-
Notifications
You must be signed in to change notification settings - Fork 31
/
50011.7cd1e3c3.iframe.bundle.js
1 lines (1 loc) · 134 KB
/
50011.7cd1e3c3.iframe.bundle.js
1
(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[50011],{"./node_modules/@metamask-institutional/configuration-client/dist/ConfigurationClient.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConfigurationClient=void 0;let constants_1=__webpack_require__("./node_modules/@metamask-institutional/configuration-client/dist/constants.js");exports.ConfigurationClient=class{constructor(configurationApiUrl=constants_1.MMI_CONFIGURATION_API_URL){this.configurationApiUrl=configurationApiUrl}async getConfiguration(){console.log(`Fetching MMI configuration from ${this.configurationApiUrl}`);try{let response=await fetch(this.configurationApiUrl,{method:"GET"});return await response.json()}catch(e){throw console.log("Error fetching MMI configuration"),Error(e)}}}},"./node_modules/@metamask-institutional/configuration-client/dist/constants.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MMI_CONFIGURATION_API_URL=void 0,exports.MMI_CONFIGURATION_API_URL="https://configuration.metamask-institutional.io/v2/configuration/default"},"./node_modules/@metamask-institutional/configuration-client/dist/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConfigurationClient=void 0;var ConfigurationClient_1=__webpack_require__("./node_modules/@metamask-institutional/configuration-client/dist/ConfigurationClient.js");Object.defineProperty(exports,"ConfigurationClient",{enumerable:!0,get:function(){return ConfigurationClient_1.ConfigurationClient}})},"./node_modules/@metamask-institutional/custody-controller/dist/custody.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustodyController=void 0;let custody_keyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/index.js"),obs_store_1=__webpack_require__("./node_modules/@metamask/obs-store/dist/index.js"),utils_1=__webpack_require__("./node_modules/@metamask-institutional/custody-controller/dist/utils.js");exports.CustodyController=class{constructor(opts={}){this.MAX_LOG_ENTRIES=500;let{initState,captureException}=opts;this.store=new obs_store_1.ObservableStore({custodyAccountDetails:{},custodianConnectRequest:{},apiRequestLogs:[],...initState}),this.captureException=captureException}storeApiCallLog(apiLogEntry){let{apiRequestLogs}=this.store.getState(),updatedApiRequestLogs=apiRequestLogs?[...apiRequestLogs]:[];updatedApiRequestLogs.length>=this.MAX_LOG_ENTRIES&&updatedApiRequestLogs.shift(),updatedApiRequestLogs.push(apiLogEntry),this.store.updateState({apiRequestLogs:updatedApiRequestLogs})}sanitizeAndLogApiCall(apiLogEntry){let{id,method,endpoint,success,timestamp,errorMessage,responseData}=apiLogEntry,sanitizedEntry={id,method,endpoint,success,timestamp,responseData:success?responseData:void 0};!success&&errorMessage&&(sanitizedEntry.errorMessage=errorMessage),this.storeApiCallLog(sanitizedEntry)}storeCustodyStatusMap(custody,custodyStatusMap){try{let{custodyStatusMaps}=this.store.getState();this.store.updateState({custodyStatusMaps:{...custodyStatusMaps,[custody.toLowerCase()]:custodyStatusMap}})}catch(error){this.captureException(error)}}storeSupportedChainsForAddress(address,supportedChains,custodianName){try{let{custodianSupportedChains}=this.store.getState();this.store.updateState({custodianSupportedChains:{...custodianSupportedChains,[address]:{supportedChains:supportedChains.map(chain=>Number(chain).toString()),custodianName:custodianName}}})}catch(error){this.captureException(error)}}setAccountDetails(newAccountDetails){try{let{custodyAccountDetails}=this.store.getState(),accountsToAdd={};newAccountDetails.forEach(item=>{custodyAccountDetails[(0,utils_1.toChecksumHexAddress)(item.address)]||(accountsToAdd[(0,utils_1.toChecksumHexAddress)(item.address)]=item)}),this.store.updateState({custodyAccountDetails:{...custodyAccountDetails,...accountsToAdd}})}catch(error){this.captureException(error)}}removeAccount(address){try{let{custodyAccountDetails}=this.store.getState();delete custodyAccountDetails[utils_1.toChecksumHexAddress(address)],this.store.updateState({custodyAccountDetails})}catch(error){this.captureException(error)}}setWaitForConfirmDeepLinkDialog(waitForConfirmDeepLinkDialog){this.store.updateState({waitForConfirmDeepLinkDialog})}getAccountDetails(address){let{custodyAccountDetails}=this.store.getState();return custodyAccountDetails[(0,utils_1.toChecksumHexAddress)(address)]}getCustodyTypeByAddress(address){var _a;let{custodyAccountDetails}=this.store.getState();return null===(_a=custodyAccountDetails[address])||void 0===_a?void 0:_a.custodyType}getAllCustodyTypes(){var _a;try{let custodyTypes=new Set,{custodyAccountDetails}=this.store.getState(),excludedCustodyTypes=["Custody - Qredo","Custody - Curv"];for(let address of Object.keys(custodyAccountDetails)){let custodyType=null===(_a=custodyAccountDetails[address])||void 0===_a?void 0:_a.custodyType;excludedCustodyTypes.includes(custodyType)||custodyTypes.add(custodyType)}return custodyTypes}catch(error){this.captureException(error)}}handleMmiCustodianInUse(req){var _a;try{if(!req.params.custodianName)throw Error("Missing parameter: custodianName");let custodian=custody_keyring_1.CUSTODIAN_TYPES[req.params.custodianName.toUpperCase()],allowed=!1;if(custodian)for(let origin of custodian.origins)origin.test(req.origin)&&(allowed=!0);if(!allowed)throw Error("Forbidden");let{custodyAccountDetails}=this.store.getState();for(let address of Object.keys(custodyAccountDetails))if((null===(_a=custodyAccountDetails[address])||void 0===_a?void 0:_a.custodyType)===`Custody - ${custodian.name}`)return!0;return!1}catch(error){throw this.captureException(error),error}}async handleMmiCheckIfTokenIsPresent({token,envName,keyring}){try{for(let address of(await keyring.getAccounts())){let accountDetails=keyring.getAccountDetails(address);if(accountDetails.envName===envName&&accountDetails.authDetails.refreshToken===token)return!0}return!1}catch(error){return this.captureException(error),!1}}}},"./node_modules/@metamask-institutional/custody-controller/dist/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toChecksumHexAddress=exports.CustodyController=void 0;var custody_1=__webpack_require__("./node_modules/@metamask-institutional/custody-controller/dist/custody.js");Object.defineProperty(exports,"CustodyController",{enumerable:!0,get:function(){return custody_1.CustodyController}});var utils_1=__webpack_require__("./node_modules/@metamask-institutional/custody-controller/dist/utils.js");Object.defineProperty(exports,"toChecksumHexAddress",{enumerable:!0,get:function(){return utils_1.toChecksumHexAddress}})},"./node_modules/@metamask-institutional/custody-controller/dist/utils.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toChecksumHexAddress=void 0;let util_1=__webpack_require__("./ui/__mocks__/ethereumjs-util.js");function toChecksumHexAddress(address){if(!address)return"";let hexPrefixed=(0,util_1.addHexPrefix)(address);return(0,util_1.isHexString)(hexPrefixed)?(0,util_1.toChecksumAddress)((0,util_1.addHexPrefix)(address)):hexPrefixed}exports.toChecksumHexAddress=toChecksumHexAddress},"./node_modules/@metamask-institutional/custody-keyring/dist/CustodyKeyring.js":function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __importDefault=this&&this.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustodyKeyring=void 0;let util_1=__webpack_require__("./ui/__mocks__/ethereumjs-util.js"),types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js"),crypto_1=__importDefault(__webpack_require__("?a04e")),events_1=__webpack_require__("./node_modules/events/events.js"),constants_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/constants/index.js"),migrations_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/migrations/index.js"),migrator_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/migrations/migrator.js");class CustodyKeyring extends events_1.EventEmitter{constructor(opts={}){super(),this.trackingActiveByCredentials={},this.accounts=[],this.selectedAddresses=[],this.accountsDetails=[],this.sdkList=[],this.meta={},this.mmiConfigurationController=opts.mmiConfigurationController,this.captureException=opts.captureException}getUniqueAccountDetails(account){return this.hashAuthDetails(account.authDetails,account.envName)}serialize(){return console.log("Serializing custody keyring"),Promise.resolve({accounts:this.accounts,selectedAddresses:this.selectedAddresses,accountsDetails:this.accountsDetails,meta:this.meta})}deserialize(opts={}){return new Promise(resolve=>{try{let migratedOpts=new migrator_1.Migrator({migrations:migrations_1.migrations}).migrateData({custodianType:this.custodianType,type:this.type,authType:this.authType,...opts});this.accounts=migratedOpts.accounts||[],this.selectedAddresses=migratedOpts.selectedAddresses||[],this.accountsDetails=migratedOpts.accountsDetails||[],this.meta=migratedOpts.meta||{};let custodians=this.getCustodians();this.accountsDetails.filter(account=>!account.envName).forEach(account=>{var _a;account.envName=null===(_a=custodians.find(c=>c.apiUrl===account.apiUrl))||void 0===_a?void 0:_a.envName}),this.selectedAddresses.filter(account=>!account.envName).forEach(account=>{var _a;account.envName=null===(_a=custodians.find(c=>c.apiUrl===account.apiUrl))||void 0===_a?void 0:_a.envName}),this.accountsDetails.reduce((result,details)=>{let hash=this.getUniqueAccountDetails(details);return result.find(account=>hash===account.hash)||result.push({hash,authDetails:details.authDetails,envName:details.envName}),result},[]).forEach(item=>this.getSDK(item.authDetails,item.envName)),resolve()}catch(error){console.error("Error during deserialize method execution:",error),this.captureException(error)}})}convertExtensionCustodianAccountToSDKCustodianAccount(account){let{token,...accountWithoutToken}=account;return{...accountWithoutToken,address:account.address.toLowerCase(),authDetails:this.createAuthDetails(account.token)}}setSelectedAddresses(addresses){this.selectedAddresses=addresses.map(this.convertExtensionCustodianAccountToSDKCustodianAccount.bind(this))}addAccounts(n){return new Promise(resolve=>{this.accounts||(this.accounts=[]);for(let i=0;i<n;i++){let selectedAccountDetails=this.selectedAddresses.shift(),address=null==selectedAccountDetails?void 0:selectedAccountDetails.address;address&&!this.accounts.includes(address)&&(selectedAccountDetails.meta={version:migrations_1.migrations.length},this.accountsDetails.push(selectedAccountDetails),this.accounts.push(address),this.getSDK(selectedAccountDetails.authDetails,selectedAccountDetails.envName))}resolve(this.accounts)})}getAccounts(){return Promise.resolve(this.accounts.slice())}removeAccount(address){this.accounts=this.accounts.filter(a=>a.toLowerCase()!==address.toLowerCase()),this.accountsDetails=this.accountsDetails.filter(a=>a.address.toLowerCase()!==address.toLowerCase())}hashAuthDetails(authDetails,envName){let identifier;let{apiUrl}=this.getCustodianFromEnvName(envName);return authDetails.jwt?identifier=authDetails.jwt+apiUrl:authDetails.refreshToken&&(identifier=authDetails.refreshToken+apiUrl),crypto_1.default.createHash("sha256").update(identifier).digest("hex")}replaceRefreshTokenAuthDetails(address,refreshToken){let{authDetails,envName}=this.getAccountDetails(address);this.getSDK(authDetails,envName).changeRefreshTokenAuthDetails({refreshToken})}updateAccountsDetailsWithNewRefreshToken(oldRefreshToken,newRefreshToken,envName){for(let account of this.accountsDetails){let authDetails=account.authDetails;authDetails.refreshToken===oldRefreshToken&&account.envName===envName&&(authDetails.refreshToken=newRefreshToken)}}handleRefreshTokenChangeEvent(event,envName){this.updateAccountsDetailsWithNewRefreshToken(event.oldRefreshToken,event.newRefreshToken,envName);let payload={oldRefreshToken:event.oldRefreshToken,newRefreshToken:event.newRefreshToken};this.emit(constants_1.REFRESH_TOKEN_CHANGE_EVENT,payload)}handleInteractiveRefreshTokenChangeEvent(event){this.emit(constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,event)}emitApiRequestLogEvent(event){this.emit(constants_1.API_REQUEST_LOG_EVENT,event)}createAuthDetails(token){let authDetails;return this.authType===types_1.AuthTypes.TOKEN?authDetails={jwt:token}:this.authType===types_1.AuthTypes.REFRESH_TOKEN&&(authDetails={refreshToken:token}),authDetails}getSDK(authDetails,envName){let hash=this.hashAuthDetails(authDetails,envName),found=this.sdkList.find(item=>item.hash===hash);if(found)return found.sdk;let sdk=this.sdkFactory(authDetails,envName);return sdk.on(constants_1.REFRESH_TOKEN_CHANGE_EVENT,event=>this.handleRefreshTokenChangeEvent(event,envName)),sdk.on(constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,event=>this.handleInteractiveRefreshTokenChangeEvent(event)),sdk.on(constants_1.API_REQUEST_LOG_EVENT,event=>this.emitApiRequestLogEvent(event)),this.sdkList.push({sdk,hash}),sdk}async getCustodianAccounts(token,envName,searchText,getNonImportedAccounts=!0){let accounts;let authDetails=this.createAuthDetails(token),sdk=this.getSDK(authDetails,envName);return(accounts=searchText?searchText.startsWith("0x")?await sdk.getEthereumAccountsByAddress(searchText,constants_1.DEFAULT_MAX_CACHE_AGE):await sdk.getEthereumAccountsByLabelOrAddressName(searchText,constants_1.DEFAULT_MAX_CACHE_AGE):await sdk.getEthereumAccounts(constants_1.DEFAULT_MAX_CACHE_AGE),getNonImportedAccounts)?accounts.filter(account=>-1===this.accounts.map(addr=>addr.toLowerCase()).indexOf(account.address.toLowerCase())):accounts.filter(account=>-1!==this.accounts.map(addr=>addr.toLowerCase()).indexOf(account.address.toLowerCase()))}getTransactionNote(txMeta){var _a;let readableCategory={contractInteraction:"Contract Interaction",contractDeployment:"Contract Deployment",transfer:"ETH Transfer",swap:"Metamask Swap",approve:"Token Approval"}[txMeta.type]||txMeta.type;return(null===(_a=null==txMeta?void 0:txMeta.metadata)||void 0===_a?void 0:_a.note)||`${readableCategory} - initiated on ${txMeta.origin}`}async signTransaction(fromAddress,ethTx,txMeta){var _a,_b;let data,payload;let note=this.getTransactionNote(txMeta);"string"==typeof ethTx.data?data=ethTx.data:ethTx.data instanceof Uint8Array&&(data=ethTx.data.toString("hex")),(null==data?void 0:data.length)?(null==data?void 0:data.startsWith("0x"))||(data="0x"+data):data=void 0;let{authDetails,envName}=this.getAccountDetails(fromAddress),sdk=this.getSDK(authDetails,envName),noGasPayload={from:(0,util_1.toChecksumAddress)(fromAddress),value:BigInt(txMeta.txParams.value).toString(),gasLimit:BigInt(txMeta.txParams.gas).toString(),data:data};txMeta.txParams.to&&(noGasPayload.to=(0,util_1.toChecksumAddress)(txMeta.txParams.to));let eip1559=txMeta.txParams.maxFeePerGas,chainId=Number(txMeta.chainId).toString(10);try{let supportedChainIds=await sdk.getSupportedChains(fromAddress);if(!supportedChainIds||0===supportedChainIds.length)throw Error("Didn't find any supported chains or an error occurred.");if(!supportedChainIds.map(chainId=>Number(chainId).toString()).includes(chainId))throw Error(`This network ${chainId} is not configured or supported with your custody provider.`)}catch(error){throw console.error("Error processing chain IDs:",error),error}return payload=eip1559?{...noGasPayload,maxFeePerGas:BigInt(txMeta.txParams.maxFeePerGas).toString(),maxPriorityFeePerGas:BigInt(txMeta.txParams.maxPriorityFeePerGas).toString(),type:"2"}:{...noGasPayload,gasPrice:BigInt(txMeta.txParams.gasPrice).toString(),type:"0"},await sdk.createTransaction(payload,{chainId,note,transactionCategory:txMeta.type,origin:txMeta.origin,custodianPublishesTransaction:null===(_a=null==txMeta?void 0:txMeta.metadata)||void 0===_a?void 0:_a.custodianPublishesTransaction,rpcUrl:null===(_b=null==txMeta?void 0:txMeta.metadata)||void 0===_b?void 0:_b.rpcUrl})}getAllAccountsWithToken(token){return this.accountsDetails.filter(item=>{var _a,_b;return(null===(_a=item.authDetails)||void 0===_a?void 0:_a.jwt)===token||(null===(_b=item.authDetails)||void 0===_b?void 0:_b.refreshToken)===token})}async getTransaction(from,txCustodyId){if(void 0===from||void 0===txCustodyId)return null;let{authDetails,envName}=this.getAccountDetails(from),sdk=this.getSDK(authDetails,envName);return await sdk.getTransaction((0,util_1.toChecksumAddress)(from),txCustodyId)}async getTransactionDeepLink(address,txId){return this.txDeepLink(address,txId)}getAccountDetails(address){return this.accountsDetails.find(account=>account.address.toLowerCase()===address.toLowerCase())}async getSignature(address,signatureId){if(void 0===signatureId)return null;let{authDetails,envName}=this.getAccountDetails(address),sdk=this.getSDK(authDetails,envName);return await sdk.getSignature((0,util_1.toChecksumAddress)(address),signatureId)}async signPersonalMessage(address,message,opts){let{authDetails,envName}=this.getAccountDetails(address);return this.getSDK(authDetails,envName).signPersonalMessage(address,message,{chainId:null,originUrl:null,note:null})}signMessage(){throw Error("Not supported on this custodian")}exportAccount(){throw Error("Not supported on this custodian")}async getErc20Tokens(){let tokenContracts={};for(let{sdk}of this.sdkList){let tokens=await sdk.getErc20Tokens();tokenContracts={...tokenContracts,tokens}}return tokenContracts}async getCustomerProof(address){let{authDetails,envName}=this.getAccountDetails(address);return this.getSDK(authDetails,envName).getCustomerProof()}async signTypedData(address,data,opts){(null==opts?void 0:opts.version)!=="V4"&&(null==opts?void 0:opts.version)!=="V3"&&this.emit("error","Only signedTypedData_v4 and signedTypedData_v3 is supported");let{authDetails,envName}=this.getAccountDetails(address);return this.getSDK(authDetails,envName).signedTypedData_v4(address,data,opts.version,{chainId:null,originUrl:null,note:null})}getSupportedChains(address){let{authDetails,envName}=this.getAccountDetails(address);return this.getSDK(authDetails,envName).getSupportedChains(address)}getCustodianFromEnvName(envName){if(!envName)return;let custodian=this.getCustodians().find(c=>c.envName===envName);if(!custodian)throw Error(`Could not find custodian with name: ${envName} - please contact support`);return custodian}getCustodians(){let{mmiConfiguration:{custodians}}=this.mmiConfigurationController.store.getState();return custodians}}exports.CustodyKeyring=CustodyKeyring},"./node_modules/@metamask-institutional/custody-keyring/dist/MmiConfiguration.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MmiConfigurationController=void 0;let configuration_client_1=__webpack_require__("./node_modules/@metamask-institutional/configuration-client/dist/index.js"),obs_store_1=__webpack_require__("./node_modules/@metamask/obs-store/dist/index.js"),custodianTypes_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/index.js"),legacyCustodianNames=["curv","qredo","bitgo","cactus"];exports.MmiConfigurationController=class{constructor(opts={}){var _a;console.log("MMI Configuration controller constructor");let initState=(null===(_a=opts.initState)||void 0===_a?void 0:_a.mmiConfiguration)?opts.initState:{mmiConfiguration:{portfolio:{enabled:!1,url:"",cookieSetUrls:[]},features:{websocketApi:!1},custodians:[]}};this.configurationClient=new configuration_client_1.ConfigurationClient(opts.mmiConfigurationServiceUrl),this.store=new obs_store_1.ObservableStore({mmiConfiguration:{portfolio:{...initState.mmiConfiguration.portfolio},features:{...initState.mmiConfiguration.features},custodians:initState.mmiConfiguration.custodians}})}async storeConfiguration(){let configuration=await this.getConfiguration(),{portfolio,features}=configuration,{mmiConfiguration}=this.store.getState(),configuredCustodians=configuration.custodians,custodians=[...Object.values(custodianTypes_1.CUSTODIAN_TYPES).filter(custodian=>!1===custodian.hidden).map(custodian=>({type:custodian.name,name:custodian.name.toLowerCase(),onboardingUrl:custodian.onboardingUrl,website:custodian.website,envName:custodian.envName,apiUrl:custodian.apiUrl,apiVersion:custodian.apiVersion,iconUrl:custodian.imgSrc,displayName:custodian.displayName,websocketApiUrl:null,production:custodian.production,refreshTokenUrl:null,isNoteToTraderSupported:!1,isQRCodeSupported:!1,isManualTokenInputSupported:!1,custodianPublishesTransaction:custodian.custodianPublishesTransaction,version:1}))];configuredCustodians.forEach(custodian=>{custodian.environments.forEach(environment=>{if(environment.name.includes("bitgo")&&(environment.type="Bitgo",environment.version=1,environment.apiVersion=void 0,environment.websocketApiUrl=void 0),legacyCustodianNames.includes(environment.name)){let legacyCustodian=custodians.find(legacyCustodian=>legacyCustodian.name.toLowerCase()===environment.name);legacyCustodian?environment.apiBaseUrl&&(legacyCustodian.apiUrl=environment.apiBaseUrl):console.warn(`Missing legacy custodian ${environment.name}`);return}custodians.push({type:"3"===environment.apiVersion?"ECA3":"1"===environment.apiVersion?"JSONRPC":environment.type,iconUrl:custodian.iconUrl,name:custodian.name,onboardingUrl:custodian.onboardingUrl,website:custodian.website,envName:environment.name,apiUrl:environment.apiBaseUrl,apiVersion:environment.apiVersion,displayName:environment.displayName,production:environment.enabled,refreshTokenUrl:environment.refreshTokenUrl,websocketApiUrl:environment.websocketApiUrl,isNoteToTraderSupported:environment.isNoteToTraderSupported,isQRCodeSupported:environment.isQRCodeSupported,isManualTokenInputSupported:environment.isManualTokenInputSupported,custodianPublishesTransaction:environment.custodianPublishesTransaction,version:environment.apiVersion?2:1})})}),this.store.updateState({mmiConfiguration:{...mmiConfiguration,portfolio:{...mmiConfiguration.portfolio,enabled:portfolio.enabled,url:portfolio.url,cookieSetUrls:portfolio.cookieSetUrls},features:{websocketApi:features.websocketApi},custodians}})}getConfiguration(){return this.configurationClient.getConfiguration()}getWebsocketApiUrl(){let{mmiConfiguration}=this.store.getState();console.log("mmiConfiguration",mmiConfiguration);let custodian=mmiConfiguration.custodians.find(custodian=>custodian.websocketApiUrl);return null==custodian?void 0:custodian.websocketApiUrl}}},"./node_modules/@metamask-institutional/custody-keyring/dist/constants/index.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.API_REQUEST_LOG_EVENT=exports.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT=exports.REFRESH_TOKEN_CHANGE_EVENT=exports.DEFAULT_MAX_CACHE_AGE=void 0,exports.DEFAULT_MAX_CACHE_AGE=60,exports.REFRESH_TOKEN_CHANGE_EVENT="refresh_token_change",exports.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT="interactive_replacement_token_change",exports.API_REQUEST_LOG_EVENT="API_REQUEST_LOG_EVENT"},"./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/bitgo/BitgoCustodyKeyring.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BitgoCustodyKeyring=void 0;let sdk_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/index.js"),types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js"),CustodyKeyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/CustodyKeyring.js"),BitgoStatusMap_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/bitgo/BitgoStatusMap.js");class BitgoCustodyKeyring extends CustodyKeyring_1.CustodyKeyring{constructor(opts={}){super(opts),this.type="Custody - Bitgo",this.authType=types_1.AuthTypes.TOKEN,this.custodianType={name:"Bitgo",displayName:"BitGo",apiUrl:"https://app.bitgo.com/defi/v2",imgSrc:"https://dashboard.metamask-institutional.io/custodian-icons/bitgo-icon.svg",iconUrl:"https://dashboard.metamask-institutional.io/custodian-icons/bitgo-icon.svg",website:"https://www.bitgo.com",onboardingUrl:"https://www.bitgo.com",envName:"bitgo",keyringClass:BitgoCustodyKeyring,production:!0,hidden:!1,origins:[],environmentMapping:[{pattern:/^.*$/u,mmiApiUrl:"https://mmi.codefi.network/v1"},{pattern:/^https:\/\/app.bitgo-test.com/u,mmiApiUrl:"https://mmi.codefi.network/v1"},{pattern:/^https:\/\/app.bitgo.com/u,mmiApiUrl:"https://api.mmi-prod.codefi.network/v1"}]},this.sdkFactory=(authDetails,envName)=>{let custodian=this.getCustodianFromEnvName("bitgo"!==envName?"bitgo-test":"bitgo");return(0,sdk_1.mmiSDKFactory)(sdk_1.BitgoCustodianApi,authDetails,this.authType,custodian.apiUrl)},this.txDeepLink=async(_custodianDetails,_txId)=>({text:"Approve and sign the transaction in BitGo. Once all required approvals have been performed, the transaction will complete. Check your BitGo wallet for the latest status.",url:null})}getStatusMap(){return BitgoStatusMap_1.BitgoStatusMap}}BitgoCustodyKeyring.type="Custody - Bitgo",exports.BitgoCustodyKeyring=BitgoCustodyKeyring},"./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/bitgo/BitgoStatusMap.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BitgoStatusMap=void 0;let types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js");exports.BitgoStatusMap={created:{mmStatus:types_1.MetaMaskTransactionStatuses.APPROVED,shortText:"Created",longText:"Created",finished:!1},signed:{mmStatus:types_1.MetaMaskTransactionStatuses.SIGNED,shortText:"Signed",longText:"Signed",finished:!1},submitted:{mmStatus:types_1.MetaMaskTransactionStatuses.SUBMITTED,shortText:"Submitted",longText:"Waiting for block",finished:!1},completed:{mmStatus:types_1.MetaMaskTransactionStatuses.CONFIRMED,shortText:"Mined",longText:"Mined",finished:!1},mined:{mmStatus:types_1.MetaMaskTransactionStatuses.CONFIRMED,shortText:"Mined",longText:"Mined",finished:!1},aborted:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Aborted",longText:"Aborted",finished:!0},rejected:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Aborted",longText:"Aborted",finished:!0},failed:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Failed",longText:"Failed",finished:!0}}},"./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/cactus/CactusCustodyKeyring.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CactusCustodyKeyring=void 0;let sdk_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/index.js"),types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js"),CustodyKeyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/CustodyKeyring.js"),CactusStatusMap_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/cactus/CactusStatusMap.js");class CactusCustodyKeyring extends CustodyKeyring_1.CustodyKeyring{constructor(opts={}){super(opts),this.type="Custody - Cactus",this.custodianType={name:"Cactus",displayName:"Cactus Custody",apiUrl:"https://api.mycactus.com/custody/v1/mmi-api",imgSrc:"https://dashboard.metamask-institutional.io/custodian-icons/cactus-icon.svg",iconUrl:"https://dashboard.metamask-institutional.io/custodian-icons/cactus-icon.svg",website:"https://www.mycactus.com",onboardingUrl:"https://www.mycactus.com",envName:"cactus",keyringClass:CactusCustodyKeyring,production:!0,hidden:!1,origins:[],environmentMapping:[{pattern:/^.*$/u,mmiApiUrl:"https://mmi.codefi.network/v1"},{pattern:/^https:\/\/api.mycactus.com/u,mmiApiUrl:"https://api.mmi-prod.codefi.network/v1"}]},this.authType=types_1.AuthTypes.REFRESH_TOKEN,this.sdkFactory=(authDetails,envName)=>(0,sdk_1.mmiSDKFactory)(sdk_1.CactusCustodianApi,authDetails,this.authType,this.custodianType.apiUrl),this.txDeepLink=async(_custodianDetails,_txId)=>({text:null,url:"https://www.mycactus.com/cactus/login"})}getStatusMap(){return CactusStatusMap_1.CactusStatusMap}}CactusCustodyKeyring.type="Custody - Cactus",exports.CactusCustodyKeyring=CactusCustodyKeyring},"./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/cactus/CactusStatusMap.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CactusStatusMap=void 0;let types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js");exports.CactusStatusMap={created:{mmStatus:types_1.MetaMaskTransactionStatuses.APPROVED,shortText:"Created",longText:"Created",finished:!1},approved:{mmStatus:types_1.MetaMaskTransactionStatuses.APPROVED,shortText:"Created",longText:"Created",finished:!1},submitted:{mmStatus:types_1.MetaMaskTransactionStatuses.SUBMITTED,shortText:"Submitted",longText:"Waiting for block",finished:!1},mined:{mmStatus:types_1.MetaMaskTransactionStatuses.CONFIRMED,shortText:"Mined",longText:"Mined",finished:!0},completed:{mmStatus:types_1.MetaMaskTransactionStatuses.CONFIRMED,shortText:"Completed",longText:"Completed",finished:!0},aborted:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Aborted",longText:"Aborted",finished:!0},rejected:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Rejected",longText:"Rejected",finished:!0},failed:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Failed",longText:"Failed",finished:!0},overriden:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Overriden",longText:"Overriden",finished:!0}}},"./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/eca3/ECA3CustodyKeyring.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ECA3CustodyKeyring=void 0;let sdk_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/index.js"),types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js"),CustodyKeyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/CustodyKeyring.js"),ECA3StatusMap_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/eca3/ECA3StatusMap.js");class ECA3CustodyKeyring extends CustodyKeyring_1.CustodyKeyring{constructor(opts={}){super(opts),this.type="Custody - ECA3",this.authType=types_1.AuthTypes.REFRESH_TOKEN,this.custodianType={name:"ECA3",displayName:"ECA3",apiUrl:"https://neptune-custody.codefi.network/eth",imgSrc:"https://backend.vistan-brillen.de/storage/files/images/marken/changeme/header/changeme-logo-header.jpg",iconUrl:"https://backend.vistan-brillen.de/storage/files/images/marken/changeme/header/changeme-logo-header.jpg",website:"https://neptune-custody-ui.metamask-institutional.io/",onboardingUrl:"https://neptune-custody-ui.metamask-institutional.io/",envName:"neptune-custody",keyringClass:ECA3CustodyKeyring,production:!1,hidden:!0,origins:[],environmentMapping:[]},this.sdkFactory=(authDetails,envName)=>{let{refreshTokenUrl,apiUrl}=this.getCustodianFromEnvName(envName);return authDetails.refreshTokenUrl=refreshTokenUrl,(0,sdk_1.mmiSDKFactory)(sdk_1.ECA3CustodianApi,authDetails,this.authType,apiUrl)},this.txDeepLink=async(address,txId)=>{let{authDetails,envName}=this.getAccountDetails(address),sdk=this.getSDK(authDetails,envName);try{return await sdk.getTransactionLink(txId)}catch(e){return console.log(`Unable to get transction link for ${txId}`),null}}}getStatusMap(){return ECA3StatusMap_1.ECA3StatusMap}}ECA3CustodyKeyring.type="Custody - ECA3",exports.ECA3CustodyKeyring=ECA3CustodyKeyring},"./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/eca3/ECA3StatusMap.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ECA3StatusMap=void 0;let types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js");exports.ECA3StatusMap={created:{mmStatus:types_1.MetaMaskTransactionStatuses.APPROVED,shortText:"Created",longText:"Created",finished:!1},signed:{mmStatus:types_1.MetaMaskTransactionStatuses.SIGNED,shortText:"Signed",longText:"Signed",finished:!1},submitted:{mmStatus:types_1.MetaMaskTransactionStatuses.SUBMITTED,shortText:"Submitted",longText:"Waiting for block",finished:!1},mined:{mmStatus:types_1.MetaMaskTransactionStatuses.CONFIRMED,shortText:"Mined",longText:"Mined",finished:!0},aborted:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Aborted",longText:"Aborted",finished:!0},rejected:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Aborted",longText:"Aborted",finished:!0},failed:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Failed",longText:"Failed",finished:!0},completed:{mmStatus:types_1.MetaMaskTransactionStatuses.CONFIRMED,shortText:"Mined",longText:"Mined",finished:!0}}},"./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CUSTODIAN_TYPES=void 0;let BitgoCustodyKeyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/bitgo/BitgoCustodyKeyring.js"),CactusCustodyKeyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/cactus/CactusCustodyKeyring.js"),ECA3CustodyKeyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/eca3/ECA3CustodyKeyring.js"),JsonRpcCustodyKeyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/json-rpc/JsonRpcCustodyKeyring.js");exports.CUSTODIAN_TYPES={CACTUS:{name:"Cactus",displayName:"Cactus Custody",apiUrl:"https://api.mycactus.com/custody/v1/mmi-api",imgSrc:"https://dashboard.metamask-institutional.io/custodian-icons/cactus-icon.svg",iconUrl:"https://dashboard.metamask-institutional.io/custodian-icons/cactus-icon.svg",website:"https://www.mycactus.com",onboardingUrl:"https://www.mycactus.com",envName:"cactus",keyringClass:CactusCustodyKeyring_1.CactusCustodyKeyring,production:!0,hidden:!1,origins:[],environmentMapping:[{pattern:/^.*$/u,mmiApiUrl:"https://mmi.codefi.network/v1"},{pattern:/^https:\/\/api.mycactus.com/u,mmiApiUrl:"https://api.mmi-prod.codefi.network/v1"}]},BITGO:{name:"Bitgo",displayName:"BitGo",apiUrl:"https://app.bitgo.com/defi/v2",imgSrc:"https://dashboard.metamask-institutional.io/custodian-icons/bitgo-icon.svg",iconUrl:"https://dashboard.metamask-institutional.io/custodian-icons/bitgo-icon.svg",website:"https://www.bitgo.com",onboardingUrl:"https://www.bitgo.com",envName:"bitgo",keyringClass:BitgoCustodyKeyring_1.BitgoCustodyKeyring,production:!0,hidden:!1,origins:[],environmentMapping:[{pattern:/^.*$/u,mmiApiUrl:"https://mmi.codefi.network/v1"},{pattern:/^https:\/\/app.bitgo-test.com/u,mmiApiUrl:"https://mmi.codefi.network/v1"},{pattern:/^https:\/\/app.bitgo.com/u,mmiApiUrl:"https://api.mmi-prod.codefi.network/v1"}]},JSONRPC:{name:"JSONRPC",displayName:"JSON-RPC",apiUrl:"https://saturn-custody.codefi.network/eth",imgSrc:"https://saturn-custody-ui.metamask-institutional.io/saturn.svg",iconUrl:"https://saturn-custody-ui.metamask-institutional.io/saturn.svg",website:"https://saturn-custody-ui.metamask-institutional.io/",onboardingUrl:"https://saturn-custody-ui.metamask-institutional.io/",envName:"saturn-prod",keyringClass:JsonRpcCustodyKeyring_1.JsonRpcCustodyKeyring,production:!1,hidden:!0,origins:[],environmentMapping:[]},ECA3:{name:"ECA3",displayName:"ECA3",apiUrl:"https://neptune-custody.codefi.network/eth",imgSrc:"https://backend.vistan-brillen.de/storage/files/images/marken/changeme/header/changeme-logo-header.jpg",iconUrl:"https://backend.vistan-brillen.de/storage/files/images/marken/changeme/header/changeme-logo-header.jpg",website:"https://neptune-custody-ui.metamask-institutional.io/",onboardingUrl:"https://neptune-custody-ui.metamask-institutional.io/",envName:"neptune-custody",keyringClass:ECA3CustodyKeyring_1.ECA3CustodyKeyring,production:!1,hidden:!0,origins:[],environmentMapping:[]}}},"./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/json-rpc/JsonRpcCustodyKeyring.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonRpcCustodyKeyring=void 0;let sdk_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/index.js"),types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js"),CustodyKeyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/CustodyKeyring.js"),JsonRpcStatusMap_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/json-rpc/JsonRpcStatusMap.js");class JsonRpcCustodyKeyring extends CustodyKeyring_1.CustodyKeyring{constructor(opts={}){super(opts),this.type="Custody - JSONRPC",this.authType=types_1.AuthTypes.REFRESH_TOKEN,this.custodianType={name:"JSONRPC",displayName:"JSON-RPC",apiUrl:"https://saturn-custody.codefi.network/eth",imgSrc:"https://saturn-custody-ui.metamask-institutional.io/saturn.svg",iconUrl:"https://saturn-custody-ui.metamask-institutional.io/saturn.svg",website:"https://saturn-custody-ui.metamask-institutional.io/",onboardingUrl:"https://saturn-custody-ui.metamask-institutional.io/",envName:"saturn-prod",keyringClass:JsonRpcCustodyKeyring,production:!1,hidden:!0,origins:[],environmentMapping:[]},this.sdkFactory=(authDetails,envName)=>{let{refreshTokenUrl,apiUrl}=this.getCustodianFromEnvName(envName);return authDetails.refreshTokenUrl=refreshTokenUrl,(0,sdk_1.mmiSDKFactory)(sdk_1.JsonRpcCustodianApi,authDetails,this.authType,apiUrl)},this.txDeepLink=async(address,txId)=>{let{authDetails,envName}=this.getAccountDetails(address),sdk=this.getSDK(authDetails,envName);try{return await sdk.getTransactionLink(txId)}catch(e){return console.log(`Unable to get transction link for ${txId}`),null}}}getStatusMap(){return JsonRpcStatusMap_1.JsonRpcStatusMap}}JsonRpcCustodyKeyring.type="Custody - JSONRPC",exports.JsonRpcCustodyKeyring=JsonRpcCustodyKeyring},"./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/json-rpc/JsonRpcStatusMap.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonRpcStatusMap=void 0;let types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js");exports.JsonRpcStatusMap={created:{mmStatus:types_1.MetaMaskTransactionStatuses.APPROVED,shortText:"Created",longText:"Created",finished:!1},signed:{mmStatus:types_1.MetaMaskTransactionStatuses.SIGNED,shortText:"Signed",longText:"Signed",finished:!1},submitted:{mmStatus:types_1.MetaMaskTransactionStatuses.SUBMITTED,shortText:"Submitted",longText:"Waiting for block",finished:!1},mined:{mmStatus:types_1.MetaMaskTransactionStatuses.CONFIRMED,shortText:"Mined",longText:"Mined",finished:!0},aborted:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Aborted",longText:"Aborted",finished:!0},rejected:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Aborted",longText:"Aborted",finished:!0},failed:{mmStatus:types_1.MetaMaskTransactionStatuses.FAILED,shortText:"Failed",longText:"Failed",finished:!0},completed:{mmStatus:types_1.MetaMaskTransactionStatuses.CONFIRMED,shortText:"Mined",longText:"Mined",finished:!0}}},"./node_modules/@metamask-institutional/custody-keyring/dist/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonRpcCustodyKeyring=exports.IMmiConfigurationControllerOptions=exports.MmiConfigurationController=exports.CustodyKeyring=exports.CUSTODIAN_TYPES=void 0;var custodianTypes_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/index.js");Object.defineProperty(exports,"CUSTODIAN_TYPES",{enumerable:!0,get:function(){return custodianTypes_1.CUSTODIAN_TYPES}});var CustodyKeyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/CustodyKeyring.js");Object.defineProperty(exports,"CustodyKeyring",{enumerable:!0,get:function(){return CustodyKeyring_1.CustodyKeyring}});var MmiConfiguration_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/MmiConfiguration.js");Object.defineProperty(exports,"MmiConfigurationController",{enumerable:!0,get:function(){return MmiConfiguration_1.MmiConfigurationController}});var IMmiConfigurationControllerOptions_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/interfaces/IMmiConfigurationControllerOptions.js");Object.defineProperty(exports,"IMmiConfigurationControllerOptions",{enumerable:!0,get:function(){return IMmiConfigurationControllerOptions_1.IMmiConfigurationControllerOptions}});var JsonRpcCustodyKeyring_1=__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/custodianTypes/json-rpc/JsonRpcCustodyKeyring.js");Object.defineProperty(exports,"JsonRpcCustodyKeyring",{enumerable:!0,get:function(){return JsonRpcCustodyKeyring_1.JsonRpcCustodyKeyring}})},"./node_modules/@metamask-institutional/custody-keyring/dist/interfaces/IMmiConfigurationControllerOptions.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IMmiConfigurationControllerOptions=void 0,exports.IMmiConfigurationControllerOptions=class{}},"./node_modules/@metamask-institutional/custody-keyring/dist/migrations/001.js":function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __importDefault=this&&this.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0});let types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js"),lodash_clonedeep_1=__importDefault(__webpack_require__("./node_modules/lodash.clonedeep/index.js")),keyringTypesToChange=[];function transformKeyring(keyring){delete keyring.jwt,delete keyring.token;let defaultApiUrl=keyring.custodianType.apiUrl;return keyring.accountsDetails=keyring.accountsDetails.map(details=>{var _a,_b;return{name:details.name,address:details.address,custodianDetails:details.custodianDetails,labels:details.labels,apiUrl:details.apiUrl||defaultApiUrl,chainId:details.chainId,custodyType:details.custodyType,authDetails:keyring.authType===types_1.AuthTypes.REFRESH_TOKEN?{refreshToken:details.jwt||details.token||(null===(_a=details.authDetails)||void 0===_a?void 0:_a.refreshToken)}:{jwt:details.jwt||details.token||(null===(_b=details.authDetails)||void 0===_b?void 0:_b.jwt)}}}),keyring}exports.default={version:1,keyringTypesToChange,migrate(keyring){var _a;let versionedKeyring={};return keyringTypesToChange.includes(keyring.type)&&(null===(_a=(versionedKeyring=(0,lodash_clonedeep_1.default)(keyring)).meta)||void 0===_a?void 0:_a.version)!==1&&(versionedKeyring.meta={version:1},versionedKeyring=transformKeyring(versionedKeyring)),versionedKeyring||keyring}}},"./node_modules/@metamask-institutional/custody-keyring/dist/migrations/index.js":function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __importDefault=this&&this.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.migrations=void 0;let _001_1=__importDefault(__webpack_require__("./node_modules/@metamask-institutional/custody-keyring/dist/migrations/001.js"));exports.migrations=[_001_1.default]},"./node_modules/@metamask-institutional/custody-keyring/dist/migrations/migrator.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Migrator=void 0;let events_1=__webpack_require__("./node_modules/events/events.js");class Migrator extends events_1.EventEmitter{constructor(opts){super();let migrations=(null==opts?void 0:opts.migrations)||[];this.migrations=migrations.sort((a,b)=>a.version-b.version);let lastMigration=this.migrations.slice(-1)[0];this.defaultVersion=opts.defaultVersion||lastMigration&&lastMigration.version||0}migrateData(versionedKeyring=this.generateInitialState()){for(let migration of this.migrations.filter(migration=>migration.keyringTypesToChange.includes(versionedKeyring.type)&&(!versionedKeyring.meta||versionedKeyring.meta.version<migration.version)))try{let migratedKeyring=migration.migrate(versionedKeyring);if(!migratedKeyring.meta)throw Error("MMI Migrator - migration returned empty meta");if(migratedKeyring.meta.version!==migration.version)throw Error("MMI Migrator - Migration did not update version number correctly");versionedKeyring=migratedKeyring}catch(err){let originalErrorMessage=err.message;err.message=`MetaMask Institutional Migration Error #${migration.version}: ${originalErrorMessage}`,this.emit("error",err);break}return versionedKeyring}generateInitialState(data){return{meta:{version:this.defaultVersion},data}}}exports.Migrator=Migrator},"./node_modules/@metamask-institutional/extension/dist/ExtensionUtils.js":function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __importDefault=this&&this.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.handleTxStatusUpdate=exports.getTxByCustodyId=exports.showCustodianDeepLink=exports.custodianEventHandlerFactory=exports.updateCustodianTransactions=void 0;let custody_controller_1=__webpack_require__("./node_modules/@metamask-institutional/custody-controller/dist/index.js"),sdk_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/index.js"),types_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/index.js"),lodash_clonedeep_1=__importDefault(__webpack_require__("./node_modules/lodash.clonedeep/index.js")),TRANSACTION_EVENTS={[types_1.MetaMaskTransactionStatuses.ADDED]:"Transaction Added",[types_1.MetaMaskTransactionStatuses.APPROVED]:"Transaction Approved",[types_1.MetaMaskTransactionStatuses.SIGNED]:"Transaction Signed",[types_1.MetaMaskTransactionStatuses.REJECTED]:"Transaction Rejected",[types_1.MetaMaskTransactionStatuses.FAILED]:"Transaction Failed",[types_1.MetaMaskTransactionStatuses.SUBMITTED]:"Transaction Submitted",[types_1.MetaMaskTransactionStatuses.CONFIRMED]:"Transaction Confirmed",[types_1.MetaMaskTransactionStatuses.UNAPPROVED]:"Transaction Unapproved",[types_1.MetaMaskTransactionStatuses.DROPPED]:"Transaction Dropped",[types_1.MetaMaskTransactionStatuses.FINALIZED]:"Transaction Finalized"};async function updateCustodianTransactions({keyring,type,txList,custodyController,transactionUpdateController,txStateManager,getPendingNonce,setTxHash}){let txStatusMap=keyring.getStatusMap();await Promise.all(txList.map(async tx=>{var _a;if(tx.custodyId&&!(tx.custodyStatus&&(null===(_a=txStatusMap[tx.custodyStatus])||void 0===_a?void 0:_a.finished))){if(custodyController.getCustodyTypeByAddress((0,custody_controller_1.toChecksumHexAddress)(tx.txParams.from))!==type)return;let custodyTx=await keyring.getTransaction(tx.txParams.from,tx.custodyId);if(null===custodyTx)return;let status=(0,sdk_1.mapTransactionStatus)(custodyTx.transactionStatus),updateEvent={transaction:{id:custodyTx.custodian_transactionId,hash:custodyTx.transactionHash,status,from:custodyTx.from,gasPrice:custodyTx.gasPrice,nonce:custodyTx.nonce,to:custodyTx.to,value:custodyTx.value,data:custodyTx.data,gas:custodyTx.gasLimit,type:null},metadata:null};await handleTxStatusUpdate(updateEvent,txStateManager,getPendingNonce,setTxHash),status.finished||transactionUpdateController.addTransactionToWatchList(custodyTx.custodian_transactionId,custodyTx.from,null,!1)}})),custodyController.storeCustodyStatusMap(keyring.type.split(" - ")[1],txStatusMap)}function custodianEventHandlerFactory({getState,log,getPendingNonce,setTxHash,signatureController,txStateManager,custodyController,trackTransactionEvent,captureException}){return async txData=>{let address;if(Object.hasOwnProperty.call(txData,"transaction")&&null!==txData.transaction&&Object.hasOwnProperty.call(txData.transaction,"from")?address=txData.transaction.from:Object.hasOwnProperty.call(txData,"signedMessage")&&null!==txData.signedMessage&&Object.hasOwnProperty.call(txData.signedMessage,"address")&&(address=txData.signedMessage.address),!custodyController.getCustodyTypeByAddress((0,custody_controller_1.toChecksumHexAddress)(address)))return log.info(`Got an update for an address I do not own: ${address}`),getState();if(!Object.hasOwnProperty.call(txData,"signedMessage")&&!txData.transaction)return getState();if(Object.hasOwnProperty.call(txData,"signedMessage")&&null!==txData.signedMessage){console.log("Update for message:",txData.signedMessage.id,txData.signedMessage.status),txData.signedMessage.signature&&custodyController.setWaitForConfirmDeepLinkDialog(!1);let allMessages=signatureController.messages,filteredItem=Object.keys(allMessages).map(key=>allMessages[key]).find(item=>{var _a;return(null===(_a=item.metadata)||void 0===_a?void 0:_a.custodian_transactionId)===txData.signedMessage.id});if(!filteredItem)return;let messageId=filteredItem.id;return txData.signedMessage.signature&&"0x"!=txData.signedMessage.signature?signatureController.setDeferredSignSuccess(messageId,txData.signedMessage.signature):txData.signedMessage.status.finished&&!txData.signedMessage.status.success?signatureController.setDeferredSignError(messageId):void 0}console.log("Update for transaction: ",txData.transaction.id,txData.transaction.status);let txMeta=await handleTxStatusUpdate(txData,txStateManager,getPendingNonce,setTxHash);if(txMeta){if(TRANSACTION_EVENTS[txMeta.status])try{trackTransactionEvent(txMeta,TRANSACTION_EVENTS[txMeta.status])}catch(error){log.error(error),captureException(error)}console.log("custodianEventHandler finished, txMeta:",txMeta)}}}async function showCustodianDeepLink({dispatch,mmiActions,txId,fromAddress,closeNotification,isSignature,custodyId,onDeepLinkFetched,onDeepLinkShown,showCustodyConfirmLink}){let deepLink;let custodianTxId=custodyId;if(isSignature)deepLink=await dispatch(mmiActions.getCustodianSignMessageDeepLink(fromAddress,custodyId));else{let result=await dispatch(mmiActions.getCustodianConfirmDeepLink(txId));deepLink=result.deepLink,custodianTxId=result.custodyId}onDeepLinkFetched();try{await dispatch(showCustodyConfirmLink({link:deepLink,address:fromAddress,closeNotification:closeNotification,custodyId:custodianTxId})),dispatch(mmiActions.setWaitForConfirmDeepLinkDialog(!0)),onDeepLinkShown()}catch(e){dispatch(mmiActions.setWaitForConfirmDeepLinkDialog(!1))}}function getTxByCustodyId(getTransactions,txCustodyId){let found=getTransactions({searchCriteria:{custodyId:txCustodyId}});if(found.length)return found[0]}async function handleTxStatusUpdate(txData,txStateManager,getPendingNonce,setTxHash){var _a;let txMeta=getTxByCustodyId(({searchCriteria})=>txStateManager.getTransactions({searchCriteria}),txData.transaction.id);if(txMeta){let mutableTxMeta=(0,lodash_clonedeep_1.default)(txMeta);if(mutableTxMeta.custodyStatus=txData.transaction.status.displayText.toLowerCase(),mutableTxMeta.custodyStatusDisplayText=null===(_a=txData.transaction)||void 0===_a?void 0:_a.status.displayText,txData.transaction.hash&&(!mutableTxMeta.hash||"0x"===mutableTxMeta.hash)&&(setTxHash(mutableTxMeta.id,txData.transaction.hash),mutableTxMeta.hash=txData.transaction.hash),txStateManager.updateTransaction(mutableTxMeta,"Updated custody transaction status."),txData.transaction.status.signed&&!txData.transaction.status.finished&&mutableTxMeta.status!==types_1.MetaMaskTransactionStatuses.SIGNED&&mutableTxMeta.status!==types_1.MetaMaskTransactionStatuses.SUBMITTED&&mutableTxMeta.status!==types_1.MetaMaskTransactionStatuses.CONFIRMED&&mutableTxMeta.status!==types_1.MetaMaskTransactionStatuses.FAILED&&(txStateManager.setTxStatusSigned(mutableTxMeta.id),mutableTxMeta.status=mutableTxMeta.custodyStatus),!mutableTxMeta.txParams.nonce||txData.transaction.nonce&&Number(mutableTxMeta.txParams.nonce)!==Number(txData.transaction.nonce)){let nonce="0x"+(parseInt(txData.transaction.nonce)||await getPendingNonce(txData.transaction.from)).toString(16),newTxParams=await {...mutableTxMeta.txParams,nonce};mutableTxMeta.txParams=newTxParams}let looksLikeFinalUpdate=txData.transaction.status.finished&&txData.transaction.status.success&&mutableTxMeta.status!==types_1.MetaMaskTransactionStatuses.CONFIRMED,looksLikeRealSubmission=txData.transaction.status.submitted&&mutableTxMeta.status!==types_1.MetaMaskTransactionStatuses.CONFIRMED;if(looksLikeFinalUpdate||looksLikeRealSubmission)txStateManager.setTxStatusSubmitted(mutableTxMeta.id),mutableTxMeta.custodyStatus===types_1.MetaMaskTransactionStatuses.SUBMITTED&&(mutableTxMeta.status=mutableTxMeta.custodyStatus);else if(txData.transaction.status.finished&&!txData.transaction.status.success){let message=`Transaction status from custodian: ${mutableTxMeta.custodyStatusDisplayText}`;txData.transaction.status.reason&&(message=txData.transaction.status.reason),txStateManager.setTxStatusFailed(mutableTxMeta.id,message),mutableTxMeta.status=mutableTxMeta.custodyStatus}return txStateManager.updateTransaction(mutableTxMeta,"Updated custody transaction status."),mutableTxMeta}return null}exports.updateCustodianTransactions=updateCustodianTransactions,exports.custodianEventHandlerFactory=custodianEventHandlerFactory,exports.showCustodianDeepLink=showCustodianDeepLink,exports.getTxByCustodyId=getTxByCustodyId,exports.handleTxStatusUpdate=handleTxStatusUpdate},"./node_modules/@metamask-institutional/extension/dist/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";exports.ep=void 0;var ExtensionUtils_1=__webpack_require__("./node_modules/@metamask-institutional/extension/dist/ExtensionUtils.js");Object.defineProperty(exports,"ep",{enumerable:!0,get:function(){return ExtensionUtils_1.showCustodianDeepLink}})},"./node_modules/@metamask-institutional/sdk/dist/classes/AccountHierarchyNode.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ETHEREUM_ACCOUNT=exports.WALLET=exports.ORGANIZATION=exports.ROOT_NAME=exports.ROOT=exports.AccountHierarchyNode=void 0,exports.AccountHierarchyNode=class{constructor(type,id,name,parent=null){this.type=type,this.name=name,this.id=id,this.parent=parent,this.children=[]}serialize(){return this.removeParents(),this}removeParents(){this.parent=void 0,this.children.length&&this.children.forEach(child=>child.removeParents())}findItemWithId(id){if(this.id===id)return this;for(let child of this.children){let found=child.findItemWithId(id);if(found)return found}return null}getEthereumAccounts(stack=[]){for(let child of(this.account&&stack.push(this.account),this.children))child.getEthereumAccounts(stack);return stack}},exports.ROOT="root",exports.ROOT_NAME="Root account node",exports.ORGANIZATION="organization",exports.WALLET="wallet",exports.ETHEREUM_ACCOUNT="ethereum-account"},"./node_modules/@metamask-institutional/sdk/dist/classes/MMISDK.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MMISDK=void 0;let simplecache_1=__webpack_require__("./node_modules/@metamask-institutional/simplecache/dist/index.js"),events_1=__webpack_require__("./node_modules/events/events.js"),constants_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/constants/constants.js");class MMISDK extends events_1.EventEmitter{constructor(custodianApi,authDetails,authType,apiUrl,defaultCacheAgeSeconds=-1){super(),this.defaultCacheAgeSeconds=defaultCacheAgeSeconds,this.cache=new simplecache_1.SimpleCache,this.custodianApi=new custodianApi(authDetails,authType,apiUrl,defaultCacheAgeSeconds),this.custodianApi.on(constants_1.REFRESH_TOKEN_CHANGE_EVENT,event=>{this.emit(constants_1.REFRESH_TOKEN_CHANGE_EVENT,event)}),this.custodianApi.on(constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,event=>{this.emit(constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,event)}),this.custodianApi.on(constants_1.API_REQUEST_LOG_EVENT,event=>{this.emit(constants_1.API_REQUEST_LOG_EVENT,event)})}changeRefreshTokenAuthDetails(authDetails){this.custodianApi.changeRefreshTokenAuthDetails(authDetails)}getAccountHierarchy(){return this.custodianApi.getAccountHierarchy()}async getListAccountsSigned(){return this.custodianApi.getListAccountsSigned()}async getEthereumAccounts(maxCacheAgeSeconds=this.defaultCacheAgeSeconds){return console.log("GetEthereumAccounts MMI SDK"),this.cache.tryCachingArray("getEthereumAccounts",maxCacheAgeSeconds,async()=>await this.custodianApi.getEthereumAccounts())}async getEthereumAccountsByAddress(address,maxCacheAgeSeconds=this.defaultCacheAgeSeconds){return this.cache.tryCachingArray("getEthereumAccountsByAddress-"+address,maxCacheAgeSeconds,async()=>await this.custodianApi.getEthereumAccountsByAddress(address))}async getEthereumAccountsByLabelOrAddressName(name,maxCacheAgeSeconds=this.defaultCacheAgeSeconds){return this.cache.tryCachingArray("getEthereumAccountsByLabelOrAddressName-"+name,maxCacheAgeSeconds,async()=>await this.custodianApi.getEthereumAccountsByLabelOrAddressName(name))}async createTransaction(txParams,txMeta){return await this.custodianApi.createTransaction(txParams,txMeta)}async replaceTransaction(txParams){return await this.custodianApi.replaceTransaction(txParams)}getTransaction(from,transactionId){return this.custodianApi.getTransaction(from,transactionId)}getAllTransactions(){return this.custodianApi.getAllTransactions()}getCustomerId(){return this.custodianApi.getCustomerId()}async signedTypedData_v4(address,data,version,signedTypedMessageMetadata){return await this.custodianApi.signTypedData_v4(address,data,version,signedTypedMessageMetadata)}async signPersonalMessage(address,message,signedMessageMetadata){return await this.custodianApi.signPersonalMessage(address,message,signedMessageMetadata)}async getSignature(address,signatureId){return this.custodianApi.getSignedMessage(address,signatureId)}async getCustomerProof(){return this.custodianApi.getCustomerProof()}async getErc20Tokens(){return this.custodianApi.getErc20Tokens()}async getSupportedChains(address){return this.custodianApi.getSupportedChains(address)}async getTransactionLink(transactionId){return this.custodianApi.getTransactionLink(transactionId)}}exports.MMISDK=MMISDK},"./node_modules/@metamask-institutional/sdk/dist/constants/constants.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.API_REQUEST_LOG_EVENT=exports.DEFAULT_MAX_CACHE_AGE=exports.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT=exports.REFRESH_TOKEN_CHANGE_EVENT=void 0,exports.REFRESH_TOKEN_CHANGE_EVENT="refresh_token_change",exports.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT="interactive_replacement_token_change",exports.DEFAULT_MAX_CACHE_AGE=60,exports.API_REQUEST_LOG_EVENT="API_REQUEST_LOG_EVENT"},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/bitgo/BitgoClient.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BitgoClient=void 0;let handle_response_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/util/handle-response.js");exports.BitgoClient=class{constructor(apiUrl,jwt){this.bitgoApiurl=apiUrl,this.jwt=jwt}getHeaders(){return{"Content-Type":"application/json",Authorization:`Bearer ${this.jwt}`}}async getEthereumAccounts(){let headers=this.getHeaders(),response=await fetch(`${this.bitgoApiurl}/wallets`,{headers});return(await (0,handle_response_1.handleResponse)(response,"Error fetching wallet accounts")).data}async getEthereumAccountByAddress(address){let headers=this.getHeaders(),response=await fetch(`${this.bitgoApiurl}/mmi/wallets/address/${address}`,{headers}),contextErrorMessage=`Error fetching account for address ${address}`,accounts=await (0,handle_response_1.handleResponse)(response,contextErrorMessage);return accounts.data.length?accounts.data[0]:null}async createTransaction(bitgoTxDetails,txParams){let headers=this.getHeaders();"0"===txParams.type||"1"===txParams.type?txParams.gasPrice=txParams.gasPrice:"2"===txParams.type&&(txParams.maxPriorityFeePerGas=txParams.maxPriorityFeePerGas,txParams.maxFeePerGas=txParams.maxFeePerGas);let response=await fetch(`${this.bitgoApiurl}/mmi/${bitgoTxDetails.coinId}/wallet/${bitgoTxDetails.walletId}/tx/build`,{method:"POST",headers,body:JSON.stringify({txParams})});return(await (0,handle_response_1.handleResponse)(response,"Error creating transaction")).data}async getTransaction(custodian_transactionId){let headers=this.getHeaders(),response=await fetch(`${this.bitgoApiurl}/mmi/wallets/transactions/${custodian_transactionId}`,{headers}),contextErrorMessage=`Error getting transaction with id ${custodian_transactionId}`;return(await (0,handle_response_1.handleResponse)(response,contextErrorMessage)).data[0]}async getTransactions(){let headers=this.getHeaders(),response=await fetch(`${this.bitgoApiurl}/custodian/transaction`,{headers});return(await (0,handle_response_1.handleResponse)(response,"Error getting transactions")).data}async getCustomerProof(){let headers=this.getHeaders(),response=await fetch(`${this.bitgoApiurl}/mmi/customer-proof`,{method:"POST",headers,body:JSON.stringify({version:"n/a"})});return await (0,handle_response_1.handleResponse)(response,"Error getting Customer Proof")}async signTypedData_v4(fromAddress,message,coinId,walletId,version){let headers=await this.getHeaders(),response=await fetch(`${this.bitgoApiurl}/mmi/${coinId}/wallet/${walletId}/messages/typed`,{method:"POST",body:JSON.stringify({address:fromAddress,payload:message,encodingVersion:version||"v4"}),headers}),contextErrorMessage=`Error doing signTypedData from address: ${fromAddress}`;return await (0,handle_response_1.handleResponse)(response,contextErrorMessage)}async signPersonalMessage(fromAddress,message,coinId,walletId){let headers=await this.getHeaders(),response=await fetch(`${this.bitgoApiurl}/mmi/${coinId}/wallet/${walletId}/messages/personal`,{method:"POST",body:JSON.stringify({address:fromAddress,message}),headers}),contextErrorMessage=`Error doing signPersonalMessage from address: ${fromAddress}`;return await (0,handle_response_1.handleResponse)(response,contextErrorMessage)}async getSignedMessage(custodian_signedMessageId,coinId,walletId){let headers=await this.getHeaders(),response=await fetch(`${this.bitgoApiurl}/mmi/${coinId}/wallet/${walletId}/messages/${custodian_signedMessageId}`,{headers}),contextErrorMessage=`Error getting signed message with id ${custodian_signedMessageId}`;return await (0,handle_response_1.handleResponse)(response,contextErrorMessage)}}},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/bitgo/BitgoCustodianApi.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BitgoCustodianApi=void 0;let events_1=__webpack_require__("./node_modules/events/events.js"),BitgoClient_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/bitgo/BitgoClient.js"),DefaultBitgoCustodianDetails_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/bitgo/DefaultBitgoCustodianDetails.js");class BitgoCustodianApi extends events_1.EventEmitter{constructor(authDetails,_authType,apiUrl=DefaultBitgoCustodianDetails_1.DefaultBitgoCustodianDetails.apiUrl,_cacheAge){super(),this._cacheAge=_cacheAge,this.integrationVersion=1;let{jwt}=authDetails;this.client=new BitgoClient_1.BitgoClient(apiUrl,jwt),this.jwt=jwt}getAccountHierarchy(){return null}async getEthereumAccounts(chainId){let mappedAccounts=(await this.client.getEthereumAccounts()).map(account=>{var _a;return{name:(null===(_a=account.labels.find(label=>"Wallet Name"===label.key))||void 0===_a?void 0:_a.value)||"Unnamed Bitgo Wallet",address:account.address,balance:account.balance,custodianDetails:{accountId:account.custodianDetails.id,coinId:account.custodianDetails.coin},chainId:account.chainId,labels:account.labels.filter(label=>"Wallet Name"!==label.key)}});return chainId?mappedAccounts.filter(account=>account.chainId===chainId):mappedAccounts}async getEthereumAccountsByAddress(address){return(await this.getEthereumAccounts()).filter(account=>account.address.toLowerCase().includes(address.toLowerCase()))}async getEthereumAccountsByLabelOrAddressName(name){return(await this.getEthereumAccounts()).filter(account=>account.name.includes(name))}async createTransaction(txParams){let fromAddress=txParams.from,accounts=await this.getEthereumAccountsByAddress(fromAddress);if(!accounts.length)throw Error("No such ethereum account!");let walletId=accounts[0].custodianDetails.accountId,coinId=accounts[0].custodianDetails.coinId;txParams.gasLimit=(Number(txParams.gasLimit)+1e5).toString();let result=await this.client.createTransaction({walletId,coinId},txParams);return{transactionStatus:result.transactionStatus,custodian_transactionId:result.custodianTransactionId,from:result.from,gasLimit:result.gasLimit,gasPrice:result.gasPrice,maxFeePerGas:result.maxFeePerGas,maxPriorityFeePerGas:result.maxFeePerGas,nonce:result.nonce,transactionHash:result.transactionHash}}async getTransaction(_from,custodian_transactionId){let result=await this.client.getTransaction(custodian_transactionId);return{transactionStatus:result.transactionStatus,custodian_transactionId:result.custodianTransactionId,from:result.from,gasLimit:result.gasLimit,gasPrice:result.gasPrice,maxFeePerGas:result.maxFeePerGas,maxPriorityFeePerGas:result.maxPriorityFeePerGas,nonce:result.nonce,transactionHash:result.transactionHash}}async getCustomerId(){return"bitgo-customer"}async getAllTransactions(){return(await this.client.getTransactions()).map(result=>({transactionStatus:result.transactionStatus,custodian_transactionId:result.custodianTransactionId,from:result.from,gasLimit:result.gasLimit,gasPrice:result.gasPrice,maxFeePerGas:result.maxFeePerGas,maxPriorityFeePerGas:result.maxPriorityFeePerGas,nonce:result.nonce,transactionHash:result.transactionHash}))}async getCustomerProof(){let{data}=await this.client.getCustomerProof();return data}async getErc20Tokens(){return{}}async getSupportedChains(address){let account=await this.client.getEthereumAccountByAddress(address);return account?[account.chainId.toString()]:[]}async getTransactionLink(_transactionId){return null}changeRefreshTokenAuthDetails(authDetails){throw Error("BitGo does not support refresh tokens")}async getSignedMessage(address,custodian_signedMessageId){let accounts=await this.getEthereumAccountsByAddress(address);if(!accounts.length)throw Error("No such ethereum account!");let walletId=accounts[0].custodianDetails.accountId,coinId=accounts[0].custodianDetails.coinId,result=await this.client.getSignedMessage(custodian_signedMessageId,coinId,walletId);return result?{id:result.data.id,signature:result.data.signature,status:result.data.status}:null}async signTypedData_v4(address,message,version){let accounts=await this.getEthereumAccountsByAddress(address);if(!accounts.length)throw Error("No such ethereum account!");let walletId=accounts[0].custodianDetails.accountId,coinId=accounts[0].custodianDetails.coinId;return{custodian_transactionId:(await this.client.signTypedData_v4(address,message,coinId,walletId,version)).data.id,transactionStatus:"created",from:address}}async signPersonalMessage(address,message){let accounts=await this.getEthereumAccountsByAddress(address);if(!accounts.length)throw Error("No such ethereum account!");let walletId=accounts[0].custodianDetails.accountId,coinId=accounts[0].custodianDetails.coinId;return{custodian_transactionId:(await this.client.signPersonalMessage(address,message,coinId,walletId)).data.id,transactionStatus:"created",from:address}}}exports.BitgoCustodianApi=BitgoCustodianApi},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/bitgo/DefaultBitgoCustodianDetails.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DefaultBitgoCustodianDetails=void 0,exports.DefaultBitgoCustodianDetails={apiUrl:"https://app.bitgo.com/defi/v2"}},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/cactus/CactusClient.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CactusClient=void 0;let simplecache_1=__webpack_require__("./node_modules/@metamask-institutional/simplecache/dist/index.js"),handle_response_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/util/handle-response.js");exports.CactusClient=class{constructor(apiUrl,refreshToken){this.apiUrl=apiUrl,this.refreshToken=refreshToken,this.cache=new simplecache_1.SimpleCache}async getHeaders(){let accessToken=await this.cache.tryCachingArray("accessToken",7200,async()=>this.getAccessToken());return{"Content-Type":"application/json",Authorization:`Bearer ${accessToken}`}}async getAccessToken(){let response=await fetch(`${this.apiUrl}/tokens`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grantType:"refresh_token",refreshToken:this.refreshToken})}),data=await (0,handle_response_1.handleResponse)(response,"Error fetching the access token");if(!data.jwt)throw Error("No access token");return data.jwt}async getEthereumAccounts(){let headers=await this.getHeaders(),response=await fetch(`${this.apiUrl}/eth-accounts`,{headers});return await (0,handle_response_1.handleResponse)(response,"Error fetching accounts")}async createTransaction(cactusTxDetails,txParams){let headers=await this.getHeaders(),payload={to:txParams.to,from:txParams.from,value:txParams.value,data:txParams.data,gasLimit:txParams.gasLimit,note:cactusTxDetails.note};"0"===txParams.type||"1"===txParams.type?payload.gasPrice=txParams.gasPrice:"2"===txParams.type&&(payload.maxPriorityFeePerGas=txParams.maxPriorityFeePerGas,payload.maxFeePerGas=txParams.maxFeePerGas);let response=await fetch(`${this.apiUrl}/transactions?chainId=${cactusTxDetails.chainId}`,{method:"POST",body:JSON.stringify(payload),headers});return await (0,handle_response_1.handleResponse)(response,"Error creating transaction")}async getSignedMessage(custodian_signedMessageId){let headers=await this.getHeaders(),response=await fetch(`${this.apiUrl}/signatures?transactionId=${custodian_signedMessageId}`,{headers}),contextErrorMessage=`Error getting signed message with id ${custodian_signedMessageId}`,data=await (0,handle_response_1.handleResponse)(response,contextErrorMessage);return data.length?data[0]:null}async getTransaction(custodian_transactionId){let headers=await this.getHeaders(),response=await fetch(`${this.apiUrl}/transactions?transactionId=${custodian_transactionId}`,{headers}),contextErrorMessage=`Error getting transaction with id ${custodian_transactionId}`,data=await (0,handle_response_1.handleResponse)(response,contextErrorMessage);return data.length?data[0]:null}async getTransactions(chainId){let headers=await this.getHeaders(),response=await fetch(`${this.apiUrl}/transactions?chainId=${chainId}`,{headers}),contextErrorMessage=`Error getting transactions with chainId ${chainId}`;return await (0,handle_response_1.handleResponse)(response,contextErrorMessage)}async getCustomerProof(){let headers=await this.getHeaders(),response=await fetch(`${this.apiUrl}/customer-proof`,{method:"POST",headers,body:JSON.stringify({})});return await (0,handle_response_1.handleResponse)(response,"Error getting Custommer Proof")}async signTypedData_v4(fromAddress,message,signatureVersion,chainId){let headers=await this.getHeaders(),url=`${this.apiUrl}/signatures`;chainId&&(url+=`?chainId=${chainId}`);let response=await fetch(url,{method:"POST",body:JSON.stringify({address:fromAddress,payload:message,signatureVersion}),headers}),contextErrorMessage=`Error doing signTypedData from address: ${fromAddress}`;return await (0,handle_response_1.handleResponse)(response,contextErrorMessage)}async signPersonalMessage(fromAddress,message){let headers=await this.getHeaders(),response=await fetch(`${this.apiUrl}/signatures`,{method:"POST",body:JSON.stringify({address:fromAddress,payload:{message},signatureVersion:"personalSign"}),headers}),contextErrorMessage=`Error doing signPersonalMessage from address: ${fromAddress}`;return await (0,handle_response_1.handleResponse)(response,contextErrorMessage)}async getChainIds(){let headers=await this.getHeaders(),response=await fetch(`${this.apiUrl}/chainIds`,{headers});return await (0,handle_response_1.handleResponse)(response,"Error getting chainIds")}}},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/cactus/CactusCustodianApi.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CactusCustodianApi=void 0;let simplecache_1=__webpack_require__("./node_modules/@metamask-institutional/simplecache/dist/index.js"),events_1=__webpack_require__("./node_modules/events/events.js"),map_status_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/util/map-status.js"),CactusClient_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/cactus/CactusClient.js"),DefaultCactusCustodianDetails_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/cactus/DefaultCactusCustodianDetails.js");class CactusCustodianApi extends events_1.EventEmitter{constructor(authDetails,_authType,apiUrl=DefaultCactusCustodianDetails_1.DefaultCactusCustodianDetails.apiUrl,cacheAge){super(),this.cacheAge=cacheAge,this.cache=new simplecache_1.SimpleCache,this.integrationVersion=1,this.client=new CactusClient_1.CactusClient(apiUrl,authDetails.refreshToken)}getAccountHierarchy(){return null}async getEthereumAccounts(){return(await this.client.getEthereumAccounts()).map(account=>({name:account.name||"Cactus wallet",address:account.address,balance:account.balance,custodianDetails:{walletId:account.custodianDetails.walletId,chainId:account.chainId},labels:account.labels?account.labels.map(label=>({key:"label",value:label})):[]}))}async getEthereumAccountsByAddress(address){return(await this.getEthereumAccounts()).filter(account=>account.address.toLowerCase().includes(address.toLowerCase()))}async getEthereumAccountsByLabelOrAddressName(name){let accounts=await this.getEthereumAccounts();return name.length?accounts.filter(account=>new RegExp(name).test(account.name)):accounts}async createTransaction(txParams,txMeta){let result=await this.client.createTransaction({chainId:Number(txMeta.chainId),note:txMeta.note},txParams);return{transactionStatus:result.transactionStatus,custodian_transactionId:result.custodian_transactionId,from:result.from,gasLimit:result.gasLimit,gasPrice:result.gasPrice,maxFeePerGas:result.maxFeePerGas,maxPriorityFeePerGas:result.maxFeePerGas,nonce:result.nonce,transactionHash:result.transactionHash}}async getTransaction(_from,custodian_transactionId){let result=await this.client.getTransaction(custodian_transactionId);return result?{transactionStatus:result.transactionStatus,custodian_transactionId:result.custodian_transactionId,from:result.from,gasLimit:result.gasLimit,gasPrice:result.gasPrice,maxFeePerGas:result.maxFeePerGas,maxPriorityFeePerGas:result.maxPriorityFeePerGas,nonce:result.nonce,transactionHash:result.transactionHash}:null}async getSignedMessage(address,custodian_signedMessageId){var _a;let result=await this.client.getSignedMessage(custodian_signedMessageId),signature=null==result?void 0:result.signature;return result?((null===(_a=result.signature)||void 0===_a?void 0:_a.length)&&(signature=result.signature),{id:result.custodian_transactionId,signature,status:(0,map_status_1.mapTransactionStatus)(result.transactionStatus)}):null}async getCustomerId(){return"cactus-customer"}async getAllTransactions(){throw Error("Not implemented")}async getCustomerProof(){let{jwt}=await this.client.getCustomerProof();return jwt}async signTypedData_v4(address,message,version){var _a;let result=await this.client.signTypedData_v4(address,message,version,null===(_a=message.domain)||void 0===_a?void 0:_a.chainId);return{custodian_transactionId:result.custodian_transactionId,transactionStatus:result.transactionStatus,from:address}}async signPersonalMessage(address,message){let result=await this.client.signPersonalMessage(address,message);return{custodian_transactionId:result.custodian_transactionId,transactionStatus:result.transactionStatus,from:address}}async getErc20Tokens(){return{}}async getSupportedChains(){return this.cache.tryCachingArray("getSupportedChains",this.cacheAge,async()=>{let{networks}=await this.client.getChainIds();return networks.map(network=>network.chainID)})}async getTransactionLink(_transactionId){return null}changeRefreshTokenAuthDetails(authDetails){throw Error("Not implemented yet")}}exports.CactusCustodianApi=CactusCustodianApi},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/cactus/DefaultCactusCustodianDetails.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DefaultCactusCustodianDetails=void 0,exports.DefaultCactusCustodianDetails={apiUrl:"https://api.mycactus.com/custody/v1/mmi-api"}},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/eca3/ECA3Client.js":function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __importDefault=this&&this.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ECA3Client=void 0;let simplecache_1=__webpack_require__("./node_modules/@metamask-institutional/simplecache/dist/index.js"),crypto_1=__importDefault(__webpack_require__("?cbdd")),events_1=__webpack_require__("./node_modules/events/events.js"),constants_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/constants/constants.js"),json_rpc_call_1=__importDefault(__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/eca3/util/json-rpc-call.js"));class ECA3Client extends events_1.EventEmitter{constructor(apiBaseUrl,refreshToken,refreshTokenUrl){super(),this.apiBaseUrl=apiBaseUrl,this.refreshToken=refreshToken,this.refreshTokenUrl=refreshTokenUrl,this.cacheAge=null,this.call=(0,json_rpc_call_1.default)(`${this.apiBaseUrl}/v3/json-rpc`,this.emit.bind(this)),this.cache=new simplecache_1.SimpleCache}setRefreshToken(refreshToken){let payload={oldRefreshToken:this.refreshToken,newRefreshToken:refreshToken};this.emit(constants_1.REFRESH_TOKEN_CHANGE_EVENT,payload),this.refreshToken=refreshToken}async getAccessToken(){if(this.cacheAge&&this.cache.cacheExists("accessToken")&&this.cache.cacheValid("accessToken",this.cacheAge))return this.cache.getCache("accessToken");try{let data={grant_type:"refresh_token",refresh_token:this.refreshToken},response=await fetch(this.refreshTokenUrl,{method:"POST",body:JSON.stringify(data),headers:{"Content-Type":"application/json"},credentials:"same-origin"}),responseJson=await response.json();if((null==response?void 0:response.status)===401&&(null==responseJson?void 0:responseJson.url)){let url=null==responseJson?void 0:responseJson.url,oldRefreshToken=this.refreshToken,hashedToken=crypto_1.default.createHash("sha256").update(oldRefreshToken+url).digest("hex");throw this.emit(constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,{url,oldRefreshToken:hashedToken}),Error("Refresh token provided is no longer valid.")}if(!response.ok)throw Error(`Request failed with status ${response.status}: ${responseJson.message}`);if(this.cacheAge=responseJson.expires_in,this.cache.setCache("accessToken",responseJson.access_token),responseJson.refresh_token&&responseJson.refresh_token!==this.refreshToken){console.log("JsonRPCClient: Refresh token changed to "+responseJson.refresh_token.substring(0,5)+"..."+responseJson.refresh_token.substring(responseJson.refresh_token.length-5));let oldRefreshToken=this.refreshToken;this.setRefreshToken(responseJson.refresh_token);let payload={oldRefreshToken,newRefreshToken:responseJson.refresh_token};this.emit(constants_1.REFRESH_TOKEN_CHANGE_EVENT,payload)}return this.emit(constants_1.API_REQUEST_LOG_EVENT,{method:"POST",endpoint:this.refreshTokenUrl,success:response.ok,timestamp:new Date().toISOString(),errorMessage:response.ok?void 0:responseJson.message}),responseJson.access_token}catch(error){throw this.emit(constants_1.API_REQUEST_LOG_EVENT,{method:"POST",endpoint:this.refreshTokenUrl,success:!1,timestamp:new Date().toISOString(),errorMessage:error.message}),Error(`Error getting the Access Token: ${error}`)}}async listAccounts(){let accessToken=await this.getAccessToken();return this.call("custodian_listAccounts",{},accessToken)}async listAccountsSigned(){let accessToken=await this.getAccessToken();return this.call("custodian_listAccountsSigned",{},accessToken)}async replaceTransaction(replaceTransactionPayload){let accessToken=await this.getAccessToken();return this.call("custodian_replaceTransaction",replaceTransactionPayload,accessToken)}async getCustomerProof(){let accessToken=await this.getAccessToken();return this.call("custodian_getCustomerProof",{},accessToken)}async createTransaction(createTransactionPayload){let accessToken=await this.getAccessToken();return this.call("custodian_createTransaction",createTransactionPayload,accessToken)}async getAccountChainIds(listAccountChainIdPayload){let accessToken=await this.getAccessToken();return this.call("custodian_listAccountChainIds",listAccountChainIdPayload,accessToken)}async signPersonalMessage(signPayload){let accessToken=await this.getAccessToken();return this.call("custodian_sign",signPayload,accessToken)}async signTypedData(signPayload){let accessToken=await this.getAccessToken();return this.call("custodian_signTypedData",signPayload,accessToken)}async getTransaction(getTransactionPayload){let accessToken=await this.getAccessToken();return this.call("custodian_getTransactionById",getTransactionPayload,accessToken)}async getSignedMessage(getSignedMessagePayload){let accessToken=await this.getAccessToken();return this.call("custodian_getSignedMessageById",getSignedMessagePayload,accessToken)}async getTransactionLink(getTransactionLinkPayload){let accessToken=await this.getAccessToken();return this.call("custodian_getTransactionLink",getTransactionLinkPayload,accessToken)}async getSignedMessageLink(getSignedMessageLinkPayload){let accessToken=await this.getAccessToken();return this.call("custodian_getSignedMessageLink",getSignedMessageLinkPayload,accessToken)}}exports.ECA3Client=ECA3Client},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/eca3/ECA3CustodianApi.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ECA3CustodianApi=void 0;let simplecache_1=__webpack_require__("./node_modules/@metamask-institutional/simplecache/dist/index.js"),events_1=__webpack_require__("./node_modules/events/events.js"),constants_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/constants/constants.js"),ECA3Client_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/eca3/ECA3Client.js"),hexlify_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/eca3/util/hexlify.js"),mapStatusObjectToStatusText_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/eca3/util/mapStatusObjectToStatusText.js");class ECA3CustodianApi extends events_1.EventEmitter{constructor(authDetails,_authType,apiUrl,cacheAge){super(),this.cacheAge=cacheAge,this.cache=new simplecache_1.SimpleCache,this.integrationVersion=2;let{refreshToken}=authDetails;this.client=new ECA3Client_1.ECA3Client(apiUrl,refreshToken,authDetails.refreshTokenUrl),this.client.on(constants_1.REFRESH_TOKEN_CHANGE_EVENT,event=>{this.emit(constants_1.REFRESH_TOKEN_CHANGE_EVENT,event)}),this.client.on(constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,event=>{this.emit(constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,event)}),this.client.on(constants_1.API_REQUEST_LOG_EVENT,event=>{this.emit(constants_1.API_REQUEST_LOG_EVENT,event)})}getAccountHierarchy(){return null}async getEthereumAccounts(){return(await this.client.listAccounts()).result.map(account=>({name:account.name,address:account.address,custodianDetails:null,labels:account.tags.map(tag=>({key:tag.name,value:tag.value})),metadata:account.metadata}))}async getEthereumAccountsByAddress(address){return(await this.getEthereumAccounts()).filter(account=>account.address.toLowerCase().includes(address.toLowerCase()))}async getListAccountsSigned(){let{result}=await this.client.listAccountsSigned();return result.jwt}async getEthereumAccountsByLabelOrAddressName(name){return(await this.getEthereumAccounts()).filter(account=>account.name.includes(name))}async createTransaction(txParams,txMeta){let fromAddress=txParams.from,accounts=await this.getEthereumAccountsByAddress(fromAddress);if(!accounts.length)throw Error("No such ethereum account!");let payload={from:accounts[0].address,to:txParams.to,data:txParams.data,value:(0,hexlify_1.hexlify)(txParams.value),gas:(0,hexlify_1.hexlify)(txParams.gasLimit),type:(0,hexlify_1.hexlify)(txParams.type)};2===Number(txParams.type)?(payload.maxFeePerGas=(0,hexlify_1.hexlify)(txParams.maxFeePerGas),payload.maxPriorityFeePerGas=(0,hexlify_1.hexlify)(txParams.maxPriorityFeePerGas)):payload.gasPrice=(0,hexlify_1.hexlify)(txParams.gasPrice);let{result}=await this.client.createTransaction([payload,{chainId:(0,hexlify_1.hexlify)(txMeta.chainId),note:txMeta.note,originUrl:txMeta.origin,transactionCategory:txMeta.transactionCategory,custodianPublishesTransaction:txMeta.custodianPublishesTransaction,rpcUrl:txMeta.rpcUrl}]);return{custodian_transactionId:result,transactionStatus:"created",from:accounts[0].address}}async getTransaction(_from,custodian_transactionId){var _a;let{result}=await this.client.getTransaction([custodian_transactionId]);return result?{transactionStatus:(0,mapStatusObjectToStatusText_1.mapStatusObjectToStatusText)(result.transaction.status),transactionStatusDisplayText:null===(_a=result.transaction.status)||void 0===_a?void 0:_a.displayText,custodian_transactionId:result.transaction.id,from:result.transaction.from,gasLimit:result.transaction.gas,gasPrice:result.transaction.gasPrice,maxFeePerGas:result.transaction.maxFeePerGas,maxPriorityFeePerGas:result.transaction.maxPriorityFeePerGas,nonce:result.transaction.nonce,transactionHash:result.transaction.hash,reason:result.transaction.status.reason,to:result.transaction.to,signedRawTransaction:result.transaction.signedRawTransaction,chainId:result.metadata.chainId,custodianPublishesTransaction:result.metadata.custodianPublishesTransaction,rpcUrl:result.metadata.rpcUrl}:null}async replaceTransaction(txParams){let payload={transactionId:txParams.transactionId,action:txParams.action},{result}=await this.client.replaceTransaction([payload,{gas:(0,hexlify_1.hexlify)(txParams.gasLimit),maxPriorityFeePerGas:(0,hexlify_1.hexlify)(txParams.maxPriorityFeePerGas),maxFeePerGas:(0,hexlify_1.hexlify)(txParams.maxFeePerGas)}]);return{transactionId:result.transactionId}}async getSignedMessage(_address,custodian_signedMessageId){let{result}=await this.client.getSignedMessage([custodian_signedMessageId]);return result?{signature:result.signature,status:result.status}:null}async getTransactionLink(transactionId){let{result}=await this.client.getTransactionLink([transactionId]);return result?{url:result.url,text:result.text,action:result.action,ethereum:result.ethereum}:null}async getSignedMessageLink(transactionId){let{result}=await this.client.getSignedMessageLink([transactionId]);return result?{url:result.url,text:result.text,action:result.action,ethereum:result.ethereum}:null}async getCustomerId(){return null}async getAllTransactions(){return null}async getCustomerProof(){let{result}=await this.client.getCustomerProof();return result.jwt}async signTypedData_v4(address,data,version,signedTypedMessageMetadata){if(!(await this.getEthereumAccountsByAddress(address)).length)throw Error("No such ethereum account!");version=version.toLowerCase();let{result}=await this.client.signTypedData([{address,data,version},signedTypedMessageMetadata]);return{custodian_transactionId:result,transactionStatus:"created",from:address}}async signPersonalMessage(address,message,signedMessageMetadata){let accounts=await this.getEthereumAccountsByAddress(address);if(!accounts.length)throw Error("No such ethereum account!");let{result}=await this.client.signPersonalMessage([{address,message},signedMessageMetadata]);return{custodian_transactionId:result,transactionStatus:"created",from:accounts[0].address}}async getErc20Tokens(){return{}}async getSupportedChains(address){return this.cache.tryCachingArray("getSupportedChains-"+address,this.cacheAge,async()=>{let{result}=await this.client.getAccountChainIds([address]);return result})}changeRefreshTokenAuthDetails(authDetails){this.client.setRefreshToken(authDetails.refreshToken)}}exports.ECA3CustodianApi=ECA3CustodianApi},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/eca3/util/hexlify.js":(__unused_webpack_module,exports)=>{"use strict";function hexlify(num){return"0x"+BigInt(num).toString(16)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.hexlify=void 0,exports.hexlify=hexlify},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/eca3/util/json-rpc-call.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});let constants_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/constants/constants.js");function default_1(jsonRpcEndpoint,emit){let requestId=0;return async function jsonRpcCall(method,params,accessToken){let response,responseJson;console.debug("JSON-RPC >",method,++requestId,params,jsonRpcEndpoint);try{if(response=await fetch(jsonRpcEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${accessToken}`},body:JSON.stringify({jsonrpc:"2.0",id:requestId,method,params}),credentials:"same-origin"}),responseJson=await response.json(),emit(constants_1.API_REQUEST_LOG_EVENT,{id:requestId,method,endpoint:jsonRpcEndpoint,success:!responseJson.error,timestamp:new Date().toISOString(),errorMessage:responseJson.error?responseJson.error.message:void 0,responseData:responseJson.result}),responseJson.error)throw console.log("JSON-RPC <",method,requestId,responseJson,jsonRpcEndpoint),Error(responseJson.error.message);console.debug("JSON-RPC <",method,requestId,responseJson.result,jsonRpcEndpoint)}catch(e){throw console.log("JSON-RPC <",method,requestId,e,jsonRpcEndpoint),emit(constants_1.API_REQUEST_LOG_EVENT,{id:requestId,method,endpoint:jsonRpcEndpoint,success:!1,timestamp:new Date().toISOString(),errorMessage:e.message,responseData:null}),e}return responseJson}}exports.default=default_1},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/eca3/util/mapStatusObjectToStatusText.js":(__unused_webpack_module,exports)=>{"use strict";function mapStatusObjectToStatusText(status){return status.finished&&status.submitted&&status.signed&&status.success?"mined":status.finished&&status.submitted&&status.signed&&!status.success?"failed":status.submitted&&!status.finished?"submitted":status.signed&&!status.submitted?"signed":status.signed||status.finished?!status.signed&&status.finished?"aborted":void 0:"created"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.mapStatusObjectToStatusText=void 0,exports.mapStatusObjectToStatusText=mapStatusObjectToStatusText},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/json-rpc/JsonRpcClient.js":function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __importDefault=this&&this.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonRpcClient=void 0;let simplecache_1=__webpack_require__("./node_modules/@metamask-institutional/simplecache/dist/index.js"),crypto_1=__importDefault(__webpack_require__("?9581")),events_1=__webpack_require__("./node_modules/events/events.js"),constants_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/constants/constants.js"),json_rpc_call_1=__importDefault(__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/json-rpc/util/json-rpc-call.js"));class JsonRpcClient extends events_1.EventEmitter{constructor(apiBaseUrl,refreshToken,refreshTokenUrl){super(),this.apiBaseUrl=apiBaseUrl,this.refreshToken=refreshToken,this.refreshTokenUrl=refreshTokenUrl,this.cacheAge=null,this.call=(0,json_rpc_call_1.default)(`${this.apiBaseUrl}/v1/json-rpc`,this.emit.bind(this)),this.cache=new simplecache_1.SimpleCache}setRefreshToken(refreshToken){let payload={oldRefreshToken:this.refreshToken,newRefreshToken:refreshToken};this.emit(constants_1.REFRESH_TOKEN_CHANGE_EVENT,payload),this.refreshToken=refreshToken}async getAccessToken(){if(this.cacheAge&&this.cache.cacheExists("accessToken")&&this.cache.cacheValid("accessToken",this.cacheAge))return this.cache.getCache("accessToken");try{let data=new URLSearchParams({grant_type:"refresh_token",refresh_token:this.refreshToken}),response=await fetch(this.refreshTokenUrl,{method:"POST",body:data,headers:{"Content-Type":"application/x-www-form-urlencoded"},credentials:"same-origin"}),responseJson=await response.json();if((null==response?void 0:response.status)===401&&(null==responseJson?void 0:responseJson.url)){let url=null==responseJson?void 0:responseJson.url,oldRefreshToken=this.refreshToken,hashedToken=crypto_1.default.createHash("sha256").update(oldRefreshToken+url).digest("hex");throw this.emit(constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,{url,oldRefreshToken:hashedToken}),Error("Refresh token provided is no longer valid.")}if(!response.ok)throw Error(`Request failed with status ${response.status}: ${responseJson.message}`);if(this.cacheAge=responseJson.expires_in,this.cache.setCache("accessToken",responseJson.access_token),responseJson.refresh_token&&responseJson.refresh_token!==this.refreshToken){console.log("JsonRPCClient: Refresh token changed to "+responseJson.refresh_token.substring(0,5)+"..."+responseJson.refresh_token.substring(responseJson.refresh_token.length-5));let oldRefreshToken=this.refreshToken;this.setRefreshToken(responseJson.refresh_token);let payload={oldRefreshToken,newRefreshToken:responseJson.refresh_token};this.emit(constants_1.REFRESH_TOKEN_CHANGE_EVENT,payload)}return this.emit(constants_1.API_REQUEST_LOG_EVENT,{method:"POST",endpoint:this.refreshTokenUrl,success:response.ok,timestamp:new Date().toISOString(),errorMessage:response.ok?void 0:responseJson.message}),responseJson.access_token}catch(error){throw this.emit(constants_1.API_REQUEST_LOG_EVENT,{method:"POST",endpoint:this.refreshTokenUrl,success:!1,timestamp:new Date().toISOString(),errorMessage:error.message}),Error(`Error getting the Access Token: ${error}`)}}async listAccounts(){let accessToken=await this.getAccessToken();return this.call("custodian_listAccounts",{},accessToken)}async getCustomerProof(){let accessToken=await this.getAccessToken();return this.call("custodian_getCustomerProof",{},accessToken)}async createTransaction(createTransactionPayload){let accessToken=await this.getAccessToken();return this.call("custodian_createTransaction",createTransactionPayload,accessToken)}async getAccountChainIds(listAccountChainIdPayload){let accessToken=await this.getAccessToken();return this.call("custodian_listAccountChainIds",listAccountChainIdPayload,accessToken)}async signPersonalMessage(signPayload){let accessToken=await this.getAccessToken();return this.call("custodian_sign",signPayload,accessToken)}async signTypedData(signPayload){let accessToken=await this.getAccessToken();return this.call("custodian_signTypedData",signPayload,accessToken)}async getTransaction(getTransactionPayload){let accessToken=await this.getAccessToken();return this.call("custodian_getTransactionById",getTransactionPayload,accessToken)}async getSignedMessage(getSignedMessagePayload){let accessToken=await this.getAccessToken();return this.call("custodian_getSignedMessageById",getSignedMessagePayload,accessToken)}async getTransactionLink(getTransactionLinkPayload){let accessToken=await this.getAccessToken();return this.call("custodian_getTransactionLink",getTransactionLinkPayload,accessToken)}}exports.JsonRpcClient=JsonRpcClient},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/json-rpc/JsonRpcCustodianApi.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonRpcCustodianApi=void 0;let simplecache_1=__webpack_require__("./node_modules/@metamask-institutional/simplecache/dist/index.js"),events_1=__webpack_require__("./node_modules/events/events.js"),constants_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/constants/constants.js"),JsonRpcClient_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/json-rpc/JsonRpcClient.js"),hexlify_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/json-rpc/util/hexlify.js"),mapStatusObjectToStatusText_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/json-rpc/util/mapStatusObjectToStatusText.js");class JsonRpcCustodianApi extends events_1.EventEmitter{constructor(authDetails,_authType,apiUrl,cacheAge){super(),this.cacheAge=cacheAge,this.cache=new simplecache_1.SimpleCache,this.integrationVersion=2;let{refreshToken}=authDetails;this.client=new JsonRpcClient_1.JsonRpcClient(apiUrl,refreshToken,authDetails.refreshTokenUrl),this.client.on(constants_1.REFRESH_TOKEN_CHANGE_EVENT,event=>{this.emit(constants_1.REFRESH_TOKEN_CHANGE_EVENT,event)}),this.client.on(constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,event=>{this.emit(constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,event)}),this.client.on(constants_1.API_REQUEST_LOG_EVENT,event=>{this.emit(constants_1.API_REQUEST_LOG_EVENT,event)})}getAccountHierarchy(){return null}async getEthereumAccounts(){return(await this.client.listAccounts()).result.map(account=>({name:account.name,address:account.address,custodianDetails:null,labels:account.tags.map(tag=>({key:tag.name,value:tag.value}))}))}async getEthereumAccountsByAddress(address){return(await this.getEthereumAccounts()).filter(account=>account.address.toLowerCase().includes(address.toLowerCase()))}async getEthereumAccountsByLabelOrAddressName(name){return(await this.getEthereumAccounts()).filter(account=>account.name.includes(name))}async createTransaction(txParams,txMeta){let fromAddress=txParams.from,accounts=await this.getEthereumAccountsByAddress(fromAddress);if(!accounts.length)throw Error("No such ethereum account!");let payload={from:accounts[0].address,to:txParams.to,data:txParams.data,value:(0,hexlify_1.hexlify)(txParams.value),gas:(0,hexlify_1.hexlify)(txParams.gasLimit),type:(0,hexlify_1.hexlify)(txParams.type)};2===Number(txParams.type)?(payload.maxFeePerGas=(0,hexlify_1.hexlify)(txParams.maxFeePerGas),payload.maxPriorityFeePerGas=(0,hexlify_1.hexlify)(txParams.maxPriorityFeePerGas)):payload.gasPrice=(0,hexlify_1.hexlify)(txParams.gasPrice);let{result}=await this.client.createTransaction([payload,{chainId:(0,hexlify_1.hexlify)(txMeta.chainId),note:txMeta.note,originUrl:txMeta.origin,transactionCategory:txMeta.transactionCategory}]);return{custodian_transactionId:result,transactionStatus:"created",from:accounts[0].address}}async getTransaction(_from,custodian_transactionId){var _a;let{result}=await this.client.getTransaction([custodian_transactionId]);return result?{transactionStatus:(0,mapStatusObjectToStatusText_1.mapStatusObjectToStatusText)(result.status),transactionStatusDisplayText:null===(_a=result.status)||void 0===_a?void 0:_a.displayText,custodian_transactionId:result.id,from:result.from,gasLimit:result.gas,gasPrice:result.gasPrice,maxFeePerGas:result.maxFeePerGas,maxPriorityFeePerGas:result.maxPriorityFeePerGas,nonce:result.nonce,transactionHash:result.hash,reason:result.status.reason,to:result.to}:null}async getSignedMessage(_address,custodian_signedMessageId){let{result}=await this.client.getSignedMessage([custodian_signedMessageId]);return result?{signature:result.signature,status:result.status}:null}async getTransactionLink(transactionId){let{result}=await this.client.getTransactionLink([transactionId]);return result?{url:result.url,text:result.text,action:result.action,ethereum:result.ethereum}:null}async getCustomerId(){return null}async getAllTransactions(){return null}async getCustomerProof(){let{result}=await this.client.getCustomerProof();return result.jwt}async signTypedData_v4(address,message,version){if(!(await this.getEthereumAccountsByAddress(address)).length)throw Error("No such ethereum account!");version=version.toLowerCase();let{result}=await this.client.signTypedData([address,message,version]);return{custodian_transactionId:result,transactionStatus:"created",from:address}}async signPersonalMessage(address,message){let accounts=await this.getEthereumAccountsByAddress(address);if(!accounts.length)throw Error("No such ethereum account!");let{result}=await this.client.signPersonalMessage([address,message]);return{custodian_transactionId:result,transactionStatus:"created",from:accounts[0].address}}async getErc20Tokens(){return{}}async getSupportedChains(address){return this.cache.tryCachingArray("getSupportedChains-"+address,this.cacheAge,async()=>{let{result}=await this.client.getAccountChainIds([address]);return result})}changeRefreshTokenAuthDetails(authDetails){this.client.setRefreshToken(authDetails.refreshToken)}}exports.JsonRpcCustodianApi=JsonRpcCustodianApi},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/json-rpc/util/hexlify.js":(__unused_webpack_module,exports)=>{"use strict";function hexlify(num){return"0x"+BigInt(num).toString(16)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.hexlify=void 0,exports.hexlify=hexlify},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/json-rpc/util/json-rpc-call.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});let constants_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/constants/constants.js");function default_1(jsonRpcEndpoint,emit){let requestId=0;return async function jsonRpcCall(method,params,accessToken){let response,responseJson;console.debug("JSON-RPC >",method,++requestId,params,jsonRpcEndpoint);try{if(response=await fetch(jsonRpcEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${accessToken}`},body:JSON.stringify({jsonrpc:"2.0",id:requestId,method,params}),credentials:"same-origin"}),responseJson=await response.json(),emit(constants_1.API_REQUEST_LOG_EVENT,{id:requestId,method,endpoint:jsonRpcEndpoint,success:!responseJson.error,timestamp:new Date().toISOString(),errorMessage:responseJson.error?responseJson.error.message:void 0,responseData:responseJson.result}),responseJson.error)throw console.log("JSON-RPC <",method,requestId,responseJson,jsonRpcEndpoint),Error(responseJson.error.message);console.debug("JSON-RPC <",method,requestId,responseJson.result,jsonRpcEndpoint)}catch(e){throw console.log("JSON-RPC <",method,requestId,e,jsonRpcEndpoint),emit(constants_1.API_REQUEST_LOG_EVENT,{id:requestId,method,endpoint:jsonRpcEndpoint,success:!1,timestamp:new Date().toISOString(),errorMessage:e.message,responseData:null}),e}return responseJson}}exports.default=default_1},"./node_modules/@metamask-institutional/sdk/dist/custodianApi/json-rpc/util/mapStatusObjectToStatusText.js":(__unused_webpack_module,exports)=>{"use strict";function mapStatusObjectToStatusText(status){return status.finished&&status.submitted&&status.signed&&status.success?"mined":status.finished&&status.submitted&&status.signed&&!status.success?"failed":status.submitted&&!status.finished?"submitted":status.signed&&!status.submitted?"signed":status.signed||status.finished?!status.signed&&status.finished?"aborted":void 0:"created"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.mapStatusObjectToStatusText=void 0,exports.mapStatusObjectToStatusText=mapStatusObjectToStatusText},"./node_modules/@metamask-institutional/sdk/dist/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mmiSDKFactory=exports.mapTransactionStatus=exports.ECA3CustodianApi=exports.JsonRpcCustodianApi=exports.CactusCustodianApi=exports.BitgoCustodianApi=exports.DEFAULT_MAX_CACHE_AGE=exports.API_REQUEST_LOG_EVENT=exports.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT=exports.REFRESH_TOKEN_CHANGE_EVENT=exports.MMISDK=exports.AccountHierarchyNode=void 0;var AccountHierarchyNode_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/classes/AccountHierarchyNode.js");Object.defineProperty(exports,"AccountHierarchyNode",{enumerable:!0,get:function(){return AccountHierarchyNode_1.AccountHierarchyNode}});var MMISDK_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/classes/MMISDK.js");Object.defineProperty(exports,"MMISDK",{enumerable:!0,get:function(){return MMISDK_1.MMISDK}});var constants_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/constants/constants.js");Object.defineProperty(exports,"REFRESH_TOKEN_CHANGE_EVENT",{enumerable:!0,get:function(){return constants_1.REFRESH_TOKEN_CHANGE_EVENT}}),Object.defineProperty(exports,"INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT",{enumerable:!0,get:function(){return constants_1.INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT}}),Object.defineProperty(exports,"API_REQUEST_LOG_EVENT",{enumerable:!0,get:function(){return constants_1.API_REQUEST_LOG_EVENT}}),Object.defineProperty(exports,"DEFAULT_MAX_CACHE_AGE",{enumerable:!0,get:function(){return constants_1.DEFAULT_MAX_CACHE_AGE}});var BitgoCustodianApi_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/bitgo/BitgoCustodianApi.js");Object.defineProperty(exports,"BitgoCustodianApi",{enumerable:!0,get:function(){return BitgoCustodianApi_1.BitgoCustodianApi}});var CactusCustodianApi_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/cactus/CactusCustodianApi.js");Object.defineProperty(exports,"CactusCustodianApi",{enumerable:!0,get:function(){return CactusCustodianApi_1.CactusCustodianApi}});var JsonRpcCustodianApi_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/json-rpc/JsonRpcCustodianApi.js");Object.defineProperty(exports,"JsonRpcCustodianApi",{enumerable:!0,get:function(){return JsonRpcCustodianApi_1.JsonRpcCustodianApi}});var ECA3CustodianApi_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/custodianApi/eca3/ECA3CustodianApi.js");Object.defineProperty(exports,"ECA3CustodianApi",{enumerable:!0,get:function(){return ECA3CustodianApi_1.ECA3CustodianApi}});var map_status_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/util/map-status.js");Object.defineProperty(exports,"mapTransactionStatus",{enumerable:!0,get:function(){return map_status_1.mapTransactionStatus}});var mmi_sdk_factory_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/util/mmi-sdk-factory.js");Object.defineProperty(exports,"mmiSDKFactory",{enumerable:!0,get:function(){return mmi_sdk_factory_1.mmiSDKFactory}})},"./node_modules/@metamask-institutional/sdk/dist/util/handle-response.js":(__unused_webpack_module,exports)=>{"use strict";function handleError(message,response){let errorMessage=`${message}. URL: ${response.url}`;throw console.error(errorMessage,{headers:response.headers,url:response.url}),Error(errorMessage)}async function handleResponse(response,contextErrorMessage){var _a;let errorMsg=`Error with request. Status: ${response.status} Status text: ${response.statusText}. URL: ${response.url}. ${contextErrorMessage||""}`;if(!response.ok)try{let errorData=await response.json();errorMsg+=(null===(_a=errorData.error)||void 0===_a?void 0:_a.message)?`. Error message: ${errorData.error.message}`:`. Error message: ${errorData.message}`,handleError(errorMsg,response)}catch(error){handleError(`Failed to parse JSON. ${errorMsg}`,response)}try{return await response.json()}catch(error){handleError(`Failed to parse JSON. ${errorMsg}`,response)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.handleResponse=void 0,exports.handleResponse=handleResponse},"./node_modules/@metamask-institutional/sdk/dist/util/map-status.js":(__unused_webpack_module,exports)=>{"use strict";function mapTransactionStatus(status,reason){switch(status){case"created":return{finished:!1,submitted:!1,signed:!1,success:!1,displayText:"Created",reason};case"signed":return{finished:!1,submitted:!1,signed:!0,success:!1,displayText:"Signed",reason};case"submitted":return{finished:!1,submitted:!0,signed:!0,success:!1,displayText:"Submitted",reason};case"mined":return{finished:!0,submitted:!0,signed:!0,success:!0,displayText:"Mined",reason};case"completed":return{finished:!0,submitted:!0,signed:!0,success:!0,displayText:"Completed",reason};case"failed":return{finished:!0,submitted:!0,signed:!0,success:!1,displayText:"Failed",reason};case"rejected":return{finished:!0,submitted:!1,signed:!1,success:!1,displayText:"Rejected",reason};case"aborted":return{finished:!0,submitted:!1,signed:!1,success:!1,displayText:"Aborted",reason};case"confirmed":return{finished:!0,submitted:!0,signed:!0,success:!0,displayText:"Confirmed",reason};default:return{finished:!1,submitted:!1,signed:!1,success:!1,displayText:"Unknown",reason}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.mapTransactionStatus=void 0,exports.mapTransactionStatus=mapTransactionStatus},"./node_modules/@metamask-institutional/sdk/dist/util/mmi-sdk-factory.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mmiSDKFactory=void 0;let MMISDK_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/classes/MMISDK.js"),constants_1=__webpack_require__("./node_modules/@metamask-institutional/sdk/dist/constants/constants.js");exports.mmiSDKFactory=function(custodianApi,authDetails,authType,apiUrl){if(apiUrl.startsWith("http://")&&!apiUrl.startsWith("http://localhost")&&!apiUrl.startsWith("http://18.139.217.63"))throw Error("http:// URLs are not supported - only https://");return new MMISDK_1.MMISDK(custodianApi,authDetails,authType,apiUrl,constants_1.DEFAULT_MAX_CACHE_AGE)}},"./node_modules/@metamask-institutional/simplecache/dist/SimpleCache.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SimpleCache=void 0,exports.SimpleCache=class{constructor(){this.cache={}}async tryCachingArray(key,maxCacheAgeSeconds,fn){if(maxCacheAgeSeconds>=0&&this.cacheExists(key)&&this.cacheValid(key,maxCacheAgeSeconds))return this.cache[key].results;let results=await fn();return this.cache[key]={results,timestamp:new Date().getTime()},results}setCache(key,value){this.cache[key]={results:value,timestamp:new Date().getTime()}}getCache(key){return this.cacheExists(key)?this.cache[key].results:null}cacheExists(key){return this.cache.hasOwnProperty(key)}cacheValid(key,maxCacheAgeSeconds){let cache=this.cache[key];return new Date().getTime()-cache.timestamp<1e3*maxCacheAgeSeconds}deleteCache(key){this.cacheExists(key)&&delete this.cache[key]}}},"./node_modules/@metamask-institutional/simplecache/dist/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SimpleCache=void 0;var SimpleCache_1=__webpack_require__("./node_modules/@metamask-institutional/simplecache/dist/SimpleCache.js");Object.defineProperty(exports,"SimpleCache",{enumerable:!0,get:function(){return SimpleCache_1.SimpleCache}})},"./node_modules/@metamask-institutional/types/dist/enum/AddressType.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AddressType=void 0,function(AddressType){AddressType[AddressType.MONOCHAIN=0]="MONOCHAIN",AddressType[AddressType.POLYCHAIN=1]="POLYCHAIN"}(exports.AddressType||(exports.AddressType={}))},"./node_modules/@metamask-institutional/types/dist/enum/AuthTypes.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AuthTypes=void 0,function(AuthTypes){AuthTypes[AuthTypes.TOKEN=0]="TOKEN",AuthTypes[AuthTypes.REFRESH_TOKEN=1]="REFRESH_TOKEN",AuthTypes[AuthTypes.AUTHORIZATION_CODE_FLOW=2]="AUTHORIZATION_CODE_FLOW"}(exports.AuthTypes||(exports.AuthTypes={}))},"./node_modules/@metamask-institutional/types/dist/enum/MetaMaskTransactionStatuses.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MetaMaskTransactionStatuses=void 0,function(MetaMaskTransactionStatuses){MetaMaskTransactionStatuses.UNAPPROVED="unapproved",MetaMaskTransactionStatuses.APPROVED="approved",MetaMaskTransactionStatuses.REJECTED="rejected",MetaMaskTransactionStatuses.SIGNED="signed",MetaMaskTransactionStatuses.SUBMITTED="submitted",MetaMaskTransactionStatuses.FAILED="failed",MetaMaskTransactionStatuses.DROPPED="dropped",MetaMaskTransactionStatuses.CONFIRMED="confirmed",MetaMaskTransactionStatuses.ADDED="added",MetaMaskTransactionStatuses.FINALIZED="finalized"}(exports.MetaMaskTransactionStatuses||(exports.MetaMaskTransactionStatuses={}))},"./node_modules/@metamask-institutional/types/dist/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MetaMaskTransactionStatuses=exports.AddressType=exports.AuthTypes=void 0;var AuthTypes_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/enum/AuthTypes.js");Object.defineProperty(exports,"AuthTypes",{enumerable:!0,get:function(){return AuthTypes_1.AuthTypes}});var AddressType_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/enum/AddressType.js");Object.defineProperty(exports,"AddressType",{enumerable:!0,get:function(){return AddressType_1.AddressType}});var MetaMaskTransactionStatuses_1=__webpack_require__("./node_modules/@metamask-institutional/types/dist/enum/MetaMaskTransactionStatuses.js");Object.defineProperty(exports,"MetaMaskTransactionStatuses",{enumerable:!0,get:function(){return MetaMaskTransactionStatuses_1.MetaMaskTransactionStatuses}})},"./node_modules/@metamask/obs-store/dist/ComposedStore.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ComposedStore=void 0;let ObservableStore_1=__webpack_require__("./node_modules/@metamask/obs-store/dist/ObservableStore.js");class ComposedStore extends ObservableStore_1.ObservableStore{constructor(children){super({}),this._children=children||{},Object.keys(this._children).forEach(childKey=>{let child=this._children[childKey];this._addChild(childKey,child)})}_addChild(childKey,child){let updateFromChild=childValue=>{let state=this.getState();state[childKey]=childValue,this.putState(state)};child.subscribe(updateFromChild),updateFromChild(child.getState())}}exports.ComposedStore=ComposedStore},"./node_modules/@metamask/obs-store/dist/MergedStore.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MergedStore=void 0;let ObservableStore_1=__webpack_require__("./node_modules/@metamask/obs-store/dist/ObservableStore.js");class MergedStore extends ObservableStore_1.ObservableStore{constructor(children=[]){super({}),this._children=children,children.forEach(child=>this._addChild(child)),this._updateWholeState()}_addChild(child){child.subscribe(()=>this._updateWholeState())}_updateWholeState(){let state=Object.assign({},...this._children.map(child=>child.getState()));this.putState(state)}}exports.MergedStore=MergedStore},"./node_modules/@metamask/obs-store/dist/ObservableStore.js":function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __importDefault=this&&this.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ObservableStore=void 0;let safe_event_emitter_1=__importDefault(__webpack_require__("./node_modules/@metamask/safe-event-emitter/dist/cjs/index.js"));class ObservableStore extends safe_event_emitter_1.default{constructor(initState){super(),void 0===initState?this._state={}:this._state=initState}getState(){return this._getState()}putState(newState){this._putState(newState),this.emit("update",newState)}updateState(partialState){if(partialState&&"object"==typeof partialState){let state=this.getState();this.putState(Object.assign(Object.assign({},state),partialState))}else this.putState(partialState)}subscribe(handler){this.on("update",handler)}unsubscribe(handler){this.removeListener("update",handler)}_getState(){return this._state}_putState(newState){this._state=newState}}exports.ObservableStore=ObservableStore},"./node_modules/@metamask/obs-store/dist/asStream.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.storeAsStream=void 0;let readable_stream_1=__webpack_require__("./node_modules/readable-stream/readable-browser.js");class ObservableStoreStream extends readable_stream_1.Duplex{constructor(obsStore){super({objectMode:!0}),this.resume(),this.handler=state=>this.push(state),this.obsStore=obsStore,this.obsStore.subscribe(this.handler)}pipe(dest,options){let result=super.pipe(dest,options);return dest.write(this.obsStore.getState()),result}_write(chunk,_encoding,callback){this.obsStore.putState(chunk),callback()}_read(_size){}_destroy(err,callback){this.obsStore.unsubscribe(this.handler),super._destroy(err,callback)}}function storeAsStream(obsStore){return new ObservableStoreStream(obsStore)}exports.storeAsStream=storeAsStream},"./node_modules/@metamask/obs-store/dist/index.js":function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(o,m,k,k2){void 0===k2&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){void 0===k2&&(k2=k),o[k2]=m[k]}),__exportStar=this&&this.__exportStar||function(m,exports){for(var p in m)"default"===p||Object.prototype.hasOwnProperty.call(exports,p)||__createBinding(exports,m,p)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(__webpack_require__("./node_modules/@metamask/obs-store/dist/asStream.js"),exports),__exportStar(__webpack_require__("./node_modules/@metamask/obs-store/dist/ComposedStore.js"),exports),__exportStar(__webpack_require__("./node_modules/@metamask/obs-store/dist/MergedStore.js"),exports),__exportStar(__webpack_require__("./node_modules/@metamask/obs-store/dist/ObservableStore.js"),exports),__exportStar(__webpack_require__("./node_modules/@metamask/obs-store/dist/transform.js"),exports)},"./node_modules/@metamask/obs-store/dist/transform.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.storeTransformStream=void 0;let readable_stream_1=__webpack_require__("./node_modules/readable-stream/readable-browser.js");function storeTransformStream(syncTransformFn){return new readable_stream_1.Transform({objectMode:!0,transform:(state,_encoding,cb)=>{try{let newState=syncTransformFn(state);cb(void 0,newState);return}catch(err){cb(err);return}}})}exports.storeTransformStream=storeTransformStream},"./node_modules/lodash.clonedeep/index.js":(module,exports,__webpack_require__)=>{module=__webpack_require__.nmd(module);var HASH_UNDEFINED="__lodash_hash_undefined__",argsTag="[object Arguments]",boolTag="[object Boolean]",dateTag="[object Date]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",promiseTag="[object Promise]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reFlags=/\w*$/,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,cloneableTags={};cloneableTags[argsTag]=cloneableTags["[object Array]"]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags["[object Error]"]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var freeGlobal="object"==typeof __webpack_require__.g&&__webpack_require__.g&&__webpack_require__.g.Object===Object&&__webpack_require__.g,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports=exports&&!exports.nodeType&&exports,freeModule=freeExports&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports;function addMapEntry(map,pair){return map.set(pair[0],pair[1]),map}function addSetEntry(set,value){return set.add(value),set}function arrayEach(array,iteratee){for(var index=-1,length=array?array.length:0;++index<length&&!1!==iteratee(array[index],index,array););return array}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=array?array.length:0;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}function getValue(object,key){return null==object?void 0:object[key]}function isHostObject(value){var result=!1;if(null!=value&&"function"!=typeof value.toString)try{result=!!(value+"")}catch(e){}return result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?root.Buffer:void 0,Symbol=root.Symbol,Uint8Array1=root.Uint8Array,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,nativeKeys=overArg(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise1=getNative(root,"Promise"),Set1=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise1),setCtorString=toSource(Set1),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function Hash(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(key){return this.has(key)&&delete this.__data__[key]}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?void 0:result}return hasOwnProperty.call(data,key)?data[key]:void 0}function hashHas(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty.call(data,key)}function hashSet(key,value){return this.__data__[key]=nativeCreate&&void 0===value?HASH_UNDEFINED:value,this}function ListCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),!0)}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?void 0:data[index][1]}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(key){return getMapData(this,key).delete(key)}function mapCacheGet(key){return getMapData(this,key).get(key)}function mapCacheHas(key){return getMapData(this,key).has(key)}function mapCacheSet(key,value){return getMapData(this,key).set(key,value),this}function Stack(entries){this.__data__=new ListCache(entries)}function stackClear(){this.__data__=new ListCache}function stackDelete(key){return this.__data__.delete(key)}function stackGet(key){return this.__data__.get(key)}function stackHas(key){return this.__data__.has(key)}function stackSet(key,value){var cache=this.__data__;if(cache instanceof ListCache){var pairs=cache.__data__;if(!Map||pairs.length<199)return pairs.push([key,value]),this;cache=this.__data__=new MapCache(pairs)}return cache.set(key,value),this}function arrayLikeKeys(value,inherited){var result=isArray(value)||isArguments(value)?baseTimes(value.length,String):[],length=result.length,skipIndexes=!!length;for(var key in value)(inherited||hasOwnProperty.call(value,key))&&!(skipIndexes&&("length"==key||isIndex(key,length)))&&result.push(key);return result}function assignValue(object,key,value){var objValue=object[key];hasOwnProperty.call(object,key)&&eq(objValue,value)&&(void 0!==value||key in object)||(object[key]=value)}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return -1}function baseAssign(object,source){return object&©Object(source,keys(source),object)}function baseClone(value,isDeep,isFull,customizer,key,object,stack){if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),void 0!==result)return result;if(!isObject(value))return value;var result,isArr=isArray(value);if(isArr){if(result=initCloneArray(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value))return cloneBuffer(value,isDeep);if(tag==objectTag||tag==argsTag||isFunc&&!object){if(isHostObject(value))return object?value:{};if(result=initCloneObject(isFunc?{}:value),!isDeep)return copySymbols(value,baseAssign(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,baseClone,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;if(stack.set(value,result),!isArr)var props=isFull?getAllKeys(value):keys(value);return arrayEach(props||value,function(subValue,key){props&&(subValue=value[key=subValue]),assignValue(result,key,baseClone(subValue,isDeep,isFull,customizer,key,value,stack))}),result}function baseCreate(proto){return isObject(proto)?objectCreate(proto):{}}function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function baseGetTag(value){return objectToString.call(value)}function baseIsNative(value){return!(!isObject(value)||isMasked(value))&&(isFunction(value)||isHostObject(value)?reIsNative:reIsHostCtor).test(toSource(value))}function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty.call(object,key)&&"constructor"!=key&&result.push(key);return result}function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var result=new buffer.constructor(buffer.length);return buffer.copy(result),result}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array1(result).set(new Uint8Array1(arrayBuffer)),result}function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}function cloneMap(map,isDeep,cloneFunc){return arrayReduce(isDeep?cloneFunc(mapToArray(map),!0):mapToArray(map),addMapEntry,new map.constructor)}function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));return result.lastIndex=regexp.lastIndex,result}function cloneSet(set,isDeep,cloneFunc){return arrayReduce(isDeep?cloneFunc(setToArray(set),!0):setToArray(set),addSetEntry,new set.constructor)}function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{}}function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}function copyArray(source,array){var index=-1,length=source.length;for(array||(array=Array(length));++index<length;)array[index]=source[index];return array}function copyObject(source,props,object,customizer){object||(object={});for(var index=-1,length=props.length;++index<length;){var key=props[index],newValue=customizer?customizer(object[key],source[key],key,object,source):void 0;assignValue(object,key,void 0===newValue?source[key]:newValue)}return object}function copySymbols(source,object){return copyObject(source,getSymbols(source),object)}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data["string"==typeof key?"string":"hash"]:data.map}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getSymbols=nativeGetSymbols?overArg(nativeGetSymbols,Object):stubArray,getTag=baseGetTag;function initCloneArray(array){var length=array.length,result=array.constructor(length);return length&&"string"==typeof array[0]&&hasOwnProperty.call(array,"index")&&(result.index=array.index,result.input=array.input),result}function initCloneObject(object){return"function"!=typeof object.constructor||isPrototype(object)?{}:baseCreate(getPrototype(object))}function initCloneByTag(object,tag,cloneFunc,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return cloneDataView(object,isDeep);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:return cloneTypedArray(object,isDeep);case mapTag:return cloneMap(object,isDeep,cloneFunc);case numberTag:case stringTag:return new Ctor(object);case regexpTag:return cloneRegExp(object);case setTag:return cloneSet(object,isDeep,cloneFunc);case symbolTag:return cloneSymbol(object)}}function isIndex(value,length){return!!(length=null==length?9007199254740991:length)&&("number"==typeof value||reIsUint.test(value))&&value>-1&&value%1==0&&value<length}function isKeyable(value){var type=typeof value;return"string"==type||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func}function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto)}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function cloneDeep(value){return baseClone(value,!0,!0)}function eq(value,other){return value===other||value!=value&&other!=other}function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise1&&getTag(Promise1.resolve())!=promiseTag||Set1&&getTag(new Set1)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});var isArray=Array.isArray;function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}var isBuffer=nativeIsBuffer||stubFalse;function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=9007199254740991}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function stubArray(){return[]}function stubFalse(){return!1}module.exports=cloneDeep}}]);