@lombard.finance/sdk 0.11.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +4 -4
  2. package/dist/index.cjs +65 -1
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +3491 -925
  5. package/dist/index.js.map +1 -1
  6. package/dist/style.css +1 -0
  7. package/package.json +1 -1
  8. package/src/common/types/types.ts +2 -1
  9. package/src/index.ts +1 -0
  10. package/src/provider/rpcUrlConfig.ts +4 -0
  11. package/src/sdk/apiConfig.ts +5 -1
  12. package/src/sdk/const.ts +1 -0
  13. package/src/sdk/getDepositsByAddress/getDepositsByAddress.ts +39 -10
  14. package/src/sdk/{getLBTCExchageRate/getLBTCExchageRate.stories.tsx → getLBTCExchangeRate/getLBTCExchangeRate.stories.tsx} +8 -8
  15. package/src/sdk/getLBTCExchangeRate/getLBTCExchangeRate.ts +65 -0
  16. package/src/sdk/getLBTCExchangeRate/index.ts +1 -0
  17. package/src/sdk/getNetworkFeeSignature/getNetworkFeeSignature.stories.tsx +85 -0
  18. package/src/sdk/getNetworkFeeSignature/getNetworkFeeSignature.ts +81 -0
  19. package/src/sdk/getNetworkFeeSignature/index.ts +1 -0
  20. package/src/sdk/index.ts +4 -1
  21. package/src/sdk/storeNetworkFeeSignature/index.ts +1 -0
  22. package/src/sdk/storeNetworkFeeSignature/storeNetworkFeeSignature.stories.tsx +86 -0
  23. package/src/sdk/storeNetworkFeeSignature/storeNetworkFeeSignature.ts +62 -0
  24. package/src/sdk/utils/getCainIdByName.ts +1 -1
  25. package/src/sdk/utils/getChainNameById.ts +1 -0
  26. package/src/stories/components/Button/Button.tsx +0 -4
  27. package/src/web3Sdk/abi/LBTC.json +542 -354
  28. package/src/web3Sdk/basculeAddressConfig.ts +6 -3
  29. package/src/web3Sdk/claimLBTC/claimLBTC.ts +4 -1
  30. package/src/web3Sdk/getLBTCMintingFee/getLBTCMintingFee.stories.tsx +65 -0
  31. package/src/web3Sdk/getLBTCMintingFee/getLBTCMintingFee.tsx +51 -0
  32. package/src/web3Sdk/getLBTCMintingFee/index.ts +1 -0
  33. package/src/web3Sdk/getPermitNonce/getPermitNonce.stories.tsx +65 -0
  34. package/src/web3Sdk/getPermitNonce/getPermitNonce.ts +47 -0
  35. package/src/web3Sdk/getPermitNonce/index.ts +1 -0
  36. package/src/web3Sdk/index.ts +9 -3
  37. package/src/web3Sdk/lbtcAddressConfig.ts +4 -2
  38. package/src/web3Sdk/signNetworkFee/getTypedData.ts +41 -0
  39. package/src/web3Sdk/signNetworkFee/index.ts +1 -0
  40. package/src/web3Sdk/signNetworkFee/signNetworkFee.stories.tsx +92 -0
  41. package/src/web3Sdk/signNetworkFee/signNetworkFee.ts +82 -0
  42. package/src/web3Sdk/utils/chainIdToEnv.ts +10 -0
  43. package/src/web3Sdk/utils/getGasMultiplier.ts +1 -0
  44. package/src/web3Sdk/utils/getRpcUrlConfigFromChain.ts +34 -0
  45. package/src/sdk/getLBTCExchageRate/getLBTCExchageRate.ts +0 -43
  46. package/src/sdk/getLBTCExchageRate/index.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/common/types/types.ts","../src/common/const.ts","../src/sdk/apiConfig.ts","../src/common/utils/getErrorMessage.ts","../src/sdk/internalTypes.ts","../src/sdk/utils/getChainNameById.ts","../src/sdk/generateDepositBtcAddress/generateDepositBtcAddress.ts","../src/sdk/getDepositBtcAddress/getDepositBtcAddress.ts","../src/common/utils/convertSatoshi.ts","../src/sdk/utils/getCainIdByName.ts","../src/sdk/getDepositsByAddress/getDepositsByAddress.ts","../src/sdk/getLBTCExchageRate/getLBTCExchageRate.ts","../src/provider/rpcUrlConfig.ts","../src/provider/utils/getMaxPriorityFeePerGas.ts","../src/provider/ReadProvider.ts","../src/provider/Provider.ts","../src/web3Sdk/utils/getGasMultiplier.ts","../src/common/utils/isValidChain.ts","../src/web3Sdk/lbtcAddressConfig.ts","../src/web3Sdk/utils/getTokenABI.ts","../src/web3Sdk/utils/getLbtcTokenContract.ts","../src/web3Sdk/approveLBTC/approveLBTC.ts","../src/web3Sdk/claimLBTC/claimLBTC.ts","../src/web3Sdk/signLbtcDestionationAddr/signLbtcDestionationAddr.ts","../src/btcSdk/utils/getOutputScript.ts","../src/web3Sdk/unstakeLBTC/unstakeLBTC.ts","../../../node_modules/web3-errors/lib/esm/error_codes.js","../../../node_modules/web3-errors/lib/esm/web3_error_base.js","../../../node_modules/web3-errors/lib/esm/errors/rpc_error_messages.js","../../../node_modules/web3-errors/lib/esm/errors/rpc_errors.js","../../../node_modules/web3-validator/lib/esm/validation/string.js","../../../node_modules/web3-types/lib/esm/data_format_types.js","../../../node_modules/web3-types/lib/esm/eth_types.js","../src/web3Sdk/basculeAddressConfig.ts","../src/web3Sdk/utils/getBasculeTokenContract.ts","../src/web3Sdk/getBasculeDepositStatus/getBasculeDepositStatus.ts","../src/web3Sdk/getLBTCTotalSupply/getLBTCTotalSupply.ts","../src/web3Sdk/lbtcOFTAdapterAddressConfig.ts"],"sourcesContent":["export const OEnv = {\n prod: 'prod',\n testnet: 'testnet',\n stage: 'stage',\n} as const;\n\nexport type TEnv = (typeof OEnv)[keyof typeof OEnv];\n\nexport const OChainId = {\n ethereum: 1,\n holesky: 17000,\n binanceSmartChain: 56,\n binanceSmartChainTestnet: 97,\n base: 8453,\n baseTestnet: 84532,\n berachainBartioTestnet: 80084,\n sepolia: 11155111,\n corn: 21000000,\n} as const;\n\nexport type TChainId = (typeof OChainId)[keyof typeof OChainId];\n\nexport type TOFTChainId =\n | (typeof OChainId)['berachainBartioTestnet']\n | (typeof OChainId)['sepolia']\n | (typeof OChainId)['corn']\n | (typeof OChainId)['ethereum'];\n\n/**\n * Abstract EIP-1193 provider\n */\nexport interface IEIP1193Provider {\n request: (args: any) => Promise<any>;\n}\n","import { OEnv, TEnv } from './types/types';\n\nexport const defaultEnv: TEnv = OEnv.prod;\n\n/**\n * Address of the zero account.\n * Can also be used as a placeholder for unknown addresses.\n */\nexport const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';\n","import { defaultEnv } from '../common/const';\nimport { OEnv, TEnv } from '../common/types/types';\n\ninterface IApiConfig {\n baseApiUrl: string;\n}\n\nconst stageConfig: IApiConfig = {\n baseApiUrl: 'https://staging.prod.lombard.finance',\n};\n\nconst testnetConfig: IApiConfig = {\n baseApiUrl: 'https://gastald-testnet.prod.lombard.finance',\n};\n\nconst prodConfig: IApiConfig = {\n baseApiUrl: 'https://mainnet.prod.lombard.finance',\n};\n\nexport const getApiConfig = (env: TEnv = defaultEnv): IApiConfig => {\n switch (env) {\n case OEnv.prod:\n return prodConfig;\n case OEnv.testnet:\n return testnetConfig;\n default:\n return stageConfig;\n }\n};\n","import { AxiosError } from 'axios';\n\n/**\n * Retrieves the error message from the given error object.\n *\n * @param error - The error object.\n * @returns The error message as a string.\n */\nexport function getErrorMessage(error: unknown): string {\n if (typeof error === 'string') {\n return error;\n }\n\n const hasDataMessage = (err: any): err is { data: { message: string } } =>\n err?.data?.message && typeof err.data.message === 'string';\n\n if (hasDataMessage(error)) {\n return error.data.message;\n }\n\n if (error instanceof Error) {\n return getAxiosErrorMessage(error as AxiosError);\n }\n\n return getErrorMessageFromObject(error);\n}\n\nfunction getAxiosErrorMessage(error: AxiosError): string {\n if (error.response) {\n return (error.response.data as { message: string }).message;\n }\n\n return error.message;\n}\n\nfunction getErrorMessageFromObject(error: any): string {\n if (error?.message) {\n return error.message;\n }\n\n return 'Unknown error';\n}\n","export const OChainName = {\n eth: 'DESTINATION_BLOCKCHAIN_ETHEREUM',\n} as const;\n\nexport type TChainName = (typeof OChainName)[keyof typeof OChainName];\n","import { OChainId, TChainId } from '../../common/types/types';\nimport { OChainName, TChainName } from '../internalTypes';\n\n/**\n * @param chainId the chain ID\n *\n * @returns the chain name\n */\nexport function getChainNameById(chainId: TChainId): TChainName {\n switch (chainId) {\n case OChainId.holesky:\n case OChainId.ethereum:\n return OChainName.eth;\n default:\n throw new Error(`Unknown chain ID: ${chainId}`);\n }\n}\n","import axios from 'axios';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { TChainId } from '../../common/types/types';\nimport { getErrorMessage } from '../../common/utils/getErrorMessage';\nimport { getApiConfig } from '../apiConfig';\nimport { getChainNameById } from '../utils/getChainNameById';\n\n/**\n * The address wich will be returned if the provided EVM address is sanctioned.\n */\nexport const SANCTIONED_ADDRESS = 'sanctioned_address';\nconst ADDRESS_URL = 'api/v1/address/generate';\nconst SANCTIONS_MESSAGE = 'destination address is under sanctions';\n\ninterface IGenerateNewAddressResponse {\n address: string;\n}\n\nexport interface IGenerateDepositBtcAddressParams extends IEnvParam {\n /**\n * The destination EVM user address where LBTC will be claimed.\n */\n address: string;\n /**\n * The destination chain ID where LBTC will be claimed.\n */\n chainId: TChainId;\n /**\n * The signature of the address. The signature is generated by signing the address using EVM wallet.\n */\n signature: string;\n /**\n * The captcha token.\n */\n captchaToken?: string;\n /**\n * The referrer code.\n */\n referrerCode?: string;\n /**\n * The referral ID.\n */\n referralId: string;\n}\n\n/**\n * Generates a BTC deposit address.\n *\n * If the provided EVM address is sanctioned, the function will return the `SANCTIONED_ADDRESS`.\n *\n * @param {IGenerateDepositBtcAddressParams} params - The parameters for generating the deposit address.\n * @returns {Promise<string>} The generated deposit address.\n */\nexport async function generateDepositBtcAddress({\n address,\n chainId,\n signature,\n env,\n captchaToken,\n referrerCode,\n referralId,\n}: IGenerateDepositBtcAddressParams): Promise<string> {\n const { baseApiUrl } = getApiConfig(env);\n const toChain = getChainNameById(chainId);\n\n const requestParams = {\n to_address: address,\n to_address_signature: signature,\n to_chain: toChain,\n referrer_code: referrerCode,\n referral_id: referralId,\n nonce: 0,\n captcha: captchaToken,\n };\n\n try {\n const { data } = await axios.post<IGenerateNewAddressResponse>(\n ADDRESS_URL,\n requestParams,\n { baseURL: baseApiUrl },\n );\n\n return data.address;\n } catch (error) {\n const errorMsg = getErrorMessage(error);\n\n if (isSanctioned(errorMsg)) {\n return SANCTIONED_ADDRESS;\n } else {\n throw new Error(errorMsg);\n }\n }\n}\n\nfunction isSanctioned(errorMsg: string): boolean {\n return !!errorMsg.includes(SANCTIONS_MESSAGE);\n}\n","import axios from 'axios';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { TChainId } from '../../common/types/types';\nimport { getApiConfig } from '../apiConfig';\nimport { TChainName } from '../internalTypes';\nimport { getChainNameById } from '../utils/getChainNameById';\n\nconst ADDRESS_URL = 'api/v1/address';\n\ntype TReferralId = 'lombard' | string;\n\ninterface IDepositAddress {\n btc_address: string;\n created_at: string;\n deprecated?: boolean;\n type: string;\n used?: boolean;\n deposit_metadata: {\n referral: TReferralId;\n to_address: string;\n to_blockchain: TChainName;\n };\n}\n\ninterface IDepositAddressesResponse {\n addresses: IDepositAddress[];\n has_more?: boolean;\n}\n\n\nexport interface IGetDepositBtcAddressParams extends IEnvParam {\n /**\n * The destination EVM user address where LBTC will be claimed.\n */\n address: string;\n /**\n * The destination chain ID where LBTC will be claimed.\n */\n chainId: TChainId;\n /**\n * The referral ID.\n */\n referralId: TReferralId;\n}\n\n/**\n * Returns the address for depositing BTC.\n *\n * @param {IGetDepositBtcAddressParams} params - function parameters\n *\n * @returns {Promise<string>} the address for depositing BTC\n */\nexport async function getDepositBtcAddress({\n address,\n chainId,\n env,\n referralId,\n}: IGetDepositBtcAddressParams): Promise<string> {\n const addresses = await getDepositBtcAddresses({\n address,\n chainId,\n env,\n referralId,\n });\n\n const addressData = getActualAddress(addresses);\n\n if (!addressData) {\n throw new Error('No address');\n }\n\n return addressData.btc_address;\n}\n\n/**\n * Retrieves the actual deposit address from a list of deposit addresses.\n *\n * @param addresses - The list of deposit addresses.\n * @returns The actual deposit address or undefined if the last created address is deprecated.\n */\nfunction getActualAddress(\n addresses: IDepositAddress[],\n): IDepositAddress | undefined {\n if (!addresses.length) {\n return undefined;\n }\n\n const actualAddress = addresses.reduce((acc, address) => {\n if (acc.created_at < address.created_at) {\n return address;\n }\n return acc;\n }, addresses[0]);\n\n return actualAddress.deprecated ? undefined : actualAddress;\n}\n\n/**\n * Returns the addresses for depositing BTC.\n *\n * @param {IGetDepositBtcAddressParams} params - function parameters\n *\n * @returns {Promise<IDepositAddress[]>} the deposit addresses\n */\nexport async function getDepositBtcAddresses({\n address,\n chainId,\n env,\n referralId,\n}: IGetDepositBtcAddressParams): Promise<IDepositAddress[]> {\n const { baseApiUrl } = getApiConfig(env);\n const toBlockchain = getChainNameById(chainId);\n\n const requestrParams = {\n to_address: address,\n to_blockchain: toBlockchain,\n limit: 1,\n offset: 0,\n asc: false,\n referralId,\n };\n\n const { data } = await axios.get<IDepositAddressesResponse>(ADDRESS_URL, {\n baseURL: baseApiUrl,\n params: requestrParams,\n });\n\n return data?.addresses || [];\n}\n","const BTC_DECIMALS = 8;\nexport const SATOSHI_SCALE = 10 ** BTC_DECIMALS;\n\n/**\n * Convert Satoshi to BTC\n * @param amount - Satoshi amount\n * @returns BTC amount\n */\nexport function fromSatoshi(amount: number | string) {\n return +amount / SATOSHI_SCALE;\n}\n\n/**\n * Convert BTC to Satoshi\n *\n * @param amount - BTC amount\n * @returns Satoshi amount\n */\nexport function toSatoshi(amount: number | string) {\n return Math.floor(+amount * SATOSHI_SCALE);\n}\n","import { defaultEnv } from '../../common/const';\nimport { OChainId, OEnv, TChainId, TEnv } from '../../common/types/types';\nimport { TChainName } from '../internalTypes';\n\n/**\n * @param chainId the chain ID\n *\n * @returns the chain name\n */\nexport function getCainIdByName(\n chain: string,\n env: TEnv = defaultEnv,\n): TChainId {\n switch (chain as TChainName) {\n case 'DESTINATION_BLOCKCHAIN_ETHEREUM':\n return env === OEnv.prod ? OChainId.ethereum : OChainId.holesky;\n\n default:\n return OChainId.ethereum;\n }\n}\n","import axios from 'axios';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { TChainId, TEnv } from '../../common/types/types';\nimport { fromSatoshi } from '../../common/utils/convertSatoshi';\nimport { getApiConfig } from '../apiConfig';\nimport { getCainIdByName } from '../utils/getCainIdByName';\nimport BigNumber from 'bignumber.js';\n\ntype Address = string;\ntype Seconds = number;\n\ninterface IDepositResponse {\n txid: string;\n value: number;\n address: Address;\n to_chain: string;\n notarization_wait_dur?: string | number;\n index?: number;\n raw_payload?: string;\n payload?: string;\n signature?: string;\n claim_tx?: string;\n block_height?: string;\n block_time?: string;\n sanctioned?: boolean;\n}\n\ninterface IDepositsByAddressResponse {\n outputs: IDepositResponse[];\n}\n\nexport interface IDeposit {\n txid: string;\n index?: number;\n blockHeight?: number;\n blockTime?: number;\n value: BigNumber;\n address: Address;\n chainId?: TChainId;\n isClaimed?: boolean;\n rawPayload?: string;\n signature?: string;\n isRestricted?: boolean;\n notarizationWaitDur?: Seconds;\n // bascule hash id\n payload?: string;\n\n fromChainId?: TChainId;\n toChainId?: TChainId;\n status?: string;\n}\n\nexport interface IGetDepositsByAddressParams extends IEnvParam {\n /**\n * The EVM address to get deposits for\n */\n address: Address;\n}\n\n/**\n * Returns all deposits for a given address\n *\n * @param {IGetDepositsByAddressParams} params\n *\n * @returns {Promise<IDeposit[]>} a list of deposits\n */\nexport async function getDepositsByAddress({\n address,\n env,\n}: IGetDepositsByAddressParams): Promise<IDeposit[]> {\n const { baseApiUrl } = getApiConfig(env);\n\n const { data } = await axios.get<IDepositsByAddressResponse | undefined>(\n `api/v1/address/outputs/${address}`,\n { baseURL: baseApiUrl },\n );\n\n const outputs = data?.outputs ?? [];\n\n return outputs.map(mapResponse(env));\n}\n\nfunction mapResponse(env?: TEnv) {\n return (data: IDepositResponse): IDeposit => ({\n txid: data.txid,\n index: data.index ?? 0,\n blockHeight: data.block_height ? Number(data.block_height) : undefined,\n blockTime: data.block_time ? Number(data.block_time) : undefined,\n value: new BigNumber(fromSatoshi(data.value)),\n address: data.address,\n chainId: getCainIdByName(data.to_chain, env),\n // todo: return claiming tx from the API when it's available\n isClaimed: !!data.claim_tx,\n rawPayload: data.raw_payload,\n signature: data.signature,\n isRestricted: !!data.sanctioned,\n notarizationWaitDur: data.notarization_wait_dur\n ? Number(data.notarization_wait_dur)\n : undefined,\n payload: data.payload,\n });\n}\n","import axios from 'axios';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { TChainId } from '../../common/types/types';\nimport { getApiConfig } from '../apiConfig';\nimport { getChainNameById } from '../utils/getChainNameById';\n\ntype ExchangeRateResponse = {\n amount_out: string;\n};\n\nexport interface IGetLBTCExchageRateParams extends IEnvParam {\n /**\n * The chain id of the asset to get the exchange rate for\n */\n chainId: TChainId;\n /**\n * The amount of the asset to get the exchange rate for\n */\n amount: number;\n}\n\n/**\n * Retrieves the exchange rate for LBTC.\n *\n * @param {IGetLBTCExchageRateParams} params\n *\n * @returns {Promise<string>} - The exchange rate.\n */\nexport async function getLBTCExchageRate({\n env,\n chainId,\n amount,\n}: IGetLBTCExchageRateParams): Promise<string> {\n const { baseApiUrl } = getApiConfig(env);\n const chainIdName = getChainNameById(chainId);\n\n const { data } = await axios.get<ExchangeRateResponse>(\n `api/v1/exchange/rate/${chainIdName}`,\n { baseURL: baseApiUrl, params: { amount } },\n );\n\n return data.amount_out;\n}\n","import { OChainId } from '../common/types/types';\n\nexport type TRpcUrlConfig = Record<number, string>;\n\nexport const rpcUrlConfig: TRpcUrlConfig = {\n [OChainId.ethereum]: 'https://rpc.ankr.com/eth',\n [OChainId.holesky]: 'https://rpc.ankr.com/eth_holesky',\n};\n","import BigNumber from 'bignumber.js';\nimport Web3 from 'web3';\n\nexport async function getMaxPriorityFeePerGas(\n rpcUrl: string,\n): Promise<BigNumber> {\n const response = await fetch(rpcUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n jsonrpc: '2.0',\n id: 1,\n method: 'eth_maxPriorityFeePerGas',\n params: [],\n }),\n });\n\n const data = await response.json();\n\n const convertedHexValue = Web3.utils.hexToNumber(data?.result);\n\n return new BigNumber(Number(convertedHexValue));\n}\n","import BigNumber from 'bignumber.js';\nimport { Web3, Contract, ContractAbi } from 'web3';\nimport {\n TRpcUrlConfig,\n rpcUrlConfig as defaultRpcUrlConfig,\n} from './rpcUrlConfig';\nimport { IGetMaxFeesResult } from './types';\nimport { getMaxPriorityFeePerGas } from './utils/getMaxPriorityFeePerGas';\n\nconst FEE_MULTIPLIER = 2;\nconst ADDITIONAL_SAFE_GAS_PRICE_WEI = 25_000;\n\nexport interface IReadProviderParams {\n /**\n * Chain ID of the network to interact with.\n */\n chainId: number;\n /**\n * The RPC URL configuration. If not provided, the default configuration will be used.\n */\n rpcUrlConfig?: TRpcUrlConfig;\n}\n\nexport class ReadProvider {\n chainId: number;\n rpcConfig: TRpcUrlConfig;\n\n constructor({ chainId, rpcUrlConfig }: IReadProviderParams) {\n this.chainId = chainId;\n this.rpcConfig = { ...defaultRpcUrlConfig, ...rpcUrlConfig };\n }\n\n /**\n * Returns web3 instance for read operations.\n *\n * @public\n * @returns {Web3} Web3 instance.\n */\n public getReadWeb3(): Web3 {\n const rpcUrl = this.getRpcUrl();\n const readWeb3 = new Web3();\n const provider = new Web3.providers.HttpProvider(rpcUrl);\n readWeb3.setProvider(provider);\n return readWeb3;\n }\n\n /**\n * Retrieves the RPC URL based on the current chain ID.\n * @returns The RPC URL for the current chain ID.\n * @throws Error if the RPC URL for the current chain ID is not found.\n */\n getRpcUrl(): string {\n const { chainId } = this;\n const rpcUrl = this.rpcConfig?.[chainId];\n\n if (!rpcUrl) {\n console.error(\n `You might need to add the rpcConfig for the ${chainId} chain ID when creating the provider.`,\n );\n throw new Error(`RPC URL for chainId ${chainId} not found`);\n }\n\n return rpcUrl;\n }\n\n /**\n * Calculates max fees for transaction. Thess values are available for networks\n * with EIP-1559 support.\n *\n * @public\n * @note If current network is Binance Smart Chain, will return default values.\n * @returns {Promise<IGetMaxFeesResult>} Max fees for transaction.\n */\n public async getMaxFees(): Promise<IGetMaxFeesResult> {\n const web3 = this.getReadWeb3();\n const rpcUrl = this.getRpcUrl();\n\n const [block, maxPriorityFeePerGas] = await Promise.all([\n web3.eth.getBlock('latest'),\n getMaxPriorityFeePerGas(rpcUrl),\n ]);\n\n if (!block?.baseFeePerGas && typeof block?.baseFeePerGas !== 'bigint') {\n return {};\n }\n\n const maxFeePerGas = new BigNumber(block.baseFeePerGas.toString(10))\n .multipliedBy(FEE_MULTIPLIER)\n .plus(maxPriorityFeePerGas);\n\n return {\n maxFeePerGas: +maxFeePerGas,\n maxPriorityFeePerGas: +maxPriorityFeePerGas,\n };\n }\n\n /**\n * Returns safe gas price for transaction.\n *\n * @public\n * @returns {Promise<BigNumber>} Safe gas price.\n */\n public async getSafeGasPriceWei(): Promise<BigNumber> {\n const pureGasPriceWei = await this.getReadWeb3().eth.getGasPrice();\n\n return new BigNumber(pureGasPriceWei.toString(10)).plus(\n ADDITIONAL_SAFE_GAS_PRICE_WEI,\n );\n }\n\n /**\n * Creates a contract instance with the given ABI and address.\n *\n * @template AbiType - The type of the contract ABI.\n * @param {any} abi - The ABI of the contract.\n * @param {string} address - The address of the contract.\n * @returns {Contract<AbiType>} The contract instance.\n */\n public createContract<AbiType extends ContractAbi>(\n abi: any,\n address: string,\n ): Contract<AbiType> {\n const web3 = this.getReadWeb3();\n return new web3.eth.Contract<AbiType>(abi, address);\n }\n}\n","import Web3, { Contract, ContractAbi, Transaction, utils } from 'web3';\nimport { IEIP1193Provider } from '../common/types/types';\nimport { IReadProviderParams, ReadProvider } from './ReadProvider';\nimport {\n TRpcUrlConfig,\n rpcUrlConfig as defaultRpcUrlConfig,\n} from './rpcUrlConfig';\nimport { ISendOptions, IWeb3SendResult } from './types';\n\nexport interface IProviderParams extends IReadProviderParams {\n /**\n * The EIP-1193 provider instance.\n */\n provider: IEIP1193Provider;\n /**\n * The сurrent account address.\n */\n account: string;\n}\n\n/**\n * Provider for interacting with a blockchain network.\n */\nexport class Provider extends ReadProvider {\n web3: Web3;\n account: string;\n rpcConfig: TRpcUrlConfig = defaultRpcUrlConfig;\n\n constructor({ provider, account, chainId, rpcUrlConfig }: IProviderParams) {\n super({ chainId, rpcUrlConfig });\n this.web3 = new Web3(provider);\n this.account = account;\n this.chainId = chainId;\n this.rpcConfig = { ...defaultRpcUrlConfig, ...rpcUrlConfig };\n }\n\n /**\n * Signs a message using the current provider and account.\n * @public\n * @param message - The message to be signed.\n * @returns A promise that resolves to the signed message as a string.\n */\n public async signMessage(message: string): Promise<string> {\n const { account } = this;\n\n const messageHex = `0x${Buffer.from(message, 'utf8').toString('hex')}`;\n\n const ethereum = this.web3.currentProvider as any;\n\n return ethereum.request({\n method: 'personal_sign',\n params: [messageHex, account],\n });\n }\n\n /**\n * Custom replacement for web3js [send](https://docs.web3js.org/libdocs/Contract#send).\n *\n * @public\n * @param {string} from - Address of the sender.\n * @param {string} to - Address of the recipient.\n * @param {ISendOptions} sendOptions - Options for sending transaction.\n * @returns {Promise<IWeb3SendResult>} Promise with transaction hash and receipt promise.\n */\n public async sendTransactionAsync(\n from: string,\n to: string,\n sendOptions: ISendOptions,\n ): Promise<IWeb3SendResult> {\n const { chainId, web3: web3Write } = this;\n const web3Read = this.getReadWeb3();\n\n const {\n data,\n estimate = false,\n estimateFee = false,\n extendedGasLimit,\n gasLimit = '0',\n value = '0',\n gasLimitMultiplier = 1,\n } = sendOptions;\n let { nonce } = sendOptions;\n\n if (!nonce) {\n nonce = await web3Read.eth.getTransactionCount(from);\n }\n\n console.log(`Nonce: ${nonce}`);\n\n const tx: Transaction = {\n from,\n to,\n value: utils.numberToHex(value),\n data,\n nonce,\n chainId: utils.numberToHex(chainId),\n };\n\n if (estimate) {\n try {\n const estimatedGas = await web3Read.eth.estimateGas(tx);\n const multipliedGasLimit = Math.round(\n Number(estimatedGas) * gasLimitMultiplier,\n );\n\n if (extendedGasLimit) {\n tx.gas = utils.numberToHex(multipliedGasLimit + extendedGasLimit);\n } else {\n tx.gas = utils.numberToHex(multipliedGasLimit);\n }\n } catch (e) {\n throw new Error(\n (e as Partial<Error>).message ??\n 'Failed to estimate gas limit for transaction.',\n );\n }\n } else {\n tx.gas = utils.numberToHex(gasLimit);\n }\n\n const { maxFeePerGas, maxPriorityFeePerGas } = estimateFee\n ? await this.getMaxFees().catch(() => sendOptions)\n : sendOptions;\n\n if (maxPriorityFeePerGas !== undefined) {\n tx.maxPriorityFeePerGas = utils.numberToHex(maxPriorityFeePerGas);\n }\n\n if (maxFeePerGas !== undefined) {\n tx.maxFeePerGas = utils.numberToHex(maxFeePerGas);\n }\n\n if (!tx.maxFeePerGas && !tx.maxPriorityFeePerGas) {\n const safeGasPrice = await this.getSafeGasPriceWei();\n tx.gasPrice = safeGasPrice.toString(10);\n }\n\n if (!tx.maxFeePerGas && !tx.maxPriorityFeePerGas) {\n const safeGasPrice = await this.getSafeGasPriceWei();\n tx.gasPrice = safeGasPrice.toString(10);\n }\n\n console.log('Sending transaction via Web3: ', tx);\n\n return new Promise((resolve, reject) => {\n const promise = web3Write.eth.sendTransaction(tx);\n\n promise\n .once('transactionHash', async (transactionHash: string) => {\n console.log(`Just signed transaction has is: ${transactionHash}`);\n\n resolve({\n receiptPromise: promise,\n transactionHash,\n });\n })\n .catch(reject);\n });\n }\n\n public createContract<AbiType extends ContractAbi>(\n abi: any,\n address: string,\n ): Contract<AbiType> {\n return new this.web3.eth.Contract<AbiType>(abi, address);\n }\n}\n","import { OChainId } from '../../common/types/types';\n\n/**\n * Returns the gas multiplier for the given chain ID.\n *\n * @param chainId - Chain ID.\n *\n * @returns Gas multiplier.\n */\nexport function getGasMultiplier(chainId: number): number {\n switch (chainId) {\n case OChainId.ethereum:\n return 1.3;\n case OChainId.holesky:\n return 1.5;\n default:\n return 1.3;\n }\n}\n","import { OChainId, TChainId } from '../types/types';\n\nexport function isValidChain(chainId: number): chainId is TChainId {\n return Object.values(OChainId).includes(chainId as TChainId);\n}\n","import {\n defaultEnv,\n ZERO_ADDRESS as PLACEHOLDER_ADDRESS,\n} from '../common/const';\nimport { OChainId, OEnv, TChainId, TEnv } from '../common/types/types';\n\ntype LbtcTokenConfig = Record<TChainId, string>;\n\nconst stageConfig: LbtcTokenConfig = {\n [OChainId.holesky]: '0xED7bfd5C1790576105Af4649817f6d35A75CD818',\n [OChainId.ethereum]: PLACEHOLDER_ADDRESS,\n\n [OChainId.binanceSmartChainTestnet]:\n '0x731eFa688F3679688cf60A3993b8658138953ED6',\n [OChainId.binanceSmartChain]: PLACEHOLDER_ADDRESS,\n\n [OChainId.base]: PLACEHOLDER_ADDRESS,\n // TODO: Add baseTestnet address\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.berachainBartioTestnet]:\n '0xc47e4b3124597FDF8DD07843D4a7052F2eE80C30',\n [OChainId.sepolia]: '0xc47e4b3124597fdf8dd07843d4a7052f2ee80c30',\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n};\n\nconst testnetConfig: LbtcTokenConfig = {\n [OChainId.holesky]: '0x38A13AB20D15ffbE5A7312d2336EF1552580a4E2',\n [OChainId.ethereum]: PLACEHOLDER_ADDRESS,\n\n [OChainId.binanceSmartChainTestnet]:\n '0x107Fc7d90484534704dD2A9e24c7BD45DB4dD1B5',\n [OChainId.binanceSmartChain]: PLACEHOLDER_ADDRESS,\n\n [OChainId.base]: PLACEHOLDER_ADDRESS,\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.berachainBartioTestnet]:\n '0xc47e4b3124597FDF8DD07843D4a7052F2eE80C30',\n [OChainId.sepolia]: '0xc47e4b3124597fdf8dd07843d4a7052f2ee80c30',\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n};\n\nconst prodConfig: LbtcTokenConfig = {\n [OChainId.ethereum]: '0x8236a87084f8b84306f72007f36f2618a5634494',\n [OChainId.holesky]: PLACEHOLDER_ADDRESS,\n [OChainId.sepolia]: PLACEHOLDER_ADDRESS,\n\n [OChainId.binanceSmartChainTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.binanceSmartChain]: '0xecAc9C5F704e954931349Da37F60E39f515c11c1',\n\n [OChainId.base]: '0xecAc9C5F704e954931349Da37F60E39f515c11c1',\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n \n [OChainId.berachainBartioTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.corn]: '0xecAc9C5F704e954931349Da37F60E39f515c11c1',\n};\n\nexport function getLbtcAddressConfig(env: TEnv = defaultEnv): LbtcTokenConfig {\n switch (env) {\n case OEnv.prod:\n return prodConfig;\n case OEnv.testnet:\n return testnetConfig;\n default:\n return stageConfig;\n }\n}\n","import { IERC20, LBTCABI } from '../abi';\n\ntype Token = 'LBTC' | 'ERC20';\n\nexport function getTokenABI(token: Token) {\n switch (token) {\n case 'LBTC':\n return LBTCABI;\n default:\n return IERC20;\n }\n}\n","import { ReadProvider } from '../../provider/ReadProvider';\nimport { TEnv } from '../../common/types/types';\nimport { isValidChain } from '../../common/utils/isValidChain';\nimport { Provider } from '../../provider';\nimport { getLbtcAddressConfig } from '../lbtcAddressConfig';\nimport { getTokenABI } from './getTokenABI';\n\nexport function getLbtcTokenContract(provider: Provider | ReadProvider, env?: TEnv) {\n const lbtcAddressConfig = getLbtcAddressConfig(env);\n const { chainId } = provider;\n\n if (!isValidChain(chainId)) {\n throw new Error(`This chain ${chainId} is not supported`);\n }\n\n const tokenAddress = lbtcAddressConfig[chainId];\n\n if (!tokenAddress) {\n throw new Error(`Token address for chain ${chainId} is not defined`);\n }\n\n const abi = getTokenABI('LBTC');\n\n const contract = provider.createContract(abi, tokenAddress);\n\n if (!contract.options.address) {\n contract.options.address = tokenAddress;\n }\n\n return contract as typeof contract & {\n options: typeof contract.options & { address: string };\n };\n}\n","import { IEnvParam } from '../../common/types/internalTypes';\nimport { toSatoshi } from '../../common/utils/convertSatoshi';\nimport { IWeb3SendResult, Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\nimport { getGasMultiplier } from '../utils/getGasMultiplier';\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\n\nexport interface IApproveLBTCParams extends IProviderBasedParams, IEnvParam {\n /**\n * Spender address\n */\n spender: string;\n /**\n * The amount of LBTC to approve\n */\n amount: number;\n}\n\n/**\n * Approves the transfer of a specified amount of LBTC tokens.\n *\n * @param {IApproveLBTCParams} params\n *\n * @returns {Promise<IWeb3SendResult>} transaction promise\n */\nexport function approveLBTC({\n spender,\n amount,\n env,\n ...providerParams\n}: IApproveLBTCParams): Promise<IWeb3SendResult> {\n const provider = new Provider(providerParams);\n const tokenContract = getLbtcTokenContract(provider, env);\n const amountSat = toSatoshi(amount);\n\n const tx = tokenContract.methods.approve(spender, amountSat);\n\n return provider.sendTransactionAsync(\n provider.account,\n tokenContract.options.address,\n {\n data: tx.encodeABI(),\n estimate: true,\n estimateFee: true,\n gasLimitMultiplier: getGasMultiplier(provider.chainId),\n },\n );\n}\n","import { IEnvParam } from '../../common/types/internalTypes';\nimport { getErrorMessage } from '../../common/utils/getErrorMessage';\nimport { IWeb3SendResult, Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\nimport { getGasMultiplier } from '../utils/getGasMultiplier';\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\n\nconst INSUFFICIENT_FUNDS_PARTIAL_ERROR = 'insufficient funds';\n\nconst INSUFFICIENT_FUNDS_ERROR =\n 'Insufficient funds for transfer. Make sure you have enough ETH to cover the gas cost.';\n\nexport interface IClaimLBTCParams extends IProviderBasedParams, IEnvParam {\n /**\n * Raw payload from deposit notarization.\n */\n data: string;\n /**\n * Signature from deposit notarization.\n */\n proofSignature: string;\n}\n\n/**\n * Claims LBTC.\n *\n * @param {IClaimLBTCParams} params - The parameters for claiming LBTC.\n *\n * @returns {Promise<IWeb3SendResult>} transaction promise\n */\nexport async function claimLBTC({\n data,\n proofSignature,\n env,\n ...providerParams\n}: IClaimLBTCParams): Promise<IWeb3SendResult> {\n const provider = new Provider(providerParams);\n\n const tokenContract = getLbtcTokenContract(provider, env);\n\n const tx = tokenContract.methods.mint(data, proofSignature);\n\n try {\n const result = await provider.sendTransactionAsync(\n provider.account,\n tokenContract.options.address,\n {\n data: tx.encodeABI(),\n estimate: true,\n estimateFee: true,\n gasLimitMultiplier: getGasMultiplier(provider.chainId),\n },\n );\n\n return result;\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n\n if (errorMessage.includes(INSUFFICIENT_FUNDS_PARTIAL_ERROR)) {\n throw new Error(INSUFFICIENT_FUNDS_ERROR);\n }\n\n throw new Error(errorMessage);\n }\n}\n","import { Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\n\nexport type SignLbtcDestionationAddrParams = IProviderBasedParams;\n\n/**\n * Signs the destination address for the LBTC in active chain\n * in the current account. Signing is necessary for the\n * generation of the deposit address.\n *\n * @param {SignLbtcDestionationAddrParams} params\n *\n * @returns {Promise<string>} The signature of the message.\n */\nexport async function signLbtcDestionationAddr(\n params: SignLbtcDestionationAddrParams,\n): Promise<string> {\n const provider = new Provider(params);\n\n const message = `destination chain id is ${params.chainId}`;\n\n return provider.signMessage(message);\n}\n","import * as ecc from '@bitcoin-js/tiny-secp256k1-asmjs';\nimport {\n address as addressUtils,\n initEccLib,\n networks,\n payments,\n} from 'bitcoinjs-lib';\nimport { OEnv, TEnv } from '../../common/types/types';\n\ninitEccLib(ecc);\n\ntype AddressType = 'p2tr' | 'p2wpkh' | 'p2wsh';\n\n/**\n * Get output script from address.\n *\n * @param address - The address.\n * @param networkMode - The network mode.\n *\n * @returns The output script.\n */\nexport function getOutputScript(\n address: string,\n env: TEnv = OEnv.prod,\n): string {\n const addressType = getAddressType(address);\n\n const payment = payments[addressType]({\n address,\n network: env === OEnv.prod ? networks.bitcoin : networks.testnet,\n });\n\n const paymentOutputScript = payment.output?.toString('hex');\n\n if (!paymentOutputScript) {\n throw new Error('Output script is not found.');\n }\n\n return `0x${paymentOutputScript}`;\n}\n\nfunction getAddressType(address: string): AddressType {\n const result = addressUtils.fromBech32(address);\n\n const isP2TR = result.version === 1 && result.data.length === 32;\n if (isP2TR) {\n return 'p2tr';\n }\n\n const isP2WPKH = result.version === 0 && result.data.length === 20;\n if (isP2WPKH) {\n return 'p2wpkh';\n }\n\n if (isP2WSHAddressType(address)) {\n return 'p2wsh';\n }\n\n throw new Error('Address type is not supported.');\n}\n\nfunction isP2WSHAddressType(address: string): boolean {\n return (\n (address.startsWith('bc1') || address.startsWith('tb1')) &&\n address.length === 62\n );\n}\n","import { getOutputScript } from '../../btcSdk/utils/getOutputScript';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { toSatoshi } from '../../common/utils/convertSatoshi';\nimport { IWeb3SendResult, Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\nimport { getGasMultiplier } from '../utils/getGasMultiplier';\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\n\nexport interface IUnstakeLBTCParams extends IProviderBasedParams, IEnvParam {\n /**\n * The BTC address to send the unstaked BTC to.\n */\n btcAddress: string;\n /**\n * The amount of LBTC to unstake.\n */\n amount: number;\n}\n\n/**\n * Unstakes LBTC to the specified BTC address.\n *\n * @param {IUnstakeLBTCParams} params\n *\n * @returns {Promise<IWeb3SendResult>} transaction promise\n */\nexport function unstakeLBTC({\n btcAddress,\n amount,\n env,\n ...providerParams\n}: IUnstakeLBTCParams): Promise<IWeb3SendResult> {\n const provider = new Provider(providerParams);\n const tokenContract = getLbtcTokenContract(provider, env);\n const outputScript = getOutputScript(btcAddress, env);\n\n const amountSat = toSatoshi(amount);\n\n const tx = tokenContract.methods.redeem(outputScript, amountSat);\n\n return provider.sendTransactionAsync(\n provider.account,\n tokenContract.options.address,\n {\n data: tx.encodeABI(),\n estimate: true,\n estimateFee: true,\n gasLimitMultiplier: getGasMultiplier(provider.chainId),\n },\n );\n}\n","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\n// Response error\nexport const ERR_RESPONSE = 100;\nexport const ERR_INVALID_RESPONSE = 101;\n// Generic errors\nexport const ERR_PARAM = 200;\nexport const ERR_FORMATTERS = 201;\nexport const ERR_METHOD_NOT_IMPLEMENTED = 202;\nexport const ERR_OPERATION_TIMEOUT = 203;\nexport const ERR_OPERATION_ABORT = 204;\nexport const ERR_ABI_ENCODING = 205;\nexport const ERR_EXISTING_PLUGIN_NAMESPACE = 206;\nexport const ERR_INVALID_METHOD_PARAMS = 207;\nexport const ERR_MULTIPLE_ERRORS = 208;\n// Contract error codes\nexport const ERR_CONTRACT = 300;\nexport const ERR_CONTRACT_RESOLVER_MISSING = 301;\nexport const ERR_CONTRACT_ABI_MISSING = 302;\nexport const ERR_CONTRACT_REQUIRED_CALLBACK = 303;\nexport const ERR_CONTRACT_EVENT_NOT_EXISTS = 304;\nexport const ERR_CONTRACT_RESERVED_EVENT = 305;\nexport const ERR_CONTRACT_MISSING_DEPLOY_DATA = 306;\nexport const ERR_CONTRACT_MISSING_ADDRESS = 307;\nexport const ERR_CONTRACT_MISSING_FROM_ADDRESS = 308;\nexport const ERR_CONTRACT_INSTANTIATION = 309;\nexport const ERR_CONTRACT_EXECUTION_REVERTED = 310;\nexport const ERR_CONTRACT_TX_DATA_AND_INPUT = 311;\n// Transaction error codes\nexport const ERR_TX = 400;\nexport const ERR_TX_REVERT_INSTRUCTION = 401;\nexport const ERR_TX_REVERT_TRANSACTION = 402;\nexport const ERR_TX_NO_CONTRACT_ADDRESS = 403;\nexport const ERR_TX_CONTRACT_NOT_STORED = 404;\nexport const ERR_TX_REVERT_WITHOUT_REASON = 405;\nexport const ERR_TX_OUT_OF_GAS = 406;\nexport const ERR_RAW_TX_UNDEFINED = 407;\nexport const ERR_TX_INVALID_SENDER = 408;\nexport const ERR_TX_INVALID_CALL = 409;\nexport const ERR_TX_MISSING_CUSTOM_CHAIN = 410;\nexport const ERR_TX_MISSING_CUSTOM_CHAIN_ID = 411;\nexport const ERR_TX_CHAIN_ID_MISMATCH = 412;\nexport const ERR_TX_INVALID_CHAIN_INFO = 413;\nexport const ERR_TX_MISSING_CHAIN_INFO = 414;\nexport const ERR_TX_MISSING_GAS = 415;\nexport const ERR_TX_INVALID_LEGACY_GAS = 416;\nexport const ERR_TX_INVALID_FEE_MARKET_GAS = 417;\nexport const ERR_TX_INVALID_FEE_MARKET_GAS_PRICE = 418;\nexport const ERR_TX_INVALID_LEGACY_FEE_MARKET = 419;\nexport const ERR_TX_INVALID_OBJECT = 420;\nexport const ERR_TX_INVALID_NONCE_OR_CHAIN_ID = 421;\nexport const ERR_TX_UNABLE_TO_POPULATE_NONCE = 422;\nexport const ERR_TX_UNSUPPORTED_EIP_1559 = 423;\nexport const ERR_TX_UNSUPPORTED_TYPE = 424;\nexport const ERR_TX_DATA_AND_INPUT = 425;\nexport const ERR_TX_POLLING_TIMEOUT = 426;\nexport const ERR_TX_RECEIPT_MISSING_OR_BLOCKHASH_NULL = 427;\nexport const ERR_TX_RECEIPT_MISSING_BLOCK_NUMBER = 428;\nexport const ERR_TX_LOCAL_WALLET_NOT_AVAILABLE = 429;\nexport const ERR_TX_NOT_FOUND = 430;\nexport const ERR_TX_SEND_TIMEOUT = 431;\nexport const ERR_TX_BLOCK_TIMEOUT = 432;\nexport const ERR_TX_SIGNING = 433;\nexport const ERR_TX_GAS_MISMATCH = 434;\nexport const ERR_TX_CHAIN_MISMATCH = 435;\nexport const ERR_TX_HARDFORK_MISMATCH = 436;\nexport const ERR_TX_INVALID_RECEIVER = 437;\nexport const ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR = 438;\nexport const ERR_TX_INVALID_PROPERTIES_FOR_TYPE = 439;\nexport const ERR_TX_MISSING_GAS_INNER_ERROR = 440;\nexport const ERR_TX_GAS_MISMATCH_INNER_ERROR = 441;\n// Connection error codes\nexport const ERR_CONN = 500;\nexport const ERR_CONN_INVALID = 501;\nexport const ERR_CONN_TIMEOUT = 502;\nexport const ERR_CONN_NOT_OPEN = 503;\nexport const ERR_CONN_CLOSE = 504;\nexport const ERR_CONN_MAX_ATTEMPTS = 505;\nexport const ERR_CONN_PENDING_REQUESTS = 506;\nexport const ERR_REQ_ALREADY_SENT = 507;\n// Provider error codes\nexport const ERR_PROVIDER = 600;\nexport const ERR_INVALID_PROVIDER = 601;\nexport const ERR_INVALID_CLIENT = 602;\nexport const ERR_SUBSCRIPTION = 603;\nexport const ERR_WS_PROVIDER = 604;\n// Account error codes\nexport const ERR_PRIVATE_KEY_LENGTH = 701;\nexport const ERR_INVALID_PRIVATE_KEY = 702;\nexport const ERR_UNSUPPORTED_KDF = 703;\nexport const ERR_KEY_DERIVATION_FAIL = 704;\nexport const ERR_KEY_VERSION_UNSUPPORTED = 705;\nexport const ERR_INVALID_PASSWORD = 706;\nexport const ERR_IV_LENGTH = 707;\nexport const ERR_INVALID_KEYSTORE = 708;\nexport const ERR_PBKDF2_ITERATIONS = 709;\n// Signature error codes\nexport const ERR_SIGNATURE_FAILED = 801;\nexport const ERR_INVALID_SIGNATURE = 802;\nexport const GENESIS_BLOCK_NUMBER = '0x0';\n// RPC error codes (EIP-1193)\n// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md#provider-errors\nexport const JSONRPC_ERR_REJECTED_REQUEST = 4001;\nexport const JSONRPC_ERR_UNAUTHORIZED = 4100;\nexport const JSONRPC_ERR_UNSUPPORTED_METHOD = 4200;\nexport const JSONRPC_ERR_DISCONNECTED = 4900;\nexport const JSONRPC_ERR_CHAIN_DISCONNECTED = 4901;\n// ENS error codes\nexport const ERR_ENS_CHECK_INTERFACE_SUPPORT = 901;\nexport const ERR_ENS_UNSUPPORTED_NETWORK = 902;\nexport const ERR_ENS_NETWORK_NOT_SYNCED = 903;\n// Utils error codes\nexport const ERR_INVALID_STRING = 1001;\nexport const ERR_INVALID_BYTES = 1002;\nexport const ERR_INVALID_NUMBER = 1003;\nexport const ERR_INVALID_UNIT = 1004;\nexport const ERR_INVALID_ADDRESS = 1005;\nexport const ERR_INVALID_HEX = 1006;\nexport const ERR_INVALID_TYPE = 1007;\nexport const ERR_INVALID_BOOLEAN = 1008;\nexport const ERR_INVALID_UNSIGNED_INTEGER = 1009;\nexport const ERR_INVALID_SIZE = 1010;\nexport const ERR_INVALID_LARGE_VALUE = 1011;\nexport const ERR_INVALID_BLOCK = 1012;\nexport const ERR_INVALID_TYPE_ABI = 1013;\nexport const ERR_INVALID_NIBBLE_WIDTH = 1014;\nexport const ERR_INVALID_INTEGER = 1015;\n// Validation error codes\nexport const ERR_VALIDATION = 1100;\n// Core error codes\nexport const ERR_CORE_HARDFORK_MISMATCH = 1101;\nexport const ERR_CORE_CHAIN_MISMATCH = 1102;\n// Schema error codes\nexport const ERR_SCHEMA_FORMAT = 1200;\n// RPC error codes (EIP-1474)\n// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md\nexport const ERR_RPC_INVALID_JSON = -32700;\nexport const ERR_RPC_INVALID_REQUEST = -32600;\nexport const ERR_RPC_INVALID_METHOD = -32601;\nexport const ERR_RPC_INVALID_PARAMS = -32602;\nexport const ERR_RPC_INTERNAL_ERROR = -32603;\nexport const ERR_RPC_INVALID_INPUT = -32000;\nexport const ERR_RPC_MISSING_RESOURCE = -32001;\nexport const ERR_RPC_UNAVAILABLE_RESOURCE = -32002;\nexport const ERR_RPC_TRANSACTION_REJECTED = -32003;\nexport const ERR_RPC_UNSUPPORTED_METHOD = -32004;\nexport const ERR_RPC_LIMIT_EXCEEDED = -32005;\nexport const ERR_RPC_NOT_SUPPORTED = -32006;\n//# sourceMappingURL=error_codes.js.map","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\nimport { ERR_MULTIPLE_ERRORS } from './error_codes.js';\n/**\n * Base class for Web3 errors.\n */\nexport class BaseWeb3Error extends Error {\n constructor(msg, cause) {\n super(msg);\n if (Array.isArray(cause)) {\n // eslint-disable-next-line no-use-before-define\n this.cause = new MultipleErrors(cause);\n }\n else {\n this.cause = cause;\n }\n this.name = this.constructor.name;\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(new.target.constructor);\n }\n else {\n this.stack = new Error().stack;\n }\n }\n /**\n * @deprecated Use the `cause` property instead.\n */\n get innerError() {\n // eslint-disable-next-line no-use-before-define\n if (this.cause instanceof MultipleErrors) {\n return this.cause.errors;\n }\n return this.cause;\n }\n /**\n * @deprecated Use the `cause` property instead.\n */\n set innerError(cause) {\n if (Array.isArray(cause)) {\n // eslint-disable-next-line no-use-before-define\n this.cause = new MultipleErrors(cause);\n }\n else {\n this.cause = cause;\n }\n }\n static convertToString(value, unquotValue = false) {\n // Using \"null\" value intentionally for validation\n // eslint-disable-next-line no-null/no-null\n if (value === null || value === undefined)\n return 'undefined';\n const result = JSON.stringify(value, (_, v) => (typeof v === 'bigint' ? v.toString() : v));\n return unquotValue && ['bigint', 'string'].includes(typeof value)\n ? result.replace(/['\\\\\"]+/g, '')\n : result;\n }\n toJSON() {\n return {\n name: this.name,\n code: this.code,\n message: this.message,\n cause: this.cause,\n // deprecated\n innerError: this.cause,\n };\n }\n}\nexport class MultipleErrors extends BaseWeb3Error {\n constructor(errors) {\n super(`Multiple errors occurred: [${errors.map(e => e.message).join('], [')}]`);\n this.code = ERR_MULTIPLE_ERRORS;\n this.errors = errors;\n }\n}\nexport class InvalidValueError extends BaseWeb3Error {\n constructor(value, msg) {\n super(`Invalid value given \"${BaseWeb3Error.convertToString(value, true)}\". Error: ${msg}.`);\n this.name = this.constructor.name;\n }\n}\n//# sourceMappingURL=web3_error_base.js.map","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\nimport { ERR_RPC_INTERNAL_ERROR, ERR_RPC_INVALID_INPUT, ERR_RPC_INVALID_JSON, ERR_RPC_INVALID_METHOD, ERR_RPC_INVALID_PARAMS, ERR_RPC_INVALID_REQUEST, ERR_RPC_LIMIT_EXCEEDED, ERR_RPC_MISSING_RESOURCE, ERR_RPC_NOT_SUPPORTED, ERR_RPC_TRANSACTION_REJECTED, ERR_RPC_UNAVAILABLE_RESOURCE, ERR_RPC_UNSUPPORTED_METHOD, JSONRPC_ERR_CHAIN_DISCONNECTED, JSONRPC_ERR_DISCONNECTED, JSONRPC_ERR_REJECTED_REQUEST, JSONRPC_ERR_UNAUTHORIZED, JSONRPC_ERR_UNSUPPORTED_METHOD, } from '../error_codes.js';\n/**\n * A template string for a generic Rpc Error. The `*code*` will be replaced with the code number.\n * Note: consider in next version that a spelling mistake could be corrected for `occured` and the value could be:\n * \t`An Rpc error has occurred with a code of *code*`\n */\nexport const genericRpcErrorMessageTemplate = 'An Rpc error has occured with a code of *code*';\n/* eslint-disable @typescript-eslint/naming-convention */\nexport const RpcErrorMessages = {\n // EIP-1474 & JSON RPC 2.0\n // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md\n [ERR_RPC_INVALID_JSON]: {\n message: 'Parse error',\n description: 'Invalid JSON',\n },\n [ERR_RPC_INVALID_REQUEST]: {\n message: 'Invalid request',\n description: 'JSON is not a valid request object\t',\n },\n [ERR_RPC_INVALID_METHOD]: {\n message: 'Method not found',\n description: 'Method does not exist\t',\n },\n [ERR_RPC_INVALID_PARAMS]: {\n message: 'Invalid params',\n description: 'Invalid method parameters',\n },\n [ERR_RPC_INTERNAL_ERROR]: {\n message: 'Internal error',\n description: 'Internal JSON-RPC error',\n },\n [ERR_RPC_INVALID_INPUT]: {\n message: 'Invalid input',\n description: 'Missing or invalid parameters',\n },\n [ERR_RPC_MISSING_RESOURCE]: {\n message: 'Resource not found',\n description: 'Requested resource not found',\n },\n [ERR_RPC_UNAVAILABLE_RESOURCE]: {\n message: 'Resource unavailable',\n description: 'Requested resource not available',\n },\n [ERR_RPC_TRANSACTION_REJECTED]: {\n message: 'Transaction rejected',\n description: 'Transaction creation failed',\n },\n [ERR_RPC_UNSUPPORTED_METHOD]: {\n message: 'Method not supported',\n description: 'Method is not implemented',\n },\n [ERR_RPC_LIMIT_EXCEEDED]: {\n message: 'Limit exceeded',\n description: 'Request exceeds defined limit',\n },\n [ERR_RPC_NOT_SUPPORTED]: {\n message: 'JSON-RPC version not supported',\n description: 'Version of JSON-RPC protocol is not supported',\n },\n // EIP-1193\n // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md#provider-errors\n [JSONRPC_ERR_REJECTED_REQUEST]: {\n name: 'User Rejected Request',\n message: 'The user rejected the request.',\n },\n [JSONRPC_ERR_UNAUTHORIZED]: {\n name: 'Unauthorized',\n message: 'The requested method and/or account has not been authorized by the user.',\n },\n [JSONRPC_ERR_UNSUPPORTED_METHOD]: {\n name: 'Unsupported Method',\n message: 'The Provider does not support the requested method.',\n },\n [JSONRPC_ERR_DISCONNECTED]: {\n name: 'Disconnected',\n message: 'The Provider is disconnected from all chains.',\n },\n [JSONRPC_ERR_CHAIN_DISCONNECTED]: {\n name: 'Chain Disconnected',\n message: 'The Provider is not connected to the requested chain.',\n },\n // EIP-1193 - CloseEvent\n // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code\n '0-999': {\n name: '',\n message: 'Not used.',\n },\n 1000: {\n name: 'Normal Closure',\n message: 'The connection successfully completed the purpose for which it was created.',\n },\n 1001: {\n name: 'Going Away',\n message: 'The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.',\n },\n 1002: {\n name: 'Protocol error',\n message: 'The endpoint is terminating the connection due to a protocol error.',\n },\n 1003: {\n name: 'Unsupported Data',\n message: 'The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)',\n },\n 1004: {\n name: 'Reserved',\n message: 'Reserved. A meaning might be defined in the future.',\n },\n 1005: {\n name: 'No Status Rcvd',\n message: 'Reserved. Indicates that no status code was provided even though one was expected.',\n },\n 1006: {\n name: 'Abnormal Closure',\n message: 'Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected.',\n },\n 1007: {\n name: 'Invalid frame payload data',\n message: 'The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message).',\n },\n 1008: {\n name: 'Policy Violation',\n message: 'The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable.',\n },\n 1009: {\n name: 'Message Too Big',\n message: 'The endpoint is terminating the connection because a data frame was received that is too large.',\n },\n 1010: {\n name: 'Mandatory Ext.',\n message: \"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't.\",\n },\n 1011: {\n name: 'Internal Error',\n message: 'The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.',\n },\n 1012: {\n name: 'Service Restart',\n message: 'The server is terminating the connection because it is restarting.',\n },\n 1013: {\n name: 'Try Again Later',\n message: 'The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients.',\n },\n 1014: {\n name: 'Bad Gateway',\n message: 'The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code.',\n },\n 1015: {\n name: 'TLS handshake',\n message: \"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).\",\n },\n '1016-2999': {\n name: '',\n message: 'For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications.',\n },\n '3000-3999': {\n name: '',\n message: 'For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol.',\n },\n '4000-4999': {\n name: '',\n message: \"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol.\",\n },\n};\n//# sourceMappingURL=rpc_error_messages.js.map","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\nimport { BaseWeb3Error } from '../web3_error_base.js';\nimport { ERR_RPC_INTERNAL_ERROR, ERR_RPC_INVALID_INPUT, ERR_RPC_INVALID_JSON, ERR_RPC_INVALID_METHOD, ERR_RPC_INVALID_PARAMS, ERR_RPC_INVALID_REQUEST, ERR_RPC_LIMIT_EXCEEDED, ERR_RPC_MISSING_RESOURCE, ERR_RPC_NOT_SUPPORTED, ERR_RPC_TRANSACTION_REJECTED, ERR_RPC_UNAVAILABLE_RESOURCE, ERR_RPC_UNSUPPORTED_METHOD, } from '../error_codes.js';\nimport { RpcErrorMessages, genericRpcErrorMessageTemplate } from './rpc_error_messages.js';\nexport class RpcError extends BaseWeb3Error {\n constructor(rpcError, message) {\n super(message !== null && message !== void 0 ? message : genericRpcErrorMessageTemplate.replace('*code*', rpcError.error.code.toString()));\n this.code = rpcError.error.code;\n this.id = rpcError.id;\n this.jsonrpc = rpcError.jsonrpc;\n this.jsonRpcError = rpcError.error;\n }\n toJSON() {\n return Object.assign(Object.assign({}, super.toJSON()), { error: this.jsonRpcError, id: this.id, jsonRpc: this.jsonrpc });\n }\n}\nexport class EIP1193ProviderRpcError extends BaseWeb3Error {\n constructor(code, data) {\n var _a, _b, _c, _d;\n if (!code) {\n // this case should ideally not happen\n super();\n }\n else if ((_a = RpcErrorMessages[code]) === null || _a === void 0 ? void 0 : _a.message) {\n super(RpcErrorMessages[code].message);\n }\n else {\n // Retrieve the status code object for the given code from the table, by searching through the appropriate range\n const statusCodeRange = Object.keys(RpcErrorMessages).find(statusCode => typeof statusCode === 'string' &&\n code >= parseInt(statusCode.split('-')[0], 10) &&\n code <= parseInt(statusCode.split('-')[1], 10));\n super((_c = (_b = RpcErrorMessages[statusCodeRange !== null && statusCodeRange !== void 0 ? statusCodeRange : '']) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : genericRpcErrorMessageTemplate.replace('*code*', (_d = code === null || code === void 0 ? void 0 : code.toString()) !== null && _d !== void 0 ? _d : '\"\"'));\n }\n this.code = code;\n this.data = data;\n }\n}\nexport class ParseError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_JSON].message);\n this.code = ERR_RPC_INVALID_JSON;\n }\n}\nexport class InvalidRequestError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_REQUEST].message);\n this.code = ERR_RPC_INVALID_REQUEST;\n }\n}\nexport class MethodNotFoundError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_METHOD].message);\n this.code = ERR_RPC_INVALID_METHOD;\n }\n}\nexport class InvalidParamsError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_PARAMS].message);\n this.code = ERR_RPC_INVALID_PARAMS;\n }\n}\nexport class InternalError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INTERNAL_ERROR].message);\n this.code = ERR_RPC_INTERNAL_ERROR;\n }\n}\nexport class InvalidInputError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_INPUT].message);\n this.code = ERR_RPC_INVALID_INPUT;\n }\n}\nexport class MethodNotSupported extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_UNSUPPORTED_METHOD].message);\n this.code = ERR_RPC_UNSUPPORTED_METHOD;\n }\n}\nexport class ResourceUnavailableError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_UNAVAILABLE_RESOURCE].message);\n this.code = ERR_RPC_UNAVAILABLE_RESOURCE;\n }\n}\nexport class ResourcesNotFoundError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_MISSING_RESOURCE].message);\n this.code = ERR_RPC_MISSING_RESOURCE;\n }\n}\nexport class VersionNotSupportedError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_NOT_SUPPORTED].message);\n this.code = ERR_RPC_NOT_SUPPORTED;\n }\n}\nexport class TransactionRejectedError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_TRANSACTION_REJECTED].message);\n this.code = ERR_RPC_TRANSACTION_REJECTED;\n }\n}\nexport class LimitExceededError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_LIMIT_EXCEEDED].message);\n this.code = ERR_RPC_LIMIT_EXCEEDED;\n }\n}\nexport const rpcErrorsMap = new Map();\nrpcErrorsMap.set(ERR_RPC_INVALID_JSON, { error: ParseError });\nrpcErrorsMap.set(ERR_RPC_INVALID_REQUEST, {\n error: InvalidRequestError,\n});\nrpcErrorsMap.set(ERR_RPC_INVALID_METHOD, {\n error: MethodNotFoundError,\n});\nrpcErrorsMap.set(ERR_RPC_INVALID_PARAMS, { error: InvalidParamsError });\nrpcErrorsMap.set(ERR_RPC_INTERNAL_ERROR, { error: InternalError });\nrpcErrorsMap.set(ERR_RPC_INVALID_INPUT, { error: InvalidInputError });\nrpcErrorsMap.set(ERR_RPC_UNSUPPORTED_METHOD, {\n error: MethodNotSupported,\n});\nrpcErrorsMap.set(ERR_RPC_UNAVAILABLE_RESOURCE, {\n error: ResourceUnavailableError,\n});\nrpcErrorsMap.set(ERR_RPC_TRANSACTION_REJECTED, {\n error: TransactionRejectedError,\n});\nrpcErrorsMap.set(ERR_RPC_MISSING_RESOURCE, {\n error: ResourcesNotFoundError,\n});\nrpcErrorsMap.set(ERR_RPC_NOT_SUPPORTED, {\n error: VersionNotSupportedError,\n});\nrpcErrorsMap.set(ERR_RPC_LIMIT_EXCEEDED, { error: LimitExceededError });\n//# sourceMappingURL=rpc_errors.js.map","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * checks input if typeof data is valid string input\n */\nexport const isString = (value) => typeof value === 'string';\nexport const isHexStrict = (hex) => typeof hex === 'string' && /^((-)?0x[0-9a-f]+|(0x))$/i.test(hex);\n/**\n * Is the string a hex string.\n *\n * @param value\n * @param length\n * @returns output the string is a hex string\n */\nexport function isHexString(value, length) {\n if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/))\n return false;\n if (typeof length !== 'undefined' && length > 0 && value.length !== 2 + 2 * length)\n return false;\n return true;\n}\nexport const isHex = (hex) => typeof hex === 'number' ||\n typeof hex === 'bigint' ||\n (typeof hex === 'string' && /^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(hex));\nexport const isHexString8Bytes = (value, prefixed = true) => prefixed ? isHexStrict(value) && value.length === 18 : isHex(value) && value.length === 16;\nexport const isHexString32Bytes = (value, prefixed = true) => prefixed ? isHexStrict(value) && value.length === 66 : isHex(value) && value.length === 64;\n/**\n * Returns a `Boolean` on whether or not the a `String` starts with '0x'\n * @param str the string input value\n * @return a boolean if it is or is not hex prefixed\n * @throws if the str input is not a string\n */\nexport function isHexPrefixed(str) {\n if (typeof str !== 'string') {\n throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof str}`);\n }\n return str.startsWith('0x');\n}\n/**\n * Checks provided Uint8Array for leading zeroes and throws if found.\n *\n * Examples:\n *\n * Valid values: 0x1, 0x, 0x01, 0x1234\n * Invalid values: 0x0, 0x00, 0x001, 0x0001\n *\n * Note: This method is useful for validating that RLP encoded integers comply with the rule that all\n * integer values encoded to RLP must be in the most compact form and contain no leading zero bytes\n * @param values An object containing string keys and Uint8Array values\n * @throws if any provided value is found to have leading zero bytes\n */\nexport const validateNoLeadingZeroes = function (values) {\n for (const [k, v] of Object.entries(values)) {\n if (v !== undefined && v.length > 0 && v[0] === 0) {\n throw new Error(`${k} cannot have leading zeroes, received: ${v.toString()}`);\n }\n }\n};\n//# sourceMappingURL=string.js.map","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\nexport var FMT_NUMBER;\n(function (FMT_NUMBER) {\n FMT_NUMBER[\"NUMBER\"] = \"NUMBER_NUMBER\";\n FMT_NUMBER[\"HEX\"] = \"NUMBER_HEX\";\n FMT_NUMBER[\"STR\"] = \"NUMBER_STR\";\n FMT_NUMBER[\"BIGINT\"] = \"NUMBER_BIGINT\";\n})(FMT_NUMBER || (FMT_NUMBER = {}));\nexport var FMT_BYTES;\n(function (FMT_BYTES) {\n FMT_BYTES[\"HEX\"] = \"BYTES_HEX\";\n FMT_BYTES[\"UINT8ARRAY\"] = \"BYTES_UINT8ARRAY\";\n})(FMT_BYTES || (FMT_BYTES = {}));\nexport const DEFAULT_RETURN_FORMAT = {\n number: FMT_NUMBER.BIGINT,\n bytes: FMT_BYTES.HEX,\n};\nexport const ETH_DATA_FORMAT = { number: FMT_NUMBER.HEX, bytes: FMT_BYTES.HEX };\n//# sourceMappingURL=data_format_types.js.map","export var BlockTags;\n(function (BlockTags) {\n BlockTags[\"EARLIEST\"] = \"earliest\";\n BlockTags[\"LATEST\"] = \"latest\";\n BlockTags[\"PENDING\"] = \"pending\";\n BlockTags[\"SAFE\"] = \"safe\";\n BlockTags[\"FINALIZED\"] = \"finalized\";\n})(BlockTags || (BlockTags = {}));\n// This list of hardforks is expected to be in order\n// keep this in mind when making changes to it\nexport var HardforksOrdered;\n(function (HardforksOrdered) {\n HardforksOrdered[\"chainstart\"] = \"chainstart\";\n HardforksOrdered[\"frontier\"] = \"frontier\";\n HardforksOrdered[\"homestead\"] = \"homestead\";\n HardforksOrdered[\"dao\"] = \"dao\";\n HardforksOrdered[\"tangerineWhistle\"] = \"tangerineWhistle\";\n HardforksOrdered[\"spuriousDragon\"] = \"spuriousDragon\";\n HardforksOrdered[\"byzantium\"] = \"byzantium\";\n HardforksOrdered[\"constantinople\"] = \"constantinople\";\n HardforksOrdered[\"petersburg\"] = \"petersburg\";\n HardforksOrdered[\"istanbul\"] = \"istanbul\";\n HardforksOrdered[\"muirGlacier\"] = \"muirGlacier\";\n HardforksOrdered[\"berlin\"] = \"berlin\";\n HardforksOrdered[\"london\"] = \"london\";\n HardforksOrdered[\"altair\"] = \"altair\";\n HardforksOrdered[\"arrowGlacier\"] = \"arrowGlacier\";\n HardforksOrdered[\"grayGlacier\"] = \"grayGlacier\";\n HardforksOrdered[\"bellatrix\"] = \"bellatrix\";\n HardforksOrdered[\"merge\"] = \"merge\";\n HardforksOrdered[\"capella\"] = \"capella\";\n HardforksOrdered[\"shanghai\"] = \"shanghai\";\n})(HardforksOrdered || (HardforksOrdered = {}));\n//# sourceMappingURL=eth_types.js.map","import {\n defaultEnv,\n ZERO_ADDRESS as PLACEHOLDER_ADDRESS,\n} from '../common/const';\nimport { OChainId, OEnv, TChainId, TEnv } from '../common/types/types';\n\ntype BasculeTokenConfig = Record<TChainId, string>;\n\nconst stageConfig: BasculeTokenConfig = {\n [OChainId.holesky]: '0x3a0c40c84b5034ed9a98a9a47a02af2b0885246f',\n [OChainId.ethereum]: PLACEHOLDER_ADDRESS,\n\n [OChainId.binanceSmartChainTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.binanceSmartChain]: PLACEHOLDER_ADDRESS,\n\n [OChainId.base]: PLACEHOLDER_ADDRESS,\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.berachainBartioTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.sepolia]: PLACEHOLDER_ADDRESS,\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n};\n\nconst testnetConfig: BasculeTokenConfig = {\n [OChainId.holesky]: '0x3a0c40c84b5034ed9a98a9a47a02af2b0885246f',\n [OChainId.ethereum]: PLACEHOLDER_ADDRESS,\n\n [OChainId.binanceSmartChainTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.binanceSmartChain]: PLACEHOLDER_ADDRESS,\n\n [OChainId.base]: PLACEHOLDER_ADDRESS,\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.berachainBartioTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.sepolia]: PLACEHOLDER_ADDRESS,\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n};\n\nconst prodConfig: BasculeTokenConfig = {\n [OChainId.holesky]: PLACEHOLDER_ADDRESS,\n [OChainId.ethereum]: '0xc750eCAC7250E0D18ecE2C7a5F130E3A765dc260',\n\n [OChainId.binanceSmartChainTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.binanceSmartChain]: PLACEHOLDER_ADDRESS,\n\n [OChainId.base]: PLACEHOLDER_ADDRESS,\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.berachainBartioTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.sepolia]: PLACEHOLDER_ADDRESS,\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n};\n\nexport function getBasculeAddressConfig(\n env: TEnv = defaultEnv,\n): BasculeTokenConfig {\n switch (env) {\n case OEnv.prod:\n return prodConfig;\n case OEnv.testnet:\n return testnetConfig;\n default:\n return stageConfig;\n }\n}\n","import { TEnv } from '../../common/types/types';\nimport { isValidChain } from '../../common/utils/isValidChain';\nimport { Provider } from '../../provider';\nimport { getBasculeAddressConfig } from '../basculeAddressConfig';\nimport { BASCULE_ABI } from '../abi';\n\nexport function getBasculeTokenContract(provider: Provider, env?: TEnv) {\n const basculeAddressConfig = getBasculeAddressConfig(env);\n const { chainId } = provider;\n\n if (!isValidChain(chainId)) {\n throw new Error(`This chain ${chainId} is not supported`);\n }\n\n const contractAddress = basculeAddressConfig[chainId];\n\n if (!contractAddress) {\n throw new Error(`The address for bascule module is not defined`);\n }\n\n const contract = provider.createContract(BASCULE_ABI, contractAddress);\n\n if (!contract.options.address) {\n contract.options.address = contractAddress;\n }\n\n return contract as typeof contract & {\n options: typeof contract.options & { address: string };\n };\n}\n","import { isHexStrict } from 'web3-validator';\n\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { getErrorMessage } from '../../common/utils/getErrorMessage';\nimport { Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\nimport { getBasculeTokenContract } from '../utils/getBasculeTokenContract';\n\nconst NO_DEPOSIT_ID_ERROR =\n 'No deposit ID provided. Please provide a deposit ID as an argument.';\n\nconst INVALID_DEPOSIT_ID_ERROR =\n 'Invalid deposit ID. Expected a 0x-prefixed 32-byte hex string.';\n\n// Deposit status enum\nexport enum BasculeDepositStatus {\n UNREPORTED = 0, // potentially pending\n REPORTED = 1,\n WITHDRAWN = 2,\n}\n\nexport interface ICheckBasculeDepositStatusParams\n extends IProviderBasedParams,\n IEnvParam {\n /**\n * id of the transaction.\n */\n txId?: string;\n}\n\n/**\n * Check bascule contract deposit status.\n *\n * @param {ICheckBasculeDepositStatusParams} params - The parameters to get status base on Bascule contract.\n *\n * @returns {Promise<BasculeDepositStatus>} Deposit status promise\n */\nexport async function getBasculeDepositStatus({\n txId,\n env,\n ...providerParams\n}: ICheckBasculeDepositStatusParams): Promise<BasculeDepositStatus> {\n if (!txId) {\n throw new Error(NO_DEPOSIT_ID_ERROR);\n }\n\n if (!isHexStrict(txId)) {\n throw new Error(INVALID_DEPOSIT_ID_ERROR);\n }\n\n const provider = new Provider(providerParams);\n const basculeContract = getBasculeTokenContract(provider, env);\n\n try {\n const status: bigint = await basculeContract.methods\n .depositHistory(Buffer.from(txId.replace(/^0x/, ''), 'hex'))\n .call();\n\n const depositStatus: BasculeDepositStatus = Number(status);\n\n return depositStatus;\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n\n throw new Error(errorMessage);\n }\n}\n","import { IReadProviderParams, ReadProvider } from '../../provider/ReadProvider';\nimport { TRpcUrlConfig } from '../../provider/rpcUrlConfig';\nimport { IEnvParam } from '../../common/types/internalTypes';\n\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\n\nexport interface ILBTCTotalSupplyParams extends IEnvParam {\n rpcUrl: string;\n chainId: IReadProviderParams['chainId'];\n}\n\nexport async function getLBTCTotalSupply({\n env,\n rpcUrl,\n chainId,\n}: ILBTCTotalSupplyParams): Promise<string> {\n const rpcUrlConfig: TRpcUrlConfig = { [chainId]: rpcUrl };\n\n const provider = new ReadProvider({ chainId, rpcUrlConfig });\n\n const tokenContract = getLbtcTokenContract(provider, env);\n\n const balance: bigint = await tokenContract.methods.totalSupply().call();\n\n return balance.toString();\n}\n","import {\n defaultEnv,\n ZERO_ADDRESS as PLACEHOLDER_ADDRESS,\n} from '../common/const';\nimport { OChainId, OEnv, TOFTChainId, TEnv } from '../common/types/types';\n\ntype LbtcOFTAdapterConfig = Record<TOFTChainId, string>;\n\nconst stageConfig: LbtcOFTAdapterConfig = {\n [OChainId.sepolia]: '0xe3748bF0Ec0A76767539eE28610B3367e35fe2C2',\n [OChainId.berachainBartioTestnet]:\n '0x1977013acaf27856ac8048C42EE2ed0134d53895',\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n [OChainId.ethereum]: PLACEHOLDER_ADDRESS,\n};\n\nconst testnetConfig: LbtcOFTAdapterConfig = {\n ...stageConfig,\n};\n\nconst prodConfig: LbtcOFTAdapterConfig = {\n ...stageConfig,\n [OChainId.corn]: '0xfc7B20D9B59A8A466f4fC3d34aA69a7D98e71d7A',\n [OChainId.ethereum]: '0x6bc15d7930839ec18a57f6f7df72ae1b439d077f',\n};\n\nexport function getLbtcOFTAdapterAddressConfig(\n env: TEnv = defaultEnv,\n): LbtcOFTAdapterConfig {\n switch (env) {\n case OEnv.prod:\n return prodConfig;\n case OEnv.testnet:\n return testnetConfig;\n default:\n return stageConfig;\n }\n}\n"],"names":["OEnv","OChainId","defaultEnv","ZERO_ADDRESS","stageConfig","testnetConfig","prodConfig","getApiConfig","env","getErrorMessage","error","err","_a","getAxiosErrorMessage","getErrorMessageFromObject","OChainName","getChainNameById","chainId","SANCTIONED_ADDRESS","ADDRESS_URL","SANCTIONS_MESSAGE","generateDepositBtcAddress","address","signature","captchaToken","referrerCode","referralId","baseApiUrl","toChain","requestParams","data","axios","errorMsg","isSanctioned","getDepositBtcAddress","addresses","getDepositBtcAddresses","addressData","getActualAddress","actualAddress","acc","toBlockchain","requestrParams","BTC_DECIMALS","SATOSHI_SCALE","fromSatoshi","amount","toSatoshi","getCainIdByName","chain","getDepositsByAddress","mapResponse","BigNumber","getLBTCExchageRate","chainIdName","rpcUrlConfig","getMaxPriorityFeePerGas","rpcUrl","convertedHexValue","Web3","FEE_MULTIPLIER","ADDITIONAL_SAFE_GAS_PRICE_WEI","ReadProvider","__publicField","defaultRpcUrlConfig","readWeb3","provider","web3","block","maxPriorityFeePerGas","pureGasPriceWei","abi","Provider","account","message","messageHex","from","to","sendOptions","web3Write","web3Read","estimate","estimateFee","extendedGasLimit","gasLimit","value","gasLimitMultiplier","nonce","tx","utils","estimatedGas","multipliedGasLimit","e","maxFeePerGas","safeGasPrice","resolve","reject","promise","transactionHash","getGasMultiplier","isValidChain","PLACEHOLDER_ADDRESS","getLbtcAddressConfig","getTokenABI","token","LBTCABI","IERC20","getLbtcTokenContract","lbtcAddressConfig","tokenAddress","contract","approveLBTC","spender","providerParams","tokenContract","amountSat","INSUFFICIENT_FUNDS_PARTIAL_ERROR","INSUFFICIENT_FUNDS_ERROR","claimLBTC","proofSignature","errorMessage","signLbtcDestionationAddr","params","initEccLib","ecc","getOutputScript","addressType","getAddressType","paymentOutputScript","payments","networks","result","addressUtils","isP2WSHAddressType","unstakeLBTC","btcAddress","outputScript","ERR_MULTIPLE_ERRORS","JSONRPC_ERR_REJECTED_REQUEST","JSONRPC_ERR_UNAUTHORIZED","JSONRPC_ERR_UNSUPPORTED_METHOD","JSONRPC_ERR_DISCONNECTED","JSONRPC_ERR_CHAIN_DISCONNECTED","ERR_RPC_INVALID_JSON","ERR_RPC_INVALID_REQUEST","ERR_RPC_INVALID_METHOD","ERR_RPC_INVALID_PARAMS","ERR_RPC_INTERNAL_ERROR","ERR_RPC_INVALID_INPUT","ERR_RPC_MISSING_RESOURCE","ERR_RPC_UNAVAILABLE_RESOURCE","ERR_RPC_TRANSACTION_REJECTED","ERR_RPC_UNSUPPORTED_METHOD","ERR_RPC_LIMIT_EXCEEDED","ERR_RPC_NOT_SUPPORTED","BaseWeb3Error","msg","cause","MultipleErrors","unquotValue","_","v","errors","genericRpcErrorMessageTemplate","RpcErrorMessages","RpcError","rpcError","ParseError","InvalidRequestError","MethodNotFoundError","InvalidParamsError","InternalError","InvalidInputError","MethodNotSupported","ResourceUnavailableError","ResourcesNotFoundError","VersionNotSupportedError","TransactionRejectedError","LimitExceededError","rpcErrorsMap","isHexStrict","hex","FMT_NUMBER","FMT_BYTES","BlockTags","HardforksOrdered","getBasculeAddressConfig","getBasculeTokenContract","basculeAddressConfig","contractAddress","BASCULE_ABI","NO_DEPOSIT_ID_ERROR","INVALID_DEPOSIT_ID_ERROR","BasculeDepositStatus","getBasculeDepositStatus","txId","basculeContract","status","getLBTCTotalSupply","getLbtcOFTAdapterAddressConfig"],"mappings":"yqBAAaA,EAAO,CAClB,KAAM,OACN,QAAS,UACT,MAAO,OACT,EAIaC,EAAW,CACtB,SAAU,EACV,QAAS,KACT,kBAAmB,GACnB,yBAA0B,GAC1B,KAAM,KACN,YAAa,MACb,uBAAwB,MACxB,QAAS,SACT,KAAM,IACR,EChBaC,EAAmBF,EAAK,KAMxBG,EAAe,6CCDtBC,GAA0B,CAC9B,WAAY,sCACd,EAEMC,GAA4B,CAChC,WAAY,8CACd,EAEMC,GAAyB,CAC7B,WAAY,sCACd,EAEaC,EAAe,CAACC,EAAYN,IAA2B,CAClE,OAAQM,EAAK,CACX,KAAKR,EAAK,KACD,OAAAM,GACT,KAAKN,EAAK,QACD,OAAAK,GACT,QACS,OAAAD,EACX,CACF,ECpBO,SAASK,EAAgBC,EAAwB,CAClD,OAAA,OAAOA,GAAU,SACZA,GAGeC,GACtB,OAAA,QAAAC,EAAAD,GAAA,YAAAA,EAAK,OAAL,YAAAC,EAAW,UAAW,OAAOD,EAAI,KAAK,SAAY,WAEjCD,CAAK,EACfA,EAAM,KAAK,QAGhBA,aAAiB,MACZG,GAAqBH,CAAmB,EAG1CI,GAA0BJ,CAAK,CACxC,CAEA,SAASG,GAAqBH,EAA2B,CACvD,OAAIA,EAAM,SACAA,E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GAAmB,CACvC,IAAA9L,EACA,OAAAiD,EACA,QAAAxC,CACF,EAA4C,CAC1C,MAAMsC,EAA8B,CAAE,CAACtC,CAAO,EAAGwC,CAAO,EAElDS,EAAW,IAAIJ,GAAa,CAAE,QAAA7C,EAAS,aAAAsC,CAAc,CAAA,EAM3D,OAFwB,MAFFoD,EAAqBzC,EAAU1D,CAAG,EAEZ,QAAQ,YAAA,EAAc,QAEnD,UACjB,CCjBA,MAAMJ,EAAoC,CACxC,CAACH,EAAS,OAAO,EAAG,6CACpB,CAACA,EAAS,sBAAsB,EAC9B,6CACF,CAACA,EAAS,IAAI,EAAGoG,EACjB,CAACpG,EAAS,QAAQ,EAAGoG,CACvB,EAEMhG,GAAsC,CAC1C,GAAGD,CACL,EAEME,GAAmC,CACvC,GAAGF,EACH,CAACH,EAAS,IAAI,EAAG,6CACjB,CAACA,EAAS,QAAQ,EAAG,4CACvB,EAEgB,SAAAsM,GACd/L,EAAYN,EACU,CACtB,OAAQM,EAAK,CACX,KAAKR,EAAK,KACD,OAAAM,GACT,KAAKN,EAAK,QACD,OAAAK,GACT,QACS,OAAAD,CACX,CACF","x_google_ignoreList":[26,27,28,29,30,31,32]}
1
+ {"version":3,"file":"index.cjs","sources":["../src/common/types/types.ts","../src/common/const.ts","../src/sdk/apiConfig.ts","../src/common/utils/getErrorMessage.ts","../src/sdk/internalTypes.ts","../src/sdk/utils/getChainNameById.ts","../src/sdk/generateDepositBtcAddress/generateDepositBtcAddress.ts","../src/sdk/getDepositBtcAddress/getDepositBtcAddress.ts","../src/common/utils/convertSatoshi.ts","../src/sdk/utils/getCainIdByName.ts","../src/sdk/getDepositsByAddress/getDepositsByAddress.ts","../../../node_modules/react/cjs/react.production.min.js","../../../node_modules/react/cjs/react.development.js","../../../node_modules/react/index.js","../../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/react/jsx-runtime.js","../src/stories/components/Spinner/Spinner.tsx","../src/stories/components/Button/Button.tsx","../src/stories/components/CodeBlock/CodeBlock.tsx","../src/stories/hooks/useQuery.ts","../src/sdk/const.ts","../src/sdk/getLBTCExchangeRate/getLBTCExchangeRate.ts","../src/sdk/getLBTCExchangeRate/getLBTCExchangeRate.stories.tsx","../src/sdk/getNetworkFeeSignature/getNetworkFeeSignature.ts","../src/sdk/storeNetworkFeeSignature/storeNetworkFeeSignature.ts","../src/provider/rpcUrlConfig.ts","../src/provider/utils/getMaxPriorityFeePerGas.ts","../src/provider/ReadProvider.ts","../src/provider/Provider.ts","../src/web3Sdk/utils/getGasMultiplier.ts","../src/common/utils/isValidChain.ts","../src/web3Sdk/lbtcAddressConfig.ts","../src/web3Sdk/utils/getTokenABI.ts","../src/web3Sdk/utils/getLbtcTokenContract.ts","../src/web3Sdk/approveLBTC/approveLBTC.ts","../src/web3Sdk/claimLBTC/claimLBTC.ts","../../../node_modules/web3-errors/lib/esm/error_codes.js","../../../node_modules/web3-errors/lib/esm/web3_error_base.js","../../../node_modules/web3-errors/lib/esm/errors/rpc_error_messages.js","../../../node_modules/web3-errors/lib/esm/errors/rpc_errors.js","../../../node_modules/web3-validator/lib/esm/validation/string.js","../../../node_modules/web3-types/lib/esm/data_format_types.js","../../../node_modules/web3-types/lib/esm/eth_types.js","../src/web3Sdk/basculeAddressConfig.ts","../src/web3Sdk/utils/getBasculeTokenContract.ts","../src/web3Sdk/getBasculeDepositStatus/getBasculeDepositStatus.ts","../src/web3Sdk/utils/chainIdToEnv.ts","../src/web3Sdk/utils/getRpcUrlConfigFromChain.ts","../src/web3Sdk/getLBTCMintingFee/getLBTCMintingFee.tsx","../src/web3Sdk/getLBTCTotalSupply/getLBTCTotalSupply.ts","../src/web3Sdk/getPermitNonce/getPermitNonce.ts","../src/web3Sdk/lbtcOFTAdapterAddressConfig.ts","../src/web3Sdk/signLbtcDestionationAddr/signLbtcDestionationAddr.ts","../src/web3Sdk/signNetworkFee/getTypedData.ts","../src/web3Sdk/signNetworkFee/signNetworkFee.ts","../src/btcSdk/utils/getOutputScript.ts","../src/web3Sdk/unstakeLBTC/unstakeLBTC.ts"],"sourcesContent":["export const OEnv = {\n prod: 'prod',\n testnet: 'testnet',\n stage: 'stage',\n} as const;\n\nexport type TEnv = (typeof OEnv)[keyof typeof OEnv];\n\nexport const OChainId = {\n ethereum: 1,\n holesky: 17000,\n binanceSmartChain: 56,\n binanceSmartChainTestnet: 97,\n sepolia: 11155111,\n base: 8453,\n baseTestnet: 84532,\n berachainBartioTestnet: 80084,\n\n corn: 21000000,\n} as const;\n\nexport type TChainId = (typeof OChainId)[keyof typeof OChainId];\n\nexport type TOFTChainId =\n | (typeof OChainId)['berachainBartioTestnet']\n | (typeof OChainId)['sepolia']\n | (typeof OChainId)['corn']\n | (typeof OChainId)['ethereum'];\n\n/**\n * Abstract EIP-1193 provider\n */\nexport interface IEIP1193Provider {\n request: (args: any) => Promise<any>;\n}\n","import { OEnv, TEnv } from './types/types';\n\nexport const defaultEnv: TEnv = OEnv.prod;\n\n/**\n * Address of the zero account.\n * Can also be used as a placeholder for unknown addresses.\n */\nexport const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';\n","import { defaultEnv } from '../common/const';\nimport { OEnv, TEnv } from '../common/types/types';\n\ninterface IApiConfig {\n baseApiUrl: string;\n claimerApiUrl: string;\n}\n\nconst stageConfig: IApiConfig = {\n baseApiUrl: 'https://bft-dev.stage.lombard.finance',\n claimerApiUrl: 'https://claimer.staging.lombard.finance',\n};\n\nconst testnetConfig: IApiConfig = {\n baseApiUrl: 'https://gastald-testnet.prod.lombard.finance',\n claimerApiUrl: 'https://claimer.staging.lombard.finance',\n};\n\nconst prodConfig: IApiConfig = {\n baseApiUrl: 'https://mainnet.prod.lombard.finance',\n claimerApiUrl: '',\n};\n\nexport const getApiConfig = (env: TEnv = defaultEnv): IApiConfig => {\n switch (env) {\n case OEnv.prod:\n return prodConfig;\n case OEnv.testnet:\n return testnetConfig;\n default:\n return stageConfig;\n }\n};\n","import { AxiosError } from 'axios';\n\n/**\n * Retrieves the error message from the given error object.\n *\n * @param error - The error object.\n * @returns The error message as a string.\n */\nexport function getErrorMessage(error: unknown): string {\n if (typeof error === 'string') {\n return error;\n }\n\n const hasDataMessage = (err: any): err is { data: { message: string } } =>\n err?.data?.message && typeof err.data.message === 'string';\n\n if (hasDataMessage(error)) {\n return error.data.message;\n }\n\n if (error instanceof Error) {\n return getAxiosErrorMessage(error as AxiosError);\n }\n\n return getErrorMessageFromObject(error);\n}\n\nfunction getAxiosErrorMessage(error: AxiosError): string {\n if (error.response) {\n return (error.response.data as { message: string }).message;\n }\n\n return error.message;\n}\n\nfunction getErrorMessageFromObject(error: any): string {\n if (error?.message) {\n return error.message;\n }\n\n return 'Unknown error';\n}\n","export const OChainName = {\n eth: 'DESTINATION_BLOCKCHAIN_ETHEREUM',\n} as const;\n\nexport type TChainName = (typeof OChainName)[keyof typeof OChainName];\n","import { OChainId, TChainId } from '../../common/types/types';\nimport { OChainName, TChainName } from '../internalTypes';\n\n/**\n * @param chainId the chain ID\n *\n * @returns the chain name\n */\nexport function getChainNameById(chainId: TChainId): TChainName {\n switch (chainId) {\n case OChainId.holesky:\n case OChainId.sepolia:\n case OChainId.ethereum:\n return OChainName.eth;\n default:\n throw new Error(`Unknown chain ID: ${chainId}`);\n }\n}\n","import axios from 'axios';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { TChainId } from '../../common/types/types';\nimport { getErrorMessage } from '../../common/utils/getErrorMessage';\nimport { getApiConfig } from '../apiConfig';\nimport { getChainNameById } from '../utils/getChainNameById';\n\n/**\n * The address wich will be returned if the provided EVM address is sanctioned.\n */\nexport const SANCTIONED_ADDRESS = 'sanctioned_address';\nconst ADDRESS_URL = 'api/v1/address/generate';\nconst SANCTIONS_MESSAGE = 'destination address is under sanctions';\n\ninterface IGenerateNewAddressResponse {\n address: string;\n}\n\nexport interface IGenerateDepositBtcAddressParams extends IEnvParam {\n /**\n * The destination EVM user address where LBTC will be claimed.\n */\n address: string;\n /**\n * The destination chain ID where LBTC will be claimed.\n */\n chainId: TChainId;\n /**\n * The signature of the address. The signature is generated by signing the address using EVM wallet.\n */\n signature: string;\n /**\n * The captcha token.\n */\n captchaToken?: string;\n /**\n * The referrer code.\n */\n referrerCode?: string;\n /**\n * The referral ID.\n */\n referralId: string;\n}\n\n/**\n * Generates a BTC deposit address.\n *\n * If the provided EVM address is sanctioned, the function will return the `SANCTIONED_ADDRESS`.\n *\n * @param {IGenerateDepositBtcAddressParams} params - The parameters for generating the deposit address.\n * @returns {Promise<string>} The generated deposit address.\n */\nexport async function generateDepositBtcAddress({\n address,\n chainId,\n signature,\n env,\n captchaToken,\n referrerCode,\n referralId,\n}: IGenerateDepositBtcAddressParams): Promise<string> {\n const { baseApiUrl } = getApiConfig(env);\n const toChain = getChainNameById(chainId);\n\n const requestParams = {\n to_address: address,\n to_address_signature: signature,\n to_chain: toChain,\n referrer_code: referrerCode,\n referral_id: referralId,\n nonce: 0,\n captcha: captchaToken,\n };\n\n try {\n const { data } = await axios.post<IGenerateNewAddressResponse>(\n ADDRESS_URL,\n requestParams,\n { baseURL: baseApiUrl },\n );\n\n return data.address;\n } catch (error) {\n const errorMsg = getErrorMessage(error);\n\n if (isSanctioned(errorMsg)) {\n return SANCTIONED_ADDRESS;\n } else {\n throw new Error(errorMsg);\n }\n }\n}\n\nfunction isSanctioned(errorMsg: string): boolean {\n return !!errorMsg.includes(SANCTIONS_MESSAGE);\n}\n","import axios from 'axios';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { TChainId } from '../../common/types/types';\nimport { getApiConfig } from '../apiConfig';\nimport { TChainName } from '../internalTypes';\nimport { getChainNameById } from '../utils/getChainNameById';\n\nconst ADDRESS_URL = 'api/v1/address';\n\ntype TReferralId = 'lombard' | string;\n\ninterface IDepositAddress {\n btc_address: string;\n created_at: string;\n deprecated?: boolean;\n type: string;\n used?: boolean;\n deposit_metadata: {\n referral: TReferralId;\n to_address: string;\n to_blockchain: TChainName;\n };\n}\n\ninterface IDepositAddressesResponse {\n addresses: IDepositAddress[];\n has_more?: boolean;\n}\n\n\nexport interface IGetDepositBtcAddressParams extends IEnvParam {\n /**\n * The destination EVM user address where LBTC will be claimed.\n */\n address: string;\n /**\n * The destination chain ID where LBTC will be claimed.\n */\n chainId: TChainId;\n /**\n * The referral ID.\n */\n referralId: TReferralId;\n}\n\n/**\n * Returns the address for depositing BTC.\n *\n * @param {IGetDepositBtcAddressParams} params - function parameters\n *\n * @returns {Promise<string>} the address for depositing BTC\n */\nexport async function getDepositBtcAddress({\n address,\n chainId,\n env,\n referralId,\n}: IGetDepositBtcAddressParams): Promise<string> {\n const addresses = await getDepositBtcAddresses({\n address,\n chainId,\n env,\n referralId,\n });\n\n const addressData = getActualAddress(addresses);\n\n if (!addressData) {\n throw new Error('No address');\n }\n\n return addressData.btc_address;\n}\n\n/**\n * Retrieves the actual deposit address from a list of deposit addresses.\n *\n * @param addresses - The list of deposit addresses.\n * @returns The actual deposit address or undefined if the last created address is deprecated.\n */\nfunction getActualAddress(\n addresses: IDepositAddress[],\n): IDepositAddress | undefined {\n if (!addresses.length) {\n return undefined;\n }\n\n const actualAddress = addresses.reduce((acc, address) => {\n if (acc.created_at < address.created_at) {\n return address;\n }\n return acc;\n }, addresses[0]);\n\n return actualAddress.deprecated ? undefined : actualAddress;\n}\n\n/**\n * Returns the addresses for depositing BTC.\n *\n * @param {IGetDepositBtcAddressParams} params - function parameters\n *\n * @returns {Promise<IDepositAddress[]>} the deposit addresses\n */\nexport async function getDepositBtcAddresses({\n address,\n chainId,\n env,\n referralId,\n}: IGetDepositBtcAddressParams): Promise<IDepositAddress[]> {\n const { baseApiUrl } = getApiConfig(env);\n const toBlockchain = getChainNameById(chainId);\n\n const requestrParams = {\n to_address: address,\n to_blockchain: toBlockchain,\n limit: 1,\n offset: 0,\n asc: false,\n referralId,\n };\n\n const { data } = await axios.get<IDepositAddressesResponse>(ADDRESS_URL, {\n baseURL: baseApiUrl,\n params: requestrParams,\n });\n\n return data?.addresses || [];\n}\n","const BTC_DECIMALS = 8;\nexport const SATOSHI_SCALE = 10 ** BTC_DECIMALS;\n\n/**\n * Convert Satoshi to BTC\n * @param amount - Satoshi amount\n * @returns BTC amount\n */\nexport function fromSatoshi(amount: number | string) {\n return +amount / SATOSHI_SCALE;\n}\n\n/**\n * Convert BTC to Satoshi\n *\n * @param amount - BTC amount\n * @returns Satoshi amount\n */\nexport function toSatoshi(amount: number | string) {\n return Math.floor(+amount * SATOSHI_SCALE);\n}\n","import { defaultEnv } from '../../common/const';\nimport { OChainId, OEnv, TChainId, TEnv } from '../../common/types/types';\nimport { TChainName } from '../internalTypes';\n\n/**\n * @param chainId the chain ID\n *\n * @returns the chain name\n */\nexport function getCainIdByName(\n chain: string,\n env: TEnv = defaultEnv,\n): TChainId {\n switch (chain as TChainName) {\n case 'DESTINATION_BLOCKCHAIN_ETHEREUM':\n return env === OEnv.prod ? OChainId.ethereum : OChainId.sepolia;\n\n default:\n return OChainId.ethereum;\n }\n}\n","import axios from 'axios';\nimport BigNumber from 'bignumber.js';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { TChainId, TEnv } from '../../common/types/types';\nimport { fromSatoshi } from '../../common/utils/convertSatoshi';\nimport { getApiConfig } from '../apiConfig';\nimport { getCainIdByName } from '../utils/getCainIdByName';\n\ntype Address = string;\ntype Seconds = number;\n\nexport enum ENotarizationStatus {\n NOTARIZATION_STATUS_UNSPECIFIED = 'NOTARIZATION_STATUS_UNSPECIFIED',\n // actually initial status for a deposit tx\n NOTARIZATION_STATUS_PENDING = 'NOTARIZATION_STATUS_PENDING',\n // the deposit was sent to the notarization\n NOTARIZATION_STATUS_SUBMITTED = 'NOTARIZATION_STATUS_SUBMITTED',\n // notarization was approved\n NOTARIZATION_STATUS_SESSION_APPROVED = 'NOTARIZATION_STATUS_SESSION_APPROVED',\n // notarization was failed\n NOTARIZATION_STATUS_FAILED = 'NOTARIZATION_STATUS_FAILED',\n}\n\nexport enum ESessionState {\n SESSION_STATE_UNSPECIFIED = 'SESSION_STATE_UNSPECIFIED',\n SESSION_STATE_PENDING = 'SESSION_STATE_PENDING',\n SESSION_STATE_COMPLETED = 'SESSION_STATE_COMPLETED',\n SESSION_STATE_EXPIRED = 'SESSION_STATE_EXPIRED',\n}\n\ninterface IDepositResponse {\n txid: string;\n value: number;\n address: Address;\n to_chain: string;\n notarization_wait_dur?: string | number;\n index?: number;\n raw_payload?: string;\n payload_hash?: string;\n proof?: string;\n claim_tx?: string; // tx on the destination chain\n block_height?: string;\n block_time?: string;\n sanctioned?: boolean;\n\n session_id: number;\n notarization_status: ENotarizationStatus;\n session_state: ESessionState;\n}\n\ninterface IDepositsByAddressResponse {\n outputs: IDepositResponse[];\n}\n\nexport interface IDeposit {\n txid: string;\n index?: number;\n blockHeight?: number;\n blockTime?: number;\n value: BigNumber;\n address: Address;\n chainId: TChainId;\n isClaimed?: boolean;\n claimedTxId?: string;\n rawPayload?: string;\n signature?: string;\n isRestricted?: boolean;\n notarizationWaitDur?: Seconds;\n // bascule hash id\n payload?: string;\n\n sessionId: number;\n notarizationStatus: ENotarizationStatus;\n sessionState: ESessionState;\n fromChainId?: TChainId;\n toChainId?: TChainId;\n status?: string;\n}\n\nexport interface IGetDepositsByAddressParams extends IEnvParam {\n /**\n * The EVM address to get deposits for\n */\n address: Address;\n}\n\n/**\n * Returns all deposits for a given address\n *\n * @param {IGetDepositsByAddressParams} params\n *\n * @returns {Promise<IDeposit[]>} a list of deposits\n */\nexport async function getDepositsByAddress({\n address,\n env,\n}: IGetDepositsByAddressParams): Promise<IDeposit[]> {\n const { baseApiUrl } = getApiConfig(env);\n\n const { data } = await axios.get<IDepositsByAddressResponse | undefined>(\n `api/v1/address/outputs-v2/${address}`,\n { baseURL: baseApiUrl },\n );\n\n const outputs = data?.outputs ?? [];\n\n return outputs.map(mapResponse(env));\n}\n\nfunction mapResponse(env?: TEnv) {\n return (data: IDepositResponse): IDeposit => ({\n txid: data.txid,\n index: data.index ?? 0,\n blockHeight: data.block_height ? Number(data.block_height) : undefined,\n blockTime: data.block_time ? Number(data.block_time) : undefined,\n value: new BigNumber(fromSatoshi(data.value)),\n address: data.address,\n chainId: getCainIdByName(data.to_chain, env),\n claimedTxId: data.claim_tx,\n rawPayload: data.raw_payload,\n signature: data.proof,\n isRestricted: !!data.sanctioned,\n notarizationWaitDur: data.notarization_wait_dur\n ? Number(data.notarization_wait_dur)\n : undefined,\n payload: data.payload_hash,\n sessionId: data.session_id,\n notarizationStatus: data.notarization_status,\n sessionState: data.session_state,\n });\n}\n","/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}\nfunction N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\\/+/g;function Q(a,b){return\"object\"===typeof a&&null!==a&&null!=a.key?escape(\"\"+a.key):b.toString(36)}\nfunction R(a,b,e,d,c){var k=typeof a;if(\"undefined\"===k||\"boolean\"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case \"string\":case \"number\":h=!0;break;case \"object\":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=\"\"===d?\".\"+Q(h,0):d,I(c)?(e=\"\",null!=a&&(e=a.replace(P,\"$&/\")+\"/\"),R(c,b,e,\"\",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?\"\":(\"\"+c.key).replace(P,\"$&/\")+\"/\")+a)),b.push(c)),1;h=0;d=\"\"===d?\".\":d+\":\";if(I(a))for(var g=0;g<a.length;g++){k=\na[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),\"function\"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if(\"object\"===k)throw b=String(a),Error(\"Objects are not valid as a React child (found: \"+(\"[object Object]\"===b?\"object with keys {\"+Object.keys(a).join(\", \")+\"}\":b)+\"). If you meant to render a collection of children, use an array instead.\");return h}\nfunction S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,\"\",\"\",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}\nvar U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};exports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error(\"React.Children.only expected to receive a single React element child.\");return a}};exports.Component=E;exports.Fragment=p;\nexports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;\nexports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+a+\".\");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=\"\"+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);\nfor(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};\nexports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=function(){throw Error(\"act(...) is not supported in production builds of React.\");};\nexports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};\nexports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};exports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};\nexports.useTransition=function(){return U.current.useTransition()};exports.version=\"18.2.0\";\n","/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var ReactVersion = '18.2.0';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n transition: null\n};\n\nvar ReactCurrentActQueue = {\n current: null,\n // Used to reproduce behavior of `batchedUpdates` in legacy mode.\n isBatchingLegacy: false,\n didScheduleLegacyUpdate: false\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar ReactDebugCurrentFrame = {};\nvar currentExtraStackFrame = null;\nfunction setExtraStackFrame(stack) {\n {\n currentExtraStackFrame = stack;\n }\n}\n\n{\n ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {\n {\n currentExtraStackFrame = stack;\n }\n }; // Stack implementation injected by the current renderer.\n\n\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentExtraStackFrame) {\n stack += currentExtraStackFrame;\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar ReactSharedInternals = {\n ReactCurrentDispatcher: ReactCurrentDispatcher,\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\n ReactCurrentOwner: ReactCurrentOwner\n};\n\n{\n ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;\n ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;\n}\n\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + \".\" + callerName;\n\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n/**\n * This is the abstract API for an update queue.\n */\n\n\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar assign = Object.assign;\n\nvar emptyObject = {};\n\n{\n Object.freeze(emptyObject);\n}\n/**\n * Base class helpers for the updating state of a component.\n */\n\n\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\n\nComponent.prototype.setState = function (partialState, callback) {\n if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {\n throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');\n }\n\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\n\n\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n\n\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n\n return undefined;\n }\n });\n };\n\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\n\nComponentDummy.prototype = Component.prototype;\n/**\n * Convenience component with default shallow equality check for sCU.\n */\n\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\n\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n var warnAboutAccessingKey = function () {\n {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n var warnAboutAccessingRef = function () {\n {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\n\nfunction createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\n\nfunction cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n var escapeRegex = /[=:]/g;\n var escaperLookup = {\n '=': '=0',\n ':': '=2'\n };\n var escapedString = key.replace(escapeRegex, function (match) {\n return escaperLookup[match];\n });\n return '$' + escapedString;\n}\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\n\nvar didWarnAboutMaps = false;\nvar userProvidedKeyEscapeRegex = /\\/+/g;\n\nfunction escapeUserProvidedKey(text) {\n return text.replace(userProvidedKeyEscapeRegex, '$&/');\n}\n/**\n * Generate a key string that identifies a element within a set.\n *\n * @param {*} element A element that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\n\n\nfunction getElementKey(element, index) {\n // Do some typechecking here since we call this blindly. We want to ensure\n // that we don't block potential future ES APIs.\n if (typeof element === 'object' && element !== null && element.key != null) {\n // Explicit key\n {\n checkKeyStringCoercion(element.key);\n }\n\n return escape('' + element.key);\n } // Implicit key determined by the index in the set\n\n\n return index.toString(36);\n}\n\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n\n if (type === 'undefined' || type === 'boolean') {\n // All of the above are perceived as null.\n children = null;\n }\n\n var invokeCallback = false;\n\n if (children === null) {\n invokeCallback = true;\n } else {\n switch (type) {\n case 'string':\n case 'number':\n invokeCallback = true;\n break;\n\n case 'object':\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = true;\n }\n\n }\n }\n\n if (invokeCallback) {\n var _child = children;\n var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows:\n\n var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;\n\n if (isArray(mappedChild)) {\n var escapedChildKey = '';\n\n if (childKey != null) {\n escapedChildKey = escapeUserProvidedKey(childKey) + '/';\n }\n\n mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {\n return c;\n });\n } else if (mappedChild != null) {\n if (isValidElement(mappedChild)) {\n {\n // The `if` statement here prevents auto-disabling of the safe\n // coercion ESLint rule, so we must manually disable it below.\n // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {\n checkKeyStringCoercion(mappedChild.key);\n }\n }\n\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\n // traverseAllChildren used to do for objects as children\n escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number\n // eslint-disable-next-line react-internal/safe-string-coercion\n escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);\n }\n\n array.push(mappedChild);\n }\n\n return 1;\n }\n\n var child;\n var nextName;\n var subtreeCount = 0; // Count of children found in the current subtree.\n\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n nextName = nextNamePrefix + getElementKey(child, i);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var iterableChildren = children;\n\n {\n // Warn about using Maps as children\n if (iteratorFn === iterableChildren.entries) {\n if (!didWarnAboutMaps) {\n warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n\n var iterator = iteratorFn.call(iterableChildren);\n var step;\n var ii = 0;\n\n while (!(step = iterator.next()).done) {\n child = step.value;\n nextName = nextNamePrefix + getElementKey(child, ii++);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else if (type === 'object') {\n // eslint-disable-next-line react-internal/safe-string-coercion\n var childrenString = String(children);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n }\n }\n\n return subtreeCount;\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\n *\n * The provided mapFunction(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var result = [];\n var count = 0;\n mapIntoArray(children, result, '', '', function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\n\n\nfunction countChildren(children) {\n var n = 0;\n mapChildren(children, function () {\n n++; // Don't return anything\n });\n return n;\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n mapChildren(children, function () {\n forEachFunc.apply(this, arguments); // Don't return anything.\n }, forEachContext);\n}\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\n */\n\n\nfunction toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\n\n\nfunction onlyChild(children) {\n if (!isValidElement(children)) {\n throw new Error('React.Children.only expected to receive a single React element child.');\n }\n\n return children;\n}\n\nfunction createContext(defaultValue) {\n // TODO: Second argument used to be an optional `calculateChangedBits`\n // function. Warn to reserve for future use?\n var context = {\n $$typeof: REACT_CONTEXT_TYPE,\n // As a workaround to support multiple concurrent renderers, we categorize\n // some renderers as primary and others as secondary. We only expect\n // there to be two concurrent renderers at most: React Native (primary) and\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\n // Secondary renderers store their context values on separate fields.\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n // Used to track how many concurrent renderers this context currently\n // supports within in a single renderer. Such as parallel server rendering.\n _threadCount: 0,\n // These are circular\n Provider: null,\n Consumer: null,\n // Add these to use same hidden class in VM as ServerContext\n _defaultValue: null,\n _globalName: null\n };\n context.Provider = {\n $$typeof: REACT_PROVIDER_TYPE,\n _context: context\n };\n var hasWarnedAboutUsingNestedContextConsumers = false;\n var hasWarnedAboutUsingConsumerProvider = false;\n var hasWarnedAboutDisplayNameOnConsumer = false;\n\n {\n // A separate object, but proxies back to the original context object for\n // backwards compatibility. It has a different $$typeof, so we can properly\n // warn for the incorrect usage of Context as a Consumer.\n var Consumer = {\n $$typeof: REACT_CONTEXT_TYPE,\n _context: context\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\n\n Object.defineProperties(Consumer, {\n Provider: {\n get: function () {\n if (!hasWarnedAboutUsingConsumerProvider) {\n hasWarnedAboutUsingConsumerProvider = true;\n\n error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');\n }\n\n return context.Provider;\n },\n set: function (_Provider) {\n context.Provider = _Provider;\n }\n },\n _currentValue: {\n get: function () {\n return context._currentValue;\n },\n set: function (_currentValue) {\n context._currentValue = _currentValue;\n }\n },\n _currentValue2: {\n get: function () {\n return context._currentValue2;\n },\n set: function (_currentValue2) {\n context._currentValue2 = _currentValue2;\n }\n },\n _threadCount: {\n get: function () {\n return context._threadCount;\n },\n set: function (_threadCount) {\n context._threadCount = _threadCount;\n }\n },\n Consumer: {\n get: function () {\n if (!hasWarnedAboutUsingNestedContextConsumers) {\n hasWarnedAboutUsingNestedContextConsumers = true;\n\n error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n\n return context.Consumer;\n }\n },\n displayName: {\n get: function () {\n return context.displayName;\n },\n set: function (displayName) {\n if (!hasWarnedAboutDisplayNameOnConsumer) {\n warn('Setting `displayName` on Context.Consumer has no effect. ' + \"You should set it directly on the context with Context.displayName = '%s'.\", displayName);\n\n hasWarnedAboutDisplayNameOnConsumer = true;\n }\n }\n }\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\n\n context.Consumer = Consumer;\n }\n\n {\n context._currentRenderer = null;\n context._currentRenderer2 = null;\n }\n\n return context;\n}\n\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\n\nfunction lazyInitializer(payload) {\n if (payload._status === Uninitialized) {\n var ctor = payload._result;\n var thenable = ctor(); // Transition to the next state.\n // This might throw either because it's missing or throws. If so, we treat it\n // as still uninitialized and try again next time. Which is the same as what\n // happens if the ctor or any wrappers processing the ctor throws. This might\n // end up fixing it if the resolution was a concurrency bug.\n\n thenable.then(function (moduleObject) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var resolved = payload;\n resolved._status = Resolved;\n resolved._result = moduleObject;\n }\n }, function (error) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var rejected = payload;\n rejected._status = Rejected;\n rejected._result = error;\n }\n });\n\n if (payload._status === Uninitialized) {\n // In case, we're still uninitialized, then we're waiting for the thenable\n // to resolve. Set it as pending in the meantime.\n var pending = payload;\n pending._status = Pending;\n pending._result = thenable;\n }\n }\n\n if (payload._status === Resolved) {\n var moduleObject = payload._result;\n\n {\n if (moduleObject === undefined) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\\n\\n\" + 'Did you accidentally put curly braces around the import?', moduleObject);\n }\n }\n\n {\n if (!('default' in moduleObject)) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\", moduleObject);\n }\n }\n\n return moduleObject.default;\n } else {\n throw payload._result;\n }\n}\n\nfunction lazy(ctor) {\n var payload = {\n // We use these fields to store the result.\n _status: Uninitialized,\n _result: ctor\n };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: payload,\n _init: lazyInitializer\n };\n\n {\n // In production, this would just set it on the object.\n var defaultProps;\n var propTypes; // $FlowFixMe\n\n Object.defineProperties(lazyType, {\n defaultProps: {\n configurable: true,\n get: function () {\n return defaultProps;\n },\n set: function (newDefaultProps) {\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n defaultProps = newDefaultProps; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'defaultProps', {\n enumerable: true\n });\n }\n },\n propTypes: {\n configurable: true,\n get: function () {\n return propTypes;\n },\n set: function (newPropTypes) {\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n propTypes = newPropTypes; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'propTypes', {\n enumerable: true\n });\n }\n }\n });\n }\n\n return lazyType;\n}\n\nfunction forwardRef(render) {\n {\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\n } else if (typeof render !== 'function') {\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\n } else {\n if (render.length !== 0 && render.length !== 2) {\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\n }\n }\n\n if (render != null) {\n if (render.defaultProps != null || render.propTypes != null) {\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\n }\n }\n }\n\n var elementType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: render\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.forwardRef((props, ref) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!render.name && !render.displayName) {\n render.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction memo(type, compare) {\n {\n if (!isValidElementType(type)) {\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\n }\n }\n\n var elementType = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: compare === undefined ? null : compare\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.memo((props) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!type.name && !type.displayName) {\n type.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nfunction resolveDispatcher() {\n var dispatcher = ReactCurrentDispatcher.current;\n\n {\n if (dispatcher === null) {\n error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n }\n } // Will result in a null access error if accessed outside render phase. We\n // intentionally don't throw our own error because this is in a hot path.\n // Also helps ensure this is inlined.\n\n\n return dispatcher;\n}\nfunction useContext(Context) {\n var dispatcher = resolveDispatcher();\n\n {\n // TODO: add a more generic warning for invalid values.\n if (Context._context !== undefined) {\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\n // and nobody should be using this in existing code.\n\n if (realContext.Consumer === Context) {\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\n } else if (realContext.Provider === Context) {\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\n }\n }\n }\n\n return dispatcher.useContext(Context);\n}\nfunction useState(initialState) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useState(initialState);\n}\nfunction useReducer(reducer, initialArg, init) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useReducer(reducer, initialArg, init);\n}\nfunction useRef(initialValue) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useRef(initialValue);\n}\nfunction useEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useEffect(create, deps);\n}\nfunction useInsertionEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useInsertionEffect(create, deps);\n}\nfunction useLayoutEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useLayoutEffect(create, deps);\n}\nfunction useCallback(callback, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useCallback(callback, deps);\n}\nfunction useMemo(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useMemo(create, deps);\n}\nfunction useImperativeHandle(ref, create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useImperativeHandle(ref, create, deps);\n}\nfunction useDebugValue(value, formatterFn) {\n {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDebugValue(value, formatterFn);\n }\n}\nfunction useTransition() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useTransition();\n}\nfunction useDeferredValue(value) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDeferredValue(value);\n}\nfunction useId() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useId();\n}\nfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher$1.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher$1.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n setExtraStackFrame(stack);\n } else {\n setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n if (ReactCurrentOwner.current) {\n var name = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\n if (elementProps !== null && elementProps !== undefined) {\n return getSourceInfoErrorAddendum(elementProps.__source);\n }\n\n return '';\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n {\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\nfunction createElementWithValidation(type, props, children) {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendumForProps(props);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n {\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n }\n\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], type);\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n}\nvar didWarnAboutDeprecatedCreateFactory = false;\nfunction createFactoryWithValidation(type) {\n var validatedFactory = createElementWithValidation.bind(null, type);\n validatedFactory.type = type;\n\n {\n if (!didWarnAboutDeprecatedCreateFactory) {\n didWarnAboutDeprecatedCreateFactory = true;\n\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\n } // Legacy hook: remove it\n\n\n Object.defineProperty(validatedFactory, 'type', {\n enumerable: false,\n get: function () {\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n\n Object.defineProperty(this, 'type', {\n value: type\n });\n return type;\n }\n });\n }\n\n return validatedFactory;\n}\nfunction cloneElementWithValidation(element, props, children) {\n var newElement = cloneElement.apply(this, arguments);\n\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], newElement.type);\n }\n\n validatePropTypes(newElement);\n return newElement;\n}\n\nfunction startTransition(scope, options) {\n var prevTransition = ReactCurrentBatchConfig.transition;\n ReactCurrentBatchConfig.transition = {};\n var currentTransition = ReactCurrentBatchConfig.transition;\n\n {\n ReactCurrentBatchConfig.transition._updatedFibers = new Set();\n }\n\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.transition = prevTransition;\n\n {\n if (prevTransition === null && currentTransition._updatedFibers) {\n var updatedFibersCount = currentTransition._updatedFibers.size;\n\n if (updatedFibersCount > 10) {\n warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');\n }\n\n currentTransition._updatedFibers.clear();\n }\n }\n }\n}\n\nvar didWarnAboutMessageChannel = false;\nvar enqueueTaskImpl = null;\nfunction enqueueTask(task) {\n if (enqueueTaskImpl === null) {\n try {\n // read require off the module object to get around the bundlers.\n // we don't want them to detect a require and bundle a Node polyfill.\n var requireString = ('require' + Math.random()).slice(0, 7);\n var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's\n // version of setImmediate, bypassing fake timers if any.\n\n enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;\n } catch (_err) {\n // we're in a browser\n // we can't use regular timers because they may still be faked\n // so we try MessageChannel+postMessage instead\n enqueueTaskImpl = function (callback) {\n {\n if (didWarnAboutMessageChannel === false) {\n didWarnAboutMessageChannel = true;\n\n if (typeof MessageChannel === 'undefined') {\n error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');\n }\n }\n }\n\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(undefined);\n };\n }\n }\n\n return enqueueTaskImpl(task);\n}\n\nvar actScopeDepth = 0;\nvar didWarnNoAwaitAct = false;\nfunction act(callback) {\n {\n // `act` calls can be nested, so we track the depth. This represents the\n // number of `act` scopes on the stack.\n var prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n\n if (ReactCurrentActQueue.current === null) {\n // This is the outermost `act` scope. Initialize the queue. The reconciler\n // will detect the queue and use it instead of Scheduler.\n ReactCurrentActQueue.current = [];\n }\n\n var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;\n var result;\n\n try {\n // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only\n // set to `true` while the given callback is executed, not for updates\n // triggered during an async event, because this is how the legacy\n // implementation of `act` behaved.\n ReactCurrentActQueue.isBatchingLegacy = true;\n result = callback(); // Replicate behavior of original `act` implementation in legacy mode,\n // which flushed updates immediately after the scope function exits, even\n // if it's an async function.\n\n if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n ReactCurrentActQueue.didScheduleLegacyUpdate = false;\n flushActQueue(queue);\n }\n }\n } catch (error) {\n popActScope(prevActScopeDepth);\n throw error;\n } finally {\n ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;\n }\n\n if (result !== null && typeof result === 'object' && typeof result.then === 'function') {\n var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait\n // for it to resolve before exiting the current scope.\n\n var wasAwaited = false;\n var thenable = {\n then: function (resolve, reject) {\n wasAwaited = true;\n thenableResult.then(function (returnValue) {\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // We've exited the outermost act scope. Recursively flush the\n // queue until there's no remaining work.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }, function (error) {\n // The callback threw an error.\n popActScope(prevActScopeDepth);\n reject(error);\n });\n }\n };\n\n {\n if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {\n // eslint-disable-next-line no-undef\n Promise.resolve().then(function () {}).then(function () {\n if (!wasAwaited) {\n didWarnNoAwaitAct = true;\n\n error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');\n }\n });\n }\n }\n\n return thenable;\n } else {\n var returnValue = result; // The callback is not an async function. Exit the current scope\n // immediately, without awaiting.\n\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // Exiting the outermost act scope. Flush the queue.\n var _queue = ReactCurrentActQueue.current;\n\n if (_queue !== null) {\n flushActQueue(_queue);\n ReactCurrentActQueue.current = null;\n } // Return a thenable. If the user awaits it, we'll flush again in\n // case additional work was scheduled by a microtask.\n\n\n var _thenable = {\n then: function (resolve, reject) {\n // Confirm we haven't re-entered another `act` scope, in case\n // the user does something weird like await the thenable\n // multiple times.\n if (ReactCurrentActQueue.current === null) {\n // Recursively flush the queue until there's no remaining work.\n ReactCurrentActQueue.current = [];\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }\n };\n return _thenable;\n } else {\n // Since we're inside a nested `act` scope, the returned thenable\n // immediately resolves. The outer scope will flush the queue.\n var _thenable2 = {\n then: function (resolve, reject) {\n resolve(returnValue);\n }\n };\n return _thenable2;\n }\n }\n }\n}\n\nfunction popActScope(prevActScopeDepth) {\n {\n if (prevActScopeDepth !== actScopeDepth - 1) {\n error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');\n }\n\n actScopeDepth = prevActScopeDepth;\n }\n}\n\nfunction recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n if (queue.length === 0) {\n // No additional work was scheduled. Finish.\n ReactCurrentActQueue.current = null;\n resolve(returnValue);\n } else {\n // Keep flushing work until there's none left.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n }\n });\n } catch (error) {\n reject(error);\n }\n } else {\n resolve(returnValue);\n }\n }\n}\n\nvar isFlushing = false;\n\nfunction flushActQueue(queue) {\n {\n if (!isFlushing) {\n // Prevent re-entrance.\n isFlushing = true;\n var i = 0;\n\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(true);\n } while (callback !== null);\n }\n\n queue.length = 0;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n queue = queue.slice(i + 1);\n throw error;\n } finally {\n isFlushing = false;\n }\n }\n }\n}\n\nvar createElement$1 = createElementWithValidation ;\nvar cloneElement$1 = cloneElementWithValidation ;\nvar createFactory = createFactoryWithValidation ;\nvar Children = {\n map: mapChildren,\n forEach: forEachChildren,\n count: countChildren,\n toArray: toArray,\n only: onlyChild\n};\n\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\nexports.cloneElement = cloneElement$1;\nexports.createContext = createContext;\nexports.createElement = createElement$1;\nexports.createFactory = createFactory;\nexports.createRef = createRef;\nexports.forwardRef = forwardRef;\nexports.isValidElement = isValidElement;\nexports.lazy = lazy;\nexports.memo = memo;\nexports.startTransition = startTransition;\nexports.unstable_act = act;\nexports.useCallback = useCallback;\nexports.useContext = useContext;\nexports.useDebugValue = useDebugValue;\nexports.useDeferredValue = useDeferredValue;\nexports.useEffect = useEffect;\nexports.useId = useId;\nexports.useImperativeHandle = useImperativeHandle;\nexports.useInsertionEffect = useInsertionEffect;\nexports.useLayoutEffect = useLayoutEffect;\nexports.useMemo = useMemo;\nexports.useReducer = useReducer;\nexports.useRef = useRef;\nexports.useState = useState;\nexports.useSyncExternalStore = useSyncExternalStore;\nexports.useTransition = useTransition;\nexports.version = ReactVersion;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","interface ISpinnerProps {\n color?: 'text-primary' | 'text-light';\n size?: 'sm' | 'md';\n className?: string;\n}\n\nexport function Spinner({\n color = 'text-primary',\n size = 'sm',\n className,\n}: ISpinnerProps): JSX.Element {\n return (\n <div\n className={[\n 'spinner-border',\n color,\n size === 'sm' ? 'spinner-border-sm' : '',\n className || '',\n ].join(' ')}\n role=\"status\"\n >\n <span className=\"visually-hidden\">Loading...</span>\n </div>\n );\n}\n","import React from 'react';\nimport { Spinner } from '../Spinner';\n\nexport interface ButtonProps {\n disabled?: boolean;\n children?: React.ReactNode;\n primary?: boolean;\n size?: 'small' | 'medium' | 'large';\n isLoading?: boolean;\n onClick?: () => void;\n}\n\n/**\n * Primary UI component for user interaction\n */\nexport const Button = ({\n primary = true,\n size = 'medium',\n children,\n isLoading,\n ...props\n}: ButtonProps) => {\n return (\n <button\n type=\"button\"\n className={[\n 'btn',\n size === 'small' ? 'btn-sm' : '',\n size === 'large' ? 'btn-lg' : '',\n primary ? 'btn-primary' : 'btn-secondary',\n ].join(' ')}\n {...props}\n >\n {children}\n\n {isLoading && <Spinner color=\"text-light\" className=\"ms-2\" />}\n </button>\n );\n};\n","import './CodeBlockStyles.css';\n\ninterface ICodeBlockProps {\n text?: any;\n withFormatting?: boolean;\n}\n\nexport function CodeBlock({\n text,\n withFormatting = true,\n}: ICodeBlockProps): JSX.Element | null {\n const formattedCode =\n text && withFormatting ? JSON.stringify(text, null, 2) : text;\n\n if (text === undefined || text === null) {\n return null;\n }\n\n return (\n <pre className=\"card my-3 code-block--max-height\">\n <code className=\"card-body\">{formattedCode}</code>\n </pre>\n );\n}\n","import { useCallback, useEffect, useState } from 'react';\nimport { getErrorMessage } from '../../common/utils/getErrorMessage';\n\ntype QueryFn<T> = () => Promise<T>;\n\ninterface UseQueryResult<T> {\n data: T | null;\n error: string | null;\n isLoading: boolean;\n refetch: () => void;\n}\n\n/**\n * Custom hook for making a query and managing the query state.\n *\n * @template T - The type of data returned by the query.\n * @param queryFn The function that performs the query.\n * @param dependencies The dependencies that trigger a re-fetch of the query.\n * @param shouldFetch Determines whether the query should be fetched initially. Defaults to true.\n * @returns The query result object containing the data, error, loading state, and a refetch function.\n */\nexport function useQuery<T>(\n queryFn: QueryFn<T>,\n dependencies: any[] = [],\n shouldFetch = true,\n): UseQueryResult<T> {\n const [data, setData] = useState<T | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [isLoading, setLoading] = useState<boolean>(false);\n\n const fetchData = useCallback(async () => {\n setLoading(true);\n setError(null);\n setData(null);\n try {\n const result = await queryFn();\n setData(result);\n } catch (err) {\n console.error(err);\n const errorMsg = getErrorMessage(err);\n setError(errorMsg);\n } finally {\n setLoading(false);\n }\n }, [queryFn, ...dependencies]);\n\n useEffect(() => {\n if (shouldFetch) {\n fetchData();\n }\n }, [shouldFetch, fetchData, ...dependencies]);\n\n return { data, error, isLoading, refetch: fetchData };\n}\n\nexport default useQuery;\n","export const MIN_STAKE_AMOUNT = 0.0002;\n","import axios from 'axios';\nimport BigNumber from 'bignumber.js';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { OChainId, TChainId } from '../../common/types/types';\nimport { SATOSHI_SCALE } from '../../common/utils/convertSatoshi';\nimport { getApiConfig } from '../apiConfig';\nimport { MIN_STAKE_AMOUNT } from '../const';\nimport { getChainNameById } from '../utils/getChainNameById';\n\ntype ExchangeRateResponse = {\n amount_out: string;\n};\n\nexport interface IgetLBTCExchangeRateParams extends IEnvParam {\n /**\n * The chain id of the asset to get the exchange rate for. Exchange rate is the same for all chains so this param is optional.\n *\n * @default OChainId.ethereum\n */\n chainId?: TChainId;\n /**\n * The amount of the asset to get the exchange rate for. If not provided, the exchange rate will be returned for 1 BTC.\n *\n * @default 1\n */\n amount?: number;\n}\n\nexport interface IgetLBTCExchangeRateResponse {\n /**\n * The exchange rate for LBTC:BTC\n */\n exchangeRate: number;\n /**\n * The minimum amount of the asset to stake\n */\n minAmount: number;\n}\n\n/**\n * Retrieves the exchange rate for LBTC.\n *\n * @param {IgetLBTCExchangeRateParams} params\n *\n * @returns {Promise<IgetLBTCExchangeRateResponse>} - The exchange rate.\n */\nexport async function getLBTCExchangeRate({\n env,\n chainId = OChainId.ethereum,\n amount = 1,\n}: IgetLBTCExchangeRateParams): Promise<IgetLBTCExchangeRateResponse> {\n const { baseApiUrl } = getApiConfig(env);\n const chainIdName = getChainNameById(chainId);\n\n const { data } = await axios.get<ExchangeRateResponse>(\n `api/v1/exchange/rate/${chainIdName}`,\n { baseURL: baseApiUrl, params: { amount } },\n );\n\n const minAmount = new BigNumber(MIN_STAKE_AMOUNT)\n .multipliedBy(SATOSHI_SCALE)\n .toFixed();\n\n return { exchangeRate: +data.amount_out, minAmount: +minAmount };\n}\n","import type { Meta, StoryObj } from '@storybook/react';\nimport { defaultEnv } from '../../common/const';\nimport { OChainId } from '../../common/types/types';\nimport { Button } from '../../stories/components/Button';\nimport { CodeBlock } from '../../stories/components/CodeBlock';\nimport useQuery from '../../stories/hooks/useQuery';\nimport {\n getLBTCExchangeRate,\n IgetLBTCExchangeRateParams,\n} from './getLBTCExchangeRate';\n\nconst meta = {\n title: 'SDK/getLBTCExchangeRate',\n component: StoryView,\n tags: ['autodocs'],\n} satisfies Meta<typeof StoryView>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const WithDefaults: Story = {\n args: {\n env: defaultEnv,\n amount: 1,\n chainId: OChainId.ethereum,\n },\n};\n\nexport function StoryView(props: IgetLBTCExchangeRateParams) {\n const { data, error, isLoading, refetch } = useQuery(\n () => getLBTCExchangeRate(props),\n [props],\n false,\n );\n\n return (\n <>\n <Button onClick={refetch} disabled={isLoading} isLoading={isLoading}>\n Get LBTC Exchange Rate\n </Button>\n\n <CodeBlock text={error || data} />\n </>\n );\n}\n","import axios from 'axios';\n\nimport { getErrorMessage } from '../../common/utils/getErrorMessage';\nimport { getApiConfig } from '../apiConfig';\nimport { IEnvParam } from '../../common/types/internalTypes';\n\nexport interface IGetNetworkFeeSignatureParams extends IEnvParam {\n /**\n * Chain ID of the network to interact with\n */\n chainId: number;\n /**\n * Destination address\n */\n address: string;\n}\n\ninterface IGetNetworkFeeSignatureResponse {\n /**\n * Expiration date of signature\n */\n expiration_date: string;\n /**\n * The flag signature exists\n */\n has_signature: boolean;\n /**\n * The auto mint is delayed\n */\n is_delayed: boolean;\n}\n\nexport interface IGetNetworkFeeSignatureMappedResponse {\n /**\n * Expiration date of signature\n */\n expirationDate: string;\n /**\n * The flag signature exists\n */\n hasSignature: boolean;\n /**\n * The auto mint is delayed\n */\n isDelayed: boolean;\n}\n\n/**\n * Returns the expiration date and the flag signature exists\n *\n * @returns {Promise<IGetNetworkFeeSignatureResponse>} authorize network fee sign promise\n */\nexport async function getNetworkFeeSignature({\n address,\n chainId,\n env\n}: IGetNetworkFeeSignatureParams): Promise<IGetNetworkFeeSignatureMappedResponse> {\n const { claimerApiUrl } = getApiConfig(env);\n\n try {\n const { data } = await axios.get<IGetNetworkFeeSignatureResponse>(\n `${claimerApiUrl}/claimer/v1/mintwithfee/get-user-signature`,\n {\n params: {\n user_destination_address: address,\n chain_id: chainId,\n },\n },\n );\n\n return {\n expirationDate: data?.expiration_date,\n hasSignature: data?.has_signature,\n isDelayed: data?.is_delayed\n };\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n\n throw new Error(errorMessage);\n }\n}\n","import axios from 'axios';\nimport { getApiConfig } from '../apiConfig';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { getErrorMessage } from '../../common/utils/getErrorMessage';\n\nexport type IStoreNetworkFeeSignatureStatus = 'success';\n\ninterface IStoreNetworkFeeSignatureResponse {\n status: IStoreNetworkFeeSignatureStatus;\n}\n\nexport interface IStoreNetworkFeeSignatureParams extends IEnvParam {\n /**\n * signature\n */\n signature: string;\n /**\n * JSON typed data used for the signature\n */\n typedData: string;\n /**\n * Destination address\n */\n address: string;\n}\n\n/**\n * Authorize network fee\n *\n * @param {IStoreNetworkFeeSignatureParams} params - The parameters for network fee authorization\n *\n * @returns {Promise<IStoreNetworkFeeSignatureResponse>} Response promise with statuses\n *\n */\nexport async function storeNetworkFeeSignature({\n signature,\n typedData,\n address,\n env,\n}: IStoreNetworkFeeSignatureParams): Promise<IStoreNetworkFeeSignatureStatus> {\n const { claimerApiUrl } = getApiConfig(env);\n\n try {\n const { data } = await axios.post<IStoreNetworkFeeSignatureResponse>(\n `${claimerApiUrl}/claimer/v1/mintwithfee/save-user-signature`,\n null,\n {\n params: {\n typed_data: typedData,\n signature,\n user_destination_address: address,\n },\n },\n );\n\n return data.status;\n } catch (error) {\n const errorMsg = getErrorMessage(error);\n\n throw new Error(errorMsg);\n }\n}\n","import { OChainId } from '../common/types/types';\n\nexport type TRpcUrlConfig = Record<number, string>;\n\nexport const rpcUrlConfig: TRpcUrlConfig = {\n [OChainId.ethereum]: 'https://rpc.ankr.com/eth',\n [OChainId.holesky]: 'https://rpc.ankr.com/eth_holesky',\n [OChainId.sepolia]: 'https://rpc.ankr.com/eth_sepolia',\n [OChainId.base]: 'https://rpc.ankr.com/base',\n [OChainId.baseTestnet]: 'https://rpc.ankr.com/base_sepolia',\n [OChainId.binanceSmartChain]: 'https://rpc.ankr.com/bsc',\n};\n","import BigNumber from 'bignumber.js';\nimport Web3 from 'web3';\n\nexport async function getMaxPriorityFeePerGas(\n rpcUrl: string,\n): Promise<BigNumber> {\n const response = await fetch(rpcUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n jsonrpc: '2.0',\n id: 1,\n method: 'eth_maxPriorityFeePerGas',\n params: [],\n }),\n });\n\n const data = await response.json();\n\n const convertedHexValue = Web3.utils.hexToNumber(data?.result);\n\n return new BigNumber(Number(convertedHexValue));\n}\n","import BigNumber from 'bignumber.js';\nimport { Web3, Contract, ContractAbi } from 'web3';\nimport {\n TRpcUrlConfig,\n rpcUrlConfig as defaultRpcUrlConfig,\n} from './rpcUrlConfig';\nimport { IGetMaxFeesResult } from './types';\nimport { getMaxPriorityFeePerGas } from './utils/getMaxPriorityFeePerGas';\n\nconst FEE_MULTIPLIER = 2;\nconst ADDITIONAL_SAFE_GAS_PRICE_WEI = 25_000;\n\nexport interface IReadProviderParams {\n /**\n * Chain ID of the network to interact with.\n */\n chainId: number;\n /**\n * The RPC URL configuration. If not provided, the default configuration will be used.\n */\n rpcUrlConfig?: TRpcUrlConfig;\n}\n\nexport class ReadProvider {\n chainId: number;\n rpcConfig: TRpcUrlConfig;\n\n constructor({ chainId, rpcUrlConfig }: IReadProviderParams) {\n this.chainId = chainId;\n this.rpcConfig = { ...defaultRpcUrlConfig, ...rpcUrlConfig };\n }\n\n /**\n * Returns web3 instance for read operations.\n *\n * @public\n * @returns {Web3} Web3 instance.\n */\n public getReadWeb3(): Web3 {\n const rpcUrl = this.getRpcUrl();\n const readWeb3 = new Web3();\n const provider = new Web3.providers.HttpProvider(rpcUrl);\n readWeb3.setProvider(provider);\n return readWeb3;\n }\n\n /**\n * Retrieves the RPC URL based on the current chain ID.\n * @returns The RPC URL for the current chain ID.\n * @throws Error if the RPC URL for the current chain ID is not found.\n */\n getRpcUrl(): string {\n const { chainId } = this;\n const rpcUrl = this.rpcConfig?.[chainId];\n\n if (!rpcUrl) {\n console.error(\n `You might need to add the rpcConfig for the ${chainId} chain ID when creating the provider.`,\n );\n throw new Error(`RPC URL for chainId ${chainId} not found`);\n }\n\n return rpcUrl;\n }\n\n /**\n * Calculates max fees for transaction. Thess values are available for networks\n * with EIP-1559 support.\n *\n * @public\n * @note If current network is Binance Smart Chain, will return default values.\n * @returns {Promise<IGetMaxFeesResult>} Max fees for transaction.\n */\n public async getMaxFees(): Promise<IGetMaxFeesResult> {\n const web3 = this.getReadWeb3();\n const rpcUrl = this.getRpcUrl();\n\n const [block, maxPriorityFeePerGas] = await Promise.all([\n web3.eth.getBlock('latest'),\n getMaxPriorityFeePerGas(rpcUrl),\n ]);\n\n if (!block?.baseFeePerGas && typeof block?.baseFeePerGas !== 'bigint') {\n return {};\n }\n\n const maxFeePerGas = new BigNumber(block.baseFeePerGas.toString(10))\n .multipliedBy(FEE_MULTIPLIER)\n .plus(maxPriorityFeePerGas);\n\n return {\n maxFeePerGas: +maxFeePerGas,\n maxPriorityFeePerGas: +maxPriorityFeePerGas,\n };\n }\n\n /**\n * Returns safe gas price for transaction.\n *\n * @public\n * @returns {Promise<BigNumber>} Safe gas price.\n */\n public async getSafeGasPriceWei(): Promise<BigNumber> {\n const pureGasPriceWei = await this.getReadWeb3().eth.getGasPrice();\n\n return new BigNumber(pureGasPriceWei.toString(10)).plus(\n ADDITIONAL_SAFE_GAS_PRICE_WEI,\n );\n }\n\n /**\n * Creates a contract instance with the given ABI and address.\n *\n * @template AbiType - The type of the contract ABI.\n * @param {any} abi - The ABI of the contract.\n * @param {string} address - The address of the contract.\n * @returns {Contract<AbiType>} The contract instance.\n */\n public createContract<AbiType extends ContractAbi>(\n abi: any,\n address: string,\n ): Contract<AbiType> {\n const web3 = this.getReadWeb3();\n return new web3.eth.Contract<AbiType>(abi, address);\n }\n}\n","import Web3, { Contract, ContractAbi, Transaction, utils } from 'web3';\nimport { IEIP1193Provider } from '../common/types/types';\nimport { IReadProviderParams, ReadProvider } from './ReadProvider';\nimport {\n TRpcUrlConfig,\n rpcUrlConfig as defaultRpcUrlConfig,\n} from './rpcUrlConfig';\nimport { ISendOptions, IWeb3SendResult } from './types';\n\nexport interface IProviderParams extends IReadProviderParams {\n /**\n * The EIP-1193 provider instance.\n */\n provider: IEIP1193Provider;\n /**\n * The сurrent account address.\n */\n account: string;\n}\n\n/**\n * Provider for interacting with a blockchain network.\n */\nexport class Provider extends ReadProvider {\n web3: Web3;\n account: string;\n rpcConfig: TRpcUrlConfig = defaultRpcUrlConfig;\n\n constructor({ provider, account, chainId, rpcUrlConfig }: IProviderParams) {\n super({ chainId, rpcUrlConfig });\n this.web3 = new Web3(provider);\n this.account = account;\n this.chainId = chainId;\n this.rpcConfig = { ...defaultRpcUrlConfig, ...rpcUrlConfig };\n }\n\n /**\n * Signs a message using the current provider and account.\n * @public\n * @param message - The message to be signed.\n * @returns A promise that resolves to the signed message as a string.\n */\n public async signMessage(message: string): Promise<string> {\n const { account } = this;\n\n const messageHex = `0x${Buffer.from(message, 'utf8').toString('hex')}`;\n\n const ethereum = this.web3.currentProvider as any;\n\n return ethereum.request({\n method: 'personal_sign',\n params: [messageHex, account],\n });\n }\n\n /**\n * Custom replacement for web3js [send](https://docs.web3js.org/libdocs/Contract#send).\n *\n * @public\n * @param {string} from - Address of the sender.\n * @param {string} to - Address of the recipient.\n * @param {ISendOptions} sendOptions - Options for sending transaction.\n * @returns {Promise<IWeb3SendResult>} Promise with transaction hash and receipt promise.\n */\n public async sendTransactionAsync(\n from: string,\n to: string,\n sendOptions: ISendOptions,\n ): Promise<IWeb3SendResult> {\n const { chainId, web3: web3Write } = this;\n const web3Read = this.getReadWeb3();\n\n const {\n data,\n estimate = false,\n estimateFee = false,\n extendedGasLimit,\n gasLimit = '0',\n value = '0',\n gasLimitMultiplier = 1,\n } = sendOptions;\n let { nonce } = sendOptions;\n\n if (!nonce) {\n nonce = await web3Read.eth.getTransactionCount(from);\n }\n\n console.log(`Nonce: ${nonce}`);\n\n const tx: Transaction = {\n from,\n to,\n value: utils.numberToHex(value),\n data,\n nonce,\n chainId: utils.numberToHex(chainId),\n };\n\n if (estimate) {\n try {\n const estimatedGas = await web3Read.eth.estimateGas(tx);\n const multipliedGasLimit = Math.round(\n Number(estimatedGas) * gasLimitMultiplier,\n );\n\n if (extendedGasLimit) {\n tx.gas = utils.numberToHex(multipliedGasLimit + extendedGasLimit);\n } else {\n tx.gas = utils.numberToHex(multipliedGasLimit);\n }\n } catch (e) {\n throw new Error(\n (e as Partial<Error>).message ??\n 'Failed to estimate gas limit for transaction.',\n );\n }\n } else {\n tx.gas = utils.numberToHex(gasLimit);\n }\n\n const { maxFeePerGas, maxPriorityFeePerGas } = estimateFee\n ? await this.getMaxFees().catch(() => sendOptions)\n : sendOptions;\n\n if (maxPriorityFeePerGas !== undefined) {\n tx.maxPriorityFeePerGas = utils.numberToHex(maxPriorityFeePerGas);\n }\n\n if (maxFeePerGas !== undefined) {\n tx.maxFeePerGas = utils.numberToHex(maxFeePerGas);\n }\n\n if (!tx.maxFeePerGas && !tx.maxPriorityFeePerGas) {\n const safeGasPrice = await this.getSafeGasPriceWei();\n tx.gasPrice = safeGasPrice.toString(10);\n }\n\n if (!tx.maxFeePerGas && !tx.maxPriorityFeePerGas) {\n const safeGasPrice = await this.getSafeGasPriceWei();\n tx.gasPrice = safeGasPrice.toString(10);\n }\n\n console.log('Sending transaction via Web3: ', tx);\n\n return new Promise((resolve, reject) => {\n const promise = web3Write.eth.sendTransaction(tx);\n\n promise\n .once('transactionHash', async (transactionHash: string) => {\n console.log(`Just signed transaction has is: ${transactionHash}`);\n\n resolve({\n receiptPromise: promise,\n transactionHash,\n });\n })\n .catch(reject);\n });\n }\n\n public createContract<AbiType extends ContractAbi>(\n abi: any,\n address: string,\n ): Contract<AbiType> {\n return new this.web3.eth.Contract<AbiType>(abi, address);\n }\n}\n","import { OChainId } from '../../common/types/types';\n\n/**\n * Returns the gas multiplier for the given chain ID.\n *\n * @param chainId - Chain ID.\n *\n * @returns Gas multiplier.\n */\nexport function getGasMultiplier(chainId: number): number {\n switch (chainId) {\n case OChainId.ethereum:\n return 1.3;\n case OChainId.holesky:\n case OChainId.sepolia:\n return 1.5;\n default:\n return 1.3;\n }\n}\n","import { OChainId, TChainId } from '../types/types';\n\nexport function isValidChain(chainId: number): chainId is TChainId {\n return Object.values(OChainId).includes(chainId as TChainId);\n}\n","import {\n defaultEnv,\n ZERO_ADDRESS as PLACEHOLDER_ADDRESS,\n} from '../common/const';\nimport { OChainId, OEnv, TChainId, TEnv } from '../common/types/types';\n\ntype LbtcTokenConfig = Record<TChainId, string>;\n\nconst stageConfig: LbtcTokenConfig = {\n [OChainId.holesky]: '0xED7bfd5C1790576105Af4649817f6d35A75CD818',\n [OChainId.ethereum]: PLACEHOLDER_ADDRESS,\n\n [OChainId.binanceSmartChainTestnet]:\n '0x731eFa688F3679688cf60A3993b8658138953ED6',\n [OChainId.binanceSmartChain]: PLACEHOLDER_ADDRESS,\n [OChainId.sepolia]: '0xc47e4b3124597fdf8dd07843d4a7052f2ee80c30',\n\n [OChainId.base]: PLACEHOLDER_ADDRESS,\n // TODO: Add baseTestnet address\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.berachainBartioTestnet]:\n '0xc47e4b3124597FDF8DD07843D4a7052F2eE80C30',\n\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n};\n\nconst testnetConfig: LbtcTokenConfig = {\n [OChainId.holesky]: '0x38A13AB20D15ffbE5A7312d2336EF1552580a4E2',\n [OChainId.ethereum]: PLACEHOLDER_ADDRESS,\n\n [OChainId.binanceSmartChainTestnet]:\n '0x107Fc7d90484534704dD2A9e24c7BD45DB4dD1B5',\n [OChainId.binanceSmartChain]: PLACEHOLDER_ADDRESS,\n [OChainId.sepolia]: '0xc47e4b3124597fdf8dd07843d4a7052f2ee80c30',\n\n [OChainId.base]: PLACEHOLDER_ADDRESS,\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.berachainBartioTestnet]:\n '0xc47e4b3124597FDF8DD07843D4a7052F2eE80C30',\n\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n};\n\nconst prodConfig: LbtcTokenConfig = {\n [OChainId.ethereum]: '0x8236a87084f8b84306f72007f36f2618a5634494',\n [OChainId.holesky]: PLACEHOLDER_ADDRESS,\n [OChainId.sepolia]: PLACEHOLDER_ADDRESS,\n\n [OChainId.binanceSmartChainTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.binanceSmartChain]: '0xecAc9C5F704e954931349Da37F60E39f515c11c1',\n\n [OChainId.base]: '0xecAc9C5F704e954931349Da37F60E39f515c11c1',\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n \n [OChainId.berachainBartioTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.corn]: '0xecAc9C5F704e954931349Da37F60E39f515c11c1',\n};\n\nexport function getLbtcAddressConfig(env: TEnv = defaultEnv): LbtcTokenConfig {\n switch (env) {\n case OEnv.prod:\n return prodConfig;\n case OEnv.testnet:\n return testnetConfig;\n default:\n return stageConfig;\n }\n}\n","import { IERC20, LBTCABI } from '../abi';\n\ntype Token = 'LBTC' | 'ERC20';\n\nexport function getTokenABI(token: Token) {\n switch (token) {\n case 'LBTC':\n return LBTCABI;\n default:\n return IERC20;\n }\n}\n","import { ReadProvider } from '../../provider/ReadProvider';\nimport { TEnv } from '../../common/types/types';\nimport { isValidChain } from '../../common/utils/isValidChain';\nimport { Provider } from '../../provider';\nimport { getLbtcAddressConfig } from '../lbtcAddressConfig';\nimport { getTokenABI } from './getTokenABI';\n\nexport function getLbtcTokenContract(provider: Provider | ReadProvider, env?: TEnv) {\n const lbtcAddressConfig = getLbtcAddressConfig(env);\n const { chainId } = provider;\n\n if (!isValidChain(chainId)) {\n throw new Error(`This chain ${chainId} is not supported`);\n }\n\n const tokenAddress = lbtcAddressConfig[chainId];\n\n if (!tokenAddress) {\n throw new Error(`Token address for chain ${chainId} is not defined`);\n }\n\n const abi = getTokenABI('LBTC');\n\n const contract = provider.createContract(abi, tokenAddress);\n\n if (!contract.options.address) {\n contract.options.address = tokenAddress;\n }\n\n return contract as typeof contract & {\n options: typeof contract.options & { address: string };\n };\n}\n","import { IEnvParam } from '../../common/types/internalTypes';\nimport { toSatoshi } from '../../common/utils/convertSatoshi';\nimport { IWeb3SendResult, Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\nimport { getGasMultiplier } from '../utils/getGasMultiplier';\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\n\nexport interface IApproveLBTCParams extends IProviderBasedParams, IEnvParam {\n /**\n * Spender address\n */\n spender: string;\n /**\n * The amount of LBTC to approve\n */\n amount: number;\n}\n\n/**\n * Approves the transfer of a specified amount of LBTC tokens.\n *\n * @param {IApproveLBTCParams} params\n *\n * @returns {Promise<IWeb3SendResult>} transaction promise\n */\nexport function approveLBTC({\n spender,\n amount,\n env,\n ...providerParams\n}: IApproveLBTCParams): Promise<IWeb3SendResult> {\n const provider = new Provider(providerParams);\n const tokenContract = getLbtcTokenContract(provider, env);\n const amountSat = toSatoshi(amount);\n\n const tx = tokenContract.methods.approve(spender, amountSat);\n\n return provider.sendTransactionAsync(\n provider.account,\n tokenContract.options.address,\n {\n data: tx.encodeABI(),\n estimate: true,\n estimateFee: true,\n gasLimitMultiplier: getGasMultiplier(provider.chainId),\n },\n );\n}\n","import { IEnvParam } from '../../common/types/internalTypes';\nimport { getErrorMessage } from '../../common/utils/getErrorMessage';\nimport { IWeb3SendResult, Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\nimport { getGasMultiplier } from '../utils/getGasMultiplier';\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\n\nconst INSUFFICIENT_FUNDS_PARTIAL_ERROR = 'insufficient funds';\n\nconst INSUFFICIENT_FUNDS_ERROR =\n 'Insufficient funds for transfer. Make sure you have enough ETH to cover the gas cost.';\n\nexport interface IClaimLBTCParams extends IProviderBasedParams, IEnvParam {\n /**\n * Raw payload from deposit notarization.\n */\n data: string;\n /**\n * Signature from deposit notarization.\n */\n proofSignature: string;\n}\n\nconst hexify = (hexString: string) =>\n hexString.startsWith('0x') ? hexString : '0x' + hexString;\n/**\n * Claims LBTC.\n *\n * @param {IClaimLBTCParams} params - The parameters for claiming LBTC.\n *\n * @returns {Promise<IWeb3SendResult>} transaction promise\n */\nexport async function claimLBTC({\n data,\n proofSignature,\n env,\n ...providerParams\n}: IClaimLBTCParams): Promise<IWeb3SendResult> {\n const provider = new Provider(providerParams);\n\n const tokenContract = getLbtcTokenContract(provider, env);\n\n const tx = tokenContract.methods.mint(hexify(data), hexify(proofSignature));\n\n try {\n const result = await provider.sendTransactionAsync(\n provider.account,\n tokenContract.options.address,\n {\n data: tx.encodeABI(),\n estimate: true,\n estimateFee: true,\n gasLimitMultiplier: getGasMultiplier(provider.chainId),\n },\n );\n\n return result;\n } catch (error) {\n console.log('error', error);\n const errorMessage = getErrorMessage(error);\n\n if (errorMessage.includes(INSUFFICIENT_FUNDS_PARTIAL_ERROR)) {\n throw new Error(INSUFFICIENT_FUNDS_ERROR);\n }\n\n throw new Error(errorMessage);\n }\n}\n","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\n// Response error\nexport const ERR_RESPONSE = 100;\nexport const ERR_INVALID_RESPONSE = 101;\n// Generic errors\nexport const ERR_PARAM = 200;\nexport const ERR_FORMATTERS = 201;\nexport const ERR_METHOD_NOT_IMPLEMENTED = 202;\nexport const ERR_OPERATION_TIMEOUT = 203;\nexport const ERR_OPERATION_ABORT = 204;\nexport const ERR_ABI_ENCODING = 205;\nexport const ERR_EXISTING_PLUGIN_NAMESPACE = 206;\nexport const ERR_INVALID_METHOD_PARAMS = 207;\nexport const ERR_MULTIPLE_ERRORS = 208;\n// Contract error codes\nexport const ERR_CONTRACT = 300;\nexport const ERR_CONTRACT_RESOLVER_MISSING = 301;\nexport const ERR_CONTRACT_ABI_MISSING = 302;\nexport const ERR_CONTRACT_REQUIRED_CALLBACK = 303;\nexport const ERR_CONTRACT_EVENT_NOT_EXISTS = 304;\nexport const ERR_CONTRACT_RESERVED_EVENT = 305;\nexport const ERR_CONTRACT_MISSING_DEPLOY_DATA = 306;\nexport const ERR_CONTRACT_MISSING_ADDRESS = 307;\nexport const ERR_CONTRACT_MISSING_FROM_ADDRESS = 308;\nexport const ERR_CONTRACT_INSTANTIATION = 309;\nexport const ERR_CONTRACT_EXECUTION_REVERTED = 310;\nexport const ERR_CONTRACT_TX_DATA_AND_INPUT = 311;\n// Transaction error codes\nexport const ERR_TX = 400;\nexport const ERR_TX_REVERT_INSTRUCTION = 401;\nexport const ERR_TX_REVERT_TRANSACTION = 402;\nexport const ERR_TX_NO_CONTRACT_ADDRESS = 403;\nexport const ERR_TX_CONTRACT_NOT_STORED = 404;\nexport const ERR_TX_REVERT_WITHOUT_REASON = 405;\nexport const ERR_TX_OUT_OF_GAS = 406;\nexport const ERR_RAW_TX_UNDEFINED = 407;\nexport const ERR_TX_INVALID_SENDER = 408;\nexport const ERR_TX_INVALID_CALL = 409;\nexport const ERR_TX_MISSING_CUSTOM_CHAIN = 410;\nexport const ERR_TX_MISSING_CUSTOM_CHAIN_ID = 411;\nexport const ERR_TX_CHAIN_ID_MISMATCH = 412;\nexport const ERR_TX_INVALID_CHAIN_INFO = 413;\nexport const ERR_TX_MISSING_CHAIN_INFO = 414;\nexport const ERR_TX_MISSING_GAS = 415;\nexport const ERR_TX_INVALID_LEGACY_GAS = 416;\nexport const ERR_TX_INVALID_FEE_MARKET_GAS = 417;\nexport const ERR_TX_INVALID_FEE_MARKET_GAS_PRICE = 418;\nexport const ERR_TX_INVALID_LEGACY_FEE_MARKET = 419;\nexport const ERR_TX_INVALID_OBJECT = 420;\nexport const ERR_TX_INVALID_NONCE_OR_CHAIN_ID = 421;\nexport const ERR_TX_UNABLE_TO_POPULATE_NONCE = 422;\nexport const ERR_TX_UNSUPPORTED_EIP_1559 = 423;\nexport const ERR_TX_UNSUPPORTED_TYPE = 424;\nexport const ERR_TX_DATA_AND_INPUT = 425;\nexport const ERR_TX_POLLING_TIMEOUT = 426;\nexport const ERR_TX_RECEIPT_MISSING_OR_BLOCKHASH_NULL = 427;\nexport const ERR_TX_RECEIPT_MISSING_BLOCK_NUMBER = 428;\nexport const ERR_TX_LOCAL_WALLET_NOT_AVAILABLE = 429;\nexport const ERR_TX_NOT_FOUND = 430;\nexport const ERR_TX_SEND_TIMEOUT = 431;\nexport const ERR_TX_BLOCK_TIMEOUT = 432;\nexport const ERR_TX_SIGNING = 433;\nexport const ERR_TX_GAS_MISMATCH = 434;\nexport const ERR_TX_CHAIN_MISMATCH = 435;\nexport const ERR_TX_HARDFORK_MISMATCH = 436;\nexport const ERR_TX_INVALID_RECEIVER = 437;\nexport const ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR = 438;\nexport const ERR_TX_INVALID_PROPERTIES_FOR_TYPE = 439;\nexport const ERR_TX_MISSING_GAS_INNER_ERROR = 440;\nexport const ERR_TX_GAS_MISMATCH_INNER_ERROR = 441;\n// Connection error codes\nexport const ERR_CONN = 500;\nexport const ERR_CONN_INVALID = 501;\nexport const ERR_CONN_TIMEOUT = 502;\nexport const ERR_CONN_NOT_OPEN = 503;\nexport const ERR_CONN_CLOSE = 504;\nexport const ERR_CONN_MAX_ATTEMPTS = 505;\nexport const ERR_CONN_PENDING_REQUESTS = 506;\nexport const ERR_REQ_ALREADY_SENT = 507;\n// Provider error codes\nexport const ERR_PROVIDER = 600;\nexport const ERR_INVALID_PROVIDER = 601;\nexport const ERR_INVALID_CLIENT = 602;\nexport const ERR_SUBSCRIPTION = 603;\nexport const ERR_WS_PROVIDER = 604;\n// Account error codes\nexport const ERR_PRIVATE_KEY_LENGTH = 701;\nexport const ERR_INVALID_PRIVATE_KEY = 702;\nexport const ERR_UNSUPPORTED_KDF = 703;\nexport const ERR_KEY_DERIVATION_FAIL = 704;\nexport const ERR_KEY_VERSION_UNSUPPORTED = 705;\nexport const ERR_INVALID_PASSWORD = 706;\nexport const ERR_IV_LENGTH = 707;\nexport const ERR_INVALID_KEYSTORE = 708;\nexport const ERR_PBKDF2_ITERATIONS = 709;\n// Signature error codes\nexport const ERR_SIGNATURE_FAILED = 801;\nexport const ERR_INVALID_SIGNATURE = 802;\nexport const GENESIS_BLOCK_NUMBER = '0x0';\n// RPC error codes (EIP-1193)\n// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md#provider-errors\nexport const JSONRPC_ERR_REJECTED_REQUEST = 4001;\nexport const JSONRPC_ERR_UNAUTHORIZED = 4100;\nexport const JSONRPC_ERR_UNSUPPORTED_METHOD = 4200;\nexport const JSONRPC_ERR_DISCONNECTED = 4900;\nexport const JSONRPC_ERR_CHAIN_DISCONNECTED = 4901;\n// ENS error codes\nexport const ERR_ENS_CHECK_INTERFACE_SUPPORT = 901;\nexport const ERR_ENS_UNSUPPORTED_NETWORK = 902;\nexport const ERR_ENS_NETWORK_NOT_SYNCED = 903;\n// Utils error codes\nexport const ERR_INVALID_STRING = 1001;\nexport const ERR_INVALID_BYTES = 1002;\nexport const ERR_INVALID_NUMBER = 1003;\nexport const ERR_INVALID_UNIT = 1004;\nexport const ERR_INVALID_ADDRESS = 1005;\nexport const ERR_INVALID_HEX = 1006;\nexport const ERR_INVALID_TYPE = 1007;\nexport const ERR_INVALID_BOOLEAN = 1008;\nexport const ERR_INVALID_UNSIGNED_INTEGER = 1009;\nexport const ERR_INVALID_SIZE = 1010;\nexport const ERR_INVALID_LARGE_VALUE = 1011;\nexport const ERR_INVALID_BLOCK = 1012;\nexport const ERR_INVALID_TYPE_ABI = 1013;\nexport const ERR_INVALID_NIBBLE_WIDTH = 1014;\nexport const ERR_INVALID_INTEGER = 1015;\n// Validation error codes\nexport const ERR_VALIDATION = 1100;\n// Core error codes\nexport const ERR_CORE_HARDFORK_MISMATCH = 1101;\nexport const ERR_CORE_CHAIN_MISMATCH = 1102;\n// Schema error codes\nexport const ERR_SCHEMA_FORMAT = 1200;\n// RPC error codes (EIP-1474)\n// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md\nexport const ERR_RPC_INVALID_JSON = -32700;\nexport const ERR_RPC_INVALID_REQUEST = -32600;\nexport const ERR_RPC_INVALID_METHOD = -32601;\nexport const ERR_RPC_INVALID_PARAMS = -32602;\nexport const ERR_RPC_INTERNAL_ERROR = -32603;\nexport const ERR_RPC_INVALID_INPUT = -32000;\nexport const ERR_RPC_MISSING_RESOURCE = -32001;\nexport const ERR_RPC_UNAVAILABLE_RESOURCE = -32002;\nexport const ERR_RPC_TRANSACTION_REJECTED = -32003;\nexport const ERR_RPC_UNSUPPORTED_METHOD = -32004;\nexport const ERR_RPC_LIMIT_EXCEEDED = -32005;\nexport const ERR_RPC_NOT_SUPPORTED = -32006;\n//# sourceMappingURL=error_codes.js.map","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\nimport { ERR_MULTIPLE_ERRORS } from './error_codes.js';\n/**\n * Base class for Web3 errors.\n */\nexport class BaseWeb3Error extends Error {\n constructor(msg, cause) {\n super(msg);\n if (Array.isArray(cause)) {\n // eslint-disable-next-line no-use-before-define\n this.cause = new MultipleErrors(cause);\n }\n else {\n this.cause = cause;\n }\n this.name = this.constructor.name;\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(new.target.constructor);\n }\n else {\n this.stack = new Error().stack;\n }\n }\n /**\n * @deprecated Use the `cause` property instead.\n */\n get innerError() {\n // eslint-disable-next-line no-use-before-define\n if (this.cause instanceof MultipleErrors) {\n return this.cause.errors;\n }\n return this.cause;\n }\n /**\n * @deprecated Use the `cause` property instead.\n */\n set innerError(cause) {\n if (Array.isArray(cause)) {\n // eslint-disable-next-line no-use-before-define\n this.cause = new MultipleErrors(cause);\n }\n else {\n this.cause = cause;\n }\n }\n static convertToString(value, unquotValue = false) {\n // Using \"null\" value intentionally for validation\n // eslint-disable-next-line no-null/no-null\n if (value === null || value === undefined)\n return 'undefined';\n const result = JSON.stringify(value, (_, v) => (typeof v === 'bigint' ? v.toString() : v));\n return unquotValue && ['bigint', 'string'].includes(typeof value)\n ? result.replace(/['\\\\\"]+/g, '')\n : result;\n }\n toJSON() {\n return {\n name: this.name,\n code: this.code,\n message: this.message,\n cause: this.cause,\n // deprecated\n innerError: this.cause,\n };\n }\n}\nexport class MultipleErrors extends BaseWeb3Error {\n constructor(errors) {\n super(`Multiple errors occurred: [${errors.map(e => e.message).join('], [')}]`);\n this.code = ERR_MULTIPLE_ERRORS;\n this.errors = errors;\n }\n}\nexport class InvalidValueError extends BaseWeb3Error {\n constructor(value, msg) {\n super(`Invalid value given \"${BaseWeb3Error.convertToString(value, true)}\". Error: ${msg}.`);\n this.name = this.constructor.name;\n }\n}\n//# sourceMappingURL=web3_error_base.js.map","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\nimport { ERR_RPC_INTERNAL_ERROR, ERR_RPC_INVALID_INPUT, ERR_RPC_INVALID_JSON, ERR_RPC_INVALID_METHOD, ERR_RPC_INVALID_PARAMS, ERR_RPC_INVALID_REQUEST, ERR_RPC_LIMIT_EXCEEDED, ERR_RPC_MISSING_RESOURCE, ERR_RPC_NOT_SUPPORTED, ERR_RPC_TRANSACTION_REJECTED, ERR_RPC_UNAVAILABLE_RESOURCE, ERR_RPC_UNSUPPORTED_METHOD, JSONRPC_ERR_CHAIN_DISCONNECTED, JSONRPC_ERR_DISCONNECTED, JSONRPC_ERR_REJECTED_REQUEST, JSONRPC_ERR_UNAUTHORIZED, JSONRPC_ERR_UNSUPPORTED_METHOD, } from '../error_codes.js';\n/**\n * A template string for a generic Rpc Error. The `*code*` will be replaced with the code number.\n * Note: consider in next version that a spelling mistake could be corrected for `occured` and the value could be:\n * \t`An Rpc error has occurred with a code of *code*`\n */\nexport const genericRpcErrorMessageTemplate = 'An Rpc error has occured with a code of *code*';\n/* eslint-disable @typescript-eslint/naming-convention */\nexport const RpcErrorMessages = {\n // EIP-1474 & JSON RPC 2.0\n // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md\n [ERR_RPC_INVALID_JSON]: {\n message: 'Parse error',\n description: 'Invalid JSON',\n },\n [ERR_RPC_INVALID_REQUEST]: {\n message: 'Invalid request',\n description: 'JSON is not a valid request object\t',\n },\n [ERR_RPC_INVALID_METHOD]: {\n message: 'Method not found',\n description: 'Method does not exist\t',\n },\n [ERR_RPC_INVALID_PARAMS]: {\n message: 'Invalid params',\n description: 'Invalid method parameters',\n },\n [ERR_RPC_INTERNAL_ERROR]: {\n message: 'Internal error',\n description: 'Internal JSON-RPC error',\n },\n [ERR_RPC_INVALID_INPUT]: {\n message: 'Invalid input',\n description: 'Missing or invalid parameters',\n },\n [ERR_RPC_MISSING_RESOURCE]: {\n message: 'Resource not found',\n description: 'Requested resource not found',\n },\n [ERR_RPC_UNAVAILABLE_RESOURCE]: {\n message: 'Resource unavailable',\n description: 'Requested resource not available',\n },\n [ERR_RPC_TRANSACTION_REJECTED]: {\n message: 'Transaction rejected',\n description: 'Transaction creation failed',\n },\n [ERR_RPC_UNSUPPORTED_METHOD]: {\n message: 'Method not supported',\n description: 'Method is not implemented',\n },\n [ERR_RPC_LIMIT_EXCEEDED]: {\n message: 'Limit exceeded',\n description: 'Request exceeds defined limit',\n },\n [ERR_RPC_NOT_SUPPORTED]: {\n message: 'JSON-RPC version not supported',\n description: 'Version of JSON-RPC protocol is not supported',\n },\n // EIP-1193\n // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md#provider-errors\n [JSONRPC_ERR_REJECTED_REQUEST]: {\n name: 'User Rejected Request',\n message: 'The user rejected the request.',\n },\n [JSONRPC_ERR_UNAUTHORIZED]: {\n name: 'Unauthorized',\n message: 'The requested method and/or account has not been authorized by the user.',\n },\n [JSONRPC_ERR_UNSUPPORTED_METHOD]: {\n name: 'Unsupported Method',\n message: 'The Provider does not support the requested method.',\n },\n [JSONRPC_ERR_DISCONNECTED]: {\n name: 'Disconnected',\n message: 'The Provider is disconnected from all chains.',\n },\n [JSONRPC_ERR_CHAIN_DISCONNECTED]: {\n name: 'Chain Disconnected',\n message: 'The Provider is not connected to the requested chain.',\n },\n // EIP-1193 - CloseEvent\n // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code\n '0-999': {\n name: '',\n message: 'Not used.',\n },\n 1000: {\n name: 'Normal Closure',\n message: 'The connection successfully completed the purpose for which it was created.',\n },\n 1001: {\n name: 'Going Away',\n message: 'The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.',\n },\n 1002: {\n name: 'Protocol error',\n message: 'The endpoint is terminating the connection due to a protocol error.',\n },\n 1003: {\n name: 'Unsupported Data',\n message: 'The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)',\n },\n 1004: {\n name: 'Reserved',\n message: 'Reserved. A meaning might be defined in the future.',\n },\n 1005: {\n name: 'No Status Rcvd',\n message: 'Reserved. Indicates that no status code was provided even though one was expected.',\n },\n 1006: {\n name: 'Abnormal Closure',\n message: 'Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected.',\n },\n 1007: {\n name: 'Invalid frame payload data',\n message: 'The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message).',\n },\n 1008: {\n name: 'Policy Violation',\n message: 'The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable.',\n },\n 1009: {\n name: 'Message Too Big',\n message: 'The endpoint is terminating the connection because a data frame was received that is too large.',\n },\n 1010: {\n name: 'Mandatory Ext.',\n message: \"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't.\",\n },\n 1011: {\n name: 'Internal Error',\n message: 'The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.',\n },\n 1012: {\n name: 'Service Restart',\n message: 'The server is terminating the connection because it is restarting.',\n },\n 1013: {\n name: 'Try Again Later',\n message: 'The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients.',\n },\n 1014: {\n name: 'Bad Gateway',\n message: 'The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code.',\n },\n 1015: {\n name: 'TLS handshake',\n message: \"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).\",\n },\n '1016-2999': {\n name: '',\n message: 'For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications.',\n },\n '3000-3999': {\n name: '',\n message: 'For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol.',\n },\n '4000-4999': {\n name: '',\n message: \"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol.\",\n },\n};\n//# sourceMappingURL=rpc_error_messages.js.map","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\nimport { BaseWeb3Error } from '../web3_error_base.js';\nimport { ERR_RPC_INTERNAL_ERROR, ERR_RPC_INVALID_INPUT, ERR_RPC_INVALID_JSON, ERR_RPC_INVALID_METHOD, ERR_RPC_INVALID_PARAMS, ERR_RPC_INVALID_REQUEST, ERR_RPC_LIMIT_EXCEEDED, ERR_RPC_MISSING_RESOURCE, ERR_RPC_NOT_SUPPORTED, ERR_RPC_TRANSACTION_REJECTED, ERR_RPC_UNAVAILABLE_RESOURCE, ERR_RPC_UNSUPPORTED_METHOD, } from '../error_codes.js';\nimport { RpcErrorMessages, genericRpcErrorMessageTemplate } from './rpc_error_messages.js';\nexport class RpcError extends BaseWeb3Error {\n constructor(rpcError, message) {\n super(message !== null && message !== void 0 ? message : genericRpcErrorMessageTemplate.replace('*code*', rpcError.error.code.toString()));\n this.code = rpcError.error.code;\n this.id = rpcError.id;\n this.jsonrpc = rpcError.jsonrpc;\n this.jsonRpcError = rpcError.error;\n }\n toJSON() {\n return Object.assign(Object.assign({}, super.toJSON()), { error: this.jsonRpcError, id: this.id, jsonRpc: this.jsonrpc });\n }\n}\nexport class EIP1193ProviderRpcError extends BaseWeb3Error {\n constructor(code, data) {\n var _a, _b, _c, _d;\n if (!code) {\n // this case should ideally not happen\n super();\n }\n else if ((_a = RpcErrorMessages[code]) === null || _a === void 0 ? void 0 : _a.message) {\n super(RpcErrorMessages[code].message);\n }\n else {\n // Retrieve the status code object for the given code from the table, by searching through the appropriate range\n const statusCodeRange = Object.keys(RpcErrorMessages).find(statusCode => typeof statusCode === 'string' &&\n code >= parseInt(statusCode.split('-')[0], 10) &&\n code <= parseInt(statusCode.split('-')[1], 10));\n super((_c = (_b = RpcErrorMessages[statusCodeRange !== null && statusCodeRange !== void 0 ? statusCodeRange : '']) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : genericRpcErrorMessageTemplate.replace('*code*', (_d = code === null || code === void 0 ? void 0 : code.toString()) !== null && _d !== void 0 ? _d : '\"\"'));\n }\n this.code = code;\n this.data = data;\n }\n}\nexport class ParseError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_JSON].message);\n this.code = ERR_RPC_INVALID_JSON;\n }\n}\nexport class InvalidRequestError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_REQUEST].message);\n this.code = ERR_RPC_INVALID_REQUEST;\n }\n}\nexport class MethodNotFoundError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_METHOD].message);\n this.code = ERR_RPC_INVALID_METHOD;\n }\n}\nexport class InvalidParamsError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_PARAMS].message);\n this.code = ERR_RPC_INVALID_PARAMS;\n }\n}\nexport class InternalError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INTERNAL_ERROR].message);\n this.code = ERR_RPC_INTERNAL_ERROR;\n }\n}\nexport class InvalidInputError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_INVALID_INPUT].message);\n this.code = ERR_RPC_INVALID_INPUT;\n }\n}\nexport class MethodNotSupported extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_UNSUPPORTED_METHOD].message);\n this.code = ERR_RPC_UNSUPPORTED_METHOD;\n }\n}\nexport class ResourceUnavailableError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_UNAVAILABLE_RESOURCE].message);\n this.code = ERR_RPC_UNAVAILABLE_RESOURCE;\n }\n}\nexport class ResourcesNotFoundError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_MISSING_RESOURCE].message);\n this.code = ERR_RPC_MISSING_RESOURCE;\n }\n}\nexport class VersionNotSupportedError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_NOT_SUPPORTED].message);\n this.code = ERR_RPC_NOT_SUPPORTED;\n }\n}\nexport class TransactionRejectedError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_TRANSACTION_REJECTED].message);\n this.code = ERR_RPC_TRANSACTION_REJECTED;\n }\n}\nexport class LimitExceededError extends RpcError {\n constructor(rpcError) {\n super(rpcError, RpcErrorMessages[ERR_RPC_LIMIT_EXCEEDED].message);\n this.code = ERR_RPC_LIMIT_EXCEEDED;\n }\n}\nexport const rpcErrorsMap = new Map();\nrpcErrorsMap.set(ERR_RPC_INVALID_JSON, { error: ParseError });\nrpcErrorsMap.set(ERR_RPC_INVALID_REQUEST, {\n error: InvalidRequestError,\n});\nrpcErrorsMap.set(ERR_RPC_INVALID_METHOD, {\n error: MethodNotFoundError,\n});\nrpcErrorsMap.set(ERR_RPC_INVALID_PARAMS, { error: InvalidParamsError });\nrpcErrorsMap.set(ERR_RPC_INTERNAL_ERROR, { error: InternalError });\nrpcErrorsMap.set(ERR_RPC_INVALID_INPUT, { error: InvalidInputError });\nrpcErrorsMap.set(ERR_RPC_UNSUPPORTED_METHOD, {\n error: MethodNotSupported,\n});\nrpcErrorsMap.set(ERR_RPC_UNAVAILABLE_RESOURCE, {\n error: ResourceUnavailableError,\n});\nrpcErrorsMap.set(ERR_RPC_TRANSACTION_REJECTED, {\n error: TransactionRejectedError,\n});\nrpcErrorsMap.set(ERR_RPC_MISSING_RESOURCE, {\n error: ResourcesNotFoundError,\n});\nrpcErrorsMap.set(ERR_RPC_NOT_SUPPORTED, {\n error: VersionNotSupportedError,\n});\nrpcErrorsMap.set(ERR_RPC_LIMIT_EXCEEDED, { error: LimitExceededError });\n//# sourceMappingURL=rpc_errors.js.map","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * checks input if typeof data is valid string input\n */\nexport const isString = (value) => typeof value === 'string';\nexport const isHexStrict = (hex) => typeof hex === 'string' && /^((-)?0x[0-9a-f]+|(0x))$/i.test(hex);\n/**\n * Is the string a hex string.\n *\n * @param value\n * @param length\n * @returns output the string is a hex string\n */\nexport function isHexString(value, length) {\n if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/))\n return false;\n if (typeof length !== 'undefined' && length > 0 && value.length !== 2 + 2 * length)\n return false;\n return true;\n}\nexport const isHex = (hex) => typeof hex === 'number' ||\n typeof hex === 'bigint' ||\n (typeof hex === 'string' && /^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(hex));\nexport const isHexString8Bytes = (value, prefixed = true) => prefixed ? isHexStrict(value) && value.length === 18 : isHex(value) && value.length === 16;\nexport const isHexString32Bytes = (value, prefixed = true) => prefixed ? isHexStrict(value) && value.length === 66 : isHex(value) && value.length === 64;\n/**\n * Returns a `Boolean` on whether or not the a `String` starts with '0x'\n * @param str the string input value\n * @return a boolean if it is or is not hex prefixed\n * @throws if the str input is not a string\n */\nexport function isHexPrefixed(str) {\n if (typeof str !== 'string') {\n throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof str}`);\n }\n return str.startsWith('0x');\n}\n/**\n * Checks provided Uint8Array for leading zeroes and throws if found.\n *\n * Examples:\n *\n * Valid values: 0x1, 0x, 0x01, 0x1234\n * Invalid values: 0x0, 0x00, 0x001, 0x0001\n *\n * Note: This method is useful for validating that RLP encoded integers comply with the rule that all\n * integer values encoded to RLP must be in the most compact form and contain no leading zero bytes\n * @param values An object containing string keys and Uint8Array values\n * @throws if any provided value is found to have leading zero bytes\n */\nexport const validateNoLeadingZeroes = function (values) {\n for (const [k, v] of Object.entries(values)) {\n if (v !== undefined && v.length > 0 && v[0] === 0) {\n throw new Error(`${k} cannot have leading zeroes, received: ${v.toString()}`);\n }\n }\n};\n//# sourceMappingURL=string.js.map","/*\nThis file is part of web3.js.\n\nweb3.js is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nweb3.js is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with web3.js. If not, see <http://www.gnu.org/licenses/>.\n*/\nexport var FMT_NUMBER;\n(function (FMT_NUMBER) {\n FMT_NUMBER[\"NUMBER\"] = \"NUMBER_NUMBER\";\n FMT_NUMBER[\"HEX\"] = \"NUMBER_HEX\";\n FMT_NUMBER[\"STR\"] = \"NUMBER_STR\";\n FMT_NUMBER[\"BIGINT\"] = \"NUMBER_BIGINT\";\n})(FMT_NUMBER || (FMT_NUMBER = {}));\nexport var FMT_BYTES;\n(function (FMT_BYTES) {\n FMT_BYTES[\"HEX\"] = \"BYTES_HEX\";\n FMT_BYTES[\"UINT8ARRAY\"] = \"BYTES_UINT8ARRAY\";\n})(FMT_BYTES || (FMT_BYTES = {}));\nexport const DEFAULT_RETURN_FORMAT = {\n number: FMT_NUMBER.BIGINT,\n bytes: FMT_BYTES.HEX,\n};\nexport const ETH_DATA_FORMAT = { number: FMT_NUMBER.HEX, bytes: FMT_BYTES.HEX };\n//# sourceMappingURL=data_format_types.js.map","export var BlockTags;\n(function (BlockTags) {\n BlockTags[\"EARLIEST\"] = \"earliest\";\n BlockTags[\"LATEST\"] = \"latest\";\n BlockTags[\"PENDING\"] = \"pending\";\n BlockTags[\"SAFE\"] = \"safe\";\n BlockTags[\"FINALIZED\"] = \"finalized\";\n})(BlockTags || (BlockTags = {}));\n// This list of hardforks is expected to be in order\n// keep this in mind when making changes to it\nexport var HardforksOrdered;\n(function (HardforksOrdered) {\n HardforksOrdered[\"chainstart\"] = \"chainstart\";\n HardforksOrdered[\"frontier\"] = \"frontier\";\n HardforksOrdered[\"homestead\"] = \"homestead\";\n HardforksOrdered[\"dao\"] = \"dao\";\n HardforksOrdered[\"tangerineWhistle\"] = \"tangerineWhistle\";\n HardforksOrdered[\"spuriousDragon\"] = \"spuriousDragon\";\n HardforksOrdered[\"byzantium\"] = \"byzantium\";\n HardforksOrdered[\"constantinople\"] = \"constantinople\";\n HardforksOrdered[\"petersburg\"] = \"petersburg\";\n HardforksOrdered[\"istanbul\"] = \"istanbul\";\n HardforksOrdered[\"muirGlacier\"] = \"muirGlacier\";\n HardforksOrdered[\"berlin\"] = \"berlin\";\n HardforksOrdered[\"london\"] = \"london\";\n HardforksOrdered[\"altair\"] = \"altair\";\n HardforksOrdered[\"arrowGlacier\"] = \"arrowGlacier\";\n HardforksOrdered[\"grayGlacier\"] = \"grayGlacier\";\n HardforksOrdered[\"bellatrix\"] = \"bellatrix\";\n HardforksOrdered[\"merge\"] = \"merge\";\n HardforksOrdered[\"capella\"] = \"capella\";\n HardforksOrdered[\"shanghai\"] = \"shanghai\";\n})(HardforksOrdered || (HardforksOrdered = {}));\n//# sourceMappingURL=eth_types.js.map","import {\n defaultEnv,\n ZERO_ADDRESS as PLACEHOLDER_ADDRESS,\n} from '../common/const';\nimport { OChainId, OEnv, TChainId, TEnv } from '../common/types/types';\n\ntype BasculeTokenConfig = Record<TChainId, string>;\n\nconst stageConfig: BasculeTokenConfig = {\n [OChainId.holesky]: '0x3a0c40c84b5034ed9a98a9a47a02af2b0885246f',\n [OChainId.sepolia]: PLACEHOLDER_ADDRESS,\n [OChainId.ethereum]: PLACEHOLDER_ADDRESS,\n\n [OChainId.binanceSmartChainTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.binanceSmartChain]: PLACEHOLDER_ADDRESS,\n\n [OChainId.base]: PLACEHOLDER_ADDRESS,\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.berachainBartioTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n};\n\nconst testnetConfig: BasculeTokenConfig = {\n [OChainId.holesky]: '0x3a0c40c84b5034ed9a98a9a47a02af2b0885246f',\n [OChainId.sepolia]: PLACEHOLDER_ADDRESS,\n [OChainId.ethereum]: PLACEHOLDER_ADDRESS,\n\n [OChainId.binanceSmartChainTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.binanceSmartChain]: PLACEHOLDER_ADDRESS,\n\n [OChainId.base]: PLACEHOLDER_ADDRESS,\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.berachainBartioTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n};\n\nconst prodConfig: BasculeTokenConfig = {\n [OChainId.holesky]: PLACEHOLDER_ADDRESS,\n [OChainId.sepolia]: PLACEHOLDER_ADDRESS,\n [OChainId.ethereum]: '0xc750eCAC7250E0D18ecE2C7a5F130E3A765dc260',\n\n [OChainId.binanceSmartChainTestnet]: PLACEHOLDER_ADDRESS,\n [OChainId.binanceSmartChain]: PLACEHOLDER_ADDRESS,\n\n [OChainId.base]: PLACEHOLDER_ADDRESS,\n [OChainId.baseTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.berachainBartioTestnet]: PLACEHOLDER_ADDRESS,\n\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n};\n\nexport function getBasculeAddressConfig(\n env: TEnv = defaultEnv,\n): BasculeTokenConfig {\n switch (env) {\n case OEnv.prod:\n return prodConfig;\n case OEnv.testnet:\n return testnetConfig;\n default:\n return stageConfig;\n }\n}\n","import { TEnv } from '../../common/types/types';\nimport { isValidChain } from '../../common/utils/isValidChain';\nimport { Provider } from '../../provider';\nimport { getBasculeAddressConfig } from '../basculeAddressConfig';\nimport { BASCULE_ABI } from '../abi';\n\nexport function getBasculeTokenContract(provider: Provider, env?: TEnv) {\n const basculeAddressConfig = getBasculeAddressConfig(env);\n const { chainId } = provider;\n\n if (!isValidChain(chainId)) {\n throw new Error(`This chain ${chainId} is not supported`);\n }\n\n const contractAddress = basculeAddressConfig[chainId];\n\n if (!contractAddress) {\n throw new Error(`The address for bascule module is not defined`);\n }\n\n const contract = provider.createContract(BASCULE_ABI, contractAddress);\n\n if (!contract.options.address) {\n contract.options.address = contractAddress;\n }\n\n return contract as typeof contract & {\n options: typeof contract.options & { address: string };\n };\n}\n","import { isHexStrict } from 'web3-validator';\n\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { getErrorMessage } from '../../common/utils/getErrorMessage';\nimport { Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\nimport { getBasculeTokenContract } from '../utils/getBasculeTokenContract';\n\nconst NO_DEPOSIT_ID_ERROR =\n 'No deposit ID provided. Please provide a deposit ID as an argument.';\n\nconst INVALID_DEPOSIT_ID_ERROR =\n 'Invalid deposit ID. Expected a 0x-prefixed 32-byte hex string.';\n\n// Deposit status enum\nexport enum BasculeDepositStatus {\n UNREPORTED = 0, // potentially pending\n REPORTED = 1,\n WITHDRAWN = 2,\n}\n\nexport interface ICheckBasculeDepositStatusParams\n extends IProviderBasedParams,\n IEnvParam {\n /**\n * id of the transaction.\n */\n txId?: string;\n}\n\n/**\n * Check bascule contract deposit status.\n *\n * @param {ICheckBasculeDepositStatusParams} params - The parameters to get status base on Bascule contract.\n *\n * @returns {Promise<BasculeDepositStatus>} Deposit status promise\n */\nexport async function getBasculeDepositStatus({\n txId,\n env,\n ...providerParams\n}: ICheckBasculeDepositStatusParams): Promise<BasculeDepositStatus> {\n if (!txId) {\n throw new Error(NO_DEPOSIT_ID_ERROR);\n }\n\n if (!isHexStrict(txId)) {\n throw new Error(INVALID_DEPOSIT_ID_ERROR);\n }\n\n const provider = new Provider(providerParams);\n const basculeContract = getBasculeTokenContract(provider, env);\n\n try {\n const status: bigint = await basculeContract.methods\n .depositHistory(Buffer.from(txId.replace(/^0x/, ''), 'hex'))\n .call();\n\n const depositStatus: BasculeDepositStatus = Number(status);\n\n return depositStatus;\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n\n throw new Error(errorMessage);\n }\n}\n","import { OChainId, OEnv, TChainId, TEnv } from '../../common/types/types';\n\nexport const chainIdToEnv = (chainId: TChainId): TEnv => {\n if (\n chainId in [OChainId.ethereum, OChainId.base, OChainId.binanceSmartChain]\n ) {\n return OEnv.prod;\n }\n return OEnv.stage;\n};\n","import { TChainId } from '../../common/types/types';\nimport { isValidChain } from '../../common/utils/isValidChain';\nimport {\n rpcUrlConfig as defaultRpcUrlConfig,\n TRpcUrlConfig,\n} from '../../provider/rpcUrlConfig';\n\n/**\n * Get RPC URL configuration for a specific chain.\n * Validates chain support and RPC URL availability.\n *\n * @param {TChainId} chainId - Chain ID to get RPC config for\n * @param {string} [rpcUrl] - Optional custom RPC URL\n * @returns {TRpcUrlConfig} RPC URL configuration for the chain\n * @throws {Error} If chain is not supported or RPC URL is not found\n */\nexport function getRpcUrlConfigFromChain(\n chainId: TChainId,\n rpcUrl?: string,\n): TRpcUrlConfig {\n if (!isValidChain(chainId)) {\n throw new Error(`This chain ${chainId} is not supported`);\n }\n\n const rpcUrlConfig: TRpcUrlConfig = rpcUrl\n ? { [chainId]: rpcUrl }\n : defaultRpcUrlConfig;\n\n if (!rpcUrlConfig[chainId]) {\n throw new Error(`RPC URL for chainId ${chainId} not found`);\n }\n\n return rpcUrlConfig;\n}\n","import BigNumber from 'bignumber.js';\nimport { TChainId } from '../../common/types/types';\nimport { fromSatoshi } from '../../common/utils/convertSatoshi';\nimport { ReadProvider } from '../../provider/ReadProvider';\nimport { chainIdToEnv } from '../utils/chainIdToEnv';\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\nimport { getRpcUrlConfigFromChain } from '../utils/getRpcUrlConfigFromChain';\n\nexport interface IGetLBTCMintingFeeParams {\n /**\n * Chain ID\n */\n chainId: TChainId;\n /**\n * Bake gas estimate\n */\n bakeGasEstimate?: number;\n /**\n * RPC URL\n */\n rpcUrl?: string;\n}\n\n/**\n * Get LBTC minting fee.\n *\n * @param chainId - Chain ID\n * @param bakeGasEstimate - Bake gas estimate\n * @param rpcUrl - RPC URL\n *\n * @returns LBTC minting fee\n */\nexport async function getLBTCMintingFee({\n chainId,\n bakeGasEstimate = 0,\n rpcUrl,\n}: IGetLBTCMintingFeeParams): Promise<BigNumber> {\n const rpcUrlConfig = getRpcUrlConfigFromChain(chainId, rpcUrl);\n const provider = new ReadProvider({ chainId, rpcUrlConfig });\n const env = chainIdToEnv(chainId);\n const tokenContract = getLbtcTokenContract(provider, env);\n\n const fee: bigint = await tokenContract.methods.getMintFee().call();\n const feeBtc = new BigNumber(fromSatoshi(fee.toString(10)));\n if (bakeGasEstimate) {\n const total = feeBtc.plus(fromSatoshi(bakeGasEstimate));\n return total;\n }\n\n return feeBtc;\n}\n","import { IReadProviderParams, ReadProvider } from '../../provider/ReadProvider';\nimport { TRpcUrlConfig } from '../../provider/rpcUrlConfig';\nimport { IEnvParam } from '../../common/types/internalTypes';\n\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\n\nexport interface ILBTCTotalSupplyParams extends IEnvParam {\n rpcUrl: string;\n chainId: IReadProviderParams['chainId'];\n}\n\nexport async function getLBTCTotalSupply({\n env,\n rpcUrl,\n chainId,\n}: ILBTCTotalSupplyParams): Promise<string> {\n const rpcUrlConfig: TRpcUrlConfig = { [chainId]: rpcUrl };\n\n const provider = new ReadProvider({ chainId, rpcUrlConfig });\n\n const tokenContract = getLbtcTokenContract(provider, env);\n\n const balance: bigint = await tokenContract.methods.totalSupply().call();\n\n return balance.toString();\n}\n","import { TChainId } from '../../common/types/types';\nimport { getErrorMessage } from '../../common/utils/getErrorMessage';\nimport { ReadProvider } from '../../provider/ReadProvider';\nimport { chainIdToEnv } from '../utils/chainIdToEnv';\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\nimport { getRpcUrlConfigFromChain } from '../utils/getRpcUrlConfigFromChain';\n\nexport interface IGetPermitNonceParams {\n /**\n * Owner address to check permit nonce for\n */\n owner: string;\n /**\n * Chain ID of the network\n */\n chainId: TChainId;\n /**\n * RPC URL for the network (optional)\n */\n rpcUrl?: string;\n}\n\n/**\n * Get permit nonce for a specific owner address from LBTC contract.\n * This nonce is used in EIP-2612 permit operations.\n *\n * @param {IGetPermitNonceParams} params - Parameters for getting permit nonce\n * @returns {Promise<string>} Promise that resolves to the permit nonce value\n */\nexport async function getPermitNonce({\n owner,\n rpcUrl,\n chainId,\n}: IGetPermitNonceParams): Promise<string> {\n const rpcUrlConfig = getRpcUrlConfigFromChain(chainId, rpcUrl);\n const provider = new ReadProvider({ chainId, rpcUrlConfig });\n const env = chainIdToEnv(chainId);\n const tokenContract = getLbtcTokenContract(provider, env);\n\n try {\n const nonce: bigint = await tokenContract.methods.nonces(owner).call();\n return nonce.toString();\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n throw new Error(errorMessage);\n }\n}\n","import {\n defaultEnv,\n ZERO_ADDRESS as PLACEHOLDER_ADDRESS,\n} from '../common/const';\nimport { OChainId, OEnv, TOFTChainId, TEnv } from '../common/types/types';\n\ntype LbtcOFTAdapterConfig = Record<TOFTChainId, string>;\n\nconst stageConfig: LbtcOFTAdapterConfig = {\n [OChainId.sepolia]: '0xe3748bF0Ec0A76767539eE28610B3367e35fe2C2',\n [OChainId.berachainBartioTestnet]:\n '0x1977013acaf27856ac8048C42EE2ed0134d53895',\n [OChainId.corn]: PLACEHOLDER_ADDRESS,\n [OChainId.ethereum]: PLACEHOLDER_ADDRESS,\n};\n\nconst testnetConfig: LbtcOFTAdapterConfig = {\n ...stageConfig,\n};\n\nconst prodConfig: LbtcOFTAdapterConfig = {\n ...stageConfig,\n [OChainId.corn]: '0xfc7B20D9B59A8A466f4fC3d34aA69a7D98e71d7A',\n [OChainId.ethereum]: '0x6bc15d7930839ec18a57f6f7df72ae1b439d077f',\n};\n\nexport function getLbtcOFTAdapterAddressConfig(\n env: TEnv = defaultEnv,\n): LbtcOFTAdapterConfig {\n switch (env) {\n case OEnv.prod:\n return prodConfig;\n case OEnv.testnet:\n return testnetConfig;\n default:\n return stageConfig;\n }\n}\n","import { Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\n\nexport type SignLbtcDestionationAddrParams = IProviderBasedParams;\n\n/**\n * Signs the destination address for the LBTC in active chain\n * in the current account. Signing is necessary for the\n * generation of the deposit address.\n *\n * @param {SignLbtcDestionationAddrParams} params\n *\n * @returns {Promise<string>} The signature of the message.\n */\nexport async function signLbtcDestionationAddr(\n params: SignLbtcDestionationAddrParams,\n): Promise<string> {\n const provider = new Provider(params);\n\n const message = `destination chain id is ${params.chainId}`;\n\n return provider.signMessage(message);\n}\n","interface IGetTypedData {\n chainId: number;\n verifyingContract: string;\n fee: string;\n expiry: string;\n}\n\nexport function getTypedData({\n chainId,\n verifyingContract,\n fee,\n expiry,\n}: IGetTypedData) {\n return {\n domain: {\n name: 'Lombard Staked Bitcoin',\n version: '1',\n chainId,\n verifyingContract,\n },\n message: {\n chainId,\n fee,\n expiry,\n },\n primaryType: 'feeApproval',\n types: {\n EIP712Domain: [\n { name: 'name', type: 'string' },\n { name: 'version', type: 'string' },\n { name: 'chainId', type: 'uint256' },\n { name: 'verifyingContract', type: 'address' },\n ],\n feeApproval: [\n { name: 'chainId', type: 'uint256' },\n { name: 'fee', type: 'uint256' },\n { name: 'expiry', type: 'uint256' },\n ],\n },\n };\n}\n","import { IEnvParam } from '../../common/types/internalTypes';\nimport { Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\nimport { getTypedData } from './getTypedData';\n\nconst NO_SIGNATURE_ERROR =\n 'Failed to obtain a valid signature. The response is undefined or invalid.';\n\nexport interface ISignNetworkFeeParams\n extends Pick<IProviderBasedParams, 'provider' | 'chainId'>,\n IEnvParam {\n /**\n * User address\n */\n address: string;\n /**\n * Authorization fee\n */\n fee: string;\n /**\n * Expiration time\n */\n expiry: string;\n}\n\nexport interface ISignNetworkFeeResponse {\n /**\n * signature\n */\n signature: string;\n /**\n * JSON typed data used for the signature\n */\n typedData: string;\n}\n\n/**\n * Signs the network fee transaction in the current account.\n * Signing is necessary for the auto-mint.\n *\n * @param {ISignNetworkFeeParams} params - The parameters for signing network fee\n * @returns {Promise<ISignNetworkFeeResponse>} A promise that resolves to the signature and typed data\n */\nexport async function signNetworkFee({\n address,\n provider,\n fee,\n expiry,\n chainId,\n env,\n}: ISignNetworkFeeParams): Promise<ISignNetworkFeeResponse> {\n const providerInstance = new Provider({\n provider,\n account: address,\n chainId,\n });\n\n const tokenContract = getLbtcTokenContract(providerInstance, env);\n const verifyingContract = tokenContract.options.address;\n const typedData = JSON.stringify(\n getTypedData({ chainId, verifyingContract, fee, expiry }),\n );\n\n const signature = await providerInstance.web3?.currentProvider?.request<\n 'eth_signTypedData_v4',\n string\n >({\n method: 'eth_signTypedData_v4',\n params: [address, typedData],\n });\n\n if (typeof signature === 'string') {\n return { signature, typedData: typedData };\n }\n\n if (!signature?.result) {\n throw new Error(NO_SIGNATURE_ERROR);\n }\n\n return { signature: signature.result, typedData: typedData };\n}\n","import * as ecc from '@bitcoin-js/tiny-secp256k1-asmjs';\nimport {\n address as addressUtils,\n initEccLib,\n networks,\n payments,\n} from 'bitcoinjs-lib';\nimport { OEnv, TEnv } from '../../common/types/types';\n\ninitEccLib(ecc);\n\ntype AddressType = 'p2tr' | 'p2wpkh' | 'p2wsh';\n\n/**\n * Get output script from address.\n *\n * @param address - The address.\n * @param networkMode - The network mode.\n *\n * @returns The output script.\n */\nexport function getOutputScript(\n address: string,\n env: TEnv = OEnv.prod,\n): string {\n const addressType = getAddressType(address);\n\n const payment = payments[addressType]({\n address,\n network: env === OEnv.prod ? networks.bitcoin : networks.testnet,\n });\n\n const paymentOutputScript = payment.output?.toString('hex');\n\n if (!paymentOutputScript) {\n throw new Error('Output script is not found.');\n }\n\n return `0x${paymentOutputScript}`;\n}\n\nfunction getAddressType(address: string): AddressType {\n const result = addressUtils.fromBech32(address);\n\n const isP2TR = result.version === 1 && result.data.length === 32;\n if (isP2TR) {\n return 'p2tr';\n }\n\n const isP2WPKH = result.version === 0 && result.data.length === 20;\n if (isP2WPKH) {\n return 'p2wpkh';\n }\n\n if (isP2WSHAddressType(address)) {\n return 'p2wsh';\n }\n\n throw new Error('Address type is not supported.');\n}\n\nfunction isP2WSHAddressType(address: string): boolean {\n return (\n (address.startsWith('bc1') || address.startsWith('tb1')) &&\n address.length === 62\n );\n}\n","import { getOutputScript } from '../../btcSdk/utils/getOutputScript';\nimport { IEnvParam } from '../../common/types/internalTypes';\nimport { toSatoshi } from '../../common/utils/convertSatoshi';\nimport { IWeb3SendResult, Provider } from '../../provider';\nimport { IProviderBasedParams } from '../types';\nimport { getGasMultiplier } from '../utils/getGasMultiplier';\nimport { getLbtcTokenContract } from '../utils/getLbtcTokenContract';\n\nexport interface IUnstakeLBTCParams extends IProviderBasedParams, IEnvParam {\n /**\n * The BTC address to send the unstaked BTC to.\n */\n btcAddress: string;\n /**\n * The amount of LBTC to unstake.\n */\n amount: number;\n}\n\n/**\n * Unstakes LBTC to the specified BTC address.\n *\n * @param {IUnstakeLBTCParams} params\n *\n * @returns {Promise<IWeb3SendResult>} transaction promise\n */\nexport function unstakeLBTC({\n btcAddress,\n amount,\n env,\n ...providerParams\n}: IUnstakeLBTCParams): Promise<IWeb3SendResult> {\n const provider = new Provider(providerParams);\n const tokenContract = getLbtcTokenContract(provider, env);\n const outputScript = getOutputScript(btcAddress, env);\n\n const amountSat = toSatoshi(amount);\n\n const tx = tokenContract.methods.redeem(outputScript, amountSat);\n\n return provider.sendTransactionAsync(\n provider.account,\n tokenContract.options.address,\n {\n data: tx.encodeABI(),\n estimate: true,\n estimateFee: true,\n gasLimitMultiplier: getGasMultiplier(provider.chainId),\n },\n );\n}\n"],"names":["OEnv","OChainId","defaultEnv","ZERO_ADDRESS","stageConfig","testnetConfig","prodConfig","getApiConfig","env","getErrorMessage","error","err","_a","getAxiosErrorMessage","getErrorMessageFromObject","OChainName","getChainNameById","chainId","SANCTIONED_ADDRESS","ADDRESS_URL","SANCTIONS_MESSAGE","generateDepositBtcAddress","address","signature","captchaToken","referrerCode","referralId","baseApiUrl","toChain","requestParams","data","axios","errorMsg","isSanctioned","getDepositBtcAddress","addresses","getDepositBtcAddresses","addressData","getActualAddress","actualAddress","acc","toBlockchain","requestrParams","BTC_DECIMALS","SATOSHI_SCALE","fromSatoshi","amount","toSatoshi","getCainIdByName","chain","ENotarizationStatus","ESessionState","getDepositsByAddress","mapResponse","BigNumber","l","n","p","q","r","t","u","v","w","x","y","z","A","a","B","C","D","E","b","e","F","G","H","I","J","K","L","M","d","c","k","h","g","f","m","N","O","escape","P","Q","R","S","T","U","V","W","react_production_min","ReactVersion","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactCurrentDispatcher","ReactCurrentBatchConfig","ReactCurrentActQueue","ReactCurrentOwner","ReactDebugCurrentFrame","currentExtraStackFrame","setExtraStackFrame","stack","impl","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","ReactSharedInternals","warn","format","_len","args","_key","printWarning","_len2","_key2","level","argsWithFormat","item","didWarnStateUpdateForUnmountedComponent","warnNoop","publicInstance","callerName","_constructor","componentName","warningKey","ReactNoopUpdateQueue","callback","completeState","partialState","assign","emptyObject","Component","props","context","updater","deprecatedAPIs","defineDeprecationWarning","methodName","info","fnName","ComponentDummy","PureComponent","pureComponentPrototype","createRef","refObject","isArrayImpl","isArray","typeName","value","hasToStringTag","type","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","provider","outerName","lazyComponent","payload","init","hasOwnProperty","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","warnIfStringRefCannotBeAutoConverted","ReactElement","key","ref","self","source","owner","element","createElement","children","propName","childrenLength","childArray","i","defaultProps","cloneAndReplaceKey","oldElement","newKey","newElement","cloneElement","isValidElement","object","SEPARATOR","SUBSEPARATOR","escapeRegex","escaperLookup","escapedString","match","didWarnAboutMaps","userProvidedKeyEscapeRegex","escapeUserProvidedKey","text","getElementKey","index","mapIntoArray","array","escapedPrefix","nameSoFar","invokeCallback","_child","mappedChild","childKey","escapedChildKey","child","nextName","subtreeCount","nextNamePrefix","iteratorFn","iterableChildren","iterator","step","ii","childrenString","mapChildren","func","result","count","countChildren","forEachChildren","forEachFunc","forEachContext","toArray","onlyChild","createContext","defaultValue","hasWarnedAboutUsingNestedContextConsumers","hasWarnedAboutUsingConsumerProvider","hasWarnedAboutDisplayNameOnConsumer","Consumer","_Provider","_currentValue","_currentValue2","_threadCount","Uninitialized","Pending","Resolved","Rejected","lazyInitializer","ctor","thenable","moduleObject","resolved","rejected","pending","lazy","lazyType","propTypes","newDefaultProps","newPropTypes","forwardRef","render","elementType","ownName","name","REACT_MODULE_REFERENCE","isValidElementType","memo","compare","resolveDispatcher","dispatcher","useContext","Context","realContext","useState","initialState","useReducer","reducer","initialArg","useRef","initialValue","useEffect","create","deps","useInsertionEffect","useLayoutEffect","useCallback","useMemo","useImperativeHandle","useDebugValue","formatterFn","useTransition","useDeferredValue","useId","useSyncExternalStore","subscribe","getSnapshot","getServerSnapshot","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","reenableLogs","ReactCurrentDispatcher$1","prefix","describeBuiltInComponentFrame","ownerFn","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","prototype","describeUnknownElementTypeFrameInDEV","loggedTypeFailures","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement","checkPropTypes","typeSpecs","values","location","has","typeSpecName","error$1","ex","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","getSourceInfoErrorAddendumForProps","elementProps","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","validatePropTypes","_name","validateFragmentProps","fragment","keys","createElementWithValidation","validType","sourceInfo","typeString","didWarnAboutDeprecatedCreateFactory","createFactoryWithValidation","validatedFactory","cloneElementWithValidation","startTransition","scope","options","prevTransition","currentTransition","updatedFibersCount","didWarnAboutMessageChannel","enqueueTaskImpl","enqueueTask","task","requireString","nodeRequire","module","channel","actScopeDepth","didWarnNoAwaitAct","act","prevActScopeDepth","prevIsBatchingLegacy","queue","flushActQueue","popActScope","thenableResult","wasAwaited","resolve","reject","returnValue","recursivelyFlushAsyncActWork","_queue","_thenable","_thenable2","isFlushing","createElement$1","cloneElement$1","createFactory","Children","exports","reactModule","require$$0","require$$1","reactJsxRuntime_production_min","React","jsxDEV","maybeKey","ReactCurrentOwner$1","jsxWithValidation","isStaticChildren","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","Spinner","color","size","className","Button","primary","isLoading","CodeBlock","withFormatting","formattedCode","useQuery","queryFn","dependencies","shouldFetch","setData","setError","setLoading","fetchData","MIN_STAKE_AMOUNT","getLBTCExchangeRate","chainIdName","minAmount","WithDefaults","StoryView","refetch","Fragment","getNetworkFeeSignature","claimerApiUrl","errorMessage","storeNetworkFeeSignature","typedData","rpcUrlConfig","getMaxPriorityFeePerGas","rpcUrl","convertedHexValue","Web3","FEE_MULTIPLIER","ADDITIONAL_SAFE_GAS_PRICE_WEI","ReadProvider","__publicField","defaultRpcUrlConfig","readWeb3","web3","block","maxPriorityFeePerGas","pureGasPriceWei","abi","Provider","account","message","messageHex","from","to","sendOptions","web3Write","web3Read","estimate","estimateFee","extendedGasLimit","gasLimit","gasLimitMultiplier","nonce","tx","utils","estimatedGas","multipliedGasLimit","maxFeePerGas","safeGasPrice","promise","transactionHash","getGasMultiplier","isValidChain","PLACEHOLDER_ADDRESS","getLbtcAddressConfig","getTokenABI","token","LBTCABI","IERC20","getLbtcTokenContract","lbtcAddressConfig","tokenAddress","contract","approveLBTC","spender","providerParams","tokenContract","amountSat","INSUFFICIENT_FUNDS_PARTIAL_ERROR","INSUFFICIENT_FUNDS_ERROR","hexify","hexString","claimLBTC","proofSignature","ERR_MULTIPLE_ERRORS","JSONRPC_ERR_REJECTED_REQUEST","JSONRPC_ERR_UNAUTHORIZED","JSONRPC_ERR_UNSUPPORTED_METHOD","JSONRPC_ERR_DISCONNECTED","JSONRPC_ERR_CHAIN_DISCONNECTED","ERR_RPC_INVALID_JSON","ERR_RPC_INVALID_REQUEST","ERR_RPC_INVALID_METHOD","ERR_RPC_INVALID_PARAMS","ERR_RPC_INTERNAL_ERROR","ERR_RPC_INVALID_INPUT","ERR_RPC_MISSING_RESOURCE","ERR_RPC_UNAVAILABLE_RESOURCE","ERR_RPC_TRANSACTION_REJECTED","ERR_RPC_UNSUPPORTED_METHOD","ERR_RPC_LIMIT_EXCEEDED","ERR_RPC_NOT_SUPPORTED","BaseWeb3Error","msg","cause","MultipleErrors","unquotValue","_","errors","genericRpcErrorMessageTemplate","RpcErrorMessages","RpcError","rpcError","ParseError","InvalidRequestError","MethodNotFoundError","InvalidParamsError","InternalError","InvalidInputError","MethodNotSupported","ResourceUnavailableError","ResourcesNotFoundError","VersionNotSupportedError","TransactionRejectedError","LimitExceededError","rpcErrorsMap","isHexStrict","hex","FMT_NUMBER","FMT_BYTES","BlockTags","HardforksOrdered","getBasculeAddressConfig","getBasculeTokenContract","basculeAddressConfig","contractAddress","BASCULE_ABI","NO_DEPOSIT_ID_ERROR","INVALID_DEPOSIT_ID_ERROR","BasculeDepositStatus","getBasculeDepositStatus","txId","basculeContract","status","chainIdToEnv","getRpcUrlConfigFromChain","getLBTCMintingFee","bakeGasEstimate","fee","feeBtc","getLBTCTotalSupply","getPermitNonce","getLbtcOFTAdapterAddressConfig","signLbtcDestionationAddr","params","getTypedData","verifyingContract","expiry","NO_SIGNATURE_ERROR","signNetworkFee","providerInstance","_b","initEccLib","ecc","getOutputScript","addressType","getAddressType","paymentOutputScript","payments","networks","addressUtils","isP2WSHAddressType","unstakeLBTC","btcAddress","outputScript"],"mappings":"8qBAAaA,GAAO,CAClB,KAAM,OACN,QAAS,UACT,MAAO,OACT,EAIaC,EAAW,CACtB,SAAU,EACV,QAAS,KACT,kBAAmB,GACnB,yBAA0B,GAC1B,QAAS,SACT,KAAM,KACN,YAAa,MACb,uBAAwB,MAExB,KAAM,IACR,ECjBaC,GAAmBF,GAAK,KAMxBG,EAAe,6CCAtBC,GAA0B,CAC9B,WAAY,wCACZ,cAAe,yCACjB,EAEMC,GAA4B,CAChC,WAAY,+CACZ,cAAe,yCACjB,EAEMC,GAAyB,CAC7B,WAAY,uCACZ,cAAe,EACjB,EAEaC,GAAe,CAACC,EAAYN,KAA2B,CAClE,OAAQM,EAAK,CACX,KAAKR,GAAK,KACD,OAAAM,GACT,KAAKN,GAAK,QACD,OAAAK,GACT,QACS,OAAAD,EACX,CACF,ECxBO,SAASK,GAAgBC,EAAwB,CAClD,OAAA,OAAOA,GAAU,SACZA,GAGeC,GACtB,OAAA,QAAAC,EAAAD,GAAA,YAAAA,EAAK,OAAL,YAAAC,EAAW,UAAW,OAAOD,EAA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