-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path50746.63043fd0.iframe.bundle.js
1 lines (1 loc) · 87.5 KB
/
50746.63043fd0.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[50746],{"./app/scripts/translate.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{t:()=>t});var _locales_en_messages_json__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./app/_locales/en/messages.json"),_shared_modules_i18n__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./shared/modules/i18n.ts");function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}var currentLocale=_shared_modules_i18n__WEBPACK_IMPORTED_MODULE_1__.MY;function t(key){for(var _len=arguments.length,substitutions=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)substitutions[_key-1]=arguments[_key];return(0,_shared_modules_i18n__WEBPACK_IMPORTED_MODULE_1__.I4)(currentLocale,_locales_en_messages_json__WEBPACK_IMPORTED_MODULE_0__,key,substitutions)||(0,_shared_modules_i18n__WEBPACK_IMPORTED_MODULE_1__.I4)(_shared_modules_i18n__WEBPACK_IMPORTED_MODULE_1__.MY,_locales_en_messages_json__WEBPACK_IMPORTED_MODULE_0__,key,substitutions)}},"./ui/components/multichain/account-list-item/account-list-item.types.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{P:()=>AccountListItemMenuTypes});var AccountListItemMenuTypes={None:"none",Connection:"connection",Account:"account"}},"./ui/components/multichain/account-list-item/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>account_list_item,P:()=>account_list_item_types.P});var react=__webpack_require__("./node_modules/react/index.js"),prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),classnames=__webpack_require__("./node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),es=__webpack_require__("./node_modules/react-redux/es/index.js"),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.js"),util=__webpack_require__("./ui/helpers/utils/util.js"),account_list_item_menu=__webpack_require__("./ui/components/multichain/account-list-item-menu/index.js"),avatar_group=__webpack_require__("./ui/components/multichain/avatar-group/index.ts"),connected_accounts_menu=__webpack_require__("./ui/components/multichain/connected-accounts-menu/index.ts"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),keyring=__webpack_require__("./shared/constants/keyring.ts"),user_preferenced_currency_display_component=__webpack_require__("./ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js"),common=__webpack_require__("./ui/helpers/constants/common.ts"),tooltip=__webpack_require__("./ui/components/ui/tooltip/tooltip.js"),metametrics=__webpack_require__("./shared/constants/metametrics.ts"),contexts_metametrics=__webpack_require__("./ui/contexts/metametrics.js"),selectors=__webpack_require__("./ui/selectors/index.js"),multichain=__webpack_require__("./ui/selectors/multichain.ts"),dist=__webpack_require__("./node_modules/@metamask/keyring-api/dist/index.mjs"),confirm_tx_util=__webpack_require__("./ui/helpers/utils/confirm-tx.util.ts"),assets=__webpack_require__("./shared/constants/multichain/assets.ts"),token_util=__webpack_require__("./ui/helpers/utils/token-util.js"),useMultichainSelector=__webpack_require__("./ui/hooks/useMultichainSelector.ts"),useAccountTotalFiatBalance=__webpack_require__("./ui/hooks/useAccountTotalFiatBalance.js"),EMPTY_VALUES={formattedFiat:"0",totalFiatBalance:"0",totalWeiBalance:"0",tokensWithBalances:[],loading:!1,orderedTokenList:[]},useMultichainAccountTotalFiatBalance=function(account){var _balances_account_id,_getTokenFiatAmount,shouldHideZeroBalanceTokens=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,dist.aw)(account.type))return(0,useAccountTotalFiatBalance.r)(account,shouldHideZeroBalanceTokens);var currentCurrency=(0,useMultichainSelector.t)(multichain.H5,account),ticker=(0,useMultichainSelector.t)(multichain.X3,account).network.ticker,conversionRate=(0,useMultichainSelector.t)(multichain.RP,account),nativeCurrencyImage=(0,useMultichainSelector.t)(multichain.Rh,account),balances=(0,es.d4)(multichain.aQ),asset=assets.dW[ticker];if(!(null===(_balances_account_id=balances[account.id])||void 0===_balances_account_id?void 0:_balances_account_id[asset]))return EMPTY_VALUES;var balance=balances[account.id][asset].amount,totalFiatBalance=null!==(_getTokenFiatAmount=(0,token_util.aQ)(1,Number(conversionRate),currentCurrency,balance,ticker,!1,!1))&&void 0!==_getTokenFiatAmount?_getTokenFiatAmount:"0";return{formattedFiat:(0,confirm_tx_util.vv)(totalFiatBalance,currentCurrency),totalFiatBalance:totalFiatBalance,totalBalance:balance,tokensWithBalances:[],loading:!1,orderedTokenList:[{iconUrl:nativeCurrencyImage,symbol:ticker,fiatBalance:totalFiatBalance}]}},connected_status=__webpack_require__("./ui/components/multichain/connected-status/index.ts"),institutional_selectors=__webpack_require__("./ui/selectors/institutional/selectors.ts"),useTheme=__webpack_require__("./ui/hooks/useTheme.ts"),address=__webpack_require__("./app/scripts/lib/multichain/address.ts"),useGetFormattedTokensPerChain=__webpack_require__("./ui/hooks/useGetFormattedTokensPerChain.ts"),useAccountTotalCrossChainFiatBalance=__webpack_require__("./ui/hooks/useAccountTotalCrossChainFiatBalance.ts"),accounts=__webpack_require__("./ui/helpers/utils/accounts.js"),account_list_item_types=__webpack_require__("./ui/components/multichain/account-list-item/account-list-item.types.js"),process=__webpack_require__("./node_modules/process/browser.js");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var AccountListItem=function(param){var _account_metadata,balanceToTranslate,account=param.account,selected=param.selected,onClick=param.onClick,closeMenu=param.closeMenu,accountsCount=param.accountsCount,connectedAvatar=param.connectedAvatar,_param_isPinned=param.isPinned,isPinned=void 0!==_param_isPinned&&_param_isPinned,_param_menuType=param.menuType,menuType=void 0===_param_menuType?account_list_item_types.P.None:_param_menuType,_param_isHidden=param.isHidden,isHidden=void 0!==_param_isHidden&&_param_isHidden,currentTabOrigin=param.currentTabOrigin,_param_isActive=param.isActive,startAccessory=param.startAccessory,onActionClick=param.onActionClick,_param_shouldScrollToWhenSelected=param.shouldScrollToWhenSelected,shouldScrollToWhenSelected=void 0===_param_shouldScrollToWhenSelected||_param_shouldScrollToWhenSelected,_param_privacyMode=param.privacyMode,privacyMode=void 0!==_param_privacyMode&&_param_privacyMode,t=(0,useI18nContext.P)(),_useState=_sliced_to_array((0,react.useState)(!1),2),accountOptionsMenuOpen=_useState[0],setAccountOptionsMenuOpen=_useState[1],_useState1=_sliced_to_array((0,react.useState)(),2),accountListItemMenuElement=_useState1[0],setAccountListItemMenuElement=_useState1[1],snapMetadata=(0,es.d4)(selectors.JaC),accountLabel=(0,accounts.KM)(account.metadata.keyring.type,account,account.metadata.keyring.type===keyring.ci.snap?(0,util.IB)(snapMetadata)(null===(_account_metadata=account.metadata)||void 0===_account_metadata?void 0:_account_metadata.snap.id):null),useBlockie=(0,es.d4)(selectors.bNi),isEvmNetwork=(0,useMultichainSelector.t)(multichain.X3,account).isEvmNetwork,isTestnet=(0,useMultichainSelector.t)(multichain.Ih,account),shouldShowFiat=(0,useMultichainSelector.t)(multichain.J7,account),showFiatInTestnets=(0,es.d4)(selectors.fXq),showFiat=shouldShowFiat&&(!isTestnet||isTestnet&&showFiatInTestnets),accountTotalFiatBalances=useMultichainAccountTotalFiatBalance(account),shouldHideZeroBalanceTokens=(0,es.d4)(selectors.wri),isTokenNetworkFilterEqualCurrentNetwork=(0,es.d4)(selectors.Xn),allChainIDs=(0,es.d4)(selectors.Kxn),formattedTokensWithBalancesPerChain=(0,useGetFormattedTokensPerChain.O)(account,shouldHideZeroBalanceTokens,isTokenNetworkFilterEqualCurrentNetwork,allChainIDs).formattedTokensWithBalancesPerChain,totalFiatBalance=(0,useAccountTotalCrossChainFiatBalance.k)(account,formattedTokensWithBalancesPerChain).totalFiatBalance,mappedOrderedTokenList=accountTotalFiatBalances.orderedTokenList.map(function(item){return{avatarValue:item.iconUrl}});balanceToTranslate=isEvmNetwork?shouldShowFiat&&!isTestnet&&process.env.PORTFOLIO_VIEW?totalFiatBalance:account.balance:accountTotalFiatBalances.totalBalance;var custodianIcon=(0,es.d4)(function(state){return(0,institutional_selectors.hq)(state,account.address)}),theme=(0,useTheme.D)(),itemRef=(0,react.useRef)(null);(0,react.useEffect)(function(){if(selected&&shouldScrollToWhenSelected){var _itemRef_current_scrollIntoView,_itemRef_current;null===(_itemRef_current=itemRef.current)||void 0===_itemRef_current||null===(_itemRef_current_scrollIntoView=_itemRef_current.scrollIntoView)||void 0===_itemRef_current_scrollIntoView||_itemRef_current_scrollIntoView.call(_itemRef_current)}},[itemRef,selected,shouldScrollToWhenSelected]);var trackEvent=(0,react.useContext)(contexts_metametrics.O2),primaryTokenImage=(0,useMultichainSelector.t)(multichain.KF,account),nativeCurrency=(0,useMultichainSelector.t)(multichain.zz,account),currentTabIsConnectedToSelectedAddress=(0,es.d4)(function(state){return(0,selectors.a$X)(state,account.address)}),isConnected=currentTabOrigin&¤tTabIsConnectedToSelectedAddress;return react.createElement(component_library.az,{display:design_system.nl.Flex,padding:4,backgroundColor:selected?design_system.Q1.primaryMuted:design_system.Q1.transparent,className:classnames_default()("multichain-account-list-item",{"multichain-account-list-item--selected":selected,"multichain-account-list-item--connected":!!connectedAvatar,"multichain-account-list-item--clickable":!!onClick}),ref:itemRef,onClick:function(){accountOptionsMenuOpen||null==onClick||onClick()}},startAccessory?react.createElement(component_library.az,{marginInlineEnd:2,marginTop:1},startAccessory):null,selected&&react.createElement(component_library.az,{className:"multichain-account-list-item__selected-indicator",borderRadius:design_system.Z6.pill,backgroundColor:design_system.Q1.primaryDefault}),react.createElement(react.Fragment,null,react.createElement(component_library.az,{display:[design_system.nl.Flex,design_system.nl.None],"data-testid":"account-list-item-badge"},react.createElement(connected_status.s,{address:account.address,isActive:void 0!==_param_isActive&&_param_isActive})),react.createElement(component_library.az,{display:[design_system.nl.None,design_system.nl.Flex]},react.createElement(component_library.vs,{borderColor:design_system.cG.transparent,size:design_system.or.MD,address:account.address,variant:useBlockie?component_library.Uj.Blockies:component_library.Uj.Jazzicon,marginInlineEnd:2}),custodianIcon?react.createElement("img",{src:custodianIcon,"data-testid":"custody-logo",className:"custody-logo",alt:"custody logo",style:{backgroundColor:"light"===theme?"transparent":"white"}}):react.createElement(component_library.vs,{borderColor:design_system.cG.transparent,size:design_system.or.MD,address:account.address,variant:useBlockie?component_library.Uj.Blockies:component_library.Uj.Jazzicon,marginInlineEnd:2}))),react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Column,className:"multichain-account-list-item__content"},react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Column},react.createElement(component_library.az,{display:design_system.nl.Flex,justifyContent:design_system.A9.spaceBetween},react.createElement(component_library.az,{className:"multichain-account-list-item__account-name",marginInlineEnd:2,display:design_system.nl.Flex,alignItems:design_system.k2.center,gap:2},isPinned?react.createElement(component_library.In,{name:component_library.$M.Pin,size:component_library.lK.Xs,className:"account-pinned-icon","data-testid":"account-pinned-icon"}):null,isHidden?react.createElement(component_library.In,{name:component_library.$M.EyeSlash,size:component_library.lK.Xs,className:"account-hidden-icon"}):null,react.createElement(component_library.EY,{as:"button",onClick:function(e){e.stopPropagation(),null==onClick||onClick()},variant:design_system.J3.bodyMdMedium,className:"multichain-account-list-item__account-name__button",padding:0,backgroundColor:design_system.i0.transparent,width:design_system.Zf.Full,textAlign:design_system.nO.Left,ellipsis:!0},account.metadata.name.length>17?react.createElement(tooltip.A,{title:account.metadata.name,position:"bottom",wrapperClassName:"multichain-account-list-item__tooltip"},account.metadata.name):account.metadata.name)),react.createElement(component_library.EY,{as:"div",className:"multichain-account-list-item__asset",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,alignItems:design_system.k2.center,justifyContent:design_system.A9.flexEnd,ellipsis:!0,textAlign:design_system.nO.End},react.createElement(user_preferenced_currency_display_component.A,{account:account,ethNumberOfDecimals:3,value:balanceToTranslate,type:common.jd,showFiat:showFiat,isAggregatedFiatOverviewBalance:!isTestnet&&process.env.PORTFOLIO_VIEW&&shouldShowFiat,"data-testid":"first-currency-display",privacyMode:privacyMode})))),react.createElement(component_library.az,{display:design_system.nl.Flex,justifyContent:design_system.A9.spaceBetween},react.createElement(component_library.az,{display:design_system.nl.Flex,alignItems:design_system.k2.center},react.createElement(component_library.EY,{variant:design_system.J3.bodySm,color:design_system.Q1.textAlternative,"data-testid":"account-list-address"},(0,util.Wr)((0,address.Nf)(account.address)))),mappedOrderedTokenList.length>1?react.createElement(avatar_group.Z,{members:mappedOrderedTokenList,limit:4}):react.createElement(component_library.az,{display:design_system.nl.Flex,alignItems:design_system.k2.center,justifyContent:design_system.A9.center,gap:1,className:"multichain-account-list-item__avatar-currency"},react.createElement(component_library.hQ,{src:primaryTokenImage,name:nativeCurrency,size:component_library.gh.Xs,borderColor:design_system.cG.borderDefault}),react.createElement(component_library.EY,{variant:design_system.J3.bodySm,color:design_system.r7.textAlternative,textAlign:design_system.nO.End,as:"div"},react.createElement(user_preferenced_currency_display_component.A,{account:account,ethNumberOfDecimals:3,value:isEvmNetwork?account.balance:balanceToTranslate,type:common.lS,showNative:!0,"data-testid":"second-currency-display",privacyMode:privacyMode})))),accountLabel?react.createElement(component_library.vw,{label:accountLabel,labelProps:{variant:design_system.J3.bodyXs,color:design_system.Q1.textAlternative},startIconName:account.metadata.keyring.type===keyring.ci.snap?component_library.$M.Snaps:null}):null),menuType===account_list_item_types.P.None?null:react.createElement(component_library.a2,{ariaLabel:"".concat(account.metadata.name," ").concat(t("options")),iconName:component_library.$M.MoreVertical,size:component_library.lK.Sm,ref:function(ref){setAccountListItemMenuElement(ref)},onClick:function(e){e.stopPropagation(),accountOptionsMenuOpen||trackEvent({event:metametrics.gP.AccountDetailMenuOpened,category:metametrics.FZ.Navigation,properties:{location:"Account Options"}}),setAccountOptionsMenuOpen(!accountOptionsMenuOpen)},"data-testid":"account-list-item-menu-button"}),menuType===account_list_item_types.P.Account&&react.createElement(account_list_item_menu.S,{anchorElement:accountListItemMenuElement,account:account,onClose:function(){return setAccountOptionsMenuOpen(!1)},isOpen:accountOptionsMenuOpen,isRemovable:account.metadata.keyring.type!==keyring.ci.hdKeyTree,closeMenu:closeMenu,isPinned:isPinned,isHidden:isHidden,isConnected:isConnected}),menuType===account_list_item_types.P.Connection&&react.createElement(connected_accounts_menu.P,{anchorElement:accountListItemMenuElement,account:account,onClose:function(){return setAccountOptionsMenuOpen(!1)},disableAccountSwitcher:1===accountsCount&&selected,isOpen:accountOptionsMenuOpen,onActionClick:onActionClick,activeTabOrigin:currentTabOrigin}))};AccountListItem.propTypes={account:prop_types_default().shape({id:prop_types_default().string.isRequired,address:prop_types_default().string.isRequired,balance:prop_types_default().string.isRequired,metadata:prop_types_default().shape({name:prop_types_default().string.isRequired,snap:prop_types_default().shape({id:prop_types_default().string.isRequired,name:prop_types_default().string,enabled:prop_types_default().bool}),keyring:prop_types_default().shape({type:prop_types_default().string.isRequired}).isRequired}).isRequired}).isRequired,selected:prop_types_default().bool.isRequired,onClick:prop_types_default().func,accountsCount:prop_types_default().number,closeMenu:prop_types_default().func,onActionClick:prop_types_default().func,connectedAvatar:prop_types_default().string,menuType:prop_types_default().string,isPinned:prop_types_default().bool,isHidden:prop_types_default().bool,currentTabOrigin:prop_types_default().string,isActive:prop_types_default().bool,startAccessory:prop_types_default().node,shouldScrollToWhenSelected:prop_types_default().bool,privacyMode:prop_types_default().bool},AccountListItem.displayName="AccountListItem";let account_list_item=react.memo(AccountListItem);AccountListItem.__docgenInfo={description:"",methods:[],displayName:"AccountListItem",props:{isPinned:{defaultValue:{value:"false",computed:!1},description:"Represents pinned accounts",type:{name:"bool"},required:!1},menuType:{defaultValue:{value:"'none'",computed:!1},description:"Represents the type of menu to be rendered",type:{name:"string"},required:!1},isHidden:{defaultValue:{value:"false",computed:!1},description:"Represents hidden accounts",type:{name:"bool"},required:!1},isActive:{defaultValue:{value:"false",computed:!1},description:"Represents active accounts",type:{name:"bool"},required:!1},shouldScrollToWhenSelected:{defaultValue:{value:"true",computed:!1},description:"Determines if list item should be scrolled to when selected",type:{name:"bool"},required:!1},privacyMode:{defaultValue:{value:"false",computed:!1},description:"Determines if list balance should be obfuscated",type:{name:"bool"},required:!1},account:{description:"An account object that has name, address, and balance data",type:{name:"shape",value:{id:{name:"string",required:!0},address:{name:"string",required:!0},balance:{name:"string",required:!0},metadata:{name:"shape",value:{name:{name:"string",required:!0},snap:{name:"shape",value:{id:{name:"string",required:!0},name:{name:"string",required:!1},enabled:{name:"bool",required:!1}},required:!1},keyring:{name:"shape",value:{type:{name:"string",required:!0}},required:!0}},required:!0}}},required:!0},selected:{description:"Represents if this account is currently selected",type:{name:"bool"},required:!0},onClick:{description:"Function to execute when the item is clicked",type:{name:"func"},required:!1},accountsCount:{description:"Represents how many accounts are being listed",type:{name:"number"},required:!1},closeMenu:{description:"Function that closes the menu",type:{name:"func"},required:!1},onActionClick:{description:"Function to set account name to show disconnect toast when an account is disconnected",type:{name:"func"},required:!1},connectedAvatar:{description:"File location of the avatar icon",type:{name:"string"},required:!1},currentTabOrigin:{description:"Represents current tab origin",type:{name:"string"},required:!1},startAccessory:{description:"Represents start accessory",type:{name:"node"},required:!1}}}},"./ui/helpers/constants/connected-sites.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Fs:()=>STATUS_CONNECTED_TO_ANOTHER_ACCOUNT,J7:()=>STATUS_CONNECTED,U6:()=>STATUS_CONNECTED_TO_SNAP,vr:()=>STATUS_NOT_CONNECTED});var STATUS_CONNECTED="STATUS_CONNECTED",STATUS_CONNECTED_TO_ANOTHER_ACCOUNT="STATUS_CONNECTED_TO_ANOTHER_ACCOUNT",STATUS_NOT_CONNECTED="STATUS_NOT_CONNECTED",STATUS_CONNECTED_TO_SNAP="STATUS_CONNECTED_TO_SNAP"},"./ui/helpers/utils/accounts.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{KM:()=>getAccountLabel,ZX:()=>getAvatarNetworkColor,kN:()=>getAccountNameErrorMessage});var _components_component_library__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/components/component-library/index.ts"),_shared_constants_network__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./shared/constants/network.ts"),_constants_design_system__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_shared_constants_keyring__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./shared/constants/keyring.ts"),_shared_constants_hardware_wallets__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./shared/constants/hardware-wallets.ts"),_app_scripts_translate__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./app/scripts/translate.ts");function getAccountNameErrorMessage(accounts,context,newAccountName,defaultAccountName){var errorMessage,isDuplicateAccountName=accounts.some(function(item){return item.metadata.name.toLowerCase()===newAccountName.toLowerCase()}),isEmptyAccountName=""===newAccountName,localizedWordForAccount=context.t("newAccountNumberName").replace(" $1",""),isReservedAccountName=RegExp("^\\s*".concat(localizedWordForAccount," \\d+\\s*$"),"iu").test(newAccountName),isValidAccountName=newAccountName.toLowerCase()===defaultAccountName.toLowerCase()||!isDuplicateAccountName&&!isReservedAccountName&&!isEmptyAccountName;return isValidAccountName?errorMessage=_components_component_library__WEBPACK_IMPORTED_MODULE_0__.jM:isDuplicateAccountName?errorMessage=context.t("accountNameDuplicate"):isReservedAccountName?errorMessage=context.t("accountNameReserved"):isEmptyAccountName&&(errorMessage=context.t("required")),{isValidAccountName:isValidAccountName,errorMessage:errorMessage}}function getAvatarNetworkColor(name){switch(name){case _shared_constants_network__WEBPACK_IMPORTED_MODULE_1__.iq:return _constants_design_system__WEBPACK_IMPORTED_MODULE_2__.i0.goerli;case _shared_constants_network__WEBPACK_IMPORTED_MODULE_1__.u$:return _constants_design_system__WEBPACK_IMPORTED_MODULE_2__.i0.lineaGoerli;case _shared_constants_network__WEBPACK_IMPORTED_MODULE_1__.Zk:return _constants_design_system__WEBPACK_IMPORTED_MODULE_2__.i0.lineaSepolia;case _shared_constants_network__WEBPACK_IMPORTED_MODULE_1__.hR:return _constants_design_system__WEBPACK_IMPORTED_MODULE_2__.i0.sepolia;default:return}}function getAccountLabel(type,account,snapName){if(!account)return null;switch(type){case _shared_constants_keyring__WEBPACK_IMPORTED_MODULE_3__.ci.hdKeyTree:return null;case _shared_constants_keyring__WEBPACK_IMPORTED_MODULE_3__.ci.imported:return(0,_app_scripts_translate__WEBPACK_IMPORTED_MODULE_5__.t)("imported");case _shared_constants_keyring__WEBPACK_IMPORTED_MODULE_3__.ci.qr:return _shared_constants_hardware_wallets__WEBPACK_IMPORTED_MODULE_4__.GZ.qr;case _shared_constants_keyring__WEBPACK_IMPORTED_MODULE_3__.ci.trezor:return _shared_constants_hardware_wallets__WEBPACK_IMPORTED_MODULE_4__.GZ.trezor;case _shared_constants_keyring__WEBPACK_IMPORTED_MODULE_3__.ci.ledger:return _shared_constants_hardware_wallets__WEBPACK_IMPORTED_MODULE_4__.GZ.ledger;case _shared_constants_keyring__WEBPACK_IMPORTED_MODULE_3__.ci.lattice:return _shared_constants_hardware_wallets__WEBPACK_IMPORTED_MODULE_4__.GZ.lattice;case _shared_constants_keyring__WEBPACK_IMPORTED_MODULE_3__.ci.snap:if(snapName)return"".concat(snapName," (").concat((0,_app_scripts_translate__WEBPACK_IMPORTED_MODULE_5__.t)("beta"),")");return"".concat((0,_app_scripts_translate__WEBPACK_IMPORTED_MODULE_5__.t)("snaps")," (").concat((0,_app_scripts_translate__WEBPACK_IMPORTED_MODULE_5__.t)("beta"),")");default:return null}}},"./ui/hooks/useAccountTotalFiatBalance.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{r:()=>useAccountTotalFiatBalance});var react_redux__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react-redux/es/index.js"),ethereumjs_util__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/ethereumjs-util/dist.browser/index.js"),_shared_modules_selectors_networks__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./shared/modules/selectors/networks.ts"),_selectors__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/selectors/index.js"),_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./shared/modules/conversion.utils.ts"),_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/ducks/metamask/metamask.js"),_helpers_utils_confirm_tx_util__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/helpers/utils/confirm-tx.util.ts"),_helpers_utils_token_util__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/helpers/utils/token-util.js"),_helpers_utils_util__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./ui/helpers/utils/util.js"),_useTokenBalances__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./ui/hooks/useTokenBalances.ts");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _iterable_to_array(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _non_iterable_spread(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}function _to_consumable_array(arr){return _array_without_holes(arr)||_iterable_to_array(arr)||_unsupported_iterable_to_array(arr)||_non_iterable_spread()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var useAccountTotalFiatBalance=function(account,shouldHideZeroBalanceTokens){var result,_detectedTokens_currentChainId,_cachedBalances_account_address,_detectedTokens_currentChainId_account_address,currentChainId=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_shared_modules_selectors_networks__WEBPACK_IMPORTED_MODULE_2__.gr),conversionRate=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_5__.fR),currentCurrency=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_5__.Fx),contractExchangeRates=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_3__.K_j,react_redux__WEBPACK_IMPORTED_MODULE_0__.bN),confirmationExchangeRates=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_3__._f$),cachedBalances=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_3__.lGj),balance=null!==(_cachedBalances_account_address=null==cachedBalances?void 0:cachedBalances[null==account?void 0:account.address])&&void 0!==_cachedBalances_account_address?_cachedBalances_account_address:0,nativeFiat=(0,_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__.gh)({value:balance,toCurrency:currentCurrency,conversionRate:conversionRate,numberOfDecimals:2}),detectedTokens=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_3__.YRm),tokens=null!==(_detectedTokens_currentChainId_account_address=null==detectedTokens?void 0:null===(_detectedTokens_currentChainId=detectedTokens[currentChainId])||void 0===_detectedTokens_currentChainId?void 0:_detectedTokens_currentChainId[null==account?void 0:account.address])&&void 0!==_detectedTokens_currentChainId_account_address?_detectedTokens_currentChainId_account_address:[],allTokenList=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_3__.iM3),primaryTokenImage=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_3__.Q3H),nativeCurrency=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_5__.Zt),tokensWithBalances=(0,_useTokenBalances__WEBPACK_IMPORTED_MODULE_9__.H6)({chainId:currentChainId,tokens:tokens,address:null==account?void 0:account.address,hideZeroBalanceTokens:shouldHideZeroBalanceTokens}).tokensWithBalances,mergedRates=_object_spread({},contractExchangeRates,confirmationExchangeRates),tokenFiatBalances=tokensWithBalances.map(function(token){var tokenExchangeRate=mergedRates[(0,ethereumjs_util__WEBPACK_IMPORTED_MODULE_1__.toChecksumAddress)(token.address)];return(0,_helpers_utils_token_util__WEBPACK_IMPORTED_MODULE_7__.aQ)(tokenExchangeRate,conversionRate,currentCurrency,token.string,token.symbol,!1,!1)}),orderedTokenList=[{iconUrl:primaryTokenImage,symbol:nativeCurrency,fiatBalance:nativeFiat}].concat(_to_consumable_array((result=[],tokensWithBalances.forEach(function(token){var matchingToken=allTokenList[token.address.toLowerCase()];matchingToken&&result.push(_object_spread_props(_object_spread({},matchingToken),{balance:token.balance,string:token.string,balanceError:token.balanceError}))}),result).map(function(item,index){return _object_spread_props(_object_spread({},item),{fiatBalance:tokenFiatBalances[index]})}))).sort(function(a,b){return parseFloat(b.fiatBalance)-parseFloat(a.fiatBalance)}),totalFiatBalance=_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__.s3.apply(void 0,[nativeFiat].concat(_to_consumable_array(tokenFiatBalances))).toString(10);tokensWithBalances.forEach(function(token){token.string=(0,_helpers_utils_util__WEBPACK_IMPORTED_MODULE_8__.eP)(token.string,5)}),tokensWithBalances.forEach(function(token){var tokenExchangeRate=mergedRates[(0,ethereumjs_util__WEBPACK_IMPORTED_MODULE_1__.toChecksumAddress)(token.address)];token.tokenFiatAmount=(0,_helpers_utils_token_util__WEBPACK_IMPORTED_MODULE_7__.aQ)(tokenExchangeRate,conversionRate,currentCurrency,token.string,token.symbol,!1,!1)||"0"});var formattedFiat=(0,_helpers_utils_confirm_tx_util__WEBPACK_IMPORTED_MODULE_6__.vv)(totalFiatBalance,currentCurrency),totalWeiBalance=(0,_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__.$y)({value:totalFiatBalance,fromCurrency:currentCurrency,conversionRate:conversionRate,invertConversionRate:!0});return"NaN"===totalWeiBalance&&(totalWeiBalance="0x0"),{formattedFiat:formattedFiat,totalWeiBalance:totalWeiBalance,totalFiatBalance:totalFiatBalance,tokensWithBalances:tokensWithBalances,loading:!1,orderedTokenList:orderedTokenList,mergedRates:mergedRates}}},"./ui/components/multichain/badge-status/badge-status.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{C:()=>BadgeStatus});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_redux__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-redux/es/index.js"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_component_library__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/components/component-library/index.ts"),_selectors__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/selectors/index.js"),_ui_tooltip__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/components/ui/tooltip/index.js"),_selectors_institutional_selectors__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/selectors/institutional/selectors.ts");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function _object_without_properties(source,excluded){if(null==source)return{};var key,i,target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _object_without_properties_loose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}var BadgeStatus=function(_param){var _param_className=_param.className,_param_badgeBackgroundColor=_param.badgeBackgroundColor,badgeBackgroundColor=void 0===_param_badgeBackgroundColor?_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.i0.backgroundAlternative:_param_badgeBackgroundColor,_param_badgeBorderColor=_param.badgeBorderColor,badgeBorderColor=void 0===_param_badgeBorderColor?_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.cG.borderMuted:_param_badgeBorderColor,address=_param.address,_param_isConnectedAndNotActive=_param.isConnectedAndNotActive,isConnectedAndNotActive=void 0!==_param_isConnectedAndNotActive&&_param_isConnectedAndNotActive,text=_param.text,props=_object_without_properties(_param,["className","badgeBackgroundColor","badgeBorderColor","address","isConnectedAndNotActive","text"]),useBlockie=(0,react_redux__WEBPACK_IMPORTED_MODULE_2__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_5__.bNi),custodianIcon=(0,react_redux__WEBPACK_IMPORTED_MODULE_2__.d4)(function(state){return(0,_selectors_institutional_selectors__WEBPACK_IMPORTED_MODULE_7__.hq)(state,address)});return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_4__.az,_object_spread({className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("multichain-badge-status",void 0===_param_className?"":_param_className),"data-testid":"multichain-badge-status",as:"button",display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.Flex,alignItems:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.k2.center,justifyContent:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.A9.center,backgroundColor:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.i0.transparent},props),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_ui_tooltip__WEBPACK_IMPORTED_MODULE_6__.A,{style:{display:"flex"},title:text,"data-testid":"multichain-badge-status__tooltip",position:"bottom"},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_4__.ph,{positionObj:isConnectedAndNotActive?{bottom:2,right:5}:{bottom:-1,right:2},badge:react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_4__.az,{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("multichain-badge-status__badge",{"multichain-badge-status__badge-not-connected":isConnectedAndNotActive}),backgroundColor:badgeBackgroundColor,borderRadius:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Z6.full,borderColor:badgeBorderColor,borderWidth:2})},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_4__.vs,{borderColor:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.cG.transparent,size:_component_library__WEBPACK_IMPORTED_MODULE_4__.oG.Md,address:address,variant:useBlockie?_component_library__WEBPACK_IMPORTED_MODULE_4__.Uj.Blockies:_component_library__WEBPACK_IMPORTED_MODULE_4__.Uj.Jazzicon,marginInlineEnd:2}),custodianIcon?react__WEBPACK_IMPORTED_MODULE_0__.createElement("img",{src:custodianIcon,"data-testid":"custody-logo",className:"custody-logo",alt:"custody logo"}):react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_4__.vs,{borderColor:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.cG.transparent,size:_component_library__WEBPACK_IMPORTED_MODULE_4__.oG.Md,address:address,variant:useBlockie?_component_library__WEBPACK_IMPORTED_MODULE_4__.Uj.Blockies:_component_library__WEBPACK_IMPORTED_MODULE_4__.Uj.Jazzicon,marginInlineEnd:2}))))};try{BadgeStatus.displayName="BadgeStatus",BadgeStatus.__docgenInfo={description:"",displayName:"BadgeStatus",props:{className:{defaultValue:{value:""},description:"* Additional class name for the ImportTokenLink component.",name:"className",required:!1,type:{name:"string"}},badgeBorderColor:{defaultValue:{value:"BorderColor.borderMuted"},description:"Border color based on the connection status",name:"badgeBorderColor",required:!1,type:{name:"enum",value:[{value:'"border-default"'},{value:'"border-muted"'},{value:'"primary-default"'},{value:'"primary-alternative"'},{value:'"primary-muted"'},{value:'"error-default"'},{value:'"error-alternative"'},{value:'"error-muted"'},{value:'"warning-default"'},{value:'"warning-muted"'},{value:'"success-default"'},{value:'"success-muted"'},{value:'"info-default"'},{value:'"info-muted"'},{value:'"mainnet"'},{value:'"goerli"'},{value:'"sepolia"'},{value:'"linea-goerli"'},{value:'"linea-sepolia"'},{value:'"linea-mainnet"'},{value:'"transparent"'},{value:'"localhost"'},{value:'"background-default"'}]}},badgeBackgroundColor:{defaultValue:{value:"BackgroundColor.backgroundAlternative"},description:"Background Color of Badge",name:"badgeBackgroundColor",required:!1,type:{name:"enum",value:[{value:'"background-default"'},{value:'"background-alternative"'},{value:'"background-muted"'},{value:'"background-alternative-soft"'},{value:'"background-hover"'},{value:'"background-pressed"'},{value:'"icon-default"'},{value:'"icon-alternative"'},{value:'"icon-muted"'},{value:'"overlay-default"'},{value:'"overlay-alternative"'},{value:'"primary-default"'},{value:'"primary-alternative"'},{value:'"primary-muted"'},{value:'"error-default"'},{value:'"error-alternative"'},{value:'"error-muted"'},{value:'"warning-default"'},{value:'"warning-muted"'},{value:'"success-default"'},{value:'"success-muted"'},{value:'"info-default"'},{value:'"info-muted"'},{value:'"mainnet"'},{value:'"goerli"'},{value:'"sepolia"'},{value:'"linea-goerli"'},{value:'"linea-sepolia"'},{value:'"linea-mainnet"'},{value:'"transparent"'},{value:'"localhost"'}]}},text:{defaultValue:null,description:"Connection status message on Tooltip",name:"text",required:!0,type:{name:"string"}},isConnectedAndNotActive:{defaultValue:{value:"false"},description:"To determine connection status",name:"isConnectedAndNotActive",required:!1,type:{name:"boolean"}},address:{defaultValue:null,description:"Address for AvatarAccount",name:"address",required:!0,type:{name:"string"}},flexDirection:{defaultValue:null,description:"The flex direction of the component.\nUse the FlexDirection enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"flexDirection",required:!1,type:{name:"FlexDirection | FlexDirectionArray"}},flexWrap:{defaultValue:null,description:"The flex wrap of the component.\nUse the FlexWrap enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"flexWrap",required:!1,type:{name:"FlexWrap | FlexWrapArray"}},gap:{defaultValue:null,description:"The gap between the component's children.\nUse 1-12 for a gap of 4px-48px.\nAccepts responsive props in the form of an array.",name:"gap",required:!1,type:{name:"SizeNumber | SizeNumberArray"}},margin:{defaultValue:null,description:"The margin of the component.\nUse 1-12 for 4px-48px or 'auto'.\nAccepts responsive props in the form of an array.",name:"margin",required:!1,type:{name:"SizeNumberAndAuto | SizeNumberAndAutoArray"}},marginTop:{defaultValue:null,description:"The margin-top of the component.\nUse 1-12 for 4px-48px or 'auto'.\nAccepts responsive props in the form of an array.",name:"marginTop",required:!1,type:{name:"SizeNumberAndAuto | SizeNumberAndAutoArray"}},marginBottom:{defaultValue:null,description:"The margin-bottom of the component.\nUse 1-12 for 4px-48px or 'auto'.\nAccepts responsive props in the form of an array.",name:"marginBottom",required:!1,type:{name:"SizeNumberAndAuto | SizeNumberAndAutoArray"}},marginRight:{defaultValue:null,description:"The margin-right of the component.\nUse 1-12 for 4px-48px or 'auto'.\nAccepts responsive props in the form of an array.",name:"marginRight",required:!1,type:{name:"SizeNumberAndAuto | SizeNumberAndAutoArray"}},marginLeft:{defaultValue:null,description:"The margin-left of the component.\nUse 1-12 for 4px-48px or 'auto'.\nAccepts responsive props in the form of an array.",name:"marginLeft",required:!1,type:{name:"SizeNumberAndAuto | SizeNumberAndAutoArray"}},marginInline:{defaultValue:null,description:"The margin-inline of the component.\nUse 1-12 for 4px-48px or 'auto'.\nAccepts responsive props in the form of an array.",name:"marginInline",required:!1,type:{name:"SizeNumberAndAuto | SizeNumberAndAutoArray"}},marginInlineStart:{defaultValue:null,description:"The margin-inline-start of the component.\nUse 1-12 for 4px-48px or 'auto'.\nAccepts responsive props in the form of an array.",name:"marginInlineStart",required:!1,type:{name:"SizeNumberAndAuto | SizeNumberAndAutoArray"}},marginInlineEnd:{defaultValue:null,description:"The margin-inline-end of the component.\nUse 1-12 for 4px-48px or 'auto'.\nAccepts responsive props in the form of an array.",name:"marginInlineEnd",required:!1,type:{name:"SizeNumberAndAuto | SizeNumberAndAutoArray"}},padding:{defaultValue:null,description:"The padding of the component.\nUse 1-12 for 4px-48px.\nAccepts responsive props in the form of an array.",name:"padding",required:!1,type:{name:"SizeNumber | SizeNumberArray"}},paddingTop:{defaultValue:null,description:"The padding-top of the component.\nUse 1-12 for 4px-48px.\nAccepts responsive props in the form of an array.",name:"paddingTop",required:!1,type:{name:"SizeNumber | SizeNumberArray"}},paddingBottom:{defaultValue:null,description:"The padding-bottom of the component.\nUse 1-12 for 4px-48px.\nAccepts responsive props in the form of an array.",name:"paddingBottom",required:!1,type:{name:"SizeNumber | SizeNumberArray"}},paddingRight:{defaultValue:null,description:"The padding-right of the component.\nUse 1-12 for 4px-48px.\nAccepts responsive props in the form of an array.",name:"paddingRight",required:!1,type:{name:"SizeNumber | SizeNumberArray"}},paddingLeft:{defaultValue:null,description:"The padding-left of the component.\nUse 1-12 for 4px-48px.\nAccepts responsive props in the form of an array.",name:"paddingLeft",required:!1,type:{name:"SizeNumber | SizeNumberArray"}},paddingInline:{defaultValue:null,description:"The padding-inline of the component.\nUse 1-12 for 4px-48px.\nAccepts responsive props in the form of an array.",name:"paddingInline",required:!1,type:{name:"SizeNumber | SizeNumberArray"}},paddingInlineStart:{defaultValue:null,description:"The padding-inline-start of the component.\nUse 1-12 for 4px-48px.\nAccepts responsive props in the form of an array.",name:"paddingInlineStart",required:!1,type:{name:"SizeNumber | SizeNumberArray"}},paddingInlineEnd:{defaultValue:null,description:"The padding-inline-end of the component.\nUse 1-12 for 4px-48px.\nAccepts responsive props in the form of an array.",name:"paddingInlineEnd",required:!1,type:{name:"SizeNumber | SizeNumberArray"}},borderColor:{defaultValue:null,description:"The border-color of the component.\nUse BorderColor enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"borderColor",required:!1,type:{name:"BorderColor | BorderColorArray"}},borderWidth:{defaultValue:null,description:"The border-width of the component.\nUse 1-12 for 1px-12px.\nAccepts responsive props in the form of an array.",name:"borderWidth",required:!1,type:{name:"SizeNumber | SizeNumberArray"}},borderRadius:{defaultValue:null,description:"The border-radius of the component.\nUse BorderRadius enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"borderRadius",required:!1,type:{name:"BorderRadius | BorderRadiusArray"}},borderStyle:{defaultValue:null,description:"The border-style of the component.\nUse BorderStyle enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"borderStyle",required:!1,type:{name:"BorderStyle | BorderStyleArray"}},alignItems:{defaultValue:null,description:"The align-items of the component.\nUse AlignItems enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"alignItems",required:!1,type:{name:"AlignItems | AlignItemsArray"}},justifyContent:{defaultValue:null,description:"The justify-content of the component.\nUse JustifyContent enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"justifyContent",required:!1,type:{name:"JustifyContent | JustifyContentArray"}},textAlign:{defaultValue:null,description:"The text-align of the component.\nUse TextAlign enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"textAlign",required:!1,type:{name:"TextAlign | TextAlignArray"}},display:{defaultValue:null,description:"The display of the component.\nUse Display enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"display",required:!1,type:{name:"Display | DisplayArray"}},width:{defaultValue:null,description:"The width of the component.\nUse BlockSize enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"width",required:!1,type:{name:"BlockSize | BlockSizeArray"}},minWidth:{defaultValue:null,description:"The min-width of the component.\nUse BlockSize enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"minWidth",required:!1,type:{name:"BlockSize | BlockSizeArray"}},height:{defaultValue:null,description:"The height of the component.\nUse BlockSize enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"height",required:!1,type:{name:"BlockSize | BlockSizeArray"}},backgroundColor:{defaultValue:null,description:"The background-color of the component.\nUse BackgroundColor enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"backgroundColor",required:!1,type:{name:"BackgroundColor | BackgroundColorArray"}},color:{defaultValue:null,description:"The text-color of the component.\nUse TextColor enum from '../../../helpers/constants/design-system';\nAccepts responsive props in the form of an array.",name:"color",required:!1,type:{name:"TextColor | IconColor | TextColorArray | IconColorArray"}},"data-testid":{defaultValue:null,description:"An optional data-testid to apply to the component.\nTypeScript is complaining about data- attributes which means we need to explicitly define this as a prop.\nTODO: Allow data- attributes.",name:"data-testid",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/multichain/badge-status/badge-status.tsx#BadgeStatus"]={docgenInfo:BadgeStatus.__docgenInfo,name:"BadgeStatus",path:"ui/components/multichain/badge-status/badge-status.tsx#BadgeStatus"})}catch(__react_docgen_typescript_loader_error){}},"./ui/components/multichain/connected-accounts-menu/connected-accounts-menu.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{P:()=>ConnectedAccountsMenu});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_redux__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react-redux/es/index.js"),_component_library__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/components/component-library/index.ts"),_ui_menu__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/components/ui/menu/index.js"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/hooks/useI18nContext.js"),_store_actions__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/__mocks__/actions.js"),_selectors__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/selectors/index.js"),_permission_details_modal_permission_details_modal__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./ui/components/multichain/permission-details-modal/permission-details-modal.tsx");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var TsMenuItem=_ui_menu__WEBPACK_IMPORTED_MODULE_3__.D,ConnectedAccountsMenu=function(param){var isOpen=param.isOpen,account=param.account,anchorElement=param.anchorElement,_param_disableAccountSwitcher=param.disableAccountSwitcher,onClose=param.onClose,onActionClick=param.onActionClick,activeTabOrigin=param.activeTabOrigin,dispatch=(0,react_redux__WEBPACK_IMPORTED_MODULE_1__.wA)(),t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_5__.P)(),popoverDialogRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),_useState=_sliced_to_array((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),2),showPermissionModal=_useState[0],setShowPermissionModal=_useState[1],permissions=(0,react_redux__WEBPACK_IMPORTED_MODULE_1__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_7__.xSt),handleClickOutside=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(event){(null==popoverDialogRef?void 0:popoverDialogRef.current)&&!popoverDialogRef.current.contains(event.target)&&onClose()},[onClose]);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function(){return document.addEventListener("mousedown",handleClickOutside),function(){document.removeEventListener("mousedown",handleClickOutside)}},[handleClickOutside]);var handleKeyDown=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(event){var _popoverDialogRef_current;"Tab"===event.key&&(null==popoverDialogRef?void 0:null===(_popoverDialogRef_current=popoverDialogRef.current)||void 0===_popoverDialogRef_current?void 0:_popoverDialogRef_current.contains(event.target))&&onClose&&onClose()},[onClose]);return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.AM,{className:"multichain-connected-accounts-menu__popover",referenceElement:anchorElement,role:_component_library__WEBPACK_IMPORTED_MODULE_2__.c6.Dialog,position:_component_library__WEBPACK_IMPORTED_MODULE_2__.$x.Bottom,offset:[0,0],padding:0,isOpen:isOpen,flip:!0,preventOverflow:!0,isPortal:!0},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.Qc,{restoreFocus:!0,initialFocusRef:{current:anchorElement}},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{onKeyDown:handleKeyDown,ref:popoverDialogRef},(null==permissions?void 0:permissions.length)?react__WEBPACK_IMPORTED_MODULE_0__.createElement(TsMenuItem,{iconName:_component_library__WEBPACK_IMPORTED_MODULE_2__.$M.SecurityTick,"data-testid":"permission-details-menu-item",onClick:function(){setShowPermissionModal(!0),onClose()}},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.EY,{variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.bodyMd},t("permissionDetails"))):null,void 0!==_param_disableAccountSwitcher&&_param_disableAccountSwitcher?null:react__WEBPACK_IMPORTED_MODULE_0__.createElement(TsMenuItem,{iconName:_component_library__WEBPACK_IMPORTED_MODULE_2__.$M.SwapHorizontal,"data-testid":"switch-account-menu-item",onClick:function(){dispatch((0,_store_actions__WEBPACK_IMPORTED_MODULE_6__.setSelectedAccount)(account.address)),onClose()}},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.EY,{variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.bodyMd},t("switchToThisAccount"))),react__WEBPACK_IMPORTED_MODULE_0__.createElement(TsMenuItem,{iconName:_component_library__WEBPACK_IMPORTED_MODULE_2__.$M.Logout,iconColor:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.Li.errorDefault,"data-testid":"disconnect-menu-item",onClick:function(){onActionClick(account.metadata.name),dispatch((0,_store_actions__WEBPACK_IMPORTED_MODULE_6__.removePermittedAccount)(activeTabOrigin,account.address))}},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.EY,{color:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.r7.errorDefault,variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.J3.bodyMd},t("disconnect")))))),showPermissionModal?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_permission_details_modal_permission_details_modal__WEBPACK_IMPORTED_MODULE_8__.X,{isOpen:showPermissionModal,account:account,onClick:function(){dispatch((0,_store_actions__WEBPACK_IMPORTED_MODULE_6__.removePermittedAccount)(activeTabOrigin,account.address))},onClose:function(){return setShowPermissionModal(!1)},permissions:permissions}):null)};try{ConnectedAccountsMenu.displayName="ConnectedAccountsMenu",ConnectedAccountsMenu.__docgenInfo={description:"",displayName:"ConnectedAccountsMenu",props:{isOpen:{defaultValue:null,description:"",name:"isOpen",required:!0,type:{name:"boolean"}},account:{defaultValue:null,description:"",name:"account",required:!0,type:{name:"Identity"}},anchorElement:{defaultValue:null,description:"",name:"anchorElement",required:!0,type:{name:"HTMLElement | null"}},disableAccountSwitcher:{defaultValue:{value:"false"},description:"",name:"disableAccountSwitcher",required:!1,type:{name:"boolean"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!0,type:{name:"() => void"}},onActionClick:{defaultValue:null,description:"",name:"onActionClick",required:!0,type:{name:"(message: string) => void"}},activeTabOrigin:{defaultValue:null,description:"",name:"activeTabOrigin",required:!0,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/multichain/connected-accounts-menu/connected-accounts-menu.tsx#ConnectedAccountsMenu"]={docgenInfo:ConnectedAccountsMenu.__docgenInfo,name:"ConnectedAccountsMenu",path:"ui/components/multichain/connected-accounts-menu/connected-accounts-menu.tsx#ConnectedAccountsMenu"})}catch(__react_docgen_typescript_loader_error){}},"./ui/components/multichain/connected-accounts-menu/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{P:()=>_connected_accounts_menu__WEBPACK_IMPORTED_MODULE_0__.P});var _connected_accounts_menu__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/components/multichain/connected-accounts-menu/connected-accounts-menu.tsx")},"./ui/components/multichain/connected-status/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{s:()=>ConnectedStatus});var react=__webpack_require__("./node_modules/react/index.js"),es=__webpack_require__("./node_modules/react-redux/es/index.js"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),selectors=__webpack_require__("./ui/selectors/index.js"),connected_sites=__webpack_require__("./ui/helpers/constants/connected-sites.js"),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.js"),badge_status=__webpack_require__("./ui/components/multichain/badge-status/badge-status.tsx"),ConnectedStatus=function(param){var _param_address=param.address,address=void 0===_param_address?"":_param_address,isActive=param.isActive,t=(0,useI18nContext.P)(),currentTabIsConnectedToSelectedAddress=(0,es.d4)(function(state){return(0,selectors.a$X)(state,address)}),status=connected_sites.vr;isActive?status=connected_sites.J7:currentTabIsConnectedToSelectedAddress&&(status=connected_sites.Fs);var badgeBorderColor=design_system.cG.backgroundDefault,badgeBackgroundColor=design_system.i0.iconAlternative,tooltipText=t("statusNotConnected");return status===connected_sites.J7?(badgeBorderColor=design_system.cG.backgroundDefault,badgeBackgroundColor=design_system.i0.successDefault,tooltipText=t("active")):status===connected_sites.Fs&&(badgeBorderColor=design_system.cG.successDefault,badgeBackgroundColor=design_system.i0.backgroundDefault,tooltipText=t("tooltipSatusConnectedUpperCase")),react.createElement(badge_status.C,{address:address,badgeBackgroundColor:badgeBackgroundColor,badgeBorderColor:badgeBorderColor,text:tooltipText,isConnectedAndNotActive:currentTabIsConnectedToSelectedAddress&&!isActive})};try{ConnectedStatus.displayName="ConnectedStatus",ConnectedStatus.__docgenInfo={description:"",displayName:"ConnectedStatus",props:{address:{defaultValue:{value:""},description:"",name:"address",required:!1,type:{name:"string"}},isActive:{defaultValue:null,description:"",name:"isActive",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/multichain/connected-status/connected-status.tsx#ConnectedStatus"]={docgenInfo:ConnectedStatus.__docgenInfo,name:"ConnectedStatus",path:"ui/components/multichain/connected-status/connected-status.tsx#ConnectedStatus"})}catch(__react_docgen_typescript_loader_error){}},"./ui/hooks/useAccountTotalCrossChainFiatBalance.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>useAccountTotalCrossChainFiatBalance});var react_redux__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react-redux/es/index.js"),ethereumjs_util__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/ethereumjs-util/dist.browser/index.js"),_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/ducks/metamask/metamask.js"),_selectors__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/selectors/index.js"),_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./shared/modules/conversion.utils.ts"),_helpers_utils_token_util__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/helpers/utils/token-util.js"),_shared_modules_selectors_networks__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./shared/modules/selectors/networks.ts");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _iterable_to_array(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _non_iterable_spread(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}function _to_consumable_array(arr){return _array_without_holes(arr)||_iterable_to_array(arr)||_unsupported_iterable_to_array(arr)||_non_iterable_spread()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var useAccountTotalCrossChainFiatBalance=function(account,formattedTokensWithBalancesPerChain){var allNetworks=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_shared_modules_selectors_networks__WEBPACK_IMPORTED_MODULE_6__.hX),currencyRates=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_2__.$4),currentCurrency=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_2__.Fx),crossChainContractRates=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_3__.THb,react_redux__WEBPACK_IMPORTED_MODULE_0__.bN),crossChainCachedBalances=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_3__.We4),mergedCrossChainRates=_object_spread({},crossChainContractRates),tokenFiatBalancesCrossChains=formattedTokensWithBalancesPerChain.map(function(singleChainTokenBalances){var _currencyRates_matchedChainSymbol,_crossChainCachedBalances_singleChainTokenBalances_chainId,_crossChainCachedBalances_singleChainTokenBalances_chainId_account_address,tokensWithBalances=singleChainTokenBalances.tokensWithBalances,matchedChainSymbol=allNetworks[singleChainTokenBalances.chainId].nativeCurrency,conversionRate=null==currencyRates?void 0:null===(_currencyRates_matchedChainSymbol=currencyRates[matchedChainSymbol])||void 0===_currencyRates_matchedChainSymbol?void 0:_currencyRates_matchedChainSymbol.conversionRate,tokenFiatBalances=tokensWithBalances.map(function(token){var _mergedCrossChainRates_singleChainTokenBalances_chainId,tokenExchangeRate=null==mergedCrossChainRates?void 0:null===(_mergedCrossChainRates_singleChainTokenBalances_chainId=mergedCrossChainRates[singleChainTokenBalances.chainId])||void 0===_mergedCrossChainRates_singleChainTokenBalances_chainId?void 0:_mergedCrossChainRates_singleChainTokenBalances_chainId[(0,ethereumjs_util__WEBPACK_IMPORTED_MODULE_1__.toChecksumAddress)(token.address)];return(0,_helpers_utils_token_util__WEBPACK_IMPORTED_MODULE_5__.aQ)(tokenExchangeRate,conversionRate,currentCurrency,token.string,token.symbol,!1,!1)}),balanceCached=null!==(_crossChainCachedBalances_singleChainTokenBalances_chainId_account_address=null==crossChainCachedBalances?void 0:null===(_crossChainCachedBalances_singleChainTokenBalances_chainId=crossChainCachedBalances[singleChainTokenBalances.chainId])||void 0===_crossChainCachedBalances_singleChainTokenBalances_chainId?void 0:_crossChainCachedBalances_singleChainTokenBalances_chainId[null==account?void 0:account.address])&&void 0!==_crossChainCachedBalances_singleChainTokenBalances_chainId_account_address?_crossChainCachedBalances_singleChainTokenBalances_chainId_account_address:0,nativeFiatValue=(0,_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__.gh)({value:balanceCached,toCurrency:currentCurrency,conversionRate:conversionRate,numberOfDecimals:2});return _object_spread_props(_object_spread({},singleChainTokenBalances),{tokenFiatBalances:tokenFiatBalances,nativeFiatValue:nativeFiatValue})});return{totalFiatBalance:tokenFiatBalancesCrossChains.reduce(function(accumulator,currentValue){var tmpCurrentValueFiatBalances=currentValue.tokenFiatBalances.filter(function(value){return void 0!==value}),totalFiatBalance=_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__.s3.apply(void 0,[currentValue.nativeFiatValue].concat(_to_consumable_array(tmpCurrentValueFiatBalances)));return accumulator+(totalFiatBalance.toNumber?totalFiatBalance.toNumber():Number(totalFiatBalance))},0).toString(10),tokenFiatBalancesCrossChains:tokenFiatBalancesCrossChains}}},"./ui/hooks/useGetFormattedTokensPerChain.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{O:()=>useGetFormattedTokensPerChain});var react_redux__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react-redux/es/index.js"),bn_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/bn.js/lib/bn.js"),_selectors__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/selectors/index.js"),_shared_modules_selectors_networks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./shared/modules/selectors/networks.ts"),_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./shared/modules/conversion.utils.ts"),_useTokenBalances__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/hooks/useTokenBalances.ts"),useGetFormattedTokensPerChain=function(account,shouldHideZeroBalanceTokens,shouldGetTokensPerCurrentChain,allChainIDs){var currentChainId=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_shared_modules_selectors_networks__WEBPACK_IMPORTED_MODULE_3__.gr),importedTokens=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_2__.YRm),currentTokenBalances=(0,_useTokenBalances__WEBPACK_IMPORTED_MODULE_5__.mK)({chainIds:allChainIDs});return{formattedTokensWithBalancesPerChain:(shouldGetTokensPerCurrentChain?[currentChainId]:allChainIDs).map(function(singleChain){var _importedTokens_singleChain,_importedTokens_singleChain_account_address,tokensWithBalances=(null!==(_importedTokens_singleChain_account_address=null==importedTokens?void 0:null===(_importedTokens_singleChain=importedTokens[singleChain])||void 0===_importedTokens_singleChain?void 0:_importedTokens_singleChain[null==account?void 0:account.address])&&void 0!==_importedTokens_singleChain_account_address?_importedTokens_singleChain_account_address:[]).reduce(function(acc,token){var _currentTokenBalances_tokenBalances_account_address_singleChain,_currentTokenBalances_tokenBalances_account_address,_currentTokenBalances_tokenBalances_account_address_singleChain_token_address,hexBalance=null!==(_currentTokenBalances_tokenBalances_account_address_singleChain_token_address=null===(_currentTokenBalances_tokenBalances_account_address=currentTokenBalances.tokenBalances[account.address])||void 0===_currentTokenBalances_tokenBalances_account_address?void 0:null===(_currentTokenBalances_tokenBalances_account_address_singleChain=_currentTokenBalances_tokenBalances_account_address[singleChain])||void 0===_currentTokenBalances_tokenBalances_account_address_singleChain?void 0:_currentTokenBalances_tokenBalances_account_address_singleChain[token.address])&&void 0!==_currentTokenBalances_tokenBalances_account_address_singleChain_token_address?_currentTokenBalances_tokenBalances_account_address_singleChain_token_address:"0x0";if("0x0"!==hexBalance||!shouldHideZeroBalanceTokens){var decimalBalance=(0,_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__.I0)(hexBalance);acc.push({address:token.address,symbol:token.symbol,decimals:token.decimals,balance:decimalBalance,string:(0,_useTokenBalances__WEBPACK_IMPORTED_MODULE_5__.mz)(new bn_js__WEBPACK_IMPORTED_MODULE_1__.BN(decimalBalance),new bn_js__WEBPACK_IMPORTED_MODULE_1__.BN(token.decimals))})}return acc},[]);return{chainId:singleChain,tokensWithBalances:tokensWithBalances}})}}},"./ui/hooks/useTheme.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{D:()=>useTheme});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_redux__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react-redux/es/index.js"),_selectors__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/selectors/index.js"),_shared_constants_preferences__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./shared/constants/preferences.ts");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var validThemes=Object.values(_shared_constants_preferences__WEBPACK_IMPORTED_MODULE_3__.S).filter(function(theme){return theme!==_shared_constants_preferences__WEBPACK_IMPORTED_MODULE_3__.S.os});function useTheme(){var settingTheme=(0,react_redux__WEBPACK_IMPORTED_MODULE_1__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_2__.O4b),_useState=_sliced_to_array((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(settingTheme),2),theme=_useState[0],setTheme=_useState[1];return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function(){var result=settingTheme&&settingTheme!==_shared_constants_preferences__WEBPACK_IMPORTED_MODULE_3__.S.os?settingTheme:document.documentElement.getAttribute("data-theme");validThemes.includes(result)||(console.warn('useTheme: Invalid theme resolved to "'.concat(result,'". Defaulting to "').concat(_shared_constants_preferences__WEBPACK_IMPORTED_MODULE_3__.S.light,'".')),setTheme(_shared_constants_preferences__WEBPACK_IMPORTED_MODULE_3__.S.light)),setTheme(result)},[settingTheme]),theme}},"./ui/hooks/useTokenBalances.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{mz:()=>stringifyBalance,mK:()=>useTokenBalances,H6:()=>useTokenTracker});var es=__webpack_require__("./node_modules/react-redux/es/index.js"),bn=__webpack_require__("./node_modules/bn.js/lib/bn.js"),bn_default=__webpack_require__.n(bn),networks=__webpack_require__("./shared/modules/selectors/networks.ts"),actions=__webpack_require__("./ui/store/actions.ts"),metamask=__webpack_require__("./ui/ducks/metamask/metamask.js"),conversion_utils=__webpack_require__("./shared/modules/conversion.utils.ts"),react=__webpack_require__("./node_modules/react/index.js");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}let hooks_useMultiPolling=function(usePollingOptions){var pollingTokens=(0,react.useRef)(new Map);(0,react.useEffect)(function(){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=usePollingOptions.input[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0)!function(){var input=_step.value,key=JSON.stringify(input);pollingTokens.current.has(key)||usePollingOptions.startPolling(input).then(function(token){return pollingTokens.current.set(key,token)})}()}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}var _iteratorNormalCompletion1=!0,_didIteratorError1=!1,_iteratorError1=void 0;try{for(var _step1,_iterator1=pollingTokens.current.entries()[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=!0)!function(){var _step_value=_sliced_to_array(_step1.value,2),inputKey=_step_value[0],token=_step_value[1];usePollingOptions.input.some(function(i){return inputKey===JSON.stringify(i)})||(usePollingOptions.stopPollingByPollingToken(token),pollingTokens.current.delete(inputKey))}()}catch(err){_didIteratorError1=!0,_iteratorError1=err}finally{try{_iteratorNormalCompletion1||null==_iterator1.return||_iterator1.return()}finally{if(_didIteratorError1)throw _iteratorError1}}},[usePollingOptions.input&&JSON.stringify(usePollingOptions.input)]),(0,react.useEffect)(function(){return function(){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=pollingTokens.current.values()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var token=_step.value;usePollingOptions.stopPollingByPollingToken(token)}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}}},[])};var useTokenBalances=function(){var chainIds=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).chainIds,tokenBalances=(0,es.d4)(metamask.HF),networkConfigurations=(0,es.d4)(networks.hX);return hooks_useMultiPolling({startPolling:actions.tokenBalancesStartPolling,stopPollingByPollingToken:actions.tokenBalancesStopPollingByPollingToken,input:null!=chainIds?chainIds:Object.keys(networkConfigurations)}),{tokenBalances:tokenBalances}},useTokenTracker=function(param){var chainId=param.chainId,tokens=param.tokens,address=param.address,hideZeroBalanceTokens=param.hideZeroBalanceTokens,tokenBalances=useTokenBalances({chainIds:[chainId]}).tokenBalances;return{tokensWithBalances:tokens.reduce(function(acc,token){var _tokenBalances_address_chainId,_tokenBalances_address,_tokenBalances_address_chainId_token_address,hexBalance=null!==(_tokenBalances_address_chainId_token_address=null===(_tokenBalances_address=tokenBalances[address])||void 0===_tokenBalances_address?void 0:null===(_tokenBalances_address_chainId=_tokenBalances_address[chainId])||void 0===_tokenBalances_address_chainId?void 0:_tokenBalances_address_chainId[token.address])&&void 0!==_tokenBalances_address_chainId_token_address?_tokenBalances_address_chainId_token_address:"0x0";if("0x0"!==hexBalance||!hideZeroBalanceTokens){var decimalBalance=(0,conversion_utils.I0)(hexBalance);acc.push({address:token.address,symbol:token.symbol,decimals:token.decimals,balance:decimalBalance,balanceError:null,string:stringifyBalance(new(bn_default())(decimalBalance),new(bn_default())(token.decimals))})}return acc},[])}};function stringifyBalance(balance,bnDecimals){var balanceDecimals=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;if(balance.eq(new(bn_default())(0)))return"0";var decimals=parseInt(bnDecimals.toString(),10);if(0===decimals)return balance.toString();var bal=balance.toString(),len=bal.length,decimalIndex=len-decimals,prefix="";if(decimalIndex<=0){for(;prefix.length<=-1*decimalIndex;)prefix+="0",len+=1;bal=prefix+bal,decimalIndex=1}var whole=bal.substr(0,len-decimals);if(0===balanceDecimals)return whole;var fractional=bal.substr(decimalIndex,balanceDecimals);if(/0+$/u.test(fractional)){var withOnlySigZeroes=bal.substr(decimalIndex).replace(/0+$/u,"");return withOnlySigZeroes.length>0&&(withOnlySigZeroes=".".concat(withOnlySigZeroes)),"".concat(whole).concat(withOnlySigZeroes)}return"".concat(whole,".").concat(fractional)}},"./ui/selectors/institutional/selectors.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{EA:()=>getIsCustodianPublishesTransactionSupported,HP:()=>getCustodyAccountDetails,Jq:()=>getMmiPortfolioUrl,KP:()=>getIsCustodianSupportedChain,Rw:()=>getNoteToTraderMessage,aX:()=>getMMIConfiguration,cv:()=>getMMIAddressFromModalOrAddress,f1:()=>getMmiPortfolioEnabled,gN:()=>getInteractiveReplacementToken,hq:()=>getCustodianIconForAddress,ii:()=>getIsNoteToTraderSupported});var ethereumjs_util__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/ethereumjs-util/dist.browser/index.js"),_selectors__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/selectors/selectors.js"),_accounts__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/selectors/accounts.ts"),_shared_modules_selectors_networks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./shared/modules/selectors/networks.ts"),_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./shared/modules/conversion.utils.ts"),_app_scripts_lib_multichain_address__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./app/scripts/lib/multichain/address.ts"),_shared_constants_custody__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./shared/constants/custody.ts"),process=__webpack_require__("./node_modules/process/browser.js");function getCustodyAccountDetails(state){return state.metamask.custodyAccountDetails}function getCustodyAccountSupportedChains(state,address){var chains=state.metamask.custodianSupportedChains?state.metamask.custodianSupportedChains[(0,ethereumjs_util__WEBPACK_IMPORTED_MODULE_0__.toChecksumAddress)(address)]:void 0;if(chains&&"supportedChains"in chains)return chains}function getMmiPortfolioEnabled(state){var _state_metamask_mmiConfiguration_portfolio,_state_metamask_mmiConfiguration;return!!process.env.IN_TEST||(null===(_state_metamask_mmiConfiguration=state.metamask.mmiConfiguration)||void 0===_state_metamask_mmiConfiguration?void 0:null===(_state_metamask_mmiConfiguration_portfolio=_state_metamask_mmiConfiguration.portfolio)||void 0===_state_metamask_mmiConfiguration_portfolio?void 0:_state_metamask_mmiConfiguration_portfolio.enabled)}function getMmiPortfolioUrl(state){var _state_metamask_mmiConfiguration_portfolio,_state_metamask_mmiConfiguration;return(null===(_state_metamask_mmiConfiguration=state.metamask.mmiConfiguration)||void 0===_state_metamask_mmiConfiguration?void 0:null===(_state_metamask_mmiConfiguration_portfolio=_state_metamask_mmiConfiguration.portfolio)||void 0===_state_metamask_mmiConfiguration_portfolio?void 0:_state_metamask_mmiConfiguration_portfolio.url)||""}function getCustodianIconForAddress(state,address){var checksummedAddress=address&&(0,_app_scripts_lib_multichain_address__WEBPACK_IMPORTED_MODULE_5__.Nf)(address);if(checksummedAddress&&(null===(_state_metamask_custodyAccountDetails=state.metamask.custodyAccountDetails)||void 0===_state_metamask_custodyAccountDetails?void 0:_state_metamask_custodyAccountDetails[checksummedAddress])){var _state_metamask_custodyAccountDetails,custodianIcon,_state_metamask_mmiConfiguration_custodians_find,_state_metamask_mmiConfiguration_custodians,_state_metamask_mmiConfiguration,custodianName=state.metamask.custodyAccountDetails[checksummedAddress].custodianName;custodianIcon=null===(_state_metamask_mmiConfiguration=state.metamask.mmiConfiguration)||void 0===_state_metamask_mmiConfiguration?void 0:null===(_state_metamask_mmiConfiguration_custodians=_state_metamask_mmiConfiguration.custodians)||void 0===_state_metamask_mmiConfiguration_custodians?void 0:null===(_state_metamask_mmiConfiguration_custodians_find=_state_metamask_mmiConfiguration_custodians.find(function(custodian){return custodian.envName===custodianName}))||void 0===_state_metamask_mmiConfiguration_custodians_find?void 0:_state_metamask_mmiConfiguration_custodians_find.iconUrl}return custodianIcon}function getIsCustodianSupportedChain(state){try{var selectedAccount=(0,_accounts__WEBPACK_IMPORTED_MODULE_2__._r)(state),accountType=(0,_selectors__WEBPACK_IMPORTED_MODULE_1__.U8f)(state);if(!selectedAccount||!accountType)throw Error("Invalid state");var providerConfig=(0,_shared_modules_selectors_networks__WEBPACK_IMPORTED_MODULE_3__.Iv)(state);if("string"!=typeof providerConfig.chainId)throw Error("Chain ID must be a string");if(!/^0x[0-9a-f]+$/i.test(providerConfig.chainId))throw Error("Chain ID must be a hexadecimal number");if(accountType!==_shared_constants_custody__WEBPACK_IMPORTED_MODULE_6__.C.CUSTODY)return!0;var supportedChains=getCustodyAccountSupportedChains(state,selectedAccount.address);if(!(null==supportedChains?void 0:supportedChains.supportedChains))return!0;return supportedChains.supportedChains.includes((0,_shared_modules_conversion_utils__WEBPACK_IMPORTED_MODULE_4__.I0)(providerConfig.chainId))}catch(error){throw console.error(error),error}}function getMMIAddressFromModalOrAddress(state){var _state_appState_modal_modalState_props,_state_appState_modal_modalState,_state_appState_modal,_state_appState,_getSelectedInternalAccount,modalAddress=null==state?void 0:null===(_state_appState=state.appState)||void 0===_state_appState?void 0:null===(_state_appState_modal=_state_appState.modal)||void 0===_state_appState_modal?void 0:null===(_state_appState_modal_modalState=_state_appState_modal.modalState)||void 0===_state_appState_modal_modalState?void 0:null===(_state_appState_modal_modalState_props=_state_appState_modal_modalState.props)||void 0===_state_appState_modal_modalState_props?void 0:_state_appState_modal_modalState_props.address,selectedAddress=null===(_getSelectedInternalAccount=(0,_accounts__WEBPACK_IMPORTED_MODULE_2__._r)(state))||void 0===_getSelectedInternalAccount?void 0:_getSelectedInternalAccount.address;return modalAddress||selectedAddress}function getMMIConfiguration(state){return state.metamask.mmiConfiguration||{}}function getInteractiveReplacementToken(state){return state.metamask.interactiveReplacementToken||{}}function getIsNoteToTraderSupported(state,fromChecksumHexAddress){var _mmiConfiguration_custodians,_state_metamask=state.metamask,custodyAccountDetails=_state_metamask.custodyAccountDetails,mmiConfiguration=_state_metamask.mmiConfiguration,accountDetails=null==custodyAccountDetails?void 0:custodyAccountDetails[fromChecksumHexAddress];if(!accountDetails)return!1;var foundCustodian=null==mmiConfiguration?void 0:null===(_mmiConfiguration_custodians=mmiConfiguration.custodians)||void 0===_mmiConfiguration_custodians?void 0:_mmiConfiguration_custodians.find(function(custodian){return custodian.envName===accountDetails.custodianName});return!!foundCustodian&&foundCustodian.isNoteToTraderSupported}function getIsCustodianPublishesTransactionSupported(state,fromChecksumHexAddress){var _mmiConfiguration_custodians,_state_metamask=state.metamask,custodyAccountDetails=_state_metamask.custodyAccountDetails,mmiConfiguration=_state_metamask.mmiConfiguration,accountDetails=null==custodyAccountDetails?void 0:custodyAccountDetails[fromChecksumHexAddress];if(!accountDetails)return!1;var foundCustodian=null==mmiConfiguration?void 0:null===(_mmiConfiguration_custodians=mmiConfiguration.custodians)||void 0===_mmiConfiguration_custodians?void 0:_mmiConfiguration_custodians.find(function(custodian){return custodian.envName===accountDetails.custodianName});return!!foundCustodian&&foundCustodian.custodianPublishesTransaction}function getNoteToTraderMessage(state){return state.metamask.noteToTraderMessage||""}}}]);