-
Notifications
You must be signed in to change notification settings - Fork 31
/
49907.b08e476a.iframe.bundle.js
1 lines (1 loc) · 43.8 KB
/
49907.b08e476a.iframe.bundle.js
1
(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[49907],{"./ui/__mocks__/useNftCollectionsMetadata.js":module=>{module.exports={useNftCollectionsMetadata:function(){return{"0x1":{"0xc0ffee254729296a45a3885639ac7e10f9d54979":{name:"Everything I Own",image:"https://img.reservoir.tools/images/v2/mainnet/z9JRSpLYGu7%2BCZoKWtAuAN%2F%2FMfWcOGcwki5%2FxXYtCb4OfGsOPvxN1LZHZ5%2BcuQGwJciTvgr58ThRjooWLMWehc1nSTXtbfFJ1TNtL%2FeIjglkPKsEG%2Fbem0E%2B3yo7tAUqlZ1ou0SMzGOfq%2FG1BHwIpgHQ524PRAlaynVkDcp8y58kALOPTQSDN1tgaqkZD%2FZiNBEaYq6Bp9XH8Vm8tMXsaQ%3D%3D?width=250",isSpam:!1}}}}}},"./ui/components/ui/identicon/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>identicon_container});var es=__webpack_require__("./node_modules/react-redux/es/index.js"),selectors=__webpack_require__("./ui/selectors/index.js"),nft=__webpack_require__("./ui/selectors/nft.ts"),identicon_component=__webpack_require__("./ui/components/ui/identicon/identicon.component.js");let identicon_container=(0,es.Ng)(function(state){var _state_metamask=state.metamask,useBlockie=_state_metamask.useBlockie,ipfsGateway=_state_metamask.ipfsGateway;return{useBlockie:useBlockie,tokenList:(0,selectors.iM3)(state),ipfsGateway:ipfsGateway,watchedNftContracts:(0,nft.k9)(state)}})(identicon_component.A);identicon_component.A.__docgenInfo={description:"",methods:[{name:"loadImage",docblock:null,modifiers:["async"],params:[],returns:null},{name:"renderImage",docblock:null,modifiers:[],params:[],returns:null},{name:"renderJazzicon",docblock:null,modifiers:[],params:[],returns:null},{name:"renderBlockie",docblock:null,modifiers:[],params:[],returns:null},{name:"renderBlockieOrJazzIcon",docblock:null,modifiers:[],params:[],returns:null},{name:"getTokenImage",docblock:null,modifiers:[],params:[],returns:null},{name:"getNftImage",docblock:null,modifiers:[],params:[],returns:null},{name:"getTokenList",docblock:null,modifiers:[],params:[],returns:null}],displayName:"Identicon",props:{addBorder:{defaultValue:{value:"false",computed:!1},description:"Adds blue border around the Identicon used for selected account.\nIncreases the width and height of the Identicon by 8px",type:{name:"bool"},required:!1},address:{defaultValue:{value:"undefined",computed:!0},description:"Address used for generating random image",type:{name:"string"},required:!1},className:{defaultValue:{value:"undefined",computed:!0},description:"Add custom css class",type:{name:"string"},required:!1},diameter:{defaultValue:{value:"46",computed:!1},description:"Sets the width and height of the inner img element\nIf addBorder is true will increase components height and width by 8px",type:{name:"number"},required:!1},image:{defaultValue:{value:"undefined",computed:!0},description:"Used as the image source of the Identicon",type:{name:"union",value:[{name:"string"},{name:"array"}]},required:!1},useBlockie:{defaultValue:{value:"false",computed:!1},description:"Use the blockie type random image generator",type:{name:"bool"},required:!1},alt:{defaultValue:{value:"''",computed:!1},description:"The alt text of the image",type:{name:"string"},required:!1},tokenList:{defaultValue:{value:"{}",computed:!1},description:"Add list of token in object",type:{name:"object"},required:!1},watchedNftContracts:{defaultValue:{value:"{}",computed:!1},description:"Watched NFT contract data keyed by address",type:{name:"object"},required:!1},imageBorder:{description:"Check if show image border",type:{name:"bool"},required:!1},ipfsGateway:{description:"User preferred IPFS gateway",type:{name:"string"},required:!1}}}},"./shared/constants/first-party-contracts.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{B:()=>EXPERIENCES_TYPE,q:()=>FIRST_PARTY_CONTRACT_NAMES});var EXPERIENCES_TYPE,_obj,_obj1,_obj2,_network__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./shared/constants/network.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(EXPERIENCES_TYPE){EXPERIENCES_TYPE.METAMASK_VALIDATOR_STAKING="MetaMask Validator Staking",EXPERIENCES_TYPE.METAMASK_POOLED_STAKING="MetaMask Pooled Staking",EXPERIENCES_TYPE.METAMASK_THIRD_PARTY_STAKING="MetaMask Third Party Staking",EXPERIENCES_TYPE.METAMASK_POOLED_STAKING_V1="MetaMask Pool Staking (v1)",EXPERIENCES_TYPE.METAMASK_BRIDGE="MetaMask Bridge",EXPERIENCES_TYPE.METAMASK_SWAPS="MetaMask Swaps"}(EXPERIENCES_TYPE||(EXPERIENCES_TYPE={}));var FIRST_PARTY_CONTRACT_NAMES=(_define_property(_obj2={},"MetaMask Validator Staking",_define_property({},_network__WEBPACK_IMPORTED_MODULE_0__.tx.MAINNET,"0xDc71aFFC862fceB6aD32BE58E098423A7727bEbd")),_define_property(_obj2,"MetaMask Pooled Staking",_define_property({},_network__WEBPACK_IMPORTED_MODULE_0__.tx.MAINNET,"0x4FEF9D741011476750A243aC70b9789a63dd47Df")),_define_property(_obj2,"MetaMask Third Party Staking",_define_property({},_network__WEBPACK_IMPORTED_MODULE_0__.tx.MAINNET,"0x1f6692E78dDE07FF8da75769B6d7c716215bC7D0")),_define_property(_obj2,"MetaMask Pool Staking (v1)",_define_property({},_network__WEBPACK_IMPORTED_MODULE_0__.tx.MAINNET,"0xc7bE520a13dC023A1b34C03F4Abdab8A43653F7B")),_define_property(_obj2,"MetaMask Bridge",(_define_property(_obj={},_network__WEBPACK_IMPORTED_MODULE_0__.tx.MAINNET,"0x0439e60F02a8900a951603950d8D4527f400C3f1"),_define_property(_obj,_network__WEBPACK_IMPORTED_MODULE_0__.tx.OPTIMISM,"0xB90357f2b86dbfD59c3502215d4060f71DF8ca0e"),_define_property(_obj,_network__WEBPACK_IMPORTED_MODULE_0__.tx.BSC,"0xaEc23140408534b378bf5832defc426dF8604B59"),_define_property(_obj,_network__WEBPACK_IMPORTED_MODULE_0__.tx.POLYGON,"0x3A0b42cE6166abB05d30DdF12E726c95a83D7a16"),_define_property(_obj,_network__WEBPACK_IMPORTED_MODULE_0__.tx.ZKSYNC_ERA,"0x357B5935482AD8a4A2e181e0132aBd1882E16520"),_define_property(_obj,_network__WEBPACK_IMPORTED_MODULE_0__.tx.BASE,"0xa20ECbC821fB54064aa7B5C6aC81173b8b34Df71"),_define_property(_obj,_network__WEBPACK_IMPORTED_MODULE_0__.tx.ARBITRUM,"0x23981fC34e69eeDFE2BD9a0a9fCb0719Fe09DbFC"),_define_property(_obj,_network__WEBPACK_IMPORTED_MODULE_0__.tx.AVALANCHE,"0x29106d08382d3c73bF477A94333C61Db1142E1B6"),_define_property(_obj,_network__WEBPACK_IMPORTED_MODULE_0__.tx.LINEA_MAINNET,"0xE3d0d2607182Af5B24f5C3C2E4990A053aDd64e3"),_obj)),_define_property(_obj2,"MetaMask Swaps",(_define_property(_obj1={},_network__WEBPACK_IMPORTED_MODULE_0__.tx.MAINNET,"0x881D40237659C251811CEC9c364ef91dC08D300C"),_define_property(_obj1,_network__WEBPACK_IMPORTED_MODULE_0__.tx.BSC,"0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31"),_define_property(_obj1,_network__WEBPACK_IMPORTED_MODULE_0__.tx.POLYGON,"0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31"),_define_property(_obj1,_network__WEBPACK_IMPORTED_MODULE_0__.tx.AVALANCHE,"0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31"),_define_property(_obj1,_network__WEBPACK_IMPORTED_MODULE_0__.tx.ARBITRUM,"0x9dDA6Ef3D919c9bC8885D5560999A3640431e8e6"),_define_property(_obj1,_network__WEBPACK_IMPORTED_MODULE_0__.tx.OPTIMISM,"0x9dDA6Ef3D919c9bC8885D5560999A3640431e8e6"),_define_property(_obj1,_network__WEBPACK_IMPORTED_MODULE_0__.tx.ZKSYNC_ERA,"0xf504c1fe13d14DF615E66dcd0ABF39e60c697f34"),_define_property(_obj1,_network__WEBPACK_IMPORTED_MODULE_0__.tx.LINEA_MAINNET,"0x9dDA6Ef3D919c9bC8885D5560999A3640431e8e6"),_obj1)),_obj2)},"./ui/components/app/name/name.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>name_name});var react=__webpack_require__("./node_modules/react/index.js"),chunk_6W3DEAGA=__webpack_require__("./node_modules/@metamask/name-controller/dist/chunk-6W3DEAGA.mjs"),classnames=__webpack_require__("./node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),dist_browser=__webpack_require__("./node_modules/ethereumjs-util/dist.browser/index.js"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),util=__webpack_require__("./ui/helpers/utils/util.js"),metametrics=__webpack_require__("./ui/contexts/metametrics.js"),constants_metametrics=__webpack_require__("./shared/constants/metametrics.ts"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),useDisplayName=__webpack_require__("./ui/hooks/useDisplayName.ts"),identicon=__webpack_require__("./ui/components/ui/identicon/index.js"),es=__webpack_require__("./node_modules/react-redux/es/index.js"),lodash=__webpack_require__("./node_modules/lodash/lodash.js"),form_combo_field=__webpack_require__("./ui/components/ui/form-combo-field/form-combo-field.tsx"),selectors=__webpack_require__("./ui/selectors/index.js"),actions=__webpack_require__("./ui/__mocks__/actions.js"),useCopyToClipboard=__webpack_require__("./ui/hooks/useCopyToClipboard.js"),useName=__webpack_require__("./ui/hooks/useName.ts"),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.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_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 _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)}}function usePetnamesMetrics(param){var initialSources=param.initialSources,name=param.name,proposedNameOptions=param.proposedNameOptions,savedName=param.savedName,savedSourceId=param.savedSourceId,selectedSourceId=param.selectedSourceId,type=param.type,trackEvent=(0,react.useContext)(metametrics.O2),trackPetnamesEvent=(0,react.useCallback)(function(event){var additionalProperties=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},properties=_object_spread({petname_category:type,suggested_names_sources:_to_consumable_array(new Set(proposedNameOptions.map(function(option){return option.sourceId})))},additionalProperties);trackEvent({event:event,category:constants_metametrics.FZ.Petnames,properties:properties})},[trackEvent,type,proposedNameOptions]),trackPetnamesSaveEvent=(0,react.useCallback)(function(){var petnameSource=null!=selectedSourceId?selectedSourceId:null,isDeleted=(null==savedName?void 0:savedName.length)&&!(null==name?void 0:name.length),isUpdated=(null==savedName?void 0:savedName.length)&&(null==name?void 0:name.length)&&name!==savedName,isCreated=!(null==savedName?void 0:savedName.length)&&(null==name?void 0:name.length),event=null,additionalProperties={};isDeleted&&(event=constants_metametrics.gP.PetnameDeleted,additionalProperties={petname_previous_source:savedSourceId}),isUpdated&&(event=constants_metametrics.gP.PetnameUpdated,additionalProperties={petname_previous_source:savedSourceId,petname_source:petnameSource}),isCreated&&(event=constants_metametrics.gP.PetnameCreated,additionalProperties={petname_source:petnameSource}),event&&trackPetnamesEvent(event,additionalProperties)},[trackPetnamesEvent,name,selectedSourceId,savedName,savedSourceId]);return{trackPetnamesOpenEvent:(0,react.useCallback)(function(){trackPetnamesEvent(constants_metametrics.gP.PetnameModalOpened,{has_petname:!!(null==savedName?void 0:savedName.length),suggested_names_sources:initialSources})},[trackPetnamesEvent,savedName,initialSources]),trackPetnamesSaveEvent:trackPetnamesSaveEvent}}function name_details_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 name_details_array_without_holes(arr){if(Array.isArray(arr))return name_details_array_like_to_array(arr)}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)}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}function name_details_iterable_to_array(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}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 name_details_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 _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||name_details_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function name_details_to_consumable_array(arr){return name_details_array_without_holes(arr)||name_details_iterable_to_array(arr)||name_details_unsupported_iterable_to_array(arr)||name_details_non_iterable_spread()}function name_details_unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return name_details_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 name_details_array_like_to_array(o,minLen)}}function _ts_generator(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}}function formatValue(value,type){return value.length&&type===chunk_6W3DEAGA.k.ETHEREUM_ADDRESS?(0,dist_browser.toChecksumAddress)(value):value}var LOCALIZED_PROVIDERS=["ens","etherscan","lens","token"];function getProviderLabel(sourceId,t,nameSources){if(LOCALIZED_PROVIDERS.includes(sourceId)){var _nameSources_sourceId,_nameSources_sourceId_label;return t("nameProvider_".concat(sourceId))}return null!==(_nameSources_sourceId_label=null===(_nameSources_sourceId=nameSources[sourceId])||void 0===_nameSources_sourceId?void 0:_nameSources_sourceId.label)&&void 0!==_nameSources_sourceId_label?_nameSources_sourceId_label:sourceId}function generateComboOptions(proposedNameEntries,t,nameSources){return Object.keys(proposedNameEntries).filter(function(sourceId){var _proposedNameEntries_sourceId_proposedNames,_proposedNameEntries_sourceId;return null===(_proposedNameEntries_sourceId=proposedNameEntries[sourceId])||void 0===_proposedNameEntries_sourceId?void 0:null===(_proposedNameEntries_sourceId_proposedNames=_proposedNameEntries_sourceId.proposedNames)||void 0===_proposedNameEntries_sourceId_proposedNames?void 0:_proposedNameEntries_sourceId_proposedNames.length}).map(function(sourceId){var _proposedNameEntries_sourceId,_proposedNameEntries_sourceId_proposedNames;return(null!==(_proposedNameEntries_sourceId_proposedNames=null===(_proposedNameEntries_sourceId=proposedNameEntries[sourceId])||void 0===_proposedNameEntries_sourceId?void 0:_proposedNameEntries_sourceId.proposedNames)&&void 0!==_proposedNameEntries_sourceId_proposedNames?_proposedNameEntries_sourceId_proposedNames:[]).map(function(proposedName){return{value:proposedName,primaryLabel:t("nameModalMaybeProposedName",[proposedName]),secondaryLabel:t("nameProviderProposedBy",[getProviderLabel(sourceId,t,nameSources)]),sourceId:sourceId}})}).flat().sort(function(a,b){return a.secondaryLabel.toLowerCase().localeCompare(b.secondaryLabel.toLowerCase())})}function getInitialSources(proposedNamesResult,proposedNamesState){var resultSources=Object.keys(proposedNamesResult).filter(function(sourceId){var _proposedNamesResult_sourceId_proposedNames;return null===(_proposedNamesResult_sourceId_proposedNames=proposedNamesResult[sourceId].proposedNames)||void 0===_proposedNamesResult_sourceId_proposedNames?void 0:_proposedNamesResult_sourceId_proposedNames.length}),stateSources=Object.keys(proposedNamesState).filter(function(sourceId){var _proposedNamesResult_sourceId,_proposedNamesState_sourceId_proposedNames;return!(null===(_proposedNamesResult_sourceId=proposedNamesResult[sourceId])||void 0===_proposedNamesResult_sourceId?void 0:_proposedNamesResult_sourceId.proposedNames)&&(null===(_proposedNamesState_sourceId_proposedNames=proposedNamesState[sourceId].proposedNames)||void 0===_proposedNamesState_sourceId_proposedNames?void 0:_proposedNamesState_sourceId_proposedNames.length)});return name_details_to_consumable_array(resultSources).concat(name_details_to_consumable_array(stateSources)).sort()}function useProposedNames(value,type,variation){var dispatch=(0,es.wA)(),proposedNames=(0,useName.t)(value,type,variation).proposedNames,updateInterval=(0,react.useRef)(),_useState=_sliced_to_array((0,react.useState)(),2),initialSources=_useState[0],setInitialSources=_useState[1];return(0,react.useEffect)(function(){var _ref,reset=function(){updateInterval.current&&clearInterval(updateInterval.current)},update=(_ref=_async_to_generator(function(){var result,_result_results;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,dispatch((0,actions.updateProposedNames)({value:value,type:type,onlyUpdateAfterDelay:!0,variation:variation}))];case 1:return result=_state.sent(),initialSources||setInitialSources(getInitialSources(null!==(_result_results=null==result?void 0:result.results)&&void 0!==_result_results?_result_results:{},proposedNames)),[2]}})}),function update(){return _ref.apply(this,arguments)});return reset(),update(),updateInterval.current=setInterval(update,2e3),reset},[value,type,variation,dispatch,initialSources,setInitialSources]),{proposedNames:proposedNames,initialSources:initialSources}}function NameDetails(param){var onClose=param.onClose,type=param.type,value=param.value,variation=param.variation,_useName=(0,useName.t)(value,type,variation),savedPetname=_useName.name,savedSourceId=_useName.sourceId,_useDisplayName=(0,useDisplayName.n)({value:value,type:type,variation:variation}),displayName=_useDisplayName.name,hasSavedPetname=_useDisplayName.hasPetname,nameSources=(0,es.d4)(selectors.ufX,lodash.isEqual),_useState=_sliced_to_array((0,react.useState)(""),2),name=_useState[0],setName=_useState[1],_useState1=_sliced_to_array((0,react.useState)(!1),2),openMetricSent=_useState1[0],setOpenMetricSent=_useState1[1],_useState2=_sliced_to_array((0,react.useState)(),2),selectedSourceId=_useState2[0],setSelectedSourceId=_useState2[1],_useState3=_sliced_to_array((0,react.useState)(),2),selectedSourceName=_useState3[0],setSelectedSourceName=_useState3[1],dispatch=(0,es.wA)(),t=(0,useI18nContext.P)(),formattedValue=formatValue(value,type),_useProposedNames=useProposedNames(value,type,variation),proposedNames=_useProposedNames.proposedNames,initialSources=_useProposedNames.initialSources,_useCopyToClipboard=_sliced_to_array((0,useCopyToClipboard.C)(),2),copiedAddress=_useCopyToClipboard[0],handleCopyAddress=_useCopyToClipboard[1];(0,react.useEffect)(function(){setName(null!=savedPetname?savedPetname:""),setSelectedSourceId(null!=savedSourceId?savedSourceId:void 0),setSelectedSourceName(savedSourceId&&null!=savedPetname?savedPetname:void 0)},[savedPetname,savedSourceId,setName,setSelectedSourceId]);var proposedNameOptions=(0,react.useMemo)(function(){return generateComboOptions(proposedNames,t,nameSources)},[proposedNames,nameSources]),_usePetnamesMetrics=usePetnamesMetrics({initialSources:initialSources,name:name,proposedNameOptions:proposedNameOptions,savedName:savedPetname,savedSourceId:savedSourceId,selectedSourceId:selectedSourceId,type:type}),trackPetnamesOpenEvent=_usePetnamesMetrics.trackPetnamesOpenEvent,trackPetnamesSaveEvent=_usePetnamesMetrics.trackPetnamesSaveEvent;(0,react.useEffect)(function(){initialSources&&!openMetricSent&&(trackPetnamesOpenEvent(),setOpenMetricSent(!0))},[initialSources,openMetricSent,trackPetnamesOpenEvent]);var handleSaveClick=(0,react.useCallback)(_async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return trackPetnamesSaveEvent(),[4,dispatch((0,actions.setName)({value:value,type:type,name:(null==name?void 0:name.length)?name:null,sourceId:selectedSourceId,variation:variation}))];case 1:return _state.sent(),onClose(),[2]}})}),[name,selectedSourceId,onClose,trackPetnamesSaveEvent,variation]),handleClose=(0,react.useCallback)(function(){onClose()},[onClose]),handleNameChange=(0,react.useCallback)(function(newName){setName(newName),newName!==selectedSourceName&&(setSelectedSourceId(void 0),setSelectedSourceName(void 0))},[setName,selectedSourceId,setSelectedSourceId,setSelectedSourceName]),handleProposedNameClick=(0,react.useCallback)(function(option){setSelectedSourceId(option.sourceId),setSelectedSourceName(option.value)},[setSelectedSourceId,setSelectedSourceName]),handleCopyClick=(0,react.useCallback)(function(){handleCopyAddress(formattedValue)},[handleCopyAddress,formattedValue]),_ref=_sliced_to_array(hasSavedPetname?[t("nameModalTitleSaved"),t("nameInstructionsSaved")]:!hasSavedPetname&&displayName?[t("nameModalTitleRecognized"),t("nameInstructionsRecognized")]:[t("nameModalTitleNew"),t("nameInstructionsNew")],2),title=_ref[0],instructions=_ref[1];return react.createElement(component_library.az,null,react.createElement(component_library.aF,{isOpen:!0,onClose:handleClose},react.createElement(component_library.mH,null),react.createElement(component_library.$m,null,react.createElement(component_library.rQ,{onClose:handleClose},title),react.createElement(component_library.cw,{className:"name-details__modal-body"},react.createElement("div",{style:{textAlign:"center",marginBottom:16,marginTop:8}},react.createElement(name_name,{value:value,type:chunk_6W3DEAGA.k.ETHEREUM_ADDRESS,variation:variation,disableEdit:!0,internal:!0})),react.createElement(component_library.EY,{marginBottom:4,justifyContent:design_system.A9.spaceBetween},instructions),react.createElement(component_library.YJ,{id:"address",className:"name-details__address",label:t("nameAddressLabel"),value:formattedValue,marginBottom:4,disabled:!0,endAccessory:react.createElement(component_library.a2,{display:design_system.nl.Flex,iconName:copiedAddress?component_library.$M.CopySuccess:component_library.$M.Copy,size:component_library.f3.Sm,onClick:handleCopyClick,color:design_system.Li.iconMuted,ariaLabel:t("copyAddress")})}),react.createElement(component_library.JU,{flexDirection:design_system.bo.Column,alignItems:design_system.k2.flexStart,marginBottom:2,className:"name-details__display-name"},t("nameLabel"),react.createElement(form_combo_field.A,{hideDropdownIfNoOptions:!0,value:name,options:proposedNameOptions,placeholder:t("nameSetPlaceholder"),onChange:handleNameChange,onOptionClick:handleProposedNameClick}))),react.createElement(component_library.jl,null,react.createElement(component_library.$n,{variant:component_library.Ak.Primary,startIconName:component_library.$M.Save,width:design_system.Zf.Full,onClick:handleSaveClick,size:component_library.Mp.Lg},t("save"))))))}try{namedetails.displayName="namedetails",namedetails.__docgenInfo={description:"",displayName:"namedetails",props:{onClose:{defaultValue:null,description:"",name:"onClose",required:!0,type:{name:"() => void"}},sourcePriority:{defaultValue:null,description:"",name:"sourcePriority",required:!1,type:{name:"string[]"}},type:{defaultValue:null,description:"",name:"type",required:!0,type:{name:"NameType"}},value:{defaultValue:null,description:"",name:"value",required:!0,type:{name:"string"}},variation:{defaultValue:null,description:"",name:"variation",required:!0,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/name/name-details/name-details.tsx#namedetails"]={docgenInfo:namedetails.__docgenInfo,name:"namedetails",path:"ui/components/app/name/name-details/name-details.tsx#namedetails"})}catch(__react_docgen_typescript_loader_error){}function name_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 name_array_with_holes(arr){if(Array.isArray(arr))return arr}function name_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 name_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 name_sliced_to_array(arr,i){return name_array_with_holes(arr)||name_iterable_to_array_limit(arr,i)||name_unsupported_iterable_to_array(arr,i)||name_non_iterable_rest()}function name_unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return name_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 name_array_like_to_array(o,minLen)}}function name_formatValue(value,type){return value.length&&type===chunk_6W3DEAGA.k.ETHEREUM_ADDRESS?(0,util.Wr)((0,dist_browser.toChecksumAddress)(value)):value}let name_name=(0,react.memo)(function(param){var value=param.value,type=param.type,disableEdit=param.disableEdit,internal=param.internal,_param_preferContractSymbol=param.preferContractSymbol,variation=param.variation,_useState=name_sliced_to_array((0,react.useState)(!1),2),modalOpen=_useState[0],setModalOpen=_useState[1],trackEvent=(0,react.useContext)(metametrics.O2),_useDisplayName=(0,useDisplayName.n)({value:value,type:type,preferContractSymbol:void 0!==_param_preferContractSymbol&&_param_preferContractSymbol,variation:variation}),name=_useDisplayName.name,hasPetname=_useDisplayName.hasPetname,image=_useDisplayName.image;(0,react.useEffect)(function(){internal||trackEvent({event:constants_metametrics.gP.PetnameDisplayed,category:constants_metametrics.FZ.Petnames,properties:{petname_category:type,has_petname:!!(null==name?void 0:name.length)}})},[]);var handleClick=(0,react.useCallback)(function(){setModalOpen(!0)},[setModalOpen]),handleModalClose=(0,react.useCallback)(function(){setModalOpen(!1)},[setModalOpen]),formattedValue=name_formatValue(value,type),formattedName=(0,util.l1)(name||void 0,{truncatedCharLimit:12,truncatedStartChars:9,truncatedEndChars:0,skipCharacterInEnd:!0}),hasDisplayName=!!name;return react.createElement(component_library.az,{display:design_system.nl.Flex},!disableEdit&&modalOpen&&react.createElement(NameDetails,{value:value,type:type,variation:variation,onClose:handleModalClose}),react.createElement("div",{className:classnames_default()({name:!0,name__saved:hasPetname,name__recognized_unsaved:!hasPetname&&hasDisplayName,name__missing:!hasDisplayName}),onClick:handleClick},hasDisplayName?react.createElement(identicon.A,{address:value,diameter:16,image:image}):react.createElement(component_library.In,{name:component_library.$M.Question,className:"name__icon",size:component_library.lK.Md}),hasDisplayName?react.createElement(component_library.EY,{className:"name__name",variant:design_system.J3.bodyMd},formattedName):react.createElement(component_library.EY,{className:"name__value",variant:design_system.J3.bodyMd},formattedValue)))})},"./ui/hooks/useDisplayName.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{k:()=>useDisplayNames,n:()=>useDisplayName});var _metamask_name_controller__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@metamask/name-controller/dist/chunk-6W3DEAGA.mjs"),react_redux__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react-redux/es/index.js"),_shared_constants_first_party_contracts__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./shared/constants/first-party-contracts.ts"),_shared_modules_hexstring_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./shared/modules/hexstring-utils.ts"),_ducks_domains__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/ducks/domains.js"),_selectors__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/selectors/index.js"),_selectors_nft__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/selectors/nft.ts"),_useName__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/hooks/useName.ts"),_useNftCollectionsMetadata__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/__mocks__/useNftCollectionsMetadata.js");function useDisplayNames(requests){var nameEntries=(0,_useName__WEBPACK_IMPORTED_MODULE_6__.E)(requests),firstPartyContractNames=useFirstPartyContractNames(requests),erc20Tokens=useERC20Tokens(requests),watchedNFTNames=useWatchedNFTNames(requests),nfts=useNFTs(requests),ens=useDomainResolutions(requests);return requests.map(function(_request,index){var nameEntry=nameEntries[index],firstPartyContractName=firstPartyContractNames[index],erc20Token=erc20Tokens[index],watchedNftName=watchedNFTNames[index],nft=nfts[index],ensName=ens[index],name=(null==nameEntry?void 0:nameEntry.name)||firstPartyContractName||(null==nft?void 0:nft.name)||(null==erc20Token?void 0:erc20Token.name)||watchedNftName||ensName||null,image=(null==nft?void 0:nft.image)||(null==erc20Token?void 0:erc20Token.image);return{name:name,hasPetname:!!(null==nameEntry?void 0:nameEntry.name),contractDisplayName:null==erc20Token?void 0:erc20Token.name,image:image}})}function useDisplayName(request){return useDisplayNames([request])[0]}function useERC20Tokens(nameRequests){var erc20TokensByChain=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_4__.f2k);return nameRequests.map(function(param){var _erc20TokensByChain_variation_data,_erc20TokensByChain_variation,_erc20TokensByChain_variation_data_contractAddress,preferContractSymbol=param.preferContractSymbol,type=param.type,value=param.value,variation=param.variation;if(type===_metamask_name_controller__WEBPACK_IMPORTED_MODULE_8__.k.ETHEREUM_ADDRESS){var contractAddress=value.toLowerCase(),_ref=null!==(_erc20TokensByChain_variation_data_contractAddress=null==erc20TokensByChain?void 0:null===(_erc20TokensByChain_variation=erc20TokensByChain[variation])||void 0===_erc20TokensByChain_variation?void 0:null===(_erc20TokensByChain_variation_data=_erc20TokensByChain_variation.data)||void 0===_erc20TokensByChain_variation_data?void 0:_erc20TokensByChain_variation_data[contractAddress])&&void 0!==_erc20TokensByChain_variation_data_contractAddress?_erc20TokensByChain_variation_data_contractAddress:{},image=_ref.iconUrl,tokenName=_ref.name,symbol=_ref.symbol;return{name:preferContractSymbol&&symbol?symbol:tokenName,image:image}}})}function useWatchedNFTNames(nameRequests){var watchedNftNamesByAddressByChain=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors_nft__WEBPACK_IMPORTED_MODULE_5__.nG);return nameRequests.map(function(param){var _watchedNftNamesByAddress_contractAddress,type=param.type,value=param.value,variation=param.variation;if(type===_metamask_name_controller__WEBPACK_IMPORTED_MODULE_8__.k.ETHEREUM_ADDRESS){var contractAddress=value.toLowerCase(),watchedNftNamesByAddress=watchedNftNamesByAddressByChain[variation];return null==watchedNftNamesByAddress?void 0:null===(_watchedNftNamesByAddress_contractAddress=watchedNftNamesByAddress[contractAddress])||void 0===_watchedNftNamesByAddress_contractAddress?void 0:_watchedNftNamesByAddress_contractAddress.name}})}function useNFTs(nameRequests){var requests=nameRequests.filter(function(param){return param.type===_metamask_name_controller__WEBPACK_IMPORTED_MODULE_8__.k.ETHEREUM_ADDRESS}).map(function(param){var value=param.value;return{chainId:param.variation,contractAddress:value}}),nftCollectionsByAddressByChain=(0,_useNftCollectionsMetadata__WEBPACK_IMPORTED_MODULE_7__.useNftCollectionsMetadata)(requests);return nameRequests.map(function(param){var _nftCollectionsByAddressByChain_chainId,type=param.type,contractAddress=param.value,chainId=param.variation;if(type===_metamask_name_controller__WEBPACK_IMPORTED_MODULE_8__.k.ETHEREUM_ADDRESS){var nftCollectionProperties=null===(_nftCollectionsByAddressByChain_chainId=nftCollectionsByAddressByChain[chainId])||void 0===_nftCollectionsByAddressByChain_chainId?void 0:_nftCollectionsByAddressByChain_chainId[contractAddress.toLowerCase()],isSpam=(null==nftCollectionProperties?void 0:nftCollectionProperties.isSpam)!==!1;if(nftCollectionProperties&&!isSpam)return{name:nftCollectionProperties.name,image:nftCollectionProperties.image}}})}function useDomainResolutions(nameRequests){var domainResolutions=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_ducks_domains__WEBPACK_IMPORTED_MODULE_3__.oE);return nameRequests.map(function(param){var type=param.type,value=param.value;if(type===_metamask_name_controller__WEBPACK_IMPORTED_MODULE_8__.k.ETHEREUM_ADDRESS){var matchedResolution=null==domainResolutions?void 0:domainResolutions.find(function(resolution){return(0,_shared_modules_hexstring_utils__WEBPACK_IMPORTED_MODULE_2__.sX)(resolution.resolvedAddress)===(0,_shared_modules_hexstring_utils__WEBPACK_IMPORTED_MODULE_2__.sX)(value)});return null==matchedResolution?void 0:matchedResolution.domainName}})}function useFirstPartyContractNames(nameRequests){return nameRequests.map(function(param){var type=param.type,value=param.value,variation=param.variation;if(type===_metamask_name_controller__WEBPACK_IMPORTED_MODULE_8__.k.ETHEREUM_ADDRESS){var normalizedContractAddress=value.toLowerCase();return Object.keys(_shared_constants_first_party_contracts__WEBPACK_IMPORTED_MODULE_1__.q).find(function(contractName){var _FIRST_PARTY_CONTRACT_NAMES_contractName,currentContractAddress=null===(_FIRST_PARTY_CONTRACT_NAMES_contractName=_shared_constants_first_party_contracts__WEBPACK_IMPORTED_MODULE_1__.q[contractName])||void 0===_FIRST_PARTY_CONTRACT_NAMES_contractName?void 0:_FIRST_PARTY_CONTRACT_NAMES_contractName[variation];return(null==currentContractAddress?void 0:currentContractAddress.toLowerCase())===normalizedContractAddress})}})}},"./ui/hooks/useName.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{E:()=>useNames,t:()=>useName});var _metamask_name_controller__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@metamask/name-controller/dist/chunk-6AVJOVIX.mjs"),_metamask_name_controller__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@metamask/name-controller/dist/chunk-6W3DEAGA.mjs"),react_redux__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react-redux/es/index.js"),lodash__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/lodash/lodash.js"),_selectors__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/selectors/index.js");function useName(value,type,variation){return useNames([{value:value,type:type,variation:variation}])[0]}function useNames(requests){var names=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_2__.jPo,lodash__WEBPACK_IMPORTED_MODULE_1__.isEqual);return requests.map(function(param){var _names_type,_names_type_normalizedValue,value=param.value,type=param.type,variation=param.variation,normalizedValue=normalizeValue(value,type),variationsToNameEntries=null!==(_names_type_normalizedValue=null===(_names_type=names[type])||void 0===_names_type?void 0:_names_type[normalizedValue])&&void 0!==_names_type_normalizedValue?_names_type_normalizedValue:{},variationEntry=variationsToNameEntries[variation],fallbackEntry=variationsToNameEntries[_metamask_name_controller__WEBPACK_IMPORTED_MODULE_3__.Pl],entry=(null==variationEntry?void 0:variationEntry.name)||!fallbackEntry?null!=variationEntry?variationEntry:{}:fallbackEntry,_entry_name=entry.name,_entry_sourceId=entry.sourceId,_entry_origin=entry.origin,_entry_proposedNames=entry.proposedNames;return{name:void 0===_entry_name?null:_entry_name,sourceId:void 0===_entry_sourceId?null:_entry_sourceId,proposedNames:void 0===_entry_proposedNames?{}:_entry_proposedNames,origin:void 0===_entry_origin?null:_entry_origin}})}function normalizeValue(value,type){return type===_metamask_name_controller__WEBPACK_IMPORTED_MODULE_4__.k.ETHEREUM_ADDRESS?value.toLowerCase():value}},"./ui/selectors/nft.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{k9:()=>getNftContractsByAddressOnCurrentChain,nG:()=>getNftContractsByAddressByChain});var reselect__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/reselect/dist/reselect.mjs"),_selectors__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/selectors/selectors.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_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 _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}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)}}function getNftContractsByChainByAccount(state){var _state_metamask_allNftContracts;return null!==(_state_metamask_allNftContracts=state.metamask.allNftContracts)&&void 0!==_state_metamask_allNftContracts?_state_metamask_allNftContracts:{}}function getNftsByChainByAccount(state){var _state_metamask_allNfts;return null!==(_state_metamask_allNfts=state.metamask.allNfts)&&void 0!==_state_metamask_allNfts?_state_metamask_allNfts:{}}var getNftContractsByAddressByChain=(0,reselect__WEBPACK_IMPORTED_MODULE_1__.Mz)(getNftContractsByChainByAccount,function(nftContractsByChainByAccount){return Object.keys(nftContractsByChainByAccount).map(function(account){return Object.keys(nftContractsByChainByAccount[account]).map(function(chainId){return nftContractsByChainByAccount[account][chainId].map(function(contract){return _object_spread_props(_object_spread({},contract),{chainId:chainId})})})}).flat().flat().reduce(function(acc,contract){var _acc_chainId,chainId=contract.chainId,data=_object_without_properties(contract,["chainId"]),chainIdContracts=null!==(_acc_chainId=acc[chainId])&&void 0!==_acc_chainId?_acc_chainId:{};return acc[chainId]=chainIdContracts,chainIdContracts[data.address.toLowerCase()]=data,acc},{})}),getNftContractsByAddressOnCurrentChain=(0,reselect__WEBPACK_IMPORTED_MODULE_1__.Mz)(function(state){return(0,_selectors__WEBPACK_IMPORTED_MODULE_0__.wXH)(state)},getNftContractsByAddressByChain,function(currentChainId,nftContractsByAddressByChain){var _nftContractsByAddressByChain_currentChainId;return null!==(_nftContractsByAddressByChain_currentChainId=nftContractsByAddressByChain[currentChainId])&&void 0!==_nftContractsByAddressByChain_currentChainId?_nftContractsByAddressByChain_currentChainId:{}});(0,reselect__WEBPACK_IMPORTED_MODULE_1__.Mz)(getNftsByChainByAccount,function(nftsByChainByAccount){return Object.values(nftsByChainByAccount).reduce(function(acc,nftsByChain){var nftsArrays=Object.values(nftsByChain);return acc.concat.apply(acc,_to_consumable_array(nftsArrays))},[])})}}]);