diff --git a/docs/reference/ethers/modules.md b/docs/reference/ethers/modules.md index 26c56c2c3b..709aac6d31 100644 --- a/docs/reference/ethers/modules.md +++ b/docs/reference/ethers/modules.md @@ -6,9 +6,8 @@ ### Type Aliases -- [BaseContractMethod](/reference/ethers/modules.md#basecontractmethod) -- [ContractMethodArgs](/reference/ethers/modules.md#contractmethodargs) -- [TypesafeEthersContract](/reference/ethers/modules.md#typesafeetherscontract) +- [TypesafeEthersContractConstructor](/reference/ethers/modules.md#typesafeetherscontractconstructor) +- [TypesafeEthersInterfaceConstructor](/reference/ethers/modules.md#typesafeethersinterfaceconstructor) ### Variables @@ -17,99 +16,83 @@ ## Type Aliases -### BaseContractMethod +### TypesafeEthersContractConstructor -Ƭ **BaseContractMethod**<`TArguments`, `TReturnType`, `TExtendedReturnType`\>: `Object` +Ƭ **TypesafeEthersContractConstructor**: (`target`: `string` \| `Addressable`, `abi`: `TAbi` \| { `fragments`: `TAbi` }, `runner?`: ``null`` \| `ContractRunner`, `_deployTx?`: ``null`` \| `TransactionResponse`) => `BaseContract` & { [TFunctionName in string]: BaseContractMethod<{ [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["inputs"][K], AbiParameterKind\> }[K] } & any[], { [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["outputs"][K], AbiParameterKind\> }[K] }[0], { [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["outputs"][K], AbiParameterKind\> }[K] }[0]\> } & { [TFunctionName in string]: BaseContractMethod<{ [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["inputs"][K], AbiParameterKind\> }[K] } & any[], { [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["outputs"][K], AbiParameterKind\> }[K] }[0], ContractTransactionResponse\> } & { `queryFilter`: (`event`: `TContractEventName`, `fromBlock?`: `BlockTag`, `toBlock?`: `BlockTag`) => `Promise`<`TContractEventName` extends `ExtractAbiEventNames`<`TAbi`\> ? `ExtractAbiEvent`<`TAbi`, `TContractEventName`\> : `EventLog` \| `Log`[]\> } & `Contract` -#### Type parameters +#### Type declaration -| Name | Type | -| :------ | :------ | -| `TArguments` | extends `ReadonlyArray`<`any`\> = `ReadonlyArray`<`any`\> | -| `TReturnType` | `any` | -| `TExtendedReturnType` | extends `TReturnType` \| `ContractTransactionResponse` = `ContractTransactionResponse` | +• **new TypesafeEthersContractConstructor**<`TAbi`\>(`target`, `abi`, `runner?`, `_deployTx?`): `BaseContract` & { [TFunctionName in string]: BaseContractMethod<{ [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["inputs"][K], AbiParameterKind\> }[K] } & any[], { [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["outputs"][K], AbiParameterKind\> }[K] }[0], { [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["outputs"][K], AbiParameterKind\> }[K] }[0]\> } & { [TFunctionName in string]: BaseContractMethod<{ [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["inputs"][K], AbiParameterKind\> }[K] } & any[], { [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["outputs"][K], AbiParameterKind\> }[K] }[0], ContractTransactionResponse\> } & { `queryFilter`: (`event`: `TContractEventName`, `fromBlock?`: `BlockTag`, `toBlock?`: `BlockTag`) => `Promise`<`TContractEventName` extends `ExtractAbiEventNames`<`TAbi`\> ? `ExtractAbiEvent`<`TAbi`, `TContractEventName`\> : `EventLog` \| `Log`[]\> } & `Contract` -#### Call signature +##### Type parameters -▸ (`...args`): `Promise`<`TReturnType` \| `TExtendedReturnType`\> +| Name | Type | +| :------ | :------ | +| `TAbi` | extends `Abi` | ##### Parameters | Name | Type | | :------ | :------ | -| `...args` | [`ContractMethodArgs`](/reference/ethers/modules.md#contractmethodargs)<`TArguments`\> | +| `target` | `string` \| `Addressable` | +| `abi` | `TAbi` \| { `fragments`: `TAbi` } | +| `runner?` | ``null`` \| `ContractRunner` | +| `_deployTx?` | ``null`` \| `TransactionResponse` | ##### Returns -`Promise`<`TReturnType` \| `TExtendedReturnType`\> - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `_contract` | `BaseContract` | -| `_key` | `string` | -| `estimateGas` | (...`args`: [`ContractMethodArgs`](/reference/ethers/modules.md#contractmethodargs)<`TArguments`\>) => `Promise`<`bigint`\> | -| `fragment` | `FunctionFragment` | -| `getFragment` | (...`args`: [`ContractMethodArgs`](/reference/ethers/modules.md#contractmethodargs)<`TArguments`\>) => `FunctionFragment` | -| `name` | `string` | -| `populateTransaction` | (...`args`: [`ContractMethodArgs`](/reference/ethers/modules.md#contractmethodargs)<`TArguments`\>) => `Promise`<`ContractTransaction`\> | -| `send` | (...`args`: [`ContractMethodArgs`](/reference/ethers/modules.md#contractmethodargs)<`TArguments`\>) => `Promise`<`ContractTransactionResponse`\> | -| `staticCall` | (...`args`: [`ContractMethodArgs`](/reference/ethers/modules.md#contractmethodargs)<`TArguments`\>) => `Promise`<`TReturnType`\> | -| `staticCallResult` | (...`args`: [`ContractMethodArgs`](/reference/ethers/modules.md#contractmethodargs)<`TArguments`\>) => `Promise`<`Result`\> | +`BaseContract` & { [TFunctionName in string]: BaseContractMethod<{ [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["inputs"][K], AbiParameterKind\> }[K] } & any[], { [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["outputs"][K], AbiParameterKind\> }[K] }[0], { [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["outputs"][K], AbiParameterKind\> }[K] }[0]\> } & { [TFunctionName in string]: BaseContractMethod<{ [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["inputs"][K], AbiParameterKind\> }[K] } & any[], { [K in string \| number \| symbol]: { [K in string \| number \| symbol]: AbiParameterToPrimitiveType, Object\>["outputs"][K], AbiParameterKind\> }[K] }[0], ContractTransactionResponse\> } & { `queryFilter`: (`event`: `TContractEventName`, `fromBlock?`: `BlockTag`, `toBlock?`: `BlockTag`) => `Promise`<`TContractEventName` extends `ExtractAbiEventNames`<`TAbi`\> ? `ExtractAbiEvent`<`TAbi`, `TContractEventName`\> : `EventLog` \| `Log`[]\> } & `Contract` #### Defined in -[BaseContractMethod.ts:10](https://github.com/evmts/evmts-monorepo/blob/main/ethers/src/BaseContractMethod.ts#L10) +[ethers/src/Contract.d.ts:21](https://github.com/evmts/evmts-monorepo/blob/main/ethers/src/Contract.d.ts#L21) ___ -### ContractMethodArgs +### TypesafeEthersInterfaceConstructor -Ƭ **ContractMethodArgs**<`A`\>: [...A, `Overrides`] \| `A` +Ƭ **TypesafeEthersInterfaceConstructor**: (`abi`: `InterfaceAbi`) => `Omit`<`Interface`, ``"fragments"``\> & { `fragments`: `TAbi` } -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `A` | extends `ReadonlyArray`<`any`\> | - -#### Defined in +#### Type declaration -[ContractMethodArgs.ts:3](https://github.com/evmts/evmts-monorepo/blob/main/ethers/src/ContractMethodArgs.ts#L3) +• **new TypesafeEthersInterfaceConstructor**<`TAbi`\>(`abi`): `Omit`<`Interface`, ``"fragments"``\> & { `fragments`: `TAbi` } -___ +##### Type parameters -### TypesafeEthersContract - -Ƭ **TypesafeEthersContract**<`TAbi`\>: `BaseContract` & { [TFunctionName in ExtractAbiFunctionNames]: BaseContractMethod["inputs"]\> & any[], AbiParametersToPrimitiveTypes["outputs"]\>[0], AbiParametersToPrimitiveTypes["outputs"]\>[0]\> } & { [TFunctionName in ExtractAbiFunctionNames]: BaseContractMethod["inputs"]\> & any[], AbiParametersToPrimitiveTypes["outputs"]\>[0], ContractTransactionResponse\> } & { `queryFilter`: (`event`: `TContractEventName`, `fromBlock?`: `BlockTag`, `toBlock?`: `BlockTag`) => `Promise`<`TContractEventName` extends `ExtractAbiEventNames`<`TAbi`\> ? `ExtractAbiEvent`<`TAbi`, `TContractEventName`\> : `EventLog` \| `Log`[]\> } +| Name | Type | +| :------ | :------ | +| `TAbi` | extends `Abi` | -#### Type parameters +##### Parameters | Name | Type | | :------ | :------ | -| `TAbi` | extends `Abi` | +| `abi` | `InterfaceAbi` | + +##### Returns + +`Omit`<`Interface`, ``"fragments"``\> & { `fragments`: `TAbi` } #### Defined in -[TypesafeEthersContract.ts:19](https://github.com/evmts/evmts-monorepo/blob/main/ethers/src/TypesafeEthersContract.ts#L19) +[ethers/src/Contract.d.ts:12](https://github.com/evmts/evmts-monorepo/blob/main/ethers/src/Contract.d.ts#L12) ## Variables ### Contract -• `Const` **Contract**: `TypesafeEthersContractConstructor` +• `Const` **Contract**: [`TypesafeEthersContractConstructor`](/reference/ethers/modules.md#typesafeetherscontractconstructor) #### Defined in -[Contract.ts:30](https://github.com/evmts/evmts-monorepo/blob/main/ethers/src/Contract.ts#L30) +[ethers/src/Contract.d.ts:30](https://github.com/evmts/evmts-monorepo/blob/main/ethers/src/Contract.d.ts#L30) ___ ### Interface -• `Const` **Interface**: `TypesafeEthersInterfaceConstructor` +• `Const` **Interface**: [`TypesafeEthersInterfaceConstructor`](/reference/ethers/modules.md#typesafeethersinterfaceconstructor) #### Defined in -[Contract.ts:19](https://github.com/evmts/evmts-monorepo/blob/main/ethers/src/Contract.ts#L19) +[ethers/src/Contract.d.ts:19](https://github.com/evmts/evmts-monorepo/blob/main/ethers/src/Contract.d.ts#L19) diff --git a/ethers/package.json b/ethers/package.json index 8626e80021..ee8fc466f8 100644 --- a/ethers/package.json +++ b/ethers/package.json @@ -24,7 +24,7 @@ ], "type": "module", "main": "dist/index.cjs", - "module": "dist/index.js", + "module": "src/index.js", "types": "types/index.d.ts", "files": [ "dist", diff --git a/ethers/src/Contract.ts b/ethers/src/Contract.d.ts similarity index 74% rename from ethers/src/Contract.ts rename to ethers/src/Contract.d.ts index 842d661b45..cfc631feb1 100644 --- a/ethers/src/Contract.ts +++ b/ethers/src/Contract.d.ts @@ -2,9 +2,9 @@ import type { TypesafeEthersContract } from './TypesafeEthersContract.js' import type { Abi } from 'abitype' import { type Addressable, - Contract as EthersContract, + type Contract as EthersContract, type ContractRunner, - Interface as EthersInterface, + type Interface as EthersInterface, type InterfaceAbi, type TransactionResponse, } from 'ethers' @@ -16,7 +16,7 @@ type TypesafeEthersInterfaceConstructor = { > & { fragments: TAbi } } -export const Interface = EthersInterface as TypesafeEthersInterfaceConstructor +export const Interface: TypesafeEthersInterfaceConstructor type TypesafeEthersContractConstructor = { new ( @@ -27,4 +27,4 @@ type TypesafeEthersContractConstructor = { ): TypesafeEthersContract & EthersContract } -export const Contract = EthersContract as TypesafeEthersContractConstructor +export const Contract: TypesafeEthersContractConstructor diff --git a/ethers/src/Contract.js b/ethers/src/Contract.js new file mode 100644 index 0000000000..088008179c --- /dev/null +++ b/ethers/src/Contract.js @@ -0,0 +1,20 @@ +import { + Contract as EthersContract, + Interface as EthersInterface, +} from 'ethers' + +/** + * Typesafe version of the ethers Interface class. + */ +export const Interface = + /** @type {import('./Contract.js').TypesafeEthersInterfaceConstructor} */ ( + EthersInterface + ) + +/** + * Typesafe version of the ethers Contract class. + */ +export const Contract = + /** @type {import('./Contract.js').TypesafeEthersContractConstructor} */ ( + EthersContract + ) diff --git a/ethers/src/index.ts b/ethers/src/index.d.ts similarity index 100% rename from ethers/src/index.ts rename to ethers/src/index.d.ts diff --git a/ethers/src/index.js b/ethers/src/index.js new file mode 100644 index 0000000000..99439b1096 --- /dev/null +++ b/ethers/src/index.js @@ -0,0 +1 @@ +export * from './Contract.js' diff --git a/ethers/tsconfig.json b/ethers/tsconfig.json index ae07c26e34..d4028f680c 100644 --- a/ethers/tsconfig.json +++ b/ethers/tsconfig.json @@ -4,10 +4,10 @@ "rootDir": "src", "composite": true, "outDir": "types", - "skipLibCheck": true, + "skipLibCheck": true }, "include": [ "src", "src/**/*.json" ] -} \ No newline at end of file +} diff --git a/ethers/tsup.config.ts b/ethers/tsup.config.ts index b7861596d6..a45bc2cfac 100644 --- a/ethers/tsup.config.ts +++ b/ethers/tsup.config.ts @@ -3,7 +3,7 @@ import { defineConfig } from 'tsup' export default defineConfig({ name: packageJson.name, - entry: ['src/index.ts'], + entry: ['src/index.js'], outDir: 'dist', format: ['esm', 'cjs'], splitting: false, diff --git a/ethers/typedoc.json b/ethers/typedoc.json index 21f16f20a1..992969cc2a 100644 --- a/ethers/typedoc.json +++ b/ethers/typedoc.json @@ -1,7 +1,7 @@ { "$schema": "https://typedoc.org/schema.json", "out": "../docs/reference/ethers", - "entryPoints": ["./src/index.ts"], + "entryPoints": ["./src/index.js"], "publicPath": "/reference/ethers/", "plugin": ["typedoc-plugin-markdown"], "gitRevision": "main" diff --git a/examples/vite/dist/assets/ccip-4cb4b6ef.js b/examples/vite/dist/assets/ccip-e9747f23.js similarity index 97% rename from examples/vite/dist/assets/ccip-4cb4b6ef.js rename to examples/vite/dist/assets/ccip-e9747f23.js index f091070b70..3a3c682d78 100644 --- a/examples/vite/dist/assets/ccip-4cb4b6ef.js +++ b/examples/vite/dist/assets/ccip-e9747f23.js @@ -1 +1 @@ -import{aU as f,aV as w,aW as y,aX as p,aY as h,aZ as g,a_ as k,a$ as O,b0 as L,b1 as m,b2 as E}from"./index-9fd9e1d6.js";import"@safe-globalThis/safe-apps-provider";import"@safe-globalThis/safe-apps-sdk";class x extends f{constructor({callbackSelector:e,cause:t,data:n,extraData:c,sender:d,urls:a}){var i;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(i=t.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",a&&[" Gateway URL(s):",...a.map(u=>` ${w(u)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends f{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(t)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class $ extends f{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function R(s,e){if(!p(s))throw new h({address:s});if(!p(e))throw new h({address:e});return s.toLowerCase()===e.toLowerCase()}const j="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function D(s,{blockNumber:e,blockTag:t,data:n,to:c}){const{args:d}=g({data:n,abi:[S]}),[a,i,u,r,o]=d;try{if(!R(c,a))throw new $({sender:a,to:c});const l=await A({data:u,sender:a,urls:i}),{data:b}=await k(s,{blockNumber:e,blockTag:t,data:O([r,L([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return b}catch(l){throw new x({callbackSelector:r,cause:l,data:n,extraData:o,sender:a,urls:i})}}async function A({data:s,sender:e,urls:t}){var c;let n=new Error("An unknown error occurred.");for(let d=0;d` ${w(u)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends f{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(t)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class $ extends f{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function R(s,e){if(!p(s))throw new h({address:s});if(!p(e))throw new h({address:e});return s.toLowerCase()===e.toLowerCase()}const j="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function D(s,{blockNumber:e,blockTag:t,data:n,to:c}){const{args:d}=g({data:n,abi:[S]}),[a,i,u,r,o]=d;try{if(!R(c,a))throw new $({sender:a,to:c});const l=await A({data:u,sender:a,urls:i}),{data:b}=await k(s,{blockNumber:e,blockTag:t,data:O([r,L([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return b}catch(l){throw new x({callbackSelector:r,cause:l,data:n,extraData:o,sender:a,urls:i})}}async function A({data:s,sender:e,urls:t}){var c;let n=new Error("An unknown error occurred.");for(let d=0;d0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")d(c,this,n);else for(var h=c.length,O=E(c,h),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,j(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=R.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():N(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?M(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;r0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")d(c,this,n);else for(var h=c.length,O=E(c,h),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,j(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=R.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():N(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?M(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;rJSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),de=t=>{const e=/([\[:])?(\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,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(i,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function ye(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return de(t)}catch{return t}}function F(t){return typeof t=="string"?t:he(t)||""}const pe="PARSE_ERROR",be="INVALID_REQUEST",me="METHOD_NOT_FOUND",ge="INVALID_PARAMS",k="INTERNAL_ERROR",U="SERVER_ERROR",ve=[-32700,-32600,-32601,-32602,-32603],P={[pe]:{code:-32700,message:"Parse error"},[be]:{code:-32600,message:"Invalid Request"},[me]:{code:-32601,message:"Method not found"},[ge]:{code:-32602,message:"Invalid params"},[k]:{code:-32603,message:"Internal error"},[U]:{code:-32e3,message:"Server error"}},W=U;function _e(t){return ve.includes(t)}function H(t){return Object.keys(P).includes(t)?P[t]:P[W]}function we(t){const e=Object.values(P).find(r=>r.code===t);return e||P[W]}function Ee(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Re={};/*! ***************************************************************************** +import{e as X}from"./events-699377c5.js";import{e as ue,k as le}from"./index-8dd5e2d3.js";const he=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),de=t=>{const e=/([\[:])?(\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,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(i,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function ye(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return de(t)}catch{return t}}function F(t){return typeof t=="string"?t:he(t)||""}const pe="PARSE_ERROR",be="INVALID_REQUEST",me="METHOD_NOT_FOUND",ge="INVALID_PARAMS",k="INTERNAL_ERROR",U="SERVER_ERROR",ve=[-32700,-32600,-32601,-32602,-32603],P={[pe]:{code:-32700,message:"Parse error"},[be]:{code:-32600,message:"Invalid Request"},[me]:{code:-32601,message:"Method not found"},[ge]:{code:-32602,message:"Invalid params"},[k]:{code:-32603,message:"Internal error"},[U]:{code:-32e3,message:"Server error"}},W=U;function _e(t){return ve.includes(t)}function H(t){return Object.keys(P).includes(t)?P[t]:P[W]}function we(t){const e=Object.values(P).find(r=>r.code===t);return e||P[W]}function Ee(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Re={};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any diff --git a/examples/vite/dist/assets/index-70641c6b.js b/examples/vite/dist/assets/index-02eff833.js similarity index 99% rename from examples/vite/dist/assets/index-70641c6b.js rename to examples/vite/dist/assets/index-02eff833.js index 7f7dbc9bf7..d8e12300f7 100644 --- a/examples/vite/dist/assets/index-70641c6b.js +++ b/examples/vite/dist/assets/index-02eff833.js @@ -1,4 +1,4 @@ -import{E as Dt}from"./events-db1d9fc4.js";import{b as Fr,s as $r,m as jr,c as ie,I as Hr,f as vt,J as Et,H as zr}from"./http-d435a746.js";import{k as Ve,aA as Wr,aB as Vr,aC as Jr,aD as Qr,aE as Kr,aF as Yr,aG as Gr,aH as Zr,aI as Xr,aJ as eo,aK as to,aL as no,aM as ro,aN as oo,aO as io,aP as so,aQ as ao,aR as co,e as Ft,aS as lo,aT as uo}from"./index-9fd9e1d6.js";import{b as j,l as N,y as O,k as W,C as B,B as ge,E as fo,F as ho,a as ye,c as Je,d as Qe,V as $t,s as jt,_ as Ht,A as zt,e as Wt,T as Vt,q as Jt,x as Qt,G as Kt,f as Yt,P as go}from"./hooks.module-fb90a505.js";import"@safe-globalThis/safe-apps-provider";import"@safe-globalThis/safe-apps-sdk";const Ne="Session currently connected",$="Session currently disconnected",_o="Session Rejected",po="Missing JSON RPC response",mo='JSON-RPC success response must include "result" field',wo='JSON-RPC error response must include "error" field',yo='JSON RPC request must have valid "method" value',bo='JSON RPC request must have valid "id" value',vo="Missing one of the required parameters: bridge / uri / session",Ct="JSON RPC response format is invalid",Eo="URI format is invalid",Co="QRCode Modal not provided",St="User close QRCode Modal",So=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],Io=["wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Ke=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign",...Io],Pe="WALLETCONNECT_DEEPLINK_CHOICE",Ro={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var Gt=Ye;Ye.strict=Zt;Ye.loose=Xt;var ko=Object.prototype.toString,To={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function Ye(t){return Zt(t)||Xt(t)}function Zt(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function Xt(t){return To[ko.call(t)]}const No=Ve(Gt);var xo=Gt.strict,Mo=function(e){if(xo(e)){var n=Buffer.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(n=n.slice(e.byteOffset,e.byteOffset+e.byteLength)),n}else return Buffer.from(e)};const Ao=Ve(Mo),Ge="hex",Ze="utf8",Oo="binary",Lo="buffer",Bo="array",Uo="typed-array",Po="array-buffer",be="0";function V(t){return new Uint8Array(t)}function Xe(t,e=!1){const n=t.toString(Ge);return e?se(n):n}function et(t){return t.toString(Ze)}function en(t){return t.readUIntBE(0,t.length)}function Z(t){return Ao(t)}function U(t,e=!1){return Xe(Z(t),e)}function tn(t){return et(Z(t))}function nn(t){return en(Z(t))}function tt(t){return Buffer.from(J(t),Ge)}function P(t){return V(tt(t))}function qo(t){return et(tt(t))}function Do(t){return nn(P(t))}function nt(t){return Buffer.from(t,Ze)}function rn(t){return V(nt(t))}function Fo(t,e=!1){return Xe(nt(t),e)}function $o(t){const e=parseInt(t,10);return ii(oi(e),"Number can only safely store up to 53 bits"),e}function jo(t){return Vo(rt(t))}function Ho(t){return ot(rt(t))}function zo(t,e){return Jo(rt(t),e)}function Wo(t){return`${t}`}function rt(t){const e=(t>>>0).toString(2);return st(e)}function Vo(t){return Z(ot(t))}function ot(t){return new Uint8Array(Xo(t).map(e=>parseInt(e,2)))}function Jo(t,e){return U(ot(t),e)}function Qo(t){return!(typeof t!="string"||!new RegExp(/^[01]+$/).test(t)||t.length%8!==0)}function on(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}function ve(t){return Buffer.isBuffer(t)}function it(t){return No.strict(t)&&!ve(t)}function sn(t){return!it(t)&&!ve(t)&&typeof t.byteLength<"u"}function Ko(t){return ve(t)?Lo:it(t)?Uo:sn(t)?Po:Array.isArray(t)?Bo:typeof t}function Yo(t){return Qo(t)?Oo:on(t)?Ge:Ze}function Go(...t){return Buffer.concat(t)}function an(...t){let e=[];return t.forEach(n=>e=e.concat(Array.from(n))),new Uint8Array([...e])}function Zo(t,e=8){const n=t%e;return n?(t-n)/e*e+e:t}function Xo(t,e=8){const n=st(t).match(new RegExp(`.{${e}}`,"gi"));return Array.from(n||[])}function st(t,e=8,n=be){return ei(t,Zo(t.length,e),n)}function ei(t,e,n=be){return si(t,e,!0,n)}function J(t){return t.replace(/^0x/,"")}function se(t){return t.startsWith("0x")?t:`0x${t}`}function ti(t){return t=J(t),t=st(t,2),t&&(t=se(t)),t}function ni(t){const e=t.startsWith("0x");return t=J(t),t=t.startsWith(be)?t.substring(1):t,e?se(t):t}function ri(t){return typeof t>"u"}function oi(t){return!ri(t)}function ii(t,e){if(!t)throw new Error(e)}function si(t,e,n,r=be){const o=e-t.length;let i=t;if(o>0){const s=r.repeat(o);i=n?s+t:t+s}return i}function _e(t){return Z(new Uint8Array(t))}function ai(t){return tn(new Uint8Array(t))}function cn(t,e){return U(new Uint8Array(t),!e)}function ci(t){return nn(new Uint8Array(t))}function li(...t){return P(t.map(e=>U(new Uint8Array(e))).join("")).buffer}function ln(t){return V(t).buffer}function ui(t){return et(t)}function di(t,e){return Xe(t,!e)}function fi(t){return en(t)}function hi(...t){return Go(...t)}function gi(t){return rn(t).buffer}function _i(t){return nt(t)}function pi(t,e){return Fo(t,!e)}function mi(t){return $o(t)}function wi(t){return tt(t)}function un(t){return P(t).buffer}function yi(t){return qo(t)}function bi(t){return Do(t)}function vi(t){return jo(t)}function Ei(t){return Ho(t).buffer}function Ci(t){return Wo(t)}function dn(t,e){return zo(Number(t),!e)}const Si=Qr,Ii=Kr,Ri=Yr,ki=Gr,Ti=Zr,fn=Jr,Ni=Xr,hn=Wr,xi=eo,Mi=to,Ai=no,Ee=Vr;function Ce(t){return ro(t)}function Se(){const t=Ce();return t&&t.os?t.os:void 0}function gn(){const t=Se();return t?t.toLowerCase().includes("android"):!1}function _n(){const t=Se();return t?t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function pn(){return Se()?gn()||_n():!1}function mn(){const t=Ce();return t&&t.name?t.name.toLowerCase()==="node":!1}function wn(){return!mn()&&!!fn()}const yn=Fr,bn=$r;function at(t,e){const n=bn(e),r=Ee();r&&r.setItem(t,n)}function ct(t){let e=null,n=null;const r=Ee();return r&&(n=r.getItem(t)),e=n&&yn(n),e}function lt(t){const e=Ee();e&&e.removeItem(t)}function qe(){return oo()}function Oi(t){return ti(t)}function Li(t){return se(t)}function Bi(t){return J(t)}function Ui(t){return ni(se(t))}const vn=jr;function he(){return((e,n)=>{for(n=e="";e++<36;n+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return n})()}function Pi(){console.warn("DEPRECATION WARNING: This WalletConnect client library will be deprecated in favor of @walletconnect/client. Please check docs.walletconnect.org to learn more about this migration!")}function En(t,e){let n;const r=Ro[t];return r&&(n=`https://${r}.infura.io/v3/${e}`),n}function Cn(t,e){let n;const r=En(t,e.infuraId);return e.custom&&e.custom[t]?n=e.custom[t]:r&&(n=r),n}function qi(t,e){const n=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${n}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${n}`:""}function Di(t){const e=t.href.split("?")[0];at(Pe,Object.assign(Object.assign({},t),{href:e}))}function Sn(t,e){return t.filter(n=>n.name.toLowerCase().includes(e.toLowerCase()))[0]}function Fi(t,e){let n=t;return e&&(n=e.map(r=>Sn(t,r)).filter(Boolean)),n}function $i(t,e){return async(...r)=>new Promise((o,i)=>{const s=(a,c)=>{(a===null||typeof a>"u")&&i(a),o(c)};t.apply(e,[...r,s])})}function In(t){const e=t.message||"Failed or Rejected Request";let n=-32e3;if(t&&!t.code)switch(e){case"Parse error":n=-32700;break;case"Invalid request":n=-32600;break;case"Method not found":n=-32601;break;case"Invalid params":n=-32602;break;case"Internal error":n=-32603;break;default:n=-32e3;break}const r={code:n,message:e};return t.data&&(r.data=t.data),r}const Rn="https://registry.walletconnect.com";function ji(){return Rn+"/api/v2/wallets"}function Hi(){return Rn+"/api/v2/dapps"}function kn(t,e="mobile"){var n;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:(n=t.image_url.sm)!==null&&n!==void 0?n:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function zi(t,e="mobile"){return Object.values(t).filter(n=>!!n[e].universal||!!n[e].native).map(n=>kn(n,e))}var ut={};(function(t){const e=ao,n=co,r=io,o=so,i=l=>l==null;function s(l){switch(l.arrayFormat){case"index":return d=>(f,u)=>{const g=f.length;return u===void 0||l.skipNull&&u===null||l.skipEmptyString&&u===""?f:u===null?[...f,[h(d,l),"[",g,"]"].join("")]:[...f,[h(d,l),"[",h(g,l),"]=",h(u,l)].join("")]};case"bracket":return d=>(f,u)=>u===void 0||l.skipNull&&u===null||l.skipEmptyString&&u===""?f:u===null?[...f,[h(d,l),"[]"].join("")]:[...f,[h(d,l),"[]=",h(u,l)].join("")];case"comma":case"separator":return d=>(f,u)=>u==null||u.length===0?f:f.length===0?[[h(d,l),"=",h(u,l)].join("")]:[[f,h(u,l)].join(l.arrayFormatSeparator)];default:return d=>(f,u)=>u===void 0||l.skipNull&&u===null||l.skipEmptyString&&u===""?f:u===null?[...f,h(d,l)]:[...f,[h(d,l),"=",h(u,l)].join("")]}}function a(l){let d;switch(l.arrayFormat){case"index":return(f,u,g)=>{if(d=/\[(\d*)\]$/.exec(f),f=f.replace(/\[\d*\]$/,""),!d){g[f]=u;return}g[f]===void 0&&(g[f]={}),g[f][d[1]]=u};case"bracket":return(f,u,g)=>{if(d=/(\[\])$/.exec(f),f=f.replace(/\[\]$/,""),!d){g[f]=u;return}if(g[f]===void 0){g[f]=[u];return}g[f]=[].concat(g[f],u)};case"comma":case"separator":return(f,u,g)=>{const y=typeof u=="string"&&u.includes(l.arrayFormatSeparator),m=typeof u=="string"&&!y&&_(u,l).includes(l.arrayFormatSeparator);u=m?_(u,l):u;const S=y||m?u.split(l.arrayFormatSeparator).map(R=>_(R,l)):u===null?u:_(u,l);g[f]=S};default:return(f,u,g)=>{if(g[f]===void 0){g[f]=u;return}g[f]=[].concat(g[f],u)}}}function c(l){if(typeof l!="string"||l.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(l,d){return d.encode?d.strict?e(l):encodeURIComponent(l):l}function _(l,d){return d.decode?n(l):l}function v(l){return Array.isArray(l)?l.sort():typeof l=="object"?v(Object.keys(l)).sort((d,f)=>Number(d)-Number(f)).map(d=>l[d]):l}function b(l){const d=l.indexOf("#");return d!==-1&&(l=l.slice(0,d)),l}function w(l){let d="";const f=l.indexOf("#");return f!==-1&&(d=l.slice(f)),d}function E(l){l=b(l);const d=l.indexOf("?");return d===-1?"":l.slice(d+1)}function C(l,d){return d.parseNumbers&&!Number.isNaN(Number(l))&&typeof l=="string"&&l.trim()!==""?l=Number(l):d.parseBooleans&&l!==null&&(l.toLowerCase()==="true"||l.toLowerCase()==="false")&&(l=l.toLowerCase()==="true"),l}function I(l,d){d=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},d),c(d.arrayFormatSeparator);const f=a(d),u=Object.create(null);if(typeof l!="string"||(l=l.trim().replace(/^[?#&]/,""),!l))return u;for(const g of l.split("&")){if(g==="")continue;let[y,m]=r(d.decode?g.replace(/\+/g," "):g,"=");m=m===void 0?null:["comma","separator"].includes(d.arrayFormat)?m:_(m,d),f(_(y,d),m,u)}for(const g of Object.keys(u)){const y=u[g];if(typeof y=="object"&&y!==null)for(const m of Object.keys(y))y[m]=C(y[m],d);else u[g]=C(y,d)}return d.sort===!1?u:(d.sort===!0?Object.keys(u).sort():Object.keys(u).sort(d.sort)).reduce((g,y)=>{const m=u[y];return m&&typeof m=="object"&&!Array.isArray(m)?g[y]=v(m):g[y]=m,g},Object.create(null))}t.extract=E,t.parse=I,t.stringify=(l,d)=>{if(!l)return"";d=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},d),c(d.arrayFormatSeparator);const f=m=>d.skipNull&&i(l[m])||d.skipEmptyString&&l[m]==="",u=s(d),g={};for(const m of Object.keys(l))f(m)||(g[m]=l[m]);const y=Object.keys(g);return d.sort!==!1&&y.sort(d.sort),y.map(m=>{const S=l[m];return S===void 0?"":S===null?h(m,d):Array.isArray(S)?S.reduce(u(m),[]).join("&"):h(m,d)+"="+h(S,d)}).filter(m=>m.length>0).join("&")},t.parseUrl=(l,d)=>{d=Object.assign({decode:!0},d);const[f,u]=r(l,"#");return Object.assign({url:f.split("?")[0]||"",query:I(E(l),d)},d&&d.parseFragmentIdentifier&&u?{fragmentIdentifier:_(u,d)}:{})},t.stringifyUrl=(l,d)=>{d=Object.assign({encode:!0,strict:!0},d);const f=b(l.url).split("?")[0]||"",u=t.extract(l.url),g=t.parse(u,{sort:!1}),y=Object.assign(g,l.query);let m=t.stringify(y,d);m&&(m=`?${m}`);let S=w(l.url);return l.fragmentIdentifier&&(S=`#${h(l.fragmentIdentifier,d)}`),`${f}${m}${S}`},t.pick=(l,d,f)=>{f=Object.assign({parseFragmentIdentifier:!0},f);const{url:u,query:g,fragmentIdentifier:y}=t.parseUrl(l,f);return t.stringifyUrl({url:u,query:o(g,d),fragmentIdentifier:y},f)},t.exclude=(l,d,f)=>{const u=Array.isArray(d)?g=>!d.includes(g):(g,y)=>!d(g,y);return t.pick(l,u,f)}})(ut);function Tn(t){const e=t.indexOf("?")!==-1?t.indexOf("?"):void 0;return typeof e<"u"?t.substr(e):""}function Nn(t,e){let n=dt(t);return n=Object.assign(Object.assign({},n),e),t=xn(n),t}function dt(t){return ut.parse(t)}function xn(t){return ut.stringify(t)}function Mn(t){return typeof t.bridge<"u"}function An(t){const e=t.indexOf(":"),n=t.indexOf("?")!==-1?t.indexOf("?"):void 0,r=t.substring(0,e),o=t.substring(e+1,n);function i(v){const b="@",w=v.split(b);return{handshakeTopic:w[0],version:parseInt(w[1],10)}}const s=i(o),a=typeof n<"u"?t.substr(n):"";function c(v){const b=dt(v);return{key:b.key||"",bridge:b.bridge||""}}const h=c(a);return Object.assign(Object.assign({protocol:r},s),h)}function Wi(t){return t===""||typeof t=="string"&&t.trim()===""}function Vi(t){return!(t&&t.length)}function Ji(t){return ve(t)}function Qi(t){return it(t)}function Ki(t){return sn(t)}function Yi(t){return Ko(t)}function Gi(t){return Yo(t)}function Zi(t,e){return on(t,e)}function Xi(t){return typeof t.params=="object"}function On(t){return typeof t.method<"u"}function H(t){return typeof t.result<"u"}function re(t){return typeof t.error<"u"}function De(t){return typeof t.event<"u"}function Ln(t){return So.includes(t)||t.startsWith("wc_")}function Bn(t){return t.method.startsWith("wc_")?!0:!Ke.includes(t.method)}const es=Object.freeze(Object.defineProperty({__proto__:null,addHexPrefix:Li,appendToQueryString:Nn,concatArrayBuffers:li,concatBuffers:hi,convertArrayBufferToBuffer:_e,convertArrayBufferToHex:cn,convertArrayBufferToNumber:ci,convertArrayBufferToUtf8:ai,convertBufferToArrayBuffer:ln,convertBufferToHex:di,convertBufferToNumber:fi,convertBufferToUtf8:ui,convertHexToArrayBuffer:un,convertHexToBuffer:wi,convertHexToNumber:bi,convertHexToUtf8:yi,convertNumberToArrayBuffer:Ei,convertNumberToBuffer:vi,convertNumberToHex:dn,convertNumberToUtf8:Ci,convertUtf8ToArrayBuffer:gi,convertUtf8ToBuffer:_i,convertUtf8ToHex:pi,convertUtf8ToNumber:mi,detectEnv:Ce,detectOS:Se,formatIOSMobile:qi,formatMobileRegistry:zi,formatMobileRegistryEntry:kn,formatQueryString:xn,formatRpcError:In,getClientMeta:qe,getCrypto:Mi,getCryptoOrThrow:xi,getDappRegistryUrl:Hi,getDocument:ki,getDocumentOrThrow:Ri,getEncoding:Gi,getFromWindow:Si,getFromWindowOrThrow:Ii,getInfuraRpcUrl:En,getLocal:ct,getLocalStorage:Ee,getLocalStorageOrThrow:Ai,getLocation:hn,getLocationOrThrow:Ni,getMobileLinkRegistry:Fi,getMobileRegistryEntry:Sn,getNavigator:fn,getNavigatorOrThrow:Ti,getQueryString:Tn,getRpcUrl:Cn,getType:Yi,getWalletRegistryUrl:ji,isAndroid:gn,isArrayBuffer:Ki,isBrowser:wn,isBuffer:Ji,isEmptyArray:Vi,isEmptyString:Wi,isHexString:Zi,isIOS:_n,isInternalEvent:De,isJsonRpcRequest:On,isJsonRpcResponseError:re,isJsonRpcResponseSuccess:H,isJsonRpcSubscription:Xi,isMobile:pn,isNode:mn,isReservedEvent:Ln,isSilentPayload:Bn,isTypedArray:Qi,isWalletConnectSession:Mn,logDeprecationWarning:Pi,parseQueryString:dt,parseWalletConnectUri:An,payloadId:vn,promisify:$i,removeHexLeadingZeros:Ui,removeHexPrefix:Bi,removeLocal:lt,safeJsonParse:yn,safeJsonStringify:bn,sanitizeHex:Oi,saveMobileLinkInfo:Di,setLocal:at,uuid:he},Symbol.toStringTag,{value:"Module"}));class ts{constructor(){this._eventEmitters=[],typeof window<"u"&&typeof window.addEventListener<"u"&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(e,n){this._eventEmitters.push({event:e,callback:n})}trigger(e){let n=[];e&&(n=this._eventEmitters.filter(r=>r.event===e)),n.forEach(r=>{r.callback()})}}const ns=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:require("ws");class rs{constructor(e){if(this.opts=e,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=e.protocol,this._version=e.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=e.subscriptions||[],this._netMonitor=e.netMonitor||new ts,!e.url||typeof e.url!="string")throw new Error("Missing or invalid WebSocket url");this._url=e.url,this._netMonitor.on("online",()=>this._socketCreate())}set readyState(e){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(e){}get connecting(){return this.readyState===0}set connected(e){}get connected(){return this.readyState===1}set closing(e){}get closing(){return this.readyState===2}set closed(e){}get closed(){return this.readyState===3}open(){this._socketCreate()}close(){this._socketClose()}send(e,n,r){if(!n||typeof n!="string")throw new Error("Missing or invalid topic field");this._socketSend({topic:n,type:"pub",payload:e,silent:!!r})}subscribe(e){this._socketSend({topic:e,type:"sub",payload:"",silent:!0})}on(e,n){this._events.push({event:e,callback:n})}_socketCreate(){if(this._nextSocket)return;const e=os(this._url,this._protocol,this._version);if(this._nextSocket=new ns(e),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=n=>this._socketReceive(n),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=n=>this._socketError(n),this._nextSocket.onclose=()=>{setTimeout(()=>{this._nextSocket=null,this._socketCreate()},1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(e){const n=JSON.stringify(e);this._socket&&this._socket.readyState===1?this._socket.send(n):(this._setToQueue(e),this._socketCreate())}async _socketReceive(e){let n;try{n=JSON.parse(e.data)}catch{return}if(this._socketSend({topic:n.topic,type:"ack",payload:"",silent:!0}),this._socket&&this._socket.readyState===1){const r=this._events.filter(o=>o.event==="message");r&&r.length&&r.forEach(o=>o.callback(n))}}_socketError(e){const n=this._events.filter(r=>r.event==="error");n&&n.length&&n.forEach(r=>r.callback(e))}_queueSubscriptions(){this._subscriptions.forEach(n=>this._queue.push({topic:n,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(e){this._queue.push(e)}_pushQueue(){this._queue.forEach(n=>this._socketSend(n)),this._queue=[]}}function os(t,e,n){var r,o;const s=(t.startsWith("https")?t.replace("https","wss"):t.startsWith("http")?t.replace("http","ws"):t).split("?"),a=wn()?{protocol:e,version:n,env:"browser",host:((r=hn())===null||r===void 0?void 0:r.host)||""}:{protocol:e,version:n,env:((o=Ce())===null||o===void 0?void 0:o.name)||""},c=Nn(Tn(s[1]||""),a);return s[0]+"?"+c}class is{constructor(){this._eventEmitters=[]}subscribe(e){this._eventEmitters.push(e)}unsubscribe(e){this._eventEmitters=this._eventEmitters.filter(n=>n.event!==e)}trigger(e){let n=[],r;On(e)?r=e.method:H(e)||re(e)?r=`response:${e.id}`:De(e)?r=e.event:r="",r&&(n=this._eventEmitters.filter(o=>o.event===r)),(!n||!n.length)&&!Ln(r)&&!De(r)&&(n=this._eventEmitters.filter(o=>o.event==="call_request")),n.forEach(o=>{if(re(e)){const i=new Error(e.error.message);o.callback(i,null)}else o.callback(null,e)})}}class ss{constructor(e="walletconnect"){this.storageId=e}getSession(){let e=null;const n=ct(this.storageId);return n&&Mn(n)&&(e=n),e}setSession(e){return at(this.storageId,e),e}removeSession(){lt(this.storageId)}}const as="walletconnect.org",cs="abcdefghijklmnopqrstuvwxyz0123456789",Un=cs.split("").map(t=>`https://${t}.bridge.walletconnect.org`);function ls(t){let e=t.indexOf("//")>-1?t.split("/")[2]:t.split("/")[0];return e=e.split(":")[0],e=e.split("?")[0],e}function us(t){return ls(t).split(".").slice(-2).join(".")}function ds(){return Math.floor(Math.random()*Un.length)}function fs(){return Un[ds()]}function hs(t){return us(t)===as}function gs(t){return hs(t)?fs():t}class _s{constructor(e){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new is,this._clientMeta=qe()||e.connectorOpts.clientMeta||null,this._cryptoLib=e.cryptoLib,this._sessionStorage=e.sessionStorage||new ss(e.connectorOpts.storageId),this._qrcodeModal=e.connectorOpts.qrcodeModal,this._qrcodeModalOptions=e.connectorOpts.qrcodeModalOptions,this._signingMethods=[...Ke,...e.connectorOpts.signingMethods||[]],!e.connectorOpts.bridge&&!e.connectorOpts.uri&&!e.connectorOpts.session)throw new Error(vo);e.connectorOpts.bridge&&(this.bridge=gs(e.connectorOpts.bridge)),e.connectorOpts.uri&&(this.uri=e.connectorOpts.uri);const n=e.connectorOpts.session||this._getStorageSession();n&&(this.session=n),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=e.transport||new rs({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),e.connectorOpts.uri&&this._subscribeToSessionRequest(),e.pushServerOpts&&this._registerPushServer(e.pushServerOpts)}set bridge(e){e&&(this._bridge=e)}get bridge(){return this._bridge}set key(e){if(!e)return;const n=un(e);this._key=n}get key(){return this._key?cn(this._key,!0):""}set clientId(e){e&&(this._clientId=e)}get clientId(){let e=this._clientId;return e||(e=this._clientId=he()),this._clientId}set peerId(e){e&&(this._peerId=e)}get peerId(){return this._peerId}set clientMeta(e){}get clientMeta(){let e=this._clientMeta;return e||(e=this._clientMeta=qe()),e}set peerMeta(e){this._peerMeta=e}get peerMeta(){return this._peerMeta}set handshakeTopic(e){e&&(this._handshakeTopic=e)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(e){e&&(this._handshakeId=e)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(e){if(!e)return;const{handshakeTopic:n,bridge:r,key:o}=this._parseUri(e);this.handshakeTopic=n,this.bridge=r,this.key=o}set chainId(e){this._chainId=e}get chainId(){return this._chainId}set networkId(e){this._networkId=e}get networkId(){return this._networkId}set accounts(e){this._accounts=e}get accounts(){return this._accounts}set rpcUrl(e){this._rpcUrl=e}get rpcUrl(){return this._rpcUrl}set connected(e){}get connected(){return this._connected}set pending(e){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(e){e&&(this._connected=e.connected,this.accounts=e.accounts,this.chainId=e.chainId,this.bridge=e.bridge,this.key=e.key,this.clientId=e.clientId,this.clientMeta=e.clientMeta,this.peerId=e.peerId,this.peerMeta=e.peerMeta,this.handshakeId=e.handshakeId,this.handshakeTopic=e.handshakeTopic)}on(e,n){const r={event:e,callback:n};this._eventManager.subscribe(r)}off(e){this._eventManager.unsubscribe(e)}async createInstantRequest(e){this._key=await this._generateKey();const n=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(e)}]});this.handshakeId=n.id,this.handshakeTopic=he(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",()=>{throw new Error(St)});const r=()=>{this.killSession()};try{const o=await this._sendCallRequest(n);return o&&r(),o}catch(o){throw r(),o}}async connect(e){if(!this._qrcodeModal)throw new Error(Co);return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(e),new Promise(async(n,r)=>{this.on("modal_closed",()=>r(new Error(St))),this.on("connect",(o,i)=>{if(o)return r(o);n(i.params[0])})}))}async createSession(e){if(this._connected)throw new Error(Ne);if(this.pending)return;this._key=await this._generateKey();const n=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:e&&e.chainId?e.chainId:null}]});this.handshakeId=n.id,this.handshakeTopic=he(),this._sendSessionRequest(n,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(e){if(this._connected)throw new Error(Ne);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";const n={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},r={id:this.handshakeId,jsonrpc:"2.0",result:n};this._sendResponse(r),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(e){if(this._connected)throw new Error(Ne);const n=e&&e.message?e.message:_o,r=this._formatResponse({id:this.handshakeId,error:{message:n}});this._sendResponse(r),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:n}]}),this._removeStorageSession()}updateSession(e){if(!this._connected)throw new Error($);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";const n={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},r=this._formatRequest({method:"wc_sessionUpdate",params:[n]});this._sendSessionRequest(r,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(e){const n=e?e.message:"Session Disconnected",r={approved:!1,chainId:null,networkId:null,accounts:null},o=this._formatRequest({method:"wc_sessionUpdate",params:[r]});await this._sendRequest(o),this._handleSessionDisconnect(n)}async sendTransaction(e){if(!this._connected)throw new Error($);const n=e,r=this._formatRequest({method:"eth_sendTransaction",params:[n]});return await this._sendCallRequest(r)}async signTransaction(e){if(!this._connected)throw new Error($);const n=e,r=this._formatRequest({method:"eth_signTransaction",params:[n]});return await this._sendCallRequest(r)}async signMessage(e){if(!this._connected)throw new Error($);const n=this._formatRequest({method:"eth_sign",params:e});return await this._sendCallRequest(n)}async signPersonalMessage(e){if(!this._connected)throw new Error($);const n=this._formatRequest({method:"personal_sign",params:e});return await this._sendCallRequest(n)}async signTypedData(e){if(!this._connected)throw new Error($);const n=this._formatRequest({method:"eth_signTypedData",params:e});return await this._sendCallRequest(n)}async updateChain(e){if(!this._connected)throw new Error("Session currently disconnected");const n=this._formatRequest({method:"wallet_updateChain",params:[e]});return await this._sendCallRequest(n)}unsafeSend(e,n){return this._sendRequest(e,n),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:n}]}),new Promise((r,o)=>{this._subscribeToResponse(e.id,(i,s)=>{if(i){o(i);return}if(!s)throw new Error(po);r(s)})})}async sendCustomRequest(e,n){if(!this._connected)throw new Error($);switch(e.method){case"eth_accounts":return this.accounts;case"eth_chainId":return dn(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":e.params;break;case"personal_sign":e.params;break}const r=this._formatRequest(e);return await this._sendCallRequest(r,n)}approveRequest(e){if(H(e)){const n=this._formatResponse(e);this._sendResponse(n)}else throw new Error(mo)}rejectRequest(e){if(re(e)){const n=this._formatResponse(e);this._sendResponse(n)}else throw new Error(wo)}transportClose(){this._transport.close()}async _sendRequest(e,n){const r=this._formatRequest(e),o=await this._encrypt(r),i=typeof(n==null?void 0:n.topic)<"u"?n.topic:this.peerId,s=JSON.stringify(o),a=typeof(n==null?void 0:n.forcePushNotification)<"u"?!n.forcePushNotification:Bn(r);this._transport.send(s,i,a)}async _sendResponse(e){const n=await this._encrypt(e),r=this.peerId,o=JSON.stringify(n),i=!0;this._transport.send(o,r,i)}async _sendSessionRequest(e,n,r){this._sendRequest(e,r),this._subscribeToSessionResponse(e.id,n)}_sendCallRequest(e,n){return this._sendRequest(e,n),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:n}]}),this._subscribeToCallResponse(e.id)}_formatRequest(e){if(typeof e.method>"u")throw new Error(yo);return{id:typeof e.id>"u"?vn():e.id,jsonrpc:"2.0",method:e.method,params:typeof e.params>"u"?[]:e.params}}_formatResponse(e){if(typeof e.id>"u")throw new Error(bo);const n={id:e.id,jsonrpc:"2.0"};if(re(e)){const r=In(e.error);return Object.assign(Object.assign(Object.assign({},n),e),{error:r})}else if(H(e))return Object.assign(Object.assign({},n),e);throw new Error(Ct)}_handleSessionDisconnect(e){const n=e||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),lt(Pe)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:n}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(e,n){n?n.approved?(this._connected?(n.chainId&&(this.chainId=n.chainId),n.accounts&&(this.accounts=n.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,n.chainId&&(this.chainId=n.chainId),n.accounts&&(this.accounts=n.accounts),n.peerId&&!this.peerId&&(this.peerId=n.peerId),n.peerMeta&&!this.peerMeta&&(this.peerMeta=n.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(e):this._handleSessionDisconnect(e)}async _handleIncomingMessages(e){if(![this.clientId,this.handshakeTopic].includes(e.topic))return;let r;try{r=JSON.parse(e.payload)}catch{return}const o=await this._decrypt(r);o&&this._eventManager.trigger(o)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(e,n){this.on(`response:${e}`,n)}_subscribeToSessionResponse(e,n){this._subscribeToResponse(e,(r,o)=>{if(r){this._handleSessionResponse(r.message);return}H(o)?this._handleSessionResponse(n,o.result):o.error&&o.error.message?this._handleSessionResponse(o.error.message):this._handleSessionResponse(n)})}_subscribeToCallResponse(e){return new Promise((n,r)=>{this._subscribeToResponse(e,(o,i)=>{if(o){r(o);return}H(i)?n(i.result):i.error&&i.error.message?r(i.error):r(new Error(Ct))})})}_subscribeToInternalEvents(){this.on("display_uri",()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,()=>{this._eventManager.trigger({event:"modal_closed",params:[]})},this._qrcodeModalOptions)}),this.on("connect",()=>{this._qrcodeModal&&this._qrcodeModal.close()}),this.on("call_request_sent",(e,n)=>{const{request:r}=n.params[0];if(pn()&&this._signingMethods.includes(r.method)){const o=ct(Pe);o&&(window.location.href=o.href)}}),this.on("wc_sessionRequest",(e,n)=>{e&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:e.toString()}]}),this.handshakeId=n.id,this.peerId=n.params[0].peerId,this.peerMeta=n.params[0].peerMeta;const r=Object.assign(Object.assign({},n),{method:"session_request"});this._eventManager.trigger(r)}),this.on("wc_sessionUpdate",(e,n)=>{e&&this._handleSessionResponse(e.message),this._handleSessionResponse("Session disconnected",n.params[0])})}_initTransport(){this._transport.on("message",e=>this._handleIncomingMessages(e)),this._transport.on("open",()=>this._eventManager.trigger({event:"transport_open",params:[]})),this._transport.on("close",()=>this._eventManager.trigger({event:"transport_close",params:[]})),this._transport.on("error",()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})),this._transport.open()}_formatUri(){const e=this.protocol,n=this.handshakeTopic,r=this.version,o=encodeURIComponent(this.bridge),i=this.key;return`${e}:${n}@${r}?bridge=${o}&key=${i}`}_parseUri(e){const n=An(e);if(n.protocol===this.protocol){if(!n.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const r=n.handshakeTopic;if(!n.bridge)throw Error("Invalid or missing bridge url parameter value");const o=decodeURIComponent(n.bridge);if(!n.key)throw Error("Invalid or missing key parameter value");const i=n.key;return{handshakeTopic:r,bridge:o,key:i}}else throw new Error(Eo)}async _generateKey(){return this._cryptoLib?await this._cryptoLib.generateKey():null}async _encrypt(e){const n=this._key;return this._cryptoLib&&n?await this._cryptoLib.encrypt(e,n):null}async _decrypt(e){const n=this._key;return this._cryptoLib&&n?await this._cryptoLib.decrypt(e,n):null}_getStorageSession(){let e=null;return this._sessionStorage&&(e=this._sessionStorage.getSession()),e}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(e){if(!e.url||typeof e.url!="string")throw Error("Invalid or missing pushServerOpts.url parameter value");if(!e.type||typeof e.type!="string")throw Error("Invalid or missing pushServerOpts.type parameter value");if(!e.token||typeof e.token!="string")throw Error("Invalid or missing pushServerOpts.token parameter value");const n={bridge:this.bridge,topic:this.clientId,type:e.type,token:e.token,peerName:"",language:e.language||""};this.on("connect",async(r,o)=>{if(r)throw r;if(e.peerMeta){const i=o.params[0].peerMeta.name;n.peerName=i}try{if(!(await(await fetch(`${e.url}/new`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})).json()).success)throw Error("Failed to register in Push Server")}catch{throw Error("Failed to register in Push Server")}})}}function ps(t){return ie.getBrowerCrypto().getRandomValues(new Uint8Array(t))}const Pn=256,qn=Pn,ms=Pn,q="AES-CBC",ws=`SHA-${qn}`,Fe="HMAC",ys="encrypt",bs="decrypt",vs="sign",Es="verify";function Cs(t){return t===q?{length:qn,name:q}:{hash:{name:ws},name:Fe}}function Ss(t){return t===q?[ys,bs]:[vs,Es]}async function ft(t,e=q){return ie.getSubtleCrypto().importKey("raw",t,Cs(e),!0,Ss(e))}async function Is(t,e,n){const r=ie.getSubtleCrypto(),o=await ft(e,q),i=await r.encrypt({iv:t,name:q},o,n);return new Uint8Array(i)}async function Rs(t,e,n){const r=ie.getSubtleCrypto(),o=await ft(e,q),i=await r.decrypt({iv:t,name:q},o,n);return new Uint8Array(i)}async function ks(t,e){const n=ie.getSubtleCrypto(),r=await ft(t,Fe),o=await n.sign({length:ms,name:Fe},r,e);return new Uint8Array(o)}function Ts(t,e,n){return Is(t,e,n)}function Ns(t,e,n){return Rs(t,e,n)}async function Dn(t,e){return await ks(t,e)}async function Fn(t){const e=(t||256)/8,n=ps(e);return ln(Z(n))}async function $n(t,e){const n=P(t.data),r=P(t.iv),o=P(t.hmac),i=U(o,!1),s=an(n,r),a=await Dn(e,s),c=U(a,!1);return J(i)===J(c)}async function xs(t,e,n){const r=V(_e(e)),o=n||await Fn(128),i=V(_e(o)),s=U(i,!1),a=JSON.stringify(t),c=rn(a),h=await Ts(i,r,c),_=U(h,!1),v=an(h,i),b=await Dn(r,v),w=U(b,!1);return{data:_,hmac:w,iv:s}}async function Ms(t,e){const n=V(_e(e));if(!n)throw new Error("Missing key: required for decryption");if(!await $n(t,n))return null;const o=P(t.data),i=P(t.iv),s=await Ns(i,n,o),a=tn(s);let c;try{c=JSON.parse(a)}catch{return null}return c}const As=Object.freeze(Object.defineProperty({__proto__:null,decrypt:Ms,encrypt:xs,generateKey:Fn,verifyHmac:$n},Symbol.toStringTag,{value:"Module"}));class Os extends _s{constructor(e,n){super({cryptoLib:As,connectorOpts:e,pushServerOpts:n})}}const Ls=Ft(es);var ae={},Bs=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},jn={},M={};let ht;const Us=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];M.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};M.getSymbolTotalCodewords=function(e){return Us[e]};M.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};M.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');ht=e};M.isKanjiModeEnabled=function(){return typeof ht<"u"};M.toSJIS=function(e){return ht(e)};var Ie={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},t.from=function(r,o){if(t.isValid(r))return r;try{return e(r)}catch{return o}}})(Ie);function Hn(){this.buffer=[],this.length=0}Hn.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ps=Hn;function ce(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}ce.prototype.set=function(t,e,n,r){const o=t*this.size+e;this.data[o]=n,r&&(this.reservedBit[o]=!0)};ce.prototype.get=function(t,e){return this.data[t*this.size+e]};ce.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};ce.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var qs=ce,zn={};(function(t){const e=M.getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const o=Math.floor(r/7)+2,i=e(r),s=i===145?26:Math.ceil((i-13)/(2*o-2))*2,a=[i-7];for(let c=1;c=0&&o<=7},t.from=function(o){return t.isValid(o)?parseInt(o,10):void 0},t.getPenaltyN1=function(o){const i=o.size;let s=0,a=0,c=0,h=null,_=null;for(let v=0;v=5&&(s+=e.N1+(a-5)),h=w,a=1),w=o.get(b,v),w===_?c++:(c>=5&&(s+=e.N1+(c-5)),_=w,c=1)}a>=5&&(s+=e.N1+(a-5)),c>=5&&(s+=e.N1+(c-5))}return s},t.getPenaltyN2=function(o){const i=o.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,c=c<<1&2047|o.get(_,h),_>=10&&(c===1488||c===93)&&s++}return s*e.N3},t.getPenaltyN4=function(o){let i=0;const s=o.data.length;for(let c=0;c=0;){const s=i[0];for(let c=0;c0){const i=new Uint8Array(this.degree);return i.set(r,o),i}return r};var Fs=gt,Kn={},D={},_t={};_t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var A={};const Yn="[0-9]+",$s="[A-Z $%*+\\-./:]+";let oe="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";oe=oe.replace(/u/g,"\\u");const js="(?:(?![A-Z0-9 $%*+\\-./:]|"+oe+`)(?:.|[\r +import{E as Dt}from"./events-699377c5.js";import{b as Fr,s as $r,m as jr,c as ie,I as Hr,f as vt,J as Et,H as zr}from"./http-8ae254e4.js";import{k as Ve,aA as Wr,aB as Vr,aC as Jr,aD as Qr,aE as Kr,aF as Yr,aG as Gr,aH as Zr,aI as Xr,aJ as eo,aK as to,aL as no,aM as ro,aN as oo,aO as io,aP as so,aQ as ao,aR as co,e as Ft,aS as lo,aT as uo}from"./index-8dd5e2d3.js";import{b as j,l as N,y as O,k as W,C as B,B as ge,E as fo,F as ho,a as ye,c as Je,d as Qe,V as $t,s as jt,_ as Ht,A as zt,e as Wt,T as Vt,q as Jt,x as Qt,G as Kt,f as Yt,P as go}from"./hooks.module-fb90a505.js";import"@safe-globalThis/safe-apps-provider";import"@safe-globalThis/safe-apps-sdk";const Ne="Session currently connected",$="Session currently disconnected",_o="Session Rejected",po="Missing JSON RPC response",mo='JSON-RPC success response must include "result" field',wo='JSON-RPC error response must include "error" field',yo='JSON RPC request must have valid "method" value',bo='JSON RPC request must have valid "id" value',vo="Missing one of the required parameters: bridge / uri / session",Ct="JSON RPC response format is invalid",Eo="URI format is invalid",Co="QRCode Modal not provided",St="User close QRCode Modal",So=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],Io=["wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Ke=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign",...Io],Pe="WALLETCONNECT_DEEPLINK_CHOICE",Ro={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var Gt=Ye;Ye.strict=Zt;Ye.loose=Xt;var ko=Object.prototype.toString,To={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function Ye(t){return Zt(t)||Xt(t)}function Zt(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function Xt(t){return To[ko.call(t)]}const No=Ve(Gt);var xo=Gt.strict,Mo=function(e){if(xo(e)){var n=Buffer.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(n=n.slice(e.byteOffset,e.byteOffset+e.byteLength)),n}else return Buffer.from(e)};const Ao=Ve(Mo),Ge="hex",Ze="utf8",Oo="binary",Lo="buffer",Bo="array",Uo="typed-array",Po="array-buffer",be="0";function V(t){return new Uint8Array(t)}function Xe(t,e=!1){const n=t.toString(Ge);return e?se(n):n}function et(t){return t.toString(Ze)}function en(t){return t.readUIntBE(0,t.length)}function Z(t){return Ao(t)}function U(t,e=!1){return Xe(Z(t),e)}function tn(t){return et(Z(t))}function nn(t){return en(Z(t))}function tt(t){return Buffer.from(J(t),Ge)}function P(t){return V(tt(t))}function qo(t){return et(tt(t))}function Do(t){return nn(P(t))}function nt(t){return Buffer.from(t,Ze)}function rn(t){return V(nt(t))}function Fo(t,e=!1){return Xe(nt(t),e)}function $o(t){const e=parseInt(t,10);return ii(oi(e),"Number can only safely store up to 53 bits"),e}function jo(t){return Vo(rt(t))}function Ho(t){return ot(rt(t))}function zo(t,e){return Jo(rt(t),e)}function Wo(t){return`${t}`}function rt(t){const e=(t>>>0).toString(2);return st(e)}function Vo(t){return Z(ot(t))}function ot(t){return new Uint8Array(Xo(t).map(e=>parseInt(e,2)))}function Jo(t,e){return U(ot(t),e)}function Qo(t){return!(typeof t!="string"||!new RegExp(/^[01]+$/).test(t)||t.length%8!==0)}function on(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}function ve(t){return Buffer.isBuffer(t)}function it(t){return No.strict(t)&&!ve(t)}function sn(t){return!it(t)&&!ve(t)&&typeof t.byteLength<"u"}function Ko(t){return ve(t)?Lo:it(t)?Uo:sn(t)?Po:Array.isArray(t)?Bo:typeof t}function Yo(t){return Qo(t)?Oo:on(t)?Ge:Ze}function Go(...t){return Buffer.concat(t)}function an(...t){let e=[];return t.forEach(n=>e=e.concat(Array.from(n))),new Uint8Array([...e])}function Zo(t,e=8){const n=t%e;return n?(t-n)/e*e+e:t}function Xo(t,e=8){const n=st(t).match(new RegExp(`.{${e}}`,"gi"));return Array.from(n||[])}function st(t,e=8,n=be){return ei(t,Zo(t.length,e),n)}function ei(t,e,n=be){return si(t,e,!0,n)}function J(t){return t.replace(/^0x/,"")}function se(t){return t.startsWith("0x")?t:`0x${t}`}function ti(t){return t=J(t),t=st(t,2),t&&(t=se(t)),t}function ni(t){const e=t.startsWith("0x");return t=J(t),t=t.startsWith(be)?t.substring(1):t,e?se(t):t}function ri(t){return typeof t>"u"}function oi(t){return!ri(t)}function ii(t,e){if(!t)throw new Error(e)}function si(t,e,n,r=be){const o=e-t.length;let i=t;if(o>0){const s=r.repeat(o);i=n?s+t:t+s}return i}function _e(t){return Z(new Uint8Array(t))}function ai(t){return tn(new Uint8Array(t))}function cn(t,e){return U(new Uint8Array(t),!e)}function ci(t){return nn(new Uint8Array(t))}function li(...t){return P(t.map(e=>U(new Uint8Array(e))).join("")).buffer}function ln(t){return V(t).buffer}function ui(t){return et(t)}function di(t,e){return Xe(t,!e)}function fi(t){return en(t)}function hi(...t){return Go(...t)}function gi(t){return rn(t).buffer}function _i(t){return nt(t)}function pi(t,e){return Fo(t,!e)}function mi(t){return $o(t)}function wi(t){return tt(t)}function un(t){return P(t).buffer}function yi(t){return qo(t)}function bi(t){return Do(t)}function vi(t){return jo(t)}function Ei(t){return Ho(t).buffer}function Ci(t){return Wo(t)}function dn(t,e){return zo(Number(t),!e)}const Si=Qr,Ii=Kr,Ri=Yr,ki=Gr,Ti=Zr,fn=Jr,Ni=Xr,hn=Wr,xi=eo,Mi=to,Ai=no,Ee=Vr;function Ce(t){return ro(t)}function Se(){const t=Ce();return t&&t.os?t.os:void 0}function gn(){const t=Se();return t?t.toLowerCase().includes("android"):!1}function _n(){const t=Se();return t?t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function pn(){return Se()?gn()||_n():!1}function mn(){const t=Ce();return t&&t.name?t.name.toLowerCase()==="node":!1}function wn(){return!mn()&&!!fn()}const yn=Fr,bn=$r;function at(t,e){const n=bn(e),r=Ee();r&&r.setItem(t,n)}function ct(t){let e=null,n=null;const r=Ee();return r&&(n=r.getItem(t)),e=n&&yn(n),e}function lt(t){const e=Ee();e&&e.removeItem(t)}function qe(){return oo()}function Oi(t){return ti(t)}function Li(t){return se(t)}function Bi(t){return J(t)}function Ui(t){return ni(se(t))}const vn=jr;function he(){return((e,n)=>{for(n=e="";e++<36;n+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return n})()}function Pi(){console.warn("DEPRECATION WARNING: This WalletConnect client library will be deprecated in favor of @walletconnect/client. Please check docs.walletconnect.org to learn more about this migration!")}function En(t,e){let n;const r=Ro[t];return r&&(n=`https://${r}.infura.io/v3/${e}`),n}function Cn(t,e){let n;const r=En(t,e.infuraId);return e.custom&&e.custom[t]?n=e.custom[t]:r&&(n=r),n}function qi(t,e){const n=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${n}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${n}`:""}function Di(t){const e=t.href.split("?")[0];at(Pe,Object.assign(Object.assign({},t),{href:e}))}function Sn(t,e){return t.filter(n=>n.name.toLowerCase().includes(e.toLowerCase()))[0]}function Fi(t,e){let n=t;return e&&(n=e.map(r=>Sn(t,r)).filter(Boolean)),n}function $i(t,e){return async(...r)=>new Promise((o,i)=>{const s=(a,c)=>{(a===null||typeof a>"u")&&i(a),o(c)};t.apply(e,[...r,s])})}function In(t){const e=t.message||"Failed or Rejected Request";let n=-32e3;if(t&&!t.code)switch(e){case"Parse error":n=-32700;break;case"Invalid request":n=-32600;break;case"Method not found":n=-32601;break;case"Invalid params":n=-32602;break;case"Internal error":n=-32603;break;default:n=-32e3;break}const r={code:n,message:e};return t.data&&(r.data=t.data),r}const Rn="https://registry.walletconnect.com";function ji(){return Rn+"/api/v2/wallets"}function Hi(){return Rn+"/api/v2/dapps"}function kn(t,e="mobile"){var n;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:(n=t.image_url.sm)!==null&&n!==void 0?n:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function zi(t,e="mobile"){return Object.values(t).filter(n=>!!n[e].universal||!!n[e].native).map(n=>kn(n,e))}var ut={};(function(t){const e=ao,n=co,r=io,o=so,i=l=>l==null;function s(l){switch(l.arrayFormat){case"index":return d=>(f,u)=>{const g=f.length;return u===void 0||l.skipNull&&u===null||l.skipEmptyString&&u===""?f:u===null?[...f,[h(d,l),"[",g,"]"].join("")]:[...f,[h(d,l),"[",h(g,l),"]=",h(u,l)].join("")]};case"bracket":return d=>(f,u)=>u===void 0||l.skipNull&&u===null||l.skipEmptyString&&u===""?f:u===null?[...f,[h(d,l),"[]"].join("")]:[...f,[h(d,l),"[]=",h(u,l)].join("")];case"comma":case"separator":return d=>(f,u)=>u==null||u.length===0?f:f.length===0?[[h(d,l),"=",h(u,l)].join("")]:[[f,h(u,l)].join(l.arrayFormatSeparator)];default:return d=>(f,u)=>u===void 0||l.skipNull&&u===null||l.skipEmptyString&&u===""?f:u===null?[...f,h(d,l)]:[...f,[h(d,l),"=",h(u,l)].join("")]}}function a(l){let d;switch(l.arrayFormat){case"index":return(f,u,g)=>{if(d=/\[(\d*)\]$/.exec(f),f=f.replace(/\[\d*\]$/,""),!d){g[f]=u;return}g[f]===void 0&&(g[f]={}),g[f][d[1]]=u};case"bracket":return(f,u,g)=>{if(d=/(\[\])$/.exec(f),f=f.replace(/\[\]$/,""),!d){g[f]=u;return}if(g[f]===void 0){g[f]=[u];return}g[f]=[].concat(g[f],u)};case"comma":case"separator":return(f,u,g)=>{const y=typeof u=="string"&&u.includes(l.arrayFormatSeparator),m=typeof u=="string"&&!y&&_(u,l).includes(l.arrayFormatSeparator);u=m?_(u,l):u;const S=y||m?u.split(l.arrayFormatSeparator).map(R=>_(R,l)):u===null?u:_(u,l);g[f]=S};default:return(f,u,g)=>{if(g[f]===void 0){g[f]=u;return}g[f]=[].concat(g[f],u)}}}function c(l){if(typeof l!="string"||l.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(l,d){return d.encode?d.strict?e(l):encodeURIComponent(l):l}function _(l,d){return d.decode?n(l):l}function v(l){return Array.isArray(l)?l.sort():typeof l=="object"?v(Object.keys(l)).sort((d,f)=>Number(d)-Number(f)).map(d=>l[d]):l}function b(l){const d=l.indexOf("#");return d!==-1&&(l=l.slice(0,d)),l}function w(l){let d="";const f=l.indexOf("#");return f!==-1&&(d=l.slice(f)),d}function E(l){l=b(l);const d=l.indexOf("?");return d===-1?"":l.slice(d+1)}function C(l,d){return d.parseNumbers&&!Number.isNaN(Number(l))&&typeof l=="string"&&l.trim()!==""?l=Number(l):d.parseBooleans&&l!==null&&(l.toLowerCase()==="true"||l.toLowerCase()==="false")&&(l=l.toLowerCase()==="true"),l}function I(l,d){d=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},d),c(d.arrayFormatSeparator);const f=a(d),u=Object.create(null);if(typeof l!="string"||(l=l.trim().replace(/^[?#&]/,""),!l))return u;for(const g of l.split("&")){if(g==="")continue;let[y,m]=r(d.decode?g.replace(/\+/g," "):g,"=");m=m===void 0?null:["comma","separator"].includes(d.arrayFormat)?m:_(m,d),f(_(y,d),m,u)}for(const g of Object.keys(u)){const y=u[g];if(typeof y=="object"&&y!==null)for(const m of Object.keys(y))y[m]=C(y[m],d);else u[g]=C(y,d)}return d.sort===!1?u:(d.sort===!0?Object.keys(u).sort():Object.keys(u).sort(d.sort)).reduce((g,y)=>{const m=u[y];return m&&typeof m=="object"&&!Array.isArray(m)?g[y]=v(m):g[y]=m,g},Object.create(null))}t.extract=E,t.parse=I,t.stringify=(l,d)=>{if(!l)return"";d=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},d),c(d.arrayFormatSeparator);const f=m=>d.skipNull&&i(l[m])||d.skipEmptyString&&l[m]==="",u=s(d),g={};for(const m of Object.keys(l))f(m)||(g[m]=l[m]);const y=Object.keys(g);return d.sort!==!1&&y.sort(d.sort),y.map(m=>{const S=l[m];return S===void 0?"":S===null?h(m,d):Array.isArray(S)?S.reduce(u(m),[]).join("&"):h(m,d)+"="+h(S,d)}).filter(m=>m.length>0).join("&")},t.parseUrl=(l,d)=>{d=Object.assign({decode:!0},d);const[f,u]=r(l,"#");return Object.assign({url:f.split("?")[0]||"",query:I(E(l),d)},d&&d.parseFragmentIdentifier&&u?{fragmentIdentifier:_(u,d)}:{})},t.stringifyUrl=(l,d)=>{d=Object.assign({encode:!0,strict:!0},d);const f=b(l.url).split("?")[0]||"",u=t.extract(l.url),g=t.parse(u,{sort:!1}),y=Object.assign(g,l.query);let m=t.stringify(y,d);m&&(m=`?${m}`);let S=w(l.url);return l.fragmentIdentifier&&(S=`#${h(l.fragmentIdentifier,d)}`),`${f}${m}${S}`},t.pick=(l,d,f)=>{f=Object.assign({parseFragmentIdentifier:!0},f);const{url:u,query:g,fragmentIdentifier:y}=t.parseUrl(l,f);return t.stringifyUrl({url:u,query:o(g,d),fragmentIdentifier:y},f)},t.exclude=(l,d,f)=>{const u=Array.isArray(d)?g=>!d.includes(g):(g,y)=>!d(g,y);return t.pick(l,u,f)}})(ut);function Tn(t){const e=t.indexOf("?")!==-1?t.indexOf("?"):void 0;return typeof e<"u"?t.substr(e):""}function Nn(t,e){let n=dt(t);return n=Object.assign(Object.assign({},n),e),t=xn(n),t}function dt(t){return ut.parse(t)}function xn(t){return ut.stringify(t)}function Mn(t){return typeof t.bridge<"u"}function An(t){const e=t.indexOf(":"),n=t.indexOf("?")!==-1?t.indexOf("?"):void 0,r=t.substring(0,e),o=t.substring(e+1,n);function i(v){const b="@",w=v.split(b);return{handshakeTopic:w[0],version:parseInt(w[1],10)}}const s=i(o),a=typeof n<"u"?t.substr(n):"";function c(v){const b=dt(v);return{key:b.key||"",bridge:b.bridge||""}}const h=c(a);return Object.assign(Object.assign({protocol:r},s),h)}function Wi(t){return t===""||typeof t=="string"&&t.trim()===""}function Vi(t){return!(t&&t.length)}function Ji(t){return ve(t)}function Qi(t){return it(t)}function Ki(t){return sn(t)}function Yi(t){return Ko(t)}function Gi(t){return Yo(t)}function Zi(t,e){return on(t,e)}function Xi(t){return typeof t.params=="object"}function On(t){return typeof t.method<"u"}function H(t){return typeof t.result<"u"}function re(t){return typeof t.error<"u"}function De(t){return typeof t.event<"u"}function Ln(t){return So.includes(t)||t.startsWith("wc_")}function Bn(t){return t.method.startsWith("wc_")?!0:!Ke.includes(t.method)}const es=Object.freeze(Object.defineProperty({__proto__:null,addHexPrefix:Li,appendToQueryString:Nn,concatArrayBuffers:li,concatBuffers:hi,convertArrayBufferToBuffer:_e,convertArrayBufferToHex:cn,convertArrayBufferToNumber:ci,convertArrayBufferToUtf8:ai,convertBufferToArrayBuffer:ln,convertBufferToHex:di,convertBufferToNumber:fi,convertBufferToUtf8:ui,convertHexToArrayBuffer:un,convertHexToBuffer:wi,convertHexToNumber:bi,convertHexToUtf8:yi,convertNumberToArrayBuffer:Ei,convertNumberToBuffer:vi,convertNumberToHex:dn,convertNumberToUtf8:Ci,convertUtf8ToArrayBuffer:gi,convertUtf8ToBuffer:_i,convertUtf8ToHex:pi,convertUtf8ToNumber:mi,detectEnv:Ce,detectOS:Se,formatIOSMobile:qi,formatMobileRegistry:zi,formatMobileRegistryEntry:kn,formatQueryString:xn,formatRpcError:In,getClientMeta:qe,getCrypto:Mi,getCryptoOrThrow:xi,getDappRegistryUrl:Hi,getDocument:ki,getDocumentOrThrow:Ri,getEncoding:Gi,getFromWindow:Si,getFromWindowOrThrow:Ii,getInfuraRpcUrl:En,getLocal:ct,getLocalStorage:Ee,getLocalStorageOrThrow:Ai,getLocation:hn,getLocationOrThrow:Ni,getMobileLinkRegistry:Fi,getMobileRegistryEntry:Sn,getNavigator:fn,getNavigatorOrThrow:Ti,getQueryString:Tn,getRpcUrl:Cn,getType:Yi,getWalletRegistryUrl:ji,isAndroid:gn,isArrayBuffer:Ki,isBrowser:wn,isBuffer:Ji,isEmptyArray:Vi,isEmptyString:Wi,isHexString:Zi,isIOS:_n,isInternalEvent:De,isJsonRpcRequest:On,isJsonRpcResponseError:re,isJsonRpcResponseSuccess:H,isJsonRpcSubscription:Xi,isMobile:pn,isNode:mn,isReservedEvent:Ln,isSilentPayload:Bn,isTypedArray:Qi,isWalletConnectSession:Mn,logDeprecationWarning:Pi,parseQueryString:dt,parseWalletConnectUri:An,payloadId:vn,promisify:$i,removeHexLeadingZeros:Ui,removeHexPrefix:Bi,removeLocal:lt,safeJsonParse:yn,safeJsonStringify:bn,sanitizeHex:Oi,saveMobileLinkInfo:Di,setLocal:at,uuid:he},Symbol.toStringTag,{value:"Module"}));class ts{constructor(){this._eventEmitters=[],typeof window<"u"&&typeof window.addEventListener<"u"&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(e,n){this._eventEmitters.push({event:e,callback:n})}trigger(e){let n=[];e&&(n=this._eventEmitters.filter(r=>r.event===e)),n.forEach(r=>{r.callback()})}}const ns=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:require("ws");class rs{constructor(e){if(this.opts=e,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=e.protocol,this._version=e.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=e.subscriptions||[],this._netMonitor=e.netMonitor||new ts,!e.url||typeof e.url!="string")throw new Error("Missing or invalid WebSocket url");this._url=e.url,this._netMonitor.on("online",()=>this._socketCreate())}set readyState(e){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(e){}get connecting(){return this.readyState===0}set connected(e){}get connected(){return this.readyState===1}set closing(e){}get closing(){return this.readyState===2}set closed(e){}get closed(){return this.readyState===3}open(){this._socketCreate()}close(){this._socketClose()}send(e,n,r){if(!n||typeof n!="string")throw new Error("Missing or invalid topic field");this._socketSend({topic:n,type:"pub",payload:e,silent:!!r})}subscribe(e){this._socketSend({topic:e,type:"sub",payload:"",silent:!0})}on(e,n){this._events.push({event:e,callback:n})}_socketCreate(){if(this._nextSocket)return;const e=os(this._url,this._protocol,this._version);if(this._nextSocket=new ns(e),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=n=>this._socketReceive(n),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=n=>this._socketError(n),this._nextSocket.onclose=()=>{setTimeout(()=>{this._nextSocket=null,this._socketCreate()},1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(e){const n=JSON.stringify(e);this._socket&&this._socket.readyState===1?this._socket.send(n):(this._setToQueue(e),this._socketCreate())}async _socketReceive(e){let n;try{n=JSON.parse(e.data)}catch{return}if(this._socketSend({topic:n.topic,type:"ack",payload:"",silent:!0}),this._socket&&this._socket.readyState===1){const r=this._events.filter(o=>o.event==="message");r&&r.length&&r.forEach(o=>o.callback(n))}}_socketError(e){const n=this._events.filter(r=>r.event==="error");n&&n.length&&n.forEach(r=>r.callback(e))}_queueSubscriptions(){this._subscriptions.forEach(n=>this._queue.push({topic:n,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(e){this._queue.push(e)}_pushQueue(){this._queue.forEach(n=>this._socketSend(n)),this._queue=[]}}function os(t,e,n){var r,o;const s=(t.startsWith("https")?t.replace("https","wss"):t.startsWith("http")?t.replace("http","ws"):t).split("?"),a=wn()?{protocol:e,version:n,env:"browser",host:((r=hn())===null||r===void 0?void 0:r.host)||""}:{protocol:e,version:n,env:((o=Ce())===null||o===void 0?void 0:o.name)||""},c=Nn(Tn(s[1]||""),a);return s[0]+"?"+c}class is{constructor(){this._eventEmitters=[]}subscribe(e){this._eventEmitters.push(e)}unsubscribe(e){this._eventEmitters=this._eventEmitters.filter(n=>n.event!==e)}trigger(e){let n=[],r;On(e)?r=e.method:H(e)||re(e)?r=`response:${e.id}`:De(e)?r=e.event:r="",r&&(n=this._eventEmitters.filter(o=>o.event===r)),(!n||!n.length)&&!Ln(r)&&!De(r)&&(n=this._eventEmitters.filter(o=>o.event==="call_request")),n.forEach(o=>{if(re(e)){const i=new Error(e.error.message);o.callback(i,null)}else o.callback(null,e)})}}class ss{constructor(e="walletconnect"){this.storageId=e}getSession(){let e=null;const n=ct(this.storageId);return n&&Mn(n)&&(e=n),e}setSession(e){return at(this.storageId,e),e}removeSession(){lt(this.storageId)}}const as="walletconnect.org",cs="abcdefghijklmnopqrstuvwxyz0123456789",Un=cs.split("").map(t=>`https://${t}.bridge.walletconnect.org`);function ls(t){let e=t.indexOf("//")>-1?t.split("/")[2]:t.split("/")[0];return e=e.split(":")[0],e=e.split("?")[0],e}function us(t){return ls(t).split(".").slice(-2).join(".")}function ds(){return Math.floor(Math.random()*Un.length)}function fs(){return Un[ds()]}function hs(t){return us(t)===as}function gs(t){return hs(t)?fs():t}class _s{constructor(e){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new is,this._clientMeta=qe()||e.connectorOpts.clientMeta||null,this._cryptoLib=e.cryptoLib,this._sessionStorage=e.sessionStorage||new ss(e.connectorOpts.storageId),this._qrcodeModal=e.connectorOpts.qrcodeModal,this._qrcodeModalOptions=e.connectorOpts.qrcodeModalOptions,this._signingMethods=[...Ke,...e.connectorOpts.signingMethods||[]],!e.connectorOpts.bridge&&!e.connectorOpts.uri&&!e.connectorOpts.session)throw new Error(vo);e.connectorOpts.bridge&&(this.bridge=gs(e.connectorOpts.bridge)),e.connectorOpts.uri&&(this.uri=e.connectorOpts.uri);const n=e.connectorOpts.session||this._getStorageSession();n&&(this.session=n),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=e.transport||new rs({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),e.connectorOpts.uri&&this._subscribeToSessionRequest(),e.pushServerOpts&&this._registerPushServer(e.pushServerOpts)}set bridge(e){e&&(this._bridge=e)}get bridge(){return this._bridge}set key(e){if(!e)return;const n=un(e);this._key=n}get key(){return this._key?cn(this._key,!0):""}set clientId(e){e&&(this._clientId=e)}get clientId(){let e=this._clientId;return e||(e=this._clientId=he()),this._clientId}set peerId(e){e&&(this._peerId=e)}get peerId(){return this._peerId}set clientMeta(e){}get clientMeta(){let e=this._clientMeta;return e||(e=this._clientMeta=qe()),e}set peerMeta(e){this._peerMeta=e}get peerMeta(){return this._peerMeta}set handshakeTopic(e){e&&(this._handshakeTopic=e)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(e){e&&(this._handshakeId=e)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(e){if(!e)return;const{handshakeTopic:n,bridge:r,key:o}=this._parseUri(e);this.handshakeTopic=n,this.bridge=r,this.key=o}set chainId(e){this._chainId=e}get chainId(){return this._chainId}set networkId(e){this._networkId=e}get networkId(){return this._networkId}set accounts(e){this._accounts=e}get accounts(){return this._accounts}set rpcUrl(e){this._rpcUrl=e}get rpcUrl(){return this._rpcUrl}set connected(e){}get connected(){return this._connected}set pending(e){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(e){e&&(this._connected=e.connected,this.accounts=e.accounts,this.chainId=e.chainId,this.bridge=e.bridge,this.key=e.key,this.clientId=e.clientId,this.clientMeta=e.clientMeta,this.peerId=e.peerId,this.peerMeta=e.peerMeta,this.handshakeId=e.handshakeId,this.handshakeTopic=e.handshakeTopic)}on(e,n){const r={event:e,callback:n};this._eventManager.subscribe(r)}off(e){this._eventManager.unsubscribe(e)}async createInstantRequest(e){this._key=await this._generateKey();const n=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(e)}]});this.handshakeId=n.id,this.handshakeTopic=he(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",()=>{throw new Error(St)});const r=()=>{this.killSession()};try{const o=await this._sendCallRequest(n);return o&&r(),o}catch(o){throw r(),o}}async connect(e){if(!this._qrcodeModal)throw new Error(Co);return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(e),new Promise(async(n,r)=>{this.on("modal_closed",()=>r(new Error(St))),this.on("connect",(o,i)=>{if(o)return r(o);n(i.params[0])})}))}async createSession(e){if(this._connected)throw new Error(Ne);if(this.pending)return;this._key=await this._generateKey();const n=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:e&&e.chainId?e.chainId:null}]});this.handshakeId=n.id,this.handshakeTopic=he(),this._sendSessionRequest(n,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(e){if(this._connected)throw new Error(Ne);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";const n={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},r={id:this.handshakeId,jsonrpc:"2.0",result:n};this._sendResponse(r),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(e){if(this._connected)throw new Error(Ne);const n=e&&e.message?e.message:_o,r=this._formatResponse({id:this.handshakeId,error:{message:n}});this._sendResponse(r),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:n}]}),this._removeStorageSession()}updateSession(e){if(!this._connected)throw new Error($);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";const n={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},r=this._formatRequest({method:"wc_sessionUpdate",params:[n]});this._sendSessionRequest(r,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(e){const n=e?e.message:"Session Disconnected",r={approved:!1,chainId:null,networkId:null,accounts:null},o=this._formatRequest({method:"wc_sessionUpdate",params:[r]});await this._sendRequest(o),this._handleSessionDisconnect(n)}async sendTransaction(e){if(!this._connected)throw new Error($);const n=e,r=this._formatRequest({method:"eth_sendTransaction",params:[n]});return await this._sendCallRequest(r)}async signTransaction(e){if(!this._connected)throw new Error($);const n=e,r=this._formatRequest({method:"eth_signTransaction",params:[n]});return await this._sendCallRequest(r)}async signMessage(e){if(!this._connected)throw new Error($);const n=this._formatRequest({method:"eth_sign",params:e});return await this._sendCallRequest(n)}async signPersonalMessage(e){if(!this._connected)throw new Error($);const n=this._formatRequest({method:"personal_sign",params:e});return await this._sendCallRequest(n)}async signTypedData(e){if(!this._connected)throw new Error($);const n=this._formatRequest({method:"eth_signTypedData",params:e});return await this._sendCallRequest(n)}async updateChain(e){if(!this._connected)throw new Error("Session currently disconnected");const n=this._formatRequest({method:"wallet_updateChain",params:[e]});return await this._sendCallRequest(n)}unsafeSend(e,n){return this._sendRequest(e,n),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:n}]}),new Promise((r,o)=>{this._subscribeToResponse(e.id,(i,s)=>{if(i){o(i);return}if(!s)throw new Error(po);r(s)})})}async sendCustomRequest(e,n){if(!this._connected)throw new Error($);switch(e.method){case"eth_accounts":return this.accounts;case"eth_chainId":return dn(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":e.params;break;case"personal_sign":e.params;break}const r=this._formatRequest(e);return await this._sendCallRequest(r,n)}approveRequest(e){if(H(e)){const n=this._formatResponse(e);this._sendResponse(n)}else throw new Error(mo)}rejectRequest(e){if(re(e)){const n=this._formatResponse(e);this._sendResponse(n)}else throw new Error(wo)}transportClose(){this._transport.close()}async _sendRequest(e,n){const r=this._formatRequest(e),o=await this._encrypt(r),i=typeof(n==null?void 0:n.topic)<"u"?n.topic:this.peerId,s=JSON.stringify(o),a=typeof(n==null?void 0:n.forcePushNotification)<"u"?!n.forcePushNotification:Bn(r);this._transport.send(s,i,a)}async _sendResponse(e){const n=await this._encrypt(e),r=this.peerId,o=JSON.stringify(n),i=!0;this._transport.send(o,r,i)}async _sendSessionRequest(e,n,r){this._sendRequest(e,r),this._subscribeToSessionResponse(e.id,n)}_sendCallRequest(e,n){return this._sendRequest(e,n),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:n}]}),this._subscribeToCallResponse(e.id)}_formatRequest(e){if(typeof e.method>"u")throw new Error(yo);return{id:typeof e.id>"u"?vn():e.id,jsonrpc:"2.0",method:e.method,params:typeof e.params>"u"?[]:e.params}}_formatResponse(e){if(typeof e.id>"u")throw new Error(bo);const n={id:e.id,jsonrpc:"2.0"};if(re(e)){const r=In(e.error);return Object.assign(Object.assign(Object.assign({},n),e),{error:r})}else if(H(e))return Object.assign(Object.assign({},n),e);throw new Error(Ct)}_handleSessionDisconnect(e){const n=e||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),lt(Pe)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:n}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(e,n){n?n.approved?(this._connected?(n.chainId&&(this.chainId=n.chainId),n.accounts&&(this.accounts=n.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,n.chainId&&(this.chainId=n.chainId),n.accounts&&(this.accounts=n.accounts),n.peerId&&!this.peerId&&(this.peerId=n.peerId),n.peerMeta&&!this.peerMeta&&(this.peerMeta=n.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(e):this._handleSessionDisconnect(e)}async _handleIncomingMessages(e){if(![this.clientId,this.handshakeTopic].includes(e.topic))return;let r;try{r=JSON.parse(e.payload)}catch{return}const o=await this._decrypt(r);o&&this._eventManager.trigger(o)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(e,n){this.on(`response:${e}`,n)}_subscribeToSessionResponse(e,n){this._subscribeToResponse(e,(r,o)=>{if(r){this._handleSessionResponse(r.message);return}H(o)?this._handleSessionResponse(n,o.result):o.error&&o.error.message?this._handleSessionResponse(o.error.message):this._handleSessionResponse(n)})}_subscribeToCallResponse(e){return new Promise((n,r)=>{this._subscribeToResponse(e,(o,i)=>{if(o){r(o);return}H(i)?n(i.result):i.error&&i.error.message?r(i.error):r(new Error(Ct))})})}_subscribeToInternalEvents(){this.on("display_uri",()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,()=>{this._eventManager.trigger({event:"modal_closed",params:[]})},this._qrcodeModalOptions)}),this.on("connect",()=>{this._qrcodeModal&&this._qrcodeModal.close()}),this.on("call_request_sent",(e,n)=>{const{request:r}=n.params[0];if(pn()&&this._signingMethods.includes(r.method)){const o=ct(Pe);o&&(window.location.href=o.href)}}),this.on("wc_sessionRequest",(e,n)=>{e&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:e.toString()}]}),this.handshakeId=n.id,this.peerId=n.params[0].peerId,this.peerMeta=n.params[0].peerMeta;const r=Object.assign(Object.assign({},n),{method:"session_request"});this._eventManager.trigger(r)}),this.on("wc_sessionUpdate",(e,n)=>{e&&this._handleSessionResponse(e.message),this._handleSessionResponse("Session disconnected",n.params[0])})}_initTransport(){this._transport.on("message",e=>this._handleIncomingMessages(e)),this._transport.on("open",()=>this._eventManager.trigger({event:"transport_open",params:[]})),this._transport.on("close",()=>this._eventManager.trigger({event:"transport_close",params:[]})),this._transport.on("error",()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})),this._transport.open()}_formatUri(){const e=this.protocol,n=this.handshakeTopic,r=this.version,o=encodeURIComponent(this.bridge),i=this.key;return`${e}:${n}@${r}?bridge=${o}&key=${i}`}_parseUri(e){const n=An(e);if(n.protocol===this.protocol){if(!n.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const r=n.handshakeTopic;if(!n.bridge)throw Error("Invalid or missing bridge url parameter value");const o=decodeURIComponent(n.bridge);if(!n.key)throw Error("Invalid or missing key parameter value");const i=n.key;return{handshakeTopic:r,bridge:o,key:i}}else throw new Error(Eo)}async _generateKey(){return this._cryptoLib?await this._cryptoLib.generateKey():null}async _encrypt(e){const n=this._key;return this._cryptoLib&&n?await this._cryptoLib.encrypt(e,n):null}async _decrypt(e){const n=this._key;return this._cryptoLib&&n?await this._cryptoLib.decrypt(e,n):null}_getStorageSession(){let e=null;return this._sessionStorage&&(e=this._sessionStorage.getSession()),e}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(e){if(!e.url||typeof e.url!="string")throw Error("Invalid or missing pushServerOpts.url parameter value");if(!e.type||typeof e.type!="string")throw Error("Invalid or missing pushServerOpts.type parameter value");if(!e.token||typeof e.token!="string")throw Error("Invalid or missing pushServerOpts.token parameter value");const n={bridge:this.bridge,topic:this.clientId,type:e.type,token:e.token,peerName:"",language:e.language||""};this.on("connect",async(r,o)=>{if(r)throw r;if(e.peerMeta){const i=o.params[0].peerMeta.name;n.peerName=i}try{if(!(await(await fetch(`${e.url}/new`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})).json()).success)throw Error("Failed to register in Push Server")}catch{throw Error("Failed to register in Push Server")}})}}function ps(t){return ie.getBrowerCrypto().getRandomValues(new Uint8Array(t))}const Pn=256,qn=Pn,ms=Pn,q="AES-CBC",ws=`SHA-${qn}`,Fe="HMAC",ys="encrypt",bs="decrypt",vs="sign",Es="verify";function Cs(t){return t===q?{length:qn,name:q}:{hash:{name:ws},name:Fe}}function Ss(t){return t===q?[ys,bs]:[vs,Es]}async function ft(t,e=q){return ie.getSubtleCrypto().importKey("raw",t,Cs(e),!0,Ss(e))}async function Is(t,e,n){const r=ie.getSubtleCrypto(),o=await ft(e,q),i=await r.encrypt({iv:t,name:q},o,n);return new Uint8Array(i)}async function Rs(t,e,n){const r=ie.getSubtleCrypto(),o=await ft(e,q),i=await r.decrypt({iv:t,name:q},o,n);return new Uint8Array(i)}async function ks(t,e){const n=ie.getSubtleCrypto(),r=await ft(t,Fe),o=await n.sign({length:ms,name:Fe},r,e);return new Uint8Array(o)}function Ts(t,e,n){return Is(t,e,n)}function Ns(t,e,n){return Rs(t,e,n)}async function Dn(t,e){return await ks(t,e)}async function Fn(t){const e=(t||256)/8,n=ps(e);return ln(Z(n))}async function $n(t,e){const n=P(t.data),r=P(t.iv),o=P(t.hmac),i=U(o,!1),s=an(n,r),a=await Dn(e,s),c=U(a,!1);return J(i)===J(c)}async function xs(t,e,n){const r=V(_e(e)),o=n||await Fn(128),i=V(_e(o)),s=U(i,!1),a=JSON.stringify(t),c=rn(a),h=await Ts(i,r,c),_=U(h,!1),v=an(h,i),b=await Dn(r,v),w=U(b,!1);return{data:_,hmac:w,iv:s}}async function Ms(t,e){const n=V(_e(e));if(!n)throw new Error("Missing key: required for decryption");if(!await $n(t,n))return null;const o=P(t.data),i=P(t.iv),s=await Ns(i,n,o),a=tn(s);let c;try{c=JSON.parse(a)}catch{return null}return c}const As=Object.freeze(Object.defineProperty({__proto__:null,decrypt:Ms,encrypt:xs,generateKey:Fn,verifyHmac:$n},Symbol.toStringTag,{value:"Module"}));class Os extends _s{constructor(e,n){super({cryptoLib:As,connectorOpts:e,pushServerOpts:n})}}const Ls=Ft(es);var ae={},Bs=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},jn={},M={};let ht;const Us=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];M.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};M.getSymbolTotalCodewords=function(e){return Us[e]};M.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};M.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');ht=e};M.isKanjiModeEnabled=function(){return typeof ht<"u"};M.toSJIS=function(e){return ht(e)};var Ie={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},t.from=function(r,o){if(t.isValid(r))return r;try{return e(r)}catch{return o}}})(Ie);function Hn(){this.buffer=[],this.length=0}Hn.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ps=Hn;function ce(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}ce.prototype.set=function(t,e,n,r){const o=t*this.size+e;this.data[o]=n,r&&(this.reservedBit[o]=!0)};ce.prototype.get=function(t,e){return this.data[t*this.size+e]};ce.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};ce.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var qs=ce,zn={};(function(t){const e=M.getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const o=Math.floor(r/7)+2,i=e(r),s=i===145?26:Math.ceil((i-13)/(2*o-2))*2,a=[i-7];for(let c=1;c=0&&o<=7},t.from=function(o){return t.isValid(o)?parseInt(o,10):void 0},t.getPenaltyN1=function(o){const i=o.size;let s=0,a=0,c=0,h=null,_=null;for(let v=0;v=5&&(s+=e.N1+(a-5)),h=w,a=1),w=o.get(b,v),w===_?c++:(c>=5&&(s+=e.N1+(c-5)),_=w,c=1)}a>=5&&(s+=e.N1+(a-5)),c>=5&&(s+=e.N1+(c-5))}return s},t.getPenaltyN2=function(o){const i=o.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,c=c<<1&2047|o.get(_,h),_>=10&&(c===1488||c===93)&&s++}return s*e.N3},t.getPenaltyN4=function(o){let i=0;const s=o.data.length;for(let c=0;c=0;){const s=i[0];for(let c=0;c0){const i=new Uint8Array(this.degree);return i.set(r,o),i}return r};var Fs=gt,Kn={},D={},_t={};_t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var A={};const Yn="[0-9]+",$s="[A-Z $%*+\\-./:]+";let oe="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";oe=oe.replace(/u/g,"\\u");const js="(?:(?![A-Z0-9 $%*+\\-./:]|"+oe+`)(?:.|[\r ]))+`;A.KANJI=new RegExp(oe,"g");A.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");A.BYTE=new RegExp(js,"g");A.NUMERIC=new RegExp(Yn,"g");A.ALPHANUMERIC=new RegExp($s,"g");const Hs=new RegExp("^"+oe+"$"),zs=new RegExp("^"+Yn+"$"),Ws=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");A.testKanji=function(e){return Hs.test(e)};A.testNumeric=function(e){return zs.test(e)};A.testAlphanumeric=function(e){return Ws.test(e)};(function(t){const e=_t,n=A;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(i,s){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?i.ccBits[0]:s<27?i.ccBits[1]:i.ccBits[2]},t.getBestModeForData=function(i){return n.testNumeric(i)?t.NUMERIC:n.testAlphanumeric(i)?t.ALPHANUMERIC:n.testKanji(i)?t.KANJI:t.BYTE},t.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},t.isValid=function(i){return i&&i.bit&&i.ccBits};function r(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+o)}}t.from=function(i,s){if(t.isValid(i))return i;try{return r(i)}catch{return s}}})(D);(function(t){const e=M,n=Re,r=Ie,o=D,i=_t,s=7973,a=e.getBCHDigit(s);function c(b,w,E){for(let C=1;C<=40;C++)if(w<=t.getCapacity(C,E,b))return C}function h(b,w){return o.getCharCountIndicator(b,w)+4}function _(b,w){let E=0;return b.forEach(function(C){const I=h(C.mode,w);E+=I+C.getBitsLength()}),E}function v(b,w){for(let E=1;E<=40;E++)if(_(b,E)<=t.getCapacity(E,w,o.MIXED))return E}t.from=function(w,E){return i.isValid(w)?parseInt(w,10):E},t.getCapacity=function(w,E,C){if(!i.isValid(w))throw new Error("Invalid QR Code version");typeof C>"u"&&(C=o.BYTE);const I=e.getSymbolTotalCodewords(w),l=n.getTotalCodewordsCount(w,E),d=(I-l)*8;if(C===o.MIXED)return d;const f=d-h(C,w);switch(C){case o.NUMERIC:return Math.floor(f/10*3);case o.ALPHANUMERIC:return Math.floor(f/11*2);case o.KANJI:return Math.floor(f/13);case o.BYTE:default:return Math.floor(f/8)}},t.getBestVersionForData=function(w,E){let C;const I=r.from(E,r.M);if(Array.isArray(w)){if(w.length>1)return v(w,I);if(w.length===0)return 1;C=w[0]}else C=w;return c(C.mode,C.getLength(),I)},t.getEncodedBits=function(w){if(!i.isValid(w)||w<7)throw new Error("Invalid QR Code version");let E=w<<12;for(;e.getBCHDigit(E)-a>=0;)E^=s<=0;)o^=Zn<<$e.getBCHDigit(o)-Rt;return(r<<10|o)^Vs};var Xn={};const Js=D;function Q(t){this.mode=Js.NUMERIC,this.data=t.toString()}Q.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Q.prototype.getLength=function(){return this.data.length};Q.prototype.getBitsLength=function(){return Q.getBitsLength(this.data.length)};Q.prototype.write=function(e){let n,r,o;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),o=parseInt(r,10),e.put(o,10);const i=this.data.length-n;i>0&&(r=this.data.substr(n),o=parseInt(r,10),e.put(o,i*3+1))};var Qs=Q;const Ks=D,xe=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function K(t){this.mode=Ks.ALPHANUMERIC,this.data=t}K.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};K.prototype.getLength=function(){return this.data.length};K.prototype.getBitsLength=function(){return K.getBitsLength(this.data.length)};K.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let r=xe.indexOf(this.data[n])*45;r+=xe.indexOf(this.data[n+1]),e.put(r,11)}this.data.length%2&&e.put(xe.indexOf(this.data[n]),6)};var Ys=K;const Gs=lo,Zs=D;function Y(t){this.mode=Zs.BYTE,typeof t=="string"&&(t=Gs(t)),this.data=new Uint8Array(t)}Y.getBitsLength=function(e){return e*8};Y.prototype.getLength=function(){return this.data.length};Y.prototype.getBitsLength=function(){return Y.getBitsLength(this.data.length)};Y.prototype.write=function(t){for(let e=0,n=this.data.length;e=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var na=G;(function(t){const e=D,n=Qs,r=Ys,o=Xs,i=na,s=A,a=M,c=uo;function h(l){return unescape(encodeURIComponent(l)).length}function _(l,d,f){const u=[];let g;for(;(g=l.exec(f))!==null;)u.push({data:g[0],index:g.index,mode:d,length:g[0].length});return u}function v(l){const d=_(s.NUMERIC,e.NUMERIC,l),f=_(s.ALPHANUMERIC,e.ALPHANUMERIC,l);let u,g;return a.isKanjiModeEnabled()?(u=_(s.BYTE,e.BYTE,l),g=_(s.KANJI,e.KANJI,l)):(u=_(s.BYTE_KANJI,e.BYTE,l),g=[]),d.concat(f,u,g).sort(function(m,S){return m.index-S.index}).map(function(m){return{data:m.data,mode:m.mode,length:m.length}})}function b(l,d){switch(d){case e.NUMERIC:return n.getBitsLength(l);case e.ALPHANUMERIC:return r.getBitsLength(l);case e.KANJI:return i.getBitsLength(l);case e.BYTE:return o.getBitsLength(l)}}function w(l){return l.reduce(function(d,f){const u=d.length-1>=0?d[d.length-1]:null;return u&&u.mode===f.mode?(d[d.length-1].data+=f.data,d):(d.push(f),d)},[])}function E(l){const d=[];for(let f=0;f=0&&a<=6&&(c===0||c===6)||c>=0&&c<=6&&(a===0||a===6)||a>=2&&a<=4&&c>=2&&c<=4?t.set(i+a,s+c,!0,!0):t.set(i+a,s+c,!1,!0))}}function da(t){const e=t.size;for(let n=8;n>a&1)===1,t.set(o,i,s,!0),t.set(i,o,s,!0)}function Oe(t,e,n){const r=t.size,o=ca.getEncodedBits(e,n);let i,s;for(i=0;i<15;i++)s=(o>>i&1)===1,i<6?t.set(i,8,s,!0):i<8?t.set(i+1,8,s,!0):t.set(r-15+i,8,s,!0),i<8?t.set(8,r-i-1,s,!0):i<9?t.set(8,15-i-1+1,s,!0):t.set(8,15-i-1,s,!0);t.set(r-8,8,1,!0)}function ga(t,e){const n=t.size;let r=-1,o=n-1,i=7,s=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let c=0;c<2;c++)if(!t.isReserved(o,a-c)){let h=!1;s>>i&1)===1),t.set(o,a-c,h),i--,i===-1&&(s++,i=7)}if(o+=r,o<0||n<=o){o-=r,r=-r;break}}}function _a(t,e,n){const r=new ra;n.forEach(function(c){r.put(c.mode.bit,4),r.put(c.getLength(),la.getCharCountIndicator(c.mode,t)),c.write(r)});const o=Te.getSymbolTotalCodewords(t),i=He.getTotalCodewordsCount(t,e),s=(o-i)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const a=(s-r.getLengthInBits())/8;for(let c=0;cn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var mu={},$i={},Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.walletLogo=void 0;const Yp=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Zs.walletLogo=Yp;var Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.LINK_API_URL=void 0;Qs.LINK_API_URL="https://www.walletlink.org";var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.ScopedLocalStorage=void 0;class Kp{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}Ys.ScopedLocalStorage=Kp;var Qn={},gn={};Object.defineProperty(gn,"__esModule",{value:!0});const Xp=yu;function Ic(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function e0(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")Ic(s,this,r);else{const o=s.length,a=e0(s);for(let c=0;c0?u:h},s.min=function(u,h){return u.cmp(h)<0?u:h},s.prototype._init=function(u,h,p){if(typeof u=="number")return this._initNumber(u,h,p);if(typeof u=="object")return this._initArray(u,h,p);h==="hex"&&(h=16),n(h===(h|0)&&h>=2&&h<=36),u=u.toString().replace(/\s+/g,"");var y=0;u[0]==="-"&&(y++,this.negative=1),y=0;y-=3)x=u[y]|u[y-1]<<8|u[y-2]<<16,this.words[w]|=x<>>26-T&67108863,T+=24,T>=26&&(T-=26,w++);else if(p==="le")for(y=0,w=0;y>>26-T&67108863,T+=24,T>=26&&(T-=26,w++);return this._strip()};function a(v,u){var h=v.charCodeAt(u);if(h>=48&&h<=57)return h-48;if(h>=65&&h<=70)return h-55;if(h>=97&&h<=102)return h-87;n(!1,"Invalid character in "+v)}function c(v,u,h){var p=a(v,h);return h-1>=u&&(p|=a(v,h-1)<<4),p}s.prototype._parseHex=function(u,h,p){this.length=Math.ceil((u.length-h)/6),this.words=new Array(this.length);for(var y=0;y=h;y-=2)T=c(u,h,y)<=18?(w-=18,x+=1,this.words[x]|=T>>>26):w+=8;else{var m=u.length-h;for(y=m%2===0?h+1:h;y=18?(w-=18,x+=1,this.words[x]|=T>>>26):w+=8}this._strip()};function l(v,u,h,p){for(var y=0,w=0,x=Math.min(v.length,h),T=u;T=49?w=m-49+10:m>=17?w=m-17+10:w=m,n(m>=0&&w1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{s.prototype.inspect=g}else s.prototype.inspect=g;function g(){return(this.red?""}var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(u,h){u=u||10,h=h|0||1;var p;if(u===16||u==="hex"){p="";for(var y=0,w=0,x=0;x>>24-y&16777215,y+=2,y>=26&&(y-=26,x--),w!==0||x!==this.length-1?p=b[6-m.length]+m+p:p=m+p}for(w!==0&&(p=w.toString(16)+p);p.length%h!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(u===(u|0)&&u>=2&&u<=36){var f=C[u],E=A[u];p="";var U=this.clone();for(U.negative=0;!U.isZero();){var q=U.modrn(E).toString(u);U=U.idivn(E),U.isZero()?p=q+p:p=b[f-q.length]+q+p}for(this.isZero()&&(p="0"+p);p.length%h!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=this.words[1]*67108864:this.length===3&&this.words[2]===1?u+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(u,h){return this.toArrayLike(o,u,h)}),s.prototype.toArray=function(u,h){return this.toArrayLike(Array,u,h)};var P=function(u,h){return u.allocUnsafe?u.allocUnsafe(h):new u(h)};s.prototype.toArrayLike=function(u,h,p){this._strip();var y=this.byteLength(),w=p||Math.max(1,y);n(y<=w,"byte array longer than desired length"),n(w>0,"Requested array length <= 0");var x=P(u,w),T=h==="le"?"LE":"BE";return this["_toArrayLike"+T](x,y),x},s.prototype._toArrayLikeLE=function(u,h){for(var p=0,y=0,w=0,x=0;w>8&255),p>16&255),x===6?(p>24&255),y=0,x=0):(y=T>>>24,x+=2)}if(p=0&&(u[p--]=T>>8&255),p>=0&&(u[p--]=T>>16&255),x===6?(p>=0&&(u[p--]=T>>24&255),y=0,x=0):(y=T>>>24,x+=2)}if(p>=0)for(u[p--]=y;p>=0;)u[p--]=0},Math.clz32?s.prototype._countBits=function(u){return 32-Math.clz32(u)}:s.prototype._countBits=function(u){var h=u,p=0;return h>=4096&&(p+=13,h>>>=13),h>=64&&(p+=7,h>>>=7),h>=8&&(p+=4,h>>>=4),h>=2&&(p+=2,h>>>=2),p+h},s.prototype._zeroBits=function(u){if(u===0)return 26;var h=u,p=0;return h&8191||(p+=13,h>>>=13),h&127||(p+=7,h>>>=7),h&15||(p+=4,h>>>=4),h&3||(p+=2,h>>>=2),h&1||p++,p},s.prototype.bitLength=function(){var u=this.words[this.length-1],h=this._countBits(u);return(this.length-1)*26+h};function N(v){for(var u=new Array(v.bitLength()),h=0;h>>y&1}return u}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,h=0;hu.length?this.clone().ior(u):u.clone().ior(this)},s.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},s.prototype.iuand=function(u){var h;this.length>u.length?h=u:h=this;for(var p=0;pu.length?this.clone().iand(u):u.clone().iand(this)},s.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},s.prototype.iuxor=function(u){var h,p;this.length>u.length?(h=this,p=u):(h=u,p=this);for(var y=0;yu.length?this.clone().ixor(u):u.clone().ixor(this)},s.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},s.prototype.inotn=function(u){n(typeof u=="number"&&u>=0);var h=Math.ceil(u/26)|0,p=u%26;this._expand(h),p>0&&h--;for(var y=0;y0&&(this.words[y]=~this.words[y]&67108863>>26-p),this._strip()},s.prototype.notn=function(u){return this.clone().inotn(u)},s.prototype.setn=function(u,h){n(typeof u=="number"&&u>=0);var p=u/26|0,y=u%26;return this._expand(p+1),h?this.words[p]=this.words[p]|1<u.length?(p=this,y=u):(p=u,y=this);for(var w=0,x=0;x>>26;for(;w!==0&&x>>26;if(this.length=p.length,w!==0)this.words[this.length]=w,this.length++;else if(p!==this)for(;xu.length?this.clone().iadd(u):u.clone().iadd(this)},s.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var h=this.iadd(u);return u.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var p=this.cmp(u);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var y,w;p>0?(y=this,w=u):(y=u,w=this);for(var x=0,T=0;T>26,this.words[T]=h&67108863;for(;x!==0&&T>26,this.words[T]=h&67108863;if(x===0&&T>>26,U=m&67108863,q=Math.min(f,u.length-1),I=Math.max(0,f-v.length+1);I<=q;I++){var k=f-I|0;y=v.words[k]|0,w=u.words[I]|0,x=y*w+U,E+=x/67108864|0,U=x&67108863}h.words[f]=U|0,m=E|0}return m!==0?h.words[f]=m|0:h.length--,h._strip()}var R=function(u,h,p){var y=u.words,w=h.words,x=p.words,T=0,m,f,E,U=y[0]|0,q=U&8191,I=U>>>13,k=y[1]|0,$=k&8191,V=k>>>13,se=y[2]|0,_=se&8191,S=se>>>13,F=y[3]|0,H=F&8191,re=F>>>13,ie=y[4]|0,ee=ie&8191,de=ie>>>13,Qt=y[5]|0,we=Qt&8191,Se=Qt>>>13,mr=y[6]|0,ve=mr&8191,ye=mr>>>13,lr=y[7]|0,be=lr&8191,pe=lr>>>13,xt=y[8]|0,Ee=xt&8191,Me=xt>>>13,En=y[9]|0,xe=En&8191,Ce=En>>>13,Mn=w[0]|0,Re=Mn&8191,Ie=Mn>>>13,xn=w[1]|0,Ae=xn&8191,Te=xn>>>13,Cn=w[2]|0,ke=Cn&8191,Oe=Cn>>>13,Rn=w[3]|0,Ne=Rn&8191,Le=Rn>>>13,In=w[4]|0,Pe=In&8191,De=In>>>13,An=w[5]|0,$e=An&8191,Be=An>>>13,Tn=w[6]|0,je=Tn&8191,Fe=Tn>>>13,kn=w[7]|0,We=kn&8191,He=kn>>>13,On=w[8]|0,Ve=On&8191,Ue=On>>>13,Nn=w[9]|0,ze=Nn&8191,qe=Nn>>>13;p.negative=u.negative^h.negative,p.length=19,m=Math.imul(q,Re),f=Math.imul(q,Ie),f=f+Math.imul(I,Re)|0,E=Math.imul(I,Ie);var Dr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,m=Math.imul($,Re),f=Math.imul($,Ie),f=f+Math.imul(V,Re)|0,E=Math.imul(V,Ie),m=m+Math.imul(q,Ae)|0,f=f+Math.imul(q,Te)|0,f=f+Math.imul(I,Ae)|0,E=E+Math.imul(I,Te)|0;var $r=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+($r>>>26)|0,$r&=67108863,m=Math.imul(_,Re),f=Math.imul(_,Ie),f=f+Math.imul(S,Re)|0,E=Math.imul(S,Ie),m=m+Math.imul($,Ae)|0,f=f+Math.imul($,Te)|0,f=f+Math.imul(V,Ae)|0,E=E+Math.imul(V,Te)|0,m=m+Math.imul(q,ke)|0,f=f+Math.imul(q,Oe)|0,f=f+Math.imul(I,ke)|0,E=E+Math.imul(I,Oe)|0;var Br=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Br>>>26)|0,Br&=67108863,m=Math.imul(H,Re),f=Math.imul(H,Ie),f=f+Math.imul(re,Re)|0,E=Math.imul(re,Ie),m=m+Math.imul(_,Ae)|0,f=f+Math.imul(_,Te)|0,f=f+Math.imul(S,Ae)|0,E=E+Math.imul(S,Te)|0,m=m+Math.imul($,ke)|0,f=f+Math.imul($,Oe)|0,f=f+Math.imul(V,ke)|0,E=E+Math.imul(V,Oe)|0,m=m+Math.imul(q,Ne)|0,f=f+Math.imul(q,Le)|0,f=f+Math.imul(I,Ne)|0,E=E+Math.imul(I,Le)|0;var jr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(jr>>>26)|0,jr&=67108863,m=Math.imul(ee,Re),f=Math.imul(ee,Ie),f=f+Math.imul(de,Re)|0,E=Math.imul(de,Ie),m=m+Math.imul(H,Ae)|0,f=f+Math.imul(H,Te)|0,f=f+Math.imul(re,Ae)|0,E=E+Math.imul(re,Te)|0,m=m+Math.imul(_,ke)|0,f=f+Math.imul(_,Oe)|0,f=f+Math.imul(S,ke)|0,E=E+Math.imul(S,Oe)|0,m=m+Math.imul($,Ne)|0,f=f+Math.imul($,Le)|0,f=f+Math.imul(V,Ne)|0,E=E+Math.imul(V,Le)|0,m=m+Math.imul(q,Pe)|0,f=f+Math.imul(q,De)|0,f=f+Math.imul(I,Pe)|0,E=E+Math.imul(I,De)|0;var Fr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,m=Math.imul(we,Re),f=Math.imul(we,Ie),f=f+Math.imul(Se,Re)|0,E=Math.imul(Se,Ie),m=m+Math.imul(ee,Ae)|0,f=f+Math.imul(ee,Te)|0,f=f+Math.imul(de,Ae)|0,E=E+Math.imul(de,Te)|0,m=m+Math.imul(H,ke)|0,f=f+Math.imul(H,Oe)|0,f=f+Math.imul(re,ke)|0,E=E+Math.imul(re,Oe)|0,m=m+Math.imul(_,Ne)|0,f=f+Math.imul(_,Le)|0,f=f+Math.imul(S,Ne)|0,E=E+Math.imul(S,Le)|0,m=m+Math.imul($,Pe)|0,f=f+Math.imul($,De)|0,f=f+Math.imul(V,Pe)|0,E=E+Math.imul(V,De)|0,m=m+Math.imul(q,$e)|0,f=f+Math.imul(q,Be)|0,f=f+Math.imul(I,$e)|0,E=E+Math.imul(I,Be)|0;var Wr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,m=Math.imul(ve,Re),f=Math.imul(ve,Ie),f=f+Math.imul(ye,Re)|0,E=Math.imul(ye,Ie),m=m+Math.imul(we,Ae)|0,f=f+Math.imul(we,Te)|0,f=f+Math.imul(Se,Ae)|0,E=E+Math.imul(Se,Te)|0,m=m+Math.imul(ee,ke)|0,f=f+Math.imul(ee,Oe)|0,f=f+Math.imul(de,ke)|0,E=E+Math.imul(de,Oe)|0,m=m+Math.imul(H,Ne)|0,f=f+Math.imul(H,Le)|0,f=f+Math.imul(re,Ne)|0,E=E+Math.imul(re,Le)|0,m=m+Math.imul(_,Pe)|0,f=f+Math.imul(_,De)|0,f=f+Math.imul(S,Pe)|0,E=E+Math.imul(S,De)|0,m=m+Math.imul($,$e)|0,f=f+Math.imul($,Be)|0,f=f+Math.imul(V,$e)|0,E=E+Math.imul(V,Be)|0,m=m+Math.imul(q,je)|0,f=f+Math.imul(q,Fe)|0,f=f+Math.imul(I,je)|0,E=E+Math.imul(I,Fe)|0;var Hr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,m=Math.imul(be,Re),f=Math.imul(be,Ie),f=f+Math.imul(pe,Re)|0,E=Math.imul(pe,Ie),m=m+Math.imul(ve,Ae)|0,f=f+Math.imul(ve,Te)|0,f=f+Math.imul(ye,Ae)|0,E=E+Math.imul(ye,Te)|0,m=m+Math.imul(we,ke)|0,f=f+Math.imul(we,Oe)|0,f=f+Math.imul(Se,ke)|0,E=E+Math.imul(Se,Oe)|0,m=m+Math.imul(ee,Ne)|0,f=f+Math.imul(ee,Le)|0,f=f+Math.imul(de,Ne)|0,E=E+Math.imul(de,Le)|0,m=m+Math.imul(H,Pe)|0,f=f+Math.imul(H,De)|0,f=f+Math.imul(re,Pe)|0,E=E+Math.imul(re,De)|0,m=m+Math.imul(_,$e)|0,f=f+Math.imul(_,Be)|0,f=f+Math.imul(S,$e)|0,E=E+Math.imul(S,Be)|0,m=m+Math.imul($,je)|0,f=f+Math.imul($,Fe)|0,f=f+Math.imul(V,je)|0,E=E+Math.imul(V,Fe)|0,m=m+Math.imul(q,We)|0,f=f+Math.imul(q,He)|0,f=f+Math.imul(I,We)|0,E=E+Math.imul(I,He)|0;var Vr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,m=Math.imul(Ee,Re),f=Math.imul(Ee,Ie),f=f+Math.imul(Me,Re)|0,E=Math.imul(Me,Ie),m=m+Math.imul(be,Ae)|0,f=f+Math.imul(be,Te)|0,f=f+Math.imul(pe,Ae)|0,E=E+Math.imul(pe,Te)|0,m=m+Math.imul(ve,ke)|0,f=f+Math.imul(ve,Oe)|0,f=f+Math.imul(ye,ke)|0,E=E+Math.imul(ye,Oe)|0,m=m+Math.imul(we,Ne)|0,f=f+Math.imul(we,Le)|0,f=f+Math.imul(Se,Ne)|0,E=E+Math.imul(Se,Le)|0,m=m+Math.imul(ee,Pe)|0,f=f+Math.imul(ee,De)|0,f=f+Math.imul(de,Pe)|0,E=E+Math.imul(de,De)|0,m=m+Math.imul(H,$e)|0,f=f+Math.imul(H,Be)|0,f=f+Math.imul(re,$e)|0,E=E+Math.imul(re,Be)|0,m=m+Math.imul(_,je)|0,f=f+Math.imul(_,Fe)|0,f=f+Math.imul(S,je)|0,E=E+Math.imul(S,Fe)|0,m=m+Math.imul($,We)|0,f=f+Math.imul($,He)|0,f=f+Math.imul(V,We)|0,E=E+Math.imul(V,He)|0,m=m+Math.imul(q,Ve)|0,f=f+Math.imul(q,Ue)|0,f=f+Math.imul(I,Ve)|0,E=E+Math.imul(I,Ue)|0;var Ur=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,m=Math.imul(xe,Re),f=Math.imul(xe,Ie),f=f+Math.imul(Ce,Re)|0,E=Math.imul(Ce,Ie),m=m+Math.imul(Ee,Ae)|0,f=f+Math.imul(Ee,Te)|0,f=f+Math.imul(Me,Ae)|0,E=E+Math.imul(Me,Te)|0,m=m+Math.imul(be,ke)|0,f=f+Math.imul(be,Oe)|0,f=f+Math.imul(pe,ke)|0,E=E+Math.imul(pe,Oe)|0,m=m+Math.imul(ve,Ne)|0,f=f+Math.imul(ve,Le)|0,f=f+Math.imul(ye,Ne)|0,E=E+Math.imul(ye,Le)|0,m=m+Math.imul(we,Pe)|0,f=f+Math.imul(we,De)|0,f=f+Math.imul(Se,Pe)|0,E=E+Math.imul(Se,De)|0,m=m+Math.imul(ee,$e)|0,f=f+Math.imul(ee,Be)|0,f=f+Math.imul(de,$e)|0,E=E+Math.imul(de,Be)|0,m=m+Math.imul(H,je)|0,f=f+Math.imul(H,Fe)|0,f=f+Math.imul(re,je)|0,E=E+Math.imul(re,Fe)|0,m=m+Math.imul(_,We)|0,f=f+Math.imul(_,He)|0,f=f+Math.imul(S,We)|0,E=E+Math.imul(S,He)|0,m=m+Math.imul($,Ve)|0,f=f+Math.imul($,Ue)|0,f=f+Math.imul(V,Ve)|0,E=E+Math.imul(V,Ue)|0,m=m+Math.imul(q,ze)|0,f=f+Math.imul(q,qe)|0,f=f+Math.imul(I,ze)|0,E=E+Math.imul(I,qe)|0;var zr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(zr>>>26)|0,zr&=67108863,m=Math.imul(xe,Ae),f=Math.imul(xe,Te),f=f+Math.imul(Ce,Ae)|0,E=Math.imul(Ce,Te),m=m+Math.imul(Ee,ke)|0,f=f+Math.imul(Ee,Oe)|0,f=f+Math.imul(Me,ke)|0,E=E+Math.imul(Me,Oe)|0,m=m+Math.imul(be,Ne)|0,f=f+Math.imul(be,Le)|0,f=f+Math.imul(pe,Ne)|0,E=E+Math.imul(pe,Le)|0,m=m+Math.imul(ve,Pe)|0,f=f+Math.imul(ve,De)|0,f=f+Math.imul(ye,Pe)|0,E=E+Math.imul(ye,De)|0,m=m+Math.imul(we,$e)|0,f=f+Math.imul(we,Be)|0,f=f+Math.imul(Se,$e)|0,E=E+Math.imul(Se,Be)|0,m=m+Math.imul(ee,je)|0,f=f+Math.imul(ee,Fe)|0,f=f+Math.imul(de,je)|0,E=E+Math.imul(de,Fe)|0,m=m+Math.imul(H,We)|0,f=f+Math.imul(H,He)|0,f=f+Math.imul(re,We)|0,E=E+Math.imul(re,He)|0,m=m+Math.imul(_,Ve)|0,f=f+Math.imul(_,Ue)|0,f=f+Math.imul(S,Ve)|0,E=E+Math.imul(S,Ue)|0,m=m+Math.imul($,ze)|0,f=f+Math.imul($,qe)|0,f=f+Math.imul(V,ze)|0,E=E+Math.imul(V,qe)|0;var qr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(qr>>>26)|0,qr&=67108863,m=Math.imul(xe,ke),f=Math.imul(xe,Oe),f=f+Math.imul(Ce,ke)|0,E=Math.imul(Ce,Oe),m=m+Math.imul(Ee,Ne)|0,f=f+Math.imul(Ee,Le)|0,f=f+Math.imul(Me,Ne)|0,E=E+Math.imul(Me,Le)|0,m=m+Math.imul(be,Pe)|0,f=f+Math.imul(be,De)|0,f=f+Math.imul(pe,Pe)|0,E=E+Math.imul(pe,De)|0,m=m+Math.imul(ve,$e)|0,f=f+Math.imul(ve,Be)|0,f=f+Math.imul(ye,$e)|0,E=E+Math.imul(ye,Be)|0,m=m+Math.imul(we,je)|0,f=f+Math.imul(we,Fe)|0,f=f+Math.imul(Se,je)|0,E=E+Math.imul(Se,Fe)|0,m=m+Math.imul(ee,We)|0,f=f+Math.imul(ee,He)|0,f=f+Math.imul(de,We)|0,E=E+Math.imul(de,He)|0,m=m+Math.imul(H,Ve)|0,f=f+Math.imul(H,Ue)|0,f=f+Math.imul(re,Ve)|0,E=E+Math.imul(re,Ue)|0,m=m+Math.imul(_,ze)|0,f=f+Math.imul(_,qe)|0,f=f+Math.imul(S,ze)|0,E=E+Math.imul(S,qe)|0;var Gr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,m=Math.imul(xe,Ne),f=Math.imul(xe,Le),f=f+Math.imul(Ce,Ne)|0,E=Math.imul(Ce,Le),m=m+Math.imul(Ee,Pe)|0,f=f+Math.imul(Ee,De)|0,f=f+Math.imul(Me,Pe)|0,E=E+Math.imul(Me,De)|0,m=m+Math.imul(be,$e)|0,f=f+Math.imul(be,Be)|0,f=f+Math.imul(pe,$e)|0,E=E+Math.imul(pe,Be)|0,m=m+Math.imul(ve,je)|0,f=f+Math.imul(ve,Fe)|0,f=f+Math.imul(ye,je)|0,E=E+Math.imul(ye,Fe)|0,m=m+Math.imul(we,We)|0,f=f+Math.imul(we,He)|0,f=f+Math.imul(Se,We)|0,E=E+Math.imul(Se,He)|0,m=m+Math.imul(ee,Ve)|0,f=f+Math.imul(ee,Ue)|0,f=f+Math.imul(de,Ve)|0,E=E+Math.imul(de,Ue)|0,m=m+Math.imul(H,ze)|0,f=f+Math.imul(H,qe)|0,f=f+Math.imul(re,ze)|0,E=E+Math.imul(re,qe)|0;var Jr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,m=Math.imul(xe,Pe),f=Math.imul(xe,De),f=f+Math.imul(Ce,Pe)|0,E=Math.imul(Ce,De),m=m+Math.imul(Ee,$e)|0,f=f+Math.imul(Ee,Be)|0,f=f+Math.imul(Me,$e)|0,E=E+Math.imul(Me,Be)|0,m=m+Math.imul(be,je)|0,f=f+Math.imul(be,Fe)|0,f=f+Math.imul(pe,je)|0,E=E+Math.imul(pe,Fe)|0,m=m+Math.imul(ve,We)|0,f=f+Math.imul(ve,He)|0,f=f+Math.imul(ye,We)|0,E=E+Math.imul(ye,He)|0,m=m+Math.imul(we,Ve)|0,f=f+Math.imul(we,Ue)|0,f=f+Math.imul(Se,Ve)|0,E=E+Math.imul(Se,Ue)|0,m=m+Math.imul(ee,ze)|0,f=f+Math.imul(ee,qe)|0,f=f+Math.imul(de,ze)|0,E=E+Math.imul(de,qe)|0;var Zr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,m=Math.imul(xe,$e),f=Math.imul(xe,Be),f=f+Math.imul(Ce,$e)|0,E=Math.imul(Ce,Be),m=m+Math.imul(Ee,je)|0,f=f+Math.imul(Ee,Fe)|0,f=f+Math.imul(Me,je)|0,E=E+Math.imul(Me,Fe)|0,m=m+Math.imul(be,We)|0,f=f+Math.imul(be,He)|0,f=f+Math.imul(pe,We)|0,E=E+Math.imul(pe,He)|0,m=m+Math.imul(ve,Ve)|0,f=f+Math.imul(ve,Ue)|0,f=f+Math.imul(ye,Ve)|0,E=E+Math.imul(ye,Ue)|0,m=m+Math.imul(we,ze)|0,f=f+Math.imul(we,qe)|0,f=f+Math.imul(Se,ze)|0,E=E+Math.imul(Se,qe)|0;var ea=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(ea>>>26)|0,ea&=67108863,m=Math.imul(xe,je),f=Math.imul(xe,Fe),f=f+Math.imul(Ce,je)|0,E=Math.imul(Ce,Fe),m=m+Math.imul(Ee,We)|0,f=f+Math.imul(Ee,He)|0,f=f+Math.imul(Me,We)|0,E=E+Math.imul(Me,He)|0,m=m+Math.imul(be,Ve)|0,f=f+Math.imul(be,Ue)|0,f=f+Math.imul(pe,Ve)|0,E=E+Math.imul(pe,Ue)|0,m=m+Math.imul(ve,ze)|0,f=f+Math.imul(ve,qe)|0,f=f+Math.imul(ye,ze)|0,E=E+Math.imul(ye,qe)|0;var ta=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(ta>>>26)|0,ta&=67108863,m=Math.imul(xe,We),f=Math.imul(xe,He),f=f+Math.imul(Ce,We)|0,E=Math.imul(Ce,He),m=m+Math.imul(Ee,Ve)|0,f=f+Math.imul(Ee,Ue)|0,f=f+Math.imul(Me,Ve)|0,E=E+Math.imul(Me,Ue)|0,m=m+Math.imul(be,ze)|0,f=f+Math.imul(be,qe)|0,f=f+Math.imul(pe,ze)|0,E=E+Math.imul(pe,qe)|0;var ra=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(ra>>>26)|0,ra&=67108863,m=Math.imul(xe,Ve),f=Math.imul(xe,Ue),f=f+Math.imul(Ce,Ve)|0,E=Math.imul(Ce,Ue),m=m+Math.imul(Ee,ze)|0,f=f+Math.imul(Ee,qe)|0,f=f+Math.imul(Me,ze)|0,E=E+Math.imul(Me,qe)|0;var na=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(na>>>26)|0,na&=67108863,m=Math.imul(xe,ze),f=Math.imul(xe,qe),f=f+Math.imul(Ce,ze)|0,E=Math.imul(Ce,qe);var ia=(T+m|0)+((f&8191)<<13)|0;return T=(E+(f>>>13)|0)+(ia>>>26)|0,ia&=67108863,x[0]=Dr,x[1]=$r,x[2]=Br,x[3]=jr,x[4]=Fr,x[5]=Wr,x[6]=Hr,x[7]=Vr,x[8]=Ur,x[9]=zr,x[10]=qr,x[11]=Gr,x[12]=Jr,x[13]=Zr,x[14]=ea,x[15]=ta,x[16]=ra,x[17]=na,x[18]=ia,T!==0&&(x[19]=T,p.length++),p};Math.imul||(R=M);function O(v,u,h){h.negative=u.negative^v.negative,h.length=v.length+u.length;for(var p=0,y=0,w=0;w>>26)|0,y+=x>>>26,x&=67108863}h.words[w]=T,p=x,x=y}return p!==0?h.words[w]=p:h.length--,h._strip()}function D(v,u,h){return O(v,u,h)}s.prototype.mulTo=function(u,h){var p,y=this.length+u.length;return this.length===10&&u.length===10?p=R(this,u,h):y<63?p=M(this,u,h):y<1024?p=O(this,u,h):p=D(this,u,h),p},s.prototype.mul=function(u){var h=new s(null);return h.words=new Array(this.length+u.length),this.mulTo(u,h)},s.prototype.mulf=function(u){var h=new s(null);return h.words=new Array(this.length+u.length),D(this,u,h)},s.prototype.imul=function(u){return this.clone().mulTo(u,this)},s.prototype.imuln=function(u){var h=u<0;h&&(u=-u),n(typeof u=="number"),n(u<67108864);for(var p=0,y=0;y>=26,p+=w/67108864|0,p+=x>>>26,this.words[y]=x&67108863}return p!==0&&(this.words[y]=p,this.length++),h?this.ineg():this},s.prototype.muln=function(u){return this.clone().imuln(u)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(u){var h=N(u);if(h.length===0)return new s(1);for(var p=this,y=0;y=0);var h=u%26,p=(u-h)/26,y=67108863>>>26-h<<26-h,w;if(h!==0){var x=0;for(w=0;w>>26-h}x&&(this.words[w]=x,this.length++)}if(p!==0){for(w=this.length-1;w>=0;w--)this.words[w+p]=this.words[w];for(w=0;w=0);var y;h?y=(h-h%26)/26:y=0;var w=u%26,x=Math.min((u-w)/26,this.length),T=67108863^67108863>>>w<x)for(this.length-=x,f=0;f=0&&(E!==0||f>=y);f--){var U=this.words[f]|0;this.words[f]=E<<26-w|U>>>w,E=U&T}return m&&E!==0&&(m.words[m.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(u,h,p){return n(this.negative===0),this.iushrn(u,h,p)},s.prototype.shln=function(u){return this.clone().ishln(u)},s.prototype.ushln=function(u){return this.clone().iushln(u)},s.prototype.shrn=function(u){return this.clone().ishrn(u)},s.prototype.ushrn=function(u){return this.clone().iushrn(u)},s.prototype.testn=function(u){n(typeof u=="number"&&u>=0);var h=u%26,p=(u-h)/26,y=1<=0);var h=u%26,p=(u-h)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(h!==0&&p++,this.length=Math.min(p,this.length),h!==0){var y=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(u){if(n(typeof u=="number"),n(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-(m/67108864|0),this.words[w+p]=x&67108863}for(;w>26,this.words[w+p]=x&67108863;if(T===0)return this._strip();for(n(T===-1),T=0,w=0;w>26,this.words[w]=x&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(u,h){var p=this.length-u.length,y=this.clone(),w=u,x=w.words[w.length-1]|0,T=this._countBits(x);p=26-T,p!==0&&(w=w.ushln(p),y.iushln(p),x=w.words[w.length-1]|0);var m=y.length-w.length,f;if(h!=="mod"){f=new s(null),f.length=m+1,f.words=new Array(f.length);for(var E=0;E=0;q--){var I=(y.words[w.length+q]|0)*67108864+(y.words[w.length+q-1]|0);for(I=Math.min(I/x|0,67108863),y._ishlnsubmul(w,I,q);y.negative!==0;)I--,y.negative=0,y._ishlnsubmul(w,1,q),y.isZero()||(y.negative^=1);f&&(f.words[q]=I)}return f&&f._strip(),y._strip(),h!=="div"&&p!==0&&y.iushrn(p),{div:f||null,mod:y}},s.prototype.divmod=function(u,h,p){if(n(!u.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var y,w,x;return this.negative!==0&&u.negative===0?(x=this.neg().divmod(u,h),h!=="mod"&&(y=x.div.neg()),h!=="div"&&(w=x.mod.neg(),p&&w.negative!==0&&w.iadd(u)),{div:y,mod:w}):this.negative===0&&u.negative!==0?(x=this.divmod(u.neg(),h),h!=="mod"&&(y=x.div.neg()),{div:y,mod:x.mod}):this.negative&u.negative?(x=this.neg().divmod(u.neg(),h),h!=="div"&&(w=x.mod.neg(),p&&w.negative!==0&&w.isub(u)),{div:x.div,mod:w}):u.length>this.length||this.cmp(u)<0?{div:new s(0),mod:this}:u.length===1?h==="div"?{div:this.divn(u.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modrn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new s(this.modrn(u.words[0]))}:this._wordDiv(u,h)},s.prototype.div=function(u){return this.divmod(u,"div",!1).div},s.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},s.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},s.prototype.divRound=function(u){var h=this.divmod(u);if(h.mod.isZero())return h.div;var p=h.div.negative!==0?h.mod.isub(u):h.mod,y=u.ushrn(1),w=u.andln(1),x=p.cmp(y);return x<0||w===1&&x===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modrn=function(u){var h=u<0;h&&(u=-u),n(u<=67108863);for(var p=(1<<26)%u,y=0,w=this.length-1;w>=0;w--)y=(p*y+(this.words[w]|0))%u;return h?-y:y},s.prototype.modn=function(u){return this.modrn(u)},s.prototype.idivn=function(u){var h=u<0;h&&(u=-u),n(u<=67108863);for(var p=0,y=this.length-1;y>=0;y--){var w=(this.words[y]|0)+p*67108864;this.words[y]=w/u|0,p=w%u}return this._strip(),h?this.ineg():this},s.prototype.divn=function(u){return this.clone().idivn(u)},s.prototype.egcd=function(u){n(u.negative===0),n(!u.isZero());var h=this,p=u.clone();h.negative!==0?h=h.umod(u):h=h.clone();for(var y=new s(1),w=new s(0),x=new s(0),T=new s(1),m=0;h.isEven()&&p.isEven();)h.iushrn(1),p.iushrn(1),++m;for(var f=p.clone(),E=h.clone();!h.isZero();){for(var U=0,q=1;!(h.words[0]&q)&&U<26;++U,q<<=1);if(U>0)for(h.iushrn(U);U-- >0;)(y.isOdd()||w.isOdd())&&(y.iadd(f),w.isub(E)),y.iushrn(1),w.iushrn(1);for(var I=0,k=1;!(p.words[0]&k)&&I<26;++I,k<<=1);if(I>0)for(p.iushrn(I);I-- >0;)(x.isOdd()||T.isOdd())&&(x.iadd(f),T.isub(E)),x.iushrn(1),T.iushrn(1);h.cmp(p)>=0?(h.isub(p),y.isub(x),w.isub(T)):(p.isub(h),x.isub(y),T.isub(w))}return{a:x,b:T,gcd:p.iushln(m)}},s.prototype._invmp=function(u){n(u.negative===0),n(!u.isZero());var h=this,p=u.clone();h.negative!==0?h=h.umod(u):h=h.clone();for(var y=new s(1),w=new s(0),x=p.clone();h.cmpn(1)>0&&p.cmpn(1)>0;){for(var T=0,m=1;!(h.words[0]&m)&&T<26;++T,m<<=1);if(T>0)for(h.iushrn(T);T-- >0;)y.isOdd()&&y.iadd(x),y.iushrn(1);for(var f=0,E=1;!(p.words[0]&E)&&f<26;++f,E<<=1);if(f>0)for(p.iushrn(f);f-- >0;)w.isOdd()&&w.iadd(x),w.iushrn(1);h.cmp(p)>=0?(h.isub(p),y.isub(w)):(p.isub(h),w.isub(y))}var U;return h.cmpn(1)===0?U=y:U=w,U.cmpn(0)<0&&U.iadd(u),U},s.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var h=this.clone(),p=u.clone();h.negative=0,p.negative=0;for(var y=0;h.isEven()&&p.isEven();y++)h.iushrn(1),p.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;p.isEven();)p.iushrn(1);var w=h.cmp(p);if(w<0){var x=h;h=p,p=x}else if(w===0||p.cmpn(1)===0)break;h.isub(p)}while(!0);return p.iushln(y)},s.prototype.invm=function(u){return this.egcd(u).a.umod(u)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(u){return this.words[0]&u},s.prototype.bincn=function(u){n(typeof u=="number");var h=u%26,p=(u-h)/26,y=1<>>26,T&=67108863,this.words[x]=T}return w!==0&&(this.words[x]=w,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(u){var h=u<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var p;if(this.length>1)p=1;else{h&&(u=-u),n(u<=67108863,"Number is too big");var y=this.words[0]|0;p=y===u?0:yu.length)return 1;if(this.length=0;p--){var y=this.words[p]|0,w=u.words[p]|0;if(y!==w){yw&&(h=1);break}}return h},s.prototype.gtn=function(u){return this.cmpn(u)===1},s.prototype.gt=function(u){return this.cmp(u)===1},s.prototype.gten=function(u){return this.cmpn(u)>=0},s.prototype.gte=function(u){return this.cmp(u)>=0},s.prototype.ltn=function(u){return this.cmpn(u)===-1},s.prototype.lt=function(u){return this.cmp(u)===-1},s.prototype.lten=function(u){return this.cmpn(u)<=0},s.prototype.lte=function(u){return this.cmp(u)<=0},s.prototype.eqn=function(u){return this.cmpn(u)===0},s.prototype.eq=function(u){return this.cmp(u)===0},s.red=function(u){return new Y(u)},s.prototype.toRed=function(u){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(u){return this.red=u,this},s.prototype.forceRed=function(u){return n(!this.red,"Already a number in reduction context"),this._forceRed(u)},s.prototype.redAdd=function(u){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},s.prototype.redIAdd=function(u){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},s.prototype.redSub=function(u){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},s.prototype.redISub=function(u){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},s.prototype.redShl=function(u){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},s.prototype.redMul=function(u){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},s.prototype.redIMul=function(u){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(u){return n(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var L={k256:null,p224:null,p192:null,p25519:null};function B(v,u){this.name=v,this.p=new s(u,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}B.prototype._tmp=function(){var u=new s(null);return u.words=new Array(Math.ceil(this.n/13)),u},B.prototype.ireduce=function(u){var h=u,p;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),p=h.bitLength();while(p>this.n);var y=p0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},B.prototype.split=function(u,h){u.iushrn(this.n,0,h)},B.prototype.imulK=function(u){return u.imul(this.k)};function G(){B.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(G,B),G.prototype.split=function(u,h){for(var p=4194303,y=Math.min(u.length,9),w=0;w>>22,x=T}x>>>=22,u.words[w-10]=x,x===0&&u.length>10?u.length-=10:u.length-=9},G.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var h=0,p=0;p>>=26,u.words[p]=w,h=y}return h!==0&&(u.words[u.length++]=h),u},s._prime=function(u){if(L[u])return L[u];var h;if(u==="k256")h=new G;else if(u==="p224")h=new z;else if(u==="p192")h=new W;else if(u==="p25519")h=new K;else throw new Error("Unknown prime "+u);return L[u]=h,h};function Y(v){if(typeof v=="string"){var u=s._prime(v);this.m=u.p,this.prime=u}else n(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}Y.prototype._verify1=function(u){n(u.negative===0,"red works only with positives"),n(u.red,"red works only with red numbers")},Y.prototype._verify2=function(u,h){n((u.negative|h.negative)===0,"red works only with positives"),n(u.red&&u.red===h.red,"red works only with red numbers")},Y.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):(d(u,u.umod(this.m)._forceRed(this)),u)},Y.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},Y.prototype.add=function(u,h){this._verify2(u,h);var p=u.add(h);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},Y.prototype.iadd=function(u,h){this._verify2(u,h);var p=u.iadd(h);return p.cmp(this.m)>=0&&p.isub(this.m),p},Y.prototype.sub=function(u,h){this._verify2(u,h);var p=u.sub(h);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},Y.prototype.isub=function(u,h){this._verify2(u,h);var p=u.isub(h);return p.cmpn(0)<0&&p.iadd(this.m),p},Y.prototype.shl=function(u,h){return this._verify1(u),this.imod(u.ushln(h))},Y.prototype.imul=function(u,h){return this._verify2(u,h),this.imod(u.imul(h))},Y.prototype.mul=function(u,h){return this._verify2(u,h),this.imod(u.mul(h))},Y.prototype.isqr=function(u){return this.imul(u,u.clone())},Y.prototype.sqr=function(u){return this.mul(u,u)},Y.prototype.sqrt=function(u){if(u.isZero())return u.clone();var h=this.m.andln(3);if(n(h%2===1),h===3){var p=this.m.add(new s(1)).iushrn(2);return this.pow(u,p)}for(var y=this.m.subn(1),w=0;!y.isZero()&&y.andln(1)===0;)w++,y.iushrn(1);n(!y.isZero());var x=new s(1).toRed(this),T=x.redNeg(),m=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);this.pow(f,m).cmp(T)!==0;)f.redIAdd(T);for(var E=this.pow(f,y),U=this.pow(u,y.addn(1).iushrn(1)),q=this.pow(u,y),I=w;q.cmp(x)!==0;){for(var k=q,$=0;k.cmp(x)!==0;$++)k=k.redSqr();n($=0;w--){for(var E=h.words[w],U=f-1;U>=0;U--){var q=E>>U&1;if(x!==y[0]&&(x=this.sqr(x)),q===0&&T===0){m=0;continue}T<<=1,T|=q,m++,!(m!==p&&(w!==0||U!==0))&&(x=this.mul(x,y[T]),m=0,T=0)}f=26}return x},Y.prototype.convertTo=function(u){var h=u.umod(this.m);return h===u?h.clone():h},Y.prototype.convertFrom=function(u){var h=u.clone();return h.red=null,h},s.mont=function(u){return new X(u)};function X(v){Y.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(X,Y),X.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},X.prototype.convertFrom=function(u){var h=this.imod(u.mul(this.rinv));return h.red=null,h},X.prototype.imul=function(u,h){if(u.isZero()||h.isZero())return u.words[0]=0,u.length=1,u;var p=u.imul(h),y=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=p.isub(y).iushrn(this.shift),x=w;return w.cmp(this.m)>=0?x=w.isub(this.m):w.cmpn(0)<0&&(x=w.iadd(this.m)),x._forceRed(this)},X.prototype.mul=function(u,h){if(u.isZero()||h.isZero())return new s(0)._forceRed(this);var p=u.mul(h),y=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=p.isub(y).iushrn(this.shift),x=w;return w.cmp(this.m)>=0?x=w.isub(this.m):w.cmpn(0)<0&&(x=w.iadd(this.m)),x._forceRed(this)},X.prototype.invm=function(u){var h=this.imod(u._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(t,Z)})(wu);var Ks=wu.exports,li={};Object.defineProperty(li,"__esModule",{value:!0});li.EVENTS=void 0;li.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var zi={},Vf={},Ir={},Uf=Bi;Bi.default=Bi;Bi.stable=Gf;Bi.stableStringify=Gf;var Ps="[...]",zf="[Circular]",cn=[],nn=[];function qf(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Bi(t,e,r,n){typeof n>"u"&&(n=qf()),Ja(t,"",0,[],void 0,0,n);var i;try{nn.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Jf(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;cn.length!==0;){var s=cn.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Un(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),cn.push([n,r,e,i])):nn.push([e,r,t]):(n[r]=t,cn.push([n,r,e]))}function Ja(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;ao.depthLimit){Un(Ps,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Un(Ps,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;ae?1:0}function Gf(t,e,r,n){typeof n>"u"&&(n=qf());var i=Za(t,"",0,[],void 0,0,n)||t,s;try{nn.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Jf(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;cn.length!==0;){var o=cn.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Za(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;ao.depthLimit){Un(Ps,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Un(Ps,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a0)for(var n=0;n=1e3&&t<=4999}function o0(t,e){if(e!=="[Circular]")return e}var _u={},Ar={};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.errorValues=Ar.errorCodes=void 0;Ar.errorCodes={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}};Ar.errorValues={"-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."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Ar,r=Ir,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(b,C=i){if(Number.isInteger(b)){const A=b.toString();if(g(e.errorValues,A))return e.errorValues[A].message;if(l(b))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return C}t.getMessageFromCode=o;function a(b){if(!Number.isInteger(b))return!1;const C=b.toString();return!!(e.errorValues[C]||l(b))}t.isValidCode=a;function c(b,{fallbackError:C=s,shouldIncludeStack:A=!1}={}){var P,N;if(!C||!Number.isInteger(C.code)||typeof C.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(b instanceof r.EthereumRpcError)return b.serialize();const M={};if(b&&typeof b=="object"&&!Array.isArray(b)&&g(b,"code")&&a(b.code)){const O=b;M.code=O.code,O.message&&typeof O.message=="string"?(M.message=O.message,g(O,"data")&&(M.data=O.data)):(M.message=o(M.code),M.data={originalError:d(b)})}else{M.code=C.code;const O=(P=b)===null||P===void 0?void 0:P.message;M.message=O&&typeof O=="string"?O:C.message,M.data={originalError:d(b)}}const R=(N=b)===null||N===void 0?void 0:N.stack;return A&&b&&R&&typeof R=="string"&&(M.stack=R),M}t.serializeError=c;function l(b){return b>=-32099&&b<=-32e3}function d(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function g(b,C){return Object.prototype.hasOwnProperty.call(b,C)}})(_u);var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.ethErrors=void 0;const Su=Ir,Qf=_u,dt=Ar;Xs.ethErrors={rpc:{parse:t=>Tt(dt.errorCodes.rpc.parse,t),invalidRequest:t=>Tt(dt.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Tt(dt.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Tt(dt.errorCodes.rpc.methodNotFound,t),internal:t=>Tt(dt.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Tt(e,t)},invalidInput:t=>Tt(dt.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Tt(dt.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Tt(dt.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Tt(dt.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Tt(dt.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Tt(dt.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Ei(dt.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Ei(dt.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Ei(dt.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Ei(dt.errorCodes.provider.disconnected,t),chainDisconnected:t=>Ei(dt.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Su.EthereumProviderError(e,r,n)}}};function Tt(t,e){const[r,n]=Yf(e);return new Su.EthereumRpcError(t,r||Qf.getMessageFromCode(t),n)}function Ei(t,e){const[r,n]=Yf(e);return new Su.EthereumProviderError(t,r||Qf.getMessageFromCode(t),n)}function Yf(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Ir;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=_u;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Xs;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Ar;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Vf);var _e={},eo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(eo);Object.defineProperty(_e,"__esModule",{value:!0});_e.EthereumAddressFromSignedMessageResponse=_e.SubmitEthereumTransactionResponse=_e.SignEthereumTransactionResponse=_e.SignEthereumMessageResponse=_e.isRequestEthereumAccountsResponse=_e.SelectProviderResponse=_e.WatchAssetReponse=_e.RequestEthereumAccountsResponse=_e.SwitchEthereumChainResponse=_e.AddEthereumChainResponse=_e.isErrorResponse=void 0;const cr=eo;function a0(t){var e,r;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((r=t)===null||r===void 0?void 0:r.errorMessage)!==void 0}_e.isErrorResponse=a0;function u0(t){return{method:cr.Web3Method.addEthereumChain,result:t}}_e.AddEthereumChainResponse=u0;function c0(t){return{method:cr.Web3Method.switchEthereumChain,result:t}}_e.SwitchEthereumChainResponse=c0;function l0(t){return{method:cr.Web3Method.requestEthereumAccounts,result:t}}_e.RequestEthereumAccountsResponse=l0;function f0(t){return{method:cr.Web3Method.watchAsset,result:t}}_e.WatchAssetReponse=f0;function h0(t){return{method:cr.Web3Method.selectProvider,result:t}}_e.SelectProviderResponse=h0;function d0(t){return t&&t.method===cr.Web3Method.requestEthereumAccounts}_e.isRequestEthereumAccountsResponse=d0;function p0(t){return{method:cr.Web3Method.signEthereumMessage,result:t}}_e.SignEthereumMessageResponse=p0;function g0(t){return{method:cr.Web3Method.signEthereumTransaction,result:t}}_e.SignEthereumTransactionResponse=g0;function b0(t){return{method:cr.Web3Method.submitEthereumTransaction,result:t}}_e.SubmitEthereumTransactionResponse=b0;function v0(t){return{method:cr.Web3Method.ethereumAddressFromSignedMessage,result:t}}_e.EthereumAddressFromSignedMessageResponse=v0;var fi={};Object.defineProperty(fi,"__esModule",{value:!0});fi.LIB_VERSION=void 0;fi.LIB_VERSION="3.7.2";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=Vf,r=_e,n=fi;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(d){return d!==void 0?(0,e.getMessageFromCode)(d):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(d="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${d}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(d,g){const b=(0,e.serializeError)(o(d),{shouldIncludeStack:!0}),C=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");C.searchParams.set("version",n.LIB_VERSION),C.searchParams.set("code",b.code.toString());const A=a(b.data,g);return A&&C.searchParams.set("method",A),C.searchParams.set("message",b.message),Object.assign(Object.assign({},b),{docUrl:C.href})}t.serializeError=s;function o(d){return typeof d=="string"?{message:d,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(d)?Object.assign(Object.assign({},d),{message:d.errorMessage,code:d.errorCode,data:{method:d.method,result:d.result}}):d}function a(d,g){var b;const C=(b=d)===null||b===void 0?void 0:b.method;if(C)return C;if(g!==void 0)return typeof g=="string"?g:Array.isArray(g)?g.length>0?g[0].method:void 0:g.method}function c(d){var g;if(typeof d=="number")return d;if(l(d))return(g=d.code)!==null&&g!==void 0?g:d.errorCode}t.getErrorCode=c;function l(d){return typeof d=="object"&&d!==null&&(typeof d.code=="number"||typeof d.errorCode=="number")}})(zi);var hi={},Kf={exports:{}},Qa={exports:{}};typeof Object.create=="function"?Qa.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Qa.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var Gt=Qa.exports,Ya={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(t,e){var r=Ui,n=r.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,c){return n(o,a,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(Ya,Ya.exports);var bn=Ya.exports,Xf=bn.Buffer;function to(t,e){this._block=Xf.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}to.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=Xf.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};to.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var di=to,y0=Gt,eh=di,m0=bn.Buffer,w0=[1518500249,1859775393,-1894007588,-899497514],_0=new Array(80);function qi(){this.init(),this._w=_0,eh.call(this,64,56)}y0(qi,eh);qi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function S0(t){return t<<5|t>>>27}function E0(t){return t<<30|t>>>2}function M0(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}qi.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var c=0;c<80;++c){var l=~~(c/20),d=S0(r)+M0(l,n,i,s)+o+e[c]+w0[l]|0;o=s,s=i,i=E0(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};qi.prototype._hash=function(){var t=m0.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var x0=qi,C0=Gt,th=di,R0=bn.Buffer,I0=[1518500249,1859775393,-1894007588,-899497514],A0=new Array(80);function Gi(){this.init(),this._w=A0,th.call(this,64,56)}C0(Gi,th);Gi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function T0(t){return t<<1|t>>>31}function k0(t){return t<<5|t>>>27}function O0(t){return t<<30|t>>>2}function N0(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Gi.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=T0(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var c=0;c<80;++c){var l=~~(c/20),d=k0(r)+N0(l,n,i,s)+o+e[c]+I0[l]|0;o=s,s=i,i=O0(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Gi.prototype._hash=function(){var t=R0.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var L0=Gi,P0=Gt,rh=di,D0=bn.Buffer,$0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],B0=new Array(64);function Ji(){this.init(),this._w=B0,rh.call(this,64,56)}P0(Ji,rh);Ji.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function j0(t,e,r){return r^t&(e^r)}function F0(t,e,r){return t&e|r&(t|e)}function W0(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function H0(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function V0(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function U0(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}Ji.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,l=this._h|0,d=0;d<16;++d)e[d]=t.readInt32BE(d*4);for(;d<64;++d)e[d]=U0(e[d-2])+e[d-7]+V0(e[d-15])+e[d-16]|0;for(var g=0;g<64;++g){var b=l+H0(o)+j0(o,a,c)+$0[g]+e[g]|0,C=W0(r)+F0(r,n,i)|0;l=c,c=a,a=o,o=s+b|0,s=i,i=n,n=r,r=b+C|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0};Ji.prototype._hash=function(){var t=D0.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var nh=Ji,z0=Gt,q0=nh,G0=di,J0=bn.Buffer,Z0=new Array(64);function ro(){this.init(),this._w=Z0,G0.call(this,64,56)}z0(ro,q0);ro.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};ro.prototype._hash=function(){var t=J0.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var Q0=ro,Y0=Gt,ih=di,K0=bn.Buffer,Ac=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],X0=new Array(160);function Zi(){this.init(),this._w=X0,ih.call(this,128,112)}Y0(Zi,ih);Zi.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Tc(t,e,r){return r^t&(e^r)}function kc(t,e,r){return t&e|r&(t|e)}function Oc(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Nc(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function eg(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function tg(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function rg(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function ng(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function it(t,e){return t>>>0>>0?1:0}Zi.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,l=this._hh|0,d=this._al|0,g=this._bl|0,b=this._cl|0,C=this._dl|0,A=this._el|0,P=this._fl|0,N=this._gl|0,M=this._hl|0,R=0;R<32;R+=2)e[R]=t.readInt32BE(R*4),e[R+1]=t.readInt32BE(R*4+4);for(;R<160;R+=2){var O=e[R-30],D=e[R-15*2+1],L=eg(O,D),B=tg(D,O);O=e[R-2*2],D=e[R-2*2+1];var G=rg(O,D),z=ng(D,O),W=e[R-7*2],K=e[R-7*2+1],Y=e[R-16*2],X=e[R-16*2+1],v=B+K|0,u=L+W+it(v,B)|0;v=v+z|0,u=u+G+it(v,z)|0,v=v+X|0,u=u+Y+it(v,X)|0,e[R]=u,e[R+1]=v}for(var h=0;h<160;h+=2){u=e[h],v=e[h+1];var p=kc(r,n,i),y=kc(d,g,b),w=Oc(r,d),x=Oc(d,r),T=Nc(o,A),m=Nc(A,o),f=Ac[h],E=Ac[h+1],U=Tc(o,a,c),q=Tc(A,P,N),I=M+m|0,k=l+T+it(I,M)|0;I=I+q|0,k=k+U+it(I,q)|0,I=I+E|0,k=k+f+it(I,E)|0,I=I+v|0,k=k+u+it(I,v)|0;var $=x+y|0,V=w+p+it($,x)|0;l=c,M=N,c=a,N=P,a=o,P=A,A=C+I|0,o=s+k+it(A,C)|0,s=i,C=b,i=n,b=g,n=r,g=d,d=I+$|0,r=k+V+it(d,I)|0}this._al=this._al+d|0,this._bl=this._bl+g|0,this._cl=this._cl+b|0,this._dl=this._dl+C|0,this._el=this._el+A|0,this._fl=this._fl+P|0,this._gl=this._gl+N|0,this._hl=this._hl+M|0,this._ah=this._ah+r+it(this._al,d)|0,this._bh=this._bh+n+it(this._bl,g)|0,this._ch=this._ch+i+it(this._cl,b)|0,this._dh=this._dh+s+it(this._dl,C)|0,this._eh=this._eh+o+it(this._el,A)|0,this._fh=this._fh+a+it(this._fl,P)|0,this._gh=this._gh+c+it(this._gl,N)|0,this._hh=this._hh+l+it(this._hl,M)|0};Zi.prototype._hash=function(){var t=K0.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var sh=Zi,ig=Gt,sg=sh,og=di,ag=bn.Buffer,ug=new Array(160);function no(){this.init(),this._w=ug,og.call(this,128,112)}ig(no,sg);no.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};no.prototype._hash=function(){var t=ag.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var cg=no,vn=Kf.exports=function(e){e=e.toLowerCase();var r=vn[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};vn.sha=x0;vn.sha1=L0;vn.sha224=Q0;vn.sha256=nh;vn.sha384=cg;vn.sha512=sh;var lg=Kf.exports,J={},fg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0},Lc=typeof Symbol<"u"&&Symbol,hg=fg,dg=function(){return typeof Lc!="function"||typeof Symbol!="function"||typeof Lc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hg()},Pc={foo:{}},pg=Object,gg=function(){return{__proto__:Pc}.foo===Pc.foo&&!({__proto__:null}instanceof pg)},bg="Function.prototype.bind called on incompatible ",vg=Object.prototype.toString,yg=Math.max,mg="[object Function]",Dc=function(e,r){for(var n=[],i=0;i"u"||!at?ce:at(Uint8Array),un={"%AggregateError%":typeof AggregateError>"u"?ce:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ce:ArrayBuffer,"%ArrayIteratorPrototype%":Ln&&at?at([][Symbol.iterator]()):ce,"%AsyncFromSyncIteratorPrototype%":ce,"%AsyncFunction%":Fn,"%AsyncGenerator%":Fn,"%AsyncGeneratorFunction%":Fn,"%AsyncIteratorPrototype%":Fn,"%Atomics%":typeof Atomics>"u"?ce:Atomics,"%BigInt%":typeof BigInt>"u"?ce:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ce:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ce:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ce:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ce:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ce:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ce:FinalizationRegistry,"%Function%":ah,"%GeneratorFunction%":Fn,"%Int8Array%":typeof Int8Array>"u"?ce:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ce:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ce:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ln&&at?at(at([][Symbol.iterator]())):ce,"%JSON%":typeof JSON=="object"?JSON:ce,"%Map%":typeof Map>"u"?ce:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ln||!at?ce:at(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ce:Promise,"%Proxy%":typeof Proxy>"u"?ce:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ce:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ce:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ln||!at?ce:at(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ce:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ln&&at?at(""[Symbol.iterator]()):ce,"%Symbol%":Ln?Symbol:ce,"%SyntaxError%":Yn,"%ThrowTypeError%":xg,"%TypedArray%":Rg,"%TypeError%":zn,"%Uint8Array%":typeof Uint8Array>"u"?ce:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ce:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ce:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ce:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ce:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ce:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ce:WeakSet};if(at)try{null.error}catch(t){var Ig=at(at(t));un["%Error.prototype%"]=Ig}var Ag=function t(e){var r;if(e==="%AsyncFunction%")r=oa("async function () {}");else if(e==="%GeneratorFunction%")r=oa("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=oa("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&at&&(r=at(i.prototype))}return un[e]=r,r},Bc={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Qi=oh,Ds=Mg,Tg=Qi.call(Function.call,Array.prototype.concat),kg=Qi.call(Function.apply,Array.prototype.splice),jc=Qi.call(Function.call,String.prototype.replace),$s=Qi.call(Function.call,String.prototype.slice),Og=Qi.call(Function.call,RegExp.prototype.exec),Ng=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Lg=/\\(\\)?/g,Pg=function(e){var r=$s(e,0,1),n=$s(e,-1);if(r==="%"&&n!=="%")throw new Yn("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Yn("invalid intrinsic syntax, expected opening `%`");var i=[];return jc(e,Ng,function(s,o,a,c){i[i.length]=a?jc(c,Lg,"$1"):o||s}),i},Dg=function(e,r){var n=e,i;if(Ds(Bc,n)&&(i=Bc[n],n="%"+i[0]+"%"),Ds(un,n)){var s=un[n];if(s===Fn&&(s=Ag(n)),typeof s>"u"&&!r)throw new zn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Yn("intrinsic "+e+" does not exist!")},Eu=function(e,r){if(typeof e!="string"||e.length===0)throw new zn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new zn('"allowMissing" argument must be a boolean');if(Og(/^%?[^%]*%?$/,e)===null)throw new Yn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Pg(e),i=n.length>0?n[0]:"",s=Dg("%"+i+"%",r),o=s.name,a=s.value,c=!1,l=s.alias;l&&(i=l[0],kg(n,Tg([0,1],l)));for(var d=1,g=!0;d=n.length){var P=an(a,b);g=!!P,g&&"get"in P&&!("originalValue"in P.get)?a=P.get:a=a[b]}else g=Ds(a,b),a=a[b];g&&!c&&(un[o]=a)}}return a},uh={exports:{}};(function(t){var e=oh,r=Eu,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(i,n),o=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(g){var b=s(e,i,arguments);if(o&&a){var C=o(b,"length");C.configurable&&a(b,"length",{value:1+c(0,g.length-(arguments.length-1))})}return b};var l=function(){return s(e,n,arguments)};a?a(t.exports,"apply",{value:l}):t.exports.apply=l})(uh);var $g=uh.exports,ch=Eu,lh=$g,Bg=lh(ch("String.prototype.indexOf")),jg=function(e,r){var n=ch(e,!!r);return typeof n=="function"&&Bg(e,".prototype.")>-1?lh(n):n},Mu=typeof Map=="function"&&Map.prototype,ua=Object.getOwnPropertyDescriptor&&Mu?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Bs=Mu&&ua&&typeof ua.get=="function"?ua.get:null,Fc=Mu&&Map.prototype.forEach,xu=typeof Set=="function"&&Set.prototype,ca=Object.getOwnPropertyDescriptor&&xu?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,js=xu&&ca&&typeof ca.get=="function"?ca.get:null,Wc=xu&&Set.prototype.forEach,Fg=typeof WeakMap=="function"&&WeakMap.prototype,ki=Fg?WeakMap.prototype.has:null,Wg=typeof WeakSet=="function"&&WeakSet.prototype,Oi=Wg?WeakSet.prototype.has:null,Hg=typeof WeakRef=="function"&&WeakRef.prototype,Hc=Hg?WeakRef.prototype.deref:null,Vg=Boolean.prototype.valueOf,Ug=Object.prototype.toString,zg=Function.prototype.toString,qg=String.prototype.match,Cu=String.prototype.slice,Cr=String.prototype.replace,Gg=String.prototype.toUpperCase,Vc=String.prototype.toLowerCase,fh=RegExp.prototype.test,Uc=Array.prototype.concat,nr=Array.prototype.join,Jg=Array.prototype.slice,zc=Math.floor,Ka=typeof BigInt=="function"?BigInt.prototype.valueOf:null,la=Object.getOwnPropertySymbols,Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",vt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Kn||"symbol")?Symbol.toStringTag:null,hh=Object.prototype.propertyIsEnumerable,qc=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Gc(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||fh.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-zc(-t):zc(t);if(n!==t){var i=String(n),s=Cu.call(e,i.length+1);return Cr.call(i,r,"$&_")+"."+Cr.call(Cr.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Cr.call(e,r,"$&_")}var eu=Js,Jc=eu.custom,Zc=ph(Jc)?Jc:null,Zg=function t(e,r,n,i){var s=r||{};if(Er(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Er(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Er(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Er(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Er(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return bh(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?Gc(e,c):c}if(typeof e=="bigint"){var l=String(e)+"n";return a?Gc(e,l):l}var d=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=d&&d>0&&typeof e=="object")return tu(e)?"[Array]":"[Object]";var g=db(s,n);if(typeof i>"u")i=[];else if(gh(i,e)>=0)return"[Circular]";function b(v,u,h){if(u&&(i=Jg.call(i),i.push(u)),h){var p={depth:s.depth};return Er(s,"quoteStyle")&&(p.quoteStyle=s.quoteStyle),t(v,p,n+1,i)}return t(v,s,n+1,i)}if(typeof e=="function"&&!Qc(e)){var C=ib(e),A=gs(e,b);return"[Function"+(C?": "+C:" (anonymous)")+"]"+(A.length>0?" { "+nr.call(A,", ")+" }":"")}if(ph(e)){var P=Kn?Cr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Xa.call(e);return typeof e=="object"&&!Kn?Mi(P):P}if(lb(e)){for(var N="<"+Vc.call(String(e.nodeName)),M=e.attributes||[],R=0;R",N}if(tu(e)){if(e.length===0)return"[]";var O=gs(e,b);return g&&!hb(O)?"["+ru(O,g)+"]":"[ "+nr.call(O,", ")+" ]"}if(Kg(e)){var D=gs(e,b);return!("cause"in Error.prototype)&&"cause"in e&&!hh.call(e,"cause")?"{ ["+String(e)+"] "+nr.call(Uc.call("[cause]: "+b(e.cause),D),", ")+" }":D.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+nr.call(D,", ")+" }"}if(typeof e=="object"&&o){if(Zc&&typeof e[Zc]=="function"&&eu)return eu(e,{depth:d-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(sb(e)){var L=[];return Fc&&Fc.call(e,function(v,u){L.push(b(u,e,!0)+" => "+b(v,e))}),Yc("Map",Bs.call(e),L,g)}if(ub(e)){var B=[];return Wc&&Wc.call(e,function(v){B.push(b(v,e))}),Yc("Set",js.call(e),B,g)}if(ob(e))return fa("WeakMap");if(cb(e))return fa("WeakSet");if(ab(e))return fa("WeakRef");if(eb(e))return Mi(b(Number(e)));if(rb(e))return Mi(b(Ka.call(e)));if(tb(e))return Mi(Vg.call(e));if(Xg(e))return Mi(b(String(e)));if(e===globalThis)return typeof window<"u"?"{ [object Window] }":"{ [object globalThis] }";if(!Yg(e)&&!Qc(e)){var G=gs(e,b),z=qc?qc(e)===Object.prototype:e instanceof Object||e.constructor===Object,W=e instanceof Object?"":"null prototype",K=!z&&vt&&Object(e)===e&&vt in e?Cu.call(Pr(e),8,-1):W?"Object":"",Y=z||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",X=Y+(K||W?"["+nr.call(Uc.call([],K||[],W||[]),": ")+"] ":"");return G.length===0?X+"{}":g?X+"{"+ru(G,g)+"}":X+"{ "+nr.call(G,", ")+" }"}return String(e)};function dh(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Qg(t){return Cr.call(String(t),/"/g,""")}function tu(t){return Pr(t)==="[object Array]"&&(!vt||!(typeof t=="object"&&vt in t))}function Yg(t){return Pr(t)==="[object Date]"&&(!vt||!(typeof t=="object"&&vt in t))}function Qc(t){return Pr(t)==="[object RegExp]"&&(!vt||!(typeof t=="object"&&vt in t))}function Kg(t){return Pr(t)==="[object Error]"&&(!vt||!(typeof t=="object"&&vt in t))}function Xg(t){return Pr(t)==="[object String]"&&(!vt||!(typeof t=="object"&&vt in t))}function eb(t){return Pr(t)==="[object Number]"&&(!vt||!(typeof t=="object"&&vt in t))}function tb(t){return Pr(t)==="[object Boolean]"&&(!vt||!(typeof t=="object"&&vt in t))}function ph(t){if(Kn)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Xa)return!1;try{return Xa.call(t),!0}catch{}return!1}function rb(t){if(!t||typeof t!="object"||!Ka)return!1;try{return Ka.call(t),!0}catch{}return!1}var nb=Object.prototype.hasOwnProperty||function(t){return t in this};function Er(t,e){return nb.call(t,e)}function Pr(t){return Ug.call(t)}function ib(t){if(t.name)return t.name;var e=qg.call(zg.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function gh(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return bh(Cu.call(t,0,e.maxStringLength),e)+n}var i=Cr.call(Cr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,fb);return dh(i,"single",e)}function fb(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Gg.call(e.toString(16))}function Mi(t){return"Object("+t+")"}function fa(t){return t+" { ? }"}function Yc(t,e,r,n){var i=n?ru(r,n):nr.call(r,", ");return t+" ("+e+") {"+i+"}"}function hb(t){for(var e=0;en[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var mu={},$i={},Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.walletLogo=void 0;const Yp=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Zs.walletLogo=Yp;var Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.LINK_API_URL=void 0;Qs.LINK_API_URL="https://www.walletlink.org";var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.ScopedLocalStorage=void 0;class Kp{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}Ys.ScopedLocalStorage=Kp;var Qn={},gn={};Object.defineProperty(gn,"__esModule",{value:!0});const Xp=yu;function Ic(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function e0(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")Ic(s,this,r);else{const o=s.length,a=e0(s);for(let c=0;c0?u:h},s.min=function(u,h){return u.cmp(h)<0?u:h},s.prototype._init=function(u,h,p){if(typeof u=="number")return this._initNumber(u,h,p);if(typeof u=="object")return this._initArray(u,h,p);h==="hex"&&(h=16),n(h===(h|0)&&h>=2&&h<=36),u=u.toString().replace(/\s+/g,"");var y=0;u[0]==="-"&&(y++,this.negative=1),y=0;y-=3)x=u[y]|u[y-1]<<8|u[y-2]<<16,this.words[w]|=x<>>26-T&67108863,T+=24,T>=26&&(T-=26,w++);else if(p==="le")for(y=0,w=0;y>>26-T&67108863,T+=24,T>=26&&(T-=26,w++);return this._strip()};function a(v,u){var h=v.charCodeAt(u);if(h>=48&&h<=57)return h-48;if(h>=65&&h<=70)return h-55;if(h>=97&&h<=102)return h-87;n(!1,"Invalid character in "+v)}function c(v,u,h){var p=a(v,h);return h-1>=u&&(p|=a(v,h-1)<<4),p}s.prototype._parseHex=function(u,h,p){this.length=Math.ceil((u.length-h)/6),this.words=new Array(this.length);for(var y=0;y=h;y-=2)T=c(u,h,y)<=18?(w-=18,x+=1,this.words[x]|=T>>>26):w+=8;else{var m=u.length-h;for(y=m%2===0?h+1:h;y=18?(w-=18,x+=1,this.words[x]|=T>>>26):w+=8}this._strip()};function l(v,u,h,p){for(var y=0,w=0,x=Math.min(v.length,h),T=u;T=49?w=m-49+10:m>=17?w=m-17+10:w=m,n(m>=0&&w1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{s.prototype.inspect=g}else s.prototype.inspect=g;function g(){return(this.red?""}var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(u,h){u=u||10,h=h|0||1;var p;if(u===16||u==="hex"){p="";for(var y=0,w=0,x=0;x>>24-y&16777215,y+=2,y>=26&&(y-=26,x--),w!==0||x!==this.length-1?p=b[6-m.length]+m+p:p=m+p}for(w!==0&&(p=w.toString(16)+p);p.length%h!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(u===(u|0)&&u>=2&&u<=36){var f=C[u],E=A[u];p="";var U=this.clone();for(U.negative=0;!U.isZero();){var q=U.modrn(E).toString(u);U=U.idivn(E),U.isZero()?p=q+p:p=b[f-q.length]+q+p}for(this.isZero()&&(p="0"+p);p.length%h!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=this.words[1]*67108864:this.length===3&&this.words[2]===1?u+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(u,h){return this.toArrayLike(o,u,h)}),s.prototype.toArray=function(u,h){return this.toArrayLike(Array,u,h)};var P=function(u,h){return u.allocUnsafe?u.allocUnsafe(h):new u(h)};s.prototype.toArrayLike=function(u,h,p){this._strip();var y=this.byteLength(),w=p||Math.max(1,y);n(y<=w,"byte array longer than desired length"),n(w>0,"Requested array length <= 0");var x=P(u,w),T=h==="le"?"LE":"BE";return this["_toArrayLike"+T](x,y),x},s.prototype._toArrayLikeLE=function(u,h){for(var p=0,y=0,w=0,x=0;w>8&255),p>16&255),x===6?(p>24&255),y=0,x=0):(y=T>>>24,x+=2)}if(p=0&&(u[p--]=T>>8&255),p>=0&&(u[p--]=T>>16&255),x===6?(p>=0&&(u[p--]=T>>24&255),y=0,x=0):(y=T>>>24,x+=2)}if(p>=0)for(u[p--]=y;p>=0;)u[p--]=0},Math.clz32?s.prototype._countBits=function(u){return 32-Math.clz32(u)}:s.prototype._countBits=function(u){var h=u,p=0;return h>=4096&&(p+=13,h>>>=13),h>=64&&(p+=7,h>>>=7),h>=8&&(p+=4,h>>>=4),h>=2&&(p+=2,h>>>=2),p+h},s.prototype._zeroBits=function(u){if(u===0)return 26;var h=u,p=0;return h&8191||(p+=13,h>>>=13),h&127||(p+=7,h>>>=7),h&15||(p+=4,h>>>=4),h&3||(p+=2,h>>>=2),h&1||p++,p},s.prototype.bitLength=function(){var u=this.words[this.length-1],h=this._countBits(u);return(this.length-1)*26+h};function N(v){for(var u=new Array(v.bitLength()),h=0;h>>y&1}return u}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,h=0;hu.length?this.clone().ior(u):u.clone().ior(this)},s.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},s.prototype.iuand=function(u){var h;this.length>u.length?h=u:h=this;for(var p=0;pu.length?this.clone().iand(u):u.clone().iand(this)},s.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},s.prototype.iuxor=function(u){var h,p;this.length>u.length?(h=this,p=u):(h=u,p=this);for(var y=0;yu.length?this.clone().ixor(u):u.clone().ixor(this)},s.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},s.prototype.inotn=function(u){n(typeof u=="number"&&u>=0);var h=Math.ceil(u/26)|0,p=u%26;this._expand(h),p>0&&h--;for(var y=0;y0&&(this.words[y]=~this.words[y]&67108863>>26-p),this._strip()},s.prototype.notn=function(u){return this.clone().inotn(u)},s.prototype.setn=function(u,h){n(typeof u=="number"&&u>=0);var p=u/26|0,y=u%26;return this._expand(p+1),h?this.words[p]=this.words[p]|1<u.length?(p=this,y=u):(p=u,y=this);for(var w=0,x=0;x>>26;for(;w!==0&&x>>26;if(this.length=p.length,w!==0)this.words[this.length]=w,this.length++;else if(p!==this)for(;xu.length?this.clone().iadd(u):u.clone().iadd(this)},s.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var h=this.iadd(u);return u.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var p=this.cmp(u);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var y,w;p>0?(y=this,w=u):(y=u,w=this);for(var x=0,T=0;T>26,this.words[T]=h&67108863;for(;x!==0&&T>26,this.words[T]=h&67108863;if(x===0&&T>>26,U=m&67108863,q=Math.min(f,u.length-1),I=Math.max(0,f-v.length+1);I<=q;I++){var k=f-I|0;y=v.words[k]|0,w=u.words[I]|0,x=y*w+U,E+=x/67108864|0,U=x&67108863}h.words[f]=U|0,m=E|0}return m!==0?h.words[f]=m|0:h.length--,h._strip()}var R=function(u,h,p){var y=u.words,w=h.words,x=p.words,T=0,m,f,E,U=y[0]|0,q=U&8191,I=U>>>13,k=y[1]|0,$=k&8191,V=k>>>13,se=y[2]|0,_=se&8191,S=se>>>13,F=y[3]|0,H=F&8191,re=F>>>13,ie=y[4]|0,ee=ie&8191,de=ie>>>13,Qt=y[5]|0,we=Qt&8191,Se=Qt>>>13,mr=y[6]|0,ve=mr&8191,ye=mr>>>13,lr=y[7]|0,be=lr&8191,pe=lr>>>13,xt=y[8]|0,Ee=xt&8191,Me=xt>>>13,En=y[9]|0,xe=En&8191,Ce=En>>>13,Mn=w[0]|0,Re=Mn&8191,Ie=Mn>>>13,xn=w[1]|0,Ae=xn&8191,Te=xn>>>13,Cn=w[2]|0,ke=Cn&8191,Oe=Cn>>>13,Rn=w[3]|0,Ne=Rn&8191,Le=Rn>>>13,In=w[4]|0,Pe=In&8191,De=In>>>13,An=w[5]|0,$e=An&8191,Be=An>>>13,Tn=w[6]|0,je=Tn&8191,Fe=Tn>>>13,kn=w[7]|0,We=kn&8191,He=kn>>>13,On=w[8]|0,Ve=On&8191,Ue=On>>>13,Nn=w[9]|0,ze=Nn&8191,qe=Nn>>>13;p.negative=u.negative^h.negative,p.length=19,m=Math.imul(q,Re),f=Math.imul(q,Ie),f=f+Math.imul(I,Re)|0,E=Math.imul(I,Ie);var Dr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,m=Math.imul($,Re),f=Math.imul($,Ie),f=f+Math.imul(V,Re)|0,E=Math.imul(V,Ie),m=m+Math.imul(q,Ae)|0,f=f+Math.imul(q,Te)|0,f=f+Math.imul(I,Ae)|0,E=E+Math.imul(I,Te)|0;var $r=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+($r>>>26)|0,$r&=67108863,m=Math.imul(_,Re),f=Math.imul(_,Ie),f=f+Math.imul(S,Re)|0,E=Math.imul(S,Ie),m=m+Math.imul($,Ae)|0,f=f+Math.imul($,Te)|0,f=f+Math.imul(V,Ae)|0,E=E+Math.imul(V,Te)|0,m=m+Math.imul(q,ke)|0,f=f+Math.imul(q,Oe)|0,f=f+Math.imul(I,ke)|0,E=E+Math.imul(I,Oe)|0;var Br=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Br>>>26)|0,Br&=67108863,m=Math.imul(H,Re),f=Math.imul(H,Ie),f=f+Math.imul(re,Re)|0,E=Math.imul(re,Ie),m=m+Math.imul(_,Ae)|0,f=f+Math.imul(_,Te)|0,f=f+Math.imul(S,Ae)|0,E=E+Math.imul(S,Te)|0,m=m+Math.imul($,ke)|0,f=f+Math.imul($,Oe)|0,f=f+Math.imul(V,ke)|0,E=E+Math.imul(V,Oe)|0,m=m+Math.imul(q,Ne)|0,f=f+Math.imul(q,Le)|0,f=f+Math.imul(I,Ne)|0,E=E+Math.imul(I,Le)|0;var jr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(jr>>>26)|0,jr&=67108863,m=Math.imul(ee,Re),f=Math.imul(ee,Ie),f=f+Math.imul(de,Re)|0,E=Math.imul(de,Ie),m=m+Math.imul(H,Ae)|0,f=f+Math.imul(H,Te)|0,f=f+Math.imul(re,Ae)|0,E=E+Math.imul(re,Te)|0,m=m+Math.imul(_,ke)|0,f=f+Math.imul(_,Oe)|0,f=f+Math.imul(S,ke)|0,E=E+Math.imul(S,Oe)|0,m=m+Math.imul($,Ne)|0,f=f+Math.imul($,Le)|0,f=f+Math.imul(V,Ne)|0,E=E+Math.imul(V,Le)|0,m=m+Math.imul(q,Pe)|0,f=f+Math.imul(q,De)|0,f=f+Math.imul(I,Pe)|0,E=E+Math.imul(I,De)|0;var Fr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,m=Math.imul(we,Re),f=Math.imul(we,Ie),f=f+Math.imul(Se,Re)|0,E=Math.imul(Se,Ie),m=m+Math.imul(ee,Ae)|0,f=f+Math.imul(ee,Te)|0,f=f+Math.imul(de,Ae)|0,E=E+Math.imul(de,Te)|0,m=m+Math.imul(H,ke)|0,f=f+Math.imul(H,Oe)|0,f=f+Math.imul(re,ke)|0,E=E+Math.imul(re,Oe)|0,m=m+Math.imul(_,Ne)|0,f=f+Math.imul(_,Le)|0,f=f+Math.imul(S,Ne)|0,E=E+Math.imul(S,Le)|0,m=m+Math.imul($,Pe)|0,f=f+Math.imul($,De)|0,f=f+Math.imul(V,Pe)|0,E=E+Math.imul(V,De)|0,m=m+Math.imul(q,$e)|0,f=f+Math.imul(q,Be)|0,f=f+Math.imul(I,$e)|0,E=E+Math.imul(I,Be)|0;var Wr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,m=Math.imul(ve,Re),f=Math.imul(ve,Ie),f=f+Math.imul(ye,Re)|0,E=Math.imul(ye,Ie),m=m+Math.imul(we,Ae)|0,f=f+Math.imul(we,Te)|0,f=f+Math.imul(Se,Ae)|0,E=E+Math.imul(Se,Te)|0,m=m+Math.imul(ee,ke)|0,f=f+Math.imul(ee,Oe)|0,f=f+Math.imul(de,ke)|0,E=E+Math.imul(de,Oe)|0,m=m+Math.imul(H,Ne)|0,f=f+Math.imul(H,Le)|0,f=f+Math.imul(re,Ne)|0,E=E+Math.imul(re,Le)|0,m=m+Math.imul(_,Pe)|0,f=f+Math.imul(_,De)|0,f=f+Math.imul(S,Pe)|0,E=E+Math.imul(S,De)|0,m=m+Math.imul($,$e)|0,f=f+Math.imul($,Be)|0,f=f+Math.imul(V,$e)|0,E=E+Math.imul(V,Be)|0,m=m+Math.imul(q,je)|0,f=f+Math.imul(q,Fe)|0,f=f+Math.imul(I,je)|0,E=E+Math.imul(I,Fe)|0;var Hr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,m=Math.imul(be,Re),f=Math.imul(be,Ie),f=f+Math.imul(pe,Re)|0,E=Math.imul(pe,Ie),m=m+Math.imul(ve,Ae)|0,f=f+Math.imul(ve,Te)|0,f=f+Math.imul(ye,Ae)|0,E=E+Math.imul(ye,Te)|0,m=m+Math.imul(we,ke)|0,f=f+Math.imul(we,Oe)|0,f=f+Math.imul(Se,ke)|0,E=E+Math.imul(Se,Oe)|0,m=m+Math.imul(ee,Ne)|0,f=f+Math.imul(ee,Le)|0,f=f+Math.imul(de,Ne)|0,E=E+Math.imul(de,Le)|0,m=m+Math.imul(H,Pe)|0,f=f+Math.imul(H,De)|0,f=f+Math.imul(re,Pe)|0,E=E+Math.imul(re,De)|0,m=m+Math.imul(_,$e)|0,f=f+Math.imul(_,Be)|0,f=f+Math.imul(S,$e)|0,E=E+Math.imul(S,Be)|0,m=m+Math.imul($,je)|0,f=f+Math.imul($,Fe)|0,f=f+Math.imul(V,je)|0,E=E+Math.imul(V,Fe)|0,m=m+Math.imul(q,We)|0,f=f+Math.imul(q,He)|0,f=f+Math.imul(I,We)|0,E=E+Math.imul(I,He)|0;var Vr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,m=Math.imul(Ee,Re),f=Math.imul(Ee,Ie),f=f+Math.imul(Me,Re)|0,E=Math.imul(Me,Ie),m=m+Math.imul(be,Ae)|0,f=f+Math.imul(be,Te)|0,f=f+Math.imul(pe,Ae)|0,E=E+Math.imul(pe,Te)|0,m=m+Math.imul(ve,ke)|0,f=f+Math.imul(ve,Oe)|0,f=f+Math.imul(ye,ke)|0,E=E+Math.imul(ye,Oe)|0,m=m+Math.imul(we,Ne)|0,f=f+Math.imul(we,Le)|0,f=f+Math.imul(Se,Ne)|0,E=E+Math.imul(Se,Le)|0,m=m+Math.imul(ee,Pe)|0,f=f+Math.imul(ee,De)|0,f=f+Math.imul(de,Pe)|0,E=E+Math.imul(de,De)|0,m=m+Math.imul(H,$e)|0,f=f+Math.imul(H,Be)|0,f=f+Math.imul(re,$e)|0,E=E+Math.imul(re,Be)|0,m=m+Math.imul(_,je)|0,f=f+Math.imul(_,Fe)|0,f=f+Math.imul(S,je)|0,E=E+Math.imul(S,Fe)|0,m=m+Math.imul($,We)|0,f=f+Math.imul($,He)|0,f=f+Math.imul(V,We)|0,E=E+Math.imul(V,He)|0,m=m+Math.imul(q,Ve)|0,f=f+Math.imul(q,Ue)|0,f=f+Math.imul(I,Ve)|0,E=E+Math.imul(I,Ue)|0;var Ur=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,m=Math.imul(xe,Re),f=Math.imul(xe,Ie),f=f+Math.imul(Ce,Re)|0,E=Math.imul(Ce,Ie),m=m+Math.imul(Ee,Ae)|0,f=f+Math.imul(Ee,Te)|0,f=f+Math.imul(Me,Ae)|0,E=E+Math.imul(Me,Te)|0,m=m+Math.imul(be,ke)|0,f=f+Math.imul(be,Oe)|0,f=f+Math.imul(pe,ke)|0,E=E+Math.imul(pe,Oe)|0,m=m+Math.imul(ve,Ne)|0,f=f+Math.imul(ve,Le)|0,f=f+Math.imul(ye,Ne)|0,E=E+Math.imul(ye,Le)|0,m=m+Math.imul(we,Pe)|0,f=f+Math.imul(we,De)|0,f=f+Math.imul(Se,Pe)|0,E=E+Math.imul(Se,De)|0,m=m+Math.imul(ee,$e)|0,f=f+Math.imul(ee,Be)|0,f=f+Math.imul(de,$e)|0,E=E+Math.imul(de,Be)|0,m=m+Math.imul(H,je)|0,f=f+Math.imul(H,Fe)|0,f=f+Math.imul(re,je)|0,E=E+Math.imul(re,Fe)|0,m=m+Math.imul(_,We)|0,f=f+Math.imul(_,He)|0,f=f+Math.imul(S,We)|0,E=E+Math.imul(S,He)|0,m=m+Math.imul($,Ve)|0,f=f+Math.imul($,Ue)|0,f=f+Math.imul(V,Ve)|0,E=E+Math.imul(V,Ue)|0,m=m+Math.imul(q,ze)|0,f=f+Math.imul(q,qe)|0,f=f+Math.imul(I,ze)|0,E=E+Math.imul(I,qe)|0;var zr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(zr>>>26)|0,zr&=67108863,m=Math.imul(xe,Ae),f=Math.imul(xe,Te),f=f+Math.imul(Ce,Ae)|0,E=Math.imul(Ce,Te),m=m+Math.imul(Ee,ke)|0,f=f+Math.imul(Ee,Oe)|0,f=f+Math.imul(Me,ke)|0,E=E+Math.imul(Me,Oe)|0,m=m+Math.imul(be,Ne)|0,f=f+Math.imul(be,Le)|0,f=f+Math.imul(pe,Ne)|0,E=E+Math.imul(pe,Le)|0,m=m+Math.imul(ve,Pe)|0,f=f+Math.imul(ve,De)|0,f=f+Math.imul(ye,Pe)|0,E=E+Math.imul(ye,De)|0,m=m+Math.imul(we,$e)|0,f=f+Math.imul(we,Be)|0,f=f+Math.imul(Se,$e)|0,E=E+Math.imul(Se,Be)|0,m=m+Math.imul(ee,je)|0,f=f+Math.imul(ee,Fe)|0,f=f+Math.imul(de,je)|0,E=E+Math.imul(de,Fe)|0,m=m+Math.imul(H,We)|0,f=f+Math.imul(H,He)|0,f=f+Math.imul(re,We)|0,E=E+Math.imul(re,He)|0,m=m+Math.imul(_,Ve)|0,f=f+Math.imul(_,Ue)|0,f=f+Math.imul(S,Ve)|0,E=E+Math.imul(S,Ue)|0,m=m+Math.imul($,ze)|0,f=f+Math.imul($,qe)|0,f=f+Math.imul(V,ze)|0,E=E+Math.imul(V,qe)|0;var qr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(qr>>>26)|0,qr&=67108863,m=Math.imul(xe,ke),f=Math.imul(xe,Oe),f=f+Math.imul(Ce,ke)|0,E=Math.imul(Ce,Oe),m=m+Math.imul(Ee,Ne)|0,f=f+Math.imul(Ee,Le)|0,f=f+Math.imul(Me,Ne)|0,E=E+Math.imul(Me,Le)|0,m=m+Math.imul(be,Pe)|0,f=f+Math.imul(be,De)|0,f=f+Math.imul(pe,Pe)|0,E=E+Math.imul(pe,De)|0,m=m+Math.imul(ve,$e)|0,f=f+Math.imul(ve,Be)|0,f=f+Math.imul(ye,$e)|0,E=E+Math.imul(ye,Be)|0,m=m+Math.imul(we,je)|0,f=f+Math.imul(we,Fe)|0,f=f+Math.imul(Se,je)|0,E=E+Math.imul(Se,Fe)|0,m=m+Math.imul(ee,We)|0,f=f+Math.imul(ee,He)|0,f=f+Math.imul(de,We)|0,E=E+Math.imul(de,He)|0,m=m+Math.imul(H,Ve)|0,f=f+Math.imul(H,Ue)|0,f=f+Math.imul(re,Ve)|0,E=E+Math.imul(re,Ue)|0,m=m+Math.imul(_,ze)|0,f=f+Math.imul(_,qe)|0,f=f+Math.imul(S,ze)|0,E=E+Math.imul(S,qe)|0;var Gr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,m=Math.imul(xe,Ne),f=Math.imul(xe,Le),f=f+Math.imul(Ce,Ne)|0,E=Math.imul(Ce,Le),m=m+Math.imul(Ee,Pe)|0,f=f+Math.imul(Ee,De)|0,f=f+Math.imul(Me,Pe)|0,E=E+Math.imul(Me,De)|0,m=m+Math.imul(be,$e)|0,f=f+Math.imul(be,Be)|0,f=f+Math.imul(pe,$e)|0,E=E+Math.imul(pe,Be)|0,m=m+Math.imul(ve,je)|0,f=f+Math.imul(ve,Fe)|0,f=f+Math.imul(ye,je)|0,E=E+Math.imul(ye,Fe)|0,m=m+Math.imul(we,We)|0,f=f+Math.imul(we,He)|0,f=f+Math.imul(Se,We)|0,E=E+Math.imul(Se,He)|0,m=m+Math.imul(ee,Ve)|0,f=f+Math.imul(ee,Ue)|0,f=f+Math.imul(de,Ve)|0,E=E+Math.imul(de,Ue)|0,m=m+Math.imul(H,ze)|0,f=f+Math.imul(H,qe)|0,f=f+Math.imul(re,ze)|0,E=E+Math.imul(re,qe)|0;var Jr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,m=Math.imul(xe,Pe),f=Math.imul(xe,De),f=f+Math.imul(Ce,Pe)|0,E=Math.imul(Ce,De),m=m+Math.imul(Ee,$e)|0,f=f+Math.imul(Ee,Be)|0,f=f+Math.imul(Me,$e)|0,E=E+Math.imul(Me,Be)|0,m=m+Math.imul(be,je)|0,f=f+Math.imul(be,Fe)|0,f=f+Math.imul(pe,je)|0,E=E+Math.imul(pe,Fe)|0,m=m+Math.imul(ve,We)|0,f=f+Math.imul(ve,He)|0,f=f+Math.imul(ye,We)|0,E=E+Math.imul(ye,He)|0,m=m+Math.imul(we,Ve)|0,f=f+Math.imul(we,Ue)|0,f=f+Math.imul(Se,Ve)|0,E=E+Math.imul(Se,Ue)|0,m=m+Math.imul(ee,ze)|0,f=f+Math.imul(ee,qe)|0,f=f+Math.imul(de,ze)|0,E=E+Math.imul(de,qe)|0;var Zr=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,m=Math.imul(xe,$e),f=Math.imul(xe,Be),f=f+Math.imul(Ce,$e)|0,E=Math.imul(Ce,Be),m=m+Math.imul(Ee,je)|0,f=f+Math.imul(Ee,Fe)|0,f=f+Math.imul(Me,je)|0,E=E+Math.imul(Me,Fe)|0,m=m+Math.imul(be,We)|0,f=f+Math.imul(be,He)|0,f=f+Math.imul(pe,We)|0,E=E+Math.imul(pe,He)|0,m=m+Math.imul(ve,Ve)|0,f=f+Math.imul(ve,Ue)|0,f=f+Math.imul(ye,Ve)|0,E=E+Math.imul(ye,Ue)|0,m=m+Math.imul(we,ze)|0,f=f+Math.imul(we,qe)|0,f=f+Math.imul(Se,ze)|0,E=E+Math.imul(Se,qe)|0;var ea=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(ea>>>26)|0,ea&=67108863,m=Math.imul(xe,je),f=Math.imul(xe,Fe),f=f+Math.imul(Ce,je)|0,E=Math.imul(Ce,Fe),m=m+Math.imul(Ee,We)|0,f=f+Math.imul(Ee,He)|0,f=f+Math.imul(Me,We)|0,E=E+Math.imul(Me,He)|0,m=m+Math.imul(be,Ve)|0,f=f+Math.imul(be,Ue)|0,f=f+Math.imul(pe,Ve)|0,E=E+Math.imul(pe,Ue)|0,m=m+Math.imul(ve,ze)|0,f=f+Math.imul(ve,qe)|0,f=f+Math.imul(ye,ze)|0,E=E+Math.imul(ye,qe)|0;var ta=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(ta>>>26)|0,ta&=67108863,m=Math.imul(xe,We),f=Math.imul(xe,He),f=f+Math.imul(Ce,We)|0,E=Math.imul(Ce,He),m=m+Math.imul(Ee,Ve)|0,f=f+Math.imul(Ee,Ue)|0,f=f+Math.imul(Me,Ve)|0,E=E+Math.imul(Me,Ue)|0,m=m+Math.imul(be,ze)|0,f=f+Math.imul(be,qe)|0,f=f+Math.imul(pe,ze)|0,E=E+Math.imul(pe,qe)|0;var ra=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(ra>>>26)|0,ra&=67108863,m=Math.imul(xe,Ve),f=Math.imul(xe,Ue),f=f+Math.imul(Ce,Ve)|0,E=Math.imul(Ce,Ue),m=m+Math.imul(Ee,ze)|0,f=f+Math.imul(Ee,qe)|0,f=f+Math.imul(Me,ze)|0,E=E+Math.imul(Me,qe)|0;var na=(T+m|0)+((f&8191)<<13)|0;T=(E+(f>>>13)|0)+(na>>>26)|0,na&=67108863,m=Math.imul(xe,ze),f=Math.imul(xe,qe),f=f+Math.imul(Ce,ze)|0,E=Math.imul(Ce,qe);var ia=(T+m|0)+((f&8191)<<13)|0;return T=(E+(f>>>13)|0)+(ia>>>26)|0,ia&=67108863,x[0]=Dr,x[1]=$r,x[2]=Br,x[3]=jr,x[4]=Fr,x[5]=Wr,x[6]=Hr,x[7]=Vr,x[8]=Ur,x[9]=zr,x[10]=qr,x[11]=Gr,x[12]=Jr,x[13]=Zr,x[14]=ea,x[15]=ta,x[16]=ra,x[17]=na,x[18]=ia,T!==0&&(x[19]=T,p.length++),p};Math.imul||(R=M);function O(v,u,h){h.negative=u.negative^v.negative,h.length=v.length+u.length;for(var p=0,y=0,w=0;w>>26)|0,y+=x>>>26,x&=67108863}h.words[w]=T,p=x,x=y}return p!==0?h.words[w]=p:h.length--,h._strip()}function D(v,u,h){return O(v,u,h)}s.prototype.mulTo=function(u,h){var p,y=this.length+u.length;return this.length===10&&u.length===10?p=R(this,u,h):y<63?p=M(this,u,h):y<1024?p=O(this,u,h):p=D(this,u,h),p},s.prototype.mul=function(u){var h=new s(null);return h.words=new Array(this.length+u.length),this.mulTo(u,h)},s.prototype.mulf=function(u){var h=new s(null);return h.words=new Array(this.length+u.length),D(this,u,h)},s.prototype.imul=function(u){return this.clone().mulTo(u,this)},s.prototype.imuln=function(u){var h=u<0;h&&(u=-u),n(typeof u=="number"),n(u<67108864);for(var p=0,y=0;y>=26,p+=w/67108864|0,p+=x>>>26,this.words[y]=x&67108863}return p!==0&&(this.words[y]=p,this.length++),h?this.ineg():this},s.prototype.muln=function(u){return this.clone().imuln(u)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(u){var h=N(u);if(h.length===0)return new s(1);for(var p=this,y=0;y=0);var h=u%26,p=(u-h)/26,y=67108863>>>26-h<<26-h,w;if(h!==0){var x=0;for(w=0;w>>26-h}x&&(this.words[w]=x,this.length++)}if(p!==0){for(w=this.length-1;w>=0;w--)this.words[w+p]=this.words[w];for(w=0;w=0);var y;h?y=(h-h%26)/26:y=0;var w=u%26,x=Math.min((u-w)/26,this.length),T=67108863^67108863>>>w<x)for(this.length-=x,f=0;f=0&&(E!==0||f>=y);f--){var U=this.words[f]|0;this.words[f]=E<<26-w|U>>>w,E=U&T}return m&&E!==0&&(m.words[m.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(u,h,p){return n(this.negative===0),this.iushrn(u,h,p)},s.prototype.shln=function(u){return this.clone().ishln(u)},s.prototype.ushln=function(u){return this.clone().iushln(u)},s.prototype.shrn=function(u){return this.clone().ishrn(u)},s.prototype.ushrn=function(u){return this.clone().iushrn(u)},s.prototype.testn=function(u){n(typeof u=="number"&&u>=0);var h=u%26,p=(u-h)/26,y=1<=0);var h=u%26,p=(u-h)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(h!==0&&p++,this.length=Math.min(p,this.length),h!==0){var y=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(u){if(n(typeof u=="number"),n(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-(m/67108864|0),this.words[w+p]=x&67108863}for(;w>26,this.words[w+p]=x&67108863;if(T===0)return this._strip();for(n(T===-1),T=0,w=0;w>26,this.words[w]=x&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(u,h){var p=this.length-u.length,y=this.clone(),w=u,x=w.words[w.length-1]|0,T=this._countBits(x);p=26-T,p!==0&&(w=w.ushln(p),y.iushln(p),x=w.words[w.length-1]|0);var m=y.length-w.length,f;if(h!=="mod"){f=new s(null),f.length=m+1,f.words=new Array(f.length);for(var E=0;E=0;q--){var I=(y.words[w.length+q]|0)*67108864+(y.words[w.length+q-1]|0);for(I=Math.min(I/x|0,67108863),y._ishlnsubmul(w,I,q);y.negative!==0;)I--,y.negative=0,y._ishlnsubmul(w,1,q),y.isZero()||(y.negative^=1);f&&(f.words[q]=I)}return f&&f._strip(),y._strip(),h!=="div"&&p!==0&&y.iushrn(p),{div:f||null,mod:y}},s.prototype.divmod=function(u,h,p){if(n(!u.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var y,w,x;return this.negative!==0&&u.negative===0?(x=this.neg().divmod(u,h),h!=="mod"&&(y=x.div.neg()),h!=="div"&&(w=x.mod.neg(),p&&w.negative!==0&&w.iadd(u)),{div:y,mod:w}):this.negative===0&&u.negative!==0?(x=this.divmod(u.neg(),h),h!=="mod"&&(y=x.div.neg()),{div:y,mod:x.mod}):this.negative&u.negative?(x=this.neg().divmod(u.neg(),h),h!=="div"&&(w=x.mod.neg(),p&&w.negative!==0&&w.isub(u)),{div:x.div,mod:w}):u.length>this.length||this.cmp(u)<0?{div:new s(0),mod:this}:u.length===1?h==="div"?{div:this.divn(u.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modrn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new s(this.modrn(u.words[0]))}:this._wordDiv(u,h)},s.prototype.div=function(u){return this.divmod(u,"div",!1).div},s.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},s.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},s.prototype.divRound=function(u){var h=this.divmod(u);if(h.mod.isZero())return h.div;var p=h.div.negative!==0?h.mod.isub(u):h.mod,y=u.ushrn(1),w=u.andln(1),x=p.cmp(y);return x<0||w===1&&x===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modrn=function(u){var h=u<0;h&&(u=-u),n(u<=67108863);for(var p=(1<<26)%u,y=0,w=this.length-1;w>=0;w--)y=(p*y+(this.words[w]|0))%u;return h?-y:y},s.prototype.modn=function(u){return this.modrn(u)},s.prototype.idivn=function(u){var h=u<0;h&&(u=-u),n(u<=67108863);for(var p=0,y=this.length-1;y>=0;y--){var w=(this.words[y]|0)+p*67108864;this.words[y]=w/u|0,p=w%u}return this._strip(),h?this.ineg():this},s.prototype.divn=function(u){return this.clone().idivn(u)},s.prototype.egcd=function(u){n(u.negative===0),n(!u.isZero());var h=this,p=u.clone();h.negative!==0?h=h.umod(u):h=h.clone();for(var y=new s(1),w=new s(0),x=new s(0),T=new s(1),m=0;h.isEven()&&p.isEven();)h.iushrn(1),p.iushrn(1),++m;for(var f=p.clone(),E=h.clone();!h.isZero();){for(var U=0,q=1;!(h.words[0]&q)&&U<26;++U,q<<=1);if(U>0)for(h.iushrn(U);U-- >0;)(y.isOdd()||w.isOdd())&&(y.iadd(f),w.isub(E)),y.iushrn(1),w.iushrn(1);for(var I=0,k=1;!(p.words[0]&k)&&I<26;++I,k<<=1);if(I>0)for(p.iushrn(I);I-- >0;)(x.isOdd()||T.isOdd())&&(x.iadd(f),T.isub(E)),x.iushrn(1),T.iushrn(1);h.cmp(p)>=0?(h.isub(p),y.isub(x),w.isub(T)):(p.isub(h),x.isub(y),T.isub(w))}return{a:x,b:T,gcd:p.iushln(m)}},s.prototype._invmp=function(u){n(u.negative===0),n(!u.isZero());var h=this,p=u.clone();h.negative!==0?h=h.umod(u):h=h.clone();for(var y=new s(1),w=new s(0),x=p.clone();h.cmpn(1)>0&&p.cmpn(1)>0;){for(var T=0,m=1;!(h.words[0]&m)&&T<26;++T,m<<=1);if(T>0)for(h.iushrn(T);T-- >0;)y.isOdd()&&y.iadd(x),y.iushrn(1);for(var f=0,E=1;!(p.words[0]&E)&&f<26;++f,E<<=1);if(f>0)for(p.iushrn(f);f-- >0;)w.isOdd()&&w.iadd(x),w.iushrn(1);h.cmp(p)>=0?(h.isub(p),y.isub(w)):(p.isub(h),w.isub(y))}var U;return h.cmpn(1)===0?U=y:U=w,U.cmpn(0)<0&&U.iadd(u),U},s.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var h=this.clone(),p=u.clone();h.negative=0,p.negative=0;for(var y=0;h.isEven()&&p.isEven();y++)h.iushrn(1),p.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;p.isEven();)p.iushrn(1);var w=h.cmp(p);if(w<0){var x=h;h=p,p=x}else if(w===0||p.cmpn(1)===0)break;h.isub(p)}while(!0);return p.iushln(y)},s.prototype.invm=function(u){return this.egcd(u).a.umod(u)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(u){return this.words[0]&u},s.prototype.bincn=function(u){n(typeof u=="number");var h=u%26,p=(u-h)/26,y=1<>>26,T&=67108863,this.words[x]=T}return w!==0&&(this.words[x]=w,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(u){var h=u<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var p;if(this.length>1)p=1;else{h&&(u=-u),n(u<=67108863,"Number is too big");var y=this.words[0]|0;p=y===u?0:yu.length)return 1;if(this.length=0;p--){var y=this.words[p]|0,w=u.words[p]|0;if(y!==w){yw&&(h=1);break}}return h},s.prototype.gtn=function(u){return this.cmpn(u)===1},s.prototype.gt=function(u){return this.cmp(u)===1},s.prototype.gten=function(u){return this.cmpn(u)>=0},s.prototype.gte=function(u){return this.cmp(u)>=0},s.prototype.ltn=function(u){return this.cmpn(u)===-1},s.prototype.lt=function(u){return this.cmp(u)===-1},s.prototype.lten=function(u){return this.cmpn(u)<=0},s.prototype.lte=function(u){return this.cmp(u)<=0},s.prototype.eqn=function(u){return this.cmpn(u)===0},s.prototype.eq=function(u){return this.cmp(u)===0},s.red=function(u){return new Y(u)},s.prototype.toRed=function(u){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(u){return this.red=u,this},s.prototype.forceRed=function(u){return n(!this.red,"Already a number in reduction context"),this._forceRed(u)},s.prototype.redAdd=function(u){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},s.prototype.redIAdd=function(u){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},s.prototype.redSub=function(u){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},s.prototype.redISub=function(u){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},s.prototype.redShl=function(u){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},s.prototype.redMul=function(u){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},s.prototype.redIMul=function(u){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(u){return n(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var L={k256:null,p224:null,p192:null,p25519:null};function B(v,u){this.name=v,this.p=new s(u,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}B.prototype._tmp=function(){var u=new s(null);return u.words=new Array(Math.ceil(this.n/13)),u},B.prototype.ireduce=function(u){var h=u,p;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),p=h.bitLength();while(p>this.n);var y=p0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},B.prototype.split=function(u,h){u.iushrn(this.n,0,h)},B.prototype.imulK=function(u){return u.imul(this.k)};function G(){B.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(G,B),G.prototype.split=function(u,h){for(var p=4194303,y=Math.min(u.length,9),w=0;w>>22,x=T}x>>>=22,u.words[w-10]=x,x===0&&u.length>10?u.length-=10:u.length-=9},G.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var h=0,p=0;p>>=26,u.words[p]=w,h=y}return h!==0&&(u.words[u.length++]=h),u},s._prime=function(u){if(L[u])return L[u];var h;if(u==="k256")h=new G;else if(u==="p224")h=new z;else if(u==="p192")h=new W;else if(u==="p25519")h=new K;else throw new Error("Unknown prime "+u);return L[u]=h,h};function Y(v){if(typeof v=="string"){var u=s._prime(v);this.m=u.p,this.prime=u}else n(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}Y.prototype._verify1=function(u){n(u.negative===0,"red works only with positives"),n(u.red,"red works only with red numbers")},Y.prototype._verify2=function(u,h){n((u.negative|h.negative)===0,"red works only with positives"),n(u.red&&u.red===h.red,"red works only with red numbers")},Y.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):(d(u,u.umod(this.m)._forceRed(this)),u)},Y.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},Y.prototype.add=function(u,h){this._verify2(u,h);var p=u.add(h);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},Y.prototype.iadd=function(u,h){this._verify2(u,h);var p=u.iadd(h);return p.cmp(this.m)>=0&&p.isub(this.m),p},Y.prototype.sub=function(u,h){this._verify2(u,h);var p=u.sub(h);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},Y.prototype.isub=function(u,h){this._verify2(u,h);var p=u.isub(h);return p.cmpn(0)<0&&p.iadd(this.m),p},Y.prototype.shl=function(u,h){return this._verify1(u),this.imod(u.ushln(h))},Y.prototype.imul=function(u,h){return this._verify2(u,h),this.imod(u.imul(h))},Y.prototype.mul=function(u,h){return this._verify2(u,h),this.imod(u.mul(h))},Y.prototype.isqr=function(u){return this.imul(u,u.clone())},Y.prototype.sqr=function(u){return this.mul(u,u)},Y.prototype.sqrt=function(u){if(u.isZero())return u.clone();var h=this.m.andln(3);if(n(h%2===1),h===3){var p=this.m.add(new s(1)).iushrn(2);return this.pow(u,p)}for(var y=this.m.subn(1),w=0;!y.isZero()&&y.andln(1)===0;)w++,y.iushrn(1);n(!y.isZero());var x=new s(1).toRed(this),T=x.redNeg(),m=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);this.pow(f,m).cmp(T)!==0;)f.redIAdd(T);for(var E=this.pow(f,y),U=this.pow(u,y.addn(1).iushrn(1)),q=this.pow(u,y),I=w;q.cmp(x)!==0;){for(var k=q,$=0;k.cmp(x)!==0;$++)k=k.redSqr();n($=0;w--){for(var E=h.words[w],U=f-1;U>=0;U--){var q=E>>U&1;if(x!==y[0]&&(x=this.sqr(x)),q===0&&T===0){m=0;continue}T<<=1,T|=q,m++,!(m!==p&&(w!==0||U!==0))&&(x=this.mul(x,y[T]),m=0,T=0)}f=26}return x},Y.prototype.convertTo=function(u){var h=u.umod(this.m);return h===u?h.clone():h},Y.prototype.convertFrom=function(u){var h=u.clone();return h.red=null,h},s.mont=function(u){return new X(u)};function X(v){Y.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(X,Y),X.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},X.prototype.convertFrom=function(u){var h=this.imod(u.mul(this.rinv));return h.red=null,h},X.prototype.imul=function(u,h){if(u.isZero()||h.isZero())return u.words[0]=0,u.length=1,u;var p=u.imul(h),y=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=p.isub(y).iushrn(this.shift),x=w;return w.cmp(this.m)>=0?x=w.isub(this.m):w.cmpn(0)<0&&(x=w.iadd(this.m)),x._forceRed(this)},X.prototype.mul=function(u,h){if(u.isZero()||h.isZero())return new s(0)._forceRed(this);var p=u.mul(h),y=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=p.isub(y).iushrn(this.shift),x=w;return w.cmp(this.m)>=0?x=w.isub(this.m):w.cmpn(0)<0&&(x=w.iadd(this.m)),x._forceRed(this)},X.prototype.invm=function(u){var h=this.imod(u._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(t,Z)})(wu);var Ks=wu.exports,li={};Object.defineProperty(li,"__esModule",{value:!0});li.EVENTS=void 0;li.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var zi={},Vf={},Ir={},Uf=Bi;Bi.default=Bi;Bi.stable=Gf;Bi.stableStringify=Gf;var Ps="[...]",zf="[Circular]",cn=[],nn=[];function qf(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Bi(t,e,r,n){typeof n>"u"&&(n=qf()),Ja(t,"",0,[],void 0,0,n);var i;try{nn.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Jf(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;cn.length!==0;){var s=cn.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Un(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),cn.push([n,r,e,i])):nn.push([e,r,t]):(n[r]=t,cn.push([n,r,e]))}function Ja(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;ao.depthLimit){Un(Ps,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Un(Ps,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;ae?1:0}function Gf(t,e,r,n){typeof n>"u"&&(n=qf());var i=Za(t,"",0,[],void 0,0,n)||t,s;try{nn.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Jf(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;cn.length!==0;){var o=cn.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Za(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;ao.depthLimit){Un(Ps,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Un(Ps,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a0)for(var n=0;n=1e3&&t<=4999}function o0(t,e){if(e!=="[Circular]")return e}var _u={},Ar={};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.errorValues=Ar.errorCodes=void 0;Ar.errorCodes={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}};Ar.errorValues={"-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."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Ar,r=Ir,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(b,C=i){if(Number.isInteger(b)){const A=b.toString();if(g(e.errorValues,A))return e.errorValues[A].message;if(l(b))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return C}t.getMessageFromCode=o;function a(b){if(!Number.isInteger(b))return!1;const C=b.toString();return!!(e.errorValues[C]||l(b))}t.isValidCode=a;function c(b,{fallbackError:C=s,shouldIncludeStack:A=!1}={}){var P,N;if(!C||!Number.isInteger(C.code)||typeof C.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(b instanceof r.EthereumRpcError)return b.serialize();const M={};if(b&&typeof b=="object"&&!Array.isArray(b)&&g(b,"code")&&a(b.code)){const O=b;M.code=O.code,O.message&&typeof O.message=="string"?(M.message=O.message,g(O,"data")&&(M.data=O.data)):(M.message=o(M.code),M.data={originalError:d(b)})}else{M.code=C.code;const O=(P=b)===null||P===void 0?void 0:P.message;M.message=O&&typeof O=="string"?O:C.message,M.data={originalError:d(b)}}const R=(N=b)===null||N===void 0?void 0:N.stack;return A&&b&&R&&typeof R=="string"&&(M.stack=R),M}t.serializeError=c;function l(b){return b>=-32099&&b<=-32e3}function d(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function g(b,C){return Object.prototype.hasOwnProperty.call(b,C)}})(_u);var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.ethErrors=void 0;const Su=Ir,Qf=_u,dt=Ar;Xs.ethErrors={rpc:{parse:t=>Tt(dt.errorCodes.rpc.parse,t),invalidRequest:t=>Tt(dt.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Tt(dt.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Tt(dt.errorCodes.rpc.methodNotFound,t),internal:t=>Tt(dt.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Tt(e,t)},invalidInput:t=>Tt(dt.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Tt(dt.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Tt(dt.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Tt(dt.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Tt(dt.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Tt(dt.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Ei(dt.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Ei(dt.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Ei(dt.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Ei(dt.errorCodes.provider.disconnected,t),chainDisconnected:t=>Ei(dt.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Su.EthereumProviderError(e,r,n)}}};function Tt(t,e){const[r,n]=Yf(e);return new Su.EthereumRpcError(t,r||Qf.getMessageFromCode(t),n)}function Ei(t,e){const[r,n]=Yf(e);return new Su.EthereumProviderError(t,r||Qf.getMessageFromCode(t),n)}function Yf(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Ir;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=_u;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Xs;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Ar;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Vf);var _e={},eo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(eo);Object.defineProperty(_e,"__esModule",{value:!0});_e.EthereumAddressFromSignedMessageResponse=_e.SubmitEthereumTransactionResponse=_e.SignEthereumTransactionResponse=_e.SignEthereumMessageResponse=_e.isRequestEthereumAccountsResponse=_e.SelectProviderResponse=_e.WatchAssetReponse=_e.RequestEthereumAccountsResponse=_e.SwitchEthereumChainResponse=_e.AddEthereumChainResponse=_e.isErrorResponse=void 0;const cr=eo;function a0(t){var e,r;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((r=t)===null||r===void 0?void 0:r.errorMessage)!==void 0}_e.isErrorResponse=a0;function u0(t){return{method:cr.Web3Method.addEthereumChain,result:t}}_e.AddEthereumChainResponse=u0;function c0(t){return{method:cr.Web3Method.switchEthereumChain,result:t}}_e.SwitchEthereumChainResponse=c0;function l0(t){return{method:cr.Web3Method.requestEthereumAccounts,result:t}}_e.RequestEthereumAccountsResponse=l0;function f0(t){return{method:cr.Web3Method.watchAsset,result:t}}_e.WatchAssetReponse=f0;function h0(t){return{method:cr.Web3Method.selectProvider,result:t}}_e.SelectProviderResponse=h0;function d0(t){return t&&t.method===cr.Web3Method.requestEthereumAccounts}_e.isRequestEthereumAccountsResponse=d0;function p0(t){return{method:cr.Web3Method.signEthereumMessage,result:t}}_e.SignEthereumMessageResponse=p0;function g0(t){return{method:cr.Web3Method.signEthereumTransaction,result:t}}_e.SignEthereumTransactionResponse=g0;function b0(t){return{method:cr.Web3Method.submitEthereumTransaction,result:t}}_e.SubmitEthereumTransactionResponse=b0;function v0(t){return{method:cr.Web3Method.ethereumAddressFromSignedMessage,result:t}}_e.EthereumAddressFromSignedMessageResponse=v0;var fi={};Object.defineProperty(fi,"__esModule",{value:!0});fi.LIB_VERSION=void 0;fi.LIB_VERSION="3.7.2";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=Vf,r=_e,n=fi;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(d){return d!==void 0?(0,e.getMessageFromCode)(d):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(d="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${d}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(d,g){const b=(0,e.serializeError)(o(d),{shouldIncludeStack:!0}),C=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");C.searchParams.set("version",n.LIB_VERSION),C.searchParams.set("code",b.code.toString());const A=a(b.data,g);return A&&C.searchParams.set("method",A),C.searchParams.set("message",b.message),Object.assign(Object.assign({},b),{docUrl:C.href})}t.serializeError=s;function o(d){return typeof d=="string"?{message:d,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(d)?Object.assign(Object.assign({},d),{message:d.errorMessage,code:d.errorCode,data:{method:d.method,result:d.result}}):d}function a(d,g){var b;const C=(b=d)===null||b===void 0?void 0:b.method;if(C)return C;if(g!==void 0)return typeof g=="string"?g:Array.isArray(g)?g.length>0?g[0].method:void 0:g.method}function c(d){var g;if(typeof d=="number")return d;if(l(d))return(g=d.code)!==null&&g!==void 0?g:d.errorCode}t.getErrorCode=c;function l(d){return typeof d=="object"&&d!==null&&(typeof d.code=="number"||typeof d.errorCode=="number")}})(zi);var hi={},Kf={exports:{}},Qa={exports:{}};typeof Object.create=="function"?Qa.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Qa.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var Gt=Qa.exports,Ya={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(t,e){var r=Ui,n=r.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,c){return n(o,a,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(Ya,Ya.exports);var bn=Ya.exports,Xf=bn.Buffer;function to(t,e){this._block=Xf.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}to.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=Xf.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};to.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var di=to,y0=Gt,eh=di,m0=bn.Buffer,w0=[1518500249,1859775393,-1894007588,-899497514],_0=new Array(80);function qi(){this.init(),this._w=_0,eh.call(this,64,56)}y0(qi,eh);qi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function S0(t){return t<<5|t>>>27}function E0(t){return t<<30|t>>>2}function M0(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}qi.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var c=0;c<80;++c){var l=~~(c/20),d=S0(r)+M0(l,n,i,s)+o+e[c]+w0[l]|0;o=s,s=i,i=E0(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};qi.prototype._hash=function(){var t=m0.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var x0=qi,C0=Gt,th=di,R0=bn.Buffer,I0=[1518500249,1859775393,-1894007588,-899497514],A0=new Array(80);function Gi(){this.init(),this._w=A0,th.call(this,64,56)}C0(Gi,th);Gi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function T0(t){return t<<1|t>>>31}function k0(t){return t<<5|t>>>27}function O0(t){return t<<30|t>>>2}function N0(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Gi.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=T0(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var c=0;c<80;++c){var l=~~(c/20),d=k0(r)+N0(l,n,i,s)+o+e[c]+I0[l]|0;o=s,s=i,i=O0(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Gi.prototype._hash=function(){var t=R0.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var L0=Gi,P0=Gt,rh=di,D0=bn.Buffer,$0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],B0=new Array(64);function Ji(){this.init(),this._w=B0,rh.call(this,64,56)}P0(Ji,rh);Ji.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function j0(t,e,r){return r^t&(e^r)}function F0(t,e,r){return t&e|r&(t|e)}function W0(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function H0(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function V0(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function U0(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}Ji.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,l=this._h|0,d=0;d<16;++d)e[d]=t.readInt32BE(d*4);for(;d<64;++d)e[d]=U0(e[d-2])+e[d-7]+V0(e[d-15])+e[d-16]|0;for(var g=0;g<64;++g){var b=l+H0(o)+j0(o,a,c)+$0[g]+e[g]|0,C=W0(r)+F0(r,n,i)|0;l=c,c=a,a=o,o=s+b|0,s=i,i=n,n=r,r=b+C|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0};Ji.prototype._hash=function(){var t=D0.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var nh=Ji,z0=Gt,q0=nh,G0=di,J0=bn.Buffer,Z0=new Array(64);function ro(){this.init(),this._w=Z0,G0.call(this,64,56)}z0(ro,q0);ro.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};ro.prototype._hash=function(){var t=J0.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var Q0=ro,Y0=Gt,ih=di,K0=bn.Buffer,Ac=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],X0=new Array(160);function Zi(){this.init(),this._w=X0,ih.call(this,128,112)}Y0(Zi,ih);Zi.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Tc(t,e,r){return r^t&(e^r)}function kc(t,e,r){return t&e|r&(t|e)}function Oc(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Nc(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function eg(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function tg(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function rg(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function ng(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function it(t,e){return t>>>0>>0?1:0}Zi.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,l=this._hh|0,d=this._al|0,g=this._bl|0,b=this._cl|0,C=this._dl|0,A=this._el|0,P=this._fl|0,N=this._gl|0,M=this._hl|0,R=0;R<32;R+=2)e[R]=t.readInt32BE(R*4),e[R+1]=t.readInt32BE(R*4+4);for(;R<160;R+=2){var O=e[R-30],D=e[R-15*2+1],L=eg(O,D),B=tg(D,O);O=e[R-2*2],D=e[R-2*2+1];var G=rg(O,D),z=ng(D,O),W=e[R-7*2],K=e[R-7*2+1],Y=e[R-16*2],X=e[R-16*2+1],v=B+K|0,u=L+W+it(v,B)|0;v=v+z|0,u=u+G+it(v,z)|0,v=v+X|0,u=u+Y+it(v,X)|0,e[R]=u,e[R+1]=v}for(var h=0;h<160;h+=2){u=e[h],v=e[h+1];var p=kc(r,n,i),y=kc(d,g,b),w=Oc(r,d),x=Oc(d,r),T=Nc(o,A),m=Nc(A,o),f=Ac[h],E=Ac[h+1],U=Tc(o,a,c),q=Tc(A,P,N),I=M+m|0,k=l+T+it(I,M)|0;I=I+q|0,k=k+U+it(I,q)|0,I=I+E|0,k=k+f+it(I,E)|0,I=I+v|0,k=k+u+it(I,v)|0;var $=x+y|0,V=w+p+it($,x)|0;l=c,M=N,c=a,N=P,a=o,P=A,A=C+I|0,o=s+k+it(A,C)|0,s=i,C=b,i=n,b=g,n=r,g=d,d=I+$|0,r=k+V+it(d,I)|0}this._al=this._al+d|0,this._bl=this._bl+g|0,this._cl=this._cl+b|0,this._dl=this._dl+C|0,this._el=this._el+A|0,this._fl=this._fl+P|0,this._gl=this._gl+N|0,this._hl=this._hl+M|0,this._ah=this._ah+r+it(this._al,d)|0,this._bh=this._bh+n+it(this._bl,g)|0,this._ch=this._ch+i+it(this._cl,b)|0,this._dh=this._dh+s+it(this._dl,C)|0,this._eh=this._eh+o+it(this._el,A)|0,this._fh=this._fh+a+it(this._fl,P)|0,this._gh=this._gh+c+it(this._gl,N)|0,this._hh=this._hh+l+it(this._hl,M)|0};Zi.prototype._hash=function(){var t=K0.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var sh=Zi,ig=Gt,sg=sh,og=di,ag=bn.Buffer,ug=new Array(160);function no(){this.init(),this._w=ug,og.call(this,128,112)}ig(no,sg);no.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};no.prototype._hash=function(){var t=ag.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var cg=no,vn=Kf.exports=function(e){e=e.toLowerCase();var r=vn[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};vn.sha=x0;vn.sha1=L0;vn.sha224=Q0;vn.sha256=nh;vn.sha384=cg;vn.sha512=sh;var lg=Kf.exports,J={},fg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0},Lc=typeof Symbol<"u"&&Symbol,hg=fg,dg=function(){return typeof Lc!="function"||typeof Symbol!="function"||typeof Lc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hg()},Pc={foo:{}},pg=Object,gg=function(){return{__proto__:Pc}.foo===Pc.foo&&!({__proto__:null}instanceof pg)},bg="Function.prototype.bind called on incompatible ",vg=Object.prototype.toString,yg=Math.max,mg="[object Function]",Dc=function(e,r){for(var n=[],i=0;i"u"||!at?ce:at(Uint8Array),un={"%AggregateError%":typeof AggregateError>"u"?ce:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ce:ArrayBuffer,"%ArrayIteratorPrototype%":Ln&&at?at([][Symbol.iterator]()):ce,"%AsyncFromSyncIteratorPrototype%":ce,"%AsyncFunction%":Fn,"%AsyncGenerator%":Fn,"%AsyncGeneratorFunction%":Fn,"%AsyncIteratorPrototype%":Fn,"%Atomics%":typeof Atomics>"u"?ce:Atomics,"%BigInt%":typeof BigInt>"u"?ce:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ce:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ce:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ce:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ce:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ce:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ce:FinalizationRegistry,"%Function%":ah,"%GeneratorFunction%":Fn,"%Int8Array%":typeof Int8Array>"u"?ce:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ce:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ce:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ln&&at?at(at([][Symbol.iterator]())):ce,"%JSON%":typeof JSON=="object"?JSON:ce,"%Map%":typeof Map>"u"?ce:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ln||!at?ce:at(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ce:Promise,"%Proxy%":typeof Proxy>"u"?ce:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ce:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ce:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ln||!at?ce:at(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ce:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ln&&at?at(""[Symbol.iterator]()):ce,"%Symbol%":Ln?Symbol:ce,"%SyntaxError%":Yn,"%ThrowTypeError%":xg,"%TypedArray%":Rg,"%TypeError%":zn,"%Uint8Array%":typeof Uint8Array>"u"?ce:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ce:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ce:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ce:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ce:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ce:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ce:WeakSet};if(at)try{null.error}catch(t){var Ig=at(at(t));un["%Error.prototype%"]=Ig}var Ag=function t(e){var r;if(e==="%AsyncFunction%")r=oa("async function () {}");else if(e==="%GeneratorFunction%")r=oa("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=oa("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&at&&(r=at(i.prototype))}return un[e]=r,r},Bc={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Qi=oh,Ds=Mg,Tg=Qi.call(Function.call,Array.prototype.concat),kg=Qi.call(Function.apply,Array.prototype.splice),jc=Qi.call(Function.call,String.prototype.replace),$s=Qi.call(Function.call,String.prototype.slice),Og=Qi.call(Function.call,RegExp.prototype.exec),Ng=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Lg=/\\(\\)?/g,Pg=function(e){var r=$s(e,0,1),n=$s(e,-1);if(r==="%"&&n!=="%")throw new Yn("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Yn("invalid intrinsic syntax, expected opening `%`");var i=[];return jc(e,Ng,function(s,o,a,c){i[i.length]=a?jc(c,Lg,"$1"):o||s}),i},Dg=function(e,r){var n=e,i;if(Ds(Bc,n)&&(i=Bc[n],n="%"+i[0]+"%"),Ds(un,n)){var s=un[n];if(s===Fn&&(s=Ag(n)),typeof s>"u"&&!r)throw new zn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Yn("intrinsic "+e+" does not exist!")},Eu=function(e,r){if(typeof e!="string"||e.length===0)throw new zn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new zn('"allowMissing" argument must be a boolean');if(Og(/^%?[^%]*%?$/,e)===null)throw new Yn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Pg(e),i=n.length>0?n[0]:"",s=Dg("%"+i+"%",r),o=s.name,a=s.value,c=!1,l=s.alias;l&&(i=l[0],kg(n,Tg([0,1],l)));for(var d=1,g=!0;d=n.length){var P=an(a,b);g=!!P,g&&"get"in P&&!("originalValue"in P.get)?a=P.get:a=a[b]}else g=Ds(a,b),a=a[b];g&&!c&&(un[o]=a)}}return a},uh={exports:{}};(function(t){var e=oh,r=Eu,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(i,n),o=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(g){var b=s(e,i,arguments);if(o&&a){var C=o(b,"length");C.configurable&&a(b,"length",{value:1+c(0,g.length-(arguments.length-1))})}return b};var l=function(){return s(e,n,arguments)};a?a(t.exports,"apply",{value:l}):t.exports.apply=l})(uh);var $g=uh.exports,ch=Eu,lh=$g,Bg=lh(ch("String.prototype.indexOf")),jg=function(e,r){var n=ch(e,!!r);return typeof n=="function"&&Bg(e,".prototype.")>-1?lh(n):n},Mu=typeof Map=="function"&&Map.prototype,ua=Object.getOwnPropertyDescriptor&&Mu?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Bs=Mu&&ua&&typeof ua.get=="function"?ua.get:null,Fc=Mu&&Map.prototype.forEach,xu=typeof Set=="function"&&Set.prototype,ca=Object.getOwnPropertyDescriptor&&xu?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,js=xu&&ca&&typeof ca.get=="function"?ca.get:null,Wc=xu&&Set.prototype.forEach,Fg=typeof WeakMap=="function"&&WeakMap.prototype,ki=Fg?WeakMap.prototype.has:null,Wg=typeof WeakSet=="function"&&WeakSet.prototype,Oi=Wg?WeakSet.prototype.has:null,Hg=typeof WeakRef=="function"&&WeakRef.prototype,Hc=Hg?WeakRef.prototype.deref:null,Vg=Boolean.prototype.valueOf,Ug=Object.prototype.toString,zg=Function.prototype.toString,qg=String.prototype.match,Cu=String.prototype.slice,Cr=String.prototype.replace,Gg=String.prototype.toUpperCase,Vc=String.prototype.toLowerCase,fh=RegExp.prototype.test,Uc=Array.prototype.concat,nr=Array.prototype.join,Jg=Array.prototype.slice,zc=Math.floor,Ka=typeof BigInt=="function"?BigInt.prototype.valueOf:null,la=Object.getOwnPropertySymbols,Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",vt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Kn||"symbol")?Symbol.toStringTag:null,hh=Object.prototype.propertyIsEnumerable,qc=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Gc(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||fh.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-zc(-t):zc(t);if(n!==t){var i=String(n),s=Cu.call(e,i.length+1);return Cr.call(i,r,"$&_")+"."+Cr.call(Cr.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Cr.call(e,r,"$&_")}var eu=Js,Jc=eu.custom,Zc=ph(Jc)?Jc:null,Zg=function t(e,r,n,i){var s=r||{};if(Er(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Er(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Er(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Er(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Er(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return bh(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?Gc(e,c):c}if(typeof e=="bigint"){var l=String(e)+"n";return a?Gc(e,l):l}var d=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=d&&d>0&&typeof e=="object")return tu(e)?"[Array]":"[Object]";var g=db(s,n);if(typeof i>"u")i=[];else if(gh(i,e)>=0)return"[Circular]";function b(v,u,h){if(u&&(i=Jg.call(i),i.push(u)),h){var p={depth:s.depth};return Er(s,"quoteStyle")&&(p.quoteStyle=s.quoteStyle),t(v,p,n+1,i)}return t(v,s,n+1,i)}if(typeof e=="function"&&!Qc(e)){var C=ib(e),A=gs(e,b);return"[Function"+(C?": "+C:" (anonymous)")+"]"+(A.length>0?" { "+nr.call(A,", ")+" }":"")}if(ph(e)){var P=Kn?Cr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Xa.call(e);return typeof e=="object"&&!Kn?Mi(P):P}if(lb(e)){for(var N="<"+Vc.call(String(e.nodeName)),M=e.attributes||[],R=0;R",N}if(tu(e)){if(e.length===0)return"[]";var O=gs(e,b);return g&&!hb(O)?"["+ru(O,g)+"]":"[ "+nr.call(O,", ")+" ]"}if(Kg(e)){var D=gs(e,b);return!("cause"in Error.prototype)&&"cause"in e&&!hh.call(e,"cause")?"{ ["+String(e)+"] "+nr.call(Uc.call("[cause]: "+b(e.cause),D),", ")+" }":D.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+nr.call(D,", ")+" }"}if(typeof e=="object"&&o){if(Zc&&typeof e[Zc]=="function"&&eu)return eu(e,{depth:d-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(sb(e)){var L=[];return Fc&&Fc.call(e,function(v,u){L.push(b(u,e,!0)+" => "+b(v,e))}),Yc("Map",Bs.call(e),L,g)}if(ub(e)){var B=[];return Wc&&Wc.call(e,function(v){B.push(b(v,e))}),Yc("Set",js.call(e),B,g)}if(ob(e))return fa("WeakMap");if(cb(e))return fa("WeakSet");if(ab(e))return fa("WeakRef");if(eb(e))return Mi(b(Number(e)));if(rb(e))return Mi(b(Ka.call(e)));if(tb(e))return Mi(Vg.call(e));if(Xg(e))return Mi(b(String(e)));if(e===globalThis)return typeof window<"u"?"{ [object Window] }":"{ [object globalThis] }";if(!Yg(e)&&!Qc(e)){var G=gs(e,b),z=qc?qc(e)===Object.prototype:e instanceof Object||e.constructor===Object,W=e instanceof Object?"":"null prototype",K=!z&&vt&&Object(e)===e&&vt in e?Cu.call(Pr(e),8,-1):W?"Object":"",Y=z||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",X=Y+(K||W?"["+nr.call(Uc.call([],K||[],W||[]),": ")+"] ":"");return G.length===0?X+"{}":g?X+"{"+ru(G,g)+"}":X+"{ "+nr.call(G,", ")+" }"}return String(e)};function dh(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Qg(t){return Cr.call(String(t),/"/g,""")}function tu(t){return Pr(t)==="[object Array]"&&(!vt||!(typeof t=="object"&&vt in t))}function Yg(t){return Pr(t)==="[object Date]"&&(!vt||!(typeof t=="object"&&vt in t))}function Qc(t){return Pr(t)==="[object RegExp]"&&(!vt||!(typeof t=="object"&&vt in t))}function Kg(t){return Pr(t)==="[object Error]"&&(!vt||!(typeof t=="object"&&vt in t))}function Xg(t){return Pr(t)==="[object String]"&&(!vt||!(typeof t=="object"&&vt in t))}function eb(t){return Pr(t)==="[object Number]"&&(!vt||!(typeof t=="object"&&vt in t))}function tb(t){return Pr(t)==="[object Boolean]"&&(!vt||!(typeof t=="object"&&vt in t))}function ph(t){if(Kn)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Xa)return!1;try{return Xa.call(t),!0}catch{}return!1}function rb(t){if(!t||typeof t!="object"||!Ka)return!1;try{return Ka.call(t),!0}catch{}return!1}var nb=Object.prototype.hasOwnProperty||function(t){return t in this};function Er(t,e){return nb.call(t,e)}function Pr(t){return Ug.call(t)}function ib(t){if(t.name)return t.name;var e=qg.call(zg.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function gh(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return bh(Cu.call(t,0,e.maxStringLength),e)+n}var i=Cr.call(Cr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,fb);return dh(i,"single",e)}function fb(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Gg.call(e.toString(16))}function Mi(t){return"Object("+t+")"}function fa(t){return t+" { ? }"}function Yc(t,e,r,n){var i=n?ru(r,n):nr.call(r,", ");return t+" ("+e+") {"+i+"}"}function hb(t){for(var e=0;e=0)return!1;return!0}function db(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=nr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:nr.call(Array(e+1),r)}}function ru(t,e){if(t.length===0)return"";var r=` `+e.prev+e.base;return r+nr.call(t,","+r)+` `+e.prev}function gs(t,e){var r=tu(t),n=[];if(r){n.length=t.length;for(var i=0;i1;){var r=e.pop(),n=r.obj[r.prop];if(Xr(n)){for(var i=[],s=0;s=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===Ib.RFC1738&&(l===40||l===41)){a+=o.charAt(c);continue}if(l<128){a=a+Yt[l];continue}if(l<2048){a=a+(Yt[192|l>>6]+Yt[128|l&63]);continue}if(l<55296||l>=57344){a=a+(Yt[224|l>>12]+Yt[128|l>>6&63]+Yt[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|o.charCodeAt(c)&1023),a+=Yt[240|l>>18]+Yt[128|l>>12&63]+Yt[128|l>>6&63]+Yt[128|l&63]}return a},Lb=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i"u"&&(O=0)}if(typeof c=="function"?M=c(r,M):M instanceof Date?M=g(M):n==="comma"&&dr(M)&&(M=ks.maybeMap(M,function(p){return p instanceof Date?g(p):p})),M===null){if(s)return a&&!A?a(r,bt.encoder,P,"key",b):r;M=""}if(Hb(M)||ks.isBuffer(M)){if(a){var B=A?r:a(r,bt.encoder,P,"key",b);return[C(B)+"="+C(a(M,bt.encoder,P,"value",b))]}return[C(r)+"="+C(String(M))]}var G=[];if(typeof M>"u")return G;var z;if(n==="comma"&&dr(M))A&&a&&(M=ks.maybeMap(M,a)),z=[{value:M.length>0?M.join(",")||null:void 0}];else if(dr(c))z=c;else{var W=Object.keys(M);z=l?W.sort(l):W}for(var K=i&&dr(M)&&M.length===1?r+"[]":r,Y=0;Y"u"?bt.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:bt.charsetSentinel,delimiter:typeof e.delimiter>"u"?bt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:bt.encode,encoder:typeof e.encoder=="function"?e.encoder:bt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:bt.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:bt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:bt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:bt.strictNullHandling}},zb=function(t,e){var r=t,n=Ub(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):dr(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in Kc?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=Kc[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var d=mh(),g=0;g0?A+C:""},Xn=yh,nu=Object.prototype.hasOwnProperty,qb=Array.isArray,st={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Xn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Gb=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},_h=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Jb="utf8=%26%2310003%3B",Zb="utf8=%E2%9C%93",Qb=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,c,l=r.charset;if(r.charsetSentinel)for(c=0;c-1&&(A=qb(A)?[A]:A),nu.call(n,C)?n[C]=Xn.combine(n[C],A):n[C]=A}return n},Yb=function(t,e,r,n){for(var i=n?e:_h(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!r.parseArrays&&c===""?o={0:i}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(o=[],o[l]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},Kb=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(s),l=c?s.slice(0,c.index):s,d=[];if(l){if(!n.plainObjects&&nu.call(Object.prototype,l)&&!n.allowPrototypes)return;d.push(l)}for(var g=0;n.depth>0&&(c=a.exec(s))!==null&&g"u"?st.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?st.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:st.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:st.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:st.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:st.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:st.comma,decoder:typeof e.decoder=="function"?e.decoder:st.decoder,delimiter:typeof e.delimiter=="string"||Xn.isRegExp(e.delimiter)?e.delimiter:st.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:st.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:st.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:st.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:st.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:st.strictNullHandling}},ev=function(t,e){var r=Xb(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Qb(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;on}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function r(n){return Math.floor(n)}t.IntNumber=r,t.RegExpString=e(),function(n){n.CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(Yi);var sv=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(J,"__esModule",{value:!0});J.isInIFrame=J.createQrUrl=J.getFavicon=J.range=J.isBigNumber=J.ensureParsedJSONObject=J.ensureBN=J.ensureRegExpString=J.ensureIntNumber=J.ensureBuffer=J.ensureAddressString=J.ensureEvenLengthHexString=J.ensureHexString=J.isHexString=J.prepend0x=J.strip0x=J.has0xPrefix=J.hexStringFromIntNumber=J.intNumberFromHexString=J.bigIntStringFromBN=J.hexStringFromBuffer=J.hexStringToUint8Array=J.uint8ArrayToHex=J.randomBytesHex=void 0;const Mr=sv(Ks),ov=iv,yn=zi,$t=Yi,Sh=/^[0-9]*$/,Eh=/^[a-f0-9]*$/;function av(t){return Mh(crypto.getRandomValues(new Uint8Array(t)))}J.randomBytesHex=av;function Mh(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}J.uint8ArrayToHex=Mh;function uv(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}J.hexStringToUint8Array=uv;function cv(t,e=!1){const r=t.toString("hex");return(0,$t.HexString)(e?"0x"+r:r)}J.hexStringFromBuffer=cv;function lv(t){return(0,$t.BigIntString)(t.toString(10))}J.bigIntStringFromBN=lv;function fv(t){return(0,$t.IntNumber)(new Mr.default(Xi(t,!1),16).toNumber())}J.intNumberFromHexString=fv;function hv(t){return(0,$t.HexString)("0x"+new Mr.default(t).toString(16))}J.hexStringFromIntNumber=hv;function Tu(t){return t.startsWith("0x")||t.startsWith("0X")}J.has0xPrefix=Tu;function io(t){return Tu(t)?t.slice(2):t}J.strip0x=io;function xh(t){return Tu(t)?"0x"+t.slice(2):"0x"+t}J.prepend0x=xh;function Ki(t){if(typeof t!="string")return!1;const e=io(t).toLowerCase();return Eh.test(e)}J.isHexString=Ki;function Ch(t,e=!1){if(typeof t=="string"){const r=io(t).toLowerCase();if(Eh.test(r))return(0,$t.HexString)(e?"0x"+r:r)}throw yn.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}J.ensureHexString=Ch;function Xi(t,e=!1){let r=Ch(t,!1);return r.length%2===1&&(r=(0,$t.HexString)("0"+r)),e?(0,$t.HexString)("0x"+r):r}J.ensureEvenLengthHexString=Xi;function dv(t){if(typeof t=="string"){const e=io(t).toLowerCase();if(Ki(e)&&e.length===40)return(0,$t.AddressString)(xh(e))}throw yn.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}J.ensureAddressString=dv;function pv(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string")if(Ki(t)){const e=Xi(t,!1);return Buffer.from(e,"hex")}else return Buffer.from(t,"utf8");throw yn.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}J.ensureBuffer=pv;function Rh(t){if(typeof t=="number"&&Number.isInteger(t))return(0,$t.IntNumber)(t);if(typeof t=="string"){if(Sh.test(t))return(0,$t.IntNumber)(Number(t));if(Ki(t))return(0,$t.IntNumber)(new Mr.default(Xi(t,!1),16).toNumber())}throw yn.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}J.ensureIntNumber=Rh;function gv(t){if(t instanceof RegExp)return(0,$t.RegExpString)(t.toString());throw yn.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}J.ensureRegExpString=gv;function bv(t){if(t!==null&&(Mr.default.isBN(t)||Ih(t)))return new Mr.default(t.toString(10),10);if(typeof t=="number")return new Mr.default(Rh(t));if(typeof t=="string"){if(Sh.test(t))return new Mr.default(t,10);if(Ki(t))return new Mr.default(Xi(t,!1),16)}throw yn.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}J.ensureBN=bv;function vv(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw yn.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}J.ensureParsedJSONObject=vv;function Ih(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}J.isBigNumber=Ih;function yv(t,e){return Array.from({length:e-t},(r,n)=>t+n)}J.range=yv;function mv(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}J.getFavicon=mv;function wv(t,e,r,n,i,s){const o=n?"parent-id":"id",a=(0,ov.stringify)({[o]:t,secret:e,server:r,v:i,chainId:s});return`${r}/#/link?${a}`}J.createQrUrl=wv;function _v(){try{return window.frameElement!==null}catch{return!1}}J.isInIFrame=_v;Object.defineProperty(hi,"__esModule",{value:!0});hi.Session=void 0;const el=lg,tl=J,rl="session:id",nl="session:secret",il="session:linked";class ku{constructor(e,r,n,i){this._storage=e,this._id=r||(0,tl.randomBytesHex)(16),this._secret=n||(0,tl.randomBytesHex)(32),this._key=new el.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(rl),n=e.getItem(il),i=e.getItem(nl);return r&&i?new ku(e,r,i,n==="1"):null}static hash(e){return new el.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(rl,this._id),this._storage.setItem(nl,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(il,this._linked?"1":"0")}}hi.Session=ku;var qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.WalletSDKRelayAbstract=qt.APP_VERSION_KEY=qt.LOCAL_STORAGE_ADDRESSES_KEY=qt.WALLET_USER_NAME_KEY=void 0;const sl=zi;qt.WALLET_USER_NAME_KEY="walletUsername";qt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";qt.APP_VERSION_KEY="AppVersion";class Sv{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw sl.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,sl.serializeError)(s,e.method);return i})}}qt.WalletSDKRelayAbstract=Sv;var iu={exports:{}},Ah=yu.EventEmitter,ga,ol;function Ev(){if(ol)return ga;ol=1;function t(A,P){var N=Object.keys(A);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(A);P&&(M=M.filter(function(R){return Object.getOwnPropertyDescriptor(A,R).enumerable})),N.push.apply(N,M)}return N}function e(A){for(var P=1;P0?this.tail.next=M:this.head=M,this.tail=M,++this.length}},{key:"unshift",value:function(N){var M={data:N,next:this.head};this.length===0&&(this.tail=M),this.head=M,++this.length}},{key:"shift",value:function(){if(this.length!==0){var N=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,N}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(N){if(this.length===0)return"";for(var M=this.head,R=""+M.data;M=M.next;)R+=N+M.data;return R}},{key:"concat",value:function(N){if(this.length===0)return l.alloc(0);for(var M=l.allocUnsafe(N>>>0),R=this.head,O=0;R;)C(R.data,M,O),O+=R.data.length,R=R.next;return M}},{key:"consume",value:function(N,M){var R;return ND.length?D.length:N;if(L===D.length?O+=D:O+=D.slice(0,N),N-=L,N===0){L===D.length?(++R,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=D.slice(L));break}++R}return this.length-=R,O}},{key:"_getBuffer",value:function(N){var M=l.allocUnsafe(N),R=this.head,O=1;for(R.data.copy(M),N-=R.data.length;R=R.next;){var D=R.data,L=N>D.length?D.length:N;if(D.copy(M,M.length-N,0,L),N-=L,N===0){L===D.length?(++O,R.next?this.head=R.next:this.head=this.tail=null):(this.head=R,R.data=D.slice(L));break}++O}return this.length-=O,M}},{key:b,value:function(N,M){return g(this,e(e({},M),{},{depth:0,customInspect:!1}))}}]),A}(),ga}function Mv(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(su,this,t)):process.nextTick(su,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Os,r):(r._writableState.errorEmitted=!0,process.nextTick(al,r,s)):process.nextTick(al,r,s):e?(process.nextTick(Os,r),e(s)):process.nextTick(Os,r)}),this)}function al(t,e){su(t,e),Os(t)}function Os(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function xv(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function su(t,e){t.emit("error",e)}function Cv(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var Th={destroy:Mv,undestroy:xv,errorOrDestroy:Cv},mn={};function Rv(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var kh={};function jt(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){Rv(o,s);function o(a,c,l){return s.call(this,n(a,c,l))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,kh[t]=i}function ul(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function Iv(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Av(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Tv(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}jt("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);jt("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&Iv(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(Av(t," argument"))i="The ".concat(t," ").concat(n," ").concat(ul(e,"type"));else{var s=Tv(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(ul(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);jt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");jt("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});jt("ERR_STREAM_PREMATURE_CLOSE","Premature close");jt("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});jt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");jt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");jt("ERR_STREAM_WRITE_AFTER_END","write after end");jt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);jt("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);jt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");mn.codes=kh;var kv=mn.codes.ERR_INVALID_OPT_VALUE;function Ov(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Nv(t,e,r,n){var i=Ov(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new kv(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var Oh={getHighWaterMark:Nv},Lv=Pv;function Pv(t,e){if(ba("noDeprecation"))return t;var r=!1;function n(){if(!r){if(ba("throwDeprecation"))throw new Error(e);ba("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function ba(t){try{if(!globalThis.localStorage)return!1}catch{return!1}var e=globalThis.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var va,cl;function Nh(){if(cl)return va;cl=1,va=z;function t(I){var k=this;this.next=null,this.entry=null,this.finish=function(){q(k,I)}}var e;z.WritableState=B;var r={deprecate:Lv},n=Ah,i=Ui.Buffer,s=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(I){return i.from(I)}function a(I){return i.isBuffer(I)||I instanceof s}var c=Th,l=Oh,d=l.getHighWaterMark,g=mn.codes,b=g.ERR_INVALID_ARG_TYPE,C=g.ERR_METHOD_NOT_IMPLEMENTED,A=g.ERR_MULTIPLE_CALLBACK,P=g.ERR_STREAM_CANNOT_PIPE,N=g.ERR_STREAM_DESTROYED,M=g.ERR_STREAM_NULL_VALUES,R=g.ERR_STREAM_WRITE_AFTER_END,O=g.ERR_UNKNOWN_ENCODING,D=c.errorOrDestroy;Gt(z,n);function L(){}function B(I,k,$){e=e||ei(),I=I||{},typeof $!="boolean"&&($=k instanceof e),this.objectMode=!!I.objectMode,$&&(this.objectMode=this.objectMode||!!I.writableObjectMode),this.highWaterMark=d(this,I,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var V=I.decodeStrings===!1;this.decodeStrings=!V,this.defaultEncoding=I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(se){p(k,se)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=I.emitClose!==!1,this.autoDestroy=!!I.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}B.prototype.getBuffer=function(){for(var k=this.bufferedRequest,$=[];k;)$.push(k),k=k.next;return $},function(){try{Object.defineProperty(B.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var G;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(G=Function.prototype[Symbol.hasInstance],Object.defineProperty(z,Symbol.hasInstance,{value:function(k){return G.call(this,k)?!0:this!==z?!1:k&&k._writableState instanceof B}})):G=function(k){return k instanceof this};function z(I){e=e||ei();var k=this instanceof e;if(!k&&!G.call(z,this))return new z(I);this._writableState=new B(I,this,k),this.writable=!0,I&&(typeof I.write=="function"&&(this._write=I.write),typeof I.writev=="function"&&(this._writev=I.writev),typeof I.destroy=="function"&&(this._destroy=I.destroy),typeof I.final=="function"&&(this._final=I.final)),n.call(this)}z.prototype.pipe=function(){D(this,new P)};function W(I,k){var $=new R;D(I,$),process.nextTick(k,$)}function K(I,k,$,V){var se;return $===null?se=new M:typeof $!="string"&&!k.objectMode&&(se=new b("chunk",["string","Buffer"],$)),se?(D(I,se),process.nextTick(V,se),!1):!0}z.prototype.write=function(I,k,$){var V=this._writableState,se=!1,_=!V.objectMode&&a(I);return _&&!i.isBuffer(I)&&(I=o(I)),typeof k=="function"&&($=k,k=null),_?k="buffer":k||(k=V.defaultEncoding),typeof $!="function"&&($=L),V.ending?W(this,$):(_||K(this,V,I,$))&&(V.pendingcb++,se=X(this,V,_,I,k,$)),se},z.prototype.cork=function(){this._writableState.corked++},z.prototype.uncork=function(){var I=this._writableState;I.corked&&(I.corked--,!I.writing&&!I.corked&&!I.bufferProcessing&&I.bufferedRequest&&x(this,I))},z.prototype.setDefaultEncoding=function(k){if(typeof k=="string"&&(k=k.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((k+"").toLowerCase())>-1))throw new O(k);return this._writableState.defaultEncoding=k,this},Object.defineProperty(z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Y(I,k,$){return!I.objectMode&&I.decodeStrings!==!1&&typeof k=="string"&&(k=i.from(k,$)),k}Object.defineProperty(z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function X(I,k,$,V,se,_){if(!$){var S=Y(k,V,se);V!==S&&($=!0,se="buffer",V=S)}var F=k.objectMode?1:V.length;k.length+=F;var H=k.length */var fl;function Dv(){return fl||(fl=1,function(t,e){var r=Ui,n=r.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,c){return n(o,a,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}}(ys,ys.exports)),ys.exports}var hl;function dl(){if(hl)return ma;hl=1;var t=Dv().Buffer,e=t.isEncoding||function(M){switch(M=""+M,M&&M.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(M){if(!M)return"utf8";for(var R;;)switch(M){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return M;default:if(R)return;M=(""+M).toLowerCase(),R=!0}}function n(M){var R=r(M);if(typeof R!="string"&&(t.isEncoding===e||!e(M)))throw new Error("Unknown encoding: "+M);return R||M}ma.StringDecoder=i;function i(M){this.encoding=n(M);var R;switch(this.encoding){case"utf16le":this.text=g,this.end=b,R=4;break;case"utf8":this.fillLast=c,R=4;break;case"base64":this.text=C,this.end=A,R=3;break;default:this.write=P,this.end=N;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(R)}i.prototype.write=function(M){if(M.length===0)return"";var R,O;if(this.lastNeed){if(R=this.fillLast(M),R===void 0)return"";O=this.lastNeed,this.lastNeed=0}else O=0;return O>5===6?2:M>>4===14?3:M>>3===30?4:M>>6===2?-1:-2}function o(M,R,O){var D=R.length-1;if(D=0?(L>0&&(M.lastNeed=L-1),L):--D=0?(L>0&&(M.lastNeed=L-2),L):--D=0?(L>0&&(L===2?L=0:M.lastNeed=L-3),L):0))}function a(M,R,O){if((R[0]&192)!==128)return M.lastNeed=0,"�";if(M.lastNeed>1&&R.length>1){if((R[1]&192)!==128)return M.lastNeed=1,"�";if(M.lastNeed>2&&R.length>2&&(R[2]&192)!==128)return M.lastNeed=2,"�"}}function c(M){var R=this.lastTotal-this.lastNeed,O=a(this,M);if(O!==void 0)return O;if(this.lastNeed<=M.length)return M.copy(this.lastChar,R,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,R,0,M.length),this.lastNeed-=M.length}function l(M,R){var O=o(this,M,R);if(!this.lastNeed)return M.toString("utf8",R);this.lastTotal=O;var D=M.length-(O-this.lastNeed);return M.copy(this.lastChar,0,D),M.toString("utf8",R,D)}function d(M){var R=M&&M.length?this.write(M):"";return this.lastNeed?R+"�":R}function g(M,R){if((M.length-R)%2===0){var O=M.toString("utf16le",R);if(O){var D=O.charCodeAt(O.length-1);if(D>=55296&&D<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],O.slice(0,-1)}return O}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",R,M.length-1)}function b(M){var R=M&&M.length?this.write(M):"";if(this.lastNeed){var O=this.lastTotal-this.lastNeed;return R+this.lastChar.toString("utf16le",0,O)}return R}function C(M,R){var O=(M.length-R)%3;return O===0?M.toString("base64",R):(this.lastNeed=3-O,this.lastTotal=3,O===1?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",R,M.length-O))}function A(M){var R=M&&M.length?this.write(M):"";return this.lastNeed?R+this.lastChar.toString("base64",0,3-this.lastNeed):R}function P(M){return M.toString(this.encoding)}function N(M){return M&&M.length?this.write(M):""}return ma}var pl=mn.codes.ERR_STREAM_PREMATURE_CLOSE;function $v(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof S!="string"&&!ie.objectMode&&Object.getPrototypeOf(S)!==n.prototype&&(S=s(S)),H)ie.endEmitted?L(_,new M):Y(_,ie,S,!0);else if(ie.ended)L(_,new P);else{if(ie.destroyed)return!1;ie.reading=!1,ie.decoder&&!F?(S=ie.decoder.write(S),ie.objectMode||S.length!==0?Y(_,ie,S,!1):x(_,ie)):Y(_,ie,S,!1)}else H||(ie.reading=!1,x(_,ie))}return!ie.ended&&(ie.length=v?_=v:(_--,_|=_>>>1,_|=_>>>2,_|=_>>>4,_|=_>>>8,_|=_>>>16,_++),_}function h(_,S){return _<=0||S.length===0&&S.ended?0:S.objectMode?1:_!==_?S.flowing&&S.length?S.buffer.head.data.length:S.length:(_>S.highWaterMark&&(S.highWaterMark=u(_)),_<=S.length?_:S.ended?S.length:(S.needReadable=!0,0))}W.prototype.read=function(_){c("read",_),_=parseInt(_,10);var S=this._readableState,F=_;if(_!==0&&(S.emittedReadable=!1),_===0&&S.needReadable&&((S.highWaterMark!==0?S.length>=S.highWaterMark:S.length>0)||S.ended))return c("read: emitReadable",S.length,S.ended),S.length===0&&S.ended?$(this):y(this),null;if(_=h(_,S),_===0&&S.ended)return S.length===0&&$(this),null;var H=S.needReadable;c("need readable",H),(S.length===0||S.length-_0?re=k(_,S):re=null,re===null?(S.needReadable=S.length<=S.highWaterMark,_=0):(S.length-=_,S.awaitDrain=0),S.length===0&&(S.ended||(S.needReadable=!0),F!==_&&S.ended&&$(this)),re!==null&&this.emit("data",re),re};function p(_,S){if(c("onEofChunk"),!S.ended){if(S.decoder){var F=S.decoder.end();F&&F.length&&(S.buffer.push(F),S.length+=S.objectMode?1:F.length)}S.ended=!0,S.sync?y(_):(S.needReadable=!1,S.emittedReadable||(S.emittedReadable=!0,w(_)))}}function y(_){var S=_._readableState;c("emitReadable",S.needReadable,S.emittedReadable),S.needReadable=!1,S.emittedReadable||(c("emitReadable",S.flowing),S.emittedReadable=!0,process.nextTick(w,_))}function w(_){var S=_._readableState;c("emitReadable_",S.destroyed,S.length,S.ended),!S.destroyed&&(S.length||S.ended)&&(_.emit("readable"),S.emittedReadable=!1),S.needReadable=!S.flowing&&!S.ended&&S.length<=S.highWaterMark,I(_)}function x(_,S){S.readingMore||(S.readingMore=!0,process.nextTick(T,_,S))}function T(_,S){for(;!S.reading&&!S.ended&&(S.length1&&se(H.pipes,_)!==-1)&&!we&&(c("false write response, pause",H.awaitDrain),H.awaitDrain++),F.pause())}function ve(pe){c("onerror",pe),be(),_.removeListener("error",ve),e(_,"error")===0&&L(_,pe)}G(_,"error",ve);function ye(){_.removeListener("finish",lr),be()}_.once("close",ye);function lr(){c("onfinish"),_.removeListener("close",ye),be()}_.once("finish",lr);function be(){c("unpipe"),F.unpipe(_)}return _.emit("pipe",F),H.flowing||(c("pipe resume"),F.resume()),_};function m(_){return function(){var F=_._readableState;c("pipeOnDrain",F.awaitDrain),F.awaitDrain&&F.awaitDrain--,F.awaitDrain===0&&e(_,"data")&&(F.flowing=!0,I(_))}}W.prototype.unpipe=function(_){var S=this._readableState,F={hasUnpiped:!1};if(S.pipesCount===0)return this;if(S.pipesCount===1)return _&&_!==S.pipes?this:(_||(_=S.pipes),S.pipes=null,S.pipesCount=0,S.flowing=!1,_&&_.emit("unpipe",this,F),this);if(!_){var H=S.pipes,re=S.pipesCount;S.pipes=null,S.pipesCount=0,S.flowing=!1;for(var ie=0;ie0,H.flowing!==!1&&this.resume()):_==="readable"&&!H.endEmitted&&!H.readableListening&&(H.readableListening=H.needReadable=!0,H.flowing=!1,H.emittedReadable=!1,c("on readable",H.length,H.reading),H.length?y(this):H.reading||process.nextTick(E,this)),F},W.prototype.addListener=W.prototype.on,W.prototype.removeListener=function(_,S){var F=r.prototype.removeListener.call(this,_,S);return _==="readable"&&process.nextTick(f,this),F},W.prototype.removeAllListeners=function(_){var S=r.prototype.removeAllListeners.apply(this,arguments);return(_==="readable"||_===void 0)&&process.nextTick(f,this),S};function f(_){var S=_._readableState;S.readableListening=_.listenerCount("readable")>0,S.resumeScheduled&&!S.paused?S.flowing=!0:_.listenerCount("data")>0&&_.resume()}function E(_){c("readable nexttick read 0"),_.read(0)}W.prototype.resume=function(){var _=this._readableState;return _.flowing||(c("resume"),_.flowing=!_.readableListening,U(this,_)),_.paused=!1,this};function U(_,S){S.resumeScheduled||(S.resumeScheduled=!0,process.nextTick(q,_,S))}function q(_,S){c("resume",S.reading),S.reading||_.read(0),S.resumeScheduled=!1,_.emit("resume"),I(_),S.flowing&&!S.reading&&_.read(0)}W.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function I(_){var S=_._readableState;for(c("flow",S.flowing);S.flowing&&_.read()!==null;);}W.prototype.wrap=function(_){var S=this,F=this._readableState,H=!1;_.on("end",function(){if(c("wrapped end"),F.decoder&&!F.ended){var ee=F.decoder.end();ee&&ee.length&&S.push(ee)}S.push(null)}),_.on("data",function(ee){if(c("wrapped data"),F.decoder&&(ee=F.decoder.write(ee)),!(F.objectMode&&ee==null)&&!(!F.objectMode&&(!ee||!ee.length))){var de=S.push(ee);de||(H=!0,_.pause())}});for(var re in _)this[re]===void 0&&typeof _[re]=="function"&&(this[re]=function(de){return function(){return _[de].apply(_,arguments)}}(re));for(var ie=0;ie=S.length?(S.decoder?F=S.buffer.join(""):S.buffer.length===1?F=S.buffer.first():F=S.buffer.concat(S.length),S.buffer.clear()):F=S.buffer.consume(_,S.decoder),F}function $(_){var S=_._readableState;c("endReadable",S.endEmitted),S.endEmitted||(S.ended=!0,process.nextTick(V,S,_))}function V(_,S){if(c("endReadableNT",_.endEmitted,_.length),!_.endEmitted&&_.length===0&&(_.endEmitted=!0,S.readable=!1,S.emit("end"),_.autoDestroy)){var F=S._writableState;(!F||F.autoDestroy&&F.finished)&&S.destroy()}}typeof Symbol=="function"&&(W.from=function(_,S){return D===void 0&&(D=Wv()),D(W,_,S)});function se(_,S){for(var F=0,H=_.length;F0;return Xv(o,c,l,function(d){i||(i=d),d&&s.forEach(wl),!c&&(s.forEach(wl),n(i))})});return e.reduce(ey)}var ny=ry;(function(t,e){e=t.exports=Ph(),e.Stream=e,e.Readable=e,e.Writable=Nh(),e.Duplex=ei(),e.Transform=Dh,e.PassThrough=Jv,e.finished=Ou,e.pipeline=ny})(iu,iu.exports);var jh=iu.exports;const{Transform:iy}=jh;var sy=t=>class Fh extends iy{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Fh(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:oy}=jh;var ay=t=>class Wh extends oy{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Wh(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const uy=sy,cy=ay;var ly=function(t){const e=uy(t),r=cy(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},Hh={};const _l=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Hh.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],d=t[8]^t[18]^t[28]^t[38]^t[48],g=t[9]^t[19]^t[29]^t[39]^t[49];let b=d^(i<<1|s>>>31),C=g^(s<<1|i>>>31);const A=t[0]^b,P=t[1]^C,N=t[10]^b,M=t[11]^C,R=t[20]^b,O=t[21]^C,D=t[30]^b,L=t[31]^C,B=t[40]^b,G=t[41]^C;b=r^(o<<1|a>>>31),C=n^(a<<1|o>>>31);const z=t[2]^b,W=t[3]^C,K=t[12]^b,Y=t[13]^C,X=t[22]^b,v=t[23]^C,u=t[32]^b,h=t[33]^C,p=t[42]^b,y=t[43]^C;b=i^(c<<1|l>>>31),C=s^(l<<1|c>>>31);const w=t[4]^b,x=t[5]^C,T=t[14]^b,m=t[15]^C,f=t[24]^b,E=t[25]^C,U=t[34]^b,q=t[35]^C,I=t[44]^b,k=t[45]^C;b=o^(d<<1|g>>>31),C=a^(g<<1|d>>>31);const $=t[6]^b,V=t[7]^C,se=t[16]^b,_=t[17]^C,S=t[26]^b,F=t[27]^C,H=t[36]^b,re=t[37]^C,ie=t[46]^b,ee=t[47]^C;b=c^(r<<1|n>>>31),C=l^(n<<1|r>>>31);const de=t[8]^b,Qt=t[9]^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le,t[22]=$e^~ze&qr,t[23]=Be^~qe&Gr,t[32]=Me^~Oe&Fe,t[33]=En^~Rn&kn,t[42]=Ue^~Ur&Mn,t[43]=Nn^~zr&Re,t[4]=Tn^~Dr&Jr,t[5]=je^~$r&Zr,t[14]=xe^~Ne&We,t[15]=Ce^~Le&He,t[24]=ze^~qr&Ie,t[25]=qe^~Gr&xn,t[34]=Oe^~Fe&Br,t[35]=Rn^~kn&jr,t[44]=Ur^~Mn&In,t[45]=zr^~Re&Pe,t[6]=Dr^~Jr&xt,t[7]=$r^~Zr&Ee,t[16]=Ne^~We&On,t[17]=Le^~He&Ve,t[26]=qr^~Ie&Ae,t[27]=Gr^~xn&Te,t[36]=Fe^~Br&Fr,t[37]=kn^~jr&Wr,t[46]=Mn^~In&De,t[47]=Re^~Pe&An,t[8]=Jr^~xt&Cn,t[9]=Zr^~Ee&ke,t[18]=We^~On&Hr,t[19]=He^~Ve&Vr,t[28]=Ie^~Ae&$e,t[29]=xn^~Te&Be,t[38]=Br^~Fr&Me,t[39]=jr^~Wr&En,t[48]=In^~De&Ue,t[49]=Pe^~An&Nn,t[0]^=_l[e*2],t[1]^=_l[e*2+1]}};const Fs=Hh;function gi(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}gi.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};gi.prototype.absorb=function(t){for(let e=0;e>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Fs.p1600(this.state),this.count=0);return e};gi.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var fy=gi,hy=ly(fy);const dy=hy,py=Ks;function Vh(t){return Buffer.allocUnsafe(t).fill(0)}function Uh(t,e,r){const n=Vh(e);return t=ao(t),r?t.length"u")throw new Error("Not an array?");if(r=Zh(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(tr(t,e[s]));if(r==="dynamic"){var o=tr("uint256",e.length);i.unshift(o)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([tr("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,ln.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=qn(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return ln.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=qn(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=en(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=qn(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=en(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=Sl(t),n=en(e),n<0)throw new Error("Supplied ufixed is negative");return tr("uint256",n.mul(new sn(2).pow(new sn(r[1]))))}else if(t.startsWith("fixed"))return r=Sl(t),tr("int256",en(e).mul(new sn(2).pow(new sn(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function my(t){return t==="string"||t==="bytes"||Zh(t)==="dynamic"}function wy(t){return t.lastIndexOf("]")===t.length-1}function _y(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var o=Jh(t[s]),a=e[s],c=tr(o,a);my(o)?(r.push(tr("uint256",i)),n.push(c),i+=c.length):r.push(c)}return Buffer.concat(r.concat(n))}function Qh(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(ln.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=qn(o),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=en(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=qn(o),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=en(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(i)}function Sy(t,e){return ln.keccak(Qh(t,e))}var Ey={rawEncode:_y,solidityPack:Qh,soliditySHA3:Sy};const Vt=Gh,Li=Ey,Yh={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"]},Ma={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const o=(a,c,l)=>{if(r[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Vt.keccak(this.encodeData(c,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",Vt.keccak(l)];if(c==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",Vt.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const d=c.slice(0,c.lastIndexOf("[")),g=l.map(b=>o(a,d,b));return["bytes32",Vt.keccak(Li.rawEncode(g.map(([b])=>b),g.map(([,b])=>b)))]}return[c,l]};for(const a of r[t]){const[c,l]=o(a.name,a.type,e[a.name]);i.push(c),s.push(l)}}else for(const o of r[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=Vt.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=Vt.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=Vt.keccak(this.encodeData(o.type,a,r,n)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return Li.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return Vt.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Vt.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Yh.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),Vt.keccak(Buffer.concat(n))}};var My={TYPED_MESSAGE_SCHEMA:Yh,TypedDataUtils:Ma,hashForSignTypedDataLegacy:function(t){return xy(t.data)},hashForSignTypedData_v3:function(t){return Ma.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Ma.hash(t.data)}};function xy(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?Vt.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return Li.soliditySHA3(["bytes32","bytes32"],[Li.soliditySHA3(new Array(t.length).fill("string"),i),Li.soliditySHA3(n,r)])}var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.filterFromParam=ti.FilterPolyfill=void 0;const Wn=Yi,yt=J,Cy=5*60*1e3,tn={jsonrpc:"2.0",id:0};class Ry{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Wn.IntNumber)(1),this.provider=e}async newFilter(e){const r=Kh(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.log(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,yt.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,yt.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,yt.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,yt.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,yt.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(ms())}async getFilterLogs(e){const r=(0,yt.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},tn),{method:"eth_getLogs",params:[El(n)]})):ms()}makeFilterId(){return(0,Wn.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return ms();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return ws();console.log(`Fetching logs from ${n} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},tn),{method:"eth_getLogs",params:[El(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,yt.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const l=(0,Wn.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${n} to ${l}`),this.cursors.set(e,l)}}return o}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return ms();const n=await this.getCurrentBlockHeight();if(r>n)return ws();console.log(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,yt.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,Wn.IntNumber)(o))))).filter(o=>!!o),s=(0,Wn.IntNumber)(r+i.length);return console.log(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},tn),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(ws())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},Cy);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},tn),{method:"eth_blockNumber",params:[]}));return(0,yt.intNumberFromHexString)((0,yt.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},tn),{method:"eth_getBlockByNumber",params:[(0,yt.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,yt.ensureHexString)(r.result.hash):null}}ti.FilterPolyfill=Ry;function Kh(t){return{fromBlock:Ml(t.fromBlock),toBlock:Ml(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}ti.filterFromParam=Kh;function El(t){const e={fromBlock:xl(t.fromBlock),toBlock:xl(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Ml(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Wn.IntNumber)(0);if((0,yt.isHexString)(t))return(0,yt.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function xl(t){return t==="latest"?t:(0,yt.hexStringFromIntNumber)(t)}function ms(){return Object.assign(Object.assign({},tn),{error:{code:-32e3,message:"filter not found"}})}function ws(){return Object.assign(Object.assign({},tn),{result:[]})}var Xh={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(Xh);var uo={},ed={},co={},Nu=Iy;function Iy(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const Cl=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i{e.errorFirst?n.push(function(o,a){if(e.multiArgs){const c=new Array(arguments.length-1);for(let l=1;l{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):Cl(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?Cl(s,e):s}return n},es={},Ty=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(es,"__esModule",{value:!0});es.BaseBlockTracker=void 0;const ky=Ty(gn),Oy=1e3,Ny=(t,e)=>t+e,Rl=["sync","latest"];class Ly extends ky.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*Oy,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){Rl.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Rl.map(e=>this.listenerCount(e)).reduce(Ny)}_newPotentialLatest(e){const r=this._currentBlock;r&&Il(e)<=Il(r)||this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}es.BaseBlockTracker=Ly;function Il(t){return Number.parseInt(t,16)}var td={},rd={},ht={};class nd extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function Py(t){return Bt(t)&&typeof t[Symbol.iterator]=="function"}function Bt(t){return typeof t=="object"&&t!=null}function Al(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function nt(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Dy(t){const{done:e,value:r}=t.next();return e?void 0:r}function $y(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${nt(n)}\``}=t;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*ou(t,e,r,n){Py(t)||(t=[t]);for(const i of t){const s=$y(i,e,r,n);s&&(yield s)}}function*Lu(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Bt(e.schema)&&Bt(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let c="valid";for(const l of e.validator(t,a))l.explanation=r.message,c="not_valid",yield[l,void 0];for(let[l,d,g]of e.entries(t,a)){const b=Lu(d,g,{path:l===void 0?n:[...n,l],branch:l===void 0?i:[...i,d],coerce:s,mask:o,message:r.message});for(const C of b)C[0]?(c=C[0].refinement!=null?"not_refined":"not_valid",yield[C[0],void 0]):s&&(d=C[1],l===void 0?t=d:t instanceof Map?t.set(l,d):t instanceof Set?t.add(d):Bt(t)&&(d!==void 0||l in t)&&(t[l]=d))}if(c!=="not_valid")for(const l of e.refiner(t,a))l.explanation=r.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}class et{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const d=i(c,l);return ou(d,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const d=s(c,l);return ou(d,l,this,c)}:this.refiner=()=>[]}assert(e,r){return id(e,this,r)}create(e,r){return sd(e,this,r)}is(e){return Pu(e,this)}mask(e,r){return od(e,this,r)}validate(e,r={}){return bi(e,this,r)}}function id(t,e,r){const n=bi(t,e,{message:r});if(n[0])throw n[0]}function sd(t,e,r){const n=bi(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function od(t,e,r){const n=bi(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Pu(t,e){return!bi(t,e)[0]}function bi(t,e,r={}){const n=Lu(t,e,r),i=Dy(n);return i[0]?[new nd(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function By(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?$u(n):ts(n)}function Mt(t,e){return new et({type:t,schema:null,validator:e})}function jy(t,e){return new et({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function Fy(t){return new et({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Wy(t){let e;return new et({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function Hy(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return $u(n);default:return ts(n)}}function Vy(t){const e=t instanceof et?{...t.schema}:{...t};for(const r in e)e[r]=ad(e[r]);return ts(e)}function Uy(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];return ts(n)}function zy(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Mt(t,e)}function qy(){return Mt("any",()=>!0)}function Gy(t){return new et({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${nt(e)}`}})}function Jy(){return Mt("bigint",t=>typeof t=="bigint")}function Zy(){return Mt("boolean",t=>typeof t=="boolean")}function Qy(){return Mt("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${nt(t)}`)}function Yy(t){const e={},r=t.map(n=>nt(n)).join();for(const n of t)e[n]=n;return new et({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${nt(n)}`}})}function Ky(){return Mt("func",t=>typeof t=="function"||`Expected a function, but received: ${nt(t)}`)}function Xy(t){return Mt("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${nt(e)}`)}function em(){return Mt("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${nt(t)}`)}function tm(t){return new et({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function rm(t){const e=nt(t),r=typeof t;return new et({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${nt(n)}`}})}function nm(t,e){return new et({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${nt(r)}`}})}function Du(){return Mt("never",()=>!1)}function im(t){return new et({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function sm(){return Mt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${nt(t)}`)}function ts(t){const e=t?Object.keys(t):[],r=Du();return new et({type:"object",schema:t||null,*entries(n){if(t&&Bt(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return Bt(n)||`Expected an object, but received: ${nt(n)}`},coercer(n){return Bt(n)?{...n}:n}})}function ad(t){return new et({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function om(t,e){return new et({type:"record",schema:null,*entries(r){if(Bt(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return Bt(r)||`Expected an object, but received: ${nt(r)}`}})}function am(){return Mt("regexp",t=>t instanceof RegExp)}function um(t){return new et({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${nt(e)}`}})}function ud(){return Mt("string",t=>typeof t=="string"||`Expected a string, but received: ${nt(t)}`)}function cm(t){const e=Du();return new et({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;ir.type).join(" | ");return new et({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...o]=Lu(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${nt(r)}`,...i]}})}function cd(){return Mt("unknown",()=>!0)}function Bu(t,e,r){return new et({...t,coercer:(n,i)=>Pu(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function fm(t,e,r={}){return Bu(t,cd(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&Al(n)&&Al(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function hm(t){return Bu(t,ud(),e=>e.trim())}function dm(t){return wn(t,"empty",e=>{const r=ld(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function ld(t){return t instanceof Map||t instanceof Set?t.size:t.length}function pm(t,e,r={}){const{exclusive:n}=r;return wn(t,"max",i=>n?in?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function bm(t){return wn(t,"nonempty",e=>ld(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function vm(t,e){return wn(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function ym(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return wn(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function wn(t,e,r){return new et({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),o=ou(s,i,t,n);for(const a of o)yield{...a,refinement:e}}})}const mm=Object.freeze(Object.defineProperty({__proto__:null,Struct:et,StructError:nd,any:qy,array:Gy,assert:id,assign:By,bigint:Jy,boolean:Zy,coerce:Bu,create:sd,date:Qy,defaulted:fm,define:Mt,deprecated:jy,dynamic:Fy,empty:dm,enums:Yy,func:Ky,instance:Xy,integer:em,intersection:tm,is:Pu,lazy:Wy,literal:rm,map:nm,mask:od,max:pm,min:gm,never:Du,nonempty:bm,nullable:im,number:sm,object:ts,omit:Hy,optional:ad,partial:Vy,pattern:vm,pick:Uy,record:om,refine:wn,regexp:am,set:um,size:ym,string:ud,struct:zy,trimmed:hm,tuple:cm,type:$u,union:lm,unknown:cd,validate:bi},Symbol.toStringTag,{value:"Module"})),_n=pn(mm);Object.defineProperty(ht,"__esModule",{value:!0});ht.assertExhaustive=ht.assertStruct=ht.assert=ht.AssertionError=void 0;const wm=_n;function _m(t){return typeof t=="object"&&t!==null&&"message"in t}function Sm(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function Em(t){const e=_m(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function fd(t,e){return Sm(t)?new t({message:e}):t({message:e})}class ju extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}ht.AssertionError=ju;function Mm(t,e="Assertion failed.",r=ju){if(!t)throw e instanceof Error?e:fd(r,e)}ht.assert=Mm;function xm(t,e,r="Assertion failed",n=ju){try{(0,wm.assert)(t,e)}catch(i){throw fd(n,`${r}: ${Em(i)}.`)}}ht.assertStruct=xm;function Cm(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}ht.assertExhaustive=Cm;var rs={};Object.defineProperty(rs,"__esModule",{value:!0});rs.base64=void 0;const Rm=_n,Im=ht,Am=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,Im.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,Rm.pattern)(t,a)};rs.base64=Am;var fe={},ns={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=_n,r=ht;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,e.is)(l,t.HexStruct)}t.isHexString=n;function i(l){return(0,e.is)(l,t.StrictHexStruct)}t.isStrictHexString=i;function s(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(l){(0,r.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}t.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}t.remove0x=c})(ns);Object.defineProperty(fe,"__esModule",{value:!0});fe.createDataView=fe.concatBytes=fe.valueToBytes=fe.stringToBytes=fe.numberToBytes=fe.signedBigIntToBytes=fe.bigIntToBytes=fe.hexToBytes=fe.bytesToString=fe.bytesToNumber=fe.bytesToSignedBigInt=fe.bytesToBigInt=fe.bytesToHex=fe.assertIsBytes=fe.isBytes=void 0;const Rt=ht,au=ns,Tl=48,kl=58,Ol=87;function Tm(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const km=Tm();function Fu(t){return t instanceof Uint8Array}fe.isBytes=Fu;function vi(t){(0,Rt.assert)(Fu(t),"Value must be a Uint8Array.")}fe.assertIsBytes=vi;function hd(t){if(vi(t),t.length===0)return"0x";const e=km(),r=new Array(t.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return lo(e)}fe.bigIntToBytes=pd;function Pm(t,e){(0,Rt.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function Dm(t,e){(0,Rt.assert)(typeof t=="bigint","Value must be a bigint."),(0,Rt.assert)(typeof e=="number","Byte length must be a number."),(0,Rt.assert)(e>0,"Byte length must be greater than 0."),(0,Rt.assert)(Pm(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i>=BigInt(8);return n.reverse()}fe.signedBigIntToBytes=Dm;function gd(t){(0,Rt.assert)(typeof t=="number","Value must be a number."),(0,Rt.assert)(t>=0,"Value must be a non-negative number."),(0,Rt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return lo(e)}fe.numberToBytes=gd;function bd(t){return(0,Rt.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}fe.stringToBytes=bd;function vd(t){if(typeof t=="bigint")return pd(t);if(typeof t=="number")return gd(t);if(typeof t=="string")return t.startsWith("0x")?lo(t):bd(t);if(Fu(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}fe.valueToBytes=vd;function $m(t){const e=new Array(t.length);let r=0;for(let i=0;ie.call(r,n,i,this))}get(e){return mt(this,Wt,"f").get(e)}has(e){return mt(this,Wt,"f").has(e)}keys(){return mt(this,Wt,"f").keys()}values(){return mt(this,Wt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}ri.FrozenMap=Wu;class Hu{constructor(e){Kt.set(this,void 0),wd(this,Kt,new Set(e),"f"),Object.freeze(this)}get size(){return mt(this,Kt,"f").size}[(Kt=new WeakMap,Symbol.iterator)](){return mt(this,Kt,"f")[Symbol.iterator]()}entries(){return mt(this,Kt,"f").entries()}forEach(e,r){return mt(this,Kt,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return mt(this,Kt,"f").has(e)}keys(){return mt(this,Kt,"f").keys()}values(){return mt(this,Kt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}ri.FrozenSet=Hu;Object.freeze(Wu);Object.freeze(Wu.prototype);Object.freeze(Hu);Object.freeze(Hu.prototype);var _d={},Vu={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(l){return Array.isArray(l)&&l.length>0}t.isNonEmptyArray=e;function r(l){return l==null}t.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}t.isObject=n;const i=(l,d)=>Object.hasOwnProperty.call(l,d);t.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let d=l;for(;Object.getPrototypeOf(d)!==null;)d=Object.getPrototypeOf(d);return Object.getPrototypeOf(l)===d}catch{return!1}}t.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}t.isASCII=o;function a(l){var d;return l.split("").reduce((b,C)=>o(C)?b+1:b+2,0)+((d=l.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&d!==void 0?d:[]).length}t.calculateStringSize=a;function c(l){return l.toString().length}t.calculateNumberSize=c})(Vu);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=_n,r=ht,n=Vu;t.JsonStruct=(0,e.define)("Json",L=>{const[B]=D(L,!0);return B?!0:"Expected a valid JSON-serializable value"});function i(L){return(0,e.is)(L,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(L){return(0,e.is)(L,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(L,B){(0,r.assertStruct)(L,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",B)}t.assertIsJsonRpcNotification=o;function a(L){return(0,e.is)(L,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(L,B){(0,r.assertStruct)(L,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",B)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function l(L){return(0,e.is)(L,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=l;function d(L,B){(0,r.assertStruct)(L,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",B)}t.assertIsPendingJsonRpcResponse=d;function g(L){return(0,e.is)(L,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=g;function b(L,B){(0,r.assertStruct)(L,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",B)}t.assertIsJsonRpcResponse=b;function C(L){return(0,e.is)(L,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=C;function A(L,B){(0,r.assertStruct)(L,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",B)}t.assertIsJsonRpcSuccess=A;function P(L){return(0,e.is)(L,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=P;function N(L,B){(0,r.assertStruct)(L,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",B)}t.assertIsJsonRpcFailure=N;function M(L){return(0,e.is)(L,t.JsonRpcErrorStruct)}t.isJsonRpcError=M;function R(L,B){(0,r.assertStruct)(L,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",B)}t.assertIsJsonRpcError=R;function O(L){const{permitEmptyString:B,permitFractions:G,permitNull:z}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},L);return K=>!!(typeof K=="number"&&(G||Number.isInteger(K))||typeof K=="string"&&(B||K.length>0)||z&&K===null)}t.getJsonRpcIdValidator=O;function D(L,B=!1){const G=new Set;function z(W,K){if(W===void 0)return[!1,0];if(W===null)return[!0,K?0:n.JsonSize.Null];const Y=typeof W;try{if(Y==="function")return[!1,0];if(Y==="string"||W instanceof String)return[!0,K?0:(0,n.calculateStringSize)(W)+n.JsonSize.Quote*2];if(Y==="boolean"||W instanceof Boolean)return K?[!0,0]:[!0,W==!0?n.JsonSize.True:n.JsonSize.False];if(Y==="number"||W instanceof Number)return K?[!0,0]:[!0,(0,n.calculateNumberSize)(W)];if(W instanceof Date)return K?[!0,0]:[!0,isNaN(W.getDate())?n.JsonSize.Null:n.JsonSize.Date+n.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,n.isPlainObject)(W)&&!Array.isArray(W))return[!1,0];if(G.has(W))return[!1,0];G.add(W);try{return[!0,Object.entries(W).reduce((X,[v,u],h,p)=>{let[y,w]=z(u,K);if(!y)throw new Error("JSON validation did not pass. Validation process stopped.");if(G.delete(W),K)return 0;const x=Array.isArray(W)?0:v.length+n.JsonSize.Comma+n.JsonSize.Colon*2,T=h0)return o(d);if(b==="number"&&isFinite(d))return g.long?c(d):a(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function o(d){if(d=String(d),!(d.length>100)){var g=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(g){var b=parseFloat(g[1]),C=(g[2]||"ms").toLowerCase();switch(C){case"years":case"year":case"yrs":case"yr":case"y":return b*s;case"weeks":case"week":case"w":return b*i;case"days":case"day":case"d":return b*n;case"hours":case"hour":case"hrs":case"hr":case"h":return b*r;case"minutes":case"minute":case"mins":case"min":case"m":return b*e;case"seconds":case"second":case"secs":case"sec":case"s":return b*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function a(d){var g=Math.abs(d);return g>=n?Math.round(d/n)+"d":g>=r?Math.round(d/r)+"h":g>=e?Math.round(d/e)+"m":g>=t?Math.round(d/t)+"s":d+"ms"}function c(d){var g=Math.abs(d);return g>=n?l(d,g,n,"day"):g>=r?l(d,g,r,"hour"):g>=e?l(d,g,e,"minute"):g>=t?l(d,g,t,"second"):d+" ms"}function l(d,g,b,C){var A=g>=b*1.5;return Math.round(d/b)+" "+C+(A?"s":"")}return xa}function Qm(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=Zm(),r.destroy=l,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function e(d){let g=0;for(let b=0;b{if(B==="%%")return"%";D++;const z=r.formatters[G];if(typeof z=="function"){const W=N[D];B=z.call(M,W),N.splice(D,1),D--}return B}),r.formatArgs.call(M,N),(M.log||r.log).apply(M,N)}return P.namespace=d,P.useColors=r.useColors(),P.color=r.selectColor(d),P.extend=n,P.destroy=r.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(C!==r.namespaces&&(C=r.namespaces,A=r.enabled(d)),A),set:N=>{b=N}}),typeof r.init=="function"&&r.init(P),P}function n(d,g){const b=r(this.namespace+(typeof g>"u"?":":g)+d);return b.log=this.log,b}function i(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let g;const b=(typeof d=="string"?d:"").split(/[\s,]+/),C=b.length;for(g=0;g"-"+g)].join(",");return r.enable(""),d}function o(d){if(d[d.length-1]==="*")return!0;let g,b;for(g=0,b=r.skips.length;g{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let d=0,g=0;c[0].replace(/%[a-zA-Z%]/g,b=>{b!=="%%"&&(d++,b==="%c"&&(g=d))}),c.splice(g,0,l)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=Ym(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(uu,uu.exports);var Km=uu.exports,Xm=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ni,"__esModule",{value:!0});ni.createModuleLogger=ni.createProjectLogger=void 0;const e1=Xm(Km),t1=(0,e1.default)("metamask");function r1(t){return t1.extend(t)}ni.createProjectLogger=r1;function n1(t,e){return t.extend(e)}ni.createModuleLogger=n1;var or={};Object.defineProperty(or,"__esModule",{value:!0});or.hexToBigInt=or.hexToNumber=or.bigIntToHex=or.numberToHex=void 0;const Gn=ht,Fi=ns,i1=t=>((0,Gn.assert)(typeof t=="number","Value must be a number."),(0,Gn.assert)(t>=0,"Value must be a non-negative number."),(0,Gn.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Fi.add0x)(t.toString(16)));or.numberToHex=i1;const s1=t=>((0,Gn.assert)(typeof t=="bigint","Value must be a bigint."),(0,Gn.assert)(t>=0,"Value must be a non-negative bigint."),(0,Fi.add0x)(t.toString(16)));or.bigIntToHex=s1;const o1=t=>{(0,Fi.assertIsHexString)(t);const e=parseInt(t,16);return(0,Gn.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};or.hexToNumber=o1;const a1=t=>((0,Fi.assertIsHexString)(t),BigInt((0,Fi.add0x)(t)));or.hexToBigInt=a1;var Sd={};Object.defineProperty(Sd,"__esModule",{value:!0});var Ed={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(Ed);var Md={},cu={exports:{}};const u1="2.0.0",xd=256,c1=Number.MAX_SAFE_INTEGER||9007199254740991,l1=16,f1=xd-6,h1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var po={MAX_LENGTH:xd,MAX_SAFE_COMPONENT_LENGTH:l1,MAX_SAFE_BUILD_LENGTH:f1,MAX_SAFE_INTEGER:c1,RELEASE_TYPES:h1,SEMVER_SPEC_VERSION:u1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const d1=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var go=d1;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=po,s=go;e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],l=e.t={};let d=0;const g="[a-zA-Z0-9-]",b=[["\\s",1],["\\d",i],[g,n]],C=P=>{for(const[N,M]of b)P=P.split(`${N}*`).join(`${N}{0,${M}}`).split(`${N}+`).join(`${N}{1,${M}}`);return P},A=(P,N,M)=>{const R=C(N),O=d++;s(P,O,N),l[P]=O,c[O]=N,o[O]=new RegExp(N,M?"g":void 0),a[O]=new RegExp(R,M?"g":void 0)};A("NUMERICIDENTIFIER","0|[1-9]\\d*"),A("NUMERICIDENTIFIERLOOSE","\\d+"),A("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),A("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),A("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),A("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),A("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),A("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),A("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),A("BUILDIDENTIFIER",`${g}+`),A("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),A("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),A("FULL",`^${c[l.FULLPLAIN]}$`),A("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),A("LOOSE",`^${c[l.LOOSEPLAIN]}$`),A("GTLT","((?:<|>)?=?)"),A("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),A("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),A("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),A("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),A("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),A("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),A("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),A("COERCERTL",c[l.COERCE],!0),A("LONETILDE","(?:~>?)"),A("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",A("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),A("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),A("LONECARET","(?:\\^)"),A("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",A("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),A("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),A("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),A("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),A("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",A("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),A("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),A("STAR","(<|>)?=?\\s*\\*"),A("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),A("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(cu,cu.exports);var is=cu.exports;const p1=Object.freeze({loose:!0}),g1=Object.freeze({}),b1=t=>t?typeof t!="object"?p1:t:g1;var Uu=b1;const Pl=/^[0-9]+$/,Cd=(t,e)=>{const r=Pl.test(t),n=Pl.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:tCd(e,t);var Rd={compareIdentifiers:Cd,rcompareIdentifiers:v1};const _s=go,{MAX_LENGTH:Dl,MAX_SAFE_INTEGER:Ss}=po,{safeRe:$l,t:Bl}=is,y1=Uu,{compareIdentifiers:Pn}=Rd;let m1=class er{constructor(e,r){if(r=y1(r),e instanceof er){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Dl)throw new TypeError(`version is longer than ${Dl} characters`);_s("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?$l[Bl.LOOSE]:$l[Bl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ss||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ss||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ss||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Pn(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var St=m1;const jl=St,w1=(t,e,r=!1)=>{if(t instanceof jl)return t;try{return new jl(t,e)}catch(n){if(!r)return null;throw n}};var yi=w1;const _1=yi,S1=(t,e)=>{const r=_1(t,e);return r?r.version:null};var E1=S1;const M1=yi,x1=(t,e)=>{const r=M1(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var C1=x1;const Fl=St,R1=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Fl(t instanceof Fl?t.version:t,r).inc(e,n,i).version}catch{return null}};var I1=R1;const Wl=yi,A1=(t,e)=>{const r=Wl(t,null,!0),n=Wl(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const d=c?"pre":"";return r.major!==n.major?d+"major":r.minor!==n.minor?d+"minor":r.patch!==n.patch?d+"patch":"prerelease"};var T1=A1;const k1=St,O1=(t,e)=>new k1(t,e).major;var N1=O1;const L1=St,P1=(t,e)=>new L1(t,e).minor;var D1=P1;const $1=St,B1=(t,e)=>new $1(t,e).patch;var j1=B1;const F1=yi,W1=(t,e)=>{const r=F1(t,e);return r&&r.prerelease.length?r.prerelease:null};var H1=W1;const Hl=St,V1=(t,e,r)=>new Hl(t,r).compare(new Hl(e,r));var Jt=V1;const U1=Jt,z1=(t,e,r)=>U1(e,t,r);var q1=z1;const G1=Jt,J1=(t,e)=>G1(t,e,!0);var Z1=J1;const Vl=St,Q1=(t,e,r)=>{const n=new Vl(t,r),i=new Vl(e,r);return n.compare(i)||n.compareBuild(i)};var zu=Q1;const Y1=zu,K1=(t,e)=>t.sort((r,n)=>Y1(r,n,e));var X1=K1;const ew=zu,tw=(t,e)=>t.sort((r,n)=>ew(n,r,e));var rw=tw;const nw=Jt,iw=(t,e,r)=>nw(t,e,r)>0;var bo=iw;const sw=Jt,ow=(t,e,r)=>sw(t,e,r)<0;var qu=ow;const aw=Jt,uw=(t,e,r)=>aw(t,e,r)===0;var Id=uw;const cw=Jt,lw=(t,e,r)=>cw(t,e,r)!==0;var Ad=lw;const fw=Jt,hw=(t,e,r)=>fw(t,e,r)>=0;var Gu=hw;const dw=Jt,pw=(t,e,r)=>dw(t,e,r)<=0;var Ju=pw;const gw=Id,bw=Ad,vw=bo,yw=Gu,mw=qu,ww=Ju,_w=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return gw(t,r,n);case"!=":return bw(t,r,n);case">":return vw(t,r,n);case">=":return yw(t,r,n);case"<":return mw(t,r,n);case"<=":return ww(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var Td=_w;const Sw=St,Ew=yi,{safeRe:Es,t:Ms}=is,Mw=(t,e)=>{if(t instanceof Sw)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(Es[Ms.COERCE]);else{let n;for(;(n=Es[Ms.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),Es[Ms.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Es[Ms.COERCERTL].lastIndex=-1}return r===null?null:Ew(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};var xw=Mw,Ca,Ul;function Cw(){return Ul||(Ul=1,Ca=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ca}var Rw=he;he.Node=fn;he.create=he;function he(t){var e=this;if(e instanceof he||(e=new he),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=t(r,n.value,i),n=n.next;return r};he.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};he.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};he.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};he.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new he;if(ethis.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&nthis.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};he.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n1;class Ow{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[rn]=e.max||1/0;const r=e.length||Ra;if(this[Dn]=typeof r!="function"?Ra:r,this[Pi]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[on]=e.maxAge||0,this[fr]=e.dispose,this[zl]=e.noDisposeOnSet||!1,this[kd]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[rn]=e||1/0,xi(this)}get max(){return this[rn]}set allowStale(e){this[Pi]=!!e}get allowStale(){return this[Pi]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[on]=e,xi(this)}get maxAge(){return this[on]}set lengthCalculator(e){typeof e!="function"&&(e=Ra),e!==this[Dn]&&(this[Dn]=e,this[pr]=0,this[ot].forEach(r=>{r.length=this[Dn](r.value,r.key),this[pr]+=r.length})),xi(this)}get lengthCalculator(){return this[Dn]}get length(){return this[pr]}get itemCount(){return this[ot].length}rforEach(e,r){r=r||this;for(let n=this[ot].tail;n!==null;){const i=n.prev;ql(this,e,n,r),n=i}}forEach(e,r){r=r||this;for(let n=this[ot].head;n!==null;){const i=n.next;ql(this,e,n,r),n=i}}keys(){return this[ot].toArray().map(e=>e.key)}values(){return this[ot].toArray().map(e=>e.value)}reset(){this[fr]&&this[ot]&&this[ot].length&&this[ot].forEach(e=>this[fr](e.key,e.value)),this[Ut]=new Map,this[ot]=new kw,this[pr]=0}dump(){return this[ot].map(e=>Ws(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[ot]}set(e,r,n){if(n=n||this[on],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[Dn](r,e);if(this[Ut].has(e)){if(s>this[rn])return Jn(this,this[Ut].get(e)),!1;const c=this[Ut].get(e).value;return this[fr]&&(this[zl]||this[fr](e,c.value)),c.now=i,c.maxAge=n,c.value=r,this[pr]+=s-c.length,c.length=s,this.get(e),xi(this),!0}const o=new Nw(e,r,s,i,n);return o.length>this[rn]?(this[fr]&&this[fr](e,r),!1):(this[pr]+=o.length,this[ot].unshift(o),this[Ut].set(e,this[ot].head),xi(this),!0)}has(e){if(!this[Ut].has(e))return!1;const r=this[Ut].get(e).value;return!Ws(this,r)}get(e){return Ia(this,e,!0)}peek(e){return Ia(this,e,!1)}pop(){const e=this[ot].tail;return e?(Jn(this,e),e.value):null}del(e){Jn(this,this[Ut].get(e))}load(e){this.reset();const r=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Ut].forEach((e,r)=>Ia(this,r,!1))}}const Ia=(t,e,r)=>{const n=t[Ut].get(e);if(n){const i=n.value;if(Ws(t,i)){if(Jn(t,n),!t[Pi])return}else r&&(t[kd]&&(n.value.now=Date.now()),t[ot].unshiftNode(n));return i.value}},Ws=(t,e)=>{if(!e||!e.maxAge&&!t[on])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[on]&&r>t[on]},xi=t=>{if(t[pr]>t[rn])for(let e=t[ot].tail;t[pr]>t[rn]&&e!==null;){const r=e.prev;Jn(t,e),e=r}},Jn=(t,e)=>{if(e){const r=e.value;t[fr]&&t[fr](r.key,r.value),t[pr]-=r.length,t[Ut].delete(r.key),t[ot].removeNode(e)}};class Nw{constructor(e,r,n,i,s){this.key=e,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const ql=(t,e,r,n)=>{let i=r.value;Ws(t,i)&&(Jn(t,r),t[Pi]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};var Lw=Ow,Aa,Gl;function Zt(){if(Gl)return Aa;Gl=1;class t{constructor(u,h){if(h=n(h),u instanceof t)return u.loose===!!h.loose&&u.includePrerelease===!!h.includePrerelease?u:new t(u.raw,h);if(u instanceof i)return this.raw=u.value,this.set=[[u]],this.format(),this;if(this.options=h,this.loose=!!h.loose,this.includePrerelease=!!h.includePrerelease,this.raw=u.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(p=>this.parseRange(p.trim())).filter(p=>p.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const p=this.set[0];if(this.set=this.set.filter(y=>!A(y[0])),this.set.length===0)this.set=[p];else if(this.set.length>1){for(const y of this.set)if(y.length===1&&P(y[0])){this.set=[y];break}}}this.format()}format(){return this.range=this.set.map(u=>u.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(u){const p=((this.options.includePrerelease&&b)|(this.options.loose&&C))+":"+u,y=r.get(p);if(y)return y;const w=this.options.loose,x=w?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];u=u.replace(x,Y(this.options.includePrerelease)),s("hyphen replace",u),u=u.replace(a[c.COMPARATORTRIM],l),s("comparator trim",u),u=u.replace(a[c.TILDETRIM],d),s("tilde trim",u),u=u.replace(a[c.CARETTRIM],g),s("caret trim",u);let T=u.split(" ").map(U=>M(U,this.options)).join(" ").split(/\s+/).map(U=>K(U,this.options));w&&(T=T.filter(U=>(s("loose invalid filter",U,this.options),!!U.match(a[c.COMPARATORLOOSE])))),s("range list",T);const m=new Map,f=T.map(U=>new i(U,this.options));for(const U of f){if(A(U))return[U];m.set(U.value,U)}m.size>1&&m.has("")&&m.delete("");const E=[...m.values()];return r.set(p,E),E}intersects(u,h){if(!(u instanceof t))throw new TypeError("a Range is required");return this.set.some(p=>N(p,h)&&u.set.some(y=>N(y,h)&&p.every(w=>y.every(x=>w.intersects(x,h)))))}test(u){if(!u)return!1;if(typeof u=="string")try{u=new o(u,this.options)}catch{return!1}for(let h=0;hv.value==="<0.0.0-0",P=v=>v.value==="",N=(v,u)=>{let h=!0;const p=v.slice();let y=p.pop();for(;h&&p.length;)h=p.every(w=>y.intersects(w,u)),y=p.pop();return h},M=(v,u)=>(s("comp",v,u),v=L(v,u),s("caret",v),v=O(v,u),s("tildes",v),v=G(v,u),s("xrange",v),v=W(v,u),s("stars",v),v),R=v=>!v||v.toLowerCase()==="x"||v==="*",O=(v,u)=>v.trim().split(/\s+/).map(h=>D(h,u)).join(" "),D=(v,u)=>{const h=u.loose?a[c.TILDELOOSE]:a[c.TILDE];return v.replace(h,(p,y,w,x,T)=>{s("tilde",v,p,y,w,x,T);let m;return R(y)?m="":R(w)?m=`>=${y}.0.0 <${+y+1}.0.0-0`:R(x)?m=`>=${y}.${w}.0 <${y}.${+w+1}.0-0`:T?(s("replaceTilde pr",T),m=`>=${y}.${w}.${x}-${T} <${y}.${+w+1}.0-0`):m=`>=${y}.${w}.${x} <${y}.${+w+1}.0-0`,s("tilde return",m),m})},L=(v,u)=>v.trim().split(/\s+/).map(h=>B(h,u)).join(" "),B=(v,u)=>{s("caret",v,u);const h=u.loose?a[c.CARETLOOSE]:a[c.CARET],p=u.includePrerelease?"-0":"";return v.replace(h,(y,w,x,T,m)=>{s("caret",v,y,w,x,T,m);let f;return R(w)?f="":R(x)?f=`>=${w}.0.0${p} <${+w+1}.0.0-0`:R(T)?w==="0"?f=`>=${w}.${x}.0${p} <${w}.${+x+1}.0-0`:f=`>=${w}.${x}.0${p} <${+w+1}.0.0-0`:m?(s("replaceCaret pr",m),w==="0"?x==="0"?f=`>=${w}.${x}.${T}-${m} <${w}.${x}.${+T+1}-0`:f=`>=${w}.${x}.${T}-${m} <${w}.${+x+1}.0-0`:f=`>=${w}.${x}.${T}-${m} <${+w+1}.0.0-0`):(s("no pr"),w==="0"?x==="0"?f=`>=${w}.${x}.${T}${p} <${w}.${x}.${+T+1}-0`:f=`>=${w}.${x}.${T}${p} <${w}.${+x+1}.0-0`:f=`>=${w}.${x}.${T} <${+w+1}.0.0-0`),s("caret return",f),f})},G=(v,u)=>(s("replaceXRanges",v,u),v.split(/\s+/).map(h=>z(h,u)).join(" ")),z=(v,u)=>{v=v.trim();const h=u.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return v.replace(h,(p,y,w,x,T,m)=>{s("xRange",v,p,y,w,x,T,m);const f=R(w),E=f||R(x),U=E||R(T),q=U;return y==="="&&q&&(y=""),m=u.includePrerelease?"-0":"",f?y===">"||y==="<"?p="<0.0.0-0":p="*":y&&q?(E&&(x=0),T=0,y===">"?(y=">=",E?(w=+w+1,x=0,T=0):(x=+x+1,T=0)):y==="<="&&(y="<",E?w=+w+1:x=+x+1),y==="<"&&(m="-0"),p=`${y+w}.${x}.${T}${m}`):E?p=`>=${w}.0.0${m} <${+w+1}.0.0-0`:U&&(p=`>=${w}.${x}.0${m} <${w}.${+x+1}.0-0`),s("xRange return",p),p})},W=(v,u)=>(s("replaceStars",v,u),v.trim().replace(a[c.STAR],"")),K=(v,u)=>(s("replaceGTE0",v,u),v.trim().replace(a[u.includePrerelease?c.GTE0PRE:c.GTE0],"")),Y=v=>(u,h,p,y,w,x,T,m,f,E,U,q,I)=>(R(p)?h="":R(y)?h=`>=${p}.0.0${v?"-0":""}`:R(w)?h=`>=${p}.${y}.0${v?"-0":""}`:x?h=`>=${h}`:h=`>=${h}${v?"-0":""}`,R(f)?m="":R(E)?m=`<${+f+1}.0.0-0`:R(U)?m=`<${f}.${+E+1}.0-0`:q?m=`<=${f}.${E}.${U}-${q}`:v?m=`<${f}.${E}.${+U+1}-0`:m=`<=${m}`,`${h} ${m}`.trim()),X=(v,u,h)=>{for(let p=0;p0){const y=v[p].semver;if(y.major===u.major&&y.minor===u.minor&&y.patch===u.patch)return!0}return!1}return!0};return Aa}var Ta,Jl;function vo(){if(Jl)return Ta;Jl=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(d,g){if(g=r(g),d instanceof e){if(d.loose===!!g.loose)return d;d=d.value}d=d.trim().split(/\s+/).join(" "),o("comparator",d,g),this.options=g,this.loose=!!g.loose,this.parse(d),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(d){const g=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],b=d.match(g);if(!b)throw new TypeError(`Invalid comparator: ${d}`);this.operator=b[1]!==void 0?b[1]:"",this.operator==="="&&(this.operator=""),b[2]?this.semver=new a(b[2],this.options.loose):this.semver=t}toString(){return this.value}test(d){if(o("Comparator.test",d,this.options.loose),this.semver===t||d===t)return!0;if(typeof d=="string")try{d=new a(d,this.options)}catch{return!1}return s(d,this.operator,this.semver,this.options)}intersects(d,g){if(!(d instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(d.value,g).test(this.value):d.operator===""?d.value===""?!0:new c(this.value,g).test(d.semver):(g=r(g),g.includePrerelease&&(this.value==="<0.0.0-0"||d.value==="<0.0.0-0")||!g.includePrerelease&&(this.value.startsWith("<0.0.0")||d.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&d.operator.startsWith(">")||this.operator.startsWith("<")&&d.operator.startsWith("<")||this.semver.version===d.semver.version&&this.operator.includes("=")&&d.operator.includes("=")||s(this.semver,"<",d.semver,g)&&this.operator.startsWith(">")&&d.operator.startsWith("<")||s(this.semver,">",d.semver,g)&&this.operator.startsWith("<")&&d.operator.startsWith(">")))}}Ta=e;const r=Uu,{safeRe:n,t:i}=is,s=Td,o=go,a=St,c=Zt();return Ta}const Pw=Zt(),Dw=(t,e,r)=>{try{e=new Pw(e,r)}catch{return!1}return e.test(t)};var yo=Dw;const $w=Zt(),Bw=(t,e)=>new $w(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var jw=Bw;const Fw=St,Ww=Zt(),Hw=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Ww(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Fw(n,r))}),n};var Vw=Hw;const Uw=St,zw=Zt(),qw=(t,e,r)=>{let n=null,i=null,s=null;try{s=new zw(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Uw(n,r))}),n};var Gw=qw;const ka=St,Jw=Zt(),Zl=bo,Zw=(t,e)=>{t=new Jw(t,e);let r=new ka("0.0.0");if(t.test(r)||(r=new ka("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{const a=new ka(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Zl(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Zl(r,s))&&(r=s)}return r&&t.test(r)?r:null};var Qw=Zw;const Yw=Zt(),Kw=(t,e)=>{try{return new Yw(t,e).range||"*"}catch{return null}};var Xw=Kw;const e_=St,Od=vo(),{ANY:t_}=Od,r_=Zt(),n_=yo,Ql=bo,Yl=qu,i_=Ju,s_=Gu,o_=(t,e,r,n)=>{t=new e_(t,n),e=new r_(e,n);let i,s,o,a,c;switch(r){case">":i=Ql,s=i_,o=Yl,a=">",c=">=";break;case"<":i=Yl,s=s_,o=Ql,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(n_(t,e,n))return!1;for(let l=0;l{C.semver===t_&&(C=new Od(">=0.0.0")),g=g||C,b=b||C,i(C.semver,g.semver,n)?g=C:o(C.semver,b.semver,n)&&(b=C)}),g.operator===a||g.operator===c||(!b.operator||b.operator===a)&&s(t,b.semver))return!1;if(b.operator===c&&o(t,b.semver))return!1}return!0};var Zu=o_;const a_=Zu,u_=(t,e,r)=>a_(t,e,">",r);var c_=u_;const l_=Zu,f_=(t,e,r)=>l_(t,e,"<",r);var h_=f_;const Kl=Zt(),d_=(t,e,r)=>(t=new Kl(t,r),e=new Kl(e,r),t.intersects(e,r));var p_=d_;const g_=yo,b_=Jt;var v_=(t,e,r)=>{const n=[];let i=null,s=null;const o=t.sort((d,g)=>b_(d,g,r));for(const d of o)g_(d,e,r)?(s=d,i||(i=d)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[d,g]of n)d===g?a.push(d):!g&&d===o[0]?a.push("*"):g?d===o[0]?a.push(`<=${g}`):a.push(`${d} - ${g}`):a.push(`>=${d}`);const c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length{if(t===e)return!0;t=new Xl(t,r),e=new Xl(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const o=w_(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},m_=[new Qu(">=0.0.0-0")],ef=[new Qu(">=0.0.0")],w_=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Oa){if(e.length===1&&e[0].semver===Oa)return!0;r.includePrerelease?t=m_:t=ef}if(e.length===1&&e[0].semver===Oa){if(r.includePrerelease)return!0;e=ef}const n=new Set;let i,s;for(const C of t)C.operator===">"||C.operator===">="?i=tf(i,C,r):C.operator==="<"||C.operator==="<="?s=rf(s,C,r):n.add(C.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Yu(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const C of n){if(i&&!Ci(C,String(i),r)||s&&!Ci(C,String(s),r))return null;for(const A of e)if(!Ci(C,String(A),r))return!1;return!0}let a,c,l,d,g=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;g&&g.prerelease.length===1&&s.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(const C of e){if(d=d||C.operator===">"||C.operator===">=",l=l||C.operator==="<"||C.operator==="<=",i){if(b&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===b.major&&C.semver.minor===b.minor&&C.semver.patch===b.patch&&(b=!1),C.operator===">"||C.operator===">="){if(a=tf(i,C,r),a===C&&a!==i)return!1}else if(i.operator===">="&&!Ci(i.semver,String(C),r))return!1}if(s){if(g&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===g.major&&C.semver.minor===g.minor&&C.semver.patch===g.patch&&(g=!1),C.operator==="<"||C.operator==="<="){if(c=rf(s,C,r),c===C&&c!==s)return!1}else if(s.operator==="<="&&!Ci(s.semver,String(C),r))return!1}if(!C.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&d&&!i&&o!==0||b||g)},tf=(t,e,r)=>{if(!t)return e;const n=Yu(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},rf=(t,e,r)=>{if(!t)return e;const n=Yu(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var __=y_;const Na=is,nf=po,S_=St,sf=Rd,E_=yi,M_=E1,x_=C1,C_=I1,R_=T1,I_=N1,A_=D1,T_=j1,k_=H1,O_=Jt,N_=q1,L_=Z1,P_=zu,D_=X1,$_=rw,B_=bo,j_=qu,F_=Id,W_=Ad,H_=Gu,V_=Ju,U_=Td,z_=xw,q_=vo(),G_=Zt(),J_=yo,Z_=jw,Q_=Vw,Y_=Gw,K_=Qw,X_=Xw,e2=Zu,t2=c_,r2=h_,n2=p_,i2=v_,s2=__;var o2={parse:E_,valid:M_,clean:x_,inc:C_,diff:R_,major:I_,minor:A_,patch:T_,prerelease:k_,compare:O_,rcompare:N_,compareLoose:L_,compareBuild:P_,sort:D_,rsort:$_,gt:B_,lt:j_,eq:F_,neq:W_,gte:H_,lte:V_,cmp:U_,coerce:z_,Comparator:q_,Range:G_,satisfies:J_,toComparators:Z_,maxSatisfying:Q_,minSatisfying:Y_,minVersion:K_,validRange:X_,outside:e2,gtr:t2,ltr:r2,intersects:n2,simplifyRange:i2,subset:s2,SemVer:S_,re:Na.re,src:Na.src,tokens:Na.t,SEMVER_SPEC_VERSION:nf.SEMVER_SPEC_VERSION,RELEASE_TYPES:nf.RELEASE_TYPES,compareIdentifiers:sf.compareIdentifiers,rcompareIdentifiers:sf.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=o2,r=_n,n=ht;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",g=>(0,e.valid)(g)===null?`Expected SemVer version, got "${g}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",g=>(0,e.validRange)(g)===null?`Expected SemVer range, got "${g}"`:!0);function i(g){return(0,r.is)(g,t.VersionStruct)}t.isValidSemVerVersion=i;function s(g){return(0,r.is)(g,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(g){(0,n.assertStruct)(g,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(g){(0,n.assertStruct)(g,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(g,b){return(0,e.gt)(g,b)}t.gtVersion=c;function l(g,b){return(0,e.gtr)(g,b)}t.gtRange=l;function d(g,b){return(0,e.satisfies)(g,b,{includePrerelease:!0})}t.satisfiesVersionRange=d})(Md);(function(t){var e=Z&&Z.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=Z&&Z.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(ht,t),r(rs,t),r(fe,t),r(fo,t),r(sr,t),r(ri,t),r(ns,t),r(_d,t),r(ni,t),r(Vu,t),r(or,t),r(Sd,t),r(Ed,t),r(Md,t)})(rd);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=rd;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(td);var Nd=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(co,"__esModule",{value:!0});co.PollingBlockTracker=void 0;const a2=Nd(Nu),u2=Nd(Ay),c2=es,of=td,af=(0,of.createModuleLogger)(of.projectLogger,"polling-block-tracker"),l2=(0,a2.default)(),f2=1e3;class h2 extends c2.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*f2,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=uf(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: diff --git a/examples/vite/dist/assets/index-ec52b6d6.js b/examples/vite/dist/assets/index-5cd7d4b5.js similarity index 99% rename from examples/vite/dist/assets/index-ec52b6d6.js rename to examples/vite/dist/assets/index-5cd7d4b5.js index bceb31f9e6..8c65a671bd 100644 --- a/examples/vite/dist/assets/index-ec52b6d6.js +++ b/examples/vite/dist/assets/index-5cd7d4b5.js @@ -1,4 +1,4 @@ -import{n as _t,s as ce,T as N,t as U,a as C,o as rt,R as Br,p as q,y as gt}from"./index-926756d6.js";import{aS as Dr,aT as Ur}from"./index-9fd9e1d6.js";import"@safe-globalThis/safe-apps-provider";import"@safe-globalThis/safe-apps-sdk";/** +import{n as _t,s as ce,T as N,t as U,a as C,o as rt,R as Br,p as q,y as gt}from"./index-648799f0.js";import{aS as Dr,aT as Ur}from"./index-8dd5e2d3.js";import"@safe-globalThis/safe-apps-provider";import"@safe-globalThis/safe-apps-sdk";/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause diff --git a/examples/vite/dist/assets/index-926756d6.js b/examples/vite/dist/assets/index-648799f0.js similarity index 98% rename from examples/vite/dist/assets/index-926756d6.js rename to examples/vite/dist/assets/index-648799f0.js index 3e57eb62af..d81fc803dd 100644 --- a/examples/vite/dist/assets/index-926756d6.js +++ b/examples/vite/dist/assets/index-648799f0.js @@ -1 +1 @@ -import{av as pe}from"./index-9fd9e1d6.js";const fe=Symbol(),Z=Object.getPrototypeOf,J=new WeakMap,me=e=>e&&(J.has(e)?J.get(e):Z(e)===Object.prototype||Z(e)===Array.prototype),he=e=>me(e)&&e[fe]||null,ee=(e,t=!0)=>{J.set(e,t)},z=e=>typeof e=="object"&&e!==null,P=new WeakMap,B=new WeakSet,ge=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>z(o)&&!B.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),r=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,v=r)=>{const b=l.get(o);if((b==null?void 0:b[0])===g)return b[1];const y=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return ee(y,!0),l.set(o,[g,y]),Reflect.ownKeys(o).forEach(D=>{if(Object.getOwnPropertyDescriptor(y,D))return;const _=Reflect.get(o,D),W={value:_,enumerable:!0,configurable:!0};if(B.has(_))ee(_,!1);else if(_ instanceof Promise)delete W.value,W.get=()=>v(_);else if(P.has(_)){const[I,K]=P.get(_);W.value=c(I,K(),v)}Object.defineProperty(y,D,W)}),Object.preventExtensions(y)},m=new WeakMap,f=[1,1],C=o=>{if(!z(o))throw new Error("object required");const g=m.get(o);if(g)return g;let v=f[0];const b=new Set,y=(a,i=++f[0])=>{v!==i&&(v=i,b.forEach(n=>n(a,i)))};let D=f[1];const _=(a=++f[1])=>(D!==a&&!b.size&&(D=a,I.forEach(([i])=>{const n=i[1](a);n>v&&(v=n)})),v),W=a=>(i,n)=>{const h=[...i];h[1]=[a,...h[1]],y(h,n)},I=new Map,K=(a,i)=>{if(b.size){const n=i[3](W(a));I.set(a,[i,n])}else I.set(a,[i])},X=a=>{var i;const n=I.get(a);n&&(I.delete(a),(i=n[1])==null||i.call(n))},de=a=>(b.add(a),b.size===1&&I.forEach(([n,h],j)=>{const k=n[3](W(j));I.set(j,[n,k])}),()=>{b.delete(a),b.size===0&&I.forEach(([n,h],j)=>{h&&(h(),I.set(j,[n]))})}),H=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),N=t(H,{deleteProperty(a,i){const n=Reflect.get(a,i);X(i);const h=Reflect.deleteProperty(a,i);return h&&y(["delete",[i],n]),h},set(a,i,n,h){const j=Reflect.has(a,i),k=Reflect.get(a,i,h);if(j&&(e(k,n)||m.has(n)&&e(k,m.get(n))))return!0;X(i),z(n)&&(n=he(n)||n);let $=n;if(n instanceof Promise)n.then(O=>{n.status="fulfilled",n.value=O,y(["resolve",[i],O])}).catch(O=>{n.status="rejected",n.reason=O,y(["reject",[i],O])});else{!P.has(n)&&s(n)&&($=C(n));const O=!B.has($)&&P.get($);O&&K(i,O)}return Reflect.set(a,i,$,h),y(["set",[i],n,k]),!0}});m.set(o,N);const ue=[H,_,c,de];return P.set(N,ue),Reflect.ownKeys(o).forEach(a=>{const i=Object.getOwnPropertyDescriptor(o,a);"value"in i&&(N[a]=o[a],delete i.value,delete i.writable),Object.defineProperty(H,a,i)}),N})=>[C,P,B,e,t,s,r,l,c,m,f],[be]=ge();function A(e={}){return be(e)}function M(e,t,s){const r=P.get(e);let l;const c=[],m=r[3];let f=!1;const o=m(g=>{if(c.push(g),s){t(c.splice(0));return}l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function ye(e,t){const s=P.get(e),[r,l,c]=s;return c(r,l(),t)}const d=A({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ce={state:d,subscribe(e){return M(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=ce.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},Ie=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=A({enabled:Ie,userSessionId:"",events:[],connectedWalletId:void 0}),Ee={state:u,subscribe(e){return M(u.events,()=>e(ye(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},w=A({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),E={state:w,subscribe(e){return M(w,()=>e(w))},setChains(e){w.chains=e},setWalletConnectUri(e){w.walletConnectUri=e},setIsCustomDesktop(e){w.isCustomDesktop=e},setIsCustomMobile(e){w.isCustomMobile=e},setIsDataLoaded(e){w.isDataLoaded=e},setIsUiLoaded(e){w.isUiLoaded=e},setIsAuth(e){w.isAuth=e}},Y=A({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),T={state:Y,subscribe(e){return M(Y,()=>e(Y))},setConfig(e){var t,s;Ee.initialize(),E.setChains(e.chains),E.setIsAuth(!!e.enableAuthMode),E.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),E.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(Y,e)}};var ve=Object.defineProperty,te=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,se=(e,t,s)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,_e=(e,t)=>{for(var s in t||(t={}))we.call(t,s)&&se(e,s,t[s]);if(te)for(var s of te(t))Le.call(t,s)&&se(e,s,t[s]);return e};const q="https://explorer-api.walletconnect.com",F="wcm",G="js-2.6.2";async function x(e,t){const s=_e({sdkType:F,sdkVersion:G},t),r=new URL(e,q);return r.searchParams.append("projectId",T.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const R={async getDesktopListings(e){return x("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return x("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return x("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return x("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${q}/w3m/v1/getWalletImage/${e}?projectId=${T.state.projectId}&sdkType=${F}&sdkVersion=${G}`},getAssetImageUrl(e){return`${q}/w3m/v1/getAssetImage/${e}?projectId=${T.state.projectId}&sdkType=${F}&sdkVersion=${G}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(oe)for(var s of oe(t))Pe.call(t,s)&&ne(e,s,t[s]);return e};const re=p.isMobile(),L=A({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:L,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=T.state;if(e==="NONE"||t==="ALL"&&!e)return L.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await R.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),C=e.indexOf(m.id);return f-C}),L.recomendedWallets=l}else{const{chains:s,isAuth:r}=E.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=re?await R.getMobileListings(m):await R.getDesktopListings(m);L.recomendedWallets=Object.values(f)}return L.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=T.state,{recomendedWallets:l}=L;if(r==="ALL")return L.wallets;l.length?t.excludedIds=l.map(v=>v.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),E.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:C}=re?await R.getMobileListings(t):await R.getDesktopListings(t),o=Object.values(f),g=m?"search":"wallets";return L[g]={listings:[...L[g].listings,...o],total:C,page:c??1},{listings:o,total:C}},getWalletImageUrl(e){return R.getWalletImageUrl(e)},getAssetImageUrl(e){return R.getAssetImageUrl(e)},resetSearch(){L.search={listings:[],total:0,page:1}}},S=A({open:!1}),Q={state:S,subscribe(e){return M(S,()=>e(S))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=E.state;if(p.removeWalletConnectDeepLink(),E.setWalletConnectUri(e==null?void 0:e.uri),E.setChains(e==null?void 0:e.chains),ce.reset("ConnectWallet"),s&&r)S.open=!0,t();else{const l=setInterval(()=>{const c=E.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),S.open=!0,t())},200)}})},close(){S.open=!1}};var We=Object.defineProperty,ie=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,ae=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Me=(e,t)=>{for(var s in t||(t={}))Re.call(t,s)&&ae(e,s,t[s]);if(ie)for(var s of ie(t))Ue.call(t,s)&&ae(e,s,t[s]);return e};function De(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const V=A({themeMode:De()?"dark":"light"}),le={state:V,subscribe(e){return M(V,()=>e(V))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(V.themeMode=t),s&&(V.themeVariables=Me({},s))}},U=A({open:!1,message:"",variant:"success"}),Ve={state:U,subscribe(e){return M(U,()=>e(U))},openToast(e,t){U.open=!0,U.message=e,U.variant=t},closeToast(){U.open=!1}};class je{constructor(t){this.openModal=Q.open,this.closeModal=Q.close,this.subscribeModal=Q.subscribe,this.setTheme=le.setThemeConfig,le.setThemeConfig(t),T.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-ec52b6d6.js"),["assets/index-ec52b6d6.js","assets/index-9fd9e1d6.js","assets/index-882a2daf.css"]);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),E.setIsUiLoaded(!0)}}}const Ne=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:je},Symbol.toStringTag,{value:"Module"}));export{Ee as R,ce as T,p as a,Ne as i,le as n,Ve as o,E as p,Q as s,ke as t,T as y}; +import{av as pe}from"./index-8dd5e2d3.js";const fe=Symbol(),Z=Object.getPrototypeOf,J=new WeakMap,me=e=>e&&(J.has(e)?J.get(e):Z(e)===Object.prototype||Z(e)===Array.prototype),he=e=>me(e)&&e[fe]||null,ee=(e,t=!0)=>{J.set(e,t)},z=e=>typeof e=="object"&&e!==null,P=new WeakMap,B=new WeakSet,ge=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>z(o)&&!B.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),r=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,v=r)=>{const b=l.get(o);if((b==null?void 0:b[0])===g)return b[1];const y=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return ee(y,!0),l.set(o,[g,y]),Reflect.ownKeys(o).forEach(D=>{if(Object.getOwnPropertyDescriptor(y,D))return;const _=Reflect.get(o,D),W={value:_,enumerable:!0,configurable:!0};if(B.has(_))ee(_,!1);else if(_ instanceof Promise)delete W.value,W.get=()=>v(_);else if(P.has(_)){const[I,K]=P.get(_);W.value=c(I,K(),v)}Object.defineProperty(y,D,W)}),Object.preventExtensions(y)},m=new WeakMap,f=[1,1],C=o=>{if(!z(o))throw new Error("object required");const g=m.get(o);if(g)return g;let v=f[0];const b=new Set,y=(a,i=++f[0])=>{v!==i&&(v=i,b.forEach(n=>n(a,i)))};let D=f[1];const _=(a=++f[1])=>(D!==a&&!b.size&&(D=a,I.forEach(([i])=>{const n=i[1](a);n>v&&(v=n)})),v),W=a=>(i,n)=>{const h=[...i];h[1]=[a,...h[1]],y(h,n)},I=new Map,K=(a,i)=>{if(b.size){const n=i[3](W(a));I.set(a,[i,n])}else I.set(a,[i])},X=a=>{var i;const n=I.get(a);n&&(I.delete(a),(i=n[1])==null||i.call(n))},de=a=>(b.add(a),b.size===1&&I.forEach(([n,h],j)=>{const k=n[3](W(j));I.set(j,[n,k])}),()=>{b.delete(a),b.size===0&&I.forEach(([n,h],j)=>{h&&(h(),I.set(j,[n]))})}),H=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),N=t(H,{deleteProperty(a,i){const n=Reflect.get(a,i);X(i);const h=Reflect.deleteProperty(a,i);return h&&y(["delete",[i],n]),h},set(a,i,n,h){const j=Reflect.has(a,i),k=Reflect.get(a,i,h);if(j&&(e(k,n)||m.has(n)&&e(k,m.get(n))))return!0;X(i),z(n)&&(n=he(n)||n);let $=n;if(n instanceof Promise)n.then(O=>{n.status="fulfilled",n.value=O,y(["resolve",[i],O])}).catch(O=>{n.status="rejected",n.reason=O,y(["reject",[i],O])});else{!P.has(n)&&s(n)&&($=C(n));const O=!B.has($)&&P.get($);O&&K(i,O)}return Reflect.set(a,i,$,h),y(["set",[i],n,k]),!0}});m.set(o,N);const ue=[H,_,c,de];return P.set(N,ue),Reflect.ownKeys(o).forEach(a=>{const i=Object.getOwnPropertyDescriptor(o,a);"value"in i&&(N[a]=o[a],delete i.value,delete i.writable),Object.defineProperty(H,a,i)}),N})=>[C,P,B,e,t,s,r,l,c,m,f],[be]=ge();function A(e={}){return be(e)}function M(e,t,s){const r=P.get(e);let l;const c=[],m=r[3];let f=!1;const o=m(g=>{if(c.push(g),s){t(c.splice(0));return}l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function ye(e,t){const s=P.get(e),[r,l,c]=s;return c(r,l(),t)}const d=A({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ce={state:d,subscribe(e){return M(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=ce.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},Ie=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=A({enabled:Ie,userSessionId:"",events:[],connectedWalletId:void 0}),Ee={state:u,subscribe(e){return M(u.events,()=>e(ye(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},w=A({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),E={state:w,subscribe(e){return M(w,()=>e(w))},setChains(e){w.chains=e},setWalletConnectUri(e){w.walletConnectUri=e},setIsCustomDesktop(e){w.isCustomDesktop=e},setIsCustomMobile(e){w.isCustomMobile=e},setIsDataLoaded(e){w.isDataLoaded=e},setIsUiLoaded(e){w.isUiLoaded=e},setIsAuth(e){w.isAuth=e}},Y=A({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),T={state:Y,subscribe(e){return M(Y,()=>e(Y))},setConfig(e){var t,s;Ee.initialize(),E.setChains(e.chains),E.setIsAuth(!!e.enableAuthMode),E.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),E.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(Y,e)}};var ve=Object.defineProperty,te=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,se=(e,t,s)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,_e=(e,t)=>{for(var s in t||(t={}))we.call(t,s)&&se(e,s,t[s]);if(te)for(var s of te(t))Le.call(t,s)&&se(e,s,t[s]);return e};const q="https://explorer-api.walletconnect.com",F="wcm",G="js-2.6.2";async function x(e,t){const s=_e({sdkType:F,sdkVersion:G},t),r=new URL(e,q);return r.searchParams.append("projectId",T.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const R={async getDesktopListings(e){return x("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return x("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return x("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return x("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${q}/w3m/v1/getWalletImage/${e}?projectId=${T.state.projectId}&sdkType=${F}&sdkVersion=${G}`},getAssetImageUrl(e){return`${q}/w3m/v1/getAssetImage/${e}?projectId=${T.state.projectId}&sdkType=${F}&sdkVersion=${G}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(oe)for(var s of oe(t))Pe.call(t,s)&&ne(e,s,t[s]);return e};const re=p.isMobile(),L=A({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:L,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=T.state;if(e==="NONE"||t==="ALL"&&!e)return L.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await R.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),C=e.indexOf(m.id);return f-C}),L.recomendedWallets=l}else{const{chains:s,isAuth:r}=E.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=re?await R.getMobileListings(m):await R.getDesktopListings(m);L.recomendedWallets=Object.values(f)}return L.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=T.state,{recomendedWallets:l}=L;if(r==="ALL")return L.wallets;l.length?t.excludedIds=l.map(v=>v.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),E.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:C}=re?await R.getMobileListings(t):await R.getDesktopListings(t),o=Object.values(f),g=m?"search":"wallets";return L[g]={listings:[...L[g].listings,...o],total:C,page:c??1},{listings:o,total:C}},getWalletImageUrl(e){return R.getWalletImageUrl(e)},getAssetImageUrl(e){return R.getAssetImageUrl(e)},resetSearch(){L.search={listings:[],total:0,page:1}}},S=A({open:!1}),Q={state:S,subscribe(e){return M(S,()=>e(S))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=E.state;if(p.removeWalletConnectDeepLink(),E.setWalletConnectUri(e==null?void 0:e.uri),E.setChains(e==null?void 0:e.chains),ce.reset("ConnectWallet"),s&&r)S.open=!0,t();else{const l=setInterval(()=>{const c=E.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),S.open=!0,t())},200)}})},close(){S.open=!1}};var We=Object.defineProperty,ie=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable,ae=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Me=(e,t)=>{for(var s in t||(t={}))Re.call(t,s)&&ae(e,s,t[s]);if(ie)for(var s of ie(t))Ue.call(t,s)&&ae(e,s,t[s]);return e};function De(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const V=A({themeMode:De()?"dark":"light"}),le={state:V,subscribe(e){return M(V,()=>e(V))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(V.themeMode=t),s&&(V.themeVariables=Me({},s))}},U=A({open:!1,message:"",variant:"success"}),Ve={state:U,subscribe(e){return M(U,()=>e(U))},openToast(e,t){U.open=!0,U.message=e,U.variant=t},closeToast(){U.open=!1}};class je{constructor(t){this.openModal=Q.open,this.closeModal=Q.close,this.subscribeModal=Q.subscribe,this.setTheme=le.setThemeConfig,le.setThemeConfig(t),T.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-5cd7d4b5.js"),["assets/index-5cd7d4b5.js","assets/index-8dd5e2d3.js","assets/index-882a2daf.css"]);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),E.setIsUiLoaded(!0)}}}const Ne=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:je},Symbol.toStringTag,{value:"Module"}));export{Ee as R,ce as T,p as a,Ne as i,le as n,Ve as o,E as p,Q as s,ke as t,T as y}; diff --git a/examples/vite/dist/assets/index-9fd9e1d6.js b/examples/vite/dist/assets/index-8dd5e2d3.js similarity index 99% rename from examples/vite/dist/assets/index-9fd9e1d6.js rename to examples/vite/dist/assets/index-8dd5e2d3.js index 63d6a0d6ac..90aa7ad70e 100644 --- a/examples/vite/dist/assets/index-9fd9e1d6.js +++ b/examples/vite/dist/assets/index-8dd5e2d3.js @@ -77,10 +77,10 @@ Error generating stack: `+i.message+` `):`The contract function "${n}" reverted.`,{cause:i,metaMessages:o}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{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=a,this.reason=s,this.signature=l}}class qO extends gu{constructor({functionName:e}){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."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class $h extends gu{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class V4 extends gu{constructor({body:e,details:t,headers:n,status:r,url:i}){super("HTTP request failed.",{details:t,metaMessages:[r&&`Status: ${r}`,`URL: ${Q2(i)}`,e&&`Request body: ${f0(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"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=n,this.status=r,this.url=i}}class HO extends gu{constructor({body:e,details:t,url:n}){super("WebSocket request failed.",{details:t,metaMessages:[`URL: ${Q2(n)}`,`Request body: ${f0(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}}class Wh extends gu{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${Q2(n)}`,`Request body: ${f0(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}}class Z6 extends gu{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Q2(t)}`,`Request body: ${f0(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const GO=-1;class T0 extends gu{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:i}){super(i,{cause:e,docsPath:n,metaMessages:r||(e==null?void 0:e.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof Wh?e.code:t??GO}}class zs extends T0{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class v3 extends T0{constructor(e){super(e,{code:v3.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(v3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class F3 extends T0{constructor(e){super(e,{code:F3.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(F3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class D3 extends T0{constructor(e){super(e,{code:D3.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(D3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class b3 extends T0{constructor(e){super(e,{code:b3.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` `)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(b3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class hs extends T0{constructor(e){super(e,{code:hs.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(hs,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class sa extends T0{constructor(e){super(e,{code:sa.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` `)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(sa,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class w3 extends T0{constructor(e){super(e,{code:w3.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(w3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Qr extends T0{constructor(e){super(e,{code:Qr.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(Qr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class x3 extends T0{constructor(e){super(e,{code:x3.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(x3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class k3 extends T0{constructor(e){super(e,{code:k3.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(k3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class _3 extends T0{constructor(e){super(e,{code:_3.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(_3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class S3 extends T0{constructor(e){super(e,{code:S3.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(S3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class _e extends zs{constructor(e){super(e,{code:_e.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(_e,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class P3 extends zs{constructor(e){super(e,{code:P3.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(P3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class T3 extends zs{constructor(e){super(e,{code:T3.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(T3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class I3 extends zs{constructor(e){super(e,{code:I3.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(I3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class O3 extends zs{constructor(e){super(e,{code:O3.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(O3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class En extends zs{constructor(e){super(e,{code:En.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(En,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class KO extends T0{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const QO=3;function N3(u,{abi:e,address:t,args:n,docsPath:r,functionName:i,sender:a}){const{code:o,data:s,message:l,shortMessage:c}=u instanceof $h?u:u instanceof gu?u.walk(d=>"data"in d)||u.walk():{},E=(()=>u instanceof Z2?new qO({functionName:i}):[QO,hs.code].includes(o)&&(s||l||c)?new X6({abi:e,data:typeof s=="object"?s.data:s,functionName:i,message:c??l}):u)();return new Lh(E,{abi:e,args:n,contractAddress:t,docsPath:r,functionName:i,sender:a})}class Ms extends gu{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join(` -`),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class VO extends gu{constructor(e,{account:t,docsPath:n,chain:r,data:i,gas:a,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:l,nonce:c,to:E,value:d}){const f=bl({from:t==null?void 0:t.address,to:E,value:typeof d<"u"&&`${Uh(d)} ${(r==null?void 0:r.nativeCurrency.symbol)||"ETH"}`,data:i,gas:a,gasPrice:typeof o<"u"&&`${k0(o)} gwei`,maxFeePerGas:typeof s<"u"&&`${k0(s)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${k0(l)} gwei`,nonce:c});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",f].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}function qh(u,e){const t=(u.details||"").toLowerCase(),n=u.walk(r=>r.code===Za.code);return n instanceof gu?new Za({cause:u,message:n.details}):Za.nodeMessage.test(t)?new Za({cause:u,message:u.details}):UE.nodeMessage.test(t)?new UE({cause:u,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):W6.nodeMessage.test(t)?new W6({cause:u,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):q6.nodeMessage.test(t)?new q6({cause:u,nonce:e==null?void 0:e.nonce}):H6.nodeMessage.test(t)?new H6({cause:u,nonce:e==null?void 0:e.nonce}):G6.nodeMessage.test(t)?new G6({cause:u,nonce:e==null?void 0:e.nonce}):K6.nodeMessage.test(t)?new K6({cause:u}):Q6.nodeMessage.test(t)?new Q6({cause:u,gas:e==null?void 0:e.gas}):V6.nodeMessage.test(t)?new V6({cause:u,gas:e==null?void 0:e.gas}):J6.nodeMessage.test(t)?new J6({cause:u}):LE.nodeMessage.test(t)?new LE({cause:u,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Y2({cause:u})}function JO(u,{docsPath:e,...t}){const n=(()=>{const r=qh(u,t);return r instanceof Y2?u:r})();return new VO(n,{docsPath:e,...t})}function Hh(u,{format:e}){return e?Object.keys(e({})).reduce((n,r)=>(u!=null&&u.hasOwnProperty(r)&&(n[r]=u[r]),n),{}):{}}function wl(u){const{account:e,gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:i}=u,a=e?Ct(e):void 0;if(a&&!fs(a.address))throw new B3({address:a.address});if(i&&!fs(i))throw new B3({address:i});if(typeof t<"u"&&(typeof n<"u"||typeof r<"u"))throw new UO;if(n&&n>2n**256n-1n)throw new UE({maxFeePerGas:n});if(r&&n&&r>n)throw new LE({maxFeePerGas:n,maxPriorityFeePerGas:r})}class YO extends gu{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class Gh extends gu{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class XO extends gu{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${k0(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class ZO extends gu{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function Vr(u,{blockHash:e,blockNumber:t,blockTag:n,includeTransactions:r}={}){var c,E,d;const i=n??"latest",a=r??!1,o=t!==void 0?zu(t):void 0;let s=null;if(e?s=await u.request({method:"eth_getBlockByHash",params:[e,a]}):s=await u.request({method:"eth_getBlockByNumber",params:[o||i,a]}),!s)throw new ZO({blockHash:e,blockNumber:t});return(((d=(E=(c=u.chain)==null?void 0:c.formatters)==null?void 0:E.block)==null?void 0:d.format)||_h)(s)}async function Kh(u){const e=await u.request({method:"eth_gasPrice"});return BigInt(e)}async function uN(u,e){return mF(u,e)}async function mF(u,e){var i,a,o;const{block:t,chain:n=u.chain,request:r}=e||{};if(typeof((i=n==null?void 0:n.fees)==null?void 0:i.defaultPriorityFee)=="function"){const s=t||await Vr(u);return n.fees.defaultPriorityFee({block:s,client:u,request:r})}else if(typeof((a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee)<"u")return(o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee;try{const s=await u.request({method:"eth_maxPriorityFeePerGas"});return In(s)}catch{const[s,l]=await Promise.all([t?Promise.resolve(t):Vr(u),Kh(u)]);if(typeof s.baseFeePerGas!="bigint")throw new Gh;const c=l-s.baseFeePerGas;return c<0n?0n:c}}async function eN(u,e){return uf(u,e)}async function uf(u,e){var d,f;const{block:t,chain:n=u.chain,request:r,type:i="eip1559"}=e||{},a=await(async()=>{var m,h;return typeof((m=n==null?void 0:n.fees)==null?void 0:m.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:t,client:u,request:r}):((h=n==null?void 0:n.fees)==null?void 0:h.baseFeeMultiplier)??1.2})();if(a<1)throw new YO;const s=10**(((d=a.toString().split(".")[1])==null?void 0:d.length)??0),l=m=>m*BigInt(Math.ceil(a*s))/BigInt(s),c=t||await Vr(u);if(typeof((f=n==null?void 0:n.fees)==null?void 0:f.estimateFeesPerGas)=="function")return n.fees.estimateFeesPerGas({block:t,client:u,multiply:l,request:r,type:i});if(i==="eip1559"){if(typeof c.baseFeePerGas!="bigint")throw new Gh;const m=r!=null&&r.maxPriorityFeePerGas?r.maxPriorityFeePerGas:await mF(u,{block:c,chain:n,request:r}),h=l(c.baseFeePerGas);return{maxFeePerGas:(r==null?void 0:r.maxFeePerGas)??h+m,maxPriorityFeePerGas:m}}return{gasPrice:(r==null?void 0:r.gasPrice)??l(await Kh(u))}}async function gF(u,{address:e,blockTag:t="latest",blockNumber:n}){const r=await u.request({method:"eth_getTransactionCount",params:[e,n?zu(n):t]});return u0(r)}function tN(u){if(u.type)return u.type;if(typeof u.maxFeePerGas<"u"||typeof u.maxPriorityFeePerGas<"u")return"eip1559";if(typeof u.gasPrice<"u")return typeof u.accessList<"u"?"eip2930":"legacy";throw new LO({transaction:u})}async function rd(u,e){const{account:t=u.account,chain:n,gas:r,nonce:i,type:a}=e;if(!t)throw new Ms;const o=Ct(t),s=await Vr(u,{blockTag:"latest"}),l={...e,from:o.address};if(typeof i>"u"&&(l.nonce=await gF(u,{address:o.address,blockTag:"pending"})),typeof a>"u")try{l.type=tN(l)}catch{l.type=typeof s.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(l.type==="eip1559"){const{maxFeePerGas:c,maxPriorityFeePerGas:E}=await uf(u,{block:s,chain:n,request:l});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(l.gas=await Qh(u,{...l,account:{address:o.address,type:"json-rpc"}})),wl(l),l}async function Qh(u,e){var r,i,a;const t=e.account??u.account;if(!t)throw new Ms({docsPath:"/docs/actions/public/estimateGas"});const n=Ct(t);try{const{accessList:o,blockNumber:s,blockTag:l,data:c,gas:E,gasPrice:d,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:h,to:B,value:g,...C}=n.type==="local"?await rd(u,e):e,v=(s?zu(s):void 0)||l;wl(e);const w=((a=(i=(r=u.chain)==null?void 0:r.formatters)==null?void 0:i.transactionRequest)==null?void 0:a.format)||J2,D=w({...Hh(C,{format:w}),from:n.address,accessList:o,data:c,gas:E,gasPrice:d,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:h,to:B,value:g}),p=await u.request({method:"eth_estimateGas",params:v?[D,v]:[D]});return BigInt(p)}catch(o){throw JO(o,{...e,account:n,chain:u.chain})}}async function nN(u,{abi:e,address:t,args:n,functionName:r,...i}){const a=ri({abi:e,args:n,functionName:r});try{return await Qh(u,{data:a,to:t,...i})}catch(o){const s=i.account?Ct(i.account):void 0;throw N3(o,{abi:e,address:t,args:n,docsPath:"/docs/contract/estimateContractGas",functionName:r,sender:s==null?void 0:s.address})}}const E8="/docs/contract/decodeEventLog";function xl({abi:u,data:e,strict:t,topics:n}){const r=t??!0,[i,...a]=n;if(!i)throw new jI({docsPath:E8});const o=u.find(m=>m.type==="event"&&i===Nh(ni(m)));if(!(o&&"name"in o)||o.type!=="event")throw new zI(i,{docsPath:E8});const{name:s,inputs:l}=o,c=l==null?void 0:l.some(m=>!("name"in m&&m.name));let E=c?[]:{};const d=l.filter(m=>"indexed"in m&&m.indexed);for(let m=0;m!("indexed"in m&&m.indexed));if(f.length>0){if(e&&e!=="0x")try{const m=nd(f,e);if(m)if(c)E=[...E,...m];else for(let h=0;h0?E:void 0}}function rN({param:u,value:e}){return u.type==="string"||u.type==="bytes"||u.type==="tuple"||u.type.match(/^(.*)\[(\d+)?\]$/)?e:(nd([u],e)||[])[0]}async function Vh(u,{address:e,blockHash:t,fromBlock:n,toBlock:r,event:i,events:a,args:o,strict:s}={}){const l=s??!1,c=a??(i?[i]:void 0);let E=[];c&&(E=[c.flatMap(f=>Dl({abi:[f],eventName:f.name,args:o}))],i&&(E=E[0]));let d;return t?d=await u.request({method:"eth_getLogs",params:[{address:e,topics:E,blockHash:t}]}):d=await u.request({method:"eth_getLogs",params:[{address:e,topics:E,fromBlock:typeof n=="bigint"?zu(n):n,toBlock:typeof r=="bigint"?zu(r):r}]}),d.map(f=>{var m;try{const{eventName:h,args:B}=c?xl({abi:c,data:f.data,topics:f.topics,strict:l}):{eventName:void 0,args:void 0};return jt(f,{args:B,eventName:h})}catch(h){let B,g;if(h instanceof oa||h instanceof js){if(l)return;B=h.abiItem.name,g=(m=h.abiItem.inputs)==null?void 0:m.some(C=>!("name"in C&&C.name))}return jt(f,{args:g?[]:{},eventName:B})}}).filter(Boolean)}async function AF(u,{abi:e,address:t,args:n,blockHash:r,eventName:i,fromBlock:a,toBlock:o,strict:s}){const l=i?Fl({abi:e,name:i}):void 0,c=l?void 0:e.filter(E=>E.type==="event");return Vh(u,{address:t,args:n,blockHash:r,event:l,events:c,fromBlock:a,toBlock:o,strict:s})}const q9="/docs/contract/decodeFunctionResult";function Us({abi:u,args:e,functionName:t,data:n}){let r=u[0];if(t&&(r=Fl({abi:u,args:e,name:t}),!r))throw new $E(t,{docsPath:q9});if(r.type!=="function")throw new $E(void 0,{docsPath:q9});if(!r.outputs)throw new MI(r.name,{docsPath:q9});const i=nd(r.outputs,n);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}const ef=[{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"}],yF=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"}],BF=[...yF,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],iN=[...yF,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],d8=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],f8=[{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"}]}],aN=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],oN="0x82ad56cb";function sN(u,{docsPath:e,...t}){const n=(()=>{const r=qh(u,t);return r instanceof Y2?u:r})();return new CF(n,{docsPath:e,...t})}const H9=new Map;function Jh({fn:u,id:e,shouldSplitBatch:t,wait:n=0}){const r=async()=>{const l=o();i();const c=l.map(({args:E})=>E);c.length!==0&&u(c).then(E=>{l.forEach(({pendingPromise:d},f)=>{var m;return(m=d.resolve)==null?void 0:m.call(d,[E[f],E])})}).catch(E=>{l.forEach(({pendingPromise:d})=>{var f;return(f=d.reject)==null?void 0:f.call(d,E)})})},i=()=>H9.delete(e),a=()=>o().map(({args:l})=>l),o=()=>H9.get(e)||[],s=l=>H9.set(e,[...o(),l]);return{flush:i,async schedule(l){const c={},E=new Promise((m,h)=>{c.resolve=m,c.reject=h});return(t==null?void 0:t([...a(),l]))&&r(),o().length>0?(s({args:l,pendingPromise:c}),E):(s({args:l,pendingPromise:c}),setTimeout(r,n),E)}}}async function id(u,e){var g,C,y,v;const{account:t=u.account,batch:n=!!((g=u.batch)!=null&&g.multicall),blockNumber:r,blockTag:i="latest",accessList:a,data:o,gas:s,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:E,nonce:d,to:f,value:m,...h}=e,B=t?Ct(t):void 0;try{wl(e);const D=(r?zu(r):void 0)||i,p=((v=(y=(C=u.chain)==null?void 0:C.formatters)==null?void 0:y.transactionRequest)==null?void 0:v.format)||J2,x=p({...Hh(h,{format:p}),from:B==null?void 0:B.address,accessList:a,data:o,gas:s,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:E,nonce:d,to:f,value:m});if(n&&lN({request:x}))try{return await cN(u,{...x,blockNumber:r,blockTag:i})}catch(O){if(!(O instanceof Gv)&&!(O instanceof $6))throw O}const j=await u.request({method:"eth_call",params:D?[x,D]:[x]});return j==="0x"?{data:void 0}:{data:j}}catch(w){const D=EN(w),{offchainLookup:p,offchainLookupSignature:x}=await Hu(()=>import("./ccip-4cb4b6ef.js"),[]);if((D==null?void 0:D.slice(0,10))===x&&f)return{data:await p(u,{data:D,to:f})};throw sN(w,{...e,account:B,chain:u.chain})}}function lN({request:u}){const{data:e,to:t,...n}=u;return!(!e||e.startsWith(oN)||!t||Object.values(n).filter(r=>typeof r<"u").length>0)}async function cN(u,e){var h;const{batchSize:t=1024,wait:n=0}=typeof((h=u.batch)==null?void 0:h.multicall)=="object"?u.batch.multicall:{},{blockNumber:r,blockTag:i="latest",data:a,multicallAddress:o,to:s}=e;let l=o;if(!l){if(!u.chain)throw new Gv;l=Ns({blockNumber:r,chain:u.chain,contract:"multicall3"})}const E=(r?zu(r):void 0)||i,{schedule:d}=Jh({id:`${u.uid}.${E}`,wait:n,shouldSplitBatch(B){return B.reduce((C,{data:y})=>C+(y.length-2),0)>t*2},fn:async B=>{const g=B.map(v=>({allowFailure:!0,callData:v.data,target:v.to})),C=ri({abi:ef,args:[g],functionName:"aggregate3"}),y=await u.request({method:"eth_call",params:[{data:C,to:l},E]});return Us({abi:ef,args:[g],functionName:"aggregate3",data:y||"0x"})}}),[{returnData:f,success:m}]=await d({data:a,to:s});if(!m)throw new $h({data:f});return f==="0x"?{data:void 0}:{data:f}}function EN(u){if(!(u instanceof gu))return;const e=u.walk();return typeof e.data=="object"?e.data.data:e.data}async function Jr(u,{abi:e,address:t,args:n,functionName:r,...i}){const a=ri({abi:e,args:n,functionName:r});try{const{data:o}=await id(u,{data:a,to:t,...i});return Us({abi:e,args:n,functionName:r,data:o||"0x"})}catch(o){throw N3(o,{abi:e,address:t,args:n,docsPath:"/docs/contract/readContract",functionName:r})}}async function dN(u,{abi:e,address:t,args:n,dataSuffix:r,functionName:i,...a}){const o=a.account?Ct(a.account):void 0,s=ri({abi:e,args:n,functionName:i});try{const{data:l}=await id(u,{batch:!1,data:`${s}${r?r.replace("0x",""):""}`,to:t,...a});return{result:Us({abi:e,args:n,functionName:i,data:l||"0x"}),request:{abi:e,address:t,args:n,dataSuffix:r,functionName:i,...a}}}catch(l){throw N3(l,{abi:e,address:t,args:n,docsPath:"/docs/contract/simulateContract",functionName:i,sender:o==null?void 0:o.address})}}const G9=new Map,p8=new Map;let fN=0;function Ls(u,e,t){const n=++fN,r=()=>G9.get(u)||[],i=()=>{const c=r();G9.set(u,c.filter(E=>E.id!==n))},a=()=>{const c=p8.get(u);r().length===1&&c&&c(),i()},o=r();if(G9.set(u,[...o,{id:n,fns:e}]),o&&o.length>0)return a;const s={};for(const c in e)s[c]=(...E)=>{const d=r();d.length!==0&&d.forEach(f=>{var m,h;return(h=(m=f.fns)[c])==null?void 0:h.call(m,...E)})};const l=t(s);return typeof l=="function"&&p8.set(u,l),a}async function HE(u){return new Promise(e=>setTimeout(e,u))}function kl(u,{emitOnBegin:e,initialWaitTime:t,interval:n}){let r=!0;const i=()=>r=!1;return(async()=>{let o;e&&(o=await u({unpoll:i}));const s=await(t==null?void 0:t(o))??n;await HE(s);const l=async()=>{r&&(await u({unpoll:i}),await HE(n),l())};l()})(),i}const pN=new Map,hN=new Map;function CN(u){const e=(r,i)=>({clear:()=>i.delete(r),get:()=>i.get(r),set:a=>i.set(r,a)}),t=e(u,pN),n=e(u,hN);return{clear:()=>{t.clear(),n.clear()},promise:t,response:n}}async function mN(u,{cacheKey:e,cacheTime:t=1/0}){const n=CN(e),r=n.response.get();if(r&&t>0&&new Date().getTime()-r.created.getTime()`blockNumber.${u}`;async function _l(u,{cacheTime:e=u.cacheTime,maxAge:t}={}){const n=await mN(()=>u.request({method:"eth_blockNumber"}),{cacheKey:gN(u.uid),cacheTime:t??e});return BigInt(n)}async function ad(u,{filter:e}){const t="strict"in e&&e.strict;return(await e.request({method:"eth_getFilterChanges",params:[e.id]})).map(r=>{var i;if(typeof r=="string")return r;try{const{eventName:a,args:o}="abi"in e&&e.abi?xl({abi:e.abi,data:r.data,topics:r.topics,strict:t}):{eventName:void 0,args:void 0};return jt(r,{args:o,eventName:a})}catch(a){let o,s;if(a instanceof oa||a instanceof js){if("strict"in e&&e.strict)return;o=a.abiItem.name,s=(i=a.abiItem.inputs)==null?void 0:i.some(l=>!("name"in l&&l.name))}return jt(r,{args:s?[]:{},eventName:o})}}).filter(Boolean)}async function od(u,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function AN(u,{abi:e,address:t,args:n,batch:r=!0,eventName:i,onError:a,onLogs:o,poll:s,pollingInterval:l=u.pollingInterval,strict:c}){return(typeof s<"u"?s:u.transport.type!=="webSocket")?(()=>{const m=f0(["watchContractEvent",t,n,r,u.uid,i,l]),h=c??!1;return Ls(m,{onLogs:o,onError:a},B=>{let g,C,y=!1;const v=kl(async()=>{var w;if(!y){try{C=await EF(u,{abi:e,address:t,args:n,eventName:i,strict:h})}catch{}y=!0;return}try{let D;if(C)D=await ad(u,{filter:C});else{const p=await _l(u);g&&g!==p?D=await AF(u,{abi:e,address:t,args:n,fromBlock:g+1n,toBlock:p,strict:h}):D=[],g=p}if(D.length===0)return;r?B.onLogs(D):D.forEach(p=>B.onLogs([p]))}catch(D){C&&D instanceof sa&&(y=!1),(w=B.onError)==null||w.call(B,D)}},{emitOnBegin:!0,interval:l});return async()=>{C&&await od(u,{filter:C}),v()}})})():(()=>{let m=!0,h=()=>m=!1;return(async()=>{try{const B=i?Dl({abi:e,eventName:i,args:n}):[],{unsubscribe:g}=await u.transport.subscribe({params:["logs",{address:t,topics:B}],onData(C){var v;if(!m)return;const y=C.result;try{const{eventName:w,args:D}=xl({abi:e,data:y.data,topics:y.topics,strict:c}),p=jt(y,{args:D,eventName:w});o([p])}catch(w){let D,p;if(w instanceof oa||w instanceof js){if(c)return;D=w.abiItem.name,p=(v=w.abiItem.inputs)==null?void 0:v.some(j=>!("name"in j&&j.name))}const x=jt(y,{args:p?[]:{},eventName:D});o([x])}},onError(C){a==null||a(C)}});h=g,m||h()}catch(B){a==null||a(B)}})(),h})()}function yN(u,{docsPath:e,...t}){const n=(()=>{const r=qh(u,t);return r instanceof Y2?u:r})();return new $O(n,{docsPath:e,...t})}async function R3(u){const e=await u.request({method:"eth_chainId"});return u0(e)}async function Yh(u,{serializedTransaction:e}){return u.request({method:"eth_sendRawTransaction",params:[e]})}async function Xh(u,e){var h,B,g;const{account:t=u.account,chain:n=u.chain,accessList:r,data:i,gas:a,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:l,nonce:c,to:E,value:d,...f}=e;if(!t)throw new Ms({docsPath:"/docs/actions/wallet/sendTransaction"});const m=Ct(t);try{wl(e);let C;if(n!==null&&(C=await R3(u),Kv({currentChainId:C,chain:n})),m.type==="local"){const w=await rd(u,{account:m,accessList:r,chain:n,data:i,gas:a,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:l,nonce:c,to:E,value:d,...f});C||(C=await R3(u));const D=(h=n==null?void 0:n.serializers)==null?void 0:h.transaction,p=await m.signTransaction({...w,chainId:C},{serializer:D});return await Yh(u,{serializedTransaction:p})}const y=((g=(B=n==null?void 0:n.formatters)==null?void 0:B.transactionRequest)==null?void 0:g.format)||J2,v=y({...Hh(f,{format:y}),accessList:r,data:i,from:m.address,gas:a,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:l,nonce:c,to:E,value:d});return await u.request({method:"eth_sendTransaction",params:[v]})}catch(C){throw yN(C,{...e,account:m,chain:e.chain||void 0})}}async function BN(u,{abi:e,address:t,args:n,dataSuffix:r,functionName:i,...a}){const o=ri({abi:e,args:n,functionName:i});return await Xh(u,{data:`${o}${r?r.replace("0x",""):""}`,to:t,...a})}async function vN(u,{chain:e}){const{id:t,name:n,nativeCurrency:r,rpcUrls:i,blockExplorers:a}=e;await u.request({method:"wallet_addEthereumChain",params:[{chainId:zu(t),chainName:n,nativeCurrency:r,rpcUrls:i.default.http,blockExplorerUrls:a?Object.values(a).map(({url:o})=>o):void 0}]})}const tf=256;let gc=tf,Ac;function FN(u=11){if(!Ac||gc+u>tf*2){Ac="",gc=0;for(let e=0;e{const g=B(h);for(const y in f)delete g[y];const C={...h,...g};return Object.assign(C,{extend:m(C)})}}return Object.assign(f,{extend:m(f)})}function FF(u,{delay:e=100,retryCount:t=2,shouldRetry:n=()=>!0}={}){return new Promise((r,i)=>{const a=async({count:o=0}={})=>{const s=async({error:l})=>{const c=typeof e=="function"?e({count:o,error:l}):e;c&&await HE(c),a({count:o+1})};try{const l=await u();r(l)}catch(l){if(o"code"in u?u.code!==-1&&u.code!==-32004&&u.code!==-32005&&u.code!==-32042&&u.code!==-32603:u instanceof V4&&u.status?u.status!==403&&u.status!==408&&u.status!==413&&u.status!==429&&u.status!==500&&u.status!==502&&u.status!==503&&u.status!==504:!1;function DN(u,{retryDelay:e=150,retryCount:t=3}={}){return async n=>FF(async()=>{try{return await u(n)}catch(r){const i=r;switch(i.code){case v3.code:throw new v3(i);case F3.code:throw new F3(i);case D3.code:throw new D3(i);case b3.code:throw new b3(i);case hs.code:throw new hs(i);case sa.code:throw new sa(i);case w3.code:throw new w3(i);case Qr.code:throw new Qr(i);case x3.code:throw new x3(i);case k3.code:throw new k3(i);case _3.code:throw new _3(i);case S3.code:throw new S3(i);case _e.code:throw new _e(i);case P3.code:throw new P3(i);case T3.code:throw new T3(i);case I3.code:throw new I3(i);case O3.code:throw new O3(i);case En.code:throw new En(i);case 5e3:throw new _e(i);default:throw r instanceof gu?r:new KO(i)}}},{delay:({count:r,error:i})=>{var a;if(i&&i instanceof V4){const o=(a=i==null?void 0:i.headers)==null?void 0:a.get("Retry-After");if(o!=null&&o.match(/\d/))return parseInt(o)*1e3}return~~(1<!DF(r)})}function sd({key:u,name:e,request:t,retryCount:n=3,retryDelay:r=150,timeout:i,type:a},o){return{config:{key:u,name:e,request:t,retryCount:n,retryDelay:r,timeout:i,type:a},request:DN(t,{retryCount:n,retryDelay:r}),value:o}}function Sl(u,e={}){const{key:t="custom",name:n="Custom Provider",retryDelay:r}=e;return({retryCount:i})=>sd({key:t,name:n,request:u.request.bind(u),retryCount:e.retryCount??i,retryDelay:r,type:"custom"})}function h8(u,e={}){const{key:t="fallback",name:n="Fallback",rank:r=!1,retryCount:i,retryDelay:a}=e;return({chain:o,pollingInterval:s=4e3,timeout:l})=>{let c=u,E=()=>{};const d=sd({key:t,name:n,async request({method:f,params:m}){const h=async(B=0)=>{const g=c[B]({chain:o,retryCount:0,timeout:l});try{const C=await g.request({method:f,params:m});return E({method:f,params:m,response:C,transport:g,status:"success"}),C}catch(C){if(E({error:C,method:f,params:m,transport:g,status:"error"}),DF(C)||B===c.length-1)throw C;return h(B+1)}};return h()},retryCount:i,retryDelay:a,type:"fallback"},{onResponse:f=>E=f,transports:c.map(f=>f({chain:o,retryCount:0}))});if(r){const f=typeof r=="object"?r:{};bN({chain:o,interval:f.interval??s,onTransports:m=>c=m,sampleCount:f.sampleCount,timeout:f.timeout,transports:c,weights:f.weights})}return d}}function bN({chain:u,interval:e=4e3,onTransports:t,sampleCount:n=10,timeout:r=1e3,transports:i,weights:a={}}){const{stability:o=.7,latency:s=.3}=a,l=[],c=async()=>{const E=await Promise.all(i.map(async m=>{const h=m({chain:u,retryCount:0,timeout:r}),B=Date.now();let g,C;try{await h.request({method:"net_listening"}),C=1}catch{C=0}finally{g=Date.now()}return{latency:g-B,success:C}}));l.push(E),l.length>n&&l.shift();const d=Math.max(...l.map(m=>Math.max(...m.map(({latency:h})=>h)))),f=i.map((m,h)=>{const B=l.map(w=>w[h].latency),C=1-B.reduce((w,D)=>w+D,0)/B.length/d,y=l.map(w=>w[h].success),v=y.reduce((w,D)=>w+D,0)/y.length;return v===0?[0,h]:[s*C+o*v,h]}).sort((m,h)=>h[0]-m[0]);t(f.map(([,m])=>i[m])),await HE(e),c()};c()}class bF extends gu{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function wN(){if(typeof WebSocket<"u")return WebSocket;if(typeof globalThis.WebSocket<"u")return globalThis.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const C8=wN();function wF(u,{errorInstance:e=new Error("timed out"),timeout:t,signal:n}){return new Promise((r,i)=>{(async()=>{let a;try{const o=new AbortController;t>0&&(a=setTimeout(()=>{n?o.abort():i(e)},t)),r(await u({signal:o==null?void 0:o.signal}))}catch(o){o.name==="AbortError"&&i(e),i(o)}finally{clearTimeout(a)}})()})}let nf=0;async function xN(u,{body:e,fetchOptions:t={},timeout:n=1e4}){var o;const{headers:r,method:i,signal:a}=t;try{const s=await wF(async({signal:c})=>await fetch(u,{...t,body:Array.isArray(e)?f0(e.map(d=>({jsonrpc:"2.0",id:d.id??nf++,...d}))):f0({jsonrpc:"2.0",id:e.id??nf++,...e}),headers:{...r,"Content-Type":"application/json"},method:i||"POST",signal:a||(n>0?c:void 0)}),{errorInstance:new Z6({body:e,url:u}),timeout:n,signal:!0});let l;if((o=s.headers.get("Content-Type"))!=null&&o.startsWith("application/json")?l=await s.json():l=await s.text(),!s.ok)throw new V4({body:e,details:f0(l.error)||s.statusText,headers:s.headers,status:s.status,url:u});return l}catch(s){throw s instanceof V4||s instanceof Z6?s:new V4({body:e,details:s.message,url:u})}}const K9=new Map;async function Q9(u){let e=K9.get(u);if(e)return e;const{schedule:t}=Jh({id:u,fn:async()=>{const i=new C8(u),a=new Map,o=new Map,s=({data:c})=>{const E=JSON.parse(c),d=E.method==="eth_subscription",f=d?E.params.subscription:E.id,m=d?o:a,h=m.get(f);h&&h({data:c}),d||m.delete(f)},l=()=>{K9.delete(u),i.removeEventListener("close",l),i.removeEventListener("message",s)};return i.addEventListener("close",l),i.addEventListener("message",s),i.readyState===C8.CONNECTING&&await new Promise((c,E)=>{i&&(i.onopen=c,i.onerror=E)}),e=Object.assign(i,{requests:a,subscriptions:o}),K9.set(u,e),[e]}}),[n,[r]]=await t();return r}function kN(u,{body:e,onResponse:t}){if(u.readyState===u.CLOSED||u.readyState===u.CLOSING)throw new HO({body:e,url:u.url,details:"Socket is closed."});const n=nf++,r=({data:i})=>{var o;const a=JSON.parse(i);typeof a.id=="number"&&n!==a.id||(t==null||t(a),e.method==="eth_subscribe"&&typeof a.result=="string"&&u.subscriptions.set(a.result,r),e.method==="eth_unsubscribe"&&u.subscriptions.delete((o=e.params)==null?void 0:o[0]))};return u.requests.set(n,r),u.send(JSON.stringify({jsonrpc:"2.0",...e,id:n})),u}async function _N(u,{body:e,timeout:t=1e4}){return wF(()=>new Promise(n=>Co.webSocket(u,{body:e,onResponse:n})),{errorInstance:new Z6({body:e,url:u.url}),timeout:t})}const Co={http:xN,webSocket:kN,webSocketAsync:_N};function SN(u,e={}){const{batch:t,fetchOptions:n,key:r="http",name:i="HTTP JSON-RPC",retryDelay:a}=e;return({chain:o,retryCount:s,timeout:l})=>{const{batchSize:c=1e3,wait:E=0}=typeof t=="object"?t:{},d=e.retryCount??s,f=l??e.timeout??1e4,m=u||(o==null?void 0:o.rpcUrls.default.http[0]);if(!m)throw new bF;return sd({key:r,name:i,async request({method:h,params:B}){const g={method:h,params:B},{schedule:C}=Jh({id:`${u}`,wait:E,shouldSplitBatch(D){return D.length>c},fn:D=>Co.http(m,{body:D,fetchOptions:n,timeout:f})}),y=async D=>t?C(D):[await Co.http(m,{body:D,fetchOptions:n,timeout:f})],[{error:v,result:w}]=await y(g);if(v)throw new Wh({body:g,error:v,url:m});return w},retryCount:d,retryDelay:a,timeout:f,type:"http"},{fetchOptions:n,url:u})}}function Zh(u,e){var n,r,i;if(!(u instanceof gu))return!1;const t=u.walk(a=>a instanceof X6);return t instanceof X6?!!(((n=t.data)==null?void 0:n.errorName)==="ResolverNotFound"||((r=t.data)==null?void 0:r.errorName)==="ResolverWildcardNotSupported"||(i=t.reason)!=null&&i.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&t.reason===dF[50]):!1}function xF(u){if(u.length!==66||u.indexOf("[")!==0||u.indexOf("]")!==65)return null;const e=`0x${u.slice(1,65)}`;return cn(e)?e:null}function Vc(u){let e=new Uint8Array(32).fill(0);if(!u)return y3(e);const t=u.split(".");for(let n=t.length-1;n>=0;n-=1){const r=xF(t[n]),i=r?Kr(r):s0($n(t[n]),"bytes");e=s0(Vn([e,i]),"bytes")}return y3(e)}function PN(u){return`[${u.slice(2)}]`}function TN(u){const e=new Uint8Array(32).fill(0);return u?xF(u)||s0($n(u)):y3(e)}function ld(u){const e=u.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const t=new Uint8Array($n(e).byteLength+2);let n=0;const r=e.split(".");for(let i=0;i255&&(a=$n(PN(TN(r[i])))),t[n]=a.length,t.set(a,n+1),n+=a.length+1}return t.byteLength!==n+1?t.slice(0,n+1):t}async function IN(u,{blockNumber:e,blockTag:t,coinType:n,name:r,universalResolverAddress:i}){let a=i;if(!a){if(!u.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Ns({blockNumber:e,chain:u.chain,contract:"ensUniversalResolver"})}try{const o=ri({abi:f8,functionName:"addr",...n!=null?{args:[Vc(r),BigInt(n)]}:{args:[Vc(r)]}}),s=await Jr(u,{address:a,abi:BF,functionName:"resolve",args:[er(ld(r)),o],blockNumber:e,blockTag:t});if(s[0]==="0x")return null;const l=Us({abi:f8,args:n!=null?[Vc(r),BigInt(n)]:void 0,functionName:"addr",data:s[0]});return l==="0x"||Ji(l)==="0x00"?null:l}catch(o){if(Zh(o,"resolve"))return null;throw o}}class ON extends gu{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)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class C4 extends gu{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class u5 extends gu{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.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class NN extends gu{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const RN=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,jN=/^(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,})(\/(?[\w\-.]+))?(?\/.*)?$/,zN=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,MN=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function UN(u){try{const e=await fetch(u,{method:"HEAD"});if(e.status===200){const t=e.headers.get("content-type");return t==null?void 0:t.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(t=>{const n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=u})}}function m8(u,e){return u?u.endsWith("/")?u.slice(0,-1):u:e}function kF({uri:u,gatewayUrls:e}){const t=zN.test(u);if(t)return{uri:u,isOnChain:!0,isEncoded:t};const n=m8(e==null?void 0:e.ipfs,"https://ipfs.io"),r=m8(e==null?void 0:e.arweave,"https://arweave.net"),i=u.match(RN),{protocol:a,subpath:o,target:s,subtarget:l=""}=(i==null?void 0:i.groups)||{},c=a==="ipns:/"||o==="ipns/",E=a==="ipfs:/"||o==="ipfs/"||jN.test(u);if(u.startsWith("http")&&!c&&!E){let f=u;return e!=null&&e.arweave&&(f=u.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:f,isOnChain:!1,isEncoded:!1}}if((c||E)&&s)return{uri:`${n}/${c?"ipns":"ipfs"}/${s}${l}`,isOnChain:!1,isEncoded:!1};if(a==="ar:/"&&s)return{uri:`${r}/${s}${l||""}`,isOnChain:!1,isEncoded:!1};let d=u.replace(MN,"");if(d.startsWith("r.json());return await e5({gatewayUrls:u,uri:_F(t)})}catch{throw new u5({uri:e})}}async function e5({gatewayUrls:u,uri:e}){const{uri:t,isOnChain:n}=kF({uri:e,gatewayUrls:u});if(n||await UN(t))return t;throw new u5({uri:e})}function $N(u){let e=u;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[t,n,r]=e.split("/"),[i,a]=t.split(":"),[o,s]=n.split(":");if(!i||i.toLowerCase()!=="eip155")throw new C4({reason:"Only EIP-155 supported"});if(!a)throw new C4({reason:"Chain ID not found"});if(!s)throw new C4({reason:"Contract address not found"});if(!r)throw new C4({reason:"Token ID not found"});if(!o)throw new C4({reason:"ERC namespace not found"});return{chainID:parseInt(a),namespace:o.toLowerCase(),contractAddress:s,tokenID:r}}async function WN(u,{nft:e}){if(e.namespace==="erc721")return Jr(u,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return Jr(u,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new NN({namespace:e.namespace})}async function qN(u,{gatewayUrls:e,record:t}){return/eip155:/i.test(t)?HN(u,{gatewayUrls:e,record:t}):e5({uri:t,gatewayUrls:e})}async function HN(u,{gatewayUrls:e,record:t}){const n=$N(t),r=await WN(u,{nft:n}),{uri:i,isOnChain:a,isEncoded:o}=kF({uri:r,gatewayUrls:e});if(a&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const l=o?atob(i.replace("data:application/json;base64,","")):i,c=JSON.parse(l);return e5({uri:_F(c),gatewayUrls:e})}let s=n.tokenID;return n.namespace==="erc1155"&&(s=s.replace("0x","").padStart(64,"0")),LN({gatewayUrls:e,uri:i.replace(/(?:0x)?{id}/,s)})}async function SF(u,{blockNumber:e,blockTag:t,name:n,key:r,universalResolverAddress:i}){let a=i;if(!a){if(!u.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Ns({blockNumber:e,chain:u.chain,contract:"ensUniversalResolver"})}try{const o=await Jr(u,{address:a,abi:BF,functionName:"resolve",args:[er(ld(n)),ri({abi:d8,functionName:"text",args:[Vc(n),r]})],blockNumber:e,blockTag:t});if(o[0]==="0x")return null;const s=Us({abi:d8,functionName:"text",data:o[0]});return s===""?null:s}catch(o){if(Zh(o,"resolve"))return null;throw o}}async function GN(u,{blockNumber:e,blockTag:t,gatewayUrls:n,name:r,universalResolverAddress:i}){const a=await SF(u,{blockNumber:e,blockTag:t,key:"avatar",name:r,universalResolverAddress:i});if(!a)return null;try{return await qN(u,{record:a,gatewayUrls:n})}catch{return null}}async function KN(u,{address:e,blockNumber:t,blockTag:n,universalResolverAddress:r}){let i=r;if(!i){if(!u.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Ns({blockNumber:t,chain:u.chain,contract:"ensUniversalResolver"})}const a=`${e.toLowerCase().substring(2)}.addr.reverse`;try{return(await Jr(u,{address:i,abi:iN,functionName:"reverse",args:[er(ld(a))],blockNumber:t,blockTag:n}))[0]}catch(o){if(Zh(o,"reverse"))return null;throw o}}async function QN(u,{blockNumber:e,blockTag:t,name:n,universalResolverAddress:r}){let i=r;if(!i){if(!u.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Ns({blockNumber:e,chain:u.chain,contract:"ensUniversalResolver"})}const[a]=await Jr(u,{address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[er(ld(n))],blockNumber:e,blockTag:t});return a}async function VN(u){const e=td(u,{method:"eth_newBlockFilter"}),t=await u.request({method:"eth_newBlockFilter"});return{id:t,request:e(t),type:"block"}}async function PF(u,{address:e,args:t,event:n,events:r,fromBlock:i,strict:a,toBlock:o}={}){const s=r??(n?[n]:void 0),l=td(u,{method:"eth_newFilter"});let c=[];s&&(c=[s.flatMap(d=>Dl({abi:[d],eventName:d.name,args:t}))],n&&(c=c[0]));const E=await u.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof i=="bigint"?zu(i):i,toBlock:typeof o=="bigint"?zu(o):o,...c.length?{topics:c}:{}}]});return{abi:s,args:t,eventName:n?n.name:void 0,fromBlock:i,id:E,request:l(E),strict:a,toBlock:o,type:"event"}}async function TF(u){const e=td(u,{method:"eth_newPendingTransactionFilter"}),t=await u.request({method:"eth_newPendingTransactionFilter"});return{id:t,request:e(t),type:"transaction"}}async function JN(u,{address:e,blockNumber:t,blockTag:n="latest"}){const r=t?zu(t):void 0,i=await u.request({method:"eth_getBalance",params:[e,r||n]});return BigInt(i)}async function YN(u,{blockHash:e,blockNumber:t,blockTag:n="latest"}={}){const r=t!==void 0?zu(t):void 0;let i;return e?i=await u.request({method:"eth_getBlockTransactionCountByHash",params:[e]}):i=await u.request({method:"eth_getBlockTransactionCountByNumber",params:[r||n]}),u0(i)}async function XN(u,{address:e,blockNumber:t,blockTag:n="latest"}){const r=t!==void 0?zu(t):void 0,i=await u.request({method:"eth_getCode",params:[e,r||n]});if(i!=="0x")return i}function ZN(u){var e;return{baseFeePerGas:u.baseFeePerGas.map(t=>BigInt(t)),gasUsedRatio:u.gasUsedRatio,oldestBlock:BigInt(u.oldestBlock),reward:(e=u.reward)==null?void 0:e.map(t=>t.map(n=>BigInt(n)))}}async function uR(u,{blockCount:e,blockNumber:t,blockTag:n="latest",rewardPercentiles:r}){const i=t?zu(t):void 0,a=await u.request({method:"eth_feeHistory",params:[zu(e),i||n,r]});return ZN(a)}async function eR(u,{filter:e}){const t=e.strict??!1;return(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(r=>{var i;try{const{eventName:a,args:o}="abi"in e&&e.abi?xl({abi:e.abi,data:r.data,topics:r.topics,strict:t}):{eventName:void 0,args:void 0};return jt(r,{args:o,eventName:a})}catch(a){let o,s;if(a instanceof oa||a instanceof js){if("strict"in e&&e.strict)return;o=a.abiItem.name,s=(i=a.abiItem.inputs)==null?void 0:i.some(l=>!("name"in l&&l.name))}return jt(r,{args:s?[]:{},eventName:o})}}).filter(Boolean)}const tR=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,nR=/^(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)?$/;function rR({domain:u,message:e,primaryType:t,types:n}){const r=typeof u>"u"?{}:u,i={EIP712Domain:zF({domain:r}),...n};jF({domain:r,message:e,primaryType:t,types:i});const a=["0x1901"];return r&&a.push(iR({domain:r,types:i})),t!=="EIP712Domain"&&a.push(IF({data:e,primaryType:t,types:i})),s0(Vn(a))}function iR({domain:u,types:e}){return IF({data:u,primaryType:"EIP712Domain",types:e})}function IF({data:u,primaryType:e,types:t}){const n=OF({data:u,primaryType:e,types:t});return s0(n)}function OF({data:u,primaryType:e,types:t}){const n=[{type:"bytes32"}],r=[aR({primaryType:e,types:t})];for(const i of t[e]){const[a,o]=RF({types:t,name:i.name,type:i.type,value:u[i.name]});n.push(a),r.push(o)}return vl(n,r)}function aR({primaryType:u,types:e}){const t=er(oR({primaryType:u,types:e}));return s0(t)}function oR({primaryType:u,types:e}){let t="";const n=NF({primaryType:u,types:e});n.delete(u);const r=[u,...Array.from(n).sort()];for(const i of r)t+=`${i}(${e[i].map(({name:a,type:o})=>`${o} ${a}`).join(",")})`;return t}function NF({primaryType:u,types:e},t=new Set){const n=u.match(/^\w*/u),r=n==null?void 0:n[0];if(t.has(r)||e[r]===void 0)return t;t.add(r);for(const i of e[r])NF({primaryType:i.type,types:e},t);return t}function RF({types:u,name:e,type:t,value:n}){if(u[t]!==void 0)return[{type:"bytes32"},s0(OF({data:n,primaryType:t,types:u}))];if(t==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},s0(n)];if(t==="string")return[{type:"bytes32"},s0(er(n))];if(t.lastIndexOf("]")===t.length-1){const r=t.slice(0,t.lastIndexOf("[")),i=n.map(a=>RF({name:e,type:r,types:u,value:a}));return[{type:"bytes32"},s0(vl(i.map(([a])=>a),i.map(([,a])=>a)))]}return[{type:t},n]}function jF({domain:u,message:e,primaryType:t,types:n}){const r=n,i=(a,o)=>{for(const s of a){const{name:l,type:c}=s,E=c,d=o[l],f=E.match(nR);if(f&&(typeof d=="number"||typeof d=="bigint")){const[B,g,C]=f;zu(d,{signed:g==="int",size:parseInt(C)/8})}if(E==="address"&&typeof d=="string"&&!fs(d))throw new B3({address:d});const m=E.match(tR);if(m){const[B,g]=m;if(g&&Se(d)!==parseInt(g))throw new UI({expectedSize:parseInt(g),givenSize:Se(d)})}const h=r[E];h&&i(h,d)}};if(r.EIP712Domain&&u&&i(r.EIP712Domain,u),t!=="EIP712Domain"){const a=r[t];i(a,e)}}function zF({domain:u}){return[typeof(u==null?void 0:u.name)=="string"&&{name:"name",type:"string"},(u==null?void 0:u.version)&&{name:"version",type:"string"},typeof(u==null?void 0:u.chainId)=="number"&&{name:"chainId",type:"uint256"},(u==null?void 0:u.verifyingContract)&&{name:"verifyingContract",type:"address"},(u==null?void 0:u.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const V9="/docs/contract/encodeDeployData";function MF({abi:u,args:e,bytecode:t}){if(!e||e.length===0)return t;const n=u.find(i=>"type"in i&&i.type==="constructor");if(!n)throw new II({docsPath:V9});if(!("inputs"in n))throw new i8({docsPath:V9});if(!n.inputs||n.inputs.length===0)throw new i8({docsPath:V9});const r=vl(n.inputs,e);return Sh([t,r])}function sR(u,e){const t=(()=>typeof u=="string"?$n(u):u.raw instanceof Uint8Array?u.raw:Kr(u.raw))(),n=$n(`Ethereum Signed Message: +`),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class VO extends gu{constructor(e,{account:t,docsPath:n,chain:r,data:i,gas:a,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:l,nonce:c,to:E,value:d}){const f=bl({from:t==null?void 0:t.address,to:E,value:typeof d<"u"&&`${Uh(d)} ${(r==null?void 0:r.nativeCurrency.symbol)||"ETH"}`,data:i,gas:a,gasPrice:typeof o<"u"&&`${k0(o)} gwei`,maxFeePerGas:typeof s<"u"&&`${k0(s)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${k0(l)} gwei`,nonce:c});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",f].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}function qh(u,e){const t=(u.details||"").toLowerCase(),n=u.walk(r=>r.code===Za.code);return n instanceof gu?new Za({cause:u,message:n.details}):Za.nodeMessage.test(t)?new Za({cause:u,message:u.details}):UE.nodeMessage.test(t)?new UE({cause:u,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):W6.nodeMessage.test(t)?new W6({cause:u,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):q6.nodeMessage.test(t)?new q6({cause:u,nonce:e==null?void 0:e.nonce}):H6.nodeMessage.test(t)?new H6({cause:u,nonce:e==null?void 0:e.nonce}):G6.nodeMessage.test(t)?new G6({cause:u,nonce:e==null?void 0:e.nonce}):K6.nodeMessage.test(t)?new K6({cause:u}):Q6.nodeMessage.test(t)?new Q6({cause:u,gas:e==null?void 0:e.gas}):V6.nodeMessage.test(t)?new V6({cause:u,gas:e==null?void 0:e.gas}):J6.nodeMessage.test(t)?new J6({cause:u}):LE.nodeMessage.test(t)?new LE({cause:u,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Y2({cause:u})}function JO(u,{docsPath:e,...t}){const n=(()=>{const r=qh(u,t);return r instanceof Y2?u:r})();return new VO(n,{docsPath:e,...t})}function Hh(u,{format:e}){return e?Object.keys(e({})).reduce((n,r)=>(u!=null&&u.hasOwnProperty(r)&&(n[r]=u[r]),n),{}):{}}function wl(u){const{account:e,gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:i}=u,a=e?Ct(e):void 0;if(a&&!fs(a.address))throw new B3({address:a.address});if(i&&!fs(i))throw new B3({address:i});if(typeof t<"u"&&(typeof n<"u"||typeof r<"u"))throw new UO;if(n&&n>2n**256n-1n)throw new UE({maxFeePerGas:n});if(r&&n&&r>n)throw new LE({maxFeePerGas:n,maxPriorityFeePerGas:r})}class YO extends gu{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class Gh extends gu{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class XO extends gu{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${k0(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class ZO extends gu{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function Vr(u,{blockHash:e,blockNumber:t,blockTag:n,includeTransactions:r}={}){var c,E,d;const i=n??"latest",a=r??!1,o=t!==void 0?zu(t):void 0;let s=null;if(e?s=await u.request({method:"eth_getBlockByHash",params:[e,a]}):s=await u.request({method:"eth_getBlockByNumber",params:[o||i,a]}),!s)throw new ZO({blockHash:e,blockNumber:t});return(((d=(E=(c=u.chain)==null?void 0:c.formatters)==null?void 0:E.block)==null?void 0:d.format)||_h)(s)}async function Kh(u){const e=await u.request({method:"eth_gasPrice"});return BigInt(e)}async function uN(u,e){return mF(u,e)}async function mF(u,e){var i,a,o;const{block:t,chain:n=u.chain,request:r}=e||{};if(typeof((i=n==null?void 0:n.fees)==null?void 0:i.defaultPriorityFee)=="function"){const s=t||await Vr(u);return n.fees.defaultPriorityFee({block:s,client:u,request:r})}else if(typeof((a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee)<"u")return(o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee;try{const s=await u.request({method:"eth_maxPriorityFeePerGas"});return In(s)}catch{const[s,l]=await Promise.all([t?Promise.resolve(t):Vr(u),Kh(u)]);if(typeof s.baseFeePerGas!="bigint")throw new Gh;const c=l-s.baseFeePerGas;return c<0n?0n:c}}async function eN(u,e){return uf(u,e)}async function uf(u,e){var d,f;const{block:t,chain:n=u.chain,request:r,type:i="eip1559"}=e||{},a=await(async()=>{var m,h;return typeof((m=n==null?void 0:n.fees)==null?void 0:m.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:t,client:u,request:r}):((h=n==null?void 0:n.fees)==null?void 0:h.baseFeeMultiplier)??1.2})();if(a<1)throw new YO;const s=10**(((d=a.toString().split(".")[1])==null?void 0:d.length)??0),l=m=>m*BigInt(Math.ceil(a*s))/BigInt(s),c=t||await Vr(u);if(typeof((f=n==null?void 0:n.fees)==null?void 0:f.estimateFeesPerGas)=="function")return n.fees.estimateFeesPerGas({block:t,client:u,multiply:l,request:r,type:i});if(i==="eip1559"){if(typeof c.baseFeePerGas!="bigint")throw new Gh;const m=r!=null&&r.maxPriorityFeePerGas?r.maxPriorityFeePerGas:await mF(u,{block:c,chain:n,request:r}),h=l(c.baseFeePerGas);return{maxFeePerGas:(r==null?void 0:r.maxFeePerGas)??h+m,maxPriorityFeePerGas:m}}return{gasPrice:(r==null?void 0:r.gasPrice)??l(await Kh(u))}}async function gF(u,{address:e,blockTag:t="latest",blockNumber:n}){const r=await u.request({method:"eth_getTransactionCount",params:[e,n?zu(n):t]});return u0(r)}function tN(u){if(u.type)return u.type;if(typeof u.maxFeePerGas<"u"||typeof u.maxPriorityFeePerGas<"u")return"eip1559";if(typeof u.gasPrice<"u")return typeof u.accessList<"u"?"eip2930":"legacy";throw new LO({transaction:u})}async function rd(u,e){const{account:t=u.account,chain:n,gas:r,nonce:i,type:a}=e;if(!t)throw new Ms;const o=Ct(t),s=await Vr(u,{blockTag:"latest"}),l={...e,from:o.address};if(typeof i>"u"&&(l.nonce=await gF(u,{address:o.address,blockTag:"pending"})),typeof a>"u")try{l.type=tN(l)}catch{l.type=typeof s.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(l.type==="eip1559"){const{maxFeePerGas:c,maxPriorityFeePerGas:E}=await uf(u,{block:s,chain:n,request:l});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(l.gas=await Qh(u,{...l,account:{address:o.address,type:"json-rpc"}})),wl(l),l}async function Qh(u,e){var r,i,a;const t=e.account??u.account;if(!t)throw new Ms({docsPath:"/docs/actions/public/estimateGas"});const n=Ct(t);try{const{accessList:o,blockNumber:s,blockTag:l,data:c,gas:E,gasPrice:d,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:h,to:B,value:g,...C}=n.type==="local"?await rd(u,e):e,v=(s?zu(s):void 0)||l;wl(e);const w=((a=(i=(r=u.chain)==null?void 0:r.formatters)==null?void 0:i.transactionRequest)==null?void 0:a.format)||J2,D=w({...Hh(C,{format:w}),from:n.address,accessList:o,data:c,gas:E,gasPrice:d,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:h,to:B,value:g}),p=await u.request({method:"eth_estimateGas",params:v?[D,v]:[D]});return BigInt(p)}catch(o){throw JO(o,{...e,account:n,chain:u.chain})}}async function nN(u,{abi:e,address:t,args:n,functionName:r,...i}){const a=ri({abi:e,args:n,functionName:r});try{return await Qh(u,{data:a,to:t,...i})}catch(o){const s=i.account?Ct(i.account):void 0;throw N3(o,{abi:e,address:t,args:n,docsPath:"/docs/contract/estimateContractGas",functionName:r,sender:s==null?void 0:s.address})}}const E8="/docs/contract/decodeEventLog";function xl({abi:u,data:e,strict:t,topics:n}){const r=t??!0,[i,...a]=n;if(!i)throw new jI({docsPath:E8});const o=u.find(m=>m.type==="event"&&i===Nh(ni(m)));if(!(o&&"name"in o)||o.type!=="event")throw new zI(i,{docsPath:E8});const{name:s,inputs:l}=o,c=l==null?void 0:l.some(m=>!("name"in m&&m.name));let E=c?[]:{};const d=l.filter(m=>"indexed"in m&&m.indexed);for(let m=0;m!("indexed"in m&&m.indexed));if(f.length>0){if(e&&e!=="0x")try{const m=nd(f,e);if(m)if(c)E=[...E,...m];else for(let h=0;h0?E:void 0}}function rN({param:u,value:e}){return u.type==="string"||u.type==="bytes"||u.type==="tuple"||u.type.match(/^(.*)\[(\d+)?\]$/)?e:(nd([u],e)||[])[0]}async function Vh(u,{address:e,blockHash:t,fromBlock:n,toBlock:r,event:i,events:a,args:o,strict:s}={}){const l=s??!1,c=a??(i?[i]:void 0);let E=[];c&&(E=[c.flatMap(f=>Dl({abi:[f],eventName:f.name,args:o}))],i&&(E=E[0]));let d;return t?d=await u.request({method:"eth_getLogs",params:[{address:e,topics:E,blockHash:t}]}):d=await u.request({method:"eth_getLogs",params:[{address:e,topics:E,fromBlock:typeof n=="bigint"?zu(n):n,toBlock:typeof r=="bigint"?zu(r):r}]}),d.map(f=>{var m;try{const{eventName:h,args:B}=c?xl({abi:c,data:f.data,topics:f.topics,strict:l}):{eventName:void 0,args:void 0};return jt(f,{args:B,eventName:h})}catch(h){let B,g;if(h instanceof oa||h instanceof js){if(l)return;B=h.abiItem.name,g=(m=h.abiItem.inputs)==null?void 0:m.some(C=>!("name"in C&&C.name))}return jt(f,{args:g?[]:{},eventName:B})}}).filter(Boolean)}async function AF(u,{abi:e,address:t,args:n,blockHash:r,eventName:i,fromBlock:a,toBlock:o,strict:s}){const l=i?Fl({abi:e,name:i}):void 0,c=l?void 0:e.filter(E=>E.type==="event");return Vh(u,{address:t,args:n,blockHash:r,event:l,events:c,fromBlock:a,toBlock:o,strict:s})}const q9="/docs/contract/decodeFunctionResult";function Us({abi:u,args:e,functionName:t,data:n}){let r=u[0];if(t&&(r=Fl({abi:u,args:e,name:t}),!r))throw new $E(t,{docsPath:q9});if(r.type!=="function")throw new $E(void 0,{docsPath:q9});if(!r.outputs)throw new MI(r.name,{docsPath:q9});const i=nd(r.outputs,n);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}const ef=[{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"}],yF=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"}],BF=[...yF,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],iN=[...yF,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],d8=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],f8=[{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"}]}],aN=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],oN="0x82ad56cb";function sN(u,{docsPath:e,...t}){const n=(()=>{const r=qh(u,t);return r instanceof Y2?u:r})();return new CF(n,{docsPath:e,...t})}const H9=new Map;function Jh({fn:u,id:e,shouldSplitBatch:t,wait:n=0}){const r=async()=>{const l=o();i();const c=l.map(({args:E})=>E);c.length!==0&&u(c).then(E=>{l.forEach(({pendingPromise:d},f)=>{var m;return(m=d.resolve)==null?void 0:m.call(d,[E[f],E])})}).catch(E=>{l.forEach(({pendingPromise:d})=>{var f;return(f=d.reject)==null?void 0:f.call(d,E)})})},i=()=>H9.delete(e),a=()=>o().map(({args:l})=>l),o=()=>H9.get(e)||[],s=l=>H9.set(e,[...o(),l]);return{flush:i,async schedule(l){const c={},E=new Promise((m,h)=>{c.resolve=m,c.reject=h});return(t==null?void 0:t([...a(),l]))&&r(),o().length>0?(s({args:l,pendingPromise:c}),E):(s({args:l,pendingPromise:c}),setTimeout(r,n),E)}}}async function id(u,e){var g,C,y,v;const{account:t=u.account,batch:n=!!((g=u.batch)!=null&&g.multicall),blockNumber:r,blockTag:i="latest",accessList:a,data:o,gas:s,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:E,nonce:d,to:f,value:m,...h}=e,B=t?Ct(t):void 0;try{wl(e);const D=(r?zu(r):void 0)||i,p=((v=(y=(C=u.chain)==null?void 0:C.formatters)==null?void 0:y.transactionRequest)==null?void 0:v.format)||J2,x=p({...Hh(h,{format:p}),from:B==null?void 0:B.address,accessList:a,data:o,gas:s,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:E,nonce:d,to:f,value:m});if(n&&lN({request:x}))try{return await cN(u,{...x,blockNumber:r,blockTag:i})}catch(O){if(!(O instanceof Gv)&&!(O instanceof $6))throw O}const j=await u.request({method:"eth_call",params:D?[x,D]:[x]});return j==="0x"?{data:void 0}:{data:j}}catch(w){const D=EN(w),{offchainLookup:p,offchainLookupSignature:x}=await Hu(()=>import("./ccip-e9747f23.js"),[]);if((D==null?void 0:D.slice(0,10))===x&&f)return{data:await p(u,{data:D,to:f})};throw sN(w,{...e,account:B,chain:u.chain})}}function lN({request:u}){const{data:e,to:t,...n}=u;return!(!e||e.startsWith(oN)||!t||Object.values(n).filter(r=>typeof r<"u").length>0)}async function cN(u,e){var h;const{batchSize:t=1024,wait:n=0}=typeof((h=u.batch)==null?void 0:h.multicall)=="object"?u.batch.multicall:{},{blockNumber:r,blockTag:i="latest",data:a,multicallAddress:o,to:s}=e;let l=o;if(!l){if(!u.chain)throw new Gv;l=Ns({blockNumber:r,chain:u.chain,contract:"multicall3"})}const E=(r?zu(r):void 0)||i,{schedule:d}=Jh({id:`${u.uid}.${E}`,wait:n,shouldSplitBatch(B){return B.reduce((C,{data:y})=>C+(y.length-2),0)>t*2},fn:async B=>{const g=B.map(v=>({allowFailure:!0,callData:v.data,target:v.to})),C=ri({abi:ef,args:[g],functionName:"aggregate3"}),y=await u.request({method:"eth_call",params:[{data:C,to:l},E]});return Us({abi:ef,args:[g],functionName:"aggregate3",data:y||"0x"})}}),[{returnData:f,success:m}]=await d({data:a,to:s});if(!m)throw new $h({data:f});return f==="0x"?{data:void 0}:{data:f}}function EN(u){if(!(u instanceof gu))return;const e=u.walk();return typeof e.data=="object"?e.data.data:e.data}async function Jr(u,{abi:e,address:t,args:n,functionName:r,...i}){const a=ri({abi:e,args:n,functionName:r});try{const{data:o}=await id(u,{data:a,to:t,...i});return Us({abi:e,args:n,functionName:r,data:o||"0x"})}catch(o){throw N3(o,{abi:e,address:t,args:n,docsPath:"/docs/contract/readContract",functionName:r})}}async function dN(u,{abi:e,address:t,args:n,dataSuffix:r,functionName:i,...a}){const o=a.account?Ct(a.account):void 0,s=ri({abi:e,args:n,functionName:i});try{const{data:l}=await id(u,{batch:!1,data:`${s}${r?r.replace("0x",""):""}`,to:t,...a});return{result:Us({abi:e,args:n,functionName:i,data:l||"0x"}),request:{abi:e,address:t,args:n,dataSuffix:r,functionName:i,...a}}}catch(l){throw N3(l,{abi:e,address:t,args:n,docsPath:"/docs/contract/simulateContract",functionName:i,sender:o==null?void 0:o.address})}}const G9=new Map,p8=new Map;let fN=0;function Ls(u,e,t){const n=++fN,r=()=>G9.get(u)||[],i=()=>{const c=r();G9.set(u,c.filter(E=>E.id!==n))},a=()=>{const c=p8.get(u);r().length===1&&c&&c(),i()},o=r();if(G9.set(u,[...o,{id:n,fns:e}]),o&&o.length>0)return a;const s={};for(const c in e)s[c]=(...E)=>{const d=r();d.length!==0&&d.forEach(f=>{var m,h;return(h=(m=f.fns)[c])==null?void 0:h.call(m,...E)})};const l=t(s);return typeof l=="function"&&p8.set(u,l),a}async function HE(u){return new Promise(e=>setTimeout(e,u))}function kl(u,{emitOnBegin:e,initialWaitTime:t,interval:n}){let r=!0;const i=()=>r=!1;return(async()=>{let o;e&&(o=await u({unpoll:i}));const s=await(t==null?void 0:t(o))??n;await HE(s);const l=async()=>{r&&(await u({unpoll:i}),await HE(n),l())};l()})(),i}const pN=new Map,hN=new Map;function CN(u){const e=(r,i)=>({clear:()=>i.delete(r),get:()=>i.get(r),set:a=>i.set(r,a)}),t=e(u,pN),n=e(u,hN);return{clear:()=>{t.clear(),n.clear()},promise:t,response:n}}async function mN(u,{cacheKey:e,cacheTime:t=1/0}){const n=CN(e),r=n.response.get();if(r&&t>0&&new Date().getTime()-r.created.getTime()`blockNumber.${u}`;async function _l(u,{cacheTime:e=u.cacheTime,maxAge:t}={}){const n=await mN(()=>u.request({method:"eth_blockNumber"}),{cacheKey:gN(u.uid),cacheTime:t??e});return BigInt(n)}async function ad(u,{filter:e}){const t="strict"in e&&e.strict;return(await e.request({method:"eth_getFilterChanges",params:[e.id]})).map(r=>{var i;if(typeof r=="string")return r;try{const{eventName:a,args:o}="abi"in e&&e.abi?xl({abi:e.abi,data:r.data,topics:r.topics,strict:t}):{eventName:void 0,args:void 0};return jt(r,{args:o,eventName:a})}catch(a){let o,s;if(a instanceof oa||a instanceof js){if("strict"in e&&e.strict)return;o=a.abiItem.name,s=(i=a.abiItem.inputs)==null?void 0:i.some(l=>!("name"in l&&l.name))}return jt(r,{args:s?[]:{},eventName:o})}}).filter(Boolean)}async function od(u,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function AN(u,{abi:e,address:t,args:n,batch:r=!0,eventName:i,onError:a,onLogs:o,poll:s,pollingInterval:l=u.pollingInterval,strict:c}){return(typeof s<"u"?s:u.transport.type!=="webSocket")?(()=>{const m=f0(["watchContractEvent",t,n,r,u.uid,i,l]),h=c??!1;return Ls(m,{onLogs:o,onError:a},B=>{let g,C,y=!1;const v=kl(async()=>{var w;if(!y){try{C=await EF(u,{abi:e,address:t,args:n,eventName:i,strict:h})}catch{}y=!0;return}try{let D;if(C)D=await ad(u,{filter:C});else{const p=await _l(u);g&&g!==p?D=await AF(u,{abi:e,address:t,args:n,fromBlock:g+1n,toBlock:p,strict:h}):D=[],g=p}if(D.length===0)return;r?B.onLogs(D):D.forEach(p=>B.onLogs([p]))}catch(D){C&&D instanceof sa&&(y=!1),(w=B.onError)==null||w.call(B,D)}},{emitOnBegin:!0,interval:l});return async()=>{C&&await od(u,{filter:C}),v()}})})():(()=>{let m=!0,h=()=>m=!1;return(async()=>{try{const B=i?Dl({abi:e,eventName:i,args:n}):[],{unsubscribe:g}=await u.transport.subscribe({params:["logs",{address:t,topics:B}],onData(C){var v;if(!m)return;const y=C.result;try{const{eventName:w,args:D}=xl({abi:e,data:y.data,topics:y.topics,strict:c}),p=jt(y,{args:D,eventName:w});o([p])}catch(w){let D,p;if(w instanceof oa||w instanceof js){if(c)return;D=w.abiItem.name,p=(v=w.abiItem.inputs)==null?void 0:v.some(j=>!("name"in j&&j.name))}const x=jt(y,{args:p?[]:{},eventName:D});o([x])}},onError(C){a==null||a(C)}});h=g,m||h()}catch(B){a==null||a(B)}})(),h})()}function yN(u,{docsPath:e,...t}){const n=(()=>{const r=qh(u,t);return r instanceof Y2?u:r})();return new $O(n,{docsPath:e,...t})}async function R3(u){const e=await u.request({method:"eth_chainId"});return u0(e)}async function Yh(u,{serializedTransaction:e}){return u.request({method:"eth_sendRawTransaction",params:[e]})}async function Xh(u,e){var h,B,g;const{account:t=u.account,chain:n=u.chain,accessList:r,data:i,gas:a,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:l,nonce:c,to:E,value:d,...f}=e;if(!t)throw new Ms({docsPath:"/docs/actions/wallet/sendTransaction"});const m=Ct(t);try{wl(e);let C;if(n!==null&&(C=await R3(u),Kv({currentChainId:C,chain:n})),m.type==="local"){const w=await rd(u,{account:m,accessList:r,chain:n,data:i,gas:a,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:l,nonce:c,to:E,value:d,...f});C||(C=await R3(u));const D=(h=n==null?void 0:n.serializers)==null?void 0:h.transaction,p=await m.signTransaction({...w,chainId:C},{serializer:D});return await Yh(u,{serializedTransaction:p})}const y=((g=(B=n==null?void 0:n.formatters)==null?void 0:B.transactionRequest)==null?void 0:g.format)||J2,v=y({...Hh(f,{format:y}),accessList:r,data:i,from:m.address,gas:a,gasPrice:o,maxFeePerGas:s,maxPriorityFeePerGas:l,nonce:c,to:E,value:d});return await u.request({method:"eth_sendTransaction",params:[v]})}catch(C){throw yN(C,{...e,account:m,chain:e.chain||void 0})}}async function BN(u,{abi:e,address:t,args:n,dataSuffix:r,functionName:i,...a}){const o=ri({abi:e,args:n,functionName:i});return await Xh(u,{data:`${o}${r?r.replace("0x",""):""}`,to:t,...a})}async function vN(u,{chain:e}){const{id:t,name:n,nativeCurrency:r,rpcUrls:i,blockExplorers:a}=e;await u.request({method:"wallet_addEthereumChain",params:[{chainId:zu(t),chainName:n,nativeCurrency:r,rpcUrls:i.default.http,blockExplorerUrls:a?Object.values(a).map(({url:o})=>o):void 0}]})}const tf=256;let gc=tf,Ac;function FN(u=11){if(!Ac||gc+u>tf*2){Ac="",gc=0;for(let e=0;e{const g=B(h);for(const y in f)delete g[y];const C={...h,...g};return Object.assign(C,{extend:m(C)})}}return Object.assign(f,{extend:m(f)})}function FF(u,{delay:e=100,retryCount:t=2,shouldRetry:n=()=>!0}={}){return new Promise((r,i)=>{const a=async({count:o=0}={})=>{const s=async({error:l})=>{const c=typeof e=="function"?e({count:o,error:l}):e;c&&await HE(c),a({count:o+1})};try{const l=await u();r(l)}catch(l){if(o"code"in u?u.code!==-1&&u.code!==-32004&&u.code!==-32005&&u.code!==-32042&&u.code!==-32603:u instanceof V4&&u.status?u.status!==403&&u.status!==408&&u.status!==413&&u.status!==429&&u.status!==500&&u.status!==502&&u.status!==503&&u.status!==504:!1;function DN(u,{retryDelay:e=150,retryCount:t=3}={}){return async n=>FF(async()=>{try{return await u(n)}catch(r){const i=r;switch(i.code){case v3.code:throw new v3(i);case F3.code:throw new F3(i);case D3.code:throw new D3(i);case b3.code:throw new b3(i);case hs.code:throw new hs(i);case sa.code:throw new sa(i);case w3.code:throw new w3(i);case Qr.code:throw new Qr(i);case x3.code:throw new x3(i);case k3.code:throw new k3(i);case _3.code:throw new _3(i);case S3.code:throw new S3(i);case _e.code:throw new _e(i);case P3.code:throw new P3(i);case T3.code:throw new T3(i);case I3.code:throw new I3(i);case O3.code:throw new O3(i);case En.code:throw new En(i);case 5e3:throw new _e(i);default:throw r instanceof gu?r:new KO(i)}}},{delay:({count:r,error:i})=>{var a;if(i&&i instanceof V4){const o=(a=i==null?void 0:i.headers)==null?void 0:a.get("Retry-After");if(o!=null&&o.match(/\d/))return parseInt(o)*1e3}return~~(1<!DF(r)})}function sd({key:u,name:e,request:t,retryCount:n=3,retryDelay:r=150,timeout:i,type:a},o){return{config:{key:u,name:e,request:t,retryCount:n,retryDelay:r,timeout:i,type:a},request:DN(t,{retryCount:n,retryDelay:r}),value:o}}function Sl(u,e={}){const{key:t="custom",name:n="Custom Provider",retryDelay:r}=e;return({retryCount:i})=>sd({key:t,name:n,request:u.request.bind(u),retryCount:e.retryCount??i,retryDelay:r,type:"custom"})}function h8(u,e={}){const{key:t="fallback",name:n="Fallback",rank:r=!1,retryCount:i,retryDelay:a}=e;return({chain:o,pollingInterval:s=4e3,timeout:l})=>{let c=u,E=()=>{};const d=sd({key:t,name:n,async request({method:f,params:m}){const h=async(B=0)=>{const g=c[B]({chain:o,retryCount:0,timeout:l});try{const C=await g.request({method:f,params:m});return E({method:f,params:m,response:C,transport:g,status:"success"}),C}catch(C){if(E({error:C,method:f,params:m,transport:g,status:"error"}),DF(C)||B===c.length-1)throw C;return h(B+1)}};return h()},retryCount:i,retryDelay:a,type:"fallback"},{onResponse:f=>E=f,transports:c.map(f=>f({chain:o,retryCount:0}))});if(r){const f=typeof r=="object"?r:{};bN({chain:o,interval:f.interval??s,onTransports:m=>c=m,sampleCount:f.sampleCount,timeout:f.timeout,transports:c,weights:f.weights})}return d}}function bN({chain:u,interval:e=4e3,onTransports:t,sampleCount:n=10,timeout:r=1e3,transports:i,weights:a={}}){const{stability:o=.7,latency:s=.3}=a,l=[],c=async()=>{const E=await Promise.all(i.map(async m=>{const h=m({chain:u,retryCount:0,timeout:r}),B=Date.now();let g,C;try{await h.request({method:"net_listening"}),C=1}catch{C=0}finally{g=Date.now()}return{latency:g-B,success:C}}));l.push(E),l.length>n&&l.shift();const d=Math.max(...l.map(m=>Math.max(...m.map(({latency:h})=>h)))),f=i.map((m,h)=>{const B=l.map(w=>w[h].latency),C=1-B.reduce((w,D)=>w+D,0)/B.length/d,y=l.map(w=>w[h].success),v=y.reduce((w,D)=>w+D,0)/y.length;return v===0?[0,h]:[s*C+o*v,h]}).sort((m,h)=>h[0]-m[0]);t(f.map(([,m])=>i[m])),await HE(e),c()};c()}class bF extends gu{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function wN(){if(typeof WebSocket<"u")return WebSocket;if(typeof globalThis.WebSocket<"u")return globalThis.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const C8=wN();function wF(u,{errorInstance:e=new Error("timed out"),timeout:t,signal:n}){return new Promise((r,i)=>{(async()=>{let a;try{const o=new AbortController;t>0&&(a=setTimeout(()=>{n?o.abort():i(e)},t)),r(await u({signal:o==null?void 0:o.signal}))}catch(o){o.name==="AbortError"&&i(e),i(o)}finally{clearTimeout(a)}})()})}let nf=0;async function xN(u,{body:e,fetchOptions:t={},timeout:n=1e4}){var o;const{headers:r,method:i,signal:a}=t;try{const s=await wF(async({signal:c})=>await fetch(u,{...t,body:Array.isArray(e)?f0(e.map(d=>({jsonrpc:"2.0",id:d.id??nf++,...d}))):f0({jsonrpc:"2.0",id:e.id??nf++,...e}),headers:{...r,"Content-Type":"application/json"},method:i||"POST",signal:a||(n>0?c:void 0)}),{errorInstance:new Z6({body:e,url:u}),timeout:n,signal:!0});let l;if((o=s.headers.get("Content-Type"))!=null&&o.startsWith("application/json")?l=await s.json():l=await s.text(),!s.ok)throw new V4({body:e,details:f0(l.error)||s.statusText,headers:s.headers,status:s.status,url:u});return l}catch(s){throw s instanceof V4||s instanceof Z6?s:new V4({body:e,details:s.message,url:u})}}const K9=new Map;async function Q9(u){let e=K9.get(u);if(e)return e;const{schedule:t}=Jh({id:u,fn:async()=>{const i=new C8(u),a=new Map,o=new Map,s=({data:c})=>{const E=JSON.parse(c),d=E.method==="eth_subscription",f=d?E.params.subscription:E.id,m=d?o:a,h=m.get(f);h&&h({data:c}),d||m.delete(f)},l=()=>{K9.delete(u),i.removeEventListener("close",l),i.removeEventListener("message",s)};return i.addEventListener("close",l),i.addEventListener("message",s),i.readyState===C8.CONNECTING&&await new Promise((c,E)=>{i&&(i.onopen=c,i.onerror=E)}),e=Object.assign(i,{requests:a,subscriptions:o}),K9.set(u,e),[e]}}),[n,[r]]=await t();return r}function kN(u,{body:e,onResponse:t}){if(u.readyState===u.CLOSED||u.readyState===u.CLOSING)throw new HO({body:e,url:u.url,details:"Socket is closed."});const n=nf++,r=({data:i})=>{var o;const a=JSON.parse(i);typeof a.id=="number"&&n!==a.id||(t==null||t(a),e.method==="eth_subscribe"&&typeof a.result=="string"&&u.subscriptions.set(a.result,r),e.method==="eth_unsubscribe"&&u.subscriptions.delete((o=e.params)==null?void 0:o[0]))};return u.requests.set(n,r),u.send(JSON.stringify({jsonrpc:"2.0",...e,id:n})),u}async function _N(u,{body:e,timeout:t=1e4}){return wF(()=>new Promise(n=>Co.webSocket(u,{body:e,onResponse:n})),{errorInstance:new Z6({body:e,url:u.url}),timeout:t})}const Co={http:xN,webSocket:kN,webSocketAsync:_N};function SN(u,e={}){const{batch:t,fetchOptions:n,key:r="http",name:i="HTTP JSON-RPC",retryDelay:a}=e;return({chain:o,retryCount:s,timeout:l})=>{const{batchSize:c=1e3,wait:E=0}=typeof t=="object"?t:{},d=e.retryCount??s,f=l??e.timeout??1e4,m=u||(o==null?void 0:o.rpcUrls.default.http[0]);if(!m)throw new bF;return sd({key:r,name:i,async request({method:h,params:B}){const g={method:h,params:B},{schedule:C}=Jh({id:`${u}`,wait:E,shouldSplitBatch(D){return D.length>c},fn:D=>Co.http(m,{body:D,fetchOptions:n,timeout:f})}),y=async D=>t?C(D):[await Co.http(m,{body:D,fetchOptions:n,timeout:f})],[{error:v,result:w}]=await y(g);if(v)throw new Wh({body:g,error:v,url:m});return w},retryCount:d,retryDelay:a,timeout:f,type:"http"},{fetchOptions:n,url:u})}}function Zh(u,e){var n,r,i;if(!(u instanceof gu))return!1;const t=u.walk(a=>a instanceof X6);return t instanceof X6?!!(((n=t.data)==null?void 0:n.errorName)==="ResolverNotFound"||((r=t.data)==null?void 0:r.errorName)==="ResolverWildcardNotSupported"||(i=t.reason)!=null&&i.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&t.reason===dF[50]):!1}function xF(u){if(u.length!==66||u.indexOf("[")!==0||u.indexOf("]")!==65)return null;const e=`0x${u.slice(1,65)}`;return cn(e)?e:null}function Vc(u){let e=new Uint8Array(32).fill(0);if(!u)return y3(e);const t=u.split(".");for(let n=t.length-1;n>=0;n-=1){const r=xF(t[n]),i=r?Kr(r):s0($n(t[n]),"bytes");e=s0(Vn([e,i]),"bytes")}return y3(e)}function PN(u){return`[${u.slice(2)}]`}function TN(u){const e=new Uint8Array(32).fill(0);return u?xF(u)||s0($n(u)):y3(e)}function ld(u){const e=u.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const t=new Uint8Array($n(e).byteLength+2);let n=0;const r=e.split(".");for(let i=0;i255&&(a=$n(PN(TN(r[i])))),t[n]=a.length,t.set(a,n+1),n+=a.length+1}return t.byteLength!==n+1?t.slice(0,n+1):t}async function IN(u,{blockNumber:e,blockTag:t,coinType:n,name:r,universalResolverAddress:i}){let a=i;if(!a){if(!u.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Ns({blockNumber:e,chain:u.chain,contract:"ensUniversalResolver"})}try{const o=ri({abi:f8,functionName:"addr",...n!=null?{args:[Vc(r),BigInt(n)]}:{args:[Vc(r)]}}),s=await Jr(u,{address:a,abi:BF,functionName:"resolve",args:[er(ld(r)),o],blockNumber:e,blockTag:t});if(s[0]==="0x")return null;const l=Us({abi:f8,args:n!=null?[Vc(r),BigInt(n)]:void 0,functionName:"addr",data:s[0]});return l==="0x"||Ji(l)==="0x00"?null:l}catch(o){if(Zh(o,"resolve"))return null;throw o}}class ON extends gu{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)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class C4 extends gu{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class u5 extends gu{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.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class NN extends gu{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const RN=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,jN=/^(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,})(\/(?[\w\-.]+))?(?\/.*)?$/,zN=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,MN=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function UN(u){try{const e=await fetch(u,{method:"HEAD"});if(e.status===200){const t=e.headers.get("content-type");return t==null?void 0:t.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(t=>{const n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=u})}}function m8(u,e){return u?u.endsWith("/")?u.slice(0,-1):u:e}function kF({uri:u,gatewayUrls:e}){const t=zN.test(u);if(t)return{uri:u,isOnChain:!0,isEncoded:t};const n=m8(e==null?void 0:e.ipfs,"https://ipfs.io"),r=m8(e==null?void 0:e.arweave,"https://arweave.net"),i=u.match(RN),{protocol:a,subpath:o,target:s,subtarget:l=""}=(i==null?void 0:i.groups)||{},c=a==="ipns:/"||o==="ipns/",E=a==="ipfs:/"||o==="ipfs/"||jN.test(u);if(u.startsWith("http")&&!c&&!E){let f=u;return e!=null&&e.arweave&&(f=u.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:f,isOnChain:!1,isEncoded:!1}}if((c||E)&&s)return{uri:`${n}/${c?"ipns":"ipfs"}/${s}${l}`,isOnChain:!1,isEncoded:!1};if(a==="ar:/"&&s)return{uri:`${r}/${s}${l||""}`,isOnChain:!1,isEncoded:!1};let d=u.replace(MN,"");if(d.startsWith("r.json());return await e5({gatewayUrls:u,uri:_F(t)})}catch{throw new u5({uri:e})}}async function e5({gatewayUrls:u,uri:e}){const{uri:t,isOnChain:n}=kF({uri:e,gatewayUrls:u});if(n||await UN(t))return t;throw new u5({uri:e})}function $N(u){let e=u;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[t,n,r]=e.split("/"),[i,a]=t.split(":"),[o,s]=n.split(":");if(!i||i.toLowerCase()!=="eip155")throw new C4({reason:"Only EIP-155 supported"});if(!a)throw new C4({reason:"Chain ID not found"});if(!s)throw new C4({reason:"Contract address not found"});if(!r)throw new C4({reason:"Token ID not found"});if(!o)throw new C4({reason:"ERC namespace not found"});return{chainID:parseInt(a),namespace:o.toLowerCase(),contractAddress:s,tokenID:r}}async function WN(u,{nft:e}){if(e.namespace==="erc721")return Jr(u,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return Jr(u,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new NN({namespace:e.namespace})}async function qN(u,{gatewayUrls:e,record:t}){return/eip155:/i.test(t)?HN(u,{gatewayUrls:e,record:t}):e5({uri:t,gatewayUrls:e})}async function HN(u,{gatewayUrls:e,record:t}){const n=$N(t),r=await WN(u,{nft:n}),{uri:i,isOnChain:a,isEncoded:o}=kF({uri:r,gatewayUrls:e});if(a&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const l=o?atob(i.replace("data:application/json;base64,","")):i,c=JSON.parse(l);return e5({uri:_F(c),gatewayUrls:e})}let s=n.tokenID;return n.namespace==="erc1155"&&(s=s.replace("0x","").padStart(64,"0")),LN({gatewayUrls:e,uri:i.replace(/(?:0x)?{id}/,s)})}async function SF(u,{blockNumber:e,blockTag:t,name:n,key:r,universalResolverAddress:i}){let a=i;if(!a){if(!u.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Ns({blockNumber:e,chain:u.chain,contract:"ensUniversalResolver"})}try{const o=await Jr(u,{address:a,abi:BF,functionName:"resolve",args:[er(ld(n)),ri({abi:d8,functionName:"text",args:[Vc(n),r]})],blockNumber:e,blockTag:t});if(o[0]==="0x")return null;const s=Us({abi:d8,functionName:"text",data:o[0]});return s===""?null:s}catch(o){if(Zh(o,"resolve"))return null;throw o}}async function GN(u,{blockNumber:e,blockTag:t,gatewayUrls:n,name:r,universalResolverAddress:i}){const a=await SF(u,{blockNumber:e,blockTag:t,key:"avatar",name:r,universalResolverAddress:i});if(!a)return null;try{return await qN(u,{record:a,gatewayUrls:n})}catch{return null}}async function KN(u,{address:e,blockNumber:t,blockTag:n,universalResolverAddress:r}){let i=r;if(!i){if(!u.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Ns({blockNumber:t,chain:u.chain,contract:"ensUniversalResolver"})}const a=`${e.toLowerCase().substring(2)}.addr.reverse`;try{return(await Jr(u,{address:i,abi:iN,functionName:"reverse",args:[er(ld(a))],blockNumber:t,blockTag:n}))[0]}catch(o){if(Zh(o,"reverse"))return null;throw o}}async function QN(u,{blockNumber:e,blockTag:t,name:n,universalResolverAddress:r}){let i=r;if(!i){if(!u.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Ns({blockNumber:e,chain:u.chain,contract:"ensUniversalResolver"})}const[a]=await Jr(u,{address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[er(ld(n))],blockNumber:e,blockTag:t});return a}async function VN(u){const e=td(u,{method:"eth_newBlockFilter"}),t=await u.request({method:"eth_newBlockFilter"});return{id:t,request:e(t),type:"block"}}async function PF(u,{address:e,args:t,event:n,events:r,fromBlock:i,strict:a,toBlock:o}={}){const s=r??(n?[n]:void 0),l=td(u,{method:"eth_newFilter"});let c=[];s&&(c=[s.flatMap(d=>Dl({abi:[d],eventName:d.name,args:t}))],n&&(c=c[0]));const E=await u.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof i=="bigint"?zu(i):i,toBlock:typeof o=="bigint"?zu(o):o,...c.length?{topics:c}:{}}]});return{abi:s,args:t,eventName:n?n.name:void 0,fromBlock:i,id:E,request:l(E),strict:a,toBlock:o,type:"event"}}async function TF(u){const e=td(u,{method:"eth_newPendingTransactionFilter"}),t=await u.request({method:"eth_newPendingTransactionFilter"});return{id:t,request:e(t),type:"transaction"}}async function JN(u,{address:e,blockNumber:t,blockTag:n="latest"}){const r=t?zu(t):void 0,i=await u.request({method:"eth_getBalance",params:[e,r||n]});return BigInt(i)}async function YN(u,{blockHash:e,blockNumber:t,blockTag:n="latest"}={}){const r=t!==void 0?zu(t):void 0;let i;return e?i=await u.request({method:"eth_getBlockTransactionCountByHash",params:[e]}):i=await u.request({method:"eth_getBlockTransactionCountByNumber",params:[r||n]}),u0(i)}async function XN(u,{address:e,blockNumber:t,blockTag:n="latest"}){const r=t!==void 0?zu(t):void 0,i=await u.request({method:"eth_getCode",params:[e,r||n]});if(i!=="0x")return i}function ZN(u){var e;return{baseFeePerGas:u.baseFeePerGas.map(t=>BigInt(t)),gasUsedRatio:u.gasUsedRatio,oldestBlock:BigInt(u.oldestBlock),reward:(e=u.reward)==null?void 0:e.map(t=>t.map(n=>BigInt(n)))}}async function uR(u,{blockCount:e,blockNumber:t,blockTag:n="latest",rewardPercentiles:r}){const i=t?zu(t):void 0,a=await u.request({method:"eth_feeHistory",params:[zu(e),i||n,r]});return ZN(a)}async function eR(u,{filter:e}){const t=e.strict??!1;return(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(r=>{var i;try{const{eventName:a,args:o}="abi"in e&&e.abi?xl({abi:e.abi,data:r.data,topics:r.topics,strict:t}):{eventName:void 0,args:void 0};return jt(r,{args:o,eventName:a})}catch(a){let o,s;if(a instanceof oa||a instanceof js){if("strict"in e&&e.strict)return;o=a.abiItem.name,s=(i=a.abiItem.inputs)==null?void 0:i.some(l=>!("name"in l&&l.name))}return jt(r,{args:s?[]:{},eventName:o})}}).filter(Boolean)}const tR=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,nR=/^(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)?$/;function rR({domain:u,message:e,primaryType:t,types:n}){const r=typeof u>"u"?{}:u,i={EIP712Domain:zF({domain:r}),...n};jF({domain:r,message:e,primaryType:t,types:i});const a=["0x1901"];return r&&a.push(iR({domain:r,types:i})),t!=="EIP712Domain"&&a.push(IF({data:e,primaryType:t,types:i})),s0(Vn(a))}function iR({domain:u,types:e}){return IF({data:u,primaryType:"EIP712Domain",types:e})}function IF({data:u,primaryType:e,types:t}){const n=OF({data:u,primaryType:e,types:t});return s0(n)}function OF({data:u,primaryType:e,types:t}){const n=[{type:"bytes32"}],r=[aR({primaryType:e,types:t})];for(const i of t[e]){const[a,o]=RF({types:t,name:i.name,type:i.type,value:u[i.name]});n.push(a),r.push(o)}return vl(n,r)}function aR({primaryType:u,types:e}){const t=er(oR({primaryType:u,types:e}));return s0(t)}function oR({primaryType:u,types:e}){let t="";const n=NF({primaryType:u,types:e});n.delete(u);const r=[u,...Array.from(n).sort()];for(const i of r)t+=`${i}(${e[i].map(({name:a,type:o})=>`${o} ${a}`).join(",")})`;return t}function NF({primaryType:u,types:e},t=new Set){const n=u.match(/^\w*/u),r=n==null?void 0:n[0];if(t.has(r)||e[r]===void 0)return t;t.add(r);for(const i of e[r])NF({primaryType:i.type,types:e},t);return t}function RF({types:u,name:e,type:t,value:n}){if(u[t]!==void 0)return[{type:"bytes32"},s0(OF({data:n,primaryType:t,types:u}))];if(t==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},s0(n)];if(t==="string")return[{type:"bytes32"},s0(er(n))];if(t.lastIndexOf("]")===t.length-1){const r=t.slice(0,t.lastIndexOf("[")),i=n.map(a=>RF({name:e,type:r,types:u,value:a}));return[{type:"bytes32"},s0(vl(i.map(([a])=>a),i.map(([,a])=>a)))]}return[{type:t},n]}function jF({domain:u,message:e,primaryType:t,types:n}){const r=n,i=(a,o)=>{for(const s of a){const{name:l,type:c}=s,E=c,d=o[l],f=E.match(nR);if(f&&(typeof d=="number"||typeof d=="bigint")){const[B,g,C]=f;zu(d,{signed:g==="int",size:parseInt(C)/8})}if(E==="address"&&typeof d=="string"&&!fs(d))throw new B3({address:d});const m=E.match(tR);if(m){const[B,g]=m;if(g&&Se(d)!==parseInt(g))throw new UI({expectedSize:parseInt(g),givenSize:Se(d)})}const h=r[E];h&&i(h,d)}};if(r.EIP712Domain&&u&&i(r.EIP712Domain,u),t!=="EIP712Domain"){const a=r[t];i(a,e)}}function zF({domain:u}){return[typeof(u==null?void 0:u.name)=="string"&&{name:"name",type:"string"},(u==null?void 0:u.version)&&{name:"version",type:"string"},typeof(u==null?void 0:u.chainId)=="number"&&{name:"chainId",type:"uint256"},(u==null?void 0:u.verifyingContract)&&{name:"verifyingContract",type:"address"},(u==null?void 0:u.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const V9="/docs/contract/encodeDeployData";function MF({abi:u,args:e,bytecode:t}){if(!e||e.length===0)return t;const n=u.find(i=>"type"in i&&i.type==="constructor");if(!n)throw new II({docsPath:V9});if(!("inputs"in n))throw new i8({docsPath:V9});if(!n.inputs||n.inputs.length===0)throw new i8({docsPath:V9});const r=vl(n.inputs,e);return Sh([t,r])}function sR(u,e){const t=(()=>typeof u=="string"?$n(u):u.raw instanceof Uint8Array?u.raw:Kr(u.raw))(),n=$n(`Ethereum Signed Message: ${t.length}`);return s0(Vn([n,t]),e)}function lR(u){return u.map(e=>({...e,value:BigInt(e.value)}))}function cR(u){return{...u,balance:u.balance?BigInt(u.balance):void 0,nonce:u.nonce?u0(u.nonce):void 0,storageProof:u.storageProof?lR(u.storageProof):void 0}}async function ER(u,{address:e,blockNumber:t,blockTag:n,storageKeys:r}){const i=n??"latest",a=t!==void 0?zu(t):void 0,o=await u.request({method:"eth_getProof",params:[e,r,a||i]});return cR(o)}async function dR(u,{address:e,blockNumber:t,blockTag:n="latest",slot:r}){const i=t!==void 0?zu(t):void 0;return await u.request({method:"eth_getStorageAt",params:[e,r,i||n]})}async function t5(u,{blockHash:e,blockNumber:t,blockTag:n,hash:r,index:i}){var c,E,d;const a=n||"latest",o=t!==void 0?zu(t):void 0;let s=null;if(r?s=await u.request({method:"eth_getTransactionByHash",params:[r]}):e?s=await u.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,zu(i)]}):(o||a)&&(s=await u.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||a,zu(i)]})),!s)throw new pF({blockHash:e,blockNumber:t,blockTag:a,hash:r,index:i});return(((d=(E=(c=u.chain)==null?void 0:c.formatters)==null?void 0:E.transaction)==null?void 0:d.format)||V2)(s)}async function fR(u,{hash:e,transactionReceipt:t}){const[n,r]=await Promise.all([_l(u),e?t5(u,{hash:e}):void 0]),i=(t==null?void 0:t.blockNumber)||(r==null?void 0:r.blockNumber);return i?n-i+1n:0n}async function rf(u,{hash:e}){var r,i,a;const t=await u.request({method:"eth_getTransactionReceipt",params:[e]});if(!t)throw new hF({hash:e});return(((a=(i=(r=u.chain)==null?void 0:r.formatters)==null?void 0:i.transactionReceipt)==null?void 0:a.format)||Xv)(t)}async function pR(u,e){var h;const{allowFailure:t=!0,batchSize:n,blockNumber:r,blockTag:i,contracts:a,multicallAddress:o}=e,s=n??(typeof((h=u.batch)==null?void 0:h.multicall)=="object"&&u.batch.multicall.batchSize||1024);let l=o;if(!l){if(!u.chain)throw new Error("client chain not configured. multicallAddress is required.");l=Ns({blockNumber:r,chain:u.chain,contract:"multicall3"})}const c=[[]];let E=0,d=0;for(let B=0;B0&&d>s&&c[E].length>0&&(E++,d=(w.length-2)/2,c[E]=[]),c[E]=[...c[E],{allowFailure:!0,callData:w,target:C}]}catch(w){const D=N3(w,{abi:g,address:C,args:y,docsPath:"/docs/contract/multicall",functionName:v});if(!t)throw D;c[E]=[...c[E],{allowFailure:!0,callData:"0x",target:C}]}}const f=await Promise.allSettled(c.map(B=>Jr(u,{abi:ef,address:l,args:[B],blockNumber:r,blockTag:i,functionName:"aggregate3"}))),m=[];for(let B=0;Bu instanceof Uint8Array,mR=Array.from({length:256},(u,e)=>e.toString(16).padStart(2,"0"));function Cs(u){if(!Ed(u))throw new Error("Uint8Array expected");let e="";for(let t=0;tn+r.length,0));let t=0;return u.forEach(n=>{if(!Ed(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}function $F(u,e){if(u.length!==e.length)return!1;for(let t=0;tUF;u>>=cd,e+=1);return e}function BR(u,e){return u>>BigInt(e)&cd}const vR=(u,e,t)=>u|(t?cd:UF)<(CR<new Uint8Array(u),g8=u=>Uint8Array.from(u);function WF(u,e,t){if(typeof u!="number"||u<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=J9(u),r=J9(u),i=0;const a=()=>{n.fill(1),r.fill(0),i=0},o=(...E)=>t(r,n,...E),s=(E=J9())=>{r=o(g8([0]),E),n=o(),E.length!==0&&(r=o(g8([1]),E),n=o())},l=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let E=0;const d=[];for(;E{a(),s(E);let f;for(;!(f=d(l()));)s();return a(),f}}const FR={bigint:u=>typeof u=="bigint",function:u=>typeof u=="function",boolean:u=>typeof u=="boolean",string:u=>typeof u=="string",stringOrUint8Array:u=>typeof u=="string"||u instanceof Uint8Array,isSafeInteger:u=>Number.isSafeInteger(u),array:u=>Array.isArray(u),field:(u,e)=>e.Fp.isValid(u),hash:u=>typeof u=="function"&&Number.isSafeInteger(u.outputLen)};function Pl(u,e,t={}){const n=(r,i,a)=>{const o=FR[i];if(typeof o!="function")throw new Error(`Invalid validator "${i}", expected function`);const s=u[r];if(!(a&&s===void 0)&&!o(s,u))throw new Error(`Invalid param ${String(r)}=${s} (${typeof s}), expected ${i}`)};for(const[r,i]of Object.entries(e))n(r,i,!1);for(const[r,i]of Object.entries(t))n(r,i,!0);return u}const DR=Object.freeze(Object.defineProperty({__proto__:null,bitGet:BR,bitLen:yR,bitMask:a5,bitSet:vR,bytesToHex:Cs,bytesToNumberBE:Yi,bytesToNumberLE:r5,concatBytes:j3,createHmacDrbg:WF,ensureBytes:Dt,equalBytes:$F,hexToBytes:ms,hexToNumber:n5,numberToBytesBE:gs,numberToBytesLE:i5,numberToHexUnpadded:LF,numberToVarBytesBE:gR,utf8ToBytes:AR,validateObject:Pl},Symbol.toStringTag,{value:"Module"}));function bR(u,e){const t=cn(u)?Kr(u):u,n=cn(e)?Kr(e):e;return $F(t,n)}async function qF(u,{address:e,hash:t,signature:n,...r}){const i=cn(n)?n:er(n);try{const{data:a}=await id(u,{data:MF({abi:aN,args:[e,t,i],bytecode:hR}),...r});return bR(a??"0x0","0x1")}catch(a){if(a instanceof CF)return!1;throw a}}async function wR(u,{address:e,message:t,signature:n,...r}){const i=sR(t);return qF(u,{address:e,hash:i,signature:n,...r})}async function xR(u,{address:e,signature:t,message:n,primaryType:r,types:i,domain:a,...o}){const s=rR({message:n,primaryType:r,types:i,domain:a});return qF(u,{address:e,hash:s,signature:t,...o})}function HF(u,{emitOnBegin:e=!1,emitMissed:t=!1,onBlockNumber:n,onError:r,poll:i,pollingInterval:a=u.pollingInterval}){const o=typeof i<"u"?i:u.transport.type!=="webSocket";let s;return o?(()=>{const E=f0(["watchBlockNumber",u.uid,e,t,a]);return Ls(E,{onBlockNumber:n,onError:r},d=>kl(async()=>{var f;try{const m=await _l(u,{cacheTime:0});if(s){if(m===s)return;if(m-s>1&&t)for(let h=s+1n;hs)&&(d.onBlockNumber(m,s),s=m)}catch(m){(f=d.onError)==null||f.call(d,m)}},{emitOnBegin:e,interval:a}))})():(()=>{let E=!0,d=()=>E=!1;return(async()=>{try{const{unsubscribe:f}=await u.transport.subscribe({params:["newHeads"],onData(m){var B;if(!E)return;const h=In((B=m.result)==null?void 0:B.number);n(h,s),s=h},onError(m){r==null||r(m)}});d=f,E||d()}catch(f){r==null||r(f)}})(),d})()}async function kR(u,{confirmations:e=1,hash:t,onReplaced:n,pollingInterval:r=u.pollingInterval,timeout:i}){const a=f0(["waitForTransactionReceipt",u.uid,t]);let o,s,l,c=!1;return new Promise((E,d)=>{i&&setTimeout(()=>d(new WO({hash:t})),i);const f=Ls(a,{onReplaced:n,resolve:E,reject:d},m=>{const h=HF(u,{emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:r,async onBlockNumber(B){if(c)return;let g=B;const C=y=>{h(),y(),f()};try{if(l){if(e>1&&(!l.blockNumber||g-l.blockNumber+1nm.resolve(l));return}if(o||(c=!0,await FF(async()=>{o=await t5(u,{hash:t}),o.blockNumber&&(g=o.blockNumber)},{delay:({count:y})=>~~(1<1&&(!l.blockNumber||g-l.blockNumber+1nm.resolve(l))}catch(y){if(o&&(y instanceof pF||y instanceof hF))try{s=o;const w=(await Vr(u,{blockNumber:g,includeTransactions:!0})).transactions.find(({from:p,nonce:x})=>p===s.from&&x===s.nonce);if(!w||(l=await rf(u,{hash:w.hash}),e>1&&(!l.blockNumber||g-l.blockNumber+1n{var p;(p=m.onReplaced)==null||p.call(m,{reason:D,replacedTransaction:s,transaction:w,transactionReceipt:l}),m.resolve(l)})}catch(v){C(()=>m.reject(v))}else C(()=>m.reject(y))}}})})})}function _R(u,{blockTag:e="latest",emitMissed:t=!1,emitOnBegin:n=!1,onBlock:r,onError:i,includeTransactions:a,poll:o,pollingInterval:s=u.pollingInterval}){const l=typeof o<"u"?o:u.transport.type!=="webSocket",c=a??!1;let E;return l?(()=>{const m=f0(["watchBlocks",u.uid,t,n,c,s]);return Ls(m,{onBlock:r,onError:i},h=>kl(async()=>{var B;try{const g=await Vr(u,{blockTag:e,includeTransactions:c});if(g.number&&(E!=null&&E.number)){if(g.number===E.number)return;if(g.number-E.number>1&&t)for(let C=(E==null?void 0:E.number)+1n;CE.number)&&(h.onBlock(g,E),E=g)}catch(g){(B=h.onError)==null||B.call(h,g)}},{emitOnBegin:n,interval:s}))})():(()=>{let m=!0,h=()=>m=!1;return(async()=>{try{const{unsubscribe:B}=await u.transport.subscribe({params:["newHeads"],onData(g){var v,w,D;if(!m)return;const y=(((D=(w=(v=u.chain)==null?void 0:v.formatters)==null?void 0:w.block)==null?void 0:D.format)||_h)(g.result);r(y,E),E=y},onError(g){i==null||i(g)}});h=B,m||h()}catch(B){i==null||i(B)}})(),h})()}function SR(u,{address:e,args:t,batch:n=!0,event:r,events:i,onError:a,onLogs:o,poll:s,pollingInterval:l=u.pollingInterval,strict:c}){const E=typeof s<"u"?s:u.transport.type!=="webSocket",d=c??!1;return E?(()=>{const h=f0(["watchEvent",e,t,n,u.uid,r,l]);return Ls(h,{onLogs:o,onError:a},B=>{let g,C,y=!1;const v=kl(async()=>{var w;if(!y){try{C=await PF(u,{address:e,args:t,event:r,events:i,strict:d})}catch{}y=!0;return}try{let D;if(C)D=await ad(u,{filter:C});else{const p=await _l(u);g&&g!==p?D=await Vh(u,{address:e,args:t,event:r,events:i,fromBlock:g+1n,toBlock:p}):D=[],g=p}if(D.length===0)return;n?B.onLogs(D):D.forEach(p=>B.onLogs([p]))}catch(D){C&&D instanceof sa&&(y=!1),(w=B.onError)==null||w.call(B,D)}},{emitOnBegin:!0,interval:l});return async()=>{C&&await od(u,{filter:C}),v()}})})():(()=>{let h=!0,B=()=>h=!1;return(async()=>{try{const g=i??(r?[r]:void 0);let C=[];g&&(C=[g.flatMap(v=>Dl({abi:[v],eventName:v.name,args:t}))],r&&(C=C[0]));const{unsubscribe:y}=await u.transport.subscribe({params:["logs",{address:e,topics:C}],onData(v){var D;if(!h)return;const w=v.result;try{const{eventName:p,args:x}=xl({abi:g,data:w.data,topics:w.topics,strict:d}),j=jt(w,{args:x,eventName:p});o([j])}catch(p){let x,j;if(p instanceof oa||p instanceof js){if(c)return;x=p.abiItem.name,j=(D=p.abiItem.inputs)==null?void 0:D.some(uu=>!("name"in uu&&uu.name))}const O=jt(w,{args:j?[]:{},eventName:x});o([O])}},onError(v){a==null||a(v)}});B=y,h||B()}catch(g){a==null||a(g)}})(),B})()}function PR(u,{batch:e=!0,onError:t,onTransactions:n,poll:r,pollingInterval:i=u.pollingInterval}){return(typeof r<"u"?r:u.transport.type!=="webSocket")?(()=>{const l=f0(["watchPendingTransactions",u.uid,e,i]);return Ls(l,{onTransactions:n,onError:t},c=>{let E;const d=kl(async()=>{var f;try{if(!E)try{E=await TF(u);return}catch(h){throw d(),h}const m=await ad(u,{filter:E});if(m.length===0)return;e?c.onTransactions(m):m.forEach(h=>c.onTransactions([h]))}catch(m){(f=c.onError)==null||f.call(c,m)}},{emitOnBegin:!0,interval:i});return async()=>{E&&await od(u,{filter:E}),d()}})})():(()=>{let l=!0,c=()=>l=!1;return(async()=>{try{const{unsubscribe:E}=await u.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!l)return;const f=d.result;n([f])},onError(d){t==null||t(d)}});c=E,l||c()}catch(E){t==null||t(E)}})(),c})()}function TR(u){return{call:e=>id(u,e),createBlockFilter:()=>VN(u),createContractEventFilter:e=>EF(u,e),createEventFilter:e=>PF(u,e),createPendingTransactionFilter:()=>TF(u),estimateContractGas:e=>nN(u,e),estimateGas:e=>Qh(u,e),getBalance:e=>JN(u,e),getBlock:e=>Vr(u,e),getBlockNumber:e=>_l(u,e),getBlockTransactionCount:e=>YN(u,e),getBytecode:e=>XN(u,e),getChainId:()=>R3(u),getContractEvents:e=>AF(u,e),getEnsAddress:e=>IN(u,e),getEnsAvatar:e=>GN(u,e),getEnsName:e=>KN(u,e),getEnsResolver:e=>QN(u,e),getEnsText:e=>SF(u,e),getFeeHistory:e=>uR(u,e),estimateFeesPerGas:e=>eN(u,e),getFilterChanges:e=>ad(u,e),getFilterLogs:e=>eR(u,e),getGasPrice:()=>Kh(u),getLogs:e=>Vh(u,e),getProof:e=>ER(u,e),estimateMaxPriorityFeePerGas:e=>uN(u,e),getStorageAt:e=>dR(u,e),getTransaction:e=>t5(u,e),getTransactionConfirmations:e=>fR(u,e),getTransactionCount:e=>gF(u,e),getTransactionReceipt:e=>rf(u,e),multicall:e=>pR(u,e),prepareTransactionRequest:e=>rd(u,e),readContract:e=>Jr(u,e),sendRawTransaction:e=>Yh(u,e),simulateContract:e=>dN(u,e),verifyMessage:e=>wR(u,e),verifyTypedData:e=>xR(u,e),uninstallFilter:e=>od(u,e),waitForTransactionReceipt:e=>kR(u,e),watchBlocks:e=>_R(u,e),watchBlockNumber:e=>HF(u,e),watchContractEvent:e=>AN(u,e),watchEvent:e=>SR(u,e),watchPendingTransactions:e=>PR(u,e)}}function A8(u){const{key:e="public",name:t="Public Client"}=u;return vF({...u,key:e,name:t,type:"publicClient"}).extend(TR)}function IR(u,{abi:e,args:t,bytecode:n,...r}){const i=MF({abi:e,args:t,bytecode:n});return Xh(u,{...r,data:i})}async function OR(u){return(await u.request({method:"eth_accounts"})).map(t=>Mh(t))}async function NR(u){return await u.request({method:"wallet_getPermissions"})}async function RR(u){return(await u.request({method:"eth_requestAccounts"})).map(t=>e0(t))}async function jR(u,e){return u.request({method:"wallet_requestPermissions",params:[e]})}async function zR(u,{account:e=u.account,message:t}){if(!e)throw new Ms({docsPath:"/docs/actions/wallet/signMessage"});const n=Ct(e);if(n.type==="local")return n.signMessage({message:t});const r=(()=>typeof t=="string"?bh(t):t.raw instanceof Uint8Array?er(t.raw):t.raw)();return u.request({method:"personal_sign",params:[r,n.address]})}async function MR(u,e){var l,c,E,d;const{account:t=u.account,chain:n=u.chain,...r}=e;if(!t)throw new Ms({docsPath:"/docs/actions/wallet/signTransaction"});const i=Ct(t);wl({account:i,...e});const a=await R3(u);n!==null&&Kv({currentChainId:a,chain:n});const o=(n==null?void 0:n.formatters)||((l=u.chain)==null?void 0:l.formatters),s=((c=o==null?void 0:o.transactionRequest)==null?void 0:c.format)||J2;return i.type==="local"?i.signTransaction({...r,chainId:a},{serializer:(d=(E=u.chain)==null?void 0:E.serializers)==null?void 0:d.transaction}):await u.request({method:"eth_signTransaction",params:[{...s(r),chainId:zu(a),from:i.address}]})}async function UR(u,{account:e=u.account,domain:t,message:n,primaryType:r,types:i}){if(!e)throw new Ms({docsPath:"/docs/actions/wallet/signTypedData"});const a=Ct(e),o={EIP712Domain:zF({domain:t}),...i};if(jF({domain:t,message:n,primaryType:r,types:o}),a.type==="local")return a.signTypedData({domain:t,primaryType:r,types:o,message:n});const s=f0({domain:t??{},primaryType:r,types:o,message:n},(l,c)=>cn(c)?c.toLowerCase():c);return u.request({method:"eth_signTypedData_v4",params:[a.address,s]})}async function LR(u,{id:e}){await u.request({method:"wallet_switchEthereumChain",params:[{chainId:zu(e)}]})}async function $R(u,e){return await u.request({method:"wallet_watchAsset",params:e})}function WR(u){return{addChain:e=>vN(u,e),deployContract:e=>IR(u,e),getAddresses:()=>OR(u),getChainId:()=>R3(u),getPermissions:()=>NR(u),prepareTransactionRequest:e=>rd(u,e),requestAddresses:()=>RR(u),requestPermissions:e=>jR(u,e),sendRawTransaction:e=>Yh(u,e),sendTransaction:e=>Xh(u,e),signMessage:e=>zR(u,e),signTransaction:e=>MR(u,e),signTypedData:e=>UR(u,e),switchChain:e=>LR(u,e),watchAsset:e=>$R(u,e),writeContract:e=>BN(u,e)}}function Tl(u){const{key:e="wallet",name:t="Wallet Client",transport:n}=u;return vF({...u,key:e,name:t,transport:i=>n({...i,retryCount:0}),type:"walletClient"}).extend(WR)}function qR(u,e={}){const{key:t="webSocket",name:n="WebSocket JSON-RPC",retryDelay:r}=e;return({chain:i,retryCount:a,timeout:o})=>{var E;const s=e.retryCount??a,l=o??e.timeout??1e4,c=u||((E=i==null?void 0:i.rpcUrls.default.webSocket)==null?void 0:E[0]);if(!c)throw new bF;return sd({key:t,name:n,async request({method:d,params:f}){const m={method:d,params:f},h=await Q9(c),{error:B,result:g}=await Co.webSocketAsync(h,{body:m,timeout:l});if(B)throw new Wh({body:m,error:B,url:c});return g},retryCount:s,retryDelay:r,timeout:l,type:"webSocket"},{getSocket(){return Q9(c)},async subscribe({params:d,onData:f,onError:m}){const h=await Q9(c),{result:B}=await new Promise((g,C)=>Co.webSocket(h,{body:{method:"eth_subscribe",params:d},onResponse(y){if(y.error){C(y.error),m==null||m(y.error);return}if(typeof y.id=="number"){g(y);return}y.method==="eth_subscription"&&f(y.params)}}));return{subscriptionId:B,async unsubscribe(){return new Promise(g=>Co.webSocket(h,{body:{method:"eth_unsubscribe",params:[B]},onResponse:g}))}}}})}}function HR(u,e,t,n){if(typeof u.setBigUint64=="function")return u.setBigUint64(e,t,n);const r=BigInt(32),i=BigInt(4294967295),a=Number(t>>r&i),o=Number(t&i),s=n?4:0,l=n?0:4;u.setUint32(e+s,a,n),u.setUint32(e+l,o,n)}class GR extends Ih{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=W9(this.buffer)}update(e){ps(this);const{view:t,buffer:n,blockLen:r}=this;e=ud(e);const i=e.length;for(let a=0;ar-a&&(this.process(n,0),a=0);for(let E=a;Ec.length)throw new Error("_sha2: outputLen bigger than state");for(let E=0;Eu&e^~u&t,QR=(u,e,t)=>u&e^u&t^e&t,VR=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),or=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),sr=new Uint32Array(64);class JR extends GR{constructor(){super(64,32,8,!1),this.A=or[0]|0,this.B=or[1]|0,this.C=or[2]|0,this.D=or[3]|0,this.E=or[4]|0,this.F=or[5]|0,this.G=or[6]|0,this.H=or[7]|0}get(){const{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let E=0;E<16;E++,t+=4)sr[E]=e.getUint32(t,!1);for(let E=16;E<64;E++){const d=sr[E-15],f=sr[E-2],m=qt(d,7)^qt(d,18)^d>>>3,h=qt(f,17)^qt(f,19)^f>>>10;sr[E]=h+sr[E-7]+m+sr[E-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:l,H:c}=this;for(let E=0;E<64;E++){const d=qt(o,6)^qt(o,11)^qt(o,25),f=c+d+KR(o,s,l)+VR[E]+sr[E]|0,h=(qt(n,2)^qt(n,13)^qt(n,22))+QR(n,r,i)|0;c=l,l=s,s=o,o=a+f|0,a=i,i=r,r=n,n=f+h|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(n,r,i,a,o,s,l,c)}roundClean(){sr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const YR=rF(()=>new JR);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ne=BigInt(0),ye=BigInt(1),mi=BigInt(2),XR=BigInt(3),af=BigInt(4),y8=BigInt(5),B8=BigInt(8);BigInt(9);BigInt(16);function g0(u,e){const t=u%e;return t>=Ne?t:e+t}function ZR(u,e,t){if(t<=Ne||e 0");if(t===ye)return Ne;let n=ye;for(;e>Ne;)e&ye&&(n=n*u%t),u=u*u%t,e>>=ye;return n}function V0(u,e,t){let n=u;for(;e-- >Ne;)n*=n,n%=t;return n}function of(u,e){if(u===Ne||e<=Ne)throw new Error(`invert: expected positive integers, got n=${u} mod=${e}`);let t=g0(u,e),n=e,r=Ne,i=ye;for(;t!==Ne;){const o=n/t,s=n%t,l=r-i*o;n=t,t=s,r=i,i=l}if(n!==ye)throw new Error("invert: does not exist");return g0(r,e)}function uj(u){const e=(u-ye)/mi;let t,n,r;for(t=u-ye,n=0;t%mi===Ne;t/=mi,n++);for(r=mi;r(n[r]="function",n),e);return Pl(u,t)}function rj(u,e,t){if(t 0");if(t===Ne)return u.ONE;if(t===ye)return e;let n=u.ONE,r=e;for(;t>Ne;)t&ye&&(n=u.mul(n,r)),r=u.sqr(r),t>>=ye;return n}function ij(u,e){const t=new Array(e.length),n=e.reduce((i,a,o)=>u.is0(a)?i:(t[o]=i,u.mul(i,a)),u.ONE),r=u.inv(n);return e.reduceRight((i,a,o)=>u.is0(a)?i:(t[o]=u.mul(i,t[o]),u.mul(i,a)),r),t}function GF(u,e){const t=e!==void 0?e:u.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function aj(u,e,t=!1,n={}){if(u<=Ne)throw new Error(`Expected Field ORDER > 0, got ${u}`);const{nBitLength:r,nByteLength:i}=GF(u,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=ej(u),o=Object.freeze({ORDER:u,BITS:r,BYTES:i,MASK:a5(r),ZERO:Ne,ONE:ye,create:s=>g0(s,u),isValid:s=>{if(typeof s!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof s}`);return Ne<=s&&ss===Ne,isOdd:s=>(s&ye)===ye,neg:s=>g0(-s,u),eql:(s,l)=>s===l,sqr:s=>g0(s*s,u),add:(s,l)=>g0(s+l,u),sub:(s,l)=>g0(s-l,u),mul:(s,l)=>g0(s*l,u),pow:(s,l)=>rj(o,s,l),div:(s,l)=>g0(s*of(l,u),u),sqrN:s=>s*s,addN:(s,l)=>s+l,subN:(s,l)=>s-l,mulN:(s,l)=>s*l,inv:s=>of(s,u),sqrt:n.sqrt||(s=>a(o,s)),invertBatch:s=>ij(o,s),cmov:(s,l,c)=>c?l:s,toBytes:s=>t?i5(s,i):gs(s,i),fromBytes:s=>{if(s.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${s.length}`);return t?r5(s):Yi(s)}});return Object.freeze(o)}function KF(u){if(typeof u!="bigint")throw new Error("field order must be bigint");const e=u.toString(2).length;return Math.ceil(e/8)}function QF(u){const e=KF(u);return e+Math.ceil(e/2)}function oj(u,e,t=!1){const n=u.length,r=KF(e),i=QF(e);if(n<16||n1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);const a=t?Yi(u):r5(u),o=g0(a,e-ye)+ye;return t?i5(o,r):gs(o,r)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const sj=BigInt(0),Y9=BigInt(1);function lj(u,e){const t=(r,i)=>{const a=i.negate();return r?a:i},n=r=>{const i=Math.ceil(e/r)+1,a=2**(r-1);return{windows:i,windowSize:a}};return{constTimeNegate:t,unsafeLadder(r,i){let a=u.ZERO,o=r;for(;i>sj;)i&Y9&&(a=a.add(o)),o=o.double(),i>>=Y9;return a},precomputeWindow(r,i){const{windows:a,windowSize:o}=n(i),s=[];let l=r,c=l;for(let E=0;E>=f,B>s&&(B-=d,a+=Y9);const g=h,C=h+Math.abs(B)-1,y=m%2!==0,v=B<0;B===0?c=c.add(t(y,i[g])):l=l.add(t(v,i[C]))}return{p:l,f:c}},wNAFCached(r,i,a,o){const s=r._WINDOW_SIZE||1;let l=i.get(r);return l||(l=this.precomputeWindow(r,s),s!==1&&i.set(r,o(l))),this.wNAF(s,l,a)}}}function VF(u){return nj(u.Fp),Pl(u,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...GF(u.n,u.nBitLength),...u,p:u.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function cj(u){const e=VF(u);Pl(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:n,a:r}=e;if(t){if(!n.eql(r,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Ej,hexToBytes:dj}=DR,bi={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(u){const{Err:e}=bi;if(u.length<2||u[0]!==2)throw new e("Invalid signature integer tag");const t=u[1],n=u.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Ej(n),l:u.subarray(t+2)}},toSig(u){const{Err:e}=bi,t=typeof u=="string"?dj(u):u;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:r,l:i}=bi._parseInt(t.subarray(2)),{d:a,l:o}=bi._parseInt(i);if(o.length)throw new e("Invalid signature: left bytes after parsing");return{r,s:a}},hexFromSig(u){const e=l=>Number.parseInt(l[0],16)&8?"00"+l:l,t=l=>{const c=l.toString(16);return c.length&1?`0${c}`:c},n=e(t(u.s)),r=e(t(u.r)),i=n.length/2,a=r.length/2,o=t(i),s=t(a);return`30${t(a+i+4)}02${s}${r}02${o}${n}`}},On=BigInt(0),it=BigInt(1);BigInt(2);const v8=BigInt(3);BigInt(4);function fj(u){const e=cj(u),{Fp:t}=e,n=e.toBytes||((m,h,B)=>{const g=h.toAffine();return j3(Uint8Array.from([4]),t.toBytes(g.x),t.toBytes(g.y))}),r=e.fromBytes||(m=>{const h=m.subarray(1),B=t.fromBytes(h.subarray(0,t.BYTES)),g=t.fromBytes(h.subarray(t.BYTES,2*t.BYTES));return{x:B,y:g}});function i(m){const{a:h,b:B}=e,g=t.sqr(m),C=t.mul(g,m);return t.add(t.add(C,t.mul(m,h)),B)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function a(m){return typeof m=="bigint"&&Ont.eql(y,t.ZERO);return C(B)&&C(g)?E.ZERO:new E(B,g,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(h){const B=t.invertBatch(h.map(g=>g.pz));return h.map((g,C)=>g.toAffine(B[C])).map(E.fromAffine)}static fromHex(h){const B=E.fromAffine(r(Dt("pointHex",h)));return B.assertValidity(),B}static fromPrivateKey(h){return E.BASE.multiply(s(h))}_setWindowSize(h){this._WINDOW_SIZE=h,l.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:h,y:B}=this.toAffine();if(!t.isValid(h)||!t.isValid(B))throw new Error("bad point: x or y not FE");const g=t.sqr(B),C=i(h);if(!t.eql(g,C))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:h}=this.toAffine();if(t.isOdd)return!t.isOdd(h);throw new Error("Field doesn't support isOdd")}equals(h){c(h);const{px:B,py:g,pz:C}=this,{px:y,py:v,pz:w}=h,D=t.eql(t.mul(B,w),t.mul(y,C)),p=t.eql(t.mul(g,w),t.mul(v,C));return D&&p}negate(){return new E(this.px,t.neg(this.py),this.pz)}double(){const{a:h,b:B}=e,g=t.mul(B,v8),{px:C,py:y,pz:v}=this;let w=t.ZERO,D=t.ZERO,p=t.ZERO,x=t.mul(C,C),j=t.mul(y,y),O=t.mul(v,v),uu=t.mul(C,y);return uu=t.add(uu,uu),p=t.mul(C,v),p=t.add(p,p),w=t.mul(h,p),D=t.mul(g,O),D=t.add(w,D),w=t.sub(j,D),D=t.add(j,D),D=t.mul(w,D),w=t.mul(uu,w),p=t.mul(g,p),O=t.mul(h,O),uu=t.sub(x,O),uu=t.mul(h,uu),uu=t.add(uu,p),p=t.add(x,x),x=t.add(p,x),x=t.add(x,O),x=t.mul(x,uu),D=t.add(D,x),O=t.mul(y,v),O=t.add(O,O),x=t.mul(O,uu),w=t.sub(w,x),p=t.mul(O,j),p=t.add(p,p),p=t.add(p,p),new E(w,D,p)}add(h){c(h);const{px:B,py:g,pz:C}=this,{px:y,py:v,pz:w}=h;let D=t.ZERO,p=t.ZERO,x=t.ZERO;const j=e.a,O=t.mul(e.b,v8);let uu=t.mul(B,y),ou=t.mul(g,v),su=t.mul(C,w),Cu=t.add(B,g),eu=t.add(y,v);Cu=t.mul(Cu,eu),eu=t.add(uu,ou),Cu=t.sub(Cu,eu),eu=t.add(B,C);let au=t.add(y,w);return eu=t.mul(eu,au),au=t.add(uu,su),eu=t.sub(eu,au),au=t.add(g,C),D=t.add(v,w),au=t.mul(au,D),D=t.add(ou,su),au=t.sub(au,D),x=t.mul(j,eu),D=t.mul(O,su),x=t.add(D,x),D=t.sub(ou,x),x=t.add(ou,x),p=t.mul(D,x),ou=t.add(uu,uu),ou=t.add(ou,uu),su=t.mul(j,su),eu=t.mul(O,eu),ou=t.add(ou,su),su=t.sub(uu,su),su=t.mul(j,su),eu=t.add(eu,su),uu=t.mul(ou,eu),p=t.add(p,uu),uu=t.mul(au,eu),D=t.mul(Cu,D),D=t.sub(D,uu),uu=t.mul(Cu,ou),x=t.mul(au,x),x=t.add(x,uu),new E(D,p,x)}subtract(h){return this.add(h.negate())}is0(){return this.equals(E.ZERO)}wNAF(h){return f.wNAFCached(this,l,h,B=>{const g=t.invertBatch(B.map(C=>C.pz));return B.map((C,y)=>C.toAffine(g[y])).map(E.fromAffine)})}multiplyUnsafe(h){const B=E.ZERO;if(h===On)return B;if(o(h),h===it)return this;const{endo:g}=e;if(!g)return f.unsafeLadder(this,h);let{k1neg:C,k1:y,k2neg:v,k2:w}=g.splitScalar(h),D=B,p=B,x=this;for(;y>On||w>On;)y&it&&(D=D.add(x)),w&it&&(p=p.add(x)),x=x.double(),y>>=it,w>>=it;return C&&(D=D.negate()),v&&(p=p.negate()),p=new E(t.mul(p.px,g.beta),p.py,p.pz),D.add(p)}multiply(h){o(h);let B=h,g,C;const{endo:y}=e;if(y){const{k1neg:v,k1:w,k2neg:D,k2:p}=y.splitScalar(B);let{p:x,f:j}=this.wNAF(w),{p:O,f:uu}=this.wNAF(p);x=f.constTimeNegate(v,x),O=f.constTimeNegate(D,O),O=new E(t.mul(O.px,y.beta),O.py,O.pz),g=x.add(O),C=j.add(uu)}else{const{p:v,f:w}=this.wNAF(B);g=v,C=w}return E.normalizeZ([g,C])[0]}multiplyAndAddUnsafe(h,B,g){const C=E.BASE,y=(w,D)=>D===On||D===it||!w.equals(C)?w.multiplyUnsafe(D):w.multiply(D),v=y(this,B).add(y(h,g));return v.is0()?void 0:v}toAffine(h){const{px:B,py:g,pz:C}=this,y=this.is0();h==null&&(h=y?t.ONE:t.inv(C));const v=t.mul(B,h),w=t.mul(g,h),D=t.mul(C,h);if(y)return{x:t.ZERO,y:t.ZERO};if(!t.eql(D,t.ONE))throw new Error("invZ was invalid");return{x:v,y:w}}isTorsionFree(){const{h,isTorsionFree:B}=e;if(h===it)return!0;if(B)return B(E,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h,clearCofactor:B}=e;return h===it?this:B?B(E,this):this.multiplyUnsafe(e.h)}toRawBytes(h=!0){return this.assertValidity(),n(E,this,h)}toHex(h=!0){return Cs(this.toRawBytes(h))}}E.BASE=new E(e.Gx,e.Gy,t.ONE),E.ZERO=new E(t.ZERO,t.ONE,t.ZERO);const d=e.nBitLength,f=lj(E,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:E,normPrivateKeyToScalar:s,weierstrassEquation:i,isWithinCurveOrder:a}}function pj(u){const e=VF(u);return Pl(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function hj(u){const e=pj(u),{Fp:t,n}=e,r=t.BYTES+1,i=2*t.BYTES+1;function a(eu){return OnCs(gs(eu,e.nByteLength));function m(eu){const au=n>>it;return eu>au}function h(eu){return m(eu)?o(-eu):eu}const B=(eu,au,nu)=>Yi(eu.slice(au,nu));class g{constructor(au,nu,W){this.r=au,this.s=nu,this.recovery=W,this.assertValidity()}static fromCompact(au){const nu=e.nByteLength;return au=Dt("compactSignature",au,nu*2),new g(B(au,0,nu),B(au,nu,2*nu))}static fromDER(au){const{r:nu,s:W}=bi.toSig(Dt("DER",au));return new g(nu,W)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(au){return new g(this.r,this.s,au)}recoverPublicKey(au){const{r:nu,s:W,recovery:iu}=this,lu=p(Dt("msgHash",au));if(iu==null||![0,1,2,3].includes(iu))throw new Error("recovery id invalid");const cu=iu===2||iu===3?nu+e.n:nu;if(cu>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const pu=iu&1?"03":"02",fu=l.fromHex(pu+f(cu)),J=s(cu),_u=o(-lu*J),Du=o(W*J),xu=l.BASE.multiplyAndAddUnsafe(fu,_u,Du);if(!xu)throw new Error("point at infinify");return xu.assertValidity(),xu}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return ms(this.toDERHex())}toDERHex(){return bi.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ms(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const C={isValidPrivateKey(eu){try{return c(eu),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const eu=QF(e.n);return oj(e.randomBytes(eu),e.n)},precompute(eu=8,au=l.BASE){return au._setWindowSize(eu),au.multiply(BigInt(3)),au}};function y(eu,au=!0){return l.fromPrivateKey(eu).toRawBytes(au)}function v(eu){const au=eu instanceof Uint8Array,nu=typeof eu=="string",W=(au||nu)&&eu.length;return au?W===r||W===i:nu?W===2*r||W===2*i:eu instanceof l}function w(eu,au,nu=!0){if(v(eu))throw new Error("first arg must be private key");if(!v(au))throw new Error("second arg must be public key");return l.fromHex(au).multiply(c(eu)).toRawBytes(nu)}const D=e.bits2int||function(eu){const au=Yi(eu),nu=eu.length*8-e.nBitLength;return nu>0?au>>BigInt(nu):au},p=e.bits2int_modN||function(eu){return o(D(eu))},x=a5(e.nBitLength);function j(eu){if(typeof eu!="bigint")throw new Error("bigint expected");if(!(On<=eu&&euIu in nu))throw new Error("sign() legacy options not supported");const{hash:W,randomBytes:iu}=e;let{lowS:lu,prehash:cu,extraEntropy:pu}=nu;lu==null&&(lu=!0),eu=Dt("msgHash",eu),cu&&(eu=Dt("prehashed msgHash",W(eu)));const fu=p(eu),J=c(au),_u=[j(J),j(fu)];if(pu!=null){const Iu=pu===!0?iu(t.BYTES):pu;_u.push(Dt("extraEntropy",Iu))}const Du=j3(..._u),xu=fu;function bu(Iu){const S=D(Iu);if(!d(S))return;const T=s(S),I=l.BASE.multiply(S).toAffine(),L=o(I.x);if(L===On)return;const U=o(T*o(xu+L*J));if(U===On)return;let q=(I.x===L?0:2)|Number(I.y&it),Y=U;return lu&&m(U)&&(Y=h(U),q^=1),new g(L,Y,q)}return{seed:Du,k2sig:bu}}const uu={lowS:e.lowS,prehash:!1},ou={lowS:e.lowS,prehash:!1};function su(eu,au,nu=uu){const{seed:W,k2sig:iu}=O(eu,au,nu),lu=e;return WF(lu.hash.outputLen,lu.nByteLength,lu.hmac)(W,iu)}l.BASE._setWindowSize(8);function Cu(eu,au,nu,W=ou){var I;const iu=eu;if(au=Dt("msgHash",au),nu=Dt("publicKey",nu),"strict"in W)throw new Error("options.strict was renamed to lowS");const{lowS:lu,prehash:cu}=W;let pu,fu;try{if(typeof iu=="string"||iu instanceof Uint8Array)try{pu=g.fromDER(iu)}catch(L){if(!(L instanceof bi.Err))throw L;pu=g.fromCompact(iu)}else if(typeof iu=="object"&&typeof iu.r=="bigint"&&typeof iu.s=="bigint"){const{r:L,s:U}=iu;pu=new g(L,U)}else throw new Error("PARSE");fu=l.fromHex(nu)}catch(L){if(L.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(lu&&pu.hasHighS())return!1;cu&&(au=e.hash(au));const{r:J,s:_u}=pu,Du=p(au),xu=s(_u),bu=o(Du*xu),Iu=o(J*xu),S=(I=l.BASE.multiplyAndAddUnsafe(fu,bu,Iu))==null?void 0:I.toAffine();return S?o(S.x)===J:!1}return{CURVE:e,getPublicKey:y,getSharedSecret:w,sign:su,verify:Cu,ProjectivePoint:l,Signature:g,utils:C}}let JF=class extends Ih{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,JI(e);const n=ud(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let a=0;anew JF(u,e).update(t).digest();YF.create=(u,e)=>new JF(u,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Cj(u){return{hash:u,hmac:(e,...t)=>YF(u,e,aO(...t)),randomBytes:oO}}function mj(u,e){const t=n=>hj({...u,...Cj(n)});return Object.freeze({...t(e),create:t})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const XF=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),F8=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),gj=BigInt(1),sf=BigInt(2),D8=(u,e)=>(u+e/sf)/e;function Aj(u){const e=XF,t=BigInt(3),n=BigInt(6),r=BigInt(11),i=BigInt(22),a=BigInt(23),o=BigInt(44),s=BigInt(88),l=u*u*u%e,c=l*l*u%e,E=V0(c,t,e)*c%e,d=V0(E,t,e)*c%e,f=V0(d,sf,e)*l%e,m=V0(f,r,e)*f%e,h=V0(m,i,e)*m%e,B=V0(h,o,e)*h%e,g=V0(B,s,e)*B%e,C=V0(g,o,e)*h%e,y=V0(C,t,e)*c%e,v=V0(y,a,e)*m%e,w=V0(v,n,e)*l%e,D=V0(w,sf,e);if(!lf.eql(lf.sqr(D),u))throw new Error("Cannot find square root");return D}const lf=aj(XF,void 0,void 0,{sqrt:Aj}),lr=mj({a:BigInt(0),b:BigInt(7),Fp:lf,n:F8,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:u=>{const e=F8,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-gj*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),r=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,a=BigInt("0x100000000000000000000000000000000"),o=D8(i*u,e),s=D8(-n*u,e);let l=g0(u-o*t-s*r,e),c=g0(-o*n-s*i,e);const E=l>a,d=c>a;if(E&&(l=e-l),d&&(c=e-c),l>a||c>a)throw new Error("splitScalar: Endomorphism failed, k="+u);return{k1neg:E,k1:l,k2neg:d,k2:c}}}},YR);BigInt(0);lr.ProjectivePoint;const yj=Dh({id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}),o5=Dh({id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{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"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Bj=Dh({id:420,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461}},testnet:!0},{formatters:bI});var ZF=class extends Error{constructor({chainId:u,connectorId:e}){super(`Chain "${u}" not configured for connector "${e}".`),this.name="ChainNotConfiguredForConnectorError"}},y0=class extends Error{constructor(){super(...arguments),this.name="ConnectorNotFoundError",this.message="Connector not found"}};function la(u){return typeof u=="string"?Number.parseInt(u,u.trim().substring(0,2)==="0x"?16:10):typeof u=="bigint"?Number(u):u}var uD={exports:{}};(function(u){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function r(s,l,c){this.fn=s,this.context=l,this.once=c||!1}function i(s,l,c,E,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new r(c,E||s,d),m=t?t+l:l;return s._events[m]?s._events[m].fn?s._events[m]=[s._events[m],f]:s._events[m].push(f):(s._events[m]=f,s._eventsCount++),s}function a(s,l){--s._eventsCount===0?s._events=new n:delete s._events[l]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],c,E;if(this._eventsCount===0)return l;for(E in c=this._events)e.call(c,E)&&l.push(t?E.slice(1):E);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},o.prototype.listeners=function(l){var c=t?t+l:l,E=this._events[c];if(!E)return[];if(E.fn)return[E.fn];for(var d=0,f=E.length,m=new Array(f);d{if(!e.has(u))throw TypeError("Cannot "+t)},Wu=(u,e,t)=>(s5(u,e,"read from private field"),t?t.call(u):e.get(u)),we=(u,e,t)=>{if(e.has(u))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(u):e.set(u,t)},Jn=(u,e,t,n)=>(s5(u,e,"write to private field"),n?n.call(u,t):e.set(u,t),t),De=(u,e,t)=>(s5(u,e,"access private method"),t),Il=class extends Fj{constructor({chains:u=[o5,yj],options:e}){super(),this.chains=u,this.options=e}getBlockExplorerUrls(u){const{default:e,...t}=u.blockExplorers??{};if(e)return[e.url,...Object.values(t).map(n=>n.url)]}isChainUnsupported(u){return!this.chains.some(e=>e.id===u)}setStorage(u){this.storage=u}};function Dj(u){var t;if(!u)return"Injected";const e=n=>{if(n.isApexWallet)return"Apex Wallet";if(n.isAvalanche)return"Core Wallet";if(n.isBackpack)return"Backpack";if(n.isBifrost)return"Bifrost Wallet";if(n.isBitKeep)return"BitKeep";if(n.isBitski)return"Bitski";if(n.isBlockWallet)return"BlockWallet";if(n.isBraveWallet)return"Brave Wallet";if(n.isCoin98)return"Coin98 Wallet";if(n.isCoinbaseWallet)return"Coinbase Wallet";if(n.isDawn)return"Dawn Wallet";if(n.isDefiant)return"Defiant";if(n.isDesig)return"Desig Wallet";if(n.isEnkrypt)return"Enkrypt";if(n.isExodus)return"Exodus";if(n.isFordefi)return"Fordefi";if(n.isFrame)return"Frame";if(n.isFrontier)return"Frontier Wallet";if(n.isGamestop)return"GameStop Wallet";if(n.isHaqqWallet)return"HAQQ Wallet";if(n.isHyperPay)return"HyperPay Wallet";if(n.isImToken)return"ImToken";if(n.isHaloWallet)return"Halo Wallet";if(n.isKuCoinWallet)return"KuCoin Wallet";if(n.isMathWallet)return"MathWallet";if(n.isNovaWallet)return"Nova Wallet";if(n.isOkxWallet||n.isOKExWallet)return"OKX Wallet";if(n.isOneInchIOSWallet||n.isOneInchAndroidWallet)return"1inch Wallet";if(n.isOpera)return"Opera";if(n.isPhantom)return"Phantom";if(n.isPortal)return"Ripio Portal";if(n.isRabby)return"Rabby Wallet";if(n.isRainbow)return"Rainbow";if(n.isStatus)return"Status";if(n.isSubWallet)return"SubWallet";if(n.isTalisman)return"Talisman";if(n.isTally)return"Taho";if(n.isTokenPocket)return"TokenPocket";if(n.isTokenary)return"Tokenary";if(n.isTrust||n.isTrustWallet)return"Trust Wallet";if(n.isTTWallet)return"TTWallet";if(n.isXDEFI)return"XDEFI Wallet";if(n.isZeal)return"Zeal";if(n.isZerion)return"Zerion";if(n.isMetaMask)return"MetaMask"};if((t=u.providers)!=null&&t.length){const n=new Set;let r=1;for(const a of u.providers){let o=e(a);o||(o=`Unknown Wallet #${r}`,r+=1),n.add(o)}const i=[...n];return i.length?i:i[0]??"Injected"}return e(u)??"Injected"}var Jc,As=class extends Il{constructor({chains:u,options:e}={}){const t={shimDisconnect:!0,getProvider(){if(typeof window>"u")return;const r=window.ethereum;return r!=null&&r.providers?r.providers[0]:r},...e};super({chains:u,options:t}),this.id="injected",we(this,Jc,void 0),this.shimDisconnectKey=`${this.id}.shimDisconnect`,this.onAccountsChanged=r=>{r.length===0?this.emit("disconnect"):this.emit("change",{account:e0(r[0])})},this.onChainChanged=r=>{const i=la(r),a=this.isChainUnsupported(i);this.emit("change",{chain:{id:i,unsupported:a}})},this.onDisconnect=async r=>{var i;r.code===1013&&await this.getProvider()&&await this.getAccount()||(this.emit("disconnect"),this.options.shimDisconnect&&((i=this.storage)==null||i.removeItem(this.shimDisconnectKey)))};const n=t.getProvider();if(typeof t.name=="string")this.name=t.name;else if(n){const r=Dj(n);t.name?this.name=t.name(r):typeof r=="string"?this.name=r:this.name=r[0]}else this.name="Injected";this.ready=!!n}async connect({chainId:u}={}){var e;try{const t=await this.getProvider();if(!t)throw new y0;t.on&&(t.on("accountsChanged",this.onAccountsChanged),t.on("chainChanged",this.onChainChanged),t.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});const n=await t.request({method:"eth_requestAccounts"}),r=e0(n[0]);let i=await this.getChainId(),a=this.isChainUnsupported(i);return u&&i!==u&&(i=(await this.switchChain(u)).id,a=this.isChainUnsupported(i)),this.options.shimDisconnect&&((e=this.storage)==null||e.setItem(this.shimDisconnectKey,!0)),{account:r,chain:{id:i,unsupported:a}}}catch(t){throw this.isUserRejectedRequestError(t)?new _e(t):t.code===-32002?new Qr(t):t}}async disconnect(){var e;const u=await this.getProvider();u!=null&&u.removeListener&&(u.removeListener("accountsChanged",this.onAccountsChanged),u.removeListener("chainChanged",this.onChainChanged),u.removeListener("disconnect",this.onDisconnect),this.options.shimDisconnect&&((e=this.storage)==null||e.removeItem(this.shimDisconnectKey)))}async getAccount(){const u=await this.getProvider();if(!u)throw new y0;const e=await u.request({method:"eth_accounts"});return e0(e[0])}async getChainId(){const u=await this.getProvider();if(!u)throw new y0;return u.request({method:"eth_chainId"}).then(la)}async getProvider(){const u=this.options.getProvider();return u&&Jn(this,Jc,u),Wu(this,Jc)}async getWalletClient({chainId:u}={}){const[e,t]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find(r=>r.id===u);if(!e)throw new Error("provider is required.");return Tl({account:t,chain:n,transport:Sl(e)})}async isAuthorized(){var u;try{if(this.options.shimDisconnect&&!((u=this.storage)!=null&&u.getItem(this.shimDisconnectKey)))return!1;if(!await this.getProvider())throw new y0;return!!await this.getAccount()}catch{return!1}}async switchChain(u){var n,r,i;const e=await this.getProvider();if(!e)throw new y0;const t=zu(u);try{return await Promise.all([e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]}),new Promise(a=>this.on("change",({chain:o})=>{(o==null?void 0:o.id)===u&&a()}))]),this.chains.find(a=>a.id===u)??{id:u,name:`Chain ${t}`,network:`${t}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(a){const o=this.chains.find(s=>s.id===u);if(!o)throw new ZF({chainId:u,connectorId:this.id});if(a.code===4902||((r=(n=a==null?void 0:a.data)==null?void 0:n.originalError)==null?void 0:r.code)===4902)try{if(await e.request({method:"wallet_addEthereumChain",params:[{chainId:t,chainName:o.name,nativeCurrency:o.nativeCurrency,rpcUrls:[((i=o.rpcUrls.public)==null?void 0:i.http[0])??""],blockExplorerUrls:this.getBlockExplorerUrls(o)}]}),await this.getChainId()!==u)throw new _e(new Error("User rejected switch after adding network."));return o}catch(s){throw new _e(s)}throw this.isUserRejectedRequestError(a)?new _e(a):new En(a)}}async watchAsset({address:u,decimals:e=18,image:t,symbol:n}){const r=await this.getProvider();if(!r)throw new y0;return r.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:u,decimals:e,image:t,symbol:n}}})}isUserRejectedRequestError(u){return u.code===4001}};Jc=new WeakMap;var l5=(u,e,t)=>{if(!e.has(u))throw TypeError("Cannot "+t)},X9=(u,e,t)=>(l5(u,e,"read from private field"),t?t.call(u):e.get(u)),Z9=(u,e,t)=>{if(e.has(u))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(u):e.set(u,t)},yc=(u,e,t,n)=>(l5(u,e,"write to private field"),n?n.call(u,t):e.set(u,t),t),bj=(u,e,t)=>(l5(u,e,"access private method"),t);const wj=u=>(e,t,n)=>{const r=n.subscribe;return n.subscribe=(a,o,s)=>{let l=a;if(o){const c=(s==null?void 0:s.equalityFn)||Object.is;let E=a(n.getState());l=d=>{const f=a(d);if(!c(E,f)){const m=E;o(E=f,m)}},s!=null&&s.fireImmediately&&o(E,E)}return r(l)},u(e,t,n)},xj=wj;function kj(u,e){let t;try{t=u()}catch{return}return{getItem:r=>{var i;const a=s=>s===null?null:JSON.parse(s,e==null?void 0:e.reviver),o=(i=t.getItem(r))!=null?i:null;return o instanceof Promise?o.then(a):a(o)},setItem:(r,i)=>t.setItem(r,JSON.stringify(i,e==null?void 0:e.replacer)),removeItem:r=>t.removeItem(r)}}const z3=u=>e=>{try{const t=u(e);return t instanceof Promise?t:{then(n){return z3(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return z3(n)(t)}}}},_j=(u,e)=>(t,n,r)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:B=>B,version:0,merge:(B,g)=>({...g,...B}),...e},a=!1;const o=new Set,s=new Set;let l;try{l=i.getStorage()}catch{}if(!l)return u((...B)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),t(...B)},n,r);const c=z3(i.serialize),E=()=>{const B=i.partialize({...n()});let g;const C=c({state:B,version:i.version}).then(y=>l.setItem(i.name,y)).catch(y=>{g=y});if(g)throw g;return C},d=r.setState;r.setState=(B,g)=>{d(B,g),E()};const f=u((...B)=>{t(...B),E()},n,r);let m;const h=()=>{var B;if(!l)return;a=!1,o.forEach(C=>C(n()));const g=((B=i.onRehydrateStorage)==null?void 0:B.call(i,n()))||void 0;return z3(l.getItem.bind(l))(i.name).then(C=>{if(C)return i.deserialize(C)}).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==i.version){if(i.migrate)return i.migrate(C.state,C.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return C.state}).then(C=>{var y;return m=i.merge(C,(y=n())!=null?y:f),t(m,!0),E()}).then(()=>{g==null||g(m,void 0),a=!0,s.forEach(C=>C(m))}).catch(C=>{g==null||g(void 0,C)})};return r.persist={setOptions:B=>{i={...i,...B},B.getStorage&&(l=B.getStorage())},clearStorage:()=>{l==null||l.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>h(),hasHydrated:()=>a,onHydrate:B=>(o.add(B),()=>{o.delete(B)}),onFinishHydration:B=>(s.add(B),()=>{s.delete(B)})},h(),m||f},Sj=(u,e)=>(t,n,r)=>{let i={storage:kj(()=>localStorage),partialize:h=>h,version:0,merge:(h,B)=>({...B,...h}),...e},a=!1;const o=new Set,s=new Set;let l=i.storage;if(!l)return u((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),t(...h)},n,r);const c=()=>{const h=i.partialize({...n()});return l.setItem(i.name,{state:h,version:i.version})},E=r.setState;r.setState=(h,B)=>{E(h,B),c()};const d=u((...h)=>{t(...h),c()},n,r);let f;const m=()=>{var h,B;if(!l)return;a=!1,o.forEach(C=>{var y;return C((y=n())!=null?y:d)});const g=((B=i.onRehydrateStorage)==null?void 0:B.call(i,(h=n())!=null?h:d))||void 0;return z3(l.getItem.bind(l))(i.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==i.version){if(i.migrate)return i.migrate(C.state,C.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return C.state}).then(C=>{var y;return f=i.merge(C,(y=n())!=null?y:d),t(f,!0),c()}).then(()=>{g==null||g(f,void 0),f=n(),a=!0,s.forEach(C=>C(f))}).catch(C=>{g==null||g(void 0,C)})};return r.persist={setOptions:h=>{i={...i,...h},h.storage&&(l=h.storage)},clearStorage:()=>{l==null||l.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:h=>(o.add(h),()=>{o.delete(h)}),onFinishHydration:h=>(s.add(h),()=>{s.delete(h)})},i.skipHydration||m(),f||d},Pj=(u,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?_j(u,e):Sj(u,e),Tj=Pj,b8=u=>{let e;const t=new Set,n=(s,l)=>{const c=typeof s=="function"?s(e):s;if(!Object.is(c,e)){const E=e;e=l??typeof c!="object"?c:Object.assign({},e,c),t.forEach(d=>d(e,E))}},r=()=>e,o={setState:n,getState:r,subscribe:s=>(t.add(s),()=>t.delete(s)),destroy:()=>{t.clear()}};return e=u(n,r,o),o},Ij=u=>u?b8(u):b8;function eD(u,e){if(Object.is(u,e))return!0;if(typeof u!="object"||u===null||typeof e!="object"||e===null)return!1;if(u instanceof Map&&e instanceof Map){if(u.size!==e.size)return!1;for(const[n,r]of u)if(!Object.is(r,e.get(n)))return!1;return!0}if(u instanceof Set&&e instanceof Set){if(u.size!==e.size)return!1;for(const n of u)if(!e.has(n))return!1;return!0}const t=Object.keys(u);if(t.length!==Object.keys(e).length)return!1;for(let n=0;nh===E.id)||(s=[...s,m.chain]),l[E.id]=[...l[E.id]||[],...m.rpcUrls.http],m.rpcUrls.webSocket&&(c[E.id]=[...c[E.id]||[],...m.rpcUrls.webSocket]))}if(!d)throw new Error([`Could not find valid provider configuration for chain "${E.name}". `,"You may need to add `jsonRpcProvider` to `configureChains` with the chain's RPC URLs.","Read more: https://wagmi.sh/core/providers/jsonRpc"].join(` -`))}return{chains:s,publicClient:({chainId:E})=>{const d=s.find(h=>h.id===E)??u[0],f=l[d.id];if(!f||!f[0])throw new Error(`No providers configured for chain "${d.id}"`);const m=A8({batch:t,chain:d,transport:h8(f.map(h=>SN(h,{timeout:o})),{rank:r,retryCount:i,retryDelay:a}),pollingInterval:n});return Object.assign(m,{chains:s})},webSocketPublicClient:({chainId:E})=>{const d=s.find(h=>h.id===E)??u[0],f=c[d.id];if(!f||!f[0])return;const m=A8({batch:t,chain:d,transport:h8(f.map(h=>qR(h,{timeout:o})),{rank:r,retryCount:i,retryDelay:a}),pollingInterval:n});return Object.assign(m,{chains:s})}}}var Nj=class extends Error{constructor({activeChain:u,targetChain:e}){super(`Chain mismatch: Expected "${e}", received "${u}".`),this.name="ChainMismatchError"}},Rj=class extends Error{constructor({chainId:u,connectorId:e}){super(`Chain "${u}" not configured${e?` for connector "${e}"`:""}.`),this.name="ChainNotConfigured"}},jj=class extends Error{constructor(){super(...arguments),this.name="ConnectorAlreadyConnectedError",this.message="Connector already connected"}},zj=class extends Error{constructor(){super(...arguments),this.name="ConfigChainsNotFound",this.message="No chains were found on the wagmi config. Some functions that require a chain may not work."}},Mj=class extends Error{constructor({connector:u}){super(`"${u.name}" does not support programmatic chain switching.`),this.name="SwitchChainNotSupportedError"}};function GE(u,e){if(u===e)return!0;if(u&&e&&typeof u=="object"&&typeof e=="object"){if(u.constructor!==e.constructor)return!1;let t,n;if(Array.isArray(u)&&Array.isArray(e)){if(t=u.length,t!=e.length)return!1;for(n=t;n--!==0;)if(!GE(u[n],e[n]))return!1;return!0}if(u.valueOf!==Object.prototype.valueOf)return u.valueOf()===e.valueOf();if(u.toString!==Object.prototype.toString)return u.toString()===e.toString();const r=Object.keys(u);if(t=r.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,r[n]))return!1;for(n=t;n--!==0;){const i=r[n];if(i&&!GE(u[i],e[i]))return!1}return!0}return u!==u&&e!==e}var cf=(u,{find:e,replace:t})=>u&&e(u)?t(u):typeof u!="object"?u:Array.isArray(u)?u.map(n=>cf(n,{find:e,replace:t})):u instanceof Object?Object.entries(u).reduce((n,[r,i])=>({...n,[r]:cf(i,{find:e,replace:t})}),{}):u;function Uj(u){const e=JSON.parse(u);return cf(e,{find:n=>typeof n=="string"&&n.startsWith("#bigint."),replace:n=>BigInt(n.replace("#bigint.",""))})}function Lj(u){return{accessList:u.accessList,account:u.account,blockNumber:u.blockNumber,blockTag:u.blockTag,data:u.data,gas:u.gas,gasPrice:u.gasPrice,maxFeePerGas:u.maxFeePerGas,maxPriorityFeePerGas:u.maxPriorityFeePerGas,nonce:u.nonce,to:u.to,value:u.value}}function $j(u){return{accessList:u.accessList,account:u.account,data:u.data,gas:u.gas,gasPrice:u.gasPrice,maxFeePerGas:u.maxFeePerGas,maxPriorityFeePerGas:u.maxPriorityFeePerGas,nonce:u.nonce,to:u.to,value:u.value}}function w8(u){return typeof u=="number"?u:u==="wei"?0:Math.abs(_I[u])}function x8(u,e){return u.slice(0,e).join(".")||"."}function k8(u,e){const{length:t}=u;for(let n=0;n{const a=typeof i=="bigint"?`#bigint.${i.toString()}`:i;return(e==null?void 0:e(r,a))||a},n),t??void 0)}var tD={getItem:u=>"",setItem:(u,e)=>null,removeItem:u=>null};function nD({deserialize:u=Uj,key:e="wagmi",serialize:t=qj,storage:n}){return{...n,getItem:(r,i=null)=>{const a=n.getItem(`${e}.${r}`);try{return a?u(a):i}catch(o){return console.warn(o),i}},setItem:(r,i)=>{if(i===null)n.removeItem(`${e}.${r}`);else try{n.setItem(`${e}.${r}`,t(i))}catch(a){console.error(a)}},removeItem:r=>n.removeItem(`${e}.${r}`)}}var _8="store",Ia,x4,Ef,rD,Hj=class{constructor({autoConnect:u=!1,connectors:e=[new As],publicClient:t,storage:n=nD({storage:typeof window<"u"?window.localStorage:tD}),logger:r={warn:console.warn},webSocketPublicClient:i}){var l,c;Z9(this,Ef),this.publicClients=new Map,this.webSocketPublicClients=new Map,Z9(this,Ia,void 0),Z9(this,x4,void 0),this.args={autoConnect:u,connectors:e,logger:r,publicClient:t,storage:n,webSocketPublicClient:i};let a="disconnected",o;if(u)try{const E=n.getItem(_8),d=(l=E==null?void 0:E.state)==null?void 0:l.data;a=d!=null&&d.account?"reconnecting":"connecting",o=(c=d==null?void 0:d.chain)==null?void 0:c.id}catch{}const s=typeof e=="function"?e():e;s.forEach(E=>E.setStorage(n)),this.store=Ij(xj(Tj(()=>({connectors:s,publicClient:this.getPublicClient({chainId:o}),status:a,webSocketPublicClient:this.getWebSocketPublicClient({chainId:o})}),{name:_8,storage:n,partialize:E=>{var d,f;return{...u&&{data:{account:(d=E==null?void 0:E.data)==null?void 0:d.account,chain:(f=E==null?void 0:E.data)==null?void 0:f.chain}},chains:E==null?void 0:E.chains}},version:2}))),this.storage=n,yc(this,x4,n==null?void 0:n.getItem("wallet")),bj(this,Ef,rD).call(this),u&&typeof window<"u"&&setTimeout(async()=>await this.autoConnect(),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){var u,e;return(e=(u=this.data)==null?void 0:u.chain)==null?void 0:e.id}get publicClient(){return this.store.getState().publicClient}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketPublicClient(){return this.store.getState().webSocketPublicClient}setState(u){const e=typeof u=="function"?u(this.store.getState()):u;this.store.setState(e,!0)}clearState(){this.setState(u=>({...u,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var u,e;this.connector&&await((e=(u=this.connector).disconnect)==null?void 0:e.call(u)),yc(this,Ia,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(X9(this,Ia))return;yc(this,Ia,!0),this.setState(t=>{var n;return{...t,status:(n=t.data)!=null&&n.account?"reconnecting":"connecting"}});const u=X9(this,x4)?[...this.connectors].sort(t=>t.id===X9(this,x4)?-1:1):this.connectors;let e=!1;for(const t of u){if(!t.ready||!t.isAuthorized||!await t.isAuthorized())continue;const r=await t.connect();this.setState(i=>({...i,connector:t,chains:t==null?void 0:t.chains,data:r,status:"connected"})),e=!0;break}return e||this.setState(t=>({...t,data:void 0,status:"disconnected"})),yc(this,Ia,!1),this.data}setConnectors(u){this.args={...this.args,connectors:u};const e=typeof u=="function"?u():u;e.forEach(t=>t.setStorage(this.args.storage)),this.setState(t=>({...t,connectors:e}))}getPublicClient({chainId:u}={}){let e=this.publicClients.get(-1);if(e&&(e==null?void 0:e.chain.id)===u||(e=this.publicClients.get(u??-1),e))return e;const{publicClient:t}=this.args;return e=typeof t=="function"?t({chainId:u}):t,this.publicClients.set(u??-1,e),e}setPublicClient(u){var t,n;const e=(n=(t=this.data)==null?void 0:t.chain)==null?void 0:n.id;this.args={...this.args,publicClient:u},this.publicClients.clear(),this.setState(r=>({...r,publicClient:this.getPublicClient({chainId:e})}))}getWebSocketPublicClient({chainId:u}={}){let e=this.webSocketPublicClients.get(-1);if(e&&(e==null?void 0:e.chain.id)===u||(e=this.webSocketPublicClients.get(u??-1),e))return e;const{webSocketPublicClient:t}=this.args;return e=typeof t=="function"?t({chainId:u}):t,e&&this.webSocketPublicClients.set(u??-1,e),e}setWebSocketPublicClient(u){var t,n;const e=(n=(t=this.data)==null?void 0:t.chain)==null?void 0:n.id;this.args={...this.args,webSocketPublicClient:u},this.webSocketPublicClients.clear(),this.setState(r=>({...r,webSocketPublicClient:this.getWebSocketPublicClient({chainId:e})}))}setLastUsedConnector(u=null){var e;(e=this.storage)==null||e.setItem("wallet",u)}};Ia=new WeakMap;x4=new WeakMap;Ef=new WeakSet;rD=function(){const u=o=>{this.setState(s=>({...s,data:{...s.data,...o}}))},e=()=>{this.clearState()},t=o=>{this.setState(s=>({...s,error:o}))};this.store.subscribe(({connector:o})=>o,(o,s)=>{var l,c,E,d,f,m;(l=s==null?void 0:s.off)==null||l.call(s,"change",u),(c=s==null?void 0:s.off)==null||c.call(s,"disconnect",e),(E=s==null?void 0:s.off)==null||E.call(s,"error",t),o&&((d=o.on)==null||d.call(o,"change",u),(f=o.on)==null||f.call(o,"disconnect",e),(m=o.on)==null||m.call(o,"error",t))});const{publicClient:n,webSocketPublicClient:r}=this.args;(typeof n=="function"||typeof r=="function")&&this.store.subscribe(({data:o})=>{var s;return(s=o==null?void 0:o.chain)==null?void 0:s.id},o=>{this.setState(s=>({...s,publicClient:this.getPublicClient({chainId:o}),webSocketPublicClient:this.getWebSocketPublicClient({chainId:o})}))})};var df;function Gj(u){const e=new Hj(u);return df=e,e}function G0(){if(!df)throw new Error("No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config");return df}async function Kj({chainId:u,connector:e}){const t=G0(),n=t.connector;if(n&&e.id===n.id)throw new jj;try{t.setState(i=>({...i,status:"connecting"}));const r=await e.connect({chainId:u});return t.setLastUsedConnector(e.id),t.setState(i=>({...i,connector:e,chains:e==null?void 0:e.chains,data:r,status:"connected"})),t.storage.setItem("connected",!0),{...r,connector:e}}catch(r){throw t.setState(i=>({...i,status:i.connector?"connected":"disconnected"})),r}}async function Qj(){const u=G0();u.connector&&await u.connector.disconnect(),u.clearState(),u.storage.removeItem("connected")}var Vj=[{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:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],Jj=[{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:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];function ht({chainId:u}={}){const e=G0();return u&&e.getPublicClient({chainId:u})||e.publicClient}async function c5({chainId:u}={}){var n,r;return await((r=(n=G0().connector)==null?void 0:n.getWalletClient)==null?void 0:r.call(n,{chainId:u}))||null}function ff({chainId:u}={}){const e=G0();return u&&e.getWebSocketPublicClient({chainId:u})||e.webSocketPublicClient}function Yj(u,e){const t=G0(),n=async()=>e(ht(u));return t.subscribe(({publicClient:i})=>i,n)}function Xj(u,e){const t=G0(),n=async()=>e(ff(u));return t.subscribe(({webSocketPublicClient:i})=>i,n)}async function Zj({abi:u,address:e,args:t,chainId:n,functionName:r,walletClient:i,...a}){const o=ht({chainId:n}),s=i??await c5({chainId:n});if(!s)throw new y0;n&&oD({chainId:n});const{account:l,accessList:c,blockNumber:E,blockTag:d,gas:f,gasPrice:m,maxFeePerGas:h,maxPriorityFeePerGas:B,nonce:g,value:C}=Lj(a),{result:y,request:v}=await o.simulateContract({abi:u,address:e,functionName:r,args:t,account:l||s.account,accessList:c,blockNumber:E,blockTag:d,gas:f,gasPrice:m,maxFeePerGas:h,maxPriorityFeePerGas:B,nonce:g,value:C}),w=u.filter(D=>"name"in D&&D.name===r);return{mode:"prepared",request:{...v,abi:w,chainId:n},result:y}}async function uz({chainId:u,contracts:e,blockNumber:t,blockTag:n,...r}){const i=ht({chainId:u});if(!i.chains)throw new zj;if(u&&i.chain.id!==u)throw new Rj({chainId:u});return i.multicall({allowFailure:r.allowFailure??!0,blockNumber:t,blockTag:n,contracts:e})}async function iD({address:u,account:e,chainId:t,abi:n,args:r,functionName:i,blockNumber:a,blockTag:o}){return ht({chainId:t}).readContract({abi:n,address:u,account:e,functionName:i,args:r,blockNumber:a,blockTag:o})}async function ez({contracts:u,blockNumber:e,blockTag:t,...n}){const{allowFailure:r=!0}=n;try{const i=ht(),a=u.reduce((c,E,d)=>{const f=E.chainId??i.chain.id;return{...c,[f]:[...c[f]||[],{contract:E,index:d}]}},{}),o=()=>Object.entries(a).map(([c,E])=>uz({allowFailure:r,chainId:parseInt(c),contracts:E.map(({contract:d})=>d),blockNumber:e,blockTag:t})),s=(await Promise.all(o())).flat(),l=Object.values(a).flatMap(c=>c.map(({index:E})=>E));return s.reduce((c,E,d)=>(c&&(c[l[d]]=E),c),[])}catch(i){if(i instanceof Lh)throw i;const a=()=>u.map(o=>iD({...o,blockNumber:e,blockTag:t}));return r?(await Promise.allSettled(a())).map(o=>o.status==="fulfilled"?{result:o.value,status:"success"}:{error:o.reason,result:void 0,status:"failure"}):await Promise.all(a())}}async function S8(u){const e=await c5({chainId:u.chainId});if(!e)throw new y0;u.chainId&&oD({chainId:u.chainId});let t;if(u.mode==="prepared")t=u.request;else{const{chainId:r,mode:i,...a}=u;t=(await Zj(a)).request}return{hash:await e.writeContract({...t,chain:u.chainId?{id:u.chainId}:null})}}async function tz({address:u,chainId:e,formatUnits:t,token:n}){const r=G0(),i=ht({chainId:e});if(n){const l=async({abi:c})=>{const E={abi:c,address:n,chainId:e},[d,f,m]=await ez({allowFailure:!1,contracts:[{...E,functionName:"balanceOf",args:[u]},{...E,functionName:"decimals"},{...E,functionName:"symbol"}]});return{decimals:f,formatted:ME(d??"0",w8(t??f)),symbol:m,value:d}};try{return await l({abi:Vj})}catch(c){if(c instanceof Lh){const{symbol:E,...d}=await l({abi:Jj});return{symbol:xh(Ji(E,{dir:"right"})),...d}}throw c}}const a=[...r.publicClient.chains||[],...r.chains??[]],o=await i.getBalance({address:u}),s=a.find(l=>l.id===i.chain.id);return{decimals:(s==null?void 0:s.nativeCurrency.decimals)??18,formatted:ME(o??"0",w8(t??18)),symbol:(s==null?void 0:s.nativeCurrency.symbol)??"ETH",value:o}}function aD(){const{data:u,connector:e,status:t}=G0();switch(t){case"connected":return{address:u==null?void 0:u.account,connector:e,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:t};case"reconnecting":return{address:u==null?void 0:u.account,connector:e,isConnected:!!(u!=null&&u.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:t};case"connecting":return{address:u==null?void 0:u.account,connector:e,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:t};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:t}}}function E5(){var r,i,a,o;const u=G0(),e=(i=(r=u.data)==null?void 0:r.chain)==null?void 0:i.id,t=u.chains??[],n=[...((a=u.publicClient)==null?void 0:a.chains)||[],...t].find(s=>s.id===e)??{id:e,name:`Chain ${e}`,network:`${e}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}};return{chain:e?{...n,...(o=u.data)==null?void 0:o.chain,id:e}:void 0,chains:t}}async function nz(u){const e=await c5();if(!e)throw new y0;return await e.signMessage({message:u.message})}async function rz({chainId:u}){const{connector:e}=G0();if(!e)throw new y0;if(!e.switchChain)throw new Mj({connector:e});return e.switchChain(u)}function iz(u,{selector:e=t=>t}={}){const t=G0(),n=()=>u(aD());return t.subscribe(({data:i,connector:a,status:o})=>e({address:i==null?void 0:i.account,connector:a,status:o}),n,{equalityFn:eD})}function az(u,{selector:e=t=>t}={}){const t=G0(),n=()=>u(E5());return t.subscribe(({data:i,chains:a})=>{var o;return e({chainId:(o=i==null?void 0:i.chain)==null?void 0:o.id,chains:a})},n,{equalityFn:eD})}async function oz({name:u,chainId:e}){const{normalize:t}=await Hu(()=>import("./index-93998ae3.js"),[]);return await ht({chainId:e}).getEnsAvatar({name:t(u)})}async function sz({address:u,chainId:e}){return ht({chainId:e}).getEnsName({address:e0(u)})}async function lz({chainId:u}={}){return await ht({chainId:u}).getBlockNumber()}async function cz({chainId:u,confirmations:e=1,hash:t,onReplaced:n,timeout:r=0}){const i=ht({chainId:u}),a=await i.waitForTransactionReceipt({hash:t,confirmations:e,onReplaced:n,timeout:r});if(a.status==="reverted"){const o=await i.getTransaction({hash:a.transactionHash}),s=await i.call({...o,gasPrice:o.type!=="eip1559"?o.gasPrice:void 0,maxFeePerGas:o.type==="eip1559"?o.maxFeePerGas:void 0,maxPriorityFeePerGas:o.type==="eip1559"?o.maxPriorityFeePerGas:void 0}),l=xh(`0x${s.substring(138)}`);throw new Error(l)}return a}function oD({chainId:u}){var r,i;const{chain:e,chains:t}=E5(),n=e==null?void 0:e.id;if(n&&u!==n)throw new Nj({activeChain:((r=t.find(a=>a.id===n))==null?void 0:r.name)??`Chain ${n}`,targetChain:((i=t.find(a=>a.id===u))==null?void 0:i.name)??`Chain ${u}`})}var sD={exports:{}},lD={};/** +`))}return{chains:s,publicClient:({chainId:E})=>{const d=s.find(h=>h.id===E)??u[0],f=l[d.id];if(!f||!f[0])throw new Error(`No providers configured for chain "${d.id}"`);const m=A8({batch:t,chain:d,transport:h8(f.map(h=>SN(h,{timeout:o})),{rank:r,retryCount:i,retryDelay:a}),pollingInterval:n});return Object.assign(m,{chains:s})},webSocketPublicClient:({chainId:E})=>{const d=s.find(h=>h.id===E)??u[0],f=c[d.id];if(!f||!f[0])return;const m=A8({batch:t,chain:d,transport:h8(f.map(h=>qR(h,{timeout:o})),{rank:r,retryCount:i,retryDelay:a}),pollingInterval:n});return Object.assign(m,{chains:s})}}}var Nj=class extends Error{constructor({activeChain:u,targetChain:e}){super(`Chain mismatch: Expected "${e}", received "${u}".`),this.name="ChainMismatchError"}},Rj=class extends Error{constructor({chainId:u,connectorId:e}){super(`Chain "${u}" not configured${e?` for connector "${e}"`:""}.`),this.name="ChainNotConfigured"}},jj=class extends Error{constructor(){super(...arguments),this.name="ConnectorAlreadyConnectedError",this.message="Connector already connected"}},zj=class extends Error{constructor(){super(...arguments),this.name="ConfigChainsNotFound",this.message="No chains were found on the wagmi config. Some functions that require a chain may not work."}},Mj=class extends Error{constructor({connector:u}){super(`"${u.name}" does not support programmatic chain switching.`),this.name="SwitchChainNotSupportedError"}};function GE(u,e){if(u===e)return!0;if(u&&e&&typeof u=="object"&&typeof e=="object"){if(u.constructor!==e.constructor)return!1;let t,n;if(Array.isArray(u)&&Array.isArray(e)){if(t=u.length,t!=e.length)return!1;for(n=t;n--!==0;)if(!GE(u[n],e[n]))return!1;return!0}if(u.valueOf!==Object.prototype.valueOf)return u.valueOf()===e.valueOf();if(u.toString!==Object.prototype.toString)return u.toString()===e.toString();const r=Object.keys(u);if(t=r.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,r[n]))return!1;for(n=t;n--!==0;){const i=r[n];if(i&&!GE(u[i],e[i]))return!1}return!0}return u!==u&&e!==e}var cf=(u,{find:e,replace:t})=>u&&e(u)?t(u):typeof u!="object"?u:Array.isArray(u)?u.map(n=>cf(n,{find:e,replace:t})):u instanceof Object?Object.entries(u).reduce((n,[r,i])=>({...n,[r]:cf(i,{find:e,replace:t})}),{}):u;function Uj(u){const e=JSON.parse(u);return cf(e,{find:n=>typeof n=="string"&&n.startsWith("#bigint."),replace:n=>BigInt(n.replace("#bigint.",""))})}function Lj(u){return{accessList:u.accessList,account:u.account,blockNumber:u.blockNumber,blockTag:u.blockTag,data:u.data,gas:u.gas,gasPrice:u.gasPrice,maxFeePerGas:u.maxFeePerGas,maxPriorityFeePerGas:u.maxPriorityFeePerGas,nonce:u.nonce,to:u.to,value:u.value}}function $j(u){return{accessList:u.accessList,account:u.account,data:u.data,gas:u.gas,gasPrice:u.gasPrice,maxFeePerGas:u.maxFeePerGas,maxPriorityFeePerGas:u.maxPriorityFeePerGas,nonce:u.nonce,to:u.to,value:u.value}}function w8(u){return typeof u=="number"?u:u==="wei"?0:Math.abs(_I[u])}function x8(u,e){return u.slice(0,e).join(".")||"."}function k8(u,e){const{length:t}=u;for(let n=0;n{const a=typeof i=="bigint"?`#bigint.${i.toString()}`:i;return(e==null?void 0:e(r,a))||a},n),t??void 0)}var tD={getItem:u=>"",setItem:(u,e)=>null,removeItem:u=>null};function nD({deserialize:u=Uj,key:e="wagmi",serialize:t=qj,storage:n}){return{...n,getItem:(r,i=null)=>{const a=n.getItem(`${e}.${r}`);try{return a?u(a):i}catch(o){return console.warn(o),i}},setItem:(r,i)=>{if(i===null)n.removeItem(`${e}.${r}`);else try{n.setItem(`${e}.${r}`,t(i))}catch(a){console.error(a)}},removeItem:r=>n.removeItem(`${e}.${r}`)}}var _8="store",Ia,x4,Ef,rD,Hj=class{constructor({autoConnect:u=!1,connectors:e=[new As],publicClient:t,storage:n=nD({storage:typeof window<"u"?window.localStorage:tD}),logger:r={warn:console.warn},webSocketPublicClient:i}){var l,c;Z9(this,Ef),this.publicClients=new Map,this.webSocketPublicClients=new Map,Z9(this,Ia,void 0),Z9(this,x4,void 0),this.args={autoConnect:u,connectors:e,logger:r,publicClient:t,storage:n,webSocketPublicClient:i};let a="disconnected",o;if(u)try{const E=n.getItem(_8),d=(l=E==null?void 0:E.state)==null?void 0:l.data;a=d!=null&&d.account?"reconnecting":"connecting",o=(c=d==null?void 0:d.chain)==null?void 0:c.id}catch{}const s=typeof e=="function"?e():e;s.forEach(E=>E.setStorage(n)),this.store=Ij(xj(Tj(()=>({connectors:s,publicClient:this.getPublicClient({chainId:o}),status:a,webSocketPublicClient:this.getWebSocketPublicClient({chainId:o})}),{name:_8,storage:n,partialize:E=>{var d,f;return{...u&&{data:{account:(d=E==null?void 0:E.data)==null?void 0:d.account,chain:(f=E==null?void 0:E.data)==null?void 0:f.chain}},chains:E==null?void 0:E.chains}},version:2}))),this.storage=n,yc(this,x4,n==null?void 0:n.getItem("wallet")),bj(this,Ef,rD).call(this),u&&typeof window<"u"&&setTimeout(async()=>await this.autoConnect(),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){var u,e;return(e=(u=this.data)==null?void 0:u.chain)==null?void 0:e.id}get publicClient(){return this.store.getState().publicClient}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketPublicClient(){return this.store.getState().webSocketPublicClient}setState(u){const e=typeof u=="function"?u(this.store.getState()):u;this.store.setState(e,!0)}clearState(){this.setState(u=>({...u,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var u,e;this.connector&&await((e=(u=this.connector).disconnect)==null?void 0:e.call(u)),yc(this,Ia,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(X9(this,Ia))return;yc(this,Ia,!0),this.setState(t=>{var n;return{...t,status:(n=t.data)!=null&&n.account?"reconnecting":"connecting"}});const u=X9(this,x4)?[...this.connectors].sort(t=>t.id===X9(this,x4)?-1:1):this.connectors;let e=!1;for(const t of u){if(!t.ready||!t.isAuthorized||!await t.isAuthorized())continue;const r=await t.connect();this.setState(i=>({...i,connector:t,chains:t==null?void 0:t.chains,data:r,status:"connected"})),e=!0;break}return e||this.setState(t=>({...t,data:void 0,status:"disconnected"})),yc(this,Ia,!1),this.data}setConnectors(u){this.args={...this.args,connectors:u};const e=typeof u=="function"?u():u;e.forEach(t=>t.setStorage(this.args.storage)),this.setState(t=>({...t,connectors:e}))}getPublicClient({chainId:u}={}){let e=this.publicClients.get(-1);if(e&&(e==null?void 0:e.chain.id)===u||(e=this.publicClients.get(u??-1),e))return e;const{publicClient:t}=this.args;return e=typeof t=="function"?t({chainId:u}):t,this.publicClients.set(u??-1,e),e}setPublicClient(u){var t,n;const e=(n=(t=this.data)==null?void 0:t.chain)==null?void 0:n.id;this.args={...this.args,publicClient:u},this.publicClients.clear(),this.setState(r=>({...r,publicClient:this.getPublicClient({chainId:e})}))}getWebSocketPublicClient({chainId:u}={}){let e=this.webSocketPublicClients.get(-1);if(e&&(e==null?void 0:e.chain.id)===u||(e=this.webSocketPublicClients.get(u??-1),e))return e;const{webSocketPublicClient:t}=this.args;return e=typeof t=="function"?t({chainId:u}):t,e&&this.webSocketPublicClients.set(u??-1,e),e}setWebSocketPublicClient(u){var t,n;const e=(n=(t=this.data)==null?void 0:t.chain)==null?void 0:n.id;this.args={...this.args,webSocketPublicClient:u},this.webSocketPublicClients.clear(),this.setState(r=>({...r,webSocketPublicClient:this.getWebSocketPublicClient({chainId:e})}))}setLastUsedConnector(u=null){var e;(e=this.storage)==null||e.setItem("wallet",u)}};Ia=new WeakMap;x4=new WeakMap;Ef=new WeakSet;rD=function(){const u=o=>{this.setState(s=>({...s,data:{...s.data,...o}}))},e=()=>{this.clearState()},t=o=>{this.setState(s=>({...s,error:o}))};this.store.subscribe(({connector:o})=>o,(o,s)=>{var l,c,E,d,f,m;(l=s==null?void 0:s.off)==null||l.call(s,"change",u),(c=s==null?void 0:s.off)==null||c.call(s,"disconnect",e),(E=s==null?void 0:s.off)==null||E.call(s,"error",t),o&&((d=o.on)==null||d.call(o,"change",u),(f=o.on)==null||f.call(o,"disconnect",e),(m=o.on)==null||m.call(o,"error",t))});const{publicClient:n,webSocketPublicClient:r}=this.args;(typeof n=="function"||typeof r=="function")&&this.store.subscribe(({data:o})=>{var s;return(s=o==null?void 0:o.chain)==null?void 0:s.id},o=>{this.setState(s=>({...s,publicClient:this.getPublicClient({chainId:o}),webSocketPublicClient:this.getWebSocketPublicClient({chainId:o})}))})};var df;function Gj(u){const e=new Hj(u);return df=e,e}function G0(){if(!df)throw new Error("No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config");return df}async function Kj({chainId:u,connector:e}){const t=G0(),n=t.connector;if(n&&e.id===n.id)throw new jj;try{t.setState(i=>({...i,status:"connecting"}));const r=await e.connect({chainId:u});return t.setLastUsedConnector(e.id),t.setState(i=>({...i,connector:e,chains:e==null?void 0:e.chains,data:r,status:"connected"})),t.storage.setItem("connected",!0),{...r,connector:e}}catch(r){throw t.setState(i=>({...i,status:i.connector?"connected":"disconnected"})),r}}async function Qj(){const u=G0();u.connector&&await u.connector.disconnect(),u.clearState(),u.storage.removeItem("connected")}var Vj=[{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:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],Jj=[{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:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];function ht({chainId:u}={}){const e=G0();return u&&e.getPublicClient({chainId:u})||e.publicClient}async function c5({chainId:u}={}){var n,r;return await((r=(n=G0().connector)==null?void 0:n.getWalletClient)==null?void 0:r.call(n,{chainId:u}))||null}function ff({chainId:u}={}){const e=G0();return u&&e.getWebSocketPublicClient({chainId:u})||e.webSocketPublicClient}function Yj(u,e){const t=G0(),n=async()=>e(ht(u));return t.subscribe(({publicClient:i})=>i,n)}function Xj(u,e){const t=G0(),n=async()=>e(ff(u));return t.subscribe(({webSocketPublicClient:i})=>i,n)}async function Zj({abi:u,address:e,args:t,chainId:n,functionName:r,walletClient:i,...a}){const o=ht({chainId:n}),s=i??await c5({chainId:n});if(!s)throw new y0;n&&oD({chainId:n});const{account:l,accessList:c,blockNumber:E,blockTag:d,gas:f,gasPrice:m,maxFeePerGas:h,maxPriorityFeePerGas:B,nonce:g,value:C}=Lj(a),{result:y,request:v}=await o.simulateContract({abi:u,address:e,functionName:r,args:t,account:l||s.account,accessList:c,blockNumber:E,blockTag:d,gas:f,gasPrice:m,maxFeePerGas:h,maxPriorityFeePerGas:B,nonce:g,value:C}),w=u.filter(D=>"name"in D&&D.name===r);return{mode:"prepared",request:{...v,abi:w,chainId:n},result:y}}async function uz({chainId:u,contracts:e,blockNumber:t,blockTag:n,...r}){const i=ht({chainId:u});if(!i.chains)throw new zj;if(u&&i.chain.id!==u)throw new Rj({chainId:u});return i.multicall({allowFailure:r.allowFailure??!0,blockNumber:t,blockTag:n,contracts:e})}async function iD({address:u,account:e,chainId:t,abi:n,args:r,functionName:i,blockNumber:a,blockTag:o}){return ht({chainId:t}).readContract({abi:n,address:u,account:e,functionName:i,args:r,blockNumber:a,blockTag:o})}async function ez({contracts:u,blockNumber:e,blockTag:t,...n}){const{allowFailure:r=!0}=n;try{const i=ht(),a=u.reduce((c,E,d)=>{const f=E.chainId??i.chain.id;return{...c,[f]:[...c[f]||[],{contract:E,index:d}]}},{}),o=()=>Object.entries(a).map(([c,E])=>uz({allowFailure:r,chainId:parseInt(c),contracts:E.map(({contract:d})=>d),blockNumber:e,blockTag:t})),s=(await Promise.all(o())).flat(),l=Object.values(a).flatMap(c=>c.map(({index:E})=>E));return s.reduce((c,E,d)=>(c&&(c[l[d]]=E),c),[])}catch(i){if(i instanceof Lh)throw i;const a=()=>u.map(o=>iD({...o,blockNumber:e,blockTag:t}));return r?(await Promise.allSettled(a())).map(o=>o.status==="fulfilled"?{result:o.value,status:"success"}:{error:o.reason,result:void 0,status:"failure"}):await Promise.all(a())}}async function S8(u){const e=await c5({chainId:u.chainId});if(!e)throw new y0;u.chainId&&oD({chainId:u.chainId});let t;if(u.mode==="prepared")t=u.request;else{const{chainId:r,mode:i,...a}=u;t=(await Zj(a)).request}return{hash:await e.writeContract({...t,chain:u.chainId?{id:u.chainId}:null})}}async function tz({address:u,chainId:e,formatUnits:t,token:n}){const r=G0(),i=ht({chainId:e});if(n){const l=async({abi:c})=>{const E={abi:c,address:n,chainId:e},[d,f,m]=await ez({allowFailure:!1,contracts:[{...E,functionName:"balanceOf",args:[u]},{...E,functionName:"decimals"},{...E,functionName:"symbol"}]});return{decimals:f,formatted:ME(d??"0",w8(t??f)),symbol:m,value:d}};try{return await l({abi:Vj})}catch(c){if(c instanceof Lh){const{symbol:E,...d}=await l({abi:Jj});return{symbol:xh(Ji(E,{dir:"right"})),...d}}throw c}}const a=[...r.publicClient.chains||[],...r.chains??[]],o=await i.getBalance({address:u}),s=a.find(l=>l.id===i.chain.id);return{decimals:(s==null?void 0:s.nativeCurrency.decimals)??18,formatted:ME(o??"0",w8(t??18)),symbol:(s==null?void 0:s.nativeCurrency.symbol)??"ETH",value:o}}function aD(){const{data:u,connector:e,status:t}=G0();switch(t){case"connected":return{address:u==null?void 0:u.account,connector:e,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:t};case"reconnecting":return{address:u==null?void 0:u.account,connector:e,isConnected:!!(u!=null&&u.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:t};case"connecting":return{address:u==null?void 0:u.account,connector:e,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:t};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:t}}}function E5(){var r,i,a,o;const u=G0(),e=(i=(r=u.data)==null?void 0:r.chain)==null?void 0:i.id,t=u.chains??[],n=[...((a=u.publicClient)==null?void 0:a.chains)||[],...t].find(s=>s.id===e)??{id:e,name:`Chain ${e}`,network:`${e}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}};return{chain:e?{...n,...(o=u.data)==null?void 0:o.chain,id:e}:void 0,chains:t}}async function nz(u){const e=await c5();if(!e)throw new y0;return await e.signMessage({message:u.message})}async function rz({chainId:u}){const{connector:e}=G0();if(!e)throw new y0;if(!e.switchChain)throw new Mj({connector:e});return e.switchChain(u)}function iz(u,{selector:e=t=>t}={}){const t=G0(),n=()=>u(aD());return t.subscribe(({data:i,connector:a,status:o})=>e({address:i==null?void 0:i.account,connector:a,status:o}),n,{equalityFn:eD})}function az(u,{selector:e=t=>t}={}){const t=G0(),n=()=>u(E5());return t.subscribe(({data:i,chains:a})=>{var o;return e({chainId:(o=i==null?void 0:i.chain)==null?void 0:o.id,chains:a})},n,{equalityFn:eD})}async function oz({name:u,chainId:e}){const{normalize:t}=await Hu(()=>import("./index-b524cb51.js"),[]);return await ht({chainId:e}).getEnsAvatar({name:t(u)})}async function sz({address:u,chainId:e}){return ht({chainId:e}).getEnsName({address:e0(u)})}async function lz({chainId:u}={}){return await ht({chainId:u}).getBlockNumber()}async function cz({chainId:u,confirmations:e=1,hash:t,onReplaced:n,timeout:r=0}){const i=ht({chainId:u}),a=await i.waitForTransactionReceipt({hash:t,confirmations:e,onReplaced:n,timeout:r});if(a.status==="reverted"){const o=await i.getTransaction({hash:a.transactionHash}),s=await i.call({...o,gasPrice:o.type!=="eip1559"?o.gasPrice:void 0,maxFeePerGas:o.type==="eip1559"?o.maxFeePerGas:void 0,maxPriorityFeePerGas:o.type==="eip1559"?o.maxPriorityFeePerGas:void 0}),l=xh(`0x${s.substring(138)}`);throw new Error(l)}return a}function oD({chainId:u}){var r,i;const{chain:e,chains:t}=E5(),n=e==null?void 0:e.id;if(n&&u!==n)throw new Nj({activeChain:((r=t.find(a=>a.id===n))==null?void 0:r.name)??`Chain ${n}`,targetChain:((i=t.find(a=>a.id===u))==null?void 0:i.name)??`Chain ${u}`})}var sD={exports:{}},lD={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -156,5 +156,5 @@ PERFORMANCE OF THIS SOFTWARE. Required: ${a.toString()} Approved: ${o.toString()}`)),Object.keys(e).forEach(E=>{if(!E.includes(":")||n)return;const d=r4(e[E].accounts);d.includes(E)||(n=Cr("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${E} Required: ${E} - Approved: ${d.toString()}`))}),a.forEach(E=>{n||(wi(r[E].methods,i[E].methods)?wi(r[E].events,i[E].events)||(n=Cr("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${E}`)):n=Cr("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${E}`))}),n}function SEu(u){const e={};return Object.keys(u).forEach(t=>{var n;t.includes(":")?e[t]=u[t]:(n=u[t].chains)==null||n.forEach(r=>{e[r]={methods:u[t].methods,events:u[t].events}})}),e}function QA(u){return[...new Set(u.map(e=>e.includes(":")?e.split(":")[0]:e))]}function PEu(u){const e={};return Object.keys(u).forEach(t=>{if(t.includes(":"))e[t]=u[t];else{const n=r4(u[t].accounts);n==null||n.forEach(r=>{e[r]={accounts:u[t].accounts.filter(i=>i.includes(`${r}:`)),methods:u[t].methods,events:u[t].events}})}}),e}function hfu(u,e){return lC(u,!1)&&u<=e.max&&u>=e.min}function Cfu(){const u=Vl();return new Promise(e=>{switch(u){case U0.browser:e(TEu());break;case U0.reactNative:e(IEu());break;case U0.node:e(OEu());break;default:e(!0)}})}function TEu(){return oC()&&(navigator==null?void 0:navigator.onLine)}async function IEu(){if(aC()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo){const u=await(globalThis==null?void 0:globalThis.NetInfo.fetch());return u==null?void 0:u.isConnected}return!0}function OEu(){return!0}function mfu(u){switch(Vl()){case U0.browser:NEu(u);break;case U0.reactNative:REu(u);break}}function NEu(u){oC()&&(window.addEventListener("online",()=>u(!0)),window.addEventListener("offline",()=>u(!1)))}function REu(u){aC()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo&&(globalThis==null||globalThis.NetInfo.addEventListener(e=>u(e==null?void 0:e.isConnected)))}const _1={};class gfu{static get(e){return _1[e]}static set(e,t){_1[e]=t}static delete(e){delete _1[e]}}var Fx="eip155",jEu="store",Dx="requestedChains",$f="wallet_addEthereumChain",Ee,Y4,Zc,Wf,cC,bx,uE,qf,Hf,wx,a2,EC,Ra,_4,o2,dC,s2,fC,l2,pC,xx=class extends Il{constructor(u){super({...u,options:{isNewChainsStale:!0,...u.options}}),we(this,Zc),we(this,cC),we(this,uE),we(this,Hf),we(this,a2),we(this,Ra),we(this,o2),we(this,s2),we(this,l2),this.id="walletConnect",this.name="WalletConnect",this.ready=!0,we(this,Ee,void 0),we(this,Y4,void 0),this.onAccountsChanged=e=>{e.length===0?this.emit("disconnect"):this.emit("change",{account:e0(e[0])})},this.onChainChanged=e=>{const t=Number(e),n=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:n}})},this.onDisconnect=()=>{De(this,Ra,_4).call(this,[]),this.emit("disconnect")},this.onDisplayUri=e=>{this.emit("message",{type:"display_uri",data:e})},this.onConnect=()=>{this.emit("connect",{})},De(this,Zc,Wf).call(this)}async connect({chainId:u,pairingTopic:e}={}){var t,n,r,i,a;try{let o=u;if(!o){const m=(t=this.storage)==null?void 0:t.getItem(jEu),h=(i=(r=(n=m==null?void 0:m.state)==null?void 0:n.data)==null?void 0:r.chain)==null?void 0:i.id;h&&!this.isChainUnsupported(h)?o=h:o=(a=this.chains[0])==null?void 0:a.id}if(!o)throw new Error("No chains found on connector.");const s=await this.getProvider();De(this,Hf,wx).call(this);const l=De(this,uE,qf).call(this);if(s.session&&l&&await s.disconnect(),!s.session||l){const m=this.chains.filter(h=>h.id!==o).map(h=>h.id);this.emit("message",{type:"connecting"}),await s.connect({pairingTopic:e,chains:[o],optionalChains:m.length?m:void 0}),De(this,Ra,_4).call(this,this.chains.map(({id:h})=>h))}const c=await s.enable(),E=e0(c[0]),d=await this.getChainId(),f=this.isChainUnsupported(d);return{account:E,chain:{id:d,unsupported:f}}}catch(o){throw/user rejected/i.test(o==null?void 0:o.message)?new _e(o):o}}async disconnect(){const u=await this.getProvider();try{await u.disconnect()}catch(e){if(!/No matching key/i.test(e.message))throw e}finally{De(this,a2,EC).call(this),De(this,Ra,_4).call(this,[])}}async getAccount(){const{accounts:u}=await this.getProvider();return e0(u[0])}async getChainId(){const{chainId:u}=await this.getProvider();return u}async getProvider({chainId:u}={}){return Wu(this,Ee)||await De(this,Zc,Wf).call(this),u&&await this.switchChain(u),Wu(this,Ee)}async getWalletClient({chainId:u}={}){const[e,t]=await Promise.all([this.getProvider({chainId:u}),this.getAccount()]),n=this.chains.find(r=>r.id===u);if(!e)throw new Error("provider is required.");return Tl({account:t,chain:n,transport:Sl(e)})}async isAuthorized(){try{const[u,e]=await Promise.all([this.getAccount(),this.getProvider()]),t=De(this,uE,qf).call(this);if(!u)return!1;if(t&&e.session){try{await e.disconnect()}catch{}return!1}return!0}catch{return!1}}async switchChain(u){var t,n;const e=this.chains.find(r=>r.id===u);if(!e)throw new En(new Error("chain not found on connector."));try{const r=await this.getProvider(),i=De(this,s2,fC).call(this),a=De(this,l2,pC).call(this);if(!i.includes(u)&&a.includes($f)){await r.request({method:$f,params:[{chainId:zu(e.id),blockExplorerUrls:[(n=(t=e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url],chainName:e.name,nativeCurrency:e.nativeCurrency,rpcUrls:[...e.rpcUrls.default.http]}]});const s=De(this,o2,dC).call(this);s.push(u),De(this,Ra,_4).call(this,s)}return await r.request({method:"wallet_switchEthereumChain",params:[{chainId:zu(u)}]}),e}catch(r){const i=typeof r=="string"?r:r==null?void 0:r.message;throw/user rejected request/i.test(i)?new _e(r):new En(r)}}};Ee=new WeakMap;Y4=new WeakMap;Zc=new WeakSet;Wf=async function(){return!Wu(this,Y4)&&typeof window<"u"&&Jn(this,Y4,De(this,cC,bx).call(this)),Wu(this,Y4)};cC=new WeakSet;bx=async function(){const{EthereumProvider:u,OPTIONAL_EVENTS:e,OPTIONAL_METHODS:t}=await Hu(()=>import("./index.es-cccc293a.js"),["assets/index.es-cccc293a.js","assets/events-db1d9fc4.js","assets/http-d435a746.js"]),[n,...r]=this.chains.map(({id:i})=>i);if(n){const{projectId:i,showQrModal:a=!0,qrModalOptions:o,metadata:s,relayUrl:l}=this.options;Jn(this,Ee,await u.init({showQrModal:a,qrModalOptions:o,projectId:i,optionalMethods:t,optionalEvents:e,chains:[n],optionalChains:r.length?r:void 0,rpcMap:Object.fromEntries(this.chains.map(c=>[c.id,c.rpcUrls.default.http[0]])),metadata:s,relayUrl:l}))}};uE=new WeakSet;qf=function(){if(De(this,l2,pC).call(this).includes($f)||!this.options.isNewChainsStale)return!1;const e=De(this,o2,dC).call(this),t=this.chains.map(({id:r})=>r),n=De(this,s2,fC).call(this);return n.length&&!n.some(r=>t.includes(r))?!1:!t.every(r=>e.includes(r))};Hf=new WeakSet;wx=function(){Wu(this,Ee)&&(De(this,a2,EC).call(this),Wu(this,Ee).on("accountsChanged",this.onAccountsChanged),Wu(this,Ee).on("chainChanged",this.onChainChanged),Wu(this,Ee).on("disconnect",this.onDisconnect),Wu(this,Ee).on("session_delete",this.onDisconnect),Wu(this,Ee).on("display_uri",this.onDisplayUri),Wu(this,Ee).on("connect",this.onConnect))};a2=new WeakSet;EC=function(){Wu(this,Ee)&&(Wu(this,Ee).removeListener("accountsChanged",this.onAccountsChanged),Wu(this,Ee).removeListener("chainChanged",this.onChainChanged),Wu(this,Ee).removeListener("disconnect",this.onDisconnect),Wu(this,Ee).removeListener("session_delete",this.onDisconnect),Wu(this,Ee).removeListener("display_uri",this.onDisplayUri),Wu(this,Ee).removeListener("connect",this.onConnect))};Ra=new WeakSet;_4=function(u){var e;(e=this.storage)==null||e.setItem(Dx,u)};o2=new WeakSet;dC=function(){var u;return((u=this.storage)==null?void 0:u.getItem(Dx))??[]};s2=new WeakSet;fC=function(){var n,r,i;if(!Wu(this,Ee))return[];const u=(n=Wu(this,Ee).session)==null?void 0:n.namespaces;return u?((i=(r=Bx(u)[Fx])==null?void 0:r.chains)==null?void 0:i.map(a=>parseInt(a.split(":")[1]||"")))??[]:[]};l2=new WeakSet;pC=function(){var n,r;if(!Wu(this,Ee))return[];const u=(n=Wu(this,Ee).session)==null?void 0:n.namespaces;return u?((r=Bx(u)[Fx])==null?void 0:r.methods)??[]:[]};var S4,ja,zEu=class extends Il{constructor({chains:u,options:e}){super({chains:u,options:{reloadOnDisconnect:!1,...e}}),this.id="coinbaseWallet",this.name="Coinbase Wallet",this.ready=!0,we(this,S4,void 0),we(this,ja,void 0),this.onAccountsChanged=t=>{t.length===0?this.emit("disconnect"):this.emit("change",{account:e0(t[0])})},this.onChainChanged=t=>{const n=la(t),r=this.isChainUnsupported(n);this.emit("change",{chain:{id:n,unsupported:r}})},this.onDisconnect=()=>{this.emit("disconnect")}}async connect({chainId:u}={}){try{const e=await this.getProvider();e.on("accountsChanged",this.onAccountsChanged),e.on("chainChanged",this.onChainChanged),e.on("disconnect",this.onDisconnect),this.emit("message",{type:"connecting"});const t=await e.enable(),n=e0(t[0]);let r=await this.getChainId(),i=this.isChainUnsupported(r);return u&&r!==u&&(r=(await this.switchChain(u)).id,i=this.isChainUnsupported(r)),{account:n,chain:{id:r,unsupported:i}}}catch(e){throw/(user closed modal|accounts received is empty)/i.test(e.message)?new _e(e):e}}async disconnect(){if(!Wu(this,ja))return;const u=await this.getProvider();u.removeListener("accountsChanged",this.onAccountsChanged),u.removeListener("chainChanged",this.onChainChanged),u.removeListener("disconnect",this.onDisconnect),u.disconnect(),u.close()}async getAccount(){const e=await(await this.getProvider()).request({method:"eth_accounts"});return e0(e[0])}async getChainId(){const u=await this.getProvider();return la(u.chainId)}async getProvider(){var u;if(!Wu(this,ja)){let e=(await Hu(()=>import("./index-cdc342c4.js").then(a=>a.i),["assets/index-cdc342c4.js","assets/events-db1d9fc4.js","assets/hooks.module-fb90a505.js"])).default;typeof e!="function"&&typeof e.default=="function"&&(e=e.default),Jn(this,S4,new e(this.options));const t=(u=Wu(this,S4).walletExtension)==null?void 0:u.getChainId(),n=this.chains.find(a=>this.options.chainId?a.id===this.options.chainId:a.id===t)||this.chains[0],r=this.options.chainId||(n==null?void 0:n.id),i=this.options.jsonRpcUrl||(n==null?void 0:n.rpcUrls.default.http[0]);Jn(this,ja,Wu(this,S4).makeWeb3Provider(i,r))}return Wu(this,ja)}async getWalletClient({chainId:u}={}){const[e,t]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find(r=>r.id===u);if(!e)throw new Error("provider is required.");return Tl({account:t,chain:n,transport:Sl(e)})}async isAuthorized(){try{return!!await this.getAccount()}catch{return!1}}async switchChain(u){var n;const e=await this.getProvider(),t=zu(u);try{return await e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]}),this.chains.find(r=>r.id===u)??{id:u,name:`Chain ${t}`,network:`${t}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(r){const i=this.chains.find(a=>a.id===u);if(!i)throw new ZF({chainId:u,connectorId:this.id});if(r.code===4902)try{return await e.request({method:"wallet_addEthereumChain",params:[{chainId:t,chainName:i.name,nativeCurrency:i.nativeCurrency,rpcUrls:[((n=i.rpcUrls.public)==null?void 0:n.http[0])??""],blockExplorerUrls:this.getBlockExplorerUrls(i)}]}),i}catch(a){throw new _e(a)}throw new En(r)}}async watchAsset({address:u,decimals:e=18,image:t,symbol:n}){return(await this.getProvider()).request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:u,decimals:e,image:t,symbol:n}}})}};S4=new WeakMap;ja=new WeakMap;var eE,MEu=class extends As{constructor({chains:u,options:e}={}){const t={name:"MetaMask",shimDisconnect:!0,getProvider(){function n(i){if(i!=null&&i.isMetaMask&&!(i.isBraveWallet&&!i._events&&!i._state)&&!i.isApexWallet&&!i.isAvalanche&&!i.isBitKeep&&!i.isBlockWallet&&!i.isCoin98&&!i.isFordefi&&!i.isMathWallet&&!(i.isOkxWallet||i.isOKExWallet)&&!(i.isOneInchIOSWallet||i.isOneInchAndroidWallet)&&!i.isOpera&&!i.isPortal&&!i.isRabby&&!i.isDefiant&&!i.isTokenPocket&&!i.isTokenary&&!i.isZeal&&!i.isZerion)return i}if(typeof window>"u")return;const r=window.ethereum;return r!=null&&r.providers?r.providers.find(n):n(r)},...e};super({chains:u,options:t}),this.id="metaMask",this.shimDisconnectKey=`${this.id}.shimDisconnect`,we(this,eE,void 0),Jn(this,eE,t.UNSTABLE_shimOnConnectSelectAccount)}async connect({chainId:u}={}){var e,t,n,r;try{const i=await this.getProvider();if(!i)throw new y0;i.on&&(i.on("accountsChanged",this.onAccountsChanged),i.on("chainChanged",this.onChainChanged),i.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});let a=null;if(Wu(this,eE)&&((e=this.options)!=null&&e.shimDisconnect)&&!((t=this.storage)!=null&&t.getItem(this.shimDisconnectKey))&&(a=await this.getAccount().catch(()=>null),!!a))try{await i.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}),a=await this.getAccount()}catch(c){if(this.isUserRejectedRequestError(c))throw new _e(c);if(c.code===new Qr(c).code)throw c}if(!a){const l=await i.request({method:"eth_requestAccounts"});a=e0(l[0])}let o=await this.getChainId(),s=this.isChainUnsupported(o);return u&&o!==u&&(o=(await this.switchChain(u)).id,s=this.isChainUnsupported(o)),(n=this.options)!=null&&n.shimDisconnect&&((r=this.storage)==null||r.setItem(this.shimDisconnectKey,!0)),{account:a,chain:{id:o,unsupported:s},provider:i}}catch(i){throw this.isUserRejectedRequestError(i)?new _e(i):i.code===-32002?new Qr(i):i}}};eE=new WeakMap;var UEu=/(imtoken|metamask|rainbow|trust wallet|uniswap wallet|ledger)/i,Ci,Gf,kx,LEu=class extends Il{constructor(){super(...arguments),we(this,Gf),this.id="walletConnectLegacy",this.name="WalletConnectLegacy",this.ready=!0,we(this,Ci,void 0),this.onAccountsChanged=u=>{u.length===0?this.emit("disconnect"):this.emit("change",{account:e0(u[0])})},this.onChainChanged=u=>{const e=la(u),t=this.isChainUnsupported(e);this.emit("change",{chain:{id:e,unsupported:t}})},this.onDisconnect=()=>{this.emit("disconnect")}}async connect({chainId:u}={}){var e,t,n,r,i,a;try{let o=u;if(!o){const m=(e=this.storage)==null?void 0:e.getItem("store"),h=(r=(n=(t=m==null?void 0:m.state)==null?void 0:t.data)==null?void 0:n.chain)==null?void 0:r.id;h&&!this.isChainUnsupported(h)&&(o=h)}const s=await this.getProvider({chainId:o,create:!0});s.on("accountsChanged",this.onAccountsChanged),s.on("chainChanged",this.onChainChanged),s.on("disconnect",this.onDisconnect),setTimeout(()=>this.emit("message",{type:"connecting"}),0);const l=await s.enable(),c=e0(l[0]),E=await this.getChainId(),d=this.isChainUnsupported(E),f=((a=(i=s.connector)==null?void 0:i.peerMeta)==null?void 0:a.name)??"";return UEu.test(f)&&(this.switchChain=De(this,Gf,kx)),{account:c,chain:{id:E,unsupported:d}}}catch(o){throw/user closed modal/i.test(o.message)?new _e(o):o}}async disconnect(){const u=await this.getProvider();await u.disconnect(),u.removeListener("accountsChanged",this.onAccountsChanged),u.removeListener("chainChanged",this.onChainChanged),u.removeListener("disconnect",this.onDisconnect),typeof localStorage<"u"&&localStorage.removeItem("walletconnect")}async getAccount(){const e=(await this.getProvider()).accounts;return e0(e[0])}async getChainId(){const u=await this.getProvider();return la(u.chainId)}async getProvider({chainId:u,create:e}={}){var t,n;if(!Wu(this,Ci)||u||e){const r=(t=this.options)!=null&&t.infuraId?{}:this.chains.reduce((a,o)=>({...a,[o.id]:o.rpcUrls.default.http[0]}),{}),i=(await Hu(()=>import("./index-70641c6b.js"),["assets/index-70641c6b.js","assets/events-db1d9fc4.js","assets/http-d435a746.js","assets/hooks.module-fb90a505.js"])).default;Jn(this,Ci,new i({...this.options,chainId:u,rpc:{...r,...(n=this.options)==null?void 0:n.rpc}})),Wu(this,Ci).http=await Wu(this,Ci).setHttpProvider(u)}return Wu(this,Ci)}async getWalletClient({chainId:u}={}){const[e,t]=await Promise.all([this.getProvider({chainId:u}),this.getAccount()]),n=this.chains.find(r=>r.id===u);if(!e)throw new Error("provider is required.");return Tl({account:t,chain:n,transport:Sl(e)})}async isAuthorized(){try{return!!await this.getAccount()}catch{return!1}}};Ci=new WeakMap;Gf=new WeakSet;kx=async function(u){const e=await this.getProvider(),t=zu(u);try{return await Promise.race([e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]}),new Promise(n=>this.on("change",({chain:r})=>{(r==null?void 0:r.id)===u&&n(u)}))]),this.chains.find(n=>n.id===u)??{id:u,name:`Chain ${t}`,network:`${t}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(n){const r=typeof n=="string"?n:n==null?void 0:n.message;throw/user rejected request/i.test(r)?new _e(n):new En(n)}};var P4,T4,$Eu=class extends Il{constructor({chains:u,options:e}){const t={shimDisconnect:!1,...e};super({chains:u,options:t}),this.id="safe",this.name="Safe",this.ready=!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,we(this,P4,void 0),we(this,T4,void 0),this.shimDisconnectKey=`${this.id}.shimDisconnect`;let n=Zl;typeof Zl!="function"&&typeof Zl.default=="function"&&(n=Zl.default),Jn(this,T4,new n(t))}async connect(){var n;const u=await this.getProvider();if(!u)throw new y0;u.on&&(u.on("accountsChanged",this.onAccountsChanged),u.on("chainChanged",this.onChainChanged),u.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});const e=await this.getAccount(),t=await this.getChainId();return this.options.shimDisconnect&&((n=this.storage)==null||n.setItem(this.shimDisconnectKey,!0)),{account:e,chain:{id:t,unsupported:this.isChainUnsupported(t)}}}async disconnect(){var e;const u=await this.getProvider();u!=null&&u.removeListener&&(u.removeListener("accountsChanged",this.onAccountsChanged),u.removeListener("chainChanged",this.onChainChanged),u.removeListener("disconnect",this.onDisconnect),this.options.shimDisconnect&&((e=this.storage)==null||e.removeItem(this.shimDisconnectKey)))}async getAccount(){const u=await this.getProvider();if(!u)throw new y0;const e=await u.request({method:"eth_accounts"});return e0(e[0])}async getChainId(){const u=await this.getProvider();if(!u)throw new y0;return la(u.chainId)}async getProvider(){if(!Wu(this,P4)){const u=await Wu(this,T4).safe.getInfo();if(!u)throw new Error("Could not load Safe information");Jn(this,P4,new C_(u,Wu(this,T4)))}return Wu(this,P4)}async getWalletClient({chainId:u}={}){const e=await this.getProvider(),t=await this.getAccount(),n=this.chains.find(r=>r.id===u);if(!e)throw new Error("provider is required.");return Tl({account:t,chain:n,transport:Sl(e)})}async isAuthorized(){var u;try{return this.options.shimDisconnect&&!((u=this.storage)!=null&&u.getItem(this.shimDisconnectKey))?!1:!!await this.getAccount()}catch{return!1}}onAccountsChanged(u){}onChainChanged(u){}onDisconnect(){this.emit("disconnect")}};P4=new WeakMap;T4=new WeakMap;function WEu(u){return Object.fromEntries(Object.entries(u).filter(([e,t])=>t!==void 0))}var qEu=u=>()=>{let e=-1;const t=[],n=[],r=[],i=[];return u.forEach(({groupName:o,wallets:s},l)=>{s.forEach(c=>{if(e++,c!=null&&c.iconAccent&&!f4u(c==null?void 0:c.iconAccent))throw new Error(`Property \`iconAccent\` is not a hex value for wallet: ${c.name}`);const E={...c,groupIndex:l,groupName:o,index:e};typeof c.hidden=="function"?r.push(E):n.push(E)})}),[...n,...r].forEach(({createConnector:o,groupIndex:s,groupName:l,hidden:c,index:E,...d})=>{if(typeof c=="function"&&c({wallets:[...i.map(({connector:C,id:y,installed:v,name:w})=>({connector:C,id:y,installed:v,name:w}))]}))return;const{connector:f,...m}=WEu(o());let h;if(d.id==="walletConnect"&&m.qrCode&&!qe()){const{chains:g,options:C}=f;h=new xx({chains:g,options:{...C,showQrModal:!0}}),t.push(h)}const B={connector:f,groupIndex:s,groupName:l,index:E,walletConnectModalConnector:h,...d,...m};i.push(B),t.includes(f)||(t.push(f),f._wallets=[]),f._wallets.push(B)}),t},HEu=({chains:u,...e})=>{var t;return{id:"brave",name:"Brave Wallet",iconUrl:async()=>(await Hu(()=>import("./braveWallet-BTBH4MDN-77ab02b2.js"),[])).default,iconBackground:"#fff",installed:typeof window<"u"&&((t=window.ethereum)==null?void 0:t.isBraveWallet)===!0,downloadUrls:{},createConnector:()=>({connector:new As({chains:u,options:e})})}},GEu=({appName:u,chains:e,...t})=>{var n;const r=typeof window<"u"&&((n=window.ethereum)==null?void 0:n.isCoinbaseWallet)===!0;return{id:"coinbase",name:"Coinbase Wallet",shortName:"Coinbase",iconUrl:async()=>(await Hu(()=>import("./coinbaseWallet-2OUR5TUP-f6c629ff.js"),[])).default,iconAccent:"#2c5ff6",iconBackground:"#2c5ff6",installed:r||void 0,downloadUrls:{android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/us/app/coinbase-wallet-store-crypto/id1278383455",mobile:"https://coinbase.com/wallet/downloads",qrCode:"https://coinbase-wallet.onelink.me/q5Sx/fdb9b250",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad",browserExtension:"https://coinbase.com/wallet"},createConnector:()=>{const i=Ba(),a=new zEu({chains:e,options:{appName:u,headlessMode:!0,...t}});return{connector:a,...i?{}:{qrCode:{getUri:async()=>(await a.getProvider()).qrUrl,instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-mobile",steps:[{description:"wallet_connectors.coinbase.qr_code.step1.description",step:"install",title:"wallet_connectors.coinbase.qr_code.step1.title"},{description:"wallet_connectors.coinbase.qr_code.step2.description",step:"create",title:"wallet_connectors.coinbase.qr_code.step2.title"},{description:"wallet_connectors.coinbase.qr_code.step3.description",step:"scan",title:"wallet_connectors.coinbase.qr_code.step3.title"}]}},extension:{instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-extension",steps:[{description:"wallet_connectors.coinbase.extension.step1.description",step:"install",title:"wallet_connectors.coinbase.extension.step1.title"},{description:"wallet_connectors.coinbase.extension.step2.description",step:"create",title:"wallet_connectors.coinbase.extension.step2.title"},{description:"wallet_connectors.coinbase.extension.step3.description",step:"refresh",title:"wallet_connectors.coinbase.extension.step3.title"}]}}}}}}},KEu=({chains:u,...e})=>({id:"injected",name:"Browser Wallet",iconUrl:async()=>(await Hu(()=>import("./injectedWallet-EUKDEAIU-b2513a2e.js"),[])).default,iconBackground:"#fff",hidden:({wallets:t})=>t.some(n=>n.installed&&n.name===n.connector.name&&(n.connector instanceof As||n.id==="coinbase")),createConnector:()=>({connector:new As({chains:u,options:e})})});async function hC(u,e){const t=await u.getProvider();return e==="2"?new Promise(n=>t.once("display_uri",n)):t.connector.uri}var _x=new Map;function QEu(u,e){const t=u==="1"?new LEu(e):new xx(e);return _x.set(JSON.stringify(e),t),t}function c2({chains:u,options:e={},projectId:t,version:n="2"}){const r="21fef48091f12692cad574a6f7753643";if(n==="2"){if(!t||t==="")throw new Error("No projectId found. Every dApp must now provide a WalletConnect Cloud projectId to enable WalletConnect v2 https://www.rainbowkit.com/docs/installation#configure");(t==="YOUR_PROJECT_ID"||t===r)&&console.warn("Invalid projectId. Please create a unique WalletConnect Cloud projectId for your dApp https://www.rainbowkit.com/docs/installation#configure")}const i={chains:u,options:n==="1"?{qrcode:!1,...e}:{projectId:t==="YOUR_PROJECT_ID"?r:t,showQrModal:!1,...e}},a=JSON.stringify(i),o=_x.get(a);return o??QEu(n,i)}function VA(u){return!(!(u!=null&&u.isMetaMask)||u.isBraveWallet&&!u._events&&!u._state||u.isApexWallet||u.isAvalanche||u.isBackpack||u.isBifrost||u.isBitKeep||u.isBitski||u.isBlockWallet||u.isCoinbaseWallet||u.isDawn||u.isEnkrypt||u.isExodus||u.isFrame||u.isFrontier||u.isGamestop||u.isHyperPay||u.isImToken||u.isKuCoinWallet||u.isMathWallet||u.isOkxWallet||u.isOKExWallet||u.isOneInchIOSWallet||u.isOneInchAndroidWallet||u.isOpera||u.isPhantom||u.isPortal||u.isRabby||u.isRainbow||u.isStatus||u.isTalisman||u.isTally||u.isTokenPocket||u.isTokenary||u.isTrust||u.isTrustWallet||u.isXDEFI||u.isZerion)}var VEu=({chains:u,projectId:e,walletConnectOptions:t,walletConnectVersion:n="2",...r})=>{var i,a;const o=typeof window<"u"&&((i=window.ethereum)==null?void 0:i.providers),s=typeof window<"u"&&typeof window.ethereum<"u"&&(((a=window.ethereum.providers)==null?void 0:a.some(VA))||window.ethereum.isMetaMask),l=!s;return{id:"metaMask",name:"MetaMask",iconUrl:async()=>(await Hu(()=>import("./metaMaskWallet-ORHUNQRP-ac2ea8b3.js"),[])).default,iconAccent:"#f6851a",iconBackground:"#fff",installed:l?void 0:s,downloadUrls:{android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/us/app/metamask/id1438144202",mobile:"https://metamask.io/download",qrCode:"https://metamask.io/download",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask",opera:"https://addons.opera.com/extensions/details/metamask-10",browserExtension:"https://metamask.io/download"},createConnector:()=>{const c=l?c2({projectId:e,chains:u,version:n,options:t}):new MEu({chains:u,options:{getProvider:()=>o?o.find(VA):typeof window<"u"?window.ethereum:void 0,...r}}),E=async()=>{const d=await hC(c,n);return U5()?d:Ba()?`metamask://wc?uri=${encodeURIComponent(d)}`:`https://metamask.app.link/wc?uri=${encodeURIComponent(d)}`};return{connector:c,mobile:{getUri:l?E:void 0},qrCode:l?{getUri:E,instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.qr_code.step1.description",step:"install",title:"wallet_connectors.metamask.qr_code.step1.title"},{description:"wallet_connectors.metamask.qr_code.step2.description",step:"create",title:"wallet_connectors.metamask.qr_code.step2.title"},{description:"wallet_connectors.metamask.qr_code.step3.description",step:"refresh",title:"wallet_connectors.metamask.qr_code.step3.title"}]}}:void 0,extension:{instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.extension.step1.description",step:"install",title:"wallet_connectors.metamask.extension.step1.title"},{description:"wallet_connectors.metamask.extension.step2.description",step:"create",title:"wallet_connectors.metamask.extension.step2.title"},{description:"wallet_connectors.metamask.extension.step3.description",step:"refresh",title:"wallet_connectors.metamask.extension.step3.title"}]}}}}}};function Sx(u){if(typeof window>"u"||typeof window.ethereum>"u")return;const e=window.ethereum.providers;return e?e.find(t=>t[u]):window.ethereum[u]?window.ethereum:void 0}function JEu(u){return!!Sx(u)}function YEu(u){if(typeof window>"u"||typeof window.ethereum>"u")return;const e=window.ethereum.providers,t=Sx(u);return t||(typeof e<"u"&&e.length>0?e[0]:window.ethereum)}function XEu({chains:u,flag:e,options:t}){return new As({chains:u,options:{getProvider:()=>YEu(e),...t}})}var ZEu=({chains:u,projectId:e,walletConnectOptions:t,walletConnectVersion:n="2",...r})=>{const i=JEu("isRainbow"),a=!i;return{id:"rainbow",name:"Rainbow",iconUrl:async()=>(await Hu(()=>import("./rainbowWallet-GGU64QEI-80e56a37.js"),[])).default,iconBackground:"#0c2f78",installed:a?void 0:i,downloadUrls:{android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",ios:"https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",mobile:"https://rainbow.download?utm_source=rainbowkit",qrCode:"https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",browserExtension:"https://rainbow.me/extension?utm_source=rainbowkit"},createConnector:()=>{const o=a?c2({projectId:e,chains:u,version:n,options:t}):XEu({flag:"isRainbow",chains:u,options:r}),s=async()=>{const l=await hC(o,n);return U5()?l:Ba()?`rainbow://wc?uri=${encodeURIComponent(l)}&connector=rainbowkit`:`https://rnbwapp.com/wc?uri=${encodeURIComponent(l)}&connector=rainbowkit`};return{connector:o,mobile:{getUri:a?s:void 0},qrCode:a?{getUri:s,instructions:{learnMoreUrl:"https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",steps:[{description:"wallet_connectors.rainbow.qr_code.step1.description",step:"install",title:"wallet_connectors.rainbow.qr_code.step1.title"},{description:"wallet_connectors.rainbow.qr_code.step2.description",step:"create",title:"wallet_connectors.rainbow.qr_code.step2.title"},{description:"wallet_connectors.rainbow.qr_code.step3.description",step:"scan",title:"wallet_connectors.rainbow.qr_code.step3.title"}]}}:void 0}}}},u2u=({chains:u,...e})=>({id:"safe",name:"Safe",iconAccent:"#12ff80",iconBackground:"#fff",iconUrl:async()=>(await Hu(()=>import("./safeWallet-DFMLSLCR-bb33abc9.js"),[])).default,installed:!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,downloadUrls:{},createConnector:()=>({connector:new $Eu({chains:u,options:e})})}),e2u=({chains:u,options:e,projectId:t,version:n="2"})=>({id:"walletConnect",name:"WalletConnect",iconUrl:async()=>(await Hu(()=>import("./walletConnectWallet-D6ZADJM7-c1d5c644.js"),[])).default,iconBackground:"#3b99fc",createConnector:()=>{const r=Ba(),i=c2(n==="1"?{version:"1",chains:u,options:{qrcode:r,...e}}:{version:"2",chains:u,projectId:t,options:{showQrModal:r,...e}}),a=async()=>hC(i,n);return{connector:i,...r?{}:{mobile:{getUri:a},qrCode:{getUri:a}}}}}),t2u=({appName:u,chains:e,projectId:t})=>{const n=[{groupName:"Popular",wallets:[KEu({chains:e}),u2u({chains:e}),ZEu({chains:e,projectId:t}),GEu({appName:u,chains:e}),VEu({chains:e,projectId:t}),e2u({chains:e,projectId:t}),HEu({chains:e})]}];return{connectors:qEu(n),wallets:n}};var Px,JA=Ov;Px=JA.createRoot,JA.hydrateRoot;const Nn={1:"0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2",5:"0x1df10ec981ac5871240be4a94f250dd238b77901",10:"0x1df10ec981ac5871240be4a94f250dd238b77901",56:"0x1df10ec981ac5871240be4a94f250dd238b77901",137:"0x1df10ec981ac5871240be4a94f250dd238b77901",250:"0x1df10ec981ac5871240be4a94f250dd238b77901",288:"0x1df10ec981ac5871240be4a94f250dd238b77901",324:"0x1df10ec981ac5871240be4a94f250dd238b77901",420:"0x1df10ec981ac5871240be4a94f250dd238b77901",42161:"0x1df10ec981ac5871240be4a94f250dd238b77901",80001:"0x1df10ec981ac5871240be4a94f250dd238b77901",421613:"0x1df10ec981ac5871240be4a94f250dd238b77901"};var n2u="0.9.10",At=class Kf extends Error{constructor(e,t={}){var a;const n=t.cause instanceof Kf?t.cause.details:(a=t.cause)!=null&&a.message?t.cause.message:t.details,r=t.cause instanceof Kf&&t.cause.docsPath||t.docsPath,i=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${n2u}`].join(` -`);super(i),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=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}};function si(u,e){const t=u.exec(e);return t==null?void 0:t.groups}var Tx=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ix=/^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)?$/,Ox=/^\(.+?\).*?$/,YA=/^tuple(?(\[(\d*)\])*)$/;function Qf(u){let e=u.type;if(YA.test(u.type)&&"components"in u){e="(";const t=u.components.length;for(let r=0;r[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function i2u(u){return Nx.test(u)}function a2u(u){return si(Nx,u)}var Rx=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function o2u(u){return Rx.test(u)}function s2u(u){return si(Rx,u)}var jx=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function l2u(u){return jx.test(u)}function c2u(u){return si(jx,u)}var zx=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function Mx(u){return zx.test(u)}function E2u(u){return si(zx,u)}var Ux=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function d2u(u){return Ux.test(u)}function f2u(u){return si(Ux,u)}var p2u=/^fallback\(\)$/;function h2u(u){return p2u.test(u)}var C2u=/^receive\(\) external payable$/;function m2u(u){return C2u.test(u)}var g2u=new Set(["indexed"]),Vf=new Set(["calldata","memory","storage"]),A2u=class extends At{constructor({type:u}){super("Unknown type.",{metaMessages:[`Type "${u}" 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"})}},y2u=class extends At{constructor({type:u}){super("Unknown type.",{metaMessages:[`Type "${u}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}},B2u=class extends At{constructor({param:u}){super("Invalid ABI parameter.",{details:u}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},v2u=class extends At{constructor({param:u,name:e}){super("Invalid ABI parameter.",{details:u,metaMessages:[`"${e}" 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"})}},F2u=class extends At{constructor({param:u,type:e,modifier:t}){super("Invalid ABI parameter.",{details:u,metaMessages:[`Modifier "${t}" not allowed${e?` in "${e}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},D2u=class extends At{constructor({param:u,type:e,modifier:t}){super("Invalid ABI parameter.",{details:u,metaMessages:[`Modifier "${t}" not allowed${e?` in "${e}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${t}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},b2u=class extends At{constructor({abiParameter:u}){super("Invalid ABI parameter.",{details:JSON.stringify(u,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}},I4=class extends At{constructor({signature:u,type:e}){super(`Invalid ${e} signature.`,{details:u}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},w2u=class extends At{constructor({signature:u}){super("Unknown signature.",{details:u}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},x2u=class extends At{constructor({signature:u}){super("Invalid struct signature.",{details:u,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}},k2u=class extends At{constructor({type:u}){super("Circular reference detected.",{metaMessages:[`Struct "${u}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}},_2u=class extends At{constructor({current:u,depth:e}){super("Unbalanced parentheses.",{metaMessages:[`"${u.trim()}" has too many ${e>0?"opening":"closing"} parentheses.`],details:`Depth "${e}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}};function S2u(u,e){return e?`${e}:${u}`:u}var S1=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}]]);function P2u(u,e={}){if(l2u(u)){const t=c2u(u);if(!t)throw new I4({signature:u,type:"function"});const n=Pt(t.parameters),r=[],i=n.length;for(let o=0;o[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,I2u=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,O2u=/^u?int$/;function gi(u,e){var E,d;const t=S2u(u,e==null?void 0:e.type);if(S1.has(t))return S1.get(t);const n=Ox.test(u),r=si(n?I2u:T2u,u);if(!r)throw new B2u({param:u});if(r.name&&R2u(r.name))throw new v2u({param:u,name:r.name});const i=r.name?{name:r.name}:{},a=r.modifier==="indexed"?{indexed:!0}:{},o=(e==null?void 0:e.structs)??{};let s,l={};if(n){s="tuple";const f=Pt(r.type),m=[],h=f.length;for(let B=0;B[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function $x(u,e,t=new Set){const n=[],r=u.length;for(let i=0;iObject.fromEntries(u.filter(e=>e.type==="event").map(e=>{const t=n=>({eventName:e.name,abi:[e],humanReadableAbi:xs([e]),...n});return t.abi=[e],t.eventName=e.name,t.humanReadableAbi=xs([e]),[e.name,t]})),$2u=({methods:u})=>Object.fromEntries(u.filter(({type:e})=>e==="function").map(e=>{const t=(...n)=>{const r=u.filter(a=>a.name===(e==null?void 0:e.name)),i=n.length>0?{args:n}:{};return{abi:r,humanReadableAbi:xs([e]),functionName:e.name,...i}};return t.abi=[e],t.humanReadableAbi=xs([e]),[e.name,t]})),W2u=({methods:u})=>Object.fromEntries(u.map(e=>{const t=(...n)=>{const r=u.filter(a=>a.name===(e==null?void 0:e.name)),i=n.length>0?{args:n}:{};return{abi:r,humanReadableAbi:xs([e]),functionName:e.name,...i}};return t.abi=[e],t.humanReadableAbi=xs([e]),[e.name,t]})),q2u=({humanReadableAbi:u,name:e})=>{const t=U2u(u),n=t.filter(r=>r.type==="function");return{name:e,abi:t,humanReadableAbi:u,events:L2u({abi:t}),write:W2u({methods:n}),read:$2u({methods:n})}};const H2u={name:"WagmiMintExample",humanReadableAbi:["constructor()","event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)","event ApprovalForAll(address indexed owner, address indexed operator, bool approved)","event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)","function approve(address to, uint256 tokenId)","function balanceOf(address owner) view returns (uint256)","function getApproved(uint256 tokenId) view returns (address)","function isApprovedForAll(address owner, address operator) view returns (bool)","function mint()","function mint(uint256 tokenId)","function name() view returns (string)","function ownerOf(uint256 tokenId) view returns (address)","function safeTransferFrom(address from, address to, uint256 tokenId)","function safeTransferFrom(address from, address to, uint256 tokenId, bytes data)","function setApprovalForAll(address operator, bool approved)","function supportsInterface(bytes4 interfaceId) view returns (bool)","function symbol() view returns (string)","function tokenURI(uint256 tokenId) pure returns (string)","function totalSupply() view returns (uint256)","function transferFrom(address from, address to, uint256 tokenId)"]},rn=q2u(H2u),G2u="6.8.0";function K2u(u,e,t){const n=e.split("|").map(i=>i.trim());for(let i=0;iPromise.resolve(u[n])))).reduce((n,r,i)=>(n[e[i]]=r,n),{})}function Ou(u,e,t){for(let n in e){let r=e[n];const i=t?t[n]:null;i&&K2u(r,i,n),Object.defineProperty(u,n,{enumerable:!0,value:r,writable:!1})}}function uo(u){if(u==null)return"null";if(Array.isArray(u))return"[ "+u.map(uo).join(", ")+" ]";if(u instanceof Uint8Array){const e="0123456789abcdef";let t="0x";for(let n=0;n>4],t+=e[u[n]&15];return t}if(typeof u=="object"&&typeof u.toJSON=="function")return uo(u.toJSON());switch(typeof u){case"boolean":case"symbol":return u.toString();case"bigint":return BigInt(u).toString();case"number":return u.toString();case"string":return JSON.stringify(u);case"object":{const e=Object.keys(u);return e.sort(),"{ "+e.map(t=>`${uo(t)}: ${uo(u[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Et(u,e){return u&&u.code===e}function CC(u){return Et(u,"CALL_EXCEPTION")}function be(u,e,t){let n=u;{const i=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${uo(t)}`);for(const a in t){if(a==="shortMessage")continue;const o=t[a];i.push(a+"="+uo(o))}}i.push(`code=${e}`),i.push(`version=${G2u}`),i.length&&(u+=" ("+i.join(", ")+")")}let r;switch(e){case"INVALID_ARGUMENT":r=new TypeError(u);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(u);break;default:r=new Error(u)}return Ou(r,{code:e}),t&&Object.assign(r,t),r.shortMessage==null&&Ou(r,{shortMessage:n}),r}function Eu(u,e,t,n){if(!u)throw be(e,t,n)}function Q(u,e,t,n){Eu(u,e,"INVALID_ARGUMENT",{argument:t,value:n})}function Wx(u,e,t){t==null&&(t=""),t&&(t=": "+t),Eu(u>=e,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:u,expectedCount:e}),Eu(u<=e,"too many arguemnts"+t,"UNEXPECTED_ARGUMENT",{count:u,expectedCount:e})}const Q2u=["NFD","NFC","NFKD","NFKC"].reduce((u,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const t=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(t!==n)throw new Error("broken")}u.push(e)}catch{}return u},[]);function V2u(u){Eu(Q2u.indexOf(u)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:u}})}function t9(u,e,t){if(t==null&&(t=""),u!==e){let n=t,r="new";t&&(n+=".",r+=" "+t),Eu(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:r})}}function qx(u,e,t){if(u instanceof Uint8Array)return t?new Uint8Array(u):u;if(typeof u=="string"&&u.match(/^0x([0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((u.length-2)/2);let r=2;for(let i=0;i>4]+XA[r&15]}return t}function Te(u){return"0x"+u.map(e=>ku(e).substring(2)).join("")}function mo(u){return pe(u,!0)?(u.length-2)/2:Zu(u).length}function me(u,e,t){const n=Zu(u);return t!=null&&t>n.length&&Eu(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),ku(n.slice(e??0,t??n.length))}function Hx(u,e,t){const n=Zu(u);Eu(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const r=new Uint8Array(e);return r.fill(0),t?r.set(n,e-n.length):r.set(n,0),ku(r)}function ca(u,e){return Hx(u,e,!0)}function Y2u(u,e){return Hx(u,e,!1)}const n9=BigInt(0),Tt=BigInt(1),eo=9007199254740991;function X2u(u,e){const t=r9(u,"value"),n=BigInt(qu(e,"width"));if(Eu(t>>n===n9,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:u}),t>>n-Tt){const r=(Tt<=-eo&&u<=eo,"overflow",e||"value",u),BigInt(u);case"string":try{if(u==="")throw new Error("empty string");return u[0]==="-"&&u[1]!=="-"?-BigInt(u.substring(1)):BigInt(u)}catch(t){Q(!1,`invalid BigNumberish string: ${t.message}`,e||"value",u)}}Q(!1,"invalid BigNumberish value",e||"value",u)}function r9(u,e){const t=Su(u,e);return Eu(t>=n9,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:u}),t}const ZA="0123456789abcdef";function mC(u){if(u instanceof Uint8Array){let e="0x0";for(const t of u)e+=ZA[t>>4],e+=ZA[t&15];return BigInt(e)}return Su(u)}function qu(u,e){switch(typeof u){case"bigint":return Q(u>=-eo&&u<=eo,"overflow",e||"value",u),Number(u);case"number":return Q(Number.isInteger(u),"underflow",e||"value",u),Q(u>=-eo&&u<=eo,"overflow",e||"value",u),u;case"string":try{if(u==="")throw new Error("empty string");return qu(BigInt(u),e)}catch(t){Q(!1,`invalid numeric string: ${t.message}`,e||"value",u)}}Q(!1,"invalid numeric value",e||"value",u)}function Z2u(u){return qu(mC(u))}function Xr(u,e){let n=r9(u,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const r=qu(e,"width");for(Eu(r*2>=n.length,`value exceeds width (${r} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:u});n.length>6===2;a++)i++;return i}return u==="OVERRUN"?t.length-e-1:0}function idu(u,e,t,n,r){return u==="OVERLONG"?(Q(typeof r=="number","invalid bad code point for replacement","badCodepoint",r),n.push(r),0):(n.push(65533),Qx(u,e,t))}const adu=Object.freeze({error:rdu,ignore:Qx,replace:idu});function odu(u,e){e==null&&(e=adu.error);const t=Zu(u,"bytes"),n=[];let r=0;for(;r>7)){n.push(i);continue}let a=null,o=null;if((i&224)===192)a=1,o=127;else if((i&240)===224)a=2,o=2047;else if((i&248)===240)a=3,o=65535;else{(i&192)===128?r+=e("UNEXPECTED_CONTINUE",r-1,t,n):r+=e("BAD_PREFIX",r-1,t,n);continue}if(r-1+a>=t.length){r+=e("OVERRUN",r-1,t,n);continue}let s=i&(1<<8-a-1)-1;for(let l=0;l1114111){r+=e("OUT_OF_RANGE",r-1-a,t,n,s);continue}if(s>=55296&&s<=57343){r+=e("UTF16_SURROGATE",r-1-a,t,n,s);continue}if(s<=o){r+=e("OVERLONG",r-1-a,t,n,s);continue}n.push(s)}}return n}function Wn(u,e){e!=null&&(V2u(e),u=u.normalize(e));let t=[];for(let n=0;n>6|192),t.push(r&63|128);else if((r&64512)==55296){n++;const i=u.charCodeAt(n);Q(n>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(r>>12|224),t.push(r>>6&63|128),t.push(r&63|128)}return new Uint8Array(t)}function sdu(u){return u.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function gC(u,e){return sdu(odu(u,e))}function Vx(u){async function e(t,n){const r=t.url.split(":")[0].toLowerCase();Eu(r==="http"||r==="https",`unsupported protocol ${r}`,"UNSUPPORTED_OPERATION",{info:{protocol:r},operation:"request"}),Eu(r==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i;if(n){const E=new AbortController;i=E.signal,n.addListener(()=>{E.abort()})}const a={method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:i},o=await fetch(t.url,a),s={};o.headers.forEach((E,d)=>{s[d.toLowerCase()]=E});const l=await o.arrayBuffer(),c=l==null?null:new Uint8Array(l);return{statusCode:o.status,statusMessage:o.statusText,headers:s,body:c}}return e}const ldu=12,cdu=250;let e7=Vx();const Edu=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),ddu=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let P1=!1;async function Jx(u,e){try{const t=u.match(Edu);if(!t)throw new Error("invalid data");return new qr(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?tdu(t[3]):pdu(t[3]))}catch{return new qr(599,"BAD REQUEST (invalid data: URI)",{},null,new Yn(u))}}function Yx(u){async function e(t,n){try{const r=t.match(ddu);if(!r)throw new Error("invalid link");return new Yn(`${u}${r[2]}`)}catch{return new qr(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Yn(t))}}return e}const kc={data:Jx,ipfs:Yx("https://gateway.ipfs.io/ipfs/")},Xx=new WeakMap;var _i,mr;class fdu{constructor(e){tu(this,_i,void 0);tu(this,mr,void 0);R(this,_i,[]),R(this,mr,!1),Xx.set(e,()=>{if(!_(this,mr)){R(this,mr,!0);for(const t of _(this,_i))setTimeout(()=>{t()},0);R(this,_i,[])}})}addListener(e){Eu(!_(this,mr),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),_(this,_i).push(e)}get cancelled(){return _(this,mr)}checkSignal(){Eu(!this.cancelled,"cancelled","CANCELLED",{})}}_i=new WeakMap,mr=new WeakMap;function _c(u){if(u==null)throw new Error("missing signal; should not happen");return u.checkSignal(),u}var Bo,vo,bt,yn,Fo,Do,Ie,N0,Bn,Si,Pi,Ti,Vt,vn,gr,Ii,N4;const B2=class B2{constructor(e){tu(this,Ii);tu(this,Bo,void 0);tu(this,vo,void 0);tu(this,bt,void 0);tu(this,yn,void 0);tu(this,Fo,void 0);tu(this,Do,void 0);tu(this,Ie,void 0);tu(this,N0,void 0);tu(this,Bn,void 0);tu(this,Si,void 0);tu(this,Pi,void 0);tu(this,Ti,void 0);tu(this,Vt,void 0);tu(this,vn,void 0);tu(this,gr,void 0);R(this,Do,String(e)),R(this,Bo,!1),R(this,vo,!0),R(this,bt,{}),R(this,yn,""),R(this,Fo,3e5),R(this,vn,{slotInterval:cdu,maxAttempts:ldu}),R(this,gr,null)}get url(){return _(this,Do)}set url(e){R(this,Do,String(e))}get body(){return _(this,Ie)==null?null:new Uint8Array(_(this,Ie))}set body(e){if(e==null)R(this,Ie,void 0),R(this,N0,void 0);else if(typeof e=="string")R(this,Ie,Wn(e)),R(this,N0,"text/plain");else if(e instanceof Uint8Array)R(this,Ie,e),R(this,N0,"application/octet-stream");else if(typeof e=="object")R(this,Ie,Wn(JSON.stringify(e))),R(this,N0,"application/json");else throw new Error("invalid body")}hasBody(){return _(this,Ie)!=null}get method(){return _(this,yn)?_(this,yn):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),R(this,yn,String(e).toUpperCase())}get headers(){const e=Object.assign({},_(this,bt));return _(this,Bn)&&(e.authorization=`Basic ${ndu(Wn(_(this,Bn)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&_(this,N0)&&(e["content-type"]=_(this,N0)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){_(this,bt)[String(e).toLowerCase()]=String(t)}clearHeaders(){R(this,bt,{})}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n=0,"timeout must be non-zero","timeout",e),R(this,Fo,e)}get preflightFunc(){return _(this,Si)||null}set preflightFunc(e){R(this,Si,e)}get processFunc(){return _(this,Pi)||null}set processFunc(e){R(this,Pi,e)}get retryFunc(){return _(this,Ti)||null}set retryFunc(e){R(this,Ti,e)}get getUrlFunc(){return _(this,gr)||e7}set getUrlFunc(e){R(this,gr,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(_(this,vn).slotInterval=e.slotInterval),e.maxAttempts!=null&&(_(this,vn).maxAttempts=e.maxAttempts)}send(){return Eu(_(this,Vt)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),R(this,Vt,new fdu(this)),yu(this,Ii,N4).call(this,0,t7()+this.timeout,0,this,new qr(0,"",{},null,this))}cancel(){Eu(_(this,Vt)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=Xx.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Eu(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const r=new B2(e);return r.method="GET",r.allowGzip=this.allowGzip,r.timeout=this.timeout,R(r,bt,Object.assign({},_(this,bt))),_(this,Ie)&&R(r,Ie,new Uint8Array(_(this,Ie))),R(r,N0,_(this,N0)),r}clone(){const e=new B2(this.url);return R(e,yn,_(this,yn)),_(this,Ie)&&R(e,Ie,_(this,Ie)),R(e,N0,_(this,N0)),R(e,bt,Object.assign({},_(this,bt))),R(e,Bn,_(this,Bn)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),R(e,Si,_(this,Si)),R(e,Pi,_(this,Pi)),R(e,Ti,_(this,Ti)),R(e,gr,_(this,gr)),e}static lockConfig(){P1=!0}static getGateway(e){return kc[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(P1)throw new Error("gateways locked");kc[e]=t}static registerGetUrl(e){if(P1)throw new Error("gateways locked");e7=e}static createGetUrlFunc(e){return Vx()}static createDataGateway(){return Jx}static createIpfsGatewayFunc(e){return Yx(e)}};Bo=new WeakMap,vo=new WeakMap,bt=new WeakMap,yn=new WeakMap,Fo=new WeakMap,Do=new WeakMap,Ie=new WeakMap,N0=new WeakMap,Bn=new WeakMap,Si=new WeakMap,Pi=new WeakMap,Ti=new WeakMap,Vt=new WeakMap,vn=new WeakMap,gr=new WeakMap,Ii=new WeakSet,N4=async function(e,t,n,r,i){var c,E,d;if(e>=_(this,vn).maxAttempts)return i.makeServerError("exceeded maximum retry limit");Eu(t7()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:r}),n>0&&await hdu(n);let a=this.clone();const o=(a.url.split(":")[0]||"").toLowerCase();if(o in kc){const f=await kc[o](a.url,_c(_(r,Vt)));if(f instanceof qr){let m=f;if(this.processFunc){_c(_(r,Vt));try{m=await this.processFunc(a,m)}catch(h){(h.throttle==null||typeof h.stall!="number")&&m.makeServerError("error in post-processing function",h).assertOk()}}return m}a=f}this.preflightFunc&&(a=await this.preflightFunc(a));const s=await this.getUrlFunc(a,_c(_(r,Vt)));let l=new qr(s.statusCode,s.statusMessage,s.headers,s.body,r);if(l.statusCode===301||l.statusCode===302){try{const f=l.headers.location||"";return yu(c=a.redirect(f),Ii,N4).call(c,e+1,t,0,r,l)}catch{}return l}else if(l.statusCode===429&&(this.retryFunc==null||await this.retryFunc(a,l,e))){const f=l.headers["retry-after"];let m=_(this,vn).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof f=="string"&&f.match(/^[1-9][0-9]*$/)&&(m=parseInt(f)),yu(E=a.clone(),Ii,N4).call(E,e+1,t,m,r,l)}if(this.processFunc){_c(_(r,Vt));try{l=await this.processFunc(a,l)}catch(f){(f.throttle==null||typeof f.stall!="number")&&l.makeServerError("error in post-processing function",f).assertOk();let m=_(this,vn).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return f.stall>=0&&(m=f.stall),yu(d=a.clone(),Ii,N4).call(d,e+1,t,m,r,l)}}return l};let Yn=B2;var Z3,ul,el,wt,bo,Oi;const SC=class SC{constructor(e,t,n,r,i){tu(this,Z3,void 0);tu(this,ul,void 0);tu(this,el,void 0);tu(this,wt,void 0);tu(this,bo,void 0);tu(this,Oi,void 0);R(this,Z3,e),R(this,ul,t),R(this,el,Object.keys(n).reduce((a,o)=>(a[o.toLowerCase()]=String(n[o]),a),{})),R(this,wt,r==null?null:new Uint8Array(r)),R(this,bo,i||null),R(this,Oi,{message:""})}toString(){return``}get statusCode(){return _(this,Z3)}get statusMessage(){return _(this,ul)}get headers(){return Object.assign({},_(this,el))}get body(){return _(this,wt)==null?null:new Uint8Array(_(this,wt))}get bodyText(){try{return _(this,wt)==null?"":gC(_(this,wt))}catch{Eu(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Eu(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n=0,"invalid stall timeout","stall",t);const n=new Error(e||"throttling requests");throw Ou(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return _(this,wt)!=null}get request(){return _(this,bo)}ok(){return _(this,Oi).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=_(this,Oi);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),Eu(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t})}};Z3=new WeakMap,ul=new WeakMap,el=new WeakMap,wt=new WeakMap,bo=new WeakMap,Oi=new WeakMap;let qr=SC;function t7(){return new Date().getTime()}function pdu(u){return Wn(u.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function hdu(u){return new Promise(e=>setTimeout(e,u))}function Cdu(u){let e=u.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function n7(u,e,t){let n=0;for(let r=0;r{Eu(n<=u.length,"data short segment too short","BUFFER_OVERRUN",{buffer:u,length:u.length,offset:n})};if(u[e]>=248){const n=u[e]-247;t(e+1+n);const r=n7(u,e+1,n);return t(e+1+n+r),r7(u,e,e+1+n,n+r)}else if(u[e]>=192){const n=u[e]-192;return t(e+1+n),r7(u,e,e+1,n)}else if(u[e]>=184){const n=u[e]-183;t(e+1+n);const r=n7(u,e+1,n);t(e+1+n+r);const i=ku(u.slice(e+1+n,e+1+n+r));return{consumed:1+n+r,result:i}}else if(u[e]>=128){const n=u[e]-128;t(e+1+n);const r=ku(u.slice(e+1,e+1+n));return{consumed:1+n,result:r}}return{consumed:1,result:Cdu(u[e])}}function AC(u){const e=Zu(u,"data"),t=Zx(e,0);return Q(t.consumed===e.length,"unexpected junk after rlp payload","data",u),t.result}function i7(u){const e=[];for(;u;)e.unshift(u&255),u>>=8;return e}function uk(u){if(Array.isArray(u)){let n=[];if(u.forEach(function(i){n=n.concat(uk(i))}),n.length<=55)return n.unshift(192+n.length),n;const r=i7(n.length);return r.unshift(247+r.length),r.concat(n)}const e=Array.prototype.slice.call(Zu(u,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const t=i7(e.length);return t.unshift(183+t.length),t.concat(e)}const a7="0123456789abcdef";function q3(u){let e="0x";for(const t of uk(u))e+=a7[t>>4],e+=a7[t&15];return e}const l0=32,Jf=new Uint8Array(l0),mdu=["then"],Sc={};function B4(u,e){const t=new Error(`deferred error during ABI decoding triggered accessing ${u}`);throw t.error=e,t}var Ar;const u3=class u3 extends Array{constructor(...t){const n=t[0];let r=t[1],i=(t[2]||[]).slice(),a=!0;n!==Sc&&(r=t,i=[],a=!1);super(r.length);tu(this,Ar,void 0);r.forEach((s,l)=>{this[l]=s});const o=i.reduce((s,l)=>(typeof l=="string"&&s.set(l,(s.get(l)||0)+1),s),new Map);if(R(this,Ar,Object.freeze(r.map((s,l)=>{const c=i[l];return c!=null&&o.get(c)===1?c:null}))),!!a)return Object.freeze(this),new Proxy(this,{get:(s,l,c)=>{if(typeof l=="string"){if(l.match(/^[0-9]+$/)){const d=qu(l,"%index");if(d<0||d>=this.length)throw new RangeError("out of result range");const f=s[d];return f instanceof Error&&B4(`index ${d}`,f),f}if(mdu.indexOf(l)>=0)return Reflect.get(s,l,c);const E=s[l];if(E instanceof Function)return function(...d){return E.apply(this===c?s:this,d)};if(!(l in s))return s.getValue.apply(this===c?s:this,[l])}return Reflect.get(s,l,c)}})}toArray(){const t=[];return this.forEach((n,r)=>{n instanceof Error&&B4(`index ${r}`,n),t.push(n)}),t}toObject(){return _(this,Ar).reduce((t,n,r)=>(Eu(n!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),n in t||(t[n]=this.getValue(n)),t),{})}slice(t,n){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const r=[],i=[];for(let a=t;a{_(this,Fn)[e]=o7(t)}}}Fn=new WeakMap,Ni=new WeakMap,wo=new WeakSet,tE=function(e){return _(this,Fn).push(e),R(this,Ni,_(this,Ni)+e.length),e.length};var R0,ut,v2,ek;const PC=class PC{constructor(e,t){tu(this,v2);X(this,"allowLoose");tu(this,R0,void 0);tu(this,ut,void 0);Ou(this,{allowLoose:!!t}),R(this,R0,F0(e)),R(this,ut,0)}get data(){return ku(_(this,R0))}get dataLength(){return _(this,R0).length}get consumed(){return _(this,ut)}get bytes(){return new Uint8Array(_(this,R0))}subReader(e){return new PC(_(this,R0).slice(_(this,ut)+e),this.allowLoose)}readBytes(e,t){let n=yu(this,v2,ek).call(this,0,e,!!t);return R(this,ut,_(this,ut)+n.length),n.slice(0,e)}readValue(){return mC(this.readBytes(l0))}readIndex(){return Z2u(this.readBytes(l0))}};R0=new WeakMap,ut=new WeakMap,v2=new WeakSet,ek=function(e,t,n){let r=Math.ceil(t/l0)*l0;return _(this,ut)+r>_(this,R0).length&&(this.allowLoose&&n&&_(this,ut)+t<=_(this,R0).length?r=t:Eu(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:F0(_(this,R0)),length:_(this,R0).length,offset:_(this,ut)+r})),_(this,R0).slice(_(this,ut),_(this,ut)+r)};let Xf=PC,tk=!1;const nk=function(u){return sF(u)};let rk=nk;function fe(u){const e=Zu(u,"data");return ku(rk(e))}fe._=nk;fe.lock=function(){tk=!0};fe.register=function(u){if(tk)throw new TypeError("keccak256 is locked");rk=u};Object.freeze(fe);const Zf="0x0000000000000000000000000000000000000000",s7="0x0000000000000000000000000000000000000000000000000000000000000000",l7=BigInt(0),c7=BigInt(1),E7=BigInt(2),d7=BigInt(27),f7=BigInt(28),Pc=BigInt(35),Sa={};function p7(u){return ca(L0(u),32)}var xo,ko,_o,Ri;const vt=class vt{constructor(e,t,n,r){tu(this,xo,void 0);tu(this,ko,void 0);tu(this,_o,void 0);tu(this,Ri,void 0);t9(e,Sa,"Signature"),R(this,xo,t),R(this,ko,n),R(this,_o,r),R(this,Ri,null)}get r(){return _(this,xo)}set r(e){Q(mo(e)===32,"invalid r","value",e),R(this,xo,ku(e))}get s(){return _(this,ko)}set s(e){Q(mo(e)===32,"invalid s","value",e);const t=ku(e);Q(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),R(this,ko,t)}get v(){return _(this,_o)}set v(e){const t=qu(e,"value");Q(t===27||t===28,"invalid v","v",e),R(this,_o,t)}get networkV(){return _(this,Ri)}get legacyChainId(){const e=this.networkV;return e==null?null:vt.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Zu(this.s);return this.yParity&&(e[0]|=128),ku(e)}get compactSerialized(){return Te([this.r,this.yParityAndS])}get serialized(){return Te([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new vt(Sa,this.r,this.s,this.v);return this.networkV&&R(e,Ri,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const t=Su(e,"v");return t==d7||t==f7?l7:(Q(t>=Pc,"invalid EIP-155 v","v",e),(t-Pc)/E7)}static getChainIdV(e,t){return Su(e)*E7+BigInt(35+t-27)}static getNormalizedV(e){const t=Su(e);return t===l7||t===d7?27:t===c7||t===f7?28:(Q(t>=Pc,"invalid v","v",e),t&c7?27:28)}static from(e){function t(l,c){Q(l,c,"signature",e)}if(e==null)return new vt(Sa,s7,s7,27);if(typeof e=="string"){const l=Zu(e,"signature");if(l.length===64){const c=ku(l.slice(0,32)),E=l.slice(32,64),d=E[0]&128?28:27;return E[0]&=127,new vt(Sa,c,ku(E),d)}if(l.length===65){const c=ku(l.slice(0,32)),E=l.slice(32,64);t((E[0]&128)===0,"non-canonical s");const d=vt.getNormalizedV(l[64]);return new vt(Sa,c,ku(E),d)}t(!1,"invalid raw signature length")}if(e instanceof vt)return e.clone();const n=e.r;t(n!=null,"missing r");const r=p7(n),i=function(l,c){if(l!=null)return p7(l);if(c!=null){t(pe(c,32),"invalid yParityAndS");const E=Zu(c);return E[0]&=127,ku(E)}t(!1,"missing s")}(e.s,e.yParityAndS);t((Zu(i)[0]&128)==0,"non-canonical s");const{networkV:a,v:o}=function(l,c,E){if(l!=null){const d=Su(l);return{networkV:d>=Pc?d:void 0,v:vt.getNormalizedV(d)}}if(c!=null)return t(pe(c,32),"invalid yParityAndS"),{v:Zu(c)[0]&128?28:27};if(E!=null){switch(qu(E,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),s=new vt(Sa,r,i,o);return a&&R(s,Ri,a),t(e.yParity==null||qu(e.yParity,"sig.yParity")===s.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===s.yParityAndS,"yParityAndS mismatch"),s}};xo=new WeakMap,ko=new WeakMap,_o=new WeakMap,Ri=new WeakMap;let Mt=vt;var Dn;const Ai=class Ai{constructor(e){tu(this,Dn,void 0);Q(mo(e)===32,"invalid private key","privateKey","[REDACTED]"),R(this,Dn,ku(e))}get privateKey(){return _(this,Dn)}get publicKey(){return Ai.computePublicKey(_(this,Dn))}get compressedPublicKey(){return Ai.computePublicKey(_(this,Dn),!0)}sign(e){Q(mo(e)===32,"invalid digest length","digest",e);const t=lr.sign(F0(e),F0(_(this,Dn)),{lowS:!0});return Mt.from({r:Xr(t.r,32),s:Xr(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=Ai.computePublicKey(e);return ku(lr.getSharedSecret(F0(_(this,Dn)),Zu(t),!1))}static computePublicKey(e,t){let n=Zu(e,"key");if(n.length===32){const i=lr.getPublicKey(n,!!t);return ku(i)}if(n.length===64){const i=new Uint8Array(65);i[0]=4,i.set(n,1),n=i}const r=lr.ProjectivePoint.fromHex(n);return ku(r.toRawBytes(t))}static recoverPublicKey(e,t){Q(mo(e)===32,"invalid digest length","digest",e);const n=Mt.from(t);let r=lr.Signature.fromCompact(F0(Te([n.r,n.s])));r=r.addRecoveryBit(n.yParity);const i=r.recoverPublicKey(F0(e));return Q(i!=null,"invalid signautre for digest","signature",t),"0x"+i.toHex(!1)}static addPoints(e,t,n){const r=lr.ProjectivePoint.fromHex(Ai.computePublicKey(e).substring(2)),i=lr.ProjectivePoint.fromHex(Ai.computePublicKey(t).substring(2));return"0x"+r.add(i).toHex(!!n)}};Dn=new WeakMap;let H3=Ai;const gdu=BigInt(0),Adu=BigInt(36);function h7(u){u=u.toLowerCase();const e=u.substring(2).split(""),t=new Uint8Array(40);for(let r=0;r<40;r++)t[r]=e[r].charCodeAt(0);const n=Zu(fe(t));for(let r=0;r<40;r+=2)n[r>>1]>>4>=8&&(e[r]=e[r].toUpperCase()),(n[r>>1]&15)>=8&&(e[r+1]=e[r+1].toUpperCase());return"0x"+e.join("")}const yC={};for(let u=0;u<10;u++)yC[String(u)]=String(u);for(let u=0;u<26;u++)yC[String.fromCharCode(65+u)]=String(10+u);const C7=15;function ydu(u){u=u.toUpperCase(),u=u.substring(4)+u.substring(0,2)+"00";let e=u.split("").map(n=>yC[n]).join("");for(;e.length>=C7;){let n=e.substring(0,C7);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const Bdu=function(){const u={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];u[t]=BigInt(e)}return u}();function vdu(u){u=u.toLowerCase();let e=gdu;for(let t=0;te.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return _(this,ji)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return _(this,ji)===!0?-1:_(this,ji)===!1?this.value.length:null}static from(e,t){return new mn(Cn,e,t)}static uint8(e){return Bu(e,8)}static uint16(e){return Bu(e,16)}static uint24(e){return Bu(e,24)}static uint32(e){return Bu(e,32)}static uint40(e){return Bu(e,40)}static uint48(e){return Bu(e,48)}static uint56(e){return Bu(e,56)}static uint64(e){return Bu(e,64)}static uint72(e){return Bu(e,72)}static uint80(e){return Bu(e,80)}static uint88(e){return Bu(e,88)}static uint96(e){return Bu(e,96)}static uint104(e){return Bu(e,104)}static uint112(e){return Bu(e,112)}static uint120(e){return Bu(e,120)}static uint128(e){return Bu(e,128)}static uint136(e){return Bu(e,136)}static uint144(e){return Bu(e,144)}static uint152(e){return Bu(e,152)}static uint160(e){return Bu(e,160)}static uint168(e){return Bu(e,168)}static uint176(e){return Bu(e,176)}static uint184(e){return Bu(e,184)}static uint192(e){return Bu(e,192)}static uint200(e){return Bu(e,200)}static uint208(e){return Bu(e,208)}static uint216(e){return Bu(e,216)}static uint224(e){return Bu(e,224)}static uint232(e){return Bu(e,232)}static uint240(e){return Bu(e,240)}static uint248(e){return Bu(e,248)}static uint256(e){return Bu(e,256)}static uint(e){return Bu(e,256)}static int8(e){return Bu(e,-8)}static int16(e){return Bu(e,-16)}static int24(e){return Bu(e,-24)}static int32(e){return Bu(e,-32)}static int40(e){return Bu(e,-40)}static int48(e){return Bu(e,-48)}static int56(e){return Bu(e,-56)}static int64(e){return Bu(e,-64)}static int72(e){return Bu(e,-72)}static int80(e){return Bu(e,-80)}static int88(e){return Bu(e,-88)}static int96(e){return Bu(e,-96)}static int104(e){return Bu(e,-104)}static int112(e){return Bu(e,-112)}static int120(e){return Bu(e,-120)}static int128(e){return Bu(e,-128)}static int136(e){return Bu(e,-136)}static int144(e){return Bu(e,-144)}static int152(e){return Bu(e,-152)}static int160(e){return Bu(e,-160)}static int168(e){return Bu(e,-168)}static int176(e){return Bu(e,-176)}static int184(e){return Bu(e,-184)}static int192(e){return Bu(e,-192)}static int200(e){return Bu(e,-200)}static int208(e){return Bu(e,-208)}static int216(e){return Bu(e,-216)}static int224(e){return Bu(e,-224)}static int232(e){return Bu(e,-232)}static int240(e){return Bu(e,-240)}static int248(e){return Bu(e,-248)}static int256(e){return Bu(e,-256)}static int(e){return Bu(e,-256)}static bytes1(e){return Vu(e,1)}static bytes2(e){return Vu(e,2)}static bytes3(e){return Vu(e,3)}static bytes4(e){return Vu(e,4)}static bytes5(e){return Vu(e,5)}static bytes6(e){return Vu(e,6)}static bytes7(e){return Vu(e,7)}static bytes8(e){return Vu(e,8)}static bytes9(e){return Vu(e,9)}static bytes10(e){return Vu(e,10)}static bytes11(e){return Vu(e,11)}static bytes12(e){return Vu(e,12)}static bytes13(e){return Vu(e,13)}static bytes14(e){return Vu(e,14)}static bytes15(e){return Vu(e,15)}static bytes16(e){return Vu(e,16)}static bytes17(e){return Vu(e,17)}static bytes18(e){return Vu(e,18)}static bytes19(e){return Vu(e,19)}static bytes20(e){return Vu(e,20)}static bytes21(e){return Vu(e,21)}static bytes22(e){return Vu(e,22)}static bytes23(e){return Vu(e,23)}static bytes24(e){return Vu(e,24)}static bytes25(e){return Vu(e,25)}static bytes26(e){return Vu(e,26)}static bytes27(e){return Vu(e,27)}static bytes28(e){return Vu(e,28)}static bytes29(e){return Vu(e,29)}static bytes30(e){return Vu(e,30)}static bytes31(e){return Vu(e,31)}static bytes32(e){return Vu(e,32)}static address(e){return new mn(Cn,"address",e)}static bool(e){return new mn(Cn,"bool",!!e)}static bytes(e){return new mn(Cn,"bytes",e)}static string(e){return new mn(Cn,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new mn(Cn,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===m7}static dereference(e,t){if(mn.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}};ji=new WeakMap;let t0=mn;class Ddu extends ir{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=t0.dereference(t,"string");try{n=Yu(n)}catch(r){return this._throwError(r.message,t)}return e.writeValue(n)}decode(e){return Yu(Xr(e.readValue(),20))}}class bdu extends ir{constructor(t){super(t.name,t.type,"_",t.dynamic);X(this,"coder");this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,n){return this.coder.encode(t,n)}decode(t){return this.coder.decode(t)}}function ak(u,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let s={};n=e.map(l=>{const c=l.localName;return Eu(c,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:t}),Eu(!s[c],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:t}),s[c]=!0,t[c]})}else Q(!1,"invalid tuple value","tuple",t);Q(e.length===n.length,"types/value length mismatch","tuple",t);let r=new Yf,i=new Yf,a=[];e.forEach((s,l)=>{let c=n[l];if(s.dynamic){let E=i.length;s.encode(i,c);let d=r.writeUpdatableValue();a.push(f=>{d(f+E)})}else s.encode(r,c)}),a.forEach(s=>{s(r.length)});let o=u.appendWriter(r);return o+=u.appendWriter(i),o}function ok(u,e){let t=[],n=[],r=u.subReader(0);return e.forEach(i=>{let a=null;if(i.dynamic){let o=u.readIndex(),s=r.subReader(o);try{a=i.decode(s)}catch(l){if(Et(l,"BUFFER_OVERRUN"))throw l;a=l,a.baseType=i.name,a.name=i.localName,a.type=i.type}}else try{a=i.decode(u)}catch(o){if(Et(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=i.name,a.name=i.localName,a.type=i.type}if(a==null)throw new Error("investigate");t.push(a),n.push(i.localName||null)}),E2.fromItems(t,n)}class wdu extends ir{constructor(t,n,r){const i=t.type+"["+(n>=0?n:"")+"]",a=n===-1||t.dynamic;super("array",i,r,a);X(this,"coder");X(this,"length");Ou(this,{coder:t,length:n})}defaultValue(){const t=this.coder.defaultValue(),n=[];for(let r=0;ra||r<-(a+Idu))&&this._throwError("value out-of-bounds",n),r=Gx(r,8*l0)}else(rO4(i,this.size*8))&&this._throwError("value out-of-bounds",n);return t.writeValue(r)}decode(t){let n=O4(t.readValue(),this.size*8);return this.signed&&(n=X2u(n,this.size*8)),n}}class Rdu extends sk{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Wn(t0.dereference(t,"string")))}decode(e){return gC(super.decode(e))}}class Tc extends ir{constructor(t,n){let r=!1;const i=[];t.forEach(o=>{o.dynamic&&(r=!0),i.push(o.type)});const a="tuple("+i.join(",")+")";super("tuple",a,n,r);X(this,"coders");Ou(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach(r=>{t.push(r.defaultValue())});const n=this.coders.reduce((r,i)=>{const a=i.localName;return a&&(r[a]||(r[a]=0),r[a]++),r},{});return this.coders.forEach((r,i)=>{let a=r.localName;!a||n[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[i]))}),Object.freeze(t)}encode(t,n){const r=t0.dereference(n,"tuple");return ak(t,this.coders,r)}decode(t){return ok(t,this.coders)}}function Ea(u){return fe(Wn(u))}var jdu="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagC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4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const g7=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),A7=4;function zdu(u){let e=0;function t(){return u[e++]<<8|u[e++]}let n=t(),r=1,i=[0,1];for(let w=1;w>--s&1}const E=31,d=2**E,f=d>>>1,m=f>>1,h=d-1;let B=0;for(let w=0;w1;){let O=D+p>>>1;w>>1|c(),x=x<<1^f,j=(j^f)<<1|f|1;C=x,y=1+j-x}let v=n-4;return g.map(w=>{switch(w-v){case 3:return v+65792+(u[o++]<<16|u[o++]<<8|u[o++]);case 2:return v+256+(u[o++]<<8|u[o++]);case 1:return v+u[o++];default:return w-1}})}function Mdu(u){let e=0;return()=>u[e++]}function lk(u){return Mdu(zdu(Udu(u)))}function Udu(u){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((r,i)=>e[r.charCodeAt(0)]=i);let t=u.length,n=new Uint8Array(6*t>>3);for(let r=0,i=0,a=0,o=0;r=8&&(n[i++]=o>>(a-=8));return n}function Ldu(u){return u&1?~u>>1:u>>1}function $du(u,e){let t=Array(u);for(let n=0,r=0;n{let e=G3(u);if(e.length)return e})}function Ek(u){let e=[];for(;;){let t=u();if(t==0)break;e.push(Wdu(t,u))}for(;;){let t=u()-1;if(t<0)break;e.push(qdu(t,u))}return e.flat()}function K3(u){let e=[];for(;;){let t=u(e.length);if(!t)break;e.push(t)}return e}function dk(u,e,t){let n=Array(u).fill().map(()=>[]);for(let r=0;rn[a].push(i));return n}function Wdu(u,e){let t=1+e(),n=e(),r=K3(e);return dk(r.length,1+u,e).flatMap((a,o)=>{let[s,...l]=a;return Array(r[o]).fill().map((c,E)=>{let d=E*n;return[s+E*t,l.map(f=>f+d)]})})}function qdu(u,e){let t=1+e();return dk(t,1+u,e).map(r=>[r[0],r.slice(1)])}function Hdu(u){let e=[],t=G3(u);return r(n([]),[]),e;function n(i){let a=u(),o=K3(()=>{let s=G3(u).map(l=>t[l]);if(s.length)return n(s)});return{S:a,B:o,Q:i}}function r({S:i,B:a},o,s){if(!(i&4&&s===o[o.length-1])){i&2&&(s=o[o.length-1]),i&1&&e.push(o);for(let l of a)for(let c of l.Q)r(l,[...o,c],s)}}}function Gdu(u){return u.toString(16).toUpperCase().padStart(2,"0")}function fk(u){return`{${Gdu(u)}}`}function Kdu(u){let e=[];for(let t=0,n=u.length;t>24&255}function Ck(u){return u&16777215}let up,y7,ep,nE;function e9u(){let u=lk(Vdu);up=new Map(ck(u).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),y7=new Set(G3(u)),ep=new Map,nE=new Map;for(let[e,t]of Ek(u)){if(!y7.has(e)&&t.length==2){let[n,r]=t,i=nE.get(n);i||(i=new Map,nE.set(n,i)),i.set(r,e)}ep.set(e,t.reverse())}}function mk(u){return u>=Q3&&u=d2&&u=f2&&ep2&&e0&&r(p2+l)}else{let a=ep.get(i);a?t.push(...a):r(i)}if(!t.length)break;i=t.pop()}if(n&&e.length>1){let i=R4(e[0]);for(let a=1;a0&&r>=a)a==0?(e.push(n,...t),t.length=0,n=o):t.push(o),r=a;else{let s=t9u(n,o);s>=0?n=s:r==0&&a==0?(e.push(n),n=o):(t.push(o),r=a)}}return n>=0&&e.push(n,...t),e}function Ak(u){return gk(u).map(Ck)}function r9u(u){return n9u(gk(u))}const B7=45,yk=".",Bk=65039,vk=1,no=u=>Array.from(u);function V3(u,e){return u.P.has(e)||u.Q.has(e)}class i9u extends Array{get is_emoji(){return!0}}let tp,Fk,xi,np,Dk,go,I1,za,bk,v7,rp;function BC(){if(tp)return;let u=lk(jdu);const e=()=>G3(u),t=()=>new Set(e());tp=new Map(Ek(u)),Fk=t(),xi=e(),np=new Set(e().map(c=>xi[c])),xi=new Set(xi),Dk=t(),t();let n=ck(u),r=u();const i=()=>new Set(e().flatMap(c=>n[c]).concat(e()));go=K3(c=>{let E=K3(u).map(d=>d+96);if(E.length){let d=c>=r;E[0]-=32,E=ks(E),d&&(E=`Restricted[${E}]`);let f=i(),m=i(),h=!u();return{N:E,P:f,Q:m,M:h,R:d}}}),I1=t(),za=new Map;let a=e().concat(no(I1)).sort((c,E)=>c-E);a.forEach((c,E)=>{let d=u(),f=a[E]=d?a[E-d]:{V:[],M:new Map};f.V.push(c),I1.has(c)||za.set(c,f)});for(let{V:c,M:E}of new Set(za.values())){let d=[];for(let m of c){let h=go.filter(g=>V3(g,m)),B=d.find(({G:g})=>h.some(C=>g.has(C)));B||(B={G:new Set,V:[]},d.push(B)),B.V.push(m),h.forEach(g=>B.G.add(g))}let f=d.flatMap(m=>no(m.G));for(let{G:m,V:h}of d){let B=new Set(f.filter(g=>!m.has(g)));for(let g of h)E.set(g,B)}}let o=new Set,s=new Set;const l=c=>o.has(c)?s.add(c):o.add(c);for(let c of go){for(let E of c.P)l(E);for(let E of c.Q)l(E)}for(let c of o)!za.has(c)&&!s.has(c)&&za.set(c,vk);bk=new Set(no(o).concat(no(Ak(o)))),v7=Hdu(u).map(c=>i9u.from(c)).sort(Qdu),rp=new Map;for(let c of v7){let E=[rp];for(let d of c){let f=E.map(m=>{let h=m.get(d);return h||(h=new Map,m.set(d,h)),h});d===Bk?E.push(...f):E=f}for(let d of E)d.V=c}}function vC(u){return(wk(u)?"":`${FC(i9([u]))} `)+fk(u)}function FC(u){return`"${u}"‎`}function a9u(u){if(u.length>=4&&u[2]==B7&&u[3]==B7)throw new Error(`invalid label extension: "${ks(u.slice(0,4))}"`)}function o9u(u){for(let t=u.lastIndexOf(95);t>0;)if(u[--t]!==95)throw new Error("underscore allowed only at start")}function s9u(u){let e=u[0],t=g7.get(e);if(t)throw X4(`leading ${t}`);let n=u.length,r=-1;for(let i=1;i{let i=Kdu(r),a={input:i,offset:n};n+=i.length+1;try{let o=a.tokens=C9u(i,e,t),s=o.length,l;if(!s)throw new Error("empty label");let c=a.output=o.flat();if(o9u(c),!(a.emoji=s>1||o[0].is_emoji)&&c.every(d=>d<128))a9u(c),l="ASCII";else{let d=o.flatMap(f=>f.is_emoji?[]:f);if(!d.length)l="Emoji";else{if(xi.has(c[0]))throw X4("leading combining mark");for(let h=1;ha.has(o)):no(a),!t.length)return}else n.push(r)}if(t){for(let r of t)if(n.every(i=>V3(r,i)))throw new Error(`whole-script confusable: ${u.N}/${r.N}`)}}function f9u(u){let e=go;for(let t of u){let n=e.filter(r=>V3(r,t));if(!n.length)throw go.some(r=>V3(r,t))?kk(e[0],t):xk(t);if(e=n,n.length==1)break}return e}function p9u(u){return u.map(({input:e,error:t,output:n})=>{if(t){let r=t.message;throw new Error(u.length==1?r:`Invalid label ${FC(i9(e))}: ${r}`)}return ks(n)}).join(yk)}function xk(u){return new Error(`disallowed character: ${vC(u)}`)}function kk(u,e){let t=vC(e),n=go.find(r=>r.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${u.N} + ${t}`)}function X4(u){return new Error(`illegal placement: ${u}`)}function h9u(u,e){for(let t of e)if(!V3(u,t))throw kk(u,t);if(u.M){let t=Ak(e);for(let n=1,r=t.length;nA7)throw new Error(`excessive non-spacing marks: ${FC(i9(t.slice(n-1,i)))} (${i-n}/${A7})`);n=i}}}function C9u(u,e,t){let n=[],r=[];for(u=u.slice().reverse();u.length;){let i=g9u(u);if(i)r.length&&(n.push(e(r)),r=[]),n.push(t(i));else{let a=u.pop();if(bk.has(a))r.push(a);else{let o=tp.get(a);if(o)r.push(...o);else if(!Fk.has(a))throw xk(a)}}}return r.length&&n.push(e(r)),n}function m9u(u){return u.filter(e=>e!=Bk)}function g9u(u,e){let t=rp,n,r=u.length;for(;r&&(t=t.get(u[--r]),!!t);){let{V:i}=t;i&&(n=i,e&&e.push(...u.slice(r).reverse()),u.length=r)}return n}const _k=new Uint8Array(32);_k.fill(0);function F7(u){return Q(u.length!==0,"invalid ENS name; empty component","comp",u),u}function Sk(u){const e=Wn(A9u(u)),t=[];if(u.length===0)return t;let n=0;for(let r=0;r{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"}function O1(u,e){return{address:Yu(u),storageKeys:e.map((t,n)=>(Q(pe(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function Fa(u){if(Array.isArray(u))return u.map((t,n)=>Array.isArray(t)?(Q(t.length===2,"invalid slot set",`value[${n}]`,t),O1(t[0],t[1])):(Q(t!=null&&typeof t=="object","invalid address-slot set","value",u),O1(t.address,t.storageKeys)));Q(u!=null&&typeof u=="object","invalid access list","value",u);const e=Object.keys(u).map(t=>{const n=u[t].reduce((r,i)=>(r[i]=!0,r),{});return O1(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}function B9u(u){let e;return typeof u=="string"?e=H3.computePublicKey(u,!1):e=u.publicKey,Yu(fe("0x"+e.substring(4)).substring(26))}function v9u(u,e){return B9u(H3.recoverPublicKey(u,e))}const B0=BigInt(0),F9u=BigInt(2),D9u=BigInt(27),b9u=BigInt(28),w9u=BigInt(35),x9u=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function DC(u){return u==="0x"?null:Yu(u)}function Pk(u,e){try{return Fa(u)}catch(t){Q(!1,t.message,e,u)}}function a9(u,e){return u==="0x"?0:qu(u,e)}function o0(u,e){if(u==="0x")return B0;const t=Su(u,e);return Q(t<=x9u,"value exceeds uint size",e,t),t}function Ue(u,e){const t=Su(u,"value"),n=L0(t);return Q(n.length<=32,"value too large",`tx.${e}`,t),n}function Tk(u){return Fa(u).map(e=>[e.address,e.storageKeys])}function k9u(u){const e=AC(u);Q(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",u);const t={type:0,nonce:a9(e[0],"nonce"),gasPrice:o0(e[1],"gasPrice"),gasLimit:o0(e[2],"gasLimit"),to:DC(e[3]),value:o0(e[4],"value"),data:ku(e[5]),chainId:B0};if(e.length===6)return t;const n=o0(e[6],"v"),r=o0(e[7],"r"),i=o0(e[8],"s");if(r===B0&&i===B0)t.chainId=n;else{let a=(n-w9u)/F9u;a=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Eu(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Eu(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const r=[];return this.type!=null?r.push(this.type):t?r.push(2):e?(r.push(1),n||r.push(0)):n?(r.push(1),r.push(2)):(r.push(0),r.push(1),r.push(2)),r.sort(),r}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return fr.from(this)}toJSON(){const e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new fr;if(typeof e=="string"){const n=Zu(e);if(n[0]>=127)return fr.from(k9u(n));switch(n[0]){case 1:return fr.from(S9u(n));case 2:return fr.from(_9u(n))}Eu(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new fr;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=Mt.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.hash!=null&&(Q(t.isSigned(),"unsigned transaction cannot define hash","tx",e),Q(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Q(t.isSigned(),"unsigned transaction cannot define from","tx",e),Q(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}};bn=new WeakMap,So=new WeakMap,Po=new WeakMap,To=new WeakMap,Io=new WeakMap,Oo=new WeakMap,No=new WeakMap,Ro=new WeakMap,jo=new WeakMap,zo=new WeakMap,Mo=new WeakMap,Uo=new WeakMap;let C2=fr;const Ok=new Uint8Array(32);Ok.fill(0);const P9u=BigInt(-1),Nk=BigInt(0),Rk=BigInt(1),T9u=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function I9u(u){const e=Zu(u),t=e.length%32;return t?Te([e,Ok.slice(t)]):ku(e)}const O9u=Xr(Rk,32),N9u=Xr(Nk,32),x7={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},N1=["name","version","chainId","verifyingContract","salt"];function k7(u){return function(e){return Q(typeof e=="string",`invalid domain value for ${JSON.stringify(u)}`,`domain.${u}`,e),e}}const R9u={name:k7("name"),version:k7("version"),chainId:function(u){const e=Su(u,"domain.chainId");return Q(e>=0,"invalid chain ID","domain.chainId",u),Number.isSafeInteger(e)?Number(e):to(e)},verifyingContract:function(u){try{return Yu(u).toLowerCase()}catch{}Q(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",u)},salt:function(u){const e=Zu(u,"domain.salt");return Q(e.length===32,'invalid domain value "salt"',"domain.salt",u),ku(e)}};function R1(u){{const e=u.match(/^(u?)int(\d*)$/);if(e){const t=e[1]==="",n=parseInt(e[2]||"256");Q(n%8===0&&n!==0&&n<=256&&(e[2]==null||e[2]===String(n)),"invalid numeric width","type",u);const r=O4(T9u,t?n-1:n),i=t?(r+Rk)*P9u:Nk;return function(a){const o=Su(a,"value");return Q(o>=i&&o<=r,`value out-of-bounds for ${u}`,"value",o),Xr(t?Gx(o,256):o,32)}}}{const e=u.match(/^bytes(\d+)$/);if(e){const t=parseInt(e[1]);return Q(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",u),function(n){const r=Zu(n);return Q(r.length===t,`invalid length for ${u}`,"value",n),I9u(n)}}}switch(u){case"address":return function(e){return ca(Yu(e),32)};case"bool":return function(e){return e?O9u:N9u};case"bytes":return function(e){return fe(e)};case"string":return function(e){return Ea(e)}}return null}function _7(u,e){return`${u}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}var tl,wn,Lo,F2,jk;const Y0=class Y0{constructor(e){tu(this,F2);X(this,"primaryType");tu(this,tl,void 0);tu(this,wn,void 0);tu(this,Lo,void 0);R(this,tl,JSON.stringify(e)),R(this,wn,new Map),R(this,Lo,new Map);const t=new Map,n=new Map,r=new Map;Object.keys(e).forEach(o=>{t.set(o,new Set),n.set(o,[]),r.set(o,new Set)});for(const o in e){const s=new Set;for(const l of e[o]){Q(!s.has(l.name),`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(o)}`,"types",e),s.add(l.name);const c=l.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;Q(c!==o,`circular type reference to ${JSON.stringify(c)}`,"types",e),!R1(c)&&(Q(n.has(c),`unknown type ${JSON.stringify(c)}`,"types",e),n.get(c).push(o),t.get(o).add(c))}}const i=Array.from(n.keys()).filter(o=>n.get(o).length===0);Q(i.length!==0,"missing primary type","types",e),Q(i.length===1,`ambiguous primary types or unused types: ${i.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),Ou(this,{primaryType:i[0]});function a(o,s){Q(!s.has(o),`circular type reference to ${JSON.stringify(o)}`,"types",e),s.add(o);for(const l of t.get(o))if(n.has(l)){a(l,s);for(const c of s)r.get(c).add(l)}s.delete(o)}a(this.primaryType,new Set);for(const[o,s]of r){const l=Array.from(s);l.sort(),_(this,wn).set(o,_7(o,e[o])+l.map(c=>_7(c,e[c])).join(""))}}get types(){return JSON.parse(_(this,tl))}getEncoder(e){let t=_(this,Lo).get(e);return t||(t=yu(this,F2,jk).call(this,e),_(this,Lo).set(e,t)),t}encodeType(e){const t=_(this,wn).get(e);return Q(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return fe(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(R1(e))return n(e,t);const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r)return Q(!r[3]||parseInt(r[3])===t.length,`array length mismatch; expected length ${parseInt(r[3])}`,"value",t),t.map(a=>this._visit(r[1],a,n));const i=this.types[e];if(i)return i.reduce((a,{name:o,type:s})=>(a[o]=this._visit(s,t[o],n),a),{});Q(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Y0(e)}static getPrimaryType(e){return Y0.from(e).primaryType}static hashStruct(e,t,n){return Y0.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){if(e[n]==null)continue;const r=x7[n];Q(r,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:r})}return t.sort((n,r)=>N1.indexOf(n.name)-N1.indexOf(r.name)),Y0.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return Te(["0x1901",Y0.hashDomain(e),Y0.from(t).hash(n)])}static hash(e,t,n){return fe(Y0.encode(e,t,n))}static async resolveNames(e,t,n,r){e=Object.assign({},e);for(const o in e)e[o]==null&&delete e[o];const i={};e.verifyingContract&&!pe(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const a=Y0.from(t);a.visit(n,(o,s)=>(o==="address"&&!pe(s,20)&&(i[s]="0x"),s));for(const o in i)i[o]=await r(o);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=a.visit(n,(o,s)=>o==="address"&&i[s]?i[s]:s),{domain:e,value:n}}static getPayload(e,t,n){Y0.hashDomain(e);const r={},i=[];N1.forEach(s=>{const l=e[s];l!=null&&(r[s]=R9u[s](l),i.push({name:s,type:x7[s]}))});const a=Y0.from(t),o=Object.assign({},t);return Q(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),o.EIP712Domain=i,a.encode(n),{types:o,domain:r,primaryType:a.primaryType,message:a.visit(n,(s,l)=>{if(s.match(/^bytes(\d*)/))return ku(Zu(l));if(s.match(/^u?int/))return Su(l).toString();switch(s){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return Q(typeof l=="string","invalid string","value",l),l}Q(!1,"unsupported type","type",s)})}}};tl=new WeakMap,wn=new WeakMap,Lo=new WeakMap,F2=new WeakSet,jk=function(e){{const r=R1(e);if(r)return r}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const r=t[1],i=this.getEncoder(r);return a=>{Q(!t[3]||parseInt(t[3])===a.length,`array length mismatch; expected length ${parseInt(t[3])}`,"value",a);let o=a.map(i);return _(this,wn).has(r)&&(o=o.map(fe)),fe(Te(o))}}const n=this.types[e];if(n){const r=Ea(_(this,wn).get(e));return i=>{const a=n.map(({name:o,type:s})=>{const l=this.getEncoder(s)(i[o]);return _(this,wn).has(s)?fe(l):l});return a.unshift(r),Te(a)}}Q(!1,`unknown type: ${e}`,"type",e)};let m2=Y0;function E0(u){const e=new Set;return u.forEach(t=>e.add(t)),Object.freeze(e)}const j9u="external public payable",z9u=E0(j9u.split(" ")),zk="constant external internal payable private public pure view",M9u=E0(zk.split(" ")),Mk="constructor error event fallback function receive struct",Uk=E0(Mk.split(" ")),Lk="calldata memory storage payable indexed",U9u=E0(Lk.split(" ")),L9u="tuple returns",$9u=[Mk,Lk,L9u,zk].join(" "),W9u=E0($9u.split(" ")),q9u={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},H9u=new RegExp("^(\\s*)"),G9u=new RegExp("^([0-9]+)"),K9u=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),$k=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),Wk=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var ze,xt,nl,ap;const D2=class D2{constructor(e){tu(this,nl);tu(this,ze,void 0);tu(this,xt,void 0);R(this,ze,0),R(this,xt,e.slice())}get offset(){return _(this,ze)}get length(){return _(this,xt).length-_(this,ze)}clone(){return new D2(_(this,xt))}reset(){R(this,ze,0)}popKeyword(e){const t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=yu(this,nl,ap).call(this,_(this,ze)+1,e.match+1);return R(this,ze,e.match+1),t}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=[];for(;_(this,ze)=_(this,xt).length)throw new Error("out-of-bounds");return _(this,xt)[_(this,ze)]}peekKeyword(e){const t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return i4(this,ze)._++,e}toString(){const e=[];for(let t=_(this,ze);t<_(this,xt).length;t++){const n=_(this,xt)[t];e.push(`${n.type}:${n.text}`)}return``}};ze=new WeakMap,xt=new WeakMap,nl=new WeakSet,ap=function(e=0,t=0){return new D2(_(this,xt).slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let Ut=D2;function li(u){const e=[],t=a=>{const o=i0&&e[e.length-1].type==="NUMBER"){const E=e.pop().text;c=E+c,e[e.length-1].value=qu(E)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=c}continue}if(o=a.match(K9u),o){if(s.text=o[1],i+=s.text.length,W9u.has(s.text)){s.type="KEYWORD";continue}if(s.text.match(Wk)){s.type="TYPE";continue}s.type="ID";continue}if(o=a.match(G9u),o){s.text=o[1],s.type="NUMBER",i+=s.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${i}`)}return new Ut(e.map(a=>Object.freeze(a)))}function S7(u,e){let t=[];for(const n in e.keys())u.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function o9(u,e){if(e.peekKeyword(Uk)){const t=e.pop().text;if(t!==u)throw new Error(`expected ${u}, got ${t}`)}return e.popType("ID")}function Xn(u,e){const t=new Set;for(;;){const n=u.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(u.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function qk(u){let e=Xn(u,M9u);return S7(e,E0("constant payable nonpayable".split(" "))),S7(e,E0("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function qn(u,e){return u.popParams().map(t=>$e.from(t,e))}function Hk(u){if(u.peekType("AT")){if(u.pop(),u.peekType("NUMBER"))return Su(u.pop().text);throw new Error("invalid gas")}return null}function da(u){if(u.length)throw new Error(`unexpected tokens: ${u.toString()}`)}const Q9u=new RegExp(/^(.*)\[([0-9]*)\]$/);function P7(u){const e=u.match(Wk);if(Q(e,"invalid type","type",u),u==="uint")return"uint256";if(u==="int")return"int256";if(e[2]){const t=parseInt(e[2]);Q(t!==0&&t<=32,"invalid bytes length","type",u)}else if(e[3]){const t=parseInt(e[3]);Q(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",u)}return u}const de={},P0=Symbol.for("_ethers_internal"),T7="_ParamTypeInternal",I7="_ErrorInternal",O7="_EventInternal",N7="_ConstructorInternal",R7="_FallbackInternal",j7="_FunctionInternal",z7="_StructInternal";var $o,rE;const X0=class X0{constructor(e,t,n,r,i,a,o,s){tu(this,$o);X(this,"name");X(this,"type");X(this,"baseType");X(this,"indexed");X(this,"components");X(this,"arrayLength");X(this,"arrayChildren");if(t9(e,de,"ParamType"),Object.defineProperty(this,P0,{value:T7}),a&&(a=Object.freeze(a.slice())),r==="array"){if(o==null||s==null)throw new Error("")}else if(o!=null||s!=null)throw new Error("");if(r==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");Ou(this,{name:t,type:n,baseType:r,indexed:i,components:a,arrayLength:o,arrayChildren:s})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=n,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const r={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(r)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(t+=this.type),t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")"):t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(r=>n.arrayChildren.walk(r,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((r,i)=>n.components[i].walk(r,t))}return t(this.type,e)}async walkAsync(e,t){const n=[],r=[e];return yu(this,$o,rE).call(this,n,e,t,i=>{r[0]=i}),n.length&&await Promise.all(n),r[0]}static from(e,t){if(X0.isParamType(e))return e;if(typeof e=="string")try{return X0.from(li(e),t)}catch{Q(!1,"invalid param type","obj",e)}else if(e instanceof Ut){let o="",s="",l=null;Xn(e,E0(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(s="tuple",l=e.popParams().map(h=>X0.from(h)),o=`tuple(${l.map(h=>h.format()).join(",")})`):(o=P7(e.popType("TYPE")),s=o);let c=null,E=null;for(;e.length&&e.peekType("BRACKET");){const h=e.pop();c=new X0(de,"",o,s,null,l,E,c),E=h.value,o+=h.text,s="array",l=null}let d=null;if(Xn(e,U9u).has("indexed")){if(!t)throw new Error("");d=!0}const m=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new X0(de,m,o,s,d,l,E,c)}const n=e.name;Q(!n||typeof n=="string"&&n.match($k),"invalid name","obj.name",n);let r=e.indexed;r!=null&&(Q(t,"parameter cannot be indexed","obj.indexed",e.indexed),r=!!r);let i=e.type,a=i.match(Q9u);if(a){const o=parseInt(a[2]||"-1"),s=X0.from({type:a[1],components:e.components});return new X0(de,n||"",i,"array",r,null,o,s)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const o=e.components!=null?e.components.map(l=>X0.from(l)):null;return new X0(de,n||"",i,"tuple",r,o,null,null)}return i=P7(e.type),new X0(de,n||"",i,i,r,null,null,null)}static isParamType(e){return e&&e[P0]===T7}};$o=new WeakSet,rE=function(e,t,n,r){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,o=t.slice();o.forEach((s,l)=>{var c;yu(c=a,$o,rE).call(c,e,s,n,E=>{o[l]=E})}),r(o);return}if(this.isTuple()){const a=this.components;let o;if(Array.isArray(t))o=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");o=a.map(s=>{if(!s.name)throw new Error("cannot use object value with unnamed components");if(!(s.name in t))throw new Error(`missing value for component ${s.name}`);return t[s.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((s,l)=>{var c;yu(c=a[l],$o,rE).call(c,e,s,n,E=>{o[l]=E})}),r(o);return}const i=n(this.type,t);i.then?e.push(async function(){r(await i)}()):r(i)};let $e=X0;class fa{constructor(e,t,n){X(this,"type");X(this,"inputs");t9(e,de,"Fragment"),n=Object.freeze(n.slice()),Ou(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{fa.from(JSON.parse(e))}catch{}return fa.from(li(e))}if(e instanceof Ut)switch(e.peekKeyword(Uk)){case"constructor":return Mn.from(e);case"error":return v0.from(e);case"event":return an.from(e);case"fallback":case"receive":return An.from(e);case"function":return on.from(e);case"struct":return ea.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Mn.from(e);case"error":return v0.from(e);case"event":return an.from(e);case"fallback":case"receive":return An.from(e);case"function":return on.from(e);case"struct":return ea.from(e)}Eu(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Q(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Mn.isFragment(e)}static isError(e){return v0.isFragment(e)}static isEvent(e){return an.isFragment(e)}static isFunction(e){return on.isFragment(e)}static isStruct(e){return ea.isFragment(e)}}class s9 extends fa{constructor(t,n,r,i){super(t,n,i);X(this,"name");Q(typeof r=="string"&&r.match($k),"invalid identifier","name",r),i=Object.freeze(i.slice()),Ou(this,{name:r})}}function J3(u,e){return"("+e.map(t=>t.format(u)).join(u==="full"?", ":",")+")"}class v0 extends s9{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,P0,{value:I7})}get selector(){return Ea(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+J3(e,this.inputs)),t.join(" ")}static from(e){if(v0.isFragment(e))return e;if(typeof e=="string")return v0.from(li(e));if(e instanceof Ut){const t=o9("error",e),n=qn(e);return da(e),new v0(de,t,n)}return new v0(de,e.name,e.inputs?e.inputs.map($e.from):[])}static isFragment(e){return e&&e[P0]===I7}}class an extends s9{constructor(t,n,r,i){super(t,"event",n,r);X(this,"anonymous");Object.defineProperty(this,P0,{value:O7}),Ou(this,{anonymous:i})}get topicHash(){return Ea(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const n=[];return t!=="sighash"&&n.push("event"),n.push(this.name+J3(t,this.inputs)),t!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(t,n){return n=(n||[]).map(i=>$e.from(i)),new an(de,t,n,!1).topicHash}static from(t){if(an.isFragment(t))return t;if(typeof t=="string")try{return an.from(li(t))}catch{Q(!1,"invalid event fragment","obj",t)}else if(t instanceof Ut){const n=o9("event",t),r=qn(t,!0),i=!!Xn(t,E0(["anonymous"])).has("anonymous");return da(t),new an(de,n,r,i)}return new an(de,t.name,t.inputs?t.inputs.map(n=>$e.from(n,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[P0]===O7}}class Mn extends fa{constructor(t,n,r,i,a){super(t,n,r);X(this,"payable");X(this,"gas");Object.defineProperty(this,P0,{value:N7}),Ou(this,{payable:i,gas:a})}format(t){if(Eu(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const n=[`constructor${J3(t,this.inputs)}`];return n.push(this.payable?"payable":"nonpayable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(t){if(Mn.isFragment(t))return t;if(typeof t=="string")try{return Mn.from(li(t))}catch{Q(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof Ut){Xn(t,E0(["constructor"]));const n=qn(t),r=!!Xn(t,z9u).has("payable"),i=Hk(t);return da(t),new Mn(de,"constructor",n,r,i)}return new Mn(de,"constructor",t.inputs?t.inputs.map($e.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[P0]===N7}}class An extends fa{constructor(t,n,r){super(t,"fallback",n);X(this,"payable");Object.defineProperty(this,P0,{value:R7}),Ou(this,{payable:r})}format(t){const n=this.inputs.length===0?"receive":"fallback";if(t==="json"){const r=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:r})}return`${n}()${this.payable?" payable":""}`}static from(t){if(An.isFragment(t))return t;if(typeof t=="string")try{return An.from(li(t))}catch{Q(!1,"invalid fallback fragment","obj",t)}else if(t instanceof Ut){const n=t.toString(),r=t.peekKeyword(E0(["fallback","receive"]));if(Q(r,"type must be fallback or receive","obj",n),t.popKeyword(E0(["fallback","receive"]))==="receive"){const s=qn(t);return Q(s.length===0,"receive cannot have arguments","obj.inputs",s),Xn(t,E0(["payable"])),da(t),new An(de,[],!0)}let a=qn(t);a.length?Q(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(s=>s.format("minimal")).join(", ")):a=[$e.from("bytes")];const o=qk(t);if(Q(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),Xn(t,E0(["returns"])).has("returns")){const s=qn(t);Q(s.length===1&&s[0].type==="bytes","invalid fallback outputs","obj.outputs",s.map(l=>l.format("minimal")).join(", "))}return da(t),new An(de,a,o==="payable")}if(t.type==="receive")return new An(de,[],!0);if(t.type==="fallback"){const n=[$e.from("bytes")],r=t.stateMutability==="payable";return new An(de,n,r)}Q(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[P0]===R7}}class on extends s9{constructor(t,n,r,i,a,o){super(t,"function",n,i);X(this,"constant");X(this,"outputs");X(this,"stateMutability");X(this,"payable");X(this,"gas");Object.defineProperty(this,P0,{value:j7}),a=Object.freeze(a.slice()),Ou(this,{constant:r==="view"||r==="pure",gas:o,outputs:a,payable:r==="payable",stateMutability:r})}get selector(){return Ea(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t))),outputs:this.outputs.map(r=>JSON.parse(r.format(t)))});const n=[];return t!=="sighash"&&n.push("function"),n.push(this.name+J3(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(J3(t,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(t,n){return n=(n||[]).map(i=>$e.from(i)),new on(de,t,"view",n,[],null).selector}static from(t){if(on.isFragment(t))return t;if(typeof t=="string")try{return on.from(li(t))}catch{Q(!1,"invalid function fragment","obj",t)}else if(t instanceof Ut){const r=o9("function",t),i=qn(t),a=qk(t);let o=[];Xn(t,E0(["returns"])).has("returns")&&(o=qn(t));const s=Hk(t);return da(t),new on(de,r,a,i,o,s)}let n=t.stateMutability;return n==null&&(n="payable",typeof t.constant=="boolean"?(n="view",t.constant||(n="payable",typeof t.payable=="boolean"&&!t.payable&&(n="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(n="nonpayable")),new on(de,t.name,n,t.inputs?t.inputs.map($e.from):[],t.outputs?t.outputs.map($e.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[P0]===j7}}class ea extends s9{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,P0,{value:z7})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return ea.from(li(e))}catch{Q(!1,"invalid struct fragment","obj",e)}else if(e instanceof Ut){const t=o9("struct",e),n=qn(e);return da(e),new ea(de,t,n)}return new ea(de,e.name,e.inputs?e.inputs.map($e.from):[])}static isFragment(e){return e&&e[P0]===z7}}const $t=new Map;$t.set(0,"GENERIC_PANIC");$t.set(1,"ASSERT_FALSE");$t.set(17,"OVERFLOW");$t.set(18,"DIVIDE_BY_ZERO");$t.set(33,"ENUM_RANGE_ERROR");$t.set(34,"BAD_STORAGE_DATA");$t.set(49,"STACK_UNDERFLOW");$t.set(50,"ARRAY_RANGE_ERROR");$t.set(65,"OUT_OF_MEMORY");$t.set(81,"UNINITIALIZED_FUNCTION_CALL");const V9u=new RegExp(/^bytes([0-9]*)$/),J9u=new RegExp(/^(u?int)([0-9]*)$/);let j1=null;function Y9u(u,e,t,n){let r="missing revert data",i=null;const a=null;let o=null;if(t){r="execution reverted";const l=Zu(t);if(t=ku(t),l.length===0)r+=" (no data present; likely require(false) occurred",i="require(false)";else if(l.length%32!==4)r+=" (could not decode reason; invalid data length)";else if(ku(l.slice(0,4))==="0x08c379a0")try{i=n.decode(["string"],l.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[i]},r+=`: ${JSON.stringify(i)}`}catch{r+=" (could not decode reason; invalid string data)"}else if(ku(l.slice(0,4))==="0x4e487b71")try{const c=Number(n.decode(["uint256"],l.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[c]},i=`Panic due to ${$t.get(c)||"UNKNOWN"}(${c})`,r+=`: ${i}`}catch{r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const s={to:e.to?Yu(e.to):null,data:e.data||"0x"};return e.from&&(s.from=Yu(e.from)),be(r,"CALL_EXCEPTION",{action:u,data:t,reason:i,transaction:s,invocation:a,revert:o})}var yr,Ma;const b2=class b2{constructor(){tu(this,yr)}getDefaultValue(e){const t=e.map(r=>yu(this,yr,Ma).call(this,$e.from(r)));return new Tc(t,"_").defaultValue()}encode(e,t){Wx(t.length,e.length,"types/values length mismatch");const n=e.map(a=>yu(this,yr,Ma).call(this,$e.from(a))),r=new Tc(n,"_"),i=new Yf;return r.encode(i,t),i.data}decode(e,t,n){const r=e.map(a=>yu(this,yr,Ma).call(this,$e.from(a)));return new Tc(r,"_").decode(new Xf(t,n))}static defaultAbiCoder(){return j1==null&&(j1=new b2),j1}static getBuiltinCallException(e,t,n){return Y9u(e,t,n,b2.defaultAbiCoder())}};yr=new WeakSet,Ma=function(e){if(e.isArray())return new wdu(yu(this,yr,Ma).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Tc(e.components.map(n=>yu(this,yr,Ma).call(this,n)),e.name);switch(e.baseType){case"address":return new Ddu(e.name);case"bool":return new xdu(e.name);case"string":return new Rdu(e.name);case"bytes":return new kdu(e.name);case"":return new Pdu(e.name)}let t=e.type.match(J9u);if(t){let n=parseInt(t[2]||"256");return Q(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new Ndu(n/8,t[1]==="int",e.name)}if(t=e.type.match(V9u),t){let n=parseInt(t[1]);return Q(n!==0&&n<=32,"invalid bytes length","param",e),new _du(n,e.name)}Q(!1,"invalid type","type",e.type)};let Y3=b2;class X9u{constructor(e,t,n){X(this,"fragment");X(this,"name");X(this,"signature");X(this,"topic");X(this,"args");const r=e.name,i=e.format();Ou(this,{fragment:e,name:r,signature:i,topic:t,args:n})}}class Z9u{constructor(e,t,n,r){X(this,"fragment");X(this,"name");X(this,"args");X(this,"signature");X(this,"selector");X(this,"value");const i=e.name,a=e.format();Ou(this,{fragment:e,name:i,args:n,signature:a,selector:t,value:r})}}class u1u{constructor(e,t,n){X(this,"fragment");X(this,"name");X(this,"args");X(this,"signature");X(this,"selector");const r=e.name,i=e.format();Ou(this,{fragment:e,name:r,args:n,signature:i,selector:t})}}class M7{constructor(e){X(this,"hash");X(this,"_isIndexed");Ou(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const U7={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},L7={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:u=>`reverted with reason string ${JSON.stringify(u)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:u=>{let e="unknown panic code";return u>=0&&u<=255&&U7[u.toString()]&&(e=U7[u.toString()]),`reverted with panic code 0x${u.toString(16)} (${e})`}}};var Jt,Yt,Xt,Ve,Wo,iE,qo,aE;const ro=class ro{constructor(e){tu(this,Wo);tu(this,qo);X(this,"fragments");X(this,"deploy");X(this,"fallback");X(this,"receive");tu(this,Jt,void 0);tu(this,Yt,void 0);tu(this,Xt,void 0);tu(this,Ve,void 0);let t=[];typeof e=="string"?t=JSON.parse(e):t=e,R(this,Xt,new Map),R(this,Jt,new Map),R(this,Yt,new Map);const n=[];for(const a of t)try{n.push(fa.from(a))}catch(o){console.log("EE",o)}Ou(this,{fragments:Object.freeze(n)});let r=null,i=!1;R(this,Ve,this.getAbiCoder()),this.fragments.forEach((a,o)=>{let s;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Ou(this,{deploy:a});return;case"fallback":a.inputs.length===0?i=!0:(Q(!r||a.payable!==r.payable,"conflicting fallback fragments",`fragments[${o}]`,a),r=a,i=r.payable);return;case"function":s=_(this,Xt);break;case"event":s=_(this,Yt);break;case"error":s=_(this,Jt);break;default:return}const l=a.format();s.has(l)||s.set(l,a)}),this.deploy||Ou(this,{deploy:Mn.from("constructor()")}),Ou(this,{fallback:r,receive:i})}format(e){const t=e?"minimal":"full";return this.fragments.map(r=>r.format(t))}formatJson(){const e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return Y3.defaultAbiCoder()}getFunctionName(e){const t=yu(this,Wo,iE).call(this,e,null,!1);return Q(t,"no matching function","key",e),t.name}hasFunction(e){return!!yu(this,Wo,iE).call(this,e,null,!1)}getFunction(e,t){return yu(this,Wo,iE).call(this,e,t||null,!0)}forEachFunction(e){const t=Array.from(_(this,Xt).keys());t.sort((n,r)=>n.localeCompare(r));for(let n=0;nn.localeCompare(r));for(let n=0;n1){const i=r.map(a=>JSON.stringify(a.format())).join(", ");Q(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return r[0]}if(e=v0.from(e).format(),e==="Error(string)")return v0.from("error Error(string)");if(e==="Panic(uint256)")return v0.from("error Panic(uint256)");const n=_(this,Jt).get(e);return n||null}forEachError(e){const t=Array.from(_(this,Jt).keys());t.sort((n,r)=>n.localeCompare(r));for(let n=0;ni.type==="string"?Ea(a):i.type==="bytes"?fe(ku(a)):(i.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":i.type.match(/^u?int/)?a=Xr(a):i.type.match(/^bytes/)?a=Y2u(a,32):i.type==="address"&&_(this,Ve).encode(["address"],[a]),ca(ku(a),32));for(t.forEach((i,a)=>{const o=e.inputs[a];if(!o.indexed){Q(i==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,i);return}i==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?Q(!1,"filtering with tuples or arrays not supported","contract."+o.name,i):Array.isArray(i)?n.push(i.map(s=>r(o,s))):n.push(r(o,i))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){const a=this.getEvent(e);Q(a,"unknown event","eventFragment",e),e=a}const n=[],r=[],i=[];return e.anonymous||n.push(e.topicHash),Q(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((a,o)=>{const s=t[o];if(a.indexed)if(a.type==="string")n.push(Ea(s));else if(a.type==="bytes")n.push(fe(s));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(_(this,Ve).encode([a.type],[s]))}else r.push(a),i.push(s)}),{data:_(this,Ve).encode(r,i),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){const f=this.getEvent(e);Q(f,"unknown event","eventFragment",e),e=f}if(n!=null&&!e.anonymous){const f=e.topicHash;Q(pe(n[0],32)&&n[0].toLowerCase()===f,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const r=[],i=[],a=[];e.inputs.forEach((f,m)=>{f.indexed?f.type==="string"||f.type==="bytes"||f.baseType==="tuple"||f.baseType==="array"?(r.push($e.from({type:"bytes32",name:f.name})),a.push(!0)):(r.push(f),a.push(!1)):(i.push(f),a.push(!1))});const o=n!=null?_(this,Ve).decode(r,Te(n)):null,s=_(this,Ve).decode(i,t,!0),l=[],c=[];let E=0,d=0;return e.inputs.forEach((f,m)=>{let h=null;if(f.indexed)if(o==null)h=new M7(null);else if(a[m])h=new M7(o[d++]);else try{h=o[d++]}catch(B){h=B}else try{h=s[E++]}catch(B){h=B}l.push(h),c.push(f.name||null)}),E2.fromItems(l,c)}parseTransaction(e){const t=Zu(e.data,"tx.data"),n=Su(e.value!=null?e.value:0,"tx.value"),r=this.getFunction(ku(t.slice(0,4)));if(!r)return null;const i=_(this,Ve).decode(r.inputs,t.slice(4));return new Z9u(r,r.selector,i,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new X9u(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=ku(e),n=this.getError(me(t,0,4));if(!n)return null;const r=_(this,Ve).decode(n.inputs,me(t,4));return new u1u(n,n.selector,r)}static from(e){return e instanceof ro?e:typeof e=="string"?new ro(JSON.parse(e)):typeof e.format=="function"?new ro(e.format("json")):new ro(e)}};Jt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,Ve=new WeakMap,Wo=new WeakSet,iE=function(e,t,n){if(pe(e)){const i=e.toLowerCase();for(const a of _(this,Xt).values())if(i===a.selector)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,o]of _(this,Xt))a.split("(")[0]===e&&i.push(o);if(t){const a=t.length>0?t[t.length-1]:null;let o=t.length,s=!0;t0.isTyped(a)&&a.type==="overrides"&&(s=!1,o--);for(let l=i.length-1;l>=0;l--){const c=i[l].inputs.length;c!==o&&(!s||c!==o-1)&&i.splice(l,1)}for(let l=i.length-1;l>=0;l--){const c=i[l].inputs;for(let E=0;E=c.length){if(t[E].type==="overrides")continue;i.splice(l,1);break}if(t[E].type!==c[E].baseType){i.splice(l,1);break}}}}if(i.length===1&&t&&t.length!==i[0].inputs.length){const a=t[t.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&n){const a=i.map(o=>JSON.stringify(o.format())).join(", ");Q(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return i[0]}const r=_(this,Xt).get(on.from(e).format());return r||null},qo=new WeakSet,aE=function(e,t,n){if(pe(e)){const i=e.toLowerCase();for(const a of _(this,Yt).values())if(i===a.topicHash)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,o]of _(this,Yt))a.split("(")[0]===e&&i.push(o);if(t){for(let a=i.length-1;a>=0;a--)i[a].inputs.length=0;a--){const o=i[a].inputs;for(let s=0;s1&&n){const a=i.map(o=>JSON.stringify(o.format())).join(", ");Q(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return i[0]}const r=_(this,Yt).get(an.from(e).format());return r||null};let op=ro;const Gk=BigInt(0);function Z4(u){return u??null}function Ze(u){return u==null?null:u.toString()}class $7{constructor(e,t,n){X(this,"gasPrice");X(this,"maxFeePerGas");X(this,"maxPriorityFeePerGas");Ou(this,{gasPrice:Z4(e),maxFeePerGas:Z4(t),maxPriorityFeePerGas:Z4(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Ze(e),maxFeePerGas:Ze(t),maxPriorityFeePerGas:Ze(n)}}}function g2(u){const e={};u.to&&(e.to=u.to),u.from&&(e.from=u.from),u.data&&(e.data=ku(u.data));const t="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const r of t)!(r in u)||u[r]==null||(e[r]=Su(u[r],`request.${r}`));const n="type,nonce".split(/,/);for(const r of n)!(r in u)||u[r]==null||(e[r]=qu(u[r],`request.${r}`));return u.accessList&&(e.accessList=Fa(u.accessList)),"blockTag"in u&&(e.blockTag=u.blockTag),"enableCcipRead"in u&&(e.enableCcipRead=!!u.enableCcipRead),"customData"in u&&(e.customData=u.customData),e}var xn;class e1u{constructor(e,t){X(this,"provider");X(this,"number");X(this,"hash");X(this,"timestamp");X(this,"parentHash");X(this,"nonce");X(this,"difficulty");X(this,"gasLimit");X(this,"gasUsed");X(this,"miner");X(this,"extraData");X(this,"baseFeePerGas");tu(this,xn,void 0);R(this,xn,e.transactions.map(n=>typeof n!="string"?new X3(n,t):n)),Ou(this,{provider:t,hash:Z4(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:Z4(e.baseFeePerGas)})}get transactions(){return _(this,xn).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=_(this,xn).slice();return e.length===0?[]:(Eu(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:r,gasUsed:i,hash:a,miner:o,nonce:s,number:l,parentHash:c,timestamp:E,transactions:d}=this;return{_type:"Block",baseFeePerGas:Ze(e),difficulty:Ze(t),extraData:n,gasLimit:Ze(r),gasUsed:Ze(i),hash:a,miner:o,nonce:s,number:l,parentHash:c,timestamp:E,transactions:d}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>enew Jl(r,t))));let n=Gk;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Ou(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:n,type:e.type,status:e.status,root:e.root})}get logs(){return _(this,rl)}toJSON(){const{to:e,from:t,contractAddress:n,hash:r,index:i,blockHash:a,blockNumber:o,logsBloom:s,logs:l,status:c,root:E}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:n,cumulativeGasUsed:Ze(this.cumulativeGasUsed),from:t,gasPrice:Ze(this.gasPrice),gasUsed:Ze(this.gasUsed),hash:r,index:i,logs:l,logsBloom:s,root:E,status:c,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(o)return null;const{blockNumber:d,nonce:f}=await a0({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(f{if(d==null||d.status!==0)return d;Eu(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},c=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(c);if(c){if(await c.confirmations()>=n)return l(c)}else if(await s(),n===0)return null;return await new Promise((d,f)=>{const m=[],h=()=>{m.forEach(g=>g())};if(m.push(()=>{o=!0}),r>0){const g=setTimeout(()=>{h(),f(be("wait for transaction timeout","TIMEOUT"))},r);m.push(()=>{clearTimeout(g)})}const B=async g=>{if(await g.confirmations()>=n){h();try{d(l(g))}catch(C){f(C)}}};if(m.push(()=>{this.provider.off(this.hash,B)}),this.provider.on(this.hash,B),i>=0){const g=async()=>{try{await s()}catch(C){if(Et(C,"TRANSACTION_REPLACED")){h(),f(C);return}}o||this.provider.once("block",g)};m.push(()=>{this.provider.off("block",g)}),this.provider.once("block",g)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return Eu(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Vk(this)}reorderedEvent(e){return Eu(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Eu(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Qk(this,e)}replaceableTransaction(e){Q(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new TC(this,this.provider);return R(t,Br,e),t}};Br=new WeakMap;let X3=TC;function t1u(u){return{orphan:"drop-block",hash:u.hash,number:u.number}}function Qk(u,e){return{orphan:"reorder-transaction",tx:u,other:e}}function Vk(u){return{orphan:"drop-transaction",tx:u}}function n1u(u){return{orphan:"drop-log",log:{transactionHash:u.transactionHash,blockHash:u.blockHash,blockNumber:u.blockNumber,address:u.address,data:u.data,topics:Object.freeze(u.topics.slice()),index:u.index}}}class bC extends Jl{constructor(t,n,r){super(t,t.provider);X(this,"interface");X(this,"fragment");X(this,"args");const i=n.decodeEventLog(r,t.data,t.topics);Ou(this,{args:i,fragment:r,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class Jk extends Jl{constructor(t,n){super(t,t.provider);X(this,"error");Ou(this,{error:n})}}var Ho;class r1u extends Kk{constructor(t,n,r){super(r,n);tu(this,Ho,void 0);R(this,Ho,t)}get logs(){return super.logs.map(t=>{const n=t.topics.length?_(this,Ho).getEvent(t.topics[0]):null;if(n)try{return new bC(t,_(this,Ho),n)}catch(r){return new Jk(t,r)}return t})}}Ho=new WeakMap;var il;class wC extends X3{constructor(t,n,r){super(r,n);tu(this,il,void 0);R(this,il,t)}async wait(t){const n=await super.wait(t);return n==null?null:new r1u(_(this,il),this.provider,n)}}il=new WeakMap;class Yk extends Kx{constructor(t,n,r,i){super(t,n,r);X(this,"log");Ou(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class i1u extends Yk{constructor(e,t,n,r,i){super(e,t,n,new bC(i,e.interface,r));const a=e.interface.decodeEventLog(r,this.log.data,this.log.topics);Ou(this,{args:a,fragment:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const W7=BigInt(0);function Xk(u){return u&&typeof u.call=="function"}function Zk(u){return u&&typeof u.estimateGas=="function"}function l9(u){return u&&typeof u.resolveName=="function"}function u_(u){return u&&typeof u.sendTransaction=="function"}function e_(u){if(u!=null){if(l9(u))return u;if(u.provider)return u.provider}}var al;class a1u{constructor(e,t,n){tu(this,al,void 0);X(this,"fragment");if(Ou(this,{fragment:t}),t.inputs.lengthn[s]==null?null:o.walkAsync(n[s],(c,E)=>c==="address"?Array.isArray(E)?Promise.all(E.map(d=>c0(d,i))):c0(E,i):E)));return e.interface.encodeFilterTopics(t,a)}())}getTopicFilter(){return _(this,al)}}al=new WeakMap;function pa(u,e){return u==null?null:typeof u[e]=="function"?u:u.provider&&typeof u.provider[e]=="function"?u.provider:null}function ki(u){return u==null?null:u.provider||null}async function t_(u,e){const t=t0.dereference(u,"overrides");Q(typeof t=="object","invalid overrides parameter","overrides",u);const n=g2(t);return Q(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),Q(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function o1u(u,e,t){const n=pa(u,"resolveName"),r=l9(n)?n:null;return await Promise.all(e.map((i,a)=>i.walkAsync(t[a],(o,s)=>(s=t0.dereference(s,o),o==="address"?c0(s,r):s))))}function s1u(u){const e=async function(a){const o=await t_(a,["data"]);o.to=await u.getAddress(),o.from&&(o.from=await c0(o.from,e_(u.runner)));const s=u.interface,l=Su(o.value||W7,"overrides.value")===W7,c=(o.data||"0x")==="0x";s.fallback&&!s.fallback.payable&&s.receive&&!c&&!l&&Q(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),Q(s.fallback||c,"cannot send data to receive-only contract","overrides.data",o.data);const E=s.receive||s.fallback&&s.fallback.payable;return Q(E||l,"cannot send value to non-payable fallback","overrides.value",o.value),Q(s.fallback||c,"cannot send data to receive-only contract","overrides.data",o.data),o},t=async function(a){const o=pa(u.runner,"call");Eu(Xk(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const s=await e(a);try{return await o.call(s)}catch(l){throw CC(l)&&l.data?u.interface.makeError(l.data,s):l}},n=async function(a){const o=u.runner;Eu(u_(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const s=await o.sendTransaction(await e(a)),l=ki(u.runner);return new wC(u.interface,l,s)},r=async function(a){const o=pa(u.runner,"estimateGas");return Eu(Zk(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(a))},i=async a=>await n(a);return Ou(i,{_contract:u,estimateGas:r,populateTransaction:e,send:n,staticCall:t}),i}function l1u(u,e){const t=function(...l){const c=u.interface.getFunction(e,l);return Eu(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:l}}),c},n=async function(...l){const c=t(...l);let E={};if(c.inputs.length+1===l.length&&(E=await t_(l.pop()),E.from&&(E.from=await c0(E.from,e_(u.runner)))),c.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const d=await o1u(u.runner,c.inputs,l);return Object.assign({},E,await a0({to:u.getAddress(),data:u.interface.encodeFunctionData(c,d)}))},r=async function(...l){const c=await o(...l);return c.length===1?c[0]:c},i=async function(...l){const c=u.runner;Eu(u_(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const E=await c.sendTransaction(await n(...l)),d=ki(u.runner);return new wC(u.interface,d,E)},a=async function(...l){const c=pa(u.runner,"estimateGas");return Eu(Zk(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await n(...l))},o=async function(...l){const c=pa(u.runner,"call");Eu(Xk(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const E=await n(...l);let d="0x";try{d=await c.call(E)}catch(m){throw CC(m)&&m.data?u.interface.makeError(m.data,E):m}const f=t(...l);return u.interface.decodeFunctionResult(f,d)},s=async(...l)=>t(...l).constant?await r(...l):await i(...l);return Ou(s,{name:u.interface.getFunctionName(e),_contract:u,_key:e,getFragment:t,estimateGas:a,populateTransaction:n,send:i,staticCall:r,staticCallResult:o}),Object.defineProperty(s,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=u.interface.getFunction(e);return Eu(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),l}}),s}function c1u(u,e){const t=function(...r){const i=u.interface.getEvent(e,r);return Eu(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:r}}),i},n=function(...r){return new a1u(u,t(...r),r)};return Ou(n,{name:u.interface.getEventName(e),_contract:u,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=u.interface.getEvent(e);return Eu(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),r}}),n}const A2=Symbol.for("_ethersInternal_contract"),n_=new WeakMap;function E1u(u,e){n_.set(u[A2],e)}function O0(u){return n_.get(u[A2])}function d1u(u){return u&&typeof u=="object"&&"getTopicFilter"in u&&typeof u.getTopicFilter=="function"&&u.fragment}async function xC(u,e){let t,n=null;if(Array.isArray(e)){const i=function(a){if(pe(a,32))return a;const o=u.interface.getEvent(a);return Q(o,"unknown fragment","name",a),o.topicHash};t=e.map(a=>a==null?null:Array.isArray(a)?a.map(i):i(a))}else e==="*"?t=[null]:typeof e=="string"?pe(e,32)?t=[e]:(n=u.interface.getEvent(e),Q(n,"unknown fragment","event",e),t=[n.topicHash]):d1u(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):Q(!1,"unknown event name","event",e);t=t.map(i=>{if(i==null)return null;if(Array.isArray(i)){const a=Array.from(new Set(i.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return i.toLowerCase()});const r=t.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:n,tag:r,topics:t}}async function j4(u,e){const{subs:t}=O0(u);return t.get((await xC(u,e)).tag)||null}async function q7(u,e,t){const n=ki(u.runner);Eu(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:r,tag:i,topics:a}=await xC(u,t),{addr:o,subs:s}=O0(u);let l=s.get(i);if(!l){const E={address:o||u,topics:a},d=B=>{let g=r;if(g==null)try{g=u.interface.getEvent(B.topics[0])}catch{}if(g){const C=g,y=r?u.interface.decodeEventLog(r,B.data,B.topics):[];lp(u,t,y,v=>new i1u(u,v,t,C,B))}else lp(u,t,[],C=>new Yk(u,C,t,B))};let f=[];l={tag:i,listeners:[],start:()=>{f.length||f.push(n.on(E,d))},stop:async()=>{if(f.length==0)return;let B=f;f=[],await Promise.all(B),n.off(E,d)}},s.set(i,l)}return l}let sp=Promise.resolve();async function f1u(u,e,t,n){await sp;const r=await j4(u,e);if(!r)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=Array.from(t);n&&s.push(n(o?null:a));try{a.call(u,...s)}catch{}return!o}),r.listeners.length===0&&(r.stop(),O0(u).subs.delete(r.tag)),i>0}async function lp(u,e,t,n){try{await sp}catch{}const r=f1u(u,e,t,n);return sp=r,await r}const Ic=["then"];var d6u;const e3=class e3{constructor(e,t,n,r){X(this,"target");X(this,"interface");X(this,"runner");X(this,"filters");X(this,d6u);X(this,"fallback");Q(typeof e=="string"||ik(e),"invalid value for Contract target","target",e),n==null&&(n=null);const i=op.from(t);Ou(this,{target:e,runner:n,interface:i}),Object.defineProperty(this,A2,{value:{}});let a,o=null,s=null;if(r){const E=ki(n);s=new wC(this.interface,E,r)}let l=new Map;if(typeof e=="string")if(pe(e))o=e,a=Promise.resolve(e);else{const E=pa(n,"resolveName");if(!l9(E))throw be("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=E.resolveName(e).then(d=>{if(d==null)throw be("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return O0(this).addr=d,d})}else a=e.getAddress().then(E=>{if(E==null)throw new Error("TODO");return O0(this).addr=E,E});E1u(this,{addrPromise:a,addr:o,deployTx:s,subs:l});const c=new Proxy({},{get:(E,d,f)=>{if(typeof d=="symbol"||Ic.indexOf(d)>=0)return Reflect.get(E,d,f);try{return this.getEvent(d)}catch(m){if(!Et(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(E,d)=>Ic.indexOf(d)>=0?Reflect.has(E,d):Reflect.has(E,d)||this.interface.hasEvent(String(d))});return Ou(this,{filters:c}),Ou(this,{fallback:i.receive||i.fallback?s1u(this):null}),new Proxy(this,{get:(E,d,f)=>{if(typeof d=="symbol"||d in E||Ic.indexOf(d)>=0)return Reflect.get(E,d,f);try{return E.getFunction(d)}catch(m){if(!Et(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(E,d)=>typeof d=="symbol"||d in E||Ic.indexOf(d)>=0?Reflect.has(E,d):E.interface.hasFunction(d)})}connect(e){return new e3(this.target,this.interface,e)}attach(e){return new e3(e,this.interface,this.runner)}async getAddress(){return await O0(this).addrPromise}async getDeployedCode(){const e=ki(this.runner);Eu(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=ki(this.runner);return Eu(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((r,i)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return r(this);n.once("block",a)}catch(o){i(o)}};a()})}deploymentTransaction(){return O0(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),l1u(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),c1u(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");const{addr:r,addrPromise:i}=O0(this),a=r||await i,{fragment:o,topics:s}=await xC(this,e),l={address:a,topics:s,fromBlock:t,toBlock:n},c=ki(this.runner);return Eu(c,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await c.getLogs(l)).map(E=>{let d=o;if(d==null)try{d=this.interface.getEvent(E.topics[0])}catch{}if(d)try{return new bC(E,this.interface,d)}catch(f){return new Jk(E,f)}return new Jl(E,c)})}async on(e,t){const n=await q7(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){const n=await q7(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await lp(this,e,t,null)}async listenerCount(e){if(e){const r=await j4(this,e);return r?r.listeners.length:0}const{subs:t}=O0(this);let n=0;for(const{listeners:r}of t.values())n+=r.length;return n}async listeners(e){if(e){const r=await j4(this,e);return r?r.listeners.map(({listener:i})=>i):[]}const{subs:t}=O0(this);let n=[];for(const{listeners:r}of t.values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,t){const n=await j4(this,e);if(!n)return this;if(t){const r=n.listeners.map(({listener:i})=>i).indexOf(t);r>=0&&n.listeners.splice(r,1)}return(t==null||n.listeners.length===0)&&(n.stop(),O0(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const t=await j4(this,e);if(!t)return this;t.stop(),O0(this).subs.delete(t.tag)}else{const{subs:t}=O0(this);for(const{tag:n,stop:r}of t.values())r(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends e3{constructor(r,i=null){super(r,e,i)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}};d6u=A2;let cp=e3;function p1u(){return cp}let Ao=class extends p1u(){};function z1(u){return u.match(/^ipfs:\/\/ipfs\//i)?u=u.substring(12):u.match(/^ipfs:\/\//i)?u=u.substring(7):Q(!1,"unsupported IPFS format","link",u),`https://gateway.ipfs.io/ipfs/${u}`}class h1u{constructor(e){X(this,"name");Ou(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const r_=new RegExp("^(ipfs)://(.*)$","i"),H7=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),r_,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var vr,zi,Fr,Ua,w2,i_;const io=class io{constructor(e,t,n){tu(this,Fr);X(this,"provider");X(this,"address");X(this,"name");tu(this,vr,void 0);tu(this,zi,void 0);Ou(this,{provider:e,address:t,name:n}),R(this,vr,null),R(this,zi,new Ao(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return _(this,vr)==null&&R(this,vr,(async()=>{try{return await _(this,zi).supportsInterface("0x9061b923")}catch(e){if(Et(e,"CALL_EXCEPTION"))return!1;throw R(this,vr,null),e}})()),await _(this,vr)}async getAddress(e){if(e==null&&(e=60),e===60)try{const i=await yu(this,Fr,Ua).call(this,"addr(bytes32)");return i==null||i===Zf?null:i}catch(i){if(Et(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648;const a=await yu(this,Fr,Ua).call(this,"addr(bytes32,uint)",[i]);if(pe(a,20))return Yu(a)}let t=null;for(const i of this.provider.plugins)if(i instanceof h1u&&i.supportsCoinType(e)){t=i;break}if(t==null)return null;const n=await yu(this,Fr,Ua).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const r=await t.decodeAddress(e,n);if(r!=null)return r;Eu(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const t=await yu(this,Fr,Ua).call(this,"text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){const e=await yu(this,Fr,Ua).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const r=t[1]==="e3010170"?"ipfs":"ipns",i=parseInt(t[4],16);if(t[5].length===i*2)return`${r}://${edu("0x"+t[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Eu(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n{if(!Array.isArray(e))throw new Error("not an array");return e.map(t=>u(t))}}function Yl(u,e){return t=>{const n={};for(const r in u){let i=r;if(e&&r in e&&!(i in t)){for(const a of e[r])if(a in t){i=a;break}}try{const a=u[r](t[i]);a!==void 0&&(n[r]=a)}catch(a){const o=a instanceof Error?a.message:"not-an-error";Eu(!1,`invalid value for value.${r} (${o})`,"BAD_DATA",{value:t})}}return n}}function C1u(u){switch(u){case!0:case"true":return!0;case!1:case"false":return!1}Q(!1,`invalid boolean; ${JSON.stringify(u)}`,"value",u)}function Ss(u){return Q(pe(u,!0),"invalid data","value",u),u}function dt(u){return Q(pe(u,32),"invalid hash","value",u),u}const m1u=Yl({address:Yu,blockHash:dt,blockNumber:qu,data:Ss,index:qu,removed:le(C1u,!1),topics:kC(dt),transactionHash:dt,transactionIndex:qu},{index:["logIndex"]});function g1u(u){return m1u(u)}const A1u=Yl({hash:le(dt),parentHash:dt,number:qu,timestamp:qu,nonce:le(Ss),difficulty:Su,gasLimit:Su,gasUsed:Su,miner:le(Yu),extraData:Ss,baseFeePerGas:le(Su)});function y1u(u){const e=A1u(u);return e.transactions=u.transactions.map(t=>typeof t=="string"?t:a_(t)),e}const B1u=Yl({transactionIndex:qu,blockNumber:qu,transactionHash:dt,address:Yu,topics:kC(dt),data:Ss,index:qu,blockHash:dt},{index:["logIndex"]});function v1u(u){return B1u(u)}const F1u=Yl({to:le(Yu,null),from:le(Yu,null),contractAddress:le(Yu,null),index:qu,root:le(ku),gasUsed:Su,logsBloom:le(Ss),blockHash:dt,hash:dt,logs:kC(v1u),blockNumber:qu,cumulativeGasUsed:Su,effectiveGasPrice:le(Su),status:le(qu),type:le(qu,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function D1u(u){return F1u(u)}function a_(u){u.to&&Su(u.to)===G7&&(u.to="0x0000000000000000000000000000000000000000");const e=Yl({hash:dt,type:t=>t==="0x"||t==null?0:qu(t),accessList:le(Fa,null),blockHash:le(dt,null),blockNumber:le(qu,null),transactionIndex:le(qu,null),from:Yu,gasPrice:le(Su),maxPriorityFeePerGas:le(Su),maxFeePerGas:le(Su),gasLimit:Su,to:le(Yu,null),value:Su,nonce:qu,data:Ss,creates:le(Yu,null),chainId:le(Su,null)},{data:["input"],gasLimit:["gas"]})(u);if(e.to==null&&e.creates==null&&(e.creates=Fdu(e)),(u.type===1||u.type===2)&&u.accessList==null&&(e.accessList=[]),u.signature?e.signature=Mt.from(u.signature):e.signature=Mt.from(u),e.chainId==null){const t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&Su(e.blockHash)===G7&&(e.blockHash=null),e}const b1u="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Xl{constructor(e){X(this,"name");Ou(this,{name:e})}clone(){return new Xl(this.name)}}class c9 extends Xl{constructor(t,n){t==null&&(t=0);super(`org.ethers.network.plugins.GasCost#${t||0}`);X(this,"effectiveBlock");X(this,"txBase");X(this,"txCreate");X(this,"txDataZero");X(this,"txDataNonzero");X(this,"txAccessListStorageKey");X(this,"txAccessListAddress");const r={effectiveBlock:t};function i(a,o){let s=(n||{})[a];s==null&&(s=o),Q(typeof s=="number",`invalud value for ${a}`,"costs",n),r[a]=s}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Ou(this,r)}clone(){return new c9(this.effectiveBlock,this)}}class E9 extends Xl{constructor(t,n){super("org.ethers.plugins.network.Ens");X(this,"address");X(this,"targetNetwork");Ou(this,{address:t||b1u,targetNetwork:n??1})}clone(){return new E9(this.address,this.targetNetwork)}}var ol,sl;class o_ extends Xl{constructor(t,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");tu(this,ol,void 0);tu(this,sl,void 0);R(this,ol,t),R(this,sl,n)}get url(){return _(this,ol)}get processFunc(){return _(this,sl)}clone(){return this}}ol=new WeakMap,sl=new WeakMap;const M1=new Map;var Go,Ko,Dr;const ao=class ao{constructor(e,t){tu(this,Go,void 0);tu(this,Ko,void 0);tu(this,Dr,void 0);R(this,Go,e),R(this,Ko,Su(t)),R(this,Dr,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return _(this,Go)}set name(e){R(this,Go,e)}get chainId(){return _(this,Ko)}set chainId(e){R(this,Ko,Su(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Su(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Su(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Su(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(_(this,Dr).values())}attachPlugin(e){if(_(this,Dr).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return _(this,Dr).set(e.name,e.clone()),this}getPlugin(e){return _(this,Dr).get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new ao(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new c9;let n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let r=2;r9){let r=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||r++,n[1]=r.toString()}return BigInt(n[0]+n[1])}function Q7(u){return new o_(u,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let r;try{const[i,a]=await Promise.all([n.send(),e()]);r=i;const o=r.bodyJson.standard;return{gasPrice:a.gasPrice,maxFeePerGas:K7(o.maxFee,9),maxPriorityFeePerGas:K7(o.maxPriorityFee,9)}}catch(i){Eu(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:r,error:i})}})}function w1u(u){return new o_("data:",async(e,t,n)=>{const r=await e();if(r.maxFeePerGas==null||r.maxPriorityFeePerGas==null)return r;const i=r.maxFeePerGas-r.maxPriorityFeePerGas;return{gasPrice:r.gasPrice,maxFeePerGas:i+u,maxPriorityFeePerGas:u}})}let V7=!1;function x1u(){if(V7)return;V7=!0;function u(e,t,n){const r=function(){const i=new Un(e,t);return n.ensNetwork!=null&&i.attachPlugin(new E9(null,n.ensNetwork)),i.attachPlugin(new c9),(n.plugins||[]).forEach(a=>{i.attachPlugin(a)}),i};Un.register(e,r),Un.register(t,r),n.altNames&&n.altNames.forEach(i=>{Un.register(i,r)})}u("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),u("ropsten",3,{ensNetwork:3}),u("rinkeby",4,{ensNetwork:4}),u("goerli",5,{ensNetwork:5}),u("kovan",42,{ensNetwork:42}),u("sepolia",11155111,{}),u("classic",61,{}),u("classicKotti",6,{}),u("arbitrum",42161,{ensNetwork:1}),u("arbitrum-goerli",421613,{}),u("bnb",56,{ensNetwork:1}),u("bnbt",97,{}),u("linea",59144,{ensNetwork:1}),u("linea-goerli",59140,{}),u("matic",137,{ensNetwork:1,plugins:[Q7("https://gasstation.polygon.technology/v2")]}),u("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Q7("https://gasstation-testnet.polygon.technology/v2")]}),u("optimism",10,{ensNetwork:1,plugins:[w1u(BigInt("1000000"))]}),u("optimism-goerli",420,{}),u("xdai",100,{ensNetwork:1})}function Ep(u){return JSON.parse(JSON.stringify(u))}var kn,et,br,Zt,Qo,oE;class k1u{constructor(e){tu(this,Qo);tu(this,kn,void 0);tu(this,et,void 0);tu(this,br,void 0);tu(this,Zt,void 0);R(this,kn,e),R(this,et,null),R(this,br,4e3),R(this,Zt,-2)}get pollingInterval(){return _(this,br)}set pollingInterval(e){R(this,br,e)}start(){_(this,et)||(R(this,et,_(this,kn)._setTimeout(yu(this,Qo,oE).bind(this),_(this,br))),yu(this,Qo,oE).call(this))}stop(){_(this,et)&&(_(this,kn)._clearTimeout(_(this,et)),R(this,et,null))}pause(e){this.stop(),e&&R(this,Zt,-2)}resume(){this.start()}}kn=new WeakMap,et=new WeakMap,br=new WeakMap,Zt=new WeakMap,Qo=new WeakSet,oE=async function(){try{const e=await _(this,kn).getBlockNumber();if(_(this,Zt)===-2){R(this,Zt,e);return}if(e!==_(this,Zt)){for(let t=_(this,Zt)+1;t<=e;t++){if(_(this,et)==null)return;await _(this,kn).emit("block",t)}R(this,Zt,e)}}catch{}_(this,et)!=null&&R(this,et,_(this,kn)._setTimeout(yu(this,Qo,oE).bind(this),_(this,br)))};var Mi,Ui,wr;class s_{constructor(e){tu(this,Mi,void 0);tu(this,Ui,void 0);tu(this,wr,void 0);R(this,Mi,e),R(this,wr,!1),R(this,Ui,t=>{this._poll(t,_(this,Mi))})}async _poll(e,t){throw new Error("sub-classes must override this")}start(){_(this,wr)||(R(this,wr,!0),_(this,Ui).call(this,-2),_(this,Mi).on("block",_(this,Ui)))}stop(){_(this,wr)&&(R(this,wr,!1),_(this,Mi).off("block",_(this,Ui)))}pause(e){this.stop()}resume(){this.start()}}Mi=new WeakMap,Ui=new WeakMap,wr=new WeakMap;var x2;class _1u extends s_{constructor(t,n){super(t);tu(this,x2,void 0);R(this,x2,Ep(n))}async _poll(t,n){throw new Error("@TODO")}}x2=new WeakMap;var Vo;class S1u extends s_{constructor(t,n){super(t);tu(this,Vo,void 0);R(this,Vo,n)}async _poll(t,n){const r=await n.getTransactionReceipt(_(this,Vo));r&&n.emit(_(this,Vo),r)}}Vo=new WeakMap;var _n,Jo,Yo,xr,tt,k2,l_;class _C{constructor(e,t){tu(this,k2);tu(this,_n,void 0);tu(this,Jo,void 0);tu(this,Yo,void 0);tu(this,xr,void 0);tu(this,tt,void 0);R(this,_n,e),R(this,Jo,Ep(t)),R(this,Yo,yu(this,k2,l_).bind(this)),R(this,xr,!1),R(this,tt,-2)}start(){_(this,xr)||(R(this,xr,!0),_(this,tt)===-2&&_(this,_n).getBlockNumber().then(e=>{R(this,tt,e)}),_(this,_n).on("block",_(this,Yo)))}stop(){_(this,xr)&&(R(this,xr,!1),_(this,_n).off("block",_(this,Yo)))}pause(e){this.stop(),e&&R(this,tt,-2)}resume(){this.start()}}_n=new WeakMap,Jo=new WeakMap,Yo=new WeakMap,xr=new WeakMap,tt=new WeakMap,k2=new WeakSet,l_=async function(e){if(_(this,tt)===-2)return;const t=Ep(_(this,Jo));t.fromBlock=_(this,tt)+1,t.toBlock=e;const n=await _(this,_n).getLogs(t);if(n.length===0){_(this,tt){if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const r=Object.keys(n);return r.sort(),r.reduce((i,a)=>(i[a]=n[a],i),{})}return n})}class c_{constructor(e){X(this,"name");Ou(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function I1u(u){return JSON.parse(JSON.stringify(u))}function dp(u){return u=Array.from(new Set(u).values()),u.sort(),u}async function U1(u,e){if(u==null)throw new Error("invalid event");if(Array.isArray(u)&&(u={topics:u}),typeof u=="string")switch(u){case"block":case"pending":case"debug":case"error":case"network":return{type:u,tag:u}}if(pe(u,32)){const t=u.toLowerCase();return{type:"transaction",tag:sE("tx",{hash:t}),hash:t}}if(u.orphan){const t=u;return{type:"orphan",tag:sE("orphan",t),filter:I1u(t)}}if(u.address||u.topics){const t=u,n={topics:(t.topics||[]).map(r=>r==null?null:Array.isArray(r)?dp(r.map(i=>i.toLowerCase())):r.toLowerCase())};if(t.address){const r=[],i=[],a=o=>{pe(o)?r.push(o):i.push((async()=>{r.push(await c0(o,e))})())};Array.isArray(t.address)?t.address.forEach(a):a(t.address),i.length&&await Promise.all(i),n.address=dp(r.map(o=>o.toLowerCase()))}return{filter:n,tag:sE("event",n),type:"event"}}Q(!1,"unknown ProviderEvent","event",u)}function L1(){return new Date().getTime()}const O1u={cacheTimeout:250,pollingInterval:4e3};var Je,kr,Ye,Xo,j0,Li,_r,Sn,ll,nt,Zo,us,C0,J0,cl,fp,El,pp,$i,z4,dl,hp,Wi,M4,es,lE;class N1u{constructor(e,t){tu(this,C0);tu(this,cl);tu(this,El);tu(this,$i);tu(this,dl);tu(this,Wi);tu(this,es);tu(this,Je,void 0);tu(this,kr,void 0);tu(this,Ye,void 0);tu(this,Xo,void 0);tu(this,j0,void 0);tu(this,Li,void 0);tu(this,_r,void 0);tu(this,Sn,void 0);tu(this,ll,void 0);tu(this,nt,void 0);tu(this,Zo,void 0);tu(this,us,void 0);if(R(this,us,Object.assign({},O1u,t||{})),e==="any")R(this,Li,!0),R(this,j0,null);else if(e){const n=Un.from(e);R(this,Li,!1),R(this,j0,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else R(this,Li,!1),R(this,j0,null);R(this,Sn,-1),R(this,_r,new Map),R(this,Je,new Map),R(this,kr,new Map),R(this,Ye,null),R(this,Xo,!1),R(this,ll,1),R(this,nt,new Map),R(this,Zo,!1)}get pollingInterval(){return _(this,us).pollingInterval}get provider(){return this}get plugins(){return Array.from(_(this,kr).values())}attachPlugin(e){if(_(this,kr).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return _(this,kr).set(e.name,e.connect(this)),this}getPlugin(e){return _(this,kr).get(e)||null}get disableCcipRead(){return _(this,Zo)}set disableCcipRead(e){R(this,Zo,!!e)}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const r=e.to.toLowerCase(),i=t.toLowerCase(),a=[];for(let o=0;o=500,`response not found during CCIP fetch: ${E}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:s,errorMessage:E}}),a.push(E)}Eu(!1,`error encountered during CCIP fetch: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:a}})}_wrapBlock(e,t){return new e1u(y1u(e),this)}_wrapLog(e,t){return new Jl(g1u(e),this)}_wrapTransactionReceipt(e,t){return new Kk(D1u(e),this)}_wrapTransactionResponse(e,t){return new X3(a_(e),this)}_detectNetwork(){Eu(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Eu(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=qu(await yu(this,C0,J0).call(this,{method:"getBlockNumber"}),"%response");return _(this,Sn)>=0&&R(this,Sn,e),e}_getAddress(e){return c0(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(pe(e))return pe(e,32)?e:to(e);if(typeof e=="bigint"&&(e=qu(e,"blockTag")),typeof e=="number")return e>=0?to(e):_(this,Sn)>=0?to(_(this,Sn)+e):this.getBlockNumber().then(t=>to(t+e));Q(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const t=(e.topics||[]).map(s=>s==null?null:Array.isArray(s)?dp(s.map(l=>l.toLowerCase())):s.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,r=(s,l,c)=>{let E;switch(s.length){case 0:break;case 1:E=s[0];break;default:s.sort(),E=s}if(n&&(l!=null||c!=null))throw new Error("invalid filter");const d={};return E&&(d.address=E),t.length&&(d.topics=t),l&&(d.fromBlock=l),c&&(d.toBlock=c),n&&(d.blockHash=n),d};let i=[];if(e.address)if(Array.isArray(e.address))for(const s of e.address)i.push(this._getAddress(s));else i.push(this._getAddress(e.address));let a;"fromBlock"in e&&(a=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),i.filter(s=>typeof s!="string").length||a!=null&&typeof a!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(i),a,o]).then(s=>r(s[0],s[1],s[2])):r(i,a,o)}_getTransactionRequest(e){const t=g2(e),n=[];if(["to","from"].forEach(r=>{if(t[r]==null)return;const i=c0(t[r],this);Oc(i)?n.push(async function(){t[r]=await i}()):t[r]=i}),t.blockTag!=null){const r=this._getBlockTag(t.blockTag);Oc(r)?n.push(async function(){t.blockTag=await r}()):t.blockTag=r}return n.length?async function(){return await Promise.all(n),t}():t}async getNetwork(){if(_(this,j0)==null){const r=this._detectNetwork().then(i=>(this.emit("network",i,null),i),i=>{throw _(this,j0)===r&&R(this,j0,null),i});return R(this,j0,r),(await r).clone()}const e=_(this,j0),[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(_(this,Li)?(this.emit("network",n,t),_(this,j0)===e&&R(this,j0,Promise.resolve(n))):Eu(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:r,gasPrice:i}=await a0({_block:yu(this,dl,hp).call(this,"latest",!1),gasPrice:(async()=>{try{const l=await yu(this,C0,J0).call(this,{method:"getGasPrice"});return Su(l,"%response")}catch{}return null})()});let a=null,o=null;const s=this._wrapBlock(r,e);return s&&s.baseFeePerGas&&(o=BigInt("1000000000"),a=s.baseFeePerGas*P1u+o),new $7(i,a,o)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const r=new Yn(n.url),i=await n.processFunc(t,this,r);return new $7(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return Oc(t)&&(t=await t),Su(await yu(this,C0,J0).call(this,{method:"estimateGas",transaction:t}),"%response")}async call(e){const{tx:t,blockTag:n}=await a0({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await yu(this,El,pp).call(this,yu(this,cl,fp).call(this,t,n,e.enableCcipRead?0:-1))}async getBalance(e,t){return Su(await yu(this,$i,z4).call(this,{method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return qu(await yu(this,$i,z4).call(this,{method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return ku(await yu(this,$i,z4).call(this,{method:"getCode"},e,t))}async getStorage(e,t,n){const r=Su(t,"position");return ku(await yu(this,$i,z4).call(this,{method:"getStorage",position:r},e,n))}async broadcastTransaction(e){const{blockNumber:t,hash:n,network:r}=await a0({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=C2.from(e);if(i.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,r).replaceableTransaction(t)}async getBlock(e,t){const{network:n,params:r}=await a0({network:this.getNetwork(),params:yu(this,dl,hp).call(this,e,!!t)});return r==null?null:this._wrapBlock(r,n)}async getTransaction(e){const{network:t,params:n}=await a0({network:this.getNetwork(),params:yu(this,C0,J0).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){const{network:t,params:n}=await a0({network:this.getNetwork(),params:yu(this,C0,J0).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const r=await yu(this,C0,J0).call(this,{method:"getTransaction",hash:e});if(r==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=r.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){const{result:t}=await a0({network:this.getNetwork(),result:yu(this,C0,J0).call(this,{method:"getTransactionResult",hash:e})});return t==null?null:ku(t)}async getLogs(e){let t=this._getFilter(e);Oc(t)&&(t=await t);const{network:n,params:r}=await a0({network:this.getNetwork(),params:yu(this,C0,J0).call(this,{method:"getLogs",filter:t})});return r.map(i=>this._wrapLog(i,n))}_getProvider(e){Eu(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await y2.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=Yu(e);const t=ip(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await y2.getEnsAddress(this),i=await new Ao(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(i==null||i===Zf)return null;const o=await new Ao(i,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(o)!==e?null:o}catch(n){if(Et(n,"BAD_DATA")&&n.value==="0x"||Et(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){const r=t??1;return r===0?this.getTransactionReceipt(e):new Promise(async(i,a)=>{let o=null;const s=async l=>{try{const c=await this.getTransactionReceipt(e);if(c!=null&&l-c.blockNumber+1>=r){i(c),o&&(clearTimeout(o),o=null);return}}catch(c){console.log("EEE",c)}this.once("block",s)};n!=null&&(o=setTimeout(()=>{o!=null&&(o=null,this.off("block",s),a(be("timeout","TIMEOUT",{reason:"timeout"})))},n)),s(await this.getBlockNumber())})}async waitForBlock(e){Eu(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=_(this,nt).get(e);t&&(t.timer&&clearTimeout(t.timer),_(this,nt).delete(e))}_setTimeout(e,t){t==null&&(t=0);const n=i4(this,ll)._++,r=()=>{_(this,nt).delete(n),e()};if(this.paused)_(this,nt).set(n,{timer:null,func:r,time:t});else{const i=setTimeout(r,t);_(this,nt).set(n,{timer:i,func:r,time:L1()})}return n}_forEachSubscriber(e){for(const t of _(this,Je).values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new c_(e.type);case"block":{const t=new k1u(this);return t.pollingInterval=this.pollingInterval,t}case"event":return new _C(this,e.filter);case"transaction":return new S1u(this,e.hash);case"orphan":return new _1u(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const n of _(this,Je).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),_(this,Ye)!=null&&t.pause(_(this,Ye));break}}async on(e,t){const n=await yu(this,es,lE).call(this,e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,_(this,Ye)!=null&&n.subscriber.pause(_(this,Ye))),this}async once(e,t){const n=await yu(this,es,lE).call(this,e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,_(this,Ye)!=null&&n.subscriber.pause(_(this,Ye))),this}async emit(e,...t){const n=await yu(this,Wi,M4).call(this,e,t);if(!n||n.listeners.length===0)return!1;const r=n.listeners.length;return n.listeners=n.listeners.filter(({listener:i,once:a})=>{const o=new Kx(this,a?null:i,e);try{i.call(this,...t,o)}catch{}return!a}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),_(this,Je).delete(n.tag)),r>0}async listenerCount(e){if(e){const n=await yu(this,Wi,M4).call(this,e);return n?n.listeners.length:0}let t=0;for(const{listeners:n}of _(this,Je).values())t+=n.length;return t}async listeners(e){if(e){const n=await yu(this,Wi,M4).call(this,e);return n?n.listeners.map(({listener:r})=>r):[]}let t=[];for(const{listeners:n}of _(this,Je).values())t=t.concat(n.map(({listener:r})=>r));return t}async off(e,t){const n=await yu(this,Wi,M4).call(this,e);if(!n)return this;if(t){const r=n.listeners.map(({listener:i})=>i).indexOf(t);r>=0&&n.listeners.splice(r,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),_(this,Je).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:n,subscriber:r}=await yu(this,es,lE).call(this,e);n&&r.stop(),_(this,Je).delete(t)}else for(const[t,{started:n,subscriber:r}]of _(this,Je))n&&r.stop(),_(this,Je).delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return _(this,Xo)}destroy(){this.removeAllListeners();for(const e of _(this,nt).keys())this._clearTimeout(e);R(this,Xo,!0)}get paused(){return _(this,Ye)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(R(this,Sn,-1),_(this,Ye)!=null){if(_(this,Ye)==!!e)return;Eu(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),R(this,Ye,!!e);for(const t of _(this,nt).values())t.timer&&clearTimeout(t.timer),t.time=L1()-t.time}resume(){if(_(this,Ye)!=null){this._forEachSubscriber(e=>e.resume()),R(this,Ye,null);for(const e of _(this,nt).values()){let t=e.time;t<0&&(t=0),e.time=L1(),setTimeout(e.func,t)}}}}Je=new WeakMap,kr=new WeakMap,Ye=new WeakMap,Xo=new WeakMap,j0=new WeakMap,Li=new WeakMap,_r=new WeakMap,Sn=new WeakMap,ll=new WeakMap,nt=new WeakMap,Zo=new WeakMap,us=new WeakMap,C0=new WeakSet,J0=async function(e){const t=_(this,us).cacheTimeout;if(t<0)return await this._perform(e);const n=sE(e.method,e);let r=_(this,_r).get(n);return r||(r=this._perform(e),_(this,_r).set(n,r),setTimeout(()=>{_(this,_r).get(n)===r&&_(this,_r).delete(n)},t)),await r},cl=new WeakSet,fp=async function(e,t,n){Eu(n=0&&t==="latest"&&r.to!=null&&me(i.data,0,4)==="0x556f1830"){const a=i.data,o=await c0(r.to,this);let s;try{s=U1u(me(i.data,4))}catch(E){Eu(!1,E.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:r,info:{data:a}})}Eu(s.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:a,reason:"OffchainLookup",transaction:r,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:s.errorArgs}});const l=await this.ccipReadFetch(r,s.calldata,s.urls);Eu(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:r,info:{data:i.data,errorArgs:s.errorArgs}});const c={to:o,data:Te([s.selector,M1u([l,s.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const E=await yu(this,cl,fp).call(this,c,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},c),result:E}),E}catch(E){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},c),error:E}),E}}throw i}},El=new WeakSet,pp=async function(e){const{value:t}=await a0({network:this.getNetwork(),value:e});return t},$i=new WeakSet,z4=async function(e,t,n){let r=this._getAddress(t),i=this._getBlockTag(n);return(typeof r!="string"||typeof i!="string")&&([r,i]=await Promise.all([r,i])),await yu(this,El,pp).call(this,yu(this,C0,J0).call(this,Object.assign(e,{address:r,blockTag:i})))},dl=new WeakSet,hp=async function(e,t){if(pe(e,32))return await yu(this,C0,J0).call(this,{method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await yu(this,C0,J0).call(this,{method:"getBlock",blockTag:n,includeTransactions:t})},Wi=new WeakSet,M4=async function(e,t){let n=await U1(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await U1({orphan:"drop-log",log:t[0]},this)),_(this,Je).get(n.tag)||null},es=new WeakSet,lE=async function(e){const t=await U1(e,this),n=t.tag;let r=_(this,Je).get(n);return r||(r={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},_(this,Je).set(n,r)),r};function R1u(u,e){try{const t=Cp(u,e);if(t)return gC(t)}catch{}return null}function Cp(u,e){if(u==="0x")return null;try{const t=qu(me(u,e,e+32)),n=qu(me(u,t,t+32));return me(u,t+32,t+32+n)}catch{}return null}function J7(u){const e=L0(u);if(e.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(e,32-e.length),t}function j1u(u){if(u.length%32===0)return u;const e=new Uint8Array(Math.ceil(u.length/32)*32);return e.set(u),e}const z1u=new Uint8Array([]);function M1u(u){const e=[];let t=0;for(let n=0;n=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=me(u,0,32);Eu(me(t,0,12)===me(Y7,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=me(t,12);try{const n=[],r=qu(me(u,32,64)),i=qu(me(u,r,r+32)),a=me(u,r+32);for(let o=0;oe[n]),e}function Pa(u,e){if(u.provider)return u.provider;Eu(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function X7(u,e){let t=g2(e);if(t.to!=null&&(t.to=c0(t.to,u)),t.from!=null){const n=t.from;t.from=Promise.all([u.getAddress(),c0(n,u)]).then(([r,i])=>(Q(r.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),r))}else t.from=u.getAddress();return await a0(t)}class L1u{constructor(e){X(this,"provider");Ou(this,{provider:e||null})}async getNonce(e){return Pa(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await X7(this,e)}async populateTransaction(e){const t=Pa(this,"populateTransaction"),n=await X7(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const r=await this.provider.getNetwork();if(n.chainId!=null){const a=Su(n.chainId);Q(a===r.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=r.chainId;const i=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||i)?Q(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&i&&Q(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const a=await t.getFeeData();Eu(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice)}else{const a=await t.getFeeData();if(n.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const o=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=o,n.maxPriorityFeePerGas=o}else n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(Eu(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice),n.type=0):Eu(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else n.type===2&&(n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await a0(n)}async estimateGas(e){return Pa(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Pa(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Pa(this,"resolveName").resolveName(e)}async sendTransaction(e){const t=Pa(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const r=C2.from(n);return await t.broadcastTransaction(await this.signTransaction(r))}}function $1u(u){return JSON.parse(JSON.stringify(u))}var m0,un,qi,Sr,Hi,ts,fl,mp,pl,gp;class E_{constructor(e){tu(this,fl);tu(this,pl);tu(this,m0,void 0);tu(this,un,void 0);tu(this,qi,void 0);tu(this,Sr,void 0);tu(this,Hi,void 0);tu(this,ts,void 0);R(this,m0,e),R(this,un,null),R(this,qi,yu(this,fl,mp).bind(this)),R(this,Sr,!1),R(this,Hi,null),R(this,ts,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){_(this,Sr)||(R(this,Sr,!0),yu(this,fl,mp).call(this,-2))}stop(){_(this,Sr)&&(R(this,Sr,!1),R(this,ts,!0),yu(this,pl,gp).call(this),_(this,m0).off("block",_(this,qi)))}pause(e){e&&yu(this,pl,gp).call(this),_(this,m0).off("block",_(this,qi))}resume(){this.start()}}m0=new WeakMap,un=new WeakMap,qi=new WeakMap,Sr=new WeakMap,Hi=new WeakMap,ts=new WeakMap,fl=new WeakSet,mp=async function(e){try{_(this,un)==null&&R(this,un,this._subscribe(_(this,m0)));let t=null;try{t=await _(this,un)}catch(i){if(!Et(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(t==null){R(this,un,null),_(this,m0)._recoverSubscriber(this,this._recover(_(this,m0)));return}const n=await _(this,m0).getNetwork();if(_(this,Hi)||R(this,Hi,n),_(this,Hi).chainId!==n.chainId)throw new Error("chaid changed");if(_(this,ts))return;const r=await _(this,m0).send("eth_getFilterChanges",[t]);await this._emitResults(_(this,m0),r)}catch(t){console.log("@TODO",t)}_(this,m0).once("block",_(this,qi))},pl=new WeakSet,gp=function(){const e=_(this,un);e&&(R(this,un,null),e.then(t=>{_(this,m0).send("eth_uninstallFilter",[t])}))};var Gi;class W1u extends E_{constructor(t,n){super(t);tu(this,Gi,void 0);R(this,Gi,$1u(n))}_recover(t){return new _C(t,_(this,Gi))}async _subscribe(t){return await t.send("eth_newFilter",[_(this,Gi)])}async _emitResults(t,n){for(const r of n)t.emit(_(this,Gi),t._wrapLog(r,t._network))}}Gi=new WeakMap;class q1u extends E_{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const n of t)e.emit("pending",n)}}const H1u="bigint,boolean,function,number,string,symbol".split(/,/g);function cE(u){if(u==null||H1u.indexOf(typeof u)>=0||typeof u.getAddress=="function")return u;if(Array.isArray(u))return u.map(cE);if(typeof u=="object")return Object.keys(u).reduce((e,t)=>(e[t]=u[t],e),{});throw new Error(`should not happen: ${u} (${typeof u})`)}function G1u(u){return new Promise(e=>{setTimeout(e,u)})}function Ta(u){return u&&u.toLowerCase()}function Z7(u){return u&&typeof u.pollingInterval=="number"}const K1u={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class $1 extends L1u{constructor(t,n){super(t);X(this,"address");n=Yu(n),Ou(this,{address:n})}connect(t){Eu(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(t){return await this.populateCall(t)}async sendUncheckedTransaction(t){const n=cE(t),r=[];if(n.from){const a=n.from;r.push((async()=>{const o=await c0(a,this.provider);Q(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),n.from=o})())}else n.from=this.address;if(n.gasLimit==null&&r.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){const a=n.to;r.push((async()=>{n.to=await c0(a,this.provider)})())}r.length&&await Promise.all(r);const i=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(t){const n=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(t);return await new Promise((i,a)=>{const o=[1e3,100],s=async()=>{const l=await this.provider.getTransaction(r);if(l!=null){i(l.replaceableTransaction(n));return}this.provider._setTimeout(()=>{s()},o.pop()||4e3)};s()})}async signTransaction(t){const n=cE(t);if(n.from){const i=await c0(n.from,this.provider);Q(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),n.from=i}else n.from=this.address;const r=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[r])}async signMessage(t){const n=typeof t=="string"?Wn(t):t;return await this.provider.send("personal_sign",[ku(n),this.address.toLowerCase()])}async signTypedData(t,n,r){const i=cE(r),a=await m2.resolveNames(t,n,i,async o=>{const s=await c0(o);return Q(s!=null,"TypedData does not support null address","value",o),s});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(m2.getPayload(a.domain,n,a.value))])}async unlock(t){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),t,null])}async _legacySignMessage(t){const n=typeof t=="string"?Wn(t):t;return await this.provider.send("eth_sign",[this.address.toLowerCase(),ku(n)])}}var Ki,ns,Pn,en,kt,Tn,hl,Ap;class Q1u extends N1u{constructor(t,n){super(t,n);tu(this,hl);tu(this,Ki,void 0);tu(this,ns,void 0);tu(this,Pn,void 0);tu(this,en,void 0);tu(this,kt,void 0);tu(this,Tn,void 0);R(this,ns,1),R(this,Ki,Object.assign({},K1u,n||{})),R(this,Pn,[]),R(this,en,null),R(this,Tn,null);{let i=null;const a=new Promise(o=>{i=o});R(this,kt,{promise:a,resolve:i})}const r=this._getOption("staticNetwork");r&&(Q(t==null||r.matches(t),"staticNetwork MUST match network object","options",n),R(this,Tn,r))}_getOption(t){return _(this,Ki)[t]}get _network(){return Eu(_(this,Tn),"network is not available yet","NETWORK_ERROR"),_(this,Tn)}async _perform(t){if(t.method==="call"||t.method==="estimateGas"){let r=t.transaction;if(r&&r.type!=null&&Su(r.type)&&r.maxFeePerGas==null&&r.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(t=Object.assign({},t,{transaction:Object.assign({},r,{type:void 0})}))}}const n=this.getRpcRequest(t);return n!=null?await this.send(n.method,n.args):super._perform(t)}async _detectNetwork(){const t=this._getOption("staticNetwork");if(t)return t;if(this.ready)return Un.from(Su(await this.send("eth_chainId",[])));const n={id:i4(this,ns)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let r;try{r=(await this._send(n))[0]}catch(i){throw this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:r}),"result"in r)return Un.from(Su(r.result));throw this.getRpcError(n,r)}_start(){_(this,kt)==null||_(this,kt).resolve==null||(_(this,kt).resolve(),R(this,kt,null),(async()=>{for(;_(this,Tn)==null&&!this.destroyed;)try{R(this,Tn,await this._detectNetwork())}catch(t){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",be("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:t}})),await G1u(1e3)}yu(this,hl,Ap).call(this)})())}async _waitUntilReady(){if(_(this,kt)!=null)return await _(this,kt).promise}_getSubscriber(t){return t.type==="pending"?new q1u(this):t.type==="event"?this._getOption("polling")?new _C(this,t.filter):new W1u(this,t.filter):t.type==="orphan"&&t.filter.orphan==="drop-log"?new c_("orphan"):super._getSubscriber(t)}get ready(){return _(this,kt)==null}getRpcTransaction(t){const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(r=>{if(t[r]==null)return;let i=r;r==="gasLimit"&&(i="gas"),n[i]=to(Su(t[r],`tx.${r}`))}),["from","to","data"].forEach(r=>{t[r]!=null&&(n[r]=ku(t[r]))}),t.accessList&&(n.accessList=Fa(t.accessList)),n}getRpcRequest(t){switch(t.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ta(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ta(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ta(t.address),t.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ta(t.address),"0x"+t.position.toString(16),t.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[t.signedTransaction]};case"getBlock":if("blockTag"in t)return{method:"eth_getBlockByNumber",args:[t.blockTag,!!t.includeTransactions]};if("blockHash"in t)return{method:"eth_getBlockByHash",args:[t.blockHash,!!t.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[t.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[t.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(t.transaction),t.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(t.transaction)]};case"getLogs":return t.filter&&t.filter.address!=null&&(Array.isArray(t.filter.address)?t.filter.address=t.filter.address.map(Ta):t.filter.address=Ta(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(t,n){const{method:r}=t,{error:i}=n;if(r==="eth_estimateGas"&&i.message){const s=i.message;if(!s.match(/revert/i)&&s.match(/insufficient funds/i))return be("insufficient funds","INSUFFICIENT_FUNDS",{transaction:t.params[0],info:{payload:t,error:i}})}if(r==="eth_call"||r==="eth_estimateGas"){const s=yp(i),l=Y3.getBuiltinCallException(r==="eth_call"?"call":"estimateGas",t.params[0],s?s.data:null);return l.info={error:i,payload:t},l}const a=JSON.stringify(Y1u(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return be("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[r]||"unknown",reason:"rejected",info:{payload:t,error:i}});if(r==="eth_sendRawTransaction"||r==="eth_sendTransaction"){const s=t.params[0];if(a.match(/insufficient funds|base fee exceeds gas limit/i))return be("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:s,info:{error:i}});if(a.match(/nonce/i)&&a.match(/too low/i))return be("nonce has already been used","NONCE_EXPIRED",{transaction:s,info:{error:i}});if(a.match(/replacement transaction/i)&&a.match(/underpriced/i))return be("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:s,info:{error:i}});if(a.match(/only replay-protected/i))return be("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:r,info:{transaction:s,info:{error:i}}})}let o=!!a.match(/the method .* does not exist/i);return o||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(o=!0),o?be("unsupported operation","UNSUPPORTED_OPERATION",{operation:t.method,info:{error:i,payload:t}}):be("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:t})}send(t,n){if(this.destroyed)return Promise.reject(be("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t}));const r=i4(this,ns)._++,i=new Promise((a,o)=>{_(this,Pn).push({resolve:a,reject:o,payload:{method:t,params:n,id:r,jsonrpc:"2.0"}})});return yu(this,hl,Ap).call(this),i}async getSigner(t){t==null&&(t=0);const n=this.send("eth_accounts",[]);if(typeof t=="number"){const i=await n;if(t>=i.length)throw new Error("no such account");return new $1(this,i[t])}const{accounts:r}=await a0({network:this.getNetwork(),accounts:n});t=Yu(t);for(const i of r)if(Yu(i)===t)return new $1(this,t);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new $1(this,n))}destroy(){_(this,en)&&(clearTimeout(_(this,en)),R(this,en,null));for(const{payload:t,reject:n}of _(this,Pn))n(be("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t.method}));R(this,Pn,[]),super.destroy()}}Ki=new WeakMap,ns=new WeakMap,Pn=new WeakMap,en=new WeakMap,kt=new WeakMap,Tn=new WeakMap,hl=new WeakSet,Ap=function(){if(_(this,en))return;const t=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");R(this,en,setTimeout(()=>{R(this,en,null);const n=_(this,Pn);for(R(this,Pn,[]);n.length;){const r=[n.shift()];for(;n.length&&r.length!==_(this,Ki).batchMaxCount;)if(r.push(n.shift()),JSON.stringify(r.map(a=>a.payload)).length>_(this,Ki).batchMaxSize){n.unshift(r.pop());break}(async()=>{const i=r.length===1?r[0].payload:r.map(a=>a.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{const a=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:a});for(const{resolve:o,reject:s,payload:l}of r){if(this.destroyed){s(be("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:l.method}));continue}const c=a.filter(E=>E.id===l.id)[0];if(c==null){const E=be("missing response for request","BAD_DATA",{value:a,info:{payload:l}});this.emit("error",E),s(E);continue}if("error"in c){s(this.getRpcError(l,c));continue}o(c.result)}}catch(a){this.emit("debug",{action:"receiveRpcError",error:a});for(const{reject:o}of r)o(a)}})()}},t))};var Pr;class V1u extends Q1u{constructor(t,n){super(t,n);tu(this,Pr,void 0);R(this,Pr,4e3)}_getSubscriber(t){const n=super._getSubscriber(t);return Z7(n)&&(n.pollingInterval=_(this,Pr)),n}get pollingInterval(){return _(this,Pr)}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");R(this,Pr,t),this._forEachSubscriber(n=>{Z7(n)&&(n.pollingInterval=_(this,Pr))})}}Pr=new WeakMap;var rs;class J1u extends V1u{constructor(t,n,r){t==null&&(t="http://localhost:8545");super(n,r);tu(this,rs,void 0);typeof t=="string"?R(this,rs,new Yn(t)):R(this,rs,t.clone())}_getConnection(){return _(this,rs).clone()}async send(t,n){return await this._start(),await super.send(t,n)}async _send(t){const n=this._getConnection();n.body=JSON.stringify(t),n.setHeader("content-type","application/json");const r=await n.send();r.assertOk();let i=r.bodyJson;return Array.isArray(i)||(i=[i]),i}}rs=new WeakMap;function yp(u){if(u==null)return null;if(typeof u.message=="string"&&u.message.match(/revert/i)&&pe(u.data))return{message:u.message,data:u.data};if(typeof u=="object"){for(const e in u){const t=yp(u[e]);if(t)return t}return null}if(typeof u=="string")try{return yp(JSON.parse(u))}catch{}return null}function Bp(u,e){if(u!=null){if(typeof u.message=="string"&&e.push(u.message),typeof u=="object")for(const t in u)Bp(u[t],e);if(typeof u=="string")try{return Bp(JSON.parse(u),e)}catch{}}}function Y1u(u){const e=[];return Bp(u,e),e}var X1u=Ao;const Z1u=async()=>{const u=new J1u("https://goerli.optimism.io",420);return new X1u(Nn[420],rn.abi,u).balanceOf(Nn[420])},u6u=()=>{const{error:u,isLoading:e,data:t}=ZT(["ethers.Contract().balanceOf"],Z1u);return e?Lu.jsx("div",{children:"'loading balance...'"}):u?(console.error(u),Lu.jsx("div",{children:"error loading balance"})):Lu.jsx("div",{children:t==null?void 0:t.toString()})},e6u=()=>{const{address:u}=K0(),{data:e}=f5(),[t,n]=M.useState([]),r=rn.events.Transfer({fromBlock:e&&e-BigInt(1e3),args:{to:u}});return qz({...r,address:Nn[420],listener:i=>{n([...t,i])}}),Lu.jsx("div",{children:Lu.jsx("div",{style:{display:"flex",flexDirection:"column-reverse"},children:t.map((i,a)=>Lu.jsxs("div",{children:[Lu.jsxs("div",{children:["Event ",a]}),Lu.jsx("div",{children:JSON.stringify(i)})]}))})})},t6u=()=>{const{address:u,isConnected:e}=K0(),{data:t}=Oa({...rn.read.balanceOf(u),address:Nn[420],enabled:e}),{data:n}=Oa({...rn.read.totalSupply(),address:Nn[420],enabled:e}),{data:r}=Oa({...rn.read.tokenURI(BigInt(1)),address:Nn[420],enabled:e}),{data:i}=Oa({...rn.read.symbol(),address:Nn[420],enabled:e}),{data:a}=Oa({...rn.read.ownerOf(BigInt(1)),address:Nn[420],enabled:e});return Lu.jsx("div",{children:Lu.jsxs("div",{children:[Lu.jsxs("div",{children:["balanceOf(",u,"): ",t==null?void 0:t.toString()]}),Lu.jsxs("div",{children:["totalSupply(): ",n==null?void 0:n.toString()]}),Lu.jsxs("div",{children:["tokenUri(BigInt(1)): ",r==null?void 0:r.toString()]}),Lu.jsxs("div",{children:["symbol(): ",i==null?void 0:i.toString()]}),Lu.jsxs("div",{children:["ownerOf(BigInt(1)): ",a==null?void 0:a.toString()]})]})})};function n6u(u=1,e=1e9){const t=e-u+1;return Math.floor(Math.random()*t)+u}const r6u=()=>{const{address:u,isConnected:e}=K0(),{data:t,refetch:n}=Oa({...rn.read.balanceOf(u),enabled:e}),{writeAsync:r,data:i}=Vz({address:Nn[420],...rn.write.mint});return rM({hash:i==null?void 0:i.hash,onSuccess:a=>{console.log("minted",a),n()}}),Lu.jsxs("div",{children:[Lu.jsx("div",{children:Lu.jsxs("div",{children:["balance: ",t==null?void 0:t.toString()]})}),Lu.jsx("button",{type:"button",onClick:()=>r(rn.write.mint(BigInt(n6u()))),children:"Mint"})]})};function i6u(){const[u,e]=M.useState("unselected"),{isConnected:t}=K0(),n={unselected:Lu.jsx(Lu.Fragment,{children:"Select which component to render"}),reads:Lu.jsx(t6u,{}),writes:Lu.jsx(r6u,{}),events:Lu.jsx(e6u,{}),ethers:Lu.jsx(u6u,{})};return Lu.jsxs(Lu.Fragment,{children:[Lu.jsx("h1",{children:"Evmts example"}),Lu.jsx(Y5,{}),t&&Lu.jsxs(Lu.Fragment,{children:[Lu.jsx("hr",{}),Lu.jsx("div",{style:{display:"flex"},children:Object.keys(n).map(r=>Lu.jsx("button",{type:"button",onClick:()=>e(r),children:r}))}),Lu.jsx("h2",{children:u}),n[u]]})]})}function a6u({rpc:u}){return function(e){const t=u(e);return!t||t.http===""?null:{chain:{...e,rpcUrls:{...e.rpcUrls,default:{http:[t.http]}}},rpcUrls:{http:[t.http],webSocket:t.webSocket?[t.webSocket]:void 0}}}}const o6u="898f836c53a18d0661340823973f0cb4",{chains:d_,publicClient:s6u,webSocketPublicClient:l6u}=Oj([o5,Bj],[a6u({rpc:u=>{const e={1:{http:"https://mainnet.infura.io/v3/845f07495e374dfabf3a66e3f10ad786"},420:{http:"https://goerli.optimism.io"}};return[1,420].includes(u.id)?e[u.id]:null}})]),{connectors:c6u}=t2u({appName:"My wagmi + RainbowKit App",chains:d_,projectId:o6u}),E6u=u=>Az({autoConnect:!0,connectors:c6u,publicClient:s6u,webSocketPublicClient:l6u,queryClient:u}),uy=new _y,f_=document.getElementById("root");if(!f_)throw new Error("No root element found");Px(f_).render(Lu.jsx(M.StrictMode,{children:Lu.jsx(Uv,{client:uy,children:Lu.jsx(yz,{config:E6u(uy),children:Lu.jsx(Tsu,{chains:d_,children:Lu.jsx(i6u,{})})})})}));export{u9 as $,J6u as A,V6u as B,z6u as C,ufu as D,H6u as E,I6u as F,q6u as G,afu as H,Z6u as I,N6u as J,S6u as K,P6u as L,gt as M,Cr as N,$6u as O,U6u as P,L6u as Q,Hcu as R,aC as S,oC as T,ws as U,k6u as V,gx as W,mfu as X,R6u as Y,Cfu as Z,Ql as _,GN as a,Vn as a$,j6u as a0,_6u as a1,K6u as a2,Q6u as a3,e9 as a4,O6u as a5,sC as a6,Y6u as a7,G6u as a8,X6u as a9,Ex as aA,pcu as aB,tC as aC,hcu as aD,Ccu as aE,gcu as aF,cx as aG,Bcu as aH,Dcu as aI,xcu as aJ,_cu as aK,Pcu as aL,Nlu as aM,dx as aN,zcu as aO,Mcu as aP,Ocu as aQ,jcu as aR,oru as aS,pru as aT,gu as aU,Q2 as aV,f0 as aW,fs as aX,B3 as aY,MO as aZ,id as a_,gfu as aa,rfu as ab,nfu as ac,kEu as ad,pfu as ae,ofu as af,_Eu as ag,tfu as ah,Efu as ai,sfu as aj,dfu as ak,hfu as al,lfu as am,cfu as an,ffu as ao,ifu as ap,AEu as aq,yx as ar,k1 as as,F6u as at,D6u as au,Hu as av,b3u as aw,Ju as ax,ey as ay,v6u as az,KN as b,vl as b0,V4 as b1,cn as b2,QN as c,SF as d,Fp as e,Zi as f,IN as g,Mu as h,It as i,yA as j,vp as k,TN as l,ua as m,Vc as n,efu as o,b6u as p,w6u as q,Kd as r,x6u as s,zt as t,mx as u,S0 as v,Lt as w,T6u as x,M6u as y,W6u as z}; + Approved: ${d.toString()}`))}),a.forEach(E=>{n||(wi(r[E].methods,i[E].methods)?wi(r[E].events,i[E].events)||(n=Cr("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${E}`)):n=Cr("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${E}`))}),n}function SEu(u){const e={};return Object.keys(u).forEach(t=>{var n;t.includes(":")?e[t]=u[t]:(n=u[t].chains)==null||n.forEach(r=>{e[r]={methods:u[t].methods,events:u[t].events}})}),e}function QA(u){return[...new Set(u.map(e=>e.includes(":")?e.split(":")[0]:e))]}function PEu(u){const e={};return Object.keys(u).forEach(t=>{if(t.includes(":"))e[t]=u[t];else{const n=r4(u[t].accounts);n==null||n.forEach(r=>{e[r]={accounts:u[t].accounts.filter(i=>i.includes(`${r}:`)),methods:u[t].methods,events:u[t].events}})}}),e}function hfu(u,e){return lC(u,!1)&&u<=e.max&&u>=e.min}function Cfu(){const u=Vl();return new Promise(e=>{switch(u){case U0.browser:e(TEu());break;case U0.reactNative:e(IEu());break;case U0.node:e(OEu());break;default:e(!0)}})}function TEu(){return oC()&&(navigator==null?void 0:navigator.onLine)}async function IEu(){if(aC()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo){const u=await(globalThis==null?void 0:globalThis.NetInfo.fetch());return u==null?void 0:u.isConnected}return!0}function OEu(){return!0}function mfu(u){switch(Vl()){case U0.browser:NEu(u);break;case U0.reactNative:REu(u);break}}function NEu(u){oC()&&(window.addEventListener("online",()=>u(!0)),window.addEventListener("offline",()=>u(!1)))}function REu(u){aC()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo&&(globalThis==null||globalThis.NetInfo.addEventListener(e=>u(e==null?void 0:e.isConnected)))}const _1={};class gfu{static get(e){return _1[e]}static set(e,t){_1[e]=t}static delete(e){delete _1[e]}}var Fx="eip155",jEu="store",Dx="requestedChains",$f="wallet_addEthereumChain",Ee,Y4,Zc,Wf,cC,bx,uE,qf,Hf,wx,a2,EC,Ra,_4,o2,dC,s2,fC,l2,pC,xx=class extends Il{constructor(u){super({...u,options:{isNewChainsStale:!0,...u.options}}),we(this,Zc),we(this,cC),we(this,uE),we(this,Hf),we(this,a2),we(this,Ra),we(this,o2),we(this,s2),we(this,l2),this.id="walletConnect",this.name="WalletConnect",this.ready=!0,we(this,Ee,void 0),we(this,Y4,void 0),this.onAccountsChanged=e=>{e.length===0?this.emit("disconnect"):this.emit("change",{account:e0(e[0])})},this.onChainChanged=e=>{const t=Number(e),n=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:n}})},this.onDisconnect=()=>{De(this,Ra,_4).call(this,[]),this.emit("disconnect")},this.onDisplayUri=e=>{this.emit("message",{type:"display_uri",data:e})},this.onConnect=()=>{this.emit("connect",{})},De(this,Zc,Wf).call(this)}async connect({chainId:u,pairingTopic:e}={}){var t,n,r,i,a;try{let o=u;if(!o){const m=(t=this.storage)==null?void 0:t.getItem(jEu),h=(i=(r=(n=m==null?void 0:m.state)==null?void 0:n.data)==null?void 0:r.chain)==null?void 0:i.id;h&&!this.isChainUnsupported(h)?o=h:o=(a=this.chains[0])==null?void 0:a.id}if(!o)throw new Error("No chains found on connector.");const s=await this.getProvider();De(this,Hf,wx).call(this);const l=De(this,uE,qf).call(this);if(s.session&&l&&await s.disconnect(),!s.session||l){const m=this.chains.filter(h=>h.id!==o).map(h=>h.id);this.emit("message",{type:"connecting"}),await s.connect({pairingTopic:e,chains:[o],optionalChains:m.length?m:void 0}),De(this,Ra,_4).call(this,this.chains.map(({id:h})=>h))}const c=await s.enable(),E=e0(c[0]),d=await this.getChainId(),f=this.isChainUnsupported(d);return{account:E,chain:{id:d,unsupported:f}}}catch(o){throw/user rejected/i.test(o==null?void 0:o.message)?new _e(o):o}}async disconnect(){const u=await this.getProvider();try{await u.disconnect()}catch(e){if(!/No matching key/i.test(e.message))throw e}finally{De(this,a2,EC).call(this),De(this,Ra,_4).call(this,[])}}async getAccount(){const{accounts:u}=await this.getProvider();return e0(u[0])}async getChainId(){const{chainId:u}=await this.getProvider();return u}async getProvider({chainId:u}={}){return Wu(this,Ee)||await De(this,Zc,Wf).call(this),u&&await this.switchChain(u),Wu(this,Ee)}async getWalletClient({chainId:u}={}){const[e,t]=await Promise.all([this.getProvider({chainId:u}),this.getAccount()]),n=this.chains.find(r=>r.id===u);if(!e)throw new Error("provider is required.");return Tl({account:t,chain:n,transport:Sl(e)})}async isAuthorized(){try{const[u,e]=await Promise.all([this.getAccount(),this.getProvider()]),t=De(this,uE,qf).call(this);if(!u)return!1;if(t&&e.session){try{await e.disconnect()}catch{}return!1}return!0}catch{return!1}}async switchChain(u){var t,n;const e=this.chains.find(r=>r.id===u);if(!e)throw new En(new Error("chain not found on connector."));try{const r=await this.getProvider(),i=De(this,s2,fC).call(this),a=De(this,l2,pC).call(this);if(!i.includes(u)&&a.includes($f)){await r.request({method:$f,params:[{chainId:zu(e.id),blockExplorerUrls:[(n=(t=e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url],chainName:e.name,nativeCurrency:e.nativeCurrency,rpcUrls:[...e.rpcUrls.default.http]}]});const s=De(this,o2,dC).call(this);s.push(u),De(this,Ra,_4).call(this,s)}return await r.request({method:"wallet_switchEthereumChain",params:[{chainId:zu(u)}]}),e}catch(r){const i=typeof r=="string"?r:r==null?void 0:r.message;throw/user rejected request/i.test(i)?new _e(r):new En(r)}}};Ee=new WeakMap;Y4=new WeakMap;Zc=new WeakSet;Wf=async function(){return!Wu(this,Y4)&&typeof window<"u"&&Jn(this,Y4,De(this,cC,bx).call(this)),Wu(this,Y4)};cC=new WeakSet;bx=async function(){const{EthereumProvider:u,OPTIONAL_EVENTS:e,OPTIONAL_METHODS:t}=await Hu(()=>import("./index.es-866852ed.js"),["assets/index.es-866852ed.js","assets/events-699377c5.js","assets/http-8ae254e4.js"]),[n,...r]=this.chains.map(({id:i})=>i);if(n){const{projectId:i,showQrModal:a=!0,qrModalOptions:o,metadata:s,relayUrl:l}=this.options;Jn(this,Ee,await u.init({showQrModal:a,qrModalOptions:o,projectId:i,optionalMethods:t,optionalEvents:e,chains:[n],optionalChains:r.length?r:void 0,rpcMap:Object.fromEntries(this.chains.map(c=>[c.id,c.rpcUrls.default.http[0]])),metadata:s,relayUrl:l}))}};uE=new WeakSet;qf=function(){if(De(this,l2,pC).call(this).includes($f)||!this.options.isNewChainsStale)return!1;const e=De(this,o2,dC).call(this),t=this.chains.map(({id:r})=>r),n=De(this,s2,fC).call(this);return n.length&&!n.some(r=>t.includes(r))?!1:!t.every(r=>e.includes(r))};Hf=new WeakSet;wx=function(){Wu(this,Ee)&&(De(this,a2,EC).call(this),Wu(this,Ee).on("accountsChanged",this.onAccountsChanged),Wu(this,Ee).on("chainChanged",this.onChainChanged),Wu(this,Ee).on("disconnect",this.onDisconnect),Wu(this,Ee).on("session_delete",this.onDisconnect),Wu(this,Ee).on("display_uri",this.onDisplayUri),Wu(this,Ee).on("connect",this.onConnect))};a2=new WeakSet;EC=function(){Wu(this,Ee)&&(Wu(this,Ee).removeListener("accountsChanged",this.onAccountsChanged),Wu(this,Ee).removeListener("chainChanged",this.onChainChanged),Wu(this,Ee).removeListener("disconnect",this.onDisconnect),Wu(this,Ee).removeListener("session_delete",this.onDisconnect),Wu(this,Ee).removeListener("display_uri",this.onDisplayUri),Wu(this,Ee).removeListener("connect",this.onConnect))};Ra=new WeakSet;_4=function(u){var e;(e=this.storage)==null||e.setItem(Dx,u)};o2=new WeakSet;dC=function(){var u;return((u=this.storage)==null?void 0:u.getItem(Dx))??[]};s2=new WeakSet;fC=function(){var n,r,i;if(!Wu(this,Ee))return[];const u=(n=Wu(this,Ee).session)==null?void 0:n.namespaces;return u?((i=(r=Bx(u)[Fx])==null?void 0:r.chains)==null?void 0:i.map(a=>parseInt(a.split(":")[1]||"")))??[]:[]};l2=new WeakSet;pC=function(){var n,r;if(!Wu(this,Ee))return[];const u=(n=Wu(this,Ee).session)==null?void 0:n.namespaces;return u?((r=Bx(u)[Fx])==null?void 0:r.methods)??[]:[]};var S4,ja,zEu=class extends Il{constructor({chains:u,options:e}){super({chains:u,options:{reloadOnDisconnect:!1,...e}}),this.id="coinbaseWallet",this.name="Coinbase Wallet",this.ready=!0,we(this,S4,void 0),we(this,ja,void 0),this.onAccountsChanged=t=>{t.length===0?this.emit("disconnect"):this.emit("change",{account:e0(t[0])})},this.onChainChanged=t=>{const n=la(t),r=this.isChainUnsupported(n);this.emit("change",{chain:{id:n,unsupported:r}})},this.onDisconnect=()=>{this.emit("disconnect")}}async connect({chainId:u}={}){try{const e=await this.getProvider();e.on("accountsChanged",this.onAccountsChanged),e.on("chainChanged",this.onChainChanged),e.on("disconnect",this.onDisconnect),this.emit("message",{type:"connecting"});const t=await e.enable(),n=e0(t[0]);let r=await this.getChainId(),i=this.isChainUnsupported(r);return u&&r!==u&&(r=(await this.switchChain(u)).id,i=this.isChainUnsupported(r)),{account:n,chain:{id:r,unsupported:i}}}catch(e){throw/(user closed modal|accounts received is empty)/i.test(e.message)?new _e(e):e}}async disconnect(){if(!Wu(this,ja))return;const u=await this.getProvider();u.removeListener("accountsChanged",this.onAccountsChanged),u.removeListener("chainChanged",this.onChainChanged),u.removeListener("disconnect",this.onDisconnect),u.disconnect(),u.close()}async getAccount(){const e=await(await this.getProvider()).request({method:"eth_accounts"});return e0(e[0])}async getChainId(){const u=await this.getProvider();return la(u.chainId)}async getProvider(){var u;if(!Wu(this,ja)){let e=(await Hu(()=>import("./index-408ac722.js").then(a=>a.i),["assets/index-408ac722.js","assets/events-699377c5.js","assets/hooks.module-fb90a505.js"])).default;typeof e!="function"&&typeof e.default=="function"&&(e=e.default),Jn(this,S4,new e(this.options));const t=(u=Wu(this,S4).walletExtension)==null?void 0:u.getChainId(),n=this.chains.find(a=>this.options.chainId?a.id===this.options.chainId:a.id===t)||this.chains[0],r=this.options.chainId||(n==null?void 0:n.id),i=this.options.jsonRpcUrl||(n==null?void 0:n.rpcUrls.default.http[0]);Jn(this,ja,Wu(this,S4).makeWeb3Provider(i,r))}return Wu(this,ja)}async getWalletClient({chainId:u}={}){const[e,t]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find(r=>r.id===u);if(!e)throw new Error("provider is required.");return Tl({account:t,chain:n,transport:Sl(e)})}async isAuthorized(){try{return!!await this.getAccount()}catch{return!1}}async switchChain(u){var n;const e=await this.getProvider(),t=zu(u);try{return await e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]}),this.chains.find(r=>r.id===u)??{id:u,name:`Chain ${t}`,network:`${t}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(r){const i=this.chains.find(a=>a.id===u);if(!i)throw new ZF({chainId:u,connectorId:this.id});if(r.code===4902)try{return await e.request({method:"wallet_addEthereumChain",params:[{chainId:t,chainName:i.name,nativeCurrency:i.nativeCurrency,rpcUrls:[((n=i.rpcUrls.public)==null?void 0:n.http[0])??""],blockExplorerUrls:this.getBlockExplorerUrls(i)}]}),i}catch(a){throw new _e(a)}throw new En(r)}}async watchAsset({address:u,decimals:e=18,image:t,symbol:n}){return(await this.getProvider()).request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:u,decimals:e,image:t,symbol:n}}})}};S4=new WeakMap;ja=new WeakMap;var eE,MEu=class extends As{constructor({chains:u,options:e}={}){const t={name:"MetaMask",shimDisconnect:!0,getProvider(){function n(i){if(i!=null&&i.isMetaMask&&!(i.isBraveWallet&&!i._events&&!i._state)&&!i.isApexWallet&&!i.isAvalanche&&!i.isBitKeep&&!i.isBlockWallet&&!i.isCoin98&&!i.isFordefi&&!i.isMathWallet&&!(i.isOkxWallet||i.isOKExWallet)&&!(i.isOneInchIOSWallet||i.isOneInchAndroidWallet)&&!i.isOpera&&!i.isPortal&&!i.isRabby&&!i.isDefiant&&!i.isTokenPocket&&!i.isTokenary&&!i.isZeal&&!i.isZerion)return i}if(typeof window>"u")return;const r=window.ethereum;return r!=null&&r.providers?r.providers.find(n):n(r)},...e};super({chains:u,options:t}),this.id="metaMask",this.shimDisconnectKey=`${this.id}.shimDisconnect`,we(this,eE,void 0),Jn(this,eE,t.UNSTABLE_shimOnConnectSelectAccount)}async connect({chainId:u}={}){var e,t,n,r;try{const i=await this.getProvider();if(!i)throw new y0;i.on&&(i.on("accountsChanged",this.onAccountsChanged),i.on("chainChanged",this.onChainChanged),i.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});let a=null;if(Wu(this,eE)&&((e=this.options)!=null&&e.shimDisconnect)&&!((t=this.storage)!=null&&t.getItem(this.shimDisconnectKey))&&(a=await this.getAccount().catch(()=>null),!!a))try{await i.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}),a=await this.getAccount()}catch(c){if(this.isUserRejectedRequestError(c))throw new _e(c);if(c.code===new Qr(c).code)throw c}if(!a){const l=await i.request({method:"eth_requestAccounts"});a=e0(l[0])}let o=await this.getChainId(),s=this.isChainUnsupported(o);return u&&o!==u&&(o=(await this.switchChain(u)).id,s=this.isChainUnsupported(o)),(n=this.options)!=null&&n.shimDisconnect&&((r=this.storage)==null||r.setItem(this.shimDisconnectKey,!0)),{account:a,chain:{id:o,unsupported:s},provider:i}}catch(i){throw this.isUserRejectedRequestError(i)?new _e(i):i.code===-32002?new Qr(i):i}}};eE=new WeakMap;var UEu=/(imtoken|metamask|rainbow|trust wallet|uniswap wallet|ledger)/i,Ci,Gf,kx,LEu=class extends Il{constructor(){super(...arguments),we(this,Gf),this.id="walletConnectLegacy",this.name="WalletConnectLegacy",this.ready=!0,we(this,Ci,void 0),this.onAccountsChanged=u=>{u.length===0?this.emit("disconnect"):this.emit("change",{account:e0(u[0])})},this.onChainChanged=u=>{const e=la(u),t=this.isChainUnsupported(e);this.emit("change",{chain:{id:e,unsupported:t}})},this.onDisconnect=()=>{this.emit("disconnect")}}async connect({chainId:u}={}){var e,t,n,r,i,a;try{let o=u;if(!o){const m=(e=this.storage)==null?void 0:e.getItem("store"),h=(r=(n=(t=m==null?void 0:m.state)==null?void 0:t.data)==null?void 0:n.chain)==null?void 0:r.id;h&&!this.isChainUnsupported(h)&&(o=h)}const s=await this.getProvider({chainId:o,create:!0});s.on("accountsChanged",this.onAccountsChanged),s.on("chainChanged",this.onChainChanged),s.on("disconnect",this.onDisconnect),setTimeout(()=>this.emit("message",{type:"connecting"}),0);const l=await s.enable(),c=e0(l[0]),E=await this.getChainId(),d=this.isChainUnsupported(E),f=((a=(i=s.connector)==null?void 0:i.peerMeta)==null?void 0:a.name)??"";return UEu.test(f)&&(this.switchChain=De(this,Gf,kx)),{account:c,chain:{id:E,unsupported:d}}}catch(o){throw/user closed modal/i.test(o.message)?new _e(o):o}}async disconnect(){const u=await this.getProvider();await u.disconnect(),u.removeListener("accountsChanged",this.onAccountsChanged),u.removeListener("chainChanged",this.onChainChanged),u.removeListener("disconnect",this.onDisconnect),typeof localStorage<"u"&&localStorage.removeItem("walletconnect")}async getAccount(){const e=(await this.getProvider()).accounts;return e0(e[0])}async getChainId(){const u=await this.getProvider();return la(u.chainId)}async getProvider({chainId:u,create:e}={}){var t,n;if(!Wu(this,Ci)||u||e){const r=(t=this.options)!=null&&t.infuraId?{}:this.chains.reduce((a,o)=>({...a,[o.id]:o.rpcUrls.default.http[0]}),{}),i=(await Hu(()=>import("./index-02eff833.js"),["assets/index-02eff833.js","assets/events-699377c5.js","assets/http-8ae254e4.js","assets/hooks.module-fb90a505.js"])).default;Jn(this,Ci,new i({...this.options,chainId:u,rpc:{...r,...(n=this.options)==null?void 0:n.rpc}})),Wu(this,Ci).http=await Wu(this,Ci).setHttpProvider(u)}return Wu(this,Ci)}async getWalletClient({chainId:u}={}){const[e,t]=await Promise.all([this.getProvider({chainId:u}),this.getAccount()]),n=this.chains.find(r=>r.id===u);if(!e)throw new Error("provider is required.");return Tl({account:t,chain:n,transport:Sl(e)})}async isAuthorized(){try{return!!await this.getAccount()}catch{return!1}}};Ci=new WeakMap;Gf=new WeakSet;kx=async function(u){const e=await this.getProvider(),t=zu(u);try{return await Promise.race([e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]}),new Promise(n=>this.on("change",({chain:r})=>{(r==null?void 0:r.id)===u&&n(u)}))]),this.chains.find(n=>n.id===u)??{id:u,name:`Chain ${t}`,network:`${t}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(n){const r=typeof n=="string"?n:n==null?void 0:n.message;throw/user rejected request/i.test(r)?new _e(n):new En(n)}};var P4,T4,$Eu=class extends Il{constructor({chains:u,options:e}){const t={shimDisconnect:!1,...e};super({chains:u,options:t}),this.id="safe",this.name="Safe",this.ready=!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,we(this,P4,void 0),we(this,T4,void 0),this.shimDisconnectKey=`${this.id}.shimDisconnect`;let n=Zl;typeof Zl!="function"&&typeof Zl.default=="function"&&(n=Zl.default),Jn(this,T4,new n(t))}async connect(){var n;const u=await this.getProvider();if(!u)throw new y0;u.on&&(u.on("accountsChanged",this.onAccountsChanged),u.on("chainChanged",this.onChainChanged),u.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});const e=await this.getAccount(),t=await this.getChainId();return this.options.shimDisconnect&&((n=this.storage)==null||n.setItem(this.shimDisconnectKey,!0)),{account:e,chain:{id:t,unsupported:this.isChainUnsupported(t)}}}async disconnect(){var e;const u=await this.getProvider();u!=null&&u.removeListener&&(u.removeListener("accountsChanged",this.onAccountsChanged),u.removeListener("chainChanged",this.onChainChanged),u.removeListener("disconnect",this.onDisconnect),this.options.shimDisconnect&&((e=this.storage)==null||e.removeItem(this.shimDisconnectKey)))}async getAccount(){const u=await this.getProvider();if(!u)throw new y0;const e=await u.request({method:"eth_accounts"});return e0(e[0])}async getChainId(){const u=await this.getProvider();if(!u)throw new y0;return la(u.chainId)}async getProvider(){if(!Wu(this,P4)){const u=await Wu(this,T4).safe.getInfo();if(!u)throw new Error("Could not load Safe information");Jn(this,P4,new C_(u,Wu(this,T4)))}return Wu(this,P4)}async getWalletClient({chainId:u}={}){const e=await this.getProvider(),t=await this.getAccount(),n=this.chains.find(r=>r.id===u);if(!e)throw new Error("provider is required.");return Tl({account:t,chain:n,transport:Sl(e)})}async isAuthorized(){var u;try{return this.options.shimDisconnect&&!((u=this.storage)!=null&&u.getItem(this.shimDisconnectKey))?!1:!!await this.getAccount()}catch{return!1}}onAccountsChanged(u){}onChainChanged(u){}onDisconnect(){this.emit("disconnect")}};P4=new WeakMap;T4=new WeakMap;function WEu(u){return Object.fromEntries(Object.entries(u).filter(([e,t])=>t!==void 0))}var qEu=u=>()=>{let e=-1;const t=[],n=[],r=[],i=[];return u.forEach(({groupName:o,wallets:s},l)=>{s.forEach(c=>{if(e++,c!=null&&c.iconAccent&&!f4u(c==null?void 0:c.iconAccent))throw new Error(`Property \`iconAccent\` is not a hex value for wallet: ${c.name}`);const E={...c,groupIndex:l,groupName:o,index:e};typeof c.hidden=="function"?r.push(E):n.push(E)})}),[...n,...r].forEach(({createConnector:o,groupIndex:s,groupName:l,hidden:c,index:E,...d})=>{if(typeof c=="function"&&c({wallets:[...i.map(({connector:C,id:y,installed:v,name:w})=>({connector:C,id:y,installed:v,name:w}))]}))return;const{connector:f,...m}=WEu(o());let h;if(d.id==="walletConnect"&&m.qrCode&&!qe()){const{chains:g,options:C}=f;h=new xx({chains:g,options:{...C,showQrModal:!0}}),t.push(h)}const B={connector:f,groupIndex:s,groupName:l,index:E,walletConnectModalConnector:h,...d,...m};i.push(B),t.includes(f)||(t.push(f),f._wallets=[]),f._wallets.push(B)}),t},HEu=({chains:u,...e})=>{var t;return{id:"brave",name:"Brave Wallet",iconUrl:async()=>(await Hu(()=>import("./braveWallet-BTBH4MDN-77ab02b2.js"),[])).default,iconBackground:"#fff",installed:typeof window<"u"&&((t=window.ethereum)==null?void 0:t.isBraveWallet)===!0,downloadUrls:{},createConnector:()=>({connector:new As({chains:u,options:e})})}},GEu=({appName:u,chains:e,...t})=>{var n;const r=typeof window<"u"&&((n=window.ethereum)==null?void 0:n.isCoinbaseWallet)===!0;return{id:"coinbase",name:"Coinbase Wallet",shortName:"Coinbase",iconUrl:async()=>(await Hu(()=>import("./coinbaseWallet-2OUR5TUP-f6c629ff.js"),[])).default,iconAccent:"#2c5ff6",iconBackground:"#2c5ff6",installed:r||void 0,downloadUrls:{android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/us/app/coinbase-wallet-store-crypto/id1278383455",mobile:"https://coinbase.com/wallet/downloads",qrCode:"https://coinbase-wallet.onelink.me/q5Sx/fdb9b250",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad",browserExtension:"https://coinbase.com/wallet"},createConnector:()=>{const i=Ba(),a=new zEu({chains:e,options:{appName:u,headlessMode:!0,...t}});return{connector:a,...i?{}:{qrCode:{getUri:async()=>(await a.getProvider()).qrUrl,instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-mobile",steps:[{description:"wallet_connectors.coinbase.qr_code.step1.description",step:"install",title:"wallet_connectors.coinbase.qr_code.step1.title"},{description:"wallet_connectors.coinbase.qr_code.step2.description",step:"create",title:"wallet_connectors.coinbase.qr_code.step2.title"},{description:"wallet_connectors.coinbase.qr_code.step3.description",step:"scan",title:"wallet_connectors.coinbase.qr_code.step3.title"}]}},extension:{instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-extension",steps:[{description:"wallet_connectors.coinbase.extension.step1.description",step:"install",title:"wallet_connectors.coinbase.extension.step1.title"},{description:"wallet_connectors.coinbase.extension.step2.description",step:"create",title:"wallet_connectors.coinbase.extension.step2.title"},{description:"wallet_connectors.coinbase.extension.step3.description",step:"refresh",title:"wallet_connectors.coinbase.extension.step3.title"}]}}}}}}},KEu=({chains:u,...e})=>({id:"injected",name:"Browser Wallet",iconUrl:async()=>(await Hu(()=>import("./injectedWallet-EUKDEAIU-b2513a2e.js"),[])).default,iconBackground:"#fff",hidden:({wallets:t})=>t.some(n=>n.installed&&n.name===n.connector.name&&(n.connector instanceof As||n.id==="coinbase")),createConnector:()=>({connector:new As({chains:u,options:e})})});async function hC(u,e){const t=await u.getProvider();return e==="2"?new Promise(n=>t.once("display_uri",n)):t.connector.uri}var _x=new Map;function QEu(u,e){const t=u==="1"?new LEu(e):new xx(e);return _x.set(JSON.stringify(e),t),t}function c2({chains:u,options:e={},projectId:t,version:n="2"}){const r="21fef48091f12692cad574a6f7753643";if(n==="2"){if(!t||t==="")throw new Error("No projectId found. Every dApp must now provide a WalletConnect Cloud projectId to enable WalletConnect v2 https://www.rainbowkit.com/docs/installation#configure");(t==="YOUR_PROJECT_ID"||t===r)&&console.warn("Invalid projectId. Please create a unique WalletConnect Cloud projectId for your dApp https://www.rainbowkit.com/docs/installation#configure")}const i={chains:u,options:n==="1"?{qrcode:!1,...e}:{projectId:t==="YOUR_PROJECT_ID"?r:t,showQrModal:!1,...e}},a=JSON.stringify(i),o=_x.get(a);return o??QEu(n,i)}function VA(u){return!(!(u!=null&&u.isMetaMask)||u.isBraveWallet&&!u._events&&!u._state||u.isApexWallet||u.isAvalanche||u.isBackpack||u.isBifrost||u.isBitKeep||u.isBitski||u.isBlockWallet||u.isCoinbaseWallet||u.isDawn||u.isEnkrypt||u.isExodus||u.isFrame||u.isFrontier||u.isGamestop||u.isHyperPay||u.isImToken||u.isKuCoinWallet||u.isMathWallet||u.isOkxWallet||u.isOKExWallet||u.isOneInchIOSWallet||u.isOneInchAndroidWallet||u.isOpera||u.isPhantom||u.isPortal||u.isRabby||u.isRainbow||u.isStatus||u.isTalisman||u.isTally||u.isTokenPocket||u.isTokenary||u.isTrust||u.isTrustWallet||u.isXDEFI||u.isZerion)}var VEu=({chains:u,projectId:e,walletConnectOptions:t,walletConnectVersion:n="2",...r})=>{var i,a;const o=typeof window<"u"&&((i=window.ethereum)==null?void 0:i.providers),s=typeof window<"u"&&typeof window.ethereum<"u"&&(((a=window.ethereum.providers)==null?void 0:a.some(VA))||window.ethereum.isMetaMask),l=!s;return{id:"metaMask",name:"MetaMask",iconUrl:async()=>(await Hu(()=>import("./metaMaskWallet-ORHUNQRP-ac2ea8b3.js"),[])).default,iconAccent:"#f6851a",iconBackground:"#fff",installed:l?void 0:s,downloadUrls:{android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/us/app/metamask/id1438144202",mobile:"https://metamask.io/download",qrCode:"https://metamask.io/download",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask",opera:"https://addons.opera.com/extensions/details/metamask-10",browserExtension:"https://metamask.io/download"},createConnector:()=>{const c=l?c2({projectId:e,chains:u,version:n,options:t}):new MEu({chains:u,options:{getProvider:()=>o?o.find(VA):typeof window<"u"?window.ethereum:void 0,...r}}),E=async()=>{const d=await hC(c,n);return U5()?d:Ba()?`metamask://wc?uri=${encodeURIComponent(d)}`:`https://metamask.app.link/wc?uri=${encodeURIComponent(d)}`};return{connector:c,mobile:{getUri:l?E:void 0},qrCode:l?{getUri:E,instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.qr_code.step1.description",step:"install",title:"wallet_connectors.metamask.qr_code.step1.title"},{description:"wallet_connectors.metamask.qr_code.step2.description",step:"create",title:"wallet_connectors.metamask.qr_code.step2.title"},{description:"wallet_connectors.metamask.qr_code.step3.description",step:"refresh",title:"wallet_connectors.metamask.qr_code.step3.title"}]}}:void 0,extension:{instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.extension.step1.description",step:"install",title:"wallet_connectors.metamask.extension.step1.title"},{description:"wallet_connectors.metamask.extension.step2.description",step:"create",title:"wallet_connectors.metamask.extension.step2.title"},{description:"wallet_connectors.metamask.extension.step3.description",step:"refresh",title:"wallet_connectors.metamask.extension.step3.title"}]}}}}}};function Sx(u){if(typeof window>"u"||typeof window.ethereum>"u")return;const e=window.ethereum.providers;return e?e.find(t=>t[u]):window.ethereum[u]?window.ethereum:void 0}function JEu(u){return!!Sx(u)}function YEu(u){if(typeof window>"u"||typeof window.ethereum>"u")return;const e=window.ethereum.providers,t=Sx(u);return t||(typeof e<"u"&&e.length>0?e[0]:window.ethereum)}function XEu({chains:u,flag:e,options:t}){return new As({chains:u,options:{getProvider:()=>YEu(e),...t}})}var ZEu=({chains:u,projectId:e,walletConnectOptions:t,walletConnectVersion:n="2",...r})=>{const i=JEu("isRainbow"),a=!i;return{id:"rainbow",name:"Rainbow",iconUrl:async()=>(await Hu(()=>import("./rainbowWallet-GGU64QEI-80e56a37.js"),[])).default,iconBackground:"#0c2f78",installed:a?void 0:i,downloadUrls:{android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",ios:"https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",mobile:"https://rainbow.download?utm_source=rainbowkit",qrCode:"https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",browserExtension:"https://rainbow.me/extension?utm_source=rainbowkit"},createConnector:()=>{const o=a?c2({projectId:e,chains:u,version:n,options:t}):XEu({flag:"isRainbow",chains:u,options:r}),s=async()=>{const l=await hC(o,n);return U5()?l:Ba()?`rainbow://wc?uri=${encodeURIComponent(l)}&connector=rainbowkit`:`https://rnbwapp.com/wc?uri=${encodeURIComponent(l)}&connector=rainbowkit`};return{connector:o,mobile:{getUri:a?s:void 0},qrCode:a?{getUri:s,instructions:{learnMoreUrl:"https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",steps:[{description:"wallet_connectors.rainbow.qr_code.step1.description",step:"install",title:"wallet_connectors.rainbow.qr_code.step1.title"},{description:"wallet_connectors.rainbow.qr_code.step2.description",step:"create",title:"wallet_connectors.rainbow.qr_code.step2.title"},{description:"wallet_connectors.rainbow.qr_code.step3.description",step:"scan",title:"wallet_connectors.rainbow.qr_code.step3.title"}]}}:void 0}}}},u2u=({chains:u,...e})=>({id:"safe",name:"Safe",iconAccent:"#12ff80",iconBackground:"#fff",iconUrl:async()=>(await Hu(()=>import("./safeWallet-DFMLSLCR-bb33abc9.js"),[])).default,installed:!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,downloadUrls:{},createConnector:()=>({connector:new $Eu({chains:u,options:e})})}),e2u=({chains:u,options:e,projectId:t,version:n="2"})=>({id:"walletConnect",name:"WalletConnect",iconUrl:async()=>(await Hu(()=>import("./walletConnectWallet-D6ZADJM7-c1d5c644.js"),[])).default,iconBackground:"#3b99fc",createConnector:()=>{const r=Ba(),i=c2(n==="1"?{version:"1",chains:u,options:{qrcode:r,...e}}:{version:"2",chains:u,projectId:t,options:{showQrModal:r,...e}}),a=async()=>hC(i,n);return{connector:i,...r?{}:{mobile:{getUri:a},qrCode:{getUri:a}}}}}),t2u=({appName:u,chains:e,projectId:t})=>{const n=[{groupName:"Popular",wallets:[KEu({chains:e}),u2u({chains:e}),ZEu({chains:e,projectId:t}),GEu({appName:u,chains:e}),VEu({chains:e,projectId:t}),e2u({chains:e,projectId:t}),HEu({chains:e})]}];return{connectors:qEu(n),wallets:n}};var Px,JA=Ov;Px=JA.createRoot,JA.hydrateRoot;const Nn={1:"0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2",5:"0x1df10ec981ac5871240be4a94f250dd238b77901",10:"0x1df10ec981ac5871240be4a94f250dd238b77901",56:"0x1df10ec981ac5871240be4a94f250dd238b77901",137:"0x1df10ec981ac5871240be4a94f250dd238b77901",250:"0x1df10ec981ac5871240be4a94f250dd238b77901",288:"0x1df10ec981ac5871240be4a94f250dd238b77901",324:"0x1df10ec981ac5871240be4a94f250dd238b77901",420:"0x1df10ec981ac5871240be4a94f250dd238b77901",42161:"0x1df10ec981ac5871240be4a94f250dd238b77901",80001:"0x1df10ec981ac5871240be4a94f250dd238b77901",421613:"0x1df10ec981ac5871240be4a94f250dd238b77901"};var n2u="0.9.10",At=class Kf extends Error{constructor(e,t={}){var a;const n=t.cause instanceof Kf?t.cause.details:(a=t.cause)!=null&&a.message?t.cause.message:t.details,r=t.cause instanceof Kf&&t.cause.docsPath||t.docsPath,i=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${n2u}`].join(` +`);super(i),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=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}};function si(u,e){const t=u.exec(e);return t==null?void 0:t.groups}var Tx=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ix=/^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)?$/,Ox=/^\(.+?\).*?$/,YA=/^tuple(?(\[(\d*)\])*)$/;function Qf(u){let e=u.type;if(YA.test(u.type)&&"components"in u){e="(";const t=u.components.length;for(let r=0;r[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function i2u(u){return Nx.test(u)}function a2u(u){return si(Nx,u)}var Rx=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function o2u(u){return Rx.test(u)}function s2u(u){return si(Rx,u)}var jx=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function l2u(u){return jx.test(u)}function c2u(u){return si(jx,u)}var zx=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function Mx(u){return zx.test(u)}function E2u(u){return si(zx,u)}var Ux=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function d2u(u){return Ux.test(u)}function f2u(u){return si(Ux,u)}var p2u=/^fallback\(\)$/;function h2u(u){return p2u.test(u)}var C2u=/^receive\(\) external payable$/;function m2u(u){return C2u.test(u)}var g2u=new Set(["indexed"]),Vf=new Set(["calldata","memory","storage"]),A2u=class extends At{constructor({type:u}){super("Unknown type.",{metaMessages:[`Type "${u}" 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"})}},y2u=class extends At{constructor({type:u}){super("Unknown type.",{metaMessages:[`Type "${u}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}},B2u=class extends At{constructor({param:u}){super("Invalid ABI parameter.",{details:u}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},v2u=class extends At{constructor({param:u,name:e}){super("Invalid ABI parameter.",{details:u,metaMessages:[`"${e}" 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"})}},F2u=class extends At{constructor({param:u,type:e,modifier:t}){super("Invalid ABI parameter.",{details:u,metaMessages:[`Modifier "${t}" not allowed${e?` in "${e}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},D2u=class extends At{constructor({param:u,type:e,modifier:t}){super("Invalid ABI parameter.",{details:u,metaMessages:[`Modifier "${t}" not allowed${e?` in "${e}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${t}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},b2u=class extends At{constructor({abiParameter:u}){super("Invalid ABI parameter.",{details:JSON.stringify(u,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}},I4=class extends At{constructor({signature:u,type:e}){super(`Invalid ${e} signature.`,{details:u}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},w2u=class extends At{constructor({signature:u}){super("Unknown signature.",{details:u}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},x2u=class extends At{constructor({signature:u}){super("Invalid struct signature.",{details:u,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}},k2u=class extends At{constructor({type:u}){super("Circular reference detected.",{metaMessages:[`Struct "${u}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}},_2u=class extends At{constructor({current:u,depth:e}){super("Unbalanced parentheses.",{metaMessages:[`"${u.trim()}" has too many ${e>0?"opening":"closing"} parentheses.`],details:`Depth "${e}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}};function S2u(u,e){return e?`${e}:${u}`:u}var S1=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}]]);function P2u(u,e={}){if(l2u(u)){const t=c2u(u);if(!t)throw new I4({signature:u,type:"function"});const n=Pt(t.parameters),r=[],i=n.length;for(let o=0;o[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,I2u=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,O2u=/^u?int$/;function gi(u,e){var E,d;const t=S2u(u,e==null?void 0:e.type);if(S1.has(t))return S1.get(t);const n=Ox.test(u),r=si(n?I2u:T2u,u);if(!r)throw new B2u({param:u});if(r.name&&R2u(r.name))throw new v2u({param:u,name:r.name});const i=r.name?{name:r.name}:{},a=r.modifier==="indexed"?{indexed:!0}:{},o=(e==null?void 0:e.structs)??{};let s,l={};if(n){s="tuple";const f=Pt(r.type),m=[],h=f.length;for(let B=0;B[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function $x(u,e,t=new Set){const n=[],r=u.length;for(let i=0;iObject.fromEntries(u.filter(e=>e.type==="event").map(e=>{const t=n=>({eventName:e.name,abi:[e],humanReadableAbi:xs([e]),...n});return t.abi=[e],t.eventName=e.name,t.humanReadableAbi=xs([e]),[e.name,t]})),$2u=({methods:u})=>Object.fromEntries(u.filter(({type:e})=>e==="function").map(e=>{const t=(...n)=>{const r=u.filter(a=>a.name===(e==null?void 0:e.name)),i=n.length>0?{args:n}:{};return{abi:r,humanReadableAbi:xs([e]),functionName:e.name,...i}};return t.abi=[e],t.humanReadableAbi=xs([e]),[e.name,t]})),W2u=({methods:u})=>Object.fromEntries(u.map(e=>{const t=(...n)=>{const r=u.filter(a=>a.name===(e==null?void 0:e.name)),i=n.length>0?{args:n}:{};return{abi:r,humanReadableAbi:xs([e]),functionName:e.name,...i}};return t.abi=[e],t.humanReadableAbi=xs([e]),[e.name,t]})),q2u=({humanReadableAbi:u,name:e})=>{const t=U2u(u),n=t.filter(r=>r.type==="function");return{name:e,abi:t,humanReadableAbi:u,events:L2u({abi:t}),write:W2u({methods:n}),read:$2u({methods:n})}};const H2u={name:"WagmiMintExample",humanReadableAbi:["constructor()","event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)","event ApprovalForAll(address indexed owner, address indexed operator, bool approved)","event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)","function approve(address to, uint256 tokenId)","function balanceOf(address owner) view returns (uint256)","function getApproved(uint256 tokenId) view returns (address)","function isApprovedForAll(address owner, address operator) view returns (bool)","function mint()","function mint(uint256 tokenId)","function name() view returns (string)","function ownerOf(uint256 tokenId) view returns (address)","function safeTransferFrom(address from, address to, uint256 tokenId)","function safeTransferFrom(address from, address to, uint256 tokenId, bytes data)","function setApprovalForAll(address operator, bool approved)","function supportsInterface(bytes4 interfaceId) view returns (bool)","function symbol() view returns (string)","function tokenURI(uint256 tokenId) pure returns (string)","function totalSupply() view returns (uint256)","function transferFrom(address from, address to, uint256 tokenId)"]},rn=q2u(H2u),G2u="6.8.0";function K2u(u,e,t){const n=e.split("|").map(i=>i.trim());for(let i=0;iPromise.resolve(u[n])))).reduce((n,r,i)=>(n[e[i]]=r,n),{})}function Ou(u,e,t){for(let n in e){let r=e[n];const i=t?t[n]:null;i&&K2u(r,i,n),Object.defineProperty(u,n,{enumerable:!0,value:r,writable:!1})}}function uo(u){if(u==null)return"null";if(Array.isArray(u))return"[ "+u.map(uo).join(", ")+" ]";if(u instanceof Uint8Array){const e="0123456789abcdef";let t="0x";for(let n=0;n>4],t+=e[u[n]&15];return t}if(typeof u=="object"&&typeof u.toJSON=="function")return uo(u.toJSON());switch(typeof u){case"boolean":case"symbol":return u.toString();case"bigint":return BigInt(u).toString();case"number":return u.toString();case"string":return JSON.stringify(u);case"object":{const e=Object.keys(u);return e.sort(),"{ "+e.map(t=>`${uo(t)}: ${uo(u[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Et(u,e){return u&&u.code===e}function CC(u){return Et(u,"CALL_EXCEPTION")}function be(u,e,t){let n=u;{const i=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${uo(t)}`);for(const a in t){if(a==="shortMessage")continue;const o=t[a];i.push(a+"="+uo(o))}}i.push(`code=${e}`),i.push(`version=${G2u}`),i.length&&(u+=" ("+i.join(", ")+")")}let r;switch(e){case"INVALID_ARGUMENT":r=new TypeError(u);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(u);break;default:r=new Error(u)}return Ou(r,{code:e}),t&&Object.assign(r,t),r.shortMessage==null&&Ou(r,{shortMessage:n}),r}function Eu(u,e,t,n){if(!u)throw be(e,t,n)}function Q(u,e,t,n){Eu(u,e,"INVALID_ARGUMENT",{argument:t,value:n})}function Wx(u,e,t){t==null&&(t=""),t&&(t=": "+t),Eu(u>=e,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:u,expectedCount:e}),Eu(u<=e,"too many arguemnts"+t,"UNEXPECTED_ARGUMENT",{count:u,expectedCount:e})}const Q2u=["NFD","NFC","NFKD","NFKC"].reduce((u,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const t=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(t!==n)throw new Error("broken")}u.push(e)}catch{}return u},[]);function V2u(u){Eu(Q2u.indexOf(u)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:u}})}function t9(u,e,t){if(t==null&&(t=""),u!==e){let n=t,r="new";t&&(n+=".",r+=" "+t),Eu(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:r})}}function qx(u,e,t){if(u instanceof Uint8Array)return t?new Uint8Array(u):u;if(typeof u=="string"&&u.match(/^0x([0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((u.length-2)/2);let r=2;for(let i=0;i>4]+XA[r&15]}return t}function Te(u){return"0x"+u.map(e=>ku(e).substring(2)).join("")}function mo(u){return pe(u,!0)?(u.length-2)/2:Zu(u).length}function me(u,e,t){const n=Zu(u);return t!=null&&t>n.length&&Eu(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),ku(n.slice(e??0,t??n.length))}function Hx(u,e,t){const n=Zu(u);Eu(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const r=new Uint8Array(e);return r.fill(0),t?r.set(n,e-n.length):r.set(n,0),ku(r)}function ca(u,e){return Hx(u,e,!0)}function Y2u(u,e){return Hx(u,e,!1)}const n9=BigInt(0),Tt=BigInt(1),eo=9007199254740991;function X2u(u,e){const t=r9(u,"value"),n=BigInt(qu(e,"width"));if(Eu(t>>n===n9,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:u}),t>>n-Tt){const r=(Tt<=-eo&&u<=eo,"overflow",e||"value",u),BigInt(u);case"string":try{if(u==="")throw new Error("empty string");return u[0]==="-"&&u[1]!=="-"?-BigInt(u.substring(1)):BigInt(u)}catch(t){Q(!1,`invalid BigNumberish string: ${t.message}`,e||"value",u)}}Q(!1,"invalid BigNumberish value",e||"value",u)}function r9(u,e){const t=Su(u,e);return Eu(t>=n9,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:u}),t}const ZA="0123456789abcdef";function mC(u){if(u instanceof Uint8Array){let e="0x0";for(const t of u)e+=ZA[t>>4],e+=ZA[t&15];return BigInt(e)}return Su(u)}function qu(u,e){switch(typeof u){case"bigint":return Q(u>=-eo&&u<=eo,"overflow",e||"value",u),Number(u);case"number":return Q(Number.isInteger(u),"underflow",e||"value",u),Q(u>=-eo&&u<=eo,"overflow",e||"value",u),u;case"string":try{if(u==="")throw new Error("empty string");return qu(BigInt(u),e)}catch(t){Q(!1,`invalid numeric string: ${t.message}`,e||"value",u)}}Q(!1,"invalid numeric value",e||"value",u)}function Z2u(u){return qu(mC(u))}function Xr(u,e){let n=r9(u,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const r=qu(e,"width");for(Eu(r*2>=n.length,`value exceeds width (${r} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:u});n.length>6===2;a++)i++;return i}return u==="OVERRUN"?t.length-e-1:0}function idu(u,e,t,n,r){return u==="OVERLONG"?(Q(typeof r=="number","invalid bad code point for replacement","badCodepoint",r),n.push(r),0):(n.push(65533),Qx(u,e,t))}const adu=Object.freeze({error:rdu,ignore:Qx,replace:idu});function odu(u,e){e==null&&(e=adu.error);const t=Zu(u,"bytes"),n=[];let r=0;for(;r>7)){n.push(i);continue}let a=null,o=null;if((i&224)===192)a=1,o=127;else if((i&240)===224)a=2,o=2047;else if((i&248)===240)a=3,o=65535;else{(i&192)===128?r+=e("UNEXPECTED_CONTINUE",r-1,t,n):r+=e("BAD_PREFIX",r-1,t,n);continue}if(r-1+a>=t.length){r+=e("OVERRUN",r-1,t,n);continue}let s=i&(1<<8-a-1)-1;for(let l=0;l1114111){r+=e("OUT_OF_RANGE",r-1-a,t,n,s);continue}if(s>=55296&&s<=57343){r+=e("UTF16_SURROGATE",r-1-a,t,n,s);continue}if(s<=o){r+=e("OVERLONG",r-1-a,t,n,s);continue}n.push(s)}}return n}function Wn(u,e){e!=null&&(V2u(e),u=u.normalize(e));let t=[];for(let n=0;n>6|192),t.push(r&63|128);else if((r&64512)==55296){n++;const i=u.charCodeAt(n);Q(n>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(r>>12|224),t.push(r>>6&63|128),t.push(r&63|128)}return new Uint8Array(t)}function sdu(u){return u.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function gC(u,e){return sdu(odu(u,e))}function Vx(u){async function e(t,n){const r=t.url.split(":")[0].toLowerCase();Eu(r==="http"||r==="https",`unsupported protocol ${r}`,"UNSUPPORTED_OPERATION",{info:{protocol:r},operation:"request"}),Eu(r==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i;if(n){const E=new AbortController;i=E.signal,n.addListener(()=>{E.abort()})}const a={method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:i},o=await fetch(t.url,a),s={};o.headers.forEach((E,d)=>{s[d.toLowerCase()]=E});const l=await o.arrayBuffer(),c=l==null?null:new Uint8Array(l);return{statusCode:o.status,statusMessage:o.statusText,headers:s,body:c}}return e}const ldu=12,cdu=250;let e7=Vx();const Edu=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),ddu=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let P1=!1;async function Jx(u,e){try{const t=u.match(Edu);if(!t)throw new Error("invalid data");return new qr(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?tdu(t[3]):pdu(t[3]))}catch{return new qr(599,"BAD REQUEST (invalid data: URI)",{},null,new Yn(u))}}function Yx(u){async function e(t,n){try{const r=t.match(ddu);if(!r)throw new Error("invalid link");return new Yn(`${u}${r[2]}`)}catch{return new qr(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Yn(t))}}return e}const kc={data:Jx,ipfs:Yx("https://gateway.ipfs.io/ipfs/")},Xx=new WeakMap;var _i,mr;class fdu{constructor(e){tu(this,_i,void 0);tu(this,mr,void 0);R(this,_i,[]),R(this,mr,!1),Xx.set(e,()=>{if(!_(this,mr)){R(this,mr,!0);for(const t of _(this,_i))setTimeout(()=>{t()},0);R(this,_i,[])}})}addListener(e){Eu(!_(this,mr),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),_(this,_i).push(e)}get cancelled(){return _(this,mr)}checkSignal(){Eu(!this.cancelled,"cancelled","CANCELLED",{})}}_i=new WeakMap,mr=new WeakMap;function _c(u){if(u==null)throw new Error("missing signal; should not happen");return u.checkSignal(),u}var Bo,vo,bt,yn,Fo,Do,Ie,N0,Bn,Si,Pi,Ti,Vt,vn,gr,Ii,N4;const B2=class B2{constructor(e){tu(this,Ii);tu(this,Bo,void 0);tu(this,vo,void 0);tu(this,bt,void 0);tu(this,yn,void 0);tu(this,Fo,void 0);tu(this,Do,void 0);tu(this,Ie,void 0);tu(this,N0,void 0);tu(this,Bn,void 0);tu(this,Si,void 0);tu(this,Pi,void 0);tu(this,Ti,void 0);tu(this,Vt,void 0);tu(this,vn,void 0);tu(this,gr,void 0);R(this,Do,String(e)),R(this,Bo,!1),R(this,vo,!0),R(this,bt,{}),R(this,yn,""),R(this,Fo,3e5),R(this,vn,{slotInterval:cdu,maxAttempts:ldu}),R(this,gr,null)}get url(){return _(this,Do)}set url(e){R(this,Do,String(e))}get body(){return _(this,Ie)==null?null:new Uint8Array(_(this,Ie))}set body(e){if(e==null)R(this,Ie,void 0),R(this,N0,void 0);else if(typeof e=="string")R(this,Ie,Wn(e)),R(this,N0,"text/plain");else if(e instanceof Uint8Array)R(this,Ie,e),R(this,N0,"application/octet-stream");else if(typeof e=="object")R(this,Ie,Wn(JSON.stringify(e))),R(this,N0,"application/json");else throw new Error("invalid body")}hasBody(){return _(this,Ie)!=null}get method(){return _(this,yn)?_(this,yn):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),R(this,yn,String(e).toUpperCase())}get headers(){const e=Object.assign({},_(this,bt));return _(this,Bn)&&(e.authorization=`Basic ${ndu(Wn(_(this,Bn)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&_(this,N0)&&(e["content-type"]=_(this,N0)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){_(this,bt)[String(e).toLowerCase()]=String(t)}clearHeaders(){R(this,bt,{})}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n=0,"timeout must be non-zero","timeout",e),R(this,Fo,e)}get preflightFunc(){return _(this,Si)||null}set preflightFunc(e){R(this,Si,e)}get processFunc(){return _(this,Pi)||null}set processFunc(e){R(this,Pi,e)}get retryFunc(){return _(this,Ti)||null}set retryFunc(e){R(this,Ti,e)}get getUrlFunc(){return _(this,gr)||e7}set getUrlFunc(e){R(this,gr,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(_(this,vn).slotInterval=e.slotInterval),e.maxAttempts!=null&&(_(this,vn).maxAttempts=e.maxAttempts)}send(){return Eu(_(this,Vt)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),R(this,Vt,new fdu(this)),yu(this,Ii,N4).call(this,0,t7()+this.timeout,0,this,new qr(0,"",{},null,this))}cancel(){Eu(_(this,Vt)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=Xx.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Eu(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const r=new B2(e);return r.method="GET",r.allowGzip=this.allowGzip,r.timeout=this.timeout,R(r,bt,Object.assign({},_(this,bt))),_(this,Ie)&&R(r,Ie,new Uint8Array(_(this,Ie))),R(r,N0,_(this,N0)),r}clone(){const e=new B2(this.url);return R(e,yn,_(this,yn)),_(this,Ie)&&R(e,Ie,_(this,Ie)),R(e,N0,_(this,N0)),R(e,bt,Object.assign({},_(this,bt))),R(e,Bn,_(this,Bn)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),R(e,Si,_(this,Si)),R(e,Pi,_(this,Pi)),R(e,Ti,_(this,Ti)),R(e,gr,_(this,gr)),e}static lockConfig(){P1=!0}static getGateway(e){return kc[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(P1)throw new Error("gateways locked");kc[e]=t}static registerGetUrl(e){if(P1)throw new Error("gateways locked");e7=e}static createGetUrlFunc(e){return Vx()}static createDataGateway(){return Jx}static createIpfsGatewayFunc(e){return Yx(e)}};Bo=new WeakMap,vo=new WeakMap,bt=new WeakMap,yn=new WeakMap,Fo=new WeakMap,Do=new WeakMap,Ie=new WeakMap,N0=new WeakMap,Bn=new WeakMap,Si=new WeakMap,Pi=new WeakMap,Ti=new WeakMap,Vt=new WeakMap,vn=new WeakMap,gr=new WeakMap,Ii=new WeakSet,N4=async function(e,t,n,r,i){var c,E,d;if(e>=_(this,vn).maxAttempts)return i.makeServerError("exceeded maximum retry limit");Eu(t7()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:r}),n>0&&await hdu(n);let a=this.clone();const o=(a.url.split(":")[0]||"").toLowerCase();if(o in kc){const f=await kc[o](a.url,_c(_(r,Vt)));if(f instanceof qr){let m=f;if(this.processFunc){_c(_(r,Vt));try{m=await this.processFunc(a,m)}catch(h){(h.throttle==null||typeof h.stall!="number")&&m.makeServerError("error in post-processing function",h).assertOk()}}return m}a=f}this.preflightFunc&&(a=await this.preflightFunc(a));const s=await this.getUrlFunc(a,_c(_(r,Vt)));let l=new qr(s.statusCode,s.statusMessage,s.headers,s.body,r);if(l.statusCode===301||l.statusCode===302){try{const f=l.headers.location||"";return yu(c=a.redirect(f),Ii,N4).call(c,e+1,t,0,r,l)}catch{}return l}else if(l.statusCode===429&&(this.retryFunc==null||await this.retryFunc(a,l,e))){const f=l.headers["retry-after"];let m=_(this,vn).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof f=="string"&&f.match(/^[1-9][0-9]*$/)&&(m=parseInt(f)),yu(E=a.clone(),Ii,N4).call(E,e+1,t,m,r,l)}if(this.processFunc){_c(_(r,Vt));try{l=await this.processFunc(a,l)}catch(f){(f.throttle==null||typeof f.stall!="number")&&l.makeServerError("error in post-processing function",f).assertOk();let m=_(this,vn).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return f.stall>=0&&(m=f.stall),yu(d=a.clone(),Ii,N4).call(d,e+1,t,m,r,l)}}return l};let Yn=B2;var Z3,ul,el,wt,bo,Oi;const SC=class SC{constructor(e,t,n,r,i){tu(this,Z3,void 0);tu(this,ul,void 0);tu(this,el,void 0);tu(this,wt,void 0);tu(this,bo,void 0);tu(this,Oi,void 0);R(this,Z3,e),R(this,ul,t),R(this,el,Object.keys(n).reduce((a,o)=>(a[o.toLowerCase()]=String(n[o]),a),{})),R(this,wt,r==null?null:new Uint8Array(r)),R(this,bo,i||null),R(this,Oi,{message:""})}toString(){return``}get statusCode(){return _(this,Z3)}get statusMessage(){return _(this,ul)}get headers(){return Object.assign({},_(this,el))}get body(){return _(this,wt)==null?null:new Uint8Array(_(this,wt))}get bodyText(){try{return _(this,wt)==null?"":gC(_(this,wt))}catch{Eu(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Eu(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n=0,"invalid stall timeout","stall",t);const n=new Error(e||"throttling requests");throw Ou(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return _(this,wt)!=null}get request(){return _(this,bo)}ok(){return _(this,Oi).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=_(this,Oi);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),Eu(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t})}};Z3=new WeakMap,ul=new WeakMap,el=new WeakMap,wt=new WeakMap,bo=new WeakMap,Oi=new WeakMap;let qr=SC;function t7(){return new Date().getTime()}function pdu(u){return Wn(u.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function hdu(u){return new Promise(e=>setTimeout(e,u))}function Cdu(u){let e=u.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function n7(u,e,t){let n=0;for(let r=0;r{Eu(n<=u.length,"data short segment too short","BUFFER_OVERRUN",{buffer:u,length:u.length,offset:n})};if(u[e]>=248){const n=u[e]-247;t(e+1+n);const r=n7(u,e+1,n);return t(e+1+n+r),r7(u,e,e+1+n,n+r)}else if(u[e]>=192){const n=u[e]-192;return t(e+1+n),r7(u,e,e+1,n)}else if(u[e]>=184){const n=u[e]-183;t(e+1+n);const r=n7(u,e+1,n);t(e+1+n+r);const i=ku(u.slice(e+1+n,e+1+n+r));return{consumed:1+n+r,result:i}}else if(u[e]>=128){const n=u[e]-128;t(e+1+n);const r=ku(u.slice(e+1,e+1+n));return{consumed:1+n,result:r}}return{consumed:1,result:Cdu(u[e])}}function AC(u){const e=Zu(u,"data"),t=Zx(e,0);return Q(t.consumed===e.length,"unexpected junk after rlp payload","data",u),t.result}function i7(u){const e=[];for(;u;)e.unshift(u&255),u>>=8;return e}function uk(u){if(Array.isArray(u)){let n=[];if(u.forEach(function(i){n=n.concat(uk(i))}),n.length<=55)return n.unshift(192+n.length),n;const r=i7(n.length);return r.unshift(247+r.length),r.concat(n)}const e=Array.prototype.slice.call(Zu(u,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const t=i7(e.length);return t.unshift(183+t.length),t.concat(e)}const a7="0123456789abcdef";function q3(u){let e="0x";for(const t of uk(u))e+=a7[t>>4],e+=a7[t&15];return e}const l0=32,Jf=new Uint8Array(l0),mdu=["then"],Sc={};function B4(u,e){const t=new Error(`deferred error during ABI decoding triggered accessing ${u}`);throw t.error=e,t}var Ar;const u3=class u3 extends Array{constructor(...t){const n=t[0];let r=t[1],i=(t[2]||[]).slice(),a=!0;n!==Sc&&(r=t,i=[],a=!1);super(r.length);tu(this,Ar,void 0);r.forEach((s,l)=>{this[l]=s});const o=i.reduce((s,l)=>(typeof l=="string"&&s.set(l,(s.get(l)||0)+1),s),new Map);if(R(this,Ar,Object.freeze(r.map((s,l)=>{const c=i[l];return c!=null&&o.get(c)===1?c:null}))),!!a)return Object.freeze(this),new Proxy(this,{get:(s,l,c)=>{if(typeof l=="string"){if(l.match(/^[0-9]+$/)){const d=qu(l,"%index");if(d<0||d>=this.length)throw new RangeError("out of result range");const f=s[d];return f instanceof Error&&B4(`index ${d}`,f),f}if(mdu.indexOf(l)>=0)return Reflect.get(s,l,c);const E=s[l];if(E instanceof Function)return function(...d){return E.apply(this===c?s:this,d)};if(!(l in s))return s.getValue.apply(this===c?s:this,[l])}return Reflect.get(s,l,c)}})}toArray(){const t=[];return this.forEach((n,r)=>{n instanceof Error&&B4(`index ${r}`,n),t.push(n)}),t}toObject(){return _(this,Ar).reduce((t,n,r)=>(Eu(n!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),n in t||(t[n]=this.getValue(n)),t),{})}slice(t,n){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const r=[],i=[];for(let a=t;a{_(this,Fn)[e]=o7(t)}}}Fn=new WeakMap,Ni=new WeakMap,wo=new WeakSet,tE=function(e){return _(this,Fn).push(e),R(this,Ni,_(this,Ni)+e.length),e.length};var R0,ut,v2,ek;const PC=class PC{constructor(e,t){tu(this,v2);X(this,"allowLoose");tu(this,R0,void 0);tu(this,ut,void 0);Ou(this,{allowLoose:!!t}),R(this,R0,F0(e)),R(this,ut,0)}get data(){return ku(_(this,R0))}get dataLength(){return _(this,R0).length}get consumed(){return _(this,ut)}get bytes(){return new Uint8Array(_(this,R0))}subReader(e){return new PC(_(this,R0).slice(_(this,ut)+e),this.allowLoose)}readBytes(e,t){let n=yu(this,v2,ek).call(this,0,e,!!t);return R(this,ut,_(this,ut)+n.length),n.slice(0,e)}readValue(){return mC(this.readBytes(l0))}readIndex(){return Z2u(this.readBytes(l0))}};R0=new WeakMap,ut=new WeakMap,v2=new WeakSet,ek=function(e,t,n){let r=Math.ceil(t/l0)*l0;return _(this,ut)+r>_(this,R0).length&&(this.allowLoose&&n&&_(this,ut)+t<=_(this,R0).length?r=t:Eu(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:F0(_(this,R0)),length:_(this,R0).length,offset:_(this,ut)+r})),_(this,R0).slice(_(this,ut),_(this,ut)+r)};let Xf=PC,tk=!1;const nk=function(u){return sF(u)};let rk=nk;function fe(u){const e=Zu(u,"data");return ku(rk(e))}fe._=nk;fe.lock=function(){tk=!0};fe.register=function(u){if(tk)throw new TypeError("keccak256 is locked");rk=u};Object.freeze(fe);const Zf="0x0000000000000000000000000000000000000000",s7="0x0000000000000000000000000000000000000000000000000000000000000000",l7=BigInt(0),c7=BigInt(1),E7=BigInt(2),d7=BigInt(27),f7=BigInt(28),Pc=BigInt(35),Sa={};function p7(u){return ca(L0(u),32)}var xo,ko,_o,Ri;const vt=class vt{constructor(e,t,n,r){tu(this,xo,void 0);tu(this,ko,void 0);tu(this,_o,void 0);tu(this,Ri,void 0);t9(e,Sa,"Signature"),R(this,xo,t),R(this,ko,n),R(this,_o,r),R(this,Ri,null)}get r(){return _(this,xo)}set r(e){Q(mo(e)===32,"invalid r","value",e),R(this,xo,ku(e))}get s(){return _(this,ko)}set s(e){Q(mo(e)===32,"invalid s","value",e);const t=ku(e);Q(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),R(this,ko,t)}get v(){return _(this,_o)}set v(e){const t=qu(e,"value");Q(t===27||t===28,"invalid v","v",e),R(this,_o,t)}get networkV(){return _(this,Ri)}get legacyChainId(){const e=this.networkV;return e==null?null:vt.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Zu(this.s);return this.yParity&&(e[0]|=128),ku(e)}get compactSerialized(){return Te([this.r,this.yParityAndS])}get serialized(){return Te([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new vt(Sa,this.r,this.s,this.v);return this.networkV&&R(e,Ri,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const t=Su(e,"v");return t==d7||t==f7?l7:(Q(t>=Pc,"invalid EIP-155 v","v",e),(t-Pc)/E7)}static getChainIdV(e,t){return Su(e)*E7+BigInt(35+t-27)}static getNormalizedV(e){const t=Su(e);return t===l7||t===d7?27:t===c7||t===f7?28:(Q(t>=Pc,"invalid v","v",e),t&c7?27:28)}static from(e){function t(l,c){Q(l,c,"signature",e)}if(e==null)return new vt(Sa,s7,s7,27);if(typeof e=="string"){const l=Zu(e,"signature");if(l.length===64){const c=ku(l.slice(0,32)),E=l.slice(32,64),d=E[0]&128?28:27;return E[0]&=127,new vt(Sa,c,ku(E),d)}if(l.length===65){const c=ku(l.slice(0,32)),E=l.slice(32,64);t((E[0]&128)===0,"non-canonical s");const d=vt.getNormalizedV(l[64]);return new vt(Sa,c,ku(E),d)}t(!1,"invalid raw signature length")}if(e instanceof vt)return e.clone();const n=e.r;t(n!=null,"missing r");const r=p7(n),i=function(l,c){if(l!=null)return p7(l);if(c!=null){t(pe(c,32),"invalid yParityAndS");const E=Zu(c);return E[0]&=127,ku(E)}t(!1,"missing s")}(e.s,e.yParityAndS);t((Zu(i)[0]&128)==0,"non-canonical s");const{networkV:a,v:o}=function(l,c,E){if(l!=null){const d=Su(l);return{networkV:d>=Pc?d:void 0,v:vt.getNormalizedV(d)}}if(c!=null)return t(pe(c,32),"invalid yParityAndS"),{v:Zu(c)[0]&128?28:27};if(E!=null){switch(qu(E,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),s=new vt(Sa,r,i,o);return a&&R(s,Ri,a),t(e.yParity==null||qu(e.yParity,"sig.yParity")===s.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===s.yParityAndS,"yParityAndS mismatch"),s}};xo=new WeakMap,ko=new WeakMap,_o=new WeakMap,Ri=new WeakMap;let Mt=vt;var Dn;const Ai=class Ai{constructor(e){tu(this,Dn,void 0);Q(mo(e)===32,"invalid private key","privateKey","[REDACTED]"),R(this,Dn,ku(e))}get privateKey(){return _(this,Dn)}get publicKey(){return Ai.computePublicKey(_(this,Dn))}get compressedPublicKey(){return Ai.computePublicKey(_(this,Dn),!0)}sign(e){Q(mo(e)===32,"invalid digest length","digest",e);const t=lr.sign(F0(e),F0(_(this,Dn)),{lowS:!0});return Mt.from({r:Xr(t.r,32),s:Xr(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=Ai.computePublicKey(e);return ku(lr.getSharedSecret(F0(_(this,Dn)),Zu(t),!1))}static computePublicKey(e,t){let n=Zu(e,"key");if(n.length===32){const i=lr.getPublicKey(n,!!t);return ku(i)}if(n.length===64){const i=new Uint8Array(65);i[0]=4,i.set(n,1),n=i}const r=lr.ProjectivePoint.fromHex(n);return ku(r.toRawBytes(t))}static recoverPublicKey(e,t){Q(mo(e)===32,"invalid digest length","digest",e);const n=Mt.from(t);let r=lr.Signature.fromCompact(F0(Te([n.r,n.s])));r=r.addRecoveryBit(n.yParity);const i=r.recoverPublicKey(F0(e));return Q(i!=null,"invalid signautre for digest","signature",t),"0x"+i.toHex(!1)}static addPoints(e,t,n){const r=lr.ProjectivePoint.fromHex(Ai.computePublicKey(e).substring(2)),i=lr.ProjectivePoint.fromHex(Ai.computePublicKey(t).substring(2));return"0x"+r.add(i).toHex(!!n)}};Dn=new WeakMap;let H3=Ai;const gdu=BigInt(0),Adu=BigInt(36);function h7(u){u=u.toLowerCase();const e=u.substring(2).split(""),t=new Uint8Array(40);for(let r=0;r<40;r++)t[r]=e[r].charCodeAt(0);const n=Zu(fe(t));for(let r=0;r<40;r+=2)n[r>>1]>>4>=8&&(e[r]=e[r].toUpperCase()),(n[r>>1]&15)>=8&&(e[r+1]=e[r+1].toUpperCase());return"0x"+e.join("")}const yC={};for(let u=0;u<10;u++)yC[String(u)]=String(u);for(let u=0;u<26;u++)yC[String.fromCharCode(65+u)]=String(10+u);const C7=15;function ydu(u){u=u.toUpperCase(),u=u.substring(4)+u.substring(0,2)+"00";let e=u.split("").map(n=>yC[n]).join("");for(;e.length>=C7;){let n=e.substring(0,C7);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const Bdu=function(){const u={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];u[t]=BigInt(e)}return u}();function vdu(u){u=u.toLowerCase();let e=gdu;for(let t=0;te.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return _(this,ji)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return _(this,ji)===!0?-1:_(this,ji)===!1?this.value.length:null}static from(e,t){return new mn(Cn,e,t)}static uint8(e){return Bu(e,8)}static uint16(e){return Bu(e,16)}static uint24(e){return Bu(e,24)}static uint32(e){return Bu(e,32)}static uint40(e){return Bu(e,40)}static uint48(e){return Bu(e,48)}static uint56(e){return Bu(e,56)}static uint64(e){return Bu(e,64)}static uint72(e){return Bu(e,72)}static uint80(e){return Bu(e,80)}static uint88(e){return Bu(e,88)}static uint96(e){return Bu(e,96)}static uint104(e){return Bu(e,104)}static uint112(e){return Bu(e,112)}static uint120(e){return Bu(e,120)}static uint128(e){return Bu(e,128)}static uint136(e){return Bu(e,136)}static uint144(e){return Bu(e,144)}static uint152(e){return Bu(e,152)}static uint160(e){return Bu(e,160)}static uint168(e){return Bu(e,168)}static uint176(e){return Bu(e,176)}static uint184(e){return Bu(e,184)}static uint192(e){return Bu(e,192)}static uint200(e){return Bu(e,200)}static uint208(e){return Bu(e,208)}static uint216(e){return Bu(e,216)}static uint224(e){return Bu(e,224)}static uint232(e){return Bu(e,232)}static uint240(e){return Bu(e,240)}static uint248(e){return Bu(e,248)}static uint256(e){return Bu(e,256)}static uint(e){return Bu(e,256)}static int8(e){return Bu(e,-8)}static int16(e){return Bu(e,-16)}static int24(e){return Bu(e,-24)}static int32(e){return Bu(e,-32)}static int40(e){return Bu(e,-40)}static int48(e){return Bu(e,-48)}static int56(e){return Bu(e,-56)}static int64(e){return Bu(e,-64)}static int72(e){return Bu(e,-72)}static int80(e){return Bu(e,-80)}static int88(e){return Bu(e,-88)}static int96(e){return Bu(e,-96)}static int104(e){return Bu(e,-104)}static int112(e){return Bu(e,-112)}static int120(e){return Bu(e,-120)}static int128(e){return Bu(e,-128)}static int136(e){return Bu(e,-136)}static int144(e){return Bu(e,-144)}static int152(e){return Bu(e,-152)}static int160(e){return Bu(e,-160)}static int168(e){return Bu(e,-168)}static int176(e){return Bu(e,-176)}static int184(e){return Bu(e,-184)}static int192(e){return Bu(e,-192)}static int200(e){return Bu(e,-200)}static int208(e){return Bu(e,-208)}static int216(e){return Bu(e,-216)}static int224(e){return Bu(e,-224)}static int232(e){return Bu(e,-232)}static int240(e){return Bu(e,-240)}static int248(e){return Bu(e,-248)}static int256(e){return Bu(e,-256)}static int(e){return Bu(e,-256)}static bytes1(e){return Vu(e,1)}static bytes2(e){return Vu(e,2)}static bytes3(e){return Vu(e,3)}static bytes4(e){return Vu(e,4)}static bytes5(e){return Vu(e,5)}static bytes6(e){return Vu(e,6)}static bytes7(e){return Vu(e,7)}static bytes8(e){return Vu(e,8)}static bytes9(e){return Vu(e,9)}static bytes10(e){return Vu(e,10)}static bytes11(e){return Vu(e,11)}static bytes12(e){return Vu(e,12)}static bytes13(e){return Vu(e,13)}static bytes14(e){return Vu(e,14)}static bytes15(e){return Vu(e,15)}static bytes16(e){return Vu(e,16)}static bytes17(e){return Vu(e,17)}static bytes18(e){return Vu(e,18)}static bytes19(e){return Vu(e,19)}static bytes20(e){return Vu(e,20)}static bytes21(e){return Vu(e,21)}static bytes22(e){return Vu(e,22)}static bytes23(e){return Vu(e,23)}static bytes24(e){return Vu(e,24)}static bytes25(e){return Vu(e,25)}static bytes26(e){return Vu(e,26)}static bytes27(e){return Vu(e,27)}static bytes28(e){return Vu(e,28)}static bytes29(e){return Vu(e,29)}static bytes30(e){return Vu(e,30)}static bytes31(e){return Vu(e,31)}static bytes32(e){return Vu(e,32)}static address(e){return new mn(Cn,"address",e)}static bool(e){return new mn(Cn,"bool",!!e)}static bytes(e){return new mn(Cn,"bytes",e)}static string(e){return new mn(Cn,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new mn(Cn,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===m7}static dereference(e,t){if(mn.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}};ji=new WeakMap;let t0=mn;class Ddu extends ir{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=t0.dereference(t,"string");try{n=Yu(n)}catch(r){return this._throwError(r.message,t)}return e.writeValue(n)}decode(e){return Yu(Xr(e.readValue(),20))}}class bdu extends ir{constructor(t){super(t.name,t.type,"_",t.dynamic);X(this,"coder");this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,n){return this.coder.encode(t,n)}decode(t){return this.coder.decode(t)}}function ak(u,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let s={};n=e.map(l=>{const c=l.localName;return Eu(c,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:t}),Eu(!s[c],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:t}),s[c]=!0,t[c]})}else Q(!1,"invalid tuple value","tuple",t);Q(e.length===n.length,"types/value length mismatch","tuple",t);let r=new Yf,i=new Yf,a=[];e.forEach((s,l)=>{let c=n[l];if(s.dynamic){let E=i.length;s.encode(i,c);let d=r.writeUpdatableValue();a.push(f=>{d(f+E)})}else s.encode(r,c)}),a.forEach(s=>{s(r.length)});let o=u.appendWriter(r);return o+=u.appendWriter(i),o}function ok(u,e){let t=[],n=[],r=u.subReader(0);return e.forEach(i=>{let a=null;if(i.dynamic){let o=u.readIndex(),s=r.subReader(o);try{a=i.decode(s)}catch(l){if(Et(l,"BUFFER_OVERRUN"))throw l;a=l,a.baseType=i.name,a.name=i.localName,a.type=i.type}}else try{a=i.decode(u)}catch(o){if(Et(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=i.name,a.name=i.localName,a.type=i.type}if(a==null)throw new Error("investigate");t.push(a),n.push(i.localName||null)}),E2.fromItems(t,n)}class wdu extends ir{constructor(t,n,r){const i=t.type+"["+(n>=0?n:"")+"]",a=n===-1||t.dynamic;super("array",i,r,a);X(this,"coder");X(this,"length");Ou(this,{coder:t,length:n})}defaultValue(){const t=this.coder.defaultValue(),n=[];for(let r=0;ra||r<-(a+Idu))&&this._throwError("value out-of-bounds",n),r=Gx(r,8*l0)}else(rO4(i,this.size*8))&&this._throwError("value out-of-bounds",n);return t.writeValue(r)}decode(t){let n=O4(t.readValue(),this.size*8);return this.signed&&(n=X2u(n,this.size*8)),n}}class Rdu extends sk{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Wn(t0.dereference(t,"string")))}decode(e){return gC(super.decode(e))}}class Tc extends ir{constructor(t,n){let r=!1;const i=[];t.forEach(o=>{o.dynamic&&(r=!0),i.push(o.type)});const a="tuple("+i.join(",")+")";super("tuple",a,n,r);X(this,"coders");Ou(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach(r=>{t.push(r.defaultValue())});const n=this.coders.reduce((r,i)=>{const a=i.localName;return a&&(r[a]||(r[a]=0),r[a]++),r},{});return this.coders.forEach((r,i)=>{let a=r.localName;!a||n[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[i]))}),Object.freeze(t)}encode(t,n){const r=t0.dereference(n,"tuple");return ak(t,this.coders,r)}decode(t){return ok(t,this.coders)}}function Ea(u){return fe(Wn(u))}var jdu="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDU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DA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const g7=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),A7=4;function zdu(u){let e=0;function t(){return u[e++]<<8|u[e++]}let n=t(),r=1,i=[0,1];for(let w=1;w>--s&1}const E=31,d=2**E,f=d>>>1,m=f>>1,h=d-1;let B=0;for(let w=0;w1;){let O=D+p>>>1;w>>1|c(),x=x<<1^f,j=(j^f)<<1|f|1;C=x,y=1+j-x}let v=n-4;return g.map(w=>{switch(w-v){case 3:return v+65792+(u[o++]<<16|u[o++]<<8|u[o++]);case 2:return v+256+(u[o++]<<8|u[o++]);case 1:return v+u[o++];default:return w-1}})}function Mdu(u){let e=0;return()=>u[e++]}function lk(u){return Mdu(zdu(Udu(u)))}function Udu(u){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((r,i)=>e[r.charCodeAt(0)]=i);let t=u.length,n=new Uint8Array(6*t>>3);for(let r=0,i=0,a=0,o=0;r=8&&(n[i++]=o>>(a-=8));return n}function Ldu(u){return u&1?~u>>1:u>>1}function $du(u,e){let t=Array(u);for(let n=0,r=0;n{let e=G3(u);if(e.length)return e})}function Ek(u){let e=[];for(;;){let t=u();if(t==0)break;e.push(Wdu(t,u))}for(;;){let t=u()-1;if(t<0)break;e.push(qdu(t,u))}return e.flat()}function K3(u){let e=[];for(;;){let t=u(e.length);if(!t)break;e.push(t)}return e}function dk(u,e,t){let n=Array(u).fill().map(()=>[]);for(let r=0;rn[a].push(i));return n}function Wdu(u,e){let t=1+e(),n=e(),r=K3(e);return dk(r.length,1+u,e).flatMap((a,o)=>{let[s,...l]=a;return Array(r[o]).fill().map((c,E)=>{let d=E*n;return[s+E*t,l.map(f=>f+d)]})})}function qdu(u,e){let t=1+e();return dk(t,1+u,e).map(r=>[r[0],r.slice(1)])}function Hdu(u){let e=[],t=G3(u);return r(n([]),[]),e;function n(i){let a=u(),o=K3(()=>{let s=G3(u).map(l=>t[l]);if(s.length)return n(s)});return{S:a,B:o,Q:i}}function r({S:i,B:a},o,s){if(!(i&4&&s===o[o.length-1])){i&2&&(s=o[o.length-1]),i&1&&e.push(o);for(let l of a)for(let c of l.Q)r(l,[...o,c],s)}}}function Gdu(u){return u.toString(16).toUpperCase().padStart(2,"0")}function fk(u){return`{${Gdu(u)}}`}function Kdu(u){let e=[];for(let t=0,n=u.length;t>24&255}function Ck(u){return u&16777215}let up,y7,ep,nE;function e9u(){let u=lk(Vdu);up=new Map(ck(u).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),y7=new Set(G3(u)),ep=new Map,nE=new Map;for(let[e,t]of Ek(u)){if(!y7.has(e)&&t.length==2){let[n,r]=t,i=nE.get(n);i||(i=new Map,nE.set(n,i)),i.set(r,e)}ep.set(e,t.reverse())}}function mk(u){return u>=Q3&&u=d2&&u=f2&&ep2&&e0&&r(p2+l)}else{let a=ep.get(i);a?t.push(...a):r(i)}if(!t.length)break;i=t.pop()}if(n&&e.length>1){let i=R4(e[0]);for(let a=1;a0&&r>=a)a==0?(e.push(n,...t),t.length=0,n=o):t.push(o),r=a;else{let s=t9u(n,o);s>=0?n=s:r==0&&a==0?(e.push(n),n=o):(t.push(o),r=a)}}return n>=0&&e.push(n,...t),e}function Ak(u){return gk(u).map(Ck)}function r9u(u){return n9u(gk(u))}const B7=45,yk=".",Bk=65039,vk=1,no=u=>Array.from(u);function V3(u,e){return u.P.has(e)||u.Q.has(e)}class i9u extends Array{get is_emoji(){return!0}}let tp,Fk,xi,np,Dk,go,I1,za,bk,v7,rp;function BC(){if(tp)return;let u=lk(jdu);const e=()=>G3(u),t=()=>new Set(e());tp=new Map(Ek(u)),Fk=t(),xi=e(),np=new Set(e().map(c=>xi[c])),xi=new Set(xi),Dk=t(),t();let n=ck(u),r=u();const i=()=>new Set(e().flatMap(c=>n[c]).concat(e()));go=K3(c=>{let E=K3(u).map(d=>d+96);if(E.length){let d=c>=r;E[0]-=32,E=ks(E),d&&(E=`Restricted[${E}]`);let f=i(),m=i(),h=!u();return{N:E,P:f,Q:m,M:h,R:d}}}),I1=t(),za=new Map;let a=e().concat(no(I1)).sort((c,E)=>c-E);a.forEach((c,E)=>{let d=u(),f=a[E]=d?a[E-d]:{V:[],M:new Map};f.V.push(c),I1.has(c)||za.set(c,f)});for(let{V:c,M:E}of new Set(za.values())){let d=[];for(let m of c){let h=go.filter(g=>V3(g,m)),B=d.find(({G:g})=>h.some(C=>g.has(C)));B||(B={G:new Set,V:[]},d.push(B)),B.V.push(m),h.forEach(g=>B.G.add(g))}let f=d.flatMap(m=>no(m.G));for(let{G:m,V:h}of d){let B=new Set(f.filter(g=>!m.has(g)));for(let g of h)E.set(g,B)}}let o=new Set,s=new Set;const l=c=>o.has(c)?s.add(c):o.add(c);for(let c of go){for(let E of c.P)l(E);for(let E of c.Q)l(E)}for(let c of o)!za.has(c)&&!s.has(c)&&za.set(c,vk);bk=new Set(no(o).concat(no(Ak(o)))),v7=Hdu(u).map(c=>i9u.from(c)).sort(Qdu),rp=new Map;for(let c of v7){let E=[rp];for(let d of c){let f=E.map(m=>{let h=m.get(d);return h||(h=new Map,m.set(d,h)),h});d===Bk?E.push(...f):E=f}for(let d of E)d.V=c}}function vC(u){return(wk(u)?"":`${FC(i9([u]))} `)+fk(u)}function FC(u){return`"${u}"‎`}function a9u(u){if(u.length>=4&&u[2]==B7&&u[3]==B7)throw new Error(`invalid label extension: "${ks(u.slice(0,4))}"`)}function o9u(u){for(let t=u.lastIndexOf(95);t>0;)if(u[--t]!==95)throw new Error("underscore allowed only at start")}function s9u(u){let e=u[0],t=g7.get(e);if(t)throw X4(`leading ${t}`);let n=u.length,r=-1;for(let i=1;i{let i=Kdu(r),a={input:i,offset:n};n+=i.length+1;try{let o=a.tokens=C9u(i,e,t),s=o.length,l;if(!s)throw new Error("empty label");let c=a.output=o.flat();if(o9u(c),!(a.emoji=s>1||o[0].is_emoji)&&c.every(d=>d<128))a9u(c),l="ASCII";else{let d=o.flatMap(f=>f.is_emoji?[]:f);if(!d.length)l="Emoji";else{if(xi.has(c[0]))throw X4("leading combining mark");for(let h=1;ha.has(o)):no(a),!t.length)return}else n.push(r)}if(t){for(let r of t)if(n.every(i=>V3(r,i)))throw new Error(`whole-script confusable: ${u.N}/${r.N}`)}}function f9u(u){let e=go;for(let t of u){let n=e.filter(r=>V3(r,t));if(!n.length)throw go.some(r=>V3(r,t))?kk(e[0],t):xk(t);if(e=n,n.length==1)break}return e}function p9u(u){return u.map(({input:e,error:t,output:n})=>{if(t){let r=t.message;throw new Error(u.length==1?r:`Invalid label ${FC(i9(e))}: ${r}`)}return ks(n)}).join(yk)}function xk(u){return new Error(`disallowed character: ${vC(u)}`)}function kk(u,e){let t=vC(e),n=go.find(r=>r.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${u.N} + ${t}`)}function X4(u){return new Error(`illegal placement: ${u}`)}function h9u(u,e){for(let t of e)if(!V3(u,t))throw kk(u,t);if(u.M){let t=Ak(e);for(let n=1,r=t.length;nA7)throw new Error(`excessive non-spacing marks: ${FC(i9(t.slice(n-1,i)))} (${i-n}/${A7})`);n=i}}}function C9u(u,e,t){let n=[],r=[];for(u=u.slice().reverse();u.length;){let i=g9u(u);if(i)r.length&&(n.push(e(r)),r=[]),n.push(t(i));else{let a=u.pop();if(bk.has(a))r.push(a);else{let o=tp.get(a);if(o)r.push(...o);else if(!Fk.has(a))throw xk(a)}}}return r.length&&n.push(e(r)),n}function m9u(u){return u.filter(e=>e!=Bk)}function g9u(u,e){let t=rp,n,r=u.length;for(;r&&(t=t.get(u[--r]),!!t);){let{V:i}=t;i&&(n=i,e&&e.push(...u.slice(r).reverse()),u.length=r)}return n}const _k=new Uint8Array(32);_k.fill(0);function F7(u){return Q(u.length!==0,"invalid ENS name; empty component","comp",u),u}function Sk(u){const e=Wn(A9u(u)),t=[];if(u.length===0)return t;let n=0;for(let r=0;r{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"}function O1(u,e){return{address:Yu(u),storageKeys:e.map((t,n)=>(Q(pe(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function Fa(u){if(Array.isArray(u))return u.map((t,n)=>Array.isArray(t)?(Q(t.length===2,"invalid slot set",`value[${n}]`,t),O1(t[0],t[1])):(Q(t!=null&&typeof t=="object","invalid address-slot set","value",u),O1(t.address,t.storageKeys)));Q(u!=null&&typeof u=="object","invalid access list","value",u);const e=Object.keys(u).map(t=>{const n=u[t].reduce((r,i)=>(r[i]=!0,r),{});return O1(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}function B9u(u){let e;return typeof u=="string"?e=H3.computePublicKey(u,!1):e=u.publicKey,Yu(fe("0x"+e.substring(4)).substring(26))}function v9u(u,e){return B9u(H3.recoverPublicKey(u,e))}const B0=BigInt(0),F9u=BigInt(2),D9u=BigInt(27),b9u=BigInt(28),w9u=BigInt(35),x9u=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function DC(u){return u==="0x"?null:Yu(u)}function Pk(u,e){try{return Fa(u)}catch(t){Q(!1,t.message,e,u)}}function a9(u,e){return u==="0x"?0:qu(u,e)}function o0(u,e){if(u==="0x")return B0;const t=Su(u,e);return Q(t<=x9u,"value exceeds uint size",e,t),t}function Ue(u,e){const t=Su(u,"value"),n=L0(t);return Q(n.length<=32,"value too large",`tx.${e}`,t),n}function Tk(u){return Fa(u).map(e=>[e.address,e.storageKeys])}function k9u(u){const e=AC(u);Q(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",u);const t={type:0,nonce:a9(e[0],"nonce"),gasPrice:o0(e[1],"gasPrice"),gasLimit:o0(e[2],"gasLimit"),to:DC(e[3]),value:o0(e[4],"value"),data:ku(e[5]),chainId:B0};if(e.length===6)return t;const n=o0(e[6],"v"),r=o0(e[7],"r"),i=o0(e[8],"s");if(r===B0&&i===B0)t.chainId=n;else{let a=(n-w9u)/F9u;a=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Eu(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Eu(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const r=[];return this.type!=null?r.push(this.type):t?r.push(2):e?(r.push(1),n||r.push(0)):n?(r.push(1),r.push(2)):(r.push(0),r.push(1),r.push(2)),r.sort(),r}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return fr.from(this)}toJSON(){const e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new fr;if(typeof e=="string"){const n=Zu(e);if(n[0]>=127)return fr.from(k9u(n));switch(n[0]){case 1:return fr.from(S9u(n));case 2:return fr.from(_9u(n))}Eu(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new fr;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=Mt.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.hash!=null&&(Q(t.isSigned(),"unsigned transaction cannot define hash","tx",e),Q(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Q(t.isSigned(),"unsigned transaction cannot define from","tx",e),Q(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}};bn=new WeakMap,So=new WeakMap,Po=new WeakMap,To=new WeakMap,Io=new WeakMap,Oo=new WeakMap,No=new WeakMap,Ro=new WeakMap,jo=new WeakMap,zo=new WeakMap,Mo=new WeakMap,Uo=new WeakMap;let C2=fr;const Ok=new Uint8Array(32);Ok.fill(0);const P9u=BigInt(-1),Nk=BigInt(0),Rk=BigInt(1),T9u=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function I9u(u){const e=Zu(u),t=e.length%32;return t?Te([e,Ok.slice(t)]):ku(e)}const O9u=Xr(Rk,32),N9u=Xr(Nk,32),x7={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},N1=["name","version","chainId","verifyingContract","salt"];function k7(u){return function(e){return Q(typeof e=="string",`invalid domain value for ${JSON.stringify(u)}`,`domain.${u}`,e),e}}const R9u={name:k7("name"),version:k7("version"),chainId:function(u){const e=Su(u,"domain.chainId");return Q(e>=0,"invalid chain ID","domain.chainId",u),Number.isSafeInteger(e)?Number(e):to(e)},verifyingContract:function(u){try{return Yu(u).toLowerCase()}catch{}Q(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",u)},salt:function(u){const e=Zu(u,"domain.salt");return Q(e.length===32,'invalid domain value "salt"',"domain.salt",u),ku(e)}};function R1(u){{const e=u.match(/^(u?)int(\d*)$/);if(e){const t=e[1]==="",n=parseInt(e[2]||"256");Q(n%8===0&&n!==0&&n<=256&&(e[2]==null||e[2]===String(n)),"invalid numeric width","type",u);const r=O4(T9u,t?n-1:n),i=t?(r+Rk)*P9u:Nk;return function(a){const o=Su(a,"value");return Q(o>=i&&o<=r,`value out-of-bounds for ${u}`,"value",o),Xr(t?Gx(o,256):o,32)}}}{const e=u.match(/^bytes(\d+)$/);if(e){const t=parseInt(e[1]);return Q(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",u),function(n){const r=Zu(n);return Q(r.length===t,`invalid length for ${u}`,"value",n),I9u(n)}}}switch(u){case"address":return function(e){return ca(Yu(e),32)};case"bool":return function(e){return e?O9u:N9u};case"bytes":return function(e){return fe(e)};case"string":return function(e){return Ea(e)}}return null}function _7(u,e){return`${u}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}var tl,wn,Lo,F2,jk;const Y0=class Y0{constructor(e){tu(this,F2);X(this,"primaryType");tu(this,tl,void 0);tu(this,wn,void 0);tu(this,Lo,void 0);R(this,tl,JSON.stringify(e)),R(this,wn,new Map),R(this,Lo,new Map);const t=new Map,n=new Map,r=new Map;Object.keys(e).forEach(o=>{t.set(o,new Set),n.set(o,[]),r.set(o,new Set)});for(const o in e){const s=new Set;for(const l of e[o]){Q(!s.has(l.name),`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(o)}`,"types",e),s.add(l.name);const c=l.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;Q(c!==o,`circular type reference to ${JSON.stringify(c)}`,"types",e),!R1(c)&&(Q(n.has(c),`unknown type ${JSON.stringify(c)}`,"types",e),n.get(c).push(o),t.get(o).add(c))}}const i=Array.from(n.keys()).filter(o=>n.get(o).length===0);Q(i.length!==0,"missing primary type","types",e),Q(i.length===1,`ambiguous primary types or unused types: ${i.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),Ou(this,{primaryType:i[0]});function a(o,s){Q(!s.has(o),`circular type reference to ${JSON.stringify(o)}`,"types",e),s.add(o);for(const l of t.get(o))if(n.has(l)){a(l,s);for(const c of s)r.get(c).add(l)}s.delete(o)}a(this.primaryType,new Set);for(const[o,s]of r){const l=Array.from(s);l.sort(),_(this,wn).set(o,_7(o,e[o])+l.map(c=>_7(c,e[c])).join(""))}}get types(){return JSON.parse(_(this,tl))}getEncoder(e){let t=_(this,Lo).get(e);return t||(t=yu(this,F2,jk).call(this,e),_(this,Lo).set(e,t)),t}encodeType(e){const t=_(this,wn).get(e);return Q(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return fe(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(R1(e))return n(e,t);const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r)return Q(!r[3]||parseInt(r[3])===t.length,`array length mismatch; expected length ${parseInt(r[3])}`,"value",t),t.map(a=>this._visit(r[1],a,n));const i=this.types[e];if(i)return i.reduce((a,{name:o,type:s})=>(a[o]=this._visit(s,t[o],n),a),{});Q(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Y0(e)}static getPrimaryType(e){return Y0.from(e).primaryType}static hashStruct(e,t,n){return Y0.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){if(e[n]==null)continue;const r=x7[n];Q(r,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:r})}return t.sort((n,r)=>N1.indexOf(n.name)-N1.indexOf(r.name)),Y0.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return Te(["0x1901",Y0.hashDomain(e),Y0.from(t).hash(n)])}static hash(e,t,n){return fe(Y0.encode(e,t,n))}static async resolveNames(e,t,n,r){e=Object.assign({},e);for(const o in e)e[o]==null&&delete e[o];const i={};e.verifyingContract&&!pe(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const a=Y0.from(t);a.visit(n,(o,s)=>(o==="address"&&!pe(s,20)&&(i[s]="0x"),s));for(const o in i)i[o]=await r(o);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=a.visit(n,(o,s)=>o==="address"&&i[s]?i[s]:s),{domain:e,value:n}}static getPayload(e,t,n){Y0.hashDomain(e);const r={},i=[];N1.forEach(s=>{const l=e[s];l!=null&&(r[s]=R9u[s](l),i.push({name:s,type:x7[s]}))});const a=Y0.from(t),o=Object.assign({},t);return Q(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),o.EIP712Domain=i,a.encode(n),{types:o,domain:r,primaryType:a.primaryType,message:a.visit(n,(s,l)=>{if(s.match(/^bytes(\d*)/))return ku(Zu(l));if(s.match(/^u?int/))return Su(l).toString();switch(s){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return Q(typeof l=="string","invalid string","value",l),l}Q(!1,"unsupported type","type",s)})}}};tl=new WeakMap,wn=new WeakMap,Lo=new WeakMap,F2=new WeakSet,jk=function(e){{const r=R1(e);if(r)return r}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const r=t[1],i=this.getEncoder(r);return a=>{Q(!t[3]||parseInt(t[3])===a.length,`array length mismatch; expected length ${parseInt(t[3])}`,"value",a);let o=a.map(i);return _(this,wn).has(r)&&(o=o.map(fe)),fe(Te(o))}}const n=this.types[e];if(n){const r=Ea(_(this,wn).get(e));return i=>{const a=n.map(({name:o,type:s})=>{const l=this.getEncoder(s)(i[o]);return _(this,wn).has(s)?fe(l):l});return a.unshift(r),Te(a)}}Q(!1,`unknown type: ${e}`,"type",e)};let m2=Y0;function E0(u){const e=new Set;return u.forEach(t=>e.add(t)),Object.freeze(e)}const j9u="external public payable",z9u=E0(j9u.split(" ")),zk="constant external internal payable private public pure view",M9u=E0(zk.split(" ")),Mk="constructor error event fallback function receive struct",Uk=E0(Mk.split(" ")),Lk="calldata memory storage payable indexed",U9u=E0(Lk.split(" ")),L9u="tuple returns",$9u=[Mk,Lk,L9u,zk].join(" "),W9u=E0($9u.split(" ")),q9u={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},H9u=new RegExp("^(\\s*)"),G9u=new RegExp("^([0-9]+)"),K9u=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),$k=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),Wk=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var ze,xt,nl,ap;const D2=class D2{constructor(e){tu(this,nl);tu(this,ze,void 0);tu(this,xt,void 0);R(this,ze,0),R(this,xt,e.slice())}get offset(){return _(this,ze)}get length(){return _(this,xt).length-_(this,ze)}clone(){return new D2(_(this,xt))}reset(){R(this,ze,0)}popKeyword(e){const t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=yu(this,nl,ap).call(this,_(this,ze)+1,e.match+1);return R(this,ze,e.match+1),t}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=[];for(;_(this,ze)=_(this,xt).length)throw new Error("out-of-bounds");return _(this,xt)[_(this,ze)]}peekKeyword(e){const t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return i4(this,ze)._++,e}toString(){const e=[];for(let t=_(this,ze);t<_(this,xt).length;t++){const n=_(this,xt)[t];e.push(`${n.type}:${n.text}`)}return``}};ze=new WeakMap,xt=new WeakMap,nl=new WeakSet,ap=function(e=0,t=0){return new D2(_(this,xt).slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let Ut=D2;function li(u){const e=[],t=a=>{const o=i0&&e[e.length-1].type==="NUMBER"){const E=e.pop().text;c=E+c,e[e.length-1].value=qu(E)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=c}continue}if(o=a.match(K9u),o){if(s.text=o[1],i+=s.text.length,W9u.has(s.text)){s.type="KEYWORD";continue}if(s.text.match(Wk)){s.type="TYPE";continue}s.type="ID";continue}if(o=a.match(G9u),o){s.text=o[1],s.type="NUMBER",i+=s.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${i}`)}return new Ut(e.map(a=>Object.freeze(a)))}function S7(u,e){let t=[];for(const n in e.keys())u.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function o9(u,e){if(e.peekKeyword(Uk)){const t=e.pop().text;if(t!==u)throw new Error(`expected ${u}, got ${t}`)}return e.popType("ID")}function Xn(u,e){const t=new Set;for(;;){const n=u.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(u.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function qk(u){let e=Xn(u,M9u);return S7(e,E0("constant payable nonpayable".split(" "))),S7(e,E0("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function qn(u,e){return u.popParams().map(t=>$e.from(t,e))}function Hk(u){if(u.peekType("AT")){if(u.pop(),u.peekType("NUMBER"))return Su(u.pop().text);throw new Error("invalid gas")}return null}function da(u){if(u.length)throw new Error(`unexpected tokens: ${u.toString()}`)}const Q9u=new RegExp(/^(.*)\[([0-9]*)\]$/);function P7(u){const e=u.match(Wk);if(Q(e,"invalid type","type",u),u==="uint")return"uint256";if(u==="int")return"int256";if(e[2]){const t=parseInt(e[2]);Q(t!==0&&t<=32,"invalid bytes length","type",u)}else if(e[3]){const t=parseInt(e[3]);Q(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",u)}return u}const de={},P0=Symbol.for("_ethers_internal"),T7="_ParamTypeInternal",I7="_ErrorInternal",O7="_EventInternal",N7="_ConstructorInternal",R7="_FallbackInternal",j7="_FunctionInternal",z7="_StructInternal";var $o,rE;const X0=class X0{constructor(e,t,n,r,i,a,o,s){tu(this,$o);X(this,"name");X(this,"type");X(this,"baseType");X(this,"indexed");X(this,"components");X(this,"arrayLength");X(this,"arrayChildren");if(t9(e,de,"ParamType"),Object.defineProperty(this,P0,{value:T7}),a&&(a=Object.freeze(a.slice())),r==="array"){if(o==null||s==null)throw new Error("")}else if(o!=null||s!=null)throw new Error("");if(r==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");Ou(this,{name:t,type:n,baseType:r,indexed:i,components:a,arrayLength:o,arrayChildren:s})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=n,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const r={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(r)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(t+=this.type),t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")"):t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(r=>n.arrayChildren.walk(r,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((r,i)=>n.components[i].walk(r,t))}return t(this.type,e)}async walkAsync(e,t){const n=[],r=[e];return yu(this,$o,rE).call(this,n,e,t,i=>{r[0]=i}),n.length&&await Promise.all(n),r[0]}static from(e,t){if(X0.isParamType(e))return e;if(typeof e=="string")try{return X0.from(li(e),t)}catch{Q(!1,"invalid param type","obj",e)}else if(e instanceof Ut){let o="",s="",l=null;Xn(e,E0(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(s="tuple",l=e.popParams().map(h=>X0.from(h)),o=`tuple(${l.map(h=>h.format()).join(",")})`):(o=P7(e.popType("TYPE")),s=o);let c=null,E=null;for(;e.length&&e.peekType("BRACKET");){const h=e.pop();c=new X0(de,"",o,s,null,l,E,c),E=h.value,o+=h.text,s="array",l=null}let d=null;if(Xn(e,U9u).has("indexed")){if(!t)throw new Error("");d=!0}const m=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new X0(de,m,o,s,d,l,E,c)}const n=e.name;Q(!n||typeof n=="string"&&n.match($k),"invalid name","obj.name",n);let r=e.indexed;r!=null&&(Q(t,"parameter cannot be indexed","obj.indexed",e.indexed),r=!!r);let i=e.type,a=i.match(Q9u);if(a){const o=parseInt(a[2]||"-1"),s=X0.from({type:a[1],components:e.components});return new X0(de,n||"",i,"array",r,null,o,s)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const o=e.components!=null?e.components.map(l=>X0.from(l)):null;return new X0(de,n||"",i,"tuple",r,o,null,null)}return i=P7(e.type),new X0(de,n||"",i,i,r,null,null,null)}static isParamType(e){return e&&e[P0]===T7}};$o=new WeakSet,rE=function(e,t,n,r){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,o=t.slice();o.forEach((s,l)=>{var c;yu(c=a,$o,rE).call(c,e,s,n,E=>{o[l]=E})}),r(o);return}if(this.isTuple()){const a=this.components;let o;if(Array.isArray(t))o=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");o=a.map(s=>{if(!s.name)throw new Error("cannot use object value with unnamed components");if(!(s.name in t))throw new Error(`missing value for component ${s.name}`);return t[s.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((s,l)=>{var c;yu(c=a[l],$o,rE).call(c,e,s,n,E=>{o[l]=E})}),r(o);return}const i=n(this.type,t);i.then?e.push(async function(){r(await i)}()):r(i)};let $e=X0;class fa{constructor(e,t,n){X(this,"type");X(this,"inputs");t9(e,de,"Fragment"),n=Object.freeze(n.slice()),Ou(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{fa.from(JSON.parse(e))}catch{}return fa.from(li(e))}if(e instanceof Ut)switch(e.peekKeyword(Uk)){case"constructor":return Mn.from(e);case"error":return v0.from(e);case"event":return an.from(e);case"fallback":case"receive":return An.from(e);case"function":return on.from(e);case"struct":return ea.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Mn.from(e);case"error":return v0.from(e);case"event":return an.from(e);case"fallback":case"receive":return An.from(e);case"function":return on.from(e);case"struct":return ea.from(e)}Eu(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Q(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Mn.isFragment(e)}static isError(e){return v0.isFragment(e)}static isEvent(e){return an.isFragment(e)}static isFunction(e){return on.isFragment(e)}static isStruct(e){return ea.isFragment(e)}}class s9 extends fa{constructor(t,n,r,i){super(t,n,i);X(this,"name");Q(typeof r=="string"&&r.match($k),"invalid identifier","name",r),i=Object.freeze(i.slice()),Ou(this,{name:r})}}function J3(u,e){return"("+e.map(t=>t.format(u)).join(u==="full"?", ":",")+")"}class v0 extends s9{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,P0,{value:I7})}get selector(){return Ea(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+J3(e,this.inputs)),t.join(" ")}static from(e){if(v0.isFragment(e))return e;if(typeof e=="string")return v0.from(li(e));if(e instanceof Ut){const t=o9("error",e),n=qn(e);return da(e),new v0(de,t,n)}return new v0(de,e.name,e.inputs?e.inputs.map($e.from):[])}static isFragment(e){return e&&e[P0]===I7}}class an extends s9{constructor(t,n,r,i){super(t,"event",n,r);X(this,"anonymous");Object.defineProperty(this,P0,{value:O7}),Ou(this,{anonymous:i})}get topicHash(){return Ea(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const n=[];return t!=="sighash"&&n.push("event"),n.push(this.name+J3(t,this.inputs)),t!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(t,n){return n=(n||[]).map(i=>$e.from(i)),new an(de,t,n,!1).topicHash}static from(t){if(an.isFragment(t))return t;if(typeof t=="string")try{return an.from(li(t))}catch{Q(!1,"invalid event fragment","obj",t)}else if(t instanceof Ut){const n=o9("event",t),r=qn(t,!0),i=!!Xn(t,E0(["anonymous"])).has("anonymous");return da(t),new an(de,n,r,i)}return new an(de,t.name,t.inputs?t.inputs.map(n=>$e.from(n,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[P0]===O7}}class Mn extends fa{constructor(t,n,r,i,a){super(t,n,r);X(this,"payable");X(this,"gas");Object.defineProperty(this,P0,{value:N7}),Ou(this,{payable:i,gas:a})}format(t){if(Eu(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const n=[`constructor${J3(t,this.inputs)}`];return n.push(this.payable?"payable":"nonpayable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(t){if(Mn.isFragment(t))return t;if(typeof t=="string")try{return Mn.from(li(t))}catch{Q(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof Ut){Xn(t,E0(["constructor"]));const n=qn(t),r=!!Xn(t,z9u).has("payable"),i=Hk(t);return da(t),new Mn(de,"constructor",n,r,i)}return new Mn(de,"constructor",t.inputs?t.inputs.map($e.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[P0]===N7}}class An extends fa{constructor(t,n,r){super(t,"fallback",n);X(this,"payable");Object.defineProperty(this,P0,{value:R7}),Ou(this,{payable:r})}format(t){const n=this.inputs.length===0?"receive":"fallback";if(t==="json"){const r=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:r})}return`${n}()${this.payable?" payable":""}`}static from(t){if(An.isFragment(t))return t;if(typeof t=="string")try{return An.from(li(t))}catch{Q(!1,"invalid fallback fragment","obj",t)}else if(t instanceof Ut){const n=t.toString(),r=t.peekKeyword(E0(["fallback","receive"]));if(Q(r,"type must be fallback or receive","obj",n),t.popKeyword(E0(["fallback","receive"]))==="receive"){const s=qn(t);return Q(s.length===0,"receive cannot have arguments","obj.inputs",s),Xn(t,E0(["payable"])),da(t),new An(de,[],!0)}let a=qn(t);a.length?Q(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(s=>s.format("minimal")).join(", ")):a=[$e.from("bytes")];const o=qk(t);if(Q(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),Xn(t,E0(["returns"])).has("returns")){const s=qn(t);Q(s.length===1&&s[0].type==="bytes","invalid fallback outputs","obj.outputs",s.map(l=>l.format("minimal")).join(", "))}return da(t),new An(de,a,o==="payable")}if(t.type==="receive")return new An(de,[],!0);if(t.type==="fallback"){const n=[$e.from("bytes")],r=t.stateMutability==="payable";return new An(de,n,r)}Q(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[P0]===R7}}class on extends s9{constructor(t,n,r,i,a,o){super(t,"function",n,i);X(this,"constant");X(this,"outputs");X(this,"stateMutability");X(this,"payable");X(this,"gas");Object.defineProperty(this,P0,{value:j7}),a=Object.freeze(a.slice()),Ou(this,{constant:r==="view"||r==="pure",gas:o,outputs:a,payable:r==="payable",stateMutability:r})}get selector(){return Ea(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t))),outputs:this.outputs.map(r=>JSON.parse(r.format(t)))});const n=[];return t!=="sighash"&&n.push("function"),n.push(this.name+J3(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(J3(t,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(t,n){return n=(n||[]).map(i=>$e.from(i)),new on(de,t,"view",n,[],null).selector}static from(t){if(on.isFragment(t))return t;if(typeof t=="string")try{return on.from(li(t))}catch{Q(!1,"invalid function fragment","obj",t)}else if(t instanceof Ut){const r=o9("function",t),i=qn(t),a=qk(t);let o=[];Xn(t,E0(["returns"])).has("returns")&&(o=qn(t));const s=Hk(t);return da(t),new on(de,r,a,i,o,s)}let n=t.stateMutability;return n==null&&(n="payable",typeof t.constant=="boolean"?(n="view",t.constant||(n="payable",typeof t.payable=="boolean"&&!t.payable&&(n="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(n="nonpayable")),new on(de,t.name,n,t.inputs?t.inputs.map($e.from):[],t.outputs?t.outputs.map($e.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[P0]===j7}}class ea extends s9{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,P0,{value:z7})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return ea.from(li(e))}catch{Q(!1,"invalid struct fragment","obj",e)}else if(e instanceof Ut){const t=o9("struct",e),n=qn(e);return da(e),new ea(de,t,n)}return new ea(de,e.name,e.inputs?e.inputs.map($e.from):[])}static isFragment(e){return e&&e[P0]===z7}}const $t=new Map;$t.set(0,"GENERIC_PANIC");$t.set(1,"ASSERT_FALSE");$t.set(17,"OVERFLOW");$t.set(18,"DIVIDE_BY_ZERO");$t.set(33,"ENUM_RANGE_ERROR");$t.set(34,"BAD_STORAGE_DATA");$t.set(49,"STACK_UNDERFLOW");$t.set(50,"ARRAY_RANGE_ERROR");$t.set(65,"OUT_OF_MEMORY");$t.set(81,"UNINITIALIZED_FUNCTION_CALL");const V9u=new RegExp(/^bytes([0-9]*)$/),J9u=new RegExp(/^(u?int)([0-9]*)$/);let j1=null;function Y9u(u,e,t,n){let r="missing revert data",i=null;const a=null;let o=null;if(t){r="execution reverted";const l=Zu(t);if(t=ku(t),l.length===0)r+=" (no data present; likely require(false) occurred",i="require(false)";else if(l.length%32!==4)r+=" (could not decode reason; invalid data length)";else if(ku(l.slice(0,4))==="0x08c379a0")try{i=n.decode(["string"],l.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[i]},r+=`: ${JSON.stringify(i)}`}catch{r+=" (could not decode reason; invalid string data)"}else if(ku(l.slice(0,4))==="0x4e487b71")try{const c=Number(n.decode(["uint256"],l.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[c]},i=`Panic due to ${$t.get(c)||"UNKNOWN"}(${c})`,r+=`: ${i}`}catch{r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const s={to:e.to?Yu(e.to):null,data:e.data||"0x"};return e.from&&(s.from=Yu(e.from)),be(r,"CALL_EXCEPTION",{action:u,data:t,reason:i,transaction:s,invocation:a,revert:o})}var yr,Ma;const b2=class b2{constructor(){tu(this,yr)}getDefaultValue(e){const t=e.map(r=>yu(this,yr,Ma).call(this,$e.from(r)));return new Tc(t,"_").defaultValue()}encode(e,t){Wx(t.length,e.length,"types/values length mismatch");const n=e.map(a=>yu(this,yr,Ma).call(this,$e.from(a))),r=new Tc(n,"_"),i=new Yf;return r.encode(i,t),i.data}decode(e,t,n){const r=e.map(a=>yu(this,yr,Ma).call(this,$e.from(a)));return new Tc(r,"_").decode(new Xf(t,n))}static defaultAbiCoder(){return j1==null&&(j1=new b2),j1}static getBuiltinCallException(e,t,n){return Y9u(e,t,n,b2.defaultAbiCoder())}};yr=new WeakSet,Ma=function(e){if(e.isArray())return new wdu(yu(this,yr,Ma).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Tc(e.components.map(n=>yu(this,yr,Ma).call(this,n)),e.name);switch(e.baseType){case"address":return new Ddu(e.name);case"bool":return new xdu(e.name);case"string":return new Rdu(e.name);case"bytes":return new kdu(e.name);case"":return new Pdu(e.name)}let t=e.type.match(J9u);if(t){let n=parseInt(t[2]||"256");return Q(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new Ndu(n/8,t[1]==="int",e.name)}if(t=e.type.match(V9u),t){let n=parseInt(t[1]);return Q(n!==0&&n<=32,"invalid bytes length","param",e),new _du(n,e.name)}Q(!1,"invalid type","type",e.type)};let Y3=b2;class X9u{constructor(e,t,n){X(this,"fragment");X(this,"name");X(this,"signature");X(this,"topic");X(this,"args");const r=e.name,i=e.format();Ou(this,{fragment:e,name:r,signature:i,topic:t,args:n})}}class Z9u{constructor(e,t,n,r){X(this,"fragment");X(this,"name");X(this,"args");X(this,"signature");X(this,"selector");X(this,"value");const i=e.name,a=e.format();Ou(this,{fragment:e,name:i,args:n,signature:a,selector:t,value:r})}}class u1u{constructor(e,t,n){X(this,"fragment");X(this,"name");X(this,"args");X(this,"signature");X(this,"selector");const r=e.name,i=e.format();Ou(this,{fragment:e,name:r,args:n,signature:i,selector:t})}}class M7{constructor(e){X(this,"hash");X(this,"_isIndexed");Ou(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const U7={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},L7={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:u=>`reverted with reason string ${JSON.stringify(u)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:u=>{let e="unknown panic code";return u>=0&&u<=255&&U7[u.toString()]&&(e=U7[u.toString()]),`reverted with panic code 0x${u.toString(16)} (${e})`}}};var Jt,Yt,Xt,Ve,Wo,iE,qo,aE;const ro=class ro{constructor(e){tu(this,Wo);tu(this,qo);X(this,"fragments");X(this,"deploy");X(this,"fallback");X(this,"receive");tu(this,Jt,void 0);tu(this,Yt,void 0);tu(this,Xt,void 0);tu(this,Ve,void 0);let t=[];typeof e=="string"?t=JSON.parse(e):t=e,R(this,Xt,new Map),R(this,Jt,new Map),R(this,Yt,new Map);const n=[];for(const a of t)try{n.push(fa.from(a))}catch(o){console.log("EE",o)}Ou(this,{fragments:Object.freeze(n)});let r=null,i=!1;R(this,Ve,this.getAbiCoder()),this.fragments.forEach((a,o)=>{let s;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Ou(this,{deploy:a});return;case"fallback":a.inputs.length===0?i=!0:(Q(!r||a.payable!==r.payable,"conflicting fallback fragments",`fragments[${o}]`,a),r=a,i=r.payable);return;case"function":s=_(this,Xt);break;case"event":s=_(this,Yt);break;case"error":s=_(this,Jt);break;default:return}const l=a.format();s.has(l)||s.set(l,a)}),this.deploy||Ou(this,{deploy:Mn.from("constructor()")}),Ou(this,{fallback:r,receive:i})}format(e){const t=e?"minimal":"full";return this.fragments.map(r=>r.format(t))}formatJson(){const e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return Y3.defaultAbiCoder()}getFunctionName(e){const t=yu(this,Wo,iE).call(this,e,null,!1);return Q(t,"no matching function","key",e),t.name}hasFunction(e){return!!yu(this,Wo,iE).call(this,e,null,!1)}getFunction(e,t){return yu(this,Wo,iE).call(this,e,t||null,!0)}forEachFunction(e){const t=Array.from(_(this,Xt).keys());t.sort((n,r)=>n.localeCompare(r));for(let n=0;nn.localeCompare(r));for(let n=0;n1){const i=r.map(a=>JSON.stringify(a.format())).join(", ");Q(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return r[0]}if(e=v0.from(e).format(),e==="Error(string)")return v0.from("error Error(string)");if(e==="Panic(uint256)")return v0.from("error Panic(uint256)");const n=_(this,Jt).get(e);return n||null}forEachError(e){const t=Array.from(_(this,Jt).keys());t.sort((n,r)=>n.localeCompare(r));for(let n=0;ni.type==="string"?Ea(a):i.type==="bytes"?fe(ku(a)):(i.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":i.type.match(/^u?int/)?a=Xr(a):i.type.match(/^bytes/)?a=Y2u(a,32):i.type==="address"&&_(this,Ve).encode(["address"],[a]),ca(ku(a),32));for(t.forEach((i,a)=>{const o=e.inputs[a];if(!o.indexed){Q(i==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,i);return}i==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?Q(!1,"filtering with tuples or arrays not supported","contract."+o.name,i):Array.isArray(i)?n.push(i.map(s=>r(o,s))):n.push(r(o,i))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){const a=this.getEvent(e);Q(a,"unknown event","eventFragment",e),e=a}const n=[],r=[],i=[];return e.anonymous||n.push(e.topicHash),Q(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((a,o)=>{const s=t[o];if(a.indexed)if(a.type==="string")n.push(Ea(s));else if(a.type==="bytes")n.push(fe(s));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(_(this,Ve).encode([a.type],[s]))}else r.push(a),i.push(s)}),{data:_(this,Ve).encode(r,i),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){const f=this.getEvent(e);Q(f,"unknown event","eventFragment",e),e=f}if(n!=null&&!e.anonymous){const f=e.topicHash;Q(pe(n[0],32)&&n[0].toLowerCase()===f,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const r=[],i=[],a=[];e.inputs.forEach((f,m)=>{f.indexed?f.type==="string"||f.type==="bytes"||f.baseType==="tuple"||f.baseType==="array"?(r.push($e.from({type:"bytes32",name:f.name})),a.push(!0)):(r.push(f),a.push(!1)):(i.push(f),a.push(!1))});const o=n!=null?_(this,Ve).decode(r,Te(n)):null,s=_(this,Ve).decode(i,t,!0),l=[],c=[];let E=0,d=0;return e.inputs.forEach((f,m)=>{let h=null;if(f.indexed)if(o==null)h=new M7(null);else if(a[m])h=new M7(o[d++]);else try{h=o[d++]}catch(B){h=B}else try{h=s[E++]}catch(B){h=B}l.push(h),c.push(f.name||null)}),E2.fromItems(l,c)}parseTransaction(e){const t=Zu(e.data,"tx.data"),n=Su(e.value!=null?e.value:0,"tx.value"),r=this.getFunction(ku(t.slice(0,4)));if(!r)return null;const i=_(this,Ve).decode(r.inputs,t.slice(4));return new Z9u(r,r.selector,i,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new X9u(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=ku(e),n=this.getError(me(t,0,4));if(!n)return null;const r=_(this,Ve).decode(n.inputs,me(t,4));return new u1u(n,n.selector,r)}static from(e){return e instanceof ro?e:typeof e=="string"?new ro(JSON.parse(e)):typeof e.format=="function"?new ro(e.format("json")):new ro(e)}};Jt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,Ve=new WeakMap,Wo=new WeakSet,iE=function(e,t,n){if(pe(e)){const i=e.toLowerCase();for(const a of _(this,Xt).values())if(i===a.selector)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,o]of _(this,Xt))a.split("(")[0]===e&&i.push(o);if(t){const a=t.length>0?t[t.length-1]:null;let o=t.length,s=!0;t0.isTyped(a)&&a.type==="overrides"&&(s=!1,o--);for(let l=i.length-1;l>=0;l--){const c=i[l].inputs.length;c!==o&&(!s||c!==o-1)&&i.splice(l,1)}for(let l=i.length-1;l>=0;l--){const c=i[l].inputs;for(let E=0;E=c.length){if(t[E].type==="overrides")continue;i.splice(l,1);break}if(t[E].type!==c[E].baseType){i.splice(l,1);break}}}}if(i.length===1&&t&&t.length!==i[0].inputs.length){const a=t[t.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&n){const a=i.map(o=>JSON.stringify(o.format())).join(", ");Q(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return i[0]}const r=_(this,Xt).get(on.from(e).format());return r||null},qo=new WeakSet,aE=function(e,t,n){if(pe(e)){const i=e.toLowerCase();for(const a of _(this,Yt).values())if(i===a.topicHash)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,o]of _(this,Yt))a.split("(")[0]===e&&i.push(o);if(t){for(let a=i.length-1;a>=0;a--)i[a].inputs.length=0;a--){const o=i[a].inputs;for(let s=0;s1&&n){const a=i.map(o=>JSON.stringify(o.format())).join(", ");Q(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return i[0]}const r=_(this,Yt).get(an.from(e).format());return r||null};let op=ro;const Gk=BigInt(0);function Z4(u){return u??null}function Ze(u){return u==null?null:u.toString()}class $7{constructor(e,t,n){X(this,"gasPrice");X(this,"maxFeePerGas");X(this,"maxPriorityFeePerGas");Ou(this,{gasPrice:Z4(e),maxFeePerGas:Z4(t),maxPriorityFeePerGas:Z4(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Ze(e),maxFeePerGas:Ze(t),maxPriorityFeePerGas:Ze(n)}}}function g2(u){const e={};u.to&&(e.to=u.to),u.from&&(e.from=u.from),u.data&&(e.data=ku(u.data));const t="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const r of t)!(r in u)||u[r]==null||(e[r]=Su(u[r],`request.${r}`));const n="type,nonce".split(/,/);for(const r of n)!(r in u)||u[r]==null||(e[r]=qu(u[r],`request.${r}`));return u.accessList&&(e.accessList=Fa(u.accessList)),"blockTag"in u&&(e.blockTag=u.blockTag),"enableCcipRead"in u&&(e.enableCcipRead=!!u.enableCcipRead),"customData"in u&&(e.customData=u.customData),e}var xn;class e1u{constructor(e,t){X(this,"provider");X(this,"number");X(this,"hash");X(this,"timestamp");X(this,"parentHash");X(this,"nonce");X(this,"difficulty");X(this,"gasLimit");X(this,"gasUsed");X(this,"miner");X(this,"extraData");X(this,"baseFeePerGas");tu(this,xn,void 0);R(this,xn,e.transactions.map(n=>typeof n!="string"?new X3(n,t):n)),Ou(this,{provider:t,hash:Z4(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:Z4(e.baseFeePerGas)})}get transactions(){return _(this,xn).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=_(this,xn).slice();return e.length===0?[]:(Eu(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:r,gasUsed:i,hash:a,miner:o,nonce:s,number:l,parentHash:c,timestamp:E,transactions:d}=this;return{_type:"Block",baseFeePerGas:Ze(e),difficulty:Ze(t),extraData:n,gasLimit:Ze(r),gasUsed:Ze(i),hash:a,miner:o,nonce:s,number:l,parentHash:c,timestamp:E,transactions:d}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>enew Jl(r,t))));let n=Gk;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Ou(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:n,type:e.type,status:e.status,root:e.root})}get logs(){return _(this,rl)}toJSON(){const{to:e,from:t,contractAddress:n,hash:r,index:i,blockHash:a,blockNumber:o,logsBloom:s,logs:l,status:c,root:E}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:n,cumulativeGasUsed:Ze(this.cumulativeGasUsed),from:t,gasPrice:Ze(this.gasPrice),gasUsed:Ze(this.gasUsed),hash:r,index:i,logs:l,logsBloom:s,root:E,status:c,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(o)return null;const{blockNumber:d,nonce:f}=await a0({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(f{if(d==null||d.status!==0)return d;Eu(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},c=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(c);if(c){if(await c.confirmations()>=n)return l(c)}else if(await s(),n===0)return null;return await new Promise((d,f)=>{const m=[],h=()=>{m.forEach(g=>g())};if(m.push(()=>{o=!0}),r>0){const g=setTimeout(()=>{h(),f(be("wait for transaction timeout","TIMEOUT"))},r);m.push(()=>{clearTimeout(g)})}const B=async g=>{if(await g.confirmations()>=n){h();try{d(l(g))}catch(C){f(C)}}};if(m.push(()=>{this.provider.off(this.hash,B)}),this.provider.on(this.hash,B),i>=0){const g=async()=>{try{await s()}catch(C){if(Et(C,"TRANSACTION_REPLACED")){h(),f(C);return}}o||this.provider.once("block",g)};m.push(()=>{this.provider.off("block",g)}),this.provider.once("block",g)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return Eu(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Vk(this)}reorderedEvent(e){return Eu(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Eu(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Qk(this,e)}replaceableTransaction(e){Q(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new TC(this,this.provider);return R(t,Br,e),t}};Br=new WeakMap;let X3=TC;function t1u(u){return{orphan:"drop-block",hash:u.hash,number:u.number}}function Qk(u,e){return{orphan:"reorder-transaction",tx:u,other:e}}function Vk(u){return{orphan:"drop-transaction",tx:u}}function n1u(u){return{orphan:"drop-log",log:{transactionHash:u.transactionHash,blockHash:u.blockHash,blockNumber:u.blockNumber,address:u.address,data:u.data,topics:Object.freeze(u.topics.slice()),index:u.index}}}class bC extends Jl{constructor(t,n,r){super(t,t.provider);X(this,"interface");X(this,"fragment");X(this,"args");const i=n.decodeEventLog(r,t.data,t.topics);Ou(this,{args:i,fragment:r,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class Jk extends Jl{constructor(t,n){super(t,t.provider);X(this,"error");Ou(this,{error:n})}}var Ho;class r1u extends Kk{constructor(t,n,r){super(r,n);tu(this,Ho,void 0);R(this,Ho,t)}get logs(){return super.logs.map(t=>{const n=t.topics.length?_(this,Ho).getEvent(t.topics[0]):null;if(n)try{return new bC(t,_(this,Ho),n)}catch(r){return new Jk(t,r)}return t})}}Ho=new WeakMap;var il;class wC extends X3{constructor(t,n,r){super(r,n);tu(this,il,void 0);R(this,il,t)}async wait(t){const n=await super.wait(t);return n==null?null:new r1u(_(this,il),this.provider,n)}}il=new WeakMap;class Yk extends Kx{constructor(t,n,r,i){super(t,n,r);X(this,"log");Ou(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class i1u extends Yk{constructor(e,t,n,r,i){super(e,t,n,new bC(i,e.interface,r));const a=e.interface.decodeEventLog(r,this.log.data,this.log.topics);Ou(this,{args:a,fragment:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const W7=BigInt(0);function Xk(u){return u&&typeof u.call=="function"}function Zk(u){return u&&typeof u.estimateGas=="function"}function l9(u){return u&&typeof u.resolveName=="function"}function u_(u){return u&&typeof u.sendTransaction=="function"}function e_(u){if(u!=null){if(l9(u))return u;if(u.provider)return u.provider}}var al;class a1u{constructor(e,t,n){tu(this,al,void 0);X(this,"fragment");if(Ou(this,{fragment:t}),t.inputs.lengthn[s]==null?null:o.walkAsync(n[s],(c,E)=>c==="address"?Array.isArray(E)?Promise.all(E.map(d=>c0(d,i))):c0(E,i):E)));return e.interface.encodeFilterTopics(t,a)}())}getTopicFilter(){return _(this,al)}}al=new WeakMap;function pa(u,e){return u==null?null:typeof u[e]=="function"?u:u.provider&&typeof u.provider[e]=="function"?u.provider:null}function ki(u){return u==null?null:u.provider||null}async function t_(u,e){const t=t0.dereference(u,"overrides");Q(typeof t=="object","invalid overrides parameter","overrides",u);const n=g2(t);return Q(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),Q(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function o1u(u,e,t){const n=pa(u,"resolveName"),r=l9(n)?n:null;return await Promise.all(e.map((i,a)=>i.walkAsync(t[a],(o,s)=>(s=t0.dereference(s,o),o==="address"?c0(s,r):s))))}function s1u(u){const e=async function(a){const o=await t_(a,["data"]);o.to=await u.getAddress(),o.from&&(o.from=await c0(o.from,e_(u.runner)));const s=u.interface,l=Su(o.value||W7,"overrides.value")===W7,c=(o.data||"0x")==="0x";s.fallback&&!s.fallback.payable&&s.receive&&!c&&!l&&Q(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),Q(s.fallback||c,"cannot send data to receive-only contract","overrides.data",o.data);const E=s.receive||s.fallback&&s.fallback.payable;return Q(E||l,"cannot send value to non-payable fallback","overrides.value",o.value),Q(s.fallback||c,"cannot send data to receive-only contract","overrides.data",o.data),o},t=async function(a){const o=pa(u.runner,"call");Eu(Xk(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const s=await e(a);try{return await o.call(s)}catch(l){throw CC(l)&&l.data?u.interface.makeError(l.data,s):l}},n=async function(a){const o=u.runner;Eu(u_(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const s=await o.sendTransaction(await e(a)),l=ki(u.runner);return new wC(u.interface,l,s)},r=async function(a){const o=pa(u.runner,"estimateGas");return Eu(Zk(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(a))},i=async a=>await n(a);return Ou(i,{_contract:u,estimateGas:r,populateTransaction:e,send:n,staticCall:t}),i}function l1u(u,e){const t=function(...l){const c=u.interface.getFunction(e,l);return Eu(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:l}}),c},n=async function(...l){const c=t(...l);let E={};if(c.inputs.length+1===l.length&&(E=await t_(l.pop()),E.from&&(E.from=await c0(E.from,e_(u.runner)))),c.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const d=await o1u(u.runner,c.inputs,l);return Object.assign({},E,await a0({to:u.getAddress(),data:u.interface.encodeFunctionData(c,d)}))},r=async function(...l){const c=await o(...l);return c.length===1?c[0]:c},i=async function(...l){const c=u.runner;Eu(u_(c),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const E=await c.sendTransaction(await n(...l)),d=ki(u.runner);return new wC(u.interface,d,E)},a=async function(...l){const c=pa(u.runner,"estimateGas");return Eu(Zk(c),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await c.estimateGas(await n(...l))},o=async function(...l){const c=pa(u.runner,"call");Eu(Xk(c),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const E=await n(...l);let d="0x";try{d=await c.call(E)}catch(m){throw CC(m)&&m.data?u.interface.makeError(m.data,E):m}const f=t(...l);return u.interface.decodeFunctionResult(f,d)},s=async(...l)=>t(...l).constant?await r(...l):await i(...l);return Ou(s,{name:u.interface.getFunctionName(e),_contract:u,_key:e,getFragment:t,estimateGas:a,populateTransaction:n,send:i,staticCall:r,staticCallResult:o}),Object.defineProperty(s,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=u.interface.getFunction(e);return Eu(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),l}}),s}function c1u(u,e){const t=function(...r){const i=u.interface.getEvent(e,r);return Eu(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:r}}),i},n=function(...r){return new a1u(u,t(...r),r)};return Ou(n,{name:u.interface.getEventName(e),_contract:u,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=u.interface.getEvent(e);return Eu(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),r}}),n}const A2=Symbol.for("_ethersInternal_contract"),n_=new WeakMap;function E1u(u,e){n_.set(u[A2],e)}function O0(u){return n_.get(u[A2])}function d1u(u){return u&&typeof u=="object"&&"getTopicFilter"in u&&typeof u.getTopicFilter=="function"&&u.fragment}async function xC(u,e){let t,n=null;if(Array.isArray(e)){const i=function(a){if(pe(a,32))return a;const o=u.interface.getEvent(a);return Q(o,"unknown fragment","name",a),o.topicHash};t=e.map(a=>a==null?null:Array.isArray(a)?a.map(i):i(a))}else e==="*"?t=[null]:typeof e=="string"?pe(e,32)?t=[e]:(n=u.interface.getEvent(e),Q(n,"unknown fragment","event",e),t=[n.topicHash]):d1u(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):Q(!1,"unknown event name","event",e);t=t.map(i=>{if(i==null)return null;if(Array.isArray(i)){const a=Array.from(new Set(i.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return i.toLowerCase()});const r=t.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:n,tag:r,topics:t}}async function j4(u,e){const{subs:t}=O0(u);return t.get((await xC(u,e)).tag)||null}async function q7(u,e,t){const n=ki(u.runner);Eu(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:r,tag:i,topics:a}=await xC(u,t),{addr:o,subs:s}=O0(u);let l=s.get(i);if(!l){const E={address:o||u,topics:a},d=B=>{let g=r;if(g==null)try{g=u.interface.getEvent(B.topics[0])}catch{}if(g){const C=g,y=r?u.interface.decodeEventLog(r,B.data,B.topics):[];lp(u,t,y,v=>new i1u(u,v,t,C,B))}else lp(u,t,[],C=>new Yk(u,C,t,B))};let f=[];l={tag:i,listeners:[],start:()=>{f.length||f.push(n.on(E,d))},stop:async()=>{if(f.length==0)return;let B=f;f=[],await Promise.all(B),n.off(E,d)}},s.set(i,l)}return l}let sp=Promise.resolve();async function f1u(u,e,t,n){await sp;const r=await j4(u,e);if(!r)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=Array.from(t);n&&s.push(n(o?null:a));try{a.call(u,...s)}catch{}return!o}),r.listeners.length===0&&(r.stop(),O0(u).subs.delete(r.tag)),i>0}async function lp(u,e,t,n){try{await sp}catch{}const r=f1u(u,e,t,n);return sp=r,await r}const Ic=["then"];var d6u;const e3=class e3{constructor(e,t,n,r){X(this,"target");X(this,"interface");X(this,"runner");X(this,"filters");X(this,d6u);X(this,"fallback");Q(typeof e=="string"||ik(e),"invalid value for Contract target","target",e),n==null&&(n=null);const i=op.from(t);Ou(this,{target:e,runner:n,interface:i}),Object.defineProperty(this,A2,{value:{}});let a,o=null,s=null;if(r){const E=ki(n);s=new wC(this.interface,E,r)}let l=new Map;if(typeof e=="string")if(pe(e))o=e,a=Promise.resolve(e);else{const E=pa(n,"resolveName");if(!l9(E))throw be("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=E.resolveName(e).then(d=>{if(d==null)throw be("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return O0(this).addr=d,d})}else a=e.getAddress().then(E=>{if(E==null)throw new Error("TODO");return O0(this).addr=E,E});E1u(this,{addrPromise:a,addr:o,deployTx:s,subs:l});const c=new Proxy({},{get:(E,d,f)=>{if(typeof d=="symbol"||Ic.indexOf(d)>=0)return Reflect.get(E,d,f);try{return this.getEvent(d)}catch(m){if(!Et(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(E,d)=>Ic.indexOf(d)>=0?Reflect.has(E,d):Reflect.has(E,d)||this.interface.hasEvent(String(d))});return Ou(this,{filters:c}),Ou(this,{fallback:i.receive||i.fallback?s1u(this):null}),new Proxy(this,{get:(E,d,f)=>{if(typeof d=="symbol"||d in E||Ic.indexOf(d)>=0)return Reflect.get(E,d,f);try{return E.getFunction(d)}catch(m){if(!Et(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(E,d)=>typeof d=="symbol"||d in E||Ic.indexOf(d)>=0?Reflect.has(E,d):E.interface.hasFunction(d)})}connect(e){return new e3(this.target,this.interface,e)}attach(e){return new e3(e,this.interface,this.runner)}async getAddress(){return await O0(this).addrPromise}async getDeployedCode(){const e=ki(this.runner);Eu(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=ki(this.runner);return Eu(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((r,i)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return r(this);n.once("block",a)}catch(o){i(o)}};a()})}deploymentTransaction(){return O0(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),l1u(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),c1u(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");const{addr:r,addrPromise:i}=O0(this),a=r||await i,{fragment:o,topics:s}=await xC(this,e),l={address:a,topics:s,fromBlock:t,toBlock:n},c=ki(this.runner);return Eu(c,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await c.getLogs(l)).map(E=>{let d=o;if(d==null)try{d=this.interface.getEvent(E.topics[0])}catch{}if(d)try{return new bC(E,this.interface,d)}catch(f){return new Jk(E,f)}return new Jl(E,c)})}async on(e,t){const n=await q7(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){const n=await q7(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await lp(this,e,t,null)}async listenerCount(e){if(e){const r=await j4(this,e);return r?r.listeners.length:0}const{subs:t}=O0(this);let n=0;for(const{listeners:r}of t.values())n+=r.length;return n}async listeners(e){if(e){const r=await j4(this,e);return r?r.listeners.map(({listener:i})=>i):[]}const{subs:t}=O0(this);let n=[];for(const{listeners:r}of t.values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,t){const n=await j4(this,e);if(!n)return this;if(t){const r=n.listeners.map(({listener:i})=>i).indexOf(t);r>=0&&n.listeners.splice(r,1)}return(t==null||n.listeners.length===0)&&(n.stop(),O0(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const t=await j4(this,e);if(!t)return this;t.stop(),O0(this).subs.delete(t.tag)}else{const{subs:t}=O0(this);for(const{tag:n,stop:r}of t.values())r(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends e3{constructor(r,i=null){super(r,e,i)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}};d6u=A2;let cp=e3;function p1u(){return cp}let Ao=class extends p1u(){};function z1(u){return u.match(/^ipfs:\/\/ipfs\//i)?u=u.substring(12):u.match(/^ipfs:\/\//i)?u=u.substring(7):Q(!1,"unsupported IPFS format","link",u),`https://gateway.ipfs.io/ipfs/${u}`}class h1u{constructor(e){X(this,"name");Ou(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const r_=new RegExp("^(ipfs)://(.*)$","i"),H7=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),r_,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var vr,zi,Fr,Ua,w2,i_;const io=class io{constructor(e,t,n){tu(this,Fr);X(this,"provider");X(this,"address");X(this,"name");tu(this,vr,void 0);tu(this,zi,void 0);Ou(this,{provider:e,address:t,name:n}),R(this,vr,null),R(this,zi,new Ao(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return _(this,vr)==null&&R(this,vr,(async()=>{try{return await _(this,zi).supportsInterface("0x9061b923")}catch(e){if(Et(e,"CALL_EXCEPTION"))return!1;throw R(this,vr,null),e}})()),await _(this,vr)}async getAddress(e){if(e==null&&(e=60),e===60)try{const i=await yu(this,Fr,Ua).call(this,"addr(bytes32)");return i==null||i===Zf?null:i}catch(i){if(Et(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648;const a=await yu(this,Fr,Ua).call(this,"addr(bytes32,uint)",[i]);if(pe(a,20))return Yu(a)}let t=null;for(const i of this.provider.plugins)if(i instanceof h1u&&i.supportsCoinType(e)){t=i;break}if(t==null)return null;const n=await yu(this,Fr,Ua).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const r=await t.decodeAddress(e,n);if(r!=null)return r;Eu(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const t=await yu(this,Fr,Ua).call(this,"text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){const e=await yu(this,Fr,Ua).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const r=t[1]==="e3010170"?"ipfs":"ipns",i=parseInt(t[4],16);if(t[5].length===i*2)return`${r}://${edu("0x"+t[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Eu(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n{if(!Array.isArray(e))throw new Error("not an array");return e.map(t=>u(t))}}function Yl(u,e){return t=>{const n={};for(const r in u){let i=r;if(e&&r in e&&!(i in t)){for(const a of e[r])if(a in t){i=a;break}}try{const a=u[r](t[i]);a!==void 0&&(n[r]=a)}catch(a){const o=a instanceof Error?a.message:"not-an-error";Eu(!1,`invalid value for value.${r} (${o})`,"BAD_DATA",{value:t})}}return n}}function C1u(u){switch(u){case!0:case"true":return!0;case!1:case"false":return!1}Q(!1,`invalid boolean; ${JSON.stringify(u)}`,"value",u)}function Ss(u){return Q(pe(u,!0),"invalid data","value",u),u}function dt(u){return Q(pe(u,32),"invalid hash","value",u),u}const m1u=Yl({address:Yu,blockHash:dt,blockNumber:qu,data:Ss,index:qu,removed:le(C1u,!1),topics:kC(dt),transactionHash:dt,transactionIndex:qu},{index:["logIndex"]});function g1u(u){return m1u(u)}const A1u=Yl({hash:le(dt),parentHash:dt,number:qu,timestamp:qu,nonce:le(Ss),difficulty:Su,gasLimit:Su,gasUsed:Su,miner:le(Yu),extraData:Ss,baseFeePerGas:le(Su)});function y1u(u){const e=A1u(u);return e.transactions=u.transactions.map(t=>typeof t=="string"?t:a_(t)),e}const B1u=Yl({transactionIndex:qu,blockNumber:qu,transactionHash:dt,address:Yu,topics:kC(dt),data:Ss,index:qu,blockHash:dt},{index:["logIndex"]});function v1u(u){return B1u(u)}const F1u=Yl({to:le(Yu,null),from:le(Yu,null),contractAddress:le(Yu,null),index:qu,root:le(ku),gasUsed:Su,logsBloom:le(Ss),blockHash:dt,hash:dt,logs:kC(v1u),blockNumber:qu,cumulativeGasUsed:Su,effectiveGasPrice:le(Su),status:le(qu),type:le(qu,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function D1u(u){return F1u(u)}function a_(u){u.to&&Su(u.to)===G7&&(u.to="0x0000000000000000000000000000000000000000");const e=Yl({hash:dt,type:t=>t==="0x"||t==null?0:qu(t),accessList:le(Fa,null),blockHash:le(dt,null),blockNumber:le(qu,null),transactionIndex:le(qu,null),from:Yu,gasPrice:le(Su),maxPriorityFeePerGas:le(Su),maxFeePerGas:le(Su),gasLimit:Su,to:le(Yu,null),value:Su,nonce:qu,data:Ss,creates:le(Yu,null),chainId:le(Su,null)},{data:["input"],gasLimit:["gas"]})(u);if(e.to==null&&e.creates==null&&(e.creates=Fdu(e)),(u.type===1||u.type===2)&&u.accessList==null&&(e.accessList=[]),u.signature?e.signature=Mt.from(u.signature):e.signature=Mt.from(u),e.chainId==null){const t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&Su(e.blockHash)===G7&&(e.blockHash=null),e}const b1u="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Xl{constructor(e){X(this,"name");Ou(this,{name:e})}clone(){return new Xl(this.name)}}class c9 extends Xl{constructor(t,n){t==null&&(t=0);super(`org.ethers.network.plugins.GasCost#${t||0}`);X(this,"effectiveBlock");X(this,"txBase");X(this,"txCreate");X(this,"txDataZero");X(this,"txDataNonzero");X(this,"txAccessListStorageKey");X(this,"txAccessListAddress");const r={effectiveBlock:t};function i(a,o){let s=(n||{})[a];s==null&&(s=o),Q(typeof s=="number",`invalud value for ${a}`,"costs",n),r[a]=s}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Ou(this,r)}clone(){return new c9(this.effectiveBlock,this)}}class E9 extends Xl{constructor(t,n){super("org.ethers.plugins.network.Ens");X(this,"address");X(this,"targetNetwork");Ou(this,{address:t||b1u,targetNetwork:n??1})}clone(){return new E9(this.address,this.targetNetwork)}}var ol,sl;class o_ extends Xl{constructor(t,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");tu(this,ol,void 0);tu(this,sl,void 0);R(this,ol,t),R(this,sl,n)}get url(){return _(this,ol)}get processFunc(){return _(this,sl)}clone(){return this}}ol=new WeakMap,sl=new WeakMap;const M1=new Map;var Go,Ko,Dr;const ao=class ao{constructor(e,t){tu(this,Go,void 0);tu(this,Ko,void 0);tu(this,Dr,void 0);R(this,Go,e),R(this,Ko,Su(t)),R(this,Dr,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return _(this,Go)}set name(e){R(this,Go,e)}get chainId(){return _(this,Ko)}set chainId(e){R(this,Ko,Su(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Su(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Su(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Su(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(_(this,Dr).values())}attachPlugin(e){if(_(this,Dr).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return _(this,Dr).set(e.name,e.clone()),this}getPlugin(e){return _(this,Dr).get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new ao(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new c9;let n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let r=2;r9){let r=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||r++,n[1]=r.toString()}return BigInt(n[0]+n[1])}function Q7(u){return new o_(u,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let r;try{const[i,a]=await Promise.all([n.send(),e()]);r=i;const o=r.bodyJson.standard;return{gasPrice:a.gasPrice,maxFeePerGas:K7(o.maxFee,9),maxPriorityFeePerGas:K7(o.maxPriorityFee,9)}}catch(i){Eu(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:r,error:i})}})}function w1u(u){return new o_("data:",async(e,t,n)=>{const r=await e();if(r.maxFeePerGas==null||r.maxPriorityFeePerGas==null)return r;const i=r.maxFeePerGas-r.maxPriorityFeePerGas;return{gasPrice:r.gasPrice,maxFeePerGas:i+u,maxPriorityFeePerGas:u}})}let V7=!1;function x1u(){if(V7)return;V7=!0;function u(e,t,n){const r=function(){const i=new Un(e,t);return n.ensNetwork!=null&&i.attachPlugin(new E9(null,n.ensNetwork)),i.attachPlugin(new c9),(n.plugins||[]).forEach(a=>{i.attachPlugin(a)}),i};Un.register(e,r),Un.register(t,r),n.altNames&&n.altNames.forEach(i=>{Un.register(i,r)})}u("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),u("ropsten",3,{ensNetwork:3}),u("rinkeby",4,{ensNetwork:4}),u("goerli",5,{ensNetwork:5}),u("kovan",42,{ensNetwork:42}),u("sepolia",11155111,{}),u("classic",61,{}),u("classicKotti",6,{}),u("arbitrum",42161,{ensNetwork:1}),u("arbitrum-goerli",421613,{}),u("bnb",56,{ensNetwork:1}),u("bnbt",97,{}),u("linea",59144,{ensNetwork:1}),u("linea-goerli",59140,{}),u("matic",137,{ensNetwork:1,plugins:[Q7("https://gasstation.polygon.technology/v2")]}),u("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Q7("https://gasstation-testnet.polygon.technology/v2")]}),u("optimism",10,{ensNetwork:1,plugins:[w1u(BigInt("1000000"))]}),u("optimism-goerli",420,{}),u("xdai",100,{ensNetwork:1})}function Ep(u){return JSON.parse(JSON.stringify(u))}var kn,et,br,Zt,Qo,oE;class k1u{constructor(e){tu(this,Qo);tu(this,kn,void 0);tu(this,et,void 0);tu(this,br,void 0);tu(this,Zt,void 0);R(this,kn,e),R(this,et,null),R(this,br,4e3),R(this,Zt,-2)}get pollingInterval(){return _(this,br)}set pollingInterval(e){R(this,br,e)}start(){_(this,et)||(R(this,et,_(this,kn)._setTimeout(yu(this,Qo,oE).bind(this),_(this,br))),yu(this,Qo,oE).call(this))}stop(){_(this,et)&&(_(this,kn)._clearTimeout(_(this,et)),R(this,et,null))}pause(e){this.stop(),e&&R(this,Zt,-2)}resume(){this.start()}}kn=new WeakMap,et=new WeakMap,br=new WeakMap,Zt=new WeakMap,Qo=new WeakSet,oE=async function(){try{const e=await _(this,kn).getBlockNumber();if(_(this,Zt)===-2){R(this,Zt,e);return}if(e!==_(this,Zt)){for(let t=_(this,Zt)+1;t<=e;t++){if(_(this,et)==null)return;await _(this,kn).emit("block",t)}R(this,Zt,e)}}catch{}_(this,et)!=null&&R(this,et,_(this,kn)._setTimeout(yu(this,Qo,oE).bind(this),_(this,br)))};var Mi,Ui,wr;class s_{constructor(e){tu(this,Mi,void 0);tu(this,Ui,void 0);tu(this,wr,void 0);R(this,Mi,e),R(this,wr,!1),R(this,Ui,t=>{this._poll(t,_(this,Mi))})}async _poll(e,t){throw new Error("sub-classes must override this")}start(){_(this,wr)||(R(this,wr,!0),_(this,Ui).call(this,-2),_(this,Mi).on("block",_(this,Ui)))}stop(){_(this,wr)&&(R(this,wr,!1),_(this,Mi).off("block",_(this,Ui)))}pause(e){this.stop()}resume(){this.start()}}Mi=new WeakMap,Ui=new WeakMap,wr=new WeakMap;var x2;class _1u extends s_{constructor(t,n){super(t);tu(this,x2,void 0);R(this,x2,Ep(n))}async _poll(t,n){throw new Error("@TODO")}}x2=new WeakMap;var Vo;class S1u extends s_{constructor(t,n){super(t);tu(this,Vo,void 0);R(this,Vo,n)}async _poll(t,n){const r=await n.getTransactionReceipt(_(this,Vo));r&&n.emit(_(this,Vo),r)}}Vo=new WeakMap;var _n,Jo,Yo,xr,tt,k2,l_;class _C{constructor(e,t){tu(this,k2);tu(this,_n,void 0);tu(this,Jo,void 0);tu(this,Yo,void 0);tu(this,xr,void 0);tu(this,tt,void 0);R(this,_n,e),R(this,Jo,Ep(t)),R(this,Yo,yu(this,k2,l_).bind(this)),R(this,xr,!1),R(this,tt,-2)}start(){_(this,xr)||(R(this,xr,!0),_(this,tt)===-2&&_(this,_n).getBlockNumber().then(e=>{R(this,tt,e)}),_(this,_n).on("block",_(this,Yo)))}stop(){_(this,xr)&&(R(this,xr,!1),_(this,_n).off("block",_(this,Yo)))}pause(e){this.stop(),e&&R(this,tt,-2)}resume(){this.start()}}_n=new WeakMap,Jo=new WeakMap,Yo=new WeakMap,xr=new WeakMap,tt=new WeakMap,k2=new WeakSet,l_=async function(e){if(_(this,tt)===-2)return;const t=Ep(_(this,Jo));t.fromBlock=_(this,tt)+1,t.toBlock=e;const n=await _(this,_n).getLogs(t);if(n.length===0){_(this,tt){if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const r=Object.keys(n);return r.sort(),r.reduce((i,a)=>(i[a]=n[a],i),{})}return n})}class c_{constructor(e){X(this,"name");Ou(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function I1u(u){return JSON.parse(JSON.stringify(u))}function dp(u){return u=Array.from(new Set(u).values()),u.sort(),u}async function U1(u,e){if(u==null)throw new Error("invalid event");if(Array.isArray(u)&&(u={topics:u}),typeof u=="string")switch(u){case"block":case"pending":case"debug":case"error":case"network":return{type:u,tag:u}}if(pe(u,32)){const t=u.toLowerCase();return{type:"transaction",tag:sE("tx",{hash:t}),hash:t}}if(u.orphan){const t=u;return{type:"orphan",tag:sE("orphan",t),filter:I1u(t)}}if(u.address||u.topics){const t=u,n={topics:(t.topics||[]).map(r=>r==null?null:Array.isArray(r)?dp(r.map(i=>i.toLowerCase())):r.toLowerCase())};if(t.address){const r=[],i=[],a=o=>{pe(o)?r.push(o):i.push((async()=>{r.push(await c0(o,e))})())};Array.isArray(t.address)?t.address.forEach(a):a(t.address),i.length&&await Promise.all(i),n.address=dp(r.map(o=>o.toLowerCase()))}return{filter:n,tag:sE("event",n),type:"event"}}Q(!1,"unknown ProviderEvent","event",u)}function L1(){return new Date().getTime()}const O1u={cacheTimeout:250,pollingInterval:4e3};var Je,kr,Ye,Xo,j0,Li,_r,Sn,ll,nt,Zo,us,C0,J0,cl,fp,El,pp,$i,z4,dl,hp,Wi,M4,es,lE;class N1u{constructor(e,t){tu(this,C0);tu(this,cl);tu(this,El);tu(this,$i);tu(this,dl);tu(this,Wi);tu(this,es);tu(this,Je,void 0);tu(this,kr,void 0);tu(this,Ye,void 0);tu(this,Xo,void 0);tu(this,j0,void 0);tu(this,Li,void 0);tu(this,_r,void 0);tu(this,Sn,void 0);tu(this,ll,void 0);tu(this,nt,void 0);tu(this,Zo,void 0);tu(this,us,void 0);if(R(this,us,Object.assign({},O1u,t||{})),e==="any")R(this,Li,!0),R(this,j0,null);else if(e){const n=Un.from(e);R(this,Li,!1),R(this,j0,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else R(this,Li,!1),R(this,j0,null);R(this,Sn,-1),R(this,_r,new Map),R(this,Je,new Map),R(this,kr,new Map),R(this,Ye,null),R(this,Xo,!1),R(this,ll,1),R(this,nt,new Map),R(this,Zo,!1)}get pollingInterval(){return _(this,us).pollingInterval}get provider(){return this}get plugins(){return Array.from(_(this,kr).values())}attachPlugin(e){if(_(this,kr).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return _(this,kr).set(e.name,e.connect(this)),this}getPlugin(e){return _(this,kr).get(e)||null}get disableCcipRead(){return _(this,Zo)}set disableCcipRead(e){R(this,Zo,!!e)}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const r=e.to.toLowerCase(),i=t.toLowerCase(),a=[];for(let o=0;o=500,`response not found during CCIP fetch: ${E}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:s,errorMessage:E}}),a.push(E)}Eu(!1,`error encountered during CCIP fetch: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:a}})}_wrapBlock(e,t){return new e1u(y1u(e),this)}_wrapLog(e,t){return new Jl(g1u(e),this)}_wrapTransactionReceipt(e,t){return new Kk(D1u(e),this)}_wrapTransactionResponse(e,t){return new X3(a_(e),this)}_detectNetwork(){Eu(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Eu(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=qu(await yu(this,C0,J0).call(this,{method:"getBlockNumber"}),"%response");return _(this,Sn)>=0&&R(this,Sn,e),e}_getAddress(e){return c0(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(pe(e))return pe(e,32)?e:to(e);if(typeof e=="bigint"&&(e=qu(e,"blockTag")),typeof e=="number")return e>=0?to(e):_(this,Sn)>=0?to(_(this,Sn)+e):this.getBlockNumber().then(t=>to(t+e));Q(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const t=(e.topics||[]).map(s=>s==null?null:Array.isArray(s)?dp(s.map(l=>l.toLowerCase())):s.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,r=(s,l,c)=>{let E;switch(s.length){case 0:break;case 1:E=s[0];break;default:s.sort(),E=s}if(n&&(l!=null||c!=null))throw new Error("invalid filter");const d={};return E&&(d.address=E),t.length&&(d.topics=t),l&&(d.fromBlock=l),c&&(d.toBlock=c),n&&(d.blockHash=n),d};let i=[];if(e.address)if(Array.isArray(e.address))for(const s of e.address)i.push(this._getAddress(s));else i.push(this._getAddress(e.address));let a;"fromBlock"in e&&(a=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),i.filter(s=>typeof s!="string").length||a!=null&&typeof a!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(i),a,o]).then(s=>r(s[0],s[1],s[2])):r(i,a,o)}_getTransactionRequest(e){const t=g2(e),n=[];if(["to","from"].forEach(r=>{if(t[r]==null)return;const i=c0(t[r],this);Oc(i)?n.push(async function(){t[r]=await i}()):t[r]=i}),t.blockTag!=null){const r=this._getBlockTag(t.blockTag);Oc(r)?n.push(async function(){t.blockTag=await r}()):t.blockTag=r}return n.length?async function(){return await Promise.all(n),t}():t}async getNetwork(){if(_(this,j0)==null){const r=this._detectNetwork().then(i=>(this.emit("network",i,null),i),i=>{throw _(this,j0)===r&&R(this,j0,null),i});return R(this,j0,r),(await r).clone()}const e=_(this,j0),[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(_(this,Li)?(this.emit("network",n,t),_(this,j0)===e&&R(this,j0,Promise.resolve(n))):Eu(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:r,gasPrice:i}=await a0({_block:yu(this,dl,hp).call(this,"latest",!1),gasPrice:(async()=>{try{const l=await yu(this,C0,J0).call(this,{method:"getGasPrice"});return Su(l,"%response")}catch{}return null})()});let a=null,o=null;const s=this._wrapBlock(r,e);return s&&s.baseFeePerGas&&(o=BigInt("1000000000"),a=s.baseFeePerGas*P1u+o),new $7(i,a,o)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const r=new Yn(n.url),i=await n.processFunc(t,this,r);return new $7(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return Oc(t)&&(t=await t),Su(await yu(this,C0,J0).call(this,{method:"estimateGas",transaction:t}),"%response")}async call(e){const{tx:t,blockTag:n}=await a0({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await yu(this,El,pp).call(this,yu(this,cl,fp).call(this,t,n,e.enableCcipRead?0:-1))}async getBalance(e,t){return Su(await yu(this,$i,z4).call(this,{method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return qu(await yu(this,$i,z4).call(this,{method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return ku(await yu(this,$i,z4).call(this,{method:"getCode"},e,t))}async getStorage(e,t,n){const r=Su(t,"position");return ku(await yu(this,$i,z4).call(this,{method:"getStorage",position:r},e,n))}async broadcastTransaction(e){const{blockNumber:t,hash:n,network:r}=await a0({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=C2.from(e);if(i.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,r).replaceableTransaction(t)}async getBlock(e,t){const{network:n,params:r}=await a0({network:this.getNetwork(),params:yu(this,dl,hp).call(this,e,!!t)});return r==null?null:this._wrapBlock(r,n)}async getTransaction(e){const{network:t,params:n}=await a0({network:this.getNetwork(),params:yu(this,C0,J0).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){const{network:t,params:n}=await a0({network:this.getNetwork(),params:yu(this,C0,J0).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const r=await yu(this,C0,J0).call(this,{method:"getTransaction",hash:e});if(r==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=r.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){const{result:t}=await a0({network:this.getNetwork(),result:yu(this,C0,J0).call(this,{method:"getTransactionResult",hash:e})});return t==null?null:ku(t)}async getLogs(e){let t=this._getFilter(e);Oc(t)&&(t=await t);const{network:n,params:r}=await a0({network:this.getNetwork(),params:yu(this,C0,J0).call(this,{method:"getLogs",filter:t})});return r.map(i=>this._wrapLog(i,n))}_getProvider(e){Eu(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await y2.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=Yu(e);const t=ip(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await y2.getEnsAddress(this),i=await new Ao(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(i==null||i===Zf)return null;const o=await new Ao(i,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(o)!==e?null:o}catch(n){if(Et(n,"BAD_DATA")&&n.value==="0x"||Et(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){const r=t??1;return r===0?this.getTransactionReceipt(e):new Promise(async(i,a)=>{let o=null;const s=async l=>{try{const c=await this.getTransactionReceipt(e);if(c!=null&&l-c.blockNumber+1>=r){i(c),o&&(clearTimeout(o),o=null);return}}catch(c){console.log("EEE",c)}this.once("block",s)};n!=null&&(o=setTimeout(()=>{o!=null&&(o=null,this.off("block",s),a(be("timeout","TIMEOUT",{reason:"timeout"})))},n)),s(await this.getBlockNumber())})}async waitForBlock(e){Eu(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=_(this,nt).get(e);t&&(t.timer&&clearTimeout(t.timer),_(this,nt).delete(e))}_setTimeout(e,t){t==null&&(t=0);const n=i4(this,ll)._++,r=()=>{_(this,nt).delete(n),e()};if(this.paused)_(this,nt).set(n,{timer:null,func:r,time:t});else{const i=setTimeout(r,t);_(this,nt).set(n,{timer:i,func:r,time:L1()})}return n}_forEachSubscriber(e){for(const t of _(this,Je).values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new c_(e.type);case"block":{const t=new k1u(this);return t.pollingInterval=this.pollingInterval,t}case"event":return new _C(this,e.filter);case"transaction":return new S1u(this,e.hash);case"orphan":return new _1u(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const n of _(this,Je).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),_(this,Ye)!=null&&t.pause(_(this,Ye));break}}async on(e,t){const n=await yu(this,es,lE).call(this,e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,_(this,Ye)!=null&&n.subscriber.pause(_(this,Ye))),this}async once(e,t){const n=await yu(this,es,lE).call(this,e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,_(this,Ye)!=null&&n.subscriber.pause(_(this,Ye))),this}async emit(e,...t){const n=await yu(this,Wi,M4).call(this,e,t);if(!n||n.listeners.length===0)return!1;const r=n.listeners.length;return n.listeners=n.listeners.filter(({listener:i,once:a})=>{const o=new Kx(this,a?null:i,e);try{i.call(this,...t,o)}catch{}return!a}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),_(this,Je).delete(n.tag)),r>0}async listenerCount(e){if(e){const n=await yu(this,Wi,M4).call(this,e);return n?n.listeners.length:0}let t=0;for(const{listeners:n}of _(this,Je).values())t+=n.length;return t}async listeners(e){if(e){const n=await yu(this,Wi,M4).call(this,e);return n?n.listeners.map(({listener:r})=>r):[]}let t=[];for(const{listeners:n}of _(this,Je).values())t=t.concat(n.map(({listener:r})=>r));return t}async off(e,t){const n=await yu(this,Wi,M4).call(this,e);if(!n)return this;if(t){const r=n.listeners.map(({listener:i})=>i).indexOf(t);r>=0&&n.listeners.splice(r,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),_(this,Je).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:n,subscriber:r}=await yu(this,es,lE).call(this,e);n&&r.stop(),_(this,Je).delete(t)}else for(const[t,{started:n,subscriber:r}]of _(this,Je))n&&r.stop(),_(this,Je).delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return _(this,Xo)}destroy(){this.removeAllListeners();for(const e of _(this,nt).keys())this._clearTimeout(e);R(this,Xo,!0)}get paused(){return _(this,Ye)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(R(this,Sn,-1),_(this,Ye)!=null){if(_(this,Ye)==!!e)return;Eu(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),R(this,Ye,!!e);for(const t of _(this,nt).values())t.timer&&clearTimeout(t.timer),t.time=L1()-t.time}resume(){if(_(this,Ye)!=null){this._forEachSubscriber(e=>e.resume()),R(this,Ye,null);for(const e of _(this,nt).values()){let t=e.time;t<0&&(t=0),e.time=L1(),setTimeout(e.func,t)}}}}Je=new WeakMap,kr=new WeakMap,Ye=new WeakMap,Xo=new WeakMap,j0=new WeakMap,Li=new WeakMap,_r=new WeakMap,Sn=new WeakMap,ll=new WeakMap,nt=new WeakMap,Zo=new WeakMap,us=new WeakMap,C0=new WeakSet,J0=async function(e){const t=_(this,us).cacheTimeout;if(t<0)return await this._perform(e);const n=sE(e.method,e);let r=_(this,_r).get(n);return r||(r=this._perform(e),_(this,_r).set(n,r),setTimeout(()=>{_(this,_r).get(n)===r&&_(this,_r).delete(n)},t)),await r},cl=new WeakSet,fp=async function(e,t,n){Eu(n=0&&t==="latest"&&r.to!=null&&me(i.data,0,4)==="0x556f1830"){const a=i.data,o=await c0(r.to,this);let s;try{s=U1u(me(i.data,4))}catch(E){Eu(!1,E.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:r,info:{data:a}})}Eu(s.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:a,reason:"OffchainLookup",transaction:r,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:s.errorArgs}});const l=await this.ccipReadFetch(r,s.calldata,s.urls);Eu(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:r,info:{data:i.data,errorArgs:s.errorArgs}});const c={to:o,data:Te([s.selector,M1u([l,s.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const E=await yu(this,cl,fp).call(this,c,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},c),result:E}),E}catch(E){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},c),error:E}),E}}throw i}},El=new WeakSet,pp=async function(e){const{value:t}=await a0({network:this.getNetwork(),value:e});return t},$i=new WeakSet,z4=async function(e,t,n){let r=this._getAddress(t),i=this._getBlockTag(n);return(typeof r!="string"||typeof i!="string")&&([r,i]=await Promise.all([r,i])),await yu(this,El,pp).call(this,yu(this,C0,J0).call(this,Object.assign(e,{address:r,blockTag:i})))},dl=new WeakSet,hp=async function(e,t){if(pe(e,32))return await yu(this,C0,J0).call(this,{method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await yu(this,C0,J0).call(this,{method:"getBlock",blockTag:n,includeTransactions:t})},Wi=new WeakSet,M4=async function(e,t){let n=await U1(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await U1({orphan:"drop-log",log:t[0]},this)),_(this,Je).get(n.tag)||null},es=new WeakSet,lE=async function(e){const t=await U1(e,this),n=t.tag;let r=_(this,Je).get(n);return r||(r={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},_(this,Je).set(n,r)),r};function R1u(u,e){try{const t=Cp(u,e);if(t)return gC(t)}catch{}return null}function Cp(u,e){if(u==="0x")return null;try{const t=qu(me(u,e,e+32)),n=qu(me(u,t,t+32));return me(u,t+32,t+32+n)}catch{}return null}function J7(u){const e=L0(u);if(e.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(e,32-e.length),t}function j1u(u){if(u.length%32===0)return u;const e=new Uint8Array(Math.ceil(u.length/32)*32);return e.set(u),e}const z1u=new Uint8Array([]);function M1u(u){const e=[];let t=0;for(let n=0;n=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=me(u,0,32);Eu(me(t,0,12)===me(Y7,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=me(t,12);try{const n=[],r=qu(me(u,32,64)),i=qu(me(u,r,r+32)),a=me(u,r+32);for(let o=0;oe[n]),e}function Pa(u,e){if(u.provider)return u.provider;Eu(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function X7(u,e){let t=g2(e);if(t.to!=null&&(t.to=c0(t.to,u)),t.from!=null){const n=t.from;t.from=Promise.all([u.getAddress(),c0(n,u)]).then(([r,i])=>(Q(r.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),r))}else t.from=u.getAddress();return await a0(t)}class L1u{constructor(e){X(this,"provider");Ou(this,{provider:e||null})}async getNonce(e){return Pa(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await X7(this,e)}async populateTransaction(e){const t=Pa(this,"populateTransaction"),n=await X7(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const r=await this.provider.getNetwork();if(n.chainId!=null){const a=Su(n.chainId);Q(a===r.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=r.chainId;const i=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||i)?Q(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&i&&Q(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const a=await t.getFeeData();Eu(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice)}else{const a=await t.getFeeData();if(n.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const o=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=o,n.maxPriorityFeePerGas=o}else n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(Eu(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice),n.type=0):Eu(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else n.type===2&&(n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await a0(n)}async estimateGas(e){return Pa(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Pa(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Pa(this,"resolveName").resolveName(e)}async sendTransaction(e){const t=Pa(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const r=C2.from(n);return await t.broadcastTransaction(await this.signTransaction(r))}}function $1u(u){return JSON.parse(JSON.stringify(u))}var m0,un,qi,Sr,Hi,ts,fl,mp,pl,gp;class E_{constructor(e){tu(this,fl);tu(this,pl);tu(this,m0,void 0);tu(this,un,void 0);tu(this,qi,void 0);tu(this,Sr,void 0);tu(this,Hi,void 0);tu(this,ts,void 0);R(this,m0,e),R(this,un,null),R(this,qi,yu(this,fl,mp).bind(this)),R(this,Sr,!1),R(this,Hi,null),R(this,ts,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){_(this,Sr)||(R(this,Sr,!0),yu(this,fl,mp).call(this,-2))}stop(){_(this,Sr)&&(R(this,Sr,!1),R(this,ts,!0),yu(this,pl,gp).call(this),_(this,m0).off("block",_(this,qi)))}pause(e){e&&yu(this,pl,gp).call(this),_(this,m0).off("block",_(this,qi))}resume(){this.start()}}m0=new WeakMap,un=new WeakMap,qi=new WeakMap,Sr=new WeakMap,Hi=new WeakMap,ts=new WeakMap,fl=new WeakSet,mp=async function(e){try{_(this,un)==null&&R(this,un,this._subscribe(_(this,m0)));let t=null;try{t=await _(this,un)}catch(i){if(!Et(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(t==null){R(this,un,null),_(this,m0)._recoverSubscriber(this,this._recover(_(this,m0)));return}const n=await _(this,m0).getNetwork();if(_(this,Hi)||R(this,Hi,n),_(this,Hi).chainId!==n.chainId)throw new Error("chaid changed");if(_(this,ts))return;const r=await _(this,m0).send("eth_getFilterChanges",[t]);await this._emitResults(_(this,m0),r)}catch(t){console.log("@TODO",t)}_(this,m0).once("block",_(this,qi))},pl=new WeakSet,gp=function(){const e=_(this,un);e&&(R(this,un,null),e.then(t=>{_(this,m0).send("eth_uninstallFilter",[t])}))};var Gi;class W1u extends E_{constructor(t,n){super(t);tu(this,Gi,void 0);R(this,Gi,$1u(n))}_recover(t){return new _C(t,_(this,Gi))}async _subscribe(t){return await t.send("eth_newFilter",[_(this,Gi)])}async _emitResults(t,n){for(const r of n)t.emit(_(this,Gi),t._wrapLog(r,t._network))}}Gi=new WeakMap;class q1u extends E_{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const n of t)e.emit("pending",n)}}const H1u="bigint,boolean,function,number,string,symbol".split(/,/g);function cE(u){if(u==null||H1u.indexOf(typeof u)>=0||typeof u.getAddress=="function")return u;if(Array.isArray(u))return u.map(cE);if(typeof u=="object")return Object.keys(u).reduce((e,t)=>(e[t]=u[t],e),{});throw new Error(`should not happen: ${u} (${typeof u})`)}function G1u(u){return new Promise(e=>{setTimeout(e,u)})}function Ta(u){return u&&u.toLowerCase()}function Z7(u){return u&&typeof u.pollingInterval=="number"}const K1u={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class $1 extends L1u{constructor(t,n){super(t);X(this,"address");n=Yu(n),Ou(this,{address:n})}connect(t){Eu(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(t){return await this.populateCall(t)}async sendUncheckedTransaction(t){const n=cE(t),r=[];if(n.from){const a=n.from;r.push((async()=>{const o=await c0(a,this.provider);Q(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),n.from=o})())}else n.from=this.address;if(n.gasLimit==null&&r.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){const a=n.to;r.push((async()=>{n.to=await c0(a,this.provider)})())}r.length&&await Promise.all(r);const i=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(t){const n=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(t);return await new Promise((i,a)=>{const o=[1e3,100],s=async()=>{const l=await this.provider.getTransaction(r);if(l!=null){i(l.replaceableTransaction(n));return}this.provider._setTimeout(()=>{s()},o.pop()||4e3)};s()})}async signTransaction(t){const n=cE(t);if(n.from){const i=await c0(n.from,this.provider);Q(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),n.from=i}else n.from=this.address;const r=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[r])}async signMessage(t){const n=typeof t=="string"?Wn(t):t;return await this.provider.send("personal_sign",[ku(n),this.address.toLowerCase()])}async signTypedData(t,n,r){const i=cE(r),a=await m2.resolveNames(t,n,i,async o=>{const s=await c0(o);return Q(s!=null,"TypedData does not support null address","value",o),s});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(m2.getPayload(a.domain,n,a.value))])}async unlock(t){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),t,null])}async _legacySignMessage(t){const n=typeof t=="string"?Wn(t):t;return await this.provider.send("eth_sign",[this.address.toLowerCase(),ku(n)])}}var Ki,ns,Pn,en,kt,Tn,hl,Ap;class Q1u extends N1u{constructor(t,n){super(t,n);tu(this,hl);tu(this,Ki,void 0);tu(this,ns,void 0);tu(this,Pn,void 0);tu(this,en,void 0);tu(this,kt,void 0);tu(this,Tn,void 0);R(this,ns,1),R(this,Ki,Object.assign({},K1u,n||{})),R(this,Pn,[]),R(this,en,null),R(this,Tn,null);{let i=null;const a=new Promise(o=>{i=o});R(this,kt,{promise:a,resolve:i})}const r=this._getOption("staticNetwork");r&&(Q(t==null||r.matches(t),"staticNetwork MUST match network object","options",n),R(this,Tn,r))}_getOption(t){return _(this,Ki)[t]}get _network(){return Eu(_(this,Tn),"network is not available yet","NETWORK_ERROR"),_(this,Tn)}async _perform(t){if(t.method==="call"||t.method==="estimateGas"){let r=t.transaction;if(r&&r.type!=null&&Su(r.type)&&r.maxFeePerGas==null&&r.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(t=Object.assign({},t,{transaction:Object.assign({},r,{type:void 0})}))}}const n=this.getRpcRequest(t);return n!=null?await this.send(n.method,n.args):super._perform(t)}async _detectNetwork(){const t=this._getOption("staticNetwork");if(t)return t;if(this.ready)return Un.from(Su(await this.send("eth_chainId",[])));const n={id:i4(this,ns)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let r;try{r=(await this._send(n))[0]}catch(i){throw this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:r}),"result"in r)return Un.from(Su(r.result));throw this.getRpcError(n,r)}_start(){_(this,kt)==null||_(this,kt).resolve==null||(_(this,kt).resolve(),R(this,kt,null),(async()=>{for(;_(this,Tn)==null&&!this.destroyed;)try{R(this,Tn,await this._detectNetwork())}catch(t){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",be("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:t}})),await G1u(1e3)}yu(this,hl,Ap).call(this)})())}async _waitUntilReady(){if(_(this,kt)!=null)return await _(this,kt).promise}_getSubscriber(t){return t.type==="pending"?new q1u(this):t.type==="event"?this._getOption("polling")?new _C(this,t.filter):new W1u(this,t.filter):t.type==="orphan"&&t.filter.orphan==="drop-log"?new c_("orphan"):super._getSubscriber(t)}get ready(){return _(this,kt)==null}getRpcTransaction(t){const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(r=>{if(t[r]==null)return;let i=r;r==="gasLimit"&&(i="gas"),n[i]=to(Su(t[r],`tx.${r}`))}),["from","to","data"].forEach(r=>{t[r]!=null&&(n[r]=ku(t[r]))}),t.accessList&&(n.accessList=Fa(t.accessList)),n}getRpcRequest(t){switch(t.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ta(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ta(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ta(t.address),t.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ta(t.address),"0x"+t.position.toString(16),t.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[t.signedTransaction]};case"getBlock":if("blockTag"in t)return{method:"eth_getBlockByNumber",args:[t.blockTag,!!t.includeTransactions]};if("blockHash"in t)return{method:"eth_getBlockByHash",args:[t.blockHash,!!t.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[t.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[t.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(t.transaction),t.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(t.transaction)]};case"getLogs":return t.filter&&t.filter.address!=null&&(Array.isArray(t.filter.address)?t.filter.address=t.filter.address.map(Ta):t.filter.address=Ta(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(t,n){const{method:r}=t,{error:i}=n;if(r==="eth_estimateGas"&&i.message){const s=i.message;if(!s.match(/revert/i)&&s.match(/insufficient funds/i))return be("insufficient funds","INSUFFICIENT_FUNDS",{transaction:t.params[0],info:{payload:t,error:i}})}if(r==="eth_call"||r==="eth_estimateGas"){const s=yp(i),l=Y3.getBuiltinCallException(r==="eth_call"?"call":"estimateGas",t.params[0],s?s.data:null);return l.info={error:i,payload:t},l}const a=JSON.stringify(Y1u(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return be("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[r]||"unknown",reason:"rejected",info:{payload:t,error:i}});if(r==="eth_sendRawTransaction"||r==="eth_sendTransaction"){const s=t.params[0];if(a.match(/insufficient funds|base fee exceeds gas limit/i))return be("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:s,info:{error:i}});if(a.match(/nonce/i)&&a.match(/too low/i))return be("nonce has already been used","NONCE_EXPIRED",{transaction:s,info:{error:i}});if(a.match(/replacement transaction/i)&&a.match(/underpriced/i))return be("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:s,info:{error:i}});if(a.match(/only replay-protected/i))return be("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:r,info:{transaction:s,info:{error:i}}})}let o=!!a.match(/the method .* does not exist/i);return o||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(o=!0),o?be("unsupported operation","UNSUPPORTED_OPERATION",{operation:t.method,info:{error:i,payload:t}}):be("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:t})}send(t,n){if(this.destroyed)return Promise.reject(be("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t}));const r=i4(this,ns)._++,i=new Promise((a,o)=>{_(this,Pn).push({resolve:a,reject:o,payload:{method:t,params:n,id:r,jsonrpc:"2.0"}})});return yu(this,hl,Ap).call(this),i}async getSigner(t){t==null&&(t=0);const n=this.send("eth_accounts",[]);if(typeof t=="number"){const i=await n;if(t>=i.length)throw new Error("no such account");return new $1(this,i[t])}const{accounts:r}=await a0({network:this.getNetwork(),accounts:n});t=Yu(t);for(const i of r)if(Yu(i)===t)return new $1(this,t);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new $1(this,n))}destroy(){_(this,en)&&(clearTimeout(_(this,en)),R(this,en,null));for(const{payload:t,reject:n}of _(this,Pn))n(be("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t.method}));R(this,Pn,[]),super.destroy()}}Ki=new WeakMap,ns=new WeakMap,Pn=new WeakMap,en=new WeakMap,kt=new WeakMap,Tn=new WeakMap,hl=new WeakSet,Ap=function(){if(_(this,en))return;const t=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");R(this,en,setTimeout(()=>{R(this,en,null);const n=_(this,Pn);for(R(this,Pn,[]);n.length;){const r=[n.shift()];for(;n.length&&r.length!==_(this,Ki).batchMaxCount;)if(r.push(n.shift()),JSON.stringify(r.map(a=>a.payload)).length>_(this,Ki).batchMaxSize){n.unshift(r.pop());break}(async()=>{const i=r.length===1?r[0].payload:r.map(a=>a.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{const a=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:a});for(const{resolve:o,reject:s,payload:l}of r){if(this.destroyed){s(be("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:l.method}));continue}const c=a.filter(E=>E.id===l.id)[0];if(c==null){const E=be("missing response for request","BAD_DATA",{value:a,info:{payload:l}});this.emit("error",E),s(E);continue}if("error"in c){s(this.getRpcError(l,c));continue}o(c.result)}}catch(a){this.emit("debug",{action:"receiveRpcError",error:a});for(const{reject:o}of r)o(a)}})()}},t))};var Pr;class V1u extends Q1u{constructor(t,n){super(t,n);tu(this,Pr,void 0);R(this,Pr,4e3)}_getSubscriber(t){const n=super._getSubscriber(t);return Z7(n)&&(n.pollingInterval=_(this,Pr)),n}get pollingInterval(){return _(this,Pr)}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");R(this,Pr,t),this._forEachSubscriber(n=>{Z7(n)&&(n.pollingInterval=_(this,Pr))})}}Pr=new WeakMap;var rs;class J1u extends V1u{constructor(t,n,r){t==null&&(t="http://localhost:8545");super(n,r);tu(this,rs,void 0);typeof t=="string"?R(this,rs,new Yn(t)):R(this,rs,t.clone())}_getConnection(){return _(this,rs).clone()}async send(t,n){return await this._start(),await super.send(t,n)}async _send(t){const n=this._getConnection();n.body=JSON.stringify(t),n.setHeader("content-type","application/json");const r=await n.send();r.assertOk();let i=r.bodyJson;return Array.isArray(i)||(i=[i]),i}}rs=new WeakMap;function yp(u){if(u==null)return null;if(typeof u.message=="string"&&u.message.match(/revert/i)&&pe(u.data))return{message:u.message,data:u.data};if(typeof u=="object"){for(const e in u){const t=yp(u[e]);if(t)return t}return null}if(typeof u=="string")try{return yp(JSON.parse(u))}catch{}return null}function Bp(u,e){if(u!=null){if(typeof u.message=="string"&&e.push(u.message),typeof u=="object")for(const t in u)Bp(u[t],e);if(typeof u=="string")try{return Bp(JSON.parse(u),e)}catch{}}}function Y1u(u){const e=[];return Bp(u,e),e}const X1u=Ao,Z1u=async()=>{const u=new J1u("https://goerli.optimism.io",420);return new X1u(Nn[420],rn.abi,u).balanceOf(Nn[420])},u6u=()=>{const{error:u,isLoading:e,data:t}=ZT(["ethers.Contract().balanceOf"],Z1u);return e?Lu.jsx("div",{children:"'loading balance...'"}):u?(console.error(u),Lu.jsx("div",{children:"error loading balance"})):Lu.jsx("div",{children:t==null?void 0:t.toString()})},e6u=()=>{const{address:u}=K0(),{data:e}=f5(),[t,n]=M.useState([]),r=rn.events.Transfer({fromBlock:e&&e-BigInt(1e3),args:{to:u}});return qz({...r,address:Nn[420],listener:i=>{n([...t,i])}}),Lu.jsx("div",{children:Lu.jsx("div",{style:{display:"flex",flexDirection:"column-reverse"},children:t.map((i,a)=>Lu.jsxs("div",{children:[Lu.jsxs("div",{children:["Event ",a]}),Lu.jsx("div",{children:JSON.stringify(i)})]}))})})},t6u=()=>{const{address:u,isConnected:e}=K0(),{data:t}=Oa({...rn.read.balanceOf(u),address:Nn[420],enabled:e}),{data:n}=Oa({...rn.read.totalSupply(),address:Nn[420],enabled:e}),{data:r}=Oa({...rn.read.tokenURI(BigInt(1)),address:Nn[420],enabled:e}),{data:i}=Oa({...rn.read.symbol(),address:Nn[420],enabled:e}),{data:a}=Oa({...rn.read.ownerOf(BigInt(1)),address:Nn[420],enabled:e});return Lu.jsx("div",{children:Lu.jsxs("div",{children:[Lu.jsxs("div",{children:["balanceOf(",u,"): ",t==null?void 0:t.toString()]}),Lu.jsxs("div",{children:["totalSupply(): ",n==null?void 0:n.toString()]}),Lu.jsxs("div",{children:["tokenUri(BigInt(1)): ",r==null?void 0:r.toString()]}),Lu.jsxs("div",{children:["symbol(): ",i==null?void 0:i.toString()]}),Lu.jsxs("div",{children:["ownerOf(BigInt(1)): ",a==null?void 0:a.toString()]})]})})};function n6u(u=1,e=1e9){const t=e-u+1;return Math.floor(Math.random()*t)+u}const r6u=()=>{const{address:u,isConnected:e}=K0(),{data:t,refetch:n}=Oa({...rn.read.balanceOf(u),enabled:e}),{writeAsync:r,data:i}=Vz({address:Nn[420],...rn.write.mint});return rM({hash:i==null?void 0:i.hash,onSuccess:a=>{console.log("minted",a),n()}}),Lu.jsxs("div",{children:[Lu.jsx("div",{children:Lu.jsxs("div",{children:["balance: ",t==null?void 0:t.toString()]})}),Lu.jsx("button",{type:"button",onClick:()=>r(rn.write.mint(BigInt(n6u()))),children:"Mint"})]})};function i6u(){const[u,e]=M.useState("unselected"),{isConnected:t}=K0(),n={unselected:Lu.jsx(Lu.Fragment,{children:"Select which component to render"}),reads:Lu.jsx(t6u,{}),writes:Lu.jsx(r6u,{}),events:Lu.jsx(e6u,{}),ethers:Lu.jsx(u6u,{})};return Lu.jsxs(Lu.Fragment,{children:[Lu.jsx("h1",{children:"Evmts example"}),Lu.jsx(Y5,{}),t&&Lu.jsxs(Lu.Fragment,{children:[Lu.jsx("hr",{}),Lu.jsx("div",{style:{display:"flex"},children:Object.keys(n).map(r=>Lu.jsx("button",{type:"button",onClick:()=>e(r),children:r}))}),Lu.jsx("h2",{children:u}),n[u]]})]})}function a6u({rpc:u}){return function(e){const t=u(e);return!t||t.http===""?null:{chain:{...e,rpcUrls:{...e.rpcUrls,default:{http:[t.http]}}},rpcUrls:{http:[t.http],webSocket:t.webSocket?[t.webSocket]:void 0}}}}const o6u="898f836c53a18d0661340823973f0cb4",{chains:d_,publicClient:s6u,webSocketPublicClient:l6u}=Oj([o5,Bj],[a6u({rpc:u=>{const e={1:{http:"https://mainnet.infura.io/v3/845f07495e374dfabf3a66e3f10ad786"},420:{http:"https://goerli.optimism.io"}};return[1,420].includes(u.id)?e[u.id]:null}})]),{connectors:c6u}=t2u({appName:"My wagmi + RainbowKit App",chains:d_,projectId:o6u}),E6u=u=>Az({autoConnect:!0,connectors:c6u,publicClient:s6u,webSocketPublicClient:l6u,queryClient:u}),uy=new _y,f_=document.getElementById("root");if(!f_)throw new Error("No root element found");Px(f_).render(Lu.jsx(M.StrictMode,{children:Lu.jsx(Uv,{client:uy,children:Lu.jsx(yz,{config:E6u(uy),children:Lu.jsx(Tsu,{chains:d_,children:Lu.jsx(i6u,{})})})})}));export{u9 as $,J6u as A,V6u as B,z6u as C,ufu as D,H6u as E,I6u as F,q6u as G,afu as H,Z6u as I,N6u as J,S6u as K,P6u as L,gt as M,Cr as N,$6u as O,U6u as P,L6u as Q,Hcu as R,aC as S,oC as T,ws as U,k6u as V,gx as W,mfu as X,R6u as Y,Cfu as Z,Ql as _,GN as a,Vn as a$,j6u as a0,_6u as a1,K6u as a2,Q6u as a3,e9 as a4,O6u as a5,sC as a6,Y6u as a7,G6u as a8,X6u as a9,Ex as aA,pcu as aB,tC as aC,hcu as aD,Ccu as aE,gcu as aF,cx as aG,Bcu as aH,Dcu as aI,xcu as aJ,_cu as aK,Pcu as aL,Nlu as aM,dx as aN,zcu as aO,Mcu as aP,Ocu as aQ,jcu as aR,oru as aS,pru as aT,gu as aU,Q2 as aV,f0 as aW,fs as aX,B3 as aY,MO as aZ,id as a_,gfu as aa,rfu as ab,nfu as ac,kEu as ad,pfu as ae,ofu as af,_Eu as ag,tfu as ah,Efu as ai,sfu as aj,dfu as ak,hfu as al,lfu as am,cfu as an,ffu as ao,ifu as ap,AEu as aq,yx as ar,k1 as as,F6u as at,D6u as au,Hu as av,b3u as aw,Ju as ax,ey as ay,v6u as az,KN as b,vl as b0,V4 as b1,cn as b2,QN as c,SF as d,Fp as e,Zi as f,IN as g,Mu as h,It as i,yA as j,vp as k,TN as l,ua as m,Vc as n,efu as o,b6u as p,w6u as q,Kd as r,x6u as s,zt as t,mx as u,S0 as v,Lt as w,T6u as x,M6u as y,W6u as z}; diff --git a/examples/vite/dist/assets/index-93998ae3.js b/examples/vite/dist/assets/index-b524cb51.js similarity index 99% rename from examples/vite/dist/assets/index-93998ae3.js rename to examples/vite/dist/assets/index-b524cb51.js index a7f46b370c..65849053fd 100644 --- a/examples/vite/dist/assets/index-93998ae3.js +++ b/examples/vite/dist/assets/index-b524cb51.js @@ -1 +1 @@ -import{g as Be,a as Qe,b as Ee,c as ae,d as he,l as ue,n as Me}from"./index-9fd9e1d6.js";import"@safe-globalThis/safe-apps-provider";import"@safe-globalThis/safe-apps-sdk";function IA(A){let e=0;function t(){return A[e++]<<8|A[e++]}let l=t(),C=1,o=[0,1];for(let Q=1;Q>--r&1}const I=31,f=2**I,i=f>>>1,d=i>>1,E=f-1;let w=0;for(let Q=0;Q1;){let H=u+T>>>1;Q>>1|s(),a=a<<1^i,M=(M^i)<<1|i|1;O=a,k=1+M-a}let V=l-4;return j.map(Q=>{switch(Q-V){case 3:return V+65792+(A[g++]<<16|A[g++]<<8|A[g++]);case 2:return V+256+(A[g++]<<8|A[g++]);case 1:return V+A[g++];default:return Q-1}})}function DA(A){let e=0;return()=>A[e++]}function eA(A){return DA(IA(pA(A)))}function pA(A){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((C,o)=>e[C.charCodeAt(0)]=o);let t=A.length,l=new Uint8Array(6*t>>3);for(let C=0,o=0,n=0,g=0;C=8&&(l[o++]=g>>(n-=8));return l}function UA(A){return A&1?~A>>1:A>>1}function dA(A,e){let t=Array(A);for(let l=0,C=0;l{let e=h(A);if(e.length)return e})}function CA(A){let e=[];for(;;){let t=A();if(t==0)break;e.push(NA(t,A))}for(;;){let t=A()-1;if(t<0)break;e.push(RA(t,A))}return e.flat()}function m(A){let e=[];for(;;){let t=A(e.length);if(!t)break;e.push(t)}return e}function oA(A,e,t){let l=Array(A).fill().map(()=>[]);for(let C=0;Cl[n].push(o));return l}function NA(A,e){let t=1+e(),l=e(),C=m(e);return oA(C.length,1+A,e).flatMap((n,g)=>{let[r,...c]=n;return Array(C[g]).fill().map((s,I)=>{let f=I*l;return[r+I*t,c.map(i=>i+f)]})})}function RA(A,e){let t=1+e();return oA(t,1+A,e).map(C=>[C[0],C.slice(1)])}function mA(A){let e=[],t=h(A);return C(l([]),[]),e;function l(o){let n=A(),g=m(()=>{let r=h(A).map(c=>t[c]);if(r.length)return l(r)});return{S:n,B:g,Q:o}}function C({S:o,B:n},g,r){if(!(o&4&&r===g[g.length-1])){o&2&&(r=g[g.length-1]),o&1&&e.push(g);for(let c of n)for(let s of c.Q)C(c,[...g,s],r)}}}var B=eA("AEITLAk1DSsBxwKEAQMBOQDpATAAngDUAHsAoABoAM4AagCNAEQAhABMAHIAOwA9ACsANgAmAGIAHgAvACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGAAeABMAFwAXBOcF2QEXE943ygXaALgArkYBbgCsCAPMAK6GNjY2NgE/rgwQ8gAEB0YG6zgFXgVfAD0yOQf2vRgFDc/IABUDz546AswKNgKOqAKG3z+Vb5ACxdICg/kBJuYQAPK0AUgCNJQKRpYA6gDpChwAHtvAzxMSRKQEIn4BBAJAGMQP8hAGMPAMBIhuDSIHNACyAHCY76ychgBiBpoCKgbwACIAQgyaFwKqAspCINYIwjADuBRCAPc0cqoAqIQfAB4ELALeHQEkAMAZ1AUBECBTPgmeCY8lIlZgTOqDSQAaABMAHAAVclsAKAAVAE71HN89+gI5X8qc5jUKFyRfVAJfPfMAGgATABwAFXIgY0CeAMPyACIAQAzMFsKqAgHavwViBekC0KYCxLcCCl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JkPm+A0K8CQNXL6V3apC4ROBTyJSW9oOGNF4YrwoTFyz/pexIkeWQADpi+M7q8gBlmGRUune0k7cXyacdbOsD0Q1JQat9T8nmHhyO8PNd2k4qjZsQCs6lEcmaThpVUzGzWOJQGGf2oz7+F/bMfUMARo1PD0/yIhVDK+8MGRo/uByG5UAwPfNeHAd09gkMFpZmTN2rZgoqdSjwv1SbFnFRAqYuzwW8P4+Rk9fE3PVu80HKcXyIEvPfit+o+pnlHDUKKo32HapcVtQhsNiIdH80j/lRnJ2y5RYRbECyY4vl20j/NiBAD0Z5jxWWiL6xAZIonSEJb1qhwmdRp3hISLL9Q1QYOt6C/OixU3eUtXblgBu+fGPAQE0o");const Z=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),W=4;function LA(A){return A.toString(16).toUpperCase().padStart(2,"0")}function lA(A){return`{${LA(A)}}`}function SA(A){let e=[];for(let t=0,l=A.length;t>24&255}function nA(A){return A&16777215}const FA=new Map(tA(X).flatMap((A,e)=>A.map(t=>[t,e+1<<24]))),OA=new Set(h(X)),gA=new Map,x=new Map;for(let[A,e]of CA(X)){if(!OA.has(A)&&e.length==2){let[t,l]=e,C=x.get(t);C||(C=new Map,x.set(t,C)),C.set(l,A)}gA.set(A,e.reverse())}const L=44032,b=4352,J=4449,G=4519,rA=19,cA=21,p=28,Y=cA*p,kA=rA*Y,VA=L+kA,bA=b+rA,JA=J+cA,GA=G+p;function iA(A){return A>=L&&A=b&&A=J&&eG&&e0&&C(G+c)}else{let n=gA.get(o);n?t.push(...n):C(o)}if(!t.length)break;o=t.pop()}if(l&&e.length>1){let o=N(e[0]);for(let n=1;n0&&C>=n)n==0?(e.push(l,...t),t.length=0,l=g):t.push(g),C=n;else{let r=YA(l,g);r>=0?l=r:C==0&&n==0?(e.push(l),l=g):(t.push(g),C=n)}}return l>=0&&e.push(l,...t),e}function sA(A){return wA(A).map(nA)}function zA(A){return KA(wA(A))}const fA=65039,BA=".",QA=1,v=45;function U(){return new Set(h(B))}const TA=new Map(CA(B)),HA=U(),K=U(),_=new Set(h(B).map(function(A){return this[A]},[...K])),xA=U();U();const XA=tA(B);function $(){return new Set([h(B).map(A=>XA[A]),h(B)].flat(2))}const qA=B(),S=m(A=>{let e=m(B).map(t=>t+96);if(e.length){let t=A>=qA;e[0]-=32,e=D(e),t&&(e=`Restricted[${e}]`);let l=$(),C=$(),o=[...l,...C].sort((g,r)=>g-r),n=!B();return{N:e,P:l,M:n,R:t,V:new Set(o)}}}),AA=U(),P=new Map;[...AA,...U()].sort((A,e)=>A-e).map((A,e,t)=>{let l=B(),C=t[e]=l?t[e-l]:{V:[],M:new Map};C.V.push(A),AA.has(A)||P.set(A,C)});for(let{V:A,M:e}of new Set(P.values())){let t=[];for(let C of A){let o=S.filter(g=>g.V.has(C)),n=t.find(({G:g})=>o.some(r=>g.has(r)));n||(n={G:new Set,V:[]},t.push(n)),n.V.push(C),o.forEach(g=>n.G.add(g))}let l=t.flatMap(({G:C})=>[...C]);for(let{G:C,V:o}of t){let n=new Set(l.filter(g=>!C.has(g)));for(let g of o)e.set(g,n)}}let F=new Set,EA=new Set;for(let A of S)for(let e of A.V)(F.has(e)?EA:F).add(e);for(let A of F)!P.has(A)&&!EA.has(A)&&P.set(A,QA);const yA=new Set([...F,...sA(F)]);class jA extends Array{get is_emoji(){return!0}}const ZA=mA(B).map(A=>jA.from(A)).sort(PA),aA=new Map;for(let A of ZA){let e=[aA];for(let t of A){let l=e.map(C=>{let o=C.get(t);return o||(o=new Map,C.set(t,o)),o});t===fA?e.push(...l):e=l}for(let t of e)t.V=A}function z(A,e=lA){let t=[];$A(A[0])&&t.push("◌");let l=0,C=A.length;for(let o=0;o=4&&A[2]==v&&A[3]==v)throw new Error(`invalid label extension: "${D(A.slice(0,4))}"`)}function vA(A){for(let t=A.lastIndexOf(95);t>0;)if(A[--t]!==95)throw new Error("underscore allowed only at start")}function _A(A){let e=A[0],t=Z.get(e);if(t)throw R(`leading ${t}`);let l=A.length,C=-1;for(let o=1;o{let o=SA(C),n={input:o,offset:l};l+=o.length+1;let g;try{let r=n.tokens=ne(o,e,t),c=r.length,s;if(c)if(g=r.flat(),vA(g),!(n.emoji=c>1||r[0].is_emoji)&&g.every(f=>f<128))WA(g),s="ASCII";else{let f=r.flatMap(i=>i.is_emoji?[]:i);if(!f.length)s="Emoji";else{if(K.has(g[0]))throw R("leading combining mark");for(let E=1;En.has(g)):[...n],!t.length)return}else l.push(C)}if(t){for(let C of t)if(l.every(o=>C.V.has(o)))throw new Error(`whole-script confusable: ${A.N}/${C.N}`)}}function Ce(A){let e=S;for(let t of A){let l=e.filter(C=>C.V.has(t));if(!l.length)throw S.some(C=>C.V.has(t))?MA(e[0],t):uA(t);if(e=l,l.length==1)break}return e}function oe(A){return A.map(({input:e,error:t,output:l})=>{if(t){let C=t.message;throw new Error(A.length==1?C:`Invalid label ${y(z(e))}: ${C}`)}return D(l)}).join(BA)}function uA(A){return new Error(`disallowed character: ${q(A)}`)}function MA(A,e){let t=q(e),l=S.find(C=>C.P.has(e));return l&&(t=`${l.N} ${t}`),new Error(`illegal mixture: ${A.N} + ${t}`)}function R(A){return new Error(`illegal placement: ${A}`)}function le(A,e){let{V:t,M:l}=A;for(let C of e)if(!t.has(C))throw MA(A,C);if(l){let C=sA(e);for(let o=1,n=C.length;oW)throw new Error(`excessive non-spacing marks: ${y(z(C.slice(o-1,g)))} (${g-o}/${W})`);o=g}}}function ne(A,e,t){let l=[],C=[];for(A=A.slice().reverse();A.length;){let o=re(A);if(o)C.length&&(l.push(e(C)),C=[]),l.push(t(o));else{let n=A.pop();if(yA.has(n))C.push(n);else{let g=TA.get(n);if(g)C.push(...g);else if(!HA.has(n))throw uA(n)}}}return C.length&&l.push(e(C)),l}function ge(A){return A.filter(e=>e!=fA)}function re(A,e){let t=aA,l,C=A.length;for(;C&&(t=t.get(A[--C]),!!t);){let{V:o}=t;o&&(l=o,e&&e.push(...A.slice(C).reverse()),A.length=C)}return l}function we(A){return Ae(A)}export{Be as getEnsAddress,Qe as getEnsAvatar,Ee as getEnsName,ae as getEnsResolver,he as getEnsText,ue as labelhash,Me as namehash,we as normalize}; +import{g as Be,a as Qe,b as Ee,c as ae,d as he,l as ue,n as Me}from"./index-8dd5e2d3.js";import"@safe-globalThis/safe-apps-provider";import"@safe-globalThis/safe-apps-sdk";function IA(A){let e=0;function t(){return A[e++]<<8|A[e++]}let l=t(),C=1,o=[0,1];for(let Q=1;Q>--r&1}const I=31,f=2**I,i=f>>>1,d=i>>1,E=f-1;let w=0;for(let Q=0;Q1;){let H=u+T>>>1;Q>>1|s(),a=a<<1^i,M=(M^i)<<1|i|1;O=a,k=1+M-a}let V=l-4;return j.map(Q=>{switch(Q-V){case 3:return V+65792+(A[g++]<<16|A[g++]<<8|A[g++]);case 2:return V+256+(A[g++]<<8|A[g++]);case 1:return V+A[g++];default:return Q-1}})}function DA(A){let e=0;return()=>A[e++]}function eA(A){return DA(IA(pA(A)))}function pA(A){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((C,o)=>e[C.charCodeAt(0)]=o);let t=A.length,l=new Uint8Array(6*t>>3);for(let C=0,o=0,n=0,g=0;C=8&&(l[o++]=g>>(n-=8));return l}function UA(A){return A&1?~A>>1:A>>1}function dA(A,e){let t=Array(A);for(let l=0,C=0;l{let e=h(A);if(e.length)return e})}function CA(A){let e=[];for(;;){let t=A();if(t==0)break;e.push(NA(t,A))}for(;;){let t=A()-1;if(t<0)break;e.push(RA(t,A))}return e.flat()}function m(A){let e=[];for(;;){let t=A(e.length);if(!t)break;e.push(t)}return e}function oA(A,e,t){let l=Array(A).fill().map(()=>[]);for(let C=0;Cl[n].push(o));return l}function NA(A,e){let t=1+e(),l=e(),C=m(e);return oA(C.length,1+A,e).flatMap((n,g)=>{let[r,...c]=n;return Array(C[g]).fill().map((s,I)=>{let f=I*l;return[r+I*t,c.map(i=>i+f)]})})}function RA(A,e){let t=1+e();return oA(t,1+A,e).map(C=>[C[0],C.slice(1)])}function mA(A){let e=[],t=h(A);return C(l([]),[]),e;function l(o){let n=A(),g=m(()=>{let r=h(A).map(c=>t[c]);if(r.length)return l(r)});return{S:n,B:g,Q:o}}function C({S:o,B:n},g,r){if(!(o&4&&r===g[g.length-1])){o&2&&(r=g[g.length-1]),o&1&&e.push(g);for(let c of n)for(let s of c.Q)C(c,[...g,s],r)}}}var B=eA("AEITLAk1DSsBxwKEAQMBOQDpATAAngDUAHsAoABoAM4AagCNAEQAhABMAHIAOwA9ACsANgAmAGIAHgAvACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGAAeABMAFwAXBOcF2QEXE943ygXaALgArkYBbgCsCAPMAK6GNjY2NgE/rgwQ8gAEB0YG6zgFXgVfAD0yOQf2vRgFDc/IABUDz546AswKNgKOqAKG3z+Vb5ACxdICg/kBJuYQAPK0AUgCNJQKRpYA6gDpChwAHtvAzxMSRKQEIn4BBAJAGMQP8hAGMPAMBIhuDSIHNACyAHCY76ychgBiBpoCKgbwACIAQgyaFwKqAspCINYIwjADuBRCAPc0cqoAqIQfAB4ELALeHQEkAMAZ1AUBECBTPgmeCY8lIlZgTOqDSQAaABMAHAAVclsAKAAVAE71HN89+gI5X8qc5jUKFyRfVAJfPfMAGgATABwAFXIgY0CeAMPyACIAQAzMFsKqAgHavwViBekC0KYCxLcCClMjpGwUehp0TPwAwhRuAugAEjQ0kBfQmAKBggETIgDEFG4C6AASNAFPUCyYTBEDLgIFLxDecB60Ad5KAHgyEn4COBYoAy4uwD5yAEDoAfwsAM4O0rwBImqIALgMAAwCAIraUAUi3HIeAKgu2AGoBgYGBgYrNAOiAG4BCiA+9Dd7BB8eALEBzgIoAgDmMhJ6OvpQtzOoLjVPBQAGAS4FYAVftr8FcDtkQhlBWEiee5pmZqH/EhoDzA4s+H4qBKpSAlpaAnwisi4BlqqsPGIDTB4EimgQANgCBrJGNioCBzACQG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/NiBAD0Z5jxWWiL6xAZIonSEJb1qhwmdRp3hISLL9Q1QYOt6C/OixU3eUtXblgBu+fGPAQE0o");const Z=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),W=4;function LA(A){return A.toString(16).toUpperCase().padStart(2,"0")}function lA(A){return`{${LA(A)}}`}function SA(A){let e=[];for(let t=0,l=A.length;t>24&255}function nA(A){return A&16777215}const FA=new Map(tA(X).flatMap((A,e)=>A.map(t=>[t,e+1<<24]))),OA=new Set(h(X)),gA=new Map,x=new Map;for(let[A,e]of CA(X)){if(!OA.has(A)&&e.length==2){let[t,l]=e,C=x.get(t);C||(C=new Map,x.set(t,C)),C.set(l,A)}gA.set(A,e.reverse())}const L=44032,b=4352,J=4449,G=4519,rA=19,cA=21,p=28,Y=cA*p,kA=rA*Y,VA=L+kA,bA=b+rA,JA=J+cA,GA=G+p;function iA(A){return A>=L&&A=b&&A=J&&eG&&e0&&C(G+c)}else{let n=gA.get(o);n?t.push(...n):C(o)}if(!t.length)break;o=t.pop()}if(l&&e.length>1){let o=N(e[0]);for(let n=1;n0&&C>=n)n==0?(e.push(l,...t),t.length=0,l=g):t.push(g),C=n;else{let r=YA(l,g);r>=0?l=r:C==0&&n==0?(e.push(l),l=g):(t.push(g),C=n)}}return l>=0&&e.push(l,...t),e}function sA(A){return wA(A).map(nA)}function zA(A){return KA(wA(A))}const fA=65039,BA=".",QA=1,v=45;function U(){return new Set(h(B))}const TA=new Map(CA(B)),HA=U(),K=U(),_=new Set(h(B).map(function(A){return this[A]},[...K])),xA=U();U();const XA=tA(B);function $(){return new Set([h(B).map(A=>XA[A]),h(B)].flat(2))}const qA=B(),S=m(A=>{let e=m(B).map(t=>t+96);if(e.length){let t=A>=qA;e[0]-=32,e=D(e),t&&(e=`Restricted[${e}]`);let l=$(),C=$(),o=[...l,...C].sort((g,r)=>g-r),n=!B();return{N:e,P:l,M:n,R:t,V:new Set(o)}}}),AA=U(),P=new Map;[...AA,...U()].sort((A,e)=>A-e).map((A,e,t)=>{let l=B(),C=t[e]=l?t[e-l]:{V:[],M:new Map};C.V.push(A),AA.has(A)||P.set(A,C)});for(let{V:A,M:e}of new Set(P.values())){let t=[];for(let C of A){let o=S.filter(g=>g.V.has(C)),n=t.find(({G:g})=>o.some(r=>g.has(r)));n||(n={G:new Set,V:[]},t.push(n)),n.V.push(C),o.forEach(g=>n.G.add(g))}let l=t.flatMap(({G:C})=>[...C]);for(let{G:C,V:o}of t){let n=new Set(l.filter(g=>!C.has(g)));for(let g of o)e.set(g,n)}}let F=new Set,EA=new Set;for(let A of S)for(let e of A.V)(F.has(e)?EA:F).add(e);for(let A of F)!P.has(A)&&!EA.has(A)&&P.set(A,QA);const yA=new Set([...F,...sA(F)]);class jA extends Array{get is_emoji(){return!0}}const ZA=mA(B).map(A=>jA.from(A)).sort(PA),aA=new Map;for(let A of ZA){let e=[aA];for(let t of A){let l=e.map(C=>{let o=C.get(t);return o||(o=new Map,C.set(t,o)),o});t===fA?e.push(...l):e=l}for(let t of e)t.V=A}function z(A,e=lA){let t=[];$A(A[0])&&t.push("◌");let l=0,C=A.length;for(let o=0;o=4&&A[2]==v&&A[3]==v)throw new Error(`invalid label extension: "${D(A.slice(0,4))}"`)}function vA(A){for(let t=A.lastIndexOf(95);t>0;)if(A[--t]!==95)throw new Error("underscore allowed only at start")}function _A(A){let e=A[0],t=Z.get(e);if(t)throw R(`leading ${t}`);let l=A.length,C=-1;for(let o=1;o{let o=SA(C),n={input:o,offset:l};l+=o.length+1;let g;try{let r=n.tokens=ne(o,e,t),c=r.length,s;if(c)if(g=r.flat(),vA(g),!(n.emoji=c>1||r[0].is_emoji)&&g.every(f=>f<128))WA(g),s="ASCII";else{let f=r.flatMap(i=>i.is_emoji?[]:i);if(!f.length)s="Emoji";else{if(K.has(g[0]))throw R("leading combining mark");for(let E=1;En.has(g)):[...n],!t.length)return}else l.push(C)}if(t){for(let C of t)if(l.every(o=>C.V.has(o)))throw new Error(`whole-script confusable: ${A.N}/${C.N}`)}}function Ce(A){let e=S;for(let t of A){let l=e.filter(C=>C.V.has(t));if(!l.length)throw S.some(C=>C.V.has(t))?MA(e[0],t):uA(t);if(e=l,l.length==1)break}return e}function oe(A){return A.map(({input:e,error:t,output:l})=>{if(t){let C=t.message;throw new Error(A.length==1?C:`Invalid label ${y(z(e))}: ${C}`)}return D(l)}).join(BA)}function uA(A){return new Error(`disallowed character: ${q(A)}`)}function MA(A,e){let t=q(e),l=S.find(C=>C.P.has(e));return l&&(t=`${l.N} ${t}`),new Error(`illegal mixture: ${A.N} + ${t}`)}function R(A){return new Error(`illegal placement: ${A}`)}function le(A,e){let{V:t,M:l}=A;for(let C of e)if(!t.has(C))throw MA(A,C);if(l){let C=sA(e);for(let o=1,n=C.length;oW)throw new Error(`excessive non-spacing marks: ${y(z(C.slice(o-1,g)))} (${g-o}/${W})`);o=g}}}function ne(A,e,t){let l=[],C=[];for(A=A.slice().reverse();A.length;){let o=re(A);if(o)C.length&&(l.push(e(C)),C=[]),l.push(t(o));else{let n=A.pop();if(yA.has(n))C.push(n);else{let g=TA.get(n);if(g)C.push(...g);else if(!HA.has(n))throw uA(n)}}}return C.length&&l.push(e(C)),l}function ge(A){return A.filter(e=>e!=fA)}function re(A,e){let t=aA,l,C=A.length;for(;C&&(t=t.get(A[--C]),!!t);){let{V:o}=t;o&&(l=o,e&&e.push(...A.slice(C).reverse()),A.length=C)}return l}function we(A){return Ae(A)}export{Be as getEnsAddress,Qe as getEnsAvatar,Ee as getEnsName,ae as getEnsResolver,he as getEnsText,ue as labelhash,Me as namehash,we as normalize}; diff --git a/examples/vite/dist/assets/index.es-cccc293a.js b/examples/vite/dist/assets/index.es-866852ed.js similarity index 99% rename from examples/vite/dist/assets/index.es-cccc293a.js rename to examples/vite/dist/assets/index.es-866852ed.js index 0a81982b0b..c6bbdb9f38 100644 --- a/examples/vite/dist/assets/index.es-cccc293a.js +++ b/examples/vite/dist/assets/index.es-866852ed.js @@ -1,4 +1,4 @@ -import{e as fa,f as re,h as t1,w as Dl,r as ql,i as bc,t as pa,j as r1,k as i1,m as yi,D as n1,o as s1,N as X,p as a1,q as sc,s as o1,V as c1,R as u1,F as $h,K as h1,x as l1,L as f1,u as Fh,$ as p1,v as d1,y as Bn,Z as Dh,J as g1,X as y1,_ as jl,z as Rr,A as v1,B as _1,C as an,E as $t,U as er,G as gi,H as cr,I as m1,M as on,O as Ll,P as w1,Q as b1,S as E1,T as Ml,W as x1,Y as zl,a0 as Ul,a1 as un,a2 as ac,a3 as aa,a4 as hn,a5 as I1,a6 as oa,a7 as S1,a8 as P1,a9 as O1,aa as ra,ab as C1,ac as A1,ad as Ho,ae as qh,af as T1,ag as R1,ah as N1,ai as jh,aj as $1,ak as F1,al as D1,am as q1,an as j1,ao as L1,ap as M1,aq as kn,ar as kl,as as Ko,at as z1,au as U1,av as k1}from"./index-9fd9e1d6.js";import{e as Ur,E as Ec}from"./events-db1d9fc4.js";import{s as xc,i as Lh,c as H1,a as K1,b as Hl,f as Ic,p as V1,J as _i,d as Sc,e as Pc,g as Oc,h as di,j as ri,k as Vn,l as B1,m as G1,H as qi}from"./http-d435a746.js";import"@safe-globalThis/safe-apps-provider";import"@safe-globalThis/safe-apps-sdk";var da={};/*! ***************************************************************************** +import{e as fa,f as re,h as t1,w as Dl,r as ql,i as bc,t as pa,j as r1,k as i1,m as yi,D as n1,o as s1,N as X,p as a1,q as sc,s as o1,V as c1,R as u1,F as $h,K as h1,x as l1,L as f1,u as Fh,$ as p1,v as d1,y as Bn,Z as Dh,J as g1,X as y1,_ as jl,z as Rr,A as v1,B as _1,C as an,E as $t,U as er,G as gi,H as cr,I as m1,M as on,O as Ll,P as w1,Q as b1,S as E1,T as Ml,W as x1,Y as zl,a0 as Ul,a1 as un,a2 as ac,a3 as aa,a4 as hn,a5 as I1,a6 as oa,a7 as S1,a8 as P1,a9 as O1,aa as ra,ab as C1,ac as A1,ad as Ho,ae as qh,af as T1,ag as R1,ah as N1,ai as jh,aj as $1,ak as F1,al as D1,am as q1,an as j1,ao as L1,ap as M1,aq as kn,ar as kl,as as Ko,at as z1,au as U1,av as k1}from"./index-8dd5e2d3.js";import{e as Ur,E as Ec}from"./events-699377c5.js";import{s as xc,i as Lh,c as H1,a as K1,b as Hl,f as Ic,p as V1,J as _i,d as Sc,e as Pc,g as Oc,h as di,j as ri,k as Vn,l as B1,m as G1,H as qi}from"./http-8ae254e4.js";import"@safe-globalThis/safe-apps-provider";import"@safe-globalThis/safe-apps-sdk";var da={};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -63,4 +63,4 @@ __p += '`),Oe&&(M+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+M+`return __p -}`;var _e=Th(function(){return Fe(d,ee+"return "+M).apply(t,_)});if(_e.source=M,No(_e))throw _e;return _e}function cv(e){return qe(e).toLowerCase()}function uv(e){return qe(e).toUpperCase()}function hv(e,r,s){if(e=qe(e),e&&(s||r===t))return Mc(e);if(!e||!(r=lr(r)))return e;var u=Or(e),l=Or(r),d=zc(u,l),_=Uc(u,l)+1;return fi(u,d,_).join("")}function lv(e,r,s){if(e=qe(e),e&&(s||r===t))return e.slice(0,Hc(e)+1);if(!e||!(r=lr(r)))return e;var u=Or(e),l=Uc(u,Or(r))+1;return fi(u,0,l).join("")}function fv(e,r,s){if(e=qe(e),e&&(s||r===t))return e.replace(dt,"");if(!e||!(r=lr(r)))return e;var u=Or(e),l=zc(u,Or(r));return fi(u,l).join("")}function pv(e,r){var s=te,u=Ee;if(ot(r)){var l="separator"in r?r.separator:l;s="length"in r?ye(r.length):s,u="omission"in r?lr(r.omission):u}e=qe(e);var d=e.length;if(Gi(e)){var _=Or(e);d=_.length}if(s>=d)return e;var w=s-Wi(u);if(w<1)return u;var I=_?fi(_,0,w).join(""):e.slice(0,w);if(l===t)return I+u;if(_&&(w+=I.length-w),$o(l)){if(e.slice(w).search(l)){var F,D=I;for(l.global||(l=Wa(l.source,qe(gr.exec(l))+"g")),l.lastIndex=0;F=l.exec(D);)var M=F.index;I=I.slice(0,M===t?w:M)}}else if(e.indexOf(lr(l),w)!=w){var G=I.lastIndexOf(l);G>-1&&(I=I.slice(0,G))}return I+u}function dv(e){return e=qe(e),e&&ht.test(e)?e.replace(ii,Hf):e}var gv=tn(function(e,r,s){return e+(s?" ":"")+r.toUpperCase()}),qo=Ru("toUpperCase");function Ah(e,r,s){return e=qe(e),r=s?t:r,r===t?Lf(e)?Bf(e):Af(e):e.match(r)||[]}var Th=we(function(e,r){try{return Lt(e,t,r)}catch(s){return No(s)?s:new ce(s)}}),yv=Jr(function(e,r){return vr(r,function(s){s=Lr(s),Gr(e,s,To(e[s],e))}),e});function vv(e){var r=e==null?0:e.length,s=ie();return e=r?it(e,function(u){if(typeof u[1]!="function")throw new _r(f);return[s(u[0]),u[1]]}):[],we(function(u){for(var l=-1;++lJ)return[];var s=B,u=Kt(e,B);r=ie(r),e-=B;for(var l=Va(u,r);++s0||r<0)?new Se(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),r!==t&&(r=ye(r),s=r<0?s.dropRight(-r):s.take(r-e)),s)},Se.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Se.prototype.toArray=function(){return this.take(B)},qr(Se.prototype,function(e,r){var s=/^(?:filter|find|map|reject)|While$/.test(r),u=/^(?:head|last)$/.test(r),l=p[u?"take"+(r=="last"?"Right":""):r],d=u||/^find/.test(r);l&&(p.prototype[r]=function(){var _=this.__wrapped__,w=u?[1]:arguments,I=_ instanceof Se,F=w[0],D=I||fe(_),M=function(xe){var Oe=l.apply(p,ai([xe],w));return u&&G?Oe[0]:Oe};D&&s&&typeof F=="function"&&F.length!=1&&(I=D=!1);var G=this.__chain__,ee=!!this.__actions__.length,ne=d&&!G,_e=I&&!ee;if(!d&&D){_=_e?_:new Se(this);var se=e.apply(_,w);return se.__actions__.push({func:Ws,args:[M],thisArg:t}),new mr(se,G)}return ne&&_e?e.apply(this,w):(se=this.thru(M),ne?u?se.value()[0]:se.value():se)})}),vr(["pop","push","shift","sort","splice","unshift"],function(e){var r=ws[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",u=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var l=arguments;if(u&&!this.__chain__){var d=this.value();return r.apply(fe(d)?d:[],l)}return this[s](function(_){return r.apply(fe(_)?_:[],l)})}}),qr(Se.prototype,function(e,r){var s=p[r];if(s){var u=s.name+"";Le.call(Xi,u)||(Xi[u]=[]),Xi[u].push({name:r,func:s})}}),Xi[Us(t,be).name]=[{name:"wrapper",func:t}],Se.prototype.clone=dp,Se.prototype.reverse=gp,Se.prototype.value=yp,p.prototype.at=Vg,p.prototype.chain=Bg,p.prototype.commit=Gg,p.prototype.next=Wg,p.prototype.plant=Qg,p.prototype.reverse=Yg,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Xg,p.prototype.first=p.prototype.head,_n&&(p.prototype[_n]=Jg),p},Ji=Gf();mt?((mt.exports=Ji)._=Ji,Be._=Ji):Pe._=Ji}).call(Un)})(_c,_c.exports);var ME=Object.defineProperty,zE=Object.defineProperties,UE=Object.getOwnPropertyDescriptors,Ol=Object.getOwnPropertySymbols,kE=Object.prototype.hasOwnProperty,HE=Object.prototype.propertyIsEnumerable,Cl=(o,i,t)=>i in o?ME(o,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[i]=t,na=(o,i)=>{for(var t in i||(i={}))kE.call(i,t)&&Cl(o,t,i[t]);if(Ol)for(var t of Ol(i))HE.call(i,t)&&Cl(o,t,i[t]);return o},KE=(o,i)=>zE(o,UE(i));function fn(o,i,t){var n;const a=z1(o);return((n=i.rpcMap)==null?void 0:n[a.reference])||`${LE}?chainId=${a.namespace}:${a.reference}&projectId=${t}`}function Li(o){return o.includes(":")?o.split(":")[1]:o}function Ef(o){return o.map(i=>`${i.split(":")[0]}:${i.split(":")[1]}`)}function VE(o,i){const t=Object.keys(i.namespaces).filter(a=>a.includes(o));if(!t.length)return[];const n=[];return t.forEach(a=>{const c=i.namespaces[a].accounts;n.push(...c)}),n}function BE(o={},i={}){const t=Al(o),n=Al(i);return _c.exports.merge(t,n)}function Al(o){var i,t,n,a;const c={};if(!oa(o))return c;for(const[f,g]of Object.entries(o)){const m=kl(f)?[f]:g.chains,v=g.methods||[],P=g.events||[],L=g.rpcMap||{},T=kn(f);c[T]=KE(na(na({},c[T]),g),{chains:Ko(m,(i=c[T])==null?void 0:i.chains),methods:Ko(v,(t=c[T])==null?void 0:t.methods),events:Ko(P,(n=c[T])==null?void 0:n.events),rpcMap:na(na({},L),(a=c[T])==null?void 0:a.rpcMap)})}return c}function GE(o){return o.includes(":")?o.split(":")[2]:o}function WE(o){const i={};for(const[t,n]of Object.entries(o)){const a=n.methods||[],c=n.events||[],f=n.accounts||[],g=kl(t)?[t]:n.chains?n.chains:Ef(n.accounts);i[t]={chains:g,methods:a,events:c,accounts:f}}return i}function tc(o){return typeof o=="number"?o:o.includes("0x")?parseInt(o,16):o.includes(":")?Number(o.split(":")[1]):Number(o)}const xf={},Et=o=>xf[o],rc=(o,i)=>{xf[o]=i};class JE{constructor(i){this.name="polkadot",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getAccounts(){const i=this.namespace.accounts;return i?i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=Li(t);i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||fn(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}class QE{constructor(i){this.name="eip155",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(i){switch(i.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(i);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(i.request.method)?await this.client.request(i):this.getHttpProvider().request(i.request)}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(parseInt(i),t),this.chainId=parseInt(i),this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}createHttpProvider(i,t){const n=t||fn(`${this.name}:${i}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=parseInt(Li(t));i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const i=this.chainId,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}async handleSwitchChain(i){var t,n;let a=i.request.params?(t=i.request.params[0])==null?void 0:t.chainId:"0x0";a=a.startsWith("0x")?a:`0x${a}`;const c=parseInt(a,16);if(this.isChainApproved(c))this.setDefaultChain(`${c}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:i.topic,request:{method:i.request.method,params:[{chainId:a}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${c}`);else throw new Error(`Failed to switch to chain 'eip155:${c}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(i){return this.namespace.chains.includes(`${this.name}:${i}`)}}class YE{constructor(i){this.name="solana",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=Li(t);i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||fn(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}class XE{constructor(i){this.name="cosmos",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=Li(t);i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||fn(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}class ZE{constructor(i){this.name="cip34",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{const n=this.getCardanoRPCUrl(t),a=Li(t);i[a]=this.createHttpProvider(a,n)}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}getCardanoRPCUrl(i){const t=this.namespace.rpcMap;if(t)return t[i]}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||this.getCardanoRPCUrl(i);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}class ex{constructor(i){this.name="elrond",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=Li(t);i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||fn(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}class tx{constructor(i){this.name="multiversx",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=Li(t);i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||fn(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}var rx=Object.defineProperty,ix=Object.defineProperties,nx=Object.getOwnPropertyDescriptors,Tl=Object.getOwnPropertySymbols,sx=Object.prototype.hasOwnProperty,ax=Object.prototype.propertyIsEnumerable,Rl=(o,i,t)=>i in o?rx(o,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[i]=t,sa=(o,i)=>{for(var t in i||(i={}))sx.call(i,t)&&Rl(o,t,i[t]);if(Tl)for(var t of Tl(i))ax.call(i,t)&&Rl(o,t,i[t]);return o},ic=(o,i)=>ix(o,nx(i));class Nc{constructor(i){this.events=new Ec,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=i,this.logger=typeof(i==null?void 0:i.logger)<"u"&&typeof(i==null?void 0:i.logger)!="string"?i.logger:Ce.pino(Ce.getDefaultLoggerOptions({level:(i==null?void 0:i.logger)||Sl})),this.disableProviderPing=(i==null?void 0:i.disableProviderPing)||!1}static async init(i){const t=new Nc(i);return await t.initialize(),t}async request(i,t){const[n,a]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:sa({},i),chainId:`${n}:${a}`,topic:this.session.topic})}sendAsync(i,t,n){this.request(i,n).then(a=>t(null,a)).catch(a=>t(a,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var i;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(i=this.session)==null?void 0:i.topic,reason:er("USER_DISCONNECTED")}),await this.cleanup()}async connect(i){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(i),await this.cleanupPendingPairings(),!i.skipPairing)return await this.pair(i.pairingTopic)}on(i,t){this.events.on(i,t)}once(i,t){this.events.once(i,t)}removeListener(i,t){this.events.removeListener(i,t)}off(i,t){this.events.off(i,t)}get isWalletConnect(){return!0}async pair(i){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:a}=await this.client.connect({pairingTopic:i,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await a().then(c=>{this.session=c,this.namespaces||(this.namespaces=WE(c.namespaces),this.persist("namespaces",this.namespaces))}).catch(c=>{if(c.message!==wf)throw c;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(i,t){try{if(!this.session)return;const[n,a]=this.validateChain(i);this.getProvider(n).setDefaultChain(a,t)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(i={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(hn(t)){for(const n of t)i.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const i=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[i]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await FE.init({logger:this.providerOpts.logger||Sl,relayUrl:this.providerOpts.relayUrl||DE,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const i=[...new Set(Object.keys(this.session.namespaces).map(t=>kn(t)))];rc("client",this.client),rc("events",this.events),rc("disableProviderPing",this.disableProviderPing),i.forEach(t=>{if(!this.session)return;const n=VE(t,this.session),a=Ef(n),c=BE(this.namespaces,this.optionalNamespaces),f=ic(sa({},c[t]),{accounts:n,chains:a});switch(t){case"eip155":this.rpcProviders[t]=new QE({namespace:f});break;case"solana":this.rpcProviders[t]=new YE({namespace:f});break;case"cosmos":this.rpcProviders[t]=new XE({namespace:f});break;case"polkadot":this.rpcProviders[t]=new JE({namespace:f});break;case"cip34":this.rpcProviders[t]=new ZE({namespace:f});break;case"elrond":this.rpcProviders[t]=new ex({namespace:f});break;case"multiversx":this.rpcProviders[t]=new tx({namespace:f});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",i=>{this.events.emit("session_ping",i)}),this.client.on("session_event",i=>{const{params:t}=i,{event:n}=t;if(n.name==="accountsChanged"){const a=n.data;a&&hn(a)&&this.events.emit("accountsChanged",a.map(GE))}else if(n.name==="chainChanged"){const a=t.chainId,c=t.event.data,f=kn(a),g=tc(a)!==tc(c)?`${f}:${tc(c)}`:a;this.onChainChanged(g)}else this.events.emit(n.name,n.data);this.events.emit("session_event",i)}),this.client.on("session_update",({topic:i,params:t})=>{var n;const{namespaces:a}=t,c=(n=this.client)==null?void 0:n.session.get(i);this.session=ic(sa({},c),{namespaces:a}),this.onSessionUpdate(),this.events.emit("session_update",{topic:i,params:t})}),this.client.on("session_delete",async i=>{await this.cleanup(),this.events.emit("session_delete",i),this.events.emit("disconnect",ic(sa({},er("USER_DISCONNECTED")),{data:i.topic}))}),this.on(mi.DEFAULT_CHAIN_CHANGED,i=>{this.onChainChanged(i,!0)})}getProvider(i){if(!this.rpcProviders[i])throw new Error(`Provider not found: ${i}`);return this.rpcProviders[i]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(i=>{var t;this.getProvider(i).updateNamespace((t=this.session)==null?void 0:t.namespaces[i])})}setNamespaces(i){const{namespaces:t,optionalNamespaces:n,sessionProperties:a}=i;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=a,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(i){const[t,n]=(i==null?void 0:i.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map(f=>kn(f)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const a=kn(Object.keys(this.namespaces)[0]),c=this.rpcProviders[a].getDefaultChain();return[a,c]}async requestAccounts(){const[i]=this.validateChain();return await this.getProvider(i).requestAccounts()}onChainChanged(i,t=!1){var n;if(!this.namespaces)return;const[a,c]=this.validateChain(i);t||this.getProvider(a).setDefaultChain(c),((n=this.namespaces[a])!=null?n:this.namespaces[`${a}:${c}`]).defaultChain=c,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",c)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(i,t){this.client.core.storage.setItem(`${Pl}/${i}`,t)}async getFromStore(i){return await this.client.core.storage.getItem(`${Pl}/${i}`)}}const ox=Nc,cx="wc",ux="ethereum_provider",hx=`${cx}@2:${ux}:`,lx="https://rpc.walletconnect.com/v1/",mc=["eth_sendTransaction","personal_sign"],fx=["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"],wc=["chainChanged","accountsChanged"],px=["chainChanged","accountsChanged","message","disconnect","connect"];var dx=Object.defineProperty,gx=Object.defineProperties,yx=Object.getOwnPropertyDescriptors,Nl=Object.getOwnPropertySymbols,vx=Object.prototype.hasOwnProperty,_x=Object.prototype.propertyIsEnumerable,$l=(o,i,t)=>i in o?dx(o,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[i]=t,Kn=(o,i)=>{for(var t in i||(i={}))vx.call(i,t)&&$l(o,t,i[t]);if(Nl)for(var t of Nl(i))_x.call(i,t)&&$l(o,t,i[t]);return o},Fl=(o,i)=>gx(o,yx(i));function la(o){return Number(o[0].split(":")[1])}function nc(o){return`0x${o.toString(16)}`}function mx(o){const{chains:i,optionalChains:t,methods:n,optionalMethods:a,events:c,optionalEvents:f,rpcMap:g}=o;if(!hn(i))throw new Error("Invalid chains");const m={chains:i,methods:n||mc,events:c||wc,rpcMap:Kn({},i.length?{[la(i)]:g[la(i)]}:{})},v=c==null?void 0:c.filter(U=>!wc.includes(U)),P=n==null?void 0:n.filter(U=>!mc.includes(U));if(!t&&!f&&!a&&!(v!=null&&v.length)&&!(P!=null&&P.length))return{required:i.length?m:void 0};const L=(v==null?void 0:v.length)&&(P==null?void 0:P.length)||!t,T={chains:[...new Set(L?m.chains.concat(t||[]):t)],methods:[...new Set(m.methods.concat(a!=null&&a.length?a:fx))],events:[...new Set(m.events.concat(f!=null&&f.length?f:px))],rpcMap:g};return{required:i.length?m:void 0,optional:t.length?T:void 0}}class $c{constructor(){this.events=new Ur.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=hx,this.on=(i,t)=>(this.events.on(i,t),this),this.once=(i,t)=>(this.events.once(i,t),this),this.removeListener=(i,t)=>(this.events.removeListener(i,t),this),this.off=(i,t)=>(this.events.off(i,t),this),this.parseAccount=i=>this.isCompatibleChainId(i)?this.parseAccountId(i).address:i,this.signer={},this.rpc={}}static async init(i){const t=new $c;return await t.initialize(i),t}async request(i){return await this.signer.request(i,this.formatChainId(this.chainId))}sendAsync(i,t){this.signer.sendAsync(i,t,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(i){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(i);const{required:t,optional:n}=mx(this.rpc);try{const a=await new Promise(async(f,g)=>{var m;this.rpc.showQrModal&&((m=this.modal)==null||m.subscribeModal(v=>{!v.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),g(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Fl(Kn({namespaces:Kn({},t&&{[this.namespace]:t})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:i==null?void 0:i.pairingTopic})).then(v=>{f(v)}).catch(v=>{g(new Error(v.message))})});if(!a)return;const c=U1(a.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:c),this.setAccounts(c),this.events.emit("connect",{chainId:nc(this.chainId)})}catch(a){throw this.signer.logger.error(a),a}finally{this.modal&&this.modal.closeModal()}}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",i=>{const{params:t}=i,{event:n}=t;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",i)}),this.signer.on("chainChanged",i=>{const t=parseInt(i);this.chainId=t,this.events.emit("chainChanged",nc(this.chainId)),this.persist()}),this.signer.on("session_update",i=>{this.events.emit("session_update",i)}),this.signer.on("session_delete",i=>{this.reset(),this.events.emit("session_delete",i),this.events.emit("disconnect",Fl(Kn({},er("USER_DISCONNECTED")),{data:i.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",i=>{var t,n;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(n=this.modal)==null||n.openModal({uri:i})),this.events.emit("display_uri",i)})}switchEthereumChain(i){this.request({method:"wallet_switchEthereumChain",params:[{chainId:i.toString(16)}]})}isCompatibleChainId(i){return typeof i=="string"?i.startsWith(`${this.namespace}:`):!1}formatChainId(i){return`${this.namespace}:${i}`}parseChainId(i){return Number(i.split(":")[1])}setChainIds(i){const t=i.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",nc(this.chainId)),this.persist())}setChainId(i){if(this.isCompatibleChainId(i)){const t=this.parseChainId(i);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(i){const[t,n,a]=i.split(":");return{chainId:`${t}:${n}`,address:a}}setAccounts(i){this.accounts=i.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(i){var t,n;const a=(t=i==null?void 0:i.chains)!=null?t:[],c=(n=i==null?void 0:i.optionalChains)!=null?n:[],f=a.concat(c);if(!f.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const g=a.length?(i==null?void 0:i.methods)||mc:[],m=a.length?(i==null?void 0:i.events)||wc:[],v=(i==null?void 0:i.optionalMethods)||[],P=(i==null?void 0:i.optionalEvents)||[],L=(i==null?void 0:i.rpcMap)||this.buildRpcMap(f,i.projectId),T=(i==null?void 0:i.qrModalOptions)||void 0;return{chains:a==null?void 0:a.map(U=>this.formatChainId(U)),optionalChains:c.map(U=>this.formatChainId(U)),methods:g,events:m,optionalMethods:v,optionalEvents:P,rpcMap:L,showQrModal:!!(i!=null&&i.showQrModal),qrModalOptions:T,projectId:i.projectId,metadata:i.metadata}}buildRpcMap(i,t){const n={};return i.forEach(a=>{n[a]=this.getRpcUrl(a,t)}),n}async initialize(i){if(this.rpc=this.getRpcConfig(i),this.chainId=this.rpc.chains.length?la(this.rpc.chains):la(this.rpc.optionalChains),this.signer=await ox.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:i.disableProviderPing,relayUrl:i.relayUrl,storageOptions:i.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:n}=await k1(()=>import("./index-926756d6.js").then(a=>a.i),["assets/index-926756d6.js","assets/index-9fd9e1d6.js","assets/index-882a2daf.css"]);t=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Kn({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(i){if(!i)return;const{chains:t,optionalChains:n,rpcMap:a}=i;t&&hn(t)&&(this.rpc.chains=t.map(c=>this.formatChainId(c)),t.forEach(c=>{this.rpc.rpcMap[c]=(a==null?void 0:a[c])||this.getRpcUrl(c)})),n&&hn(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(c=>this.formatChainId(c)),n.forEach(c=>{this.rpc.rpcMap[c]=(a==null?void 0:a[c])||this.getRpcUrl(c)}))}getRpcUrl(i,t){var n;return((n=this.rpc.rpcMap)==null?void 0:n[i])||`${lx}?chainId=eip155:${i}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const i=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${i}`]?this.session.namespaces[`${this.namespace}:${i}`]:this.session.namespaces[this.namespace];this.setChainIds(i?[this.formatChainId(i)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(i){return typeof i=="string"||i instanceof String?[this.parseAccount(i)]:i.map(t=>this.parseAccount(t))}}const Nx=$c;export{Nx as EthereumProvider,px as OPTIONAL_EVENTS,fx as OPTIONAL_METHODS,wc as REQUIRED_EVENTS,mc as REQUIRED_METHODS,$c as default}; +}`;var _e=Th(function(){return Fe(d,ee+"return "+M).apply(t,_)});if(_e.source=M,No(_e))throw _e;return _e}function cv(e){return qe(e).toLowerCase()}function uv(e){return qe(e).toUpperCase()}function hv(e,r,s){if(e=qe(e),e&&(s||r===t))return Mc(e);if(!e||!(r=lr(r)))return e;var u=Or(e),l=Or(r),d=zc(u,l),_=Uc(u,l)+1;return fi(u,d,_).join("")}function lv(e,r,s){if(e=qe(e),e&&(s||r===t))return e.slice(0,Hc(e)+1);if(!e||!(r=lr(r)))return e;var u=Or(e),l=Uc(u,Or(r))+1;return fi(u,0,l).join("")}function fv(e,r,s){if(e=qe(e),e&&(s||r===t))return e.replace(dt,"");if(!e||!(r=lr(r)))return e;var u=Or(e),l=zc(u,Or(r));return fi(u,l).join("")}function pv(e,r){var s=te,u=Ee;if(ot(r)){var l="separator"in r?r.separator:l;s="length"in r?ye(r.length):s,u="omission"in r?lr(r.omission):u}e=qe(e);var d=e.length;if(Gi(e)){var _=Or(e);d=_.length}if(s>=d)return e;var w=s-Wi(u);if(w<1)return u;var I=_?fi(_,0,w).join(""):e.slice(0,w);if(l===t)return I+u;if(_&&(w+=I.length-w),$o(l)){if(e.slice(w).search(l)){var F,D=I;for(l.global||(l=Wa(l.source,qe(gr.exec(l))+"g")),l.lastIndex=0;F=l.exec(D);)var M=F.index;I=I.slice(0,M===t?w:M)}}else if(e.indexOf(lr(l),w)!=w){var G=I.lastIndexOf(l);G>-1&&(I=I.slice(0,G))}return I+u}function dv(e){return e=qe(e),e&&ht.test(e)?e.replace(ii,Hf):e}var gv=tn(function(e,r,s){return e+(s?" ":"")+r.toUpperCase()}),qo=Ru("toUpperCase");function Ah(e,r,s){return e=qe(e),r=s?t:r,r===t?Lf(e)?Bf(e):Af(e):e.match(r)||[]}var Th=we(function(e,r){try{return Lt(e,t,r)}catch(s){return No(s)?s:new ce(s)}}),yv=Jr(function(e,r){return vr(r,function(s){s=Lr(s),Gr(e,s,To(e[s],e))}),e});function vv(e){var r=e==null?0:e.length,s=ie();return e=r?it(e,function(u){if(typeof u[1]!="function")throw new _r(f);return[s(u[0]),u[1]]}):[],we(function(u){for(var l=-1;++lJ)return[];var s=B,u=Kt(e,B);r=ie(r),e-=B;for(var l=Va(u,r);++s0||r<0)?new Se(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),r!==t&&(r=ye(r),s=r<0?s.dropRight(-r):s.take(r-e)),s)},Se.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Se.prototype.toArray=function(){return this.take(B)},qr(Se.prototype,function(e,r){var s=/^(?:filter|find|map|reject)|While$/.test(r),u=/^(?:head|last)$/.test(r),l=p[u?"take"+(r=="last"?"Right":""):r],d=u||/^find/.test(r);l&&(p.prototype[r]=function(){var _=this.__wrapped__,w=u?[1]:arguments,I=_ instanceof Se,F=w[0],D=I||fe(_),M=function(xe){var Oe=l.apply(p,ai([xe],w));return u&&G?Oe[0]:Oe};D&&s&&typeof F=="function"&&F.length!=1&&(I=D=!1);var G=this.__chain__,ee=!!this.__actions__.length,ne=d&&!G,_e=I&&!ee;if(!d&&D){_=_e?_:new Se(this);var se=e.apply(_,w);return se.__actions__.push({func:Ws,args:[M],thisArg:t}),new mr(se,G)}return ne&&_e?e.apply(this,w):(se=this.thru(M),ne?u?se.value()[0]:se.value():se)})}),vr(["pop","push","shift","sort","splice","unshift"],function(e){var r=ws[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",u=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var l=arguments;if(u&&!this.__chain__){var d=this.value();return r.apply(fe(d)?d:[],l)}return this[s](function(_){return r.apply(fe(_)?_:[],l)})}}),qr(Se.prototype,function(e,r){var s=p[r];if(s){var u=s.name+"";Le.call(Xi,u)||(Xi[u]=[]),Xi[u].push({name:r,func:s})}}),Xi[Us(t,be).name]=[{name:"wrapper",func:t}],Se.prototype.clone=dp,Se.prototype.reverse=gp,Se.prototype.value=yp,p.prototype.at=Vg,p.prototype.chain=Bg,p.prototype.commit=Gg,p.prototype.next=Wg,p.prototype.plant=Qg,p.prototype.reverse=Yg,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Xg,p.prototype.first=p.prototype.head,_n&&(p.prototype[_n]=Jg),p},Ji=Gf();mt?((mt.exports=Ji)._=Ji,Be._=Ji):Pe._=Ji}).call(Un)})(_c,_c.exports);var ME=Object.defineProperty,zE=Object.defineProperties,UE=Object.getOwnPropertyDescriptors,Ol=Object.getOwnPropertySymbols,kE=Object.prototype.hasOwnProperty,HE=Object.prototype.propertyIsEnumerable,Cl=(o,i,t)=>i in o?ME(o,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[i]=t,na=(o,i)=>{for(var t in i||(i={}))kE.call(i,t)&&Cl(o,t,i[t]);if(Ol)for(var t of Ol(i))HE.call(i,t)&&Cl(o,t,i[t]);return o},KE=(o,i)=>zE(o,UE(i));function fn(o,i,t){var n;const a=z1(o);return((n=i.rpcMap)==null?void 0:n[a.reference])||`${LE}?chainId=${a.namespace}:${a.reference}&projectId=${t}`}function Li(o){return o.includes(":")?o.split(":")[1]:o}function Ef(o){return o.map(i=>`${i.split(":")[0]}:${i.split(":")[1]}`)}function VE(o,i){const t=Object.keys(i.namespaces).filter(a=>a.includes(o));if(!t.length)return[];const n=[];return t.forEach(a=>{const c=i.namespaces[a].accounts;n.push(...c)}),n}function BE(o={},i={}){const t=Al(o),n=Al(i);return _c.exports.merge(t,n)}function Al(o){var i,t,n,a;const c={};if(!oa(o))return c;for(const[f,g]of Object.entries(o)){const m=kl(f)?[f]:g.chains,v=g.methods||[],P=g.events||[],L=g.rpcMap||{},T=kn(f);c[T]=KE(na(na({},c[T]),g),{chains:Ko(m,(i=c[T])==null?void 0:i.chains),methods:Ko(v,(t=c[T])==null?void 0:t.methods),events:Ko(P,(n=c[T])==null?void 0:n.events),rpcMap:na(na({},L),(a=c[T])==null?void 0:a.rpcMap)})}return c}function GE(o){return o.includes(":")?o.split(":")[2]:o}function WE(o){const i={};for(const[t,n]of Object.entries(o)){const a=n.methods||[],c=n.events||[],f=n.accounts||[],g=kl(t)?[t]:n.chains?n.chains:Ef(n.accounts);i[t]={chains:g,methods:a,events:c,accounts:f}}return i}function tc(o){return typeof o=="number"?o:o.includes("0x")?parseInt(o,16):o.includes(":")?Number(o.split(":")[1]):Number(o)}const xf={},Et=o=>xf[o],rc=(o,i)=>{xf[o]=i};class JE{constructor(i){this.name="polkadot",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getAccounts(){const i=this.namespace.accounts;return i?i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=Li(t);i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||fn(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}class QE{constructor(i){this.name="eip155",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(i){switch(i.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(i);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(i.request.method)?await this.client.request(i):this.getHttpProvider().request(i.request)}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(parseInt(i),t),this.chainId=parseInt(i),this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}createHttpProvider(i,t){const n=t||fn(`${this.name}:${i}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=parseInt(Li(t));i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const i=this.chainId,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}async handleSwitchChain(i){var t,n;let a=i.request.params?(t=i.request.params[0])==null?void 0:t.chainId:"0x0";a=a.startsWith("0x")?a:`0x${a}`;const c=parseInt(a,16);if(this.isChainApproved(c))this.setDefaultChain(`${c}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:i.topic,request:{method:i.request.method,params:[{chainId:a}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${c}`);else throw new Error(`Failed to switch to chain 'eip155:${c}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(i){return this.namespace.chains.includes(`${this.name}:${i}`)}}class YE{constructor(i){this.name="solana",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=Li(t);i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||fn(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}class XE{constructor(i){this.name="cosmos",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=Li(t);i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||fn(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}class ZE{constructor(i){this.name="cip34",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{const n=this.getCardanoRPCUrl(t),a=Li(t);i[a]=this.createHttpProvider(a,n)}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}getCardanoRPCUrl(i){const t=this.namespace.rpcMap;if(t)return t[i]}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||this.getCardanoRPCUrl(i);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}class ex{constructor(i){this.name="elrond",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=Li(t);i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||fn(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}class tx{constructor(i){this.name="multiversx",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,t){this.httpProviders[i]||this.setHttpProvider(i,t),this.chainId=i,this.events.emit(mi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(t=>{var n;const a=Li(t);i[a]=this.createHttpProvider(a,(n=this.namespace.rpcMap)==null?void 0:n[t])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,t=this.httpProviders[i];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return t}setHttpProvider(i,t){const n=this.createHttpProvider(i,t);n&&(this.httpProviders[i]=n)}createHttpProvider(i,t){const n=t||fn(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new _i(new qi(n,Et("disableProviderPing")))}}var rx=Object.defineProperty,ix=Object.defineProperties,nx=Object.getOwnPropertyDescriptors,Tl=Object.getOwnPropertySymbols,sx=Object.prototype.hasOwnProperty,ax=Object.prototype.propertyIsEnumerable,Rl=(o,i,t)=>i in o?rx(o,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[i]=t,sa=(o,i)=>{for(var t in i||(i={}))sx.call(i,t)&&Rl(o,t,i[t]);if(Tl)for(var t of Tl(i))ax.call(i,t)&&Rl(o,t,i[t]);return o},ic=(o,i)=>ix(o,nx(i));class Nc{constructor(i){this.events=new Ec,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=i,this.logger=typeof(i==null?void 0:i.logger)<"u"&&typeof(i==null?void 0:i.logger)!="string"?i.logger:Ce.pino(Ce.getDefaultLoggerOptions({level:(i==null?void 0:i.logger)||Sl})),this.disableProviderPing=(i==null?void 0:i.disableProviderPing)||!1}static async init(i){const t=new Nc(i);return await t.initialize(),t}async request(i,t){const[n,a]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:sa({},i),chainId:`${n}:${a}`,topic:this.session.topic})}sendAsync(i,t,n){this.request(i,n).then(a=>t(null,a)).catch(a=>t(a,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var i;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(i=this.session)==null?void 0:i.topic,reason:er("USER_DISCONNECTED")}),await this.cleanup()}async connect(i){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(i),await this.cleanupPendingPairings(),!i.skipPairing)return await this.pair(i.pairingTopic)}on(i,t){this.events.on(i,t)}once(i,t){this.events.once(i,t)}removeListener(i,t){this.events.removeListener(i,t)}off(i,t){this.events.off(i,t)}get isWalletConnect(){return!0}async pair(i){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:a}=await this.client.connect({pairingTopic:i,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await a().then(c=>{this.session=c,this.namespaces||(this.namespaces=WE(c.namespaces),this.persist("namespaces",this.namespaces))}).catch(c=>{if(c.message!==wf)throw c;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(i,t){try{if(!this.session)return;const[n,a]=this.validateChain(i);this.getProvider(n).setDefaultChain(a,t)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(i={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(hn(t)){for(const n of t)i.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const i=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[i]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await FE.init({logger:this.providerOpts.logger||Sl,relayUrl:this.providerOpts.relayUrl||DE,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const i=[...new Set(Object.keys(this.session.namespaces).map(t=>kn(t)))];rc("client",this.client),rc("events",this.events),rc("disableProviderPing",this.disableProviderPing),i.forEach(t=>{if(!this.session)return;const n=VE(t,this.session),a=Ef(n),c=BE(this.namespaces,this.optionalNamespaces),f=ic(sa({},c[t]),{accounts:n,chains:a});switch(t){case"eip155":this.rpcProviders[t]=new QE({namespace:f});break;case"solana":this.rpcProviders[t]=new YE({namespace:f});break;case"cosmos":this.rpcProviders[t]=new XE({namespace:f});break;case"polkadot":this.rpcProviders[t]=new JE({namespace:f});break;case"cip34":this.rpcProviders[t]=new ZE({namespace:f});break;case"elrond":this.rpcProviders[t]=new ex({namespace:f});break;case"multiversx":this.rpcProviders[t]=new tx({namespace:f});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",i=>{this.events.emit("session_ping",i)}),this.client.on("session_event",i=>{const{params:t}=i,{event:n}=t;if(n.name==="accountsChanged"){const a=n.data;a&&hn(a)&&this.events.emit("accountsChanged",a.map(GE))}else if(n.name==="chainChanged"){const a=t.chainId,c=t.event.data,f=kn(a),g=tc(a)!==tc(c)?`${f}:${tc(c)}`:a;this.onChainChanged(g)}else this.events.emit(n.name,n.data);this.events.emit("session_event",i)}),this.client.on("session_update",({topic:i,params:t})=>{var n;const{namespaces:a}=t,c=(n=this.client)==null?void 0:n.session.get(i);this.session=ic(sa({},c),{namespaces:a}),this.onSessionUpdate(),this.events.emit("session_update",{topic:i,params:t})}),this.client.on("session_delete",async i=>{await this.cleanup(),this.events.emit("session_delete",i),this.events.emit("disconnect",ic(sa({},er("USER_DISCONNECTED")),{data:i.topic}))}),this.on(mi.DEFAULT_CHAIN_CHANGED,i=>{this.onChainChanged(i,!0)})}getProvider(i){if(!this.rpcProviders[i])throw new Error(`Provider not found: ${i}`);return this.rpcProviders[i]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(i=>{var t;this.getProvider(i).updateNamespace((t=this.session)==null?void 0:t.namespaces[i])})}setNamespaces(i){const{namespaces:t,optionalNamespaces:n,sessionProperties:a}=i;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=a,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(i){const[t,n]=(i==null?void 0:i.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map(f=>kn(f)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const a=kn(Object.keys(this.namespaces)[0]),c=this.rpcProviders[a].getDefaultChain();return[a,c]}async requestAccounts(){const[i]=this.validateChain();return await this.getProvider(i).requestAccounts()}onChainChanged(i,t=!1){var n;if(!this.namespaces)return;const[a,c]=this.validateChain(i);t||this.getProvider(a).setDefaultChain(c),((n=this.namespaces[a])!=null?n:this.namespaces[`${a}:${c}`]).defaultChain=c,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",c)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(i,t){this.client.core.storage.setItem(`${Pl}/${i}`,t)}async getFromStore(i){return await this.client.core.storage.getItem(`${Pl}/${i}`)}}const ox=Nc,cx="wc",ux="ethereum_provider",hx=`${cx}@2:${ux}:`,lx="https://rpc.walletconnect.com/v1/",mc=["eth_sendTransaction","personal_sign"],fx=["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"],wc=["chainChanged","accountsChanged"],px=["chainChanged","accountsChanged","message","disconnect","connect"];var dx=Object.defineProperty,gx=Object.defineProperties,yx=Object.getOwnPropertyDescriptors,Nl=Object.getOwnPropertySymbols,vx=Object.prototype.hasOwnProperty,_x=Object.prototype.propertyIsEnumerable,$l=(o,i,t)=>i in o?dx(o,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[i]=t,Kn=(o,i)=>{for(var t in i||(i={}))vx.call(i,t)&&$l(o,t,i[t]);if(Nl)for(var t of Nl(i))_x.call(i,t)&&$l(o,t,i[t]);return o},Fl=(o,i)=>gx(o,yx(i));function la(o){return Number(o[0].split(":")[1])}function nc(o){return`0x${o.toString(16)}`}function mx(o){const{chains:i,optionalChains:t,methods:n,optionalMethods:a,events:c,optionalEvents:f,rpcMap:g}=o;if(!hn(i))throw new Error("Invalid chains");const m={chains:i,methods:n||mc,events:c||wc,rpcMap:Kn({},i.length?{[la(i)]:g[la(i)]}:{})},v=c==null?void 0:c.filter(U=>!wc.includes(U)),P=n==null?void 0:n.filter(U=>!mc.includes(U));if(!t&&!f&&!a&&!(v!=null&&v.length)&&!(P!=null&&P.length))return{required:i.length?m:void 0};const L=(v==null?void 0:v.length)&&(P==null?void 0:P.length)||!t,T={chains:[...new Set(L?m.chains.concat(t||[]):t)],methods:[...new Set(m.methods.concat(a!=null&&a.length?a:fx))],events:[...new Set(m.events.concat(f!=null&&f.length?f:px))],rpcMap:g};return{required:i.length?m:void 0,optional:t.length?T:void 0}}class $c{constructor(){this.events=new Ur.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=hx,this.on=(i,t)=>(this.events.on(i,t),this),this.once=(i,t)=>(this.events.once(i,t),this),this.removeListener=(i,t)=>(this.events.removeListener(i,t),this),this.off=(i,t)=>(this.events.off(i,t),this),this.parseAccount=i=>this.isCompatibleChainId(i)?this.parseAccountId(i).address:i,this.signer={},this.rpc={}}static async init(i){const t=new $c;return await t.initialize(i),t}async request(i){return await this.signer.request(i,this.formatChainId(this.chainId))}sendAsync(i,t){this.signer.sendAsync(i,t,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(i){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(i);const{required:t,optional:n}=mx(this.rpc);try{const a=await new Promise(async(f,g)=>{var m;this.rpc.showQrModal&&((m=this.modal)==null||m.subscribeModal(v=>{!v.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),g(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Fl(Kn({namespaces:Kn({},t&&{[this.namespace]:t})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:i==null?void 0:i.pairingTopic})).then(v=>{f(v)}).catch(v=>{g(new Error(v.message))})});if(!a)return;const c=U1(a.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:c),this.setAccounts(c),this.events.emit("connect",{chainId:nc(this.chainId)})}catch(a){throw this.signer.logger.error(a),a}finally{this.modal&&this.modal.closeModal()}}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",i=>{const{params:t}=i,{event:n}=t;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",i)}),this.signer.on("chainChanged",i=>{const t=parseInt(i);this.chainId=t,this.events.emit("chainChanged",nc(this.chainId)),this.persist()}),this.signer.on("session_update",i=>{this.events.emit("session_update",i)}),this.signer.on("session_delete",i=>{this.reset(),this.events.emit("session_delete",i),this.events.emit("disconnect",Fl(Kn({},er("USER_DISCONNECTED")),{data:i.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",i=>{var t,n;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(n=this.modal)==null||n.openModal({uri:i})),this.events.emit("display_uri",i)})}switchEthereumChain(i){this.request({method:"wallet_switchEthereumChain",params:[{chainId:i.toString(16)}]})}isCompatibleChainId(i){return typeof i=="string"?i.startsWith(`${this.namespace}:`):!1}formatChainId(i){return`${this.namespace}:${i}`}parseChainId(i){return Number(i.split(":")[1])}setChainIds(i){const t=i.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",nc(this.chainId)),this.persist())}setChainId(i){if(this.isCompatibleChainId(i)){const t=this.parseChainId(i);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(i){const[t,n,a]=i.split(":");return{chainId:`${t}:${n}`,address:a}}setAccounts(i){this.accounts=i.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(i){var t,n;const a=(t=i==null?void 0:i.chains)!=null?t:[],c=(n=i==null?void 0:i.optionalChains)!=null?n:[],f=a.concat(c);if(!f.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const g=a.length?(i==null?void 0:i.methods)||mc:[],m=a.length?(i==null?void 0:i.events)||wc:[],v=(i==null?void 0:i.optionalMethods)||[],P=(i==null?void 0:i.optionalEvents)||[],L=(i==null?void 0:i.rpcMap)||this.buildRpcMap(f,i.projectId),T=(i==null?void 0:i.qrModalOptions)||void 0;return{chains:a==null?void 0:a.map(U=>this.formatChainId(U)),optionalChains:c.map(U=>this.formatChainId(U)),methods:g,events:m,optionalMethods:v,optionalEvents:P,rpcMap:L,showQrModal:!!(i!=null&&i.showQrModal),qrModalOptions:T,projectId:i.projectId,metadata:i.metadata}}buildRpcMap(i,t){const n={};return i.forEach(a=>{n[a]=this.getRpcUrl(a,t)}),n}async initialize(i){if(this.rpc=this.getRpcConfig(i),this.chainId=this.rpc.chains.length?la(this.rpc.chains):la(this.rpc.optionalChains),this.signer=await ox.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:i.disableProviderPing,relayUrl:i.relayUrl,storageOptions:i.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:n}=await k1(()=>import("./index-648799f0.js").then(a=>a.i),["assets/index-648799f0.js","assets/index-8dd5e2d3.js","assets/index-882a2daf.css"]);t=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Kn({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(i){if(!i)return;const{chains:t,optionalChains:n,rpcMap:a}=i;t&&hn(t)&&(this.rpc.chains=t.map(c=>this.formatChainId(c)),t.forEach(c=>{this.rpc.rpcMap[c]=(a==null?void 0:a[c])||this.getRpcUrl(c)})),n&&hn(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(c=>this.formatChainId(c)),n.forEach(c=>{this.rpc.rpcMap[c]=(a==null?void 0:a[c])||this.getRpcUrl(c)}))}getRpcUrl(i,t){var n;return((n=this.rpc.rpcMap)==null?void 0:n[i])||`${lx}?chainId=eip155:${i}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const i=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${i}`]?this.session.namespaces[`${this.namespace}:${i}`]:this.session.namespaces[this.namespace];this.setChainIds(i?[this.formatChainId(i)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(i){return typeof i=="string"||i instanceof String?[this.parseAccount(i)]:i.map(t=>this.parseAccount(t))}}const Nx=$c;export{Nx as EthereumProvider,px as OPTIONAL_EVENTS,fx as OPTIONAL_METHODS,wc as REQUIRED_EVENTS,mc as REQUIRED_METHODS,$c as default}; diff --git a/examples/vite/dist/index.html b/examples/vite/dist/index.html index d8f26407f2..d62da87fe1 100644 --- a/examples/vite/dist/index.html +++ b/examples/vite/dist/index.html @@ -5,7 +5,7 @@ wagmi - + diff --git a/tsconfig/base.json b/tsconfig/base.json index 4494bba6cc..8ddb571922 100644 --- a/tsconfig/base.json +++ b/tsconfig/base.json @@ -2,9 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "target": "ESNext", - "lib": [ - "esnext" - ], + "lib": ["esnext"], "module": "NodeNext", "moduleResolution": "NodeNext", "allowJs": true, @@ -29,4 +27,4 @@ "noUnusedParameters": true, "strict": true } -} \ No newline at end of file +}