PageSourceSearch

https://www.chiho.ai/_next/static/chunks/3775-6b638ba5830306eb.js

js chiho.ai collected 2026-10-05 15:30:05 UTC 1,988,773 bytes, 320 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3775],{73:(e,t,r)=>{"use strict";r.d(t,{Sl:()=>i,X:()=>a,eV:()=>o,kK:()=>s});var n=r(83315);function i(e,t){if(n.Ej(e)>t)throw new n.u({givenSize:n.Ej(e),maxSize:t})}function s(e,t){if("number"==typeof t&&t>0&&t>n.Ej(e)-1)throw new n.ii({offset:t,position:"start",size:n.Ej(e)})}function a(e,t,r){if("number"==typeof t&&"number"==typeof r&&n.Ej(e)!==r-t)throw new n.ii({offset:r,position:"end",size:n.Ej(e)})}function o(e,t={}){let{dir:r,size:i=32}=t;if(0===i)return e;let s=e.replace("0x","");if(s.length>2*i)throw new n.Fl({size:Math.ceil(s.length/2),targetSize:i,type:"Hex"});return`0x${s["right"===r?"padEnd":"padStart"](2*i,"0")}`}},77:(e,t,r)=>{"use strict";r.d(t,{D:()=>n});var n=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(n||{})},97:(e,t,r)=>{"use strict";r.d(t,{Dv:()=>A,FO:()=>y,If:()=>x,Ji:()=>d,Rv:()=>l,WL:()=>p,Yo:()=>b,ej:()=>f,fC:()=>I,iB:()=>c,kz:()=>a,l9:()=>g,pc:()=>s,sP:()=>E,v7:()=>C,v8:()=>v});var n=r(48441);let i=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function s(e){return i.test(e)}function a(e){return(0,n.Yv)(i,e)}let o=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function l(e){return o.test(e)}function c(e){return(0,n.Yv)(o,e)}let u=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function d(e){return u.test(e)}function f(e){return(0,n.Yv)(u,e)}let h=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function p(e){return h.test(e)}function y(e){return(0,n.Yv)(h,e)}let m=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function g(e){return m.test(e)}function b(e){return(0,n.Yv)(m,e)}let w=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function v(e){return w.test(e)}function x(e){return(0,n.Yv)(w,e)}let _=/^receive\(\) external payable$/;function E(e){return _.test(e)}let A=new Set(["memory","indexed","storage","calldata"]),I=new Set(["indexed"]),C=new Set(["calldata","memory","storage"])},232:(e,t,r)=>{"use strict";r.d(t,{Q:()=>s});var n=r(90320);let i=/^tuple(?<array>(\[(\d*)\])*)$/;function s(e){let t="",r=e.length;for(let s=0;s<r;s++)t+=function e(t){let r=t.type;if(i.test(t.type)&&"components"in t){r="(";let s=t.components.length;for(let n=0;n<s;n++)r+=e(t.components[n]),n<s-1&&(r+=", ");let a=(0,n.Yv)(i,t.type);return r+=`)${a?.array||""}`,e({...t,type:r})}return("indexed"in t&&t.indexed&&(r=`${r}
1 indexed`),t.name)?`${r} ${t.name}`:r}(e[s]),s!==r-1&&(t+=", ");return t}},324:(e,t,r)=>{"use strict";r.d(t,{a:()=>h});var n=r(63710),i=r(68305),s=r(93861),a=r(89502),o=r(20347),l=r(95016),c=r(29447),u=r(74869),d=r(32560),f=r(40857);async function h(e,t){let{account:r=e.account,accessList:h,authorizationList:p,chain:y=e.chain,blobVersionedHashes:m,blobs:g,data:b,gas:w,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:_,maxPriorityFeePerGas:E,nonce:A,nonceManager:I,to:C,type:S,value:P,...$}=t,k=await (async()=>{if(!r||!I||void 0!==A)return A;let t=(0,n.J)(r),i=y?y.id:await (0,c.T)(e,f.T,"getChainId")({});return await I.consume({address:t.address,chainId:i,client:e})})();(0,u.c)(t);let T=y?.formatters?.transactionRequest?.format,O=(T||l.Bv)({...(0,a.o)($,{format:T}),account:r?(0,n.J)(r):void 0,accessList:h,authorizationList:p,blobs:g,blobVersionedHashes:m,data:b,gas:w,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:_,maxPriorityFeePerGas:E,nonce:k,to:C,type:S,value:P},"fillTransaction");try{let r=await e.request({method:"eth_fillTransaction",params:[O]}),n=(y?.formatters?.transaction?.format||o.uP)(r.tx);delete n.blockHash,delete n.blockNumber,delete n.r,delete n.s,delete n.transactionIndex,delete n.v,delete n.yParity,n.data=n.input,n.gas&&(n.gas=t.gas??n.gas),n.gasPrice&&(n.gasPrice=t.gasPrice??n.gasPrice),n.maxFeePerBlobGas&&(n.maxFeePerBlobGas=t.maxFeePerBlobGas??n.maxFeePerBlobGas),n.maxFeePerGas&&(n.maxFeePerGas=t.maxFeePerGas??n.maxFeePerGas),n.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas??n.maxPriorityFeePerGas),void 0!==n.nonce&&(n.nonce=t.nonce??n.nonce);let s=await (async()=>{if("function"==typeof y?.fees?.baseFeeMultiplier){let r=await (0,c.T)(e,d.g,"getBlock")({});return y.fees.baseFeeMultiplier({block:r,client:e,request:t})}return y?.fees?.baseFeeMultiplier??1.2})();if(s<1)throw new i.sM;let a=s.toString().split(".")[1]?.length??0,l=10**a,u=e=>e*BigInt(Math.ceil(s*l))/BigInt(l);return n.feePayerSignature||(n.maxFeePerGas&&!t.maxFeePerGas&&(n.maxFeePerGas=u(n.maxFeePerGas)),n.gasPrice&&!t.gasPrice&&(n.gasPrice=u(n.gasPrice))),{raw:r.raw,transaction:{from:O.from,...n},...r.capabilities?{capabilities:r.capabilities}:{}}}catch(r){throw(0,s.p)(r,{...t,chain:e.chain})}}},651:(e,t,r)=>{"use strict";r.d(t,{$P:()=>l,My:()=>c,cK:()=>u,i3:()=>f,nj:()=>o});var n=r(59206),i=r(87601),s=r(5596);let a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function o(e,t={}){return"number"==typeof e||"bigint"==typeof e?u(e,t):"string"==typeof e?f(e,t):"boolean"==typeof e?l(e,t):c(e,t)}function l(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?((0,s.Sl)(r,{size:t.size}),(0,i.eV)(r,{size:t.size})):r}function c(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=a[e[t]];let n=`0x${r}`;return"number"==typeof t.size?((0,s.Sl)(n,{size:t.size}),(0,i.eV)(n,{dir:"right",size:t.size})):n}function u(e,t={}){let r,{signed:s,size:a}=t,o=BigInt(e);a?r=s?(1n<<8n*BigInt(a)-1n)-1n:2n**(8n*BigInt(a))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let l="bigint"==typeof r&&s?-r-1n:0;if(r&&o>r||o<l){let t="bigint"==typeof e?"n":"";throw new n.Ty({max:r?`${r}${t}`:void 0,min:`${l}${t}`,signed:s,size:a,value:`${e}${t}`})}let c=`0x${(s&&o<0?(1n<<BigInt(8*a))+BigInt(o):o).toString(16)}`;return a?(0,i.eV)(c,{size:a}):c}let d=new TextEncoder;function f(e,t={}){return c(d.encode(e),t)}},852:(e,t,r)=>{"use strict";r.d(t,{D0:()=>i,Rd:()=>n});let n=new TextEncoder,i=new TextDecoder},1232:(e,t,r)=>{"use strict";r.d(t,{y:()=>s});var n=r(84742),i=r(5596);async function s(e,{address:t,blockHash:r,blockNumber:s,blockTag:a="latest",requireCanonical:o}){let l=(0,n.O)({blockHash:r,blockNumber:s,blockTag:a,requireCanonical:o}),c=await e.request({method:"eth_getTransactionCount",params:[t,l]},{dedupe:"bigint"==typeof s||void 0!==r});return(0,i.ME)(c)}},1376:(e,t,r)=>{"use strict";r.d(t,{J:()=>l});var n=r(45897),i=r(22744),s=r(65402),a=r(82666),o=r(21394);function l(e){let{abi:t,data:r}=e,l=(0,i.di)(r,0,4),c=t.find(e=>"function"===e.type&&l===(0,s.V)((0,o.B)(e)));if(!c)throw new n.EB(l,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:c.name,args:"inputs"in c&&c.inputs&&c.inputs.length>0?(0,a.n)(c.inputs,(0,i.di)(r,4)):void 0}}},1808:(e,t,r)=>{"use strict";r.d(t,{_:()=>i});var n=r(75834);function i(e){return(0,n.useMemo)(()=>e,Object.values(e))}},2204:(e,t,r)=>{"use strict";r.d(t,{o:()=>t3});var n=r(62610),i=r(99225),s=r(64959),a=r(38417);let o=`0x${"00".repeat(32)}`;function l(e){let t,{salt:r,threshold:s,owners:a}=e;if(void 0!==r&&32!==n.Ej(r))throw new d({reason:"salt must be 32 bytes"});if(0===a.length)throw new d({reason:"owners cannot be empty"});if(a.length>255)throw new d({reason:"too many owners"});if(!Number.isInteger(Number(s)))throw new d({reason:"threshold must be an integer"});if(1>Number(s))throw new d({reason:"threshold cannot be zero"});if(Number(s)>8)throw new d({reason:"threshold exceeds max threshold"});let o=0;for(let e of a){if(!i.tf(e.owner)||0n===n.Dg(e.owner))throw new d({reason:"owner cannot be zero"});if(!Number.isInteger(Number(e.weight)))throw new d({reason:"owner weight must be an integer"});if(1>Number(e.weight))throw new d({reason:"owner weight cannot be zero"});let r=n.Dg(e.owner);if(void 0!==t&&t>=r)throw new d({reason:"owners must be strictly ascending"});t=r,o+=Number(e.weight)}if(o>255)throw new d({reason:"total owner weight exceeds u8 max"});if(Number(s)>o)throw new d({reason:"threshold exceeds total owner weight"})}function c(e){let t=[...e.owners].sort((e,t)=>
1n.Dg(e.owner)<n.Dg(t.owner)?-1:1),r={salt:e.salt?n.Ho(e.salt,32):o,threshold:e.threshold,owners:t};return l(r),r}function u(e){l(e);let t=a.So(n.xW(n.sH("tempo:multisig:account"),n.Ho(e.salt??o,32),n.oB(e.threshold,{size:1}),n.oB(e.owners.length,{size:1}),...e.owners.flatMap(e=>[e.owner,n.oB(e.weight,{size:1})]))),r=i.HT(n.di(t,12,32));if(0n===n.Dg(r))throw new d({reason:"derived account cannot be zero"});return r}class d extends s.C{constructor({reason:e}){super(`Invalid native multisig config: ${e}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MultisigConfig.InvalidConfigError"})}}var f=r(52511),h=r(18775),p=r(66049),y=r(57551);let m=(0,y.D0)(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),g=m.create(BigInt("-3")),b=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),w=(0,p.s)({a:g,b:b,Fp:m,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},h.sc),v=(0,y.D0)(BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff")),x=v.create(BigInt("-3")),_=BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef");(0,p.s)({a:x,b:_,Fp:v,n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"),h:BigInt(1),lowS:!1},h.qt);let E=(0,y.D0)(BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")),A=E.create(BigInt("-3")),I=BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00");(0,p.s)({a:A,b:I,Fp:E,n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"),h:BigInt(1),lowS:!1,allowedPrivateKeyLengths:[130,131,132]},h.Zf);var C=r(21332),S=r(31155);function P(e){let{hash:t,payload:r,publicKey:n,signature:i}=e;return w.verify(i,r instanceof Uint8Array?r:C.aD(r),S.nj(n).substring(2),{lowS:!0,...t?{prehash:!0}:{}})}var $=r(75123);function k(e,t){let r=t??("string"==typeof e?"Hex":"Bytes"),i=(()=>{if("string"==typeof e){if(e.length>3&&e.length%2!=0)throw new n.o4(e);return C.aD(e)}return e})();return function e(t,r="Hex"){if(0===t.bytes.length)return"Hex"===r?n.uK(t.bytes):t.bytes;let i=t.readByte();if(i<128&&t.decrementPosition(1),i<192){let e=T(t,i,128),s=t.readBytes(e);return"Hex"===r?n.uK(s):s}let s=T(t,i,192);var a=t,o=s,l=r;let c=a.position,u=[];for(;a.position-c<o;)u.push(e(a,l));return u}($.vt(i,{recursiveReadLimit:1/0}),r)}function T(e,t,r){if(128===r&&t<128)return 1;if(t<=r+55)return t-r;if(t===r+55+1)return e.readUint8();if(t===r+55+2)return e.readUint16();if(t===r+55+3)return e.readUint24();if(t===r+55+4)return e.readUint32();throw new s.C("Invalid RLP prefix")}function O(e,t={}){let{as:r="Hex"}=t;return function(e,t){let{as:r}=t,i=function e(t){return Array.isArray(t)?function(e){let t=e.reduce((e,t)=>e+t.length,0),r=N(t);return{length:t<=55?1+t:1+r+t,encode(n){for(let{encode:i}of(t<=55?n.pushByte(192+t):(n.pushByte(247+r),1===r?n.pushUint8(t):2===r?n.pushUint16(t):3===r?n.pushUint24(t):n.pushUint32(t)),e))i(n)}}}(t.map(t=>e(t))):function(e){let t="string"==typeof e?C.aD(e):e,r=N(t.length);return{length:1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(e){1===t.length&&t[0]<128||(t.length<=55?e.pushByte(128+t.length):(e.pushByte(183+r),1===r?e.pushUint8(t.length):2===r?e.pushUint16(t.length):3===r?e.pushUint24(t.length):e.pushUint32(t.length))),e.pushBytes(t)}}}(t)}(e),s=$.vt(new Uint8Array(i.length));return(i.encode(s),"Hex"===r)?n.uK(s.bytes):s.bytes}(e,{as:r})}function N(e){if(e<=255)return 1;if(e<=65535)return 2;if(e<=0xffffff)return 3;if(e<=0xffffffff)return 4;throw new s.C("Length is too large.")}var R=r(31168);function B(e){let{payload:t,signature:r}
1=e,{r:i,s,yParity:a}=r,o=new R.secp256k1.Signature(BigInt(i),BigInt(s)).addRecoveryBit(a).recoverPublicKey(n.HT(t).substring(2));return S.HT(o)}var D=r(21557);let M=new TextEncoder;Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((e,t)=>[t,e.charCodeAt(0)]);let U={...Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((e,t)=>[e.charCodeAt(0),t])),61:0,45:62,95:63};class j extends s.C{constructor({majorType:e}){super(`Invalid CBOR major type: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.InvalidMajorTypeError"})}}class L extends s.C{constructor({additionalInfo:e}){super(`Invalid CBOR additional info: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.InvalidAdditionalInfoError"})}}class F extends s.C{constructor(){super("64-bit integers are not supported in CBOR decoding."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.Unsupported64BitIntegerError"})}}class z extends s.C{constructor({tag:e}){super(`CBOR tagged data (tag ${e}) is not yet supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.UnsupportedTagError"})}}class q extends s.C{constructor({type:e}){super(`Invalid chunk type in indefinite-length ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.InvalidIndefiniteLengthChunkError"})}}class W extends s.C{constructor({value:e}){super(`Invalid CBOR simple value: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.InvalidSimpleValueError"})}}class H extends s.C{constructor(){super("BigInt values are not supported in CBOR encoding."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.UnsupportedBigIntError"})}}class K extends s.C{constructor({token:e}){super(`Unexpected token: ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.UnexpectedTokenError"})}}class V extends s.C{constructor({number:e}){super(`Number exceeds maximum safe integer (${Number.MAX_SAFE_INTEGER}): ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.NumberTooLargeError"})}}class G extends s.C{constructor({size:e}){super(`String length exceeds maximum (4294967295): ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.StringTooLargeError"})}}class J extends s.C{constructor({size:e}){super(`Array length exceeds maximum (4294967295): ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.ArrayTooLargeError"})}}class Y extends s.C{constructor({size:e}){super(`Object size exceeds maximum (4294967295): ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.ObjectTooLargeError"})}}class Z extends s.C{constructor({size:e}){super(`Byte string length exceeds maximum (4294967295): ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cbor.ByteStringTooLargeError"})}}function Q(e){if(void 0===e)return{length:1,encode:e=>e.pushUint8(247)};if(null===e)return{length:1,encode:e=>e.pushUint8(246)};if("boolean"==typeof e)return{length:1,encode:t=>t.pushUint8(e?245:244)};if("number"==typeof e)return Q.number(e);if("bigint"==typeof e)throw new H;if("string"==typeof e)return Q.string(e);if(Array.isArray(e))return Q.array(e);if(e instanceof Uint8Array)return Q.byteString(e);if(e instanceof ArrayBuffer)return Q.byteString(new Uint8Array(e));if(ArrayBuffer.isView(e))return Q.byteString(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));if(e instanceof Map)return Q.map(e);if("object"==typeof e)return Q.object(e);throw new K({token:String(e)})}function X(e){let t=e.readUint8(),r=t>>5,n=31&t;switch(r){case 0:return X.readUnsignedInteger(e,n);case 1:return X.readNegativeInteger(e,n);case 2:return X.readByteString(e,n);case 3:return X.readTextString(e,n);case 4:return X.readArray(e,n);case 5:return X.readMap(e,n);case 6:throw new z({tag:n});case 7:return X.readSimpleOrFloat(e,n);default:throw new j({majorType:r})}}!function(e){e.number=function(e){if(!Number.isSafeInteger(e)){let t=Math.fround(e);return Number.isNaN(e)||e===t?{length:5,encode(t){t.pushUint8(250),t.dataView.setFloat32(t.position,e,!1),t.position+=4}}:{length:9,encode(t){t.pushUint8(251),t.dataView.setFloat64(t.position,e,!1),t.position+=8}}}if(e>=0){if(e<=23)return{length:1,encode:t=>t.pushUint8(e)};if(e<=255)return{length:2,encode:t=>{t.pushUint8(24),t.pushUint8(e)}};if(e<=65535)return{length:3,encode:t=>{t.pushUint8(25),t.pushUint16(e)}};if(e<=0xffffffff)return{length:5,encode:t=>{t.pushUint8(26),t.pushUint32(e)}};throw new V({number:e.toString(10)})}let t=-1-e;if(e>=-24)return{length:1,encode:e=>e.pushUint8(32+t)};if(t<=255)return{length:2,encode:e=>{e.pushUint8(56),e.pushUint8(t)}};if(t<=65535)return{length:3,encode:e=>{e.pushUint8(57),e.pushUint16(t)}};if(t<=0xffffffff)return{length:5,encode:e=>{e.pushUint8(58),e.pushUint32(t)}};throw new V({number:e.toString(10)})},e.string=function(e){let t=C.sH(e),r=t.length;if(r<=23)return{length:1+r,encode(e){e.pushUint8(96+r),r>0&&e.pushBytes(t)}};if(r<=255)return{length:2+r,encode(e){e.pushUint8(120),e.pushUint8(r),e.pushBytes(t)}};if(r<=65535)return{length:3+r,encode(e){e.pushUint8(121),e.pushUint16(r),e.pushBytes(t)}};if(r<=0xffffffff)return{length:5+r,encode(e){e.pushUint8(122),e.pushUint32(r),e.pushBytes(t)}};throw new G({size:r})},e.array=function(t){let r=t.map(t=>e(t)),n=r.reduce((e,t)=>
1e+t.length,0),i=t.length;if(i<=23)return{length:1+n,encode(e){for(let t of(e.pushUint8(128+i),r))t.encode(e)}};if(i<=255)return{length:2+n,encode(e){for(let t of(e.pushUint8(152),e.pushUint8(i),r))t.encode(e)}};if(i<=65535)return{length:3+n,encode(e){for(let t of(e.pushUint8(153),e.pushUint16(i),r))t.encode(e)}};if(i<=0xffffffff)return{length:5+n,encode(e){for(let t of(e.pushUint8(154),e.pushUint32(i),r))t.encode(e)}};throw new J({size:i})},e.byteString=function(e){let t=e.byteLength;if(t<=23)return{length:1+t,encode(r){r.pushUint8(64+t),r.pushBytes(e)}};if(t<=255)return{length:2+t,encode(r){r.pushUint8(88),r.pushUint8(t),r.pushBytes(e)}};if(t<=65535)return{length:3+t,encode(r){r.pushUint8(89),r.pushUint16(t),r.pushBytes(e)}};if(t<=0xffffffff)return{length:5+t,encode(r){r.pushUint8(90),r.pushUint32(t),r.pushBytes(e)}};throw new Z({size:t})},e.object=function(t){let r=Object.keys(t),n=r.map(r=>({key:e(r),value:e(t[r])})),i=n.reduce((e,t)=>e+t.key.length+t.value.length,0),s=r.length;if(s<=23)return{length:1+i,encode(e){for(let t of(e.pushUint8(160+s),n))t.key.encode(e),t.value.encode(e)}};if(s<=255)return{length:2+i,encode(e){for(let t of(e.pushUint8(184),e.pushUint8(s),n))t.key.encode(e),t.value.encode(e)}};if(s<=65535)return{length:3+i,encode(e){for(let t of(e.pushUint8(185),e.pushUint16(s),n))t.key.encode(e),t.value.encode(e)}};if(s<=0xffffffff)return{length:5+i,encode(e){for(let t of(e.pushUint8(186),e.pushUint32(s),n))t.key.encode(e),t.value.encode(e)}};throw new Y({size:s})},e.map=function(t){let r=[];for(let[n,i]of t)r.push({key:e(n),value:e(i)});let n=r.reduce((e,t)=>e+t.key.length+t.value.length,0),i=t.size;if(i<=23)return{length:1+n,encode(e){for(let t of(e.pushUint8(160+i),r))t.key.encode(e),t.value.encode(e)}};if(i<=255)return{length:2+n,encode(e){for(let t of(e.pushUint8(184),e.pushUint8(i),r))t.key.encode(e),t.value.encode(e)}};if(i<=65535)return{length:3+n,encode(e){for(let t of(e.pushUint8(185),e.pushUint16(i),r))t.key.encode(e),t.value.encode(e)}};if(i<=0xffffffff)return{length:5+n,encode(e){for(let t of(e.pushUint8(186),e.pushUint32(i),r))t.key.encode(e),t.value.encode(e)}};throw new Y({size:i})}}(Q||(Q={})),function(e){function t(e,t){if(t<24)return t;if(24===t)return e.readUint8();if(25===t)return e.readUint16();if(26===t)return e.readUint32();if(27===t)throw new F;throw new L({additionalInfo:t})}e.readUnsignedInteger=function(e,r){return t(e,r)},e.readNegativeInteger=function(e,r){return -1-t(e,r)},e.readByteString=function(r,n){if(31===n){let t=[],n=0;for(;;){if(255===r.inspectUint8()){r.readUint8();break}let i=e(r);if(!(i instanceof Uint8Array))throw new q({type:"byte string"});t.push(i),n+=i.length}let i=new Uint8Array(n),s=0;for(let e of t)i.set(e,s),s+=e.length;return i}let i=t(r,n);return r.readBytes(i)},e.readTextString=function(r,n){if(31===n){let t=[];for(;;){if(255===r.inspectUint8()){r.readUint8();break}let n=e(r);if("string"!=typeof n)throw new q({type:"text string"});t.push(n)}return t.join("")}let i=t(r,n),s=r.readBytes(i);return C.dI(s)},e.readArray=function(r,n){if(31===n){let t=[];for(;;){if(255===r.inspectUint8()){r.readUint8();break}t.push(e(r))}return t}let i=t(r,n),s=[];for(let t=0;t<i;t++)s.push(e(r));return s},e.readMap=function(r,n){if(31===n){let t={};for(;;){if(255===r.inspectUint8()){r.readUint8();break}let n=e(r),i="string"==typeof n?n:String(n),s=e(r);t[i]=s}return t}let i=t(r,n),s={};for(let t=0;t<i;t++){let t=e(r),n="string"==typeof t?t:String(t),i=e(r);s[n]=i}return s},e.readSimpleOrFloat=function(e,t){if(20===t)return!1;if(21===t)return!0;if(22===t)return null;if(23!==t){if(25===t)return function(e){let t=e>>15&1,r=e>>10&31,n=1023&e;if(0===r){if(0===n)return t?-0:0;let e=n/1024*6103515625e-14;return t?-e:e}if(31===r)return 0===n?t?-1/0:1/0:NaN;let i=2**(r-15)*(1+n/1024);return t?-i:i}(e.readUint16());if(26===t){let t=e.dataView.getFloat32(e.position,!1);return e.position+=4,t}if(27===t){let t=e.dataView.getFloat64(e.position,!1);return e.position+=8,t}if(24===t){let t=e.readUint8();if(t<32)throw new W({value:t});return}throw new L({additionalInfo:t})}}}(X||(X={})),s.C,s.C,Uint8Array.from([105,171,180,181,160,222,75,198,42,42,32,31,141,37,186,233]),s.C,s.C;let ee="0x01",et="0x02",er="0x03",en="0x04",ei="0x05",es="0x7777777777777777777777777777777777777777777777777777777777777777";function ea(e){let t=ef(e);if("secp256k1"===t)return void D.vA(e.signature);if("p256"===t){let t=[];if("bigint"!=typeof e.signature?.r&&t.push("signature.r"),"bigint"!=typeof e.signature?.s&&t.pu
1sh("signature.s"),"boolean"!=typeof e.prehash&&t.push("prehash"),e.publicKey?("bigint"!=typeof e.publicKey.x&&t.push("publicKey.x"),"bigint"!=typeof e.publicKey.y&&t.push("publicKey.y")):t.push("publicKey"),t.length>0)throw new eg({envelope:e,missing:t,type:"p256"});return}if("webAuthn"===t){let t=[];if("bigint"!=typeof e.signature?.r&&t.push("signature.r"),"bigint"!=typeof e.signature?.s&&t.push("signature.s"),e.metadata?(e.metadata.authenticatorData||t.push("metadata.authenticatorData"),e.metadata.clientDataJSON||t.push("metadata.clientDataJSON")):t.push("metadata"),e.publicKey?("bigint"!=typeof e.publicKey.x&&t.push("publicKey.x"),"bigint"!=typeof e.publicKey.y&&t.push("publicKey.y")):t.push("publicKey"),t.length>0)throw new eg({envelope:e,missing:t,type:"webAuthn"});return}return"keychain"===t?void ea(e.inner):"multisig"===t?void eo(e,1):void 0}function eo(e,t){let r=[];if(e.account||r.push("account"),Array.isArray(e.signatures)||r.push("signatures"),r.length>0)throw new eg({envelope:e,missing:r,type:"multisig"});if(t>2)throw new ew({reason:"multisig nesting depth exceeds 2"});if(!i.tf(e.account))throw new ew({reason:"multisig account is invalid"});if(0n===n.Dg(e.account))throw new ew({reason:"multisig account cannot be zero"});if(0===e.signatures.length)throw new ew({reason:"multisig signatures cannot be empty"});if(e.signatures.length>8)throw new ew({reason:"multisig signatures exceed 8"});if(e.init&&(l(e.init),!i.n4(u(e.init),e.account)))throw new ew({reason:"multisig init does not derive account"});for(let r of e.signatures){let e=ef(r);if("keychain"===e)throw new ew({reason:"keychain owner approvals are not allowed"});if("multisig"===e){if(r.init)throw new ew({reason:"nested multisig owner approvals cannot carry `init`"});eo(r,t+1)}else ea(r);if(n.Ej(eh(r))>2049)throw new ew({reason:"multisig owner signature exceeds 2049 bytes"})}}function el(e){let{signature:t,root:r}=e;return"keychain"===t.type?r?t.userAddress:el({...e,signature:t.inner}):"multisig"===t.type?t.account:i.bI(function e(t){let{payload:r,signature:n}=t;switch(n.type){case"secp256k1":return B({payload:r,signature:n.signature});case"p256":case"webAuthn":return n.publicKey;case"keychain":return e({payload:r,signature:n.inner});case"multisig":throw new em({envelope:n})}}(e))}function ec(e,t){let r=e.endsWith(es.slice(2))?n.di(e,0,-n.Ej(es)):e;if(65===n.Ej(r)){let e=D.aD(r);return D.vA(e),{signature:e,type:"secp256k1"}}let s=n.di(r,0,1),a=n.di(r,1),l=n.Ej(a);if(s===ee){if(129!==l)throw new eb({reason:`Invalid P256 signature envelope size: expected 129 bytes, got ${l} bytes`,serialized:r});return{publicKey:{prefix:4,x:n.Dg(n.di(a,64,96)),y:n.Dg(n.di(a,96,128))},prehash:0!==n.Ro(n.di(a,128,129)),signature:{r:n.Dg(n.di(a,0,32)),s:n.Dg(n.di(a,32,64))},type:"p256"}}if(s===et){let e,t;if(l<128)throw new eb({reason:`Invalid WebAuthn signature envelope size: expected at least 128 bytes, got ${l} bytes`,serialized:r});let i=l-128,s=n.di(a,0,i);for(let r=37;r<i;r++){let i=n.dI(n.di(s,r));if(i.startsWith("{")&&i.endsWith("}"))try{JSON.parse(i),e=n.di(s,0,r),t=i;break}catch{}}if(!e||!t)throw new eb({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:r});return{publicKey:{prefix:4,x:n.Dg(n.di(a,i+64,i+96)),y:n.Dg(n.di(a,i+96,i+128))},metadata:{authenticatorData:e,clientDataJSON:t},signature:{r:n.Dg(n.di(a,i,i+32)),s:n.Dg(n.di(a,i+32,i+64))},type:"webAuthn"}}if(s===er||s===en)return{userAddress:n.di(a,0,20),inner:ec(n.di(a,20),t),type:"keychain",version:s===en?"v2":"v1"};if(s===ei){let e=t+1;if(e>2)throw new eb({reason:"multisig nesting depth exceeds 2",serialized:r});let s=k(a,"Hex");if(!Array.isArray(s)||2!==s.length)throw new eb({reason:"invalid multisig wire shape: expected exactly two fields",serialized:r});let[l,c]=s;if(!Array.isArray(c)||c.some(Array.isArray))throw new eb({reason:"invalid multisig signatures list",serialized:r});if(0===c.length)throw new eb({reason:"multisig signatures cannot be empty",serialized:r});if(c.length>8)throw new eb({reason:"multisig signatures exceed 8",serialized:r});for(let e of c)if(n.Ej(e)>2049)throw new eb({reason:"multisig owner signature exceeds 2049 bytes",serialized:r});if(!Array.isArray(l)&&!i.tf(l))throw new eb({reason:"invalid multisig account",serialized:r});if(Array.isArray(l)){let[e,t,i]=l;if(3!==l.length||Array.isArray(e)||32!==n.Ej(e)||Array.isArray(t)||n.Ej(t)>1||!Array.isArray(i)||i.some(e=>!Array.isArray(e)||2!==e.length||e.some(Array.isArray)||n.Ej(e[1])>1))throw new eb({reason:"invalid multisig init config",serialized:r})}let d=Array.isArray(l)?function(e){let[t,r,i]=e;return{salt:t&&"0x"!==t?n.Ho(t,32):o,threshold:"0x"===r?0:n.Ro(r),owners:i.map(e=>{let[t,r]=e;return{owner:t,weight:r&&"0x"!==r?n.Ro(r):0}})}}(l):void 0,f={type:"multisig",account:d?u(d):l,signatures:c.map(t=>ec(t,e)),...d?{init:d}:{}};return eo(f,e),f}throw new eb({reason:`Unknown signature type identifier: ${s}. Expected ${ee} (P256), ${et} (WebAuthn), ${er} (Keychain V1), ${en}
1 (Keychain V2), or ${ei} (Multisig)`,serialized:r})}function eu(e,t){if("string"==typeof e)return ec(e,0);if("object"==typeof e&&null!==e&&"r"in e&&"s"in e&&"yParity"in e)return{signature:e,type:"secp256k1"};let r=ef(e);if("multisig"===r){let{genesisConfig:t,init:n,...i}=e,s=i.account?i.account:t?u(t):i.account,a=!0===n?t:n||void 0;return{...i,account:s,signatures:i.signatures.map(e=>eu(e)),...a?{init:c(a)}:{},type:r}}return{...e,..."p256"===r?{prehash:e.prehash}:{},..."keychain"===r?{...!("object"==typeof e&&null!==e&&"version"in e&&e.version)?{version:"v2"}:{},...!("object"==typeof e&&"keyId"in e&&e.keyId)?(()=>{let r=e.inner;return"p256"===r.type||"webAuthn"===r.type?{keyId:i.bI(r.publicKey)}:"secp256k1"===r.type&&t?.payload?{keyId:i.bI(B({payload:t.payload,signature:r.signature}))}:{}})():{}}:{},type:r}}function ed(e){if("secp256k1"===e.type)return{signature:D.gX(e),type:"secp256k1"};if("p256"===e.type)return{prehash:e.preHash,publicKey:{prefix:4,x:n.Dg(e.pubKeyX),y:n.Dg(e.pubKeyY)},signature:{r:n.Dg(e.r),s:n.Dg(e.s)},type:"p256"};if("webAuthn"===e.type){let t,r,i=e.webauthnData,s=n.Ej(i);for(let e=37;e<s;e++){let s=n.dI(n.di(i,e));if(s.startsWith("{")&&s.endsWith("}"))try{JSON.parse(s),t=n.di(i,0,e),r=s;break}catch{}}if(!t||!r)throw new eb({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:i});return{metadata:{authenticatorData:t,clientDataJSON:r},publicKey:{prefix:4,x:n.Dg(e.pubKeyX),y:n.Dg(e.pubKeyY)},signature:{r:n.Dg(e.r),s:n.Dg(e.s)},type:"webAuthn"}}if("keychain"===e.type||"userAddress"in e&&"signature"in e)return{type:"keychain",userAddress:e.userAddress,inner:ed(e.signature),...e.keyId?{keyId:e.keyId}:{},...e.version?{version:e.version}:{}};if("multisig"===e.type||"signatures"in e&&("account"in e||"init"in e)){let t=void 0!==e.account,r=void 0!==e.init;if(t===r)throw new ew({reason:"RPC multisig must contain exactly one of `account` or `init`"});let n=r?c(e.init):void 0,i={type:"multisig",account:n?u(n):e.account,signatures:e.signatures.map(e=>ed(e)),...n?{init:n}:{}};return ea(i),i}throw new em({envelope:e})}function ef(e){if("object"!=typeof e||null===e)throw new em({envelope:e});if("type"in e&&e.type)return e.type;if("signature"in e&&!("publicKey"in e)&&"object"==typeof e.signature&&null!==e.signature&&"r"in e.signature&&"s"in e.signature&&"yParity"in e.signature||"r"in e&&"s"in e&&"yParity"in e)return"secp256k1";if("signature"in e&&"prehash"in e&&"publicKey"in e&&"boolean"==typeof e.prehash)return"p256";if("signature"in e&&"metadata"in e&&"publicKey"in e)return"webAuthn";if("userAddress"in e&&"inner"in e)return"keychain";if(("account"in e||"genesisConfig"in e||"init"in e)&&"signatures"in e)return"multisig";throw new em({envelope:e})}function eh(e,t={}){let r=ef(e);if("secp256k1"===r)return n.xW(D.nj(e.signature),t.magic?es:"0x");if("p256"===r)return n.xW(ee,n.oB(e.signature.r,{size:32}),n.oB(e.signature.s,{size:32}),n.oB(e.publicKey.x,{size:32}),n.oB(e.publicKey.y,{size:32}),n.oB(+!!e.prehash,{size:1}),t.magic?es:"0x");if("webAuthn"===r){let r=n.xW(e.metadata.authenticatorData,n.sH(e.metadata.clientDataJSON));return n.xW(et,r,n.oB(e.signature.r,{size:32}),n.oB(e.signature.s,{size:32}),n.oB(e.publicKey.x,{size:32}),n.oB(e.publicKey.y,{size:32}),t.magic?es:"0x")}if("keychain"===r){let r="v1"===e.version?er:en;return n.xW(r,e.userAddress,eh(e.inner),t.magic?es:"0x")}if("multisig"===r)return ea(e),n.xW(ei,O([e.init?function(e){l(e);let t=e.owners.map(e=>[e.owner,n.oB(e.weight)]);return[e.salt?n.Ho(e.salt,32):o,n.oB(e.threshold),t]}(e.init):e.account,e.signatures.map(e=>eh(e))]),t.magic?es:"0x");throw new em({envelope:e})}function ep(e){let t=ef(e);if("secp256k1"===t)return{...D.J$(e.signature),type:"secp256k1"};if("p256"===t)return{preHash:e.prehash,pubKeyX:n.oB(e.publicKey.x,{size:32}),pubKeyY:n.oB(e.publicKey.y,{size:32}),r:n.oB(e.signature.r,{size:32}),s:n.oB(e.signature.s,{size:32}),type:"p256"};if("webAuthn"===t){let t=n.xW(e.metadata.authenticatorData,n.sH(e.metadata.clientDataJSON));return{pubKeyX:n.oB(e.publicKey.x,{size:32}),pubKeyY:n.oB(e.publicKey.y,{size:32}),r:n.oB(e.signature.r,{size:32}),s:n.oB(e.signature.s,{size:32}),type:"webAuthn",webauthnData:t}}if("keychain"===t)return{type:"keychain",userAddress:e.userAddress,signature:ep(e.inner),...e.keyId?{keyId:e.keyId}:{},...e.version?{version:e.version}:{}};if("multisig"===t){ea(e);let t=e.signatures.map(e=>ep(e));return e.init?{init:{...e.init,salt:e.init.salt??o,threshold:Number(e.init.threshold),owners:e.init.owners.map(e=>({...e,weight:Number(e.weight)}))},signatures:t}:{account:e.account,signatures:t}}throw new em({envelope:e})}function ey(e,t){let{payload:r}=t,s=t.address?t.address:t.publicKey?i.bI(t.publicKey):void 0;if(!s)return!1;let o=eu(e);
1if("secp256k1"===o.type){if(!s)return!1;var l,c={address:s,payload:r,signature:o.signature};let{hash:e,payload:t}=c;return c.address?i.n4(c.address,(l={payload:t,signature:c.signature},i.bI(B(l)))):R.secp256k1.verify(c.signature,C.HT(t),S.ZJ(c.publicKey),...e?[{prehash:!0,lowS:!0}]:[])}if("p256"===o.type){let e=i.bI(o.publicKey);return!!i.n4(e,s)&&P({hash:o.prehash,publicKey:o.publicKey,payload:r,signature:o.signature})}if("webAuthn"===o.type){let e=i.bI(o.publicKey);return!!i.n4(e,s)&&function(e){let{challenge:t,metadata:r,origin:i,publicKey:s,rpId:o,signature:l}=e,{authenticatorData:c,clientDataJSON:u,userVerificationRequired:d}=r,f=C.aD(c);if(f.length<37)return!1;if(void 0!==o){let e=f.slice(0,32),t=a.sc(n.sH(o),{as:"Bytes"});if(!C.n4(e,t))return!1}let h=f[32];if((1&h)!=1||d&&(4&h)!=4||(8&h)!=8&&(16&h)==16)return!1;let p=JSON.parse(u);if("webauthn.get"!==p.type||!p.challenge||n.uK(function(e){let t=e.replace(/=+$/,""),r=t.length,n=new Uint8Array(r+3);M.encodeInto(t+"===",n);for(let e=0,r=0;e<t.length;e+=4,r+=3){let t=(U[n[e]]<<18)+(U[n[e+1]]<<12)+(U[n[e+2]]<<6)+U[n[e+3]];n[r]=t>>16,n[r+1]=t>>8&255,n[r+2]=255&t}return new Uint8Array(n.buffer,0,(r>>2)*3+(r%4&&r%4-1))}(p.challenge))!==t||void 0!==i&&!(Array.isArray(i)?i:[i]).includes(p.origin))return!1;let y=a.sc(C.sH(u),{as:"Bytes"});return P({hash:!0,payload:C.xW(f,y),publicKey:s,signature:l})}({challenge:n.HT(r),metadata:o.metadata,publicKey:o.publicKey,signature:o.signature})}throw new ev(`Unable to verify signature envelope of type "${o.type}".`)}class em extends s.C{constructor({envelope:e}){super(`Unable to coerce value (\`${f.As(e)}\`) to a valid signature envelope.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.CoercionError"})}}class eg extends s.C{constructor({envelope:e,missing:t,type:r}){super(`Signature envelope of type "${r}" is missing required properties: ${t.map(e=>`\`${e}\``).join(", ")}.
2
3Provided: ${f.As(e)}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.MissingPropertiesError"})}}class eb extends s.C{constructor({reason:e,serialized:t}){super(`Unable to deserialize signature envelope: ${e}`,{metaMessages:[`Serialized: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.InvalidSerializedError"})}}class ew extends s.C{constructor({reason:e}){super(`Invalid native multisig owner approval: ${e}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.InvalidMultisigApprovalError"})}}class ev extends s.C{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.VerificationError"})}}var ex=r(4884),e_=r(57572),eE=r(37888),eA=r(2452),eI=r(83121),eC=r(20169),eS=r(17819),eP=r(23274),e$=r(12089),ek=r(84413),eT=r(97352),eO=r(71441),eN=r(56947),eR=r(78136),eB=r(70968);let eD=[{name:"authorizeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"tuple[]",name:"limits",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]}],outputs:[]},{name:"authorizeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"tuple",name:"config",components:[{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"tuple[]",name:"limits",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"},{type:"uint64",name:"period"}]},{type:"bool",name:"allowAnyCalls"},{type:"tuple[]",name:"allowedCalls",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}]}],outputs:[]},{name:"authorizeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"tuple",name:"config",components:[{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"tuple[]",name:"limits",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"},{type:"uint64",name:"period"}]},{type:"bool",name:"allowAnyCalls"},{type:"tuple[]",name:"allowedCalls",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}]},{type:"bytes32",name:"witness"}],outputs:[]},{name:"authorizeAdminKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"bytes32",name:"witness"}],outputs:[]},{name:"burnKeyAuthorizationWitness",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"witness"}],outputs:[]},{name:"revokeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"}],outputs:[]},{name:"updateSpendingLimit",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"address",name:"token"},{type:"uint256",name:"newLimit"}],outputs:[]},{name:"setAllowedCalls",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"tuple[]",name:"scopes",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}],outputs:[]},{name:"removeAllowedCalls",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"address",name:"target"}],outputs:[]},{name:"getKey",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"}],outputs:[{type:"tuple",components:[{type:"uint8",name:"signatureType"},{type:"address",name:"keyId"},{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"bool",name:"isRevoked"}]}]},{name:"getRemainingLimit",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"},{type:"address",name:"token"}],outputs:[{type:"uint256",name:"remaining"}]},{name:"getRemainingLimitWithPeriod",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"},{type:"address",name:"token"}],outputs:[{type:"uint256",name:"remaining"},{type:"uint64",name:"periodEnd"}]},{name:"getAllowedCalls",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"}],outputs:[{type:"bool",name:"isScoped"},{type:"tuple[]",name:"scopes",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}]},{name:"isKeyAuthorizationWitnessBurned",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"witness"}],outputs:[{type:"bool"}]},{name:"isAdminKey",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"}],outputs:[{type:"bool"}]},{name:"getTransactionKey",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"KeyAuthorized",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0},{type:"uint8",name:"signatureType"},{type:"uint64",name:"expiry"}]},{name:"AdminKeyAuthorized",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0}]},{name:"KeyRevoked",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0}]},{name:"SpendingLimitUpdated",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0}
3,{type:"address",name:"token",indexed:!0},{type:"uint256",name:"newLimit"}]},{name:"AccessKeySpend",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0},{type:"address",name:"token",indexed:!0},{type:"uint256",name:"amount"},{type:"uint256",name:"remainingLimit"}]},{name:"KeyAuthorizationWitness",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"bytes32",name:"witness",indexed:!0}]},{name:"KeyAuthorizationWitnessBurned",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"bytes32",name:"witness",indexed:!0}]},{name:"UnauthorizedCaller",type:"error",inputs:[]},{name:"KeyAlreadyExists",type:"error",inputs:[]},{name:"KeyNotFound",type:"error",inputs:[]},{name:"KeyExpired",type:"error",inputs:[]},{name:"SpendingLimitExceeded",type:"error",inputs:[]},{name:"InvalidSpendingLimit",type:"error",inputs:[]},{name:"InvalidSignatureType",type:"error",inputs:[]},{name:"ZeroPublicKey",type:"error",inputs:[]},{name:"ExpiryInPast",type:"error",inputs:[]},{name:"KeyAlreadyRevoked",type:"error",inputs:[]},{name:"SignatureTypeMismatch",type:"error",inputs:[{type:"uint8",name:"expected"},{type:"uint8",name:"actual"}]},{name:"CallNotAllowed",type:"error",inputs:[]},{name:"InvalidCallScope",type:"error",inputs:[]},{name:"InvalidKeyId",type:"error",inputs:[]},{name:"InvalidKeyAuthorizationWitness",type:"error",inputs:[]},{name:"KeyAuthorizationWitnessAlreadyBurned",type:"error",inputs:[]},{name:"LegacyAuthorizeKeySelectorChanged",type:"error",inputs:[{type:"bytes4",name:"newSelector"}]}],eM=[{name:"recover",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"address",name:"signer"}]},{name:"verify",type:"function",stateMutability:"view",inputs:[{type:"address",name:"signer"},{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"bool"}]},{name:"verifyKeychain",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"bool"}]},{name:"verifyKeychainAdmin",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"bool"}]},{name:"InvalidFormat",type:"error",inputs:[]},{name:"InvalidSignature",type:"error",inputs:[]}];[...eD,...eM];var eU=r(16203);function ej(e){return e.startsWith("tempo")?function(e){if(!e.startsWith("tempox"))throw new eL({address:e});let t=e.slice(6);return n.vA(t,{strict:!0}),{address:i.cM(t)}}(e).address:e}class eL extends s.C{constructor({address:e}){super(`Tempo address "${e}" has an invalid prefix. Expected "tempox".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TempoAddress.InvalidPrefixError"})}}function eF(e,t={}){if("keyId"in e)return ez(e);void 0!==e.witness&&eG(e.witness),e.signature&&eJ(e.signature);let r={...e,address:ej(e.address),...e.limits?{limits:e.limits.map(e=>({...e,token:ej(e.token)}))}:{},...e.scopes?{scopes:e.scopes.map(e=>({...e,address:ej(e.address),selector:eV(e.selector),...e.recipients?{recipients:e.recipients.map(e=>ej(e))}:{}}))}:{}};if(t.signature){let e=eu(t.signature);return eJ(e),{...r,signature:e}}return r}function ez(e){let{allowedCalls:t,chainId:r,keyId:i,expiry:s,limits:a,keyType:o}=e,l=e.witness??void 0,c=e.isAdmin??void 0,u=e.account??void 0,d=ed(e.signature);eJ(d),void 0!==l&&eG(l);let f=t?t.flatMap(e=>e.selectorRules&&0!==e.selectorRules.length?e.selectorRules.map(t=>{var r;return{address:e.target,selector:"string"==typeof(r=t.selector)?r:Array.isArray(r)?n.uK(new Uint8Array(r)):r,...t.recipients&&t.recipients.length>0?{recipients:t.recipients}:{}}
3}):[{address:e.target}]):void 0;return{address:i,chainId:"0x"===r?0n:n.Dg(r),...null!=s?{expiry:Number(s)}:{},limits:a?.map(e=>({token:e.token,limit:BigInt(e.limit),...e.period&&eK(e.period)>0?{period:eK(e.period)}:{}})),...f?{scopes:f}:{},signature:d,type:o,...void 0!==l?{witness:l}:{},...void 0!==u&&c?{account:u,isAdmin:!0}:{}}}function eq(e){let{address:t,chainId:r,scopes:n,expiry:i,limits:s,witness:a,isAdmin:o,account:l}=e;void 0!==a&&eG(a);let c=(()=>{if(e.signature)return eJ(e.signature),eh(e.signature)})(),u=(()=>{switch(e.type){case"secp256k1":return"0x";case"p256":return"0x01";case"webAuthn":return"0x02";default:throw Error(`Invalid key type: ${e.type}`)}})(),d=s?.map(e=>{let t=[e.token,eW(e.limit)];return e.period&&e.period>0&&t.push(eH(e.period)),t}),f=(()=>{if(!n)return;let e=new Map;for(let t of n){let r=t.address;e.has(r)||e.set(r,[]),t.selector&&e.get(r).push([eV(t.selector),t.recipients??[]])}return[...e.entries()].map(([e,t])=>[e,t.map(([e,t])=>[e,t])])})(),h=void 0!==a||o||void 0!==l,p=[{value:null!=i&&0!==i?eH(i):void 0,placeholder:"0x"},{value:d,placeholder:h?"0x":[]},{value:f,placeholder:"0x"},{value:a,placeholder:"0x"},{value:o?"0x01":void 0,placeholder:"0x"},{value:l,placeholder:"0x"}],y=-1;for(let e=p.length-1;e>=0;e--)if(void 0!==p[e].value){y=e;break}let m=p.slice(0,y+1).map(({value:e,placeholder:t})=>e??t);return[[eW(r),u,t,...m],...c?[c]:[]]}function eW(e){return 0n===e?"0x":n.oB(e)}function eH(e){return 0===e?"0x":n.oB(e)}function eK(e){return"0x"===e?0:n.Ro(e)}function eV(e){if(e)return e.startsWith("0x")?e:eU.go(e)}function eG(e){if(32!==n.Ej(e))throw new eZ(e)}function eJ(e){if("keychain"===e.type||"multisig"===e.type)throw new eX(e.type)}function eY(e){return void 0===e||"0x"===e}class eZ extends Error{constructor(e){super(`Witness \`${e}\` must be exactly 32 bytes (got ${n.Ej(e)} bytes).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidWitnessSizeError"})}}class eQ extends Error{constructor(e){super(`Admin marker \`${e}\` is invalid; expected \`0x01\` (TIP-1049).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidAdminMarkerError"})}}class eX extends Error{constructor(e){super(`Signature type \`${e}\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, or \`webAuthn\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidSignatureTypeError"})}}async function e0(e,t){var r;let{chainId:n,key:s,expiry:o,limits:l,scopes:c,witness:u,admin:d}=t,{accessKeyAddress:f,keyType:h}="accessKeyAddress"in(r=s)?{accessKeyAddress:r.accessKeyAddress,keyType:r.keyType}:"publicKey"in r&&r.publicKey?{accessKeyAddress:i.bI(S.aD(r.publicKey)),keyType:r.type}:{accessKeyAddress:r.address,keyType:r.type},p="accessKey"===e.source&&"accessKeyAddress"in e,y=p?{account:e.address}:{},m=d?{}:{expiry:o,limits:l,scopes:c},g=function(e){let[t]=eq(e),r=O(t);return a.So(r)}({address:f,chainId:n,type:h,witness:u,...d?{isAdmin:!0}:{},...y,...m});return eF({address:f,chainId:n,signature:eu(p?await e.sign({hash:g,raw:!0}):await e.sign({hash:g})),type:h,...u?{witness:u}:{},...d?{isAdmin:!0}:{},...y,...m})}let e1="0xaAAAaaAA00000000000000000000000000000000",e2=["genesis","t0","t1","t1a","t1b","t1c","t2","t3","t4","t5","t6"];var e5=r(72693);function e6(e){return{...e,data:(0,e5.p)(e),to:e.address}}let e3={0:"secp256k1",1:"p256",2:"webAuthn"}
3,e8={true:"limited",false:"unlimited"};async function e4(e,t){return e4.inner(eN.v,e,t)}async function e9(e,t){return e9.inner(eR.E,e,t)}async function e7(e,t){let{account:r=e.account,accessKey:n,...i}=t;if(!r)throw Error("account is required.");let s=(0,eT.J)(r),a=await (0,eO.J)(e,{...i,account:null,...e7.call({account:s.address,accessKey:n})});return{address:a.keyId,keyType:e3[a.signatureType]??"secp256k1",expiry:a.expiry,spendPolicy:e8[`${a.enforceLimits}`],isRevoked:a.isRevoked}}async function te(e,t){let{account:r=e.account,accessKey:n,token:i,...s}=t;if(!r)throw Error("account is required.");let a=(0,eT.J)(r),o=e.chain?.hardfork;if(o&&e2.indexOf(o)<e2.indexOf("t3"))return{remaining:await (0,eO.J)(e,{...s,...te.call({account:a.address,accessKey:n,token:i})}),periodEnd:void 0};let[l,c]=await (0,eO.J)(e,{...s,...te.callWithPeriod({account:a.address,accessKey:n,token:i})});return{remaining:l,periodEnd:c}}async function tt(e,t){let{account:r=e.account,accessKey:n,...i}=t;if(!r)throw Error("account is required.");let s=(0,eT.J)(r);return(0,eO.J)(e,{...i,account:null,...tt.call({account:s.address,accessKey:n})})}async function tr(e,t){let{account:r=e.account,witness:n,...i}=t;if(!r)throw Error("account is required.");let s=(0,eT.J)(r);return(0,eO.J)(e,{...i,account:null,...tr.call({account:s.address,witness:n})})}async function tn(e,t){return tn.inner(eR.E,e,t)}async function ti(e,t){return ti.inner(eR.E,e,t)}async function ts(e,t){let{account:r,admin:n,hash:i,signature:s,...a}=t;return(0,eO.J)(e,{...a,...ts.call({account:r,admin:n,hash:i,signature:s})})}function ta(e){return"string"==typeof e?e:e.accessKeyAddress}!function(e){e.inner=async function(e,t,r){let{accessKey:n,admin:i,chainId:s=t.chain?.id,expiry:a,limits:o,scopes:l,witness:c,...u}=r,d=u.account??t.account;if(!d)throw Error("account is required.");if(!s)throw Error("chainId is required.");let f=(0,eT.J)(d),h=await e0(f,{chainId:BigInt(s),key:n,admin:i,expiry:a,limits:o,scopes:l,witness:c});return await e(t,{...u,keyAuthorization:h})},e.extractEvent=function(e){let[t]=(0,eB.p)({abi:eD,logs:e,eventName:"KeyAuthorized",strict:!0});if(!t)throw Error("`KeyAuthorized` event not found.");return t}}(e4||(e4={})),function(e){async function t(t,r,n){let{witness:i,...s}=n,a=e.call({witness:i});return await t(r,{...s,...a})}e.inner=t,e.call=function(e){let{witness:t}=e;return e6({address:e1,abi:eD,functionName:"burnKeyAuthorizationWitness",args:[t]})},e.extractEvent=function(e){let[t]=(0,eB.p)({abi:eD,logs:e,eventName:"KeyAuthorizationWitnessBurned",strict:!0});if(!t)throw Error("`KeyAuthorizationWitnessBurned` event not found.");return t}}(e9||(e9={})),(e7||(e7={})).call=function(e){let{account:t,accessKey:r}=e;return e6({address:e1,abi:eD,functionName:"getKey",args:[t,ta(r)]})},function(e){e.call=function(e){let{account:t,accessKey:r,token:n}=e;return e6({address:e1,abi:eD,functionName:"getRemainingLimit",args:[t,ta(r),n]})},e.callWithPeriod=function(e){let{account:t,accessKey:r,token:n}=e;return e6({address:e1,abi:eD,functionName:"getRemainingLimitWithPeriod",args:[t,ta(r),n]})}}(te||(te={})),(tt||(tt={})).call=function(e){let{account:t,accessKey:r}=e;return e6({address:e1,abi:eD,functionName:"isAdminKey",args:[t,ta(r)]})},(tr||(tr={})).call=function(e){let{account:t,witness:r}=e;return e6({address:e1,abi:eD,functionName:"isKeyAuthorizationWitnessBurned",args:[t,r]})},function(e){async function t(t,r,n){let{accessKey:i,...s}=n,a=e.call({accessKey:i});return await t(r,{...s,...a})}e.inner=t,e.call=function(e){let{accessKey:t}=e;return e6({address:e1,abi:eD,functionName:"revokeKey",args:[ta(t)]})},e.extractEvent=function(e){let[t]=(0,eB.p)({abi:eD,logs:e,eventName:"KeyRevoked",strict:!0});if(!t)throw Error("`KeyRevoked` event not found.");return t}}(tn||(tn={})),function(e){async function t(t,r,n){let{accessKey:i,token:s,limit:a,...o}=n,l=e.call({accessKey:i,token:s,limit:a});return await t(r,{...o,...l})}e.inner=t,e.call=function(e){let{accessKey:t,token:r,limit:n}=e;return e6({address:e1,abi:eD,functionName:"updateSpendingLimit",args:[ta(t),r,n]})},e.extractEvent=function(e){let[t]=(0,eB.p)({abi:eD,logs:e,eventName:"SpendingLimitUpdated",strict:!0});if(!t)throw Error("`SpendingLimitUpdated` event not found.");return t}}(ti||(ti={})),(ts||(ts={})).call=function(e){let{account:t,admin:r=!0,hash:n,signature:i}=e;return e6({address:"0x5165300000000000000000000000000000000000",abi:eM,functionName:r?"verifyKeychainAdmin":"verifyKeychain",args:[t,n,i]})};var to=r(82762);let tl={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"},tc={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function tu(e){let{address:t,chainId:r,nonce:n}=e,i=ed(e.signature);return{address:t,chainId:Number(r),nonce:BigInt(n),signature:i}}let td={...tl,tempo:"0x76"},tf={...tc,"0x76":"tempo"};function th(e){if("string"==typeof e){let t=ej(e);return i.vA(t),t}let t=n.oB(e,{size:18});return n.xW("0x20c0",t)}class tp extends s.C{constructor({storageKey:e}){super(`Size for storage key "${e}
3" is invalid. Expected 32 bytes. Got ${n.Ej(e)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccessList.InvalidStorageKeySizeError"})}}let ty={wei:0,gwei:9,szabo:12,finney:15,ether:18};function tm(e,t="wei"){return function(e,t=0){let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1));let[i,s]=[(r=r.padStart(t,"0")).slice(0,r.length-t),r.slice(r.length-t)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}(e,ty.gwei-ty[t])}s.C;class tg extends s.C{constructor({feeCap:e}={}){super(`The fee cap (\`maxFeePerGas\`/\`maxPriorityFeePerGas\`${e?` = ${tm(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.FeeCapTooHighError"})}}s.C;class tb extends s.C{constructor({chainId:e}){super(void 0!==e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidChainIdError"})}}class tw extends s.C{constructor({attributes:e,serialized:t,type:r}){let n=Object.entries(e).map(([e,t])=>void 0===t?e:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${r}" was provided.`,{metaMessages:[`Serialized Transaction: "${t}"`,n.length>0?`Missing Attributes: ${n.join(", ")}`:""].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidSerializedError"})}}class tv extends s.C{constructor({maxPriorityFeePerGas:e,maxFeePerGas:t}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${tm(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${t?` = ${tm(t)} gwei`:""}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}let tx="tempo";function t_(e){let{calls:t,chainId:r,maxFeePerGas:n,maxPriorityFeePerGas:s,validBefore:a,validAfter:o}=e;if(!t||0===t.length)throw new tC;if("number"==typeof a&&"number"==typeof o&&a<=o)throw new tS({validBefore:a,validAfter:o});if(t)for(let e of t)e.to&&i.vA(e.to,{strict:!1});if(r<=0)throw new tb({chainId:r});if(n&&BigInt(n)>2n**256n-1n)throw new tg({feeCap:n});if(s&&n&&s>n)throw new tv({maxFeePerGas:n,maxPriorityFeePerGas:s})}function tE(e,t={}){let{feePayerSignature:r,signature:s}=t,o="string"==typeof e?function(e){let t=k(n.di(e,1),"Hex"),[r,s,o,l,c,u,d,f,h,p,y,m,g,b,w]=t,v=Array.isArray(b)?b:void 0,x=v?w:b;if(13!==t.length&&14!==t.length&&15!==t.length)throw new tw({attributes:{authorizationList:g,chainId:r,maxPriorityFeePerGas:s,maxFeePerGas:o,gas:l,calls:c,accessList:u,keyAuthorization:v,nonceKey:d,nonce:f,validBefore:h,validAfter:p,feeToken:y,feePayerSignatureOrSender:m,...t.length>12?{signature:x}:{}},serialized:e,type:tx});let _={chainId:Number(r),type:tx};n.tf(l)&&"0x"!==l&&(_.gas=BigInt(l)),n.tf(f)&&(_.nonce="0x"===f?0n:BigInt(f)),n.tf(o)&&"0x"!==o&&(_.maxFeePerGas=BigInt(o)),n.tf(s)&&"0x"!==s&&(_.maxPriorityFeePerGas=BigInt(s)),n.tf(d)&&(_.nonceKey="0x"===d?0n:BigInt(d)),n.tf(h)&&"0x"!==h&&(_.validBefore=Number(h)),n.tf(p)&&"0x"!==p&&(_.validAfter=Number(p)),n.tf(y)&&"0x"!==y&&(_.feeToken=y),c&&"0x"!==c&&(_.calls=c.map(e=>{let[t,r,n]=e,i={};return t&&"0x"!==t&&(i.to=t),r&&"0x"!==r&&(i.value=BigInt(r)),n&&"0x"!==n&&(i.data=n),i})),u?.length!==0&&"0x"!==u&&(_.accessList=function(e){let t=[];for(let r=0;r<e.length;r++){let[s,o]=e[r];s&&i.vA(s,{strict:!1}),t.push({address:s,storageKeys:o.map(e=>a.tf(e)?e:n.Mr(e))})}return t}(u)),g?.length!==0&&"0x"!==g&&(_.authorizationList=function(e){let t=[];for(let r of e)t.push(function(e){let[t,r,n,i]=e,s={address:r,chainId:"0x"===t?0:Number(t),nonce:"0x"===n?0n:BigInt(n)};return i&&(s.signature=ec(i,0)),function(e,t={}){if("string"==typeof e.chainId)return tu(e);let r={...e,address:ej(e.address)};return t.signature?{...r,signature:t.signature}:r}(s)}(r));return t}(g)),"0x"!==m&&void 0!==m&&("0x00"===m||i.tf(m)?(_.feePayerSignature=null,i.tf(m)&&(_.from=m)):_.feePayerSignature=D.Bm(m)),v&&(_.keyAuthorization=function(e){let[t,r]=e,[i,s,a,...o]=t,l=(()=>{switch(s){case"0x":case"0x00":return"secp256k1";case"0x01":return"p256";case"0x02":return"webAuthn";default:throw Error(`Invalid key type: ${s}`)}})(),[c,u,d,f,h,p]=o,y=eY(c)?void 0:eK(c)||void 0,m=Array.isArray(u)&&u.length>0?u.map(e=>{var t;let[r,n,i]=e;return{token:r,limit:"0x"===(t=n)?0n:BigInt(t),...void 0!==i?{period:eK(i)}:{}}}):void 0,g=Array.isArray(d)?d.flatMap(e=>{let[t,r]=e;return Array.isArray(r)&&0!==r.length?r.map(e=>{let[r,n]=e;return{address:t,selector:r,...Array.isArray(n)&&n.length>0?{recipients:n}:{}}}):[{address:t}]}):void 0,b=eY(f)?void 0:f;void 0!==b&&eG(b);let w=(()=>
3{if(!eY(h)){if("0x01"!==h)throw new eQ(h);return!0}})(),v=eY(p)?void 0:p,x={address:a,chainId:"0x"===i?0n:n.Dg(i),type:l,...void 0!==y?{expiry:y}:{},...void 0!==m?{limits:m}:{},...void 0!==g?{scopes:g}:{},...void 0!==b?{witness:b}:{},...void 0!==v&&w?{account:v,isAdmin:!0}:{}};if(r){let e=ec(r,0);eJ(e),x.signature=e}return eF(x)}(v));let E=x?ec(x,0):void 0;if(E&&(_={..._,signature:E}),!_.from&&E)try{_.from=el({payload:tI(tE(_)),signature:E,root:!0})}catch{}return t_(_),_}(e):e;return o.from&&(o.from=ej(o.from)),o.calls&&(o.calls=o.calls.map(e=>({...e,...e.to?{to:ej(e.to)}:{}}))),t_(o),{...o,...s?{signature:eu(s)}:{},...r?{feePayerSignature:D.HT(r)}:{},type:"tempo"}}function tA(e,t={}){let{accessList:r,authorizationList:s,calls:a,chainId:o,feeToken:l,gas:c,keyAuthorization:u,nonce:d,nonceKey:f,maxFeePerGas:h,maxPriorityFeePerGas:p,validBefore:y,validAfter:m}=e;t_(e);let g=function(e){if(!e||0===e.length)return[];let t=[];for(let{address:r,storageKeys:s}of e){for(let e=0;e<s.length;e++)if(32!==n.Ej(s[e]))throw new tp({storageKey:s[e]});r&&i.vA(r,{strict:!1}),t.push([r,s])}return t}(r),b=t.signature||e.signature,w=function(e){if(!e||0===e.length)return[];let t=[];for(let r of e)t.push(function(e){let{address:t,chainId:r,nonce:i}=e,s=e.signature?eh(e.signature):void 0;return[r?n.oB(r):"0x",t,i?n.oB(i):"0x",...s?[s]:[]]}(r));return t}(s),v=a.map(e=>[e.to?ej(e.to):"0x",e.value?n.oB(e.value):"0x",e.data??"0x"]),x=!1,_=(()=>{if(t.sender)return t.sender;if("feePayer"===t.format&&b){let t=eu(b);if("keychain"===t.type)return t.userAddress;if("p256"===t.type||"webAuthn"===t.type)return i.bI(t.publicKey);if("secp256k1"===t.type){var r;return r={payload:tI(tE(e)),signature:t.signature},i.bI(B(r))}}let n=void 0!==t.feePayerSignature?t.feePayerSignature:e.feePayerSignature;return null===n?(x=!0,"0x00"):n?D._7(n):"0x"})(),E=[n.oB(o),p?n.oB(p):"0x",h?n.oB(h):"0x",c?n.oB(c):"0x",v,g,f?n.oB(f):"0x",d?n.oB(d):"0x","number"==typeof y?n.oB(y):"0x","number"==typeof m?n.oB(m):"0x",x||"bigint"!=typeof l&&"string"!=typeof l?"0x":th(l),_,w,...u?[eq(u)]:[],...b?[eh(eu(b))]:[]];return n.xW("feePayer"===t.format?"0x78":"0x76",O(E))}function tI(e,t={}){let r=function(e,t={}){let r=t.presign?tA({...e,signature:void 0,...void 0!==e.feePayerSignature?{feePayerSignature:null}:{}}):tA(e);return a.So(r)}(e,{presign:!0});return t.from?a.So(n.xW("0x04",r,ej(t.from))):r}class tC extends s.C{constructor(){super("Calls list cannot be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.CallsEmptyError"})}}class tS extends s.C{constructor({validBefore:e,validAfter:t}){super(`validBefore (${e}) must be greater than validAfter (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.InvalidValidityWindowError"})}}var tP=r(80384),t$=r(66471),tk=r(44037),tT=r(54722),tO=r(44775),tN=r(58797),tR=r(49369),tB=r(30406),tD=r(4538),tM=r(14782),tU=r(81505),tj=r(23971),tL=r(15520),tF=r(40198),tz=r(97282),tq=r(31445),tW=r(60336),tH=r(21047),tK=r(22744),tV=r(36174);function tG(e){let{chainId:t,maxPriorityFeePerGas:r,maxFeePerGas:n,to:i}=e;if(t<=0)throw new tz.qD({chainId:t});if(i&&!(0,tW.P)(i))throw new tj.M({address:i});if(n&&n>eE.Ao)throw new tq.BG({maxFeePerGas:n});if(r&&n&&r>n)throw new tq.lN({maxFeePerGas:n,maxPriorityFeePerGas:r})}function tJ(e){if(!e||0===e.length)return[];let t=[];for(let r=0;r<e.length;r++){let{address:n,storageKeys:i}=e[r];for(let e=0;e<i.length;e++)if(i[e].length-2!=64)throw new t$.fZ({storageKey:i[e]});if(!(0,tW.P)(n,{strict:!1}))throw new tj.M({address:n});t.push([n,i])}return t}function tY(e,t){let r=(0,tP.L)(e);return"eip1559"===r?function(e,t){let{chainId:r,gas:n,nonce:i,to:s,value:a,maxFeePerGas:o,maxPriorityFeePerGas:l,accessList:c,data:u}=e;tG(e);let d=tJ(c),f=[(0,tk.cK)(r),i?(0,tk.cK)(i):"0x",l?(0,tk.cK)(l):"0x",o?(0,tk.cK)(o):"0x",n?(0,tk.cK)(n):"0x",s??"0x",a?(0,tk.cK)(a):"0x",u??"0x",d,...tZ(e,t)];return(0,tB.aP)(["0x02",(0,tM.EQ)(f)])}(e,t):"eip2930"===r?function(e,t){let{chainId:r,gas:n,data:i,nonce:s,to:a,value:o,accessList:l,gasPrice:c}=e,{chainId:u,maxPriorityFeePerGas:d,gasPrice:f,maxFeePerGas:h,to:p}=e;if(u<=0)throw new tz.qD({chainId:u});if(p&&!(0,tW.P)(p))throw new tj.M({address:p});if(d||h)throw new tL.C("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(f&&f>eE.Ao)throw new tq.BG({maxFeePerGas:f});let y=tJ(l),m=[(0,tk.cK)(r),s?(0,tk.cK)(s):"0x",c?(0,tk.cK)(c):"0x",n?(0,tk.cK)(n):"0x",a??"0x",o?(0,tk.cK)(o):"0x",i??"0x",y,...tZ(e,t)];return(0,tB.aP)(["0x01",(0,tM.EQ)(m)])}(e,t):"eip4844"===r?function(e,t){let{chainId:r,gas:n,nonce:i,to:s,value:a,maxFeePerBlobGas:o,maxFeePerGas:l,maxPriorityFeePerGas:c,accessList:u,data:d}=e,{blobVersionedHashes:f}=e;if(f){if(0===f.length)throw new tF.zF;for(let e of f){let t=(0,tH.E)(e),r=(0,tV.ME)((0,tK.di)(e,0,1));if(32!==t)throw new tF.uP({hash:e,size:t});if(r!==tU.E)throw new tF.PK({hash:e,version:r})}}tG(e);let h=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&(void 0===h||void 0===p)){let t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map(e=>(0,tk.My)(e)),r=e.kzg,n=(0,tT.S)({blobs:t,kzg:r});if(void 0===h&&(h=(0,tN.d)({commitments:n})),void 0===p){let e=(0,tO.t)({blobs:t,commitments:n,kzg:r});p=(0,tR.T)({blobs:t,commitments:n,proofs:e})}}let y=tJ(u),m=[(0,tk.cK)(r),i?(0,tk.cK)(i):"0x",c?(0,tk.cK)(c):"0x",l?(0,tk.cK)(l):"0x",n?(0,tk.cK)(n):"0x",s??"0x",a?(0,tk.cK)(a):"0x",d??"0x",y,o?(0,tk.cK)(o):"0x",h??[],...tZ(e,t)],g=[],b=[],w=[];if(p)for(let e=0;e<p.length;e++){let{blob:t,commitment:r,proof:n}=p[e];g.push(t),b.push(r),w.push(n)}return(0,tB.aP)(["0x03",p?(0,tM.EQ)([m,g,b,w]):(0,tM.EQ)(m)])}(e,t):"eip7702"===r?function(e,t){let{authorizationList:r,chainId:n,gas:i,nonce:s,to:a,value:o,maxFeePerGas:l,maxPriorityFeePerGas:c,accessList:u,data:d}=e,{authorizationList:f}=e;if(f)for(let e of f){let{chainId:t}=e,r=e.address;if(!(0,tW.P)(r))throw new tj.M({address:r});if(t<0)throw new tz.qD({chainId:t})}tG(e);let h=tJ(u),p=function(e){if(!e||0===e.length)return[];let t=[];for(let r of e){let{chainId:e,nonce:n,...i}=r,s=r.address;t.push([e?(0,tk.nj)(e):"0x",s,n?(0,tk.nj)(n):"0x",...tZ({},i)])}return t}(r);return(0,tB.aP)(["0x04",(0,tM.EQ)([(0,tk.cK)(n),s?(0,tk.cK)(s):"0x",c?(0,tk.cK)(c):"0x",l?(0,tk.cK)(l):"0x",i?(0,tk.cK)(i):"0x",a??"0x",o?(0,tk.cK)(o):"0x",d??"0x",h,p,...tZ(e,t)])])}(e,t):function(e,t){let{chainId:r=0,gas:n,data:i,nonce:s,to:a,value:o,gasPrice:l}=e,{chainId:c,maxPriorityFeePerGas:u,gasPrice:d,maxFeePerGas:f,to:h}=e;if(h&&!(0,tW.P)(h))throw new tj.M({address:h});if(void 0!==c&&c<=0)throw new tz.qD({chainId:c});if(u||f)throw new tL.C("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(d&&d>eE.Ao)throw new tq.BG({maxFeePerGas:d});let p=[s?(0,tk.cK)(s):"0x",l?(0,tk.cK)(l):"0x",n?(0,tk.cK)(n):"0x",a??"0x",o?(0,tk.cK)(o):"0x",i??"0x"];if(t){let e=(()=>
3{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n);if(r>0)return BigInt(2*r)+BigInt(35n+t.v-27n);let e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new t$.zW({v:t.v});return e})(),n=(0,tD.B)(t.r),i=(0,tD.B)(t.s);p=[...p,(0,tk.cK)(e),"0x00"===n?"0x":n,"0x00"===i?"0x":i]}else r>0&&(p=[...p,(0,tk.cK)(r),"0x","0x"]);return(0,tM.EQ)(p)}(e,t)}function tZ(e,t){let r=t??e,{v:n,yParity:i}=r;if(void 0===r.r||void 0===r.s||void 0===n&&void 0===i)return[];let s=(0,tD.B)(r.r),a=(0,tD.B)(r.s);return["number"==typeof i?i?(0,tk.cK)(1):"0x":0n===n?"0x":1n===n?(0,tk.cK)(1):27n===n?"0x":(0,tk.cK)(1),"0x00"===s?"0x":s,"0x00"===a?"0x":a]}function tQ(e){let t=e.account;return t?.keyType&&"secp256k1"!==t.keyType||t?.source==="accessKey"||t?.source==="multisig"||void 0!==e.calls||void 0!==e.feePayer||void 0!==e.feePayerSignature||void 0!==e.feeToken||void 0!==e.keyAuthorization||void 0!==e.multisig||void 0!==e.nonceKey||void 0!==e.signature||void 0!==e.signatures||void 0!==e.validBefore||void 0!==e.validAfter?"tempo":e.type?e.type:(0,tP.L)(e)}function tX(e){try{let t=tQ(e);return"tempo"===t}catch{return!1}}async function t0(e,t){if(!tX(e)){if(t&&"type"in t&&"secp256k1"!==t.type)throw Error("Unsupported signature type. Expected `secp256k1` but got `"+t.type+"`.");if(t&&"type"in t){let{r,s:i,yParity:s}=t?.signature;return tY(e,{r:n.oB(r,{size:32}),s:n.oB(i,{size:32}),yParity:s})}return tY(e,t)}if("tempo"===tQ(e))return t1(e,t);throw Error("Unsupported transaction type")}async function t1(e,t){let r=e.signature?e.signature:t&&"type"in t?t:t?eu({r:BigInt(t.r),s:BigInt(t.s),yParity:Number(t.yParity)}):void 0,{chainId:i,feePayer:s,nonce:o,...l}=e,c=(()=>{let t=e.feePayerSignature;return t?{r:BigInt(t.r),s:BigInt(t.s),yParity:Number(t.yParity)}:null===t||s?null:void 0})(),d=void 0!==e.feePayerSignature&&null!==e.feePayerSignature,f={...l,calls:l.calls?.length?l.calls:[{to:l.to||(l.data&&"0x"!==l.data?void 0:"0x0000000000000000000000000000000000000000"),value:l.value,data:l.data}],chainId:Number(i),feePayerSignature:c,type:"tempo",...o?{nonce:BigInt(o)}:{}},h={...f};(!0!==s||r&&c)&&("object"!=typeof s||r)&&(r||!d)||delete h.feeToken;let p=(()=>{if(r)return r;if(!e.multisig||!e.signatures)return;let t=function(e){let{payload:t,signatures:r}=e,i=function(e){let{payload:t}=e,r="account"in e&&e.account?e.account:u(e.genesisConfig);return a.So(n.xW(n.sH("tempo:multisig:signature"),n.HT(t),r))}("genesisConfig"in e&&e.genesisConfig?{payload:t,genesisConfig:e.genesisConfig}:{payload:t,account:e.account});return r.map(e=>({key:n.Dg(el({payload:i,signature:e})),signature:e})).sort((e,t)=>e.key<t.key?-1:+(e.key>t.key)).map(e=>e.signature)}({payload:tI(tE(h)),signatures:e.signatures.map(e=>eu(e)),genesisConfig:e.multisig});return eu({genesisConfig:e.multisig,signatures:t,...o||e.nonceKey?{}:{init:!0}})})();if(p&&"object"==typeof e.feePayer){let t=tE(f,{signature:p}),r=e.from??el({payload:tI(t),root:!0,signature:p}),n=function(e,t){let r=ej(t.sender),n=tA({...e,signature:void 0},{sender:r,format:"feePayer"});return a.So(n)}(t,{sender:r}),i=await e.feePayer.sign({hash:n});return tA(t,{feePayerSignature:D.HT(i)})}return!0===s||!p&&d?p&&c?tA(h,{signature:p}):p?tA(h,{format:"feePayer",sender:e.from,signature:p}):tA(h,{feePayerSignature:null}):tA(h,{feePayerSignature:void 0,signature:p})}function t2(e){if(!e)return e;let t=(e.length-2)/2;return t<=4?e:n.oB(t,{size:2})}let t5=new Map;async function t6(e){t5.set(e,(t5.get(e)??0)+1),await Promise.resolve();let t=(t5.get(e)??0)>1;return queueMicrotask(()=>{let t=t5.get(e)??0;t<=1?t5.delete(e):t5.set(e,t-1)}),t}let t3={blockTime:1e3,extendSchema:(0,eI.i)(),formatters:{transaction:(0,eC.gU)({exclude:["aaAuthorizationList"],format:function(e){if(!tX(e))return(0,eC.uP)(e);let t=null==e.blockTimestamp?void 0:BigInt(e.blockTimestamp),{feePayerSignature:r,gasPrice:i,nonce:s,...a}=function(e,t={}){if(!e)return null;let r=function(e,t={}){if(!e)return null;let r=D.o6(e),n={...e,...r};return n.blockNumber=e.blockNumber?BigInt(e.blockNumber):null,"blockTimestamp"in e&&(n.blockTimestamp=e.blockTimestamp?BigInt(e.blockTimestamp):null===e.blockTimestamp?null:void 0),n.data=e.input,n.gas=BigInt(e.gas??0n),n.nonce=BigInt(e.nonce??0n),n.transactionIndex=e.transactionIndex?Number(e.transactionIndex):null,n.value=
3BigInt(e.value??0n),e.authorizationList&&(n.authorizationList=to.G_(e.authorizationList)),e.chainId&&(n.chainId=Number(e.chainId)),e.gasPrice&&(n.gasPrice=BigInt(e.gasPrice)),e.maxFeePerBlobGas&&(n.maxFeePerBlobGas=BigInt(e.maxFeePerBlobGas)),e.maxFeePerGas&&(n.maxFeePerGas=BigInt(e.maxFeePerGas)),e.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=BigInt(e.maxPriorityFeePerGas)),e.type&&(n.type=tc[e.type]??e.type),r&&(n.v=D.el(r.yParity)),n}(e);return r.type=tf[e.type],e.aaAuthorizationList&&(r.authorizationList=e.aaAuthorizationList.map(e=>tu(e)),delete r.aaAuthorizationList),e.calls&&(r.calls=e.calls.map(e=>({to:e.to,value:e.value&&"0x"!==e.value?BigInt(e.value):void 0,data:e.input||e.data||"0x"}))),e.feeToken&&(r.feeToken=e.feeToken),e.nonceKey&&(r.nonceKey=BigInt(e.nonceKey)),e.signature&&(r.signature=ed(e.signature)),e.validAfter&&(r.validAfter=Number(e.validAfter)),e.validBefore&&(r.validBefore=Number(e.validBefore)),e.keyAuthorization&&(r.keyAuthorization=ez(e.keyAuthorization)),e.feePayerSignature&&(r.feePayerSignature=D.gX(e.feePayerSignature),r.feePayerSignature.v=D.el(r.feePayerSignature.yParity)),r}(e);return{...a,accessList:a.accessList,...void 0!==t&&{blockTimestamp:t},feePayerSignature:r?{r:n.oB(r.r,{size:32}),s:n.oB(r.s,{size:32}),v:BigInt(r.v??27),yParity:r.yParity}:void 0,nonce:Number(s),typeHex:td[a.type],type:a.type}}}),transactionReceipt:(0,eS.WB)({format:function(e){return(0,eS.uL)(e)}}),transactionRequest:(0,eP.bm)({format:function(e,t){let r=e.account?(0,eT.J)(e.account):void 0;if(!tX(e))return(0,eP.Bv)(e,t);t&&(e.calls=e.calls??[{to:e.to||(e.data&&"0x"!==e.data?void 0:"0x0000000000000000000000000000000000000000"),value:e.value,data:e.data}]),!0!==e.feePayer||e.feePayerSignature||delete e.feeToken;let{multisig:i,multisigInit:s,multisigSignatureCount:a,signatures:o,...l}=e,c=function(e){let t=function(e){let t={};return void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.authorizationList&&(t.authorizationList=to.lh(e.authorizationList)),void 0!==e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&(t.blobs=e.blobs),void 0!==e.chainId&&(t.chainId=n.oB(e.chainId)),void 0!==e.data?(t.data=e.data,t.input=e.data):void 0!==e.input&&(t.data=e.input,t.input=e.input),void 0!==e.from&&(t.from=e.from),void 0!==e.gas&&(t.gas=n.oB(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=n.oB(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=n.oB(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=n.oB(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=n.oB(e.maxPriorityFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=n.oB(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=n.oB(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=tl[e.type]||e.type),void 0!==e.value&&(t.value=n.oB(e.value)),t}({...e,authorizationList:void 0});e.authorizationList&&(t.authorizationList=e.authorizationList.map(e=>(function(e){let{address:t,chainId:r,nonce:i,signature:s}=e;return{address:t,chainId:n.oB(r),nonce:n.oB(i),signature:ep(s)}})(e))),e.calls?t.calls=e.calls.map(e=>({to:e.to?ej(e.to):e.to,value:e.value?n.oB(e.value):"0x",data:e.data??"0x"})):(e.to||e.data||e.value)&&(t.calls=[{to:e.to?ej(e.to):void 0,value:e.value?n.oB(e.value):"0x",data:e.data??"0x"}]),void 0!==e.feeToken&&(t.feeToken=th(e.feeToken)),e.keyAuthorization&&(t.keyAuthorization=function(e){let{address:t,scopes:r,chainId:i,expiry:s,limits:a,type:o,signature:l,witness:c,isAdmin:u,account:d}=e;eJ(l),void 0!==c&&eG(c);let f=(()=>{if(!r)return;let e=new Map;for(let t of r){let r=t.address;e.has(r)||e.set(r,[]),t.selector&&e.get(r).push({selector:eV(t.selector),...t.recipients&&t.recipients.length>0?{recipients:t.recipients}:{}}
3)}return[...e.entries()].map(([e,t])=>({target:e,...t.length>0?{selectorRules:t}:{}}))})();return{chainId:0n===i?"0x":n.oB(i),expiry:"number"==typeof s?n.oB(s):null,keyId:ej(t),keyType:o,limits:a?.map(({token:e,limit:t,period:r})=>({token:e,limit:n.oB(t),...r?{period:eH(r)}:{}})),signature:ep(l),...f?{allowedCalls:f}:{},...void 0!==c?{witness:c}:{},...u?{isAdmin:!0}:{},...void 0!==d?{account:d}:{}}}(e.keyAuthorization)),void 0!==e.validBefore&&(t.validBefore=n.oB(e.validBefore)),void 0!==e.validAfter&&(t.validAfter=n.oB(e.validAfter));let r="random"===e.nonceKey?n.yT(6):"bigint"==typeof e.nonceKey?n.oB(e.nonceKey):void 0;return r&&(t.nonceKey=r),(void 0!==e.calls||void 0!==e.feePayer||void 0!==e.feeToken||void 0!==e.keyAuthorization||void 0!==e.nonceKey||void 0!==e.validBefore||void 0!==e.validAfter||"tempo"===e.type)&&(t.type=td.tempo,delete t.data,delete t.input,delete t.to,delete t.value),t}({...l,type:"tempo"});"estimateGas"===t&&(c.maxFeePerGas=void 0,c.maxPriorityFeePerGas=void 0),c.to=void 0,c.data=void 0,c.value=void 0;let[u,d]=(()=>{let t=r&&"keyType"in r?r.keyType:r?.source;return t?"webAuthn"===t?["webAuthn","0x0578"]:["p256","secp256k1"].includes(t)?[t,void 0]:[e.keyType,t2(e.keyData)]:[e.keyType,t2(e.keyData)]})(),f=r&&"accessKeyAddress"in r?r.accessKeyAddress:e.keyId;return r&&(c.from=r.address),{...c,...s?{multisigInit:s}:{},...void 0!==a?{multisigSignatureCount:a}:{},...e.capabilities?{capabilities:e.capabilities}:{},...d?{keyData:d}:{},...f?{keyId:f}:{},...u?{keyType:u}:{},...void 0!==e.feePayer?{feePayer:"object"==typeof e.feePayer?(0,eT.J)(e.feePayer):e.feePayer}:{},..."feePayerSignature"in e&&void 0!==e.feePayerSignature?{feePayerSignature:e.feePayerSignature}:{}}}})},prepareTransactionRequest:[async(e,{client:t,phase:r})=>{if("afterFillParameters"===r)return e.feePayer&&(e.keyAuthorization?.signature.type==="webAuthn"?e.gas=(e.gas??0n)+20000n:e.account?.source==="accessKey"&&(e.gas=(e.gas??0n)+10000n)),e;let i=e.multisig??(e.account?.source==="multisig"?e.account.config:void 0);if(i){let t=c(i);e.multisig=t,e.from=u(t),e.multisigInit={salt:t.salt??o,threshold:Number(t.threshold),owners:t.owners.map(e=>({owner:e.owner,weight:Number(e.weight)}))},e.multisigSignatureCount??=function(e){let t=Number(e.threshold),r=e.owners.map(e=>Number(e.weight)).sort((e,t)=>t-e),n=0;for(let[e,i]of r.entries())if((n+=i)>=t)return e+1;return r.length}(t),e.account?.source!=="multisig"&&delete e.account}if(!e.keyAuthorization&&e.account?.source==="accessKey"){let r=e.account.keyAuthorizationManager;if(r){let n=e.chainId??e.chain?.id;if(void 0!==n){let i=e.account.address,s=e.account.accessKeyAddress,a={address:i,accessKey:s,chainId:n},o=await r.get(a);if(o){let n=BigInt(Math.floor(Date.now()/1e3));if(null!=o.expiry&&BigInt(o.expiry)<=n)await r.remove(a);else{let l=await (0,e$.T)(t,e7,"getMetadata")({account:i,accessKey:s});(0,eA.h)(l.address,s)&&!l.isRevoked&&l.expiry>n?await r.remove(a):e.keyAuthorization=o}}}}}return await (async()=>{if("expiring"===e.nonceKey)return!0;if(i)return!1;if(e.feePayer&&void 0===e.nonceKey)return!0;let t=e.account?.address;return!!t&&void 0===e.nonceKey&&await t6(t)})()?(e.nonceKey=eE.Ao,e.nonce=0,void 0===e.validAfter&&(e.validAfter=function(){let e=BigInt(Math.floor(Date.now()/1e3))-60n;return e<=0n?0:Number(BigInt(n.yT(8))%e)}()),void 0===e.validBefore&&(e.validBefore=Math.floor(Date.now()/1e3)+25)):void 0!==e.nonceKey&&(e.nonce="number"==typeof e.nonce?e.nonce:0),!e.feeToken&&e.chain?.feeToken&&(e.feeToken=e.chain.feeToken),e},{runAt:["beforeFillTransaction","afterFillParameters"]}],serializers:{transaction:(e,t)=>t0(e,t)},async verifyHash(e,t){let{address:r,hash:i,signature:s,mode:a}=t,o=(()=>
3{if("string"==typeof s)try{return ec(s,0)}catch{return}})();if(o){if(o?.type==="keychain"&&"allowAccessKey"===a){let s="v2"===o.version?(0,ek.S)(n.xW("0x04",i,r)):i,a=(()=>{try{return el({payload:s,signature:o.inner})}catch{return}})();if(!a)return!1;let l=await e7(e,{account:r,accessKey:a,blockHash:t.blockHash,blockNumber:t.blockNumber,blockTag:t.blockTag,requireCanonical:t.requireCanonical});return!(l.isRevoked||l.expiry<=BigInt(Math.floor(Date.now()/1e3)))&&ey(o.inner,{address:a,payload:s})}if("p256"===o.type||"webAuthn"===o.type){let n=await (0,ex.Q)(e,{address:r,blockHash:t.blockHash,blockNumber:t.blockNumber,blockTag:t.blockTag,requireCanonical:t.requireCanonical});if(!n||"0xef01007702c00000000000000000000000000000000000"===n)return ey(o,{address:r,payload:i})}}return await (0,e$.T)(e,e_.KK,"verifyHash")({...t,chain:null})}}},2367:(e,t,r)=>{"use strict";r.d(t,{PUP:()=>b,Q7D:()=>w,YsN:()=>f,_mM:()=>g});var n=r(13569),i=r(85361),s=r(6274),a=r(5635),o=r(8971),l=r(21008),c=(e=>(e[e.Uninitialized=0]="Uninitialized",e[e.Initialized=1]="Initialized",e[e.Frozen=2]="Frozen",e))(c||{}),u=(e=>(e[e.MintTokens=0]="MintTokens",e[e.FreezeAccount=1]="FreezeAccount",e[e.AccountOwner=2]="AccountOwner",e[e.CloseAccount=3]="CloseAccount",e))(u||{}),d=(e=>(e[e.CreateAssociatedToken=0]="CreateAssociatedToken",e[e.CreateAssociatedTokenIdempotent=1]="CreateAssociatedTokenIdempotent",e[e.RecoverNestedAssociatedToken=2]="RecoverNestedAssociatedToken",e))(d||{}),f="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",h=(e=>(e[e.Mint=0]="Mint",e[e.Token=1]="Token",e[e.Multisig=2]="Multisig",e))(h||{}),p=(e=>(e[e.InitializeMint=0]="InitializeMint",e[e.InitializeAccount=1]="InitializeAccount",e[e.InitializeMultisig=2]="InitializeMultisig",e[e.Transfer=3]="Transfer",e[e.Approve=4]="Approve",e[e.Revoke=5]="Revoke",e[e.SetAuthority=6]="SetAuthority",e[e.MintTo=7]="MintTo",e[e.Burn=8]="Burn",e[e.CloseAccount=9]="CloseAccount",e[e.FreezeAccount=10]="FreezeAccount",e[e.ThawAccount=11]="ThawAccount",e[e.TransferChecked=12]="TransferChecked",e[e.ApproveChecked=13]="ApproveChecked",e[e.MintToChecked=14]="MintToChecked",e[e.BurnChecked=15]="BurnChecked",e[e.InitializeAccount2=16]="InitializeAccount2",e[e.SyncNative=17]="SyncNative",e[e.InitializeAccount3=18]="InitializeAccount3",e[e.InitializeMultisig2=19]="InitializeMultisig2",e[e.InitializeMint2=20]="InitializeMint2",e[e.GetAccountDataSize=21]="GetAccountDataSize",e[e.InitializeImmutableOwner=22]="InitializeImmutableOwner",e[e.AmountToUiAmount=23]="AmountToUiAmount",e[e.UiAmountToAmount=24]="UiAmountToAmount",e))(p||{});function y(e,t){return t=>{if(!t.value)return Object.freeze({address:e,role:n.Uv.READONLY});let r=t.isWritable?n.Uv.WRITABLE:n.Uv.READONLY;return Object.freeze({address:function(e){if(!e)throw Error("Expected a Address.");return"object"==typeof e&&"address"in e?e.address:Array.isArray(e)?e[0]:e}(t.value),role:m(t.value)?(0,n.MR)(r):r,...m(t.value)?{signer:t.value}:{}})}}function m(e){return!!e&&"object"==typeof e&&"address"in e&&(0,i.Pl)(e)}async function g(e,t={}){let{programAddress:r="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"}=t;return await (0,s.o0)({programAddress:r,seeds:[(0,s.jw)().encode(e.owner),(0,s.jw)().encode(e.tokenProgram),(0,s.jw)().encode(e.mint)]})}function b(e,t){let r=t?.programAddress??"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",n={payer:{value:e.payer??null,isWritable:!0},ata:{value:e.ata??null,isWritable:!0},owner:{value:e.owner??null,isWritable:!1},mint:{value:e.mint??null,isWritable:!1},systemProgram:{value:e.systemProgram??null,isWritable:!1},tokenProgram:{value:e.tokenProgram??null,isWritable:!1}};n.tokenProgram.value||(n.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let i=y(r);return Object.freeze({accounts:[i(n.payer),i(n.ata),i(n.owner),i(n.mint),i(n.systemProgram),i(n.tokenProgram)],data:(0,a.FU)((0,o.a5)([["discriminator",(0,l.Qe)()]]),e=>({...e,discriminator:1})).encode({}),programAddress:r})}function w(e,t){let r=t?.programAddress??f,i={source:{value:e.source??null,isWritable:!0},destination:{value:e.destination??null,isWritable:!0},authority:{value:e.authority??null,isWritable:!1}},s={...e},c=(s.multiSigners??[]).map(e=>({address:e.address,role:n.Uv.READONLY_SIGNER,signer:e})),u=y(r);return Object.freeze({accounts:[u(i.source),u(i.destination),u(i.authority),...c],data:(0,a.FU)((0,o.a5)([["discriminator",(0,l.Qe)()],["amount",(0,l.eC)()]]),e=>({...e,discriminator:3})).encode(s),programAddress:r})}},2452:(e,t,r)=>{"use strict";r.d(t,{h:()=>s});var n=r(23971),i=r(60336);function s(e,t){if(!(0,i.P)(e,{strict:!1}))throw new n.M({address:e});if(!(0,i.P)(t,{strict:!1}))throw new n.M({address:t});return e.toLowerCase()===t.toLowerCase()}},2494:(e,t,r)=>{"use strict";r.d(t,{b:()=>c});var n=r(75834),i=r(20888),s=r(26514),a="horizontal",o=["horizontal","vertical"],l=n.forwardRef((e,t)=>
3{var r;let{decorative:n,orientation:l=a,...c}=e,u=(r=l,o.includes(r))?l:a;return(0,s.jsx)(i.sG.div,{"data-orientation":u,...n?{role:"none"}:{"aria-orientation":"vertical"===u?u:void 0,role:"separator"},...c,ref:t})});l.displayName="Separator";var c=l},2801:e=>{function t(e){return(0x100000000+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else if("string"==typeof e)t=new TextEncoder().encode(e);else throw Error("Input must be an string, Buffer or Uint8Array");return t},toHex:function(e){return Array.prototype.map.call(e,function(e){return(e<16?"0":"")+e.toString(16)}).join("")},debugPrint:function(e,r,n){let i="\n"+e+" = ";for(let s=0;s<r.length;s+=2){if(32===n)i+=t(r[s]).toUpperCase(),i+=" ",i+=t(r[s+1]).toUpperCase();else if(64===n)i+=t(r[s+1]).toUpperCase(),i+=t(r[s]).toUpperCase();else throw Error("Invalid size "+n);s%6==4?i+="\n"+Array(e.length+4).join(" "):s<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){let n=new Date().getTime(),i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;let s=new Date().getTime();console.log("Generated random input in "+(s-n)+"ms"),n=s;for(let s=0;s<r;s++){let r=e(i),s=new Date().getTime(),a=s-n;n=s,console.log("Hashed in "+a+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/1048576/(a/1e3)*100)/100+" MB PER SECOND")}}}},2807:(e,t,r)=>{"use strict";var n,i,s,a,o=Object.defineProperty,l=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})},c={84532:{usdcAddress:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",usdcName:"USDC"},8453:{usdcAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",usdcName:"USD Coin"},43113:{usdcAddress:"0x5425890298aed601595a70AB815c96711a31Bc65",usdcName:"USD Coin"},43114:{usdcAddress:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",usdcName:"USD Coin"},4689:{usdcAddress:"0xcdf79194c6c285077a58da47641d4dbe51f63542",usdcName:"Bridged USDC"},103:{usdcAddress:"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",usdcName:"USDC"},101:{usdcAddress:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",usdcName:"USDC"},1328:{usdcAddress:"0x4fcf1784b31630811181f670aea7a7bef803eaed",usdcName:"USDC"},1329:{usdcAddress:"0xe15fc38f6d8c56af07bbcbe3baf5708a2bf42392",usdcName:"USDC"},137:{usdcAddress:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",usdcName:"USD Coin"},80002:{usdcAddress:"0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582",usdcName:"USDC"},3338:{usdcAddress:"0xbbA60da06c2c5424f03f7434542280FCAd453d10",usdcName:"USDC"},2741:{usdcAddress:"0x84a71ccd554cc1b02749b35d22f684cc8ec987e1",usdcName:"Bridged USDC"},11124:{usdcAddress:"0xe4C7fBB0a626ed208021ccabA6Be1566905E2dFc",usdcName:"Bridged USDC"},1514:{usdcAddress:"0xF1815bd50389c46847f0Bda824eC8da914045D14",usdcName:"Bridged USDC"},41923:{usdcAddress:"0x12a272A581feE5577A5dFa371afEB4b2F3a8C2F8",usdcName:"Bridged USDC (Stargate)"},0x135a9d92:{usdcAddress:"0x2e08028E3C4c2356572E096d8EF835cD5C6030bD",usdcName:"Bridged USDC (SKALE Bridge)"}},u=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"authorizer",type:"address"},{indexed:!0,internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"AuthorizationCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"authorizer",type:"address"},{indexed:!0,internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"AuthorizationUsed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_account",type:"address"}],name:"Blacklisted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newBlacklister",type:"address"}],name:"BlacklisterChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"burner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newMasterMinter",type:"address"}],name:"MasterMinterChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"minter",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"minter",type:"address"},{indexed:!1,internalType:"uint256",name:"minterAllowedAmount",type:"uint256"}],name:"MinterConfigured",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldMinter",type:"address"}],name:"MinterRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousOwner",type:"address"},{indexed:!1,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[],name:"Pause",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newAddress",type:"address"}],name:"PauserChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newRescuer",type:"address"}],name:"RescuerChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_account",type:"address"}],name:"UnBlacklisted",type:"event"},{anonymous:!1,inputs:[],name:"Unpause",type:"event"},{inputs:[],name:"CANCEL_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"RECEIVE_WITH_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TRANSFER_WITH_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"authorizationState",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}
3],name:"blacklist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"blacklister",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"cancelAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"cancelAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"},{internalType:"uint256",name:"minterAllowedAmount",type:"uint256"}],name:"configureMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"currency",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"decrement",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"increment",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"tokenName",type:"string"},{internalType:"string",name:"tokenSymbol",type:"string"},{internalType:"string",name:"tokenCurrency",type:"string"},{internalType:"uint8",name:"tokenDecimals",type:"uint8"},{internalType:"address",name:"newMasterMinter",type:"address"},{internalType:"address",name:"newPauser",type:"address"},{internalType:"address",name:"newBlacklister",type:"address"},{internalType:"address",name:"newOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"newName",type:"string"}],name:"initializeV2",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"lostAndFound",type:"address"}],name:"initializeV2_1",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"accountsToBlacklist",type:"address[]"},{internalType:"string",name:"newSymbol",type:"string"}],name:"initializeV2_2",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}],name:"isBlacklisted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"isMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"masterMinter",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_to",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"}],name:"minterAllowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"pauser",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"receiveWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"receiveWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"}],name:"removeMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20",name:"tokenContract",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"rescueERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rescuer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"transferWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"transferWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}],name:"unBlacklist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newBlacklister",type:"address"}],name:"updateBlacklister",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newMasterMinter",type:"address"}],name:"updateMasterMinter",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newPauser",type:"address"}],name:"updatePauser",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newRescuer",type:"address"}],name:"updateRescuer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"}],d=r(96212),f=r(21178),h=r(71719),p=r(48197),y=r(14487),m=r(324),g=r(40857),b=r(67008),w=r(41726),v=r(92710),x=r(21989),_=r(63710),E=r(92594),A=r(10439),I=r(61349),C=r(29447),S=r(69697);async function P(e,t){return P.internal(e,S.v,"sendTransaction",t)}(P||(P={})).internal=async function(e,t,r,n){let{abi:i,account:s=e.account,address:a,args:o,functionName:l,...c}=n;if(void 0===s)throw new E.T({docsPath:"/docs/contract/writeContract"});let u=s?(0,_.J)(s):null,d=(0,A.p)({abi:i,args:o,functionName:l});try{return await (0,C.T)(e,t,r)({data:d,to:a,account:u,...c})}catch(e){throw(0,I.j)(e,{abi:i,address:a,args:o,docsPath:"/docs/contract/writeContract",functionName:l,sender:u?.address})}};var $=r(93062);async function k(e,t){return k.inner(P,e,t)}!function(e){async function t(t,r,n){return await t(r,{...n,...e.call(r,n)})}async function r(t,r){return(0,v.W)(t,{...(0,$.th)(r),...e.call(t,r)})}async function n(t,r){return(0,x.v)(t,{...(0,$.th)(r),...e.call(t,r)})}e.inner=t,e.call=function(e,t){return(0,$.mj)(function(e,t){let{amount:r,spender:n,token:i}=t,{address:s,decimals:a}=(0,$.E7)(e,{token:i});return{abi:b.xw,address:s,args:[n,(0,$.Yr)(r,a)],functionName:"approve"}}(e,t))}
3,e.estimateGas=r,e.simulate=n,e.extractEvent=function(e){let[t]=(0,w.p)({abi:b.xw,logs:e,eventName:"Approval",strict:!0});if(!t)throw Error("`Approval` event not found.");return t}}(k||(k={}));var T=r(99808),O=r(99838),N=r(68145),R=r(9652),B=r(48409),D=r(50016),M=r(93861),U=r(89502),j=r(95016),L=r(13108),F=r(74869),z=r(62495),q=r(29421),W=r(89534);let H=new L.A(128);async function K(e,t){let r,{account:n=e.account,assertChainId:i=!0,chain:s=e.chain,accessList:a,authorizationList:o,blobs:l,data:c,dataSuffix:u="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,gas:d,gasPrice:f,maxFeePerBlobGas:h,maxFeePerGas:p,maxPriorityFeePerGas:y,nonce:m,pollingInterval:b,throwOnReceiptRevert:w,type:v,value:x,...A}=t,I=t.timeout??Math.max((s?.blockTime??0)*3,5e3);if(void 0===n)throw new E.T({docsPath:"/docs/actions/wallet/sendTransactionSync"});let S=n?(0,_.J)(n):null;try{(0,F.c)(t);let n=await (async()=>t.to?t.to:null!==t.to&&o&&o.length>0?await (0,R.g)({authorization:o[0]}).catch(()=>{throw new O.C("`to` is required. Could not infer from `authorizationList`.")}):void 0)();if(S?.type==="json-rpc"||null===S){let t;null!==s&&(t=await (0,C.T)(e,g.T,"getChainId")({}),i&&(0,B.v)({currentChainId:t,chain:s}));let r=e.chain?.formatters?.transactionRequest?.format,_=(r||j.Bv)({...(0,U.o)(A,{format:r}),accessList:a,account:S,authorizationList:o,blobs:l,chainId:t,data:u?(0,D.xW)([c??"0x",u]):c,gas:d,gasPrice:f,maxFeePerBlobGas:h,maxFeePerGas:p,maxPriorityFeePerGas:y,nonce:m,to:n,type:v,value:x},"sendTransaction"),E=H.get(e.uid),P=E?"wallet_sendTransaction":"eth_sendTransaction",$=await (async()=>{try{return await e.request({method:P,params:[_]},{retryCount:0})}catch(t){if(!1===E)throw t;if("InvalidInputRpcError"===t.name||"InvalidParamsRpcError"===t.name||"MethodNotFoundRpcError"===t.name||"MethodNotSupportedRpcError"===t.name)return await e.request({method:"wallet_sendTransaction",params:[_]},{retryCount:0}).then(t=>(H.set(e.uid,!0),t)).catch(r=>{if("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name)throw H.set(e.uid,!1),t;throw r});throw t}})(),k=await (0,C.T)(e,z.n,"waitForTransactionReceipt")({checkReplacement:!1,hash:$,pollingInterval:b,timeout:I});if(w&&"reverted"===k.status)throw new N.Sq({receipt:k});return k}if(S?.type==="local"){if(S.nonceManager&&void 0===m){let t=A.chainId,n=await (async()=>"number"==typeof t?t:s?s.id:(0,C.T)(e,g.T,"getChainId")({}))();r={address:S.address,chainId:n}}let i=await (0,C.T)(e,q.ft,"prepareTransactionRequest")({account:S,accessList:a,authorizationList:o,blobs:l,chain:s,data:u?(0,D.xW)([c??"0x",u]):c,gas:d,gasPrice:f,maxFeePerBlobGas:h,maxFeePerGas:p,maxPriorityFeePerGas:y,nonce:m,nonceManager:S.nonceManager,parameters:[...q.MM,"sidecars"],type:v,value:x,...A,to:n}),b=s?.serializers?.transaction,_=await S.signTransaction(i,{serializer:b});return await (0,C.T)(e,W.s,"sendRawTransactionSync")({serializedTransaction:_,throwOnReceiptRevert:w,timeout:t.timeout})}if(S?.type==="smart")throw new E.Z({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new E.Z({docsPath:"/docs/actions/wallet/sendTransactionSync",type:S?.type})}catch(e){if(e instanceof E.Z)throw e;throw!r||e instanceof N.Sq||S?.nonceManager?.reset(r),(0,M.p)(e,{...t,account:S,chain:t.chain||void 0})}}async function V(e,t){return P.internal(e,K,"sendTransactionSync",t)}async function G(e,t){let{amount:r,token:n,throwOnReceiptRevert:i=!0}=t,{decimals:s}=(0,$.E7)(e,{token:n}),a=(0,$.Pw)(r,s),o=await k.inner(V,e,{...t,throwOnReceiptRevert:i}),{args:l}=k.extractEvent(o.logs);return{...l,...void 0===a?{}:{decimals:a,formatted:(0,T.J)(l.value,a)},receipt:o}}async function J(e,t){return J.inner(P,e,t)}async function Y(e,t){let{amount:r,token:n,throwOnReceiptRevert:i=!0}=t,{decimals:s}=(0,$.E7)(e,{token:n}),a=(0,$.Pw)(r,s),o=await J.inner(V,e,{...t,throwOnReceiptRevert:i}),{args:l}=J.extractEvent(o.logs);return{...l,...void 0===a?{}:{decimals:a,formatted:(0,T.J)(l.value,a)},receipt:o}}!function(e){async function t(t,r,n){return await t(r,{...n,...e.call(r,n)})}async function r(t,r){return(0,v.W)(t,{...(0,$.th)(r),...e.call(t,r)})}async function n(t,r){return(0,x.v)(t,{...(0,$.th)(r),...e.call(t,r)})}e.inner=t,e.call=function(e,t){return(0,$.mj)(function(e,t){let{amount:r,from:n,to:i,token:s}=t,{address:a,decimals:o}=(0,$.E7)(e,{token:s}),l=(0,$.Yr)(r,o);return n?{abi:b.xw,address:a,args:[n,i,l],functionName:"transferFrom"}:{abi:b.xw,address:a,args:[i,l],functionName:"transfer"}}(e,t))}
3,e.estimateGas=r,e.simulate=n,e.extractEvent=function(e){let[t]=(0,w.p)({abi:b.xw,logs:e,eventName:"Transfer",strict:!0});if(!t)throw Error("`Transfer` event not found.");return t}}(J||(J={}));var Z=r(651);async function Q(e,{chain:t}){let{id:r,name:n,nativeCurrency:i,rpcUrls:s,blockExplorers:a}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:(0,Z.cK)(r),chainName:n,nativeCurrency:i,rpcUrls:s.default.http,blockExplorerUrls:a?Object.values(a).map(({url:e})=>e):void 0}]},{dedupe:!0,retryCount:0})}var X=r(57813),ee=r(48717);async function et(e){return e.account?.type==="local"?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map(e=>(0,ee.o)(e))}var er=r(52510);async function en(e,t={}){let{account:r=e.account,chainId:n}=t,i=r?(0,_.J)(r):void 0,s=n?[i?.address,[(0,Z.cK)(n)]]:[i?.address],a=await e.request({method:"wallet_getCapabilities",params:s}),o={};for(let[e,t]of Object.entries(a))for(let[r,n]of(o[Number(e)]={},Object.entries(t)))"addSubAccount"===r&&(r="unstable_addSubAccount"),o[Number(e)][r]=n;return"number"==typeof n?o[n]:o}async function ei(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}var es=r(90517);async function ea(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(e=>(0,ee.b)(e))}async function eo(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}var el=r(36684),ec=r(77864);async function eu(e,t){let{chain:r=e.chain}=t,n=t.timeout??Math.max((r?.blockTime??0)*3,5e3),i=await (0,C.T)(e,el.yM,"sendCalls")(t);return await (0,C.T)(e,ec.c,"waitForCallsStatus")({...t,id:i.id,timeout:n})}var ed=r(3581);async function ef(e,t){let{id:r}=t;await e.request({method:"wallet_showCallsStatus",params:[r]})}async function eh(e,t){let{account:r=e.account}=t;if(!r)throw new E.T({docsPath:"/docs/eip7702/signAuthorization"});let n=(0,_.J)(r);if(!n.signAuthorization)throw new E.Z({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});let i=await (0,es.h)(e,t);return n.signAuthorization(i)}async function ep(e,{account:t=e.account,message:r}){if(!t)throw new E.T({docsPath:"/docs/actions/wallet/signMessage"});let n=(0,_.J)(t);if(n.signMessage)return n.signMessage({message:r});let i="string"==typeof r?(0,Z.i3)(r):r.raw instanceof Uint8Array?(0,Z.nj)(r.raw):r.raw;return e.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function ey(e,t){let{account:r=e.account,chain:n=e.chain,...i}=t;if(!r)throw new E.T({docsPath:"/docs/actions/wallet/signTransaction"});let s=(0,_.J)(r);(0,F.c)({account:s,...t});let a=await (0,C.T)(e,g.T,"getChainId")({});null!==n&&(0,B.v)({currentChainId:a,chain:n});let o=n?.formatters||e.chain?.formatters,l=o?.transactionRequest?.format||j.Bv;return s.signTransaction?s.signTransaction({...i,account:s,chainId:a},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...l({...i,account:s},"signTransaction"),chainId:(0,Z.cK)(a),from:s.address}]},{retryCount:0})}var em=r(3859);async function eg(e,t){let{account:r=e.account,domain:n,message:i,primaryType:s}=t;if(!r)throw new E.T({docsPath:"/docs/actions/wallet/signTypedData"});let a=(0,_.J)(r),o={EIP712Domain:(0,em.H4)({domain:n}),...t.types};if((0,em.$$)({domain:n,message:i,primaryType:s,types:o}),a.signTypedData)return a.signTypedData({domain:n,message:i,primaryType:s,types:o});let l=(0,em.v8)({domain:n,message:i,primaryType:s,types:o});return e.request({method:"eth_signTypedData_v4",params:[a.address,l]},{retryCount:0})}async function eb(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,Z.cK)(t)}]},{retryCount:0})}async function ew(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}function ev(e){return{addChain:t=>Q(e,t),deployContract:t=>(function(e,t){let{abi:r,args:n,bytecode:i,...s}=t,a=(0,X.m)({abi:r,args:n,bytecode:i});return(0,S.v)(e,{...s,...s.authorizationList?{to:null}:{},data:a})})(e,t),fillTransaction:t=>(0,m.a)(e,t),getAddresses:()=>et(e),getCallsStatus:t=>(0,er.k)(e,t),getCapabilities:t=>en(e,t),getChainId:()=>(0,g.T)(e),getPermissions:()=>ei(e),prepareAuthorization:t=>(0,es.h)(e,t),prepareTransactionRequest:t=>(0,q.ft)(e,t),requestAddresses:()=>ea(e),requestPermissions:t=>eo(e,t),sendCalls:t=>(0,el.yM)(e,t),sendCallsSync:t=>eu(e,t),sendRawTransaction:t=>(0,ed.L)(e,t),sendRawTransactionSync:t=>(0,W.s)(e,t),sendTransaction:t=>(0,S.v)(e,t),sendTransactionSync:t=>K(e,t),showCallsStatus:t=>ef(e,t),signAuthorization:t=>eh(e,t),signMessage:t=>ep(e,t),signTransaction:t=>ey(e,t),signTypedData:t=>eg(e,t),switchChain:t=>eb(e,t),waitForCallsStatus:t=>(0,ec.c)(e,t),watchAsset:t=>ew(e,t),writeContract:t=>P(e,t),writeContractSync:t=>V(e,t),token:{approve:(0,y.Ai)(e,k),approveSync:(0,y.Ai)(e,G),transfer:(0,y.Ai)(e,J),transferSync:(0,y.Ai)(e,Y)}}}
3var ex=r(42467),e_=r(5596),eE=r(36665),eA=r(8042),eI=r(86665),eC=r(20347),eS=r(16025),eP=r(95962);let e$=32n*eP.Au,ek={block:(0,eA.R)({format(e){let t=e.transactions?.map(e=>{if("string"==typeof e)return e;let t=ek.transaction?.format(e);return"0x71"===t.typeHex?t.type="eip712":"0xff"===t.typeHex&&(t.type="priority"),t});return{l1BatchNumber:e.l1BatchNumber?(0,e_.uU)(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?(0,e_.uU)(e.l1BatchTimestamp):null,transactions:t}}}),transaction:(0,eC.gU)({format(e){let t={};return"0x71"===e.type?t.type="eip712":"0xff"===e.type&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?(0,e_.uU)(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?(0,e_.uU)(e.l1BatchTxIndex):null}}}),transactionReceipt:(0,eS.WB)({format:e=>({l1BatchNumber:e.l1BatchNumber?(0,e_.uU)(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?(0,e_.uU)(e.l1BatchTxIndex):null,logs:e.logs.map(e=>({...(0,eI.e)(e),l1BatchNumber:e.l1BatchNumber?(0,e_.uU)(e.l1BatchNumber):null,transactionLogIndex:(0,e_.ME)(e.transactionLogIndex),logType:e.logType})),l2ToL1Logs:e.l2ToL1Logs.map(e=>({blockNumber:(0,e_.uU)(e.blockHash),blockHash:e.blockHash,l1BatchNumber:e.l1BatchNumber?(0,e_.uU)(e.l1BatchNumber):null,transactionIndex:(0,e_.uU)(e.transactionIndex),shardId:(0,e_.uU)(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:(0,e_.uU)(e.logIndex)}))})}),transactionRequest:(0,j.bm)({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format:e=>e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:(0,Z.nj)(e.gasPerPubdata)}:{gasPerPubdata:(0,Z.nj)(50000n)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from((0,eE.aT)(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map(e=>Array.from((0,eE.aT)(e)))}:{},...e.customSignature?{customSignature:Array.from((0,eE.aT)(e.customSignature))}:{}},type:"0x71"}:{}})};var eT=r(64072),eO=r(87284),eN=r(18841),eR=r(29158),eB=r(15979),eD=r(38112),eM=r(83815),eU=r(65409),ej=r(69592),eL=r(56260),eF=r(64507),ez=r(27526),eq=r(44633),eW=r(24654);function eH(e){let{chainId:t,maxPriorityFeePerGas:r,maxFeePerGas:n,to:i}=e;if(t<=0)throw new eL.qD({chainId:t});if(i&&!(0,ez.P)(i))throw new eU.M({address:i});if(n&&n>eP.Ao)throw new eF.BG({maxFeePerGas:n});if(r&&n&&r>n)throw new eF.lN({maxFeePerGas:n,maxPriorityFeePerGas:r})}var eK=r(61354);function eV(e){if(!e||0===e.length)return[];let t=[];for(let r=0;r<e.length;r++){let{address:n,storageKeys:i}=e[r];for(let e=0;e<i.length;e++)if(i[e].length-2!=64)throw new N.fZ({storageKey:i[e]});if(!(0,ez.P)(n,{strict:!1}))throw new eU.M({address:n});t.push([n,i])}return t}function eG(e,t){let r=(0,eK.L)(e);return"eip1559"===r?function(e,t){let{chainId:r,gas:n,nonce:i,to:s,value:a,maxFeePerGas:o,maxPriorityFeePerGas:l,accessList:c,data:u}=e;eH(e);let d=eV(c),f=[(0,Z.cK)(r),i?(0,Z.cK)(i):"0x",l?(0,Z.cK)(l):"0x",o?(0,Z.cK)(o):"0x",n?(0,Z.cK)(n):"0x",s??"0x",a?(0,Z.cK)(a):"0x",u??"0x",d,...eJ(e,t)];return(0,D.aP)(["0x02",(0,eT.EQ)(f)])}(e,t):"eip2930"===r?function(e,t){let{chainId:r,gas:n,data:i,nonce:s,to:a,value:o,accessList:l,gasPrice:c}=e,{chainId:u,maxPriorityFeePerGas:d,gasPrice:f,maxFeePerGas:h,to:p}=e;if(u<=0)throw new eL.qD({chainId:u});if(p&&!(0,ez.P)(p))throw new eU.M({address:p});if(d||h)throw new O.C("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(f&&f>eP.Ao)throw new eF.BG({maxFeePerGas:f});let y=eV(l),m=[(0,Z.cK)(r),s?(0,Z.cK)(s):"0x",c?(0,Z.cK)(c):"0x",n?(0,Z.cK)(n):"0x",a??"0x",o?(0,Z.cK)(o):"0x",i??"0x",y,...eJ(e,t)];return(0,D.aP)(["0x01",(0,eT.EQ)(m)])}(e,t):"eip4844"===r?function(e,t){let{chainId:r,gas:n,nonce:i,to:s,value:a,maxFeePerBlobGas:o,maxFeePerGas:l,maxPriorityFeePerGas:c,accessList:u,data:d}=e,{blobVersionedHashes:f}=e;if(f){if(0===f.length)throw new ej.zF;for(let e of f){let t=(0,eq.E)(e),r=(0,e_.ME)((0,eW.di)(e,0,1));if(32!==t)throw new ej.uP({hash:e,size:t});if(r!==eM.E)throw new ej.PK({hash:e,version:r})}}eH(e);let h=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&(void 0===h||void 0===p)){let t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map(e=>(0,Z.My)(e)),r=e.kzg,n=(0,eO.S)({blobs:t,kzg:r});if(void 0===h&&(h=(0,eR.d)({commitments:n})),void 0===p){let e=(0,eN.t)({blobs:t,commitments:n,kzg:r});p=(0,eB.T)({blobs:t,commitments:n,proofs:e})}}
3let y=eV(u),m=[(0,Z.cK)(r),i?(0,Z.cK)(i):"0x",c?(0,Z.cK)(c):"0x",l?(0,Z.cK)(l):"0x",n?(0,Z.cK)(n):"0x",s??"0x",a?(0,Z.cK)(a):"0x",d??"0x",y,o?(0,Z.cK)(o):"0x",h??[],...eJ(e,t)],g=[],b=[],w=[];if(p)for(let e=0;e<p.length;e++){let{blob:t,commitment:r,proof:n}=p[e];g.push(t),b.push(r),w.push(n)}return(0,D.aP)(["0x03",p?(0,eT.EQ)([m,g,b,w]):(0,eT.EQ)(m)])}(e,t):"eip7702"===r?function(e,t){let{authorizationList:r,chainId:n,gas:i,nonce:s,to:a,value:o,maxFeePerGas:l,maxPriorityFeePerGas:c,accessList:u,data:d}=e,{authorizationList:f}=e;if(f)for(let e of f){let{chainId:t}=e,r=e.address;if(!(0,ez.P)(r))throw new eU.M({address:r});if(t<0)throw new eL.qD({chainId:t})}eH(e);let h=eV(u),p=function(e){if(!e||0===e.length)return[];let t=[];for(let r of e){let{chainId:e,nonce:n,...i}=r,s=r.address;t.push([e?(0,Z.nj)(e):"0x",s,n?(0,Z.nj)(n):"0x",...eJ({},i)])}return t}(r);return(0,D.aP)(["0x04",(0,eT.EQ)([(0,Z.cK)(n),s?(0,Z.cK)(s):"0x",c?(0,Z.cK)(c):"0x",l?(0,Z.cK)(l):"0x",i?(0,Z.cK)(i):"0x",a??"0x",o?(0,Z.cK)(o):"0x",d??"0x",h,p,...eJ(e,t)])])}(e,t):function(e,t){let{chainId:r=0,gas:n,data:i,nonce:s,to:a,value:o,gasPrice:l}=e,{chainId:c,maxPriorityFeePerGas:u,gasPrice:d,maxFeePerGas:f,to:h}=e;if(h&&!(0,ez.P)(h))throw new eU.M({address:h});if(void 0!==c&&c<=0)throw new eL.qD({chainId:c});if(u||f)throw new O.C("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(d&&d>eP.Ao)throw new eF.BG({maxFeePerGas:d});let p=[s?(0,Z.cK)(s):"0x",l?(0,Z.cK)(l):"0x",n?(0,Z.cK)(n):"0x",a??"0x",o?(0,Z.cK)(o):"0x",i??"0x"];if(t){let e=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n);if(r>0)return BigInt(2*r)+BigInt(35n+t.v-27n);let e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new N.zW({v:t.v});return e})(),n=(0,eD.B)(t.r),i=(0,eD.B)(t.s);p=[...p,(0,Z.cK)(e),"0x00"===n?"0x":n,"0x00"===i?"0x":i]}else r>0&&(p=[...p,(0,Z.cK)(r),"0x","0x"]);return(0,eT.EQ)(p)}(e,t)}function eJ(e,t){let r=t??e,{v:n,yParity:i}=r;if(void 0===r.r||void 0===r.s||void 0===n&&void 0===i)return[];let s=(0,eD.B)(r.r),a=(0,eD.B)(r.s);return["number"==typeof i?i?(0,Z.cK)(1):"0x":0n===n?"0x":1n===n?(0,Z.cK)(1):27n===n?"0x":(0,Z.cK)(1),"0x00"===s?"0x":s,"0x00"===a?"0x":a]}class eY extends O.C{constructor(){super('Transaction is not an EIP712 transaction.\n\nTransaction must:\n  - include `type: "eip712"`\n  - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`',{name:"InvalidEip712TransactionError"})}}function eZ(e){return"eip712"===e.type||"customSignature"in e&&!!e.customSignature||"paymaster"in e&&!!e.paymaster||"paymasterInput"in e&&!!e.paymasterInput||"gasPerPubdata"in e&&"bigint"==typeof e.gasPerPubdata||"factoryDeps"in e&&!!e.factoryDeps||!1}function eQ(e){let{chainId:t,to:r,from:n,paymaster:i,paymasterInput:s}=e;if(!eZ(e))throw new eY;if(!t||t<=0)throw new eL.qD({chainId:t});if(r&&!(0,ez.P)(r))throw new eU.M({address:r});if(n&&!(0,ez.P)(n))throw new eU.M({address:n});if(i&&!(0,ez.P)(i))throw new eU.M({address:i});if(i&&!s)throw new O.C("`paymasterInput` must be provided when `paymaster` is defined");if(!i&&s)throw new O.C("`paymaster` must be provided when `paymasterInput` is defined")}var eX=r(87601),e0=r(90391);class e1 extends O.C{constructor({givenLength:e,maxBytecodeSize:t}){super(`Bytecode cannot be longer than ${t} bytes. Given length: ${e}`,{name:"BytecodeLengthExceedsMaxSizeError"})}}class e2 extends O.C{constructor({givenLengthInWords:e}){super(`Bytecode length in 32-byte words must be odd. Given length in words: ${e}`,{name:"BytecodeLengthInWordsMustBeOddError"})}}class e5 extends O.C{constructor({givenLength:e}){super(`The bytecode length in bytes must be divisible by 32. Given length: ${e}`,{name:"BytecodeLengthMustBeDivisibleBy32Error"})}}function e6(e){let t=(0,eE.ZJ)(e);if(t.length%32!=0)throw new e5({givenLength:t.length});if(t.length>e$)throw new e1({givenLength:t.length,maxBytecodeSize:e$});let r=(0,e0.s)(t),n=(0,eE.ZJ)(r),i=t.length/32;if(i%2==0)throw new e2({givenLengthInWords:i});let s=(0,eE.ZJ)(i),a=(0,eX.eV)(s,{size:2}),o=new Uint8Array([1,0]);return n.set(o,0),n.set(a,2),n}let e3={blockTime:1e3,formatters:ek,serializers:{transaction:function(e,t){return eZ(e)?function(e){let{chainId:t,gas:r,nonce:n,to:i,from:s,value:a,maxFeePerGas:o,maxPriorityFeePerGas:l,customSignature:c,factoryDeps:u,paymaster:d,paymasterInput:f,gasPerPubdata:h,data:p}=e;eQ(e);let y=[n?(0,Z.nj)(n):"0x",l?(0,Z.nj)(l):"0x",o?(0,Z.nj)(o):"0x",r?(0,Z.nj)(r):"0x",i??"0x",a?(0,Z.nj)(a):"0x",p??"0x",(0,Z.nj)(t),(0,Z.nj)(""),(0,Z.nj)(""),(0,Z.nj)(t),s??"0x",h?(0,Z.nj)(h):(0,Z.nj)(50000n),u??[],c??"0x",d&&f?[d,f]:[]];
3return(0,D.aP)(["0x71",(0,eT.EQ)(y)])}(e):eG(e,t)}},custom:{getEip712Domain:e=>{eQ(e);let t=function(e){let{gas:t,nonce:r,to:n,from:i,value:s,maxFeePerGas:a,maxPriorityFeePerGas:o,factoryDeps:l,paymaster:c,paymasterInput:u,gasPerPubdata:d,data:f}=e;return{txType:113n,from:BigInt(i),to:n?BigInt(n):0n,gasLimit:t??0n,gasPerPubdataByteLimit:d??50000n,maxFeePerGas:a??0n,maxPriorityFeePerGas:o??0n,paymaster:c?BigInt(c):0n,nonce:r?BigInt(r):0n,value:s??0n,data:f??"0x",factoryDeps:l?.map(e=>(0,Z.nj)(e6(e)))??[],paymasterInput:u||"0x"}}(e);return{domain:{name:"zkSync",version:"2",chainId:e.chainId},types:{Transaction:[{name:"txType",type:"uint256"},{name:"from",type:"uint256"},{name:"to",type:"uint256"},{name:"gasLimit",type:"uint256"},{name:"gasPerPubdataByteLimit",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymaster",type:"uint256"},{name:"nonce",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"factoryDeps",type:"bytes32[]"},{name:"paymasterInput",type:"bytes"}]},primaryType:"Transaction",message:t}}}},e8=(0,ex.x)({...e3,blockTime:200,id:2741,name:"Abstract",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://api.mainnet.abs.xyz"],webSocket:["wss://api.mainnet.abs.xyz/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://abscan.org"},native:{name:"Abstract Explorer",url:"https://explorer.mainnet.abs.xyz"}},contracts:{multicall3:{address:"0xAa4De41dba0Ca5dCBb288b7cC6b708F3aaC759E7",blockCreated:5288},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:5263}}}),e4=(0,ex.x)({...e3,blockTime:200,id:11124,name:"Abstract Testnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://api.testnet.abs.xyz"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.abscan.org"},native:{name:"Abstract Explorer",url:"https://explorer.testnet.abs.xyz"}},testnet:!0,contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963",blockCreated:358349},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:431682}}}),e9={blockTime:2e3,contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:{block:(0,eA.R)({format:e=>({transactions:e.transactions?.map(e=>{if("string"==typeof e)return e;let t=(0,eC.uP)(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?(0,e_.uU)(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}),stateRoot:e.stateRoot})}),transaction:(0,eC.gU)({format(e){let t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?(0,e_.uU)(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:(0,eS.WB)({format:e=>({...e.depositNonce?{depositNonce:(0,e_.uU)(e.depositNonce)}:{},...e.depositReceiptVersion?{depositReceiptVersion:(0,e_.ME)(e.depositReceiptVersion)}:{},l1GasPrice:e.l1GasPrice?(0,e_.uU)(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?(0,e_.uU)(e.l1GasUsed):null,l1Fee:e.l1Fee?(0,e_.uU)(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},serializers:{transaction:function(e,t){var r;return"deposit"===(r=e).type||void 0!==r.sourceHash?function(e){var t=e;let{from:r,to:n}=t;if(r&&!(0,ez.P)(r))throw new eU.M({address:r});if(n&&!(0,ez.P)(n))throw new eU.M({address:n});let{sourceHash:i,data:s,from:a,gas:o,isSystemTx:l,mint:c,to:u,value:d}=e,f=[i,a,u??"0x",c?(0,Z.nj)(c):"0x",d?(0,Z.nj)(d):"0x",o?(0,Z.nj)(o):"0x",l?"0x1":"0x",s??"0x"];return(0,D.aP)(["0x7e",(0,eT.EQ)(f)])}(e):eG(e,t)}}},e7=(0,ex.x)({...e9,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...e9.contracts,disputeGameFactory:{1:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{1:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{1:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:0x10ac19f}},l1StandardBridge:{1:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:0x10ac19f}}},sourceId:1});({...e7,experimental_preconfirmationTime:200,rpcUrls:{default:{http:["https://mainnet-preconf.base.org"]}}});let te=(0,ex.x)({...e9,id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol
3:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://sepolia.basescan.org",apiUrl:"https://api-sepolia.basescan.org/api"}},contracts:{...e9.contracts,disputeGameFactory:{0xaa36a7:{address:"0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"}},l2OutputOracle:{0xaa36a7:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{0xaa36a7:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{0xaa36a7:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:0xaa36a7});({...te,experimental_preconfirmationTime:200,rpcUrls:{default:{http:["https://sepolia-preconf.base.org"]}}});let tt=(0,ex.x)({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0xb5b35e}}}),tr=(0,ex.x)({id:43113,name:"Avalanche Fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://testnet.snowtrace.io",apiUrl:"https://api-testnet.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7096959}},testnet:!0}),tn=(0,ex.x)({id:1329,name:"Sei Network",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc.sei-apis.com/"],webSocket:["wss://evm-ws.sei-apis.com/"]}},blockExplorers:{default:{name:"Seiscan",url:"https://seiscan.io",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}}}),ti=(0,ex.x)({id:1328,name:"Sei Testnet",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc-testnet.sei-apis.com"],webSocket:["wss://evm-ws-testnet.sei-apis.com"]}},blockExplorers:{default:{name:"Seiscan",url:"https://testnet.seiscan.io",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0x5e201b3}},testnet:!0}),ts=(0,ex.x)({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon.drpc.org"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0x18938b0}}}),ta=(0,ex.x)({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),to=(0,ex.x)({id:3338,name:"Peaq",nativeCurrency:{decimals:18,name:"peaq",symbol
3:"PEAQ"},rpcUrls:{default:{http:["https://quicknode1.peaq.xyz","https://quicknode2.peaq.xyz","https://quicknode3.peaq.xyz"],webSocket:["wss://quicknode1.peaq.xyz","wss://quicknode2.peaq.xyz","wss://quicknode3.peaq.xyz"]}},blockExplorers:{default:{name:"Subscan",url:"https://peaq.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3566354}}}),tl=(0,ex.x)({id:1514,name:"Story",nativeCurrency:{decimals:18,name:"IP Token",symbol:"IP"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:340998},ensRegistry:{address:"0x5dc881dda4e4a8d312be3544ad13118d1a04cb17",blockCreated:648924},ensUniversalResolver:{address:"0xddfb18888a9466688235887dec2a10c4f5effee9",blockCreated:649114}},rpcUrls:{default:{http:["https://mainnet.storyrpc.io"]}},blockExplorers:{default:{name:"Story explorer",url:"https://storyscan.io",apiUrl:"https://storyscan.io/api/v2"}},ensTlds:[".ip"],testnet:!1}),tc=(0,ex.x)({id:41923,name:"EDU Chain",nativeCurrency:{decimals:18,name:"EDU",symbol:"EDU"},rpcUrls:{default:{http:["https://rpc.edu-chain.raas.gelato.cloud"]}},blockExplorers:{default:{name:"EDU Chain Explorer",url:"https://educhain.blockscout.com/"}},testnet:!1}),tu=(0,ex.x)({id:4689,name:"IoTeX",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.mainnet.iotex.io"],webSocket:["wss://babel-api.mainnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://iotexscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0x15230d6}}}),td=(0,ex.x)({id:4690,name:"IoTeX Testnet",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.testnet.iotex.io"],webSocket:["wss://babel-api.testnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://testnet.iotexscan.io"}},contracts:{multicall3:{address:"0xb5cecD6894c6f473Ec726A176f1512399A2e355d",blockCreated:0x17383c8}},testnet:!0});var tf=r(88481),th=r(93255),tp=r(92733),ty=r(77424);async function tm({hash:e,privateKey:t,to:r="object"}){let{r:n,s:i,recovery:s}=tf.secp256k1.sign(e.slice(2),t.slice(2),{lowS:!0,extraEntropy:!!(0,tp.q)(!1,{strict:!1})&&(0,eE.aT)(!1)}),a={r:(0,Z.cK)(n,{size:32}),s:(0,Z.cK)(i,{size:32}),v:s?28n:27n,yParity:s};return"bytes"===r||"hex"===r?(0,ty.h)({...a,to:r}):a}var tg=r(29134);async function tb(e){let{chainId:t,nonce:r,privateKey:n,to:i="object"}=e,s=e.contractAddress??e.address,a=await tm({hash:(0,tg.C)({address:s,chainId:t,nonce:r}),privateKey:n,to:i});return"object"===i?{address:s,chainId:t,nonce:r,...a}:a}var tw=r(24009);async function tv({message:e,privateKey:t}){return await tm({hash:(0,tw.A)(e),privateKey:t,to:"hex"})}var tx=r(3303);async function t_(e){let{privateKey:t,transaction:r,serializer:n=eG}=e,i="eip4844"===r.type?{...r,sidecars:!1}:r,s=await tm({hash:(0,tx.S)(await n(i)),privateKey:t});return await n(r,s)}var tE=r(12060);async function tA(e){let{privateKey:t,...r}=e;return await tm({hash:(0,tE.Zh)(r),privateKey:t,to:"hex"})}var tI=r(7878),tC=r(74263),tS=r(10752);let tP=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"accountAddress",type:"address"},{indexed:!1,internalType:"enum IContractDeployer.AccountNonceOrdering",name:"nonceOrdering",type:"uint8"}],name:"AccountNonceOrderingUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"accountAddress",type:"address"},{indexed:!1,internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"aaVersion",type:"uint8"}],name:"AccountVersionUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"deployerAddress",type:"address"},{indexed:!0,internalType:"bytes32",name:"bytecodeHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"contractAddress",type:"address"}],name:"ContractDeployed",type:"event"},{inputs:[{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"}],name:"create",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"}],name:"create2",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"},{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"_aaVersion",type:"uint8"}],name:"create2Account",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"},{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"_aaVersion",type:"uint8"}],name:"createAccount",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_address",type:"address"}],name:"extendedAccountVersion",outputs:[{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_keccak256BytecodeHash",type:"bytes32"}],name:"forceDeployKeccak256",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes32",name:"bytecodeHash",type:"bytes32"},{internalType:"address",name:"newAddress",type:"address"},{internalType:"bool",name:"callConstructor",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"input",type:"bytes"}],internalType:"struct ContractDeployer.ForceDeployment",name:"_deployment",type:"tuple"},{internalType:"address",name:"_sender",type:"address"}],name:"forceDeployOnAddress",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes32",name:"bytecodeHash",type:"bytes32"},{internalType:"address",name:"newAddress",type:"address"},{internalType:"bool",name:"callConstructor",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"input",type:"bytes"}],internalType:"struct ContractDeployer.ForceDeployment[]",name:"_deployments",type:"tuple[]"}],name:"forceDeployOnAddresses",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_address",type:"address"}],name:"getAccountInfo",outputs:[{components:[{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"supportedAAVersion",type:"uint8"},{internalType:"enum IContractDeployer.AccountNonceOrdering",name:"nonceOrdering",type:"uint8"}],internalType:"struct IContractDeployer.AccountInfo",name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_sender",type:"address"},{internalType:"uint256",name:"_senderNonce",type:"uint256"}],name:"getNewAddressCreate",outputs:[{internalType:"address",name:"newAddress",type:"address"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_sender",type:"address"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"}],name:"getNewAddressCreate2",outputs:[{internalType:"address",name:"newAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"_version",type:"uint8"}],name:"updateAccountVersion",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"enum IContractDeployer.AccountNonceOrdering",name:"_nonceOrdering",type:"uint8"}],name:"updateNonceOrdering",outputs:[],stateMutability:"nonpayable",type:"function"}],t$="/docs/contract/encodeDeployData";function tk(e,t,r,n){let i=[t,r,n];
3return({create:{functionName:"create",argsContractDeployer:i},create2:{functionName:"create2",argsContractDeployer:i},createAccount:{functionName:"createAccount",argsContractDeployer:[...i,1]},create2Account:{functionName:"create2Account",argsContractDeployer:[...i,1]}})[e||"create"]}function tT(e){if(!eZ(e))throw new eY;(0,F.c)(e)}async function tO(e,t){let{account:r=e.account,chain:n=e.chain,...i}=t,s=r?(0,_.J)(r):e.account;if(!s)throw new E.T({docsPath:"/docs/actions/wallet/signTransaction"});if(tT({account:s,chain:n,...t}),!n?.custom?.getEip712Domain)throw new O.C("`getEip712Domain` not found on chain.");if(!n?.serializers?.transaction)throw new O.C("transaction serializer not found on chain.");let a=await (0,C.T)(e,g.T,"getChainId")({});null!==n&&(0,B.v)({currentChainId:a,chain:n});let o=n?.custom.getEip712Domain({...i,chainId:a,from:s.address,type:"eip712"}),l=await eg(e,{...o,account:s});return n?.serializers?.transaction({chainId:a,...i,customSignature:l,type:"eip712"},{r:"0x0",s:"0x0",v:0n})}async function tN(e,t){return eZ(t)?tO(e,t):await ey(e,t)}async function tR(e,t){let{account:r=e.account,chain:n=e.chain}=t,i=r?(0,_.J)(r):e.account;if(!i)throw new E.T({docsPath:"/docs/actions/wallet/sendTransaction"});try{let r;tT(t);let s=await (0,q.ft)(e,{...t,nonceManager:i.nonceManager,parameters:["gas","nonce","fees"]});null!==n&&(r=await (0,C.T)(e,g.T,"getChainId")({}),(0,B.v)({currentChainId:r,chain:n}));let a=await tN(e,{...s,chainId:r});return await (0,C.T)(e,ed.L,"sendRawTransaction")({serializedTransaction:a})}catch(e){throw(0,M.p)(e,{...t,account:i,chain:n})}}async function tB(e,t){return eZ(t)?tR(e,t):(0,S.v)(e,t)}var tD=r(85361),tM=r(51731),tU=r(31911);function tj(e){return JSON.parse(function(e){let t=[],r=!1;for(let i=0;i<e.length;i++){let s=!1;if("\\"===e[i]&&(t.push(e[i++]),s=!s),'"'===e[i]){t.push(e[i]),s||(r=!r);continue}if(!r){let r=function(e,t){if(!e[t]?.match(/[-\d]/))return null;let r=e.slice(t).match(/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/);return r?r[0]:null}(e,i);if(r?.length){var n;i+=r.length-1,r.match(/\.|[eE]-/)?t.push(r):t.push((n=r,`{"$n":"${n}"}`));continue}}t.push(e[i])}return t.join("")}(e),(e,t)=>{var r;return(r=t)&&"object"==typeof r&&"$n"in r&&"string"==typeof r.$n?function({$n:e}){if(e.match(/[eE]/)){let[t,r]=e.split(/[eE]/);return BigInt(t)*BigInt(10)**BigInt(r)}return BigInt(e)}(t):t})}var tL=0n;function tF(e){return{id:function(){let e=tL;return tL++,e.toString()}(),jsonrpc:"2.0",method:e.methodName,params:e.params}}function tz(e,t){return JSON.stringify(e,(e,t)=>{var r;return"bigint"==typeof t?(r=t,{$n:`${r}`}):t},t).replace(/\{\s*"\$n"\s*:\s*"(-?\d+)"\s*\}/g,"$1")}function tq(e){return!(null==e||"object"!=typeof e||Array.isArray(e))&&"jsonrpc"in e&&"2.0"===e.jsonrpc&&"method"in e&&"string"==typeof e.method&&"params"in e}var tW=r(77809);function tH(e){return"bigint"==typeof e?Number(e):e}var tK={};function tV(e){return function t(r,n){if(Array.isArray(r))return r.map((e,r)=>t(e,{...n,keyPath:[...n.keyPath,r]}));if("object"!=typeof r||null===r)return e.reduce((e,t)=>t(e,n),r);{let e={};for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let s={...n,keyPath:[...n.keyPath,i]};e[i]=t(r[i],s)}return e}}}function tG(e,t){return r=>{let n=tV(e);return Object.freeze({...r,params:n(r.params,t)})}}var tJ={accountNotifications:1,blockNotifications:1,getAccountInfo:1,getBalance:1,getBlock:1,getBlockHeight:0,getBlockProduction:0,getBlocks:2,getBlocksWithLimit:2,getEpochInfo:0,getFeeForMessage:1,getInflationGovernor:0,getInflationReward:1,getLargestAccounts:0,getLatestBlockhash:0,getLeaderSchedule:1,getMinimumBalanceForRentExemption:1,getMultipleAccounts:1,getProgramAccounts:1,getSignaturesForAddress:1,getSlot:0,getSlotLeader:0,getStakeMinimumDelegation:0,getSupply:0,getTokenAccountBalance:1,getTokenAccountsByDelegate:2,getTokenAccountsByOwner:2,getTokenLargestAccounts:1,getTokenSupply:1,getTransaction:1,getTransactionCount:0,getVoteAccounts:0,isBlockhashValid:1,logsNotifications:1,programNotifications:1,requestAirdrop:2,sendTransaction:1,signatureNotifications:1,simulateTransaction:1};function tY(e){let t=e?.onIntegerOverflow;return r=>(0,tW.F)(r,t?e=>{var r;return tG([(r=(...r)=>t(e,...r),(e,{keyPath:t})=>("bigint"==typeof e&&r&&(e>Number.MAX_SAFE_INTEGER||e<-Number.MAX_SAFE_INTEGER)&&r(t,e),e))],{keyPath:[]})(e)}:e=>e,tG([tH],{keyPath:[]}),function({defaultCommitment:e,optionsObjectPositionByMethod:t}){return r=>{let{params:n,methodName:i}=r;if(!Array.isArray(n))return r;let s=t[i];return null==s?r:Object.freeze({methodName:i,params:function({commitmentPropertyName:e,params:t,optionsObjectPositionInParams:r,overrideCommitment:n}){let i=t[r];
3if(void 0===i||i&&"object"==typeof i&&!Array.isArray(i)){if(i&&e in i){if(!i[e]||"finalized"===i[e]){let n=[...t],{[e]:s,...a}=i;return Object.keys(a).length>0?n[r]=a:r===n.length-1?n.length--:n[r]=void 0,n}}else if("finalized"!==n){let s=[...t];return s[r]={...i,[e]:n},s}}return t}({commitmentPropertyName:"sendTransaction"===i?"preflightCommitment":"commitment",optionsObjectPositionInParams:s,overrideCommitment:e,params:n})})}}({defaultCommitment:e?.defaultCommitment,optionsObjectPositionByMethod:tJ}))}function tZ(e){return function(t,{keyPath:r}){var n;return"number"==typeof t&&Number.isInteger(t)||"bigint"==typeof t?(n=r,e.some(e=>{if(e.length!==n.length)return!1;for(let t=n.length-1;t>=0;t--){let r=n[t],i=e[t];if(i!==r&&(i!==tK||"number"!=typeof r))return!1}return!0}))?Number(t):BigInt(t):t}}function tQ(e){var t,r;return t=[tZ(e)],r={keyPath:[]},e=>tV(t)(e,r)}var tX=[["data","parsed","info","tokenAmount","decimals"],["data","parsed","info","tokenAmount","uiAmount"],["data","parsed","info","rentExemptReserve","decimals"],["data","parsed","info","rentExemptReserve","uiAmount"],["data","parsed","info","delegatedAmount","decimals"],["data","parsed","info","delegatedAmount","uiAmount"],["data","parsed","info","extensions",tK,"state","olderTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",tK,"state","newerTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",tK,"state","preUpdateAverageRate"],["data","parsed","info","extensions",tK,"state","currentRate"]],t0=[...tX,["data","parsed","info","lastExtendedSlotStartIndex"],["data","parsed","info","slashPenalty"],["data","parsed","info","warmupCooldownRate"],["data","parsed","info","decimals"],["data","parsed","info","numRequiredSigners"],["data","parsed","info","numValidSigners"],["data","parsed","info","stake","delegation","warmupCooldownRate"],["data","parsed","info","exemptionThreshold"],["data","parsed","info","burnPercent"],["data","parsed","info","commission"],["data","parsed","info","votes",tK,"confirmationCount"]],t1=[["index"],["
3instructions",tK,"accounts",tK],["instructions",tK,"programIdIndex"],["instructions",tK,"stackHeight"]],t2=[["addressTableLookups",tK,"writableIndexes",tK],["addressTableLookups",tK,"readonlyIndexes",tK],["header","numReadonlySignedAccounts"],["header","numReadonlyUnsignedAccounts"],["header","numRequiredSignatures"],["instructions",tK,"accounts",tK],["instructions",tK,"programIdIndex"],["instructions",tK,"stackHeight"]],t5=["getAccountInfo","getBalance","getBlock","getBlockCommitment","getBlockHeight","getBlockProduction","getBlocks","getBlocksWithLimit","getBlockTime","getClusterNodes","getEpochInfo","getEpochSchedule","getFeeForMessage","getFirstAvailableBlock","getGenesisHash","getHealth","getHighestSnapshotSlot","getIdentity","getInflationGovernor","getInflationRate","getInflationReward","getLargestAccounts","getLatestBlockhash","getLeaderSchedule","getMaxRetransmitSlot","getMaxShredInsertSlot","getMinimumBalanceForRentExemption","getMultipleAccounts","getProgramAccounts","getRecentPerformanceSamples","getRecentPrioritizationFees","getSignaturesForAddress","getSignatureStatuses","getSlot","getSlotLeader","getSlotLeaders","getStakeMinimumDelegation","getSupply","getTokenAccountBalance","getTokenAccountsByDelegate","getTokenAccountsByOwner","getTokenLargestAccounts","getTokenSupply","getTransaction","getTransactionCount","getVersion","getVoteAccounts","index","isBlockhashValid","minimumLedgerSlot","requestAirdrop","sendTransaction","simulateTransaction"];function t6(e){return tq(e)&&t5.includes(e.method)}var t3=Object.prototype.toString,t8=Object.keys||function(e){let t=[];for(let r in e)t.push(r);return t};function t4(e){let t=function e(t,r){let n,i,s,a,o,l,c;if(!0===t)return"true";if(!1===t)return"false";switch(typeof t){case"object":if(null===t)return null;if("toJSON"in t&&"function"==typeof t.toJSON)return e(t.toJSON(),r);if("[object Array]"===(c=t3.call(t))){for(n=0,s="[",i=t.length-1;n<i;n++)s+=e(t[n],!0)+",";return i>-1&&(s+=e(t[n],!0)),s+"]"}if("[object Object]"!==c)return JSON.stringify(t);for(i=(a=t8(t).sort()).length,s="",n=0;n<i;)void 0!==(l=e(t[o=a[n]],!1))&&(s&&(s+=","),s+=JSON.stringify(o)+":"+l),n++;return"{"+s+"}";case"function":case"undefined":return r?null:void 0;case"bigint":return`${t.toString()}n`;case"string":return JSON.stringify(t);default:return isFinite(t)?t:null}}(e,!1);if(void 0!==t)return""+t}var t9={defaultCommitment:"confirmed",onIntegerOverflow(e,t,r){throw function e(t,r,n){let i="";if("number"==typeof r[0]){let e=r[0]+1,t=e%10,n=e%100;i=1==t&&11!=n?e+"st":2==t&&12!=n?e+"nd":3==t&&13!=n?e+"rd":e+"th"}else i=`\`${r[0].toString()}\``;let s=r.length>1?r.slice(1).map(e=>"number"==typeof e?`[${e}]`:e).join("."):void 0,a=new tU.tsw(tU.O7$,{argumentLabel:i,keyPath:r,methodName:t,optionalPathLabel:s?` at path \`${s}\``:"",value:n,...void 0!==s?{path:s}:void 0});return(0,tU.rMr)(a,e),a}(e.methodName,t,r)}},t7=globalThis.AbortController;function re(e){return tq(e)?t4([e.method,e.params]):void 0}function rt(e,t){var r,s,a,o,l;return s=(r={url:e,...t},(0,tW.F)(function(e){let t,{fromJson:r,headers:n,toJson:i,url:s}=e,a=n&&function(e){let t={};for(let r in e)t[r.toLowerCase()]=e[r];return t}(n);return async function({payload:e,signal:n}){let o=i?i(e):JSON.stringify(e),l={...t,body:o,headers:{...a,accept:"application/json","content-length":o.length.toString(),"content-type":"application/json; charset=utf-8"},method:"POST",signal:n},c=await fetch(s,l);if(!c.ok)throw new tU.tsw(tU._yh,{headers:c.headers,message:c.statusText,statusCode:c.status});return r?r(await c.text(),e):await c.json()}}({...{...r,headers:{...!1,...r.headers?function(e){let t={};for(let r in e)t[r.toLowerCase()]=e[r];return t}(r.headers):void 0,"solana-client":"js/5.5.1"}},fromJson:(e,t)=>t6(t)?tj(e):JSON.parse(e),toJson:e=>t6(e)?tz(e):JSON.stringify(e)}),e=>{let t;return async function(r){let{payload:n,signal:s}=r,a=re(n);if(void 0===a)return await e(r);if(t||(queueMicrotask(()=>{t=void 0}),t={}),null==t[a]){let n=new t7,s=(async()=>{try{return await e({...r,signal:n.signal})}catch(e){if(e===(i||={}))return;throw e}})();t[a]={abortController:n,numConsumers:0,responsePromise:s}}let o=t[a];if(o.numConsumers++,!s)return await o.responsePromise;{let e=o.responsePromise;return await new Promise((t,r)=>{let n=e=>{s.removeEventListener("abort",n),o.numConsumers-=1,queueMicrotask(()=>{0===o.numConsumers&&o.abortController.abort(i||={})}),r(e.target.reason)};
3s.addEventListener("abort",n),e.then(t).catch(r).finally(()=>{s.removeEventListener("abort",n)})})}}})),l={api:(o={requestTransformer:tY(t9),responseTransformer:(a={allowedNumericKeyPaths:(n||(n={getAccountInfo:t0.map(e=>["value",...e]),getBlock:[["transactions",tK,"meta","preTokenBalances",tK,"accountIndex"],["transactions",tK,"meta","preTokenBalances",tK,"uiTokenAmount","decimals"],["transactions",tK,"meta","postTokenBalances",tK,"accountIndex"],["transactions",tK,"meta","postTokenBalances",tK,"uiTokenAmount","decimals"],["transactions",tK,"meta","rewards",tK,"commission"],...t1.map(e=>["transactions",tK,"meta","innerInstructions",tK,...e]),...t2.map(e=>["transactions",tK,"transaction","message",...e]),["rewards",tK,"commission"]],getClusterNodes:[[tK,"featureSet"],[tK,"shredVersion"]],getInflationGovernor:[["initial"],["foundation"],["foundationTerm"],["taper"],["terminal"]],getInflationRate:[["foundation"],["total"],["validator"]],getInflationReward:[[tK,"commission"]],getMultipleAccounts:t0.map(e=>["value",tK,...e]),getProgramAccounts:t0.flatMap(e=>[["value",tK,"account",...e],[tK,"account",...e]]),getRecentPerformanceSamples:[[tK,"samplePeriodSecs"]],getTokenAccountBalance:[["value","decimals"],["value","uiAmount"]],getTokenAccountsByDelegate:tX.map(e=>["value",tK,"account",...e]),getTokenAccountsByOwner:tX.map(e=>["value",tK,"account",...e]),getTokenLargestAccounts:[["value",tK,"decimals"],["value",tK,"uiAmount"]],getTokenSupply:[["value","decimals"],["value","uiAmount"]],getTransaction:[["meta","preTokenBalances",tK,"accountIndex"],["meta","preTokenBalances",tK,"uiTokenAmount","decimals"],["meta","postTokenBalances",tK,"accountIndex"],["meta","postTokenBalances",tK,"uiTokenAmount","decimals"],["meta","rewards",tK,"commission"],...t1.map(e=>["meta","innerInstructions",tK,...e]),...t2.map(e=>["transaction","message",...e])],getVersion:[["feature-set"]],getVoteAccounts:[["current",tK,"commission"],["delinquent",tK,"commission"]],simulateTransaction:[["value","loadedAccountsDataSize"],...t0.map(e=>["value","accounts",tK,...e]),...t1.map(e=>["value","innerInstructions",tK,...e])]}),n)},(e,t)=>{let r=t.methodName,n=a?.allowedNumericKeyPaths&&r?a.allowedNumericKeyPaths[r]:void 0;return(0,tW.F)(e,e=>((e,t)=>{if("error"in e){let{error:i}=e;if(i&&"object"==typeof i&&"code"in i&&(-32002===i.code||i.code===-32002n)&&"data"in i&&i.data){var r,n;let e=(r=[tZ([["loadedAccountsDataSize"],...t0.map(e=>["accounts",tK,...e]),...t1.map(e=>["innerInstructions",tK,...e])])],n={keyPath:[]},e=>tV(r)(e,n))(i.data,t),s={...i,data:e};throw(0,tU.evr)(s)}throw(0,tU.evr)(e.error)}return e})(e,t),e=>e.result,e=>tQ(n??[])(e,t))})},new Proxy({},{defineProperty:()=>!1,deleteProperty:()=>!1,get(...e){let[t,r]=e,n=r.toString();return function(...e){let t=Object.freeze({methodName:n,params:e}),r=o?.requestTransformer?o?.requestTransformer(t):t;return Object.freeze({execute:async({signal:e,transport:t})=>{let n=tF(r),i=await t({payload:n,signal:e});return o?.responseTransformer?o.responseTransformer(i,r):i}})}}})),transport:s},new Proxy(l.api,{defineProperty:()=>!1,deleteProperty:()=>!1,get(e,t,r){if("then"!==t)return function(...n){let i=t.toString(),s=Reflect.get(e,i,r);if(!s)throw new tU.tsw(tU._jo,{method:i,params:n});return function({transport:e},t){return{send:async r=>await t.execute({signal:r?.abortSignal,transport:e})}}(l,s(...n))}}})}var rr=r(6825),rn=globalThis.AbortController,ri=globalThis.EventTarget;function rs(){return Symbol(void 0)}var ra=Symbol();function ro(e){return{on(t,r,n){function i(e){e instanceof CustomEvent?r(e.detail):r()}return e.addEventListener(t,i,n),()=>{e.removeEventListener(t,i)}}}}function rl(e){return null!==e&&("object"==typeof e||"function"==typeof e)}var rc=new WeakMap;async function ru(e){let t,r=new Promise((r,n)=>{for(let i of(t={reject:n,resolve:r},e)){if(!rl(i)){Promise.resolve(i).then(r,n);continue}let e=rc.get(i);void 0===e?((e=function(e){let t=new Set,r={deferreds:t,settled:!1};return Promise.resolve(e).then(e=>{for(let{resolve:r}of t)r(e);t.clear(),r.settled=!0},e=>{for(let{reject:r}of t)r(e);t.clear(),r.settled=!0}),r}(i)).deferreds.add(t),rc.set(i,e)):e.settled?Promise.resolve(i).then(r,n):e.deferreds.add(t)}});return await r.finally(()=>{for(let r of e)rl(r)&&rc.get(r).deferreds.delete(t)})}var rd=globalThis.AbortController,rf=new WeakMap;function rh(e,t,r){let n;if(void 0===r)return;let i=((n=rf.get(t))||rf.set(t,n={}),n);!i[r]&&e>0&&(i[r]=0);let s=e+i[r];return s<=0?delete i[r]:i[r]=s,s}var rp=new WeakMap;async function ry({channel:e,responseTransformer:t,signal:r,subscribeRequest:n,unsubscribeMethodName:i}){let s;e.on("error",()=>{s=void 0,rf.delete(e)},{signal:r});let a=new Promise((t,n)=>{function a(){if(0===rh(-1,e,s)){let t=tF({methodName:i,params:[s]});
3s=void 0,e.send(t).catch(()=>{})}n(this.reason)}r.aborted?a.call(r):r.addEventListener("abort",a)}),o=tF(n);await e.send(o);let l=new Promise((t,n)=>{let i=new rd;r.addEventListener("abort",i.abort.bind(i));let s={signal:i.signal};e.on("error",e=>{i.abort(),n(e)},s),e.on("message",e=>{e&&"object"==typeof e&&"id"in e&&e.id===o.id&&(i.abort(),"error"in e?n((0,tU.evr)(e.error)):t(e.result))},s)});if(null==(s=await ru([a,l])))throw new tU.tsw(tU.aYZ);rh(1,e,s);let c=function(e,t,r){let n=rp.get(e);n||rp.set(e,n=new WeakMap);let i=r??e,s=n.get(i);return s||n.set(i,s=function(e,t,r){let n,i=new ri,s=ro(i);return{...s,on(a,o,l){n||(n={dispose:e.on(t,e=>{let t=r(e);if(!t)return;let[n,s]=t;i.dispatchEvent(new CustomEvent(n,{detail:s}))}),numSubscribers:0}),n.numSubscribers++;let c=s.on(a,o,l),u=!0;function d(){u&&(u=!1,l?.signal.removeEventListener("abort",d),n.numSubscribers--,0===n.numSubscribers&&(n.dispose(),n=void 0),c())}return l?.signal.addEventListener("abort",d),d}}}(e,"message",e=>{if(!("method"in e))return;let n=r?r(e.params.result,t):e.params.result;return[`notification:${e.params.subscription}`,n]})),s}(e,n,t),u=`notification:${s}`;return{on(t,r,n){switch(t){case"notification":return c.on(u,r,n);case"error":return e.on("error",r,n);default:throw new tU.tsw(tU.JOu,{channelName:t,supportedChannelNames:["notification","error"]})}}}}var rm=globalThis.EventTarget,rg=globalThis.WebSocket,rb={defaultCommitment:"confirmed",onIntegerOverflow(e,t,r){throw function e(t,r,n){let i="";if("number"==typeof r[0]){let e=r[0]+1,t=e%10,n=e%100;i=1==t&&11!=n?e+"st":2==t&&12!=n?e+"nd":3==t&&13!=n?e+"rd":e+"th"}else i=`\`${r[0].toString()}\``;let s=r.length>1?r.slice(1).map(e=>"number"==typeof e?`[${e}]`:e).join("."):void 0,a=new tU.tsw(tU.O7$,{argumentLabel:i,keyPath:r,methodName:t,optionalPathLabel:s?` at path \`${s}\``:"",value:n,...void 0!==s?{path:s}:void 0});return(0,tU.rMr)(a,e),a}(e.methodName,t,r)}},rw=globalThis.AbortController,rv={jsonrpc:"2.0",method:"ping"};function rx(e){return(0,tW.F)(e,e=>Object.freeze({...e,on:(t,r,n)=>"message"!==t?e.on(t,r,n):e.on("message",e=>r(tj(e)),n)}),e=>Object.freeze({...e,send:t=>e.send(tz(t))}))}function r_(e,t){var r,n;return r=function({createChannel:e}){var t;return(0,tW.F)((t=e,async({execute:e,signal:r})=>{let n=await t({abortSignal:r});return await e({channel:n,signal:r})}),e=>(function(e){let t=new Map;return function(r){let{request:n,signal:i}=r,s=t4([n.methodName,n.params]),a=t.get(s);if(!a){let n=new rw,i=e({...r,signal:n.signal});i.then(e=>{e.on("error",()=>{t.delete(s),n.abort()},{signal:n.signal})}).catch(()=>{}),t.set(s,a={abortController:n,dataPublisherPromise:i,numSubscribers:0})}return a.numSubscribers++,i.addEventListener("abort",()=>{a.numSubscribers--,0===a.numSubscribers&&queueMicrotask(()=>{0===a.numSubscribers&&(t.delete(s),a.abortController.abort())})},{signal:a.abortController.signal}),a.dataPublisherPromise}})(e))}({createChannel:function(e){if(!1===/^wss?:/i.test(e.url)){let t=e.url.match(/^([^:]+):/);throw new DOMException(t?`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${t[1]}:' is not allowed.`:`Failed to construct 'WebSocket': The URL '${e.url}' is invalid.`)}let{intervalMs:t,...r}=e;return function(e,{maxSubscriptionsPerChannel:t,minChannels:r}){let n={entries:[],freeChannelIndex:-1};function i(){let e;if(n.entries.length<r){n.freeChannelIndex=-1;return}for(let r=0;r<n.entries.length;r++){let i=(n.freeChannelIndex+r+2)%n.entries.length,s=n.entries[i];s.subscriptionCount<t&&(!e||e.subscriptionCount>=s.subscriptionCount)&&(e={poolIndex:i,subscriptionCount:s.subscriptionCount})}n.freeChannelIndex=e?.poolIndex??-1}return function({abortSignal:t}){let r;function s(){let e=n.entries.findIndex(e=>e===r);n.entries.splice(e,1),r.dispose(),i()}if(-1===n.freeChannelIndex){let t=new rw,i=e({abortSignal:t.signal});i.then(e=>{e.on("error",s,{signal:t.signal})}).catch(s),r={channel:i,dispose(){t.abort()},subscriptionCount:0},n.entries.push(r)}else r=n.entries[n.freeChannelIndex];return r.subscriptionCount++,t.addEventListener("abort",function(){r.subscriptionCount--,0===r.subscriptionCount?s():-1!==n.freeChannelIndex&&(n.freeChannelIndex--,i())}),i(),r.channel}}(({abortSignal:n})=>(function({sendBufferHighWatermark:e,signal:t,url:r}){let n,i,s;if(t.aborted)return Promise.reject(t.reason);let a=!1,o=new Set;
3function l(){o.forEach(e=>{e()}),o.clear()}function c(){l(),a||i(t.reason),y.readyState!==rg.CLOSED&&y.readyState!==rg.CLOSING&&y.close(1e3)}function u(e){if(!t.aborted&&!a){let t=new tU.tsw(tU.gF,{errorEvent:e});i(t),f.dispatchEvent(new CustomEvent("error",{detail:t}))}}function d(e){t.aborted||f.dispatchEvent(new CustomEvent("message",{detail:e.data}))}let f=new rm,h=ro(f);function p(){a=!0,s({...h,async send(t){if(y.readyState!==rg.OPEN)throw new tU.tsw(tU.pFb);if(!n&&y.bufferedAmount>e){let t,r=new Promise((r,i)=>{let s=setInterval(()=>{y.readyState===rg.OPEN&&y.bufferedAmount>e||(clearInterval(s),n=void 0,r())},16);t=()=>{n=void 0,clearInterval(s),i(new tU.tsw(tU.UwC))}});n={onCancel:t,promise:r}}n&&(!ArrayBuffer.isView(t)||t instanceof DataView||(t=new t.constructor(t)),await n.promise),y.send(t)}})}let y=new rg(r);return t.addEventListener("abort",c),y.addEventListener("close",function e(r){l(),n?.onCancel(),t.removeEventListener("abort",c),y.removeEventListener("close",e),y.removeEventListener("error",u),y.removeEventListener("message",d),y.removeEventListener("open",p),t.aborted||r.wasClean&&1e3===r.code||f.dispatchEvent(new CustomEvent("error",{detail:new tU.tsw(tU.pFb,{cause:r})}))}),y.addEventListener("error",u),y.addEventListener("message",d),y.addEventListener("open",p),new Promise((e,t)=>{i=t,s=e})})({...r,sendBufferHighWatermark:e.sendBufferHighWatermark??131072,signal:n}).then(e.jsonSerializer).then(e=>(function({abortSignal:e,channel:t,intervalMs:r}){let n;function i(){t.send(rv).catch(e=>{(0,tU.zbS)(e,tU.pFb)&&a.abort()})}function s(){clearInterval(n),n=setInterval(i,r)}let a=new rw;return a.signal.addEventListener("abort",()=>{clearInterval(n)}),e.addEventListener("abort",()=>{a.abort()}),t.on("error",()=>{a.abort()},{signal:a.signal}),t.on("message",s,{signal:a.signal}),globalThis.navigator.onLine&&s(),globalThis.addEventListener("offline",function(){clearInterval(n)},{signal:a.signal}),globalThis.addEventListener("online",function(){i(),s()},{signal:a.signal}),{...t,send:(...e)=>(a.signal.aborted||s(),t.send(...e))}})({abortSignal:n,channel:e,intervalMs:t??5e3})),{maxSubscriptionsPerChannel:e.maxSubscriptionsPerChannel??100,minChannels:e.minChannels??1})}({...t,url:e,jsonSerializer:rx})}),n={api:function(e){var t,r;let n=tY(e),i=(t={allowedNumericKeyPaths:(a||(a={accountNotifications:t0.map(e=>["value",...e]),blockNotifications:[["value","block","transactions",tK,"meta","preTokenBalances",tK,"accountIndex"],["value","block","transactions",tK,"meta","preTokenBalances",tK,"uiTokenAmount","decimals"],["value","block","transactions",tK,"meta","postTokenBalances",tK,"accountIndex"],["value","block","transactions",tK,"meta","postTokenBalances",tK,"uiTokenAmount","decimals"],["value","block","transactions",tK,"meta","rewards",tK,"commission"],["value","block","transactions",tK,"meta","innerInstructions",tK,"index"],["value","block","transactions",tK,"meta","innerInstructions",tK,"instructions",tK,"programIdIndex"],["value","block","transactions",tK,"meta","innerInstructions",tK,"instructions",tK,"accounts",tK],["value","block","transactions",tK,"transaction","message","addressTableLookups",tK,"writableIndexes",tK],["value","block","transactions",tK,"transaction","message","addressTableLookups",tK,"readonlyIndexes",tK],["value","block","transactions",tK,"transaction","message","instructions",tK,"programIdIndex"],["value","block","transactions",tK,"transaction","message","instructions",tK,"accounts",tK],["value","block","transactions",tK,"transaction","message","header","numReadonlySignedAccounts"],["value","block","transactions",tK,"transaction","message","header","numReadonlyUnsignedAccounts"],["value","block","transactions",tK,"transaction","message","header","numRequiredSignatures"],["value","block","rewards",tK,"commission"]],programNotifications:t0.flatMap(e=>[["value",tK,"account",...e],[tK,"account",...e]])}),a)},(e,r)=>{let n=r.methodName,i=t?.allowedNumericKeyPaths&&n?t.allowedNumericKeyPaths[n]:void 0;return(0,tW.F)(e,e=>tQ(i??[])(e,r))});return r={planExecutor:({request:e,...t})=>ry({...t,responseTransformer:i,subscribeRequest:{...e,methodName:e.methodName.replace(/Notifications$/,"Subscribe")},unsubscribeMethodName:e.methodName.replace(/Notifications$/,"Unsubscribe")}),requestTransformer:n},new Proxy({},{defineProperty:()=>!1,deleteProperty:()=>!1,get(...e){let[t,n]=e,i=n.toString();return function(...e){let t={methodName:i,params:e},n=r.requestTransformer?r.requestTransformer(t):t;return{execute:e=>r.planExecutor({...e,request:n}),request:n}}}})}(rb),transport:r},new Proxy(n.api,{defineProperty:()=>!1,deleteProperty:()=>!1,get(e,t,r){if("then"!==t)return function(...i){var a,o;let l=t.toString(),c=Reflect.get(e,l,r);
3if(!c)throw new tU.tsw(tU.uWs,{notificationName:l});let u=c(...i);return a=n.transport,o=u,{async subscribe({abortSignal:e}){let t=await a({signal:e,...o});return function({abortSignal:e,dataChannelName:t,dataPublisher:r,errorChannelName:n}){let i=new Map;function a(e){for(let[t,r]of i.entries())r.__hasPolled?(i.delete(t),r.onError(e)):r.publishQueue.push({__type:1,err:e})}let o=new rn;e.addEventListener("abort",()=>{o.abort(),a(s||=rs())});let l={signal:o.signal},c=ra;return r.on(n,e=>{c===ra&&(c=e,o.abort(),a(e))},l),r.on(t,e=>{i.forEach((t,r)=>{if(t.__hasPolled){let{onData:n}=t;i.set(r,{__hasPolled:!1,publishQueue:[]}),n(e)}else t.publishQueue.push({__type:0,data:e})})},l),{async *[Symbol.asyncIterator](){if(e.aborted)return;if(c!==ra)throw c;let t=Symbol();i.set(t,{__hasPolled:!1,publishQueue:[]});try{for(;;){let e=i.get(t);if(!e)throw new tU.tsw(tU.LzQ);if(e.__hasPolled)throw new tU.tsw(tU.ibr);let r=e.publishQueue;try{if(r.length)for(let t of(e.publishQueue=[],r))if(0===t.__type)yield t.data;else throw t.err;else yield await new Promise((e,r)=>{i.set(t,{__hasPolled:!0,onData:e,onError:r})})}catch(e){if(e===(s||=rs()))return;throw e}}}finally{i.delete(t)}}}}({abortSignal:e,dataChannelName:"notification",dataPublisher:t,errorChannelName:"error"})}}}}})}var rE=r(44116),rA=r(26101),rI=r(34867),rC=r(2367),rS=r(94328);r(98539).hp,d.KC([d.Yj().transform(e=>e.replace(/[^0-9.-]+/g,"")),d.ai()]).pipe(d.au.number().min(1e-4).max(0x3b9ac9ff));var rP=d.k5(["abstract","abstract-testnet","base-sepolia","base","avalanche-fuji","avalanche","iotex","solana-devnet","solana","sei","sei-testnet","polygon","polygon-amoy","peaq","story","educhain","skale-base-sepolia"]),r$=new Map([["abstract",2741],["abstract-testnet",11124],["base-sepolia",84532],["base",8453],["avalanche-fuji",43113],["avalanche",43114],["iotex",4689],["sei",1329],["sei-testnet",1328],["polygon",137],["polygon-amoy",80002],["peaq",3338],["story",1514],["educhain",41923],["skale-base-sepolia",0x135a9d92]]),rk=["s
3olana-devnet","solana"];Object.fromEntries(["abstract","abstract-testnet","base-sepolia","base","avalanche-fuji","avalanche","iotex","sei","sei-testnet","polygon","polygon-amoy","peaq","story","educhain","skale-base-sepolia",...rk].map(e=>[r$.get(e),e]));var rT={id:0x135a9d92,name:"SKALE Base Sepolia",nativeCurrency:{name:"Credits",symbol:"CREDITS",decimals:18},rpcUrls:{default:{http:["https://base-sepolia-testnet.skalenodes.com/v1/jubilant-horrible-ancha"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia-testnet-explorer.skalenodes.com",apiUrl:"https://base-sepolia-testnet-explorer.skalenodes.com/api"}}};function rO(e){let t=rL(e);return(0,f.l)({chain:t,transport:(0,h.L)()}).extend(p.$)}function rN(){return rO("base-sepolia")}function rR(){return rO("avalanche-fuji")}function rB(e,t){let r=rL(e),n=function(e){let{key:t="wallet",name:r="Wallet Client",transport:n}=e;return(0,y.UU)({...e,key:t,name:r,transport:n,type:"walletClient"}).extend(ev)}({chain:r,transport:(0,h.L)(),account:function(e,t={}){let{nonceManager:r}=t,n=(0,Z.nj)(tf.secp256k1.getPublicKey(e.slice(2),!1));return{...function(e){if("string"==typeof e){if(!(0,ez.P)(e,{strict:!1}))throw new eU.M({address:e});return{address:e,type:"json-rpc"}}if(!(0,ez.P)(e.address,{strict:!1}))throw new eU.M({address:e.address});return{address:e.address,nonceManager:e.nonceManager,sign:e.sign,signAuthorization:e.signAuthorization,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:"custom",type:"local"}}({address:(0,th.M)(n),nonceManager:r,sign:async({hash:t})=>tm({hash:t,privateKey:e,to:"hex"}),signAuthorization:async t=>tb({...t,privateKey:e}),signMessage:async({message:t})=>tv({message:t,privateKey:e}),signTransaction:async(t,{serializer:r}={})=>t_({privateKey:e,transaction:t,serializer:r}),signTypedData:async t=>tA({...t,privateKey:e})}),publicKey:n,source:"privateKey"}}(t)});return rz(r)?n.extend(p.$).extend(e=>({sendTransaction:t=>tB(e,t),signTransaction:t=>tN(e,t),deployContract:t=>(function(e,t){let{abi:r,args:n,bytecode:i,deploymentType:s,salt:a,...o}=t,l=function(e){let{abi:t,args:r,bytecode:n,deploymentType:i,salt:s}=e;if(!r||0===r.length){let{functionName:e,argsContractDeployer:t}=tk(i,s??tI.t,(0,Z.nj)(e6(n)),"0x");return(0,A.p)({abi:tP,functionName:e,args:t})}let a=t.find(e=>"type"in e&&"constructor"===e.type);if(!a)throw new tC.YW({docsPath:t$});if(!("inputs"in a)||!a.inputs||0===a.inputs.length)throw new tC.YF({docsPath:t$});let o=(0,tS.h)(a.inputs,r),{functionName:l,argsContractDeployer:c}=tk(i,s??tI.t,(0,Z.nj)(e6(n)),o);return(0,A.p)({abi:tP,functionName:l,args:c})}({abi:r,args:n,bytecode:i,deploymentType:s,salt:a});return o.factoryDeps=o.factoryDeps||[],o.factoryDeps.includes(i)||o.factoryDeps.push(i),tR(e,{...o,data:l,to:"create2"===s||"create2Account"===s?"0x0000000000000000000000000000000000010000":"0x0000000000000000000000000000000000008006"})})(e,t),writeContract:t=>P(Object.assign(e,{sendTransaction:t=>tB(e,t)}),t)})):n.extend(p.$)}function rD(e){return rB("base-sepolia",e)}function rM(e){return rB("avalanche-fuji",e)}function rU(e){return"object"==typeof e&&null!==e&&"chain"in e&&"transport"in e}function rj(e){return"object"==typeof e&&null!==e&&"string"==typeof e.address&&"string"==typeof e.type&&"function"==typeof e.sign&&"function"==typeof e.signMessage&&"function"==typeof e.signTypedData&&"function"==typeof e.signTransaction}function rL(e){if(!e)throw Error("NETWORK environment variable is not set");switch(e){case"abstract":return e8;case"abstract-testnet":return e4;case"base":return e7;case"base-sepolia":return te;case"avalanche":return tt;case"avalanche-fuji":return tr;case"sei":return tn;case"sei-testnet":return ti;case"polygon":return ts;case"polygon-amoy":return ta;case"peaq":return to;case"story":return tl;case"educhain":return tc;case"iotex":return tu;case"iotex-testnet":return td;case"skale-base-sepolia":return rT;default:throw Error(`Unsupported network: ${e}`)}}var rF=new Set([2741,11124]);function rz(e){return rF.has(e.id)}function rq(e){return rt(e?(0,rr.xn)(e):(0,rr.xn)("https://api.devnet.solana.com"))}function rW(e){return rt(e?(0,rr.rC)(e):(0,rr.rC)("https://api.mainnet-beta.solana.com"))}function rH(e,t){if("solana-devnet"===e)return rq(t);if("solana"===e)return rW(t);throw Error("Invalid network")}function rK(e,t){if("solana-devnet"===e)return r_((0,rr.xn)(t?rV(t):"wss://api.devnet.solana.com"));if("solana"===e)return r_((0,rr.rC)(t?rV(t):"wss://api.mainnet-beta.solana.com"));throw Error("Invalid network")}function rV(e){return e.startsWith("http")?e.replace("http","ws"):e}function rG(e){if(!rk.find(t=>t===e))throw Error(`Unsupported SVM network: ${e}`);return rH(e)}async function rJ(e){let t=tM.tw.decode(e);if(64===t.length)return await (0,tD.Lt)(t);
3if(32===t.length)return await (0,tD.bY)(t);throw Error(`Unexpected key length: ${t.length}. Expected 32 or 64 bytes.`)}function rY(e){return"object"==typeof e&&null!==e&&(0,tD.Pl)(e)}l({},{authorizationPrimaryType:()=>rQ,authorizationTypes:()=>rZ,config:()=>c,createClientAvalancheFuji:()=>rR,createClientSepolia:()=>rN,createConnectedClient:()=>rO,createSigner:()=>rB,createSignerAvalancheFuji:()=>rM,createSignerSepolia:()=>rD,getChainFromNetwork:()=>rL,isAccount:()=>rj,isSignerWallet:()=>rU,isZkStackChain:()=>rz,usdcABI:()=>u});var rZ={TransferWithAuthorization:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"validAfter",type:"uint256"},{name:"validBefore",type:"uint256"},{name:"nonce",type:"bytes32"}]},rQ="TransferWithAuthorization";l({},{SvmAddressRegex:()=>rX});var rX=/^[1-9A-HJ-NP-Za-km-z]{32,44}$/,r0=/^0x[0-9a-fA-F]{40}$/,r1=/^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$/,r2=["exact"],r5=[1],r6=["insufficient_funds","invalid_exact_evm_payload_authorization_valid_after","invalid_exact_evm_payload_authorization_valid_before","invalid_exact_evm_payload_authorization_value","invalid_exact_evm_payload_signature","invalid_exact_evm_payload_undeployed_smart_wallet","invalid_exact_evm_payload_recipient_mismatch","invalid_exact_svm_payload_transaction","invalid_exact_svm_payload_transaction_amount_mismatch","invalid_exact_svm_payload_transaction_create_ata_instruction","invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee","invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset","invalid_exact_svm_payload_transaction_instructions","invalid_exact_svm_payload_transaction_instructions_length","invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction","invalid_exact_svm_payload_transaction_instructions_compute_price_instruction","invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high","invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked","invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked","invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts","invalid_exact_svm_payload_transaction_fee_payer_transferring_funds","invalid_exact_svm_payload_transaction_not_a_transfer_instruction","invalid_exact_svm_payload_transaction_receiver_ata_not_found","invalid_exact_svm_payload_transaction_sender_ata_not_found","invalid_exact_svm_payload_transaction_simulation_failed","invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata","invalid_network","invalid_payload","invalid_payment_requirements","invalid_scheme","invalid_payment","payment_expired","unsupported_scheme","invalid_x402_version","invalid_transaction_state","invalid_x402_version","settle_exact_svm_block_height_exceeded","settle_exact_svm_transaction_confirmation_timed_out","unsupported_scheme","unexpected_settle_error","unexpected_verify_error"],r3=e=>Number.isInteger(Number(e))&&Number(e)>=0,r8=d.Yj().regex(r0).or(d.Yj().regex(rX)),r4=d.Yj().regex(r1).or(d.Yj().regex(rX)),r9=d.Ik({scheme:d.k5(r2),network:rP,maxAmountRequired:d.Yj().refine(r3),resource:d.Yj().url(),description:d.Yj(),mimeType:d.Yj(),outputSchema:d.g1(d.bz()).optional(),payTo:r8,maxTimeoutSeconds:d.ai().int(),asset:r4,extra:d.g1(d.bz()).optional()}),r7=d.Ik({from:d.Yj().regex(r0),to:d.Yj().regex(r0),value:d.Yj().refine(r3).refine(e=>e.length<=18),validAfter:d.Yj().refine(r3),validBefore:d.Yj().refine(r3),nonce:d.Yj().regex(/^0x[0-9a-fA-F]{64}$/)}),ne=d.Ik({signature:d.Yj().regex(/^0x[0-9a-fA-F]+$/),authorization:r7}),nt=d.Ik({transaction:d.Yj().regex(/^[A-Za-z0-9+/]*={0,2}$/)}),nr=d.Ik({x402Version:d.ai().refine(e=>r5.includes(e)),scheme:d.k5(r2),network:rP,payload:d.KC([ne,nt])});d.Ik({x402Version:d.ai().refine(e=>r5.includes(e)),error:d.k5(r6).optional(),accepts:d.YO(r9).optional(),payer:d.Yj().regex(r1).optional()});var nn=d.k5(["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD"]),ni=d.Ik({type:d.eu("http"),method:nn,queryParams:d.g1(d.Yj(),d.Yj()).optional(),bodyType:d.k5(["json","form-data","multipart-form-data","text","binary"]).optional(),bodyFields:d.g1(d.Yj(),d.bz()).optional(),headerFields:d.g1(d.Yj(),d.bz()).optional()});d.gM("type",[ni]);var ns=d.Ik({resource:d.Yj(),type:d.k5(["http"]),x402Version:d.ai().refine(e=>r5.includes(e)),accepts:d.YO(r9),lastUpdated:d.p6(),metadata:d.g1(d.bz()).optional()});d.Ik({paymentPayload:nr,paymentRequirements:r9}),d.Ik({paymentPayload:nr,paymentRequirements:r9}),d.Ik({isValid:d.zM(),invalidReason:d.k5(r6).optional(),payer:r8.optional()}),d.Ik({success:d.zM(),errorReason:d.k5(r6).optional(),payer:r8.optional(),transaction:d.Yj().regex(r1),network:rP}),d.Ik({type:d.Yj().optional(),limit:d.ai().optional(),offset:d.ai().optional()}),d.Ik({x402Version:d.ai().refine(e=>r5.includes(e)),items:d.YO(ns),pagination:d.Ik({limit:d.ai(),offset:d.ai(),total:d.ai()})});var na=d.Ik({x402Version:d.ai().refine(e=>r5.includes(e)),scheme:d.k5(r2),network:rP,extra:d.g1(d.bz()).optional()});function no(e){try{let t=(0,rE.Iz)().encode(e.transaction);return(0,rA.BX)().decode(t)}catch(e){throw console.error("error",e),Error("invalid_exact_svm_payload_transaction")}}function nl(e){let t=(0,rI.fr)().decode(e.messageBytes),r=t.staticAccounts??[];for(let e of t.instructions??[]){let t=r[e.programAddressIndex].toString();if(t===rC.YsN.toString()||t===rS.du.toString()){let t=e.accountIndices??[];if(t.length>=4){let e=r[t[3]].toString();if(e)return e}}}return""}async function nc(e,t,r){let n=await nu(e,t),i=(0,rA.RO)(n);return await r.simulateTransaction(i,{sigVerify:!0,replaceRecentBlockhash:!1,commitment:"confirmed",encoding:"base64",accounts:void 0,innerInstructions:void 0,minContextSlot:void 0}).send()}async function nu(e,t){if((0,tD.D7)(e)){let[r]=await e.modifyAndSignTransactions([t]);if(!r)throw Error("transaction_signer_failed_to_return_transaction");return r}if((0,tD.Y6)(e)){var r,n;let[i]=await e.signTransactions([t]);if(!i)throw Error("transaction_signer_failed_to_return_signatures");return r=t,n=i,Object.freeze({...r,signatures:Object.freeze({...r.signatures,...n})})}throw Error("transaction_signer_must_support_offline_signing")}d.Ik({kinds:d.YO(na)}),l({},{createDevnetRpcClient:()=>rq,createMainnetRpcClient:()=>rW,createSignerFromBase58:()=>rJ,createSvmConnectedClient:()=>rG,decodeTransactionFromPayload:()=>no,getRpcClient:()=>rH,getRpcSubscriptions:()=>rK,getTokenPayerFromTransaction:()=>nl,isSignerWallet:()=>rY,signAndSimulateTransaction:()=>nc,signTransactionWithSigner:()=>nu}),d.Ik({paymentHeader:d.Yj(),paymentRequirements:r9})},2829:(e,t,r)=>{"use strict";r.d(t,{n:()=>p});var n=r(44990),i=r(66471),s=r(12089),a=r(42375),o=r(52862),l=r(10479),c=r(97314),u=r(42606),d=r(10199),f=r(77045),h=r(97994);async function p(e,t){let r,p,y,m,g,{checkReplacement:b=e.chain?.supportsTransactionReplacementDetection??!0,confirmations:w=1,hash:v,onReplaced:x,retryCount:_=6,retryDelay:E=({count:e})=>200*~~(1<<e),timeout:A=18e4}=t,I=(0,c.A)(["waitForTransactionReceipt",e.uid,v]),C=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval,S=!1,{promise:P,resolve:$,reject:k}=(0,o.Y)(),T=A?setTimeout(()=>{g?.(),m?.(),k(new i.WA({hash:v}))},A):void 0;return m=(0,a.lB)(I,{onReplaced:x,resolve:$,reject:k},async t=>{if((y=await (0,s.T)(e,f.h,"getTransactionReceipt")({hash:v}).catch(()=>void 0))&&w<=1){clearTimeout(T),t.resolve(y),m?.();return}g=(0,s.T)(e,h.q,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:C,async onBlockNumber(a){let o=e=>{clearTimeout(T),g?.(),e(),m?.()},c=a;if(!S)try{if(y){if(w>1&&(!y.blockNumber||c-y.blockNumber+1n<w))return;o(()=>t.resolve(y));return}if(b&&!r&&(S=!0,await (0,l.b)(async()=>{(r=await (0,s.T)(e,d.x,"getTransaction")({hash:v})).blockNumber&&(c=r.blockNumber)},{delay:E,retryCount:_}),S=!1),y=await (0,s.T)(e,f.h,"getTransactionReceipt")({hash:v}),w>1&&(!y.blockNumber||c-y.blockNumber+1n<w))return;o(()=>t.resolve(y))}catch(a){if(a instanceof i.Kz||a instanceof i.Kc){if(!r){S=!1;return}try{p=r,S=!0;let i=await (0,l.b)(()=>(0,s.T)(e,u.g,"getBlock")({blockNumber:c,includeTransactions:!0}),{delay:E,retryCount:_,shouldRetry:({error:e})=>e instanceof n.l});S=!1;let a=i.transactions.find(({from:e,nonce:t})=>e===p.from&&t===p.nonce);if(!a||(y=await (0,s.T)(e,f.h,"getTransactionReceipt")({hash:a.hash}),w>1&&(!y.blockNumber||c-y.blockNumber+1n<w)))return;let d="replaced";a.to===p.to&&a.value===p.value&&a.input===p.input?d="repriced":a.from===a.to&&0n===a.value&&(d="cancelled"),o(()=>{t.onReplaced?.({reason:d,replacedTransaction:p,transaction:a,transactionReceipt:y}),t.resolve(y)})}catch(e){o(()=>t.reject(e))}}else o(()=>t.reject(a))}}})}),P}},2939:(e,t,r)=>{"use strict";function n(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}r.d(t,{q:()=>n})},3303:(e,t,r)=>{"use strict";r.d(t,{S:()=>o});var n=r(11577),i=r(92733),s=r(36665),a=r(651);function o(e,t){let r=(0,n.lY)((0,i.q)(e,{strict:!1})?(0,s.ZJ)(e):e);return"bytes"===(t||"hex")?r:(0,a.nj)(r)}},3374:(e,t,r)=>{"use strict";r.d(t,{lG:()=>ea,Lj:()=>es});var n=r(75834),i=r(77),s=r(63455);function a(e,t,r,i){let a=(0,s.Y)(r);(0,n.useEffect)(()=>{function r(e){a.current(e)}return(e=null!=e?e:window).addEventListener(t,r,i),()=>e.removeEventListener(t,r,i)},[e,t,i])}var o=r(53986),l=r(35424),c=r(20824),u=r(53160),d=r(63349),f=r(7706),h=r(48855),p=r(30749),y=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(y||{});let m=(0,p.FX)(function(e,t){var r;let{features:n=1,...i}=e,s={ref:t,"aria-hidden":(2&n)==2||(null!=(r=i["aria-hidden"])?r:void 0),hidden:(4&n)==4||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(4&n)==4&&(2&n)!=2&&{display:"none"}}};return(0,p.Ci)()({ourProps:s,theirProps:i,slot:{},defaultTag:"span",name:"Hidden"})});var g=r(36207),b=r(56300);let w=(0,n.createContext)(null);function v({children:e,node:t}
3){let[r,i]=(0,n.useState)(null),s=x(null!=t?t:r);return n.createElement(w.Provider,{value:s},e,null===s&&n.createElement(m,{features:y.Hidden,ref:e=>{var t,r;if(e){for(let n of null!=(r=null==(t=(0,b.TW)(e))?void 0:t.querySelectorAll("html > *, body > *"))?r:[])if(n!==document.body&&n!==document.head&&g.vq(n)&&null!=n&&n.contains(e)){i(n);break}}}}))}function x(e=null){var t;return null!=(t=(0,n.useContext)(w))?t:e}var _=r(42301),E=r(88160),A=r(1808),I=r(52368);let C=(0,n.createContext)(()=>{});function S({value:e,children:t}){return n.createElement(C.Provider,{value:e},t)}var P=r(67714),$=r(33106),k=r(97010),T=r(29908),O=r(6194),N=r(68139),R=r(60031),B=r(96313),D=r(79608),M=r(5453),U=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(U||{});function j(e,t){let r=(0,n.useRef)([]),i=(0,l._)(e);(0,n.useEffect)(()=>{let e=[...r.current];for(let[n,s]of t.entries())if(r.current[n]!==s){let n=i(t,e);return r.current=t,n}},[i,...t])}var L=r(70393);let F=[];!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){if(!g.Lk(e.target)||e.target===document.body||F[0]===e.target)return;let t=e.target;t=t.closest(L.Uo),F.unshift(null!=t?t:e.target),(F=F.filter(e=>null!=e&&e.isConnected)).splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var z=r(78615);function q(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let r of e.current)g.vq(r.current)&&t.add(r.current);return t}var W=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(W||{});let H=Object.assign((0,p.FX)(function(e,t){let r,i=(0,n.useRef)(null),s=(0,I.P)(i,t),{initialFocus:c,initialFocusFallback:u,containers:d,features:f=15,...w}=e;(0,E.g)()||(f=0);let v=(0,h.g)(i.current);!function(e,{ownerDocument:t}){let r=!!(8&e),i=function(e=!0){let t=(0,n.useRef)(F.slice());return j(([e],[r])=>{!0===r&&!1===e&&(0,z._)(()=>{t.current.splice(0)}),!1===r&&!0===e&&(t.current=F.slice())},[e,F,t]),(0,l._)(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(r);j(()=>{r||(0,b.X7)(null==t?void 0:t.body)&&(0,L.pW)(i())},[r]),(0,D.X)(()=>{r&&(0,L.pW)(i())})}(f,{ownerDocument:v});let x=function(e,{ownerDocument:t,container:r,initialFocus:i,initialFocusFallback:s}){let a=(0,n.useRef)(null),l=(0,o.S)(!!(1&e),"focus-trap#initial-focus"),c=(0,B.a)();return j(()=>{if(0===e)return;if(!l){null!=s&&s.current&&(0,L.pW)(s.current);return}let n=r.current;n&&(0,z._)(()=>{if(!c.current)return;let r=null==t?void 0:t.activeElement;if(null!=i&&i.current){if((null==i?void 0:i.current)===r){a.current=r;return}}else if(n.contains(r)){a.current=r;return}if(null!=i&&i.current)(0,L.pW)(i.current);else{if(16&e){if((0,L.CU)(n,L.BD.First|L.BD.AutoFocus)!==L.Me.Error)return}else if((0,L.CU)(n,L.BD.First)!==L.Me.Error)return;if(null!=s&&s.current&&((0,L.pW)(s.current),(null==t?void 0:t.activeElement)===s.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=null==t?void 0:t.activeElement})},[s,l,e]),a}(f,{ownerDocument:v,container:i,initialFocus:c,initialFocusFallback:u});!function(e,{ownerDocument:t,container:r,containers:n,previousActiveElement:i}){let s=(0,B.a)(),o=!!(4&e);a(null==t?void 0:t.defaultView,"focus",e=>{if(!o||!s.current)return;let t=q(n);g.sb(r.current)&&t.add(r.current);let a=i.current;if(!a)return;let l=e.target;g.sb(l)?K(t,l)?(i.current=l,(0,L.pW)(l)):(e.preventDefault(),e.stopPropagation(),(0,L.pW)(a)):(0,L.pW)(i.current)},!0)}(f,{ownerDocument:v,container:i,containers:d,previousActiveElement:x});let _=(r=(0,n.useRef)(0),(0,M.M)(!0,"keydown",e=>{"Tab"===e.key&&(r.current=+!!e.shiftKey)},!0),r),A=(0,l._)(e=>{if(!g.sb(i.current))return;let t=i.current;(0,O.Y)(_.current,{[U.Forwards]:()=>{(0,L.CU)(t,L.BD.First,{skipElements:[e.relatedTarget,u]}
3)},[U.Backwards]:()=>{(0,L.CU)(t,L.BD.Last,{skipElements:[e.relatedTarget,u]})}})}),C=(0,o.S)(!!(2&f),"focus-trap#tab-lock"),S=(0,R.L)(),P=(0,n.useRef)(!1),$=(0,p.Ci)();return n.createElement(n.Fragment,null,C&&n.createElement(m,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:A,features:y.Focusable}),$({ourProps:{ref:s,onKeyDown(e){"Tab"==e.key&&(P.current=!0,S.requestAnimationFrame(()=>{P.current=!1}))},onBlur(e){if(!(4&f))return;let t=q(d);g.sb(i.current)&&t.add(i.current);let r=e.relatedTarget;g.Lk(r)&&"true"!==r.dataset.headlessuiFocusGuard&&(K(t,r)||(P.current?(0,L.CU)(i.current,(0,O.Y)(_.current,{[U.Forwards]:()=>L.BD.Next,[U.Backwards]:()=>L.BD.Previous})|L.BD.WrapAround,{relativeTo:e.target}):g.Lk(e.target)&&(0,L.pW)(e.target)))}},theirProps:w,defaultTag:"div",name:"FocusTrap"}),C&&n.createElement(m,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:A,features:y.Focusable}))}),{features:W});function K(e,t){for(let r of e)if(r.contains(t))return!0;return!1}var V=r(3569),G=r(62687),J=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(J||{}),Y=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Y||{});let Z={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},Q=(0,n.createContext)(null);function X(e){let t=(0,n.useContext)(Q);if(null===t){let t=Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,X),t}return t}function ee(e,t){return(0,O.Y)(t.type,Z,e,t)}Q.displayName="DialogContext";let et=(0,p.FX)(function(e,t){let r=(0,n.useId)(),{id:s=`headlessui-dialog-${r}`,open:y,onClose:m,initialFocus:w,role:v="dialog",autoFocus:C=!0,__demoMode:O=!1,unmount:R=!1,...B}=e,D=(0,n.useRef)(!1);v="dialog"===v||"alertdialog"===v?v:(D.current||(D.current=!0,console.warn(`Invalid role [${v}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let M=(0,P.O_)();void 0===y&&null!==M&&(y=(M&P.Uw.Open)===P.Uw.Open);let U=(0,n.useRef)(null),j=(0,I.P)(U,t),L=(0,h.g)(U.current),F=+!y,[z,q]=(0,n.useReducer)(ee,{titleId:null,descriptionId:null,panelRef:(0,n.createRef)()}),K=(0,l._)(()=>m(!1)),G=(0,l._)(e=>q({type:0,id:e})),J=!!(0,E.g)()&&0===F,[Y,Z]=(0,V.k2)(),X=x(),{resolveContainers:et}=function({defaultContainers:e=[],portals:t,mainTreeNode:r}={}){let n=(0,l._)(()=>{var n,i;let s=(0,b.TW)(r),a=[];for(let t of e)null!==t&&(g.vq(t)?a.push(t):"current"in t&&g.vq(t.current)&&a.push(t.current));if(null!=t&&t.current)for(let e of t.current)a.push(e);for(let e of null!=(n=null==s?void 0:s.querySelectorAll("html > *, body > *"))?n:[])e!==document.body&&e!==document.head&&g.vq(e)&&"headlessui-portal-root"!==e.id&&(r&&(e.contains(r)||e.contains(null==(i=null==r?void 0:r.getRootNode())?void 0:i.host))||a.some(t=>e.contains(t))||a.push(e));return a});
3return{resolveContainers:n,contains:(0,l._)(e=>n().some(t=>t.contains(e)))}}({mainTreeNode:X,portals:Y,defaultContainers:[{get current(){var ei;return null!=(ei=z.panelRef.current)?ei:U.current}}]}),es=null!==M&&(M&P.Uw.Closing)===P.Uw.Closing;(0,c.v)(!O&&!es&&J,{allowed:(0,l._)(()=>{var e,t;return[null!=(t=null==(e=U.current)?void 0:e.closest("[data-headlessui-portal]"))?t:null]}),disallowed:(0,l._)(()=>{var e;return[null!=(e=null==X?void 0:X.closest("body > *:not(#headlessui-portal-root)"))?e:null]})});let ea=k.D.get(null);(0,u.s)(()=>{if(J)return ea.actions.push(s),()=>ea.actions.pop(s)},[ea,s,J]);let eo=(0,T.y)(ea,(0,n.useCallback)(e=>ea.selectors.isTop(e,s),[ea,s]));(0,f.j)(eo,et,e=>{e.preventDefault(),K()}),function(e,t="undefined"!=typeof document?document.defaultView:null,r){let n=(0,o.S)(e,"escape");a(t,"keydown",e=>{n&&(e.defaultPrevented||e.key===i.D.Escape&&r(e))})}(eo,null==L?void 0:L.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur(),K()}),(0,_.K)(!O&&!es&&J,L,et),(0,d.O)(J,U,K);let[el,ec]=(0,N.rU)(),eu=(0,n.useMemo)(()=>[{dialogState:F,close:K,setTitleId:G,unmount:R},z],[F,K,G,R,z]),ed=(0,A._)({open:0===F}),ef={ref:j,id:s,role:v,tabIndex:-1,"aria-modal":O?void 0:0===F||void 0,"aria-labelledby":z.titleId,"aria-describedby":el,unmount:R},eh=!function(){var e;let[t]=(0,n.useState)(()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null),[r,i]=(0,n.useState)(null!=(e=null==t?void 0:t.matches)&&e);return(0,u.s)(()=>{if(t)return t.addEventListener("change",e),()=>t.removeEventListener("change",e);function e(e){i(e.matches)}},[t]),r}(),ep=W.None;J&&!O&&(ep|=W.RestoreFocus,ep|=W.TabLock,C&&(ep|=W.AutoFocus),eh&&(ep|=W.InitialFocus));let ey=(0,p.Ci)();return n.createElement(P.$x,null,n.createElement($.a,{force:!0},n.createElement(V.ZL,null,n.createElement(Q.Provider,{value:eu},n.createElement(V.Ee,{target:U},n.createElement($.a,{force:!1},n.createElement(ec,{slot:ed},n.createElement(Z,null,n.createElement(H,{initialFocus:w,initialFocusFallback:U,containers:et,features:ep},n.createElement(S,{value:K},ey({ourProps:ef,theirProps:B,slot:ed,defaultTag:er,features:en,visible:0===F,name:"Dialog"})))))))))))}),er="div",en=p.Ac.RenderStrategy|p.Ac.Static,ei=(0,p.FX)(function(e,t){let{transition:r=!1,open:i,...s}=e,a=(0,P.O_)(),o=e.hasOwnProperty("open")||null!==a,l=e.hasOwnProperty("onClose");if(!o&&!l)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&"boolean"!=typeof e.open)throw Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if("function"!=typeof e.onClose)throw Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(void 0!==i||r)&&!s.static?n.createElement(v,null,n.createElement(G.e,{show:i,transition:r,unmount:s.unmount},n.createElement(et,{ref:t,...s}))):n.createElement(v,null,n.createElement(et,{ref:t,open:i,...s}))}),es=(0,p.FX)(function(e,t){let r=(0,n.useId)(),{id:i=`headlessui-dialog-panel-${r}`,transition:s=!1,...a}=e,[{dialogState:o,unmount:c},u]=X("Dialog.Panel"),d=(0,I.P)(t,u.panelRef),f=(0,A._)({open:0===o}),h=(0,l._)(e=>{e.stopPropagation()}),y=s?G._:n.Fragment,m=(0,p.Ci)();return n.createElement(y,{...s?{unmount:c}:{}},m({ourProps:{ref:d,id:i,onClick:h},theirProps:a,slot:f,defaultTag:"div",name:"Dialog.Panel"}))}),ea=Object.assign(ei,{Panel:es,Title:((0,p.FX)(function(e,t){let{transition:r=!1,...i}=e,[{dialogState:s,unmount:a}]=X("Dialog.Backdrop"),o=(0,A._)({open:0===s}),l=r?G._:n.Fragment,c=(0,p.Ci)();return n.createElement(l,{...r?{unmount:a}:{}},c({ourProps:{ref:t,"aria-hidden":!0},theirProps:i,slot:o,defaultTag:"div",name:"Dialog.Backdrop"}))}),(0,p.FX)(function(e,t){let r=(0,n.useId)(),{id:i=`headlessui-dialog-title-${r}`,...s}=e,[{dialogState:a,setTitleId:o}]=X("Dialog.Title"),l=(0,I.P)(t);(0,n.useEffect)(()=>(o(i),()=>o(null)),[i,o]);let c=(0,A._)({open:0===a});return(0,p.Ci)()({ourProps:{ref:l,id:i},theirProps:s,slot:c,defaultTag:"h2",name:"Dialog.Title"})})),Description:N.VY})},3569:(e,t,r)=>{"use strict";r.d(t,{Ee:()=>x,ZL:()=>_,k2:()=>w});var n=r(75834),i=r(60851),s=r(60031),a=r(35424),o=r(79608),l=r(48855),c=r(88160),u=r(52368),d=r(33106),f=r(63228),h=r(30749);let p=n.Fragment,y=(0,h.FX)(function(e,t){let{ownerDocument:r=null,...a}=e,y=(0,n.useRef)(null),m=(0,u.P)((0,u.a)(e=>{y.current=e}),t),w=(0,l.g)(y.current),v=function(e){let t=(0,d.S)(),r=(0,n.useContext)(g),[i,s]=(0,n.use
3State)(()=>{var n;if(!t&&null!==r)return null!=(n=r.current)?n:null;if(f._.isServer)return null;let i=null==e?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(null===e)return null;let s=e.createElement("div");return s.setAttribute("id","headlessui-portal-root"),e.body.appendChild(s)});return(0,n.useEffect)(()=>{null!==i&&(null!=e&&e.body.contains(i)||null==e||e.body.appendChild(i))},[i,e]),(0,n.useEffect)(()=>{t||null!==r&&s(r.current)},[r,s,t]),i}(null!=r?r:w),x=(0,n.useContext)(b),_=(0,s.L)(),E=(0,c.g)(),A=(0,h.Ci)();return(0,o.X)(()=>{var e;v&&v.childNodes.length<=0&&(null==(e=v.parentElement)||e.removeChild(v))}),v&&E?(0,i.createPortal)(n.createElement("div",{"data-headlessui-portal":"",ref:e=>{_.dispose(),x&&e&&_.add(x.register(e))}},A({ourProps:{ref:m},theirProps:a,slot:{},defaultTag:p,name:"Portal"})),v):null}),m=n.Fragment,g=(0,n.createContext)(null),b=(0,n.createContext)(null);function w(){let e=(0,n.useContext)(b),t=(0,n.useRef)([]),r=(0,a._)(r=>(t.current.push(r),e&&e.register(r),()=>i(r))),i=(0,a._)(r=>{let n=t.current.indexOf(r);-1!==n&&t.current.splice(n,1),e&&e.unregister(r)}),s=(0,n.useMemo)(()=>({register:r,unregister:i,portals:t}),[r,i,t]);return[t,(0,n.useMemo)(()=>function({children:e}){return n.createElement(b.Provider,{value:s},e)},[s])]}let v=(0,h.FX)(function(e,t){let r=(0,u.P)(t),{enabled:i=!0,ownerDocument:s,...a}=e,o=(0,h.Ci)();return i?n.createElement(y,{...a,ownerDocument:s,ref:r}):o({ourProps:{ref:r},theirProps:a,slot:{},defaultTag:p,name:"Portal"})}),x=(0,h.FX)(function(e,t){let{target:r,...i}=e,s={ref:(0,u.P)(t)},a=(0,h.Ci)();return n.createElement(g.Provider,{value:r},a({ourProps:s,theirProps:i,defaultTag:m,name:"Popover.Group"}))}),_=Object.assign(v,{Group:x})},3581:(e,t,r)=>{"use strict";async function n(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}r.d(t,{L:()=>n})},3832:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});class n extends Error{constructor(e,t={}){let r=t.cause instanceof n?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof n&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...r?[`Details: ${r}`]:[],"Version: [email protected]"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=i,this.metaMessages=t.metaMessages,this.shortMessage=e}}},3859:(e,t,r)=>{"use strict";r.d(t,{H4:()=>m,v8:()=>p,$$:()=>y});var n=r(74263),i=r(65409),s=r(40508),a=r(99838);class o extends a.C{constructor({domain:e}){super(`Invalid domain "${(0,s.A)(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class l extends a.C{constructor({primaryType:e,types:t}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(t))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class c extends a.C{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}var u=r(27526),d=r(44633),f=r(651),h=r(43794);function p(e){let{domain:t,message:r,primaryType:n,types:i}=e,a=(e,t)=>{let r={...t};for(let t of e){let{name:e,type:n}=t;"address"===n&&(r[e]=r[e].toLowerCase())}return r},o=i.EIP712Domain&&t?a(i.EIP712Domain,t):{},l=(()=>{if("EIP712Domain"!==n)return a(i[n],r)})();return(0,s.A)({domain:o,message:l,primaryType:n,types:i})}function y(e){let{domain:t,message:r,primaryType:s,types:a}=e,p=(e,t)=>{for(let r of e){let{name:e,type:s}=r,o=t[e],l=s.match(h.Ge);if(l&&("number"==typeof o||"bigint"==typeof o)){let[e,t,r]=l;(0,f.cK)(o,{signed:"int"===t,size:Number.parseInt(r,10)/8})}if("address"===s&&"string"==typeof o&&!(0,u.P)(o))throw new i.M({address:o});let y=s.match(h.BD);if(y){let[e,t]=y;if(t&&(0,d.E)(o)!==Number.parseInt(t,10))throw new n.BI({expectedSize:Number.parseInt(t,10),givenSize:(0,d.E)(o)})}let m=a[s];m&&(function(e){if("address"===e||"bool"===e||"string"===e||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new c({type:e})}(s),p(m,o))}};
3if(a.EIP712Domain&&t){if("object"!=typeof t)throw new o({domain:t});p(a.EIP712Domain,t)}if("EIP712Domain"!==s)if(a[s])p(a[s],r);else throw new l({primaryType:s,types:a})}function m({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},("number"==typeof e?.chainId||"bigint"==typeof e?.chainId)&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}},3901:(e,t,r)=>{"use strict";r.d(t,{Q:()=>b});var n=r(97352),i=r(15520),s=r(54051),a=r(44037),o=r(18409),l=r(30063),c=r(66471);class u extends i.C{constructor(e,{account:t,docsPath:r,chain:n,data:i,gas:s,gasPrice:a,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:f,to:h,value:p}){super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",(0,c.aO)({from:t?.address,to:h,value:void 0!==p&&`${(0,o.c)(p)} ${n?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:s,gasPrice:void 0!==a&&`${(0,l.Q)(a)} gwei`,maxFeePerGas:void 0!==u&&`${(0,l.Q)(u)} gwei`,maxPriorityFeePerGas:void 0!==d&&`${(0,l.Q)(d)} gwei`,nonce:f})].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}var d=r(31445),f=r(37289),h=r(62276),p=r(23274),y=r(61526),m=r(94383),g=r(81655);async function b(e,t){let{account:r=e.account,prepare:o=!0}=t,l=r?(0,n.J)(r):void 0,c=Array.isArray(o)?o:l?.type!=="local"?["blobVersionedHashes"]:void 0;try{let r=await (async()=>t.to?t.to:t.authorizationList&&t.authorizationList.length>0?await (0,s.g)({authorization:t.authorizationList[0]}).catch(()=>{throw new i.C("`to` is required. Could not infer from `authorizationList`")}):void 0)(),{accessList:n,authorizationList:u,blobs:d,blobVersionedHashes:f,blockNumber:b,blockTag:w,data:v,gas:x,gasPrice:_,maxFeePerBlobGas:E,maxFeePerGas:A,maxPriorityFeePerGas:I,nonce:C,value:S,stateOverride:P,...$}=o?await (0,g.ft)(e,{...t,parameters:c,to:r}):t;if(x&&t.gas!==x)return x;let k=("bigint"==typeof b?(0,a.cK)(b):void 0)||w,T=(0,y.yH)(P);(0,m.c)(t);let O=e.chain?.formatters?.transactionRequest?.format,N=(O||p.Bv)({...(0,h.o)($,{format:O}),account:l,accessList:n,authorizationList:u,blobs:d,blobVersionedHashes:f,data:v,gasPrice:_,maxFeePerBlobGas:E,maxFeePerGas:A,maxPriorityFeePerGas:I,nonce:C,to:r,value:S},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:T?[N,k??e.experimental_blockTag??"latest",T]:k?[N,k]:[N]}))}catch(r){throw function(e,{docsPath:t,...r}){return new u((()=>{let t=(0,f.l)(e,r);return t instanceof d.RM?e:t})(),{docsPath:t,...r})}(r,{...t,account:l,chain:e.chain})}}},4232:(e,t,r)=>{"use strict";r.d(t,{$:()=>i});var n=r(20169);function i(e,t){let r=(e.transactions??[]).map(e=>"string"==typeof e?e:(0,n.uP)(e));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:r,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}},4306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(57924).__exportStar(r(19081),t)},4375:(e,t,r)=>{"use strict";r.d(t,{$:()=>u,A:()=>$,B:()=>P,C:()=>O,D:()=>Q,E:()=>X,F:()=>ee,G:()=>I,H:()=>k,I:()=>c,J:()=>p,K:()=>M,L:()=>v,M:()=>Y,N:()=>el,O:()=>es,P:()=>ea,Q:()=>eo,R:()=>s,S:()=>a,T:()=>o,U:()=>l,V:()=>d,W:()=>f,X:()=>U,Y:()=>y,Z:()=>Z,_:()=>x,a:()=>b,a0:()=>N,a1:()=>S,a2:()=>h,a3:()=>ec,a4:()=>eu,a8:()=>F,a9:()=>L,aa:()=>j,b:()=>m,c:()=>w,d:()=>K,e:()=>H,f:()=>g,g:()=>W,h:()=>q,i:()=>z,j:()=>J,k:()=>D,l:()=>R,m:()=>i,n:()=>et,o:()=>B,p:()=>V,q:()=>er,r:()=>en,s:()=>n,t:()=>G,u:()=>E,v:()=>A,w:()=>_,x:()=>C,y:()=>ei,z:()=>T});let n="/api/v1/sessions",i="/api/v1/sessions/logout",s="/api/v1/siwe/init",a="/api/v1/siwe/authenticate",o="/api/v1/siwe/link",l="/api/v1/siwe/link_smart_wallet",c="/api/v1/siwe/unlink",u="/api/v1/siwe/transfer",d="/api/v1/siws/init",f="/api/v1/siws/authenticate",h="/api/v1/siws/link",p="/api/v1/siws/unlink",y="/api/v1/siws/transfer",m="/api/v1/farcaster/init",g="/api/v1/farcaster/authenticate",b="/api/v1/farcaster/link",w="/api/v1/farcaster/status",v="/api/v1/farcaster/unlink",x="/api/v1/farcaster/transfer",_="/api/v1/passwordless/init",E="/api/v1/passwordless/authenticate",A="/api/v1/passwordless/link",I="/api/v1/passwordless/unlink",C="/api/v1/passwordless/update",S="/api/v1/passwordless/transfer",P="/api/v1/passwordless_sms/init",$="/api/v1/passwordless_sms/link",k="/api/v1/passwordless_sms/unlink",T="/api/v1/passwordless_sms/authenticate",O="/api/v1/passwordless_sms/update",N="/api/v1/passwordless_sms/transfer",R="/api/v1/oauth/init",B="/api/v1/oauth/authenticate",D="/api/v1/oauth/link",M="/api/v1/oauth/unlink",U="/api/v1/oauth/transfer",j="/api/v1/recovery/oauth/init",L="/api/v1/recovery/oauth/init_icloud",F="/api/v1/recovery/oauth/authenticate",z="/api/v1/passkeys/link/init",q="/api/v1/passkeys/authenticate/init",W="/api/v1/passkeys/register/init",H="/api/v1/passkeys/link",K="/api/v1/passkeys/authenticate",V="/api/v1/passkeys/register",G="/api/v1/telegram/authenticate",J="/api/v1/telegram/link",Y="/api/v1/telegram/unlink",Z="/api/v1/telegram/transfer",Q="/api/v1/mfa/passwordless_sms/init",X="/api/v1/mfa/passkeys/init",ee="/api/v1/users/me/accept_terms",et="/api/v1/analytics_events",er="/api/v1/custom_jwt_account/authenticate",en="/api/v1/custom_jwt_account/link",ei="/api/v1/guest/authenticate",es="/api/v1/plugins/moonpay_on_ramp/sign",ea="/api/v1/funding/coinbase_on_ramp/init",eo="/api/v1/funding/coinbase_on_ramp/status",el="/api/v1/wallets/revoke",e
3c="/api/v1/users/me",eu="/api/v1/scan/transaction"},4435:e=>{"use strict";e.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},4538:(e,t,r)=>{"use strict";function n(e,{dir:t="left"}={}){let r="string"==typeof e?e.replace("0x",""):e,i=0;for(let e=0;e<r.length-1;e++)if("0"===r["left"===t?e:r.length-e-1].toString())i++;else break;return(r="left"===t?r.slice(i):r.slice(0,r.length-i),"string"==typeof e)?(1===r.length&&"right"===t&&(r=`${r}0`),`0x${r.length%2==1?`0${r}`:r}`):r}r.d(t,{B:()=>n})},4544:(e,t,r)=>{"use strict";r.d(t,{Ci:()=>a,J8:()=>l,MU:()=>c,f:()=>o});var n=r(40508),i=r(99838),s=r(70044);class a extends i.C{constructor({body:e,cause:t,details:r,headers:i,status:a,url:o}){super("HTTP request failed.",{cause:t,details:r,metaMessages:[a&&`Status: ${a}`,`URL: ${(0,s.ID)(o)}`,e&&`Request body: ${(0,n.A)(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=a,this.url=o}}class o extends i.C{constructor({maxSize:e,size:t}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${e} bytes`,`Received: ${t} bytes`],name:"ResponseBodyTooLargeError"}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e,this.size=t}}i.C;class l extends i.C{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${(0,s.ID)(r)}`,`Request body: ${(0,n.A)(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.data=t.data,this.url=r}}i.C;class c extends i.C{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,s.ID)(t)}`,`Request body: ${(0,n.A)(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=t}}},4691:(e,t,r)=>{"use strict";r.d(t,{GK:()=>E,BI:()=>A,dm:()=>C,ST:()=>S,D4:()=>g,lF:()=>b,HT:()=>v});var n=r(57168),i=r(97),s=r(39613),a=r(68229),o=r(99809),l=r(99225),c=r(21332),u=r(64959),d=r
vendor: 4,232 bytes, line 3
3(62610),f=r(22460);function h(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=d.Ej(i)}let r=[],n=[],i=0;for(let s=0;s<e.length;s++){let{dynamic:a,encoded:o}=e[s];a?(r.push(d.oB(t+i,{size:32})),n.push(o),i+=d.Ej(o)):r.push(o)}return d.xW(...r,...n)}function p(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function y(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(y);let r=p(e.type);return!!(r&&y({...e,type:r[1]}))}var m=r(75123);function g(e,t,r={}){let{as:n="Array",checksumAddress:i=!1}=r,s="string"==typeof t?c.aD(t):t,a=m.vt(s);if(0===c.Ej(s)&&e.length>0)throw new _;if(c.Ej(s)&&32>c.Ej(s))throw new x({data:"string"==typeof t?t:d.uK(t),parameters:e,size:c.Ej(s)});let o=0,u="Array"===n?[]:{};for(let t=0;t<e.length;++t){let r=e[t];o<s.length&&a.setPosition(o);let[f,h]=function e(t,r,n){let{checksumAddress:i,staticPosition:s}=n,a=p(r.type);if(a){let[n,o]=a;return function(t,r,n){let{checksumAddress:i,length:s,staticPosition:a}=n;if(null===s){let n=a+c.Ro(t.readBytes(32)),s=n+32;t.setPosition(n);let o=c.Ro(t.readBytes(32)),l=y(r),u=0,d=[];for(let n=0;n<o;++n){t.setPosition(s+(l?32*n:u));let[a,o]=e(t,r,{checksumAddress:i,staticPosition:s});u+=o,d.push(a),0===o&&(t.assertReadLimit(),t._touch())}return t.setPosition(a+32),[d,32]}if(y(r)){let n=a+c.Ro(t.readBytes(32)),o=[];for(let a=0;a<s;++a){t.setPosition(n+32*a);let[s]=e(t,r,{checksumAddress:i,staticPosition:n});o.push(s)}return t.setPosition(a+32),[o,32]}let o=0,l=[];for(let n=0;n<s;++n){let[n,s]=e(t,r,{checksumAddress:i,staticPosition:a+o});o+=s,l.push(n),0===s&&(t.assertReadLimit(),t._touch())}return[l,o]}(t,{...r,type:o},{checksumAddress:i,length:n,staticPosition:s})}if("tuple"===r.type)return function(t,r,n){let{checksumAddress:i,staticPosition:s}=n,a=0===r.components.length||r.components.some(({name:e})=>!e),o=a?[]:{},l=0;if(y(r)){let n=s+c.Ro(t.readBytes(32));for(let s=0;s<r.components.length;++s){let c=r.components[s];t.setPosition(n+l);let[u,d]=e(t,c,{checksumAddress:i,staticPosition:n});l+=d,o[a?s:c?.name]=u}return t.setPosition(s+32),[o,32]}for(let n=0;n<r.components.length;++n){let c=r.components[n],[u,d]=e(t,c,{checksumAddress:i,staticPosition:s});o[a?n:c?.name]=u,l+=d}return[o,l]}(t,r,{checksumAddress:i,staticPosition:s});if("address"===r.type)return function(e,t={}){let r,{checksum:n=!1}=t,i=e.readBytes(32);return[(r=d.uK(c.di(i,-20)),n?l.cM(r):r),32]}(t,{checksum:i});if("bool"===r.type){var o;return o=t,[c.G4(o.readBytes(32),{size:32}),32]}if(r.type.startsWith("bytes"))return function(e,t,{staticPosition:r}){let[n,i]=t.type.split("bytes");if(!i){let t=c.Ro(e.readBytes(32));e.setPosition(r+t);let n=c.Ro(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];let i=e.readBytes(n);return e.setPosition(r+32),[d.uK(i),32]}return[d.uK(e.readBytes(Number.parseInt(i,10),32)),32]}(t,r,{staticPosition:s});if(r.type.startsWith("uint")||r.type.startsWith("int")){var u=t,f=r;let e=f.type.startsWith("int"),n=Number.parseInt(f.type.split("int")[1]||"256",10),i=u.readBytes(32);return[n>48?c.Dg(i,{signed:e}):c.Ro(i,{signed:e}),32]}if("string"===r.type)return function(e,{staticPosition:t}){let r=c.Ro(e.readBytes(32));e.setPosition(t+r);let n=c.Ro(e.readBytes(32));if(0===n)return e.setPosition(t+32),["",32];let i=e.readBytes(n,32),s=c.dI(c.Mr(i));return e.setPosition(t+32),[s,32]}(t,{staticPosition:s});throw new S(r.type)}(a,r,{checksumAddress:i,staticPosition:0});o+=h,"Array"===n?u.push(f):u[r.name??t]=f}return u}function b(e,t,r){let{checksumAddress:n=!1}=r??{};if(e.length!==t.length)throw new I({expectedLength:e.length,givenLength:t.length});let i=h(function({checksumAddress:e,parameters:t,values:r}){let n=[];for(let i=0;i<t.length;i++)n.push(function e({checksumAddress:t=!1,parameter:r,value:n}){let i=p(r.type);if(i){let[s,a]=i;return function(t,r){let{checksumAddress:n,length:i,parameter:s}=r,a=null===i;if(!Array.isArray(t))throw new C(t);if(!a&&t.length!==i)throw new E({expectedLength:i,givenLength:t.length,type:`${s.type}[${i}]`});let o=0===t.length&&y(s),l=[];for(let r=0;r<t.length;r++){let i=e({checksumAddress:n,parameter:s,value:t[r]});i.dynamic&&(o=!0),l.push(i)}
vendor: 2,218 bytes, line 3
3if(a||o){let e=h(l);if(a){let t=d.oB(l.length,{size:32});return{dynamic:!0,encoded:l.length>0?d.xW(t,e):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:d.xW(...l.map(({encoded:e})=>e))}}(n,{checksumAddress:t,length:s,parameter:{...r,type:a}})}if("tuple"===r.type)return function(t,r){let{checksumAddress:n,parameter:i}=r,s=!1,a=[];for(let r=0;r<i.components.length;r++){let o=i.components[r],l=Array.isArray(t)?r:o.name,c=e({checksumAddress:n,parameter:o,value:t[l]});a.push(c),c.dynamic&&(s=!0)}return{dynamic:s,encoded:s?h(a):d.xW(...a.map(({encoded:e})=>e))}}(n,{checksumAddress:t,parameter:r});if("address"===r.type){var s=n,a={checksum:t};let{checksum:e=!1}=a;return l.vA(s,{strict:e}),{dynamic:!1,encoded:d.Ho(s.toLowerCase())}}if("bool"===r.type){var o=n;if("boolean"!=typeof o)throw new u.C(`Invalid boolean value: "${o}" (type: ${typeof o}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:d.Ho(d.xb(o))}}if(r.type.startsWith("uint")||r.type.startsWith("int")){let e=r.type.startsWith("int"),[,,t="256"]=f.Ge.exec(r.type)??[];return function(e,{signed:t,size:r}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,i=t?-n-1n:0n;if(e>n||e<i)throw new d.Ty({max:n.toString(),min:i.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:d.oB(e,{size:32,signed:t})}}(n,{signed:e,size:Number(t)})}if(r.type.startsWith("bytes"))return function(e,{type:t}){let[,r]=t.split("bytes"),n=d.Ej(e);if(!r){let t=e;return n%32!=0&&(t=d.M7(t,32*Math.ceil((e.length-2)/2/32))),{dynamic:!0,encoded:d.xW(d.Ho(d.oB(n,{size:32})),t)}}if(n!==Number.parseInt(r,10))throw new A({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:d.M7(e)}}(n,{type:r.type});if("string"===r.type){var c=n;let e=d.sH(c),t=Math.ceil(d.Ej(e)/32),r=[];for(let n=0;n<t;n++)r.push(d.M7(d.di(e,32*n,(n+1)*32)));return{dynamic:!0,encoded:d.xW(d.M7(d.oB(d.Ej(e),{size:32})),...r)}}throw new S(r.type)}({checksumAddress:e,parameter:t[i],value:r[i]}));return n}({checksumAddress:n,parameters:e,values:t}));return 0===i.length?"0x":i}function w(e,t){if(e.length!==t.length)throw new I({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let i=e[n],s=t[n];
3r.push(w.encode(i,s))}return d.xW(...r)}function v(e){return Array.isArray(e)&&"string"==typeof e[0]||"string"==typeof e?function(e){let t=[];if("string"==typeof e){let r=(0,a.NV)(e),n=r.length;for(let e=0;e<n;e++)t.push((0,a.Pj)(r[e],{modifiers:i.Dv}))}else{let r=(0,s.e)(e),n=e.length;for(let s=0;s<n;s++){let n=e[s];if((0,i.WL)(n))continue;let o=(0,a.NV)(n),l=o.length;for(let e=0;e<l;e++)t.push((0,a.Pj)(o[e],{modifiers:i.Dv,structs:r}))}}if(0===t.length)throw new n.A9({params:e});return t}(e):e}(w||(w={})).encode=function e(t,r,n=!1){if("address"===t)return l.vA(r),d.Ho(r.toLowerCase(),32*!!n);if("string"===t)return d.sH(r);if("bytes"===t)return r;if("bool"===t)return d.Ho(d.xb(r),n?32:1);let i=t.match(f.Ge);if(i){let[e,t,s="256"]=i,a=Number.parseInt(s,10)/8;return d.oB(r,{size:n?32:a,signed:"int"===t})}let s=t.match(f.BD);if(s){let[e,t]=s;if(Number.parseInt(t,10)!==(r.length-2)/2)throw new A({expectedSize:Number.parseInt(t,10),value:r});return d.M7(r,32*!!n)}let a=t.match(f.D5);if(a&&Array.isArray(r)){let[t,n]=a,i=[];for(let t=0;t<r.length;t++)i.push(e(n,r[t],!0));return 0===i.length?"0x":d.xW(...i)}throw new S(t)};class x extends u.C{constructor({data:e,parameters:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${o.Q(t)})`,`Data:   ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class _ extends u.C{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class E extends u.C{constructor({expectedLength:e,givenLength:t,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${t}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class A extends u.C{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${d.Ej(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class I extends u.C{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding parameters/values length mismatch.
4Expected length (parameters): ${e}
5Given length (values): ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class C extends u.C{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class S extends u.C{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}},4884:(e,t,r)=>{"use strict";r.d(t,{Q:()=>i});var n=r(11692);async function i(e,{address:t,blockHash:r,blockNumber:i,blockTag:s="latest",requireCanonical:a}){let o=(0,n.O)({blockHash:r,blockNumber:i,blockTag:s,requireCanonical:a}),l=await e.request({method:"eth_getCode",params:[t,o]},{dedupe:"bigint"==typeof i||void 0!==r});if("0x"!==l)return l}},4891:(e,t,r)=>{"use strict";function n(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}r.d(t,{C:()=>n})},5360:(e,t,r)=>{"use strict";r.d(t,{V:()=>s});var n=r(24654),i=r(9102);let s=e=>(0,n.di)((0,i.k)(e),0,4)},5453:(e,t,r)=>{"use strict";r.d(t,{M:()=>s});var n=r(75834),i=r(63455);function s(e,t,r,s){let a=(0,i.Y)(r);(0,n.useEffect)(()=>{if(e)return window.addEventListener(t,r,s),()=>window.removeEventListener(t,r,s);function r(e){a.current(e)}},[e,t,s])}},5596:(e,t,r)=>{"use strict";r.d(t,{IQ:()=>d,ME:()=>u,Nx:()=>c,Sl:()=>o,uU:()=>l});var n=r(59206),i=r(44633),s=r(38112),a=r(36665);function o(e,{size:t}){if((0,i.E)(e)>t)throw new n.u({givenSize:(0,i.E)(e),maxSize:t})}function l(e,t={}){let{signed:r}=t;t.size&&o(e,{size:t.size});let n=BigInt(e);if(!r)return n;let i=(e.length-2)/2;return n<=(1n<<8n*BigInt(i)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function c(e,t={}){let r=e;if(t.size&&(o(r,{size:t.size}),r=(0,s.B)(r)),"0x00"===(0,s.B)(r))return!1;if("0x01"===(0,s.B)(r))return!0;throw new n.H2(r)}function u(e,t={}){let r=l(e,t),i=Number(r);
5if(!Number.isSafeInteger(i))throw new n.Ty({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${r}n`});return i}function d(e,t={}){let r=(0,a.aT)(e);return t.size&&(o(r,{size:t.size}),r=(0,s.B)(r,{dir:"right"})),new TextDecoder().decode(r)}},5635:(e,t,r)=>{"use strict";r.d(t,{$C:()=>o,Bq:()=>h,C1:()=>d,FU:()=>w,Ns:()=>m,O6:()=>i,QM:()=>s,Ru:()=>p,Sc:()=>l,XA:()=>y,iO:()=>b,mC:()=>c,pI:()=>g,vt:()=>v,xL:()=>u,xv:()=>a});var n=r(31911);function i(e,t){return e.length===t.length&&e.every((e,r)=>e===t[r])}function s(e,t){return"fixedSize"in t?t.fixedSize:t.getSizeFromValue(e)}function a(e){return Object.freeze({...e,encode:t=>{let r=new Uint8Array(s(t,e));return e.write(t,r,0),r}})}function o(e){return Object.freeze({...e,decode:(t,r=0)=>e.read(t,r)[0]})}function l(e){return"fixedSize"in e&&"number"==typeof e.fixedSize}function c(e,t){if(l(e)!==l(t))throw new n.tsw(n.CvZ);if(l(e)&&l(t)&&e.fixedSize!==t.fixedSize)throw new n.tsw(n.Uq4,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!l(e)&&!l(t)&&e.maxSize!==t.maxSize)throw new n.tsw(n.SHY,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}}function u(e,t,r=0){if(t.length-r<=0)throw new n.tsw(n.Ot7,{codecDescription:e})}function d(e,t,r,i=0){let s=r.length-i;if(s<t)throw new n.tsw(n.Uyo,{bytesLength:s,codecDescription:e,expected:t})}function f(e,t,r){if(t<0||t>r)throw new n.tsw(n.v8P,{bytesLength:r,codecDescription:e,offset:t})}function h(e,t){let r=(r,n,i)=>{let s=e.encode(r);return i=t.write(s.length,n,i),n.set(s,i),i+s.length};if(l(t)&&l(e))return a({...e,fixedSize:t.fixedSize+e.fixedSize,write:r});let n=l(t)?t.fixedSize:t.maxSize??null,i=l(e)?e.fixedSize:e.maxSize??null,o=null!==n&&null!==i?n+i:null;return a({...e,...null!==o?{maxSize:o}:{}
5,getSizeFromValue:r=>{let n=s(r,e);return s(n,t)+n},write:r})}function p(e,t){let r=(r,n)=>{let[i,s]=t.read(r,n),a=Number(i);return((n=s)>0||r.length>a)&&(r=r.slice(n,n+a)),d("addDecoderSizePrefix",a,r),[e.decode(r),n+a]};if(l(t)&&l(e))return o({...e,fixedSize:t.fixedSize+e.fixedSize,read:r});let n=l(t)?t.fixedSize:t.maxSize??null,i=l(e)?e.fixedSize:e.maxSize??null,s=null!==n&&null!==i?n+i:null;return o({...e,...null!==s?{maxSize:s}:{},read:r})}function y(e,t,r){let n,i=e.byteOffset+(t??0),s=r??e.byteLength;return"undefined"==typeof SharedArrayBuffer?n=e.buffer:e.buffer instanceof SharedArrayBuffer?new Uint8Array(n=new ArrayBuffer(e.length)).set(new Uint8Array(e)):n=e.buffer,(0===i||i===-e.byteLength)&&s===e.byteLength?n:n.slice(i,i+s)}function m(e,t){return a({fixedSize:t,write:(r,n,i)=>{let s=e.encode(r),a=s.length>t?s.slice(0,t):s;return n.set(a,i),i+t}})}function g(e,t){return o({fixedSize:t,read:(r,n)=>{let i,s;d("fixCodecSize",t,r,n),(n>0||r.length>t)&&(r=r.slice(n,n+t)),l(e)&&(i=r,s=e.fixedSize,r=function(e,t){if(e.length>=t)return e;let r=new Uint8Array(t).fill(0);return r.set(e),r}(i.length<=s?i:i.slice(0,s),s));let[a]=e.read(r,0);return[a,n+t]}})}function b(e,t){var r,i;return r=function(e,t){if(l(e)){let r=t(e.fixedSize);if(r<0)throw new n.tsw(n.rIW,{bytesLength:r,codecDescription:"resizeDecoder"});return o({...e,fixedSize:r})}return e}(e,e=>e+t),i={postOffset:({postOffset:e})=>e+t},o({...r,read:(e,t)=>{let n=t=>{var r,n;return r=t,0===(n=e.length)?0:(r%n+n)%n},s=i.preOffset?i.preOffset({bytes:e,preOffset:t,wrapBytes:n}):t;f("offsetDecoder",s,e.length);let[a,o]=r.read(e,s),l=i.postOffset?i.postOffset({bytes:e,newPreOffset:s,postOffset:o,preOffset:t,wrapBytes:n}):o;return f("offsetDecoder",l,e.length),[a,l]}})}function w(e,t){return a({...!l(e)?{...e,getSizeFromValue:r=>e.getSizeFromValue(t(r))}:e,write:(r,n,i)=>e.write(t(r),n,i)})}function v(e,t){return o({...e,read:(r,n)=>{let[i,s]=e.read(r,n);return[t(i,r,n),s]}})}},5755:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(10077).A)("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]])},6194:(e,t,r)=>{"use strict";function n(e,t,...r){if(e in t){let n=t[e];return"function"==typeof n?n(...r):n}let i=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,n),i}r.d(t,{Y:()=>n})},6274:(e,t,r)=>{"use strict";r.d(t,{PW:()=>u,Tq:()=>x,Vm:()=>d,XF:()=>y,Xg:()=>p,hl:()=>f,jw:()=>h,o0:()=>v});var n,i,s=r(5635),a=r(44116),o=r(31911),l=r(73181);function c(){return n||(n=(0,a.nZ)()),n}function u(e){if(e.length<32||e.length>44)return!1;let t=c();try{return 32===t.encode(e).byteLength}catch{return!1}}function d(e){if(e.length<32||e.length>44)throw new o.tsw(o.VCG,{actualLength:e.length});let t=c().encode(e).byteLength;if(32!==t)throw new o.tsw(o.ncp,{actualLength:t})}function f(e){return d(e),e}function h(){return(0,s.FU)((0,s.Ns)(c(),32),e=>f(e))}function p(){return(0,s.pI)((i||(i=(0,a.BC)()),i),32)}function y(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}function m(e){let t=e%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn;return t>=0n?t:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn+t}function g(e,t){let r=e;for(;t-- >0n;)r*=r,r%=0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn;return r}var b=[80,114,111,103,114,97,109,68,101,114,105,118,101,100,65,100,100,114,101,115,115];async function w({programAddress:e,seeds:t}){let r;if((0,l.cr)(),t.length>16)throw new o.tsw(o.R_T,{actual:t.length,maxSeeds:16});let n=t.reduce((e,t,n)=>{let i="string"==typeof t?(r||=new TextEncoder).encode(t):t;if(i.byteLength>32)throw new o.tsw(o.nNU,{actual:i.byteLength,index:n,maxSeedLength:32});return e.push(...i),e},[]),i=(0,s.mC)(h(),p()),a=i.encode(e),c=await crypto.subtle.digest("SHA-256",
5new Uint8Array([...n,...a,...b])),u=new Uint8Array(c);if(32===u.byteLength&&function(e,t){let r=m(e*e),n=function(e,t){let r=m(t*t*t),n=function(e){let t=e*e%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn*e%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,r=g(t,2n)*t%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,n=g(r,1n)*e%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,i=g(n,5n)*n%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,s=g(i,10n)*i%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,a=g(s,20n)*s%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,o=g(a,40n)*a%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,l=g(o,80n)*o%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,c=g(l,80n)*o%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,u=g(c,10n)*i%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn;return g(u,2n)*e%0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn}(e*m(r*r*t)),i=m(e*r*n),s=m(t*i*i),a=i,o=m(0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n*i),l=s===e,c=s===m(-e),u=s===m(-(0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n*e));return(l&&(i=a),(c||u)&&(i=o),(1n&m(i))===1n&&(i=m(-i)),l||c)?i:null}(m(r-1n),m(0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n*r+1n));return null!==n&&(0n!==n||(128&t)==0)}(function(e){let t=e.reduce((e,t,r)=>`${function(e){let t=e.toString(16);return 1===t.length?`0${t}`:t}(31===r?-129&t:t)}${e}`,"");return BigInt(`0x${t}`)}(u),u[31]))throw new o.tsw(o.Ji6);return i.decode(u)}async function v({programAddress:e,seeds:t}){let r=255;for(;r>0;)try{return[await w({programAddress:e,seeds:[...t,new Uint8Array([r])]}),r]}catch(e){if((0,o.zbS)(e,o.Ji6))r--;else throw e}throw new o.tsw(o.Y0g)}async function x(e){if((0,l.sw)(),"public"!==e.type||"Ed25519"!==e.algorithm.name)throw new o.tsw(o.xZX);let t=await crypto.subtle.exportKey("raw",e);return p().decode(new Uint8Array(t))}},6307:(e,t,r)=>{"use strict";r.d(t,{_:()=>s});var n=r(75834);let i=(0,n.createContext)(void 0);function s(){return(0,n.useContext)(i)}},6825:(e,t,r)=>{"use strict";r.d(t,{rC:()=>s,xn:()=>a,yF:()=>i});var n=r(6274);function i(e){return(0,n.PW)(e)}function s(e){return e}function a(e){return e}},7265:(e,t,r)=>{let n=r(2801);function i(e,t,r,n,i,a){l[e]=l[e]+l[t]+i,l[n]=s(l[n]^l[e],16),l[r]=l[r]+l[n],l[t]=s(l[t]^l[r],12),l[e]=l[e]+l[t]+a,l[n]=s(l[n]^l[e],8),l[r]=l[r]+l[n],l[t]=s(l[t]^l[r],7)}function s(e,t){return e>>>t^e<<32-t}
5let a=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),o=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),l=new Uint32Array(16),c=new Uint32Array(16);function u(e,t){let r=0;for(r=0;r<8;r++)l[r]=e.h[r],l[r+8]=a[r];for(l[12]^=e.t,l[13]^=e.t/0x100000000,t&&(l[14]=~l[14]),r=0;r<16;r++){var n,s;c[r]=(n=e.b)[s=4*r]^n[s+1]<<8^n[s+2]<<16^n[s+3]<<24}for(r=0;r<10;r++)i(0,4,8,12,c[o[16*r+0]],c[o[16*r+1]]),i(1,5,9,13,c[o[16*r+2]],c[o[16*r+3]]),i(2,6,10,14,c[o[16*r+4]],c[o[16*r+5]]),i(3,7,11,15,c[o[16*r+6]],c[o[16*r+7]]),i(0,5,10,15,c[o[16*r+8]],c[o[16*r+9]]),i(1,6,11,12,c[o[16*r+10]],c[o[16*r+11]]),i(2,7,8,13,c[o[16*r+12]],c[o[16*r+13]]),i(3,4,9,14,c[o[16*r+14]],c[o[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=l[r]^l[r+8]}function d(e,t){if(!(e>0&&e<=32))throw Error("Incorrect output length, should be in [1, 32]");let r=t?t.length:0;if(t&&!(r>0&&r<=32))throw Error("Incorrect key length, should be in [1, 32]");let n={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=0x1010000^r<<8^e,r>0&&(f(n,t),n.c=64),n}function f(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,u(e,!1),e.c=0),e.b[e.c++]=t[r]}function h(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;u(e,!0);let t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function p(e,t,r){r=r||32,e=n.normalizeInput(e);let i=d(r,t);return f(i,e),h(i)}e.exports={blake2s:p,blake2sHex:function(e,t,r){let i=p(e,t,r);return n.toHex(i)},blake2sInit:d,blake2sUpdate:f,blake2sFinal:h}},7287:(e,t,r)=>{"use strict";var n=(function(e){e&&"object"==typeof e&&"default"in e&&e.default}(r(75834)),r(33790)),i=new n,s=i.getBrowser(),a=i.getCPU(),o=i.getDevice(),l=i.getEngine(),c=i.getOS(),u=i.getUA(),d=function(e){if(!e)return void console.error("No userAgent string was provided");var t=new n(e);return{UA:t,browser:t.getBrowser(),cpu:t.getCPU(),device:t.getDevice(),engine:t.getEngine(),os:t.getOS(),ua:t.getUA(),setUserAgent:function(e){return t.setUA(e)}}},f=Object.freeze({ClientUAInstance:i,browser:s,cpu:a,device:o,engine:l,os:c,ua:u,setUa:function(e){return i.setUA(e)},parseUserAgent:d}),h={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},p={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},y={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},m={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";return e||t},b=function(){return!!("undefined"!=typeof window&&(window.navigator||navigator))&&(window.navigator||navigator)},w=function(e){var t=b();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},v=function(e){return e.type===h.Mobile},x=function(e){return e.type===h.Tablet},_=function(e){var t=e.type;return t===h.Mobile||t===h.Tablet},E=function(e){return e.type===h.SmartTv},A=function(e){return e.type===h.Browser},I=function(e){return e.type===h.Wearable},C=function(e){return e.type===h.Console},S=function(e){return e.type===h.Embedded},P=function(e){return g(e.vendor)},$=function(e){return g(e.model)},k=function(e){return g(e.type,"browser")},T=function(e){return e.name===y.Android},O=function(e){return e.name===y.Windows},N=function(e){return e.name===y.MAC_OS},R=function(e){return e.name===y.WindowsPhone},B=function(e){return e.name===y.IOS},D=function(e){return g(e.version)},M=function(e){return g(e.name)}
5,U=function(e){return e.name===p.Chrome},j=function(e){return e.name===p.Firefox},L=function(e){return e.name===p.Chromium},F=function(e){return e.name===p.Edge},z=function(e){return e.name===p.Yandex},q=function(e){var t=e.name;return t===p.Safari||t===p.MobileSafari},W=function(e){return e.name===p.MobileSafari},H=function(e){return e.name===p.Opera},K=function(e){var t=e.name;return t===p.InternetExplorer||t===p.Ie},V=function(e){return e.name===p.MIUI},G=function(e){return e.name===p.SamsungBrowser},J=function(e){return g(e.version)},Y=function(e){return g(e.major)},Z=function(e){return g(e.name)},Q=function(e){return g(e.name)},X=function(e){return g(e.version)},ee=function(){var e=b(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)},et=function(e){return"string"==typeof e&&-1!==e.indexOf("Edg/")},er=function(){var e=b();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream},en=function(){return w("iPad")},ei=function(){return w("iPhone")},es=function(){return w("iPod")},ea=function(e){return g(e)};E(o),C(o),I(o),S(o),W(s)||en(),L(s);var eo=_(o)||en(),el=(v(o),x(o)||en(),A(o),A(o),T(c)),ec=(R(c),B(c)||en()),eu=(U(s),j(s)),ed=q(s);H(s),K(s),D(c),M(c),J(s),Y(s),Z(s),P(o),$(o),Q(l),X(l),ea(u),F(s)||et(u),z(s),k(o),er(),en(),ei(),es(),ee(),et(u),F(s)&&et(u),O(c),N(c),V(s),G(s);t.m0=el,t.gm=eu,t.un=ec,t.Fr=eo,t.nr=ed},7706:(e,t,r)=>{"use strict";r.d(t,{j:()=>u});var n=r(75834),i=r(36207),s=r(70393),a=r(16234),o=r(46140),l=r(63455),c=r(5453);function u(e,t,r){let u=(0,l.Y)(r),d=(0,n.useCallback)(function(e,r){if(e.defaultPrevented)return;let n=r(e);if(null!==n&&n.getRootNode().contains(n)&&n.isConnected){for(let r of function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t))if(null!==r&&(r.contains(n)||e.composed&&e.composedPath().includes(r)))return;return(0,s.Bm)(n,s.MZ.Loose)||-1===n.tabIndex||e.preventDefault(),u.current(e,n)}},[u,t]),f=(0,n.useRef)(null);(0,o.z)(e,"pointerdown",e=>{var t,r;(0,a.Fr)()||(f.current=(null==(r=null==(t=e.composedPath)?void 0:t.call(e))?void 0:r[0])||e.target)},!0),(0,o.z)(e,"pointerup",e=>{if((0,a.Fr)()||!f.current)return;let t=f.current;return f.current=null,d(e,()=>t)},!0);let h=(0,n.useRef)({x:0,y:0});(0,o.z)(e,"touchstart",e=>{h.current.x=e.touches[0].clientX,h.current.y=e.touches[0].clientY},!0),(0,o.z)(e,"touchend",e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-h.current.x)>=30||Math.abs(t.y-h.current.y)>=30))return d(e,()=>i.Lk(e.target)?e.target:null)},!0),(0,c.M)(e,"blur",e=>d(e,()=>i.Gu(window.document.activeElement)?window.document.activeElement:null),!0)}},7727:(e,t,r)=>{"use strict";r.d(t,{g:()=>o});
5class n{constructor(e,t){this.type=e,this.data=t}}var i=r(87595),s=r(19390);let a={type:-1,encode:function(e){return e instanceof Date?function({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=0x3ffffffff)if(0===t&&e<=0xffffffff){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}else{let r=e/0x100000000,n=new Uint8Array(8),i=new DataView(n.buffer);return i.setUint32(0,t<<2|3&r),i.setUint32(4,0|e),n}{let r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,t),(0,s._j)(n,4,e),r}}(function(e){let t=e.getTime(),r=Math.floor(t/1e3),n=(t-1e3*r)*1e6,i=Math.floor(n/1e9);return{sec:r+i,nsec:n-1e9*i}}(e)):null},decode:function(e){let t=function(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{let e=t.getUint32(0);return{sec:(3&e)*0x100000000+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:(0,s.eN)(t,4),nsec:t.getUint32(0)};default:throw new i.X(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}};class o{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(a)}register({type:e,encode:t,decode:r}){if(e>=0)this.encoders[e]=t,this.decoders[e]=r;else{let n=-1-e;this.builtInEncoders[n]=t,this.builtInDecoders[n]=r}}tryToEncode(e,t){for(let r=0;r<this.builtInEncoders.length;r++){let i=this.builtInEncoders[r];if(null!=i){let s=i(e,t);if(null!=s)return new n(-1-r,s)}}for(let r=0;r<this.encoders.length;r++){let i=this.encoders[r];if(null!=i){let s=i(e,t);if(null!=s)return new n(r,s)}}return e instanceof n?e:null}decode(e,t,r){let i=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return i?i(e,t,r):new n(t,e)}}o.defaultCodec=new o},7878:(e,t,r)=>{"use strict";r.d(t,{I:()=>n,t:()=>i});let n="0x6492649264926492649264926492649264926492649264926492649264926492",i="0x0000000000000000000000000000000000000000000000000000000000000000"},8042:(e,t,r)=>{"use strict";r.d(t,{$:()=>s,R:()=>a});var n=r(75941),i=r(20347);function s(e,t){let r=(e.transactions??[]).map(e=>"string"==typeof e?e:(0,i.uP)(e));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:r,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}let a=(0,n.q)("block",s)},8971:(e,t,r)=>{"use strict";r.d(t,{EK:()=>h,Im:()=>f,J8:()=>p,O_:()=>u,a5:()=>b,ci:()=>w,is:()=>c,md:()=>m,xQ:()=>y});var n=r(5635),i=r(21008),s=r(31911);function a(e){return e.reduce((e,t)=>null===e||null===t?null:e+t,0)}function o(e){return(0,n.Sc)(e)?e.fixedSize:null}function l(e){return(0,n.Sc)(e)?e.fixedSize:e.maxSize??null}function c(e,t={}){let r=t.size??(0,i.PL)(),a=d(r,o(e)),u=d(r,l(e))??void 0;return(0,n.xv)({...null!==a?{fixedSize:a}:{getSizeFromValue:t=>("object"==typeof r?(0,n.QM)(t.length,r):0)+[...t].reduce((t,r)=>t+(0,n.QM)(r,e),0),maxSize:u},write:(t,n,i)=>("number"==typeof r&&function(e,t,r){if(t!==r)throw new s.tsw(s.lUj,{actual:r,codecDescription:e,expected:t})}("array",r,t.length),"object"==typeof r&&(i=r.write(t.length,n,i)),t.forEach(t=>{i=e.write(t,n,i)}),i)})}function u(e,t={}){let r=t.size??(0,i.VI)(),s=d(r,o(e)),a=d(r,l(e))??void 0;return(0,n.$C)({...null!==s?{fixedSize:s}:{maxSize:a},read:(t,n)=>{let i=[];if("object"==typeof r&&0===t.slice(n).length)return[i,n];if("remainder"===r){for(;n<t.length;){let[r,s]=e.read(t,n);n=s,i.push(r)}return[i,n]}let[s,a]="number"==typeof r?[r,n]:r.read(t,n);n=a;for(let r=0;r<s;r+=1){let[r,s]=e.read(t,n);n=s,i.push(r)}return[i,n]}})}function d(e,t){return"number"!=typeof e?null:0===e?0:null===t?null:t*e}function f(){return(0,n.xv)({getSizeFromValue:e=>e.length,write:(e,t,r)=>(t.set(e,r),r+e.length)})}function h(){return(0,n.$C)({read:(e,t)=>{let r=e.slice(t);return[r,t+r.length]}})}function p(e){return(0,n.xv)({fixedSize:e.length,write:(t,r,n)=>(r.set(e,n),n+e.length)})}function y(e){let t=a(e.map(o)),r=a(e.map(l))??void 0;return(0,n.$C)({...null===t?{maxSize:r}:{fixedSize:t},read:(t,r)=>{let n=[];
5return e.forEach(e=>{let[i,s]=e.read(t,r);n.push(i),r=s}),[n,r]}})}function m(e,t){let r=function(e){if(0===e.length)return 0;if(!(0,n.Sc)(e[0]))return null;let t=e[0].fixedSize;return e.every(e=>(0,n.Sc)(e)&&e.fixedSize===t)?t:null}(e),i=(r,n,i)=>{let s=t(r);return g(e,s),e[s].write(r,n,i)};if(null!==r)return(0,n.xv)({fixedSize:r,write:i});let s=e.map(e=>l(e)).reduce((e,t)=>null===e||null===t?null:Math.max(e,t),0);return(0,n.xv)({...null!==s?{maxSize:s}:{},getSizeFromValue:r=>{let i=t(r);return g(e,i),(0,n.QM)(r,e[i])},write:i})}function g(e,t){if(void 0===e[t])throw new s.tsw(s.bg4,{maxRange:e.length-1,minRange:0,variant:t})}function b(e){let t=e.map(([,e])=>e),r=a(t.map(o)),i=a(t.map(l))??void 0;return(0,n.xv)({...null===r?{getSizeFromValue:t=>e.map(([e,r])=>(0,n.QM)(t[e],r)).reduce((e,t)=>e+t,0),maxSize:i}:{fixedSize:r},write:(t,r,n)=>(e.forEach(([e,i])=>{n=i.write(t[e],r,n)}),n)})}function w(e){let t=e.map(([,e])=>e),r=a(t.map(o)),i=a(t.map(l))??void 0;return(0,n.$C)({...null===r?{maxSize:i}:{fixedSize:r},read:(t,r)=>{let n={};return e.forEach(([e,i])=>{let[s,a]=i.read(t,r);r=a,n[e]=s}),[n,r]}})}},9102:(e,t,r)=>{"use strict";r.d(t,{k:()=>o});var n=r(36665),i=r(3303),s=r(83870),a=r(99838);function o(e){var t;return t=function(e){let t=!0,r="",n=0,i="",s=!1;for(let a=0;a<e.length;a++){let o=e[a];if(["(",")",","].includes(o)&&(t=!0),"("===o&&n++,")"===o&&n--,t){if(0===n){if(" "===o&&["event","function",""].includes(i))i="";else if(i+=o,")"===o){s=!0;break}continue}if(" "===o){","!==e[a-1]&&","!==r&&",("!==r&&(r="",t=!1);continue}i+=o,r+=o}}if(!s)throw new a.C("Unable to normalize signature.");return i}("string"==typeof e?e:(0,s.B)(e)),(0,i.S)((0,n.ZJ)(t))}},9146:(e,t,r)=>{"use strict";r.d(t,{Vw:()=>E,DO:()=>a,CC:()=>l,sd:()=>o,Fe:()=>s,Ht:()=>c,My:()=>g,uH:()=>d,Id:()=>_,qj:()=>A,O8:()=>f,aT:()=>v,aY:()=>i,po:()=>I,Ow:()=>h,fd:()=>p,ZJ:()=>x,DH:()=>u});let n="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(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){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");s(e.outputLen),s(e.blockLen)}function l(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")}function c(e,t){a(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function u(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function d(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function f(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function h(e,t){return e<<32-t|e>>>t}let p=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?e=>e:function(e){for(let r=0;r<e.length;r++){var t;e[r]=(t=e[r])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}return e},y="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,m=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function g(e){if(a(e),y)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=m[e[r]];return t}let b={_0:48,_9:57,A:65,F:70,a:97,f:102};function w(e){return e>=b._0&&e<=b._9?e-b._0:e>=b.A&&e<=b.F?e-(b.A-10):e>=b.a&&e<=b.f?e-(b.a-10):void 0}function v(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(y)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=w(e.charCodeAt(i)),s=w(e.charCodeAt(i+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+s}return n}function x(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e)),a(e),e}function _(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];a(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}class E{}function A(e){let t=t=>e().update(x(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function I(e=32){if(n&&"function"==typeof n.getRandomValues)return n.getRandomValues(new Uint8Array(e));if(n&&"function"==typeof n.randomBytes)return Uint8Array.from(n.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}},9652:(e,t,r)=>{"use strict";r.d(t,{g:()=>s});var n=r(91607),i=r(29134);async function s(e){let{authorization:t,signature:r}=e;return(0,n.x)({hash:(0,i.C)(t),signature:r??t})}},9845:(e,t,r)=>{"use strict";r.d(t,{a:()=>c,g:()=>l});var n=r(12960),i=r(79869),s=r(96384),a=r(67671),o=r(33861);let l=(e,t,r,l)=>{let u=Number(e),d=t.find(e=>e.id===u);if(!d)throw new o.e(`Unsupported chainId ${e}`,4901);let f=c(d,r,l.appId);if(u===s.O.id||u===a.f.id){let e=u===s.O.id?s.O:a.f;return(0,n.l)({transport:(0,i.L)(f),chain:e})}return(0,n.l)({transport:(0,i.L)(f),chain:d})},c=(e,t,r)=>{let n,i=e.id,s=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])n=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[s])n=t.rpcUrls[s];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",r),n=t.toString()}else n=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!n)throw new o.e(`No RPC url found for ${i}`);return n}},9865:(e,t,r)=>{"use strict";r.d(t,{kF:()=>s});
5class n{}class i extends n{constructor(){super()}}class s extends i{constructor(e){super()}}},10187:(e,t,r)=>{"use strict";r.d(t,{c:()=>s});var n=r(75345),i=r(99808);function s(e,t="wei"){return(0,i.J)(e,n.eL[t])}},10199:(e,t,r)=>{"use strict";r.d(t,{x:()=>a});var n=r(66471),i=r(44037),s=r(20169);async function a(e,{blockHash:t,blockNumber:r,blockTag:a,hash:o,index:l,sender:c,nonce:u}){let d=a||"latest",f=void 0!==r?(0,i.cK)(r):void 0,h=null;if(o?h=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?h=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,(0,i.cK)(l)]},{dedupe:!0}):(f||d)&&"number"==typeof l?h=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[f||d,(0,i.cK)(l)]},{dedupe:!!f}):c&&"number"==typeof u&&(h=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[c,(0,i.cK)(u)]},{dedupe:!0})),!h)throw new n.Kz({blockHash:t,blockNumber:r,blockTag:d,hash:o,index:l});return(e.chain?.formatters?.transaction?.format||s.uP)(h,"getTransaction")}},10415:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},10439:(e,t,r)=>{"use strict";r.d(t,{p:()=>u});var n=r(50016),i=r(10752),s=r(74263),a=r(5360),o=r(22760),l=r(99453);let c="/docs/contract/encodeFunctionData";function u(e){let{args:t}=e,{abi:r,functionName:u}=(()=>{if(1===e.abi.length&&e.functionName?.startsWith("0x"))return e;let{abi:t,args:r,functionName:n}=e,i=t[0];if(n){let e=(0,l.iY)({abi:t,args:r,name:n});if(!e)throw new s.Iz(n,{docsPath:c});i=e}if("function"!==i.type)throw new s.Iz(void 0,{docsPath:c});return{abi:[i],functionName:(0,a.V)((0,o.B)(i))}})(),d=r[0],f="inputs"in d&&d.inputs?(0,i.h)(d.inputs,t??[]):void 0;return(0,n.aP)([u,f??"0x"])}},10479:(e,t,r)=>{"use strict";r.d(t,{b:()=>s});var n=r(86326),i=r(19284);function s(e,{delay:t=100,retryCount:r=2,shouldRetry:a=()=>!0,signal:o}={}){return new Promise((s,l)=>{let c=async({count:u=0}={})=>{if(o?.aborted)return void l((0,n.TY)(o));let d=async({error:e})=>{let r="function"==typeof t?t({count:u,error:e}):t;if(r)try{await (0,i.u)(r,{signal:o})}catch(e){l(e);return}c({count:u+1})};try{let t=await e();s(t)}catch(e){if(o?.aborted)return void l((0,n.TY)(o));if((0,n.zf)(e))return void l(e);if(u<r&&await a({count:u,error:e}))return d({error:e});l(e)}};c()})}},10752:(e,t,r)=>{"use strict";r.d(t,{h:()=>p,k:()=>m});var n=r(74263),i=r(65409),s=r(99838),a=r(59206),o=r(27526),l=r(50016),c=r(87601),u=r(44633),d=r(24654),f=r(651),h=r(43794);function p(e,t){if(e.length!==t.length)throw new n.YE({expectedLength:e.length,givenLength:t.length});return y(function({params:e,values:t}){let r=[];for(let p=0;p<e.length;p++)r.push(function e({param:t,value:r}){let p=m(t.type);if(p){let[i,s]=p;return function(t,{length:r,param:i}){let s=null===r;if(!Array.isArray(t))throw new n.dm(t);if(!s&&t.length!==r)throw new n.Nc({expectedLength:r,givenLength:t.length,type:`${i.type}[${r}]`});let a=0===t.length&&function e(t){let{type:r}=t;if("string"===r||"bytes"===r||r.endsWith("[]"))return!0;if("tuple"===r)return t.components.some(e);let n=m(r);return!!n&&e({...t,type:n[1]})}(i),o=[];for(let r=0;r<t.length;r++){let n=e({param:i,value:t[r]});n.dynamic&&(a=!0),o.push(n)}if(s||a){let e=y(o);if(s){let t=(0,f.cK)(o.length,{size:32});return{dynamic:!0,encoded:(0,l.aP)([t,e])}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,l.aP)(o.map(({encoded:e})=>e))}}(r,{length:i,param:{...t,type:s}})}if("tuple"===t.type)return function(t,{param:r}){let n=!1,i=[];for(let s=0;s<r.components.length;s++){let a=r.components[s],o=Array.isArray(t)?s:a.name,l=e({param:a,value:t[o]});i.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?y(i):(0,l.aP)(i.map(({encoded:e})=>e))}}(r,{param:t});if("address"===t.type){var g=r;if(!(0,o.P)(g))throw new i.M({address:g});return{dynamic:!1,encoded:(0,c.db)(g.toLowerCase())}}if("bool"===t.type){var b=r;if("boolean"!=typeof b)throw new s.C(`Invalid boolean value: "${b}" (type: ${typeof b}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,c.db)((0,f.$P)(b))}}if(t.type.startsWith("uint")||t.type.startsWith("int")){let e=t.type.startsWith("int"),[,,n="256"]=h.Ge.exec(t.type)??[];return function(e,{signed:t,size:r=256}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,i=t?-n-1n:0n;if(e>n||e<i)throw new a.Ty({max:n.toString(),min:i.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:(0,f.cK)(e,{size:32,signed:t})}}(r,{signed:e,size:Number(n)})}if(t.type.startsWith("bytes"))return function(e,{param:t}){let[,r]=t.type.split("bytes"),i=(0,u.E)(e);if(!r){let t=e;
vendor: 11,457 bytes, line 5
5return i%32!=0&&(t=(0,c.db)(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:(0,l.aP)([(0,c.db)((0,f.cK)(i,{size:32})),t])}}if(i!==Number.parseInt(r,10))throw new n.gH({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:(0,c.db)(e,{dir:"right"})}}(r,{param:t});if("string"===t.type){var w=r;let e=(0,f.i3)(w),t=Math.ceil((0,u.E)(e)/32),n=[];for(let r=0;r<t;r++)n.push((0,c.db)((0,d.di)(e,32*r,(r+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,l.aP)([(0,c.db)((0,f.cK)((0,u.E)(e),{size:32})),...n])}}throw new n.nK(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}({param:e[p],value:t[p]}));return r}({params:e,values:t}))}function y(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=(0,u.E)(i)}let r=[],n=[],i=0;for(let s=0;s<e.length;s++){let{dynamic:a,encoded:o}=e[s];a?(r.push((0,f.cK)(t+i,{size:32})),n.push(o),i+=(0,u.E)(o)):r.push(o)}return(0,l.aP)([...r,...n])}function m(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}},11177:(e,t,r)=>{"use strict";r.d(t,{X9:()=>a,s7:()=>i,x8:()=>s});var n=r(54057);class i extends n.C{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class s extends n.C{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class a extends n.C{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}},11287:(e,t,r)=>{"use strict";r.d(t,{eF:()=>o,mE:()=>i,rI:()=>a,vG:()=>s});var n=r(44312);function i(e){return n.jf.includes(e)}function s(e){return Object.keys(n.Uf).includes(e)?n.Uf[e]:n.Uf[n.XW]}function a(e){let t=Object.values(n.Uf).find(t=>t.code===e);return t||n.Uf[n.XW]}function o(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${r} RPC url at ${t}`):e}},11400:(e,t,r)=>{"use strict";r.d(t,{b:()=>u,o:()=>c});var n=r(23971),i=r(32579),s=r(84413),a=r(42450),o=r(60336);let l=new a.A(8192);function c(e,t){if(l.has(`${e}.${t}`))return l.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,s.S)((0,i.Af)(r),"bytes"),a=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&a[e]&&(a[e]=a[e].toUpperCase()),(15&n[e>>1])>=8&&a[e+1]&&(a[e+1]=a[e+1].toUpperCase());let o=`0x${a.join("")}`;return l.set(`${e}.${t}`,o),o}function u(e,t){if(!(0,o.P)(e,{strict:!1}))throw new n.M({address:e});return c(e,t)}},11577:(e,t,r)=>{"use strict";r.d(t,{lY:()=>v});var n=r(57636),i=r(9146);let s=BigInt(0),a=BigInt(1),o=BigInt(2),l=BigInt(7),c=BigInt(256),u=BigInt(113),d=[],f=[],h=[];for(let e=0,t=a,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],d.push(2*(5*n+r)),f.push((e+1)*(e+2)/2%64);let i=s;for(let e=0;e<7;e++)(t=(t<<a^(t>>l)*u)%c)&o&&(i^=a<<(a<<BigInt(e))-a);h.push(i)}let p=(0,n.lD)(h,!0),y=p[0],m=p[1],g=(e,t,r)=>r>32?(0,n.WM)(e,t,r):(0,n.P5)(e,t,r),b=(e,t,r)=>r>32?(0,n.im)(e,t,r):(0,n.B4)(e,t,r);class w extends i.Vw{constructor(e,t,r,n=!1,s=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=r,this.enableXOF=n,this.rounds=s,(0,i.Fe)(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,i.DH)(this.state)}clone(){return this._cloneInto()}keccak(){(0,i.fd)(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,s=r[i],a=r[i+1],o=g(s,a,1)^r[n],l=b(s,a,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=f[r],s=g(t,i,n),a=b(t,i,n),o=d[r];t=e[o],i=e[o+1],e[o]=s,e[o+1]=a}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=y[n],e[1]^=m[n]}(0,i.uH)(r)}(this.state32,this.rounds),(0,i.fd)(this.state32),this.posOut=0,this.pos=0}update(e){(0,i.CC)(this),e=(0,i.ZJ)(e),(0,i.DO)(e);let{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){let s=Math.min(t-this.pos,n-i);for(let t=0;t<s;t++)r[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:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,i.CC)(this,!1),(0,i.DO)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}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.Fe)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,i.Ht)(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.uH)(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new w(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}let v=(()=>(0,i.qj)(()=>new w(136,1,32)))()},11692:(e,t,r)=>{"use strict";r.d(t,{O:()=>s});var n=r(15520),i=r(44037);function s(e){let{blockHash:t,blockNumber:r,blockTag:s,requireCanonical:a}=e;if(void 0!==a&&!t)throw new n.C("`requireCanonical` can only be provided when `blockHash` is set.");return t?a?{blockHash:t,requireCanonical:a}:{blockHash:t}:"bigint"==typeof r?(0,i.cK)(r):s??"latest"}},11693:(e,t,r)=>{"use strict";r.d(t,{Fl:()=>s,NV:()=>a,ii:()=>i});var n=r(15520);class i extends n.C{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class s extends n.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}class a extends n.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${t} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}},12060:(e,t,r)=>{"use strict";r.d(t,{Zh:()=>l});var n=r(10752),i=r(50016),s=r(651),a=r(3303),o=r(3859);function l(e){let{domain:t={},message:r,primaryType:n}=e,s={EIP712Domain:(0,o.H4)({domain:t}),...e.types};(0,o.$$)({domain:t,message:r,primaryType:n,types:s});let l=["0x1901"];return t&&l.push(function({domain:e,types:t}){return c({data:e,primaryType:"EIP712Domain",types:t})}({domain:t,types:s})),"EIP712Domain"!==n&&l.push(c({data:r,primaryType:n,types:s})),(0,a.S)((0,i.xW)(l))}function c({data:e,primaryType:t,types:r}){let i=function e({data:t,primaryType:r,types:i}){let o=[{type:"bytes32"}],l=[function({primaryType:e,types:t}){let r=(0,s.nj)(function({primaryType:e,types:t}){let r="",n=function e({primaryType:t,types:r},n=new Set){let i=t.match(/^\w*/u),s=i?.[0];if(n.has(s)||void 0===r[s])return n;for(let t of(n.add(s),r[s]))e({primaryType:t.type,types:r},n);return n}({primaryType:e,types:t});for(let i of(n.delete(e),[e,...Array.from(n).sort()]))r+=`${i}(${t[i].map(({name:e,type:t})=>`${t} ${e}`).join(",")})`;return r}({primaryType:e,types:t}));return(0,a.S)(r)}({primaryType:r,types:i})];for(let c of i[r]){let[r,u]=function t({types:r,name:i,type:o,value:l}){if(void 0!==r[o])return[{type:"bytes32"},(0,a.S)(e({data:l,primaryType:o,types:r}))];if("bytes"===o)return[{type:"bytes32"},(0,a.S)(l)];if("string"===o)return[{type:"bytes32"},(0,a.S)((0,s.nj)(l))];if(o.lastIndexOf("]")===o.length-1){let e=o.slice(0,o.lastIndexOf("[")),s=l.map(n=>t({name:i,type:e,types:r,value:n}));return[{type:"bytes32"},(0,a.S)((0,n.h)(s.map(([e])=>e),s.map(([,e])=>e)))]}return[{type:o},l]}({types:i,name:c.name,type:c.type,value:t[c.name]});o.push(r),l.push(u)}return(0,n.h)(o,l)}({data:e,primaryType:t,types:r});return(0,a.S)(i)}},12089:(e,t,r)=>{"use strict";function n(e,t,r){let n=e[t.name];if("function"==typeof n)return n;let i=e[r];return"function"==typeof i?i:r=>t(e,r)}r.d(t,{T:()=>n})},12392:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,n,s,a){if("function"!=typeof n)throw TypeError("The listener must be a function");var o=new i(n,s||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),o.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},o.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,a=Array(s);i<s;i++)a[i]=n[i].fn;return a},o.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,i,s,a){var o=r?r+e:e;if(!this._events[o])return!1;var l,c,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,i),!0;case 5:return u.fn.call(u.context,t,n,i,s),!0;case 6:return u.fn.call(u.context,t,n,i,s,a),!0}for(c=1,l=Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var f,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,i);break;default:if(!l)for(f=1,l=Array(d-1);f<d;f++)l[f-1]=arguments[f];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},o.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},o.prototype.removeListener=function(e,t,n,i){var s=r?r+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||i&&!o.once||n&&o.context!==n||a(this,s);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==t||i&&!o[l].once||n&&o[l].context!==n)&&c.push(o[l]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o},12414:(e,t,r)=>{"use strict";r.d(t,{H:()=>n});
5class n{}},12480:(e,t,r)=>{"use strict";r.d(t,{l:()=>i});var n=r(99838);class i extends n.C{constructor({blockHash:e,blockNumber:t}){let r="Block";e&&(r=`Block at hash "${e}"`),t&&(r=`Block at number "${t}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}},12934:(e,t,r)=>{"use strict";r.d(t,{y:()=>s});var n=r(11692),i=r(36174);async function s(e,{address:t,blockHash:r,blockNumber:s,blockTag:a="latest",requireCanonical:o}){let l=(0,n.O)({blockHash:r,blockNumber:s,blockTag:a,requireCanonical:o}),c=await e.request({method:"eth_getTransactionCount",params:[t,l]},{dedupe:"bigint"==typeof s||void 0!==r});return(0,i.ME)(c)}},12960:(e,t,r)=>{"use strict";r.d(t,{l:()=>s});var n=r(46501),i=r(70435);function s(e){let{key:t="public",name:r="Public Client"}=e;return(0,n.UU)({...e,key:t,name:r,type:"publicClient"}).extend(i.$)}},13108:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,t)),t}set(e,t){if(super.has(e)&&super.delete(e),super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=super.keys().next().value;void 0!==e&&super.delete(e)}return this}}},13225:(e,t,r)=>{"use strict";r.d(t,{si:()=>i});var n=r(96212);let i=function(e){return e.OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",e.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",e.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",e.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",e.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",e.MISSING_MFA_ENROLLMENT="missing_mfa_enrollment",e.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",e.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",e.INVALID_DATA="invalid_data",e.INVALID_CREDENTIALS="invalid_credentials",e.INVALID_CAPTCHA="invalid_captcha",e.LINKED_TO_ANOTHER_USER="linked_to_another_user",e.ALLOWLIST_REJECTED="allowlist_rejected",e.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",e.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",e.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",e.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",e.TOO_MANY_REQUESTS="too_many_requests",e.RESOURCE_CONFLICT="resource_conflict",e.INVALID_ORIGIN="invalid_origin",e.MISSING_ORIGIN="missing_origin",e.INVALID_
5NATIVE_APP_ID="invalid_native_app_id",e.TOKEN_ALREADY_USED="token_already_used",e.ALREADY_LOGGED_OUT="already_logged_out",e.NOT_SUPPORTED="not_supported",e.USER_UNSUBSCRIBED="user_unsubscribed",e.MAX_APPS_REACHED="max_apps_reached",e.USER_LIMIT_REACHED="max_accounts_reached",e.DEVICE_REVOKED="device_revoked",e.WALLET_PASSWORD_EXISTS="wallet_password_exists",e.OAUTH_STATE_MISMATCH="oauth_state_mismatch",e.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",e.MAX_TEST_ACCOUNTS_REACHED="max_test_accounts_reached",e.DISALLOWED_LOGIN_METHOD="disallowed_login_method",e.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",e.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",e.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",e.CANNOT_SET_PASSWORD="cannot_set_password",e.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",e.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",e.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",e.USER_DOES_NOT_EXIST="user_does_not_exist",e.ALREADY_EXISTS="resource_already_exists",e.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",e.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",e.FEATURE_NOT_ENABLED="feature_not_enabled",e.ONRAMP_MINIMUM_IDENTITY_VERIFICATION_REQUIRED="onramp_minimum_identity_verification_required",e.ONRAMP_IDENTITY_VERIFICATION_REQUIRED="onramp_identity_verification_required",e.ONRAMP_DOCUMENT_VERIFICATION_REQUIRED="onramp_document_verification_required",e.ONRAMP_UNSUPPORTED_INFORMATION="onramp_unsupported_information",e.ONRAMP_TRANSACTION_LIMIT_REACHED="transaction_limit_reached",e.ONRAMP_QUOTE_EXPIRED="onramp_quote_expired",e.INSUFFICIENT_FUNDS="insufficient_funds",e.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",e.TRANSACTION_EXECUTION_FAILURE="transaction_execution_failure",e.INVALID_SOLANA_TRANSACTION="invalid_solana_transaction",e.INVALID_POLICY_FORMAT="invalid_policy_format",e.INVALID_AGGREGATION_FORMAT="invalid_aggregation_format",e.POLICY_VIOLATION="policy_violation",e.AUTHORIZATION_KEY_HAS_ASSOCIATED_WALLETS="authorization_key_has_associated_wallets",e.COMPLIANCE_BLOCKED="compliance_blocked",e.INVALID_REQUEST="invalid_request",e.SIGNUP_DISABLED="signup_disabled",e.INVALID_STATE="invalid_state",e}({});n.Ik({error:n.Yj(),cause:n.Yj().optional(),code:n.fc(i).optional()})},13569:(e,t,r)=>{"use strict";r.d(t,{MR:()=>o,TN:()=>s,Uv:()=>n,Wq:()=>a,tZ:()=>i});var n=(e=>(e[e.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",e[e.READONLY_SIGNER=2]="READONLY_SIGNER",e[e.WRITABLE=1]="WRITABLE",e[e.READONLY=0]="READONLY",e))(n||{});function i(e){return e>=2}function s(e){return(1&e)!=0}function a(e,t){return e|t}function o(e){return 2|e}},13752:(e,t,r)=>{"use strict";r.d(t,{D:()=>n});let n=Symbol("data-suffix-plugin")},13799:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=r(12392)},14487:(e,t,r)=>{"use strict";r.d(t,{Ai:()=>o,UU:()=>s});var n=r(63710),i=r(49655);function s(e){let{batch:t,chain:r,ccipRead:s,dataSuffix:o,key:l="base",name:c="Base Client",tokens:u,type:d="base"}=e,f=e.experimental_blockTag??("number"==typeof r?.experimental_preconfirmationTime?"pending":void 0),h=Math.min(Math.max(Math.floor((r?.blockTime??12e3)/2),500),4e3),p=e.pollingInterval??h,y=e.cacheTime??p,m=e.account?(0,n.J)(e.account):void 0,{config:g,request:b,value:w}=e.transport({account:m,chain:r,pollingInterval:p}),v={account:m,batch:t,cacheTime:y,ccipRead:s,chain:r,dataSuffix:o,key:l,name:c,pollingInterval:p,request:b,tokens:u,transport:{...g,...w},type:d,uid:(0,i.L)(),...f?{experimental_blockTag:f}:{}};return Object.assign(v,{extend:function e(t){return r=>{let n=r(t);for(let e in v)delete n[e];let i={...t,...n};for(let e in n){let r=t[e],s=n[e];a(r)&&a(s)&&(i[e]={...r,...s})}return Object.assign(i,{extend:e(i)})}}(v)})}function a(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function o(e,t){let r=(r={})=>t(e,r);for(let n of["call","calls","callWithPeriod","estimateGas","prepare","simulate"])if(Object.hasOwn(t,n)){let i=t[n];r[n]=(t={})=>1===i.length?i(t):i(e,t)}for(let e of["extractEvent","extractEvents"])Object.hasOwn(t,e)&&(r[e]=t[e]);return r}},14558:(e,t,r)=>{"use strict";r.d(t,{M:()=>i});var n=r(56260);function i({blockNumber:e,chain:t,contract:r}){let i=t?.contracts?.[r];if(!i)throw new n.rj({chain:t,contract:{name:r}});if(e&&i.blockCreated&&i.blockCreated>e)throw new n.rj({blockNumber:e,chain:t,contract:{name:r,blockCreated:i.blockCreated}});return i.address}},14782:(e,t,r)=>{"use strict";r.d(t,{EQ:()=>o});var n=r(15520),i=r(65195),s=r(32579),a=r(44037);function o(e,t="hex"){let r=function e(t){return Array.isArray(t)?function(e){let t=e.reduce((e,t)=>
5e+t.length,0),r=l(t);return{length:t<=55?1+t:1+r+t,encode(n){for(let{encode:i}of(t<=55?n.pushByte(192+t):(n.pushByte(247+r),1===r?n.pushUint8(t):2===r?n.pushUint16(t):3===r?n.pushUint24(t):n.pushUint32(t)),e))i(n)}}}(t.map(t=>e(t))):function(e){let t="string"==typeof e?(0,s.aT)(e):e,r=l(t.length);return{length:1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(e){1===t.length&&t[0]<128||(t.length<=55?e.pushByte(128+t.length):(e.pushByte(183+r),1===r?e.pushUint8(t.length):2===r?e.pushUint16(t.length):3===r?e.pushUint24(t.length):e.pushUint32(t.length))),e.pushBytes(t)}}}(t)}(e),n=(0,i.l)(new Uint8Array(r.length));return(r.encode(n),"hex"===t)?(0,a.My)(n.bytes):n.bytes}function l(e){if(e<256)return 1;if(e<65536)return 2;if(e<0x1000000)return 3;if(e<0x100000000)return 4;throw new n.C("Length is too large.")}},14992:(e,t,r)=>{"use strict";r.d(t,{yH:()=>c});var n=r(65409),i=r(49731),s=r(62516),a=r(27526),o=r(651);function l(e){if(e&&0!==e.length)return e.reduce((e,{slot:t,value:r})=>{if(66!==t.length)throw new i.NV({size:t.length,targetSize:66,type:"hex"});if(66!==r.length)throw new i.NV({size:r.length,targetSize:66,type:"hex"});return e[t]=r,e},{})}function c(e){if(!e)return;let t={};for(let{address:r,...i}of e){if(!(0,a.P)(r,{strict:!1}))throw new n.M({address:r});if(t[r])throw new s.Hi({address:r});t[r]=function(e){let{balance:t,nonce:r,state:n,stateDiff:i,code:a}=e,c={};
5if(void 0!==a&&(c.code=a),void 0!==t&&(c.balance=(0,o.cK)(t)),void 0!==r&&(c.nonce=(0,o.cK)(r)),void 0!==n&&(c.state=l(n)),void 0!==i){if(c.state)throw new s.ft;c.stateDiff=l(i)}return c}(i)}return t}},15171:(e,t,r)=>{"use strict";r.d(t,{P:()=>s,a:()=>c,e:()=>l,p:()=>i,u:()=>o});var n=r(75834);let i={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},connectOrCreateWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},signTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},s=(0,n.createContext)(void 0),a=()=>(0,n.useContext)(s);function o(e,t){if(!t)return;let r=a().current[e];return(0,n.useEffect)(()=>{for(let[n,i]of Object.entries(t))Object.prototype.hasOwnProperty.call(r,n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))Object.prototype.hasOwnProperty.call(r,n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]=r[n]?.filter(e=>e!==i)}},[t])}function l(e,t,r,...n){for(let i of e.current[t][r])i(...n)}function c(){let e=a();return(t,r,...n)=>l(e,t,r,...n)}},15203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let t=this.get(e);if(void 0!==t.elapsed)throw Error(`Watch already stopped for label: ${e}`);let r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){let t=this.timestamps.get(e);if(void 0===t)throw Error(`No timestamp found for label: ${e}`);return t}elapsed(e){let t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},15520:(e,t,r)=>{"use strict";r.d(t,{C:()=>s});let n="2.55.5",i={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${n}`};class s extends Error{constructor(e,t={}){let r=t.cause instanceof s?t.cause.details:t.cause?.message?t.cause.message:t.details,a=t.cause instanceof s&&t.cause.docsPath||t.docsPath,o=i.getDocsUrl?.({...t,docsPath:a});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=a,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=n}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}},15678:(e,t,r)=>{"use strict";r.d(t,{h:()=>p,k:()=>m});var n=r(45897),i=r(23971),s=r(15520),a=r(65636),o=r(60336),l=r(30406),c=r(27931),u=r(21047),d=r(22744),f=r(44037),h=r(41356);function p(e,t){if(e.length!==t.length)throw new n.YE({expectedLength:e.length,givenLength:t.length});return y(function({params:e,values:t}){let r=[];for(let p=0;p<e.length;p++)r.push(function e({param:t,value:r}){let p=m(t.type);if(p){let[i,s]=p;return function(t,{length:r,param:i}){let s=null===r;if(!Array.isArray(t))throw new n.dm(t);if(!s&&t.length!==r)throw new n.Nc({expectedLength:r,givenLength:t.length,type:`${i.type}[${r}]`});let a=0===t.length&&function e(t){let{type:r}=t;if("string"===r||"bytes"===r||r.endsWith("[]"))return!0;
vendor: 9,868 bytes, line 5
5if("tuple"===r)return t.components.some(e);let n=m(r);return!!n&&e({...t,type:n[1]})}(i),o=[];for(let r=0;r<t.length;r++){let n=e({param:i,value:t[r]});n.dynamic&&(a=!0),o.push(n)}if(s||a){let e=y(o);if(s){let t=(0,f.cK)(o.length,{size:32});return{dynamic:!0,encoded:(0,l.aP)([t,e])}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,l.aP)(o.map(({encoded:e})=>e))}}(r,{length:i,param:{...t,type:s}})}if("tuple"===t.type)return function(t,{param:r}){let n=!1,i=[];for(let s=0;s<r.components.length;s++){let a=r.components[s],o=Array.isArray(t)?s:a.name,l=e({param:a,value:t[o]});i.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?y(i):(0,l.aP)(i.map(({encoded:e})=>e))}}(r,{param:t});if("address"===t.type){var g=r;if(!(0,o.P)(g))throw new i.M({address:g});return{dynamic:!1,encoded:(0,c.db)(g.toLowerCase())}}if("bool"===t.type){var b=r;if("boolean"!=typeof b)throw new s.C(`Invalid boolean value: "${b}" (type: ${typeof b}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,c.db)((0,f.$P)(b))}}if(t.type.startsWith("uint")||t.type.startsWith("int")){let e=t.type.startsWith("int"),[,,n="256"]=h.Ge.exec(t.type)??[];return function(e,{signed:t,size:r=256}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,i=t?-n-1n:0n;if(e>n||e<i)throw new a.Ty({max:n.toString(),min:i.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:(0,f.cK)(e,{size:32,signed:t})}}(r,{signed:e,size:Number(n)})}if(t.type.startsWith("bytes"))return function(e,{param:t}){let[,r]=t.type.split("bytes"),i=(0,u.E)(e);if(!r){let t=e;return i%32!=0&&(t=(0,c.db)(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:(0,l.aP)([(0,c.db)((0,f.cK)(i,{size:32})),t])}}if(i!==Number.parseInt(r,10))throw new n.gH({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:(0,c.db)(e,{dir:"right"})}}(r,{param:t});if("string"===t.type){var w=r;let e=(0,f.i3)(w),t=Math.ceil((0,u.E)(e)/32),n=[];for(let r=0;r<t;r++)n.push((0,c.db)((0,d.di)(e,32*r,(r+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,l.aP)([(0,c.db)((0,f.cK)((0,u.E)(e),{size:32})),...n])}}throw new n.nK(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}({param:e[p],value:t[p]}));return r}({params:e,values:t}))}function y(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=(0,u.E)(i)}let r=[],n=[],i=0;for(let s=0;s<e.length;s++){let{dynamic:a,encoded:o}=e[s];a?(r.push((0,f.cK)(t+i,{size:32})),n.push(o),i+=(0,u.E)(o)):r.push(o)}return(0,l.aP)([...r,...n])}function m(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}},15979:(e,t,r)=>{"use strict";r.d(t,{T:()=>u});var n=r(87284),i=r(18841),s=r(69592),a=r(39345),o=r(44633),l=r(36665),c=r(651);function u(e){let{data:t,kzg:r,to:u}=e,d=e.blobs??function(e){let t=e.to??("string"==typeof e.data?"hex":"bytes"),r="string"==typeof e.data?(0,l.aT)(e.data):e.data,n=(0,o.E)(r);if(!n)throw new s.zF;if(n>761855)throw new s.iq({maxSize:761855,size:n});let i=[],u=!0,d=0;for(;u;){let e=(0,a.l)(new Uint8Array(131072)),t=0;for(;t<4096;){let n=r.slice(d,d+31);if(e.pushByte(0),e.pushBytes(n),n.length<31){e.pushByte(128),u=!1;break}t++,d+=31}i.push(e)}return"bytes"===t?i.map(e=>e.bytes):i.map(e=>(0,c.My)(e.bytes))}({data:t,to:u}),f=e.commitments??(0,n.S)({blobs:d,kzg:r,to:u}),h=e.proofs??(0,i.t)({blobs:d,commitments:f,kzg:r,to:u}),p=[];for(let e=0;e<d.length;e++)p.push({blob:d[e],commitment:f[e],proof:h[e]});return p}},16025:(e,t,r)=>{"use strict";r.d(t,{Lj:()=>o,WB:()=>c,uL:()=>l});var n=r(5596),i=r(75941),s=r(86665),a=r(20347);let o={"0x0":"reverted","0x1":"success"};function l(e,t){let r={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>(0,s.e)(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,n.ME)(e.transactionIndex):null,status:e.status?o[e.status]:null,type:e.type?a.b4[e.type]||e.type:null};return e.blobGasPrice&&(r.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(r.blobGasUsed=BigInt(e.blobGasUsed)),r}let c=(0,i.q)("transactionReceipt",l)},16203:(e,t,r)=>{"use strict";r.d(t,{m_:()=>b,HT:()=>h,n1:()=>p,go:()=>y});var n=r(25586),i=r(97),s=r(39613),a=r(68229),o=r(89633),l=r(64959),c=r(38417),u=r(62610),d=r(99225);function f(e){let t=!0,r="",n=0,i="",s=!1;for(let a=0;a<e.length;a++){let o=e[a];if(["(",")",","].includes(o)&&(t=!0),"("===o&&n++,")"===o&&n--,t){if(0===n){if(" "===o&&["event","function","error",""].includes(i))i="";else if(i+=o,")"===o){s=!0;break}continue}if(" "===o){","!==e[a-1]&&","!==r&&",("!==r&&(r="",t=!1);continue}i+=o,r+=o}}if(!s)throw new l.C("Unable to normalize signature.");return i}function h(e,t={}){let{prepare:r=!0}=t,o=Array.isArray(e)||"string"==typeof e?function(e){let t;if("string"==typeof e)t=(0,a.uT)(e);else{let r=(0,s.e)(e),n=e.length;for(let s=0;s<n;s++){let n=e[s];if(!(0,i.WL)(n)){t=(0,a.uT)(n,r);break}}}if(!t)throw new n.xo({signature:e});return t}(e):e;return{...o,...r?{hash:m(o)}:{}}}function p(e,t,r){let n,{args:i=[],prepare:s=!0}=r??{},a=u.tf(t,{strict:!1}),o=e.filter(e=>a?"function"===e.type||"error"===e.type?y(e)===u.di(t,0,4):"event"===e.type&&m(e)===t:"name"in e&&e.name===t);if(0===o.length)throw new b({name:t});if(1===o.length)return{...o[0],...s?{hash:m(o[0])}:{}};for(let e of o){if("inputs"in e){if(!i||0===i.length){if(!e.inputs||0===e.inputs.length)return{...e,...s?{hash:m(e)}:{}};continue}if(e.inputs&&0!==e.inputs.length&&e.inputs.length===i.length&&i.every((t,r)=>{let n="inputs"in e&&e.inputs[r];return!!n&&function e(t,r){let n=typeof t,i=r.type;switch(i){case"address":return d.tf(t,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:if("tuple"===i&&"components"in r)return Object.values(r.components).every((r,n)=>e(Object.values(t)[n],r));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i))return"number"===n||"bigint"===n;if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i))return"string"===n||t instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i))return Array.isArray(t)&&t.every(t=>e(t,{...r,type:i.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}(t,n)})){if(n&&"inputs"in n&&n.inputs){let t=function e(t,r,n){for(let i in t){let s=t[i],a=r[i];if("tuple"===s.type&&"tuple"===a.type&&"components"in s&&"components"in a)return e(s.components,a.components,n[i]);let o=[s.type,a.type];if(o.includes("address")&&o.includes("bytes20")||(o.includes("address")&&o.includes("string")||o.includes("address")&&o.includes("bytes"))&&d.tf(n[i],{strict:!1}))return o}}(e.inputs,n.inputs,i);if(t)throw new g({abiItem:e,type:t[0]},{abiItem:n,type:t[1]})}n=e}}}let l=(()=>{if(n)return n;let[e,...t]=o;return{...e,overloads:t}})();if(!l)throw new b({name:t});return{...l,...s?{hash:m(l)}:{}}}function y(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return p(t,r)}return e[0]})();return u.di(m(t),0,4)}function m(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return p(t,r)}return e[0]})();return"string"!=typeof t&&"hash"in t&&t.hash?t.hash:c.So(u.sH(function(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return p(t,r)}return e[0]})();return f("string"==typeof t?t:o.B(t))}(t)))}class g extends l.C{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${f(o.B(e.abiItem))}\`, and`,`\`${t.type}\` in \`${f(o.B(t.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class b extends l.C{constructor({name:e,data:t,type:r="item"}){super(`ABI ${r}${e?` with name "${e}"`:t?` with data "${t}"`:""} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}l.C},16234:(e,t,r)=>{"use strict";function n(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function i(){return n()||/Android/gi.test(window.navigator.userAgent)}r.d(t,{Fr:()=>i,un:()=>n})},16291:(e,t,r)=>{"use strict";r.d(t,{B4:()=>i,SK:()=>s,hX:()=>a});var n=r(15520);class i extends n.C{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class s extends n.C{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class a extends n.C{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}},16965:(e,t,r)=>{"use strict";r.d(t,{W:()=>c});var n=r(49786),i=r(74263),s=r(24654),a=r(5360),o=r(86380),l=r(22760);function c(e){let{abi:t,data:r,cause:c}=e,u=(0,s.di)(r,0,4);if("0x"===u)throw new i.O({cause:c});let d=[...t||[],n.Mc,n.J9].find(e=>"error"===e.type&&u===(0,a.V)((0,l.B)(e)));if(!d)throw new i.Wq(u,{docsPath:"/docs/contract/decodeErrorResult",cause:c});return{abiItem:d,args:"inputs"in d&&d.inputs&&d.inputs.length>0?(0,o.n)(d.inputs,(0,s.di)(r,4)):void 0,errorName:d.name}}},17068:(e,t,r)=>{"use strict";r.d(t,{J:()=>s});var n=r(83315);function i(e){return{address:e.address,amount:n.oB(e.amount),index:n.oB(e.index),validatorIndex:n.oB(e.validatorIndex)}}function s(e){return{..."bigint"==typeof e.baseFeePerGas&&{baseFeePerGas:n.oB(e.baseFeePerGas)},..."bigint"==typeof e.blobBaseFee&&{blobBaseFee:n.oB(e.blobBaseFee)},..."string"==typeof e.feeRecipient&&{feeRecipient:e.feeRecipient}
5,..."bigint"==typeof e.gasLimit&&{gasLimit:n.oB(e.gasLimit)},..."bigint"==typeof e.number&&{number:n.oB(e.number)},..."bigint"==typeof e.prevRandao&&{prevRandao:n.oB(e.prevRandao)},..."bigint"==typeof e.time&&{time:n.oB(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(i)}}}},17421:(e,t,r)=>{"use strict";t.g=void 0;let n=r(48212);t.g=function(){let e,t,r;try{e=n.getDocumentOrThrow(),t=n.getLocationOrThrow()}catch(e){return null}function i(...t){let r=e.getElementsByTagName("meta");for(let e=0;e<r.length;e++){let n=r[e],i=["itemprop","property","name"].map(e=>n.getAttribute(e)).filter(e=>!!e&&t.includes(e));if(i.length&&i){let e=n.getAttribute("content");if(e)return e}}return""}let s=((r=i("name","og:site_name","og:title","twitter:title"))||(r=e.title),r),a=i("description","og:description","twitter:description","keywords"),o=t.origin;return{description:a,url:o,icons:function(){let r=e.getElementsByTagName("link"),n=[];for(let e=0;e<r.length;e++){let i=r[e],s=i.getAttribute("rel");if(s&&s.toLowerCase().indexOf("icon")>-1){let e=i.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{let n=t.pathname.split("/");n.pop(),r+=n.join("/")+"/"+e}n.push(r)}else if(0===e.indexOf("//")){let r=t.protocol+e;n.push(r)}else n.push(e)}}return n}(),name:s}}},17562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(57924);n.__exportStar(r(26102),t),n.__exportStar(r(10415),t)},17572:(e,t,r)=>{"use strict";r.d(t,{F:()=>A,c:()=>function e(t={}){let{fetch:r=globalThis.fetch,Headers:i=globalThis.Headers,AbortController:s=globalThis.AbortController}=t;async function a(e){let t=e.error&&"AbortError"===e.error.name&&!e.options.timeout||!1;if(!1!==e.options.retry&&!t){let t;t="number"==typeof e.options.retry?e.options.retry:+!C(e.options.method);let r=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(r):k.has(r))){let r="function"==typeof e.options.retryDelay?e.options.retryDelay(e):e.options.retryDelay||0;return r>0&&await new Promise(e=>setTimeout(e,r)),o(e.request,{...e.options,retry:t-1})}}let r=function(e){let t=e.error?.message||e.error?.toString()||"",r=e.request?.method||e.options?.method||"GET",n=e.request?.url||String(e.request)||"/",i=`[${r}] ${JSON.stringify(n)}`,s=e.response?`${e.response.status} ${e.response.statusText}`:"<no response>",a=new A(`${i}: ${s}${t?` ${t}`:""}`,e.error?{cause:e.error}:void 0);for(let t of["request","options","response"])Object.defineProperty(a,t,{get:()=>e[t]});for(let[t,r]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,t,{get:()=>e.response&&e.response[r]});return a}(e);throw Error.captureStackTrace&&Error.captureStackTrace(r,o),r}let o=async function(e,o={}){let c,u={request:e,options:function(e,t,r,n){let i,s=function(e,t,r){if(!t)return new r(e);let n=new r(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new r(e))n.set(t,i);return n}(t?.headers??e?.headers,r?.headers,n);return(r?.query||r?.params||t?.params||t?.query)&&(i={...r?.params,...r?.query,...t?.params,...t?.query}),{...r,...t,query:i,params:i,headers:s}}(e,o,t.defaults,i),response:void 0,error:void 0};if(u.options.method&&(u.options.method=u.options.method.toUpperCase()),u.options.onRequest&&(await $(u,u.options.onRequest),u.options.headers instanceof i||(u.options.headers=new i(u.options.headers||{}))),"string"==typeof u.request&&(u.options.baseURL&&(u.request=function(e,t){var r;if(!(r=t)||"/"===r||x(e))return e;let n=function(e="",t){return(function(e="",t){return t?w.test(e):e.endsWith("/")}(e)?e.slice(0,-1):e)||"/"}(t);if(e.startsWith(n)){let t=e[n.length];if(!t||"/"===t||"?"===t)return e}return function(e,...t){let r=e||"";for(let e of t.filter(e=>e&&"/"!==e))if(r){let t=e.replace(v,"");r=function(e="",t){return e.endsWith("/")?e:e+"/"}(r)+t}else r=e;return r}(n,e)}(u.request,u.options.baseURL)),u.options.query&&(u.request=function(e,t){let r=function e(t="",r){let n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=""]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:"",host:"",search:"",hash:""}}if(!x(t,{acceptRelative:!0}))return r?e(r+t):E(t);let[,i="",s,a=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o="",l=""]=a.match(/([^#/?]*)(.*)?/)||[];"file:"===i&&(l=l.replace(/\/(?=[A-Za-z]:)/,""));let{pathname:c,search:u,hash:d}=E(l);return{protocol:i.toLowerCase(),auth:s?s.slice(0,Math.max(0,s.length-1)):"",host:o,pathname:c,search:u,hash:d,[_]:!i}}(e),n={...function(e=""){let t=Object.create(null);for(let r of("?"===e[0]&&(e=e.slice(1)),e.split("&"))){let e=r.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let n=y(e[1].replace(l," "));if("__proto__"===n||"constructor"===n)continue;let i=y((e[2]||"").replace(l," "));void 0===t[n]?t[n]=i:Array.isArray(t[n])?t[n].push(i):t[n]=[t[n],i]}return t}(r.search),...t};return r.search=Object.keys(n).filter(e=>void 0!==n[e]).map(e=>{var t;return(("number"==typeof(t=n[e])||"boolean"==typeof t)&&(t=String(t)),t)?Array.isArray(t)?t.map(t=>`${p(e)}=${h(t)}`).join("&"):`${p(e)}=${h(t)}`:p(e)}
5).filter(Boolean).join("&"),function(e){let t=e.pathname||"",r=e.search?(e.search.startsWith("?")?"":"?")+e.search:"",n=e.hash||"",i=e.auth?e.auth+"@":"",s=e.host||"";return(e.protocol||e[_]?(e.protocol||"")+"//":"")+i+s+t+r+n}(r)}(u.request,u.options.query),delete u.options.query),"query"in u.options&&delete u.options.query,"params"in u.options&&delete u.options.params),u.options.body&&C(u.options.method))if(function(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!(e.buffer||e instanceof FormData||e instanceof URLSearchParams)&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}(u.options.body)){let e=u.options.headers.get("content-type");"string"!=typeof u.options.body&&(u.options.body="application/x-www-form-urlencoded"===e?new URLSearchParams(u.options.body).toString():JSON.stringify(u.options.body)),e||u.options.headers.set("content-type","application/json"),u.options.headers.has("accept")||u.options.headers.set("accept","application/json")}else("pipeTo"in u.options.body&&"function"==typeof u.options.body.pipeTo||"function"==typeof u.options.body.pipe)&&!("duplex"in u.options)&&(u.options.duplex="half");if(!u.options.signal&&u.options.timeout){let e=new s;c=setTimeout(()=>{let t=Error("[TimeoutError]: The operation was aborted due to timeout");t.name="TimeoutError",t.code=23,e.abort(t)},u.options.timeout),u.options.signal=e.signal}try{u.response=await r(u.request,u.options)}catch(e){return u.error=e,u.options.onRequestError&&await $(u,u.options.onRequestError),await a(u)}finally{c&&clearTimeout(c)}if((u.response.body||u.response._bodyInit)&&!T.has(u.response.status)&&"HEAD"!==u.options.method){let e=(u.options.parseResponse?"json":u.options.responseType)||function(e=""){if(!e)return"json";let t=e.split(";").shift()||"";return P.test(t)?"json":"text/event-stream"===t?"stream":S.has(t)||t.startsWith("text/")?"text":"blob"}(u.response.headers.get("content-type")||"");switch(e){case"json":{let e=await u.response.text(),t=u.options.parseResponse||n.Ay;u.response._data=t(e);break}case"stream":u.response._data=u.response.body||u.response._bodyInit;break;default:u.response._data=await u.response[e]()}}return(u.options.onResponse&&await $(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600)?(u.options.onResponseError&&await $(u,u.options.onResponseError),await a(u)):u.response},c=async function(e,t){return(await o(e,t))._data};return c.raw=o,c.native=(...e)=>r(...e),c.create=(r={},n={})=>e({...t,...n,defaults:{...t.defaults,...n.defaults,...r}}),c}});var n=r(61161);let i=/#/g,s=/&/g,a=/\//g,o=/=/g,l=/\+/g,c=/%5e/gi,u=/%60/gi,d=/%7c/gi,f=/%20/gi;function h(e){return encodeURI(""+("string"==typeof e?e:JSON.stringify(e))).replace(d,"|").replace(l,"%2B").replace(f,"+").replace(i,"%23").replace(s,"%26").replace(u,"`").replace(c,"^").replace(a,"%2F")}function p(e){return h(e).replace(o,"%3D")}function y(e=""){try{return decodeURIComponent(""+e)}catch{return""+e}}let m=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,g=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,b=/^([/\\]\s*){2,}[^/\\]/,w=/\/$|\/\?|\/#/,v=/^\.?\//;function x(e,t={}){return("boolean"==typeof t&&(t={acceptRelative:t}),t.strict)?m.test(e):g.test(e)||!!t.acceptRelative&&b.test(e)}let _=Symbol.for("ufo:protocolRelative");function E(e=""){let[t="",r="",n=""]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:r,hash:n}}class A extends Error{constructor(e,t){super(e,t),this.name="FetchError",t?.cause&&!this.cause&&(this.cause=t.cause)}}let I=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function C(e="GET"){return I.has(e.toUpperCase())}let S=new Set(["image/svg","application/xml","application/xhtml","application/html"]),P=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;async function $(e,t){if(t)if(Array.isArray(t))for(let r of t)await r(e);else await t(e)}let k=new Set([408,409,425,429,500,502,503,504]),T=new Set([101,204,205,304])},17819:(e,t,r)=>{"use strict";r.d(t,{Lj:()=>o,WB:()=>c,uL:()=>l});var n=r(36174),i=r(65323),s=r(24807),a=r(20169);let o={"0x0":"reverted","0x1":"success"};function l(e,t){let r={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>(0,s.e)(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,n.ME)(e.transactionIndex):null,status:e.status?o[e.status]:null,type:e.type?a.b4[e.type]||e.type:null};return e.blobGasPrice&&(r.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(r.blobGasUsed=BigInt(e.blobGasUsed)),r}let c=(0,i.q)("transactionReceipt",l)},18034:(e,t,r)=>{"use strict";r.d(t,{O:()=>c,_:()=>l});var n=r(68305),i=r(29447),s=r(42053),a=r(32560),o=r(82497);async function l(e,t){return c(e,t)}async function c(e,t){let{block:r,chain:l=e.chain,request:c,type:u="eip1559"}=t||{},d=await (async()=>"function"==typeof l?.fees?.baseFeeMultiplier?l.fees.baseFeeMultiplier({block:r,client:e,request:c}):l?.fees?.baseFeeMultiplier??1.2)();if(d<1)throw new n.sM;let f=d.toString().split(".")[1]?.length??0,h=10**f,p=e=>e*BigInt(Math.ceil(d*h))/BigInt(h),y=r||await (0,i.T)(e,a.g,"getBlock")({});if("function"==typeof l?.fees?.estimateFeesPerGas){let t=await l.fees.estimateFeesPerGas({block:r,client:e,multiply:p,request:c,type:u});if(null!==t)return t}if("eip1559"===u){if("bigint"!=typeof y.baseFeePerGas)throw new n.pw;let t="bigint"==typeof c?.maxPriorityFeePerGas?c.maxPriorityFeePerGas:await (0,s.N)(e,{block:y,chain:l,request:c}),r=p(y.baseFeePerGas);return{maxFeePerGas:c?.maxFeePerGas??r+t,maxPriorityFeePerGas:t}}return{gasPrice:c?.gasPrice??p(await (0,i.T)(e,o.L,"getGasPrice")({}))}}},18323:(e,t,r)=>{"use strict";r.d(t,{o:()=>d});
5var n=r(15520),i=r(39534),s=r(69064),a=r(86326);let o=new(r(42450)).A(8192);var l=r(10479),c=r(97314),u=r(39633);function d({key:e,methods:t,name:r,request:d,retryCount:f=3,retryDelay:h=150,timeout:p,type:y},m){return{config:{key:e,methods:t,name:r,request:d,retryCount:f,retryDelay:h,timeout:p,type:y},request:function(e,t={}){return async(r,u={})=>{let{dedupe:d=!1,methods:f,retryDelay:h=150,retryCount:p=3,signal:y,uid:m}={...t,...u},{method:g}=r;if(f?.exclude?.includes(g)||f?.include&&!f.include.includes(g))throw new s.ab(Error("method not supported"),{method:g});if(y?.aborted)throw(0,a.TY)(y);let b=d?function(e,t=0){let r=0xdeadbeef^t,n=0x41c6ce57^t;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);r=Math.imul(r^i,0x9e3779b1),n=Math.imul(n^i,0x5f356495)}return r=Math.imul(r^r>>>16,0x85ebca6b)^Math.imul(n^n>>>16,0xc2b2ae35),(0x100000000*(2097151&(n=Math.imul(n^n>>>16,0x85ebca6b)^Math.imul(r^r>>>16,0xc2b2ae35)))+(r>>>0)).toString(36)}(`${m}.${(0,c.A)(r)}`):void 0;return function(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(o.get(r))return o.get(r);let n=e().finally(()=>o.delete(r));return o.set(r,n),n}(()=>(0,l.b)(async()=>{try{return await e(r,y?{signal:y}:void 0)}catch(e){if(y?.aborted)throw(0,a.TY)(y);if((0,a.zf)(e))throw e;switch(e.code){case s.XU.code:throw new s.XU(e);case s.CL.code:throw new s.CL(e);case s.Gi.code:throw new s.Gi(e,{method:r.method});case s.D5.code:throw new s.D5(e);case s.bq.code:throw new s.bq(e);case s.Di.code:throw new s.Di(e);case s.hA.code:throw new s.hA(e);case s.qZ.code:throw new s.qZ(e);case s.YW.code:throw new s.YW(e);case s.ab.code:throw new s.ab(e,{method:r.method});case s.s0.code:throw new s.s0(e);case s.xQ.code:throw new s.xQ(e);case s.vx.code:throw new s.vx(e);case s.sV.code:throw new s.sV(e);case s.Sf.code:throw new s.Sf(e);case s.RV.code:throw new s.RV(e);case s.xq.code:throw new s.xq(e);case s.ch.code:throw new s.ch(e);case s.L5.code:throw new s.L5(e);case s.WT.code:throw new s.WT(e);case s.hl.code:throw new s.hl(e);case s.cg.code:throw new s.cg(e);case s.uL.code:throw new s.uL(e);case s.G1.code:throw new s.G1(e);case s.jz.code:throw new s.jz(e);case 5e3:throw new s.vx(e);case s.nR.code:throw new s.nR(e);default:if(e instanceof n.C)throw e;throw new s.MI(e)}}},{delay:({count:e,error:t})=>{if(t&&t instanceof i.Ci){let e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e,10)}return~~(1<<e)*h},retryCount:p,signal:y,shouldRetry:({error:e})=>{var t;return t=e,!(0,a.zf)(t)&&("code"in t&&"number"==typeof t.code?-1===t.code||t.code===s.s0.code||t.code===s.bq.code||429===t.code:!(t instanceof i.Ci)||!t.status||403===t.status||408===t.status||413===t.status||429===t.status||500===t.status||502===t.status||503===t.status||504===t.status||!1)}}),{enabled:d,id:b})}}(d,{methods:t,retryCount:f,retryDelay:h,uid:(0,u.L)()}),value:m}}},18409:(e,t,r)=>{"use strict";r.d(t,{c:()=>i});var n=r(40917);function i(e,t="wei"){return n.ck(e,t)}},18637:(e,t,r)=>{"use strict";r.d(t,{E:()=>I,M:()=>P,P:()=>C,S:()=>N,a:()=>_,b:()=>k,c:()=>B,d:()=>R,e:()=>m,f:()=>y,g:()=>E,h:()=>A,i:()=>x,j:()=>S,k:()=>b,l:()=>T,m:()=>$,s:()=>v,u:()=>g});var n=r(75834),i=r(92204),s=r(40175),a=r(60336),o=r(11400),l=r(44037),c=r(33861),u=r(77603),d=r(26514),f=r(7287);let h=(0,i.v)(()=>({listings:[],loading:!1})),p=h.setState,y=e=>h.getState().listings.find(({slug:t})=>w(t)===w(e)),m=e=>{let t;try{t=new URL(e).hostname}catch(e){return}return h.getState().listings.find(({homepage:e})=>{let r;try{r=new URL(e).hostname}catch(e){return!1}return t.includes(r)})},g=(e=!0)=>{let t=(0,s.u)(),r=h(e=>e.listings),i=h(e=>e.loading),a=!!r.length;return(0,n.useEffect)(()=>{e&&!a&&(p({listings:[],loading:!0}),(async e=>{let t=new URL("v3/wallets","https://explorer-api.walletconnect.com");t.searchParams.append("projectId",e);let r=await fetch(t);return r.ok?Object.values((await r.json()).listings).sort(({slug:e},{slug:t})=>"rainbow"===e&&"metamask"===t?1:"metamask"===e||"rainbow"===e?-1:1):(console.debug(`Failed to fetch WalletConnect listings: ${await r.text().catch(()=>"No response.")}`),[])})(t.walletConnectCloudProjectId).then(e=>p({listings:e,loading:!1})).catch(e=>{console.error(e),p({listings:[],loading:!1})}
5))},[e,a,t.walletConnectCloudProjectId]),{listings:r,loading:i}},b=e=>{let{listings:t}=g();return t.find(({slug:t})=>w(t)===w(e))};function w(e){return"cryptocom"===e?"cryptocom-defi":"binance"===e?"binance-defi":e.replace(/[-_]wallet$/,"")}function v(e){return["wallet_connect","backpack","binance","binanceus","bitget_wallet","bybit_wallet","cryptocom","haha_wallet","jupiter","metamask","okx_wallet","phantom","rabby_wallet","rainbow","ronin_wallet","safe","solflare","uniswap","zerion","kraken_wallet","robinhood_wallet"].some(t=>e?.includes(t))}function x(e){return"ethereum"===e.type}function _(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let n=e[r],i=t[r];if(n?.address!==i?.address||n&&i&&x(n)&&x(i)&&n?.chainId!==i?.chainId||n?.connectorType!==i?.connectorType||n?.connectedAt!==i?.connectedAt||n?.walletClientType!==i?.walletClientType||n?.isConnected!==i?.isConnected||n?.linked!==i?.linked)return!1}return!0}let E=(e,t)=>e.rpcTimeouts&&e.rpcTimeouts[t]||s.o;function A(e){return"ethereum"===e.chainType}class I extends u.W{buildConnectedWallet(e,t,r,n){let i=async()=>!!this.wallets.find(t=>(0,o.b)(t.address)===(0,o.b)(e));return{type:"ethereum",address:(0,o.b)(e),chainId:t,meta:r,imported:n,switchChain:async r=>{let n,s;if(!i)throw new c.e("Wallet is not currently connected.");let a=this.wallets.find(t=>(0,o.b)(t.address)===(0,o.b)(e))?.chainId;if(!a)throw new c.e("Unable to determine current chainId.");if("number"==typeof r?(n=`0x${r.toString(16)}`,s=r):(n=r,s=Number(r)),a===(0,u.f)(n))return;let l=this.chains.find(e=>e.id===s);if(!l)throw new c.e(`Unsupported chainId: ${r}`);let d=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:n}]})};try{return await d()}catch(e){if(((e,t)=>{switch(t){case"coinbase_wallet":case"base_account":return e.message.includes("addEthereumChain");case"rabby_wallet":return e.message.includes("Unrecognized chain ID");default:return 4902===e.code||e.message?.includes("4902")}})(e,this.walletClientType))return"rabby_wallet"===this.walletClientType&&await (0,u.a)(300),await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:n,chainName:l.name,nativeCurrency:l.nativeCurrency,rpcUrls:[l.rpcUrls.default?.http[0]??""],blockExplorerUrls:[l.blockExplorers?.default.url??""]}]}),d();if("rainbow"===this.walletClientType&&e.message?.includes("wallet_switchEthereumChain"))throw new c.e(`Rainbow does not support the chainId ${t}`);throw e}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new c.e("Wallet is not currently connected.");return this.proxyProvider},sign:async e=>{if(!await i())throw new c.e("Wallet is not currently connected.");return await this.sign(e)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let t;u.c.debug("Syncing accounts",{wallet:this.walletClientType});let r=e;try{if(void 0===r){u.c.rpcRequest("eth_accounts",this.walletClientType);let e=await (0,u.i)(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});u.c.rpcResponse("eth_accounts",this.walletClientType),Array.isArray(e)&&(r=e)}}catch(e){u.c.warn("Wallet did not respond to eth_accounts, using prefetched accounts",{wallet:this.walletClientType})}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return void u.c.debug("No accounts found",{wallet:this.walletClientType});let n=r[0];if(!(0,a.P)(n))return;let i=(0,o.b)(n),l=[];if("privy"===this.walletClientType){let e=u.s.get((0,s.p)(i));this.chains.find(t=>t.id===Number(e))||(u.s.del((0,s.p)(i)),e=null),t=e||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(e){u.c.warn("Unable to switch embedded wallet chain on initialization",{wallet:this.walletClientType,chainId:t})}}else try{u.c.rpcRequest("eth_chainId",this.walletClientType);let e=await (0,u.i)(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(u.c.rpcResponse("eth_chainId",this.walletClientType),"string"==typeof e)t=e;else{if("number"!=typeof e)throw Error("Invalid chainId returned from provider");t=`0x${e.toString(16)}`}}catch(e){u.c.warn("Failed to get chainId from provider, using default",{wallet:this.walletClientType,defaultChainId:s.q}),t=s.q}let c=(0,u.f)(t);if(!l.find(e=>(0,o.b)(e.address)===i)){let e={name:this.walletBranding.name,icon:this.walletBranding.icon,id:this.walletBranding.id};l.push(this.buildConnectedWallet((0,o.b)(n),c,e,"embedded_imported"===this.connectorType))}_(l,this.wallets)||(u.c.debug("Wallets updated",{wallet:this.walletClientType,address:i,chainId:c}
5),this.wallets=l,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((e,t)=>t.connectedAt-e.connectedAt).find(t=>e.find(e=>(0,o.b)(e)===(0,o.b)(t.address)))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),this.proxyProvider.request({method:"personal_sign",params:[(0,l.nj)(e),this.wallets[0]?.address]})}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,t,r,n){super(e),this.chainType="ethereum",this.onAccountsChanged=e=>{u.c.providerEvent("accountsChanged",this.walletClientType,{accountsCount:e.length}),0===e.length?this.onDisconnect():this.syncAccounts(e)},this.onChainChanged=e=>{u.c.providerEvent("chainChanged",this.walletClientType,{chainId:e}),this.wallets.forEach(t=>{t.chainId=(0,u.f)(e),"privy"===this.walletClientType&&u.s.put((0,s.p)(t.address),e)}),this.emit("walletsUpdated")},this.onDisconnect=()=>{u.c.providerEvent("disconnect",this.walletClientType),this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=async()=>{u.c.providerEvent("connect",this.walletClientType),"base_account"===this.connectorType&&this.connected||(this.connected=!0,"coinbase_wallet"===this.connectorType&&await (0,u.a)(500),this.syncAccounts())},this.wallets=[],this.walletClientType=e,this.chains=t,this.defaultChain=r,this.rpcConfig=n,this.rpcTimeoutDuration=E(n,e),this.connected=!1,this.initialized=!1}}class C{on(e,t){if(this.walletProvider)return this.walletProvider.on(e,t);this._subscriptions.push({eventName:e,listener:t})}async request(e){if(!this.walletProvider)throw new c.e(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch(e=>{throw(0,u.j)(e)})}constructor(e,t){this.removeListener=(e,t)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(e,t)}catch(e){console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(e=new u.o,t=this.rpcTimeoutDuration)=>new Promise((r,n)=>setTimeout(()=>{n(e)},t)),this.setWalletProvider=e=>{this.walletProvider&&this._subscriptions.forEach(e=>{this.removeListener(e.eventName,e.listener)}),this.walletProvider=e,this._subscriptions.forEach(e=>{this.walletProvider?.on(e.eventName,e.listener)})},this.walletProvider=e,this.rpcTimeoutDuration=t||s.o,this._subscriptions=[]}}class S extends I{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the EthereumNullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the EthereumNullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the EthereumNullConnector for ${e}`)}constructor({id:e,name:t,icon:r,walletClientType:n,defaultChain:i}){super(n,[],i,{}),this.connectorType="null",this.proxyProvider=new C(void 0,s.o),this.id=e,this.name=t,this.icon=r}}let P=({...e}={})=>(0,d.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",...e,children:[(0,d.jsx)("rect",{width:"32",height:"32",rx:"6",fill:"#121314"}),(0,d.jsx)("g",{transform:"translate(4, 4)",children:(0,d.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 318.6 318.6",children:[(0,d.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,d.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,d.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,d.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,d.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,d.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,d.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,d.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,d.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,d.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,d.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,d.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,d.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h4
56.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]})})]}),$=Object.freeze({phantom:{client:"phantom",name:"Phantom",installLink:f.gm?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",chainTypes:["ethereum","solana"],get isInstalled(){if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId||e?.phantom?.solana?.isPhantom)return!0}return!1},getMobileRedirect({useUniversalLink:e,isSolana:t,connectOnly:r}){let n=O({client:this.client,isSolana:t,connectOnly:r});return`${e?"phantom://":"https://phantom.app/ul/"}browse/${n}?ref=${n}`}},solflare:{client:"solflare",name:"Solflare",installLink:f.gm?"https://addons.mozilla.org/es/firefox/addon/solflare-wallet/":"https://chromewebstore.google.com/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",chainTypes:["solana"],get isInstalled(){return"solflare"in window&&!!window?.solflare?.isSolflare},getMobileRedirect({useUniversalLink:e,isSolana:t,connectOnly:r}){let n=O({client:this.client,isSolana:t,connectOnly:r});return`${e?"solflare://ul/v1/":"https://solflare.com/ul/v1/"}browse/${n}?ref=${n}`}},jupiter:{client:"jupiter",name:"Jupiter Wallet",installLink:"https://chromewebstore.google.com/detail/jupiter-wallet/iledlaeogohbilgbfhmbgkgmpplbfboh",chainTypes:["solana"],get isInstalled(){return"jupiter"in window&&!!window?.jupiter?.isJupiter},getMobileRedirect({isSolana:e,connectOnly:t}){let r=O({client:this.client,isSolana:e,connectOnly:t});return`jupjupjup://jup.ag/browse/${r}?ref=${r}`}},backpack:{client:"backpack",name:"Backpack",installLink:"https://chromewebstore.google.com/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof",chainTypes:["ethereum","solana"],get isInstalled(){return!(!("backpack"in window)||!window?.backpack?.ethereum?.isBackpack&&!window?.backpack?.solana?.isBackpack)},getMobileRedirect({useUniversalLink:e,isSolana:t,connectOnly:r}){let n=O({client:this.client,isSolana:t,connectOnly:r});return`${e?"backpack://ul/v1/":"https://backpack.app/ul/v1/"}browse/${n}?ref=${n}`}},okx_wallet:{client:"okx_wallet",name:"OKX Wallet",installLink:"https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge",chainTypes:["ethereum","solana"],get isInstalled(){return"okxwallet"in window&&!!window?.okxwallet?.isOkxWallet},getMobileRedirect({isSolana:e,connectOnly:t}){return`okx://wallet/dapp/url?dappUrl=${O({client:this.client,isSolana:e,connectOnly:t})}`}}});function k({connectorType:e,walletClientType:t}){for(let r of s.A)if(e===r||t===r)return $[r]}function T({isMobile:e,walletConfig:t}){return!e&&"phantom"===t?.client}function O({client:e,isSolana:t,connectOnly:r}){let n=new URL(window.location.href);return n.searchParams.set("privy_connector",t?"solana_adapter":"injected"),n.searchParams.set("privy_wallet_client",e),n.searchParams.set("privy_connect_only",String(r)),encodeURIComponent(n.href.replace(/\/$/g,""))}class N extends u.S{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the SolanaNullConnector")}constructor({id:e,name:t,icon:r}){super({name:t},!1),this.connectorType="null",this.proxyProvider=new C(void 0,s.o),this.disconnect=async()=>{throw Error("disconnect called for an uninstalled wallet via the SolanaNullConnector")},this.promptConnection=async()=>{throw Error("promptConnection called for an uninstalled wallet via the SolanaNullConnector")},this.id=e,this.name=t,this.icon=r}}function R(e){return"solana"===e.chainType}function B(e){return"solana"===e.type}},18775:(e,t,r)=>{"use strict";r.d(t,{sc:()=>w,qt:()=>x,Zf:()=>v});var n=r(9146);
vendor: 4,273 bytes, line 5
5class i extends n.Vw{constructor(e,t,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=(0,n.O8)(this.buffer)}update(e){(0,n.CC)(this),e=(0,n.ZJ)(e),(0,n.DO)(e);let{view:t,buffer:r,blockLen:i}=this,s=e.length;for(let a=0;a<s;){let o=Math.min(i-this.pos,s-a);if(o===i){let t=(0,n.O8)(e);for(;i<=s-a;a+=i)this.process(t,a);continue}r.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.CC)(this),(0,n.Ht)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:i,isLE:s}=this,{pos:a}=this;t[a++]=128,(0,n.uH)(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(r,0),a=0);for(let e=a;e<i;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(0xffffffff),a=Number(r>>i&s),o=Number(r&s),l=4*!!n,c=4*!n;e.setUint32(t+l,a,n),e.setUint32(t+c,o,n)}(r,i-8,BigInt(8*this.length),s),this.process(r,0);let o=(0,n.O8)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=l/4,u=this.get();if(c>u.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)o.setUint32(4*e,u[e],s)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:a}=this;return e.destroyed=s,e.finished=i,e.length=n,e.pos=a,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}let s=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),a=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),o=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]);var l=r(57636);let c=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),u=new Uint32Array(64);class d extends i{constructor(e=32){super(64,e,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:a,H:o}=this;return[e,t,r,n,i,s,a,o]}set(e,t,r,n,i,s,a,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|a,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=u[e-15],r=u[e-2],i=(0,n.Ow)(t,7)^(0,n.Ow)(t,18)^t>>>3,s=(0,n.Ow)(r,17)^(0,n.Ow)(r,19)^r>>>10;u[e]=s+u[e-7]+i+u[e-16]|0}let{A:r,B:i,C:s,D:a,E:o,F:l,G:d,H:f}=this;for(let e=0;e<64;e++){var h,p,y,m;let t=f+((0,n.Ow)(o,6)^(0,n.Ow)(o,11)^(0,n.Ow)(o,25))+((h=o)&l^~h&d)+c[e]+u[e]|0,g=((0,n.Ow)(r,2)^(0,n.Ow)(r,13)^(0,n.Ow)(r,22))+((p=r)&(y=i)^p&(m=s)^y&m)|0;f=d,d=l,l=o,o=a+t|0,a=s,s=i,i=r,r=t+g|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,l=l+this.F|0,d=d+this.G|0,f=f+this.H|0,this.set(r,i,s,a,o,l,d,f)}roundClean(){(0,n.uH)(u)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,n.uH)(this.buffer)}}let f=l.lD(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
56f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),h=f[0],p=f[1],y=new Uint32Array(80),m=new Uint32Array(80);class g extends i{constructor(e=64){super(128,e,16,!1),this.Ah=0|o[0],this.Al=0|o[1],this.Bh=0|o[2],this.Bl=0|o[3],this.Ch=0|o[4],this.Cl=0|o[5],this.Dh=0|o[6],this.Dl=0|o[7],this.Eh=0|o[8],this.El=0|o[9],this.Fh=0|o[10],this.Fl=0|o[11],this.Gh=0|o[12],this.Gl=0|o[13],this.Hh=0|o[14],this.Hl=0|o[15]}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:a,Dl:o,Eh:l,El:c,Fh:u,Fl:d,Gh:f,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,i,s,a,o,l,c,u,d,f,h,p,y]}set(e,t,r,n,i,s,a,o,l,c,u,d,f,h,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|l,this.El=0|c,this.Fh=0|u,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)y[r]=e.getUint32(t),m[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|y[e-15],r=0|m[e-15],n=l.rE(t,r,1)^l.rE(t,r,8)^l.xn(t,r,7),i=l.ry(t,r,1)^l.ry(t,r,8)^l.jm(t,r,7),s=0|y[e-2],a=0|m[e-2],o=l.rE(s,a,19)^l.qh(s,a,61)^l.xn(s,a,6),c=l.ry(s,a,19)^l.Ei(s,a,61)^l.jm(s,a,6),u=l.CW(i,c,m[e-7],m[e-16]),d=l.CQ(u,n,o,y[e-7],y[e-16]);y[e]=0|d,m[e]=0|u}let{Ah:r,Al:n,Bh:i,Bl:s,Ch:a,Cl:o,Dh:c,Dl:u,Eh:d,El:f,Fh:g,Fl:b,Gh:w,Gl:v,Hh:x,Hl:_}=this;for(let e=0;e<80;e++){let t=l.rE(d,f,14)^l.rE(d,f,18)^l.qh(d,f,41),E=l.ry(d,f,14)^l.ry(d,f,18)^l.Ei(d,f,41),A=d&g^~d&w,I=f&b^~f&v,C=l.F8(_,E,I,p[e],m[e]),S=l.TH(C,x,t,A,h[e],y[e]),P=0|C,$=l.rE(r,n,28)^l.qh(r,n,34)^l.qh(r,n,39),k=l.ry(r,n,28)^l.Ei(r,n,34)^l.Ei(r,n,39),T=r&i^r&a^i&a,O=n&s^n&o^s&o;x=0|w,_=0|v,w=0|g,v=0|b,g=0|d,b=0|f,({h:d,l:f}=l.WQ(0|c,0|u,0|S,0|P)),c=0|a,u=0|o,a=0|i,o=0|s,i=0|r,s=0|n;let N=l.Vl(P,k,O);r=l.Vr(N,S,$,T),n=0|N}({h:r,l:n}=l.WQ(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:s}=l.WQ(0|this.Bh,0|this.Bl,0|i,0|s)),({h:a,l:o}=l.WQ(0|this.Ch,0|this.Cl,0|a,0|o)),({h:c,l:u}=l.WQ(0|this.Dh,0|this.Dl,0|c,0|u)),({h:d,l:f}=l.WQ(0|this.Eh,0|this.El,0|d,0|f)),({h:g,l:b}=l.WQ(0|this.Fh,0|this.Fl,0|g,0|b)),({h:w,l:v}=l.WQ(0|this.Gh,0|this.Gl,0|w,0|v)),({h:x,l:_}=l.WQ(0|this.Hh,0|this.Hl,0|x,0|_)),this.set(r,n,i,s,a,o,c,u,d,f,g,b,w,v,x,_)}roundClean(){(0,n.uH)(y,m)}destroy(){(0,n.uH)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class b extends g{constructor(){super(48),this.Ah=0|a[0],this.Al=0|a[1],this.Bh=0|a[2],this.Bl=0|a[3],this.Ch=0|a[4],this.Cl=0|a[5],this.Dh=0|a[6],this.Dl=0|a[7],this.Eh=0|a[8],this.El=0|a[9],this.Fh=0|a[10],this.Fl=0|a[11],this.Gh=0|a[12],this.Gl=0|a[13],this.Hh=0|a[14],this.Hl=0|a[15]}}let w=(0,n.qj)(()=>new d),v=(0,n.qj)(()=>new g),x=(0,n.qj)(()=>new b)},18841:(e,t,r)=>{"use strict";r.d(t,{t:()=>s});var n=r(36665),i=r(651);function s(e){let{kzg:t}=e,r=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),s="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,n.aT)(e)):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map(e=>(0,n.aT)(e)):e.commitments,o=[];for(let e=0;e<s.length;e++){let r=s[e],n=a[e];o.push(Uint8Array.from(t.computeBlobKzgProof(r,n)))}return"bytes"===r?o:o.map(e=>(0,i.My)(e))}},19081:(e,t)=>{"use strict";
5Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;class r{}t.IWatch=r},19142:(e,t,r)=>{"use strict";r.d(t,{j:()=>u});var n=r(45897),i=r(16291),s=r(21047),a=r(43024),o=r(82666),l=r(21394);let c="/docs/contract/decodeEventLog";function u(e){let{abi:t,data:r,strict:u,topics:d}=e,f=u??!0,[h,...p]=d;if(!h)throw new n._z({docsPath:c});let y=t.find(e=>"event"===e.type&&h===(0,a.h)((0,l.B)(e)));if(!(y&&"name"in y)||"event"!==y.type)throw new n.kE(h,{docsPath:c});let{name:m,inputs:g}=y,b=g?.some(e=>!("name"in e&&e.name)),w=b?[]:{},v=g.map((e,t)=>[e,t]).filter(([e])=>"indexed"in e&&e.indexed),x=[];for(let e=0;e<v.length;e++){let[t,r]=v[e],i=p[e];if(!i){if(f)throw new n.l3({abiItem:y,param:t});x.push([t,r]);continue}w[b?r:t.name||r]=function({param:e,value:t}){return"string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/)?t:((0,o.n)([e],t)||[])[0]}({param:t,value:i})}let _=g.filter(e=>!("indexed"in e&&e.indexed)),E=f?_:[...x.map(([e])=>e),..._];if(E.length>0){if(r&&"0x"!==r)try{let e=(0,o.n)(E,r);if(e){let t=0;if(!f)for(let[r,n]of x)w[b?n:r.name||n]=e[t++];if(b)for(let r=0;r<g.length;r++)void 0===w[r]&&t<e.length&&(w[r]=e[t++]);else for(let r=0;r<_.length;r++)w[_[r].name]=e[t++]}}catch(e){if(f){if(e instanceof n.Iy||e instanceof i.SK)throw new n.fo({abiItem:y,data:r,params:E,size:(0,s.E)(r)});throw e}}else if(f)throw new n.fo({abiItem:y,data:"0x",params:E,size:0})}return{eventName:m,args:Object.values(w).length>0?w:void 0}}},19284:(e,t,r)=>{"use strict";r.d(t,{u:()=>i});var n=r(86326);async function i(e,{signal:t}={}){return new Promise((r,i)=>{if(t?.aborted)return void i((0,n.TY)(t));let s=()=>t?.removeEventListener("abort",o),a=setTimeout(()=>{s(),r()},e),o=()=>{clearTimeout(a),s(),i((0,n.TY)(t))};t?.addEventListener("abort",o,{once:!0})})}},19390:(e,t,r)=>{"use strict";r.d(t,{Hn:()=>o,X3:()=>i,_j:()=>s,eN:()=>a,f7:()=>n});let n=0xffffffff;function i(e,t,r){e.setUint32(t,r/0x100000000),e.setUint32(t+4,r)}function s(e,t,r){let n=Math.floor(r/0x100000000);e.setUint32(t,n),e.setUint32(t+4,r)}function a(e,t){return 0x100000000*e.getInt32(t)+e.getUint32(t+4)}function o(e,t){return 0x100000000*e.getUint32(t)+e.getUint32(t+4)}},19866:(e,t,r)=>{"use strict";r.d(t,{w:()=>i});var n=r(92202);function i(e,{emitOnBegin:t,initialWaitTime:r,interval:i}){let s=!0,a=()=>s=!1;return(async()=>{let o;t&&(o=await e({unpoll:a}));let l=await r?.(o)??i;await (0,n.u)(l);let c=async()=>{s&&(await e({unpoll:a}),await (0,n.u)(i),c())};c()})(),a}},20041:(e,t,r)=>{"use strict";r.d(t,{F:()=>s});var n=r(66277),i=r(71345);class s extends i.IJsonRpcProvider{constructor(e){super(e),this.events=new n.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict((0,i.formatJsonRpcRequest)(e.method,e.params||[],e.id||(0,i.getBigIntRpcId)().toString()),t)}async requestStrict(e,t){return new Promise(async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,e=>{(0,i.isJsonRpcError)(e)?n(e.error):r(e.result)});try{await this.connection.send(e,t)}catch(e){n(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),(0,i.isJsonRpcResponse)(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}},20169:(e,t,r)=>{"use strict";r.d(t,{b4:()=>s,gU:()=>o,uP:()=>a});var n=r(36174),i=r(65323);let s={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function a(e,t){let r={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...null!=e.blockTimestamp&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?(0,n.ME)(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?(0,n.ME)(e.n
vendor: 6,362 bytes, line 5
5once):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?s[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(r.authorizationList=e.authorizationList.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))),r.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof r.v){if(0n===r.v||27n===r.v)return 0;if(1n===r.v||28n===r.v)return 1;if(r.v>=35n)return+(r.v%2n===0n)}})(),"legacy"===r.type&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),"eip2930"===r.type&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),"eip1559"===r.type&&delete r.maxFeePerBlobGas,r}let o=(0,i.q)("transaction",a)},20234:(e,t,r)=>{"use strict";r.d(t,{Q:()=>i});var n=r(84742);async function i(e,{address:t,blockHash:r,blockNumber:i,blockTag:s="latest",requireCanonical:a}){let o=(0,n.O)({blockHash:r,blockNumber:i,blockTag:s,requireCanonical:a}),l=await e.request({method:"eth_getCode",params:[t,o]},{dedupe:"bigint"==typeof i||void 0!==r});if("0x"!==l)return l}},20284:(e,t,r)=>{"use strict";r.d(t,{_o:()=>g,Pj:()=>y,uT:()=>d,NV:()=>m});var n=r(90320),i=r(38619),s=r(29063),a=r(99640),o=r(3832);class l extends o.C{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}let c=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);var u=r(55212);function d(e,t={}){if((0,u.Ji)(e))return function(e,t={}){let r=(0,u.ej)(e);if(!r)throw new a.s7({signature:e,type:"function"});let n=m(r.parameters),i=[],s=n.length;for(let e=0;e<s;e++)i.push(y(n[e],{modifiers:u.v7,structs:t,type:"function"}));let o=[];if(r.returns){let e=m(r.returns),n=e.length;for(let r=0;r<n;r++)o.push(y(e[r],{modifiers:u.v7,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:i,outputs:o}}(e,t);if((0,u.Rv)(e))return function(e,t={}){let r=(0,u.iB)(e);if(!r)throw new a.s7({signature:e,type:"event"});let n=m(r.parameters),i=[],s=n.length;for(let e=0;e<s;e++)i.push(y(n[e],{modifiers:u.fC,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:i}}(e,t);if((0,u.pc)(e))return function(e,t={}){let r=(0,u.kz)(e);if(!r)throw new a.s7({signature:e,type:"error"});let n=m(r.parameters),i=[],s=n.length;for(let e=0;e<s;e++)i.push(y(n[e],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:i}}(e,t);if((0,u.l9)(e))return function(e,t={}){let r=(0,u.Yo)(e);if(!r)throw new a.s7({signature:e,type:"constructor"});let n=m(r.parameters),i=[],s=n.length;for(let e=0;e<s;e++)i.push(y(n[e],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:i}}(e,t);if((0,u.v8)(e)){var r=e;let t=(0,u.If)(r);if(!t)throw new a.s7({signature:r,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}if((0,u.sP)(e))return{type:"receive",stateMutability:"payable"};throw new a.x8({signature:e})}let f=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,h=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,p=/^u?int$/;function y(e,t){var r,a;let o,l=function(e,t,r){let n="";if(r)for(let e of Object.entries(r)){if(!e)continue;let t="";for(let r of e[1])t+=`[${r.type}${r.name?`:${r.name}`:""}]`;n+=`(${e[0]}{${t}})`}return t?`${t}:${e}${n}`:`${e}${n}`}(e,t?.type,t?.structs);if(c.has(l))return c.get(l);let d=n.wj.test(e),w=(0,n.Yv)(d?h:f,e);if(!w)throw new s.dV({param:e});if(w.name&&("address"===(r=w.name)||"bool"===r||"function"===r||"string"===r||"tuple"===r||n.BD.test(r)||n.Ge.test(r)||b.test(r)))throw new s.zd({param:e,name:w.name});let v=w.name?{name:w.name}:{},x="indexed"===w.modifier?{indexed:!0}:{},_=t?.structs??{},E={};if(d){o="tuple";let e=m(w.type),t=[],r=e.length;for(let n=0;n<r;n++)t.push(y(e[n],{structs:_}));E={components:t}}else if(w.type in _)o="tuple",E={components:_[w.type]};else if(p.test(w.type))o=`${w.type}256`;else if("address payable"===w.type)o="address";else if(o=w.type,t?.type!=="struct"&&!g(o))throw new i.UG({type:o});if(w.modifier){if(!t?.modifiers?.has?.(w.modifier))throw new s.NO({param:e,type:t?.type,modifier:w.modifier});if(u.v7.has(w.modifier)&&(a=o,!w.array&&"bytes"!==a&&"string"!==a&&"tuple"!==a)
5)throw new s.Pj({param:e,type:t?.type,modifier:w.modifier})}let A={type:`${o}${w.array??""}`,...v,...x,...E};return c.set(l,A),A}function m(e,t=[],r="",n=0){let i=e.trim().length;for(let s=0;s<i;s++){let i=e[s],a=e.slice(s+1);switch(i){case",":return 0===n?m(a,[...t,r.trim()]):m(a,t,`${r}${i}`,n);case"(":return m(a,t,`${r}${i}`,n+1);case")":return m(a,t,`${r}${i}`,n-1);default:return m(a,t,`${r}${i}`,n)}}if(""===r)return t;if(0!==n)throw new l({current:r,depth:n});return t.push(r.trim()),t}function g(e){return"address"===e||"bool"===e||"function"===e||"string"===e||n.BD.test(e)||n.Ge.test(e)}let b=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/},20347:(e,t,r)=>{"use strict";r.d(t,{b4:()=>s,gU:()=>o,uP:()=>a});var n=r(5596),i=r(75941);let s={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function a(e,t){let r={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...null!=e.blockTimestamp&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?(0,n.ME)(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?(0,n.ME)(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?s[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(r.authorizationList=e.authorizationList.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))),r.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof r.v){if(0n===r.v||27n===r.v)return 0;if(1n===r.v||28n===r.v)return 1;if(r.v>=35n)return+(r.v%2n===0n)}})(),"legacy"===r.type&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),"eip2930"===r.type&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),"eip1559"===r.type&&delete r.maxFeePerBlobGas,r}let o=(0,i.q)("transaction",a)},20824:(e,t,r)=>{"use strict";r.d(t,{v:()=>u});var n=r(40852),i=r(56300),s=r(53986),a=r(53160);let o=new Map,l=new Map;function c(e){var t;let r=null!=(t=l.get(e))?t:0;return l.set(e,r+1),0!==r||(o.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>(function(e){var t;let r=null!=(t=l.get(e))?t:1;if(1===r?l.delete(e):l.set(e,r-1),1!==r)return;let n=o.get(e);n&&(null===n["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,o.delete(e))})(e)}function u(e,{allowed:t,disallowed:r}={}){let o=(0,s.S)(e,"inert-others");(0,a.s)(()=>{var e,s;if(!o)return;let a=(0,n.e)();for(let t of null!=(e=null==r?void 0:r())?e:[])t&&a.add(c(t));let l=null!=(s=null==t?void 0:t())?s:[];for(let e of l){if(!e)continue;let t=(0,i.TW)(e);if(!t)continue;let r=e.parentElement;for(;r&&r!==t.body;){for(let e of r.children)l.some(t=>e.contains(t))||a.add(c(e));r=r.parentElement}}return a.dispose},[o,t,r])}},20872:(e,t,r)=>{"use strict";r.d(t,{P:()=>f,a:()=>u,b:()=>h,c:()=>c,g:()=>m,s:()=>d,t:()=>y,u:()=>p});var n=r(75834),i=r(55663),s=r(92204),a=r(86253),o=r(33861),l=r(87280);let c=(e,{chainType:t,walletIndex:r}={})=>e?.linkedAccounts.filter(e=>"wallet"===e.type&&"privy"===e.walletClientType&&(void 0===r||e.walletIndex===r)&&(void 0===t||e.chainType===t))??[],u=(0,s.v)(()=>({ethereumExternal:[],areExternalConnectorsReady:!1,ethereumEmbedded:[]})),d=e=>
5u.setState({areExternalConnectorsReady:e}),f=(0,n.createContext)(!1),h=()=>{if((0,n.useContext)(f))throw new o.P("Multiple PrivyProvider instances found","Found multiple instances of PrivyProvider, ensure there is only one mounted in your application tree.")};function p(){let e=(0,n.useContext)(f),t=(0,a.u)(),r=u(e=>e.ethereumEmbedded),s=u(e=>e.ethereumExternal),o=u(e=>e.areExternalConnectorsReady),l=(0,i.u)(e=>e.user),d=(0,i.u)(e=>e.hasResolvedInitialUser),h=(0,n.useMemo)(()=>[...r,...s].sort((e,t)=>t.connectedAt-e.connectedAt),[r,s]),p=c(l,{chainType:"ethereum"}).length>0,y=r.length>0,m=!!o&&!!d&&!!t.walletProxy&&(!p||y);return e?(0,n.useMemo)(()=>({wallets:h,ready:m}),[h,m]):(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1})}let y=e=>{if("ethereum"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},m=(e,t)=>{if(t?.imported)return y(t);let r=(0,l.g)(e);if(!r)throw Error("Failed to find primary wallet");return y(r)}},20888:(e,t,r)=>{"use strict";r.d(t,{sG:()=>a});var n=r(75834);r(60851);var i=r(29729),s=r(26514),a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=(0,i.TL)(`Primitive.${t}`),a=n.forwardRef((e,n)=>{let{asChild:i,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(i?r:t,{...a,ref:n})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{})},21008:(e,t,r)=>{"use strict";r.d(t,{PL:()=>f,Qe:()=>y,VI:()=>h,eC:()=>p,eh:()=>m,tD:()=>u,vU:()=>d});var n=r(31911),i=r(5635);function s(e,t,r,i){if(i<t||i>r)throw new n.tsw(n.hMG,{codecDescription:e,max:r,min:t,value:i})}var a=(e=>(e[e.Little=0]="Little",e[e.Big=1]="Big",e))(a||{});function o(e){return e?.endian!==1}function l(e){return(0,i.xv)({fixedSize:e.size,write(t,r,n){e.range&&s(e.name,e.range[0],e.range[1],t);let i=new ArrayBuffer(e.size);return e.set(new DataView(i),t,o(e.config)),r.set(new Uint8Array(i),n),n+e.size}})}function c(e){return(0,i.$C)({fixedSize:e.size,read(t,r=0){(0,i.xL)(e.name,t,r),(0,i.C1)(e.name,e.size,t,r);let n=new DataView((0,i.XA)(t,r,e.size));return[e.get(n,o(e.config)),r+e.size]}})}var u=()=>(0,i.xv)({getSizeFromValue:e=>e<=127?1:e<=16383?2:3,maxSize:3,write:(e,t,r)=>{s("shortU16",0,65535,e);let n=[0];for(let t=0;;t+=1){let r=Number(e)>>7*t;if(0===r)break;let i=127&r;n[t]=i,t>0&&(n[t-1]|=128)}return t.set(n,r),r+n.length}}),d=()=>(0,i.$C)({maxSize:3,read:(e,t)=>{let r=0,n=0;for(;++n;){let i=n-1,s=e[t+i];if(r|=(127&s)<<7*i,(128&s)==0)break}return[r,t+n]}}),f=(e={})=>l({config:e,name:"u32",range:[0,Number("0xffffffff")],set:(e,t,r)=>e.setUint32(0,Number(t),r),size:4}),h=(e={})=>c({config:e,get:(e,t)=>e.getUint32(0,t),name:"u32",size:4}),p=(e={})=>l({config:e,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,t,r)=>e.setBigUint64(0,BigInt(t),r),size:8}),y=()=>l({name:"u8",range:[0,Number("0xff")],set:(e,t)=>e.setUint8(0,Number(t)),size:1}),m=()=>c({get:e=>e.getUint8(0),name:"u8",size:1})},21047:(e,t,r)=>{"use strict";r.d(t,{E:()=>i});var n=r(2939);function i(e){return(0,n.q)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}},21178:(e,t,r)=>{"use strict";r.d(t,{l:()=>s});var n=r(14487),i=r(48197);function s(e){let{key:t="public",name:r="Public Client"}=e;return(0,n.UU)({...e,key:t,name:r,type:"publicClient"}).extend(i.$)}},21304:(e,t,r)=>{"use strict";r.d(t,{P:()=>a,g:()=>o,u:()=>l});var n=r(26514),i=r(75834);let s=(0,r(92204).v)(()=>({})),a=({children:e,configPlugins:t})=>((0,i.useEffect)(()=>{if(t&&0!==t.length)return s.setState(Object.fromEntries(t.map(e=>[e.id,e]))),()=>{s.setState(Object.fromEntries(t.map(e=>[e.id,void 0])))}},[t]),(0,n.jsx)(n.Fragment,{children:e})),o=e=>s.getState()[e],l=()=>(0,i.useCallback)(e=>o(e),[])},21329:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;let n=r(17562);t.toMiliseconds=function(e){return e*n.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/n.ONE_THOUSAND)}},21332:(e,t,r)=>{"use strict";r.d(t,{$T:()=>A,Dg:()=>w,Ej:()=>g,Fl:()=>k,G4:()=>v,HT:()=>f,Mr:()=>E,Ro:()=>x,aD:()=>h,dI:()=>_,di:()=>b,ii:()=>$,n4:()=>y,sH:()=>p,tf:()=>I,u:()=>P,xW:()=>d,yT:()=>m});var n=r(52516),i=r(64959),s=r(62610),a=r(23392),o=r(58566),l=r(52511);let c=new TextDecoder,u=new TextEncoder;function d(...e){let t=0;
5for(let r of e)t+=r.length;let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}function f(e){var t;return e instanceof Uint8Array?e:"string"==typeof e?h(e):(t=e)instanceof Uint8Array?t:new Uint8Array(t)}function h(e,t={}){let{size:r}=t,n=e;r&&(o.Sl(e,r),n=s.M7(e,r));let l=n.slice(2);l.length%2&&(l=`0${l}`);let c=l.length/2,u=new Uint8Array(c);for(let e=0,t=0;e<c;e++){let r=a.t7(l.charCodeAt(t++)),n=a.t7(l.charCodeAt(t++));if(void 0===r||void 0===n)throw new i.C(`Invalid byte sequence ("${l[t-2]}${l[t-1]}" in "${l}").`);u[e]=r<<4|n}return u}function p(e,t={}){var r,n;let{size:i}=t,s=u.encode(e);return"number"==typeof i?(a.Sl(s,i),r=s,n=i,a.eV(r,{dir:"right",size:n})):s}function y(e,t){return(0,n.ex)(e,t)}function m(e){return crypto.getRandomValues(new Uint8Array(e))}function g(e){return e.length}function b(e,t,r,n={}){let{strict:i}=n;a.kK(e,t);let s=e.slice(t,r);return i&&a.X(s,t,r),s}function w(e,t={}){let{size:r}=t;void 0!==r&&a.Sl(e,r);let n=s.uK(e,t);return s.Dg(n,t)}function v(e,t={}){let{size:r}=t,n=e;if(void 0!==r&&(a.Sl(n,r),n=E(n)),n.length>1||n[0]>1)throw new C(n);return!!n[0]}function x(e,t={}){let{size:r}=t;void 0!==r&&a.Sl(e,r);let n=s.uK(e,t);return s.Ro(n,t)}function _(e,t={}){let{size:r}=t,n=e;return void 0!==r&&(a.Sl(n,r),n=A(n)),c.decode(n)}function E(e){return a.Bq(e,{dir:"left"})}function A(e){return a.Bq(e,{dir:"right"})}function I(e){try{if(!(e instanceof Uint8Array)&&(!e||"object"!=typeof e||!("BYTES_PER_ELEMENT"in e)||1!==e.BYTES_PER_ELEMENT||"Uint8Array"!==e.constructor.name))throw new S(e);return!0}catch{return!1}}class C extends i.C{constructor(e){super(`Bytes value \`${e}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}class S extends i.C{constructor(e){super(`Value \`${"object"==typeof e?l.As(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}class P extends i.C{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class $ extends i.C{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}class k extends i.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}},21394:(e,t,r)=>{"use strict";r.d(t,{A:()=>s,B:()=>i});var n=r(45897);function i(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new n.d_(e.type);return`${e.name}(${s(e.inputs,{includeName:t})})`}function s(e,{includeName:t=!1}={}){return e?e.map(e=>(function(e,{includeName:t}){return e.type.startsWith("tuple")?`(${s(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")})(e,{includeName:t})).join(t?", ":","):""}},21557:(e,t,r)=>{"use strict";r.d(t,{Bm:()=>f,HT:()=>u,J$:()=>p,_7:()=>y,aD:()=>l,el:()=>g,gX:()=>d,nj:()=>h,o6:()=>c,vA:()=>o});var n=r(64959),i=r(62610),s=r(52511),a=r(22460);function o(e,t={}){let{recovered:r}=t;if(void 0===e.r||void 0===e.s||r&&void 0===e.yParity)throw new w({signature:e});if(e.r<0n||e.r>a.Ao)throw new v({value:e.r});if(e.s<0n||e.s>a.Ao)throw new x({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new _({value:e.yParity})}function l(e){if(130!==e.length&&132!==e.length)throw new b({signature:e});let t=BigInt(i.di(e,0,32)),r=BigInt(i.di(e,32,64)),n=(()=>{let t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return m(t)}catch{throw new _({value:t})}})();return void 0===n?{r:t,s:r}:{r:t,s:r,yParity:n}}function c(e){if(void 0!==e.r&&void 0!==e.s)return u(e)}function u(e){let t=(()=>{var t;if("string"==typeof e)return l(e);
5if(e instanceof Uint8Array)return l(i.uK(e));return"string"==typeof e.r?d(e):e.v?{r:(t=e).r,s:t.s,yParity:m(t.v)}:{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}}})();return o(t),t}function d(e){let t=(()=>{let t=e.v?Number(e.v):void 0,r=e.yParity?Number(e.yParity):void 0;if("number"==typeof t&&"number"!=typeof r&&(r=m(t)),"number"!=typeof r)throw new _({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function f(e){let[t,r,n]=e;return u({r:"0x"===r?0n:BigInt(r),s:"0x"===n?0n:BigInt(n),yParity:"0x"===t?0:Number(t)})}function h(e){o(e);let t=e.r,r=e.s;return i.xW(i.oB(t,{size:32}),i.oB(r,{size:32}),"number"==typeof e.yParity?i.oB(g(e.yParity),{size:1}):"0x")}function p(e){let{r:t,s:r,yParity:n}=e;return{r:i.oB(t,{size:32}),s:i.oB(r,{size:32}),yParity:0===n?"0x0":"0x1"}}function y(e){let{r:t,s:r,yParity:n}=e;return[n?"0x01":"0x",0n===t?"0x":i.Mr(i.oB(t)),0n===r?"0x":i.Mr(i.oB(r))]}function m(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return+(e%2==0);throw new E({value:e})}function g(e){if(0===e)return 27;if(1===e)return 28;throw new _({value:e})}class b extends n.C{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${i.Ej(i.HT(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class w extends n.C{constructor({signature:e}){super(`Signature \`${s.As(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class v extends n.C{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class x extends n.C{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class _ extends n.C{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class E extends n.C{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}},21989:(e,t,r)=>{"use strict";r.d(t,{v:()=>c});var n=r(63710),i=r(40407),s=r(10439),a=r(61349),o=r(29447),l=r(37438);async function c(e,t){let{abi:r,address:c,args:u,functionName:d,dataSuffix:f="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,...h}=t,p=h.account?(0,n.J)(h.account):e.account,y=(0,s.p)({abi:r,args:u,functionName:d});try{let{data:n}=await (0,o.T)(e,l.T,"call")({batch:!1,data:`${y}${f?f.replace("0x",""):""}`,to:c,...h,account:p}),s=(0,i.e)({abi:r,args:u,functionName:d,data:n||"0x"}),a=r.filter(e=>"name"in e&&e.name===t.functionName);return{result:s,request:{abi:a,address:c,args:u,dataSuffix:f,functionName:d,...h,account:p}}}catch(e){throw(0,a.j)(e,{abi:r,address:c,args:u,docsPath:"/docs/contract/simulateContract",functionName:d,sender:p?.address})}}},22395:(e,t,r)=>{"use strict";r.d(t,{l:()=>l});var n=r(68860),i=r(7727),s=r(19390),a=r(4891);class o{constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??i.g.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??100,this.initialBufferSize=e?.initialBufferSize??2048,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new o({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw Error(`Too deep objects in depth ${t}`);null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):"str
5ing"==typeof e?this.encodeString(e):this.useBigInt64&&"bigint"==typeof e?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){let t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)}resizeBuffer(e){let t=new ArrayBuffer(e),r=new Uint8Array(t),n=new DataView(t);r.set(this.bytes),this.view=n,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){!1===e?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<0x100000000?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-0x80000000?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<0x100000000)this.writeU8(219),this.writeU32(e);else throw Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let t=(0,n.dS)(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),(0,n.yi)(e,this.bytes,this.pos),this.pos+=t}encodeObject(e,t){let r=this.extensionCodec.tryToEncode(e,this.context);if(null!=r)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if("object"==typeof e)this.encodeMap(e,t);else throw Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<0x100000000)this.writeU8(198),this.writeU32(t);else throw Error(`Too large binary: ${t}`);let r=(0,a.C)(e);this.writeU8a(r)}encodeArray(e,t){let r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<0x100000000)this.writeU8(221),this.writeU32(r);else throw Error(`Too large array: ${r}`);for(let r of e)this.doEncode(r,t+1)}countWithoutUndefined(e,t){let r=0;for(let n of t)void 0!==e[n]&&r++;return r}encodeMap(e,t){let r=Object.keys(e);this.sortKeys&&r.sort();let n=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(n<16)this.writeU8(128+n);else if(n<65536)this.writeU8(222),this.writeU16(n);else if(n<0x100000000)this.writeU8(223),this.writeU32(n);else throw Error(`Too large map object: ${n}`);for(let n of r){let r=e[n];this.ignoreUndefined&&void 0===r||(this.encodeString(n),this.doEncode(r,t+1))}}encodeExtension(e){if("function"==typeof e.data){let t=e.data(this.pos+6),r=t.length;if(r>=0x100000000)throw Error(`Too large extension object: ${r}`);this.writeU8(201),this.writeU32(r),this.writeI8(e.type),this.writeU8a(t);return}let t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<0x100000000)this.writeU8(201),this.writeU32(t);else throw Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),(0,s.X3)(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),(0,s._j)(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function l(e,t){return new o(t).encodeSharedRef(e)}},22460:(e,t,r)=>{"use strict";r.d(t,{Ao:()=>a,BD:()=>i,D5:()=>n,Ge:()=>s});let n=/^(.*)\[([0-9]*)\]$/,i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,s=/^(u?int)(8|
516|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,a=2n**256n-1n},22744:(e,t,r)=>{"use strict";r.d(t,{A1:()=>c,di:()=>a,iN:()=>u});var n=r(11693),i=r(2939),s=r(21047);function a(e,t,r,{strict:n}={}){return(0,i.q)(e,{strict:!1})?u(e,t,r,{strict:n}):c(e,t,r,{strict:n})}function o(e,t){if("number"==typeof t&&t>0&&t>(0,s.E)(e)-1)throw new n.ii({offset:t,position:"start",size:(0,s.E)(e)})}function l(e,t,r){if("number"==typeof t&&"number"==typeof r&&(0,s.E)(e)!==r-t)throw new n.ii({offset:r,position:"end",size:(0,s.E)(e)})}function c(e,t,r,{strict:n}={}){o(e,t);let i=e.slice(t,r);return n&&l(i,t,r),i}function u(e,t,r,{strict:n}={}){o(e,t);let i=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&l(i,t,r),i}},22760:(e,t,r)=>{"use strict";r.d(t,{A:()=>s,B:()=>i});var n=r(74263);function i(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new n.d_(e.type);return`${e.name}(${s(e.inputs,{includeName:t})})`}function s(e,{includeName:t=!1}={}){return e?e.map(e=>(function(e,{includeName:t}){return e.type.startsWith("tuple")?`(${s(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")})(e,{includeName:t})).join(t?", ":","):""}},23274:(e,t,r)=>{"use strict";r.d(t,{Bv:()=>a,bm:()=>o});var n=r(44037),i=r(65323);let s={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function a(e,t){let r={};return void 0!==e.authorizationList&&(r.authorizationList=e.authorizationList.map(e=>({address:e.address,r:e.r?(0,n.cK)(BigInt(e.r)):e.r,s:e.s?(0,n.cK)(BigInt(e.s)):e.s,chainId:(0,n.cK)(e.chainId),nonce:(0,n.cK)(e.nonce),...void 0!==e.yParity?{yParity:(0,n.cK)(e.yParity)}:{},...void 0!==e.v&&void 0===e.yParity?{v:(0,n.cK)(e.v)}:{}}))),void 0!==e.accessList&&(r.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(r.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?r.blobs=e.blobs.map(e=>(0,n.My)(e)):r.blobs=e.blobs),void 0!==e.data&&(r.data=e.data),e.account&&(r.from=e.account.address),void 0!==e.from&&(r.from=e.from),void 0!==e.gas&&(r.gas=(0,n.cK)(e.gas)),void 0!==e.gasPrice&&(r.gasPrice=(0,n.cK)(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(r.maxFeePerBlobGas=(0,n.cK)(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(r.maxFeePerGas=(0,n.cK)(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=(0,n.cK)(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(r.nonce=(0,n.cK)(e.nonce)),void 0!==e.to&&(r.to=e.to),void 0!==e.type&&(r.type=s[e.type]),void 0!==e.value&&(r.value=(0,n.cK)(e.value)),r}let o=(0,i.q)("transactionRequest",a)},23392:(e,t,r)=>{"use strict";r.d(t,{Bq:()=>u,Sl:()=>i,X:()=>a,eV:()=>c,kK:()=>s,t7:()=>l});var n=r(21332);function i(e,t){if(n.Ej(e)>t)throw new n.u({givenSize:n.Ej(e),maxSize:t})}function s(e,t){if("number"==typeof t&&t>0&&t>n.Ej(e)-1)throw new n.ii({offset:t,position:"start",size:n.Ej(e)})}function a(e,t,r){if("number"==typeof t&&"number"==typeof r&&n.Ej(e)!==r-t)throw new n.ii({offset:r,position:"end",size:n.Ej(e)})}let o={zero:48,nine:57,A:65,F:70,a:97,f:102};function l(e){return e>=o.zero&&e<=o.nine?e-o.zero:e>=o.A&&e<=o.F?e-(o.A-10):e>=o.a&&e<=o.f?e-(o.a-10):void 0}function c(e,t={}){let{dir:r,size:i=32}=t;if(0===i)return e;if(e.length>i)throw new n.Fl({size:e.length,targetSize:i,type:"Bytes"});let s=new Uint8Array(i);for(let t=0;t<i;t++){let n="right"===r;s[n?t:i-t-1]=e[n?t:e.length-t-1]}return s}function u(e,t={}){let{dir:r="left"}=t,n=e,i=0;for(let e=0;e<n.length-1;e++)if("0"===n["left"===r?e:n.length-e-1].toString())i++;else break;return"left"===r?n.slice(i):n.slice(0,n.length-i)}},23458:(e,t,r)=>{"use strict";r.d(t,{G:()=>a});let n=new Map,i=new Map;async function s(e,{cacheKey:t,cacheTime:r=1/0}){let s=function(e){let t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:r=>t.set(e,r)}),r=t(e,n),s=t(e,i);return{clear:()=>{r.clear(),s.clear()},promise:r,response:s}}(t),a=s.response.get();if(a&&r>0&&Date.now()-a.created.getTime()<r)return a.data;let o=s.promise.get();o||(o=e(),s.promise.set(o));try{let e=await o;return s.response.set({created:new Date,data:e}),e}finally{s.promise.clear()}}async function a(e,{cacheTime:t=e.cacheTime}={}){let r;return BigInt(await s(()=>e.request({method:"eth_blockNumber"}),{cacheKey:(r=e.uid,`blockNumber.${r}`),cacheTime:t}))}},23536:(e,t,r)=>{"use strict";r.d(t,{T:()=>i,Z:()=>s});var n=r(15520);class i extends n.C{constructor({docsPath:e}={}){super("Could not find an Account to execute with this Action.\nPlease provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client.",{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class s extends n.C{constructor({docsPath:e,metaMessages:t,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:e,metaMessages:t,name:"AccountTypeNotSupportedError"})}}},23971:(e,t,r)=>{"use strict";r.d(t,{M:()=>i});var n=r(15520);class i extends n.C{constructor({address:e}){super(`Address "${e}
vendor: 6,011 bytes, lines 5-6
5" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}},24009:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(3303),i=r(50016),s=r(44633),a=r(651);function o(e,t){return(0,n.S)(function(e){let t="string"==typeof e?(0,a.i3)(e):"string"==typeof e.raw?e.raw:(0,a.My)(e.raw),r=(0,a.i3)(`\x19Ethereum Signed Message:
6${(0,s.E)(t)}`);return(0,i.xW)([r,t])}(e),t)}},24243:(e,t,r)=>{"use strict";r.d(t,{RR:()=>o,pw:()=>a,sM:()=>s});var n=r(30063),i=r(15520);class s extends i.C{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class a extends i.C{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class o extends i.C{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,n.Q)(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}},24393:(e,t,r)=>{"use strict";r.d(t,{d:()=>a});var n=r(48241),i=r(31445),s=r(37289);function a(e,{docsPath:t,...r}){let a=(()=>{let t=(0,s.l)(e,r);return t instanceof i.RM?e:t})();return new n.zX(a,{docsPath:t,...r})}},24410:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,n,s,a){if("function"!=typeof n)throw TypeError("The listener must be a function");var o=new i(n,s||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),o.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},o.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,a=Array(s);i<s;i++)a[i]=n[i].fn;return a},o.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,i,s,a){var o=r?r+e:e;if(!this._events[o])return!1;var l,c,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,i),!0;case 5:return u.fn.call(u.context,t,n,i,s),!0;case 6:return u.fn.call(u.context,t,n,i,s,a),!0}for(c=1,l=Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var f,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,i);break;default:if(!l)for(f=1,l=Array(d-1);f<d;f++)l[f-1]=arguments[f];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},o.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},o.prototype.removeListener=function(e,t,n,i){var s=r?r+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||i&&!o.once||n&&o.context!==n||a(this,s);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==t||i&&!o[l].once||n&&o[l].context!==n)&&c.push(o[l]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o},24654:(e,t,r)=>{"use strict";r.d(t,{A1:()=>c,di:()=>a,iN:()=>u});var n=r(49731),i=r(92733),s=r(44633);function a(e,t,r,{strict:n}={}){return(0,i.q)(e,{strict:!1})?u(e,t,r,{strict:n}):c(e,t,r,{strict:n})}function o(e,t){if("number"==typeof t&&t>0&&t>(0,s.E)(e)-1)throw new n.ii({offset:t,position:"start",size:(0,s.E)(e)})}function l(e,t,r){if("number"==typeof t&&"number"==typeof r&&(0,s.E)(e)!==r-t)throw new n.ii({offset:r,position:"end",size:(0,s.E)(e)})}function c(e,t,r,{strict:n}={}){o(e,t);let i=e.slice(t,r);return n&&l(i,t,r),i}function u(e,t,r,{strict:n}={}){o(e,t);let i=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&l(i,t,r),i}},24807:(e,t,r)=>{"use strict";function n(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):null===e.blockTimestamp?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}r.d(t,{e:()=>n})},25586:(e,t,r)=>{"use strict";r.d(t,{UG:()=>a,xo:()=>i,zz:()=>s});var n=r(54057);class i extends n.C{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class s extends n.C{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class a extends n.C{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}},25728:(e,t,r)=>{"use strict";r.d(t,{j:()=>u});
6var n=r(74263),i=r(29021),s=r(44633),a=r(73142),o=r(86380),l=r(22760);let c="/docs/contract/decodeEventLog";function u(e){let{abi:t,data:r,strict:u,topics:d}=e,f=u??!0,[h,...p]=d;if(!h)throw new n._z({docsPath:c});let y=t.find(e=>"event"===e.type&&h===(0,a.h)((0,l.B)(e)));if(!(y&&"name"in y)||"event"!==y.type)throw new n.kE(h,{docsPath:c});let{name:m,inputs:g}=y,b=g?.some(e=>!("name"in e&&e.name)),w=b?[]:{},v=g.map((e,t)=>[e,t]).filter(([e])=>"indexed"in e&&e.indexed),x=[];for(let e=0;e<v.length;e++){let[t,r]=v[e],i=p[e];if(!i){if(f)throw new n.l3({abiItem:y,param:t});x.push([t,r]);continue}w[b?r:t.name||r]=function({param:e,value:t}){return"string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/)?t:((0,o.n)([e],t)||[])[0]}({param:t,value:i})}let _=g.filter(e=>!("indexed"in e&&e.indexed)),E=f?_:[...x.map(([e])=>e),..._];if(E.length>0){if(r&&"0x"!==r)try{let e=(0,o.n)(E,r);if(e){let t=0;if(!f)for(let[r,n]of x)w[b?n:r.name||n]=e[t++];if(b)for(let r=0;r<g.length;r++)void 0===w[r]&&t<e.length&&(w[r]=e[t++]);else for(let r=0;r<_.length;r++)w[_[r].name]=e[t++]}}catch(e){if(f){if(e instanceof n.Iy||e instanceof i.SK)throw new n.fo({abiItem:y,data:r,params:E,size:(0,s.E)(r)});throw e}}else if(f)throw new n.fo({abiItem:y,data:"0x",params:E,size:0})}return{eventName:m,args:Object.values(w).length>0?w:void 0}}},25879:(e,t,r)=>{"use strict";r.d(t,{d:()=>a});var n=r(97687),i=r(64507),s=r(76243);function a(e,{docsPath:t,...r}){let a=(()=>{let t=(0,s.l)(e,r);return t instanceof i.RM?e:t})();return new n.zX(a,{docsPath:t,...r})}},26074:(e,t,r)=>{"use strict";r.d(t,{O:()=>o});var n=r(51731);let i=new TextEncoder,s=new TextDecoder,a=new TextDecoder("utf-8",{fatal:!0}),o={utf8:{fromBytes:(e,t)=>(t?.fatal?a:s).decode(e),toBytes:e=>Uint8Array.from(i.encode(e))},base64:{fromBytes:e=>n.K3.encode(e),toBytes:e=>{try{return Uint8Array.from(n.K3.decode(e))}catch(t){if(t instanceof Error&&t.message.includes("string should have whole number of bytes"))return Uint8Array.from(n._H.decode(e));throw t}}},base64url:{fromBytes:e=>n.r0.encode(e),toBytes:e=>Uint8Array.from(n.r0.decode(e))},hex:{fromBytes:e=>n.uh.encode(e),toBytes:e=>Uint8Array.from(n.uh.decode(e.startsWith("0x")?e.slice(2):e))}}},26101:(e,t,r)=>{"use strict";r.d(t,{BX:()=>h,RO:()=>g,i5:()=>y,iW:()=>m,l9:()=>f});var n=r(6274),i=r(5635),s=r(8971),a=r(21008),o=r(31911),l=r(34867),c=r(44116),u=r(97140);function d(e){let t=Object.values(e);if(0===t.length)throw new o.tsw(o.BUQ);return t.map(e=>e||new Uint8Array(64).fill(0))}function f(){return(0,s.a5)([["signatures",(0,i.FU)((0,s.is)((0,i.Ns)((0,s.Im)(),64),{size:(0,a.tD)()}),d)],["messageBytes",(0,s.Im)()]])}function h(){return(0,i.vt)((0,s.ci)([["signatures",(0,s.O_)((0,i.pI)((0,s.EK)(),64),{size:(0,a.vU)()})],["messageBytes",(0,s.EK)()]]),p)}function p(e){let{messageBytes:t,signatures:r}=e,[c,u,d]=(0,s.xQ)([(0,l.N0)(),(0,i.iO)((0,a.eh)(),2),(0,s.O_)((0,n.Xg)(),{size:(0,a.vU)()})]).decode(t),f=d.slice(0,u);if(f.length!==r.length)throw new o.tsw(o.Ipf,{numRequiredSignatures:u,signaturesLength:r.length,signerAddresses:f});let h={};return f.forEach((e,t)=>{let n=r[t];n.every(e=>0===e)?h[e]=null:h[e]=n}),{messageBytes:t,signatures:Object.freeze(h)}}function y(e){let t,r=(0,l.rt)(e),n=(0,l.dU)().encode(r),i=r.staticAccounts.slice(0,r.header.numSignerAccounts),s={};for(let e of i)s[e]=null;return(0,l.q0)(e)?t={blockhash:e.lifetimeConstraint.blockhash,lastValidBlockHeight:e.lifetimeConstraint.lastValidBlockHeight}:(0,l.vm)(e)&&(t={nonce:e.lifetimeConstraint.nonce,nonceAccountAddress:e.instructions[0].accounts[0].address}),Object.freeze({...t?{lifetimeConstraint:t}:void 0,messageBytes:n,signatures:Object.freeze(s)})}async function m(e,t){let r,s;if(await Promise.all(e.map(async e=>{let a=await (0,n.Tq)(e.publicKey),o=t.signatures[a];if(void 0===o)return void(s||=new Set).add(a);if(s)return;let l=await (0,u.b_)(e.privateKey,t.messageBytes);null!==o&&(0,i.O6)(l,o)||((r||={})[a]=l)})),s&&s.size>0){let e=Object.keys(t.signatures);throw new o.tsw(o.Ngb,{expectedAddresses:e,unexpectedAddresses:[...s]})}return r?Object.freeze({...t,signatures:Object.freeze({...t.signatures,...r})}):t}function g(e){let t=f().encode(e);return(0,c.Ul)().decode(t)}},26102:(e,t)=>
6{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},27137:(e,t,r)=>{"use strict";r.d(t,{hZ:()=>n});let n=e=>window.open(e?.location,void 0,(({w:e,h:t})=>{let r=void 0===window.screenLeft?window.screenX:window.screenLeft,n=void 0===window.screenTop?window.screenY:window.screenTop,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,s=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=i/window.screen.availWidth,o=s/window.screen.availHeight;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${(i-e)/2/a+r},top=${(s-t)/2/o+n}`})({w:440,h:680}))},27526:(e,t,r)=>{"use strict";r.d(t,{P:()=>o});var n=r(13108),i=r(48717);let s=/^0x[a-fA-F0-9]{40}$/,a=new n.A(8192);function o(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(a.has(n))return a.get(n);let o=!!s.test(e)&&(e.toLowerCase()===e||!r||(0,i.o)(e)===e);return a.set(n,o),o}},27931:(e,t,r)=>{"use strict";r.d(t,{db:()=>s,eV:()=>i});var n=r(11693);function i(e,{dir:t,size:r=32}={}){return"string"==typeof e?s(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new n.Fl({size:e.length,targetSize:r,type:"bytes"});let i=new Uint8Array(r);for(let n=0;n<r;n++){let s="right"===t;i[s?n:r-n-1]=e[s?n:e.length-n-1]}return i}(e,{dir:t,size:r})}function s(e,{dir:t,size:r=32}={}){if(null===r)return e;let i=e.replace("0x","");if(i.length>2*r)throw new n.Fl({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i["right"===t?"padEnd":"padStart"](2*r,"0")}`}},28266:(e,t,r)=>{"use strict";r.d(t,{Ag:()=>a,E5:()=>d,Rm:()=>c,SJ:()=>l,UW:()=>u,b2:()=>i,oX:()=>o,v2:()=>n,xw:()=>f});let n=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],i=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],s=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],a=[...s,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],o=[...s,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],l=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],c=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],u=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],d=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}
6],f=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}]},28598:(e,t,r)=>{let n=r(2801);function i(e,t,r){let n=e[t]+e[r],i=e[t+1]+e[r+1];n>=0x100000000&&i++,e[t]=n,e[t+1]=i}function s(e,t,r,n){let i=e[t]+r;r<0&&(i+=0x100000000);let s=e[t+1]+n;i>=0x100000000&&s++,e[t]=i,e[t+1]=s}function a(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,r,n,a,o){let l=d[a],c=d[a+1],f=d[o],h=d[o+1];i(u,e,t),s(u,e,l,c);let p=u[n]^u[e],y=u[n+1]^u[e+1];u[n]=y,u[n+1]=p,i(u,r,n),p=u[t]^u[r],y=u[t+1]^u[r+1],u[t]=p>>>24^y<<8,u[t+1]=y>>>24^p<<8,i(u,e,t),s(u,e,f,h),p=u[n]^u[e],y=u[n+1]^u[e+1],u[n]=p>>>16^y<<16,u[n+1]=y>>>16^p<<16,i(u,r,n),p=u[t]^u[r],y=u[t+1]^u[r+1],u[t]=y>>>31^p<<1,u[t+1]=p>>>31^y<<1}let l=new Uint32Array([0xf3bcc908,0x6a09e667,0x84caa73b,0xbb67ae85,0xfe94f82b,0x3c6ef372,0x5f1d36f1,0xa54ff53a,0xade682d1,0x510e527f,0x2b3e6c1f,0x9b05688c,0xfb41bd6b,0x1f83d9ab,0x137e2179,0x5be0cd19]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(function(e){return 2*e})),u=new Uint32Array(32),d=new Uint32Array(32);function f(e,t){let r=0;for(r=0;r<16;r++)u[r]=e.h[r],u[r+16]=l[r];for(u[24]=u[24]^e.t,u[25]=u[25]^e.t/0x100000000,t&&(u[28]=~u[28],u[29]=~u[29]),r=0;r<32;r++)d[r]=a(e.b,4*r);for(r=0;r<12;r++)o(0,8,16,24,c[16*r+0],c[16*r+1]),o(2,10,18,26,c[16*r+2],c[16*r+3]),o(4,12,20,28,c[16*r+4],c[16*r+5]),o(6,14,22,30,c[16*r+6],c[16*r+7]),o(0,10,20,30,c[16*r+8],c[16*r+9]),o(2,12,22,24,c[16*r+10],c[16*r+11]),o(4,14,16,26,c[16*r+12],c[16*r+13]),o(6,8,18,28,c[16*r+14],c[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^u[r]^u[r+16]}let h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,t,r,n){if(0===e||e>64)throw Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw Error("Illegal salt, expected Uint8Array with length is 16");if(n&&16!==n.length)throw Error("Illegal personal, expected Uint8Array with length is 16");let i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};h.fill(0),h[0]=e,t&&(h[1]=t.length),h[2]=1,h[3]=1,r&&h.set(r,32),n&&h.set(n,48);for(let e=0;e<16;e++)i.h[e]=l[e]^a(h,4*e);return t&&(y(i,t),i.c=128),i}function y(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,f(e,!1),e.c=0),e.b[e.c++]=t[r]}function m(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;f(e,!0);let t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function g(e,t,r,i,s){r=r||64,e=n.normalizeInput(e),i&&(i=n.normalizeInput(i)),s&&(s=n.normalizeInput(s));let a=p(r,t,i,s);return y(a,e),m(a)}
6e.exports={blake2b:g,blake2bHex:function(e,t,r,i,s){let a=g(e,t,r,i,s);return n.toHex(a)},blake2bInit:p,blake2bUpdate:y,blake2bFinal:m}},28931:(e,t,r)=>{"use strict";r.d(t,{H4:()=>E,_V:()=>_,bL:()=>x});var n=r(75834),i=r(26514),s=r(25196),a=r(39795),o=r(20888),l=r(58784);function c(){return()=>{}}var u="Avatar",[d,f]=function(e,t=[]){let r=[],s=()=>{let t=r.map(e=>n.createContext(e));return function(r){let i=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:i}}),[r,i])}};return s.scopeName=e,[function(t,s){let a=n.createContext(s);a.displayName=t+"Context";let o=r.length;r=[...r,s];let l=t=>{let{scope:r,children:s,...l}=t,c=r?.[e]?.[o]||a,u=n.useMemo(()=>l,Object.values(l));return(0,i.jsx)(c.Provider,{value:u,children:s})};return l.displayName=t+"Provider",[l,function(r,i){let l=i?.[e]?.[o]||a,c=n.useContext(l);if(c)return c;if(void 0!==s)return s;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let i=r.reduce((t,{useScope:r,scopeName:n})=>{let i=r(e)[`__scope${n}`];return{...t,...i}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}(s,...t)]}(u),[h,p]=d(u),y=n.forwardRef((e,t)=>{let{__scopeAvatar:r,...s}=e,[a,l]=n.useState("idle");return(0,i.jsx)(h,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:l,children:(0,i.jsx)(o.sG.span,{...s,ref:t})})});y.displayName=u;var m="AvatarImage",g=n.forwardRef((e,t)=>{let{__scopeAvatar:r,src:u,onLoadingStatusChange:d=()=>{},...f}=e,h=p(m,r),y=function(e,{referrerPolicy:t,crossOrigin:r}){let i=(0,l.useSyncExternalStore)(c,()=>!0,()=>!1),s=n.useRef(null),o=i?(s.current||(s.current=new window.Image),s.current):null,[u,d]=n.useState(()=>v(o,e));return(0,a.N)(()=>{d(v(o,e))},[o,e]),(0,a.N)(()=>{let e=e=>()=>{d(e)};if(!o)return;let n=e("loaded"),i=e("error");return o.addEventListener("load",n),o.addEventListener("error",i),t&&(o.referrerPolicy=t),"string"==typeof r&&(o.crossOrigin=r),()=>{o.removeEventListener("load",n),o.removeEventListener("error",i)}},[o,r,t]),u}(u,f),g=(0,s.c)(e=>{d(e),h.onImageLoadingStatusChange(e)});return(0,a.N)(()=>{"idle"!==y&&g(y)},[y,g]),"loaded"===y?(0,i.jsx)(o.sG.img,{...f,ref:t,src:u}):null});g.displayName=m;var b="AvatarFallback",w=n.forwardRef((e,t)=>{let{__scopeAvatar:r,delayMs:s,...a}=e,l=p(b,r),[c,u]=n.useState(void 0===s);return n.useEffect(()=>{if(void 0!==s){let e=window.setTimeout(()=>u(!0),s);return()=>window.clearTimeout(e)}},[s]),c&&"loaded"!==l.imageLoadingStatus?(0,i.jsx)(o.sG.span,{...a,ref:t}):null});function v(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}w.displayName=b;var x=y,_=g,E=w},29021:(e,t,r)=>{"use strict";r.d(t,{B4:()=>i,SK:()=>s,hX:()=>a});var n=r(99838);class i extends n.C{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class s extends n.C{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class a extends n.C{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}},29063:(e,t,r)=>{"use strict";r.d(t,{A9:()=>i,NO:()=>o,Pj:()=>l,dV:()=>s,nx:()=>c,zd:()=>a});var n=r(3832);n.C;class i extends n.C{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class s extends n.C{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class a extends n.C{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class o extends n.C{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class l extends n.C{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class c extends n.C{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invali
6d."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}},29134:(e,t,r)=>{"use strict";r.d(t,{C:()=>l});var n=r(50016),i=r(36665),s=r(651),a=r(64072),o=r(3303);function l(e){let{chainId:t,nonce:r,to:l}=e,c=e.contractAddress??e.address,u=(0,o.S)((0,n.aP)(["0x05",(0,a.EQ)([t?(0,s.cK)(t):"0x",c,r?(0,s.cK)(r):"0x"])]));return"bytes"===l?(0,i.aT)(u):u}},29158:(e,t,r)=>{"use strict";r.d(t,{d:()=>s});var n=r(651),i=r(90391);function s(e){let{commitments:t,version:r}=e,s=e.to??("string"==typeof t[0]?"hex":"bytes"),a=[];for(let e of t)a.push(function(e){let{commitment:t,version:r=1}=e,s=e.to??("string"==typeof t?"hex":"bytes"),a=(0,i.s)(t,"bytes");return a.set([r],0),"bytes"===s?a:(0,n.My)(a)}({commitment:e,to:s,version:r}));return a}},29171:(e,t,r)=>{"use strict";r.d(t,{m:()=>o});var n=r(45897),i=r(30406),s=r(15678);let a="/docs/contract/encodeDeployData";function o(e){let{abi:t,args:r,bytecode:o}=e;if(!r||0===r.length)return o;let l=t.find(e=>"type"in e&&"constructor"===e.type);if(!l)throw new n.YW({docsPath:a});if(!("inputs"in l)||!l.inputs||0===l.inputs.length)throw new n.YF({docsPath:a});let c=(0,s.h)(l.inputs,r);return(0,i.aP)([o,c])}},29421:(e,t,r)=>{"use strict";r.d(t,{MM:()=>w,ft:()=>_});var n=r(63710),i=r(18034),s=r(91855),a=r(32560),o=r(1232),l=r(68305),c=r(87284),u=r(18841),d=r(29158),f=r(15979),h=r(29447),p=r(13108),y=r(74869),m=r(61354),g=r(324),b=r(40857);let w=["blobVersionedHashes","chainId","fees","gas","nonce","type"],v=new Map,x=new p.A(128);async function _(e,t){let r,p,_=t;_.account??=e.account,_.parameters??=w;let{account:E,chain:A=e.chain,nonceManager:I,parameters:C}=_,S="function"==typeof A?.prepareTransactionRequest?{fn:A.prepareTransactionRequest,runAt:["beforeFillTransaction"]}:Array.isArray(A?.prepareTransactionRequest)?{fn:A.prepareTransactionRequest[0],runAt:A.prepareTransactionRequest[1].runAt}:void 0;async function P(){return r?r:void 0!==_.chainId?_.chainId:A?A.id:r=await (0,h.T)(e,b.T,"getChainId")({})}let $=E?(0,n.J)(E):E,k=_.nonce;if(C.includes("nonce")&&void 0===k&&$&&I){let t=await P();k=await I.consume({address:$.address,chainId:t,client:e})}S?.fn&&S.runAt?.includes("beforeFillTransaction")&&(_=await S.fn({..._,chain:A},{client:e,phase:"beforeFillTransaction"}),k??=_.nonce);let T=(!(C.includes("blobVersionedHashes")||C.includes("sidecars"))||!_.kzg||!_.blobs)&&!1!==x.get(e.uid)&&["fees","gas"].some(e=>C.includes(e))&&(C.includes("chainId")&&"number"!=typeof _.chainId||C.includes("nonce")&&"number"!=typeof k||C.includes("fees")&&"bigint"!=typeof _.gasPrice&&("bigint"!=typeof _.maxFeePerGas||"bigint"!=typeof _.maxPriorityFeePerGas)||C.includes("gas")&&"bigint"!=typeof _.gas)?await (0,h.T)(e,g.a,"fillTransaction")({..._,nonce:k}).then(t=>{let{chainId:r,from:n,gas:i,gasPrice:s,nonce:a,maxFeePerBlobGas:o,maxFeePerGas:l,maxPriorityFeePerGas:c,type:u,...d}=t.transaction,f="feeToken"in d?d.feeToken:void 0,h="feePayerSignature"in d&&null!==d.feePayerSignature&&void 0!==d.feePayerSignature,p=null!=f&&(!("feeToken"in _)||h);return x.set(e.uid,!0),{..._,...n?{from:n}:{},...u&&!_.type?{type:u}:{},...void 0!==r?{chainId:r}:{},...void 0!==i?{gas:i}:{},...void 0!==s?{gasPrice:s}:{},...void 0!==a?{nonce:a}:{},...void 0!==o&&"legacy"!==_.type&&"eip2930"!==_.type?{maxFeePerBlobGas:o}:{},...void 0!==l&&"legacy"!==_.type&&"eip2930"!==_.type?{maxFeePerGas:l}:{},...void 0!==c&&"legacy"!==_.type&&"eip2930"!==_.type?{maxPriorityFeePerGas:c}:{},..."nonceKey"in d&&void 0!==d.nonceKey?{nonceKey:d.nonceKey}:{},..."keyAuthorization"in d&&void 0!==d.keyAuthorization&&null!==d.keyAuthorization&&!("keyAuthorization"in _)?{keyAuthorization:d.keyAuthorization}:{},..."feePayerSignature"in d&&void 0!==d.feePayerSignature&&null!==d.feePayerSignature?{feePayerSignature:d.feePayerSignature}:{},...p?{feeToken:f}:{},...t.capabilities?{_capabilities:t.capabilities}:{}}}).catch(t=>{if("TransactionExecutionError"!==t.name)return _;if(t.walk?.(e=>"ExecutionRevertedError"===e.name))throw t;return t.walk?.(e=>"MethodNotFoundRpcError"===e.name||"MethodNotSupportedRpcError"===e.name||e.message?.includes("eth_fillTransaction is not available"))&&x.set(e.uid,!1),_}):_;k??=T.nonce;let{blobs:O,gas:N,kzg:R,type:B}=_={...T,...$?{from:$?.address}:{},...void 0!==k?{nonce:k}:{}};async function D(){return p||(p=await (0,h.T)(e,a.g,"getBlock")({blockTag:"latest"}))}if(S?.fn&&S.runAt?.includes("beforeFillParameters")&&(_=await S.fn({..._,chain:A},{client:e,phase:"beforeFillParameters"})),C.includes("nonce")&&void 0===k&&$&&!I&&(_.nonce=await (0,h.T)(e,o.y,"getTransactionCount")({address:$.address,blockTag:"pending"})),(C.includes("blobVersionedHashes")||C.includes("sidecars"))&&O&&R){let e=(0,c.S)({blobs:O,kzg:R});if(C.includes("blobVersionedHashes")){let t=(0,d.d)({commitments:e,to:"hex"});_.blobVersionedHashes=t}if(C.includes("sidecars")){let t=(0,u.t)({blobs:O,commitments:e,kzg:R}),r=(0,f.T)({blobs:O,commitments:e,proofs:t,to:"hex"});_.sidecars=r}}if(C.includes("chainId")&&(_.chainId=await P()),(C.includes("fees")||C.includes("type"))&&void 0===B)try{_.type=(0,m.L)(_)}catch{let t=v.get(e.uid);if(void 0===t){let r=await D();t="bigint"==typeof r?.baseFeePerGas,v.set(e.uid,t)}_.type=t?"eip1559":"legacy"}if(C.includes("fees"))if("legacy"!==_.type&&"eip2930"!==_.type){if(void 0===_.maxFeePerGas||void 0===_.maxPriorityFeePerGas){let t=await D(),{maxFeePerGas:r,maxPriorityFeePerGas:n}=await (0,i.O)(e,{block:t,chain:A,request:_});if(void 0===_.maxPriorityFeePerGas&&_.maxFeePerGas&&_.maxFeePerGas<n)throw new l.RR({maxPriorityFeePerGas:n});_.maxPriorityFeePerGas=n,_.maxFeePerGas=r}}else{if(void 0!==_.maxFeePerGas||void 0!==_.maxPriorityFeePerGas)throw new l.pw;if(void 0===_.gasPrice){let t=await D(),{gasPrice:r}=await (0,i.O)(e,{block:t,chain:A,request:_,type:"legacy"});_.gasPrice=r}}return C.includes("gas")&&void 0===N&&(_.gas=await (0,h.T)(e,s.Q,"estimateGas")({..._,account:$,prepare:$?.type==="local"?[]:["blobVersionedHashes"]})),S?.fn&&S.runAt?.includes("afterFillParameters")&&(_=await S.fn({..._,chain:A},{client:e,phase:"afterFillParameters"})),(0,y.c)(_),delete _.parameters,_}},29447:(e,t,r)=>{"use strict";function n(e,t,r){let n=e[t.name];if("function"==typeof n)return n;let i=e[r];return"function"==typeof i?i:r=>t(e,r)}r.d(t,{T:()=>n})},29908:(e,t,r)=>{"use strict";r.d(t,{y:()=>a});var n=r(33984),i=r(35424),s=r(72004);
6function a(e,t,r=s.bN){return(0,n.useSyncExternalStoreWithSelector)((0,i._)(t=>e.subscribe(o,t)),(0,i._)(()=>e.state),(0,i._)(()=>e.state),(0,i._)(t),r)}function o(e){return e}},30063:(e,t,r)=>{"use strict";r.d(t,{Q:()=>i});var n=r(40917);function i(e,t="wei"){return n.Q_(e,t)}},30293:(e,t,r)=>{"use strict";function n(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function i(){let e=n();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=n,t.getSubtleCrypto=i,t.isBrowserCryptoAvailable=function(){return!!n()&&!!i()}},30406:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e[0]?i(e):function(e){let t=0;for(let r of e)t+=r.length;let r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return r}(e)}function i(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}r.d(t,{aP:()=>i,xW:()=>n})},30749:(e,t,r)=>{"use strict";r.d(t,{Ac:()=>a,Ci:()=>l,FX:()=>h,mK:()=>o,oE:()=>p,v6:()=>f,zv:()=>m});var n=r(75834),i=r(98966),s=r(6194),a=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(a||{}),o=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(o||{});function l(){let e,t,r=(e=(0,n.useRef)([]),t=(0,n.useCallback)(t=>{for(let r of e.current)null!=r&&("function"==typeof r?r(t):r.current=t)},[]),(...r)=>{if(!r.every(e=>null==e))return e.current=r,t});return(0,n.useCallback)(e=>(function({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:o,mergeRefs:l}){l=null!=l?l:u;let f=d(t,e);if(a)return c(f,r,n,o,l);let h=null!=i?i:0;if(2&h){let{static:e=!1,...t}=f;if(e)return c(t,r,n,o,l)}if(1&h){let{unmount:e=!0,...t}=f;return(0,s.Y)(+!e,{0:()=>null,1:()=>c({...t,hidden:!0,style:{display:"none"}},r,n,o,l)})}return c(f,r,n,o,l)})({mergeRefs:r,...e}),[r])}function c(e,t={},r,s,a){let{as:o=r,children:l,refName:u="ref",...f}=y(e,["unmount","static"]),h=void 0!==e.ref?{[u]:e.ref}:{},g="function"==typeof l?l(t):l;g=function e(t){if(null!=t&&t.$$typeof===Symbol.for("react.lazy")){let r=t._payload;if(null!=r&&"fulfilled"===r.status)return e(r.value)}return t}(g),"className"in f&&f.className&&"function"==typeof f.className&&(f.className=f.className(t)),f["aria-labelledby"]&&f["aria-labelledby"]===f.id&&(f["aria-labelledby"]=void 0);let b={};if(t){let e=!1,r=[];for(let[n,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&r.push(n.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e)for(let e of(b["data-headlessui-state"]=r.join(" "),r))b[`data-${e}`]=""}if(m(o)&&(Object.keys(p(f)).length>0||Object.keys(p(b)).length>0))if(!(0,n.isValidElement)(g)||Array.isArray(g)&&g.length>1||m(g.type)){if(Object.keys(p(f)).length>0)throw Error(['Passing props on "Fragment"!',"",`The current component <${s} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(p(f)).concat(Object.keys(p(b))).map(e=>`  - ${e}`).join(`
7`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>`  - ${e}`).join(`
8`)].join(`
9`))}else{var w;let e=g.props,t=null==e?void 0:e.className,r="function"==typeof t?(...e)=>(0,i.x)(t(...e),f.className):(0,i.x)(t,f.className),s=d(g.props,p(y(f,["ref"])));for(let e in b)e in s&&delete b[e];return(0,n.cloneElement)(g,Object.assign({},s,b,h,{ref:a((w=g,n.version.split(".")[0]>="19"?w.props.ref:w.ref),h.ref)},r?{className:r}:{}))}return(0,n.createElement)(o,Object.assign({},y(f,["ref"]),!m(o)&&h,!m(o)&&b),g)}function u(...e){return e.every(e=>null==e)?void 0:t=>{for(let r of e)null!=r&&("function"==typeof r?r(t):r.current=t)}}function d(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},r={};for(let n of e)for(let e in n)e.startsWith("on")&&"function"==typeof n[e]?(null!=r[e]||(r[e]=[]),r[e].push(n[e])):t[e]=n[e];if(t.disabled||t["aria-disabled"])for(let e in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(r[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in r)Object.assign(t,{[e](t,...n){for(let i of r[e]){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;i(t,...n)}}});return t}function f(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},r={};for(let n of e)for(let e in n)e.startsWith("on")&&"function"==typeof n[e]?(null!=r[e]||(r[e]=[]),r[e].push(n[e])):t[e]=n[e];for(let e in r)Object.assign(t,{[e](...t){for(let n of r[e])null==n||n(...t)}});return t}function h(e){var t;return Object.assign((0,n.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function p(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function y(e,t=[]){let r=Object.assign({},e);for(let e of t)e in r&&delete r[e];return r}function m(e){return e===n.Fragment||e===Symbol.for("react.fragment")}},31155:(e,t,r)=>{"use strict";r.d(t,{HT:()=>l,ZJ:()=>u,aD:()=>c,nj:()=>d});var n=r(21332),i=r(64959),s=r(62610),a=r(52511);function o(e,t={}){let{compressed:r}=t,{prefix:n,x:i,y:s}=e;if(!1===r||"bigint"==typeof i&&"bigint"==typeof s){if(4!==n)throw new h({prefix:n,cause:new y});return}if(!0===r||"bigint"==typeof i&&void 0===s){if(3!==n&&2!==n)throw new h({prefix:n,cause:new p});return}throw new f({publicKey:e})}function l(e){let t=(()=>
9{if(s.tf(e))return c(e);if(n.tf(e)){var t;return t=e,c(s.uK(t))}let{prefix:r,x:i,y:a}=e;return"bigint"==typeof i&&"bigint"==typeof a?{prefix:r??4,x:i,y:a}:{prefix:r,x:i}})();return o(t),t}function c(e){if(132!==e.length&&130!==e.length&&68!==e.length)throw new m({publicKey:e});if(130===e.length)return{prefix:4,x:BigInt(s.di(e,0,32)),y:BigInt(s.di(e,32,64))};if(132===e.length){let t=Number(s.di(e,0,1));return{prefix:t,x:BigInt(s.di(e,1,33)),y:BigInt(s.di(e,33,65))}}return{prefix:Number(s.di(e,0,1)),x:BigInt(s.di(e,1,33))}}function u(e,t={}){return n.aD(d(e,t))}function d(e,t={}){o(e);let{prefix:r,x:n,y:i}=e,{includePrefix:a=!0}=t;return s.xW(a?s.oB(r,{size:1}):"0x",s.oB(n,{size:32}),"bigint"==typeof i?s.oB(i,{size:32}):"0x")}class f extends i.C{constructor({publicKey:e}){super(`Value \`${a.As(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class h extends i.C{constructor({prefix:e,cause:t}){super(`Prefix "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class p extends i.C{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class y extends i.C{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}class m extends i.C{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${s.Ej(s.HT(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}},31168:(e,t,r)=>{"use strict";r.d(t,{secp256k1:()=>h});var n=r(18775),i=r(66049),s=r(57551);let a=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),o=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(0),c=BigInt(1),u=BigInt(2),d=(e,t)=>(e+t/u)/t,f=(0,s.D0)(a,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),l=BigInt(44),c=BigInt(88),d=e*e*e%a,h=d*d*e%a,p=(0,s.zH)(h,t,a)*h%a,y=(0,s.zH)(p,t,a)*h%a,m=(0,s.zH)(y,u,a)*d%a,g=(0,s.zH)(m,n,a)*m%a,b=(0,s.zH)(g,i,a)*g%a,w=(0,s.zH)(b,l,a)*b%a,v=(0,s.zH)(w,c,a)*w%a,x=(0,s.zH)(v,l,a)*b%a,_=(0,s.zH)(x,t,a)*h%a,E=(0,s.zH)(_,o,a)*g%a,A=(0,s.zH)(E,r,a)*d%a,I=(0,s.zH)(A,u,a);if(!f.eql(f.sqr(I),e))throw Error("Cannot find square root");return I}}),h=(0,i.s)({a:l,b:BigInt(7),Fp:f,n:o,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-c*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),a=d(t*e,o),l=d(-r*e,o),u=(0,s.zi)(e-a*t-l*n,o),f=(0,s.zi)(-a*r-l*t,o),h=u>i,p=f>i;if(h&&(u=o-u),p&&(f=o-f),u>i||f>i)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:h,k1:u,k2neg:p,k2:f}}}},n.sc)},31445:(e,t,r)=>{"use strict";r.d(t,{A7:()=>s,BG:()=>a,Fo:()=>h,K0:()=>l,Oh:()=>c,RM:()=>m,jj:()=>o,k5:()=>d,lN:()=>y,lY:()=>f,uC:()=>p,vW:()=>u});var n=r(30063),i=r(15520);class s extends i.C{constructor({cause:e,message:t}={}){let r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(s,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class a extends i.C{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.Q)(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class o extends i.C{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.Q)(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class l extends i.C{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class c extends i.C{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.
10Try increasing the nonce or find the latest nonce with \`getTransactionCount\`.`,{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class u extends i.C{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class d extends i.C{constructor({cause:e}={}){super("The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.",{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class f extends i.C{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class h extends i.C{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class p extends i.C{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class y extends i.C{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${(0,n.Q)(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${(0,n.Q)(r)} gwei`:""}).`,{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(y,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class m extends i.C{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}},31911:(e,t,r)=>{"use strict";r.d(t,{BUQ:()=>k,CvZ:()=>B,DAJ:()=>O,Da$:()=>A,Dgp:()=>v,Ipf:()=>T,JOu:()=>ee,Ji6:()=>l,JsK:()=>h,LzQ:()=>Q,MQP:()=>S,Ngb:()=>$,O7$:()=>W,Ot7:()=>N,R_T:()=>a,SHY:()=>M,Tsv:()=>E,Uq4:()=>D,UwC:()=>J,Uyo:()=>R,VCG:()=>i,VO0:()=>x,Vjw:()=>I,XNQ:()=>_,XzN:()=>m,Y0g:()=>c,Y5q:()=>w,_jo:()=>K,_yh:()=>H,aYZ:()=>G,bg4:()=>q,eZ6:()=>P,evr:()=>el,f$j:()=>y,gF:()=>Z,hMG:()=>j,iOv:()=>b,ibr:()=>X,kz9:()=>p,lUj:()=>U,mMN:()=>u,mZ_:()=>L,nNU:()=>o,ncp:()=>n,pFb:()=>Y,qTc:()=>f,rIW:()=>F,rMr:()=>ei,rXw:()=>g,sf7:()=>d,t_l:()=>C,tsw:()=>en,uWs:()=>V,v8P:()=>z,xZX:()=>s,zbS:()=>er});var n=28e5,i=2800001,s=2800003,a=2800006,o=2800007,l=2800008,c=2800009,u=0x1ecdbe1,d=3230004,f=361e4,h=3610001,p=3610003,y=3610005,m=3610006,g=3610007,b=3611e3,w=3704e3,v=3704001,x=3704004,_=5663e3,E=5663001,A=5663004,I=5663005,C=5663006,S=5663007,P=5663008,$=5663015,k=5663016,T=5663017,O=5663021,N=8078e3,R=8078001,B=8078004,D=8078005,M=8078006,U=8078007,j=8078011,L=8078012,F=8078013,z=8078014,q=8078017,W=81e5,H=8100002,K=8100003,V=819e4,G=8190001,J=8190002,Y=8190003,Z=8190004,Q=99e5,X=9900001,ee=9900004;function et([e,t]){return`${e}=${function e(t){return Array.isArray(t)?"%5B"+t.map(e).join("%2C%20")+"%5D":"bigint"==typeof t?`${t}n`:encodeURIComponent(String(null!=t&&null===Object.getPrototypeOf(t)?{...t}:t))}(t)}`}function er(e,t){return e instanceof Error&&"SolanaError"===e.name&&(void 0===t||e.context.__code===t)}
10var en=class extends Error{cause=this.cause;context;constructor(...[e,t]){let r,n;t&&Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([t,i])=>{"cause"===t?n={cause:i.value}:(void 0===r&&(r={__code:e}),Object.defineProperty(r,t,i))}),super(function(e,t={}){{let r=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(r+=` '${btoa(Object.entries(t).map(et).join("&"))}'`),`${r}\``}}(e,r),n),this.context=Object.freeze(void 0===r?{__code:e}:r),this.name="SolanaError"}};function ei(...e){"captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(...e)}function es({errorCodeBaseOffset:e,getErrorContext:t,orderedErrorNames:r,rpcEnumError:n},i){let s,a;"string"==typeof n?s=n:(s=Object.keys(n)[0],a=n[s]);let o=e+r.indexOf(s),l=t(o,s,a),c=new en(o,l);return ei(c,i),c}var ea=["GenericError","InvalidArgument","InvalidInstructionData","InvalidAccountData","AccountDataTooSmall","InsufficientFunds","IncorrectProgramId","MissingRequiredSignature","AccountAlreadyInitialized","UninitializedAccount","UnbalancedInstruction","ModifiedProgramId","ExternalAccountLamportSpend","ExternalAccountDataModified","ReadonlyLamportChange","ReadonlyDataModified","DuplicateAccountIndex","ExecutableModified","RentEpochModified","NotEnoughAccountKeys","AccountDataSizeChanged","AccountNotExecutable","AccountBorrowFailed","AccountBorrowOutstanding","DuplicateAccountOutOfSync","Custom","InvalidError","ExecutableDataModified","ExecutableLamportChange","ExecutableAccountNotRentExempt","UnsupportedProgramId","CallDepth","MissingAccount","ReentrancyNotAllowed","MaxSeedLengthExceeded","InvalidSeeds","InvalidRealloc","ComputationalBudgetExceeded","PrivilegeEscalation","ProgramEnvironmentSetupFailure","ProgramFailedToComplete","ProgramFailedToCompile","Immutable","IncorrectAuthority","BorshIoError","AccountNotRentExempt","InvalidAccountOwner","ArithmeticOverflow","UnsupportedSysvar","IllegalOwner","MaxAccountsDataAllocationsExceeded","MaxAccountsExceeded","MaxInstructionTraceLengthExceeded","BuiltinProgramsMustConsumeComputeUnits"],eo=["AccountInUse","AccountLoadedTwice","AccountNotFound","ProgramAccountNotFound","InsufficientFundsForFee","InvalidAccountForFee","AlreadyProcessed","BlockhashNotFound","CallChainTooDeep","MissingSignatureForFee","InvalidAccountIndex","SignatureFailure","InvalidProgramForExecution","SanitizeFailure","ClusterMaintenance","AccountBorrowOutstanding","WouldExceedMaxBlockCostLimit","UnsupportedVersion","InvalidWritableAccount","WouldExceedMaxAccountCostLimit","WouldExceedAccountDataBlockLimit","TooManyAccountLocks","AddressLookupTableNotFound","InvalidAddressLookupTableOwner","InvalidAddressLookupTableData","InvalidAddressLookupTableIndex","InvalidRentPayingAccount","WouldExceedMaxVoteCostLimit","WouldExceedAccountDataTotalLimit","DuplicateInstruction","InsufficientFundsForRent","MaxLoadedAccountsDataSizeExceeded","InvalidLoadedAccountsDataSizeLimit","ResanitizationNeeded","ProgramExecutionTemporarilyRestricted","UnbalancedTransaction"];function el(e){var t;let r;if("object"==typeof(t=e)&&null!==t&&"code"in t&&"message"in t&&("number"==typeof t.code||"bigint"==typeof t.code)&&"string"==typeof t.message){let{code:t,data:n,message:i}=e,s=Number(t);if(-32002===s){let{err:e,...t}=n,i=e?{cause:function e(t){return"object"==typeof t&&"InstructionError"in t?function e(t,r){let n=Number(t);return es({errorCodeBaseOffset:4615001,getErrorContext:(e,t,r)=>4615e3===e?{errorName:t,index:n,...void 0!==r?{instructionErrorContext:r}:null}:4615026===e?{code:Number(r),index:n}:{index:n},orderedErrorNames:ea,rpcEnumError:r},e)}(...t.InstructionError):es({errorCodeBaseOffset:7050001,getErrorContext:(e,t,r)=>705e4===e?{errorName:t,...void 0!==r?{transactionErrorContext:r}:null}:7050030===e?{index:Number(r)}:7050031===e||7050035===e?{accountIndex:Number(r.account_index)}:void 0,orderedErrorNames:eo,rpcEnumError:t},e)}(e)}:null;r=new en(-32002,{...t,...i})}else{let e;switch(s){case -32603:case -32602:case -32600:case -32601:case -32700:case -32012:case -32001:case -32004:case -32014:case -32010:case -32009:case -32007:case -32006:case -32015:e={__serverMessage:i};break;default:"object"!=typeof n||Array.isArray(n)||(e=n)}r=new en(s,e)}}else{let t="object"==typeof e&&null!==e&&"message"in e&&"string"==typeof e.message?e.message:"Malformed JSON-RPC error with no message attribute";r=new en(10,{error:e,message:t})}return ei(r,el),r}},32279:(e,t,r)=>{"use strict";r.d(t,{A:()=>y,B:()=>k,C:()=>I,E:()=>E,G:()=>p,H:()=>_,L:()=>P,R:()=>R,S:()=>w,a:()=>j,e:()=>O,f:()=>L,h:()=>U,m:()=>v,n:()=>x,o:()=>A,p:()=>g,q:()=>$,r:()=>m,s:()=>z,u:()=>h});
10var n=r(75834),i=r(51807),s=r(26514),a=r(44037),o=r(77603),l=r(40175),c=r(15171),u=r(86253),d=r(87280),f=r(92204);let h=e=>{let[t,r]=(0,n.useState)("auto");return(0,n.useEffect)(()=>{let t=new ResizeObserver(e=>{r(e[0]?.contentRect.height??"auto")});return e.current&&t.observe(e.current),()=>{e.current&&t.unobserve(e.current)}},[e.current]),t},p=i.I4.div`
11  text-align: left;
12  flex-grow: 1;
13`,y=i.I4.div`
14  display: flex;
15  flex-direction: column;
16  justify-content: flex-end;
17  flex-grow: 1;
18`,m=i.I4.div`
19  display: flex;
20  flex-direction: column;
21  gap: 8px;
22
23  /* for Internet Explorer, Edge */
24  -ms-overflow-style: none;
25
26  /* for Firefox */
27  scrollbar-width: none;
28
29  /* for Chrome, Safari, and Opera */
30  &::-webkit-scrollbar {
31    display: none;
32  }
33`,g=(0,i.I4)(m)`
34  ${e=>"light"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0}
35
36  background-repeat: no-repeat;
37  background-size:
38    100% 32px,
39    100% 16px;
40  background-attachment: local, scroll;
41  max-height: 400px;
42  overflow-y: auto;
43  scrollbar-width: none;
44  padding: 3px;
45`,b=(0,i.AH)`
46  && {
47    width: 100%;
48    font-size: 16px;
49    line-height: 24px;
50    min-height: 56px;
51
52    /* Tablet and Up */
53    @media (min-width: 440px) {
54      font-size: 14px;
55    }
56
57    display: flex;
58    gap: 12px;
59    align-items: center;
60    color: var(--privy-color-foreground);
61
62    padding: 10px 12px;
63    border: 1px solid var(--privy-color-foreground-4) !important;
64    border-radius: var(--privy-border-radius-md);
65    transition: background-color 200ms ease;
66
67    cursor: pointer;
68
69    &:hover {
70      background-color: var(--privy-color-background-2);
71    }
72
73    &:disabled {
74      cursor: pointer;
75      background-color: var(--privy-color-background-2);
76    }
77  }
78`,w=i.I4.div`
79  text-align: center;
80  font-size: 14px;
81  margin-bottom: 24px;
82`,v=i.I4.button.attrs({className:"login-method-button"})`
83  ${b}
84`;i.I4.a`
85  ${b}
86`;let x=i.I4.div`
87  width: 32px;
88  height: 32px;
89  border-radius: ${e=>e.$fullSize?"0":"4px"};
90  background: ${e=>e.$fullSize?"transparent":"var(--privy-color-background-2)"};
91  display: flex;
92  align-items: center;
93  justify-content: center;
94  flex-shrink: 0;
95
96  svg {
97    width: ${e=>e.$fullSize?"32px":"18px"};
98    height: ${e=>e.$fullSize?"32px":"18px"};
99    color: ${e=>e.$fullSize?"inherit":"var(--privy-color-icon-muted)"};
100  }
101`,_=i.I4.div`
102  width: 100%;
103  height: 100%;
104  min-height: inherit;
105  display: flex;
106  flex-direction: column;
107  ${e=>e.$if?"display: none;":""}
108`,E=i.I4.div`
109  width: 100%;
110  height: 100%;
111  padding: ${e=>e.$withPadding?"64px 0px":"0px"};
112`,A=i.I4.div`
113  display: flex;
114  flex-direction: column;
115  align-items: center;
116  justify-content: center;
117  margin-bottom: 32px;
118  gap: 12px;
119  & h3 {
120    font-size: 18px;
121    font-style: normal;
122    font-weight: 600;
123    line-height: 24px;
124  }
125  & p {
126    max-width: 300px;
127    font-size: 14px;
128    font-style: normal;
129    font-weight: 400;
130    line-height: 20px;
131  }
132`,I=({success:e,fail:t})=>(0,s.jsxs)(S,{children:[(0,s.jsx)(C,{children:(0,s.jsx)($,{className:e?"success":t?"fail":""})}),(0,s.jsx)(C,{children:(0,s.jsx)(P,{className:e?"success":t?"fail":""})})]}),C=i.I4.span`
133  && {
134    position: absolute;
135    top: 0;
136    left: 0;
137    z-index: 2;
138  }
139`,S=i.I4.span`
140  position: relative;
141  width: 82px;
142  height: 82px;
143  display: inline-block;
144`,P=i.I4.span`
145  && {
146    width: 82px;
147    height: 82px;
148    border-width: 4px;
149    border-style: solid;
150    border-color: ${e=>e.color??"var(--privy-color-icon-subtle)"};
151    border-bottom-color: transparent;
152    border-radius: 50%;
153    display: inline-block;
154    box-sizing: border-box;
155    animation: rotation 1.2s linear infinite;
156    transition: border-color 800ms;
157  }
158
159  @keyframes rotation {
160    0% {
161      transform: rotate(0deg);
162    }
163    100% {
164      transform: rotate(360deg);
165    }
166  }
167
168  &&&.success {
169    border-color: var(--privy-color-icon-success);
170    border-bottom-color: var(--privy-color-icon-success);
171  }
172
173  &&&.fail {
174    border-color: var(--privy-color-icon-error);
175    border-bottom-color: var(--privy-color-icon-error);
176  }
177`,$=(0,i.I4)(P)`
178  && {
179    border-bottom-color: ${e=>e.color??"var(--privy-color-border-default)"};
180    border-color: ${e=>e.color??"var(--privy-color-border-default)"};
181    animation: none;
182    opacity: 0.5;
183  }
184`,k=e=>(0,s.jsx)(T,{color:e.color||"var(--privy-color-foreground-3)"}),T=(0,i.I4)(P)`
185  && {
186    height: 1rem;
187    width: 1rem;
188    margin: 2px 0;
189    border-width: 1.5px;
190
191    /* Override default Loader to match button transitions */
192    transition: border-color 200ms ease;
193  }
194`;async function O(e,t,r){if(!t.shouldEnforceDefaultChainOnConnect)return;let n=Number(e.chainId.replace("eip155:",""));if(!t.chains.find(e=>e.id===n)&&("wallet_connect_v2"!==e.connectorType||"metamask"!==e.walletClientType)){r?.();try{await e.switchChain(t.defaultChain.id),e.chainId=(0,o.f)((0,a.nj)(t.defaultChain.id))}catch{o.c.warn("Unable to switch to default chain after connect",{chainId:t.defaultChain.id})}}}let N=(0,n.createContext)({}),R=({children:e})=>
194{let t=(0,l.u)(),[r,i]=(0,n.useState)({});return(0,c.u)("login",{onComplete:({loginAccount:e})=>{e&&"passkey"!==e.type&&"cross_app"!==e.type&&("wallet"!==e.type||"privy"!==e.walletClientType)&&(o.s.put(B(t.id),e.type),"wallet"===e.type?(o.s.put(D(t.id),e.walletClientType),o.s.put(M(t.id),e.chainType),i({accountType:e.type,walletClientType:e.walletClientType,chainType:e.chainType})):(o.s.del(D(t.id)),o.s.del(M(t.id)),i({accountType:e.type})))}}),(0,n.useEffect)(()=>{if(!t.id)return;let e=o.s.get(B(t.id)),r=o.s.get(D(t.id)),n=o.s.get(M(t.id));e&&i("wallet"===e?{accountType:e,walletClientType:r,chainType:n}:{accountType:e})},[t.id]),(0,s.jsx)(N.Provider,{value:r,children:e})},B=e=>`privy:${e}:recent-login-method`,D=e=>`privy:${e}:recent-login-wallet-client`,M=e=>`privy:${e}:recent-login-chain-type`,U=()=>(0,n.useContext)(N),j=e=>{(0,c.u)("fundWallet",e);let{fundWallet:t}=(0,u.u)();return{fundWallet:({address:e,options:r})=>t(e,r)}};function L(e){let{logout:t}=(0,n.useContext)(d.P);return(0,c.u)("logout",e),{logout:t}}let F=(0,f.v)(()=>({isModalOpen:!1,resolvers:null}));(0,f.v)(()=>({}));let z=({address:e,client:t,appId:r})=>{let n=`${t}:${e}`;r&&o.s.put(q(r),n),F.setState({wallet:n})},q=e=>`privy:${e}:active-wallet-connection`},32553:e=>{"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var i=n&&n.stringify||t;if("object"==typeof e&&null!==e){var s=r.length+1;if(1===s)return e;var a=Array(s);a[0]=i(e);for(var o=1;o<s;o++)a[o]=i(r[o]);return a.join(" ")}if("string"!=typeof e)return e;var l=r.length;if(0===l)return e;for(var c="",u=0,d=-1,f=e&&e.length||0,h=0;h<f;){if(37===e.charCodeAt(h)&&h+1<f){switch(d=d>-1?d:0,e.charCodeAt(h+1)){case 100:case 102:if(u>=l||null==r[u])break;d<h&&(c+=e.slice(d,h)),c+=Number(r[u]),d=h+2,h++;break;case 105:if(u>=l||null==r[u])break;d<h&&(c+=e.slice(d,h)),c+=Math.floor(Number(r[u])),d=h+2,h++;break;case 79:case 111:case 106:if(u>=l||void 0===r[u])break;d<h&&(c+=e.slice(d,h));var p=typeof r[u];if("string"===p){c+="'"+r[u]+"'",d=h+2,h++;break}if("function"===p){c+=r[u].name||"<anonymous>",d=h+2,h++;break}c+=i(r[u]),d=h+2,h++;break;case 115:if(u>=l)break;d<h&&(c+=e.slice(d,h)),c+=String(r[u]),d=h+2,h++;break;case 37:d<h&&(c+=e.slice(d,h)),c+="%",d=h+2,h++,u--}++u}++h}return -1===d?e:(d<f&&(c+=e.slice(d)),c)}},32560:(e,t,r)=>{"use strict";r.d(t,{g:()=>a});var n=r(12480),i=r(651),s=r(8042);async function a(e,{blockHash:t,blockNumber:r,blockTag:o=e.experimental_blockTag??"latest",includeTransactions:l}={}){let c=l??!1,u=void 0!==r?(0,i.cK)(r):void 0,d=null;if(!(d=t?await e.request({method:"eth_getBlockByHash",params:[t,c]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[u||o,c]},{dedupe:!!u})))throw new n.l({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||s.$)(d,"getBlock")}},32579:(e,t,r)=>{"use strict";r.d(t,{Af:()=>h,ZJ:()=>c,aT:()=>f});var n=r(15520),i=r(2939),s=r(27931),a=r(36174),o=r(44037);let l=new TextEncoder;function c(e,t={}){var r,n;return"number"==typeof e||"bigint"==typeof e?(r=e,n=t,f((0,o.cK)(r,n))):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?((0,a.Sl)(r,{size:t.size}),(0,s.eV)(r,{size:t.size})):r}(e,t):(0,i.q)(e)?f(e,t):h(e,t)}let u={zero:48,nine:57,A:65,F:70,a:97,f:102};function d(e){return e>=u.zero&&e<=u.nine?e-u.zero:e>=u.A&&e<=u.F?e-(u.A-10):e>=u.a&&e<=u.f?e-(u.a-10):void 0}function f(e,t={}){let r=e;t.size&&((0,a.Sl)(r,{size:t.size}),r=(0,s.eV)(r,{dir:"right",size:t.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);let o=i.length/2,l=new Uint8Array(o);for(let e=0,t=0;e<o;e++){let r=d(i.charCodeAt(t++)),s=d(i.charCodeAt(t++));if(void 0===r||void 0===s)throw new n.C(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);l[e]=16*r+s}return l}function h(e,t={}){let r=l.encode(e);return"number"==typeof t.size?((0,a.Sl)(r,{size:t.size}),(0,s.eV)(r,{dir:"right",size:t.size})):r}},33032:(e,t,r)=>{"use strict";r.d(t,{k:()=>o});var n=r(32579),i=r(84413),s=r(89633),a=r(15520);function o(e){var t;return t=function(e){let t=!0,r="",n=0,i="",s=!1;for(let a=0;a<e.length;a++){let o=e[a];if(["(",")",","].includes(o)&&(t=!0),"("===o&&n++,")"===o&&n--,t){if(0===n){if(" "===o&&["event","function",""].includes(i))i="";else if(i+=o,")"===o){s=!0;break}continue}if(" "===o){","!==e[a-1]&&","!==r&&",("!==r&&(r="",t=!1);continue}i+=o,r+=o}}if(!s)throw new a.C("Unable to normalize signature.");return i}("string"==typeof e?e:(0,s.B)(e)),(0,i.S)((0,n.ZJ)(t))}},33106:(e,t,r)=>{"use strict";r.d(t,{S:()=>s,a:()=>a});var n=r(75834);let i=(0,n.createContext)(!1);function s(){return(0,n.useContext)(i)}function a(e){return n.createElement(i.Provider,{value:e.force},e.children)}},33790:function(e,t,r){var n;!function(i,s){"use strict";var a="function",o="undefined",l="object",c="string",u="major",d="model",f="name",h="type",p="vendor",y="version",m="architecture",g="console",b="mobile",w="tablet",v="smarttv",x="wearable",_="embedded",E="Amazon",A="Apple",I="ASUS",C="BlackBerry",S="Browser",P="Chrome",$="Firefox",k="Google",T="Honor",O="Huawei",N="Microsoft",R="Motorola",B="Nvidia",D="OnePlus",M="Opera",U="OPPO",j="Samsung",L="Sharp",F="Sony",z="Xiaomi",q="Zebra",W="Facebook",H="Chromium OS",K="Mac OS",V=" Browser",G=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},J=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},Y=function(e,t){return typeof e===c&&-1!==Z(t).indexOf(Z(e))},Z=function(e){return e.toLowerCase()},Q=function(e,t){if(typeof e===c)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,500)},X=function(e,t){for(var r,n,i,o,c,u,d=0;d<t.length&&!c;){var f=t[d],h=t[d+1];for(r=n=0;r<f.length&&!c&&f[r];)if(c=f[r++].exec(e))for(i=0;i<h.length;i++)u=c[++n],typeof(o=h[i])===l&&o.length>0?2===o.length?typeof o[1]==a?this[o[0]]=o[1].call(this,u):this[o[0]]=o[1]:3===o.length?typeof o[1]!==a||o[1].exec&&o[1].test?this[o[0]]=u?u.replace(o[
vendor: 5,110 bytes, line 194
1941],o[2]):void 0:this[o[0]]=u?o[1].call(this,u,o[2]):void 0:4===o.length&&(this[o[0]]=u?o[3].call(this,u.replace(o[1],o[2])):s):this[o]=u||s;d+=2}},ee=function(e,t){for(var r in t)if(typeof t[r]===l&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(Y(t[r][n],e))return"?"===r?s:r}else if(Y(t[r],e))return"?"===r?s:r;return t.hasOwnProperty("*")?t["*"]:e},et={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},er={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,y],[/opios[\/ ]+([\w\.]+)/i],[y,[f,M+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[f,M+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[f,M]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[f,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[f,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[f,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[f,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[f,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[f,"Smart Lenovo "+S]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+S],y],[/\bfocus\/([\w\.]+)/i],[y,[f,$+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[f,M+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[f,M+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[f,"MIUI"+V]],[/fxios\/([\w\.-]+)/i],[y,[f,$]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[f,"360"]],[/\b(qq)\/([\w\.]+)/i],[[f,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1"+V],y],[/samsungbrowser\/([\w\.]+)/i],[y,[f,j+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[f,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[f,y],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[f],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[y,f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,W],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[f,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[f,P+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,P+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[f,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[y,ee,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[f,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[f,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[f,$+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[f,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[f,[y,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[m,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[m,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[m,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[m,/ower/,"",Z]],[/ sun4\w[;\)]/i],[[m,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;
vendor: 8,022 bytes, line 194
194|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[m,Z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[p,j],[h,w]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[d,[p,j],[h,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[p,A],[h,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[p,A],[h,w]],[/(macintosh);/i],[d,[p,A]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[p,L],[h,b]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[d,[p,T],[h,w]],[/honor([-\w ]+)[;\)]/i],[d,[p,T],[h,b]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[d,[p,O],[h,w]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[p,O],[h,b]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[d,/_/g," "],[p,z],[h,w]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[d,/_/g," "],[p,z],[h,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[p,U],[h,b]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[d,[p,ee,{OnePlus:["304","403","203"],"*":U}],[h,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[p,"Vivo"],[h,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[p,"Realme"],[h,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[p,R],[h,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[p,R],[h,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[p,"LG"],[h,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[p,"LG"],[h,b]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[d,[p,"Lenovo"],[h,w]],[/(nokia) (t[12][01])/i],[p,d,[h,w]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[d,/_/g," "],[h,b],[p,"Nokia"]],[/(pixel (c|tablet))\b/i],[d,[p,k],[h,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[p,k],[h,b]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[p,F],[h,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[p,F],[h,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[p,D],[h,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[p,E],[h,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[p,E],[h,b]],[/(playbook);[-\w\),; ]+(rim)/i],[d,p,[h,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[p,C],[h,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[p,I],[h,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[p,I],[h,b]],[/(nexus 9)/i],[d,[p,"HTC"],[h,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[d,/_/g," "],[h,b]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[d,[p,"TCL"],[h,w]],[/(itel) ((\w+))/i],[[p,Z],d,[h,ee,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[p,"Acer"],[h,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[p,"Meizu"],[h,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[p,"Ulefone"],[h,b]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[d,[p,"Energizer"],[h,b]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[d,[p,"Cat"],[h,b]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[d,[p,"Smartfren"],[h,b]],[/droid.+; (a(?:015|06[35]|142p?))/i],[d,[p,"Nothing"],[h,b]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[d,[p,"Archos"],[h,w]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[d,[p,"Archos"],[h,b]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[p,d,[h,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[p,d,[h,b]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,d,[h,w]],[/(surface duo)/i],[d,[p,N],[h,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[p,"Fairphone"],[h,b]],[/(u304aa)/i],[d,[p,"AT&T"],[h,b]],[/\bsie-(\w*)/i],[d,[p,"Siemens"],[h,b]],[/\b(rct\w+) b/i],[d,[p,"RCA"],[h,w]],[/\b(venue[\d ]{2,7}) b/i],[d,[p,"Dell"],[h,w]],[/\b(q(?:mv|ta)\w+) b/i],[d,[p,"Verizon"],[h,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[p,"Barnes & Noble"],[h,w]],[/\b(tm\d{3}\w+) b/i],[d,[p,"NuVision"],[h,w]],[/\b(k88) b/i],[d,[p,"ZTE"],[h,w]],[/\b(nx\d{3}j) b/i],[d,[p,"ZTE"],[h,b]],[/\b(gen\d{3}) b.+49h/i],[d,[p,"Swiss"],[h,b]],[/\b(zur\d{3}) b/i],[d,[p,"Swiss"],[h,w]],[/\b((zeki)?tb.*\b) b/i],[d,[p,"Zeki"],[h,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],d,[h,w]],[/\b(ns-?\w{0,9}) b/i],[d,[p,"Insignia"],[h,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[p,"NextBook"],[h,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],d,[h,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],d,[h,b]],[/\b(ph-1) /i],[d,[p,"Essential"],[h,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[p,"Envizen"],[h,w]],[/\b(trio[-\w\. ]+) b/i],[d,[p,"MachSpeed"],[h,w]],[/\btu_(1491) b/i],[d,[p,"Rotor"],[h,w]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[d,[p,B],[h,w]],[/(sprint) (\w+)/i],[p,d,[h,b]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[p,N],[h,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[p,q],[h,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[p,q],[h,b]],[/smart-tv.+(samsung)/i],[p,[h,v]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[p,j],[h,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,"LG"],[h,v]],[/(apple) ?tv/i],[p,[d,A+" TV"],[h,v]],[/crkey/i],[[d,P+"cast"],[p,k],[h,v]],[/droid.+aft(\w+)( bui|\))/i],[d,[p,E],[h,v]],[/(shield \w+ tv)/i],[d,[p,B],[h,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[p,L],[h,v]],[/(bravia[\w ]+)( bui|\))/i],[d,[p,F],[h,v]],[/(mi(tv|box)-?\w+) bui/i],[d,[p,z],[h,v]],[/Hbbtv.*(technisat) (.*);/i],[p,d,[h,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,Q],[d,Q],[h,v]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[d,[h,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,d,[h,g]],[/droid.+; (shield)( bui|\))/i],[d,[p,B],[h,g]],[/(playstation \w+)/i],[d,[p,F],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[p,N],[h,g]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[d,[p,j],[h,x]],[/((pebble))app/i,/(asu
vendor: 4,318 bytes, line 194
194s|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[p,d,[h,x]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[d,[p,U],[h,x]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[p,A],[h,x]],[/(opwwe\d{3})/i],[d,[p,D],[h,x]],[/(moto 360)/i],[d,[p,R],[h,x]],[/(smartwatch 3)/i],[d,[p,F],[h,x]],[/(g watch r)/i],[d,[p,"LG"],[h,x]],[/droid.+; (wt63?0{2,3})\)/i],[d,[p,q],[h,x]],[/droid.+; (glass) \d/i],[d,[p,k],[h,x]],[/(pico) (4|neo3(?: link|pro)?)/i],[p,d,[h,x]],[/; (quest( \d| pro)?)/i],[d,[p,W],[h,x]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[h,_]],[/(aeobc)\b/i],[d,[p,E],[h,_]],[/(homepod).+mac os/i],[d,[p,A],[h,_]],[/windows iot/i],[[h,_]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[h,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[h,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,b]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[d,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[f,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[f,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,y],[/ladybird\//i],[[f,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,y],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[f,[y,ee,et]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,ee,et],[f,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,K],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,f],[/(ubuntu) ([\w\.]+) like android/i],[[f,/(.+)/,"$1 Touch"],y],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[f,y],[/\(bb(10);/i],[y,[f,C]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[y,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[f,$+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[f,P+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,H],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,y],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,y]]},en=function(e,t){if(typeof e===l&&(t=e,e=s),!(this instanceof en))return new en(e,t).getResult();var r=typeof i!==o&&i.navigator?i.navigator:s,n=e||(r&&r.userAgent?r.userAgent:""),g=r&&r.userAgentData?r.userAgentData:s,v=t?G(er,t):er,x=r&&r.userAgent==n;return this.getBrowser=function(){var e,t={};return t[f]=s,t[y]=s,X.call(t,n,v.browser),t[u]=typeof(e=t[y])===c?e.replace(/[^\d\.]/g,"").split(".")[0]:s,x&&r&&r.brave&&typeof r.brave.isBrave==a&&(t[f]="Brave"),t},this.getCPU=function(){var e={};return e[m]=s,X.call(e,n,v.cpu),e},this.getDevice=function(){var e={};return e[p]=s,e[d]=s,e[h]=s,X.call(e,n,v.device),x&&!e[h]&&g&&g.mobile&&(e[h]=b),x&&"Macintosh"==e[d]&&r&&typeof r.standalone!==o&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e[d]="iPad",e[h]=w),e},this.getEngine=function(){var e={};
194return e[f]=s,e[y]=s,X.call(e,n,v.engine),e},this.getOS=function(){var e={};return e[f]=s,e[y]=s,X.call(e,n,v.os),x&&!e[f]&&g&&g.platform&&"Unknown"!=g.platform&&(e[f]=g.platform.replace(/chrome os/i,H).replace(/macos/i,K)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===c&&e.length>500?Q(e,500):e,this},this.setUA(n),this};en.VERSION="1.0.41",en.BROWSER=J([f,y,u]),en.CPU=J([m]),en.DEVICE=J([d,p,h,g,b,v,w,x,_]),en.ENGINE=en.OS=J([f,y]),typeof t!==o?(e.exports&&(t=e.exports=en),t.UAParser=en):r.amdO?s===(n=(function(){return en}).call(t,r,t,e))||(e.exports=n):typeof i!==o&&(i.UAParser=en);var ei=typeof i!==o&&(i.jQuery||i.Zepto);if(ei&&!ei.ua){var es=new en;ei.ua=es.getResult(),ei.ua.get=function(){return es.getUA()},ei.ua.set=function(e){es.setUA(e);var t=es.getResult();for(var r in t)ei.ua[r]=t[r]}}}("object"==typeof window?window:this)},33861:(e,t,r)=>{"use strict";r.d(t,{P:()=>o,a:()=>f,b:()=>s,c:()=>a,d:()=>h,e:()=>c,f:()=>u,g:()=>l,h:()=>d,i:()=>g,j:()=>m,k:()=>p,l:()=>y});var n,i=r(17572);class s extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,r){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=r}}class a extends s{constructor(e,t,r,n,i,s){super(r,n,i),this.type=e,this.status=t,this.data=s}}class o extends s{constructor(e,t,r){super(e,t,r),this.type="client_error"}}class l extends o{constructor(){super("Request timed out",void 0,"client_request_timeout")}}class c extends s{constructor(e,t,r){super(e,t,r),this.type="connector_error"}}let u=e=>{if(e instanceof s)return e;if(!(e instanceof i.F))return d(e);if(!e.response)return new a("api_error",null,e.message,e);let{type:t,message:r,error:n,code:o}=e.data;return new a(t||"ApiError",e.response.status,r||n,e,o,e.data)},d=e=>e instanceof s?e:e instanceof Error?new o(e.message,e):new o(`Internal error: ${e}`);var f=((n={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",n.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",n.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",n.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",n.INVALID_DATA="invalid_data",n.INVALID_CAPTCHA="invalid_captcha",n.LINKED_TO_ANOTHER_USER="linked_to_another_user",n.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",n.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",n.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",n.USER_EXITED_UPDATE_FLOW="exited_update_flow",n.ALLOWLIST_REJECTED="allowlist_rejected",n.OAUTH_USER_DENIED="oauth_user_denied",n.OAUTH_UNEXPECTED="oauth_unexpected",n.UNKNOWN_AUTH_ERROR="unknown_auth_error",n.USER_EXITED_AUTH_FLOW="exited_auth_flow",n.USER_EXITED_LINK_FLOW="exited_link_flow",n.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",n.MUST_BE_AUTHENTICATED="must_be_authenticated",n.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",n.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",n.CLIENT_REQUEST_TIMEOUT="client_request_timeout",n.INVALID_CREDENTIALS="invalid_credentials",n.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",n.UNKNOWN_MFA_ERROR="unknown_mfa_error",n.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",n.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",n.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",n.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",n.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",n.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",n.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",n.TRANSACTION_FAILURE="transaction_failure",n.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",n.NOT_SUPPORTED="not_supported",n.CAPTCHA_TIMEOUT="captcha_timeout",n.INVALID_MESSAGE="invalid_message",n.UNABLE_TO_SIGN="unable_to_sign",n.CAPTCHA_FAILURE="captcha_failure",n.CAPTCHA_DISABLED="captcha_disabled",n.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",n.TOO_MANY_REQUESTS="too_many_requests",n.USER_LIMIT_REACHED="max_accounts_reached",n.DISALLOWED_LOGIN_METHOD="disallowed_login_method",n.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",n.PASSKEY_NOT_ALLOWED="passkey_not_allowed",n.USER_DOES_NOT_EXIST="user_does_not_exist",n.INSUFFICIENT_BALANCE="insufficient_balance",n.ONRAMP_MINIMUM_IDENTITY_VERIFICATION_REQUIRED="onramp_minimum_identity_verification_required",n.ONRAMP_IDENTITY_VERIFICATION_REQUIRED="onramp_identity_verification_required",n.ONRAMP_DOCUMENT_VERIFICATION_REQUIRED="onramp_document_verification_required",n.ONRAMP_UNSUPPORTED_INFORMATION="onramp_unsupported_information",n.ONRAMP_TRANSACTION_LIMIT_REACHED="transaction_limit_reached",n.ONRAMP_QUOTE_EXPIRED="onramp_quote_expired",n.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",n.BUFFER_NOT_DEFINED="buffer_not_defined",n.UNSUPPORTED_WALLET_TYPE="unsupported_wallet_type",n.NO_SOLANA_ACCOUNTS="no_solana_accounts",n.UNKNOWN_FUNDING_ERROR="unknown_funding_error",n);class h extends o{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}}class p extends o{constructor(e="Embedded wallet error",t){super(e,t,"unknown_embedded_wallet_error")}}class y extends o{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}}class m extends o{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}}class g extends c{constructor(){super("No Solana accounts found in wallet",void 0,"no_solana_accounts")}}},33984:(e,t,r)=>{"use strict";e.exports=r(54008)},34143:(e,t,r)=>{var n=r(98539).hp;let i=r(95847),s=r(88417),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,r,a=!0){let o=["bytes32"],l=[this.hashType(e,r)];if(a){let c=(e,t,o)=>{if(void 0!==r[t])return["bytes32",null==o?"0x0000000000000000000000000000000000000000000000000000000000000000":i.keccak(this.encodeData(t,o,r,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=n.from(o,"utf8")),["bytes32",i.keccak(o)];if(t.lastIndexOf("]")===t.length-1){let r=t.slice(0,t.lastIndexOf("[")),n=o.map(t=>c(e,r,t));return["bytes32",i.keccak(s.rawEncode(n.map(([e])=>e),n.map(([,e])=>e)))]}return[t,o]};for(let n of r[e]){let[e,r]=c(n.name,n.type,t[n.name]);o.push(e),l.push(r)}}else for(let s of r[e]){let e=t[s.name];
194if(void 0!==e)if("bytes"===s.type)o.push("bytes32"),e=i.keccak(e),l.push(e);else if("string"===s.type)o.push("bytes32"),"string"==typeof e&&(e=n.from(e,"utf8")),e=i.keccak(e),l.push(e);else if(void 0!==r[s.type])o.push("bytes32"),e=i.keccak(this.encodeData(s.type,e,r,a)),l.push(e);else if(s.type.lastIndexOf("]")===s.type.length-1)throw Error("Arrays currently unimplemented in encodeData");else o.push(s.type),l.push(e)}return s.rawEncode(o,l)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(t=>t!==e);for(let i of n=[e].concat(n.sort())){if(!t[i])throw Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:e,type:t})=>t+" "+e).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||void 0===t[e])return r;for(let n of(r.push(e),t[e]))for(let e of this.findTypeDependencies(n.type,t,r))r.includes(e)||r.push(e);return r},hashStruct(e,t,r,n=!0){return i.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return i.keccak(this.encodeType(e,t))},sanitizeData(e){let t={};for(let r in a.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){let r=this.sanitizeData(e),s=[n.from("1901","hex")];return s.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),"EIP712Domain"!==r.primaryType&&s.push(this.hashStruct(r.primaryType,r.message,r.types,t)),i.keccak(n.concat(s))}};e.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 r=e.map(function(e){return"bytes"===e.type?i.toBuffer(e.value):e.value}),n=e.map(function(e){return e.type}),a=e.map(function(e){if(!e.name)throw t;return e.type+" "+e.name});return s.soliditySHA3(["bytes32","bytes32"],[s.soliditySHA3(Array(e.length).fill("string"),a),s.soliditySHA3(n,r)])}(e.data)},hashForSignTypedData_v3:function(e){return o.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return o.hash(e.data)}}},34172:(e,t,r)=>{"use strict";r.d(t,{W:()=>l});var n=r(97352),i=r(72693),s=r(38519),a=r(12089),o=r(3901);async function l(e,t){let{abi:r,address:l,args:c,functionName:u,dataSuffix:d="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,...f}=t,h=(0,i.p)({abi:r,args:c,functionName:u});try{return await (0,a.T)(e,o.Q,"estimateGas")({data:`${h}${d?d.replace("0x",""):""}`,to:l,...f})}catch(t){let e=f.account?(0,n.J)(f.account):void 0;throw(0,s.j)(t,{abi:r,address:l,args:c,docsPath:"/docs/contract/estimateContractGas",functionName:u,sender:e?.address})}}},34867:(e,t,r)=>{"use strict";r.d(t,{N0:()=>A,S$:()=>b,az:()=>j,dU:()=>P,fr:()=>$,mN:()=>N,mm:()=>L,q0:()=>g,rt:()=>O,vm:()=>U});var n,i,s,a,o,l,c=r(31911),u=r(6825),d=r(6274),f=r(5635),h=r(8971),p=r(21008),y=r(13569),m=r(77809);function g(e){return"lifetimeConstraint"in e&&"string"==typeof e.lifetimeConstraint.blockhash&&"bigint"==typeof e.lifetimeConstraint.lastValidBlockHeight&&(0,u.yF)(e.lifetimeConstraint.blockhash)}function b(e,t){return"lifetimeConstraint"in t&&t.lifetimeConstraint&&"blockhash"in t.lifetimeConstraint&&t.lifetimeConstraint.blockhash===e.blockhash&&t.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight?t:Object.freeze({...t,lifetimeConstraint:Object.freeze(e)})}function w(e,t){let[r,n]=e.split(RegExp(`((?!${t}).*)`));return[r,n]}function v(e,t){let r=BigInt(t.length),n=0n;for(let i of e)n*=r,n+=BigInt(t.indexOf(i));return n}var x="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function _(){return s||(s=(0,p.Qe)()),s}function E(){return a||(a=(0,p.eh)()),a}function A(){return(0,f.$C)({maxSize:1,read:(e,t)=>{let r=e[t];if((128&r)==0)return["legacy",t];{let e=128^r;if(e>0)throw new c.tsw(c.DAJ,{unsupportedVersion:e});return[e,t+1]}}})}function I(){return(0,h.a5)(S())}function C(){return(0,f.FU)((0,h.a5)([...S(),["addressTableLookups",(0,h.is)(function(){if(!n){let e=(0,h.is)((0,p.Qe)(),{size:(0,p.tD)()});n=(0,h.a5)([["lookupTableAddress",(0,d.jw)()],["writableIndexes",e],["readonlyIndexes",e]])}return n}(),{size:(0,p.tD)()})]]),e=>"legacy"===e.version?e:{...e,addressTableLookups:e.addressTableLookups??[]})}function S(){let e=(0,h.md)([(0,h.J8)(new Uint8Array(32)),(0,f.Ns)((0,f.xv)({getSizeFromValue:e=>{let[t,r]=w(e,x[0]);if(!r)return e.length;let n=v(r,x);return t.length+Math.ceil(n.toString(16).length/2)},write(e,t,r){if(!function(e,t,r=t){if(!t.match(RegExp(`^[${e}
194]*$`)))throw new c.tsw(c.mZ_,{alphabet:e,base:e.length,value:r})}(x,e),""===e)return r;let[n,i]=w(e,x[0]);if(!i)return t.set(new Uint8Array(n.length).fill(0),r),r+n.length;let s=v(i,x),a=[];for(;s>0n;)a.unshift(Number(s%256n)),s/=256n;let o=[...Array(n.length).fill(0),...a];return t.set(o,r),r+o.length}}),32)],e=>+(void 0!==e));return[["version",(0,f.xv)({getSizeFromValue:e=>+("legacy"!==e),maxSize:1,write:(e,t,r)=>{if("legacy"===e)return r;if(e<0||e>127)throw new c.tsw(c.Da$,{actualVersion:e});if(e>0)throw new c.tsw(c.DAJ,{unsupportedVersion:e});return t.set([128|e],r),r+1}})],["header",(0,h.a5)([["numSignerAccounts",_()],["numReadonlySignerAccounts",_()],["numReadonlyNonSignerAccounts",_()]])],["staticAccounts",(0,h.is)((0,d.jw)(),{size:(0,p.tD)()})],["lifetimeToken",e],["instructions",(0,h.is)((o||(o=(0,f.FU)((0,h.a5)([["programAddressIndex",(0,p.Qe)()],["accountIndices",(0,h.is)((0,p.Qe)(),{size:(0,p.tD)()})],["data",(0,f.Bq)((0,h.Im)(),(0,p.tD)())]]),e=>void 0!==e.accountIndices&&void 0!==e.data?e:{...e,accountIndices:e.accountIndices??[],data:e.data??new Uint8Array(0)})),o),{size:(0,p.tD)()})]]}function P(){return(0,f.xv)({getSizeFromValue:e=>"legacy"===e.version?I().getSizeFromValue(e):C().getSizeFromValue(e),write:(e,t,r)=>"legacy"===e.version?I().write(e,t,r):C().write(e,t,r)})}function $(){return(0,f.vt)((0,h.ci)([["version",A()],["header",(0,h.ci)([["numSignerAccounts",E()],["numReadonlySignerAccounts",E()],["numReadonlyNonSignerAccounts",E()]])],["staticAccounts",(0,h.O_)((0,d.Xg)(),{size:(0,p.vU)()})],["lifetimeToken",(0,f.pI)((0,f.$C)({read(e,t){let r=0===t?e:e.slice(t);if(0===r.length)return["",0];let n=r.findIndex(e=>0!==e);n=-1===n?r.length:n;let i=x[0].repeat(n);return n===r.length?[i,e.length]:[i+function(e,t){let r=BigInt(t.length),n=[];for(;e>0n;)n.unshift(t[Number(e%r)]),e/=r;return n.join("")}(r.slice(n).reduce((e,t)=>256n*e+BigInt(t),0n),x),e.length]}}),32)],["instructions",(0,h.O_)((l||(l=(0,f.vt)((0,h.ci)([["programAddressIndex",(0,p.eh)()],["accountIndices",(0,h.O_)((0,p.eh)(),{size:(0,p.vU)()})],["data",(0,f.Ru)((0,h.EK)(),(0,p.vU)())]]),e=>{if(e.accountIndices.length&&e.data.byteLength)return e;let{accountIndices:t,data:r,...n}=e;return{...n,...t.length?{accountIndices:t}:null,...r.byteLength?{data:r}:null}})),l),{size:(0,p.vU)()})],["addressTableLookups",(0,h.O_)(function(){if(!i){let e=(0,h.O_)((0,p.eh)(),{size:(0,p.vU)()});i=(0,h.ci)([["lookupTableAddress",(0,d.Xg)()],["writableIndexes",e],["readonlyIndexes",e]])}return i}(),{size:(0,p.vU)()})]]),({addressTableLookups:e,...t})=>"legacy"!==t.version&&e?.length?{...t,addressTableLookups:e}:t)}function k(e,t,r){e[t]=r(e[t]??{role:y.Uv.READONLY})}var T=Symbol("AddressMapTypeProperty");function O(e){let t,r=Object.entries(function(e,t){let r={[e]:{[T]:0,role:y.Uv.WRITABLE_SIGNER}},n=new Set;for(let e of t){let t;if(k(r,e.programAddress,t=>{if(n.add(e.programAddress),T in t){if((0,y.TN)(t.role))if(0===t[T])throw new c.tsw(c.XNQ,{programAddress:e.programAddress});else throw new c.tsw(c.Tsv,{programAddress:e.programAddress});if(2===t[T])return t}return{[T]:2,role:y.Uv.READONLY}}),e.accounts)for(let i of e.accounts)k(r,i.address,e=>{let{address:r,...s}=i;if(T in e)switch(e[T]){case 0:return e;case 1:{let r=(0,y.Wq)(e.role,s.role);if("lookupTableAddress"in s){if(e.lookupTableAddress!==s.lookupTableAddress&&0>(t||=(0,d.XF)())(s.lookupTableAddress,e.lookupTableAddress))return{[T]:1,...s,role:r}}else if((0,y.tZ)(s.role))return{[T]:2,role:r};if(e.role!==r)return{...e,role:r};return e}case 2:{let t=(0,y.Wq)(e.role,s.role);if(n.has(i.address)){if((0,y.TN)(s.role))throw new c.tsw(c.Tsv,{programAddress:i.address});if(e.role!==t)return{...e,role:t};return e}if("lookupTableAddress"in s&&!(0,y.tZ)(e.role))return{...s,[T]:1,role:t};if(e.role!==t)return{...e,role:t};else return e}}return"lookupTableAddress"in s?{...s,[T]:1}:{...s,[T]:2}})}return r}(e.feePayer.address,e.instructions)).sort(([e,r],[n,i])=>{if(r[T]!==i[T]){if(0===r[T])return -1;else if(0===i[T])return 1;else if(2===r[T])return -1;else if(2===i[T])return 1}let s=(0,y.tZ)(r.role);if(s!==(0,y.tZ)(i.role))return s?-1:1;let a=(0,y.TN)(r.role);return a!==(0,y.TN)(i.role)?a?-1:1:(t||=(0,d.XF)(),1===r[T]&&1===i[T]&&r.lookupTableAddress!==i.lookupTableAddress)?t(r.lookupTableAddress,i.lookupTableAddress):t(e,n)}).map(([e,t])=>({address:e,...t})),n=e.lifetimeConstraint;return{..."legacy"!==e.version?{addressTableLookups:function(e){let t={};for(let r of e){if(!("lookupTableAddress"in r))continue;let e=t[r.lookupTableAddress]||={readonlyIndexes:[],writableIndexes:[]};r.role===y.Uv.WRITABLE?e.writableIndexes.push(r.addressIndex):e.readonlyIndexes.push(r.addressIndex)}return Object.keys(t).sort((0,d.XF)()).map(e=>({lookupTableAddress:e,...t[e]}))}(r)}:null,...n?{lifetimeToken:"nonce"in n?n.nonce:n.blockhash}:null,header:function(e){let t=0,r=0,n=0;for(let i of e){if("lookupTableAddress"in i)break;let e=(0,y.TN)(i.role);(0,y.tZ)(i.role)?(n++,!e&&r++):!e&&t++}return{numReadonlyNonSignerAccounts:t,numReadonlySignerAccounts:r,numSignerAccounts:n}}(r),instructions:function(e,t){let r=function(e){let t={};for(let[r,n]of e.entries())t[n.address]=r;return t}(t);return e.map(({accounts:e,data:t,programAddress:n})=>({programAddressIndex:r[n],...e?{accountIndices:e.map(({address:e})=>r[e])}:null,...t?{data:t}:null}))}(e.instructions,r),staticAccounts:function(e){let t=e.findIndex(e=>"lookupTableAddress"in e);return(-1===t?e:e.slice(0,t)).map(({address:e})=>e)}(r),version:e.version}}function N(e){return Object.freeze({instructions:Object.freeze([]),version:e.version})}var R="SysvarRecentB1ockHashes11111111111111111111",B="11111111111111111111111111111111";function D(e,t){return{accounts:[{address:e,role:y.Uv.WRITABLE},{address:R,role:y.Uv.READONLY},{address:t,role:y.Uv.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:B}}function M(e){var t;return e.programAddress===B&&null!=e.data&&4===(t=e.data).byteLength&&4===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&e.accounts?.length===3&&null!=e.accounts[0].address&&e.accounts[0].role===y.Uv.WRITABLE&&e.accounts[1].address===R&&e.accounts[1].role===y.Uv.READONLY&&null!=e.accounts[2].address&&(0,y.tZ)(e.accounts[2].role)}function U(e){return"lifetimeConstraint"in e&&"string"==typeof e.lifetimeConstraint.nonce&&null!=e.instructions[0]&&M(e.instructions[0])}function j(e,t){var r,n;return r=[e],Object.freeze({...n=t,instructions:Object.freeze([...n.instructions,...r])})}function L(e,t){let r=e.staticAccounts[0];if(!r)throw new c.tsw(c.eZ6);let n=[...function(e){let{header:t}=e,r=t.numSignerAccounts-t.numReadonlySignerAccounts,n=e.staticAccounts.length-t.numSignerAccounts-t.numReadonlyNonSignerAccounts,i=[],s=0;for(let t=0;t<r;t++)i.push({address:e.staticAccounts[s],role:y.Uv.WRITABLE_SIGNER}),s++;for(let r=0;r<t.numReadonlySignerAccounts;r++)i.push({address:e.staticAccounts[s],role:y.Uv.READONLY_SIGNER}),s++;for(let t=0;t<n;t++)i.push({address:e.staticAccounts[s],role:y.Uv.WRITABLE}),s++;for(let r=0;r<t.numReadonlyNonSignerAccounts;r++)i.push({address:e.staticAccounts[s],role:y.Uv.READONLY}),s++;return i}(e),..."addressTableLookups"in e&&void 0!==e.addressTableLookups&&e.addressTableLookups.length>0?function(e,t){let r=e.map(e=>e.lookupTableAddress).filter(e=>void 0===t[e]);if(r.length>0)throw new c.tsw(c.Vjw,{lookupTableAddresses:r});let n=[],i=[];for(let r of e){let e=t[r.lookupTableAddress],s=r.readonlyIndexes,a=r.writableIndexes,o=Math.max(...s,...a);if(o>
194=e.length)throw new c.tsw(c.t_l,{highestKnownIndex:e.length-1,highestRequestedIndex:o,lookupTableAddress:r.lookupTableAddress});let l=s.map(t=>({address:e[t],addressIndex:t,lookupTableAddress:r.lookupTableAddress,role:y.Uv.READONLY}));n.push(...l);let u=a.map(t=>({address:e[t],addressIndex:t,lookupTableAddress:r.lookupTableAddress,role:y.Uv.WRITABLE}));i.push(...u)}return[...i,...n]}(e.addressTableLookups,t?.addressesByLookupTableAddress??{}):[]],i=e.instructions.map(e=>(function(e,t){let r=t[e.programAddressIndex]?.address;if(!r)throw new c.tsw(c.MQP,{index:e.programAddressIndex});let n=e.accountIndices?.map(e=>t[e]),{data:i}=e;return Object.freeze({programAddress:r,...n&&n.length?{accounts:Object.freeze(n)}:{},...i&&i.length?{data:i}:{}})})(e,n)),s=i[0],a=function(e,t,r){if(!t||!M(t))return{blockhash:e,lastValidBlockHeight:r??2n**64n-1n};{let r=t.accounts[0].address;(0,d.Vm)(r);let n=t.accounts[2].address;return(0,d.Vm)(n),{nonce:e,nonceAccountAddress:r,nonceAuthorityAddress:n}}}(e.lifetimeToken,s,t?.lastValidBlockHeight);return(0,m.F)(N({version:e.version}),e=>(function(e,t){var r;if("feePayer"in t&&e===t.feePayer?.address&&(r=t.feePayer)&&"address"in r&&"string"==typeof r.address&&1===Object.keys(r).length)return t;let n={...t,feePayer:Object.freeze({address:e})};return Object.freeze(n),n})(r,e),e=>i.reduce((e,t)=>j(t,e),e),e=>"blockhash"in a?b(a,e):function({nonce:e,nonceAccountAddress:t,nonceAuthorityAddress:r},n){let i,s=n.instructions[0];if(s&&M(s))if(s.accounts[0].address===t&&s.accounts[2].address===r)if(U(n)&&n.lifetimeConstraint.nonce===e)return n;else i=[s,...n.instructions.slice(1)];else i=[Object.freeze(D(t,r)),...n.instructions.slice(1)];else i=[Object.freeze(D(t,r)),...n.instructions];return Object.freeze({...n,instructions:Object.freeze(i),lifetimeConstraint:Object.freeze({nonce:e})})}(a,e))}},35098:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toBig=t.shrSL=t.shrSH=t.rotrSL=t.rotrSH=t.rotrBL=t.rotrBH=t.rotr32L=t.rotr32H=t.rotlSL=t.rotlSH=t.rotlBL=t.rotlBH=t.add5L=t.add5H=t.add4L=t.add4H=t.add3L=t.add3H=void 0,t.add=w,t.fromBig=i,t.split=s;let r=BigInt(0x100000000-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function s(e,t=!1){let r=e.length,n=new Uint32Array(r),a=new Uint32Array(r);for(let s=0;s<r;s++){let{h:r,l:o}=i(e[s],t);[n[s],a[s]]=[r,o]}return[n,a]}let a=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=a;let o=(e,t,r)=>e>>>r;t.shrSH=o;let l=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=l;let c=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=c;let u=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=u;let d=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=d;let f=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=f;let h=(e,t)=>t;t.rotr32H=h;let p=(e,t)=>e;t.rotr32L=p;let y=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=y;let m=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=m;let g=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=g;let b=(e,t,r)=>e<<r-32|t>>>64-r;function w(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}t.rotlBL=b;let v=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=v;let x=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0;t.add3H=x;let _=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=_;let E=(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0;t.add4H=E;let A=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);t.add5L=A;let I=(e,t,r,n,i,s)=>t+r+n+i+s+(e/0x100000000|0)|0;t.add5H=I,t.default={fromBig:i,split:s,toBig:a,shrSH:o,shrSL:l,rotrSH:c,rotrSL:u,rotrBH:d,rotrBL:f,rotr32H:h,rotr32L:p,rotlSH:y,rotlSL:m,rotlBH:g,rotlBL:b,add:w,add3L:v,add3H:x,add4L:_,add4H:E,add5H:I,add5L:A}},35107:(e,t,r)=>{"use strict";async function n(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}r.d(t,{L:()=>n})},35234:(e,t,r)=>{"use strict";r.d(t,{J:()=>i});var n=r(40917);function i(e,t){return n.GP(e,t)}},35259:(e,t,r)=>{"use strict";r.d(t,{B:()=>d,p:()=>f});var n,i,s=r(75834),a=r(40852),o=r(60031),l=r(53160),c=r(88304);void 0!==c&&"undefined"!=typeof globalThis&&"undefined"!=typeof Element&&(null==(n=null==c?void 0:c.env)?void 0:n.NODE_ENV)==="test"&&void 0===(null==(i=null==Element?void 0:Element.prototype)?void 0:i.getAnimations)&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
195`)),[]});var u=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(u||{});function d(e){let t={};for(let r in e)!0===e[r]&&(t[`data-${r}`]="");return t}
195function f(e,t,r,n){let[i,c]=(0,s.useState)(r),{hasFlag:u,addFlag:d,removeFlag:f}=function(e=0){let[t,r]=(0,s.useState)(e),n=(0,s.useCallback)(e=>r(e),[]),i=(0,s.useCallback)(e=>r(t=>t|e),[]),a=(0,s.useCallback)(e=>(t&e)===e,[t]);return{flags:t,setFlag:n,addFlag:i,hasFlag:a,removeFlag:(0,s.useCallback)(e=>r(t=>t&~e),[]),toggleFlag:(0,s.useCallback)(e=>r(t=>t^e),[])}}(e&&i?3:0),h=(0,s.useRef)(!1),p=(0,s.useRef)(!1),y=(0,o.L)();return(0,l.s)(()=>{var i;if(e){if(r&&c(!0),!t){r&&d(3);return}return null==(i=null==n?void 0:n.start)||i.call(n,r),function(e,{prepare:t,run:r,done:n,inFlight:i}){let s=(0,a.e)();return function(e,{inFlight:t,prepare:r}){if(null!=t&&t.current)return r();let n=e.style.transition;e.style.transition="none",r(),e.offsetHeight,e.style.transition=n}(e,{prepare:t,inFlight:i}),s.nextFrame(()=>{r(),s.requestAnimationFrame(()=>{s.add(function(e,t){var r,n;let i=(0,a.e)();if(!e)return i.dispose;let s=!1;i.add(()=>{s=!0});let o=null!=(n=null==(r=e.getAnimations)?void 0:r.call(e).filter(e=>e instanceof CSSTransition))?n:[];return 0===o.length?t():Promise.allSettled(o.map(e=>e.finished)).then(()=>{s||t()}),i.dispose}(e,n))})}),s.dispose}(t,{inFlight:h,prepare(){p.current?p.current=!1:p.current=h.current,h.current=!0,p.current||(r?(d(3),f(4)):(d(4),f(2)))},run(){p.current?r?(f(3),d(4)):(f(4),d(3)):r?f(1):d(1)},done(){var e,i,s,a;p.current&&(null!=(a=null==(s=(i=t).getAnimations)?void 0:s.call(i))?a:[]).some(e=>e instanceof CSSTransition&&"finished"!==e.playState)||(h.current=!1,f(7),r||c(!1),null==(e=null==n?void 0:n.end)||e.call(n,r))}})}},[e,r,t,y]),e?[i,{closed:u(1),enter:u(2),leave:u(4),transition:u(2)||u(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}},35424:(e,t,r)=>{"use strict";r.d(t,{_:()=>s});var n=r(75834),i=r(63455);let s=function(e){let t=(0,i.Y)(e);return n.useCallback((...e)=>t.current(...e),[t])}},36174:(e,t,r)=>{"use strict";r.d(t,{IQ:()=>d,ME:()=>u,Nx:()=>c,Sl:()=>o,uU:()=>l});
195var n=r(65636),i=r(21047),s=r(4538),a=r(32579);function o(e,{size:t}){if((0,i.E)(e)>t)throw new n.u({givenSize:(0,i.E)(e),maxSize:t})}function l(e,t={}){let{signed:r}=t;t.size&&o(e,{size:t.size});let n=BigInt(e);if(!r)return n;let i=(e.length-2)/2;return n<=(1n<<8n*BigInt(i)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function c(e,t={}){let r=e;if(t.size&&(o(r,{size:t.size}),r=(0,s.B)(r)),"0x00"===(0,s.B)(r))return!1;if("0x01"===(0,s.B)(r))return!0;throw new n.H2(r)}function u(e,t={}){let r=l(e,t),i=Number(r);if(!Number.isSafeInteger(i))throw new n.Ty({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${r}n`});return i}function d(e,t={}){let r=(0,a.aT)(e);return t.size&&(o(r,{size:t.size}),r=(0,s.B)(r,{dir:"right"})),new TextDecoder().decode(r)}},36207:(e,t,r)=>{"use strict";function n(e){return"object"==typeof e&&null!==e&&"nodeType"in e}function i(e){return n(e)&&"tagName"in e}function s(e){return i(e)&&"accessKey"in e}function a(e){return i(e)&&"tabIndex"in e}function o(e){return i(e)&&"style"in e}function l(e){return s(e)&&"IFRAME"===e.nodeName}function c(e){return s(e)&&"INPUT"===e.nodeName}function u(e){return s(e)&&"LABEL"===e.nodeName}function d(e){return s(e)&&"FIELDSET"===e.nodeName}function f(e){return s(e)&&"LEGEND"===e.nodeName}function h(e){return!!i(e)&&e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]')}r.d(t,{A3:()=>c,Er:()=>d,Gu:()=>l,H5:()=>h,Jb:()=>f,Lk:()=>a,Ll:()=>n,kS:()=>u,pv:()=>o,sb:()=>s,vq:()=>i})},36480:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>s,__asyncDelegator:()=>v,__asyncGenerator:()=>w,__asyncValues:()=>x,__await:()=>b,__awaiter:()=>u,__classPrivateFieldGet:()=>I,__classPrivateFieldSet:()=>C,__createBinding:()=>f,__decorate:()=>o,__exportStar:()=>h,__extends:()=>i,__generator:()=>d,__importDefault:()=>A,__importStar:()=>
vendor: 4,139 bytes, line 195
195E,__makeTemplateObject:()=>_,__metadata:()=>c,__param:()=>l,__read:()=>y,__rest:()=>a,__spread:()=>m,__spreadArrays:()=>g,__values:()=>p});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function o(e,t,r,n){var i,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(a=(s<3?i(a):s>3?i(t,r,a):i(t,r))||a);return s>3&&a&&Object.defineProperty(t,r,a),a}function l(e,t){return function(r,n){t(r,n,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))(function(i,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((n=n.apply(e,t||[])).next())})}function d(e,t){var r,n,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){var l=[s,o];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){a.label=l[1];break}if(6===l[0]&&a.label<i[1]){a.label=i[1],i=l;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(l);break}i[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function f(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function h(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return a}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e}function g(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],a=0,o=s.length;a<o;a++,i++)n[i]=s[a];return n}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function w(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){i[e]&&(n[e]=function(t){return new Promise(function(r,n){
195s.push([e,t,r,n])>1||o(e,t)})})}function o(e,t){try{var r;(r=i[e](t)).value instanceof b?Promise.resolve(r.value.v).then(l,c):u(s[0][2],r)}catch(e){u(s[0][3],e)}}function l(e){o("next",e)}function c(e){o("throw",e)}function u(e,t){e(t),s.shift(),s.length&&o(s[0][0],s[0][1])}}function v(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function x(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){var s,a,o;s=n,a=i,o=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){s({value:e,done:o})},a)})}}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function A(e){return e&&e.__esModule?e:{default:e}}function I(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function C(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},36665:(e,t,r)=>{"use strict";r.d(t,{Af:()=>h,ZJ:()=>c,aT:()=>f});var n=r(99838),i=r(92733),s=r(87601),a=r(5596),o=r(651);let l=new TextEncoder;function c(e,t={}){var r,n;return"number"==typeof e||"bigint"==typeof e?(r=e,n=t,f((0,o.cK)(r,n))):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?((0,a.Sl)(r,{size:t.size}),(0,s.eV)(r,{size:t.size})):r}(e,t):(0,i.q)(e)?f(e,t):h(e,t)}let u={zero:48,nine:57,A:65,F:70,a:97,f:102};function d(e){return e>=u.zero&&e<=u.nine?e-u.zero:e>=u.A&&e<=u.F?e-(u.A-10):e>=u.a&&e<=u.f?e-(u.a-10):void 0}function f(e,t={}){let r=e;t.size&&((0,a.Sl)(r,{size:t.size}),r=(0,s.eV)(r,{dir:"right",size:t.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);let o=i.length/2,l=new Uint8Array(o);for(let e=0,t=0;e<o;e++){let r=d(i.charCodeAt(t++)),s=d(i.charCodeAt(t++));if(void 0===r||void 0===s)throw new n.C(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);l[e]=16*r+s}return l}function h(e,t={}){let r=l.encode(e);return"number"==typeof t.size?((0,a.Sl)(r,{size:t.size}),(0,s.eV)(r,{dir:"right",size:t.size})):r}},36684:(e,t,r)=>{"use strict";r.d(t,{BH:()=>h,vB:()=>f,yM:()=>p});var n=r(63710),i=r(99838),s=r(47450),a=r(10439),o=r(50016),l=r(5596),c=r(651),u=r(93861),d=r(69697);let f="0x5792579257925792579257925792579257925792579257925792579257925792",h=(0,c.cK)(0,{size:32});async function p(e,t){let{account:r=e.account,chain:p=e.chain,experimental_fallback:y,experimental_fallbackDelay:m=32,forceAtomic:g=!1,id:b,version:w="2.0.0"}=t,v=r?(0,n.J)(r):null,x=t.capabilities;e.dataSuffix&&!t.capabilities?.dataSuffix&&(x="string"==typeof e.dataSuffix?{...t.capabilities,dataSuffix:{value:e.dataSuffix,optional:!0}}:{...t.capabilities,dataSuffix:{value:e.dataSuffix.value,...e.dataSuffix.required?{}:{optional:!0}}});let _=t.calls.map(e=>{let t=e.abi?(0,a.p)({abi:e.abi,functionName:e.functionName,args:e.args}):e.data;return{data:e.dataSuffix&&t?(0,o.xW)([t,e.dataSuffix]):t,to:e.to,value:e.value?(0,c.cK)(e.value):void 0}});try{let t=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:g,calls:_,capabilities:x,chainId:(0,c.cK)(p.id),from:v?.address,id:b,version:w}]},{retryCount:0});if("string"==typeof t)return{id:t};return t}catch(r){if(y&&("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name||"UnknownRpcError"===r.name||r.details.toLowerCase().includes("does not exist / is not available")||r.details.toLowerCase().includes("missing or invalid. request()")||r.details.toLowerCase().includes("did not match any variant of untagged enum")||r.details.toLowerCase().includes("account upgraded to unsupported contract")||r.details.toLowerCase().includes("eip-7702 not supported")||r.details.toLowerCase().includes("unsupported wc_ method")||r.details.toLowerCase().includes("feature toggled misconfigured")||r.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(x&&Object.values(x).some(e=>!e.optional)){let e="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new s.L5(new i.C(e,{details:e}))}if(g&&_.length>1){let e="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new s.jz(new i.C(e,{details:e}))}let t=[];for(let r of _){try{let n=await (0,d.v)(e,{account:v,chain:p,data:r.data,to:r.to,value:r.value?(0,l.uU)(r.value):void 0});t.push({status:"fulfilled",value:n})}catch(e){t.push({reason:e,status:"rejected"})}m>0&&await new Promise(e=>setTimeout(e,m))}if(t.every(e=>"rejected"===e.status))throw t[0].reason;let r=t.map(e=>"fulfilled"===e.status?e.value:h);return{id:(0,o.xW)([...r,(0,c.cK)(p.id,{size:32}),f])}}throw(0,u.p)(r,{...t,account:v,chain:t.chain})}}},37289:(e,t,r)=>{"use strict";r.d(t,{l:()=>s});var n=r(15520),i=r(31445);function s(e,t){let r=(e.details||"").toLowerCase(),s=e instanceof n.C?e.walk(e=>e?.code===i.A7.code):e;return s instanceof n.C?new i.A7({cause:e,message:s.details}):i.A7.nodeMessage.test(r)?new i.A7({cause:e,message:e.details}):i.BG.nodeMessage.test(r)?new i.BG({cause:e,maxFeePerGas:t?.maxFeePerGas}):i.jj.nodeMessage.test(r)?new i.jj({cause:e,maxFeePerGas:t?.maxFeePerGas}):i.K0.nodeMessage.test(r)?new i.K0({cause:e,nonce:t?.nonce}):i.Oh.nodeMessage.test(r)?new i.Oh({cause:e,nonce:t?.nonce}):i.vW.nodeMessage.test(r)?new i.vW({cause:e,nonce:t?.nonce}):i.k5.nodeMessage.test(r)?new i.k5({cause:e}):i.lY.nodeMessage.test(r)?new i.lY({cause:e,gas:t?.gas}):i.Fo.nodeMessage.test(r)?new i.Fo({cause:e,gas:t?.gas}):i.uC.nodeMessage.test(r)?new i.uC({cause:e}):i.lN.nodeMessage.test(r)?new i.lN({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new i.RM({cause:e})}},37438:(e,t,r)=>{"use strict";r.d(t,{T:()=>A});var n=r(85745),i=r(17068),s=r(63710),a=r(67008),o=r(99842),l=r(99838),c=r(56260),u=r(97687),d=r(70044),f=r(40407),h=r(57813),p=r(10439),y=r(72334),m=r(84742),g=r(14558),b=r(25879),w=r(89502),v=r(95016),x=r(57952),_=r(14992),E=r(74869);async function A(e,t){let{account:a=e.account,authorizationList:f,batch:p=!!e.batch?.multicall,blockHash:g,blockNumber:x,blockTag:A=e.experimental_blockTag??"latest",requireCanonical:I,accessList:C,blobs:k,blockOverrides:T,code:O,data:N,factory:R,factoryData:B,gas:D,gasPrice:M,maxFeePerBlobGas:U,maxFeePerGas:j,maxPriorityFeePerGas:L,nonce:F,requestOptions:z,to:q,value:W,stateOverride:H,...K}=t,V=a?(0,s.J)(a):void 0;if(O&&(R||B))throw new l.C("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(O&&q)throw new l.C("Cannot provide both `code` & `to` as parameters.");let G=O&&N,J=R&&B&&q&&N,Y=G||J,Z=G?$({code:O,data:N}):J?function(e){let{data:t,factory:r,factoryData:i,to:s}=e;return(0,h.m)({abi:(0,n.U)(["constructor(address, bytes, address, bytes)"]),bytecode:o.WN,args:[s,t,r,i]})}({data:N,factory:R,factoryData:B,to:q}):N;try{(0,E.c)(t);let r=(0,m.O)({blockHash:g,blockNumber:x,blockTag:A,requireCanonical:I}),n=T?i.J(T):void 0,s=(0,_.yH)(H),a=e.chain?.formatters?.transactionRequest?.format,o=(a||v.Bv)({...(0,w.o)(K,{format:a}),accessList:C,account:V,authorizationList:f,blobs:k,data:Z,gas:D,gasPrice:M,maxFeePerBlobGas:U,maxFeePerGas:j,maxPriorityFeePerGas:L,nonce:F,to:Y?void 0:q,value:W},"call");if(p&&function({request:e}){let{data:t,to:r,...n}=e;return!(!t||t.startsWith("0x82ad56cb"))&&!!r&&!(Object.values(n).filter(e=>void 0!==e).length>0)}({request:o})&&!n&&void 0===g)try{var Q,X;let{deployless:t=!1}="object"==typeof e.batch?.multicall?e.batch.multicall:{},r=P(e,{blockNumber:x,deployless:t});if(!r||(Q=s,X=r,!(Q&&Object.keys(Q).some(e=>(0,y.h)(e,X)))))return await S(e,{...o,blockHash:g,blockNumber:x,blockTag:A,multicallAddress:r,requestOptions:z,requireCanonical:I,rpcStateOverride:s})}catch(e){if(!(e instanceof c.YE)&&!(e instanceof c.rj))throw e}let l=(()=>{let e=[o,r];return s&&n?[...e,s,n]:s?[...e,s]:n?[...e,{},n]:e})(),u=await e.request({method:"eth_call",params:l},z);if("0x"===u)return{data:void 0};return{data:u}}catch(a){if(z?.signal?.aborted)throw(0,d.TY)(z.signal);if((0,d.zf)(a))throw a;let n=function(e){if(!(e instanceof l.C))return;let t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(a),{offchainLookup:i,offchainLookupSignature:s}=await r.e(6353).then(r.bind(r,46353));if(!1!==e.ccipRead&&n?.slice(0,10)===s&&q)return{data:await i(e,{data:n,requestOptions:z,to:q})};if(Y&&n?.slice(0,10)==="0x101bb98d")throw new u.Po({factory:R});throw(0,b.d)(a,{...t,account:V,chain:e.chain})}}let I=0,C=new WeakMap;async function S(e,t){let{batchSize:r=1024,deployless:n=!1,wait:i=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockHash:s,blockNumber:l,blockTag:c=e.experimental_blockTag??"latest",requireCanonical:d,data:h,multicallAddress:y,requestOptions:g,rpcStateOverride:b,to:w}=t,v=void 0!==y?y:P(e,{blockNumber:l,deployless:n}),_=(0,m.O)({blockHash:s,blockNumber:l,blockTag:c,requireCanonical:d}),E="string"==typeof _?_:JSON.stringify(_),A=b?`.${JSON.stringify(b)}`:"",{schedule:S}=(0,x.u)({id:`${e.uid}.${E}.${function(e){if(!e)return"default";let t=C.get(e);if(void 0!==t)return t;let r=I++;return C.set(e,r),r}(g)}${A}`,wait:i,shouldSplitBatch:e=>e.reduce((e,{data:t})=>e+(t.length-2),0)>2*r,fn:async t=>{let r=t.map(e=>
195({allowFailure:!0,callData:e.data,target:e.to})),n=(0,p.p)({abi:a.v2,args:[r],functionName:"aggregate3"}),i={...null===v?{data:$({code:o.Ez,data:n})}:{to:v,data:n}},s=await e.request({method:"eth_call",params:b?[i,_,b]:[i,_]},g);return(0,f.e)({abi:a.v2,args:[r],functionName:"aggregate3",data:s||"0x"})}}),[{returnData:k,success:T}]=await S({data:h,to:w});if(!T)throw new u.$S({data:k});return"0x"===k?{data:void 0}:{data:k}}function P(e,t){let{blockNumber:r,deployless:n}=t;if(n)return null;if(e.chain)return(0,g.M)({blockNumber:r,chain:e.chain,contract:"multicall3"});throw new c.YE}function $(e){let{code:t,data:r}=e;return(0,h.m)({abi:(0,n.U)(["constructor(bytes, bytes)"]),bytecode:o.LX,args:[t,r]})}},37503:(e,t,r)=>{"use strict";r.d(t,{M:()=>c,u:()=>u});var n=r(26514),i=r(75834),s=r(40175),a=r(86253);function o({src:e,...t}){return(0,n.jsx)("img",{src:e,...t,style:{display:"none"}})}let l=(0,i.createContext)({currentScreen:null,lastScreen:null,navigate:a.n,navigateBack:a.n,resetNavigation:a.n,setModalData:a.n,onUserCloseViaDialogOrKeybindRef:void 0}),c=e=>{let t=(0,s.u)(),[r,a]=(0,i.useState)(e.initialScreen),c=(0,i.useRef)(null);(0,i.useEffect)(()=>{e.open||(c.current=null)},[e.open]),(0,i.useEffect)(()=>{c.current=null},[e.initialScreen]);let u={data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:r,navigate:(t,r=!0)=>{e.setInitialScreen(t),r&&a(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(r)},resetNavigation:()=>{e.setInitialScreen(null),a(null)},onUserCloseViaDialogOrKeybindRef:c};return(0,n.jsxs)(l.Provider,{value:u,children:[("string"==typeof t.appearance.logo||"img"===t.appearance.logo?.type)&&(0,n.jsx)(o,{src:"string"==typeof t.appearance.logo?t.appearance.logo:t.a
195ppearance.logo.props.src}),e.children]})},u=()=>(0,i.useContext)(l)},37716:(e,t,r)=>{"use strict";r.d(t,{L1:()=>f,VN:()=>p,W$:()=>u,_r:()=>l,iz:()=>c,kY:()=>a,rt:()=>h});var n=r(2939),i=r(44037);let s={0:"legacy",1:"eip2930",2:"eip1559",3:"eip4844",4:"eip7702"},a={legacy:0,eip2930:1,eip1559:2,eip4844:3,eip7702:4},o=e=>void 0===e?void 0:BigInt(e);function l(e){let{type:t=2,authorizationList:r,...a}="string"==typeof e?JSON.parse(e):e,l;a.accessList&&Array.isArray(a.accessList)?l=a.accessList.map(e=>Array.isArray(e)?{address:e[0],storageKeys:e[1]}:e):a.accessList&&(l=Object.entries(a.accessList).map(e=>({address:e[0],storageKeys:e[1]})));let c=Number(a.chainId??1),u=(0,n.q)(a.data)?a.data:a.data?(0,i.nj)(Uint8Array.from(a.data)):void 0,d=a.nonce?Number(a.nonce):void 0,f={chainId:c,data:u,nonce:d,value:o(a.value),gas:o(a.gas??a.gasLimit)},h=Number(t);if(0===h)return{...a,type:s[h],...f,gasPrice:o(a.gasPrice),accessList:void 0,maxFeePerGas:void 0,maxPriorityFeePerGas:void 0};if(1===h)return{...a,type:s[h],...f,gasPrice:o(a.gasPrice),accessList:l,maxFeePerGas:void 0,maxPriorityFeePerGas:void 0};if(2===h)return{...a,type:s[h],...f,nonce:d,accessList:l,maxFeePerGas:o(a.maxFeePerGas),maxPriorityFeePerGas:o(a.maxPriorityFeePerGas),gasPrice:void 0,maxFeePerBlobGas:void 0};if(4===h){let e=(r??[]).map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:e.yParity??(void 0===e.v?0:Number(e.v)-27)}));return{...a,type:s[h],...f,nonce:d,accessList:l,maxFeePerGas:o(a.maxFeePerGas),maxPriorityFeePerGas:o(a.maxPriorityFeePerGas),authorizationList:e,gasPrice:void 0,maxFeePerBlobGas:void 0}}throw Error(`Unsupported transaction type: ${t}`)}let c=118,u="tempo",d=(e,t)=>{if(void 0===e)return;let r=Number(e);if(!Number.isSafeInteger(r)||r<0)throw Error(`Invalid Tempo ${t}: ${String(e)}`);return r};function f(e){if(!e||"object"!=typeof e)return!1;let t=e.type;if(118!==t&&("string"!=typeof t||"tempo"!==t.toLowerCase()))return!1;let r=e.calls;return Array.isArray(r)&&r.length>0}function h(e){let t,r;if("string"==typeof e)try{t=JSON.parse(e)}catch(t){let e=t instanceof Error?t.message:String(t);throw Error(`Invalid Tempo transaction JSON: ${e}`)}else t=e;if(t.accessList&&Array.isArray(t.accessList)?r=t.accessList.map(e=>Array.isArray(e)?{address:e[0],storageKeys:e[1]}:e):t.accessList&&(r=Object.entries(t.accessList).map(e=>({address:e[0],storageKeys:e[1]}))),void 0===t.chainId||null===t.chainId)throw Error("Tempo transactions require a chainId");let n=Number(t.chainId);if(!Number.isSafeInteger(n)||n<=0)throw Error(`Invalid Tempo chainId: ${String(t.chainId)}`);let i=d(t.nonce,"nonce");if(!Array.isArray(t.calls)||0===t.calls.length)throw Error("Tempo transactions require at least one call");let s=t.calls.map(e=>({to:e.to,data:e.data,value:o(e.value)}));return{type:u,chainId:n,from:t.from,nonce:i,gas:o(t.gasLimit),maxFeePerGas:o(t.maxFeePerGas),maxPriorityFeePerGas:o(t.maxPriorityFeePerGas),calls:s,feeToken:t.feeToken,nonceKey:o(t.nonceKey),validBefore:d(t.validBefore,"validBefore"),validAfter:d(t.validAfter,"validAfter"),feePayerSignature:t.feePayerSignature,accessList:r}}function p(e,t){let{chain:r,gas:n,...i}=e;return{...i,...void 0!==n&&void 0===t?{gasLimit:n}:{}}}},37720:(e,t,r)=>{"use strict";r.d(t,{Ez:()=>a,LX:()=>n,WN:()=>i,fT:()=>s});let n="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",i="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de82602083
1950160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",s="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
195603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",a="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
195150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"},37888:(e,t,r)=>{"use strict";r.d(t,{Ao:()=>n});let n=2n**256n-1n},38112:(e,t,r)=>{"use strict";function n(e,{dir:t="left"}={}){let r="string"==typeof e?e.replace("0x",""):e,i=0;for(let e=0;e<r.length-1;e++)if("0"===r["left"===t?e:r.length-e-1].toString())i++;else break;
vendor: 7,756 bytes, line 195
195return(r="left"===t?r.slice(i):r.slice(0,r.length-i),"string"==typeof e)?(1===r.length&&"right"===t&&(r=`${r}0`),`0x${r.length%2==1?`0${r}`:r}`):r}r.d(t,{B:()=>n})},38272:(e,t,r)=>{"use strict";function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)"__proto__"!==n&&(e[n]=r[n])}return e}r.d(t,{A:()=>i});var i=function e(t,r){function i(e,i,s){if("undefined"!=typeof document){"number"==typeof(s=n({},r,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var o in s)s[o]&&(a+="; "+o,!0!==s[o]&&(a+="="+s[o].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+a}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},i=0;i<r.length;i++){var s=r[i].split("="),a=s.slice(1).join("=");try{var o=decodeURIComponent(s[0]);if(o in n||(n[o]=t.read(a,o)),e===o)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){i(e,"",n({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,n({},this.attributes,t))},withConverter:function(t){return e(n({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})},38352:(e,t,r)=>{"use strict";r.d(t,{VH:()=>c,li:()=>l});var n=r(66277),i=r(66776),s=r(12414);class a extends s.H{constructor(e){super()}}let o=i.FIVE_SECONDS,l={pulse:"heartbeat_pulse"};class c extends a{constructor(e){super(e),this.events=new n.EventEmitter,this.interval=o,this.interval=e?.interval||o}static async init(e){let t=new c(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,i.toMiliseconds)(this.interval))}pulse(){this.events.emit(l.pulse)}}},38417:(e,t,r)=>{"use strict";r.d(t,{So:()=>o,sc:()=>l,tf:()=>c});var n=r(11577),i=r(43793),s=r(21332),a=r(62610);function o(e,t={}){let{as:r="string"==typeof e?"Hex":"Bytes"}=t,i=(0,n.lY)(s.HT(e));return"Bytes"===r?i:a.uK(i)}function l(e,t={}){let{as:r="string"==typeof e?"Hex":"Bytes"}=t,n=(0,i.sc)(s.HT(e));return"Bytes"===r?n:a.uK(n)}function c(e){return a.tf(e)&&32===a.Ej(e)}},38519:(e,t,r)=>{"use strict";r.d(t,{j:()=>l});var n=r(45897),i=r(15520),s=r(48241),a=r(39534),o=r(69064);function l(e,{abi:t,address:r,args:l,docsPath:c,functionName:u,sender:d}){let f=e instanceof s.$S?e:e instanceof i.C?e.walk(e=>"data"in e)||e.walk():{},{code:h,data:p,details:y,message:m,shortMessage:g}=f,b=e instanceof n.O?new s.rR({functionName:u,cause:e}):[3,o.bq.code].includes(h)&&(p||y||m||g)||h===o.Di.code&&"execution reverted"===y&&p?new s.M({abi:t,data:"object"==typeof p?p.data:p,functionName:u,message:f instanceof a.J8?y:g??m,cause:e}):e;return new s.bG(b,{abi:t,args:l,contractAddress:r,docsPath:c,functionName:u,sender:d})}},38619:(e,t,r)=>{"use strict";r.d(t,{UG:()=>a,xo:()=>i,zz:()=>s});var n=r(3832);class i extends n.C{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class s extends n.C{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class a extends n.C{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}},39345:(e,t,r)=>{"use strict";r.d(t,{l:()=>s});var n=r(29021);let i={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new n.hX({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new n.SK({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new n.B4({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new n.B4({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===1/0)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function s(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(i);return r.bytes=e,r.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}},39534:(e,t,r)=>{"use strict";r.d(t,{Ci:()=>a,J8:()=>l,MU:()=>c,f:()=>o});var n=r(97314),i=r(15520),s=r(86326);class a extends i.C{constructor({body:e,cause:t,details:r,headers:i,status:a,url:o}){super("HTTP request failed.",{cause:t,details:r,metaMessages:[a&&`Status: ${a}`,`URL: ${(0,s.ID)(o)}`,e&&`Request body: ${(0,n.A)(e)}
195`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=a,this.url=o}}class o extends i.C{constructor({maxSize:e,size:t}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${e} bytes`,`Received: ${t} bytes`],name:"ResponseBodyTooLargeError"}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e,this.size=t}}i.C;class l extends i.C{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${(0,s.ID)(r)}`,`Request body: ${(0,n.A)(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.data=t.data,this.url=r}}i.C;class c extends i.C{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,s.ID)(t)}`,`Request body: ${(0,n.A)(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=t}}},39613:(e,t,r)=>{"use strict";r.d(t,{e:()=>d});var n=r(48441),i=r(25586),s=r(57168),a=r(11177),o=r(54057);class l extends o.C{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}var c=r(97),u=r(68229);function d(e){let t={},r=e.length;for(let n=0;n<r;n++){let r=e[n];if(!(0,c.WL)(r))continue;let i=(0,c.FO)(r);if(!i)throw new a.s7({signature:r,type:"struct"});let s=i.properties.split(";"),o=[],l=s.length;for(let e=0;e<l;e++){let t=s[e].trim();if(!t)continue;let r=(0,u.Pj)(t,{type:"struct"});o.push(r)}if(!o.length)throw new a.X9({signature:r});t[i.name]=o}let o={},d=Object.entries(t),h=d.length;for(let e=0;e<h;e++){let[r,a]=d[e];o[r]=function e(t=[],r={},a=new Set){let o=[],c=t.length;for(let d=0;d<c;d++){let c=t[d];if(n.wj.test(c.type))o.push(c);else{let t=(0,n.Yv)(f,c.type);if(!t?.type)throw new s.nx({abiParameter:c});let{array:d,type:h}=t;if(h in r){if(a.has(h))throw new l({type:h});o.push({...c,type:`tuple${d??""}`,components:e(r[h],r,new Set([...a,h]))})}else if((0,u._o)(h))o.push(c);else throw new i.zz({type:h})}}return o}(a,t)}return o}let f=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/},39633:(e,t,r)=>{"use strict";let n;r.d(t,{L:()=>s});let i=256;function s(e=11){if(!n||i+e>512){n="",i=0;for(let e=0;e<256;e++)n+=(256+256*Math.random()|0).toString(16).substring(1)}return n.substring(i,i+++e)}},40175:(e,t,r)=>{"use strict";r.d(t,{A:()=>Y,C:()=>$,D:()=>o,H:()=>C,I:()=>b,M:()=>B,O:()=>S,P:()=>ee,R:()=>y,S:()=>A,V:()=>f,W:()=>N,a:()=>er,b:()=>en,c:()=>x,d:()=>h,e:()=>E,f:()=>I,g:()=>_,h:()=>g,i:()=>v,j:()=>U,k:()=>p,l:()=>m,m:()=>w,n:()=>l,o:()=>k,p:()=>P,q:()=>O,r:()=>c,s:()=>u,t:()=>T,u:()=>et,v:()=>d,w:()=>R,x:()=>M,y:()=>D});var n=r(26514),i=r(75834),s=r(43489),a=r(66239);let o="https://auth.privy.io",l=2e4,c=1400,u=2500,d=4e3,f="3.36.1",h="privy:token",p="privy-token",y="privy:refresh_token",m="privy-refresh-token",g="privy:pat",b="privy:id_token",w="privy-id-token",v="privy-session",x="privy:caid",_=e=>`privy:guest:${e}`,E=e=>`privy:cross-app:${e}`,A="privy:state_code",I="privy:code_verifier",C="privy:headless_oauth",S="privy:oauth_disable_signup",P=e=>`privy:wallet:${e}`,$="privy:connections",k=12e4,T=1,O="0x1",N=3e4,R="https://api.moonpay.com/v1",B="https://api.moonpay.com/v1",D="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",M="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",U="deprecated",j={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","robinhood_wallet","base_account","wallet_connect","phantom"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}},L=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","jupiter","binance","binanceus","bitget_wallet","kraken_wallet","robinhood_wallet"]),F=e=>L.has(e),z=(e,t,r)=>r.indexOf(e)===t,q=/paymaster\.biconomy\.io\/api/i,W={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}};function H(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,a.A)({...e.toHsl(),l:r})}function K(e,t){let r=e.getLuminance(),n=t.getLuminance();return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}let V={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#
195EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},G={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}},J=["sms","totp","passkey"],Y=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","crypto.com_wallet_extension","crypto.com_onchain","binance","bitget_wallet","coinbase_wallet","coinbase_smart_wallet","base_account","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitget_wallet","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","privy","unknown","phantom","solflare","glow","backpack","jupiter","mobile_wallet_adapter"];function Z(e,t,r,n,i){let o,l,c,u,d,f,h,p,y,m,g,b,w,v,x,_,E,A,I=r?console.warn:()=>{},C=[];if(t?.loginMethods)for(let e of(o=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),u=t.loginMethods.includes("wallet"),d=t.loginMethods.includes("google"),f=t.loginMethods.includes("twitter"),h=t.loginMethods.includes("discord"),g=t.loginMethods.includes("spotify"),b=t.loginMethods.includes("instagram"),p=t.loginMethods.includes("tiktok"),y=t.loginMethods.includes("line"),m=t.loginMethods.includes("twitch"),v=t.loginMethods.includes("github"),w=t.loginMethods.includes("linkedin"),x=t.loginMethods.includes("apple"),_=t.loginMethods.includes("farcaster"),E=t.loginMethods.includes("telegram"),c=t.loginMethods.includes("passkey"),t.loginMethods))"string"==typeof e&&e.startsWith("privy:")&&C.push(e);else o=e.email_auth,l=e.sms_auth,u=e.wallet_auth||e.solana_wallet_auth,d=e.google_oauth,f=e.twitter_oauth,h=e.discord_oauth,v=e.github_oauth,g=e.spotify_oauth,b=e.instagram_oauth,p=e.tiktok_oauth,y=e.line_oauth,m=e.twitch_oauth,w=e.linkedin_oauth,x=e.apple_oauth,_=e.farcaster_auth,E=e.telegram_auth||e.telegram_oauth,c=e.passkey_auth,A=e.custom_jwt_auth;e.passkey_auth&&(c=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(c=!1);let S=[o,l].filter(Boolean),P=[d,f,h,v,g,b,p,y,m,w,x,_,E].filter(Boolean),$=[u].filter(Boolean),k=t?.loginMethods?.includes("passkey")??!1,T=e.passkeys_for_signup_enabled??!1,O=[c&&(T||k)].filter(
195Boolean),N=[A].filter(Boolean);if(S.length+P.length+$.length+O.length+N.length+C.length===0)throw Error("You must enable at least one login method");let R=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.show_wallet_login_first;R&&0===$.length?(I("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),R=!1):R||P.length+S.length!==0||(I("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),R=!0);let B=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&I("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let D=(({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(F).filter(z):e?e.filter(F).filter(z):j.appearance.walletList)({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder});if((D.includes("wallet_connect_qr")||D.includes("wallet_connect"))&&D.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in walletList due to WalletConnect session conflicts.");let M=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let n of e.overflow??[])t.includes(n)||r.includes(n)?console.warn(`Duplicated login method: ${n}`):r.push(n);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),U=t?.intl?.defaultCountry??"US",{chains:L,defaultChain:Y}=function({supportedChains:e,defaultChainFromConfig:t}){let r;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");r=(0,s._h)(e)}else r=[...s.mf];let n=e?r[0]:s.rC,i=t??n;if(!r.find(e=>e.id===i.id))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:r,defaultChain:i}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),Z=!!t?.defaultChain,Q=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,X=Q?"all-users":e.embedded_wallet_config.ethereum.create_on_login,ee=e.embedded_wallet_config.solana.create_on_login;e.solana_wallet_auth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let et=e.telegram_auth_config?{botId:e.telegram_auth_config.bot_id,botName:e.telegram_auth_config.bot_name,linkEnabled:e.telegram_auth_config.link_enabled,seamlessAuthEnabled:e.telegram_auth_config.seamless_auth_enabled}:void 0,er=e.funding_config?{methods:e.funding_config.methods,options:e.funding_config.options,defaultRecommendedAmount:e.funding_config.default_recommended_amount,defaultRecommendedCurrency:e.funding_config.default_recommended_currency,promptFundingOnWalletCreation:e.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:e.funding_config.cross_chain_bridging_enabled}:void 0,en=e.smart_wallet_config;return{id:e.id,appClientId:i,name:e.name,scriptNonce:t?.scriptNonce,allowlistConfig:{errorTitle:e.allowlist_config.error_title,errorDetail:e.allowlist_config.error_detail,errorCtaText:e.allowlist_config.cta_text,errorCtaLink:e.allowlist_config.cta_link},legacyWalletUiConfig:e.legacy_wallet_ui_config,appearance:{logo:t?.appearance?.logo??e.logo_url??void 0,emailDomain:t?.appearance?.emailDomain,landingHeader:t?.appearance?.landingHeader??j.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:function({backgroundTheme:e,accentHex:t}){let r,n,i,s,o,l,c;"light"===e?r=!1:"dark"===e?r=!0:(r=.5>=(0,a.A)(e).getLuminance(),n=(0,a.A)(e).toHslString());let u=r?"dark":"light",d=r?V:G,{accent:f,accentLight:h,accentHover:p,accentDark:y,accentDarkest:m}=function(e,t){if(!e){let e=t?V:G;return{accent:(0,a.A)(e.background.interactive),accentLight:(0,a.A)(e.background.interactive),accentHover:(0,a.A)(e.background["interactive-hover"]),accentDark:(0,a.A)(e.background["interactive-clicked"]),accentDarkest:(0,a.A)(e.background["interactive-disabled"])}}let r=(0,a.A)(e);return{accent:r,accentLight:H(r,.15),accentHover:H(r,.3),accentDark:H(r,-.06),accentDarkest:H(r,-.6)}}(t,r),g=(i=(0,a.A)(G.text.default),s=(0,a.A)(V.text.default),o=K(f,i),l=K(f,s),(c=f.toHsl()).h>=220&&c.h<=300&&l>=3?V.text.default:o>l?G.text.default:V.text.default),b=(0,a.A)(g),w=K(f,(0,a.A)(d.background.default))>=3;return{colorScheme:u,background:n||d.background.default,background2:d.background.elevated,background3:d.background.interactive,foreground:d.text.default,foreground2:d.text.muted,foreground3:d.text.placeholder,foreground4:d.border.default,accent:f.toHslString(),accentLight:h.toHslString(),accentHover:p.toHslString(),accentDark:y.toHslString(),accentDarkest:m.toHslString(),foregroundAccent:b.toHslString(),success:d.background.success,successDark:d.text.success,successLight:d.background.success,error:d.text.error,errorLight:d.background.error,warn:d.background.warning,warnLight:d.background.warning,warningDark:d.text.
195warning,errorDark:d.text.error,successBg:d.background.success,errorBg:d.background.error,errorBgHover:d.background["error-hover"],warnBg:d.background.warning,infoBg:d.background.info,infoBgHover:d.background["info-hover"],borderDefault:d.border.default,borderHover:d.border["default-hover"],borderFocus:d.border.focused,borderError:d.border.error,borderSuccess:d.border.success,borderWarning:d.border.warning,borderInfo:d.border.info,borderInteractive:d.border.interactive,borderInteractiveHover:d.border["interactive-hover"],backgroundHover:d.background["default-hover"],backgroundClicked:d.background["default-clicked"],backgroundDisabled:d.background["default-disabled"],backgroundInteractive:d.background.interactive,backgroundInteractiveHover:d.background["interactive-hover"],backgroundInteractiveClicked:d.background["interactive-clicked"],backgroundInteractiveDisabled:d.background["interactive-disabled"],foregroundHover:d.text.default,foregroundClicked:d.text.default,foregroundDisabled:d.text["default-disabled"],foregroundInteractive:d.text.interactive,foregroundInteractiveHover:d.text["interactive-hover"],accentHasGoodContrast:w?"1":"0",linkNavigationColor:w?f.toHslString():d.text.default,linkNavigationDecoration:w?"none":"underline",iconDefault:d.icon.default,iconMuted:d.icon.muted,iconSubtle:d.icon.subtle,iconInverse:d.icon.inverse,iconSuccess:d.icon.success,iconWarning:d.icon.warning,iconError:d.icon.error,iconInteractive:d.icon.interactive,iconDefaultHover:d.icon["default-hover"],iconMutedHover:d.icon["muted-hover"],iconSubtleHover:d.icon["subtle-hover"],iconDefaultClicked:d.icon["default-clicked"],iconMutedClicked:d.icon["muted-clicked"],iconSubtleClicked:d.icon["subtle-clicked"],iconDefaultDisabled:d.icon["default-disabled"],iconMutedDisabled:d.icon["muted-disabled"],iconSubtleDisabled:d.icon["subtle-disabled"],iconErrorHover:d.icon["error-hover"],iconInteractiveHover:d.icon["interactive-hover"],iconErrorClicked:d.icon["error-clicked"],iconInteractiveClicked:d.icon["interactive-clicked"],iconMutedDisabledAlt:d.icon["muted-disabled"],iconSubtleDisabledAlt:d.icon["subtle-disabled"]}}({backgroundTheme:t?.appearance?.theme??j.appearance.theme,accentHex:t?.appearance?.accentColor??e.accent_color}),loginGroupPriority:R?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:D,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.wallet_auth??!1,solanaWalletAuth:e.solana_wallet_auth??!1})},loginMethods:{wallet:u,email:o,sms:l,passkey:c,google:d,twitter:f,discord:h,github:v,spotify:g,instagram:b,tiktok:p,line:y,twitch:m,linkedin:w,apple:x,farcaster:_,telegram:E},globalDisablePasskeys:t?.globalDisablePasskeys??!1,customOAuthProviders:(e.custom_oauth_providers??[]).filter(e=>!1!==e.enabled),crossAppProviders:C,disablePlusEmails:e.disable_plus_emails,loginMethodsAndOrder:M,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.terms_and_conditions_url,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacy_policy_url,requireUsersAcceptTerms:e.require_users_accept_terms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.wallet_connect_cloud_project_id??j.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:t?.externalWallets?.signatureRequestTimeouts??{}},chains:L,defaultChain:Y,intl:{defaultCountry:U,textLocalization:t?.intl?.textLocalization},shouldEnforceDefaultChainOnConnect:Z,captcha:{enabledProvider:e.enabled_captcha_provider??null,siteKey:e.captcha_site_key},externalWallets:{coinbaseWallet:{config:{appName:e.name,appLogoUrl:e.logo_url,preference:{options:"all",...t?.externalWallets?.coinbaseWallet?.config?.preference},...t?.externalWallets?.coinbaseWallet?.config}},baseAccount:{config:{appName:e.name,appLogoUrl:e.logo_url,...t?.externalWallets?.baseAccount?.config,preference:{...t?.externalWallets?.baseAccount?.config?.preference,telemetry:!1}}},walletConnect:{enabled:B},solana:{connectors:t?.externalWallets?.solana?.connectors},disableAllExternalWallets:t?.externalWallets?.disableAllExternalWallets??!1},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!Q&&(e.embedded_wallet_config.require_user_owned_recovery_on_create??!1),userOwnedRecoveryOptions:Q?["user-passcode"]:e.embedded_wallet_config.user_owned_recovery_options,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:t?.embeddedWallets?.ethereum?.createOnLogin??X},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??ee},disableAutomaticMigration:t?.embeddedWallets?.disableAutomaticMigration??!1,mode:e.embedded_wallet_config.mode,showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforce_wallet_uis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??n??"https://auth.privy.io"}},mfa:{methods:(e.mfa_methods??[]).filter(e=>
195J.includes(e)),noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink,registration:t?.passkeys?.registration},customAuth:Q?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:et,telegramHasHmacCredentials:!!e.telegram_auth,telegramSeamlessAuthEnabled:!!e.telegram_seamless_auth_enabled,passkeysForSignupEnabled:e.passkeys_for_signup_enabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??j._render.standalone},fundingConfig:er,fundingMethodConfig:{...t?.fundingMethodConfig??j.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??j.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??j.fundingMethodConfig.moonpay.useSandbox}},whatsAppEnabled:!!e.whatsapp_enabled,customOAuthRedirectUrl:t?.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:t?.allowOAuthInEmbeddedBrowsers??!1,solanaRpcs:{"solana:mainnet":t?.solana?.rpcs?.["solana:mainnet"]??null,"solana:devnet":t?.solana?.rpcs?.["solana:devnet"]??null,"solana:testnet":t?.solana?.rpcs?.["solana:testnet"]??null},smartWallets:en?.enabled?{enabled:en.enabled,smartWalletVersion:en.smart_wallet_version,smartWalletType:en.smart_wallet_type,configuredNetworks:en.configured_networks.map(e=>{let t,r;return{chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url,paymasterContext:(t=e.paymaster_url,r=e.paymaster_context,t&&q.test(t)?W:r&&r.policy_id?{policyId:r.policy_id}:void 0)}})}:{enabled:en?.enabled??!1},connectorsDebugLogs:t?.connectorsDebugLogs??!1}}let Q={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1},X=(0,i.createContext)({appConfig:Z(Q,void 0,!1),isServerConfigLoaded:!1,initializationError:null,setInitializationError:()=>{}}),ee=({children:e,client:t,legacyClient:r,clientConfig:s,appClientId:a})=>{let[o,l]=(0,i.useState)(null),[c,u]=(0,i.useState)(null),d=(0,i.useMemo)(()=>Z(o??Q,s,!!o,"undefined"!=typeof window?window.location.origin:void 0,a),[o,s,a]);return(0,i.useEffect)(()=>{if(!o)return;let e=function(e){if(!e)return{};let{appearance:t,scriptNonce:r,supportedChains:n,defaultChain:i,externalWallets:s,...a}=e;return{...a,...n?{supportedChains:n.map(e=>e.id)}:void 0,...i?{defaultChain:i.id}:void 0,...s?{walletConnect:s.walletConnect?{enabled:s.walletConnect.enabled}
195:void 0,coinbaseWallet:s.coinbaseWallet,solana:{connectors:s.solana?.connectors?.get().map(e=>e.walletClientType)}}:void 0}}(s),t=(function(e,t=0){let r=0xdeadbeef^t,n=0x41c6ce57^t;for(let t,i=0;i<e.length;i++)r=Math.imul(r^(t=e.charCodeAt(i)),0x9e3779b1),n=Math.imul(n^t,0x5f356495);return r=Math.imul(r^r>>>16,0x85ebca6b)^Math.imul(n^n>>>13,0xc2b2ae35),0x100000000*(2097151&(n=Math.imul(n^n>>>16,0x85ebca6b)^Math.imul(r^r>>>13,0xc2b2ae35)))+(r>>>0)})(JSON.stringify(e)).toString(),n=`privy:sent:${o.id}:${t}`;localStorage.getItem(n)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(n,"t"))},[s,o]),(0,i.useEffect)(()=>{o||(async()=>{try{await t.initialize();let e=t.app.getConfig();e.custom_api_url&&r.updateApiUrl(e.custom_api_url),l(e)}catch(t){let e=t instanceof Error?t:Error(String(t));u(e),console.warn("Error generating app config: ",e)}})()},[]),(0,n.jsx)(X.Provider,{value:{appConfig:d,isServerConfigLoaded:!!o,initializationError:c,setInitializationError:u},children:e})},et=()=>{let{appConfig:e}=(0,i.useContext)(X);return e},er=()=>{let{isServerConfigLoaded:e}=(0,i.useContext)(X);return e},en=()=>{let{initializationError:e,setInitializationError:t}=(0,i.useContext)(X);return{initializationError:e,setInitializationError:t}}},40198:(e,t,r)=>{"use strict";r.d(t,{PK:()=>l,iq:()=>s,uP:()=>o,zF:()=>a});var n=r(81505),i=r(15520);class s extends i.C{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`],name:"BlobSizeTooLargeError"})}}class a extends i.C{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class o extends i.C{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`],name:"InvalidVersionedHashSizeError"})}}class l extends i.C{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${n.E}`,`Received: ${t}`],name:"InvalidVersionedHashVersionError"})}}},40407:(e,t,r)=>{"use strict";r.d(t,{e:()=>o});var n=r(74263),i=r(86380),s=r(99453);let a="/docs/contract/decodeFunctionResult";function o(e){let{abi:t,args:r,functionName:o,data:l}=e,c=t[0];if(o){let e=(0,s.iY)({abi:t,args:r,name:o});if(!e)throw new n.Iz(o,{docsPath:a});c=e}if("function"!==c.type)throw new n.Iz(void 0,{docsPath:a});if(!c.outputs)throw new n.MR(c.name,{docsPath:a});let u=(0,i.n)(c.outputs,l);return u&&u.length>1?u:u&&1===u.length?u[0]:void 0}},40508:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(e,t,r)=>JSON.stringify(e,(e,r)=>{let n="bigint"==typeof r?r.toString():r;return"function"==typeof t?t(e,n):n},r)},40852:(e,t,r)=>{"use strict";r.d(t,{e:()=>function e(){let t=[],r={addEventListener:(e,t,n,i)=>(e.addEventListener(t,n,i),r.add(()=>e.removeEventListener(t,n,i))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add(()=>cancelAnimationFrame(t))},nextFrame:(...e)=>r.requestAnimationFrame(()=>r.requestAnimationFrame(...e)),setTimeout(...e){let t=setTimeout(...e);return r.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return(0,n._)(()=>{t.current&&e[0]()}),r.add(()=>{t.current=!1})},style(e,t,r){let n=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:r}),this.add(()=>{Object.assign(e.style,{[t]:n})})},group(t){let r=e();return t(r),this.add(()=>r.dispose())},add:e=>(t.includes(e)||t.push(e),()=>{let r=t.indexOf(e);if(r>=0)for(let e of t.splice(r,1))e()}),dispose(){for(let e of t.splice(0))e()}};return r}});var n=r(78615)},40857:(e,t,r)=>{"use strict";r.d(t,{T:()=>i});var n=r(5596);async function i(e){let t=await e.request({method:"eth_chainId"},{dedupe:!0});return(0,n.ME)(t)}},40896:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,s=l(e),a=s[0],o=s[1],c=new i((a+o)*3/4-o),u=0,d=o>0?a-4:a;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],a=0,o=n-i;a<o;a+=16383)s.push(function(e,t,n){for(var i,s=[],a=t;a<n;a+=3)i=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}(e,a,a+16383>o?o:a+16383));return 1===i?s.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&s.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
195+/",a=0,o=s.length;a<o;++a)r[a]=s[a],n[s.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},40917:(e,t,r)=>{"use strict";r.d(t,{GP:()=>i,HT:()=>o,Q_:()=>a,Xq:()=>l,ck:()=>s});let n={wei:0,gwei:9,szabo:12,finney:15,ether:18};function i(e,t=0){if(!Number.isInteger(t)||t<0)throw new u({decimals:t});let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1));let[s,a]=[(r=r.padStart(t,"0")).slice(0,r.length-t),r.slice(r.length-t)];return a=a.replace(/(0+)$/,""),`${n?"-":""}${s||"0"}${a?`.${a}`:""}`}function s(e,t="wei"){return i(e,n.ether-n[t])}function a(e,t="wei"){return i(e,n.gwei-n[t])}function o(e,t=0){if(!Number.isInteger(t)||t<0)throw new u({decimals:t});if(!/^-?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)$/.test(e))throw new c({value:e});let[r="",n="0"]=e.split("."),i=r.startsWith("-");if(i&&(r=r.slice(1)),""===r&&(r="0"),n=n.replace(/(0+)$/,""),0===t)n.length>0&&Number.parseInt(n[0],10)>=5&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>t){let e=n.slice(0,t);if(Number.parseInt(n.slice(t,t+1),10)>=5){let i=function(e){let t=e.split(""),r=t.length-1;for(;r>=0;){let e=Number.parseInt(t[r],10)+1;if(e<10)return t[r]=String(e),t.join("");t[r]="0",r--}return`1${t.join("")}`}(e);i.length>t?(n=i.slice(1),r=`${BigInt(r)+1n}`):n=i}else n=e}else n=n.padEnd(t,"0");return BigInt(`${i?"-":""}${r}${n}`)}function l(e,t="wei"){return o(e,n.ether-n[t])}class c extends Error{constructor({value:e}){super(`Value \`${e}\` is not a valid decimal number.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalNumberError"})}}class u extends Error{constructor({decimals:e}){super(`\`decimals\` must be a non-negative integer. Got \`${e}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalsError"})}}},41356:(e,t,r)=>{"use strict";r.d(t,{BD:()=>n,Ge:()=>i});let n=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,i=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/},41537:(e,t,r)=>{"use strict";r.d(t,{x:()=>a});var n=r(68145),i=r(651),s=r(20347);async function a(e,{blockHash:t,blockNumber:r,blockTag:a,hash:o,index:l,sender:c,nonce:u}){let d=a||"latest",f=void 0!==r?(0,i.cK)(r):void 0,h=null;if(o?h=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?h=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,(0,i.cK)(l)]},{dedupe:!0}):(f||d)&&"number"==typeof l?h=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[f||d,(0,i.cK)(l)]},{dedupe:!!f}):c&&"number"==typeof u&&(h=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[c,(0,i.cK)(u)]},{dedupe:!0})),!h)throw new n.Kz({blockHash:t,blockNumber:r,blockTag:d,hash:o,index:l});return(e.chain?.formatters?.transaction?.format||s.uP)(h,"getTransaction")}},41726:(e,t,r)=>{"use strict";r.d(t,{p:()=>c});var n=r(72334),i=r(36665),s=r(86665),a=r(3303),o=r(73142),l=r(25728);function c(e){let{abi:t,args:r,logs:c,strict:u=!0}=e,d=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),f=t.filter(e=>"event"===e.type).map(e=>({abi:e,selector:(0,o.h)(e)}));return c.map(e=>{let t,o,c="string"==typeof e.blockNumber?(0,s.e)(e):e,h=f.filter(e=>c.topics[0]===e.selector);if(0===h.length)return null;for(let e of h)try{t=(0,l.j)({...c,abi:[e.abi],strict:!0}),o=e;break}catch{}if(!t&&!u){o=h[0];try{t=(0,l.j)({data:c.data,topics:c.topics,abi:[o.abi],strict:!1})}catch{let e=o.abi.inputs?.some(e=>!("name"in e&&e.name));return{...c,args:e?[]:{},eventName:o.abi.name}}}return t&&o&&(!d||d.includes(t.eventName))&&function(e){let{args:t,inputs:r,matchArgs:s}=e;if(!s)return!0;if(!t)return!1;function o(e,t,r){try{if("address"===e.type)return(0,n.h)(t,r);if("string"===e.type||"bytes"===e.type)return(0,a.S)((0,i.ZJ)(t))===r;return t===r}catch{return!1}}return Array.isArray(t)&&Array.isArray(s)?s.every((e,n)=>{if(null==e)return!0;let i=r[n];return!!i&&(Array.isArray(e)?e:[e]).some(e=>o(i,e,t[n]))}):!("object"!=typeof t||Array.isArray(t)||"object"!=typeof s||Array.isArray(s))&&Object.entries(s).every(([e,n])=>{if(null==n)return!0;let i=r.find(t=>t.name===e);return!!i&&(Array.isArray(n)?n:[n]).some(r=>o(i,r,t[e]))})}({args:t.args,inputs:o.abi.inputs,matchArgs:r})?{...t,...c}:null}
195).filter(Boolean)}},42053:(e,t,r)=>{"use strict";r.d(t,{N:()=>c,b:()=>l});var n=r(68305),i=r(5596),s=r(29447),a=r(32560),o=r(82497);async function l(e,t){return c(e,t)}async function c(e,t){let{block:r,chain:l=e.chain,request:c}=t||{};try{let t=l?.fees?.maxPriorityFeePerGas??l?.fees?.defaultPriorityFee;if("function"==typeof t){let n=r||await (0,s.T)(e,a.g,"getBlock")({}),i=await t({block:n,client:e,request:c});if(null===i)throw Error();return i}if(void 0!==t)return t;let n=await e.request({method:"eth_maxPriorityFeePerGas"});return(0,i.uU)(n)}catch{let[t,i]=await Promise.all([r?Promise.resolve(r):(0,s.T)(e,a.g,"getBlock")({}),(0,s.T)(e,o.L,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new n.pw;let l=i-t.baseFeePerGas;if(l<0n)return 0n;return l}}},42150:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(55642);function i(e,t){var r=Array.prototype.slice.call(t);return r.push(n.A),e.apply(this,r)}},42301:(e,t,r)=>{"use strict";r.d(t,{K:()=>d});var n=r(75834),i=r(53160),s=r(40852),a=r(36207),o=r(16234);function l(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let c=function(e,t){let r=e(),n=new Set;return{getSnapshot:()=>r,subscribe:e=>(n.add(e),()=>n.delete(e)),dispatch(e,...i){let s=t[e].call(r,...i);s&&(r=s,n.forEach(e=>e()))}}}(()=>new Map,{PUSH(e,t){var r;let n=null!=(r=this.get(e))?r:{doc:e,count:0,d:(0,s.e)(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=l(n.meta),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t),r.computedMeta=l(r.meta)),this},SCROLL_PREVENT(e){let t,r={doc:e.doc,d:e.d,meta:()=>e.computedMeta},n=[(0,o.un)()?{before({doc:e,d:t,meta:r}){function n(e){for(let t of r().containers)for(let r of t())if(r.contains(e))return!0;return!1}t.microTask(()=>{var r;if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let r=(0,s.e)();r.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>r.dispose()))}let i=null!=(r=window.scrollY)?r:window.pageYOffset,o=null;t.addEventListener(e,"click",t=>{if(a.Lk(t.target))try{let r=t.target.closest("a");if(!r)return;let{hash:i}=new URL(r.href),s=e.querySelector(i);a.Lk(s)&&!n(s)&&(o=s)}catch{}},!0),t.group(r=>{t.addEventListener(e,"touchstart",e=>{if(r.dispose(),a.Lk(e.target)&&a.pv(e.target))if(n(e.target)){let t=e.target;for(;t.parentElement&&n(t.parentElement);)t=t.parentElement;r.style(t,"overscrollBehavior","contain")}else r.style(e.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",e=>{if(a.Lk(e.target)&&!a.A3(e.target))if(n(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()},{passive:!1}),t.add(()=>{var e;i!==(null!=(e=window.scrollY)?e:window.pageYOffset)&&window.scrollTo(0,i),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{},{before({doc:e}){var r;let n=e.documentElement;t=Math.max(0,(null!=(r=e.defaultView)?r:window).innerWidth-n.clientWidth)},after({doc:e,d:r}){let n=e.documentElement,i=Math.max(0,n.clientWidth-n.offsetWidth),s=Math.max(0,t-i);r.style(n,"paddingRight",`${s}px`)}},{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];n.forEach(({before:e})=>null==e?void 0:e(r)),n.forEach(({after:e})=>null==e?void 0:e(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});c.subscribe(()=>{let e=c.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let e="hidden"===t.get(r.doc),n=0!==r.count;(n&&!e||!n&&e)&&c.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),0===r.count&&c.dispatch("TEARDOWN",r)}});var u=r(53986);function d(e,t,r=()=>[document.body]){!function(e,t,r=()=>({containers:[]})){let s=(0,n.useSyncExternalStore)(c.subscribe,c.getSnapshot,c.getSnapshot),a=t?s.get(t):void 0;a&&a.count,(0,i.s)(()=>{if(!(!t||!e))return c.dispatch("PUSH",t,r),()=>c.dispatch("POP",t,r)},[e,t])}((0,u.S)(e,"scroll-lock"),t,e=>{var t;
195return{containers:[...null!=(t=e.containers)?t:[],r]}})}},42375:(e,t,r)=>{"use strict";r.d(t,{lB:()=>a});let n=new Map,i=new Map,s=0;function a(e,t,r){let a=++s,o=()=>n.get(e)||[],l=()=>{let t=o();if(!t.some(e=>e.id===a))return;let r=i.get(e);if(1===t.length&&r){let e=r();e instanceof Promise&&e.catch(()=>{})}(()=>{let t=o().filter(e=>e.id!==a);if(0===t.length){n.delete(e),i.delete(e);return}n.set(e,t)})()},c=o();if(n.set(e,[...c,{id:a,fns:t}]),c&&c.length>0)return l;let u={};for(let e in t)u[e]=(...t)=>{let r=o();if(0!==r.length)for(let n of r)n.fns[e]?.(...t)};let d=r(u);return"function"==typeof d&&i.set(e,d),l}},42450:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,t)),t}set(e,t){if(super.has(e)&&super.delete(e),super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=super.keys().next().value;void 0!==e&&super.delete(e)}return this}}},42467:(e,t,r)=>{"use strict";function n(e){let t={formatters:void 0,fees:void 0,serializers:void 0,...e};return Object.assign(t,{extend:function e(t){return r=>{let n="function"==typeof r?r(t):r,i={...t,...n};return Object.assign(i,{extend:e(i)})}}(t)})}r.d(t,{x:()=>n})},42606:(e,t,r)=>{"use strict";r.d(t,{g:()=>a});var n=r(44990),i=r(44037),s=r(4232);async function a(e,{blockHash:t,blockNumber:r,blockTag:o=e.experimental_blockTag??"latest",includeTransactions:l}={}){let c=l??!1,u=void 0!==r?(0,i.cK)(r):void 0,d=null;if(!(d=t?await e.request({method:"eth_getBlockByHash",params:[t,c]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[u||o,c]},{dedupe:!!u})))throw new n.l({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||s.$)(d,"getBlock")}},42783:(e,t,r)=>{"use strict";r.d(t,{mj:()=>b,nh:()=>p,th:()=>g,Pw:()=>f,E7:()=>h,ov:()=>m,cP:()=>u,Yr:()=>d});var n=r(28266),i=r(60336),s=r(2452),a=r(72693),o=r(35234),l=r(40917),c=r(71441);function u(e,t){return{amount:e,decimals:t,formatted:(0,o.J)(e,t)}}function d(e,t){var r,n;if("bigint"==typeof e)return e;let i=e.decimals??t;return r=e.formatted,n=function(e){if(void 0===e)throw Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");return e}(i),l.HT(r,n)}function f(e,t){return"bigint"==typeof e?t:e.decimals??t}function h(e,t){let{decimals:r,token:n}=t,a=p(e,n);if(a)return{address:a.address,decimals:r??a.decimals};if((0,i.P)(n,{strict:!1}))return{address:n,decimals:r??function(e,t){let r=e.tokens,n=e.chain?.id;if(r&&void 0!==n)for(let e of r){let r=y(e,n);if(r&&(0,s.h)(r.address,t))return r.decimals}}(e,n)};throw Error(`Token "${n}" is not a declared ERC-20 token on the client's \`tokens\` array (with an address for the client's chain), and is not a valid address.`)}function p(e,t){let r=e.tokens,n=e.chain?.id;if(!r||void 0===n)return;let a=function(e,t){let r=t.toLowerCase();for(let t of e)if(t.symbol?.toLowerCase()===r)return t}(r,t);if(a)return y(a,n);if((0,i.P)(t,{strict:!1}))for(let e of r){let r=y(e,n);if(r&&(0,s.h)(r.address,t))return r}}function y(e,t){let r=e.addresses[t];if(r)return{address:r,currency:e.currency,decimals:e.decimals,name:e.name,popular:e.popular,symbol:e.symbol}}async function m(e,t){let{address:r,decimals:i}=h(e,t);return void 0!==i?{address:r,decimals:i}:{address:r,decimals:await (0,c.J)(e,{abi:n.xw,address:r,functionName:"decimals"})}}function g(e){let{account:t,chain:r,gas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:a}=e;return{account:t,chain:r,gas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:a}}function b(e){return{...e,data:(0,a.p)(e),to:e.address}}},42816:(e,t,r)=>{"use strict";let n,i,s,a,o;r.d(t,{B:()=>p9,C:()=>yh,E:()=>yy,O:()=>y_,R:()=>yE,S:()=>yI,U:()=>yS,W:()=>yo,a:()=>yj,b:()=>yC,c:()=>ym,d:()=>yL,e:()=>yU,f:()=>yM,g:()=>yp,h:()=>yv,i:()=>yz,l:()=>yx,p:()=>yA,t:()=>yq,v:()=>p5,w:()=>p6,x:()=>p2});var l=r(98855),c=r(86786),u=r(87280),d=r(13799),f=r(18637),h=r(77603),p=r(33861),y=r(26514);class m{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 r=0;r<localStorage.length;r++){let n=localStorage.key(r);"string"==typeof n&&n.startsWith(e)&&t.push(n)}
195t.forEach(e=>localStorage.removeItem(e))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new m("CBWSDK").clear(),new m("walletlink").clear()}}let g={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},b={"-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."}},w="Unspecified error message.";function v(e,t=w){if(e&&Number.isInteger(e)){var r;let t=e.toString();if(_(b,t))return b[t].message;if((r=e)>=-32099&&r<=-32e3)return"Unspecified server error."}return t}function x(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function E(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}let A={rpc:{parse:e=>I(g.rpc.parse,e),invalidRequest:e=>I(g.rpc.invalidRequest,e),invalidParams:e=>I(g.rpc.invalidParams,e),methodNotFound:e=>I(g.rpc.methodNotFound,e),internal:e=>I(g.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code 
195<= -32005');return I(t,e)},invalidInput:e=>I(g.rpc.invalidInput,e),resourceNotFound:e=>I(g.rpc.resourceNotFound,e),resourceUnavailable:e=>I(g.rpc.resourceUnavailable,e),transactionRejected:e=>I(g.rpc.transactionRejected,e),methodNotSupported:e=>I(g.rpc.methodNotSupported,e),limitExceeded:e=>I(g.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>C(g.provider.userRejectedRequest,e),unauthorized:e=>C(g.provider.unauthorized,e),unsupportedMethod:e=>C(g.provider.unsupportedMethod,e),disconnected:e=>C(g.provider.disconnected,e),chainDisconnected:e=>C(g.provider.chainDisconnected,e),unsupportedChain:e=>C(g.provider.unsupportedChain,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw Error('"message" must be a nonempty string');return new $(t,r,n)}}};function I(e,t){let[r,n]=S(t);return new P(e,r||v(e),n)}function C(e,t){let[r,n]=S(t);return new $(e,r||v(e),n)}function S(e){if(e){if("string"==typeof e)return[e];else if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t||void 0,r]}}return[]}class P extends Error{constructor(e,t,r){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!==r&&(this.data=r)}}class $ extends P{constructor(e,t,r){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,r)}}function k(e){return Math.floor(e)}var T=r(98539).hp;let O=/^[0-9]*$/,N=/^[a-f0-9]*$/;function R(e){return B(crypto.getRandomValues(new Uint8Array(e)))}function B(e){return[...e].map(e=>e.toString(16).padStart(2,"0")).join("")}function D(e){return new Uint8Array(e.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function M(e,t=!1){let r=e.toString("hex");return t?`0x${r}`:r}function U(e){return M(V(e),!0)}function j(e){return e.toString(10)}function L(e){return`0x${BigInt(e).toString(16)}`}function F(e){return e.startsWith("0x")||e.startsWith("0X")}function z(e){return F(e)?e.slice(2):e}function q(e){return F(e)?`0x${e.slice(2)}`:`0x${e}`}function W(e){if("string"!=typeof e)return!1;let t=z(e).toLowerCase();return N.test(t)}function H(e,t=!1){let r=function(e,t=!1){if("string"==typeof e){let r=z(e).toLowerCase();if(N.test(r))return t?`0x${r}`:r}throw A.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}(e,!1);return r.length%2==1&&(r=`0${r}`),t?`0x${r}`:r}function K(e){if("string"==typeof e){let t=z(e).toLowerCase();if(W(t)&&40===t.length)return q(t)}throw A.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}function V(e){if(T.isBuffer(e))return e;if("string"==typeof e){if(W(e)){let t=H(e,!1);return T.from(t,"hex")}return T.from(e,"utf8")}throw A.rpc.invalidParams(`Not binary data: ${String(e)}`)}function G(e){if("number"==typeof e&&Number.isInteger(e))return k(e);if("string"==typeof e){if(O.test(e))return k(Number(e));if(W(e))return k(Number(BigInt(H(e,!0))))}throw A.rpc.invalidParams(`Not an integer: ${String(e)}`)}function J(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(G(e));if("string"==typeof e){if(O.test(e))return BigInt(e);if(W(e))return BigInt(H(e,!0))}throw A.rpc.invalidParams(`Not an integer: ${String(e)}`)}async function Y(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function Z(e,t){return crypto.subtle.deriveKey({name:"ECDH",public:t},e,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Q(e,t){let r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},e,new TextEncoder().encode(t));return{iv:r,cipherText:n}}async function X(e,{iv:t,cipherText:r}
vendor: 6,827 bytes, line 195
195){let n=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,r);return new TextDecoder().decode(n)}function ee(e){switch(e){case"public":return"spki";case"private":return"pkcs8"}}async function et(e,t){let r=ee(e);return B(new Uint8Array(await crypto.subtle.exportKey(r,t)))}async function er(e,t){let r=ee(e),n=D(t).buffer;return await crypto.subtle.importKey(r,new Uint8Array(n),{name:"ECDH",namedCurve:"P-256"},!0,"private"===e?["deriveKey"]:[])}async function en(e,t){return Q(t,JSON.stringify(e,(e,t)=>t instanceof Error?Object.assign(Object.assign({},t.code?{code:t.code}:{}),{message:t.message}):t))}async function ei(e,t){return JSON.parse(await X(t,e))}let es={storageKey:"ownPrivateKey",keyType:"private"},ea={storageKey:"ownPublicKey",keyType:"public"},eo={storageKey:"peerPublicKey",keyType:"public"};class el{constructor(){this.storage=new m("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(eo,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(ea.storageKey),this.storage.removeItem(es.storageKey),this.storage.removeItem(eo.storageKey)}async generateKeyPair(){let e=await Y();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(es,e.privateKey),await this.storeKey(ea,e.publicKey)}async loadKeysIfNeeded(){null===this.ownPrivateKey&&(this.ownPrivateKey=await this.loadKey(es)),null===this.ownPublicKey&&(this.ownPublicKey=await this.loadKey(ea)),(null===this.ownPrivateKey||null===this.ownPublicKey)&&await this.generateKeyPair(),null===this.peerPublicKey&&(this.peerPublicKey=await this.loadKey(eo)),null===this.sharedSecret&&null!==this.ownPrivateKey&&null!==this.peerPublicKey&&(this.sharedSecret=await Z(this.ownPrivateKey,this.peerPublicKey))}async loadKey(e){let t=this.storage.getItem(e.storageKey);return t?er(e.keyType,t):null}async storeKey(e,t){let r=await et(e.keyType,t);this.storage.setItem(e.storageKey,r)}}let ec="4.3.2",eu="@coinbase/wallet-sdk";async function ed(e,t){let r=Object.assign(Object.assign({},e),{jsonrpc:"2.0",id:crypto.randomUUID()}),n=await window.fetch(t,{method:"POST",body:JSON.stringify(r),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":ec,"X-Cbw-Sdk-Platform":eu}}),{result:i,error:s}=await n.json();if(s)throw s;return i}let ef="accounts",eh="activeChain",ep="availableChains",ey="walletCapabilities";class em{constructor(e){var t,r,n;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new el,this.storage=new m("CBWSDK","SCWStateManager"),this.accounts=null!=(t=this.storage.loadObject(ef))?t:[],this.chain=this.storage.loadObject(eh)||{id:null!=(n=null==(r=e.metadata.appChainIds)?void 0:r[0])?n: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,r,n,i;await (null==(r=(t=this.communicator).waitForPopupLoaded)?void 0:r.call(t));let s=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,null!=(n=e.params)?n:{})}}),a=await this.communicator.postRequestAndWaitForResponse(s);if("failure"in a.content)throw a.content.failure;let o=await er("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(ef,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 A.provider.unauthorized();switch(e.method){case"eth_requestAccounts":return null==(t=this.callback)||t.call(this,"connect",{chainId:L(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 L(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(ey);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 A.rpc.internal("No RPC URL set for chain");return ed(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var t,r;await (null==(r=(t=this.communicator).waitForPopupLoaded)?void 0:r.call(t));let n=await this.sendEncryptedRequest(e),i=(await this.decryptResponseMessage(n)).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 r=e.params;if(!r||!(null==(t=r[0])?void 0:t.chainId))throw A.rpc.invalidParams();let n=G(r[0].chainId);if(this.updateChain(n))return null;let i=await this.sendRequestToPopup(e);return null===i&&this.updateChain(n),i}async sendEncryptedRequest(e){let t=await this.keyManager.getSharedSecret();if(!t)throw A.provider.unauthorized("No valid session found, try requestAccounts before other methods");let r=await en({action:e,chainId:this.chain.id},t),n=await this.createRequestMessage({encrypted:r});return this.communicator.postRequestAndWaitForResponse(n)}async createRequestMessage(e){let t=await et("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){var t,r;let n=e.content;if("failure"in n)throw n.failure;let i=await this.keyManager.getSharedSecret();if(!i)throw A.provider.unauthorized("Invalid session");let s=await ei(n.encrypted,i),a=null==(t=s.data)?void 0:t.chains;if(a){let e=Object.entries(a).map(([e,t])=>({id:Number(e),rpcUrl:t}));this.storage.storeObject(ep,e),this.updateChain(this.chain.id,e)}let o=null==(r=s.data)?void 0:r.capabilities;return o&&this.storage.storeObject(ey,o),s}updateChain(e,t){var r;let n=null!=t?t:this.storage.loadObject(ep),i=null==n?void 0:n.find(t=>
vendor: 2,638 bytes, line 195
195t.id===e);return!!i&&(i!==this.chain&&(this.chain=i,this.storage.storeObject(eh,i),null==(r=this.callback)||r.call(this,"chainChanged",L(i.id))),!0)}}var eg=r(34143);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 r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",D(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(e)),a=s.slice(s.byteLength-16),o=s.slice(0,s.byteLength-16),l=new Uint8Array(a),c=new Uint8Array(o);return B(new Uint8Array([...r,...l,...c]))}async decrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");return new Promise((r,n)=>{!async function(){let i=await crypto.subtle.importKey("raw",D(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=D(e),a=s.slice(0,12),o=s.slice(12,28),l=new Uint8Array([...s.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;r(t.decode(e))}catch(e){n(e)}}()})}}class ex{constructor(e,t,r){this.linkAPIUrl=e,this.sessionId=t;let n=`${t}:${r}`;this.auth=`Basic ${btoa(n)}`}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:r,error:n}=await t.json();if(n)throw Error(`Check unseen events failed: ${n}`);let i=null!=(e=null==r?void 0:r.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}`)}}!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(y$||(y$={}));class e_{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw Error("webSocket object is not null");return new Promise((e,t)=>{var r;let n;try{this.webSocket=n=new this.WebSocketClass(this.url)}catch(e){t(e);return}null==(r=this.connectionStateListener)||r.call(this,y$.CONNECTING),n.onclose
195=e=>{var r;this.clearWebSocket(),t(Error(`websocket error ${e.code}: ${e.reason}`)),null==(r=this.connectionStateListener)||r.call(this,y$.DISCONNECTED)},n.onopen=t=>{var r;e(),null==(r=this.connectionStateListener)||r.call(this,y$.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(e=>this.sendData(e)),this.pendingData=[])},n.onmessage=e=>{var t,r;if("h"===e.data)null==(t=this.incomingDataListener)||t.call(this,{type:"Heartbeat"});else try{let t=JSON.parse(e.data);null==(r=this.incomingDataListener)||r.call(this,t)}catch(e){}}})}disconnect(){var e;let{webSocket:t}=this;if(t){this.clearWebSocket(),null==(e=this.connectionStateListener)||e.call(this,y$.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch(e){}}}sendData(e){let{webSocket:t}=this;if(!t){this.pendingData.push(e),this.connect();return}t.send(e)}clearWebSocket(){let{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}class eE{constructor({session:e,linkAPIUrl:t,listener:r}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=k(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!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,r)=>{let n=e[r];void 0!==n&&t(n)})},this.handleDestroyed=e=>{var t;"1"===e&&(null==(t=this.listener)||t.resetAndReload())},this.handleAccountUpdated=async e=>{var t;let r=await this.cipher.decrypt(e);null==(t=this.listener)||t.accountUpdated(r)},this.handleMetadataUpdated=async(e,t)=>{var r;let n=await this.cipher.decrypt(t);null==(r=this.listener)||r.metadataUpdated(e,n)},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated("walletUsername",e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated("AppVersion",e)},this.handleChainUpdated=async(e,t)=>{var r;let n=await this.cipher.decrypt(e),i=await this.cipher.decrypt(t);null==(r=this.listener)||r.chainUpdated(n,i)},this.session=e,this.cipher=new ev(e.secret),this.listener=r;let n=new e_(`${t}/rpc`,WebSocket);n.setConnectionStateListener(async e=>{let t=!1;switch(e){case y$.DISCONNECTED:if(!this.destroyed){let e=async()=>{await new Promise(e=>setTimeout(e,5e3)),this.destroyed||n.connect().catch(()=>{e()})};e()}break;case y$.CONNECTED:t=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},1e4),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();case y$.CONNECTING:}this.connected!==t&&(this.connected=t)}),n.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))}),this.ws=n,this.http=new ex(t,e.id,e.key)}connect(){if(this.destroyed)throw Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:k(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),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,r;this._linked=e,e&&(null==(t=this.onceLinked)||t.call(this)),null==(r=this.listener)||r.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)return;let r=JSON.parse(await this.cipher.decrypt(e.data));if("WEB3_RESPONSE"!==r.type)return;let{id:n,response:i}=r;null==(t=this.listener)||t.handleWeb3ResponseMessage(n,i)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEac
vendor: 7,581 bytes, line 195
195h(e=>this.handleIncomingEvent(e))}async publishEvent(e,t,r=!1){let n=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:k(this.nextReqId++),sessionId:this.session.id,event:e,data:n,callWebhook:r};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();try{this.ws.sendData("h")}catch(e){}}async makeRequest(e,t={timeout:6e4}){let r,n=e.id;return this.sendData(e),Promise.race([new Promise((e,i)=>{r=window.setTimeout(()=>{i(Error(`request ${n} timed out`))},t.timeout)}),new Promise(e=>{this.requestResolutions.set(n,t=>{clearTimeout(r),e(t),this.requestResolutions.delete(n)})})])}async handleConnected(){return"Fail"!==(await this.makeRequest({type:"HostSession",id:k(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type&&(this.sendData({type:"IsLinked",id:k(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:k(this.nextReqId++),sessionId:this.session.id}),!0)}}class eA{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 eI=r(43793),eC=r(9146);let eS="session:id",eP="session:secret",e$="session:linked";class ek{constructor(e,t,r,n=!1){this.storage=e,this.id=t,this.secret=r,this.key=(0,eC.My)((0,eI.sc)(`${t}, ${r} WalletLink`)),this._linked=!!n}static create(e){return new ek(e,R(16),R(32)).save()}static load(e){let t=e.getItem(eS),r=e.getItem(e$),n=e.getItem(eP);return t&&n?new ek(e,t,n,"1"===r):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(eS,this.id),this.storage.setItem(eP,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(e$,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 eO(){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)}var eN=r(98457),eR=r(72274),eB=r(71782);class eD{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&&(0,eR.XX)((0,eR.h)("div",null,(0,eR.h)(eM,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,t])=>(0,eR.h)(eU,Object.assign({},t,{key:e}))))),this.root)}}let eM=e=>(0,eR.h)("div",{class:(0,eN.$)("-cbwsdk-snackbar-container")},(0,eR.h)("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;
195cursor: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}"),(0,eR.h)("div",{class:"-cbwsdk-snackbar"},e.children)),eU=({autoExpand:e,message:t,menuItems:r})=>{let[n,i]=(0,eB.J0)(!0),[s,a]=(0,eB.J0)(null!=e&&e);return(0,eB.vJ)(()=>{let e=[window.setTimeout(()=>{i(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{e.forEach(window.clearTimeout)}}),(0,eR.h)("div",{class:(0,eN.$)("-cbwsdk-snackbar-instance",n&&"-cbwsdk-snackbar-instance-hidden",s&&"-cbwsdk-snackbar-instance-expanded")},(0,eR.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{a(!s)}},(0,eR.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,eR.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,eR.h)("div",{class:"-gear-container"},!s&&(0,eR.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,eR.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,eR.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwu
195NTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,eR.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((e,t)=>(0,eR.h)("div",{class:(0,eN.$)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,eR.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,eR.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,eR.h)("span",{class:(0,eN.$)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info)))))},ej="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 eL{constructor(){this.attached=!1,this.snackbar=new eD}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,eO()}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:ej,defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}class eF{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),eO()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,eR.XX)(null,this.root),e&&(0,eR.XX)((0,eR.h)(ez,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}let ez=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>(0,eR.h)(eM,{darkMode:r},(0,eR.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,eR.h)("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}
195.-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}"),(0,eR.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,eR.h)("div",{class:(0,eN.$)("-cbwsdk-redirect-dialog-box",r?"dark":"light")},(0,eR.h)("p",null,e),(0,eR.h)("button",{onClick:n},t)))),eq="https://www.walletlink.org";class eW{constructor(){this.attached=!1,this.redirectDialog=new eF}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 r=document.createElement("a");r.target="cbw-opener",r.href=t.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class eH{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 r=t.split(" "),n="true"===this.storage.getItem("IsStandaloneSigning");""===r[0]||e||!this._session.linked||n||(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]),eH.accountRequestCallbackIds.size>0&&(Array.from(eH.accountRequestCallbackIds.values()).forEach(t=>{this.invokeCallback(t,{method:"requestEthereumAccounts",result:[e]})}),eH.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;let{session:t,ui:r,connection:n}=this.subscribe();this._session=t,this.connection=n,this.relayEventManager=new eA,this.ui=r,this.ui.attach()}subscribe(){let e=ek.load(this.storage)||ek.create(this.storage),{linkAPIUrl:t}=this,r=new eE({session:e,linkAPIUrl:t,listener:this}),n=this.isMobileWeb?new eW:new eL;return r.connect(),{session:e,ui:n,connection:r}}resetAndReload(){this.connection.destroy().then(()=>{let e=ek.load(this.storage);(null==e?void 0:e.id)===this._session.id&&m.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:j(e.weiValue),data:M(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?j(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?j(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?j(e.gasPriceInWei):null,gasLimit:e.gasLim
vendor: 4,172 bytes, line 195
195it?j(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:j(e.weiValue),data:M(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?j(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?j(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?j(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?j(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:M(e,!0),chainId:t}})}getWalletLinkSession(){return this._session}sendRequest(e){let t=null,r=R(8),n=n=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,n),null==t||t()};return new Promise((i,s)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:n,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(r,e=>{if(null==t||t(),ew(e))return s(Error(e.errorMessage));i(e)}),this.publishWeb3RequestEvent(r,e)})}publishWeb3RequestEvent(e,t){let r={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",r,!0).then(e=>{}).catch(e=>{this.handleWeb3ResponseMessage(r.id,{method:t.method,errorMessage:e.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof eW)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,r){return this.connection.publishEvent(e,t,r)}handleWeb3ResponseMessage(e,t){if("requestEthereumAccounts"===t.method){eH.accountRequestCallbackIds.forEach(e=>this.invokeCallback(e,t)),eH.accountRequestCallbackIds.clear();return}this.invokeCallback(e,t)}handleErrorResponse(e,t,r){var n;let i=null!=(n=null==r?void 0:r.message)?n:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:t,errorMessage:i})}invokeCallback(e,t){let r=this.relayEventManager.callbacks.get(e);r&&(r(t),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){let{appName:e,appLogoUrl:t}=this.metadata,r={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:t}},n=R(8);return new Promise((e,t)=>{this.relayEventManager.callbacks.set(n,r=>{if(ew(r))return t(Error(r.errorMessage));e(r)}),eH.accountRequestCallbackIds.add(n),this.publishWeb3RequestEvent(n,r)})}watchAsset(e,t,r,n,i,s){let a={method:"watchAsset",params:{type:e,options:{address:t,symbol:r,decimals:n,image:i},chainId:s}},o=null,l=R(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,r=>{if(null==o||o(),ew(r))return t(Error(r.errorMessage));e(r)}),this.publishWeb3RequestEvent(l,a)})}addEthereumChain(e,t,r,n,i,s){let a={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:n,chainName:i,iconUrls:r,nativeCurrency:s}},o=null,l=R(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,r=>{if(null==o||o(),ew(r))return t(Error(r.errorMessage));e(r)}),this.publishWeb3RequestEvent(l,a)})}switchEthereumChain(e,t){let r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},n=null,i=R(8),s=e=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,r.method,e),null==n||n()};return n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload}),new Promise((e,t)=>
vendor: 4,846 bytes, line 195
195{this.relayEventManager.callbacks.set(i,r=>(null==n||n(),ew(r)&&r.errorCode)?t(A.provider.custom({code:r.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):ew(r)?t(Error(r.errorMessage)):void e(r)),this.publishWeb3RequestEvent(i,r)})}}eH.accountRequestCallbackIds=new Set;var eK=r(98539).hp;let eV="DefaultChainId",eG="DefaultJsonRpcUrl";class eJ{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new m("walletlink",eq),this.callback=e.callback||null;let t=this._storage.getItem(eb);if(t){let 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(eG))?e:void 0}set jsonRpcUrl(e){this._storage.setItem(eG,e)}updateProviderInfo(e,t){var r;this.jsonRpcUrl=e;let n=this.getChainId();this._storage.setItem(eV,t.toString(10)),G(t)!==n&&(null==(r=this.callback)||r.call(this,"chainChanged",L(t)))}async watchAsset(e){let t=Array.isArray(e)?e[0]:e;if(!t.type)throw A.rpc.invalidParams("Type is required");if((null==t?void 0:t.type)!=="ERC20")throw A.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(null==t?void 0:t.options))throw A.rpc.invalidParams("Options are required");if(!(null==t?void 0:t.options.address))throw A.rpc.invalidParams("Address is required");let r=this.getChainId(),{address:n,symbol:i,image:s,decimals:a}=t.options,o=this.initializeRelay(),l=await o.watchAsset(t.type,n,i,a,s,null==r?void 0:r.toString());return!ew(l)&&!!l.result}async addEthereumChain(e){var t,r;let n=e[0];if((null==(t=n.rpcUrls)?void 0:t.length)===0)throw A.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!n.chainName||""===n.chainName.trim())throw A.rpc.invalidParams("chainName is a required field");if(!n.nativeCurrency)throw A.rpc.invalidParams("nativeCurrency is a required field");let i=Number.parseInt(n.chainId,16);if(i===this.getChainId())return!1;let s=this.initializeRelay(),{rpcUrls:a=[],blockExplorerUrls:o=[],chainName:l,iconUrls:c=[],nativeCurrency:u}=n,d=await s.addEthereumChain(i.toString(),a,c,o,l,u);if(ew(d))return!1;if((null==(r=d.result)?void 0:r.isApproved)===!0)return this.updateProviderInfo(a[0],i),null;throw A.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){let t=Number.parseInt(e[0].chainId,16),r=this.initializeRelay(),n=await r.switchEthereumChain(t.toString(10),this.selectedAddress||void 0);if(ew(n))throw n;let i=n.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 r;if(!Array.isArray(e))throw Error("addresses is not an array");let n=e.map(e=>K(e));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,null==(r=this.callback)||r.call(this,"accountsChanged",n),this._storage.setItem(eb,n.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 L(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 A.rpc.internal("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 r=e.to?K(e.to):null,n=null!=e.value?J(e.value):BigInt(0),i=e.data?V(e.data):eK.alloc(0),s=null!=e.nonce?G(e.nonce):null,a=null!=e.gasPrice?J(e.gasPrice):null,o=null!=e.maxFeePerGas?J(e.maxFeePerGas):null,l=null!=e.maxPriorityFeePerGas?J(e.maxPriorityFeePerGas):null;return{fromAddress:t,toAddress:r,weiValue:n,data:i,nonce:s,gasPriceInWei:a,maxFeePerGas:o,maxPriorityFeePerGas:l,gasLim
vendor: 20,209 bytes, lines 195-197
195it:null!=e.gas?J(e.gas):null,chainId:e.chainId?G(e.chainId):this.getChainId()}}async ecRecover(e){let{method:t,params:r}=e;if(!Array.isArray(r))throw A.rpc.invalidParams();let n=this.initializeRelay(),i=await n.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:U(r[0]),signature:U(r[1]),addPrefix:"personal_ecRecover"===t}});if(ew(i))throw i;return i.result}getChainId(){var e;return Number.parseInt(null!=(e=this._storage.getItem(eV))?e:"1",10)}async _eth_requestAccounts(){var e,t;if(this._addresses.length>0)return null==(e=this.callback)||e.call(this,"connect",{chainId:L(this.getChainId())}),this._addresses;let r=this.initializeRelay(),n=await r.requestEthereumAccounts();if(ew(n))throw n;if(!n.result)throw Error("accounts received is empty");return this._setAddresses(n.result),null==(t=this.callback)||t.call(this,"connect",{chainId:L(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw A.rpc.invalidParams();let t=e[1],r=e[0];this._ensureKnownAddress(t);let n=this.initializeRelay(),i=await n.sendRequest({method:"signEthereumMessage",params:{address:K(t),message:U(r),addPrefix:!0,typedDataJson:null}});if(ew(i))throw i;return i.result}async _eth_signTransaction(e){let t=this._prepareTransactionParams(e[0]||{}),r=this.initializeRelay(),n=await r.signEthereumTransaction(t);if(ew(n))throw n;return n.result}async _eth_sendRawTransaction(e){let t=V(e[0]),r=this.initializeRelay(),n=await r.submitEthereumTransaction(t,this.getChainId());if(ew(n))throw n;return n.result}async _eth_sendTransaction(e){let t=this._prepareTransactionParams(e[0]||{}),r=this.initializeRelay(),n=await r.signAndSubmitEthereumTransaction(t);if(ew(n))throw n;return n.result}async signTypedData(e){let{method:t,params:r}=e;if(!Array.isArray(r))throw A.rpc.invalidParams();let n=r[+("eth_signTypedData_v1"===t)],i=r[+("eth_signTypedData_v1"!==t)];this._ensureKnownAddress(n);let s=this.initializeRelay(),a=await s.sendRequest({method:"signEthereumMessage",params:{address:K(n),message:M(({eth_signTypedData_v1:eg.hashForSignTypedDataLegacy,eth_signTypedData_v3:eg.hashForSignTypedData_v3,eth_signTypedData_v4:eg.hashForSignTypedData_v4,eth_signTypedData:eg.hashForSignTypedData_v4})[t]({data:function(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw A.rpc.invalidParams(`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 eH({linkAPIUrl:eq,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}let eY="SignerType",eZ=new m("CBWSDK","SignerConfigurator");async function eQ(e){let{communicator:t,metadata:r,handshakeRequest:n,callback:i}=e;eX(t,r,i).catch(()=>{});let s={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},e.preference),{handshakeRequest:n})},{data:a}=await t.postRequestAndWaitForResponse(s);return a}async function eX(e,t,r){await e.onMessage(({event:e})=>"WalletLinkSessionRequest"===e);let n=new eJ({metadata:t,callback:r});e.postMessage({event:"WalletLinkUpdate",data:{session:n.getSession()}}),await n.handshake(),e.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}let e0=`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.
196
197Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,{checkCrossOriginOpenerPolicy:e1,getCrossOriginOpenerPolicy:e2}=(()=>{let e;return{getCrossOriginOpenerPolicy:()=>void 0===e?"undefined":e,checkCrossOriginOpenerPolicy:async()=>{if("undefined"==typeof window){e="non-browser-env";return}try{let t=`${window.location.origin}${window.location.pathname}`,r=await fetch(t,{method:"HEAD"});if(!r.ok)throw Error(`HTTP error! status: ${r.status}`);let n=r.headers.get("Cross-Origin-Opener-Policy");e=null!=n?n:"null","same-origin"===e&&console.error(e0)}catch(t){console.error("Error checking Cross-Origin-Opener-Policy:",t.message),e="error"}}}})(),e5={isRed:!1,info:"Retry",svgWidth:"10",svgHeight:"11",path:ej,defaultFillRule:"evenodd",defaultClipRule:"evenodd"},e6=null;class e3{constructor({url:e="https://keys.coinbase.com/connect",metadata:t,preference:r}){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,r)=>{let n=r=>{if(r.origin!==this.url.origin)return;let i=r.data;e(i)&&(t(i),window.removeEventListener("message",n),this.listeners.delete(n))};window.addEventListener("message",n),this.listeners.set(n,{reject:r})}),this.disconnect=()=>{!function(e){e&&!e.closed&&e.close()}(this.popup),this.popup=null,this.listeners.forEach(({reject:e},t)=>{e(A.provider.userRejectedRequest("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,r=(window.innerHeight-540)/2+window.screenY;function n(){let n=`wallet_${crypto.randomUUID()}`,i=window.open(e,n,`width=420, height=540, left=${t}, top=${r}`);return(null==i||i.focus(),i)?i:null}var i=e;for(let[e,t]of Object.entries({sdkName:eu,sdkVersion:ec,origin:window.location.origin,coop:e2()}))i.searchParams.append(e,t.toString());let s=n();if(!s){let e=function(){if(!e6){let e=document.createElement("div");e.className="-cbwsdk-css-reset",document.body.appendChild(e),(e6=new eD).attach(e)}return e6}();return new Promise((t,r)=>{e.presentItem({autoExpand:!0,message:"Popup was blocked. Try again.",menuItems:[Object.assign(Object.assign({},e5),{onClick:()=>{(s=n())?t(s):r(A.rpc.internal("Popup window was blocked")),e.clear()}})]})})}return Promise.resolve(s)}(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 A.rpc.internal();return this.popup})),this.url=new URL(e),this.metadata=t,this.preference=r}}var e8=r(24410);class e4 extends e8{}var e9=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};class e7 extends e4{constructor(e){var{metadata:t}=e,r=e.preference,{keysUrl:n}=r,i=e9(r,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=t,this.preference=i,this.communicator=new e3({url:n,metadata:t,preference:i});let s=eZ.getItem(eY);s&&(this.signer=this.initSigner(s))}async request(e){try{if(!e||"object"!=typeof e||Array.isArray(e))throw A.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:e});let{method:t,params:r}=e;if("string"!=typeof t||0===t.length)throw A.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw A.rpc.invalidParams({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 A.provider.unsupportedMethod()}if(!this.signer)switch(e.method){case"eth_requestAccounts":{let t=await this.requestSignerSelection(e),r=this.initSigner(t);await r.handshake(e),this.signer=r,eZ.setItem(eY,t);break}case"wallet_sendCalls":{let t=this.initSigner("scw");await t.handshake({method:"handshake"});let r=await t.request(e);return await t.cleanup(),r}case"wallet_getCallsStatus":return ed(e,"https://rpc.wallet.coinbase.com");case"net_version":return 1;case"eth_chainId":return L(1);default:throw A.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(t){let{code:e}=t;return e===g.provider.unauthorized&&this.disconnect(),Promise.reject(function(e){let t=function(e,{shouldIncludeStack:t=!1}={}){var r,n;let i={};if(e&&"object"==typeof e&&!Array.isArray(e)&&_(e,"code")&&Number.isInteger(r=e.code)&&(b[r.toString()]||(n=r)>=-32099&&n<=-32e3))i.code=e.code,e.message&&"string"==typeof e.message?(i.message=e.message,_(e,"data")&&(i.data=e.data)):(i.message=v(i.code),i.data={originalError:x(e)});else i.code=g.rpc.internal,i.message=E(e,"message")?e.message:w,i.data={originalError:x(e)};return t&&(i.stack=E(e,"stack")?e.stack:void 0),i}(function(e){var t;if("string"==typeof e)return{message:e,code:g.rpc.internal};if(ew(e)){let r=e.errorMessage,n=null!=(t=e.errorCode)?t:r.match(/(denied|rejected)/i)?g.provider.userRejectedRequest:void 0;return Object.assign(Object.assign({},e),{message:r,code:n,data:{method:e.method}})}return e}(e),{shouldIncludeStack:!0}),r=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return r.searchParams.set("version",ec),r.searchParams.set("code",t.code.toString()),r.searchParams.set("message",t.message),Object.assign(Object.assign({},t),{docUrl:r.href})}(t))}}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,m.clearAll(),this.emit("disconnect",A.provider.disconnected("User initiated disconnection"))}requestSignerSelection(e){return eQ({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){let{signerType:t,metadata:r,communicator:n,callback:i}={signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)};switch(t){case"scw":return new em({metadata:r,callback:i,communicator:n});case"walletlink":return new eJ({metadata:r,callback:i})}}}let te={options:"all"};function tt(e){new m("CBWSDK").setItem("VERSION",ec),e1();let t={metadata:{appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||"",appChainIds:e.appChainIds||[]},preference:Object.assign(te,null!=(r=e.preference)?r:{})};var r,n=t.preference;if(n){if(!["all","smartWalletOnly","eoaOnly"].includes(n.options))throw Error(`Invalid options: ${n.options}`);if(n.attribution&&void 0!==n.attribution.auto&&void 0!==n.attribution.dataSuffix)throw Error("Attribution cannot contain both auto and dataSuffix properties")}let i=null;return{getProvider:()=>(i||(i=function(e){var t;let r={metadata:e.metadata,preference:e.preference};return null!=(t=function({metadata:e,preference:t}){var r,n;let{appName:i,appLogoUrl:s,appChainIds:a}=e;if("smartWalletOnly"!==t.options){let e=globalThis.coinbaseWalletExtension;if(e)return null==(r=e.setAppInfo)||r.call(e,i,s,a,t),e}let o=function(){var e,t;try{let r=globalThis;return null!=(e=r.ethereum)?e:null==(t=r.top)?void 0:t.ethereum}catch(e){return}}();if(null==o?void 0:o.isCoinbaseBrowser)return null==(n=o.setAppInfo)||n.call(o,i,s,a,t),o}(r))?t:new e7(r)}(t)),i)}}var tr=r(43489),tn=r(7287),ti=r(66277),ts=r.n(ti),ta=r(50898),to=r(66776),tl=r(48212),tc=r(17421);class tu extends Error{constructor(e,t={}){let r=(()=>{if(t.cause instanceof tu){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"==typeof t.cause.details?t.cause.details:t.cause?.message?t.cause.message:t.details})(),n=t.cause instanceof tu&&t.cause.docsPath||t.docsPath,i=`https://oxlib.sh${n??""}`;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r||n?["",r?`Details: ${r}`:void 0,n?`See: ${i}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"[email protected]"}),this.cause=t.cause,this.details=r,this.docs=i,this.docsPath=n,this.shortMessage=e}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?e(t.cause,r):r?null:t}(this,e)}}function td(e,t){if(tv(e)>t)throw new tA({givenSize:tv(e),maxSize:t})}function tf(e,t={}){let{dir:r,size:n=32}=t;if(0===n)return e;let i=e.replace("0x","");if(i.length>2*n)throw new tC({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i["right"===r?"padEnd":"padStart"](2*n,"0")}`}function th(e,t,r){return JSON.stringify(e,(e,r)=>"function"==typeof t?t(e,r):"bigint"==typeof r?r.toString()+"#__bigint":r,r)}let tp=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ty(e){return e instanceof Uint8Array?tm(e):Array.isArray(e)?tm(new Uint8Array(e)):e}function tm(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=tp[e[t]];let n=`0x${r}`;return"number"==typeof t.size?(td(n,t.size),tb(n,t.size)):n}function tg(e,t={}){var r;let n,{signed:i,size:s}=t,a=BigInt(e);s?n=i?(1n<<8n*BigInt(s)-1n)-1n:2n**(8n*BigInt(s))-1n:"number"==typeof e&&(n=BigInt(Number.MAX_SAFE_INTEGER));let o="bigint"==typeof n&&i?-n-1n:0;if(n&&a>n||a<o){let t="bigint"==typeof e?"n":"";throw new tx({max:n?`${n}${t}`:void 0,min:`${o}${t}`,signed:i,size:s,value:`${e}${t}`})}let l=(i&&a<0?(1n<<BigInt(8*s))+BigInt(a):a).toString(16),c=`0x${l}`;return s?(r=c,tf(r,{dir:"left",size:s})):c}function tb(e,t){return tf(e,{dir:"right",size:t})}function tw(e,t,r,n={}){let{strict:i}=n;if("number"==typeof t&&t>0&&t>tv(e)-1)throw new tI({offset:t,position:"start",size:tv(e)});let s=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return i&&function(e,t,r){if("number"==typeof t&&"number"==typeof r&&tv(e)!==r-t)throw new tI({offset:r,position:"end",size:tv(e)})}(s,t,r),s}function tv(e){return Math.ceil((e.length-2)/2)}class tx extends tu{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number \`${i}\` is not in safe${n?` ${8*n}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class t_ extends tu{constructor(e){super(`Value \`${"object"==typeof e?th(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class tE extends tu{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class tA extends tu{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class tI extends tu{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class tC extends tu{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}class tS extends tu{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${tv(ty(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class tP extends tu{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class t$ extends tu{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}var tk=r(18775),tT=r(46077);let tO=BigInt(0),tN=BigInt(1);function tR(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function tB(e){if(!tR(e))throw Error("Uint8Array expected")}function tD(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}function tM(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function tU(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?tO:BigInt("0x"+e)}let tj="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,tL=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function tF(e){if(tB(e),tj)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=tL[e[r]];return t}let tz={_0:48,_9:57,A:65,F:70,a:97,f:102};function tq(e){return e>=tz._0&&e<=tz._9?e-tz._0:e>=tz.A&&e<=tz.F?e-(tz.A-10):e>=tz.a&&e<=tz.f?e-(tz.a-10):void 0}function tW(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(tj)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=tq(e.charCodeAt(i)),s=tq(e.charCodeAt(i+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+s}return n}function tH(e){return tU(tF(e))}function tK(e){return tB(e),tU(tF(Uint8Array.from(e).reverse()))}function tV(e,t){return tW(e.toString(16).padStart(2*t,"0"))}function tG(e,t){return tV(e,t).reverse()}function tJ(e,t,r){let n;if("string"==typeof t)try{n=tW(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(tR(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function tY(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];tB(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let tZ=e=>"bigint"==typeof e&&tO<=e;function tQ(e,t,r){return tZ(e)&&tZ(t)&&tZ(r)&&t<=e&&e<r}function tX(e,t,r,n){if(!tQ(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}let t0=e=>(tN<<BigInt(e))-tN,t1=e=>new Uint8Array(e),t2=e=>Uint8Array.from(e),t5={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||tR(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function t6(e,t,r={}){let n=(t,r,n)=>{let i=t5[r];if("function"!=typeof i)throw Error("invalid validator function");let s=e[t];if((!n||void 0!==s)&&!i(s,e))throw Error("param "+String(t)+" is invali
197d. Expected "+r+", got "+s)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function t3(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let s=e(r,...n);return t.set(r,s),s}}let t8=BigInt(0),t4=BigInt(1),t9=BigInt(2),t7=BigInt(3),re=BigInt(4),rt=BigInt(5),rr=BigInt(8);function rn(e,t){let r=e%t;return r>=t8?r:t+r}function ri(e,t,r){let n=e;for(;t-- >t8;)n*=n,n%=r;return n}function rs(e,t){if(e===t8)throw Error("invert: expected non-zero number");if(t<=t8)throw Error("invert: expected positive modulus, got "+t);let r=rn(e,t),n=t,i=t8,s=t4,a=t4,o=t8;for(;r!==t8;){let e=n/r,t=n%r,l=i-a*e,c=s-o*e;n=r,r=t,i=a,s=o,a=l,o=c}if(n!==t4)throw Error("invert: does not exist");return rn(i,t)}function ra(e,t){let r=(e.ORDER+t4)/re,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw Error("Cannot find square root");return n}function ro(e,t){let r=(e.ORDER-rt)/rr,n=e.mul(t,t9),i=e.pow(n,r),s=e.mul(t,i),a=e.mul(e.mul(s,t9),i),o=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),t))throw Error("Cannot find square root");return o}let rl=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function rc(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),s=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),s),n}function ru(e,t){let r=(e.ORDER-t4)/t9,n=e.pow(t,r),i=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),a=e.eql(n,e.neg(e.ONE));if(!i&&!s&&!a)throw Error("invalid Legendre symbol result");return i?1:s?0:-1}function rd(e,t){void 0!==t&&(0,eC.Fe)(t);let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function rf(e,t,r=!1,n={}){let i;if(e<=t8)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:s,nByteLength:a}=rd(e,t);if(a>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let o=Object.freeze({ORDER:e,isLE:r,BITS:s,BYTES:a,MASK:t0(s),ZERO:t8,ONE:t4,create:t=>rn(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return t8<=t&&t<e},is0:e=>e===t8,isOdd:e=>(e&t4)===t4,neg:t=>rn(-t,e),eql:(e,t)=>e===t,sqr:t=>rn(t*t,e),add:(t,r)=>rn(t+r,e),sub:(t,r)=>rn(t-r,e),mul:(t,r)=>rn(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<t8)throw Error("invalid exponent, negatives unsupported");if(r===t8)return e.ONE;if(r===t4)return t;let n=e.ONE,i=t;for(;r>t8;)r&t4&&(n=e.mul(n,i)),i=e.sqr(i),r>>=t4;return n})(o,e,t),div:(t,r)=>rn(t*rs(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>rs(t,e),sqrt:n.sqrt||(t=>(i||(i=e%re===t7?ra:e%rr===rt?ro:function(e){if(e<BigInt(3))throw Error("sqrt is not defined for small field");let t=e-t4,r=0;for(;t%t9===t8;)t/=t9,r++;let n=t9,i=rf(e);for(;1===ru(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return ra;let s=i.pow(n,t),a=(t+t4)/t9;return function(e,n){if(e.is0(n))return n;if(1!==ru(e,n))throw Error("Cannot find square root");let i=r,o=e.mul(e.ONE,s),l=e.pow(n,t),c=e.pow(n,a);for(;!e.eql(l,e.ONE);){if(e.is0(l))return e.ZERO;let t=1,r=e.sqr(l);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw Error("Cannot find square root");let n=t4<<BigInt(i-t-1),s=e.pow(o,n);i=t,o=e.sqr(s),l=e.mul(l,o),c=e.mul(c,s)}return c}}(e)),i(o,t))),toBytes:e=>r?tG(e,a):tV(e,a),fromBytes:e=>{if(e.length!==a)throw Error("Field.fromBytes: expected "+a+" bytes, got "+e.length);return r?tK(e):tH(e)},invertBatch:e=>rc(o,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(o)}function rh(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function rp(e){let t=rh(e);return t+Math.ceil(t/2)}let ry=BigInt(0),rm=BigInt(1);function rg(e,t){let r=t.negate();return e?r:t}function rb(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function rw(e,t){rb(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),i=2**e;return{windows:r,windowSize:n,mask:t0(e),maxNumber:i,shiftBy:BigInt(e)}}function rv(e,t,r){let{windowSize:n,mask:i,maxNumber:s,shiftBy:a}=r,o=Number(e&i),l=e>>a;o>n&&(o-=s,l+=rm);let c=t*n,u=c+Math.abs(o)-1,d=0===o;return{nextN:l,offset:u,isZero:d,isNeg:o<0,isNegF:t%2!=0,offsetF:c}}let rx=new WeakMap,r_=new WeakMap;function rE(e){return r_.get(e)||1}function rA(e){return t6(e.Fp,rl.reduce((e,t)=>
vendor: 20,676 bytes, line 197
197(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),t6(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...rd(e.n,e.nBitLength),...e,...{p:e.Fp.ORDER}})}function rI(e){void 0!==e.lowS&&tD("lowS",e.lowS),void 0!==e.prehash&&tD("prehash",e.prehash)}class rC extends Error{constructor(e=""){super(e)}}let rS={Err:rC,_tlv:{encode:(e,t)=>{let{Err:r}=rS;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let n=t.length/2,i=tM(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let s=n>127?tM(i.length/2|128):"";return tM(e)+s+i+t},decode(e,t){let{Err:r}=rS,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],s=0;if(128&i){let e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let a=t.subarray(n,n+e);if(a.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===a[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of a)s=s<<8|e;if(n+=e,s<128)throw new r("tlv.decode(long): not minimal encoding")}else s=i;let a=t.subarray(n,n+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+s)}}},_int:{encode(e){let{Err:t}=rS;if(e<rP)throw new t("integer: negative integers are not allowed");let r=tM(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=rS;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return tH(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=rS,i=tJ("signature",e),{v:s,l:a}=n.decode(48,i);if(a.length)throw new t("invalid signature: left bytes after parsing");let{v:o,l:l}=n.decode(2,s),{v:c,l:u}=n.decode(2,l);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(o),s:r.decode(c)}},hexFromSig(e){let{_tlv:t,_int:r}=rS,n=t.encode(2,r.encode(e.r)),i=t.encode(2,r.encode(e.s));return t.encode(48,n+i)}},rP=BigInt(0),r$=BigInt(1),rk=(BigInt(2),BigInt(3)),rT=BigInt(4),rO=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),rN=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),rR=BigInt(0),rB=BigInt(1),rD=BigInt(2),rM=(e,t)=>(e+t/rD)/t,rU=rf(rO,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),s=BigInt(23),a=BigInt(44),o=BigInt(88),l=e*e*e%rO,c=l*l*e%rO,u=ri(c,t,rO)*c%rO,d=ri(u,t,rO)*c%rO,f=ri(d,rD,rO)*l%rO,h=ri(f,n,rO)*f%rO,p=ri(h,i,rO)*h%rO,y=ri(p,a,rO)*p%rO,m=ri(y,o,rO)*y%rO,g=ri(m,a,rO)*p%rO,b=ri(g,t,rO)*c%rO,w=ri(b,s,rO)*h%rO,v=ri(w,r,rO)*l%rO,x=ri(v,rD,rO);if(!rU.eql(rU.sqr(x),e))throw Error("Cannot find square root");return x}}),rj=function(e,t){let r=t=>(function(e){let t=function(e){let t=rA(e);return t6(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:n,nByteLength:i,nBitLength:s}=t,a=r.BYTES+1,o=2*r.BYTES+1;function l(e){return rn(e,n)}let{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=function(e){var t;let r=function(e){let t=rA(e);t6(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("invalid endo: CURVE.a must be 0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}(e),{Fp:n}=r,i=rf(r.n,r.nBitLength),s=r.toBytes||((e,t,r)=>{let i=t.toAffine();return tY(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),a=r.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function o(e){let{a:t,b:i}=r,s=n.sqr(e),a=n.mul(s,e);return n.add(n.add(a,n.mul(e,t)),i)}function l(e,t){let r=n.sqr(t),i=o(e);return n.eql(r,i)}if(!l(r.Gx,r.Gy))throw Error("bad curve params: generator point");let c=n.mul(n.pow(r.a,rk),rT),u=n.mul(n.sqr(r.b),BigInt(27));if(n.is0(n.add(c,u)))throw Error("bad curve params: a or b");function d(e){let t,{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:s,n:a}=r;if(n&&"bigint"!=typeof e){if(tR(e)&&(e=tF(e)),"string"!=typeof e||!n.includes(e.length))throw Error("invalid private key");e=e.padStart(2*i,"0")}try{t="bigint"==typeof e?e:tH(tJ("private key",e,i))}catch(t){throw Error("invalid private key, expected hex or "+i+" bytes, got "+typeof e)}return s&&(t=rn(t,a)),tX("private key",t,r$,a),t}function f(e){if(!(e instanceof y))throw Error("ProjectivePoint expected")}let h=t3((e,t)=>{let{px:r,py:i,pz:s}=e;if(n.eql(s,n.ONE))return{x:r,y:i};let a=e.is0();null==t&&(t=a?n.ONE:n.inv(s));let o=n.mul(r,t),l=n.mul(i,t),c=n.mul(s,t);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw Error("invZ was invalid");return{x:o,y:l}}),p=t3(e=>{if(e.is0()){if(r.allowInfinityPoint&&!n.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:i}=e.toAffine();if(!n.isValid(t)||!n.isValid(i))throw Error("bad point: x or y not FE");if(!l(t,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class y{constructor(e,t,r){if(null==e||!n.isValid(e))throw Error("x required");if(null==t||!n.isValid(t)||n.is0(t))throw Error("y required");if(null==r||!n.isValid(r))throw Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error("invalid affine point");if(e instanceof y)throw Error("projective point not allowed");let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?y.ZERO:new y(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=rc(n,e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(y.fromAffine)}static fromHex(e){let t=y.fromAffine(a(tJ("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return y.BASE.multiply(d(e))}static msm(e,t){return function(e,t,r,n){if(!Array.isArray(r))throw Error("array expected");r.forEach((t,r)=>{if(!(t instanceof e))throw Error("invalid point at index "+r)});if(!Array.isArray(n))throw Error("array of scalars expected");n.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)});let i=r.length,s=n.length;if(i!==s)throw Error("arrays of points and scalars must have equal length");let a=e.ZERO,o=function(e){let t;for(t=0;e>tO;e>>=tN,t+=1);return t}(BigInt(i)),l=1;o>12?l=o-3:o>4?l=o-2:o>0&&(l=2);let c=t0(l),u=Array(Number(c)+1).fill(a),d=Math.floor((t.BITS-1)/l)*l,f=a;for(let e=d;e>=0;e-=l){u.fill(a);for(let t=0;t<s;t++){let i=Number(n[t]>>BigInt(e)&c);u[i]=u[i].add(r[t])}let t=a;for(let e=u.length-1,r=a;e>0;e--)r=r.add(u[e]),t=t.add(r);if(f=f.add(t),0!==e)for(let e=0;e<l;e++)f=f.double()}return f}(y,i,e,t)}_setWindowSize(e){b.setWindowSize(this,e)}assertValidity(){p(this)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){f(e);let{px:t,py:r,pz:i}=this,{px:s,py:a,pz:o}=e,l=n.eql(n.mul(t,o),n.mul(s,i)),c=n.eql(n.mul(r,o),n.mul(a,i));return l&&c}negate(){return new y(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:t}=r,i=n.mul(t,rk),{px:s,py:a,pz:o}=this,l=n.ZERO,c=n.ZERO,u=n.ZERO,d=n.mul(s,s),f=n.mul(a,a),h=n.mul(o,o),p=n.mul(s,a);return p=n.add(p,p),u=n.mul(s,o),u=n.add(u,u),l=n.mul(e,u),c=n.mul(i,h),c=n.add(l,c),l=n.sub(f,c),c=n.add(f,c),c=n.mul(l,c),l=n.mul(p,l),u=n.mul(i,u),h=n.mul(e,h),p=n.sub(d,h),p=n.mul(e,p),p=n.add(p,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,h),d=n.mul(d,p),c=n.add(c,d),h=n.mul(a,o),h=n.add(h,h),d=n.mul(h,p),l=n.sub(l,d),u=n.mul(h,f),u=n.add(u,u),new y(l,c,u=n.add(u,u))}add(e){f(e);let{px:t,py:i,pz:s}=this,{px:a,py:o,pz:l}=e,c=n.ZERO,u=n.ZERO,d=n.ZERO,h=r.a,p=n.mul(r.b,rk),m=n.mul(t,a),g=n.mul(i,o),b=n.mul(s,l),w=n.add(t,i),v=n.add(a,o);w=n.mul(w,v),v=n.add(m,g),w=n.sub(w,v),v=n.add(t,s);let x=n.add(a,l);return v=n.mul(v,x),x=n.add(m,b),v=n.sub(v,x),x=n.add(i,s),c=n.add(o,l),x=n.mul(x,c),c=n.add(g,b),x=n.sub(x,c),d=n.mul(h,v),c=n.mul(p,b),d=n.add(c,d),c=n.sub(g,d),d=n.add(g,d),u=n.mul(c,d),g=n.add(m,m),g=n.add(g,m),b=n.mul(h,b),v=n.mul(p,v),g=n.add(g,b),b=n.sub(m,b),b=n.mul(h,b),v=n.add(v,b),m=n.mul(g,v),u=n.add(u,m),m=n.mul(x,v),c=n.mul(w,c),c=n.sub(c,m),m=n.mul(w,g),d=n.mul(x,d),new y(c,u,d=n.add(d,m))}subtract(e){return this.add(e.negate())}is0(){return this.equals(y.ZERO)}wNAF(e){return b.wNAFCached(this,e,y.normalizeZ)}multiplyUnsafe(e){let{endo:t,n:i}=r;tX("scalar",e,rP,i);let s=y.ZERO;if(e===rP)return s;if(this.is0()||e===r$)return this;if(!t||b.hasPrecomputes(this))return b.wNAFCachedUnsafe(this,e,y.normalizeZ);let{k1neg:a,k1:o,k2neg:l,k2:c}=t.splitScalar(e),u=s,d=s,f=this;for(;o>rP||c>rP;)o&r$&&(u=u.add(f)),c&r$&&(d=d.add(f)),f=f.double(),o>>=r$,c>>=r$;return a&&(u=u.negate()),l&&(d=d.negate()),d=new y(n.mul(d.px,t.beta),d.py,d.pz),u.add(d)}multiply(e){let t,i,{endo:s,n:a}=r;if(tX("scalar",e,r$,a),s){let{k1neg:r,k1:a,k2neg:o,k2:l}=s.splitScalar(e),{p:c,f:u}=this.wNAF(a),{p:d,f:f}=this.wNAF(l);c=b.constTimeNegate(r,c),d=b.constTimeNegate(o,d),d=new y(n.mul(d.px,s.beta),d.py,d.pz),t=c.add(d),i=u.add(f)}else{let{p:r,f:n}=this.wNAF(e);t=r,i=n}return y.normalizeZ([t,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=y.BASE,i=(e,t)=>t!==rP&&t!==r$&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,r));return s.is0()?void 0:s}toAffine(e){return h(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=r;if(e===r$)return!0;if(t)return t(y,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=r;return e===r$?this:t?t(y,this):this.multiplyUnsafe(r.h)}toRawBytes(e=!0){return tD("isCompressed",e),this.assertValidity(),s(y,this,e)}toHex(e=!0){return tD("isCompressed",e),tF(this.toRawBytes(e))}}y.BASE=new y(r.Gx,r.Gy,n.ONE),y.ZERO=new y(n.ZERO,n.ONE,n.ZERO);let{endo:m,nBitLength:g}=r,b=(t=m?Math.ceil(g/2):g,{constTimeNegate:rg,hasPrecomputes:e=>1!==rE(e),unsafeLadder(e,t,r=y.ZERO){let n=e;for(;t>ry;)t&rm&&(r=r.add(n)),n=n.double(),t>>=rm;return r},precomputeWindow(e,r){let{windows:n,windowSize:i}=rw(r,t),s=[],a=e,o=a;for(let e=0;e<n;e++){o=a,s.push(o);for(let e=1;e<i;e++)o=o.add(a),s.push(o);a=o.double()}return s},wNAF(e,r,n){let i=y.ZERO,s=y.BASE,a=rw(e,t);for(let e=0;e<a.windows;e++){let{nextN:t,offset:o,isZero:l,isNeg:c,isNegF:u,offsetF:d}=rv(n,e,a);n=t,l?s=s.add(rg(u,r[d])):i=i.add(rg(c,r[o]))}return{p:i,f:s}},wNAFUnsafe(e,r,n,i=y.ZERO){let s=rw(e,t);for(let e=0;e<s.windows&&n!==ry;e++){let{nextN:t,offset:a,isZero:o,isNeg:l}=rv(n,e,s);if(n=t,!o){let e=r[a];i=i.add(l?e.negate():e)}}return i},getPrecomputes(e,t,r){let n=rx.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&rx.set(t,r(n))),n},wNAFCached(e,t,r){let n=rE(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=rE(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){rb(r,t),r_.set(e,r),rx.delete(e)}});return{CURVE:r,ProjectivePoint:y,normPrivateKeyToScalar:d,weierstrassEquation:o,isWithinCurveOrder:function(e){return tQ(e,r$,r.n)}}}({...t,toBytes(e,t,n){let i=t.toAffine(),s=r.toBytes(i.x);return(tD("isCompressed",n),n)?tY(Uint8Array.from([t.hasEvenY()?2:3]),s):tY(Uint8Array.from([4]),s,r.toBytes(i.y))},fromBytes(e){let t=e.length,n=e[0],i=e.subarray(1);if(t===a&&(2===n||3===n)){let e,t=tH(i);if(!tQ(t,r$,r.ORDER))throw Error("Point is not on curve");let s=d(t);try{e=r.sqrt(s)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&n)==1!=((e&r$)===r$)&&(e=r.neg(e)),{x:t,y:e}}if(t===o&&4===n)return{x:r.fromBytes(i.subarray(0,r.BYTES)),y:r.fromBytes(i.subarray(r.BYTES,2*r.BYTES))};throw Error("invalid Point, expected length of "+a+", or uncompressed "+o+", got "+t)}}),h=(e,t,r)=>tH(e.slice(t,r));class p{constructor(e,t,r){tX("r",e,r$,n),tX("s",t,r$,n),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){return new p(h(e=tJ("compactSignature",e,2*i),0,i),h(e,i,2*i))}static fromDER(e){let{r:t,s:r}=rS.toSig(tJ("DER",e));return new p(t,r)}assertValidity(){}addRecoveryBit(e){return new p(this.r,this.s,e)}recoverPublicKey(e){let{r:i,s,recovery:a}=this,o=g(tJ("msgHash",e));if(null==a||![0,1,2,3].includes(a))throw Error("recovery id invalid");let u=2===a||3===a?i+t.n:i;if(u>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let d=(1&a)==0?"02":"03",f=c.fromHex(d+tF(tV(u,r.BYTES))),h=rs(u,n),p=l(-o*h),y=l(s*h),m=c.BASE.multiplyAndAddUnsafe(f,p,y);if(!m)throw Error("point at infinify");return m.assertValidity(),m}hasHighS(){return this.s>n>>r$}normalizeS(){return this.hasHighS()?new p(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return tW(this.toDERHex())}toDERHex(){return rS.hexFromSig(this)}toCompactRawBytes(){return tW(this.toCompactHex())}toCompactHex(){return tF(tV(this.r,i))+tF(tV(this.s,i))}}function y(e){if("bigint"==typeof e)return!1;if(e instanceof c)return!0;let n=tJ("key",e).length,s=r.BYTES,a=s+1;if(!t.allowedPrivateKeyLengths&&i!==a)return n===a||n===2*s+1}let m=t.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=tH(e),r=8*e.length-s;return r>0?t>>BigInt(r):t},g=t.bits2int_modN||function(e){return l(m(e))},b=t0(s);function w(e){return tX("num < 2^"+s,e,rP,b),tV(e,i)}let v={lowS:t.lowS,prehash:!1},x={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(!0===y(e))throw Error("first arg must be private key");if(!1===y(t))throw Error("second arg must be public key");return c.fromHex(t).multiply(u(e)).toRawBytes(r)},sign:function(e,i,s=v){let{seed:a,k2sig:o}=function(e,i,s=v){if(["recovered","canonical"].some(e=>e in s))throw Error("sign() legacy options not supported");let{hash:a,randomBytes:o}=t,{lowS:d,prehash:h,extraEntropy:y}=s;null==d&&(d=!0),e=tJ("msgHash",e),rI(s),h&&(e=tJ("prehashed msgHash",a(e)));let b=g(e),x=u(i),_=[w(x),w(b)];if(null!=y&&!1!==y){let e=!0===y?o(r.BYTES):y;_.push(tJ("extraEntropy",e))}return{seed:tY(..._),k2sig:function(e){var t;let r=m(e);if(!f(r))return;let i=rs(r,n),s=c.BASE.multiply(r).toAffine(),a=l(s.x);if(a===rP)return;let o=l(i*l(b+a*x));if(o===rP)return;let u=2*(s.x!==a)|Number(s.y&r$),h=o;return d&&o>n>>r$&&(h=(t=o)>n>>r$?l(-t):t,u^=1),new p(a,h,u)}}}(e,i,s);return(function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=t1(e),i=t1(e),s=0,a=()=>{n.fill(1),i.fill(0),s=0},o=(...e)=>r(i,n,...e),l=(e=t1(0))=>{i=o(t2([0]),e),n=o(),0!==e.length&&(i=o(t2([1]),e),n=o())},c=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=o()).slice();r.push(t),e+=n.length}return tY(...r)};return(e,t)=>{let r;for(a(),l(e);!(r=t(c()));)l();return a(),r}})(t.hash.outputLen,t.nByteLength,t.hmac)(a,o)},verify:function(e,r,i,s=x){let a,o;r=tJ("msgHash",r),i=tJ("publicKey",i);let{lowS:u,prehash:d,format:f}=s;if(rI(s),"strict"in s)throw Error("options.strict was renamed to lowS");if(void 0!==f&&"compact"!==f&&"der"!==f)throw Error("format must be compact or der");let h="string"==typeof e||tR(e),y=!h&&!f&&"object"==typeof e&&null!==e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!h&&!y)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(y&&(o=new p(e.r,e.s)),h){try{"compact"!==f&&(o=p.fromDER(e))}catch(e){if(!(e instanceof rS.Err))throw e}o||"der"===f||(o=p.fromCompact(e))}a=c.fromHex(i)}catch(e){return!1}if(!o||u&&o.hasHighS())return!1;d&&(r=t.hash(r));let{r:m,s:b}=o,w=g(r),v=rs(b,n),_=l(w*v),E=l(m*v),A=c.BASE.multiplyAndAddUnsafe(a,_,E)?.toAffine();return!!A&&l(A.x)===m},ProjectivePoint:c,Signature:p,utils:{isValidPrivateKey(e){try{return u(e),!0}catch(e){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let e=rp(t.n);return function(e,t,r=!1){let n=e.length,i=rh(t),s=rp(t);if(n<16||n<s||n>1024)throw Error("expected "+s+"-1024 bytes of input, got "+n);let a=rn(r?tK(e):tH(e),t-t4)+t4;return r?tG(a,i):tV(a,i)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...e,...{hash:t,hmac:(e,...r)=>(0,tT.w)(t,e,(0,eC.Id)(...r)),randomBytes:eC.po}});return{...r(t),create:r}}({a:rR,b:BigInt(7),Fp:rU,n:rN,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-rB*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),s=rM(t*e,rN),a=rM(-r*e,rN),o=rn(e-s*t-a*n,rN),l=rn(-s*r-a*t,rN),c=o>i,u=l>i;if(c&&(o=rN-o),u&&(l=rN-l),o>i||l>i)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:c,k1:o,k2neg:u,k2:l}}}},tk.sc),rL={zero:48,nine:57,A:65,F:70,a:97,f:102};function rF(e){return e>=rL.zero&&e<=rL.nine?e-rL.zero:e>=rL.A&&e<=rL.F?e-(rL.A-10):e>=rL.a&&e<=rL.f?e-(rL.a-10):void 0}let rz=new TextEncoder;class rq extends tu{constructor(e){super(`Value \`${"object"==typeof e?th(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}class rW extends tu{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class rH extends tu{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}class rK extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}let rV={checksum:new rK(8192)}.checksum;var rG=r(11577);function rJ(e,t={}){var r;let{as:n="string"==typeof e?"Hex":"Bytes"}=t,i=(0,rG.lY)(e instanceof Uint8Array?e:"string"==typeof e?function(e,t={}){let{size:r}=t,n=e;r&&(td(e,r),n=tb(e,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);let s=i.length/2,a=new Uint8Array(s);for(let e=0,t=0;e<s;e++){let r=rF(i.charCodeAt(t++)),n=rF(i.charCodeAt(t++));if(void 0===r||void 0===n)throw new tu(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);a[e]=16*r+n}return a}(e):(r=e)instanceof Uint8Array?r:new Uint8Array(r));return"Bytes"===n?i:tm(i)}function rY(e,t={}){let{compressed:r}=t,{prefix:n,x:i,y:s}=e;if(!1===r||"bigint"==typeof i&&"bigint"==typeof s){if(4!==n)throw new rX({prefix:n,cause:new r1});return}if(!0===r||"bigint"==typeof i&&void 0===s){if(3!==n&&2!==n)throw new rX({prefix:n,cause:new r0});return}throw new rQ({publicKey:e})}function rZ(e){if(132!==e.length&&130!==e.length&&68!==e.length)throw new r2({publicKey:e});if(130===e.length)return{prefix:4,x:BigInt(tw(e,0,32)),y:BigInt(tw(e,32,64))};if(132===e.length){let t=Number(tw(e,0,1));return{prefix:t,x:BigInt(tw(e,1,33)),y:BigInt(tw(e,33,65))}}return{prefix:Number(tw(e,0,1)),x:BigInt(tw(e,1,33))}}class rQ extends tu{constructor({publicKey:e}){super(`Value \`${th(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class rX extends tu{constructor({prefix:e,cause:t}){super(`Prefix "${e}
197" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class r0 extends tu{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class r1 extends tu{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}class r2 extends tu{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${tv(ty(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}let r5=/^0x[a-fA-F0-9]{40}$/;function r6(e,t={}){let{strict:r=!0}=t;if(!r5.test(e))throw new r8({address:e,cause:new r4});if(r){if(e.toLowerCase()===e)return;if(r3(e)!==e)throw new r8({address:e,cause:new r9})}}function r3(e){if(rV.has(e))return rV.get(e);r6(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=rJ(function(e,t={}){let{size:r}=t,n=rz.encode(e);if("number"==typeof r){var i;if(n.length>r)throw new rW({givenSize:n.length,maxSize:r});return i=n,function(e,t={}){let{dir:r,size:n=32}=t;if(0===n)return e;if(e.length>n)throw new rH({size:e.length,targetSize:n,type:"Bytes"});let i=new Uint8Array(n);for(let t=0;t<n;t++){let s="right"===r;i[s?t:n-t-1]=e[s?t:e.length-t-1]}return i}(i,{dir:"right",size:r})}return n}(t),{as:"Bytes"}),n=t.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&n[e]&&(n[e]=n[e].toUpperCase()),(15&r[e>>1])>=8&&n[e+1]&&(n[e+1]=n[e+1].toUpperCase());let i=`0x${n.join("")}`;return rV.set(e,i),i}class r8 extends tu{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class r4 extends tu{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class r9 extends tu{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}var r7=r(86890),ne=r(97442),nt=r(22395),nr=r(51731),nn=r(73058),ni=r(84243),ns=r(92672),na=r(80619),no=r(77557),nl=r.n(no),nc=r(95912);let nu={level:"info"},nd="custom_context";var nf=Object.defineProperty,nh=(e,t,r)=>((e,t,r)=>t in e?nf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class np{constructor(e){nh(this,"nodeValue"),nh(this,"sizeInBytes"),nh(this,"next"),this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class ny{constructor(e){nh(this,"lengthInNodes"),nh(this,"sizeInBytes"),nh(this,"head"),nh(this,"tail"),nh(this,"maxSizeInBytes"),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){let t=new np(e);if(t.size>this.maxSizeInBytes)throw Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?this.tail&&(this.tail.next=t):this.head=t,this.tail=t,this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;let e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){let e=[],t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};let t=e.value;return e=e.next,{done:!1,value:t}}}}}var nm=Object.defineProperty,ng=(e,t,r)=>((e,t,r)=>t in e?nm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class nb{constructor(e,t=1024e3){ng(this,"logs"),ng(this,"level"),ng(this,"levelValue"),ng(this,"MAX_LOG_SIZE_IN_BYTES"),this.level=e??"error",this.levelValue=no.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new ny(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===no.levels.values.error?console.error(e):t===no.levels.values.warn?console.warn(e):t===no.levels.values.debug?console.debug(e):t===no.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append((0,nc.h)({timestamp:new Date().toISOString(),log:e}));let t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new ny(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){let t=this.getLogArray();return t.push((0,nc.h)({extraMetadata:e})),new Blob(t,{type:"application/json"})}}var nw=Object.defineProperty;
197class nv{constructor(e,t=1024e3){((e,t,r)=>((e,t,r)=>t in e?nw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r))(this,"baseChunkLogger"),this.baseChunkLogger=new nb(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){let t=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=t,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}}var nx=Object.defineProperty;class n_{constructor(e,t=1024e3){((e,t,r)=>((e,t,r)=>t in e?nx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r))(this,"baseChunkLogger"),this.baseChunkLogger=new nb(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var nE=Object.defineProperty,nA=Object.defineProperties,nI=Object.getOwnPropertyDescriptors,nC=Object.getOwnPropertySymbols,nS=Object.prototype.hasOwnProperty,nP=Object.prototype.propertyIsEnumerable,n$=(e,t,r)=>t in e?nE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nk=(e,t)=>{for(var r in t||(t={}))nS.call(t,r)&&n$(e,r,t[r]);if(nC)for(var r of nC(t))nP.call(t,r)&&n$(e,r,t[r]);return e},nT=(e,t)=>nA(e,nI(t));function nO(e,t=nd){return e[t]||""}function nN(e,t,r=nd){let n=function(e,t,r=nd){let n=nO(e,r);return n.trim()?`${n}/${t}`:t}(e,t,r);return function(e,t,r=nd){return e[r]=t,e}(e.child({context:n}),n,r)}function nR(e){return"u">typeof e.loggerOverride&&"string"!=typeof e.loggerOverride?{logger:e.loggerOverride,chunkLoggerController:null}:"u">typeof window?function(e){var t,r;let n=new nv(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:nl()(nT(nk({},e.opts),{level:"trace",browser:nT(nk({},null==(r=e.opts)?void 0:r.browser),{write:e=>n.write(e)})})),chunkLoggerController:n}}(e):function(e){var t;let r=new n_(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:nl()(nT(nk({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}(e)}var nB=r(88304),nD=r(98539).hp;function nM(e){let[t,r]=e.split(":");return{namespace:t,reference:r}}function nU(e,t=[]){let r=[];return Object.keys(e).forEach(n=>{if(t.length&&!t.includes(n))return;let i=e[n];r.push(...i.accounts)}),r}function nj(e,t){return e.includes(":")?[e]:t.chains||[]}var nL=Object.defineProperty,nF=Object.defineProperties,nz=Object.getOwnPropertyDescriptors,nq=Object.getOwnPropertySymbols,nW=Object.prototype.hasOwnProperty,nH=Object.prototype.propertyIsEnumerable,nK=(e,t,r)=>t in e?nL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nV=(e,t)=>{for(var r in t||(t={}))nW.call(t,r)&&nK(e,r,t[r]);if(nq)for(var r of nq(t))nH.call(t,r)&&nK(e,r,t[r]);return e},nG=(e,t,r)=>nK(e,"symbol"!=typeof t?t+"":t,r);let nJ={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"};function nY(){return"u">typeof nB&&"u">typeof nB.versions&&"u">typeof nB.versions.node}function nZ(){return!(0,tl.getDocument)()&&!!(0,tl.getNavigator)()&&"ReactNative"===navigator.product}function nQ(){return!nY()&&!!(0,tl.getNavigator)()&&!!(0,tl.getDocument)()}function nX(){return nZ()?nJ.reactNative:nY()?nJ.node:nQ()?nJ.browser:nJ.unknown}function n0(){var e;try{return nZ()&&"u">typeof global&&"u">typeof(null==global?void 0:global.Application)?null==(e=global.Application)?void 0:e.applicationId:void 0}catch{return}}function n1(){return(0,tc.g)()||{name:"",description:"",url:"",icons:[""]}}function n2(e,t,r){let n=function(){if(nX()===nJ.reactNative&&"u">typeof global&&"u">typeof(null==global?void 0:global.Platform)){let{OS:e,Version:t}=global.Platform;return[e,t].join("-")}let e=(0,ta.o0)();if(null===e)return"unknown";let t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}(),i=function(){var e;let t=nX();return t===nJ.browser?[t,(null==(e=(0,tl.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),["js",r].join("-"),n,i].join("/")}function n5(e,t){return e.filter(e=>t.includes(e)).length===e.length}function n6(e){return Object.fromEntries(e.entries())}function n3(e){return new Map(Object.entries(e))}function n8(e=to.FIVE_MINUTES,t){let r,n,i,s,a=(0,to.toMiliseconds)(e||to.FIVE_MINUTES);return{resolve:e=>{i&&r&&(clearTimeout(i),r(e),s=Promise.resolve(e))},reject:e=>{i&&n&&(clearTimeout(i),n(e))},done:()=>new Promise((e,o)=>{if(s)return e(s);i=setTimeout(()=>{let e=Error(t);s=Promise.reject(e),o(e)},a),r=e,n=o})}}function n4(e,t,r){return new Promise(async(n,i)=>{let s=setTimeout(()=>i(Error(r)),t);try{let t=await e;n(t)}catch(e){i(e)}clearTimeout(s)})}function n9(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw Error(`Unknown expirer target type: ${e}`)}function n7(e){let[t,r]=e.split(":"),n={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)n.topic=r;else if("id"===t&&Number.isInteger(Number(r)))n.id=Number(r);else throw Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);return n}function ie(e,t){return(0,to.fromMiliseconds)((t||Date.now())+(0,to.toMiliseconds)(e))}function it(e){return Date.now()>=(0,to.toMiliseconds)(e)}function ir(e,t){return`${e}${t?`:${t}`:""}`}function ii(e=[],t=[]){return[...new Set([...e,...t])]}async function is({id:e,topic:t,wcDeepLink:r}){var n,i;try{if(!r)return;let s="string"==typeof r?JSON.parse(r):r,a=s?.href;if("string"!=typeof a)return;let o=function(e,t,r){let n=`requestId=${t}&sessionTopic=${r}`;e.endsWith("/")&&(e=e.slice(0,-1));let i=`${e}`;if(e.startsWith("https://t.me")){let t=e.includes("?")?"&startapp=":"?startapp=";i=`${i}${t}${function(e,t=!1){let r=nD.from(e).toString("base64");return t?r.replace(/[=]/g,""):r}(n,!0)}`}else i=`${i}/wc?${n}`;return i}(a,e,t),l=nX();if(l===nJ.browser){let e;if(!(null!=(n=(0,tl.getDocument)())&&n.hasFocus()))return void console.warn("Document does not have focus, skipping deeplink.");i=o,e="_self",!function(){try{return window.self!==window.top}catch{return!1}}()?("u">typeof window&&(window.TelegramWebviewProxy||window.Telegram||window.TelegramWebviewProxyProto)||i.startsWith("https://")||i.startsWith("http://"))&&(e="_blank"):e="_top",window.open(i,e,"noreferrer noopener")}else l===nJ.reactNative&&"u">typeof(null==global?void 0:global.Linking)&&await global.Linking.openURL(o)}catch(e){console.error(e)}}async function ia(e,t){let r="";try{if(nQ()&&(r=localStorage.getItem(t)))return r;r=await e.getItem(t)}catch(e){console.error(e)}return r}function io(e,t){if(!e.includes(t))return null;let r=e.split(/([&,?,=])/),n=r.indexOf(t);return r[n+2]}function il(){return"u">typeof crypto&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function ic(){return"u">typeof nB&&"true"===nB.env.IS_VITEST}function iu(e){return nD.from(e,"base64").toString("utf-8")}
197class id{constructor({limit:e}){nG(this,"limit"),nG(this,"set"),this.limit=e,this.set=new Set}add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){let e=this.set.values().next().value;e&&this.set.delete(e)}this.set.add(e)}}has(e){return this.set.has(e)}}let ih=BigInt(0x100000000-1),ip=BigInt(32);function iy(e,t=!1){return t?{h:Number(e&ih),l:Number(e>>ip&ih)}:{h:0|Number(e>>ip&ih),l:0|Number(e&ih)}}function im(e,t=!1){let r=e.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){let{h:r,l:a}=iy(e[s],t);[n[s],i[s]]=[r,a]}return[n,i]}let ig=(e,t,r)=>e>>>r,ib=(e,t,r)=>e<<32-r|t>>>r,iw=(e,t,r)=>e>>>r|t<<32-r,iv=(e,t,r)=>e<<32-r|t>>>r,ix=(e,t,r)=>e<<64-r|t>>>r-32,i_=(e,t,r)=>e>>>r-32|t<<64-r;function iE(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}let iA=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),iI=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0,iC=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),iS=(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0,iP=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),i$=(e,t,r,n,i,s)=>t+r+n+i+s+(e/0x100000000|0)|0,ik="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function iT(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function iO(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function iN(e,...t){if(!iT(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 iR(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");iO(e.outputLen),iO(e.blockLen)}function iB(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")}function iD(e,t){iN(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function iM(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function iU(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ij(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function iL(e,t){return e<<32-t|e>>>t}let iF=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function iz(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}let iq=iF?e=>e:e=>iz(e),iW=iF?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=iz(e[t]);return e},iH="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,iK=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function iV(e){if(iN(e),iH)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=iK[e[r]];return t}let iG={_0:48,_9:57,A:65,F:70,a:97,f:102};function iJ(e){return e>=iG._0&&e<=iG._9?e-iG._0:e>=iG.A&&e<=iG.F?e-(iG.A-10):e>=iG.a&&e<=iG.f?e-(iG.a-10):void 0}function iY(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(iH)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=iJ(e.charCodeAt(i)),s=iJ(e.charCodeAt(i+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+s}return n}function iZ(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function iQ(e){return"string"==typeof e&&(e=iZ(e)),iN(e),e}function iX(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];iN(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}class i0{}function i1(e){let t=t=>e().update(iQ(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function i2(e=32){if(ik&&"function"==typeof ik.getRandomValues)return ik.getRandomValues(new Uint8Array(e));if(ik&&"function"==typeof ik.randomBytes)return Uint8Array.from(ik.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}let i5=BigInt(0),i6=BigInt(1),i3=BigInt(2),i8=BigInt(7),i4=BigInt(256),i9=BigInt(113),i7=[],se=[],st=[];for(let e=0,t=i6,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],i7.push(2*(5*n+r)),se.push((e+1)*(e+2)/2%64);let i=i5;for(let e=0;e<7;e++)(t=(t<<i6^(t>>i8)*i9)%i4)&i3&&(i^=i6<<(i6<<BigInt(e))-i6);st.push(i)}let sr=im(st,!0),sn=sr[0],si=sr[1],ss=(e,t,r)=>r>32?((e,t,r)=>t<<r-32|e>>>64-r)(e,t,r):((e,t,r)=>e<<r|t>>>32-r)(e,t,r),sa=(e,t,r)=>r>32?((e,t,r)=>e<<r-32|t>>>64-r)(e,t,r):((e,t,r)=>t<<r|e>>>32-r)(e,t,r);class so extends i0{constructor(e,t,r,n=!1,i=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=r,this.enableXOF=n,this.rounds=i,iO(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=iM(this.state)}clone(){return this._cloneInto()}keccak(){iW(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,s=r[i],a=r[i+1],o=ss(s,a,1)^r[n],l=sa(s,a,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=se[r],s=ss(t,i,n),a=sa(t,i,n),o=i7[r];t=e[o],i=e[o+1],e[o]=s,e[o+1]=a}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=sn[n],e[1]^=si[n]}iU(r)}(this.state32,this.rounds),iW(this.state32),this.posOut=0,this.pos=0}update(e){iB(this),iN(e=iQ(e));let{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){let s=Math.min(t-this.pos,n-i);for(let t=0;t<s;t++)r[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:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){iB(this,!1),iN(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return iO(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(iD(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,iU(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new so(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}let sl=i1(()=>new so(136,1,32));class sc extends i0{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=ij(this.buffer)}update(e){iB(this),iN(e=iQ(e));let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let s=0;s<i;){let a=Math.min(n-this.pos,i-s);if(a===n){let t=ij(e);for(;n<=i-s;
197s+=n)this.process(t,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){iB(this),iD(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:s}=this;t[s++]=128,iU(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let e=s;e<n;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(0xffffffff),a=Number(r>>i&s),o=Number(r&s),l=4*!!n,c=4*!n;e.setUint32(t+l,a,n),e.setUint32(t+c,o,n)})(r,n-8,BigInt(8*this.length),i),this.process(r,0);let a=ij(e),o=this.outputLen;if(o%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=o/4,c=this.get();if(l>c.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)a.setUint32(4*e,c[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:a}=this;return e.destroyed=s,e.finished=i,e.length=n,e.pos=a,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}let su=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),sd=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),sf=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),sh=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),sp=new Uint32Array(64);class sy extends sc{constructor(e=32){super(64,e,8,!1),this.A=0|su[0],this.B=0|su[1],this.C=0|su[2],this.D=0|su[3],this.E=0|su[4],this.F=0|su[5],this.G=0|su[6],this.H=0|su[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:a,H:o}=this;return[e,t,r,n,i,s,a,o]}set(e,t,r,n,i,s,a,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|a,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)sp[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=sp[e-15],r=sp[e-2],n=iL(t,7)^iL(t,18)^t>>>3,i=iL(r,17)^iL(r,19)^r>>>10;sp[e]=i+sp[e-7]+n+sp[e-16]|0}let{A:r,B:n,C:i,D:s,E:a,F:o,G:l,H:c}=this;for(let e=0;e<64;e++){var u,d,f,h;let t=c+(iL(a,6)^iL(a,11)^iL(a,25))+((u=a)&o^~u&l)+sh[e]+sp[e]|0,p=(iL(r,2)^iL(r,13)^iL(r,22))+((d=r)&(f=n)^d&(h=i)^f&h)|0;c=l,l=o,o=a,a=s+t|0,s=i,i=n,n=r,r=t+p|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,o=o+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(r,n,i,s,a,o,l,c)}roundClean(){iU(sp)}destroy(){this.set(0,0,0,0,0,0,0,0),iU(this.buffer)}}let sm=im(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a854
1976d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),sg=sm[0],sb=sm[1],sw=new Uint32Array(80),sv=new Uint32Array(80);class sx extends sc{constructor(e=64){super(128,e,16,!1),this.Ah=0|sf[0],this.Al=0|sf[1],this.Bh=0|sf[2],this.Bl=0|sf[3],this.Ch=0|sf[4],this.Cl=0|sf[5],this.Dh=0|sf[6],this.Dl=0|sf[7],this.Eh=0|sf[8],this.El=0|sf[9],this.Fh=0|sf[10],this.Fl=0|sf[11],this.Gh=0|sf[12],this.Gl=0|sf[13],this.Hh=0|sf[14],this.Hl=0|sf[15]}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:a,Dl:o,Eh:l,El:c,Fh:u,Fl:d,Gh:f,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,i,s,a,o,l,c,u,d,f,h,p,y]}set(e,t,r,n,i,s,a,o,l,c,u,d,f,h,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|l,this.El=0|c,this.Fh=0|u,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)sw[r]=e.getUint32(t),sv[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|sw[e-15],r=0|sv[e-15],n=iw(t,r,1)^iw(t,r,8)^ig(t,r,7),i=iv(t,r,1)^iv(t,r,8)^ib(t,r,7),s=0|sw[e-2],a=0|sv[e-2],o=iw(s,a,19)^ix(s,a,61)^ig(s,a,6),l=iC(i,iv(s,a,19)^i_(s,a,61)^ib(s,a,6),sv[e-7],sv[e-16]
197),c=iS(l,n,o,sw[e-7],sw[e-16]);sw[e]=0|c,sv[e]=0|l}let{Ah:r,Al:n,Bh:i,Bl:s,Ch:a,Cl:o,Dh:l,Dl:c,Eh:u,El:d,Fh:f,Fl:h,Gh:p,Gl:y,Hh:m,Hl:g}=this;for(let e=0;e<80;e++){let t=iw(u,d,14)^iw(u,d,18)^ix(u,d,41),b=iv(u,d,14)^iv(u,d,18)^i_(u,d,41),w=u&f^~u&p,v=iP(g,b,d&h^~d&y,sb[e],sv[e]),x=i$(v,m,t,w,sg[e],sw[e]),_=0|v,E=iw(r,n,28)^ix(r,n,34)^ix(r,n,39),A=iv(r,n,28)^i_(r,n,34)^i_(r,n,39),I=r&i^r&a^i&a,C=n&s^n&o^s&o;m=0|p,g=0|y,p=0|f,y=0|h,f=0|u,h=0|d,({h:u,l:d}=iE(0|l,0|c,0|x,0|_)),l=0|a,c=0|o,a=0|i,o=0|s,i=0|r,s=0|n;let S=iA(_,A,C);r=iI(S,x,E,I),n=0|S}({h:r,l:n}=iE(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:s}=iE(0|this.Bh,0|this.Bl,0|i,0|s)),({h:a,l:o}=iE(0|this.Ch,0|this.Cl,0|a,0|o)),({h:l,l:c}=iE(0|this.Dh,0|this.Dl,0|l,0|c)),({h:u,l:d}=iE(0|this.Eh,0|this.El,0|u,0|d)),({h:f,l:h}=iE(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:y}=iE(0|this.Gh,0|this.Gl,0|p,0|y)),({h:m,l:g}=iE(0|this.Hh,0|this.Hl,0|m,0|g)),this.set(r,n,i,s,a,o,l,c,u,d,f,h,p,y,m,g)}roundClean(){iU(sw,sv)}destroy(){iU(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class s_ extends sx{constructor(){super(48),this.Ah=0|sd[0],this.Al=0|sd[1],this.Bh=0|sd[2],this.Bl=0|sd[3],this.Ch=0|sd[4],this.Cl=0|sd[5],this.Dh=0|sd[6],this.Dl=0|sd[7],this.Eh=0|sd[8],this.El=0|sd[9],this.Fh=0|sd[10],this.Fl=0|sd[11],this.Gh=0|sd[12],this.Gl=0|sd[13],this.Hh=0|sd[14],this.Hl=0|sd[15]}}let sE=Uint32Array.from([0x22312194,0xfc2bf72c,0x9f555fa3,0xc84c64c2,0x2393b86b,0x6f53b151,0x96387719,0x5940eabd,0x96283ee2,0xa88effe3,0xbe5e1e25,0x53863992,0x2b0199fc,0x2c85b8aa,0xeb72ddc,0x81c52ca2]);class sA extends sx{constructor(){super(32),this.Ah=0|sE[0],this.Al=0|sE[1],this.Bh=0|sE[2],this.Bl=0|sE[3],this.Ch=0|sE[4],this.Cl=0|sE[5],this.Dh=0|sE[6],this.Dl=0|sE[7],this.Eh=0|sE[8],this.El=0|sE[9],this.Fh=0|sE[10],this.Fl=0|sE[11],this.Gh=0|sE[12],this.Gl=0|sE[13],this.Hh=0|sE[14],this.Hl=0|sE[15]}}let sI=i1(()=>new sy),sC=i1(()=>new sx),sS=i1(()=>new s_),sP=i1(()=>new sA),s$=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),sk=Uint32Array.from([0xf3bcc908,0x6a09e667,0x84caa73b,0xbb67ae85,0xfe94f82b,0x3c6ef372,0x5f1d36f1,0xa54ff53a,0xade682d1,0x510e527f,0x2b3e6c1f,0x9b05688c,0xfb41bd6b,0x1f83d9ab,0x137e2179,0x5be0cd19]),sT=new Uint32Array(32);function sO(e,t,r,n,i,s){let a=i[s],o=i[s+1],l=sT[2*e],c=sT[2*e+1],u=sT[2*t],d=sT[2*t+1],f=sT[2*r],h=sT[2*r+1],p=sT[2*n],y=sT[2*n+1],m=iA(l,u,a);c=iI(m,c,d,o),l=0|m,({Dh:y,Dl:p}={Dh:y^c,Dl:p^l}),({Dh:y,Dl:p}={Dh:p,Dl:y}),({h,l:f}=iE(h,f,y,p)),({Bh:d,Bl:u}={Bh:d^h,Bl:u^f}),({Bh:d,Bl:u}={Bh:iw(d,u,24),Bl:iv(d,u,24)}),sT[2*e]=l,sT[2*e+1]=c,sT[2*t]=u,sT[2*t+1]=d,sT[2*r]=f,sT[2*r+1]=h,sT[2*n]=p,sT[2*n+1]=y}function sN(e,t,r,n,i,s){let a=i[s],o=i[s+1],l=sT[2*e],c=sT[2*e+1],u=sT[2*t],d=sT[2*t+1],f=sT[2*r],h=sT[2*r+1],p=sT[2*n],y=sT[2*n+1],m=iA(l,u,a);c=iI(m,c,d,o),l=0|m,({Dh:y,Dl:p}={Dh:y^c,Dl:p^l}),({Dh:y,Dl:p}={Dh:iw(y,p,16),Dl:iv(y,p,16)}),({h,l:f}=iE(h,f,y,p)),({Bh:d,Bl:u}={Bh:d^h,Bl:u^f}),({Bh:d,Bl:u}={Bh:ix(d,u,63),Bl:i_(d,u,63)}),sT[2*e]=l,sT[2*e+1]=c,sT[2*t]=u,sT[2*t+1]=d,sT[2*r]=f,sT[2*r+1]=h,sT[2*n]=p,sT[2*n+1]=y}class sR extends i0{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,iO(e),iO(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=iM(this.buffer)}update(e){iB(this),iN(e=iQ(e));let{blockLen:t,buffer:r,buffer32:n}=this,i=e.length,s=e.byteOffset,a=e.buffer;for(let o=0;o<i;){this.pos===t&&(iW(n),this.compress(n,0,!1),iW(n),this.pos=0);let l=Math.min(t-this.pos,i-o),c=s+o;if(l===t&&!(c%4)&&o+l<i){let e=new Uint32Array(a,c,Math.floor((i-o)/4));iW(e);for(let r=0;o+t<i;r+=n.length,o+=t)this.length+=t,this.compress(e,r,!1);iW(e);continue}r.set(e.subarray(o,o+l),this.pos),this.pos+=l,this.length+=l,o+=l}return this}digestInto(e){iB(this),iD(e,this);let{pos:t,buffer32:r}=this;this.finished=!0,iU(this.buffer.subarray(t)),iW(r),this.compress(r,0,!0),iW(r);let n=iM(e);
197this.get().forEach((e,t)=>n[t]=iq(e))}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){let{buffer:t,length:r,finished:n,destroyed:i,outputLen:s,pos:a}=this;return e||(e=new this.constructor({dkLen:s})),e.set(...this.get()),e.buffer.set(t),e.destroyed=i,e.finished=n,e.length=r,e.pos=a,e.outputLen=s,e}clone(){return this._cloneInto()}}class sB extends sR{constructor(e={}){let t=void 0===e.dkLen?64:e.dkLen;super(128,t),this.v0l=0|sk[0],this.v0h=0|sk[1],this.v1l=0|sk[2],this.v1h=0|sk[3],this.v2l=0|sk[4],this.v2h=0|sk[5],this.v3l=0|sk[6],this.v3h=0|sk[7],this.v4l=0|sk[8],this.v4h=0|sk[9],this.v5l=0|sk[10],this.v5h=0|sk[11],this.v6l=0|sk[12],this.v6h=0|sk[13],this.v7l=0|sk[14],this.v7h=0|sk[15],function(e,t={},r,n,i){if(iO(64),e<0||e>64)throw Error("outputLen bigger than keyLen");let{key:s,salt:a,personalization:o}=t;if(void 0!==s&&(s.length<1||s.length>r))throw Error("key length must be undefined or 1.."+r);if(void 0!==a&&16!==a.length)throw Error("salt must be undefined or 16");if(void 0!==o&&16!==o.length)throw Error("personalization must be undefined or 16")}(t,e,64,16,16);let{key:r,personalization:n,salt:i}=e,s=0;if(void 0!==r&&(s=(r=iQ(r)).length),this.v0l^=this.outputLen|s<<8|0x1010000,void 0!==i){let e=iM(i=iQ(i));this.v4l^=iq(e[0]),this.v4h^=iq(e[1]),this.v5l^=iq(e[2]),this.v5h^=iq(e[3])}if(void 0!==n){let e=iM(n=iQ(n));this.v6l^=iq(e[0]),this.v6h^=iq(e[1]),this.v7l^=iq(e[2]),this.v7h^=iq(e[3])}if(void 0!==r){let e=new Uint8Array(this.blockLen);e.set(r),this.update(e)}}get(){let{v0l:e,v0h:t,v1l:r,v1h:n,v2l:i,v2h:s,v3l:a,v3h:o,v4l:l,v4h:c,v5l:u,v5h:d,v6l:f,v6h:h,v7l:p,v7h:y}=this;return[e,t,r,n,i,s,a,o,l,c,u,d,f,h,p,y]}set(e,t,r,n,i,s,a,o,l,c,u,d,f,h,p,y){this.v0l=0|e,this.v0h=0|t,this.v1l=0|r,this.v1h=0|n,this.v2l=0|i,this.v2h=0|s,this.v3l=0|a,this.v3h=0|o,this.v4l=0|l,this.v4h=0|c,this.v5l=0|u,this.v5h=0|d,this.v6l=0|f,this.v6h=0|h,this.v7l=0|p,this.v7h=0|y}compress(e,t,r){this.get().forEach((e,t)=>sT[t]=e),sT.set(sk,16);let{h:n,l:i}=iy(BigInt(this.length));sT[24]=sk[8]^i,sT[25]=sk[9]^n,r&&(sT[28]=~sT[28],sT[29]=~sT[29]);let s=0;for(let r=0;r<12;r++)sO(0,4,8,12,e,t+2*s$[s++]),sN(0,4,8,12,e,t+2*s$[s++]),sO(1,5,9,13,e,t+2*s$[s++]),sN(1,5,9,13,e,t+2*s$[s++]),sO(2,6,10,14,e,t+2*s$[s++]),sN(2,6,10,14,e,t+2*s$[s++]),sO(3,7,11,15,e,t+2*s$[s++]),sN(3,7,11,15,e,t+2*s$[s++]),sO(0,5,10,15,e,t+2*s$[s++]),sN(0,5,10,15,e,t+2*s$[s++]),sO(1,6,11,12,e,t+2*s$[s++]),sN(1,6,11,12,e,t+2*s$[s++]),sO(2,7,8,13,e,t+2*s$[s++]),sN(2,7,8,13,e,t+2*s$[s++]),sO(3,4,9,14,e,t+2*s$[s++]),sN(3,4,9,14,e,t+2*s$[s++]);this.v0l^=sT[0]^sT[16],this.v0h^=sT[1]^sT[17],this.v1l^=sT[2]^sT[18],this.v1h^=sT[3]^sT[19],this.v2l^=sT[4]^sT[20],this.v2h^=sT[5]^sT[21],this.v3l^=sT[6]^sT[22],this.v3h^=sT[7]^sT[23],this.v4l^=sT[8]^sT[24],this.v4h^=sT[9]^sT[25],this.v5l^=sT[10]^sT[26],this.v5h^=sT[11]^sT[27],this.v6l^=sT[12]^sT[28],this.v6h^=sT[13]^sT[29],this.v7l^=sT[14]^sT[30],this.v7h^=sT[15]^sT[31],iU(sT)}destroy(){this.destroyed=!0,iU(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let sD=function(e){let t=(t,r)=>e(r).update(iQ(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new sB(e));function sM(e){let t=`�Ethereum Signed Message:
198${e.length}`,r=new TextEncoder().encode(t+e);return"0x"+nD.from(sl(r)).toString("hex")}async function sU(e,t,r,n,i,s){switch(r.t){case"eip191":return await function(e,t,r){let n=function(e){if(130!==e.length&&132!==e.length)throw new tS({signature:e});let t=BigInt(tw(e,0,32)),r=BigInt(tw(e,32,64)),n=(()=>{let t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{var r=t;if(0===r||27===r)return 0;if(1===r||28===r)return 1;if(r>=35)return+(r%2==0);throw new t$({value:r})}catch{throw new tP({value:t})}})();return void 0===n?{r:t,s:r}:{r:t,s:r,yParity:n}}(r);return(function(e,t={}){let r=rJ(`0x${(function(e,t={}){rY(e);let{prefix:r,x:n,y:i}=e,{includePrefix:s=!0}=t;return function(...e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}(s?tg(r,{size:1}):"0x",tg(n,{size:32}),"bigint"==typeof i?tg(i,{size:32}):"0x")})(e).slice(4)}`).substring(26);return function(e,t={}){let{checksum:r=!1}=t;return(r6(e),r)?r3(e):e}(`0x${r}`,t)})(function(e){let{payload:t,signature:r}
198=e,{r:n,s:i,yParity:s}=r;var a=new rj.Signature(BigInt(n),BigInt(i)).addRecoveryBit(s).recoverPublicKey(ty(t).substring(2));let o=(()=>{if(function(e,t={}){let{strict:r=!1}=t;try{return!function(e,t={}){let{strict:r=!1}=t;if(!e||"string"!=typeof e)throw new t_(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e)||!e.startsWith("0x"))throw new tE(e)}(e,{strict:r}),!0}catch{return!1}}(a))return rZ(a);if(function(e){try{if(!(e instanceof Uint8Array)&&(!e||"object"!=typeof e||!("BYTES_PER_ELEMENT"in e)||1!==e.BYTES_PER_ELEMENT||"Uint8Array"!==e.constructor.name))throw new rq(e);return!0}catch{return!1}}(a))return rZ(tm(a));let{prefix:e,x:t,y:r}=a;return"bigint"==typeof t&&"bigint"==typeof r?{prefix:e??4,x:t,y:r}:{prefix:e,x:t}})();return rY(o),o}({payload:sM(t),signature:n})).toLowerCase()===e.toLowerCase()}(e,t,r.s);case"eip1271":return await sj(e,t,r.s,n,i,s);default:throw Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}async function sj(e,t,r,n,i,s){let a=nM(n);if(!a.namespace||!a.reference)throw Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{let a="0x1626ba7e",o=r.substring(2),l=(o.length/2).toString(16).padStart(64,"0"),c=(t.startsWith("0x")?t:sM(t)).substring(2),u=a+c+"0000000000000000000000000000000000000000000000000000000000000040"+l+o,d=await fetch(`${s||"https://rpc.walletconnect.org/v1"}/?chainId=${n}&projectId=${i}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:Date.now()+Math.floor(1e3*Math.random()),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:u},"latest"]})}),{result:f}=await d.json();return!!f&&f.slice(0,a.length).toLowerCase()===a.toLowerCase()}catch(e){return console.error("isValidEip1271Signature: ",e),!1}}function sL(e){let t=new Uint8Array(sI(function(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if("object"==typeof e&&null!=e&&e.data)return new Uint8Array(Object.values(e.data));if("object"==typeof e&&e)return new Uint8Array(Object.values(e));throw Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}(e)));return r7.A.encode(t)}function sF(e){let t=nD.from(e,"base64"),r=(0,ne.D)(t).txn;if(!r)throw Error("Invalid signed transaction: missing 'txn' field");let n=(0,nt.l)(r),i=nD.from("TX"),s=sP(nD.concat([i,nD.from(n)]));return nr.RG.encode(s).replace(/=+$/,"")}function sz(e){let t=[],r=BigInt(e);for(;r>=BigInt(128);)t.push(Number(r&BigInt(127)|BigInt(128))),r>>=BigInt(7);return t.push(Number(r)),nD.from(t)}var sq=Object.defineProperty,sW=Object.defineProperties,sH=Object.getOwnPropertyDescriptors,sK=Object.getOwnPropertySymbols,sV=Object.prototype.hasOwnProperty,sG=Object.prototype.propertyIsEnumerable,sJ=(e,t,r)=>t in e?sq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;let sY=e=>e?.split(":"),sZ=e=>{let t=e&&sY(e);if(t)return t[2]+":"+t[3]},sQ=e=>{let t=e&&sY(e);if(t)return t.pop()};async function sX(e){let{cacao:t,projectId:r}=e,{s:n,p:i}=t,s=s0(i,i.iss),a=sQ(i.iss);return await sU(a,s,n,sZ(i.iss),r)}let s0=(e,t)=>{let r=`${e.domain} wants you to sign in with your Ethereum account:`,n=sQ(t);if(!e.aud&&!e.uri)throw Error("Either `aud` or `uri` is required to construct the message");let i=e.statement||void 0,s=`URI: ${e.aud||e.uri}`,a=`Version: ${e.version}`,o=`Chain ID: ${(e=>{let t=e&&sY(e);if(t)return e.includes("did:pkh:")?t[3]:t[1]})(t)}`,l=`Nonce: ${e.nonce}`,c=`Issued At: ${e.iat}`,u=e.exp?`Expiration Time: ${e.exp}`:void 0,d=e.nbf?`Not Before: ${e.nbf}`:void 0,f=e.requestId?`Request ID: ${e.requestId}`:void 0,h=e.resources?`Resources:${e.resources.map(e=>`
199- ${e}`).join("")}`:void 0,p=s8(e.resources);return p&&(i=function(e="",t){s1(t);let r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;let n=[],i=0;Object.keys(t.att).forEach(e=>{let r=Object.keys(t.att[e]).map(e=>({ability:e.split("/")[0],action:e.split("/")[1]}));r.sort((e,t)=>e.action.localeCompare(t.action));let s={};r.forEach(e=>{s[e.ability]||(s[e.ability]=[]),s[e.ability].push(e.action)});let a=Object.keys(s).map(t=>(i++,`(${i}) '${t}': '${s[t].join("', '")}' for '${e}'.`));n.push(a.join(", ").replace(".,","."))});let s=n.join(" "),a=`${r}${s}`;return`${e?e+" ":""}${a}
199`}(i,s5(p))),[r,n,"",i,"",s,a,o,l,c,u,d,f,h].filter(e=>null!=e).join(`
200`)};function s1(e){if(!e)throw Error("No recap provided, value is undefined");if(!e.att)throw Error("No `att` property found");let t=Object.keys(e.att);if(!(null!=t&&t.length))throw Error("No resources found in `att` property");t.forEach(t=>{let r=e.att[t];if(Array.isArray(r)||"object"!=typeof r)throw Error(`Resource must be an object: ${t}`);if(!Object.keys(r).length)throw Error(`Resource object is empty: ${t}`);Object.keys(r).forEach(e=>{let t=r[e];if(!Array.isArray(t))throw Error(`Ability limits ${e} must be an array of objects, found: ${t}`);if(!t.length)throw Error(`Value of ${e} is empty array, must be an array with objects`);t.forEach(t=>{if("object"!=typeof t)throw Error(`Ability limits (${e}) must be an array of objects, found: ${t}`)})})})}function s2(e){return s1(e),`urn:recap:${nD.from(JSON.stringify(e)).toString("base64").replace(/=/g,"")}`}function s5(e){var t;let r=(t=e.replace("urn:recap:",""),JSON.parse(nD.from(t,"base64").toString("utf-8")));return s1(r),r}function s6(e){var t;let r=s5(e);s1(r);let n=null==(t=r.att)?void 0:t.eip155;return n?Object.keys(n).map(e=>e.split("/")[1]):[]}function s3(e){let t=s5(e);s1(t);let r=[];return Object.values(t.att).forEach(e=>{Object.values(e).forEach(e=>{var t;null!=(t=e?.[0])&&t.chains&&r.push(e[0].chains)})}),[...new Set(r.flat())]}function s8(e){if(!e)return;let t=e?.[e.length-1];return t&&t.includes("urn:recap:")?t:void 0}function s4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s9(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function s7(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function ae(e,...t){if(!s4(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 at(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")}function ar(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function an(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}let ai=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function as(e){if("string"==typeof e)e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e);else if(s4(e))e=al(e);else throw Error("Uint8Array expected, got "+typeof e);return e}function aa(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw Error("invalid output length, expected "+e+", got: "+t.length);if(r&&t.byteOffset%4!=0)throw Error("invalid output, must be aligned");return t}function ao(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(0xffffffff),a=Number(r>>i&s),o=Number(r&s),l=4*!!n,c=4*!n;e.setUint32(t+l,a,n),e.setUint32(t+c,o,n)}function al(e){return Uint8Array.from(e)}let ac=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),au=ac("expand 16-byte k"),ad=ac("expand 32-byte k"),af=ar(au),ah=ar(ad);function ap(e,t){return e<<t|e>>>32-t}function ay(e){return e.byteOffset%4==0}let am=0x100000000-1,ag=new Uint32Array,ab=(e,t)=>255&e[t++]|(255&e[t++])<<8;class aw{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,ae(e=as(e),32);let t=ab(e,0),r=ab(e,2),n=ab(e,4),i=ab(e,6),s=ab(e,8),a=ab(e,10),o=ab(e,12),l=ab(e,14);this.r[0]=8191&t,this.r[1]=(t>>>13|r<<3)&8191,this.r[2]=(r>>>10|n<<6)&7939,this.r[3]=(n>>>7|i<<9)&8191,this.r[4]=(i>>>4|s<<12)&255,this.r[5]=s>>>1&8190,this.r[6]=(s>>>14|a<<2)&8191,this.r[7]=(a>>>11|o<<5)&8065,this.r[8]=(o>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let t=0;t<8;t++)this.pad[t]=ab(e,16+2*t)}process(e,t,r=!1){let{h:n,r:i}=this,s=i[0],a=i[1],o=i[2],l=i[3],c=i[4],u=i[5],d=i[6],f=i[7],h=i[8],p=i[9],y=ab(e,t+0),m=ab(e,t+2),g=ab(e,t+4),b=ab(e,t+6),w=ab(e,t+8),v=ab(e,t+10),x=ab(e,t+12),_=ab(e,t+14),E=n[0]+(8191&y),A=n[1]+((y>>>13|m<<3)&8191),I=n[2]+((m>>>10|g<<6)&8191),C=n[3]+((g>>>7|b<<9)&8191),S=n[4]+((b>>>4|w<<12)&8191),P=n[5]+(w>>>1&8191),$=n[6]+((w>>>14|v<<2)&8191),k=n[7]+((v>>>11|x<<5)&8191),T=n[8]+((x>>>8|_<<8)&8191),O=n[9]+(_>>>5|2048*!r),N=0,R=0+E*s+5*p*A+5*h*I+5*f*C+5*d*S;N=R>>>13,R&=8191,R+=5*u*P+5*c*$+5*l*k+5*o*T+5*a*O,N+=R>>>13,R&=8191;
200let B=N+E*a+A*s+5*p*I+5*h*C+5*f*S;N=B>>>13,B&=8191,B+=5*d*P+5*u*$+5*c*k+5*l*T+5*o*O,N+=B>>>13,B&=8191;let D=N+E*o+A*a+I*s+5*p*C+5*h*S;N=D>>>13,D&=8191,D+=5*f*P+5*d*$+5*u*k+5*c*T+5*l*O,N+=D>>>13,D&=8191;let M=N+E*l+A*o+I*a+C*s+5*p*S;N=M>>>13,M&=8191,M+=5*h*P+5*f*$+5*d*k+5*u*T+5*c*O,N+=M>>>13,M&=8191;let U=N+E*c+A*l+I*o+C*a+S*s;N=U>>>13,U&=8191,U+=5*p*P+5*h*$+5*f*k+5*d*T+5*u*O,N+=U>>>13,U&=8191;let j=N+E*u+A*c+I*l+C*o+S*a;N=j>>>13,j&=8191,j+=P*s+5*p*$+5*h*k+5*f*T+5*d*O,N+=j>>>13,j&=8191;let L=N+E*d+A*u+I*c+C*l+S*o;N=L>>>13,L&=8191,L+=P*a+$*s+5*p*k+5*h*T+5*f*O,N+=L>>>13,L&=8191;let F=N+E*f+A*d+I*u+C*c+S*l;N=F>>>13,F&=8191,F+=P*o+$*a+k*s+5*p*T+5*h*O,N+=F>>>13,F&=8191;let z=N+E*h+A*f+I*d+C*u+S*c;N=z>>>13,z&=8191,z+=P*l+$*o+k*a+T*s+5*p*O,N+=z>>>13,z&=8191;let q=N+E*p+A*h+I*f+C*d+S*u;N=q>>>13,q&=8191,q+=P*c+$*l+k*o+T*a+O*s,N+=q>>>13,q&=8191,R=8191&(N=(N=(N<<2)+N|0)+R|0),N>>>=13,B+=N,n[0]=R,n[1]=B,n[2]=D,n[3]=M,n[4]=U,n[5]=j,n[6]=L,n[7]=F,n[8]=z,n[9]=q}finalize(){let{h:e,pad:t}=this,r=new Uint16Array(10),n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let i=(1^n)-1;for(let e=0;e<10;e++)r[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|r[t];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let s=e[0]+t[0];e[0]=65535&s;for(let r=1;r<8;r++)s=(e[r]+t[r]|0)+(s>>>16)|0,e[r]=65535&s;an(r)}update(e){at(this),ae(e=as(e));let{buffer:t,blockLen:r}=this,n=e.length;for(let i=0;i<n;){let s=Math.min(r-this.pos,n-i);if(s===r){for(;r<=n-i;i+=r)this.process(e,i);continue}t.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){an(this.h,this.r,this.buffer,this.pad)}digestInto(e){at(this),function(e,t){ae(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;let{buffer:t,h:r}=this,{pos:n}=this;if(n){for(t[n++]=1;n<16;n++)t[n]=0;this.process(t,0,!0)}this.finalize();let i=0;for(let t=0;t<8;t++)e[i++]=r[t]>>>0,e[i++]=r[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}}let av=function(e){let t=(t,r)=>e(r).update(as(t)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new aw(e)),ax=function(e,t){let{allowShortKeys:r,extendNonceFn:n,counterLength:i,counterRight:s,rounds:a}=function(e,t){if(null==t||"object"!=typeof t)throw Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw Error("core must be a function");return s7(i),s7(a),s9(s),s9(r),(t,o,l,c,u=0)=>{ae(t),ae(o),ae(l);let d=l.length;if(void 0===c&&(c=new Uint8Array(d)),ae(c),s7(u),u<0||u>=am)throw Error("arx: counter overflow");if(c.length<d)throw Error(`arx: output (${c.length}) is shorter than data (${d})`);let f=[],h=t.length,p,y;if(32===h)f.push(p=al(t)),y=ah;
200else if(16===h&&r)(p=new Uint8Array(32)).set(t),p.set(t,16),y=af,f.push(p);else throw Error(`arx: invalid 32-byte key, got length=${h}`);ay(o)||f.push(o=al(o));let m=ar(p);if(n){if(24!==o.length)throw Error("arx: extended nonce must be 24 bytes");n(y,m,ar(o.subarray(0,16)),m),o=o.subarray(16)}let g=16-i;if(g!==o.length)throw Error(`arx: nonce must be ${g} or 16 bytes`);if(12!==g){let e=new Uint8Array(12);e.set(o,s?0:12-o.length),o=e,f.push(o)}return function(e,t,r,n,i,s,a,o){let l=i.length,c=new Uint8Array(64),u=ar(c),d=ay(i)&&ay(s),f=d?ar(i):ag,h=d?ar(s):ag;for(let p=0;p<l;a++){if(e(t,r,n,u,a,o),a>=am)throw Error("arx: counter overflow");let y=Math.min(64,l-p);if(d&&64===y){let e=p/4;if(p%4!=0)throw Error("arx: invalid block position");for(let t=0,r;t<16;t++)h[r=e+t]=f[r]^u[t];p+=64;continue}for(let e=0,t;e<y;e++)s[t=p+e]=i[t]^c[e];p+=y}}(e,y,m,ar(o),l,c,u,a),an(...f),c}}(function(e,t,r,n,i,s=20){let a=e[0],o=e[1],l=e[2],c=e[3],u=t[0],d=t[1],f=t[2],h=t[3],p=t[4],y=t[5],m=t[6],g=t[7],b=r[0],w=r[1],v=r[2],x=a,_=o,E=l,A=c,I=u,C=d,S=f,P=h,$=p,k=y,T=m,O=g,N=i,R=b,B=w,D=v;for(let e=0;e<s;e+=2)$=$+(N=ap(N^(x=x+I|0),16))|0,x=x+(I=ap(I^$,12))|0,$=$+(N=ap(N^x,8))|0,I=ap(I^$,7),k=k+(R=ap(R^(_=_+C|0),16))|0,_=_+(C=ap(C^k,12))|0,k=k+(R=ap(R^_,8))|0,C=ap(C^k,7),T=T+(B=ap(B^(E=E+S|0),16))|0,E=E+(S=ap(S^T,12))|0,T=T+(B=ap(B^E,8))|0,S=ap(S^T,7),O
200=O+(D=ap(D^(A=A+P|0),16))|0,A=A+(P=ap(P^O,12))|0,O=O+(D=ap(D^A,8))|0,P=ap(P^O,7),T=T+(D=ap(D^(x=x+C|0),16))|0,x=x+(C=ap(C^T,12))|0,T=T+(D=ap(D^x,8))|0,C=ap(C^T,7),O=O+(N=ap(N^(_=_+S|0),16))|0,_=_+(S=ap(S^O,12))|0,O=O+(N=ap(N^_,8))|0,S=ap(S^O,7),$=$+(R=ap(R^(E=E+P|0),16))|0,E=E+(P=ap(P^$,12))|0,$=$+(R=ap(R^E,8))|0,P=ap(P^$,7),k=k+(B=ap(B^(A=A+I|0),16))|0,A=A+(I=ap(I^k,12))|0,k=k+(B=ap(B^A,8))|0,I=ap(I^k,7);let M=0;n[M++]=a+x|0,n[M++]=o+_|0,n[M++]=l+E|0,n[M++]=c+A|0,n[M++]=u+I|0,n[M++]=d+C|0,n[M++]=f+S|0,n[M++]=h+P|0,n[M++]=p+$|0,n[M++]=y+k|0,n[M++]=m+T|0,n[M++]=g+O|0,n[M++]=i+N|0,n[M++]=b+R|0,n[M++]=w+B|0,n[M++]=v+D|0},{counterRight:!1,counterLength:4,allowShortKeys:!1}),a_=new Uint8Array(16),aE=(e,t)=>{e.update(t);let r=t.length%16;r&&e.update(a_.subarray(r))},aA=new Uint8Array(32);function aI(e,t,r,n,i){let s=e(t,r,aA),a=av.create(s);i&&aE(a,i),aE(a,n);let o=function(e,t,r){s9(r);let n=new Uint8Array(16),i=new DataView(n.buffer,n.byteOffset,n.byteLength);return ao(i,0,BigInt(t),r),ao(i,8,BigInt(e),r),n}(n.length,i?i.length:0,!0);a.update(o);let l=a.digest();return an(s,o),l}let aC=((e,t)=>{function r(n,...i){if(ae(n),!ai)throw Error("Non little-endian hardware is not yet supported");if(void 0!==e.nonceLength){let t=i[0];if(!t)throw Error("nonce / iv required");e.varSizeNonce?ae(t):ae(t,e.nonceLength)}let s=e.tagLength;s&&void 0!==i[1]&&ae(i[1]);let a=t(n,...i),o=(e,t)=>{if(void 0!==t){if(2!==e)throw Error("cipher output not supported");ae(t)}},l=!1;return{encrypt(e,t){if(l)throw Error("cannot encrypt() twice with same key + nonce");return l=!0,ae(e),o(a.encrypt.length,t),a.encrypt(e,t)},decrypt(e,t){if(ae(e),s&&e.length<s)throw Error("invalid ciphertext length: smaller than tagLength="+s);return o(a.decrypt.length,t),a.decrypt(e,t)}}}return Object.assign(r,e),r})({blockSize:64,nonceLength:12,tagLength:16},(e=>(t,r,n)=>({encrypt(i,s){let a=i.length;(s=aa(a+16,s,!1)).set(i);let o=s.subarray(0,-16);e(t,r,o,o,1);let l=aI(e,t,r,o,n);return s.set(l,a),an(l),s},decrypt(i,s){s=aa(i.length-16,s,!1);let a=i.subarray(0,-16),o=i.subarray(-16),l=aI(e,t,r,a,n);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(o,l))throw Error("invalid tag");return s.set(i.subarray(0,-16)),e(t,r,s,s,1),an(l),s}}))(ax));class aS extends i0{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,iR(e);let r=iQ(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),iU(i)}update(e){return iB(this),this.iHash.update(e),this}digestInto(e){iB(this),iN(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:a}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let aP=(e,t,r)=>new aS(e,t).update(r).digest();aP.create=(e,t)=>new aS(e,t);let a$=Uint8Array.from([0]),ak=Uint8Array.of(),aT=BigInt(0),aO=BigInt(1);function aN(e,t=""){if("boolean"!=typeof e)throw Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e);return e}function aR(e,t,r=""){let n=iT(e),i=e?.length,s=void 0!==t;if(!n||s&&i!==t)throw Error((r&&`"${r}" `)+"expected Uint8Array"+(s?` of length ${t}`:"")+", got "+(n?`length=${i}`:`type=${typeof e}`));return e}function aB(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function aD(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?aT:BigInt("0x"+e)}function aM(e){return iN(e),aD(iV(Uint8Array.from(e).reverse()))}function aU(e,t){return iY(e.toString(16).padStart(2*t,"0"))}function aj(e,t){return aU(e,t).reverse()}function aL(e,t,r){let n;if("string"==typeof t)try{n=iY(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(iT(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}let aF=e=>"bigint"==typeof e&&aT<=e;function az(e,t,r,n){if(!(aF(t)&&aF(r)&&aF(n))||!(r<=t)||!(t<n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function aq(e){let t;for(t=0;e>aT;e>>=aO,t+=1);return t}let aW=e=>(aO<<BigInt(e))-aO;function aH(e,t,r={}){if(!e||"object"!=typeof e)throw Error("expected valid options object");function n(t,r,n){let i=e[t];if(n&&void 0===i)return;let s=typeof i;if(s!==r||null===i)throw Error(`param "${t}
200" is invalid: expected ${r}, got ${s}`)}Object.entries(t).forEach(([e,t])=>n(e,t,!1)),Object.entries(r).forEach(([e,t])=>n(e,t,!0))}function aK(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let s=e(r,...n);return t.set(r,s),s}}let aV=BigInt(0),aG=BigInt(1),aJ=BigInt(2),aY=BigInt(3),aZ=BigInt(4),aQ=BigInt(5),aX=BigInt(7),a0=BigInt(8),a1=BigInt(9),a2=BigInt(16);function a5(e,t){let r=e%t;return r>=aV?r:t+r}function a6(e,t,r){let n=e;for(;t-- >aV;)n*=n,n%=r;return n}function a3(e,t){if(e===aV)throw Error("invert: expected non-zero number");if(t<=aV)throw Error("invert: expected positive modulus, got "+t);let r=a5(e,t),n=t,i=aV,s=aG;for(;r!==aV;){let e=n/r,t=n%r,a=i-s*e;n=r,r=t,i=s,s=a}if(n!==aG)throw Error("invert: does not exist");return a5(i,t)}function a8(e,t,r){if(!e.eql(e.sqr(t),r))throw Error("Cannot find square root")}function a4(e,t){let r=(e.ORDER+aG)/aZ,n=e.pow(t,r);return a8(e,n,t),n}function a9(e,t){let r=(e.ORDER-aQ)/a0,n=e.mul(t,aJ),i=e.pow(n,r),s=e.mul(t,i),a=e.mul(e.mul(s,aJ),i),o=e.mul(s,e.sub(a,e.ONE));return a8(e,o,t),o}function a7(e){if(e<aY)throw Error("sqrt is not defined for small field");let t=e-aG,r=0;for(;t%aJ===aV;)t/=aJ,r++;let n=aJ,i=oi(e);for(;1===or(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return a4;let s=i.pow(n,t),a=(t+aG)/aJ;return function(e,n){if(e.is0(n))return n;if(1!==or(e,n))throw Error("Cannot find square root");let i=r,o=e.mul(e.ONE,s),l=e.pow(n,t),c=e.pow(n,a);for(;!e.eql(l,e.ONE);){if(e.is0(l))return e.ZERO;let t=1,r=e.sqr(l);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw Error("Cannot find square root");let n=aG<<BigInt(i-t-1),s=e.pow(o,n);i=t,o=e.sqr(s),l=e.mul(l,o),c=e.mul(c,s)}return c}}let oe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ot(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),s=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),s),n}function or(e,t){let r=(e.ORDER-aG)/aJ,n=e.pow(t,r),i=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),a=e.eql(n,e.neg(e.ONE));if(!i&&!s&&!a)throw Error("invalid Legendre symbol result");return i?1:s?0:-1}function on(e,t){void 0!==t&&iO(t);let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function oi(e,t,r=!1,n={}){let i;if(e<=aV)throw Error("invalid field: expected ORDER > 0, got "+e);let s,a,o=!1,l;if("object"==typeof t&&null!=t){if(n.sqrt||r)throw Error("cannot specify opts in two arguments");t.BITS&&(s=t.BITS),t.sqrt&&(a=t.sqrt),"boolean"==typeof t.isLE&&(r=t.isLE),"boolean"==typeof t.modFromBytes&&(o=t.modFromBytes),l=t.allowedLengths}else"number"==typeof t&&(s=t),n.sqrt&&(a=n.sqrt);let{nBitLength:c,nByteLength:u}=on(e,s);if(u>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let d=Object.freeze({ORDER:e,isLE:r,BITS:c,BYTES:u,MASK:aW(c),ZERO:aV,ONE:aG,allowedLengths:l,create:t=>a5(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return aV<=t&&t<e},is0:e=>e===aV,isValidNot0:e=>!d.is0(e)&&d.isValid(e),isOdd:e=>(e&aG)===aG,neg:t=>a5(-t,e),eql:(e,t)=>e===t,sqr:t=>a5(t*t,e),add:(t,r)=>a5(t+r,e),sub:(t,r)=>a5(t-r,e),mul:(t,r)=>a5(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<aV)throw Error("invalid exponent, negatives unsupported");if(r===aV)return e.ONE;if(r===aG)return t;let n=e.ONE,i=t;for(;r>aV;)r&aG&&(n=e.mul(n,i)),i=e.sqr(i),r>>=aG;return n})(d,e,t),div:(t,r)=>a5(t*a3(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>a3(t,e),sqrt:a||(t=>(i||(i=e%aZ===aY?a4:e%a0===aQ?a9:e%a2===a1?function(e){let t=oi(e),r=a7(e),n=r(t,t.neg(t.ONE)),i=r(t,n),s=r(t,t.neg(n)),a=(e+aX)/a2;return(e,t)=>{let r=e.pow(t,a),o=e.mul(r,n),l=e.mul(r,i),c=e.mul(r,s),u=e.eql(e.sqr(o),t),d=e.eql(e.sqr(l),t);r=e.cmov(r,o,u),o=e.cmov(c,l,d);let f=e.eql(e.sqr(o),t),h=e.cmov(r,o,f);return a8(e,h,t),h}}(e):a7(e)),i(d,t))),toBytes:e=>r?aj(e,u):aU(e,u),fromBytes:(t,n=!0)=>{if(l){if(!l.includes(t.length)||t.length>u)throw Error("Field.fromBytes: expected "+l+" bytes, got "+t.length);let e=new Uint8Array(u);e.set(t,r?0:e.length-t.length),t=e}if(t.length!==u)throw Error("Field.fromBytes: expected "+u+" bytes, got "+t.length);let i=r?aM(t):aD(iV(t));if(o&&(i=a5(i,e)),!n&&!d.isValid(i))throw Error("invalid field element: outside of range 0..ORDER");return i},invertBatch:e=>ot(d,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(d)}function os(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function oa(e){let t=os(e);return t+Math.ceil(t/2)}let oo=BigInt(0),ol=BigInt(1);function oc(e,t){let r=t.negate();return e?r:t}function ou(e,t){let r=ot(e.Fp,t.map(e=>e.Z));return t.map((t,n)=>e.fromAffine(t.toAffine(r[n])))}function od(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function of(e,t){od(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),i=2**e;return{windows:r,windowSize:n,mask:aW(e),maxNumber:i,shiftBy:BigInt(e)}}function oh(e,t,r){let{windowSize:n,mask:i,maxNumber:s,shiftBy:a}=r,o=Number(e&i),l=e>>a;o>n&&(o-=s,l+=ol);let c=t*n;return{nextN:l,offset:c+Math.abs(o)-1,isZero:0===o,isNeg:o<0,isNegF:t%2!=0,offsetF:c}}let op=new WeakMap,oy=new WeakMap;function om(e){return oy.get(e)||1}function og(e){if(e!==oo)throw Error("invalid wNAF")}class ob{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let n=e;for(;t>oo;)t&ol&&(r=r.add(n)),n=n.double(),t>>=ol;return r}precomputeWindow(e,t){let{windows:r,windowSize:n}=of(t,this.bits),i=[],s=e,a=s;for(let e=0;e<r;e++){a=s,i.push(a);for(let e=1;e<n;e++)a=a.add(s),i.push(a);s=a.double()}return i}wNAF(e,t,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let n=this.ZERO,i=this.BASE,s=of(e,this.bits);for(let e=0;e<s.windows;e++){let{nextN:a,offset:o,isZero:l,isNeg:c,isNegF:u,offsetF:d}=oh(r,e,s);r=a,l?i=i.add(oc(u,t[d])):n=n.add(oc(c,t[o]))}return og(r),{p:n,f:i}
200}wNAFUnsafe(e,t,r,n=this.ZERO){let i=of(e,this.bits);for(let e=0;e<i.windows&&r!==oo;e++){let{nextN:s,offset:a,isZero:o,isNeg:l}=oh(r,e,i);if(r=s,!o){let e=t[a];n=n.add(l?e.negate():e)}}return og(r),n}getPrecomputes(e,t,r){let n=op.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),op.set(t,n))),n}cached(e,t,r){let n=om(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)}unsafe(e,t,r,n){let i=om(e);return 1===i?this._unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)}createCache(e,t){od(t,this.bits),oy.set(e,t),op.delete(e)}hasCache(e){return 1!==om(e)}}function ow(e,t,r){if(!t)return oi(e,{isLE:r});if(t.ORDER!==e)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return aH(t,oe.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"})),t}BigInt(0),BigInt(1),BigInt(2),BigInt(8),iZ("HashToScalar-");let ov=BigInt(0),ox=BigInt(1),o_=BigInt(2),oE=BigInt(1),oA=BigInt(2),oI=BigInt(3),oC=BigInt(5),oS=BigInt(8),oP=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed");function o$(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}let ok=oi({p:oP,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:oS,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")}.p,{isLE:!0}),oT=(()=>{let e=ok.ORDER;return function(e){let{P:t,type:r,adjustScalarBytes:n,powPminus2:i,randomBytes:s}=(aH(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})),a="x25519"===r;if(!a&&"x448"!==r)throw Error("invalid type");let o=s||i2,l=a?255:448,c=a?32:56,u=BigInt(a?9:5),d=BigInt(a?121665:39081),f=a?o_**BigInt(254):o_**BigInt(447),h=f
200+(a?BigInt(8)*o_**BigInt(251)-ox:BigInt(4)*o_**BigInt(445)-ox)+ox,p=e=>a5(e,t),y=aj(p(u),c);function m(e,r){let s=function(e,r){az("u",e,ov,t),az("scalar",r,f,h);let n=ox,s=ov,a=e,o=ox,c=ov;for(let t=BigInt(l-1);t>=ov;t--){let i=r>>t&ox;c^=i,({x_2:n,x_3:a}=b(c,n,a)),({x_2:s,x_3:o}=b(c,s,o)),c=i;let l=n+s,u=p(l*l),f=n-s,h=p(f*f),y=u-h,m=a+o,g=p((a-o)*l),w=p(m*f),v=g+w,x=g-w;a=p(v*v),o=p(e*p(x*x)),n=p(u*h),s=p(y*(u+p(d*y)))}return{x_2:n,x_3:a}=b(c,n,a),{x_2:s,x_3:o}=b(c,s,o),p(n*i(s))}(function(e){let t=aL("u coordinate",e,c);return a&&(t[31]&=127),p(aM(t))}(r),aM(n(aL("scalar",e,c))));if(s===ov)throw Error("invalid private or public key received");return aj(p(s),c)}function g(e){return m(e,y)}function b(e,t,r){let n=p(e*(t-r));return{x_2:t=p(t-n),x_3:r=p(r+n)}}let w={secretKey:c,publicKey:c,seed:c},v=(e=o(c))=>(iN(e,w.seed),e);return{keygen:function(e){let t=v(e);return{secretKey:t,publicKey:g(t)}},getSharedSecret:(e,t)=>m(e,t),getPublicKey:e=>g(e),scalarMult:m,scalarMultBase:g,utils:{randomSecretKey:v,randomPrivateKey:v},GuBytes:y.slice(),lengths:w}}({P:e,type:"x25519",powPminus2:t=>{let{pow_p_5_8:r,b2:n}=function(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),s=e*e%oP*e%oP,a=a6(s,oA,oP)*s%oP,o=a6(a,oE,oP)*e%oP,l=a6(o,oC,oP)*o%oP,c=a6(l,t,oP)*l%oP,u=a6(c,r,oP)*c%oP,d=a6(u,n,oP)*u%oP,f=a6(d,i,oP)*d%oP,h=a6(f,i,oP)*d%oP,p=a6(h,t,oP)*l%oP;return{pow_p_5_8:a6(p,oA,oP)*e%oP,b2:s}}(t);return a5(a6(r,oI,e)*n,e)},adjustScalarBytes:o$})})(),oO=(e,t)=>(e+(e>=0?t:-t)/oj)/t;function oN(e){if(!["compact","recovered","der"].includes(e))throw Error('Signature format must be "compact", "recovered", or "der"');return e}function oR(e,t){let r={};for(let n of Object.keys(t))r[n]=void 0===e[n]?t[n]:e[n];return aN(r.lowS,"lowS"),aN(r.prehash,"prehash"),void 0!==r.format&&oN(r.format),r}class oB extends Error{constructor(e=""){super(e)}}let oD={Err:oB,_tlv:{encode:(e,t)=>{let{Err:r}=oD;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let n=t.length/2,i=aB(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let s=n>127?aB(i.length/2|128):"";return aB(e)+s+i+t},decode(e,t){let{Err:r}=oD,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],s=0;if(128&i){let e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let a=t.subarray(n,n+e);if(a.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===a[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of a)s=s<<8|e;if(n+=e,s<128)throw new r("tlv.decode(long): not minimal encoding")}else s=i;let a=t.subarray(n,n+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+s)}}},_int:{encode(e){let{Err:t}=oD;if(e<oM)throw new t("integer: negative integers are not allowed");let r=aB(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=oD;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return aD(iV(e))}},toSig(e){let{Err:t,_int:r,_tlv:n}=oD,i=aL("signature",e),{v:s,l:a}=n.decode(48,i);if(a.length)throw new t("invalid signature: left bytes after parsing");let{v:o,l:l}=n.decode(2,s),{v:c,l:u}=n.decode(2,l);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(o),s:r.decode(c)}},hexFromSig(e){let{_tlv:t,_int:r}=oD,n=t.encode(2,r.encode(e.r)),i=t.encode(2,r.encode(e.s));return t.encode(48,n+i)}},oM=BigInt(0),oU=BigInt(1),oj=BigInt(2),oL=BigInt(3),oF=BigInt(4);function oz(e,t){let r,{BYTES:n}=e;if("bigint"==typeof t)r=t;else{let i=aL("private key",t);try{r=e.fromBytes(i)}catch{throw Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw Error("invalid private key: out of range [1..N-1]");return r}function oq(e){return Uint8Array.of(e?2:3)}function oW(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function oH(e,t){let r=t=>(function(e){let{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:i}=function(e){let{CURVE:t,curveOpts:r}=function(e){let t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp,n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0,i={Fp:r,Fn:oi(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:i}}(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}(e),s=function(e,t,r={}){iR(t),aH(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let n=r.randomBytes||i2,i=r.hmac||((e,...r)=>aP(t,e,iX(...r))),{Fp:s,Fn:a}=e,{ORDER:o,BITS:l}=a,{keygen:c,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h}=function(e,t={}){let{Fn:r}=e,n=t.randomBytes||i2,i=Object.assign(oW(e.Fp,r),{seed:oa(r.ORDER)});function s(e){try{return!!oz(r,e)}catch{return!1}}function a(e=n(i.seed)){return function(e,t,r=!1){let n=e.length,i=os(t),s=oa(t);if(n<16||n<s||n>1024)throw Error("expected "+s+"-1024 bytes of input, got "+n);let a=a5(r?aM(e):aD(iV(e)),t-aG)+aG;return r?aj(a,i):aU(a,i)}(aR(e,i.seed,"seed"),r.ORDER)}function o(t,n=!0){return e.BASE.multiply(oz(r,t)).toBytes(n)}function l(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;let{secretKey:n,publicKey:s,publicKeyUncompressed:a}=i;if(r.allowedLengths||n===s)return;let o=aL("key",t).length;return o===s||o===a}return Object.freeze({getPublicKey:o,getSharedSecret:function(t,n,i=!0){if(!0===l(t))throw Error("first arg must be private key");if(!1===l(n))throw Error("second arg must be public key");let s=oz(r,t);return e.fromHex(n).multiply(s).toBytes(i)},keygen:function(e){let t=a(e);return{secretKey:t,publicKey:o(t)}},Point:e,utils:{isValidSecretKey:s,isValidPublicKey:function(t,r){let{publicKey:n,publicKeyUncompressed:s}=i;try{let i=t.length;return(!0!==r||i===n)&&(!1!==r||i===s)&&!!e.fromBytes(t)}catch{return!1}},randomSecretKey:a,isValidPrivateKey:s,randomPrivateKey:a,normPrivateKeyToScalar:e=>
vendor: 10,554 bytes, line 200
200oz(r,e),precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)},lengths:i})}(e,r),p={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},y="compact";function m(e,t){if(!a.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class g{constructor(e,t,r){this.r=m("r",e),this.s=m("s",t),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(e,t=y){let r;if(!function(e,t){oN(t);let r=h.signature;aR(e,"compact"===t?r:"recovered"===t?r+1:void 0,`${t} signature`)}(e,t),"der"===t){let{r:t,s:r}=oD.toSig(aR(e));return new g(t,r)}"recovered"===t&&(r=e[0],t="compact",e=e.subarray(1));let n=a.BYTES,i=e.subarray(0,n),s=e.subarray(n,2*n);return new g(a.fromBytes(i),a.fromBytes(s),r)}static fromHex(e,t){return this.fromBytes(iY(e),t)}addRecoveryBit(e){return new g(this.r,this.s,e)}recoverPublicKey(t){let r=s.ORDER,{r:n,s:i,recovery:l}=this;if(null==l||![0,1,2,3].includes(l))throw Error("recovery id invalid");if(o*oj<r&&l>1)throw Error("recovery id is ambiguous for h>1 curve");let c=2===l||3===l?n+o:n;if(!s.isValid(c))throw Error("recovery id 2 or 3 invalid");let u=s.toBytes(c),d=e.fromBytes(iX(oq((1&l)==0),u)),f=a.inv(c),h=w(aL("msgHash",t)),p=a.create(-h*f),y=a.create(i*f),m=e.BASE.multiplyUnsafe(p).add(d.multiplyUnsafe(y));if(m.is0())throw Error("point at infinify");return m.assertValidity(),m}hasHighS(){return this.s>o>>oU}toBytes(e=y){if(oN(e),"der"===e)return iY(oD.hexFromSig(this));let t=a.toBytes(this.r),r=a.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw Error("recovery bit must be present");return iX(Uint8Array.of(this.recovery),t,r)}return iX(t,r)}toHex(e){return iV(this.toBytes(e))}assertValidity(){}static fromCompact(e){return g.fromBytes(aL("sig",e),"compact")}static fromDER(e){return g.fromBytes(aL("sig",e),"der")}normalizeS(){return this.hasHighS()?new g(this.r,a.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return iV(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return iV(this.toBytes("compact"))}}let b=r.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=aD(iV(e)),r=8*e.length-l;return r>0?t>>BigInt(r):t},w=r.bits2int_modN||function(e){return a.create(b(e))},v=aW(l);function x(e){return az("num < 2^"+l,e,oM,v),a.toBytes(e)}function _(e,r){return aR(e,void 0,"message"),r?aR(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:c,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h,Point:e,sign:function(r,s,l={}){let{seed:c,k2sig:u}=function(t,r,i){if(["recovered","canonical"].some(e=>e in i))throw Error("sign() legacy options not supported");let{lowS:s,prehash:l,extraEntropy:c}=oR(i,p),u=w(t=_(t,l)),d=oz(a,r),f=[x(d),x(u)];if(null!=c&&!1!==c){let e=!0===c?n(h.secretKey):c;f.push(aL("extraEntropy",e))}return{seed:iX(...f),k2sig:function(t){let r=b(t);if(!a.isValidNot0(r))return;let n=a.inv(r),i=e.BASE.multiply(r).toAffine(),l=a.create(i.x);if(l===oM)return;let c=a.create(n*a.create(u+l*d));if(c===oM)return;let f=2*(i.x!==l)|Number(i.y&oU),h=c;return s&&c>o>>oU&&(h=a.neg(c),f^=1),new g(l,h,f)}}}(r=aL("message",r),s,l);return(function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=e=>new Uint8Array(e),i=e=>Uint8Array.of(e),s=n(e),a=n(e),o=0,l=()=>{s.fill(1),a.fill(0),o=0},c=(...e)=>r(a,s,...e),u=(e=n(0))=>{a=c(i(0),e),s=c(),0!==e.length&&(a=c(i(1),e),s=c())},d=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(s=c()).slice();r.push(t),e+=s.length}return iX(...r)};return(e,t)=>{let r;for(l(),u(e);!(r=t(d()));)u();return l(),r}})(t.outputLen,a.BYTES,i)(c,u)},verify:function(t,r,n,i={}){let{lowS:s,prehash:o,format:l}=oR(i,p);if(n=aL("publicKey",n),r=_(aL("message",r),o),"strict"in i)throw Error("options.strict was renamed to lowS");let c=void 0===l?function(e){let t,r="string"==typeof e||iT(e),n=!r&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!r&&!n)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(n)t=new g(e.r,e.s);else if(r){try{t=g.fromBytes(aL("sig",e),"der")}catch(e){if(!(e instanceof oD.Err))throw e}if(!t)try{t=g.fromBytes(aL("sig",e),"compact")}catch{return!1}}return t||!1}(t):g.fromBytes(aL("sig",t),l);if(!1===c)return!1;try{let t=e.fromBytes(n);if(s&&c.hasHighS())return!1;let{r:i,s:o}=c,l=w(r),u=a.inv(o),d=a.create(l*u),f=a.create(i*u),h=e.BASE.multiplyUnsafe(d).add(t.multiplyUnsafe(f));return!h.is0()&&a.create(h.x)===i}catch{return!1}},recoverPublicKey:function(e,t,r={}){let{prehash:n}=oR(r,p);return t=_(t,n),g.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:g,hash:t})}(function(e,t={}){let r=function(e,t,r={},n){if(void 0===n&&(n="edwards"===e),!t||"object"!=typeof t)throw Error(`expected valid ${e} CURVE object`);for(let e of["p","n","h"]){let r=t[e];if(!("bigint"==typeof r&&r>oo))throw Error(`CURVE.${e} must be positive bigint`)}let i=ow(t.p,r.Fp,n),s=ow(t.n,r.Fn,n);for(let r of["Gx","Gy","a","weierstrass"===e?"b":"d"])if(!i.isValid(t[r]))throw Error(`CURVE.${r} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:i,Fn:s}}("weierstrass",e,t),{Fp:n,Fn:i}=r,s=r.CURVE,{h:a,n:o}=s;aH(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:l}=t;if(l&&(!n.is0(s.a)||"bigint"!=typeof l.beta||!Array.isArray(l.basises)))throw Error('invalid endo: expected "beta": bigint and "basises": array');let c=oW(n,i);function u(){if(!n.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let d=t.toBytes||function(e,t,r){let{x:i,y:s}=t.toAffine(),a=n.toBytes(i);return(aN(r,"isCompressed"),r)?(u(),iX(oq(!n.isOdd(s)),a)):iX(Uint8Array.of(4),a,n.toBytes(s))},f=t.fromBytes||function(e){aR(e,void 0,"Point");let{publicKey:t,publicKeyUncompressed:r}=c,i=e.length,s=e[0],a=e.subarray(1);if(i===t&&(2===s||3===s)){let e,t=n.fromBytes(a);if(!n.isValid(t))throw Error("bad point: is not on curve, wrong x");let r=h(t);try{e=n.sqrt(r)}catch(e){throw Error("bad point: is not on curve, sqrt error"+(e instanceof Error?": "+e.message:""))}return u(),(1&s)==1!==n.isOdd(e)&&(e=n.neg(e)),{x:t,y:e}}if(i===r&&4===s){let e=n.BYTES,t=n.fromBytes(a.subarray(0,e)),r=n.fromBytes(a.subarray(e,2*e));if(!p(t,r))throw Error("bad point: is not on curve");return{x:t,y:r}}throw Error(`bad point: got length ${i}, expected compressed=${t} or uncompressed=${r}`)};function h(e){let t=n.sqr(e),r=n.mul(t,e);return n.add(n.add(r,n.mul(e,s.a)),s.b)}function p(e,t){let r=n.sqr(t),i=h(e);return n.eql(r,i)}if(!p(s.Gx,s.Gy))throw Error("bad curve params: generator point");let y=n.mul(n.pow(s.a,oL),oF),m=n.mul(n.sqr(s.b),BigInt(27));if(n.is0(n.add(y,m)))throw Error("bad curve params: a or b");function g(e,t,r=!1){if(!n.isValid(t)||r&&n.is0(t))throw Error(`bad point coordinate ${e}`);return t}function b(e){if(!(e instanceof E))throw Error("ProjectivePoint expected")}function w(e){if(!l||!l.basises)throw Error("no endo");return function(e,t,r){let[[n,i],[s,a]]=t,o=oO(a*e,r),l=oO(-i*e,r),c=e-o*n-l*s,u=-o*i-l*a,d=c<oM,f=u<oM;d&&(c=-c),f&&(u=-u);let h=aW(Math.ceil(aq(r)/2))+oU;if(c<oM||c>=h||u<oM||u>=h)throw Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:d,k1:c,k2neg:f,k2:u}}(e,l.basises,i.ORDER)}let v=aK((e,t)=>{let{X:r,Y:i,Z:s}=e;if(n.eql(s,n.ONE))return{x:r,y:i};let a=e.is0();null==t&&(t=a?n.ONE:n.inv(s));let o=n.mul(r,t),l=n.mul(i,t),c=n.mul(s,t);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw Error("invZ was invalid");return{x:o,y:l}}),x=aK(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.Y))return;throw Error("bad point: ZERO")}let{x:r,y:i}=e.toAffine();if(!n.isValid(r)||!n.isValid(i))throw Error("bad point: x or y not field elements");if(!p(r,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function _(e,t,r,i,s){return r=new E(n.mul(r.X,e),r.Y,r.Z),t=oc(i,t),r=oc(s,r),t.add(r)}class E{constructor(e,t,r){this.X=g("x",e),this.Y=g("y",t,!0),this.Z=g("z",r),Object.freeze(this)}static CURVE(){return s}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error("invalid affine point");if(e instanceof E)throw Error("projective point not allowed");return n.is0(t)&&n.is0(r)?E.ZERO:new E(t,r,n.ONE)}static fromBytes(e){let t=E.fromAffine(f(aR(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return E.fromBytes(aL("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return I.createCache(this,e),t||this.multiply(oL),this}assertValidity(){x(this)}hasEvenY(){let{y:e}=this.toAffine();if(!n.isOdd)throw Error("Field doesn't support isOdd");return!n.isOdd(e)}equals(e){b(e);let{X:t,Y:r,Z:i}=this,{X:s,Y:a,Z:o}=e,l=n.eql(n.mul(t,o),n.mul(s,i)),c=n.eql(n.mul(r,o),n.mul(a,i));return l&&c}negate(){return new E(this.X,n.neg(this.Y),this.Z)}double(){let{a:e,b:t}=s,r=n.mul(t,oL),{X:i,Y:a,Z:o}=this,l=n.ZERO,c=n.ZERO,u=n.ZERO,d=n.mul(i,i),f=n.mul(a,a),h=n.mul(o,o),p=n.mul(i,a);return p=n.add(p,p),u=n.mul(i,o),u=n.add(u,u),l=n.mul(e,u),c=n.mul(r,h),c=n.add(l,c),l=n.sub(f,c),c=n.add(f,c),c=n.mul(l,c),l=n.mul(p,l),u=n.mul(r,u),h=n.mul(e,h),p=n.sub(d,h),p=n.mul(e,p),p=n.add(p,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,h),d=n.mul(d,p),c=n.add(c,d),h=n.mul(a,o),h=n.add(h,h),d=n.mul(h,p),l=n.sub(l,d),u=n.mul(h,f),u=n.add(u,u),new E(l,c,u=n.add(u,u))}add(e){b(e);let{X:t,Y:r,Z:i}=this,{X:a,Y:o,Z:l}=e,c=n.ZERO,u=n.ZERO,d=n.ZERO,f=s.a,h=n.mul(s.b,oL),p=n.mul(t,a),y=n.mul(r,o),m=n.mul(i,l),g=n.add(t,r),w=n.add(a,o);g=n.mul(g,w),w=n.add(p,y),g=n.sub(g,w),w=n.add(t,i);let v=n.add(a,l);return w=n.mul(w,v),v=n.add(p,m),w=n.sub(w,v),v=n.add(r,i),c=n.add(o,l),v=n.mul(v,c),c=n.add(y,m),v=n.sub(v,c),d=n.mul(f,w),c=n.mul(h,m),d=n.add(c,d),c=n.sub(y,d),d=n.add(y,d),u=n.mul(c,d),y=n.add(p,p),y=n.add(y,p),m=n.mul(f,m),w=n.mul(h,w),y=n.add(y,m),m=n.sub(p,m),m=n.mul(f,m),w=n.add(w,m),p=n.mul(y,w),u=n.add(u,p),p=n.mul(v,w),c=n.mul(g,c),c=n.sub(c,p),p=n.mul(g,y),d=n.mul(v,d),new E(c,u,d=n.add(d,p))}subtract(e){return this.add(e.negate())}is0(){return this.equals(E.ZERO)}multiply(e){let r,n,{endo:s}=t;if(!i.isValidNot0(e))throw Error("invalid scalar: out of range");let a=e=>I.cached(this,e,e=>ou(E,e));
vendor: 4,639 bytes, line 200
200if(s){let{k1neg:t,k1:i,k2neg:o,k2:l}=w(e),{p:c,f:u}=a(i),{p:d,f:f}=a(l);n=u.add(f),r=_(s.beta,c,d,t,o)}else{let{p:t,f:i}=a(e);r=t,n=i}return ou(E,[r,n])[0]}multiplyUnsafe(e){let{endo:r}=t;if(!i.isValid(e))throw Error("invalid scalar: out of range");if(e===oM||this.is0())return E.ZERO;if(e===oU)return this;if(I.hasCache(this))return this.multiply(e);if(!r)return I.unsafe(this,e);{let{k1neg:t,k1:n,k2neg:i,k2:s}=w(e),{p1:a,p2:o}=function(e,t,r,n){let i=t,s=e.ZERO,a=e.ZERO;for(;r>oo||n>oo;)r&ol&&(s=s.add(i)),n&ol&&(a=a.add(i)),i=i.double(),r>>=ol,n>>=ol;return{p1:s,p2:a}}(E,this,n,s);return _(r.beta,a,o,t,i)}}multiplyAndAddUnsafe(e,t,r){let n=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(e){return v(this,e)}isTorsionFree(){let{isTorsionFree:e}=t;return a===oU||(e?e(E,this):I.unsafe(this,o).is0())}clearCofactor(){let{clearCofactor:e}=t;return a===oU?this:e?e(E,this):this.multiplyUnsafe(a)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}toBytes(e=!0){return aN(e,"isCompressed"),this.assertValidity(),d(E,this,e)}toHex(e=!0){return iV(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return ou(E,e)}static msm(e,t){return function(e,t,r,n){(function(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})})(r,e),function(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}(n,t);let i=r.length,s=n.length;if(i!==s)throw Error("arrays of points and scalars must have equal length");let a=e.ZERO,o=aq(BigInt(i)),l=1;o>12?l=o-3:o>4?l=o-2:o>0&&(l=2);let c=aW(l),u=Array(Number(c)+1).fill(a),d=Math.floor((t.BITS-1)/l)*l,f=a;for(let e=d;e>=0;e-=l){u.fill(a);for(let t=0;t<s;t++){let i=Number(n[t]>>BigInt(e)&c);u[i]=u[i].add(r[t])}let t=a;for(let e=u.length-1,r=a;e>0;e--)r=r.add(u[e]),t=t.add(r);if(f=f.add(t),0!==e)for(let e=0;e<l;e++)f=f.double()}return f}(E,i,e,t)}static fromPrivateKey(e){return E.BASE.multiply(oz(i,e))}}E.BASE=new E(s.Gx,s.Gy,n.ONE),E.ZERO=new E(n.ZERO,n.ONE,n.ZERO),E.Fp=n,E.Fn=i;let A=i.BITS,I=new ob(E,t.endo?Math.ceil(A/2):A);return E.BASE.precompute(8),E}(t,r),n,i),a=s.Point;return Object.assign({},s,{ProjectivePoint:a,CURVE:Object.assign({},e,on(a.Fn.ORDER,a.Fn.BITS))})})({...e,hash:t});return{...r(t),create:r}}let oK={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},oV={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},oG={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")}
200,oJ=oi(oK.p),oY=oi(oV.p),oZ=oi(oG.p),oQ=oH({...oK,Fp:oJ,lowS:!1},sI);oH({...oV,Fp:oY,lowS:!1},sS),oH({...oG,Fp:oZ,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},sC);let oX="base10",o0="base16",o1="base64pad",o2="base64url",o5="utf8";function o6(){let e=i2(32);return(0,ni.dI)(e,o0)}function o3(e){let t=sI((0,ni.sH)(e,o0));return(0,ni.dI)(t,o0)}function o8(e){let t=sI((0,ni.sH)(e,o5));return(0,ni.dI)(t,o0)}function o4(e){return(0,ni.sH)(`${e}`,oX)}function o9(e){return Number((0,ni.dI)(e,oX))}function o7(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function le(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4;return t+"=".repeat(r)}function lt(e){if(2===o9(e.type))return(0,ni.dI)((0,ni.xW)([e.type,e.sealed]),o1);if(1===o9(e.type)){if(typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");return(0,ni.dI)((0,ni.xW)([e.type,e.senderPublicKey,e.iv,e.sealed]),o1)}return(0,ni.dI)((0,ni.xW)([e.type,e.iv,e.sealed]),o1)}function lr(e){let t=(e.encoding||o1)===o2?le(e.encoded):e.encoded,r=(0,ni.sH)(t,o1),n=r.slice(0,1);if(1===o9(n)){let e=r.slice(1,33),t=r.slice(33,45);return{type:n,sealed:r.slice(45),iv:t,senderPublicKey:e}}if(2===o9(n))return{type:n,sealed:r.slice(1),iv:i2(12)};let i=r.slice(1,13);return{type:n,sealed:r.slice(13),iv:i}}function ln(e){let t=e?.type||0;if(1===t){if(typeof e?.senderPublicKey>"u")throw Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function li(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}function ls(e){return e?.relay||{protocol:"irn"}}function la(e){let t=ns.CG[e];if(typeof t>"u")throw Error(`Relay Protocol not supported: ${e}`);return t}var lo=Object.defineProperty,ll=Object.defineProperties,lc=Object.getOwnPropertyDescriptors,lu=Object.getOwnPropertySymbols,ld=Object.prototype.hasOwnProperty,lf=Object.prototype.propertyIsEnumerable,lh=(e,t,r)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lp=(e,t)=>{for(var r in t||(t={}))ld.call(t,r)&&lh(e,r,t[r]);if(lu)for(var r of lu(t))lf.call(t,r)&&lh(e,r,t[r]);return e};function ly(e){var t;if(!e.includes("wc:")){let t=iu(e);null!=t&&t.includes("wc:")&&(e=t)}let r=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,i=e.substring(0,r),s=e.substring(r+1,n).split("@"),a=Object.fromEntries(new URLSearchParams("u">typeof n?e.substring(n):"").entries()),o="string"==typeof a.methods?a.methods.split(","):void 0;return{protocol:i,topic:(t=s[0]).startsWith("//")?t.substring(2):t,version:parseInt(s[1],10),symKey:a.symKey,relay:function(e,t="-"){let r={},n="relay"+t;return Object.keys(e).forEach(t=>{if(t.startsWith(n)){let i=t.replace(n,""),s=e[t];r[i]=s}}),r}(a),methods:o,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function lm(e){let t=new URLSearchParams;return Object.entries(lp(lp(ll(lp({},function(e,t="-"){let r={};return Object.keys(e).forEach(n=>{e[n]&&(r["relay"+t+n]=e[n])}),r}(e.relay)),lc({symKey:e.symKey})),e.expiryTimestamp&&{expiryTimestamp:e.expiryTimestamp.toString()}),e.methods&&{methods:e.methods.join(",")})).sort(([e],[t])=>e.localeCompare(t)).forEach(([e,r])=>{void 0!==r&&t.append(e,String(r))}),`${e.protocol}:${e.topic}@${e.version}?${t}`}function lg(e,t,r){return`${e}?wc_ev=${r}&topic=${t}`}var lb=Object.defineProperty,lw=Object.defineProperties,lv=Object.getOwnPropertyDescriptors,lx=Object.getOwnPropertySymbols,l_=Object.prototype.hasOwnProperty,lE=Object.prototype.propertyIsEnumerable,lA=(e,t,r)=>t in e?lb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lI=(e,t)=>{for(var r in t||(t={}))l_.call(t,r)&&lA(e,r,t[r]);if(lx)for(var r of lx(t))lE.call(t,r)&&lA(e,r,t[r]);return e},lC=(e,t)=>lw(e,lv(t));function lS(e){let t=[];return e.forEach(e=>{let[r,n]=e.split(":");t.push(`${r}:${n}`)}),t}function lP(e){return e.includes(":")}function l$(e){return lP(e)?e.split(":")[0]:e}function lk(e){var t,r,n;let i={};if(!lM(e))return i;for(let[s,a]of Object.entries(e)){let e=lP(s)?[s]:a.chains,o=a.methods||[],l=a.events||[],c=l$(s);i[c]=lC(lI({}
200,i[c]),{chains:ii(e,null==(t=i[c])?void 0:t.chains),methods:ii(o,null==(r=i[c])?void 0:r.methods),events:ii(l,null==(n=i[c])?void 0:n.events)})}return i}function lT(e,t){let r=function(e){let t={};return e?.forEach(e=>{var r;let[n,i]=e.split(":");t[n]||(t[n]={accounts:[],chains:[],events:[],methods:[]}),t[n].accounts.push(e),null==(r=t[n].chains)||r.push(`${n}:${i}`)}),t}(t=t.map(e=>e.replace("did:pkh:","")));for(let[t,n]of Object.entries(r))n.methods?n.methods=ii(n.methods,e):n.methods=e,n.events=["chainChanged","accountsChanged"];return r}let lO={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},lN={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function lR(e,t){let{message:r,code:n}=lN[e];return{message:t?`${r} ${t}`:r,code:n}}function lB(e,t){let{message:r,code:n}=lO[e];return{message:t?`${r} ${t}`:r,code:n}}function lD(e,t){return!!Array.isArray(e)&&(!("u">typeof t)||!e.length||e.every(t))}function lM(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function lU(e){return typeof e>"u"}function lj(e,t){return!!(t&&lU(e))||"string"==typeof e&&!!e.trim().length}function lL(e,t){return!!(t&&lU(e))||"number"==typeof e&&!isNaN(e)}function lF(e){return!!(lj(e,!1)&&e.includes(":"))&&2===e.split(":").length}function lz(e){let t=!0;return lD(e)?e.length&&(t=e.every(e=>lj(e,!1))):t=!1,t}function lq(e,t){let r=null;return Object.values(e).forEach(e=>{var n;let i;if(r)return;let s=(n=`${t}, namespace`,i=null,lz(e?.methods)?lz(e?.events)||(i=lB("UNSUPPORTED_EVENTS",`${n}, events should be an array of strings or empty array for no events`)):i=lB("UNSUPPORTED_METHODS",`${n}, methods should be an array of strings or empty array for no methods`),i);s&&(r=s)}),r}function lW(e,t){let r=null;if(e&&lM(e)){let n,i=lq(e,t);i&&(r=i);let s=(n=null,Object.values(e).forEach(e=>{var r,i;let s;if(n)return;let a=(r=e?.accounts,i=`${t} namespace`,s=null,lD(r)?r.forEach(e=>{s||function(e){if(lj(e,!1)&&e.includes(":")){let t=e.split(":");if(3===t.length){let e=t[0]+":"+t[1];return!!t[2]&&lF(e)}}return!1}(e)||(s=lB("UNSUPPORTED_ACCOUNTS",`${i}, account ${e} should be a string and conform to "namespace:chainId:address" format`))}):s=lB("UNSUPPORTED_ACCOUNTS",`${i}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),s);a&&(n=a)}),n);s&&(r=s)}else r=lR("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function lH(e){return lj(e.protocol,!0)}function lK(e){return"u">typeof e}function lV(e,t){return!(!lF(t)||!(function(e){let t=[];
200return Object.values(e).forEach(e=>{t.push(...lS(e.accounts))}),t})(e).includes(t))}function lG(e,t,r){let n=null,i=function(e){let t={};return Object.keys(e).forEach(r=>{var n;r.includes(":")?t[r]=e[r]:null==(n=e[r].chains)||n.forEach(n=>{t[n]={methods:e[r].methods,events:e[r].events}})}),t}(e),s=function(e){let t={};return Object.keys(e).forEach(r=>{if(r.includes(":"))t[r]=e[r];else{let n=lS(e[r].accounts);n?.forEach(n=>{t[n]={accounts:e[r].accounts.filter(e=>e.includes(`${n}:`)),methods:e[r].methods,events:e[r].events}})}}),t}(t),a=Object.keys(i),o=Object.keys(s),l=lJ(Object.keys(e)),c=lJ(Object.keys(t)),u=l.filter(e=>!c.includes(e));return u.length&&(n=lR("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
201      Required: ${u.toString()}
202      Received: ${Object.keys(t).toString()}`)),n5(a,o)||(n=lR("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
203      Required: ${a.toString()}
204      Approved: ${o.toString()}`)),Object.keys(t).forEach(e=>{if(!e.includes(":")||n)return;let i=lS(t[e].accounts);i.includes(e)||(n=lR("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e}
205        Required: ${e}
206        Approved: ${i.toString()}`))}),a.forEach(e=>{n||(n5(i[e].methods,s[e].methods)?n5(i[e].events,s[e].events)||(n=lR("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):n=lR("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))}),n}function lJ(e){return[...new Set(e.map(e=>e.includes(":")?e.split(":")[0]:e))]}function lY(){let e=nX();return new Promise(t=>{switch(e){case nJ.browser:t(nQ()&&navigator?.onLine);break;case nJ.reactNative:t(lZ());break;case nJ.node:default:t(!0)}})}async function lZ(){if(nZ()&&"u">typeof global&&null!=global&&global.NetInfo){let e=await (null==global?void 0:global.NetInfo.fetch());return e?.isConnected}return!0}let lQ={};class lX{static get(e){return lQ[e]}static set(e,t){lQ[e]=t}static delete(e){delete lQ[e]}}function l0(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function l1({logger:e,name:t}){let r="string"==typeof e?nR({opts:{level:e,name:t}}).logger:e;return r.level="string"==typeof e?e:e.level,r}var l2=r(38352),l5=r(61161),l6=r(98539).hp;function l3(e,...t){try{var r;return(r=e(...t))&&"function"==typeof r.then?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}}function l8(e){if(function(e){let t=typeof e;return null===e||"object"!==t&&"function"!==t}(e))return String(e);if(function(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}(e)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return l8(e.toJSON());throw Error("[unstorage] Cannot stringify value!")}let l4="base64:";function l9(e){return e&&e.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function l7(e){return(e=l9(e))?e+":":""}function ce(e,t,r){return e.watch?e.watch((e,n)=>t(e,r+n)):()=>{}}async function ct(e){"function"==typeof e.dispose&&await l3(e.dispose)}var cr=r(74960);class cn{constructor(){this.indexedDb=function(e={}){let t={mounts:{"":e.driver||(()=>{let e=new Map;return{name:"memory",getInstance:()=>e,hasItem:t=>e.has(t),getItem:t=>e.get(t)??null,getItemRaw:t=>e.get(t)??null,setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys:()=>[...e.keys()],clear(){e.clear()},dispose(){e.clear()}}})()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=e=>{for(let r of t.mountpoints)if(e.startsWith(r))return{base:r,relativeKey:e.slice(r.length),driver:t.mounts[r]};return{base:"",relativeKey:e,driver:t.mounts[""]}},n=(e,r)=>t.mountpoints.filter(t=>t.startsWith(e)||r&&e.startsWith(t)).map(r=>({relativeBase:e.length>r.length?e.slice(r.length):void 0,mountpoint:r,driver:t.mounts[r]})),i=(e,r)=>{if(t.watching)for(let n of(r=l9(r),t.watchListeners))n(e,r)},s=async()=>{if(!t.watching)for(let e in t.watching=!0,t.mounts)t.unwatch[e]=await ce(t.mounts[e],i,e)},a=async()=>{if(t.watching){for(let e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},o=(e,t,n)=>{let i=new Map,s=e=>{let t=i.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},i.set(e.base,t)),t};for(let n of e){let e="string"==typeof n,i=l9(e?n:n.key),a=e?void 0:n.value,o=e||!n.options?t:{...t,...n.options},l=r(i);s(l).items.push({key:i,value:a,relativeKey:l.relativeKey,options:o})}return Promise.all([...i.values()].map(e=>n(e))).then(e=>e.flat())},l={hasItem(e,t={}){let{relativeKey:n,driver:i}=r(e=l9(e));return l3(i.hasItem,n,t)},getItem(e,t={}){let{relativeKey:n,driver:i}=r(e=l9(e));
206return l3(i.getItem,n,t).then(e=>(0,l5.Ay)(e))},getItems:(e,t={})=>o(e,t,e=>e.driver.getItems?l3(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:function(...e){return l9(e.join(":"))}(e.base,t.key),value:(0,l5.Ay)(t.value)}))):Promise.all(e.items.map(t=>l3(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:(0,l5.Ay)(e)}))))),getItemRaw(e,t={}){let{relativeKey:n,driver:i}=r(e=l9(e));return i.getItemRaw?l3(i.getItemRaw,n,t):l3(i.getItem,n,t).then(e=>{var t;return"string"==typeof e&&e.startsWith(l4)?(t=e.slice(l4.length),globalThis.Buffer?l6.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))):e})},async setItem(e,t,n={}){if(void 0===t)return l.removeItem(e);let{relativeKey:s,driver:a}=r(e=l9(e));a.setItem&&(await l3(a.setItem,s,l8(t),n),a.watch||i("update",e))},async setItems(e,t){await o(e,t,async e=>{if(e.driver.setItems)return l3(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:l8(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>l3(e.driver.setItem,t.relativeKey,l8(t.value),t.options)))})},async setItemRaw(e,t,n={}){if(void 0===t)return l.removeItem(e,n);let{relativeKey:s,driver:a}=r(e=l9(e));if(a.setItemRaw)await l3(a.setItemRaw,s,t,n);else{var o;if(!a.setItem)return;await l3(a.setItem,s,"string"==typeof t?t:l4+(o=t,globalThis.Buffer?l6.from(o).toString("base64"):globalThis.btoa(String.fromCodePoint(...o))),n)}a.watch||i("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t});let{relativeKey:n,driver:s}=r(e=l9(e));s.removeItem&&(await l3(s.removeItem,n,t),(t.removeMeta||t.removeMata)&&await l3(s.removeItem,n+"$",t),s.watch||i("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t});let{relativeKey:n,driver:i}=r(e=l9(e)),s=Object.create(null);if(i.getMeta&&Object.assign(s,await l3(i.getMeta,n,t)),!t.nativeOnly){let e=await l3(i.getItem,n+"$",t).then(e=>(0,l5.Ay)(e));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(s,e))}return s},setMeta(e,t,r={}){return this.setItem(e+"$",t,r)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){let r=n(e=l7(e),!0),i=[],s=[],a=!0;for(let e of r){for(let r of(e.driver.flags?.maxDepth||(a=!1),await l3(e.driver.getKeys,e.relativeBase,t))){let t=e.mountpoint+l9(r);i.some(e=>t.startsWith(e))||s.push(t)}i=[e.mountpoint,...i.filter(t=>!t.startsWith(e.mountpoint))]}let o=void 0!==t.maxDepth&&!a;return s.filter(r=>{var n;return(!o||function(e,t){if(void 0===t)return!0;let r=0,n=e.indexOf(":");for(;n>-1;)r++,n=e.indexOf(":",n+1);return r<=t}(r,t.maxDepth))&&((n=e)?r.startsWith(n)&&"$"!==r[r.length-1]:"$"!==r[r.length-1])})},async clear(e,t={}){e=l7(e),await Promise.all(n(e,!1).map(async e=>e.driver.clear?l3(e.driver.clear,e.relativeBase,t):e.driver.removeItem?Promise.all((await e.driver.getKeys(e.relativeBase||"",t)).map(r=>e.driver.removeItem(r,t))):void 0))},async dispose(){await Promise.all(Object.values(t.mounts).map(e=>ct(e)))},watch:async e=>(await s(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter(t=>t!==e),0===t.watchListeners.length&&await a()}),async unwatch(){t.watchListeners=[],await a()},mount(e,r){if((e=l7(e))&&t.mounts[e])throw Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort((e,t)=>t.length-e.length)),t.mounts[e]=r,t.watching&&Promise.resolve(ce(r,i,e)).then(r=>{t.unwatch[e]=r}).catch(console.error),l},async unmount(e,r=!0){(e=l7(e))&&t.mounts[e]&&(t.watching&&e in t.unwatch&&(t.unwatch[e]?.(),delete t.unwatch[e]),r&&await ct(t.mounts[e]),t.mountpoints=t.mountpoints.filter(t=>t!==e),delete t.mounts[e])},getMount(e=""){let t=r(e=l9(e)+":");return{driver:t.driver,base:t.base}},getMounts:(e="",t={})=>n(e=l9(e),t.parents).map(e=>({driver:e.driver,base:e.mountpoint})),keys:(e,t={})=>l.getKeys(e,t),get:(e,t={})=>l.getItem(e,t),set:(e,t,r={})=>l.setItem(e,t,r),has:(e,t={})=>l.hasItem(e,t),del:(e,t={})=>l.removeItem(e,t),remove:(e,t={})=>l.removeItem(e,t)};return l}({driver:((e={})=>{let t,r=e.base&&e.base.length>0?`${e.base}:`:"";return e.dbName&&e.storeName&&(t=(0,cr.y$)(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await (0,cr.Jt)(r+e,t)>"u"),getItem:async e=>
206await (0,cr.Jt)(r+e,t)??null,setItem:(e,n)=>(0,cr.hZ)(r+e,n,t),removeItem:e=>(0,cr.yH)(r+e,t),getKeys:()=>(0,cr.HP)(t),clear:()=>(0,cr.IU)(t)}})({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){let t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,(0,nc.h)(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var ci="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},cs={exports:{}};function ca(e){var t;return[e[0],(0,nc.j)(null!=(t=e[1])?t:"")]}!function(){function e(){}e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){let e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),"u">typeof ci&&ci.localStorage?cs.exports=ci.localStorage:"u">typeof window&&window.localStorage?cs.exports=window.localStorage:cs.exports=new e}();class co{constructor(){this.localStorage=cs.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(ca)}async getItem(e){let t=this.localStorage.getItem(e);if(null!==t)return(0,nc.j)(t)}async setItem(e,t){this.localStorage.setItem(e,(0,nc.h)(t))}async removeItem(e){this.localStorage.removeItem(e)}}let cl=async(e,t,r)=>{let n="wc_storage_version",i=await t.getItem(n);if(i&&i>=1)return void r(t);let s=await e.getKeys();if(!s.length)return void r(t);let a=[];for(;s.length;){let r=s.shift();if(!r)continue;let n=r.toLowerCase();if(n.includes("wc@")||n.includes("walletconnect")||n.includes("wc_")||n.includes("wallet_connect")){let n=await e.getItem(r);await t.setItem(r,n),a.push(r)}}await t.setItem(n,1),r(t),cc(e,a)},cc=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class cu{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};let e=new co;this.storage=e;try{let t=new cn;cl(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{let t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var cd=r(12414),cf=Object.defineProperty,ch=(e,t,r)=>((e,t,r)=>t in e?cf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class cp extends cd.H{constructor(e){super(),this.opts=e,ch(this,"protocol","wc"),ch(this,"version",2)}}var cy=Object.defineProperty;class cm extends cd.H{constructor(e,t){super(),this.core=e,this.logger=t,((e,t,r)=>((e,t,r)=>t in e?cy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r))(this,"records",new Map)}}class cg{constructor(e,t){this.logger=e,this.core=t}}class cb extends cd.H{constructor(e,t){super(),this.relayer=e,this.logger=t}}class cw extends cd.H{constructor(e){super()}}class cv{constructor(e,t,r,n){this.core=e,this.logger=t,this.name=r}}class cx extends cd.H{constructor(e,t){super(),this.relayer=e,this.logger=t}}class c_ extends cd.H{constructor(e,t){super(),this.core=e,this.logger=t}}class cE{constructor(e,t,r){this.core=e,this.logger=t,this.store=r}}class cA{constructor(e,t){this.projectId=e,this.logger=t}}class cI{constructor(e,t,r){this.core=e,this.logger=t,this.telemetryEnabled=r}}var cC=Object.defineProperty,cS=(e,t,r)=>((e,t,r)=>t in e?cC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);ts();class cP{constructor(e){this.opts=e,cS(this,"protocol","wc"),cS(this,"version",2)}}ti.EventEmitter;class c${constructor(e){this.client=e}}var ck=r(20041),cT=r(71345),cO=r(45850),cN=r(98539).hp,cR=r(88304);let cB="core",cD=`wc@2:${cB}:`,cM={logger:"error"},cU={database:":memory:"},cj="client_ed25519_seed",cL=to.ONE_DAY,cF=to.SIX_HOURS,cz="wss://relay.walletconnect.org",cq={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",publish:"relayer_publish"},cW={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},cH="2.22.4",cK={link_mode:"link_mode",relay:"relay"},cV={inbound:"inbound",outbound:"outbound"},cG="WALLETCONNECT_LINK_MODE_APPS",cJ={created:"subscription_created",deleted:"subscription_deleted",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},cY=(to.FIVE_SECONDS,{wc_pairingDelete:{req:{ttl:to.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:to.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:to.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:to.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:to.ONE_DAY,prompt:!1,tag:0},res:{ttl:to.ONE_DAY,prompt:!1,tag:0}}}),cZ={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},cQ={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},cX={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},c0="https://verify.walletconnect.org",c1=`${c0}/v3`,c2=["https://verify.walletconnect.com",c0],c5={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal"},c6={no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_listener_not_found:"proposal_listener_not_found"},c3={session_approve_started:"session_approve_started",session_namespaces_validation_success:"session_namespaces_validation_success",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",session_request_response_started:"session_request_response_started",session_request_response_validation_success:"session_request_response_validation_success",session_request_response_publish_started:"session_request_response_publish_started"},c8={no_internet_connection:"no_internet_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found",session_request_response_validation_failure:"session_request_response_validation_failure",session_request_response_publish_failure:"session_request_response_publish_failure"},c4={authenticated_session_approve_started:"authenticated_session_approve_started",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve"}
206,c9={no_internet_connection:"no_internet_connection",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"};var c7=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),a=s.charCodeAt(0);if(255!==r[a])throw TypeError(s+" is ambiguous");r[a]=i}var o=e.length,l=e.charAt(0),c=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===l;)n++,t++;for(var s=(e.length-t)*c+1>>>0,a=new Uint8Array(s);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var d=0,f=s-1;(0!==u||d<i)&&-1!==f;f--,d++)u+=o*a[f]>>>0,a[f]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var h=s-i;h!==s&&0===a[h];)h++;for(var p=new Uint8Array(n+(s-h)),y=n;h!==s;)p[y++]=a[h++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,s=t.length;i!==s&&0===t[i];)i++,r++;for(var a=(s-i)*u+1>>>0,c=new Uint8Array(a);i!==s;){for(var d=t[i],f=0,h=a-1;(0!==d||f<n)&&-1!==h;h--,f++)d+=256*c[h]>>>0,c[h]=d%o>>>0,d=d/o>>>0;if(0!==d)throw Error("Non-zero carry");n=f,i++}for(var p=a-n;p!==a&&0===c[p];)p++;for(var y=l.repeat(r);p<a;++p)y+=e.charAt(c[p]);return y},decodeUnsafe:d,decode:function(e){var r=d(e);if(r)return r;throw Error(`Non-${t} character`)}}};let ue=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")};class ut{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class ur{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return ui(this,e)}}class un{constructor(e){this.decoders=e}or(e){return ui(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let ui=(e,t)=>new un({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class us{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new ut(e,t,r),this.decoder=new ur(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let ua=({name:e,prefix:t,encode:r,decode:n})=>new us(e,t,r,n),uo=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=c7(r,t);return ua({prefix:e,name:t,encode:n,decode:e=>ue(i(e))})},ul=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>ua({prefix:t,name:e,encode:e=>((e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,s="",a=0,o=0;for(let n=0;n<e.length;++n)for(o=o<<8|e[n],a+=8;a>r;)a-=r,s+=t[i&o>>a];if(a&&(s+=t[i&o<<r-a]),n)for(;s.length*r&7;)s+="=";return s})(e,n,r),decode:t=>((e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let a=new Uint8Array(s*r/8|0),o=0,l=0,c=0;for(let t=0;t<s;++t){let s=i[e[t]];if(void 0===s)throw SyntaxError(`Non-${n} character`);l=l<<r|s,(o+=r)>=8&&(o-=8,a[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw SyntaxError("Unexpected end of data");return a})(t,n,r,e)});var uc=Object.freeze({__proto__:null,identity:ua({prefix:"\0",name:"identity",encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)})}),uu=Object.freeze({__proto__:null,base2:ul({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),ud=Object.freeze({__proto__:null,base8:ul({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),uf=Object.freeze({__proto__:null,base10:uo({prefix:"9",name:"base10",alphabet:"0123456789"})}),uh=Object.freeze({__proto__:null,base16:ul({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:ul({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let up=ul({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),uy=ul({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),um=ul({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ug=ul({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ub=ul({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),uw=ul({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),uv=ul({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5});var ux=Object.freeze({__proto__:null,base32:up,base32upper:uy,base32pad:um,base32padupper:ug,base32hex:ub,base32hexupper:uw,base32hexpad:uv,base32hexpadupper:ul({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:ul({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),u_=Object.freeze({__proto__:null,base36:uo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:uo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),uE=Object.freeze({__proto__:null,base58btc:uo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:uo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let uA=ul({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
206+/",bitsPerChar:6}),uI=ul({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6});var uC=Object.freeze({__proto__:null,base64:uA,base64pad:uI,base64url:ul({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:ul({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let uS=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),uP=uS.reduce((e,t,r)=>(e[r]=t,e),[]),u$=uS.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var uk=Object.freeze({__proto__:null,base256emoji:ua({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=uP[t],"")},decode:function(e){let t=[];for(let r of e){let e=u$[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})});function uT(e,t,r){t=t||[],r=r||0;for(var n=r;e>=0x80000000;)t[r++]=255&e|128,e/=128;for(;-128&e;)t[r++]=255&e|128,e>>>=7;return t[r]=0|e,uT.bytes=r-n+1,t}var uO={encode:uT,encodingLength:function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10}};let uN=(e,t,r=0)=>(uO.encode(e,t,r),t),uR=e=>uO.encodingLength(e),uB=(e,t)=>{let r=t.byteLength,n=uR(e),i=n+uR(r),s=new Uint8Array(i+r);return uN(e,s,0),uN(r,s,n),s.set(t,i),new uD(e,r,t,s)};
206class uD{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let uM=({name:e,code:t,encode:r})=>new uU(e,t,r);class uU{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?uB(this.code,t):t.then(e=>uB(this.code,e))}throw Error("Unknown type, must be binary type")}}let uj=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var uL=Object.freeze({__proto__:null,sha256:uM({name:"sha2-256",code:18,encode:uj("SHA-256")}),sha512:uM({name:"sha2-512",code:19,encode:uj("SHA-512")})}),uF=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:ue,digest:e=>uB(0,ue(e))}});new TextEncoder,new TextDecoder;let uz={...uc,...uu,...ud,...uf,...uh,...ux,...u_,...uE,...uC,...uk};function uq(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function uW(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...uL,...uF});let uH=uW("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),uK=uW("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?uq(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),uV={utf8:uH,"utf-8":uH,hex:uz.base16,latin1:uK,ascii:uK,binary:uK,...uz};var uG=Object.defineProperty,uJ=(e,t,r)=>((e,t,r)=>t in e?uG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class uY{constructor(e,t){this.core=e,this.logger=t,uJ(this,"keychain",new Map),uJ(this,"name","keychain"),uJ(this,"version","0.3"),uJ(this,"initialized",!1),uJ(this,"storagePrefix",cD),uJ(this,"init",async()=>{if(!this.initialized){let e=await this.getKeyChain();"u">typeof e&&(this.keychain=e),this.initialized=!0}}),uJ(this,"has",e=>(this.isInitialized(),this.keychain.has(e))),uJ(this,"set",async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()}),uJ(this,"get",e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>"u"){let{message:t}=lR("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}),uJ(this,"del",async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()}),this.core=e,this.logger=nN(t,this.name)}get context(){return nO(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,n6(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?n3(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=lR("NOT_INITIALIZED",this.name);throw Error(e)}}}var uZ=Object.defineProperty,uQ=(e,t,r)=>((e,t,r)=>t in e?uZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class uX{constructor(e,t,r){this.core=e,this.logger=t,uQ(this,"name","crypto"),uQ(this,"keychain"),uQ(this,"randomSessionIdentifier",o6()),uQ(this,"initialized",!1),uQ(this,"clientId"),uQ(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),uQ(this,"hasKeys",e=>(this.isInitialized(),this.keychain.has(e))),uQ(this,"getClientId",async()=>{if(this.isInitialized(),this.clientId)return this.clientId;let e=await this.getClientSeed(),t=nn.TZ(e),r=nn.UF(t.publicKey);return this.clientId=r,r}),uQ(this,"generateKeyPair",()=>{this.isInitialized();let e=function(){let e=oT.utils.randomPrivateKey(),t=oT.getPublicKey(e);return{privateKey:(0,ni.dI)(e,o0),publicKey:(0,ni.dI)(t,o0)}}();return this.setPrivateKey(e.publicKey,e.privateKey)}),uQ(this,"signJWT",async e=>{this.isInitialized();let t=await this.getClientSeed(),r=nn.TZ(t),n=this.randomSessionIdentifier;return await nn.FA(n,e,cL,r)}),uQ(this,"generateSharedKey",(e,t,r)=>{this.isInitialized();let n=function(e,t){var r;let n,i=oT.getSharedSecret((0,ni.sH)(e,o0),(0,ni.sH)(t,o0)),s=(n=void 0,function(e,t,r,n=32){iR(e),iO(n);let i=e.outputLen;if(n>255*i)throw Error("Length should be <= 255*HashLen");let s=Math.ceil(n/i);void 0===r&&(r=ak);let a=new Uint8Array(s*i),o=aP.create(e,t),l=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let e=0;e<s;e++)a$[0]=e+1,l.update(0===e?ak:c).update(r).update(a$).digestInto(c),a.set(c,i*e),o._cloneInto(l);return o.destroy(),l.destroy(),iU(c,a$),a.slice(0,n)}(sI,(r=void 0,iR(sI),void 0===r&&(r=new Uint8Array(sI.outputLen)),aP(sI,iQ(r),iQ(i))),n,32));return(0,ni.dI)(s,o0)}(this.getPrivateKey(e),t);return this.setSymKey(n,r)}),uQ(this,"setSymKey",async(e,t)=>{this.isInitialized();let r=t||o3(e);return await this.keychain.set(r,e),r}),uQ(this,"deleteKeyPair",async e=>{this.isInitialized(),await this.keychain.del(e)}),uQ(this,"deleteSymKey",async e=>{this.isInitialized(),await this.keychain.del(e)}),uQ(this,"encode",async(e,t,r)=>{this.isInitialized();let n=ln(r),i=(0,nc.h)(t);if(2===n.type)return function(e,t){let r=o4(2),n=i2(12),i=lt({type:r,sealed:(0,ni.sH)(e,o5),iv:n});return t===o2?o7(i):i}(i,r?.encoding);
206if(li(n)){let t=n.senderPublicKey,r=n.receiverPublicKey;e=await this.generateSharedKey(t,r)}let s=this.getSymKey(e),{type:a,senderPublicKey:o}=n;return function(e){let t=o4("u">typeof e.type?e.type:0);if(1===o9(t)&&typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");let r="u">typeof e.senderPublicKey?(0,ni.sH)(e.senderPublicKey,o0):void 0,n="u">typeof e.iv?(0,ni.sH)(e.iv,o0):i2(12),i=lt({type:t,sealed:aC((0,ni.sH)(e.symKey,o0),n).encrypt((0,ni.sH)(e.message,o5)),iv:n,senderPublicKey:r});return e.encoding===o2?o7(i):i}({type:a,symKey:s,message:i,senderPublicKey:o,encoding:r?.encoding})}),uQ(this,"decode",async(e,t,r)=>{this.isInitialized();let n=function(e,t){let r=lr({encoded:e,encoding:t?.encoding});return ln({type:o9(r.type),senderPublicKey:"u">typeof r.senderPublicKey?(0,ni.dI)(r.senderPublicKey,o0):void 0,receiverPublicKey:t?.receiverPublicKey})}(t,r);if(2===n.type){let e=function(e,t){let{sealed:r}=lr({encoded:e,encoding:t});return(0,ni.dI)(r,o5)}(t,r?.encoding);return(0,nc.j)(e)}if(li(n)){let t=n.receiverPublicKey,r=n.senderPublicKey;e=await this.generateSharedKey(t,r)}try{let n=this.getSymKey(e),i=function(e){let t=(0,ni.sH)(e.symKey,o0),{sealed:r,iv:n}=lr({encoded:e.encoded,encoding:e.encoding}),i=aC(t,n).decrypt(r);if(null===i)throw Error("Failed to decrypt");return(0,ni.dI)(i,o5)}({symKey:n,encoded:t,encoding:r?.encoding});return(0,nc.j)(i)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}}),uQ(this,"getPayloadType",(e,t=o1)=>o9(lr({encoded:e,encoding:t}).type)),uQ(this,"getPayloadSenderPublicKey",(e,t=o1)=>{let r=lr({encoded:e,encoding:t});return r.senderPublicKey?(0,ni.dI)(r.senderPublicKey,o0):void 0}),this.core=e,this.logger=nN(t,this.name),this.keychain=r||new uY(this.core,this.logger)}get context(){return nO(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(cj)}catch{e=o6(),await this.keychain.set(cj,e)}return function(e,t="utf8"){let r=uV[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?uq(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=lR("NOT_INITIALIZED",this.name);throw Error(e)}}}var u0=Object.defineProperty,u1=Object.defineProperties,u2=Object.getOwnPropertyDescriptors,u5=Object.getOwnPropertySymbols,u6=Object.prototype.hasOwnProperty,u3=Object.prototype.propertyIsEnumerable,u8=(e,t,r)=>t in e?u0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,u4=(e,t,r)=>u8(e,"symbol"!=typeof t?t+"":t,r);class u9 extends cg{constructor(e,t){super(e,t),this.logger=e,this.core=t,u4(this,"messages",new Map),u4(this,"messagesWithoutClientAck",new Map),u4(this,"name","messages"),u4(this,"version","0.3"),u4(this,"initialized",!1),u4(this,"storagePrefix",cD),u4(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let e=await this.getRelayerMessages();"u">typeof e&&(this.messages=e);let t=await this.getRelayerMessagesWithoutClientAck();"u">typeof t&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}}),u4(this,"set",async(e,t,r)=>{this.isInitialized();let n=o8(t),i=this.messages.get(e);if(typeof i>"u"&&(i={}),"u">typeof i[n])return n;if(i[n]=t,this.messages.set(e,i),r===cV.inbound){let r=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,u1(((e,t)=>{for(var r in t||(t={}))u6.call(t,r)&&u8(e,r,t[r]);if(u5)for(var r of u5(t))u3.call(t,r)&&u8(e,r,t[r]);return e})({},r),u2({[n]:t})))}return await this.persist(),n}),u4(this,"get",e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t}),u4(this,"getWithoutAck",e=>{this.isInitialized();let t={};for(let r of e){let e=this.messagesWithoutClientAck.get(r)||{};t[r]=Object.values(e)}return t}),u4(this,"has",(e,t)=>(this.isInitialized(),"u">typeof this.get(e)[o8(t)])),u4(this,"ack",async(e,t)=>{this.isInitialized();let r=this.messagesWithoutClientAck.get(e);if(typeof r>"u")return;let n=o8(t);delete r[n],0===Object.keys(r).length?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,r),await this.persist()}),u4(this,"del",async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()}),this.logger=nN(e,this.name),this.core=t}
206get context(){return nO(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,n6(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,n6(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?n3(e):void 0}async getRelayerMessagesWithoutClientAck(){let e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return"u">typeof e?n3(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){let{message:e}=lR("NOT_INITIALIZED",this.name);throw Error(e)}}}var u7=Object.defineProperty,de=Object.defineProperties,dt=Object.getOwnPropertyDescriptors,dr=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,di=Object.prototype.propertyIsEnumerable,ds=(e,t,r)=>t in e?u7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,da=(e,t)=>{for(var r in t||(t={}))dn.call(t,r)&&ds(e,r,t[r]);if(dr)for(var r of dr(t))di.call(t,r)&&ds(e,r,t[r]);return e},dl=(e,t)=>de(e,dt(t)),dc=(e,t,r)=>ds(e,"symbol"!=typeof t?t+"":t,r);class du extends cb{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,dc(this,"events",new ti.EventEmitter),dc(this,"name","publisher"),dc(this,"queue",new Map),dc(this,"publishTimeout",(0,to.toMiliseconds)(to.ONE_MINUTE)),dc(this,"initialPublishTimeout",(0,to.toMiliseconds)(15*to.ONE_SECOND)),dc(this,"needsTransportRestart",!1),dc(this,"publish",async(e,t,r)=>{var n,i,s,a,o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});let l=r?.ttl||cF,c=r?.prompt||!1,u=r?.tag||0,d=r?.id||(0,cT.getBigIntRpcId)().toString(),f=la(ls().protocol),h={id:d,method:r?.publishMethod||f.publish,params:da({topic:e,message:t,ttl:l,prompt:c,tag:u,attestation:r?.attestation},r?.tvf)},p=`Failed to publish payload, please try again. id:${d} tag:${u}`;try{lU(null==(n=h.params)?void 0:n.prompt)&&(null==(i=h.params)||delete i.prompt),lU(null==(s=h.params)?void 0:s.tag)&&(null==(a=h.params)||delete a.tag);let o=new Promise(async e=>{let t=({id:r})=>{var n;(null==(n=h.id)?void 0:n.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(cq.publish,t),e())};this.relayer.events.on(cq.publish,t);let n=n4(new Promise((e,t)=>{this.rpcPublish(h,r).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${d} tag:${u}`);try{await n,this.events.removeListener(cq.publish,t)}catch(e){this.queue.set(d,{request:h,opts:r,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:d,topic:e,message:t,opts:r}}),await n4(o,this.publishTimeout,p)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(o=r?.internal)&&o.throwOnFailedPublish)throw e}finally{this.queue.delete(d)}}),dc(this,"publishCustom",async e=>{var t,r,n,i,s;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:e});let{payload:a,opts:o={}}=e,{attestation:l,tvf:c,publishMethod:u,prompt:d,tag:f,ttl:h=to.FIVE_MINUTES}=o,p=o.id||(0,cT.getBigIntRpcId)().toString(),y=la(ls().protocol),m=u||y.publish,g={id:p,method:m,params:da(dl(da({},a),{ttl:h,prompt:d,tag:f,attestation:l}),c)},b=`Failed to publish custom payload, please try again. id:${p} tag:${f}`;try{lU(null==(t=g.params)?void 0:t.prompt)&&(null==(r=g.params)||delete r.prompt),lU(null==(n=g.params)?void 0:n.tag)&&(null==(i=g.params)||delete i.tag);let e=new Promise(async e=>{let t=({id:r})=>{var n;(null==(n=g.id)?void 0:n.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(cq.publish,t),e())};this.relayer.events.on(cq.publish,t);let r=n4(new Promise((e,t)=>
206{this.rpcPublish(g,o).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${m} id:${p} tag:${f}`);try{await r,this.events.removeListener(cq.publish,t)}catch(e){this.queue.set(p,{request:g,opts:o,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:p,payload:a,opts:o}}),await n4(e,this.publishTimeout,b)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(s=o?.internal)&&s.throwOnFailedPublish)throw e}finally{this.queue.delete(p)}}),dc(this,"on",(e,t)=>{this.events.on(e,t)}),dc(this,"once",(e,t)=>{this.events.once(e,t)}),dc(this,"off",(e,t)=>{this.events.off(e,t)}),dc(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.relayer=e,this.logger=nN(t,this.name),this.registerEventListeners()}get context(){return nO(this.logger)}async rpcPublish(e,t){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:e});let r=await this.relayer.request(e);return this.relayer.events.emit(cq.publish,da(da({},e),t)),this.logger.debug("Successfully Published Payload"),r}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{var r;let n=e.attempt+1;this.queue.set(t,dl(da({},e),{attempt:n})),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${null==(r=e.request.params)?void 0:r.tag}, attempt: ${n}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(l2.li.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(cq.connection_stalled);return}this.checkQueue()}),this.relayer.on(cq.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}var dd=Object.defineProperty,df=(e,t,r)=>((e,t,r)=>t in e?dd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class dh{constructor(){df(this,"map",new Map),df(this,"set",(e,t)=>{let r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])}),df(this,"get",e=>this.map.get(e)||[]),df(this,"exists",(e,t)=>this.get(e).includes(t)),df(this,"delete",(e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;let r=this.get(e);if(!this.exists(e,t))return;let n=r.filter(e=>e!==t);if(!n.length)return void this.map.delete(e);this.map.set(e,n)}),df(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}}var dp=Object.defineProperty,dy=Object.defineProperties,dm=Object.getOwnPropertyDescriptors,dg=Object.getOwnPropertySymbols,db=Object.prototype.hasOwnProperty,dw=Object.prototype.propertyIsEnumerable,dv=(e,t,r)=>t in e?dp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dx=(e,t)=>{for(var r in t||(t={}))db.call(t,r)&&dv(e,r,t[r]);if(dg)for(var r of dg(t))dw.call(t,r)&&dv(e,r,t[r]);return e},d_=(e,t)=>dy(e,dm(t)),dE=(e,t,r)=>dv(e,"symbol"!=typeof t?t+"":t,r);class dA extends cx{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,dE(this,"subscriptions",new Map),dE(this,"topicMap",new dh),dE(this,"events",new ti.EventEmitter),dE(this,"name","subscription"),dE(this,"version","0.3"),dE(this,"pending",new Map),dE(this,"cached",[]),dE(this,"initialized",!1),dE(this,"storagePrefix",cD),dE(this,"subscribeTimeout",(0,to.toMiliseconds)(to.ONE_MINUTE)),dE(this,"initialSubscribeTimeout",(0,to.toMiliseconds)(15*to.ONE_SECOND)),dE(this,"clientId"),dE(this,"batchSubscribeTopicsLimit",500),dE(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),dE(this,"subscribe",async(e,t)=>{var r;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{let n=ls(t),i={topic:e,relay:n,transportType:t?.transportType};null!=(r=t?.internal)&&r.skipSubscribe||this.pending.set(e,i);let s=await this.rpcSubscribe(e,n,t);return"string"==typeof s&&(this.onSubscribe(s,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),s}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}}),dE(this,"unsubscribe",async(e,t)=>{this.isInitialized(),"u">typeof t?.id?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)}),dE(this,"isSubscribed",e=>new Promise(t=>{t(this.topicMap.topics.includes(e))})),dE(this,"isKnownTopic",e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))})),dE(this,"on",(e,t)=>{this.events.on(e,t)}),dE(this,"once",(e,t)=>{this.events.once(e,t)}),dE(this,"off",(e,t)=>{this.events.off(e,t)}),dE(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),dE(this,"start",async()=>{await this.onConnect()}),dE(this,"stop",async()=>{await this.onDisconnect()}),dE(this,"restart",async()=>
206{await this.restore(),await this.onRestart()}),dE(this,"checkPending",async()=>{if(0===this.pending.size&&(!this.initialized||!this.relayer.connected))return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}),dE(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(l2.li.pulse,async()=>{await this.checkPending()}),this.events.on(cJ.created,async e=>{let t=cJ.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(cJ.deleted,async e=>{let t=cJ.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}),this.relayer=e,this.logger=nN(t,this.name),this.clientId=""}get context(){return nO(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let r=this.topicMap.get(e);await Promise.all(r.map(async r=>await this.unsubscribeById(e,r,t)))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{let n=ls(r);await this.restartToComplete({topic:e,id:t,relay:n}),await this.rpcUnsubscribe(e,t,n);let i=lB("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,r){var n,i;
206let s=await this.getSubscriptionId(e);if(null!=(n=r?.internal)&&n.skipSubscribe)return s;r&&r?.transportType!==cK.relay||await this.restartToComplete({topic:e,id:e,relay:t});let a={method:la(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:a});let o=null==(i=r?.internal)?void 0:i.throwOnFailedPublish;try{if(r?.transportType===cK.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(a).catch(e=>this.logger.warn(e))},(0,to.toMiliseconds)(to.ONE_SECOND)),s;let t=new Promise(async t=>{let r=n=>{n.topic===e&&(this.events.removeListener(cJ.created,r),t(n.id))};this.events.on(cJ.created,r);try{let n=await n4(new Promise((e,t)=>{this.relayer.request(a).catch(e=>{this.logger.warn(e,e?.message),t(e)}).then(e)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(cJ.created,r),t(n)}catch{}}),n=await n4(t,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!n&&o)throw Error(`Subscribing to ${e} failed, please try again`);return n?s:null}catch(e){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(cq.connection_stalled),o)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return;let t={method:la(e[0].relay.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{await await n4(new Promise(e=>{this.relayer.request(t).catch(e=>this.logger.warn(e)).then(e)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(cq.connection_stalled)}}async rpcBatchFetchMessages(e){let t;if(!e.length)return;let r={method:la(e[0].relay.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{t=await await n4(new Promise((e,t)=>{this.relayer.request(r).catch(e=>{this.logger.warn(e),t(e)}).then(e)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(cq.connection_stalled)}return t}rpcUnsubscribe(e,t,r){let n={method:la(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,d_(dx({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,dx({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,dx({},t)),this.topicMap.set(t.topic,e),this.events.emit(cJ.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=lR("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});let r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(cJ.deleted,d_(dx({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(cJ.sync)}async onRestart(){if(this.cached.length){let e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<t;r++){let t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(cJ.resubscribed)}
206async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size&&!e.every(e=>{var t;return e.topic===(null==(t=this.subscriptions.get(e.id))?void 0:t.topic)})){let{message:e}=lR("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async e=>d_(dx({},e),{id:await this.getSubscriptionId(e.topic)})))))}async batchFetchMessages(e){var t;if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(await (t=(0,to.toMiliseconds)(to.ONE_SECOND),new Promise(e=>setTimeout(e,t))),await this.relayer.handleBatchMessageEvents(r.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){let{message:e}=lR("NOT_INITIALIZED",this.name);throw Error(e)}}async restartToComplete(e){this.relayer.connected||this.relayer.connecting||(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return o8(e+await this.getClientId())}}var dI=Object.defineProperty,dC=Object.getOwnPropertySymbols,dS=Object.prototype.hasOwnProperty,dP=Object.prototype.propertyIsEnumerable,d$=(e,t,r)=>t in e?dI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dk=(e,t)=>{for(var r in t||(t={}))dS.call(t,r)&&d$(e,r,t[r]);if(dC)for(var r of dC(t))dP.call(t,r)&&d$(e,r,t[r]);return e},dT=(e,t,r)=>d$(e,"symbol"!=typeof t?t+"":t,r);class dO extends cw{constructor(e){var t;super(e),dT(this,"protocol","wc"),dT(this,"version",2),dT(this,"core"),dT(this,"logger"),dT(this,"events",new ti.EventEmitter),dT(this,"provider"),dT(this,"messages"),dT(this,"subscriber"),dT(this,"publisher"),dT(this,"name","relayer"),dT(this,"transportExplicitlyClosed",!1),dT(this,"initialized",!1),dT(this,"connectionAttemptInProgress",!1),dT(this,"relayUrl"),dT(this,"projectId"),dT(this,"packageName"),dT(this,"bundleId"),dT(this,"hasExperiencedNetworkDisruption",!1),dT(this,"pingTimeout"),dT(this,"heartBeatTimeout",(0,to.toMiliseconds)(to.THIRTY_SECONDS+to.FIVE_SECONDS)),dT(this,"reconnectTimeout"),dT(this,"connectPromise"),dT(this,"reconnectInProgress",!1),dT(this,"requestsInFlight",[]),dT(this,"connectTimeout",(0,to.toMiliseconds)(15*to.ONE_SECOND)),dT(this,"request",async e=>{var t,r;this.logger.debug("Publishing Request Payload");let n=e.id||(0,cT.getBigIntRpcId)().toString();await this.toEstablishConnection();try{this.logger.trace({id:n,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - publishing...");let i=`${n}:${(null==(r=e.params)?void 0:r.tag)||""}`;this.requestsInFlight.push(i);let s=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==i),s}catch(e){throw this.logger.debug(`Failed to Publish Request: ${n}`),e}}),dT(this,"resetPingTimeout",()=>{nY()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,r,n;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),null==(n=null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.terminate)||n.call(r)}catch(e){this.logger.warn(e,e?.message)}},this.heartBeatTimeout))}),dT(this,"onPayloadHandler",e=>{this.onProviderPayload(e),this.resetPingTimeout()}),dT(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected \uD83D\uDEDC"),this.startPingTimeout(),this.events.emit(cq.connect)}),dT(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected \uD83D\uDED1"),this.requestsInFlight=[],this.onProviderDisconnect()}),dT(this,"onProviderErrorHandler",e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit(cq.error,e),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),dT(this,"registerProviderListeners",()=>{this.provider.on(cW.payload,this.onPayloadHandler),this.provider.on(cW.connect,this.onConnectHandler),this.provider.on(cW.disconnect,this.onDisconnectHandler),this.provider.on(cW.error,this.onProviderErrorHandler)}),this.core=e.core,this.logger=l1({logger:null!=(t=e.logger)?t:"error",name:this.name}),this.messages=new u9(this.logger,e.core),this.subscriber=new dA(this,this.logger),this.publisher=new du(this,this.logger),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||cz,nZ()&&"u">typeof global&&"u">typeof(null==global?void 0:global.Platform)&&(null==global?void 0:global.Platform.OS)==="android"?this.packageName=n0():nZ()&&"u">typeof global&&"u">typeof(null==global?void 0:global.Platform)&&(null==global?void 0:global.Platform.OS)==="ios"&&(this.bundleId=n0()),this.provider={}}
206async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e?.message))}get context(){return nO(this.logger)}get connected(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===1}get connecting(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===0||void 0!==this.connectPromise}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:cK.relay},cV.outbound)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){var r,n,i;this.isInitialized(),null!=t&&t.transportType&&t?.transportType!=="relay"||await this.toEstablishConnection();let s=typeof(null==(r=t?.internal)?void 0:r.throwOnFailedPublish)>
206"u"||(null==(n=t?.internal)?void 0:n.throwOnFailedPublish),a=(null==(i=this.subscriber.topicMap.get(e))?void 0:i[0])||"",o,l=t=>{t.topic===e&&(this.subscriber.off(cJ.created,l),o())};return await Promise.all([new Promise(e=>{o=e,this.subscriber.on(cJ.created,l)}),new Promise(async(r,n)=>{a=await this.subscriber.subscribe(e,dk({internal:{throwOnFailedPublish:s}},t)).catch(e=>{s&&n(e)})||a,r()})]),a}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await n4(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(!this.subscriber.hasAnyTopics)return void this.logger.info("Starting WS connection skipped because the client has no topics to work with.");if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(t,r)=>{await this.connect(e).then(t).catch(r).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await lY())throw Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0)return void this.logger.trace("Batch message events is empty. Ignoring...");let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);for(let e of(this.logger.debug(`Batch of ${t.length} message events sorted`),t))try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,"Error while processing batch message event: "+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:r}=e;if(!t.sessionExists){let e=ie(to.FIVE_MINUTES);await this.core.pairing.pairings.set(r,{topic:r,expiry:e,relay:{protocol:"irn"},active:!1})}this.events.emit(cq.message,e),await this.recordMessageEvent(e,cV.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let t=1;for(;t<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise(async(e,t)=>{let r=()=>{t(Error("Connection interrupted while trying to connect"))};this.provider.once(cW.disconnect,r),await n4(new Promise((e,t)=>{this.provider.connect().then(e).catch(t)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(e=>{t(e)}).finally(()=>{this.provider.off(cW.disconnect,r),clearTimeout(this.reconnectTimeout)}),await new Promise(async(e,r)=>{let n=()=>{t(Error("Connection interrupted while trying to subscribe"))};this.provider.once(cW.disconnect,n),await this.subscriber.start().then(e).catch(r).finally(()=>{this.provider.off(cW.disconnect,n)})}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(e){await this.subscriber.stop(),this.logger.warn({},e.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(e=>setTimeout(e,(0,to.toMiliseconds)(+t))),t++}}startPingTimeout(){var e,t,r,n,i;if(nY())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(i=null==(n=null==(r=this.provider)?void 0:r.connection)?void 0:n.socket)||i.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new ck.F(new cO.A(function({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:a,bundleId:o,packageName:l}){let c=r.split("?"),u=n2(e,t,n),d=function(e,t){let r=new URLSearchParams(e);return Object.entries(t).sort(([e],[t])=>
206e.localeCompare(t)).forEach(([e,t])=>{null!=t&&r.set(e,String(t))}),r.toString()}(c[1]||"",{auth:i,ua:u,projectId:s,useOnCloseEvent:a||void 0,packageName:l||void 0,bundleId:o||void 0});return c[0]+"?"+d}({sdkVersion:cH,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){let{topic:r,message:n}=e;await this.messages.set(r,n,t)}async shouldIgnoreMessageEvent(e){let{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;let n=this.messages.has(t,r);return n&&this.logger.warn(`Ignoring duplicate message: ${r}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),(0,cT.isJsonRpcRequest)(e)){if(!e.method.endsWith("_subscription"))return;let t=e.params,{topic:r,message:n,publishedAt:i,attestation:s}=t.data,a={topic:r,message:n,publishedAt:i,transportType:cK.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(dk({type:"event",event:t.id},a)),this.events.emit(t.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else(0,cT.isJsonRpcResponse)(e)&&this.events.emit(cq.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,cV.inbound),this.events.emit(cq.message,e))}async acknowledgePayload(e){let t=(0,cT.formatJsonRpcResult)(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(cW.payload,this.onPayloadHandler),this.provider.off(cW.connect,this.onConnectHandler),this.provider.off(cW.disconnect,this.onDisconnectHandler),this.provider.off(cW.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await lY();(function(e){var t,r;switch(nX()){case nJ.browser:t=e,!nZ()&&nQ()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)));break;case nJ.reactNative:r=e,nZ()&&"u">typeof global&&null!=global&&global.NetInfo&&global?.NetInfo.addEventListener(e=>r(e?.isConnected));case nJ.node:}})(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,e?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(l2.li.pulse,async()=>{var e;if(!this.transportExplicitlyClosed&&!this.connected&&(!(nQ()&&(0,tl.getDocument)())||(null==(e=(0,tl.getDocument)())?void 0:e.visibilityState)==="visible"))try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(cq.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,to.toMiliseconds)(.1)))))}isInitialized(){if(!this.initialized){let{message:e}=lR("NOT_INITIALIZED",this.name);throw Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise)return void await this.connectPromise;await this.connect()}}}function dN(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function dR(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let dB="[object Arguments]",dD="[object Object]";function dM(){}function dU(e){if(!e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}var dj=Object.defineProperty,dL=Object.getOwnPropertySymbols,dF=Object.prototype.hasOwnProperty,dz=Object.prototype.propertyIsEnumerable,dq=(e,t,r)=>t in e?dj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dW=(e,t)=>
206{for(var r in t||(t={}))dF.call(t,r)&&dq(e,r,t[r]);if(dL)for(var r of dL(t))dz.call(t,r)&&dq(e,r,t[r]);return e},dH=(e,t,r)=>dq(e,"symbol"!=typeof t?t+"":t,r);class dK extends cv{constructor(e,t,r,n=cD,i){super(e,t,r,n),this.core=e,this.logger=t,this.name=r,dH(this,"map",new Map),dH(this,"version","0.3"),dH(this,"cached",[]),dH(this,"initialized",!1),dH(this,"getKey"),dH(this,"storagePrefix",cD),dH(this,"recentlyDeleted",[]),dH(this,"recentlyDeletedLimit",200),dH(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{this.getKey&&null!==e&&!lU(e)?this.map.set(this.getKey(e),e):function(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}(e)?this.map.set(e.id,e):e?.topic&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)}),dH(this,"set",async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())}),dH(this,"get",e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e))),dH(this,"getAll",e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(r=>{var n;return n=t[r],function e(t,r,n,i,s,a,o){let l=o(t,r,n,i,s,a);if(void 0!==l)return l;if(typeof t==typeof r)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return t===r;case"number":return t===r||Object.is(t,r)}return function t(r,n,i,s){if(Object.is(r,n))return!0;let a=dR(r),o=dR(n);if(a===dB&&(a=dD),o===dB&&(o=dD),a!==o)return!1;switch(a){case"[object String]":return r.toString()===n.toString();case"[object Number]":{let e=r.valueOf(),t=n.valueOf();return e===t||Number.isNaN(e)&&Number.isNaN(t)}case"[object Boolean]":case"[object Date]":case"[object Symbol]":return Object.is(r.valueOf(),n.valueOf());case"[object RegExp]":return r.source===n.source&&r.flags===n.flags;case"[object Function]":return r===n}let l=(i=i??new Map).get(r),c=i.get(n);if(null!=l&&null!=c)return l===n;i.set(r,n),i.set(n,r);try{switch(a){case"[object Map]":if(r.size!==n.size)return!1;for(let[t,a]of r.entries())if(!n.has(t)||!e(a,n.get(t),t,r,n,i,s))return!1;return!0;case"[object Set]":{if(r.size!==n.size)return!1;let t=Array.from(r.values()),a=Array.from(n.values());for(let o=0;o<t.length;o++){let l=t[o],c=a.findIndex(t=>e(l,t,void 0,r,n,i,s));if(-1===c)return!1;a.splice(c,1)}return!0}case"[object Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":case"[object BigUint64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object BigInt64Array]":case"[object Float32Array]":case"[object Float64Array]":if("u">typeof cN&&cN.isBuffer(r)!==cN.isBuffer(n)||r.length!==n.length)return!1;for(let t=0;t<r.length;t++)if(!e(r[t],n[t],t,r,n,i,s))return!1;return!0;case"[object ArrayBuffer]":return r.byteLength===n.byteLength&&t(new Uint8Array(r),new Uint8Array(n),i,s);case"[object DataView]":return r.byteLength===n.byteLength&&r.byteOffset===n.byteOffset&&t(new Uint8Array(r),new Uint8Array(n),i,s);case"[object Error]":return r.name===n.name&&r.message===n.message;case dD:{if(!(t(r.constructor,n.constructor,i,s)||dU(r)&&dU(n)))return!1;let a=[...Object.keys(r),...dN(r)],o=[...Object.keys(n),...dN(n)];if(a.length!==o.length)return!1;for(let t=0;t<a.length;t++){let o=a[t],l=r[o];if(!Object.hasOwn(n,o))return!1;let c=n[o];if(!e(l,c,o,r,n,i,s))return!1}return!0}default:return!1}}finally{i.delete(r),i.delete(n)}}(t,r,a,o)}(n,e[r],void 0,void 0,void 0,void 0,dM)})):this.values)),dH(this,"update",async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});let r=dW(dW({},this.getData(e)),t);this.map.set(e,r),await this.persist()}),dH(this,"delete",async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())}),this.logger=nN(t,this.name),this.storagePrefix=n,this.getKey=i}get context(){return nO(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}
206get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=lR("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=lR("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){let{message:e}=lR("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=lR("NOT_INITIALIZED",this.name);throw Error(e)}}}var dV=Object.defineProperty,dG=(e,t,r)=>((e,t,r)=>t in e?dV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class dJ{constructor(e,t){this.core=e,this.logger=t,dG(this,"name","pairing"),dG(this,"version","0.3"),dG(this,"events",new ti),dG(this,"pairings"),dG(this,"initialized",!1),dG(this,"storagePrefix",cD),dG(this,"ignoredPayloadTypes",[1]),dG(this,"registeredMethods",[]),dG(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),dG(this,"register",({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]}),dG(this,"create",async e=>{this.isInitialized();let t=o6(),r=await this.core.crypto.setSymKey(t),n=ie(to.FIVE_MINUTES),i={protocol:"irn"},s={topic:r,expiry:n,relay:i,active:!1,methods:e?.methods},a=lm({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:i,expiryTimestamp:n,methods:e?.methods});return this.events.emit(cZ.create,s),this.core.expirer.set(r,n),await this.pairings.set(r,s),await this.core.relayer.subscribe(r,{transportType:e?.transportType,internal:e?.internal}),{topic:r,uri:a}}),dG(this,"pair",async e=>{let t;this.isInitialized();let r=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[c5.pairing_started]}});this.isValidPair(e,r);let{topic:n,symKey:i,relay:s,expiryTimestamp:a,methods:o}=ly(e.uri);if(r.props.properties.topic=n,r.addTrace(c5.pairing_uri_validation_success),r.addTrace(c5.pairing_uri_not_expired),this.pairings.keys.includes(n)){if(t=this.pairings.get(n),r.addTrace(c5.existing_pairing),t.active)throw r.setError(c6.active_pairing_already_exists),Error(`Pairing already exists: ${n}. Please try again with a new connection URI.`);r.addTrace(c5.pairing_not_expired)}let l=a||ie(to.FIVE_MINUTES),c={topic:n,relay:s,expiry:l,active:!1,methods:o};this.core.expirer.set(n,l),await this.pairings.set(n,c),r.addTrace(c5.store_new_pairing),e.activatePairing&&await this.activate({topic:n}),this.events.emit(cZ.create,c),r.addTrace(c5.emit_inactive_pairing),this.core.crypto.keychain.has(n)||await this.core.crypto.setSymKey(i,n),r.addTrace(c5.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{r.setError(c6.no_internet_connection)}try{await this.core.relayer.subscribe(n,{relay:s})}catch(e){throw r.setError(c6.subscribe_pairing_topic_failure),e}return r.addTrace(c5.subscribe_pairing_topic_success),c}),dG(this,"activate",async({topic:e})=>{this.isInitialized();let t=ie(to.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})}),dG(this,"ping",async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn("ping() is deprecated and will be removed in the next major release.");let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:n,reject:i}=n8();this.events.once(ir("pairing_ping",e),({error:e})=>{e?i(e):n()}),await r()}}),dG(this,"updateExpiry",async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})}),dG(this,"updateMetadata",async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})}),dG(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),dG(this,"disconnect",async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",lB("USER_DISCONNECTED")),await this.deletePairing(t))}),dG(this,"formatUriFromPairing",e=>{this.isInitialized();let{topic:t,relay:r,expiry:n,methods:i}=e,s=this.core.crypto.keychain.get(t);return lm({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:s,relay:r,expiryTimestamp:n,methods:i})}),dG(this,"sendRequest",async(e,t,r)=>{let n=(0,cT.formatJsonRpcRequest)(t,r),i=await this.core.crypto.encode(e,n),s=cY[t].req;return this.core.history.set(e,n),this.core.relayer.publish(e,i,s),n.id}),dG(this,"sendResult",async(e,t,r)=>{let n=(0,cT.formatJsonRpcResult)(e,r),i=await this.core.crypto.encode(t,n),s=cY[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(n)}),dG(this,"sendError",async(e,t,r)=>{let n=(0,cT.formatJsonRpcError)(e,r),i=await this.core.crypto.encode(t,n),s=(await this.core.history.get(t,e)).request.method,a=cY[s]?cY[s].res:cY.unregistered_method.res;await this.core.relayer.publish(t,i,a),await this.core.history.resolve(n)}),dG(this,"deletePairing",async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,lB("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])}),dG(this,"cleanup",async()=>{let e=this.pairings.getAll().filter(e=>it(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))}),dG(this,"onRelayEventRequest",async e=>{let{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return await this.onPairingPingRequest(t,r);case"wc_pairingDelete":return await this.onPairingDeleteRequest(t,r);default:return await this.onUnknownRpcMethodRequest(t,r)}}),dG(this,"onRelayEventResponse",async e=>{let{topic:t,payload:r}=e,n=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===n?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(n)}),dG(this,"onPairingPingRequest",async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit(cZ.ping,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),dG(this,"onPairingPingResponse",(e,t)=>{let{id:r}=t;setTimeout(()=>
206{(0,cT.isJsonRpcResult)(t)?this.events.emit(ir("pairing_ping",r),{}):(0,cT.isJsonRpcError)(t)&&this.events.emit(ir("pairing_ping",r),{error:t.error})},500)}),dG(this,"onPairingDeleteRequest",async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(cZ.delete,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),dG(this,"onUnknownRpcMethodRequest",async(e,t)=>{let{id:r,method:n}=t;try{if(this.registeredMethods.includes(n))return;let t=lB("WC_METHOD_UNSUPPORTED",n);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),dG(this,"onUnknownRpcMethodResponse",e=>{this.registeredMethods.includes(e)||this.logger.error(lB("WC_METHOD_UNSUPPORTED",e))}),dG(this,"isValidPair",(e,t)=>{var r;if(!lK(e)){let{message:r}=lR("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(c6.malformed_pairing_uri),Error(r)}if(!function(e){function t(e){try{return"u">typeof new URL(e)}catch{return!1}}try{if(lj(e,!1)){if(t(e))return!0;let r=iu(e);return t(r)}}catch{}return!1}(e.uri)){let{message:r}=lR("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(c6.malformed_pairing_uri),Error(r)}let n=ly(e?.uri);if(!(null!=(r=n?.relay)&&r.protocol)){let{message:e}=lR("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(c6.malformed_pairing_uri),Error(e)}if(!(null!=n&&n.symKey)){let{message:e}=lR("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(c6.malformed_pairing_uri),Error(e)}if(null!=n&&n.expiryTimestamp&&(0,to.toMiliseconds)(n?.expiryTimestamp)<Date.now()){t.setError(c6.pairing_expired);let{message:e}=lR("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw Error(e)}}),dG(this,"isValidPing",async e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)}),dG(this,"isValidDisconnect",async e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)}),dG(this,"isValidPairingTopic",async e=>{if(!lj(e,!1)){let{message:t}=lR("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=lR("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(it(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=lR("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}),this.core=e,this.logger=nN(t,this.name),this.pairings=new dK(this.core,this.logger,this.name,this.storagePrefix)}get context(){return nO(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=lR("NOT_INITIALIZED",this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(cq.message,async e=>{let{topic:t,message:r,transportType:n}=e;if(this.pairings.keys.includes(t)&&n!==cK.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{let e=await this.core.crypto.decode(t,r);(0,cT.isJsonRpcRequest)(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):(0,cT.isJsonRpcResponse)(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,r)}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(cX.expired,async e=>{let{topic:t}=n7(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(cZ.expire,{topic:t}))})}}var dY=Object.defineProperty,dZ=(e,t,r)=>((e,t,r)=>t in e?dY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class dQ extends cm{constructor(e,t){super(e,t),this.core=e,this.logger=t,dZ(this,"records",new Map),dZ(this,"events",new ti.EventEmitter),dZ(this,"name","history"),dZ(this,"version","0.3"),dZ(this,"cached",[]),dZ(this,"initialized",!1),dZ(this,"storagePrefix",cD),dZ(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(
206),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),dZ(this,"set",(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;let n={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:ie(to.THIRTY_DAYS)};this.records.set(n.id,n),this.persist(),this.events.emit(cQ.created,n)}),dZ(this,"resolve",async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=(0,cT.isJsonRpcError)(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(cQ.updated,t))}),dZ(this,"get",async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t))),dZ(this,"delete",(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach(r=>{r.topic===e&&("u">typeof t&&r.id!==t||(this.records.delete(r.id),this.events.emit(cQ.deleted,r)))}),this.persist()}),dZ(this,"exists",async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e)),dZ(this,"on",(e,t)=>{this.events.on(e,t)}),dZ(this,"once",(e,t)=>{this.events.once(e,t)}),dZ(this,"off",(e,t)=>{this.events.off(e,t)}),dZ(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=nN(t,this.name)}get context(){return nO(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if("u">typeof t.response)return;let r={topic:t.topic,request:(0,cT.formatJsonRpcRequest)(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=lR("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(cQ.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){let{message:e}=lR("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(cQ.created,e=>{let t=cQ.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(cQ.updated,e=>{let t=cQ.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(cQ.deleted,e=>{let t=cQ.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(l2.li.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,to.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(cQ.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=lR("NOT_INITIALIZED",this.name);throw Error(e)}}}var dX=Object.defineProperty,d0=(e,t,r)=>((e,t,r)=>t in e?dX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class d1 extends c_{constructor(e,t){super(e,t),this.core=e,this.logger=t,d0(this,"expirations",new Map),d0(this,"events",new ti.EventEmitter),d0(this,"name","expirer"),d0(this,"version","0.3"),d0(this,"cac
206hed",[]),d0(this,"initialized",!1),d0(this,"storagePrefix",cD),d0(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),d0(this,"has",e=>{try{let t=this.formatTarget(e);return"u">typeof this.getExpiration(t)}catch{return!1}}),d0(this,"set",(e,t)=>{this.isInitialized();let r=this.formatTarget(e),n={target:r,expiry:t};this.expirations.set(r,n),this.checkExpiry(r,n),this.events.emit(cX.created,{target:r,expiration:n})}),d0(this,"get",e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)}),d0(this,"del",e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(cX.deleted,{target:t,expiration:r})}}),d0(this,"on",(e,t)=>{this.events.on(e,t)}),d0(this,"once",(e,t)=>{this.events.once(e,t)}),d0(this,"off",(e,t)=>{this.events.off(e,t)}),d0(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=nN(t,this.name)}get context(){return nO(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return n9("topic",e);if("number"==typeof e)return n9("id",e);let{message:t}=lR("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(cX.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){let{message:e}=lR("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=lR("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:r}=t;(0,to.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(cX.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(l2.li.pulse,()=>this.checkExpirations()),this.events.on(cX.created,e=>{let t=cX.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(cX.expired,e=>{let t=cX.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(cX.deleted,e=>{let t=cX.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=lR("NOT_INITIALIZED",this.name);throw Error(e)}}}var d2=Object.defineProperty,d5=(e,t,r)=>((e,t,r)=>t in e?d2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class d6 extends cE{constructor(e,t,r){super(e,t,r),this.core=e,this.logger=t,this.store=r,d5(this,"name","verify-api"),d5(this,"abortController"),d5(this,"isDevEnv"),d5(this,"verifyUrlV3",c1),d5(this,"storagePrefix",cD),d5(this,"version",2),d5(this,"publicKey"),d5(this,"fetchPromise"),d5(this,"init",async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,to.toMiliseconds)(null==(e=this.publicKey)?void 0:e.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),d5(this,"register",async e=>{if(!nQ()||this.isDevEnv)return;let t=window.location.origin,{id:r,decryptedId:n}=e,i=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${r}&decryptedId=${n}`;try{let e=(0,tl.getDocument)(),t=this.startAbortTimer(5*to.ONE_SECOND),n=await new Promise((n,s)=>{let a=()=>{window.removeEventListener("message",l),e.body.removeChild(o),s("attestation aborted")};this.abortController.signal.addEventListener("abort",a);let o=e.createElement("iframe");o.src=i,o.style.display="none",o.addEventListener("error",a,{signal:this.abortController.signal});let l=i=>{if(i.data&&"string"==typeof i.data)try{let s=JSON.parse(i.data);if("verify_attestation"===s.type){if((0,nn.Cq)(s.attestation).payload.id!==r)return;clearInterval(t),e.body.removeChild(o),this.abortController.signal.removeEventListener("abort",a),window.removeEventListener("message",l),n(null===s.attestation?"":s.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(o),window.addEventListener("message",l,{signal:this.abortController.signal})});return this.logger.debug(n,"jwt attestation"),n}catch(e){this.logger.warn(e)}return""}),d5(this,"resolve",async e=>{if(this.isDevEnv)return"";let{attestationId:t,hash:r,encryptedId:n}=e;if(""===t)return void this.logger.debug("resolve: attestationId is empty, skipping");if(t){if((0,nn.Cq)(t).payload.id!==n)return;let e=await this.isValidJwtAttestation(t);
206if(e)return e.isVerified?e:void this.logger.warn("resolve: jwt attestation: origin url not verified")}if(!r)return;let i=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(r,i)}),d5(this,"fetchAttestation",async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let r=this.startAbortTimer(5*to.ONE_SECOND),n=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(r),200===n.status?await n.json():void 0}),d5(this,"getVerifyUrl",e=>{let t=e||c0;return c2.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${c0}`),t=c0),t}),d5(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer(to.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}}),d5(this,"persistPublicKey",async e=>{this.logger.debug(e,"persisting public key to local storage"),await this.store.setItem(this.storeKey,e),this.publicKey=e}),d5(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),d5(this,"isValidJwtAttestation",async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}let r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(e,r)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}}),d5(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),d5(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e}),d5(this,"validateAttestation",(e,t)=>{let r=function(e,t){let[r,n,i]=e.split("."),s=nD.from(le(i),"base64");if(64!==s.length)throw Error("Invalid signature length");let a=s.slice(0,32),o=s.slice(32,64),l=sI(`${r}.${n}`),c=function(e){let t=nD.from(e.x,"base64"),r=nD.from(e.y,"base64");return(0,ni.xW)([new Uint8Array([4]),t,r])}(t);if(!oQ.verify((0,ni.xW)([a,o]),l,c))throw Error("Invalid signature");return(0,nn.Cq)(e).payload}(e,t.publicKey),n={hasExpired:(0,to.toMiliseconds)(r.exp)<Date.now(),payload:r};if(n.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),Error("JWT attestation expired");return{origin:n.payload.origin,isScam:n.payload.isScam,isVerified:n.payload.isVerified}}),this.logger=nN(t,this.name),this.abortController=new AbortController,this.isDevEnv=ic(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return nO(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,to.toMiliseconds)(e))}}var d3=Object.defineProperty,d8=(e,t,r)=>((e,t,r)=>t in e?d3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class d4 extends cA{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,d8(this,"context","echo"),d8(this,"registerDeviceToken",async e=>{let{clientId:t,token:r,notificationType:n,enableEncrypted:i=!1}=e,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:n,token:r,always_raw:i})})}),this.logger=nN(t,this.context)}}var d9=Object.defineProperty,d7=Object.getOwnPropertySymbols,fe=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,fr=(e,t,r)=>t in e?d9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fn=(e,t)=>{for(var r in t||(t={}))fe.call(t,r)&&fr(e,r,t[r]);if(d7)for(var r of d7(t))ft.call(t,r)&&fr(e,r,t[r]);return e},fi=(e,t,r)=>fr(e,"symbol"!=typeof t?t+"":t,r);class fs extends cI{constructor(e,t,r=!0){super(e,t,r),this.core=e,this.logger=t,fi(this,"context","event-client"),fi(this,"storagePrefix",cD),fi(this,"storageVersion",.1),fi(this,"events",new Map),fi(this,"shouldPersist",!1),fi(this,"init",async()=>
206{if(!ic())try{let e={eventId:il(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:n2(this.core.relayer.protocol,this.core.relayer.version,cH)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}}),fi(this,"createEvent",e=>{let{event:t="ERROR",type:r="",properties:{topic:n,trace:i}}=e,s=il(),a=this.core.projectId||"",o=fn({eventId:s,timestamp:Date.now(),props:{event:t,type:r,properties:{topic:n,trace:i}},bundleId:a,domain:this.getAppDomain()},this.setMethods(s));return this.telemetryEnabled&&(this.events.set(s,o),this.shouldPersist=!0),o}),fi(this,"getEvent",e=>{let{eventId:t,topic:r}=e;if(t)return this.events.get(t);let n=Array.from(this.events.values()).find(e=>e.props.properties.topic===r);if(n)return fn(fn({},n),this.setMethods(n.eventId))}),fi(this,"deleteEvent",e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0}),fi(this,"setEventListeners",()=>{this.core.heartbeat.on(l2.li.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,to.fromMiliseconds)(Date.now())-(0,to.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})}),fi(this,"setMethods",e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)})),fi(this,"addTrace",(e,t)=>{let r=this.events.get(e);r&&(r.props.properties.trace.push(t),this.events.set(e,r),this.shouldPersist=!0)}),fi(this,"setError",(e,t)=>{let r=this.events.get(e);r&&(r.props.type=t,r.timestamp=Date.now(),this.events.set(e,r),this.shouldPersist=!0)}),fi(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),fi(this,"restore",async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,fn(fn({},e),this.setMethods(e.eventId)))})}catch(e){this.logger.warn(e)}}),fi(this,"submit",async()=>{if(!this.telemetryEnabled||0===this.events.size)return;let e=[];for(let[t,r]of this.events)r.props.type&&e.push(r);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}}),fi(this,"sendEvent",async e=>{let t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${cH}${t}`,{method:"POST",body:JSON.stringify(e)})}),fi(this,"getAppDomain",()=>n1().url),this.logger=nN(t,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var fa=Object.defineProperty,fo=Object.getOwnPropertySymbols,fl=Object.prototype.hasOwnProperty,fc=Object.prototype.propertyIsEnumerable,fu=(e,t,r)=>t in e?fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fd=(e,t)=>{for(var r in t||(t={}))fl.call(t,r)&&fu(e,r,t[r]);if(fo)for(var r of fo(t))fc.call(t,r)&&fu(e,r,t[r]);return e},ff=(e,t,r)=>fu(e,"symbol"!=typeof t?t+"":t,r);class fh extends cp{constructor(e){var t;super(e),ff(this,"protocol","wc"),ff(this,"version",2),ff(this,"name",cB),ff(this,"relayUrl"),ff(this,"projectId"),ff(this,"customStoragePrefix"),ff(this,"events",new ti.EventEmitter),ff(this,"logger"),ff(this,"heartbeat"),ff(this,"relayer"),ff(this,"crypto"),ff(this,"storage"),ff(this,"history"),ff(this,"expirer"),ff(this,"pairing"),ff(this,"verify"),ff(this,"echoClient"),ff(this,"linkModeSupportedApps"),ff(this,"eventClient"),ff(this,"initialized",!1),ff(this,"logChunkController"),ff(this,"on",(e,t)=>this.events.on(e,t)),ff(this,"once",(e,t)=>this.events.once(e,t)),ff(this,"off",(e,t)=>this.events.off(e,t)),ff(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),ff(this,"dispatchEnvelope",({topic:e,message:t,sessionExists:r})=>{if(!e||!t)return;let n={topic:e,message:t,publishedAt:Date.now(),transportType:cK.link_mode};this.relayer.onLinkMessageEvent(n,{sessionExists:r})});let r=this.getGlobalCore(e?.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(e){console.warn("Failed to copy global core",e)}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||cz,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";let{logger:n,chunkLoggerController:i}=nR({opts:function(e){return nT(nk({},e),{level:e?.level||nu.level})}({level:"string"==typeof e?.logger&&e.logger?e.logger:cM.logger,name:cB}),maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=i,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=nN(n,this.name),this.heartbeat=new l2.VH,this.crypto=new uX(this,this.logger,e?.keychain),this.history=new dQ(this,this.logger),this.expirer=new d1(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new cu(fd(fd({},cU),e?.storageOptions)),this.relayer=new dO({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new dJ(this,this.logger),this.verify=new d6(this,this.logger,this.storage),this.echoClient=new d4(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new fs(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(e){let t=new fh(e);await t.initialize();let r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return nO(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(cG,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
206),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(cG)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(e,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e}`,r=`${t}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[t]}catch(e){console.warn("Failed to get global WalletConnect core",e);return}}setGlobalCore(e){var t;try{if(this.isGlobalCoreDisabled())return;let r=`_walletConnectCore_${(null==(t=e.opts)?void 0:t.customStoragePrefix)||""}`;globalThis[r]=e}catch(e){console.warn("Failed to set global WalletConnect core",e)}}isGlobalCoreDisabled(){try{return"u">typeof cR&&"true"===cR.env.DISABLE_GLOBAL_CORE}catch{return!0}}}let fp="client",fy=`wc@2:${fp}:`,fm={name:fp,logger:"error"},fg="WALLETCONNECT_DEEPLINK_CHOICE",fb="Proposal expired",fw=to.SEVEN_DAYS,fv={wc_sessionPropose:{req:{ttl:to.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:to.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:to.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:to.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:to.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:to.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:to.ONE_DAY,prompt:!1,tag:1104},res:{ttl:to.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:to.ONE_DAY,prompt:!1,tag:1106},res:{ttl:to.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:to.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:to.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:to.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:to.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:to.ONE_DAY,prompt:!1,tag:1112},res:{ttl:to.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:to.ONE_DAY,prompt:!1,tag:1114},res:{ttl:to.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:to.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:to.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:to.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:to.FIVE_MINUTES,prompt:!1,tag:1119}}},fx={min:to.FIVE_MINUTES,max:to.SEVEN_DAYS},f_={idle:"IDLE",active:"ACTIVE"},fE={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},fA=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],fI="[email protected]:auth:",fC=`${fI}:PUB_KEY`;var fS=Object.defineProperty,fP=Object.defineProperties,f$=Object.getOwnPropertyDescriptors,fk=Object.getOwnPropertySymbols,fT=Object.prototype.hasOwnProperty,fO=Object.prototype.propertyIsEnumerable,fN=(e,t,r)=>t in e?fS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fR=(e,t)=>{for(var r in t||(t={}))fT.call(t,r)&&fN(e,r,t[r]);if(fk)for(var r of fk(t))fO.call(t,r)&&fN(e,r,t[r]);return e},fB=(e,t)=>fP(e,f$(t)),fD=(e,t,r)=>fN(e,"symbol"!=typeof t?t+"":t,r);class fM extends c${constructor(e){super(e),fD(this,"name","engine"),fD(this,"events",new ti),fD(this,"initialized",!1),fD(this,"requestQueue",{state:f_.idle,queue:[]}),fD(this,"sessionRequestQueue",{state:f_.idle,queue:[]}),fD(this,"emittedSessionRequests",new id({limit:500})),fD(this,"requestQueueDelay",to.ONE_SECOND),fD(this,"expectedPairingMethodMap",new Map),fD(this,"recentlyDeletedMap",new Map),fD(this,"recentlyDeletedLimit",200),fD(this,"relayMessageCache",[]),fD(this,"pendingSessions",new Map),fD(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(fv)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,to.toMiliseconds)(this.requestQueueDelay)))}),fD(this,"connect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let t=fB(fR({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t),t.optionalNamespaces=function(e,t){var r,n,i,s,a,o;let l=lk(e),c=lk(t),u={};for(let e of Object.keys(l).concat(Object.keys(c)))u[e]={chains:ii(null==(r=l[e])?void 0:r.chains,null==(n=c[e])?void 0:n.chains),methods:ii(null==(i=l[e])?void 0:i.methods,null==(s=c[e])?void 0:s.methods),events:ii(null==(a=l[e])?void 0:a.events,null==(o=c[e])?void 0:o.events)};return u}(t.requiredNamespaces,t.optionalNamespaces),t.requiredNamespaces={};let{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:i,sessionProperties:s,scopedProperties:a,relays:o}=t,l=r,c,u=!1;try{if(l){let e=this.client.core.pairing.pairings.get(l);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),u=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${l}) failed`),e}if(!l||!u){let{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});l=e,c=t}if(!l){let{message:e}=lR("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw Error(e)}let d=await this.client.core.crypto.generateKeyPair(),f=fv.wc_sessionPropose.req.ttl||to.FIVE_MINUTES,h=ie(f),p=fB(fR(fR({requiredNamespaces:n,optionalNamespaces:i,relays:o??[{protocol:"irn"}],proposer:{publicKey:d,metadata:this.client.metadata},expiryTimestamp:h,pairingTopic:l},s&&{sessionProperties:s}),a&&{scopedProperties:a}),{id:(0,cT.payloadId)()}),y=ir("session_connect",p.id),{reject:m,resolve:g,done:b}=n8(f,fb),w=({id:e})=>{e===p.id&&(this.client.events.off("proposal_expire",w),this.pendingSessions.delete(p.id),this.events.emit(y,{error:{message:fb,code:0}}))};return this.client.events.on("proposal_expire",w),this.events.once(y,({error:e,session:t})=>{this.client.events.off("proposal_expire",w),e?m(e):t&&g(t)}),await this.sendProposeSession({proposal:p,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:p.id}}}),await this.setProposal(p.id,p),{uri:c,approval:b}}),fD(this,"pair",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}}),fD(this,"approve",async e=>{var t,r,n;let i=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[c3.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw i.setError(c8.no_internet_connection),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),i.setError(c8.proposal_not_found),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),i.setError(c8.session_approve_namespace_validation_failure),e}let{id:s,relayProtocol:a,namespaces:o,sessionProperties:l,scopedProperties:c,sessionConfig:u}=e,d=this.client.proposal.get(s);this.client.core.eventClient.deleteEvent({eventId:i.eventId});let{pairingTopic:f,proposer:h,requiredNamespaces:p,optionalNamespaces:y}=d,m=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:f});m||(m=null==(n=this.client.core.eventClient)?void 0:n.createEvent({type:c3.session_approve_started,properties:{topic:f,trace:[c3.session_approve_started,c3.session_namespaces_validation_success]}}));let g=await this.client.core.crypto.generateKeyPair(),b=h.publicKey,w=await this.client.core.crypto.generateSharedKey(g,b),v=fR(fR(fR({relay:{protocol:a??"irn"},namespaces:o,controller:{publicKey:g,metadata:this.client.metadata},expiry:ie(fw)},l&&{sessionProperties:l}),c&&{scopedProperties:c}),u&&{sessionConfig:u}),x=cK.relay;m.addTrace(c3.subscribing_session_topic);try{await this.client.core.relayer.subscribe(w,{transportType:x,internal:{skipSubscribe:!0}})}catch(e){throw m.setError(c8.subscribe_session_topic_failure),e}m.addTrace(c3.subscribe_session_topic_success);let _=fB(fR({},v),{topic:w,requiredNamespaces:p,optionalNamespaces:y,pairingTopic:f,acknowledged:!1,self:v.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:g,transportType:cK.relay});await this.client.session.set(w,_),m.addTrace(c3.store_session);try{await this.sendApproveSession({sessionTopic:w,proposal:d,pairingProposalResponse:{relay:{protocol:a??"irn"},responderPublicKey:g},sessionSettleRequest:v,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:s}}}),m.addTrace(c3.session_approve_publish_success)}catch(e){throw this.client.logger.error(e),this.client.session.delete(w,lB("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(w),e}return this.client.core.eventClient.deleteEvent({eventId:m.eventId}),await this.client.core.pairing.updateMetadata({topic:f,metadata:h.metadata}),await this.deleteProposal(s),await this.client.core.pairing.activate({topic:f}),await this.setExpiry(w,ie(fw)),{topic:w,acknowledged:()=>Promise.resolve(this.client.session.get(w))}}),fD(this,"reject",async e=>{let t;this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}let{id:r,reason:n}=e;try{t=this.client.proposal.get(r).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),e}
206t&&await this.sendError({id:r,topic:t,error:n,rpcOpts:fv.wc_sessionPropose.reject}),await this.deleteProposal(r)}),fD(this,"update",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}let{topic:t,namespaces:r}=e,{done:n,resolve:i,reject:s}=n8(),a=(0,cT.payloadId)(),o=(0,cT.getBigIntRpcId)().toString(),l=this.client.session.get(t).namespaces;return this.events.once(ir("session_update",a),({error:e})=>{e?s(e):i()}),await this.client.session.update(t,{namespaces:r}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:a,relayRpcId:o}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:l}),s(e)}),{acknowledged:n}}),fD(this,"extend",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}let{topic:t}=e,r=(0,cT.payloadId)(),{done:n,resolve:i,reject:s}=n8();return this.events.once(ir("session_extend",r),({error:e})=>{e?s(e):i()}),await this.setExpiry(t,ie(fw)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch(e=>{s(e)}),{acknowledged:n}}),fD(this,"request",async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}let{chainId:t,request:r,topic:n,expiry:i=fv.wc_sessionRequest.req.ttl}=e,s=this.client.session.get(n);s?.transportType===cK.relay&&await this.confirmOnlineStateOrThrow();let a=(0,cT.payloadId)(),o=(0,cT.getBigIntRpcId)().toString(),{done:l,resolve:c,reject:u}=n8(i,"Request expired. Please try again.");this.events.once(ir("session_request",a),({error:e,result:t})=>{e?u(e):c(t)});let d="wc_sessionRequest",f=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);if(f)return await this.sendRequest({clientRpcId:a,relayRpcId:o,topic:n,method:d,params:{request:fB(fR({},r),{expiryTimestamp:ie(i)}),chainId:t},expiry:i,throwOnFailedPublish:!0,appLink:f}).catch(e=>u(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:a}),await l();let h={request:fB(fR({},r),{expiryTimestamp:ie(i)}),chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:a,relayRpcId:o,topic:n,method:d,params:h,expiry:i,throwOnFailedPublish:!0,tvf:this.getTVFParams(a,h)}).catch(e=>u(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:a}),e()}),new Promise(async e=>{var t;if(!(null!=(t=s.sessionConfig)&&t.disableDeepLink)){let e=await ia(this.client.core.storage,fg);await is({id:a,topic:n,wcDeepLink:e})}e()}),l()]).then(e=>e[2])}),fD(this,"respond",async e=>{var t,r;this.isInitialized();let n=this.client.core.eventClient.createEvent({properties:{topic:e?.topic||(null==(r=null==(t=e?.response)?void 0:t.id)?void 0:r.toString()),trace:[c3.session_request_response_started]}});try{await this.isValidRespond(e)}catch(e){throw n.addTrace(e?.message),n.setError(c8.session_request_response_validation_failure),e}n.addTrace(c3.session_request_response_validation_success);let{topic:i,response:s}=e,{id:a}=s,o=this.client.session.get(i);o.transportType===cK.relay&&await this.confirmOnlineStateOrThrow();let l=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);try{n.addTrace(c3.session_request_response_publish_started),(0,cT.isJsonRpcResult)(s)?await this.sendResult({id:a,topic:i,result:s.result,throwOnFailedPublish:!0,appLink:l}):(0,cT.isJsonRpcError)(s)&&await this.sendError({id:a,topic:i,error:s.error,appLink:l}),this.cleanupAfterResponse(e)}catch(e){throw n.addTrace(e?.message),n.setError(c8.session_request_response_publish_failure),e}}),fD(this,"ping",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=(0,cT.payloadId)(),r=(0,cT.getBigIntRpcId)().toString(),{done:n,resolve:i,reject:s}=n8();this.events.once(ir("session_ping",e),({error:e})=>{e?s(e):i()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:r}),n()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:t}))}),fD(this,"emit",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);let{topic:t,event:r,chainId:n}=e,i=(0,cT.getBigIntRpcId)().toString(),s=(0,cT.payloadId)();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:n},throwOnFailedPublish:!0,relayRpcId:i,clientRpcId:s})}),fD(this,"disconnect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:lB("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=lR("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw Error(e)}}),fD(this,"find",e=>(this.isInitialized(),this.client.session.getAll().filter(t=>(function(e,t){let{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),i=Object.keys(r),s=!0;return!!n5(i,n)&&(n.forEach(t=>{let{accounts:n,methods:i,events:a}=e.namespaces[t],o=lS(n),l=r[t];n5(nj(t,l),o)&&n5(l.methods,i)&&n5(l.events,a)||(s=!1)}),s)})(t,e)))),fD(this,"getPendingSessionRequests",()=>
206this.client.pendingRequest.getAll()),fD(this,"authenticate",async(e,t)=>{var r,n,i;let s;this.isInitialized(),this.isValidAuthenticate(e);let a=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(r=this.client.metadata.redirect)?void 0:r.linkMode),o=a?cK.link_mode:cK.relay;o===cK.relay&&await this.confirmOnlineStateOrThrow();let{chains:l,statement:c="",uri:u,domain:d,nonce:f,type:h,exp:p,nbf:y,methods:m=[],expiry:g}=e,b=[...e.resources||[]],{topic:w,uri:v}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:w,uri:v}});let x=await this.client.core.crypto.generateKeyPair(),_=o3(x);if(await Promise.all([this.client.auth.authKeys.set(fC,{responseTopic:_,publicKey:x}),this.client.auth.pairingTopics.set(_,{topic:_,pairingTopic:w})]),await this.client.core.relayer.subscribe(_,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${w}`),m.length>0){let{namespace:e}=nM(l[0]),t=s2(function(e,t,r,n={}){return r?.sort((e,t)=>e.localeCompare(t)),{att:{[e]:function(e,t,r={}){return Object.assign({},...(t=t?.sort((e,t)=>e.localeCompare(t))).map(t=>({[`${e}/${t}`]:[r]})))}(t,r,n)}}}(e,"request",m));s8(b)&&(n=t,i=b.pop(),t=s2(function(e,t){s1(e),s1(t);let r=Object.keys(e.att).concat(Object.keys(t.att)).sort((e,t)=>e.localeCompare(t)),n={att:{}};return r.forEach(r=>{var i,s;Object.keys((null==(i=e.att)?void 0:i[r])||{}).concat(Object.keys((null==(s=t.att)?void 0:s[r])||{})).sort((e,t)=>e.localeCompare(t)).forEach(i=>{var s,a;n.att[r]=sW(((e,t)=>{for(var r in t||(t={}))sV.call(t,r)&&sJ(e,r,t[r]);if(sK)for(var r of sK(t))sG.call(t,r)&&sJ(e,r,t[r]);return e})({},n.att[r]),sH({[i]:(null==(s=e.att[r])?void 0:s[i])||(null==(a=t.att[r])?void 0:a[i])}))})}),n}(s5(n),s5(i)))),b.push(t)}let E=g&&g>fv.wc_sessionAuthenticate.req.ttl?g:fv.wc_sessionAuthenticate.req.ttl,A={authPayload:{type:h??"caip122",chains:l,statement:c,aud:u,domain:d,version:"1",nonce:f,iat:new Date().toISOString(),exp:p,nbf:y,resources:b},requester:{publicKey:x,metadata:this.client.metadata},expiryTimestamp:ie(E)},I={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:l,methods:[...new Set(["personal_sign",...m])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:w,proposer:{publicKey:x,metadata:this.client.metadata},expiryTimestamp:ie(fv.wc_sessionPropose.req.ttl),id:(0,cT.payloadId)()},{done:C,resolve:S,reject:P}=n8(E,"Request expired"),$=(0,cT.payloadId)(),k=ir("session_connect",I.id),T=ir("session_request",$),O=async({error:e,session:t})=>{this.events.off(T,N),e?P(e):t&&S({session:t})},N=async e=>{var r,n,i;let s;if(await this.deletePendingAuthRequest($,{message:"fulfilled",code:0}),e.error){let t=lB("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off(k,O),P(e.error.message))}await this.deleteProposal(I.id),this.events.off(k,O);let{cacaos:a,responder:l}=e.result,c=[],u=[];for(let e of a){await sX({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),P(lB("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:t}=e,r=s8(t.resources),n=[sZ(t.iss)],i=sQ(t.iss);if(r){let e=s6(r),t=s3(r);c.push(...e),n.push(...t)}for(let e of n)u.push(`${e}:${i}`)}let d=await this.client.core.crypto.generateSharedKey(x,l.publicKey);c.length>0&&(s={topic:d,acknowledged:!0,self:{publicKey:x,metadata:this.client.metadata},peer:l,controller:l.publicKey,expiry:ie(fw),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:w,namespaces:lT([...new Set(c)],[...new Set(u)]),transportType:o},await this.client.core.relayer.subscribe(d,{transportType:o}),await this.client.session.set(d,s),w&&await this.client.core.pairing.updateMetadata({topic:w,metadata:l.metadata}),s=this.client.session.get(d)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(n=l.metadata.redirect)&&n.linkMode&&null!=(i=l.metadata.redirect)&&i.universal&&t&&(this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.session.update(d,{transportType:cK.link_mode})),S({auths:a,session:s})};this.events.once(k,O),this.events.once(T,N);try{if(a){let e=(0,cT.formatJsonRpcRequest)("wc_sessionAuthenticate",A,$);this.client.core.history.set(w,e);let r=await this.client.core.crypto.encode("",e,{type:2,encoding:o2});s=lg(t,w,r)}else await Promise.all([this.sendRequest({topic:w,method:"wc_sessionAuthenticate",params:A,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:$}),this.sendRequest({topic:w,method:"wc_sessionPropose",params:I,expiry:fv.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:I.id})])}catch(e){throw this.events.off(k,O),this.events.off(T,N),e}return await this.setProposal(I.id,I),await this.setAuthRequest($,{request:fB(fR({},A),{verifyContext:{}}),pairingTopic:w,transportType:o}),{uri:s??v,response:C}}),fD(this,"approveSessionAuthenticate",async e=>{let t,{id:r,auths:n}=e,i=this.client.core.eventClient.createEvent({properties:{topic:r.toString(),trace:[c4.authenticated_session_approve_started]}});try{this.isInitialized()}catch(e){throw i.setError(c9.no_internet_connection),e}let s=this.getPendingAuthRequest(r);if(!s)throw i.setError(c9.authenticated_session_pending_request_not_found),Error(`Could not find pending auth request with id ${r}`);let a=s.transportType||cK.relay;a===cK.relay&&await this.confirmOnlineStateOrThrow();let o=s.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),c=o3(o),u={type:1,receiverPublicKey:o,senderPublicKey:l},d=[],f=[];for(let e of n){if(!await sX({cacao:e,projectId:this.client.core.projectId})){i.setError(c9.invalid_cacao);let e=lB("SESSION_SETTLEMENT_FAILED","Signature verification failed");
206throw await this.sendError({id:r,topic:c,error:e,encodeOpts:u}),Error(e.message)}i.addTrace(c4.cacaos_verified);let{p:t}=e,n=s8(t.resources),s=[sZ(t.iss)],a=sQ(t.iss);if(n){let e=s6(n),t=s3(n);d.push(...e),s.push(...t)}for(let e of s)f.push(`${e}:${a}`)}let h=await this.client.core.crypto.generateSharedKey(l,o);if(i.addTrace(c4.create_authenticated_session_topic),d?.length>0){t={topic:h,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:o,metadata:s.requester.metadata},controller:o,expiry:ie(fw),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:s.pairingTopic,namespaces:lT([...new Set(d)],[...new Set(f)]),transportType:a},i.addTrace(c4.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(h,{transportType:a})}catch(e){throw i.setError(c9.subscribe_authenticated_session_topic_failure),e}i.addTrace(c4.subscribe_authenticated_session_topic_success),await this.client.session.set(h,t),i.addTrace(c4.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:s.pairingTopic,metadata:s.requester.metadata})}i.addTrace(c4.publishing_authenticated_session_approve);try{await this.sendResult({topic:c,id:r,result:{cacaos:n,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:u,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(s.requester.metadata,a)})}catch(e){throw i.setError(c9.authenticated_session_approve_publish_failure),e}return await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:s.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:i.eventId}),{session:t}}),fD(this,"rejectSessionAuthenticate",async e=>{this.isInitialized();let{id:t,reason:r}=e,n=this.getPendingAuthRequest(t);if(!n)throw Error(`Could not find pending auth request with id ${t}`);n.transportType===cK.relay&&await this.confirmOnlineStateOrThrow();let i=n.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),a=o3(i);await this.sendError({id:t,topic:a,error:r,encodeOpts:{type:1,receiverPublicKey:i,senderPublicKey:s},rpcOpts:fv.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(n.requester.metadata,n.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.deleteProposal(t)}),fD(this,"formatAuthMessage",e=>{this.isInitialized();let{request:t,iss:r}=e;return s0(t,r)}),fD(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)}),fD(this,"cleanupDuplicatePairings",async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(r=>{var n,i;return(null==(n=r.peerMetadata)?void 0:n.url)&&(null==(i=r.peerMetadata)?void 0:i.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic});if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}}),fD(this,"deleteSession",async e=>{var t;let{topic:r,expirerHasDeleted:n=!1,emitEvent:i=!0,id:s=0}=e,{self:a}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,lB("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(a.publicKey)&&await this.client.core.crypto.deleteKeyPair(a.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(fg).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEach(e=>{e.topic===r&&this.deletePendingSessionRequest(e.id,lB("USER_DISCONNECTED"))}),r===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=f_.idle),i&&this.client.events.emit("session_delete",{id:s,topic:r})}),fD(this,"deleteProposal",async(e,t)=>{if(t)try{let t=this.client.proposal.get(e),r=this.client.core.eventClient.getEvent({topic:t.pairingTopic});r?.setError(c8.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(e,lB("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")}),fD(this,"deletePendingSessionRequest",async(e,t,r=!1)=>
206{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),r&&(this.sessionRequestQueue.state=f_.idle,this.client.events.emit("session_request_expire",{id:e}))}),fD(this,"deletePendingAuthRequest",async(e,t,r=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])}),fD(this,"setExpiry",async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))}),fD(this,"setProposal",async(e,t)=>{this.client.core.expirer.set(e,ie(fv.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)}),fD(this,"setAuthRequest",async(e,t)=>{let{request:r,pairingTopic:n,transportType:i=cK.relay}=t;this.client.core.expirer.set(e,r.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:e,pairingTopic:n,verifyContext:r.verifyContext,transportType:i})}),fD(this,"setPendingSessionRequest",async e=>{let{id:t,topic:r,params:n,verifyContext:i}=e,s=n.request.expiryTimestamp||ie(fv.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,s),await this.client.pendingRequest.set(t,{id:t,topic:r,params:n,verifyContext:i})}),fD(this,"sendRequest",async e=>{let t,r,{topic:n,method:i,params:s,expiry:a,relayRpcId:o,clientRpcId:l,throwOnFailedPublish:c,appLink:u,tvf:d,publishOpts:f={}}=e,h=(0,cT.formatJsonRpcRequest)(i,s,l),p=!!u;try{let e=p?o2:o1;t=await this.client.core.crypto.encode(n,h,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),e}if(fA.includes(i)){let e=o8(JSON.stringify(h)),n=o8(t);r=await this.client.core.verify.register({id:n,decryptedId:e})}let y=fR(fR({},fv[i].req),f);if(y.attestation=r,a&&(y.ttl=a),o&&(y.id=o),this.client.core.history.set(n,h),p){let e=lg(u,n,t);await global.Linking.openURL(e,this.client.name)}else y.tvf=fB(fR({},d),{correlationId:h.id}),c?(y.internal=fB(fR({},y.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,t,y)):this.client.core.relayer.publish(n,t,y).catch(e=>this.client.logger.error(e));return h.id}),fD(this,"sendProposeSession",async e=>{let{proposal:t,publishOpts:r}=e,n=(0,cT.formatJsonRpcRequest)("wc_sessionPropose",t,t.id);this.client.core.history.set(t.pairingTopic,n);let i=await this.client.core.crypto.encode(t.pairingTopic,n,{encoding:o1}),s=o8(JSON.stringify(n)),a=o8(i),o=await this.client.core.verify.register({id:a,decryptedId:s});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:i},opts:fB(fR({},r),{publishMethod:"wc_proposeSession",attestation:o})})}),fD(this,"sendApproveSession",async e=>{let{sessionTopic:t,pairingProposalResponse:r,proposal:n,sessionSettleRequest:i,publishOpts:s}=e,a=(0,cT.formatJsonRpcResult)(n.id,r),o=await this.client.core.crypto.encode(n.pairingTopic,a,{encoding:o1}),l=(0,cT.formatJsonRpcRequest)("wc_sessionSettle",i,s?.id),c=await this.client.core.crypto.encode(t,l,{encoding:o1});this.client.core.history.set(t,l),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:n.pairingTopic,sessionProposalResponse:o,sessionSettlementRequest:c},opts:fB(fR({},s),{publishMethod:"wc_approveSession"})})}),fD(this,"sendResult",async e=>{let t,r,n,{id:i,topic:s,result:a,throwOnFailedPublish:o,encodeOpts:l,appLink:c}=e,u=(0,cT.formatJsonRpcResult)(i,a),d=c&&"u">typeof(null==global?void 0:global.Linking);try{let e=d?o2:o1;t=await this.client.core.crypto.encode(s,u,fB(fR({},l||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${s} failed`),e}try{let e=(r=await this.client.core.history.get(s,i)).request;try{n=this.getTVFParams(i,e.params,a)}catch(e){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${e?.message}`)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${s}, ${i}) failed`),e}if(d){let e=lg(c,s,t);await global.Linking.openURL(e,this.client.name)}else{let e=fv[r.request.method].res;e.tvf=fB(fR({}
206,n),{correlationId:i}),o?(e.internal=fB(fR({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(s,t,e)):this.client.core.relayer.publish(s,t,e).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(u)}),fD(this,"sendError",async e=>{let t,r,{id:n,topic:i,error:s,encodeOpts:a,rpcOpts:o,appLink:l}=e,c=(0,cT.formatJsonRpcError)(n,s),u=l&&"u">typeof(null==global?void 0:global.Linking);try{let e=u?o2:o1;t=await this.client.core.crypto.encode(i,c,fB(fR({},a||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),e}try{r=await this.client.core.history.get(i,n)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),e}if(u){let e=lg(l,i,t);await global.Linking.openURL(e,this.client.name)}else{let e=r.request.method,n=o||fv[e].res;this.client.core.relayer.publish(i,t,n)}await this.client.core.history.resolve(c)}),fD(this,"cleanup",async()=>{let e=[],t=[];this.client.session.getAll().forEach(t=>{let r=!1;it(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{it(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])}),fD(this,"onProviderMessageEvent",async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)}),fD(this,"onRelayEventRequest",async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()}),fD(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===f_.active)return void this.client.logger.info("Request queue already active, skipping...");for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=f_.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=f_.idle}),fD(this,"processRequest",async e=>{let{topic:t,payload:r,attestation:n,transportType:i,encryptedId:s}=e,a=r.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:a}))switch(a){case"wc_sessionPropose":return await this.onSessionProposeRequest
206({topic:t,payload:r,attestation:n,encryptedId:s});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,r);case"wc_sessionPing":return await this.onSessionPingRequest(t,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:r,attestation:n,encryptedId:s,transportType:i});case"wc_sessionEvent":return await this.onSessionEventRequest(t,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:r,attestation:n,encryptedId:s,transportType:i});default:return this.client.logger.info(`Unsupported request method ${a}`)}}),fD(this,"onRelayEventResponse",async e=>{let{topic:t,payload:r,transportType:n}=e,i=(await this.client.core.history.get(t,r.id)).request.method;switch(i){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r,n);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${i}`)}}),fD(this,"onRelayEventUnknownPayload",e=>{let{topic:t}=e,{message:r}=lR("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(r)}),fD(this,"shouldIgnorePairingRequest",e=>{let{topic:t,requestMethod:r}=e,n=this.expectedPairingMethodMap.get(t);return!(!n||n.includes(r))&&!!(n.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),fD(this,"onSessionProposeRequest",async e=>{let{topic:t,payload:r,attestation:n,encryptedId:i}=e,{params:s,id:a}=r;try{let e=this.client.core.eventClient.getEvent({topic:t});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError(c6.proposal_listener_not_found)),this.isValidConnect(fR({},r.params));let o=s.expiryTimestamp||ie(fv.wc_sessionPropose.req.ttl),l=fR({id:a,pairingTopic:t,expiryTimestamp:o,attestation:n,encryptedId:i},s);await this.setProposal(a,l);let c=await this.getVerifyContext({attestationId:n,hash:o8(JSON.stringify(r)),encryptedId:i,metadata:l.proposer.metadata});e?.addTrace(c5.emit_session_proposal),this.client.events.emit("session_proposal",{id:a,params:l,verifyContext:c})}catch(e){await this.sendError({id:a,topic:t,error:e,rpcOpts:fv.wc_sessionPropose.autoReject}),this.client.logger.error(e)}}),fD(this,"onSessionProposeResponse",async(e,t,r)=>{let{id:n}=t;if((0,cT.isJsonRpcResult)(t)){let{result:i}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:i});let s=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});let a=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:a});let o=i.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:o});let l=await this.client.core.crypto.generateSharedKey(a,o);this.pendingSessions.set(n,{sessionTopic:l,pairingTopic:e,proposalId:n,publicKey:a});let c=await this.client.core.relayer.subscribe(l,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:c}),await this.client.core.pairing.activate({topic:e})}else if((0,cT.isJsonRpcError)(t)){await this.deleteProposal(n);let e=ir("session_connect",n);if(0===this.events.listenerCount(e))throw Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}}),fD(this,"onSessionSettleRequest",async(e,t)=>{let{id:r,params:n}=t;try{this.isValidSessionSettleRequest(n);let{relay:r,controller:i,expiry:s,namespaces:a,sessionProperties:o,scopedProperties:l,sessionConfig:c}=t.params,u=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!u)return this.client.logger.error(`Pending session not found for topic ${e}`);let d=this.client.proposal.get(u.proposalId),f=fB(fR(fR(fR({topic:e,relay:r,expiry:s,namespaces:a,acknowledged:!0,pairingTopic:u.pairingTopic,requiredNamespaces:d.requiredNamespaces,optionalNamespaces:d.optionalNamespaces,controller:i.publicKey,self:{publicKey:u.publicKey,metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata}},o&&{sessionProperties:o}),l&&{scopedProperties:l}),c&&{sessionConfig:c}
206),{transportType:cK.relay});await this.client.session.set(f.topic,f),await this.setExpiry(f.topic,f.expiry),await this.client.core.pairing.updateMetadata({topic:u.pairingTopic,metadata:f.peer.metadata}),this.client.events.emit("session_connect",{session:f}),this.events.emit(ir("session_connect",u.proposalId),{session:f}),this.pendingSessions.delete(u.proposalId),this.deleteProposal(u.proposalId,!1),this.cleanupDuplicatePairings(f),await this.sendResult({id:t.id,topic:e,result:!0})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),fD(this,"onSessionSettleResponse",async(e,t)=>{let{id:r}=t;(0,cT.isJsonRpcResult)(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(ir("session_approve",r),{})):(0,cT.isJsonRpcError)(t)&&(await this.client.session.delete(e,lB("USER_DISCONNECTED")),this.events.emit(ir("session_approve",r),{error:t.error}))}),fD(this,"onSessionUpdateRequest",async(e,t)=>{let{params:r,id:n}=t;try{let t=`${e}_session_update`,i=lX.get(t);if(i&&this.isRequestOutOfSync(i,n)){this.client.logger.warn(`Discarding out of sync request - ${n}`),this.sendError({id:n,topic:e,error:lB("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(fR({topic:e},r));try{lX.set(t,n),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:n,topic:e,result:!0})}catch(e){throw lX.delete(t),e}this.client.events.emit("session_update",{id:n,topic:e,params:r})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}}),fD(this,"isRequestOutOfSync",(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3)),fD(this,"onSessionUpdateResponse",(e,t)=>{let{id:r}=t,n=ir("session_update",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);(0,cT.isJsonRpcResult)(t)?this.events.emit(ir("session_update",r),{}):(0,cT.isJsonRpcError)(t)&&this.events.emit(ir("session_update",r),{error:t.error})}),fD(this,"onSessionExtendRequest",async(e,t)=>{let{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,ie(fw)),await this.sendResult({id:r,topic:e,result:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),fD(this,"onSessionExtendResponse",(e,t)=>{let{id:r}=t,n=ir("session_extend",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);(0,cT.isJsonRpcResult)(t)?this.events.emit(ir("session_extend",r),{}):(0,cT.isJsonRpcError)(t)&&this.events.emit(ir("session_extend",r),{error:t.error})}),fD(this,"onSessionPingRequest",async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),fD(this,"onSessionPingResponse",(e,t)=>{let{id:r}=t,n=ir("session_ping",r);setTimeout(()=>{if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners 2176`);(0,cT.isJsonRpcResult)(t)?this.events.emit(ir("session_ping",r),{}):(0,cT.isJsonRpcError)(t)&&this.events.emit(ir("session_ping",r),{error:t.error})},500)}),fD(this,"onSessionDeleteRequest",async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise(t=>{this.client.core.relayer.once(cq.publish,async()=>{t(await this.deleteSession({topic:e,id:r}))})}),this.sendResult({id:r,topic:e,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:lB("USER_DISCONNECTED")})]).catch(e=>this.client.logger.error(e))}catch(e){this.client.logger.error(e)}}),fD(this,"onSessionRequest",async e=>{var t,r,n;let{topic:i,payload:s,attestation:a,encryptedId:o,transportType:l}=e,{id:c,params:u}=s;try{await this.isValidRequest(fR({topic:i},u));let e=this.client.session.get(i),s=await this.getVerifyContext({attestationId:a,hash:o8(JSON.stringify((0,cT.formatJsonRpcRequest)("wc_sessionRequest",u,c))),encryptedId:o,metadata:e.peer.metadata,transportType:l}),d={id:c,topic:i,params:u,verifyContext:s};await this.setPendingSessionRequest(d),l===cK.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(r=e.peer.metadata.redirect)?void 0:r.universal),null!=(n=this.client.signConfig)&&n.disableRequestQueue?this.emitSessionRequest(d):(this.addSessionRequestToSessionRequestQueue(d),this.processSessionRequestQueue())}
206catch(e){await this.sendError({id:c,topic:i,error:e}),this.client.logger.error(e)}}),fD(this,"onSessionRequestResponse",(e,t)=>{let{id:r}=t,n=ir("session_request",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);(0,cT.isJsonRpcResult)(t)?this.events.emit(ir("session_request",r),{result:t.result}):(0,cT.isJsonRpcError)(t)&&this.events.emit(ir("session_request",r),{error:t.error})}),fD(this,"onSessionEventRequest",async(e,t)=>{let{id:r,params:n}=t;try{let t=`${e}_session_event_${n.event.name}`,i=lX.get(t);if(i&&this.isRequestOutOfSync(i,r))return void this.client.logger.info(`Discarding out of sync request - ${r}`);this.isValidEmit(fR({topic:e},n)),this.client.events.emit("session_event",{id:r,topic:e,params:n}),lX.set(t,r)}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),fD(this,"onSessionAuthenticateResponse",(e,t)=>{let{id:r}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),(0,cT.isJsonRpcResult)(t)?this.events.emit(ir("session_request",r),{result:t.result}):(0,cT.isJsonRpcError)(t)&&this.events.emit(ir("session_request",r),{error:t.error})}),fD(this,"onSessionAuthenticateRequest",async e=>{var t;let{topic:r,payload:n,attestation:i,encryptedId:s,transportType:a}=e;try{let{requester:e,authPayload:o,expiryTimestamp:l}=n.params,c=await this.getVerifyContext({attestationId:i,hash:o8(JSON.stringify(n)),encryptedId:s,metadata:e.metadata,transportType:a}),u={requester:e,pairingTopic:r,id:n.id,authPayload:o,verifyContext:c,expiryTimestamp:l};await this.setAuthRequest(n.id,{request:u,pairingTopic:r,transportType:a}),a===cK.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:n.params,id:n.id,verifyContext:c})}catch(s){this.client.logger.error(s);let e=n.params.requester.publicKey,t=await this.client.core.crypto.generateKeyPair(),i=this.getAppLinkIfEnabled(n.params.requester.metadata,a);await this.sendError({id:n.id,topic:r,error:s,encodeOpts:{type:1,receiverPublicKey:e,senderPublicKey:t},rpcOpts:fv.wc_sessionAuthenticate.autoReject,appLink:i})}}),fD(this,"addSessionRequestToSessionRequestQueue",e=>{this.sessionRequestQueue.queue.push(e)}),fD(this,"cleanupAfterResponse",e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=f_.idle,this.processSessionRequestQueue()},(0,to.toMiliseconds)(this.requestQueueDelay))}),fD(this,"cleanupPendingSentRequestsForTopic",({topic:e,error:t})=>{let r=this.client.core.history.pending;r.length>0&&r.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{let r=ir("session_request",e.request.id);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);this.events.emit(ir("session_request",e.request.id),{error:t})})}),fD(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===f_.active)return void this.client.logger.info("session request queue is already active.");let e=this.sessionRequestQueue.queue[0];if(!e)return void this.client.logger.info("session request queue is empty.");try{this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}}),fD(this,"emitSessionRequest",e=>{if(this.emittedSessionRequests.has(e.id))return void this.client.logger.warn({id:e.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${e.id}`);this.sessionRequestQueue.state=f_.active,this.emittedSessionRequests.add(e.id),this.client.events.emit("session_request",e)}),fD(this,"onPairingCreated",e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);
206t&&this.onSessionProposeRequest({topic:e.topic,payload:(0,cT.formatJsonRpcRequest)("wc_sessionPropose",fB(fR({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties}),t.id),attestation:t.attestation,encryptedId:t.encryptedId})}),fD(this,"isValidConnect",async e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:n,sessionProperties:i,scopedProperties:s,relays:a}=e;if(lU(t)||await this.isValidPairingTopic(t),!function(e,t){let r=!1;return t&&!e?r=!0:e&&lD(e)&&e.length&&e.forEach(e=>{r=lH(e)}),r}(a,!0)){let{message:e}=lR("MISSING_OR_INVALID",`connect() relays: ${a}`);throw Error(e)}if(r&&!lU(r)&&0!==lM(r)){let e="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(e):this.client.logger.warn(e),this.validateNamespaces(r,"requiredNamespaces")}if(n&&!lU(n)&&0!==lM(n)&&this.validateNamespaces(n,"optionalNamespaces"),i&&!lU(i)&&this.validateSessionProps(i,"sessionProperties"),s&&!lU(s)){this.validateSessionProps(s,"scopedProperties");let e=Object.keys(r||{}).concat(Object.keys(n||{}));if(!Object.keys(s).every(t=>e.includes(t.split(":")[0])))throw Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(s)}, required/optional namespaces: ${JSON.stringify(e)}`)}}),fD(this,"validateNamespaces",(e,t)=>{let r=function(e,t,r){let n=null;if(e&&lM(e)){let i,s=lq(e,t);s&&(n=s);let a=(i=null,Object.entries(e).forEach(([e,n])=>{var s,a;let o;if(i)return;let l=(s=nj(e,n),a=`${t} ${r}`,o=null,lD(s)&&s.length?s.forEach(e=>{o||lF(e)||(o=lB("UNSUPPORTED_CHAINS",`${a}, chain ${e} should be a string and conform to "namespace:chainId" format`))}):lF(e)||(o=lB("UNSUPPORTED_CHAINS",`${a}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),o);l&&(i=l)}),i);a&&(n=a)}else n=lR("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}(e,"connect()",t);if(r)throw Error(r.message)}),fD(this,"isValidApprove",async e=>{if(!lK(e))throw Error(lR("MISSING_OR_INVALID",`approve() params: ${e}`).message);let{id:t,namespaces:r,relayProtocol:n,sessionProperties:i,scopedProperties:s}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let a=this.client.proposal.get(t),o=lW(r,"approve()");if(o)throw Error(o.message);let l=lG(a.requiredNamespaces,r,"approve()");if(l)throw Error(l.message);if(!lj(n,!0)){let{message:e}=lR("MISSING_OR_INVALID",`approve() relayProtocol: ${n}`);throw Error(e)}if(i&&!lU(i)&&this.validateSessionProps(i,"sessionProperties"),s&&!lU(s)){this.validateSessionProps(s,"scopedProperties");let e=new Set(Object.keys(r));if(!Object.keys(s).every(t=>e.has(t.split(":")[0])))throw Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(s)}, approved namespaces: ${Array.from(e).join(", ")}`)}}),fD(this,"isValidReject",async e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`reject() params: ${e}`);throw Error(t)}let{id:t,reason:r}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!function(e){return!(!e||"object"!=typeof e||!e.code||!lL(e.code,!1)||!e.message||!lj(e.message,!1))}(r)){let{message:e}=lR("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw Error(e)}}),fD(this,"isValidSessionSettleRequest",e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw Error(t)}
206let{relay:t,controller:r,namespaces:n,expiry:i}=e;if(!lH(t)){let{message:e}=lR("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw Error(e)}let s=function(e,t){let r=null;return lj(e?.publicKey,!1)||(r=lR("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}(r,"onSessionSettleRequest()");if(s)throw Error(s.message);let a=lW(n,"onSessionSettleRequest()");if(a)throw Error(a.message);if(it(i)){let{message:e}=lR("EXPIRED","onSessionSettleRequest()");throw Error(e)}}),fD(this,"isValidUpdate",async e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:r}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let n=this.client.session.get(t),i=lW(r,"update()");if(i)throw Error(i.message);let s=lG(n.requiredNamespaces,r,"update()");if(s)throw Error(s.message)}),fD(this,"isValidExtend",async e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)}),fD(this,"isValidRequest",async e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`request() params: ${e}`);throw Error(t)}let{topic:t,request:r,chainId:n,expiry:i}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let{namespaces:s}=this.client.session.get(t);if(!lV(s,n)){let{message:e}=lR("MISSING_OR_INVALID",`request() chainId: ${n}`);throw Error(e)}if(!function(e){return!(lU(e)||!lj(e.method,!1))}(r)){let{message:e}=lR("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw Error(e)}if(!function(e,t,r){return!!lj(r,!1)&&(function(e,t){let r=[];return Object.values(e).forEach(e=>{lS(e.accounts).includes(t)&&r.push(...e.methods)}),r})(e,t).includes(r)}(s,n,r.method)){let{message:e}=lR("MISSING_OR_INVALID",`request() method: ${r.method}`);throw Error(e)}if(i&&!function(e,t){return lL(e,!1)&&e<=t.max&&e>=t.min}(i,fx)){let{message:e}=lR("MISSING_OR_INVALID",`request() expiry: ${i}. Expiry must be a number (in seconds) between ${fx.min} and ${fx.max}`);throw Error(e)}}),fD(this,"isValidRespond",async e=>{var t;if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`respond() params: ${e}`);throw Error(t)}let{topic:r,response:n}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(!function(e){return!(lU(e)||lU(e.result)&&lU(e.error)||!lL(e.id,!1)||!lj(e.jsonrpc,!1))}(n)){let{message:e}=lR("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw Error(e)}let i=this.client.pendingRequest.get(n.id);if(i.topic!==r){let{message:e}=lR("MISMATCHED_TOPIC",`Request response topic mismatch. reqId: ${n.id}, expected topic: ${i.topic}, received topic: ${r}`);throw Error(e)}}),fD(this,"isValidPing",async e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),fD(this,"isValidEmit",async e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`emit() params: ${e}`);throw Error(t)}let{topic:t,event:r,chainId:n}=e;await this.isValidSessionTopic(t);let{namespaces:i}=this.client.session.get(t);if(!lV(i,n)){let{message:e}=lR("MISSING_OR_INVALID",`emit() chainId: ${n}`);throw Error(e)}if(!function(e){return!(lU(e)||!lj(e.name,!1))}(r)||!function(e,t,r){return!!lj(r,!1)&&(function(e,t){let r=[];return Object.values(e).forEach(e=>{lS(e.accounts).includes(t)&&r.push(...e.events)}),r})(e,t).includes(r)}(i,n,r.name)){let{message:e}=lR("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw Error(e)}}),fD(this,"isValidDisconnect",async e=>{if(!lK(e)){let{message:t}=lR("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),fD(this,"isValidAuthenticate",e=>{let{chains:t,uri:r,domain:n,nonce:i}=e;if(!Array.isArray(t)||0===t.length)throw Error("chains is required and must be a non-empty array");if(!lj(r,!1))throw Error("uri is required parameter");if(!lj(n,!1))throw Error("domain is required parameter");if(!lj(i,!1))throw Error("nonce is required parameter");if([...new Set(t.map(e=>nM(e).namespace))].length>1)throw Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:s}=nM(t[0]);if("eip155"!==s)throw Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),fD(this,"getVerifyContext",async e=>{let{attestationId:t,hash:r,encryptedId:n,metadata:i,transportType:s}=e,a={verified:{verifyUrl:i.verifyUrl||c0,validation:"UNKNOWN",origin:i.url||""}};try{if(s===cK.link_mode){let e=this.getAppLinkIfEnabled(i,s);return a.verified.validation=e&&new URL(e).origin===new URL(i.url).origin?"VALID":"INVALID",a}let e=await this.client.core.verify.resolve({attestationId:t,hash:r,encryptedId:n,verifyUrl:i.verifyUrl});e&&(a.verified.origin=e.origin,a.verified.isScam=e.isScam,a.verified.validation=e.origin===new URL(i.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(a)}`),a}),fD(this,"validateSessionProps",(e,t)=>{Object.values(e).forEach((r,n)=>{if(null==r){let{message:i}=lR("MISSING_OR_INVALID",`${t} must contain an existing value for each key. Received: ${r} for key ${Object.keys(e)[n]}`);throw Error(i)}})}),fD(this,"getPendingAuthRequest",e=>{let t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0}),fD(this,"addToRecentlyDeleted",(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;
206for(let r of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(r)}}}),fD(this,"checkRecentlyDeleted",e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:r}=lR("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw Error(r)}}),fD(this,"isLinkModeEnabled",(e,t)=>{var r,n,i,s,a,o,l,c,u;return!!e&&t===cK.link_mode&&(null==(n=null==(r=this.client.metadata)?void 0:r.redirect)?void 0:n.linkMode)===!0&&(null==(s=null==(i=this.client.metadata)?void 0:i.redirect)?void 0:s.universal)!==void 0&&(null==(o=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:o.universal)!==""&&(null==(l=e?.redirect)?void 0:l.universal)!==void 0&&(null==(c=e?.redirect)?void 0:c.universal)!==""&&(null==(u=e?.redirect)?void 0:u.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&"u">typeof(null==global?void 0:global.Linking)}),fD(this,"getAppLinkIfEnabled",(e,t)=>{var r;return this.isLinkModeEnabled(e,t)?null==(r=e?.redirect)?void 0:r.universal:void 0}),fD(this,"handleLinkModeMessage",({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;let t=io(e,"topic")||"",r=decodeURIComponent(io(e,"wc_ev")||""),n=this.client.session.keys.includes(t);n&&this.client.session.update(t,{transportType:cK.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:r,sessionExists:n})}),fD(this,"registerLinkModeListeners",async()=>{var e;if(ic()||nZ()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){let e=null==global?void 0:global.Linking;if("u">typeof e){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}}),fD(this,"getTVFParams",(e,t,r)=>{var n,i,s;if(!(null!=(n=t.request)&&n.method))return{};let a={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{a.txHashes=this.extractTxHashesFromResult(t.request,r),a.contractAddresses=this.isValidContractData(t.request.params)?[null==(s=null==(i=t.request.params)?void 0:i[0])?void 0:s.to]:[]}catch(e){this.client.logger.warn(e,"Error getting TVF params")}return a}),fD(this,"isValidContractData",e=>{var t;if(!e)return!1;try{let r=e?.data||(null==(t=e?.[0])?void 0:t.data);if(!r.startsWith("0x"))return!1;let n=r.slice(2);return!!/^[0-9a-fA-F]*$/.test(n)&&n.length%2==0}catch{}return!1}),fD(this,"extractTxHashesFromResult",(e,t)=>{var r;try{if(!t)return[];let n=e.method,i=fE[n];if("sui_signTransaction"===n)return[function(e){let t=new Uint8Array(nD.from(e,"base64")),r=Array.from("TransactionData::").map(e=>e.charCodeAt(0)),n=new Uint8Array(r.length+t.length);n.set(r),n.set(t,r.length);let i=sD(n,{dkLen:32});return r7.A.encode(i)}(t.transactionBytes)];if("near_signTransaction"===n)return[sL(t)];if("near_signTransactions"===n)return t.map(e=>sL(e));if("xrpl_signTransactionFor"===n||"xrpl_signTransaction"===n)return[null==(r=t.tx_json)?void 0:r.hash];if("polkadot_signTransaction"===n)return[function(e){let t=Uint8Array.from(nD.from(e.signature,"hex")),r=function({publicKey:e,signature:t,payload:r}){var n,i;let s=l0(r.method),a=128|parseInt((null==(n=r.version)?void 0:n.toString())||"4"),o=function(e){let t=r7.A.decode(e)[0];return 42===t?0:60===t?2:1}(r.address),l="00"===r.era?new Uint8Array([0]):l0(r.era);if(1!==l.length&&2!==l.length)throw Error("Invalid era length");let c=parseInt(r.nonce,16),u=new Uint8Array([255&c,c>>8&255]),d=new Uint8Array([0,...e,o,...t,...l,...u,...function(e){if(e<BigInt(1)<<BigInt(6))return new Uint8Array([Number(e<<BigInt(2))]);if(e<BigInt(1)<<BigInt(14)){let t=e<<BigInt(2)|BigInt(1);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255))])}if(e<BigInt(1)<<BigInt(30)){let t=e<<BigInt(2)|BigInt(2);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255)),Number(t>>BigInt(16)&BigInt(255)),Number(t>>BigInt(24)&BigInt(255))])}throw Error("BigInt compact encoding not supported > 2^30")}(BigInt(`0x${(i=r.tip).startsWith("0x")?i.slice(2):i}`)),...s]);return new Uint8Array([...function(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){let t=e<<2|1;return new Uint8Array([255&t,t>>8&255])}if(e<0x40000000){let t=e<<2|2;return new Uint8Array([255&t,t>>8&255,t>>16&255,t>>24&255])}throw Error("Compact encoding > 2^30 not supported")}(d.length+1),a,...d])}({publicKey:function(e){let t=r7.A.decode(e);if(t.length<33)throw Error("Too short to contain a public key");return t.slice(1,33)}(e.transaction.address),signature:t,payload:e.transaction});var n=nD.from(r).toString("hex");let i=l0(n),s=(0,na.blake2b)(i,void 0,32);return"0x"+nD.from(s).toString("hex")}({transaction:e.params.transactionPayload,signature:t.signature})];if("algo_signTxn"===n)return lD(t)?t.map(e=>sF(e)):[sF(t)];
206if("cosmos_signDirect"===n)return[function(e){let t=nD.from(e.signed.bodyBytes,"base64"),r=nD.from(e.signed.authInfoBytes,"base64"),n=nD.from(e.signature.signature,"base64"),i=[];i.push(nD.from([10])),i.push(sz(t.length)),i.push(t),i.push(nD.from([18])),i.push(sz(r.length)),i.push(r),i.push(nD.from([26])),i.push(sz(n.length)),i.push(n);let s=sI(nD.concat(i));return nD.from(s).toString("hex").toUpperCase()}(t)];if("wallet_sendCalls"===n)return function(e){var t,r;let n=[];try{if("string"==typeof e)return n.push(e),n;if("object"!=typeof e)return n;null!=e&&e.id&&n.push(e.id);let i=null==(r=null==(t=e?.capabilities)?void 0:t.caip345)?void 0:r.transactionHashes;i&&n.push(...i)}catch(e){console.warn("getWalletSendCallsHashes failed: ",e)}return n}(t);if("string"==typeof t)return[t];let s=t[i.key];if(lD(s))return"solana_signAllTransactions"===n?s.map(e=>(function(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);let n=r[0];if(0===n)throw Error("No signatures found");if(r.length<1+64*n)throw Error("Transaction data too short for claimed signature count");if(r.length<100)throw Error("Transaction too short");let i=nD.from(e,"base64").slice(1,65);return r7.A.encode(i)})(e)):s;if("string"==typeof s)return[s]}catch(e){this.client.logger.warn(e,"Error extracting tx hashes from result")}return[]})}async processPendingMessageEvents(){try{let e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(let[e,r]of Object.entries(t))for(let t of r)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn(e,"processPendingMessageEvents failed")}}isInitialized(){if(!this.initialized){let{message:e}=lR("NOT_INITIALIZED",this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(cq.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){let{topic:t,message:r,attestation:n,transportType:i}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(fC)?this.client.auth.authKeys.get(fC):{responseTopic:void 0,publicKey:void 0};try{let e=await this.client.core.crypto.decode(t,r,{receiverPublicKey:s,encoding:i===cK.link_mode?o2:o1});
206(0,cT.isJsonRpcRequest)(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:n,transportType:i,encryptedId:o8(r)})):(0,cT.isJsonRpcResponse)(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:i}),this.client.core.history.delete(t,e.id)):await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:i}),await this.client.core.relayer.messages.ack(t,r)}catch(e){this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(cX.expired,async e=>{let{topic:t,id:r}=n7(e.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,lR("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,lR("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))})}registerPairingEvents(){this.client.core.pairing.events.on(cZ.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(cZ.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!lj(e,!1)){let{message:t}=lR("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=lR("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(it(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=lR("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!lj(e,!1)){let{message:t}=lR("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=lR("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw Error(t)}if(it(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=lR("EXPIRED",`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=lR("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(lj(e,!1)){let{message:t}=lR("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=lR("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if("number"!=typeof e){let{message:t}=lR("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=lR("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw Error(t)}if(it(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=lR("EXPIRED",`proposal id: ${e}`);throw Error(t)}}}class fU extends dK{constructor(e,t){super(e,t,"proposal",fy),this.core=e,this.logger=t}}class fj extends dK{constructor(e,t){super(e,t,"session",fy),this.core=e,this.logger=t}}class fL extends dK{constructor(e,t){super(e,t,"request",fy,e=>e.id),this.core=e,this.logger=t}}class fF extends dK{constructor(e,t){super(e,t,"authKeys",fI,()=>fC),this.core=e,this.logger=t}}class fz extends dK{constructor(e,t){super(e,t,"pairingTopics",fI),this.core=e,this.logger=t}}class fq extends dK{constructor(e,t){super(e,t,"requests",fI,e=>e.id),this.core=e,this.logger=t}}var fW=Object.defineProperty,fH=(e,t,r)=>((e,t,r)=>t in e?fW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class fK{constructor(e,t){this.core=e,this.logger=t,fH(this,"authKeys"),fH(this,"pairingTopics"),fH(this,"requests"),this.authKeys=new fF(this.core,this.logger),this.pairingTopics=new fz(this.core,this.logger),this.requests=new fq(this.core,this.logger)}
206async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var fV=Object.defineProperty,fG=(e,t,r)=>((e,t,r)=>t in e?fV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class fJ extends cP{constructor(e){super(e),fG(this,"protocol","wc"),fG(this,"version",2),fG(this,"name",fm.name),fG(this,"metadata"),fG(this,"core"),fG(this,"logger"),fG(this,"events",new ti.EventEmitter),fG(this,"engine"),fG(this,"session"),fG(this,"proposal"),fG(this,"pendingRequest"),fG(this,"auth"),fG(this,"signConfig"),fG(this,"on",(e,t)=>this.events.on(e,t)),fG(this,"once",(e,t)=>this.events.once(e,t)),fG(this,"off",(e,t)=>this.events.off(e,t)),fG(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),fG(this,"removeAllListeners",e=>this.events.removeAllListeners(e)),fG(this,"connect",async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"pair",async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"approve",async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"reject",async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"update",async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"extend",async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"request",async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"respond",async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"ping",async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"emit",async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"disconnect",async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"find",e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}}),fG(this,"authenticate",async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"formatAuthMessage",e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"approveSessionAuthenticate",async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),fG(this,"rejectSessionAuthenticate",async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),this.name=e?.name||fm.name,this.metadata=function(e){var t,r;let n=n1();try{let i,s;return null!=e&&e.url&&n.url&&new URL(e.url).host!==new URL(n.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${n.url}. This is probably unintended and can lead to issues.`),e.url=n.url),null!=(t=e?.icons)&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(e=>""!==e)),i=nV(nV({},n),e),s={url:e?.url||n.url,name:e?.name||n.name,description:e?.description||n.description,icons:null!=(r=e?.icons)&&r.length&&e.icons.length>0?e.icons:n.icons},nF(i,nz(s))}catch(t){return console.warn("Error populating app metadata",t),e||n}}(e?.metadata),this.signConfig=e?.signConfig;let t=l1({logger:e?.logger||fm.logger,name:this.name});this.logger=t,this.core=e?.core||new fh(e),this.session=new fj(this.core,this.logger),this.proposal=new fU(this.core,this.logger),this.pendingRequest=new fL(this.core,this.logger),this.engine=new fM(this),this.auth=new fK(this.core,this.logger)}static async init(e){let t=new fJ(e);return await t.initialize(),t}get context(){return nO(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var fY=r(70947),fZ=r(98539).hp;function fQ(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function fX(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}
206function f0(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let f1="[object String]",f2="[object Number]",f5="[object Boolean]",f6="[object Arguments]";function f3(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function f8(e,t,r,n=new Map,i){let s=i?.(e,t,r,n);if(null!=s)return s;if(fQ(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){let t=Array(e.length);n.set(e,t);for(let s=0;s<e.length;s++)t[s]=f8(e[s],s,r,n,i);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;for(let[s,a]of(n.set(e,t),e))t.set(s,f8(a,s,r,n,i));return t}if(e instanceof Set){let t=new Set;for(let s of(n.set(e,t),e))t.add(f8(s,void 0,r,n,i));return t}if("u">typeof fZ&&fZ.isBuffer(e))return e.subarray();if(f3(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,t);for(let s=0;s<e.length;s++)t[s]=f8(e[s],s,r,n,i);return t}if(e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,t),f4(t,e,r,n,i),t}if("u">typeof File&&e instanceof File){let t=new File([e],e.name,{type:e.type});return n.set(e,t),f4(t,e,r,n,i),t}if(e instanceof Blob){let t=new Blob([e],{type:e.type});return n.set(e,t),f4(t,e,r,n,i),t}if(e instanceof Error){let t=new e.constructor;return n.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,f4(t,e,r,n,i),t}if("object"==typeof e&&function(e){switch(f0(e)){case f6:case"[object Array]":case"[object ArrayBuffer]":case"[object DataView]":case f5:case"[object Date]":case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Map]":case f2:case"[object Object]":case"[object RegExp]":case"[object Set]":case f1:case"[object Symbol]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return!0;default:return!1}}(e)){let t=Object.create(Object.getPrototypeOf(e));return n.set(e,t),f4(t,e,r,n,i),t}return e}function f4(e,t,r=e,n,i){let s=[...Object.keys(t),...fX(t)];for(let a=0;a<s.length;a++){let o=s[a],l=Object.getOwnPropertyDescriptor(e,o);(null==l||l.writable)&&(e[o]=f8(t[o],o,r,n,i))}}function f9(e){var t;return t=(t,r,n,i)=>{let s=void 0;if(null!=s)return s;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case f2:case f1:case f5:{let t=new e.constructor(e?.valueOf());return f4(t,e),t}case f6:{let t={};return f4(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}},f8(e,void 0,e,new Map,t)}function f7(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===f0(e)}function he(e){return"object"==typeof e&&null!==e}function ht(){}let hr="error",hn="universal_provider",hi=`wc@2:${hn}:`,hs="https://rpc.walletconnect.org/v1/",ha="generic",ho=`${hs}bundler`,hl="call_status",hc={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var hu=Object.defineProperty,hd=Object.defineProperties,hf=Object.getOwnPropertyDescriptors,hh=Object.getOwnPropertySymbols,hp=Object.prototype.hasOwnProperty,hy=Object.prototype.propertyIsEnumerable,hm=(e,t,r)=>t in e?hu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hg=(e,t)=>{for(var r in t||(t={}))hp.call(t,r)&&hm(e,r,t[r]);if(hh)for(var r of hh(t))hy.call(t,r)&&hm(e,r,t[r]);return e},hb=(e,t)=>hd(e,hf(t));function hw(e,t,r){var n;let i=nM(e);return(null==(n=t.rpcMap)?void 0:n[i.reference])||`${hs}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function hv(e){return e.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function hx(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>{var r,n;return(null==(r=t?.chains)?void 0:r.length)&&(null==(n=t?.chains)?void 0:n.length)>0}))}function h_(e={},t={}){return function(e,...t){return function(e,...t){let r=t.slice(0,-1),n=t[t.length-1],i=e;for(let e=0;e<r.length;e++)i=function e(t,r,n,i){if(fQ(t)&&(t=Object(t)),null==r||"object"!=typeof r)return t;if(i.has(r))return function(e){if(fQ(e))return e;if(Array.isArray(e)||f3(e)||e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e),r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){let t=new r(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let t=new r(e.message);return t.stack=e.stack,t.name=e.name,t.cause=e.cause,t}return"u">typeof File&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):"object"==typeof e?Object.assign(Object.create(t),e):e}(i.get(r));if(i.set(r,t),Array.isArray(r)){r=r.slice();for(let e=0;e<r.length;e++)r[e]=r[e]??void 0}let s=[...Object.keys(r),...fX(r)];for(let a=0;a<s.length;a++){let o=s[a],l=r[o],c=t[o];if(f7(l)&&(l={...l}),f7(c)&&(c={...c}),"u">typeof fZ&&fZ.isBuffer(l)&&(l=f9(l)),Array.isArray(l))if("object"==typeof c&&null!=c){let e=[],t=Reflect.ownKeys(c);for(let r=0;r<t.length;r++){let n=t[r];e[n]=c[n]}c=e}else c=[];let u=n(c,l,o,t,r,i);null!=u?t[o]=u:Array.isArray(l)||he(c)&&he(l)?t[o]=e(c,l,n,i):null==c&&function(e){if("object"!=typeof e||null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;
206if("[object Object]"!==Object.prototype.toString.call(e)){let t=e[Symbol.toStringTag];return null!=t&&!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(l)?t[o]=e({},l,n,i):null==c&&f3(l)?t[o]=f9(l):(void 0===c||void 0!==l)&&(t[o]=l)}return t}(i,r[e],n,new Map);return i}(e,...t,ht)}(hx(hE(e)),hx(hE(t)))}function hE(e){var t,r,n,i,s;let a={};if(!lM(e))return a;for(let[o,l]of Object.entries(e)){let e=lP(o)?[o]:l.chains,c=l.methods||[],u=l.events||[],d=l.rpcMap||{},f=l$(o);a[f]=hb(hg(hg({},a[f]),l),{chains:ii(e,null==(t=a[f])?void 0:t.chains),methods:ii(c,null==(r=a[f])?void 0:r.methods),events:ii(u,null==(n=a[f])?void 0:n.events)}),(lM(d)||lM((null==(i=a[f])?void 0:i.rpcMap)||{}))&&(a[f].rpcMap=hg(hg({},d),null==(s=a[f])?void 0:s.rpcMap))}return a}function hA(e){return e.includes(":")?e.split(":")[2]:e}function hI(e){let t={};for(let[r,n]of Object.entries(e)){let e=n.methods||[],i=n.events||[],s=n.accounts||[],a=lP(r)?[r]:n.chains?n.chains:hv(n.accounts);t[r]={chains:a,methods:e,events:i,accounts:s}}return t}function hC(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):isNaN(Number(e=e.includes(":")?e.split(":")[1]:e))?e:Number(e)}let hS={},hP=e=>hS[e],h$=(e,t)=>{hS[e]=t};var hk=Object.defineProperty,hT=Object.getOwnPropertySymbols,hO=Object.prototype.hasOwnProperty,hN=Object.prototype.propertyIsEnumerable,hR=(e,t,r)=>t in e?hk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hB=(e,t)=>{for(var r in t||(t={}))hO.call(t,r)&&hR(e,r,t[r]);if(hT)for(var r of hT(t))hN.call(t,r)&&hR(e,r,t[r]);return e};let hD="eip155",hM=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],hU=e=>e&&e.startsWith("0x")?BigInt(e).toString(10):e,hj=e=>e&&e.startsWith("0x")?e:`0x${BigInt(e).toString(16)}`,hL=e=>Object.keys(e).filter(e=>hM.includes(e)).reduce((t,r)=>(t[r]=hF(e[r]),t),{}),hF=e=>"string"==typeof e&&function(e){try{let t=JSON.parse(e);return"object"==typeof t&&null!==t&&!Array.isArray(t)}catch{return!1}}(e)?JSON.parse(e):e;var hz=Object.defineProperty;class hq{constructor(e){((e,t,r)=>((e,t,r)=>t in e?hz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r))(this,"storage"),this.storage=e}async getItem(e){return await this.storage.getItem(e)}async setItem(e,t){return await this.storage.setItem(e,t)}async removeItem(e){return await this.storage.removeItem(e)}static getStorage(e){return n||(n=new hq(e)),n}}var hW=Object.defineProperty,hH=Object.defineProperties,hK=Object.getOwnPropertyDescriptors,hV=Object.getOwnPropertySymbols,hG=Object.prototype.hasOwnProperty,hJ=Object.prototype.propertyIsEnumerable,hY=(e,t,r)=>t in e?hW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;async function hZ(e,t){let r,n=nM(e.result.capabilities.caip345.caip2),i=e.result.capabilities.caip345.transactionHashes,s=await Promise.allSettled(i.map(e=>hQ(n.reference,e,t))),a=s.filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>e);s.filter(e=>"rejected"===e.status).forEach(e=>console.warn("Failed to fetch transaction receipt:",e.reason));let o=!a.length||a.some(e=>!e),l=a.every(e=>e?.status==="0x1"),c=a.every(e=>e?.status==="0x0"),u=a.some(e=>e?.status==="0x0");return o?r=100:l?r=200:c?r=500:u&&(r=600),{id:e.result.id,version:e.request.version,atomic:e.request.atomicRequired,chainId:e.request.chainId,capabilities:e.result.capabilities,receipts:a,status:r}}async function hQ(e,t,r){return await r(parseInt(e)).request((0,cT.formatJsonRpcRequest)("eth_getTransactionReceipt",[t]))}async function hX({sendCalls:e,storage:t}){let r=await t.getItem(hl);await t.setItem(hl,hH(((e,t)=>{for(var r in t||(t={}))hG.call(t,r)&&hY(e,r,t[r]);if(hV)for(var r of hV(t))hJ.call(t,r)&&hY(e,r,t[r]);return e})({},r),hK({[e.result.id]:{request:e.request,result:e.result,expiry:ie(86400)}})))}async function h0({resultId:e,storage:t}){let r=await t.getItem(hl);if(r){for(let n in delete r[e],await t.setItem(hl,r),r)it(r[n].expiry)&&delete r[n];await t.setItem(hl,r)}}async function h1({resultId:e,storage:t}){let r=await t.getItem(hl),n=r?.[e];
206if(n&&!it(n.expiry))return n;await h0({resultId:e,storage:t})}var h2=Object.defineProperty,h5=Object.defineProperties,h6=Object.getOwnPropertyDescriptors,h3=Object.getOwnPropertySymbols,h8=Object.prototype.hasOwnProperty,h4=Object.prototype.propertyIsEnumerable,h9=(e,t,r)=>t in e?h2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h7=(e,t)=>{for(var r in t||(t={}))h8.call(t,r)&&h9(e,r,t[r]);if(h3)for(var r of h3(t))h4.call(t,r)&&h9(e,r,t[r]);return e},pe=(e,t)=>h5(e,h6(t)),pt=(e,t,r)=>h9(e,"symbol"!=typeof t?t+"":t,r);class pr{constructor(e){pt(this,"name","eip155"),pt(this,"client"),pt(this,"chainId"),pt(this,"namespace"),pt(this,"httpProviders"),pt(this,"events"),pt(this,"storage"),this.namespace=e.namespace,this.events=hP("events"),this.client=hP("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain()),this.storage=hq.getStorage(this.client.core.storage)}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e);case"wallet_sendCalls":return await this.sendCalls(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t);let r=this.chainId;this.chainId=parseInt(e),this.events.emit(hc.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${r}`})}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){let r=t||hw(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new ck.F(new fY.V(r,hP("disableProviderPing")))}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=parseInt(t.includes(":")?t.split(":")[1]:t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(e){let t=e||this.chainId;return this.httpProviders[t]||(this.httpProviders=pe(h7({},this.httpProviders),{[t]:this.createHttpProvider(t)}),this.httpProviders[t])}async handleSwitchChain(e){var t,r;let n=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0",i=parseInt(n=n.startsWith("0x")?n:`0x${n}`,16);if(this.isChainApproved(i))this.setDefaultChain(`${i}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:null==(r=this.namespace.chains)?void 0:r[0]}),this.setDefaultChain(`${i}`);else throw Error(`Failed to switch to chain 'eip155:${i}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,r,n,i,s;let a,o=null==(r=null==(t=e.request)?void 0:t.params)?void 0:r[0],l=(null==(i=null==(n=e.request)?void 0:n.params)?void 0:i[1])||[];if(!o)throw Error("Missing address parameter in `wallet_getCapabilities` request");let c=this.client.session.get(e.topic),u=(null==(s=c?.sessionProperties)?void 0:s.capabilities)||{},d=`${o}${l.join(",")}`,f=u?.[d];if(f)return f;try{a=((e,t,r)=>{let{sessionProperties:n={},scopedProperties:i={}}=e,s={};if(!lM(i)&&!lM(n))return;let a=hL(n);for(let e of r){let r=hU(e);if(!r)continue;s[hj(r)]=a;let n=i?.[`${hD}:${r}`];if(n){let e=n?.[`${hD}:${r}:${t}`];s[hj(r)]=hB(hB({},s[hj(r)]),hL(e||n))}}for(let[e,t]of Object.entries(s))0===Object.keys(t).length&&delete s[e];return Object.keys(s).length>0?s:void 0})(c,o,l)}catch(e){console.warn("Failed to extract capabilities from session",e)}if(a)return a;let h=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:pe(h7({},c.sessionProperties||{}),{capabilities:pe(h7({},u||{}
206),{[d]:h})})})}catch(e){console.warn("Failed to update session with capabilities",e)}return h}async getCallStatus(e){var t,r,n;let i=this.client.session.get(e.topic),s=null==(t=i.sessionProperties)?void 0:t.bundler_name;if(s){let t=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(t,e)}catch(e){console.warn("Failed to fetch call status from bundler",e,t)}}let a=null==(r=i.sessionProperties)?void 0:r.bundler_url;if(a)try{return await this.getUserOperationReceipt(a,e)}catch(e){console.warn("Failed to fetch call status from custom bundler",e,a)}let o=await h1({resultId:null==(n=e.request.params)?void 0:n[0],storage:this.storage});if(o)try{return await hZ(o,this.getHttpProvider.bind(this))}catch(e){console.warn("Failed to fetch call status from stored send calls",e,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var r;let n=new URL(e),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,cT.formatJsonRpcRequest)("eth_getUserOperationReceipt",[null==(r=t.request.params)?void 0:r[0]]))});if(!i.ok)throw Error(`Failed to fetch user operation receipt - ${i.status}`);return await i.json()}getBundlerUrl(e,t){return`${ho}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}async sendCalls(e){var t,r,n;let i=await this.client.request(e),s=null==(t=e.request.params)?void 0:t[0],a=i?.id,o=i?.capabilities||{},l=null==(r=o?.caip345)?void 0:r.caip2,c=null==(n=o?.caip345)?void 0:n.transactionHashes;return a&&l&&null!=c&&c.length&&await hX({sendCalls:{request:s,result:i},storage:this.storage}),i}}var pn=Object.defineProperty,pi=(e,t,r)=>((e,t,r)=>t in e?pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class ps{constructor(e){pi(this,"name",ha),pi(this,"client"),pi(this,"httpProviders"),pi(this,"events"),pi(this,"namespace"),pi(this,"chainId"),this.namespace=e.namespace,this.events=hP("events"),this.client=hP("client"),this.chainId=this.getDefaultChain(),this.name=this.getNamespaceName(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t);let r=this.chainId;this.chainId=e,this.events.emit(hc.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${r}`})}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getNamespaceName(){let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return nM(e).namespace}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){var e,t;let r={};return null==(t=null==(e=this.namespace)?void 0:e.accounts)||t.forEach(e=>{var t,n;let i=nM(e),s=null==(n=null==(t=this.namespace)?void 0:t.rpcMap)?void 0:n[`${i.namespace}:${i.reference}`];r[i.reference]=this.createHttpProvider(e,s)}),r}getHttpProvider(e){let t=nM(e).reference,r=this.httpProviders[t];if(typeof r>"u")throw Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||hw(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new ck.F(new fY.A(r,hP("disableProviderPing")))}}var pa=Object.defineProperty,po=Object.defineProperties,pl=Object.getOwnPropertyDescriptors,pc=Object.getOwnPropertySymbols,pu=Object.prototype.hasOwnProperty,pd=Object.prototype.propertyIsEnumerable,pf=(e,t,r)=>t in e?pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ph=(e,t)=>{for(var r in t||(t={}))pu.call(t,r)&&pf(e,r,t[r]);if(pc)for(var r of pc(t))pd.call(t,r)&&pf(e,r,t[r]);return e},pp=(e,t)=>po(e,pl(t)),py=(e,t,r)=>pf(e,"symbol"!=typeof t?t+"":t,r);class pm{constructor(e){var t,r;py(this,"client"),py(this,"namespaces"),py(this,"optionalNamespaces"),py(this,"sessionProperties"),py(this,"scopedProperties"),py(this,"events",new ti),py(this,"rpcProviders",{}),py(this,"session"),py(this,"providerOpts"),py(this,"logger"),py(this,"uri"),py(this,"disableProviderPing",!1),this.providerOpts=e,this.logger=l1({logger:null!=(t=e.logger)?t:hr,name:null!=(r=this.providerOpts.name)?r:hn}),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){let t=new pm(e);return await t.initialize(),t}async request(e,t,r){let[n,i]=this.validateChain(t);if(!this.session)throw Error("Please call connect() before request()");return await this.getProvider(n).request({request:ph({}
206,e),chainId:`${n}:${i}`,topic:this.session.topic,expiry:r})}sendAsync(e,t,r,n){let i=new Date().getTime();this.request(e,r,n).then(e=>t(null,(0,cT.formatJsonRpcResult)(i,e))).catch(e=>t(e,void 0))}async enable(){if(!this.client)throw Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:lB("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw Error("Sign Client not initialized");if(this.setNamespaces(e),this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();let{uri:r,response:n}=await this.client.authenticate(e,t);r&&(this.uri=r,this.events.emit("display_uri",r));let i=await n();if(this.session=i.session,this.session){let e=hI(this.session.namespaces);this.namespaces=h_(this.namespaces,e),await this.persist("namespaces",this.namespaces),this.onConnect()}return i}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){let{uri:t,approval:r}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties});t&&(this.uri=t,this.events.emit("display_uri",t));let n=await r();this.session=n;let i=hI(n.namespaces);return this.namespaces=h_(this.namespaces,i),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;let[r,n]=this.validateChain(e);this.getProvider(r).setDefaultChain(n,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){try{this.logger.info("Cleaning up inactive pairings...");let t=this.client.pairing.getAll();if(!lD(t))return;for(let r of t)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}catch(e){this.logger.warn(e,"Failed to cleanup pending pairings")}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,t;if(this.client=this.providerOpts.client||await fJ.init({core:this.providerOpts.core,logger:this.providerOpts.logger||hr,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.org",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(r){throw this.logger.error(r,"Failed to get session"),Error(`The provided session: ${null==(t=null==(e=this.providerOpts)?void 0:e.session)?void 0:t.topic} doesn't exist in the Sign client`)}else{let e=this.client.session.getAll();this.session=e[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw Error("Sign Client not initialized");if(!this.session)throw Error("Session not initialized. Please call connect() before enable()");let e=[...new Set(Object.keys(this.session.namespaces).map(e=>l$(e)))];h$("client",this.client),h$("events",this.events),h$("disableProviderPing",this.disableProviderPing),e.forEach(e
206=>{if(!this.session)return;let t=function(e,t){let r=Object.keys(t.namespaces).filter(t=>t.includes(e));if(!r.length)return[];let n=[];return r.forEach(e=>{let r=t.namespaces[e].accounts;n.push(...r)}),n}(e,this.session);if(t?.length===0)return;let r=hv(t),n=pp(ph({},h_(this.namespaces,this.optionalNamespaces)[e]),{accounts:t,chains:r});"eip155"===e?this.rpcProviders[e]=new pr({namespace:n}):this.rpcProviders[e]=new ps({namespace:n})})}registerEventListeners(){if(typeof this.client>"u")throw Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var t;let{topic:r}=e;r===(null==(t=this.session)?void 0:t.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var t;let{params:r,topic:n}=e;if(n!==(null==(t=this.session)?void 0:t.topic))return;let{event:i}=r;if("accountsChanged"===i.name){let e=i.data;e&&lD(e)&&this.events.emit("accountsChanged",e.map(hA))}else if("chainChanged"===i.name){let e=r.chainId,t=r.event.data,n=l$(e),i=hC(e)!==hC(t)?`${n}:${hC(t)}`:e;this.onChainChanged({currentCaipChainId:i})}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var r,n;if(e!==(null==(r=this.session)?void 0:r.topic))return;let{namespaces:i}=t,s=null==(n=this.client)?void 0:n.session.get(e);this.session=pp(ph({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{var t;e.topic===(null==(t=this.session)?void 0:t.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",pp(ph({},lB("USER_DISCONNECTED")),{data:e.topic})))}),this.on(hc.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(pp(ph({},e),{internal:!0}))})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[ha]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])})}setNamespaces(e){let{namespaces:t={},optionalNamespaces:r={},sessionProperties:n,scopedProperties:i}=e;this.optionalNamespaces=h_(t,r),this.sessionProperties=n,this.scopedProperties=i}validateChain(e){let[t,r]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,r];if(t&&!Object.keys(this.namespaces||{}).map(e=>l$(e)).includes(t))throw Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&r)return[t,r];let n=l$(Object.keys(this.namespaces)[0]),i=this.rpcProviders[n].getDefaultChain();return[n,i]}async requestAccounts(){let[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged({currentCaipChainId:e,previousCaipChainId:t,internal:r=!1}){if(!this.namespaces)return;let[n,i]=this.validateChain(e);i&&(this.updateNamespaceChain(n,i),r?(this.events.emit("chainChanged",i),this.emitAccountsChangedOnChainChange({namespace:n,currentCaipChainId:e,previousCaipChainId:t})):this.getProvider(n).setDefaultChain(i),await this.persist("namespaces",this.namespaces))}emitAccountsChangedOnChainChange({namespace:e,currentCaipChainId:t,previousCaipChainId:r}){var n,i;try{if(r===t)return;let s=null==(i=null==(n=this.session)?void 0:n.namespaces[e])?void 0:i.accounts;if(!s)return;let a=s.filter(e=>e.includes(`${t}:`)).map(hA);if(!lD(a))return;this.events.emit("accountsChanged",a)}catch(e){this.logger.warn(e,"Failed to emit accountsChanged on chain change")}}updateNamespaceChain(e,t){if(!this.namespaces)return;let r=this.namespaces[e]?e:`${e}:${t}`;this.namespaces[r]?this.namespaces[r]&&(this.namespaces[r].defaultChain=t):this.namespaces[r]={chains:[],methods:[],events:[],defaultChain:t}}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,t){var r;let n=(null==(r=this.session)?void 0:r.topic)||"";await this.client.core.storage.setItem(`${hi}/${e}${n}`,t)}async getFromStore(e){var t;let r=(null==(t=this.session)?void 0:t.topic)||"";return await this.client.core.storage.getItem(`${hi}/${e}${r}`)}async deleteFromStore(e){var t;let r=(null==(t=this.session)?void 0:t.topic)||"";await this.client.core.storage.removeItem(`${hi}/${e}${r}`)}async cleanupStorage(){var e;try{if((null==(e=this.client)?void 0:e.session.length)>0)return;for(let e of(await this.client.core.storage.getKeys()))e.startsWith(hi)&&await this.client.core.storage.removeItem(e)}catch(e){this.logger.warn(e,"Failed to cleanup storage")}}}let pg=["eth_sendTransaction","personal_sign"],pb=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],pw=["chainChanged","accountsChanged"],pv=["chainChanged","accountsChanged","message","disconnect","connect"],px=async()=>{let{createAppKit:e}=await r.e(2593).then(r.bind(r,62593));return e};var p_=Object.defineProperty,pE=Object.defineProperties,pA=Object.getOwnPropertyDescriptors,pI=Object.getOwnPropertySymbols,pC=Object.prototype.hasOwnProperty,pS=Object.prototype.propertyIsEnumerable,pP=(e,t,r)=>t in e?p_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p$=(e,t)=>
206{for(var r in t||(t={}))pC.call(t,r)&&pP(e,r,t[r]);if(pI)for(var r of pI(t))pS.call(t,r)&&pP(e,r,t[r]);return e},pk=(e,t)=>pE(e,pA(t)),pT=(e,t,r)=>pP(e,"symbol"!=typeof t?t+"":t,r);function pO(e){return Number(e[0].split(":")[1])}function pN(e){return`0x${e.toString(16)}`}class pR{constructor(){pT(this,"events",new ti.EventEmitter),pT(this,"namespace","eip155"),pT(this,"accounts",[]),pT(this,"signer"),pT(this,"chainId",1),pT(this,"modal"),pT(this,"rpc"),pT(this,"STORAGE_KEY","wc@2:ethereum_provider:"),pT(this,"on",(e,t)=>(this.events.on(e,t),this)),pT(this,"once",(e,t)=>(this.events.once(e,t),this)),pT(this,"removeListener",(e,t)=>(this.events.removeListener(e,t),this)),pT(this,"off",(e,t)=>(this.events.off(e,t),this)),pT(this,"parseAccount",e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e),this.signer={},this.rpc={}}static async init(e){let t=new pR;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,r){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),r)}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){var t;if(!this.signer.client)throw Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);let{required:r,optional:n}=function(e){let{chains:t,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:a,rpcMap:o}=e;if(!lD(t))throw Error("Invalid chains");let l={chains:t,methods:n||pg,events:s||pw,rpcMap:p$({},t.length?{[pO(t)]:o[pO(t)]}:{})},c=s?.filter(e=>!pw.includes(e)),u=n?.filter(e=>!pg.includes(e));if(!r&&!a&&!i&&!(null!=c&&c.length)&&!(null!=u&&u.length))return{required:t.length?l:void 0};let d={chains:[...new Set(c?.length&&u?.length||!r?l.chains.concat(r||[]):r)],methods:[...new Set(l.methods.concat(null!=i&&i.length?i:pb))],events:[...new Set(l.events.concat(null!=a&&a.length?a:pv))],rpcMap:o};return{required:t.length?l:void 0,optional:r.length?d:void 0}}(this.rpc);try{let t=await new Promise(async(t,i)=>{var s,a;this.rpc.showQrModal&&(null==(s=this.modal)||s.open(),null==(a=this.modal)||a.subscribeState(e=>{e.open||this.signer.session||(this.signer.abortPairingAttempt(),i(Error("Connection request reset. Please try again.")))}));let o=null!=e&&e.scopedProperties?{[this.namespace]:e.scopedProperties}:void 0;await this.signer.connect(pk(p$({namespaces:p$({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e?.pairingTopic,scopedProperties:o})).then(e=>{t(e)}).catch(e=>{var t;null==(t=this.modal)||t.showErrorMessage("Unable to connect"),i(Error(e.message))})});if(!t)return;let i=nU(t.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:i),this.setAccounts(i),this.events.emit("connect",{chainId:pN(this.chainId)})}catch(e){throw this.signer.logger.error(e),e}finally{null==(t=this.modal)||t.close()}}async authenticate(e,t){var r;if(!this.signer.client)throw Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e?.chains});try{let r=await new Promise(async(r,n)=>{var i,s;this.rpc.showQrModal&&(null==(i=this.modal)||i.open(),null==(s=this.modal)||s.subscribeState(e=>{e.open||this.signer.session||(this.signer.abortPairingAttempt(),n(Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(pk(p$({},e),{chains:this.rpc.chains}),t).then(e=>{r(e)}).catch(e=>{var t;null==(t=this.modal)||t.showErrorMessage("Unable to connect"),n(Error(e.message))})}),n=r.session;if(n){let e=nU(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:e),this.setAccounts(e),this.events.emit("connect",{chainId:pN(this.chainId)})}return r}catch(e){throw this.signer.logger.error(e),e}finally{null==(r=this.modal)||r.close()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{let{params:t}=e,{event:r}=t;
206"accountsChanged"===r.name?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===r.name?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",e)}),this.signer.on("accountsChanged",e=>{this.accounts=this.parseAccounts(e),this.events.emit("accountsChanged",this.accounts)}),this.signer.on("chainChanged",e=>{let t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",pN(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",pk(p$({},lB("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith(`${this.namespace}:`)}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){let t=e.filter(e=>this.isCompatibleChainId(e)).map(e=>this.parseChainId(e));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",pN(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){let t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){let[t,r,n]=e.split(":");return{chainId:`${t}:${r}`,address:n}}setAccounts(e){this.accounts=e.filter(e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId).map(e=>this.parseAccountId(e).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,r;let n=null!=(t=e?.chains)?t:[],i=null!=(r=e?.optionalChains)?r:[],s=n.concat(i);if(!s.length)throw Error("No chains specified in either `chains` or `optionalChains`");let a=n.length?e?.methods||pg:[],o=n.length?e?.events||pw:[],l=e?.optionalMethods||[],c=e?.optionalEvents||[],u=e?.rpcMap||this.buildRpcMap(s,e.projectId),d=e?.qrModalOptions||void 0;return{chains:n?.map(e=>this.formatChainId(e)),optionalChains:i.map(e=>this.formatChainId(e)),methods:a,events:o,optionalMethods:l,optionalEvents:c,rpcMap:u,showQrModal:!!(null!=e&&e.showQrModal),qrModalOptions:d,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){let r={};return e.forEach(e=>{r[e]=this.getRpcUrl(e,t)}),r}async initialize(e){var t;if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?pO(this.rpc.chains):pO(this.rpc.optionalChains),this.signer=await pm.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storage:e.storage,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{let r=await px(),{convertWCMToAppKitOptions:n}=await Promise.resolve().then(function(){return pH}),i=n(pk(p$({},this.rpc.qrModalOptions),{chains:[...new Set([...this.rpc.chains,...this.rpc.optionalChains])],metadata:this.rpc.metadata,projectId:this.rpc.projectId}));if(!i.networks.length)throw Error("No networks found for WalletConnect\xb7");e=r(pk(p$({},i),{universalProvider:this.signer,manualWCControl:!0,enableMobileFullScreen:(null==(t=this.rpc.qrModalOptions)?void 0:t.enableMobileFullScreen)===!0}))}catch(e){throw console.warn(e),Error("To use QR modal, please install @reown/appkit package")}if(e)try{this.modal=e}catch(e){throw this.signer.logger.error(e),Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;let{chains:t,optionalChains:r,rpcMap:n}=e;t&&lD(t)&&(this.rpc.chains=t.map(e=>this.formatChainId(e)),t.forEach(e=>{this.rpc.rpcMap[e]=n?.[e]||this.getRpcUrl(e)})),r&&lD(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r?.map(e=>this.formatChainId(e)),r.forEach(e=>{this.rpc.rpcMap[e]=n?.[e]||this.getRpcUrl(e)}))}getRpcUrl(e,t){var r;return(null==(r=this.rpc.rpcMap)?void 0:r[e])||`https://rpc.walletconnect.org/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{let e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(e=>this.signer.logger.warn(e))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map(e=>this.parseAccount(e))}}var pB=Object.defineProperty,pD=Object.defineProperties,pM=Object.getOwnPropertyDescriptors,pU=Object.getOwnPropertySymbols,pj=Object.prototype.hasOwnProperty,pL=Object.prototype.propertyIsEnumerable,pF=(e,t,r)=>t in e?pB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pz=(e,t)=>
206{for(var r in t||(t={}))pj.call(t,r)&&pF(e,r,t[r]);if(pU)for(var r of pU(t))pL.call(t,r)&&pF(e,r,t[r]);return e};let pq=e=>{let[t,r]=e.split(":");return pW({id:r,caipNetworkId:e,chainNamespace:t,name:"",nativeCurrency:{name:"",symbol:"",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}})};function pW(e){return pz({formatters:void 0,fees:void 0,serializers:void 0},e)}var pH=Object.freeze({__proto__:null,convertWCMToAppKitOptions:function(e){var t,r,n,i,s,a,o;let l=null==(t=e.chains)?void 0:t.map(pq).filter(Boolean);if(0===l.length)throw Error("At least one chain must be specified");let c=l.find(t=>{var r;return t.id===(null==(r=e.defaultChain)?void 0:r.id)}),u={projectId:e.projectId,networks:l,themeMode:e.themeMode,themeVariables:function(e){if(e)return{"--w3m-font-family":e["--wcm-font-family"],"--w3m-accent":e["--wcm-accent-color"],"--w3m-color-mix":e["--wcm-background-color"],"--w3m-z-index":e["--wcm-z-index"]?Number(e["--wcm-z-index"]):void 0,"--w3m-qr-color":e["--wcm-accent-color"],"--w3m-font-size-master":e["--wcm-text-medium-regular-size"],"--w3m-border-radius-master":e["--wcm-container-border-radius"],"--w3m-color-mix-strength":0}}(e.themeVariables),chainImages:e.chainImages,connectorImages:e.walletImages,defaultNetwork:c,metadata:pD(pz({},e.metadata),pM({name:(null==(r=e.metadata)?void 0:r.name)||"WalletConnect",description:(null==(n=e.metadata)?void 0:n.description)||"Connect to WalletConnect-compatible wallets",url:(null==(i=e.metadata)?void 0:i.url)||"https://walletconnect.org",icons:(null==(s=e.metadata)?void 0:s.icons)||["https://walletconnect.org/walletconnect-logo.png"]})),showWallets:!0,featuredWalletIds:"NONE"===e.explorerRecommendedWalletIds?[]:Array.isArray(e.explorerRecommendedWalletIds)?e.explorerRecommendedWalletIds:[],excludeWalletIds:"ALL"===e.explorerExcludedWalletIds?[]:Array.isArray(e.explorerExcludedWalletIds)?e.explorerExcludedWalletIds:[],enableEIP6963:!1,enableInjected:!1,enableCoinbase:!0,enableWalletConnect:!0,features:{email:!1,socials:!1}};if(null!=(a=e.mobileWallets)&&a.length||null!=(o=e.desktopWallets)&&o.length){let t=[...(e.mobileWallets||[]).map(e=>({id:e.id,name:e.name,links:e.links})),...(e.desktopWallets||[]).map(e=>({id:e.id,name:e.name,links:{native:e.links.native,universal:e.links.universal}}))],r=[...u.featuredWalletIds||[],...u.excludeWalletIds||[]],n=t.filter(e=>!r.includes(e.id));n.length&&(u.customWallets=n)}return u},defineChain:pW}),pK=r(71217),pV=r(40175),pG=r(92204),pJ=r(81436),pY=r(4375),pZ=r(21304),pQ=r(38272),pX=r(37716);class p0{static parse(e){try{return new p0(e)}catch(e){return null}}static throwIfNotWellFormedJwt(e){return l.i(e),e}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=l.i(e)}}class p1 extends p0{static parse(e){try{return new p1(e)}catch(e){return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}}let p2=({style:e,...t})=>(0,y.jsxs)("svg",{viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,y.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,y.jsx)("path",{fillRule:"evenodd",clipRule:"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"})]}),p5="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",p6="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAALZJREFUaEPtmjEOhDAMBNc/O14GvOzys3CAKK6eAlmaVGl2Zc+kTOU685vkc9/bnD2prZK5/TZY24z9P+g4F5hNh7/GdoG37WlAA5CATwgCxHENYISwQAMQII5rACOEBRqAAHFcAxghLNAABIjjGsAIYYEGIEAc1wBGCAs0AAHiuAYwQligAQgQxzWAEcICDUCAOK4BjBAWaAACxHENYISwQAMQII6fBjr+VHkW3+u+tfyxMpJaDgYzYxb/ALZVAAAAAElFTkSuQmCC";class p3 extends f.E{async initialize(){await this.importPromise,await this.syncAccounts(),this.initialized=!0,this.emit
206("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:p6,id:"com.coinbase.wallet"}}async promptConnection(){h.c.debug("Prompting connection via Base Account",{wallet:this.walletClientType});try{await this.importPromise,h.c.rpcRequest("eth_requestAccounts",this.walletClientType);let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(h.c.rpcResponse("eth_requestAccounts",this.walletClientType),!e||0===e.length||!e[0])throw new p.e("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw h.c.connectionFailed(this.walletClientType,e,{method:"base_account"}),(0,h.j)(e)}}constructor(e,t,n,s,a){super("base_account",e,t,n),this.connectorType="base_account",this.walletClientType="base_account",this.displayName="Base",this.setBaseAccountSdk=a,this.proxyProvider=new f.P(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.baseAccountConfig={...s,appChainIds:[t.id].concat(e.map(e=>e.id))},i?(this.proxyProvider.setWalletProvider(i.getProvider()),this.setBaseAccountSdk(i)):this.importPromise=r.e(3343).then(r.bind(r,3343)).then(({createBaseAccountSDK:e})=>{i=e(this.baseAccountConfig),this.proxyProvider.setWalletProvider(i.getProvider()),this.setBaseAccountSdk(i)}).catch(console.error)}}let p8=[1,0xaa36a7,137,10,8453,84532,42161,7777777,43114,56];class p4 extends f.E{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:p5,id:"com.coinbase.wallet"}}async promptConnection(){h.c.debug("Prompting connection via Coinbase Wallet",{wallet:this.walletClientType});try{h.c.rpcRequest("eth_requestAccounts",this.walletClientType);let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(h.c.rpcResponse("eth_requestAccounts",this.walletClientType),!e||0===e.length||!e[0])throw new p.e("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw h.c.connectionFailed(this.walletClientType,e,{method:"coinbase_wallet"}),(0,h.j)(e)}}updateConnectionPreference(e){this.coinbaseWalletConfig={...this.coinbaseWalletConfig,preference:{...this.coinbaseWalletConfig.preference,options:e}},this.walletClientType="smartWalletOnly"===e?"coinbase_smart_wallet":"coinbase_wallet",s=tt({...this.coinbaseWalletConfig}),this.proxyProvider.setWalletProvider(s.getProvider())}constructor(e,t,r,n){if(super("coinbase_wallet",e,t,r),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new f.P(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.coinbaseWalletConfig={...n,appChainIds:[t.id].concat(e.map(e=>e.id))},this.walletClientType="smartWalletOnly"===this.coinbaseWalletConfig.preference?.options?"coinbase_smart_wallet":"coinbase_wallet","coinbase_smart_wallet"===this.walletClientType&&(this.displayName="Coinbase Smart Wallet"),!s){let e="eoaOnly"!==this.coinbaseWalletConfig.preference?.options?(this.coinbaseWalletConfig.appChainIds??[]).filter(e=>!p8.includes(e)):[];e.length>0&&!e.every(e=>tr.o9.has(e))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${e.join(", ")}`),s=tt(this.coinbaseWalletConfig)}this.proxyProvider.setWalletProvider(s.getProvider())}}let p9=({style:e,...t}={})=>(0,y.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,y.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),p7=({style:e,...t}={})=>(0,y.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,y.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,y.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});function ye(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var yt=0;async function yr(e,t){try{h.c.rpcRequest("eth_requestAccounts",t);let r=await e.request({method:"eth_requestAccounts"});return h.c.rpcResponse("eth_requestAccounts",t),r}catch(r){if(-32002===r.code&&r.message?.includes("Already processing")){h.c.debug("eth_requestAccounts already processing, retrying after delay",{wallet:t}),await new Promise(e=>setTimeout(e,500)),h.c.rpcRequest("eth_requestAccounts",t);let r=await e.request({method:"eth_requestAccounts"});return h.c.rpcResponse("eth_requestAccounts",t),r}throw r}}class yn extends f.E{async initialize(){h.c.debug("Initializing injected connector (EIP-6963)",{wallet:this.walletClientType}
206),await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){if(h.c.connectionStart(this.walletClientType,"injected",{showPrompt:e.showPrompt}),e.showPrompt&&await this.promptConnection(),!await this.isConnected())return h.c.debug("Not connected after prompt",{wallet:this.walletClientType}),null;let t=await this.getConnectedWallet();return t&&h.c.connectionSuccess(this.walletClientType),t}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){h.c.debug("Prompting connection via eth_requestAccounts",{wallet:this.walletClientType});try{let e=await yr(this.proxyProvider,this.walletClientType);if(!e||0===e.length||!e[0])throw new p.e("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw h.c.connectionFailed(this.walletClientType,e,{method:"injected"}),(0,h.j)(e)}}constructor(e,t,r,n,i){super(i||"unknown",e,t,r),this.connectorType="injected",this.proxyProvider=new f.P(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=n;let s=n.provider;this.proxyProvider.setWalletProvider(s)}}var yi="__private_"+yt+++"__walletBranding";class ys extends f.E{async initialize(){h.c.debug("Initializing legacy injected connector",{wallet:this.walletClientType}),await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){if(h.c.connectionStart(this.walletClientType,"injected (legacy)",{showPrompt:e.showPrompt}),e.showPrompt&&await this.promptConnection(),!await this.isConnected())return h.c.debug("Not connected after prompt",{wallet:this.walletClientType}),null;let t=await this.getConnectedWallet();return t&&h.c.connectionSuccess(this.walletClientType),t}get walletBranding(){return ye(this,yi)[yi]??{name:"Browser Extension",icon:p9,id:"extension"}}disconnect(){h.c.debug("Disconnect requested (not supported for legacy injected)",{wallet:this.walletClientType})}async promptConnection(){h.c.debug("Prompting connection via eth_requestAccounts (legacy)",{wallet:this.walletClientType});try{let e=await yr(this.proxyProvider,this.walletClientType);if(!e||0===e.length||!e[0])throw new p.e("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw h.c.connectionFailed(this.walletClientType,e,{method:"injected (legacy)"}),(0,h.j)(e)}}constructor(e,t,r,n,i){super(i??"unknown",e,t,r),Object.defineProperty(this,yi,{writable:!0,value:void 0}),this.connectorType="injected",this.proxyProvider=new f.P(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(n),"metamask"===i?ye(this,yi)[yi]={name:"MetaMask",icon:f.M,id:"io.metamask"}:"phantom"===i&&(ye(this,yi)[yi]={name:"Phantom",icon:p7,id:"phantom"})}}class ya extends yn{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){h.c.debug("Prompting connection via MetaMask",{wallet:this.walletClientType});try{tn.Fr||(h.c.rpcRequest("wallet_requestPermissions",this.walletClientType),await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}),h.c.rpcResponse("wallet_requestPermissions",this.walletClientType)),h.c.rpcRequest("eth_requestAccounts",this.walletClientType);let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(h.c.rpcResponse("eth_requestAccounts",this.walletClientType),!e||0===e.length||!e[0])throw new p.e("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw h.c.connectionFailed(this.walletClientType,e,{method:"metamask"}),(0,h.j)(e)}}}class yo extends f.E{async initialize(){h.c.debug("Initializing WalletConnect V2 connector",{wallet:this.walletClientType});let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){let e=this.walletProvider?.session?.peer.metadata;h.c.debug("Restoring existing WalletConnect session",{peerName:e?.name,accountsCount:this.walletProvider?.accounts?.length}),this.walletProvider?.session?.peer.metadata.url&&(this.walletEntry=(0,f.e)(this.walletProvider?.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown"),this.connected=!0,await this.syncAccounts()}
206this.initialized=!0,this.emit("initialized")}async connect(e){h.c.connectionStart(this.walletClientType,"wallet_connect_v2",{showPrompt:e.showPrompt}),e.showPrompt&&await this.promptConnection();let t=await this.getConnectedWallet();return t&&h.c.connectionSuccess(this.walletClientType),t}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){let e=this.walletProvider?.session?.peer.metadata.icons?.[0];return{name:(0,h.k)(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:"string"==typeof e?e:h.h,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(e){let t=this.walletClientType;h.c.debug("Resetting WalletConnect connection for new wallet",{previousWallet:t,newWallet:e}),this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,(0,pK.e)(),this.onDisconnect())}async promptConnection(){if(this.provider)return h.c.debug("Prompting WalletConnect connection",{wallet:this.walletClientType}),new Promise((e,t)=>{(async()=>{h.c.debug("Enabling WalletConnect provider",{wallet:this.walletClientType,timeoutMs:this.proxyProvider.rpcTimeoutDuration});let t="",r=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout().then(()=>{})]);if(r?.length&&(t=r[0],h.c.debug("WalletConnect accounts received",{address:t,accountsCount:r.length})),!t||""===t)throw new p.e("Unable to retrieve address");this.walletProvider?.session?.peer.metadata.url&&(this.walletEntry=(0,f.e)(this.walletProvider?.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown",h.c.debug("Identified wallet from session",{wallet:this.walletClientType}),this.proxyProvider.rpcTimeoutDuration=(0,f.g)(this.rpcConfig,this.walletClientType)),this.connected=!0,await this.syncAccounts(r),e()})().catch(e=>{h.c.connectionFailed(this.walletClientType,e,{method:"wallet_connect_v2"}),t(e?(0,h.j)(e):new p.e("Unknown error during connection"))})});h.c.warn("WalletConnect provider not initialized")}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect WalletConnect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){h.c.debug("Creating WalletConnect EthereumProvider",{chainsCount:this.chains.length,defaultChainId:this.defaultChain.id});let e={};for(let t of this.chains){let r=(0,h.m)(t.id,this.chains,this.rpcConfig,this.privyAppId);r&&(e[t.id]=r)}let t=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],r=this.chains.map(e=>e.id);h.c.debug("Initializing WalletConnect EthereumProvider",{requiredChains:t.join(", ")||"none",optionalChainsCount:r.length});let n=await pR.init({projectId:this.walletConnectCloudProjectId,chains:t,optionalChains:r,optionalEvents:pv,optionalMethods:pb,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.origin,icons:[]}});return n.on("display_uri",e=>{if(h.c.debug("WalletConnect URI generated",{wallet:this.walletClientType,isMobile:tn.Fr,hasWalletEntry:!!this.walletEntry}),h.c.debug("Aborting WalletConnect pairing attempt"),n.signer.abortPairingAttempt(),(0,pK.r)(),!this.showPrivyQrModal)throw new p.e("WalletConnect modal not available - Privy handles wallet connections through its own UI");if(tn.Fr&&this.walletEntry){let{redirect:t,href:r}=(0,pK.b)(e,this.walletEntry),n=t.startsWith("http");h.c.debug("Opening mobile wallet via deep link",{wallet:this.walletEntry.name,redirectType:n?"universal":"native"}),(0,pK.o)(t,"_self"),(0,pK.s)({href:r,name:this.walletEntry.metadata?.shortName||this.walletEntry.name});let i=(0,pK.f)(e,this.walletEntry);return this.redirectUri=t,this.fallbackUniversalRedirectUri=i?.redirect,this.showPrivyQrModal({native:t,universal:t})}if(h.c.debug("Displaying WalletConnect QR code",{wallet:this.walletEntry?.name||"generic"}),this.redirectUri=void 0,this.walletEntry){let t=(0,pK.f)(e,this.walletEntry);this.fallbackUniversalRedirectUri=t?.redirect}this.showPrivyQrModal({native:e,universal:void 0})}),n.on("connect",()=>{let e=n.session?.peer.metadata;h.c.debug("WalletConnect session established",{peerName:e?.name,peerIcon:e?.icons?.[0]?"present":"none"}),n.session?.peer.metadata.url&&(this.walletEntry=(0,f.e)(n.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown")}),n}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}setWalletEntry(e,t){this.walletEntry=e,this.showPrivyQrModal=t}constructor({walletConnectCloudProjectId:e,rpcConfig:t,chains:r,defaultChain:n,shouldEnforceDefaultChainOnConnect:i,privyAppId:s,privyAppName:a,walletClientType:o}){super(o||"unknown",r,n,t),this.connectorType="wallet_connect_v2",this.privyAppId=s,this.privyAppName=a,this.walletConnectCloudProjectId=e,this.rpcConfig=t,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new f.P(void 0,this.rpcTimeoutDuration),o&&(this.walletEntry=(0,f.f)(o),this.walletClientType=o)}}class yl extends d.A{get wallets(){let e=new Set;return this.walletConnectors.flatMap(e=>e.wallets).sort((e,t)=>
206e.connectedAt&&t.connectedAt?t.connectedAt-e.connectedAt:0).filter(t=>{let r=`${t.address}${t.walletClientType}${t.connectorType}${t.meta.id}`;return!e.has(r)&&(e.add(r),!0)})}async initialize(e){if(h.c.info("Starting connector initialization",{reInit:e??!1}),this.initialized&&!e)return;if(e&&this.removeAllConnectors(),this.externalWalletConfig.disableAllExternalWallets)return void h.c.info("All external wallets disabled, skipping initialization");let t=(0,h.n)({store:this.store,walletList:this.walletList,externalWalletConfig:this.externalWalletConfig,walletChainType:this.walletChainType}).then(e=>{h.c.info("Detected injected providers",{count:e.length,wallets:e.map(e=>e.type).join(", ")}),e.forEach(({type:e,eip6963InjectedProvider:t,legacyInjectedProvider:r})=>{this.createEthereumWalletConnector({connectorType:"injected",walletClientType:e,providers:{eip6963InjectedProvider:t,legacyInjectedProvider:r}})})});for(let e of(this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector({connectorType:"coinbase_wallet",walletClientType:"coinbase_wallet"}),this.walletList.includes("base_account")&&this.createEthereumWalletConnector({connectorType:"base_account",walletClientType:"base_account"}),Object.values(f.m)))!e.isInstalled&&this.walletList.includes(e.client)&&(["ethereum-only","ethereum-and-solana"].includes(this.walletChainType)&&e.chainTypes.includes("ethereum")&&this.createEthereumWalletConnector({connectorType:"null",walletClientType:e.client,walletConfig:e}),["ethereum-and-solana","solana-only"].includes(this.walletChainType)&&e.chainTypes.includes("solana")&&this.addSolanaWalletConnector(new f.S({id:e.client,name:e.name})));let r=this.walletList.includes("wallet_connect_qr_solana")||(0,f.s)(this.walletList)&&"ethereum-only"!==this.walletChainType,n=this.externalWalletConfig.walletConnect.enabled&&(this.walletList.includes("wallet_connect_qr")||(0,f.s)(this.walletList))&&"solana-only"!==this.walletChainType,i=this.externalWalletConfig.solana.connectors?.get()||[],s=async e=>{await e.initializeProvider({walletConnectCloudProjectId:this.walletConnectCloudProjectId,privyAppName:this.privyAppName});let t=await e.hideSolanaSessionsFromSignClient();try{this.ethereumWalletConnectInitPromise||(this.ethereumWalletConnectInitPromise=this.initEthereumWalletConnect()),await this.ethereumWalletConnectInitPromise}finally{await e.unhideSolanaSessionsInSignClient(t)}await e.restoreSession()},a=async e=>{let t=e.find(e=>"walletconnect_solana"===e.walletBranding?.id),i=t?.wallet??null;!n||r&&i?r&&!n&&i?await i.initialize({walletConnectCloudProjectId:this.walletConnectCloudProjectId,privyAppName:this.privyAppName}):r&&n&&i&&await s(i):this.ethereumWalletConnectInitPromise||(this.ethereumWalletConnectInitPromise=this.initEthereumWalletConnect())};a(i),i.filter(e=>r||"walletconnect_solana"!==e.walletBranding?.id).forEach(this.addSolanaWalletConnector),this.externalWalletConfig.solana.connectors?._setOnConnectorsUpdated?.(e=>{a(e),e?.filter(e=>r||"walletconnect_solana"!==e.walletBranding?.id).forEach(this.addSolanaWalletConnector)}),await t,this.initialized=!0}findWalletConnector(e,t,r){return"wallet_connect_v2"===e?this.walletConnectors.filter(f.h).find(t=>t.connectorType===e&&(!r||t.wallets.some(e=>e.address===r)))??null:this.walletConnectors.filter(f.h).find(n=>n.connectorType===e&&n.walletClientType===t&&(!r||n.wallets.some(e=>e.address===r)))??null}findSolanaWalletConnector(e){return this.walletConnectors.filter(f.d).find(t=>"unknown"===t.walletClientType?t.walletBranding.id===e:t.walletClientType===e)??null}onInitialized(e){h.c.connectorInit(e.connectorType,e.walletClientType,{walletsCount:e.wallets.length}),e.wallets.forEach(e=>{let t=this.storedConnections.find(t=>t.address===e.address&&t.connectorType===e.connectorType&&("solana"===e.type&&"unknown"===t.walletClientType&&"unknown"===e.walletClientType?e.meta.id===t.id:t.walletClientType===e.walletClientType));t&&(e.connectedAt=t.connectedAt)}),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&this.emit("walletsUpdated")}initEthereumWalletConnect(){return this.createEthereumWalletConnector({connectorType:"wallet_connect_v2",walletClientType:"unknown"}).then(e=>{if(e)return new Promise(t=>{if(e.initialized)return void t();let r=setTimeout(()=>t(),5e3);e.once("initialized",()=>{clearTimeout(r),t()})})})}async createEthereumWalletConnector({connectorType:e,walletClientType:t,providers:r,walletConfig:n}){h.c.debug("Creating Ethereum wallet connector",{connector:e,wallet:t});let i=this.findWalletConnector(e,t);if(i&&(0,f.h)(i))return h.c.debug("Found existing connector, reusing",{connector:e,wallet:t}),i instanceof yo&&i.resetConnection(t),i;let s="injected"!==e?"coinbase_wallet"===e?new p4(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig.coinbaseWallet.config):"base_account"===e?new p3(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig.baseAccount.config,this.setBaseAccountSdk):"null"!==e?new yo({walletConnectCloudProjectId:this.walletConnectCloudProjectId,rpcConfig:this.rpcConfig,chains:this.chains,defaultChain:this.defaultChain,shouldEnforceDefaultChainOnConnect:this.shouldEnforceDefaultChainOnConnect,privyAppId:this.privyAppId,privyAppName:this.privyAppName,walletClientType:t}
206):n?new f.j({id:n.client,name:n.name,defaultChain:this.defaultChain,walletClientType:n.client}):null:"metamask"===t&&r?.eip6963InjectedProvider?new ya(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,"metamask"):"metamask"===t&&r?.legacyInjectedProvider?new ys(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"metamask"):"phantom"===t&&r?.legacyInjectedProvider?new ys(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"phantom"):r?.legacyInjectedProvider&&"unknown_browser_extension"===t?new ys(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider):r?.eip6963InjectedProvider?new yn(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,t):void 0;return s?(h.c.connectorCreated(e,t),this.addWalletConnector(s)):h.c.debug("No connector created",{connector:e,wallet:t}),s||null}addWalletConnector(e){h.c.debug("Adding wallet connector",{connector:e.connectorType,wallet:e.walletClientType}),this.walletConnectors.push(e),e.on("initialized",()=>this.onInitialized(e)),e.on("walletsUpdated",()=>this.onWalletsUpdated(e)),e.initialize().catch(t=>{h.c.error("Failed to initialize connector",t,{connector:e.connectorType,wallet:e.walletClientType})})}setWalletList(e){this.walletList=e,this.initialized&&this.initialize(!0).catch(console.error)}removeAllConnectors(){for(let e of this.walletConnectors)e.removeAllListeners();this.walletConnectors=[]}constructor(e,t,r,n,i,s,a,o,l,c,u,d,f){super(),this.ethereumWalletConnectInitPromise=null,this.addSolanaWalletConnector=async e=>{let t=this.findSolanaWalletConnector(e.walletClientType);if(!t||"null"===t.connectorType){if("null"===t?.connectorType){let e=this.walletConnectors.indexOf(t);this.walletConnectors.splice(e,1)}this.addWalletConnector(e)}},h.c.setEnabled(f??!1),h.c.info("ConnectorManager initializing",{walletChainType:d||void 0,walletListCount:a.length}),this.privyAppId=e,this.walletConnectCloudProjectId=t,this.rpcConfig=r,this.chains=n,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=s,this.walletList=a,this.shouldEnforceDefaultChainOnConnect=o,this.externalWalletConfig=l,this.privyAppName=c,this.walletChainType=d||"ethereum-only",this.setBaseAccountSdk=u,this.storedConnections=(0,h.l)()}}let yc=(0,pG.v)(()=>({identityToken:null})),yu=[pY.s,pY.m,pY.n];class yd{async get(e,t){try{return await this.baseFetch(e,t)}catch(e){throw(0,p.f)(e)}}async post(e,t,r){try{return await this.baseFetch(e,{method:"POST",...t?{body:t}:{},...r})}catch(e){throw(0,p.f)(e)}}async delete(e,t){try{return await this.baseFetch(e,{method:"DELETE",...t})}catch(e){throw(0,p.f)(e)}}constructor({appId:e,appClientId:t,client:r,defaults:n}){this.appId=e,this.appClientId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=pV.V,this.client=r,this.defaults=n,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=pJ.OT.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:e,options:t})=>{let r=new Headers(t.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-ca-id",this.clientAnalyticsId||""),r.set("privy-client",`react-auth:${this.sdkVersion}`);let n=yu.includes(e.toString());if(!r.has("authorization")){let e=await this.client.getAccessToken({disableAutoRefresh:n});null!==e&&r.set("authorization",`Bearer ${e}`)}t.headers=r,t.retryDelay&&"number"==typeof t.retryDelay&&(t.retryDelay=3*t.retryDelay)},onRequestError:({error:e})=>{if(e instanceof DOMException&&"AbortError"===e.name)throw new p.g}})}}let yf=Symbol("cross-tab-user-sync-plugin");class yh{async authenticate(){if(!this.api)throw new p.P("Auth flow has no API instance");try{return await this.api.post(pY.q,{token:this.meta.token})}catch(e){throw(0,p.f)(e)}}async link(){if(!this.api)throw new p.P("Auth flow has no API instance");try{return await this.api.post(pY.r,{token:this.meta.token})}catch(e){throw(0,p.f)(e)}}constructor(e){this.meta={token:e}}}function yp(e){return e?{"privy-ui":"t"}:void 0}class yy{async authenticate(){if(!this.api)throw new p.P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new p.P("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(pY.u,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw(0,p.f)(e)}}async link(){if(!this.api)throw new p.P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new p.P("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(pY.v,{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw(0,p.f)(e)}}async sendCodeEmail({email:e,captchaToken:t,withPrivyUi:r}){if(!this.api)throw new p.P("Auth flow has no API instance");if(e&&(this.meta.email=e),t&&(this.meta.captchaToken=t),!this.meta.email)throw new p.P("Email must be set when initialzing authentication.");let n=yp(r);try{return await this.api.post(pY.w,{email:this.meta.email,token:this.meta.captchaToken},{headers:{...n}})}catch(e){throw(0,p.f)(e)}}constructor({email:e,captchaToken:t,disableSignup:r}){this.meta={email:e,captchaToken:t,disableSignup:r??!1}}}class ym extends yy{async link(){if(!this.api)throw new p.P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new p.P("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(pY.x,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw(0,p.f)(e)}}constructor(e,t,r){super({email:t,captchaToken:r}),this.meta={email:t,captchaToken:r,oldAddress:e,disableSignup:!1}}}class yg{getOrCreateGuestCredential(e){let t=(0,pV.g)(e);
206if((0,h.e)()){if(h.s.get(t))return h.s.get(t);{let e=c.l((0,pK.g)(32));return h.s.put(t,e),e}}return c.l((0,pK.g)(32))}async authenticate(){if(!this.api)throw new p.P("Auth flow has no API instance");try{return await this.api.post(pY.y,{guest_credential:this.meta.guestCredential})}catch(e){throw(0,p.f)(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}}function yb(){return"undefined"!=typeof window&&"chrome-extension:"===window.location.protocol&&"chrome"in window}function yw(){if(!yb())return;let e=window.chrome;return e?.runtime?.id}function yv(){if(!yb())return!1;let e=window.chrome;return"function"==typeof e?.identity?.launchWebAuthFlow}async function yx(e){return new Promise((t,r)=>{yv()?window.chrome.identity.launchWebAuthFlow({url:e,interactive:!0},async e=>{try{let r=function(){if(!yb())return;let e=window.chrome;return e?.runtime?.lastError?.message}();if(r||!e){let e=`WebAuthFlow failed: ${r||"Response URI missing"}`;throw Error(e)}let n=new URL(e),i=yw();if(!i)throw Error("Invalid extension context");if("chrome-extension:"===n.protocol){if(n.hostname!==i)throw Error("Invalid responseUri origin")}else{if("https:"!==n.protocol)throw Error("Invalid responseUri protocol");{let e=n.hostname.split(".");if(3!==e.length||"chromiumapp"!==e[1]||"org"!==e[2]||e[0]!==i)throw Error("Invalid responseUri origin")}}let s=n.searchParams.get("privy_oauth_state"),a=n.searchParams.get("privy_oauth_code");if(!s||!a)throw Error("Invalid responseUri - missing required parameters");t({privyOAuthState:s,privyOAuthCode:a})}catch(e){r(e)}}):r(Error("Chrome identity API not available"))})}class y_{addCaptchaToken(e){this.meta.captchaToken=e}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new p.P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new p.P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if("undefined"===this.meta.authorizationCode)throw new p.P("User denied confirmation during OAuth flow");let e=(0,pK.h)();try{let t=await this.api.post(pY.o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return h.s.del(pV.f),h.s.del(pV.H),h.s.del(pV.O),t}catch(t){let e=(0,p.f)(t);if(e.privyErrorCode)throw new p.P(e.message||"Invalid code during OAuth flow.",void 0,e.privyErrorCode);if("User denied confirmation during OAuth flow"===e.message)throw new p.P("Invalid code during oauth flow.",void 0,p.a.OAUTH_USER_DENIED);throw new p.P("Invalid code during OAuth flow.",void 0,p.a.UNKNOWN_AUTH_ERROR)}}async link(){if(!this.api)throw new p.P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new p.P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if("undefined"===this.meta.authorizationCode)throw new p.P("User denied confirmation during OAuth flow");let e=h.s.get(pV.f);if(!e)throw new p.P("Authentication error.");try{let t=await this.api.post(pY.k,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return h.s.del(pV.f),t}catch(e){throw(0,p.f)(e)}}async getAuthorizationUrl(){if(!this.api)throw new p.P("Auth flow has no API instance");if(!this.meta.provider)throw new p.P("Provider must be set when initializing OAuth authentication.");let e=(0,pK.c)();h.s.put(pV.f,e);let t=(0,pK.a)();h.s.put(pV.S,t);let r=await (0,pK.d)(e);this.meta.withPrivyUi||h.s.put(pV.H,!0),this.meta.disableSignup?h.s.put(pV.O,!0):h.s.del(pV.O);let n=yp(this.meta.withPrivyUi),i=window.location.href,s=function(){let e=yw();if(e)return`https://${e}.chromiumapp.org`}();s&&(i=s);try{return await this.api.post(pY.l,{provider:this.meta.provider,redirect_to:this.meta.customOAuthRedirectUrl||i,token:this.meta.captchaToken,code_challenge:r,state_code:t},{headers:{...n}})}catch(e){throw(0,p.f)(e)}}constructor(e){this.meta=e}}class yE{execute(e){return null===this.promise&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}}let yA=({address:e,chainId:t,nonce:r})=>`${window.location.host} wants you to sign in with your Ethereum account:
207${e}
208
209By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.
210
211URI: ${window.location.origin}
212Version: 1
213Chain ID: ${t}
214Nonce: ${r}
215Issued At: ${(new Date).toISOString()}
216Resources:
217- https://privy.io`;
217class yI{get meta(){return{connectorType:this.wallet?.connectorType,walletClientType:this.wallet?.walletClientType,chainId:this.wallet?.chainId,address:this.wallet?.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new p.P("SiweFlow has no client instance");try{if(this.preparedMessage&&this.signature)return await this.client.authenticateWithSiweInternal({message:this.preparedMessage,signature:this.signature,chainId:this.wallet?.chainId,walletClientType:this.walletClientType??this.wallet?.walletClientType,connectorType:this.connectorType??this.wallet?.connectorType,mode:this._meta.disableSignup?"no-signup":"login-or-sign-up"});if(!this.wallet)throw new p.P("SiweFlow has no wallet instance");let{message:e,signature:t}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw(0,p.f)(e)}}async link(){if(!this.client)throw new p.P("SiweFlow has no client instance");try{if(!this.wallet)throw new p.P("SiweFlow has no wallet instance");let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw(0,p.f)(e)}}async sign(){if(!this.client)throw new p.P("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new p.P("Could not prepare SIWE message");if(!this.wallet)throw new p.P("SiweFlow has no wallet instance");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new p.P("SiweFlow has no client instance");if(!this.wallet)throw new p.P("UI SiweFlow has no wallet instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new p.P("SiweFlow has no client instance");if(!this.wallet)throw new p.P("SiweFlow has no wallet instance");let e=this.wallet.address,t=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=yA({address:e,chainId:t,nonce:this.nonce}),this.preparedMessage}constructor(e,t,r,n=!1,i){this._meta={disableSignup:!1},this.getNonceOnce=new yE(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=r,this.client=e,this._meta.disableSignup=n,this.preparedMessage=i?.message,this.signature=i?.signature,this.walletClientType=i?.walletClientType,this.connectorType=i?.connectorType}}class yC{async authenticate(){if(!this.api)throw new p.P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new p.P("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(pY.z,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw(0,p.f)(e)}}async link(){if(!this.api)throw new p.P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new p.P("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(pY.A,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw(0,p.f)(e)}}async sendSmsCode({phoneNumber:e,captchaToken:t,withPrivyUi:r}){if(!this.api)throw new p.P("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),t&&(this.meta.captchaToken=t),!this.meta.phoneNumber)throw new p.P("phone nNumber must be set when initialzing authentication.");let n=yp(r);try{return await this.api.post(pY.B,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...n}})}catch(e){throw(0,p.f)(e)}}constructor({phoneNumber:e,captchaToken:t,disableSignup:r}){this.meta={phoneNumber:e,captchaToken:t,disableSignup:r??!1}}}class yS extends yC{async link(){if(!this.api)throw new p.P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new p.P("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(pY.C,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw(0,p.f)(e)}}constructor(e,t,r){super({phoneNumber:t,captchaToken:r}),this.meta={phoneNumber:t,captchaToken:r,oldPhoneNumber:e,disableSignup:!1}}}function yP(){return!(tn.nr&&window.location.origin.startsWith("http://localhost"))}var y$,yk,yT=((yk={}).PRIVY="privy_access_token",yk.CUSTOMER="customer_access_token",yk);class yO{get token(){return this.privyAccessToken||this.customerAccessToken}getToken(e){return"privy_access_token"===e?this.privyAccessToken:this.customerAccessToken}get customerAccessToken(){return this._getToken(pV.d)}get privyAccessToken(){return this._getToken(pV.h)}_getToken(e){try{let t=h.s.get(e);return"string"==typeof t?p0.throwIfNotWellFormedJwt(t):null}catch(e){return console.error(e),this.destroyLocalState(),null}}get refreshToken(){try{let e=h.s.get(pV.R);return"string"==typeof e?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}getProviderAccessToken(e){try{let t=h.s.get((0,pV.e)(e));if("string"!=typeof t)return null;{let r=new p0(t);return r.isExpired()?(h.s.del((0,pV.e)(e)),null):r.value}}catch(e){return console.error(e),null}}get mightHaveServerCookies(){try{let e=pQ.A.get(pV.i);return void 0!==e&&e.length>0}catch(e){console.error(e)}return!1}hasRefreshCredentials(e="privy_access_token"){let t="string"==typeof this.getToken(e),r="string"==typeof this.refreshToken&&this.refreshToken!==pV.j;return this.mightHaveServerCookies||t&&r}hasActiveAccessToken(e){let t=p0.parse(this.getToken(e));return null!==t&&!t.isExpired(30)}authenticate(e){return this.authenticateOnce.execute(e)}link(e){return this.linkOnce.execute(e)}refresh(){return this.refreshOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(e,t){"string"==typeof t?h.s.put((0,pV.e)(e),t):h.s.del((0,pV.e)(e))}updateIdentityToken(e){"string"==typeof e?this.storeIdentityToken(e):this.clearIdentityToken()}async _authenticate(e){try{let t=await e.authenticate(),{user:r,is_new_user:n,oauth_tokens:i}=t;this.handleTokenResponse(t);let s=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:i.scopes}:void 0;return this._trackAuthenticateEvents(e,n),{user:(0,u.j)(r),isNewUser:n,oAuthTokens:s}}catch(e){throw console.warn("Error authenticating session"),(0,p.h)(e)}}_trackAuthenticateEvents(e,t){let r=e instanceof yy?"email":e instanceof yC?"
217sms":e instanceof yI?"siwe":e instanceof yg?"guest":e instanceof yh?"custom_auth":e instanceof y_?e.meta.provider:null;r&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:r,isNewUser:t}}),"siwe"===r&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:e.meta.connectorType,walletClientType:e.meta.walletClientType}})}async _link(e){try{let t=await e.link(),r=t.oauth_tokens,n=r?{provider:r.provider,accessToken:r.access_token,accessTokenExpiresInSeconds:r.access_token_expires_in_seconds,refreshToken:r.refresh_token,refreshTokenExpiresInSeconds:r.refresh_token_expires_in_seconds,scopes:r.scopes}:void 0;return{user:(0,u.j)(t),oAuthTokens:n}}catch(e){throw console.warn("Error linking account"),(0,p.h)(e)}}async _refresh(){if(!this.api)throw new p.P("Session has no API instance");if(!this.client)throw new p.P("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let e=this.token,t=this.refreshToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let r;if(!(e&&t||this.mightHaveServerCookies))return null;{let n={};e&&(n.authorization=`Bearer ${e}`),r=await this.api.post(pY.s,t?{refresh_token:t}:{},{headers:n})}return this.handleTokenResponse(r),(0,u.j)(r.user)}catch(e){if(e instanceof p.c&&e.privyErrorCode===p.a.MISSING_OR_INVALID_TOKEN)return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw(0,p.h)(e)}}handleTokenResponse(e){e.session_update_action&&"set"!==e.session_update_action?"clear"===e.session_update_action?this.destroyLocalState():"ignore"===e.session_update_action&&(e.token&&(this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token)),e.identity_token&&this.storeIdentityToken(e.identity_token)):this._storeAllTokens(e)}_storeAllTokens(e){this.storeRefreshToken(e.refresh_token),this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token),e.identity_token&&this.storeIdentityToken(e.identity_token)}async _destroy(){try{await this.api?.post(pY.m,{refresh_token:this.refreshToken})}catch(e){console.warn("Error destroying session")}this.destroyLocalState()}destroyLocalState(){this.storeRefreshToken(null),this.storeCustomerAccessToken(null),this.storePrivyAccessToken(null),this.clearIdentityToken()}storeCustomerAccessToken(e){if("string"==typeof e){let t=h.s.get(pV.d);if(h.s.put(pV.d,e),!this.client?.useServerCookies){let t=p0.parse(e)?.expiration;pQ.A.set(pV.k,e,{sameSite:"Strict",secure:yP(),expires:t?new Date(1e3*t):void 0})}t!==e&&this.client?.onStoreCustomerAccessToken?.(e)}else h.s.del(pV.d),pQ.A.remove(pV.k),this.client?.onDeleteCustomerAccessToken?.()}storeRefreshToken(e){"string"==typeof e?(h.s.put(pV.R,e),this.client?.useServerCookies||pQ.A.set(pV.i,"t",{sameSite:"Strict",secure:yP(),expires:30})):(h.s.del(pV.R),pQ.A.remove(pV.l),pQ.A.remove(pV.i))}storePrivyAccessToken(e){"string"==typeof e?h.s.put(pV.h,e):h.s.del(pV.h)}storeIdentityToken(e){if(yc.setState({identityToken:e}),this.client?.useServerCookies)return;h.s.put(pV.I,e);let t=p0.parse(e)?.expiration;pQ.A.set(pV.m,e,{sameSite:"Strict",secure:yP(),expires:t?new Date(1e3*t):void 0})}clearIdentityToken(){h.s.del(pV.I),yc.setState({identityToken:null}),pQ.A.remove(pV.m)}constructor(){this.authenticateOnce=new yE(async e=>this._authenticate(e)),this.linkOnce=new yE(async e=>this._link(e)),this.refreshOnce=new yE(this._refresh.bind(this)),this.destroyOnce=new yE(this._destroy.bind(this))}}var yN=0,yR="__private_"+yN+++"__getOrGenerateClientAnalyticsId";class yB{getAppId(){return this.appId}initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:t,chains:r,defaultChain:n,store:i,walletList:s,shouldEnforceDefaultChainOnConnect:a,externalWalletConfig:o,appName:l,walletChainType:c,setBaseAccountSdk:u,connectorsDebugLogs:d}){this.connectors||(this.connectors=new yl(this.appId,e,t,r,n,i,s,a,o,l,u,c,d))}generateApi(){let e=new yd({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new p.P("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new p.P("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,t){this.session.storeProviderAccessToken(e,t)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter(e=>
217"cross_app"===e.type).forEach(e=>{this.storeProviderAccessToken(e.providerApp.id,null)})}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(pY.D,{action:"verify"})}catch(e){throw(0,p.f)(e)}}async initMfaPasskeyVerification(){try{let e;return{rpId:(e=(await this.api.post(pY.E,{})).options).rp_id,challenge:e.challenge,allowCredentials:e.allow_credentials?.map(e=>({id:e.id,type:e.type,transports:e.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification}}catch(e){throw(0,p.f)(e)}}async getCrossAppProviderDetails(e){try{return this._cachedProviderAppDetails[e]||(this._cachedProviderAppDetails[e]=await this.api.get(`/api/v1/apps/${e}/cross-app/details`)),this._cachedProviderAppDetails[e]}catch(e){console.error("Error fetching cross app provider details",e)}}async acceptTerms(){try{let e=await this.api.post(pY.F,{});return(0,u.j)(e)}catch(e){throw(0,p.h)(e)}}async unlinkEmail(e){try{let t=await this.api.post(pY.G,{address:e});return await this.getAuthenticatedUser()??(0,u.j)(t)}catch(e){throw(0,p.h)(e)}}async unlinkPhone(e){try{let t=await this.api.post(pY.H,{phoneNumber:e});return await this.getAuthenticatedUser()??(0,u.j)(t)}catch(e){throw(0,p.h)(e)}}async unlinkEthereumWallet(e){try{let t=await this.api.post(pY.I,{address:e});return await this.getAuthenticatedUser()??(0,u.j)(t)}catch(e){throw(0,p.h)(e)}}async unlinkSolanaWallet(e){try{let t=await this.api.post(pY.J,{address:e});return await this.getAuthenticatedUser()??(0,u.j)(t)}catch(e){throw(0,p.h)(e)}}async unlinkOAuth(e,t){try{let r=await this.api.post(pY.K,{provider:e,subject:t});return await this.getAuthenticatedUser()??(0,u.j)(r)}catch(e){throw(0,p.h)(e)}}async unlinkFarcaster(e){try{let t=await this.api.post(pY.L,{fid:e});return await this.getAuthenticatedUser()??(0,u.j)(t)}catch(e){throw(0,p.h)(e)}}async unlinkTelegram(e){try{let t=await this.api.post(pY.M,{telegram_user_id:e});return await this.getAuthenticatedUser()??(0,u.j)(t)}catch(e){throw(0,p.h)(e)}}async revokeDelegatedWallet(){try{await this.api.post(pY.N,{})}catch(e){throw(0,p.h)(e)}}async createAnalyticsEvent({eventName:e,payload:t,timestamp:r,options:n}){if("undefined"!=typeof window)try{if(!this.clientAnalyticsId)return void console.warn("No client analytics id set, refusing to send analytics event");await this.api.post(pY.n,{event_name:e,client_id:this.clientAnalyticsId,payload:{...t||{},clientTimestamp:r?r.toISOString():(new Date).toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(e){try{return this.api.post(pY.O,e)}catch(e){throw(0,p.h)(e)}}async initCoinbaseOnRamp(e){try{return this.api.post(pY.P,e)}catch(e){throw(0,p.h)(e)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`${pY.Q}?partnerUserId=${e}`)}catch(e){throw(0,p.h)(e)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()?this.session.refresh():null}async getAccessToken(e){return await this.getPrivyAccessToken(e)||await this.getCustomerAccessToken(e)}async getCustomerAccessToken(e){return await this._getToken(yT.CUSTOMER,e)}async getPrivyAccessToken(e){return await this._getToken(yT.PRIVY,e)}async _getToken(e,t){if(this.session.getToken(e)){if(this.session.hasActiveAccessToken(e))return this.session.hasRefreshCredentials(e)?p1.parse(this.session.getToken(e))?.appId!==this.appId?(await this.logout(),null):this.session.getToken(e):(this.session.destroyLocalState(),null);{if(t?.disableAutoRefresh||!this.session.hasRefreshCredentials(e))return null;let r=(0,pZ.g)(yf);if(r){let t=async()=>(await this.session.refresh(),this.session.getToken(e));return await r.withRefreshLock({onLeader:t,onFollowerReleased:async()=>this.session.hasActiveAccessToken(e)?this.session.getToken(e):t()})}return await this.session.refresh(),this.session.getToken(e)}}return!t?.disableAutoRefresh&&this.useServerCookies&&this.session.mightHaveServerCookies?(await this.session.refresh(),this.session.getToken(e)):null}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch(t){return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch(e){return void console.error("Unable to fetch token price for SOL")}}async getSplTokenMetadata({mintAddress:e,cluster:t}){try{return await this.api.get(`/api/v1/spl_token_info?mint_address=${e}
217&cluster=${t}`)}catch(r){return void console.error(`Unable to fetch token metadata for ${t}:${e}`)}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(e){throw console.error("Unable to fetch Farcaster signer status"),e}}async generateSiweNonce({address:e,captchaToken:t}){try{return(await this.api.post(pY.R,{address:e,token:t})).nonce}catch(e){throw(0,p.h)(e)}}async authenticateWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i,mode:s}){return await this.api.post(pY.S,{message:e,signature:t,chainId:r,walletClientType:n,connectorType:i,mode:s})}async linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}){return await this.api.post(pY.T,{message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})}async linkSmartWallet({message:e,signature:t,smartWalletType:r,smartWalletVersion:n}){try{let i=await this.api.post(pY.U,{message:e,signature:t,smart_wallet_type:r,smart_wallet_version:n});return(0,u.j)(i)}catch(e){throw(0,p.h)(e)}}async linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}){try{let s=await this.linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i});return(0,u.j)(s)}catch(e){throw(0,p.h)(e)}}async generateSiwsNonce({address:e,captchaToken:t}){try{return(await this.api.post(pY.V,{address:e,token:t})).nonce}catch(e){throw(0,p.h)(e)}}async authenticateWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n,mode:i,messageType:s="plain"}){return await this.api.post(pY.W,{message:e,signature:t,walletClientType:r,connectorType:n,mode:i,message_type:s})}async authenticateWithSiws({message:e,signature:t,walletClientType:r,connectorType:n,mode:i,messageType:s="plain"}){let a=await this.authenticateWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n,mode:i,messageType:s});this.session.handleTokenResponse(a);let o=(0,u.j)(a.user);if(!o)throw Error("Authentication failed - no user returned");return{user:o,isNewUser:a.is_new_user||!1}}async sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:n,telegramAuthResult:i,telegramWebAppData:s,farcasterEmbeddedAddress:a,oAuthUserInfo:o}){try{let l,c;switch(r){case"email":l=pY.a1,c={nonce:e,email:t};break;case"sms":l=pY.a0,c={nonce:e,phoneNumber:t};break;case"siwe":if(l=pY.$,!n)throw Error("Wallet parameters must be defined");c={nonce:e,address:t,...n};break;case"farcaster":l=pY._,c={nonce:e,farcaster_id:t,farcaster_embedded_address:a};break;case"telegram":l=pY.Z,c={nonce:e,telegram_auth_result:i,telegram_web_app_data:s};break;case"siws":l=pY.Y,c={nonce:e,address:t,...n};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:l=pY.X,c={nonce:e,userInfo:o}}let d=await this.api.post(l,c);return await this.getAuthenticatedUser()??(0,u.j)(d)}catch(e){throw(0,p.h)(e)}}async linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n,messageType:i="plain"}){return await this.api.post(pY.a2,{message:e,signature:t,walletClientType:r,connectorType:n,message_type:i})}async linkWithSiws({message:e,signature:t,walletClientType:r,connectorType:n,messageType:i="plain"}){try{let s=await this.linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n,messageType:i});return(0,u.j)(s)}catch(e){throw(0,p.h)(e)}}async updateUserAndIdToken(){try{let e=await this.api.get(pY.a3);return this.session.updateIdentityToken(e.identity_token),(0,u.j)(e.user)}catch(e){throw(0,p.h)(e)}}async scanTransaction(e){try{return await this.api.post(pY.a4,e)}catch(e){throw(0,p.h)(e)}}constructor({apiUrl:e=pV.D,appId:t,appClientId:r,timeout:n=pV.n}){Object.defineProperty(this,yR,{value:yD}),this._cachedProviderAppDetails={},this.apiUrl=e,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=e!==pV.D&&e.startsWith("https://privy."),this.timeout=n,this.appId=t,this.appClientId=r,this.clientAnalyticsId=(function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e})(this,yR)[yR](),a||(a=new yO),this.session=a,this.api=this.generateApi(),this.session.client=this}}function yD(){if("undefined"==typeof window)return null;try{let e=h.s.get(pV.c);if("string"==typeof e&&e.length>0)return e}catch(e){}let e=crypto.randomUUID();try{return h.s.put(pV.c,e),e}catch(t){return e}}function yM(){if(!o)throw new p.P("No global PrivyClient instance found. Please ensure you have initialized the PrivyProvider.");return o}function yU(e){o||(o=new yB({appId:e.appId,appClientId:e.clientId,apiUrl:e.apiUrl}))}async function yj(){let e=yM();return e?e.getAccessToken():Promise.resolve(h.s.get(pV.h)||h.s.get(pV.d)||null)}async function yL(e,t,r,n){let i=(0,pX._r)(e),{chain:s,authorizationList:a,...o}=await (async()=>n?await n():await t.prepareTransactionRequest({...i,account:{address:r,type:"json-rpc"}}))();return{...o,type:pX.kY[o.type],authorizationList:e.authorizationList}}let yF=["calls","feePayer","feePayerSignature","feeToken","keyAuthorization","nonceKey","signature","validBefore","validAfter"],yz=e=>{if(!e||"object"!=typeof e)return!1;if(e.type===pX.iz||"string"==typeof e.type&&e.type.toLowerCase()===pX.W$)return!0;let t=e.account;return!!t?.keyType&&"secp256k1"!==t.keyType||"accessKey"===t?.source||yF.some(t=>void 0!==e[t])},yq=e=>
217({type:pX.iz,from:e.from,chainId:e.chainId,nonce:e.nonce,gasLimit:e.gasLimit??e.gas,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,calls:yW(e),feeToken:yH(e.feeToken),nonceKey:yK(e.nonceKey),validBefore:e.validBefore,validAfter:e.validAfter,feePayerSignature:e.feePayerSignature??void 0,accessList:e.accessList}),yW=e=>{let t=e.calls&&e.calls.length>0?e.calls:e.to?[{to:e.to,data:e.data,value:e.value}]:[];if(0===t.length)throw Error("Tempo transactions require at least one call");return t.map(e=>{if(!e.to)throw Error("Tempo transaction calls require a `to` address");return{to:e.to,data:e.data,value:e.value}})},yH=e=>{if(void 0!==e)return"string"==typeof e?e:`0x20c0${e.toString(16).padStart(36,"0")}`},yK=e=>{if("expiring"!==e&&"random"!==e)return e}},43024:(e,t,r)=>{"use strict";r.d(t,{h:()=>n});let n=r(33032).k},43112:(e,t,r)=>{"use strict";function n(e,t,r){return JSON.stringify(e,(e,r)=>"function"==typeof t?t(e,r):"bigint"==typeof r?r.toString()+"#__bigint":r,r)}r.d(t,{As:()=>n})},43311:(e,t,r)=>{"use strict";r.d(t,{v:()=>i});var n=r(97282);function i({chain:e,currentChainId:t}){if(!e)throw new n.jF;if(t!==e.id)throw new n.EH({chain:e,currentChainId:t})}},43489:(e,t,r)=>{"use strict";r.d(t,{AF:()=>c,Cj:()=>a,D8:()=>n,E3:()=>o,Gb:()=>m,JN:()=>_,Ly:()=>g,Rr:()=>f,Yn:()=>i,ZW:()=>l,_7:()=>u,_h:()=>x,cl:()=>E,i_:()=>h,mZ:()=>s,mf:()=>b,n1:()=>p,nM:()=>y,o9:()=>w,rC:()=>d,uc:()=>v});let n={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},i={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]}
217,default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},s={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},a={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},o={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},l={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},c={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},u={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},d={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},f={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},h={id:0xaa37dc,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},p={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},y={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},m={id:0xaa36a7,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol
217:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},g={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{privy:{http:["https://zora-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},b=[d,m,{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},n,i,f,h,p,y,c,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},o,l,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:56,network:"bsc",name:"Binance Smart Chain",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{privy:{http:["https://bsc-mainnet.rpc.privy.systems"]},default:{http:["https://56.rpc.thirdweb.com"]},public:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{etherscan:{name:"BscScan",url:"https://bscscan.com"},default:{name:"BscScan",url:"https://bscscan.com"}}},{id:43419,name:"Gunz Mainnet",network:"gunz",nativeCurrency:{name:"GUN",symbol:"GUN",decimals:18},rpcUrls:{privy:{http:["https://gunz-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.gunzchain.io/ext/bc/2M47TxWHGnhNtq6pM5zPXdATBtuqubxn5EPFgFmEawCQr9WFML/rpc"]},public:{http:["https://rpc.gunzchain.io/ext/bc/2M47TxWHGnhNtq6pM5zPXdATBtuqubxn5EPFgFmEawCQr9WFML/rpc"]}},blockExplorers:{default:{name:"Gunz Explorer",url:"https://gunzscan.io"}}},{id:13371,name:"Immutable zkEVM",network:"immutable-zkevm",nativeCurrency:{name:"Immutable Coin",symbol:"IMX",decimals:18},rpcUrls:{privy:{http:["https://immutable-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.immutable.com"]},public:{http:["https://rpc.immutable.com"]}},blockExplorers:{default:{name:"Immutable Explorer",url:"https://explorer.immutable.com"}}},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol
217:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},u,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},{id:1088,name:"Metis Andromeda",network:"metis",nativeCurrency:{name:"Metis",symbol:"METIS",decimals:18},rpcUrls:{privy:{http:["https://metis-mainnet.rpc.privy.systems"]},default:{http:["https://andromeda.metis.io/?owner=1088","https://metis-mainnet.public.blastapi.io"]},public:{http:["https://andromeda.metis.io/?owner=1088","https://metis-mainnet.public.blastapi.io"]}},blockExplorers:{default:{name:"Metis Explorer",url:"https://explorer.metis.io"}}},s,a,{id:1868,name:"Soneium Mainnet",network:"soneium",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://soneium-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.soneium.org"]},public:{http:["https://rpc.soneium.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://soneium.blockscout.com"}}},{id:130,name:"Unichain",network:"unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://unichain-mainnet.rpc.privy.systems"]},default:{http:["https://mainnet.unichain.org"]},public:{http:["https://mainnet.unichain.org"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz"}}},g,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:0x3b9ac9ff,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],w=new Set(b.map(e=>e.id));function v(e){let t=e.filter(e=>!w.has(e.id));return b.concat(t)}let x=e=>e.map(e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=b.find(t=>t.id===e.id)?.rpcUrls.privy?.http[0];return t?function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}(e,t):e}),_={id:999,name:"HyperEVM Mainnet",network:"hyperevm",nativeCurrency:{name:"HYPE",symbol:"HYPE",decimals:18},rpcUrls:{privy:{http:["https://hyperevm-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.hyperliquid.xyz/evm"]},public:{http:["https://rpc.hyperliquid.xyz/evm"]}},blockExplorers:{default:{name:"HyperEVM Mainnet Explorer",url:""}}},E={id:143,name:"Monad",network:"monad",nativeCurrency:{name:"Monad",symbol:"MON",decimals:18},rpcUrls:{privy:{http:["https://monad-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.monad.xyz"]},public:{http:["https://rpc.monad.xyz"]}},blockExplorers:{default:{name:"Monadscan",url:"https://mainnet-beta.monvision.io"}}}},43793:(e,t,r)=>{"use strict";r.d(t,{sc:()=>n});let n=r(18775).sc},43794:(e,t,r)=>{"use strict";r.d(t,{BD:()=>i,D5:()=>n,Ge:()=>s});let n=/^(.*)\[([0-9]*)\]$/,i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,s=/^(u?int)(8|
21716|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/},44037:(e,t,r)=>{"use strict";r.d(t,{$P:()=>l,My:()=>c,cK:()=>u,i3:()=>f,nj:()=>o});var n=r(65636),i=r(27931),s=r(36174);let a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function o(e,t={}){return"number"==typeof e||"bigint"==typeof e?u(e,t):"string"==typeof e?f(e,t):"boolean"==typeof e?l(e,t):c(e,t)}function l(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?((0,s.Sl)(r,{size:t.size}),(0,i.eV)(r,{size:t.size})):r}function c(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=a[e[t]];let n=`0x${r}`;return"number"==typeof t.size?((0,s.Sl)(n,{size:t.size}),(0,i.eV)(n,{dir:"right",size:t.size})):n}function u(e,t={}){let r,{signed:s,size:a}=t,o=BigInt(e);a?r=s?(1n<<8n*BigInt(a)-1n)-1n:2n**(8n*BigInt(a))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let l="bigint"==typeof r&&s?-r-1n:0;if(r&&o>r||o<l){let t="bigint"==typeof e?"n":"";throw new n.Ty({max:r?`${r}${t}`:void 0,min:`${l}${t}`,signed:s,size:a,value:`${e}${t}`})}let c=`0x${(s&&o<0?(1n<<BigInt(8*a))+BigInt(o):o).toString(16)}`;return a?(0,i.eV)(c,{size:a}):c}let d=new TextEncoder;function f(e,t={}){return c(d.encode(e),t)}},44116:(e,t,r)=>{"use strict";r.d(t,{BC:()=>c,Iz:()=>d,Ul:()=>f,nZ:()=>l});var n=r(31911),i=r(5635);function s(e,t){let[r,n]=e.split(RegExp(`((?!${t}).*)`));return[r,n]}function a(e,t){let r=BigInt(t.length),n=0n;for(let i of e)n*=r,n+=BigInt(t.indexOf(i));return n}var o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",l=()=>(e=>(0,i.xv)({getSizeFromValue:t=>{let[r,n]=s(t,e[0]);if(!n)return t.length;let i=a(n,e);return r.length+Math.ceil(i.toString(16).length/2)},write(t,r,i){if(!function(e,t,r=t){if(!t.match(RegExp(`^[${e}]*$`)))throw new n.tsw(n.mZ_,{alphabet:e,base:e.length,value:r})}(e,t),""===t)return i;let[o,l]=s(t,e[0]);if(!l)return r.set(new Uint8Array(o.length).fill(0),i),i+o.length;let c=a(l,e),u=[];for(;c>0n;)u.unshift(Number(c%256n)),c/=256n;let d=[...Array(o.length).fill(0),...u];return r.set(d,i),i+d.length}}))(o),c=()=>(e=>(0,i.$C)({read(t,r){let n=0===r?t:t.slice(r);if(0===n.length)return["",0];let i=n.findIndex(e=>0!==e);i=-1===i?n.length:i;let s=e[0].repeat(i);return i===n.length?[s,t.length]:[s+function(e,t){let r=BigInt(t.length),n=[];for(;e>0n;)n.unshift(t[Number(e%r)]),e/=r;return n.join("")}(n.slice(i).reduce((e,t)=>256n*e+BigInt(t),0n),e),t.length]}}))(o),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=()=>(0,i.xv)({getSizeFromValue:e=>{try{return atob(e).length}catch{throw new n.tsw(n.mZ_,{alphabet:u,base:64,value:e})}},write(e,t,r){try{let n=atob(e).split("").map(e=>e.charCodeAt(0));return t.set(n,r),n.length+r}catch{throw new n.tsw(n.mZ_,{alphabet:u,base:64,value:e})}}}),f=()=>(0,i.$C)({read:(e,t=0)=>[btoa(String.fromCharCode(...e.slice(t))),e.length]});globalThis.TextDecoder,globalThis.TextEncoder},44312:(e,t,r)=>{"use strict";r.d(t,{Uf:()=>a,XW:()=>o,fO:()=>i,jf:()=>s,zR:()=>n});let n="INTERNAL_ERROR",i="SERVER_ERROR",s=[-32700,-32600,-32601,-32602,-32603],a={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[n]:{code:-32603,message:"Internal error"},[i]:{code:-32e3,message:"Server error"}},o=i},44478:(e,t,r)=>{"use strict";r.d(t,{J:()=>l});var n=r(74263),i=r(24654),s=r(5360),a=r(86380),o=r(22760);function l(e){let{abi:t,data:r}=e,l=(0,i.di)(r,0,4),c=t.find(e=>"function"===e.type&&l===(0,s.V)((0,o.B)(e)));if(!c)throw new n.EB(l,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:c.name,args:"inputs"in c&&c.inputs&&c.inputs.length>0?(0,a.n)(c.inputs,(0,i.di)(r,4)):void 0}}},44569:(e,t,r)=>{"use strict";r.d(t,{J:()=>s});var n=r(62610);function i(e){return{address:e.address,amount:n.oB(e.amount),index:n.oB(e.index),validatorIndex:n.oB(e.validatorIndex)}}function s(e){return{..."bigint"==typeof e.baseFeePerGas&&{baseFeePerGas:n.oB(e.baseFeePerGas)},..."bigint"==typeof e.blobBaseFee&&{blobBaseFee:n.oB(e.blobBaseFee)},..."string"==typeof e.feeRecipient&&{feeRecipient:e.feeRecipient}
217,..."bigint"==typeof e.gasLimit&&{gasLimit:n.oB(e.gasLimit)},..."bigint"==typeof e.number&&{number:n.oB(e.number)},..."bigint"==typeof e.prevRandao&&{prevRandao:n.oB(e.prevRandao)},..."bigint"==typeof e.time&&{time:n.oB(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(i)}}}},44633:(e,t,r)=>{"use strict";r.d(t,{E:()=>i});var n=r(92733);function i(e){return(0,n.q)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}},44704:(e,t,r)=>{"use strict";r.d(t,{G:()=>n});let n=(0,r(42467).x)({id:0xaa36a7,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://11155111.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:8928790}},testnet:!0})},44775:(e,t,r)=>{"use strict";r.d(t,{t:()=>s});var n=r(32579),i=r(44037);function s(e){let{kzg:t}=e,r=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),s="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,n.aT)(e)):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map(e=>(0,n.aT)(e)):e.commitments,o=[];for(let e=0;e<s.length;e++){let r=s[e],n=a[e];o.push(Uint8Array.from(t.computeBlobKzgProof(r,n)))}return"bytes"===r?o:o.map(e=>(0,i.My)(e))}},44990:(e,t,r)=>{"use strict";r.d(t,{l:()=>i});var n=r(15520);class i extends n.C{constructor({blockHash:e,blockNumber:t}){let r="Block";e&&(r=`Block at hash "${e}"`),t&&(r=`Block at number "${t}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}},45816:(e,t,r)=>{"use strict";r.d(t,{e:()=>d});var n=r(90320),i=r(38619),s=r(29063),a=r(99640),o=r(3832);class l extends o.C{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}var c=r(55212),u=r(20284);function d(e){let t={},r=e.length;for(let n=0;n<r;n++){let r=e[n];if(!(0,c.WL)(r))continue;let i=(0,c.FO)(r);if(!i)throw new a.s7({signature:r,type:"struct"});let s=i.properties.split(";"),o=[],l=s.length;for(let e=0;e<l;e++){let t=s[e].trim();if(!t)continue;let r=(0,u.Pj)(t,{type:"struct"});o.push(r)}if(!o.length)throw new a.X9({signature:r});t[i.name]=o}let o={},d=Object.entries(t),h=d.length;for(let e=0;e<h;e++){let[r,a]=d[e];o[r]=function e(t=[],r={},a=new Set){let o=[],c=t.length;for(let d=0;d<c;d++){let c=t[d];if(n.wj.test(c.type))o.push(c);else{let t=(0,n.Yv)(f,c.type);if(!t?.type)throw new s.nx({abiParameter:c});let{array:d,type:h}=t;if(h in r){if(a.has(h))throw new l({type:h});o.push({...c,type:`tuple${d??""}`,components:e(r[h],r,new Set([...a,h]))})}else if((0,u._o)(h))o.push(c);else throw new i.zz({type:h})}}return o}(a,t)}return o}let f=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/},45850:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(66277),i=r(95912),s=r(71345);let a=e=>e.split("?")[0],o="u">typeof WebSocket?WebSocket:"u">typeof r.g&&"u">typeof r.g.WebSocket?r.g.WebSocket:"u">typeof window&&"u">typeof window.WebSocket?window.WebSocket:"u">typeof self&&"u">typeof self.WebSocket?self.WebSocket:r(4435);class l{constructor(e){if(this.url=e,this.events=new n.EventEmitter,this.registering=!1,!(0,s.isWsUrl)(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return"u">typeof this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u")return void t(Error("Connection already closed"));this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send((0,i.h)(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!(0,s.isWsUrl)(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>
217{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,n)=>{let i=(0,s.isReactNative)()?void 0:{rejectUnauthorized:!(0,s.isLocalhostUrl)(e)},a=new o(e,[],i);"u">typeof WebSocket||"u">typeof r.g&&"u">typeof r.g.WebSocket||"u">typeof window&&"u">typeof window.WebSocket||"u">typeof self&&"u">typeof self.WebSocket?a.onerror=e=>{n(this.emitError(e.error))}:a.on("error",e=>{n(this.emitError(e))}),a.onopen=()=>{this.onOpen(a),t(a)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?(0,i.j)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),n=r.message||r.toString(),i=(0,s.formatJsonRpcError)(e,n);this.events.emit("payload",i)}parseError(e,t=this.url){return(0,s.parseConnectionError)(e,a(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${a(this.url)}`));return this.events.emit("register_error",t),t}}},45897:(e,t,r)=>{"use strict";r.d(t,{BI:()=>E,EB:()=>x,Iy:()=>l,Iz:()=>w,MR:()=>v,M_:()=>b,Nc:()=>u,O:()=>c,Wq:()=>y,YE:()=>f,YF:()=>o,YW:()=>a,ZP:()=>h,_z:()=>m,d_:()=>$,dm:()=>P,fo:()=>A,gH:()=>d,j:()=>S,kE:()=>g,l3:()=>I,nK:()=>C,nM:()=>_,yy:()=>p});var n=r(21394),i=r(21047),s=r(15520);class a extends s.C{constructor({docsPath:e}){super("A constructor was not found on the ABI.\nMake sure you are using the correct ABI and that the constructor exists on it.",{docsPath:e,name:"AbiConstructorNotFoundError"})}}class o extends s.C{constructor({docsPath:e}){super("Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.\nMake sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists.",{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}s.C;class l extends s.C{constructor({data:e,params:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${(0,n.A)(t,{includeName:!0})})`,`Data:   ${e} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=r}}class c extends s.C{constructor({cause:e}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:e})}}class u extends s.C{constructor({expectedLength:e,givenLength:t,type:r}){super(`ABI encoding array length mismatch for type ${r}.
218Expected length: ${e}
219Given length: ${t}`,{name:"AbiEncodingArrayLengthMismatchError"})}}class d extends s.C{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,i.E)(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class f extends s.C{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding params/values length mismatch.
220Expected length (params): ${e}
221Given length (values): ${t}`,{name:"AbiEncodingLengthMismatchError"})}}class h extends s.C{constructor(e,{docsPath:t}){super(`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).
222Cannot encode error result without knowing what the parameter types are.
223Make sure you are using the correct ABI and that the inputs exist on it.`,{docsPath:t,name:"AbiErrorInputsNotFoundError"})}}class p extends s.C{constructor(e,{docsPath:t}={}){super(`Error ${e?`"${e}" `:""}not found on ABI.
224Make sure you are using the correct ABI and that the error exists on it.`,{docsPath:t,name:"AbiErrorNotFoundError"})}}class y extends s.C{constructor(e,{docsPath:t,cause:r}){super(`Encoded error signature "${e}" not found on ABI.
225Make sure you are using the correct ABI and that the error exists on it.
226You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${e}.`,{docsPath:t,name:"AbiErrorSignatureNotFoundError",cause:r}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class m extends s.C{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class g extends s.C{constructor(e,{docsPath:t}){super(`Encoded event signature "${e}" not found on ABI.
227Make sure you are using the correct ABI and that the event exists on it.
228You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`,{docsPath:t,name:"AbiEventSignatureNotFoundError"})}}class b extends s.C{constructor(e,{docsPath:t}={}){super(`Event ${e?`"${e}" `:""}not found on ABI.
229Make sure you are using the correct ABI and that the event exists on it.`,{docsPath:t,name:"AbiEventNotFoundError"})}}class w extends s.C{constructor(e,{docsPath:t}={}){super(`Function ${e?`"${e}" `:""}not found on ABI.
230Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t,name:"AbiFunctionNotFoundError"})}}class v extends s.C{constructor(e,{docsPath:t}){super(`Function "${e}" does not contain any \`outputs\` on ABI.
231Cannot decode function result without knowing what the parameter types are.
232Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t,name:"AbiFunctionOutputsNotFoundError"})}}class x extends s.C{constructor(e,{docsPath:t}){super(`Encoded function signature "${e}" not found on ABI.
233Make sure you are using the correct ABI and that the function exists on it.
234You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`,{docsPath:t,name:"AbiFunctionSignatureNotFoundError"})}}class _ extends s.C{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${(0,n.B)(e.abiItem)}\`, and`,`\`${t.type}\` in \`${(0,n.B)(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class E extends s.C{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`,{name:"BytesSizeMismatchError"})}}class A extends s.C{constructor({abiItem:e,data:t,params:r,size:i}){super(`Data size of ${i} bytes is too small for non-indexed event parameters.`,{metaMessages:[`Params: (${(0,n.A)(r,{includeName:!0})})`,`Data:   ${t} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=r,this.size=i}}class I extends s.C{constructor({abiItem:e,param:t}){super(`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${(0,n.B)(e,{includeName:!0})}".`,{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class C extends s.C{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid encoding type.
235Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiEncodingType"})}}class S extends s.C{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid decoding type.
236Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiDecodingType"})}}class P extends s.C{constructor(e){super(`Value "${e}" is not a valid array.`,{name:"InvalidArrayError"})}}class $ extends s.C{constructor(e){super(`"${e}" is not a valid definition type.
237Valid types: "function", "event", "error"`,{name:"InvalidDefinitionTypeError"})}}s.C},46077:(e,t,r)=>{"use strict";r.d(t,{w:()=>s});var n=r(9146);class i extends n.Vw{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.sd)(e);let r=(0,n.ZJ)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<s.length;e++)s[e]^=54;this.iHash.update(s),this.oHash=e.create();for(let e=0;e<s.length;e++)s[e]^=106;this.oHash.update(s),(0,n.uH)(s)}update(e){return(0,n.CC)(this),this.iHash.update(e),this}digestInto(e){(0,n.CC)(this),(0,n.DO)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:a}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let s=(e,t,r)=>new i(e,t).update(r).digest();s.create=(e,t)=>
237new i(e,t)},46140:(e,t,r)=>{"use strict";r.d(t,{z:()=>s});var n=r(75834),i=r(63455);function s(e,t,r,s){let a=(0,i.Y)(r);(0,n.useEffect)(()=>{if(e)return document.addEventListener(t,r,s),()=>document.removeEventListener(t,r,s);function r(e){a.current(e)}},[e,t,s])}},46461:(e,t)=>{t.read=function(e,t,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,c=l>>1,u=-7,d=r?i-1:0,f=r?-1:1,h=e[t+d];for(d+=f,s=h&(1<<-u)-1,h>>=-u,u+=o;u>0;s=256*s+e[t+d],d+=f,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=n;u>0;a=256*a+e[t+d],d+=f,u-=8);if(0===s)s=1-c;else{if(s===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),s-=c}return(h?-1:1)*a*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var a,o,l,c=8*s-i-1,u=(1<<c)-1,d=u>>1,f=5960464477539062e-23*(23===i),h=n?0:s-1,p=n?1:-1,y=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(a++,l/=2),a+d>=u?(o=0,a=u):a+d>=1?(o=(t*l-1)*Math.pow(2,i),a+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&o,h+=p,o/=256,i-=8);for(a=a<<i|o,c+=i;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}},46501:(e,t,r)=>{"use strict";r.d(t,{Ai:()=>o,UU:()=>s});var n=r(97352),i=r(39633);function s(e){let{batch:t,chain:r,ccipRead:s,dataSuffix:o,key:l="base",name:c="Base Client",tokens:u,type:d="base"}=e,f=e.experimental_blockTag??("number"==typeof r?.experimental_preconfirmationTime?"pending":void 0),h=Math.min(Math.max(Math.floor((r?.blockTime??12e3)/2),500),4e3),p=e.pollingInterval??h,y=e.cacheTime??p,m=e.account?(0,n.J)(e.account):void 0,{config:g,request:b,value:w}=e.transport({account:m,chain:r,pollingInterval:p}),v={account:m,batch:t,cacheTime:y,ccipRead:s,chain:r,dataSuffix:o,key:l,name:c,pollingInterval:p,request:b,tokens:u,transport:{...g,...w},type:d,uid:(0,i.L)(),...f?{experimental_blockTag:f}:{}};return Object.assign(v,{extend:function e(t){return r=>{let n=r(t);for(let e in v)delete n[e];let i={...t,...n};for(let e in n){let r=t[e],s=n[e];a(r)&&a(s)&&(i[e]={...r,...s})}return Object.assign(i,{extend:e(i)})}}(v)})}function a(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function o(e,t){let r=(r={})=>t(e,r);for(let n of["call","calls","callWithPeriod","estimateGas","prepare","prepareRecipient","simulate"])if(Object.hasOwn(t,n)){let i=t[n];r[n]=(t={})=>1===i.length?i(t):i(e,t)}for(let e of["extractEvent","extractEvents"])Object.hasOwn(t,e)&&(r[e]=t[e]);return r}},47240:(e,t,r)=>{"use strict";function n(){let e=()=>void 0,t=()=>void 0;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}}r.d(t,{Y:()=>n})},47450:(e,t,r)=>{"use strict";r.d(t,{CL:()=>l,D5:()=>u,Di:()=>f,G1:()=>k,Gi:()=>c,L5:()=>I,MI:()=>N,RV:()=>_,Sf:()=>x,WT:()=>C,XU:()=>o,YW:()=>y,ab:()=>m,bq:()=>d,cg:()=>P,ch:()=>A,hA:()=>h,hl:()=>S,jz:()=>T,nR:()=>O,qZ:()=>p,s0:()=>g,sV:()=>v,uL:()=>$,vx:()=>w,xQ:()=>b,xq:()=>E});var n=r(99838),i=r(4544);class s extends n.C{constructor(e,{code:t,docsPath:r,metaMessages:n,name:s,shortMessage:a}){super(a,{cause:e,docsPath:r,metaMessages:n||e?.metaMessages,name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof i.J8?e.code:t??-1}}class a extends s{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class o extends s{constructor(e){super(e,{code:o.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(o,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class l extends s{constructor(e){super(e,{code:l.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class c extends s{constructor(e,{method:t}={}){super(e,{code:c.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class u extends s{constructor(e){super(e,{code:u.code,name:"InvalidParamsRpcError",shortMessage:"Invalid parameters were provided to the RPC method.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class d extends s{constructor(e){super(e,{code:d.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class f extends s{constructor(e){super(e,{code:f.code,name:"InvalidInputRpcError",shortMessage:"Missing or invalid parameters.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});
237class h extends s{constructor(e){super(e,{code:h.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class p extends s{constructor(e){super(e,{code:p.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class y extends s{constructor(e){super(e,{code:y.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class m extends s{constructor(e,{method:t}={}){super(e,{code:m.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class g extends s{constructor(e){super(e,{code:g.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class b extends s{constructor(e){super(e,{code:b.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class w extends a{constructor(e){super(e,{code:w.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class v extends a{constructor(e){super(e,{code:v.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class x extends a{constructor(e,{method:t}={}){super(e,{code:x.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class _ extends a{constructor(e){super(e,{code:_.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class E extends a{constructor(e){super(e,{code:E.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class A extends a{constructor(e){super(e,{code:A.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class I extends a{constructor(e){super(e,{code:I.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(I,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class C extends a{constructor(e){super(e,{code:C.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class S extends a{constructor(e){super(e,{code:S.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(S,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class P extends a{constructor(e){super(e,{code:P.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(P,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class $ extends a{constructor(e){super(e,{code:$.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty($,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class k extends a{constructor(e){super(e,{code:k.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(k,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
vendor: 4,739 bytes, line 237
237);class T extends a{constructor(e){super(e,{code:T.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(T,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class O extends a{constructor(e){super(e,{code:O.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(O,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class N extends s{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}},48197:(e,t,r)=>{"use strict";r.d(t,{$:()=>rQ});var n=r(67008),i=r(40407),s=r(10439),a=r(48717),o=r(14558),l=r(44633),c=r(38112),u=r(651),d=r(99838),f=r(97687);function h(e){if(!(e instanceof d.C))return!1;let t=e.walk(e=>e instanceof f.M);return t instanceof f.M&&(t.data?.errorName==="HttpError"||t.data?.errorName==="ResolverError"||t.data?.errorName==="ResolverNotContract"||t.data?.errorName==="ResolverNotFound"||t.data?.errorName==="ReverseAddressMismatch"||t.data?.errorName==="UnsupportedResolverProfile")}var p=r(77030),y=r(50016),m=r(36665),g=r(3303),b=r(92733);function w(e){if(66!==e.length||0!==e.indexOf("[")||65!==e.indexOf("]"))return null;let t=`0x${e.slice(1,65)}`;return(0,b.q)(t)?t:null}function v(e){let t=new Uint8Array(32).fill(0);if(!e)return(0,u.My)(t);let r=e.split(".");for(let e=r.length-1;e>=0;e-=1){let n=w(r[e]),i=n?(0,m.ZJ)(n):(0,g.S)((0,m.Af)(r[e]),"bytes");t=(0,g.S)((0,y.xW)([t,i]),"bytes")}return(0,u.My)(t)}function x(e){let t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);let r=new Uint8Array((0,m.Af)(t).byteLength+2),n=0,i=t.split(".");for(let e=0;e<i.length;e++){var s;let t=(0,m.Af)(i[e]);t.byteLength>255&&(t=(0,m.Af)((s=function(e){let t=new Uint8Array(32).fill(0);return e?w(e)||(0,g.S)((0,m.Af)(e)):(0,u.My)(t)}(i[e]),`[${s.slice(2)}]`))),r[n]=t.length,r.set(t,n+1),n+=t.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}var _=r(29447),E=r(90999);async function A(e,t){let{blockNumber:r,blockTag:d,coinType:f,name:y,gatewayUrls:m,strict:g}=t,{chain:b}=e,w=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!b)throw Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:r,chain:b,contract:"ensUniversalResolver"})})(),A=b?.ensTlds;if(A&&!A.some(e=>y.endsWith(e)))return null;let I=null!=f?[v(y),BigInt(f)]:[v(y)];try{let t=(0,s.p)({abi:n.Rm,functionName:"addr",args:I}),o={address:w,abi:n.Ag,functionName:"resolveWithGateways",args:[(0,u.nj)(x(y)),t,m??[p.J]],blockNumber:r,blockTag:d},h=(0,_.T)(e,E.J,"readContract"),g=await h(o);if("0x"===g[0])return null;let b=function({coinType:e,data:t,args:r}){try{return(0,i.e)({abi:n.Rm,args:r,functionName:"addr",data:t})}catch(n){if(null==e)throw n;let r=(0,c.B)(t);if(20===(0,l.E)(r))return(0,a.b)(r);throw n}}({coinType:f,data:g[0],args:I});if("0x"===b||"0x00"===(0,c.B)(b))return null;return b}catch(e){if(g)throw e;if(h(e))return null;throw e}}class I extends d.C{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class C extends d.C{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class S extends d.C{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class P extends d.C{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}d.C;let $=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,k=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,T=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,O=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function N(e){try{let t=await fetch(e,{method:"HEAD"});if(200===t.status){let e=t.headers.get("content-type");return e?.startsWith("image/")}return!1}catch(t){if("object"==typeof t&&void 0!==t.response||!Object.hasOwn(globalThis,"Image"))return!1;return new Promise(t=>{let r=new Image;r.onload=()=>{t(!0)},r.onerror=()=>{t(!1)},r.src=e})}}function R(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function B({uri:e,gatewayUrls:t}){let r=T.test(e);
vendor: 2,949 bytes, line 237
237if(r)return{uri:e,isOnChain:!0,isEncoded:r};let n=R(t?.ipfs,"https://ipfs.io"),i=R(t?.arweave,"https://arweave.net"),s=e.match($),{protocol:a,subpath:o,target:l,subtarget:c=""}=s?.groups||{},u="ipns:/"===a||"ipns/"===o,d="ipfs:/"===a||"ipfs/"===o||k.test(e);if(e.startsWith("http")&&!u&&!d){let r=e;return t?.arweave&&(r=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:r,isOnChain:!1,isEncoded:!1}}if((u||d)&&l)return{uri:`${n}/${u?"ipns":"ipfs"}/${l}${c}`,isOnChain:!1,isEncoded:!1};if("ar:/"===a&&l)return{uri:`${i}/${l}${c||""}`,isOnChain:!1,isEncoded:!1};let f=e.replace(O,"");if(f.startsWith("<svg")&&(f=`data:image/svg+xml;base64,${btoa(f)}`),f.startsWith("data:")||f.startsWith("{"))return{uri:f,isOnChain:!0,isEncoded:!1};throw new S({uri:e})}function D(e){if("object"!=typeof e||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new I({data:e});return e.image||e.image_url||e.image_data}async function M({gatewayUrls:e,uri:t}){try{let r=await fetch(t).then(e=>e.json());return await U({gatewayUrls:e,uri:D(r)})}catch{throw new S({uri:t})}}async function U({gatewayUrls:e,uri:t}){let{uri:r,isOnChain:n}=B({uri:t,gatewayUrls:e});if(n||await N(r))return r;throw new S({uri:t})}async function j(e,{nft:t}){if("erc721"===t.namespace)return(0,E.J)(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return(0,E.J)(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new P({namespace:t.namespace})}async function L(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?F(e,{gatewayUrls:t,record:r}):U({uri:r,gatewayUrls:t})}async function F(e,{gatewayUrls:t,record:r}){let n=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));let[r,n,i]=t.split("/"),[s,a]=r.split(":"),[o,l]=n.split(":");if(!s||"eip155"!==s.toLowerCase())throw new C({reason:"Only EIP-155 supported"});if(!a)throw new C({reason:"Chain ID not found"});if(!l)throw new C({reason:"Contract address not found"});if(!i)throw new C({reason:"Token ID not found"});if(!o)throw new C({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a,10),namespace:o.toLowerCase(),contractAddress:l,tokenID:i}}(r),{uri:i,isOnChain:s,isEncoded:a}=B({uri:await j(e,{nft:n}),gatewayUrls:t});if(s&&(i.includes("data:application/json;base64,")||i.startsWith("{")))return U({uri:D(JSON.parse(a?atob(i.replace("data:application/json;base64,","")):i)),gatewayUrls:t});let o=n.tokenID;return"erc1155"===n.namespace&&(o=o.replace("0x","").padStart(64,"0")),M({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,o)})}async function z(e,t){let{blockNumber:r,blockTag:a,key:l,name:c,gatewayUrls:d,str
vendor: 4,329 bytes, line 237
237ict:f}=t,{chain:y}=e,m=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!y)throw Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:r,chain:y,contract:"ensUniversalResolver"})})(),g=y?.ensTlds;if(g&&!g.some(e=>c.endsWith(e)))return null;try{let t={address:m,abi:n.Ag,args:[(0,u.nj)(x(c)),(0,s.p)({abi:n.SJ,functionName:"text",args:[v(c),l]}),d??[p.J]],functionName:"resolveWithGateways",blockNumber:r,blockTag:a},o=(0,_.T)(e,E.J,"readContract"),f=await o(t);if("0x"===f[0])return null;let h=(0,i.e)({abi:n.SJ,functionName:"text",data:f[0]});return""===h?null:h}catch(e){if(f)throw e;if(h(e))return null;throw e}}async function q(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:a,universalResolverAddress:o}){let l=await (0,_.T)(e,z,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:i,universalResolverAddress:o,gatewayUrls:s,strict:a});if(!l)return null;try{return await L(e,{record:l,gatewayUrls:n})}catch{return null}}async function W(e,t){let{address:r,blockNumber:i,blockTag:s,coinType:a=60n,gatewayUrls:l,strict:c}=t,{chain:u}=e,d=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!u)throw Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:i,chain:u,contract:"ensUniversalResolver"})})();try{let t={address:d,abi:n.oX,args:[r,a,l??[p.J]],functionName:"reverseWithGateways",blockNumber:i,blockTag:s},o=(0,_.T)(e,E.J,"readContract"),[c]=await o(t);return c||null}catch(e){if(c)throw e;if(h(e))return null;throw e}}async function H(e,t){let{blockNumber:r,blockTag:n,name:i}=t,{chain:s}=e,a=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:r,chain:s,contract:"ensUniversalResolver"})})(),l=s?.ensTlds;if(l&&!l.some(e=>i.endsWith(e)))throw Error(`${i} is not a valid ENS TLD (${l?.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);let[c]=await (0,_.T)(e,E.J,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,u.nj)(x(i))],blockNumber:r,blockTag:n});return c}var K=r(37438),V=r(63710),G=r(25879),J=r(89502),Y=r(95016),Z=r(74869);async function Q(e,t){let{account:r=e.account,blockNumber:n,blockTag:i="latest",blobs:s,data:a,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:f,maxPriorityFeePerGas:h,to:p,value:y,...m}=t,g=r?(0,V.J)(r):void 0;try{(0,Z.c)(t);let r="bigint"==typeof n?(0,u.cK)(n):void 0,b=e.chain?.formatters?.transactionRequest?.format,w=(b||Y.Bv)({...(0,J.o)(m,{format:b}),account:g,blobs:s,data:a,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:f,maxPriorityFeePerGas:h,to:p,value:y},"createAccessList"),v=await e.request({method:"eth_createAccessList",params:[w,r||i]});if(v.error)throw new d.C(v.error,{details:v.error});return{accessList:v.accessList,gasUsed:BigInt(v.gasUsed)}}catch(r){throw(0,G.d)(r,{...t,account:g,chain:e.chain})}}function X(e,{method:t}){let r={};return"fallback"===e.transport.type&&e.transport.onResponse?.(({method:e,response:n,status:i,transport:s})=>{"success"===i&&t===e&&(r[n]=s.request)}),t=>r[t]||e.request}async function ee(e){let t=X(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}var et=r(74263);class er extends d.C{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}var en=r(73142),ei=r(10752),es=r(22760),ea=r(99453);let eo="/docs/contract/encodeEventTopics";function el(e){let{abi:t,eventName:r,args:n}=e,i=t[0];if(r){let e=(0,ea.iY)({abi:t,name:r});if(!e)throw new et.M_(r,{docsPath:eo});i=e}if("event"!==i.type)throw new et.M_(void 0,{docsPath:eo});let s=[];if(n&&"inputs"in i){let e=i.inputs?.filter(e=>"indexed"in e&&e.indexed),t=Array.isArray(n)?n:Object.values(n).length>0?e?.map(e=>n[e.name])??[]:[];t.length>0&&(s=e?.map((e,r)=>Array.isArray(t[r])?t[r].map((n,i)=>ec({param:e,value:t[r][i]})):void 0!==t[r]&&null!==t[r]?ec({param:e,value:t[r]}):null)??[])}if(i.anonymous)return s;let a=(0,es.B)(i);return[(0,en.h)(a),...s]}function ec({param:e,value:t}
237){if("string"===e.type||"bytes"===e.type)return(0,g.S)((0,m.ZJ)(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new er(e.type);return(0,ei.h)([e],[t])}async function eu(e,t){let{address:r,abi:n,args:i,eventName:s,fromBlock:a,strict:o,toBlock:l}=t,c=X(e,{method:"eth_newFilter"}),d=s?el({abi:n,args:i,eventName:s}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:"bigint"==typeof a?(0,u.cK)(a):a,toBlock:"bigint"==typeof l?(0,u.cK)(l):l,topics:d}]});return{abi:n,args:i,eventName:s,id:f,request:c(f),strict:!!o,type:"event"}}async function ed(e,{address:t,args:r,event:n,events:i,fromBlock:s,strict:a,toBlock:o}={}){let l=i??(n?[n]:void 0),c=X(e,{method:"eth_newFilter"}),d=[];l&&(d=[l.flatMap(e=>el({abi:[e],eventName:e.name,args:r}))],n&&(d=d[0]));let f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof s?(0,u.cK)(s):s,toBlock:"bigint"==typeof o?(0,u.cK)(o):o,...d.length?{topics:d}:{}}]});return{abi:l,args:r,eventName:n?n.name:void 0,fromBlock:s,id:f,request:c(f),strict:!!a,toBlock:o,type:"event"}}async function ef(e){let t=X(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}var eh=r(92710),ep=r(18034),ey=r(91855),em=r(42053),eg=r(324),eb=r(84742);async function ew(e,{address:t,blockHash:r,blockNumber:a,blockTag:o=e.experimental_blockTag??"latest",requireCanonical:l}){let c=(0,eb.O)({blockHash:r,blockNumber:a,blockTag:o,requireCanonical:l});if(e.batch?.multicall&&e.chain?.contracts?.multicall3){let c=e.chain.contracts.multicall3.address,u=(0,s.p)({abi:n.v2,functionName:"getEthBalance",args:[t]}),{data:d}=await (0,_.T)(e,K.T,"call")({to:c,data:u,blockHash:r,blockNumber:a,blockTag:o,requireCanonical:l});return(0,i.e)({abi:n.v2,functionName:"getEthBalance",args:[t],data:d||"0x"})}return BigInt(await e.request({method:"eth_getBalance",params:[t,c]}))}async function ev(e){return BigInt(await e.request({method:"eth_blobBaseFee"}))}var ex=r(32560),e_=r(94828),eE=r(12480),eA=r(16025);async function eI(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest"}={}){let i=void 0!==r?(0,u.cK)(r):void 0,s=await e.request({method:"eth_getBlockReceipts",params:[t||i||n]},{dedupe:!!(t||i)});if(!s)throw new eE.l({blockHash:t,blockNumber:r});let a=e.chain?.formatters?.transactionReceipt?.format||eA.uL;return s.map(e=>a(e,"getBlockReceipts"))}var eC=r(5596);async function eS(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){let i,s=void 0!==r?(0,u.cK)(r):void 0;return i=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||n]},{dedupe:!!s}),(0,eC.ME)(i)}var eP=r(40857),e$=r(20234),ek=r(41726),eT=r(86665);async function eO(e,{address:t,blockHash:r,fromBlock:n,toBlock:i,event:s,events:a,args:o,strict:l}={}){let c=a??(s?[s]:void 0),d=[];c&&(d=[c.flatMap(e=>el({abi:[e],eventName:e.name,args:a?void 0:o}))],s&&(d=d[0]));let f=(r?await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:"bigint"==typeof n?(0,u.cK)(n):n,toBlock:"bigint"==typeof i?(0,u.cK)(i):i}]})).map(e=>(0,eT.e)(e));return c?(0,ek.p)({abi:c,args:o,logs:f,strict:l??!1}):f}async function eN(e,t){let{abi:r,address:n,args:i,blockHash:s,eventName:a,fromBlock:o,toBlock:l,strict:c}=t,u=a?(0,ea.iY)({abi:r,name:a}):void 0,d=u?void 0:r.filter(e=>"event"===e.type);return(0,_.T)(e,eO,"getLogs")({address:n,args:i,blockHash:s,event:u,events:d,fromBlock:o,toBlock:l,strict:c})}var eR=r(24654);async function eB(e,{address:t,blockNumber:r,blockTag:n="latest"}){let i=await (0,e$.Q)(e,{address:t,...void 0!==r?{blockNumber:r}:{blockTag:n}});if(i&&23===(0,l.E)(i)&&i.startsWith("0xef0100"))return(0,a.b)((0,eR.di)(i,3,23))}class eD extends d.C{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function eM(e,t){let{address:r,factory:n,factoryData:i}=t;try{let[t,s,a,o,l,c,u]=await (0,_.T)(e,E.J,"readContract")({abi:eU,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:s,version:a,chainId:Number(o),verifyingContract:l,salt:c},extensions:u,fields:t}}catch(e){if("ContractFunctionExecutionError"===e.name&&"ContractFunctionZeroDataError"===e.cause.name)throw new eD({address:r});throw e}}let eU=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];async function ej(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){var s;let a="bigint"==typeof r?(0,u.cK)(r):void 0;return{baseFeePerGas:(s=await e.request({method:"eth_feeHistory",params:[(0,u.cK)(t),a||n,i]},{dedupe:!!a})).baseFeePerGas.map(e=>BigInt(e)),gasUsedRatio:s.gasUsedRatio,oldestBlock:BigInt(s.oldestBlock),reward:s.reward?.map(e=>e.map(e=>BigInt(e)))}}async function eL(e,{filter:t}){let r="strict"in t&&t.strict,n=await t.request({method:"eth_getFilterChanges",params:[t.id]});if("string"==typeof n[0])return n;let i=n.map(e=>(0,eT.e)(e));return"abi"in t&&t.abi?(0,ek.p)({abi:t.abi,logs:i,strict:r}):i}async function eF(e,{filter:t}){let r=t.strict??!1,n=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(e=>(0,eT.e)(e));return t.abi?(0,ek.p)({abi:t.abi,logs:n,strict:r}):n}var ez=r(82497);async function eq(e,{address:t,blockHash:r,blockNumber:n,blockTag:i="latest",requireCanonical:s,storageKeys:a}){let o=(0,eb.O)({blockHash:r,blockNumber:n,blockTag:i,requireCanonical:s});var l=await e.request({method:"eth_getProof",params:[t,a,o]});return{...l,balance:l.balance?BigInt(l.balance):void 0,nonce:l.nonce?(0,eC.ME)(l.nonce):void 0,storageProof:l.storageProof?l.storageProof.map(e=>
vendor: 5,614 bytes, line 237
237({...e,value:BigInt(e.value)})):void 0}}var eW=r(68145);async function eH(e,{hash:t}){let r=await e.request({method:"eth_getRawTransactionByHash",params:[t]},{dedupe:!0});if(!r)throw new eW.Kz({hash:t});return r}async function eK(e,{address:t,blockHash:r,blockNumber:n,blockTag:i="latest",requireCanonical:s,slot:a}){let o=(0,eb.O)({blockHash:r,blockNumber:n,blockTag:i,requireCanonical:s});return await e.request({method:"eth_getStorageAt",params:[t,a,o]})}var eV=r(41537);async function eG(e,{hash:t,transactionReceipt:r}){let[n,i]=await Promise.all([(0,_.T)(e,e_.G,"getBlockNumber")({}),t?(0,_.T)(e,eV.x,"getTransaction")({hash:t}):void 0]),s=r?.blockNumber||i?.blockNumber;return s?n-s+1n:0n}var eJ=r(1232),eY=r(50963),eZ=r(99842),eQ=r(61349);async function eX(e,t){let{account:r,authorizationList:a,allowFailure:l=!0,blockHash:c,blockNumber:u,blockOverrides:h,blockTag:p,requireCanonical:y,stateOverride:m}=t,g=t.contracts,{batchSize:b=t.batchSize??1024,deployless:w=t.deployless??!1}="object"==typeof e.batch?.multicall?e.batch.multicall:{},v=(()=>{if(t.multicallAddress)return t.multicallAddress;if(w)return null;if(e.chain)return(0,o.M)({blockNumber:u,chain:e.chain,contract:"multicall3"});throw Error("client chain not configured. multicallAddress is required.")})(),x=[[]],A=0,I=0;for(let e=0;e<g.length;e++){let{abi:t,address:n,args:i,functionName:a}=g[e];try{let e=(0,s.p)({abi:t,args:i,functionName:a});I+=(e.length-2)/2,b>0&&I>b&&x[A].length>0&&(A++,I=(e.length-2)/2,x[A]=[]),x[A]=[...x[A],{allowFailure:!0,callData:e,target:n}]}catch(s){let e=(0,eQ.j)(s,{abi:t,address:n,args:i,docsPath:"/docs/contract/multicall",functionName:a,sender:r});if(!l)throw e;x[A]=[...x[A],{allowFailure:!0,callData:"0x",target:n}]}}let C=await Promise.allSettled(x.map(t=>(0,_.T)(e,E.J,"readContract")({...null===v?{code:eZ.Ez}:{address:v},abi:n.v2,account:r,args:[t],authorizationList:a,blockHash:c,blockNumber:u,blockOverrides:h,blockTag:p,functionName:"aggregate3",requireCanonical:y,stateOverride:m}))),S=[];for(let e=0;e<C.length;e++){let t=C[e];if("rejected"===t.status){if(!l)throw t.reason;for(let r=0;r<x[e].length;r++)S.push({status:"failure",error:t.reason,result:void 0});continue}let r=t.value;for(let t=0;t<r.length;t++){let{returnData:n,success:s}=r[t],{callData:a}=x[e][t],{abi:o,address:c,functionName:u,args:d}=g[S.length];try{if("0x"===a)throw new et.O;if(!s)throw new f.$S({data:n});let e=(0,i.e)({abi:o,args:d,data:n,functionName:u});S.push(l?{result:e,status:"success"}:e)}catch(t){let e=(0,eQ.j)(t,{abi:o,address:c,args:d,docsPath:"/docs/contract/multicall",functionName:u});if(!l)throw e;S.push({error:e,result:void 0,status:"failure"})}}}if(S.length!==g.length)throw new d.C("multicall results mismatch");return S}var e0=r(17068),e1=r(64507),e2=r(76243),e5=r(8042),e6=r(14992);async function e3(e,t){let{blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",blocks:a,returnFullTransactions:o,traceTransfers:l,validation:c}=t;try{let t=[];for(let e of a){let r=e.blockOverrides?e0.J(e.blockOverrides):void 0,n=e.calls.map(e=>{let t=e.account?(0,V.J)(e.account):void 0,r=e.abi?(0,s.p)(e):e.data,n={...e,account:t,data:e.dataSuffix?(0,y.xW)([r||"0x",e.dataSuffix]):r,from:e.from??t?.address};return(0,Z.c)(n),(0,Y.Bv)(n)}),i=e.stateOverrides?(0,e6.yH)(e.stateOverrides):void 0;t.push({blockOverrides:r,calls:n,stateOverrides:i})}let d="bigint"==typeof r?(0,u.cK)(r):void 0;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:t,returnFullTransactions:o,traceTransfers:l,validation:c},d||n]})).map((e,t)=>({...(0,e5.$)(e),calls:e.calls.map((e,r)=>{let{abi:n,args:s,functionName:o,to:l}=a[t].calls[r],c=e.error?.data??e.returnData,u=BigInt(e.gasUsed),d=e.logs?.map(e=>(0,eT.e)(e)),h="0x1"===e.status?"success":"failure",p=n&&"success"===h&&"0x"!==c?(0,i.e)({abi:n,data:c,functionName:o}):null,y=(()=>{let e;if("success"!==h&&("0x"===c?e=new et.O:c&&(e=new f.$S({data:c})),e))return(0,eQ.j)(e,{abi:n??[],address:l??"0x",args:s,functionName:o??"<unknown>"})})();return{data:c,gasUsed:u,logs:d,status:h,..."success"===h?{result:p}:{error:y}}})}))}catch(t){let e=(0,e2.l)(t,{});if(e instanceof e1.RM)throw t;throw e}}var e8=r(38619),e4=r(55212),e9=r(45816),e7=r(20284),te=r(83870),tt=r(74114),tr=r(11577),tn=r(83315);function ti(e,t){if(th(e)>t)throw new tg({givenSize:th(e),maxSize:t})}let ts={zero:48,nine:57,A:65,F:70,a:97,f:102};function ta(e){return e>=ts.zero&&e<=ts.nine?e-ts.zero:e>=ts.A&&e<=ts.F?e-(ts.A-10):e>=ts.a&&e<=ts.f?e-(ts.a-10):void 0}function to(e,t={}){let{dir:r="left"}=t,n=e,i=0;for(let e=0;e<n.length-1;e++)if("0"===n["left"===r?e:n.length-e-1].toString())i++;else break;return"left"===r?n.slice(i):n.slice(0,n.length-i)}var tl=r(73),tc=r(43112);let tu=new TextDecoder,td=new TextEncoder;function tf(e,t={}){let{size:r}=t,n=e;r&&(tl.Sl(e,r),n=tn.M7(e,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);let s=i.length/2,a=new Uint8Array(s);for(let e=0,t=0;e<s;e++){let r=ta(i.charCodeAt(t++)),n=ta(i.charCodeAt(t++));if(void 0===r||void 0===n)throw new tt.C(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);a[e]=r<<4|n}return a}function th(e){return e.length}function tp(e,t={}){let{size:r}=t;void 0!==r&&ti(e,r);let n=tn.uK(e,t);return tn.Ro(n,t)}function ty(e){return to(e,{dir:"left"})}class tm extends tt.C{constructor(e){super(`Bytes value \`${e}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}tt.C;class tg extends tt.C{constructor({givenSize:e,maxSize:t}
vendor: 4,152 bytes, line 237
237){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class tb extends tt.C{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}class tw extends tt.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}function tv(e,t={}){var r;let{as:n="string"==typeof e?"Hex":"Bytes"}=t,i=(0,tr.lY)(e instanceof Uint8Array?e:"string"==typeof e?tf(e):(r=e)instanceof Uint8Array?r:new Uint8Array(r));return"Bytes"===n?i:tn.uK(i)}class tx extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}let t_={checksum:new tx(8192)}.checksum,tE=/^0x[a-fA-F0-9]{40}$/;function tA(e,t={}){let{strict:r=!0}=t;if(!tE.test(e))throw new tS({address:e,cause:new tP});if(r){if(e.toLowerCase()===e)return;if(tI(e)!==e)throw new tS({address:e,cause:new t$})}}function tI(e){if(t_.has(e))return t_.get(e);tA(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=tv(function(e,t={}){let{size:r}=t,n=td.encode(e);return"number"==typeof r?(ti(n,r),function(e,t={}){let{dir:r,size:n=32}=t;if(0===n)return e;if(e.length>n)throw new tw({size:e.length,targetSize:n,type:"Bytes"});let i=new Uint8Array(n);for(let t=0;t<n;t++){let s="right"===r;i[s?t:n-t-1]=e[s?t:e.length-t-1]}return i}(n,{dir:"right",size:r})):n}(t),{as:"Bytes"}),n=t.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&n[e]&&(n[e]=n[e].toUpperCase()),(15&r[e>>1])>=8&&n[e+1]&&(n[e+1]=n[e+1].toUpperCase());let i=`0x${n.join("")}`;return t_.set(e,i),i}function tC(e,t={}){let{strict:r=!0}=t??{};try{return tA(e,{strict:r}),!0}catch{return!1}}class tS extends tt.C{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class tP extends tt.C{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class t$ extends tt.C{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function tk(e){let t=!0,r="",n=0,i="",s=!1;for(let a=0;a<e.length;a++){let o=e[a];if(["(",")",","].includes(o)&&(t=!0),"("===o&&n++,")"===o&&n--,t){if(0===n){if(" "===o&&["event","function","error",""].includes(i))i="";else if(i+=o,")"===o){s=!0;break}continue}if(" "===o){","!==e[a-1]&&","!==r&&",("!==r&&(r="",t=!1);continue}i+=o,r+=o}}if(!s)throw new tt.C("Unable to normalize signature.");return i}function tT(e,t={}){let{prepare:r=!0}=t,n=Array.isArray(e)||"string"==typeof e?function(e){let t;if("string"==typeof e)t=(0,e7.uT)(e);else{let r=(0,e9.e)(e),n=e.length;for(let i=0;i<n;i++){let n=e[i];if(!(0,e4.WL)(n)){t=(0,e7.uT)(n,r);break}}}if(!t)throw new e8.xo({signature:e});return t}(e):e;return{...n,...r?{hash:tR(n)}:{}}}function tO(e,t,r){let n,{args:i=[],prepare:s=!0}=r??{},a=tn.tf(t,{strict:!1}),o=e.filter(e=>a?"function"===e.type||"error"===e.type?tN(e)===tn.di(t,0,4):"event"===e.type&&tR(e)===t:"name"in e&&e.name===t);if(0===o.length)throw new tD({name:t});if(1===o.length)return{...o[0],...s?{hash:tR(o[0])}:{}};for(let e of o){if("inputs"in e){if(!i||0===i.length){if(!e.inputs||0===e.inputs.length)return{...e,...s?{hash:tR(e)}:{}};continue}
vendor: 18,692 bytes, lines 237-239
237if(e.inputs&&0!==e.inputs.length&&e.inputs.length===i.length&&i.every((t,r)=>{let n="inputs"in e&&e.inputs[r];return!!n&&function e(t,r){let n=typeof t,i=r.type;switch(i){case"address":return tC(t,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:if("tuple"===i&&"components"in r)return Object.values(r.components).every((r,n)=>e(Object.values(t)[n],r));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i))return"number"===n||"bigint"===n;if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i))return"string"===n||t instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i))return Array.isArray(t)&&t.every(t=>e(t,{...r,type:i.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}(t,n)})){if(n&&"inputs"in n&&n.inputs){let t=function e(t,r,n){for(let i in t){let s=t[i],a=r[i];if("tuple"===s.type&&"tuple"===a.type&&"components"in s&&"components"in a)return e(s.components,a.components,n[i]);let o=[s.type,a.type];if(o.includes("address")&&o.includes("bytes20")||(o.includes("address")&&o.includes("string")||o.includes("address")&&o.includes("bytes"))&&tC(n[i],{strict:!1}))return o}}(e.inputs,n.inputs,i);if(t)throw new tB({abiItem:e,type:t[0]},{abiItem:n,type:t[1]})}n=e}}}let l=(()=>{if(n)return n;let[e,...t]=o;return{...e,overloads:t}})();if(!l)throw new tD({name:t});return{...l,...s?{hash:tR(l)}:{}}}function tN(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return tO(t,r)}return e[0]})();return tn.di(tR(t),0,4)}function tR(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return tO(t,r)}return e[0]})();return"string"!=typeof t&&"hash"in t&&t.hash?t.hash:tv(tn.sH(function(...e){let t=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return tO(t,r)}return e[0]})();return tk("string"==typeof t?t:te.B(t))}(t)))}class tB extends tt.C{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${tk(te.B(e.abiItem))}\`, and`,`\`${t.type}\` in \`${tk(te.B(t.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class tD extends tt.C{constructor({name:e,data:t,type:r="item"}){super(`ABI ${r}${e?` with name "${e}"`:t?` with data "${t}"`:""} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}tt.C;var tM=r(29063),tU=r(232);let tj=/^(.*)\[([0-9]*)\]$/,tL=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,tF=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,tz=2n**256n-1n;function tq(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=tn.Ej(i)}let r=[],n=[],i=0;for(let s=0;s<e.length;s++){let{dynamic:a,encoded:o}=e[s];a?(r.push(tn.oB(t+i,{size:32})),n.push(o),i+=tn.Ej(o)):r.push(o)}return tn.xW(...r,...n)}function tW(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function tH(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(tH);let r=tW(e.type);return!!(r&&tH({...e,type:r[1]}))}let tK={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new tJ({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new tG({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new tV({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new tV({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===1/0)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};class tV extends tt.C{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class tG extends tt.C{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class tJ extends tt.C{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function tY(e,t,r){let{checksumAddress:n=!1}=r??{};if(e.length!==t.length)throw new t5({expectedLength:e.length,givenLength:t.length});let i=tq(function({checksumAddress:e,parameters:t,values:r}){let n=[];for(let i=0;i<t.length;i++)n.push(function e({checksumAddress:t=!1,parameter:r,value:n}){let i=tW(r.type);if(i){let[s,a]=i;return function(t,r){let{checksumAddress:n,length:i,parameter:s}=r,a=null===i;if(!Array.isArray(t))throw new t6(t);if(!a&&t.length!==i)throw new t1({expectedLength:i,givenLength:t.length,type:`${s.type}[${i}]`});let o=!1,l=[];for(let r=0;r<t.length;r++){let i=e({checksumAddress:n,parameter:s,value:t[r]});i.dynamic&&(o=!0),l.push(i)}if(a||o){let e=tq(l);if(a){let t=tn.oB(l.length,{size:32});return{dynamic:!0,encoded:l.length>0?tn.xW(t,e):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:tn.xW(...l.map(({encoded:e})=>e))}}(n,{checksumAddress:t,length:s,parameter:{...r,type:a}})}if("tuple"===r.type)return function(t,r){let{checksumAddress:n,parameter:i}=r,s=!1,a=[];for(let r=0;r<i.components.length;r++){let o=i.components[r],l=Array.isArray(t)?r:o.name,c=e({checksumAddress:n,parameter:o,value:t[l]});a.push(c),c.dynamic&&(s=!0)}return{dynamic:s,encoded:s?tq(a):tn.xW(...a.map(({encoded:e})=>e))}}(n,{checksumAddress:t,parameter:r});if("address"===r.type){var s=n,a={checksum:t};let{checksum:e=!1}=a;return tA(s,{strict:e}),{dynamic:!1,encoded:tn.Ho(s.toLowerCase())}}if("bool"===r.type){var o=n;if("boolean"!=typeof o)throw new tt.C(`Invalid boolean value: "${o}" (type: ${typeof o}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:tn.Ho(tn.xb(o))}}if(r.type.startsWith("uint")||r.type.startsWith("int")){let e=r.type.startsWith("int"),[,,t="256"]=tF.exec(r.type)??[];return function(e,{signed:t,size:r}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,i=t?-n-1n:0n;if(e>n||e<i)throw new tn.Ty({max:n.toString(),min:i.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:tn.oB(e,{size:32,signed:t})}}(n,{signed:e,size:Number(t)})}if(r.type.startsWith("bytes"))return function(e,{type:t}){let[,r]=t.split("bytes"),n=tn.Ej(e);if(!r){let t=e;return n%32!=0&&(t=tn.M7(t,32*Math.ceil((e.length-2)/2/32))),{dynamic:!0,encoded:tn.xW(tn.Ho(tn.oB(n,{size:32})),t)}}if(n!==Number.parseInt(r,10))throw new t2({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:tn.M7(e)}}(n,{type:r.type});if("string"===r.type){var l=n;let e=tn.sH(l),t=Math.ceil(tn.Ej(e)/32),r=[];for(let n=0;n<t;n++)r.push(tn.M7(tn.di(e,32*n,(n+1)*32)));return{dynamic:!0,encoded:tn.xW(tn.M7(tn.oB(tn.Ej(e),{size:32})),...r)}}throw new t3(r.type)}({checksumAddress:e,parameter:t[i],value:r[i]}));return n}({checksumAddress:n,parameters:e,values:t}));return 0===i.length?"0x":i}function tZ(e,t){if(e.length!==t.length)throw new t5({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let i=e[n],s=t[n];r.push(tZ.encode(i,s))}return tn.xW(...r)}function tQ(e){return Array.isArray(e)&&"string"==typeof e[0]||"string"==typeof e?function(e){let t=[];if("string"==typeof e){let r=(0,e7.NV)(e),n=r.length;for(let e=0;e<n;e++)t.push((0,e7.Pj)(r[e],{modifiers:e4.Dv}))}else{let r=(0,e9.e)(e),n=e.length;for(let i=0;i<n;i++){let n=e[i];if((0,e4.WL)(n))continue;let s=(0,e7.NV)(n),a=s.length;for(let e=0;e<a;e++)t.push((0,e7.Pj)(s[e],{modifiers:e4.Dv,structs:r}))}}if(0===t.length)throw new tM.A9({params:e});return t}(e):e}(tZ||(tZ={})).encode=function e(t,r,n=!1){if("address"===t)return tA(r),tn.Ho(r.toLowerCase(),32*!!n);if("string"===t)return tn.sH(r);if("bytes"===t)return r;if("bool"===t)return tn.Ho(tn.xb(r),n?32:1);let i=t.match(tF);if(i){let[e,t,s="256"]=i,a=Number.parseInt(s,10)/8;return tn.oB(r,{size:n?32:a,signed:"int"===t})}let s=t.match(tL);if(s){let[e,t]=s;if(Number.parseInt(t,10)!==(r.length-2)/2)throw new t2({expectedSize:Number.parseInt(t,10),value:r});return tn.M7(r,32*!!n)}let a=t.match(tj);if(a&&Array.isArray(r)){let[t,n]=a,i=[];for(let t=0;t<r.length;t++)i.push(e(n,r[t],!0));return 0===i.length?"0x":tn.xW(...i)}throw new t3(t)};class tX extends tt.C{constructor({data:e,parameters:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${tU.Q(t)})`,`Data:   ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class t0 extends tt.C{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class t1 extends tt.C{constructor({expectedLength:e,givenLength:t,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${t}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class t2 extends tt.C{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${tn.Ej(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class t5 extends tt.C{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding parameters/values length mismatch.
238Expected length (parameters): ${e}
239Given length (values): ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class t6 extends tt.C{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class t3 extends tt.C{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function t8(e,t={}){return tT(e,t)}function t4(e,t,r){let n=tO(e,t,r);if("function"!==n.type)throw new tD({name:t,type:"function"});return n}let t9="0x0000000000000000000000000000000000000000";async function t7(e,t){let{blockNumber:r,blockTag:n,calls:i,stateOverrides:a,traceAssetChanges:o,traceTransfers:l,validation:c}=t,u=t.account?(0,V.J)(t.account):void 0;if(o&&!u)throw new d.C("`account` is required when `traceAssetChanges` is true");let f=u?function(...e){let[t,r]=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return[function(e){let t=e.find(e=>"constructor"===e.type);if(!t)throw new tD({name:"constructor"});return t}(t),r]}return e})(),{bytecode:n,args:i}=r;return tn.xW(n,t.inputs?.length&&i?.length?tY(t.inputs,i):"0x")}(tT("constructor(bytes, bytes)"),{bytecode:eZ.LX,args:["0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",function(...e){let[t,r=[]]=(()=>{if(Array.isArray(e[0])){let[t,r,n]=e;return[t4(t,r,{args:n}),n]}let[t,r]=e;return[t,r]})(),{overloads:n}=t,i=n?t4([t,...n],t.name,{args:r}):t,s=tN(i),a=r.length>0?tY(i.inputs,r):void 0;return a?tn.xW(s,a):s}(t8("function getBalance(address)"),[u.address])]}):void 0,h=o?await Promise.all(t.calls.map(async t=>{if(!t.data&&!t.abi)return;let{accessList:r}=await Q(e,{account:u.address,...t,data:t.abi?(0,s.p)(t):t.data});return r.map(({address:e,storageKeys:t})=>t.length>0?e:null)})).then(e=>e.flat().filter(Boolean)):[],p=await e3(e,{blockNumber:r,blockTag:n,blocks:[...o?[{calls:[{data:f}],stateOverrides:a},{calls:h.map((e,t)=>({abi:[t8("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:t9,nonce:t})),stateOverrides:[{address:t9,nonce:0}]}]:[],{calls:[...i,{to:t9}].map(e=>({...e,from:u?.address})),stateOverrides:a},...o?[{calls:[{data:f}]},{calls:h.map((e,t)=>({abi:[t8("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:t9,nonce:t})),stateOverrides:[{address:t9,nonce:0}]},{calls:h.map((e,t)=>({to:e,abi:[t8("function decimals() returns (uint256)")],functionName:"decimals",from:t9,nonce:t})),stateOverrides:[{address:t9,nonce:0}]},{calls:h.map((e,t)=>({to:e,abi:[t8("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:t9,nonce:t})),stateOverrides:[{address:t9,nonce:0}]},{calls:h.map((e,t)=>({to:e,abi:[t8("function symbol() returns (string)")],functionName:"symbol",from:t9,nonce:t})),stateOverrides:[{address:t9,nonce:0}]}]:[]],traceTransfers:l,validation:c}),y=o?p[2]:p[0],[m,g,,b,w,v,x,_]=o?p:[],{calls:E,...A}=y,I=E.slice(0,-1)??[],C=[...m?.calls??[],...g?.calls??[]].map(e=>"success"===e.status?(0,eC.uU)(e.data):null),S=[...b?.calls??[],...w?.calls??[]].map(e=>"success"===e.status?(0,eC.uU)(e.data):null),P=(v?.calls??[]).map(e=>"success"===e.status?e.result:null),$=(_?.calls??[]).map(e=>"success"===e.status?e.result:null),k=(x?.calls??[]).map(e=>"success"===e.status?e.result:null),T=[];for(let[e,t]of S.entries()){let r=C[e];if("bigint"!=typeof t||"bigint"!=typeof r)continue;let n=P[e-1],i=$[e-1],s=k[e-1],a=0===e?{address:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",decimals:18,symbol:"ETH"}:{address:h[e-1],decimals:s||n?Number(n??1):void 0,symbol:i??void 0};T.some(e=>e.token.address===a.address)||T.push({token:a,value:{pre:r,post:t,diff:t-r}})}return{assetChanges:T,block:A,results:I}}var re=r(21989);async function rt(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}let rr="0x6492649264926492649264926492649264926492649264926492649264926492";class rn extends tt.C{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function ri(e,t={}){let{recovered:r}=t;if(void 0===e.r||void 0===e.s||r&&void 0===e.yParity)throw new rl({signature:e});if(e.r<0n||e.r>tz)throw new rc({value:e.r});if(e.s<0n||e.s>tz)throw new ru({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new rd({value:e.yParity})}function rs(e){if(130!==e.length&&132!==e.length)throw new ro({signature:e});let t=BigInt(tn.di(e,0,32)),r=BigInt(tn.di(e,32,64)),n=(()=>{let t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return ra(t)}catch{throw new rd({value:t})}})();return void 0===n?{r:t,s:r}:{r:t,s:r,yParity:n}}function ra(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return+(e%2==0);throw new rf({value:e})}class ro extends tt.C{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${tn.Ej(tn.HT(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class rl extends tt.C{constructor({signature:e}){super(`Signature \`${tc.As(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class rc extends tt.C{constructor({value:e}){super(`Value \`${e}
vendor: 7,738 bytes, line 239
239\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class ru extends tt.C{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class rd extends tt.C{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class rf extends tt.C{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}let rh=tQ("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function rp(e){if("string"==typeof e){if("0x8010801080108010801080108010801080108010801080108010801080108010"!==tn.di(e,-32))throw new ry(e)}else ri(e.authorization)}class ry extends tt.C{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}var rm=r(57813),rg=r(72334),rb=r(9652);async function rw({address:e,authorization:t,signature:r}){return(0,rg.h)((0,a.b)(e),await (0,rb.g)({authorization:t,signature:r}))}var rv=r(91607),rx=r(77424);async function r_(e,t){let{address:r,chain:n=e.chain,hash:i,erc6492VerifierAddress:s=t.universalSignatureVerifierAddress??n?.contracts?.erc6492Verifier?.address,multicallAddress:o=t.multicallAddress??n?.contracts?.multicall3?.address,mode:l="auto"}=t;if(n?.verifyHash)return await n.verifyHash(e,t);let c=(()=>{let e=t.signature;return(0,b.q)(e)?e:"object"==typeof e&&"r"in e&&"s"in e?(0,rx.h)(e):(0,u.My)(e)})();try{if("eoa"===l)try{if((0,rg.h)((0,a.b)(r),await (0,rv.x)({hash:i,signature:c})))return!0}catch{}if(function(e){try{return rp(e),!0}catch{return!1}}(c))return await rE(e,{...t,multicallAddress:o,signature:c});return await rA(e,{...t,verifierAddress:s,signature:c})}catch(e){if("eoa"!==l)try{if((0,rg.h)((0,a.b)(r),await (0,rv.x)({hash:i,signature:c})))return!0}catch{}if(e instanceof rC)return!1;throw e}}async function rE(e,t){let{address:r,blockNumber:i,blockTag:a,hash:o,multicallAddress:l}=t,{authorization:c,data:d,signature:f,to:h}=function(e){rp(e);let t=tn.Ro(tn.di(e,-64,-32)),r=tn.di(e,-t-64,-64),n=tn.di(e,0,-t-64),[i,s,a]=function(e,t,r={}){let{as:n="Array",checksumAddress:i=!1}=r,s="string"==typeof t?tf(t):t,a=function(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(tK);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}(s);if(0===th(s)&&e.length>0)throw new t0;if(th(s)&&32>th(s))throw new tX({data:"string"==typeof t?t:tn.uK(t),parameters:e,size:th(s)});let o=0,l="Array"===n?[]:{};for(let t=0;t<e.length;++t){let r=e[t];a.setPosition(o);let[s,c]=function e(t,r,n){let{checksumAddress:i,staticPosition:s}=n,a=tW(r.type);if(a){let[n,o]=a;return function(t,r,n){let{checksumAddress:i,length:s,staticPosition:a}=n;if(!s){let n=a+tp(t.readBytes(32)),s=n+32;t.setPosition(n);let o=tp(t.readBytes(32)),l=tH(r),c=0,u=[];for(let n=0;n<o;++n){t.setPosition(s+(l?32*n:c));let[a,o]=e(t,r,{checksumAddress:i,staticPosition:s});c+=o,u.push(a)}return t.setPosition(a+32),[u,32]}if(tH(r)){let n=a+tp(t.readBytes(32)),o=[];for(let a=0;a<s;++a){t.setPosition(n+32*a);let[s]=e(t,r,{checksumAddress:i,staticPosition:n});o.push(s)}return t.setPosition(a+32),[o,32]}let o=0,l=[];for(let n=0;n<s;++n){let[n,s]=e(t,r,{checksumAddress:i,staticPosition:a+o});o+=s,l.push(n)}return[l,o]}(t,{...r,type:o},{checksumAddress:i,length:n,staticPosition:s})}if("tuple"===r.type)return function(t,r,n){let{checksumAddress:i,staticPosition:s}=n,a=0===r.components.length||r.components.some(({name:e})=>!e),o=a?[]:{},l=0;if(tH(r)){let n=s+tp(t.readBytes(32));for(let s=0;s<r.components.length;++s){let c=r.components[s];t.setPosition(n+l);let[u,d]=e(t,c,{checksumAddress:i,staticPosition:n});l+=d,o[a?s:c?.name]=u}return t.setPosition(s+32),[o,32]}for(let n=0;n<r.components.length;++n){let c=r.components[n],[u,d]=e(t,c,{checksumAddress:i,staticPosition:s});o[a?n:c?.name]=u,l+=d}return[o,l]}(t,r,{checksumAddress:i,staticPosition:s});if("address"===r.type)return function(e,t={}){let r,{checksum:n=!1}=t,i=e.readBytes(32);return[(r=tn.uK(function(e,t,r,n={}){let{strict:i}=n;!1;let s=e.slice(-20,void 0);return i&&function(e,t,r){if("number"==typeof t&&"number"==typeof r&&th(e)!==r-t)throw new tb({offset:r,position:"end",size:th(e)})}(s,-20,void 0),s}(i,-20)),n?tI(r):r),32]}(t,{checksum:i});if("bool"===r.type)return[function(e,t={}){let{size:r}=t,n=e;if(void 0!==r&&(ti(n,r),n=ty(n)),n.length>1||n[0]>1)throw new tm(n);return!!n[0]}(t.readBytes(32),{size:32}),32];if(r.type.startsWith("bytes"))return function(e,t,{staticPosition:r}){let[n,i]=t.type.split("bytes");if(!i){let t=tp(e.readBytes(32));e.setPosition(r+t);let n=tp(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];let i=e.readBytes(n);return e.setPosition(r+32),[tn.uK(i),32]}return[tn.uK(e.readBytes(Number.parseInt(i,10),32)),32]}(t,r,{staticPosition:s});if(r.type.startsWith("uint")||r.type.startsWith("int")){var o=t,l=r;let e=l.type.startsWith("int"),n=Number.parseInt(l.type.split("int")[1]||"256",10),i=o.readBytes(32);return[n>48?function(e,t={}){let{size:r}=t;void 0!==r&&ti(e,r);let n=tn.uK(e,t);return tn.Dg(n,t)}(i,{signed:e}):tp(i,{signed:e}),32]}if("string"===r.type)return function(e,{staticPosition:t}){let r=tp(e.readBytes(32));e.setPosition(t+r);let n=tp(e.readBytes(32));if(0===n)return e.setPosition(t+32),["",32];let i=function(e,t={}){let{size:r}=t,n=e;return void 0!==r&&(ti(n,r),n=to(n,{dir:"right"})),tu.decode(n)}(ty(e.readBytes(n,32)));return e.setPosition(t+32),[i,32]}(t,{staticPosition:s});throw new t3(r.type)}(a,r,{checksumAddress:i,staticPosition:0});o+=c,"Array"===n?l.push(s):l[r.name??t]=s}return l}(rh,r);return{authorization:function(e,t={}){return"string"==typeof e.chainId?function(e){let{address:t,chainId:r,nonce:n}=e,i=function(e){if(void 0!==e.r&&void 0!==e.s){var t=e;let r=(()=>{var e;if("string"==typeof t)return rs(t);if(t instanceof Uint8Array)return rs(tn.uK(t));return"string"==typeof t.r?function(e){let t=(()=>{let t=e.v?Number(e.v):void 0,r=e.yParity?Number(e.yParity):void 0;if("number"==typeof t&&"number"!=typeof r&&(r=ra(t)),"number"!=typeof r)throw new rd({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}(t):t.v?{r:(e=t).r,s:e.s,yParity:ra(e.v)}:{r:t.r,s:t.s,...void 0!==t.yParity?{yParity:t.yParity}:{}}})();return ri(r),r}}(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...i}}(e):{...e,...t.signature}}({address:i.delegation,chainId:Number(i.chainId),nonce:i.nonce,yParity:i.yParity,r:i.r,s:i.s}),signature:n,...a&&"0x"!==a?{data:a,to:s}:{}}}(t.signature);if(await (0,e$.Q)(e,{address:r,blockNumber:i,blockTag:a})===(0,y.aP)(["0xef0100",c.address]))return await rI(e,{address:r,blockNumber:i,blockTag:a,hash:o,signature:f});let p={address:c.address,chainId:Number(c.chainId),nonce:Number(c.nonce),r:(0,u.cK)(c.r,{size:32}),s:(0,u.cK)(c.s,{size:32}),yParity:c.yParity};if(!await rw({address:r,authorization:p}))throw new rC;let m=await (0,_.T)(e,E.J,"readContract")({...l?{address:l}:{code:eZ.Ez},authorizationList:[p],abi:n.v2,blockNumber:i,blockTag:"pending",functionName:"aggregate3",args:[[...d?[{allowFailure:!0,target:h??r,callData:d}
239]:[],{allowFailure:!0,target:r,callData:(0,s.p)({abi:n.UW,functionName:"isValidSignature",args:[o,f]})}]]}),g=m[m.length-1]?.returnData;if(g?.startsWith("0x1626ba7e"))return!0;throw new rC}async function rA(e,t){let{address:r,factory:i,factoryData:a,hash:o,signature:l,verifierAddress:c,...u}=t,d=await (async()=>{if(!i&&!a||function(e){try{if(tn.di(e,-32)!==rr)throw new rn(e);return!0}catch{return!1}}(l))return l;let{data:e,signature:t,to:r}={data:a,signature:l,to:i};return tn.xW(tY(tQ("address, bytes, bytes"),[r,e,t]),rr)})(),h=c?{to:c,data:(0,s.p)({abi:n.E5,functionName:"isValidSig",args:[r,o,d]}),...u}:{data:(0,rm.m)({abi:n.E5,args:[r,o,d],bytecode:eZ.fT}),...u},{data:p}=await (0,_.T)(e,K.T,"call")(h).catch(e=>{if(e instanceof f.zX)throw new rC;throw e});if((0,eC.Nx)(p??"0x0"))return!0;throw new rC}async function rI(e,t){let{address:r,blockNumber:i,blockTag:s,hash:a,signature:o}=t;if((await (0,_.T)(e,E.J,"readContract")({address:r,abi:n.UW,args:[a,o],blockNumber:i,blockTag:s,functionName:"isValidSignature"}).catch(e=>{if(e instanceof f.bG)throw new rC;throw e})).startsWith("0x1626ba7e"))return!0;throw new rC}class rC extends Error{}var rS=r(24009);async function rP(e,{address:t,message:r,factory:n,factoryData:i,signature:s,...a}){let o=(0,rS.A)(r);return(0,_.T)(e,r_,"verifyHash")({address:t,factory:n,factoryData:i,hash:o,signature:s,...a})}var r$=r(12060);async function rk(e,t){let{address:r,factory:n,factoryData:i,signature:s,message:a,primaryType:o,types:l,domain:c,...u}=t,d=(0,r$.Zh)({message:a,primaryType:o,types:l,domain:c});return(0,_.T)(e,r_,"verifyHash")({address:r,factory:n,factoryData:i,hash:d,signature:s,...u})}var rT=r(62495),rO=r(73260),rN=r(81561),rR=r(19866),rB=r(40508),rD=r(47450),rM=r(25728);let rU=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,rj=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;var rL=r(27526);async function rF(e,t){let{address:r,domain:n,message:i,nonce:s,scheme:a,signature:o,time:l=new Date,...c}=t,u=function(e){let{scheme:t,statement:r,...n}=e.match(rU)?.groups??{},{chainId:i,expirationTime:s,issuedAt:a,notBefore:o,requestId:l,...c}=e.match(rj)?.groups??{},u=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...n,...c,...i?{chainId:Number(i)}:{},...s?{expirationTime:new Date(s)}:{},...a?{issuedAt:new Date(a)}:{},...o?{notBefore:new Date(o)}:{},...l?{requestId:l}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}(i);if(!u.address||!function(e){let{address:t,domain:r,message:n,nonce:i,scheme:s,time:a=new Date}=e;if(r&&n.domain!==r||i&&n.nonce!==i||s&&n.scheme!==s||n.expirationTime&&a>=n.expirationTime||n.notBefore&&a<n.notBefore)return!1;try{if(!n.address||!(0,rL.P)(n.address,{strict:!1})||t&&!(0,rg.h)(n.address,t))return!1}catch{return!1}return!0}({address:r,domain:n,message:u,nonce:s,scheme:a,time:l}))return!1;let d=(0,rS.A)(i);return r_(e,{address:u.address,hash:d,signature:o,...c})}var rz=r(93062);async function rq(e,t){let{account:r,decimals:n,spender:i,token:s,...a}=t,[o,{decimals:l}]=await Promise.all([(0,E.J)(e,{...a,...rq.call(e,{account:r,spender:i,token:s})}),(0,rz.ov)(e,{decimals:n,token:s})]);return(0,rz.cP)(o,l)}(rq||(rq={})).call=function(e,t){return(0,rz.mj)({address:(0,rz.E7)(e,t).address,abi:n.xw,functionName:"allowance",args:[t.account,t.spender]})};var rW=r(92594);async function rH(e,t){let{account:r=e.account,decimals:n,token:i,...s}=t;if(!r)throw new rW.T;let a=(0,V.J)(r).address,[o,{decimals:l}]=await Promise.all([(0,E.J)(e,{...s,...rH.call(e,{account:a,token:i})}),(0,rz.ov)(e,{decimals:n,token:i})]);return(0,rz.cP)(o,l)}async function rK(e,t){let{token:r,...i}=t,{address:s}=(0,rz.E7)(e,{token:r}),a=(0,rz.nh)(e,r),[o,l,c]=await Promise.all([a?.decimals??(0,E.J)(e,{...i,abi:n.xw,address:s,functionName:"decimals"}),a?.name??(0,E.J)(e,{...i,abi:n.xw,address:s,functionName:"name"}),a?.symbol??(0,E.J)(e,{...i,abi:n.xw,address:s,functionName:"symbol"})]);
239return{decimals:o,name:l,symbol:c}}async function rV(e,t){let{decimals:r,token:n,...i}=t,[s,{decimals:a}]=await Promise.all([(0,E.J)(e,{...i,...rV.call(e,{token:n})}),(0,rz.ov)(e,{decimals:r,token:n})]);return(0,rz.cP)(s,a)}(rH||(rH={})).call=function(e,t){let r=t.account??e.account;if(!r)throw new rW.T;let i=(0,V.J)(r).address;return(0,rz.mj)({address:(0,rz.E7)(e,t).address,abi:n.xw,functionName:"balanceOf",args:[i]})},(rV||(rV={})).call=function(e,t){return(0,rz.mj)({address:(0,rz.E7)(e,t).address,abi:n.xw,args:[],functionName:"totalSupply"})};var rG=r(29421),rJ=r(3581),rY=r(89534),rZ=r(14487);function rQ(e){var t;return{call:t=>(0,K.T)(e,t),createAccessList:t=>Q(e,t),createBlockFilter:()=>ee(e),createContractEventFilter:t=>eu(e,t),createEventFilter:t=>ed(e,t),createPendingTransactionFilter:()=>ef(e),estimateContractGas:t=>(0,eh.W)(e,t),estimateGas:t=>(0,ey.Q)(e,t),getBalance:t=>ew(e,t),getBlobBaseFee:()=>ev(e),getBlock:t=>(0,ex.g)(e,t),getBlockNumber:t=>(0,e_.G)(e,t),getBlockReceipts:t=>eI(e,t),getBlockTransactionCount:t=>eS(e,t),getBytecode:t=>(0,e$.Q)(e,t),getChainId:()=>(0,eP.T)(e),getCode:t=>(0,e$.Q)(e,t),getContractEvents:t=>eN(e,t),getDelegation:t=>eB(e,t),getEip712Domain:t=>eM(e,t),getEnsAddress:t=>A(e,t),getEnsAvatar:t=>q(e,t),getEnsName:t=>W(e,t),getEnsResolver:t=>H(e,t),getEnsText:t=>z(e,t),getFeeHistory:t=>ej(e,t),estimateFeesPerGas:t=>(0,ep._)(e,t),getFilterChanges:t=>eL(e,t),getFilterLogs:t=>eF(e,t),getGasPrice:()=>(0,ez.L)(e),getLogs:t=>eO(e,t),getProof:t=>eq(e,t),estimateMaxPriorityFeePerGas:t=>(0,em.b)(e,t),fillTransaction:t=>(0,eg.a)(e,t),getRawTransaction:t=>eH(e,t),getStorageAt:t=>eK(e,t),getTransaction:t=>(0,eV.x)(e,t),getTransactionConfirmations:t=>eG(e,t),getTransactionCount:t=>(0,eJ.y)(e,t),getTransactionReceipt:t=>(0,eY.h)(e,t),multicall:t=>eX(e,t),prepareTransactionRequest:t=>(0,rG.ft)(e,t),readContract:t=>(0,E.J)(e,t),sendRawTransaction:t=>(0,rJ.L)(e,t),sendRawTransactionSync:t=>(0,rY.s)(e,t),simulate:t=>e3(e,t),simulateBlocks:t=>e3(e,t),simulateCalls:t=>t7(e,t),simulateContract:t=>(0,re.v)(e,t),verifyHash:t=>r_(e,t),verifyMessage:t=>rP(e,t),verifySiweMessage:t=>rF(e,t),verifyTypedData:t=>rk(e,t),uninstallFilter:t=>rt(e,t),waitForTransactionReceipt:t=>(0,rT.n)(e,t),watchBlocks:t=>(function(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:a,poll:o,pollingInterval:l=e.pollingInterval}){let c,u,d,f,h=void 0!==o?o:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
239onfig.type&&"ipc"!==e.transport.transports[0].config.type),p=a??!1;return h?(()=>{let a=(0,rB.A)(["watchBlocks",e.uid,t,r,n,p,l]);return(0,rN.lB)(a,{onBlock:i,onError:s},i=>(0,rR.w)(async()=>{try{let n=await (0,_.T)(e,ex.g,"getBlock")({blockTag:t,includeTransactions:p});if(null!==n.number&&c?.number!=null){if(n.number===c.number)return;if(n.number-c.number>1&&r)for(let t=c?.number+1n;t<n.number;t++){let r=await (0,_.T)(e,ex.g,"getBlock")({blockNumber:t,includeTransactions:p});i.onBlock(r,c),c=r}}(c?.number==null||"pending"===t&&n?.number==null||null!==n.number&&n.number>c.number)&&(i.onBlock(n,c),c=n)}catch(e){i.onError?.(e)}},{emitOnBegin:n,interval:l}))})():(u=!0,d=!0,f=()=>u=!1,(async()=>{try{n&&(0,_.T)(e,ex.g,"getBlock")({blockTag:t,includeTransactions:p}).then(e=>{u&&d&&(i(e,void 0),d=!1)}).catch(s);let r=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:a}=await r.subscribe({params:["newHeads"],async onData(t){if(!u)return;let r=await (0,_.T)(e,ex.g,"getBlock")({blockNumber:t.result?.number,includeTransactions:p}).catch(()=>{});u&&(i(r,c),d=!1,c=r)},onError(e){s?.(e)}});f=a,u||f()}catch(e){s?.(e)}})(),()=>f())})(e,t),watchBlockNumber:t=>(0,rO.q)(e,t),watchContractEvent:t=>(function(e,t){let{abi:r,address:n,args:i,batch:s=!0,eventName:a,fromBlock:o,onError:l,onLogs:c,poll:u,pollingInterval:d=e.pollingInterval,strict:f}=t;return(void 0!==u?u:"bigint"==typeof o||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
239onfig.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{let t=f??!1,u=(0,rB.A)(["watchContractEvent",n,i,s,e.uid,a,d,t,o]);return(0,rN.lB)(u,{onLogs:c,onError:l},l=>{let c,u;void 0!==o&&(c=o-1n);let f=!1,h=(0,rR.w)(async()=>{if(!f){try{u=await (0,_.T)(e,eu,"createContractEventFilter")({abi:r,address:n,args:i,eventName:a,strict:t,fromBlock:o})}catch{}f=!0;return}try{let o;if(u)o=await (0,_.T)(e,eL,"getFilterChanges")({filter:u});else{let s=await (0,_.T)(e,e_.G,"getBlockNumber")({});o=c&&c<s?await (0,_.T)(e,eN,"getContractEvents")({abi:r,address:n,args:i,eventName:a,fromBlock:c+1n,toBlock:s,strict:t}):[],c=s}if(0===o.length)return;if(s)l.onLogs(o);else for(let e of o)l.onLogs([e])}catch(e){u&&e instanceof rD.Di&&(f=!1),l.onError?.(e)}},{emitOnBegin:!0,interval:d});return async()=>{u&&await (0,_.T)(e,rt,"uninstallFilter")({filter:u}),h()}})})():(()=>{let t=(0,rB.A)(["watchContractEvent",n,i,s,e.uid,a,d,f??!1]),o=!0,u=()=>o=!1;return(0,rN.lB)(t,{onLogs:c,onError:l},t=>((async()=>{try{let s=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),l=a?el({abi:r,eventName:a,args:i}):[],{unsubscribe:c}=await s.subscribe({params:["logs",{address:n,topics:l}],onData(e){if(!o)return;let n=e.result;try{let{eventName:e,args:i}=(0,rM.j)({abi:r,data:n.data,topics:n.topics,strict:f}),s=(0,eT.e)(n,{args:i,eventName:e});t.onLogs([s])}catch(s){let e,r;if(s instanceof et.fo||s instanceof et.l3){if(f)return;e=s.abiItem.name,r=s.abiItem.inputs?.some(e=>!("name"in e&&e.name))}let i=(0,eT.e)(n,{args:r?[]:{},eventName:e});t.onLogs([i])}},onError(e){t.onError?.(e)}});u=c,o||u()}catch(e){l?.(e)}})(),()=>u()))})()})(e,t),watchEvent:t=>(function(e,{address:t,args:r,batch:n=!0,event:i,events:s,fromBlock:a,onError:o,onLogs:l,poll:c,pollingInterval:u=e.pollingInterval,strict:d}){let f,h,p=void 0!==c?c:"bigint"==typeof a||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
239onfig.type&&"ipc"!==e.transport.transports[0].config.type),y=d??!1;return p?(()=>{let c=(0,rB.A)(["watchEvent",t,r,n,e.uid,i,u,a]);return(0,rN.lB)(c,{onLogs:l,onError:o},o=>{let l,c;void 0!==a&&(l=a-1n);let d=!1,f=(0,rR.w)(async()=>{if(!d){try{c=await (0,_.T)(e,ed,"createEventFilter")({address:t,args:r,event:i,events:s,strict:y,fromBlock:a})}catch{}d=!0;return}try{let a;if(c)a=await (0,_.T)(e,eL,"getFilterChanges")({filter:c});else{let n=await (0,_.T)(e,e_.G,"getBlockNumber")({});a=l&&l!==n?await (0,_.T)(e,eO,"getLogs")({address:t,args:r,event:i,events:s,fromBlock:l+1n,toBlock:n}):[],l=n}if(0===a.length)return;if(n)o.onLogs(a);else for(let e of a)o.onLogs([e])}catch(e){c&&e instanceof rD.Di&&(d=!1),o.onError?.(e)}},{emitOnBegin:!0,interval:u});return async()=>{c&&await (0,_.T)(e,rt,"uninstallFilter")({filter:c}),f()}})})():(f=!0,h=()=>f=!1,(async()=>{try{let n=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),a=s??(i?[i]:void 0),c=[];a&&(c=[a.flatMap(e=>el({abi:[e],eventName:e.name,args:r}))],i&&(c=c[0]));let{unsubscribe:u}=await n.subscribe({params:["logs",{address:t,topics:c}],onData(e){if(!f)return;let t=e.result;try{let{eventName:e,args:r}=(0,rM.j)({abi:a??[],data:t.data,topics:t.topics,strict:y}),n=(0,eT.e)(t,{args:r,eventName:e});l([n])}catch(i){let e,r;if(i instanceof et.fo||i instanceof et.l3){if(d)return;e=i.abiItem.name,r=i.abiItem.inputs?.some(e=>!("name"in e&&e.name))}let n=(0,eT.e)(t,{args:r?[]:{},eventName:e});l([n])}},onError(e){o?.(e)}});h=u,f||h()}catch(e){o?.(e)}})(),()=>h())})(e,t),watchPendingTransactions:t=>(function(e,{batch:t=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=e.pollingInterval}){let a,o;return(void 0!==i?i:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type)?(()=>{let i=(0,rB.A)(["watchPendingTransactions",e.uid,t,s]);return(0,rN.lB)(i,{onTransactions:n,onError:r},r=>{let n,i=(0,rR.w)(async()=>{try{if(!n)try{n=await (0,_.T)(e,ef,"createPendingTransactionFilter")({});return}catch(e){throw i(),e}let s=await (0,_.T)(e,eL,"getFilterChanges")({filter:n});if(0===s.length)return;if(t)r.onTransactions(s);else for(let e of s)r.onTransactions([e])}catch(e){r.onError?.(e)}},{emitOnBegin:!0,interval:s});return async()=>{n&&await (0,_.T)(e,rt,"uninstallFilter")({filter:n}),i()}})})():(a=!0,o=()=>a=!1,(async()=>{try{let{unsubscribe:t}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!a)return;let t=e.result;n([t])},onError(e){r?.(e)}});o=t,a||o()}catch(e){r?.(e)}})(),()=>o())})(e,t),token:(t=e,{getAllowance:(0,rZ.Ai)(t,rq),getBalance:(0,rZ.Ai)(t,rH),getMetadata:(0,rZ.Ai)(t,rK),getTotalSupply:(0,rZ.Ai)(t,rV)})}}},48212:(e,t)=>{"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){let t=r(e);if(!t)throw Error(`${e} is not defined in Window`);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},48241:(e,t,r)=>{"use strict";r.d(t,{zX:()=>g,bG:()=>b,M:()=>w,rR:()=>v,Po:()=>x,$S:()=>_});var n=r(97352),i=r(84940),s=r(74479),a=r(21394),o=r(97314);function l({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map((e,r)=>`${n&&e.name?`${e.name}: `:""}${"object"==typeof t[r]?(0,o.A)(t[r]):t[r]}`).join(", ")})`}var c=r(63547),u=r(18409),d=r(30063),f=r(45897),h=r(15520),p=r(93774),y=r(66471),m=r(86326);class g extends h.C{constructor(e,{account:t,docsPath:r,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:f,to:h,value:m,stateOverride:g}){let b=t?(0,n.J)(t):void 0,w=(0,y.aO)({from:b?.address,to:h,value:void 0!==m&&`${(0,u.c)(m)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:a,gasPrice:void 0!==o&&`${(0,d.Q)(o)} gwei`,maxFeePerGas:void 0!==l&&`${(0,d.Q)(l)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${(0,d.Q)(c)}
239 gwei`,nonce:f});g&&(w+=`
240${(0,p.uj)(g)}`),super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class b extends h.C{constructor(e,{abi:t,args:r,contractAddress:n,docsPath:i,functionName:s,sender:o}){let u=(0,c.iY)({abi:t,args:r,name:s}),d=u?l({abiItem:u,args:r,includeFunctionName:!1,includeName:!1}):void 0,f=u?(0,a.B)(u,{includeName:!0}):void 0,h=(0,y.aO)({address:n&&(0,m.RZ)(n),function:f,args:d&&"()"!==d&&`${[...Array(s?.length??0).keys()].map(()=>" ").join("")}${d}`,sender:o});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],h&&"Contract Call:",h].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=t,this.args=r,this.cause=e,this.contractAddress=n,this.functionName=s,this.sender=o}}class w extends h.C{constructor({abi:e,data:t,functionName:r,message:n,cause:o}){let c,u,d,h,p;if(t&&"0x"!==t)try{let{abiItem:r,errorName:n,args:c}=u=(0,s.W)({abi:e,data:t,cause:o});if("Error"===n)h=c[0];else if("Panic"===n){let[e]=c;h=i.fD[e]}else{let e=r?(0,a.B)(r,{includeName:!0}):void 0,t=r&&c?l({abiItem:r,args:c,includeFunctionName:!1,includeName:!1}):void 0;d=[e?`Error: ${e}`:"",t&&"()"!==t?`       ${[...Array(n?.length??0).keys()].map(()=>" ").join("")}${t}`:""]}}catch(e){c=e}else n&&(h=n);c instanceof f.Wq&&(p=c.signature,d=[`Unable to decode signature "${p}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${p}.`]),super(h&&"execution reverted"!==h||p?[`The contract function "${r}" reverted with the following ${p?"signature":"reason"}:`,h||p].join("\n"):`The contract function "${r}" reverted.`,{cause:c??o,metaMessages:d,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=u,this.raw=t,this.reason=h,this.signature=p}}class v extends h.C{constructor({functionName:e,cause:t}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${e}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:t})}}class x extends h.C{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class _ extends h.C{constructor({data:e,message:t}){super(t||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}},48409:(e,t,r)=>{"use strict";r.d(t,{v:()=>i});var n=r(56260);function i({chain:e,currentChainId:t}){if(!e)throw new n.jF;if(t!==e.id)throw new n.EH({chain:e,currentChainId:t})}},48441:(e,t,r)=>{"use strict";function n(e,t){let r=e.exec(t);return r?.groups}r.d(t,{BD:()=>i,Ge:()=>s,Yv:()=>n,wj:()=>a});let i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,s=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,a=/^\(.+?\).*?$/},48717:(e,t,r)=>{"use strict";r.d(t,{b:()=>u,o:()=>c});var n=r(65409),i=r(36665),s=r(3303),a=r(13108),o=r(27526);let l=new a.A(8192);function c(e,t){if(l.has(`${e}.${t}`))return l.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,s.S)((0,i.Af)(r),"bytes"),a=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&a[e]&&(a[e]=a[e].toUpperCase()),(15&n[e>>1])>=8&&a[e+1]&&(a[e+1]=a[e+1].toUpperCase());let o=`0x${a.join("")}`;return l.set(`${e}.${t}`,o),o}function u(e,t){if(!(0,o.P)(e,{strict:!1}))throw new n.M({address:e});return c(e,t)}},48855:(e,t,r)=>{"use strict";r.d(t,{g:()=>s});var n=r(75834),i=r(56300);function s(...e){return(0,n.useMemo)(()=>(0,i.TW)(...e),[...e])}},49369:(e,t,r)=>{"use strict";r.d(t,{T:()=>u});var n=r(54722),i=r(44775),s=r(40198),a=r(65195),o=r(21047),l=r(32579),c=r(44037);function u(e){let{data:t,kzg:r,to:u}=e,d=e.blobs??function(e){let t=e.to??("string"==typeof e.data?"hex":"bytes"),r="string"==typeof e.data?(0,l.aT)(e.data):e.data,n=(0,o.E)(r);if(!n)throw new s.zF;if(n>761855)throw new s.iq({maxSize:761855,size:n});let i=[],u=!0,d=0;for(;u;){let e=(0,a.l)(new Uint8Array(131072)),t=0;for(;t<4096;){let n=r.slice(d,d+31);if(e.pushByte(0),e.pushBytes(n),n.length<31){e.pushByte(128),u=!1;break}t++,d+=31}i.push(e)}return"bytes"===t?i.map(e=>e.bytes):i.map(e=>(0,c.My)(e.bytes))}({data:t,to:u}),f=e.commitments??(0,n.S)({blobs:d,kzg:r,to:u}),h=e.proofs??(0,i.t)({blobs:d,commitments:f,kzg:r,to:u}),p=[];for(let e=0;e<d.length;e++)p.push({blob:d[e],commitment:f[e],proof:h[e]});return p}},49608:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(10077).A)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},49655:(e,t,r)=>{"use strict";let n;r.d(t,{L:()=>s});let i=256;function s(e=11){if(!n||i+e>512){n="",i=0;for(let e=0;e<256;e++)n+=(256+256*Math.random()|0).toString(16).substring(1)}return n.substring(i,i+++e)}},49731:(e,t,r)=>{"use strict";r.d(t,{Fl:()=>s,NV:()=>a,ii:()=>i});var n=r(99838);class i extends n.C{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class s extends n.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}class a extends n.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${t} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}},49786:(e,t,r)=>{"use strict";r.d(t,{J9:()=>s,Mc:()=>i,fD:()=>n});
240let n={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},i={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},s={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}},50016:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e[0]?i(e):function(e){let t=0;for(let r of e)t+=r.length;let r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return r}(e)}function i(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}r.d(t,{aP:()=>i,xW:()=>n})},50898:(e,t,r)=>{"use strict";r.d(t,{o0:()=>h});var n=r(88304),i=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},s=function(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"},a=function(e){this.version=e,this.type="node",this.name="node",this.os=n.platform},o=function(e,t,r,n){this.name=e,this.version=t,this.os=r,this.bot=n,this.type="bot-device"},l=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},c=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},u=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,d=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],f=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function h(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new c:"undefined"!=typeof navigator?p(navigator.userAgent):void 0!==n&&n.version?new a(n.version.slice(1)):null}function p(e){var t=""!==e&&d.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var s=i.exec(e);return!!s&&[n,s]},!1);if(!t)return null;var r=t[0],n=t[1];if("searchbot"===r)return new l;var a=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);a?a.length<3&&(a=i(i([],a,!0),function(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}(3-a.length),!0)):a=[];var c=a.join("."),h=function(e){for(var t=0,r=f.length;t<r;t++){var n=f[t],i=n[0];if(n[1].exec(e))return i}return null}(e),p=u.exec(e);return p&&p[1]?new o(r,c,h,p[1]):new s(r,c,h)}},50963:(e,t,r)=>{"use strict";r.d(t,{h:()=>s});var n=r(68145),i=r(16025);async function s(e,{hash:t}){let r=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!r)throw new n.Kc({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||i.uL)(r,"getTransactionReceipt")}},51731:(e,t,r)=>{"use strict";var n;function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(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 a(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function o(e){if("function"!=typeof e)throw Error("function expected");return!0}function l(e,t){if("string"!=typeof t)throw Error(`${e}: string expected`);return!0}function c(e){if(!Number.isSafeInteger(e))throw Error(`invalid integer: ${e}`)}function u(e){if(!Array.isArray(e))throw Error("array expected")}function d(e,t){if(!a(!0,t))throw Error(`${e}
240: array of strings expected`)}function f(e,t){if(!a(!1,t))throw Error(`${e}: array of numbers expected`)}function h(...e){let t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map(e=>e.encode).reduceRight(r,t),decode:e.map(e=>e.decode).reduce(r,t)}}function p(e){let t="string"==typeof e?e.split(""):e,r=t.length;d("alphabet",t);let n=new Map(t.map((e,t)=>[e,t]));return{encode:n=>(u(n),n.map(n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]})),decode:t=>(u(t),t.map(t=>{l("alphabet.decode",t);let r=n.get(t);if(void 0===r)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}function y(e=""){return l("join",e),{encode:t=>(d("join.decode",t),t.join(e)),decode:t=>(l("join.decode",t),t.split(e))}}function m(e,t="="){return c(e),l("padding",t),{encode(r){for(d("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){d("padding.decode",r);let n=r.length;if(n*e%8)throw Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if((n-1)*e%8==0)throw Error("padding: invalid, string has too much padding");return r.slice(0,n)}}}function g(e,t,r){if(t<2)throw Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(u(e),!e.length)return[];let n=0,i=[],s=Array.from(e,e=>{if(c(e),e<0||e>=t)throw Error(`invalid integer: ${e}`);return e}),a=s.length;for(;;){let e=0,o=!0;for(let i=n;i<a;i++){let a=s[i],l=t*e,c=l+a;if(!Number.isSafeInteger(c)||l/t!==e||c-a!==l)throw Error("convertRadix: carry overflow");let u=c/r;e=c%r;let d=Math.floor(u);if(s[i]=d,!Number.isSafeInteger(d)||d*r+e!==c)throw Error("convertRadix: carry overflow");o&&(d?o=!1:n=i)}if(i.push(e),o)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}r.d(t,{K3:()=>C,RG:()=>E,_H:()=>S,r0:()=>P,tw:()=>$,uh:()=>T});let b=(e,t)=>0===t?e:b(t,e%t),w=(e,t)=>e+(t-b(e,t)),v=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function x(e,t,r,n){if(u(e),t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw Error(`convertRadix2: wrong to=${r}`);if(w(t,r)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${w(t,r)}`);let i=0,s=0,a=v[t],o=v[r]-1,l=[];for(let n of e){if(c(n),n>=a)throw Error(`convertRadix2: invalid data word=${n} from=${t}`);if(i=i<<t|n,s+t>32)throw Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=r;s-=r)l.push((i>>s-r&o)>>>0);let e=v[s];if(void 0===e)throw Error("invalid carry");i&=e-1}if(i=i<<r-s&o,!n&&s>=t)throw Error("Excess padding");if(!n&&i>0)throw Error(`Non-zero padding: ${i}`);return n&&s>0&&l.push(i>>>0),l}function _(e,t=!1){if(c(e),e<=0||e>32)throw Error("radix2: bits should be in (0..32]");if(w(8,e)>32||w(e,8)>32)throw Error("radix2: carry overflow");return{encode:r=>{if(!i(r))throw Error("radix2.encode input should be Uint8Array");return x(Array.from(r),8,e,!t)},decode:r=>(f("radix2.decode",r),Uint8Array.from(x(r,e,8,t)))}}let E=h(_(5),p("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),m(5),y("")),A="function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64,I=(e,t)=>{if(l("base64",e),e.length>0&&!(t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/).test(e))throw Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64",lastChunkHandling:"strict"})},C=A?{encode:e=>(s(e),e.toBase64()),decode:e=>I(e,!1)}:h(_(6),p("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),m(6),y("")),S=h(_(6),p("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),y("")),P=A?{encode:e=>(s(e),e.toBase64({alphabet:"base64url"})),decode:e=>I(e,!0)}:h(_(6),p("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),m(6),y("")),$=h((n=58,c(58),{encode:e=>{if(!i(e))throw Error("radix.encode input should be Uint8Array");return g(Array.from(e),256,58)},decode:e=>(f("radix.decode",e),Uint8Array.from(g(e,58,256)))}),p("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),y("")),k=h(p("qpzry9x8gf2tvdw0s3jn54
240khce6mua7l"),y("")),T="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex?{encode:e=>(s(e),e.toHex()),decode:e=>(l("hex",e),Uint8Array.fromHex(e))}:h(_(4),p("0123456789abcdef"),y(""),function(e){return o(e),{encode:e=>e,decode:t=>e(t)}}(e=>{if("string"!=typeof e||e.length%2!=0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}))},51807:(e,t,r)=>{"use strict";r.d(t,{DU:()=>tv,AH:()=>tm,i7:()=>t_,I4:()=>tb});var n,i,s,a=r(75834),o="-ms-",l="-moz-",c="-webkit-",u="comm",d="rule",f="decl",h="@keyframes",p=Math.abs,y=String.fromCharCode,m=Object.assign;function g(e,t){return(e=t.exec(e))?e[0]:e}function b(e,t,r){return e.replace(t,r)}function w(e,t,r){return e.indexOf(t,r)}function v(e,t){return 0|e.charCodeAt(t)}function x(e,t,r){return e.slice(t,r)}function _(e){return e.length}function E(e,t){return t.push(e),e}function A(e,t){return e.filter(function(e){return!g(e,t)})}var I=1,C=1,S=0,P=0,$=0,k="";function T(e,t,r,n,i,s,a,o){return{value:e,root:t,parent:r,type:n,props:i,children:s,line:I,column:C,length:a,return:"",siblings:o}}function O(e,t){return m(T("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function N(e){for(;e.root;)e=O(e.root,{children:[e]});E(e,e.siblings)}function R(){return $=P<S?v(k,P++):0,C++,10===$&&(C=1,I++),$}function B(){return v(k,P)}function D(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function M(e){var t,r;return(t=P-1,r=function e(t){for(;R();)switch($){case t:return P;case 34:case 39:34!==t&&39!==t&&e($);break;case 40:41===t&&e(t);break;case 92:R()}return P}(91===e?e+2:40===e?e+1:e),x(k,t,r)).trim()}function U(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function j(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case f:return e.return=e.return||e.value;case u:return"";case h:return e.return=e.value+"{"+U(e.children,n)+"}";case d:if(!_(e.value=e.props.join(",")))return""}return _(r=U(e.children,n))?e.return=e.value+"{"+r+"}":""}function L(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case f:e.return=function e(t,r,n){var i;switch(i=r,45^v(t,0)?(((i<<2^v(t,0))<<2^v(t,1))<<2^v(t,2))<<2^v(t,3):0){case 5103:return c+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return c+t+t;case 4855:return c+t.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+t;case 4789:return l+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return c+t+l+t+o+t+t;case 5936:switch(v(t,r+11)){case 114:return c+t+o+b(t,/[svh]\w+-[tblr]{2}/,"tb")+t;
vendor: 4,626 bytes, line 240
240case 108:return c+t+o+b(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return c+t+o+b(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return c+t+o+t+t;case 6165:return c+t+o+"flex-"+t+t;case 5187:return c+t+b(t,/(\w+).+(:[^]+)/,c+"box-$1$2"+o+"flex-$1$2")+t;case 5443:return c+t+o+"flex-item-"+b(t,/flex-|-self/g,"")+(g(t,/flex-|baseline/)?"":o+"grid-row-"+b(t,/flex-|-self/g,""))+t;case 4675:return c+t+o+"flex-line-pack"+b(t,/align-content|flex-|-self/g,"")+t;case 5548:return c+t+o+b(t,"shrink","negative")+t;case 5292:return c+t+o+b(t,"basis","preferred-size")+t;case 6060:return c+"box-"+b(t,"-grow","")+c+t+o+b(t,"grow","positive")+t;case 4554:return c+b(t,/([^-])(transform)/g,"$1"+c+"$2")+t;case 6187:return b(b(b(t,/(zoom-|grab)/,c+"$1"),/(image-set)/,c+"$1"),t,"")+t;case 5495:case 3959:return b(t,/(image-set\([^]*)/,c+"$1$`$1");case 4968:return b(b(t,/(.+:)(flex-)?(.*)/,c+"box-pack:$3"+o+"flex-pack:$3"),/space-between/,"justify")+c+t+t;case 4200:if(!g(t,/flex-|baseline/))return o+"grid-column-align"+x(t,r)+t;break;case 2592:case 3360:return o+b(t,"template-","")+t;case 4384:case 3616:if(n&&n.some(function(e,t){return r=t,g(e.props,/grid-\w+-end/)}))return~w(t+(n=n[r].value),"span",0)?t:o+b(t,"-start","")+t+o+"grid-row-span:"+(~w(n,"span",0)?g(n,/\d+/):g(n,/\d+/)-g(t,/\d+/))+";";return o+b(t,"-start","")+t;case 4896:case 4128:return n&&n.some(function(e){return g(e.props,/grid-\w+-start/)})?t:o+b(b(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return b(t,/(.+)-inline(.+)/,c+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(_(t)-1-r>6)switch(v(t,r+1)){case 109:if(45!==v(t,r+4))break;case 102:return b(t,/(.+:)(.+)-([^]+)/,"$1"+c+"$2-$3$1"+l+(108==v(t,r+3)?"$3":"$2-$3"))+t;case 115:return~w(t,"stretch",0)?e(b(t,"stretch","fill-available"),r,n)+t:t}break;case 5152:case 5920:return b(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(e,r,n,i,s,a,l){return o+r+":"+n+l+(i?o+r+"-span:"+(s?a:a-n)+l:"")+t});case 4949:if(121===v(t,r+6))return b(t,":",":"+c)+t;break;case 6444:switch(v(t,45===v(t,14)?18:11)){case 120:return b(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+c+(45===v(t,14)?"inline-":"")+"box$3$1"+c+"$2$3$1"+o+"$2box$3")+t;case 100:return b(t,":",":"+o)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return b(t,"scroll-","scroll-snap-")+t}return t}(e.value,e.length,r);return;case h:return U([O(e,{value:b(e.value,"@","@"+c)})],n);case d:if(e.length){var i,s;return i=r=e.props,s=function(t){switch(g(t,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":N(O(e,{props:[b(t,/:(read-\w+)/,":"+l+"$1")]})),N(O(e,{props:[t]})),m(e,{props:A(r,n)});break;case"::placeholder":N(O(e,{props:[b(t,/:(plac\w+)/,":"+c+"input-$1")]})),N(O(e,{props:[b(t,/:(plac\w+)/,":"+l+"$1")]})),N(O(e,{props:[b(t,/:(plac\w+)/,o+"input-$1")]})),N(O(e,{props:[t]})),m(e,{props:A(r,n)})}return""},i.map(s).join("")}}}function F(e,t,r,n,i,s,a,o,l,c,u,f){for(var h=i-1,y=0===i?s:[""],m=y.length,g=0,w=0,v=0;g<n;++g)for(var _=0,E=x(e,h+1,h=p(w=a[g])),A=e;_<m;++_)(A=(w>0?y[_]+" "+E:b(E,/&\f/g,y[_])).trim())&&(l[v++]=A);return T(e,t,r,0===i?d:o,l,c,u,f)}function z(e,t,r,n,i){return T(e,t,r,f,x(e,0,n),x(e,n+1,-1),n,i)}var q=r(88304);let W=void 0!==q&&void 0!==q.env&&(q.env.REACT_APP_SC_ATTR||q.env.SC_ATTR)||"data-styled",H="active",K="data-styled-version",V="6.4.3",G="/*!sc*/\n",J="undefined"!=typeof window&&"undefined"!=typeof document;function Y(e){if(void 0!==q&&void 0!==q.env){let t=q.env[e];if(void 0!==t&&""!==t)return"false"!==t}}let Z=!!("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:null!=(i=null!=(n=Y("REACT_APP_SC_DISABLE_SPEEDY"))?n:Y("SC_DISABLE_SPEEDY"))?i:void 0!==q&&void 0!==q.env&&!1),Q="sc-keyframes-",X={};function ee(e,...t){return Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${e} for more information.${t.length>0?` Args: ${t.join(", ")}`:""}`)}let et=new Map,er=new Map,en=1,ei=e=>{if(et.has(e))return et.get(e);for(;er.has(en);)en++;let t=en++;return et.set(e,t),er.set(t,e),t},es=e=>er.get(e),ea=(e,t)=>{en=t+1,et.set(e,t),er.set(t,e)},eo=Object.freeze([]),el=Object.freeze({});function ec(e,t,r=el){return e.theme!==r.theme&&e.theme||t||r.theme}let eu=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,ed=/(^-|-$)/g;function ef(e){return e.replace(eu,"-").replace(ed,"")}let eh=/(a)(d)/gi,ep=e=>String.fromCharCode(e+(e>25?39:97));function ey(e){let t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=ep(t%52)+r;return(ep(t%52)+r).replace(eh,"$1-$2")}let em=(e,t)=>
240{let r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return e},eg=e=>em(5381,e);function eb(e){return ey(eg(e)>>>0)}function ew(e){return"string"==typeof e}let ev=Symbol.for("react.memo"),ex=Symbol.for("react.forward_ref"),e_={contextType:!0,defaultProps:!0,displayName:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},eE={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},eA={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},eI={[ex]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[ev]:eA};function eC(e){return("type"in e&&e.type.$$typeof)===ev?eA:"$$typeof"in e?eI[e.$$typeof]:e_}let eS=Object.defineProperty,eP=Object.getOwnPropertyNames,e$=Object.getOwnPropertySymbols,ek=Object.getOwnPropertyDescriptor,eT=Object.getPrototypeOf,eO=Object.prototype;function eN(e){return"function"==typeof e}let eR=Symbol.for("react.forward_ref");function eB(e){return null!=e&&("object"==typeof e||"function"==typeof e)&&e.$$typeof===eR&&"styledComponentId"in e}function eD(e,t){return e&&t?e+" "+t:e||t||""}function eM(e,t){return e.join(t||"")}function eU(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ej(e,t){Object.defineProperty(e,"toString",{value:t})}let eL=class{constructor(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}indexOfGroup(e){if(e===this._cGroup)return this._cIndex;let t=this._cIndex;if(e>this._cGroup)for(let r=this._cGroup;r<e;r++)t+=this.groupSizes[r];else for(let r=this._cGroup-1;r>=e;r--)t-=this.groupSizes[r];return this._cGroup=e,this._cIndex=t,t}insertRules(e,t){if(e>=this.groupSizes.length){let t=this.groupSizes,r=t.length,n=r;for(;e>=n;)if((n<<=1)<0)throw ee(16,`${e}`);this.groupSizes=new Uint32Array(n),this.groupSizes.set(t),this.length=n;for(let e=r;e<n;e++)this.groupSizes[e]=0}let r=this.indexOfGroup(e+1),n=0;for(let i=0,s=t.length;i<s;i++)this.tag.insertRule(r,t[i])&&(this.groupSizes[e]++,r++,n++);n>0&&this._cGroup>e&&(this._cIndex+=n)}clearGroup(e){if(e<this.length){let t=this.groupSizes[e],r=this.indexOfGroup(e),n=r+t;this.groupSizes[e]=0;for(let e=r;e<n;e++)this.tag.deleteRule(r);t>0&&this._cGroup>e&&(this._cIndex-=t)}}getGroup(e){let t="";if(e>=this.length||0===this.groupSizes[e])return t;let r=this.groupSizes[e],n=this.indexOfGroup(e),i=n+r;for(let e=n;e<i;e++)t+=this.tag.getRule(e)+G;return t}},eF=`style[${W}][${K}="${V}"]`,ez=RegExp(`^${W}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`),eq=e=>"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot||"host"in e&&11===e.nodeType,eW=e=>{if(!e)return document;if(eq(e))return e;if("getRootNode"in e){let t=e.getRootNode();if(eq(t))return t}return document},eH=(e,t,r)=>{let n,i=r.split(",");for(let r=0,s=i.length;r<s;r++)(n=i[r])&&e.registerName(t,n)},eK=(e,t)=>{var r;let n=(null!=(r=t.textContent)?r:"").split(G),i=[];for(let t=0,r=n.length;t<r;t++){let r=n[t].trim();if(!r)continue;let s=r.match(ez);if(s){let t=0|parseInt(s[1],10),r=s[2];0!==t&&(ea(r,t),eH(e,r,s[3]),e.getTag().insertRules(t,i)),i.length=0}else i.push(r)}},eV=e=>{let t=eW(e.options.target).querySelectorAll(eF);for(let r=0,n=t.length;r<n;r++){let n=t[r];n&&n.getAttribute(W)!==H&&(eK(e,n),n.parentNode&&n.parentNode.removeChild(n))}},eG=!1,eJ=(e,t)=>{let n=document.head,i=e||n,s=document.createElement("style"),a=(e=>{let t=Array.from(e.querySelectorAll(`style[${W}]`));return t[t.length-1]})(i),o=void 0!==a?a.nextSibling:null;s.setAttribute(W,H),s.setAttribute(K,V);let l=t||function(){if(!1!==eG)return eG;if("undefined"!=typeof document){let e=document.head.querySelector('meta[property="csp-nonce"]');if(e)return eG=e.nonce||e.getAttribute("content")||void 0;let t=document.head.querySelector('meta[name="sc-nonce"]');if(t)return eG=t.getAttribute("content")||void 0}return eG=r.nc}();return l&&s.setAttribute("nonce",l),i.insertBefore(s,o),s},eY=class{constructor(e,t){this.element=eJ(e,t),this.element.appendChild(document.createTextNode("")),this.sheet=(e=>{var t;if(e.sheet)return e.sheet;let r=null!=(t=e.getRootNode().styleSheets)?t:document.styleSheets;for(let t=0,n=r.length;t<n;t++){let n=r[t];if(n.ownerNode===e)return n}throw ee(17)})(this.element),this.length=0}insertRule(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}}deleteRule(e){this.sheet.deleteRule(e),this.length--}getRule(e){let t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""}}
240,eZ=class{constructor(e,t){this.element=eJ(e,t),this.nodes=this.element.childNodes,this.length=0}insertRule(e,t){if(e<=this.length&&e>=0){let r=document.createTextNode(t);return this.element.insertBefore(r,this.nodes[e]||null),this.length++,!0}return!1}deleteRule(e){this.element.removeChild(this.nodes[e]),this.length--}getRule(e){return e<this.length?this.nodes[e].textContent:""}},eQ=J,eX={isServer:!J,useCSSOMInjection:!Z};class e0{static registerId(e){return ei(e)}constructor(e=el,t={},r){this.options=Object.assign(Object.assign({},eX),e),this.gs=t,this.keyframeIds=new Set,this.names=new Map(r),this.server=!!e.isServer,!this.server&&J&&eQ&&(eQ=!1,eV(this)),ej(this,()=>(e=>{let t=e.getTag(),{length:r}=t,n="";for(let i=0;i<r;i++){let r=es(i);if(void 0===r)continue;let s=e.names.get(r);if(void 0===s||!s.size)continue;let a=t.getGroup(i);if(0===a.length)continue;let o=W+".g"+i+'[id="'+r+'"]',l="";for(let e of s)e.length>0&&(l+=e+",");n+=a+o+'{content:"'+l+'"}'+G}return n})(this))}rehydrate(){!this.server&&J&&eV(this)}reconstructWithOptions(e,t=!0){let r=new e0(Object.assign(Object.assign({},this.options),e),this.gs,t&&this.names||void 0);return r.keyframeIds=new Set(this.keyframeIds),!this.server&&J&&e.target!==this.options.target&&eW(this.options.target)!==eW(e.target)&&eV(r),r}allocateGSInstance(e){return this.gs[e]=(this.gs[e]||0)+1}getTag(){return this.tag||(this.tag=new eL((({useCSSOMInjection:e,target:t,nonce:r})=>e?new eY(t,r):new eZ(t,r))(this.options)))}hasNameForId(e,t){var r,n;return null!=(n=null==(r=this.names.get(e))?void 0:r.has(t))&&n}registerName(e,t){ei(e),e.startsWith(Q)&&this.keyframeIds.add(e);let r=this.names.get(e);r?r.add(t):this.names.set(e,new Set([t]))}insertRules(e,t,r){this.registerName(e,t),this.getTag().insertRules(ei(e),r)}clearNames(e){this.names.has(e)&&this.names.get(e).clear()}clearRules(e){this.getTag().clearGroup(ei(e)),this.clearNames(e)}clearTag(){this.tag=void 0}}let e1=new WeakSet,e2={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function e5(e){if(45===e.charCodeAt(0)&&45===e.charCodeAt(1))return e;let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t+=n>=65&&n<=90?"-"+String.fromCharCode(n+32):e[r]}return t.startsWith("ms-")?"-"+t:t}let e6=Symbol.for("sc-keyframes");function e3(e){return eN(e)&&!(e.prototype&&e.prototype.isReactComponent)}let e8=e=>
240null==e||!1===e||""===e,e4=Symbol.for("react.client.reference");function e9(e){return e.$$typeof===e4}function e7(e,t,r,n,i=[]){if(e8(e))return i;let s=typeof e;if("string"===s)return i.push(e),i;if("function"===s)return e9(e)?i:e3(e)&&t?e7(e(t),t,r,n,i):(i.push(e),i);if(Array.isArray(e)){for(let s=0;s<e.length;s++)e7(e[s],t,r,n,i);return i}return eB(e)?i.push(`.${e.styledComponentId}`):"object"==typeof e&&null!==e&&e6 in e?r?(e.inject(r,n),i.push(e.getName(n))):i.push(e):e9(e)||(eU(e)?e.toString!==Object.prototype.toString?i.push(e.toString()):function e(t,r){for(let n in t){let i=t[n];t.hasOwnProperty(n)&&!e8(i)&&(Array.isArray(i)&&e1.has(i)||eN(i)?r.push(e5(n)+":",i,";"):eU(i)?(r.push(n+" {"),e(i,r),r.push("}")):r.push(e5(n)+": "+(null==i||"boolean"==typeof i||""===i?"":"number"!=typeof i||0===i||n in e2||n.startsWith("--")?String(i).trim():i+"px")+";"))}}(e,i):i.push(e.toString())),i}let te=eg(V);class tt{constructor(e,t,r){this.rules=e,this.componentId=t,this.baseHash=em(te,t),this.baseStyle=r,e0.registerId(t)}generateAndInjectStyles(e,t,r){let n=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,r):"";{let i="";for(let n=0;n<this.rules.length;n++){let s=this.rules[n];if("string"==typeof s)i+=s;else if(s)if(e3(s)){let n=s(e);"string"==typeof n?i+=n:null!=n&&!1!==n&&(i+=eM(e7(n,e,t,r)))}else i+=eM(e7(s,e,t,r))}if(i){this.dynamicNameCache||(this.dynamicNameCache=new Map);let e=r.hash?r.hash+i:i,s=this.dynamicNameCache.get(e);if(!s){if(s=ey(em(em(this.baseHash,r.hash),i)>>>0),this.dynamicNameCache.size>=200){let e=this.dynamicNameCache.keys().next().value;void 0!==e&&this.dynamicNameCache.delete(e)}this.dynamicNameCache.set(e,s)}if(!t.hasNameForId(this.componentId,s)){let e=r(i,"."+s,void 0,this.componentId);t.insertRules(this.componentId,s,e)}n=eD(n,s)}}return n}}let tr=/&/g;function tn(e,t){let r=0;for(;--t>=0&&92===e.charCodeAt(t);)r++;return!(1&~r)}function ti(e){let t=e.length,r="",n=0,i=0,s=0,a=!1,o=!1;for(let l=0;l<t;l++){let c=e.charCodeAt(l);if(0!==s||a||47!==c||42!==e.charCodeAt(l+1))if(a)42===c&&47===e.charCodeAt(l+1)&&(a=!1,l++);else if(34!==c&&39!==c||tn(e,l)){if(0===s)if(123===c)i++;else if(125===c){if(--i<0){o=!0;let r=l+1;for(;r<t;){let t=e.charCodeAt(r);if(59===t||10===t)break;r++}r<t&&59===e.charCodeAt(r)&&r++,i=0,l=r-1,n=r;continue}0===i&&(r+=e.substring(n,l+1),n=l+1)}else 59===c&&0===i&&(r+=e.substring(n,l+1),n=l+1)}else 0===s?s=c:s===c&&(s=0);else a=!0,l++}return o||0!==i||0!==s?(n<t&&0===i&&0===s&&(r+=e.substring(n)),r):e}let ts=new e0,ta=function({options:e=el,plugins:t=eo}=el){var r,n,i;let s,a,o,l=(e,t,r)=>r.startsWith(a)&&r.endsWith(a)&&r.replaceAll(a,"").length>0?`.${s}`:e,c=t.slice();c.push(e=>{e.type===d&&e.value.includes("&")&&(o||(o=RegExp(`\\${a}\\b`,"g")),e.props[0]=e.props[0].replace(tr,a).replace(o,l))}),e.prefix&&c.push(L),c.push(j);let f=[],h=(i=(n=c.concat((r=e=>f.push(e),function(e){!e.root&&(e=e.return)&&r(e)}))).length,function(e,t,r,s){for(var a="",o=0;o<i;o++)a+=n[o](e,t,r,s)||"";return a}),m=(t,r="",n="",i="&")=>{var l,c,d;s=i,a=r,o=void 0;let m=function(e){let t=-1!==e.indexOf("//"),r=-1!==e.indexOf("}");if(!t&&!r)return e;if(!t)return ti(e);let n=e.length,i="",s=0,a=0,o=0,l=0,c=0,u=!1;for(;a<n;){let t=e.charCodeAt(a);if(34!==t&&39!==t||tn(e,a))if(0===o)if(47===t&&a+1<n&&42===e.charCodeAt(a+1)){for(a+=2;a+1<n&&(42!==e.charCodeAt(a)||47!==e.charCodeAt(a+1));)a++;a+=2}else if(40!==t)if(41!==t)if(l>0)a++;else if(42===t&&a+1<n&&47===e.charCodeAt(a+1))i+=e.substring(s,a),a+=2,s=a,u=!0;else if(47===t&&a+1<n&&47===e.charCodeAt(a+1)){for(i+=e.substring(s,a);a<n&&10!==e.charCodeAt(a);)a++;s=a,u=!0}else 123===t?c++:125===t&&c--,a++;else l>0&&l--,a++;else l++,a++;else a++;else 0===o?o=t:o===t&&(o=0),a++}return u?(s<n&&(i+=e.substring(s)),0===c?i:ti(i)):0===c?e:ti(e)}(t),g=(d=function e(t,r,n,i,s,a,o,l,c){for(var d,f,h,m,g=0,A=0,S=o,O=0,N=0,U=0,j=1,L=1,q=1,W=0,H="",K=s,V=a,G=i,J=H;L;)switch(U=W,W=R()){case 40:if(108!=U&&58==v(J,S-1)){-1!=w(J+=b(M(W),"&","&\f"),"&\f",p(g?l[g-1]:0))&&(q=-1);break}case 34:case 39:case 91:J+=M(W);break;case 9:case 10:case 13:case 32:J+=function(e){for(;$=B();)if($<33)R();else break;return D(e)>
2402||D($)>3?"":" "}(U);break;case 92:J+=function(e,t){for(var r;--t&&R()&&!($<48)&&!($>102)&&(!($>57)||!($<65))&&(!($>70)||!($<97)););return r=P+(t<6&&32==B()&&32==R()),x(k,e,r)}(P-1,7);continue;case 47:switch(B()){case 42:case 47:E((d=function(e,t){for(;R();)if(e+$===57)break;else if(e+$===84&&47===B())break;return"/*"+x(k,t,P-1)+"*"+y(47===e?e:R())}(R(),P),f=r,h=n,m=c,T(d,f,h,u,y($),x(d,2,-2),0,m)),c),(5==D(U||1)||5==D(B()||1))&&_(J)&&" "!==x(J,-1,void 0)&&(J+=" ");break;default:J+="/"}break;case 123*j:l[g++]=_(J)*q;case 125*j:case 59:case 0:switch(W){case 0:case 125:L=0;case 59+A:-1==q&&(J=b(J,/\f/g,"")),N>0&&(_(J)-S||0===j&&47===U)&&E(N>32?z(J+";",i,n,S-1,c):z(b(J," ","")+";",i,n,S-2,c),c);break;case 59:J+=";";default:if(E(G=F(J,r,n,g,A,s,l,H,K=[],V=[],S,a),a),123===W)if(0===A)e(J,r,G,G,K,a,S,l,V);else{switch(O){case 99:if(110===v(J,3))break;case 108:if(97===v(J,2))break;default:A=0;case 100:case 109:case 115:}A?e(t,G,G,i&&E(F(t,G,G,0,0,s,l,H,s,K=[],S,V),V),s,V,S,l,i?K:V):e(J,G,G,G,[""],V,0,l,V)}}g=A=N=0,j=q=1,H=J="",S=o;break;case 58:S=1+_(J),N=U;default:if(j<1){if(123==W)--j;else if(125==W&&0==j++&&125==($=P>0?v(k,--P):0,C--,10===$&&(C=1,I--),$))continue}switch(J+=y(W),W*j){case 38:q=A>0?1:(J+="\f",-1);break;case 44:l[g++]=(_(J)-1)*q,q=1;break;case 64:45===B()&&(J+=M(R())),O=B(),A=S=_(H=J+=function(e){for(;!D(B());)R();return x(k,e,P)}(P)),W++;break;case 45:45===U&&2==_(J)&&(j=0)}}return a}("",null,null,null,[""],(c=l=n||r?n+" "+r+" { "+m+" }":m,I=C=1,S=_(k=c),P=0,l=[]),0,[0],l),k="",d);return e.namespace&&(g=function e(t,r){let n=r+" ",i=","+n;for(let s=0;s<t.length;s++){let a=t[s];if("rule"===a.type){a.value=(n+a.value).replaceAll(",",i);let e=a.props,t=[];for(let r=0;r<e.length;r++)t[r]=n+e[r];a.props=t}Array.isArray(a.children)&&"@keyframes"!==a.type&&e(a.children,r)}return t}(g,e.namespace)),f=[],U(g,h),f},g=5381;for(let e=0;e<t.length;e++)t[e].name||ee(15),g=em(g,t[e].name);return(null==e?void 0:e.namespace)&&(g=em(g,e.namespace)),(null==e?void 0:e.prefix)&&(g=em(g,"p")),m.hash=5381!==g?g.toString():"",m}(),to=a.createContext({shouldForwardProp:void 0,styleSheet:ts,stylis:ta,stylisPlugins:void 0});function tl(){return a.useContext(to)}to.Consumer;let tc=a.createContext(void 0);tc.Consumer;let tu=Object.prototype.hasOwnProperty,td={};function tf(e,t,r){let n=eB(e),i=!ew(e),{attrs:s=eo,componentId:o=function(e,t){let r="string"!=typeof e?"sc":ef(e);td[r]=(td[r]||0)+1;let n=r+"-"+eb(V+r+td[r]);return t?t+"-"+n:n}(t.displayName,t.parentComponentId),displayName:l=ew(e)?`styled.${e}`:`Styled(${e.displayName||e.name||"Component"})`}=t,c=t.displayName&&t.componentId?ef(t.displayName)+"-"+t.componentId:t.componentId||o,u=n&&e.attrs?e.attrs.concat(s).filter(Boolean):s,{shouldForwardProp:d}=t;if(n&&e.shouldForwardProp){let r=e.shouldForwardProp;if(t.shouldForwardProp){let e=t.shouldForwardProp;d=(t,n)=>r(t,n)&&e(t,n)}else d=r}let f=new tt(r,c,n?e.componentStyle:void 0);function h(e,t){return function(e,t,r){let n,i,{attrs:s,componentStyle:o,defaultProps:l,foldedComponentIds:c,styledComponentId:u,target:d}=e,f=a.useContext(tc),h=tl(),p=e.shouldForwardProp||h.shouldForwardProp,y=ec(t,f,l)||el;{let e=a.useRef(null),r=e.current;if(null!==r&&r[1]===y&&r[2]===h.styleSheet&&r[3]===h.stylis&&r[7]===o&&function(e,t,r){let n=0;for(let r in t)if(tu.call(t,r)&&(n++,e[r]!==t[r]))return!1;return n===r}(r[0],t,r[4]))n=r[5],i=r[6];else{var m,g,b;n=function(e,t,r){let n=Object.assign(Object.assign({},t),{className:void 0,theme:r}),i=e.length>1;for(let r=0;r<e.length;r++){let s=e[r],a=eN(s)?s(i?Object.assign({},n):n):s;for(let e in a)"className"===e?n.className=eD(n.className,a[e]):"style"===e?n.style=Object.assign(Object.assign({},n.style),a[e]):e in t&&void 0===t[e]||(n[e]=a[e])}return"className"in t&&"string"==typeof t.className&&(n.className=eD(n.className,t.className)),n}(s,t,y),m=n,g=h.styleSheet,b=h.stylis,i=o.generateAndInjectStyles(m,g,b);let r=0;for(let e in t)tu.call(t,e)&&r++;e.current=[t,y,h.styleSheet,h.stylis,r,n,i,o]}}let w=n.as||d,v=function(e,t,r,n){let i={};for(let s in e)void 0===e[s]||"$"===s[0]||"as"===s||"theme"===s&&e.theme===r||("forwardedAs"===s?i.as=e.forwardedAs:n&&!n(s,t)||(i[s]=e[s]));return i}(n,w,y,p),x=eD(c,u);return i&&(x+=" "+i),n.className&&(x+=" "+n.className),v[ew(w)&&w.includes("-")?"class":"className"]=x,r&&(v.ref=r),(0,a.createElement)(w,v)}(p,e,t)}h.displayName=l;let p=a.forwardRef(h);return p.attrs=u,p.componentStyle=f,p.displayName=l,p.shouldForwardProp=d,p.foldedComponentIds=n?eD(e.foldedComponentIds,e.styledComponentId):"",p.styledComponentId=c,p.target=n?e.target:e,Object.defineProperty(p,"defaultProps",{get(){return this._foldedDefaultProps},set(t){this._foldedDefaultProps=n?function(e,...t){for(let r of t)!function e(t,r,n=!1){if(!n&&!eU(t)&&!Array.isArray(t))return r;if(Array.isArray(r))for(let n=0;n<r.length;n++)t[n]=e(t[n],r[n]);else if(eU(r))for(let n in r)t[n]=e(t[n],r[n]);return t}(e,r,!0);return e}({},e.defaultProps,t):t}}),ej(p,()=>`.${p.styledComponentId}`),i&&function e(t,r,n){if("string"!=typeof r){let i=eT(r);i&&i!==eO&&e(t,i,n);let s=eP(r).concat(e$(r)),a=eC(t),o=eC(r);for(let e=0;e<s.length;++e){let i=s[e];
240if(!(i in eE||n&&n[i]||o&&i in o||a&&i in a)){let e=ek(r,i);try{eS(t,i,e)}catch(e){}}}}return t}(p,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),p}var th=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]);function tp(e,t){let r=[e[0]];for(let n=0,i=t.length;n<i;n+=1)r.push(t[n],e[n+1]);return r}let ty=e=>(e1.add(e),e);function tm(e,...t){return eN(e)||eU(e)?ty(e7(tp(eo,[e,...t]))):0===t.length&&1===e.length&&"string"==typeof e[0]?e7(e):ty(e7(tp(e,t)))}let tg=e=>(function e(t,r,n=el){if(!r)throw ee(1,r);let i=(e,...i)=>t(r,n,tm(e,...i));return i.attrs=i=>e(t,r,Object.assign(Object.assign({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)})),i.withConfig=i=>e(t,r,Object.assign(Object.assign({},n),i)),i})(tf,e),tb=tg;th.forEach(e=>{tb[e]=tg(e)});class tw{constructor(e,t){this.instanceRules=new Map,this.rules=e,this.componentId=t,this.isStatic=function(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(eN(r)&&!eB(r))return!1}return!0}(e),e0.registerId(this.componentId)}removeStyles(e,t){this.instanceRules.delete(e),this.rebuildGroup(t)}renderStyles(e,t,r,n){let i=this.componentId;if(this.isStatic){if(r.hasNameForId(i,i+e))this.instanceRules.has(e)||this.computeRules(e,t,r,n);else{let s=this.computeRules(e,t,r,n);r.insertRules(i,s.name,s.rules)}return}let s=this.instanceRules.get(e);if(this.computeRules(e,t,r,n),!r.server&&s){let t=s.rules,r=this.instanceRules.get(e).rules;if(t.length===r.length){let e=!0;for(let n=0;n<t.length;n++)if(t[n]!==r[n]){e=!1;break}if(e)return}}this.rebuildGroup(r)}computeRules(e,t,r,n){let i=eM(e7(this.rules,t,r,n)),s={name:this.componentId+e,rules:n(i,"")};return this.instanceRules.set(e,s),s}rebuildGroup(e){let t=this.componentId;for(let r of(e.clearRules(t),this.instanceRules.values()))e.insertRules(t,r.name,r.rules)}}function tv(e,...t){let r=tm(e,...t),n=`sc-global-${eb(JSON.stringify(r))}`,i=new tw(r,n),s=e=>{let t,r=tl(),s=a.useContext(tc);{let e=a.useRef(null);null===e.current&&(e.current=r.styleSheet.allocateGSInstance(n)),t=e.current}r.styleSheet.server&&o(t,e,r.styleSheet,s,r.stylis);{let l=i.isStatic?[t,r.styleSheet,i]:[t,e,r.styleSheet,s,r.stylis,i],c=a.useRef(i);a.useLayoutEffect(()=>{r.styleSheet.server||(c.current!==i&&(r.styleSheet.clearRules(n),c.current=i),o(t,e,r.styleSheet,s,r.stylis))},l),a.useLayoutEffect(()=>()=>{r.styleSheet.server||i.removeStyles(t,r.styleSheet)},[t,r.styleSheet,i])}return r.styleSheet.server&&i.instanceRules.delete(t),null};function o(e,t,r,n,a){if(i.isStatic)i.renderStyles(e,X,r,a);else{let o=Object.assign(Object.assign({},t),{theme:ec(t,n,s.defaultProps)});i.renderStyles(e,o,r,a)}}return a.memo(s)}class tx{constructor(e,t){this[s]=!0,this.inject=(e,t=ta)=>{let r=this.getName(t);if(!e.hasNameForId(this.id,r)){let n=t(this.rules,r,"@keyframes");e.insertRules(this.id,r,n)}},this.name=e,this.id=Q+e,this.rules=t,ei(this.id),ej(this,()=>{throw ee(12,String(this.name))})}getName(e=ta){return e.hash?this.name+ey(e.hash>>>0):this.name}}function t_(e,...t){let r=eM(tm(e,...t));return new tx(eb(r),r)}s=e6},52368:(e,t,r)=>{"use strict";r.d(t,{P:()=>o,a:()=>a});var n=r(75834),i=r(35424);let s=Symbol();function a(e,t=!0){return Object.assign(e,{[s]:t})}function o(...e){let t=(0,n.useRef)(e);(0,n.useEffect)(()=>{t.current=e},[e]);let r=(0,i._)(e=>{for(let r of t.current)null!=r&&("function"==typeof r?r(e):r.current=e)});return e.every(e=>null==e||(null==e?void 0:e[s]))?void 0:r}},52510:(e,t,r)=>{"use strict";r.d(t,{k:()=>l});var n=r(24654),i=r(38112),s=r(5596),a=r(16025),o=r(36684);async function l(e,t){async function r(t){if(t.endsWith(o.vB.slice(2))){let r=(0,i.B)((0,n.iN)(t,-64,-32)),a=(0,n.iN)(t,0,-64).slice(2).match(/.{1,64}/g),l=await Promise.all(a.map(t=>o.BH.slice(2)!==t?e.request({method:"eth_getTransactionReceipt",params:[`0x${t}`]},{dedupe:!0}):void 0)),c=l.some(e=>null===e)?100:l.every(e=>e?.status==="0x1")?200:l.every(e=>e?.status==="0x0")?500:600;return{atomic:!1,chainId:(0,s.ME)(r),receipts:l.filter(Boolean),status:c,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[t]})}let{atomic:l=!1,chainId:c,receipts:u,version:d="2.0.0",...f}
240=await r(t.id),[h,p]=(()=>{let e=f.status;return e>=100&&e<200?["pending",e]:e>=200&&e<300?["success",e]:e>=300&&e<700?["failure",e]:"CONFIRMED"===e?["success",200]:"PENDING"===e?["pending",100]:[void 0,e]})();return{...f,atomic:l,chainId:c?(0,s.ME)(c):void 0,receipts:u?.map(e=>({...e,blockNumber:(0,s.uU)(e.blockNumber),gasUsed:(0,s.uU)(e.gasUsed),status:a.Lj[e.status]}))??[],statusCode:p,status:h,version:d}}},52511:(e,t,r)=>{"use strict";function n(e,t,r){return JSON.stringify(e,(e,r)=>"function"==typeof t?t(e,r):"bigint"==typeof r?r.toString()+"#__bigint":r,r)}r.d(t,{As:()=>n})},52516:(e,t,r)=>{"use strict";r.d(t,{Id:()=>x,My:()=>f,OG:()=>S,Ph:()=>m,Q5:()=>O,aK:()=>I,aT:()=>y,aY:()=>s,dJ:()=>C,e8:()=>o,ex:()=>_,fg:()=>k,lX:()=>g,lq:()=>b,qj:()=>v,r4:()=>A,x:()=>N,z:()=>w,zW:()=>l});let n=BigInt(0),i=BigInt(1);function s(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function a(e){if(!s(e))throw Error("Uint8Array expected")}function o(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}function l(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function c(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?n:BigInt("0x"+e)}let u="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,d=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function f(e){if(a(e),u)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=d[e[r]];return t}let h={_0:48,_9:57,A:65,F:70,a:97,f:102};function p(e){return e>=h._0&&e<=h._9?e-h._0:e>=h.A&&e<=h.F?e-(h.A-10):e>=h.a&&e<=h.f?e-(h.a-10):void 0}function y(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(u)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=p(e.charCodeAt(i)),s=p(e.charCodeAt(i+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+s}return n}function m(e){return c(f(e))}function g(e){return a(e),c(f(Uint8Array.from(e).reverse()))}function b(e,t){return y(e.toString(16).padStart(2*t,"0"))}function w(e,t){return b(e,t).reverse()}function v(e,t,r){let n;if("string"==typeof t)try{n=y(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(s(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function x(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];a(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}function _(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}let E=e=>"bigint"==typeof e&&n<=e;function A(e,t,r){return E(e)&&E(t)&&E(r)&&t<=e&&e<r}function I(e,t,r,n){if(!A(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function C(e){let t;for(t=0;e>n;e>>=i,t+=1);return t}let S=e=>(i<<BigInt(e))-i,P=e=>new Uint8Array(e),$=e=>Uint8Array.from(e);function k(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=P(e),i=P(e),s=0,a=()=>{n.fill(1),i.fill(0),s=0},o=(...e)=>r(i,n,...e),l=(e=P(0))=>{i=o($([0]),e),n=o(),0!==e.length&&(i=o($([1]),e),n=o())},c=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=o()).slice();r.push(t),e+=n.length}return x(...r)};return(e,t)=>{let r;for(a(),l(e);!(r=t(c()));)l();return a(),r}}let T={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||s(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function O(e,t,r={}){let n=(t,r,n)=>{let i=T[r];if("function"!=typeof i)throw Error("invalid validator function");let s=e[t];if((!n||void 0!==s)&&!i(s,e))throw Error("param "+String(t)+" is invali
240d. Expected "+r+", got "+s)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function N(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let s=e(r,...n);return t.set(r,s),s}}},52690:(e,t,r)=>{"use strict";r.d(t,{S:()=>E,a:()=>_,b:()=>A,c:()=>I,d:()=>$,g:()=>x,l:()=>k,p:()=>b,u:()=>B});var n=r(75834),i=r(58701),s=r(87280),a=r(27137),o=r(40175),l=r(33861),c=r(4375),u=r(71217),d=r(44037),f=r(77603),h=r(15171),p=r(86253),y=r(37503),m=r(20872),g=r(65601);let b=({address:e,nonce:t})=>`${window.location.host} wants you to sign in with your Solana account:
241${e}
242
243You are proving you own ${e}.
244
245URI: ${window.location.origin}
246Version: 1
247Chain ID: mainnet
248Nonce: ${t}
249Issued At: ${(new Date).toISOString()}
250Resources:
251- https://privy.io`;class w{async authenticate(){if(!this.api)throw new l.P("Auth flow has no API instance");try{return await this.api.post(c.o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw(0,l.f)(e)}}async link(){if(!this.api)throw new l.P("Auth flow has no API instance");try{return await this.api.post(c.k,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw(0,l.f)(e)}}constructor(e){this.meta=e}}async function v({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(e=>e.provider_app_id===r);if(!n)throw new l.P("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only,customAuthAuthorizeUrl:n.provider_app_custom_auth_authorize_url,customAuthTransactUrl:n.provider_app_custom_auth_transact_url}}async function x({api:e,appId:t}){let r=(0,u.c)(),n=(0,u.a)(),i=await (0,u.d)(r);try{let{url:s}=await e.post(c.l,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:i,state_code:n});return{url:s,stateCode:n,codeVerifier:r}}catch(e){throw(0,l.f)(e)}}async function _({appId:e,stateCode:t,codeVerifier:r,authorizationCode:n,action:i,client:s,disableSignup:a}){if(!n||!t)throw new l.P("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===n)throw new l.P("User denied confirmation during cross-app auth flow");try{let o=new w({authorizationCode:n,stateCode:t,codeVerifier:r,provider:`privy:${e}`,disableSignup:!!a});s.startAuthFlow(o);let l="link"===i?await s.link():await s.authenticate(),c=l.oAuthTokens?.accessToken;return console.debug(),c}catch(t){let e=(0,l.f)(t);if(e.privyErrorCode===l.a.ACCOUNT_TRANSFER_REQUIRED)throw e;if(e.privyErrorCode)throw new l.P(e.message||"Invalid code during cross-app auth flow.",void 0,e.privyErrorCode);if("User denied confirmation during cross-app auth flow"===e.message)throw new l.P("Invalid code during cross-app auth flow.",void 0,l.a.OAUTH_USER_DENIED);throw new l.P("Invalid code during cross-app auth flow.",void 0,l.a.UNKNOWN_AUTH_ERROR)}}let E=Symbol("solana-funding-plugin"),A=Symbol("solana-ledger-plugin"),I=async({user:e,accessToken:t,proxy:r,refreshSessionAndUser:n,privy:i,appConfig:a,recoverEmbeddedWallet:o,setUser:l,walletIndex:c,chainType:u,recoveryMethod:d,recoveryPassword:h,recoveryAccessToken:p,idempotencyKey:y,additionalSigners:b})=>{if(0===c)if("user-controlled-server-wallets-only"===a.embeddedWallets.mode)await (0,g.vt)(i,{request:{chain_type:u,additional_signers:b?(0,f.b)(b):void 0},headers:y?{"privy-idempotency-key":y}:void 0});else if("ethereum"===u){let n=(0,s.d)(e);n&&await o({address:n.address}),await r.create({accessToken:t,solanaAddress:n?.address,recoveryMethod:d,recoveryPassword:h,recoveryAccessToken:p})}else{if("solana"!==u)throw Error("Invalid input to create wallet");{let n=(0,s.b)(e);n&&await o({address:n.address}),await r.createSolana({accessToken:t,ethereumAddress:n?.address,recoveryMethod:d,recoveryPassword:h,recoveryAccessToken:p})}}else if("user-controlled-server-wallets-only"===a.embeddedWallets.mode)await (0,g.vt)(i,{request:{chain_type:u,additional_signers:b?(0,f.b)(b):void 0}});else{let{entropyId:n,entropyIdVerifier:i}=(0,m.g)(e);await o(),await r.addWallet({accessToken:t,entropyId:n,entropyIdVerifier:i,chainType:u,hdWalletIndex:c})}
251let w=await n(),v=(0,m.c)(w,{chainType:u,walletIndex:c})[0];return l(w),{user:w,account:v}},C=async({user:e,address:t,client:r,request:n,requesterAppId:i,reconnect:s})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:n.method}});let o=e?.linkedAccounts.find(e=>"cross_app"===e.type&&(e.embeddedWallets.some(e=>e.address===t)||e.smartWallets.some(e=>e.address===t)));if(!e||!o)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new l.P("Cannot request a signature with this wallet address");let c=r.getProviderAccessToken(o.providerApp.id),u=await v({api:r.api,requesterAppId:i,providerAppId:o.providerApp.id});if(!c){if(u.readOnly)throw console.error("cannot transact against a read-only provider app"),new l.P("Cannot transact against a read-only provider app");await s({appId:o.providerApp.id,action:"link"})&&(c=r.getProviderAccessToken(o.providerApp.id))}if(!c)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new l.P("Transactions require a valid token");let d=new URL(u.customAuthTransactUrl||`${u.apiUrl}/oauth/transact`);d.searchParams.set("token",c||""),d.searchParams.set("request",S(n));let f=(0,a.hZ)({location:d.href});if(!f)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new l.P("Failed to initialize signature request");return new Promise((e,i)=>{let s=setTimeout(()=>{u(),i(new l.P("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),a=setInterval(()=>{f.closed&&(u(),i(new l.P("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),c=s=>{s.data&&("set"===s.data.token?.action&&void 0!==s.data.token?.value?r.storeProviderAccessToken(o.providerApp.id,s.data.token.value):"clear"===s.data.token?.action&&r.storeProviderAccessToken(o.providerApp.id,null),"PRIVY_CROSS_APP_ACTION_RESPONSE"===s.data.type&&s.data.result&&(u(),e(s.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:n.method}})),"PRIVY_CROSS_APP_ACTION_ERROR"===s.data.type&&s.data.error&&(u(),i(s.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:s.data.error,address:t}})))};window.addEventListener("message",c);let u=()=>{f.close(),clearInterval(a),clearTimeout(s),window.removeEventListener("message",c)}})},S=e=>JSON.stringify({content:{request:{request:P(e,d.nj)}},timestamp:Date.now(),callbackUrl:window.origin}),P=(e,t)=>"bigint"==typeof e?t(e):Array.isArray(e)?e.map(e=>P(e,t)):e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[e,P(r,t)])):e,$=()=>{let{user:e,getAccessToken:t}=(0,s.u)(),{client:r,setUser:i,openModal:c,inProgressAuthFlowRef:u,inProgressLoginOrLinkMethodRef:d}=(0,p.u)(),m=(0,o.u)(),g=(0,h.a)(),{setModalData:b}=(0,y.u)(),w=(0,n.useCallback)(t=>e?.linkedAccounts.some(e=>"cross_app"===e.type&&e.smartWallets.some(e=>e.address===t))??!1,[e]),x=(0,n.useCallback)(async({appId:e,action:n,disableSignup:i})=>{let s=await t();if("link"===n&&!s)throw g("linkAccount","onError",l.a.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${e}`}),new l.P("User must be authenticated before linking an account.");if("login"===n&&s)throw g("login","onError",l.a.UNKNOWN_AUTH_ERROR),new l.P("Attempted to log in, but user is already logged in. Use a `link` helper instead.");d.current=`privy:${e}`,u.current=n;let o=(0,a.hZ)();return r.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:e}}),new Promise(async(t,s)=>{let{name:a,logoUrl:l}=await v({api:r.api,providerAppId:e,requesterAppId:m.id});b({crossAppAuth:{appId:e,name:a,logoUrl:l,action:n,popup:o,disableSignup:i,onSuccess:t,onError:s}}),c("CrossAppAuthScreen")})},[t,g,d,u,r,m.id,b,c]),_=(0,n.useCallback)(async({subject:t})=>{let n=e?.linkedAccounts.find(e=>"cross_app"===e.type&&e.subject===t)?.providerApp;if(!n)throw new l.P("Invalid subject");r.storeProviderAccessToken(n.id,null);let s=await r.unlinkOAuth(`privy:${n.id}`,t);return i(s),s},[e,r,i]),E=(0,n.useCallback)((t,{address:n,chainId:i})=>C({user:e,client:r,address:n,requesterAppId:m.id,request:{method:w(n)?"privy_signSmartWalletMessage":"personal_sign",params:[t,n],chainId:i},reconnect:x}),[e,r,m.id,w,x]),A=(0,n.useCallback)((t,{address:n,chainId:i})=>{let s=(0,f.g)(t);return C({user:e,client:r,address:n,requesterAppId:m.id,request:{method:w(n)?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[n,s],chainId:i},reconnect:x})},[e,r,m.id,w,x]),I=(0,n.useCallback)((t,{address:n})=>C({user:e,client:r,address:n,requesterAppId:m.id,request:{method:w(n)?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[t],
251chainId:t.chainId},reconnect:x}),[e,r,m.id,w,x]),S=(0,n.useCallback)((t,{address:n})=>C({user:e,client:r,address:n,requesterAppId:m.id,request:{method:w(n)?"privy_signSmartWalletTx":"eth_signTransaction",params:[t],chainId:t.chainId},reconnect:x}),[e,r,m.id,w,x]);return(0,n.useMemo)(()=>({startCrossAppAuthFlow:x,unlinkCrossAppAccount:_,signMessageWithCrossAppWallet:E,signTypedDataWithCrossAppWallet:A,sendTransactionWithCrossAppWallet:I,signTransactionWithCrossAppWallet:S}),[x,_,E,A,I,S])},k=()=>{let{client:e,setUser:t,walletProxy:r}=(0,p.u)(),{getAccessToken:i}=(0,s.u)(),a=(0,o.u)(),l=a?.passkeys?.shouldUnenrollMfaOnUnlink??!1;return{unlink:(0,n.useCallback)(async({credentialId:n})=>{let s=await i();if(!s)throw Error("Must have valid access token to enroll in MFA");if(!r)throw Error("Wallet proxy not initialized.");await r.unlinkPasskeyAccount({credentialId:n,accessToken:s,removeAsMfa:l});let a=await e.getAuthenticatedUser();return t(a),a},[l,e,i,t,r])}},T=async({appConfig:e,getAccessToken:t,initializeWalletProxy:r,user:n,privy:i,emitPrivyEvent:s,recoverEmbeddedWallet:a,setModalData:o,openModal:c,setUser:u,options:d,timeoutDuration:f,refreshSessionAndUser:h,chainType:p,idempotencyKey:y,additionalSigners:g})=>{let[b,w]=await Promise.all([r(f),t()]);if(!w||!n)throw s("createWallet","onError",l.a.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");if(!b&&e.customAuth?.enabled)throw s("createWallet","onError",l.a.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(g&&"user-controlled-server-wallets-only"!==e.embeddedWallets.mode)throw new l.P("Specifying additionalSigners is only supported for TEE execution and this app uses on-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");if(d&&"walletIndex"in d&&"number"==typeof d.walletIndex){if("user-controlled-server-wallets-only"===e.embeddedWallets.mode)throw s("createWallet","onError",l.a.INVALID_DATA),Error("Invalid input, use `createAdditional` instead of `walletIndex` to create additional wallets.");return O({accessToken:w,appConfig:e,privy:i,emitPrivyEvent:s,openModal:c,proxy:b,refreshSessionAndUser:h,recoverEmbeddedWallet:a,setModalData:o,user:n,walletIndex:d.walletIndex,chainType:p,setUser:u,additionalSigners:g})}let v=d&&"createAdditional"in d&&d.createAdditional,x=(0,m.c)(n,{chainType:p});if(x[0]&&!v)throw s("createWallet","onError",l.a.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");return O({accessToken:w,appConfig:e,privy:i,emitPrivyEvent:s,openModal:c,proxy:b,recoverEmbeddedWallet:a,setModalData:o,user:n,walletIndex:(x.reduce((e,t)=>!e||e.walletIndex<t.walletIndex?t:e,null)?.walletIndex??-1)+1,chainType:p,refreshSessionAndUser:h,setUser:u,idempotencyKey:y,additionalSigners:g})},O=async({accessToken:e,appConfig:t,privy:r,emitPrivyEvent:n,proxy:i,refreshSessionAndUser:a,recoverEmbeddedWallet:o,user:c,walletIndex:u,setModalData:d,openModal:f,chainType:h,setUser:p,idempotencyKey:y,additionalSigners:g})=>{if(u<0)throw n("createWallet","onError",l.a.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${u}
251) is invalid.`);let b=(0,s.g)(c);if(u>0&&!b)throw n("createWallet","onError",l.a.EMBEDDED_WALLET_NOT_FOUND),Error("Must have an existing embedded wallet to create an additional wallet.");if(t.embeddedWallets.requireUserOwnedRecoveryOnCreate&&"user-controlled-server-wallets-only"===t.embeddedWallets.mode)throw n("createWallet","onError",l.a.EMBEDDED_WALLET_CREATE_ERROR),Error("User owned recovery not yet supported for this app.");if(!b&&t.embeddedWallets.requireUserOwnedRecoveryOnCreate)return await N({emitPrivyEvent:n,setModalData:d,openModal:f,chainType:h});let w=(0,m.c)(c,{chainType:h,walletIndex:u})[0];if(w)return{user:c,account:w};if(0===u&&!i)return N({emitPrivyEvent:n,setModalData:d,openModal:f,chainType:h});if(!i)throw n("createWallet","onError",l.a.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return I({appConfig:t,walletIndex:u,chainType:h,user:c,accessToken:e,proxy:i,refreshSessionAndUser:a,privy:r,recoverEmbeddedWallet:o,setUser:p,idempotencyKey:y,additionalSigners:g})},N=async({emitPrivyEvent:e,setModalData:t,openModal:r,chainType:n})=>new Promise((i,s)=>{t({createWallet:{onSuccess:({user:t,account:r})=>{e("createWallet","onSuccess",{wallet:r}),i({user:t,account:r})},onFailure:t=>{e("createWallet","onError",l.a.UNKNOWN_EMBEDDED_WALLET_ERROR),s(t)},callAuthOnSuccessOnClose:!1,shouldCreateEth:"ethereum"===n,shouldCreateSol:"solana"===n}}),r("EmbeddedWalletOnAccountCreateScreen")}),R=async({emitPrivyEvent:e,getAccessToken:t,initializeWalletProxy:r,refreshSessionAndUser:n,user:i,appConfig:a},{privateKey:o,chainType:c,additionalSigners:u})=>{if(!i)throw e("linkAccount","onError",l.a.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new l.P("User must be authenticated before linking an account.");let d="user-controlled-server-wallets-only"===a.embeddedWallets.mode?"tee":"on-device";if(u&&"on-device"===d)throw new l.P("Specifying additionalSigners is only supported for TEE execution and this app uses on-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let[f,h]=await Promise.all([t(),r(15e3)]);if(!h||!f)throw e("linkAccount","onError",l.a.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new l.P("User must be authenticated before linking an account.");let{address:p}=await h.importWallet({privateKey:o,accessToken:f,chainType:c,mode:d,additionalSigners:u}),y=await n(),m="solana"===c?(0,s.e)(y):(0,s.c)(y),g=m?.find(e=>e.address===p);if(!g)throw e("createWallet","onError",l.a.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return e("createWallet","onSuccess",{wallet:g}),g},B=()=>{let e=(0,n.useContext)(s.P),{importWallet:t}=(()=>{let{user:e}=(0,s.u)(),{client:t,refreshSessionAndUser:r,initializeWalletProxy:i}=(0,p.u)(),a=(0,h.a)(),l=(0,o.u)();return{importWallet:(0,n.useCallback)(({privateKey:n,additionalSigners:s})=>R({getAccessToken:()=>t.getAccessToken(),user:e,initializeWalletProxy:i,refreshSessionAndUser:r,emitPrivyEvent:a,appConfig:l},{privateKey:n,chainType:"ethereum",additionalSigners:s}),[e,t,r,i,a,l])}})(),{exportWallet:r}=(0,i.u)(),{createWallet:a}=function(e){let{create:t}=(()=>{let e=(0,o.u)(),t=(0,h.a)(),{setModalData:r}=(0,y.u)(),{initializeWalletProxy:n,recoverEmbeddedWallet:i,setUser:s,openModal:a,refreshSessionAndUser:c,privy:u,client:d}=(0,p.u)();return{create:async({chainType:f,options:h,latestUser:p,idempotencyKey:y})=>{let m=p;if(m||(m=await c()),!m)throw t("createWallet","onError",l.a.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return await T({appConfig:e,privy:u,getAccessToken:()=>d.getAccessToken(),refreshSessionAndUser:c,initializeWalletProxy:n,user:m,emitPrivyEvent:t,recoverEmbeddedWallet:i,setModalData:r,openModal:a,setUser:s,options:h,timeoutDuration:o.W,chainType:f,idempotencyKey:y,additionalSigners:h?.signers})}}})();return(0,h.u)("createWallet",void 0),{createWallet:async e=>{e&&"target"in e&&e&&(e=void 0);let{account:r}=await t({chainType:"ethereum",options:e});return r}}}(),{unlinkCrossAppAccount:c}=$(),{unlink:u}=(0,i.a)(),{unlink:d}=(()=>{let{client:e,setUser:t}=(0,p.u)();return{unlink:(0,n.useCallback)(async({address:r})=>{let n=await e.unlinkEmail(r);return t(n),n},[e,t])}})(),{unlink:f}=(()=>{let{client:e,setUser:t}=(0,p.u)();return{unlink:(0,n.useCallback)(async({phoneNumber:r})=>{let n=await e.unlinkPhone(r);return t(n),n},[e,t])}})(),{unlink:m}=(()=>{let{client:e,setUser:t}=(0,p.u)();return{unlink:(0,n.useCallback)(async({fid:r})=>{let n=await e.unlinkFarcaster(r);return t(n),n},[e,t])}})(),{unlink:g}=(()=>{let{client:e,setUser:t}=(0,p.u)();return{unlink:(0,n.useCallback)(async({telegramUserId:r})=>{let n=await e.unlinkTelegram(r);return t(n),n},[e,t])}})(),{unlink:b}=k(),{unlink:w}=(()=>{let{client:e,setUser:t}=(0,p.u)();return{unlink:(0,n.useCallback)(async({provider:r,subject:n})=>{let i=await e.unlinkOAuth(r,n);return t(i),i},[e,t])}})(),v=(0,n.useCallback)(e=>u({address:e}),[u]),x=(0,n.useCallback)(e=>d({address:e}),[d]),_=(0,n.useCallback)(e=>f({phoneNumber:e}),[f]),E=(0,n.useCallback)(e=>m({fid:e}),[m]),A=(0,n.useCallback)(e=>g({telegramUserId:e}),[g]),I=(0,n.useCallback)(e=>b({credentialId:e}),[b]),C=(0,n.useCallback)(e=>w(e),[w]),S=(0,n.useCallback)(e=>w({provider:"google",subject:e}),[w]),P=(0,n.useCallback)(e=>w({provider:"twitter",subject:e}),[w]),O=(0,n.useCallback)(e=>w({provider:"twitch",subject:e}),[w]),N=(0,n.useCallback)(e=>w({provider:"discord",subject:e}),[w]),B=(0,n.useCallback)(e=>w({provider:"github",subject:e}),[w]),D=(0,n.useCallback)(e=>w({provider:"spotify",subject:e}),[w]),M=(0,n.useCallback)(e=>w({provider:"instagram",subject:e}),[w]),U=(0,n.useCallback)(e=>w({provider:"tiktok",subject:e}),[w]),j=(0,n.useCallback)(e=>w({provider:"line",subject:e}),[w]),L=(0,n.useCallback)(e=>w({provider:"linkedin",subject:e}),[w]),F=(0,n.useCallback)(e=>w({provider:"apple",subject:e}),[w]),{update:z}=(0,i.b)(),{update:q}=(0,i.c)();return{...e,importWallet:t,createWallet:a,exportWallet:r,unlinkCrossAppAccount:c,unlinkWallet:v,unlinkEmail:x,unlinkPhone:_,unlinkGoogle:S,unlinkTwitter:P,unlinkTwitch:O,unlinkDiscord:N,unlinkGithub:B,unlinkSpotify:D,unlinkInstagram:M,unlinkTiktok:U,unlinkLine:j,unlinkLinkedIn:L,unlinkApple:F,unlinkFarcaster:E,unlinkTelegram:A,unlinkPasskey:I,unlinkOAuth:C,updateEmail:z,updatePhone:q}}},52862:(e,t,r)=>{"use strict";function n(){let e=()=>void 0,t=()=>void 0;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}}r.d(t,{Y:()=>n})},53160:(e,t,r)=>{"use strict";r.d(t,{s:()=>s});var n=r(75834),i=r(63228);let s=(e,t)=>{i._.isServer?(0,n.useEffect)(e,t):(0,n.useLayoutEffect)(e,t)}},53986:(e,t,r)=>{"use strict";r.d(t,{S:()=>o});var n=r(75834),i=r(97010),s=r(29908),a=r(53160);function o(e,t){let r=(0,n.useId)(),o=i.D.get(t),[l,c]=(0,s.y)(o,(0,n.useCallback)(e=>[o.selectors.isTop(e,r),o.selectors.inStack(e,r)],[o,r]));return(0,a.s)(()=>
251{if(e)return o.actions.push(r),()=>o.actions.pop(r)},[o,e,r]),!!e&&(!c||l)}},54008:(e,t,r)=>{"use strict";var n=r(75834),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useSyncExternalStore,a=n.useRef,o=n.useEffect,l=n.useMemo,c=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var h=s(e,(d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=n(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,i(s,e))return t;var r=n(e);return void 0!==u&&u(t,r)?(s=e,t):(s=e,a=r)}var s,a,o=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,r,n,u]))[0],d[1]);return o(function(){f.hasValue=!0,f.value=h},[h]),c(h),h}},54051:(e,t,r)=>{"use strict";r.d(t,{g:()=>c});var n=r(69300),i=r(30406),s=r(32579),a=r(44037),o=r(14782),l=r(84413);async function c(e){let{authorization:t,signature:r}=e;return(0,n.x)({hash:function(e){let{chainId:t,nonce:r,to:n}=e,c=e.contractAddress??e.address,u=(0,l.S)((0,i.aP)(["0x05",(0,o.EQ)([t?(0,a.cK)(t):"0x",c,r?(0,a.cK)(r):"0x"])]));return"bytes"===n?(0,s.aT)(u):u}(t),signature:r??t})}},54057:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});class n extends Error{constructor(e,t={}){let r=t.cause instanceof n?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof n&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...r?[`Details: ${r}`]:[],"Version: [email protected]"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=i,this.metaMessages=t.metaMessages,this.shortMessage=e}}},54722:(e,t,r)=>{"use strict";r.d(t,{S:()=>s});var n=r(32579),i=r(44037);function s(e){let{kzg:t}=e,r=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),s="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,n.aT)(e)):e.blobs,a=[];for(let e of s)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===r?a:a.map(e=>(0,i.My)(e))}},55035:(e,t,r)=>{"use strict";async function n(e){return BigInt(await e.request({method:"eth_gasPrice"}))}r.d(t,{L:()=>n})},55212:(e,t,r)=>{"use strict";r.d(t,{Dv:()=>A,FO:()=>y,If:()=>x,Ji:()=>d,Rv:()=>l,WL:()=>p,Yo:()=>b,ej:()=>f,fC:()=>I,iB:()=>c,kz:()=>a,l9:()=>g,pc:()=>s,sP:()=>E,v7:()=>C,v8:()=>v});var n=r(90320);let i=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function s(e){return i.test(e)}function a(e){return(0,n.Yv)(i,e)}let o=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function l(e){return o.test(e)}function c(e){return(0,n.Yv)(o,e)}let u=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function d(e){return u.test(e)}function f(e){return(0,n.Yv)(u,e)}let h=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function p(e){return h.test(e)}function y(e){return(0,n.Yv)(h,e)}let m=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function g(e){return m.test(e)}function b(e){return(0,n.Yv)(m,e)}let w=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function v(e){return w.test(e)}function x(e){return(0,n.Yv)(w,e)}let _=/^receive\(\) external payable$/;function E(e){return _.test(e)}let A=new Set(["memory","indexed","storage","calldata"]),I=new Set(["indexed"]),C=new Set(["calldata","memory","storage"])},55464:(e,t,r)=>{"use strict";r.d(t,{s:()=>s});var n=r(66471),i=r(17819);async function s(e,{serializedTransaction:t,throwOnReceiptRevert:r,timeout:s}
251){let a=await e.request({method:"eth_sendRawTransactionSync",params:s?[t,s]:[t]},{retryCount:0}),o=(e.chain?.formatters?.transactionReceipt?.format||i.uL)(a);if("reverted"===o.status&&r)throw new n.Sq({receipt:o});return o}},55642:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n
vendor: 12,668 bytes, line 251
251={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[2-467])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-7]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]|50"]],["(\\d{8})","$1",["[5-7]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}
vendor: 13,185 bytes, line 251
251|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8}
vendor: 7,686 bytes, line 251
251)","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|3[01]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","(?:400|[5-9]\\d\\d)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-9]"]]]],ET:["251","00","(?:11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[
2512-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6
vendor: 21,963 bytes, line 251
251]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-37-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85
251"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[013]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|9[2-9]"]],["(\\d)(\\d{7})","$1 $2",["[267]|904"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[346-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4}
251)","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[0-79]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:472[2-47-9]|983[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[02469]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}",[7,8,9,10],[["(\\d{4})(\\d{4,6})","$1 $2",["1(?:2[02]|[89])"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[26]|6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4}
251)","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}}},55663:(e,t,r)=>{"use strict";r.d(t,{a:()=>i,b:()=>a,s:()=>s,u:()=>n});let n=(0,r(92204).v)(()=>({user:null,authenticated:!1,hasResolvedInitialUser:!1})),i=e=>n.setState({user:e}),s=e=>n.setState({authenticated:e}),a=e=>n.setState({hasResolvedInitialUser:e})},56043:(e,t,r)=>{"use strict";var n=r(88304);function i(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function s(){return void 0!==n&&void 0!==n.versions&&void 0!==n.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=i,t.isNode=s,t.isBrowser=function(){return!i()&&!s()}},56260:(e,t,r)=>{"use strict";r.d(t,{EH:()=>s,YE:()=>o,jF:()=>a,qD:()=>l,rj:()=>i});var n=r(99838);class i extends n.C{constructor({blockNumber:e,chain:t,contract:r}){super(`Chain "${t.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class s extends n.C{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID:  ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}}class a extends n.C{constructor(){super("No chain was provided to the request.\nPlease provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient.",{name:"ChainNotFoundError"})}}class o extends n.C{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class l extends n.C{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}
251" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}},56300:(e,t,r)=>{"use strict";r.d(t,{TW:()=>i,X7:()=>o,bq:()=>a,zm:()=>s});var n=r(63228);function i(e){var t;return n._.isServer?null:null==e?document:null!=(t=null==e?void 0:e.ownerDocument)?t:document}function s(e){var t,r;return n._.isServer?null:null==e?document:null!=(r=null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e))?r:document}function a(e){var t,r;return null!=(r=null==(t=s(e))?void 0:t.activeElement)?r:null}function o(e){return a(e)===e}},56947:(e,t,r)=>{"use strict";r.d(t,{v:()=>w});var n=r(97352),i=r(23536),s=r(15520),a=r(54051),o=r(43311),l=r(30406),c=r(74079),u=r(62276),d=r(23274),f=r(12089),h=r(42450),p=r(94383),y=r(72767),m=r(81655),g=r(35107);let b=new h.A(128);async function w(e,t){let r,{account:h=e.account,assertChainId:w=!0,chain:v=e.chain,accessList:x,authorizationList:_,blobs:E,data:A,dataSuffix:I="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,gas:C,gasPrice:S,maxFeePerBlobGas:P,maxFeePerGas:$,maxPriorityFeePerGas:k,nonce:T,type:O,value:N,...R}=t;if(void 0===h)throw new i.T({docsPath:"/docs/actions/wallet/sendTransaction"});let B=h?(0,n.J)(h):null;try{(0,p.c)(t);let n=await (async()=>t.to?t.to:null!==t.to&&_&&_.length>0?await (0,a.g)({authorization:_[0]}).catch(()=>{throw new s.C("`to` is required. Could not infer from `authorizationList`.")}):void 0)();if(B?.type==="json-rpc"||null===B){let t;null!==v&&(t=await (0,f.T)(e,y.T,"getChainId")({}),w&&(0,o.v)({currentChainId:t,chain:v}));let r=e.chain?.formatters?.transactionRequest?.format,i=(r||d.Bv)({...(0,u.o)(R,{format:r}),accessList:x,account:B,authorizationList:_,blobs:E,chainId:t,data:I?(0,l.xW)([A??"0x",I]):A,gas:C,gasPrice:S,maxFeePerBlobGas:P,maxFeePerGas:$,maxPriorityFeePerGas:k,nonce:T,to:n,type:O,value:N},"sendTransaction"),s=b.get(e.uid);try{return await e.request({method:s?"wallet_sendTransaction":"eth_sendTransaction",params:[i]},{retryCount:0})}catch(t){if(!1===s)throw t;if("InvalidInputRpcError"===t.name||"InvalidParamsRpcError"===t.name||"MethodNotFoundRpcError"===t.name||"MethodNotSupportedRpcError"===t.name)return await e.request({method:"wallet_sendTransaction",params:[i]},{retryCount:0}).then(t=>(b.set(e.uid,!0),t)).catch(r=>{if("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name)throw b.set(e.uid,!1),t;throw r});throw t}}if(B?.type==="local"){if(B.nonceManager&&void 0===T){let t=R.chainId,n=await (async()=>"number"==typeof t?t:v?v.id:(0,f.T)(e,y.T,"getChainId")({}))();r={address:B.address,chainId:n}}let t=await (0,f.T)(e,m.ft,"prepareTransactionRequest")({account:B,accessList:x,authorizationList:_,blobs:E,chain:v,data:I?(0,l.xW)([A??"0x",I]):A,gas:C,gasPrice:S,maxFeePerBlobGas:P,maxFeePerGas:$,maxPriorityFeePerGas:k,nonce:T,nonceManager:B.nonceManager,parameters:[...m.MM,"sidecars"],type:O,value:N,...R,to:n}),i=v?.serializers?.transaction,s=await B.signTransaction(t,{serializer:i});return await (0,f.T)(e,g.L,"sendRawTransaction")({serializedTransaction:s})}if(B?.type==="smart")throw new i.Z({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new i.Z({docsPath:"/docs/actions/wallet/sendTransaction",type:B?.type})}catch(e){if(e instanceof i.Z)throw e;throw r&&B?.nonceManager?.reset(r),(0,c.p)(e,{...t,account:B,chain:t.chain||void 0})}}},57168:(e,t,r)=>{"use strict";r.d(t,{A9:()=>i,NO:()=>o,Pj:()=>l,dV:()=>s,nx:()=>c,zd:()=>a});var n=r(54057);n.C;class i extends n.C{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class s extends n.C{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class a extends n.C{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class o extends n.C{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class l extends n.C{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class c extends n.C{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invali
251d."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}},57551:(e,t,r)=>{"use strict";r.d(t,{B8:()=>p,D0:()=>function e(t,r,n=!1,h={}){let g;if(t<=s)throw Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:b,nByteLength:_}=x(t,r);if(_>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let E=Object.freeze({ORDER:t,isLE:n,BITS:b,BYTES:_,MASK:(0,i.OG)(b),ZERO:s,ONE:a,create:e=>f(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return s<=e&&e<t},is0:e=>e===s,isOdd:e=>(e&a)===a,neg:e=>f(-e,t),eql:(e,t)=>e===t,sqr:e=>f(e*e,t),add:(e,r)=>f(e+r,t),sub:(e,r)=>f(e-r,t),mul:(e,r)=>f(e*r,t),pow:(e,t)=>(function(e,t,r){if(r<s)throw Error("invalid exponent, negatives unsupported");if(r===s)return e.ONE;if(r===a)return t;let n=e.ONE,i=t;for(;r>s;)r&a&&(n=e.mul(n,i)),i=e.sqr(i),r>>=a;return n})(E,e,t),div:(e,r)=>f(e*p(r,t),t),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:e=>p(e,t),sqrt:h.sqrt||(r=>(g||(g=t%c===l?y:t%d===u?m:function(t){if(t<BigInt(3))throw Error("sqrt is not defined for small field");let r=t-a,n=0;for(;r%o===s;)r/=o,n++;let i=o,l=e(t);for(;1===v(l,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===n)return y;let c=l.pow(i,r),u=(r+a)/o;return function(e,t){if(e.is0(t))return t;if(1!==v(e,t))throw Error("Cannot find square root");let i=n,s=e.mul(e.ONE,c),o=e.pow(t,r),l=e.pow(t,u);for(;!e.eql(o,e.ONE);){if(e.is0(o))return e.ZERO;let t=1,r=e.sqr(o);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw Error("Cannot find square root");let n=a<<BigInt(i-t-1),c=e.pow(s,n);i=t,s=e.sqr(c),o=e.mul(o,s),l=e.mul(l,c)}return l}}(t)),g(E,r))),toBytes:e=>n?(0,i.z)(e,_):(0,i.lq)(e,_),fromBytes:e=>{if(e.length!==_)throw Error("Field.fromBytes: expected "+_+" bytes, got "+e.length);return n?(0,i.lX)(e):(0,i.Ph)(e)},invertBatch:e=>w(E,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(E)},LH:()=>x,Tp:()=>E,jr:()=>b,pS:()=>w,qy:()=>A,zH:()=>h,zi:()=>f});var n=r(9146),i=r(52516);let s=BigInt(0),a=BigInt(1),o=BigInt(2),l=BigInt(3),c=BigInt(4),u=BigInt(5),d=BigInt(8);function f(e,t){let r=e%t;return r>=s?r:t+r}function h(e,t,r){let n=e;for(;t-- >s;)n*=n,n%=r;return n}function p(e,t){if(e===s)throw Error("invert: expected non-zero number");if(t<=s)throw Error("invert: expected positive modulus, got "+t);let r=f(e,t),n=t,i=s,o=a,l=a,c=s;for(;r!==s;){let e=n/r,t=n%r,s=i-l*e,a=o-c*e;n=r,r=t,i=l,o=c,l=s,c=a}if(n!==a)throw Error("invert: does not exist");return f(i,t)}function y(e,t){let r=(e.ORDER+a)/c,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw Error("Cannot find square root");return n}function m(e,t){let r=(e.ORDER-u)/d,n=e.mul(t,o),i=e.pow(n,r),s=e.mul(t,i),a=e.mul(e.mul(s,o),i),l=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(l),t))throw Error("Cannot find square root");return l}let g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function b(e){let t=g.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,i.Q5)(e,t)}function w(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),s=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),s),n}function v(e,t){let r=(e.ORDER-a)/o,n=e.pow(t,r),i=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),l=e.eql(n,e.neg(e.ONE));if(!i&&!s&&!l)throw Error("invalid Legendre symbol result");return i?1:s?0:-1}function x(e,t){void 0!==t&&(0,n.Fe)(t);let r=void 0!==t?t:e.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function _(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function E(e){let t=_(e);return t+Math.ceil(t/2)}function A(e,t,r=!1){let n=e.length,s=_(t),o=E(t);if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let l=f(r?(0,i.lX)(e):(0,i.Ph)(e),t-a)+a;return r?(0,i.z)(l,s):(0,i.lq)(l,s)}},57572:(e,t,r)=>{"use strict";r.d(t,{KK:()=>N});var n=r(4691),i=r(64959),s=r(62610);let a="0x6492649264926492649264926492649264926492649264926492649264926492";class o extends i.C{constructor(e){super(`Value \`${e}
251\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}var l=r(82762),c=r(21557);let u=n.HT("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function d(e){if("string"==typeof e){if("0x8010801080108010801080108010801080108010801080108010801080108010"!==s.di(e,-32))throw new f(e)}else c.vA(e.authorization)}class f extends i.C{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}var h=r(28266),p=r(37720),y=r(48241),m=r(29171),g=r(72693),b=r(11400),w=r(2452),v=r(54051);async function x({address:e,authorization:t,signature:r}){return(0,w.h)((0,b.b)(e),await (0,v.g)({authorization:t,signature:r}))}var _=r(30406),E=r(2939),A=r(36174),I=r(44037),C=r(12089),S=r(69300),P=r(31168),$=r(32579),k=r(71151),T=r(4884),O=r(71441);async function N(e,t){let{address:r,chain:n=e.chain,hash:i,erc6492VerifierAddress:s=t.universalSignatureVerifierAddress??n?.contracts?.erc6492Verifier?.address,multicallAddress:a=t.multicallAddress??n?.contracts?.multicall3?.address,mode:o="auto"}=t;if(n?.verifyHash)return await n.verifyHash(e,t);let l=(()=>{let e=t.signature;return(0,E.q)(e)?e:"object"==typeof e&&"r"in e&&"s"in e?function({r:e,s:t,to:r="hex",v:n,yParity:i}){let s=(()=>{if(0===i||1===i)return i;if(n&&(27n===n||28n===n||n>=35n))return+(n%2n===0n);throw Error("Invalid `v` or `yParity` value")})(),a=`0x${new P.secp256k1.Signature((0,A.uU)(e),(0,A.uU)(t)).toCompactHex()}${0===s?"1b":"1c"}`;return"hex"===r?a:(0,$.aT)(a)}(e):(0,I.My)(e)})();try{if("eoa"===o)try{if((0,w.h)((0,b.b)(r),await (0,S.x)({hash:i,signature:l})))return!0}catch{}if(function(e){try{return d(e),!0}catch{return!1}}(l))return await R(e,{...t,multicallAddress:a,signature:l});return await B(e,{...t,verifierAddress:s,signature:l})}catch(e){if("eoa"!==o)try{if((0,w.h)((0,b.b)(r),await (0,S.x)({hash:i,signature:l})))return!0}catch{}if(e instanceof M)return!1;throw e}}async function R(e,t){let{address:r,blockHash:i,blockNumber:a,blockTag:o,hash:c,multicallAddress:f,requireCanonical:y}=t,{authorization:m,data:b,signature:w,to:v}=function(e){d(e);let t=s.Ro(s.di(e,-64,-32)),r=s.di(e,-t-64,-64),i=s.di(e,0,-t-64),[a,o,c]=n.D4(u,r);return{authorization:l.HT({address:a.delegation,chainId:Number(a.chainId),nonce:a.nonce,yParity:a.yParity,r:a.r,s:a.s}),signature:i,...c&&"0x"!==c?{data:c,to:o}:{}}}(t.signature);if(await (0,T.Q)(e,{address:r,blockHash:i,blockNumber:a,blockTag:o,requireCanonical:y})===(0,_.aP)(["0xef0100",m.address]))return await D(e,{...t,signature:w});let E={address:m.address,chainId:Number(m.chainId),nonce:Number(m.nonce),r:(0,I.cK)(m.r,{size:32}),s:(0,I.cK)(m.s,{size:32}),yParity:m.yParity};if(!await x({address:r,authorization:E}))throw new M;let A=await (0,C.T)(e,O.J,"readContract")({...f?{address:f}:{code:p.Ez},authorizationList:[E],abi:h.v2,blockHash:i,blockNumber:a,blockTag:"pending",functionName:"aggregate3",requireCanonical:y,args:[[...b?[{allowFailure:!0,target:v??r,callData:b}]:[],{allowFailure:!0,target:r,callData:(0,g.p)({abi:h.UW,functionName:"isValidSignature",args:[c,w]})}]]}),S=A[A.length-1]?.returnData;if(S?.startsWith("0x1626ba7e"))return!0;throw new M}async function B(e,t){let{address:r,factory:i,factoryData:l,hash:c,signature:u,verifierAddress:d,...f}=t,b=await (async()=>{if(!i&&!l||function(e){try{if(s.di(e,-32)!==a)throw new o(e);return!0}catch{return!1}}(u))return u;let{data:e,signature:t,to:r}={data:l,signature:u,to:i};return s.xW(n.lF(n.HT("address, bytes, bytes"),[r,e,t]),a)})(),w=d?{to:d,data:(0,g.p)({abi:h.E5,functionName:"isValidSig",args:[r,c,b]}),...f}:{data:(0,m.m)({abi:h.E5,args:[r,c,b],bytecode:p.fT}),...f},{data:v}=await (0,C.T)(e,k.T,"call")(w).catch(e=>{if(e instanceof y.zX)throw new M;throw e});if((0,A.Nx)(v??"0x0"))return!0;throw new M}async function D(e,t){let{address:r,blockHash:n,blockNumber:i,blockTag:s,hash:a,requireCanonical:o,signature:l}=t;if((await (0,C.T)(e,O.J,"readContract")({address:r,abi:h.UW,args:[a,l],blockHash:n,blockNumber:i,blockTag:s,functionName:"isValidSignature",requireCanonical:o}).catch(e=>{if(e instanceof y.bG)throw new M;throw e})).startsWith("0x1626ba7e"))return!0;throw new M}
vendor: 3,382 bytes, line 251
251class M extends Error{}},57608:(e,t,r)=>{"use strict";r.d(t,{X:()=>m,J:()=>y});var n=r(28266),i=r(84940),s=r(1376),a=r(45897),o=r(30406),l=r(65402),c=r(15678),u=r(21394),d=r(63547);let f="/docs/contract/encodeErrorResult";function h(e){let{abi:t,errorName:r,args:n}=e,i=t[0];if(r){let e=(0,d.iY)({abi:t,args:n,name:r});if(!e)throw new a.yy(r,{docsPath:f});i=e}if("error"!==i.type)throw new a.yy(void 0,{docsPath:f});let s=(0,u.B)(i),h=(0,l.V)(s),p="0x";if(n&&n.length>0){if(!i.inputs)throw new a.ZP(i.name,{docsPath:f});p=(0,c.h)(i.inputs,n)}return(0,o.aP)([h,p])}let p="/docs/contract/encodeFunctionResult",y="x-batch-gateway:true";async function m(e){let{data:t,ccipRequest:r}=e,{args:[o]}=(0,s.J)({abi:n.b2,data:t}),l=[],u=[];return await Promise.all(o.map(async(e,t)=>{try{u[t]=e.urls.includes(y)?await m({data:e.data,ccipRequest:r}):await r(e),l[t]=!1}catch(e){var s;l[t]=!0,u[t]="HttpRequestError"===(s=e).name&&s.status?h({abi:n.b2,errorName:"HttpError",args:[s.status,s.shortMessage]}):h({abi:[i.Mc],errorName:"Error",args:["shortMessage"in s?s.shortMessage:s.message]})}})),function(e){let{abi:t,functionName:r,result:n}=e,i=t[0];if(r){let e=(0,d.iY)({abi:t,name:r});if(!e)throw new a.Iz(r,{docsPath:p});i=e}if("function"!==i.type)throw new a.Iz(void 0,{docsPath:p});if(!i.outputs)throw new a.MR(i.name,{docsPath:p});let s=(()=>{if(0===i.outputs.length)return[];if(1===i.outputs.length)return[n];if(Array.isArray(n))return n;throw new a.dm(n)})();return(0,c.h)(i.outputs,s)}({abi:n.b2,functionName:"query",result:[l,u]})}},57636:(e,t,r)=>{"use strict";r.d(t,{B4:()=>h,CQ:()=>v,CW:()=>w,Ei:()=>d,F8:()=>x,P5:()=>f,TH:()=>_,Vl:()=>g,Vr:()=>b,WM:()=>p,WQ:()=>m,im:()=>y,jm:()=>o,lD:()=>s,qh:()=>u,rE:()=>l,ry:()=>c,xn:()=>a});let n=BigInt(0x100000000-1),i=BigInt(32);function s(e,t=!1){let r=e.length,a=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){let{h:r,l}=function(e,t=!1){return t?{h:Number(e&n),l:Number(e>>i&n)}:{h:0|Number(e>>i&n),l:0|Number(e&n)}}(e[s],t);[a[s],o[s]]=[r,l]}return[a,o]}let a=(e,t,r)=>e>>>r,o=(e,t,r)=>e<<32-r|t>>>r,l=(e,t,r)=>e>>>r|t<<32-r,c=(e,t,r)=>e<<32-r|t>>>r,u=(e,t,r)=>e<<64-r|t>>>r-32,d=(e,t,r)=>e>>>r-32|t<<64-r,f=(e,t,r)=>e<<r|t>>>32-r,h=(e,t,r)=>t<<r|e>>>32-r,p=(e,t,r)=>t<<r-32|e>>>64-r,y=(e,t,r)=>e<<r-32|t>>>64-r;function m(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}let g=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),b=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0,w=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),v=(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0,x=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),_=(e,t,r,n,i,s)=>t+r+n+i+s+(e/0x100000000|0)|0},57813:(e,t,r)=>{"use strict";r.d(t,{m:()=>o});var n=r(74263),i=r(50016),s=r(10752);let a="/docs/contract/encodeDeployData";function o(e){let{abi:t,args:r,bytecode:o}=e;if(!r||0===r.length)return o;let l=t.find(e=>"type"in e&&"constructor"===e.type);if(!l)throw new n.YW({docsPath:a});if(!("inputs"in l)||!l.inputs||0===l.inputs.length)throw new n.YF({docsPath:a});let c=(0,s.h)(l.inputs,r);return(0,i.aP)([o,c])}},57924:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>s,__asyncDelegator:()=>v,__asyncGenerator:()=>w,__asyncValues:()=>x,__await:()=>b,__awaiter:()=>u,__classPrivateFieldGet:()=>I,__classPrivateFieldSet:()=>C,__createBinding:()=>f,__decorate:()=>o,__exportStar:()=>h,__extends:()=>i,__generator:()=>d,__importDefault:()=>A,__importStar:()=>
vendor: 4,139 bytes, line 251
251E,__makeTemplateObject:()=>_,__metadata:()=>c,__param:()=>l,__read:()=>y,__rest:()=>a,__spread:()=>m,__spreadArrays:()=>g,__values:()=>p});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function o(e,t,r,n){var i,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(a=(s<3?i(a):s>3?i(t,r,a):i(t,r))||a);return s>3&&a&&Object.defineProperty(t,r,a),a}function l(e,t){return function(r,n){t(r,n,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))(function(i,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((n=n.apply(e,t||[])).next())})}function d(e,t){var r,n,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){var l=[s,o];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){a.label=l[1];break}if(6===l[0]&&a.label<i[1]){a.label=i[1],i=l;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(l);break}i[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function f(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function h(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return a}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e}function g(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],a=0,o=s.length;a<o;a++,i++)n[i]=s[a];return n}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function w(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){i[e]&&(n[e]=function(t){return new Promise(function(r,n){
251s.push([e,t,r,n])>1||o(e,t)})})}function o(e,t){try{var r;(r=i[e](t)).value instanceof b?Promise.resolve(r.value.v).then(l,c):u(s[0][2],r)}catch(e){u(s[0][3],e)}}function l(e){o("next",e)}function c(e){o("throw",e)}function u(e,t){e(t),s.shift(),s.length&&o(s[0][0],s[0][1])}}function v(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function x(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){var s,a,o;s=n,a=i,o=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){s({value:e,done:o})},a)})}}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function A(e){return e&&e.__esModule?e:{default:e}}function I(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function C(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},57952:(e,t,r)=>{"use strict";r.d(t,{u:()=>s});var n=r(47240);let i=new Map;function s({fn:e,id:t,shouldSplitBatch:r,wait:s=0,sort:a}){let o=async()=>{let t=c();l();let r=t.map(({args:e})=>e);0!==r.length&&e(r).then(e=>{a&&Array.isArray(e)&&e.sort(a);for(let r=0;r<t.length;r++){let{resolve:n}=t[r];n?.([e[r],e])}}).catch(e=>{for(let r=0;r<t.length;r++){let{reject:n}=t[r];n?.(e)}})},l=()=>i.delete(t),c=()=>i.get(t)||[],u=e=>i.set(t,[...c(),e]);return{flush:l,async schedule(e){let{promise:t,resolve:i,reject:a}=(0,n.Y)();return(r?.([...c().map(({args:e})=>e),e])&&o(),c().length>0)?u({args:e,resolve:i,reject:a}):(u({args:e,resolve:i,reject:a}),setTimeout(o,s)),t}}}},58239:(e,t,r)=>{"use strict";r.d(t,{N:()=>c,b:()=>l});var n=r(24243),i=r(36174),s=r(12089),a=r(42606),o=r(55035);async function l(e,t){return c(e,t)}async function c(e,t){let{block:r,chain:l=e.chain,request:c}=t||{};try{let t=l?.fees?.maxPriorityFeePerGas??l?.fees?.defaultPriorityFee;if("function"==typeof t){let n=r||await (0,s.T)(e,a.g,"getBlock")({}),i=await t({block:n,client:e,request:c});if(null===i)throw Error();return i}if(void 0!==t)return t;let n=await e.request({method:"eth_maxPriorityFeePerGas"});return(0,i.uU)(n)}catch{let[t,i]=await Promise.all([r?Promise.resolve(r):(0,s.T)(e,a.g,"getBlock")({}),(0,s.T)(e,o.L,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new n.pw;let l=i-t.baseFeePerGas;if(l<0n)return 0n;return l}}},58433:(e,t,r)=>{"use strict";r.d(t,{r:()=>n});let n=(0,r(42467).x)({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:0x16041f6},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0xdb04c1}}})},58566:(e,t,r)=>{"use strict";r.d(t,{Bq:()=>l,Sl:()=>i,X:()=>a,eV:()=>o,kK:()=>s});var n=r(62610);function i(e,t){if(n.Ej(e)>t)throw new n.u({givenSize:n.Ej(e),maxSize:t})}function s(e,t){if("number"==typeof t&&t>0&&t>n.Ej(e)-1)throw new n.ii({offset:t,position:"start",size:n.Ej(e)})}function a(e,t,r){if("number"==typeof t&&"number"==typeof r&&n.Ej(e)!==r-t)throw new n.ii({offset:r,position:"end",size:n.Ej(e)})}function o(e,t={}){let{dir:r,size:i=32}=t;if(0===i)return e;let s=e.replace("0x","");if(s.length>2*i)throw new n.Fl({size:Math.ceil(s.length/2),targetSize:i,type:"Hex"});return`0x${s["right"===r?"padEnd":"padStart"](2*i,"0")}`}function l(e,t={}){let{dir:r="left"}=t,n=e.replace("0x",""),i=0;for(let e=0;e<n.length-1;e++)if("0"===n["left"===r?e:n.length-e-1].toString())i++;else break;return"0"===(n="left"===r?n.slice(i):n.slice(0,n.length-i))?"0x":"right"===r&&n.length%2==1?`0x${n}0`:`0x${n}`}},58701:(e,t,r)=>{"use strict";r.d(t,{a:()=>_,b:()=>v,c:()=>x,d:()=>b,e:()=>p,f:()=>y,i:()=>h,p:()=>g,u:()=>w});var n=r(33861),i=r(43489),s=r(75834),a=r(60336),o=r(87280),l=r(40175),c=r(20872),u=r(86253),d=r(37503),f=r(15171);function h(e){return["ethereum","solana"].includes(e.chainType)}function p(e){let t=e.replace("eip155:","");if(t)return parseInt(t);throw Error("Chain ID not compatible with CAIP-2 format.")}let y=e=>e.filter(e=>"wallets"===e.method||("exchange"===e.method?"coinbase"===e.provider:"card"===e.method||"payment-request"===e.method?"coinbase"===e.provider||"moonpay"===e.provider:(e.method,!1))),m={[i.rC.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[i.Gb.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[i.Rr.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[i.i_.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[i.n1.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[i.nM.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[i.E3.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[i.ZW.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[i.mZ.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[i.Cj.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[i.D8.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[i.Yn.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",[i.JN.id]:"0xb88339CB7199b77E23DB6E890353E22632Ba630f",[i.cl.id]:"0x754704Bc059F8C67012fEd69BC8A327a5aafb603"},g=({address:e,appConfig:t,fundWalletConfig:r,methodScreen:i,chainIdOverride:s,comingFromSendTransactionScreen:a=!1,onComplete:o,onError:l})=>{let c,u;if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let d=y(t.fundingConfig.options);if(d.length<1)throw Error("Wallet funding is not enabled");c=s||(r?.chain?r.chain.id:p(t.fundingConfig.defaultRecommendedCurrency.chain));let f=t.chains.find(e=>e.id===c);if(!f)throw new n.P(`Funding chain ${c} is not in PrivyProvider chains list`);let h=r?.amount??t.fundingConfig.defaultRecommendedAmount,g=!1;function b(){if(!c)return;let e=m[c];d.find(e=>"wallets"===e.method)&&!e&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),u=e,g=!0}r&&"asset"in r?"USDC"===r.asset?b():"string"!=typeof r.asset&&"erc20"in r.asset&&(g=(u=r.asset.erc20)===m[f.id]):"USDC"===t.fundingConfig.defaultRecommendedCurrency.asset&&b();let w=r?.defaultFundingMethod;return{chainType:"ethereum",address:e,amount:h,chain:f,erc20Address:u,erc20ContractInfo:g?{symbol:"USDC",decimals:6}:void 0,isUSDC:g,methodScreen:i,supportedOptions:d,comingFromSendTransactionScreen:a,defaultFundingMethod:w,usingDefaultFundingMethod:!!w,preferredCardProvider:r?.card?.preferredProvider,crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,solanaChain:"solana:mainnet",uiConfig:r&&"uiConfig"in r?r.uiConfig:void 0,externalSolanaFundingScreen:null,onComplete:o??(()=>{}),onError:l??(()=>{})}};function b({address:e,fundWalletConfig:t,appConfig:r,comingFromSendTransactionScreen:n,externalSolanaFundingScreen:i,methodScreen:s}){if(!r.fundingConfig)throw Error("Wallet funding is not enabled");let a=y(r.fundingConfig.options);if(a.length<1)throw Error("Wallet funding is not enabled");if("USDC"===t?.asset&&"solana:testnet"===t?.chain)throw Error("USDC funding is not supported on the Solana testnet");let o=t?.amount??r.fundingConfig.defaultRecommendedAmount,l=t?.defaultFundingMethod;return{chainType:"solana",address:e,supportedOptions:a,amount:o,isUSDC:"USDC"===t?.asset,methodScreen:s,comingFromSendTransactionScreen:n,chain:t?.chain||"solana:mainnet",crossChainBridgingEnabled:r.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:l,preferredCardProvider:t?.card?.preferredProvider,usingDefaultFundingMethod:!!l,uiConfig:t?.uiConfig,externalSolanaFundingScreen:i,onComplete:()=>{},onError:()=>{}}}function w(){let{user:e,getAccessToken:t}=(0,o.u)(),{walletProxy:r,openModal:i,client:f}=(0,u.u)(),{setModalData:p}=(0,d.u)(),y=(0,l.u)();return(0,s.useMemo)(()=>({exportWallet:s=>new Promise(async(l,u)=>{if(!e)return void u(Error("User must be authenticated before exporting their Privy wallet"));s&&"target"in s&&s&&(s=void 0);let d=s?.address?(0,o.f)(e,s.address):(0,o.b)(e);if(!d)return void u(new n.P("User must have an embedded wallet."));let m=d.address,{entropyId:g,entropyIdVerifier:b}=(0,c.g)(e,d),w=(0,o.a)(d);if(!m)return void u(Error("User does not have an HD Ethereum wallet. To export an imported wallet, pass the `address` of the wallet to `exportWallet`."));
251if(!(0,a.P)(m))return void u(Error("Must provide a valid Ethereum address."));let v={recoveryMethod:d.recoveryMethod,connectingWalletAddress:d.address,isUnifiedWallet:w,entropyId:g,entropyIdVerifier:b,onCompleteNavigateTo:"EmbeddedWalletKeyExportScreen",onFailure:u,shouldForceMFA:!0};await t()&&r?h(d)?(p({keyExport:{appId:y.id,appClientId:y.appClientId,origin:f.apiUrl,address:d.address,entropyId:g,entropyIdVerifier:b,hdWalletIndex:d.walletIndex,chainType:d.chainType,walletId:d.id,isUnifiedWallet:w,imported:d.imported,onSuccess:l,onFailure:u,showBackButton:s?.showBackButton},connectWallet:v}),i("EmbeddedWalletConnectingScreen")):u(Error(`Export is not supported for ${d.chainType} wallets`)):u(Error("Must have valid access token."))})}),[e,t,r,i,f,p,y])}let v=()=>{let{authenticated:e,user:t}=(0,o.u)(),{openModal:r,inProgressAuthFlowRef:i,inProgressLoginOrLinkMethodRef:a}=(0,u.u)(),l=(0,f.a)();return{update:(0,s.useCallback)(()=>{if(!e)throw l("linkAccount","onError",n.a.MUST_BE_AUTHENTICATED,{linkMethod:"email"}),new n.P("User must be authenticated before linking an account.");if(!t?.email)throw new n.P("User does not have an email linked to their account.");i.current="update",a.current="email",r("UpdateEmailScreen")},[e,l,i,a,r,t])}},x=()=>{let{authenticated:e,user:t}=(0,o.u)(),{openModal:r,inProgressAuthFlowRef:i,inProgressLoginOrLinkMethodRef:a}=(0,u.u)(),l=(0,f.a)();return{update:(0,s.useCallback)(()=>{if(!e)throw l("linkAccount","onError",n.a.MUST_BE_AUTHENTICATED,{linkMethod:"sms"}),new n.P("User must be authenticated before linking an account.");if(!t?.phone)throw new n.P("User does not have a phone number linked to their account.");i.current="update",a.current="sms",r("UpdatePhoneScreen")},[e,l,i,a,r,t])}},_=()=>{let{client:e,setUser:t}=(0,u.u)();return{unlink:(0,s.useCallback)(async({address:r})=>{let n;return t(n=r.startsWith("0x")?await e.unlinkEthereumWallet(r):await e.unlinkSolanaWallet(r)),n},[e,t])}}},58797:(e,t,r)=>{"use strict";r.d(t,{d:()=>o});var n=r(44037),i=r(43793),s=r(2939),a=r(32579);function o(e){let{commitments:t,version:r}=e,o=e.to??("string"==typeof t[0]?"hex":"bytes"),l=[];for(let e of t)l.push(function(e){let{commitment:t,version:r=1}=e,o=e.to??("string"==typeof t?"hex":"bytes"),l=function(e,t){let r=(0,i.sc)((0,s.q)(e,{strict:!1})?(0,a.ZJ)(e):e);return"bytes"===(t||"hex")?r:(0,n.nj)(r)}(t,"bytes");return l.set([r],0),"bytes"===o?l:(0,n.My)(l)}({commitment:e,to:o,version:r}));return l}},58914:(e,t,r)=>{"use strict";var n=r(87980);r.o(n,"IJsonRpcProvider")&&r.d(t,{IJsonRpcProvider:function(){return n.IJsonRpcProvider}}),r.o(n,"formatJsonRpcError")&&r.d(t,{formatJsonRpcError:function(){return n.formatJsonRpcError}}),r.o(n,"formatJsonRpcRequest")&&r.d(t,{formatJsonRpcRequest:function(){return n.formatJsonRpcRequest}}),r.o(n,"formatJsonRpcResult")&&r.d(t,{formatJsonRpcResult:function(){return n.formatJsonRpcResult}}),r.o(n,"getBigIntRpcId")&&r.d(t,{getBigIntRpcId:function(){return n.getBigIntRpcId}}),r.o(n,"isHttpUrl")&&r.d(t,{isHttpUrl:function(){return n.isHttpUrl}}),r.o(n,"isJsonRpcError")&&r.d(t,{isJsonRpcError:function(){return n.isJsonRpcError}}),r.o(n,"isJsonRpcRequest")&&r.d(t,{isJsonRpcRequest:function(){return n.isJsonRpcRequest}}),r.o(n,"isJsonRpcResponse")&&r.d(t,{isJsonRpcResponse:function(){return n.isJsonRpcResponse}}),r.o(n,"isJsonRpcResult")&&r.d(t,{isJsonRpcResult:function(){return n.isJsonRpcResult}}),r.o(n,"isLocalhostUrl")&&r.d(t,{isLocalhostUrl:function(){return n.isLocalhostUrl}}),r.o(n,"isReactNative")&&r.d(t,{isReactNative:function(){return n.isReactNative}}),r.o(n,"isWsUrl")&&r.d(t,{isWsUrl:function(){return n.isWsUrl}}),r.o(n,"payloadId")&&r.d(t,{payloadId:function(){return n.payloadId}})},59206:(e,t,r)=>{"use strict";r.d(t,{H2:()=>a,Ty:()=>i,u:()=>o,xO:()=>s});var n=r(99838);class i extends n.C{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class s extends n.C{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class a extends n.C{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}n.C,n.C,n.C,n.C;class o extends n.C{constructor({givenSize:e,maxSize:t}
251){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}},59395:(e,t,r)=>{var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(i.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function d(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function f(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function h(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){if(this.bodyUsed=this.bodyUsed,this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(i.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(i.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var t;i.arrayBuffer&&i.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e)}else this._noBody=!0,this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i.blob)return this.blob().then(h);throw Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,i,s=d(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),i=(n=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?n[1]:"utf-8",t.readAsText(e,i),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},i.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=o(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[o(e)]},u.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},u.prototype.set=function(e,t){this.map[o(e)]=l(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),c(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),c(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),c(e)},i.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var m=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function g(e,t){if(!(this instanceof g))throw TypeError('Please use the "new" operator, this DOM object c
251onstructor cannot be called as a function.');var r,i,s=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,s||null==e._bodyInit||(s=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=(i=(r=t.method||this.method||"GET").toUpperCase(),m.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return new AbortController().signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),("GET"===this.method||"HEAD"===this.method)&&("no-store"===t.cache||"no-cache"===t.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function b(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function w(e,t){if(!(this instanceof w))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},y.call(g.prototype),y.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var v=[301,302,303,307,308];w.redirect=function(e,t){if(-1===v.indexOf(t))throw RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function x(e,r){return new Promise(function(s,a){var c=new g(e,r);if(c.signal&&c.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function f(){d.abort()}if(d.onload=function(){var e,t,r={statusText:d.statusText,headers:(e=d.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();try{t.append(n,i)}catch(e){console.warn("Response "+e.message)}}}),t)};0===c.url.indexOf("file://")&&(d.status<200||d.status>599)?r.status=200:r.status=d.status,r.url="responseURL"in d?d.responseURL:r.headers.get("X-Request-URL");var n="response"in d?d.response:d.responseText;setTimeout(function(){s(new w(n,r))},0)},d.onerror=function(){setTimeout(function(){a(TypeError("Network request failed"))},0)},d.ontimeout=function(){setTimeout(function(){a(TypeError("Network request timed out"))},0)},d.onabort=function(){setTimeout(function(){a(new t.DOMException("Aborted","AbortError"))},0)},d.open(c.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(c.url),!0),"include"===c.credentials?d.withCredentials=!0:"omit"===c.credentials&&(d.withCredentials=!1),"responseType"in d&&(i.blob?d.responseType="blob":i.arrayBuffer&&(d.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof u||n.Headers&&r.headers instanceof n.Headers)){var h=[];
251Object.getOwnPropertyNames(r.headers).forEach(function(e){h.push(o(e)),d.setRequestHeader(e,l(r.headers[e]))}),c.headers.forEach(function(e,t){-1===h.indexOf(t)&&d.setRequestHeader(t,e)})}else c.headers.forEach(function(e,t){d.setRequestHeader(t,e)});c.signal&&(c.signal.addEventListener("abort",f),d.onreadystatechange=function(){4===d.readyState&&c.signal.removeEventListener("abort",f)}),d.send(void 0===c._bodyInit?null:c._bodyInit)})}x.polyfill=!0,n.fetch||(n.fetch=x,n.Headers=u,n.Request=g,n.Response=w),t.Headers=u,t.Request=g,t.Response=w,t.fetch=x,Object.defineProperty(t,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var s=n.fetch?n:i;(t=s.fetch).default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t},59681:(e,t,r)=>{"use strict";r.d(t,{G:()=>n});class n extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}}},60031:(e,t,r)=>{"use strict";r.d(t,{L:()=>s});var n=r(75834),i=r(40852);function s(){let[e]=(0,n.useState)(i.e);return(0,n.useEffect)(()=>()=>e.dispose(),[e]),e}},60336:(e,t,r)=>{"use strict";r.d(t,{P:()=>o});var n=r(42450),i=r(11400);let s=/^0x[a-fA-F0-9]{40}$/,a=new n.A(8192);function o(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(a.has(n))return a.get(n);let o=!!s.test(e)&&(e.toLowerCase()===e||!r||(0,i.o)(e)===e);return a.set(n,o),o}},60449:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}},60975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=void 0,t.keccakP=w;let n=r(35098),i=r(61861),s=BigInt(0),a=BigInt(1),o=BigInt(2),l=BigInt(7),c=BigInt(256),u=BigInt(113),d=[],f=[],h=[];for(let e=0,t=a,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],d.push(2*(5*n+r)),f.push((e+1)*(e+2)/2%64);let i=s;for(let e=0;e<7;e++)(t=(t<<a^(t>>l)*u)%c)&o&&(i^=a<<(a<<BigInt(e))-a);h.push(i)}let p=(0,n.split)(h,!0),y=p[0],m=p[1],g=(e,t,r)=>r>32?(0,n.rotlBH)(e,t,r):(0,n.rotlSH)(e,t,r),b=(e,t,r)=>r>32?(0,n.rotlBL)(e,t,r):(0,n.rotlSL)(e,t,r);function w(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,s=r[i],a=r[i+1],o=g(s,a,1)^r[n],l=b(s,a,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=f[r],s=g(t,i,n),a=b(t,i,n),o=d[r];t=e[o],i=e[o+1],e[o]=s,e[o+1]=a}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=y[n],e[1]^=m[n]}(0,i.clean)(r)}class v extends i.Hash{constructor(e,t,r,n=!1,s=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=r,this.enableXOF=n,this.rounds=s,(0,i.anumber)(r),!(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),w(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:r}=this,n=e.length;for(let i=0;i<n;){let s=Math.min(t-this.pos,n-i);for(let t=0;t<s;t++)r[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:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,i.aexists)(this,!1),(0,i.abytes)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}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:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new v(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}t.Keccak=v;let x=(e,t,r)=>(0,i.createHasher)(()=>new v(t,e,r));t.sha3_224=x(6,144,28),t.sha3_256=x(6,136,32),t.sha3_384=x(6,104,48),t.sha3_512=x(6,72,64),t.keccak_224=x(1,144,28),t.keccak_256=x(1,136,32),t.keccak_384=x(1,104,48),t.keccak_512=x(1,72,64);let _=(e,t,r)=>(0,i.createXOFer)((n={})=>new v(t,e,void 0===n.dkLen?r:n.dkLen,!0));t.shake128=_(31,168,16),t.shake256=_(31,136,32)},61161:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>o});let n=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,s=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function a(e,t){var r;return"__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t?void(r=e,console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)):t}function o(e,t={}){if("string"!=typeof e)return e;if('"'===e[0]&&'"'===e[e.length-1]&&-1===e.indexOf("\\"))return e.slice(1,-1);let r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return NaN;case"infinity":return 1/0;case"-infinity":return-1/0}if(!s.test(e)){if(t.strict)throw SyntaxError("[destr] Invalid JSON");return e}try{if(n.test(e)||i.test(e)){if(t.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(e,a)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}},61349:(e,t,r)=>{"use strict";r.d(t,{j:()=>l});var n=r(74263),i=r(99838),s=r(97687),a=r(4544),o=r(47450);function l(e,{abi:t,address:r,args:l,docsPath:c,functionName:u,sender:d}){let f=e instanceof s.$S?e:e instanceof i.C?e.walk(e=>"data"in e)||e.walk():{},{code:h,data:p,details:y,message:m,shortMessage:g}=f,b=e instanceof n.O?new s.rR({functionName:u,cause:e}
251):[3,o.bq.code].includes(h)&&(p||y||m||g)||h===o.Di.code&&"execution reverted"===y&&p?new s.M({abi:t,data:"object"==typeof p?p.data:p,functionName:u,message:f instanceof a.J8?y:g??m,cause:e}):e;return new s.bG(b,{abi:t,args:l,contractAddress:r,docsPath:c,functionName:u,sender:d})}},61354:(e,t,r)=>{"use strict";r.d(t,{L:()=>i});var n=r(68145);function i(e){if(e.type)return e.type;if(void 0!==e.authorizationList)return"eip7702";if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new n.Vg({transaction:e})}},61526:(e,t,r)=>{"use strict";r.d(t,{yH:()=>c});var n=r(23971),i=r(11693),s=r(93774),a=r(60336),o=r(44037);function l(e){if(e&&0!==e.length)return e.reduce((e,{slot:t,value:r})=>{if(66!==t.length)throw new i.NV({size:t.length,targetSize:66,type:"hex"});if(66!==r.length)throw new i.NV({size:r.length,targetSize:66,type:"hex"});return e[t]=r,e},{})}function c(e){if(!e)return;let t={};for(let{address:r,...i}of e){if(!(0,a.P)(r,{strict:!1}))throw new n.M({address:r});if(t[r])throw new s.Hi({address:r});t[r]=function(e){let{balance:t,nonce:r,state:n,stateDiff:i,code:a}=e,c={};
251if(void 0!==a&&(c.code=a),void 0!==t&&(c.balance=(0,o.cK)(t)),void 0!==r&&(c.nonce=(0,o.cK)(r)),void 0!==n&&(c.state=l(n)),void 0!==i){if(c.state)throw new s.ft;c.stateDiff=l(i)}return c}(i)}return t}},61861:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=i,t.anumber=s,t.abytes=a,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");s(e.outputLen),s(e.blockLen)},t.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")},t.aoutput=function(e,t){a(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)},t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},t.clean=function(...e){for(let t=0;t<e.length;t++)e[t].fill(0)},t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},t.rotr=function(e,t){return e<<32-t|e>>>t},t.rotl=function(e,t){return e<<t|e>>>32-t>>>0},t.byteSwap=o,t.byteSwap32=l,t.bytesToHex=function(e){if(a(e),c)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=u[e[r]];return t},t.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,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=f(e.charCodeAt(i)),s=f(e.charCodeAt(i+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+s}return n},t.asyncLoop=h,t.utf8ToBytes=p,t.bytesToUtf8=function(e){return new TextDecoder().decode(e)},t.toBytes=y,t.kdfInputToBytes=function(e){return"string"==typeof e&&(e=p(e)),a(e),e},t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];a(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r},t.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)},t.createHasher=g,t.createOptHasher=b,t.createXOFer=w,t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return Uint8Array.from(n.crypto.randomBytes(e));throw Error("crypto.getRandomValues must be defined")};let n=r(65701);function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(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}t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],t.swap8IfBE=t.isLE?e=>e:e=>o(e),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?e=>e:l;let c="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),d={_0:48,_9:57,A:65,F:70,a:97,f:102};function f(e){return e>=d._0&&e<=d._9?e-d._0:e>=d.A&&e<=d.F?e-(d.A-10):e>=d.a&&e<=d.f?e-(d.a-10):void 0}async function h(e,r,n){let i=Date.now();for(let s=0;s<e;s++){n(s);let e=Date.now()-i;e>=0&&e<r||(await (0,t.nextTick)(),i+=e)}}function p(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function y(e){return"string"==typeof e&&(e=p(e)),a(e),e}t.nextTick=async()=>{};class m{}function g(e){let t=t=>e().update(y(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function b(e){let t=(t,r)=>e(r).update(y(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function w(e){let t=(t,r)=>e(r).update(y(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}t.Hash=m,t.wrapConstructor=g,t.wrapConstructorWithOpts=b,t.wrapXOFConstructorWithOpts=w},62276:(e,t,r)=>{"use strict";function n(e,{format:t}){if(!t)return{};let r={};return!function t(n){for(let i of Object.keys(n))i in e&&(r[i]=e[i]),n[i]&&"object"==typeof n[i]&&!Array.isArray(n[i])&&t(n[i])}(t(e||{})),r}r.d(t,{o:()=>n})},62495:(e,t,r)=>{"use strict";r.d(t,{n:()=>p});var n=r(12480),i=r(68145),s=r(29447),a=r(81561),o=r(47240),l=r(96793),c=r(40508),u=r(32560),d=r(41537),f=r(50963),h=r(73260);async function p(e,t){let r,p,y,m,g,{checkReplacement:b=!0,confirmations:w=1,hash:v,onReplaced:x,retryCount:_=6,retryDelay:E=({count:e})=>200*~~(1<<e),timeout:A=18e4}=t,I=(0,c.A)(["waitForTransactionReceipt",e.uid,v]),C=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval,S=!1,{promise:P,resolve:$,reject:k}=(0,o.Y)(),T=A?setTimeout(()=>{g?.(),m?.(),k(new i.WA({hash:v}))},A):void 0;return m=(0,a.lB)(I,{onReplaced:x,resolve:$,reject:k},async t=>{if((y=await (0,s.T)(e,f.h,"getTransactionReceipt")({hash:v}).catch(()=>void 0))&&w<=1){clearTimeout(T),t.resolve(y),m?.();return}g=(0,s.T)(e,h.q,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:C,async onBlockNumber(a){let o=e=>{clearTimeout(T),g?.(),e(),m?.()},c=a;if(!S)try{if(y){if(w>1&&(!y.blockNumber||c-y.blockNumber+1n<w))return;o(()=>t.resolve(y));return}if(b&&!r&&(S=!0,await (0,l.b)(async()=>{(r=await (0,s.T)(e,d.x,"getTransaction")({hash:v})).blockNumber&&(c=r.blockNumber)},{delay:E,retryCount:_}),S=!1),y=await (0,s.T)(e,f.h,"getTransactionReceipt")({hash:v}),w>1&&(!y.blockNumber||c-y.blockNumber+1n<w))return;o(()=>t.resolve(y))}catch(a){if(a instanceof i.Kz||a instanceof i.Kc){if(!r){S=!1;return}try{p=r,S=!0;let i=await (0,l.b)(()=>(0,s.T)(e,u.g,"getBlock")({blockNumber:c,includeTransactions:!0}),{delay:E,retryCount:_,shouldRetry:({error:e})=>e instanceof n.l});S=!1;let a=i.transactions.find(({from:e,nonce:t})=>e===p.from&&t===p.nonce);if(!a||(y=await (0,s.T)(e,f.h,"getTransactionReceipt")({hash:a.hash}),w>1&&(!y.blockNumber||c-y.blockNumber+1n<w)))return;let d="replaced";a.to===p.to&&a.value===p.value&&a.input===p.input?d="repriced":a.from===a.to&&0n===a.value&&(d="cancelled"),o(()=>{t.onReplaced?.({reason:d,replacedTransaction:p,transaction:a,transactionReceipt:y}),t.resolve(y)})}catch(e){o(()=>t.reject(e))}}else o(()=>t.reject(a))}}})}),P}},62516:(e,t,r)=>{"use strict";r.d(t,{Hi:()=>i,ft:()=>s,uj:()=>o});var n=r(99838);class i extends n.C{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class s extends n.C{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentC
251onflictError"})}}function a(e){return e.reduce((e,{slot:t,value:r})=>`${e}        ${t}: ${r}
252`,"")}function o(e){return e.reduce((e,{address:t,...r})=>{let n=`${e}    ${t}:
253`;return r.nonce&&(n+=`      nonce: ${r.nonce}
254`),r.balance&&(n+=`      balance: ${r.balance}
255`),r.code&&(n+=`      code: ${r.code}
256`),r.state&&(n+="      state:\n",n+=a(r.state)),r.stateDiff&&(n+="      stateDiff:\n",n+=a(r.stateDiff)),n},"  State Override:\n").slice(0,-1)}},62610:(e,t,r)=>{"use strict";r.d(t,{Dg:()=>E,Ej:()=>x,Fl:()=>R,HT:()=>f,Ho:()=>g,M7:()=>b,Mr:()=>_,Ro:()=>I,Ty:()=>P,ZJ:()=>A,dI:()=>C,di:()=>v,ii:()=>N,o4:()=>T,oB:()=>y,sH:()=>m,tf:()=>S,u:()=>O,uK:()=>p,vA:()=>u,xW:()=>d,xb:()=>h,yT:()=>w});var n=r(21332),i=r(64959),s=r(23392),a=r(58566),o=r(52511);let l=new TextEncoder,c=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function u(e,t={}){let{strict:r=!1}=t;if(!e||"string"!=typeof e)throw new $(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e)||!e.startsWith("0x"))throw new k(e)}function d(...e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}function f(e){return e instanceof Uint8Array?p(e):Array.isArray(e)?p(new Uint8Array(e)):e}function h(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?(a.Sl(r,t.size),g(r,t.size)):r}function p(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=c[e[t]];let n=`0x${r}`;return"number"==typeof t.size?(a.Sl(n,t.size),b(n,t.size)):n}function y(e,t={}){let r,{signed:n,size:i}=t,s=BigInt(e);i?r=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let a="bigint"==typeof r&&n?-r-1n:0;if(r&&s>r||s<a){let t="bigint"==typeof e?"n":"";throw new P({max:r?`${r}${t}`:void 0,min:`${a}${t}`,signed:n,size:i,value:`${e}${t}`})}let o=(n&&s<0?BigInt.asUintN(8*i,BigInt(s)):s).toString(16),l=`0x${o}`;return i?g(l,i):l}function m(e,t={}){return p(l.encode(e),t)}function g(e,t){return a.eV(e,{dir:"left",size:t})}function b(e,t){return a.eV(e,{dir:"right",size:t})}function w(e){return p(n.yT(e))}function v(e,t,r,n={}){let{strict:i}=n;a.kK(e,t);let s=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return i&&a.X(s,t,r),s}function x(e){return Math.ceil((e.length-2)/2)}function _(e){return a.Bq(e,{dir:"left"})}function E(e,t={}){let{signed:r}=t;t.size&&a.Sl(e,t.size);let n=BigInt(e);if(!r)return n;let i=(1n<<8n*BigInt((e.length-2)/2))-1n;return n<=i>>1n?n:n-i-1n}function A(e,t={}){return n.aD(e,t)}function I(e,t={}){let{signed:r,size:n}=t;return r||n?Number(E(e,t)):Number(e)}function C(e,t={}){let{size:r}=t,i=n.aD(e);return r&&(s.Sl(i,r),i=n.$T(i)),new TextDecoder().decode(i)}function S(e,t={}){let{strict:r=!1}=t;try{return u(e,{strict:r}),!0}catch{return!1}}class P extends i.C{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number \`${i}\` is not in safe${n?` ${8*n}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}i.C;class $ extends i.C{constructor(e){super(`Value \`${"object"==typeof e?o.As(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class k extends i.C{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class T extends i.C{constructor(e){super(`Hex value \`"${e}"\` is an odd length (${e.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}class O extends i.C{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class N extends i.C{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class R extends i.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}},62687:(e,t,r)=>{"use strict";r.d(t,{_:()=>C,e:()=>S});var n=r(75834),i=r(60031),s=r(35424),a=r(96313),o=r(53160),l=r(63455),c=r(88160),u=r(52368),d=r(35259),f=r(67714),h=r(98966),p=r(6194),y=r(30749);function m(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!(0,y.zv)(null!=(t=e.as)?t:_)||1===n.Children.count(e.children)}let g=(0,n.createContext)(null);g.displayName="TransitionContext";var b=(e=>(e.Visible="visible",e.Hidden="hidden",e))(b||{});let w=(0,n.createContext)(null);function v(e){return"children"in e?v(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function x(e,t){let r=(0,l.Y)(e),o=(0,n.useRef)([]),c=(0,a.a)(),u=(0,i.L)(),d=(0,s._)((e,t=y.mK.Hidden)=>{let n=o.current.findIndex(({el:t})=>t===e);-1!==n&&((0,p.Y)(t,{[y.mK.Unmount](){o.current.splice(n,1)},[y.mK.Hidden](){o.current[n].state="hidden"}}),u.microTask(()=>{var e;!v(o)&&c.current&&(null==(e=r.current)||e.call(r))}))}),f=(0,s._)(e=>
256{let t=o.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):o.current.push({el:e,state:"visible"}),()=>d(e,y.mK.Unmount)}),h=(0,n.useRef)([]),m=(0,n.useRef)(Promise.resolve()),g=(0,n.useRef)({enter:[],leave:[]}),b=(0,s._)((e,r,n)=>{h.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(([t])=>t!==e)),null==t||t.chains.current[r].push([e,new Promise(e=>{h.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(g.current[r].map(([e,t])=>t)).then(()=>e())})]),"enter"===r?m.current=m.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),w=(0,s._)((e,t,r)=>{Promise.all(g.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=h.current.shift())||e()}).then(()=>r(t))});return(0,n.useMemo)(()=>({children:o,register:f,unregister:d,onStart:b,onStop:w,wait:m,chains:g}),[f,d,o,b,w,g,m])}w.displayName="NestingContext";let _=n.Fragment,E=y.Ac.RenderStrategy,A=(0,y.FX)(function(e,t){let{show:r,appear:i=!1,unmount:a=!0,...l}=e,d=(0,n.useRef)(null),h=m(e),p=(0,u.P)(...h?[d,t]:null===t?[]:[t]);(0,c.g)();let b=(0,f.O_)();if(void 0===r&&null!==b&&(r=(b&f.Uw.Open)===f.Uw.Open),void 0===r)throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[_,A]=(0,n.useState)(r?"visible":"hidden"),C=x(()=>{r||A("hidden")}),[S,P]=(0,n.useState)(!0),$=(0,n.useRef)([r]);(0,o.s)(()=>{!1!==S&&$.current[$.current.length-1]!==r&&($.current.push(r),P(!1))},[$,r]);let k=(0,n.useMemo)(()=>({show:r,appear:i,initial:S}),[r,i,S]);(0,o.s)(()=>{r?A("visible"):v(C)||null===d.current||A("hidden")},[r,C]);let T={unmount:a},O=(0,s._)(()=>{var t;S&&P(!1),null==(t=e.beforeEnter)||t.call(e)}),N=(0,s._)(()=>{var t;S&&P(!1),null==(t=e.beforeLeave)||t.call(e)}),R=(0,y.Ci)();return n.createElement(w.Provider,{value:C},n.createElement(g.Provider,{value:k},R({ourProps:{...T,as:n.Fragment,children:n.createElement(I,{ref:p,...T,...l,beforeEnter:O,beforeLeave:N})},theirProps:{},defaultTag:n.Fragment,features:E,visible:"visible"===_,name:"Transition"})))}),I=(0,y.FX)(function(e,t){var r,i;let{transition:a=!0,beforeEnter:l,afterEnter:b,beforeLeave:A,afterLeave:I,enter:C,enterFrom:S,enterTo:P,entered:$,leave:k,leaveFrom:T,leaveTo:O,...N}=e,[R,B]=(0,n.useState)(null),D=(0,n.useRef)(null),M=m(e),U=(0,u.P)(...M?[D,t,B]:null===t?[]:[t]),j=null==(r=N.unmount)||r?y.mK.Unmount:y.mK.Hidden,{show:L,appear:F,initial:z}=function(){let e=(0,n.useContext)(g);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[q,W]=(0,n.useState)(L?"visible":"hidden"),H=function(){let e=(0,n.useContext)(w);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:K,unregister:V}=H;(0,o.s)(()=>K(D),[K,D]),(0,o.s)(()=>{if(j===y.mK.Hidden&&D.current)return L&&"visible"!==q?void W("visible"):(0,p.Y)(q,{hidden:()=>V(D),visible:()=>K(D)})},[q,D,K,V,L,j]);let G=(0,c.g)();(0,o.s)(()=>{if(M&&G&&"visible"===q&&null===D.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[D,q,G,M]);let J=z&&!F,Y=F&&L&&z,Z=(0,n.useRef)(!1),Q=x(()=>{Z.current||(W("hidden"),V(D))},H),X=(0,s._)(e=>{Z.current=!0,Q.onStart(D,e?"enter":"leave",e=>{"enter"===e?null==l||l():"leave"===e&&(null==A||A())})}),ee=(0,s._)(e=>{let t=e?"enter":"leave";Z.current=!1,Q.onStop(D,t,e=>{"enter"===e?null==b||b():"leave"===e&&(null==I||I())}),"leave"!==t||v(Q)||(W("hidden"),V(D))});(0,n.useEffect)(()=>{M&&a||(X(L),ee(L))},[L,M,a]);let et=!(!a||!M||!G||J),[,er]=(0,d.p)(et,R,L,{start:X,end:ee}),en=(0,y.oE)({ref:U,className:(null==(i=(0,h.x)(N.className,Y&&C,Y&&S,er.enter&&C,er.enter&&er.closed&&S,er.enter&&!er.closed&&P,er.leave&&k,er.leave&&!er.closed&&T,er.leave&&er.closed&&O,!er.transition&&L&&$))?void 0:i.trim())||void 0,...(0,d.B)(er)}),ei=0;"visible"===q&&(ei|=f.Uw.Open),"hidden"===q&&(ei|=f.Uw.Closed),L&&"hidden"===q&&(ei|=f.Uw.Opening),L||"visible"!==q||(ei|=f.Uw.Closing);let es=(0,y.Ci)();return n.createElement(w.Provider,{value:Q},n.createElement(f.El,{value:ei},es({ourProps:en,theirProps:N,defaultTag:_,features:E,visible:"visible"===q,name:"Transition.Child"})))}),C=(0,y.FX)(function(e,t){let r=null!==(0,n.useContext)(g),i=null!==(0,f.O_)();return n.createElement(n.Fragment,null,!r&&i?n.createElement(A,{ref:t,...e}):n.createElement(I,{ref:t,...e}))}),S=Object.assign(A,{Child:C,Root:A})},63228:(e,t,r)=>{"use strict";r.d(t,{_:()=>a});var n=Object.defineProperty,i=(e,t,r)=>(((e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),r);class s{constructor(){i(this,"current",this.detect()),i(this,"handoffState","pending"),i(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server"
256:"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}}let a=new s},63349:(e,t,r)=>{"use strict";r.d(t,{O:()=>o});var n=r(75834),i=r(40852),s=r(36207),a=r(63455);function o(e,t,r){let o=(0,a.Y)(e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&r()});(0,n.useEffect)(()=>{if(!e)return;let r=null===t?null:s.sb(t)?t:t.current;if(!r)return;let n=(0,i.e)();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver(()=>o.current(r));e.observe(r),n.add(()=>e.disconnect())}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver(()=>o.current(r));e.observe(r),n.add(()=>e.disconnect())}return()=>n.dispose()},[t,o,e])}},63455:(e,t,r)=>{"use strict";r.d(t,{Y:()=>s});var n=r(75834),i=r(53160);function s(e){let t=(0,n.useRef)(e);return(0,i.s)(()=>{t.current=e},[e]),t}},63547:(e,t,r)=>{"use strict";r.d(t,{iY:()=>l});var n=r(45897),i=r(2939),s=r(60336),a=r(43024),o=r(65402);function l(e){let t,{abi:r,args:l=[],name:c}=e,u=(0,i.q)(c,{strict:!1}),d=r.filter(e=>u?"function"===e.type?(0,o.V)(e)===c:"event"===e.type&&(0,a.h)(e)===c:"name"in e&&e.name===c);if(0!==d.length){if(1===d.length)return d[0];for(let e of d){if("inputs"in e){if(!l||0===l.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(e.inputs&&0!==e.inputs.length&&e.inputs.length===l.length&&l.every((t,r)=>{let n="inputs"in e&&e.inputs[r];return!!n&&function e(t,r){let n=typeof t,i=r.type;switch(i){case"address":return(0,s.P)(t,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:if("tuple"===i&&"components"in r)return Object.values(r.components).every((r,i)=>"object"===n&&e(Object.values(t)[i],r));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i))return"number"===n||"bigint"===n;if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i))return"string"===n||t instanceof Uint8Array;
256if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i))return Array.isArray(t)&&t.every(t=>e(t,{...r,type:i.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}(t,n)})){if(t&&"inputs"in t&&t.inputs){let r=function e(t,r,n){for(let i in t){let a=t[i],o=r[i];if("tuple"===a.type&&"tuple"===o.type&&"components"in a&&"components"in o)return e(a.components,o.components,n[i]);let l=[a.type,o.type];if(l.includes("address")&&l.includes("bytes20")||(l.includes("address")&&l.includes("string")||l.includes("address")&&l.includes("bytes"))&&(0,s.P)(n[i],{strict:!1}))return l}}(e.inputs,t.inputs,l);if(r)throw new n.nM({abiItem:e,type:r[0]},{abiItem:t,type:r[1]})}t=e}}}return t||d[0]}}},63710:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}r.d(t,{J:()=>n})},63965:(e,t,r)=>{"use strict";r.d(t,{j:()=>n});let n=({origin:e,path:t,query:r={},hash:n={}})=>{let i=new URL(t,e.endsWith("/")?e:`${e}/`);for(let[e,t]of Object.entries(r))void 0!==t&&i.searchParams.set(e,t);let s=Object.entries(n);if(s.length>0){let e=new URLSearchParams;for(let[t,r]of s)void 0!==r&&e.append(t,r);i.hash=e.toString()}return i.href}},64072:(e,t,r)=>{"use strict";r.d(t,{EQ:()=>o});var n=r(99838),i=r(39345),s=r(36665),a=r(651);function o(e,t="hex"){let r=function e(t){return Array.isArray(t)?function(e){let t=e.reduce((e,t)=>e+t.length,0),r=l(t);return{length:t<=55?1+t:1+r+t,encode(n){for(let{encode:i}of(t<=55?n.pushByte(192+t):(n.pushByte(247+r),1===r?n.pushUint8(t):2===r?n.pushUint16(t):3===r?n.pushUint24(t):n.pushUint32(t)),e))i(n)}}}(t.map(t=>e(t))):function(e){let t="string"==typeof e?(0,s.aT)(e):e,r=l(t.length);return{length:1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(e){1===t.length&&t[0]<128||(t.length<=55?e.pushByte(128+t.length):(e.pushByte(183+r),1===r?e.pushUint8(t.length):2===r?e.pushUint16(t.length):3===r?e.pushUint24(t.length):e.pushUint32(t.length))),e.pushBytes(t)}}}(t)}(e),n=(0,i.l)(new Uint8Array(r.length));return(r.encode(n),"hex"===t)?(0,a.My)(n.bytes):n.bytes}function l(e){if(e<256)return 1;if(e<65536)return 2;if(e<0x1000000)return 3;if(e<0x100000000)return 4;throw new n.C("Length is too large.")}},64233:(e,t,r)=>{"use strict";r.d(t,{a:()=>h});var n=r(97352),i=r(24243),s=r(74079),a=r(62276),o=r(20169),l=r(23274),c=r(12089),u=r(94383),d=r(42606),f=r(72767);async function h(e,t){let{account:r=e.account,accessList:h,authorizationList:p,chain:y=e.chain,blobVersionedHashes:m,blobs:g,data:b,gas:w,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:_,maxPriorityFeePerGas:E,nonce:A,nonceManager:I,to:C,type:S,value:P,...$}=t,k=await (async()=>{if(!r||!I||void 0!==A)return A;let t=(0,n.J)(r),i=y?y.id:await (0,c.T)(e,f.T,"getChainId")({});return await I.consume({address:t.address,chainId:i,client:e})})();(0,u.c)(t);let T=y?.formatters?.transactionRequest?.format,O=(T||l.Bv)({...(0,a.o)($,{format:T}),account:r?(0,n.J)(r):void 0,accessList:h,authorizationList:p,blobs:g,blobVersionedHashes:m,data:b,gas:w,gasPrice:v,maxFeePerBlobGas:x,maxFeePerGas:_,maxPriorityFeePerGas:E,nonce:k,to:C,type:S,value:P},"fillTransaction");try{let r=await e.request({method:"eth_fillTransaction",params:[O]}),n=(y?.formatters?.transaction?.format||o.uP)(r.tx);delete n.blockHash,delete n.blockNumber,delete n.r,delete n.s,delete n.transactionIndex,delete n.v,delete n.yParity,n.data=n.input,n.gas&&(n.gas=t.gas??n.gas),n.gasPrice&&(n.gasPrice=t.gasPrice??n.gasPrice),n.maxFeePerBlobGas&&(n.maxFeePerBlobGas=t.maxFeePerBlobGas??n.maxFeePerBlobGas),n.maxFeePerGas&&(n.maxFeePerGas=t.maxFeePerGas??n.maxFeePerGas),n.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas??n.maxPriorityFeePerGas),void 0!==n.nonce&&(n.nonce=t.nonce??n.nonce);let s=await (async()=>{if("function"==typeof y?.fees?.baseFeeMultiplier){let r=await (0,c.T)(e,d.g,"getBlock")({});return y.fees.baseFeeMultiplier({block:r,client:e,request:t})}return y?.fees?.baseFeeMultiplier??1.2})();if(s<1)throw new i.sM;let a=s.toString().split(".")[1]?.length??0,l=10**a,u=e=>e*BigInt(Math.ceil(s*l))/BigInt(l);return n.feePayerSignature||(n.maxFeePerGas&&!t.maxFeePerGas&&(n.maxFeePerGas=u(n.maxFeePerGas)),n.gasPrice&&!t.gasPrice&&(n.gasPrice=u(n.gasPrice))),{raw:r.raw,transaction:{from:O.from,...n},...r.capabilities?{capabilities:r.capabilities}:{}}}catch(r){throw(0,s.p)(r,{...t,chain:e.chain})}}},64507:(e,t,r)=>{"use strict";r.d(t,{A7:()=>s,BG:()=>a,Fo:()=>h,K0:()=>l,Oh:()=>c,RM:()=>m,jj:()=>o,k5:()=>d,lN:()=>y,lY:()=>f,uC:()=>p,vW:()=>u});var n=r(65385),i=r(99838);class s extends i.C{constructor({cause:e,message:t}={}){let r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(s,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class a extends i.C{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.Q)(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class o extends i.C{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.Q)(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class l extends i.C{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class c extends i.C{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.
vendor: 8,801 bytes, line 257
257Try increasing the nonce or find the latest nonce with \`getTransactionCount\`.`,{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class u extends i.C{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class d extends i.C{constructor({cause:e}={}){super("The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.",{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class f extends i.C{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class h extends i.C{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class p extends i.C{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class y extends i.C{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${(0,n.Q)(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${(0,n.Q)(r)} gwei`:""}).`,{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(y,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class m extends i.C{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}},64959:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});class n extends Error{static setStaticOptions(e){n.prototype.docsOrigin=e.docsOrigin,n.prototype.showVersion=e.showVersion,n.prototype.version=e.version}constructor(e,t={}){let r=(()=>{if(t.cause instanceof n){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"==typeof t.cause.details?t.cause.details:t.cause?.message?t.cause.message:t.details})(),i=t.cause instanceof n&&t.cause.docsPath||t.docsPath,s=t.docsOrigin??n.prototype.docsOrigin,a=`${s}${i??""}`,o=!!(t.version??n.prototype.showVersion),l=t.version??n.prototype.version;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r||i||o?["",r?`Details: ${r}`:void 0,i?`See: ${a}`:void 0,o?`Version: ${l}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=t.cause,this.details=r,this.docs=a,this.docsOrigin=s,this.docsPath=i,this.shortMessage=e,this.showVersion=o,this.version=l}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?e(t.cause,r):r?null:t}(this,e)}}Object.defineProperty(n,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:"[email protected]"}}),n.setStaticOptions(n.defaultStaticOptions)},65195:(e,t,r)=>{"use strict";r.d(t,{l:()=>s});var n=r(16291);let i={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new n.hX({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new n.SK({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new n.B4({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new n.B4({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===1/0)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function s(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(i);return r.bytes=e,r.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}},65323:(e,t,r)=>{"use strict";function n(e,t){return({exclude:r,format:n})=>({exclude:r,format:(e,i)=>{let s=t(e,i);if(r)for(let e of r)delete s[e];return{...s,...n(e,i)}},type:e})}r.d(t,{q:()=>n})},65385:(e,t,r)=>{"use strict";r.d(t,{Q:()=>s});var n=r(75345),i=r(99808);function s(e,t="wei"){return(0,i.J)(e,n.sz[t])}},65402:(e,t,r)=>{"use strict";r.d(t,{V:()=>s});var n=r(22744),i=r(33032);let s=e=>(0,n.di)((0,i.k)(e),0,4)},65409:(e,t,r)=>{"use strict";r.d(t,{M:()=>i});var n=r(99838);class i extends n.C{constructor({address:e}){super(`Address "${e}
257" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}},65601:(e,t,r)=>{"use strict";r.d(t,{WW:()=>nj,VQ:()=>tE,Z9:()=>tO,US:()=>nr,Q9:()=>nd,v:()=>rG,QN:()=>r9,vt:()=>t8,Ay:()=>nL,tr:()=>nM,n4:()=>r3,NJ:()=>np,vz:()=>nf,vj:()=>nh,J3:()=>nn,v8:()=>nl,K9:()=>tK,oj:()=>ne,jZ:()=>r7,Vr:()=>nc,Rx:()=>rV,Ds:()=>r8,qi:()=>r4,wt:()=>nT,_0:()=>tj,bN:()=>nu,vA:()=>nt,Df:()=>tL,Q7:()=>r6});var n=r(94245),i=r(98855),s=r(86786),a=r(43489),o=r(13799),l=r(12960),c=r(79869),u=r(44037),d=r(18409),f=r(35234),h=r(37716),p=r(94091),y=r(26074),m=r(96384),g=r(67671),b=r(90170),w=r(13225),v=r(38272);let x={AC:"40123",AD:"312345",AE:"501234567",AF:"701234567",AG:"2684641234",AI:"2642351234",AL:"672123456",AM:"77123456",AO:"923123456",AR:"91123456789",AS:"6847331234",AT:"664123456",AU:"412345678",AW:"5601234",AX:"412345678",AZ:"401234567",BA:"61123456",BB:"2462501234",BD:"1812345678",BE:"450001234",BF:"70123456",BG:"43012345",BH:"36001234",BI:"79561234",BJ:"0195123456",BL:"690001234",BM:"4413701234",BN:"7123456",BO:"71234567",BQ:"3181234",BR:"11961234567",BS:"2423591234",BT:"17123456",BW:"71123456",BY:"294911911",BZ:"6221234",CA:"5062345678",CC:"412345678",CD:"991234567",CF:"70012345",CG:"061234567",CH:"781234567",CI:"0123456789",CK:"71234",CL:"221234567",CM:"671234567",CN:"13123456789",CO:"3211234567",CR:"83123456",CU:"51234567",CV:"9911234",CW:"95181234",CX:"412345678",CY:"96123456",CZ:"601123456",DE:"15123456789",DJ:"77831001",DK:"34412345",DM:"7672251234",DO:"8092345678",DZ:"551234567",EC:"991234567",EE:"51234567",EG:"1001234567",EH:"650123456",ER:"7123456",ES:"612345678",ET:"911234567",FI:"412345678",FJ:"7012345",FK:"51234",FM:"3501234",FO:"211234",FR:"612345678",GA:"06031234",GB:"7400123456",GD:"4734031234",GE:"555123456",GF:"694201234",GG:"7781123456",GH:"231234567",GI:"57123456",GL:"221234",GM:"3012345",GN:"601123456",GP:"690001234",GQ:"222123456",GR:"6912345678",GT:"51234567",GU:"6713001234",GW:"955012345",GY:"6091234",HK:"51234567",HN:"91234567",HR:"921234567",HT:"34101234",HU:"201234567",ID:"812345678",IE:"850123456",IL:"502345678",IM:"7924123456",IN:"8123456789",IO:"3801234",IQ:"7912345678",IR:"9123456789",IS:"6111234",IT:"3123456789",JE:"7797712345",JM:"8762101234",JO:"790123456",JP:"9012345678",KE:"712123456",KG:"700123456",KH:"91234567",KI:"72001234",KM:"3212345",KN:"8697652917",KP:"1921234567",KR:"1020000000",KW:"50012345",KY:"3453231234",KZ:"7710009998",LA:"2023123456",LB:"71123456",LC:"7582845678",LI:"660234567",LK:"712345678",LR:"770123456",LS:"50123456",LT:"61234567",LU:"628123456",LV:"21234567",LY:"912345678",MA:"650123456",MC:"612345678",MD:"62112345",ME:"60123456",MF:"690001234",MG:"321234567",MH:"2351234",MK:"72345678",ML:"65012345",MM:"92123456",MN:"88123456",MO:"66123456",MP:"6702345678",MQ:"696201234",MR:"22123456",MS:"6644923456",MT:"96961234",MU:"52512345",MV:"7712345",MW:"991234567",MX:"2221234567",MY:"123456789",MZ:"821234567",NA:"811234567",NC:"751234",NE:"93123456",NF:"381234",NG:"8021234567",NI:"81234567",NL:"612345678",NO:"40612345",NP:"9841234567",NR:"5551234",NU:"8884012",NZ:"211234567",OM:"92123456",PA:"61234567",PE:"912345678",PF:"87123456",PG:"70123456",PH:"9051234567",PK:"3012345678",PL:"512345678",PM:"551234",PR:"7872345678",PS:"599123456",PT:"912345678",PW:"6201234",PY:"961456789",QA:"33123456",RE:"692123456",RO:"712034567",RS:"601234567",RU:"9123456789",RW:"720123456",SA:"512345678",SB:"7421234",SC:"2510123",SD:"911231234",SE:"701234567",SG:"81234567",SH:"51234",SI:"31234567",SJ:"41234567",SK:"912123456",SL:"25123456",SM:"66661212",SN:"701234567",SO:"71123456",SR:"7412345",SS:"977123456",ST:"9812345",SV:"70123456",SX:"7215205678",SY:"944567890",SZ:"76123456",TA:"8999",TC:"6492311234",TD:"63012345",TG:"90112345",TH:"812345678",TJ:"917123456",TK:"7290",TL:"77212345",TM:"66123456",TN:"20123456",TO:"7715123",TR:"5012345678",TT:"8682911234",TV:"901234",TW:"912345678",TZ:"621234567",UA:"501234567",UG:"712345678",US:"2015550123",UY:"94231234",UZ:"912345678",VA:"3123456789",VC:"7844301234",VE:"4121234567",VG:"2843001234",VI:"3406421234",VN:"912345678",VU:"5912345",WF:"821234",WS:"7212345",XK:"43201234",YE:"712345678",YT:"639012345",ZA:"711234567",ZM:"955123456",ZW:"712345678"};var _=r(42150),E=r(71895);function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var S="0-90-9٠-٩۰-۹",P="".concat("-‐-―−ー-").concat("//").concat("..").concat(" \xa0\xad​⁠ ").concat("()()[]\\[\\]").concat("~⁓∼~"),$="++";function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(e){var t="function"==typeof Map?new Map:void 0;return(T=function(e){if(null===e||!function(e){try{return -1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(O())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&N(i,r.prototype),i}(e,arguments,R(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),N(r,e)})(e)}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}
257function N(e,t){return(N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var B=function(e){function t(e){var r,n,i;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return n=t,i=[e],n=R(n),Object.setPrototypeOf(r=function(e,t){if(t&&("object"==k(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var r=e;if(void 0===r)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(this,O()?Reflect.construct(n,i||[],R(this).constructor):n.apply(this,i)),t.prototype),r.name=r.constructor.name,r}if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&N(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(T(Error)),D=r(78492),M=function(e){return"([".concat(S,"]{1,").concat(e,"})")};function U(e){var t="[ \xa0\\t,]*",r="[:\\..]?[ \xa0\\t,-]*",n="[ \xa0\\t]*";return";ext="+M("20")+"|"+(t+"(?:e?xt(?:ensi(?:ó?|\xf3))?n?|e?xtn?|доб|anexo)"+r+M("20"))+"#?|"+(t+"(?:[xx##~~]|int|int)"+r+M("9"))+"#?|"+("[- ]+"+M("6"))+"#|"+(n+"(?:,{2}|;)"+r+M("15"))+"#?|"+(n+"(?:,)+"+r+M("9"))+"#?"}var j="["+$+"]{0,1}(?:["+P+"]*["+S+"]){3,}["+P+S+"]*",L=RegExp("^["+$+"]{0,1}(?:["+P+"]*["+S+"]){1,2}$","i"),F=RegExp("^["+S+"]{2}$|^"+(j+"(?:"+U())+")?$","i"),z=RegExp("(?:"+U()+")$","i");function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var W={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function H(e){for(var t,r="",n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return q(e,void 0);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?q(e,t):void 0}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;){var i=W[t.value];i&&(r+=i)}return r}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function V(e){for(var t,r="",n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return K(e,void 0);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(e,t):void 0}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;){var i=t.value;r+=function(e,t,r){if("+"===e){if(t)return;return"+"}return W[e]}(i,r)||""}return r}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function J(e,t,r){return function e(t,r,n,i){n&&(i=new D.Ay(i.metadata)).selectNumberingPlan(n);var s=i.type(r),a=s&&s.possibleLengths()||i.possibleLengths();if(!a)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===r){if(!i.type("FIXED_LINE"))return e(t,"MOBILE",n,i);
257var o=i.type("MOBILE");o&&(a=function(e,t){for(var r,n=e.slice(),i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return G(e,void 0);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(e,t):void 0}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(r=i()).done;){var s=r.value;0>e.indexOf(s)&&n.push(s)}return n.sort(function(e,t){return e-t})}(a,o.possibleLengths()))}else if(r&&!s)return"INVALID_LENGTH";var l=t.length,c=a[0];return c===l?"IS_POSSIBLE":c>l?"TOO_SHORT":a[a.length-1]<l?"TOO_LONG":a.indexOf(l,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}(e,void 0,t,r)}function Y(e,t){return"IS_POSSIBLE"===J(e,void 0,t)}function Z(e,t){return e=e||"",RegExp("^(?:"+t+")$").test(e)}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var X=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function ee(e,t,r){if(t=t||{},e.country||e.countryCallingCode){var n=new D.Ay(r);n.selectNumberingPlan(e.country||e.countryCallingCode);var i=t.v2?e.nationalNumber:e.phone;if(Z(i,n.nationalNumberPattern())){if(et(i,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()||!n.type("MOBILE")||et(i,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var s,a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Q(e,void 0);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q(e,t):void 0}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(X);!(s=a()).done;){var o=s.value;if(et(i,o,n))return o}}}}function et(e,t,r){var n=r.type(t);return!(!n||!n.pattern()||n.possibleLengths()&&0>n.possibleLengths().indexOf(e.length))&&Z(e,n.pattern())}var er=/^[A-Z]{2}$/,en=RegExp("(["+S+"])");function ei(e,t,r,n){if(t){var i=new D.Ay(n);i.selectNumberingPlan(t||r);var s=new RegExp(i.IDDPrefix());if(0===e.search(s)){var a=(e=e.slice(e.match(s)[0].length)).match(en);if(!a||null==a[1]||!(a[1].length>0)||"0"!==a[1])return e}}}function es(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var i,s,a,o=n.length-1,l=o>0&&n[o];if(t.nationalPrefixTransformRule()&&l)i=e.replace(r,t.nationalPrefixTransformRule()),o>1&&(s=n[1]);else{var c=n[0];i=e.slice(c.length),l&&(s=n[1])}if(l){var u=e.indexOf(n[1]);e.slice(0,u)===t.numberingPlan.nationalPrefix()&&(a=t.numberingPlan.nationalPrefix())}else a=n[0];return{nationalNumber:i,nationalPrefix:a,carrierCode:s}}}return{nationalNumber:e}}function ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eo(e,t,r){for(var n,i=new D.Ay(r),s=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ea(e,void 0);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ea(e,t):void 0}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(n=s()).done;){var a=n.value;if(i.selectNumberingPlan(a),i.leadingDigits()){if(e&&0===e.search(i.leadingDigits()))return a}else if(ee({phone:e,country:a},void 0,i.metadata))return a}}function el(e,t){var r=t.nationalNumber,n=t.metadata,i=n.getCountryCodesForCallingCode(e);if(i)return 1===i.length?i[0]:eo(r,i,n.metadata)}function ec(e,t,r){var n,i,s,a=es(e,r),o=a.carrierCode,l=a.nationalNumber;if(l!==e){if(n=e,i=l,!(!Z(n,(s=r).nationalNumberPattern())||Z(i,s.nationalNumberPattern()))||r.numberingPlan.possibleLengths()&&(t||(t=el(r.numberingPlan.callingCode(),{nationalNumber:l,metadata:r})),!function(e,t,r){switch(J(e,t,r)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(l,t,r)))return{nationalNumber:e}}return{nationalNumber:l,carrierCode:o}}function eu(e,t,r,n,i){if(!(t||r||n))return{number:e};var s=t||r?(0,D.Ko)(t||r,i):n;if(0===e.indexOf(s)){var a=new D.Ay(i);a.selectNumberingPlan(t||r||n);var o=e.slice(s.length),l=ec(o,void 0,a).nationalNumber,c=ec(e,void 0,a).nationalNumber;if(!Z(c,a.nationalNumberPattern())&&Z(l,a.nationalNumberPattern())||"TOO_LONG"===J(c,void 0,a))return{countryCallingCode:s,number:o}}return{number:e}}function ed(e,t,r,n,i){if(!e)return{};if("+"!==e[0]){var s,a=ei(e,t||r,n,i);
257if(a&&a!==e)s=!0,e="+"+a;else{if(t||r||n){var o=eu(e,t,r,n,i),l=o.countryCallingCode,c=o.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:c}}return{number:e}}}if("0"===e[1])return{};for(var u=new D.Ay(i),d=2;d-1<=3&&d<=e.length;){var f=e.slice(1,d);if(u.hasCallingCode(f))return u.selectNumberingPlan(f),{countryCallingCodeSource:s?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:f,number:e.slice(d)};d++}return{}}function ef(e){return e.replace(RegExp("[".concat(P,"]+"),"g")," ").trim()}var eh=/(\$\d)/;function ep(e,t,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var s=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():i&&t.nationalPrefixFormattingRule()?t.format().replace(eh,t.nationalPrefixFormattingRule()):t.format());return n?ef(s):s}var ey=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/,em={formatExtension:function(e,t,r){return"".concat(e).concat(r.ext()).concat(t)}};function eg(e,t,r,n,i){var s=function(e,t){for(var r=e,n=function(e){if(e.leadingDigitsPatterns().length>0){var r=e.leadingDigitsPatterns()[e.leadingDigitsPatterns().length-1];if(0!==t.search(r))return!1}return Z(t,e.pattern())},i=0;i<r.length;){if(n(r[i]))return r[i];i++}}(n.formats(),e);return s?ep(e,s,{useInternationalFormat:"INTERNATIONAL"===r,withNationalPrefix:!s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!i||!1!==i.nationalPrefix,carrierCode:t,metadata:n}):e}function eb(e){return(eb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ew(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ev(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ew(Object(r),!0).forEach(function(t){var n,i,s;n=e,i=t,s=r[t],(i=ex(i))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ew(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ex(e){var t=function(e,t){if("object"!=eb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eb(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eb(t)?t:t+""}var e_=function(){var e,t;return e=function e(t,r,n){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");if(!t)throw TypeError("First argument is required");if("string"!=typeof t)throw TypeError("First argument must be a string");if("+"===t[0]&&!r)throw TypeError("`metadata` argument not passed");if((0,E.A)(r)&&(0,E.A)(r.countries)){n=r;var i=t;if(!eE.test(i))throw Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var s=ed(i,void 0,void 0,void 0,n),a=s.countryCallingCode;if(r=s.number,t=a,!r)throw Error("Invalid `number` argument passed: too short")}if(!r)throw TypeError("`nationalNumber` argument is required");if("string"!=typeof r)throw TypeError("`nationalNumber` argument must be a string");(0,D.aR)(n);var o=function(e,t){var r,n,i=new D.Ay(t);return er.test(e)?(r=e,i.selectNumberingPlan(r),n=i.countryCallingCode()):n=e,{country:r,callingCode:n}}(t,n),l=o.country,c=o.callingCode;this.country=l,this.countryCallingCode=c,this.nationalNumber=r,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}},t=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){var e,t,r,n;return this.country?[this.country]:(e=this.countryCallingCode,t=this.nationalNumber,r=this.getMetadata(),(n=new D.Ay(r).getCountryCodesForCallingCode(e))?n.filter(function(e){var n,i,s,a;return n=t,i=e,s=r,(a=new D.Ay(s)).selectNumberingPlan(i),a.numberingPlan.possibleLengths().indexOf(n.length)>=0}):[])}},{key:"isPossible",value:function(){return function(e,t,r){void 0===t&&(t={});var n=new D.Ay(r);if(t.v2){if(!e.countryCallingCode)throw Error("Invalid phone number object passed");n.selectNumberingPlan(e.country||e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!n.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));n.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)throw Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}}if(n.possibleLengths())return Y(e.phone||e.nationalNumber,n);if(e.countryCallingCode&&n.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){var e,t,r;return e={v2:!0},t=this.getMetadata(),e=e||{}
257,((r=new D.Ay(t)).selectNumberingPlan(this.country||this.countryCallingCode),r.hasTypes())?void 0!==ee(this,e,r.metadata):Z(e.v2?this.nationalNumber:this.phone,r.nationalNumberPattern())}},{key:"isNonGeographic",value:function(){return new D.Ay(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return ee(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return function(e,t,r,n){r=r?function(){for(var e=1,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(;e<r.length;){if(r[e])for(var i in r[e])r[0][i]=r[e][i];e++}return r[0]}({},em,r):em;var i,s=new D.Ay(n);if(e.country&&"001"!==e.country){if(!s.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));s.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)return e.phone||"";s.selectNumberingPlan(e.countryCallingCode)}var a=s.countryCallingCode(),o=r.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":if(!o)return"";return d=i=eg(o,e.carrierCode,"NATIONAL",s,r),f=e.ext,h=s,p=r.formatExtension,f?p(d,f,h):d;case"INTERNATIONAL":if(!o)return"+".concat(a);return i=eg(o,null,"INTERNATIONAL",s,r),y=i="+".concat(a," ").concat(i),m=e.ext,g=s,b=r.formatExtension,m?b(y,m,g):y;case"E.164":return"+".concat(a).concat(o);case"RFC3966":var l={number:"+".concat(a).concat(o),ext:e.ext},c=l.number,u=l.ext;if(!c)return"";if("+"!==c[0])throw Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(c).concat(u?";ext="+u:"");case"IDD":if(!r.fromCountry)return;var d,f,h,p,y,m,g,b,w,v,x,_,E=function(e,t,r,n,i){if((0,D.Ko)(n,i.metadata)===r){var s,a,o,l=eg(e,t,"NATIONAL",i);return"1"===r?r+" "+l:l}var c=(s=void 0,a=i.metadata,((o=new D.Ay(a)).selectNumberingPlan(n||s),o.defaultIDDPrefix())?o.defaultIDDPrefix():ey.test(o.IDDPrefix())?o.IDDPrefix():void 0);if(c)return"".concat(c," ").concat(r," ").concat(eg(e,null,"INTERNATIONAL",i))}(o,e.carrierCode,a,r.fromCountry,s);if(!E)return;return w=E,v=e.ext,x=s,_=r.formatExtension,v?_(w,v,x):w;default:throw Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}(this,e,t?ev(ev({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ex(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(),eE=/^\+\d+$/,eA="(["+S+"]|[\\-\\.\\(\\)]?)",eI=RegExp("^\\+"+eA+"*["+S+"]"+eA+"*$","g"),eC=RegExp("^("+("["+S+"]+((\\-)*[")+S+"])*\\.)*[a-zA-Z]+((\\-)*["+S+"])*\\.?$","g"),eS="tel:",eP=";phone-context=",e$=RegExp("["+$+S+"]"),ek=RegExp("[^"+S+"#]+$");function eT(e){return(eT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eO(Object(r),!0).forEach(function(t){var n,i,s;n=e,i=t,s=r[t],(i=function(e){var t=function(e,t){if("object"!=eT(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eT(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eT(t)?t:t+""}(i))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eO(Object(r)).forEac
257h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function eR(e){return(eR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eB(Object(r),!0).forEach(function(t){var n,i,s;n=e,i=t,s=r[t],(i=function(e){var t=function(e,t){if("object"!=eR(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eR(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eR(t)?t:t+""}(i))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eB(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function eM(e){return(eM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eU(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ej(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eU(Object(r),!0).forEach(function(t){var n,i,s;n=e,i=t,s=r[t],(i=function(e){var t=function(e,t){if("object"!=eM(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eM(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eM(t)?t:t+""}(i))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eU(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function eL(){var e=function(e){var t,r,n,i,s=function(e){if(Array.isArray(e))return e}(t=Array.prototype.slice.call(e))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,s,a,o=[],l=!0,c=!1;try{s=(r=r.call(e)).next,!1;for(;!(l=(n=s.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}(t,4)||function(e,t){if(e){if("string"==typeof e)return C(e,4);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(e,t):void 0}}(t,4)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=s[0],o=s[1],l=s[2],c=s[3];if("string"==typeof a)r=a;else throw TypeError("A text for parsing must be a string.");if(o&&"string"!=typeof o)if((0,E.A)(o))l?(n=o,i=l):i=o;else throw Error("Invalid second argument: ".concat(o));else c?(n=l,i=c):(n=void 0,i=l),o&&(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?I(Object(r),!0).forEach(function(t){var n,i,s;n=e,i=t,s=r[t],(i=function(e){var t=function(e,t){if("object"!=A(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=A(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==A(t)?t:t+""}(i))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEac
257h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({defaultCountry:o},n));return{text:r,options:n,metadata:i}}(arguments),t=e.text,r=e.options,n=e.metadata,i=function(e,t,r){t&&t.defaultCountry&&!(0,D.J_)(t.defaultCountry,r)&&(t=eD(eD({},t),{},{defaultCountry:void 0}));try{var n;return n=t,function(e,t,r){t=t||{};var n,i,s,a,o=new D.Ay(r);if(t.defaultCountry&&!o.hasCountry(t.defaultCountry)){if(t.v2)throw new B("INVALID_COUNTRY");throw Error("Unknown country: ".concat(t.defaultCountry))}var l=function(e,t,r){var n=function(e,t){var r=t.extractFormattedPhoneNumber,n=function(e){var t=e.indexOf(eP);if(t<0)return null;var r=t+eP.length;if(r>=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}(e);if(!(null===n||0!==n.length&&(eI.test(n)||eC.test(n))))throw new B("NOT_A_NUMBER");if(null===n)i=r(e)||"";else{i="","+"===n.charAt(0)&&(i+=n);var i,s,a=e.indexOf(eS);s=a>=0?a+eS.length:0;var o=e.indexOf(eP);i+=e.substring(s,o)}var l=i.indexOf(";isub=");if(l>0&&(i=i.substring(0,l)),""!==i)return i}(e,{extractFormattedPhoneNumber:function(e){if(e){if(e.length>250){if(t)throw new B("TOO_LONG");return}if(!1===r)return e;var n=e.search(e$);return n<0?void 0:e.slice(n).replace(ek,"")}}});if(!n)return{};if(!(n.length>=2&&F.test(n)))return L.test(n)?{error:"TOO_SHORT"}:{};var i=function(e){var t=e.search(z);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(z),i=1;i<n.length;){if(n[i])return{number:r,ext:n[i]};i++}}(n);return i.ext?i:{number:n}}(e,t.v2,t.extract),c=l.number,u=l.ext,d=l.error;if(!c){if(t.v2){if("TOO_SHORT"===d)throw new B("TOO_SHORT");throw new B("NOT_A_NUMBER")}return{}}var f=function(e,t,r,n){var i,s=ed(V(e),void 0,t,r,n.metadata),a=s.countryCallingCodeSource,o=s.countryCallingCode,l=s.number;if(o)n.selectNumberingPlan(o);else{if(!l||!t&&!r)return{};t?(i=t,n.selectNumberingPlan(t),o=n.numberingPlan.callingCode()):(n.selectNumberingPlan(r),o=r)}if(!l)return{countryCallingCodeSource:a,countryCallingCode:o};var c=ec(V(l),void 0,n),u=c.nationalNumber,d=c.carrierCode,f=el(o,{nationalNumber:u,metadata:n});return f&&(i=f,"001"===f||n.selectNumberingPlan(i)),{country:i,countryCallingCode:o,countryCallingCodeSource:a,nationalNumber:u,carrierCode:d}}(c,t.defaultCountry,t.defaultCallingCode,o),h=f.country,p=f.nationalNumber,y=f.countryCallingCode,m=f.countryCallingCodeSource,g=f.carrierCode;if(!o.hasSelectedNumberingPlan()){if(t.v2)throw new B("INVALID_COUNTRY");return{}}if(!p||p.length<2){if(t.v2)throw new B("TOO_SHORT");return{}}if(p.length>17){if(t.v2)throw new B("TOO_LONG");return{}}if(t.v2){var b=new e_(y,p,o.metadata);return h&&(b.country=h),g&&(b.carrierCode=g),u&&(b.ext=u),b.__countryCallingCodeSource=m,b}var w=(t.extended?!!o.hasSelectedNumberingPlan():!!h)&&Z(p,o.nationalNumberPattern());return t.extended?{country:h,countryCallingCode:y,carrierCode:g,valid:w,possible:!!w||!!(!0===t.extended&&o.possibleLengths()&&Y(p,o)),phone:p,ext:u}:w?(n=h,i=p,s=u,a={country:n,phone:i},s&&(a.ext=s),a):{}}(e,eN(eN({},n),{},{v2:!0}),r)}catch(e){if(e instanceof B);else throw e}}(t,r=ej(ej({},r),{},{extract:!1}),n);return i&&i.isPossible()||!1}var eF=r(72831),ez=r(55642);function eq(e){return(eq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eW=function(){var e,t;return e=function e(t){var r=t.onCountryChange,n=t.onCallingCodeChange;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.onCountryChange=r,this.onCallingCodeChange=n},t=[{key:"reset",value:function(e){var t=e.country,r=e.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(t,r)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}},{key:"update",value:function(e){for(var t=0,r=Object.keys(e);t<r.length;t++){var n=r[t];this[n]=e[n]}}},{key:"initCountryAndCallingCode",value:function(e,t){this.setCountry(e),this.setCallingCode(t)}},{key:"setCountry",value:function(e){this.country=e,this.onCountryChange(e)}},{key:"setCallingCode",value:function(e){this.callingCode=e,this.onCallingCodeChange(e,this.country)}},{key:"startInternationalNumber",value:function(e,t){this.international=!0,this.initCountryAndCallingCode(e,t)}},{key:"appendDigits",value:function(e){this.digits+=e}},{key:"appendNationalSignificantNumberDigits",value:function(e){this.nationalSignificantNumber+=e}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=eq(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eq(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eq(t)?t:t+""}(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();function eH(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var eK=/x/;function eV(e,t){if(t<1)return"";for(var r="";t>1;)1&t&&(r+=e),t>>=1,e+=e;return r+e}function eG(e,t){return")"===e[t]&&t++,function(e){for(var t=[],r=0;r<e.length;)"("===e[r]?t.push(r):")"===e[r]&&t.pop(),r++;var n=0,i="";t.push(e.length);for(var s=0;s<t.length;s++){var a=t[s];i+=e.slice(n,a),n=a+1}return i}(e.slice(0,t))}function eJ(e,t,r){var n,i,s=r.metadata,a=r.useNationalPrefixFormattingRule,o=r.getSeparatorAfterNationalPrefix,l=ep(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:a,metadata:s});
257if(!a&&(e.nationalPrefix?l=e.nationalPrefix+o(t)+l:e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(l=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+l)),n=l,i=e,H(n)===i.getNationalDigits())return l}function eY(e){return(eY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eZ=function(){var e,t;return e=function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function")},t=[{key:"parse",value:function(e){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(e),1!==this.context.length)throw Error("Non-finalized contexts left when pattern parse ended");var t=this.context[0],r=t.branches,n=t.instructions;if(r)return{op:"|",args:r.concat([e0(n)])};if(0===n.length)throw Error("Pattern is required");return 1===n.length?n[0]:n}},{key:"startContext",value:function(e){this.context.push(e)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(e){if(!e)throw Error("Pattern is required");var t=e.match(eX);if(!t){if(eQ.test(e))throw Error("Illegal characters found in a pattern: ".concat(e));this.getContext().instructions=this.getContext().instructions.concat(e.split(""));return}var r=t[1],n=e.slice(0,t.index),i=e.slice(t.index+r.length);switch(r){case"(?:":n&&this.parsePattern(n),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw Error('")" operator must be preceded by "(?:" operator');if(n&&this.parsePattern(n),0===this.getContext().instructions.length)throw Error('No instructions found after "|" operator in an "or" group');var s=this.getContext().branches;s.push(e0(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:s});break;case"|":if(!this.getContext().or)throw Error('"|" operator can only be used inside "or" groups');if(n&&this.parsePattern(n),!this.getContext().branches)if(1===this.context.length)this.getContext().branches=[];else throw Error('"branches" not found in an "or" group context');this.getContext().branches.push(e0(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":n&&this.parsePattern(n),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:function(e){for(var t=[],r=0;r<e.length;){if("-"===e[r]){if(0===r||r===e.length-1)throw Error("Couldn't parse a one-of set pattern: ".concat(e));for(var n=e[r-1].charCodeAt(0)+1,i=e[r+1].charCodeAt(0)-1,s=n;s<=i;)t.push(String.fromCharCode(s)),s++}else t.push(e[r]);r++}return t}(n)});break;default:throw Error("Unknown operator: ".concat(r))}i&&this.parsePattern(i)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=eY(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eY(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eY(t)?t:t+""}(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(),eQ=/[\(\)\[\]\?\:\|]/,eX=RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function e0(e){return 1===e.length?e[0]:e}function e1(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return e2(e,void 0);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e2(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e2(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function e5(e){return(e5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var e6=function(){var e,t;return e=function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.matchTree=new eZ().parse(t)},t=[{key:"match",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.allowOverflow;
257if(!e)throw Error("String is required");var n=function e(t,r,n){if("string"==typeof r){var i=t.join("");return 0===r.indexOf(i)?t.length===r.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===i.indexOf(r)?n&&t.length>r.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,r.length)}:void 0}if(Array.isArray(r)){for(var s=t.slice(),a=0;a<r.length;){var o=e(s,r[a],n&&a===r.length-1);if(!o)return;if(o.overflow)return o;if(o.match){if(0===(s=s.slice(o.matchedChars.length)).length)if(a===r.length-1)return{match:!0,matchedChars:t};else return{partialMatch:!0}}else if(o.partialMatch)return{partialMatch:!0};else throw Error("Unsupported match result:\n".concat(JSON.stringify(o,null,2)));a++}return n?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-s.length)}}switch(r.op){case"|":for(var l,c,u=e1(r.args);!(c=u()).done;){var d=e(t,c.value,n);if(d)if(d.overflow)return d;else if(d.match)return{match:!0,matchedChars:d.matchedChars};else if(d.partialMatch)l=!0;else throw Error("Unsupported match result:\n".concat(JSON.stringify(d,null,2)))}if(l)return{partialMatch:!0};return;case"[]":for(var f,h=e1(r.args);!(f=h()).done;){var p=f.value;if(t[0]===p){if(1===t.length)return{match:!0,matchedChars:t};if(n)return{overflow:!0};return{match:!0,matchedChars:[p]}}}return;default:throw Error("Unsupported instruction tree: ".concat(r))}}(e.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||r)return n}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=e5(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=e5(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==e5(t)?t:t+""}(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();function e3(e){return(e3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e8(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return e4(e,void 0);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e4(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e4(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var e9=eV("9",15),e7=/[- ]/,te=RegExp("["+P+"]*\\$1["+P+"]*(\\$\\d["+P+"]*)*$"),tt=function(){var e,t;return e=function e(t){t.state;var r=t.metadata;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.metadata=r,this.resetFormat()},t=[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(e,t){this.resetFormat(),e?(this.isNANP="1"===e.callingCode(),this.matchingFormats=e.formats(),t.nationalSignificantNumber&&this.narrowDownMatchingFormats(t)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(e,t){var r=this;if("IS_POSSIBLE"===J(t.nationalSignificantNumber,void 0,this.metadata))for(var n,i=e8(this.matchingFormats);!(n=i()).done;){var s=n.value,a=function(e,t,r){var n=r.metadata,i=r.shouldTryNationalPrefixFormattingRule,s=r.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return function(e,t,r){var n=r.metadata,i=r.shouldTryNationalPrefixFormattingRule,
257s=r.getSeparatorAfterNationalPrefix;if(e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode,i(t)){var a=eJ(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:s,metadata:n});if(a)return a}return eJ(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:s,metadata:n})}(e,t,{metadata:n,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:s})}(t,s,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(e){return r.shouldTryNationalPrefixFormattingRule(e,{international:t.international,nationalPrefix:t.nationalPrefix})},getSeparatorAfterNationalPrefix:function(e){return r.getSeparatorAfterNationalPrefix(e)}});if(a)return this.resetFormat(),this.chosenFormat=s,this.setNationalNumberTemplate(a.replace(/\d/g,"x"),t),this.populatedNationalNumberTemplate=a,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf("x"),a}return this.formatNationalNumberWithNextDigits(e,t)}},{key:"formatNationalNumberWithNextDigits",value:function(e,t){var r=this.chosenFormat,n=this.chooseFormat(t);if(n)if(n===r)return this.formatNextNationalNumberDigits(e);else return this.formatNextNationalNumberDigits(t.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(e){var t=this,r=e.nationalSignificantNumber,n=e.nationalPrefix,i=e.international,s=r.length-3;s<0&&(s=0),this.matchingFormats=this.matchingFormats.filter(function(e){return t.formatSuits(e,i,n)&&t.formatMatches(e,r,s)}),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(e,t,r){return!(r&&!e.usesNationalPrefix()&&!e.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!t&&!r&&e.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(e,t,r){var n=e.leadingDigitsPatterns().length;if(0===n)return!0;r=Math.min(r,n-1);var i=e.leadingDigitsPatterns()[r];if(t.length<3)try{return void 0!==new e6(i).match(t,{allowOverflow:!0})}catch(e){return console.error(e),!0}return new RegExp("^(".concat(i,")")).test(t)}},{key:"getFormatFormat",value:function(e,t){return t?e.internationalFormat():e.format()}},{key:"chooseFormat",value:function(e){for(var t,r,n,i=this,s=e8(this.matchingFormats.slice());!(n=s()).done&&0!==(t=n.value,r=i.chosenFormat===t?0:te.test(i.getFormatFormat(t,e.international))?i.createTemplateForFormat(t,e)?(i.chosenFormat=t,0):(i.matchingFormats=i.matchingFormats.filter(function(e){return e!==t}),1):1);)if(1===r)continue;return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(e,t){if(!(e.pattern().indexOf("|")>=0)){var r=this.getTemplateForFormat(e,t);if(r)return this.setNationalNumberTemplate(r,t),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(e){return this.isNANP||e&&e.nationalPrefixFormattingRule()&&e7.test(e.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(e,t){var r=e.IDDPrefix,n=e.missingPlus;return r?t&&!1===t.spacing?r:r+" ":n?"":"+"}},{key:"getTemplate",value:function(e){if(this.template){for(var t=-1,r=0,n=e.international?this.getInternationalPrefixBeforeCountryCallingCode(e,{spacing:!1}):"";r<n.length+e.getDigitsWithoutInternationalPrefix().length;)t=this.template.indexOf("x",t+1),r++;return eG(this.template,t+1)}}},{key:"setNationalNumberTemplate",value:function(e,t){this.nationalNumberTemplate=e,this.populatedNationalNumberTemplate=e,this.populatedNationalNumberTemplatePosition=-1,t.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(t).replace(/[\d\+]/g,"x")+eV("x",t.callingCode.length)+" "+e:this.template=e}},{key:"getTemplateForFormat",value:function(e,t){var r,n=t.nationalSignificantNumber,i=t.international,s=t.nationalPrefix,a=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,o=e.pattern();o=o.replace(/\[([^\[\]])*\]/g,"\\d").replace(/\d(?=[^,}][^,}])/g,"\\d");var l=e9.match(o)[0];if(!(n.length>l.length)){var c=RegExp("^"+o+"$"),u=n.replace(/\d/g,"9");c.test(u)&&(l=u);var d=this.getFormatFormat(e,i);if(this.shouldTryNationalPrefixFormattingRule(e,{international:i,nationalPrefix:s})){var f=d.replace(eh,e.nationalPrefixFormattingRule());if(H(e.nationalPrefixFormattingRule())===(s||"")+H("$1")&&(d=f,r=!0,s))for(var h=s.length;h>0;)d=d.replace(/\d/,"x"),h--}var p=l.replace(new RegExp(o),d).replace(/9/g,"x");return!r&&(a?p=eV("x",a.length)+" "+p:s&&(p=eV("x",s.length)+this.getSeparatorAfterNationalPrefix(e)+p)),i&&(p=ef(p)),p}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=function(e,t,r){for(var n,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return eH(e,void 0);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eH(e,t):void 0}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.split(""));!(n=i()).done;){var s=n.value;if(0>e.slice(t+1).search(eK))return;t=e.search(eK),e=e.replace(eK,s)}return[e,t]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);return t?(this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],eG(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)):void this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(e,t){var r=t.international,n=t.nationalPrefix;if(e.nationalPrefixFormattingRule()){var i=e.usesNationalPrefix();if(i&&n||!i&&!r)return!0}}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=e3(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=e3(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==e3(t)?t:t+""}(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();function tr(e){return(tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,s,a,o=[],l=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=s.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){c=!0,i=e}
257finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ti(e,t);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ti(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ti(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ts=RegExp("^["+P+S+"]+$","i"),ta="(?:["+$+"]["+P+S+"]*|["+P+S+"]+)",to=RegExp("[^"+P+S+"]+.*$"),tl=/[^\d\[\]]/,tc=function(){var e,t;return e=function e(t){var r=t.defaultCountry,n=t.defaultCallingCode,i=t.metadata,s=t.onNationalSignificantNumberChange;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.defaultCountry=r,this.defaultCallingCode=n,this.metadata=i,this.onNationalSignificantNumberChange=s},t=[{key:"input",value:function(e,t){var r,n,i,s,a,o=tn((i=(n=tn("+"===(r=function(e){var t,r=e.search(ta);if(!(r<0))return"+"===(e=e.slice(r))[0]&&(t=!0,e=e.slice(1)),e=e.replace(to,""),t&&(e="+"+e),e}(e)||"")[0]?[r.slice(1),!0]:[r],2))[0],s=n[1],ts.test(i)||(i=""),[i,s]),2),l=o[0],c=o[1],u=H(l);return c&&!t.digits&&(t.startInternationalNumber(void 0,void 0),u||(a=!0)),u&&this.inputDigits(u,t),{digits:u,justLeadingPlus:a}}},{key:"inputDigits",value:function(e,t){var r=t.digits,n=r.length<3&&r.length+e.length>=3;if(t.appendDigits(e),n&&this.extractIddPrefix(t),this.isWaitingForCountryCallingCode(t)){if(!this.extractCountryCallingCode(t))return}else t.appendNationalSignificantNumberDigits(e);t.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(t.getNationalDigits(),function(e){return t.update(e)})}},{key:"isWaitingForCountryCallingCode",value:function(e){var t=e.international,r=e.callingCode;return t&&!r}},{key:"extractCountryCallingCode",value:function(e){var t=ed("+"+e.getDigitsWithoutInternationalPrefix(),e.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode,n=t.number;if(r)return e.setCallingCode(r),e.update({nationalSignificantNumber:n}),!0}},{key:"reset",value:function(e){if(e){this.hasSelectedNumberingPlan=!0;var t=e._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=t&&tl.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var r=es(e,this.metadata),n=r.nationalPrefix,i=r.nationalNumber,s=r.carrierCode;if(i!==e)return this.onExtractedNationalNumber(n,s,i,e,t),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(e,t,r){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,r);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var n=es(e,this.metadata),i=n.nationalPrefix,s=n.nationalNumber,a=n.carrierCode;if(s!==t)return this.onExtractedNationalNumber(i,a,s,e,r),!0}}},{key:"onExtractedNationalNumber",value:function(e,t,r,n,i){var s,a=!1,o=n.lastIndexOf(r);if(o<0||o!==n.length-r.length)a=!0;else{var l=n.slice(0,o);l&&l!==e&&(s=l)}i({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:r,nationalSignificantNumberIsModified:a,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:s}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(e){return!!this.extractAnotherNationalSignificantNumber(e.getNationalDigits(),e.nationalSignificantNumber,function(t){return e.update(t)})||(this.extractIddPrefix(e)||this.fixMissingPlus(e)?(this.extractCallingCodeAndNationalSignificantNumber(e),!0):void 0)}},{key:"extractIddPrefix",value:function(e){var t=e.international,r=e.IDDPrefix,n=e.digits;if(e.nationalSignificantNumber,!t&&!r){var i=ei(n,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(void 0!==i&&i!==n)return e.update({IDDPrefix:n.slice(0,n.length-i.length)}),this.startInternationalNumber(e,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(e){if(!e.international){var t=eu(e.digits,e.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata).countryCallingCode;if(t)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:t}),!0}}},{key:"startInternationalNumber",value:function(e,t){var r=t.country,n=t.callingCode;e.startInternationalNumber(r,n),e.nationalSignificantNumber&&(e.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(e){this.extractCountryCallingCode(e)&&this.extractNationalSignificantNumber(e.getNationalDigits(),function(t){return e.update(t)})}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=tr(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=tr(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==tr(t)?t:t+""}(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();function tu(e){return(tu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function td(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var tf=function(){var e,t;return e=function e(t,r){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.metadata=new D.Ay(r);var n,i=function(e){if(Array.isArray(e))return e}(n=this.getCountryAndCallingCode(t))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,s,a,o=[],l=!0,c=!1;
257try{s=(r=r.call(e)).next,!1;for(;!(l=(n=s.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}(n,2)||function(e,t){if(e){if("string"==typeof e)return td(e,2);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?td(e,t):void 0}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=i[0],a=i[1];this.defaultCountry=s,this.defaultCallingCode=a,this.reset()},t=[{key:"getCountryAndCallingCode",value:function(e){var t,r;return e&&((0,E.A)(e)?(t=e.defaultCountry,r=e.defaultCallingCode):t=e),t&&!this.metadata.hasCountry(t)&&(t=void 0),[t,r]}},{key:"input",value:function(e){var t=this.parser.input(e,this.state),r=t.digits;if(t.justLeadingPlus)this.formattedOutput="+";else if(r){if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(n=this.formatter.format(r,this.state)),void 0===n&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var n,i=this.state.getNationalDigits();i&&(n=this.formatter.format(i,this.state))}this.formattedOutput=n?this.getFullNumber(n):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var e=this;return this.state=new eW({onCountryChange:function(t){e.country=t},onCallingCodeChange:function(t,r){e.metadata.selectNumberingPlan(r||t),e.formatter.reset(e.metadata.numberingPlan,e.state),e.parser.reset(e.metadata.numberingPlan)}}),this.formatter=new tt({state:this.state,metadata:this.metadata}),this.parser=new tc({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){e.determineTheCountryIfNeeded(),e.formatter.reset(e.metadata.numberingPlan,e.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){var e=this.state.country;return e}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(e){var t=this;if(this.isInternational()){var r=function(e){return t.formatter.getInternationalPrefixBeforeCountryCallingCode(t.state,{spacing:!!e})+e},n=this.state.callingCode;return r(n?e?"".concat(n," ").concat(e):n:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return e}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var e=this.state,t=e.nationalSignificantNumber,r=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,n=e.nationalPrefix,i=t,s=r||n;return s&&(i=s+i),i}},{key:"getNonFormattedNumber",value:function(){var e=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(e?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,"x")}},{key:"isCountryCallingCodeAmbiguous",value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:"determineTheCountry",value:function(){var e=el(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata});e!==this.state.country&&(this.state.setCountry(e),e&&this.metadata.selectNumberingPlan(e))}},{key:"getNumberValue",value:function(){var e=this.state,t=e.digits,r=e.callingCode,n=e.country,i=e.nationalSignificantNumber;if(t){if(this.isInternational())if(r)return"+"+r+i;else return"+"+t;else if(n||r)return"+"+(n?this.metadata.countryCallingCode():r)+i}}},{key:"getNumber",value:function(){var e=this.state,t=e.nationalSignificantNumber,r=e.carrierCode,n=e.callingCode;if(t){var i=this._getCountry();
257if(i||n){if(i&&i===this.defaultCountry){var s=function(e,t,r){var n=r.getCountryCodesForCallingCode(e);if(n.length>1)return eo(t,n,r.metadata)}(this.metadata.numberingPlan.callingCode(),t,this.metadata);s&&(i=s)}var a=new e_(i||n,t,this.metadata.metadata);return r&&(a.carrierCode=r),a}}}},{key:"isPossible",value:function(){var e=this.getNumber();return!!e&&e.isPossible()}},{key:"isValid",value:function(){var e=this.getNumber();return!!e&&e.isValid()}},{key:"validateLength",value:function(){var e=this.state,t=e.digits,r=e.nationalSignificantNumber;if(!t)return"NOT_A_NUMBER";if(!this.metadata.numberingPlan)return"INVALID_COUNTRY";if(!r)return"TOO_SHORT";var n=J(r,void 0,this.metadata);if("IS_POSSIBLE"!==n)return n}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=tu(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=tu(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==tu(t)?t:t+""}(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();function th(e){return tf.call(this,e,ez.A)}function tp(e){return new D.Ay(e).getCountries()}function ty(e,t,r){if(t[e])return new e_(e,t[e],r)}th.prototype=Object.create(tf.prototype,{}),th.prototype.constructor=th;var tm=r(98539).hp,tg=Object.defineProperty,tb=(e,t)=>{let r={};for(var n in e)tg(r,n,{get:e[n],enumerable:!0});return t||tg(r,Symbol.toStringTag,{value:"Module"}),r},tw=class{_privyInternal;_smartWalletConfig;constructor(e){this._privyInternal=e}getConfig(){return this._privyInternal.config}async getSmartWalletConfig(){return this._smartWalletConfig||=await this._privyInternal.fetch(n.r6,{params:{app_id:this.appId}}),this._smartWalletConfig}get appId(){return this._privyInternal.appId}},tv=class e{static parse(t){try{return new e(t)}catch{return null}}value;_decoded;constructor(e){this.value=e,this._decoded=i.i(e)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=(this.expiration-e)*1e3}},tx=class e{_storage;_privyInternal;constructor(e,t){this._privyInternal=e,this._storage=t}static providerAccessTokenStorageKey=e=>`privy:cross-app:${e}`;async updateOnCrossAppAuthentication(t,r){let n=r.access_token,i=e.providerAccessTokenStorageKey(t);await this._storage.put(i,n)}async getProviderAccessToken(t){let r=e.providerAccessTokenStorageKey(t),n=await this._storage.get(r);if("string"!=typeof n)return null;try{if(new tv(n).isExpired())throw Error("JWT is expired");return n}catch{return await this._storage.del(r),null}}async getCrossAppConnections(){return await this._privyInternal.fetch(n.fd,{params:{app_id:this._privyInternal.appId}})}},t_=class{_privyInternal;constructor(e){this._privyInternal=e}async revoke(){await this._privyInternal.fetch(n.xh,{})}},tE=class extends Error{name="PrivyApiError";error;code;status;constructor({error:e,code:t,status:r}){super(e),this.error=e,this.code=t,this.status=r}},tA=class extends Error{error;code;constructor({error:e,code:t}){super(e),this.code=t,this.error=e}},tI=class extends Error{error;code;response;constructor({error:e,code:t,response:r}){super(e),this.code=t,this.error=e,this.response=r}};let tC=e=>!!e.id&&"privy-v2"===e.recovery_method,tS=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","mfa_timeout","missing_or_invalid_mfa","mfa_verification_max_attempts_reached"];!function(e){e.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",e.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",e.INVALID_DATA="invalid_data",e.LINKED_TO_ANOTHER_USER="linked_to_another_user",e.ALLOWLIST_REJECTED="allowlist_rejected",e.OAUTH_USER_DENIED="oauth_user_denied",e.UNKNOWN_AUTH_ERROR="unknown_auth_error",e.USER_EXITED_AUTH_FLOW="exited_auth_flow",e.MUST_BE_AUTHENTICATED="must_be_authenticated",e.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",e.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",e.CLIENT_REQUEST_TIMEOUT="client_request_timeout",e.INVALID_CREDENTIALS="invalid_credentials"}({});
257var tP=class extends Error{cause;privyErrorCode;constructor(e,t,r){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=r}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},t$=class extends Error{type;constructor(e,t){super(t),this.type=e}},tk=class extends tP{type="connector_error";constructor(e,t,r){super(e,t,r)}},tT=class extends Error{code;data;constructor(e,t,r){super(e),this.code=t,this.data=r}};let tO={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:`Don’t see your wallet? Check your other browser windows.`,retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:`Don’t see your wallet? Check your other browser windows.`,retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Unlock your wallet and try again.",retryable:!0},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};function tN(e){let t;return"string"==typeof(t=e.type)&&tS.includes(t)&&"wallet_not_on_device"===e.type}let tR=e=>/^0x[0-9a-fA-F]*$/.test(e),tB=e=>tm.from(e,"utf8"),tD=e=>`0x${e.toString("hex")}`;async function tM(e,t){let r;if(t instanceof Uint8Array)r=y.O.base64.fromBytes(t);else{let e=p(t);if(void 0===e)throw new tA({error:"Failed to prepare the payload for signing",code:"invalid_input"});r=y.O.base64.fromBytes(y.O.utf8.toBytes(e))}let{signature:n}=await e({message:r});return{signature:n}}let tU="privy-request-expiry";async function tj(e,t,{wallet_id:r,headers:i,...s}){let a=e.getCompiledPath(n.H_,{params:{wallet_id:r}}),o=String(Date.now()+18e5),{signature:l}=await tM(t,{version:1,url:a,method:n.H_.method,headers:{"privy-app-id":e.app.appId,[tU]:o},body:{...s}});if(Date.now()>Number(o))throw new tA({error:"Wallet request expired before it could be sent. Please try again.",code:"embedded_wallet_request_expired"});
257return await e.fetchPrivyRoute(n.H_,{body:s,params:{wallet_id:r},headers:{"privy-authorization-signature":l,[tU]:o,...i??{}}})}function tL(e){var t,r;return(0,h.L1)(e)?(t=e,{type:h.iz,from:t.from,chain_id:tF(t.chainId),nonce:tF(t.nonce),nonce_key:tF(t.nonceKey),gas_limit:tF(t.gasLimit),max_fee_per_gas:tF(t.maxFeePerGas),max_priority_fee_per_gas:tF(t.maxPriorityFeePerGas),fee_token:t.feeToken,valid_after:tF(t.validAfter),valid_before:tF(t.validBefore),fee_payer_signature:function(e){var t;if(!e)return;let r=void 0!==(t=e).yParity?t.yParity:void 0!==t.v?Number(t.v)-27:void 0;if(0!==r&&1!==r)throw Error("Tempo fee payer signatures require a valid yParity value");return{r:e.r,s:e.s,y_parity:r}}(t.feePayerSignature),access_list:function(e){if(e)return Array.isArray(e)?e.map(e=>"address"in e?{address:e.address,storage_keys:[...e.storageKeys]}:{address:e[0],storage_keys:[...e[1]]}):Object.entries(e).map(([e,t])=>({address:e,storage_keys:[...t]}))}(t.accessList),calls:t.calls.map(e=>({to:e.to,data:e.data,value:tF(e.value)}))}):{from:(r=e).from,to:r.to??void 0,nonce:tF(r.nonce),chain_id:tF(r.chainId),data:function(e){if(void 0!==e)return"string"==typeof e?tR(e)?e:tD(tB(e)):tD(tm.from(Uint8Array.from(e)))}(r.data),value:tF(r.value),type:r.type,gas_limit:tF(r.gasLimit),gas_price:tF(r.gasPrice),max_fee_per_gas:tF(r.maxFeePerGas),max_priority_fee_per_gas:tF(r.maxPriorityFeePerGas)}}function tF(e){if("number"==typeof e||"bigint"==typeof e)return`0x${BigInt(e).toString(16)}`;if("string"==typeof e){if(tR(e))return e;throw Error(`Invalid quantity string: expected a hex-prefixed value (0x…), got "${e}". Use a number, bigint, or hex string instead.`)}}async function tz({context:e,account:t,rpcRequest:r}){switch(r.chainType){case"ethereum":return tq({context:e,account:t,rpcRequest:r.request});case"solana":return tW({context:e,account:t,rpcRequest:r.request})}}async function tq({context:e,account:t,rpcRequest:r}){switch(r.method){case"personal_sign":{let[n]=r.params,i=await tj(e,e.signRequest,{chain_type:"ethereum",method:"personal_sign",wallet_id:t.id,params:n.startsWith("0x")?{message:n.slice(2),encoding:"hex"}:{message:n,encoding:"utf-8"}});if("personal_sign"!==i.method)throw Error("Unable to sign message");return{data:i.data.signature}}case"eth_signTransaction":{let[n]=r.params,i=await tj(e,e.signRequest,{chain_type:"ethereum",method:"eth_signTransaction",wallet_id:t.id,params:{transaction:tL(n)}});if("eth_signTransaction"!==i.method)throw Error("Unable to sign transaction");return{data:i.data.signed_transaction}}case"eth_signTypedData_v4":{var n;let[,i]=r.params,s=await tj(e,e.signRequest,{chain_type:"ethereum",method:r.method,wallet_id:t.id,params:{typed_data:("string"==typeof(n=i)&&(n=JSON.parse(n)),{types:n.types,primary_type:String(n.primaryType),domain:n.domain,message:n.message})}});if("eth_signTypedData_v4"!==s.method)throw Error("Unable to sign typed data");return{data:s.data.signature}}case"eth_sign":{let[,n]=r.params,i=await tj(e,e.signRequest,{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:t.id,params:{hash:tR(n)?n:tD(tB(n))}});if("secp256k1_sign"!==i.method)throw Error("Unable to sign message");return{data:i.data.signature}}case"secp256k1_sign":{let[n]=r.params,i=await tj(e,e.signRequest,{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:t.id,params:{hash:tR(n)?n:tD(tB(n))}});if("secp256k1_sign"!==i.method)throw Error("Unable to sign message");return{data:i.data.signature}}case"csw_signUserOperation":case"eth_sendTransaction":case"eth_populateTransactionRequest":throw Error(`This wallet does not support the method: ${r.method}`)}}async function tW({context:e,account:t,rpcRequest:r}){if("signMessage"===r.method){let{message:n}=r.params,i=await tj(e,e.signRequest,{chain_type:"solana",method:"signMessage",wallet_id:t.id,params:{message:n,encoding:"base64"}});if("signMessage"!==i.method)throw Error("Unable to sign message");return{data:i.data.signature}}}let tH=(e,t,r,n)=>{let i=Number(e),s=t.find(e=>e.id===i);if(!s)throw new tk(`Unsupported chainId ${e}`,4901);let a=tK(s,r,n.appId);if(i===m.O.id||i===g.f.id){let e=i===m.O.id?m.O:g.f;return(0,l.l)({transport:(0,c.L)(a),chain:e})}return(0,l.l)({transport:(0,c.L)(a),chain:s})},tK=(e,t,r)=>{let n=e.id,i=Number(e.id),s;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])s=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[i])s=t.rpcUrls[i];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",r),s=t.toString()}else s=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!s)throw new tk(`No RPC url found for ${n}`);return s},tV=new Set(["eth_sign","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"]);var tG=class extends o.A{_walletProxy;_privyInternal;_account;_entropyId;_entropyIdVerifier;_chainId;_chains;_onNeedsRecovery;_client;_appApi;constructor({walletProxy:e,privyInternal:t,account:r,entropyId:n,entropyIdVerifier:i,chains:s,onNeedsRecovery:a,chainId:o=s[0].id,appApi:l}){super(),this._walletProxy=e,this._privyInternal=t,this._account=r,this._entropyId=n,this._entropyIdVerifier=i,this._chainId=o,this._chains=s,this._onNeedsRecovery=a,this._client=tH(o,s,{rpcUrls:[]},{appId:l.appId}),this._appApi=l}async request(e){if(tV.has(e.method))return this.handleIFrameRpc(e);switch(e.method){case"eth_accounts":case"eth_requestAccounts":return this._account.address?[this._account.address]:[];case"eth_chainId":return`0x${this._chainId.toString(16)}`;case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_signTransaction":{let t=e.params?.[0];return this.handleSignTransaction(t)}case"eth_sendTransaction":{let t=e.params?.[0];return this.handleSendTransaction(t)}case"eth_populateTransactionRequest":{let t=e.params?.[0];return this.handlePopulateTransaction(t)}default:return this.handleJsonRpc(e)}}ensureChainId(e){let t={chainId:this._chainId,...e};return this.internalSwitchEthereumChain(t.chainId),t}internalSwitchEthereumChain(e){e&&Number(e)!==this._chainId&&(this._chainId=Number(e),this._client=tH(this._chainId,this._chains,{rpcUrls:[]},{appId:this._privyInternal.appId}
257),this.emit("chainChanged",e))}async handlePopulateTransaction(e){let t=this.ensureChainId(e);if((0,h.L1)(t)){let e=(0,h.rt)(t),r=(0,h.VN)(await this.requireTempoClient().prepareTransactionRequest({account:t.from??this._account.address,...e}),t.gasLimit);return{...t,...r,type:h.iz}}let r=(0,h._r)(t),{gas:n,...i}=await this._client.prepareTransactionRequest({account:t.from??this._account.address,...r});return{...i,gasLimit:n,type:h.kY[i.type],authorizationList:t.authorizationList}}async handleSignTransaction(e){let t={...e};for(let e of Object.keys(t)){let r=t[e];"bigint"==typeof r&&(t[e]=(0,u.nj)(r))}return(0,h.L1)(t)&&(t.calls=t.calls.map(e=>({...e,value:"bigint"==typeof e.value?(0,u.nj)(e.value):e.value}))),await this.handleIFrameRpc({method:"eth_signTransaction",params:[t]})}async handleSendTransaction(e){let t=await this.handlePopulateTransaction(e),r=await this.handleSignTransaction(t);return await this.handleJsonRpc({method:"eth_sendRawTransaction",params:[r]})}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");let t=e.params?.[0],r=this.ensureChainId(t);if((0,h.L1)(r)){let e=(0,h.rt)(r);return await this.requireTempoClient().estimateGas({account:r.from??this._account.address,...e})}let n=(0,h._r)(r);return await this._client.estimateGas({account:r.from??this._account.address,...n})}handleSwitchEthereumChain(e){let t;if(!e.params||!Array.isArray(e.params))throw new tT(`Invalid params for ${e.method}`,4200);if("string"==typeof e.params[0])t=e.params[0];else if("chainId"in e.params[0]&&"string"==typeof e.params[0].chainId)t=e.params[0].chainId;else throw new tT(`Invalid params for ${e.method}`,4200);this.internalSwitchEthereumChain(t)}async handleIFrameRpc(e){try{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address});let r=this._account;if(tC(r)){let{data:n}=await tz({context:{app:this._appApi,fetchPrivyRoute:(...e)=>this._privyInternal.fetch(...e),getCompiledPath:(...e)=>this._privyInternal.getPath(...e),signRequest:({message:e})=>this._walletProxy.signWithUserSigner({accessToken:t,message:e})},account:r,rpcRequest:{chainType:"ethereum",request:e}});return n}try{await this._walletProxy.connect({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:t})}catch(r){let e=tN(r);if(e&&"privy"===this._account.recovery_method)await this._walletProxy.recover({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:t});else if(e&&this._onNeedsRecovery){let e;await new Promise(async(t,r)=>{e=setTimeout(()=>r(new tA({code:"embedded_wallet_recovery_error",error:"User-owned recovery timed out"})),12e4),await this._onNeedsRecovery?.({recoveryMethod:this._account.recovery_method,onRecovered:()=>t(!0)})}).finally(()=>clearTimeout(e))}else throw r}return(await this._walletProxy.rpcWallet({accessToken:t,request:e,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,hdWalletIndex:this._account.wallet_index,chainType:"ethereum"})).response.data}catch(r){console.error(r);let t=r instanceof Error?r.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:t}),new tA({code:"embedded_wallet_request_error",error:t})}}async handleJsonRpc(e){return this._client.request(e)}requireTempoClient(){var e;if((e=this._chainId)!==m.O.id&&e!==g.f.id)throw new tT(`Cannot send a Tempo (type 118) transaction on chain ${this._chainId}`,4901);return this._client}toJSON(){return`PrivyEIP1193Provider { address: '${this._account.address}', chainId: ${this._chainId}, request: [Function] }`}};function tJ(e){return"version"in e}function tY(e,t){let r=(tJ(e)?e.message:e.compileMessage()).staticAccountKeys.find(e=>e.toBase58()===t);if(!r)throw Error(`Transaction does not contain public key ${t}`);return r}var tZ=class{_proxy;_privyInternal;_app;_entropyId;_entropyIdVerifier;_account;_onNeedsRecovery;constructor({proxy:e,privyInternal:t,account:r,entropyId:n,entropyIdVerifier:i,onNeedsRecovery:s,app:a}){this._proxy=e,this._privyInternal=t,this._account=r,this._entropyId=n,this._entropyIdVerifier=i,this._onNeedsRecovery=s,this._app=a}async request(e){if(!await this._privyInternal.getAccessTokenInternal())throw new tA({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});switch(e.method){case"signAndSendTransaction":return await this.handleSignAndSendTransaction(e);case"signTransaction":return await this.handleSignTransaction(e);default:return await this.handleIFrameRpc(e)}}get _publicKey(){return this._account.address}
257async connectAndRecover(e){if("privy-v2"!==this._account.recovery_method)try{await this._proxy.connect({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:e})}catch(r){let t=tN(r);if(t&&"privy"===this._account.recovery_method)await this._proxy.recover({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:e});else if(t&&this._onNeedsRecovery){let e;await new Promise(async(t,r)=>{e=setTimeout(()=>r(new tA({code:"embedded_wallet_recovery_error",error:"User-owned recovery timed out"})),12e4),await this._onNeedsRecovery?.({recoveryMethod:this._account.recovery_method,onRecovered:()=>t(!0)})}).finally(()=>clearTimeout(e))}else throw r}}async signMessageRpc(e,t){let r=this._account;if(!tC(r))return(await this._proxy.rpcWallet({accessToken:t,request:e,chainType:"solana",hdWalletIndex:this._account.wallet_index,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier})).response.data;{let{data:n}=await tz({context:{app:this._app,fetchPrivyRoute:(...e)=>this._privyInternal.fetch(...e),getCompiledPath:(...e)=>this._privyInternal.getPath(...e),signRequest:({message:e})=>this._proxy.signWithUserSigner({accessToken:t,message:e})},account:r,rpcRequest:{chainType:"solana",request:e}});return{signature:n}}}async handleIFrameRpc(e){try{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw Error("Missing privy token. User must be logged in");return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(t),await this.signMessageRpc(e,t)}catch(r){console.error(r);let t=r instanceof Error?r.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:t}),new tA({code:"embedded_wallet_request_error",error:t})}}async handleSignAndSendTransaction(e){try{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(t);let{transaction:r,connection:n,options:i}=e.params,s=tY(r,this._account.address),a=tJ(r)?tm.from(r.message.serialize()):r.serializeMessage(),{signature:o}=await this.signMessageRpc({method:"signMessage",params:{message:a.toString("base64")}},t);return r.addSignature(s,tm.from(o,"base64")),{signature:await n.sendRawTransaction(r.serialize(),i)}}catch(r){console.error(r);let t=r instanceof Error?r.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:t}),new tA({code:"embedded_wallet_request_error",error:t})}}async handleSignTransaction(e){try{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(t);let{transaction:r}=e.params,n=tY(r,this._account.address),i=tJ(r)?tm.from(r.message.serialize()):r.serializeMessage(),{signature:s}=await this.signMessageRpc({method:"signMessage",params:{message:i.toString("base64")}},t);return r.addSignature(n,tm.from(s,"base64")),{signedTransaction:r}}catch(r){console.error(r);let t=r instanceof Error?r.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.wallet_index,error:t}),new tA({code:"embedded_wallet_request_error",error:t})}}toJSON(){return`PrivyEmbeddedSolanaProvider { address: '${this._account.address}', request: [Function] }`}},tQ=class{_proxy;_privyInternal;_account;_entropyId;_entropyIdVerifier;constructor({proxy:e,privyInternal:t,account:r,entropyId:n,entropyIdVerifier:i}){this._proxy=e,this._privyInternal=t,this._account=r,this._entropyId=n,this._entropyIdVerifier=i}async sign({message:e}){return await this.request({method:"sign",params:{message:new TextDecoder("utf8").decode(e)}})}async signTransaction({psbt:e}){return await this.request({method:"signTransaction",params:{psbt:e}})}async request(e){if(tC(this._account))throw new tA({code:"unsupported_wallet_type",error:"Bitcoin wallet providers are only supported for on-device execution and this app uses TEE execution. Use the useSignRawHash hook from @privy-io/expo/extended-chains to sign over a hash with this wallet. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide"});if(!await this._privyInternal.getAccessTokenInternal())throw new tA({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});return this.handleIFrameRpc(e)}async handleIFrameRpc(e){try{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw Error("Missing access token. User must be authenticated.");return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}
257),(await this._proxy.rpcWallet({accessToken:t,request:e,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,hdWalletIndex:this._account.wallet_index,chainType:this._account.chain_type})).response.data}catch(r){console.error(r);let t=r instanceof Error?r.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:t}),new tA({code:"embedded_wallet_request_error",error:t})}}toJSON(){return`PrivyEmbeddedBitcoinProvider { address: '${this._account.address}', request: [Function] }`}},tX=class{callbacks={};enqueue(e,t){this.callbacks[e]=t}flush(e){let t=Object.values(this.callbacks);for(let{reject:r}of(this.callbacks={},t))r(e)}dequeue(e,t){let r=this.callbacks[t];if(!r)return console.warn(`[Privy] No callback found for "${e}" (id: ${t})`),null;switch(delete this.callbacks[t],e){case"privy:iframe:ready":case"privy:wallets:create":case"privy:user-signer:sign":case"privy:wallets:add":case"privy:wallets:set-recovery":case"privy:wallets:connect":case"privy:wallets:recover":case"privy:wallets:rpc":case"privy:wallet:create":case"privy:wallet:connect":case"privy:wallet:recover":case"privy:wallet:rpc":case"privy:solana-wallet:create":case"privy:solana-wallet:create-additional":case"privy:solana-wallet:connect":case"privy:solana-wallet:recover":case"privy:solana-wallet:rpc":case"privy:delegated-actions:consent":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":case"privy:auth:unlink-passkey":return r;default:throw Error(`invalid wallet event type ${e}`)}}};async function t0(e,t,r,n,i=!1,s,a){let o=i,l=async s=>o?(s===+!i?n():r.current?.reject(new t$("missing_or_invalid_mfa","MFA verification failed, retry.")),await e(await new Promise((e,n)=>{t.current={resolve:e,reject:n},setTimeout(()=>{let e=new t$("mfa_timeout","Timed out waiting for MFA code");r.current?.reject(e),n(e)},a)}))):await e(),c=null;for(let e=0;e<s;e++)try{c=await l(e),r.current?.resolve(void 0);break}catch(e){if("missing_or_invalid_mfa"===e.type)o=!0;else throw r.current?.resolve(void 0),e}if(null===c){let e=new t$("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw r.current?.reject(e),e}return c}let t1=function(e){return()=>`id-${e++}`}(0),t2=(e,t)=>"bigint"==typeof t?t.toString():t,t5=async(e,{ms:t,msg:r})=>{let n,i=new Promise((e,i)=>{n=setTimeout(()=>{i(Error(r))},t??15e3)});try{return await Promise.race([e,i])}finally{void 0!==n&&clearTimeout(n)}},t6=new tX;var t3=class{ready;_waitForReadyPromise=null;cache;_embeddedWalletMessagePoster;mfa;constructor(e,t){this.ready=!1,this.cache=new Map,this._embeddedWalletMessagePoster=e,this.mfa=t}invokeWithMfa(e,t){return t5(t0(r=>t5(this.waitForReady().then(()=>e(r)),{msg:t.timeoutMsg,ms:t.timeoutMs}),this.mfa.rootPromise,this.mfa.submitPromise,()=>this.mfa.emit("mfaRequired"),t.mfaAlwaysRequired??!1,4,3e5),{msg:"Operation reached timeout: MFA verification",ms:126e4})}reload(){return this.ready=!1,this._waitForReadyPromise=null,t6.flush(Error("Embedded wallet WebView was reloaded")),this.cache.clear(),this._embeddedWalletMessagePoster.reload()}onBackground(){this.ready=!1}ping(e=15e3){return t5(this.invoke("privy:iframe:ready",{}),{msg:"Ping reached timeout",ms:e})}create(e){return t5(this.waitForReady().then(()=>this.invoke("privy:wallet:create",e)),{msg:"Operation reached timeout: create"})}rpc(e){return this.invokeWithMfa(t=>this.invoke("privy:wallet:rpc",{...t,...e}),{timeoutMsg:"Operation reached timeout: rpc"})}createSolana(e){return this.invokeWithMfa(t=>this.invoke("privy:solana-wallet:create",{...t,...e}),{timeoutMsg:"Operation reached timeout: create",timeoutMs:6e4})}createAdditionalSolana(e){return t5(this.waitForReady().then(()=>this.invoke("privy:solana-wallet:create-additional",e)),{msg:"Operation reached timeout: create"})}solanaRpc(e){return this.invokeWithMfa(t=>this.invoke("privy:solana-wallet:rpc",{...t,...e}),{timeoutMsg:"Operation reached timeout: solana-rpc"})}delegateWallets(e){return this.invokeWithMfa(t=>this.invoke("privy:delegated-actions:consent",{...t,...e}),{timeoutMsg:"Operation reached timeout: delegated-actions:consent"})}verifyMfa(e){return this.invokeWithMfa(t=>this.invoke("privy:mfa:verify",{...t,...e}),{timeoutMsg:"Operation reached timeout: mfa:verify",mfaAlwaysRequired:!0})}initEnrollMfa(e){return this.invokeWithMfa(t=>this.invoke("privy:mfa:init-enrollment",{...t,...e}),{timeoutMsg:"Operation reached timeout: mfa:init-enrollment"})}submitEnrollMfa(e){return"passkey"===e.method?this.invokeWithMfa(t=>this.invoke("privy:mfa:submit-enrollment",{...t,...e}),{timeoutMsg:"Operation reached timeout: mfa:submit-enrollment"}):t5(this.waitForReady().then(()=>this.invoke("privy:mfa:submit-enrollment",e)),{msg:"Operation reached timeout: mfa:submit-enrollment"})}unenrollMfa(e){return this.invokeWithMfa(t=>this.invoke("privy:mfa:unenroll",{...t,...e}),{timeoutMsg:"Operation reached timeout: mfa:unenroll",mfaAlwaysRequired:!0})}unlinkPasskey(e){return this.invokeWithMfa(t=>this.invoke("privy:auth:unlink-passkey",{...t,...e}),{timeoutMsg:"Operation reached timeout: auth:unlink-passkey",mfaAlwaysRequired:!0})}clearMfa(e){return t5(this.waitForReady().then(()=>this.invoke("privy:mfa:clear",e)),{msg:"Operation reached timeout: mfa:clear"})}createWallet(e){return this.invokeWithMfa(t=>this.invoke("privy:wallets:create",{...t,...e}),{timeoutMsg:"Operation reached timeout: create",timeoutMs:6e4})}signWithUserSigner(e){return this.invokeWithMfa(t=>this.invoke("privy:user-signer:sign",{...t,...e}),{timeoutMsg:"Operation reached timeout: user-signer:sign"})}addWallet(e){return t5(this.waitForReady().then(()=>this.invoke("privy:wallets:add",e)),{msg:"Operation reached timeout: wallets:add"})}setRecovery(e){return this.invokeWithMfa(t=>this.invoke("privy:wallets:set-recovery",{...t,...e}),{timeoutMsg:"Operation reached timeout: wallets:set-recovery",t
257imeoutMs:6e4})}connect(e){return t5(this.waitForReady().then(()=>this.invoke("privy:wallets:connect",e)),{msg:"Operation reached timeout: wallets:connect"})}recover(e){return this.invokeWithMfa(t=>this.invoke("privy:wallets:recover",{...t,...e}),{timeoutMsg:"Operation reached timeout: wallets:recover",timeoutMs:6e4})}rpcWallet(e){return this.invokeWithMfa(t=>this.invoke("privy:wallets:rpc",{...t,...e}),{timeoutMsg:"Operation reached timeout: wallets:rpc"})}handleEmbeddedWalletMessages(e){if(!e.event.startsWith("privy:"))return void console.warn(`Unsupported event type: ${e.event}`);let t=t6.dequeue(e.event,e.id);if(t)return void 0!==e.error?t.reject(new t$(e.error.type,e.error.message)):t.resolve(e.data)}waitForReady(){return this.ready?Promise.resolve():(this._waitForReadyPromise||=new Promise((e,t)=>{(async()=>{for(let t=0;t<100&&!this.ready;t++)this.invoke("privy:iframe:ready",{}).then(()=>{this.ready=!0,this._waitForReadyPromise=null,e()}).catch(()=>{}),await new Promise(e=>setTimeout(e,150));this.ready||(this._waitForReadyPromise=null,t(Error("Embedded wallet WebView failed to become ready")))})()}),this._waitForReadyPromise)}invoke(e,t){let r=`${e}${JSON.stringify(t,t2)}`;if("privy:wallet:create"===e||"privy:solana-wallet:create"===e){let e=this.cache.get(r);if(e)return e}let n=new Promise((r,n)=>{let i=t1();t6.enqueue(i,{resolve:r,reject:n}),this._embeddedWalletMessagePoster.postMessage(JSON.stringify({id:i,event:e,data:t}),"*")}).finally(()=>{this.cache.delete(r)});return this.cache.set(r,n),n}};async function t8(e,{request:t,headers:r}){return await e.fetchPrivyRoute(n.GK,{body:t,headers:r})}async function t4({context:e,chainType:t,idempotencyKey:r}){return{wallet:await t8(e,{request:{chain_type:t,owner_id:void 0},headers:r?{"privy-idempotency-key":r}:void 0})}}var t9=class{_privyInternal;_proxy;_chains=Array.from(a.mf);_mfa;_mfaPromises;_appApi;constructor(e,t,r,n,i,s){if(this._privyInternal=e,t&&(this._proxy=new t3(t,i),n.setProxy(this._proxy)),r){let e=(0,a._h)(r);this._chains=e}
257this._mfa=n,this._mfaPromises=i,this._appApi=s}setMessagePoster(e){this._proxy=new t3(e,this._mfaPromises),this._mfa.setProxy(this._proxy)}async signWithUserSigner(e){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw new tA({error:"User must be logged in to sign a message with the user signer",code:"user_signer_sign_error"});let{signature:r}=await this._proxy.signWithUserSigner({accessToken:t,message:e.message});return{signature:r}}async add(e){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(this._privyInternal.config?.embedded_wallet_config.mode==="user-controlled-server-wallets-only")await t4({context:{app:this._appApi,fetchPrivyRoute:(...e)=>this._privyInternal.fetch(...e),getCompiledPath:(...e)=>this._privyInternal.getPath(...e)},chainType:e.chainType});else{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw new tA({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});await this._proxy.addWallet({accessToken:t,...e})}let{user:t}=await this._privyInternal.refreshSession();return{user:t}}async getBitcoinProvider({wallet:e,entropyId:t,entropyIdVerifier:r,recoveryPassword:n,recoveryAccessToken:i,recoverySecretOverride:s}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(!await this._privyInternal.getAccessTokenInternal())throw Error("User must be logged in to create an embedded wallet");return tC(e)||await this._load({entropyId:t,entropyIdVerifier:r,wallet:e,recoveryPassword:n,recoveryAccessToken:i,recoverySecretOverride:s}),new tQ({account:e,privyInternal:this._privyInternal,proxy:this._proxy,entropyId:t,entropyIdVerifier:r})}async create({password:e,recoveryMethod:t,recoveryToken:r,recoveryKey:n,recoverySecretOverride:i,iCloudRecordNameOverride:s,solanaAccount:a,skipCallbacks:o,idempotencyKey:l}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(this._privyInternal.config?.embedded_wallet_config.mode==="user-controlled-server-wallets-only"){if(t&&!t.startsWith("privy"))throw new tA({error:"User-controlled server wallets do not support custom recovery methods",code:"embedded_wallet_creation_error"});await t4({context:{app:this._appApi,fetchPrivyRoute:(...e)=>this._privyInternal.fetch(...e),getCompiledPath:(...e)=>this._privyInternal.getPath(...e)},chainType:"ethereum",idempotencyKey:l})}else{let o;if(o=t||(e?"user-passcode":"privy"),e&&"string"!=typeof e)throw Error("Invalid recovery password, must be a string");if("privy"===o&&this._privyInternal.config?.embedded_wallet_config.require_user_password_on_create)throw Error("Password not provided yet is required by App configuration");let l=await this._privyInternal.getAccessTokenInternal();if(!l)throw Error("User must be logged in to create an embedded wallet");let{address:c}=await this._proxy.create({accessToken:l,recoveryMethod:o,recoveryKey:n,recoveryPassword:e,recoveryAccessToken:r,recoverySecretOverride:i,iCloudRecordNameOverride:s,solanaAddress:a?.address});if(!c)throw Error("Failed to create wallet")}return await this._privyInternal.refreshSession(o)}async createSolana(e){if(!this._proxy)throw new tA({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_creation_error"});if(this._privyInternal.config?.embedded_wallet_config.mode==="user-controlled-server-wallets-only")await t4({context:{app:this._appApi,fetchPrivyRoute:(...e)=>this._privyInternal.fetch(...e),getCompiledPath:(...e)=>this._privyInternal.getPath(...e)},chainType:"solana",idempotencyKey:e?.idempotencyKey});else{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw new tA({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});e?.ethereumAccount&&await this.getProvider(e.ethereumAccount);let{publicKey:r}=await this._proxy.createSolana({accessToken:t,ethereumAddress:e?.ethereumAccount?.address});if(!r)throw new tA({error:"Failed to create wallet",code:"embedded_wallet_creation_error"})}return await this._privyInternal.refreshSession()}async delegateWallets({delegatedWallets:e,rootWallet:t}){if(!this._proxy)throw new tA({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_creation_error"});let r=await this._privyInternal.getAccessTokenInternal();if(!r)throw new tA({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});await this._proxy.delegateWallets({accessToken:r,delegatedWallets:e,rootWallet:t})}async getProvider(e,t,r,n,i){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");
257return tC(e)||await this._load({wallet:e,entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier",recoveryPassword:t,recoveryKey:i,recoveryAccessToken:r,recoverySecretOverride:n}),new tG({account:e,entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,appApi:this._appApi})}async getEthereumProvider({wallet:e,entropyId:t,entropyIdVerifier:r,recoveryPassword:n,recoveryAccessToken:i,recoverySecretOverride:s,recoveryKey:a,onNeedsRecovery:o}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(!await this._privyInternal.getAccessTokenInternal())throw Error("User must be logged in to create an embedded wallet");return tC(e)||(!o||n||i||s||a)&&await this._load({entropyId:t,entropyIdVerifier:r,wallet:e,recoveryPassword:n,recoveryAccessToken:i,recoverySecretOverride:s,recoveryKey:a}),new tG({account:e,entropyId:t,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,onNeedsRecovery:o,appApi:this._appApi})}async getSolanaProvider(e,t,r,n,i,s,a){if(!this._proxy)throw new tA({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return tC(e)||(!a||n||i||s)&&await this._load({wallet:e,entropyId:t,entropyIdVerifier:r,recoveryPassword:n,recoveryAccessToken:i,recoverySecretOverride:s}),new tZ({account:e,privyInternal:this._privyInternal,proxy:this._proxy,entropyId:t,entropyIdVerifier:r,onNeedsRecovery:a,app:this._appApi})}async setRecovery(e){let{wallet:t,...r}=e;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(tC(t))throw new tA({error:"This wallet does not support setting recovery methods",code:"unsupported_recovery_method"});(function({currentRecoveryMethod:e,upgradeToRecoveryMethod:t}){switch(e){case"privy":case"user-passcode":case"recovery-encryption-key":return;case"icloud":case"google-drive":if(e===t)throw Error("Cannot upgrade to the existing cloud platform");return;default:throw Error("Unknown recovery method")}})({currentRecoveryMethod:t.recovery_method,upgradeToRecoveryMethod:"icloud-native"===r.recoveryMethod?"icloud":r.recoveryMethod}),await this._load("solana"===t.chain_type?{wallet:t,entropyId:t.address,entropyIdVerifier:"solana-address-ver
257ifier"}:{wallet:t,entropyId:t.address,entropyIdVerifier:"ethereum-address-verifier"});let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("User must be logged in to interact with embedded wallets");let i=t.recovery_method;this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_started",{address:t.address,target_recovery_method:r.recoveryMethod,existing_recovery_method:i});try{let e;if("user-passcode"===r.recoveryMethod)e={recoveryMethod:"user-passcode",recoveryPassword:r.password};else if("google-drive"===r.recoveryMethod)e={recoveryMethod:"google-drive",recoveryAccessToken:r.recoveryAccessToken};else if("icloud"===r.recoveryMethod)e={recoveryMethod:"icloud",recoveryAccessToken:r.recoveryAccessToken};else if("icloud-native"===r.recoveryMethod)e={recoveryMethod:"icloud-native",iCloudRecordNameOverride:r.iCloudRecordNameOverride,recoverySecretOverride:r.recoverySecretOverride};else if("recovery-encryption-key"===r.recoveryMethod)e={recoveryMethod:"recovery-encryption-key",recoveryKey:r.recoveryKey};else if("privy"===r.recoveryMethod)e={recoveryMethod:"privy"};else throw Error(`Unknown recovery method: ${r.recoveryMethod}`);await this._proxy.setRecovery({accessToken:n,entropyId:t.address,entropyIdVerifier:"solana"===t.chain_type?"solana-address-ver
257ifier":"ethereum-address-verifier",...e}),this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_completed",{address:t.address,target_recovery_method:r.recoveryMethod,existing_recovery_method:i});let{user:s}=await this._privyInternal.refreshSession();return{user:s,provider:"ethereum"===t.chain_type?new tG({account:t,entropyId:t.address,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,appApi:this._appApi}):null}}catch(e){throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_failed",{address:t.address,recovery_method:t.recovery_method,error:e instanceof Error?e.message:"Unable to recover wallet"}),e}}getURL(){let e=new URL(`${this._privyInternal.baseUrl}/apps/${this._privyInternal.appId}/embedded-wallets`);return this._privyInternal.caid&&e.searchParams.append("caid",this._privyInternal.caid),this._privyInternal.appClientId&&e.searchParams.append("client_id",this._privyInternal.appClientId),e.href}get chains(){return this._chains}onMessage(e){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");return this._proxy.handleEmbeddedWalletMessages(e)}reload(){if(!this._proxy)return void this._privyInternal.logger.warn("Attempted to reload proxy before initialized");this._proxy.reload()}onBackground(){this._proxy?.onBackground()}async ping(e){try{if(!this._proxy)throw Error("Embedded wallet proxy not initialized");return await this._proxy.ping(e),!0}catch(e){return this._privyInternal.logger.debug(e),!1}}async _load({entropyId:e,entropyIdVerifier:t,wallet:r,recoveryPassword:n,recoveryKey:i,recoveryAccessToken:s,recoverySecretOverride:a}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");let o=await this._privyInternal.getAccessTokenInternal();if(!o)throw Error("User must be logged in to interact with embedded wallets");try{return await this._proxy.connect({accessToken:o,entropyId:e,entropyIdVerifier:t}),e}catch(l){if(tN(l))try{if("privy"===r.recovery_method){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let n=await this._proxy.recover({accessToken:o,entropyId:e,entropyIdVerifier:t});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),n.entropyId}if("user-passcode"===r.recovery_method&&n){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let i=await this._proxy.recover({accessToken:o,recoveryPassword:n,entropyId:e,entropyIdVerifier:t});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),i.entropyId}if(["google-drive","icloud"].includes(r.recovery_method)&&s){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let n=await this._proxy.recover({accessToken:o,recoveryAccessToken:s,entropyId:e,entropyIdVerifier:t});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),n.entropyId}if("icloud"===r.recovery_method&&a){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:"icloud-native"});let n=await this._proxy.recover({accessToken:o,recoverySecretOverride:a,entropyId:e,entropyIdVerifier:t});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:"icloud-native"}),n.entropyId}if("recovery-encryption-key"===r.recovery_method&&i){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let n=await this._proxy.recover({accessToken:o,recoveryKey:i,entropyId:e,entropyIdVerifier:t});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.re
257covery_method}),n.entropyId}}catch(t){throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_failed",{address:r.address,recovery_method:r.recovery_method,error:t instanceof Error?t.message:`Unable to recover wallet: ${e}`}),t}throw l}}},t7=class extends o.A{rootPromise;submitPromise;constructor(){super(),this.rootPromise={current:null},this.submitPromise={current:null}}};let re="privy:active-user",rt="privy:saved-users",rr=e=>e?`privy:${e}:token`:"privy:token",rn=e=>e?`privy:${e}:pat`:"privy:pat",ri=e=>e?`privy:${e}:refresh_token`:"privy:refresh_token",rs=e=>e?`privy:${e}:id-token`:"privy:id-token",ra=e=>e?`privy-${e}-token`:"privy-token",ro=e=>e?`privy-${e}-refresh-token`:"privy-refresh-token",rl=e=>e?`privy-${e}-id-token`:"privy-id-token",rc=e=>e?`privy-${e}-session`:"privy-session",ru=Promise.allSettled.bind(Promise)??(e=>Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))))),rd=["storage_cleared","token_cleared","refresh_token_cleared","identity_token_cleared","token_stored","refresh_token_stored","identity_token_stored","oauth_tokens_granted","error_storing_tokens"];var rf=class extends o.A{static events=rd;_storage;_isUsingServerCookies=!1;GUEST_CREDENTIAL_STORAGE_KEY;_setStoredUsers;_hasEmittedStoredUsers=!1;constructor(e){super(),this._storage=e.storage,this.GUEST_CREDENTIAL_STORAGE_KEY=`privy:guest:${e.appId}`,this._setStoredUsers=e.setStoredUsers}set isUsingServerCookies(e){this._isUsingServerCookies=e}setStoredUsersCallback(e){this._setStoredUsers=e,this.getSavedUserIds().then(e=>{this._hasEmittedStoredUsers||this._setStoredUsers?.({users:e.map(e=>({id:e}))})})}async getCustomerAccessToken(){let e=await this.getActiveUserId(),t=await this._storage.get(rr(e));try{return"string"==typeof t?new tv(t).value:null}catch(e){return console.error(e),await this.destroyLocalState({reason:"getToken_error"}),null}}async getPrivyAccessToken(){let e=await this.getActiveUserId(),t=await this._storage.get(rn(e));try{return"string"==typeof t?new tv(t).value:null}catch(e){return console.error(e),await this.destroyLocalState({reason:"getToken_error"}),null}}async getRefreshToken(){let e=await this.getActiveUserId(),t=await this._storage.get(ri(e));return"string"==typeof t?t:null}async getIdentityToken(){let e=await this.getActiveUserId(),t=await this._storage.get(rs(e));return"string"==typeof t?t:null}async mightHaveServerCookies(){try{let e=await this.getActiveUserId(),t=v.A.get(rc(e));if(void 0!==t&&t.length>0)return!0;let r=v.A.get(rc(null));return void 0!==r&&r.length>0}catch(e){console.error(e)}return!1}async hasRefreshCredentials(e,t){return await this.mightHaveServerCookies()||"string"==typeof e&&"string"==typeof t}tokenIsActive(e){if(!e)return!1;let t=tv.parse(e);return null!==t&&!t.isExpired(30)}async destroyLocalState(e){let t=await this.getActiveUserId(),r=[this._storage.del(rr(null)),this._storage.del(rn(null)),this._storage.del(ri(null)),this._storage.del(rs(null)),this._storage.del(this.GUEST_CREDENTIAL_STORAGE_KEY),this._storage.del(re)];t&&r.push(this._storage.del(rr(t)),this._storage.del(rn(t)),this._storage.del(ri(t)),this._storage.del(rs(t)),this.removeSavedUserId(t)),await ru(r),v.A.remove(ra(null)),v.A.remove(ro(null)),v.A.remove(rl(null)),v.A.remove(rc(null)),t&&(v.A.remove(ra(t)),v.A.remove(ro(t)),v.A.remove(rl(t)),v.A.remove(rc(t))),e?.reason&&this.emit("storage_cleared",{reason:e.reason})}async storeCustomerAccessToken(e){let t=await this.getActiveUserId();await this.storeCustomerAccessTokenForUser(t,e)}async storeCustomerAccessTokenForUser(e,t){let r=rr(e),n=ra(e);if("string"==typeof t){let e=await this._storage.get(r);if(await this._storage.put(r,t),!this._isUsingServerCookies){let e=tv.parse(t)?.expiration;v.A.set(n,t,{sameSite:"Strict",secure:!0,expires:e?new Date(1e3*e):void 0})}e!==t&&this.emit("token_stored",{cookiesEnabled:this._isUsingServerCookies})}else{let e=await this._storage.get(r);await this._storage.del(r),v.A.remove(n),null!==e&&this.emit("token_cleared",{reason:"set_with_non_string_value"})}}async storePrivyAccessToken(e){let t=await this.getActiveUserId();await this.storePrivyAccessTokenForUser(t,e)}async storePrivyAccessTokenForUser(e,t){let r=rn(e);"string"==typeof t?await this._storage.put(r,t):await this._storage.del(r)}async storeRefreshTokenForUser(e,t){let r=ri(e),n=ro(e),i=rc(e);"string"==typeof t?(await this._storage.put(r,t),this._isUsingServerCookies||(v.A.set(i,"t",{sameSite:"Str
257ict",secure:!0,expires:30}),v.A.set(n,t,{sameSite:"Strict",secure:!0,expires:30})),this.emit("refresh_token_stored",{cookiesEnabled:this._isUsingServerCookies})):(await this._storage.del(r),v.A.remove(n),v.A.remove(i),this.emit("refresh_token_cleared",{reason:"set_with_non_string_value"}))}async updateWithTokensResponse(e){let t=e.user.id,r=(await ru([this.storeCustomerAccessTokenForUser(t,e.token),this.storePrivyAccessTokenForUser(t,e.privy_access_token),this.storeRefreshTokenForUser(t,e.refresh_token),this.storeIdentityTokenForUser(t,e.identity_token)])).filter(e=>"rejected"===e.status);if(r.length>0)return void this.emit("error_storing_tokens",r.map(e=>String(e.reason)).join(", "));let n=(await ru([this.storeCustomerAccessTokenForUser(null,e.token),this.storePrivyAccessTokenForUser(null,e.privy_access_token),this.storeRefreshTokenForUser(null,e.refresh_token),this.storeIdentityTokenForUser(null,e.identity_token)])).filter(e=>"rejected"===e.status);if(n.length>0)return void this.emit("error_storing_tokens",n.map(e=>String(e.reason)).join(", "));await this.storeActiveUserId(t);let i=(await ru([this.processOAuthTokens(e.oauth_tokens)])).filter(e=>"rejected"===e.status);i.length>0&&this.emit("error_storing_tokens",i.map(e=>String(e.reason)).join(", "))}async backfillLegacySession(){if(await this.getActiveUserId())return;let[e,t,r,n]=await Promise.all([this._storage.get(rr(null)),this._storage.get(rn(null)),this._storage.get(ri(null)),this._storage.get(rs(null))]);if("string"!=typeof e||"string"!=typeof r)return;let i=tv.parse(e)?.subject;if("string"!=typeof i||0===i.length)return;let s=[this.storeCustomerAccessTokenForUser(i,e),this.storeRefreshTokenForUser(i,r)];"string"==typeof t&&s.push(this.storePrivyAccessTokenForUser(i,t)),"string"==typeof n&&s.push(this.storeIdentityTokenForUser(i,n));let a=(await ru(s)).filter(e=>"rejected"===e.status);if(a.length>0)return void this.emit("error_storing_tokens",a.map(e=>String(e.reason)).join(", "));await this.storeActiveUserId(i)}async processOAuthTokens(e){e&&this.emit("oauth_tokens_granted",e)}async storeIdentityToken(e){let t=await this.getActiveUserId();await this.storeIdentityTokenForUser(t,e)}async storeIdentityTokenForUser(e,t){let r=rs(e),n=rl(e);if("string"==typeof t){let e=await this._storage.get(r);if(await this._storage.put(r,t),!this._isUsingServerCookies){let e=tv.parse(t)?.expiration;v.A.set(n,t,{sameSite:"Strict",secure:!0,expires:e?new Date(1e3*e):void 0})}e!==t&&this.emit("identity_token_stored",{cookiesEnabled:this._isUsingServerCookies})}else{let e=await this._storage.get(r);await this._storage.del(r),v.A.remove(n),null!==e&&this.emit("identity_token_cleared",{reason:"set_with_non_string_value"})}}async getOrCreateGuestCredential(){let e=await this._storage.get(this.GUEST_CREDENTIAL_STORAGE_KEY);if(e&&"string"==typeof e)return e;let t=s.l(crypto.getRandomValues(new Uint8Array(32)));return await this._storage.put(this.GUEST_CREDENTIAL_STORAGE_KEY,t),t}async getActiveUserId(){let e=await this._storage.get(re);return"string"==typeof e?e:null}
257async storeActiveUserId(e){let t=await this.getSavedUserIds();await this.storeSavedUserIds([...t,e]),await this._storage.put(re,e)}async getSavedUserIds(){let e=await this._storage.get(rt);if("string"!=typeof e)return[];try{let t=JSON.parse(e),r=Array.isArray(t)?t.filter(e=>"string"==typeof e):[];return[...new Set(r)]}catch{return[]}}async storeSavedUserIds(e){let t=[...new Set(e)];t.length>0?await this._storage.put(rt,JSON.stringify(t)):await this._storage.del(rt),this._setStoredUsers&&(this._hasEmittedStoredUsers=!0,this._setStoredUsers({users:t.map(e=>({id:e}))}))}async removeSavedUserId(e){let t=await this.getSavedUserIds();await this.storeSavedUserIds(t.filter(t=>t!==e))}async switchActiveUserId(e){if(!(await this.getSavedUserIds()).includes(e))throw new tA({code:"invalid_input",error:"Cannot switch active user because the user ID is not saved on this device"});await this._storage.put(re,e)}};let rh=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal},rp=()=>void 0,ry={NONE:-1/0,ERROR:1,WARN:2,INFO:3,DEBUG:1/0},rm="privy:caid";var rg=class{baseUrl;callbacks;appId;appClientId;logger;session;_config;_analyticsId;_storage;_sdkVersion="js-sdk-core:0.68.6";_fetch;nativeAppIdentifier;_crypto;isMultiUserModeEnabled;_cache=new Map;constructor(e){this.logger=(({level:e,logger:t})=>({get level(){return e},error:ry[e]>=ry.ERROR?t.error:rp,warn:ry[e]>=ry.WARN?t.warn:rp,info:ry[e]>=ry.INFO?t.info:rp,debug:ry[e]>=ry.DEBUG?t.debug:rp}))({level:e.logger?.level??e.logLevel??"ERROR",logger:e.logger??console}),this._storage=e.storage,this._crypto=e.crypto,this._analyticsId=null,this._getOrGenerateClientAnalyticsId(),this.baseUrl=e.baseUrl??"https://auth.privy.io",this.appId=e.appId,this.appClientId=e.appClientId,this._sdkVersion=e.sdkVersion??this._sdkVersion,this.callbacks=e.callbacks,this.nativeAppIdentifier=e.nativeAppIdentifier,this.isMultiUserModeEnabled=e.isMultiUserModeEnabled,this.session=new rf({storage:this._storage,isUsingServerCookies:!1,appId:e.appId,setStoredUsers:e.callbacks?.setStoredUsers}),this._fetch=b(globalThis.fetch,{retries:3,retryDelay:e=>3**e*500,retryOn:[408,409,425,500,502,503,504]}),this.session.on("error_storing_tokens",e=>{this.createAnalyticsEvent("error_updating_tokens_in_storage",{reason:e})})}setCallbacks(e){this.callbacks={...this.callbacks,...e},this.session.setStoredUsersCallback(this.callbacks?.setStoredUsers)}get isReady(){return!!this._config}get config(){return this._config}get caid(){return this._analyticsId}async _initialize(){if(this.isReady)return void this.callbacks?.setIsReady?.(!0);if(!await this.isStorageAccessible())throw new tA({code:"storage_error",error:"Unable to access storage"});this._config=await this.getAppConfig(),this._config?.custom_api_url&&(this.baseUrl=this._config.custom_api_url,this.session.isUsingServerCookies=!0),this.isMultiUserModeEnabled&&await this.session.backfillLegacySession(),this.callbacks?.setIsReady?.(!0),this._sdkVersion.startsWith("react-auth:")||this.createAnalyticsEvent("sdk_initialize",{})}getPath(e,{params:t,query:r}){return`${this.baseUrl}${(0,n.GN)(e.path,t)}${function(e){let t=new URLSearchParams;for(let r in e)null!=e[r]&&t.append(r,String(e[r]));return Array.from(t).length?"?"+t.toString():""}(r)}`}async fetchWithoutAuthentication(e,t){if(!this.isMultiUserModeEnabled)throw new tA({code:"invalid_input",error:'Unauthenticated requests require sessions.mode to be set to "multi-user"'});return this.fetch(e,{...t,onRequest:this._beforeRequestWithoutAuth.bind(this)})}async fetchForLogin(e,t){return this.isMultiUserModeEnabled?this.fetchWithoutAuthentication(e,t):this.fetch(e,t)}async fetch(e,{body:t,params:r,query:n,headers:i,onRequest:s=this._beforeRequest.bind(this)}){let a=new Request(this.getPath(e,{params:r,query:n}),{method:e.method,body:JSON.stringify(t),headers:i}),o=await s(a),l=await this._fetch(a,o),c=await l.json();if(l.status>299)throw new tE({...c,status:l.status});return c}async _beforeRequestWithoutInitialize(e){let t=await this.session.getPrivyAccessToken()??await this.session.getCustomerAccessToken(),r=new Headers(e.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-client",this._sdkVersion),t&&r.set("Authorization",`Bearer ${t}`),r.set("Content-Type","application/json"),r.set("Accept","application/json");let n=await this._getOrGenerateClientAnalyticsId();return n&&r.set("privy-ca-id",n),this.nativeAppIdentifier&&r.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:rh(2e4),headers:r,credentials:"include"}}async beforeRequestWithoutRefresh(e){return await this._initialize(),this._beforeRequestWithoutInitialize(e)}async _beforeRequestWithoutAuth(e){await this._initialize();let t=new Headers(e.headers);t.set("privy-app-id",this.appId),this.appClientId&&t.set("privy-client-id",this.appClientId),t.set("privy-client",this._sdkVersion),t.set("Content-Type","application/json"),t.set("Accept","application/json");let r=await this._getOrGenerateClientAnalyticsId();return r&&t.set("privy-ca-id",r),this.nativeAppIdentifier&&t.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:rh(2e4),headers:t}}async _beforeRequest(e){return await this._initialize(),await this.getAccessTokenInternal(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(n.oO,{params:{app_id:this.appId},onRequest:this._beforeRequestWithoutInitialize.bind(this)})}async _getOrGenerateClientAnalyticsId(){if(this._analyticsId)return this._analyticsId;try{let e=await this._storage.get(rm);if("string"==typeof e&&e.length>0)return this._analyticsId=e,e}catch(e){this.logger.error("Unable to load clientId",e)}try{this._analyticsId=this._crypto.randomUUID()}catch(e){this.logger.error("Unable to generate uuidv4",e)}if(this._analyticsId){try{await this._storage.put(rm,this._analyticsId)}catch(e){this.logger.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}}async destroyClientAnalyticsId(){try{return await this._storage.del(rm)}catch(e){this.logger.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,t){try{await this.fetch(n.XN,{body:{event_name:e,client_id:await this._getOrGenerateClientAnalyticsId(),payload:t},onRequest:this.beforeRequestWithoutRefresh.bind(this)})}catch{}}async refreshSession(e=!1){if(!await this.isStorageAccessible())throw new tA({code:"storage_error",error:"Unable to access storage"});let t=await this.session.getRefreshToken()??void 0,r=t??"key",n=this._cache.get(r);if(n)return this.logger.debug("[privy:refresh] found in-flight session refresh request, deduping"),await n;let i=this._refreshSession(t,e);this._cache.set(r,i);try{return await i}finally{this._cache.delete(r)}}async _refreshSession(e,t){let r=await this.session.getCustomerAccessToken();if(!await this.session.hasRefreshCredentials(r,e??null))throw this.logger.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new tE({code:w.si.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage",status:401});try{this.logger.debug(`[privy:refresh] fetching: ${n.aW.path}`);let r=await this.fetch(n.aW,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),i=r.session_update_action;return this.logger.debug(`[privy:refresh] response: ${i}`),"set"===i&&(await this.session.updateWithTokensResponse(r),this.logger.debug("[privy:refresh] tokens stored")),"clear"===i&&(await this.session.destroyLocalState(),this.logger.debug("[privy:refresh] tokens cleared"),t||this.callbacks?.setUser?.(null)),"ignore"===i&&(r.token&&(await this.session.storeCustomerAccessToken(r.token),this.logger.debug("[privy:refresh] token stored (CAT)")),r.privy_access_token&&(await this.session.storePrivyAccessToken(r.privy_access_token),this.logger.debug("[privy:refresh] token stored (PAT)")),r.identity_token&&(this.logger.debug("[privy:refresh] token stored (IDT)"),await this.session.storeIdentityToken(r.identity_token))),this.logger.debug("[privy:refresh] returning response"),t||this.callbacks?.setUser?.(r.user),r}catch(e){throw this.logger.debug(`[privy:refresh] error: ${e.message??"unknown error"}`),e instanceof tE&&e.code===w.si.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),t||this.callbacks?.setUser?.(null)),e}}
257async getAccessToken(){let[e,t]=await Promise.all([this.session.getCustomerAccessToken(),this.session.getRefreshToken()]);if(e&&!this.session.tokenIsActive(e)&&await this.session.hasRefreshCredentials(e,t)){let t=await this.refreshSession(),r=await this.session.getCustomerAccessToken();return t.token||this.logger.debug("[privy:getAccessToken] expected token received null"),t.token===e&&this.logger.debug("[privy:getAccessToken] expected new token in response received existing"),r===e&&this.logger.debug("[privy:getAccessToken] expected new token in storage received existing"),t.token??r}return e&&!this.session.tokenIsActive(e)?(this.logger.debug("[privy:getAccessToken] unable to refresh inactive token"),this.callbacks?.setUser?.(null),await this.session.destroyLocalState(),null):e}async getAccessTokenInternal(){let e=await this.getAccessToken();return await this.session.getPrivyAccessToken()??e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${this._crypto.randomUUID()}`,t="blobby";await this._storage.put(e,t);let r=await this._storage.get(e);return await this._storage.del(e),r===t}catch(e){return this.logger.error(e),!1}}},rb=class{_privyInternal;_embedded;_isMultiUserModeEnabled;constructor(e,t,r){this._privyInternal=e,this._embedded=t,this._isMultiUserModeEnabled=r}async get(){let{user:e}=await this._privyInternal.refreshSession();return{user:e}}async acceptTerms(){return{user:await this._privyInternal.fetch(n.C5,{})}}async switchActiveUser(e){if(!this._isMultiUserModeEnabled)throw new tA({code:"invalid_input",error:'User switching requires sessions.mode to be set to "multi-user"'});await this._privyInternal.session.switchActiveUserId(e.userId);try{this._embedded.reload();let{user:t}=await this._privyInternal.refreshSession(!0);if(t.id!==e.userId)throw new tA({code:"invalid_input",error:"Cannot switch active user because the refreshed user did not match the requested user ID"});return this._privyInternal.callbacks?.setUser?.(t),{user:t}}catch(e){throw await this._privyInternal.session.destroyLocalState(),this._privyInternal.callbacks?.setUser?.(null),e}}};let rw=e=>"wallet"===e.type&&"privy"===e.wallet_client_type&&"embedded"===e.connector_type,rv=e=>e?e.linked_accounts.filter(rw).filter(e=>"ethereum"===e.chain_type).sort((e,t)=>e.wallet_index-t.wallet_index):[],rx=e=>rv(e).find(e=>0===e.wallet_index)??null,r_=e=>e?e.linked_accounts.filter(rw).filter(e=>"solana"===e.chain_type).sort((e,t)=>e.wallet_index-t.wallet_index):[],rE=e=>r_(e).find(e=>0===e.wallet_index)??null,rA=(e,t)=>({...e,is_new_user:t.is_new_user,oauth_tokens:t.oauth_tokens}),rI=async(e,t,r)=>{let n=((e,t)=>"off"!==t&&!(rv(e).length>0)&&(!(e.linked_accounts.filter(e=>"wallet"===e.type&&"ethereum"===e.chain_type).length>0)||"all-users"===t))(t.user,r?.ethereum?.createOnLogin??"off"),i=((e,t)=>"off"!==t&&!(r_(e).length>0)&&(!(e.linked_accounts.filter(e=>"wallet"===e.type&&"solana"===e.chain_type).length>0)||"all-users"===t))(t.user,r?.solana?.createOnLogin??"off");if(n&&i){let r=await e.create({recoveryMethod:"privy",skipCallbacks:!0});return rA(await e.createSolana({ethereumAccount:rx(r.user)??void 0}),t)}return n?rA(await e.create({recoveryMethod:"privy",solanaAccount:rE(t.user)??void 0}),t):i?rA(await e.createSolana({ethereumAccount:rx(t.user)??void 0}),t):t};var rC=class{_privyInternal;_embedded;constructor(e,t){this._privyInternal=e,this._embedded=t}async syncWithToken(e,t,r){let i=await this._privyInternal.fetchForLogin(n.kC,{body:{token:e,mode:r}});await this._privyInternal.session.updateWithTokensResponse(i);let s=await rI(this._embedded,i,t?.embedded);return this._privyInternal.callbacks?.setUser?.(s.user),s}async linkWithToken(e){await this._privyInternal.fetch(n.Jj,{body:{token:e}});let t=await this._privyInternal.refreshSession();return{user:t.user,identity_token:t.identity_token}}},rS=class{_privyInternal;_embedded;constructor(e,t){this._privyInternal=e,this._embedded=t}async sendCode(e,t){return this._privyInternal.fetch(n.$u,{body:{email:e,token:t}})}
257async loginWithCode(e,t,r,i){let s=await this._privyInternal.fetchForLogin(n.KI,{body:{email:e,code:t,mode:r}});await this._privyInternal.session.updateWithTokensResponse(s);let a=await rI(this._embedded,s,i?.embedded);return this._privyInternal.callbacks?.setUser?.(a.user),a}async linkWithCode(e,t){await this._privyInternal.fetch(n.BE,{body:{email:e,code:t}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}async updateEmail({oldEmailAddress:e,newEmailAddress:t,code:r}){await this._privyInternal.fetch(n.m_,{body:{oldAddress:e,newAddress:t,code:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async unlink(e){await this._privyInternal.fetch(n.M2,{body:{address:e}});let t=await this._privyInternal.refreshSession();return{user:t.user,identity_token:t.identity_token}}},rP=class{_privyInternal;_embedded;constructor(e,t){this._privyInternal=e,this._embedded=t}async initializeAuth({relyingParty:e,redirectUrl:t,token:r}){return await this._privyInternal.fetch(n.qU,{body:{relying_party:e,redirect_url:t,token:r}})}async getFarcasterStatus({channel_token:e}){return await this._privyInternal.fetch(n.Iz,{headers:{"farcaster-channel-token":e}})}async authenticate({channel_token:e,message:t,signature:r,fid:i,mode:s},a){let o=await this._privyInternal.fetchForLogin(n.Rb,{body:{channel_token:e,message:t,signature:r,fid:i,mode:s}});await this._privyInternal.session.updateWithTokensResponse(o);let l=await rI(this._embedded,o,a?.embedded);return this._privyInternal.callbacks?.setUser?.(l.user),l}async link({channel_token:e,message:t,signature:r,fid:i}){await this._privyInternal.fetch(n.uH,{body:{channel_token:e,message:t,signature:r,fid:i}});let s=await this._privyInternal.refreshSession();return{user:s.user,identity_token:s.identity_token}}async unlink({fid:e}){await this._privyInternal.fetch(n.DD,{body:{fid:e}});let t=await this._privyInternal.refreshSession();return{user:t.user,identity_token:t.identity_token}}},r$=class{_privyInternal;_embedded;constructor(e,t){this._privyInternal=e,this._embedded=t}async initializeAuth(){return await this._privyInternal.fetch(n.MT,{body:{}})}async authenticate({message:e,signature:t,fid:r},i){let s=await this._privyInternal.fetchForLogin(n.nU,{body:{message:e,signature:t,fid:r}});await this._privyInternal.session.updateWithTokensResponse(s);let a=await rI(this._embedded,s,i?.embedded);return this._privyInternal.callbacks?.setUser?.(a.user),a}},rk=class{_privyInternal;_embedded;constructor(e,t){this._privyInternal=e,this._embedded=t}async create(e){let t=await this._privyInternal.session.getOrCreateGuestCredential(),r=await this._privyInternal.fetch(n.A6,{body:{guest_credential:t}});await this._privyInternal.session.updateWithTokensResponse(r);let i=await rI(this._embedded,r,e?.embedded);return this._privyInternal.callbacks?.setUser?.(i.user),i}};let rT="privy:state_code",rO="privy:code_verifier";async function rN(e,t){return new Uint8Array(await t("SHA-256",new TextEncoder().encode(e)))}function rR(){return s.l(crypto.getRandomValues(new Uint8Array(36)))}async function rB({codeVerifier:e,method:t="S256",digest:r}){if("S256"!=t)return e;{let t=await rN(e,r);return s.l(t)}}var rD=class{_privyInternal;_storage;_crypto;_embedded;constructor(e,t,r,n){this._privyInternal=e,this._embedded=t,this._storage=r,this._crypto=n}async generateURL(e,t){let r=rR(),i=rR(),s=await rB({codeVerifier:r,digest:this._crypto.digest});return await Promise.all([this._storage.put(rO,r),this._storage.put(rT,i)]),this._privyInternal.fetchForLogin(n.A0,{body:{redirect_to:t,provider:e,code_challenge:s,state_code:i}})}async loginWithCode(e,t,r,i,s,a){let[o,l]=await Promise.all([this._storage.get(rO),this._storage.get(rT)]);if(l!==t)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"oauth",provider:r,storedStateCode:l??"",returnedStateCode:t??""}),new tA({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let c=await this._privyInternal.fetchForLogin(n.$z,{body:{authorization_code:e,code_type:i,state_code:l,code_verifier:o,mode:s}});await this._privyInternal.session.updateWithTokensResponse(c);let u=await rI(this._embedded,c,a?.embedded);return await Promise.all([this._storage.del(rO),this._storage.del(rT)]),this._privyInternal.callbacks?.setUser?.(u.user),u}
257async linkWithCode(e,t,r,i){let[s,a]=await Promise.all([this._storage.get(rO),this._storage.get(rT)]);if(a!==t)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"oauth",provider:r,storedStateCode:a??"",returnedStateCode:t??""}),new tA({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let o=await this._privyInternal.fetch(n.I3,{body:{authorization_code:e,code_type:i,state_code:a,code_verifier:s}});await this._privyInternal.session.processOAuthTokens(o.oauth_tokens);let l=await this._privyInternal.refreshSession();return await Promise.all([this._storage.del(rO),this._storage.del(rT)]),{user:l.user,identity_token:l.identity_token}}async unlink(e,t){await this._privyInternal.fetch(n.XW,{body:{provider:e,subject:t}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}},rM=class{_privyInternal;_embedded;constructor(e,t){this._privyInternal=e,this._embedded=t}async generateRegistrationOptions(e){return await this._privyInternal.fetch(n.lw,{body:{relying_party:e}})}async generateAuthenticationOptions(e){return await this._privyInternal.fetch(n.qs,{body:{relying_party:e}})}async generateSignupOptions(e){return await this._privyInternal.fetch(n.gp,{body:{relying_party:e}})}async loginWithPasskey(e,t,r,i){let s=await this._privyInternal.fetchForLogin(n.e5,{body:{relying_party:r,challenge:t,authenticator_response:this._transformAuthenticationResponseToSnakeCase(e)}});await this._privyInternal.session.updateWithTokensResponse(s);let a=await rI(this._embedded,s,i?.embedded);return this._privyInternal.callbacks?.setUser?.(a.user),a}async signupWithPasskey(e,t,r){let i=await this._privyInternal.fetchForLogin(n.w0,{body:{relying_party:t,authenticator_response:this._transformRegistrationResponseToSnakeCase(e)}});await this._privyInternal.session.updateWithTokensResponse(i);let s=await rI(this._embedded,i,r?.embedded);return this._privyInternal.callbacks?.setUser?.(s.user),s}async linkWithPasskey(e,t){await this._privyInternal.fetch(n.Rj,{body:{relying_party:t,authenticator_response:this._transformRegistrationResponseToSnakeCase(e)}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}_transformRegistrationResponseToSnakeCase(e){return{type:e.type,id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData||void 0,transports:e.response.transports||void 0,public_key:e.response.publicKey||void 0,public_key_algorithm:e.response.publicKeyAlgorithm||void 0},authenticator_attachment:e.authenticatorAttachment||void 0,client_extension_results:{app_id:e.clientExtensionResults.appid||void 0,cred_props:e.clientExtensionResults.credProps||void 0,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret||void 0}}}_transformAuthenticationResponseToSnakeCase(e){return{type:e.type,id:e.id,raw_id:e.rawId,response:{signature:e.response.signature,client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,user_handle:e.response.userHandle||void 0},authenticator_attachment:e.authenticatorAttachment||void 0,client_extension_results:{app_id:e.clientExtensionResults.appid||void 0,cred_props:e.clientExtensionResults.credProps||void 0,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret||void 0}}}},rU=class{_privyInternal;_embedded;constructor(e,t){this._privyInternal=e,this._embedded=t}async sendCode(e,t){return this._privyInternal.fetch(n.aw,{body:{phoneNumber:e,token:t}})}async loginWithCode(e,t,r,i){let s=await this._privyInternal.fetchForLogin(n.lb,{body:{phoneNumber:e,code:t,mode:r}});await this._privyInternal.session.updateWithTokensResponse(s);let a=await rI(this._embedded,s,i?.embedded);return this._privyInternal.callbacks?.setUser?.(a.user),a}async linkWithCode(e,t){await this._privyInternal.fetch(n.WN,{body:{phoneNumber:e,code:t}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}async updatePhone({oldPhoneNumber:e,newPhoneNumber:t,code:r}){await this._privyInternal.fetch(n.j2,{body:{old_phone_number:e,new_phone_number:t,code:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async unlink(e){await this._privyInternal.fetch(n.Hh,{body:{phoneNumber:e}});let t=await this._privyInternal.refreshSession();return{user:t.user,identity_token:t.identity_token}}},rj=class{_privyInternal;_embedded;_wallet=void 0;_preparedMessage;constructor(e,t){this._privyInternal=e,this._embedded=t}async unlinkWallet(e){await this._privyInternal.fetch(n.wG,{body:{address:e}});let t=await this._privyInternal.refreshSession();return{user:t.user,identity_token:t.identity_token}}async linkWithSiwe(e,t,r){let i=t||this._wallet,s=r||this._preparedMessage;if(!i)throw Error("A wallet must be provided in the init step or as an argument to linkWithSiwe");if(!s)throw Error("A message must be generated and signed before being used to link a wallet to privy");await this._privyInternal.fetch(n.FI,{body:{message:s,signature:e,chainId:i.chainId,walletClientType:i.walletClientType??null,connectorType:i.connectorType??null}});let a=await this._privyInternal.refreshSession();return{user:a.user,identity_token:a.identity_token}}async loginWithSiwe(e,t,r,i,s){let a=t||this._wallet,o=r||this._preparedMessage;if(!a)throw Error("A wallet must be provided in the init step or as an argument to loginWithSiwe");if(!o)throw Error("A message must be generated and signed before being used to login to privy with a wallet");let l=await this._privyInternal.fetchForLogin(n.OA,{body:{signature:e,message:o,chainId:a.chainId,walletClientType:a.walletClientType??null,connectorType:a.connectorType??null,mode:i}});await this._privyInternal.session.updateWithTokensResponse(l);let c=await rI(this._embedded,l,s?.embedded);return this._privyInternal.callbacks?.setUser?.(c.user),c}async init(e,t,r){var i;this._wallet=e;let{nonce:s}=await this._privyInternal.fetch(n.hZ,{body:{address:e.address}}),a=(i={chainId:e.chainId.toString().replace("eip155:",""),address:e.address,issuedAt:new Date().toISOString(),statement:"By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",domain:t,nonce:s,uri:r},`${i.domain} wants you to sign in with your Ethereum account:
258${i.address}
259
260${i.statement}
261
262URI: ${i.uri}
263Version: 1
264Chain ID: ${i.chainId}
265Nonce: ${i.nonce}
266Issued At: ${i.issuedAt}
267Resources:
268- https://privy.io`);return this._preparedMessage=a,{nonce:s,message:a}}},rL=class{_privyInternal;_embedded;constructor(e,t){this._privyInternal=e,this._embedded=t}async unlink({address:e}){await this._privyInternal.fetch(n.ED,{body:{address:e}});let t=await this._privyInternal.refreshSession();return{user:t.user,identity_token:t.identity_token}}async link({message:e,signature:t,walletClientType:r,connectorType:i}){await this._privyInternal.fetch(n.zs,{body:{message:e,signature:t,walletClientType:r??null,connectorType:i??null}});let s=await this._privyInternal.refreshSession();return{user:s.user,identity_token:s.identity_token}}async login({mode:e,message:t,signature:r,walletClientType:i,connectorType:s,opts:a}){let o=await this._privyInternal.fetchForLogin(n.W5,{body:{signature:r,message:t,walletClientType:i??null,connectorType:s??null,mode:e}});await this._privyInternal.session.updateWithTokensResponse(o);let l=await rI(this._embedded,o,a?.embedded);return this._privyInternal.callbacks?.setUser?.(l.user),l}async fetchNonce({address:e}){let{nonce:t}=await this._privyInternal.fetch(n.bz,{body:{address:e}});return{nonce:t}}},rF=class{_privyInternal;constructor(e){this._privyInternal=e}async link(e,t,r,i){await this._privyInternal.fetch(n.PE,{body:{message:e,signature:t,smart_wallet_type:r,smart_wallet_version:i}});let s=await this._privyInternal.refreshSession();return{user:s.user,identity_token:s.identity_token}}async init(e){var t;let{nonce:r}=await this._privyInternal.fetch(n.hZ,{body:{address:e.address}});return{nonce:r,message:(t={chainId:e.chainId.toString().replace("eip155:",""),address:e.address,issuedAt:new Date().toISOString(),statement:"By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",domain:"privy.io",uri:"https://auth.privy.io",nonce:r},`${t.domain} wants you to sign in with your Ethereum account:
269${t.address}
270
271${t.statement}
272
273URI: ${t.uri}
274Version: 1
275Chain ID: ${t.chainId}
276Nonce: ${t.nonce}
277Issued At: ${t.issuedAt}
278Resources:
279- https://privy.io`)}}},rz=class{_privyInternal;_mfa;customProvider;phone;email;oauth;siwe;siws;smartWallet;passkey;farcaster;farcasterV2;guest;constructor(e,t,r,n,i){this._privyInternal=e,this._mfa=i,this.customProvider=new rC(this._privyInternal,t),this.phone=new rU(this._privyInternal,t),this.email=new rS(this._privyInternal,t),this.oauth=new rD(this._privyInternal,t,r,n),this.guest=new rk(this._privyInternal,t),this.siwe=new rj(this._privyInternal,t),this.siws=new rL(this._privyInternal,t),this.smartWallet=new rF(this._privyInternal),this.passkey=new rM(this._privyInternal,t),this.farcaster=new rP(this._privyInternal,t),this.farcasterV2=new r$(this._privyInternal,t)}async logout(e){try{let e=await this._privyInternal.session.getRefreshToken()??void 0;await this._privyInternal.fetch(n.fQ,{body:{refresh_token:e}})}catch{console.warn("Error destroying session")}await Promise.all([this._privyInternal.session.destroyLocalState({reason:"logout"}),this._privyInternal.destroyClientAnalyticsId(),e?.userId&&this._mfa.clearMfa({userId:e.userId})]),this._privyInternal.callbacks?.setUser?.(null)}},rq=class{_privyInternal;constructor(e){this._privyInternal=e}async initOnRampSession(e){return await this._privyInternal.fetch(n.mb,{body:e})}async getStatus(e){return await this._privyInternal.fetch(n.AG,{query:{partnerUserId:e}})}};let rW={prod:{url:"https://api.moonpay.com/v1",key:"pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL"},sandbox:{url:"https://api.moonpay.com/v1",key:"pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI"}},rH=new Set([a.rC.id,a.D8.id,a.E3.id,a.n1.id,a.mZ.id,a.AF.id,a.cl.id]),rK=new Set([a.rC.id,a.D8.id,a.Rr.id,a.E3.id,a.n1.id,a.mZ.id]);function rV(e,t){switch(t){case"native-currency":return rH.has(e);case"USDC":return rK.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}}function rG(e,t){switch(e){case a.D8.id:return"native-currency"===t?"ETH_ARBITRUM":"USDC_ARBITRUM";case a.mZ.id:return"native-currency"===t?"AVAX_CCHAIN":"USDC_CCHAIN";case a.E3.id:return"native-currency"===t?"ETH_BASE":"USDC_BASE";case a.AF.id:return"CELO_CELO";case a.n1.id:return"native-currency"===t?"MATIC_POLYGON":"USDC_POLYGON";case a.cl.id:return"MON_MON";case a.rC.id:return"native-currency"===t?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}var rJ=class{_privyInternal;constructor(e){this._privyInternal=e}async sign(e){return await this._privyInternal.fetch(n.ij,{body:e})}async getTransactionStatus({transactionId:e,useSandbox:t}){let{url:r,key:n}=rW[t?"sandbox":"prod"],i=await b(fetch,{retries:3,retryDelay:500})(`${r}/transactions/ext/${e}?apiKey=${n}`);if(!i.ok)throw new tI({error:`Failed to fetch transaction status for Transaction ${e}`,code:"failed_to_fetch_moonpay_transaction_status",response:i});let s=await i.json();return Array.isArray(s)?s.at(0):void 0}},rY=class{moonpay;coinbase;constructor(e){this.moonpay=new rJ(e),this.coinbase=new rq(e)}},rZ=class{_privyInternal;constructor(e){this._privyInternal=e}async generateAuthenticationOptions(e){return await this._privyInternal.fetch(n.XH,{body:e})}},rQ=class{_privyInternal;constructor(e){this._privyInternal=e}async sendCode(e){return await this._privyInternal.fetch(n.WW,{body:e})}},rX=class{privyInternal;proxy;sms;passkey;constructor(e,t){this.proxy=t,this.privyInternal=e,this.sms=new rQ(e),this.passkey=new rZ(e)}setProxy(e){this.proxy=e}async getAccessTokenInternal(){let e=await this.privyInternal.getAccessTokenInternal();if(!e)throw new tA({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});return e}async verifyMfa(){if(!this.proxy)throw new tA({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.verifyMfa({accessToken:await this.getAccessTokenInternal()})}async initEnrollMfa(e){if(!this.proxy)throw new tA({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.initEnrollMfa({...e,accessToken:await this.getAccessTokenInternal()})}async submitEnrollMfa(e){if(!this.proxy)throw new tA({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});let t=await this.proxy.submitEnrollMfa({...e,accessToken:await this.getAccessTokenInternal()}),r=await this.privyInternal.refreshSession();if(0===r.user.mfa_methods.length)try{await this.proxy.clearMfa({userId:r.user.id})}catch{}return t}async unenrollMfa(e){if(!this.proxy)throw new tA({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});let t=await this.proxy.unenrollMfa({method:e,accessToken:await this.getAccessTokenInternal()}),r=await this.privyInternal.refreshSession();if(0===r.user.mfa_methods.length)try{await this.proxy.clearMfa({userId:r.user.id})}catch{}return t}async unlinkPasskey({credentialId:e,removeAsMfa:t}){if(!this.proxy)throw new tA({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});await this.proxy.unlinkPasskey({credentialId:e,removeAsMfa:t,accessToken:await this.getAccessTokenInternal()});let r=await this.privyInternal.refreshSession();if(0===r.user.mfa_methods.length)try{await this.proxy.clearMfa({userId:r.user.id})}catch{}}async clearMfa(e){if(!this.proxy)throw new tA({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.clearMfa(e)}},r0=class{_privyInternal;constructor(e){this._privyInternal=e}async init(e){return this._privyInternal.fetch(n.jC,{body:{client_type:e}})}async getICloudConfiguration(e){return this._privyInternal.fetch(n.mK,{body:{client_type:e}})}},r1=class{_privyInternal;_storage;_crypto;constructor(e,t,r){this._privyInternal=e,this._storage=t,this._crypto=r}async generateURL(e){let t=rR(),r=rR(),i=await rB({codeVerifier:t,digest:this._crypto.digest});return await Promise.all([this._storage.put(rO,t),this._storage.put(rT,r)]),this._privyInternal.fetch(n.$U,{body:{redirect_to:e,code_challenge:i,state_code:r}})}async authorize(e,t){let[r,i]=await Promise.all([this._storage.get(rO),this._storage.get(rT)]);if(i!==t)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"recovery_oauth",storedStateCode:i??"",returnedStateCode:t??""}),new tA({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let s=await this._privyInternal.fetch(n.Id,{body:{authorization_code:e,state_code:i,code_verifier:r}});return await Promise.all([this._storage.del(rO),this._storage.del(rT)]),s}},r2=class{_privyInternal;auth;icloudAuth;constructor(e,t,r){this._privyInternal=e,this.auth=new r1(this._privyInternal,t,r),this.icloudAuth=new r0(this._privyInternal)}async getRecoveryKeyMaterial(e,t){return this._privyInternal.fetch(n.Kw,{body:{chain_type:t},params:{address:e}})}},r5=class{auth;user;embeddedWallet;recovery;mfa;app;mfaPromises;funding;delegated;crossApp;isMultiUserModeEnabled;_privyInternal;constructor({clientId:e,sessions:t,...r}){let n=function(e){return{digest:e?.digest??((e,t)=>globalThis.crypto.subtle.digest(e,t)),randomUUID:e?.randomUUID??(()=>globalThis.crypto.randomUUID())}}(r.crypto);this.isMultiUserModeEnabled=t?.mode==="multi-user",this._privyInternal=new rg({...r,appClientId:e,crypto:n,isMultiUserModeEnabled:this.isMultiUserModeEnabled}
279),this.mfa=new rX(this._privyInternal),this.mfaPromises=new t7,this.app=new tw(this._privyInternal),this.embeddedWallet=new t9(this._privyInternal,r.embeddedWalletMessagePoster,r.supportedChains,this.mfa,this.mfaPromises,this.app),this.user=new rb(this._privyInternal,this.embeddedWallet,t?.mode==="multi-user"),this.auth=new rz(this._privyInternal,this.embeddedWallet,r.storage,n,this.mfa),this.recovery=new r2(this._privyInternal,r.storage,n),this.funding=new rY(this._privyInternal),this.delegated=new t_(this._privyInternal),this.crossApp=new tx(this._privyInternal,r.storage)}async initialize(){await this._privyInternal._initialize()}setMessagePoster(e){this.embeddedWallet.setMessagePoster(e)}addOAuthTokensListener(e){return this._privyInternal.session.on("oauth_tokens_granted",e),{unsubscribe:()=>{this._privyInternal.session.removeListener("oauth_tokens_granted",e)}}}setCallbacks(e){this._privyInternal.setCallbacks(e)}getAccessToken(){return this._privyInternal.getAccessToken()}getIdentityToken(){return this._privyInternal.getIdentityToken()}getCompiledPath(e,t){return this._privyInternal.getPath(e,t)}async fetchPrivyRoute(e,t){return this._privyInternal.fetch(e,t)}get logger(){return this._privyInternal.logger}};let r6=(e,t)=>(function(){return(0,_.A)(eL,arguments)})(String(e),t),r3=(e,t)=>`+${(0,eF.K)(t)} ${e}`,r8=e=>`*${e.replaceAll("-","").slice(-4)}`,r4=e=>new th(e),r9=(function(){return(0,_.A)(tp,arguments)})().map(e=>({code:e,callCode:(0,eF.K)(e)})),r7=e=>{let t=(function(){return(0,_.A)(ty,arguments)})(e,x)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},ne=e=>{let t=new th;t.input(e);let r=t.getCountry()||"US",n=t.getCallingCode()||"1";return{countryCode:r,phone:e.replace("+"+n,"")}},nt=(e,t=!0)=>e.reduce((e,r)=>({...e,[r]:t}),{}),nr={[a.rC.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[a.Gb.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[a.Rr.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[a.i_.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[a.n1.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[a.nM.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[a.E3.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[a.ZW.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[a.mZ.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[a.Cj.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[a.D8.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[a.Yn.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"};async function nn(e,t){let r=`${e}-auto-${"ethereum"===t?"eth":"sol"}`,n=new TextEncoder().encode(r);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",n))).map(e=>e.toString(16).padStart(2,"0")).join("")}let ni=new Set([a.rC.id,a.E3.id,a.Rr.id,a.n1.id,a.D8.id,a.mZ.id,a.cl.id]),ns=new Set([a.rC.id,a.E3.id,a.n1.id,a.Rr.id,a.D8.id,a.mZ.id,a.cl.id]),na={buy:"CARD",send:"CRYPTO_ACCOUNT"},no={USDC:"2b92315d-eab7-5bef-84fa-089a131333f5",ETH:"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",BTC:"5b71fc48-3dd3-540c-809b-f8c94d0e68b5",SOL:"4f039497-3af8-5bb3-951c-6df9afa9be1c",POL:"026bcc1e-9163-591c-a709-34dd18b2e7a1",MON:"92aa538f-b005-45cc-a237-71d6466f54d9"};function nl({appId:e,input:t,amount:r,blockchain:n,asset:i,experience:s}){let a=new URL("https://pay.coinbase.com/buy/select-asset");return a.searchParams.set("appId",t.app_id),a.searchParams.set("sessionToken",t.session_token),a.searchParams.set("endPartnerName",`privy:${e}`),a.searchParams.set("defaultExperience",s),a.searchParams.set("presetCryptoAmount",r.startsWith(".")?`0${r}`:r),a.searchParams.set("defaultNetwork",n),a.searchParams.set("defaultPaymentMethod",na[s]),a.searchParams.set("defaultAsset",no[i]),a.searchParams.set("partnerUserId",t.partner_user_id),{url:a}}a.rC.id,a.E3.id,a.Rr.id,a.n1.id,a.D8.id,a.mZ.id,a.cl.id;let nc=(e,t)=>{switch(t){case"native-currency":return ni.has(e);case"USDC":return ns.has(e);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}};function nu(e,t){return"USDC"===t?"USDC":e===a.n1.id?"POL":e===a.cl.id?"MON":"ETH"}function nd({message:e,signerPublicKey:t,domain:r}){let n,i,s=y.O.utf8.toBytes(e);if(32!==t.length)throw Error("Signer public key must be 32 bytes");let a=85+s.length;if(a>1232)throw Error(`Combined message length (${a}) exceeds maximum (1232)`);let o=(n=y.O.utf8.toBytes(r),(i=new Uint8Array(32)).set(n.slice(0,32)),i),l=new Uint8Array(a),c=0;l[0]=255,c+=1;let u=y.O.utf8.toBytes("solana offchain");return l.set(u,c),l[c+=u.length]=0,c+=1,l.set(o,c),l[c+=32]=1,l[c+=1]=1,c+=1,l.set(t,c),l[c+=32]=255&s.length,l[c+1]=s.length>>8&255,c+=2,l.set(s,c),l}function nf(e){return e?`${e.slice(0,5)}…${e.slice(-4)}`:""}function nh({wei:e,precision:t=3}){return parseFloat((0,d.c)(e)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"")}function np({amount:e,decimals:t}){return(0,f.J)(BigInt(e),t)}[..."metamask.trust.safe.rainbow.uniswap.zerion.argent.spot.omni.cryptocom.blockchain.safepal.bitget_wallet.zengo.1inch.binance.exodus.mew_wallet.alphawallet.keyring_pro.mathwallet.unstoppable.obvious.ambire.internet_money_wallet.coin98.abc_wallet.arculus_wallet.haha.cling_wallet.broearn.copiosa.burrito_wallet.enjin_wallet.plasma_wallet.avacus.bee.pitaka.pltwallet.minerva.kryptogo.prema.slingshot.kriptonio.timeless.secux.bitizen.blocto.safemoon".split(".")];let ny=e=>[...rv(e),...r_(e)],nm=e=>async({address:t,chainType:r})=>{let{user:n}=await e.user.get();if(!n)throw new tA({code:"delegated_actions_before_logged_in",error:"Must be logged in to delegate wallets"});if("solana"!==r&&"ethereum"!==r)throw new tA({code:"unsupported_chain_type",error:"Only Solana and Ethereum embedded wallets are supported for delegation and revocation."});let i=ny(n).find(e=>e.chain_type===r&&e.address===t);if(!i)throw new tA({code:"delegated_actions_wallet_not_found",error:"Address to delegate is not associated with current user."});if(tC(i))throw new tA({code:"unsupported_wallet_type",error:"useDelegatedActions is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to provision server side access on behalf of your users. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide"});if(i.delegated)return{user:n};let s=((e,t)=>e.imported?e:rx(t)??rE(t))(i,n);if(!s)throw new tA({code:"delegated_actions_wallet_not_found",error:"Address to delegate is not associated with current user."});await e.embeddedWallet.delegateWallets({rootWallet:{address:s.address,chainType:s.chain_type,imported:s.imported},delegatedWallets:[{address:i.address,chainType:i.chain_type,walletIndex:i.wallet_index}]});let{user:a}=await e.user.get();return{user:a}},ng=e=>async()=>{let{user:t}=await e.user.get();if(!t)throw new tA({code:"delegated_actions_before_logged_in",error:"Must be logged in to revoke delegated 
279wallets"});let r=ny(t);if(r.some(tC))throw new tA({code:"unsupported_wallet_type",error:"revokeWallets is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to manage server side access on behalf of your users. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide"});if(r.every(e=>!e.delegated))throw new tA({code:"delegated_actions_no_wallet_to_revoke",error:"User has no delegated wallets to revoke."});await e.delegated.revoke();let{user:n}=await e.user.get();return{user:n}};tb({delegateWallet:()=>nm,revokeWallets:()=>ng});let nb=({client:e,openAuthSession:t})=>async({providerAppId:r,redirectUrl:n})=>{let i=`privy:${r}`,{url:s}=await e.auth.oauth.generateURL(i,n),a=await t(s,n),o=a.privy_oauth_state,l=a.privy_oauth_code;if(!o||!l)throw new tA({code:"login_with_oauth_returned_with_invalid_credentials",error:"Auth session oauth returned invalid credentials"});let c=await e.auth.oauth.loginWithCode(l,o,i),u=c.oauth_tokens;return u&&await e.crossApp.updateOnCrossAppAuthentication(r,u),c},nw=({client:e,openAuthSession:t})=>async({providerAppId:r,redirectUrl:n})=>{let i=`privy:${r}`,{url:s}=await e.auth.oauth.generateURL(i,n),a=await t(s,n),o=a.privy_oauth_state,l=a.privy_oauth_code;if(!o||!l)throw new tA({code:"login_with_oauth_returned_with_invalid_credentials",error:"Auth session oauth returned invalid credentials"});let c=e.addOAuthTokensListener(t=>{e.crossApp.updateOnCrossAppAuthentication(r,t)}),{user:u}=await e.auth.oauth.linkWithCode(l,o,i);return c.unsubscribe(),u};function nv(e,t){return e.linked_accounts.filter(e=>"cross_app"===e.type).flatMap(e=>e.smart_wallets).some(e=>e.address===t)}let nx=({client:e,openAuthSession:t})=>{let r=(({client:e,openAuthSession:t})=>{let r=nw({client:e,openAuthSession:t});return async({providerAppId:t,redirectUrl:n})=>await e.crossApp.getProviderAccessToken(t)||(await r({providerAppId:t,redirectUrl:n}),await e.crossApp.getProviderAccessToken(t))})({client:e,openAuthSession:t});return async({user:n,request:i,redirectUrl:s,address:a})=>{let o=n.linked_accounts.filter(e=>"cross_app"===e.type).find(({embedded_wallets:e,smart_wallets:t})=>[...e,...t].some(e=>e.address===a));if(!o)throw new tA({code:"cross_app_invalid_wallet",error:"Cannot operate with this wallet address"});let l=o.provider_app_id,{connections:c}=await e.crossApp.getCrossAppConnections(),u=c.find(e=>e.provider_app_id===l);if(!u)throw new tA({code:"cross_app_invalid_app",error:"Invalid connected app"});if(u.read_only)throw new tA({code:"cross_app_read_only",error:"Cannot transact against a read-only provider app"});let d=await r({providerAppId:l,redirectUrl:s});if(!d)throw new tA({code:"cross_app_request_error",error:"Wallet operations require a valid token"});let f={content:{request:{request:i}},timestamp:Date.now(),callbackUrl:s},h=new URL(`${u.provider_app_custom_api_url}/oauth/transact`);h.searchParams.set("communicationMode","redirect"),h.searchParams.set("token",d),h.searchParams.set("request",JSON.stringify(f));let{privy_cross_app_type:p,privy_cross_app_payload:y}=await t(h.href,s);if(!p||!y)throw new tA({code:"cross_app_request_error",error:"Cross app request returned an invalid result"});if("PRIVY_CROSS_APP_ACTION_ERROR"===p)throw new tA({code:"cross_app_request_error",error:y});if("PRIVY_CROSS_APP_ACTION_RESPONSE"!==p)throw new tA({code:"cross_app_request_error",error:"Cross app request returned an invalid result"});return{result:y}}};function n_(e){if(!e)throw new tA({code:"attempted_cross_app_request_before_logged_in",error:"Must be logged in to sign messages with a cross-app wallet"})}let nE=({client:e,openAuthSession:t})=>{let r=nx({client:e,openAuthSession:t});return async({user:e,address:t,message:n,redirectUrl:i})=>{n_(e);let s={method:nv(e,t)?"privy_signSmartWalletMessage":"personal_sign",params:[n,t]},{result:a}=await r({user:e,request:s,address:t,redirectUrl:i});return{signature:a}}},nA=({client:e,openAuthSession:t})=>{let r=nx({client:e,openAuthSession:t});return async({user:e,typedData:t,address:n,redirectUrl:i})=>{n_(e);let s={method:nv(e,n)?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[n,function(e){let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain??{}).map(([e,r])=>
279{if(null!=r&&"string"==typeof e&&e in t)return{name:e,type:t[e]}}).filter(e=>!!e),n={...e.types};return n.EIP712Domain=r,{...e,types:n}}(t)]},{result:a}=await r({user:e,request:s,address:n,redirectUrl:i});return{signature:a}}},nI=({client:e,openAuthSession:t})=>{let r=nx({client:e,openAuthSession:t});return async({user:e,transaction:t,address:n,redirectUrl:i})=>{n_(e);let s={method:nv(e,n)?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[t]},{result:a}=await r({user:e,request:s,address:n,redirectUrl:i});return{transactionHash:a}}};var nC=tb({sendTransaction:()=>nI,signMessage:()=>nE,signTypedData:()=>nA});function nS(e){return e.startsWith("eip155:")?"ethereum":e.startsWith("solana:")?"solana":e.startsWith("bip122:")?"bitcoin-segwit":e.startsWith("tron:")?"tron":void 0}async function nP(e){let{user:t}=await e.privy.user.get();if(!t)return{ok:!1,error:"NOT_AUTHENTICATED"};let r=function(e,t){let r=nS(e);if(!r)return;let n=t.linked_accounts.find(e=>"wallet"===e.type&&e.chain_type===r&&"address"in e&&e.address);return n&&"address"in n?n.address:void 0}(e.caip2,t);if(r)return{ok:!0,address:r};let i=nS(e.caip2);if(!i)return{ok:!1,error:"UNSUPPORTED_CHAIN"};try{let t=await e.privy.fetchPrivyRoute(n.GK,{body:{chain_type:i}});return await e.onWalletCreated?.(),{ok:!0,address:t.address}}catch{return{ok:!1,error:"REFUND_WALLET_CREATION_FAILED"}}}async function n$(e){let{user:t}=await e.privy.user.get();if(!t)throw Error("NOT_AUTHENTICATED");let r=e.refundAddress;if(!r){let t=await nP({privy:e.privy,caip2:e.sourceChain,onWalletCreated:e.onWalletCreated});if(!t.ok)throw Error(t.error);r=t.address}return await e.privy.fetchPrivyRoute(n.VC,{body:{source_chain:e.sourceChain,source_currency:e.sourceCurrency,destination_chain:e.destinationChain,destination_currency:e.destinationCurrency,destination_address:e.destinationAddress,refund_address:r,...null==e.slippageBps?{}:{slippage_bps:e.slippageBps}}})}function nk(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}tb({linkWithCrossAppAuth:()=>nw,loginWithCrossAppAuth:()=>nb,wallet:()=>nC});let nT=async({operation:e,until:t,delay:r,interval:n,attempts:i,signal:s})=>{r&&await nk(r);let a=0,o,l;for(;a<i;){if(s?.aborted)return{status:"aborted",result:o,attempts:a,error:l};a++;try{if(l=void 0,o=await e(),t(o))return{status:"success",result:o,attempts:a};a<i&&await nk(n)}catch(e){e instanceof Error&&(l=e),a<i&&await nk(n)}}return{status:"max_attempts",result:o,attempts:a,error:l}};function nO(e,t){return Math.ceil(t/e)}function nN(e){return"success"===e.status?e.result?{status:"success",order:e.result}:{status:"timeout"}:"aborted"===e.status?{status:"aborted",error:e.error}:{status:"timeout",error:e.error}}async function nR(e){return await e.privy.fetchPrivyRoute(n.rK,{params:{order_id:e.orderId}})}async function nB(e){let t=e.pollIntervalMs??2e3,r=e.timeoutMs??18e5,i=e.signal??new AbortController().signal;return nN(await nT({operation:async()=>{let t=await e.privy.fetchPrivyRoute(n.I1,{params:{deposit_address_id:e.depositAddressId},query:{after:e.quoteCreatedAt}});if(t.order)return await e.privy.fetchPrivyRoute(n.rK,{params:{order_id:t.order.id}})},until:e=>void 0!==e,delay:t,interval:t,attempts:nO(t,r),signal:i}))}async function nD(e){let t=e.pollIntervalMs??2e3,r=e.timeoutMs??18e5,i=e.signal??new AbortController().signal;return nN(await nT({operation:()=>e.privy.fetchPrivyRoute(n.rK,{params:{order_id:e.orderId}}),until:e=>"executing"!==e.status,delay:t,interval:t,attempts:nO(t,r),signal:i}))}var nM=tb({generateDepositAddress:()=>n$,getConfig:()=>nU,getDeposit:()=>nR,resolveRefundAddress:()=>nP,waitForCompletion:()=>nD,waitForDeposit:()=>nB});async function nU(e){let t=await e.fetchPrivyRoute(n.bt,{});return{currencies:t.currencies,chains:t.chains}}var nj=class{#e;#t;get standardWallet(){return this.#e}get address(){return this.#t.address}constructor({wallet:e,account:t}){this.#e=e,this.#t=t}async disconnect(){if(!this.#e.features["standard:disconnect"]?.disconnect)throw Error("Wallet does not support disconnect");await this.#e.features["standard:disconnect"].disconnect()}async signMessage(...e){if(!this.#e.features["solana:signMessage"]?.signMessage)throw Error("Wallet does not support signMessage");let t=await this.#e.features["solana:signMessage"].signMessage(...e.map(e=>({...e,account:this.#t})));return 1===e.length?t[0]:[...t]}async signTransaction(...e){if(!this.#e.features["solana:signTransaction"]?.signTransaction)throw Error("Wallet does not support signTransaction");let t=await this.#e.features["solana:signTransaction"].signTransaction(...e.map(e=>({...e,account:this.#t})));return 1===e.length?t[0]:[...t]}async signAndSendTransaction(...e){if(!this.#e.features["solana:signAndSendTransaction"]?.signAndSendTransaction)throw Error("Wallet does not support signAndSendTransaction");let t=await this.#e.features["solana:signAndSendTransaction"].signAndSendTransaction(...e.map(e=>({...e,account:this.#t})));return 1===e.length?t[0]:[...t]}async signAndSendAllTransactions(e){if(!this.#e.features["solana:signAndSendTransaction"]?.signAndSendTransaction)throw Error("Wallet does not support signAndSendTransaction");return[...await this.#e.features["solana:signAndSendTransaction"].signAndSendTransaction(...e.map(e=>({...e,account:this.#t})))]}},nL=r5},65636:(e,t,r)=>{"use strict";r.d(t,{H2:()=>a,Ty:()=>i,u:()=>o,xO:()=>s});var n=r(15520);class i extends n.C{constructor({max:e,min:t,signed:r,size:n,value:i}
279){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class s extends n.C{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class a extends n.C{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}n.C,n.C,n.C,n.C;class o extends n.C{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}},65701:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},66049:(e,t,r)=>{"use strict";r.d(t,{s:()=>I});var n=r(46077),i=r(9146),s=r(57551),a=r(52516);let o=BigInt(0),l=BigInt(1);function c(e,t){let r=t.negate();return e?r:t}function u(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function d(e,t){u(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),i=2**e;return{windows:r,windowSize:n,mask:(0,a.OG)(e),maxNumber:i,shiftBy:BigInt(e)}}function f(e,t,r){let{windowSize:n,mask:i,maxNumber:s,shiftBy:a}=r,o=Number(e&i),c=e>>a;o>n&&(o-=s,c+=l);let u=t*n,d=u+Math.abs(o)-1,f=0===o;return{nextN:c,offset:d,isZero:f,isNeg:o<0,isNegF:t%2!=0,offsetF:u}}let h=new WeakMap,p=new WeakMap;function y(e){return p.get(e)||1}function m(e){return(0,s.jr)(e.Fp),(0,a.Q5)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,s.LH)(e.n,e.nBitLength),...e,...{p:e.Fp.ORDER}})}function g(e){void 0!==e.lowS&&(0,a.e8)("lowS",e.lowS),void 0!==e.prehash&&(0,a.e8)("prehash",e.prehash)}class b extends Error{constructor(e=""){super(e)}}let w={Err:b,_tlv:{encode:(e,t)=>{let{Err:r}=w;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let n=t.length/2,i=(0,a.zW)(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let s=n>127?(0,a.zW)(i.length/2|128):"";return(0,a.zW)(e)+s+i+t},decode(e,t){let{Err:r}=w,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],s=0;if(128&i){let e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let a=t.subarray(n,n+e);if(a.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===a[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of a)s=s<<8|e;if(n+=e,s<128)throw new r("tlv.decode(long): not minimal encoding")}else s=i;let a=t.subarray(n,n+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+s)}}},_int:{encode(e){let{Err:t}=w;if(e<x)throw new t("integer: negative integers are not allowed");let r=(0,a.zW)(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=w;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return(0,a.Ph)(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=w,i=(0,a.qj)("signature",e),{v:s,l:o}=n.decode(48,i);if(o.length)throw new t("invalid signature: left bytes after parsing");let{v:l,l:c}=n.decode(2,s),{v:u,l:d}=n.decode(2,c);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(l),s:r.decode(u)}},hexFromSig(e){let{_tlv:t,_int:r}=w,n=t.encode(2,r.encode(e.r)),i=t.encode(2,r.encode(e.s));return t.encode(48,n+i)}};function v(e,t){return(0,a.My)((0,a.lq)(e,t))}let x=BigInt(0),_=BigInt(1),E=(BigInt(2),BigInt(3)),A=BigInt(4);function I(e,t){let r=t=>(function(e){let t=function(e){let t=m(e);return(0,a.Q5)(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:n,nByteLength:i,nBitLength:b}=t,I=r.BYTES+1,C=2*r.BYTES+1;function S(e){return(0,s.zi)(e,n)}function P(e){return(0,s.B8)(e,n)}let{ProjectivePoint:$,normPrivateKeyToScalar:k,weierstrassEquation:T,isWithinCurveOrder:O}=function(e){var t;let r=function(e){let t=m(e);(0,a.Q5)(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("invalid endo: CURVE.a must be 0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}(e),{Fp:n}=r,i=(0,s.D0)(r.n,r.nBitLength),g=r.toBytes||((e,t,r)=>{let i=t.toAffine();return(0,a.Id)(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),b=r.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function w(e){let{a:t,b:i}=r,s=n.sqr(e),a=n.mul(s,e);return n.add(n.add(a,n.mul(e,t)),i)}function v(e,t){let r=n.sqr(t),i=w(e);return n.eql(r,i)}if(!v(r.Gx,r.Gy))throw Error("bad curve params: generator point");let I=n.mul(n.pow(r.a,E),A),C=n.mul(n.sqr(r.b),BigInt(27));if(n.is0(n.add(I,C)))throw Error("bad curve params: a or b");function S(e){let t,{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:o,n:l}=r;if(n&&"bigint"!=typeof e){if((0,a.aY)(e)&&(e=(0,a.My)(e)),"string"!=typeof e||!n.includes(e.length))throw Error("invalid private key");e=e.padStart(2*i,"0")}try{t="bigint"==typeof e?e:(0,a.Ph)((0,a.qj)("private key",e,i))}catch(t){throw Error("invalid private key, expected hex or "+i+" bytes, got "+typeof e)}return o&&(t=(0,s.zi)(t,l)),(0,a.aK)("private key",t,_,l),t}function P(e){if(!(e instanceof T))throw Error("ProjectivePoint expected")}let $=(0,a.x)((e,t)=>{let{px:r,py:i,pz:s}=e;if(n.eql(s,n.ONE))return{x:r,y:i};let a=e.is0();null==t&&(t=a?n.ONE:n.inv(s));let o=n.mul(r,t),l=n.mul(i,t),c=n.mul(s,t);if(a)return{x:n.ZERO,y:n.ZERO};
vendor: 4,137 bytes, line 279
279if(!n.eql(c,n.ONE))throw Error("invZ was invalid");return{x:o,y:l}}),k=(0,a.x)(e=>{if(e.is0()){if(r.allowInfinityPoint&&!n.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:i}=e.toAffine();if(!n.isValid(t)||!n.isValid(i))throw Error("bad point: x or y not FE");if(!v(t,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class T{constructor(e,t,r){if(null==e||!n.isValid(e))throw Error("x required");if(null==t||!n.isValid(t)||n.is0(t))throw Error("y required");if(null==r||!n.isValid(r))throw Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error("invalid affine point");if(e instanceof T)throw Error("projective point not allowed");let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?T.ZERO:new T(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=(0,s.pS)(n,e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(T.fromAffine)}static fromHex(e){let t=T.fromAffine(b((0,a.qj)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return T.BASE.multiply(S(e))}static msm(e,t){return function(e,t,r,n){if(!Array.isArray(r))throw Error("array expected");r.forEach((t,r)=>{if(!(t instanceof e))throw Error("invalid point at index "+r)});if(!Array.isArray(n))throw Error("array of scalars expected");n.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)});let i=r.length,s=n.length;if(i!==s)throw Error("arrays of points and scalars must have equal length");let o=e.ZERO,l=(0,a.dJ)(BigInt(i)),c=1;l>12?c=l-3:l>4?c=l-2:l>0&&(c=2);let u=(0,a.OG)(c),d=Array(Number(u)+1).fill(o),f=Math.floor((t.BITS-1)/c)*c,h=o;for(let e=f;e>=0;e-=c){d.fill(o);for(let t=0;t<s;t++){let i=Number(n[t]>>BigInt(e)&u);d[i]=d[i].add(r[t])}let t=o;for(let e=d.length-1,r=o;e>0;e--)r=r.add(d[e]),t=t.add(r);if(h=h.add(t),0!==e)for(let e=0;e<c;e++)h=h.double()}return h}(T,i,e,t)}_setWindowSize(e){R.setWindowSize(this,e)}assertValidity(){k(this)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){P(e);let{px:t,py:r,pz:i}=this,{px:s,py:a,pz:o}=e,l=n.eql(n.mul(t,o),n.mul(s,i)),c=n.eql(n.mul(r,o),n.mul(a,i));return l&&c}negate(){return new T(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:t}=r,i=n.mul(t,E),{px:s,py:a,pz:o}=this,l=n.ZERO,c=n.ZERO,u=n.ZERO,d=n.mul(s,s),f=n.mul(a,a),h=n.mul(o,o),p=n.mul(s,a);return p=n.add(p,p),u=n.mul(s,o),u=n.add(u,u),l=n.mul(e,u),c=n.mul(i,h),c=n.add(l,c),l=n.sub(f,c),c=n.add(f,c),c=n.mul(l,c),l=n.mul(p,l),u=n.mul(i,u),h=n.mul(e,h),p=n.sub(d,h),p=n.mul(e,p),p=n.add(p,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,h),d=n.mul(d,p),c=n.add(c,d),h=n.mul(a,o),h=n.add(h,h),d=n.mul(h,p),l=n.sub(l,d),u=n.mul(h,f),u=n.add(u,u),new T(l,c,u=n.add(u,u))}add(e){P(e);let{px:t,py:i,pz:s}=this,{px:a,py:o,pz:l}=e,c=n.ZERO,u=n.ZERO,d=n.ZERO,f=r.a,h=n.mul(r.b,E),p=n.mul(t,a),y=n.mul(i,o),m=n.mul(s,l),g=n.add(t,i),b=n.add(a,o);g=n.mul(g,b),b=n.add(p,y),g=n.sub(g,b),b=n.add(t,s);let w=n.add(a,l);return b=n.mul(b,w),w=n.add(p,m),b=n.sub(b,w),w=n.add(i,s),c=n.add(o,l),w=n.mul(w,c),c=n.add(y,m),w=n.sub(w,c),d=n.mul(f,b),c=n.mul(h,m),d=n.add(c,d),c=n.sub(y,d),d=n.add(y,d),u=n.mul(c,d),y=n.add(p,p),y=n.add(y,p),m=n.mul(f,m),b=n.mul(h,b),y=n.add(y,m),m=n.sub(p,m),m=n.mul(f,m),b=n.add(b,m),p=n.mul(y,b),u=n.add(u,p),p=n.mul(w,b),c=n.mul(g,c),c=n.sub(c,p),p=n.mul(g,y),d=n.mul(w,d),new T(c,u,d=n.add(d,p))}subtract(e){return this.add(e.negate())}is0(){return this.equals(T.ZERO)}wNAF(e){return R.wNAFCached(this,e,T.normalizeZ)}multiplyUnsafe(e){let{endo:t,n:i}=r;(0,a.aK)("scalar",e,x,i);let s=T.ZERO;if(e===x)return s;if(this.is0()||e===_)return this;if(!t||R.hasPrecomputes(this))return R.wNAFCachedUnsafe(this,e,T.normalizeZ);let{k1neg:o,k1:l,k2neg:c,k2:u}=t.splitScalar(e),d=s,f=s,h=this;for(;l>x||u>x;)l&_&&(d=d.add(h)),u&_&&(f=f.add(h)),h=h.double(),l>>=_,u>>=_;return o&&(d=d.negate()),c&&(f=f.negate()),f=new T(n.mul(f.px,t.beta),f.py,f.pz),d.add(f)}multiply(e){let t,i,{endo:s,n:o}=r;
vendor: 6,098 bytes, line 279
279if((0,a.aK)("scalar",e,_,o),s){let{k1neg:r,k1:a,k2neg:o,k2:l}=s.splitScalar(e),{p:c,f:u}=this.wNAF(a),{p:d,f:f}=this.wNAF(l);c=R.constTimeNegate(r,c),d=R.constTimeNegate(o,d),d=new T(n.mul(d.px,s.beta),d.py,d.pz),t=c.add(d),i=u.add(f)}else{let{p:r,f:n}=this.wNAF(e);t=r,i=n}return T.normalizeZ([t,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=T.BASE,i=(e,t)=>t!==x&&t!==_&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,r));return s.is0()?void 0:s}toAffine(e){return $(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=r;if(e===_)return!0;if(t)return t(T,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=r;return e===_?this:t?t(T,this):this.multiplyUnsafe(r.h)}toRawBytes(e=!0){return(0,a.e8)("isCompressed",e),this.assertValidity(),g(T,this,e)}toHex(e=!0){return(0,a.e8)("isCompressed",e),(0,a.My)(this.toRawBytes(e))}}T.BASE=new T(r.Gx,r.Gy,n.ONE),T.ZERO=new T(n.ZERO,n.ONE,n.ZERO);let{endo:O,nBitLength:N}=r,R=(t=O?Math.ceil(N/2):N,{constTimeNegate:c,hasPrecomputes:e=>1!==y(e),unsafeLadder(e,t,r=T.ZERO){let n=e;for(;t>o;)t&l&&(r=r.add(n)),n=n.double(),t>>=l;return r},precomputeWindow(e,r){let{windows:n,windowSize:i}=d(r,t),s=[],a=e,o=a;for(let e=0;e<n;e++){o=a,s.push(o);for(let e=1;e<i;e++)o=o.add(a),s.push(o);a=o.double()}return s},wNAF(e,r,n){let i=T.ZERO,s=T.BASE,a=d(e,t);for(let e=0;e<a.windows;e++){let{nextN:t,offset:o,isZero:l,isNeg:u,isNegF:d,offsetF:h}=f(n,e,a);n=t,l?s=s.add(c(d,r[h])):i=i.add(c(u,r[o]))}return{p:i,f:s}},wNAFUnsafe(e,r,n,i=T.ZERO){let s=d(e,t);for(let e=0;e<s.windows&&n!==o;e++){let{nextN:t,offset:a,isZero:o,isNeg:l}=f(n,e,s);if(n=t,!o){let e=r[a];i=i.add(l?e.negate():e)}}return i},getPrecomputes(e,t,r){let n=h.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&h.set(t,r(n))),n},wNAFCached(e,t,r){let n=y(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=y(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){u(r,t),p.set(e,r),h.delete(e)}});return{CURVE:r,ProjectivePoint:T,normPrivateKeyToScalar:S,weierstrassEquation:w,isWithinCurveOrder:function(e){return(0,a.r4)(e,_,r.n)}}}({...t,toBytes(e,t,n){let i=t.toAffine(),s=r.toBytes(i.x),o=a.Id;return((0,a.e8)("isCompressed",n),n)?o(Uint8Array.from([t.hasEvenY()?2:3]),s):o(Uint8Array.from([4]),s,r.toBytes(i.y))},fromBytes(e){let t=e.length,n=e[0],i=e.subarray(1);if(t===I&&(2===n||3===n)){let e,t=(0,a.Ph)(i);if(!(0,a.r4)(t,_,r.ORDER))throw Error("Point is not on curve");let s=T(t);try{e=r.sqrt(s)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&n)==1!=((e&_)===_)&&(e=r.neg(e)),{x:t,y:e}}if(t===C&&4===n)return{x:r.fromBytes(i.subarray(0,r.BYTES)),y:r.fromBytes(i.subarray(r.BYTES,2*r.BYTES))};throw Error("invalid Point, expected length of "+I+", or uncompressed "+C+", got "+t)}}),N=(e,t,r)=>(0,a.Ph)(e.slice(t,r));class R{constructor(e,t,r){(0,a.aK)("r",e,_,n),(0,a.aK)("s",t,_,n),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){return new R(N(e=(0,a.qj)("compactSignature",e,2*i),0,i),N(e,i,2*i))}static fromDER(e){let{r:t,s:r}=w.toSig((0,a.qj)("DER",e));return new R(t,r)}assertValidity(){}addRecoveryBit(e){return new R(this.r,this.s,e)}recoverPublicKey(e){let{r:n,s:i,recovery:s}=this,o=M((0,a.qj)("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw Error("recovery id invalid");let l=2===s||3===s?n+t.n:n;if(l>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let c=(1&s)==0?"02":"03",u=$.fromHex(c+v(l,r.BYTES)),d=P(l),f=S(-o*d),h=S(i*d),p=$.BASE.multiplyAndAddUnsafe(u,f,h);if(!p)throw Error("point at infinify");return p.assertValidity(),p}hasHighS(){return this.s>n>>_}normalizeS(){return this.hasHighS()?new R(this.r,S(-this.s),this.recovery):this}toDERRawBytes(){return(0,a.aT)(this.toDERHex())}toDERHex(){return w.hexFromSig(this)}toCompactRawBytes(){return(0,a.aT)(this.toCompactHex())}toCompactHex(){return v(this.r,i)+v(this.s,i)}}function B(e){if("bigint"==typeof e)return!1;if(e instanceof $)return!0;let n=(0,a.qj)("key",e).length,s=r.BYTES,o=s+1;if(!t.allowedPrivateKeyLengths&&i!==o)return n===o||n===2*s+1}let D=t.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=(0,a.Ph)(e),r=8*e.length-b;return r>0?t>>BigInt(r):t},M=t.bits2int_modN||function(e){return S(D(e))},U=(0,a.OG)(b);function j(e){return(0,a.aK)("num < 2^"+b,e,x,U),(0,a.lq)(e,i)}let L={lowS:t.lowS,prehash:!1},F={lowS:t.lowS,prehash:!1};return $.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return $.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(!0===B(e))throw Error("first arg must be private key");if(!1===B(t))throw Error("second arg must be public key");return $.fromHex(t).multiply(k(e)).toRawBytes(r)},sign:function(e,i,s=L){let{seed:o,k2sig:l}=function(e,i,s=L){if(["recovered","canonical"].some(e=>e in s))throw Error("sign() legacy options not supported");let{hash:o,randomBytes:l}=t,{lowS:c,prehash:u,extraEntropy:d}=s;null==c&&(c=!0),e=(0,a.qj)("msgHash",e),g(s),u&&(e=(0,a.qj)("prehashed msgHash",o(e)));let f=M(e),h=k(i),p=[j(h),j(f)];if(null!=d&&!1!==d){let e=!0===d?l(r.BYTES):d;p.push((0,a.qj)("extraEntropy",e))}return{seed:(0,a.Id)(...p),k2sig:function(e){var t;let r=D(e);if(!O(r))return;let i=P(r),s=$.BASE.multiply(r).toAffine(),a=S(s.x);if(a===x)return;let o=S(i*S(f+a*h));if(o===x)return;let l=2*(s.x!==a)|Number(s.y&_),u=o;return c&&o>n>>_&&(u=(t=o)>n>>_?S(-t):t,l^=1),new R(a,u,l)}}}(e,i,s);return(0,a.fg)(t.hash.outputLen,t.nByteLength,t.hmac)(o,l)},verify:function(e,r,n,i=F){let s,o;r=(0,a.qj)("msgHash",r),n=(0,a.qj)("publicKey",n);let{lowS:l,prehash:c,format:u}=i;if(g(i),"strict"in i)throw Error("options.strict was renamed to lowS");if(void 0!==u&&"compact"!==u&&"der"!==u)throw Error("format must be compact or der");let d="string"==typeof e||(0,a.aY)(e),f=!d&&!u&&"object"==typeof e&&null!==e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!d&&!f)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");
279try{if(f&&(o=new R(e.r,e.s)),d){try{"compact"!==u&&(o=R.fromDER(e))}catch(e){if(!(e instanceof w.Err))throw e}o||"der"===u||(o=R.fromCompact(e))}s=$.fromHex(n)}catch(e){return!1}if(!o||l&&o.hasHighS())return!1;c&&(r=t.hash(r));let{r:h,s:p}=o,y=M(r),m=P(p),b=S(y*m),v=S(h*m),x=$.BASE.multiplyAndAddUnsafe(s,b,v)?.toAffine();return!!x&&S(x.x)===h},ProjectivePoint:$,Signature:R,utils:{isValidPrivateKey(e){try{return k(e),!0}catch(e){return!1}},normPrivateKeyToScalar:k,randomPrivateKey:()=>{let e=(0,s.Tp)(t.n);return(0,s.qy)(t.randomBytes(e),t.n)},precompute:(e=8,t=$.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...e,...{hash:t,hmac:(e,...r)=>(0,n.w)(t,e,(0,i.Id)(...r)),randomBytes:i.po}});return{...r(t),create:r}}},66143:(e,t,r)=>{"use strict";function n(){let e=new Set,t=[],r=()=>(function(e){if("undefined"==typeof window)return;let t=t=>e(t.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)})(r=>{t.some(({info:e})=>e.uuid===r.info.uuid)||(t=[...t,r],e.forEach(e=>e(t,{added:[r]})))}),n=r();return{_listeners:()=>e,clear(){e.forEach(e=>e([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),n?.()},findProvider:({rdns:e})=>t.find(t=>t.info.rdns===e),getProviders:()=>t,reset(){this.clear(),n?.(),n=r()},subscribe:(r,{emitImmediately:n}={})=>(e.add(r),n&&r(t,{added:t}),()=>e.delete(r))}}r.d(t,{y:()=>n})},66239:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r.d(t,{A:()=>a});var i=/^\s+/,s=/\s+$/;function a(e,t){if(t=t||{},(e=e||"")instanceof a)return e;if(!(this instanceof a))return new a(e,t);var r,o,l,c,u,d,f,h,p,y,m,g,b,w,v,x,_,A,S,$,T=(o={r:0,g:0,b:0},l=1,c=null,u=null,d=null,f=!1,h=!1,"string"==typeof(r=e)&&(r=function(e){e=e.replace(i,"").replace(s,"").toLowerCase();var t,r=!1;if(E[e])e=E[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=O.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=O.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=O.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=O.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=O.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=O.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=O.hex8.exec(e))?{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:P(t[4])/255,format:r?"name":"hex8"}:(t=O.hex6.exec(e))?{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:r?"name":"hex"}:(t=O.hex4.exec(e))?{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:P(t[4]+""+t[4])/255,format:r?"name":"hex8"}:!!(t=O.hex3.exec(e))&&{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:r?"name":"hex"}}(r)),"object"==n(r)&&(N(r.r)&&N(r.g)&&N(r.b)?(p=r.r,y=r.g,m=r.b,o={r:255*C(p,255),g:255*C(y,255),b:255*C(m,255)},f=!0,h="%"===String(r.r).substr(-1)?"prgb":"rgb"):N(r.h)&&N(r.s)&&N(r.v)?(c=k(r.s),u=k(r.v),g=r.h,b=c,w=u,g=6*C(g,360),b=C(b,100),w=C(w,100),v=Math.floor(g),x=g-v,_=w*(1-b),A=w*(1-x*b),S=w*(1-(1-x)*b),o={r:255*[w,A,_,_,S,w][$=v%6],g:255*[S,w,w,A,_,_][$],b:255*[_,_,S,w,w,A][$]},f=!0,h="hsv"):N(r.h)&&N(r.s)&&N(r.l)&&(c=k(r.s),d=k(r.l),o=function(e,t,r){var n,i,s;function a(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=C(e,360),t=C(t,100),r=C(r,100),0===t)n=i=s=r;else{var o=r<.5?r*(1+t):r+t-r*t,l=2*r-o;n=a(l,o,e+1/3),i=a(l,o,e),s=a(l,o,e-1/3)}return{r:255*n,g:255*i,b:255*s}}(r.h,c,d),f=!0,h="hsl"),r.hasOwnProperty("a")&&(l=r.a)),l=I(l),{ok:f,format:r.format||h,r:Math.min(255,Math.max(o.r,0)),g:Math.min(255,Math.max(o.g,0)),b:Math.min(255,Math.max(o.b,0)),a:l});this._originalInput=e,this._r=T.r,this._g=T.g,this._b=T.b,this._a=T.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||T.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=T.ok}function o(e,t,r){e=C(e,255);var n,i,s=Math.max(e,t=C(t,255),r=C(r,255)),a=Math.min(e,t,r),o=(s+a)/2;if(s==a)n=i=0;else{var l=s-a;switch(i=o>.5?l/(2-s-a):l/(s+a),s){case e:n=(t-r)/l+6*(t<r);break;case t:n=(r-e)/l+2;break;case r:n=(e-t)/l+4}n/=6}return{h:n,s:i,l:o}}function l(e,t,r){e=C(e,255);var n,i=Math.max(e,t=C(t,255),r=C(r,255)),s=Math.min(e,t,r),a=i-s;if(i==s)n=0;else{switch(i){case e:n=(t-r)/a+6*(t<r);break;case t:n=(r-e)/a+2;break;case r:n=(e-t)/a+4}n/=6}return{h:n,s:0===i?0:a/i,v:i}}function c(e,t,r,n){var i=[$(Math.round(e).toString(16)),$(Math.round(t).toString(16)),$(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function u(e,t,r,n){return[$(T(n)),$(Math.round(e).toString(16)),$(Math.round(t).toString(16)),$(Math.round(r).toString(16))].join("")}function d(e,t){t=0===t?0:t||10;var r=a(e).toHsl();return r.s-=t/100,r.s=S(r.s),a(r)}function f(e,t){t=0===t?0:t||10;var r=a(e).toHsl();return r.s+=t/100,r.s=S(r.s),a(r)}function h(e){return a(e).desaturate(100)}function p(e,t){t=0===t?0:t||10;var r=a(e).toHsl();return r.l+=t/100,r.l=S(r.l),a(r)}
vendor: 6,222 bytes, line 279
279function y(e,t){t=0===t?0:t||10;var r=a(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-(t/100*255)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-(t/100*255)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-(t/100*255)))),a(r)}function m(e,t){t=0===t?0:t||10;var r=a(e).toHsl();return r.l-=t/100,r.l=S(r.l),a(r)}function g(e,t){var r=a(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,a(r)}function b(e){var t=a(e).toHsl();return t.h=(t.h+180)%360,a(t)}function w(e,t){if(isNaN(t)||t<=0)throw Error("Argument to polyad must be a positive number");for(var r=a(e).toHsl(),n=[a(e)],i=360/t,s=1;s<t;s++)n.push(a({h:(r.h+s*i)%360,s:r.s,l:r.l}));return n}function v(e){var t=a(e).toHsl(),r=t.h;return[a(e),a({h:(r+72)%360,s:t.s,l:t.l}),a({h:(r+216)%360,s:t.s,l:t.l})]}function x(e,t,r){t=t||6,r=r||30;var n=a(e).toHsl(),i=360/r,s=[a(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,s.push(a(n));return s}function _(e,t){t=t||6;for(var r=a(e).toHsv(),n=r.h,i=r.s,s=r.v,o=[],l=1/t;t--;)o.push(a({h:n,s:i,v:s})),s=(s+l)%1;return o}a.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((r=n.b/255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=I(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=l(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=l(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=o(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=o(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return c(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){var t,r,n,i,s,a;return t=this._r,r=this._g,n=this._b,i=this._a,s=e,a=[$(Math.round(t).toString(16)),$(Math.round(r).toString(16)),$(Math.round(n).toString(16)),$(T(i))],s&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*C(this._r,255))+"%",g:Math.round(100*C(this._g,255))+"%",b:Math.round(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*C(this._r,255))+"%, "+Math.round(100*C(this._g,255))+"%, "+Math.round(100*C(this._b,255))+"%)":"rgba("+Math.round(100*C(this._r,255))+"%, "+Math.round(100*C(this._g,255))+"%, "+Math.round(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(A[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+u(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=a(e);r="#"+u(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return!t&&n&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e)?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(p,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(f,arguments)},greyscale:function(){return this._applyModification(h,arguments)},spin:function(){return this._applyModification(g,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(x,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(w,[3])},tetrad:function(){return this._applyCombination(w,[4])}},a.fromRatio=function(e,t){if("object"==n(e)){var r={};for(var i in e)e.hasOwnProperty(i)&&("a"===i?r[i]=e[i]:r[i]=k(e[i]));e=r}return a(e,t)},a.equals=function(e,t){return!!e&&!!t&&a(e).toRgbString()==a(t).toRgbString()},a.random=function(){return a.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},a.mix=function(e,t,r){r=0===r?0:r||50;var n=a(e).toRgb(),i=a(t).toRgb(),s=r/100;return a({r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)
279*s+n.a})},a.readability=function(e,t){var r=a(e),n=a(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},a.isReadable=function(e,t,r){var n,i,s,o,l,c=a.readability(e,t);switch(l=!1,(i=((n=(n=r)||{level:"AA",size:"small"}).level||"AA").toUpperCase(),s=(n.size||"small").toLowerCase(),"AA"!==i&&"AAA"!==i&&(i="AA"),"small"!==s&&"large"!==s&&(s="small"),o={level:i,size:s}).level+o.size){case"AAsmall":case"AAAlarge":l=c>=4.5;break;case"AAlarge":l=c>=3;break;case"AAAsmall":l=c>=7}return l},a.mostReadable=function(e,t,r){var n,i,s,o,l=null,c=0;i=(r=r||{}).includeFallbackColors,s=r.level,o=r.size;for(var u=0;u<t.length;u++)(n=a.readability(e,t[u]))>c&&(c=n,l=a(t[u]));return a.isReadable(e,l,{level:s,size:o})||!i?l:(r.includeFallbackColors=!1,a.mostReadable(e,["#fff","#000"],r))};var E=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
2790",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},A=a.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(E);function I(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function C(e,t){"string"==typeof(r=e)&&-1!=r.indexOf(".")&&1===parseFloat(r)&&(e="100%");var r,n,i="string"==typeof(n=e)&&-1!=n.indexOf("%");return(e=Math.min(t,Math.max(0,parseFloat(e))),i&&(e=parseInt(e*t,10)/100),1e-6>Math.abs(e-t))?1:e%t/parseFloat(t)}function S(e){return Math.min(1,Math.max(0,e))}function P(e){return parseInt(e,16)}function $(e){return 1==e.length?"0"+e:""+e}function k(e){return e<=1&&(e=100*e+"%"),e}function T(e){return Math.round(255*parseFloat(e)).toString(16)}var O=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",r="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:RegExp("rgb"+t),rgba:RegExp("rgba"+r),hsl:RegExp("hsl"+t),hsla:RegExp("hsla"+r),hsv:RegExp("hsv"+t),hsva:RegExp("hsva"
279+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function N(e){return!!O.CSS_UNIT.exec(e)}},66277:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(r,n){var i,s,a;function o(r){e.removeListener(t,l),n(r)}function l(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,l,{once:!0}),"error"!==t&&(i=e,s=o,a={once:!0},"function"==typeof i.on&&y(i,"error",s,a))})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){if(o(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),a=s[t]),void 0===a)a=s[t]=r,++e._eventsCount;else if("function"==typeof a?a=s[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var i,s,a,c=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function f(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function i(s){n.once&&e.removeEventListener(t,i),r(s)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a}
279,set:function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var a,o=Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else for(var c=l.length,u=p(l,c),r=0;r<c;++r)n(u[r],this,t);return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return o(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,s,a;if(o(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){a=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},66471:(e,t,r)=>{"use strict";r.d(t,{$s:()=>u,Kc:()=>f,Kz:()=>d,Sq:()=>h,Vg:()=>l,WA:()=>p,aO:()=>a,fZ:()=>c,zW:()=>o});var n=r(18409),i=r(30063),s=r(15520);function a(e){let t=Object.entries(e).map(([e,t])=>void 0===t||!1===t?null:[e,t]).filter(Boolean),r=t.reduce((e,[t])=>Math.max(e,t.length),0);return t.map(([e,t])=>`  ${`${e}:`.padEnd(r+1)}  ${t}`).join("\n")}s.C;class o extends s.C{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}s.C;class l extends s.C{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",a(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}s.C,s.C;class c extends s.C{constructor({storageKey:e}){super(`Size for storage key "${e}
279" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class u extends s.C{constructor(e,{account:t,docsPath:r,chain:s,data:o,gas:l,gasPrice:c,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:f,to:h,value:p}){super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",a({chain:s&&`${s?.name} (id: ${s?.id})`,from:t?.address,to:h,value:void 0!==p&&`${(0,n.c)(p)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:l,gasPrice:void 0!==c&&`${(0,i.Q)(c)} gwei`,maxFeePerGas:void 0!==u&&`${(0,i.Q)(u)} gwei`,maxPriorityFeePerGas:void 0!==d&&`${(0,i.Q)(d)} gwei`,nonce:f})].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class d extends s.C{constructor({blockHash:e,blockNumber:t,blockTag:r,hash:n,index:i}){let s="Transaction";r&&void 0!==i&&(s=`Transaction at block time "${r}" at index "${i}"`),e&&void 0!==i&&(s=`Transaction at block hash "${e}" at index "${i}"`),t&&void 0!==i&&(s=`Transaction at block number "${t}" at index "${i}"`),n&&(s=`Transaction with hash "${n}"`),super(`${s} could not be found.`,{name:"TransactionNotFoundError"})}}class f extends s.C{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class h extends s.C{constructor({receipt:e}){super(`Transaction with hash "${e.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=e}}class p extends s.C{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}},66776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(57924);n.__exportStar(r(93846),t),n.__exportStar(r(15203),t),n.__exportStar(r(4306),t),n.__exportStar(r(17562),t)},67008:(e,t,r)=>{"use strict";r.d(t,{Ag:()=>a,E5:()=>d,Rm:()=>c,SJ:()=>l,UW:()=>u,b2:()=>i,oX:()=>o,v2:()=>n,xw:()=>f});let n=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],i=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],s=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],a=[...s,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],o=[...s,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],l=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],c=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],u=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],d=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}
279],f=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}]},67671:(e,t,r)=>{"use strict";r.d(t,{f:()=>i});var n=r(2204);let i=(0,r(83121).x)({...n.o,id:42431,hardfork:"t5",blockExplorers:{default:{name:"Tempo Explorer",url:"https://explore.testnet.tempo.xyz"}},name:"Tempo Testnet (Moderato)",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.moderato.tempo.xyz"],webSocket:["wss://rpc.moderato.tempo.xyz"]}},testnet:!0})},67714:(e,t,r)=>{"use strict";r.d(t,{$x:()=>l,El:()=>o,O_:()=>a,Uw:()=>s});var n=r(75834);let i=(0,n.createContext)(null);i.displayName="OpenClosedContext";var s=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(s||{});function a(){return(0,n.useContext)(i)}function o({value:e,children:t}){return n.createElement(i.Provider,{value:e},t)}function l({children:e}){return n.createElement(i.Provider,{value:null},e)}},68139:(e,t,r)=>{"use strict";r.d(t,{VY:()=>f,rU:()=>d});var n=r(75834),i=r(35424),s=r(53160),a=r(1808),o=r(52368),l=r(6307),c=r(30749);let u=(0,n.createContext)(null);function d(){let[e,t]=(0,n.useState)([]);return[e.length>0?e.join(" "):void 0,(0,n.useMemo)(()=>function(e){let r=(0,i._)(e=>(t(t=>[...t,e]),()=>t(t=>{let r=t.slice(),n=r.indexOf(e);return -1!==n&&r.splice(n,1),r}))),s=(0,n.useMemo)(()=>({register:r,slot:e.slot,name:e.name,props:e.props,value:e.value}),[r,e.slot,e.name,e.props,e.value]);return n.createElement(u.Provider,{value:s},e.children)},[t])]}u.displayName="DescriptionContext";let f=Object.assign((0,c.FX)(function(e,t){let r=(0,n.useId)(),i=(0,l._)(),{id:d=`headlessui-description-${r}`,...f}=e,h=function e(){let t=(0,n.useContext)(u);if(null===t){let t=Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),p=(0,o.P)(t);(0,s.s)(()=>h.register(d),[d,h.register]);let y=(0,a._)({...h.slot,disabled:i||!1}),m={ref:p,...h.props,id:d};return(0,c.Ci)()({ourProps:m,theirProps:f,slot:y,defaultTag:"p",name:h.name||"Description"})}),{})},68145:(e,t,r)=>{"use strict";r.d(t,{$s:()=>u,Kc:()=>f,Kz:()=>d,Sq:()=>h,Vg:()=>l,WA:()=>p,aO:()=>a,fZ:()=>c,zW:()=>o});var n=r(10187),i=r(65385),s=r(99838);function a(e){let t=Object.entries(e).map(([e,t])=>void 0===t||!1===t?null:[e,t]).filter(Boolean),r=t.reduce((e,[t])=>Math.max(e,t.length),0);return t.map(([e,t])=>`  ${`${e}:`.padEnd(r+1)}  ${t}`).join("\n")}s.C;class o extends s.C{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}s.C;class l extends s.C{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",a(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}s.C,s.C;class c extends s.C{constructor({storageKey:e}){super(`Size for storage key "${e}
279" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class u extends s.C{constructor(e,{account:t,docsPath:r,chain:s,data:o,gas:l,gasPrice:c,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:f,to:h,value:p}){super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",a({chain:s&&`${s?.name} (id: ${s?.id})`,from:t?.address,to:h,value:void 0!==p&&`${(0,n.c)(p)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:l,gasPrice:void 0!==c&&`${(0,i.Q)(c)} gwei`,maxFeePerGas:void 0!==u&&`${(0,i.Q)(u)} gwei`,maxPriorityFeePerGas:void 0!==d&&`${(0,i.Q)(d)} gwei`,nonce:f})].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class d extends s.C{constructor({blockHash:e,blockNumber:t,blockTag:r,hash:n,index:i}){let s="Transaction";r&&void 0!==i&&(s=`Transaction at block time "${r}" at index "${i}"`),e&&void 0!==i&&(s=`Transaction at block hash "${e}" at index "${i}"`),t&&void 0!==i&&(s=`Transaction at block number "${t}" at index "${i}"`),n&&(s=`Transaction with hash "${n}"`),super(`${s} could not be found.`,{name:"TransactionNotFoundError"})}}class f extends s.C{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class h extends s.C{constructor({receipt:e}){super(`Transaction with hash "${e.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=e}}class p extends s.C{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}},68229:(e,t,r)=>{"use strict";r.d(t,{_o:()=>g,Pj:()=>y,uT:()=>d,NV:()=>m});var n=r(48441),i=r(25586),s=r(57168),a=r(11177),o=r(54057);class l extends o.C{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}let c=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);var u=r(97);function d(e,t={}){if((0,u.Ji)(e))return function(e,t={}){let r=(0,u.ej)(e);if(!r)throw new a.s7({signature:e,type:"function"});let n=m(r.parameters),i=[],s=n.length;for(let e=0;e<s;e++)i.push(y(n[e],{modifiers:u.v7,structs:t,type:"function"}));let o=[];if(r.returns){let e=m(r.returns),n=e.length;for(let r=0;r<n;r++)o.push(y(e[r],{modifiers:u.v7,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:i,outputs:o}}(e,t);if((0,u.Rv)(e))return function(e,t={}){let r=(0,u.iB)(e);if(!r)throw new a.s7({signature:e,type:"event"});let n=m(r.parameters),i=[],s=n.length;for(let e=0;e<s;e++)i.push(y(n[e],{modifiers:u.fC,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:i}}(e,t);if((0,u.pc)(e))return function(e,t={}){let r=(0,u.kz)(e);if(!r)throw new a.s7({signature:e,type:"error"});let n=m(r.parameters),i=[],s=n.length;for(let e=0;e<s;e++)i.push(y(n[e],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:i}}(e,t);if((0,u.l9)(e))return function(e,t={}){let r=(0,u.Yo)(e);if(!r)throw new a.s7({signature:e,type:"constructor"});let n=m(r.parameters),i=[],s=n.length;for(let e=0;e<s;e++)i.push(y(n[e],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:i}}(e,t);if((0,u.v8)(e)){var r=e;let t=(0,u.If)(r);if(!t)throw new a.s7({signature:r,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}if((0,u.sP)(e))return{type:"receive",stateMutability:"payable"};throw new a.x8({signature:e})}let f=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,h=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,p=/^u?int$/;function y(e,t){var r,a;let o,l=function(e,t,r){let n="";if(r)for(let e of Object.entries(r)){if(!e)continue;let t="";for(let r of e[1])t+=`[${r.type}${r.name?`:${r.name}`:""}]`;n+=`(${e[0]}{${t}})`}return t?`${t}:${e}${n}`:`${e}${n}`}(e,t?.type,t?.structs);if(c.has(l))return c.get(l);let d=n.wj.test(e),w=(0,n.Yv)(d?h:f,e);if(!w)throw new s.dV({param:e});if(w.name&&("address"===(r=w.name)||"bool"===r||"function"===r||"string"===r||"tuple"===r||n.BD.test(r)||n.Ge.test(r)||b.test(r)))throw new s.zd({param:e,name:w.name});let v=w.name?{name:w.name}:{},x="indexed"===w.modifier?{indexed:!0}:{},_=t?.structs??{},E={};if(d){o="tuple";let e=m(w.type),t=[],r=e.length;for(let n=0;n<r;n++)t.push(y(e[n],{structs:_}));E={components:t}}else if(w.type in _)o="tuple",E={components:_[w.type]};else if(p.test(w.type))o=`${w.type}256`;else if("address payable"===w.type)o="address";else if(o=w.type,t?.type!=="struct"&&!g(o))throw new i.UG({type:o});if(w.modifier){if(!t?.modifiers?.has?.(w.modifier))throw new s.NO({param:e,type:t?.type,modifier:w.modifier});if(u.v7.has(w.modifier)&&(a=o,!w.array&&"bytes"!==a&&"string"!==a&&"tuple"!==a)
279)throw new s.Pj({param:e,type:t?.type,modifier:w.modifier})}let A={type:`${o}${w.array??""}`,...v,...x,...E};return c.set(l,A),A}function m(e,t=[],r="",n=0){let i=e.trim().length;for(let s=0;s<i;s++){let i=e[s],a=e.slice(s+1);switch(i){case",":return 0===n?m(a,[...t,r.trim()]):m(a,t,`${r}${i}`,n);case"(":return m(a,t,`${r}${i}`,n+1);case")":return m(a,t,`${r}${i}`,n-1);default:return m(a,t,`${r}${i}`,n)}}if(""===r)return t;if(0!==n)throw new l({current:r,depth:n});return t.push(r.trim()),t}function g(e){return"address"===e||"bool"===e||"function"===e||"string"===e||n.BD.test(e)||n.Ge.test(e)}let b=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/},68305:(e,t,r)=>{"use strict";r.d(t,{RR:()=>o,pw:()=>a,sM:()=>s});var n=r(65385),i=r(99838);class s extends i.C{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class a extends i.C{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class o extends i.C{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,n.Q)(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}},68860:(e,t,r)=>{"use strict";function n(e){let t=e.length,r=0,n=0;for(;n<t;){let i=e.charCodeAt(n++);if((0xffffff80&i)==0){r++;continue}if((0xfffff800&i)==0)r+=2;else{if(i>=55296&&i<=56319&&n<t){let t=e.charCodeAt(n);(64512&t)==56320&&(++n,i=((1023&i)<<10)+(1023&t)+65536)}(0xffff0000&i)==0?r+=3:r+=4}}return r}r.d(t,{Zf:()=>a,_u:()=>l,dS:()=>n,yi:()=>s});let i=new TextEncoder;function s(e,t,r){if(e.length>50)i.encodeInto(e,t.subarray(r));else!function(e,t,r){let n=e.length,i=r,s=0;for(;s<n;){let r=e.charCodeAt(s++);if((0xffffff80&r)==0){t[i++]=r;continue}if((0xfffff800&r)==0)t[i++]=r>>6&31|192;else{if(r>=55296&&r<=56319&&s<n){let t=e.charCodeAt(s);(64512&t)==56320&&(++s,r=((1023&r)<<10)+(1023&t)+65536)}(0xffff0000&r)==0?t[i++]=r>>12&15|224:(t[i++]=r>>18&7|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128}t[i++]=63&r|128}}(e,t,r)}function a(e,t,r){let n=t,i=n+r,s=[],a="";for(;n<i;){let t=e[n++];if((128&t)==0)s.push(t);else if((224&t)==192){let r=63&e[n++];s.push((31&t)<<6|r)}else if((240&t)==224){let r=63&e[n++],i=63&e[n++];s.push((31&t)<<12|r<<6|i)}else if((248&t)==240){let r=63&e[n++],i=(7&t)<<18|r<<12|(63&e[n++])<<6|63&e[n++];i>65535&&(i-=65536,s.push(i>>>10&1023|55296),i=56320|1023&i),s.push(i)}else s.push(t);s.length>=4096&&(a+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(a+=String.fromCharCode(...s)),a}let o=new TextDecoder;function l(e,t,r){if(!(r>200))return a(e,t,r);let n=e.subarray(t,t+r);return o.decode(n)}},69064:(e,t,r)=>{"use strict";r.d(t,{CL:()=>l,D5:()=>u,Di:()=>f,G1:()=>k,Gi:()=>c,L5:()=>I,MI:()=>N,RV:()=>_,Sf:()=>x,WT:()=>C,XU:()=>o,YW:()=>y,ab:()=>m,bq:()=>d,cg:()=>P,ch:()=>A,hA:()=>h,hl:()=>S,jz:()=>T,nR:()=>O,qZ:()=>p,s0:()=>g,sV:()=>v,uL:()=>$,vx:()=>w,xQ:()=>b,xq:()=>E});var n=r(15520),i=r(39534);class s extends n.C{constructor(e,{code:t,docsPath:r,metaMessages:n,name:s,shortMessage:a}){super(a,{cause:e,docsPath:r,metaMessages:n||e?.metaMessages,name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof i.J8?e.code:t??-1}}class a extends s{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class o extends s{constructor(e){super(e,{code:o.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(o,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class l extends s{constructor(e){super(e,{code:l.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class c extends s{constructor(e,{method:t}={}){super(e,{code:c.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class u extends s{constructor(e){super(e,{code:u.code,name:"InvalidParamsRpcError",shortMessage:"Invalid parameters were provided to the RPC method.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class d extends s{constructor(e){super(e,{code:d.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class f extends s{constructor(e){super(e,{code:f.code,name:"InvalidInputRpcError",shortMessage:"Missing or invalid parameters.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});
279class h extends s{constructor(e){super(e,{code:h.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class p extends s{constructor(e){super(e,{code:p.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class y extends s{constructor(e){super(e,{code:y.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class m extends s{constructor(e,{method:t}={}){super(e,{code:m.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class g extends s{constructor(e){super(e,{code:g.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class b extends s{constructor(e){super(e,{code:b.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class w extends a{constructor(e){super(e,{code:w.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class v extends a{constructor(e){super(e,{code:v.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class x extends a{constructor(e,{method:t}={}){super(e,{code:x.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class _ extends a{constructor(e){super(e,{code:_.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class E extends a{constructor(e){super(e,{code:E.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class A extends a{constructor(e){super(e,{code:A.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class I extends a{constructor(e){super(e,{code:I.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(I,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class C extends a{constructor(e){super(e,{code:C.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class S extends a{constructor(e){super(e,{code:S.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(S,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class P extends a{constructor(e){super(e,{code:P.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(P,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class $ extends a{constructor(e){super(e,{code:$.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty($,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class k extends a{constructor(e){super(e,{code:k.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(k,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
279);class T extends a{constructor(e){super(e,{code:T.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(T,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class O extends a{constructor(e){super(e,{code:O.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(O,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class N extends s{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}},69300:(e,t,r)=>{"use strict";r.d(t,{x:()=>d});var n=r(11400),i=r(84413),s=r(2939),a=r(21047),o=r(36174),l=r(44037);async function c({hash:e,signature:t}){let n=(0,s.q)(e)?e:(0,l.nj)(e),{secp256k1:i}=await Promise.resolve().then(r.bind(r,31168)),c=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){let{r:e,s:r,v:n,yParity:s}=t,a=u(Number(s??n));return new i.Signature((0,o.uU)(e),(0,o.uU)(r)).addRecoveryBit(a)}let e=(0,s.q)(t)?t:(0,l.nj)(t);if(65!==(0,a.E)(e))throw Error("invalid signature length");let r=u((0,o.ME)(`0x${e.slice(130)}`));return i.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(r)})().recoverPublicKey(n.substring(2)).toHex(!1);return`0x${c}`}function u(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}async function d({hash:e,signature:t}){var r=await c({hash:e,signature:t});let s=(0,i.S)(`0x${r.substring(4)}`).substring(26);return(0,n.o)(`0x${s}`)}},69592:(e,t,r)=>{"use strict";r.d(t,{PK:()=>l,iq:()=>s,uP:()=>o,zF:()=>a});var n=r(83815),i=r(99838);class s extends i.C{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`],name:"BlobSizeTooLargeError"})}}class a extends i.C{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class o extends i.C{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`],name:"InvalidVersionedHashSizeError"})}}class l extends i.C{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${n.E}`,`Received: ${t}`],name:"InvalidVersionedHashVersionError"})}}},69697:(e,t,r)=>{"use strict";r.d(t,{v:()=>w});var n=r(63710),i=r(92594),s=r(99838),a=r(9652),o=r(48409),l=r(50016),c=r(93861),u=r(89502),d=r(95016),f=r(29447),h=r(13108),p=r(74869),y=r(40857),m=r(29421),g=r(3581);let b=new h.A(128);async function w(e,t){let r,{account:h=e.account,assertChainId:w=!0,chain:v=e.chain,accessList:x,authorizationList:_,blobs:E,data:A,dataSuffix:I="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,gas:C,gasPrice:S,maxFeePerBlobGas:P,maxFeePerGas:$,maxPriorityFeePerGas:k,nonce:T,type:O,value:N,...R}=t;if(void 0===h)throw new i.T({docsPath:"/docs/actions/wallet/sendTransaction"});let B=h?(0,n.J)(h):null;try{(0,p.c)(t);let n=await (async()=>t.to?t.to:null!==t.to&&_&&_.length>0?await (0,a.g)({authorization:_[0]}).catch(()=>{throw new s.C("`to` is required. Could not infer from `authorizationList`.")}):void 0)();if(B?.type==="json-rpc"||null===B){let t;null!==v&&(t=await (0,f.T)(e,y.T,"getChainId")({}),w&&(0,o.v)({currentChainId:t,chain:v}));let r=e.chain?.formatters?.transactionRequest?.format,i=(r||d.Bv)({...(0,u.o)(R,{format:r}),accessList:x,account:B,authorizationList:_,blobs:E,chainId:t,data:I?(0,l.xW)([A??"0x",I]):A,gas:C,gasPrice:S,maxFeePerBlobGas:P,maxFeePerGas:$,maxPriorityFeePerGas:k,nonce:T,to:n,type:O,value:N},"sendTransaction"),s=b.get(e.uid);try{return await e.request({method:s?"wallet_sendTransaction":"eth_sendTransaction",params:[i]},{retryCount:0})}catch(t){if(!1===s)throw t;if("InvalidInputRpcError"===t.name||"InvalidParamsRpcError"===t.name||"MethodNotFoundRpcError"===t.name||"MethodNotSupportedRpcError"===t.name)return await e.request({method:"wallet_sendTransaction",params:[i]},{retryCount:0}).then(t=>(b.set(e.uid,!0),t)).catch(r=>{if("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name)throw b.set(e.uid,!1),t;throw r});throw t}}if(B?.type==="local"){if(B.nonceManager&&void 0===T){let t=R.chainId,n=await (async()=>"number"==typeof t?t:v?v.id:(0,f.T)(e,y.T,"getChainId")({}))();r={address:B.address,chainId:n}}let t=await (0,f.T)(e,m.ft,"prepareTransactionRequest")({account:B,accessList:x,authorizationList:_,blobs:E,chain:v,data:I?(0,l.xW)([A??"0x",I]):A,gas:C,gasPrice:S,maxFeePerBlobGas:P,maxFeePerGas:$,maxPriorityFeePerGas:k,nonce:T,nonceManager:B.nonceManager,parameters:[...m.MM,"sidecars"],type:O,value:N,...R,to:n}),i=v?.serializers?.transaction,s=await B.signTransaction(t,{serializer:i});return await (0,f.T)(e,g.L,"sendRawTransaction")({serializedTransaction:s})}if(B?.type==="smart")throw new i.Z({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new i.Z({docsPath:"/docs/actions/wallet/sendTransaction",type:B?.type})}catch(e){if(e instanceof i.Z)throw e;throw r&&B?.nonceManager?.reset(r),(0,c.p)(e,{...t,account:B,chain:t.chain||void 0})}}},70044:(e,t,r)=>{"use strict";r.d(t,{ID:()=>a,RZ:()=>n,TY:()=>i,zf:()=>s});let n=e=>e;function i(e){if(e?.reason)return e.reason;if("function"==typeof DOMException)return new DOMException("This operation was aborted","AbortError");let t=Error("This operation was aborted");return t.name="AbortError",t}function s(e){return"object"==typeof e&&null!==e&&"name"in e&&"AbortError"===e.name}let a=e=>{try{let t=new URL(e);if(!t.username&&!t.password)return e;return t.username="",t.password="",t.toString()}catch{return e}}},70393:(e,t,r)=>{"use strict";r.d(t,{BD:()=>c,Bm:()=>p,CU:()=>v,Fh:()=>y,MZ:()=>h,Me:()=>u,Uo:()=>o,p9:()=>w,pW:()=>g,wl:()=>b});var n=r(40852),i=r(36207),s=r(6194),a=r(56300);let o=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),l=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var c=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(c||{}),u=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(u||{}),d=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(d||{});function f(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(
279o)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var h=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(h||{});function p(e,t=0){var r;return e!==(null==(r=(0,a.TW)(e))?void 0:r.body)&&(0,s.Y)(t,{0:()=>e.matches(o),1(){let t=e;for(;null!==t;){if(t.matches(o))return!0;t=t.parentElement}return!1}})}function y(e){(0,n.e)().nextFrame(()=>{let t=(0,a.bq)(e);t&&i.Lk(t)&&!p(t,0)&&g(e)})}var m=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(m||{});function g(e){null==e||e.focus({preventScroll:!0})}function b(e,t=e=>e){return e.slice().sort((e,r)=>{let n=t(e),i=t(r);if(null===n||null===i)return 0;let s=n.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function w(e,t,r=null===e?document.body:(0,a.zm)(e)){return v(f(r),t,{relativeTo:e})}function v(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){var s,o,c;let u=Array.isArray(e)?e.length>0?(0,a.zm)(e[0]):document:(0,a.zm)(e),d=Array.isArray(e)?r?b(e):e:64&t?function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(l)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e):f(e);i.length>0&&d.length>1&&(d=d.filter(e=>!i.some(t=>null!=t&&"current"in t?(null==t?void 0:t.current)===e:t===e))),n=null!=n?n:null==u?void 0:u.activeElement;let h=(()=>{if(5&t)return 1;if(10&t)return -1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=(()=>
279{if(1&t)return 0;if(2&t)return Math.max(0,d.indexOf(n))-1;if(4&t)return Math.max(0,d.indexOf(n))+1;if(8&t)return d.length-1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),y=32&t?{preventScroll:!0}:{},m=0,g=d.length,w;do{if(m>=g||m+g<=0)return 0;let e=p+m;if(16&t)e=(e+g)%g;else{if(e<0)return 3;if(e>=g)return 1}null==(w=d[e])||w.focus(y),m+=h}while(w!==(0,a.bq)(w));return 6&t&&null!=(c=null==(o=null==(s=w)?void 0:s.matches)?void 0:o.call(s,"textarea,input"))&&c&&w.select(),2}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0))},70435:(e,t,r)=>{"use strict";r.d(t,{$:()=>tB});var n=r(28266),i=r(74889),s=r(72693),a=r(11400),o=r(87664),l=r(21047),c=r(4538),u=r(44037),d=r(15520),f=r(48241);function h(e){if(!(e instanceof d.C))return!1;let t=e.walk(e=>e instanceof f.M);return t instanceof f.M&&(t.data?.errorName==="HttpError"||t.data?.errorName==="ResolverError"||t.data?.errorName==="ResolverNotContract"||t.data?.errorName==="ResolverNotFound"||t.data?.errorName==="ReverseAddressMismatch"||t.data?.errorName==="UnsupportedResolverProfile")}var p=r(57608),y=r(30406),m=r(32579),g=r(84413),b=r(2939);function w(e){if(66!==e.length||0!==e.indexOf("[")||65!==e.indexOf("]"))return null;let t=`0x${e.slice(1,65)}`;return(0,b.q)(t)?t:null}function v(e){let t=new Uint8Array(32).fill(0);if(!e)return(0,u.My)(t);let r=e.split(".");for(let e=r.length-1;e>=0;e-=1){let n=w(r[e]),i=n?(0,m.ZJ)(n):(0,g.S)((0,m.Af)(r[e]),"bytes");t=(0,g.S)((0,y.xW)([t,i]),"bytes")}return(0,u.My)(t)}function x(e){let t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);let r=new Uint8Array((0,m.Af)(t).byteLength+2),n=0,i=t.split(".");for(let e=0;e<i.length;e++){var s;let t=(0,m.Af)(i[e]);t.byteLength>255&&(t=(0,m.Af)((s=function(e){let t=new Uint8Array(32).fill(0);return e?w(e)||(0,g.S)((0,m.Af)(e)):(0,u.My)(t)}(i[e]),`[${s.slice(2)}]`))),r[n]=t.length,r.set(t,n+1),n+=t.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}var _=r(12089),E=r(71441);async function A(e,t){let{blockNumber:r,blockTag:d,coinType:f,name:y,gatewayUrls:m,strict:g}=t,{chain:b}=e,w=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!b)throw Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:r,chain:b,contract:"ensUniversalResolver"})})(),A=b?.ensTlds;if(A&&!A.some(e=>y.endsWith(e)))return null;let I=null!=f?[v(y),BigInt(f)]:[v(y)];try{let t=(0,s.p)({abi:n.Rm,functionName:"addr",args:I}),o={address:w,abi:n.Ag,functionName:"resolveWithGateways",args:[(0,u.nj)(x(y)),t,m??[p.J]],blockNumber:r,blockTag:d},h=(0,_.T)(e,E.J,"readContract"),g=await h(o);if("0x"===g[0])return null;let b=function({coinType:e,data:t,args:r}){try{return(0,i.e)({abi:n.Rm,args:r,functionName:"addr",data:t})}catch(n){if(null==e)throw n;let r=(0,c.B)(t);if(20===(0,l.E)(r))return(0,a.b)(r);throw n}}({coinType:f,data:g[0],args:I});if("0x"===b||"0x00"===(0,c.B)(b))return null;return b}catch(e){if(g)throw e;if(h(e))return null;throw e}}class I extends d.C{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class C extends d.C{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class S extends d.C{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class P extends d.C{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}d.C;let $=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,k=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,T=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,O=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function N(e){try{let t=await fetch(e,{method:"HEAD"});if(200===t.status){let e=t.headers.get("content-type");return e?.startsWith("image/")}return!1}catch(t){if("object"==typeof t&&void 0!==t.response||!Object.hasOwn(globalThis,"Image"))return!1;return new Promise(t=>{let r=new Image;r.onload=()=>{t(!0)},r.onerror=()=>{t(!1)},r.src=e})}}function R(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function B({uri:e,gatewayUrls:t}){let r=T.test(e);
vendor: 2,949 bytes, line 279
279if(r)return{uri:e,isOnChain:!0,isEncoded:r};let n=R(t?.ipfs,"https://ipfs.io"),i=R(t?.arweave,"https://arweave.net"),s=e.match($),{protocol:a,subpath:o,target:l,subtarget:c=""}=s?.groups||{},u="ipns:/"===a||"ipns/"===o,d="ipfs:/"===a||"ipfs/"===o||k.test(e);if(e.startsWith("http")&&!u&&!d){let r=e;return t?.arweave&&(r=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:r,isOnChain:!1,isEncoded:!1}}if((u||d)&&l)return{uri:`${n}/${u?"ipns":"ipfs"}/${l}${c}`,isOnChain:!1,isEncoded:!1};if("ar:/"===a&&l)return{uri:`${i}/${l}${c||""}`,isOnChain:!1,isEncoded:!1};let f=e.replace(O,"");if(f.startsWith("<svg")&&(f=`data:image/svg+xml;base64,${btoa(f)}`),f.startsWith("data:")||f.startsWith("{"))return{uri:f,isOnChain:!0,isEncoded:!1};throw new S({uri:e})}function D(e){if("object"!=typeof e||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new I({data:e});return e.image||e.image_url||e.image_data}async function M({gatewayUrls:e,uri:t}){try{let r=await fetch(t).then(e=>e.json());return await U({gatewayUrls:e,uri:D(r)})}catch{throw new S({uri:t})}}async function U({gatewayUrls:e,uri:t}){let{uri:r,isOnChain:n}=B({uri:t,gatewayUrls:e});if(n||await N(r))return r;throw new S({uri:t})}async function j(e,{nft:t}){if("erc721"===t.namespace)return(0,E.J)(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return(0,E.J)(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new P({namespace:t.namespace})}async function L(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?F(e,{gatewayUrls:t,record:r}):U({uri:r,gatewayUrls:t})}async function F(e,{gatewayUrls:t,record:r}){let n=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));let[r,n,i]=t.split("/"),[s,a]=r.split(":"),[o,l]=n.split(":");if(!s||"eip155"!==s.toLowerCase())throw new C({reason:"Only EIP-155 supported"});if(!a)throw new C({reason:"Chain ID not found"});if(!l)throw new C({reason:"Contract address not found"});if(!i)throw new C({reason:"Token ID not found"});if(!o)throw new C({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a,10),namespace:o.toLowerCase(),contractAddress:l,tokenID:i}}(r),{uri:i,isOnChain:s,isEncoded:a}=B({uri:await j(e,{nft:n}),gatewayUrls:t});if(s&&(i.includes("data:application/json;base64,")||i.startsWith("{")))return U({uri:D(JSON.parse(a?atob(i.replace("data:application/json;base64,","")):i)),gatewayUrls:t});let o=n.tokenID;return"erc1155"===n.namespace&&(o=o.replace("0x","").padStart(64,"0")),M({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,o)})}async function z(e,t){let{blockNumber:r,blockTag:a,key:l,name:c,gatewayUrls:d,str
vendor: 4,329 bytes, line 279
279ict:f}=t,{chain:y}=e,m=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!y)throw Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:r,chain:y,contract:"ensUniversalResolver"})})(),g=y?.ensTlds;if(g&&!g.some(e=>c.endsWith(e)))return null;try{let t={address:m,abi:n.Ag,args:[(0,u.nj)(x(c)),(0,s.p)({abi:n.SJ,functionName:"text",args:[v(c),l]}),d??[p.J]],functionName:"resolveWithGateways",blockNumber:r,blockTag:a},o=(0,_.T)(e,E.J,"readContract"),f=await o(t);if("0x"===f[0])return null;let h=(0,i.e)({abi:n.SJ,functionName:"text",data:f[0]});return""===h?null:h}catch(e){if(f)throw e;if(h(e))return null;throw e}}async function q(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:a,universalResolverAddress:o}){let l=await (0,_.T)(e,z,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:i,universalResolverAddress:o,gatewayUrls:s,strict:a});if(!l)return null;try{return await L(e,{record:l,gatewayUrls:n})}catch{return null}}async function W(e,t){let{address:r,blockNumber:i,blockTag:s,coinType:a=60n,gatewayUrls:l,strict:c}=t,{chain:u}=e,d=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!u)throw Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:i,chain:u,contract:"ensUniversalResolver"})})();try{let t={address:d,abi:n.oX,args:[r,a,l??[p.J]],functionName:"reverseWithGateways",blockNumber:i,blockTag:s},o=(0,_.T)(e,E.J,"readContract"),[c]=await o(t);return c||null}catch(e){if(c)throw e;if(h(e))return null;throw e}}async function H(e,t){let{blockNumber:r,blockTag:n,name:i}=t,{chain:s}=e,a=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:r,chain:s,contract:"ensUniversalResolver"})})(),l=s?.ensTlds;if(l&&!l.some(e=>i.endsWith(e)))throw Error(`${i} is not a valid ENS TLD (${l?.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);let[c]=await (0,_.T)(e,E.J,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,u.nj)(x(i))],blockNumber:r,blockTag:n});return c}var K=r(71151),V=r(97352),G=r(24393),J=r(62276),Y=r(23274),Z=r(94383);async function Q(e,t){let{account:r=e.account,blockNumber:n,blockTag:i="latest",blobs:s,data:a,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:f,maxPriorityFeePerGas:h,to:p,value:y,...m}=t,g=r?(0,V.J)(r):void 0;try{(0,Z.c)(t);let r="bigint"==typeof n?(0,u.cK)(n):void 0,b=e.chain?.formatters?.transactionRequest?.format,w=(b||Y.Bv)({...(0,J.o)(m,{format:b}),account:g,blobs:s,data:a,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:f,maxPriorityFeePerGas:h,to:p,value:y},"createAccessList"),v=await e.request({method:"eth_createAccessList",params:[w,r||i]});if(v.error)throw new d.C(v.error,{details:v.error});return{accessList:v.accessList,gasUsed:BigInt(v.gasUsed)}}catch(r){throw(0,G.d)(r,{...t,account:g,chain:e.chain})}}function X(e,{method:t}){let r={};return"fallback"===e.transport.type&&e.transport.onResponse?.(({method:e,response:n,status:i,transport:s})=>{"success"===i&&t===e&&(r[n]=s.request)}),t=>r[t]||e.request}async function ee(e){let t=X(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}var et=r(45897);class er extends d.C{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}var en=r(43024),ei=r(15678),es=r(21394),ea=r(63547);let eo="/docs/contract/encodeEventTopics";function el(e){let{abi:t,eventName:r,args:n}=e,i=t[0];if(r){let e=(0,ea.iY)({abi:t,name:r});if(!e)throw new et.M_(r,{docsPath:eo});i=e}if("event"!==i.type)throw new et.M_(void 0,{docsPath:eo});let s=[];if(n&&"inputs"in i){let e=i.inputs?.filter(e=>"indexed"in e&&e.indexed),t=Array.isArray(n)?n:Object.values(n).length>0?e?.map(e=>n[e.name])??[]:[];t.length>0&&(s=e?.map((e,r)=>Array.isArray(t[r])?t[r].map((n,i)=>ec({param:e,value:t[r][i]})):void 0!==t[r]&&null!==t[r]?ec({param:e,value:t[r]}):null)??[])}if(i.anonymous)return s;let a=(0,es.B)(i);return[(0,en.h)(a),...s]}function ec({param:e,value:t}
279){if("string"===e.type||"bytes"===e.type)return(0,g.S)((0,m.ZJ)(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new er(e.type);return(0,ei.h)([e],[t])}async function eu(e,t){let{address:r,abi:n,args:i,eventName:s,fromBlock:a,strict:o,toBlock:l}=t,c=X(e,{method:"eth_newFilter"}),d=s?el({abi:n,args:i,eventName:s}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:"bigint"==typeof a?(0,u.cK)(a):a,toBlock:"bigint"==typeof l?(0,u.cK)(l):l,topics:d}]});return{abi:n,args:i,eventName:s,id:f,request:c(f),strict:!!o,type:"event"}}async function ed(e,{address:t,args:r,event:n,events:i,fromBlock:s,strict:a,toBlock:o}={}){let l=i??(n?[n]:void 0),c=X(e,{method:"eth_newFilter"}),d=[];l&&(d=[l.flatMap(e=>el({abi:[e],eventName:e.name,args:r}))],n&&(d=d[0]));let f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof s?(0,u.cK)(s):s,toBlock:"bigint"==typeof o?(0,u.cK)(o):o,...d.length?{topics:d}:{}}]});return{abi:l,args:r,eventName:n?n.name:void 0,fromBlock:s,id:f,request:c(f),strict:!!a,toBlock:o,type:"event"}}async function ef(e){let t=X(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}var eh=r(34172),ep=r(90892),ey=r(3901),em=r(58239),eg=r(64233),eb=r(11692);async function ew(e,{address:t,blockHash:r,blockNumber:a,blockTag:o=e.experimental_blockTag??"latest",requireCanonical:l}){let c=(0,eb.O)({blockHash:r,blockNumber:a,blockTag:o,requireCanonical:l});if(e.batch?.multicall&&e.chain?.contracts?.multicall3){let c=e.chain.contracts.multicall3.address,u=(0,s.p)({abi:n.v2,functionName:"getEthBalance",args:[t]}),{data:d}=await (0,_.T)(e,K.T,"call")({to:c,data:u,blockHash:r,blockNumber:a,blockTag:o,requireCanonical:l});return(0,i.e)({abi:n.v2,functionName:"getEthBalance",args:[t],data:d||"0x"})}return BigInt(await e.request({method:"eth_getBalance",params:[t,c]}))}async function ev(e){return BigInt(await e.request({method:"eth_blobBaseFee"}))}var ex=r(42606),e_=r(23458),eE=r(44990),eA=r(17819);async function eI(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest"}={}){let i=void 0!==r?(0,u.cK)(r):void 0,s=await e.request({method:"eth_getBlockReceipts",params:[t||i||n]},{dedupe:!!(t||i)});if(!s)throw new eE.l({blockHash:t,blockNumber:r});let a=e.chain?.formatters?.transactionReceipt?.format||eA.uL;return s.map(e=>a(e,"getBlockReceipts"))}var eC=r(36174);async function eS(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){let i,s=void 0!==r?(0,u.cK)(r):void 0;return i=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||n]},{dedupe:!!s}),(0,eC.ME)(i)}var eP=r(72767),e$=r(4884),ek=r(70968),eT=r(24807);async function eO(e,{address:t,blockHash:r,fromBlock:n,toBlock:i,event:s,events:a,args:o,strict:l}={}){let c=a??(s?[s]:void 0),d=[];c&&(d=[c.flatMap(e=>el({abi:[e],eventName:e.name,args:a?void 0:o}))],s&&(d=d[0]));let f=(r?await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:"bigint"==typeof n?(0,u.cK)(n):n,toBlock:"bigint"==typeof i?(0,u.cK)(i):i}]})).map(e=>(0,eT.e)(e));return c?(0,ek.p)({abi:c,args:o,logs:f,strict:l??!1}):f}async function eN(e,t){let{abi:r,address:n,args:i,blockHash:s,eventName:a,fromBlock:o,toBlock:l,strict:c}=t,u=a?(0,ea.iY)({abi:r,name:a}):void 0,d=u?void 0:r.filter(e=>"event"===e.type);return(0,_.T)(e,eO,"getLogs")({address:n,args:i,blockHash:s,event:u,events:d,fromBlock:o,toBlock:l,strict:c})}var eR=r(22744);async function eB(e,{address:t,blockNumber:r,blockTag:n="latest"}){let i=await (0,e$.Q)(e,{address:t,...void 0!==r?{blockNumber:r}:{blockTag:n}});if(i&&23===(0,l.E)(i)&&i.startsWith("0xef0100"))return(0,a.b)((0,eR.di)(i,3,23))}class eD extends d.C{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function eM(e,t){let{address:r,factory:n,factoryData:i}=t;try{let[t,s,a,o,l,c,u]=await (0,_.T)(e,E.J,"readContract")({abi:eU,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:s,version:a,chainId:Number(o),verifyingContract:l,salt:c},extensions:u,fields:t}}catch(e){if("ContractFunctionExecutionError"===e.name&&"ContractFunctionZeroDataError"===e.cause.name)throw new eD({address:r});throw e}}let eU=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];async function ej(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){var s;let a="bigint"==typeof r?(0,u.cK)(r):void 0;return{baseFeePerGas:(s=await e.request({method:"eth_feeHistory",params:[(0,u.cK)(t),a||n,i]},{dedupe:!!a})).baseFeePerGas.map(e=>BigInt(e)),gasUsedRatio:s.gasUsedRatio,oldestBlock:BigInt(s.oldestBlock),reward:s.reward?.map(e=>e.map(e=>BigInt(e)))}}async function eL(e,{filter:t}){let r="strict"in t&&t.strict,n=await t.request({method:"eth_getFilterChanges",params:[t.id]});if("string"==typeof n[0])return n;let i=n.map(e=>(0,eT.e)(e));return"abi"in t&&t.abi?(0,ek.p)({abi:t.abi,logs:i,strict:r}):i}async function eF(e,{filter:t}){let r=t.strict??!1,n=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(e=>(0,eT.e)(e));return t.abi?(0,ek.p)({abi:t.abi,logs:n,strict:r}):n}var ez=r(55035);async function eq(e,{address:t,blockHash:r,blockNumber:n,blockTag:i="latest",requireCanonical:s,storageKeys:a}){let o=(0,eb.O)({blockHash:r,blockNumber:n,blockTag:i,requireCanonical:s});var l=await e.request({method:"eth_getProof",params:[t,a,o]});return{...l,balance:l.balance?BigInt(l.balance):void 0,nonce:l.nonce?(0,eC.ME)(l.nonce):void 0,storageProof:l.storageProof?l.storageProof.map(e=>
279({...e,value:BigInt(e.value)})):void 0}}var eW=r(66471);async function eH(e,{hash:t}){let r=await e.request({method:"eth_getRawTransactionByHash",params:[t]},{dedupe:!0});if(!r)throw new eW.Kz({hash:t});return r}async function eK(e,{address:t,blockHash:r,blockNumber:n,blockTag:i="latest",requireCanonical:s,slot:a}){let o=(0,eb.O)({blockHash:r,blockNumber:n,blockTag:i,requireCanonical:s});return await e.request({method:"eth_getStorageAt",params:[t,a,o]})}var eV=r(10199);async function eG(e,{hash:t,transactionReceipt:r}){let[n,i]=await Promise.all([(0,_.T)(e,e_.G,"getBlockNumber")({}),t?(0,_.T)(e,eV.x,"getTransaction")({hash:t}):void 0]),s=r?.blockNumber||i?.blockNumber;return s?n-s+1n:0n}var eJ=r(12934),eY=r(77045),eZ=r(37720),eQ=r(38519),eX=r(82778),e0=r(97314);async function e1(e,t){let{account:r,authorizationList:a,allowFailure:l=!0,blockHash:c,blockNumber:u,blockOverrides:h,blockTag:p,requireCanonical:y,stateOverride:m}=t,g=t.contracts,b="object"==typeof e.batch?.multicall?e.batch.multicall:{},w=t.batchSize??b.batchSize??1024,v=t.deployless??b.deployless??!1,x=(()=>{if(t.multicallAddress)return t.multicallAddress;if(v)return null;if(e.chain)return(0,o.M)({blockNumber:u,chain:e.chain,contract:"multicall3"});throw Error("client chain not configured. multicallAddress is required.")})(),A=[[]],I=0,C=0;for(let e=0;e<g.length;e++){let{abi:t,address:n,args:i,functionName:a}=g[e];try{let e=(0,s.p)({abi:t,args:i,functionName:a});C+=(e.length-2)/2,w>0&&C>w&&A[I].length>0&&(I++,C=(e.length-2)/2,A[I]=[]),A[I]=[...A[I],{allowFailure:!0,callData:e,target:n}]}catch(s){let e=(0,eQ.j)(s,{abi:t,address:n,args:i,docsPath:"/docs/contract/multicall",functionName:a,sender:r});if(!l)throw e;A[I]=[...A[I],{allowFailure:!0,callData:"0x",target:n}]}}let S=!!e.batch?.multicall,P=S?A.flatMap(e=>e.map(e=>[e])):A,$=await Promise.allSettled(P.map(t=>S?e2(e,{account:r,authorizationList:a,batchSize:w,blockHash:c,blockNumber:u,blockOverrides:h,blockTag:p,call:t[0],multicallAddress:x,requireCanonical:y,stateOverride:m}).then(e=>[e]):(0,_.T)(e,E.J,"readContract")({...null===x?{code:eZ.Ez}:{address:x},abi:n.v2,account:r,args:[t],authorizationList:a,blockHash:c,blockNumber:u,blockOverrides:h,blockTag:p,functionName:"aggregate3",requireCanonical:y,stateOverride:m}))),k=[];for(let e=0;e<$.length;e++){let t=$[e];if("rejected"===t.status){if(!l)throw t.reason;for(let r=0;r<P[e].length;r++)k.push({status:"failure",error:t.reason,result:void 0});continue}let r=t.value;for(let t=0;t<r.length;t++){let{returnData:n,success:s}=r[t],{callData:a}=P[e][t],{abi:o,address:c,functionName:u,args:d}=g[k.length];try{if("0x"===a)throw new et.O;if(!s)throw new f.$S({data:n});let e=(0,i.e)({abi:o,args:d,data:n,functionName:u});k.push(l?{result:e,status:"success"}:e)}catch(t){let e=(0,eQ.j)(t,{abi:o,address:c,args:d,docsPath:"/docs/contract/multicall",functionName:u});if(!l)throw e;k.push({error:e,result:void 0,status:"failure"})}}}if(k.length!==g.length)throw new d.C("multicall results mismatch");return k}async function e2(e,t){let{batchSize:r,call:i,multicallAddress:s,...a}=t,{wait:o=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{schedule:l}=(0,eX.u)({id:(0,e0.A)(["multicall",e.uid,r,s,a]),wait:o,shouldSplitBatch:e=>0!==r&&e.reduce((e,{callData:t})=>e+(t.length-2)/2,0)>r,fn:t=>(0,_.T)(e,E.J,"readContract")({...null===s?{code:eZ.Ez}:{address:s},...a,abi:n.v2,args:[t],functionName:"aggregate3"})}),[c]=await l(i);return c}var e5=r(44569),e6=r(31445),e3=r(37289),e8=r(4232),e4=r(61526);async function e9(e,t){let{blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",blocks:a,returnFullTransactions:o,traceTransfers:l,validation:c}=t;try{let t=[];for(let e of a){let r=e.blockOverrides?e5.J(e.blockOverrides):void 0,n=e.calls.map(e=>{let t=e.account?(0,V.J)(e.account):void 0,r=e.abi?(0,s.p)(e):e.data,n={...e,account:t,data:e.dataSuffix?(0,y.xW)([r||"0x",e.dataSuffix]):r,from:e.from??t?.address};return(0,Z.c)(n),(0,Y.Bv)(n)}),i=e.stateOverrides?(0,e4.yH)(e.stateOverrides):void 0;t.push({blockOverrides:r,calls:n,stateOverrides:i})}let d="bigint"==typeof r?(0,u.cK)(r):void 0;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:t,returnFullTransactions:o,traceTransfers:l,validation:c},d||n]})).map((e,t)=>({...(0,e8.$)(e),calls:e.calls.map((e,r)=>{let{abi:n,args:s,functionName:o,to:l}=a[t].calls[r],c=e.error?.data??e.returnData,u=BigInt(e.gasUsed),d=e.logs?.map(e=>(0,eT.e)(e)),h="0x1"===e.status?"success":"failure",p=n&&"success"===h&&"0x"!==c?(0,i.e)({abi:n,data:c,functionName:o}):null,y=(()=>{let e;
vendor: 8,359 bytes, lines 279-280
279if("success"!==h&&("0x"===c?e=new et.O:c&&(e=new f.$S({data:c})),e))return(0,eQ.j)(e,{abi:n??[],address:l??"0x",args:s,functionName:o??"<unknown>"})})();return{data:c,gasUsed:u,logs:d,status:h,..."success"===h?{result:p}:{error:y}}})}))}catch(t){let e=(0,e3.l)(t,{});if(e instanceof e6.RM)throw t;throw e}}var e7=r(16203),te=r(4691),tt=r(62610);function tr(e,t={}){return e7.HT(e,t)}function tn(e,t,r){let n=e7.n1(e,t,r);if("function"!==n.type)throw new e7.m_({name:t,type:"function"});return n}let ti="0x0000000000000000000000000000000000000000";async function ts(e,t){let{blockNumber:r,blockTag:n,calls:i,stateOverrides:a,traceAssetChanges:o,traceTransfers:l,validation:c}=t,u=t.account?(0,V.J)(t.account):void 0;if(o&&!u)throw new d.C("`account` is required when `traceAssetChanges` is true");let f=u?function(...e){let[t,r]=(()=>{if(Array.isArray(e[0])){let[t,r]=e;return[function(e){let t=e.find(e=>"constructor"===e.type);if(!t)throw new e7.m_({name:"constructor"});return t}(t),r]}return e})(),{bytecode:n,args:i}=r;return tt.xW(n,t.inputs?.length&&i?.length?te.lF(t.inputs,i):"0x")}(e7.HT("constructor(bytes, bytes)"),{bytecode:eZ.LX,args:["0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",function(...e){var t;let[r,n=[]]=(()=>{if(Array.isArray(e[0])){let[t,r,n]=e;return[tn(t,r,{args:n}),n]}let[t,r]=e;return[t,r]})(),{overloads:i}=r,s=i?tn([r,...i],r.name,{args:n}):r,a=(t=s,e7.go(t)),o=n.length>0?te.lF(s.inputs,n):void 0;return o?tt.xW(a,o):a}(tr("function getBalance(address)"),[u.address])]}):void 0,h=o?await Promise.all(t.calls.map(async t=>{if(!t.data&&!t.abi)return;let{accessList:r}=await Q(e,{account:u.address,...t,data:t.abi?(0,s.p)(t):t.data});return r.map(({address:e,storageKeys:t})=>t.length>0?e:null)})).then(e=>e.flat().filter(Boolean)):[],p=await e9(e,{blockNumber:r,blockTag:n,blocks:[...o?[{calls:[{data:f}],stateOverrides:a},{calls:h.map((e,t)=>({abi:[tr("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:ti,nonce:t})),stateOverrides:[{address:ti,nonce:0}]}]:[],{calls:[...i,{to:ti}].map(e=>({...e,from:u?.address})),stateOverrides:a},...o?[{calls:[{data:f}]},{calls:h.map((e,t)=>({abi:[tr("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:ti,nonce:t})),stateOverrides:[{address:ti,nonce:0}]},{calls:h.map((e,t)=>({to:e,abi:[tr("function decimals() returns (uint256)")],functionName:"decimals",from:ti,nonce:t})),stateOverrides:[{address:ti,nonce:0}]},{calls:h.map((e,t)=>({to:e,abi:[tr("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:ti,nonce:t})),stateOverrides:[{address:ti,nonce:0}]},{calls:h.map((e,t)=>({to:e,abi:[tr("function symbol() returns (string)")],functionName:"symbol",from:ti,nonce:t})),stateOverrides:[{address:ti,nonce:0}]}]:[]],traceTransfers:l,validation:c}),y=o?p[2]:p[0],[m,g,,b,w,v,x,_]=o?p:[],{calls:E,...A}=y,I=E.slice(0,-1)??[],C=[...m?.calls??[],...g?.calls??[]].map(e=>"success"===e.status?(0,eC.uU)(e.data):null),S=[...b?.calls??[],...w?.calls??[]].map(e=>"success"===e.status?(0,eC.uU)(e.data):null),P=(v?.calls??[]).map(e=>"success"===e.status?e.result:null),$=(_?.calls??[]).map(e=>"success"===e.status?e.result:null),k=(x?.calls??[]).map(e=>"success"===e.status?e.result:null),T=[];for(let[e,t]of S.entries()){let r=C[e];if("bigint"!=typeof t||"bigint"!=typeof r)continue;let n=P[e-1],i=$[e-1],s=k[e-1],a=0===e?{address:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",decimals:18,symbol:"ETH"}:{address:h[e-1],decimals:s||n?Number(n??1):void 0,symbol:i??void 0};T.some(e=>e.token.address===a.address)||T.push({token:a,value:{pre:r,post:t,diff:t-r}})}return{assetChanges:T,block:A,results:I}}var ta=r(79239);async function to(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}var tl=r(57572);function tc(e,t){return(0,g.S)(function(e){let t="string"==typeof e?(0,u.i3)(e):"string"==typeof e.raw?e.raw:(0,u.My)(e.raw),r=(0,u.i3)(`\x19Ethereum Signed Message:
280${(0,l.E)(t)}`);return(0,y.xW)([r,t])}(e),t)}async function tu(e,{address:t,message:r,factory:n,factoryData:i,signature:s,...a}){let o=tc(r);return(0,_.T)(e,tl.KK,"verifyHash")({address:t,factory:n,factoryData:i,hash:o,signature:s,...a})}var td=r(93473);function tf({data:e,primaryType:t,types:r}){let n=function e({data:t,primaryType:r,types:n}){let i=[{type:"bytes32"}],s=[function({primaryType:e,types:t}){let r=(0,u.nj)(function({primaryType:e,types:t}){let r="",n=function e({primaryType:t,types:r},n=new Set){let i=t.match(/^\w*/u),s=i?.[0];if(n.has(s)||void 0===r[s])return n;for(let t of(n.add(s),r[s]))e({primaryType:t.type,types:r},n);return n}({primaryType:e,types:t});for(let i of(n.delete(e),[e,...Array.from(n).sort()]))r+=`${i}(${t[i].map(({name:e,type:t})=>`${t} ${e}`).join(",")})`;return r}({primaryType:e,types:t}));return(0,g.S)(r)}({primaryType:r,types:n})];for(let a of n[r]){let[r,o]=function t({types:r,name:n,type:i,value:s}){if(void 0!==r[i])return[{type:"bytes32"},(0,g.S)(e({data:s,primaryType:i,types:r}))];if("bytes"===i)return[{type:"bytes32"},(0,g.S)(s)];if("string"===i)return[{type:"bytes32"},(0,g.S)((0,u.nj)(s))];if(i.lastIndexOf("]")===i.length-1){let e=i.slice(0,i.lastIndexOf("[")),a=s.map(i=>t({name:n,type:e,types:r,value:i}));return[{type:"bytes32"},(0,g.S)((0,ei.h)(a.map(([e])=>e),a.map(([,e])=>e)))]}return[{type:i},s]}({types:n,name:a.name,type:a.type,value:t[a.name]});i.push(r),s.push(o)}return(0,ei.h)(i,s)}({data:e,primaryType:t,types:r});return(0,g.S)(n)}async function th(e,t){let{address:r,factory:n,factoryData:i,signature:s,message:a,primaryType:o,types:l,domain:c,...u}=t,d=function(e){let{domain:t={},message:r,primaryType:n}=e,i={EIP712Domain:(0,td.H4)({domain:t}),...e.types};(0,td.$$)({domain:t,message:r,primaryType:n,types:i});let s=["0x1901"];return t&&s.push(function({domain:e,types:t}){return tf({data:e,primaryType:"EIP712Domain",types:t})}({domain:t,types:i})),"EIP712Domain"!==n&&s.push(tf({data:r,primaryType:n,types:i})),(0,g.S)((0,y.xW)(s))}({message:a,primaryType:o,types:l,domain:c});return(0,_.T)(e,tl.KK,"verifyHash")({address:r,factory:n,factoryData:i,hash:d,signature:s,...u})}var tp=r(2829),ty=r(97994),tm=r(42375),tg=r(82804),tb=r(69064),tw=r(19142);let tv=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,tx=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;var t_=r(60336),tE=r(2452);async function tA(e,t){let{address:r,domain:n,message:i,nonce:s,scheme:a,signature:o,time:l=new Date,...c}=t,u=function(e){let{scheme:t,statement:r,...n}=e.match(tv)?.groups??{},{chainId:i,expirationTime:s,issuedAt:a,notBefore:o,requestId:l,...c}=e.match(tx)?.groups??{},u=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...n,...c,...i?{chainId:Number(i)}:{},...s?{expirationTime:new Date(s)}:{},...a?{issuedAt:new Date(a)}:{},...o?{notBefore:new Date(o)}:{},...l?{requestId:l}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}(i);if(!u.address||!function(e){let{address:t,domain:r,message:n,nonce:i,scheme:s,time:a=new Date}=e;if(r&&n.domain!==r||i&&n.nonce!==i||s&&n.scheme!==s||n.expirationTime&&a>=n.expirationTime||n.notBefore&&a<n.notBefore)return!1;try{if(!n.address||!(0,t_.P)(n.address,{strict:!1})||t&&!(0,tE.h)(n.address,t))return!1}catch{return!1}return!0}
280({address:r,domain:n,message:u,nonce:s,scheme:a,time:l}))return!1;let d=tc(i);return(0,tl.KK)(e,{address:u.address,hash:d,signature:o,...c})}var tI=r(42783);async function tC(e,t){let{account:r,decimals:n,spender:i,token:s,...a}=t,[o,{decimals:l}]=await Promise.all([(0,E.J)(e,{...a,...tC.call(e,{account:r,spender:i,token:s})}),(0,tI.ov)(e,{decimals:n,token:s})]);return(0,tI.cP)(o,l)}(tC||(tC={})).call=function(e,t){return(0,tI.mj)({address:(0,tI.E7)(e,t).address,abi:n.xw,functionName:"allowance",args:[t.account,t.spender]})};var tS=r(23536);async function tP(e,t){let{account:r=e.account,decimals:n,token:i,...s}=t;if(!r)throw new tS.T;let a=(0,V.J)(r).address,[o,{decimals:l}]=await Promise.all([(0,E.J)(e,{...s,...tP.call(e,{account:a,token:i})}),(0,tI.ov)(e,{decimals:n,token:i})]);return(0,tI.cP)(o,l)}async function t$(e,t){let{token:r,...i}=t,{address:s}=(0,tI.E7)(e,{token:r}),a=(0,tI.nh)(e,r),[o,l,c]=await Promise.all([a?.decimals??(0,E.J)(e,{...i,abi:n.xw,address:s,functionName:"decimals"}),a?.name??(0,E.J)(e,{...i,abi:n.xw,address:s,functionName:"name"}),a?.symbol??(0,E.J)(e,{...i,abi:n.xw,address:s,functionName:"symbol"})]);return{decimals:o,name:l,symbol:c}}async function tk(e,t){let{decimals:r,token:n,...i}=t,[s,{decimals:a}]=await Promise.all([(0,E.J)(e,{...i,...tk.call(e,{token:n})}),(0,tI.ov)(e,{decimals:r,token:n})]);return(0,tI.cP)(s,a)}(tP||(tP={})).call=function(e,t){let r=t.account??e.account;if(!r)throw new tS.T;let i=(0,V.J)(r).address;return(0,tI.mj)({address:(0,tI.E7)(e,t).address,abi:n.xw,functionName:"balanceOf",args:[i]})},(tk||(tk={})).call=function(e,t){return(0,tI.mj)({address:(0,tI.E7)(e,t).address,abi:n.xw,args:[],functionName:"totalSupply"})};var tT=r(81655),tO=r(35107),tN=r(55464),tR=r(46501);function tB(e){var t;return{call:t=>(0,K.T)(e,t),createAccessList:t=>Q(e,t),createBlockFilter:()=>ee(e),createContractEventFilter:t=>eu(e,t),createEventFilter:t=>ed(e,t),createPendingTransactionFilter:()=>ef(e),estimateContractGas:t=>(0,eh.W)(e,t),estimateGas:t=>(0,ey.Q)(e,t),getBalance:t=>ew(e,t),getBlobBaseFee:()=>ev(e),getBlock:t=>(0,ex.g)(e,t),getBlockNumber:t=>(0,e_.G)(e,t),getBlockReceipts:t=>eI(e,t),getBlockTransactionCount:t=>eS(e,t),getBytecode:t=>(0,e$.Q)(e,t),getChainId:()=>(0,eP.T)(e),getCode:t=>(0,e$.Q)(e,t),getContractEvents:t=>eN(e,t),getDelegation:t=>eB(e,t),getEip712Domain:t=>eM(e,t),getEnsAddress:t=>A(e,t),getEnsAvatar:t=>q(e,t),getEnsName:t=>W(e,t),getEnsResolver:t=>H(e,t),getEnsText:t=>z(e,t),getFeeHistory:t=>ej(e,t),estimateFeesPerGas:t=>(0,ep._)(e,t),getFilterChanges:t=>eL(e,t),getFilterLogs:t=>eF(e,t),getGasPrice:()=>(0,ez.L)(e),getLogs:t=>eO(e,t),getProof:t=>eq(e,t),estimateMaxPriorityFeePerGas:t=>(0,em.b)(e,t),fillTransaction:t=>(0,eg.a)(e,t),getRawTransaction:t=>eH(e,t),getStorageAt:t=>eK(e,t),getTransaction:t=>(0,eV.x)(e,t),getTransactionConfirmations:t=>eG(e,t),getTransactionCount:t=>(0,eJ.y)(e,t),getTransactionReceipt:t=>(0,eY.h)(e,t),multicall:t=>e1(e,t),prepareTransactionRequest:t=>(0,tT.ft)(e,t),readContract:t=>(0,E.J)(e,t),sendRawTransaction:t=>(0,tO.L)(e,t),sendRawTransactionSync:t=>(0,tN.s)(e,t),simulate:t=>e9(e,t),simulateBlocks:t=>e9(e,t),simulateCalls:t=>ts(e,t),simulateContract:t=>(0,ta.v)(e,t),verifyHash:t=>(0,tl.KK)(e,t),verifyMessage:t=>tu(e,t),verifySiweMessage:t=>tA(e,t),verifyTypedData:t=>th(e,t),uninstallFilter:t=>to(e,t),waitForTransactionReceipt:t=>(0,tp.n)(e,t),watchBlocks:t=>(function(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:a,poll:o,pollingInterval:l=e.pollingInterval}){let c,u,d,f,h=void 0!==o?o:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
280onfig.type&&"ipc"!==e.transport.transports[0].config.type),p=a??!1;return h?(()=>{let a=(0,e0.A)(["watchBlocks",e.uid,t,r,n,p,l]);return(0,tm.lB)(a,{onBlock:i,onError:s},i=>(0,tg.w)(async()=>{try{let n=await (0,_.T)(e,ex.g,"getBlock")({blockTag:t,includeTransactions:p});if(null!==n.number&&c?.number!=null){if(n.number===c.number)return;if(n.number-c.number>1&&r)for(let t=c?.number+1n;t<n.number;t++){let r=await (0,_.T)(e,ex.g,"getBlock")({blockNumber:t,includeTransactions:p});i.onBlock(r,c),c=r}}(c?.number==null||"pending"===t&&n?.number==null||null!==n.number&&n.number>c.number)&&(i.onBlock(n,c),c=n)}catch(e){i.onError?.(e)}},{emitOnBegin:n,interval:l}))})():(u=!0,d=!0,f=()=>u=!1,(async()=>{try{n&&(0,_.T)(e,ex.g,"getBlock")({blockTag:t,includeTransactions:p}).then(e=>{u&&d&&(i(e,void 0),d=!1)}).catch(s);let r=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:a}=await r.subscribe({params:["newHeads"],async onData(t){if(!u)return;let r=await (0,_.T)(e,ex.g,"getBlock")({blockNumber:t.result?.number,includeTransactions:p}).catch(()=>{});u&&(i(r,c),d=!1,c=r)},onError(e){s?.(e)}});f=a,u||f()}catch(e){s?.(e)}})(),()=>f())})(e,t),watchBlockNumber:t=>(0,ty.q)(e,t),watchContractEvent:t=>(function(e,t){let{abi:r,address:n,args:i,batch:s=!0,eventName:a,fromBlock:o,onError:l,onLogs:c,poll:u,pollingInterval:d=e.pollingInterval,strict:f}=t;return(void 0!==u?u:"bigint"==typeof o||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
280onfig.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{let t=f??!1,u=(0,e0.A)(["watchContractEvent",n,i,s,e.uid,a,d,t,o]);return(0,tm.lB)(u,{onLogs:c,onError:l},l=>{let c,u;void 0!==o&&(c=o-1n);let f=!1,h=(0,tg.w)(async()=>{if(!f){try{u=await (0,_.T)(e,eu,"createContractEventFilter")({abi:r,address:n,args:i,eventName:a,strict:t,fromBlock:o})}catch{}f=!0;return}try{let o;if(u)o=await (0,_.T)(e,eL,"getFilterChanges")({filter:u});else{let s=await (0,_.T)(e,e_.G,"getBlockNumber")({});o=c&&c<s?await (0,_.T)(e,eN,"getContractEvents")({abi:r,address:n,args:i,eventName:a,fromBlock:c+1n,toBlock:s,strict:t}):[],c=s}if(0===o.length)return;if(s)l.onLogs(o);else for(let e of o)l.onLogs([e])}catch(e){u&&e instanceof tb.Di&&(f=!1),l.onError?.(e)}},{emitOnBegin:!0,interval:d});return async()=>{u&&await (0,_.T)(e,to,"uninstallFilter")({filter:u}),h()}})})():(()=>{let t=(0,e0.A)(["watchContractEvent",n,i,s,e.uid,a,d,f??!1]),o=!0,u=()=>o=!1;return(0,tm.lB)(t,{onLogs:c,onError:l},t=>((async()=>{try{let s=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),l=a?el({abi:r,eventName:a,args:i}):[],{unsubscribe:c}=await s.subscribe({params:["logs",{address:n,topics:l}],onData(e){if(!o)return;let n=e.result;try{let{eventName:e,args:i}=(0,tw.j)({abi:r,data:n.data,topics:n.topics,strict:f}),s=(0,eT.e)(n,{args:i,eventName:e});t.onLogs([s])}catch(s){let e,r;if(s instanceof et.fo||s instanceof et.l3){if(f)return;e=s.abiItem.name,r=s.abiItem.inputs?.some(e=>!("name"in e&&e.name))}let i=(0,eT.e)(n,{args:r?[]:{},eventName:e});t.onLogs([i])}},onError(e){t.onError?.(e)}});u=c,o||u()}catch(e){l?.(e)}})(),()=>u()))})()})(e,t),watchEvent:t=>(function(e,{address:t,args:r,batch:n=!0,event:i,events:s,fromBlock:a,onError:o,onLogs:l,poll:c,pollingInterval:u=e.pollingInterval,strict:d}){let f,h,p=void 0!==c?c:"bigint"==typeof a||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
280onfig.type&&"ipc"!==e.transport.transports[0].config.type),y=d??!1;return p?(()=>{let c=(0,e0.A)(["watchEvent",t,r,n,e.uid,i,u,a]);return(0,tm.lB)(c,{onLogs:l,onError:o},o=>{let l,c;void 0!==a&&(l=a-1n);let d=!1,f=(0,tg.w)(async()=>{if(!d){try{c=await (0,_.T)(e,ed,"createEventFilter")({address:t,args:r,event:i,events:s,strict:y,fromBlock:a})}catch{}d=!0;return}try{let a;if(c)a=await (0,_.T)(e,eL,"getFilterChanges")({filter:c});else{let n=await (0,_.T)(e,e_.G,"getBlockNumber")({});a=l&&l!==n?await (0,_.T)(e,eO,"getLogs")({address:t,args:r,event:i,events:s,fromBlock:l+1n,toBlock:n}):[],l=n}if(0===a.length)return;if(n)o.onLogs(a);else for(let e of a)o.onLogs([e])}catch(e){c&&e instanceof tb.Di&&(d=!1),o.onError?.(e)}},{emitOnBegin:!0,interval:u});return async()=>{c&&await (0,_.T)(e,to,"uninstallFilter")({filter:c}),f()}})})():(f=!0,h=()=>f=!1,(async()=>{try{let n=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),a=s??(i?[i]:void 0),c=[];a&&(c=[a.flatMap(e=>el({abi:[e],eventName:e.name,args:r}))],i&&(c=c[0]));let{unsubscribe:u}=await n.subscribe({params:["logs",{address:t,topics:c}],onData(e){if(!f)return;let t=e.result;try{let{eventName:e,args:r}=(0,tw.j)({abi:a??[],data:t.data,topics:t.topics,strict:y}),n=(0,eT.e)(t,{args:r,eventName:e});l([n])}catch(i){let e,r;if(i instanceof et.fo||i instanceof et.l3){if(d)return;e=i.abiItem.name,r=i.abiItem.inputs?.some(e=>!("name"in e&&e.name))}let n=(0,eT.e)(t,{args:r?[]:{},eventName:e});l([n])}},onError(e){o?.(e)}});h=u,f||h()}catch(e){o?.(e)}})(),()=>h())})(e,t),watchPendingTransactions:t=>(function(e,{batch:t=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=e.pollingInterval}){let a,o;return(void 0!==i?i:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type)?(()=>{let i=(0,e0.A)(["watchPendingTransactions",e.uid,t,s]);return(0,tm.lB)(i,{onTransactions:n,onError:r},r=>{let n,i=(0,tg.w)(async()=>{try{if(!n)try{n=await (0,_.T)(e,ef,"createPendingTransactionFilter")({});return}catch(e){throw i(),e}let s=await (0,_.T)(e,eL,"getFilterChanges")({filter:n});if(0===s.length)return;if(t)r.onTransactions(s);else for(let e of s)r.onTransactions([e])}catch(e){r.onError?.(e)}},{emitOnBegin:!0,interval:s});return async()=>{n&&await (0,_.T)(e,to,"uninstallFilter")({filter:n}),i()}})})():(a=!0,o=()=>a=!1,(async()=>{try{let{unsubscribe:t}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!a)return;let t=e.result;n([t])},onError(e){r?.(e)}});o=t,a||o()}catch(e){r?.(e)}})(),()=>o())})(e,t),token:(t=e,{getAllowance:(0,tR.Ai)(t,tC),getBalance:(0,tR.Ai)(t,tP),getMetadata:(0,tR.Ai)(t,t$),getTotalSupply:(0,tR.Ai)(t,tk)})}}},70947:(e,t,r)=>{"use strict";r.d(t,{A:()=>b,V:()=>b});var n=r(66277),i=r(59395),s=r.n(i),a=r(95912),o=r(71345),l=Object.defineProperty,c=Object.defineProperties,u=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,p=(e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t)=>{for(var r in t||(t={}))f.call(t,r)&&p(e,r,t[r]);if(d)for(var r of d(t))h.call(t,r)&&p(e,r,t[r]);return e},m=(e,t)=>c(e,u(t));let g={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class b{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new n.EventEmitter,this.isAvailable=!1,this.registering=!1,!(0,o.isHttpUrl)(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{let t=(0,a.h)(e),r=await (await s()(this.url,m(y({},g),{body:t}))).json();this.onPayload({data:r})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!(0,o.isHttpUrl)(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>
280{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(Error("HTTP connection is missing or invalid"));e()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){let t=(0,a.h)({id:1,jsonrpc:"2.0",method:"test",params:[]});await s()(e,m(y({},g),{body:t}))}this.onOpen()}catch(t){let e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?(0,a.j)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),n=r.message||r.toString(),i=(0,o.formatJsonRpcError)(e,n);this.events.emit("payload",i)}parseError(e,t=this.url){return(0,o.parseConnectionError)(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}},70968:(e,t,r)=>{"use strict";r.d(t,{p:()=>c});var n=r(2452),i=r(32579),s=r(24807),a=r(84413),o=r(43024),l=r(19142);function c(e){let{abi:t,args:r,logs:c,strict:u=!0}=e,d=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),f=t.filter(e=>"event"===e.type).map(e=>({abi:e,selector:(0,o.h)(e)}));return c.map(e=>{let t,o,c="string"==typeof e.blockNumber?(0,s.e)(e):e,h=f.filter(e=>c.topics[0]===e.selector);if(0===h.length)return null;for(let e of h)try{t=(0,l.j)({...c,abi:[e.abi],strict:!0}),o=e;break}catch{}if(!t&&!u){o=h[0];try{t=(0,l.j)({data:c.data,topics:c.topics,abi:[o.abi],strict:!1})}catch{let e=o.abi.inputs?.some(e=>!("name"in e&&e.name));return{...c,args:e?[]:{},eventName:o.abi.name}}}return t&&o&&(!d||d.includes(t.eventName))&&function(e){let{args:t,inputs:r,matchArgs:s}=e;if(!s)return!0;if(!t)return!1;function o(e,t,r){try{if("address"===e.type)return(0,n.h)(t,r);if("string"===e.type||"bytes"===e.type)return(0,a.S)((0,i.ZJ)(t))===r;return t===r}catch{return!1}}return Array.isArray(t)&&Array.isArray(s)?s.every((e,n)=>{if(null==e)return!0;let i=r[n];return!!i&&(Array.isArray(e)?e:[e]).some(e=>o(i,e,t[n]))}):!("object"!=typeof t||Array.isArray(t)||"object"!=typeof s||Array.isArray(s))&&Object.entries(s).every(([e,n])=>{if(null==n)return!0;let i=r.find(t=>t.name===e);return!!i&&(Array.isArray(n)?n:[n]).some(r=>o(i,r,t[e]))})}({args:t.args,inputs:o.abi.inputs,matchArgs:r})?{...t,...c}:null}).filter(Boolean)}},71151:(e,t,r)=>{"use strict";r.d(t,{T:()=>S});var n=r(97),i=r(39613),s=r(68229);function a(e){let t=(0,i.e)(e),r=[],a=e.length;for(let i=0;i<a;i++){let a=e[i];(0,n.WL)(a)||r.push((0,s.uT)(a,t))}return r}var o=r(44569),l=r(97352),c=r(28266),u=r(37720),d=r(15520),f=r(97282),h=r(48241),p=r(86326),y=r(74889),m=r(29171),g=r(72693),b=r(2452),w=r(11692),v=r(87664),x=r(24393),_=r(62276),E=r(23274),A=r(82778),I=r(61526),C=r(94383);async function S(e,t){let{account:n=e.account,authorizationList:i,batch:s=!!e.batch?.multicall,blockHash:c,blockNumber:y,blockTag:g=e.experimental_blockTag??"latest",requireCanonical:v,accessList:A,blobs:S,blockOverrides:P,code:$,data:N,factory:R,factoryData:B,gas:D,gasPrice:M,maxFeePerBlobGas:U,maxFeePerGas:j,maxPriorityFeePerGas:L,nonce:F,requestOptions:z,to:q,value:W,stateOverride:H,...K}=t,V=n?(0,l.J)(n):void 0;if($&&(R||B))throw new d.C("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if($&&q)throw new d.C("Cannot provide both `code` & `to` as parameters.");let G=$&&N,J=R&&B&&q&&N,Y=G||J,Z=G?O({code:$,data:N}):J?function(e){let{data:t,factory:r,factoryData:n,to:i}=e;return(0,m.m)({abi:a(["constructor(address, bytes, address, bytes)"]),bytecode:u.WN,args:[i,t,r,n]})}({data:N,factory:R,factoryData:B,to:q}):N;try{(0,C.c)(t);let r=(0,w.O)({blockHash:c,blockNumber:y,blockTag:g,requireCanonical:v}),n=P?o.J(P):void 0,a=(0,I.yH)(H),l=e.chain?.formatters?.transactionRequest?.format,u=(l||E.Bv)({...(0,_.o)(K,{format:l}),accessList:A,account:V,authorizationList:i,blobs:S,data:Z,gas:D,gasPrice:M,maxFeePerBlobGas:U,maxFeePerGas:j,maxPriorityFeePerGas:L,nonce:F,to:Y?void 0:q,value:W},"call");if(s&&function({request:e}){let{data:t,to:r,...n}=e;return!(!t||t.startsWith("0x82ad56cb"))&&!!r&&!(Object.values(n).filter(e=>void 0!==e).length>0)}({request:u}
280)&&!n&&void 0===c)try{var Q,X;let{deployless:t=!1}="object"==typeof e.batch?.multicall?e.batch.multicall:{},r=T(e,{blockNumber:y,deployless:t});if(!r||(Q=a,X=r,!(Q&&Object.keys(Q).some(e=>(0,b.h)(e,X)))))return await k(e,{...u,blockHash:c,blockNumber:y,blockTag:g,multicallAddress:r,requestOptions:z,requireCanonical:v,rpcStateOverride:a})}catch(e){if(!(e instanceof f.YE)&&!(e instanceof f.rj))throw e}let d=(()=>{let e=[u,r];return a&&n?[...e,a,n]:a?[...e,a]:n?[...e,{},n]:e})(),h=await e.request({method:"eth_call",params:d},z);if("0x"===h)return{data:void 0};return{data:h}}catch(a){if(z?.signal?.aborted)throw(0,p.TY)(z.signal);if((0,p.zf)(a))throw a;let n=function(e){if(!(e instanceof d.C))return;let t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(a),{offchainLookup:i,offchainLookupSignature:s}=await r.e(407).then(r.bind(r,90407));if(!1!==e.ccipRead&&n?.slice(0,10)===s&&q)return{data:await i(e,{data:n,requestOptions:z,to:q})};if(Y&&n?.slice(0,10)==="0x101bb98d")throw new h.Po({factory:R});throw(0,x.d)(a,{...t,account:V,chain:e.chain})}}let P=0,$=new WeakMap;async function k(e,t){let{batchSize:r=1024,deployless:n=!1,wait:i=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockHash:s,blockNumber:a,blockTag:o=e.experimental_blockTag??"latest",requireCanonical:l,data:d,multicallAddress:f,requestOptions:p,rpcStateOverride:m,to:b}=t,v=void 0!==f?f:T(e,{blockNumber:a,deployless:n}),x=(0,w.O)({blockHash:s,blockNumber:a,blockTag:o,requireCanonical:l}),_="string"==typeof x?x:JSON.stringify(x),E=m?`.${JSON.stringify(m)}`:"",{schedule:I}=(0,A.u)({id:`${e.uid}.${_}.${function(e){if(!e)return"default";let t=$.get(e);if(void 0!==t)return t;let r=P++;return $.set(e,r),r}(p)}${E}`,wait:i,shouldSplitBatch:e=>e.reduce((e,{data:t})=>e+(t.length-2),0)>2*r,fn:async t=>{let r=t.map(e=>({allowFailure:!0,callData:e.data,target:e.to})),n=(0,g.p)({abi:c.v2,args:[r],functionName:"aggregate3"}),i={...null===v?{data:O({code:u.Ez,data:n})}:{to:v,data:n}},s=await e.request({method:"eth_call",params:m?[i,x,m]:[i,x]},p);return(0,y.e)({abi:c.v2,args:[r],functionName:"aggregate3",data:s||"0x"})}}),[{returnData:C,success:S}]=await I({data:d,to:b});if(!S)throw new h.$S({data:C});return"0x"===C?{data:void 0}:{data:C}}function T(e,t){let{blockNumber:r,deployless:n}=t;if(n)return null;if(e.chain)return(0,v.M)({blockNumber:r,chain:e.chain,contract:"multicall3"});throw new f.YE}function O(e){let{code:t,data:r}=e;return(0,m.m)({abi:a(["constructor(bytes, bytes)"]),bytecode:u.LX,args:[t,r]})}},71217:(e,t,r)=>{"use strict";r.d(t,{a:()=>x,b:()=>c,c:()=>v,d:()=>_,e:()=>f,f:()=>u,g:()=>w,h:()=>E,o:()=>b,r:()=>p,s:()=>h});var n=r(7287),i=r(33861),s=r(86786),a=r(40175),o=r(77603);function l(e){return{name:e.metadata?.shortName||e.name||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function c(e,t){let r=l(t);if(n.Fr&&n.m0&&r.universalLink)return g(r.universalLink,e);if(r.deepLink)return m(r.deepLink,e);if(r.universalLink)return g(r.universalLink,e);throw new i.P(`Unsupported wallet ${t.id}`)}function u(e,t){let r=l(t);if(r.universalLink)return g(r.universalLink,e)}let d="WALLETCONNECT_DEEPLINK_CHOICE";function f(){try{localStorage.removeItem(d)}catch{}}function h({href:e,name:t}){try{localStorage.setItem(d,JSON.stringify({href:e,name:t}))}catch{}}function p(){try{localStorage.removeItem(d)}catch{}}function y(e){return e.startsWith("http://")||e.startsWith("https://")}function m(e,t){if(y(e))return g(e,t);let r=e;return r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(t)}`,href:r}}function g(e,t){if(!y(e))return m(e,t);let r=e;return r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(t)}`,href:r}}function b(e,t){window.open(e,t,"noreferrer noopener")}function w(e){return crypto.getRandomValues(new Uint8Array(e))}function v(){return s.l(w(36))}function x(){return v()}async function _(e,t="S256"){if("S256"!=t)return e;{let t=await async function(e){let t=(new TextEncoder).encode(e);return new Uint8Array(await crypto.subtle.digest("SHA-256",t))}(e);return s.l(t)}}function E(){let e=o.s.get(a.f);if(!e)throw new i.P("Authentication error.");return e}},71345:(e,t,r)=>{"use strict";r.d(t,{IJsonRpcProvider:()=>a.kF,formatJsonRpcError:()=>s.dZ,formatJsonRpcRequest:()=>s.e_,formatJsonRpcResult:()=>s.Im,getBigIntRpcId:()=>s.eX,isHttpUrl:()=>
280o.q$,isJsonRpcError:()=>l.U$,isJsonRpcRequest:()=>l.p3,isJsonRpcResponse:()=>l.tq,isJsonRpcResult:()=>l.xT,isLocalhostUrl:()=>o.z,isWsUrl:()=>o.A1,parseConnectionError:()=>n.eF,payloadId:()=>s.ER}),r(44312);var n=r(11287),i=r(58914);r.o(i,"IJsonRpcProvider")&&r.d(t,{IJsonRpcProvider:function(){return i.IJsonRpcProvider}}),r.o(i,"formatJsonRpcError")&&r.d(t,{formatJsonRpcError:function(){return i.formatJsonRpcError}}),r.o(i,"formatJsonRpcRequest")&&r.d(t,{formatJsonRpcRequest:function(){return i.formatJsonRpcRequest}}),r.o(i,"formatJsonRpcResult")&&r.d(t,{formatJsonRpcResult:function(){return i.formatJsonRpcResult}}),r.o(i,"getBigIntRpcId")&&r.d(t,{getBigIntRpcId:function(){return i.getBigIntRpcId}}),r.o(i,"isHttpUrl")&&r.d(t,{isHttpUrl:function(){return i.isHttpUrl}}),r.o(i,"isJsonRpcError")&&r.d(t,{isJsonRpcError:function(){return i.isJsonRpcError}}),r.o(i,"isJsonRpcRequest")&&r.d(t,{isJsonRpcRequest:function(){return i.isJsonRpcRequest}}),r.o(i,"isJsonRpcResponse")&&r.d(t,{isJsonRpcResponse:function(){return i.isJsonRpcResponse}}),r.o(i,"isJsonRpcResult")&&r.d(t,{isJsonRpcResult:function(){return i.isJsonRpcResult}}),r.o(i,"isLocalhostUrl")&&r.d(t,{isLocalhostUrl:function(){return i.isLocalhostUrl}}),r.o(i,"isReactNative")&&r.d(t,{isReactNative:function(){return i.isReactNative}}),r.o(i,"isWsUrl")&&r.d(t,{isWsUrl:function(){return i.isWsUrl}}),r.o(i,"payloadId")&&r.d(t,{payloadId:function(){return i.payloadId}});var s=r(86888),a=r(9865),o=r(92340),l=r(89164)},71441:(e,t,r)=>{"use strict";r.d(t,{J:()=>l});var n=r(74889),i=r(72693),s=r(38519),a=r(12089),o=r(71151);async function l(e,t){let{abi:r,address:l,args:c,functionName:u,...d}=t,f=(0,i.p)({abi:r,args:c,functionName:u});try{let{data:t}=await (0,a.T)(e,o.T,"call")({...d,data:f,to:l});return(0,n.e)({abi:r,args:c,functionName:u,data:t||"0x"})}catch(e){throw(0,s.j)(e,{abi:r,address:l,args:c,docsPath:"/docs/contract/readContract",functionName:u})}}},71525:(e,t,r)=>{"use strict";r.d(t,{o:()=>d});var n=r(99838),i=r(4544),s=r(47450),a=r(70044);let o=new(r(13108)).A(8192);var l=r(96793),c=r(40508),u=r(49655);function d({key:e,methods:t,name:r,request:d,retryCount:f=3,retryDelay:h=150,timeout:p,type:y},m){return{config:{key:e,methods:t,name:r,request:d,retryCount:f,retryDelay:h,timeout:p,type:y},request:function(e,t={}){return async(r,u={})=>{let{dedupe:d=!1,methods:f,retryDelay:h=150,retryCount:p=3,signal:y,uid:m}={...t,...u},{method:g}=r;if(f?.exclude?.includes(g)||f?.include&&!f.include.includes(g))throw new s.ab(Error("method not supported"),{method:g});if(y?.aborted)throw(0,a.TY)(y);let b=d?function(e,t=0){let r=0xdeadbeef^t,n=0x41c6ce57^t;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);r=Math.imul(r^i,0x9e3779b1),n=Math.imul(n^i,0x5f356495)}return r=Math.imul(r^r>>>16,0x85ebca6b)^Math.imul(n^n>>>16,0xc2b2ae35),(0x100000000*(2097151&(n=Math.imul(n^n>>>16,0x85ebca6b)^Math.imul(r^r>>>16,0xc2b2ae35)))+(r>>>0)).toString(36)}(`${m}.${(0,c.A)(r)}`):void 0;return function(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(o.get(r))return o.get(r);let n=e().finally(()=>o.delete(r));return o.set(r,n),n}(()=>(0,l.b)(async()=>{try{return await e(r,y?{signal:y}:void 0)}catch(e){if(y?.aborted)throw(0,a.TY)(y);if((0,a.zf)(e))throw e;switch(e.code){case s.XU.code:throw new s.XU(e);case s.CL.code:throw new s.CL(e);case s.Gi.code:throw new s.Gi(e,{method:r.method});case s.D5.code:throw new s.D5(e);case s.bq.code:throw new s.bq(e);case s.Di.code:throw new s.Di(e);case s.hA.code:throw new s.hA(e);case s.qZ.code:throw new s.qZ(e);case s.YW.code:throw new s.YW(e);case s.ab.code:throw new s.ab(e,{method:r.method});case s.s0.code:throw new s.s0(e);case s.xQ.code:throw new s.xQ(e);case s.vx.code:throw new s.vx(e);case s.sV.code:throw new s.sV(e);case s.Sf.code:throw new s.Sf(e);case s.RV.code:throw new s.RV(e);case s.xq.code:throw new s.xq(e);case s.ch.code:throw new s.ch(e);case s.L5.code:throw new s.L5(e);case s.WT.code:throw new s.WT(e);case s.hl.code:throw new s.hl(e);case s.cg.code:throw new s.cg(e);case s.uL.code:throw new s.uL(e);case s.G1.code:throw new s.G1(e);case s.jz.code:throw new s.jz(e);case 5e3:throw new s.vx(e);case s.nR.code:throw new s.nR(e);default:if(e instanceof n.C)throw e;throw new s.MI(e)}}},{delay:({count:e,error:t})=>{if(t&&t instanceof i.Ci){let e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e,10)}return~~(1<<e)*h},retryCount:p,signal:y,shouldRetry:({error:e})=>{var t;return t=e,!(0,a.zf)(t)&&("code"in t&&"number"==typeof t.code?-1===t.code||t.code===s.s0.code||t.code===s.bq.code||429===t.code:!(t instanceof i.Ci)||!t.status||403===t.status||408===t.status||413===t.status||429===t.status||500===t.status||502===t.status||503===t.status||504===t.status||!1)}}),{enabled:d,id:b})}}(d,{methods:t,retryCount:f,retryDelay:h,uid:(0,u.L)()}),value:m}}},71719:(e,t,r)=>{"use strict";r.d(t,{L:()=>p});var n=r(4544),i=r(99838);class s extends i.C{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}
280var a=r(57952),o=r(70044),l=r(40508);let c={current:0,take(){return this.current++},reset(){this.current=0}};async function u(e,{maxResponseBodySize:t}){if(!1===t)return e.text();let r=e.headers.get("Content-Length");if(r){let e=Number(r);if(e>t)throw new n.f({maxSize:t,size:e})}if(!e.body){let r=await e.text(),i=new TextEncoder().encode(r).length;if(i>t)throw new n.f({maxSize:t,size:i});return r}let i=e.body.getReader(),s=new TextDecoder,a="",o=0;try{for(;;){let{done:e,value:r}=await i.read();if(e)break;if((o+=r.byteLength)>t)throw await i.cancel(),new n.f({maxSize:t,size:o});a+=s.decode(r,{stream:!0})}return a+=s.decode()}finally{i.releaseLock()}}var d=r(71525);let f=0,h=new WeakMap;function p(e,t={}){let{batch:r,fetchFn:i,fetchOptions:y,key:m="http",maxResponseBodySize:g,methods:b,name:w="HTTP JSON-RPC",onFetchRequest:v,onFetchResponse:x,retryDelay:_,raw:E}=t;return({chain:p,retryCount:A,timeout:I})=>{let{batchSize:C=1e3,wait:S=0}="object"==typeof r?r:{},P=t.retryCount??A,$=I??t.timeout??1e4,k=e||p?.rpcUrls.default.http[0];if(!k)throw new s;let T=function(e,t={}){let{url:r,headers:i}=function(e){try{let t=new URL(e),r=(()=>{if(t.username){let e=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(e)}`}}}})();return{url:t.toString(),...r}}catch{return{url:e}}}(e);return{async request(e){let{body:s,fetchFn:a=t.fetchFn??fetch,maxResponseBodySize:d=t.maxResponseBodySize??0xa00000,onRequest:f=t.onRequest,onResponse:h=t.onResponse,timeout:p=t.timeout??1e4}=e,y={...t.fetchOptions??{},...e.fetchOptions??{}},{headers:m,method:g,signal:b}=y;try{let e,t=await function(e,{errorInstance:t=Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let a,l=new AbortController;try{r>0&&(a=setTimeout(()=>{n?l.abort():s(t)},r)),i(await e({signal:l?.signal||null}))}catch(e){if(l?.signal.aborted&&(0,o.zf)(e))return void s(t);s(e)}finally{clearTimeout(a)}})()})}(async({signal:e})=>{let t={...y,body:Array.isArray(s)?(0,l.A)(s.map(e=>({jsonrpc:"2.0",id:e.id??c.take(),...e}))):(0,l.A)({jsonrpc:"2.0",id:s.id??c.take(),...s}),headers:{...i,"Content-Type":"application/json",...m},method:g||"POST",signal:b||(p>0?e:null)},n=new Request(r,t),o=await f?.(n,t)??{...t,url:r};return await a(o.url??r,o)},{errorInstance:new n.MU({body:s,url:r}),timeout:p,signal:!0});h&&await h(t);let w=await u(t,{maxResponseBodySize:d});if(t.headers.get("Content-Type")?.startsWith("application/json"))e=JSON.parse(w);else{e=w;try{e=JSON.parse(e||"{}")}catch(r){if(t.ok)throw r;e={error:e}}}if(!t.ok){if("number"==typeof e.error?.code&&"string"==typeof e.error?.message)return e;throw new n.Ci({body:s,details:(0,l.A)(e.error)||t.statusText,headers:t.headers,status:t.status,url:r})}return e}catch(e){if(b?.aborted)throw(0,o.TY)(b);if((0,o.zf)(e)||e instanceof n.Ci||e instanceof n.f||e instanceof n.MU)throw e;throw new n.Ci({body:s,cause:e,url:r})}}}}(k,{fetchFn:i,fetchOptions:y,maxResponseBodySize:g,onRequest:v,onResponse:x,timeout:$});return(0,d.o)({key:m,methods:b,name:w,async request({method:e,params:t},i){let s={method:e,params:t},o=i?.signal?{signal:i.signal}:void 0,{schedule:l}=(0,a.u)({id:`${k}.${function(e){if(!e)return"default";let t=h.get(e);if(void 0!==t)return t;let r=f++;return h.set(e,r),r}(i?.signal)}`,wait:S,shouldSplitBatch:e=>e.length>C,fn:e=>T.request({body:e,fetchOptions:o}),sort:(e,t)=>e.id-t.id}),c=async e=>r?l(e):[await T.request({body:e,fetchOptions:o})],[{error:u,result:d}]=await c(s);if(E)return{error:u,result:d};if(u)throw new n.J8({body:s,error:u,url:k});return d},retryCount:P,retryDelay:_,timeout:$,type:"http"},{fetchOptions:y,url:k})}}},71782:(e,t,r)=>{"use strict";r.d(t,{J0:()=>b,Kr:()=>v,vJ:()=>w});var n,i,s,a,o=r(72274),l=0,c=[],u=o.fF,d=u.__b,f=u.__r,h=u.diffed,p=u.__c,y=u.unmount,m=u.__;function g(e,t){u.__h&&u.__h(i,e,l||t),l=0;var r=i.__H||(i.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function b(e){return l=1,function(e,t,r){var s=g(n++,2);if(s.t=e,!s.__c&&(s.__=[C(void 0,t),function(e){var t=s.__N?s.__N[0]:s.__[0],r=s.t(t,e);t!==r&&(s.__N=[r,s.__[1]],s.__c.setState({}))}],s.__c=i,!i.u)){var a=function(e,t,r){if(!s.__c.__H)return!0;var n=s.__c.__H.__.filter(function(e){return!!e.__c});if(n.every(function(e){return!e.__N}))return!o||o.call(this,e,t,r);var i=!1;
280return n.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}}),!(!i&&s.__c.props===e)&&(!o||o.call(this,e,t,r))};i.u=!0;var o=i.shouldComponentUpdate,l=i.componentWillUpdate;i.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,a(e,t,r),o=n}l&&l.call(this,e,t,r)},i.shouldComponentUpdate=a}return s.__N||s.__}(C,e)}function w(e,t){var r=g(n++,3);!u.__s&&I(r.__H,t)&&(r.__=e,r.i=t,i.__H.__h.push(r))}function v(e,t){var r=g(n++,7);return I(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function x(){for(var e;e=c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(E),e.__H.__h.forEach(A),e.__H.__h=[]}catch(t){e.__H.__h=[],u.__e(t,e.__v)}}u.__b=function(e){i=null,d&&d(e)},u.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),m&&m(e,t)},u.__r=function(e){f&&f(e),n=0;var t=(i=e.__c).__H;t&&(s===i?(t.__h=[],i.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(t.__h.forEach(E),t.__h.forEach(A),t.__h=[],n=0)),s=i},u.diffed=function(e){h&&h(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&a===u.requestAnimationFrame||((a=u.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(n),_&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);_&&(t=requestAnimationFrame(r))})(x)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),s=i=null},u.__c=function(e,t){t.some(function(e){try{e.__h.forEach(E),e.__h=e.__h.filter(function(e){return!e.__||A(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],u.__e(r,e.__v)}}),p&&p(e,t)},u.unmount=function(e){y&&y(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(e){try{E(e)}catch(e){t=e}}),r.__H=void 0,t&&u.__e(t,r.__v))};var _="function"==typeof requestAnimationFrame;function E(e){var t=i,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),i=t}function A(e){var t=i;e.__c=e.__(),i=t}function I(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function C(e,t){return"function"==typeof t?t(e):t}},71895:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n={}.constructor;function i(e){return null!=e&&e.constructor===n}},72004:(e,t,r)=>{"use strict";r.d(t,{bN:()=>y,u5:()=>p,vA:()=>b});var n,i,s,a=r(59681),o=r(40852),l=r(63228),c=Object.defineProperty,u=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},d=(e,t,r)=>(u(e,t,"read from private field"),r?r.call(e):t.get(e)),f=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},h=(e,t,r,n)=>(u(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);class p{constructor(e){f(this,n,{}),f(this,i,new a.G(()=>new Set)),f(this,s,new Set),((e,t,r)=>((e,t,r)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r))(this,"disposables",(0,o.e)()),h(this,n,e),l._.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return d(this,n)}subscribe(e,t){if(l._.isServer)return()=>{};let r={selector:e,callback:t,current:e(d(this,n))};return d(this,s).add(r),this.disposables.add(()=>{d(this,s).delete(r)})}on(e,t){return l._.isServer?()=>{}:(d(this,i).get(e).add(t),this.disposables.add(()=>{d(this,i).get(e).delete(t)}))}send(e){let t=this.reduce(d(this,n),e);if(t!==d(this,n)){for(let e of(h(this,n,t),d(this,s))){let t=e.selector(d(this,n));y(e.current,t)||(e.current=t,e.callback(t))}for(let t of d(this,i).get(e.type))t(d(this,n),e)}}}function y(e,t){return!!Object.is(e,t)||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&m(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&m(e.entries(),t.entries()):!!(g(e)&&g(t))&&m(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()))}function m(e,t){for(;;){let r=e.next(),n=t.next();if(r.done&&n.done)return!0;if(r.done||n.done||!Object.is(r.value,n.value))return!1}}function g(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}function b(e){let[t,r]=e(),n=(0,o.e)();return(...e)=>{t(...e),n.dispose(),n.microTask(r)}
vendor: 5,219 bytes, line 280
280}n=new WeakMap,i=new WeakMap,s=new WeakMap},72274:(e,t,r)=>{"use strict";r.d(t,{XX:()=>R,fF:()=>i,h:()=>w,n:()=>w});var n,i,s,a,o,l,c,u,d,f,h={},p=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function g(e,t){for(var r in t)e[r]=t[r];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,r){var i,s,a,o={};for(a in t)"key"==a?i=t[a]:"ref"==a?s=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return v(e,o,i,s,null)}function v(e,t,r,n,a){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++s:a,__i:-1,__u:0};return null==a&&null!=i.vnode&&i.vnode(o),o}function x(e){return e.children}function _(e,t){this.props=e,this.context=t}function E(e,t){if(null==t)return e.__?E(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?E(e):null}function A(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!I.__r++||o!==i.debounceRendering)&&((o=i.debounceRendering)||l)(I)}function I(){var e,t,r,n,s,o,l,u;for(a.sort(c);e=a.shift();)e.__d&&(t=a.length,n=void 0,o=(s=(r=e).__v).__e,l=[],u=[],r.__P&&((n=g({},s)).__v=s.__v+1,i.vnode&&i.vnode(n),k(r.__P,n,s,r.__n,r.__P.namespaceURI,32&s.__u?[o]:null,l,null==o?E(s):o,!!(32&s.__u),u),n.__v=s.__v,n.__.__k[n.__i]=n,T(l,n,u),n.__e!=o&&function e(t){var r,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,r=0;r<t.__k.length;r++)if(null!=(n=t.__k[r])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return e(t)}}(n)),a.length>t&&a.sort(c));I.__r=0}function C(e,t,r,n,s,a,o,l,c,u,d){var f,y,g,w,_,A=n&&n.__k||p,I=t.length;for(r.__d=c,function(e,t,r){var n,s,a,o,l,c=t.length,u=r.length,d=u,f=0;for(e.__k=[],n=0;n<c;n++)null!=(s=t[n])&&"boolean"!=typeof s&&"function"!=typeof s?(o=n+f,(s=e.__k[n]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?v(null,s,null,null,null):m(s)?v(x,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?v(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,-1!==(l=s.__i=function(e,t,r,n){var i=e.key,s=e.type,a=r-1,o=r+1,l=t[r];if(null===l||l&&i==l.key&&s===l.type&&0==(131072&l.__u))return r;if(n>+(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&&s===l.type)return a;a--}if(o<t.length){if((l=t[o])&&0==(131072&l.__u)&&i==l.key&&s===l.type)return o;o++}}return -1}(s,r,o,d))&&(d--,(a=r[l])&&(a.__u|=131072)),null==a||null===a.__v?(-1==l&&f--,"function"!=typeof s.type&&(s.__u|=65536)):l!==o&&(l==o-1?f--:l==o+1?f++:(l>o?f--:f++,s.__u|=65536))):s=e.__k[n]=null;if(d)for(n=0;n<u;n++)null!=(a=r[n])&&0==(131072&a.__u)&&(a.__e==e.__d&&(e.__d=E(a)),function e(t,r,n){var s,a;if(i.unmount&&i.unmount(t),(s=t.ref)&&(s.current&&s.current!==t.__e||O(s,null,r)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){i.__e(e,r)}s.base=s.__P=null}if(s=t.__k)for(a=0;a<s.length;a++)s[a]&&e(s[a],r,n||"function"!=typeof t.type);n||b(t.__e),t.__c=t.__=t.__e=t.__d=void 0}(a,a))}(r,t,A),c=r.__d,f=0;f<I;f++)null!=(g=r.__k[f])&&(y=-1===g.__i?h:A[g.__i]||h,g.__i=f,k(e,g,y,s,a,o,l,c,u,d),w=g.__e,g.ref&&y.ref!=g.ref&&(y.ref&&O(y.ref,null,g),d.push(g.ref,g.__c||w,g)),null==_&&null!=w&&(_=w),65536&g.__u||y.__k===g.__k?c=function e(t,r,n){var i,s;if("function"==typeof t.type){for(i=t.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=t,r=e(i[s],r,n));return r}t.__e!=r&&(r&&t.type&&!n.contains(r)&&(r=E(t)),n.insertBefore(t.__e,r||null),r=t.__e);do r=r&&r.nextSibling;while(null!=r&&8===r.nodeType);return r}(g,c,e):"function"==typeof g.type&&void 0!==g.__d?c=g.__d:w&&(c=w.nextSibling),g.__d=void 0,g.__u&=-196609);r.__d=c,r.__e=_}function S(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||y.test(t)?r:r+"px"}function P(e,t,r,n,i){var s;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||S(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||S(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])s=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+s]=r,r?n?r.u=n.u:(r.u=u,e.addEventListener(t,s?f:d,s)):e.removeEventListener(t,s?f:d,s);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==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function $(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=u++;else if(t.t<r.u)return;return r(i.event?i.event(t):t)}}}function k(e,t,r,s,a,o,l,c,u,d){var f,p,y,w,v,A,I,S,$,k,T,O,R,B,D,M,U=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),o=[c=t.__e=r.__e]),(f=i.__b)&&f(t);
vendor: 4,907 bytes, line 280
280e:if("function"==typeof U)try{if(S=t.props,$="prototype"in U&&U.prototype.render,k=(f=U.contextType)&&s[f.__c],T=f?k?k.props.value:f.__:s,r.__c?I=(p=t.__c=r.__c).__=p.__E:($?t.__c=p=new U(S,T):(t.__c=p=new _(S,T),p.constructor=U,p.render=N),k&&k.sub(p),p.props=S,p.state||(p.state={}),p.context=T,p.__n=s,y=p.__d=!0,p.__h=[],p._sb=[]),$&&null==p.__s&&(p.__s=p.state),$&&null!=U.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=g({},p.__s)),g(p.__s,U.getDerivedStateFromProps(S,p.__s))),w=p.props,v=p.state,p.__v=t,y)$&&null==U.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),$&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if($&&null==U.getDerivedStateFromProps&&S!==w&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(S,T),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(S,p.__s,T)||t.__v===r.__v)){for(t.__v!==r.__v&&(p.props=S,p.state=p.__s,p.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),O=0;O<p._sb.length;O++)p.__h.push(p._sb[O]);p._sb=[],p.__h.length&&l.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(S,p.__s,T),$&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(w,v,A)})}if(p.context=T,p.props=S,p.__P=e,p.__e=!1,R=i.__r,B=0,$){for(p.state=p.__s,p.__d=!1,R&&R(t),f=p.render(p.props,p.state,p.context),D=0;D<p._sb.length;D++)p.__h.push(p._sb[D]);p._sb=[]}else do p.__d=!1,R&&R(t),f=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++B<25);p.state=p.__s,null!=p.getChildContext&&(s=g(g({},s),p.getChildContext())),$&&!y&&null!=p.getSnapshotBeforeUpdate&&(A=p.getSnapshotBeforeUpdate(w,v)),C(e,m(M=null!=f&&f.type===x&&null==f.key?f.props.children:f)?M:[M],t,r,s,a,o,l,c,u,d),p.base=t.__e,t.__u&=-161,p.__h.length&&l.push(p),I&&(p.__E=p.__=null)}catch(e){if(t.__v=null,u||null!=o){for(t.__u|=u?160:32;c&&8===c.nodeType&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else t.__e=r.__e,t.__k=r.__k;i.__e(e,t,r)}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,s,a,o,l,c,u){var d,f,p,y,g,w,v,x=r.props,_=t.props,A=t.type;if("svg"===A?a="http://www.w3.org/2000/svg":"math"===A?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),null!=o){for(d=0;d<o.length;d++)if((g=o[d])&&"setAttribute"in g==!!A&&(A?g.localName===A:3===g.nodeType)){e=g,o[d]=null;break}}if(null==e){if(null===A)return document.createTextNode(_);e=document.createElementNS(a,A,_.is&&_),c&&(i.__m&&i.__m(t,o),c=!1),o=null}if(null===A)x===_||c&&e.data===_||(e.data=_);else{if(o=o&&n.call(e.childNodes),x=r.props||h,!c&&null!=o)for(x={},d=0;d<e.attributes.length;d++)x[(g=e.attributes[d]).name]=g.value;for(d in x)if(g=x[d],"children"==d);else if("dangerouslySetInnerHTML"==d)p=g;else if(!(d in _)){if("value"==d&&"defaultValue"in _||"checked"==d&&"defaultChecked"in _)continue;P(e,d,null,g,a)}for(d in _)g=_[d],"children"==d?y=g:"dangerouslySetInnerHTML"==d?f=g:"value"==d?w=g:"checked"==d?v=g:c&&"function"!=typeof g||x[d]===g||P(e,d,g,x[d],a);if(f)c||p&&(f.__html===p.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(p&&(e.innerHTML=""),C(e,m(y)?y:[y],t,r,s,"foreignObject"===A?"http://www.w3.org/1999/xhtml":a,o,l,o?o[0]:r.__k&&E(r,0),c,u),null!=o)for(d=o.length;d--;)b(o[d]);c||(d="value","progress"===A&&null==w?e.removeAttribute("value"):void 0===w||w===e[d]&&("progress"!==A||w)&&("option"!==A||w===x[d])||P(e,d,w,x[d],a),d="checked",void 0!==v&&v!==e[d]&&P(e,d,v,x[d],a))}return e}(r.__e,t,r,s,a,o,l,u,d);(f=i.diffed)&&f(t)}function T(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)O(r[n],r[++n],r[++n]);i.__c&&i.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){i.__e(e,t.__v)}})}function O(e,t,r){try{if("function"==typeof e){var n="function"==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){i.__e(e,r)}}function N(e,t,r){return this.constructor(e,r)}function R(e,t,r){var s,a,o,l;i.__&&i.__(e,t),a=(s="function"==typeof r)?null:r&&r.__k||t.__k,o=[],l=[],k(t,e=(!s&&r||t).__k=w(x,null,[e]),a||h,h,t.namespaceURI,!s&&r?[r]:a?null:t.firstChild?n.call(t.childNodes):null,o,!s&&r?r:a?a.__e:t.firstChild,s,l),T(o,e,l)}n=p.slice,i={__e:function(e,t,r,n){for(var i,s,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},s=0,_.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=g({},this.state),"function"==typeof e&&(e=e(g({},r),this.props)),e&&g(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),A(this))},_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),A(this))},_.prototype.render=x,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Prom
280ise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},I.__r=0,u=0,d=$(!1),f=$(!0)},72334:(e,t,r)=>{"use strict";r.d(t,{h:()=>s});var n=r(65409),i=r(27526);function s(e,t){if(!(0,i.P)(e,{strict:!1}))throw new n.M({address:e});if(!(0,i.P)(t,{strict:!1}))throw new n.M({address:t});return e.toLowerCase()===t.toLowerCase()}},72693:(e,t,r)=>{"use strict";r.d(t,{p:()=>u});var n=r(30406),i=r(15678),s=r(45897),a=r(65402),o=r(21394),l=r(63547);let c="/docs/contract/encodeFunctionData";function u(e){let{args:t}=e,{abi:r,functionName:u}=(()=>{if(1===e.abi.length&&e.functionName?.startsWith("0x"))return e;let{abi:t,args:r,functionName:n}=e,i=t[0];if(n){let e=(0,l.iY)({abi:t,args:r,name:n});if(!e)throw new s.Iz(n,{docsPath:c});i=e}if("function"!==i.type)throw new s.Iz(void 0,{docsPath:c});return{abi:[i],functionName:(0,a.V)((0,o.B)(i))}})(),d=r[0],f="inputs"in d&&d.inputs?(0,i.h)(d.inputs,t??[]):void 0;return(0,n.aP)([u,f??"0x"])}},72767:(e,t,r)=>{"use strict";r.d(t,{T:()=>i});var n=r(36174);async function i(e){let t=await e.request({method:"eth_chainId"},{dedupe:!0});return(0,n.ME)(t)}},72831:(e,t,r)=>{"use strict";r.d(t,{K:()=>s});var n=r(42150),i=r(78492);function s(){return(0,n.A)(i.Ko,arguments)}},73018:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(10077).A)("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]])},73058:(e,t,r)=>{"use strict";r.d(t,{Cq:()=>tv,FA:()=>t_,TZ:()=>tx,UF:()=>tw});var n=r(66776),i=r(95912);function s(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function a(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")}let o="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,l=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function c(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}(e)),s(e),e}class u{clone(){return this._cloneInto()}}function d(e=32){if(o&&"function"==typeof o.getRandomValues)return o.getRandomValues(new Uint8Array(e));if(o&&"function"==typeof o.randomBytes)return o.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}class f extends u{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=l(this.buffer)}update(e){a(this);let{view:t,buffer:r,blockLen:n}=this,i=(e=c(e)).length;for(let s=0;s<i;){let a=Math.min(n-this.pos,i-s);if(a===n){let t=l(e);for(;n<=i-s;s+=n)this.process(t,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){a(this),function(e,t){s(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(0xffffffff),a=Number(r>>i&s),o=Number(r&s),l=4*!!n,c=4*!n;e.setUint32(t+l,a,n),e.setUint32(t+c,o,n)})(r,n-8,BigInt(8*this.length),i),this.process(r,0);let c=l(e),u=this.outputLen;if(u%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=u/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)c.setUint32(4*e,f[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}let h=BigInt(0x100000000-1),p=BigInt(32),y={split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:s,l:a}=function(e,t=!1){return t?{h:Number(e&h),l:Number(e>>p&h)}:{h:0|Number(e>>p&h),l:0|Number(e&h)}}(e[i],t);[r[i],n[i]]=[s,a]}return[r,n]},shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,add:function(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0,add5H:(e,t,r,n,i,s)=>t+r+n+i+s+(e/0x100000000|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},[m,g]=y.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
2806f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),b=new Uint32Array(80),w=new Uint32Array(80);class v extends f{constructor(){super(128,64,16,!1),this.Ah=0x6a09e667,this.Al=-0xc4336f8,this.Bh=-0x4498517b,this.Bl=-0x7b3558c5,this.Ch=0x3c6ef372,this.Cl=-0x16b07d5,this.Dh=-0x5ab00ac6,this.Dl=0x5f1d36f1,this.Eh=0x510e527f,this.El=-0x52197d2f,this.Fh=-0x64fa9774,this.Fl=0x2b3e6c1f,this.Gh=0x1f83d9ab,this.Gl=-0x4be4295,this.Hh=0x5be0cd19,this.Hl=0x137e2179}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:a,Dl:o,Eh:l,El:c,Fh:u,Fl:d,Gh:f,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,i,s,a,o,l,c,u,d,f,h,p,y]}set(e,t,r,n,i,s,a,o,l,c,u,d,f,h,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|l,this.El=0|c,this.Fh=0|u,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)b[r]=e.getUint32(t),w[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|b[e-15],r=0|w[e-15],n=y.rotrSH(t,r,1)^y.rotrSH(t,r,8)^y.shrSH(t,r,7),i=y.rotrSL(t,r,1)^y.rotrSL(t,r,8)^y.shrSL(t,r,7),s=0|b[e-2],a=0|w[e-2],o=y.rotrSH(s,a,19)^y.rotrBH(s,a,61)^y.shrSH(s,a,6),l=y.rotrSL(s,a,19)^y.rotrBL(s,a,61)^y.shrSL(s,a,6),c=y.add4L(i,l,w[e-7],w[e-16]),u=y.add4H(c,n,o,b[e-7],b[e-16]);b[e]=0|u,w[e]=0|c}let{Ah:r,Al:n,Bh:i,Bl:s,Ch:a,Cl:o,Dh:l,Dl:c,Eh:u,El:d,Fh:f,Fl:h,Gh:p,Gl:v,Hh:x,Hl:_}=this;for(let e=0;e<80;e++){let t=y.rotrSH(u,d,14)^y.rotrSH(u,d,18)^y.rotrBH(u,d,41),E=y.rotrSL(u,d,14)^y.rotrSL(u,d,18)^y.rotrBL(u,d,41),A=u&f^~u&p,I=d&h^~d&v,C=y.add5L(_,E,I,g[e],w[e]),S=y.add5H(C,x,t,A,m[e],b[e]),P=0|C,$=y.rotrSH(r,n,28)^y.rotrBH(r,n,34)^y.rotrBH(r,n,39),k=y.rotrSL(r,n,28)^y.rotrBL(r,n,34)^y.rotrBL(r,n,39),T=r&i^r&a^i&a,O=n&s^n&o^s&o;x=0|p,_=0|v,p=0|f,v=0|h,f=0|u,h=0|d,({h:u,l:d}=y.add(0|l,0|c,0|S,0|P)),l=0|a,c=0|o,a=0|i,o=0|s,i=0|r,s=0|n;let N=y.add3L(P,k,O);r=y.add3H(N,S,$,T),n=0|N}({h:r,l:n}=y.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:s}=y.add(0|this.Bh,0|this.Bl,0|i,0|s)),({h:a,l:o}=y.add(0|this.Ch,0|this.Cl,0|a,0|o)),({h:l,l:c}=y.add(0|this.Dh,0|this.Dl,0|l,0|c)),({h:u,l:d}=y.add(0|this.Eh,0|this.El,0|u,0|d)),({h:f,l:h}=y.add(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:v}=y.add(0|this.Gh,0|this.Gl,0|p,0|v)),({h:x,l:_}=y.add(0|this.Hh,0|this.Hl,0|x,0|_)),this.set(r,n,i,s,a,o,l,c,u,d,f,h,p,v,x,_)}roundClean(){b.fill(0),w.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let x=function(e){let t=t=>e().update(c(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}(()=>new v),_=BigInt(0),E=BigInt(1),A=BigInt(2);function I(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function C(e){if(!I(e))throw Error("Uint8Array expected")}function S(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}let P=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function $(e){C(e);let t="";for(let r=0;r<e.length;r++)t+=P[e[r]];return t}function k(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?_:BigInt("0x"+e)}let T={_0:48,_9:57,A:65,F:70,a:97,f:102};function O(e){return e>=T._0&&e<=T._9?e-T._0:e>=T.A&&e<=T.F?e-(T.A-10):e>=T.a&&e<=T.f?e-(T.a-10):void 0}function N(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=O(e.charCodeAt(i)),s=O(e.charCodeAt(i+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+s}return n}function R(e){return C(e),k($(Uint8Array.from(e).reverse()))}function B(e,t){return N(e.toString(16).padStart(2*t,"0"))}function D(e,t){return B(e,t).reverse()}function M(e,t,r){let n;if("string"==typeof t)try{n=N(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(I(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function U(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];C(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let j=e=>"bigint"==typeof e&&_<=e;function L(e,t,r,n){if(!(j(t)&&j(r)&&j(n))||!(r<=t)||!(t<n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}let F={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||I(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function z(e,t,r={}){let n=(t,r,n)=>{let i=F[r];if("function"!=typeof i)throw Error("invalid validator function");let s=e[t];if(!(n&&void 0===s)&&!i(s,e))throw Error("param "+String(t)+" is invali
280d. Expected "+r+", got "+s)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function q(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let s=e(r,...n);return t.set(r,s),s}}let W=BigInt(0),H=BigInt(1),K=BigInt(2),V=BigInt(3),G=BigInt(4),J=BigInt(5),Y=BigInt(8);function Z(e,t){let r=e%t;return r>=W?r:t+r}function Q(e,t,r){let n=e;for(;t-- >W;)n*=n,n%=r;return n}function X(e,t){if(e===W)throw Error("invert: expected non-zero number");if(t<=W)throw Error("invert: expected positive modulus, got "+t);let r=Z(e,t),n=t,i=W,s=H;for(;r!==W;){let e=n/r,t=n%r,a=i-s*e;n=r,r=t,i=s,s=a}if(n!==H)throw Error("invert: does not exist");return Z(i,t)}let ee=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function et(e,t){let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function er(e,t,r=!1,n={}){let i;if(e<=W)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:s,nByteLength:a}=et(e,t);if(a>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let o=Object.freeze({ORDER:e,isLE:r,BITS:s,BYTES:a,MASK:(A<<BigInt(s-1))-E,ZERO:W,ONE:H,create:t=>Z(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return W<=t&&t<e},is0:e=>e===W,isOdd:e=>(e&H)===H,neg:t=>Z(-t,e),eql:(e,t)=>e===t,sqr:t=>Z(t*t,e),add:(t,r)=>Z(t+r,e),sub:(t,r)=>Z(t-r,e),mul:(t,r)=>Z(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<W)throw Error("invalid exponent, negatives unsupported");if(r===W)return e.ONE;if(r===H)return t;let n=e.ONE,i=t;for(;r>W;)r&H&&(n=e.mul(n,i)),i=e.sqr(i),r>>=H;return n})(o,e,t),div:(t,r)=>Z(t*X(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>X(t,e),sqrt:n.sqrt||(t=>(i||(i=function(e){if(e%G===V){let t=(e+H)/G;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}if(e%Y===J){let t=(e-J)/Y;return function(e,r){let n=e.mul(r,K),i=e.pow(n,t),s=e.mul(r,i),a=e.mul(e.mul(s,K),i),o=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),r))throw Error("Cannot find square root");return o}}return function(e){let t,r,n,i=(e-H)/K;for(t=e-H,r=0;t%K===W;t/=K,r++);for(n=K;n<e&&function(e,t,r){if(t<W)throw Error("invalid exponent, negatives unsupported");if(r<=W)throw Error("invalid modulus");if(r===H)return W;let n=H;for(;t>W;)t&H&&(n=n*e%r),e=e*e%r,t>>=H;return n}(n,i,e)!==e-H;n++)if(n>1e3)throw Error("Cannot find square root: likely non-prime P");if(1===r){let t=(e+H)/G;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}let s=(t+H)/K;return function(e,a){if(e.pow(a,i)===e.neg(e.ONE))throw Error("Cannot find square root");let o=r,l=e.pow(e.mul(e.ONE,n),t),c=e.pow(a,s),u=e.pow(a,t);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(u);t<o&&!e.eql(r,e.ONE);t++)r=e.sqr(r);let r=e.pow(l,H<<BigInt(o-t-1));l=e.sqr(r),c=e.mul(c,r),u=e.mul(u,l),o=t}return c}}(e)}(e)),i(o,t))),invertBatch:e=>(function(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r})(o,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?D(e,a):B(e,a),fromBytes:e=>{if(e.length!==a)throw Error("Field.fromBytes: expected "+a+" bytes, got "+e.length);return r?R(e):k($(e))}});return Object.freeze(o)}let en=BigInt(0),ei=BigInt(1);function es(e,t){let r=t.negate();return e?r:t}function ea(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function eo(e,t){return ea(e,t),{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}let el=new WeakMap,ec=new WeakMap;function eu(e){return ec.get(e)||1}let ed=BigInt(0),ef=BigInt(1),eh=BigInt(2),ep=BigInt(8),ey={zip215:!0};BigInt(0),BigInt(1);let em=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),eg=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);let eb=BigInt(1),ew=BigInt(2);BigInt(3);let ev=BigInt(5),ex=BigInt(8),e_=er(em,void 0,!0),eE=function(e){var t;let r=function(e){let t=(z(e.Fp,ee.reduce((e,t)=>
280(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),z(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...et(e.n,e.nBitLength),...e,p:e.Fp.ORDER}));return z(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:n,n:i,prehash:s,hash:a,randomBytes:o,nByteLength:l,h:c}=r,u=eh<<BigInt(8*l)-ef,d=n.create,f=er(r.n,r.nBitLength),h=r.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch{return{isValid:!1,value:ed}}}),p=r.adjustScalarBytes||(e=>e),y=r.domain||((e,t,r)=>{if(S("phflag",r),t.length||r)throw Error("Contexts/pre-hash are not supported");return e});function m(e,t){L("coordinate "+e,t,ed,u)}function g(e){if(!(e instanceof v))throw Error("ExtendedPoint expected")}let b=q((e,t)=>{let{ex:r,ey:i,ez:s}=e,a=e.is0();null==t&&(t=a?ep:n.inv(s));let o=d(r*t),l=d(i*t),c=d(s*t);if(a)return{x:ed,y:ef};if(c!==ef)throw Error("invZ was invalid");return{x:o,y:l}}),w=q(e=>{let{a:t,d:n}=r;if(e.is0())throw Error("bad point: ZERO");let{ex:i,ey:s,ez:a,et:o}=e,l=d(i*i),c=d(s*s),u=d(a*a),f=d(u*u),h=d(l*t);if(d(u*d(h+c))!==d(f+d(n*d(l*c))))throw Error("bad point: equation left != right (1)");if(d(i*s)!==d(a*o))throw Error("bad point: equation left != right (2)");return!0});class v{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,m("x",e),m("y",t),m("z",r),m("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof v)throw Error("extended point not allowed");let{x:t,y:r}=e||{};return m("x",t),m("y",r),new v(t,r,ef,d(t*r))}static normalizeZ(e){let t=n.invertBatch(e.map(e=>e.ez));return e.map((e,r)=>e.toAffine(t[r])).map(v.fromAffine)}static msm(e,t){return function(e,t,r,n){if(function(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})}(r,e),function(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}(n,t),r.length!==n.length)throw Error("arrays of points and scalars must have equal length");let i=e.ZERO,s=function(e){let t;for(t=0;e>_;e>>=E,t+=1);return t}(BigInt(r.length)),a=s>12?s-3:s>4?s-2:s?2:1,o=(1<<a)-1,l=Array(o+1).fill(i),c=Math.floor((t.BITS-1)/a)*a,u=i;for(let e=c;e>=0;e-=a){l.fill(i);for(let t=0;t<n.length;t++){let i=Number(n[t]>>BigInt(e)&BigInt(o));l[i]=l[i].add(r[t])}let t=i;for(let e=l.length-1,r=i;e>0;e--)r=r.add(l[e]),t=t.add(r);if(u=u.add(t),0!==e)for(let e=0;e<a;e++)u=u.double()}return u}(v,f,e,t)}_setWindowSize(e){I.setWindowSize(this,e)}assertValidity(){w(this)}equals(e){g(e);let{ex:t,ey:r,ez:n}=this,{ex:i,ey:s,ez:a}=e,o=d(t*a),l=d(i*n),c=d(r*a),u=d(s*n);return o===l&&c===u}is0(){return this.equals(v.ZERO)}negate(){return new v(d(-this.ex),this.ey,this.ez,d(-this.et))}double(){let{a:e}=r,{ex:t,ey:n,ez:i}=this,s=d(t*t),a=d(n*n),o=d(eh*d(i*i)),l=d(e*s),c=t+n,u=d(d(c*c)-s-a),f=l+a,h=f-o,p=l-a,y=d(u*h),m=d(f*p),g=d(u*p);return new v(y,m,d(h*f),g)}add(e){g(e);let{a:t,d:n}=r,{ex:i,ey:s,ez:a,et:o}=this,{ex:l,ey:c,ez:u,et:f}=e;if(t===BigInt(-1)){let e=d((s-i)*(c+l)),t=d((s+i)*(c-l)),r=d(t-e);if(r===ed)return this.double();let n=d(a*eh*f),h=d(o*eh*u),p=h+n,y=t+e,m=h-n,g=d(p*r),b=d(y*m),w=d(p*m);return new v(g,b,d(r*y),w)}let h=d(i*l),p=d(s*c),y=d(o*n*f),m=d(a*u),b=d((i+s)*(l+c)-h-p),w=m-y,x=m+y,_=d(p-t*h),E=d(b*w),A=d(x*_),I=d(b*_);return new v(E,A,d(w*x),I)}subtract(e){return this.add(e.negate())}wNAF(e){return I.wNAFCached(this,e,v.normalizeZ)}multiply(e){L("scalar",e,ef,i);let{p:t,f:r}=this.wNAF(e);return v.normalizeZ([t,r])[0]}multiplyUnsafe(e,t=v.ZERO){return L("scalar",e,ed,i),e===ed?A:this.is0()||e===ef?this:I.wNAFCachedUnsafe(this,e,v.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return I.unsafeLadder(this,i).is0()}toAffine(e){return b(this,e)}clearCofactor(){let{h:e}=r;return e===ef?this:this.multiplyUnsafe(e)}static fromHex(e,t=!1){let{d:i,a:s}=r,a=n.BYTES;e=M("pointHex",e,a),S("zip215",t);let o=e.slice(),l=e[a-1];o[a-1]=-129&l;let c=R(o);L("pointHex.y",c,ed,t?u:n.ORDER);let f=d(c*c),{isValid:p,value:y}=h(d(f-ef),d(i*f-s));
280if(!p)throw Error("Point.fromHex: invalid y coordinate");let m=(y&ef)===ef,g=(128&l)!=0;if(!t&&y===ed&&g)throw Error("Point.fromHex: x=0 and x_0=1");return g!==m&&(y=d(-y)),v.fromAffine({x:y,y:c})}static fromPrivateKey(e){return C(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),r=D(t,n.BYTES);return r[r.length-1]|=e&ef?128:0,r}toHex(){return $(this.toRawBytes())}}v.BASE=new v(r.Gx,r.Gy,ef,d(r.Gx*r.Gy)),v.ZERO=new v(ed,ef,ef,ed);let{BASE:x,ZERO:A}=v,I=(t=8*l,{constTimeNegate:es,hasPrecomputes:e=>1!==eu(e),unsafeLadder(e,t,r=v.ZERO){let n=e;for(;t>en;)t&ei&&(r=r.add(n)),n=n.double(),t>>=ei;return r},precomputeWindow(e,r){let{windows:n,windowSize:i}=eo(r,t),s=[],a=e,o=a;for(let e=0;e<n;e++){o=a,s.push(o);for(let e=1;e<i;e++)o=o.add(a),s.push(o);a=o.double()}return s},wNAF(e,r,n){let{windows:i,windowSize:s}=eo(e,t),a=v.ZERO,o=v.BASE,l=BigInt(2**e-1),c=2**e,u=BigInt(e);for(let e=0;e<i;e++){let t=e*s,i=Number(n&l);n>>=u,i>s&&(i-=c,n+=ei);let d=t+Math.abs(i)-1,f=e%2!=0,h=i<0;0===i?o=o.add(es(f,r[t])):a=a.add(es(h,r[d]))}return{p:a,f:o}},wNAFUnsafe(e,r,n,i=v.ZERO){let{windows:s,windowSize:a}=eo(e,t),o=BigInt(2**e-1),l=2**e,c=BigInt(e);for(let e=0;e<s;e++){let t=e*a;if(n===en)break;let s=Number(n&o);if(n>>=c,s>a&&(s-=l,n+=ei),0===s)continue;let u=r[t+Math.abs(s)-1];s<0&&(u=u.negate()),i=i.add(u)}return i},getPrecomputes(e,t,r){let n=el.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&el.set(t,r(n))),n},wNAFCached(e,t,r){let n=eu(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=eu(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){ea(r,t),ec.set(e,r),el.delete(e)}});function C(e){let t=n.BYTES;e=M("private key",e,t);let r=M("hashed private key",a(e),2*t),s=p(r.slice(0,t)),o=r.slice(t,2*t),l=Z(R(s),i),c=x.multiply(l),u=c.toRawBytes();return{head:s,prefix:o,scalar:l,point:c,pointBytes:u}}function P(e=new Uint8Array,...t){return Z(R(a(y(U(...t),M("context",e),!!s))),i)}return x._setWindowSize(8),{CURVE:r,getPublicKey:function(e){return C(e).pointBytes},sign:function(e,t,r={}){e=M("message",e),s&&(e=s(e));let{prefix:a,scalar:o,pointBytes:l}=C(t),c=P(r.context,a,e),u=x.multiply(c).toRawBytes(),d=Z(c+P(r.context,u,l,e)*o,i);return L("signature.s",d,ed,i),M("result",U(u,D(d,n.BYTES)),2*n.BYTES)},verify:function(e,t,r,i=ey){let a,o,l,{context:c,zip215:u}=i,d=n.BYTES;e=M("signature",e,2*d),t=M("message",t),r=M("publicKey",r,d),void 0!==u&&S("zip215",u),s&&(t=s(t));let f=R(e.slice(d,2*d));try{a=v.fromHex(r,u),o=v.fromHex(e.slice(0,d),u),l=x.multiplyUnsafe(f)}catch{return!1}if(!u&&a.isSmallOrder())return!1;let h=P(c,o.toRawBytes(),a.toRawBytes(),t);return o.add(a.multiplyUnsafe(h)).subtract(l).clearCofactor().equals(v.ZERO)},ExtendedPoint:v,utils:{getExtendedPublicKey:C,randomPrivateKey:()=>o(n.BYTES),precompute:(e=8,t=v.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:e_,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:ex,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:x,randomBytes:d,adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[31]|=64,e},uvRatio:function(e,t){let r=Z(t*t*t,em),n=function(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),s=e*e%em*e%em,a=Q(s,ew,em)*s%em,o=Q(a,eb,em)*e%em,l=Q(o,ev,em)*o%em,c=Q(l,t,em)*l%em,u=Q(c,r,em)*c%em,d=Q(u,n,em)*u%em,f=Q(d,i,em)*d%em,h=Q(f,i,em)*d%em,p=Q(h,t,em)*l%em;return{pow_p_5_8:Q(p,ew,em)*e%em,b2:s}}(e*Z(r*r*t,em)).pow_p_5_8,i=Z(e*r*n,em),s=Z(t*i*i,em),a=i,o=Z(i*eg,em),l=s===e,c=s===Z(-e,em),u=s===Z(-e*eg,em);return l&&(i=a),(c||u)&&(i=o),(Z(i,em)&H)===H&&(i=Z(-i,em)),{isValid:l||c,value:i}}}),eA="base64url",eI="utf8",eC="utf8",eS="base58btc";function eP(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function e$(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?eP(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ek(e,t){t||(t=e.reduce((e,t)=>
280e+t.length,0));let r=e$(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return eP(r)}var eT=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),a=s.charCodeAt(0);if(255!==r[a])throw TypeError(s+" is ambiguous");r[a]=i}var o=e.length,l=e.charAt(0),c=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===l;)n++,t++;for(var s=(e.length-t)*c+1>>>0,a=new Uint8Array(s);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var d=0,f=s-1;(0!==u||d<i)&&-1!==f;f--,d++)u+=o*a[f]>>>0,a[f]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var h=s-i;h!==s&&0===a[h];)h++;for(var p=new Uint8Array(n+(s-h)),y=n;h!==s;)p[y++]=a[h++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,s=t.length;i!==s&&0===t[i];)i++,r++;for(var a=(s-i)*u+1>>>0,c=new Uint8Array(a);i!==s;){for(var d=t[i],f=0,h=a-1;(0!==d||f<n)&&-1!==h;h--,f++)d+=256*c[h]>>>0,c[h]=d%o>>>0,d=d/o>>>0;if(0!==d)throw Error("Non-zero carry");n=f,i++}for(var p=a-n;p!==a&&0===c[p];)p++;for(var y=l.repeat(r);p<a;++p)y+=e.charAt(c[p]);return y},decodeUnsafe:d,decode:function(e){var r=d(e);if(r)return r;throw Error(`Non-${t} character`)}}};let eO=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")};class eN{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class eR{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return eD(this,e)}}class eB{constructor(e){this.decoders=e}or(e){return eD(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let eD=(e,t)=>new eB({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class eM{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new eN(e,t,r),this.decoder=new eR(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let eU=({name:e,prefix:t,encode:r,decode:n})=>new eM(e,t,r,n),ej=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=eT(r,t);return eU({prefix:e,name:t,encode:n,decode:e=>eO(i(e))})},eL=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>eU({prefix:t,name:e,encode:e=>((e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,s="",a=0,o=0;for(let n=0;n<e.length;++n)for(o=o<<8|e[n],a+=8;a>r;)a-=r,s+=t[i&o>>a];if(a&&(s+=t[i&o<<r-a]),n)for(;s.length*r&7;)s+="=";return s})(e,n,r),decode:t=>((e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let a=new Uint8Array(s*r/8|0),o=0,l=0,c=0;for(let t=0;t<s;++t){let s=i[e[t]];if(void 0===s)throw SyntaxError(`Non-${n} character`);l=l<<r|s,(o+=r)>=8&&(o-=8,a[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw SyntaxError("Unexpected end of data");return a})(t,n,r,e)});var eF=Object.freeze({__proto__:null,identity:eU({prefix:"\0",name:"identity",encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)})}),ez=Object.freeze({__proto__:null,base2:eL({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),eq=Object.freeze({__proto__:null,base8:eL({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),eW=Object.freeze({__proto__:null,base10:ej({prefix:"9",name:"base10",alphabet:"0123456789"})}),eH=Object.freeze({__proto__:null,base16:eL({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:eL({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let eK=eL({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),eV=eL({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),eG=eL({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),eJ=eL({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),eY=eL({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),eZ=eL({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),eQ=eL({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5});var eX=Object.freeze({__proto__:null,base32:eK,base32upper:eV,base32pad:eG,base32padupper:eJ,base32hex:eY,base32hexupper:eZ,base32hexpad:eQ,base32hexpadupper:eL({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:eL({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),e0=Object.freeze({__proto__:null,base36:ej({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:ej({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),e1=Object.freeze({__proto__:null,base58btc:ej({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:ej({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let e2=eL({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
280+/",bitsPerChar:6}),e5=eL({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6});var e6=Object.freeze({__proto__:null,base64:e2,base64pad:e5,base64url:eL({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:eL({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let e3=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),e8=e3.reduce((e,t,r)=>(e[r]=t,e),[]),e4=e3.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var e9=Object.freeze({__proto__:null,base256emoji:eU({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=e8[t],"")},decode:function(e){let t=[];for(let r of e){let e=e4[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})});function e7(e,t,r){t=t||[],r=r||0;for(var n=r;e>=0x80000000;)t[r++]=255&e|128,e/=128;for(;-128&e;)t[r++]=255&e|128,e>>>=7;return t[r]=0|e,e7.bytes=r-n+1,t}var te={encode:e7,encodingLength:function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10}};let tt=(e,t,r=0)=>(te.encode(e,t,r),t),tr=e=>te.encodingLength(e),tn=(e,t)=>{let r=t.byteLength,n=tr(e),i=n+tr(r),s=new Uint8Array(i+r);return tt(e,s,0),tt(r,s,n),s.set(t,i),new ti(e,r,t,s)};
280class ti{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let ts=({name:e,code:t,encode:r})=>new ta(e,t,r);class ta{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?tn(this.code,t):t.then(e=>tn(this.code,e))}throw Error("Unknown type, must be binary type")}}let to=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var tl=Object.freeze({__proto__:null,sha256:ts({name:"sha2-256",code:18,encode:to("SHA-256")}),sha512:ts({name:"sha2-512",code:19,encode:to("SHA-512")})}),tc=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:eO,digest:e=>tn(0,eO(e))}});new TextEncoder,new TextDecoder;let tu={...eF,...ez,...eq,...eW,...eH,...eX,...e0,...e1,...e6,...e9};function td(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...tl,...tc});let tf=td("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),th=td("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=e$((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),tp={utf8:tf,"utf-8":tf,hex:tu.base16,latin1:th,ascii:th,binary:th,...tu};function ty(e,t="utf8"){let r=tp[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function tm(e,t="utf8"){let r=tp[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?eP(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function tg(e){return(0,i.j)(ty(tm(e,eA),eI))}function tb(e){return ty(tm((0,i.h)(e),eI),eA)}function tw(e){return["did:key","z"+ty(ek([tm("K36",eS),e]),eS)].join(":")}function tv(e){let t=e.split("."),r=tg(t[0]),n=tg(t[1]);return{header:r,payload:n,signature:tm(t[2],eA),data:tm(t.slice(0,2).join("."),eC)}}function tx(e=d(32)){let t=eE.getPublicKey(e);return{secretKey:ek([e,t]),publicKey:t}}async function t_(e,t,r,i,s=(0,n.fromMiliseconds)(Date.now())){let a={alg:"EdDSA",typ:"JWT"},o={iss:tw(i.publicKey),sub:e,aud:t,iat:s,exp:s+r},l=tm([tb((c={header:a,payload:o}).header),tb(c.payload)].join("."),eC);var c,u={header:a,payload:o,signature:eE.sign(l,i.secretKey.slice(0,32))};return[tb(u.header),tb(u.payload),ty(u.signature,eA)].join(".")}},73142:(e,t,r)=>{"use strict";r.d(t,{h:()=>n});let n=r(9102).k},73181:(e,t,r)=>{"use strict";r.d(t,{XF:()=>i,Zg:()=>c,cr:()=>a,f_:()=>l,sw:()=>o});var n=r(31911);function i(){if(void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.getRandomValues)throw new n.tsw(n.iOv)}function s(){if(!globalThis.isSecureContext)throw new n.tsw(n.qTc)}function a(){if(s(),void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.subtle?.digest)throw new n.tsw(n.JsK)}function o(){if(s(),void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.subtle?.exportKey)throw new n.tsw(n.kz9)}function l(){if(s(),void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.subtle?.sign)throw new n.tsw(n.f$j)}function c(){if(s(),void 0===globalThis.crypto||"function"!=typeof globalThis.crypto.subtle?.verify)throw new n.tsw(n.XzN)}},73260:(e,t,r)=>{"use strict";r.d(t,{q:()=>c});var n=r(5596),i=r(29447),s=r(81561),a=r(19866),o=r(40508),l=r(94828);function c(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:c,onError:u,poll:d,pollingInterval:f=e.pollingInterval}){let h;return(void 0!==d?d:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
280onfig.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{let n=(0,o.A)(["watchBlockNumber",e.uid,t,r,f]);return(0,s.lB)(n,{onBlockNumber:c,onError:u},n=>(0,a.w)(async()=>{try{let t=await (0,i.T)(e,l.G,"getBlockNumber")({cacheTime:0});if(void 0!==h){if(t===h)return;if(t-h>1&&r)for(let e=h+1n;e<t;e++)n.onBlockNumber(e,h),h=e}(void 0===h||t>h)&&(n.onBlockNumber(t,h),h=t)}catch(e){n.onError?.(e)}},{emitOnBegin:t,interval:f}))})():(()=>{let i=(0,o.A)(["watchBlockNumber",e.uid,t,r]);return(0,s.lB)(i,{onBlockNumber:c,onError:u},t=>{let r=!0,i=()=>r=!1;return(async()=>{try{let s=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:a}=await s.subscribe({params:["newHeads"],onData(e){if(!r)return;let i=(0,n.uU)(e.result?.number);t.onBlockNumber(i,h),h=i},onError(e){t.onError?.(e)}});i=a,r||i()}catch(e){u?.(e)}})(),()=>i()})})()}},74079:(e,t,r)=>{"use strict";r.d(t,{p:()=>a});var n=r(31445),i=r(66471),s=r(37289);function a(e,{docsPath:t,...r}){let a=(()=>{let t=(0,s.l)(e,r);return t instanceof n.RM?e:t})();return new i.$s(a,{docsPath:t,...r})}},74114:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});class n extends Error{static setStaticOptions(e){n.prototype.docsOrigin=e.docsOrigin,n.prototype.showVersion=e.showVersion,n.prototype.version=e.version}constructor(e,t={}){let r=(()=>{if(t.cause instanceof n){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"==typeof t.cause.details?t.cause.details:t.cause?.message?t.cause.message:t.details})(),i=t.cause instanceof n&&t.cause.docsPath||t.docsPath,s=t.docsOrigin??n.prototype.docsOrigin,a=`${s}${i??""}`,o=!!(t.version??n.prototype.showVersion),l=t.version??n.prototype.version;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r||i||o?["",r?`Details: ${r}`:void 0,i?`See: ${a}`:void 0,o?`Version: ${l}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=t.cause,this.details=r,this.docs=a,this.docsOrigin=s,this.docsPath=i,this.shortMessage=e,this.showVersion=o,this.version=l}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?e(t.cause,r):r?null:t}(this,e)}}Object.defineProperty(n,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:"[email protected]"}}),n.setStaticOptions(n.defaultStaticOptions)},74263:(e,t,r)=>{"use strict";r.d(t,{BI:()=>E,EB:()=>x,Iy:()=>l,Iz:()=>w,MR:()=>v,M_:()=>b,Nc:()=>u,O:()=>c,Wl:()=>k,Wq:()=>y,YE:()=>f,YF:()=>o,YW:()=>a,ZP:()=>h,_z:()=>m,d_:()=>$,dm:()=>P,fo:()=>A,gH:()=>d,j:()=>S,kE:()=>g,l3:()=>I,nK:()=>C,nM:()=>_,yy:()=>p});var n=r(22760),i=r(44633),s=r(99838);class a extends s.C{constructor({docsPath:e}){super("A constructor was not found on the ABI.\nMake sure you are using the correct ABI and that the constructor exists on it.",{docsPath:e,name:"AbiConstructorNotFoundError"})}}class o extends s.C{constructor({docsPath:e}){super("Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.\nMake sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists.",{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}s.C;class l extends s.C{constructor({data:e,params:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${(0,n.A)(t,{includeName:!0})})`,`Data:   ${e} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=r}}class c extends s.C{constructor({cause:e}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:e})}}class u extends s.C{constructor({expectedLength:e,givenLength:t,type:r}){super(`ABI encoding array length mismatch for type ${r}.
281Expected length: ${e}
282Given length: ${t}
vendor: 14,103 bytes, lines 282-300
282`,{name:"AbiEncodingArrayLengthMismatchError"})}}class d extends s.C{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,i.E)(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class f extends s.C{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding params/values length mismatch.
283Expected length (params): ${e}
284Given length (values): ${t}`,{name:"AbiEncodingLengthMismatchError"})}}class h extends s.C{constructor(e,{docsPath:t}){super(`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).
285Cannot encode error result without knowing what the parameter types are.
286Make sure you are using the correct ABI and that the inputs exist on it.`,{docsPath:t,name:"AbiErrorInputsNotFoundError"})}}class p extends s.C{constructor(e,{docsPath:t}={}){super(`Error ${e?`"${e}" `:""}not found on ABI.
287Make sure you are using the correct ABI and that the error exists on it.`,{docsPath:t,name:"AbiErrorNotFoundError"})}}class y extends s.C{constructor(e,{docsPath:t,cause:r}){super(`Encoded error signature "${e}" not found on ABI.
288Make sure you are using the correct ABI and that the error exists on it.
289You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${e}.`,{docsPath:t,name:"AbiErrorSignatureNotFoundError",cause:r}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class m extends s.C{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class g extends s.C{constructor(e,{docsPath:t}){super(`Encoded event signature "${e}" not found on ABI.
290Make sure you are using the correct ABI and that the event exists on it.
291You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`,{docsPath:t,name:"AbiEventSignatureNotFoundError"})}}class b extends s.C{constructor(e,{docsPath:t}={}){super(`Event ${e?`"${e}" `:""}not found on ABI.
292Make sure you are using the correct ABI and that the event exists on it.`,{docsPath:t,name:"AbiEventNotFoundError"})}}class w extends s.C{constructor(e,{docsPath:t}={}){super(`Function ${e?`"${e}" `:""}not found on ABI.
293Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t,name:"AbiFunctionNotFoundError"})}}class v extends s.C{constructor(e,{docsPath:t}){super(`Function "${e}" does not contain any \`outputs\` on ABI.
294Cannot decode function result without knowing what the parameter types are.
295Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t,name:"AbiFunctionOutputsNotFoundError"})}}class x extends s.C{constructor(e,{docsPath:t}){super(`Encoded function signature "${e}" not found on ABI.
296Make sure you are using the correct ABI and that the function exists on it.
297You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`,{docsPath:t,name:"AbiFunctionSignatureNotFoundError"})}}class _ extends s.C{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${(0,n.B)(e.abiItem)}\`, and`,`\`${t.type}\` in \`${(0,n.B)(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class E extends s.C{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`,{name:"BytesSizeMismatchError"})}}class A extends s.C{constructor({abiItem:e,data:t,params:r,size:i}){super(`Data size of ${i} bytes is too small for non-indexed event parameters.`,{metaMessages:[`Params: (${(0,n.A)(r,{includeName:!0})})`,`Data:   ${t} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=r,this.size=i}}class I extends s.C{constructor({abiItem:e,param:t}){super(`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${(0,n.B)(e,{includeName:!0})}".`,{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class C extends s.C{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid encoding type.
298Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiEncodingType"})}}class S extends s.C{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid decoding type.
299Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiDecodingType"})}}class P extends s.C{constructor(e){super(`Value "${e}" is not a valid array.`,{name:"InvalidArrayError"})}}class $ extends s.C{constructor(e){super(`"${e}" is not a valid definition type.
300Valid types: "function", "event", "error"`,{name:"InvalidDefinitionTypeError"})}}class k extends s.C{constructor(e){super(`Type "${e}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}},74479:(e,t,r)=>{"use strict";r.d(t,{W:()=>c});var n=r(84940),i=r(45897),s=r(22744),a=r(65402),o=r(82666),l=r(21394);function c(e){let{abi:t,data:r,cause:c}=e,u=(0,s.di)(r,0,4);if("0x"===u)throw new i.O({cause:c});let d=[...t||[],n.Mc,n.J9].find(e=>"error"===e.type&&u===(0,a.V)((0,l.B)(e)));if(!d)throw new i.Wq(u,{docsPath:"/docs/contract/decodeErrorResult",cause:c});return{abiItem:d,args:"inputs"in d&&d.inputs&&d.inputs.length>0?(0,o.n)(d.inputs,(0,s.di)(r,4)):void 0,errorName:d.name}}},74869:(e,t,r)=>{"use strict";r.d(t,{c:()=>l});var n=r(63710),i=r(95962),s=r(65409),a=r(64507),o=r(27526);function l(e){let{account:t,maxFeePerGas:r,maxPriorityFeePerGas:l,to:c}=e,u=t?(0,n.J)(t):void 0;if(u&&!(0,o.P)(u.address))throw new s.M({address:u.address});if(c&&!(0,o.P)(c))throw new s.M({address:c});if(r&&r>i.Ao)throw new a.BG({maxFeePerGas:r});if(l&&r&&l>r)throw new a.lN({maxFeePerGas:r,maxPriorityFeePerGas:l})}},74889:(e,t,r)=>{"use strict";r.d(t,{e:()=>o});var n=r(45897),i=r(82666),s=r(63547);let a="/docs/contract/decodeFunctionResult";function o(e){let{abi:t,args:r,functionName:o,data:l}=e,c=t[0];if(o){let e=(0,s.iY)({abi:t,args:r,name:o});if(!e)throw new n.Iz(o,{docsPath:a});c=e}if("function"!==c.type)throw new n.Iz(void 0,{docsPath:a});if(!c.outputs)throw new n.MR(c.name,{docsPath:a});let u=(0,i.n)(c.outputs,l);return u&&u.length>1?u:u&&1===u.length?u[0]:void 0}},74960:(e,t,r)=>{"use strict";let n;function i(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function s(e,t){let r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);let n=i(r);return(e,r)=>n.then(n=>r(n.transaction(t,e).objectStore(t)))}function a(){return n||(n=s("keyval-store","keyval")),n}function o(e,t=a()){return t("readonly",t=>i(t.get(e)))}function l(e,t,r=a()){return r("readwrite",r=>(r.put(t,e),i(r.transaction)))}function c(e,t=a()){return t("readwrite",t=>(t.delete(e),i(t.transaction)))}function u(e=a()){return e("readwrite",e=>(e.clear(),i(e.transaction)))}function d(e=a()){return e("readonly",e=>{var t;if(e.getAllKeys)return i(e.getAllKeys());let r=[];return(t=e=>r.push(e.key),e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},i(e.transaction)).then(()=>r)})}r.d(t,{HP:()=>d,IU:()=>u,Jt:()=>o,hZ:()=>l,y$:()=>s,yH:()=>c})},75123:(e,t,r)=>{"use strict";r.d(t,{vt:()=>s});var n=r(64959);let i={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new l({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new o({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new a({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new a({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===1/0)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function s(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(i);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}class a extends n.C{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class o extends n.C{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class l extends n.C{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}},75345:(e,t,r)=>{"use strict";r.d(t,{eL:()=>n,sz:()=>i});let n={gwei:9,wei:18},i={ether:-9,wei:9}},75941:(e,t,r)=>{"use strict";function n(e,t){return({exclude:r,format:n})=>({exclude:r,format:(e,i)=>{let s=t(e,i);if(r)for(let e of r)delete s[e];return{...s,...n(e,i)}},type:e})}r.d(t,{q:()=>n})},76243:(e,t,r)=>{"use strict";r.d(t,{l:()=>s});var n=r(99838),i=r(64507);function s(e,t){let r=(e.details||"").toLowerCase(),s=e instanceof n.C?e.walk(e=>e?.code===i.A7.code):e;return s instanceof n.C?new i.A7({cause:e,message:s.details}):i.A7.nodeMessage.test(r)?new i.A7({cause:e,message:e.details}):i.BG.nodeMessage.test(r)?new i.BG({cause:e,maxFeePerGas:t?.maxFeePerGas}):i.jj.nodeMessage.test(r)?new i.jj({cause:e,maxFeePerGas:t?.maxFeePerGas}):i.K0.nodeMessage.test(r)?new i.K0({cause:e,nonce:t?.nonce}):i.Oh.nodeMessage.test(r)?new i.Oh({cause:e,nonce:t?.nonce}):i.vW.nodeMessage.test(r)?new i.vW({cause:e,nonce:t?.nonce}):i.k5.nodeMessage.test(r)?new i.k5({cause:e}):i.lY.nodeMessage.test(r)?new i.lY({cause:e,gas:t?.gas}):i.Fo.nodeMessage.test(r)?new i.Fo({cause:e,gas:t?.gas}):i.uC.nodeMessage.test(r)?new i.uC({cause:e}):i.lN.nodeMessage.test(r)?new i.lN({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new i.RM({cause:e})}},77030:(e,t,r)=>{"use strict";r.d(t,{X:()=>m,J:()=>y});var n=r(67008),i=r(49786),s=r(44478),a=r(74263),o=r(50016),l=r(5360),c=r(10752),u=r(22760),d=r(99453);let f="/docs/contract/encodeErrorResult";function h(e){let{abi:t,errorName:r,args:n}=e,i=t[0];if(r){let e=(0,d.iY)({abi:t,args:n,name:r});if(!e)throw new a.yy(r,{docsPath:f});i=e}if("error"!==i.type)throw new a.yy(void 0,{docsPath:f});let s=(0,u.B)(i),h=(0,l.V)(s),p="0x";if(n&&n.length>0){if(!i.inputs)throw new a.ZP(i.name,{docsPath:f});p=(0,c.h)(i.inputs,n)}return(0,o.aP)([h,p])}let p="/docs/contract/encodeFunctionResult",y="x-batch-gateway:true";async function m(e){let{data:t,ccipRequest:r}=e,{args:[o]}=(0,s.J)({abi:n.b2,data:t}),l=[],u=[];return await Promise.all(o.map(async(e,t)=>{try{u[t]=e.urls.includes(y)?await m({data:e.data,ccipRequest:r}):await r(e),l[t]=!1}catch(e){var s;l[t]=!0,u[t]="HttpRequestError"===(s=e).name&&s.status?h({abi:n.b2,errorName:"HttpError",args:[s.status,s.shortMessage]}):h({abi:[i.Mc],errorName:"Error",args:["shortMessage"in s?s.shortMessage:s.message]})}})),function(e){let{abi:t,functionName:r,result:n}=e,i=t[0];if(r){let e=(0,d.iY)({abi:t,name:r});if(!e)throw new a.Iz(r,{docsPath:p});i=e}if("function"!==i.type)throw new a.Iz(void 0,{docsPath:p});if(!i.outputs)throw new a.MR(i.name,{docsPath:p});let s=(()=>
300{if(0===i.outputs.length)return[];if(1===i.outputs.length)return[n];if(Array.isArray(n))return n;throw new a.dm(n)})();return(0,c.h)(i.outputs,s)}({abi:n.b2,functionName:"query",result:[l,u]})}},77045:(e,t,r)=>{"use strict";r.d(t,{h:()=>s});var n=r(66471),i=r(17819);async function s(e,{hash:t}){let r=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!r)throw new n.Kc({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||i.uL)(r,"getTransactionReceipt")}},77424:(e,t,r)=>{"use strict";r.d(t,{h:()=>a});var n=r(88481),i=r(5596),s=r(36665);function a({r:e,s:t,to:r="hex",v:a,yParity:o}){let l=(()=>{if(0===o||1===o)return o;if(a&&(27n===a||28n===a||a>=35n))return+(a%2n===0n);throw Error("Invalid `v` or `yParity` value")})(),c=`0x${new n.secp256k1.Signature((0,i.uU)(e),(0,i.uU)(t)).toCompactHex()}${0===l?"1b":"1c"}`;return"hex"===r?c:(0,s.aT)(c)}},77557:(e,t,r)=>{"use strict";let n=r(32553);e.exports=u;let i=function(){function e(e){return void 0!==e&&e}try{if("undefined"!=typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let a=Symbol("pino.logFuncs"),o=Symbol("pino.hierarchy"),l={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function c(e,t){let r={logger:t,parent:e[o]};t[o]=r}function u(e){var t,r;(e=e||{}).browser=e.browser||{};let n=e.browser.transmit;if(n&&"function"!=typeof n.send)throw Error("pino: transmit option must have a send function");let o=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let p=e.serializers||{},y=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(p)),m=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(m=!1);let v=Object.keys(e.customLevels||{}),x=["error","fatal","warn","info","debug","trace"].concat(v);"function"==typeof o&&x.forEach(function(e){o[e]=o}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let _=e.level||"info",E=Object.create(o);E.log||(E.log=g);let A={};x.forEach(e=>{A[e]=o[e]?o[e]:i[e]||i[l[e]||"log"]||g}),E[a]=A,c({},E),Object.defineProperty(E,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(E,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,d(this,I,E,"error"),d(this,I,E,"fatal"),d(this,I,E,"warn"),d(this,I,E,"info"),d(this,I,E,"debug"),d(this,I,E,"trace"),v.forEach(e=>{d(this,I,E,e)})}});let I={transmit:n,serialize:y,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:x,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?b:w,messageKey:e.messageKey||"msg",onChild:e.onChild||g};function C(t,r,i){if(!r)throw Error("missing bindings for child Pino");i=i||{},y&&r.serializers&&(i.serializers=r.serializers);let s=i.serializers;if(y&&s){var a=Object.assign({},p,s),o=!0===e.browser.serialize?Object.keys(a):y;delete r.serializers,f([r],o,a,this._stdErrSerialize)}function l(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,a&&(this.serializers=a,this._serialize=o),n&&(this._logEvent=h([].concat(e._logEvent.bindings,r)))}l.prototype=this;let u=new l(this);return c(this,u),u.child=function(...e){return C.call(this,t,...e)},u.level=i.level||this.level,t.onChild(u),u}return E.levels=function(e){let t=e.customLevels||{};return{values:Object.assign({},u.levels.values,t),labels:Object.assign({},u.levels.labels,function(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}(t))}}(e),E.level=_,E.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},E.setMaxListeners=E.getMaxListeners=E.emit=E.addListener=E.on=E.prependListener=E.once=E.prependOnceListener=E.removeListener=E.removeAllListeners=E.listeners=E.listenerCount=E.eventNames=E.write=E.flush=g,E.serializers=p,E._serialize=y,E._stdErrSerialize=m,E.child=function(...e){return C.call(this,I,...e)},n&&(E._logEvent=h()),E}function d(e,t,r,l){var c,u,d,p,y,m,b;if(Object.defineProperty(e,l,{value:s(e.level,r)>s(l,r)?g:r[a][l],writable:!0,enumerable:!0,configurable:!0}),e[l]===g){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(l,r)<n)return}e[l]=(c=e,u=t,d=r,p=l,y=c[a][p],function(){let e=u.timestamp(),t=Array(arguments.length),r=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var a=0;a<t.length;a++)t[a]=arguments[a];var o=!1;if(u.serialize&&(f(t,this._serialize,this.serializers,this._stdErrSerialize),o=!0),u.asObject||u.formatters?y.call(r,...function(e,t,r,i,s){let{level:a,log:o=e=>e}=s.formatters||{},l=r.slice(),c=l[0],u={},d=(0|e._childLevel)+1;
300if(d<1&&(d=1),i&&(u.time=i),a?Object.assign(u,a(t,e.levels.values[t])):u.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==c&&"object"==typeof c)for(;d--&&"object"==typeof l[0];)Object.assign(u,l.shift());return[o(u),...l]}if(null!==c&&"object"==typeof c){for(;d--&&"object"==typeof l[0];)Object.assign(u,l.shift());c=l.length?n(l.shift(),l):void 0}else"string"==typeof c&&(c=n(l.shift(),l));return void 0!==c&&(u[s.messageKey]=c),[o(u)]}(this,p,t,e,u)):y.apply(r,t),u.transmit){let r=u.transmit.level||c._level,n=s(r,d),i=s(p,d);if(i<n)return;!function(e,t,r,n=!1){let i=t.send,s=t.ts,a=t.methodLevel,o=t.methodValue,l=t.val,c=e._logEvent.bindings;n||f(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=r.filter(function(e){return -1===c.indexOf(e)}),e._logEvent.level.label=a,e._logEvent.level.value=o,i(a,e._logEvent,l),e._logEvent=h(c)}(this,{ts:e,methodLevel:p,methodValue:i,transmitLevel:r,transmitValue:d.levels.values[u.transmit.level||c._level],send:u.transmit.send,val:s(c._level,d)},t,o)}});let w=function(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[o];for(;r.parent;)(r=r.parent).logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==w.length&&(e[l]=(m=w,b=e[l],function(){return b.apply(this,[...m,...arguments])}))}function f(e,t,r,n){for(let i in e)if(n&&e[i]instanceof Error)e[i]=u.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i])&&t)for(let n in e[i])t.indexOf(n)>-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function h(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function p(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function y(){return{}}function m(e){return e}function g(){}function b(){return!1}function w(){return Date.now()}u.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},u.stdSerializers={mapHttpRequest:y,mapHttpResponse:y,wrapRequestSerializer:m,wrapResponseSerializer:m,wrapErrorSerializer:m,req:y,res:y,err:p,errWithCause:p},u.stdTimeFunctions=Object.assign({},{nullTime:b,epochTime:w,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),e.exports.default=u,e.exports.pino=u},77603:(e,t,r)=>{"use strict";r.d(t,{A:()=>q,B:()=>m,C:()=>D,P:()=>B,S:()=>W,W:()=>L,a:()=>g,b:()=>P,c:()=>T,d:()=>y,e:()=>U,f:()=>E,g:()=>C,h:()=>V,i:()=>w,j:()=>N,k:()=>v,l:()=>F,m:()=>A,n:()=>_,o:()=>O,p:()=>b,q:()=>d,r:()=>f,s:()=>j,t:()=>x,u:()=>K,v:()=>h,w:()=>p,x:()=>S,y:()=>I,z:()=>R});
300var n=r(33861),i=r(9845),s=r(65601),a=r(13799),o=r(40175),l=r(26514);let c=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom||"isPhantom"in e?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,u=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==c(e))return!1;if(e.providers){for(let t of e.providers)if(!u(t))return!1}return!0},d=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1},f=(e,t)=>{let r=[],n=[];for(let[i,s]of e.entries())i<t?r.push(s):n.push(s);return[r,n]},h=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),p=(e,t)=>{let r=e.slice(0),n=[];for(;r.length;)n.push(r.splice(0,t));return n},y=(e,t=3,r=4,n="ethereum")=>{if(!e)return"";let i=2*("ethereum"===n);return t+r+i+3>=e.length?e:`${e.slice(0,i+t)}...${e.slice(e.length-r,e.length)}`},m=(e,t=3,r=4)=>y(e,t,r,"solana"),g=e=>new Promise(t=>setTimeout(t,e));function b(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((n,i)=>{let s,a=0,o=()=>{a>=r?i("Max attempts reached without result"):(s=e(),a+=t,null==s?setTimeout(o,t):n(s))};o()})}let w=(e,t={})=>{let r=t.delayMs||150,n=t.maxAttempts||270;return new Promise(async(i,s)=>{let a=!1,o=0;for(;!a&&o<n;){if(t.abortSignal?.aborted)return;e().then(e=>{a=!0,i(e)},(...e)=>{a=!0,s(...e)}),o+=1,await g(r)}a||s(Error("Exceeded max attempts before resolving function"))})},v=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),x=e=>"string"==typeof e?e:"0x"+e.toString(16);async function _({store:e,walletList:t,externalWalletConfig:r,walletChainType:n,timeout:i=3e3}){let s=!1,a=window;return new Promise(o=>{function l(){if(s)return;s=!0,window.removeEventListener("ethereum#initialized",l);let i=e.getProviders();console.debug("Detected injected providers:",i.map(e=>e.info));let a=[];for(let e of i)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===n&&"app.phantom"===e.info.rdns||a.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==n)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let e of t.providers)e&&r.push(e);return r.push(e.ethereum),r}()){let t=c(e);if(!i.some(e=>e.info.name===t)){if(u(e,!0)&&!a.find(e=>"metamask"===e.type)){a.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!a.find(e=>"phantom"===e.type)){a.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!a.find(e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==r.coinbaseWallet?.config?.preference?.options)){a.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}a.find(e=>"unknown_browser_extension"===e.type)||a.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}o(a)}a.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},i))})}function E(e){return`eip155:${String(Number(e))}`}let A=(e,t,r,s)=>{let a=Number(e),o=t.find(e=>e.id===a);if(!o)throw new n.e(`Unsupported chainId ${e}`,4901);return(0,i.a)(o,r,s)},I=(e,t)=>{let r=Number(e),i=t.find(e=>e.id===r);if(!i)throw new n.e(`Unsupported chainId ${e}`,4901);return i.blockExplorers?.default.url},C=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([e,r])=>
300{if(null!=r&&"string"==typeof e&&e in t)return{name:e,type:t[e]}}).filter(e=>void 0!==e);return{...e,types:{...e.types,EIP712Domain:r}}};function S(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)}let P=e=>e?.map(e=>({signer_id:e.signerId,override_policy_ids:e.policyIds})),$="[Privy:Connectors]";function k(e){if(!e||0===Object.keys(e).length)return"";let t=Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}=${String(t)}`);return t.length>0?` (${t.join(", ")})`:""}let T=new class{setEnabled(e){this._enabled=e,e&&this.info("Debug logging enabled")}get enabled(){return this._enabled}debug(e,t){this._enabled&&console.debug(`${$} ${e}${k(t)}`)}info(e,t){this._enabled&&console.info(`${$} ${e}${k(t)}`)}warn(e,t){this._enabled&&console.warn(`${$} ${e}${k(t)}`)}error(e,t,r){if(!this._enabled)return;let n=t instanceof Error?t.message:t?String(t):void 0,i=n?{...r,error:n}:r;console.error(`${$} ${e}${k(i)}`)}connectionStart(e,t,r){this.info("Connection attempt started",{wallet:e,method:t,...r})}connectionSuccess(e,t){this.info("Connection successful",{wallet:e,...t})}connectionFailed(e,t,r){this.error("Connection failed",t,{wallet:e,...r})}connectorInit(e,t,r){this.debug("Connector initialized",{connector:e,wallet:t,...r})}connectorCreated(e,t,r){this.debug("Connector created",{connector:e,wallet:t,...r})}providerEvent(e,t,r){this.debug(`Provider event: ${e}`,{wallet:t,...r})}rpcRequest(e,t,r){this.debug(`RPC request: ${e}`,{wallet:t,...r})}rpcResponse(e,t,r){this.debug(`RPC response: ${e}`,{wallet:t,...r})}constructor(){this._enabled=!1}};class O extends n.e{constructor(){super("Wallet timeout"),this.type="wallet_error",T.warn("Wallet request timed out")}}let N=e=>{if(e instanceof n.e)return T.debug("Connector error (already formatted)",{error:e.message}),e;if("number"==typeof e?.code){let t=new B(e);return T.debug("Provider RPC error",{code:t.code,error:t.message}),t}let t=e instanceof Error?e.message:String(e);return T.debug("Unknown connector error",{error:t}),new n.e(t||"Unknown connector error",e)};class R extends n.b{constructor(e,t,r){super(e),this.type="provider_error",this.code=t,this.data=r}}class B extends R{constructor(e){super(e.message,e.code,e.data);let t=Object.values(s.Z9).find(t=>t.eipCode===e.code);this.details=t||s.Z9.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=s.Z9.E32002_CONNECTION_ALREADY_PENDING:this.details=s.Z9.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=s.Z9.E32002_WALLET_LOCKED))}}let D={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...s.Z9};class M{get(e){let t=localStorage.getItem(e);return null===t?void 0:JSON.parse(t)}put(e,t){void 0!==t?localStorage.setItem(e,JSON.stringify(t)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map(([e])=>e)}}function U(){try{let e="privy:__session_storage__test",t=new M;return t.put(e,"blobby"),t.del(e),!0}catch(e){return!1}}var j="undefined"!=typeof window&&window.localStorage?new M:new class{get(e){return this._cache[e]}put(e,t){void 0!==t?this._cache[e]=t:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};class L extends a.A{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}let F=()=>{let e=j.get(o.C);return e&&Array.isArray(e)&&e.map(e=>(e=>e&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt)(e)).every(Boolean)?e:[]},z=["phantom","glow","solflare","backpack","okx_wallet","walletconnect","mobile_wallet_adapter","jupiter","tokenpocket"];function q(e){return e.toLowerCase().split(" ").join("_")}class W extends L{get isInstalled(){return!0}get wallet(){return this._wallet}buildConnectedWallet(){return this._wallet.accounts.map(e=>({type:"solana",provider:new s.WW({wallet:this._wallet,account:e}),address:e.address,connectedAt:Date.now(),walletClientType:this._wallet.name,connectorType:this.connectorType,imported:!1,meta:{name:this._wallet.name,id:this._wallet.name,icon:this._wallet.icon},isConnected:async()=>this._wallet.accounts.length>0,disconnect:async()=>{await this.disconnect()}}))}async syncAccounts(){this.wallets=this.buildConnectedWallet(),this.emit
300("walletsUpdated")}get walletBranding(){return{id:H(this.wallet)?"walletconnect_solana":this.wallet.name,name:this.wallet.name,icon:this.wallet.icon}}async initialize(){T.debug("Initializing Solana connector",{wallet:this.walletClientType}),this.subscribeListeners(),await this.syncAccounts(),this.shouldAttemptAutoConnect()&&(T.debug("Attempting Solana auto-connect",{wallet:this.walletClientType}),await this.wallet.features["standard:connect"]?.connect({silent:!0}).catch(()=>{}),await this.isConnected()&&(T.debug("Solana auto-connect successful",{wallet:this.walletClientType}),await this.syncAccounts())),this.initialized=!0,this.emit("initialized")}async connect(e){if(T.connectionStart(this.walletClientType,"solana_adapter",{showPrompt:e.showPrompt}),e.showPrompt)try{await this.promptConnection()}catch(e){if(0===this._wallet.accounts.length)throw T.warn("Solana wallet connected but has no accounts",{wallet:this.walletClientType}),new n.i;throw T.connectionFailed(this.walletClientType,e,{method:"solana_adapter"}),e}if(!await this.isConnected())throw T.warn("Solana wallet not connected after prompt",{wallet:this.walletClientType}),new n.i;await this.syncAccounts();let t=await this.getConnectedWallet();return t&&T.connectionSuccess(this.walletClientType),t}async getConnectedWallet(){return this.wallets.sort((e,t)=>t.connectedAt-e.connectedAt)[0]||null}async isConnected(){return this._wallet.accounts.length>0}subscribeListeners(){this._unsubscribeListeners=this.wallet.features["standard:events"]?.on("change",this.onChange)}unsubscribeListeners(){this._unsubscribeListeners?.()}shouldAttemptAutoConnect(){return!(!this.autoConnectEnabled||!z.includes(this.walletClientType))&&("phantom"!==this.walletClientType||F().some(({walletClientType:e})=>"phantom"===e))}constructor(e,t){super(q(H(e)?"walletconnect_solana":e.name)),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=async()=>{T.debug("Disconnecting Solana wallet",{wallet:this.walletClientType}),await this.wallet.features["standard:disconnect"]?.disconnect().catch(e=>{T.error("Error disconnecting Solana wallet",e,{wallet:this.walletClientType})}),await this.syncAccounts()},this.promptConnection=async()=>{T.debug("Prompting Solana connection",{wallet:this.walletClientType});try{await this.wallet.features["standard:connect"]?.connect()}catch(e){throw T.connectionFailed(this.walletClientType,e,{method:"solana_adapter"}),N(e)}},this.onChange=()=>{this.syncAccounts()},this._wallet=e,this.autoConnectEnabled=t,this.wallets=[]}}function H(e){return"isWalletConnectSolana"in e&&e.isWalletConnectSolana}let K=({style:e,...t})=>{let r=(0,o.u)();return(0,l.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,l.jsx)("rect",{width:"28",height:"28",rx:"3",fill:"dark"===r?.appearance.palette.colorScheme?"#3396ff":"#141414"}),(0,l.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,l.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3
300639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,l.jsx)("defs",{children:(0,l.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,l.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})},V="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC"},77809:(e,t,r)=>{"use strict";function n(e,...t){return t.reduce((e,t)=>t(e),e)}r.d(t,{F:()=>n})},77864:(e,t,r)=>{"use strict";r.d(t,{c:()=>f});var n=r(99838);class i extends n.C{constructor(e){super(`Call bundle failed with status: ${e.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}}var s=r(29447),a=r(81561),o=r(19866),l=r(47240),c=r(96793),u=r(40508),d=r(52510);async function f(e,t){let r,{id:n,pollingInterval:f=e.pollingInterval,status:p=({statusCode:e})=>200===e||e>=300,retryCount:y=4,retryDelay:m=({count:e})=>200*~~(1<<e),timeout:g=6e4,throwOnFailure:b=!1}=t,w=(0,u.A)(["waitForCallsStatus",e.uid,n]),{promise:v,resolve:x,reject:_}=(0,l.Y)(),E=(0,a.lB)(w,{resolve:x,reject:_},t=>{let a=(0,o.w)(async()=>{let o=e=>{clearTimeout(r),a(),e(),E()};try{let r=await (0,c.b)(async()=>{let t=await (0,s.T)(e,d.k,"getCallsStatus")({id:n});if(b&&"failure"===t.status)throw new i(t);return t},{retryCount:y,delay:m});if(!p(r))return;o(()=>t.resolve(r))}catch(e){o(()=>t.reject(e))}},{interval:f,emitOnBegin:!0});return a});return r=g?setTimeout(()=>{E(),clearTimeout(r),_(new h({id:n}))},g):void 0,await v}class h extends n.C{constructor({id:e}){super(`Timed out while waiting for call bundle with id "${e}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}},78136:(e,t,r)=>{"use strict";r.d(t,{E:()=>c});var n=r(97352),i=r(23536),s=r(72693),a=r(38519),o=r(12089),l=r(56947);async function c(e,t){return c.internal(e,l.v,"sendTransaction",t)}(c||(c={})).internal=async function(e,t,r,l){let{abi:c,account:u=e.account,address:d,args:f,functionName:h,...p}=l;if(void 0===u)throw new i.T({docsPath:"/docs/contract/writeContract"});let y=u?(0,n.J)(u):null,m=(0,s.p)({abi:c,args:f,functionName:h});try{return await (0,o.T)(e,t,r)({data:m,to:d,account:y,...p})}catch(e){throw(0,a.j)(e,{abi:c,address:d,args:f,docsPath:"/docs/contract/writeContract",functionName:h,sender:y?.address})}}},78492:(e,t,r)=>{"use strict";function n(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),i=0;i<3;i++){var s=Number(r[i]),a=Number(n[i]);if(s>a)return 1;if(a>s)return -1;if(!isNaN(s)&&isNaN(a))return 1;if(isNaN(s)&&!isNaN(a))return -1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}r.d(t,{Ay:()=>d,Ko:()=>w,J_:()=>v,aR:()=>g});var i=r(71895),s=/^\d+$/;function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=a(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}(n.key),n)}}function c(e,t,r){return t&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var u=" ext. ",d=c(function e(t){o(this,e),g(t),this.metadata=t,x.call(this,t)},[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(e){return"001"!==e})}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!this.v1&&!this.v2&&!this.v3)return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;
vendor: 6,351 bytes, line 300
300if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){e&&(s.test(e)?n=e:r=e);if(t&&(n=t),r&&"001"!==r){var r,n,i=this.getCountryMetadata(r);if(!i)throw Error("Unknown country: ".concat(r));this.numberingPlan=new f(i,this)}else if(n){if(!this.hasCallingCode(n))throw Error("Unknown calling code: ".concat(n));this.numberingPlan=new f(this.getNumberingPlanMetadata(n),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var r=this.nonGeographic()[e];if(r)return r}else{var n=this.countryCallingCodes()[e];if(n&&1===n.length&&"001"===n[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),f=c(function e(t,r){o(this,e),this.globalMetadataObject=r,this.metadata=t,x.call(this,r.metadata)},[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"_getDefaultCountryMetadataForThisCallingCode",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this._getDefaultCountryMetadataForThisCallingCode()}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this;return(this._getFormats(this.metadata)||this._getFormats(this._getDefaultCountryMetadataForThisCallingCode())||[]).map(function(t){return new h(t,e)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(e){if(this.hasTypes()&&m(this.types(),e))return new y(m(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?u:this.metadata[13]||u}}]),h=c(function e(t,r){o(this,e),this._format=t,this.metadata=r},[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||p.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),p=/^\(?\$1\)?$/,y=c(function e(t,r){o(this,e),this.type=t,this.metadata=r},[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.t
300ype[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]);function m(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}function g(e){if(!e)throw Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!(0,i.A)(e)||!(0,i.A)(e.countries))throw Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat((0,i.A)(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+b(e)+": "+e,"."))}var b=function(e){return a(e)};function w(e,t){var r=new d(t);if(r.hasCountry(e))return r.selectNumberingPlan(e).countryCallingCode();throw Error("Unknown country: ".concat(e))}function v(e,t){return t.countries.hasOwnProperty(e)}function x(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===n(t,"1.2.0")?this.v2=!0:-1===n(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}},78615:(e,t,r)=>{"use strict";function n(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}r.d(t,{_:()=>n})},79239:(e,t,r)=>{"use strict";r.d(t,{v:()=>c});var n=r(97352),i=r(74889),s=r(72693),a=r(38519),o=r(12089),l=r(71151);async function c(e,t){let{abi:r,address:c,args:u,functionName:d,dataSuffix:f="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,...h}=t,p=h.account?(0,n.J)(h.account):e.account,y=(0,s.p)({abi:r,args:u,functionName:d});try{let{data:n}=await (0,o.T)(e,l.T,"call")({batch:!1,data:`${y}${f?f.replace("0x",""):""}`,to:c,...h,account:p}),s=(0,i.e)({abi:r,args:u,functionName:d,data:n||"0x"}),a=r.filter(e=>"name"in e&&e.name===t.functionName);return{result:s,request:{abi:a,address:c,args:u,dataSuffix:f,functionName:d,...h,account:p}}}catch(e){throw(0,a.j)(e,{abi:r,address:c,args:u,docsPath:"/docs/contract/simulateContract",functionName:d,sender:p?.address})}}},79608:(e,t,r)=>{"use strict";r.d(t,{X:()=>a});var n=r(75834),i=r(78615),s=r(35424);function a(e){let t=(0,s._)(e),r=(0,n.useRef)(!1);(0,n.useEffect)(()=>(r.current=!1,()=>{r.current=!0,(0,i._)(()=>{r.current&&t()})}),[t])}},79869:(e,t,r)=>{"use strict";r.d(t,{L:()=>p});var n=r(39534),i=r(15520);class s extends i.C{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}var a=r(82778),o=r(86326),l=r(97314);let c={current:0,take(){return this.current++},reset(){this.current=0}};async function u(e,{maxResponseBodySize:t}){if(!1===t)return e.text();let r=e.headers.get("Content-Length");if(r){let e=Number(r);if(e>t)throw new n.f({maxSize:t,size:e})}if(!e.body){let r=await e.text(),i=new TextEncoder().encode(r).length;if(i>t)throw new n.f({maxSize:t,size:i});return r}let i=e.body.getReader(),s=new TextDecoder,a="",o=0;try{for(;;){let{done:e,value:r}=await i.read();if(e)break;if((o+=r.byteLength)>t)throw await i.cancel(),new n.f({maxSize:t,size:o});a+=s.decode(r,{stream:!0})}return a+=s.decode()}finally{i.releaseLock()}}var d=r(18323);let f=0,h=new WeakMap;function p(e,t={}){let{batch:r,fetchFn:i,fetchOptions:y,key:m="http",maxResponseBodySize:g,methods:b,name:w="HTTP JSON-RPC",onFetchRequest:v,onFetchResponse:x,retryDelay:_,raw:E}=t;return({chain:p,retryCount:A,timeout:I})=>{let{batchSize:C=1e3,wait:S=0}="object"==typeof r?r:{},P=t.retryCount??A,$=I??t.timeout??1e4,k=e||p?.rpcUrls.default.http[0];if(!k)throw new s;let T=function(e,t={}){let{url:r,headers:i}=function(e){try{let t=new URL(e),r=(()=>{if(t.username){let e=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(e)}`}}}})();return{url:t.toString(),...r}}catch{return{url:e}}}(e);return{async request(e){let{body:s,fetchFn:a=t.fetchFn??fetch,maxResponseBodySize:d=t.maxResponseBodySize??0xa00000,onRequest:f=t.onRequest,onResponse:h=t.onResponse,timeout:p=t.t
300imeout??1e4}=e,y={...t.fetchOptions??{},...e.fetchOptions??{}},{headers:m,method:g,signal:b}=y;try{let e,t=await function(e,{errorInstance:t=Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let a,l=new AbortController;try{r>0&&(a=setTimeout(()=>{n?l.abort():s(t)},r)),i(await e({signal:l?.signal||null}))}catch(e){if(l?.signal.aborted&&(0,o.zf)(e))return void s(t);s(e)}finally{clearTimeout(a)}})()})}(async({signal:e})=>{let t={...y,body:Array.isArray(s)?(0,l.A)(s.map(e=>({jsonrpc:"2.0",id:e.id??c.take(),...e}))):(0,l.A)({jsonrpc:"2.0",id:s.id??c.take(),...s}),headers:{...i,"Content-Type":"application/json",...m},method:g||"POST",signal:b||(p>0?e:null)},n=new Request(r,t),o=await f?.(n,t)??{...t,url:r};return await a(o.url??r,o)},{errorInstance:new n.MU({body:s,url:r}),timeout:p,signal:!0});h&&await h(t);let w=await u(t,{maxResponseBodySize:d});if(t.headers.get("Content-Type")?.startsWith("application/json"))e=JSON.parse(w);else{e=w;try{e=JSON.parse(e||"{}")}catch(r){if(t.ok)throw r;e={error:e}}}if(!t.ok){if("number"==typeof e.error?.code&&"string"==typeof e.error?.message)return e;throw new n.Ci({body:s,details:(0,l.A)(e.error)||t.statusText,headers:t.headers,status:t.status,url:r})}return e}catch(e){if(b?.aborted)throw(0,o.TY)(b);if((0,o.zf)(e)||e instanceof n.Ci||e instanceof n.f||e instanceof n.MU)throw e;throw new n.Ci({body:s,cause:e,url:r})}}}}(k,{fetchFn:i,fetchOptions:y,maxResponseBodySize:g,onRequest:v,onResponse:x,timeout:$});return(0,d.o)({key:m,methods:b,name:w,async request({method:e,params:t},i){let s={method:e,params:t},o=i?.signal?{signal:i.signal}:void 0,{schedule:l}=(0,a.u)({id:`${k}.${function(e){if(!e)return"default";let t=h.get(e);if(void 0!==t)return t;let r=f++;return h.set(e,r),r}(i?.signal)}`,wait:S,shouldSplitBatch:e=>e.length>C,fn:e=>T.request({body:e,fetchOptions:o}),sort:(e,t)=>e.id-t.id}),c=async e=>r?l(e):[await T.request({body:e,fetchOptions:o})],[{error:u,result:d}]=await c(s);if(E)return{error:u,result:d};if(u)throw new n.J8({body:s,error:u,url:k});return d},retryCount:P,retryDelay:_,timeout:$,type:"http"},{fetchOptions:y,url:k})}}},80384:(e,t,r)=>{"use strict";r.d(t,{L:()=>i});var n=r(66471);function i(e){if(e.type)return e.type;if(void 0!==e.authorizationList)return"eip7702";if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new n.Vg({transaction:e})}},80619:(e,t,r)=>{let n=r(28598),i=r(7265);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},81436:(e,t,r)=>{"use strict";r.d(t,{OT:()=>l});var n=r(17572);let i=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}(),s=i.fetch?(...e)=>i.fetch(...e):()=>Promise.reject(Error("[ofetch] global.fetch is not supported!")),a=i.Headers,o=i.AbortController,l=(0,n.c)({fetch:s,Headers:a,AbortController:o})},81505:(e,t,r)=>{"use strict";r.d(t,{E:()=>n});let n=1},81561:(e,t,r)=>{"use strict";r.d(t,{lB:()=>a});let n=new Map,i=new Map,s=0;function a(e,t,r){let a=++s,o=()=>n.get(e)||[],l=()=>{let t=o();if(!t.some(e=>e.id===a))return;let r=i.get(e);if(1===t.length&&r){let e=r();e instanceof Promise&&e.catch(()=>{})}(()=>
300{let t=o().filter(e=>e.id!==a);if(0===t.length){n.delete(e),i.delete(e);return}n.set(e,t)})()},c=o();if(n.set(e,[...c,{id:a,fns:t}]),c&&c.length>0)return l;let u={};for(let e in t)u[e]=(...t)=>{let r=o();if(0!==r.length)for(let n of r)n.fns[e]?.(...t)};let d=r(u);return"function"==typeof d&&i.set(e,d),l}},81655:(e,t,r)=>{"use strict";r.d(t,{MM:()=>w,ft:()=>_});var n=r(97352),i=r(90892),s=r(3901),a=r(42606),o=r(12934),l=r(24243),c=r(54722),u=r(44775),d=r(58797),f=r(49369),h=r(12089),p=r(42450),y=r(94383),m=r(80384),g=r(64233),b=r(72767);let w=["blobVersionedHashes","chainId","fees","gas","nonce","type"],v=new Map,x=new p.A(128);async function _(e,t){let r,p,_=t;_.account??=e.account,_.parameters??=w;let{account:E,chain:A=e.chain,nonceManager:I,parameters:C}=_,S="function"==typeof A?.prepareTransactionRequest?{fn:A.prepareTransactionRequest,runAt:["beforeFillTransaction"]}:Array.isArray(A?.prepareTransactionRequest)?{fn:A.prepareTransactionRequest[0],runAt:A.prepareTransactionRequest[1].runAt}:void 0;async function P(){return r?r:void 0!==_.chainId?_.chainId:A?A.id:r=await (0,h.T)(e,b.T,"getChainId")({})}let $=E?(0,n.J)(E):E,k=_.nonce;if(C.includes("nonce")&&void 0===k&&$&&I){let t=await P();k=await I.consume({address:$.address,chainId:t,client:e})}if(S?.fn&&S.runAt?.includes("beforeFillTransaction")){_=await S.fn({..._,chain:A},{client:e,phase:"beforeFillTransaction"}),k??=_.nonce;let t=_.account??_.from;$=t?(0,n.J)(t):void 0}let T=(!(C.includes("blobVersionedHashes")||C.includes("sidecars"))||!_.kzg||!_.blobs)&&!1!==x.get(e.uid)&&(C.length>0&&"feePayer"in _&&_.feePayer&&(!("feePayerSignature"in _)||!_.feePayerSignature)||["fees","gas"].some(e=>C.includes(e))&&(C.includes("chainId")&&"number"!=typeof _.chainId||C.includes("nonce")&&"number"!=typeof k||C.includes("fees")&&"bigint"!=typeof _.gasPrice&&("bigint"!=typeof _.maxFeePerGas||"bigint"!=typeof _.maxPriorityFeePerGas)||C.includes("gas")&&"bigint"!=typeof _.gas))?await (0,h.T)(e,g.a,"fillTransaction")({..._,nonce:k}).then(t=>{let{chainId:r,from:n,gas:i,gasPrice:s,nonce:a,maxFeePerBlobGas:o,maxFeePerGas:l,maxPriorityFeePerGas:c,type:u,...d}=t.transaction,f="feeToken"in d?d.feeToken:void 0,h="feePayerSignature"in d&&null!==d.feePayerSignature&&void 0!==d.feePayerSignature,p=null!=f&&(!("feeToken"in _)||h);return x.set(e.uid,!0),{..._,...n?{from:n}:{},...u&&!_.type?{type:u}:{},...void 0!==r?{chainId:r}:{},...void 0!==i?{gas:i}:{},...void 0!==s?{gasPrice:s}:{},...void 0!==a?{nonce:a}:{},...void 0!==o&&"legacy"!==_.type&&"eip2930"!==_.type?{maxFeePerBlobGas:o}:{},...void 0!==l&&"legacy"!==_.type&&"eip2930"!==_.type?{maxFeePerGas:l}:{},...void 0!==c&&"legacy"!==_.type&&"eip2930"!==_.type?{maxPriorityFeePerGas:c}:{},..."nonceKey"in d&&void 0!==d.nonceKey?{nonceKey:d.nonceKey}:{},..."keyAuthorization"in d&&void 0!==d.keyAuthorization&&null!==d.keyAuthorization&&!("keyAuthorization"in _)?{keyAuthorization:d.keyAuthorization}:{},..."feePayerSignature"in d&&void 0!==d.feePayerSignature&&null!==d.feePayerSignature?{feePayerSignature:d.feePayerSignature}:{},...p?{feeToken:f}:{},...t.capabilities?{_capabilities:t.capabilities}:{}}}).catch(t=>{if("TransactionExecutionError"!==t.name)return _;if(t.walk?.(e=>"ExecutionRevertedError"===e.name))throw t;return t.walk?.(e=>"MethodNotFoundRpcError"===e.name||"MethodNotSupportedRpcError"===e.name||e.message?.includes("eth_fillTransaction is not available"))&&x.set(e.uid,!1),_}):_;k??=T.nonce;let{blobs:O,gas:N,kzg:R,type:B}=_={...T,...$?{from:$?.address}:{},...void 0!==k?{nonce:k}:{}};async function D(){return p||(p=await (0,h.T)(e,a.g,"getBlock")({blockTag:"latest"}))}if(S?.fn&&S.runAt?.includes("beforeFillParameters")&&(_=await S.fn({..._,chain:A},{client:e,phase:"beforeFillParameters"})),C.includes("nonce")&&void 0===k&&$&&!I&&(_.nonce=await (0,h.T)(e,o.y,"getTransactionCount")({address:$.address,blockTag:"pending"})),(C.includes("blobVersionedHashes")||C.includes("sidecars"))&&O&&R){let e=(0,c.S)({blobs:O,kzg:R});if(C.includes("blobVersionedHashes")){let t=(0,d.d)({commitments:e,to:"hex"});_.blobVersionedHashes=t}if(C.includes("sidecars")){let t=(0,u.t)({blobs:O,commitments:e,kzg:R}),r=(0,f.T)({blobs:O,commitments:e,proofs:t,to:"hex"});_.sidecars=r}}if(C.includes("chainId")&&(_.chainId=await P()),(C.includes("fees")||C.includes("type"))&&void 0===B)try{_.type=(0,m.L)(_)}catch{let t=v.get(e.uid);if(void 0===t){let r=await D();t="bigint"==typeof r?.baseFeePerGas,v.set(e.uid,t)}_.type=t?"eip1559":"legacy"}if(C.includes("fees"))if("legacy"!==_.type&&"eip2930"!==_.type){if(void 0===_.maxFeePerGas||void 0===_.maxPriorityFeePerGas){let t=await D(),{maxFeePerGas:r,maxPriorityFeePerGas:n}=await (0,i.O)(e,{block:t,chain:A,request:_});if(void 0===_.maxPriorityFeePerGas&&_.maxFeePerGas&&_.maxFeePerGas<n)throw new l.RR({maxPriorityFeePerGas:n});_.maxPriorityFeePerGas=n,_.maxFeePerGas=r}}else{if(void 0!==_.maxFeePerGas||void 0!==_.maxPriorityFeePerGas)throw new l.pw;if(void 0===_.gasPrice){let t=await D(),{gasPrice:r}=await (0,i.O)(e,{block:t,chain:A,request:_,type:"legacy"});_.gasPrice=r}}return C.includes("gas")&&void 0===N&&(_.gas=await (0,h.T)(e,s.Q,"estimateGas")({..._,account:$,prepare:$?.type==="local"?[]:["blobVersionedHashes"]})),S?.fn&&S.runAt?.includes("afterFillParameters")&&(_=await S.fn({..._,chain:A},{client:e,phase:"afterFillParameters"})),(0,y.c)(_),delete _.parameters,_}},82497:(e,t,r)=>{"use strict";async function n(e){return BigInt(await e.request({method:"eth_gasPrice"}))}r.d(t,{L:()=>n})},82666:(e,t,r)=>{"use strict";r.d(t,{n:()=>y});var n=r(45897),i=r(11400),s=r(65195),a=r(21047),o=r(22744),l=r(65636),c=r(4538),u=r(36174),d=r(44037);function f(e,t={}){void 0!==t.size&&(0,u.Sl)(e,{size:t.size});let r=(0,d.My)(e,t);return(0,u.ME)(r,t)}var h=r(32579),p=r(15678);function y(e,t){let r="string"==typeof t?(0,h.aT)(t):t,y=(0,s.l)(r);if(0===(0,a.E)(r)&&e.length>0)throw new n.O;if((0,a.E)(t)&&32>(0,a.E)(t))throw new n.Iy({data:"string"==typeof t?t:(0,d.My)(t),params:e,size:(0,a.E)(t)});let g=0,b=[];for(let t=0;t<e.length;++t){let s=e[t];g<r.length&&y.setPosition(g);let[a,h]=function e(t,r,{staticPosition:s}){let a=(0,p.k)(r.type);
vendor: 4,152 bytes, line 300
300if(a){let[n,i]=a;return function(t,r,{length:n,staticPosition:i}){if(null===n){let n=i+f(t.readBytes(32)),s=n+32;t.setPosition(n);let a=f(t.readBytes(32)),o=m(r),l=0,c=[];for(let n=0;n<a;++n){t.setPosition(s+(o?32*n:l));let[i,a]=e(t,r,{staticPosition:s});l+=a,c.push(i),0===a&&(t.assertReadLimit(),t._touch())}return t.setPosition(i+32),[c,32]}if(m(r)){let s=i+f(t.readBytes(32)),a=[];for(let i=0;i<n;++i){t.setPosition(s+32*i);let[n]=e(t,r,{staticPosition:s});a.push(n)}return t.setPosition(i+32),[a,32]}let s=0,a=[];for(let o=0;o<n;++o){let[n,o]=e(t,r,{staticPosition:i+s});s+=o,a.push(n),0===o&&(t.assertReadLimit(),t._touch())}return[a,s]}(t,{...r,type:i},{length:n,staticPosition:s})}if("tuple"===r.type)return function(t,r,{staticPosition:n}){let i=0===r.components.length||r.components.some(({name:e})=>!e),s=i?[]:{},a=0;if(m(r)){let o=n+f(t.readBytes(32));for(let n=0;n<r.components.length;++n){let l=r.components[n];t.setPosition(o+a);let[c,u]=e(t,l,{staticPosition:o});a+=u,s[i?n:l?.name]=c}return t.setPosition(n+32),[s,32]}for(let o=0;o<r.components.length;++o){let l=r.components[o],[c,u]=e(t,l,{staticPosition:n});s[i?o:l?.name]=c,a+=u}return[s,a]}(t,r,{staticPosition:s});if("address"===r.type){var h=t;let e=h.readBytes(32);return[(0,i.o)((0,d.My)((0,o.A1)(e,-20))),32]}if("bool"===r.type)return[function(e,t={}){let r=e;if(void 0!==t.size&&((0,u.Sl)(r,{size:t.size}),r=(0,c.B)(r)),r.length>1||r[0]>1)throw new l.xO(r);return!!r[0]}(t.readBytes(32),{size:32}),32];if(r.type.startsWith("bytes"))return function(e,t,{staticPosition:r}){let[n,i]=t.type.split("bytes");if(!i){let t=f(e.readBytes(32));e.setPosition(r+t);let n=f(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];let i=e.readBytes(n);return e.setPosition(r+32),[(0,d.My)(i),32]}return[(0,d.My)(e.readBytes(Number.parseInt(i,10),32)),32]}(t,r,{staticPosition:s});if(r.type.startsWith("uint")||r.type.startsWith("int")){var y=t,g=r;let e=g.type.startsWith("int"),n=Number.parseInt(g.type.split("int")[1]||"256",10),i=y.readBytes(32);return[n>48?function(e,t={}){void 0!==t.size&&(0,u.Sl)(e,{size:t.size});let r=(0,d.My)(e,t);return(0,u.uU)(r,t)}(i,{signed:e}):f(i,{signed:e}),32]}if("string"===r.type)return function(e,{staticPosition:t}){let r=f(e.readBytes(32));e.setPosition(t+r);let n=f(e.readBytes(32));if(0===n)return e.setPosition(t+32),["",32];let i=function(e,t={}){let r=e;return void 0!==t.size&&((0,u.Sl)(r,{size:t.size}),r=(0,c.B)(r,{dir:"right"})),new TextDecoder().decode(r)}(e.readBytes(n,32));return e.setPosition(t+32),[i,32]}(t,{staticPosition:s});throw new n.j(r.type,{docsPath:"/docs/contract/decodeAbiParameters"})}(y,s,{staticPosition:0});g+=h,b.push(a)}return b}function m(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(m);let r=(0,p.k)(e.type);return!!(r&&m({...e,type:r[1]}))}},82762:(e,t,r)=>{"use strict";r.d(t,{G_:()=>o,HT:()=>s,lh:()=>c});var n=r(62610),i=r(21557);function s(e,t={}){return"string"==typeof e.chainId?a(e):{...e,...t.signature}}function a(e){let{address:t,chainId:r,nonce:n}=e,s=i.o6(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...s}}function o(e){return e.map(a)}function l(e){let{address:t,chainId:r,nonce:s,...a}=e;return{address:t,chainId:n.oB(r),nonce:n.oB(s),...i.J$(a)}}function c(e){return e.map(l)}},82778:(e,t,r)=>{"use strict";r.d(t,{u:()=>s});var n=r(52862);let i=new Map;function s({fn:e,id:t,shouldSplitBatch:r,wait:s=0,sort:a}){let o=async()=>{let t=c();l();let r=t.map(({args:e})=>e);0!==r.length&&e(r).then(e=>{a&&Array.isArray(e)&&e.sort(a);for(let r=0;r<t.length;r++){let{resolve:n}=t[r];n?.([e[r],e])}}).catch(e=>{for(let r=0;r<t.length;r++){let{reject:n}=t[r];n?.(e)}})},l=()=>i.delete(t),c=()=>i.get(t)||[],u=e=>i.set(t,[...c(),e]);return{flush:l,async schedule(e){let{promise:t,resolve:i,reject:a}=(0,n.Y)();return(r?.([...c().map(({args:e})=>e),e])&&o(),c().length>0)?u({args:e,resolve:i,reject:a}):(u({args:e,resolve:i,reject:a}),setTimeout(o,s)),t}}}},82804:(e,t,r)=>{"use strict";r.d(t,{w:()=>i});var n=r(19284);function i(e,{emitOnBegin:t,initialWaitTime:r,interval:i}){let s=!0,a=()=>s=!1;return(async()=>{let o;
300t&&(o=await e({unpoll:a}));let l=await r?.(o)??i;await (0,n.u)(l);let c=async()=>{s&&(await e({unpoll:a}),await (0,n.u)(i),c())};c()})(),a}},83121:(e,t,r)=>{"use strict";function n(e){let t={formatters:void 0,fees:void 0,serializers:void 0,...e};return Object.assign(t,{extend:function e(t){return r=>{let n="function"==typeof r?r(t):r,i={...t,...n};return Object.assign(i,{extend:e(i)})}}(t)})}function i(){return{}}r.d(t,{i:()=>i,x:()=>n})},83315:(e,t,r)=>{"use strict";r.d(t,{Dg:()=>b,Ej:()=>g,Fl:()=>C,HT:()=>c,Ho:()=>p,M7:()=>y,Ro:()=>w,Ty:()=>x,di:()=>m,ii:()=>I,oB:()=>f,sH:()=>h,tf:()=>v,u:()=>A,uK:()=>d,xW:()=>l,xb:()=>u});var n=r(74114),i=r(73),s=r(43112);let a=new TextEncoder,o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(...e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}function c(e){return e instanceof Uint8Array?d(e):Array.isArray(e)?d(new Uint8Array(e)):e}function u(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?(i.Sl(r,t.size),p(r,t.size)):r}function d(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=o[e[t]];let n=`0x${r}`;return"number"==typeof t.size?(i.Sl(n,t.size),y(n,t.size)):n}function f(e,t={}){let r,{signed:n,size:i}=t,s=BigInt(e);i?r=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let a="bigint"==typeof r&&n?-r-1n:0;if(r&&s>r||s<a){let t="bigint"==typeof e?"n":"";throw new x({max:r?`${r}${t}`:void 0,min:`${a}${t}`,signed:n,size:i,value:`${e}${t}`})}let o=(n&&s<0?BigInt.asUintN(8*i,BigInt(s)):s).toString(16),l=`0x${o}`;return i?p(l,i):l}function h(e,t={}){return d(a.encode(e),t)}function p(e,t){return i.eV(e,{dir:"left",size:t})}function y(e,t){return i.eV(e,{dir:"right",size:t})}function m(e,t,r,n={}){let{strict:s}=n;i.kK(e,t);let a=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return s&&i.X(a,t,r),a}function g(e){return Math.ceil((e.length-2)/2)}function b(e,t={}){let{signed:r}=t;t.size&&i.Sl(e,t.size);let n=BigInt(e);if(!r)return n;let s=(1n<<8n*BigInt((e.length-2)/2))-1n;return n<=s>>1n?n:n-s-1n}function w(e,t={}){let{signed:r,size:n}=t;return r||n?Number(b(e,t)):Number(e)}function v(e,t={}){let{strict:r=!1}=t;try{return!function(e,t={}){let{strict:r=!1}=t;if(!e||"string"!=typeof e)throw new _(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e)||!e.startsWith("0x"))throw new E(e)}(e,{strict:r}),!0}catch{return!1}}class x extends n.C{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number \`${i}\` is not in safe${n?` ${8*n}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}n.C;class _ extends n.C{constructor(e){super(`Value \`${"object"==typeof e?s.As(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class E extends n.C{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}n.C;class A extends n.C{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class I extends n.C{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class C extends n.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}},83815:(e,t,r)=>{"use strict";r.d(t,{E:()=>n});let n=1},83870:(e,t,r)=>{"use strict";r.d(t,{B:()=>i});var n=r(232);function i(e){return"function"===e.type?`function ${e.name}(${(0,n.Q)(e.inputs)})${e.stateMutability&&"nonpayable"!==e.stateMutability?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${(0,n.Q)(e.outputs)})`:""}`:"event"===e.type?`event ${e.name}(${(0,n.Q)(e.inputs)})`:"error"===e.type?`error ${e.name}(${(0,n.Q)(e.inputs)})`:"constructor"===e.type?`constructor(${(0,n.Q)(e.inputs)})${"payable"===e.stateMutability?" payable":""}`:"fallback"===e.type?`fallback() external${"payable"===e.stateMutability?" payable":""}`:"receive() external payable"}},84243:(e,t,r)=>{"use strict";r.d(t,{xW:()=>w,sH:()=>eW,dI:()=>eH});var n={};r.r(n),r.d(n,{identity:()=>k}
300);var i={};r.r(i),r.d(i,{base2:()=>T});var s={};r.r(s),r.d(s,{base8:()=>O});var a={};r.r(a),r.d(a,{base10:()=>N});var o={};r.r(o),r.d(o,{base16:()=>R,base16upper:()=>B});var l={};r.r(l),r.d(l,{base32:()=>D,base32hex:()=>L,base32hexpad:()=>z,base32hexpadupper:()=>q,base32hexupper:()=>F,base32pad:()=>U,base32padupper:()=>j,base32upper:()=>M,base32z:()=>W});var c={};r.r(c),r.d(c,{base36:()=>H,base36upper:()=>K});var u={};r.r(u),r.d(u,{base58btc:()=>V,base58flickr:()=>G});var d={};r.r(d),r.d(d,{base64:()=>J,base64pad:()=>Y,base64url:()=>Z,base64urlpad:()=>Q});var f={};r.r(f),r.d(f,{base256emoji:()=>er});var h={};r.r(h),r.d(h,{sha256:()=>ep,sha512:()=>ey});var p={};r.r(p),r.d(p,{identity:()=>em});var y={};r.r(y),r.d(y,{code:()=>eb,decode:()=>ev,encode:()=>ew,name:()=>eg});var m={};function g(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function b(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?g(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function w(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let r=b(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return g(r)}r.r(m),r.d(m,{code:()=>eA,decode:()=>eC,encode:()=>eI,name:()=>eE});let v=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),a=s.charCodeAt(0);if(255!==r[a])throw TypeError(s+" is ambiguous");r[a]=i}var o=e.length,l=e.charAt(0),c=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===l;)n++,t++;for(var s=(e.length-t)*c+1>>>0,a=new Uint8Array(s);e[t];){var u=r[e.charCodeAt(t)];if(255===u)return;for(var d=0,f=s-1;(0!==u||d<i)&&-1!==f;f--,d++)u+=o*a[f]>>>0,a[f]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var h=s-i;h!==s&&0===a[h];)h++;for(var p=new Uint8Array(n+(s-h)),y=n;h!==s;)p[y++]=a[h++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,s=t.length;i!==s&&0===t[i];)i++,r++;for(var a=(s-i)*u+1>>>0,c=new Uint8Array(a);i!==s;){for(var d=t[i],f=0,h=a-1;(0!==d||f<n)&&-1!==h;h--,f++)d+=256*c[h]>>>0,c[h]=d%o>>>0,d=d/o>>>0;if(0!==d)throw Error("Non-zero carry");n=f,i++}for(var p=a-n;p!==a&&0===c[p];)p++;for(var y=l.repeat(r);p<a;++p)y+=e.charAt(c[p]);return y},decodeUnsafe:d,decode:function(e){var r=d(e);if(r)return r;throw Error(`Non-${t} character`)}}};new Uint8Array(0);let x=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")};class _{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class E{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return I(this,e)}}class A{constructor(e){this.decoders=e}or(e){return I(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let I=(e,t)=>new A({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class C{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new _(e,t,r),this.decoder=new E(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let S=({name:e,prefix:t,encode:r,decode:n})=>new C(e,t,r,n),P=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=v(r,t);return S({prefix:e,name:t,encode:n,decode:e=>x(i(e))})},$=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>S({prefix:t,name:e,encode:e=>((e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,s="",a=0,o=0;for(let n=0;n<e.length;++n)for(o=o<<8|e[n],a+=8;a>r;)a-=r,s+=t[i&o>>a];if(a&&(s+=t[i&o<<r-a]),n)for(;s.length*r&7;)s+="=";return s})(e,n,r),decode:t=>((e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let a=new Uint8Array(s*r/8|0),o=0,l=0,c=0;for(let t=0;t<s;++t){let s=i[e[t]];if(void 0===s)throw SyntaxError(`Non-${n} character`);l=l<<r|s,(o+=r)>=8&&(o-=8,a[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw SyntaxError("Unexpected end of data");return a})(t,n,r,e)}),k=S({prefix:"\0",name:"identity",encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)}),T=$({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),O=$({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),N=P({prefix:"9",name:"base10",alphabet:"0123456789"}),R=$({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),B=$({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),D=$({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),M=$({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),U=$({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),j=$({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),L=$({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),F=$({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),z=$({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),q=$({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),W=$({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),H=P({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),K=P({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),V=P({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),G=P({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),J=$({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
300+/",bitsPerChar:6}),Y=$({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Z=$({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Q=$({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),X=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),ee=X.reduce((e,t,r)=>(e[r]=t,e),[]),et=X.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),er=S({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=ee[t],"")},decode:function(e){let t=[];for(let r of e){let e=et[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});function en(e,t,r){t=t||[];for(var n=r=r||0;e>=0x80000000;)t[r++]=255&e|128,e/=128;for(;-128&e;)t[r++]=255&e|128,e>>>=7;return t[r]=0|e,en.bytes=r-n+1,t}function ei(e,t){var r,n=0,t=t||0,i=0,s=t,a=e.length;do{if(s>=a)throw ei.bytes=0,RangeError("Could not decode varint");r=e[s++],n+=i<28?(127&r)<<i:(127&r)*Math.pow(2,i),i+=7}while(r>=128);return ei.bytes=s-t,n}let es={encode:en,decode:ei,encodingLength:function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10}},ea=(e,t=0)=>[es.decode(e,t),es.decode.bytes],eo=(e,t,r=0)=>(es.encode(e,t,r),t),el=e=>es.encodingLength(e),ec=(e,t)=>{let r=t.byteLength,n=el(e),i=n+el(r),s=new Uint8Array(i+r);return eo(e,s,0),eo(r,s,n),s.set(t,i),new eu(e,r,t,s)};
300class eu{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let ed=({name:e,code:t,encode:r})=>new ef(e,t,r);class ef{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?ec(this.code,t):t.then(e=>ec(this.code,e))}throw Error("Unknown type, must be binary type")}}let eh=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),ep=ed({name:"sha2-256",code:18,encode:eh("SHA-256")}),ey=ed({name:"sha2-512",code:19,encode:eh("SHA-512")}),em={code:0,name:"identity",encode:x,digest:e=>ec(0,x(e))},eg="raw",eb=85,ew=e=>x(e),ev=e=>x(e),ex=new TextEncoder,e_=new TextDecoder,eE="json",eA=512,eI=e=>ex.encode(JSON.stringify(e)),eC=e=>JSON.parse(e_.decode(e));class eS{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:eD,byteLength:eD,code:eB,version:eB,multihash:eB,bytes:eB,_baseCache:eD,asCID:eD})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==eT)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==eO)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return eS.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=ec(e,t);return eS.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){var t,r;return e&&this.code===e.code&&this.version===e.version&&((t=this.multihash)===(r=e.multihash)||t.code===r.code&&t.size===r.size&&((e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0})(t.bytes,r.bytes))}toString(e){let{bytes:t,version:r,_baseCache:n}=this;return 0===r?e$(t,n,e||V.encoder):ek(t,n,e||D.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return eM(/^0\.0/,eU),!!(e&&(e[eR]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof eS)return e;if(null!=e&&e.asCID===e){let{version:t,code:r,multihash:n,bytes:i}=e;return new eS(t,r,n,i||eN(t,r,n.bytes))}if(null==e||!0!==e[eR])return null;{let{version:t,multihash:r,code:n}=e,i=(e=>{let t=x(e),[r,n]=ea(t),[i,s]=ea(t.subarray(n)),a=t.subarray(n+s);if(a.byteLength!==i)throw Error("Incorrect length");return new eu(r,i,a,t)})(r);return eS.create(t,n,i)}}static create(e,t,r){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===eT)return new eS(e,t,r,r.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${eT}) block encoding`);case 1:{let n=eN(e,t,r.bytes);return new eS(e,t,r,n)}default:throw Error("Invalid version")}}static createV0(e){return eS.create(0,eT,e)}static createV1(e,t){return eS.create(1,e,t)}static decode(e){let[t,r]=eS.decodeFirst(e);if(r.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=eS.inspectBytes(e),r=t.size-t.multihashSize,n=x(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw Error("Incorrect length");let i=n.subarray(t.multihashSize-t.digestSize),s=new eu(t.multihashCode,t.digestSize,i,n);return[0===t.version?eS.createV0(s):eS.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[r,n]=ea(e.subarray(t));return t+=n,r},n=r(),i=eT;if(18===n?(n=0,t=0):1===n&&(i=r()),0!==n&&1!==n)throw RangeError(`Invalid CID version ${n}`);let s=t,a=r(),o=r(),l=t+o;return{version:n,codec:i,multihashCode:a,digestSize:o,multihashSize:l-s,size:l}}static parse(e,t){let[r,n]=eP(e,t),i=eS.decode(n);return i._baseCache.set(r,e),i}}let eP=(e,t)=>{switch(e[0]){case"Q":{let r=t||V;return[V.prefix,r.decode(`${V.prefix}${e}`)]}case V.prefix:{let r=t||V;return[V.prefix,r.decode(e)]}case D.prefix:{let r=t||D;return[D.prefix,r.decode(e)]}default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},e$=(e,t,r)=>{let{prefix:n}=r;if(n!==V.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(null!=i)return i;{let i=r.encode(e).slice(1);return t.set(n,i),i}},ek=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(null!=i)return i;{let i=r.encode(e);return t.set(n,i),i}},eT=112,eO=18,eN=(e,t,r)=>{let n=el(e),i=n+el(t),s=new Uint8Array(i+r.byteLength);return eo(e,s,0),eo(t,s,n),s.set(r,i),s}
300,eR=Symbol.for("@ipld/js-cid/CID"),eB={writable:!1,configurable:!1,enumerable:!0},eD={writable:!1,enumerable:!1,configurable:!1},eM=(e,t)=>{if(e.test("0.0.0-dev"))console.warn(t);else throw Error(t)},eU=`CID.isCID(v) is deprecated and will be removed in the next major release.
301Following code pattern:
302
303if (CID.isCID(value)) {
304  doSomethingWithCID(value)
305}
306
307Is replaced with:
308
309const cid = CID.asCID(value)
310if (cid) {
311  // Make sure to use cid instead of value
312  doSomethingWithCID(cid)
313}
314`,ej={...n,...i,...s,...a,...o,...l,...c,...u,...d,...f};function eL(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...h,...p});let eF=eL("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),ez=eL("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=b((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),eq={utf8:eF,"utf-8":eF,hex:ej.base16,latin1:ez,ascii:ez,binary:ez,...ej};function eW(e,t="utf8"){let r=eq[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?g(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function eH(e,t="utf8"){let r=eq[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}},84413:(e,t,r)=>{"use strict";r.d(t,{S:()=>o});var n=r(11577),i=r(2939),s=r(32579),a=r(44037);function o(e,t){let r=(0,n.lY)((0,i.q)(e,{strict:!1})?(0,s.ZJ)(e):e);return"bytes"===(t||"hex")?r:(0,a.nj)(r)}},84742:(e,t,r)=>{"use strict";r.d(t,{O:()=>s});var n=r(99838),i=r(651);function s(e){let{blockHash:t,blockNumber:r,blockTag:s,requireCanonical:a}=e;if(void 0!==a&&!t)throw new n.C("`requireCanonical` can only be provided when `blockHash` is set.");return t?a?{blockHash:t,requireCanonical:a}:{blockHash:t}:"bigint"==typeof r?(0,i.cK)(r):s??"latest"}},84940:(e,t,r)=>{"use strict";r.d(t,{J9:()=>s,Mc:()=>i,fD:()=>n});let n={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},i={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},s={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}},85267:(e,t,r)=>{"use strict";r.d(t,{X:()=>s});var n=r(99838);class i extends n.C{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function s(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new i({value:e});let[r,n="0"]=e.split("."),s=r.startsWith("-");if(s&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),0===t)1===Math.round(Number(`.${n}`))&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>t){let[e,i,s]=[n.slice(0,t-1),n.slice(t-1,t),n.slice(t)],a=Math.round(Number(`${i}.${s}`));(n=a>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,"0"):`${e}${a}`).length>t&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,t)}else n=n.padEnd(t,"0");return BigInt(`${s?"-":""}${r}${n}`)}},85361:(e,t,r)=>{"use strict";r.d(t,{D7:()=>a,Lt:()=>d,Pl:()=>l,Y6:()=>o,bY:()=>f,pt:()=>c});var n=r(6274),i=r(97140),s=r(26101);function a(e){return"modifyAndSignTransactions"in e&&"function"==typeof e.modifyAndSignTransactions}function o(e){return"signTransactions"in e&&"function"==typeof e.signTransactions}function l(e){return o(e)||a(e)||"signAndSendTransactions"in e&&"function"==typeof e.signAndSendTransactions}function c(e,t){Object.freeze(e);let r={...t,feePayer:e};return Object.freeze(r),r}async function u(e){let t=await (0,n.Tq)(e.publicKey);return Object.freeze({address:t,keyPair:e,signMessages:r=>Promise.all(r.map(async r=>Object.freeze({[t]:await (0,i.b_)(e.privateKey,r.content)}))),signTransactions:r=>Promise.all(r.map(async r=>Object.freeze({[t]:(await (0,s.iW)([e],r)).signatures[t]})))})}async function d(e,t){return await u(await (0,i.RL)(e,t))}async function f(e,t){return await u(await (0,i.Hx)(e,t))}globalThis.TextEncoder},85745:(e,t,r)=>{"use strict";r.d(t,{U:()=>a});var n=r(55212),i=r(45816),s=r(20284);function a(e){let t=(0,i.e)(e),r=[],a=e.length;for(let i=0;i<a;i++){let a=e[i];(0,n.WL)(a)||r.push((0,s.uT)(a,t))}return r}}
314,86253:(e,t,r)=>{"use strict";r.d(t,{I:()=>o,a:()=>a,b:()=>s,n:()=>i,u:()=>l});var n=r(75834);let i=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},s=e=>()=>{throw Error(e.trim())},a=()=>{},o=(0,n.createContext)({setAuthenticated:i,setUser:i,setIsNewUser:i,isNewUserThisSession:!1,walletConnectionStatus:null,setWalletConnectionStatus:i,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:i,initializeWalletProxy:i,getAuthMeta:i,getAuthFlow:i,closePrivyModal:i,openPrivyModal:i,connectWallet:i,initLoginWithWallet:i,loginWithWallet:i,initLoginWithFarcaster:i,loginWithFarcaster:i,loginWithCode:i,initLoginWithEmail:i,initLoginWithSms:i,initUpdateEmail:i,initUpdatePhone:i,resendEmailCode:i,resendSmsCode:i,initLoginWithHeadlessOAuth:i,loginWithHeadlessOAuth:i,crossAppAuthFlow:i,initLoginWithOAuth:i,loginWithOAuth:i,passkeyAuthState:{status:"initial"},setPasskeyAuthState:i,initSignupWithPasskey:i,signupWithPasskey:i,initLoginWithPasskey:i,loginWithPasskey:i,initLinkWithPasskey:i,linkWithPasskey:i,refreshSessionAndUser:i,walletProxy:null,createAnalyticsEvent:i,acceptTerms:i,getUsdTokenPrice:i,getUsdPriceForSol:i,getSplTokenMetadata:i,recoverEmbeddedWallet:i,updateWallets:i,fundWallet:i,openModal:i,setReadyToTrue:i,requestFarcasterSignerStatus:i,initLoginWithTelegram:i,loginWithTelegram:i,generateSiweMessage:i,generateSiweMessageForSmartWallet:i,loginWithSiwe:i,linkWithSiwe:i,linkSmartWallet:i,delegateWallet:i,revokeDelegatedWallets:i,connectCoinbaseSmartWallet:i,connectBaseAccount:i,initiateAccountTransfer:i,emailOtpState:{status:"initial"},setEmailOtpState:i,smsOtpState:{status:"initial"},setSmsOtpState:i,siweState:{status:"initial"},setSiweState:i,oAuthState:{status:"initial"},setOAuthState:i,telegramAuthState:{status:"initial"},setTelegramAuthState:i,isHeadlessOAuthLoading:!1,isHeadlessSigning:i,inProgressAuthFlowRef:{current:null},inProgressLoginOrLinkMethodRef:{current:null},baseAccountSdk:void 0,setBaseAccountSdk:i}),l=()=>(0,n.useContext)(o)},86326:(e,t,r)=>{"use strict";r.d(t,{ID:()=>a,RZ:()=>n,TY:()=>i,zf:()=>s});let n=e=>e;function i(e){if(e?.reason)return e.reason;if("function"==typeof DOMException)return new DOMException("This operation was aborted","AbortError");let t=Error("This operation was aborted");return t.name="AbortError",t}function s(e){return"object"==typeof e&&null!==e&&"name"in e&&"AbortError"===e.name}let a=e=>{try{let t=new URL(e);if(!t.username&&!t.password)return e;return t.username="",t.password="",t.toString()}catch{return e}}},86380:(e,t,r)=>{"use strict";r.d(t,{n:()=>y});var n=r(74263),i=r(48717),s=r(39345),a=r(44633),o=r(24654),l=r(38112),c=r(59206),u=r(5596),d=r(651);function f(e,t={}){void 0!==t.size&&(0,u.Sl)(e,{size:t.size});let r=(0,d.My)(e,t);return(0,u.ME)(r,t)}var h=r(36665),p=r(10752);function y(e,t){let r="string"==typeof t?(0,h.aT)(t):t,y=(0,s.l)(r);if(0===(0,a.E)(r)&&e.length>0)throw new n.O;if((0,a.E)(t)&&32>(0,a.E)(t))throw new n.Iy({data:"string"==typeof t?t:(0,d.My)(t),params:e,size:(0,a.E)(t)});let g=0,b=[];for(let t=0;t<e.length;++t){let s=e[t];g<r.length&&y.setPosition(g);let[a,h]=function e(t,r,{staticPosition:s}){let a=(0,p.k)(r.type);if(a){let[n,i]=a;return function(t,r,{length:n,staticPosition:i}){if(null===n){let n=i+f(t.readBytes(32)),s=n+32;t.setPosition(n);let a=f(t.readBytes(32)),o=m(r),l=0,c=[];for(let n=0;n<a;++n){t.setPosition(s+(o?32*n:l));let[i,a]=e(t,r,{staticPosition:s});l+=a,c.push(i),0===a&&(t.assertReadLimit(),t._touch())}return t.setPosition(i+32),[c,32]}if(m(r)){let s=i+f(t.readBytes(32)),a=[];for(let i=0;i<n;++i){t.setPosition(s+32*i);let[n]=e(t,r,{staticPosition:s});a.push(n)}return t.setPosition(i+32),[a,32]}let s=0,a=[];for(let o=0;o<n;++o){let[n,o]=e(t,r,{staticPosition:i+s});s+=o,a.push(n),0===o&&(t.assertReadLimit(),t._touch())}return[a,s]}(t,{...r,type:i},{length:n,staticPosition:s})}if("tuple"===r.type)return function(t,r,{staticPosition:n}){let i=0===r.components.length||r.components.some(({name:e})=>!e),s=i?[]:{},a=0;if(m(r)){let o=n+f(t.readBytes(32));for(let n=0;n<r.components.length;++n){let l=r.components[n];t.setPosition(o+a);let[c,u]=e(t,l,{staticPosition:o});a+=u,s[i?n:l?.name]=c}return t.setPosition(n+32),[s,32]}for(let o=0;o<r.components.length;++o){let l=r.components[o],[c,u]=e(t,l,{staticPosition:n});s[i?o:l?.name]=c,a+=u}return[s,a]}(t,r,{staticPosition:s});if("address"===r.type){var h=t;let e=h.readBytes(32);return[(0,i.o)((0,d.My)((0,o.A1)(e,-20))),32]}if("bool"===r.type)return[function(e,t={}){let r=e;if(void 0!==t.size&&((0,u.Sl)(r,{size:t.size}),r=(0,l.B)(r)),r.length>1||r[0]>1)throw new c.xO(r);return!!r[0]}(t.readBytes(32),{size:32}),32];if(r.type.startsWith("bytes"))return function(e,t,{staticPosition:r}){let[n,i]=t.type.split("bytes");if(!i){let t=f(e.readBytes(32));e.setPosition(r+t);let n=f(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];let i=e.readBytes(n);return e.setPosition(r+32),[(0,d.My)(i),32]}return[(0,d.My)(e.readBytes(Number.parseInt(i,10),32)),32]}(t,r,{staticPosition:s});if(r.type.startsWith("uint")||r.type.startsWith("int")){var y=t,g=r;let e=g.type.startsWith("int"),n=Number.parseInt(g.type.split("int")[1]||"256",10),i=y.readBytes(32);return[n>48?function(e,t={}){void 0!==t.size&&(0,u.Sl)(e,{size:t.size});let r=(0,d.My)(e,t);return(0,u.uU)(r,t)}(i,{signed:e}):f(i,{signed:e}),32]}if("string"===r.type)return function(e,{staticPosition:t}){let r=f(e.readBytes(32));e.setPosition(t+r);let n=f(e.readBytes(32));if(0===n)return e.setPosition(t+32),["",32];let i=e.readBytes(n,32),s=function(e,t={}){let r=e;return void 0!==t.size&&((0,u.Sl)(r,{size:t.size}),r=(0,l.B)(r,{dir:"right"})),new TextDecoder().decode(r)}((0,l.B)(i));return e.setPosition(t+32),[s,32]}(t,{staticPosition:s});throw new n.j(r.type,{docsPath:"/docs/contract/decodeAbiParameters"})}(y,s,{staticPosition:0});g+=h,b.push(a)}return b}function m(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;
314if("tuple"===t)return e.components?.some(m);let r=(0,p.k)(e.type);return!!(r&&m({...e,type:r[1]}))}},86665:(e,t,r)=>{"use strict";function n(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):null===e.blockTimestamp?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}r.d(t,{e:()=>n})},86786:(e,t,r)=>{"use strict";r.d(t,{D:()=>s,l:()=>i});var n=r(852);let i=e=>(e=>{let t=e;"string"==typeof t&&(t=n.Rd.encode(t));let r=[];for(let e=0;e<t.length;e+=32768)r.push(String.fromCharCode.apply(null,t.subarray(e,e+32768)));return btoa(r.join(""))})(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),s=e=>{let t=e;t instanceof Uint8Array&&(t=n.D0.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r})(t)}catch(e){throw TypeError("The input to be decoded is not correctly encoded.")}}},86888:(e,t,r)=>{"use strict";r.d(t,{ER:()=>s,Im:()=>l,dZ:()=>c,eX:()=>a,e_:()=>o});var n=r(11287),i=r(44312);
314function s(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function a(e=6){return BigInt(s(e))}function o(e,t,r){return{id:r||s(),jsonrpc:"2.0",method:e,params:t}}function l(e,t){return{id:e,jsonrpc:"2.0",result:t}}function c(e,t,r){var s,a;return{id:e,jsonrpc:"2.0",error:(s=t,a=r,void 0===s?(0,n.vG)(i.zR):("string"==typeof s&&(s=Object.assign(Object.assign({},(0,n.vG)(i.fO)),{message:s})),void 0!==a&&(s.data=a),(0,n.mE)(s.code)&&(s=(0,n.rI)(s.code)),s))}}},86890:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=function(e){if(e.length>=255)throw TypeError("Alphabet too long");let t=new Uint8Array(256);for(let e=0;e<t.length;e++)t[e]=255;for(let r=0;r<e.length;r++){let n=e.charAt(r),i=n.charCodeAt(0);if(255!==t[i])throw TypeError(n+" is ambiguous");t[i]=r}let r=e.length,n=e.charAt(0),i=Math.log(r)/Math.log(256),s=Math.log(256)/Math.log(r);function a(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;let s=0,a=0,o=0;for(;e[s]===n;)a++,s++;let l=(e.length-s)*i+1>>>0,c=new Uint8Array(l);for(;s<e.length;){let n=e.charCodeAt(s);if(n>255)return;let i=t[n];if(255===i)return;let a=0;for(let e=l-1;(0!==i||a<o)&&-1!==e;e--,a++)i+=r*c[e]>>>0,c[e]=i%256>>>0,i=i/256>>>0;if(0!==i)throw Error("Non-zero carry");o=a,s++}let u=l-o;for(;u!==l&&0===c[u];)u++;let d=new Uint8Array(a+(l-u)),f=a;for(;u!==l;)d[f++]=c[u++];return d}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";let i=0,a=0,o=0,l=t.length;for(;o!==l&&0===t[o];)o++,i++;let c=(l-o)*s+1>>>0,u=new Uint8Array(c);for(;o!==l;){let e=t[o],n=0;for(let t=c-1;(0!==e||n<a)&&-1!==t;t--,n++)e+=256*u[t]>>>0,u[t]=e%r>>>0,e=e/r>>>0;if(0!==e)throw Error("Non-zero carry");a=n,o++}let d=c-a;for(;d!==c&&0===u[d];)d++;let f=n.repeat(i);for(;d<c;++d)f+=e.charAt(u[d]);return f},decodeUnsafe:a,decode:function(e){let t=a(e);if(t)return t;throw Error("Non-base"+r+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},87280:(e,t,r)=>{"use strict";r.d(t,{P:()=>G,a:()=>R,b:()=>M,c:()=>z,d:()=>F,e:()=>q,f:()=>W,g:()=>K,h:()=>H,i:()=>N,j:()=>V,l:()=>L,u:()=>J});let n="2.55.5",i={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${n}`};class s extends Error{constructor(e,t={}){let r=t.cause instanceof s?t.cause.details:t.cause?.message?t.cause.message:t.details,a=t.cause instanceof s&&t.cause.docsPath||t.docsPath,o=i.getDocsUrl?.({...t,docsPath:a});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=a,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=n}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}class a extends s{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}function o(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}class l extends s{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function c(e,{dir:t,size:r=32}={}){return"string"==typeof e?function(e,{dir:t,size:r=32}={}){if(null===r)return e;let n=e.replace("0x","");if(n.length>2*r)throw new l({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n["right"===t?"padEnd":"padStart"](2*r,"0")}`}(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new l({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let i=0;i<r;i++){let s="right"===t;n[s?i:r-i-1]=e[s?i:e.length-i-1]}return n}(e,{dir:t,size:r})}class u extends s{constructor({max:e,min:t,signed:r,size:n,value:i}
314){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class d extends s{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function f(e){return o(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function h(e,{size:t}){if(f(e)>t)throw new d({givenSize:f(e),maxSize:t})}let p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function y(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=p[e[t]];let n=`0x${r}`;return"number"==typeof t.size?(h(n,{size:t.size}),c(n,{dir:"right",size:t.size})):n}function m(e,t={}){let r,{signed:n,size:i}=t,s=BigInt(e);i?r=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let a="bigint"==typeof r&&n?-r-1n:0;if(r&&s>r||s<a){let t="bigint"==typeof e?"n":"";throw new u({max:r?`${r}${t}`:void 0,min:`${a}${t}`,signed:n,size:i,value:`${e}${t}`})}let o=`0x${(n&&s<0?(1n<<BigInt(8*i))+BigInt(s):s).toString(16)}`;return i?c(o,{size:i}):o}let g=new TextEncoder,b=new TextEncoder,w={zero:48,nine:57,A:65,F:70,a:97,f:102};function v(e){return e>=w.zero&&e<=w.nine?e-w.zero:e>=w.A&&e<=w.F?e-(w.A-10):e>=w.a&&e<=w.f?e-(w.a-10):void 0}function x(e,t={}){let r=e;t.size&&(h(r,{size:t.size}),r=c(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let i=n.length/2,a=new Uint8Array(i);for(let e=0,t=0;e<i;e++){let r=v(n.charCodeAt(t++)),i=v(n.charCodeAt(t++));if(void 0===r||void 0===i)throw new s(`Invalid byte sequence ("${n[t-2]}${n[t-1]}" in "${n}").`);a[e]=16*r+i}return a}function _(e,t={}){let r=b.encode(e);return"number"==typeof t.size?(h(r,{size:t.size}),c(r,{dir:"right",size:t.size})):r}var E=r(11577);class A extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,t)),t}set(e,t){if(super.has(e)&&super.delete(e),super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=super.keys().next().value;void 0!==e&&super.delete(e)}return this}}let I=/^0x[a-fA-F0-9]{40}$/,C=new A(8192),S=new A(8192);function P(e,t){if(S.has(`${e}.${t}`))return S.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=function(e,t){let r=(0,E.lY)(o(e,{strict:!1})?function(e,t={}){return"number"==typeof e||"bigint"==typeof e?x(m(e,t)):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?(h(r,{size:t.size}),c(r,{size:t.size})):r}(e,t):o(e)?x(e,t):_(e,t)}(e):e);return"bytes"===(t||"hex")?r:function(e,t={}){return"number"==typeof e||"bigint"==typeof e?m(e,t):"string"==typeof e?function(e,t={}){return y(g.encode(e),t)}(e,t):"boolean"==typeof e?function(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?(h(r,{size:t.size}),c(r,{size:t.size})):r}(e,t):y(e,t)}(r)}(_(r),"bytes"),i=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&n[e>>1])>
314=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());let s=`0x${i.join("")}`;return S.set(`${e}.${t}`,s),s}function $(e,t){if(!function(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(C.has(n))return C.get(n);let i=!!I.test(e)&&(e.toLowerCase()===e||!r||P(e)===e);return C.set(n,i),i}(e,{strict:!1}))throw new a({address:e});return P(e,t)}let k=(e,t)=>e===t||!!(e.startsWith("0x")&&t.startsWith("0x"))&&42===e.length&&42===t.length&&$(e)===$(t);var T=r(75834),O=r(86253);function N(e){return"string"==typeof e&&/^custom:[a-zA-Z0-9_-]+$/i.test(e)}let R=e=>!!e.id&&"privy-v2"===e.recoveryMethod;function B(e){return e?new Date(1e3*e):null}function D(e,t){return e.slice().sort((e,t)=>(e.firstVerifiedAt?.getTime()??0)-(t.firstVerifiedAt?.getTime()??0)).find(e=>e.type===t)}let M=e=>e?U(e).find(e=>0===e.walletIndex)??null:null,U=e=>e?j(e,"ethereum"):[],j=(e,t)=>e.linkedAccounts.filter(e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&e.chainType===t),L=e=>e?j(e,"solana"):[],F=e=>e?L(e).find(e=>0===e.walletIndex)??null:null,z=e=>(e?.linkedAccounts??[]).filter(e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType),q=e=>(e?.linkedAccounts??[]).filter(e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType),W=(e,t)=>e?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType&&k(e.address,t))||null,H=(e,t)=>e.find(e=>k(e.address,t))||null,K=e=>{let t=M(e),r=F(e);return t&&r&&!R(r)&&R(t)?r:M(e)??F(e)};function V(e){if(!e)return null;let t=function(e){let t=[];for(let r of e){let e=r.type;switch(r.type){case"wallet":let n={id:r.id,address:r.address,type:r.type,imported:r.imported,delegated:r.delegated,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at),chainType:r.chain_type,walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method,walletIndex:r.wallet_index,publicKey:r.public_key};t.push(n);break;case"smart_wallet":let i={address:r.address,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at),smartWalletType:r.smart_wallet_type,smartWalletVersion:r.smart_wallet_version};t.push(i);break;case"cross_app":let s={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(s);break;case"email":let a={address:r.address,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(a);break;case"phone":let o={number:r.phoneNumber,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(o);break;case"google_oauth":let l={subject:r.subject,email:r.email,name:r.name,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(l);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let u={subject:r.subject,username:r.username,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(u);break;case"twitter_oauth":let d={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(d);break;case"discord_oauth":let f={subject:r.subject,username:r.username,email:r.email,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(f);break;case"github_oauth":let h={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(h);break;case"tiktok_oauth":let p={subject:r.subject,username:r.username,name:r.name,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(p);break;case"line_oauth":let y={subject:r.subject,name:r.name,email:r.email,profilePictureUrl:r.profile_picture_url,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(y);break;case"twitch_oauth":let m={subject:r.subject,username:r.username,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(m);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let b={subject:r.subject,email:r.email,type:r.type,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(b);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)});break;case"farcaster":let w={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(w);break;case"passkey":let v={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,publicKey:r.public_key,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(v);break;case"telegram":let x={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(x);break;default:if(N(r.type)){let e={type:r.type,subject:r.subject,name:r.name,username:r.username,email:r.email,profilePictureUrl:r.profile_picture_url,firstVerifiedAt:B(r.first_verified_at),latestVerifiedAt:B(r.latest_verified_at)};t.push(e);break}console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),r=D(t,"wallet"),n=D(t,"smart_wallet"),i=D(t,"email"),s=D(t,"phone"),a=D(t,"google_oauth"),o=D(t,"twitter_oauth"),l=D(t,"discord_oauth"),c=D(t,"github_oauth"),u=D(t,"
314spotify_oauth"),d=D(t,"instagram_oauth"),f=D(t,"tiktok_oauth"),h=D(t,"line_oauth"),p=D(t,"twitch_oauth"),y=D(t,"linkedin_oauth"),m=D(t,"apple_oauth"),g=D(t,"farcaster"),b=D(t,"telegram"),w=e.mfa_methods.map(({type:e,verified_at:t})=>({type:e,verifiedAt:B(t)}));return{id:e.id,createdAt:B(e.created_at),linkedAccounts:t,email:i&&{address:i?.address},phone:s&&{number:s?.number},wallet:r&&{id:r.id,address:r.address,chainType:r.chainType,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,delegated:r.delegated,walletIndex:r.walletIndex,publicKey:r.publicKey},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType,smartWalletVersion:n.smartWalletVersion},google:a&&{subject:a.subject,email:a.email,name:a.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name,profilePictureUrl:o.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:c&&{subject:c.subject,username:c.username,name:c.name,email:c.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},line:h&&{subject:h.subject,name:h.name,email:h.email,profilePictureUrl:h.profilePictureUrl},twitch:p&&{subject:p.subject,username:p.username},linkedin:y&&{subject:y.subject,name:y.name,email:y.email,vanityName:y.vanityName},apple:m&&{subject:m.subject,email:m.email},farcaster:g&&{fid:g.fid,ownerAddress:g.ownerAddress,displayName:g.displayName,username:g.username,bio:g.bio,pfp:g.pfp,url:g.url,signerPublicKey:g.signerPublicKey},telegram:b&&{telegramUserId:b.telegramUserId,firstName:b.firstName,lastName:b.lastName,username:b.username,photoUrl:b.photoUrl},delegatedWallets:[],mfaMethods:w.map(e=>e.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}let G=(0,T.createContext)({ready:!1,authenticated:!1,user:null,error:null,walletConnectors:null,connectWallet:O.n,login:O.n,connectOrCreateWallet:O.n,linkEmail:O.n,linkPhone:O.n,linkFarcaster:O.n,linkWallet:O.n,linkGoogle:O.n,linkTwitter:O.n,linkTwitch:O.n,linkDiscord:O.n,linkGithub:O.n,linkSpotify:O.n,linkInstagram:O.n,linkTelegram:O.n,linkTiktok:O.n,linkLine:O.n,linkLinkedIn:O.n,linkApple:O.n,linkPasskey:O.n,linkOAuth:O.n,logout:O.n,getAccessToken:O.n,signMessage:O.n,signTypedData:O.n,enrollInMfa:O.n,initEnrollmentWithSms:O.n,initEnrollmentWithTotp:O.n,initEnrollmentWithPasskey:O.n,promptMfa:O.n,init:O.n,submitEnrollmentWithSms:O.n,submitEnrollmentWithTotp:O.n,submitEnrollmentWithPasskey:O.n,unenroll:O.n,clear:O.n,submit:O.n,cancel:O.n,sendTransaction:O.n,signTransaction:O.n,setWalletPassword:O.n,setWalletRecovery:O.n,isModalOpen:!1,mfaMethods:[]}),J=()=>(0,T.useContext)(G)},87284:(e,t,r)=>{"use strict";r.d(t,{S:()=>s});var n=r(36665),i=r(651);function s(e){let{kzg:t}=e,r=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),s="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,n.aT)(e)):e.blobs,a=[];for(let e of s)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===r?a:a.map(e=>(0,i.My)(e))}},87595:(e,t,r)=>{"use strict";r.d(t,{X:()=>n});class n extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Object.create(n.prototype)),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:n.name})}}},87601:(e,t,r)=>{"use strict";r.d(t,{db:()=>s,eV:()=>i});var n=r(49731);function i(e,{dir:t,size:r=32}={}){return"string"==typeof e?s(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new n.Fl({size:e.length,targetSize:r,type:"bytes"});let i=new Uint8Array(r);for(let n=0;n<r;n++){let s="right"===t;i[s?n:r-n-1]=e[s?n:e.length-n-1]}return i}(e,{dir:t,size:r})}function s(e,{dir:t,size:r=32}={}){if(null===r)return e;let i=e.replace("0x","");if(i.length>2*r)throw new n.Fl({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i["right"===t?"padEnd":"padStart"](2*r,"0")}`}},87664:(e,t,r)=>{"use strict";r.d(t,{M:()=>i});var n=r(97282);function i({blockNumber:e,chain:t,contract:r}){let i=t?.contracts?.[r];if(!i)throw new n.rj({chain:t,contract:{name:r}});if(e&&i.blockCreated&&i.blockCreated>e)throw new n.rj({blockNumber:e,chain:t,contract:{name:r,blockCreated:i.blockCreated}});return i.address}},87980:(e,t,r)=>{"use strict";
vendor: 7,106 bytes, line 314
314Object.defineProperty(t,"__esModule",{value:!0});let n=r(36480);n.__exportStar(r(30293),t),n.__exportStar(r(56043),t)},88160:(e,t,r)=>{"use strict";r.d(t,{g:()=>a});var n,i=r(75834),s=r(63228);function a(){let e,t=(e="undefined"==typeof document,(0,(n||(n=r.t(i,2))).useSyncExternalStore)(()=>()=>{},()=>!1,()=>!e)),[a,o]=i.useState(s._.isHandoffComplete);return a&&!1===s._.isHandoffComplete&&o(!1),i.useEffect(()=>{!0!==a&&o(!0)},[a]),i.useEffect(()=>s._.handoff(),[]),!t&&a}},88417:(e,t,r)=>{var n=r(98539).hp;let i=r(95847);function s(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 u(e,t){if("address"===e)return u("uint160",c(t));if("bool"===e)return u("uint8",+!!t);if("string"===e)return u("bytes",new n(t,"utf8"));if((h=e).lastIndexOf("]")===h.length-1){if(void 0===t.length)throw Error("Not an array?");if("dynamic"!==(r=l(e))&&0!==r&&t.length>r)throw Error("Elements exceed array size: "+r);for(f in d=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)d.push(u(e,t[f]));if("dynamic"===r){var r,s,d,f,h,p=u("uint256",t.length);d.unshift(p)}return n.concat(d)}else if("bytes"===e)return t=new n(t),d=n.concat([u("uint256",t.length),t]),t.length%32!=0&&(d=n.concat([d,i.zeros(32-t.length%32)])),d;else if(e.startsWith("bytes")){if((r=a(e))<1||r>32)throw Error("Invalid bytes<N> width: "+r);return i.setLengthRight(t,32)}else if(e.startsWith("uint")){if((r=a(e))%8||r<8||r>256)throw Error("Invalid uint<N> width: "+r);s=c(t);let n=i.bitLengthFromBigInt(s);if(n>r)throw Error("Supplied uint exceeds width: "+r+" vs "+n);if(s<0)throw Error("Supplied uint is negative");return i.bufferBEFromBigInt(s,32)}else if(e.startsWith("int")){if((r=a(e))%8||r<8||r>256)throw Error("Invalid int<N> width: "+r);s=c(t);let n=i.bitLengthFromBigInt(s);if(n>r)throw Error("Supplied int exceeds width: "+r+" vs "+n);let o=i.twosFromBigInt(s,256);return i.bufferBEFromBigInt(o,32)}else if(e.startsWith("ufixed")){if(r=o(e),(s=c(t))<0)throw Error("Supplied ufixed is negative");return u("uint256",s*BigInt(2)**BigInt(r[1]))}else if(e.startsWith("fixed"))return r=o(e),u("int256",c(t)*BigInt(2)**BigInt(r[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 r,o,l=[],u=0;u<e.length;u++){var d=s(e[u]),f=t[u];if("bytes"===d)l.push(f);else if("string"===d)l.push(new n(f,"utf8"));else if("bool"===d)l.push(new n(f?"01":"00","hex"));else if("address"===d)l.push(i.setLength(f,20));else if(d.startsWith("bytes")){if((r=a(d))<1||r>32)throw Error("Invalid bytes<N> width: "+r);l.push(i.setLengthRight(f,r))}else if(d.startsWith("uint")){if((r=a(d))%8||r<8||r>256)throw Error("Invalid uint<N> width: "+r);o=c(f);let e=i.bitLengthFromBigInt(o);if(e>r)throw Error("Supplied uint exceeds width: "+r+" vs "+e);l.push(i.bufferBEFromBigInt(o,r/8))}else if(d.startsWith("int")){if((r=a(d))%8||r<8||r>256)throw Error("Invalid int<N> width: "+r);o=c(f);let e=i.bitLengthFromBigInt(o);if(e>r)throw Error("Supplied int exceeds width: "+r+" vs "+e);let t=i.twosFromBigInt(o,r);l.push(i.bufferBEFromBigInt(t,r/8))}else throw Error("Unsupported or invalid type: "+d)}return n.concat(l)}e.exports={rawEncode:function(e,t){var r=[],i=[],a=32*e.length;for(var o in e){var c=s(e[o]),d=u(c,t[o]);"string"===c||"bytes"===c||"dynamic"===l(c)?(r.push(u("uint256",a)),i.push(d),a+=d.length):r.push(d)}return n.concat(r.concat(i))},solidityPack:d,soliditySHA3:function(e,t){return i.keccak(d(e,t))}}},88481:(e,t,r)=>{"use strict";r.d(t,{secp256k1:()=>eE});var n=r(18775),i=r(46077),s=r(9146);let a=BigInt(0),o=BigInt(1);function l(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function c(e){if(!l(e))throw Error("Uint8Array expected")}function u(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}function d(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function f(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?a:BigInt("0x"+e)}let h="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function y(e){if(c(e),h)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=p[e[r]];return t}let m={_0:48,_9:57,A:65,F:70,a:97,f:102};function g(e){return e>=m._0&&e<=m._9?e-m._0:e>=m.A&&e<=m.F?e-(m.A-10):e>=m.a&&e<=m.f?e-(m.a-10):void 0}function b(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(h)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=g(e.charCodeAt(i)),s=g(e.charCodeAt(i+1));if(void 0===r||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+s}return n}function w(e){return f(y(e))}function v(e){return c(e),f(y(Uint8Array.from(e).reverse()))}function x(e,t){return b(e.toString(16).padStart(2*t,"0"))}function _(e,t){return x(e,t).reverse()}function E(e,t,r){let n;if("string"==typeof t)try{n=b(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(l(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function A(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];c(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let I=e=>"bigint"==typeof e&&a<=e;function C(e,t,r){return I(e)&&I(t)&&I(r)&&t<=e&&e<r}function S(e,t,r,n){if(!C(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}let P=e=>(o<<BigInt(e))-o,$=e=>new Uint8Array(e),k=e=>Uint8Array.from(e),T={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||l(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function O(e,t,r={}){let n=(t,r,n)=>{let i=T[r];if("function"!=typeof i)throw Error("invalid validator function");let s=e[t];if((!n||void 0!==s)&&!i(s,e))throw Error("param "+String(t)+" is invali
314d. Expected "+r+", got "+s)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function N(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let s=e(r,...n);return t.set(r,s),s}}let R=BigInt(0),B=BigInt(1),D=BigInt(2),M=BigInt(3),U=BigInt(4),j=BigInt(5),L=BigInt(8);function F(e,t){let r=e%t;return r>=R?r:t+r}function z(e,t,r){let n=e;for(;t-- >R;)n*=n,n%=r;return n}function q(e,t){if(e===R)throw Error("invert: expected non-zero number");if(t<=R)throw Error("invert: expected positive modulus, got "+t);let r=F(e,t),n=t,i=R,s=B,a=B,o=R;for(;r!==R;){let e=n/r,t=n%r,l=i-a*e,c=s-o*e;n=r,r=t,i=a,s=o,a=l,o=c}if(n!==B)throw Error("invert: does not exist");return F(i,t)}function W(e,t){let r=(e.ORDER+B)/U,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw Error("Cannot find square root");return n}function H(e,t){let r=(e.ORDER-j)/L,n=e.mul(t,D),i=e.pow(n,r),s=e.mul(t,i),a=e.mul(e.mul(s,D),i),o=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),t))throw Error("Cannot find square root");return o}let K=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function V(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),s=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),s),n}function G(e,t){let r=(e.ORDER-B)/D,n=e.pow(t,r),i=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),a=e.eql(n,e.neg(e.ONE));if(!i&&!s&&!a)throw Error("invalid Legendre symbol result");return i?1:s?0:-1}function J(e,t){void 0!==t&&(0,s.Fe)(t);let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Y(e,t,r=!1,n={}){let i;if(e<=R)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:s,nByteLength:a}=J(e,t);if(a>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let o=Object.freeze({ORDER:e,isLE:r,BITS:s,BYTES:a,MASK:P(s),ZERO:R,ONE:B,create:t=>F(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return R<=t&&t<e},is0:e=>e===R,isOdd:e=>(e&B)===B,neg:t=>F(-t,e),eql:(e,t)=>e===t,sqr:t=>F(t*t,e),add:(t,r)=>F(t+r,e),sub:(t,r)=>F(t-r,e),mul:(t,r)=>F(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<R)throw Error("invalid exponent, negatives unsupported");if(r===R)return e.ONE;if(r===B)return t;let n=e.ONE,i=t;for(;r>R;)r&B&&(n=e.mul(n,i)),i=e.sqr(i),r>>=B;return n})(o,e,t),div:(t,r)=>F(t*q(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>q(t,e),sqrt:n.sqrt||(t=>(i||(i=e%U===M?W:e%L===j?H:function(e){if(e<BigInt(3))throw Error("sqrt is not defined for small field");let t=e-B,r=0;for(;t%D===R;)t/=D,r++;let n=D,i=Y(e);for(;1===G(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return W;let s=i.pow(n,t),a=(t+B)/D;return function(e,n){if(e.is0(n))return n;if(1!==G(e,n))throw Error("Cannot find square root");let i=r,o=e.mul(e.ONE,s),l=e.pow(n,t),c=e.pow(n,a);for(;!e.eql(l,e.ONE);){if(e.is0(l))return e.ZERO;let t=1,r=e.sqr(l);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw Error("Cannot find square root");let n=B<<BigInt(i-t-1),s=e.pow(o,n);i=t,o=e.sqr(s),l=e.mul(l,o),c=e.mul(c,s)}return c}}(e)),i(o,t))),toBytes:e=>r?_(e,a):x(e,a),fromBytes:e=>{if(e.length!==a)throw Error("Field.fromBytes: expected "+a+" bytes, got "+e.length);return r?v(e):w(e)},invertBatch:e=>V(o,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(o)}function Z(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function Q(e){let t=Z(e);return t+Math.ceil(t/2)}let X=BigInt(0),ee=BigInt(1);function et(e,t){let r=t.negate();return e?r:t}function er(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function en(e,t){er(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),i=2**e;return{windows:r,windowSize:n,mask:P(e),maxNumber:i,shiftBy:BigInt(e)}}function ei(e,t,r){let{windowSize:n,mask:i,maxNumber:s,shiftBy:a}=r,o=Number(e&i),l=e>>a;o>n&&(o-=s,l+=ee);let c=t*n,u=c+Math.abs(o)-1,d=0===o;return{nextN:l,offset:u,isZero:d,isNeg:o<0,isNegF:t%2!=0,offsetF:c}}let es=new WeakMap,ea=new WeakMap;function eo(e){return ea.get(e)||1}function el(e){return O(e.Fp,K.reduce((e,t)=>
vendor: 14,054 bytes, line 314
314(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),O(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...J(e.n,e.nBitLength),...e,...{p:e.Fp.ORDER}})}function ec(e){void 0!==e.lowS&&u("lowS",e.lowS),void 0!==e.prehash&&u("prehash",e.prehash)}class eu extends Error{constructor(e=""){super(e)}}let ed={Err:eu,_tlv:{encode:(e,t)=>{let{Err:r}=ed;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let n=t.length/2,i=d(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let s=n>127?d(i.length/2|128):"";return d(e)+s+i+t},decode(e,t){let{Err:r}=ed,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],s=0;if(128&i){let e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let a=t.subarray(n,n+e);if(a.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===a[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of a)s=s<<8|e;if(n+=e,s<128)throw new r("tlv.decode(long): not minimal encoding")}else s=i;let a=t.subarray(n,n+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+s)}}},_int:{encode(e){let{Err:t}=ed;if(e<ef)throw new t("integer: negative integers are not allowed");let r=d(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=ed;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return w(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=ed,i=E("signature",e),{v:s,l:a}=n.decode(48,i);if(a.length)throw new t("invalid signature: left bytes after parsing");let{v:o,l:l}=n.decode(2,s),{v:c,l:u}=n.decode(2,l);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(o),s:r.decode(c)}},hexFromSig(e){let{_tlv:t,_int:r}=ed,n=t.encode(2,r.encode(e.r)),i=t.encode(2,r.encode(e.s));return t.encode(48,n+i)}},ef=BigInt(0),eh=BigInt(1),ep=(BigInt(2),BigInt(3)),ey=BigInt(4),em=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),eg=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),eb=BigInt(0),ew=BigInt(1),ev=BigInt(2),ex=(e,t)=>(e+t/ev)/t,e_=Y(em,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),s=BigInt(23),a=BigInt(44),o=BigInt(88),l=e*e*e%em,c=l*l*e%em,u=z(c,t,em)*c%em,d=z(u,t,em)*c%em,f=z(d,ev,em)*l%em,h=z(f,n,em)*f%em,p=z(h,i,em)*h%em,y=z(p,a,em)*p%em,m=z(y,o,em)*y%em,g=z(m,a,em)*p%em,b=z(g,t,em)*c%em,w=z(b,s,em)*h%em,v=z(w,r,em)*l%em,x=z(v,ev,em);if(!e_.eql(e_.sqr(x),e))throw Error("Cannot find square root");return x}}),eE=function(e,t){let r=t=>(function(e){let t=function(e){let t=el(e);return O(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:n,nByteLength:i,nBitLength:s}=t,c=r.BYTES+1,d=2*r.BYTES+1;function f(e){return F(e,n)}let{ProjectivePoint:h,normPrivateKeyToScalar:p,weierstrassEquation:m,isWithinCurveOrder:g}=function(e){var t;let r=function(e){let t=el(e);O(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("invalid endo: CURVE.a must be 0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}(e),{Fp:n}=r,i=Y(r.n,r.nBitLength),s=r.toBytes||((e,t,r)=>{let i=t.toAffine();return A(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),c=r.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function d(e){let{a:t,b:i}=r,s=n.sqr(e),a=n.mul(s,e);return n.add(n.add(a,n.mul(e,t)),i)}function f(e,t){let r=n.sqr(t),i=d(e);return n.eql(r,i)}if(!f(r.Gx,r.Gy))throw Error("bad curve params: generator point");let h=n.mul(n.pow(r.a,ep),ey),p=n.mul(n.sqr(r.b),BigInt(27));if(n.is0(n.add(h,p)))throw Error("bad curve params: a or b");function m(e){let t,{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:s,n:a}=r;if(n&&"bigint"!=typeof e){if(l(e)&&(e=y(e)),"string"!=typeof e||!n.includes(e.length))throw Error("invalid private key");e=e.padStart(2*i,"0")}try{t="bigint"==typeof e?e:w(E("private key",e,i))}catch(t){throw Error("invalid private key, expected hex or "+i+" bytes, got "+typeof e)}return s&&(t=F(t,a)),S("private key",t,eh,a),t}function g(e){if(!(e instanceof x))throw Error("ProjectivePoint expected")}let b=N((e,t)=>{let{px:r,py:i,pz:s}=e;if(n.eql(s,n.ONE))return{x:r,y:i};let a=e.is0();null==t&&(t=a?n.ONE:n.inv(s));let o=n.mul(r,t),l=n.mul(i,t),c=n.mul(s,t);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw Error("invZ was invalid");return{x:o,y:l}}),v=N(e=>{if(e.is0()){if(r.allowInfinityPoint&&!n.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:i}=e.toAffine();if(!n.isValid(t)||!n.isValid(i))throw Error("bad point: x or y not FE");if(!f(t,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class x{constructor(e,t,r){if(null==e||!n.isValid(e))throw Error("x required");if(null==t||!n.isValid(t)||n.is0(t))throw Error("y required");if(null==r||!n.isValid(r))throw Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error("invalid affine point");if(e instanceof x)throw Error("projective point not allowed");let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?x.ZERO:new x(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=V(n,e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(x.fromAffine)}static fromHex(e){let t=x.fromAffine(c(E("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return x.BASE.multiply(m(e))}static msm(e,t){return function(e,t,r,n){if(!Array.isArray(r))throw Error("array expected");r.forEach((t,r)=>{if(!(t instanceof e))throw Error("invalid point at index "+r)});if(!Array.isArray(n))throw Error("array of scalars expected");n.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)});let i=r.length,s=n.length;if(i!==s)throw Error("arrays of points and scalars must have equal length");let l=e.ZERO,c=function(e){let t;for(t=0;e>a;e>>=o,t+=1);return t}(BigInt(i)),u=1;c>12?u=c-3:c>4?u=c-2:c>0&&(u=2);let d=P(u),f=Array(Number(d)+1).fill(l),h=Math.floor((t.BITS-1)/u)*u,p=l;for(let e=h;e>=0;e-=u){f.fill(l);for(let t=0;t<s;t++){let i=Number(n[t]>>BigInt(e)&d);f[i]=f[i].add(r[t])}let t=l;for(let e=f.length-1,r=l;e>0;e--)r=r.add(f[e]),t=t.add(r);if(p=p.add(t),0!==e)for(let e=0;e<u;e++)p=p.double()}return p}(x,i,e,t)}_setWindowSize(e){$.setWindowSize(this,e)}assertValidity(){v(this)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){g(e);let{px:t,py:r,pz:i}=this,{px:s,py:a,pz:o}=e,l=n.eql(n.mul(t,o),n.mul(s,i)),c=n.eql(n.mul(r,o),n.mul(a,i));return l&&c}negate(){return new x(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:t}=r,i=n.mul(t,ep),{px:s,py:a,pz:o}=this,l=n.ZERO,c=n.ZERO,u=n.ZERO,d=n.mul(s,s),f=n.mul(a,a),h=n.mul(o,o),p=n.mul(s,a);return p=n.add(p,p),u=n.mul(s,o),u=n.add(u,u),l=n.mul(e,u),c=n.mul(i,h),c=n.add(l,c),l=n.sub(f,c),c=n.add(f,c),c=n.mul(l,c),l=n.mul(p,l),u=n.mul(i,u),h=n.mul(e,h),p=n.sub(d,h),p=n.mul(e,p),p=n.add(p,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,h),d=n.mul(d,p),c=n.add(c,d),h=n.mul(a,o),h=n.add(h,h),d=n.mul(h,p),l=n.sub(l,d),u=n.mul(h,f),u=n.add(u,u),new x(l,c,u=n.add(u,u))}add(e){g(e);let{px:t,py:i,pz:s}=this,{px:a,py:o,pz:l}=e,c=n.ZERO,u=n.ZERO,d=n.ZERO,f=r.a,h=n.mul(r.b,ep),p=n.mul(t,a),y=n.mul(i,o),m=n.mul(s,l),b=n.add(t,i),w=n.add(a,o);b=n.mul(b,w),w=n.add(p,y),b=n.sub(b,w),w=n.add(t,s);let v=n.add(a,l);return w=n.mul(w,v),v=n.add(p,m),w=n.sub(w,v),v=n.add(i,s),c=n.add(o,l),v=n.mul(v,c),c=n.add(y,m),v=n.sub(v,c),d=n.mul(f,w),c=n.mul(h,m),d=n.add(c,d),c=n.sub(y,d),d=n.add(y,d),u=n.mul(c,d),y=n.add(p,p),y=n.add(y,p),m=n.mul(f,m),w=n.mul(h,w),y=n.add(y,m),m=n.sub(p,m),m=n.mul(f,m),w=n.add(w,m),p=n.mul(y,w),u=n.add(u,p),p=n.mul(v,w),c=n.mul(b,c),c=n.sub(c,p),p=n.mul(b,y),d=n.mul(v,d),new x(c,u,d=n.add(d,p))}subtract(e){return this.add(e.negate())}is0(){return this.equals(x.ZERO)}wNAF(e){return $.wNAFCached(this,e,x.normalizeZ)}multiplyUnsafe(e){let{endo:t,n:i}=r;S("scalar",e,ef,i);let s=x.ZERO;if(e===ef)return s;if(this.is0()||e===eh)return this;if(!t||$.hasPrecomputes(this))return $.wNAFCachedUnsafe(this,e,x.normalizeZ);let{k1neg:a,k1:o,k2neg:l,k2:c}=t.splitScalar(e),u=s,d=s,f=this;for(;o>ef||c>ef;)o&eh&&(u=u.add(f)),c&eh&&(d=d.add(f)),f=f.double(),o>>=eh,c>>=eh;return a&&(u=u.negate()),l&&(d=d.negate()),d=new x(n.mul(d.px,t.beta),d.py,d.pz),u.add(d)}multiply(e){let t,i,{endo:s,n:a}=r;if(S("scalar",e,eh,a),s){let{k1neg:r,k1:a,k2neg:o,k2:l}=s.splitScalar(e),{p:c,f:u}=this.wNAF(a),{p:d,f:f}=this.wNAF(l);c=$.constTimeNegate(r,c),d=$.constTimeNegate(o,d),d=new x(n.mul(d.px,s.beta),d.py,d.pz),t=c.add(d),i=u.add(f)}else{let{p:r,f:n}=this.wNAF(e);t=r,i=n}return x.normalizeZ([t,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=x.BASE,i=(e,t)=>t!==ef&&t!==eh&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,r));return s.is0()?void 0:s}toAffine(e){return b(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=r;if(e===eh)return!0;if(t)return t(x,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=r;return e===eh?this:t?t(x,this):this.multiplyUnsafe(r.h)}toRawBytes(e=!0){return u("isCompressed",e),this.assertValidity(),s(x,this,e)}toHex(e=!0){return u("isCompressed",e),y(this.toRawBytes(e))}}x.BASE=new x(r.Gx,r.Gy,n.ONE),x.ZERO=new x(n.ZERO,n.ONE,n.ZERO);let{endo:_,nBitLength:I}=r,$=(t=_?Math.ceil(I/2):I,{constTimeNegate:et,hasPrecomputes:e=>1!==eo(e),unsafeLadder(e,t,r=x.ZERO){let n=e;for(;t>X;)t&ee&&(r=r.add(n)),n=n.double(),t>>=ee;return r},precomputeWindow(e,r){let{windows:n,windowSize:i}=en(r,t),s=[],a=e,o=a;for(let e=0;e<n;e++){o=a,s.push(o);for(let e=1;e<i;e++)o=o.add(a),s.push(o);a=o.double()}return s},wNAF(e,r,n){let i=x.ZERO,s=x.BASE,a=en(e,t);for(let e=0;e<a.windows;e++){let{nextN:t,offset:o,isZero:l,isNeg:c,isNegF:u,offsetF:d}=ei(n,e,a);n=t,l?s=s.add(et(u,r[d])):i=i.add(et(c,r[o]))}return{p:i,f:s}},wNAFUnsafe(e,r,n,i=x.ZERO){let s=en(e,t);for(let e=0;e<s.windows&&n!==X;e++){let{nextN:t,offset:a,isZero:o,isNeg:l}=ei(n,e,s);if(n=t,!o){let e=r[a];i=i.add(l?e.negate():e)}}return i},getPrecomputes(e,t,r){let n=es.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&es.set(t,r(n))),n},wNAFCached(e,t,r){let n=eo(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=eo(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){er(r,t),ea.set(e,r),es.delete(e)}});return{CURVE:r,ProjectivePoint:x,normPrivateKeyToScalar:m,weierstrassEquation:d,isWithinCurveOrder:function(e){return C(e,eh,r.n)}}}({...t,toBytes(e,t,n){let i=t.toAffine(),s=r.toBytes(i.x);return(u("isCompressed",n),n)?A(Uint8Array.from([t.hasEvenY()?2:3]),s):A(Uint8Array.from([4]),s,r.toBytes(i.y))},fromBytes(e){let t=e.length,n=e[0],i=e.subarray(1);if(t===c&&(2===n||3===n)){let e,t=w(i);if(!C(t,eh,r.ORDER))throw Error("Point is not on curve");let s=m(t);try{e=r.sqrt(s)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&n)==1!=((e&eh)===eh)&&(e=r.neg(e)),{x:t,y:e}}if(t===d&&4===n)return{x:r.fromBytes(i.subarray(0,r.BYTES)),y:r.fromBytes(i.subarray(r.BYTES,2*r.BYTES))};throw Error("invalid Point, expected length of "+c+", or uncompressed "+d+", got "+t)}}),I=(e,t,r)=>w(e.slice(t,r));class T{constructor(e,t,r){S("r",e,eh,n),S("s",t,eh,n),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){return new T(I(e=E("compactSignature",e,2*i),0,i),I(e,i,2*i))}static fromDER(e){let{r:t,s:r}=ed.toSig(E("DER",e));return new T(t,r)}assertValidity(){}addRecoveryBit(e){return new T(this.r,this.s,e)}recoverPublicKey(e){let{r:i,s,recovery:a}=this,o=M(E("msgHash",e));if(null==a||![0,1,2,3].includes(a))throw Error("recovery id invalid");let l=2===a||3===a?i+t.n:i;if(l>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let c=(1&a)==0?"02":"03",u=h.fromHex(c+y(x(l,r.BYTES))),d=q(l,n),p=f(-o*d),m=f(s*d),g=h.BASE.multiplyAndAddUnsafe(u,p,m);if(!g)throw Error("point at infinify");return g.assertValidity(),g}hasHighS(){return this.s>n>>eh}normalizeS(){return this.hasHighS()?new T(this.r,f(-this.s),this.recovery):this}toDERRawBytes(){return b(this.toDERHex())}toDERHex(){return ed.hexFromSig(this)}toCompactRawBytes(){return b(this.toCompactHex())}toCompactHex(){return y(x(this.r,i))+y(x(this.s,i))}}function R(e){if("bigint"==typeof e)return!1;if(e instanceof h)return!0;let n=E("key",e).length,s=r.BYTES,a=s+1;if(!t.allowedPrivateKeyLengths&&i!==a)return n===a||n===2*s+1}let D=t.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=w(e),r=8*e.length-s;return r>0?t>>BigInt(r):t},M=t.bits2int_modN||function(e){return f(D(e))},U=P(s);function j(e){return S("num < 2^"+s,e,ef,U),x(e,i)}let L={lowS:t.lowS,prehash:!1},z={lowS:t.lowS,prehash:!1};return h.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return h.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(!0===R(e))throw Error("first arg must be private key");if(!1===R(t))throw Error("second arg must be public key");
vendor: 4,160 bytes, line 314
314return h.fromHex(t).multiply(p(e)).toRawBytes(r)},sign:function(e,i,s=L){let{seed:a,k2sig:o}=function(e,i,s=L){if(["recovered","canonical"].some(e=>e in s))throw Error("sign() legacy options not supported");let{hash:a,randomBytes:o}=t,{lowS:l,prehash:c,extraEntropy:u}=s;null==l&&(l=!0),e=E("msgHash",e),ec(s),c&&(e=E("prehashed msgHash",a(e)));let d=M(e),y=p(i),m=[j(y),j(d)];if(null!=u&&!1!==u){let e=!0===u?o(r.BYTES):u;m.push(E("extraEntropy",e))}return{seed:A(...m),k2sig:function(e){var t;let r=D(e);if(!g(r))return;let i=q(r,n),s=h.BASE.multiply(r).toAffine(),a=f(s.x);if(a===ef)return;let o=f(i*f(d+a*y));if(o===ef)return;let c=2*(s.x!==a)|Number(s.y&eh),u=o;return l&&o>n>>eh&&(u=(t=o)>n>>eh?f(-t):t,c^=1),new T(a,u,c)}}}(e,i,s);return(function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=$(e),i=$(e),s=0,a=()=>{n.fill(1),i.fill(0),s=0},o=(...e)=>r(i,n,...e),l=(e=$(0))=>{i=o(k([0]),e),n=o(),0!==e.length&&(i=o(k([1]),e),n=o())},c=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=o()).slice();r.push(t),e+=n.length}return A(...r)};return(e,t)=>{let r;for(a(),l(e);!(r=t(c()));)l();return a(),r}})(t.hash.outputLen,t.nByteLength,t.hmac)(a,o)},verify:function(e,r,i,s=z){let a,o;r=E("msgHash",r),i=E("publicKey",i);let{lowS:c,prehash:u,format:d}=s;if(ec(s),"strict"in s)throw Error("options.strict was renamed to lowS");if(void 0!==d&&"compact"!==d&&"der"!==d)throw Error("format must be compact or der");let p="string"==typeof e||l(e),y=!p&&!d&&"object"==typeof e&&null!==e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!p&&!y)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(y&&(o=new T(e.r,e.s)),p){try{"compact"!==d&&(o=T.fromDER(e))}catch(e){if(!(e instanceof ed.Err))throw e}o||"der"===d||(o=T.fromCompact(e))}a=h.fromHex(i)}catch(e){return!1}if(!o||c&&o.hasHighS())return!1;u&&(r=t.hash(r));let{r:m,s:g}=o,b=M(r),w=q(g,n),v=f(b*w),x=f(m*w),_=h.BASE.multiplyAndAddUnsafe(a,v,x)?.toAffine();return!!_&&f(_.x)===m},ProjectivePoint:h,Signature:T,utils:{isValidPrivateKey(e){try{return p(e),!0}catch(e){return!1}},normPrivateKeyToScalar:p,randomPrivateKey:()=>{let e=Q(t.n);return function(e,t,r=!1){let n=e.length,i=Z(t),s=Q(t);if(n<16||n<s||n>1024)throw Error("expected "+s+"-1024 bytes of input, got "+n);let a=F(r?v(e):w(e),t-B)+B;return r?_(a,i):x(a,i)}(t.randomBytes(e),t.n)},precompute:(e=8,t=h.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...e,...{hash:t,hmac:(e,...r)=>(0,i.w)(t,e,(0,s.Id)(...r)),randomBytes:s.po}});return{...r(t),create:r}}({a:eb,b:BigInt(7),Fp:e_,n:eg,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-ew*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),s=ex(t*e,eg),a=ex(-r*e,eg),o=F(e-s*t-a*n,eg),l=F(-s*r-a*t,eg),c=o>i,u=l>i;if(c&&(o=eg-o),u&&(l=eg-l),o>i||l>i)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:c,k1:o,k2neg:u,k2:l}}}},n.sc)},89164:(e,t,r)=>{"use strict";function n(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function i(e){return n(e)&&"method"in e}function s(e){return n(e)&&(a(e)||o(e))}function a(e){return"result"in e}function o(e){return"error"in e}r.d(t,{U$:()=>o,p3:()=>i,tq:()=>s,xT:()=>a})},89502:(e,t,r)=>{"use strict";function n(e,{format:t}){if(!t)return{};let r={};return!function t(n){for(let i of Object.keys(n))i in e&&(r[i]=e[i]),n[i]&&"object"==typeof n[i]&&!Array.isArray(n[i])&&t(n[i])}(t(e||{})),r}r.d(t,{o:()=>n})},89534:(e,t,r)=>{"use strict";r.d(t,{s:()=>s});var n=r(68145),i=r(16025);async function s(e,{serializedTransaction:t,throwOnReceiptRevert:r,timeout:s}
314){let a=await e.request({method:"eth_sendRawTransactionSync",params:s?[t,s]:[t]},{retryCount:0}),o=(e.chain?.formatters?.transactionReceipt?.format||i.uL)(a);if("reverted"===o.status&&r)throw new n.Sq({receipt:o});return o}},89633:(e,t,r)=>{"use strict";r.d(t,{B:()=>i});var n=r(99809);function i(e){return"function"===e.type?`function ${e.name}(${(0,n.Q)(e.inputs)})${e.stateMutability&&"nonpayable"!==e.stateMutability?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${(0,n.Q)(e.outputs)})`:""}`:"event"===e.type?`event ${e.name}(${(0,n.Q)(e.inputs)})`:"error"===e.type?`error ${e.name}(${(0,n.Q)(e.inputs)})`:"constructor"===e.type?`constructor(${(0,n.Q)(e.inputs)})${"payable"===e.stateMutability?" payable":""}`:"fallback"===e.type?`fallback() external${"payable"===e.stateMutability?" payable":""}`:"receive() external payable"}},90170:function(e){e.exports=function(){"use strict";function e(e){return Number.isInteger(e)&&e>=0}function t(e){this.name="ArgumentError",this.message=e}return function(r,n){if(n=n||{},"function"!=typeof r)throw new t("fetch must be a function");if("object"!=typeof n)throw new t("defaults must be an object");if(void 0!==n.retries&&!e(n.retries))throw new t("retries must be a positive integer");if(void 0!==n.retryDelay&&!e(n.retryDelay)&&"function"!=typeof n.retryDelay)throw new t("retryDelay must be a positive integer or a function returning a positive integer");if(void 0!==n.retryOn&&!Array.isArray(n.retryOn)&&"function"!=typeof n.retryOn)throw new t("retryOn property expects an array or function");return n=Object.assign({retries:3,retryDelay:1e3,retryOn:[]},n),function(i,s){var a=n.retries,o=n.retryDelay,l=n.retryOn;if(s&&void 0!==s.retries)if(e(s.retries))a=s.retries;else throw new t("retries must be a positive integer");if(s&&void 0!==s.retryDelay)if(e(s.retryDelay)||"function"==typeof s.retryDelay)o=s.retryDelay;else throw new t("retryDelay must be a positive integer or a function returning a positive integer");if(s&&s.retryOn)if(Array.isArray(s.retryOn)||"function"==typeof s.retryOn)l=s.retryOn;else throw new t("retryOn property expects an array or function");return new Promise(function(e,t){var n=function(n){r("undefined"!=typeof Request&&i instanceof Request?i.clone():i,s).then(function(r){if(Array.isArray(l)&&-1===l.indexOf(r.status))e(r);else if("function"==typeof l)try{return Promise.resolve(l(n,null,r)).then(function(t){t?c(n,null,r):e(r)}).catch(t)}catch(e){t(e)}else n<a?c(n,null,r):e(r)}).catch(function(e){if("function"==typeof l)try{Promise.resolve(l(n,e,null)).then(function(r){r?c(n,e,null):t(e)}).catch(function(e){t(e)})}catch(e){t(e)}else n<a?c(n,e,null):t(e)})};function c(e,t,r){setTimeout(function(){n(++e)},"function"==typeof o?o(e,t,r):o)}n(0)})}}}()},90320:(e,t,r)=>{"use strict";function n(e,t){let r=e.exec(t);return r?.groups}r.d(t,{BD:()=>i,Ge:()=>s,Yv:()=>n,wj:()=>a});let i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,s=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,a=/^\(.+?\).*?$/},90391:(e,t,r)=>{"use strict";r.d(t,{s:()=>o});var n=r(43793),i=r(92733),s=r(36665),a=r(651);function o(e,t){let r=(0,n.sc)((0,i.q)(e,{strict:!1})?(0,s.ZJ)(e):e);return"bytes"===(t||"hex")?r:(0,a.nj)(r)}},90517:(e,t,r)=>{"use strict";r.d(t,{h:()=>c});var n=r(63710),i=r(92594),s=r(72334),a=r(29447),o=r(40857),l=r(1232);async function c(e,t){let{account:r=e.account,chainId:c,nonce:u}=t;if(!r)throw new i.T({docsPath:"/docs/eip7702/prepareAuthorization"});let d=(0,n.J)(r),f=(()=>{if(t.executor)return"self"===t.executor?t.executor:(0,n.J)(t.executor)})(),h={address:t.contractAddress??t.address,chainId:c,nonce:u};return void 0===h.chainId&&(h.chainId=e.chain?.id??await (0,a.T)(e,o.T,"getChainId")({})),void 0===h.nonce&&(h.nonce=await (0,a.T)(e,l.y,"getTransactionCount")({address:d.address,blockTag:"pending"}),("self"===f||f?.address&&(0,s.h)(f.address,d.address))&&(h.nonce+=1)),h}},90892:(e,t,r)=>{"use strict";r.d(t,{O:()=>c,_:()=>l});var n=r(24243),i=r(12089),s=r(58239),a=r(42606),o=r(55035);async function l(e,t){return c(e,t)}async function c(e,t){let{block:r,chain:l=e.chain,request:c,type:u="eip1559"}=t||{},d=await (async()=>"function"==typeof l?.fees?.baseFeeMultiplier?l.fees.baseFeeMultiplier({block:r,client:e,request:c}):l?.fees?.baseFeeMultiplier??1.2)();if(d<1)throw new n.sM;let f=d.toString().split(".")[1]?.length??0,h=10**f,p=e=>e*BigInt(Math.ceil(d*h))/BigInt(h),y=r||await (0,i.T)(e,a.g,"getBlock")({});if("function"==typeof l?.fees?.estimateFeesPerGas){let t=await l.fees.estimateFeesPerGas({block:r,client:e,multiply:p,request:c,type:u});if(null!==t)return t}if("eip1559"===u){if("bigint"!=typeof y.baseFeePerGas)throw new n.pw;let t="bigint"==typeof c?.maxPriorityFeePerGas?c.maxPriorityFeePerGas:await (0,s.N)(e,{block:y,chain:l,request:c}),r=p(y.baseFeePerGas);return{maxFeePerGas:c?.maxFeePerGas??r+t,maxPriorityFeePerGas:t}}return{gasPrice:c?.gasPrice??p(await (0,i.T)(e,o.L,"getGasPrice")({}))}}},90999:(e,t,r)=>{"use strict";r.d(t,{J:()=>l});var n=r(40407),i=r(10439),s=r(61349),a=r(29447),o=r(37438);async function l(e,t){let{abi:r,address:l,args:c,functionName:u,...d}=t,f=(0,i.p)({abi:r,args:c,functionName:u});try{let{data:t}=await (0,a.T)(e,o.T,"call")({...d,data:f,to:l});return(0,n.e)({abi:r,args:c,functionName:u,data:t||"0x"})}catch(e){throw(0,s.j)(e,{abi:r,address:l,args:c,docsPath:"/docs/contract/readContract",functionName:u})}}},91607:(e,t,r)=>{"use strict";r.d(t,{x:()=>u});
314var n=r(93255),i=r(92733),s=r(44633),a=r(5596),o=r(651);async function l({hash:e,signature:t}){let n=(0,i.q)(e)?e:(0,o.nj)(e),{secp256k1:l}=await Promise.resolve().then(r.bind(r,88481)),u=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){let{r:e,s:r,v:n,yParity:i}=t,s=c(Number(i??n));return new l.Signature((0,a.uU)(e),(0,a.uU)(r)).addRecoveryBit(s)}let e=(0,i.q)(t)?t:(0,o.nj)(t);if(65!==(0,s.E)(e))throw Error("invalid signature length");let r=c((0,a.ME)(`0x${e.slice(130)}`));return l.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(r)})().recoverPublicKey(n.substring(2)).toHex(!1);return`0x${u}`}function c(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}async function u({hash:e,signature:t}){return(0,n.M)(await l({hash:e,signature:t}))}},91855:(e,t,r)=>{"use strict";r.d(t,{Q:()=>b});var n=r(63710),i=r(99838),s=r(9652),a=r(651),o=r(10187),l=r(65385),c=r(68145);class u extends i.C{constructor(e,{account:t,docsPath:r,chain:n,data:i,gas:s,gasPrice:a,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:f,to:h,value:p}){super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",(0,c.aO)({from:t?.address,to:h,value:void 0!==p&&`${(0,o.c)(p)} ${n?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:s,gasPrice:void 0!==a&&`${(0,l.Q)(a)} gwei`,maxFeePerGas:void 0!==u&&`${(0,l.Q)(u)} gwei`,maxPriorityFeePerGas:void 0!==d&&`${(0,l.Q)(d)} gwei`,nonce:f})].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}var d=r(64507),f=r(76243),h=r(89502),p=r(95016),y=r(14992),m=r(74869),g=r(29421);async function b(e,t){let{account:r=e.account,prepare:o=!0}=t,l=r?(0,n.J)(r):void 0,c=Array.isArray(o)?o:l?.type!=="local"?["blobVersionedHashes"]:void 0;try{let r=await (async()=>t.to?t.to:t.authorizationList&&t.authorizationList.length>0?await (0,s.g)({authorization:t.authorizationList[0]}).catch(()=>{throw new i.C("`to` is required. Could not infer from `authorizationList`")}):void 0)(),{accessList:n,authorizationList:u,blobs:d,blobVersionedHashes:f,blockNumber:b,blockTag:w,data:v,gas:x,gasPrice:_,maxFeePerBlobGas:E,maxFeePerGas:A,maxPriorityFeePerGas:I,nonce:C,value:S,stateOverride:P,...$}=o?await (0,g.ft)(e,{...t,parameters:c,to:r}):t;if(x&&t.gas!==x)return x;let k=("bigint"==typeof b?(0,a.cK)(b):void 0)||w,T=(0,y.yH)(P);(0,m.c)(t);let O=e.chain?.formatters?.transactionRequest?.format,N=(O||p.Bv)({...(0,h.o)($,{format:O}),account:l,accessList:n,authorizationList:u,blobs:d,blobVersionedHashes:f,data:v,gasPrice:_,maxFeePerBlobGas:E,maxFeePerGas:A,maxPriorityFeePerGas:I,nonce:C,to:r,value:S},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:T?[N,k??e.experimental_blockTag??"latest",T]:k?[N,k]:[N]}))}catch(r){throw function(e,{docsPath:t,...r}){return new u((()=>{let t=(0,f.l)(e,r);return t instanceof d.RM?e:t})(),{docsPath:t,...r})}(r,{...t,account:l,chain:e.chain})}}},92202:(e,t,r)=>{"use strict";r.d(t,{u:()=>i});var n=r(70044);async function i(e,{signal:t}={}){return new Promise((r,i)=>{if(t?.aborted)return void i((0,n.TY)(t));let s=()=>t?.removeEventListener("abort",o),a=setTimeout(()=>{s(),r()},e),o=()=>{clearTimeout(a),s(),i((0,n.TY)(t))};t?.addEventListener("abort",o,{once:!0})})}},92204:(e,t,r)=>{"use strict";r.d(t,{v:()=>a});var n=r(75834);let i=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.delete(e))},a=t=e(n,i,s);return s},s=e=>{let t=(e=>e?i(e):i)(e),r=e=>(function(e,t=e=>e){let r=n.useSyncExternalStore(e.subscribe,n.useCallback(()=>t(e.getState()),[e,t]),n.useCallback(()=>t(e.getInitialState()),[e,t]));return n.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},a=e=>e?s(e):s},92340:(e,t,r)=>{"use strict";function n(e,t){let r=function(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}function i(e){return n(e,"^https?:")}function s(e){return n(e,"^wss?:")}function a(e){return RegExp("wss?://localhost(:d{2,5})?").test(e)}r.d(t,{A1:()=>s,q$:()=>i,z:()=>a})},92594:(e,t,r)=>{"use strict";r.d(t,{T:()=>i,Z:()=>s});var n=r(99838);class i extends n.C{constructor({docsPath:e}={}){super("Could not find an Account to execute with this Action.\nPlease provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client.",{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class s extends n.C{constructor({docsPath:e,metaMessages:t,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:e,metaMessages:t,name:"AccountTypeNotSupportedError"})}}},92672:(e,t,r)=>{"use strict";r.d(t,{CG:()=>n});let n={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}}},92710:(e,t,r)=>{"use strict";r.d(t,{W:()=>l});var n=r(63710),i=r(10439),s=r(61349),a=r(29447),o=r(91855);async function l(e,t){let{abi:r,address:l,args:c,functionName:u,dataSuffix:d="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,...f}=t,h=(0,i.p)({abi:r,args:c,functionName:u});try{return await (0,a.T)(e,o.Q,"estimateGas")({data:`${h}${d?d.replace("0x",""):""}`,to:l,...f})}catch(t){let e=f.account?(0,n.J)(f.account):void 0;throw(0,s.j)(t,{abi:r,address:l,args:c,docsPath:"/docs/contract/estimateContractGas",functionName:u,sender:e?.address})}}},92733:(e,t,r)=>{"use strict";function n(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}r.d(t,{q:()=>n})},93062:(e,t,r)=>{"use strict";r.d(t,{E7:()=>h,Pw:()=>f,Yr:()=>d,cP:()=>u,mj:()=>b,nh:()=>p,ov:()=>m,th:()=>g});var n=r(67008),i=r(27526),s=r(72334),a=r(10439),o=r(99808),l=r(85267),c=r(90999);function u(e,t){return{amount:e,decimals:t,formatted:(0,o.J)(e,t)}}function d(e,t){if("bigint"==typeof e)return e;let r=e.decimals??t;return(0,l.X)(e.formatted,function(e){if(void 0===e)throw Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");return e}(r))}function f(e,t){return"bigint"==typeof e?t:e.decimals??t}function h(e,t){let{decimals:r,token:n}=t,a=p(e,n);if(a)return{address:a.address,decimals:r??a.decimals};if((0,i.P)(n,{strict:!1}))return{address:n,decimals:r??function(e,t){let r=e.tokens,n=e.chain?.id;if(r&&void 0!==n)for(let e of r){let r=y(e,n);if(r&&(0,s.h)(r.address,t))return r.decimals}}(e,n)};throw Error(`Token "${n}" is not a declared ERC-20 token on the client's \`tokens\` array (with an address for the client's chain), and is not a valid address.`)}function p(e,t){let r=e.tokens,n=e.chain?.id;if(!r||void 0===n)return;let a=function(e,t){let r=t.toLowerCase();for(let t of e)if(t.symbol?.toLowerCase()===r)return t}(r,t);if(a)return y(a,n);if((0,i.P)(t,{strict:!1}))for(let e of r){let r=y(e,n);if(r&&(0,s.h)(r.address,t))return r}}function y(e,t){let r=e.addresses[t];if(r)return{address:r,currency:e.currency,decimals:e.decimals,name:e.name,popular:e.popular,symbol:e.symbol}}async function m(e,t){let{address:r,decimals:i}=h(e,t);return void 0!==i?{address:r,decimals:i}:{address:r,decimals:await (0,c.J)(e,{abi:n.xw,address:r,functionName:"decimals"})}}function g(e){let{account:t,chain:r,gas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:a}=e;return{account:t,chain:r,gas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,nonce:a}}function b(e){return{...e,data:(0,a.p)(e),to:e.address}}},93255:(e,t,r)=>{"use strict";r.d(t,{M:()=>s});var n=r(48717),i=r(3303);function s(e){let t=(0,i.S)(`0x${e.substring(4)}`).substring(26);return(0,n.o)(`0x${t}`)}},93473:(e,t,r)=>{"use strict";r.d(t,{H4:()=>m,v8:()=>p,$$:()=>y});var n=r(45897),i=r(23971),s=r(97314),a=r(15520);class o extends a.C{constructor({domain:e}){super(`Invalid domain "${(0,s.A)(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class l extends a.C{constructor({primaryType:e,types:t}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(t))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class c extends a.C{constructor({type:e}){super(`Struct type "${e}
314" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}var u=r(60336),d=r(21047),f=r(44037),h=r(41356);function p(e){let{domain:t,message:r,primaryType:n,types:i}=e,a=(e,t)=>{let r={...t};for(let t of e){let{name:e,type:n}=t;"address"===n&&(r[e]=r[e].toLowerCase())}return r},o=i.EIP712Domain&&t?a(i.EIP712Domain,t):{},l=(()=>{if("EIP712Domain"!==n)return a(i[n],r)})();return(0,s.A)({domain:o,message:l,primaryType:n,types:i})}function y(e){let{domain:t,message:r,primaryType:s,types:a}=e,p=(e,t)=>{for(let r of e){let{name:e,type:s}=r,o=t[e],l=s.match(h.Ge);if(l&&("number"==typeof o||"bigint"==typeof o)){let[e,t,r]=l;(0,f.cK)(o,{signed:"int"===t,size:Number.parseInt(r,10)/8})}if("address"===s&&"string"==typeof o&&!(0,u.P)(o))throw new i.M({address:o});let y=s.match(h.BD);if(y){let[e,t]=y;if(t&&(0,d.E)(o)!==Number.parseInt(t,10))throw new n.BI({expectedSize:Number.parseInt(t,10),givenSize:(0,d.E)(o)})}let m=a[s];m&&(function(e){if("address"===e||"bool"===e||"string"===e||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new c({type:e})}(s),p(m,o))}};if(a.EIP712Domain&&t){if("object"!=typeof t)throw new o({domain:t});p(a.EIP712Domain,t)}if("EIP712Domain"!==s)if(a[s])p(a[s],r);else throw new l({primaryType:s,types:a})}function m({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},("number"==typeof e?.chainId||"bigint"==typeof e?.chainId)&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}},93774:(e,t,r)=>{"use strict";r.d(t,{Hi:()=>i,ft:()=>s,uj:()=>o});var n=r(15520);class i extends n.C{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class s extends n.C{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function a(e){return e.reduce((e,{slot:t,value:r})=>`${e}        ${t}: ${r}
315`,"")}function o(e){return e.reduce((e,{address:t,...r})=>{let n=`${e}    ${t}:
316`;return r.nonce&&(n+=`      nonce: ${r.nonce}
317`),r.balance&&(n+=`      balance: ${r.balance}
318`),r.code&&(n+=`      code: ${r.code}
319`),r.state&&(n+="      state:\n",n+=a(r.state)),r.stateDiff&&(n+="      stateDiff:\n",n+=a(r.stateDiff)),n},"  State Override:\n").slice(0,-1)}},93846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(57924);n.__exportStar(r(60449),t),n.__exportStar(r(21329),t)},93861:(e,t,r)=>{"use strict";r.d(t,{p:()=>a});var n=r(64507),i=r(68145),s=r(76243);function a(e,{docsPath:t,...r}){let a=(()=>{let t=(0,s.l)(e,r);return t instanceof n.RM?e:t})();return new i.$s(a,{docsPath:t,...r})}},94091:e=>{"use strict";e.exports=function e(t){if("number"==typeof t&&isNaN(t))throw Error("NaN is not allowed");if("number"==typeof t&&!isFinite(t))throw Error("Infinity is not allowed");if(null===t||"object"!=typeof t)return JSON.stringify(t);if(t.toJSON instanceof Function)return e(t.toJSON());if(Array.isArray(t)){let r=t.reduce((t,r,n)=>`${t}${0===n?"":","}${e(void 0===r||"symbol"==typeof r?null:r)}`,"");return`[${r}]`}let r=Object.keys(t).sort().reduce((r,n)=>{if(void 0===t[n]||"symbol"==typeof t[n])return r;let i=0===r.length?"":",";return`${r}${i}${e(n)}:${e(t[n])}`},"");return`{${r}}`}},94245:(e,t,r)=>{"use strict";r.d(t,{$U:()=>F,$u:()=>T,$z:()=>v,A0:()=>x,A6:()=>g,AG:()=>a,BE:()=>O,C5:()=>el,DD:()=>h,Dp:()=>eg,E2:()=>eh,ED:()=>eo,FI:()=>et,GK:()=>eb,GN:()=>J,H_:()=>ew,Hh:()=>U,I1:()=>V,I3:()=>_,Id:()=>z,Iz:()=>p,Jj:()=>c,KI:()=>k,Kw:()=>L,M$:()=>ep,M2:()=>N,MT:()=>y,No:()=>eu,OA:()=>ee,PE:()=>er,PG:()=>ey,Rb:()=>d,Rj:()=>A,Tm:()=>ed,VC:()=>H,W5:()=>es,WN:()=>M,WW:()=>w,XH:()=>b,XN:()=>n,XW:()=>E,aW:()=>Y,aw:()=>D,bt:()=>G,bz:()=>ei,dp:()=>ef,e5:()=>I,fQ:()=>Z,fd:()=>o,gp:()=>P,hZ:()=>X,ij:()=>ec,j2:()=>j,jC:()=>q,kC:()=>l,lb:()=>B,lw:()=>$,mK:()=>W,m_:()=>R,mb:()=>s,nG:()=>em,nU:()=>m,oO:()=>i,qU:()=>u,qs:()=>S,r6:()=>Q,rK:()=>K,uH:()=>f,w0:()=>C,wG:()=>en,xh:()=>ev,zs:()=>ea});let n={path:"/api/v1/analytics_events",method:"POST"},i={path:"/api/v1/apps/:app_id",method:"GET"},s={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},a={path:"/api/v1/funding/coinbase_on_ramp/status",method:"GET"},o={path:"/api/v1/apps/:app_id/cross-app/connections",method:"GET"},l={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"},c={path:"/api/v1/custom_jwt_account/link",method:"POST"},u={path:"/api/v1/farcaster/init",method:"POST"},d={path:"/api/v1/farcaster/authenticate",method:"POST"},f={path:"/api/v1/farcaster/link",method:"POST"},h={path:"/api/v1/farcaster/unlink",method:"POST"},p={path:"/api/v1/farcaster/status",method:"GET"},y={path:"/api/v2/farcaster/init",method:"POST"},m={path:"/api/v2/farcaster/authenticate",method:"POST"},g={path:"/api/v1/guest/authenticate",method:"POST"},b={path:"/api/v1/mfa/passkeys/init",method:"POST"},w={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"},v={path:"/api/v1/oauth/authenticate",method:"POST"},x={path:"/api/v1/oauth/init",method:"POST"},_={path:"/api/v1/oauth/link",method:"POST"},E={path:"/api/v1/oauth/unlink",method:"POST"},A={path:"/api/v1/passkeys/link",method:"POST"},I={path:"/api/v1/passkeys/authenticate",method:"POST"},C={path:"/api/v1/passkeys/register",method:"POST"},S={path:"/api/v1/passkeys/authenticate/init",method:"POST"},P={path:"/api/v1/passkeys/register/init",method:"POST"},$={path:"/api/v1/passkeys/link/init",method:"POST"},k={path:"/api/v1/passwordless/authenticate",method:"POST"},T={path:"/api/v1/passwordless/init",method:"POST"},O={path:"/api/v1/passwordless/link",method:"POST"},N={path:"/api/v1/passwordless/unlink",method:"POST"},R={path:"/api/v1/passwordless/update",method:"POST"},B={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},D={path:"/api/v1/passwordless_sms/init",method:"POST"},M={path:"/api/v1/passwordless_sms/link",method:"POST"},U={path:"/api/v1/passwordless_sms/unlink",method:"POST"},j={path:"/api/v1/passwordless_sms/update",method:"POST"},L={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},F={path:"/api/v1/recovery/oauth/init",method:"POST"},z={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},q={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},W={path:"/api/v1/recovery/configuration_icloud",method:"POST"},H={path:"/api/v1/onramp/deposit_addresses/quote",method:"POST"},K={path:"/api/v1/onramp/deposit_addresses/orders/:order_id",method:"GET"},V={path:"/api/v1/onramp/deposit_addresses/:deposit_address_id/next_order",method:"GET"},G={path:"/api/v1/onramp/deposit_addresses/deposit_config",method:"GET"},J=(e,t)=>
319t?Object.entries(t).reduce((e,[t,r])=>e.replace(`:${t}`,`${r}`),e):e,Y={path:"/api/v1/sessions",method:"POST"},Z={path:"/api/v1/sessions/logout",method:"POST"},Q={path:"/api/v1/apps/:app_id/smart_wallets",method:"GET"},X={path:"/api/v1/siwe/init",method:"POST"},ee={path:"/api/v1/siwe/authenticate",method:"POST"},et={path:"/api/v1/siwe/link",method:"POST"},er={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},en={path:"/api/v1/siwe/unlink",method:"POST"},ei={path:"/api/v1/siws/init",method:"POST"},es={path:"/api/v1/siws/authenticate",method:"POST"},ea={path:"/api/v1/siws/link",method:"POST"},eo={path:"/api/v1/siws/unlink",method:"POST"},el={path:"/api/v1/users/me/accept_terms",method:"POST"},ec={path:"/api/v1/plugins/moonpay_on_ramp/sign",method:"POST"},eu={path:"/api/v1/onramp/stripe/create_link_auth_intent",method:"POST"},ed={path:"/api/v1/onramp/stripe/exchange_tokens",method:"POST"},ef={path:"/api/v1/onramp/stripe/customer",method:"GET"},eh={path:"/api/v1/onramp/stripe/customer/wallets",method:"GET"},ep={path:"/api/v1/onramp/stripe/customer/payment_tokens",method:"GET"},ey={path:"/api/v1/onramp/stripe/create_onramp_session",method:"POST"},em={path:"/api/v1/onramp/stripe/quote/:session_id",method:"POST"},eg={path:"/api/v1/onramp/stripe/checkout/:session_id",method:"POST"},eb={path:"/api/v1/wallets",method:"POST"},ew={path:"/api/v1/wallets/:wallet_id/rpc",method:"POST"},ev={path:"/api/v1/wallets/revoke",method:"POST"}},94383:(e,t,r)=>{"use strict";r.d(t,{c:()=>l});var n=r(97352),i=r(37888),s=r(23971),a=r(31445),o=r(60336);function l(e){let{account:t,maxFeePerGas:r,maxPriorityFeePerGas:l,to:c}=e,u=t?(0,n.J)(t):void 0;if(u&&!(0,o.P)(u.address))throw new s.M({address:u.address});if(c&&!(0,o.P)(c))throw new s.M({address:c});if(r&&r>i.Ao)throw new a.BG({maxFeePerGas:r});if(l&&r&&l>r)throw new a.lN({maxFeePerGas:r,maxPriorityFeePerGas:l})}},94828:(e,t,r)=>{"use strict";r.d(t,{G:()=>a});let n=new Map,i=new Map;async function s(e,{cacheKey:t,cacheTime:r=1/0}){let s=function(e){let t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:r=>t.set(e,r)}),r=t(e,n),s=t(e,i);return{clear:()=>{r.clear(),s.clear()},promise:r,response:s}}(t),a=s.response.get();if(a&&r>0&&Date.now()-a.created.getTime()<r)return a.data;let o=s.promise.get();o||(o=e(),s.promise.set(o));try{let e=await o;return s.response.set({created:new Date,data:e}),e}finally{s.promise.clear()}}async function a(e,{cacheTime:t=e.cacheTime}={}){let r;return BigInt(await s(()=>e.request({method:"eth_blockNumber"}),{cacheKey:(r=e.uid,`blockNumber.${r}`),cacheTime:t}))}},95016:(e,t,r)=>{"use strict";r.d(t,{Bv:()=>a,bm:()=>o});var n=r(651),i=r(75941);let s={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function a(e,t){let r={};return void 0!==e.authorizationList&&(r.authorizationList=e.authorizationList.map(e=>({address:e.address,r:e.r?(0,n.cK)(BigInt(e.r)):e.r,s:e.s?(0,n.cK)(BigInt(e.s)):e.s,chainId:(0,n.cK)(e.chainId),nonce:(0,n.cK)(e.nonce),...void 0!==e.yParity?{yParity:(0,n.cK)(e.yParity)}:{},...void 0!==e.v&&void 0===e.yParity?{v:(0,n.cK)(e.v)}:{}}))),void 0!==e.accessList&&(r.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(r.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?r.blobs=e.blobs.map(e=>(0,n.My)(e)):r.blobs=e.blobs),void 0!==e.data&&(r.data=e.data),e.account&&(r.from=e.account.address),void 0!==e.from&&(r.from=e.from),void 0!==e.gas&&(r.gas=(0,n.cK)(e.gas)),void 0!==e.gasPrice&&(r.gasPrice=(0,n.cK)(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(r.maxFeePerBlobGas=(0,n.cK)(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(r.maxFeePerGas=(0,n.cK)(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=(0,n.cK)(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(r.nonce=(0,n.cK)(e.nonce)),void 0!==e.to&&(r.to=e.to),void 0!==e.type&&(r.type=s[e.type]),void 0!==e.value&&(r.value=(0,n.cK)(e.value)),r}let o=(0,i.q)("transactionRequest",a)},95847:(e,t,r)=>{var n=r(98539).hp;let{keccak_256:i}=r(60975);function s(e){return n.allocUnsafe(e).fill(0)}function a(e,t){let r=e.toString(16);r.length%2!=0&&(r="0"+r);let i=r.match(/.{1,2}/g).map(e=>parseInt(e,16));for(;i.length<t;)i.unshift(0);return n.from(i)}function o(e,t,r){let n=s(t);return(e=l(e),r)?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function l(e){if(!n.isBuffer(e))if(Array.isArray(e))e=n.from(e);else if("string"==typeof e){var t;e=c(e)?n.from((t=u(e)).length%2?"0"+t:t,"hex"):n.from(e)}else if("number"==typeof e)e=intToBuffer(e);else if(null==e)e=n.allocUnsafe(0);else if("bigint"==typeof e)e=a(e);else if(e.toArray)e=n.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 u(e){return"string"==typeof e&&e.startsWith("0x")?e.slice(2):e}e.exports={zeros:s,setLength:o,setLengthRight:function(e,t){return o(e,t,!0)},isHexString:c,stripHexPrefix:u,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 n.from(i(new Uint8Array(e)))},bitLengthFromBigInt:function(e){return e.toString(2).length},bufferBEFromBigInt:a,twosFromBigInt:function(e,t){return(e<0n?(~e&(1n<<BigInt(t))-1n)+1n:e)&(1n<<BigInt(t))-1n}}},95912:(e,t,r)=>{"use strict";function n(e){if("string"!=typeof e)throw Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3'),(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t)}catch(t){return e}}function i(e){return"string"==typeof e?e:JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t)||""}r.d(t,{h:()=>i,j:()=>n})},95962:(e,t,r)=>{"use strict";r.d(t,{Ao:()=>i,Au:()=>n});let n=2n**16n-1n,i=2n**256n-1n}
319,96313:(e,t,r)=>{"use strict";r.d(t,{a:()=>s});var n=r(75834),i=r(53160);function s(){let e=(0,n.useRef)(!1);return(0,i.s)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}},96384:(e,t,r)=>{"use strict";r.d(t,{O:()=>i});var n=r(2204);let i=(0,r(83121).x)({...n.o,id:4217,blockExplorers:{default:{name:"Tempo Explorer",url:"https://explore.tempo.xyz"}},name:"Tempo Mainnet",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.tempo.xyz"],webSocket:["wss://rpc.tempo.xyz"]}}})},96793:(e,t,r)=>{"use strict";r.d(t,{b:()=>s});var n=r(70044),i=r(92202);function s(e,{delay:t=100,retryCount:r=2,shouldRetry:a=()=>!0,signal:o}={}){return new Promise((s,l)=>{let c=async({count:u=0}={})=>{if(o?.aborted)return void l((0,n.TY)(o));let d=async({error:e})=>{let r="function"==typeof t?t({count:u,error:e}):t;if(r)try{await (0,i.u)(r,{signal:o})}catch(e){l(e);return}c({count:u+1})};try{let t=await e();s(t)}catch(e){if(o?.aborted)return void l((0,n.TY)(o));if((0,n.zf)(e))return void l(e);if(u<r&&await a({count:u,error:e}))return d({error:e});l(e)}};c()})}},97010:(e,t,r)=>{"use strict";r.d(t,{D:()=>d,Q:()=>l});var n=r(72004),i=r(59681),s=r(6194),a=Object.defineProperty,o=(e,t,r)=>(((e,t,r)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),r),l=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(l||{});let c={0(e,t){let r=t.id,n=e.stack,i=e.stack.indexOf(r);if(-1!==i){let t=e.stack.slice();return t.splice(i,1),t.push(r),n=t,{...e,stack:n}}return{...e,stack:[...e.stack,r]}},1(e,t){let r=t.id,n=e.stack.indexOf(r);if(-1===n)return e;let i=e.stack.slice();return i.splice(n,1),{...e,stack:i}}};class u extends n.u5{constructor(){super(...arguments),o(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),o(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new u({stack:[]})}reduce(e,t){return(0,s.Y)(t.type,c,e,t)}}let d=new i.G(()=>u.new())},97140:(e,t,r)=>{"use strict";r.d(t,{Hx:()=>f,RL:()=>d,b_:()=>c});var n=r(73181),i=r(31911),s=r(5635),a=Object.freeze({name:"Ed25519"});async function o(e,t=!1){let r=e.byteLength;if(32!==r)throw new i.tsw(i.Dgp,{actualLength:r});let n=new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32,...e]);return await crypto.subtle.importKey("pkcs8",n,a,t,["sign"])}async function l(e,t=!1){if((0,n.sw)(),!1===e.extractable)throw new i.tsw(i.rXw,{key:e});let r=await crypto.subtle.exportKey("jwk",e);return await crypto.subtle.importKey("jwk",{crv:"Ed25519",ext:t,key_ops:["verify"],kty:"OKP",x:r.x},"Ed25519",t,["verify"])}async function c(e,t){return(0,n.f_)(),new Uint8Array(await crypto.subtle.sign(a,e,(0,s.XA)(t)))}async function u(e,t,r){return(0,n.Zg)(),await crypto.subtle.verify(a,e,(0,s.XA)(t),(0,s.XA)(r))}async function d(e,t=!1){if((0,n.XF)(),64!==e.byteLength)throw new i.tsw(i.Y5q,{byteLength:e.byteLength});let[r,s]=await Promise.all([crypto.subtle.importKey("raw",e.slice(32),a,!0,["verify"]),o(e.slice(0,32),t)]),l=new Uint8Array(32);crypto.getRandomValues(l);let f=await c(s,l);if(!await u(r,f,l))throw new i.tsw(i.VO0);return{privateKey:s,publicKey:r}}async function f(e,t=!1){let r=o(e,t),[n,i]=await Promise.all([(t?r:o(e,!0)).then(async e=>await l(e,!0)),r]);return{privateKey:i,publicKey:n}}},97282:(e,t,r)=>{"use strict";r.d(t,{EH:()=>s,YE:()=>o,jF:()=>a,qD:()=>l,rj:()=>i});var n=r(15520);class i extends n.C{constructor({blockNumber:e,chain:t,contract:r}){super(`Chain "${t.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class s extends n.C{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID:  ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}}class a extends n.C{constructor(){super("No chain was provided to the request.\nPlease provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient.",{name:"ChainNotFoundError"})}}class o extends n.C{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class l extends n.C{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}
319" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}},97314:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(e,t,r)=>JSON.stringify(e,(e,r)=>{let n="bigint"==typeof r?r.toString():r;return"function"==typeof t?t(e,n):n},r)},97352:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}r.d(t,{J:()=>n})},97442:(e,t,r)=>{"use strict";function n(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}r.d(t,{D:()=>v});var i=r(7727),s=r(19390),a=r(68860),o=r(4891);class l{constructor(e=16,t=16){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let e=0;e<this.maxKeyLength;e++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,r){let n=this.caches[r-1];t:for(let i of n){let n=i.bytes;for(let i=0;i<r;i++)if(n[i]!==e[t+i])continue t;return i.str}return null}store(e,t){let r=this.caches[e.length-1],n={bytes:e,str:t};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=n:r.push(n)}decode(e,t,r){let n=this.find(e,t,r);if(null!=n)return this.hit++,n;this.miss++;let i=(0,a.Zf)(e,t,r),s=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(s,i),i}}var c=r(87595);let u="array",d="map_key",f="map_value",h=e=>{if("string"==typeof e||"number"==typeof e)return e;throw new c.X("The type of key must be string or number but "+typeof e)};class p{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let t=this.getUninitializedStateFromPool();t.type=u,t.position=0,t.size=e,t.array=Array(e)}pushMapState(e){let t=this.getUninitializedStateFromPool();t.type=d,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){return this.stackHeadPosition++,this.stackHeadPosition===this.stack.length&&this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null}),this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw Error("Invalid stack state. Released state is not on top of the stack.");e.type===u&&(e.size=0,e.array=void 0,e.position=0,e.type=void 0),(e.type===d||e.type===f)&&(e.size=0,e.map=void 0,e.readCount=0,e.type=void 0),this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}let y=new DataView(new ArrayBuffer(0)),m=new Uint8Array(y.buffer);try{y.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}let g=RangeError("Insufficient data"),b=new l;class w{constructor(e){this.totalPos=0,this.pos=0,this.view=y,this.bytes=m,this.headByte=-1,this.stack=new p,this.entered=!1,this.extensionCodec=e?.extensionCodec??i.g.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??s.f7,this.maxBinLength=e?.maxBinLength??s.f7,this.maxArrayLength=e?.maxArrayLength??s.f7,this.maxMapLength=e?.maxMapLength??s.f7,this.maxExtLength=e?.maxExtLength??s.f7,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:b,this.mapKeyConverter=e?.mapKeyConverter??h}clone(){return new w({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(e){let t=(0,o.C)(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(-1!==this.headByte||this.hasRemaining(1)){let t=this.bytes.subarray(this.pos),r=(0,o.C)(e),n=new Uint8Array(t.length+r.length);n.set(t),n.set(r,t.length),this.setBuffer(n)}else this.setBuffer(e)}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:t,pos:r}=this;return RangeError(`Extra ${t.byteLength-r} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){let t=this.clone();yield*t.decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{let t;this.entered=!0;let r=!1;for await(let n of e){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(n);try{t=this.doDecodeSync(),r=!0}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return t}let{headByte:i,pos:s,totalPos:a}=this;throw RangeError(`Insufficient data in parsing ${n(i)} at ${a} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async *decodeMultiAsync(e,t){if(this.entered){let r=this.clone();yield*r.decodeMultiAsync(e,t);return}try{this.entered=!0;let r=t,n=-1;for await(let i of e){if(t&&0===n)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i),r&&(n=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),0!=--n;);}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){r:for(;;){let e,t=this.readHeadByte();if(t>=224)e=t-256;else if(t<192)if(t<128)e=t;else if(t<144){let r=t-128;if(0!==r){this.pushMapState(r),this.complete();continue}e={}}else if(t<160){let r=t-144;if(0!==r){this.pushArrayState(r),this.complete();continue}e=[]}else{let r=t-160;e=this.decodeString(r,0)}else if(192===t)e=null;else if(194===t)e=!1;else if(195===t)e=!0;else if(202===t)e=this.readF32();else if(203===t)e=this.readF64();else if(204===t)e=this.readU8();else if(205===t)e=this.readU16();else if(206===t)e=this.readU32();else if(207===t)e=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===t)e=this.readI8();else if(209===t)e=this.readI16();else if(210===t)e=this.readI32();else if(211===t)e=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===t){let t=this.lookU8();e=this.decodeString(t,1)}else if(218===t){let t=this.lookU16();e=this.decodeString(t,2)}else if(219===t){let t=this.lookU32();e=this.decodeString(t,4)}else if(220===t){let t=this.readU16();if(0!==t){this.pushArrayState(t),this.complete();continue}e=[]}else if(221===t){let t=this.readU32();if(0!==t){this.pushArrayState(t),this.complete();continue}e=[]}else if(222===t){let t=this.readU16();if(0!==t){this.pushMapState(t),this.complete();continue}e={}}else if(223===t){let t=this.readU32();if(0!==t){this.pushMapState(t),this.complete();continue}e={}}else if(196===t){let t=this.lookU8();e=this.decodeBinary(t,1)}else if(197===t){let t=this.lookU16();e=this.decodeBinary(t,2)}else if(198===t){let t=this.lookU32();e=this.decodeBinary(t,4)}else if(212===t)e=this.decodeExtension(1,0);else if(213===t)e=this.decodeExtension(2,0);else if(214===t)e=this.decodeExtension(4,0);else if(215===t)e=this.decodeExtension(8,0);else if(216===t)e=this.decodeExtension(16,0);else if(199===t){let t=this.lookU8();e=this.decodeExtension(t,1)}else if(200===t){let t=this.lookU16();e=this.decodeExtension(t,2)}else if(201===t){let t=this.lookU32();e=this.decodeExtension(t,4)}else throw new c.X(`Unrecognized type byte: ${n(t)}`);this.complete();let r=this.stack;for(;r.length>0;){let t=r.top();if(t.type===u)if(t.array[t.position]=e,t.position++,t.position===t.size)e=t.array,r.release(t);else continue r;else if(t.type===d){if("__proto__"===e)throw new c.X("The key __proto__ is not allowed");t.key=this.mapKeyConverter(e),t.type=f;
319continue r}else if(t.map[t.key]=e,t.readCount++,t.readCount===t.size)e=t.map,r.release(t);else{t.key=null,t.type=d;continue r}}return e}}readHeadByte(){return -1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new c.X(`Unrecognized array type byte: ${n(e)}`)}}pushMapState(e){if(e>this.maxMapLength)throw new c.X(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new c.X(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){let r;if(e>this.maxStrLength)throw new c.X(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw g;let n=this.pos+t;return r=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?this.keyDecoder.decode(this.bytes,n,e):(0,a._u)(this.bytes,n,e),this.pos+=t+e,r}stateIsMapKey(){return this.stack.length>0&&this.stack.top().type===d}decodeBinary(e,t){if(e>this.maxBinLength)throw new c.X(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw g;let r=this.pos+t,n=this.bytes.subarray(r,r+e);return this.pos+=t+e,n}decodeExtension(e,t){if(e>this.maxExtLength)throw new c.X(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let r=this.view.getInt8(this.pos+t),n=this.decodeBinary(e,t+1);return this.extensionCodec.decode(n,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=(0,s.Hn)(this.view,this.pos);return this.pos+=8,e}readI64(){let e=(0,s.eN)(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}}function v(e,t){return new w(t).decode(e)}},97687:(e,t,r)=>{"use strict";r.d(t,{zX:()=>g,bG:()=>b,M:()=>w,rR:()=>v,Po:()=>x,$S:()=>_});var n=r(63710),i=r(49786),s=r(16965),a=r(22760),o=r(40508);function l({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map((e,r)=>`${n&&e.name?`${e.name}: `:""}${"object"==typeof t[r]?(0,o.A)(t[r]):t[r]}`).join(", ")})`}var c=r(99453),u=r(10187),d=r(65385),f=r(74263),h=r(99838),p=r(62516),y=r(68145),m=r(70044);class g extends h.C{constructor(e,{account:t,docsPath:r,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:f,to:h,value:m,stateOverride:g}){let b=t?(0,n.J)(t):void 0,w=(0,y.aO)({from:b?.address,to:h,value:void 0!==m&&`${(0,u.c)(m)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:a,gasPrice:void 0!==o&&`${(0,d.Q)(o)} gwei`,maxFeePerGas:void 0!==l&&`${(0,d.Q)(l)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${(0,d.Q)(c)} gwei`,nonce:f});g&&(w+=`
320${(0,p.uj)(g)}`),super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class b extends h.C{constructor(e,{abi:t,args:r,contractAddress:n,docsPath:i,functionName:s,sender:o}){let u=(0,c.iY)({abi:t,args:r,name:s}),d=u?l({abiItem:u,args:r,includeFunctionName:!1,includeName:!1}):void 0,f=u?(0,a.B)(u,{includeName:!0}):void 0,h=(0,y.aO)({address:n&&(0,m.RZ)(n),function:f,args:d&&"()"!==d&&`${[...Array(s?.length??0).keys()].map(()=>" ").join("")}${d}`,sender:o});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],h&&"Contract Call:",h].filter(
vendor: 3,757 bytes, line 320
320Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=t,this.args=r,this.cause=e,this.contractAddress=n,this.functionName=s,this.sender=o}}class w extends h.C{constructor({abi:e,data:t,functionName:r,message:n,cause:o}){let c,u,d,h,p;if(t&&"0x"!==t)try{let{abiItem:r,errorName:n,args:c}=u=(0,s.W)({abi:e,data:t,cause:o});if("Error"===n)h=c[0];else if("Panic"===n){let[e]=c;h=i.fD[e]}else{let e=r?(0,a.B)(r,{includeName:!0}):void 0,t=r&&c?l({abiItem:r,args:c,includeFunctionName:!1,includeName:!1}):void 0;d=[e?`Error: ${e}`:"",t&&"()"!==t?`       ${[...Array(n?.length??0).keys()].map(()=>" ").join("")}${t}`:""]}}catch(e){c=e}else n&&(h=n);c instanceof f.Wq&&(p=c.signature,d=[`Unable to decode signature "${p}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${p}.`]),super(h&&"execution reverted"!==h||p?[`The contract function "${r}" reverted with the following ${p?"signature":"reason"}:`,h||p].join("\n"):`The contract function "${r}" reverted.`,{cause:c??o,metaMessages:d,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=u,this.raw=t,this.reason=h,this.signature=p}}class v extends h.C{constructor({functionName:e,cause:t}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${e}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:t})}}class x extends h.C{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class _ extends h.C{constructor({data:e,message:t}){super(t||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}},97994:(e,t,r)=>{"use strict";r.d(t,{q:()=>c});var n=r(36174),i=r(12089),s=r(42375),a=r(82804),o=r(97314),l=r(23458);function c(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:c,onError:u,poll:d,pollingInterval:f=e.pollingInterval}){let h;return(void 0!==d?d:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
320onfig.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{let n=(0,o.A)(["watchBlockNumber",e.uid,t,r,f]);return(0,s.lB)(n,{onBlockNumber:c,onError:u},n=>(0,a.w)(async()=>{try{let t=await (0,i.T)(e,l.G,"getBlockNumber")({cacheTime:0});if(void 0!==h){if(t===h)return;if(t-h>1&&r)for(let e=h+1n;e<t;e++)n.onBlockNumber(e,h),h=e}(void 0===h||t>h)&&(n.onBlockNumber(t,h),h=t)}catch(e){n.onError?.(e)}},{emitOnBegin:t,interval:f}))})():(()=>{let i=(0,o.A)(["watchBlockNumber",e.uid,t,r]);return(0,s.lB)(i,{onBlockNumber:c,onError:u},t=>{let r=!0,i=()=>r=!1;return(async()=>{try{let s=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:a}=await s.subscribe({params:["newHeads"],onData(e){if(!r)return;let i=(0,n.uU)(e.result?.number);t.onBlockNumber(i,h),h=i},onError(e){t.onError?.(e)}});i=a,r||i()}catch(e){u?.(e)}})(),()=>i()})})()}},98539:(e,t,r)=>{"use strict";let n=r(40896),i=r(46461),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);let r=0|p(n,i),s=a(r),l=s.write(n,i);return l!==r&&(s=s.slice(0,l)),s}if(ArrayBuffer.isView(e)){var s=e;if(M(s,Uint8Array)){let e=new Uint8Array(s);return f(e.buffer,e.byteOffset,e.byteLength)}return d(s)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(M(e,ArrayBuffer)||e&&M(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(M(e,SharedArrayBuffer)||e&&M(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let l=e.valueOf&&e.valueOf();if(null!=l&&l!==e)return o.from(l,t,r);let c=function(e){if(o.isBuffer(e)){let t=0|h(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(c)return c;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),a(e<0?0:0|h(e))}function d(e){let t=e.length<0?0:0|h(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}function h(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||M(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(e).length;default:if(i)return n?-1:R(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=U[e[n]];return i}(this,t,r);case"utf8":case"utf-8":return w(this,t,r);case"ascii":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":var s,a,o;return s=this,a=t,o=r,0===a&&o===s.length?n.fromByteArray(s):n.fromByteArray(s.slice(a,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;
vendor: 17,040 bytes, line 320
320e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}(this,t,r);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function m(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){var s;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(s=r*=1)!=s&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let s,a=1,o=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,o/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(s=r;s<o;s++)if(c(e,s)===c(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===l)return n*a}else -1!==n&&(s-=s-n),n=-1}else for(r+l>o&&(r=o-l),s=r;s>=0;s--){let r=!0;for(let n=0;n<l;n++)if(c(e,s+n)!==c(t,n)){r=!1;break}if(r)return s}return -1}function w(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],s=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,o,l;switch(a){case 1:t<128&&(s=t);break;case 2:(192&(r=e[i+1]))==128&&(l=(31&t)<<6|63&r)>127&&(s=l);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(l=(15&t)<<12|(63&r)<<6|63&n)>2047&&(l<55296||l>57343)&&(s=l);break;case 4:r=e[i+1],n=e[i+2],o=e[i+3],(192&r)==128&&(192&n)==128&&(192&o)==128&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&o)>65535&&l<1114112&&(s=l)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=a}var s=n;let a=s.length;if(a<=4096)return String.fromCharCode.apply(String,s);let o="",l=0;for(;l<a;)o+=String.fromCharCode.apply(String,s.slice(l,l+=4096));return o}function v(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function _(e,t,r,n,i){k(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let a=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function E(e,t,r,n,i){k(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let a=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function A(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function I(e,t,r,n,s){return t*=1,r>>>=0,s||A(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function C(e,t,r,n,s){return t*=1,r>>>=0,s||A(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.hp=o,t.IS=50,o.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(c(e),e<=0)?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)},o.allocUnsafe=function(e){return u(e)},o.allocUnsafeSlow=function(e){return u(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(M(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),M(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(M(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(o.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?w(this,0,e):y.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let e="",r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(o.prototype[s]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(M(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let s=i-n,a=r-t,l=Math.min(s,a),c=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<l;++e)if(c[e]!==u[e]){s=c[e],a=u[e];break}return s<a?-1:+(a<s)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){var i,s,a,o,l,c,u,d;if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let h=!1;for(;;)switch(n){case"hex":return function(e,t,r,n){let i;r=Number(r)||0;let s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;let a=t.length;for(n>a/2&&(n=a/2),i=0;i<n;++i){var o;let n=parseInt(t.substr(2*i,2),16);if((o=n)!=o)break;e[r+i]=n}return i}(this,e,t,r);case"utf8":case"utf-8":return i=t,s=r,D(R(e,this.length-i),this,i,s);case"ascii":case"latin1":case"binary":return a=t,o=r,D(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,a,o);case"base64":return l=t,c=r,D(B(e),this,l,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,d=r,D(function(e,t){let r,n,i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}(e,this.length-u),this,u,d);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=j(function(e){T(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&O(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))}),o.prototype.readBigUInt64BE=j(function(e){T(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&O(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],i=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=j(function(e){T(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&O(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])}),o.prototype.readBigInt64BE=j(function(e){T(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&O(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)}),o.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;x(this,e,t,r,n,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;x(this,e,t,r,n,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=j(function(e,t=0){return _(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=j(function(e,t=0){return E(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=0,s=1,a=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s|0)-a&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=r-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s|0)-a&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=j(function(e,t=0){return _(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=j(function(e,t=0){return E(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeFloatLE=function(e,t,r){return I(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return I(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return C(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return C(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){let i;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;
320if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};let S={};function P(e,t,r){S[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function $(e){let t="",r=e.length,n=+("-"===e[0]);for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function k(e,t,r,n,i,s){if(e>r||e<t){let n,i="bigint"==typeof t?"n":"";throw n=s>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(s+1)*8}${i}`:`>= -(2${i} ** ${(s+1)*8-1}${i}) and < 2 ** ${(s+1)*8-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new S.ERR_OUT_OF_RANGE("value",n,e)}T(i,"offset"),(void 0===n[i]||void 0===n[i+s])&&O(i,n.length-(s+1))}function T(e,t){if("number"!=typeof e)throw new S.ERR_INVALID_ARG_TYPE(t,"number",e)}function O(e,t,r){if(Math.floor(e)!==e)throw T(e,r),new S.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new S.ERR_BUFFER_OUT_OF_BOUNDS;throw new S.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}P("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),P("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),P("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${t}. Received ${i}`},RangeError);let N=/[^+/0-9A-Za-z-_]/g;function R(e,t){let r;t=t||1/0;let n=e.length,i=null,s=[];for(let a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319||a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function B(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function M(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let U=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function j(e){return"undefined"==typeof BigInt?L:e}function L(){throw Error("BigInt not supported")}},98855:(e,t,r)=>{"use strict";r.d(t,{i:()=>o});var n=r(86786),i=r(852);class s extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null==(t=Error.captureStackTrace)||t.call(Error,this,this.constructor)}}class a extends s{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function o(e){let t,r;if("string"!=typeof e)throw new a("JWTs must use Compact JWS serialization, JWT must be a string");let{1:s,length:o}=e.split(".");if(5===o)throw new a("Only JWTs using Compact JWS serialization can be decoded");if(3!==o)throw new a("Invalid JWT");if(!s)throw new a("JWTs must contain a payload");try{t=(0,n.D)(s)}catch(e){throw new a("Failed to base64url decode the payload")}try{r=JSON.parse(i.D0.decode(t))}catch(e){throw new a("Failed to parse the decoded payload as JSON")}if(!function(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(r))throw new a("Invalid JWT Claims Set");return r}Symbol.asyncIterator},98877:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(10077).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}]])},98966:(e,t,r)=>{"use strict";function n(...e){return Array.from(new Set(e.flatMap(e=>
320"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}r.d(t,{x:()=>n})},99225:(e,t,r)=>{"use strict";r.d(t,{vA:()=>u,cM:()=>d,HT:()=>f,bI:()=>h,n4:()=>p,tf:()=>y});var n=r(21332);class i extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}let s={checksum:new i(8192)}.checksum;var a=r(64959),o=r(38417),l=r(31155);let c=/^0x[a-fA-F0-9]{40}$/;function u(e,t={}){let{strict:r=!0}=t;if(!c.test(e))throw new m({address:e,cause:new g});if(r){if(e.toLowerCase()===e)return;if(d(e)!==e)throw new m({address:e,cause:new b})}}function d(e){if(s.has(e))return s.get(e);u(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=o.So(n.sH(t),{as:"Bytes"}),i=t.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&r[e>>1])>
vendor: 4,266 bytes, line 320
320=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());let a=`0x${i.join("")}`;return s.set(e,a),a}function f(e,t={}){let{checksum:r=!1}=t;return(u(e),r)?d(e):e}function h(e,t={}){let r=o.So(`0x${l.nj(e).slice(4)}`).substring(26);return f(`0x${r}`,t)}function p(e,t){return u(e,{strict:!1}),u(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}function y(e,t={}){let{strict:r=!0}=t??{};try{return u(e,{strict:r}),!0}catch{return!1}}class m extends a.C{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class g extends a.C{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class b extends a.C{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}},99453:(e,t,r)=>{"use strict";r.d(t,{iY:()=>l});var n=r(74263),i=r(92733),s=r(27526),a=r(73142),o=r(5360);function l(e){let t,{abi:r,args:l=[],name:c}=e,u=(0,i.q)(c,{strict:!1}),d=r.filter(e=>u?"function"===e.type?(0,o.V)(e)===c:"event"===e.type&&(0,a.h)(e)===c:"name"in e&&e.name===c);if(0!==d.length){if(1===d.length)return d[0];for(let e of d){if("inputs"in e){if(!l||0===l.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(e.inputs&&0!==e.inputs.length&&e.inputs.length===l.length&&l.every((t,r)=>{let n="inputs"in e&&e.inputs[r];return!!n&&function e(t,r){let n=typeof t,i=r.type;switch(i){case"address":return(0,s.P)(t,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:if("tuple"===i&&"components"in r)return Object.values(r.components).every((r,i)=>"object"===n&&e(Object.values(t)[i],r));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i))return"number"===n||"bigint"===n;if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i))return"string"===n||t instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i))return Array.isArray(t)&&t.every(t=>e(t,{...r,type:i.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}(t,n)})){if(t&&"inputs"in t&&t.inputs){let r=function e(t,r,n){for(let i in t){let a=t[i],o=r[i];if("tuple"===a.type&&"tuple"===o.type&&"components"in a&&"components"in o)return e(a.components,o.components,n[i]);let l=[a.type,o.type];if(l.includes("address")&&l.includes("bytes20")||(l.includes("address")&&l.includes("string")||l.includes("address")&&l.includes("bytes"))&&(0,s.P)(n[i],{strict:!1}))return l}}(e.inputs,t.inputs,l);if(r)throw new n.nM({abiItem:e,type:r[0]},{abiItem:t,type:r[1]})}t=e}}}return t||d[0]}}},99640:(e,t,r)=>{"use strict";r.d(t,{X9:()=>a,s7:()=>i,x8:()=>s});var n=r(3832);class i extends n.C{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class s extends n.C{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class a extends n.C{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}},99808:(e,t,r)=>{"use strict";function n(e,t){let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1));let[i,s]=[(r=r.padStart(t,"0")).slice(0,r.length-t),r.slice(r.length-t)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}r.d(t,{J:()=>n})},99809:(e,t,r)=>{"use strict";r.d(t,{Q:()=>s});var n=r(48441);let i=/^tuple(?<array>(\[(\d*)\])*)$/;function s(e){let t="",r=e.length;for(let s=0;s<r;s++)t+=function e(t){let r=t.type;if(i.test(t.type)&&"components"in t){r="(";let s=t.components.length;for(let n=0;n<s;n++)r+=e(t.components[n]),n<s-1&&(r+=", ");let a=(0,n.Yv)(i,t.type);return r+=`)${a?.array||""}`,e({...t,type:r})}return("indexed"in t&&t.indexed&&(r=`${r}
320 indexed`),t.name)?`${r} ${t.name}`:r}(e[s]),s!==r-1&&(t+=", ");return t}},99838:(e,t,r)=>{"use strict";r.d(t,{C:()=>s});let n="2.55.0",i={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${n}`};class s extends Error{constructor(e,t={}){let r=t.cause instanceof s?t.cause.details:t.cause?.message?t.cause.message:t.details,a=t.cause instanceof s&&t.cause.docsPath||t.docsPath,o=i.getDocsUrl?.({...t,docsPath:a});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=a,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=n}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}},99842:(e,t,r)=>{"use strict";r.d(t,{Ez:()=>a,LX:()=>n,WN:()=>i,fT:()=>s});let n="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",i="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",s="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b
32060405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
320603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",a="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
320150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.