{"version":3,"file":"dist-CH7GaXA6.mjs","names":["RelayerExecutionStrategy","base"],"sources":["../../adapter-evm-core/dist/transaction-CGedZish.mjs","../../adapter-evm-core/dist/wallet-Cnqn54GJ.mjs","../../adapter-evm-core/dist/shared-state-C7bfwoO6.mjs","../../adapter-evm-core/dist/execution-pt51WKhv.mjs","../../adapter-evm-core/dist/relayer-B5mRFtkk.mjs","../../adapter-evm-core/dist/ui-kit-B5rRL5pH.mjs","../../adapter-evm-core/dist/wallet-BNjALpt4.mjs","../../adapter-evm-core/dist/composer-KOMbxrP9.mjs","../../adapter-evm-core/dist/declarative-BScQ8kBN.mjs","../../adapter-evm-core/dist/operator-DRcCu6qh.mjs","../../adapter-evm-core/dist/transactor-CszV6L5T.mjs","../../adapter-evm-core/dist/viewer-B9KW1uv7.mjs","../../adapter-evm-core/dist/index.mjs"],"sourcesContent":["import { t as createAbiFunctionItem } from \"./transformer-0vQSxsqD.mjs\";\nimport { t as parseEvmInput } from \"./input-parser-CegVgfkw.mjs\";\nimport { logger } from \"@openzeppelin/ui-utils\";\nimport { isAddress } from \"viem\";\n\n//#region src/transaction/formatter.ts\n/**\n* Formats transaction data for EVM chains based on parsed inputs.\n*\n* @param contractSchema The contract schema.\n* @param functionId The ID of the function being called.\n* @param submittedInputs The raw data submitted from the form.\n* @param fields The fields of the form schema.\n* @returns The formatted data payload suitable for signAndBroadcast.\n*/\nfunction formatEvmTransactionData(contractSchema, functionId, submittedInputs, fields) {\n\tlogger.info(\"formatEvmTransactionData\", `Formatting EVM transaction data for function: ${functionId}`);\n\tconst functionDetails = contractSchema.functions.find((fn) => fn.id === functionId);\n\tif (!functionDetails) throw new Error(`Function definition for ${functionId} not found in provided contract schema.`);\n\tconst expectedArgs = functionDetails.inputs;\n\tconst orderedRawValues = [];\n\tfor (const expectedArg of expectedArgs) {\n\t\tconst fieldConfig = fields.find((field) => field.name === expectedArg.name);\n\t\tif (!fieldConfig) throw new Error(`Configuration missing for argument: ${expectedArg.name} in provided fields`);\n\t\tlet value;\n\t\tif (fieldConfig.isHardcoded) value = fieldConfig.hardcodedValue;\n\t\telse if (fieldConfig.isHidden) throw new Error(`Field '${fieldConfig.name}' cannot be hidden without being hardcoded.`);\n\t\telse {\n\t\t\tif (!(fieldConfig.name in submittedInputs)) throw new Error(`Missing submitted input for required field: ${fieldConfig.name}`);\n\t\t\tvalue = submittedInputs[fieldConfig.name];\n\t\t}\n\t\torderedRawValues.push(value);\n\t}\n\tconst transformedArgs = expectedArgs.map((param, index) => {\n\t\tlet valueToParse = orderedRawValues[index];\n\t\tif (typeof param.type === \"string\" && param.type.endsWith(\"[]\") && Array.isArray(valueToParse)) valueToParse = JSON.stringify(valueToParse);\n\t\treturn parseEvmInput(param, valueToParse, false);\n\t});\n\tconst isPayable = functionDetails.stateMutability === \"payable\";\n\tlet transactionValue = 0n;\n\tif (isPayable) logger.warn(\"formatEvmTransactionData\", \"Payable function detected, but sending 0 ETH. Implement value input.\");\n\tconst functionAbiItem = createAbiFunctionItem(functionDetails);\n\tif (!contractSchema.address || !isAddress(contractSchema.address)) throw new Error(\"Contract address is missing or invalid in the provided schema.\");\n\treturn {\n\t\taddress: contractSchema.address,\n\t\tabi: [functionAbiItem],\n\t\tfunctionName: functionDetails.name,\n\t\targs: transformedArgs,\n\t\tvalue: transactionValue\n\t};\n}\n\n//#endregion\n//#region src/transaction/sender.ts\nconst SYSTEM_LOG_TAG = \"evm-core-sender\";\nasync function _ensureCorrectNetworkOrSwitch(walletImplementation, targetChainId) {\n\tconst initialAccountStatus = walletImplementation.getWalletConnectionStatus();\n\tif (!initialAccountStatus.isConnected || !initialAccountStatus.chainId) {\n\t\tlogger.error(SYSTEM_LOG_TAG, \"Wallet not connected or chainId unavailable before network check.\");\n\t\tthrow new Error(\"Wallet not connected or chain ID is unavailable.\");\n\t}\n\tif (initialAccountStatus.chainId !== targetChainId) {\n\t\tlogger.info(SYSTEM_LOG_TAG, `Wallet on chain ${initialAccountStatus.chainId}, target ${targetChainId}. Switching...`);\n\t\ttry {\n\t\t\tawait walletImplementation.switchNetwork(targetChainId);\n\t\t\tconst postSwitchAccountStatus = walletImplementation.getWalletConnectionStatus();\n\t\t\tif (postSwitchAccountStatus.chainId !== targetChainId) {\n\t\t\t\tlogger.error(SYSTEM_LOG_TAG, `Failed to switch to target chain ${targetChainId}. Current: ${postSwitchAccountStatus.chainId}`);\n\t\t\t\tthrow new Error(`Failed to switch to the required network (target: ${targetChainId}).`);\n\t\t\t}\n\t\t\tlogger.info(SYSTEM_LOG_TAG, `Successfully switched to target chain ${targetChainId}.`);\n\t\t\treturn postSwitchAccountStatus;\n\t\t} catch (error) {\n\t\t\tlogger.error(SYSTEM_LOG_TAG, \"Network switch failed:\", error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\tlogger.info(SYSTEM_LOG_TAG, \"Wallet already on target chain.\");\n\treturn initialAccountStatus;\n}\nasync function _getAuthenticatedWalletClient(walletImplementation) {\n\tconst walletClient = await walletImplementation.getWalletClient();\n\tif (!walletClient) {\n\t\tlogger.error(SYSTEM_LOG_TAG, \"Wallet client not available. Is wallet connected?\");\n\t\tthrow new Error(\"Wallet is not connected or client is unavailable.\");\n\t}\n\tconst accountStatus = walletImplementation.getWalletConnectionStatus();\n\tif (!accountStatus.isConnected || !accountStatus.address) {\n\t\tlogger.error(SYSTEM_LOG_TAG, \"Account not available. Is wallet connected?\");\n\t\tthrow new Error(\"Wallet is not connected or account address is unavailable.\");\n\t}\n\treturn {\n\t\twalletClient,\n\t\taccountStatus\n\t};\n}\nasync function _executeEoaTransaction(transactionData, walletClient, accountStatus) {\n\tlogger.info(SYSTEM_LOG_TAG, \"Using EOA execution strategy.\");\n\ttry {\n\t\tlogger.debug(SYSTEM_LOG_TAG, \"Calling walletClient.writeContract with:\", {\n\t\t\taccount: accountStatus.address,\n\t\t\taddress: transactionData.address,\n\t\t\tabi: transactionData.abi,\n\t\t\tfunctionName: transactionData.functionName,\n\t\t\targs: transactionData.args,\n\t\t\tvalue: transactionData.value,\n\t\t\tchain: walletClient.chain\n\t\t});\n\t\tconst hash = await walletClient.writeContract({\n\t\t\taccount: accountStatus.address,\n\t\t\taddress: transactionData.address,\n\t\t\tabi: transactionData.abi,\n\t\t\tfunctionName: transactionData.functionName,\n\t\t\targs: transactionData.args,\n\t\t\tvalue: transactionData.value,\n\t\t\tchain: walletClient.chain\n\t\t});\n\t\tlogger.info(SYSTEM_LOG_TAG, \"EOA Transaction initiated. Hash:\", hash);\n\t\treturn { txHash: hash };\n\t} catch (error) {\n\t\tlogger.error(SYSTEM_LOG_TAG, \"Error during EOA writeContract call:\", error);\n\t\tconst errorMessage = error instanceof Error ? error.message : \"Unknown EOA transaction error\";\n\t\tthrow new Error(`Transaction failed (EOA): ${errorMessage}`);\n\t}\n}\n/**\n* Sign and broadcast an EVM transaction using the provided wallet implementation.\n*\n* This function handles:\n* - Network switching (if wallet is on wrong chain)\n* - Transaction signing via the wallet\n* - Transaction broadcasting\n*\n* @param transactionData - The contract write parameters\n* @param walletImplementation - The wallet implementation to use for signing\n* @param targetChainId - The chain ID to execute the transaction on\n* @param executionConfig - Optional execution configuration (for future method support)\n* @returns The transaction hash\n*/\nasync function signAndBroadcastEvmTransaction(transactionData, walletImplementation, targetChainId, executionConfig) {\n\tlogger.info(SYSTEM_LOG_TAG, \"Sign & Broadcast EVM Tx:\", {\n\t\tdata: transactionData,\n\t\ttargetChainId,\n\t\texecConfig: executionConfig\n\t});\n\tconst currentMethod = executionConfig?.method || \"eoa\";\n\tawait _ensureCorrectNetworkOrSwitch(walletImplementation, targetChainId);\n\tconst { walletClient, accountStatus } = await _getAuthenticatedWalletClient(walletImplementation);\n\tswitch (currentMethod) {\n\t\tcase \"eoa\": return _executeEoaTransaction(transactionData, walletClient, accountStatus);\n\t\tcase \"relayer\":\n\t\t\tlogger.warn(SYSTEM_LOG_TAG, \"Relayer method should use RelayerExecutionStrategy directly.\");\n\t\t\tthrow new Error(\"Use RelayerExecutionStrategy for relayer execution.\");\n\t\tcase \"multisig\":\n\t\t\tlogger.warn(SYSTEM_LOG_TAG, \"Multisig execution method not yet implemented.\");\n\t\t\tthrow new Error(\"Multisig execution method not yet implemented.\");\n\t\tdefault:\n\t\t\tconst exhaustiveCheck = currentMethod;\n\t\t\tlogger.error(SYSTEM_LOG_TAG, `Unsupported execution method encountered: ${exhaustiveCheck}`);\n\t\t\tthrow new Error(`Unsupported execution method: ${exhaustiveCheck}`);\n\t}\n}\n/**\n* Sign and broadcast a transaction using the appropriate execution strategy.\n* This is a high-level router function that selects EOA or Relayer strategy\n* based on the execution configuration.\n*\n* @param transactionData - The contract write parameters\n* @param executionConfig - The execution configuration specifying method (eoa, relayer, multisig)\n* @param walletImplementation - The wallet implementation to use for signing\n* @param onStatusChange - Callback for status updates during transaction lifecycle\n* @param runtimeApiKey - Optional API key for relayer execution\n* @returns The transaction hash\n*/\nasync function executeEvmTransaction(transactionData, executionConfig, walletImplementation, onStatusChange, runtimeApiKey) {\n\tconst method = executionConfig.method || \"eoa\";\n\tlogger.info(SYSTEM_LOG_TAG, \"executeEvmTransaction: Starting transaction execution\", { method });\n\tconst { EoaExecutionStrategy } = await import(\"./eoa-CELLTcni.mjs\");\n\tconst { RelayerExecutionStrategy } = await import(\"./relayer-0OY9z8WN.mjs\");\n\tlet strategy;\n\tswitch (method) {\n\t\tcase \"eoa\":\n\t\t\tstrategy = new EoaExecutionStrategy();\n\t\t\tbreak;\n\t\tcase \"relayer\":\n\t\t\tstrategy = new RelayerExecutionStrategy();\n\t\t\tbreak;\n\t\tcase \"multisig\":\n\t\t\tlogger.warn(SYSTEM_LOG_TAG, \"Multisig execution not yet implemented\");\n\t\t\tthrow new Error(\"Multisig execution is not yet supported.\");\n\t\tdefault: {\n\t\t\tconst exhaustiveCheck = method;\n\t\t\tthrow new Error(`Unsupported execution method: ${exhaustiveCheck}`);\n\t\t}\n\t}\n\treturn strategy.execute(transactionData, executionConfig, walletImplementation, onStatusChange, runtimeApiKey);\n}\n/**\n* Waits for a transaction to be confirmed on the blockchain.\n*\n* @param txHash - The transaction hash to wait for\n* @param walletImplementation - The wallet implementation to get the public client from\n* @returns The transaction status and receipt\n*/\nasync function waitForEvmTransactionConfirmation(txHash, walletImplementation) {\n\tlogger.info(SYSTEM_LOG_TAG, `Waiting for tx: ${txHash}`);\n\ttry {\n\t\tconst resolvedPublicClient = await walletImplementation.getPublicClient();\n\t\tif (!resolvedPublicClient) throw new Error(\"Public client not available to wait for transaction.\");\n\t\tconst receipt = await resolvedPublicClient.waitForTransactionReceipt({ hash: txHash });\n\t\tlogger.info(SYSTEM_LOG_TAG, \"Received receipt:\", receipt);\n\t\tif (receipt.status === \"success\") return {\n\t\t\tstatus: \"success\",\n\t\t\treceipt\n\t\t};\n\t\telse {\n\t\t\tlogger.error(SYSTEM_LOG_TAG, \"Transaction reverted:\", receipt);\n\t\t\treturn {\n\t\t\t\tstatus: \"error\",\n\t\t\t\treceipt,\n\t\t\t\terror: /* @__PURE__ */ new Error(\"Transaction reverted.\")\n\t\t\t};\n\t\t}\n\t} catch (error) {\n\t\tlogger.error(SYSTEM_LOG_TAG, \"Error waiting for transaction confirmation:\", error);\n\t\treturn {\n\t\t\tstatus: \"error\",\n\t\t\terror: error instanceof Error ? error : new Error(String(error))\n\t\t};\n\t}\n}\n\n//#endregion\nexport { formatEvmTransactionData as i, signAndBroadcastEvmTransaction as n, waitForEvmTransactionConfirmation as r, executeEvmTransaction as t };\n//# sourceMappingURL=transaction-CGedZish.mjs.map","import { r as getUserRpcUrl } from \"./rpc-BMyYpWRW.mjs\";\nimport { appConfigService, cn, getWalletAccountDisplaySizeProps, getWalletButtonSizeProps, getWalletNetworkSwitcherSizeProps, getWalletNetworkSwitcherVariantClassName, logger } from \"@openzeppelin/ui-utils\";\nimport { http } from \"viem\";\nimport React, { createContext, useContext, useEffect, useRef, useState } from \"react\";\nimport { useDisconnect } from \"wagmi\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { Loader2, LogOut, Wallet } from \"lucide-react\";\nimport { AddressDisplay, Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"@openzeppelin/ui-components\";\nimport { useDerivedAccountStatus, useDerivedChainInfo, useDerivedConnectStatus, useDerivedDisconnect, useDerivedSwitchChainStatus } from \"@openzeppelin/ui-react\";\nimport { injected, safe } from \"@wagmi/connectors\";\nimport { connect, createConfig, disconnect, getAccount, getPublicClient, getWalletClient, http as http$1, switchChain, watchAccount } from \"@wagmi/core\";\nimport { ECOSYSTEM_WALLET_COMPONENT_KEYS } from \"@openzeppelin/ui-types\";\n\n//#region src/wallet/context/wagmi-context.tsx\n/**\n* Context to track Wagmi provider initialization status\n* Used by components to safely render when the provider is ready\n*/\nconst WagmiProviderInitializedContext = createContext(false);\n\n//#endregion\n//#region src/wallet/hooks/useIsWagmiProviderInitialized.ts\n/**\n* Hook to check if WagmiProvider is ready\n* @returns boolean indicating if the provider is initialized\n*/\nconst useIsWagmiProviderInitialized = () => {\n\treturn useContext(WagmiProviderInitializedContext);\n};\n\n//#endregion\n//#region src/wallet/hooks/useManagedWagmiDisconnect.ts\n/**\n* Backwards-compatible alias for wagmi's disconnect hook.\n*\n* The reconnect workaround path is no longer active now that wallet providers are scoped to\n* ecosystem sessions instead of network remounts, but this export remains for compatibility.\n*/\nfunction useManagedWagmiDisconnect() {\n\treturn useDisconnect();\n}\n\n//#endregion\n//#region src/wallet/components/SafeWagmiComponent.tsx\n/**\n* A wrapper component that safely renders children that use wagmi hooks.\n* It handles errors and provider initialization state to prevent crashes.\n*/\nconst SafeWagmiComponent = ({ children, fallback = null }) => {\n\tconst isProviderInitialized = useIsWagmiProviderInitialized();\n\tconst [hasError, setHasError] = useState(false);\n\tuseEffect(() => {\n\t\tif (isProviderInitialized) setHasError(false);\n\t}, [isProviderInitialized]);\n\tuseEffect(() => {\n\t\tconst handleError = (event) => {\n\t\t\tif (event.error?.message?.includes(\"useConfig\") || event.error?.message?.includes(\"WagmiProvider\")) {\n\t\t\t\tlogger.debug(\"SafeWagmiComponent\", \"Caught wagmi error via window error event:\", event.error);\n\t\t\t\tsetHasError(true);\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t};\n\t\twindow.addEventListener(\"error\", handleError);\n\t\treturn () => {\n\t\t\twindow.removeEventListener(\"error\", handleError);\n\t\t};\n\t}, []);\n\tif (!isProviderInitialized || hasError) return /* @__PURE__ */ jsx(Fragment, { children: fallback });\n\ttry {\n\t\treturn /* @__PURE__ */ jsx(Fragment, { children });\n\t} catch (error) {\n\t\tif (error instanceof Error && (error.message.includes(\"useConfig\") || error.message.includes(\"WagmiProvider\"))) {\n\t\t\tlogger.debug(\"SafeWagmiComponent\", \"Caught wagmi error:\", error);\n\t\t\tsetHasError(true);\n\t\t\treturn /* @__PURE__ */ jsx(Fragment, { children: fallback });\n\t\t}\n\t\tthrow error;\n\t}\n};\n\n//#endregion\n//#region src/wallet/components/connect/ConnectorDialog.tsx\nconst ConnectorDialog = ({ open, onOpenChange, showInjectedConnector = false }) => {\n\treturn /* @__PURE__ */ jsx(SafeWagmiComponent, {\n\t\tfallback: /* @__PURE__ */ jsx(Dialog, {\n\t\t\topen,\n\t\t\tonOpenChange,\n\t\t\tchildren: /* @__PURE__ */ jsx(DialogContent, {\n\t\t\t\tclassName: \"sm:max-w-[425px]\",\n\t\t\t\tchildren: /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: \"Wallet Connection Unavailable\" }), /* @__PURE__ */ jsx(DialogDescription, { children: \"The wallet connection system is not properly initialized.\" })] })\n\t\t\t})\n\t\t}),\n\t\tchildren: /* @__PURE__ */ jsx(ConnectorDialogContent, {\n\t\t\topen,\n\t\t\tonOpenChange,\n\t\t\tshowInjectedConnector\n\t\t})\n\t});\n};\nfunction isAlreadyConnectedError(error) {\n\treturn !!error?.message?.includes(\"Connector already connected\");\n}\nconst ConnectorDialogContent = ({ open, onOpenChange, showInjectedConnector = false }) => {\n\tconst { connect: connect$1, connectors, error: connectError } = useDerivedConnectStatus();\n\tconst accountStatus = useDerivedAccountStatus();\n\tconst [connectingId, setConnectingId] = useState(null);\n\tconst isConnected = accountStatus.isConnected;\n\tuseEffect(() => {\n\t\tif (isConnected && open) {\n\t\t\tonOpenChange(false);\n\t\t\tsetConnectingId(null);\n\t\t}\n\t}, [\n\t\tisConnected,\n\t\tonOpenChange,\n\t\topen\n\t]);\n\tuseEffect(() => {\n\t\tif (open && isAlreadyConnectedError(connectError)) {\n\t\t\tonOpenChange(false);\n\t\t\tsetConnectingId(null);\n\t\t}\n\t}, [\n\t\tconnectError,\n\t\tonOpenChange,\n\t\topen\n\t]);\n\tuseEffect(() => {\n\t\tif (!open && connectingId) setConnectingId(null);\n\t}, [connectingId, open]);\n\tuseEffect(() => {\n\t\tif (connectError && !isAlreadyConnectedError(connectError)) setConnectingId(null);\n\t}, [connectError]);\n\tif (!connect$1) return /* @__PURE__ */ jsx(Dialog, {\n\t\topen,\n\t\tonOpenChange,\n\t\tchildren: /* @__PURE__ */ jsxs(DialogContent, {\n\t\t\tclassName: \"sm:max-w-[425px]\",\n\t\t\tchildren: [/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: \"Error\" }) }), /* @__PURE__ */ jsx(\"p\", { children: \"Wallet connection function is not available.\" })]\n\t\t})\n\t});\n\tconst canSelectConnector = !isConnected && connectingId === null;\n\tconst handleConnectorSelect = (selectedConnector) => {\n\t\tif (!canSelectConnector) return;\n\t\tsetConnectingId(selectedConnector.id);\n\t\tconnect$1({ connector: selectedConnector });\n\t};\n\tconst filteredConnectors = connectors.filter((connector) => {\n\t\treturn !(connector.id === \"injected\" && !showInjectedConnector);\n\t});\n\tconst displayError = connectError && !isAlreadyConnectedError(connectError) ? connectError : null;\n\treturn /* @__PURE__ */ jsx(Dialog, {\n\t\topen,\n\t\tonOpenChange,\n\t\tchildren: /* @__PURE__ */ jsxs(DialogContent, {\n\t\t\tclassName: \"sm:max-w-[425px]\",\n\t\t\tchildren: [\n\t\t\t\t/* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: \"Connect Wallet\" }), /* @__PURE__ */ jsx(DialogDescription, { children: \"Select a wallet provider to connect with this application.\" })] }),\n\t\t\t\t/* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\tclassName: \"grid gap-4 py-4\",\n\t\t\t\t\tchildren: filteredConnectors.length === 0 ? /* @__PURE__ */ jsx(\"p\", {\n\t\t\t\t\t\tclassName: \"text-center text-muted-foreground\",\n\t\t\t\t\t\tchildren: \"No wallet connectors available.\"\n\t\t\t\t\t}) : filteredConnectors.map((connector) => /* @__PURE__ */ jsxs(Button, {\n\t\t\t\t\t\tonClick: () => handleConnectorSelect(connector),\n\t\t\t\t\t\tdisabled: !canSelectConnector,\n\t\t\t\t\t\tvariant: \"outline\",\n\t\t\t\t\t\tclassName: \"flex justify-between items-center w-full py-6\",\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"span\", { children: connector.name }), connectingId === connector.id && /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\t\t\t\tclassName: \"ml-2 text-xs\",\n\t\t\t\t\t\t\tchildren: \"Connecting...\"\n\t\t\t\t\t\t})]\n\t\t\t\t\t}, connector.id))\n\t\t\t\t}),\n\t\t\t\tdisplayError && /* @__PURE__ */ jsx(\"p\", {\n\t\t\t\t\tclassName: \"text-sm text-red-500 mt-1\",\n\t\t\t\t\tchildren: displayError.message || \"Error connecting wallet\"\n\t\t\t\t})\n\t\t\t]\n\t\t})\n\t});\n};\n\n//#endregion\n//#region src/wallet/components/connect/ConnectButton.tsx\nconst CustomConnectButton = ({ className, size, variant, fullWidth, hideWhenConnected = true, showInjectedConnector = false }) => {\n\tconst [dialogOpen, setDialogOpen] = useState(false);\n\tconst sizeProps = getWalletButtonSizeProps(size);\n\treturn /* @__PURE__ */ jsx(SafeWagmiComponent, {\n\t\tfallback: /* @__PURE__ */ jsx(\"div\", {\n\t\t\tclassName: cn(\"flex items-center\", fullWidth && \"w-full\", className),\n\t\t\tchildren: /* @__PURE__ */ jsxs(Button, {\n\t\t\t\tdisabled: true,\n\t\t\t\tvariant: variant || \"outline\",\n\t\t\t\tsize: sizeProps.size,\n\t\t\t\tclassName: cn(sizeProps.className, fullWidth && \"w-full\"),\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(Wallet, { className: cn(sizeProps.iconSize, \"mr-1\") }), \"Wallet Unavailable\"]\n\t\t\t})\n\t\t}),\n\t\tchildren: /* @__PURE__ */ jsx(ConnectButtonContent, {\n\t\t\tclassName,\n\t\t\tsize,\n\t\t\tvariant,\n\t\t\tfullWidth,\n\t\t\tdialogOpen,\n\t\t\tsetDialogOpen,\n\t\t\thideWhenConnected,\n\t\t\tshowInjectedConnector\n\t\t})\n\t});\n};\nconst ConnectButtonContent = ({ className, size, variant, fullWidth, dialogOpen, setDialogOpen, hideWhenConnected, showInjectedConnector }) => {\n\tconst { isConnected } = useDerivedAccountStatus();\n\tconst { isConnecting, error: connectError } = useDerivedConnectStatus();\n\tconst sizeProps = getWalletButtonSizeProps(size);\n\tuseEffect(() => {\n\t\tif (isConnected && hideWhenConnected) setDialogOpen(false);\n\t}, [\n\t\tisConnected,\n\t\thideWhenConnected,\n\t\tsetDialogOpen\n\t]);\n\tconst handleConnectClick = () => {\n\t\tif (!isConnected && !isConnecting) setDialogOpen(true);\n\t};\n\tif (isConnected && hideWhenConnected) return null;\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: cn(\"flex items-center\", fullWidth && \"w-full\", className),\n\t\tchildren: [/* @__PURE__ */ jsxs(Button, {\n\t\t\tonClick: handleConnectClick,\n\t\t\tdisabled: isConnecting || isConnected,\n\t\t\tvariant: variant || \"outline\",\n\t\t\tsize: sizeProps.size,\n\t\t\tclassName: cn(sizeProps.className, fullWidth && \"w-full\"),\n\t\t\ttitle: isConnected ? \"Connected\" : connectError?.message || \"Connect Wallet\",\n\t\t\tchildren: [isConnecting ? /* @__PURE__ */ jsx(Loader2, { className: cn(sizeProps.iconSize, \"animate-spin mr-1\") }) : /* @__PURE__ */ jsx(Wallet, { className: cn(sizeProps.iconSize, \"mr-1\") }), isConnecting ? \"Connecting…\" : \"Connect Wallet\"]\n\t\t}), /* @__PURE__ */ jsx(ConnectorDialog, {\n\t\t\topen: dialogOpen,\n\t\t\tonOpenChange: setDialogOpen,\n\t\t\tshowInjectedConnector\n\t\t})]\n\t});\n};\n\n//#endregion\n//#region src/wallet/components/account/AccountDisplay.tsx\n/**\n* A component that displays the connected account address and chain ID.\n* Also includes a disconnect button.\n*/\nconst CustomAccountDisplay = ({ className, size, variant, fullWidth }) => {\n\treturn /* @__PURE__ */ jsx(SafeWagmiComponent, {\n\t\tfallback: null,\n\t\tchildren: /* @__PURE__ */ jsx(AccountDisplayContent, {\n\t\t\tclassName,\n\t\t\tsize,\n\t\t\tvariant,\n\t\t\tfullWidth\n\t\t})\n\t});\n};\nconst AccountDisplayContent = ({ className, size, variant, fullWidth }) => {\n\tconst { isConnected, address, chainId } = useDerivedAccountStatus();\n\tconst { disconnect: disconnect$1 } = useDerivedDisconnect();\n\tconst sizeProps = getWalletAccountDisplaySizeProps(size);\n\tif (!isConnected || !address) return null;\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: cn(\"flex items-center gap-2\", fullWidth && \"w-full\", className),\n\t\tchildren: [/* @__PURE__ */ jsxs(\"div\", {\n\t\t\tclassName: cn(\"group flex flex-col\", fullWidth && \"flex-1\"),\n\t\t\tchildren: [/* @__PURE__ */ jsx(AddressDisplay, {\n\t\t\t\taddress,\n\t\t\t\tvariant: \"inline\",\n\t\t\t\tstartChars: 4,\n\t\t\t\tendChars: 4,\n\t\t\t\tshowTooltip: true,\n\t\t\t\tshowCopyButton: true,\n\t\t\t\tshowCopyButtonOnHover: true,\n\t\t\t\tclassName: cn(sizeProps.textSize, \"font-sans font-medium\")\n\t\t\t}), /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: cn(sizeProps.subTextSize, \"text-muted-foreground -mt-0.5\"),\n\t\t\t\tchildren: chainId ? `Chain ID: ${chainId}` : \"Chain ID: N/A\"\n\t\t\t})]\n\t\t}), disconnect$1 && /* @__PURE__ */ jsx(Button, {\n\t\t\tonClick: () => disconnect$1(),\n\t\t\tvariant: variant || \"ghost\",\n\t\t\tsize: \"icon\",\n\t\t\tclassName: cn(sizeProps.iconButtonSize, \"p-0\"),\n\t\t\ttitle: \"Disconnect wallet\",\n\t\t\tchildren: /* @__PURE__ */ jsx(LogOut, { className: sizeProps.iconSize })\n\t\t})]\n\t});\n};\n\n//#endregion\n//#region src/wallet/components/network/NetworkSwitcher.tsx\n/**\n* A component that displays the current network and allows switching to other networks.\n* Uses the chainId and switchChain hooks.\n*/\nconst CustomNetworkSwitcher = ({ className, size, variant, fullWidth }) => {\n\treturn /* @__PURE__ */ jsx(SafeWagmiComponent, {\n\t\tfallback: null,\n\t\tchildren: /* @__PURE__ */ jsx(NetworkSwitcherContent, {\n\t\t\tclassName,\n\t\t\tsize,\n\t\t\tvariant,\n\t\t\tfullWidth\n\t\t})\n\t});\n};\nconst NetworkSwitcherContent = ({ className, size, variant, fullWidth }) => {\n\tconst { isConnected } = useDerivedAccountStatus();\n\tconst { currentChainId, availableChains: unknownChains } = useDerivedChainInfo();\n\tconst { switchChain: switchChain$1, isSwitching: isPending, error } = useDerivedSwitchChainStatus();\n\tconst sizeProps = getWalletNetworkSwitcherSizeProps(size);\n\tconst variantClassName = getWalletNetworkSwitcherVariantClassName(variant);\n\tconst typedAvailableChains = unknownChains;\n\tif (!isConnected || !switchChain$1 || typedAvailableChains.length === 0) return null;\n\tconst handleNetworkChange = (chainId) => {\n\t\tif (chainId !== currentChainId) switchChain$1({ chainId });\n\t};\n\tconst currentChainName = typedAvailableChains.find((chain) => chain.id === currentChainId)?.name || \"Network\";\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tclassName: cn(\"flex items-center\", fullWidth && \"w-full\", className),\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsxs(Select, {\n\t\t\t\tvalue: currentChainId?.toString() ?? \"\",\n\t\t\t\tonValueChange: (value) => handleNetworkChange(Number(value)),\n\t\t\t\tdisabled: isPending || typedAvailableChains.length === 0,\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(SelectTrigger, {\n\t\t\t\t\tclassName: cn(sizeProps.triggerClassName, variantClassName, fullWidth && \"w-full max-w-none\"),\n\t\t\t\t\tchildren: /* @__PURE__ */ jsx(SelectValue, {\n\t\t\t\t\t\tplaceholder: \"Network\",\n\t\t\t\t\t\tchildren: currentChainName\n\t\t\t\t\t})\n\t\t\t\t}), /* @__PURE__ */ jsx(SelectContent, {\n\t\t\t\t\tposition: \"popper\",\n\t\t\t\t\tsideOffset: 5,\n\t\t\t\t\talign: \"start\",\n\t\t\t\t\tclassName: \"w-auto min-w-[160px] max-h-[300px]\",\n\t\t\t\t\tchildren: typedAvailableChains.map((chain) => /* @__PURE__ */ jsx(SelectItem, {\n\t\t\t\t\t\tvalue: chain.id.toString(),\n\t\t\t\t\t\tclassName: sizeProps.itemClassName,\n\t\t\t\t\t\tchildren: chain.name\n\t\t\t\t\t}, chain.id))\n\t\t\t\t})]\n\t\t\t}),\n\t\t\tisPending && /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: \"text-muted-foreground ml-2\",\n\t\t\t\tchildren: /* @__PURE__ */ jsx(Loader2, { className: cn(sizeProps.loaderSize, \"animate-spin\") })\n\t\t\t}),\n\t\t\terror && /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: \"text-xs text-red-500 ml-2\",\n\t\t\t\tchildren: \"!\"\n\t\t\t})\n\t\t]\n\t});\n};\n\n//#endregion\n//#region src/wallet/connection.ts\n/**\n* Default wallet connection status when disconnected.\n* Use this constant when the wallet implementation is not ready or available.\n*/\nconst DEFAULT_DISCONNECTED_STATUS = {\n\tisConnected: false,\n\tisConnecting: false,\n\tisDisconnected: true,\n\tisReconnecting: false,\n\tstatus: \"disconnected\",\n\taddress: void 0,\n\taddresses: void 0,\n\tchainId: void 0,\n\tchain: void 0,\n\tconnector: void 0\n};\n/**\n* Core implementation of connect and ensure correct network logic.\n*\n* This function handles the common pattern of:\n* 1. Connect to wallet using the specified connector\n* 2. Check if connected to the target chain\n* 3. If not, attempt to switch networks\n* 4. If switch fails, disconnect and return error\n*\n* @param impl - The wallet implementation to use\n* @param connectorId - The ID of the connector to use\n* @param targetChainId - The desired chain ID to switch to after connection\n* @param logSystem - The log system identifier for logging\n* @returns An object containing connection status, address, and any error\n*/\nasync function connectAndEnsureCorrectNetworkCore(impl, connectorId, targetChainId, logSystem) {\n\tconst connectionResult = await impl.connect(connectorId);\n\tif (!connectionResult.connected || !connectionResult.address || !connectionResult.chainId) return {\n\t\tconnected: false,\n\t\terror: connectionResult.error || \"Connection failed\"\n\t};\n\tif (connectionResult.chainId !== targetChainId) {\n\t\tlogger.info(logSystem, `Connected to chain ${connectionResult.chainId}, but target is ${targetChainId}. Attempting switch.`);\n\t\ttry {\n\t\t\tawait impl.switchNetwork(targetChainId);\n\t\t\tconst postSwitchStatus = impl.getWalletConnectionStatus();\n\t\t\tif (postSwitchStatus.chainId !== targetChainId) {\n\t\t\t\tconst switchError = `Failed to switch to target network ${targetChainId}. Current: ${postSwitchStatus.chainId}`;\n\t\t\t\tlogger.error(logSystem, switchError);\n\t\t\t\ttry {\n\t\t\t\t\tawait impl.disconnect();\n\t\t\t\t} catch (e) {\n\t\t\t\t\tlogger.warn(logSystem, \"Failed to disconnect after network switch failure.\", e);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tconnected: false,\n\t\t\t\t\terror: switchError\n\t\t\t\t};\n\t\t\t}\n\t\t\tlogger.info(logSystem, `Successfully switched to target chain ${targetChainId}.`);\n\t\t\treturn {\n\t\t\t\t...connectionResult,\n\t\t\t\tchainId: postSwitchStatus.chainId\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\t\tlogger.error(logSystem, \"Network switch failed:\", errorMessage);\n\t\t\ttry {\n\t\t\t\tawait impl.disconnect();\n\t\t\t} catch (e) {\n\t\t\t\tlogger.warn(logSystem, \"Failed to disconnect after network switch failure.\", e);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tconnected: false,\n\t\t\t\terror: `Network switch failed: ${errorMessage}`\n\t\t\t};\n\t\t}\n\t}\n\treturn connectionResult;\n}\n\n//#endregion\n//#region src/wallet/wagmi-implementation.ts\n/**\n* Core Wagmi implementation for EVM wallet connection\n*\n* This file contains the shared implementation of Wagmi and Viem for wallet connection.\n* It's designed to be used by both EVM and Polkadot adapters with full feature parity.\n*\n* Features:\n* - RPC override logic with user configuration support\n* - Dynamic RPC change listener for config invalidation\n* - Chain ID to network ID mapping\n* - Explicit connector setup (injected, safe)\n* - Sophisticated config caching with invalidation\n* - UI kit configuration methods for RainbowKit integration\n*/\n/**\n* Generates the supported chains from network configurations.\n* Only includes networks that have a viemChain property (ensuring wagmi compatibility).\n*/\nfunction getSupportedChainsFromNetworks(networkConfigs, logSystem) {\n\tconst chains = networkConfigs.filter((network) => network.viemChain).map((network) => network.viemChain).filter((chain, index, self) => self.findIndex((c) => c.id === chain.id) === index);\n\tlogger.info(logSystem, `Generated supported chains from network configurations: ${chains.length} chains`, chains.map((c) => ({\n\t\tid: c.id,\n\t\tname: c.name\n\t})));\n\treturn chains;\n}\n/**\n* Generates the mapping from Viem chain IDs to application network IDs.\n* This mapping is auto-generated from the network configurations.\n*/\nfunction getChainIdToNetworkIdMapping(networkConfigs, logSystem) {\n\tconst mapping = networkConfigs.filter((network) => network.viemChain).reduce((acc, network) => {\n\t\tacc[network.chainId] = network.id;\n\t\treturn acc;\n\t}, {});\n\tlogger.info(logSystem, \"Generated chain ID to network ID mapping from network configurations:\", mapping);\n\treturn mapping;\n}\n/**\n* Class responsible for encapsulating Wagmi core logic for wallet interactions.\n* This class should not be used directly by UI components. The adapters\n* expose a standardized interface for wallet operations.\n* It manages Wagmi Config instances and provides methods for wallet actions.\n*\n* Implements EvmWalletImplementation interface for use with shared execution strategies.\n*\n* @example\n* ```typescript\n* // In adapter-evm:\n* const walletImpl = new WagmiWalletImplementation({\n*   chains: evmChains,\n*   networkConfigs: evmNetworks,\n* });\n*\n* // In adapter-polkadot:\n* const walletImpl = new WagmiWalletImplementation({\n*   chains: polkadotChains,\n*   networkConfigs: polkadotNetworks,\n* });\n* ```\n*/\nvar WagmiWalletImplementation = class {\n\tdefaultInstanceConfig = null;\n\tactiveWagmiConfig = null;\n\tunsubscribe;\n\tinitialized = false;\n\trpcConfigUnsubscribe;\n\tsupportedChains;\n\tchainIdToNetworkId;\n\tlogSystem;\n\trainbowKitConfigFn;\n\t/**\n\t* Constructs the WagmiWalletImplementation.\n\t* Configuration for Wagmi is deferred until actually needed or set externally.\n\t*\n\t* @param config - Configuration options for the wallet implementation\n\t*/\n\tconstructor(config) {\n\t\tthis.logSystem = config.logSystem ?? \"WagmiWalletImplementation\";\n\t\tthis.supportedChains = config.chains.length > 0 ? config.chains : getSupportedChainsFromNetworks(config.networkConfigs, this.logSystem);\n\t\tthis.chainIdToNetworkId = getChainIdToNetworkIdMapping(config.networkConfigs, this.logSystem);\n\t\tlogger.info(this.logSystem, \"Constructor called. Initial anticipated kitName:\", config.initialUiKitConfig?.kitName);\n\t\tthis.initialized = true;\n\t\tlogger.info(this.logSystem, \"WagmiWalletImplementation instance initialized (Wagmi config creation deferred).\");\n\t\tthis.setupRpcConfigListener();\n\t}\n\t/**\n\t* Sets the RainbowKit config retrieval function.\n\t* This allows adapters to inject their own RainbowKit integration.\n\t*\n\t* @param fn - Function to get RainbowKit wagmi config\n\t*/\n\tsetRainbowKitConfigFn(fn) {\n\t\tthis.rainbowKitConfigFn = fn;\n\t}\n\t/**\n\t* Gets the supported chains for this implementation.\n\t*/\n\tgetSupportedChains() {\n\t\treturn this.supportedChains;\n\t}\n\t/**\n\t* Gets the chain ID to network ID mapping.\n\t*/\n\tgetChainIdToNetworkIdMapping() {\n\t\treturn this.chainIdToNetworkId;\n\t}\n\t/**\n\t* Sets up a listener for RPC configuration changes to invalidate the cached Wagmi config\n\t* when user changes RPC settings.\n\t*/\n\tsetupRpcConfigListener() {\n\t\timport(\"@openzeppelin/ui-utils\").then(({ userRpcConfigService }) => {\n\t\t\tthis.rpcConfigUnsubscribe = userRpcConfigService.subscribe(\"*\", (event) => {\n\t\t\t\tif (event.type === \"rpc-config-changed\" || event.type === \"rpc-config-cleared\") {\n\t\t\t\t\tlogger.info(this.logSystem, `RPC config changed for network ${event.networkId}. Invalidating cached Wagmi config.`);\n\t\t\t\t\tthis.defaultInstanceConfig = null;\n\t\t\t\t}\n\t\t\t});\n\t\t}).catch((error) => {\n\t\t\tlogger.error(this.logSystem, \"Failed to setup RPC config listener:\", error);\n\t\t});\n\t}\n\t/**\n\t* Cleanup method to unsubscribe from RPC config changes\n\t*/\n\tcleanup() {\n\t\tif (this.rpcConfigUnsubscribe) {\n\t\t\tthis.rpcConfigUnsubscribe();\n\t\t\tthis.rpcConfigUnsubscribe = void 0;\n\t\t}\n\t\tif (this.unsubscribe) {\n\t\t\tthis.unsubscribe();\n\t\t\tthis.unsubscribe = void 0;\n\t\t}\n\t}\n\t/**\n\t* Sets the externally determined, currently active WagmiConfig instance.\n\t* This is typically called by UiKitManager after it has resolved the appropriate\n\t* config for the selected UI kit (e.g., RainbowKit's config or a default custom config).\n\t*\n\t* @param config - The Wagmi Config object to set as active, or null to clear it.\n\t*/\n\tsetActiveWagmiConfig(config) {\n\t\tlogger.info(this.logSystem, \"setActiveWagmiConfig called with config:\", config ? \"Valid Config\" : \"Null\");\n\t\tthis.activeWagmiConfig = config;\n\t\tif (this.unsubscribe) logger.warn(this.logSystem, \"setActiveWagmiConfig: Active WagmiConfig instance has changed. Existing direct watchAccount subscription (via onWalletConnectionChange) may be stale and operating on an old config instance.\");\n\t}\n\t/**\n\t* Checks if an active wagmi config has been set.\n\t* Subclasses can use this to determine if the wallet is ready for operations.\n\t*\n\t* @returns true if an active wagmi config is set\n\t*/\n\thasActiveConfig() {\n\t\treturn this.activeWagmiConfig !== null;\n\t}\n\t/**\n\t* Creates a default WagmiConfig instance on demand.\n\t* This configuration includes standard connectors (injected, Safe).\n\t* Used as a fallback or for 'custom' UI kit mode.\n\t*\n\t* The dedicated `metaMask()` connector is deliberately absent: it pulls in\n\t* `@metamask/sdk`, which ships a proprietary ConsenSys licence restricted to\n\t* Non-Commercial Use and requiring any derivative to carry that same\n\t* restriction forward. We publish under AGPL-3.0, which forbids conveying the\n\t* work under added restrictions, so the two cannot both be satisfied.\n\t*\n\t* The MetaMask browser extension still connects through `injected()` plus\n\t* EIP-6963 discovery, which `createConfig` enables by default. What is lost is\n\t* MetaMask *mobile* deep-link / QR pairing, which only the SDK provided.\n\t*\n\t* @returns A Wagmi Config object.\n\t*/\n\tcreateDefaultConfig() {\n\t\tconst baseConnectors = [injected(), safe()];\n\t\tconst transportsConfig = this.supportedChains.reduce((acc, chainDefinition) => {\n\t\t\tlet rpcUrlToUse = chainDefinition.rpcUrls.default?.http?.[0];\n\t\t\tconst appNetworkIdString = this.chainIdToNetworkId[chainDefinition.id];\n\t\t\tif (appNetworkIdString) {\n\t\t\t\tlet httpRpcOverride = getUserRpcUrl(appNetworkIdString);\n\t\t\t\tif (!httpRpcOverride) {\n\t\t\t\t\tconst rpcOverrideSetting = appConfigService.getRpcEndpointOverride(appNetworkIdString);\n\t\t\t\t\tif (typeof rpcOverrideSetting === \"string\") httpRpcOverride = rpcOverrideSetting;\n\t\t\t\t\telse if (typeof rpcOverrideSetting === \"object\") {\n\t\t\t\t\t\tif (\"http\" in rpcOverrideSetting && rpcOverrideSetting.http) httpRpcOverride = rpcOverrideSetting.http;\n\t\t\t\t\t\telse if (\"url\" in rpcOverrideSetting && rpcOverrideSetting.url) httpRpcOverride = rpcOverrideSetting.url;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (httpRpcOverride) {\n\t\t\t\t\tlogger.info(this.logSystem, `Using overridden RPC for chain ${chainDefinition.name} (default config): ${httpRpcOverride}`);\n\t\t\t\t\trpcUrlToUse = httpRpcOverride;\n\t\t\t\t}\n\t\t\t}\n\t\t\tacc[chainDefinition.id] = http(rpcUrlToUse);\n\t\t\treturn acc;\n\t\t}, {});\n\t\ttry {\n\t\t\tconst defaultConfig = createConfig({\n\t\t\t\tchains: this.supportedChains,\n\t\t\t\tconnectors: baseConnectors,\n\t\t\t\ttransports: transportsConfig\n\t\t\t});\n\t\t\tlogger.info(this.logSystem, \"Default Wagmi config created successfully on demand.\");\n\t\t\treturn defaultConfig;\n\t\t} catch (error) {\n\t\t\tlogger.error(this.logSystem, \"Error creating default Wagmi config on demand:\", error);\n\t\t\treturn createConfig({\n\t\t\t\tchains: [this.supportedChains[0]],\n\t\t\t\tconnectors: [injected()],\n\t\t\t\ttransports: { [this.supportedChains[0].id]: http() }\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Wrapper function to convert AppConfigService RPC overrides to the format expected by RainbowKit.\n\t*\n\t* @param networkId - The network ID to get RPC override for\n\t* @returns RPC configuration in the format expected by RainbowKit\n\t*/\n\tgetRpcOverrideForRainbowKit(networkId) {\n\t\tconst userRpcUrl = getUserRpcUrl(networkId);\n\t\tif (userRpcUrl) return { http: userRpcUrl };\n\t\tconst rpcOverrideSetting = appConfigService.getRpcEndpointOverride(networkId);\n\t\tif (typeof rpcOverrideSetting === \"string\") return rpcOverrideSetting;\n\t\telse if (typeof rpcOverrideSetting === \"object\" && rpcOverrideSetting !== null) {\n\t\t\tif (\"url\" in rpcOverrideSetting && typeof rpcOverrideSetting.url === \"string\") return { http: rpcOverrideSetting.url };\n\t\t\telse if (\"http\" in rpcOverrideSetting || \"ws\" in rpcOverrideSetting) {\n\t\t\t\tconst config = rpcOverrideSetting;\n\t\t\t\treturn {\n\t\t\t\t\thttp: config.http,\n\t\t\t\t\tws: config.ws\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Retrieves or creates the WagmiConfig specifically for RainbowKit.\n\t* This delegates to the injected RainbowKit config function if available.\n\t*\n\t* @param currentAdapterUiKitConfig - The fully resolved UI kit configuration for the adapter.\n\t* @returns A Promise resolving to the RainbowKit-specific Wagmi Config object, or null if creation fails or not RainbowKit.\n\t*/\n\tasync getConfigForRainbowKit(currentAdapterUiKitConfig) {\n\t\tif (!this.initialized) {\n\t\t\tlogger.error(this.logSystem, \"getConfigForRainbowKit called before implementation initialization.\");\n\t\t\treturn null;\n\t\t}\n\t\tif (currentAdapterUiKitConfig?.kitName !== \"rainbowkit\") {\n\t\t\tlogger.warn(this.logSystem, \"getConfigForRainbowKit called, but kitName is not rainbowkit. Returning null.\");\n\t\t\treturn null;\n\t\t}\n\t\tlogger.info(this.logSystem, \"getConfigForRainbowKit: Kit is RainbowKit. Proceeding to create/get config. CurrentAdapterUiKitConfig:\", currentAdapterUiKitConfig);\n\t\tif (this.rainbowKitConfigFn) {\n\t\t\tconst rainbowKitWagmiConfig = await this.rainbowKitConfigFn(currentAdapterUiKitConfig, this.supportedChains, this.chainIdToNetworkId, this.getRpcOverrideForRainbowKit.bind(this));\n\t\t\tif (rainbowKitWagmiConfig) {\n\t\t\t\tlogger.info(this.logSystem, \"Returning RainbowKit-specific Wagmi config for provider.\");\n\t\t\t\treturn rainbowKitWagmiConfig;\n\t\t\t}\n\t\t}\n\t\tlogger.warn(this.logSystem, \"RainbowKit specific Wagmi config creation failed.\");\n\t\treturn null;\n\t}\n\t/**\n\t* Determines and returns the WagmiConfig to be used by UiKitManager during its configuration process.\n\t* If RainbowKit is specified in the passed uiKitConfig, it attempts to get its specific config.\n\t* Otherwise, it falls back to creating/returning a default instance config.\n\t*\n\t* @param uiKitConfig - The fully resolved UiKitConfiguration that the manager is currently processing.\n\t* @returns A Promise resolving to the determined Wagmi Config object.\n\t*/\n\tasync getActiveConfigForManager(uiKitConfig) {\n\t\tif (!this.initialized) {\n\t\t\tlogger.error(this.logSystem, \"getActiveConfigForManager called before initialization! Creating fallback.\");\n\t\t\treturn createConfig({\n\t\t\t\tchains: [this.supportedChains[0]],\n\t\t\t\ttransports: { [this.supportedChains[0].id]: http() }\n\t\t\t});\n\t\t}\n\t\tif (uiKitConfig?.kitName === \"rainbowkit\") {\n\t\t\tconst rkConfig = await this.getConfigForRainbowKit(uiKitConfig);\n\t\t\tif (rkConfig) return rkConfig;\n\t\t\tlogger.warn(this.logSystem, \"getActiveConfigForManager: RainbowKit config failed, falling back to default.\");\n\t\t}\n\t\tif (!this.defaultInstanceConfig) this.defaultInstanceConfig = this.createDefaultConfig();\n\t\treturn this.defaultInstanceConfig;\n\t}\n\t/**\n\t* @deprecated Prefer using methods that rely on the externally set `activeWagmiConfig`\n\t* or methods that determine contextually appropriate config like `getActiveConfigForManager` (for manager use)\n\t* or ensure `activeWagmiConfig` is set before calling wagmi actions.\n\t* This method returns the internally cached default config or the active one if set.\n\t*\n\t* @returns The current default or active Wagmi Config object.\n\t*/\n\tgetConfig() {\n\t\tlogger.warn(this.logSystem, \"getConfig() is deprecated. Internal calls should use activeWagmiConfig if set, or ensure default is created.\");\n\t\tif (this.activeWagmiConfig) return this.activeWagmiConfig;\n\t\tif (!this.defaultInstanceConfig) this.defaultInstanceConfig = this.createDefaultConfig();\n\t\treturn this.defaultInstanceConfig;\n\t}\n\t/**\n\t* Gets the current wallet connection status (isConnected, address, chainId, etc.).\n\t* This is a synchronous operation and uses the `activeWagmiConfig` if set by `UiKitManager`,\n\t* otherwise falls back to the default instance config (created on demand).\n\t*\n\t* @returns The current account status from Wagmi.\n\t*/\n\tgetWalletConnectionStatus() {\n\t\tlogger.debug(this.logSystem, \"getWalletConnectionStatus called.\");\n\t\tconst configToUse = this.activeWagmiConfig || this.defaultInstanceConfig || (this.defaultInstanceConfig = this.createDefaultConfig());\n\t\tif (!configToUse) {\n\t\t\tlogger.error(this.logSystem, \"No config available for getWalletConnectionStatus!\");\n\t\t\treturn {\n\t\t\t\tisConnected: false,\n\t\t\t\tisConnecting: false,\n\t\t\t\tisDisconnected: true,\n\t\t\t\tisReconnecting: false,\n\t\t\t\tstatus: \"disconnected\",\n\t\t\t\taddress: void 0,\n\t\t\t\taddresses: void 0,\n\t\t\t\tchainId: void 0,\n\t\t\t\tchain: void 0,\n\t\t\t\tconnector: void 0\n\t\t\t};\n\t\t}\n\t\treturn getAccount(configToUse);\n\t}\n\t/**\n\t* Subscribes to account and connection status changes from Wagmi.\n\t* The subscription is bound to the `activeWagmiConfig` if available at the time of call,\n\t* otherwise to the default instance config.\n\t*\n\t* @param callback - Function to call when connection status changes.\n\t* @returns A function to unsubscribe from the changes.\n\t*/\n\tonWalletConnectionChange(callback) {\n\t\tif (!this.initialized) {\n\t\t\tlogger.warn(this.logSystem, \"onWalletConnectionChange called before initialization. No-op.\");\n\t\t\treturn () => {};\n\t\t}\n\t\tif (this.unsubscribe) {\n\t\t\tthis.unsubscribe();\n\t\t\tlogger.debug(this.logSystem, \"Previous watchAccount unsubscribed.\");\n\t\t}\n\t\tconst configToUse = this.activeWagmiConfig || this.defaultInstanceConfig || (this.defaultInstanceConfig = this.createDefaultConfig());\n\t\tif (!configToUse) {\n\t\t\tlogger.error(this.logSystem, \"No config available for onWalletConnectionChange! Subscription not set.\");\n\t\t\treturn () => {};\n\t\t}\n\t\tthis.unsubscribe = watchAccount(configToUse, { onChange: callback });\n\t\tlogger.info(this.logSystem, \"watchAccount subscription established/re-established using config:\", configToUse === this.activeWagmiConfig ? \"activeExternal\" : \"defaultInstance\");\n\t\treturn this.unsubscribe;\n\t}\n\t/**\n\t* Gets the Viem Wallet Client for the currently connected account and chain.\n\t*\n\t* @returns A Promise resolving to the Viem WalletClient or null if not connected.\n\t*/\n\tasync getWalletClient() {\n\t\tif (!this.initialized || !this.activeWagmiConfig) {\n\t\t\tlogger.warn(this.logSystem, \"getWalletClient: Not initialized or no activeWagmiConfig. Returning null.\");\n\t\t\treturn null;\n\t\t}\n\t\tconst accountStatus = getAccount(this.activeWagmiConfig);\n\t\tif (!accountStatus.isConnected || !accountStatus.chainId || !accountStatus.address) return null;\n\t\treturn getWalletClient(this.activeWagmiConfig, {\n\t\t\tchainId: accountStatus.chainId,\n\t\t\taccount: accountStatus.address\n\t\t});\n\t}\n\t/**\n\t* Gets the Viem Public Client for the currently connected chain.\n\t*\n\t* @returns A Promise resolving to the Viem PublicClient or null.\n\t*/\n\tasync getPublicClient() {\n\t\tif (!this.initialized || !this.activeWagmiConfig) {\n\t\t\tlogger.warn(this.logSystem, \"getPublicClient: Not initialized or no activeWagmiConfig. Returning null.\");\n\t\t\treturn null;\n\t\t}\n\t\tconst currentChainId = getAccount(this.activeWagmiConfig).chainId;\n\t\tif (!currentChainId) {\n\t\t\tlogger.warn(this.logSystem, \"getPublicClient: No connected chainId available from accountStatus. Returning null.\");\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\tconst publicClient = getPublicClient(this.activeWagmiConfig, { chainId: currentChainId });\n\t\t\tif (publicClient) {\n\t\t\t\tlogger.info(this.logSystem, `getPublicClient: Successfully retrieved public client for chainId ${currentChainId}.`);\n\t\t\t\treturn publicClient;\n\t\t\t}\n\t\t\tlogger.warn(this.logSystem, `getPublicClient: getWagmiCorePublicClient returned undefined/null for chainId ${currentChainId}.`);\n\t\t\treturn null;\n\t\t} catch (error) {\n\t\t\tlogger.error(this.logSystem, \"Error getting public client from wagmi/core:\", error);\n\t\t\treturn null;\n\t\t}\n\t}\n\t/**\n\t* Gets the list of available wallet connectors from the active Wagmi config.\n\t*\n\t* @returns A Promise resolving to an array of available connectors.\n\t*/\n\tasync getAvailableConnectors() {\n\t\tif (!this.initialized || !this.activeWagmiConfig) return [];\n\t\treturn this.activeWagmiConfig.connectors.map((co) => ({\n\t\t\tid: co.uid,\n\t\t\tname: co.name\n\t\t}));\n\t}\n\t/**\n\t* Initiates the connection process for a specific connector.\n\t*\n\t* @param connectorId - The ID of the connector to use.\n\t* @returns A Promise with connection result including address and chainId if successful.\n\t*/\n\tasync connect(connectorId) {\n\t\tif (!this.initialized || !this.activeWagmiConfig) throw new Error(\"Wallet not initialized or no active config\");\n\t\tconst connectorToUse = this.activeWagmiConfig.connectors.find((cn$1) => cn$1.id === connectorId || cn$1.uid === connectorId);\n\t\tif (!connectorToUse) throw new Error(`Connector ${connectorId} not found`);\n\t\tconst res = await connect(this.activeWagmiConfig, { connector: connectorToUse });\n\t\treturn {\n\t\t\tconnected: true,\n\t\t\taddress: res.accounts[0],\n\t\t\tchainId: res.chainId\n\t\t};\n\t}\n\t/**\n\t* Disconnects the currently connected wallet.\n\t*\n\t* @returns A Promise with disconnection result.\n\t*/\n\tasync disconnect() {\n\t\tif (!this.initialized || !this.activeWagmiConfig) return {\n\t\t\tdisconnected: false,\n\t\t\terror: \"Wallet not initialized or no active config\"\n\t\t};\n\t\tawait disconnect(this.activeWagmiConfig);\n\t\treturn { disconnected: true };\n\t}\n\t/**\n\t* Prompts the user to switch to the specified network.\n\t*\n\t* @param chainId - The target chain ID to switch to.\n\t* @returns A Promise that resolves if the switch is successful, or rejects with an error.\n\t*/\n\tasync switchNetwork(chainId) {\n\t\tif (!this.initialized || !this.activeWagmiConfig) throw new Error(\"Wallet not initialized or no active config\");\n\t\tawait switchChain(this.activeWagmiConfig, { chainId });\n\t}\n};\n\n//#endregion\n//#region src/wallet/rainbowkit/config-generator.ts\nconst DEFAULT_OPTIONS = {\n\tdefaultAppName: \"My RainbowKit App\",\n\theaderComment: `// RainbowKit configuration for your exported application\n// This file is used ONLY in the exported app, not in the builder app preview`\n};\n/**\n* Generates the content for a `rainbowkit.config.ts` file for an exported project.\n* It merges the user-provided configuration with the necessary boilerplate to ensure\n* the config is valid for RainbowKit's `getDefaultConfig`.\n*\n* @param userConfig - The user-provided configuration from the builder app.\n* @param options - Optional customization for the generated file.\n* @returns A string containing the formatted TypeScript code for the config file.\n*/\nfunction generateRainbowKitConfigFile(userConfig, options = {}) {\n\tconst opts = {\n\t\t...DEFAULT_OPTIONS,\n\t\t...options\n\t};\n\tconst config = userConfig || {};\n\tconst appName = config.appName || opts.defaultAppName;\n\tconst learnMoreUrl = config.learnMoreUrl || \"https://openzeppelin.com\";\n\tconst projectId = \"WALLETCONNECT_REMOVED\";\n\tconst appInfoLines = [`appName: '${appName}'`];\n\tif (learnMoreUrl) appInfoLines.push(`learnMoreUrl: '${learnMoreUrl}'`);\n\tconst appInfoContent = appInfoLines.join(\",\\n      \");\n\treturn `${opts.headerComment}\n\n// Uncomment imports as needed:\n// import { darkTheme, lightTheme } from '@rainbow-me/rainbowkit';\nimport { injectedWallet, safeWallet } from '@rainbow-me/rainbowkit/wallets';\n\nconst rainbowKitAppConfig = {\n  wagmiParams: {\n    appName: '${appName}',\n    // RainbowKit requires this field, but WalletConnect support was removed, so it\n    // is a placeholder and no WalletConnect session is ever opened.\n    projectId: '${projectId}',\n\n    // Pinned to connectors that do not use WalletConnect. injectedWallet covers\n    // every EIP-1193 browser extension (MetaMask, Rabby, Coinbase extension, ...)\n    // and safeWallet covers the Safe app context. Adding WalletConnect-backed\n    // wallets here would reintroduce @reown/appkit and its Community Licence.\n    wallets: [{ groupName: 'Wallets', wallets: [injectedWallet, safeWallet] }],\n\n    // Additional options:\n    // ssr: true,\n  },\n  providerProps: {\n    appInfo: {\n      ${appInfoContent}\n    },\n    \n    // UI customization - all features work in exported apps:\n    // theme: darkTheme(),\n    // modalSize: 'compact',\n    // showRecentTransactions: true,\n    // coolMode: true,\n  },\n};\n\nexport default rainbowKitAppConfig;`;\n}\n/**\n* Generates the specific configuration file for RainbowKit during project export.\n*\n* @param uiKitConfig The full UI kit configuration object from the builder.\n* @param options - Optional customization for the generated file.\n* @returns A record containing the file path and its generated content.\n*/\nfunction generateRainbowKitExportables(uiKitConfig, options = {}) {\n\tconst filePath = \"src/config/wallet/rainbowkit.config.ts\";\n\tconst content = uiKitConfig.customCode || generateRainbowKitConfigFile(uiKitConfig.kitConfig, options);\n\treturn { [filePath]: content };\n}\n\n//#endregion\n//#region src/wallet/rainbowkit/types.ts\n/**\n* Type guard to check if an object contains RainbowKit customizations\n*/\nfunction isRainbowKitCustomizations(obj) {\n\treturn typeof obj === \"object\" && obj !== null && \"connectButton\" in obj;\n}\n/**\n* Utility to extract RainbowKit customizations from a kit config\n*/\nfunction extractRainbowKitCustomizations(kitConfig) {\n\tif (!kitConfig || !kitConfig.customizations) return;\n\tconst customizations = kitConfig.customizations;\n\treturn isRainbowKitCustomizations(customizations) ? customizations : void 0;\n}\n\n//#endregion\n//#region src/wallet/rainbowkit/utils.ts\n/**\n* RainbowKit configuration options definition\n*/\n/**\n* Validates the RainbowKit configuration to ensure required fields are present.\n*\n* @param kitConfig - The RainbowKit configuration object\n* @returns Object containing the validation result and any missing fields or error message\n*/\nfunction validateRainbowKitConfig(kitConfig) {\n\tlogger.debug(\"validateRainbowKitConfig\", \"Received kitConfig for validation:\", JSON.stringify(kitConfig));\n\tif (!kitConfig) {\n\t\tlogger.warn(\"validateRainbowKitConfig\", \"Validation failed: No kitConfig provided.\");\n\t\treturn {\n\t\t\tisValid: false,\n\t\t\terror: \"No kitConfig provided for RainbowKit\"\n\t\t};\n\t}\n\tconst wagmiParamsFromKitConfig = kitConfig.wagmiParams;\n\tif (!wagmiParamsFromKitConfig || typeof wagmiParamsFromKitConfig !== \"object\" || wagmiParamsFromKitConfig === null) {\n\t\tlogger.warn(\"validateRainbowKitConfig\", \"Validation failed: kitConfig.wagmiParams is missing or invalid.\", { wagmiParamsFromKitConfig });\n\t\treturn {\n\t\t\tisValid: false,\n\t\t\terror: \"kitConfig.wagmiParams is missing or not a valid object\"\n\t\t};\n\t}\n\tconst missingFields = [];\n\tif (!(\"appName\" in wagmiParamsFromKitConfig) || typeof wagmiParamsFromKitConfig.appName !== \"string\") missingFields.push(\"wagmiParams.appName\");\n\tif (!(\"projectId\" in wagmiParamsFromKitConfig) || typeof wagmiParamsFromKitConfig.projectId !== \"string\") missingFields.push(\"wagmiParams.projectId\");\n\tif (missingFields.length > 0) {\n\t\tconst errorMsg = `Missing or invalid required fields in wagmiParams: ${missingFields.join(\", \")}`;\n\t\tlogger.warn(\"validateRainbowKitConfig\", \"Validation failed:\", errorMsg, { missingFields });\n\t\treturn {\n\t\t\tisValid: false,\n\t\t\tmissingFields,\n\t\t\terror: errorMsg\n\t\t};\n\t}\n\tlogger.debug(\"validateRainbowKitConfig\", \"Validation successful.\");\n\treturn { isValid: true };\n}\n/**\n* Extracts and type-guards a RainbowKit configuration from a UiKitConfiguration\n*\n* @param config The UI kit configuration\n* @returns The raw kitConfig Record<string, unknown> or undefined.\n*/\nfunction getRawUserNativeConfig(config) {\n\tif (config.kitName !== \"rainbowkit\" || !config.kitConfig) return;\n\tif (typeof config.kitConfig === \"object\" && config.kitConfig !== null) return config.kitConfig;\n\tlogger.warn(\"rainbowkit/utils\", \"kitConfig for RainbowKit is not a valid object.\");\n}\n\n//#endregion\n//#region src/wallet/rainbowkit/components.tsx\nconst MIN_COMPONENT_LOADING_DISPLAY_MS = 1e3;\n/**\n* Creates a RainbowKitConnectButton component that uses the provided UI kit manager.\n* This factory pattern allows adapters to inject their specific UI kit manager instance.\n*\n* @param uiKitManager - The UI kit manager instance to use for state management\n* @returns A React component that renders the RainbowKit ConnectButton\n*\n* @example\n* ```typescript\n* // In adapter-evm:\n* import { createRainbowKitConnectButton } from '@openzeppelin/adapter-evm-core';\n* import { evmUiKitManager } from './evmUiKitManager';\n*\n* export const RainbowKitConnectButton = createRainbowKitConnectButton(evmUiKitManager);\n*\n* // In adapter-polkadot:\n* import { createRainbowKitConnectButton } from '@openzeppelin/adapter-evm-core';\n* import { polkadotUiKitManager } from './polkadotUiKitManager';\n*\n* export const RainbowKitConnectButton = createRainbowKitConnectButton(polkadotUiKitManager);\n* ```\n*/\nfunction createRainbowKitConnectButton(uiKitManager) {\n\tconst RainbowKitConnectButtonComponent = (props) => {\n\t\tconst [Component, setComponent] = useState(null);\n\t\tconst [error, setError] = useState(null);\n\t\tconst [isLoadingComponent, setIsLoadingComponent] = useState(true);\n\t\tconst [showComponentLoadingOverride, setShowComponentLoadingOverride] = useState(false);\n\t\tconst componentLoadingTimerRef = useRef(null);\n\t\tconst [managerState, setManagerState] = useState(uiKitManager.getState());\n\t\tconst isWagmiProviderReady = useContext(WagmiProviderInitializedContext);\n\t\tuseEffect(() => {\n\t\t\treturn uiKitManager.subscribe(() => {\n\t\t\t\tsetManagerState(uiKitManager.getState());\n\t\t\t});\n\t\t}, []);\n\t\tuseEffect(() => {\n\t\t\tlet isMounted = true;\n\t\t\tsetIsLoadingComponent(true);\n\t\t\tsetShowComponentLoadingOverride(true);\n\t\t\tif (componentLoadingTimerRef.current) clearTimeout(componentLoadingTimerRef.current);\n\t\t\tcomponentLoadingTimerRef.current = setTimeout(() => {\n\t\t\t\tif (isMounted) setShowComponentLoadingOverride(false);\n\t\t\t\tcomponentLoadingTimerRef.current = null;\n\t\t\t}, MIN_COMPONENT_LOADING_DISPLAY_MS);\n\t\t\tconst loadComponent = async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst rainbowKit = await import(\"@rainbow-me/rainbowkit\");\n\t\t\t\t\tif (isMounted) {\n\t\t\t\t\t\tsetComponent(() => rainbowKit.ConnectButton);\n\t\t\t\t\t\tsetIsLoadingComponent(false);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (isMounted) {\n\t\t\t\t\t\tsetError(err instanceof Error ? err : new Error(String(err)));\n\t\t\t\t\t\tsetIsLoadingComponent(false);\n\t\t\t\t\t\tlogger.error(\"RainbowKitConnectButton\", \"Failed to load RainbowKit ConnectButton:\", err);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tloadComponent();\n\t\t\treturn () => {\n\t\t\t\tisMounted = false;\n\t\t\t\tif (componentLoadingTimerRef.current) clearTimeout(componentLoadingTimerRef.current);\n\t\t\t};\n\t\t}, []);\n\t\tconst sizeProps = getWalletButtonSizeProps(props.size);\n\t\tconst renderLoadingPlaceholder = (message) => /* @__PURE__ */ jsxs(Button, {\n\t\t\tdisabled: true,\n\t\t\tvariant: props.variant || \"outline\",\n\t\t\tsize: sizeProps.size,\n\t\t\tclassName: cn(sizeProps.className, props.fullWidth && \"w-full\", props.className),\n\t\t\tchildren: [/* @__PURE__ */ jsx(Loader2, { className: cn(sizeProps.iconSize, \"animate-spin mr-1.5\") }), message]\n\t\t});\n\t\tif (error) {\n\t\t\tlogger.warn(\"RainbowKitConnectButton\", \"Error loading RainbowKit ConnectButton. Displaying fallback CustomConnectButton.\");\n\t\t\treturn /* @__PURE__ */ jsx(CustomConnectButton, { ...props });\n\t\t}\n\t\tif (isLoadingComponent || showComponentLoadingOverride) return renderLoadingPlaceholder(\"Loading Wallet...\");\n\t\tif (!isWagmiProviderReady) return renderLoadingPlaceholder(\"Initializing Provider...\");\n\t\tif (!Component) {\n\t\t\tlogger.warn(\"RainbowKitConnectButton\", \"Component is null after loading phase, falling back.\");\n\t\t\treturn /* @__PURE__ */ jsx(CustomConnectButton, { ...props });\n\t\t}\n\t\tconst kitConfig = managerState.currentFullUiKitConfig?.kitConfig;\n\t\tconst connectButtonConfig = extractRainbowKitCustomizations(kitConfig)?.connectButton;\n\t\tconst finalProps = {\n\t\t\t...connectButtonConfig,\n\t\t\t...props\n\t\t};\n\t\tlogger.debug(\"RainbowKitConnectButton\", \"Rendering with configuration:\", {\n\t\t\tconfigFromFile: connectButtonConfig,\n\t\t\tfinalProps\n\t\t});\n\t\treturn /* @__PURE__ */ jsx(Component, { ...finalProps });\n\t};\n\tRainbowKitConnectButtonComponent.displayName = \"RainbowKitConnectButton\";\n\treturn RainbowKitConnectButtonComponent;\n}\n\n//#endregion\n//#region src/wallet/rainbowkit/componentFactory.ts\n/**\n* Creates the complete set of RainbowKit wallet components.\n*\n* This factory function accepts a RainbowKitConnectButton component that has been\n* created with an adapter-specific UI kit manager. This allows different adapters\n* to use their own manager instance while sharing the component creation logic.\n*\n* @param RainbowKitConnectButton - The connect button component created via createRainbowKitConnectButton\n* @returns An object containing all RainbowKit wallet components\n*\n* @example\n* ```typescript\n* // In adapter-evm:\n* import { createRainbowKitConnectButton, createRainbowKitComponents } from '@openzeppelin/adapter-evm-core';\n* import { evmUiKitManager } from './evmUiKitManager';\n*\n* const RainbowKitConnectButton = createRainbowKitConnectButton(evmUiKitManager);\n* const components = createRainbowKitComponents(RainbowKitConnectButton);\n*\n* // In adapter-polkadot:\n* import { createRainbowKitConnectButton, createRainbowKitComponents } from '@openzeppelin/adapter-evm-core';\n* import { polkadotUiKitManager } from './polkadotUiKitManager';\n*\n* const RainbowKitConnectButton = createRainbowKitConnectButton(polkadotUiKitManager);\n* const components = createRainbowKitComponents(RainbowKitConnectButton);\n* ```\n*/\nfunction createRainbowKitComponents(RainbowKitConnectButton) {\n\treturn { ConnectButton: RainbowKitConnectButton };\n}\n\n//#endregion\n//#region src/wallet/rainbowkit/config-service.ts\n/**\n* RainbowKit Config Service\n*\n* Creates Wagmi configuration for RainbowKit. This is shared between\n* EVM and Polkadot adapters to avoid code duplication.\n*/\nconst LOG_PREFIX$2 = \"rainbowkit/config-service\";\n/**\n* Creates a Wagmi configuration for RainbowKit using getDefaultConfig\n*\n* @param userFullNativeConfig The full native configuration object. This object IS the result of merging\n*                             AppConfigService settings, user's native rainbowkit.config.ts, and programmatic overrides.\n*                             It is expected to contain a `wagmiParams` object for RainbowKit's getDefaultConfig\n*                             and potentially a `providerProps` object for RainbowKitProvider.\n*                             Only `appName` is required. `projectId` is supplied by this\n*                             adapter as a placeholder and any user-provided value is\n*                             ignored, because WalletConnect support was removed.\n* @param chains Array of viem Chain objects - will be safely cast to wagmi's expected chain type\n* @param chainIdToNetworkIdMap Mapping of chain IDs to network IDs for RPC override lookups\n* @param getRpcEndpointOverride Function to get RPC endpoint overrides\n* @returns Wagmi configuration for RainbowKit or null if creation fails\n*/\nasync function createRainbowKitWagmiConfig(userFullNativeConfig, chains, chainIdToNetworkIdMap, getRpcEndpointOverride) {\n\ttry {\n\t\tconst { getDefaultConfig } = await import(\"@rainbow-me/rainbowkit\");\n\t\tconst { injectedWallet, safeWallet } = await import(\"@rainbow-me/rainbowkit/wallets\");\n\t\tif (!getDefaultConfig) {\n\t\t\tlogger.error(LOG_PREFIX$2, \"Failed to import getDefaultConfig from RainbowKit\");\n\t\t\treturn null;\n\t\t}\n\t\tconst wagmiParams = userFullNativeConfig?.wagmiParams;\n\t\tif (!wagmiParams) {\n\t\t\tlogger.warn(LOG_PREFIX$2, \"Resolved kitConfig does not contain a `wagmiParams` object. Cannot create RainbowKit Wagmi config.\");\n\t\t\treturn null;\n\t\t}\n\t\tif (typeof wagmiParams.appName !== \"string\" || !wagmiParams.appName) {\n\t\t\tlogger.warn(LOG_PREFIX$2, \"kitConfig.wagmiParams is missing or has invalid `appName`.\");\n\t\t\treturn null;\n\t\t}\n\t\tconst transportsConfig = chains.reduce((acc, chainDefinition) => {\n\t\t\tlet rpcUrlToUse = chainDefinition.rpcUrls.default?.http?.[0];\n\t\t\tconst appNetworkIdString = chainIdToNetworkIdMap[chainDefinition.id];\n\t\t\tif (appNetworkIdString) {\n\t\t\t\tconst rpcOverrideSetting = getRpcEndpointOverride(appNetworkIdString);\n\t\t\t\tlet httpRpcOverride;\n\t\t\t\tif (typeof rpcOverrideSetting === \"string\") httpRpcOverride = rpcOverrideSetting;\n\t\t\t\telse if (typeof rpcOverrideSetting === \"object\" && rpcOverrideSetting) {\n\t\t\t\t\tif (\"http\" in rpcOverrideSetting && rpcOverrideSetting.http) httpRpcOverride = rpcOverrideSetting.http;\n\t\t\t\t\telse if (\"url\" in rpcOverrideSetting && rpcOverrideSetting.url) httpRpcOverride = rpcOverrideSetting.url;\n\t\t\t\t}\n\t\t\t\tif (httpRpcOverride) {\n\t\t\t\t\tlogger.info(LOG_PREFIX$2, `Using overridden RPC for chain ${chainDefinition.name}: ${httpRpcOverride}`);\n\t\t\t\t\trpcUrlToUse = httpRpcOverride;\n\t\t\t\t}\n\t\t\t}\n\t\t\tacc[chainDefinition.id] = http$1(rpcUrlToUse);\n\t\t\treturn acc;\n\t\t}, {});\n\t\tconst walletConnectFreeWallets = [{\n\t\t\tgroupName: \"Wallets\",\n\t\t\twallets: [injectedWallet, safeWallet]\n\t\t}];\n\t\tconst config = getDefaultConfig({\n\t\t\t...wagmiParams,\n\t\t\twallets: wagmiParams.wallets ?? walletConnectFreeWallets,\n\t\t\tprojectId: \"WALLETCONNECT_REMOVED\",\n\t\t\tchains,\n\t\t\ttransports: transportsConfig\n\t\t});\n\t\tlogger.info(LOG_PREFIX$2, \"Successfully created RainbowKit Wagmi config object.\", config);\n\t\treturn config;\n\t} catch (error) {\n\t\tlogger.error(LOG_PREFIX$2, \"Error creating RainbowKit Wagmi config:\", error);\n\t\treturn null;\n\t}\n}\n/**\n* Gets the Wagmi configuration for RainbowKit based on the global UI kit settings.\n* This function is intended to be called by WagmiWalletImplementation.\n*\n* @param uiKitConfiguration The UI kit configuration object from UiKitManager (contains the resolved kitConfig).\n* @param chains Array of viem Chain objects to use with RainbowKit\n* @param chainIdToNetworkIdMap Mapping of chain IDs to network IDs for RPC override lookups\n* @param getRpcEndpointOverride Function to get RPC endpoint overrides\n* @returns The wagmi Config object or null if invalid or not RainbowKit\n*/\nasync function getWagmiConfigForRainbowKit(uiKitConfiguration, chains, chainIdToNetworkIdMap, getRpcEndpointOverride) {\n\tif (!uiKitConfiguration || uiKitConfiguration.kitName !== \"rainbowkit\" || !uiKitConfiguration.kitConfig) {\n\t\tlogger.debug(LOG_PREFIX$2, \"Not configured for RainbowKit or kitConfig (resolved native + programmatic) is missing.\");\n\t\treturn null;\n\t}\n\tconst resolvedKitConfig = uiKitConfiguration.kitConfig;\n\treturn createRainbowKitWagmiConfig(resolvedKitConfig, chains, chainIdToNetworkIdMap, getRpcEndpointOverride);\n}\n\n//#endregion\n//#region src/wallet/uiKitManager.ts\n/**\n* Creates a UI Kit Manager instance with the provided dependencies.\n*\n* @param deps - The dependencies for the UI Kit Manager\n* @returns A UI Kit Manager instance with getState, subscribe, and configure methods\n*\n* @example\n* ```typescript\n* // In adapter-evm:\n* const evmUiKitManager = createUiKitManager({\n*   getWalletImplementation: getEvmWalletImplementation,\n*   loadRainbowKitAssets: async () => {\n*     const { ensureRainbowKitAssetsLoaded } = await import('./rainbowkit/rainbowkitAssetManager');\n*     return ensureRainbowKitAssetsLoaded();\n*   },\n*   logPrefix: 'EvmUiKitManager',\n* });\n*\n* // In adapter-polkadot:\n* const polkadotUiKitManager = createUiKitManager({\n*   getWalletImplementation: () => getPolkadotWalletImplementation(),\n*   loadRainbowKitAssets: async () => {\n*     const { ensureRainbowKitAssetsLoaded } = await import('./rainbowkit/rainbowkitAssetManager');\n*     return ensureRainbowKitAssetsLoaded();\n*   },\n*   logPrefix: 'PolkadotUiKitManager',\n* });\n* ```\n*/\nfunction createUiKitManager(deps) {\n\tconst { getWalletImplementation, loadRainbowKitAssets, logPrefix } = deps;\n\tlet state = {\n\t\tcurrentFullUiKitConfig: null,\n\t\twagmiConfig: null,\n\t\tkitProviderComponent: null,\n\t\tisKitAssetsLoaded: false,\n\t\tisInitializing: false,\n\t\terror: null\n\t};\n\tconst listeners = /* @__PURE__ */ new Set();\n\tfunction notifyListeners() {\n\t\tlisteners.forEach((listener) => {\n\t\t\ttry {\n\t\t\t\tlistener();\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error(logPrefix, \"Error in listener:\", error);\n\t\t\t}\n\t\t});\n\t}\n\tfunction subscribe(listener) {\n\t\tlisteners.add(listener);\n\t\treturn () => {\n\t\t\tlisteners.delete(listener);\n\t\t};\n\t}\n\tfunction getState() {\n\t\treturn { ...state };\n\t}\n\tasync function configure(newFullUiKitConfig) {\n\t\tlogger.info(`${logPrefix}:configure`, \"Configuring UI kit. New config:\", newFullUiKitConfig);\n\t\tconst oldKitName = state.currentFullUiKitConfig?.kitName;\n\t\tconst newKitName = newFullUiKitConfig.kitName;\n\t\tconst kitChanged = oldKitName !== newKitName;\n\t\tstate = {\n\t\t\t...state,\n\t\t\tisInitializing: true,\n\t\t\terror: null,\n\t\t\tcurrentFullUiKitConfig: newFullUiKitConfig,\n\t\t\tkitProviderComponent: kitChanged ? null : state.kitProviderComponent,\n\t\t\tisKitAssetsLoaded: kitChanged ? false : state.isKitAssetsLoaded\n\t\t};\n\t\tnotifyListeners();\n\t\tlet newWagmiConfigAttempt = null;\n\t\tconst walletImpl = await Promise.resolve(getWalletImplementation());\n\t\ttry {\n\t\t\tif (newKitName === \"rainbowkit\") {\n\t\t\t\tif (kitChanged || !state.kitProviderComponent || !state.isKitAssetsLoaded) {\n\t\t\t\t\tlogger.info(`${logPrefix}:configure`, \"Ensuring RainbowKit assets are loaded...\");\n\t\t\t\t\tconst rkAssets = await loadRainbowKitAssets();\n\t\t\t\t\tstate.kitProviderComponent = rkAssets.ProviderComponent;\n\t\t\t\t\tstate.isKitAssetsLoaded = rkAssets.cssLoaded && !!rkAssets.ProviderComponent;\n\t\t\t\t\tif (!state.isKitAssetsLoaded) throw new Error(\"Failed to load critical RainbowKit assets.\");\n\t\t\t\t}\n\t\t\t\tnewWagmiConfigAttempt = await walletImpl.getConfigForRainbowKit(newFullUiKitConfig);\n\t\t\t\tlogger.info(`${logPrefix}:configure`, \"WagmiConfig for RainbowKit obtained.\");\n\t\t\t} else if (newKitName === \"custom\" || !newKitName) {\n\t\t\t\tnewWagmiConfigAttempt = await walletImpl.getActiveConfigForManager(newFullUiKitConfig);\n\t\t\t\tlogger.info(`${logPrefix}:configure`, \"ActiveConfig for custom/default obtained.\");\n\t\t\t\tif (kitChanged) {\n\t\t\t\t\tstate.kitProviderComponent = null;\n\t\t\t\t\tstate.isKitAssetsLoaded = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogger.warn(`${logPrefix}:configure`, `Unsupported kitName: ${newKitName}.`);\n\t\t\t\tstate.kitProviderComponent = null;\n\t\t\t\tstate.isKitAssetsLoaded = false;\n\t\t\t}\n\t\t\tstate.wagmiConfig = newWagmiConfigAttempt;\n\t\t\twalletImpl.setActiveWagmiConfig(state.wagmiConfig);\n\t\t\tstate.error = null;\n\t\t\tif (!newWagmiConfigAttempt && newKitName && newKitName !== \"none\" && newKitName !== \"custom\") {\n\t\t\t\tstate.error = /* @__PURE__ */ new Error(`Failed to obtain WagmiConfig for ${newKitName}`);\n\t\t\t\tlogger.error(`${logPrefix}:configure`, state.error.message);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tlogger.error(`${logPrefix}:configure`, \"Error during UI kit configuration process:\", err);\n\t\t\tstate.error = err instanceof Error ? err : new Error(String(err));\n\t\t\tstate.wagmiConfig = null;\n\t\t\twalletImpl.setActiveWagmiConfig(null);\n\t\t} finally {\n\t\t\tstate.isInitializing = false;\n\t\t\tlogger.info(`${logPrefix}:configure`, \"Configuration attempt finished. Final wagmiConfig:\", state.wagmiConfig ? \"Set\" : \"Null\", \"Kit Provider Component:\", state.kitProviderComponent ? \"Set\" : \"Null\", \"Kit Assets Loaded:\", state.isKitAssetsLoaded, \"Error state:\", state.error ? state.error.message : \"None\");\n\t\t\tnotifyListeners();\n\t\t}\n\t}\n\treturn {\n\t\tgetState,\n\t\tsubscribe,\n\t\tconfigure\n\t};\n}\n\n//#endregion\n//#region src/wallet/rainbowkitAssetManager.ts\nlet loadedAssets = null;\nlet providerPromise = null;\nlet cssPromise = null;\nconst LOG_PREFIX$1 = \"RainbowKitAssetManager\";\n/**\n* Ensures RainbowKit provider component and CSS are loaded.\n* Loads them dynamically only once and caches the result.\n*\n* @returns A promise resolving to an object containing the ProviderComponent and cssLoaded status.\n*/\nasync function ensureRainbowKitAssetsLoaded() {\n\tif (loadedAssets) {\n\t\tlogger.debug(LOG_PREFIX$1, \"Assets already loaded, returning cached.\");\n\t\treturn loadedAssets;\n\t}\n\tif (!providerPromise) providerPromise = import(\"@rainbow-me/rainbowkit\").then((module) => {\n\t\tconst component = module.RainbowKitProvider;\n\t\tlogger.info(LOG_PREFIX$1, \"RainbowKitProvider module loaded.\");\n\t\treturn component;\n\t}).catch((err) => {\n\t\tlogger.error(LOG_PREFIX$1, \"Failed to load RainbowKitProvider module:\", err);\n\t\treturn null;\n\t});\n\tif (!cssPromise) cssPromise = import(\"@rainbow-me/rainbowkit/styles.css\").then(() => {\n\t\tlogger.info(LOG_PREFIX$1, \"RainbowKit CSS loaded successfully.\");\n\t\treturn true;\n\t}).catch((err) => {\n\t\tlogger.error(LOG_PREFIX$1, \"Failed to load RainbowKit CSS:\", err);\n\t\treturn false;\n\t});\n\ttry {\n\t\tconst [ProviderComponent, cssLoadedSuccess] = await Promise.all([providerPromise, cssPromise]);\n\t\tloadedAssets = {\n\t\t\tProviderComponent,\n\t\t\tcssLoaded: cssLoadedSuccess\n\t\t};\n\t\tif (!ProviderComponent || !cssLoadedSuccess) logger.warn(LOG_PREFIX$1, \"One or more RainbowKit assets failed to load.\", loadedAssets);\n\t\treturn loadedAssets;\n\t} catch (error) {\n\t\tlogger.error(LOG_PREFIX$1, \"Error in Promise.all for asset loading:\", error);\n\t\tloadedAssets = {\n\t\t\tProviderComponent: null,\n\t\t\tcssLoaded: false\n\t\t};\n\t\treturn loadedAssets;\n\t}\n}\n\n//#endregion\n//#region src/wallet/configResolution.ts\nconst LOG_PREFIX = \"ConfigResolutionService\";\n/**\n* Resolves and initializes the kit-specific configuration.\n* This function acts as a manager to call the appropriate kit's configuration initializer.\n*\n* @param kitName The name of the UI kit (e.g., 'rainbowkit').\n* @param programmaticKitConfig Optional base/programmatic config passed to the kit initializer.\n* @param loadConfigModule Optional generic callback to load configuration modules by path.\n* @returns A Promise resolving to the final kitConfig (Record<string, unknown>) for the specified kit, or null.\n*/\nasync function resolveAndInitializeKitConfig(kitName, programmaticKitConfig, loadConfigModule) {\n\tlogger.debug(`${LOG_PREFIX}:resolveAndInitializeKitConfig`, `Resolving native config for kit: ${kitName || \"none\"}`, {\n\t\thasProgrammaticKitConfig: !!programmaticKitConfig,\n\t\thasLoadConfigModule: !!loadConfigModule\n\t});\n\tlet userNativeConfig = null;\n\tif (kitName && kitName !== \"custom\" && kitName !== \"none\" && loadConfigModule) {\n\t\tconst conventionalConfigPath = `./config/wallet/${kitName}.config.ts`;\n\t\ttry {\n\t\t\tuserNativeConfig = await loadConfigModule(conventionalConfigPath);\n\t\t} catch (error) {\n\t\t\tlogger.warn(`${LOG_PREFIX}:resolveAndInitializeKitConfig`, `Call to load native config for ${kitName} from ${conventionalConfigPath} failed. Error:`, error);\n\t\t}\n\t}\n\tif (userNativeConfig && programmaticKitConfig) return {\n\t\t...userNativeConfig,\n\t\t...programmaticKitConfig\n\t};\n\telse if (userNativeConfig) return userNativeConfig;\n\telse if (programmaticKitConfig) return programmaticKitConfig;\n\tlogger.debug(`${LOG_PREFIX}:resolveAndInitializeKitConfig`, `No native or programmatic kitConfig provided for ${kitName || \"none\"}. Returning null.`);\n\treturn null;\n}\n/**\n* Resolves the final, complete UiKitConfiguration by merging various sources.\n*\n* @param programmaticOverrides - Overrides passed directly to the configureUiKit call.\n* @param initialAppServiceKitName - The kitName noted from AppConfigService when the adapter instance was constructed.\n* @param currentAppServiceConfig - The full UiKitConfiguration from AppConfigService, re-fetched at the time of the call.\n* @param options - Options, including the callback to load user's native config file.\n* @returns A Promise resolving to the final UiKitConfiguration.\n*/\nasync function resolveFullUiKitConfiguration(programmaticOverrides, initialAppServiceKitName, currentAppServiceConfig, options) {\n\tlogger.debug(`${LOG_PREFIX}:resolveFullUiKitConfiguration`, \"Starting resolution with:\", {\n\t\tprogrammaticOverrides,\n\t\tinitialAppServiceKitName,\n\t\tcurrentAppServiceConfig,\n\t\thasLoadNativeCallback: !!options?.loadUiKitNativeConfig,\n\t\thasCustomCode: !!programmaticOverrides.customCode\n\t});\n\tconst effectiveKitName = programmaticOverrides.kitName || initialAppServiceKitName || currentAppServiceConfig.kitName || \"custom\";\n\tconst resolvedUserNativeAndProgrammaticKitConfig = await resolveAndInitializeKitConfig(effectiveKitName, programmaticOverrides.kitConfig, options?.loadUiKitNativeConfig);\n\tconst finalFullConfig = {\n\t\tkitName: effectiveKitName,\n\t\tkitConfig: {\n\t\t\t...currentAppServiceConfig.kitConfig || {},\n\t\t\t...resolvedUserNativeAndProgrammaticKitConfig || {}\n\t\t},\n\t\tcustomCode: programmaticOverrides.customCode\n\t};\n\tlogger.debug(`${LOG_PREFIX}:resolveFullUiKitConfiguration`, \"Resolved finalFullConfig:\", finalFullConfig);\n\treturn finalFullConfig;\n}\n\n//#endregion\n//#region src/wallet/utils/filterWalletComponents.ts\n/**\n* Filters a set of wallet components based on an exclusion list.\n*\n* @param allPossibleComponents - An object containing all potential components for a kit.\n* @param exclusions - An array of component keys to exclude.\n* @param kitName - The name of the kit being filtered (for logging purposes).\n* @returns The filtered EcosystemWalletComponents object, or undefined if all components are excluded.\n*/\nfunction filterWalletComponents(allPossibleComponents, exclusions, kitName = \"custom\") {\n\tlogger.debug(\"filterWalletComponents\", `Filtering components for kit: ${kitName}. Exclusions: ${exclusions.join(\", \")}.`);\n\tif (!allPossibleComponents || Object.keys(allPossibleComponents).length === 0) {\n\t\tlogger.debug(\"filterWalletComponents\", `No components provided to filter for kit: ${kitName}.`);\n\t\treturn;\n\t}\n\tif (exclusions.length === 0) {\n\t\tlogger.debug(\"filterWalletComponents\", `Providing all components for kit: ${kitName}.`, allPossibleComponents);\n\t\treturn allPossibleComponents;\n\t}\n\tconst filteredComponents = {};\n\tlet componentCount = 0;\n\tfor (const key in allPossibleComponents) {\n\t\tconst componentKey = key;\n\t\tif (!exclusions.includes(componentKey)) {\n\t\t\tif (allPossibleComponents[componentKey]) {\n\t\t\t\tfilteredComponents[componentKey] = allPossibleComponents[componentKey];\n\t\t\t\tcomponentCount++;\n\t\t\t}\n\t\t}\n\t}\n\tif (componentCount > 0) {\n\t\tlogger.debug(\"filterWalletComponents\", `Providing filtered components for kit: ${kitName} after exclusions (${exclusions.join(\", \")}).`, filteredComponents);\n\t\treturn filteredComponents;\n\t}\n\tlogger.debug(\"filterWalletComponents\", `All components were excluded for kit: ${kitName}.`);\n}\n/**\n* Extracts the component exclusion list from a UI kit configuration object.\n*\n* @param kitConfig - The `kitConfig` object from `UiKitConfiguration`.\n* @returns An array of component keys to exclude, or an empty array if none are specified or config is invalid.\n*/\nfunction getComponentExclusionsFromConfig(kitConfig) {\n\tif (kitConfig && typeof kitConfig === \"object\" && \"components\" in kitConfig) {\n\t\tconst componentsCfg = kitConfig.components;\n\t\tif (componentsCfg && typeof componentsCfg === \"object\" && \"exclude\" in componentsCfg && Array.isArray(componentsCfg.exclude)) return componentsCfg.exclude.filter((key) => typeof key === \"string\" && ECOSYSTEM_WALLET_COMPONENT_KEYS.includes(key));\n\t}\n\treturn [];\n}\n\n//#endregion\nexport { ConnectorDialog as C, WagmiProviderInitializedContext as D, useIsWagmiProviderInitialized as E, CustomConnectButton as S, useManagedWagmiDisconnect as T, WagmiWalletImplementation as _, ensureRainbowKitAssetsLoaded as a, CustomNetworkSwitcher as b, getWagmiConfigForRainbowKit as c, getRawUserNativeConfig as d, validateRainbowKitConfig as f, generateRainbowKitExportables as g, generateRainbowKitConfigFile as h, resolveFullUiKitConfiguration as i, createRainbowKitComponents as l, isRainbowKitCustomizations as m, getComponentExclusionsFromConfig as n, createUiKitManager as o, extractRainbowKitCustomizations as p, resolveAndInitializeKitConfig as r, createRainbowKitWagmiConfig as s, filterWalletComponents as t, createRainbowKitConnectButton as u, DEFAULT_DISCONNECTED_STATUS as v, SafeWagmiComponent as w, CustomAccountDisplay as x, connectAndEnsureCorrectNetworkCore as y };\n//# sourceMappingURL=wallet-Cnqn54GJ.mjs.map","import { UnsupportedProfileError } from \"@openzeppelin/ui-types\";\n\n//#region ../adapter-runtime-utils/src/profile-runtime.ts\n/**\n* Minimum capability set required to construct each supported runtime profile.\n* Keeping this map centralized ensures all adapters validate profile composition consistently.\n*/\nconst PROFILE_REQUIREMENTS = {\n\tdeclarative: [\n\t\t\"addressing\",\n\t\t\"explorer\",\n\t\t\"networkCatalog\",\n\t\t\"uiLabels\"\n\t],\n\tviewer: [\n\t\t\"addressing\",\n\t\t\"explorer\",\n\t\t\"networkCatalog\",\n\t\t\"uiLabels\",\n\t\t\"contractLoading\",\n\t\t\"schema\",\n\t\t\"typeMapping\",\n\t\t\"query\"\n\t],\n\ttransactor: [\n\t\t\"addressing\",\n\t\t\"explorer\",\n\t\t\"networkCatalog\",\n\t\t\"uiLabels\",\n\t\t\"contractLoading\",\n\t\t\"schema\",\n\t\t\"typeMapping\",\n\t\t\"execution\",\n\t\t\"wallet\"\n\t],\n\tcomposer: [\n\t\t\"addressing\",\n\t\t\"explorer\",\n\t\t\"networkCatalog\",\n\t\t\"uiLabels\",\n\t\t\"contractLoading\",\n\t\t\"schema\",\n\t\t\"typeMapping\",\n\t\t\"query\",\n\t\t\"execution\",\n\t\t\"wallet\",\n\t\t\"uiKit\",\n\t\t\"relayer\"\n\t],\n\toperator: [\n\t\t\"addressing\",\n\t\t\"explorer\",\n\t\t\"networkCatalog\",\n\t\t\"uiLabels\",\n\t\t\"contractLoading\",\n\t\t\"schema\",\n\t\t\"typeMapping\",\n\t\t\"query\",\n\t\t\"execution\",\n\t\t\"wallet\",\n\t\t\"uiKit\",\n\t\t\"accessControl\"\n\t]\n};\nconst DISPOSABLE_CAPABILITY_KEYS = [\n\t\"contractLoading\",\n\t\"schema\",\n\t\"typeMapping\",\n\t\"query\",\n\t\"execution\",\n\t\"uiKit\",\n\t\"relayer\",\n\t\"accessControl\",\n\t\"wallet\",\n\t\"nameResolution\"\n];\nfunction createRuntimeEventBus() {\n\tconst listeners = /* @__PURE__ */ new Map();\n\treturn {\n\t\temit(event, payload) {\n\t\t\tlisteners.get(event)?.forEach((listener) => listener(payload));\n\t\t},\n\t\tsubscribe(event, listener) {\n\t\t\tconst eventListeners = listeners.get(event) ?? /* @__PURE__ */ new Set();\n\t\t\teventListeners.add(listener);\n\t\t\tlisteners.set(event, eventListeners);\n\t\t\treturn () => {\n\t\t\t\teventListeners.delete(listener);\n\t\t\t\tif (eventListeners.size === 0) listeners.delete(event);\n\t\t\t};\n\t\t},\n\t\tdispose() {\n\t\t\tlisteners.clear();\n\t\t}\n\t};\n}\nfunction createProfileSharedState(config, factories) {\n\tconst capabilityCache = /* @__PURE__ */ new Map();\n\tconst eventBus = createRuntimeEventBus();\n\tconst getCapability = (key) => {\n\t\tif (capabilityCache.has(key)) return capabilityCache.get(key);\n\t\tconst factory = factories[key];\n\t\tif (!factory) throw new Error(`Capability factory \"${String(key)}\" is not defined.`);\n\t\tlet capability;\n\t\tswitch (key) {\n\t\t\tcase \"networkCatalog\":\n\t\t\tcase \"uiLabels\":\n\t\t\t\tcapability = factory();\n\t\t\t\tbreak;\n\t\t\tcase \"addressing\":\n\t\t\tcase \"explorer\":\n\t\t\t\tcapability = factory(config);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcapability = factory(config);\n\t\t\t\tbreak;\n\t\t}\n\t\tcapabilityCache.set(key, capability);\n\t\treturn capability;\n\t};\n\tlet disposed = false;\n\treturn {\n\t\teventBus,\n\t\tgetCapability,\n\t\tdispose() {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\teventBus.dispose();\n\t\t\tfor (const key of DISPOSABLE_CAPABILITY_KEYS) {\n\t\t\t\tconst capability = capabilityCache.get(key);\n\t\t\t\tif (capability && typeof capability === \"object\" && \"dispose\" in capability) capability.dispose();\n\t\t\t}\n\t\t}\n\t};\n}\n/**\n* Narrows arbitrary user or config input to a supported runtime profile name.\n*/\nfunction isProfileName$1(profile) {\n\treturn profile in PROFILE_REQUIREMENTS;\n}\n/**\n* Composes a runtime for a profile from adapter capability factories.\n*\n* Capabilities are instantiated lazily, cached for the lifetime of the runtime,\n* and disposed together when the runtime is torn down.\n*\n* @throws {UnsupportedProfileError} When the adapter does not provide every\n* capability required by the selected profile.\n*/\nfunction createRuntimeFromFactories$1(profile, config, factories, options) {\n\tconst missing = PROFILE_REQUIREMENTS[profile].filter((capability) => !factories[capability]);\n\tif (missing.length > 0) throw new UnsupportedProfileError(profile, missing.map(String));\n\tconst sharedState = createProfileSharedState(config, factories);\n\tconst runtime = {\n\t\tnetworkConfig: config,\n\t\taddressing: sharedState.getCapability(\"addressing\"),\n\t\texplorer: sharedState.getCapability(\"explorer\"),\n\t\tnetworkCatalog: sharedState.getCapability(\"networkCatalog\"),\n\t\tuiLabels: sharedState.getCapability(\"uiLabels\"),\n\t\t...PROFILE_REQUIREMENTS[profile].includes(\"contractLoading\") ? { contractLoading: sharedState.getCapability(\"contractLoading\") } : {},\n\t\t...PROFILE_REQUIREMENTS[profile].includes(\"schema\") ? { schema: sharedState.getCapability(\"schema\") } : {},\n\t\t...PROFILE_REQUIREMENTS[profile].includes(\"typeMapping\") ? { typeMapping: sharedState.getCapability(\"typeMapping\") } : {},\n\t\t...PROFILE_REQUIREMENTS[profile].includes(\"query\") ? { query: sharedState.getCapability(\"query\") } : {},\n\t\t...PROFILE_REQUIREMENTS[profile].includes(\"execution\") ? { execution: sharedState.getCapability(\"execution\") } : {},\n\t\t...PROFILE_REQUIREMENTS[profile].includes(\"wallet\") ? { wallet: sharedState.getCapability(\"wallet\") } : {},\n\t\t...PROFILE_REQUIREMENTS[profile].includes(\"uiKit\") ? { uiKit: sharedState.getCapability(\"uiKit\") } : {},\n\t\t...PROFILE_REQUIREMENTS[profile].includes(\"relayer\") ? { relayer: sharedState.getCapability(\"relayer\") } : {},\n\t\t...PROFILE_REQUIREMENTS[profile].includes(\"accessControl\") ? { accessControl: sharedState.getCapability(\"accessControl\") } : {},\n\t\t...factories.nameResolution ? { nameResolution: sharedState.getCapability(\"nameResolution\") } : {},\n\t\tdispose() {\n\t\t\tsharedState.dispose();\n\t\t}\n\t};\n\tif (options?.uiKit && runtime.uiKit?.configureUiKit) runtime.uiKit.configureUiKit({\n\t\tkitName: options.uiKit,\n\t\tkitConfig: {}\n\t});\n\tsharedState.eventBus.emit(\"runtime:created\", {\n\t\tprofile,\n\t\tnetworkId: config.id\n\t});\n\treturn runtime;\n}\n\n//#endregion\n//#region src/profiles/shared-state.ts\nfunction isProfileName(profile) {\n\treturn isProfileName$1(profile);\n}\nfunction createRuntimeFromFactories(profile, config, factories, options) {\n\treturn createRuntimeFromFactories$1(profile, config, factories, options);\n}\n\n//#endregion\nexport { isProfileName as n, createRuntimeFromFactories as t };\n//# sourceMappingURL=shared-state-C7bfwoO6.mjs.map","import { n as asTypedEvmNetworkConfig, o as getEvmSupportedExecutionMethods, u as withRuntimeCapability } from \"./helpers-CYDHdjrw.mjs\";\nimport { i as formatEvmTransactionData, r as waitForEvmTransactionConfirmation, t as executeEvmTransaction } from \"./transaction-CGedZish.mjs\";\nimport { v as DEFAULT_DISCONNECTED_STATUS } from \"./wallet-Cnqn54GJ.mjs\";\nimport { t as validateEvmExecutionConfig } from \"./validation-DmTPh6u0.mjs\";\n\n//#region src/capabilities/execution.ts\nfunction createExecution(config, options) {\n\tconst networkConfig = asTypedEvmNetworkConfig(config);\n\treturn Object.assign(withRuntimeCapability(networkConfig, \"execution\"), {\n\t\tformatTransactionData(contractSchema, functionId, submittedInputs, fields) {\n\t\t\treturn formatEvmTransactionData(contractSchema, functionId, submittedInputs, fields);\n\t\t},\n\t\tasync signAndBroadcast(transactionData, executionConfig, onStatusChange, runtimeApiKey, runtimeSecret) {\n\t\t\treturn executeEvmTransaction(transactionData, executionConfig, await options.getWalletImplementation(), onStatusChange, runtimeApiKey);\n\t\t},\n\t\tgetSupportedExecutionMethods: options.getSupportedExecutionMethods ?? getEvmSupportedExecutionMethods,\n\t\tvalidateExecutionConfig(executionConfig) {\n\t\t\treturn validateEvmExecutionConfig(executionConfig, options.getWalletConnectionStatus?.() ?? DEFAULT_DISCONNECTED_STATUS);\n\t\t},\n\t\tasync waitForTransactionConfirmation(txHash) {\n\t\t\treturn waitForEvmTransactionConfirmation(txHash, await options.getWalletImplementation());\n\t\t}\n\t});\n}\n\n//#endregion\nexport { createExecution as t };\n//# sourceMappingURL=execution-pt51WKhv.mjs.map","import { a as testEvmExplorerConnection, o as validateEvmExplorerConfig } from \"./explorer-DClCq_90.mjs\";\nimport { a as testEvmRpcConnection, o as validateEvmRpcEndpoint } from \"./rpc-BMyYpWRW.mjs\";\nimport { n as asTypedEvmNetworkConfig, u as withRuntimeCapability } from \"./helpers-CYDHdjrw.mjs\";\nimport { t as RelayerExecutionStrategy } from \"./relayer-D6OROZ3N.mjs\";\n\n//#region src/capabilities/relayer.ts\nfunction createRelayer(config, options = {}) {\n\tconst networkConfig = asTypedEvmNetworkConfig(config);\n\tconst relayerStrategy = new RelayerExecutionStrategy();\n\treturn Object.assign(withRuntimeCapability(networkConfig, \"relayer\"), {\n\t\tgetRelayers(serviceUrl, accessToken) {\n\t\t\treturn relayerStrategy.getEvmRelayers(serviceUrl, accessToken, networkConfig);\n\t\t},\n\t\tgetRelayer(serviceUrl, accessToken, relayerId) {\n\t\t\treturn relayerStrategy.getEvmRelayer(serviceUrl, accessToken, relayerId, networkConfig);\n\t\t},\n\t\tgetNetworkServiceForms() {\n\t\t\treturn options.getNetworkServiceForms?.(networkConfig) ?? [];\n\t\t},\n\t\tvalidateNetworkServiceConfig: options.validateNetworkServiceConfig,\n\t\ttestNetworkServiceConnection(serviceId, values) {\n\t\t\treturn options.testNetworkServiceConnection?.(serviceId, values, networkConfig) ?? Promise.resolve({\n\t\t\t\tsuccess: false,\n\t\t\t\terror: \"Network service testing is not configured.\"\n\t\t\t});\n\t\t},\n\t\tvalidateRpcEndpoint(rpcConfig) {\n\t\t\treturn Promise.resolve(validateEvmRpcEndpoint(rpcConfig));\n\t\t},\n\t\ttestRpcConnection(rpcConfig) {\n\t\t\treturn testEvmRpcConnection(rpcConfig);\n\t\t},\n\t\tvalidateExplorerConfig(explorerConfig) {\n\t\t\treturn Promise.resolve(validateEvmExplorerConfig(explorerConfig));\n\t\t},\n\t\ttestExplorerConnection(explorerConfig) {\n\t\t\treturn testEvmExplorerConnection(explorerConfig, networkConfig);\n\t\t},\n\t\tgetDefaultServiceConfig(serviceId) {\n\t\t\treturn options.getDefaultServiceConfig?.(networkConfig, serviceId) ?? null;\n\t\t}\n\t});\n}\n\n//#endregion\nexport { createRelayer as t };\n//# sourceMappingURL=relayer-B5mRFtkk.mjs.map","import { n as asTypedEvmNetworkConfig, u as withRuntimeCapability } from \"./helpers-CYDHdjrw.mjs\";\nimport { g as generateRainbowKitExportables, h as generateRainbowKitConfigFile, i as resolveFullUiKitConfiguration } from \"./wallet-Cnqn54GJ.mjs\";\n\n//#region src/capabilities/ui-kit.ts\nconst DEFAULT_UI_KIT_CONFIG = {\n\tkitName: \"custom\",\n\tkitConfig: { showInjectedConnector: false }\n};\nfunction getDefaultUiKits() {\n\treturn Promise.resolve([{\n\t\tid: \"custom\",\n\t\tname: \"Wagmi Custom\",\n\t\tconfigFields: []\n\t}, {\n\t\tid: \"rainbowkit\",\n\t\tname: \"RainbowKit\",\n\t\tlinkToDocs: \"https://www.rainbowkit.com/docs/installation#configure\",\n\t\tdescription: \"Configure RainbowKit for your exported application. This configuration is used by exported apps, while preview keeps the default RainbowKit setup.\",\n\t\thasCodeEditor: true,\n\t\tdefaultCode: generateRainbowKitConfigFile({}),\n\t\tconfigFields: []\n\t}]);\n}\nfunction createUiKit(config, options = {}) {\n\tconst networkConfig = asTypedEvmNetworkConfig(config);\n\tlet currentUiKitConfig = options.loadCurrentUiKitConfig?.() ?? { ...DEFAULT_UI_KIT_CONFIG };\n\treturn Object.assign(withRuntimeCapability(networkConfig, \"uiKit\"), {\n\t\tasync configureUiKit(programmaticConfig = {}, runtimeOptions) {\n\t\t\tconst currentAppServiceConfig = options.loadCurrentUiKitConfig?.() ?? currentUiKitConfig;\n\t\t\tconst resolvedConfig = await resolveFullUiKitConfiguration(programmaticConfig, currentAppServiceConfig.kitName, currentAppServiceConfig, runtimeOptions);\n\t\t\tcurrentUiKitConfig = resolvedConfig;\n\t\t\tawait options.onConfigureUiKit?.(resolvedConfig);\n\t\t},\n\t\tgetEcosystemReactUiContextProvider: options.getEcosystemReactUiContextProvider,\n\t\tgetEcosystemReactHooks: options.getEcosystemReactHooks,\n\t\tgetEcosystemWalletComponents() {\n\t\t\treturn options.getEcosystemWalletComponents?.(currentUiKitConfig);\n\t\t},\n\t\tgetAvailableUiKits: options.getAvailableUiKits ?? getDefaultUiKits,\n\t\tgetRelayerOptionsComponent: options.getRelayerOptionsComponent,\n\t\tgetExportableWalletConfigFiles: options.getExportableWalletConfigFiles ?? (async (uiKitConfig) => {\n\t\t\tif (uiKitConfig?.kitName === \"rainbowkit\") return generateRainbowKitExportables(uiKitConfig);\n\t\t\treturn {};\n\t\t})\n\t});\n}\n\n//#endregion\nexport { createUiKit as t };\n//# sourceMappingURL=ui-kit-B5rRL5pH.mjs.map","import { n as asTypedEvmNetworkConfig, u as withRuntimeCapability } from \"./helpers-CYDHdjrw.mjs\";\n\n//#region src/capabilities/wallet.ts\nfunction createWallet(config, options) {\n\tconst networkConfig = asTypedEvmNetworkConfig(config);\n\treturn Object.assign(withRuntimeCapability(networkConfig, \"wallet\"), {\n\t\tsupportsWalletConnection() {\n\t\t\treturn options.supportsWalletConnection?.() ?? true;\n\t\t},\n\t\tgetAvailableConnectors: options.getAvailableConnectors,\n\t\tconnectWallet(connectorId) {\n\t\t\treturn options.connectWallet(connectorId, networkConfig.chainId);\n\t\t},\n\t\tdisconnectWallet: options.disconnectWallet,\n\t\tgetWalletConnectionStatus: options.getWalletConnectionStatus,\n\t\tonWalletConnectionChange: options.onWalletConnectionChange\n\t});\n}\n\n//#endregion\nexport { createWallet as t };\n//# sourceMappingURL=wallet-BNjALpt4.mjs.map","import { t as createRuntimeFromFactories } from \"./shared-state-C7bfwoO6.mjs\";\n\n//#region src/profiles/composer.ts\nfunction createComposerRuntime(config, factories, options) {\n\treturn createRuntimeFromFactories(\"composer\", config, factories, options);\n}\n\n//#endregion\nexport { createComposerRuntime as t };\n//# sourceMappingURL=composer-KOMbxrP9.mjs.map","import { t as createRuntimeFromFactories } from \"./shared-state-C7bfwoO6.mjs\";\n\n//#region src/profiles/declarative.ts\nfunction createDeclarativeRuntime(config, factories, options) {\n\treturn createRuntimeFromFactories(\"declarative\", config, factories, options);\n}\n\n//#endregion\nexport { createDeclarativeRuntime as t };\n//# sourceMappingURL=declarative-BScQ8kBN.mjs.map","import { t as createRuntimeFromFactories } from \"./shared-state-C7bfwoO6.mjs\";\n\n//#region src/profiles/operator.ts\nfunction createOperatorRuntime(config, factories, options) {\n\treturn createRuntimeFromFactories(\"operator\", config, factories, options);\n}\n\n//#endregion\nexport { createOperatorRuntime as t };\n//# sourceMappingURL=operator-DRcCu6qh.mjs.map","import { t as createRuntimeFromFactories } from \"./shared-state-C7bfwoO6.mjs\";\n\n//#region src/profiles/transactor.ts\nfunction createTransactorRuntime(config, factories, options) {\n\treturn createRuntimeFromFactories(\"transactor\", config, factories, options);\n}\n\n//#endregion\nexport { createTransactorRuntime as t };\n//# sourceMappingURL=transactor-CszV6L5T.mjs.map","import { t as createRuntimeFromFactories } from \"./shared-state-C7bfwoO6.mjs\";\n\n//#region src/profiles/viewer.ts\nfunction createViewerRuntime(config, factories, options) {\n\treturn createRuntimeFromFactories(\"viewer\", config, factories, options);\n}\n\n//#endregion\nexport { createViewerRuntime as t };\n//# sourceMappingURL=viewer-B9KW1uv7.mjs.map","import { t as isEvmContractArtifacts } from \"./artifacts-CdE4lY5E.mjs\";\nimport { a as stringifyWithBigInt, i as formatMethodName, n as weiToGwei, o as validateAndConvertEvmArtifacts, r as formatInputName, t as gweiToWei } from \"./utils-C2QdbtNI.mjs\";\nimport { t as createEvmPublicClient } from \"./public-client-DtJS2A20.mjs\";\nimport { t as isValidEvmAddress } from \"./validation--Y5v5XOf.mjs\";\nimport { n as transformAbiToSchema, t as createAbiFunctionItem } from \"./transformer-0vQSxsqD.mjs\";\nimport { a as testEvmExplorerConnection, i as resolveExplorerConfig, n as getEvmExplorerTxUrl, o as validateEvmExplorerConfig, r as resolveExplorerApiKeyFromAppConfig, t as getEvmExplorerAddressUrl } from \"./explorer-DClCq_90.mjs\";\nimport { n as shouldUseV2Api, r as testEtherscanV2Connection, t as loadAbiFromEtherscanV2 } from \"./etherscan-v2-DMXR3bdG.mjs\";\nimport { _ as loadAbiFromEtherscan, a as hashContractDefinition, c as isValidAbiItem, d as loadEvmContract, f as detectProxyFromAbi, g as loadAbiFromSourcify, h as getSourcifyContractAppUrl, i as compareContractDefinitions, l as loadContractSchema, m as getImplementationAddress, n as AbiComparisonService, o as validateContractDefinition, p as getAdminAddress, r as abiComparisonService, s as isValidAbiArray, t as createContractLoading, u as loadContractWithFullMetadata, v as loadAbiFromEtherscanV1 } from \"./contract-loading-BmGOAF0h.mjs\";\nimport { a as testEvmRpcConnection, i as resolveRpcUrl, n as getEvmCurrentBlock, o as validateEvmRpcEndpoint, r as getUserRpcUrl, t as buildRpcUrl } from \"./rpc-BMyYpWRW.mjs\";\nimport { c as guardRuntimeCapability, f as EVM_PROVIDER_ORDER_DEFAULT, m as isEvmProviderKey, n as asTypedEvmNetworkConfig, p as EvmProviderKeys } from \"./helpers-CYDHdjrw.mjs\";\nimport { a as EVM_TYPE_TO_FIELD_TYPE, i as mapEvmParamTypeToFieldType, n as generateEvmDefaultField, o as getEvmTypeMappingInfo, r as getEvmCompatibleFieldTypes, t as createTypeMapping } from \"./type-mapping-M_1E1k5X.mjs\";\nimport { t as parseEvmInput } from \"./input-parser-CegVgfkw.mjs\";\nimport { n as formatEvmFunctionResult, t as createQuery } from \"./query-Dp2xVzf5.mjs\";\nimport { n as isEvmViewFunction, t as queryEvmViewFunction } from \"./query-C4skW30n.mjs\";\nimport { i as formatEvmTransactionData, n as signAndBroadcastEvmTransaction, r as waitForEvmTransactionConfirmation, t as executeEvmTransaction } from \"./transaction-CGedZish.mjs\";\nimport { n as validateEvmEoaConfig, t as validateEoaConfig } from \"./eoa-BNDtrmMy.mjs\";\nimport { t as EoaExecutionStrategy } from \"./eoa-DzKx-Oss.mjs\";\nimport { t as RelayerExecutionStrategy } from \"./relayer-D6OROZ3N.mjs\";\nimport { C as ConnectorDialog, D as WagmiProviderInitializedContext, E as useIsWagmiProviderInitialized, S as CustomConnectButton, T as useManagedWagmiDisconnect, _ as WagmiWalletImplementation, a as ensureRainbowKitAssetsLoaded, b as CustomNetworkSwitcher, c as getWagmiConfigForRainbowKit, d as getRawUserNativeConfig, f as validateRainbowKitConfig, g as generateRainbowKitExportables, h as generateRainbowKitConfigFile, i as resolveFullUiKitConfiguration, l as createRainbowKitComponents, m as isRainbowKitCustomizations, n as getComponentExclusionsFromConfig, o as createUiKitManager, p as extractRainbowKitCustomizations, r as resolveAndInitializeKitConfig, s as createRainbowKitWagmiConfig, t as filterWalletComponents, u as createRainbowKitConnectButton, v as DEFAULT_DISCONNECTED_STATUS, w as SafeWagmiComponent, x as CustomAccountDisplay, y as connectAndEnsureCorrectNetworkCore } from \"./wallet-Cnqn54GJ.mjs\";\nimport { i as resolveAccessControlIndexerUrl, n as validateEvmNetworkServiceConfig, r as getUserAccessControlIndexerUrl, t as testEvmNetworkServiceConnection } from \"./configuration-DSvdNI95.mjs\";\nimport { n as validateEvmRelayerConfig, r as validateRelayerConfig, t as validateEvmExecutionConfig } from \"./validation-DmTPh6u0.mjs\";\nimport { C as assembleGrantRoleAction, D as assembleRollbackAdminDelayAction, E as assembleRevokeRoleAction, O as assembleTransferOwnershipAction, S as assembleChangeAdminDelayAction, T as assembleRenounceRoleAction, _ as ZERO_ADDRESS, a as validateRoleId, b as assembleBeginAdminTransferAction, c as getCurrentBlock, d as EvmIndexerClient, f as createIndexerClient, g as DEFAULT_ADMIN_ROLE_LABEL, h as DEFAULT_ADMIN_ROLE, i as validateAddress, l as readCurrentRoles, m as validateAccessControlSupport, n as EvmAccessControlService, o as validateRoleIds, p as detectAccessControlCapabilities, r as createEvmAccessControlService, s as getAdmin, t as createAccessControl, u as readOwnership, v as assembleAcceptAdminTransferAction, w as assembleRenounceOwnershipAction, x as assembleCancelAdminTransferAction, y as assembleAcceptOwnershipAction } from \"./access-control-BA74EeRO.mjs\";\nimport { n as isProfileName } from \"./shared-state-C7bfwoO6.mjs\";\nimport { t as createAddressing } from \"./addressing-DG7_-m6y.mjs\";\nimport { i as mapErc3643Error, n as EvmErc3643Service, r as createEvmErc3643Service, t as createERC3643 } from \"./erc3643-DUGx5gQd.mjs\";\nimport { r as extractRevertInfo } from \"./amount-Bd1Whvv5.mjs\";\nimport \"./executor-CEYC5o85.mjs\";\nimport { i as mapErc4626Error, n as EvmErc4626Service, r as createEvmErc4626Service, t as createERC4626 } from \"./erc4626-Tci3OxhB.mjs\";\nimport { t as createExecution } from \"./execution-pt51WKhv.mjs\";\nimport { t as createExplorer } from \"./explorer-DUbGo-g_.mjs\";\nimport { a as getOnchainId, c as buildClaimPayload, i as getJurisdiction, n as EvmIRSService, o as isTrustedIssuer, r as createEvmIRSService, s as isVerified, t as createIRS } from \"./irs-BCDd_qeK.mjs\";\nimport { t as createNetworkCatalog } from \"./network-catalog-QZ-DwUPP.mjs\";\nimport { t as createRelayer } from \"./relayer-B5mRFtkk.mjs\";\nimport { t as createSchema } from \"./schema-Ca-W-fZz.mjs\";\nimport { t as createUiKit } from \"./ui-kit-B5rRL5pH.mjs\";\nimport { t as createUiLabels } from \"./ui-labels-Bns-QeUh.mjs\";\nimport { t as createWallet } from \"./wallet-BNjALpt4.mjs\";\nimport { t as createComposerRuntime } from \"./composer-KOMbxrP9.mjs\";\nimport { t as createDeclarativeRuntime } from \"./declarative-BScQ8kBN.mjs\";\nimport { t as createOperatorRuntime } from \"./operator-DRcCu6qh.mjs\";\nimport { t as createTransactorRuntime } from \"./transactor-CszV6L5T.mjs\";\nimport { t as createViewerRuntime } from \"./viewer-B9KW1uv7.mjs\";\nimport { logger } from \"@openzeppelin/ui-utils\";\nimport { BaseError, ChainDoesNotSupportContract, HttpRequestError, TimeoutError, ccipRequest, createPublicClient, custom, getAddress, toCoinType } from \"viem\";\nimport { RuntimeDisposedError } from \"@openzeppelin/ui-types\";\nimport { normalize } from \"viem/ens\";\nimport { mainnet } from \"viem/chains\";\n\n//#region src/name-resolution/error-mapping.ts\n/**\n* Native-error → `NameResolutionError` mapping (SF-1).\n*\n* A reusable, **stateless, pure** classification layer that converts the native failures raised\n* by the underlying resolution transport (viem client / RPC / CCIP-Read gateway / timeouts) into\n* the **closed seven-code `NameResolutionError` union** owned by UIKit SF-1 and exported from\n* `@openzeppelin/ui-types`. It is the single place the \"never throw for expected failures\"\n* contract is centralized: the forward (SF-2), reverse (SF-3), and ENS v2 (SF-5) paths all route\n* their caught native errors through the one total function {@link mapNameResolutionError}, and\n* construct the \"resolved-to-nothing\" variants through the small set of typed constructors below.\n*\n* The module owns **classification and union construction only** — it holds no state, performs no\n* I/O, reads no clock, and does not implement any resolution itself (SF-1 Design § State Ownership).\n*\n* ## Totality (INV-6)\n* Every input either **returns** a member of the closed union or **re-throws** a member of the\n* programmer-error allowlist (INV-9, currently `{ RuntimeDisposedError }`). There is no third\n* outcome — an unclassifiable native error maps to `ADAPTER_ERROR` carrying the original by\n* reference on `cause` (INV-7), so no failure is silently swallowed and no invented code escapes\n* the union (INV-1).\n*\n* ## Classification (SF-1 Design § Classification strategy)\n* `instanceof`-primary with a `.name`-needle fallback, over a bounded, cycle-safe walk of the\n* error `cause` chain (INV-15). `instanceof` is exact but brittle when two copies of `viem` /\n* `@openzeppelin/ui-types` coexist (duplicate-copy / bundling), so a `.name` backstop mirrors the\n* defense-in-depth `erc4626/error-mapping.ts` already applies.\n*\n* @remarks\n* The class → code table below was validated against `viem@2.44.x` (the workspace lockfile pin); the\n* declared peer/dependency floor remains `^2.35.0`. A `viem` major bump requires re-validating it.\n* ENS Universal-Resolver reverts (`ResolverNotFound`, `ResolverNotContract`, `ResolverError`,\n* `UnsupportedResolverProfile`) and the UTS-46 `normalize()`-throw are **not** mapper rows: SF-2/SF-3\n* Design pre-classifies them on the resolution control path via the typed constructors here\n* (preserving INV-11), so this module maps only the transport-generic failures (timeout / gateway /\n* offchain / chain-unsupported) and provides the total `ADAPTER_ERROR` fallback. Unknown\n* `errorName`s from older floors in the `^2.35` range likewise fall to that fallback (total).\n*\n* @module name-resolution/error-mapping\n*/\n/**\n* The closed seven-code taxonomy this module maps INTO, owned by UIKit SF-1 and imported\n* type-only from `@openzeppelin/ui-types`. Reproduced here as documentation ONLY — the\n* authoritative definition lives upstream and is never redefined or modified here.\n*\n* ```ts\n* type NameResolutionError =\n*   | { readonly code: 'NAME_NOT_FOUND';         readonly name: string }\n*   | { readonly code: 'ADDRESS_NOT_FOUND';      readonly address: string }\n*   | { readonly code: 'UNSUPPORTED_NETWORK';    readonly networkId: string }\n*   | { readonly code: 'UNSUPPORTED_NAME';       readonly name: string;    readonly reason: string }\n*   | { readonly code: 'RESOLUTION_TIMEOUT';     readonly elapsedMs: number }\n*   | { readonly code: 'EXTERNAL_GATEWAY_ERROR'; readonly detail: string }\n*   | { readonly code: 'ADAPTER_ERROR';          readonly message: string; readonly cause?: unknown };\n* ```\n*/\n/**\n* `RESOLUTION_TIMEOUT.elapsedMs` sentinel for \"not measured\" (INV-12). Chosen over `0` because it\n* is not a physically-realizable elapsed time, so a consumer can distinguish an unmeasured timeout\n* from a genuine sub-millisecond `0`. A `-1` reaching a consumer means a caller omitted its\n* required `ctx.elapsedMs` measurement (cross-SF caller obligation — SF-2/SF-3/SF-5).\n*/\nconst ELAPSED_UNMEASURED = -1;\n/** Stable fallback used when a native error yields no usable message string (INV-5). */\nconst FALLBACK_MESSAGE = \"unknown error\";\n/** Depth cap for the `cause`-chain walk — a totality guard against adversarially deep chains (INV-15). */\nconst MAX_CAUSE_CHAIN_DEPTH = 32;\n/**\n* Closed programmer-error allowlist (INV-9). Membership is by class identity, never a structural\n* \"looks like a bug\" heuristic. Growth is an explicit, reviewable edit here — adding a member\n* NARROWS the never-throw guarantee (INV-6) that UIKit INV-8 and the SF-4 conformance harness\n* depend on, so treat additions as API-visible.\n*/\nconst PROGRAMMER_ERROR_CLASSES = [RuntimeDisposedError];\nconst PROGRAMMER_ERROR_NAMES = new Set([\"RuntimeDisposedError\"]);\n/** viem timeout error `.name`s (fallback for the `instanceof TimeoutError` primary check). */\nconst TIMEOUT_ERROR_NAMES = new Set([\"TimeoutError\"]);\n/**\n* CCIP-Read / offchain-lookup error `.name`s. The `OffchainLookup*` classes are NOT publicly\n* exported from `viem` (only their types are), so these are detected by `.name` only — exactly the\n* defense-in-depth fallback the classification strategy anticipates.\n*/\nconst OFFCHAIN_GATEWAY_ERROR_NAMES = new Set([\n\t\"OffchainLookupError\",\n\t\"OffchainLookupResponseMalformedError\",\n\t\"OffchainLookupSenderMismatchError\"\n]);\n/** viem HTTP transport error `.name`s (fallback for the `instanceof HttpRequestError` primary check). */\nconst HTTP_REQUEST_ERROR_NAMES = new Set([\"HttpRequestError\"]);\n/**\n* ENS Universal-Resolver **decoded revert** `errorName`s that denote an offchain-gateway HTTP\n* failure (cross-SF drift D3, from SF-2 Code). Unlike the transport classes above, `HttpError` is not\n* a thrown viem class — it is the decoded `ContractFunctionRevertedError.data.errorName` (the thrown\n* error's own `.name` is `ContractFunctionRevertedError`), so it is matched via `extractRevertInfo`,\n* not the `.name` needle. It belongs in the same `EXTERNAL_GATEWAY_ERROR` bucket as `OffchainLookup*`\n* (D-E Part B). The resolution-*semantic* UR reverts (`ResolverNotFound` / `ResolverNotContract` /\n* `ResolverError` / `UnsupportedResolverProfile`) are deliberately absent — SF-2/SF-3 pre-classify\n* those on their control paths via the constructors (INV-11); only the gateway-transport failure is a\n* mapper row.\n*/\nconst ENS_GATEWAY_REVERT_ERROR_NAMES = new Set([\"HttpError\"]);\n/**\n* \"This chain has no ENS Universal Resolver\" error `.name`s (SF-2 Research G2 drift): the real\n* forward-path `UNSUPPORTED_NETWORK` signal is viem `ChainDoesNotSupportContract`, NOT\n* `EnsInvalidChainIdError` (that is an ENSIP-11 `coinType` case — SF-5) nor\n* `ClientChainNotConfiguredError` (a no-chain-at-all case SF-2 pre-empts at capability\n* construction, so here it falls to `ADAPTER_ERROR`).\n*/\nconst CHAIN_UNSUPPORTED_ERROR_NAMES = new Set([\"ChainDoesNotSupportContract\"]);\n/**\n* Credential-substring redaction patterns (INV-16), URL-scoped per the Invariants-stage default.\n* Applied to every free-text field derived from a raw native message (`ADAPTER_ERROR.message`,\n* `EXTERNAL_GATEWAY_ERROR.detail`) — viem/RPC errors routinely embed a provider URL carrying a key.\n* The full, unredacted original is retained ONLY on `ADAPTER_ERROR.cause` (opaque, INV-17), never\n* on a renderable string.\n*\n* The set below closes SF-1 Open Question 1 (URL-scoped redaction widened, SEC-REVIEW H1): beyond\n* the Alchemy/Infura `/vN/<key>` and userinfo/query shapes, provider keys also ship as a **bare\n* high-entropy trailing path segment** (Ankr `rpc.ankr.com/eth/<key>`, QuickNode `<host>/<key>`)\n* and under provider-specific query params (`?dkey=` for dRPC, etc.). Both leak un-redacted onto\n* `EXTERNAL_GATEWAY_ERROR.detail` / `ADAPTER_ERROR.message` under the old patterns, so they are\n* covered here. Redaction is deliberately biased toward over-scrubbing a rendered string (the\n* full value is always recoverable on `cause`); the high-entropy floor (≥32 base62url chars, incl.\n* `-`/`_` — Finding 5) and the host anchor keep it from touching legitimate short or hyphenated\n* path segments.\n*/\nconst REDACTION_PATTERNS = [\n\t[/([a-z][a-z0-9+.-]*:\\/\\/)[^/\\s:@]+:[^/\\s@]+@/gi, \"$1<redacted>@\"],\n\t[/(\\/v\\d+\\/)[A-Za-z0-9_-]{16,}/g, \"$1<redacted>\"],\n\t[/(\\/\\/[^/\\s]+\\/(?:[^/\\s]+\\/)*)[A-Za-z0-9_-]{32,}/g, \"$1<redacted>\"],\n\t[/([?&](?:api[-_]?key|apikey|key|dkey|access[-_]?token|token|auth|secret|client[-_]?secret|password|passwd|pass|pk)=)[^&\\s]+/gi, \"$1<redacted>\"]\n];\n/** Forward lookup succeeded structurally but no record exists for this name. */\nconst nameNotFound = (name) => ({\n\tcode: \"NAME_NOT_FOUND\",\n\tname\n});\n/** Reverse lookup succeeded structurally but no name maps back to this address. */\nconst addressNotFound = (address) => ({\n\tcode: \"ADDRESS_NOT_FOUND\",\n\taddress\n});\n/** Input is syntactically not a name in this system (wrong TLD, failed UTS-46, …). */\nconst unsupportedName = (name, reason) => ({\n\tcode: \"UNSUPPORTED_NAME\",\n\tname,\n\treason: redactSecrets(reason)\n});\n/** The active network does not support name resolution at all. */\nconst unsupportedNetwork = (networkId) => ({\n\tcode: \"UNSUPPORTED_NETWORK\",\n\tnetworkId\n});\n/**\n* Convert a native failure raised by the resolution transport into a typed `NameResolutionError`.\n*\n* **Total over expected failures** (INV-6) — always returns a member of the closed union; never\n* throws for a transport / RPC / gateway / timeout failure. Any native error that cannot be\n* classified maps to `ADAPTER_ERROR` carrying the original value as an opaque `cause` (INV-7), so\n* no failure is silently swallowed and no invented code escapes the union (INV-1).\n*\n* The **one** exception to totality: genuine programmer / lifecycle errors on the closed allowlist\n* (INV-9, currently `RuntimeDisposedError`) are re-thrown unchanged, not classified — masking a\n* use-after-dispose bug as an expected failure code would hide a real defect. This is the\n* type-level guarantee behind UIKit INV-8.\n*\n* Pure and side-effect-free (INV-13/INV-14): reads no clock, performs no I/O, logs nothing, and\n* never mutates the caught error.\n*\n* @param error   - The caught native value, typed `unknown` (INV-4). viem's thrown values extend\n*                  `BaseError`, but any value is accepted; non-Error values fall through to\n*                  `ADAPTER_ERROR`.\n* @param context - Payload details the error itself cannot supply. Optional.\n* @returns A member of the closed seven-code `NameResolutionError` union.\n* @throws {RuntimeDisposedError} when `error` is (or wraps) a lifecycle/programmer error on the\n*   allowlist (INV-9). This is the sole `throw` in the module.\n*/\nfunction mapNameResolutionError(error, context = {}) {\n\tconst chain = collectErrorChain(error);\n\tif (chainMatches(chain, PROGRAMMER_ERROR_CLASSES, PROGRAMMER_ERROR_NAMES)) throw error;\n\tconst timedOut = chainMatches(chain, [TimeoutError], TIMEOUT_ERROR_NAMES);\n\tconst offchainFailure = chainMatches(chain, [], OFFCHAIN_GATEWAY_ERROR_NAMES);\n\tconst httpFailure = chainMatches(chain, [HttpRequestError], HTTP_REQUEST_ERROR_NAMES);\n\tconst decodedRevertName = error instanceof BaseError ? extractRevertInfo(error).errorName : void 0;\n\tconst gatewayRevert = decodedRevertName !== void 0 && ENS_GATEWAY_REVERT_ERROR_NAMES.has(decodedRevertName);\n\tif (context.viaGateway === true && (timedOut || offchainFailure || httpFailure || gatewayRevert)) return externalGatewayError(error);\n\tif (timedOut) return resolutionTimeout(context.elapsedMs);\n\tif (offchainFailure || gatewayRevert) return externalGatewayError(error);\n\tif (chainMatches(chain, [ChainDoesNotSupportContract], CHAIN_UNSUPPORTED_ERROR_NAMES)) return unsupportedNetwork(context.networkId ?? \"\");\n\treturn {\n\t\tcode: \"ADAPTER_ERROR\",\n\t\tmessage: redactSecrets(safeMessage(error)),\n\t\tcause: error\n\t};\n}\n/** Build `EXTERNAL_GATEWAY_ERROR` from a caught error, with a redacted `detail` (INV-16). */\nfunction externalGatewayError(error) {\n\treturn {\n\t\tcode: \"EXTERNAL_GATEWAY_ERROR\",\n\t\tdetail: redactSecrets(safeMessage(error))\n\t};\n}\n/** Build `RESOLUTION_TIMEOUT`, normalizing `elapsedMs` to a finite `≥ 0` value or the sentinel (INV-12). */\nfunction resolutionTimeout(elapsedMs) {\n\treturn {\n\t\tcode: \"RESOLUTION_TIMEOUT\",\n\t\telapsedMs: typeof elapsedMs === \"number\" && Number.isFinite(elapsedMs) && elapsedMs >= 0 ? elapsedMs : ELAPSED_UNMEASURED\n\t};\n}\n/**\n* Collect the error `cause` chain, bounded and cycle-safe (INV-15). Terminates on a cyclic chain\n* (via a visited set of objects) and on an adversarially deep chain (via {@link\n* MAX_CAUSE_CHAIN_DEPTH}), so classification never infinite-loops or blows the stack. Accepts any\n* value (INV-4): primitives and `null`/`undefined` yield a one- or zero-element chain. Read-only —\n* the caught error is never mutated (INV-14).\n*/\nfunction collectErrorChain(value) {\n\tconst chain = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tlet current = value;\n\twhile (current != null && chain.length < MAX_CAUSE_CHAIN_DEPTH) {\n\t\tif (typeof current === \"object\") {\n\t\t\tif (seen.has(current)) break;\n\t\t\tseen.add(current);\n\t\t}\n\t\tchain.push(current);\n\t\tcurrent = readCause(current);\n\t}\n\treturn chain;\n}\n/** Read a `.cause` reference without mutating or asserting a type (INV-14). */\nfunction readCause(value) {\n\tif (typeof value !== \"object\" || value === null || !(\"cause\" in value)) return void 0;\n\treturn value.cause;\n}\n/** Read a `.name` string structurally — works cross-realm where `instanceof` does not. */\nfunction nameOf(value) {\n\tif (typeof value !== \"object\" || value === null) return void 0;\n\tconst name = value.name;\n\treturn typeof name === \"string\" ? name : void 0;\n}\n/**\n* Whether any error in the chain matches the given classes (`instanceof`-primary) or `.name`s\n* (needle fallback). The fallback backstops duplicate-copy / foreign-realm errors where\n* `instanceof` fails despite an identical class name.\n*/\nfunction chainMatches(chain, classes, names) {\n\treturn chain.some((error) => {\n\t\tif (classes.some((ctor) => error instanceof ctor)) return true;\n\t\tconst name = nameOf(error);\n\t\treturn name !== void 0 && names.has(name);\n\t});\n}\n/**\n* Extract a non-empty display message from any value without ever throwing (INV-5). Uses\n* `error.message` when it is a non-empty string, else `String(value)`, guarding property access and\n* stringification against a hostile/broken `message`/`toString` getter; falls back to {@link\n* FALLBACK_MESSAGE} if stringification throws or yields empty. Does not touch `error.cause`.\n*/\nfunction safeMessage(value) {\n\ttry {\n\t\tif (value instanceof BaseError && value.message.length > 0) return value.message;\n\t\tif (typeof value === \"object\" && value !== null) {\n\t\t\tconst message = value.message;\n\t\t\tif (typeof message === \"string\" && message.length > 0) return message;\n\t\t}\n\t\tif (typeof value === \"string\" && value.length > 0) return value;\n\t\tconst stringified = String(value);\n\t\treturn stringified.length > 0 ? stringified : FALLBACK_MESSAGE;\n\t} catch {\n\t\treturn FALLBACK_MESSAGE;\n\t}\n}\n/**\n* Strip credential-bearing substrings from a display string before it lands on a renderable field\n* (INV-16): URL userinfo and provider-API-key-in-URL patterns, URL-scoped per the Invariants-stage\n* default. Pure over strings — the regexes never throw. Applied to `ADAPTER_ERROR.message`,\n* `EXTERNAL_GATEWAY_ERROR.detail`, and (defensively) `UNSUPPORTED_NAME.reason`; NEVER to\n* `ADAPTER_ERROR.cause`, which retains the full original (INV-17).\n*/\nfunction redactSecrets(text) {\n\tlet redacted = text;\n\tfor (const [pattern, replacement] of REDACTION_PATTERNS) redacted = redacted.replace(pattern, replacement);\n\treturn redacted;\n}\n\n//#endregion\n//#region src/name-resolution/ens-provenance.ts\n/**\n* EVM ENS-provenance extension (SF-5).\n*\n* SF-2 attaches a chain-agnostic {@link ResolutionProvenance} to a forward result. SF-5 upgrades the\n* forward path to carry an EVM-specific {@link EnsProvenance} — the same object plus the *observable*\n* facts a downstream needs to reason about a v2 (or cross-chain) resolution: an always-present\n* `system: 'ens'` discriminant, the ENSIP-9/11 `coinType` the lookup was performed for, and — only\n* for a chain-scoped result — the network the address is scoped to. The rule is **observe, don't\n* infer**: every field here is a fact the adapter can substantiate from the call it actually made,\n* never a claim it merely asserts (Research G4).\n*\n* Design decisions this file implements:\n* - **D-V3 / INV-3–7** — observable facts only. No `version: 'v1'|'v2'` (not observable from viem's\n*   `Address | null`) and no `via` mechanism enum (that boundary is UIKit SF-6's, Open Q1); `system`\n*   is the discriminant instead.\n* - **D-V4 / INV-5, INV-10** — `isEnsProvenance` narrows on the always-present `system`, never on\n*   `label` string-matching (SC-005). It is the sole sanctioned narrowing path for a consumer.\n* - **INV-4** — `EnsProvenance` is a strict *superset* of an UNCHANGED base `ResolutionProvenance`\n*   (imported, never redefined): no SF-1 capability-contract change.\n* - **INV-6** — `coinType` is stored as a JS `number` (safe-integer by ENSIP-11 construction) so a\n*   `JSON.stringify(provenance)` never throws on a `bigint`.\n* - **INV-7 / D-V6** — `scopedToNetworkId` present **iff** `coinType !== 60` (a chain-scoped result),\n*   equal to the bound network's own repo `networkId` (no coinType→chainId inverse is needed because\n*   the target chain *is* the bound network — D-V2).\n*\n* viem coupling is pinned to `2.44.4`: `toCoinType` (ENSIP-9/11 forward map) and its\n* `EnsInvalidChainIdError` throw are the only viem surface here — a viem major bump re-validates both.\n*\n* @module name-resolution/ens-provenance\n*/\n/**\n* The `coinType` for ETH / Ethereum mainnet (ENSIP-9). A resolution performed for this coinType is\n* **unscoped** — its result is a plain mainnet address and carries no `scopedToNetworkId` (INV-7).\n*/\nconst ETH_COIN_TYPE$1 = 60n;\n/**\n* Narrow a base {@link ResolutionProvenance} to the EVM ENS extension (SC-005). Total, pure, and\n* sound: checks the always-present `system` discriminant (INV-10) — never `label`. Returns `true` for\n* every SF-5 forward result, `false` for SF-3's reverse base provenance (no `system`) and any non-EVM\n* adapter's provenance. After a `true`, `p.external` / `p.coinType` / `p.scopedToNetworkId` are safe\n* to read.\n*/\nfunction isEnsProvenance(p) {\n\treturn p.system === \"ens\";\n}\n/**\n* The bound network's `networkId` **iff** the resolution is chain-scoped (`coinType !== 60`), else\n* `undefined` (INV-7 / D-V6). Single source of the \"scoped iff not mainnet\" rule that\n* {@link buildEnsProvenance} spreads — no coinType→chainId inverse is needed because the target chain\n* *is* the bound network (D-V2). A mainnet-bound result therefore omits the key entirely (key-absent,\n* not `undefined`), matching the base-type convention.\n*/\nfunction scopedNetworkId(coinType, networkId) {\n\treturn coinType !== ETH_COIN_TYPE$1 ? networkId : void 0;\n}\n/**\n* Build the {@link EnsProvenance} for a forward resolution from observed facts (INV-3). `external`\n* comes from the per-call ccipRead observation (INV-9); `coinType` from the bound network (60 for\n* mainnet-bound); `scopedToNetworkId` is added **iff** the result is chain-scoped (INV-7). `label` is\n* a curated literal chosen from `external` — one of `'ENS'` / `'ENS via external gateway'`, never a\n* URL (INV-8). Freshly allocated on every call — never a shared/frozen singleton.\n*/\nfunction buildEnsProvenance(args) {\n\tconst scoped = scopedNetworkId(args.coinType, args.networkId);\n\treturn {\n\t\tsystem: \"ens\",\n\t\tlabel: args.external ? \"ENS via external gateway\" : \"ENS\",\n\t\texternal: args.external,\n\t\tcoinType: Number(args.coinType),\n\t\t...scoped !== void 0 ? { scopedToNetworkId: scoped } : {}\n\t};\n}\n/**\n* ENSIP-9/11 forward map: a bound EVM chainId → its `coinType`. A thin wrapper over viem's\n* `toCoinType` (mainnet → `60n`). Throws viem's `EnsInvalidChainIdError` for a non-EVM / out-of-range\n* chainId — the service catches that synchronously and returns `UNSUPPORTED_NETWORK` (INV-16). No\n* coinType→chainId inverse is needed (Research G3 / D-V6): the target chain *is* the bound network.\n*\n* @throws {import('viem').EnsInvalidChainIdError} for a chainId outside the ENSIP-11 addressable range.\n*/\nfunction deriveCoinType(chainId) {\n\treturn toCoinType(chainId);\n}\n\n//#endregion\n//#region src/name-resolution/name-validation.ts\n/**\n* Synchronous ENS name shape validation (SF-2).\n*\n* A **pure, synchronous, client-free** shape gate: is a string plausibly a resolvable ENS name?\n* `isValidName` is the UIKit's per-keystroke hot-path predicate (INV-21) and `resolveName`'s own\n* step-2 gate (INV-4) — so it lives here, with no dependency on the service or the injected viem\n* client, and never performs I/O (INV-3, INV-13).\n*\n* The check is **ENSIP-15/UTS-46 `normalize`-based, not a TLD allowlist regex** (Design D-`isValidName`):\n* a `/\\.(eth|xyz|…)$/` allowlist would wrongly reject legitimate wildcard / DNS / non-`.eth` names\n* (`.box`, offchain names) — exactly the resolvable inputs ENS-in-input must accept. A `true` is\n* **necessary but not sufficient** for resolution: it asserts shape, never existence of a record.\n*\n* @module name-resolution/name-validation\n*/\n/**\n* Whether `name` is a plausibly-resolvable ENS name — a total, pure, synchronous boolean predicate\n* that **never throws** (INV-3). Three ordered, allocation-light checks (INV-4):\n*\n* 1. **Reject a raw EVM hex address** — an address is not a name; resolving it is a category error\n*    (and lets the UIKit skip a needless resolution round-trip on pasted addresses).\n* 2. **Require at least one `.`** — bare single labels are rejected (Design Open Q3 / INV-4). Cheap\n*    structural pre-filter before the (heavier) normalization step.\n* 3. **Require ENSIP-15/UTS-46 normalizability** — `normalize` throwing is caught and reported as\n*    `false`, never propagated (INV-3): the UIKit calls this inside a render path with no `try/catch`.\n*\n* @param name - Arbitrary user input.\n* @returns `true` iff all three checks pass. Never throws, never does I/O.\n*/\nfunction isValidName(name) {\n\tif (isValidEvmAddress(name)) return false;\n\tif (!name.includes(\".\")) return false;\n\ttry {\n\t\tnormalize(name);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n/**\n* ENSIP-15/UTS-46 normalization of an ENS name.\n*\n* **Throws** on a structurally-invalid name (viem/@adraffy `ens-normalize`) — unlike {@link isValidName}\n* it does not swallow the failure. `resolveName` calls it as a backstop *after* `isValidName` has\n* already passed, so a throw here is the rare case a name survives the shape gate yet fails deep\n* normalization; the caller maps that throw to `UNSUPPORTED_NAME` (Design D-D), never to the mapper's\n* fuzzy needle path.\n*\n* @param name - A name that has (typically) already passed {@link isValidName}.\n* @returns The ENSIP-15-normalized form, suitable for `getEnsAddress`.\n* @throws When `name` is not a normalizable ENS name.\n*/\nfunction normalizeName(name) {\n\treturn normalize(name);\n}\n\n//#endregion\n//#region src/name-resolution/provenance.ts\n/**\n* Canonical mainnet repo network id — MUST match `ethereumMainnet.id` in\n* `@openzeppelin/adapter-evm` (`packages/adapter-evm/src/networks/mainnet.ts`).\n* Single source for `resolvedOnNetworkId` on 003 L1 miss-fallback successes (INV-6 / INV-24).\n*/\nconst MAINNET_NETWORK_ID = \"ethereum-mainnet\";\n/**\n* The three base fallback fields adapters spread onto any L1 miss-fallback success provenance.\n* Fresh object per call (INV-12). Does not set `label`, `external`, or `scopedToNetworkId` (INV-28).\n*\n* @param args.queriedOnNetworkId — bound adapter `networkConfig.id` that missed first (INV-7).\n* @param args.resolvedOnNetworkId — network where the record was found; 003 always {@link MAINNET_NETWORK_ID}.\n*/\nfunction networkFallbackProvenanceFields(args) {\n\treturn {\n\t\tresolvedViaNetworkFallback: true,\n\t\tqueriedOnNetworkId: args.queriedOnNetworkId,\n\t\tresolvedOnNetworkId: args.resolvedOnNetworkId\n\t};\n}\n/**\n* Spread fallback triplet onto an existing success provenance (forward SF-4 / reverse L1).\n* Preserves `label`, `external`, and `scopedToNetworkId` from the base object (INV-28).\n*/\nfunction composeNetworkFallbackProvenance(provenance, args) {\n\treturn {\n\t\t...provenance,\n\t\t...networkFallbackProvenanceFields(args)\n\t};\n}\n/**\n* Base provenance for a v1 forward resolution: a freshly-allocated `{ label: 'ENS', external: false }`\n* on every call (INV-5).\n*\n* - `label` is the fixed, user-safe literal `'ENS'` — never a URL, gateway host, or keyed identifier\n*   (INV-19; a leak would fail SF-4's `label`-allowlist check). It is a **display** string, not a\n*   discriminant: downstream code must not branch on it.\n* - `external` is `false` on the v1 forward path. SF-2 does not (and per G4 cannot cheaply) detect\n*   incidental CCIP-Read traversal; accurate offchain detection is SF-5's `EnsProvenance` extension.\n* - `scopedToNetworkId` is deliberately **absent** — network-scoping is SF-5's.\n*\n* A fresh object per call (no shared/frozen singleton) so no two success results alias one provenance.\n*\n* @returns A new `ResolutionProvenance` for a canonical ENS v1 forward result.\n*/\nfunction baseEnsProvenance() {\n\treturn {\n\t\tlabel: \"ENS\",\n\t\texternal: false\n\t};\n}\n/**\n* Provenance for a **non-mainnet bound-local** reverse hit (002 SF-1 / D-R7). Marks the name as\n* network-local via `scopedToNetworkId` so chain-agnostic consumers can gate display without EVM\n* imports (INV-5 / INV-28). Mainnet-bound hits keep {@link baseEnsProvenance} (absent scope).\n*/\nfunction boundReverseProvenance(networkId) {\n\treturn {\n\t\tlabel: \"ENS\",\n\t\texternal: false,\n\t\tscopedToNetworkId: networkId\n\t};\n}\n\n//#endregion\n//#region src/name-resolution/service.ts\n/**\n* EVM name-resolution service — forward path (SF-2).\n*\n* Implements the `NameResolutionCapability` forward surface (`isValidName` + `resolveName`), sans the\n* `RuntimeCapability` mixin the factory adds via `guardRuntimeCapability`. A thin service over viem's\n* `getEnsAddress` (Universal Resolver — ENSIP-10 wildcard + CCIP-Read built in); it constructs no\n* on-chain reader / ABI of its own (Design: \"viem's `getEnsAddress` IS the on-chain reader\").\n*\n* ## The load-bearing choices\n*\n* - **`strict: true`** on the one `getEnsAddress` call (INV-7, G1 — fund safety): distinct failure\n*   classes surface as typed reverts instead of collapsing into `null`. Under `strict: true` only a\n*   genuine empty-record decode returns `null`; every resolver/gateway/transport failure throws.\n* - **Never throw for expected failures** (INV-6): every anticipated outcome resolves to a\n*   discriminated `{ ok: false, error }`. The sole sanctioned throw is `RuntimeDisposedError`, raised\n*   by the factory's guard proxy *before* this body runs — so it is never observed here.\n* - **Deterministic, total, closed classification** (INV-10/INV-12): a fixed precedence — sync\n*   support-gate → shape gate → normalize → the network call → an ordered `catch` — maps every\n*   outcome onto exactly one member of the closed seven-code `NameResolutionError` union. SF-2 owns\n*   the not-found / unsupported-name / unsupported-network codes on its control path (Part A);\n*   everything else is delegated to SF-1's total `mapNameResolutionError` (Part B).\n*\n* The forward-path native-error → code table (Design D-E) was validated against **viem@2.44.x** (the\n* workspace lockfile pin); the declared peer/dependency floor remains `^2.35.0` (ENS v2 readiness —\n* see `.changeset/ens-v2-viem-floor.md`). The UR revert `errorName`s (`ResolverNotFound`,\n* `ResolverNotContract`, `ResolverError`, `UnsupportedResolverProfile`) are reached via\n* `extractRevertInfo(err).errorName` and pre-classified here; a viem major bump requires\n* re-validating this table and SF-1's mapper. Unknown `errorName`s degrade safely via SF-1's\n* `ADAPTER_ERROR` fallback (so older floors in the `^2.35` range remain total).\n*\n* @module name-resolution/service\n*/\n/** The ENSIP-9 coinType for ETH / Ethereum mainnet — a mainnet-bound (unscoped) resolution (D-V1). */\nconst ETH_COIN_TYPE = 60n;\n/**\n* Mint a **per-call** observing client that reports whether an `OffchainLookup` (ERC-3668 CCIP-Read)\n* was actually followed during a single resolution (INV-9, D-V5), without mutating the borrowed source\n* client (INV-21) and without opening a new RPC connection (INV-23).\n*\n* The offchain traversal is observed by wrapping the client-level `ccipRead.request` hook: viem's\n* `offchainLookup` reads `client.ccipRead.request` from the client the action runs on, so a client\n* carrying our wrapper — which flips a **call-local** flag then delegates to the source client's own\n* hook (or viem's default {@link ccipRequest}) — sees every real gateway hop and none of another\n* concurrent call's (each call gets its own client + flag, so `sawOffchain` never cross-contaminates —\n* INV-18).\n*\n* viem pre-binds a client's actions to that client, so overriding `ccipRead` on a shallow clone would\n* be ignored by the source's pre-bound `getEnsAddress`. When the source exposes a reusable transport\n* (`client.request` + `chain` — every real viem client), we therefore build a fresh client over\n* `custom(client)` (which delegates transport requests back to the borrowed client — no new\n* connection, borrowed client untouched) with our `ccipRead` installed. A transport-less client (e.g.\n* a hand-rolled unit-test double that stubs `getEnsAddress` directly and performs no real offchain\n* lookup) is reused as-is with `ccipRead` overridden — there is no gateway hop to observe there.\n*/\nfunction deriveObservingClient(client, onOffchain) {\n\tconst request = async (params) => {\n\t\tonOffchain();\n\t\treturn (typeof client.ccipRead === \"object\" && typeof client.ccipRead?.request === \"function\" ? client.ccipRead.request : ccipRequest)(params);\n\t};\n\tconst ccipRead = { request };\n\tif (typeof client.request === \"function\" && client.chain) return createPublicClient({\n\t\tchain: client.chain,\n\t\ttransport: custom(client, {\n\t\t\tretryCount: 0,\n\t\t\tretryDelay: 0\n\t\t}),\n\t\tccipRead\n\t});\n\treturn Object.assign(Object.create(client), { ccipRead });\n}\nconst LOG_SYSTEM = \"EvmNameResolutionService\";\n/**\n* Curate a user-safe `UNSUPPORTED_NAME.reason` from a normalization throw (Design D-D).\n*\n* The `normalize` failure describes the *name* (a disallowed character, a bad label), never the\n* transport, so it carries no credential; the {@link unsupportedName} constructor additionally\n* redacts it defensively (SF-1 INV-16 / INV-19). We surface the underlying message when present to\n* keep the reason actionable, and never concatenate any error other than the normalize throw.\n*/\nfunction describeNormalizeFailure(error) {\n\tconst base = \"name failed ENS normalization\";\n\treturn error instanceof Error && error.message.length > 0 ? `${base}: ${error.message}` : base;\n}\n/**\n* EVM implementation of the `NameResolutionCapability` forward surface. Holds only the injected viem\n* client and the bound (read-only) network config — no resolution state, cache, or memo (INV-13):\n* repeated calls converge and concurrent calls never interfere.\n*/\nvar EvmNameResolutionService = class {\n\t/**\n\t* Frozen at construct time — only `=== true` enables miss-fallback (INV-2 / 003 SF-1).\n\t*/\n\tenableMainnetL1MissFallback;\n\t/**\n\t* @param networkConfig - The bound (read-only) network config.\n\t* @param publicClient  - The bound per-network viem client (D-A). Borrowed, never disposed (INV-21).\n\t* @param ensL1Client   - SF-5, OPTIONAL. Mainnet client for non-UR forward chain-scoped resolution\n\t*   and for L1 miss-fallback when {@link enableMainnetL1MissFallback} is explicitly `true`.\n\t* @param enableMainnetL1MissFallback - 003 SF-1 opt-in; normalized to strict `true` only (INV-2).\n\t*/\n\tconstructor(networkConfig, publicClient, ensL1Client, enableMainnetL1MissFallback) {\n\t\tthis.networkConfig = networkConfig;\n\t\tthis.publicClient = publicClient;\n\t\tthis.ensL1Client = ensL1Client;\n\t\tthis.enableMainnetL1MissFallback = enableMainnetL1MissFallback === true;\n\t}\n\t/**\n\t* Synchronous ENSIP-15 shape check (INV-3/INV-4). No I/O; delegates to the client-free\n\t* {@link isValidEnsName} helper so consumers and `resolveName` share one gate.\n\t*/\n\tisValidName(name) {\n\t\treturn isValidName(name);\n\t}\n\t/**\n\t* Forward resolution: name → address. Returns a discriminated {@link ResolutionResult}; **never\n\t* throws for an expected failure** (INV-1/INV-11). Fixed classification precedence (INV-17):\n\t*\n\t* 0. use-after-dispose → `RuntimeDisposedError` (raised by the guard proxy, before this body)\n\t* 1. CLIENT + coinType selection (sync, before any I/O — INV-16/INV-17):\n\t*      a. bound chain carries a Universal Resolver → bound client, `coinType = 60` (mainnet-bound)\n\t*      b. else an `ensL1Client` is wired → L1 client, `coinType = toCoinType(boundChainId)`\n\t*         (chain-scoped); a non-ENSIP-11 chainId throws → `UNSUPPORTED_NETWORK` (INV-16)\n\t*      c. else → `UNSUPPORTED_NETWORK` (D-B preserved — SF-2 parity when no L1 client is wired)\n\t* 2. shape gate fails → `UNSUPPORTED_NAME`\n\t* 3. normalize throws → `UNSUPPORTED_NAME`  (D-D backstop)\n\t* 4–5. delegated to {@link resolveVia}: the one `getEnsAddress` call + ordered catch.\n\t* 6. 003 SF-4 (UR bound only): bound `NAME_NOT_FOUND` + opt-in ON → single L1 `resolveVia` +\n\t*    SF-2 fallback triplet on success; bound gateway/`UNSUPPORTED_NAME` → terminal (INV-10).\n\t*\n\t* The selection ladder runs **before** the shape/normalize gates so an unsupported network wins\n\t* over a malformed name (SF-2 INV-12 precedence, preserved verbatim: a bad name on an unsupported\n\t* network is `UNSUPPORTED_NETWORK`, not `UNSUPPORTED_NAME`). Gates 1–3 all run before any network\n\t* round-trip (INV-22).\n\t*/\n\tasync resolveName(name) {\n\t\tconst selectedBoundBranch = this.supportsEns();\n\t\tlet client;\n\t\tlet coinType;\n\t\tif (selectedBoundBranch) {\n\t\t\tclient = this.publicClient;\n\t\t\tcoinType = ETH_COIN_TYPE;\n\t\t} else if (this.ensL1Client) {\n\t\t\ttry {\n\t\t\t\tcoinType = deriveCoinType(this.networkConfig.chainId);\n\t\t\t} catch {\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: unsupportedNetwork(this.networkConfig.id)\n\t\t\t\t};\n\t\t\t}\n\t\t\tclient = this.ensL1Client;\n\t\t} else return {\n\t\t\tok: false,\n\t\t\terror: unsupportedNetwork(this.networkConfig.id)\n\t\t};\n\t\tif (!isValidName(name)) return {\n\t\t\tok: false,\n\t\t\terror: unsupportedName(name, \"not a well-formed ENS name\")\n\t\t};\n\t\tlet normalized;\n\t\ttry {\n\t\t\tnormalized = normalizeName(name);\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: unsupportedName(name, describeNormalizeFailure(error))\n\t\t\t};\n\t\t}\n\t\tconst result = await this.resolveVia(client, coinType, name, normalized);\n\t\tif (selectedBoundBranch && this.isForwardBoundMissEligibleForL1(result) && this.mayConsultL1ForMissFallback()) {\n\t\t\tconst l1Result = await this.resolveVia(this.ensL1Client, ETH_COIN_TYPE, name, normalized);\n\t\t\tif (!l1Result.ok) return l1Result;\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tvalue: {\n\t\t\t\t\t...l1Result.value,\n\t\t\t\t\tprovenance: composeNetworkFallbackProvenance(l1Result.value.provenance, {\n\t\t\t\t\t\tqueriedOnNetworkId: this.networkConfig.id,\n\t\t\t\t\t\tresolvedOnNetworkId: MAINNET_NETWORK_ID\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* True iff the bound-tier forward attempt is a definitive empty / no-record miss eligible for L1\n\t* consult — NOT transport failure, NOT UNSUPPORTED_NAME (SF-4 INV-11 / D-S4-1).\n\t*/\n\tisForwardBoundMissEligibleForL1(result) {\n\t\treturn !result.ok && result.error.code === \"NAME_NOT_FOUND\";\n\t}\n\t/**\n\t* The shared forward success routine, run identically for both client selections (INV-1/INV-3).\n\t* Performs the **one** `getEnsAddress` call under `strict: true` (INV-12) on a per-call observing\n\t* client (INV-9/INV-18), builds an {@link EnsProvenance} on success from the observed `external`\n\t* (INV-3), and classifies a caught failure through the same ordered catch as SF-2 — now feeding the\n\t* **observed** `sawOffchain` as `viaGateway` (INV-13) so a gateway failure on either path dominates\n\t* to `EXTERNAL_GATEWAY_ERROR` and never silently falls back (INV-14).\n\t*/\n\tasync resolveVia(client, coinType, name, normalized) {\n\t\tlet sawOffchain = false;\n\t\tconst callClient = deriveObservingClient(client, () => {\n\t\t\tsawOffchain = true;\n\t\t});\n\t\tconst started = performance.now();\n\t\ttry {\n\t\t\tconst address = await callClient.getEnsAddress({\n\t\t\t\tname: normalized,\n\t\t\t\t...coinType !== ETH_COIN_TYPE ? { coinType } : {},\n\t\t\t\tstrict: true\n\t\t\t});\n\t\t\tif (address === null) return {\n\t\t\t\tok: false,\n\t\t\t\terror: nameNotFound(name)\n\t\t\t};\n\t\t\tif (!isValidEvmAddress(address)) return {\n\t\t\t\tok: false,\n\t\t\t\terror: nameNotFound(name)\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tvalue: {\n\t\t\t\t\tname,\n\t\t\t\t\taddress: getAddress(address),\n\t\t\t\t\tprovenance: buildEnsProvenance({\n\t\t\t\t\t\texternal: sawOffchain,\n\t\t\t\t\t\tcoinType,\n\t\t\t\t\t\tnetworkId: this.networkConfig.id\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tswitch (error instanceof BaseError ? extractRevertInfo(error).errorName : void 0) {\n\t\t\t\tcase \"ResolverNotFound\":\n\t\t\t\tcase \"ResolverNotContract\":\n\t\t\t\tcase \"ResolverError\": return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: nameNotFound(name)\n\t\t\t\t};\n\t\t\t\tcase \"UnsupportedResolverProfile\": return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: unsupportedName(name, \"the ENS resolver for this name does not implement address (addr) resolution\")\n\t\t\t\t};\n\t\t\t\tdefault: return {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: mapNameResolutionError(error, {\n\t\t\t\t\t\tnetworkId: this.networkConfig.id,\n\t\t\t\t\t\telapsedMs: performance.now() - started,\n\t\t\t\t\t\tviaGateway: sawOffchain\n\t\t\t\t\t})\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Reverse resolution: address → name (002 SF-1 / 003 SF-3 Option B miss-fallback). Returns a\n\t* discriminated {@link ResolutionResult}; **never throws for an expected failure** (INV-7). The\n\t* sole sanctioned throw is `RuntimeDisposedError`, raised by the factory's guard proxy *before*\n\t* this body runs.\n\t*\n\t* 003 SF-3 ladder (inherits 002 Option B; L1 tiers gated by SF-1 `mayConsultL1ForMissFallback()`):\n\t*\n\t* 0. use-after-dispose → `RuntimeDisposedError` (guard proxy)\n\t* 1. malformed address → `ADDRESS_NOT_FOUND` (sync, before I/O)\n\t* 2. `supportsEns()` → bound `attemptReverse` first\n\t*      - success → bound provenance per D-R7; stop (no L1)\n\t*      - failure → typed error; stop (**no** miss-fallback — INV-9)\n\t*      - empty + `mayConsultL1ForMissFallback()` → L1 `attemptReverse` (003 SF-1)\n\t*      - empty + gate false → `ADDRESS_NOT_FOUND`\n\t* 3. else `mayConsultL1ForMissFallback()` → L1 direct (non-UR)\n\t* 4. else → `UNSUPPORTED_NETWORK` (sync, before I/O)\n\t*\n\t* L1 success after bound-empty miss: `buildEnsProvenance` + SF-2 fallback triplet\n\t* (`precededByBoundMiss`). Non-UR direct L1: `buildEnsProvenance` only (001-1b parity).\n\t* `scopedToNetworkId` absent on all L1 hits (002 D-R7). Opt-in OFF: bound-empty / non-UR\n\t* terminate without L1 (SF-1 SC-001).\n\t*\n\t* Bound and L1 attempts use `strict: true`, Approach A suppress-on-mismatch, observing clients\n\t* for truthful `viaGateway`, and selected-client avatar affinity (INV-18).\n\t*\n\t* @throws {RuntimeDisposedError} on use-after-dispose (guard proxy, before this body) — the sole throw.\n\t*/\n\tasync resolveAddress(address) {\n\t\tif (!isValidEvmAddress(address)) return {\n\t\t\tok: false,\n\t\t\terror: addressNotFound(address)\n\t\t};\n\t\tif (this.supportsEns()) {\n\t\t\tconst boundOutcome = await this.attemptReverse(this.publicClient, address, \"bound\");\n\t\t\tif (boundOutcome.kind === \"success\") return {\n\t\t\t\tok: true,\n\t\t\t\tvalue: boundOutcome.value\n\t\t\t};\n\t\t\tif (boundOutcome.kind === \"failure\") return boundOutcome.result;\n\t\t\tif (this.mayConsultL1ForMissFallback()) return this.finishL1Attempt(address, true);\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: addressNotFound(address)\n\t\t\t};\n\t\t}\n\t\tif (this.mayConsultL1ForMissFallback()) return this.finishL1Attempt(address, false);\n\t\treturn {\n\t\t\tok: false,\n\t\t\terror: unsupportedNetwork(this.networkConfig.id)\n\t\t};\n\t}\n\t/**\n\t* Terminal handling for an L1 reverse attempt (direct or miss-fallback). No further client exists\n\t* after L1 — empty and failure both terminate here (INV-10).\n\t*\n\t* @param precededByBoundMiss - When true, bound UR tier returned definitive empty before this L1\n\t*   consult — SF-2 triplet is emitted on success. False for non-UR direct L1 (001-1b parity).\n\t*/\n\tasync finishL1Attempt(address, precededByBoundMiss) {\n\t\tconst l1Outcome = await this.attemptReverse(this.ensL1Client, address, \"l1\", precededByBoundMiss);\n\t\tif (l1Outcome.kind === \"success\") return {\n\t\t\tok: true,\n\t\t\tvalue: l1Outcome.value\n\t\t};\n\t\tif (l1Outcome.kind === \"failure\") return l1Outcome.result;\n\t\treturn {\n\t\t\tok: false,\n\t\t\terror: addressNotFound(address)\n\t\t};\n\t}\n\t/**\n\t* One reverse I/O against `client`: observing wrapper, strict `getEnsName`, Approach A catch table,\n\t* avatar on success via the **same** client (D-R8 / INV-18). Returns success | empty | failure so\n\t* the ladder can distinguish miss-fallback eligibility from typed transport failure (INV-9).\n\t*/\n\tasync attemptReverse(client, address, kind, precededByBoundMiss = false) {\n\t\tlet sawOffchain = false;\n\t\tconst callClient = deriveObservingClient(client, () => {\n\t\t\tsawOffchain = true;\n\t\t});\n\t\tconst started = performance.now();\n\t\tlet name;\n\t\ttry {\n\t\t\tname = await callClient.getEnsName({\n\t\t\t\taddress,\n\t\t\t\tstrict: true\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tswitch (error instanceof BaseError ? extractRevertInfo(error).errorName : void 0) {\n\t\t\t\tcase \"ReverseAddressMismatch\":\n\t\t\t\tcase \"ResolverNotFound\":\n\t\t\t\tcase \"ResolverNotContract\":\n\t\t\t\tcase \"ResolverError\":\n\t\t\t\tcase \"UnsupportedResolverProfile\": return { kind: \"empty\" };\n\t\t\t\tdefault: return {\n\t\t\t\t\tkind: \"failure\",\n\t\t\t\t\tresult: {\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\terror: mapNameResolutionError(error, {\n\t\t\t\t\t\t\tnetworkId: this.networkConfig.id,\n\t\t\t\t\t\t\telapsedMs: performance.now() - started,\n\t\t\t\t\t\t\tviaGateway: sawOffchain\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (name === null) return { kind: \"empty\" };\n\t\tconst avatarUrl = await this.tryGetAvatar(client, name);\n\t\tconst baseProvenance = kind === \"l1\" ? buildEnsProvenance({\n\t\t\texternal: sawOffchain,\n\t\t\tcoinType: ETH_COIN_TYPE,\n\t\t\tnetworkId: this.networkConfig.id\n\t\t}) : this.isMainnetBound() ? baseEnsProvenance() : boundReverseProvenance(this.networkConfig.id);\n\t\tconst provenance = kind === \"l1\" && precededByBoundMiss ? composeNetworkFallbackProvenance(baseProvenance, {\n\t\t\tqueriedOnNetworkId: this.networkConfig.id,\n\t\t\tresolvedOnNetworkId: MAINNET_NETWORK_ID\n\t\t}) : baseProvenance;\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tvalue: {\n\t\t\t\taddress,\n\t\t\t\tname,\n\t\t\t\tforwardVerified: true,\n\t\t\t\t...avatarUrl !== void 0 ? { avatarUrl } : {},\n\t\t\t\tprovenance\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Authoritative miss-fallback eligibility for both directions (003 SF-1 INV-5).\n\t* L1 consult is permitted only when opt-in is strictly true, L1 client is wired, and the adapter\n\t* is not mainnet-bound (INV-24).\n\t*/\n\tmayConsultL1ForMissFallback() {\n\t\treturn this.enableMainnetL1MissFallback === true && this.ensL1Client !== void 0 && !this.isMainnetBound();\n\t}\n\t/** True when the bound chain is Ethereum mainnet — drives miss-fallback fence and D-R7 scope (INV-22). */\n\tisMainnetBound() {\n\t\treturn this.networkConfig.chainId === mainnet.id;\n\t}\n\t/**\n\t* No-op teardown beyond a debug log. The injected `PublicClient` is owned by the composing runtime\n\t* (D-A / INV-15): the capability BORROWS it and never closes its transport — after dispose the same\n\t* client remains fully usable by the runtime and any capability sharing it. `cleanupStage` is\n\t* `'general'` (not `'rpc'`) precisely because SF-2 releases no RPC resource of its own.\n\t*/\n\tdispose() {\n\t\tlogger.debug(LOG_SYSTEM, \"Name-resolution service disposed (borrowed client left intact).\");\n\t}\n\t/**\n\t* Whether the bound chain carries an ENS Universal Resolver — mirrors what viem's\n\t* `getChainContractAddress` reads. Purely synchronous; the pre-I/O basis of D-B (INV-16) that\n\t* pre-empts viem's own `ChainDoesNotSupportContract`/no-chain throws before the network call.\n\t*/\n\tsupportsEns() {\n\t\treturn Boolean(this.publicClient.chain?.contracts?.ensUniversalResolver?.address);\n\t}\n\t/**\n\t* Best-effort, name-keyed avatar lookup (D-R5). Runs ONLY after a successful reverse and is fully\n\t* failure- and latency-isolated (INV-17): a SECOND UR round-trip (`getEnsAvatar` → text `avatar`\n\t* key) plus a possible THIRD hop inside viem's `parseAvatarRecord` (NFT/IPFS/HTTP asset resolution).\n\t* ANY outcome — gateway error, unreachable asset host, malformed avatar record, timeout — yields\n\t* `undefined`, never widening the reverse call's never-throw surface (INV-6) and never participating\n\t* in error classification (INV-8/INV-10). viem itself swallows `parseAvatarRecord` errors → `null`;\n\t* the `try/catch` here additionally absorbs the UR/text-lookup throws `strict: true` would raise, and\n\t* `?? undefined` normalizes a `null` so the caller's conditional spread never emits `avatarUrl: null`\n\t* (INV-4).\n\t*\n\t* The returned URL is untrusted, name-owner-controlled content (INV-19): passed through verbatim —\n\t* the adapter neither fetches nor sanitizes the asset beyond what `getEnsAvatar` already did — and it\n\t* (and the avatar record) is never logged. viem defaults are used; no custom gateway/host or deadline\n\t* is hardcoded (INV-18/INV-20). No retry loop — a single bounded `await` (INV-18).\n\t*/\n\tasync tryGetAvatar(client, name) {\n\t\ttry {\n\t\t\treturn await client.getEnsAvatar({\n\t\t\t\tname: normalizeName(name),\n\t\t\t\tstrict: true\n\t\t\t}) ?? void 0;\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n};\nfunction createEvmNameResolutionService(networkConfig, publicClient, ensL1Client, options) {\n\treturn new EvmNameResolutionService(networkConfig, publicClient, ensL1Client, options?.enableMainnetL1MissFallback);\n}\n\n//#endregion\n//#region src/capabilities/name-resolution.ts\n/**\n* Create the EVM name-resolution capability (forward path — SF-2).\n*\n* Mirrors {@link createERC4626}: narrows the network config, assembles the service over the injected\n* viem client, and wraps it with `guardRuntimeCapability` for the `RuntimeCapability` surface\n* (network context, idempotent `dispose()`, use-after-dispose → `RuntimeDisposedError` raised before\n* the method body, in-flight-promise rejection on dispose).\n*\n* The capability is ALWAYS constructible on EVM: `isValidName` is network-independent, and\n* `resolveName` is always present (it reports `UNSUPPORTED_NETWORK` for a bound network without a\n* Universal Resolver rather than being omitted). Whole-capability omission is reserved for non-EVM\n* adapters (SC-006). `cleanupStage: 'general'` — the capability releases no RPC resource of its own\n* (it borrows the runtime's client — INV-15).\n*/\nfunction createNameResolution(config, options) {\n\tconst networkConfig = asTypedEvmNetworkConfig(config);\n\tconst service = createEvmNameResolutionService(networkConfig, options.publicClient, options.ensL1Client, { enableMainnetL1MissFallback: options.enableMainnetL1MissFallback });\n\treturn guardRuntimeCapability(service, networkConfig, \"nameResolution\", () => service.dispose(), \"general\");\n}\n\n//#endregion\n//#region src/profiles/index.ts\nfunction createRuntime(profile, config, factories, options) {\n\tif (!isProfileName(profile)) throw new TypeError(`Invalid profile name: ${profile}. Expected one of declarative, viewer, transactor, composer, operator.`);\n\tswitch (profile) {\n\t\tcase \"declarative\": return createDeclarativeRuntime(config, factories, options);\n\t\tcase \"viewer\": return createViewerRuntime(config, factories, options);\n\t\tcase \"transactor\": return createTransactorRuntime(config, factories, options);\n\t\tcase \"composer\": return createComposerRuntime(config, factories, options);\n\t\tcase \"operator\": return createOperatorRuntime(config, factories, options);\n\t}\n}\n\n//#endregion\nexport { AbiComparisonService, ConnectorDialog, CustomAccountDisplay, CustomConnectButton, CustomNetworkSwitcher, DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_ROLE_LABEL, DEFAULT_DISCONNECTED_STATUS, ELAPSED_UNMEASURED, EVM_PROVIDER_ORDER_DEFAULT, EVM_TYPE_TO_FIELD_TYPE, EoaExecutionStrategy, EvmAccessControlService, EvmErc3643Service, EvmErc4626Service, EvmIRSService, EvmIndexerClient, EvmNameResolutionService, EvmProviderKeys, MAINNET_NETWORK_ID, RelayerExecutionStrategy, SafeWagmiComponent, WagmiProviderInitializedContext, WagmiWalletImplementation, ZERO_ADDRESS, abiComparisonService, addressNotFound, assembleAcceptAdminTransferAction, assembleAcceptOwnershipAction, assembleBeginAdminTransferAction, assembleCancelAdminTransferAction, assembleChangeAdminDelayAction, assembleGrantRoleAction, assembleRenounceOwnershipAction, assembleRenounceRoleAction, assembleRevokeRoleAction, assembleRollbackAdminDelayAction, assembleTransferOwnershipAction, baseEnsProvenance, boundReverseProvenance, buildClaimPayload, buildEnsProvenance, buildRpcUrl, compareContractDefinitions, composeNetworkFallbackProvenance, connectAndEnsureCorrectNetworkCore, createAbiFunctionItem, createAccessControl, createAddressing, createComposerRuntime, createContractLoading, createDeclarativeRuntime, createERC3643, createERC4626, createEvmAccessControlService, createEvmErc3643Service, createEvmErc4626Service, createEvmIRSService, createEvmNameResolutionService, createEvmPublicClient, createExecution, createExplorer, createIRS, createIndexerClient, createNameResolution, createNetworkCatalog, createOperatorRuntime, createQuery, createRainbowKitComponents, createRainbowKitConnectButton, createRainbowKitWagmiConfig, createRelayer, createRuntime, createSchema, createTransactorRuntime, createTypeMapping, createUiKit, createUiKitManager, createUiLabels, createViewerRuntime, createWallet, deriveCoinType, detectAccessControlCapabilities, detectProxyFromAbi, ensureRainbowKitAssetsLoaded, executeEvmTransaction, extractRainbowKitCustomizations, filterWalletComponents, formatEvmFunctionResult, formatEvmTransactionData, formatInputName, formatMethodName, generateEvmDefaultField, generateRainbowKitConfigFile, generateRainbowKitExportables, getAdmin, getAdminAddress, getComponentExclusionsFromConfig, getCurrentBlock, getEvmCompatibleFieldTypes, getEvmCurrentBlock, getEvmExplorerAddressUrl, getEvmExplorerTxUrl, getEvmTypeMappingInfo, getImplementationAddress, getJurisdiction as getIrsJurisdiction, getOnchainId, getRawUserNativeConfig, getSourcifyContractAppUrl, getUserAccessControlIndexerUrl, getUserRpcUrl, getWagmiConfigForRainbowKit, gweiToWei, hashContractDefinition, isEnsProvenance, isEvmContractArtifacts, isEvmProviderKey, isEvmViewFunction, isVerified as isIrsVerified, isRainbowKitCustomizations, isTrustedIssuer, isValidAbiArray, isValidAbiItem, isValidEvmAddress, isValidName, loadAbiFromEtherscan, loadAbiFromEtherscanV1, loadAbiFromEtherscanV2, loadAbiFromSourcify, loadContractSchema, loadContractWithFullMetadata, loadEvmContract, mapErc3643Error, mapErc4626Error, mapEvmParamTypeToFieldType, mapNameResolutionError, nameNotFound, networkFallbackProvenanceFields, normalizeName, parseEvmInput, queryEvmViewFunction, readCurrentRoles, readOwnership, resolveAccessControlIndexerUrl, resolveAndInitializeKitConfig, resolveExplorerApiKeyFromAppConfig, resolveExplorerConfig, resolveFullUiKitConfiguration, resolveRpcUrl, scopedNetworkId, shouldUseV2Api, signAndBroadcastEvmTransaction, stringifyWithBigInt, testEtherscanV2Connection, testEvmExplorerConnection, testEvmNetworkServiceConnection, testEvmRpcConnection, transformAbiToSchema, unsupportedName, unsupportedNetwork, useIsWagmiProviderInitialized, useManagedWagmiDisconnect, validateAccessControlSupport, validateAddress, validateAndConvertEvmArtifacts, validateContractDefinition, validateEoaConfig, validateEvmEoaConfig, validateEvmExecutionConfig, validateEvmExplorerConfig, validateEvmNetworkServiceConfig, validateEvmRelayerConfig, validateEvmRpcEndpoint, validateRainbowKitConfig, validateRelayerConfig, validateRoleId, validateRoleIds, waitForEvmTransactionConfirmation, weiToGwei };\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,yBAAyB,gBAAgB,YAAY,iBAAiB,QAAQ;AACtF,QAAO,KAAK,4BAA4B,iDAAiD,aAAa;CACtG,MAAM,kBAAkB,eAAe,UAAU,MAAM,OAAO,GAAG,OAAO,WAAW;AACnF,KAAI,CAAC,gBAAiB,OAAM,IAAI,MAAM,2BAA2B,WAAW,yCAAyC;CACrH,MAAM,eAAe,gBAAgB;CACrC,MAAM,mBAAmB,EAAE;AAC3B,MAAK,MAAM,eAAe,cAAc;EACvC,MAAM,cAAc,OAAO,MAAM,UAA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