LavaPack.loadBundle([[4065,{"../../../shared/constants/common":3403,"../../../shared/constants/gas":3404,"../../../shared/constants/transaction":3417,"../../../shared/lib/metamask-controller-utils":3420,"../../../shared/lib/transactions-controller-utils":3425,"../../../shared/modules/Numeric":3427,"../../../shared/modules/conversion.utils":3431,"../../../shared/modules/hexstring-utils":3435,"../../../shared/modules/string-utils":3442,"../../../shared/modules/transaction.utils":3444,"../../helpers/constants/error-keys":4071,"../../helpers/utils/optimism/fetchEstimatedL1Fee":4102,"../../helpers/utils/token-util":4105,"../../helpers/utils/transactions.util":4106,"../../helpers/utils/util":4108,"../../pages/send/send.constants":4311,"../../pages/send/send.utils":4313,"../../selectors":4436,"../../store/actionConstants":4442,"../../store/actions":4443,"../domains":4056,"../gas/gas.duck":4058,"../metamask/metamask":4062,"./helpers":4063,"@reduxjs/toolkit":1391,"bignumber.js":1853,"ethereumjs-util":2231,lodash:2932,uuid:3351},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.draftTransactionInitialState=a.default=a.computeEstimatedGasLimit=a.addHistoryEntry=a.acknowledgeRecipientWarning=a.SEND_STATUSES=a.SEND_STAGES=a.RECIPIENT_SEARCH_MODES=a.GAS_INPUT_MODES=a.AMOUNT_MODES=void 0,a.editExistingTransaction=function(e,t){return async(a,n)=>{await a(B.clearPreviousDrafts());const s=n(),o=(0,E.getUnapprovedTxs)(s)[t],i=(0,m.getTargetAccount)(s,o.txParams.from);if(e===k.AssetType.native)await a(B.addNewDraft({...U,id:t,fromAccount:i,gas:{...U.gas,gasLimit:o.txParams.gas,gasPrice:o.txParams.gasPrice},userInputHexData:o.txParams.data,recipient:{...U.recipient,address:o.txParams.to,nickname:(0,m.getAddressBookEntryOrAccountName)(s,o.txParams.to)??""},amount:{...U.amount,value:o.txParams.value},history:[`sendFlow - user clicked edit on transaction with id ${t}`]})),await a(ne({type:k.AssetType.native},{initialAssetSet:!0}));else{const n=(0,b.parseStandardTokenTransactionData)(o.txParams.data),u=e===k.AssetType.token?(0,N.getTokenValueParam)(n):"1",l=(0,T.getTokenAddressParam)(n),d=(0,m.getAddressBookEntryOrAccountName)(s,l)??"",p=(0,r.addHexPrefix)((0,c.decimalToHex)(u));await a(B.addNewDraft({...U,id:t,fromAccount:i,gas:{...U.gas,gasLimit:o.txParams.gas,gasPrice:o.txParams.gasPrice},userInputHexData:o.txParams.data,recipient:{...U.recipient,address:l,nickname:d},amount:{...U.amount,value:p},history:[`sendFlow - user clicked edit on transaction with id ${t}`]})),await a(ne({type:e,details:{address:o.txParams.to,...e===k.AssetType.NFT?{tokenId:(0,T.getTokenIdParam)(n)??(0,N.getTokenValueParam)(n)}:{}}},{initialAssetSet:!0}))}await a(H())}},a.gasFeeIsInError=function(e){var t;return Boolean(null===(t=re(e).gas)||void 0===t?void 0:t.error)},a.getAssetError=function(e){return oe(e).error},a.getCurrentDraftTransaction=re,a.getCurrentTransactionUUID=se,a.getDraftTransactionExists=function(e){const t=re(e);if(0===Object.keys(t).length)return!1;return!0},a.getDraftTransactionID=function(e){return re(e).id},a.getGasInputMode=function(e){const t=(0,m.getIsMainnet)(e),a=(0,E.getGasEstimateType)(e),n=(0,m.getAdvancedInlineGasShown)(e);if(e.send.gasIsSetInModal)return F.CUSTOM;if(!t||n)return F.INLINE;if(t&&a===u.GasEstimateTypes.ethGasPrice)return F.INLINE;return F.BASIC},a.getGasLimit=function(e){var t;return null===(t=re(e).gas)||void 0===t?void 0:t.gasLimit},a.getGasPrice=function(e){var t;return null===(t=re(e).gas)||void 0===t?void 0:t.gasPrice},a.getGasTotal=function(e){var t;return null===(t=re(e).gas)||void 0===t?void 0:t.gasTotal},a.getIsAssetSendable=function(e){var t,a,n;if((null===(t=oe(e))||void 0===t?void 0:t.type)===k.AssetType.native)return!0;return!1===(null===(a=oe(e))||void 0===a||null===(n=a.details)||void 0===n?void 0:n.isERC721)},a.getIsBalanceInsufficient=function(e){var t;return(null===(t=re(e).gas)||void 0===t?void 0:t.error)===l.INSUFFICIENT_FUNDS_ERROR},a.getIsUsingMyAccountForRecipientSearch=function(e){return e.send.recipientMode===G.MY_ACCOUNTS},a.getMinimumGasLimitForSend=function(e){return e.send.gasLimitMinimum},a.getRecipient=ie,a.getRecipientUserInput=function(e){return e.send.recipientInput},a.getRecipientWarningAcknowledgement=function(e){var t;return(null===(t=re(e).recipient)||void 0===t?void 0:t.recipientWarningAcknowledged)??!1},a.getSendAmount=function(e){var t;return null===(t=re(e).amount)||void 0===t?void 0:t.value},a.getSendAsset=oe,a.getSendAssetAddress=function(e){var t,a;return null===(t=oe(e))||void 0===t||null===(a=t.details)||void 0===a?void 0:a.address},a.getSendErrors=function(e){var t,a;return{gasFee:null===(t=re(e).gas)||void 0===t?void 0:t.error,amount:null===(a=re(e).amount)||void 0===a?void 0:a.error}},a.getSendHexData=function(e){return re(e).userInputHexData},a.getSendMaxModeState=function(e){return e.send.amountMode===D.MAX},a.getSendStage=function(e){return e.send.stage},a.getSendTo=function(e){var t;return null===(t=ie(e))||void 0===t?void 0:t.address},a.initializeSendState=a.initialState=void 0,a.isSendFormInvalid=function(e){const t=re(e);if(!t)return!0;return t.status===x.INVALID},a.isSendStateInitialized=function(e){return e.send.stage!==M.INACTIVE},a.resetRecipientInput=function(){return async(e,t)=>{const a=t(),n=(0,m.getCurrentChainId)(a);await e(Z("sendFlow - user cleared recipient input")),await e(ae("")),await e(te({address:"",nickname:""})),await e((0,v.resetDomainResolution)()),await e(Q({chainId:n}))}},a.resetSendState=function(){return async(e,t)=>{const a=t();e(B.resetSendState()),a.send.gasEstimatePollToken&&(await(0,p.disconnectGasFeeEstimatePoller)(a.send.gasEstimatePollToken),(0,p.removePollingTokenFromAppState)(a.send.gasEstimatePollToken))}},a.sendAmountIsInError=function(e){var t;return Boolean(null===(t=re(e).amount)||void 0===t?void 0:t.error)},a.signTransaction=function(){return async(e,t)=>{const a=t(),{stage:n,eip1559support:s}=a.send,r=(0,P.generateTransactionParams)(a.send),i=a.send.draftTransactions[a.send.currentTransactionUUID];if(n===M.EDIT){var c;const t=(0,E.getUnapprovedTxs)(a),n=(0,o.cloneDeep)(t[i.id]),u={data:r.data,from:r.from,to:r.to,value:r.value,gas:n.userEditedGasLimit?n.txParams.gas:r.gas};n.originalGasEstimate=u.gas;const l={...n,txParams:Object.assign(n.txParams,s?u:r)};await e(Z("sendFlow - user clicked next and transaction should be updated in controller")),await e((0,p.updateTransactionSendFlowHistory)(i.id,(null===(c=n.sendFlowHistory)||void 0===c?void 0:c.length)||0,i.history)),await e((0,p.updateEditableParams)(i.id,l.txParams)),await e((0,p.updateTransactionGasFees)(i.id,l.txParams))}else{let t=i.recipient.type===l.RECIPIENT_TYPES.SMART_CONTRACT?k.TransactionType.contractInteraction:k.TransactionType.simpleSend;i.asset.type!==k.AssetType.native&&(t=i.asset.type===k.AssetType.NFT?k.TransactionType.tokenMethodTransferFrom:k.TransactionType.tokenMethodTransfer),await e(Z("sendFlow - user clicked next and transaction should be added to controller")),e((0,p.addUnapprovedTransactionAndRouteToConfirmationPage)(undefined,r,t,i.history))}}},a.startNewDraftTransaction=function(e){return async t=>{await t(B.clearPreviousDrafts()),await t(B.addNewDraft({...U,history:["sendFlow - User started new draft transaction"]})),await t(ne({type:e.type??k.AssetType.native,details:e.details})),await t(H())}},a.toggleSendMaxMode=function(){return async(e,t)=>{t().send.amountMode===D.MAX?(await e(B.updateAmountMode(D.INPUT)),await e(B.updateSendAmount("0x0")),await e(Z("sendFlow - user toggled max mode off"))):(await e(B.updateAmountMode(D.MAX)),await e(B.updateAmountToMax()),await e(Z("sendFlow - user toggled max mode on"))),await e($())}},a.updateGasLimit=void 0,a.updateGasPrice=function(e){return t=>{t(Z(`sendFlow - user set legacy gasPrice to ${e}`)),t(B.updateGasFees({gasPrice:e,transactionType:k.TransactionEnvelopeType.legacy,manuallyEdited:!0}))}},a.updateRecipient=te,a.updateRecipientUserInput=ae,a.updateSendAmount=function(e){return async(t,a)=>{const n=a(),{metamask:s}=n,o=n.send.draftTransactions[n.send.currentTransactionUUID];let i=e;if(o.asset.type===k.AssetType.token){var u,l,d;const t=Math.pow(10,Number((null===(u=o.asset.details)||void 0===u?void 0:u.decimals)||0)),a=new C.Numeric((0,r.addHexPrefix)(e),16).toBase(10).applyConversionRate(null!==(l=o.asset.details)&&void 0!==l&&l.symbol?t:1,!0).toString();i=`${Number(a)?a:""} ${null===(d=o.asset.details)||void 0===d?void 0:d.symbol}`}else{var m;i=`${(0,c.getValueFromWeiHex)({value:e,toCurrency:I.EtherDenomination.ETH,numberOfDecimals:8})} ${(null==s||null===(m=s.provider)||void 0===m?void 0:m.ticker)||I.EtherDenomination.ETH}`}await t(Z(`sendFlow - user set amount to ${i}`)),await t(B.updateSendAmount(e)),n.send.amountMode===D.MAX&&await t(B.updateAmountMode(D.INPUT)),await t($())}},a.updateSendAsset=ne,a.updateSendHexData=function(e){return async(t,a)=>{await t(Z(`sendFlow - user added custom hexData ${e}`)),await t(B.updateUserInputHexData(e));const n=a();n.send.draftTransactions[n.send.currentTransactionUUID].asset.type===k.AssetType.native&&await t($())}},a.useContactListForRecipientSearch=function(){return e=>{e(Z("sendFlow - user selected back to all on recipient screen")),e(z(G.CONTACT_LIST))}},a.useDefaultGas=a.useCustomGas=void 0,a.useMyAccountsForRecipientSearch=function(){return e=>{e(Z("sendFlow - user selected transfer to my accounts on recipient screen")),e(z(G.MY_ACCOUNTS))}};var n=e("@reduxjs/toolkit"),s=R(e("bignumber.js")),r=e("ethereumjs-util"),o=e("lodash"),i=e("uuid"),c=e("../../../shared/modules/conversion.utils"),u=e("../../../shared/constants/gas"),l=e("../../pages/send/send.constants"),d=e("../../pages/send/send.utils"),m=e("../../selectors"),p=e("../../store/actions"),f=e("../gas/gas.duck"),g=e("../../store/actionConstants"),T=e("../../helpers/utils/token-util"),h=e("../../helpers/utils/util"),E=e("../metamask/metamask"),v=e("../domains"),_=e("../../../shared/modules/hexstring-utils"),y=e("../../helpers/utils/transactions.util"),S=R(e("../../helpers/utils/optimism/fetchEstimatedL1Fee")),k=e("../../../shared/constants/transaction"),A=e("../../helpers/constants/error-keys"),w=e("../../../shared/modules/string-utils"),b=e("../../../shared/modules/transaction.utils"),N=e("../../../shared/lib/metamask-controller-utils"),O=e("../../../shared/lib/transactions-controller-utils"),C=e("../../../shared/modules/Numeric"),I=e("../../../shared/constants/common"),P=e("./helpers");function R(e){return e&&e.__esModule?e:{default:e}}const M={ADD_RECIPIENT:"ADD_RECIPIENT",DRAFT:"DRAFT",EDIT:"EDIT",INACTIVE:"INACTIVE"};a.SEND_STAGES=M;const x={INVALID:"INVALID",VALID:"VALID"};a.SEND_STATUSES=x;const F={BASIC:"BASIC",CUSTOM:"CUSTOM",INLINE:"INLINE"};a.GAS_INPUT_MODES=F;const D={INPUT:"INPUT",MAX:"MAX"};a.AMOUNT_MODES=D;const G={CONTACT_LIST:"CONTACT_LIST",MY_ACCOUNTS:"MY_ACCOUNTS"};a.RECIPIENT_SEARCH_MODES=G;const U={amount:{error:null,value:"0x0"},asset:{balance:"0x0",details:null,error:null,type:k.AssetType.native},fromAccount:null,gas:{error:null,gasLimit:"0x0",gasPrice:"0x0",gasTotal:"0x0",maxFeePerGas:"0x0",maxPriorityFeePerGas:"0x0",wasManuallyEdited:!1},history:[],id:null,recipient:{address:"",error:null,nickname:"",warning:null,type:"",recipientWarningAcknowledged:!1},status:x.VALID,transactionType:k.TransactionEnvelopeType.legacy,userInputHexData:null};a.draftTransactionInitialState=U;const L={amountMode:D.INPUT,currentTransactionUUID:null,draftTransactions:{},eip1559support:!1,gasEstimateIsLoading:!0,gasEstimatePollToken:null,gasIsSetInModal:!1,gasPriceEstimate:"0x0",gasLimitMinimum:u.GAS_LIMITS.SIMPLE,gasTotalForLayer1:"0x0",recipientMode:G.CONTACT_LIST,recipientInput:"",selectedAccount:{address:null,balance:"0x0"},stage:M.INACTIVE};a.initialState=L;const j="send",$=(0,n.createAsyncThunk)("send/computeEstimatedGasLimit",(async(e,t)=>{var a;const n=t.getState(),{send:s,metamask:r}=n,o=s.draftTransactions[s.currentTransactionUUID],i=(0,E.getUnapprovedTxs)(n),c=(0,m.getIsMultiLayerFeeNetwork)(n),u=i[o.id],l=(0,m.getIsNonStandardEthChain)(n),d=(0,m.getCurrentChainId)(n);let p;var g;c&&(p=await(0,S.default)(d,{txParams:{gasPrice:o.gas.gasPrice,gas:o.gas.gasLimit,to:null===(g=o.recipient.address)||void 0===g?void 0:g.toLowerCase(),value:s.amountMode===D.MAX?s.selectedAccount.balance:o.amount.value,from:s.selectedAccount.address,data:o.userInputHexData,type:"0x0"}}));if(s.stage!==M.EDIT||null===(a=u.dappSuggestedGasFees)||void 0===a||!a.gas||!u.userEditedGasLimit){var T;const e=await(0,P.estimateGasLimitForSend)({gasPrice:o.gas.gasPrice,blockGasLimit:r.currentBlockGasLimit,selectedAddress:r.selectedAddress,sendToken:o.asset.details,to:null===(T=o.recipient.address)||void 0===T?void 0:T.toLowerCase(),value:o.amount.value,data:o.userInputHexData,isNonStandardEthChain:l,chainId:d,gasLimit:o.gas.gasLimit});return await t.dispatch((0,f.setCustomGasLimit)(e)),{gasLimit:e,gasTotalForLayer1:p}}return null}));a.computeEstimatedGasLimit=$;const H=(0,n.createAsyncThunk)("send/initializeSendState",(async({chainHasChanged:e=!1}={},t)=>{const a=t.getState(),n=(0,m.getIsNonStandardEthChain)(a),s=(0,m.getCurrentChainId)(a),o=(0,m.checkNetworkAndAccountSupports1559)(a),i=(0,m.getSelectedAccount)(a),{send:c,metamask:l}=a,d=c.draftTransactions[c.currentTransactionUUID];if(!d)return t.rejectWithValue("draftTransaction not found, possibly not on send flow");let g=c.stage===M.EDIT?d.gas.gasPrice:"0x1",T=null;T=await(0,p.getGasFeeEstimatesAndStartPolling)(),(0,p.addPollingTokenToAppState)(T);const{metamask:{gasFeeEstimates:h,gasEstimateType:v}}=t.getState();c.stage!==M.EDIT&&(g=v===u.GasEstimateTypes.legacy?(0,m.getGasPriceInHexWei)(h.medium):v===u.GasEstimateTypes.ethGasPrice?(0,P.getRoundedGasPrice)(h.gasPrice):v===u.GasEstimateTypes.feeMarket?(0,m.getGasPriceInHexWei)(h.medium.suggestedMaxFeePerGas):h.gasPrice?(0,P.getRoundedGasPrice)(h.gasPrice):"0x0");let{gasLimit:_}=d.gas;if(v!==u.GasEstimateTypes.none&&c.stage!==M.EDIT&&d.recipient.address){var y;_=d.asset.type===k.AssetType.token||d.asset.type===k.AssetType.NFT?u.GAS_LIMITS.BASE_TOKEN_ESTIMATE:u.GAS_LIMITS.SIMPLE;_=await(0,P.estimateGasLimitForSend)({gasPrice:g,blockGasLimit:l.currentBlockGasLimit,selectedAddress:(null===(y=d.fromAccount)||void 0===y?void 0:y.address)??c.selectedAccount.address,sendToken:d.asset.details,to:d.recipient.address.toLowerCase(),value:d.amount.value,data:d.userInputHexData,isNonStandardEthChain:n,chainId:s})||_}await t.dispatch((0,f.setCustomGasLimit)(_));return t.getState().send.currentTransactionUUID!==c.currentTransactionUUID?t.rejectWithValue("draftTransaction changed during initialization.\n        A new initializeSendState action must be dispatched."):{account:i,chainId:(0,m.getCurrentChainId)(a),tokens:(0,E.getTokens)(a),chainHasChanged:e,gasFeeEstimates:h,gasEstimateType:v,gasLimit:_,gasTotal:(0,r.addHexPrefix)((0,O.calcGasTotal)(_,g)),gasEstimatePollToken:T,eip1559support:o,useTokenDetection:(0,m.getUseTokenDetection)(a),tokenAddressList:Object.keys((0,m.getTokenList)(a))}}));a.initializeSendState=H;const W=(0,n.createSlice)({name:j,initialState:L,reducers:{addNewDraft:(e,t)=>{e.currentTransactionUUID=(0,i.v4)(),e.draftTransactions[e.currentTransactionUUID]=t.payload,t.payload.id?e.stage=M.EDIT:e.stage=M.ADD_RECIPIENT},addHistoryEntry:(e,t)=>{const a=e.draftTransactions[e.currentTransactionUUID];a&&a.history.push({entry:t.payload,timestamp:Date.now()})},calculateGasTotal:e=>{const t=e.draftTransactions[e.currentTransactionUUID];t.transactionType===k.TransactionEnvelopeType.feeMarket?t.gas.gasTotal=(0,r.addHexPrefix)((0,O.calcGasTotal)(t.gas.gasLimit,t.gas.maxFeePerGas)):t.gas.gasTotal=(0,r.addHexPrefix)((0,O.calcGasTotal)(t.gas.gasLimit,t.gas.gasPrice)),e.amountMode===D.MAX&&t.asset.type===k.AssetType.native&&W.caseReducers.updateAmountToMax(e),W.caseReducers.validateAmountField(e),W.caseReducers.validateGasField(e),W.caseReducers.validateSendState(e)},clearPreviousDrafts:e=>{e.currentTransactionUUID=null,e.draftTransactions={}},resetSendState:()=>L,updateAmountMode:(e,t)=>{Object.values(D).includes(t.payload)&&(e.amountMode=t.payload)},updateAmountToMax:e=>{const t=e.draftTransactions[e.currentTransactionUUID];let a="0x0";if(t.asset.type===k.AssetType.token){var n;const e=(null===(n=t.asset.details)||void 0===n?void 0:n.decimals)??0,s=Math.pow(10,Number(e));a=new C.Numeric(t.asset.balance,16).times(s,10).toString()}else{const n=new C.Numeric(t.gas.gasTotal||"0x0",16).add(new C.Numeric(e.gasTotalForLayer1||"0x0",16));a=new C.Numeric(t.asset.balance,16).minus(n).toString()}W.caseReducers.updateSendAmount(e,{payload:a})},updateAsset:(e,t)=>{const{asset:a,initialAssetSet:n}=t.payload,s=e.draftTransactions[e.currentTransactionUUID];s.asset.type=a.type,s.asset.balance=a.balance,s.asset.error=a.error,s.asset.type===k.AssetType.token||s.asset.type===k.AssetType.NFT?s.asset.details=a.details:(s.asset.details=null,s.recipient.error===l.CONTRACT_ADDRESS_ERROR&&(s.recipient.error=null)),e.amountMode===D.MAX?W.caseReducers.updateAmountToMax(e):!1===n&&W.caseReducers.updateSendAmount(e,{payload:"0x0"}),W.caseReducers.validateSendState(e)},updateGasFeeEstimates:(e,t)=>{const{gasFeeEstimates:a,gasEstimateType:n}=t.payload;let s="0x0";switch(n){case u.GasEstimateTypes.feeMarket:W.caseReducers.updateGasFees(e,{payload:{transactionType:k.TransactionEnvelopeType.feeMarket,maxFeePerGas:(0,m.getGasPriceInHexWei)(a.medium.suggestedMaxFeePerGas),maxPriorityFeePerGas:(0,m.getGasPriceInHexWei)(a.medium.suggestedMaxPriorityFeePerGas)}});break;case u.GasEstimateTypes.legacy:s=(0,P.getRoundedGasPrice)(a.medium),W.caseReducers.updateGasFees(e,{payload:{gasPrice:s,type:k.TransactionEnvelopeType.legacy,isAutomaticUpdate:!0}});break;case u.GasEstimateTypes.ethGasPrice:s=(0,P.getRoundedGasPrice)(a.gasPrice),W.caseReducers.updateGasFees(e,{payload:{gasPrice:(0,P.getRoundedGasPrice)(a.gasPrice),type:k.TransactionEnvelopeType.legacy,isAutomaticUpdate:!0}});case u.GasEstimateTypes.none:}e.gasPriceEstimate=(0,r.addHexPrefix)(s)},updateGasFees:(e,t)=>{const a=e.draftTransactions[e.currentTransactionUUID];a&&(t.payload.transactionType===k.TransactionEnvelopeType.feeMarket?(a.gas.maxFeePerGas=(0,r.addHexPrefix)(t.payload.maxFeePerGas),a.gas.maxPriorityFeePerGas=(0,r.addHexPrefix)(t.payload.maxPriorityFeePerGas),a.transactionType=k.TransactionEnvelopeType.feeMarket):(t.payload.manuallyEdited&&(a.gas.wasManuallyEdited=!0),a.gas.wasManuallyEdited&&!t.payload.manuallyEdited||(a.gas.gasPrice=(0,r.addHexPrefix)(t.payload.gasPrice)),a.transactionType=k.TransactionEnvelopeType.legacy),W.caseReducers.calculateGasTotal(e))},updateGasLimit:(e,t)=>{const a=e.draftTransactions[e.currentTransactionUUID];a&&(a.gas.gasLimit=(0,r.addHexPrefix)(t.payload),W.caseReducers.calculateGasTotal(e))},updateLayer1Fees:(e,t)=>{const a=e.draftTransactions[e.currentTransactionUUID];e.gasTotalForLayer1=t.payload,e.amountMode===D.MAX&&a.asset.type===k.AssetType.native&&W.caseReducers.updateAmountToMax(e)},updateRecipient:(e,t)=>{const a=e.draftTransactions[e.currentTransactionUUID];a.recipient.error=null,e.recipientInput="",a.recipient.address=t.payload.address??"",a.recipient.nickname=t.payload.nickname??"",""===a.recipient.address?e.stage=M.ADD_RECIPIENT:(e.stage=null===a.id?M.DRAFT:M.EDIT,e.recipientMode=G.CONTACT_LIST),W.caseReducers.validateSendState(e)},updateRecipientSearchMode:(e,t)=>{e.recipientInput="",e.recipientMode=t.payload},updateRecipientWarning:(e,t)=>{e.draftTransactions[e.currentTransactionUUID].recipient.warning=t.payload},updateRecipientType:(e,t)=>{e.draftTransactions[e.currentTransactionUUID].recipient.type=t.payload},updateDraftTransactionStatus:(e,t)=>{e.draftTransactions[e.currentTransactionUUID].status=t.payload},acknowledgeRecipientWarning:e=>{e.draftTransactions[e.currentTransactionUUID].recipient.recipientWarningAcknowledged=!0,W.caseReducers.validateSendState(e)},updateRecipientUserInput:(e,t)=>{e.recipientInput=t.payload},updateSendAmount:(e,t)=>{const a=e.draftTransactions[e.currentTransactionUUID];a.amount.value=(0,r.addHexPrefix)(t.payload),W.caseReducers.validateAmountField(e),a.asset.type===k.AssetType.native&&W.caseReducers.validateGasField(e),W.caseReducers.validateSendState(e)},updateUserInputHexData:(e,t)=>{e.draftTransactions[e.currentTransactionUUID].userInputHexData=t.payload},useCustomGas:e=>{e.gasIsSetInModal=!0},useDefaultGas:e=>{e.gasIsSetInModal=!1},validateAmountField:e=>{const t=e.draftTransactions[e.currentTransactionUUID],a=new C.Numeric(t.amount.value,16);switch(!0){case t.asset.type===k.AssetType.native&&!(0,d.isBalanceSufficient)({amount:t.amount.value,balance:t.asset.balance,gasTotal:t.gas.gasTotal??"0x0"}):t.amount.error=l.INSUFFICIENT_FUNDS_FOR_GAS_ERROR;break;case t.asset.type===k.AssetType.token&&!(0,d.isTokenBalanceSufficient)({tokenBalance:t.asset.balance??"0x0",amount:t.amount.value,decimals:t.asset.details.decimals}):t.amount.error=l.INSUFFICIENT_TOKENS_ERROR;break;case a.isNegative():t.amount.error=l.NEGATIVE_ETH_ERROR;break;default:t.amount.error=null}},validateGasField:e=>{var t;const a=e.draftTransactions[e.currentTransactionUUID],n=!(0,d.isBalanceSufficient)({amount:a.asset.type===k.AssetType.native?a.amount.value:"0x0",balance:(null===(t=a.fromAccount)||void 0===t?void 0:t.balance)??e.selectedAccount.balance,gasTotal:a.gas.gasTotal??"0x0"});a.gas.error=n?l.INSUFFICIENT_FUNDS_ERROR:null},validateRecipientUserInput:(e,t)=>{const a=e.draftTransactions[e.currentTransactionUUID];if(a)if(e.recipientMode===G.MY_ACCOUNTS||""===e.recipientInput||null===e.recipientInput)a.recipient.error=null,a.recipient.warning=null;else{var n,s;const{chainId:r,tokens:o,tokenAddressList:i,isProbablyAnAssetContract:c}=t.payload;(0,_.isBurnAddress)(e.recipientInput)||!(0,_.isValidHexAddress)(e.recipientInput,{mixedCaseUseChecksum:!0})&&!(0,h.isValidDomainName)(e.recipientInput)?a.recipient.error=(0,h.isDefaultMetaMaskChain)(r)?l.INVALID_RECIPIENT_ADDRESS_ERROR:l.INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR:(0,h.isOriginContractAddress)(e.recipientInput,null===(n=a.asset)||void 0===n||null===(s=n.details)||void 0===s?void 0:s.address)?a.recipient.error=l.CONTRACT_ADDRESS_ERROR:a.recipient.error=null,(0,_.isValidHexAddress)(e.recipientInput)&&(i.find((t=>(0,w.isEqualCaseInsensitive)(t,e.recipientInput)))||(0,h.checkExistingAddresses)(e.recipientInput,o))||c?a.recipient.warning=l.KNOWN_RECIPIENT_ADDRESS_WARNING:a.recipient.warning=null}W.caseReducers.validateSendState(e)},validateSendState:e=>{const t=e.draftTransactions[e.currentTransactionUUID];if(W.caseReducers.addHistoryEntry(e,{payload:"Begin validating send state"}),t)switch(!0){case Boolean(t.amount.error):W.caseReducers.addHistoryEntry(e,{payload:`Amount is in error ${t.amount.error}`}),t.status=x.INVALID;break;case Boolean(t.gas.error):W.caseReducers.addHistoryEntry(e,{payload:`Gas is in error ${t.gas.error}`}),t.status=x.INVALID;break;case Boolean(t.asset.error):W.caseReducers.addHistoryEntry(e,{payload:`Asset is in error ${t.asset.error}`}),t.status=x.INVALID;break;case t.asset.type===k.AssetType.token&&null===t.asset.details:W.caseReducers.addHistoryEntry(e,{payload:"Asset is TOKEN and token details is null"}),t.status=x.INVALID;break;case e.stage===M.ADD_RECIPIENT:W.caseReducers.addHistoryEntry(e,{payload:"Form is invalid because stage is ADD_RECIPIENT"}),t.status=x.INVALID;break;case e.stage===M.INACTIVE:W.caseReducers.addHistoryEntry(e,{payload:"Form is invalid because stage is INACTIVE"}),t.status=x.INVALID;break;case e.gasEstimateIsLoading:W.caseReducers.addHistoryEntry(e,{payload:"Form is invalid because gasEstimateIsLoading"}),t.status=x.INVALID;break;case new s.default(t.gas.gasLimit,16).lessThan(new s.default(e.gasLimitMinimum)):W.caseReducers.addHistoryEntry(e,{payload:`Form is invalid because ${t.gas.gasLimit} is lessThan ${e.gasLimitMinimum}`}),t.status=x.INVALID;break;case"loading"===t.recipient.warning:W.caseReducers.addHistoryEntry(e,{payload:"Form is invalid because recipient warning is loading"}),t.status=x.INVALID;break;case t.recipient.warning===l.KNOWN_RECIPIENT_ADDRESS_WARNING&&!1===t.recipient.recipientWarningAcknowledged:W.caseReducers.addHistoryEntry(e,{payload:"Form is invalid because recipient warning not acknolwedged"}),t.status=x.INVALID;break;default:W.caseReducers.addHistoryEntry(e,{payload:"Form is valid"}),t.status=x.VALID}}},extraReducers:e=>{e.addCase(g.ACCOUNT_CHANGED,((e,t)=>{if(e.stage===M.EDIT&&t.payload.account){const a=e.draftTransactions[e.currentTransactionUUID];a&&a.fromAccount&&a.fromAccount.address===t.payload.account.address&&(a.fromAccount.balance=t.payload.account.balance,a.asset.type===k.AssetType.native&&(a.asset.balance=t.payload.account.balance),W.caseReducers.validateAmountField(e),W.caseReducers.validateGasField(e),W.caseReducers.validateSendState(e))}})).addCase(g.ADDRESS_BOOK_UPDATED,((e,t)=>{var a;const{addressBook:n}=t.payload,s=e.draftTransactions[e.currentTransactionUUID];s&&null!==(a=n[s.recipient.address])&&void 0!==a&&a.name&&(s.recipient.nickname=n[s.recipient.address].name)})).addCase($.pending,(e=>{e.gasEstimateIsLoading=!0})).addCase($.fulfilled,((e,t)=>{var a,n;e.gasEstimateIsLoading=!1,null!==(a=t.payload)&&void 0!==a&&a.gasLimit&&W.caseReducers.updateGasLimit(e,{payload:t.payload.gasLimit}),null!==(n=t.payload)&&void 0!==n&&n.gasTotalForLayer1&&W.caseReducers.updateLayer1Fees(e,{payload:t.payload.gasTotalForLayer1})})).addCase($.rejected,(e=>{e.gasEstimateIsLoading=!1})).addCase(g.GAS_FEE_ESTIMATES_UPDATED,((e,t)=>{W.caseReducers.updateGasFeeEstimates(e,{payload:t.payload})})).addCase(H.pending,(e=>{e.gasEstimateIsLoading=!0})).addCase(H.fulfilled,((e,t)=>{e.eip1559support=t.payload.eip1559support,e.selectedAccount.address=t.payload.account.address,e.selectedAccount.balance=t.payload.account.balance;const a=e.draftTransactions[e.currentTransactionUUID];var n;a&&(a.gas.gasLimit=t.payload.gasLimit,a.gas.gasTotal=t.payload.gasTotal,t.payload.chainHasChanged&&(a.asset.type=k.AssetType.native,a.asset.balance=(null===(n=a.fromAccount)||void 0===n?void 0:n.balance)??e.selectedAccount.balance,a.asset.details=null));W.caseReducers.updateGasFeeEstimates(e,{payload:{gasFeeEstimates:t.payload.gasFeeEstimates,gasEstimateType:t.payload.gasEstimateType}}),e.gasEstimatePollToken=t.payload.gasEstimatePollToken,t.payload.gasEstimatePollToken&&(e.gasEstimateIsLoading=!1),e.stage!==M.INACTIVE&&W.caseReducers.validateRecipientUserInput(e,{payload:{chainId:t.payload.chainId,tokens:t.payload.tokens,useTokenDetection:t.payload.useTokenDetection,tokenAddressList:t.payload.tokenAddressList}}),e.amountMode===D.MAX&&W.caseReducers.updateAmountToMax(e),W.caseReducers.validateAmountField(e),W.caseReducers.validateGasField(e),W.caseReducers.validateSendState(e)})).addCase(g.SELECTED_ACCOUNT_CHANGED,((e,t)=>{if(e.stage!==M.EDIT&&t.payload.account){e.selectedAccount.balance=t.payload.account.balance,e.selectedAccount.address=t.payload.account.address;const a=e.draftTransactions[e.currentTransactionUUID];a&&((null==a?void 0:a.asset.type)===k.AssetType.native&&(a.asset.balance=t.payload.account.balance),W.caseReducers.validateAmountField(e),W.caseReducers.validateGasField(e),W.caseReducers.validateSendState(e))}})).addCase(g.QR_CODE_DETECTED,((e,t)=>{const a=t.value,n=e.draftTransactions[e.currentTransactionUUID];if(a&&n&&"address"===a.type){const t=a.values.address.toLowerCase();(0,_.isValidHexAddress)(t,{allowNonPrefixed:!1})?n.recipient.address!==t&&W.caseReducers.updateRecipient(e,{payload:{address:t}}):n.recipient.error=l.INVALID_RECIPIENT_ADDRESS_ERROR}}))}}),{actions:B,reducer:q}=W;var V=q;a.default=V;const{useDefaultGas:K,useCustomGas:Y,updateGasLimit:X,validateRecipientUserInput:Q,updateRecipientSearchMode:z,addHistoryEntry:Z,acknowledgeRecipientWarning:J}=B;a.acknowledgeRecipientWarning=J,a.addHistoryEntry=Z,a.updateGasLimit=X,a.useCustomGas=Y,a.useDefaultGas=K;const ee=(0,o.debounce)(((e,t,a)=>{e(Z(`sendFlow - user typed ${t.userInput} into recipient input field`)),e(Q(t)),a()}),300);function te({address:e,nickname:t}){return async(a,n)=>{const s=n(),r=(0,m.getAddressBookEntryOrAccountName)(s,e)??"";await a(B.updateRecipient({address:e,nickname:t||r})),await a($())}}function ae(e){return async(t,a)=>{var n;t(B.updateRecipientWarning("loading")),t(B.updateDraftTransactionStatus(x.INVALID)),await t(B.updateRecipientUserInput(e));const s=a(),r=(null===(n=s.send.draftTransactions[s.send.currentTransactionUUID].fromAccount)||void 0===n?void 0:n.address)??s.send.selectedAccount.address??(0,m.getSelectedAddress)(s),o=(0,m.getCurrentChainId)(s),i=(0,E.getTokens)(s),c=(0,m.getUseTokenDetection)(s),u=(0,m.getTokenList)(s),d=Object.keys(u),f=(0,_.isValidHexAddress)(e);let g=!1;if(f){if(await(0,y.isSmartContractAddress)(e)){t(B.updateRecipientType(l.RECIPIENT_TYPES.SMART_CONTRACT));const{symbol:a,decimals:n}=(0,T.getTokenMetadata)(e,u)||{};if(g=a&&n!==undefined,!g)try{const{standard:t}=await(0,p.getTokenStandardAndDetails)(e,r);g=Boolean(t)}catch(e){console.log(e)}}}return new Promise((a=>{ee(t,{userInput:e,chainId:o,tokens:i,useTokenDetection:c,tokenAddressList:d,isProbablyAnAssetContract:g},a)}))}}function ne({type:e,details:t},{initialAssetSet:a=!1}={}){return async(n,s)=>{var o;const i=s(),c=i.send.draftTransactions[i.send.currentTransactionUUID],u=(null===(o=c.fromAccount)||void 0===o?void 0:o.address)??i.send.selectedAccount.address??(0,m.getSelectedAddress)(i),l=(0,m.getTargetAccount)(i,u);if(e===k.AssetType.native){var d;const t=(0,E.getUnapprovedTxs)(i),s=null==t?void 0:t[c.id];await n(Z(`sendFlow - user set asset of type ${k.AssetType.native} with symbol ${(null===(d=i.metamask.provider)||void 0===d?void 0:d.ticker)??I.EtherDenomination.ETH}`)),await n(B.updateAsset({asset:{type:e,details:null,balance:l.balance,error:null},initialAssetSet:a})),(null==s?void 0:s.type)!==k.TransactionType.tokenMethodTransferFrom&&(null==s?void 0:s.type)!==k.TransactionType.tokenMethodTransfer&&(null==s?void 0:s.type)!==k.TransactionType.tokenMethodSafeTransferFrom||await n(B.updateUserInputHexData(""))}else{await n((0,p.showLoadingIndication)());const s={...t,...await(0,p.getTokenStandardAndDetails)(t.address,u,t.tokenId)};await n((0,p.hideLoadingIndication)());const o={type:e,details:s,error:null};if(s.standard===k.TokenStandard.ERC20)o.balance=(0,r.addHexPrefix)((0,O.calcTokenAmount)(s.balance,s.decimals).toString(16)),await n(Z(`sendFlow - user set asset to ERC20 token with symbol ${s.symbol} and address ${s.address}`));else{if(s.standard===k.TokenStandard.ERC1155&&e===k.AssetType.NFT)throw new Error("Sends of ERC1155 tokens are not currently supported");if(s.standard===k.TokenStandard.ERC1155||s.standard===k.TokenStandard.ERC721){if(e===k.AssetType.token)throw n((0,p.showModal)({name:"CONVERT_TOKEN_TO_NFT",tokenAddress:s.address})),o.error=A.INVALID_ASSET_TYPE,new Error(A.INVALID_ASSET_TYPE);{let e=!0;try{e=await(0,p.isNftOwner)(u,s.address,s.tokenId)}catch(e){e.message.includes("Unable to verify ownership.")||n((0,p.displayWarning)(e.message))}if(!e)throw new Error("Send slice initialized as NFT send with an NFT not currently owned by the select account");o.error=null,o.balance="0x1",await n(Z(`sendFlow - user set asset to NFT with tokenId ${s.tokenId} and address ${s.address}`))}}}await n(B.updateAsset({asset:o,initialAssetSet:a}))}!1===a&&await n($())}}function se(e){return e.send.currentTransactionUUID}function re(e){return e.send.draftTransactions[se(e)]??{}}function oe(e){return re(e).asset}function ie(e){const t=re(e);if(!t.recipient)return{address:"",nickname:"",error:null,warning:null};const a=(0,_.toChecksumHexAddress)(t.recipient.address);return e.metamask.ensResolutionsByAddress?{...t.recipient,nickname:t.recipient.nickname||(0,m.getEnsResolutionByAddress)(e,a)}:t.recipient}}}},{package:"$root$",file:"ui/ducks/send/send.js"}],[4066,{"../../../shared/constants/app":3401,"../../../shared/constants/common":3403,"../../../shared/constants/metametrics":3408,"../../../shared/constants/swaps":3413,"../../../shared/constants/transaction":3417,"../../../shared/lib/transactions-controller-utils":3425,"../../../shared/modules/Numeric":3427,"../../../shared/modules/conversion.utils":3431,"../../helpers/constants/routes":4074,"../../pages/swaps/swaps.util":4420,"../../selectors":4436,"../../store/actions":4443,"../metamask/metamask":4062,"@reduxjs/toolkit":1391,"@sentry/browser":1403,"bignumber.js":1853,loglevel:2944},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.GAS_PRICES_LOADING_STATES=a.FALLBACK_GAS_MULTIPLIER=void 0,a.cancelSwapsSmartTransaction=function(e){return async(t,a)=>{try{await t((0,i.cancelSmartTransaction)(e))}catch(e){const{swaps:{isFeatureFlagLoaded:n}}=a();if(e.message.startsWith("Fetch error:")&&n){const a=(0,u.parseSmartTransactionsError)(e.message);t(_e(null==a?void 0:a.error))}}}},a.fetchAndSetSwapsGasPriceInfo=a.default=a.clearSwapsState=void 0,a.fetchMetaSwapsGasPriceEstimates=ke,a.fetchSwapsLivenessAndFeatureFlags=a.fetchQuotesAndSetQuoteState=void 0,a.fetchSwapsSmartTransactionFees=Ae,a.setTopAssets=a.setSwapsFromToken=a.setSwapToToken=a.setSwapQuotesFetchStartTime=a.setReviewSwapClickedTimestamp=a.setMaxSlippage=a.setIsFeatureFlagLoaded=a.setFromTokenInputValue=a.setFromTokenError=a.setFetchingQuotes=a.setBalanceError=a.setAggregatorMetadata=a.prepareToLeaveSwaps=a.prepareForRetryGetQuotes=a.navigateBackToBuildQuote=a.getUsedSwapsGasPrice=a.getUsedQuote=a.getTradeTxId=a.getTopQuote=a.getTopAssets=a.getToToken=a.getSwapsWelcomeMessageSeenStatus=a.getSwapsUserFeeLevel=a.getSwapsTokens=a.getSwapsSTXLoading=a.getSwapsQuoteRefreshTime=a.getSwapsQuotePrefetchingRefreshTime=a.getSwapsNetworkConfig=a.getSwapsFeatureIsLive=a.getSwapsFallbackGasPrice=a.getSwapsErrorKey=a.getSwapsCustomizationModalPrice=a.getSwapsCustomizationModalLimit=a.getSwapGasPriceEstimateData=a.getSmartTransactionsOptInStatus=a.getSmartTransactionsErrorMessageDismissed=a.getSmartTransactionsError=a.getSmartTransactionsEnabled=a.getSmartTransactionFees=a.getSmartTransactionEstimatedGas=a.getShowQuoteLoadingScreen=a.getSelectedQuote=a.getReviewSwapClickedTimestamp=a.getQuotesLastFetched=a.getQuotesFetchStartTime=a.getQuotes=a.getPendingSmartTransactions=a.getMaxSlippage=a.getIsFeatureFlagLoaded=a.getFromTokenInputValue=a.getFromTokenError=a.getFromToken=a.getFetchingQuotes=a.getFetchParams=a.getDestinationTokenInfo=a.getCustomSwapsGasPrice=a.getCustomSwapsGas=a.getCustomMaxPriorityFeePerGas=a.getCustomMaxFeePerGas=a.getCurrentSmartTransactionsError=a.getCurrentSmartTransactionsEnabled=a.getCurrentSmartTransactions=a.getBalanceError=a.getBackgroundSwapRouteState=a.getApproveTxParams=a.getApproveTxId=a.getAggregatorMetadata=void 0,a.shouldShowCustomPriceTooLowWarning=function(e){const{average:t}=P(e),a=I(e);if(!a||t===undefined)return!1;return new v.Numeric(a,16,E.EtherDenomination.WEI).toDenomination(E.EtherDenomination.GWEI).greaterThan(t,10)},a.swapsQuoteSelected=a.swapGasPriceEstimateIsLoading=a.swapGasEstimateLoadingHasFailed=a.swapCustomGasModalPriceEdited=a.swapCustomGasModalLimitEdited=a.swapCustomGasModalClosed=a.signAndSendTransactions=a.signAndSendSwapsSmartTransaction=void 0;var n=e("@reduxjs/toolkit"),s=_(e("bignumber.js")),r=_(e("loglevel")),o=e("@sentry/browser"),i=e("../../store/actions"),c=e("../../helpers/constants/routes"),u=e("../../pages/swaps/swaps.util"),l=e("../../../shared/modules/conversion.utils"),d=e("../../selectors"),m=e("../../../shared/constants/metametrics"),p=e("../../../shared/constants/swaps"),f=e("../../../shared/constants/transaction"),g=e("../metamask/metamask"),T=e("../../../shared/constants/app"),h=e("../../../shared/lib/transactions-controller-utils"),E=e("../../../shared/constants/common"),v=e("../../../shared/modules/Numeric");function _(e){return e&&e.__esModule?e:{default:e}}const y={INITIAL:"INITIAL",LOADING:"LOADING",FAILED:"FAILED",COMPLETED:"COMPLETED"};a.GAS_PRICES_LOADING_STATES=y;a.FALLBACK_GAS_MULTIPLIER=1.5;const S={aggregatorMetadata:null,approveTxId:null,tradeTxId:null,balanceError:!1,fetchingQuotes:!1,fromToken:null,fromTokenInputValue:"",fromTokenError:null,isFeatureFlagLoaded:!1,maxSlippage:p.Slippage.default,quotesFetchStartTime:null,reviewSwapClickedTimestamp:null,topAssets:{},toToken:null,customGas:{price:null,limit:null,loading:y.INITIAL,priceEstimates:{},fallBackPrice:null},currentSmartTransactionsError:"",swapsSTXLoading:!1},k=(0,n.createSlice)({name:"swaps",initialState:S,reducers:{clearSwapsState:()=>S,navigatedBackToBuildQuote:e=>{e.approveTxId=null,e.tradeTxId=null,e.balanceError=!1,e.fetchingQuotes=!1,e.customGas.limit=null,e.customGas.price=null},retriedGetQuotes:e=>{e.approveTxId=null,e.balanceError=!1,e.fetchingQuotes=!1},setAggregatorMetadata:(e,t)=>{e.aggregatorMetadata=t.payload},setBalanceError:(e,t)=>{e.balanceError=t.payload},setFetchingQuotes:(e,t)=>{e.fetchingQuotes=t.payload},setFromToken:(e,t)=>{e.fromToken=t.payload},setFromTokenInputValue:(e,t)=>{e.fromTokenInputValue=t.payload},setFromTokenError:(e,t)=>{e.fromTokenError=t.payload},setIsFeatureFlagLoaded:(e,t)=>{e.isFeatureFlagLoaded=t.payload},setMaxSlippage:(e,t)=>{e.maxSlippage=t.payload},setQuotesFetchStartTime:(e,t)=>{e.quotesFetchStartTime=t.payload},setReviewSwapClickedTimestamp:(e,t)=>{e.reviewSwapClickedTimestamp=t.payload},setTopAssets:(e,t)=>{e.topAssets=t.payload},setToToken:(e,t)=>{e.toToken=t.payload},swapCustomGasModalClosed:e=>{e.customGas.price=null,e.customGas.limit=null},swapCustomGasModalPriceEdited:(e,t)=>{e.customGas.price=t.payload},swapCustomGasModalLimitEdited:(e,t)=>{e.customGas.limit=t.payload},swapGasPriceEstimatesFetchStarted:e=>{e.customGas.loading=y.LOADING},swapGasPriceEstimatesFetchFailed:e=>{e.customGas.loading=y.FAILED},swapGasPriceEstimatesFetchCompleted:(e,t)=>{e.customGas.priceEstimates=t.payload.priceEstimates,e.customGas.loading=y.COMPLETED},retrievedFallbackSwapsGasPrice:(e,t)=>{e.customGas.fallBackPrice=t.payload},setCurrentSmartTransactionsError:(e,t)=>{const a=Object.values(u.StxErrorTypes).includes(t.payload)?t.payload:u.StxErrorTypes.UNAVAILABLE;e.currentSmartTransactionsError=a},setSwapsSTXSubmitLoading:(e,t)=>{e.swapsSTXLoading=t.payload||!1}}}),{actions:A,reducer:w}=k;var b=w;a.default=b;a.getAggregatorMetadata=e=>e.swaps.aggregatorMetadata;const N=e=>e.swaps.balanceError;a.getBalanceError=N;const O=e=>e.swaps.fromToken;a.getFromToken=O;a.getFromTokenError=e=>e.swaps.fromTokenError;a.getFromTokenInputValue=e=>e.swaps.fromTokenInputValue;a.getIsFeatureFlagLoaded=e=>e.swaps.isFeatureFlagLoaded;a.getSwapsSTXLoading=e=>e.swaps.swapsSTXLoading;a.getMaxSlippage=e=>e.swaps.maxSlippage;a.getTopAssets=e=>e.swaps.topAssets;const C=e=>e.swaps.toToken;a.getToToken=C;a.getFetchingQuotes=e=>e.swaps.fetchingQuotes;a.getQuotesFetchStartTime=e=>e.swaps.quotesFetchStartTime;a.getReviewSwapClickedTimestamp=e=>e.swaps.reviewSwapClickedTimestamp;const I=e=>e.swaps.customGas.price;a.getSwapsCustomizationModalPrice=I;a.getSwapsCustomizationModalLimit=e=>e.swaps.customGas.limit;a.swapGasPriceEstimateIsLoading=e=>e.swaps.customGas.loading===y.LOADING;a.swapGasEstimateLoadingHasFailed=e=>e.swaps.customGas.loading===y.INITIAL;const P=e=>e.swaps.customGas.priceEstimates;a.getSwapGasPriceEstimateData=P;const R=e=>e.swaps.customGas.fallBackPrice;a.getSwapsFallbackGasPrice=R;const M=e=>e.swaps.currentSmartTransactionsError;a.getCurrentSmartTransactionsError=M;const x=e=>e.metamask.swapsState;a.getSwapsFeatureIsLive=e=>e.metamask.swapsState.swapsFeatureIsLive;a.getSmartTransactionsError=e=>e.appState.smartTransactionsError;a.getSmartTransactionsErrorMessageDismissed=e=>e.appState.smartTransactionsErrorMessageDismissed;const F=e=>{var t,a,n,s;const r=(0,d.isHardwareWallet)(e),o=(0,d.getCurrentChainId)(e),i=p.ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS.includes(o),c=null===(t=e.metamask.swapsState)||void 0===t||null===(a=t.swapsFeatureFlags)||void 0===a||null===(n=a.smartTransactions)||void 0===n?void 0:n.extensionActive,u=null===(s=e.metamask.smartTransactionsState)||void 0===s?void 0:s.liveness;return Boolean(i&&!r&&c&&u)};a.getSmartTransactionsEnabled=F;const D=e=>{const t=F(e),a=M(e);return t&&!a};a.getCurrentSmartTransactionsEnabled=D;a.getSwapsQuoteRefreshTime=e=>e.metamask.swapsState.swapsQuoteRefreshTime;a.getSwapsQuotePrefetchingRefreshTime=e=>e.metamask.swapsState.swapsQuotePrefetchingRefreshTime;a.getBackgroundSwapRouteState=e=>e.metamask.swapsState.routeState;const G=e=>e.metamask.swapsState.customMaxGas;a.getCustomSwapsGas=G;const U=e=>e.metamask.swapsState.customGasPrice;a.getCustomSwapsGasPrice=U;const L=e=>e.metamask.swapsState.customMaxFeePerGas;a.getCustomMaxFeePerGas=L;const j=e=>e.metamask.swapsState.customMaxPriorityFeePerGas;a.getCustomMaxPriorityFeePerGas=j;a.getSwapsUserFeeLevel=e=>e.metamask.swapsState.swapsUserFeeLevel;const $=e=>e.metamask.swapsState.fetchParams;a.getFetchParams=$;const H=e=>e.metamask.swapsState.quotes;a.getQuotes=H;a.getQuotesLastFetched=e=>e.metamask.swapsState.quotesLastFetched;const W=e=>{const{selectedAggId:t,quotes:a}=x(e);return a[t]};a.getSelectedQuote=W;a.getSwapsErrorKey=e=>{var t;return null===(t=x(e))||void 0===t?void 0:t.errorKey};a.getShowQuoteLoadingScreen=e=>e.swaps.showQuoteLoadingScreen;const B=e=>e.metamask.swapsState.tokens;a.getSwapsTokens=B;a.getSwapsWelcomeMessageSeenStatus=e=>e.metamask.swapsWelcomeMessageHasBeenShown;const q=e=>{const{topAggId:t,quotes:a}=x(e);return a[t]};a.getTopQuote=q;a.getApproveTxId=e=>e.metamask.swapsState.approveTxId;a.getTradeTxId=e=>e.metamask.swapsState.tradeTxId;const V=e=>W(e)||q(e);a.getUsedQuote=V;a.getDestinationTokenInfo=e=>{var t,a;return null===(t=$(e))||void 0===t||null===(a=t.metaData)||void 0===a?void 0:a.destinationTokenInfo};const K=e=>U(e)||R(e);a.getUsedSwapsGasPrice=K;const Y=e=>{var t;const{approvalNeeded:a}=W(e)||q(e)||{};if(!a)return null;const n=(null===(t=x(e))||void 0===t?void 0:t.customApproveTxData)||a.data,s=K(e);return{...a,gasPrice:s,data:n}};a.getApproveTxParams=Y;const X=e=>{var t;return null===(t=e.metamask.smartTransactionsState)||void 0===t?void 0:t.userOptIn};a.getSmartTransactionsOptInStatus=X;const Q=e=>{var t,a;return null===(t=e.metamask.smartTransactionsState)||void 0===t||null===(a=t.smartTransactions)||void 0===a?void 0:a[(0,d.getCurrentChainId)(e)]};a.getCurrentSmartTransactions=Q;a.getPendingSmartTransactions=e=>{const t=Q(e);return t&&0!==t.length?t.filter((e=>e.status===f.SmartTransactionStatus.pending)):[]};a.getSmartTransactionFees=e=>{var t;return null===(t=e.metamask.smartTransactionsState)||void 0===t?void 0:t.fees};a.getSmartTransactionEstimatedGas=e=>{var t;return null===(t=e.metamask.smartTransactionsState)||void 0===t?void 0:t.estimatedGas};const z=e=>{const{swapsQuoteRefreshTime:t,swapsQuotePrefetchingRefreshTime:a,swapsStxGetTransactionsRefreshTime:n,swapsStxBatchStatusRefreshTime:s,swapsStxStatusDeadline:r,swapsStxMaxFeeMultiplier:o}=e.metamask.swapsState;return{quoteRefreshTime:t,quotePrefetchingRefreshTime:a,stxGetTransactionsRefreshTime:n,stxBatchStatusRefreshTime:s,stxStatusDeadline:r,stxMaxFeeMultiplier:o}};a.getSwapsNetworkConfig=z;const{clearSwapsState:Z,navigatedBackToBuildQuote:J,retriedGetQuotes:ee,swapGasPriceEstimatesFetchCompleted:te,swapGasPriceEstimatesFetchStarted:ae,swapGasPriceEstimatesFetchFailed:ne,setAggregatorMetadata:se,setBalanceError:re,setFetchingQuotes:oe,setFromToken:ie,setFromTokenError:ce,setFromTokenInputValue:ue,setIsFeatureFlagLoaded:le,setMaxSlippage:de,setQuotesFetchStartTime:me,setReviewSwapClickedTimestamp:pe,setTopAssets:fe,setToToken:ge,swapCustomGasModalPriceEdited:Te,swapCustomGasModalLimitEdited:he,retrievedFallbackSwapsGasPrice:Ee,swapCustomGasModalClosed:ve,setCurrentSmartTransactionsError:_e,setSwapsSTXSubmitLoading:ye}=A;a.swapCustomGasModalClosed=ve,a.swapCustomGasModalLimitEdited=he,a.swapCustomGasModalPriceEdited=Te,a.setSwapToToken=ge,a.setTopAssets=fe,a.setReviewSwapClickedTimestamp=pe,a.setSwapQuotesFetchStartTime=me,a.setMaxSlippage=de,a.setIsFeatureFlagLoaded=le,a.setFromTokenInputValue=ue,a.setFromTokenError=ce,a.setSwapsFromToken=ie,a.setFetchingQuotes=oe,a.setBalanceError=re,a.setAggregatorMetadata=se,a.clearSwapsState=Z;a.navigateBackToBuildQuote=e=>async t=>{await t((0,i.setBackgroundSwapRouteState)("")),t(J()),e.push(c.BUILD_QUOTE_ROUTE)};a.prepareForRetryGetQuotes=()=>async e=>{await e((0,i.resetSwapsPostFetchState)()),e(ee())};a.prepareToLeaveSwaps=()=>async e=>{e(Z()),await e((0,i.resetBackgroundSwapsState)())};a.swapsQuoteSelected=e=>t=>{t(he(null)),t((0,i.setSelectedQuoteAggId)(e)),t((0,i.setSwapsTxGasLimit)(""))};const Se=()=>async e=>{const t=await e(ke());null!=t&&t.fast&&e((0,i.setSwapsTxGasPrice)((0,l.decGWEIToHexWEI)(t.fast)))};a.fetchAndSetSwapsGasPriceInfo=Se;a.fetchSwapsLivenessAndFeatureFlags=()=>async(e,t)=>{let a={swapsFeatureIsLive:!1};const n=t(),s=(0,d.getCurrentChainId)(n);try{const t=await(0,u.fetchSwapsFeatureFlags)();if(await e((0,i.setSwapsFeatureFlags)(t)),p.ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS.includes(s)){var o;await e((0,i.fetchSmartTransactionsLiveness)());((e,t)=>{if(!((null==t?void 0:t.length)<=0))for(const a of t)if(f.IN_PROGRESS_TRANSACTION_STATUSES.includes(a.status)){e(_e(u.StxErrorTypes.REGULAR_TX_IN_PROGRESS));break}})(e,await(0,i.getTransactions)({searchCriteria:{from:null===(o=n.metamask)||void 0===o?void 0:o.selectedAddress}}))}a=(0,u.getSwapsLivenessForNetwork)(s,t)}catch(e){r.default.error("Failed to fetch Swaps feature flags and Swaps liveness, defaulting to false.",e)}return await e((0,i.setSwapsLiveness)(a)),e(le(!0)),a};a.fetchQuotesAndSetQuoteState=(e,t,a,n,o)=>async(l,f)=>{var T,E,v,_;const y=f(),S=(0,d.getCurrentChainId)(y);let k={swapsFeatureIsLive:!1};try{const e=await(0,u.fetchSwapsFeatureFlags)();k=(0,u.getSwapsLivenessForNetwork)(S,e)}catch(e){r.default.error("Failed to fetch Swaps liveness, defaulting to false.",e)}if(await l((0,i.setSwapsLiveness)(k)),!k.swapsFeatureIsLive)return void await e.push(c.SWAPS_MAINTENANCE_ROUTE);const A=$(y),w=(0,d.getSelectedAccount)(y),b=N(y),I=(0,d.getSwapsDefaultToken)(y),P=(null==A||null===(T=A.metaData)||void 0===T||null===(E=T.sourceTokenInfo)||void 0===E?void 0:E.symbol)===I.symbol?I:null==A||null===(v=A.metaData)||void 0===v?void 0:v.sourceTokenInfo,R=O(y)||P||{},M=C(y)||(null==A||null===(_=A.metaData)||void 0===_?void 0:_.destinationTokenInfo)||{},{address:x,symbol:G,decimals:U,iconUrl:L,balance:j}=R,{address:H,symbol:W,decimals:q,iconUrl:V}=M;o||(await l((0,i.setBackgroundSwapRouteState)("loading")),e.push(c.LOADING_QUOTES_ROUTE)),l(oe(!0));const K=(0,d.getTokenExchangeRates)(y);let Y=!1;var Q,z;!H||W===I.symbol||K[H]!==undefined||(Q=H,z=(0,g.getTokens)(y),Array.isArray(z)&&z.find((e=>e.address.toLowerCase()===Q.toLowerCase())))||(Y=!0,await l((0,i.addToken)(H,W,q,V,!0))),x&&G!==I.symbol&&!K[x]&&j&&new s.default(j,16).gt(0)&&l((0,i.addToken)(x,G,U,L,!0));const Z=B(y),J=(null==Z?void 0:Z.find((({address:e})=>e===x)))||R,ee=(null==Z?void 0:Z.find((({address:e})=>e===H)))||M;l(ie(R));const te=(0,d.isHardwareWallet)(y),ae=(0,d.getHardwareWalletType)(y),ne=(0,d.checkNetworkAndAccountSupports1559)(y),se=X(y),re=F(y),ce=D(y);n({event:"Quotes Requested",category:m.MetaMetricsEventCategory.Swaps,sensitiveProperties:{token_from:G,token_from_amount:String(t),token_to:W,request_type:b?"Quote":"Order",slippage:a,custom_slippage:a!==p.Slippage.default,is_hardware_wallet:te,hardware_wallet_type:ae,stx_enabled:re,current_stx_enabled:ce,stx_user_opt_in:se,anonymizedData:!0}});try{var ue;const e=Date.now();l(me(e));const s=l((0,i.fetchAndSetQuotes)({slippage:a,sourceToken:x,destinationToken:H,value:t,fromAddress:w.address,destinationTokenAddedForSwap:Y,balanceError:b,sourceDecimals:U},{sourceTokenInfo:J,destinationTokenInfo:ee,accountBalance:w.balance,chainId:S})),r=ne?null:l(Se()),[[o,c]]=await Promise.all([s,r]);if(0===(null===(ue=Object.values(o))||void 0===ue?void 0:ue.length))n({event:"No Quotes Available",category:m.MetaMetricsEventCategory.Swaps,sensitiveProperties:{token_from:G,token_from_amount:String(t),token_to:W,request_type:b?"Quote":"Order",slippage:a,custom_slippage:a!==p.Slippage.default,is_hardware_wallet:te,hardware_wallet_type:ae,stx_enabled:re,current_stx_enabled:ce,stx_user_opt_in:se}}),l((0,i.setSwapsErrorKey)(p.QUOTES_NOT_AVAILABLE_ERROR));else{var le;const s=o[c];n({event:"Quotes Received",category:m.MetaMetricsEventCategory.Swaps,sensitiveProperties:{token_from:G,token_from_amount:String(t),token_to:W,token_to_amount:(0,h.calcTokenAmount)(s.destinationAmount,s.decimals||18),request_type:b?"Quote":"Order",slippage:a,custom_slippage:a!==p.Slippage.default,response_time:Date.now()-e,best_quote_source:s.aggregator,available_quotes:null===(le=Object.values(o))||void 0===le?void 0:le.length,is_hardware_wallet:te,hardware_wallet_type:ae,stx_enabled:re,current_stx_enabled:ce,stx_user_opt_in:se,anonymizedData:!0}}),l((0,i.setInitialGasEstimate)(c))}}catch(e){if(e.message===p.SWAPS_FETCH_ORDER_CONFLICT)return void r.default.debug("Swap fetch order conflict detected; ignoring older request");r.default.error("Error fetching quotes: ",e),l((0,i.setSwapsErrorKey)(p.ERROR_FETCHING_QUOTES))}l(oe(!1))};a.signAndSendSwapsSmartTransaction=({unsignedTransaction:e,trackEvent:t,history:a,additionalTrackingParams:n})=>async(s,g)=>{var E,v,_,y,S,k,A,w;s(ye(!0));const b=g(),N=$(b),{metaData:O,value:C,slippage:I}=N,{sourceTokenInfo:P={},destinationTokenInfo:R={}}=O,M=V(b),x=z(b),G=(0,d.getCurrentChainId)(b);s((0,i.setSmartTransactionsRefreshInterval)(null==x?void 0:x.stxBatchStatusRefreshTime));const U=M.trade,L=(0,h.calcTokenAmount)(M.destinationAmount,R.decimals||18).toPrecision(8),j=X(b),W=F(b),B=D(b),K={token_from:P.symbol,token_from_amount:String(C),token_to:R.symbol,token_to_amount:L,slippage:I,custom_slippage:2!==I,best_quote_source:null===(E=q(b))||void 0===E?void 0:E.aggregator,available_quotes:null===(v=H(b))||void 0===v?void 0:v.length,other_quote_selected:M.aggregator!==(null===(_=q(b))||void 0===_?void 0:_.aggregator),other_quote_selected_source:M.aggregator===(null===(y=q(b))||void 0===y?void 0:y.aggregator)?"":M.aggregator,average_savings:null===(S=M.savings)||void 0===S?void 0:S.total,performance_savings:null===(k=M.savings)||void 0===k?void 0:k.performance,fee_savings:null===(A=M.savings)||void 0===A?void 0:A.fee,median_metamask_fee:null===(w=M.savings)||void 0===w?void 0:w.medianMetaMaskFee,stx_enabled:W,current_stx_enabled:B,stx_user_opt_in:j,...n};if(t({event:"STX Swap Started",category:m.MetaMetricsEventCategory.Swaps,sensitiveProperties:K}),!(0,u.isContractAddressValid)(U.to,G))return(0,o.captureMessage)("Invalid contract address",{extra:{token_from:K.token_from,token_to:K.token_to,contract_address:U.to}}),await s((0,i.setSwapsErrorKey)(p.SWAP_FAILED_ERROR)),void a.push(c.SWAPS_ERROR_ROUTE);const Q=Y(b);let Z,J;try{var ee;Q&&(J={...Q,value:"0x0"});const t=await s(Ae({unsignedTransaction:e,approveTxParams:J,fallbackOnNotEnoughFunds:!0}));if(!t)return r.default.error('"fetchSwapsSmartTransactionFees" failed'),s(ye(!1)),void s(_e(u.StxErrorTypes.UNAVAILABLE));var te;if(Q)J.gas=`0x${(0,l.decimalToHex)((null===(te=t.approvalTxFees)||void 0===te?void 0:te.gasLimit)||0)}`,Z=await s((0,i.signAndSendSmartTransaction)({unsignedTransaction:J,smartTransactionFees:t.approvalTxFees}));e.gas=`0x${(0,l.decimalToHex)((null===(ee=t.tradeTxFees)||void 0===ee?void 0:ee.gasLimit)||0)}`;const n=await s((0,i.signAndSendSmartTransaction)({unsignedTransaction:e,smartTransactionFees:t.tradeTxFees})),o=R.address,d=R.decimals,m=R.symbol,p=P.symbol;await s((0,i.updateSmartTransaction)(n,{origin:T.ORIGIN_METAMASK,destinationTokenAddress:o,destinationTokenDecimals:d,destinationTokenSymbol:m,sourceTokenSymbol:p,swapMetaData:K,swapTokenValue:C,type:f.TransactionType.swap})),Z&&await s((0,i.updateSmartTransaction)(Z,{origin:T.ORIGIN_METAMASK,type:f.TransactionType.swapApproval,sourceTokenSymbol:p})),a.push(c.SMART_TRANSACTION_STATUS_ROUTE),s(ye(!1))}catch(e){console.log("signAndSendSwapsSmartTransaction error",e);const{swaps:{isFeatureFlagLoaded:t}}=g();if(e.message.startsWith("Fetch error:")&&t){const t=(0,u.parseSmartTransactionsError)(e.message);s(_e(null==t?void 0:t.error))}}};function ke(){return async(e,t)=>{const a=t(),n=(0,d.getCurrentChainId)(a);let s;e(ae());try{s=await(0,u.fetchSwapsGasPrices)(n)}catch(t){var o;if(r.default.warn("Fetching swaps gas prices failed:",t),null===(o=t.message)||void 0===o||!o.match(/NetworkError|Fetch failed with status:/u))throw t;e(ne());try{const t=await global.ethQuery.gasPrice(),a=(0,l.hexWEIToDecGWEI)(t.toString(10));return e(Ee(a)),null}catch(e){return console.error("Failed to retrieve fallback gas price: ",e),null}}return e(te({priceEstimates:s})),s}}function Ae({unsignedTransaction:e,approveTxParams:t,fallbackOnNotEnoughFunds:a=!1}){return async(n,s)=>{const{swaps:{isFeatureFlagLoaded:r}}=s();try{return await n((0,i.fetchSmartTransactionFees)(e,t))}catch(e){if(e.message.startsWith("Fetch error:")&&r){const t=(0,u.parseSmartTransactionsError)(e.message);(a||(null==t?void 0:t.error)!==u.StxErrorTypes.NOT_ENOUGH_FUNDS)&&n(_e(null==t?void 0:t.error))}}return null}}a.signAndSendTransactions=(e,t,a)=>async(n,T)=>{var E,v,_,y,S,k,A,w,b,N;const O=T(),C=(0,d.getCurrentChainId)(O),I=(0,d.isHardwareWallet)(O),R=(0,d.checkNetworkAndAccountSupports1559)(O);let M={swapsFeatureIsLive:!1};try{const e=await(0,u.fetchSwapsFeatureFlags)();M=(0,u.getSwapsLivenessForNetwork)(C,e)}catch(e){r.default.error("Failed to fetch Swaps liveness, defaulting to false.",e)}if(await n((0,i.setSwapsLiveness)(M)),!M.swapsFeatureIsLive)return void await e.push(c.SWAPS_MAINTENANCE_ROUTE);const x=G(O),U=L(O),W=j(O),B=$(O),{metaData:Q,value:z,slippage:Z}=B,{sourceTokenInfo:J={},destinationTokenInfo:ee={}}=Q;await n((0,i.setBackgroundSwapRouteState)("awaiting")),await n((0,i.stopPollingForQuotes)()),I||e.push(c.AWAITING_SWAP_ROUTE);const{fast:te}=P(O);let ae,ne,se,re;if(R){const{high:{suggestedMaxFeePerGas:e,suggestedMaxPriorityFeePerGas:t},estimatedBaseFee:a="0"}=(0,g.getGasFeeEstimates)(O);re=(0,l.decGWEIToHexWEI)(a),ae=U||(0,l.decGWEIToHexWEI)(e),ne=W||(0,l.decGWEIToHexWEI)(t),se=(0,l.addHexes)(re,ne)}const oe=V(O),ie=oe.trade,ce=new s.default((null==oe?void 0:oe.gasEstimate)||"0x0",16),ue=ce.times((null==oe?void 0:oe.gasMultiplier)||1.5,10).round(0).toString(16),le=x||(null!=oe&&oe.gasEstimate?ue:`0x${(0,l.decimalToHex)((null==oe?void 0:oe.maxGas)||0)}`),de=K(O);ie.gas=le,R?(ie.maxFeePerGas=ae,ie.maxPriorityFeePerGas=ne,delete ie.gasPrice):ie.gasPrice=de;const me=(0,d.getUSDConversionRate)(O),pe=(0,h.calcTokenAmount)(oe.destinationAmount,ee.decimals||18).toPrecision(8),fe=(null==oe?void 0:oe.gasEstimateWithRefund)||`0x${(0,l.decimalToHex)((null==oe?void 0:oe.averageGas)||0)}`,ge=new s.default(fe,16).plus((null===(E=oe.approvalNeeded)||void 0===E?void 0:E.gas)||"0x0",16).toString(16),Te=(0,l.getValueFromWeiHex)({value:(0,h.calcGasTotal)(ge,R?se:de),toCurrency:"usd",conversionRate:me,numberOfDecimals:6}),he=X(O),Ee=F(O),ve=D(O),_e={token_from:J.symbol,token_from_amount:String(z),token_to:ee.symbol,token_to_amount:pe,slippage:Z,custom_slippage:2!==Z,best_quote_source:null===(v=q(O))||void 0===v?void 0:v.aggregator,available_quotes:null===(_=H(O))||void 0===_?void 0:_.length,other_quote_selected:oe.aggregator!==(null===(y=q(O))||void 0===y?void 0:y.aggregator),other_quote_selected_source:oe.aggregator===(null===(S=q(O))||void 0===S?void 0:S.aggregator)?"":oe.aggregator,gas_fees:Te,estimated_gas:ce.toString(10),suggested_gas_price:te,used_gas_price:(0,l.hexWEIToDecGWEI)(de),average_savings:null===(k=oe.savings)||void 0===k?void 0:k.total,performance_savings:null===(A=oe.savings)||void 0===A?void 0:A.performance,fee_savings:null===(w=oe.savings)||void 0===w?void 0:w.fee,median_metamask_fee:null===(b=oe.savings)||void 0===b?void 0:b.medianMetaMaskFee,is_hardware_wallet:I,hardware_wallet_type:(0,d.getHardwareWalletType)(O),stx_enabled:Ee,current_stx_enabled:ve,stx_user_opt_in:he,...a};if(R&&(_e.max_fee_per_gas=ae,_e.max_priority_fee_per_gas=ne,_e.base_and_priority_fee_per_gas=se),t({event:"Swap Started",category:m.MetaMetricsEventCategory.Swaps,sensitiveProperties:_e}),!(0,u.isContractAddressValid)(ie.to,C))return(0,o.captureMessage)("Invalid contract address",{extra:{token_from:_e.token_from,token_to:_e.token_to,contract_address:ie.to}}),await n((0,i.setSwapsErrorKey)(p.SWAP_FAILED_ERROR)),void e.push(c.SWAPS_ERROR_ROUTE);let ye;const Se=Y(O);if(I&&e.push(c.AWAITING_SIGNATURES_ROUTE),Se){R&&(Se.maxFeePerGas=ae,Se.maxPriorityFeePerGas=ne,delete Se.gasPrice);const t=await(0,i.addUnapprovedTransaction)(undefined,{...Se,amount:"0x0"},f.TransactionType.swapApproval);await n((0,i.setApproveTxId)(t.id)),ye=await n((0,i.updateSwapApprovalTransaction)(t.id,{type:f.TransactionType.swapApproval,sourceTokenSymbol:J.symbol}));try{await n((0,i.updateAndApproveTx)(ye,!0))}catch(t){return await n((0,i.setSwapsErrorKey)(p.SWAP_FAILED_ERROR)),void e.push(c.SWAPS_ERROR_ROUTE)}}const ke=await(0,i.addUnapprovedTransaction)(undefined,ie,f.TransactionType.swap);if(n((0,i.setTradeTxId)(ke.id)),!Se&&ke.simulationFails)return await n((0,i.cancelTx)(ke,!1)),await n((0,i.setSwapsErrorKey)(p.SWAP_FAILED_ERROR)),void e.push(c.SWAPS_ERROR_ROUTE);const Ae=await n((0,i.updateSwapTransaction)(ke.id,{estimatedBaseFee:re,sourceTokenSymbol:J.symbol,destinationTokenSymbol:ee.symbol,type:f.TransactionType.swap,destinationTokenDecimals:ee.decimals,destinationTokenAddress:ee.address,swapMetaData:_e,swapTokenValue:z,approvalTxId:null===(N=ye)||void 0===N?void 0:N.id}));try{await n((0,i.updateAndApproveTx)(Ae,!0))}catch(t){const a=t.message.includes("EthAppPleaseEnableContractData")?p.CONTRACT_DATA_DISABLED_ERROR:p.SWAP_FAILED_ERROR;return await n((0,i.setSwapsErrorKey)(a)),void e.push(c.SWAPS_ERROR_ROUTE)}I&&e.push(c.AWAITING_SWAP_ROUTE),await(0,i.forceUpdateMetamaskState)(n)}}}},{package:"$root$",file:"ui/ducks/swaps/swaps.js"}],[4067,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){t.exports=[{code:"aud",name:"Australian Dollar"},{code:"hkd",name:"Hong Kong Dollar"},{code:"sgd",name:"Singapore Dollar"},{code:"idr",name:"Indonesian Rupiah"},{code:"inr",name:"Indian Rupee"},{code:"nzd",name:"New Zealand Dollar"},{code:"php",name:"Philippine Peso"},{code:"1st",name:"FirstBlood"},{code:"adt",name:"adToken"},{code:"adx",name:"AdEx"},{code:"ant",name:"Aragon"},{code:"bat",name:"Basic Attention Token"},{code:"bnt",name:"Bancor"},{code:"btc",name:"Bitcoin"},{code:"cad",name:"Canadian Dollar"},{code:"cfi",name:"Cofound.it"},{code:"crb",name:"CreditBit"},{code:"cvc",name:"Civic"},{code:"dash",name:"Dash"},{code:"dgd",name:"DigixDAO"},{code:"etc",name:"Ethereum Classic"},{code:"eur",name:"Euro"},{code:"fun",name:"FunFair"},{code:"gbp",name:"Pound Sterling"},{code:"gno",name:"Gnosis"},{code:"gnt",name:"Golem"},{code:"gup",name:"Matchpool"},{code:"hmq",name:"Humaniq"},{code:"jpy",name:"Japanese Yen"},{code:"lgd",name:"Legends Room"},{code:"lsk",name:"Lisk"},{code:"ltc",name:"Litecoin"},{code:"lun",name:"Lunyr"},{code:"mco",name:"Monaco"},{code:"mtl",name:"Metal"},{code:"myst",name:"Mysterium"},{code:"nmr",name:"Numeraire"},{code:"omg",name:"OmiseGO"},{code:"pay",name:"TenX"},{code:"ptoy",name:"Patientory"},{code:"qrl",name:"Quantum-Resistant Ledger"},{code:"qtum",name:"Qtum"},{code:"rep",name:"Augur"},{code:"rlc",name:"iEx.ec"},{code:"rub",name:"Russian Ruble"},{code:"sc",name:"Siacoin"},{code:"sngls",name:"SingularDTV"},{code:"snt",name:"Status"},{code:"steem",name:"Steem"},{code:"storj",name:"Storj"},{code:"time",name:"ChronoBank"},{code:"tkn",name:"TokenCard"},{code:"trst",name:"WeTrust"},{code:"uah",name:"Ukrainian Hryvnia"},{code:"usd",name:"United States Dollar"},{code:"wings",name:"Wings"},{code:"xem",name:"NEM"},{code:"xlm",name:"Stellar Lumen"},{code:"xmr",name:"Monero"},{code:"xrp",name:"Ripple"},{code:"zec",name:"Zcash"},{code:"dai",name:"DAI"},{code:"sai",name:"SAI"}]}}},{package:"$root$",file:"ui/helpers/constants/available-conversions.json"}],[4069,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.STATUS_NOT_CONNECTED=a.STATUS_CONNECTED_TO_ANOTHER_ACCOUNT=a.STATUS_CONNECTED=void 0;a.STATUS_CONNECTED="STATUS_CONNECTED";a.STATUS_CONNECTED_TO_ANOTHER_ACCOUNT="STATUS_CONNECTED_TO_ANOTHER_ACCOUNT";a.STATUS_NOT_CONNECTED="STATUS_NOT_CONNECTED"}}},{package:"$root$",file:"ui/helpers/constants/connected-sites.js"}],[4070,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){let n,s,r,o,i,c,u,l,d,m,p,f;Object.defineProperty(a,"__esModule",{value:!0}),a.TypographyVariant=a.TextVariant=a.TextColor=a.TEXT_TRANSFORM=a.TEXT_ALIGN=a.Size=a.SEVERITIES=a.RESIZE=a.OVERFLOW_WRAP=a.JustifyContent=a.IconColor=a.FRACTIONS=a.FONT_WEIGHT=a.FONT_STYLE=a.FLEX_WRAP=a.FLEX_DIRECTION=a.DISPLAY=a.Color=a.BorderStyle=a.BorderRadius=a.BorderColor=a.BackgroundColor=a.BREAKPOINTS=a.BLOCK_SIZES=a.AlignItems=void 0,a.Color=n,function(e){e.backgroundDefault="background-default",e.backgroundAlternative="background-alternative",e.textDefault="text-default",e.textAlternative="text-alternative",e.textMuted="text-muted",e.iconDefault="icon-default",e.iconAlternative="icon-alternative",e.iconMuted="icon-muted",e.borderDefault="border-default",e.borderMuted="border-muted",e.overlayDefault="overlay-default",e.overlayInverse="overlay-inverse",e.primaryDefault="primary-default",e.primaryAlternative="primary-alternative",e.primaryMuted="primary-muted",e.primaryInverse="primary-inverse",e.primaryDisabled="primary-disabled",e.errorDefault="error-default",e.errorAlternative="error-alternative",e.errorMuted="error-muted",e.errorInverse="error-inverse",e.errorDisabled="error-disabled",e.warningDefault="warning-default",e.warningAlternative="warning-alternative",e.warningMuted="warning-muted",e.warningInverse="warning-inverse",e.warningDisabled="warning-disabled",e.successDefault="success-default",e.successAlternative="success-alternative",e.successMuted="success-muted",e.successInverse="success-inverse",e.successDisabled="success-disabled",e.infoDefault="info-default",e.infoAlternative="info-alternative",e.infoMuted="info-muted",e.infoInverse="info-inverse",e.infoDisabled="info-disabled",e.mainnet="mainnet",e.goerli="goerli",e.sepolia="sepolia",e.lineaTestnet="lineatestnet",e.lineaTestnetInverse="lineatestnet-inverse",e.transparent="transparent",e.localhost="localhost",e.inherit="inherit",e.goerliInverse="goerli-inverse",e.sepoliaInverse="sepolia-inverse"}(n||(a.Color=n={})),a.BackgroundColor=s,function(e){e.backgroundDefault="background-default",e.backgroundAlternative="background-alternative",e.overlayDefault="overlay-default",e.primaryDefault="primary-default",e.primaryAlternative="primary-alternative",e.primaryMuted="primary-muted",e.errorDefault="error-default",e.errorAlternative="error-Alternative",e.errorMuted="error-muted",e.warningDefault="warning-default",e.warningAlternative="warning-alternative",e.warningMuted="warning-muted",e.successDefault="success-default",e.successAlternative="success-alternative",e.successMuted="success-muted",e.infoDefault="info-default",e.infoAlternative="info-alternative",e.infoMuted="info-muted",e.mainnet="mainnet",e.goerli="goerli",e.sepolia="sepolia",e.lineaTestnet="lineatestnet",e.transparent="transparent",e.localhost="localhost"}(s||(a.BackgroundColor=s={})),a.BorderColor=r,function(e){e.borderDefault="border-default",e.borderMuted="border-muted",e.primaryDefault="primary-default",e.primaryAlternative="primary-alternative",e.primaryMuted="primary-muted",e.errorDefault="error-default",e.errorAlternative="error-alternative",e.errorMuted="error-muted",e.warningDefault="warning-default",e.warningAlternative="warning-alternative",e.warningMuted="warning-muted",e.successDefault="success-default",e.successAlternative="success-alternative",e.successMuted="success-muted",e.infoDefault="info-default",e.infoAlternative="info-alternative",e.infoMuted="info-muted",e.mainnet="mainnet",e.goerli="goerli",e.sepolia="sepolia",e.lineaTestnet="lineatestnet",e.transparent="transparent",e.localhost="localhost"}(r||(a.BorderColor=r={})),a.TextColor=o,function(e){e.textDefault="text-default",e.textAlternative="text-alternative",e.textMuted="text-muted",e.overlayInverse="overlay-inverse",e.primaryDefault="primary-default",e.primaryInverse="primary-inverse",e.errorDefault="error-default",e.errorInverse="error-inverse",e.successDefault="success-default",e.successInverse="success-inverse",e.warningDefault="warning-default",e.warningInverse="warning-inverse",e.infoDefault="info-default",e.infoInverse="info-inverse",e.inherit="inherit",e.goerli="goerli",e.sepolia="sepolia",e.lineaTestnet="lineatestnet",e.lineaTestnetInverse="lineatestnet-inverse",e.goerliInverse="goerli-inverse",e.sepoliaInverse="sepolia-inverse",e.transparent="transparent"}(o||(a.TextColor=o={})),a.IconColor=i,function(e){e.iconDefault="icon-default",e.iconAlternative="icon-alternative",e.iconMuted="icon-muted",e.overlayInverse="overlay-inverse",e.primaryDefault="primary-default",e.primaryInverse="primary-inverse",e.errorDefault="error-default",e.errorInverse="error-inverse",e.successDefault="success-default",e.successInverse="success-inverse",e.warningDefault="warning-default",e.warningInverse="warning-inverse",e.infoDefault="info-default",e.infoInverse="info-inverse",e.inherit="inherit",e.goerli="goerli",e.sepolia="sepolia",e.lineaTestnet="lineatestnet",e.lineaTestnetInverse="lineatestnet-inverse",e.goerliInverse="goerli-inverse",e.sepoliaInverse="sepolia-inverse"}(i||(a.IconColor=i={})),a.TypographyVariant=c,function(e){e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.H7="h7",e.H8="h8",e.H9="h9",e.paragraph="p",e.span="span"}(c||(a.TypographyVariant=c={})),a.TextVariant=u,function(e){e.displayMd="display-md",e.headingLg="heading-lg",e.headingMd="heading-md",e.headingSm="heading-sm",e.bodyLgMedium="body-lg-medium",e.bodyMd="body-md",e.bodyMdBold="body-md-bold",e.bodySm="body-sm",e.bodySmBold="body-sm-bold",e.bodyXs="body-xs",e.inherit="inherit"}(u||(a.TextVariant=u={})),a.Size=l,function(e){e.XXS="xxs",e.XS="xs",e.SM="sm",e.MD="md",e.LG="lg",e.XL="xl",e.inherit="inherit",e.auto="auto",e.none="none"}(l||(a.Size=l={})),a.BorderStyle=d,function(e){e.dashed="dashed",e.solid="solid",e.dotted="dotted",e.double="double",e.none="none"}(d||(a.BorderStyle=d={})),a.BorderRadius=m,function(e){e.XS="xs",e.SM="sm",e.MD="md",e.LG="lg",e.XL="xl",e.none="none",e.pill="pill",e.full="full"}(m||(a.BorderRadius=m={})),a.AlignItems=p,function(e){e.flexStart="flex-start",e.flexEnd="flex-end",e.center="center",e.baseline="baseline",e.stretch="stretch"}(p||(a.AlignItems=p={})),a.JustifyContent=f,function(e){e.flexStart="flex-start",e.flexEnd="flex-end",e.center="center",e.spaceAround="space-around",e.spaceBetween="space-between",e.spaceEvenly="space-evenly"}(f||(a.JustifyContent=f={}));a.FLEX_DIRECTION={ROW:"row",ROW_REVERSE:"row-reverse",COLUMN:"column",COLUMN_REVERSE:"column-reverse"};a.FLEX_WRAP={WRAP:"wrap",WRAP_REVERSE:"wrap-reverse",NO_WRAP:"nowrap"};a.DISPLAY={BLOCK:"block",FLEX:"flex",GRID:"grid",INLINE_BLOCK:"inline-block",INLINE:"inline",INLINE_FLEX:"inline-flex",INLINE_GRID:"inline-grid",LIST_ITEM:"list-item",NONE:"none"};const g={HALF:"1/2",ONE_THIRD:"1/3",TWO_THIRDS:"2/3",ONE_FOURTH:"1/4",TWO_FOURTHS:"2/4",THREE_FOURTHS:"3/4",ONE_FIFTH:"1/5",TWO_FIFTHS:"2/5",THREE_FIFTHS:"3/5",FOUR_FIFTHS:"4/5",ONE_SIXTH:"1/6",TWO_SIXTHS:"2/6",THREE_SIXTHS:"3/6",FOUR_SIXTHS:"4/6",FIVE_SIXTHS:"5/6",ONE_TWELFTH:"1/12",TWO_TWELFTHS:"2/12",THREE_TWELFTHS:"3/12",FOUR_TWELFTHS:"4/12",FIVE_TWELFTHS:"5/12",SIX_TWELFTHS:"6/12",SEVEN_TWELFTHS:"7/12",EIGHT_TWELFTHS:"8/12",NINE_TWELFTHS:"9/12",TEN_TWELFTHS:"10/12",ELEVEN_TWELFTHS:"11/12"};a.FRACTIONS=g;const T={...g,SCREEN:"screen",MAX:"max",MIN:"min",FULL:"full"};a.BLOCK_SIZES=T;a.TEXT_ALIGN={LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",END:"end",START:"start"};a.TEXT_TRANSFORM={UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"};a.FONT_WEIGHT={BOLD:"bold",MEDIUM:"medium",NORMAL:"normal"};a.OVERFLOW_WRAP={BREAK_WORD:"break-word",ANYWHERE:"anywhere",NORMAL:"normal"};a.FONT_STYLE={ITALIC:"italic",NORMAL:"normal"};a.SEVERITIES={DANGER:"danger",WARNING:"warning",INFO:"info",SUCCESS:"success"};a.RESIZE={NONE:"none",BOTH:"both",HORIZONTAL:"horizontal",VERTICAL:"vertical",INITIAL:"initial",INHERIT:"inherit"};a.BREAKPOINTS=["base","sm","md","lg"]}}},{package:"$root$",file:"ui/helpers/constants/design-system.ts"}],[4071,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.UNSENDABLE_ASSET_ERROR_KEY=a.TRANSACTION_ERROR_KEY=a.INVALID_ASSET_TYPE=a.INSUFFICIENT_FUNDS_FOR_GAS_ERROR_KEY=a.INSUFFICIENT_FUNDS_ERROR_KEY=a.GAS_PRICE_FETCH_FAILURE_ERROR_KEY=a.GAS_PRICE_EXCESSIVE_ERROR_KEY=a.GAS_LIMIT_TOO_LOW_ERROR_KEY=a.ETH_GAS_PRICE_FETCH_WARNING_KEY=void 0;a.INSUFFICIENT_FUNDS_ERROR_KEY="insufficientFunds";a.GAS_LIMIT_TOO_LOW_ERROR_KEY="gasLimitTooLow";a.TRANSACTION_ERROR_KEY="transactionError";a.ETH_GAS_PRICE_FETCH_WARNING_KEY="ethGasPriceFetchWarning";a.GAS_PRICE_FETCH_FAILURE_ERROR_KEY="gasPriceFetchFailed";a.GAS_PRICE_EXCESSIVE_ERROR_KEY="gasPriceExcessive";a.UNSENDABLE_ASSET_ERROR_KEY="unsendableAsset";a.INSUFFICIENT_FUNDS_FOR_GAS_ERROR_KEY="insufficientFundsForGas";a.INVALID_ASSET_TYPE="invalidAssetType"}}},{package:"$root$",file:"ui/helpers/constants/error-keys.js"}],[4072,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.PRIORITY_LEVEL_ICON_MAP=a.GAS_FORM_ERRORS=void 0,a.getGasFormErrorText=function(e,t,{minimumGasLimit:a}={}){switch(e){case n.GAS_LIMIT_OUT_OF_BOUNDS:return t("editGasLimitOutOfBounds",[a]);case n.MAX_PRIORITY_FEE_TOO_LOW:return t("editGasMaxPriorityFeeLow");case n.MAX_FEE_TOO_LOW:return t("editGasMaxFeeLow");case n.MAX_PRIORITY_FEE_BELOW_MINIMUM:return t("editGasMaxPriorityFeeBelowMinimum");case n.MAX_PRIORITY_FEE_HIGH_WARNING:return t("editGasMaxPriorityFeeHigh");case n.MAX_FEE_HIGH_WARNING:return t("editGasMaxFeeHigh");case n.MAX_FEE_IMBALANCE:return t("editGasMaxFeePriorityImbalance");case n.GAS_PRICE_TOO_LOW:return t("editGasPriceTooLow");default:return""}};const n={GAS_LIMIT_OUT_OF_BOUNDS:"editGasLimitOutOfBounds",MAX_PRIORITY_FEE_TOO_LOW:"editGasMaxPriorityFeeLow",MAX_FEE_TOO_LOW:"editGasMaxFeeLow",MAX_PRIORITY_FEE_BELOW_MINIMUM:"editGasMaxPriorityFeeBelowMinimum",MAX_PRIORITY_FEE_HIGH_WARNING:"editGasMaxPriorityFeeHigh",MAX_FEE_HIGH_WARNING:"editGasMaxFeeHigh",MAX_FEE_IMBALANCE:"editGasMaxFeeImbalance",GAS_PRICE_TOO_LOW:"editGasPriceTooLow"};a.GAS_FORM_ERRORS=n;a.PRIORITY_LEVEL_ICON_MAP={low:"🐢",medium:"🦊",high:"🦍",dappSuggested:"🌐",swapSuggested:"🔄",custom:"⚙️"}}}},{package:"$root$",file:"ui/helpers/constants/gas.js"}],[4073,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.FIRST_TIME_FLOW_TYPES=void 0;a.FIRST_TIME_FLOW_TYPES={IMPORT:"import",CREATE:"create"}}}},{package:"$root$",file:"ui/helpers/constants/onboarding.js"}],[4074,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.VIEW_QUOTE_ROUTE=a.UNLOCK_ROUTE=a.TOKEN_DETAILS=a.SWAPS_ROUTE=a.SWAPS_MAINTENANCE_ROUTE=a.SWAPS_ERROR_ROUTE=a.SNAPS_VIEW_ROUTE=a.SNAPS_LIST_ROUTE=a.SMART_TRANSACTION_STATUS_ROUTE=a.SIGNATURE_REQUEST_PATH=a.SETTINGS_ROUTE=a.SEND_ROUTE=a.SECURITY_ROUTE=a.REVEAL_SEED_ROUTE=a.RESTORE_VAULT_ROUTE=a.PATH_NAME_MAP=a.ONBOARDING_WELCOME_ROUTE=a.ONBOARDING_UNLOCK_ROUTE=a.ONBOARDING_SECURE_YOUR_WALLET_ROUTE=a.ONBOARDING_ROUTE=a.ONBOARDING_REVIEW_SRP_ROUTE=a.ONBOARDING_PRIVACY_SETTINGS_ROUTE=a.ONBOARDING_PIN_EXTENSION_ROUTE=a.ONBOARDING_METAMETRICS=a.ONBOARDING_IMPORT_WITH_SRP_ROUTE=a.ONBOARDING_HELP_US_IMPROVE_ROUTE=a.ONBOARDING_CREATE_PASSWORD_ROUTE=a.ONBOARDING_CONFIRM_SRP_ROUTE=a.ONBOARDING_COMPLETION_ROUTE=a.NEW_ACCOUNT_ROUTE=a.NETWORKS_ROUTE=a.NETWORKS_FORM_ROUTE=a.LOCK_ROUTE=a.LOADING_QUOTES_ROUTE=a.IMPORT_TOKEN_ROUTE=a.IMPORT_ACCOUNT_ROUTE=a.GENERAL_ROUTE=a.EXPERIMENTAL_ROUTE=a.ENCRYPTION_PUBLIC_KEY_REQUEST_PATH=a.DEFAULT_ROUTE=a.DECRYPT_MESSAGE_REQUEST_PATH=a.CONTACT_VIEW_ROUTE=a.CONTACT_LIST_ROUTE=a.CONTACT_EDIT_ROUTE=a.CONTACT_ADD_ROUTE=a.CONNECT_ROUTE=a.CONNECT_HARDWARE_ROUTE=a.CONNECT_CONFIRM_PERMISSIONS_ROUTE=a.CONNECTED_ROUTE=a.CONNECTED_ACCOUNTS_ROUTE=a.CONFIRM_TRANSFER_FROM_PATH=a.CONFIRM_TRANSACTION_ROUTE=a.CONFIRM_TOKEN_METHOD_PATH=a.CONFIRM_SET_APPROVAL_FOR_ALL_PATH=a.CONFIRM_SEND_TOKEN_PATH=a.CONFIRM_SEND_ETHER_PATH=a.CONFIRM_SAFE_TRANSFER_FROM_PATH=a.CONFIRM_IMPORT_TOKEN_ROUTE=a.CONFIRM_DEPLOY_CONTRACT_PATH=a.CONFIRM_APPROVE_PATH=a.CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE=a.CONFIRMATION_V_NEXT_ROUTE=a.BUILD_QUOTE_ROUTE=a.AWAITING_SWAP_ROUTE=a.AWAITING_SIGNATURES_ROUTE=a.ASSET_ROUTE=a.ALERTS_ROUTE=a.ADVANCED_ROUTE=a.ADD_POPULAR_CUSTOM_NETWORK=a.ADD_NFT_ROUTE=a.ADD_NETWORK_ROUTE=a.ABOUT_US_ROUTE=void 0;a.DEFAULT_ROUTE="/";const n="/unlock";a.UNLOCK_ROUTE=n;const s="/lock";a.LOCK_ROUTE=s;const r="/asset";a.ASSET_ROUTE=r;const o="/settings";a.SETTINGS_ROUTE=o;const i="/settings/general";a.GENERAL_ROUTE=i;const c="/settings/advanced";a.ADVANCED_ROUTE=c;const u="/settings/experimental";a.EXPERIMENTAL_ROUTE=u;const l="/settings/security";a.SECURITY_ROUTE=l;const d="/settings/about-us";a.ABOUT_US_ROUTE=d;const m="/settings/alerts";a.ALERTS_ROUTE=m;const p="/settings/networks";a.NETWORKS_ROUTE=p;const f="/settings/networks/form";a.NETWORKS_FORM_ROUTE=f;const g="/settings/networks/add-network";a.ADD_NETWORK_ROUTE=g;const T="/settings/networks/add-popular-custom-network";a.ADD_POPULAR_CUSTOM_NETWORK=T;a.SNAPS_LIST_ROUTE="/settings/snaps-list";a.SNAPS_VIEW_ROUTE="/settings/snaps-view";const h="/settings/contact-list";a.CONTACT_LIST_ROUTE=h;const E="/settings/contact-list/edit-contact";a.CONTACT_EDIT_ROUTE=E;const v="/settings/contact-list/add-contact";a.CONTACT_ADD_ROUTE=v;const _="/settings/contact-list/view-contact";a.CONTACT_VIEW_ROUTE=_;const y="/seed";a.REVEAL_SEED_ROUTE=y;const S="/restore-vault";a.RESTORE_VAULT_ROUTE=S;const k="/import-token";a.IMPORT_TOKEN_ROUTE=k;const A="/confirm-import-token";a.CONFIRM_IMPORT_TOKEN_ROUTE=A;const w="/confirm-add-suggested-token";a.CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE=w;const b="/new-account";a.NEW_ACCOUNT_ROUTE=b;const N="/new-account/import";a.IMPORT_ACCOUNT_ROUTE=N;const O="/new-account/connect";a.CONNECT_HARDWARE_ROUTE=O;const C="/send";a.SEND_ROUTE=C;const I="/token-details";a.TOKEN_DETAILS=I;const P="/connect";a.CONNECT_ROUTE=P;const R="/confirm-permissions";a.CONNECT_CONFIRM_PERMISSIONS_ROUTE=R;const M="/connected";a.CONNECTED_ROUTE=M;const x="/connected/accounts";a.CONNECTED_ACCOUNTS_ROUTE=x;a.SWAPS_ROUTE="/swaps";const F="/swaps/build-quote";a.BUILD_QUOTE_ROUTE=F;const D="/swaps/view-quote";a.VIEW_QUOTE_ROUTE=D;const G="/swaps/loading-quotes";a.LOADING_QUOTES_ROUTE=G;a.AWAITING_SIGNATURES_ROUTE="/swaps/awaiting-signatures";a.SMART_TRANSACTION_STATUS_ROUTE="/swaps/smart-transaction-status";const U="/swaps/awaiting-swap";a.AWAITING_SWAP_ROUTE=U;const L="/swaps/swaps-error";a.SWAPS_ERROR_ROUTE=L;a.SWAPS_MAINTENANCE_ROUTE="/swaps/maintenance";a.ADD_NFT_ROUTE="/add-nft";a.ONBOARDING_ROUTE="/onboarding";a.ONBOARDING_REVIEW_SRP_ROUTE="/onboarding/review-recovery-phrase";a.ONBOARDING_CONFIRM_SRP_ROUTE="/onboarding/confirm-recovery-phrase";a.ONBOARDING_CREATE_PASSWORD_ROUTE="/onboarding/create-password";a.ONBOARDING_COMPLETION_ROUTE="/onboarding/completion";a.ONBOARDING_UNLOCK_ROUTE="/onboarding/unlock";a.ONBOARDING_HELP_US_IMPROVE_ROUTE="/onboarding/help-us-improve";a.ONBOARDING_IMPORT_WITH_SRP_ROUTE="/onboarding/import-with-recovery-phrase";a.ONBOARDING_SECURE_YOUR_WALLET_ROUTE="/onboarding/secure-your-wallet";a.ONBOARDING_PRIVACY_SETTINGS_ROUTE="/onboarding/privacy-settings";a.ONBOARDING_PIN_EXTENSION_ROUTE="/onboarding/pin-extension";a.ONBOARDING_WELCOME_ROUTE="/onboarding/welcome";a.ONBOARDING_METAMETRICS="/onboarding/metametrics";const j="/confirm-transaction";a.CONFIRM_TRANSACTION_ROUTE=j;const $="/send-ether";a.CONFIRM_SEND_ETHER_PATH=$;const H="/send-token";a.CONFIRM_SEND_TOKEN_PATH=H;const W="/deploy-contract";a.CONFIRM_DEPLOY_CONTRACT_PATH=W;const B="/approve";a.CONFIRM_APPROVE_PATH=B;const q="/set-approval-for-all";a.CONFIRM_SET_APPROVAL_FOR_ALL_PATH=q;const V="/transfer-from";a.CONFIRM_TRANSFER_FROM_PATH=V;const K="/safe-transfer-from";a.CONFIRM_SAFE_TRANSFER_FROM_PATH=K;const Y="/token-method";a.CONFIRM_TOKEN_METHOD_PATH=Y;const X="/signature-request";a.SIGNATURE_REQUEST_PATH=X;const Q="/decrypt-message-request";a.DECRYPT_MESSAGE_REQUEST_PATH=Q;const z="/encryption-public-key-request";a.ENCRYPTION_PUBLIC_KEY_REQUEST_PATH=z;const Z="/confirmation";a.CONFIRMATION_V_NEXT_ROUTE=Z;const J={"/":"Home",[n]:"Unlock Page",[s]:"Lock Page","/asset/:asset/:id":"Asset Page",[o]:"Settings Page",[i]:"General Settings Page",[c]:"Advanced Settings Page",[u]:"Experimental Settings Page",[l]:"Security Settings Page",[d]:"About Us Page",[m]:"Alerts Settings Page",[p]:"Network Settings Page",[f]:"Network Settings Page Form",[g]:"Add Network From Settings Page Form",[T]:"Add Network From A List Of Popular Custom Networks",[h]:"Contact List Settings Page",[`${E}/:address`]:"Edit Contact Settings Page",[v]:"Add Contact Settings Page",[`${_}/:address`]:"View Contact Settings Page",[y]:"Reveal Secret Recovery Phrase Page",[S]:"Restore Vault Page",[k]:"Import Token Page",[A]:"Confirm Import Token Page",[w]:"Confirm Add Suggested Token Page",[b]:"New Account Page",[N]:"Import Account Page",[O]:"Connect Hardware Wallet Page",[C]:"Send Page","/token-details/:address":"Token Details Page","/connect/:id":"Connect To Site Confirmation Page","/connect/:id/confirm-permissions":"Grant Connected Site Permissions Confirmation Page",[M]:"Sites Connected To This Account Page",[x]:"Accounts Connected To This Site Page","/confirm-transaction/:id":"Confirmation Root Page",[j]:"Confirmation Root Page",[Z]:"New Confirmation Page","/confirm-transaction/:id/token-method":"Confirm Token Method Transaction Page","/confirm-transaction/:id/send-ether":"Confirm Send Ether Transaction Page","/confirm-transaction/:id/send-token":"Confirm Send Token Transaction Page","/confirm-transaction/:id/deploy-contract":"Confirm Deploy Contract Transaction Page","/confirm-transaction/:id/approve":"Confirm Approve Transaction Page","/confirm-transaction/:id/set-approval-for-all":"Confirm Set Approval For All Transaction Page","/confirm-transaction/:id/transfer-from":"Confirm Transfer From Transaction Page","/confirm-transaction/:id/safe-transfer-from":"Confirm Safe Transfer From Transaction Page","/confirm-transaction/:id/signature-request":"Signature Request Page","/confirm-transaction/:id/decrypt-message-request":"Decrypt Message Request Page","/confirm-transaction/:id/encryption-public-key-request":"Encryption Public Key Request Page",[F]:"Swaps Build Quote Page",[D]:"Swaps View Quotes Page",[G]:"Swaps Loading Quotes Page",[U]:"Swaps Awaiting Swaps Page",[L]:"Swaps Error Page"};a.PATH_NAME_MAP=J}}},{package:"$root$",file:"ui/helpers/constants/routes.ts"}],[4075,{"../../components/component-library/icon/deprecated":3836,"./routes":4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.SETTINGS_CONSTANTS=void 0;var n=e("../../components/component-library/icon/deprecated"),s=e("./routes");const r=[{tabMessage:e=>e("general"),sectionMessage:e=>e("currencyConversion"),descriptionMessage:e=>e("currencyConversion"),route:`${s.GENERAL_ROUTE}#currency-conversion`,iconName:n.ICON_NAMES.SETTING},{tabMessage:e=>e("general"),sectionMessage:e=>e("primaryCurrencySetting"),descriptionMessage:e=>e("primaryCurrencySettingDescription"),route:`${s.GENERAL_ROUTE}#primary-currency`,iconName:n.ICON_NAMES.SETTING},{tabMessage:e=>e("general"),sectionMessage:e=>e("currentLanguage"),descriptionMessage:e=>e("currentLanguage"),route:`${s.GENERAL_ROUTE}#current-language`,iconName:n.ICON_NAMES.SETTING},{tabMessage:e=>e("general"),sectionMessage:e=>e("theme"),descriptionMessage:e=>e("themeDescription"),route:`${s.GENERAL_ROUTE}#theme`,icon:"fa fa-flask"},{tabMessage:e=>e("general"),sectionMessage:e=>e("accountIdenticon"),descriptionMessage:e=>e("accountIdenticon"),route:`${s.GENERAL_ROUTE}#account-identicon`,iconName:n.ICON_NAMES.SETTING},{tabMessage:e=>e("general"),sectionMessage:e=>e("hideZeroBalanceTokens"),descriptionMessage:e=>e("hideZeroBalanceTokens"),route:`${s.GENERAL_ROUTE}#zero-balancetokens`,iconName:n.ICON_NAMES.SETTING},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("stateLogs"),descriptionMessage:e=>e("stateLogsDescription"),route:`${s.ADVANCED_ROUTE}#state-logs`,icon:"fas fa-sliders-h"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("clearActivity"),descriptionMessage:e=>e("clearActivityDescription"),route:`${s.ADVANCED_ROUTE}#clear-activity`,icon:"fas fa-sliders-h"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("showHexData"),descriptionMessage:e=>e("showHexDataDescription"),route:`${s.ADVANCED_ROUTE}#show-hexdata`,icon:"fas fa-sliders-h"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("showFiatConversionInTestnets"),descriptionMessage:e=>e("showFiatConversionInTestnetsDescription"),route:`${s.ADVANCED_ROUTE}#conversion-testnetworks`,icon:"fas fa-sliders-h"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("showTestnetNetworks"),descriptionMessage:e=>e("showTestnetNetworksDescription"),route:`${s.ADVANCED_ROUTE}#show-testnets`,icon:"fas fa-sliders-h"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("nonceField"),descriptionMessage:e=>e("nonceFieldDescription"),route:`${s.ADVANCED_ROUTE}#customize-nonce`,icon:"fas fa-sliders-h"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("autoLockTimeLimit"),descriptionMessage:e=>e("autoLockTimeLimitDescription"),route:`${s.ADVANCED_ROUTE}#autolock-timer`,icon:"fas fa-sliders-h"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("preferredLedgerConnectionType"),descriptionMessage:e=>e("preferredLedgerConnectionType"),route:`${s.ADVANCED_ROUTE}#ledger-connection`,icon:"fas fa-sliders-h"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("dismissReminderField"),descriptionMessage:e=>e("dismissReminderDescriptionField"),route:`${s.ADVANCED_ROUTE}#dimiss-secretrecovery`,icon:"fas fa-sliders-h"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("toggleEthSignField"),descriptionMessage:e=>e("toggleEthSignDescriptionField"),route:`${s.ADVANCED_ROUTE}#toggle-ethsign`,icon:"fas fa-sliders-h"},{tabMessage:e=>e("contacts"),sectionMessage:e=>e("contacts"),descriptionMessage:e=>e("contacts"),route:s.CONTACT_LIST_ROUTE,icon:n.ICON_NAMES.BOOK},{tabMessage:e=>e("securityAndPrivacy"),sectionMessage:e=>e("revealSeedWords"),descriptionMessage:e=>e("revealSeedWords"),route:`${s.SECURITY_ROUTE}#reveal-secretrecovery`,icon:"fa fa-lock"},{tabMessage:e=>e("securityAndPrivacy"),sectionMessage:e=>e("showIncomingTransactions"),descriptionMessage:e=>e("showIncomingTransactionsDescription"),route:`${s.SECURITY_ROUTE}#incoming-transaction`,icon:"fa fa-lock"},{tabMessage:e=>e("securityAndPrivacy"),sectionMessage:e=>e("usePhishingDetection"),descriptionMessage:e=>e("usePhishingDetectionDescription"),route:`${s.SECURITY_ROUTE}#phishing-detection`,icon:"fa fa-lock"},{tabMessage:e=>e("securityAndPrivacy"),sectionMessage:e=>e("participateInMetaMetrics"),descriptionMessage:e=>e("participateInMetaMetricsDescription"),route:`${s.SECURITY_ROUTE}#metrametrics`,icon:"fa fa-lock"},{tabMessage:e=>e("securityAndPrivacy"),sectionMessage:e=>e("chooseYourNetwork"),descriptionMessage:e=>e("chooseYourNetworkDescription"),route:`${s.SECURITY_ROUTE}#-chose-your-network`,icon:"fa fa-lock"},{tabMessage:e=>e("securityAndPrivacy"),sectionMessage:e=>e("addCustomIPFSGateway"),descriptionMessage:e=>e("addCustomIPFSGatewayDescription"),route:`${s.SECURITY_ROUTE}#-add-custom-ipfs-gateway`,icon:"fa fa-lock"},{tabMessage:e=>e("securityAndPrivacy"),sectionMessage:e=>e("autoDetectTokens"),descriptionMessage:e=>e("autoDetectTokensDescription"),route:`${s.SECURITY_ROUTE}#-auto-detect-tokens`,icon:"fa fa-lock"},{tabMessage:e=>e("securityAndPrivacy"),sectionMessage:e=>e("useMultiAccountBalanceChecker"),descriptionMessage:e=>e("useMultiAccountBalanceCheckerDescription"),route:`${s.SECURITY_ROUTE}#-use-milti-account-balance-checker`,icon:"fa fa-lock"},{tabMessage:e=>e("securityAndPrivacy"),sectionMessage:e=>e("currencyRateCheckToggle"),descriptionMessage:e=>e("currencyRateCheckToggleDescription"),route:`${s.SECURITY_ROUTE}#price-checker`,icon:"fa fa-lock"},{tabMessage:e=>e("alerts"),sectionMessage:e=>e("alertSettingsUnconnectedAccount"),descriptionMessage:e=>e("alertSettingsUnconnectedAccount"),route:`${s.ALERTS_ROUTE}#unconnected-account`,iconName:n.ICON_NAMES.NOTIFICATION},{tabMessage:e=>e("alerts"),sectionMessage:e=>e("alertSettingsWeb3ShimUsage"),descriptionMessage:e=>e("alertSettingsWeb3ShimUsage"),route:`${s.ALERTS_ROUTE}#web3-shimusage`,icon:"fa fa-bell"},{tabMessage:e=>e("networks"),sectionMessage:e=>e("mainnet"),descriptionMessage:e=>e("mainnet"),route:`${s.NETWORKS_ROUTE}#networks-mainnet`,icon:"fa fa-plug"},{tabMessage:e=>e("networks"),sectionMessage:e=>e("goerli"),descriptionMessage:e=>e("goerli"),route:`${s.NETWORKS_ROUTE}#networks-goerli`,icon:"fa fa-plug"},{tabMessage:e=>e("networks"),sectionMessage:e=>e("sepolia"),descriptionMessage:e=>e("sepolia"),route:`${s.NETWORKS_ROUTE}#networks-sepolia`,icon:"fa fa-plug"},{tabMessage:e=>e("networks"),sectionMessage:e=>e("lineatestnet"),descriptionMessage:e=>e("lineatestnet"),route:`${s.NETWORKS_ROUTE}#networks-lineatestnet`,icon:"fa fa-plug"},{tabMessage:e=>e("networks"),sectionMessage:e=>e("localhost"),descriptionMessage:e=>e("localhost"),route:`${s.NETWORKS_ROUTE}#networks-localhost`,icon:"fa fa-plug"},{tabMessage:e=>e("about"),sectionMessage:e=>e("metamaskVersion"),descriptionMessage:e=>e("builtAroundTheWorld"),route:`${s.ABOUT_US_ROUTE}#version`,icon:"fa fa-info-circle"},{tabMessage:e=>e("about"),sectionMessage:e=>e("links"),descriptionMessage:e=>e("links"),route:`${s.ABOUT_US_ROUTE}#links`,icon:"fa fa-info-circle"},{tabMessage:e=>e("about"),sectionMessage:e=>e("privacyMsg"),descriptionMessage:e=>e("privacyMsg"),route:`${s.ABOUT_US_ROUTE}#privacy-policy`,icon:"fa fa-info-circle"},{tabMessage:e=>e("about"),sectionMessage:e=>e("terms"),descriptionMessage:e=>e("terms"),route:`${s.ABOUT_US_ROUTE}#terms`,icon:"fa fa-info-circle"},{tabMessage:e=>e("about"),sectionMessage:e=>e("attributions"),descriptionMessage:e=>e("attributions"),route:`${s.ABOUT_US_ROUTE}#attributions`,icon:"fa fa-info-circle"},{tabMessage:e=>e("about"),sectionMessage:e=>e("supportCenter"),descriptionMessage:e=>e("supportCenter"),route:`${s.ABOUT_US_ROUTE}#supportcenter`,icon:"fa fa-info-circle"},{tabMessage:e=>e("about"),sectionMessage:e=>e("visitWebSite"),descriptionMessage:e=>e("visitWebSite"),route:`${s.ABOUT_US_ROUTE}#visitwebsite`,icon:"fa fa-info-circle"},{tabMessage:e=>e("about"),sectionMessage:e=>e("contactUs"),descriptionMessage:e=>e("contactUs"),route:`${s.ABOUT_US_ROUTE}#contactus`,icon:"fa fa-info-circle"},{tabMessage:e=>e("about"),sectionMessage:e=>e("betaTerms"),descriptionMessage:e=>e("betaTerms"),route:`${s.ABOUT_US_ROUTE}#beta-terms`,icon:"fa fa-info-circle"},{tabMessage:e=>e("experimental"),sectionMessage:e=>e("enableOpenSeaAPI"),descriptionMessage:e=>e("enableOpenSeaAPIDescription"),route:`${s.EXPERIMENTAL_ROUTE}#opensea-api`,icon:"fa fa-flask"},{tabMessage:e=>e("experimental"),sectionMessage:e=>e("useNftDetection"),descriptionMessage:e=>e("useNftDetectionDescription"),route:`${s.EXPERIMENTAL_ROUTE}#autodetect-nfts`,icon:"fa fa-flask"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("backupUserData"),descriptionMessage:e=>e("backupUserDataDescription"),route:`${s.ADVANCED_ROUTE}#backup-userdata`,icon:"fas fa-download"},{tabMessage:e=>e("advanced"),sectionMessage:e=>e("restoreUserData"),descriptionMessage:e=>e("restoreUserDataDescription"),route:`${s.ADVANCED_ROUTE}#restore-userdata`,icon:"fas fa-upload"},{tabMessage:e=>e("experimental"),sectionMessage:e=>e("transactionSecurityCheck"),descriptionMessage:e=>e("transactionSecurityCheckDescription"),route:`${s.EXPERIMENTAL_ROUTE}#transaction-security-check`,icon:"fa fa-flask"}];a.SETTINGS_CONSTANTS=r}}},{package:"$root$",file:"ui/helpers/constants/settings.js"}],[4076,{"../../../shared/constants/transaction":3417},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.TOKEN_CATEGORY_HASH=a.PRIORITY_STATUS_HASH=a.PENDING_STATUS_HASH=void 0;var n=e("../../../shared/constants/transaction");const s={[n.TransactionStatus.unapproved]:!0,[n.TransactionStatus.approved]:!0,[n.TransactionStatus.submitted]:!0,[n.TransactionStatus.pending]:!0};a.PENDING_STATUS_HASH=s;const r={...s,[n.TransactionStatus.confirmed]:!0};a.PRIORITY_STATUS_HASH=r;const o={[n.TransactionType.tokenMethodApprove]:!0,[n.TransactionType.tokenMethodSetApprovalForAll]:!0,[n.TransactionType.tokenMethodTransfer]:!0,[n.TransactionType.tokenMethodTransferFrom]:!0};a.TOKEN_CATEGORY_HASH=o}}},{package:"$root$",file:"ui/helpers/constants/transactions.js"}],[4077,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n={ADD_CUSTOM_TOKENS:"https://metamask.zendesk.com/hc/en-us/articles/360015489031",ADD_MISSING_ACCOUNTS:"https://metamask.zendesk.com/hc/en-us/articles/360015489271",BASIC_SAFETY:"https://metamask.zendesk.com/hc/en-us/articles/360015489591-Basic-Safety-Tips",CUSTOMIZE_NONCE:"https://metamask.zendesk.com/hc/en-us/articles/7417499333531-How-to-customize-a-transaction-nonce",HARDWARE_CONNECTION:"https://metamask.zendesk.com/hc/en-us/articles/360020394612-How-to-connect-a-Trezor-or-Ledger-Hardware-Wallet",IMPORT_ACCOUNTS:"https://metamask.zendesk.com/hc/en-us/articles/360015489331",IMPORTED_ACCOUNTS:"https://metamask.zendesk.com/hc/en-us/articles/360015289932",INFURA_BLOCKAGE:"https://metamask.zendesk.com/hc/en-us/articles/360059386712",LEDGER_FIREFOX_U2F_GUIDE:"https://support.ledger.com/hc/en-us/articles/10371387758493-MetaMask-Firefox-Ledger-Integration-Issue?support=true",LEGACY_WEB3:"https://metamask.zendesk.com/hc/en-us/articles/360053147012",NFT_TOKENS:"https://metamask.zendesk.com/hc/en-us/articles/360058238591-NFT-tokens-in-MetaMask-wallet",PASSWORD_ARTICLE:"https://metamask.zendesk.com/hc/en-us/articles/4404722782107",SECRET_RECOVERY_PHRASE:"https://metamask.zendesk.com/hc/en-us/articles/360060826432-What-is-a-Secret-Recovery-Phrase-and-how-to-keep-your-crypto-wallet-secure",SECRET_RECOVERY_PHRASE_USER_GUIDE:"https://metamask.zendesk.com/hc/en-us/articles/4404722782107-User-guide-Secret-Recovery-Phrase-password-and-private-keys",NON_CUSTODIAL_WALLET:"https://metamask.zendesk.com/hc/en-us/articles/360059952212-MetaMask-is-a-non-custodial-wallet",SPEEDUP_CANCEL:"https://metamask.zendesk.com/hc/en-us/articles/360015489251-How-to-speed-up-or-cancel-a-pending-transaction",TOKEN_SAFETY_PRACTICES:"https://metamask.zendesk.com/hc/en-us/articles/4403988839451",UNKNOWN_NETWORK:"https://metamask.zendesk.com/hc/en-us/articles/4417500466971",USER_GUIDE_CUSTOM_NETWORKS:"https://metamask.zendesk.com/hc/en-us/articles/4404424659995",USER_GUIDE_DAPPS:"https://metamask.zendesk.com/hc/en-us/articles/4405506066331-User-guide-Dapps",USER_GUIDE_GAS:"https://metamask.zendesk.com/hc/en-us/articles/4404600179227-User-Guide-Gas",VERIFY_CUSTOM_NETWORK:"https://metamask.zendesk.com/hc/en-us/articles/360057142392"};a.default=n}}},{package:"$root$",file:"ui/helpers/constants/zendesk-url.js"}],[4078,{"../../constants/routes":4074,"prop-types":3032,react:3177,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=c;var n=i(e("react")),s=i(e("prop-types")),r=e("react-router-dom"),o=e("../../constants/routes");function i(e){return e&&e.__esModule?e:{default:e}}function c(e){const{isUnlocked:t,completedOnboarding:a}=e;switch(!0){case t&&a:return n.default.createElement(r.Route,e);case!a:return n.default.createElement(r.Redirect,{to:{pathname:o.ONBOARDING_ROUTE}});default:return n.default.createElement(r.Redirect,{to:{pathname:o.UNLOCK_ROUTE}})}}c.propTypes={isUnlocked:s.default.bool,completedOnboarding:s.default.bool}}}},{package:"$root$",file:"ui/helpers/higher-order-components/authenticated/authenticated.component.js"}],[4079,{"./authenticated.component":4078,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,s=e("react-redux"),r=(n=e("./authenticated.component"))&&n.__esModule?n:{default:n};var o=(0,s.connect)((e=>{const{metamask:{isUnlocked:t,completedOnboarding:a}}=e;return{isUnlocked:t,completedOnboarding:a}}))(r.default);a.default=o}}},{package:"$root$",file:"ui/helpers/higher-order-components/authenticated/authenticated.container.js"}],[4080,{"./authenticated.container":4079},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./authenticated.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/helpers/higher-order-components/authenticated/index.js"}],[4081,{"prop-types":3032,react:3177,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=i;var n=o(e("react")),s=o(e("prop-types")),r=e("react-router-dom");function o(e){return e&&e.__esModule?e:{default:e}}function i({flag:e,redirectRoute:t,...a}){return e?n.default.createElement(r.Route,a):n.default.createElement(r.Redirect,{to:{pathname:t}})}i.propTypes={flag:s.default.bool.isRequired,redirectRoute:s.default.string.isRequired}}}},{package:"$root$",file:"ui/helpers/higher-order-components/feature-toggled-route.js"}],[4082,{"./initialized.container":4084},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./initialized.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/helpers/higher-order-components/initialized/index.js"}],[4083,{"../../constants/routes":4074,"prop-types":3032,react:3177,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=c;var n=i(e("react")),s=i(e("prop-types")),r=e("react-router-dom"),o=e("../../constants/routes");function i(e){return e&&e.__esModule?e:{default:e}}function c(e){return e.completedOnboarding?n.default.createElement(r.Route,e):n.default.createElement(r.Redirect,{to:{pathname:o.ONBOARDING_ROUTE}})}c.propTypes={completedOnboarding:s.default.bool}}}},{package:"$root$",file:"ui/helpers/higher-order-components/initialized/initialized.component.js"}],[4084,{"./initialized.component":4083,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,s=e("react-redux"),r=(n=e("./initialized.component"))&&n.__esModule?n:{default:n};var o=(0,s.connect)((e=>{const{metamask:{completedOnboarding:t}}=e;return{completedOnboarding:t}}))(r.default);a.default=o}}},{package:"$root$",file:"ui/helpers/higher-order-components/initialized/initialized.container.js"}],[4085,{"./with-modal-props":4086},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./with-modal-props"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/helpers/higher-order-components/with-modal-props/index.js"}],[4086,{"../../../store/actions":4443,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(e){return(0,n.connect)(r,o)(e)};var n=e("react-redux"),s=e("../../../store/actions");const r=e=>{const{appState:t}=e,{props:a}=t.modal.modalState;return{...a}},o=e=>({hideModal:()=>e((0,s.hideModal)())})}}},{package:"$root$",file:"ui/helpers/higher-order-components/with-modal-props/with-modal-props.js"}],[4087,{"../../components/component-library/text/deprecated":3862},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getAccountNameErrorMessage=function(e,t,a,s){const r=e.some((e=>e.name===a)),o=t.t("newAccountNumberName").replace(" $1",""),i=new RegExp(`^\\s*${o} \\d+\\s*$`,"iu").test(a),c=a===s||!r&&!i;let u;c?u=n.INVISIBLE_CHARACTER:r?u=t.t("accountNameDuplicate"):i&&(u=t.t("accountNameReserved"));return{isValidAccountName:c,errorMessage:u}};var n=e("../../components/component-library/text/deprecated")}}},{package:"$root$",file:"ui/helpers/utils/accounts.js"}],[4089,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.camelCaseToCapitalize=function(e=""){return e.replace(/([A-Z])/gu," $1").replace(/^./u,(e=>e.toUpperCase()))}}}},{package:"$root$",file:"ui/helpers/utils/common.util.js"}],[4090,{"../../../shared/constants/common":3403,"../../../shared/modules/Numeric":3427,"../../selectors":4436,"bignumber.js":1853,"currency-formatter":2070,"currency-formatter/currencies":2069},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.addEth=function(e,...t){return t.reduce(((e,t)=>e.add(new i.Numeric(t,10)).round(6)),new i.Numeric(e,10)).toString()},a.addFiat=function(e,...t){return t.reduce(((e,t)=>e.add(new i.Numeric(t,10)).round(2)),new i.Numeric(e,10)).toString()},a.areDappSuggestedAndTxParamGasFeesTheSame=function(e){const{txParams:t,dappSuggestedGasFees:a}=e??{},{gasPrice:n,maxFeePerGas:s,maxPriorityFeePerGas:r}=t||{},{gasPrice:o,maxFeePerGas:i,maxPriorityFeePerGas:c}=a||{},u=!o&&!i&&!c;if(!n&&!s&&!r||u)return!1;const l=n&&n===o,d=[s,r].every((e=>e===o)),m=s&&s===i&&r===c;return Boolean(l||d||m)},a.convertTokenToFiat=function({value:e,fromCurrency:t=c.EtherDenomination.ETH,toCurrency:a,conversionRate:n,contractExchangeRate:s}){const r=n*s;let o=new i.Numeric(e,10);t!==a&&r&&(o=o.applyConversionRate(r));return o.round(2).toString()},a.formatCurrency=function(e,t){const a=t.toUpperCase();return s.default.find((e=>e.code===a))?n.default.format(Number(e),{code:a}):e},a.getHexGasTotal=function({gasLimit:e="0x0",gasPrice:t="0x0"}){return new i.Numeric(e,16).times(new i.Numeric(t,16)).toPrefixedHexString()},a.getTransactionFee=function({value:e,fromCurrency:t=c.EtherDenomination.ETH,toCurrency:a,conversionRate:n,numberOfDecimals:s}){let r=new i.Numeric(e,16,c.EtherDenomination.WEI).toDenomination(c.EtherDenomination.ETH).toBase(10);t!==a&&n&&(r=r.applyConversionRate(n));return r.round(s).toString()},a.hasUnconfirmedTransactions=function(e){return(0,o.unconfirmedTransactionsCountSelector)(e)>0},a.roundExponential=function(e){const t=new r.BigNumber(e);return t.e>20?t.toPrecision(4):e};var n=u(e("currency-formatter")),s=u(e("currency-formatter/currencies")),r=e("bignumber.js"),o=e("../../selectors"),i=e("../../../shared/modules/Numeric"),c=e("../../../shared/constants/common");function u(e){return e&&e.__esModule?e:{default:e}}}}},{package:"$root$",file:"ui/helpers/utils/confirm-tx.util.ts"}],[4091,{"./util":4108,buffer:1943},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){(function(t){(function(){Object.defineProperty(a,"__esModule",{value:!0}),a.exportAsFile=function(e,a,s="text/csv"){const r=t.from(a,"utf8").toString("base64");e=e||(0,n.getRandomFileName)();const o=window.document.createElement("a");o.href=`data:${s};Base64,${r}`,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o)};var n=e("./util")}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"$root$",file:"ui/helpers/utils/export-utils.js"}],[4092,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.formatETHFee=function(e,t="ETH"){return`${e} ${t}`}}}},{package:"$root$",file:"ui/helpers/utils/formatters.js"}],[4093,{"../../../shared/constants/gas":3404,"../../../shared/modules/Numeric":3427,"../../../shared/modules/conversion.utils":3431,"./util":4108,"bignumber.js":1853,lodash:2932},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.addTenPercentAndRound=d,a.editGasModeIsSpeedUpOrCancel=function(e){return e===o.EditGasModes.cancel||e===o.EditGasModes.speedUp},a.formatGasFeeOrFeeRange=function(e,{precision:t=2}={}){if((0,u.isNullish)(e)||Array.isArray(e)&&0===e.length)return null;const a=Array.isArray(e)?e.slice(0,2):[e],n=Array.isArray(t)?t.slice(0,2):(0,s.times)(a.length,(0,s.constant)(t));return`${(0,s.uniq)((0,s.zip)(a,n).map((([e,t])=>t===undefined?e:(0,u.roundToDecimalPlacesRemovingExtraZeroes)(e,t)))).join(" - ")} GWEI`},a.gasEstimateGreaterThanGasUsedPlusTenPercent=void 0,a.isMetamaskSuggestedGasEstimate=function(e){return[o.GasRecommendations.high,o.GasRecommendations.medium,o.GasRecommendations.low].includes(e)};var n,s=e("lodash"),r=(n=e("bignumber.js"))&&n.__esModule?n:{default:n},o=e("../../../shared/constants/gas"),i=e("../../../shared/modules/conversion.utils"),c=e("../../../shared/modules/Numeric"),u=e("./util");const l=new c.Numeric(1.1,10);function d(e){return e===undefined?undefined:new c.Numeric(e,16).times(l).round(0).toPrefixedHexString()}a.gasEstimateGreaterThanGasUsedPlusTenPercent=(e,t,a)=>{var n;let{maxFeePerGas:s}=e;s=new r.default((0,i.hexWEIToDecGWEI)(d(s)));const o=null===(n=t[a])||void 0===n?void 0:n.suggestedMaxFeePerGas;return(0,u.bnGreaterThan)(o,s)}}}},{package:"$root$",file:"ui/helpers/utils/gas.js"}],[4094,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.isHardwareKeyring=function(e=""){return e.includes("Hardware")}}}},{package:"$root$",file:"ui/helpers/utils/hardware.js"}],[4095,{"../../../shared/modules/fetch-with-timeout":3433,"@sentry/browser":1403,loglevel:2944,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.fetchLocale=async function(e){try{const t=await c(`./_locales/${e}/messages.json`);return await t.json()}catch(t){return s.default.error(`failed to fetch ${e} locale because of ${t}`),{}}},a.getMessage=void 0,a.loadRelativeTimeFormatLocaleData=async function(e){const t=e.split("_")[0];if(Intl.RelativeTimeFormat&&"function"==typeof Intl.RelativeTimeFormat.__addLocaleData&&!m.has(t)){const e=await async function(e){const t=await c(`./intl/${e}/relative-time-format-data.json`);return await t.json()}(t);Intl.RelativeTimeFormat.__addLocaleData(e)}};var n=i(e("react")),s=i(e("loglevel")),r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=o(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var i=s?Object.getOwnPropertyDescriptor(e,r):null;i&&(i.get||i.set)?Object.defineProperty(n,r,i):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("@sentry/browser"));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(o=function(e){return e?a:t})(e)}function i(e){return e&&e.__esModule?e:{default:e}}const c=(0,i(e("../../../shared/modules/fetch-with-timeout")).default)(),u={},l={},d={};a.getMessage=(e,t,a,o)=>{if(!t)return null;if(!t[a])return"en"===e?l[a]||(l[a]=new Error(`Unable to find value of key "${a}" for locale "${e}"`),r.captureException(l[a]),s.default.error(l[a])):u[e]&&u[e][a]||(u[e]||(u[e]={}),u[e][a]=!0,s.default.warn(`Translator - Unable to find value of key "${a}" for locale "${e}"`)),null;const i=function(e){return((null==e?void 0:e.length)??0)>0}(o),c=i&&(null==o?void 0:o.some((e=>null!==e&&("function"==typeof e||"object"==typeof e)))),m=t[a].message;if(i){const t=m.split(/(\$\d)/gu).map((t=>{var n;const i=t.match(/\$(\d)/u);if(!i)return t;const c=Number(i[1])-1;if(!(null!==o[c]&&o[c]!==undefined||null!==(n=d[e])&&void 0!==n&&n[a])){d[e]||(d[e]={}),d[e][a]=!0;const t=new Error(`Insufficient number of substitutions for key "${a}" with locale "${e}"`);s.default.error(t),r.captureException(t)}return null==o?void 0:o[c]}));return c?n.default.createElement("span",null," ",t," "):t.join("")}return m};const m=new Set}}},{package:"$root$",file:"ui/helpers/utils/i18n-helper.tsx"}],[4096,{"../../../shared/modules/hexstring-utils":3435},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(e){s||(s=new r(e));return s};var n=e("../../../shared/modules/hexstring-utils");let s;function r(e){this.jazzicon=e,this.cache={}}r.prototype.iconForAddress=function(e,t,a){return function(e,t){return(0,n.isValidHexAddress)(e,{allowNonPrefixed:!1})&&t&&t.iconUrl}(e,a)?function(e={}){const t=document.createElement("img");return t.src=null==e?void 0:e.iconUrl,t.style.width="100%",t}(a):this.generateIdenticonSvg(e,t)},r.prototype.generateIdenticonSvg=function(e,t){const a=`${e}:${t}`;return(this.cache[a]||(this.cache[a]=this.generateNewIdenticon(e,t))).cloneNode(!0)},r.prototype.generateNewIdenticon=function(e,t){const a=function(e){const t=e.slice(2,10);return parseInt(t,16)}(e);return this.jazzicon(t,a)}}}},{package:"$root$",file:"ui/helpers/utils/icon-factory.js"}],[4097,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.addUrlProtocolPrefix=function(e){return e.match(/^https?:\/\//u)?e:`https://${e}`}}}},{package:"$root$",file:"ui/helpers/utils/ipfs.js"}],[4098,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=()=>window.matchMedia("screen and (max-width: 575px)").matches;a.default=n}}},{package:"$root$",file:"ui/helpers/utils/is-mobile-view.js"}],[4099,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getMethodName=function(e){if(!e||"string"!=typeof e)return"";return e.replace(/([a-z])([A-Z])/gu,"$1 $2").replace(/([A-Z])([a-z])/gu," $1$2").replace(/ +/gu," ")}}}},{package:"$root$",file:"ui/helpers/utils/metrics.js"}],[4100,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getNftImageAlt=void 0;a.getNftImageAlt=({name:e,tokenId:t,description:a})=>a??`${e} ${t}`}}},{package:"$root$",file:"ui/helpers/utils/nfts.js"}],[4103,{"../../../shared/constants/permissions":3410,"../../components/component-library":3840,"../../components/component-library/icon/deprecated":3836,"../../components/ui/tooltip":4035,classnames:1980,"deep-freeze-strict":2078,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getPermissionDescription=a.PERMISSION_DESCRIPTIONS=void 0,a.getRightIcon=function({rightIcon:e,description:t,weight:a}){if(e&&t)return s.default.createElement(i.default,{wrapperClassName:(0,r.default)("permission__tooltip-icon",1===a&&"permission__tooltip-icon__warning"),html:s.default.createElement("div",null,t),position:"bottom"},"string"==typeof e?s.default.createElement("i",{className:e}):e);if(e)return"string"==typeof e?s.default.createElement("i",{className:(0,r.default)(e,"permission__tooltip-icon")}):e;return null},a.getWeightedPermissions=function(e,t,a){return Object.entries(t).reduce(((t,[n,s])=>t.concat(f({t:e,permissionName:n,permissionValue:s,targetSubjectMetadata:a}))),[]).sort(((e,t)=>e.weight-t.weight))};var n=l(e("deep-freeze-strict")),s=l(e("react")),r=l(e("classnames")),o=e("../../../shared/constants/permissions"),i=l(e("../../components/ui/tooltip")),c=e("../../components/component-library"),u=e("../../components/component-library/icon/deprecated");function l(e){return e&&e.__esModule?e:{default:e}}const d=Symbol("unknown");function m(e){return s.default.createElement(c.AvatarIcon,{iconName:e,size:u.ICON_SIZES.SM,iconProps:{size:u.ICON_SIZES.XS}})}const p=(0,n.default)({[o.RestrictedMethods.eth_accounts]:({t:e})=>({label:e("permission_ethereumAccounts"),leftIcon:m(u.ICON_NAMES.EYE),rightIcon:null,weight:2}),[d]:({t:e,permissionName:t})=>({label:e("permission_unknown",[t??"undefined"]),leftIcon:m(u.ICON_NAMES.QUESTION),rightIcon:null,weight:4})});a.PERMISSION_DESCRIPTIONS=p;const f=({t:e,permissionName:t,permissionValue:a,targetSubjectMetadata:n})=>{let s=p[d];Object.hasOwnProperty.call(p,t)&&(s=p[t]);const r=s({t:e,permissionName:t,permissionValue:a,targetSubjectMetadata:n});return Array.isArray(r)?r.map((e=>({...e,permissionName:t,permissionValue:a}))):[{...r,permissionName:t,permissionValue:a}]};a.getPermissionDescription=f}}},{package:"$root$",file:"ui/helpers/utils/permission.js"}],[4104,{"../constants/settings":4075,_process:3027},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){(function(t){(function(){Object.defineProperty(a,"__esModule",{value:!0}),a.getNumberOfSettingsInSection=function(e,t){return o(e,t).length},a.getSettingsRoutes=r,a.handleSettingsRefs=function(e,t,a){const n=o(e,t),s=n.findIndex((e=>e.route.substring(1)===window.location.hash.substring(1)));if(-1===s)return;const r=1===n.length?a:a[s];if(null!=r&&r.current){r.current.scrollIntoView({behavior:"smooth"}),r.current.focus();const e=window.location.hash.split("#")[1];window.location.hash=e}},a.highlightSearchedText=function(){const e=document.getElementById("search-settings"),t=new RegExp(e.value,"gi");[...document.querySelectorAll(".settings-page__header__search__list__item")].forEach((e=>{const a=e.querySelector(".settings-page__header__search__list__item__tab"),n=e.querySelector(".settings-page__header__search__list__item__section");i(a,t),i(n,t)}))};var n=e("../constants/settings");let s;function r(){return s||(s=n.SETTINGS_CONSTANTS.filter((e=>!e.featureFlag||t.env[e.featureFlag])),s)}function o(e,t){return r().filter((a=>a.tabMessage(e)===t))}function i(e,t){if(null!==e){let a=e.innerHTML;a=a.replace("&amp;","&"),a=a.replace(/(<span style="background:#ffd33d">|<\/span>)/gim,""),e.innerHTML=a.replace(t,'<span style="background:#ffd33d">$&</span>')}}}).call(this)}).call(this,e("_process"))}}},{package:"$root$",file:"ui/helpers/utils/settings-search.js"}],[4105,{"../../../shared/constants/transaction":3417,"../../../shared/lib/metamask-controller-utils":3420,"../../../shared/lib/transactions-controller-utils":3425,"../../../shared/modules/Numeric":3427,"../../../shared/modules/string-utils":3442,"../../../shared/modules/transaction.utils":3444,"../../store/actions":4443,"./confirm-tx.util":4090,"./util":4108,loglevel:2944},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getAssetDetails=async function(e,t,a,n){var d,m,p;const f=(0,i.parseStandardTokenTransactionData)(a);if(!f)throw new Error("Unable to detect valid token data");let g=(null===(d=_(f))||void 0===d?void 0:d.toString())??(0,u.getTokenValueParam)(f);const T=v(f);let h;if(null!=n&&n.length&&g){const t=n.find((({address:t,tokenId:a})=>(0,o.isEqualCaseInsensitive)(e,t)&&a===g));if(t)return{toAddress:T,...t}}try{h=await(0,r.getTokenStandardAndDetails)(e,t,g)}catch(e){return s.default.warn(e),{toAddress:T,tokenId:g}}const E=(0,u.getTokenValueParam)(f),y=null===(m=h)||void 0===m?void 0:m.decimals,S=f&&E&&y&&(0,l.calcTokenAmount)(E,y).toString(10),k=y&&Number(null==y?void 0:y.toString(10));(null===(p=h)||void 0===p?void 0:p.standard)===c.TokenStandard.ERC20&&(g=undefined);return{tokenAmount:S,toAddress:T,decimals:k,tokenId:g,...h}},a.getSymbolAndDecimals=E,a.getTokenAddressParam=v,a.getTokenApprovedParam=function(e={}){var t;return null==e||null===(t=e.args)||void 0===t?void 0:t._approved},a.getTokenFiatAmount=function(e,t,a,n,s,r=!0,o=!1){if(t<=0||!e||n===undefined)return undefined;const i=new d.Numeric(e,10).times(new d.Numeric(t,10)).toString();let c,u=new d.Numeric(n,10);s!==a.toUpperCase()&&i&&(u=u.applyConversionRate(i));u=u.round(2).toString(),c=o?(0,p.formatCurrency)(u,a):r?`${(0,p.formatCurrency)(u,a)} ${a.toUpperCase()}`:u;return c},a.getTokenIdParam=_,a.getTokenMetadata=g,a.tokenInfoGetter=function(){const e={};return async(t,a)=>(e[t]||(e[t]=await E(t,a)),e[t])};var n,s=(n=e("loglevel"))&&n.__esModule?n:{default:n},r=e("../../store/actions"),o=e("../../../shared/modules/string-utils"),i=e("../../../shared/modules/transaction.utils"),c=e("../../../shared/constants/transaction"),u=e("../../../shared/lib/metamask-controller-utils"),l=e("../../../shared/lib/transactions-controller-utils"),d=e("../../../shared/modules/Numeric"),m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=f(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("./util")),p=e("./confirm-tx.util");function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(f=function(e){return e?a:t})(e)}function g(e,t){return e&&t[e.toLowerCase()]}async function T(e,t){let a=await async function(e){const t=m.getContractAtAddress(e);try{return(await t.symbol())[0]}catch(t){return s.default.warn(`symbol() call for token at address ${e} resulted in error:`,t),undefined}}(e);if(!a){const n=g(e,t);n&&(a=n.symbol)}return a}async function h(e,t){let a=await async function(e){const t=m.getContractAtAddress(e);try{const e=(await t.decimals())[0];return null==e?void 0:e.toString()}catch(t){return s.default.warn(`decimals() call for token at address ${e} resulted in error:`,t),undefined}}(e);if(!a||"0"===a){const s=g(e,t);var n;if(s)a=null===(n=s.decimals)||void 0===n?void 0:n.toString()}return a}async function E(e,t){let a,n;try{a=await T(e,t),n=await h(e,t)}catch(t){s.default.warn(`symbol() and decimal() calls for token at address ${e} resulted in error:`,t)}return{symbol:a||"",decimals:n}}function v(e={}){var t,a,n;const s=(null==e||null===(t=e.args)||void 0===t?void 0:t._to)||(null==e||null===(a=e.args)||void 0===a?void 0:a.to)||(null==e||null===(n=e.args)||void 0===n?void 0:n[0]);return null==s?void 0:s.toString().toLowerCase()}function _(e={}){var t,a,n,s;return(null==e||null===(t=e.args)||void 0===t||null===(a=t._tokenId)||void 0===a?void 0:a.toString())??(null==e||null===(n=e.args)||void 0===n||null===(s=n.id)||void 0===s?void 0:s.toString())}}}},{package:"$root$",file:"ui/helpers/utils/token-util.js"}],[4106,{"../../../app/scripts/lib/util":82,"../../../shared/constants/transaction":3417,"../../../shared/lib/fetch-with-cache":3419,"../../../shared/modules/contract-utils":3430,"eth-method-registry":2162,loglevel:2944},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getFourBytePrefix=function(e=""){const t=(0,r.addHexPrefix)(e);return t.slice(0,10)},a.getLatestSubmittedTxWithNonce=function(e=[],t="0x0"){if(!e.length)return{};return e.reduce(((e,a)=>{const{submittedTime:n,txParams:{nonce:s}={}}=a;return s===t?e.submittedTime?n>e.submittedTime?a:e:a:e}),{})},a.getMethodDataAsync=async function(e){try{const t=await async function(e){const t=await(0,c.default)(`https://www.4byte.directory/api/v1/signatures/?hex_signature=${e}`,{referrerPolicy:"no-referrer-when-downgrade",body:null,method:"GET",mode:"cors"});return t.results.sort(((e,t)=>new Date(e.created_at).getTime()<new Date(t.created_at).getTime()?-1:1)),t.results[0].text_signature}(e).catch((e=>(s.default.error(e),null)));if(l||(l=new n.MethodRegistry({provider:global.ethereumProvider})),!t)return{};const a=l.parse(t);return{name:a.name,params:a.args}}catch(e){return s.default.error(e),{}}},a.getStatusKey=function(e){const{txReceipt:{status:t}={},type:a,status:n}=e;if("0x0"===t)return o.TransactionStatus.failed;if(n===o.TransactionStatus.confirmed&&a===o.TransactionType.cancel)return o.TransactionGroupStatus.cancelled;return e.status},a.getTransactionTypeTitle=function(e,t,a="ETH"){switch(t){case o.TransactionType.tokenMethodTransfer:return e("transfer");case o.TransactionType.tokenMethodTransferFrom:return e("transferFrom");case o.TransactionType.tokenMethodSafeTransferFrom:return e("safeTransferFrom");case o.TransactionType.tokenMethodApprove:return e("approve");case o.TransactionType.tokenMethodSetApprovalForAll:return e("setApprovalForAll");case o.TransactionType.simpleSend:return e("sendingNativeAsset",[a]);case o.TransactionType.contractInteraction:return e("contractInteraction");case o.TransactionType.deployContract:return e("contractDeployment");case o.TransactionType.swap:return e("swap");case o.TransactionType.swapApproval:return e("swapApproval");default:throw new Error(`Unrecognized transaction type: ${t}`)}},a.isLegacyTransaction=function(e){return(null==e?void 0:e.type)===o.TransactionEnvelopeType.legacy},a.isSmartContractAddress=async function(e){const{isContractAddress:t}=await(0,i.readAddressAsContract)(global.eth,e);return t},a.isTokenMethodAction=function(e){return[o.TransactionType.tokenMethodTransfer,o.TransactionType.tokenMethodApprove,o.TransactionType.tokenMethodSetApprovalForAll,o.TransactionType.tokenMethodTransferFrom,o.TransactionType.tokenMethodSafeTransferFrom].includes(e)};var n=e("eth-method-registry"),s=u(e("loglevel")),r=e("../../../app/scripts/lib/util"),o=e("../../../shared/constants/transaction"),i=e("../../../shared/modules/contract-utils"),c=u(e("../../../shared/lib/fetch-with-cache"));function u(e){return e&&e.__esModule?e:{default:e}}let l}}},{package:"$root$",file:"ui/helpers/utils/transactions.util.js"}],[4107,{"../../../shared/modules/transaction.utils":3444,"./util":4108,loglevel:2944},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(e,t,a,n,i,c,u,l){s.default.debug("tx-helper called with params:"),s.default.debug({unapprovedTxs:e,unapprovedMsgs:t,personalMsgs:a,decryptMsgs:n,encryptionPublicKeyMsgs:i,typedMessages:c,networkId:u,chainId:l});const d=u?(0,o.valuesFor)(e).filter((e=>(0,r.transactionMatchesNetwork)(e,l,u))):(0,o.valuesFor)(e);s.default.debug(`tx helper found ${d.length} unapproved txs`);const m=(0,o.valuesFor)(t);s.default.debug(`tx helper found ${m.length} unsigned messages`);let p=d.concat(m);const f=(0,o.valuesFor)(a);s.default.debug(`tx helper found ${f.length} unsigned personal messages`),p=p.concat(f);const g=(0,o.valuesFor)(n);s.default.debug(`tx helper found ${g.length} decrypt requests`),p=p.concat(g);const T=(0,o.valuesFor)(i);s.default.debug(`tx helper found ${T.length} encryptionPublicKey requests`),p=p.concat(T);const h=(0,o.valuesFor)(c);return s.default.debug(`tx helper found ${h.length} unsigned typed messages`),p=p.concat(h),p=p.sort(((e,t)=>e.time-t.time)),p};var n,s=(n=e("loglevel"))&&n.__esModule?n:{default:n},r=e("../../../shared/modules/transaction.utils"),o=e("./util")}}},{package:"$root$",file:"ui/helpers/utils/tx-helper.ts"}],[4109,{"../../../app/scripts/lib/util":82,"../../../shared/constants/app":3401},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=e("../../../shared/constants/app"),s=e("../../../app/scripts/lib/util");var r=class{static async checkStatus(){const e=(0,s.getEnvironmentType)()===n.ENVIRONMENT_TYPE_POPUP,t=(0,s.getPlatform)()===(n.PLATFORM_FIREFOX||n.PLATFORM_BRAVE),a=(await window.navigator.mediaDevices.enumerateDevices()).filter((e=>"videoinput"===e.kind)),r=a.length>0,o=a.some((e=>e.label&&e.label.length>0));if(r){let a=!0;return(t&&e||e&&!o)&&(a=!1),{permissions:o,environmentReady:a}}const i=new Error("No webcam found");throw i.type="NO_WEBCAM_FOUND",i}};a.default=r}}},{package:"$root$",file:"ui/helpers/utils/webcam-utils.js"}],[4110,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.openWindow=void 0;a.openWindow=(e,t)=>{window.open(e,t||"_blank","noopener")}}}},{package:"$root$",file:"ui/helpers/utils/window.ts"}],[4111,{"../../../shared/constants/network":3409,"../../selectors":4436,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=e("react"),s=e("react-redux"),r=e("../../../shared/constants/network"),o=e("../../selectors");var i=()=>{const e=(0,s.useSelector)(o.getCurrentChainId),t=(0,n.useCallback)((e=>{switch(e){case r.CHAIN_IDS.GOERLI:return"https://goerli-faucet.slock.it/";case r.CHAIN_IDS.SEPOLIA:return"https://faucet.sepolia.dev/";default:return"https://portfolio.metamask.io/buy?metamaskEntry=ext_buy_button"}}),[]);return{openBuyCryptoInPdapp:(0,n.useCallback)((()=>{const a=t(e);global.platform.openTab({url:a})}),[]),getBuyURI:t}};a.default=i}}},{package:"$root$",file:"ui/hooks/experiences/useRamps.ts"}],[4112,{"../../../shared/constants/gas":3404,"../../../shared/modules/conversion.utils":3431,"../../../shared/modules/gas.utils":3434,"../../helpers/constants/common":4068,"../../helpers/utils/transactions.util":4106,"../../selectors":4436,"../useCurrencyDisplay":4124,"../useUserPreferencedCurrency":4151,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useGasEstimates=function({editGasMode:e,gasEstimateType:t,gasFeeEstimates:a,gasLimit:m,gasPrice:p,maxFeePerGas:f,maxPriorityFeePerGas:g,minimumGasLimit:T,transaction:h}){const E=(0,n.useSelector)(i.checkNetworkAndAccountSupports1559)&&!(0,c.isLegacyTransaction)(null==h?void 0:h.txParams),{currency:v,numberOfDecimals:_}=(0,l.useUserPreferencedCurrency)(o.PRIMARY);let y={gasLimit:(0,d.decimalToHex)(m)};y=E?{...y,maxFeePerGas:(0,d.decGWEIToHexWEI)(f||p||"0"),maxPriorityFeePerGas:(0,d.decGWEIToHexWEI)(g||f||p||"0"),baseFeePerGas:(0,d.decGWEIToHexWEI)(a.estimatedBaseFee??"0")}:{...y,gasPrice:t===s.GasEstimateTypes.none?"0x0":(0,d.decGWEIToHexWEI)(p)};const S=(0,r.getMaximumGasTotalInHexWei)(y);e===s.EditGasModes.swaps&&(y={...y,gasLimit:T});const k=(0,r.getMinimumGasTotalInHexWei)(y),[A]=(0,u.useCurrencyDisplay)(k,{numberOfDecimals:_,currency:v});return{estimatedMinimumNative:A,maximumCostInHexWei:S,minimumCostInHexWei:k}};var n=e("react-redux"),s=e("../../../shared/constants/gas"),r=e("../../../shared/modules/gas.utils"),o=e("../../helpers/constants/common"),i=e("../../selectors"),c=e("../../helpers/utils/transactions.util"),u=e("../useCurrencyDisplay"),l=e("../useUserPreferencedCurrency"),d=e("../../../shared/modules/conversion.utils")}}},{package:"$root$",file:"ui/hooks/gasFeeInput/useGasEstimates.js"}],[4113,{"../../../shared/constants/gas":3404,"../../../shared/modules/Numeric":3427,"../../helpers/constants/gas":4072,"../../helpers/utils/transactions.util":4106,"../../helpers/utils/util":4108,"../../selectors":4436,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useGasFeeErrors=function({gasEstimateType:e,gasFeeEstimates:t,isGasEstimatesLoading:a,gasLimit:m,gasPrice:p,maxPriorityFeePerGas:f,maxFeePerGas:g,minimumCostInHexWei:T,minimumGasLimit:h,transaction:E}){const v=(0,s.useSelector)(o.checkNetworkAndAccountSupports1559)&&!(0,i.isLegacyTransaction)(null==E?void 0:E.txParams),_=e===r.GasEstimateTypes.feeMarket,y=((e,t)=>{if(new l.Numeric(e,10).lessThan(new l.Numeric(t||r.GAS_LIMITS.SIMPLE,16)))return u.GAS_FORM_ERRORS.GAS_LIMIT_OUT_OF_BOUNDS;return undefined})(m,h),S=((e,t)=>{if(!t)return undefined;if((0,c.bnLessThan)(e,0))return u.GAS_FORM_ERRORS.MAX_PRIORITY_FEE_BELOW_MINIMUM;return undefined})(f,v),k=((e,t,a,n)=>{if(t||!n)return undefined;if((0,c.bnGreaterThan)(a,e))return u.GAS_FORM_ERRORS.MAX_FEE_IMBALANCE;return undefined})(g,S,f,v),A=((e,t,a,n)=>{var s;if(a&&e)return undefined;if((!a||null!=n&&null!==(s=n.txParams)&&void 0!==s&&s.gasPrice)&&(0,c.bnLessThan)(t,0))return u.GAS_FORM_ERRORS.GAS_PRICE_TOO_LOW;return undefined})(_,p,v,E),w=((e,t,a,n,s)=>{var r;if(!s||!t||a)return undefined;if((0,c.bnLessThan)(n,null==e||null===(r=e.low)||void 0===r?void 0:r.suggestedMaxPriorityFeePerGas))return u.GAS_FORM_ERRORS.MAX_PRIORITY_FEE_TOO_LOW;if(null!=e&&e.high&&(0,c.bnGreaterThan)(n,1.5*e.high.suggestedMaxPriorityFeePerGas))return u.GAS_FORM_ERRORS.MAX_PRIORITY_FEE_HIGH_WARNING;return undefined})(t,_,a,f,v),b=((e,t,a,n,s,r,o)=>{var i;if(s||n||!a||!o||t)return undefined;if((0,c.bnLessThan)(r,null==e||null===(i=e.low)||void 0===i?void 0:i.suggestedMaxFeePerGas))return u.GAS_FORM_ERRORS.MAX_FEE_TOO_LOW;if(null!=e&&e.high&&(0,c.bnGreaterThan)(r,e.high.suggestedMaxFeePerGas*d))return u.GAS_FORM_ERRORS.MAX_FEE_HIGH_WARNING;return undefined})(t,a,_,k,S,g,v),N=(0,n.useMemo)((()=>{const e={};return y&&(e.gasLimit=y),S&&(e.maxPriorityFee=S),k&&(e.maxFee=k),A&&(e.gasPrice=A),e}),[y,S,k,A]),O=(0,n.useMemo)((()=>{const e={};return w&&(e.maxPriorityFee=w),b&&(e.maxFee=b),e}),[w,b]),C=Boolean(Object.keys(N).length),I=(0,n.useMemo)((()=>({...O,...N})),[N,O]),{balance:P}=(0,s.useSelector)(o.getSelectedAccount,s.shallowEqual),R=((e,t,a)=>{var n;if(e===undefined||a===undefined)return!1;const s=new l.Numeric(e,16).add(new l.Numeric((null==t||null===(n=t.txParams)||void 0===n?void 0:n.value)||"0x0",16)),r=new l.Numeric(a,16);return s.greaterThan(r)})(T,E,P);return{gasErrors:I,hasGasErrors:C,balanceError:R,hasSimulationError:Boolean(null==E?void 0:E.simulationFails)}};var n=e("react"),s=e("react-redux"),r=e("../../../shared/constants/gas"),o=e("../../selectors"),i=e("../../helpers/utils/transactions.util"),c=e("../../helpers/utils/util"),u=e("../../helpers/constants/gas"),l=e("../../../shared/modules/Numeric");const d=1.5}}},{package:"$root$",file:"ui/hooks/gasFeeInput/useGasFeeErrors.js"}],[4114,{"../../../shared/constants/gas":3404,"../../../shared/modules/conversion.utils":3431,"../../helpers/constants/gas":4072,"../../helpers/utils/gas":4093,"../../helpers/utils/transactions.util":4106,"../../selectors":4436,"../useGasFeeEstimates":4128,"./useGasEstimates":4112,"./useGasFeeErrors":4113,"./useGasPriceInput":4115,"./useMaxFeePerGasInput":4116,"./useMaxPriorityFeePerGasInput":4117,"./useTransactionFunctions":4118,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useGasFeeInputs=function(e=r.GasRecommendations.medium,t,a="0x5208",E=r.EditGasModes.modifyInPlace){const v={txParams:null==t?void 0:t.txParams,id:null==t?void 0:t.id,userFeeLevel:null==t?void 0:t.userFeeLevel,originalGasEstimate:null==t?void 0:t.originalGasEstimate,userEditedGasLimit:null==t?void 0:t.userEditedGasLimit};null!=t&&t.previousGas&&(v.previousGas=null==t?void 0:t.previousGas);const[_,y]=(0,n.useState)(v),S=(0,l.editGasModeIsSpeedUpOrCancel)(E)?_:t,k=(0,s.useSelector)(i.checkNetworkAndAccountSupports1559)&&!(0,c.isLegacyTransaction)(null==S?void 0:S.txParams),{gasEstimateType:A,gasFeeEstimates:w,isGasEstimatesLoading:b,isNetworkBusy:N}=(0,u.useGasFeeEstimates)(),O=(0,s.useSelector)(i.getAdvancedInlineGasShown),[C,I]=(0,n.useState)((()=>{var t,a;return O&&null!=S&&null!==(t=S.txParams)&&void 0!==t&&t.maxPriorityFeePerGas&&null!=S&&null!==(a=S.txParams)&&void 0!==a&&a.maxFeePerGas?null:S?(null==S?void 0:S.userFeeLevel)||null:e})),[P,R]=(0,n.useState)((()=>C||r.PriorityLevels.custom)),[M,x]=(0,n.useState)((()=>{var e;return Number((0,d.hexToDecimal)((null==S||null===(e=S.txParams)||void 0===e?void 0:e.gas)??"0x0"))})),F=Number((0,d.hexToDecimal)(null==S?void 0:S.originalGasEstimate));(0,n.useEffect)((()=>{var e;k&&(null!=S&&S.userFeeLevel&&(R(null==S?void 0:S.userFeeLevel),I(null==S?void 0:S.userFeeLevel)),x(Number((0,d.hexToDecimal)((null==S||null===(e=S.txParams)||void 0===e?void 0:e.gas)??"0x0"))))}),[R,x,I,k,S]);const{gasPrice:D,setGasPrice:G,setGasPriceHasBeenManuallySet:U}=(0,p.useGasPriceInput)({estimateToUse:C,gasEstimateType:A,gasFeeEstimates:w,transaction:S}),{maxFeePerGas:L,setMaxFeePerGas:j}=(0,f.useMaxFeePerGasInput)({estimateToUse:C,gasEstimateType:A,gasFeeEstimates:w,transaction:S}),{maxPriorityFeePerGas:$,setMaxPriorityFeePerGas:H}=(0,g.useMaxPriorityFeePerGasInput)({estimateToUse:C,gasEstimateType:A,gasFeeEstimates:w,transaction:S}),{estimatedMinimumNative:W,maximumCostInHexWei:B,minimumCostInHexWei:q}=(0,T.useGasEstimates)({editGasMode:E,gasEstimateType:A,gasFeeEstimates:w,gasLimit:M,gasPrice:D,maxFeePerGas:L,maxPriorityFeePerGas:$,minimumGasLimit:a,transaction:S}),{balanceError:V,gasErrors:K,hasGasErrors:Y,hasSimulationError:X}=(0,m.useGasFeeErrors)({gasEstimateType:A,gasFeeEstimates:w,isGasEstimatesLoading:b,gasLimit:M,gasPrice:D,maxPriorityFeePerGas:$,maxFeePerGas:L,minimumCostInHexWei:q,minimumGasLimit:a,transaction:S}),Q=(0,n.useCallback)((()=>{if(K.gasLimit===o.GAS_FORM_ERRORS.GAS_LIMIT_OUT_OF_BOUNDS){var e;const t=(0,d.hexToDecimal)(null==S||null===(e=S.txParams)||void 0===e?void 0:e.gas),n=(0,d.hexToDecimal)(a);x(t>n?t:n)}}),[a,K.gasLimit,S]),{cancelTransaction:z,speedUpTransaction:Z,updateTransaction:J,updateTransactionToTenPercentIncreasedGasFee:ee,updateTransactionUsingDAPPSuggestedValues:te,updateTransactionUsingEstimate:ae}=(0,h.useTransactionFunctions)({defaultEstimateToUse:e,editGasMode:E,gasFeeEstimates:w,gasLimit:M,maxPriorityFeePerGas:$,minimumGasLimit:a,transaction:S,setRetryTxMeta:y}),ne=(0,n.useCallback)((()=>{I(r.CUSTOM_GAS_ESTIMATE),Q(),G(D),x(M),j(L),H($),U(!0),R("custom")}),[I,Q,G,D,x,M,j,L,H,$,U]);return{transaction:S,maxFeePerGas:L,maxPriorityFeePerGas:$,gasPrice:D,setGasPrice:G,gasLimit:M,setGasLimit:x,properGasLimit:F,editGasMode:E,estimateToUse:C,estimatedMinimumNative:W,maximumCostInHexWei:B,minimumCostInHexWei:q,estimateUsed:P,gasFeeEstimates:w,isNetworkBusy:N,onManualChange:ne,balanceError:V,gasErrors:K,hasGasErrors:Y,hasSimulationError:X,minimumGasLimitDec:(0,d.hexToDecimal)(a),supportsEIP1559:k,cancelTransaction:z,speedUpTransaction:Z,updateTransaction:J,updateTransactionToTenPercentIncreasedGasFee:ee,updateTransactionUsingDAPPSuggestedValues:te,updateTransactionUsingEstimate:ae}};var n=e("react"),s=e("react-redux"),r=e("../../../shared/constants/gas"),o=e("../../helpers/constants/gas"),i=e("../../selectors"),c=e("../../helpers/utils/transactions.util"),u=e("../useGasFeeEstimates"),l=e("../../helpers/utils/gas"),d=e("../../../shared/modules/conversion.utils"),m=e("./useGasFeeErrors"),p=e("./useGasPriceInput"),f=e("./useMaxFeePerGasInput"),g=e("./useMaxPriorityFeePerGasInput"),T=e("./useGasEstimates"),h=e("./useTransactionFunctions")}}},{package:"$root$",file:"ui/hooks/gasFeeInput/useGasFeeInputs.js"}],[4115,{"../../../shared/constants/gas":3404,"../../../shared/modules/conversion.utils":3431,"../../helpers/utils/transactions.util":4106,"./utils":4119,lodash:2932,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useGasPriceInput=function({estimateToUse:e,gasEstimateType:t,gasFeeEstimates:a,transaction:l}){const[d,m]=(0,n.useState)((null==l?void 0:l.userFeeLevel)===r.CUSTOM_GAS_ESTIMATE),[p,f]=(0,n.useState)((()=>{const{gasPrice:e}=(null==l?void 0:l.txParams)||{};return e&&(0,c.feeParamsAreCustom)(l)?Number((0,i.hexWEIToDecGWEI)(e)):null})),[g]=(0,n.useState)(a),T=(0,s.isEqual)(g,a);return{gasPrice:null!==p&&(d||T||(0,o.isLegacyTransaction)(null==l?void 0:l.txParams))?p:u(a,t,e),setGasPrice:f,setGasPriceHasBeenManuallySet:m}};var n=e("react"),s=e("lodash"),r=e("../../../shared/constants/gas"),o=e("../../helpers/utils/transactions.util"),i=e("../../../shared/modules/conversion.utils"),c=e("./utils");function u(e,t,a){return t===r.GasEstimateTypes.legacy?(null==e?void 0:e[a])??"0":t===r.GasEstimateTypes.ethGasPrice?(null==e?void 0:e.gasPrice)??"0":"0"}}}},{package:"$root$",file:"ui/hooks/gasFeeInput/useGasPriceInput.js"}],[4116,{"../../../shared/modules/conversion.utils":3431,"../../helpers/utils/transactions.util":4106,"../../selectors":4436,"./utils":4119,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useMaxFeePerGasInput=function({estimateToUse:e,gasEstimateType:t,gasFeeEstimates:a,transaction:u}){const l=(0,s.useSelector)(r.checkNetworkAndAccountSupports1559)&&!(0,o.isLegacyTransaction)(null==u?void 0:u.txParams),d=l?((e,t)=>{if(null!=t&&t[null==e?void 0:e.userFeeLevel])return t[e.userFeeLevel].suggestedMaxFeePerGas;const{maxFeePerGas:a,gasPrice:n}=(null==e?void 0:e.txParams)||{};return Number((0,i.hexWEIToDecGWEI)(a||n))})(u,a):0,[m,p]=(0,n.useState)((()=>d&&(0,c.feeParamsAreCustom)(u)?d:null));(0,n.useEffect)((()=>{l&&d&&p(d)}),[d,p,l]);return{maxFeePerGas:m??(0,c.getGasFeeEstimate)("suggestedMaxFeePerGas",a,t,e,d||0),setMaxFeePerGas:p}};var n=e("react"),s=e("react-redux"),r=e("../../selectors"),o=e("../../helpers/utils/transactions.util"),i=e("../../../shared/modules/conversion.utils"),c=e("./utils")}}},{package:"$root$",file:"ui/hooks/gasFeeInput/useMaxFeePerGasInput.js"}],[4117,{"../../../shared/modules/conversion.utils":3431,"../../helpers/utils/transactions.util":4106,"../../selectors":4436,"./utils":4119,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useMaxPriorityFeePerGasInput=function({estimateToUse:e,gasEstimateType:t,gasFeeEstimates:a,transaction:l}){const d=(0,n.useSelector)(r.checkNetworkAndAccountSupports1559)&&!(0,o.isLegacyTransaction)(null==l?void 0:l.txParams),m=d?((e,t)=>{if(null!=t&&t[null==e?void 0:e.userFeeLevel])return t[e.userFeeLevel].suggestedMaxPriorityFeePerGas;const{maxPriorityFeePerGas:a,maxFeePerGas:n,gasPrice:s}=(null==e?void 0:e.txParams)||{},r=a||n||s;return r?Number((0,i.hexWEIToDecGWEI)(r)):null})(l,a):null,[p,f]=(0,s.useState)((()=>!u(m)&&(0,c.feeParamsAreCustom)(l)?m:null));(0,s.useEffect)((()=>{d&&!u(m)&&f(m)}),[m,f,d]);return{maxPriorityFeePerGas:p??(0,c.getGasFeeEstimate)("suggestedMaxPriorityFeePerGas",a,t,e,m||0),setMaxPriorityFeePerGas:f}};var n=e("react-redux"),s=e("react"),r=e("../../selectors"),o=e("../../helpers/utils/transactions.util"),i=e("../../../shared/modules/conversion.utils"),c=e("./utils");const u=e=>null===e||e===undefined}}},{package:"$root$",file:"ui/hooks/gasFeeInput/useMaxPriorityFeePerGasInput.js"}],[4118,{"../../../shared/constants/gas":3404,"../../../shared/modules/conversion.utils":3431,"../../helpers/utils/gas":4093,"../../store/actions":4443,"bignumber.js":1853,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useTransactionFunctions=void 0;var n,s=e("react"),r=e("react-redux"),o=(n=e("bignumber.js"))&&n.__esModule?n:{default:n},i=e("../../../shared/constants/gas"),c=e("../../helpers/utils/gas"),u=e("../../store/actions"),l=e("../../../shared/modules/conversion.utils");a.useTransactionFunctions=({defaultEstimateToUse:e,editGasMode:t,estimatedBaseFee:a,gasFeeEstimates:n,gasLimit:d,maxPriorityFeePerGas:m,transaction:p,setRetryTxMeta:f})=>{const g=(0,r.useDispatch)(),T=(0,s.useCallback)((()=>{if(t!==i.EditGasModes.cancel&&t!==i.EditGasModes.speedUp||p.previousGas)return{};const{maxFeePerGas:e,maxPriorityFeePerGas:a,gasLimit:n}=(null==p?void 0:p.txParams)??{};return{previousGas:{maxFeePerGas:e,maxPriorityFeePerGas:a,gasLimit:n}}}),[t,null==p?void 0:p.previousGas,null==p?void 0:p.txParams]),h=(0,s.useCallback)((async({estimateUsed:a,gasLimit:n,maxFeePerGas:s,maxPriorityFeePerGas:r,estimateSuggested:o})=>{const h={gas:(0,l.decimalToHex)(n||d),gasLimit:(0,l.decimalToHex)(n||d),estimateSuggested:o||e,estimateUsed:a};s&&(h.maxFeePerGas=s),r&&(h.maxPriorityFeePerGas=r||(0,l.decGWEIToHexWEI)(m));const E=T(),v={...p,userFeeLevel:a||i.PriorityLevels.custom,txParams:{...p.txParams,...h},...E};t===i.EditGasModes.swaps?(g((0,u.updateSwapsUserFeeLevel)(a||i.PriorityLevels.custom)),g((0,u.updateCustomSwapsEIP1559GasParams)(h))):(0,c.editGasModeIsSpeedUpOrCancel)(t)?f(v):(h.userEditedGasLimit=v.userEditedGasLimit,h.userFeeLevel=v.userFeeLevel,E&&E.previousGas&&await g((0,u.updatePreviousGasParams)(v.id,E.previousGas)),await g((0,u.updateTransactionGasFees)(v.id,h)))}),[e,g,t,d,T,m,p,f]),E=(0,s.useCallback)((()=>{g((0,u.createCancelTransaction)(p.id,p.txParams,{estimatedBaseFee:a}))}),[g,a,p]),v=(0,s.useCallback)((()=>{g((0,u.createSpeedUpTransaction)(p.id,p.txParams,{estimatedBaseFee:a}))}),[g,a,p]),_=(0,s.useCallback)(((t=!1)=>{const{gas:a,maxFeePerGas:s,maxPriorityFeePerGas:r}=p.previousGas||p.txParams,u=new o.default(r,16).isZero()?(0,l.decGWEIToHexWEI)(n[e].suggestedMaxPriorityFeePerGas):r,d="0x0"===r?i.CUSTOM_GAS_ESTIMATE:i.PriorityLevels.tenPercentIncreased;h({estimateSuggested:t?e:i.PriorityLevels.tenPercentIncreased,estimateUsed:d,gasLimit:a,maxFeePerGas:(0,c.addTenPercentAndRound)(s),maxPriorityFeePerGas:(0,c.addTenPercentAndRound)(u)})}),[e,n,p,h]),y=(0,s.useCallback)((e=>{if(!n[e])return;const{suggestedMaxFeePerGas:t,suggestedMaxPriorityFeePerGas:a}=n[e];h({estimateUsed:e,maxFeePerGas:(0,l.decGWEIToHexWEI)(t),maxPriorityFeePerGas:(0,l.decGWEIToHexWEI)(a)})}),[n,h]),S=(0,s.useCallback)((()=>{const{maxFeePerGas:e,maxPriorityFeePerGas:t}=(null==p?void 0:p.dappSuggestedGasFees)??{};h({estimateUsed:i.PriorityLevels.dAppSuggested,maxFeePerGas:e,maxPriorityFeePerGas:t})}),[p,h]);return{cancelTransaction:E,speedUpTransaction:v,updateTransaction:h,updateTransactionToTenPercentIncreasedGasFee:_,updateTransactionUsingDAPPSuggestedValues:S,updateTransactionUsingEstimate:y}}}}},{package:"$root$",file:"ui/hooks/gasFeeInput/useTransactionFunctions.js"}],[4119,{"../../../shared/constants/gas":3404},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.feeParamsAreCustom=void 0,a.getGasFeeEstimate=function(e,t,a,s,r="0"){var o;return a===n.GasEstimateTypes.feeMarket?(null==t||null===(o=t[s])||void 0===o?void 0:o[e])??String(r):String(r)};var n=e("../../../shared/constants/gas");a.feeParamsAreCustom=e=>!(null!=e&&e.userFeeLevel)||(null==e?void 0:e.userFeeLevel)===n.CUSTOM_GAS_ESTIMATE}}},{package:"$root$",file:"ui/hooks/gasFeeInput/utils.js"}],[4120,{"../../shared/modules/hexstring-utils":3435,"../helpers/utils/util":4108,"../selectors":4436,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=e("react-redux"),s=e("../../shared/modules/hexstring-utils"),r=e("../selectors"),o=e("../helpers/utils/util");var i=e=>{var t,a;const i=(0,n.useSelector)(r.getAddressBook),c=(0,n.useSelector)(r.getMetaMaskIdentities),u=(0,n.useSelector)(r.getTokenList),l=(0,s.toChecksumHexAddress)(e);if(!e)return{};const d=i.find((e=>e.address===l));return null!=d&&d.name?{toName:d.name,isTrusted:!0}:null!==(t=c[e])&&void 0!==t&&t.name?{toName:c[e].name,isTrusted:!0}:null!==(a=u[null==e?void 0:e.toLowerCase()])&&void 0!==a&&a.name?{toName:u[null==e?void 0:e.toLowerCase()].name,isTrusted:!0}:{toName:(0,o.shortenAddress)(l),isTrusted:!1}};a.default=i}}},{package:"$root$",file:"ui/hooks/useAddressDetails.js"}],[4121,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useApproveTransaction=function(){const[e,t]=(0,n.useState)(!1);return{approveTransaction:(0,n.useCallback)((()=>t(!0)),[]),showCustomizeGasPopover:e,closeCustomizeGasPopover:()=>t(!1)}};var n=e("react")}}},{package:"$root$",file:"ui/hooks/useApproveTransaction.js"}],[4122,{"../../shared/modules/string-utils":3442,"../ducks/metamask/metamask":4062,"../helpers/utils/token-util":4105,"../store/actions":4443,"./usePrevious":4133,"./useTokenTracker":4145,lodash:2932,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useAssetDetails=function(e,t,a){const m=(0,r.useDispatch)(),p=(0,r.useSelector)(o.getNfts),f=(0,r.useSelector)(o.getTokens,n.isEqual).find((t=>(0,u.isEqualCaseInsensitive)(t.address,e))),[g,T]=(0,s.useState)(null),{tokensWithBalances:h}=(0,d.useTokenTracker)(f?[f]:[]),E=(0,l.usePrevious)(e),v=(0,l.usePrevious)(t),_=(0,l.usePrevious)(a),y=(0,l.usePrevious)(h);if((0,s.useEffect)((()=>{(e!==E||t!==v||a!==_||y&&y!==h)&&async function(){m((0,c.showLoadingIndication)());const n=await(0,i.getAssetDetails)(e,t,a,p);T(n),m((0,c.hideLoadingIndication)())}()}),[m,E,_,v,e,t,a,p,h,y]),g){const{standard:t,symbol:a,image:n,name:s,balance:r,tokenId:o,toAddress:i,tokenAmount:c,decimals:u}=g;return{toAddress:i,tokenId:o,decimals:u,tokenAmount:c,assetAddress:e,assetStandard:t,tokenSymbol:a??"",tokenImage:n,userBalance:r,assetName:s}}return{}};var n=e("lodash"),s=e("react"),r=e("react-redux"),o=e("../ducks/metamask/metamask"),i=e("../helpers/utils/token-util"),c=e("../store/actions"),u=e("../../shared/modules/string-utils"),l=e("./usePrevious"),d=e("./useTokenTracker")}}},{package:"$root$",file:"ui/hooks/useAssetDetails.js"}],[4123,{"../../shared/constants/time":3415,"./useTimeout":4141,"copy-to-clipboard":2032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useCopyToClipboard=function(e=c){const[t,a]=(0,s.useState)(!1),n=(0,i.useTimeout)((()=>{(0,r.default)(" "),a(!1)}),e,!1),o=(0,s.useCallback)((e=>{a(!0),n(),(0,r.default)(e)}),[n]);return[t,o]};var n,s=e("react"),r=(n=e("copy-to-clipboard"))&&n.__esModule?n:{default:n},o=e("../../shared/constants/time"),i=e("./useTimeout");const c=3*o.SECOND}}},{package:"$root$",file:"ui/hooks/useCopyToClipboard.js"}],[4124,{"../../shared/constants/common":3403,"../../shared/constants/network":3409,"../../shared/modules/Numeric":3427,"../../shared/modules/conversion.utils":3431,"../ducks/metamask/metamask":4062,"../helpers/utils/confirm-tx.util":4090,"../selectors":4436,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useCurrencyDisplay=function(e,{displayValue:t,prefix:a,numberOfDecimals:m,denomination:p,currency:f,...g}){const T=(0,s.useSelector)(o.getCurrentCurrency),h=(0,s.useSelector)(i.getNativeCurrency),E=(0,s.useSelector)(i.getConversionRate),v=f===T,_=(0,n.useMemo)((()=>t||(f===h||!v&&!h?new l.Numeric(e,16,d.EtherDenomination.WEI).toDenomination(p||d.EtherDenomination.ETH).round(m||2).toBase(10).toString():v&&E?(0,r.formatCurrency)((0,c.getValueFromWeiHex)({value:e,fromCurrency:h,toCurrency:f,conversionRate:E,numberOfDecimals:m||2,toDenomination:p}),f):null)),[e,h,E,t,m,p,f,v]);let y;if(!g.hideLabel){const e=Object.values(u.TEST_NETWORK_TICKER_MAP).includes(f)?f:null==f?void 0:f.toUpperCase();y=g.suffix||e}return[`${a||""}${_}${y?` ${y}`:""}`,{prefix:a,value:_,suffix:y}]};var n=e("react"),s=e("react-redux"),r=e("../helpers/utils/confirm-tx.util"),o=e("../selectors"),i=e("../ducks/metamask/metamask"),c=e("../../shared/modules/conversion.utils"),u=e("../../shared/constants/network"),l=e("../../shared/modules/Numeric"),d=e("../../shared/constants/common")}}},{package:"$root$",file:"ui/hooks/useCurrencyDisplay.js"}],[4125,{"../../shared/constants/swaps":3413,"../../shared/modules/string-utils":3442,"../ducks/metamask/metamask":4062,"../helpers/constants/routes":4074,"../selectors":4436,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useCurrentAsset=function(){var e;const t=(0,s.useRouteMatch)({path:`${i.ASSET_ROUTE}/:asset`,exact:!0,strict:!0}),a=null==t||null===(e=t.params)||void 0===e?void 0:e.asset,l=(0,n.useSelector)(r.getTokens),d=a&&l.find((({address:e})=>(0,u.isEqualCaseInsensitive)(e,a))),m=(0,n.useSelector)(o.getCurrentChainId);return d??(c.SWAPS_CHAINID_DEFAULT_TOKEN_MAP[m]||c.ETH_SWAPS_TOKEN_OBJECT)};var n=e("react-redux"),s=e("react-router-dom"),r=e("../ducks/metamask/metamask"),o=e("../selectors"),i=e("../helpers/constants/routes"),c=e("../../shared/constants/swaps"),u=e("../../shared/modules/string-utils")}}},{package:"$root$",file:"ui/hooks/useCurrentAsset.js"}],[4126,{lodash:2932,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useEqualityCheck=function(e,t=s.isEqual){const[a,r]=(0,n.useState)(e);return(0,n.useLayoutEffect)((()=>{t(e,a)||r(e)}),[e,t,a]),a};var n=e("react"),s=e("lodash")}}},{package:"$root$",file:"ui/hooks/useEqualityCheck.js"}],[4127,{"../../shared/modules/conversion.utils":3431,"../ducks/metamask/metamask":4062,"../helpers/utils/confirm-tx.util":4090,"../selectors":4436,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useEthFiatAmount=function(e,t={},a){const u=(0,s.useSelector)(i.getConversionRate),l=(0,s.useSelector)(r.getCurrentCurrency),d=(0,s.useSelector)(r.getShouldShowFiat),m=t.showFiat??d,p=(0,n.useMemo)((()=>(0,c.decEthToConvertedCurrency)(e,l,u)),[u,l,e]);if(!m||"ETH"===l.toUpperCase()||u<=0||e===undefined)return undefined;return a?(0,o.formatCurrency)(p,l):`${(0,o.formatCurrency)(p,l)} ${l.toUpperCase()}`};var n=e("react"),s=e("react-redux"),r=e("../selectors"),o=e("../helpers/utils/confirm-tx.util"),i=e("../ducks/metamask/metamask"),c=e("../../shared/modules/conversion.utils")}}},{package:"$root$",file:"ui/hooks/useEthFiatAmount.js"}],[4128,{"../ducks/metamask/metamask":4062,"./useSafeGasEstimatePolling":4135,"lodash/isEqual":2918,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useGasFeeEstimates=function(){const e=(0,r.useSelector)(o.getGasEstimateType),t=(0,r.useSelector)(o.getGasFeeEstimates,s.default),a=(0,r.useSelector)(o.getIsGasEstimatesLoading),n=(0,r.useSelector)(o.getIsNetworkBusy);return(0,i.useSafeGasEstimatePolling)(),{gasFeeEstimates:t,gasEstimateType:e,isGasEstimatesLoading:a,isNetworkBusy:n}};var n,s=(n=e("lodash/isEqual"))&&n.__esModule?n:{default:n},r=e("react-redux"),o=e("../ducks/metamask/metamask"),i=e("./useSafeGasEstimatePolling")}}},{package:"$root$",file:"ui/hooks/useGasFeeEstimates.js"}],[4129,{"../contexts/i18n":4047,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useI18nContext=function(){return(0,n.useContext)(s.I18nContext)};var n=e("react"),s=e("../contexts/i18n")}}},{package:"$root$",file:"ui/hooks/useI18nContext.js"}],[4130,{"../../shared/modules/conversion.utils":3431,"../../shared/modules/transaction.utils":3444,"../helpers/utils/gas":4093,"./useGasFeeEstimates":4128,"bignumber.js":1853,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useIncrementedGasFees=function(e){const{gasFeeEstimates:t={}}=(0,u.useGasFeeEstimates)();return(0,r.useMemo)((()=>{var a,n,s,r;const o={gasLimit:null===(a=e.txParams)||void 0===a?void 0:a.gas,gas:null===(n=e.txParams)||void 0===n?void 0:n.gas},c=(null==t||null===(s=t.medium)||void 0===s?void 0:s.suggestedMaxFeePerGas)??"0",u=(null==t||null===(r=t.medium)||void 0===r?void 0:r.suggestedMaxPriorityFeePerGas)??"0";if((0,i.isEIP1559Transaction)(e)){var d,m;const t=null===(d=e.txParams)||void 0===d?void 0:d.maxFeePerGas,a=null===(m=e.txParams)||void 0===m?void 0:m.maxPriorityFeePerGas;o.maxFeePerGas=t===undefined||t.startsWith("-")?"0x0":l(t,c),o.maxPriorityFeePerGas=a===undefined||a.startsWith("-")?"0x0":l(a,u)}else{var p;const t=null===(p=e.txParams)||void 0===p?void 0:p.gasPrice;o.gasPrice=t===undefined||t.startsWith("-")?"0x0":l(t,c)}return o}),[e,t])};var n,s=(n=e("bignumber.js"))&&n.__esModule?n:{default:n},r=e("react"),o=e("../../shared/modules/conversion.utils"),i=e("../../shared/modules/transaction.utils"),c=e("../helpers/utils/gas"),u=e("./useGasFeeEstimates");function l(e,t){const a=(0,c.addTenPercentAndRound)(e),n=(0,o.decGWEIToHexWEI)(t);return new s.default(a,16).greaterThan(new s.default(n,16))?a:n}}}},{package:"$root$",file:"ui/hooks/useIncrementedGasFees.js"}],[4131,{"../ducks/metamask/metamask":4062,"../selectors":4436,"./useI18nContext":4129,"./usePrevious":4133,lodash:2932,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useNftsCollections=function(){const e=(0,u.useI18nContext)(),t=e("nftsPreviouslyOwned"),a=e("unknownCollection"),[l,d]=(0,n.useState)({}),[m,p]=(0,n.useState)({collectionName:t,nfts:[]}),f=(0,s.useSelector)(o.getNfts),[g,T]=(0,n.useState)((()=>(null==f?void 0:f.length)>=0)),h=(0,s.useSelector)(i.getSelectedAddress),E=(0,s.useSelector)(i.getCurrentChainId),v=(0,s.useSelector)(o.getNftContracts),_=(0,c.usePrevious)(f),y=(0,c.usePrevious)(E),S=(0,c.usePrevious)(h);return(0,n.useEffect)((()=>{(0,r.isEqual)(_,f)&&(0,r.isEqual)(S,h)&&(0,r.isEqual)(y,E)||(()=>{if(T(!0),h===undefined||E===undefined)return;const e={},n={collectionName:t,nfts:[]};f.forEach((t=>{if(!1===(null==t?void 0:t.isCurrentlyOwned))n.nfts.push(t);else if(e[t.address])e[t.address].nfts.push(t);else{const n=v.find((({address:e})=>e===t.address));e[t.address]={collectionName:(null==n?void 0:n.name)||a,collectionImage:(null==n?void 0:n.logo)||t.image,nfts:[t]}}})),d(e),p(n),T(!1)})()}),[f,_,v,T,E,y,h,S]),{nftsLoading:g,collections:l,previouslyOwnedCollection:m}};var n=e("react"),s=e("react-redux"),r=e("lodash"),o=e("../ducks/metamask/metamask"),i=e("../selectors"),c=e("./usePrevious"),u=e("./useI18nContext")}}},{package:"$root$",file:"ui/hooks/useNftsCollections.js"}],[4132,{"../selectors":4436,"@metamask/subject-metadata-controller":1340,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useOriginMetadata=function(e){const t=(0,s.useSelector)((t=>(0,r.getTargetSubjectMetadata)(t,e)));if(!e)return null;let a=null;try{const t=new URL(e);a={host:t.host,hostname:t.hostname,origin:e,subjectType:n.SubjectType.Unknown}}catch(e){}if(t&&a)return{...a,...t};if(t)return t;return a};var n=e("@metamask/subject-metadata-controller"),s=e("react-redux"),r=e("../selectors")}}},{package:"$root$",file:"ui/hooks/useOriginMetadata.js"}],[4133,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.usePrevious=function(e){const t=(0,n.useRef)();return(0,n.useEffect)((()=>{t.current=e}),[e]),t.current};var n=e("react")}}},{package:"$root$",file:"ui/hooks/usePrevious.js"}],[4134,{"../ducks/history/history":4059,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useRouting=function(){const e=(0,s.useHistory)(),t=(0,r.useSelector)(o.getMostRecentOverviewPage);return{navigateToMostRecentOverviewPage:(0,n.useCallback)((()=>{e.push(t)}),[e,t])}};var n=e("react"),s=e("react-router-dom"),r=e("react-redux"),o=e("../ducks/history/history")}}},{package:"$root$",file:"ui/hooks/useRouting.js"}],[4135,{"../store/actions":4443,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useSafeGasEstimatePolling=function(){(0,n.useEffect)((()=>{let e,t=!0;const a=()=>{t=!1,e&&((0,s.disconnectGasFeeEstimatePoller)(e),(0,s.removePollingTokenFromAppState)(e))};return(0,s.getGasFeeEstimatesAndStartPolling)().then((a=>{t?(e=a,(0,s.addPollingTokenToAppState)(e)):((0,s.disconnectGasFeeEstimatePoller)(a),(0,s.removePollingTokenFromAppState)(e))})),window.addEventListener("beforeunload",a),()=>{a(),window.removeEventListener("beforeunload",a)}}),[])};var n=e("react"),s=e("../store/actions")}}},{package:"$root$",file:"ui/hooks/useSafeGasEstimatePolling.js"}],[4136,{"../helpers/constants/routes":4074,"../selectors":4436,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useSegmentContext=function(){const e=(0,s.useRouteMatch)({path:i,exact:!0,strict:!0}),t=((0,n.useSelector)(o.txDataSelector)||{}).origin,a=t?{url:t}:undefined;return{page:e?{path:e.path,title:r.PATH_NAME_MAP[e.path],url:e.path}:undefined,referrer:a}};var n=e("react-redux"),s=e("react-router-dom"),r=e("../helpers/constants/routes"),o=e("../selectors");const i=Object.keys(r.PATH_NAME_MAP)}}},{package:"$root$",file:"ui/hooks/useSegmentContext.js"}],[4137,{"../ducks/app/app":4054,"./useGasFeeEstimates":4128,lodash:2932,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useShouldAnimateGasEstimations=function(){const{isGasEstimatesLoading:e,gasFeeEstimates:t}=(0,i.useGasFeeEstimates)(),a=(0,s.useDispatch)(),c=(0,s.useSelector)(o.getGasLoadingAnimationIsShowing),u=(0,n.useRef)(t),l=!(0,r.isEqual)(u.current,t),d=(0,r.isEqual)(u.current,{});l&&(u.current=t);const m=e||l&&!d;(0,n.useEffect)((()=>{!1===c&&!0===m&&a((0,o.toggleGasLoadingAnimation)(!0))}),[a,c,m]),(0,n.useEffect)((()=>{let e;return c&&!m&&(e=setTimeout((()=>{a((0,o.toggleGasLoadingAnimation)(!1))}),2e3)),()=>{e&&clearTimeout(e)}}),[a,c,m])};var n=e("react"),s=e("react-redux"),r=e("lodash"),o=e("../ducks/app/app"),i=e("./useGasFeeEstimates")}}},{package:"$root$",file:"ui/hooks/useShouldAnimateGasEstimations.js"}],[4138,{"../../shared/constants/time":3415,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useShouldShowSpeedUp=function(e,t){const{transactions:a,hasRetried:r}=e,[o={}]=a,{submittedTime:i}=o,[c,u]=(0,n.useState)((()=>Date.now()-i>5e3&&t&&!r));return(0,n.useEffect)((()=>{let e;return r||!t||c||(Date.now()-i>5*s.SECOND?u(!0):e=setTimeout((()=>{u(!0),clearTimeout(e)}),5001-(Date.now()-i))),()=>{e&&clearTimeout(e)}}),[i,c,r,t]),c};var n=e("react"),s=e("../../shared/constants/time")}}},{package:"$root$",file:"ui/hooks/useShouldShowSpeedUp.js"}],[4139,{"../selectors":4436,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useSimulationFailureWarning=function(e){const t=(0,n.useSelector)(s.txDataSelector)||{},a=Boolean(t.simulationFails);return a&&!e};var n=e("react-redux"),s=e("../selectors")}}},{package:"$root$",file:"ui/hooks/useSimulationFailureWarning.js"}],[4140,{"../../shared/constants/transaction":3417,"../../shared/lib/transactions-controller-utils":3425,"../../shared/modules/swaps.utils":3443,"../selectors":4436,"./useTokenFiatAmount":4144,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useSwappedTokenValue=function(e,t){const{symbol:a,decimals:u,address:l}=t,{primaryTransaction:d,initialTransaction:m}=e,{type:p}=m,{from:f}=m.txParams||{},g=(0,n.useSelector)(i.getCurrentChainId),T=(null==t?void 0:t.symbol)===d.destinationTokenSymbol||(0,o.isSwapsDefaultTokenAddress)(t.address,g)&&(0,o.isSwapsDefaultTokenSymbol)(d.destinationTokenSymbol,g),h=p===r.TransactionType.swap&&T?(0,s.getSwapsTokensReceivedFromTxMeta)(d.destinationTokenSymbol,m,l,f,u,null,g):p===r.TransactionType.swap&&d.swapTokenValue,E="string"==typeof h&&-1===Math.sign(h),v=(0,c.useTokenFiatAmount)(l,h||"",a);return{swapTokenValue:h,swapTokenFiatAmount:h&&T&&v,isViewingReceivedTokenFromSwap:T,isNegative:E}};var n=e("react-redux"),s=e("../../shared/lib/transactions-controller-utils"),r=e("../../shared/constants/transaction"),o=e("../../shared/modules/swaps.utils"),i=e("../selectors"),c=e("./useTokenFiatAmount")}}},{package:"$root$",file:"ui/hooks/useSwappedTokenValue.js"}],[4141,{react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useTimeout=function(e,t,a=!0){const s=(0,n.useRef)(),[r,o]=(0,n.useState)(null);(0,n.useEffect)((()=>{s.current=e}),[e]),(0,n.useEffect)((()=>{if("start"!==r)return undefined;const e=setTimeout((()=>{s.current()}),t);return o(e),()=>{clearTimeout(r)}}),[t,r]);const i=(0,n.useCallback)((()=>{clearTimeout(r),o("start")}),[r]);a&&i();return i};var n=e("react")}}},{package:"$root$",file:"ui/hooks/useTimeout.js"}],[4142,{"../../shared/modules/transaction.utils":3444,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useTokenData=function(e,t=!0){return(0,n.useMemo)((()=>t&&e?(0,s.parseStandardTokenTransactionData)(e):null),[t,e])};var n=e("react"),s=e("../../shared/modules/transaction.utils")}}},{package:"$root$",file:"ui/hooks/useTokenData.js"}],[4143,{"../../shared/lib/metamask-controller-utils":3420,"../../shared/lib/transactions-controller-utils":3425,"./useTokenData":4142,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useTokenDisplayValue=function(e,t,a=!0){const i=(0,o.useTokenData)(e,a),c=(0,s.getTokenValueParam)(i),u=Boolean(a&&e&&t&&t.decimals&&c);return(0,n.useMemo)((()=>u?(0,r.calcTokenAmount)(c,t.decimals).toString(10):null),[u,c,t])};var n=e("react"),s=e("../../shared/lib/metamask-controller-utils"),r=e("../../shared/lib/transactions-controller-utils"),o=e("./useTokenData")}}},{package:"$root$",file:"ui/hooks/useTokenDisplayValue.js"}],[4144,{"../../shared/modules/string-utils":3442,"../ducks/metamask/metamask":4062,"../helpers/utils/token-util":4105,"../selectors":4436,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useTokenFiatAmount=function(e,t,a,u={},l){const d=(0,s.useSelector)(r.getTokenExchangeRates,s.shallowEqual),m=(0,s.useSelector)(i.getConversionRate),p=(0,s.useSelector)(r.getCurrentCurrency),f=(0,s.useSelector)(r.getShouldShowFiat),g=u.showFiat??f,T=Object.keys(d).find((t=>(0,c.isEqualCaseInsensitive)(t,e))),h=u.exchangeRate??(T&&d[T]),E=(0,n.useMemo)((()=>(0,o.getTokenFiatAmount)(h,m,p,t,a,!0,l)),[h,m,p,t,a,l]);if(!g||p.toUpperCase()===a)return undefined;return E};var n=e("react"),s=e("react-redux"),r=e("../selectors"),o=e("../helpers/utils/token-util"),i=e("../ducks/metamask/metamask"),c=e("../../shared/modules/string-utils")}}},{package:"$root$",file:"ui/hooks/useTokenFiatAmount.js"}],[4145,{"../../shared/constants/time":3415,"../../shared/modules/string-utils":3442,"../selectors":4436,"./useEqualityCheck":4126,"@metamask/eth-token-tracker":1200,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useTokenTracker=function(e,t=!1,a=!1){const n=(0,o.useSelector)(i.getCurrentChainId),d=(0,o.useSelector)(i.getSelectedAddress,o.shallowEqual),[m,p]=(0,s.useState)((()=>(null==e?void 0:e.length)>=0)),[f,g]=(0,s.useState)([]),[T,h]=(0,s.useState)(null),E=(0,s.useRef)(null),v=(0,l.useEqualityCheck)(e),_=(0,s.useCallback)((e=>{const t=(a?e.filter((e=>Number(e.balance)>0)):e).map((e=>{const t=v.find((t=>(0,u.isEqualCaseInsensitive)(t.address,e.address)));return{...e,isERC721:null==t?void 0:t.isERC721,image:null==t?void 0:t.image}}));g(t),p(!1),h(null)}),[a,v]),y=(0,s.useCallback)((e=>{h(e),p(!1)}),[]),S=(0,s.useCallback)((()=>{E.current&&(E.current.stop(),E.current.removeAllListeners("update"),E.current.removeAllListeners("error"),E.current=null)}),[]),k=(0,s.useCallback)(((e,a)=>{S(),E.current=new r.default({userAddress:e,provider:global.ethereumProvider,tokens:a,includeFailedTokens:t,pollingInterval:8*c.SECOND,balanceDecimals:5}),E.current.on("update",_),E.current.on("error",y),E.current.updateBalances()}),[_,t,y,S]);return(0,s.useEffect)((()=>S),[S]),(0,s.useEffect)((()=>{p(!0),d&&n!==undefined&&global.ethereumProvider?(0===v.length&&_([]),k(d,v)):S()}),[d,S,n,v,_,k]),{loading:m,tokensWithBalances:f,error:T}};var n,s=e("react"),r=(n=e("@metamask/eth-token-tracker"))&&n.__esModule?n:{default:n},o=e("react-redux"),i=e("../selectors"),c=e("../../shared/constants/time"),u=e("../../shared/modules/string-utils"),l=e("./useEqualityCheck")}}},{package:"$root$",file:"ui/hooks/useTokenTracker.js"}],[4146,{"../../shared/constants/network":3409,"../../shared/constants/swaps":3413,"../../shared/modules/hexstring-utils":3435,"../../shared/modules/swaps.utils":3443,"../ducks/metamask/metamask":4062,"../ducks/swaps/swaps":4066,"../helpers/utils/token-util":4105,"../selectors":4436,"./useEqualityCheck":4126,"@metamask/assets-controllers":1055,"bignumber.js":1853,lodash:2932,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getRenderableTokenData=E,a.useTokensToSearch=function({usersTokens:e=[],topTokens:t={},shuffledTokensList:a,tokenBucketPriority:n=g.TokenBucketPriority.owned}){const c=(0,r.useSelector)(l.getCurrentChainId),u=(0,r.useSelector)(l.getTokenExchangeRates,i.isEqual),f=(0,r.useSelector)(d.getConversionRate),T=(0,r.useSelector)(l.getCurrentCurrency),v=(0,r.useSelector)(l.getSwapsDefaultToken,r.shallowEqual),_=(0,r.useSelector)(l.getTokenList,i.isEqual),y=(0,h.useEqualityCheck)(t),S=(0,h.useEqualityCheck)(e),k=E(v,u,f,T,c,_),A=(0,h.useEqualityCheck)(k),w=(0,r.useSelector)(m.getSwapsTokens,i.isEqual)||[],b=w.length?w:[A,...a.filter((e=>e.symbol!==A.symbol))],N=(0,h.useEqualityCheck)(b);return(0,s.useMemo)((()=>{const e=S.reduce(((e,t)=>({...e,[t.address.toLowerCase()]:t})),{}),t={owned:[],top:[],others:[]};return(0,i.uniqBy)([A,...N,...S],(e=>e.address.toLowerCase())).forEach((a=>{const s=E({...e[a.address.toLowerCase()],...a},u,f,T,c,_);n===g.TokenBucketPriority.owned?(0,p.isSwapsDefaultTokenSymbol)(s.symbol,c)||e[a.address.toLowerCase()]?t.owned.push(s):y[a.address.toLowerCase()]?t.top[y[a.address.toLowerCase()].index]=s:t.others.push(s):y[a.address.toLowerCase()]?t.top[y[a.address.toLowerCase()].index]=s:(0,p.isSwapsDefaultTokenSymbol)(s.symbol,c)||e[a.address.toLowerCase()]?t.owned.push(s):t.others.push(s)})),t.owned=t.owned.sort((({rawFiat:e},{rawFiat:t})=>new o.default(e||0).gt(t||0)?-1:1)),t.top=t.top.filter(Boolean),n===g.TokenBucketPriority.owned?[...t.owned,...t.top,...t.others]:[...t.top,...t.owned,...t.others]}),[N,S,y,u,f,T,A,c,_,n])};var n,s=e("react"),r=e("react-redux"),o=(n=e("bignumber.js"))&&n.__esModule?n:{default:n},i=e("lodash"),c=e("@metamask/assets-controllers"),u=e("../helpers/utils/token-util"),l=e("../selectors"),d=e("../ducks/metamask/metamask"),m=e("../ducks/swaps/swaps"),p=e("../../shared/modules/swaps.utils"),f=e("../../shared/modules/hexstring-utils"),g=e("../../shared/constants/swaps"),T=e("../../shared/constants/network"),h=e("./useEqualityCheck");function E(e,t,a,n,s,r){var i,l;const{symbol:d,name:m,address:g,iconUrl:h,string:E,balance:v,decimals:_}=e;let y;(0,p.isSwapsDefaultTokenSymbol)(d,s)?y=1:E&&a>0&&(y=t[(0,f.toChecksumHexAddress)(g)]);const S=(0,u.getTokenFiatAmount)(y,a,n,E,d,!0)||"",k=S?(0,u.getTokenFiatAmount)(y,a,n,E,d,!1):"",A=s===T.CHAIN_IDS.GOERLI?T.CHAIN_IDS.MAINNET:s,w=(d===T.CURRENCY_SYMBOLS.ETH&&s===T.CHAIN_IDS.MAINNET||d===T.CURRENCY_SYMBOLS.ETH&&s===T.CHAIN_IDS.GOERLI||d===T.CURRENCY_SYMBOLS.BNB&&s===T.CHAIN_IDS.BSC||d===T.CURRENCY_SYMBOLS.MATIC&&s===T.CHAIN_IDS.POLYGON||d===T.CURRENCY_SYMBOLS.AVALANCHE&&s===T.CHAIN_IDS.AVALANCHE||d===T.CURRENCY_SYMBOLS.ETH&&s===T.CHAIN_IDS.OPTIMISM||d===T.CURRENCY_SYMBOLS.ETH&&s===T.CHAIN_IDS.ARBITRUM?h:(0,c.formatIconUrlWithProxy)({chainId:A,tokenAddress:g||""}))||(null==e?void 0:e.image);return{...e,primaryLabel:d,secondaryLabel:m||(null===(i=r[null==g?void 0:g.toLowerCase()])||void 0===i?void 0:i.name),rightPrimaryLabel:E&&`${new o.default(E).round(6).toString()} ${d}`,rightSecondaryLabel:S,iconUrl:w,identiconAddress:w?null:g,balance:v,decimals:_,name:m||(null===(l=r[null==g?void 0:g.toLowerCase()])||void 0===l?void 0:l.name),rawFiat:k}}}}},{package:"$root$",file:"ui/hooks/useTokensToSearch.js"}],[4147,{"../../shared/constants/transaction":3417,"../../shared/lib/metamask-controller-utils":3420,"../../shared/modules/string-utils":3442,"../ducks/metamask/metamask":4062,"../helpers/constants/common":4068,"../helpers/constants/transactions":4076,"../helpers/utils/common.util":4089,"../helpers/utils/token-util":4105,"../helpers/utils/transactions.util":4106,"../helpers/utils/util":4108,"../selectors/selectors":4439,"../store/actions":4443,"./useCurrencyDisplay":4124,"./useCurrentAsset":4125,"./useI18nContext":4129,"./useSwappedTokenValue":4140,"./useTokenData":4142,"./useTokenDisplayValue":4143,"./useTokenFiatAmount":4144,"./useUserPreferencedCurrency":4151,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useTransactionDisplayData=function(e){var t,a,b,N,O,C,I,P;const R=(0,n.useDispatch)(),M=(0,A.useCurrentAsset)(),x=(0,n.useSelector)(m.getTokens),F=(0,n.useSelector)(m.getNfts),D=(0,n.useSelector)(r.getDetectedTokensInCurrentNetwork)||[],G=(0,n.useSelector)(r.getTokenList),U=(0,h.useI18nContext)(),{initialTransaction:L,primaryTransaction:j}=e,{type:$}=L,{from:H,to:W}=L.txParams||{},B=(0,n.useSelector)((e=>{var t;return(0,r.getKnownMethodData)(e,null==L||null===(t=L.txParams)||void 0===t?void 0:t.data)}))||{},q=(0,o.getStatusKey)(j),V=q in d.PENDING_STATUS_HASH,K=q===p.TransactionStatus.submitted,Y=null===(t=j.txParams)||void 0===t?void 0:t.value,X=(0,l.formatDateWithYearContext)(L.time);let Q,z="-",Z=!1,J=W;const ee=d.TOKEN_CATEGORY_HASH[$];let te=null;const[ae,ne]=(0,s.useState)(null);ee&&(te=x.find((({address:e})=>(0,g.isEqualCaseInsensitive)(e,J)))||D.find((({address:e})=>(0,g.isEqualCaseInsensitive)(e,J)))||G[J.toLowerCase()]);(0,s.useEffect)((()=>{!async function(){if(ee&&!te){var e;const t=await(0,u.getAssetDetails)(J,H,null==L||null===(e=L.txParams)||void 0===e?void 0:e.data,F);ne(t)}}()}),[ee,te,J,H,null==L||null===(a=L.txParams)||void 0===a?void 0:a.data,F]),ae&&(te={address:ae.toAddress,symbol:ae.symbol,decimals:ae.decimals});const se=(0,S.useTokenData)(null==L||null===(b=L.txParams)||void 0===b?void 0:b.data,ee),re=(0,u.getTokenIdParam)(se)??(0,T.getTokenValueParam)(se),oe=ee&&F.find((({address:e,tokenId:t})=>(0,g.isEqualCaseInsensitive)(e,J)&&t===re)),ie=(0,y.useTokenDisplayValue)(null==L||null===(N=L.txParams)||void 0===N?void 0:N.data,te,ee),ce=(0,E.useTokenFiatAmount)(null===(O=te)||void 0===O?void 0:O.address,ie,null===(C=te)||void 0===C?void 0:C.symbol),ue=(0,l.stripHttpSchemes)(L.origin||(null===(I=L.msgParams)||void 0===I?void 0:I.origin)||"");let le,de,me=ee?null===(P=te)||void 0===P?void 0:P.symbol:undefined,pe=ee?ie:undefined,fe=ee?ce:undefined;const{swapTokenValue:ge,isNegative:Te,swapTokenFiatAmount:he,isViewingReceivedTokenFromSwap:Ee}=(0,k.useSwappedTokenValue)(e,M);if(w.includes($))le=p.TransactionGroupCategory.signatureRequest,de=U("signatureRequest"),Q=ue,Z=!0;else if($===p.TransactionType.swap)le=p.TransactionGroupCategory.swap,de=U("swapTokenToToken",[L.sourceTokenSymbol,L.destinationTokenSymbol]),Q=ue,Z=!0,me=Ee?M.symbol:L.sourceTokenSymbol,pe=ge,fe=he,z=Te?"":Ee?"+":"-";else if($===p.TransactionType.swapApproval)le=p.TransactionGroupCategory.approval,de=U("swapApproval",[j.sourceTokenSymbol]),Q=ue,Z=!0,me=j.sourceTokenSymbol;else if($===p.TransactionType.tokenMethodApprove){var ve;le=p.TransactionGroupCategory.approval,z="",de=U("approveSpendingCap",[(null===(ve=te)||void 0===ve?void 0:ve.symbol)||U("token").toLowerCase()]),Q=ue,Z=!0}else if($===p.TransactionType.tokenMethodSetApprovalForAll){var _e;le=p.TransactionGroupCategory.approval,z="",de=U("setApprovalForAllTitle",[(null===(_e=te)||void 0===_e?void 0:_e.symbol)||U("token")]),Q=ue,Z=!0}else if($===p.TransactionType.contractInteraction){le=p.TransactionGroupCategory.interaction;const e=(0,o.getTransactionTypeTitle)(U,$);de=(null==B?void 0:B.name)&&(0,i.camelCaseToCapitalize)(B.name)||e,Q=ue,Z=!0}else if($===p.TransactionType.deployContract)le=p.TransactionGroupCategory.interaction,de=(0,o.getTransactionTypeTitle)(U,$),Q=ue,Z=!0;else if($===p.TransactionType.incoming)le=p.TransactionGroupCategory.receive,de=U("receive"),z="",Q=U("fromAddress",[(0,l.shortenAddress)(H)]);else if($===p.TransactionType.tokenMethodTransferFrom||$===p.TransactionType.tokenMethodTransfer){var ye;le=p.TransactionGroupCategory.send,de=U("sendSpecifiedTokens",[(null===(ye=te)||void 0===ye?void 0:ye.symbol)||(null==oe?void 0:oe.name)||U("token")]),J=(0,u.getTokenAddressParam)(se),Q=U("toAddress",[(0,l.shortenAddress)(J)])}else $===p.TransactionType.tokenMethodSafeTransferFrom?(le=p.TransactionGroupCategory.send,de=U("safeTransferFrom"),J=(0,u.getTokenAddressParam)(se),Q=U("toAddress",[(0,l.shortenAddress)(J)])):$===p.TransactionType.simpleSend?(le=p.TransactionGroupCategory.send,de=U("send"),Q=U("toAddress",[(0,l.shortenAddress)(J)])):R((0,f.captureSingleException)(`useTransactionDisplayData does not recognize transaction type. Type received is: ${$}`));const Se=(0,v.useUserPreferencedCurrency)(c.PRIMARY),ke=(0,v.useUserPreferencedCurrency)(c.SECONDARY),[Ae]=(0,_.useCurrencyDisplay)(Y,{prefix:z,displayValue:pe,suffix:me,...Se}),[we]=(0,_.useCurrencyDisplay)(Y,{prefix:z,displayValue:fe,hideLabel:ee||Boolean(ge),...ke});return{title:de,category:le,date:X,subtitle:Q,subtitleContainsOrigin:Z,primaryCurrency:$===p.TransactionType.swap&&V?"":Ae,senderAddress:H,recipientAddress:J,secondaryCurrency:ee&&!ce||$===p.TransactionType.swap&&!he?undefined:we,displayedStatusKey:q,isPending:V,isSubmitted:K}};var n=e("react-redux"),s=e("react"),r=e("../selectors/selectors"),o=e("../helpers/utils/transactions.util"),i=e("../helpers/utils/common.util"),c=e("../helpers/constants/common"),u=e("../helpers/utils/token-util"),l=e("../helpers/utils/util"),d=e("../helpers/constants/transactions"),m=e("../ducks/metamask/metamask"),p=e("../../shared/constants/transaction"),f=e("../store/actions"),g=e("../../shared/modules/string-utils"),T=e("../../shared/lib/metamask-controller-utils"),h=e("./useI18nContext"),E=e("./useTokenFiatAmount"),v=e("./useUserPreferencedCurrency"),_=e("./useCurrencyDisplay"),y=e("./useTokenDisplayValue"),S=e("./useTokenData"),k=e("./useSwappedTokenValue"),A=e("./useCurrentAsset");const w=[null,undefined,p.TransactionType.sign,p.TransactionType.personalSign,p.TransactionType.signTypedData,p.TransactionType.ethDecrypt,p.TransactionType.ethGetEncryptionPublicKey]}}},{package:"$root$",file:"ui/hooks/useTransactionDisplayData.js"}],[4148,{"../../shared/constants/transaction":3417,"../contexts/gasFee":4046,"../selectors":4436,"../store/actions":4443,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useTransactionEventFragment=void 0;var n=e("react"),s=e("react-redux"),r=e("../contexts/gasFee"),o=e("../store/actions"),i=e("../selectors"),c=e("../../shared/constants/transaction");a.useTransactionEventFragment=()=>{const{transaction:e}=(0,r.useGasFeeContext)(),t=(0,s.useSelector)((t=>(0,i.selectMatchingFragment)(t,{fragmentOptions:{},existingId:`transaction-added-${null==e?void 0:e.id}`})));return{updateTransactionEventFragment:(0,n.useCallback)((async a=>{e&&e.id&&(t||await(0,o.createTransactionEventFragment)(e.id,c.TransactionMetaMetricsEvent.approved),(0,o.updateEventFragment)(`transaction-added-${e.id}`,a))}),[t,e])}}}}},{package:"$root$",file:"ui/hooks/useTransactionEventFragment.js"}],[4149,{"../../shared/constants/app":3401,"../../shared/constants/transaction":3417,"../ducks/metamask/metamask":4062,"../helpers/utils/metrics":4099,"../helpers/utils/transactions.util":4106,"../selectors":4436,"./useI18nContext":4129,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useTransactionFunctionType=void 0;var n=e("react-redux"),s=e("../../shared/constants/app"),r=e("../../shared/constants/transaction"),o=e("../selectors"),i=e("../ducks/metamask/metamask"),c=e("../helpers/utils/transactions.util"),u=e("../helpers/utils/metrics"),l=e("./useI18nContext");a.useTransactionFunctionType=(e={})=>{const t=(0,l.useI18nContext)(),a=(0,n.useSelector)(i.getNativeCurrency),{txParams:d}=e,m=(0,n.useSelector)((e=>(0,o.getKnownMethodData)(e,null==d?void 0:d.data)||{}));if(!d)return{};const p=e.type===r.TransactionType.tokenMethodSetApprovalForAll||e.type===r.TransactionType.tokenMethodApprove,f=e.type===r.TransactionType.contractInteraction;let g=(p||f)&&e.origin!==s.ORIGIN_METAMASK?(0,u.getMethodName)(null==m?void 0:m.name):undefined;return g||(g=e.type?(0,c.getTransactionTypeTitle)(t,e.type,a):t("contractInteraction")),{functionType:g}}}}},{package:"$root$",file:"ui/hooks/useTransactionFunctionType.js"}],[4150,{"../../shared/modules/conversion.utils":3431,"../../shared/modules/string-utils":3442,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useTransactionInfo=void 0;var n=e("react-redux"),s=e("../../shared/modules/conversion.utils"),r=e("../../shared/modules/string-utils");a.useTransactionInfo=(e={})=>{var t,a;const{allNftContracts:o,selectedAddress:i,provider:{chainId:c}}=(0,n.useSelector)((e=>e.metamask));return{isNftTransfer:Boolean(null==o||null===(t=o[i])||void 0===t||null===(a=t[(0,s.hexToDecimal)(c)])||void 0===a?void 0:a.find((t=>(0,r.isEqualCaseInsensitive)(t.address,e.txParams.to))))}}}}},{package:"$root$",file:"ui/hooks/useTransactionInfo.js"}],[4151,{"../../shared/constants/common":3403,"../ducks/metamask/metamask":4062,"../helpers/constants/common":4068,"../selectors":4436,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.useUserPreferencedCurrency=function(e,t={}){const a=(0,n.useSelector)(r.getNativeCurrency),{useNativeCurrencyAsPrimaryCurrency:c}=(0,n.useSelector)(s.getPreferences,n.shallowEqual),u=(0,n.useSelector)(s.getShouldShowFiat)||t.showFiatOverride,l=(0,n.useSelector)(s.getCurrentCurrency);let d,m;!u||e===o.PRIMARY&&c||e===o.SECONDARY&&!c?(d=a||i.EtherDenomination.ETH,m=t.numberOfDecimals||t.ethNumberOfDecimals||8):(e===o.SECONDARY&&c||e===o.PRIMARY&&!c)&&(d=l,m=t.numberOfDecimals||t.fiatNumberOfDecimals||2);return{currency:d,numberOfDecimals:m}};var n=e("react-redux"),s=e("../selectors"),r=e("../ducks/metamask/metamask"),o=e("../helpers/constants/common"),i=e("../../shared/constants/common")}}},{package:"$root$",file:"ui/hooks/useUserPreferencedCurrency.js"}],[4152,{"../app/scripts/lib/setupSentry":80,"../app/scripts/lib/util":82,"../shared/constants/alerts":3400,"../shared/constants/app":3401,"../shared/lib/error-utils":3418,"../shared/lib/switch-direction":3423,"../shared/modules/object.utils":3438,"./ducks/alerts":4051,"./ducks/metamask/metamask":4062,"./helpers/utils/tx-helper":4107,"./pages":4241,"./selectors":4436,"./store/action-queue":4441,"./store/actions":4443,"./store/store":4444,"copy-to-clipboard":2032,lodash:2932,loglevel:2944,react:3177,"react-dom":3077,"webextension-polyfill":3385},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(e,t){const{backgroundConnection:a}=e;a.getState((function(n,s){n?t(n,{...s},a):async function(e,t,a){e.featureFlags||(e.featureFlags={});const{currentLocaleMessages:n,enLocaleMessages:s}=await(0,g.setupLocale)(e.currentLocale);"rtl"===e.textDirection&&await(0,f.default)("rtl");const r={activeTab:a.activeTab,metamask:e,appState:{},localeMessages:{currentLocale:e.currentLocale,current:n,en:s}};if(N(t),(0,u.getEnvironmentType)()===p.ENVIRONMENT_TYPE_POPUP){const{origin:e}=r.activeTab,t=(0,E.getPermittedAccountsForCurrentTab)(r),a=(0,E.getSelectedAddress)(r),n=(0,_.getUnconnectedAccountAlertShown)(r),s=(0,_.getUnconnectedAccountAlertEnabledness)(r);e&&s&&!n[e]&&t.length>0&&!t.includes(a)&&(r[l.AlertTypes.unconnectedAccount]={state:v.ALERT_STATE.OPEN},T.setUnconnectedAccountAlertShown(e))}const c=(0,h.default)(r);b=c;const d=(0,S.default)(e.unapprovedTxs,e.unapprovedMsgs,e.unapprovedPersonalMsgs,e.unapprovedDecryptMsgs,e.unapprovedEncryptionPublicKeyMsgs,e.unapprovedTypedMessages,e.networkId,e.provider.chainId);d.length>0&&c.dispatch(T.showConfTxPage({id:d[0].id}));return global.metamask={updateCurrentLocale:e=>{c.dispatch(T.updateCurrentLocale(e))},setProviderType:e=>{c.dispatch(T.setProviderType(e))},setFeatureFlag:(e,t)=>{c.dispatch(T.setFeatureFlag(e,t))}},(0,i.render)(o.default.createElement(y.default,{store:c}),a.container),c}(s,a,e).then((e=>{!function(e){window.stateHooks.throwTestError=async function(){const e=new Error("Test Error");throw e.name="TestError",e},window.stateHooks.getCleanAppState=async function(){const t=(0,r.clone)(e.getState());return t.version=global.platform.getVersion(),t.browser=window.navigator.userAgent,t.completeTxList=await T.getTransactions({filterToCurrentNetwork:!1}),t},window.stateHooks.getSentryState=function(){const t=e.getState(),a=(0,d.maskObject)(t,m.SENTRY_STATE);return{browser:window.navigator.userAgent,store:a,version:global.platform.getVersion()}}}(e),t(null,e)}))}))},a.updateBackgroundConnection=void 0;var n=w(e("copy-to-clipboard")),s=w(e("loglevel")),r=e("lodash"),o=w(e("react")),i=e("react-dom"),c=w(e("webextension-polyfill")),u=e("../app/scripts/lib/util"),l=e("../shared/constants/alerts"),d=e("../shared/modules/object.utils"),m=e("../app/scripts/lib/setupSentry"),p=e("../shared/constants/app"),f=w(e("../shared/lib/switch-direction")),g=e("../shared/lib/error-utils"),T=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=A(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("./store/actions")),h=w(e("./store/store")),E=e("./selectors"),v=e("./ducks/alerts"),_=e("./ducks/metamask/metamask"),y=w(e("./pages")),S=w(e("./helpers/utils/tx-helper")),k=e("./store/action-queue");function A(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(A=function(e){return e?a:t})(e)}function w(e){return e&&e.__esModule?e:{default:e}}let b;s.default.setLevel(global.METAMASK_DEBUG?"debug":"warn");const N=e=>{(0,k._setBackgroundConnection)(e),e.onNotification((e=>{if("sendUpdate"!==e.method)throw new Error(`Internal JSON-RPC Notification Not Handled:\n\n ${JSON.stringify(e)}`);b.dispatch(T.updateMetamaskState(e.params[0]))}))};a.updateBackgroundConnection=N,window.logStateString=async function(e){const t=await window.stateHooks.getCleanAppState();c.default.runtime.getPlatformInfo().then((a=>{t.platform=a;const n=JSON.stringify(t,null,2);e(null,n)})).catch((t=>{e(t)}))},window.logState=function(e){return window.logStateString(((t,a)=>{t?console.error(t.message):e?((0,n.default)(a),console.log("State log copied")):console.log(a)}))}}}},{package:"$root$",file:"ui/index.js"}],[4153,{"../../../shared/constants/metametrics":3408,"../../../shared/constants/transaction":3417,"../../components/app/nfts-detection-notice":3657,"../../components/component-library":3840,"../../components/component-library/icon/deprecated":3836,"../../components/ui/actionable-message":3897,"../../components/ui/box":3900,"../../components/ui/form-field":3936,"../../components/ui/page-container":3992,"../../components/ui/typography":4039,"../../contexts/metametrics":4048,"../../ducks/metamask/metamask":4062,"../../helpers/constants/design-system":4070,"../../helpers/constants/routes":4074,"../../hooks/useI18nContext":4129,"../../selectors":4436,"../../store/actions":4443,"@metamask/controller-utils":1084,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){var e,t,a,A;const w=(0,i.useI18nContext)(),b=(0,s.useHistory)(),N=(0,r.useDispatch)(),O=(0,r.useSelector)(T.getUseNftDetection),C=(0,r.useSelector)(T.getIsMainnet),I=(0,r.useSelector)(h.getNftsDropdownState),P=(0,r.useSelector)(T.getSelectedAddress),R=(0,r.useSelector)(T.getCurrentChainId),M=null==b||null===(e=b.location)||void 0===e||null===(t=e.state)||void 0===t?void 0:t.addressEnteredOnImportTokensPage,x=null==b||null===(a=b.location)||void 0===a||null===(A=a.state)||void 0===A?void 0:A.tokenAddress,[F,D]=(0,n.useState)(M??x??""),[G,U]=(0,n.useState)(""),[L,j]=(0,n.useState)(!0),[$,H]=(0,n.useState)(!1),W=(0,n.useContext)(v.MetaMetricsContext);return n.default.createElement(p.default,{title:w("importNFT"),onSubmit:()=>{(async()=>{try{var e;await N((0,f.addNftVerifyOwnership)(F,G));const t={...I,[P]:{...null==I?void 0:I[P],[R]:{...null==I||null===(e=I[P])||void 0===e?void 0:e[R],[F]:!0}}};N((0,f.updateNftDropDownState)(t))}catch(e){const{message:t}=e;return N((0,f.setNewNftAddedMessage)(t)),void H(!0)}x&&await N((0,f.ignoreTokens)({tokensToIgnore:x,dontShowLoadingIndicator:!0})),N((0,f.setNewNftAddedMessage)("success"));const t=await(0,f.getTokenStandardAndDetails)(F,null,G.toString());W({event:y.MetaMetricsEventName.TokenAdded,category:"Wallet",sensitiveProperties:{token_contract_address:F,token_symbol:null==t?void 0:t.symbol,tokenId:G.toString(),asset_type:_.AssetType.NFT,token_standard:null==t?void 0:t.standard,source:y.MetaMetricsTokenEventSource.Custom}}),b.push(c.DEFAULT_ROUTE)})()},submitText:w("add"),onCancel:()=>{b.push(c.DEFAULT_ROUTE)},onClose:()=>{b.push(c.DEFAULT_ROUTE)},disabled:L,contentComponent:n.default.createElement(l.default,null,C&&!O?n.default.createElement(E.default,null):null,$&&n.default.createElement(l.default,{marginLeft:4,marginRight:4},n.default.createElement(m.default,{type:"danger",useIcon:!0,iconFillColor:"var(--color-error-default)",message:n.default.createElement(l.default,{display:u.DISPLAY.INLINE_FLEX},n.default.createElement(d.default,{variant:u.TypographyVariant.H7,fontWeight:u.FONT_WEIGHT.NORMAL,marginTop:0},w("nftAddFailedMessage")),n.default.createElement(k.ButtonIcon,{className:"add-nft__close",iconName:S.ICON_NAMES.CLOSE,size:S.ICON_SIZES.SM,ariaLabel:w("close"),"data-testid":"add-nft-error-close",onClick:()=>H(!1)}))})),n.default.createElement(l.default,{margin:4},n.default.createElement(g.default,{dataTestId:"address",titleText:w("address"),placeholder:"0x...",value:F,onChange:e=>{(e=>{j(!(0,o.isValidHexAddress)(e)||!G),D(e)})(e),H(!1)},tooltipText:w("importNFTAddressToolTip"),autoFocus:!0}),n.default.createElement(g.default,{dataTestId:"token-id",titleText:w("tokenId"),placeholder:w("nftTokenIdPlaceholder"),value:G,onChange:e=>{(e=>{j(!(0,o.isValidHexAddress)(F)||!e||isNaN(Number(e))),U(e)})(e),H(!1)},tooltipText:w("importNFTTokenIdToolTip")})))})};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=w(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=e("react-router-dom"),r=e("react-redux"),o=e("@metamask/controller-utils"),i=e("../../hooks/useI18nContext"),c=e("../../helpers/constants/routes"),u=e("../../helpers/constants/design-system"),l=A(e("../../components/ui/box")),d=A(e("../../components/ui/typography")),m=A(e("../../components/ui/actionable-message")),p=A(e("../../components/ui/page-container")),f=e("../../store/actions"),g=A(e("../../components/ui/form-field")),T=e("../../selectors"),h=e("../../ducks/metamask/metamask"),E=A(e("../../components/app/nfts-detection-notice")),v=e("../../contexts/metametrics"),_=e("../../../shared/constants/transaction"),y=e("../../../shared/constants/metametrics"),S=e("../../components/component-library/icon/deprecated"),k=e("../../components/component-library");function A(e){return e&&e.__esModule?e:{default:e}}function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(w=function(e){return e?a:t})(e)}}}},{package:"$root$",file:"ui/pages/add-nft/add-nft.js"}],[4154,{"./add-nft":4153},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./add-nft"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/add-nft/index.js"}],[4155,{"../../../shared/modules/string-utils":3442,"../../components/app/nft-details/nft-details":3655,"../../ducks/metamask/metamask":4062,"../../helpers/constants/routes":4074,"./components/native-asset":4159,"./components/token-asset":4160,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=p(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=e("react-redux"),r=e("react-router-dom"),o=e("../../../shared/modules/string-utils"),i=m(e("../../components/app/nft-details/nft-details")),c=e("../../ducks/metamask/metamask"),u=e("../../helpers/constants/routes"),l=m(e("./components/native-asset")),d=m(e("./components/token-asset"));function m(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(p=function(e){return e?a:t})(e)}var f=()=>{const e=(0,s.useSelector)((e=>e.metamask.nativeCurrency)),t=(0,s.useSelector)(c.getTokens),a=(0,s.useSelector)(c.getNfts),{asset:m,id:p}=(0,r.useParams)(),f=t.find((({address:e})=>(0,o.isEqualCaseInsensitive)(e,m))),g=a.find((({address:e,tokenId:t})=>(0,o.isEqualCaseInsensitive)(e,m)&&p===t.toString()));let T;return(0,n.useEffect)((()=>{document.querySelector(".app").scroll(0,0)}),[]),T=g?n.default.createElement(i.default,{nft:g}):f?n.default.createElement(d.default,{token:f}):m===e?n.default.createElement(l.default,{nativeCurrency:e}):n.default.createElement(r.Redirect,{to:{pathname:u.DEFAULT_ROUTE}}),n.default.createElement("div",{className:"main-container asset__container"},T)};a.default=f}}},{package:"$root$",file:"ui/pages/asset/asset.js"}],[4156,{"../../../components/component-library/icon/deprecated":3836,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=o(e("react")),s=o(e("prop-types")),r=e("../../../components/component-library/icon/deprecated");function o(e){return e&&e.__esModule?e:{default:e}}const i=({accountName:e,assetName:t,onBack:a})=>n.default.createElement("button",{className:"asset-breadcrumb",onClick:a},n.default.createElement(r.Icon,{name:r.ICON_NAMES.ARROW_LEFT,"data-testid":"asset__back",marginInlineEnd:3,size:r.ICON_SIZES.XS}),n.default.createElement("span",null,e)," / ",n.default.createElement("span",{className:"asset-breadcrumb__asset"},t));i.propTypes={accountName:s.default.string.isRequired,assetName:s.default.string.isRequired,onBack:s.default.func.isRequired};var c=i;a.default=c}}},{package:"$root$",file:"ui/pages/asset/components/asset-breadcrumb.js"}],[4157,{"./asset-breadcrumb":4156,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=o(e("react")),s=o(e("prop-types")),r=o(e("./asset-breadcrumb"));function o(e){return e&&e.__esModule?e:{default:e}}const i=({accountName:e,assetName:t,onBack:a,optionsButton:s})=>n.default.createElement("div",{className:"asset-navigation"},n.default.createElement(r.default,{accountName:e,assetName:t,onBack:a}),s);i.propTypes={accountName:s.default.string.isRequired,assetName:s.default.string.isRequired,onBack:s.default.func.isRequired,optionsButton:s.default.element},i.defaultProps={optionsButton:undefined};var c=i;a.default=c}}},{package:"$root$",file:"ui/pages/asset/components/asset-navigation.js"}],[4158,{"../../../components/component-library":3840,"../../../components/component-library/icon/deprecated":3836,"../../../components/ui/menu":3981,"../../../contexts/i18n":4047,"../../../helpers/constants/design-system":4070,"../../../helpers/constants/routes":4074,"../../../selectors":4436,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=g(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),r=(n=e("prop-types"))&&n.__esModule?n:{default:n},o=e("react-router-dom"),i=e("react-redux"),c=e("../../../contexts/i18n"),u=e("../../../components/ui/menu"),l=e("../../../selectors"),d=e("../../../helpers/constants/routes"),m=e("../../../components/component-library/icon/deprecated"),p=e("../../../components/component-library"),f=e("../../../helpers/constants/design-system");function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(g=function(e){return e?a:t})(e)}const T=({onRemove:e,onClickBlockExplorer:t,onViewAccountDetails:a,onViewTokenDetails:n,tokenSymbol:r,isNativeAsset:g})=>{const T=(0,s.useContext)(c.I18nContext),[h,E]=(0,s.useState)(!1),v=(0,o.useHistory)(),_=(0,i.useSelector)(l.getBlockExplorerLinkText),y=(0,s.useRef)(!1);return s.default.createElement("div",{ref:y},s.default.createElement(p.ButtonIcon,{className:"asset-options__button","data-testid":"asset-options__button",onClick:()=>E(!0),ariaLabel:T("assetOptions"),iconName:m.ICON_NAMES.MORE_VERTICAL,color:f.Color.textDefault}),h?s.default.createElement(u.Menu,{anchorElement:y.current,onHide:()=>E(!1)},s.default.createElement(u.MenuItem,{iconName:m.ICON_NAMES.SCAN_BARCODE,"data-testid":"asset-options__account-details",onClick:()=>{E(!1),a()}},T("accountDetails")),s.default.createElement(u.MenuItem,{iconName:m.ICON_NAMES.EXPORT,"data-testid":"asset-options__etherscan",onClick:"addBlockExplorer"===_.firstPart?()=>{v.push(`${d.NETWORKS_ROUTE}#blockExplorerUrl`)}:()=>{E(!1),t()}},T(_.firstPart,""===_.secondPart?null:[T("blockExplorerAssetAction")])),g?null:s.default.createElement(u.MenuItem,{iconName:m.ICON_NAMES.TRASH,"data-testid":"asset-options__hide",onClick:()=>{E(!1),e()}},T("hideTokenSymbol",[r])),g?null:s.default.createElement(u.MenuItem,{iconName:m.ICON_NAMES.INFO,"data-testid":"asset-options__token-details",onClick:()=>{E(!1),n()}},T("tokenDetails"))):null)},h=e=>"function"!=typeof e;T.propTypes={isNativeAsset:r.default.bool,onClickBlockExplorer:r.default.func.isRequired,onViewAccountDetails:r.default.func.isRequired,onRemove:e=>{if(!1===e.isNativeAsset&&h(e.onRemove))throw new Error("When isNativeAsset is true, onRemove is a required prop")},onViewTokenDetails:e=>{if(!1===e.isNativeAsset&&h(e.onViewTokenDetails))throw new Error("When isNativeAsset is true, onViewTokenDetails is a required prop")},tokenSymbol:e=>{if(!1===e.isNativeAsset&&"string"!=typeof e.tokenSymbol)throw new Error("When isNativeAsset is true, tokenSymbol is a required prop")}};var E=T;a.default=E}}},{package:"$root$",file:"ui/pages/asset/components/asset-options.js"}],[4159,{"../../../../shared/constants/metametrics":3408,"../../../components/app/transaction-list":3764,"../../../components/app/wallet-overview":3776,"../../../contexts/metametrics":4048,"../../../helpers/constants/routes":4074,"../../../helpers/utils/util":4108,"../../../selectors/selectors":4439,"../../../store/actions":4443,"./asset-navigation":4157,"./asset-options":4158,"@metamask/etherscan-link":1221,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=_;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=v(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=E(e("prop-types")),r=e("react-redux"),o=e("react-router-dom"),i=e("@metamask/etherscan-link"),c=E(e("../../../components/app/transaction-list")),u=e("../../../components/app/wallet-overview"),l=e("../../../selectors/selectors"),d=e("../../../store/actions"),m=e("../../../helpers/constants/routes"),p=e("../../../helpers/utils/util"),f=e("../../../contexts/metametrics"),g=e("../../../../shared/constants/metametrics"),T=E(e("./asset-navigation")),h=E(e("./asset-options"));function E(e){return e&&e.__esModule?e:{default:e}}function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(v=function(e){return e?a:t})(e)}function _({nativeCurrency:e}){const t=(0,r.useSelector)((e=>(0,l.getSelectedIdentity)(e).name)),a=(0,r.useDispatch)(),s=(0,r.useSelector)(l.getCurrentChainId),E=(0,r.useSelector)(l.getRpcPrefsForCurrentProvider),v=(0,r.useSelector)(l.getSelectedAddress),_=(0,o.useHistory)(),y=(0,i.getAccountLink)(v,s,E),S=(0,n.useContext)(f.MetaMetricsContext),k=(0,r.useSelector)(l.getIsCustomNetwork);return n.default.createElement(n.default.Fragment,null,n.default.createElement(T.default,{accountName:t,assetName:e,onBack:()=>_.push(m.DEFAULT_ROUTE),optionsButton:n.default.createElement(h.default,{isNativeAsset:!0,onClickBlockExplorer:()=>{S({event:"Clicked Block Explorer Link",category:g.MetaMetricsEventCategory.Navigation,properties:{link_type:"Account Tracker",action:"Asset Options",block_explorer_domain:(0,p.getURLHostName)(y)}}),global.platform.openTab({url:y})},onViewAccountDetails:()=>{a((0,d.showModal)({name:"ACCOUNT_DETAILS"}))},isCustomNetwork:k})}),n.default.createElement(u.EthOverview,{className:"asset__overview"}),n.default.createElement(c.default,{hideTokenTransactions:!0}))}_.propTypes={nativeCurrency:s.default.string.isRequired}}}},{package:"$root$",file:"ui/pages/asset/components/native-asset.js"}],[4160,{"../../../../shared/constants/metametrics":3408,"../../../components/app/transaction-list":3764,"../../../components/app/wallet-overview":3776,"../../../contexts/metametrics":4048,"../../../helpers/constants/routes":4074,"../../../helpers/utils/util":4108,"../../../selectors/selectors":4439,"../../../store/actions":4443,"./asset-navigation":4157,"./asset-options":4158,"@metamask/etherscan-link":1221,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=_;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=v(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=E(e("prop-types")),r=e("react-redux"),o=e("react-router-dom"),i=e("@metamask/etherscan-link"),c=E(e("../../../components/app/transaction-list")),u=e("../../../components/app/wallet-overview"),l=e("../../../selectors/selectors"),d=e("../../../helpers/constants/routes"),m=e("../../../helpers/utils/util"),p=e("../../../store/actions"),f=e("../../../contexts/metametrics"),g=e("../../../../shared/constants/metametrics"),T=E(e("./asset-navigation")),h=E(e("./asset-options"));function E(e){return e&&e.__esModule?e:{default:e}}function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(v=function(e){return e?a:t})(e)}function _({token:e}){const t=(0,r.useDispatch)(),a=(0,r.useSelector)(l.getCurrentChainId),s=(0,r.useSelector)(l.getRpcPrefsForCurrentProvider),E=(0,r.useSelector)(l.getSelectedIdentity),v=E.name,_=E.address,y=(0,o.useHistory)(),S=(0,i.getTokenTrackerLink)(e.address,a,null,_,s),k=(0,n.useContext)(f.MetaMetricsContext),A=(0,r.useSelector)(l.getIsCustomNetwork);return n.default.createElement(n.default.Fragment,null,n.default.createElement(T.default,{accountName:v,assetName:e.symbol,onBack:()=>y.push(d.DEFAULT_ROUTE),optionsButton:n.default.createElement(h.default,{onRemove:()=>t((0,p.showModal)({name:"HIDE_TOKEN_CONFIRMATION",token:e,history:y})),isCustomNetwork:A,onClickBlockExplorer:()=>{k({event:"Clicked Block Explorer Link",category:g.MetaMetricsEventCategory.Navigation,properties:{link_type:"Token Tracker",action:"Token Options",block_explorer_domain:(0,m.getURLHostName)(S)}}),global.platform.openTab({url:S})},onViewAccountDetails:()=>{t((0,p.showModal)({name:"ACCOUNT_DETAILS"}))},onViewTokenDetails:()=>{y.push(`${d.TOKEN_DETAILS}/${e.address}`)},tokenSymbol:e.symbol})}),n.default.createElement(u.TokenOverview,{className:"asset__overview",token:e}),n.default.createElement(c.default,{tokenAddress:e.address}))}_.propTypes={token:s.default.shape({address:s.default.string.isRequired,decimals:s.default.number,symbol:s.default.string}).isRequired}}}},{package:"$root$",file:"ui/pages/asset/components/token-asset.js"}],[4161,{"./asset":4155},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./asset"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/asset/index.js"}],[4162,{"../../../shared/constants/metametrics":3408,"../../../shared/constants/transaction":3417,"../../../shared/modules/string-utils":3442,"../../components/ui/actionable-message/actionable-message":3896,"../../components/ui/button":3904,"../../components/ui/identicon":3962,"../../components/ui/page-container":3992,"../../components/ui/token-balance":4030,"../../contexts/i18n":4047,"../../contexts/metametrics":4048,"../../ducks/history/history":4059,"../../ducks/metamask/metamask":4062,"../../helpers/constants/zendesk-url":4077,"../../selectors":4436,"../../store/actions":4443,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=S(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=e("react-redux"),r=e("react-router-dom"),o=y(e("../../components/ui/actionable-message/actionable-message")),i=y(e("../../components/ui/button")),c=y(e("../../components/ui/identicon")),u=y(e("../../components/ui/token-balance")),l=e("../../components/ui/page-container"),d=e("../../contexts/i18n"),m=e("../../contexts/metametrics"),p=e("../../ducks/history/history"),f=e("../../ducks/metamask/metamask"),g=y(e("../../helpers/constants/zendesk-url")),T=e("../../../shared/modules/string-utils"),h=e("../../selectors"),E=e("../../store/actions"),v=e("../../../shared/constants/metametrics"),_=e("../../../shared/constants/transaction");function y(e){return e&&e.__esModule?e:{default:e}}function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(S=function(e){return e?a:t})(e)}var k=()=>{const e=(0,n.useContext)(d.I18nContext),t=(0,s.useDispatch)(),a=(0,r.useHistory)(),y=(0,s.useSelector)(p.getMostRecentOverviewPage),S=(0,s.useSelector)(h.getSuggestedAssets),k=(0,s.useSelector)(f.getTokens),A=(0,n.useContext)(m.MetaMetricsContext),w=(0,n.useMemo)((()=>function(e,t){const a=e.find((({asset:e})=>{const a=t.find((({address:t})=>(0,T.isEqualCaseInsensitive)(t,e.address)));return Boolean(a)}));return Boolean(a)}(S,k)&&n.default.createElement(o.default,{message:e("knownTokenWarning",[n.default.createElement(i.default,{type:"link",key:"confirm-add-suggested-token-duplicate-warning",className:"confirm-add-suggested-token__link",rel:"noopener noreferrer",target:"_blank",href:g.default.TOKEN_SAFETY_PRACTICES},e("learnScamRisk"))]),type:"warning",withRightButton:!0,useIcon:!0,iconFillColor:"#f8c000"})),[S,k,e]),b=(0,n.useMemo)((()=>function(e,t){const a=e.find((({asset:e})=>{const a=t.find((t=>(0,T.isEqualCaseInsensitive)(t.symbol,e.symbol)&&!(0,T.isEqualCaseInsensitive)(t.address,e.address)));return Boolean(a)}));return Boolean(a)}(S,k)&&n.default.createElement(o.default,{message:e("reusedTokenNameWarning"),type:"warning",withRightButton:!0,useIcon:!0,iconFillColor:"#f8c000"})),[S,k,e]),N=(0,n.useCallback)((async()=>{await Promise.all(S.map((async({asset:e,id:a})=>{await t((0,E.acceptWatchAsset)(a)),A({event:v.MetaMetricsEventName.TokenAdded,category:v.MetaMetricsEventCategory.Wallet,sensitiveProperties:{token_symbol:e.symbol,token_contract_address:e.address,token_decimal_precision:e.decimals,unlisted:e.unlisted,source:v.MetaMetricsTokenEventSource.Dapp,token_standard:_.TokenStandard.ERC20,asset_type:_.AssetType.token}})}))),a.push(y)}),[t,a,A,y,S]);return(0,n.useEffect)((()=>{S.length||a.push(y)}),[]),n.default.createElement("div",{className:"page-container"},n.default.createElement("div",{className:"page-container__header"},n.default.createElement("div",{className:"page-container__title"},e("addSuggestedTokens")),n.default.createElement("div",{className:"page-container__subtitle"},e("likeToImportTokens")),w,b),n.default.createElement("div",{className:"page-container__content"},n.default.createElement("div",{className:"confirm-add-suggested-token"},n.default.createElement("div",{className:"confirm-add-suggested-token__header"},n.default.createElement("div",{className:"confirm-add-suggested-token__token"},e("token")),n.default.createElement("div",{className:"confirm-add-suggested-token__balance"},e("balance"))),n.default.createElement("div",{className:"confirm-add-suggested-token__token-list"},S.map((({asset:e})=>{return n.default.createElement("div",{className:"confirm-add-suggested-token__token-list-item",key:e.address},n.default.createElement("div",{className:"confirm-add-suggested-token__token confirm-add-suggested-token__data"},n.default.createElement(c.default,{className:"confirm-add-suggested-token__token-icon",diameter:48,address:e.address,image:e.image}),n.default.createElement("div",{className:"confirm-add-suggested-token__name"},(t=e.name,a=e.symbol,t===undefined?a:`${t} (${a})`))),n.default.createElement("div",{className:"confirm-add-suggested-token__balance"},n.default.createElement(u.default,{token:e})));var t,a}))))),n.default.createElement(l.PageContainerFooter,{cancelText:e("cancel"),submitText:e("addToken"),onCancel:async()=>{await Promise.all(S.map((({id:e})=>t((0,E.rejectWatchAsset)(e))))),a.push(y)},onSubmit:N,disabled:0===S.length}))};a.default=k}}},{package:"$root$",file:"ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.js"}],[4163,{"./confirm-add-suggested-token":4162},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-add-suggested-token"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-add-suggested-token/index.js"}],[4164,{"../../../../shared/constants/network":3409,"../../../../shared/constants/transaction":3417,"../../../components/app/confirm-page-container/confirm-page-container-content":3507,"../../../components/app/edit-gas-fee-button":3553,"../../../components/app/gas-details-item":3571,"../../../components/app/ledger-instruction-field":3580,"../../../components/app/modals/contract-details-modal/contract-details-modal":3614,"../../../components/app/multilayer-fee-message":3645,"../../../components/app/security-provider-banner-message/security-provider-banner-message":3687,"../../../components/app/security-provider-banner-message/security-provider-banner-message.constants":3686,"../../../components/component-library":3840,"../../../components/component-library/icon/deprecated":3836,"../../../components/ui/box":3900,"../../../components/ui/button":3904,"../../../components/ui/simulation-error-message":4011,"../../../components/ui/url-icon":4044,"../../../helpers/constants/design-system":4070,"../../../helpers/utils/confirm-tx.util":4090,"../../../helpers/utils/util":4108,"@metamask/etherscan-link":1221,classnames:1980,"copy-to-clipboard":2032,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=O(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=N(e("prop-types")),r=N(e("classnames")),o=N(e("copy-to-clipboard")),i=e("@metamask/etherscan-link"),c=N(e("../../../components/ui/url-icon")),u=e("../../../helpers/utils/util"),l=e("../../../helpers/utils/confirm-tx.util"),d=N(e("../../../components/ui/box")),m=N(e("../../../components/ui/button")),p=N(e("../../../components/ui/simulation-error-message")),f=N(e("../../../components/app/edit-gas-fee-button")),g=N(e("../../../components/app/multilayer-fee-message")),T=N(e("../../../components/app/security-provider-banner-message/security-provider-banner-message")),h=e("../../../components/app/security-provider-banner-message/security-provider-banner-message.constants"),E=e("../../../helpers/constants/design-system"),v=e("../../../components/app/confirm-page-container/confirm-page-container-content"),_=N(e("../../../components/app/gas-details-item")),y=N(e("../../../components/app/ledger-instruction-field")),S=e("../../../../shared/constants/transaction"),k=e("../../../../shared/constants/network"),A=N(e("../../../components/app/modals/contract-details-modal/contract-details-modal")),w=e("../../../components/component-library/icon/deprecated"),b=e("../../../components/component-library");function N(e){return e&&e.__esModule?e:{default:e}}function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(O=function(e){return e?a:t})(e)}function C(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class I extends n.Component{constructor(...e){super(...e),C(this,"state",{showFullTxDetails:!1,copied:!1,setShowContractDetails:!1})}renderApproveContentCard({showHeader:e=!0,symbol:t,title:a,showEdit:s,showAdvanceGasFeeOptions:o=!1,onEditClick:i,content:c,footer:u,noBorder:l}){const{supportsEIP1559:p,renderSimulationFailureWarning:g,userAcknowledgedGasMissing:T}=this.props,{t:h}=this.context;return n.default.createElement("div",{className:(0,r.default)({"confirm-approve-content__card":!l,"confirm-approve-content__card--no-border":l})},e&&n.default.createElement("div",{className:"confirm-approve-content__card-header"},p&&a===h("transactionFee")?null:n.default.createElement(n.default.Fragment,null,n.default.createElement("div",{className:"confirm-approve-content__card-header__symbol"},t),n.default.createElement("div",{className:"confirm-approve-content__card-header__title"},a)),s&&(!o||!p)&&n.default.createElement(d.default,{width:E.BLOCK_SIZES.ONE_SIXTH},n.default.createElement(m.default,{type:"link",className:"confirm-approve-content__small-blue-text",onClick:()=>i()},h("edit"))),s&&o&&p&&!g&&n.default.createElement(f.default,{userAcknowledgedGasMissing:T})),n.default.createElement("div",{className:"confirm-approve-content__card-content"},c),u)}renderTransactionDetailsContent(){const{t:e}=this.context,{currentCurrency:t,nativeCurrency:a,ethTransactionTotal:s,fiatTransactionTotal:r,hexTransactionTotal:o,txData:i,isMultiLayerFeeNetwork:c,supportsEIP1559:u,userAcknowledgedGasMissing:d,renderSimulationFailureWarning:m,useCurrencyRateCheck:p}=this.props;return c||!u||m?n.default.createElement("div",{className:"confirm-approve-content__transaction-details-content"},c?n.default.createElement("div",{className:"confirm-approve-content__transaction-details-extra-content"},n.default.createElement("div",{className:"confirm-approve-content__transaction-details-content__labelled-fee"},n.default.createElement("span",null,e("transactionDetailLayer2GasHeading")),`${s} ${a}`),n.default.createElement(g.default,{transaction:i,layer2fee:o,nativeCurrency:a,plainStyle:!0})):n.default.createElement(n.default.Fragment,null,n.default.createElement("div",{className:"confirm-approve-content__small-text"},e("feeAssociatedRequest")),n.default.createElement("div",{className:"confirm-approve-content__transaction-details-content__fee"},n.default.createElement("div",{className:"confirm-approve-content__transaction-details-content__primary-fee"},p&&(0,l.formatCurrency)(r,t)),n.default.createElement("div",{className:"confirm-approve-content__transaction-details-content__secondary-fee"},`${s} ${a}`)))):n.default.createElement(_.default,{userAcknowledgedGasMissing:d})}renderERC721OrERC1155PermissionContent(){const{t:e}=this.context,{origin:t,toAddress:a,isContract:s,isSetApproveForAll:r,tokenSymbol:i}=this.props,c=this.getTitleTokenDescription(),l=e(i?"allOfYour":"allYourNFTsOf",[c]),d=s?`${e("contract")} (${(0,u.addressSummary)(a)})`:(0,u.addressSummary)(a);return n.default.createElement("div",{className:"flex-column"},n.default.createElement("div",{className:"confirm-approve-content__small-text"},e("accessAndSpendNoticeNFT",[t])),n.default.createElement("div",{className:"flex-row"},n.default.createElement("div",{className:"confirm-approve-content__label"},e("approvedAsset"),":"),n.default.createElement("div",{className:"confirm-approve-content__medium-text"},r?l:c)),n.default.createElement("div",{className:"flex-row"},n.default.createElement("div",{className:"confirm-approve-content__label"},e("grantedToWithColon")),n.default.createElement("div",{className:"confirm-approve-content__medium-text"},d),n.default.createElement("div",{className:"confirm-approve-content__medium-text"},n.default.createElement(b.ButtonIcon,{ariaLabel:"copy",onClick:()=>(0,o.default)(a),color:E.IconColor.iconDefault,iconName:this.state.copied?w.ICON_NAMES.COPY_SUCCESS:w.ICON_NAMES.COPY,title:this.state.copied?e("copiedExclamation"):e("copyToClipboard")}))))}renderDataContent(){const{t:e}=this.context,{data:t,isSetApproveForAll:a,isApprovalOrRejection:s}=this.props;return n.default.createElement("div",{className:"flex-column"},n.default.createElement("div",{className:"confirm-approve-content__small-text"},e(a?"functionSetApprovalForAll":"functionApprove")),a&&s!==undefined?n.default.createElement("div",{className:"confirm-approve-content__small-text"},`${e("parameters")}: ${s}`):null,n.default.createElement("div",{className:"confirm-approve-content__small-text confirm-approve-content__data__data-block"},t))}renderFullDetails(){const{t:e}=this.context,{assetStandard:t}=this.props;return t===S.TokenStandard.ERC721||t===S.TokenStandard.ERC1155?n.default.createElement("div",{className:"confirm-approve-content__full-tx-content"},n.default.createElement("div",{className:"confirm-approve-content__permission"},this.renderApproveContentCard({symbol:n.default.createElement("i",{className:"fas fa-user-check"}),title:e("permissionRequest"),content:this.renderERC721OrERC1155PermissionContent(),showEdit:!1})),n.default.createElement("div",{className:"confirm-approve-content__data"},this.renderApproveContentCard({symbol:n.default.createElement("i",{className:"fa fa-file"}),title:e("data"),content:this.renderDataContent(),noBorder:!0}))):null}renderCustomNonceContent(){const{t:e}=this.context,{useNonceField:t,customNonceValue:a,updateCustomNonce:s,getNextNonce:r,nextNonce:o,showCustomizeNonceModal:i}=this.props;return n.default.createElement(n.default.Fragment,null,t&&n.default.createElement("div",{className:"confirm-approve-content__custom-nonce-content"},n.default.createElement(d.default,{className:"confirm-approve-content__custom-nonce-header",justifyContent:E.JustifyContent.flexStart},n.default.createElement(b.Text,{variant:E.TextVariant.bodySm,as:"h6"},e("nonce")),n.default.createElement(m.default,{type:"link",className:"confirm-approve-content__custom-nonce-edit",onClick:()=>i({nextNonce:o,customNonceValue:a,updateCustomNonce:s,getNextNonce:r})},e("edit"))),n.default.createElement(b.Text,{className:"confirm-approve-content__custom-nonce-value",variant:E.TextVariant.bodySmBold,as:"h6"},a||o)))}getTokenName(){const{tokenId:e,assetName:t,assetStandard:a,tokenSymbol:n}=this.props,{t:s}=this.context;let r=s("token");return(a===S.TokenStandard.ERC721||a===S.TokenStandard.ERC1155||t&&e||n&&e)&&(r=t||n?`${t??n}`:s("thisCollection")),r}getTitleTokenDescription(){const{tokenId:e,tokenAddress:t,rpcPrefs:a,chainId:s,userAddress:r}=this.props,c=(null==a?void 0:a.blockExplorerUrl)||[...k.TEST_CHAINS,k.CHAIN_IDS.MAINNET].includes(s),u=this.getTokenName(),l=e?` (#${e})`:"";if(c){const e=(0,i.getTokenTrackerLink)(t,s,null,r,{blockExplorerUrl:(null==a?void 0:a.blockExplorerUrl)??null});return n.default.createElement(n.default.Fragment,null,n.default.createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:t,className:"confirm-approve-content__approval-asset-link"},u),l&&n.default.createElement("span",null,l))}return n.default.createElement(n.default.Fragment,null,n.default.createElement("span",{className:"confirm-approve-content__approval-asset-title",onClick:()=>{(0,o.default)(t)},title:t},u),l&&n.default.createElement("span",null,l))}renderTitle(){const{t:e}=this.context,{assetName:t,tokenId:a,tokenSymbol:n,assetStandard:s,isSetApproveForAll:r,isApprovalOrRejection:o}=this.props,i=this.getTitleTokenDescription();let c;return r?n?(c=e("approveAllTokensTitle",[i]),!1===o&&(c=e("revokeAllTokensTitle",[i]))):(c=e("approveAllTokensTitleWithoutSymbol",[i]),!1===o&&(c=e("revokeAllTokensTitleWithoutSymbol",[i]))):(s===S.TokenStandard.ERC721||s===S.TokenStandard.ERC1155||t&&a||n&&a)&&(c=e("approveTokenTitle",[i])),c||e("allowSpendToken",[i])}renderDescription(){const{t:e}=this.context,{assetStandard:t,assetName:a,tokenId:n,tokenSymbol:s,isContract:r,isSetApproveForAll:o,isApprovalOrRejection:i}=this.props,c=r?e("contract").toLowerCase():e("account").toLowerCase();let u=e("trustSiteApprovePermission",[c]);return o&&!1===i?u=e(s?"revokeApproveForAllDescription":"revokeApproveForAllDescriptionWithoutSymbol",[this.getTitleTokenDescription()]):(o||t===S.TokenStandard.ERC721||t===S.TokenStandard.ERC1155||a&&n||s&&n)&&(u=s?e("approveTokenDescription"):e("approveTokenDescriptionWithoutSymbol",[this.getTitleTokenDescription()])),u}render(){var e,t,a;const{t:s}=this.context,{siteImage:o,origin:i,tokenSymbol:u,showCustomizeGasModal:l,useNonceField:f,warning:g,txData:_,fromAddressIsLedger:S,toAddress:k,chainId:N,rpcPrefs:O,assetStandard:C,tokenId:I,tokenAddress:P,assetName:R,userAcknowledgedGasMissing:M,setUserAcknowledgedGasMissing:x,renderSimulationFailureWarning:F}=this.props,{showFullTxDetails:D,setShowContractDetails:G}=this.state;return n.default.createElement("div",{className:(0,r.default)("confirm-approve-content",{"confirm-approve-content--full":D})},(null==_||null===(e=_.securityProviderResponse)||void 0===e?void 0:e.flagAsDangerous)!==undefined&&(null==_||null===(t=_.securityProviderResponse)||void 0===t?void 0:t.flagAsDangerous)!==h.SECURITY_PROVIDER_MESSAGE_SEVERITIES.NOT_MALICIOUS||null!=_&&_.securityProviderResponse&&0===Object.keys(_.securityProviderResponse).length?n.default.createElement(T.default,{securityProviderResponse:_.securityProviderResponse}):null,g&&n.default.createElement("div",{className:"confirm-approve-content__custom-nonce-warning"},n.default.createElement(v.ConfirmPageContainerWarning,{warning:g})),n.default.createElement(d.default,{display:E.DISPLAY.FLEX,className:"confirm-approve-content__icon-display-content"},n.default.createElement(d.default,{display:E.DISPLAY.FLEX,alignItems:E.AlignItems.center},n.default.createElement(c.default,{className:"confirm-approve-content__siteimage-identicon",fallbackClassName:"confirm-approve-content__siteimage-identicon",name:i,url:o}),n.default.createElement(b.Text,{variant:E.TextVariant.bodySm,as:"h6",color:E.TextColor.textAlternative,marginLeft:1},i))),n.default.createElement("div",{className:"confirm-approve-content__title","data-testid":"confirm-approve-title"},this.renderTitle()),n.default.createElement("div",{className:"confirm-approve-content__description"},this.renderDescription()),n.default.createElement(d.default,{marginBottom:4,marginTop:2},n.default.createElement(m.default,{type:"link",className:"confirm-approve-content__verify-contract-details",onClick:()=>this.setState({setShowContractDetails:!0})},s("verifyContractDetails")),G&&n.default.createElement(A.default,{onClose:()=>this.setState({setShowContractDetails:!1}),tokenName:u,tokenAddress:P,toAddress:k,chainId:N,rpcPrefs:O,tokenId:I,assetName:R,assetStandard:C})),n.default.createElement("div",{className:"confirm-approve-content__card-wrapper"},F&&n.default.createElement(d.default,{paddingTop:0,paddingRight:6,paddingBottom:4,paddingLeft:6},n.default.createElement(p.default,{userAcknowledgedGasMissing:M,setUserAcknowledgedGasMissing:()=>x(!0)})),this.renderApproveContentCard({symbol:n.default.createElement(w.Icon,{name:w.ICON_NAMES.TAG}),title:s("transactionFee"),showEdit:!0,showAdvanceGasFeeOptions:!0,onEditClick:l,content:this.renderTransactionDetailsContent(),noBorder:f||!D,footer:!f&&n.default.createElement("div",{className:"confirm-approve-content__view-full-tx-button-wrapper",onClick:()=>this.setState({showFullTxDetails:!this.state.showFullTxDetails})},n.default.createElement("div",{className:"confirm-approve-content__view-full-tx-button cursor-pointer"},n.default.createElement("div",{className:"confirm-approve-content__small-blue-text"},this.state.showFullTxDetails?s("hideFullTransactionDetails"):s("viewFullTransactionDetails")),n.default.createElement("i",{className:(0,r.default)({"fa fa-caret-up":D,"fa fa-caret-down":!D})})))}),f&&this.renderApproveContentCard({showHeader:!1,content:this.renderCustomNonceContent(),useNonceField:f,noBorder:!D,footer:n.default.createElement("div",{className:"confirm-approve-content__view-full-tx-button-wrapper",onClick:()=>this.setState({showFullTxDetails:!this.state.showFullTxDetails})},n.default.createElement("div",{className:"confirm-approve-content__view-full-tx-button cursor-pointer"},n.default.createElement("div",{className:"confirm-approve-content__small-blue-text"},this.state.showFullTxDetails?s("hideFullTransactionDetails"):s("viewFullTransactionDetails")),n.default.createElement("i",{className:(0,r.default)({"fa fa-caret-up":D,"fa fa-caret-down":!D})})))})),S?n.default.createElement("div",{className:"confirm-approve-content__ledger-instruction-wrapper"},n.default.createElement(y.default,{showDataInstruction:Boolean(null===(a=_.txParams)||void 0===a?void 0:a.data)})):null,D?this.renderFullDetails():null)}}a.default=I,C(I,"contextTypes",{t:s.default.func}),C(I,"propTypes",{tokenSymbol:s.default.string,siteImage:s.default.string,showCustomizeGasModal:s.default.func,origin:s.default.string,data:s.default.string,toAddress:s.default.string,currentCurrency:s.default.string,nativeCurrency:s.default.string,fiatTransactionTotal:s.default.string,ethTransactionTotal:s.default.string,useNonceField:s.default.bool,customNonceValue:s.default.string,updateCustomNonce:s.default.func,getNextNonce:s.default.func,nextNonce:s.default.number,showCustomizeNonceModal:s.default.func,warning:s.default.string,txData:s.default.object,fromAddressIsLedger:s.default.bool,chainId:s.default.string,tokenAddress:s.default.string,rpcPrefs:s.default.object,isContract:s.default.bool,hexTransactionTotal:s.default.string,isMultiLayerFeeNetwork:s.default.bool,supportsEIP1559:s.default.bool,assetName:s.default.string,tokenId:s.default.string,assetStandard:s.default.string,isSetApproveForAll:s.default.bool,isApprovalOrRejection:s.default.bool,userAddress:s.default.string,userAcknowledgedGasMissing:s.default.bool,setUserAcknowledgedGasMissing:s.default.func,renderSimulationFailureWarning:s.default.bool,useCurrencyRateCheck:s.default.bool})}}},{package:"$root$",file:"ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js"}],[4165,{"./confirm-approve-content.component":4164},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-approve-content.component"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-approve/confirm-approve-content/index.js"}],[4166,{"../../../shared/constants/gas":3404,"../../../shared/constants/transaction":3417,"../../../shared/lib/transactions-controller-utils":3425,"../../../shared/modules/contract-utils":3430,"../../../shared/modules/transaction.utils":3444,"../../components/app/advanced-gas-fee-popover":3471,"../../components/app/edit-gas-fee-popover":3560,"../../components/app/edit-gas-popover/edit-gas-popover.component":3566,"../../components/ui/loading-screen":3973,"../../contexts/gasFee":4046,"../../contexts/transaction-modal":4049,"../../ducks/metamask/metamask":4062,"../../helpers/utils/token-util":4105,"../../hooks/useApproveTransaction":4121,"../../hooks/useSimulationFailureWarning":4139,"../../selectors":4436,"../../store/actions":4443,"../confirm-contract-interaction":4170,"../confirm-transaction-base":4192,"../token-allowance/token-allowance":4426,"./confirm-approve-content":4165,"./confirm-approve.util":4167,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=I;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=C(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=O(e("prop-types")),r=e("react-redux"),o=O(e("../confirm-transaction-base")),i=e("../../../shared/constants/gas"),c=e("../../store/actions"),u=e("../../helpers/utils/token-util"),l=e("../../../shared/modules/contract-utils"),d=e("../../contexts/gasFee"),m=e("../../contexts/transaction-modal"),p=e("../../ducks/metamask/metamask"),f=O(e("../confirm-contract-interaction")),g=e("../../selectors"),T=e("../../hooks/useApproveTransaction"),h=e("../../hooks/useSimulationFailureWarning"),E=O(e("../../components/app/advanced-gas-fee-popover")),v=O(e("../../components/app/edit-gas-fee-popover")),_=O(e("../../components/app/edit-gas-popover/edit-gas-popover.component")),y=O(e("../../components/ui/loading-screen")),S=e("../../../shared/modules/transaction.utils"),k=e("../../../shared/constants/transaction"),A=e("../../../shared/lib/transactions-controller-utils"),w=O(e("../token-allowance/token-allowance")),b=e("./confirm-approve.util"),N=O(e("./confirm-approve-content"));function O(e){return e&&e.__esModule?e:{default:e}}function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(C=function(e){return e?a:t})(e)}function I({assetStandard:e,assetName:t,userBalance:a,tokenSymbol:s,decimals:O,tokenImage:C,tokenAmount:I,tokenId:P,userAddress:R,toAddress:M,tokenAddress:x,transaction:F,ethTransactionTotal:D,fiatTransactionTotal:G,hexTransactionTotal:U,isSetApproveForAll:L}){const j=(0,r.useDispatch)(),{txParams:{data:$}={}}=F,H=(0,r.useSelector)(g.getCurrentCurrency),W=(0,r.useSelector)(p.getNativeCurrency),B=(0,r.useSelector)(g.getSubjectMetadata),q=(0,r.useSelector)(g.getUseNonceField),V=(0,r.useSelector)(g.getNextSuggestedNonce),K=(0,r.useSelector)(g.getCustomNonceValue),Y=(0,r.useSelector)(g.getCurrentChainId),X=(0,r.useSelector)(g.getRpcPrefsForCurrentProvider),Q=(0,r.useSelector)(g.getIsMultiLayerFeeNetwork),z=(0,r.useSelector)(g.checkNetworkAndAccountSupports1559),Z=(0,r.useSelector)((J=R,e=>(0,p.isAddressLedger)(e,J)));var J;const ee=(0,r.useSelector)(g.getUseCurrencyRateCheck),[te,ae]=(0,n.useState)(""),[ne,se]=(0,n.useState)(""),[re,oe]=(0,n.useState)(!1),[ie,ce]=(0,n.useState)(!1),ue=z,le=(0,n.useRef)(I),{approveTransaction:de,showCustomizeGasPopover:me,closeCustomizeGasPopover:pe}=(0,T.useApproveTransaction)(),fe=(0,h.useSimulationFailureWarning)(ie);(0,n.useEffect)((()=>{te&&le.current!==I&&ae(I),le.current=I}),[te,I]);const ge=(0,n.useRef)(V),Te=(0,n.useRef)(K);(0,n.useEffect)((()=>{ge.current===V&&Te.current===K||se(null!==V&&K>V?`Nonce is higher than suggested nonce of ${V}`:""),Te.current=K,ge.current=V}),[K,V]);const he=(0,n.useCallback)((async()=>{const{isContractAddress:e}=await(0,l.readAddressAsContract)(global.eth,M);oe(e)}),[oe,M]);(0,n.useEffect)((()=>{he()}),[he]);const{origin:Ee}=F,ve=Ee||"",{iconUrl:_e=""}=B[Ee]||{};let ye;e!==k.TokenStandard.ERC721&&e!==k.TokenStandard.ERC1155||(ye=t);const Se=a?(0,A.calcTokenAmount)(a,O).toString(10):"",ke=te?(0,b.getCustomTxParamsData)($,{customPermissionAmount:te,decimals:O}):null,Ae=(0,S.parseStandardTokenTransactionData)($),we=(0,u.getTokenApprovedParam)(Ae);return s===undefined&&t===undefined?n.default.createElement(y.default,null):e===undefined?n.default.createElement(f.default,null):e===k.TokenStandard.ERC20?n.default.createElement(d.GasFeeContextProvider,{transaction:F},n.default.createElement(m.TransactionModalContextProvider,null,n.default.createElement(w.default,{origin:ve,siteImage:_e,showCustomizeGasModal:de,useNonceField:q,currentCurrency:H,nativeCurrency:W,ethTransactionTotal:D,fiatTransactionTotal:G,hexTransactionTotal:U,txData:F,isMultiLayerFeeNetwork:Q,supportsEIP1559:ue,userAddress:R,tokenAddress:x,data:$,isSetApproveForAll:L,isApprovalOrRejection:we,dappProposedTokenAmount:I,currentTokenBalance:Se,toAddress:M,tokenSymbol:s,decimals:O,fromAddressIsLedger:Z}),me&&!ue&&n.default.createElement(_.default,{onClose:pe,mode:i.EditGasModes.modifyInPlace,transaction:F}),ue&&n.default.createElement(n.default.Fragment,null,n.default.createElement(v.default,null),n.default.createElement(E.default,null)))):n.default.createElement(d.GasFeeContextProvider,{transaction:F},n.default.createElement(o.default,{toAddress:M,identiconAddress:M,showAccountInHeader:!0,title:ye,tokenAddress:x,customTokenAmount:String(te),dappProposedTokenAmount:I,currentTokenBalance:Se,isApprovalOrRejection:we,contentComponent:n.default.createElement(m.TransactionModalContextProvider,null,n.default.createElement(N.default,{userAddress:R,isSetApproveForAll:L,isApprovalOrRejection:we,siteImage:_e,origin:ve,tokenSymbol:s,tokenImage:C,tokenId:P,assetName:t,assetStandard:e,tokenAddress:x,showCustomizeGasModal:de,data:ke||$,toAddress:M,currentCurrency:H,nativeCurrency:W,ethTransactionTotal:D,fiatTransactionTotal:G,hexTransactionTotal:U,useNonceField:q,nextNonce:V,customNonceValue:K,userAcknowledgedGasMissing:ie,setUserAcknowledgedGasMissing:ce,renderSimulationFailureWarning:fe,updateCustomNonce:e=>{j((0,c.updateCustomNonce)(e))},getNextNonce:()=>j((0,c.getNextNonce)()),showCustomizeNonceModal:({useNonceField:e,nextNonce:t,customNonceValue:a,updateCustomNonce:n,getNextNonce:s})=>j((0,c.showModal)({name:"CUSTOMIZE_NONCE",useNonceField:e,nextNonce:t,customNonceValue:a,updateCustomNonce:n,getNextNonce:s})),warning:ne,txData:F,fromAddressIsLedger:Z,chainId:Y,rpcPrefs:X,isContract:re,isMultiLayerFeeNetwork:Q,supportsEIP1559:ue,useCurrencyRateCheck:ee}),me&&!ue&&n.default.createElement(_.default,{onClose:pe,mode:i.EditGasModes.modifyInPlace,transaction:F}),ue&&n.default.createElement(n.default.Fragment,null,n.default.createElement(v.default,null),n.default.createElement(E.default,null))),hideSenderToRecipient:!0,customTxParamsData:ke,assetStandard:e}))}I.propTypes={assetStandard:s.default.string,assetName:s.default.string,tokenAddress:s.default.string,userBalance:s.default.string,tokenSymbol:s.default.string,decimals:s.default.string,tokenImage:s.default.string,tokenAmount:s.default.string,tokenId:s.default.string,userAddress:s.default.string,toAddress:s.default.string,transaction:s.default.shape({origin:s.default.string,txParams:s.default.shape({data:s.default.string,to:s.default.string,from:s.default.string})}),ethTransactionTotal:s.default.string,fiatTransactionTotal:s.default.string,hexTransactionTotal:s.default.string,isSetApproveForAll:s.default.bool}}}},{package:"$root$",file:"ui/pages/confirm-approve/confirm-approve.js"}],[4167,{"../../../shared/constants/transaction":3417,"../../../shared/lib/swaps-utils":3422,"../../../shared/modules/conversion.utils":3431,"../../../shared/modules/transaction.utils":3444,"../../helpers/utils/token-util":4105},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getCustomTxParamsData=function(e,{customPermissionAmount:t,decimals:a}){const c=(0,r.parseStandardTokenTransactionData)(e);if(!c)throw new Error("Invalid data");if(c.name!==s.TransactionType.tokenMethodApprove)throw new Error(`Invalid data; should be 'approve' method, but instead is '${c.name}'`);let u=(0,o.getTokenAddressParam)(c);u.startsWith("0x")&&(u=u.substring(2));const[l,d]=e.split(u);if(!l||!d)throw new Error("Invalid data");if(64!==d.length)throw new Error("Invalid token value; should be exactly 64 hex digits long (u256)");let m=(0,i.decimalToHex)((0,n.calcTokenValue)(t,a));if(m.length>64)throw new Error("Custom value is larger than u256");m=m.padStart(d.length,"0");return`${l}${u}${m}`};var n=e("../../../shared/lib/swaps-utils"),s=e("../../../shared/constants/transaction"),r=e("../../../shared/modules/transaction.utils"),o=e("../../helpers/utils/token-util"),i=e("../../../shared/modules/conversion.utils")}}},{package:"$root$",file:"ui/pages/confirm-approve/confirm-approve.util.js"}],[4168,{"./confirm-approve":4166},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-approve"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-approve/index.js"}],[4169,{"../../../shared/constants/transaction":3417,"../../ducks/confirm-transaction/confirm-transaction.duck":4055,"../../ducks/send":4064,"../../helpers/constants/routes":4074,"../confirm-transaction-base":4192,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(){const e=(0,s.useDispatch)(),t=(0,r.useHistory)(),a=a=>{(async({txData:t})=>{const{id:a}=t;await e((0,c.editExistingTransaction)(l.AssetType.native,a.toString())),e((0,u.clearConfirmTransaction)())})(a).then((()=>{t.push(i.SEND_ROUTE)}))};return n.default.createElement(o.default,{actionKey:"confirm",onEdit:e=>a(e)})};var n=d(e("react")),s=e("react-redux"),r=e("react-router-dom"),o=d(e("../confirm-transaction-base")),i=e("../../helpers/constants/routes"),c=e("../../ducks/send"),u=e("../../ducks/confirm-transaction/confirm-transaction.duck"),l=e("../../../shared/constants/transaction");function d(e){return e&&e.__esModule?e:{default:e}}}}},{package:"$root$",file:"ui/pages/confirm-contract-interaction/confirm-contract-interaction.js"}],[4170,{"./confirm-contract-interaction":4169},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-contract-interaction"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-contract-interaction/index.js"}],[4171,{"../../../shared/constants/common":3403,"../../../shared/constants/metametrics":3408,"../../../shared/constants/time":3415,"../../../shared/modules/Numeric":3427,"../../../shared/modules/conversion.utils":3431,"../../components/app/account-list-item":3447,"../../components/component-library/icon/deprecated":3836,"../../components/ui/identicon":3962,"../../components/ui/page-container":3992,"../../components/ui/tooltip":4035,"../../helpers/constants/design-system":4070,"../../helpers/utils/confirm-tx.util":4090,classnames:1980,"copy-to-clipboard":2032,loglevel:2944,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=y(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=_(e("prop-types")),r=_(e("copy-to-clipboard")),o=_(e("classnames")),i=_(e("loglevel")),c=_(e("../../components/app/account-list-item")),u=_(e("../../components/ui/identicon")),l=_(e("../../components/ui/tooltip")),d=e("../../components/ui/page-container"),m=e("../../../shared/constants/metametrics"),p=e("../../../shared/constants/time"),f=e("../../../shared/modules/Numeric"),g=e("../../../shared/constants/common"),T=e("../../components/component-library/icon/deprecated"),h=e("../../helpers/constants/design-system"),E=e("../../helpers/utils/confirm-tx.util"),v=e("../../../shared/modules/conversion.utils");function _(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(y=function(e){return e?a:t})(e)}function S(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class k extends n.Component{constructor(...e){super(...e),S(this,"state",{copyToClipboardPressed:!1,hasCopied:!1}),S(this,"copyMessage",(()=>{(0,r.default)(this.state.rawMessage),this.context.trackEvent({category:m.MetaMetricsEventCategory.Messages,event:"Copy",properties:{action:"Decrypt Message Copy",legacy_event:!0}}),this.setState({hasCopied:!0}),setTimeout((()=>this.setState({hasCopied:!1})),3*p.SECOND)})),S(this,"renderHeader",(()=>n.default.createElement("div",{className:"request-decrypt-message__header"},n.default.createElement("div",{className:"request-decrypt-message__header-background"}),n.default.createElement("div",{className:"request-decrypt-message__header__text"},this.context.t("decryptRequest")),n.default.createElement("div",{className:"request-decrypt-message__header__tip-container"},n.default.createElement("div",{className:"request-decrypt-message__header__tip"}))))),S(this,"renderAccount",(()=>{const{fromAccount:e}=this.props,{t:t}=this.context;return n.default.createElement("div",{className:"request-decrypt-message__account"},n.default.createElement("div",{className:"request-decrypt-message__account-text"},`${t("account")}:`),n.default.createElement("div",{className:"request-decrypt-message__account-item"},n.default.createElement(c.default,{account:e})))})),S(this,"renderBalance",(()=>{const{conversionRate:e,nativeCurrency:t,currentCurrency:a,fromAccount:{balance:s}}=this.props,{t:r}=this.context,o=e?(0,E.formatCurrency)((0,v.getValueFromWeiHex)({value:s,fromCurrency:t,toCurrency:a,conversionRate:e,numberOfDecimals:6,toDenomination:g.EtherDenomination.ETH}),a):new f.Numeric(s,16,g.EtherDenomination.WEI).toDenomination(g.EtherDenomination.ETH).round(6).toBase(10).toString();return n.default.createElement("div",{className:"request-decrypt-message__balance"},n.default.createElement("div",{className:"request-decrypt-message__balance-text"},`${r("balance")}:`),n.default.createElement("div",{className:"request-decrypt-message__balance-value"},`${o} ${e?null==a?void 0:a.toUpperCase():t}`))})),S(this,"renderRequestIcon",(()=>{const{requesterAddress:e}=this.props;return n.default.createElement("div",{className:"request-decrypt-message__request-icon"},n.default.createElement(u.default,{diameter:40,address:e}))})),S(this,"renderAccountInfo",(()=>n.default.createElement("div",{className:"request-decrypt-message__account-info"},this.renderAccount(),this.renderRequestIcon(),this.renderBalance()))),S(this,"renderBody",(()=>{const{decryptMessageInline:e,subjectMetadata:t,txData:a}=this.props,{t:s}=this.context,r=t[a.msgParams.origin],i=(null==r?void 0:r.name)||a.msgParams.origin,c=s("decryptMessageNotice",[a.msgParams.origin]),{hasCopied:u,hasDecrypted:d,hasError:m,rawMessage:p,errorMessage:f,copyToClipboardPressed:g}=this.state;return n.default.createElement("div",{className:"request-decrypt-message__body"},this.renderAccountInfo(),n.default.createElement("div",{className:"request-decrypt-message__visual"},n.default.createElement("section",null,null!=r&&r.iconUrl?n.default.createElement("img",{className:"request-decrypt-message__visual-identicon",src:r.iconUrl,alt:""}):n.default.createElement("i",{className:"request-decrypt-message__visual-identicon--default"},i.charAt(0).toUpperCase()),n.default.createElement("div",{className:"request-decrypt-message__notice"},c))),n.default.createElement("div",{className:"request-decrypt-message__message"},n.default.createElement("div",{className:"request-decrypt-message__message-text"},d||m?p:a.msgParams.data,m?f:""),n.default.createElement("div",{className:(0,o.default)("request-decrypt-message__message-cover",{"request-decrypt-message__message-lock--pressed":d||m})}),n.default.createElement("div",{className:(0,o.default)("request-decrypt-message__message-lock",{"request-decrypt-message__message-lock--pressed":d||m}),onClick:t=>{e(a,t).then((e=>{e.error?this.setState({hasError:!0,errorMessage:this.context.t("decryptInlineError",[e.error])}):this.setState({hasDecrypted:!0,rawMessage:e.rawData})}))}},n.default.createElement("div",{className:"request-decrypt-message__message-lock__container"},n.default.createElement("i",{className:"fa fa-lock fa-lg request-decrypt-message__message-lock__container__icon"}),n.default.createElement("div",{className:"request-decrypt-message__message-lock__container__text"},s("decryptMetamask"))))),d?n.default.createElement("div",{className:(0,o.default)({"request-decrypt-message__message-copy":!0,"request-decrypt-message__message-copy--pressed":g}),onClick:()=>this.copyMessage(),onMouseDown:()=>this.setState({copyToClipboardPressed:!0}),onMouseUp:()=>this.setState({copyToClipboardPressed:!1})},n.default.createElement(l.default,{position:"bottom",title:s(u?"copiedExclamation":"copyToClipboard"),wrapperClassName:"request-decrypt-message__message-copy-tooltip",style:{display:"flex",alignItems:"center"}},n.default.createElement("div",{className:"request-decrypt-message__message-copy-text"},s("decryptCopy")),n.default.createElement(T.Icon,{name:u?T.ICON_NAMES.COPY_SUCCESS:T.ICON_NAMES.COPY,color:h.IconColor.primaryDefault}))):n.default.createElement("div",null))})),S(this,"renderFooter",(()=>{const{cancelDecryptMessage:e,clearConfirmTransaction:t,decryptMessage:a,history:s,mostRecentOverviewPage:r,txData:o}=this.props,{trackEvent:i,t:c}=this.context;return n.default.createElement(d.PageContainerFooter,{cancelText:c("cancel"),submitText:c("decrypt"),onCancel:async a=>{await e(o,a),i({category:m.MetaMetricsEventCategory.Messages,event:"Cancel",properties:{action:"Decrypt Message Request",legacy_event:!0}}),t(),s.push(r)},onSubmit:async e=>{await a(o,e),i({category:m.MetaMetricsEventCategory.Messages,event:"Confirm",properties:{action:"Decrypt Message Request",legacy_event:!0}}),t(),s.push(r)}})})),S(this,"render",(()=>this.props.txData?n.default.createElement("div",{className:"request-decrypt-message__container"},this.renderHeader(),this.renderBody(),this.renderFooter()):(i.default.warn("ConfirmDecryptMessage Page: Missing txData prop."),null)))}}a.default=k,S(k,"contextTypes",{t:s.default.func.isRequired,trackEvent:s.default.func.isRequired}),S(k,"propTypes",{fromAccount:s.default.shape({address:s.default.string.isRequired,balance:s.default.string,name:s.default.string}).isRequired,clearConfirmTransaction:s.default.func.isRequired,cancelDecryptMessage:s.default.func.isRequired,decryptMessage:s.default.func.isRequired,decryptMessageInline:s.default.func.isRequired,history:s.default.object.isRequired,mostRecentOverviewPage:s.default.string.isRequired,requesterAddress:s.default.string,txData:s.default.object,subjectMetadata:s.default.object,nativeCurrency:s.default.string.isRequired,currentCurrency:s.default.string.isRequired,conversionRate:s.default.number})}}},{package:"$root$",file:"ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js"}],[4172,{"../../ducks/confirm-transaction/confirm-transaction.duck":4055,"../../ducks/history/history":4059,"../../ducks/metamask/metamask":4062,"../../selectors":4436,"../../store/actions":4443,"./confirm-decrypt-message.component":4171,lodash:2932,"react-redux":3130,"react-router-dom":3150,redux:3194},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,s=e("react-redux"),r=e("redux"),o=e("react-router-dom"),i=e("lodash"),c=e("../../store/actions"),u=e("../../selectors"),l=e("../../ducks/confirm-transaction/confirm-transaction.duck"),d=e("../../ducks/history/history"),m=e("../../ducks/metamask/metamask"),p=(n=e("./confirm-decrypt-message.component"))&&n.__esModule?n:{default:n};var f=(0,r.compose)(o.withRouter,(0,s.connect)((function(e){var t;const{metamask:{subjectMetadata:a={}}}=e,{useNativeCurrencyAsPrimaryCurrency:n}=(0,u.getPreferences)(e),s=(0,u.unconfirmedTransactionsListSelector)(e),r=(0,i.cloneDeep)(s[0]);return{txData:r,subjectMetadata:a,fromAccount:(0,u.getTargetAccountWithSendEtherInfo)(e,null==r||null===(t=r.msgParams)||void 0===t?void 0:t.from),requester:null,requesterAddress:null,conversionRate:n?null:(0,u.conversionRateSelector)(e),mostRecentOverviewPage:(0,d.getMostRecentOverviewPage)(e),nativeCurrency:(0,m.getNativeCurrency)(e),currentCurrency:(0,u.getCurrentCurrency)(e)}}),(function(e){return{goHome:()=>e((0,c.goHome)()),clearConfirmTransaction:()=>e((0,l.clearConfirmTransaction)()),decryptMessage:(t,a)=>{const n=t.msgParams;return n.metamaskId=t.id,a.stopPropagation(a),e((0,c.decryptMsg)(n))},cancelDecryptMessage:(t,a)=>(a.stopPropagation(a),e((0,c.cancelDecryptMsg)(t))),decryptMessageInline:(t,a)=>{const n=t.msgParams;return n.metamaskId=t.id,a.stopPropagation(a),e((0,c.decryptMsgInline)(n))}}})))(p.default);a.default=f}}},{package:"$root$",file:"ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js"}],[4173,{"./confirm-decrypt-message.container":4172},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-decrypt-message.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-decrypt-message/index.js"}],[4174,{"../../../shared/modules/buffer-utils":3429,"../../components/component-library":3840,"../../components/ui/box":3900,"../../helpers/constants/design-system":4070,"../confirm-transaction-base":4192,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=d(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=l(e("prop-types")),r=l(e("../confirm-transaction-base")),o=e("../../../shared/modules/buffer-utils"),i=l(e("../../components/ui/box")),c=e("../../components/component-library"),u=e("../../helpers/constants/design-system");function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(d=function(e){return e?a:t})(e)}function m(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class p extends n.Component{renderData(){const{t:e}=this.context,{txData:{origin:t,txParams:{data:a}={}}={}}=this.props;return n.default.createElement(i.default,{color:u.Color.textAlternative,padding:4},n.default.createElement(i.default,{backgroundColor:u.Color.backgroundAlternative,padding:4,variant:u.TextVariant.bodySm},n.default.createElement(i.default,{display:u.DISPLAY.FLEX},n.default.createElement(c.Text,{backgroundColor:u.Color.backgroundAlternative,marginBottom:1,paddingRight:4,variant:u.TextVariant.bodySmBold},`${e("origin")}:`),n.default.createElement(c.Text,{overflowWrap:u.OVERFLOW_WRAP.BREAK_WORD,variant:u.TextVariant.bodySm},t)),n.default.createElement(i.default,{display:u.DISPLAY.FLEX},n.default.createElement(c.Text,{backgroundColor:u.Color.backgroundAlternative,paddingRight:4,variant:u.TextVariant.bodySmBold},`${e("bytes")}:`),n.default.createElement(c.Text,{variant:u.TextVariant.bodySm},(0,o.toBuffer)(a).length))),n.default.createElement(c.Text,{as:"h3",paddingBottom:3,paddingTop:2,textTransform:u.TEXT_TRANSFORM.UPPERCASE,variant:u.TextVariant.bodySm},`${e("hexData")}:`),n.default.createElement(c.Text,{backgroundColor:u.Color.backgroundAlternative,overflowWrap:u.OVERFLOW_WRAP.BREAK_WORD,padding:4,variant:u.TextVariant.bodySm},a))}render(){return n.default.createElement(r.default,{actionKey:"contractDeployment",dataComponent:this.renderData()})}}a.default=p,m(p,"contextTypes",{t:s.default.func}),m(p,"propTypes",{txData:s.default.object})}}},{package:"$root$",file:"ui/pages/confirm-deploy-contract/confirm-deploy-contract.component.js"}],[4175,{"./confirm-deploy-contract.component":4174,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,s=e("react-redux"),r=(n=e("./confirm-deploy-contract.component"))&&n.__esModule?n:{default:n};var o=(0,s.connect)((e=>{const{confirmTransaction:{txData:t}={}}=e;return{txData:t}}))(r.default);a.default=o}}},{package:"$root$",file:"ui/pages/confirm-deploy-contract/confirm-deploy-contract.container.js"}],[4176,{"./confirm-deploy-contract.container":4175},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-deploy-contract.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-deploy-contract/index.js"}],[4177,{"../../../shared/constants/common":3403,"../../../shared/constants/metametrics":3408,"../../../shared/modules/Numeric":3427,"../../../shared/modules/conversion.utils":3431,"../../components/app/account-list-item":3447,"../../components/ui/identicon":3962,"../../components/ui/page-container":3992,"../../components/ui/site-origin":4015,"../../helpers/utils/confirm-tx.util":4090,loglevel:2944,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=T(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=g(e("prop-types")),r=g(e("loglevel")),o=g(e("../../components/app/account-list-item")),i=g(e("../../components/ui/identicon")),c=e("../../components/ui/page-container"),u=e("../../../shared/constants/metametrics"),l=g(e("../../components/ui/site-origin")),d=e("../../../shared/modules/Numeric"),m=e("../../../shared/constants/common"),p=e("../../helpers/utils/confirm-tx.util"),f=e("../../../shared/modules/conversion.utils");function g(e){return e&&e.__esModule?e:{default:e}}function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(T=function(e){return e?a:t})(e)}function h(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class E extends n.Component{constructor(...e){super(...e),h(this,"renderHeader",(()=>n.default.createElement("div",{className:"request-encryption-public-key__header"},n.default.createElement("div",{className:"request-encryption-public-key__header-background"}),n.default.createElement("div",{className:"request-encryption-public-key__header__text"},this.context.t("encryptionPublicKeyRequest")),n.default.createElement("div",{className:"request-encryption-public-key__header__tip-container"},n.default.createElement("div",{className:"request-encryption-public-key__header__tip"}))))),h(this,"renderAccount",(()=>{const{fromAccount:e}=this.props,{t:t}=this.context;return n.default.createElement("div",{className:"request-encryption-public-key__account"},n.default.createElement("div",{className:"request-encryption-public-key__account-text"},`${t("account")}:`),n.default.createElement("div",{className:"request-encryption-public-key__account-item"},n.default.createElement(o.default,{account:e})))})),h(this,"renderBalance",(()=>{const{conversionRate:e,nativeCurrency:t,currentCurrency:a,fromAccount:{balance:s}}=this.props,{t:r}=this.context,o=e?(0,p.formatCurrency)((0,f.getValueFromWeiHex)({value:s,fromCurrency:t,toCurrency:a,conversionRate:e,numberOfDecimals:6,toDenomination:m.EtherDenomination.ETH}),a):new d.Numeric(s,16,m.EtherDenomination.WEI).toDenomination(m.EtherDenomination.ETH).round(6).toBase(10).toString();return n.default.createElement("div",{className:"request-encryption-public-key__balance"},n.default.createElement("div",{className:"request-encryption-public-key__balance-text"},`${r("balance")}:`),n.default.createElement("div",{className:"request-encryption-public-key__balance-value"},`${o} ${e?null==a?void 0:a.toUpperCase():t}`))})),h(this,"renderRequestIcon",(()=>{const{requesterAddress:e}=this.props;return n.default.createElement("div",{className:"request-encryption-public-key__request-icon"},n.default.createElement(i.default,{diameter:40,address:e}))})),h(this,"renderAccountInfo",(()=>n.default.createElement("div",{className:"request-encryption-public-key__account-info"},this.renderAccount(),this.renderRequestIcon(),this.renderBalance()))),h(this,"renderBody",(()=>{const{subjectMetadata:e,txData:t}=this.props,{t:a}=this.context,s=e[t.origin],r=a("encryptionPublicKeyNotice",[n.default.createElement(l.default,{siteOrigin:t.origin,key:t.origin})]),o=(null==s?void 0:s.hostname)||t.origin;return n.default.createElement("div",{className:"request-encryption-public-key__body"},this.renderAccountInfo(),n.default.createElement("div",{className:"request-encryption-public-key__visual"},n.default.createElement("section",null,null!=s&&s.iconUrl?n.default.createElement("img",{className:"request-encryption-public-key__visual-identicon",src:s.iconUrl,alt:""}):n.default.createElement("i",{className:"request-encryption-public-key__visual-identicon--default"},o.charAt(0).toUpperCase()),n.default.createElement("div",{className:"request-encryption-public-key__notice"},r))))})),h(this,"renderFooter",(()=>{const{cancelEncryptionPublicKey:e,clearConfirmTransaction:t,encryptionPublicKey:a,history:s,mostRecentOverviewPage:r,txData:o}=this.props,{t:i,trackEvent:l}=this.context;return n.default.createElement(c.PageContainerFooter,{cancelText:i("cancel"),submitText:i("provide"),onCancel:async a=>{await e(o,a),l({category:u.MetaMetricsEventCategory.Messages,event:"Cancel",properties:{action:"Encryption public key Request",legacy_event:!0}}),t(),s.push(r)},onSubmit:async e=>{await a(o,e),this.context.trackEvent({category:u.MetaMetricsEventCategory.Messages,event:"Confirm",properties:{action:"Encryption public key Request",legacy_event:!0}}),t(),s.push(r)}})})),h(this,"render",(()=>this.props.txData?n.default.createElement("div",{className:"request-encryption-public-key__container"},this.renderHeader(),this.renderBody(),this.renderFooter()):(r.default.warn("ConfirmEncryptionPublicKey Page: Missing txData prop."),null)))}}a.default=E,h(E,"contextTypes",{t:s.default.func.isRequired,trackEvent:s.default.func.isRequired}),h(E,"propTypes",{fromAccount:s.default.shape({address:s.default.string.isRequired,balance:s.default.string,name:s.default.string}).isRequired,clearConfirmTransaction:s.default.func.isRequired,cancelEncryptionPublicKey:s.default.func.isRequired,encryptionPublicKey:s.default.func.isRequired,history:s.default.object.isRequired,requesterAddress:s.default.string,txData:s.default.object,subjectMetadata:s.default.object,mostRecentOverviewPage:s.default.string.isRequired,nativeCurrency:s.default.string.isRequired,currentCurrency:s.default.string.isRequired,conversionRate:s.default.number})}}},{package:"$root$",file:"ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js"}],[4178,{"../../ducks/confirm-transaction/confirm-transaction.duck":4055,"../../ducks/history/history":4059,"../../ducks/metamask/metamask":4062,"../../selectors":4436,"../../store/actions":4443,"./confirm-encryption-public-key.component":4177,"react-redux":3130,"react-router-dom":3150,redux:3194},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,s=e("react-redux"),r=e("redux"),o=e("react-router-dom"),i=e("../../store/actions"),c=e("../../selectors"),u=e("../../ducks/confirm-transaction/confirm-transaction.duck"),l=e("../../ducks/history/history"),d=e("../../ducks/metamask/metamask"),m=(n=e("./confirm-encryption-public-key.component"))&&n.__esModule?n:{default:n};var p=(0,r.compose)(o.withRouter,(0,s.connect)((function(e){const{metamask:{subjectMetadata:t={}}}=e,{useNativeCurrencyAsPrimaryCurrency:a}=(0,c.getPreferences)(e),n=(0,c.unconfirmedTransactionsListSelector)(e)[0];return{txData:n,subjectMetadata:t,fromAccount:(0,c.getTargetAccountWithSendEtherInfo)(e,null==n?void 0:n.msgParams),requester:null,requesterAddress:null,conversionRate:a?null:(0,c.conversionRateSelector)(e),mostRecentOverviewPage:(0,l.getMostRecentOverviewPage)(e),nativeCurrency:(0,d.getNativeCurrency)(e),currentCurrency:(0,c.getCurrentCurrency)(e)}}),(function(e){return{goHome:()=>e((0,i.goHome)()),clearConfirmTransaction:()=>e((0,u.clearConfirmTransaction)()),encryptionPublicKey:(t,a)=>{const n={data:t.msgParams,metamaskId:t.id};return a.stopPropagation(),e((0,i.encryptionPublicKeyMsg)(n))},cancelEncryptionPublicKey:(t,a)=>(a.stopPropagation(),e((0,i.cancelEncryptionPublicKeyMsg)(t)))}})))(m.default);a.default=p}}},{package:"$root$",file:"ui/pages/confirm-encryption-public-key/confirm-encryption-public-key.container.js"}],[4179,{"./confirm-encryption-public-key.container":4178},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-encryption-public-key.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-encryption-public-key/index.js"}],[4180,{"../../../shared/constants/metametrics":3408,"../../../shared/constants/transaction":3417,"../../components/ui/button":3904,"../../components/ui/identicon":3962,"../../components/ui/token-balance":4030,"../../contexts/i18n":4047,"../../contexts/metametrics":4048,"../../ducks/history/history":4059,"../../ducks/metamask/metamask":4062,"../../helpers/constants/routes":4074,"../../store/actions":4443,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=E(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=e("react-redux"),r=e("react-router-dom"),o=e("../../helpers/constants/routes"),i=h(e("../../components/ui/button")),c=h(e("../../components/ui/identicon")),u=h(e("../../components/ui/token-balance")),l=e("../../contexts/i18n"),d=e("../../contexts/metametrics"),m=e("../../ducks/history/history"),p=e("../../ducks/metamask/metamask"),f=e("../../store/actions"),g=e("../../../shared/constants/metametrics"),T=e("../../../shared/constants/transaction");function h(e){return e&&e.__esModule?e:{default:e}}function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(E=function(e){return e?a:t})(e)}var v=()=>{const e=(0,n.useContext)(l.I18nContext),t=(0,s.useDispatch)(),a=(0,r.useHistory)(),h=(0,n.useContext)(d.MetaMetricsContext),E=(0,s.useSelector)(m.getMostRecentOverviewPage),v=(0,s.useSelector)(p.getPendingTokens),_=(0,n.useCallback)((async()=>{var e;await t((0,f.addTokens)(v));const n=Object.values(v),s=null==n||null===(e=n[0].address)||void 0===e?void 0:e.toLowerCase();n.forEach((e=>{h({event:g.MetaMetricsEventName.TokenAdded,category:g.MetaMetricsEventCategory.Wallet,sensitiveProperties:{token_symbol:e.symbol,token_contract_address:e.address,token_decimal_precision:e.decimals,unlisted:e.unlisted,source:e.isCustom?g.MetaMetricsTokenEventSource.Custom:g.MetaMetricsTokenEventSource.List,token_standard:T.TokenStandard.ERC20,asset_type:T.AssetType.token}})})),t((0,f.clearPendingTokens)()),s?a.push(`${o.ASSET_ROUTE}/${s}`):a.push(E)}),[t,a,E,v,h]);return(0,n.useEffect)((()=>{0===Object.keys(v).length&&a.push(E)}),[]),n.default.createElement("div",{className:"page-container"},n.default.createElement("div",{className:"page-container__header"},n.default.createElement("div",{className:"page-container__title"},e("importTokensCamelCase")),n.default.createElement("div",{className:"page-container__subtitle"},e("likeToImportTokens"))),n.default.createElement("div",{className:"page-container__content"},n.default.createElement("div",{className:"confirm-import-token"},n.default.createElement("div",{className:"confirm-import-token__header"},n.default.createElement("div",{className:"confirm-import-token__token"},e("token")),n.default.createElement("div",{className:"confirm-import-token__balance"},e("balance"))),n.default.createElement("div",{className:"confirm-import-token__token-list"},Object.entries(v).map((([e,t])=>{const{name:a,symbol:s}=t;return n.default.createElement("div",{className:"confirm-import-token__token-list-item",key:e},n.default.createElement("div",{className:"confirm-import-token__token confirm-import-token__data"},n.default.createElement(c.default,{className:"confirm-import-token__token-icon",diameter:48,address:e}),n.default.createElement("div",{className:"confirm-import-token__name"},((e,t)=>e===undefined?t:`${e} (${t})`)(a,s))),n.default.createElement("div",{className:"confirm-import-token__balance"},n.default.createElement(u.default,{token:t})))}))))),n.default.createElement("div",{className:"page-container__footer"},n.default.createElement("footer",null,n.default.createElement(i.default,{type:"secondary",large:!0,className:"page-container__footer-button",onClick:()=>{t((0,f.clearPendingTokens)()),a.push(o.IMPORT_TOKEN_ROUTE)}},e("back")),n.default.createElement(i.default,{type:"primary",large:!0,className:"page-container__footer-button",onClick:_},e("importTokensCamelCase")))))};a.default=v}}},{package:"$root$",file:"ui/pages/confirm-import-token/confirm-import-token.js"}],[4181,{"./confirm-import-token":4180},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){var n;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var s=((n=e("./confirm-import-token"))&&n.__esModule?n:{default:n}).default;a.default=s}}},{package:"$root$",file:"ui/pages/confirm-import-token/index.js"}],[4182,{"../../helpers/constants/routes":4074,"../confirm-transaction-base":4192,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=c(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=i(e("prop-types")),r=i(e("../confirm-transaction-base")),o=e("../../helpers/constants/routes");function i(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(c=function(e){return e?a:t})(e)}function u(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class l extends n.Component{handleEdit({txData:e}){const{editTransaction:t,history:a}=this.props;t(e).then((()=>{a.push(o.SEND_ROUTE)}))}render(){return n.default.createElement(r.default,{actionKey:"confirm",onEdit:e=>this.handleEdit(e)})}}a.default=l,u(l,"contextTypes",{t:s.default.func}),u(l,"propTypes",{editTransaction:s.default.func,history:s.default.object})}}},{package:"$root$",file:"ui/pages/confirm-send-ether/confirm-send-ether.component.js"}],[4183,{"../../../shared/constants/transaction":3417,"../../ducks/confirm-transaction/confirm-transaction.duck":4055,"../../ducks/send":4064,"./confirm-send-ether.component":4182,"react-redux":3130,"react-router-dom":3150,redux:3194},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,s=e("react-redux"),r=e("redux"),o=e("react-router-dom"),i=e("../../ducks/send"),c=e("../../ducks/confirm-transaction/confirm-transaction.duck"),u=e("../../../shared/constants/transaction"),l=(n=e("./confirm-send-ether.component"))&&n.__esModule?n:{default:n};var d=(0,r.compose)(o.withRouter,(0,s.connect)(undefined,(e=>({editTransaction:async t=>{const{id:a}=t;await e((0,i.editExistingTransaction)(u.AssetType.native,a.toString())),e((0,c.clearConfirmTransaction)())}}))))(l.default);a.default=d}}},{package:"$root$",file:"ui/pages/confirm-send-ether/confirm-send-ether.container.js"}],[4184,{"./confirm-send-ether.container":4183},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-send-ether.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-send-ether/index.js"}],[4185,{"../../../shared/constants/transaction":3417,"../../ducks/confirm-transaction/confirm-transaction.duck":4055,"../../ducks/metamask/metamask":4062,"../../ducks/send":4064,"../../helpers/constants/routes":4074,"../../selectors":4436,"../../store/actions":4443,"../confirm-token-transaction-base/confirm-token-transaction-base":4188,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=T;var n=g(e("react")),s=g(e("prop-types")),r=e("react-redux"),o=e("react-router-dom"),i=g(e("../confirm-token-transaction-base/confirm-token-transaction-base")),c=e("../../helpers/constants/routes"),u=e("../../ducks/send"),l=e("../../selectors"),d=e("../../ducks/metamask/metamask"),m=e("../../ducks/confirm-transaction/confirm-transaction.duck"),p=e("../../store/actions"),f=e("../../../shared/constants/transaction");function g(e){return e&&e.__esModule?e:{default:e}}function T({assetStandard:e,toAddress:t,tokenAddress:a,assetName:s,tokenSymbol:g,tokenAmount:T,tokenId:h,transaction:E,image:v,ethTransactionTotal:_,fiatTransactionTotal:y,hexMaximumTransactionFee:S}){const k=(0,r.useDispatch)(),A=(0,o.useHistory)(),w=(0,r.useSelector)(d.getConversionRate),b=(0,r.useSelector)(d.getNativeCurrency),N=(0,r.useSelector)(l.getCurrentCurrency),O=(0,r.useSelector)(l.contractExchangeRateSelector);let C,I;return e===f.TokenStandard.ERC721?(C=s,I=`#${h}`):e===f.TokenStandard.ERC20&&(C=`${T} ${g}`),n.default.createElement(i.default,{onEdit:e=>{(async({txData:e})=>{const{id:t}=e;await k((0,u.editExistingTransaction)(f.AssetType.token,t.toString())),k((0,m.clearConfirmTransaction)()),k((0,p.showSendTokenPage)())})(e).then((()=>{A.push(c.SEND_ROUTE)}))},conversionRate:w,currentCurrency:N,nativeCurrency:b,contractExchangeRate:O,title:C,subtitle:I,assetStandard:e,assetName:s,tokenSymbol:g,tokenAmount:T,tokenId:h,transaction:E,image:v,toAddress:t,tokenAddress:a,ethTransactionTotal:_,fiatTransactionTotal:y,hexMaximumTransactionFee:S})}T.propTypes={tokenAmount:s.default.string,assetStandard:s.default.string,assetName:s.default.string,tokenSymbol:s.default.string,image:s.default.string,tokenId:s.default.string,toAddress:s.default.string,tokenAddress:s.default.string,transaction:s.default.shape({origin:s.default.string,txParams:s.default.shape({data:s.default.string,to:s.default.string,from:s.default.string})}),ethTransactionTotal:s.default.string,fiatTransactionTotal:s.default.string,hexMaximumTransactionFee:s.default.string}}}},{package:"$root$",file:"ui/pages/confirm-send-token/confirm-send-token.js"}],[4186,{"./confirm-send-token":4185},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-send-token"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-send-token/index.js"}],[4187,{"../../../shared/constants/app":3401,"../../../shared/constants/transaction":3417,"../../components/app/signature-request":3706,"../../components/app/signature-request-original":3693,"../../components/app/signature-request-siwe":3698,"../../components/ui/loading-screen":3973,"../../ducks/send":4064,"../../helpers/utils/tx-helper":4107,"../../hooks/useRouting":4134,"../../selectors":4436,"../../store/actions":4443,loglevel:2944,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=y(e("prop-types")),s=_(e("react")),r=e("react-redux"),o=e("react-router-dom"),i=y(e("loglevel")),c=_(e("../../store/actions")),u=y(e("../../helpers/utils/tx-helper")),l=y(e("../../components/app/signature-request")),d=y(e("../../components/app/signature-request-siwe")),m=y(e("../../components/app/signature-request-original")),p=y(e("../../components/ui/loading-screen")),f=e("../../hooks/useRouting"),g=e("../../selectors"),T=e("../../../shared/constants/app"),h=e("../../../shared/constants/transaction"),E=e("../../ducks/send");function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(v=function(e){return e?a:t})(e)}function _(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=v(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,a&&a.set(e,n),n}function y(e){return e&&e.__esModule?e:{default:e}}const S="message",k="personal",A="typed",w=e=>{null!=e&&e.stopPropagation&&e.stopPropagation()},b=({match:e})=>{const t=(0,r.useDispatch)(),{navigateToMostRecentOverviewPage:a}=(0,f.useRouting)(),n=(0,r.useSelector)(g.getTotalUnapprovedSignatureRequestCount),o=(0,r.useSelector)(E.getSendTo),{unapprovedTxs:v,identities:_,currentNetworkTxList:y,currentCurrency:b,unapprovedMsgs:N,unapprovedPersonalMsgs:O,unapprovedTypedMessages:C,networkId:I,blockGasLimit:P,provider:{chainId:R}}=(0,r.useSelector)((e=>e.metamask)),{txId:M}=(0,r.useSelector)((e=>e.appState)),[x,F]=(0,s.useState)();(0,s.useEffect)((()=>{0!==(0,u.default)(v||{},{},{},{},I,R).length||o||0!==n||a()}),[]),(0,s.useEffect)((()=>{if(!x)return void F({index:M,unapprovedTxs:v});let s;const{params:{id:r}={}}=e;if(r)s=y.find((({id:e})=>`${e}`===r));else{const{index:e,unapprovedTxs:t}=x,a=(0,u.default)(t,{},{},{},I,R)[e]||{};s=y.find((({id:e})=>e===a.id))||{}}const i=(0,u.default)(v||{},{},{},{},I,R);s&&s.status===h.TransactionStatus.dropped?t(c.showModal({name:"TRANSACTION_CONFIRMED",onSubmit:()=>a()})):(0!==i.length||o||0!==n||a(),F({index:M,unapprovedTxs:v}))}),[R,y,e,I,o,n,v]);const D=(()=>{const{params:{id:t}={}}=e,a=(0,u.default)(v||{},N,O,C,I,R);return i.default.info(`rendering a combined ${a.length} unconf msgs & txs`),t?a.find((({id:e})=>`${e}`===t)):a[M]})()||{},{msgParams:G}=D;if(!G)return s.default.createElement(p.default,null);const U=e=>a=>{var n;w(a);const s=D.msgParams;let r;return s.metamaskId=D.id,r=e===S?c.signMsg:e===k?c.signPersonalMsg:c.signTypedMsg,t(null===(n=r)||void 0===n?void 0:n(s))},L=e=>a=>{let n;return w(a),n=e===S?c.cancelMsg:e===k?c.cancelPersonalMsg:c.cancelTypedMsg,t(n(D))},j=(e=>{const{type:t,msgParams:{version:a,siwe:n}}=e;return t!==T.MESSAGE_TYPE.ETH_SIGN_TYPED_DATA||"V3"!==a&&"V4"!==a?null!=n&&n.isSIWEMessage?d.default:m.default:l.default})(D);return s.default.createElement(j,{txData:D,key:D.id,identities:_,currentCurrency:b,blockGasLimit:P,signMessage:U(S),signPersonalMessage:U(k),signTypedMessage:U(A),cancelMessage:L(S),cancelPersonalMessage:L(k),cancelTypedMessage:L(A)})};b.propTypes={match:n.default.shape({params:n.default.shape({id:n.default.string})})};var N=(0,o.withRouter)(b);a.default=N}}},{package:"$root$",file:"ui/pages/confirm-signature-request/index.js"}],[4188,{"../../../shared/constants/common":3403,"../../../shared/constants/network":3409,"../../../shared/constants/transaction":3417,"../../../shared/modules/conversion.utils":3431,"../../components/app/user-preferenced-currency-display":3767,"../../contexts/i18n":4047,"../../ducks/metamask/metamask":4062,"../../helpers/constants/common":4068,"../../helpers/utils/confirm-tx.util":4090,"../../selectors":4436,"../confirm-transaction-base":4192,"@metamask/etherscan-link":1221,"bignumber.js":1853,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=y;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=_(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=v(e("prop-types")),r=v(e("bignumber.js")),o=e("react-redux"),i=e("@metamask/etherscan-link"),c=e("../../contexts/i18n"),u=v(e("../confirm-transaction-base")),l=v(e("../../components/app/user-preferenced-currency-display")),d=e("../../helpers/utils/confirm-tx.util"),m=e("../../helpers/constants/common"),p=e("../../selectors"),f=e("../../ducks/metamask/metamask"),g=e("../../../shared/constants/transaction"),T=e("../../../shared/modules/conversion.utils"),h=e("../../../shared/constants/common"),E=e("../../../shared/constants/network");function v(e){return e&&e.__esModule?e:{default:e}}function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(_=function(e){return e?a:t})(e)}function y({image:e="",assetName:t,toAddress:a,tokenAddress:s,tokenAmount:v="0",tokenSymbol:_,tokenId:y,assetStandard:S,onEdit:k,ethTransactionTotal:A,fiatTransactionTotal:w,hexMaximumTransactionFee:b}){const N=(0,n.useContext)(c.I18nContext),O=(0,o.useSelector)(p.contractExchangeRateSelector),C=(0,o.useSelector)(f.getNativeCurrency),I=(0,o.useSelector)(p.getCurrentCurrency),P=(0,o.useSelector)(f.getConversionRate),R=(0,o.useSelector)(p.getRpcPrefsForCurrentProvider),M=(0,o.useSelector)(p.getCurrentChainId),x=(0,o.useSelector)(p.getSelectedAddress),F=(0,o.useSelector)(f.getNftContracts),D=Number((0,T.hexWEIToDecETH)(b)),G=e=>{const t=(null==R?void 0:R.blockExplorerUrl)||[...E.TEST_CHAINS,E.CHAIN_IDS.MAINNET].includes(M),a=F.find((e=>e.address.toLowerCase()===s.toLowerCase())),r=_||(null==a?void 0:a.name)||N("unknownCollection");if("text"===e)return r;if(t){const e=(0,i.getTokenTrackerLink)(s,M,null,x,{blockExplorerUrl:(null==R?void 0:R.blockExplorerUrl)??null});return n.default.createElement(n.default.Fragment,null,n.default.createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:s,className:"confirm-approve-content__approval-asset-link"},r))}return n.default.createElement(n.default.Fragment,null,n.default.createElement("span",{className:"confirm-approve-content__approval-asset-title",title:s},r))},U=e;let L,j,$;S===g.TokenStandard.ERC721||S===g.TokenStandard.ERC1155?(L=t||G(),j=`#${y}`,$=t||`${G("text")} #${y}`):S===g.TokenStandard.ERC20&&(L=`${v} ${_}`,$=`${v} ${_}`);const H=(0,n.useMemo)((()=>{if("0"===v||!O)return"0";const e=new r.default(v).times(new r.default(O?String(O):0)).toFixed();return(0,T.getWeiHexFromDecimalValue)({value:e,fromCurrency:h.EtherDenomination.ETH,fromDenomination:h.EtherDenomination.ETH})}),[v,O]),W=(0,n.useMemo)((()=>{if(void 0===O)return(0,d.formatCurrency)(w,I);const e=(0,d.convertTokenToFiat)({value:v,toCurrency:I,conversionRate:P,contractExchangeRate:O}),t=(0,d.addFiat)(e,w),a=(0,d.roundExponential)(t);return(0,d.formatCurrency)(a,I)}),[I,P,O,w,v]);return n.default.createElement(u.default,{toAddress:a,image:U,onEdit:k,tokenAddress:s,title:L,subtitleComponent:O===undefined&&j===undefined?n.default.createElement("span",null,N("noConversionRateAvailable")):j?n.default.createElement("span",null,j):n.default.createElement(l.default,{value:H,type:m.PRIMARY,showEthLogo:!0,hideLabel:!0}),primaryTotalTextOverride:`${$} + ${A} ${C}`,primaryTotalTextOverrideMaxAmount:`${$} + ${D} ${C}`,secondaryTotalTextOverride:W})}y.propTypes={image:s.default.string,assetName:s.default.string,toAddress:s.default.string,tokenAddress:s.default.string,tokenAmount:s.default.string,tokenSymbol:s.default.string,tokenId:s.default.string,assetStandard:s.default.string,onEdit:s.default.func,ethTransactionTotal:s.default.string,fiatTransactionTotal:s.default.string,hexMaximumTransactionFee:s.default.string}}}},{package:"$root$",file:"ui/pages/confirm-token-transaction-base/confirm-token-transaction-base.js"}],[4189,{"./confirm-token-transaction-base":4188},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-token-transaction-base"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-token-transaction-base/index.js"}],[4190,{"../../../shared/constants/metametrics":3408,"../../../shared/constants/network":3409,"../../../shared/constants/transaction":3417,"../../../shared/modules/conversion.utils":3431,"../../components/app/confirm-data":3497,"../../components/app/confirm-hexdata":3499,"../../components/app/confirm-page-container":3513,"../../components/app/confirm-subtitle":3515,"../../components/app/confirm-title":3517,"../../components/app/gas-details-item":3571,"../../components/app/gas-timing/gas-timing.component":3572,"../../components/app/ledger-instruction-field":3580,"../../components/app/multilayer-fee-message":3645,"../../components/app/transaction-alerts":3735,"../../components/app/transaction-detail-item/transaction-detail-item.component":3753,"../../components/app/transaction-detail/transaction-detail.component":3755,"../../components/app/user-preferenced-currency-display":3767,"../../components/ui/info-tooltip/info-tooltip":3965,"../../components/ui/loading-heartbeat":3970,"../../components/ui/simulation-error-message":4011,"../../components/ui/text-field":4025,"../../components/ui/typography/typography":4040,"../../contexts/transaction-modal":4049,"../../helpers/constants/common":4068,"../../helpers/constants/design-system":4070,"../../helpers/constants/error-keys":4071,"../../helpers/constants/routes":4074,"../../helpers/utils/metrics":4099,"../../helpers/utils/transactions.util":4106,"../../store/actions":4443,"../send/send.constants":4311,"../send/send.utils":4313,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=U(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=G(e("prop-types")),r=G(e("../../components/app/confirm-page-container")),o=e("../send/send.utils"),i=e("../../helpers/constants/routes"),c=e("../../helpers/constants/error-keys"),u=G(e("../../components/app/user-preferenced-currency-display")),l=e("../../helpers/constants/common"),d=G(e("../../components/ui/text-field")),m=G(e("../../components/ui/simulation-error-message")),p=e("../../../shared/constants/metametrics"),f=e("../../../shared/constants/transaction"),g=e("../../helpers/utils/metrics"),T=e("../../helpers/utils/transactions.util"),h=e("../../contexts/transaction-modal"),E=G(e("../../components/app/transaction-detail/transaction-detail.component")),v=G(e("../../components/app/transaction-detail-item/transaction-detail-item.component")),_=G(e("../../components/ui/info-tooltip/info-tooltip")),y=G(e("../../components/ui/loading-heartbeat")),S=G(e("../../components/app/gas-details-item")),k=G(e("../../components/app/gas-timing/gas-timing.component")),A=G(e("../../components/app/ledger-instruction-field")),w=G(e("../../components/app/multilayer-fee-message")),b=G(e("../../components/ui/typography/typography")),N=e("../../helpers/constants/design-system"),O=e("../../store/actions"),C=e("../send/send.constants"),I=e("../../../shared/constants/network"),P=e("../../../shared/modules/conversion.utils"),R=G(e("../../components/app/transaction-alerts")),M=e("../../components/app/confirm-hexdata"),x=e("../../components/app/confirm-data"),F=e("../../components/app/confirm-title"),D=e("../../components/app/confirm-subtitle");function G(e){return e&&e.__esModule?e:{default:e}}function U(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(U=function(e){return e?a:t})(e)}function L(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const j=()=>n.default.createElement(y.default,null);class $ extends n.Component{constructor(...e){super(...e),L(this,"state",{submitting:!1,submitError:null,submitWarning:"",ethGasPriceWarning:"",editingGas:!1,userAcknowledgedGasMissing:!1,showWarningModal:!1}),L(this,"_beforeUnloadForGasPolling",(()=>{this._isMounted=!1,this.state.pollingToken&&((0,O.disconnectGasFeeEstimatePoller)(this.state.pollingToken),(0,O.removePollingTokenFromAppState)(this.state.pollingToken))})),L(this,"_removeBeforeUnload",(()=>{window.removeEventListener("beforeunload",this._beforeUnloadForGasPolling)})),L(this,"supportsEIP1559",this.props.supportsEIP1559&&!(0,T.isLegacyTransaction)(this.props.txData))}componentDidUpdate(e){const{transactionStatus:t,showTransactionConfirmedModal:a,history:n,clearConfirmTransaction:s,nextNonce:r,customNonceValue:o,toAddress:u,tryReverseResolveAddress:l,isEthGasPrice:d,setDefaultHomeActiveTabName:m}=this.props,{customNonceValue:p,nextNonce:g,toAddress:T,transactionStatus:h,isEthGasPrice:E}=e,v=t!==h,_=t===f.TransactionStatus.dropped||t===f.TransactionStatus.confirmed;r===g&&o===p||(null!==r&&o>r?this.setState({submitWarning:this.context.t("nextNonceWarning",[r])}):this.setState({submitWarning:""})),v&&_&&a({onSubmit:()=>{s(),m("activity").then((()=>{n.push(i.DEFAULT_ROUTE)}))}}),u&&u!==T&&l(u),d!==E&&(d?this.setState({ethGasPriceWarning:this.context.t(c.ETH_GAS_PRICE_FETCH_WARNING_KEY)}):this.setState({ethGasPriceWarning:""}))}getErrorKey(){const{balance:e,conversionRate:t,hexMaximumTransactionFee:a,txData:{txParams:{value:n}={}}={},customGas:s,noGasPrice:r,gasFeeIsCustom:i}=this.props;return e&&!(0,o.isBalanceSufficient)({amount:n,gasTotal:a||"0x0",balance:e,conversionRate:t})?{valid:!1,errorKey:c.INSUFFICIENT_FUNDS_ERROR_KEY}:(0,P.hexToDecimal)(s.gasLimit)<Number(C.MIN_GAS_LIMIT_DEC)?{valid:!1,errorKey:c.GAS_LIMIT_TOO_LOW_ERROR_KEY}:r&&!i?{valid:!1,errorKey:c.GAS_PRICE_FETCH_FAILURE_ERROR_KEY}:{valid:!0}}handleEditGas(){const{actionKey:e,txData:{origin:t},methodData:a={}}=this.props;this.context.trackEvent({category:p.MetaMetricsEventCategory.Transactions,event:'User clicks "Edit" on gas',properties:{action:"Confirm Screen",legacy_event:!0,recipientKnown:null,functionType:e||(0,g.getMethodName)(a.name)||f.TransactionType.contractInteraction,origin:t}}),this.setState({editingGas:!0})}handleCloseEditGas(){this.setState({editingGas:!1})}setUserAcknowledgedGasMissing(){this.setState({userAcknowledgedGasMissing:!0})}renderDetails(){var e,t;const{primaryTotalTextOverride:a,secondaryTotalTextOverride:s,hexMinimumTransactionFee:r,hexMaximumTransactionFee:o,hexTransactionTotal:i,useNonceField:c,customNonceValue:p,updateCustomNonce:f,nextNonce:g,getNextNonce:T,txData:h,useNativeCurrencyAsPrimaryCurrency:O,primaryTotalTextOverrideMaxAmount:C,maxFeePerGas:M,maxPriorityFeePerGas:x,isMainnet:F,showLedgerSteps:D,supportsEIP1559:G,isMultiLayerFeeNetwork:U,nativeCurrency:L,isBuyableChain:$,useCurrencyRateCheck:H}=this.props,{t:W}=this.context,{userAcknowledgedGasMissing:B}=this.state,{valid:q}=this.getErrorKey(),V=Boolean(h.simulationFails)&&!B,K=I.NETWORK_TO_NAME_MAP[h.chainId],Y=c?n.default.createElement("div",null,n.default.createElement("div",{className:"confirm-detail-row"},n.default.createElement("div",{className:"confirm-detail-row__label"},W("nonceFieldHeading")),n.default.createElement("div",{className:"custom-nonce-input"},n.default.createElement(d.default,{type:"number",min:0,placeholder:"number"==typeof g?g.toString():null,onChange:({target:{value:e}})=>{!e.length||Number(e)<0?f(""):f(String(Math.floor(e))),T()},fullWidth:!0,margin:"dense",value:p||""})))):null;return n.default.createElement("div",{className:"confirm-page-container-content__details"},n.default.createElement(R.default,{setUserAcknowledgedGasMissing:()=>this.setUserAcknowledgedGasMissing(),userAcknowledgedGasMissing:B,nativeCurrency:L,networkName:K,type:h.type,isBuyableChain:$}),n.default.createElement(E.default,{disabled:!B&&!q,userAcknowledgedGasMissing:B,onEdit:V||U?null:()=>this.handleEditGas(),rows:[V&&(()=>n.default.createElement("div",{className:"confirm-page-container-content__error-container"},n.default.createElement(m.default,{userAcknowledgedGasMissing:B,setUserAcknowledgedGasMissing:()=>this.setUserAcknowledgedGasMissing()})))(),!V&&!U&&(()=>this.supportsEIP1559?n.default.createElement(S.default,{key:"gas_details",userAcknowledgedGasMissing:B}):n.default.createElement(v.default,{key:"gas-item",detailTitle:h.dappSuggestedGasFees?n.default.createElement(n.default.Fragment,null,W("transactionDetailGasHeading"),n.default.createElement(_.default,{contentText:W("transactionDetailDappGasTooltip"),position:"top"},n.default.createElement("i",{className:"fa fa-info-circle"}))):n.default.createElement(n.default.Fragment,null,W("transactionDetailGasHeading"),n.default.createElement(_.default,{contentText:n.default.createElement(n.default.Fragment,null,n.default.createElement("p",null,W("transactionDetailGasTooltipIntro",[F?W("networkNameEthereum"):""])),n.default.createElement("p",null,W("transactionDetailGasTooltipExplanation")),n.default.createElement("p",null,n.default.createElement("a",{href:"https://community.metamask.io/t/what-is-gas-why-do-transactions-take-so-long/3172",target:"_blank",rel:"noopener noreferrer"},W("transactionDetailGasTooltipConversion")))),position:"top"},n.default.createElement("i",{className:"fa fa-info-circle"}))),detailText:H&&n.default.createElement("div",{className:"confirm-page-container-content__currency-container test"},j(),n.default.createElement(u.default,{type:l.SECONDARY,value:r,hideLabel:Boolean(O)})),detailTotal:n.default.createElement("div",{className:"confirm-page-container-content__currency-container"},j(),n.default.createElement(u.default,{type:l.PRIMARY,value:r,hideLabel:!O,numberOfDecimals:6})),subText:n.default.createElement(n.default.Fragment,null,n.default.createElement("strong",{key:"editGasSubTextFeeLabel"},W("editGasSubTextFeeLabel")),n.default.createElement("div",{key:"editGasSubTextFeeValue",className:"confirm-page-container-content__currency-container"},j(),n.default.createElement(u.default,{key:"editGasSubTextFeeAmount",type:l.PRIMARY,value:o,hideLabel:!O}))),subTitle:n.default.createElement(n.default.Fragment,null,h.dappSuggestedGasFees?n.default.createElement(b.default,{variant:N.TypographyVariant.H7,fontStyle:N.FONT_STYLE.ITALIC,color:N.TextColor.textAlternative},W("transactionDetailDappGasMoreInfo")):"",G&&n.default.createElement(k.default,{maxPriorityFeePerGas:(0,P.hexWEIToDecGWEI)(x||h.txParams.maxPriorityFeePerGas).toString(),maxFeePerGas:(0,P.hexWEIToDecGWEI)(M||h.txParams.maxFeePerGas).toString()}))}))(),!V&&U&&n.default.createElement(w.default,{transaction:h,layer2fee:r,nativeCurrency:L}),!U&&n.default.createElement(v.default,{key:"total-item",detailTitle:W("total"),detailText:H&&(()=>{var e;return a===undefined&&s===undefined?n.default.createElement("div",{className:"confirm-page-container-content__total-value"},n.default.createElement(y.default,{estimateUsed:null===(e=this.props.txData)||void 0===e?void 0:e.userFeeLevel}),n.default.createElement(u.default,{type:l.SECONDARY,key:"total-detail-text",value:i,hideLabel:Boolean(O)})):O?s:a})(),detailTotal:(()=>{var e;return a===undefined&&s===undefined?n.default.createElement("div",{className:"confirm-page-container-content__total-value"},n.default.createElement(y.default,{estimateUsed:null===(e=this.props.txData)||void 0===e?void 0:e.userFeeLevel}),n.default.createElement(u.default,{type:l.PRIMARY,key:"total-detail-value",value:i,hideLabel:!O})):O?a:s})(),subTitle:W("transactionDetailGasTotalSubtitle"),subText:n.default.createElement("div",{className:"confirm-page-container-content__total-amount"},n.default.createElement(y.default,{estimateUsed:null===(e=this.props.txData)||void 0===e?void 0:e.userFeeLevel}),n.default.createElement("strong",{key:"editGasSubTextAmountLabel"},W("editGasSubTextAmountLabel"))," ",C===undefined&&s===undefined?n.default.createElement(u.default,{type:l.PRIMARY,key:"total-max-amount",value:(0,P.addHexes)(h.txParams.value,o),hideLabel:!O}):O?C:s)})]}),Y,D?n.default.createElement(A.default,{showDataInstruction:Boolean(null===(t=h.txParams)||void 0===t?void 0:t.data)}):null)}renderData(){const{txData:e,dataComponent:t}=this.props,{txParams:{data:a}}=e;return a?n.default.createElement(x.ConfirmData,{txData:e,dataComponent:t}):null}renderDataHex(){const{txData:e,dataHexComponent:t}=this.props,{txParams:{data:a,to:s}}=e;return a&&s?n.default.createElement(M.ConfirmHexData,{txData:e,dataHexComponent:t}):null}handleEdit(){const{txData:e,tokenData:t,tokenProps:a,onEdit:n,actionKey:s,txData:{origin:r},methodData:o={}}=this.props;this.context.trackEvent({category:p.MetaMetricsEventCategory.Transactions,event:"Edit Transaction",properties:{action:"Confirm Screen",legacy_event:!0,recipientKnown:null,functionType:s||(0,g.getMethodName)(o.name)||f.TransactionType.contractInteraction,origin:r}}),n({txData:e,tokenData:t,tokenProps:a})}handleCancelAll(){const{cancelAllTransactions:e,clearConfirmTransaction:t,history:a,mostRecentOverviewPage:n,showRejectTransactionsConfirmationModal:s,unapprovedTxCount:r}=this.props;s({unapprovedTxCount:r,onSubmit:async()=>{this._removeBeforeUnload(),await e(),t(),a.push(n)}})}handleCancel(){const{txData:e,cancelTransaction:t,history:a,mostRecentOverviewPage:n,updateCustomNonce:s}=this.props;this._removeBeforeUnload(),s(""),t(e).then((()=>{a.push(n)}))}handleSubmit(){const{sendTransaction:e,txData:t,history:a,mostRecentOverviewPage:n,updateCustomNonce:s,maxFeePerGas:r,customTokenAmount:o,dappProposedTokenAmount:i,currentTokenBalance:c,maxPriorityFeePerGas:u,baseFeePerGas:l,methodData:d,addToAddressBookIfNew:m,toAccounts:p,toAddress:g}=this.props,{submitting:T}=this.state,{name:h}=d;t.type===f.TransactionType.simpleSend&&m(g,p),T||(l&&(t.estimatedBaseFee=l),h&&(t.contractMethodName=h),i&&(t.dappProposedTokenAmount=i,t.originalApprovalAmount=i),o?(t.customTokenAmount=o,t.finalApprovalAmount=o):i!==undefined&&(t.finalApprovalAmount=i),c&&(t.currentTokenBalance=c),r&&(t.txParams={...t.txParams,maxFeePerGas:r}),u&&(t.txParams={...t.txParams,maxPriorityFeePerGas:u}),this.setState({submitting:!0,submitError:null},(()=>{this._removeBeforeUnload(),e(t).then((()=>{this._isMounted&&this.setState({submitting:!1},(()=>{a.push(n),s("")}))})).catch((e=>{this._isMounted&&(this.setState({submitting:!1,submitError:e.message}),s(""))}))})))}handleSetApprovalForAll(){this.setState({showWarningModal:!0})}renderTitleComponent(){const{title:e,hexTransactionAmount:t,txData:a}=this.props;return n.default.createElement(F.ConfirmTitle,{title:e,hexTransactionAmount:t,txData:a})}renderSubtitleComponent(){const{subtitleComponent:e,hexTransactionAmount:t,txData:a}=this.props;return n.default.createElement(D.ConfirmSubTitle,{hexTransactionAmount:t,subtitleComponent:e,txData:a})}componentDidMount(){this._isMounted=!0;const{toAddress:e,txData:{origin:t}={},getNextNonce:a,tryReverseResolveAddress:n}=this.props,{trackEvent:s}=this.context;s({category:p.MetaMetricsEventCategory.Transactions,event:"Confirm: Started",properties:{action:"Confirm Screen",legacy_event:!0,origin:t}}),a(),e&&n(e),(0,O.getGasFeeEstimatesAndStartPolling)().then((e=>{this._isMounted?((0,O.addPollingTokenToAppState)(e),this.setState({pollingToken:e})):((0,O.disconnectGasFeeEstimatePoller)(e),(0,O.removePollingTokenFromAppState)(this.state.pollingToken))})),window.addEventListener("beforeunload",this._beforeUnloadForGasPolling)}componentWillUnmount(){this._beforeUnloadForGasPolling(),this._removeBeforeUnload(),this.props.clearConfirmTransaction()}render(){const{t:e}=this.context,{fromName:t,fromAddress:a,toName:s,toAddress:o,toEns:i,toNickname:c,methodData:u,tokenAddress:l,contentComponent:d,onEdit:m,nonce:p,customNonceValue:E,unapprovedTxCount:v,type:_,hideSenderToRecipient:y,showAccountInHeader:S,txData:k,gasIsLoading:A,gasFeeIsCustom:w,nativeCurrency:b,hardwareWalletRequiresConnection:N,image:O,isApprovalOrRejection:C,assetStandard:I,title:P}=this.props,{submitting:R,submitError:M,submitWarning:x,ethGasPriceWarning:F,editingGas:D,userAcknowledgedGasMissing:G,showWarningModal:U}=this.state,{name:L}=u,{valid:j,errorKey:$}=this.getErrorKey(),H=Boolean(k.simulationFails),W=H&&!G,B=k.type===f.TransactionType.tokenMethodSetApprovalForAll||k.type===f.TransactionType.tokenMethodApprove,q=k.type===f.TransactionType.contractInteraction,V=(B||q)&&"metamask"!==k.origin;let K;return V&&(K=(0,g.getMethodName)(L)),K||(K=_?(0,T.getTransactionTypeTitle)(e,_,b):e("contractInteraction")),n.default.createElement(h.TransactionModalContextProvider,null,n.default.createElement(r.default,{fromName:t,fromAddress:a,showAccountInHeader:S,toName:s,toAddress:o,toEns:i,toNickname:c,showEdit:!V&&Boolean(m),action:K,image:O,title:P,titleComponent:this.renderTitleComponent(),subtitleComponent:this.renderSubtitleComponent(),detailsComponent:this.renderDetails(),dataComponent:this.renderData(K),dataHexComponent:this.renderDataHex(K),contentComponent:d,nonce:E||p,unapprovedTxCount:v,tokenAddress:l,errorMessage:M,errorKey:$,hasSimulationError:H,warning:x,disabled:W||!j||R||N||A&&!w,onEdit:()=>this.handleEdit(),onCancelAll:()=>this.handleCancelAll(),onCancel:()=>this.handleCancel(),onSubmit:()=>this.handleSubmit(),onSetApprovalForAll:()=>this.handleSetApprovalForAll(),showWarningModal:U,hideSenderToRecipient:y,origin:k.origin,ethGasPriceWarning:F,editingGas:D,handleCloseEditGas:()=>this.handleCloseEditGas(),currentTransaction:k,supportsEIP1559:this.supportsEIP1559,nativeCurrency:b,isApprovalOrRejection:C,assetStandard:I,txData:k}))}}a.default=$,L($,"contextTypes",{t:s.default.func,trackEvent:s.default.func}),L($,"propTypes",{history:s.default.object,balance:s.default.string,cancelTransaction:s.default.func,cancelAllTransactions:s.default.func,clearConfirmTransaction:s.default.func,conversionRate:s.default.number,fromAddress:s.default.string,fromName:s.default.string,hexTransactionAmount:s.default.string,hexMinimumTransactionFee:s.default.string,hexMaximumTransactionFee:s.default.string,hexTransactionTotal:s.default.string,methodData:s.default.object,nonce:s.default.string,useNonceField:s.default.bool,customNonceValue:s.default.string,updateCustomNonce:s.default.func,sendTransaction:s.default.func,showTransactionConfirmedModal:s.default.func,showRejectTransactionsConfirmationModal:s.default.func,toAccounts:s.default.array,toAddress:s.default.string,tokenData:s.default.object,tokenProps:s.default.object,toName:s.default.string,toEns:s.default.string,toNickname:s.default.string,transactionStatus:s.default.string,txData:s.default.object,unapprovedTxCount:s.default.number,customGas:s.default.object,addToAddressBookIfNew:s.default.func,actionKey:s.default.string,contentComponent:s.default.node,dataComponent:s.default.node,dataHexComponent:s.default.node,tokenAddress:s.default.string,customTokenAmount:s.default.string,dappProposedTokenAmount:s.default.string,currentTokenBalance:s.default.string,onEdit:s.default.func,subtitleComponent:s.default.node,title:s.default.string,image:s.default.string,type:s.default.string,getNextNonce:s.default.func,nextNonce:s.default.number,tryReverseResolveAddress:s.default.func.isRequired,hideSenderToRecipient:s.default.bool,showAccountInHeader:s.default.bool,mostRecentOverviewPage:s.default.string.isRequired,isEthGasPrice:s.default.bool,noGasPrice:s.default.bool,setDefaultHomeActiveTabName:s.default.func,primaryTotalTextOverride:s.default.string,secondaryTotalTextOverride:s.default.string,gasIsLoading:s.default.bool,primaryTotalTextOverrideMaxAmount:s.default.string,useNativeCurrencyAsPrimaryCurrency:s.default.bool,maxFeePerGas:s.default.string,maxPriorityFeePerGas:s.default.string,baseFeePerGas:s.default.string,isMainnet:s.default.bool,gasFeeIsCustom:s.default.bool,showLedgerSteps:s.default.bool.isRequired,nativeCurrency:s.default.string,supportsEIP1559:s.default.bool,hardwareWalletRequiresConnection:s.default.bool,isMultiLayerFeeNetwork:s.default.bool,isBuyableChain:s.default.bool,isApprovalOrRejection:s.default.bool,assetStandard:s.default.string,useCurrencyRateCheck:s.default.bool})}}},{package:"$root$",file:"ui/pages/confirm-transaction-base/confirm-transaction-base.component.js"}],[4191,{"../../../app/scripts/lib/util":82,"../../../shared/constants/gas":3404,"../../../shared/constants/transaction":3417,"../../../shared/lib/transactions-controller-utils":3425,"../../../shared/modules/hexstring-utils":3435,"../../../shared/modules/transaction.utils":3444,"../../ducks/app/app":4054,"../../ducks/confirm-transaction/confirm-transaction.duck":4055,"../../ducks/history/history":4059,"../../ducks/metamask/metamask":4062,"../../helpers/utils/token-util":4105,"../../helpers/utils/transactions.util":4106,"../../helpers/utils/util":4108,"../../selectors":4436,"../../store/actions":4443,"../send/send.utils":4313,"./confirm-transaction-base.component":4190,"react-redux":3130,"react-router-dom":3150,redux:3194},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.mapDispatchToProps=a.default=void 0;var n,s=e("react-redux"),r=e("redux"),o=e("react-router-dom"),i=e("../../ducks/confirm-transaction/confirm-transaction.duck"),c=e("../../store/actions"),u=e("../send/send.utils"),l=e("../../helpers/utils/util"),d=e("../../selectors"),m=e("../../ducks/history/history"),p=e("../../ducks/metamask/metamask"),f=e("../../../app/scripts/lib/util"),g=e("../../../shared/modules/transaction.utils"),T=e("../../../shared/modules/hexstring-utils"),h=e("../../ducks/app/app"),E=e("../../helpers/utils/transactions.util"),v=e("../../../shared/constants/gas"),_=e("../../../shared/constants/transaction"),y=e("../../helpers/utils/token-util"),S=e("../../../shared/lib/transactions-controller-utils"),k=(n=e("./confirm-transaction-base.component"))&&n.__esModule?n:{default:n};let A="";const w=e=>({tryReverseResolveAddress:t=>e((0,c.tryReverseResolveAddress)(t)),updateCustomNonce:t=>{A=t,e((0,c.updateCustomNonce)(t))},clearConfirmTransaction:()=>e((0,i.clearConfirmTransaction)()),showTransactionConfirmedModal:({onSubmit:t})=>e((0,c.showModal)({name:"TRANSACTION_CONFIRMED",onSubmit:t})),showRejectTransactionsConfirmationModal:({onSubmit:t,unapprovedTxCount:a})=>e((0,c.showModal)({name:"REJECT_TRANSACTIONS",onSubmit:t,unapprovedTxCount:a})),cancelTransaction:({id:t})=>e((0,c.cancelTx)({id:t})),cancelAllTransactions:t=>e((0,c.cancelTxs)(t)),sendTransaction:t=>e((0,c.updateAndApproveTx)((e=>A?{...e,customNonceValue:A}:e)(t))),getNextNonce:()=>e((0,c.getNextNonce)()),setDefaultHomeActiveTabName:t=>e((0,c.setDefaultHomeActiveTabName)(t)),updateTransactionGasFees:t=>{e((0,p.updateGasFees)({...t,expectHexWei:!0}))},showBuyModal:()=>e((0,c.showModal)({name:"DEPOSIT_ETHER"})),addToAddressBookIfNew:(t,a,n="")=>{const s=(0,f.addHexPrefix)(t);(function(e,t){const a=t.toLowerCase();return!e.some((({address:e})=>e.toLowerCase()===a))})(a,s)&&e((0,c.addToAddressBook)(s,n))}});a.mapDispatchToProps=w;var b=(0,r.compose)(o.withRouter,(0,s.connect)(((e,t)=>{var a,n,s;const{toAddress:r,customTxParamsData:o,match:{params:i={}}}=t,{id:c}=i,f=(0,d.getIsMainnet)(e),k=(0,p.getIsGasEstimatesLoading)(e),w=(0,h.getGasLoadingAnimationIsShowing)(e),b=(0,d.getIsBuyableChain)(e),{confirmTransaction:N,metamask:O}=e,{conversionRate:C,identities:I,addressBook:P,networkId:R,unapprovedTxs:M,nextNonce:x,provider:{chainId:F}}=O,{tokenData:D,txData:G,tokenProps:U,nonce:L}=N,{txParams:j={},id:$,type:H}=G,W=$||Number(c),B=(0,d.getUnapprovedTransaction)(e,W),{from:q,to:V,gasPrice:K,gas:Y,value:X,data:Q}=B&&B.txParams||j,z=(0,d.getMetaMaskAccounts)(e),Z=(0,g.parseStandardTokenTransactionData)(Q),J=(0,y.getTokenAddressParam)(Z),{balance:ee}=z[q],{name:te}=I[q];let ae=V;H!==_.TransactionType.simpleSend&&(ae=r||J||V);const ne=(0,p.getSendToAccounts)(e),se=(0,d.getTokenList)(e),re=(null===(a=I[ae])||void 0===a?void 0:a.name)||(null===(n=se[null===(s=ae)||void 0===s?void 0:s.toLowerCase()])||void 0===n?void 0:n.name)||(0,l.shortenAddress)((0,T.toChecksumHexAddress)(ae)),oe=(0,T.toChecksumHexAddress)(ae),ie=P&&P[F]&&P[F][oe],ce=(0,d.getEnsResolutionByAddress)(e,oe),ue=ie?ie.name:"",le=B?B.status:"",de=(0,d.checkNetworkAndAccountSupports1559)(e)&&!(0,E.isLegacyTransaction)(j),{hexTransactionAmount:me,hexMinimumTransactionFee:pe,hexMaximumTransactionFee:fe,hexTransactionTotal:ge,gasEstimationObject:Te}=(0,d.transactionFeeSelector)(e,B),he=Object.keys(M).filter((e=>(0,g.transactionMatchesNetwork)(M[e],F,R))).reduce(((e,t)=>({...e,[t]:M[t]})),{}),Ee=(0,l.valuesFor)(he).length,ve=!(0,u.isBalanceSufficient)({amount:X,gasTotal:(0,S.calcGasTotal)(Y,K),balance:ee,conversionRate:C}),_e=(0,d.getKnownMethodData)(e,Q)||{},ye=(0,d.getFullTxData)(e,W,_.TransactionStatus.unapproved,o);A=(0,d.getCustomNonceValue)(e);const Se=(0,d.getIsEthGasPriceFetched)(e),ke=!de&&(0,d.getNoGasPriceFetched)(e),{useNativeCurrencyAsPrimaryCurrency:Ae}=(0,d.getPreferences)(e),we=ye.userFeeLevel===v.CUSTOM_GAS_ESTIMATE||(0,g.txParamsAreDappSuggested)(ye),be=(0,p.isAddressLedger)(e,q),Ne=(0,p.getNativeCurrency)(e),Oe=(0,d.doesAddressRequireLedgerHidConnection)(e,q),Ce=(0,d.getIsMultiLayerFeeNetwork)(e);return{balance:ee,fromAddress:q,fromName:te,toAccounts:ne,toAddress:ae,toEns:ce,toName:re,toNickname:ue,hexTransactionAmount:me,hexMinimumTransactionFee:pe,hexMaximumTransactionFee:fe,hexTransactionTotal:ge,txData:ye,tokenData:D,methodData:_e,tokenProps:U,conversionRate:C,transactionStatus:le,nonce:L,unapprovedTxs:M,unapprovedTxCount:Ee,customGas:{gasLimit:Y,gasPrice:K},advancedInlineGasShown:(0,d.getAdvancedInlineGasShown)(e),useNonceField:(0,d.getUseNonceField)(e),customNonceValue:A,insufficientBalance:ve,hideFiatConversion:!(0,d.getShouldShowFiat)(e),type:H,nextNonce:x,mostRecentOverviewPage:(0,m.getMostRecentOverviewPage)(e),isMainnet:f,isEthGasPrice:Se,noGasPrice:ke,supportsEIP1559:de,gasIsLoading:k||w,useNativeCurrencyAsPrimaryCurrency:Ae,maxFeePerGas:Te.maxFeePerGas,maxPriorityFeePerGas:Te.maxPriorityFeePerGas,baseFeePerGas:Te.baseFeePerGas,gasFeeIsCustom:we,showLedgerSteps:be,nativeCurrency:Ne,hardwareWalletRequiresConnection:Oe,isMultiLayerFeeNetwork:Ce,chainId:F,isBuyableChain:b,useCurrencyRateCheck:(0,d.getUseCurrencyRateCheck)(e)}}),w,((e,t,a)=>{const{txData:n,unapprovedTxs:s}=e,{cancelAllTransactions:r,updateTransactionGasFees:o,...i}=t;return{...e,...i,...a,cancelAllTransactions:()=>r((0,l.valuesFor)(s)),updateGasAndCalculate:({gasLimit:e,gasPrice:t})=>{o({gasLimit:e,gasPrice:t,transaction:n})}}})))(k.default);a.default=b}}},{package:"$root$",file:"ui/pages/confirm-transaction-base/confirm-transaction-base.container.js"}],[4192,{"./confirm-transaction-base.container":4191},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirm-transaction-base.container"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirm-transaction-base/index.js"}],[4193,{"../../../shared/constants/app":3401,"../../../shared/constants/transaction":3417,"../../components/ui/loading-screen":3973,"../../helpers/constants/routes":4074,"prop-types":3032,react:3177,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,s,r,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=f(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),i=p(e("prop-types")),c=e("react-router-dom"),u=p(e("../../components/ui/loading-screen")),l=e("../../helpers/constants/routes"),d=e("../../../shared/constants/app"),m=e("../../../shared/constants/transaction");function p(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(f=function(e){return e?a:t})(e)}class g extends o.Component{redirectToTransaction(){const{txData:e}=this.props,{id:t,txParams:{data:a}={},type:n}=e;if(n===m.TransactionType.deployContract){const e=`${l.CONFIRM_TRANSACTION_ROUTE}/${t}${l.CONFIRM_DEPLOY_CONTRACT_PATH}`;return o.default.createElement(c.Redirect,{to:{pathname:e}})}if(n===m.TransactionType.simpleSend){const e=`${l.CONFIRM_TRANSACTION_ROUTE}/${t}${l.CONFIRM_SEND_ETHER_PATH}`;return o.default.createElement(c.Redirect,{to:{pathname:e}})}if(a)switch(n){case m.TransactionType.tokenMethodTransfer:{const e=`${l.CONFIRM_TRANSACTION_ROUTE}/${t}${l.CONFIRM_SEND_TOKEN_PATH}`;return o.default.createElement(c.Redirect,{to:{pathname:e}})}case m.TransactionType.tokenMethodApprove:{const e=`${l.CONFIRM_TRANSACTION_ROUTE}/${t}${l.CONFIRM_APPROVE_PATH}`;return o.default.createElement(c.Redirect,{to:{pathname:e}})}case m.TransactionType.tokenMethodSetApprovalForAll:{const e=`${l.CONFIRM_TRANSACTION_ROUTE}/${t}${l.CONFIRM_SET_APPROVAL_FOR_ALL_PATH}`;return o.default.createElement(c.Redirect,{to:{pathname:e}})}case m.TransactionType.tokenMethodTransferFrom:{const e=`${l.CONFIRM_TRANSACTION_ROUTE}/${t}${l.CONFIRM_TRANSFER_FROM_PATH}`;return o.default.createElement(c.Redirect,{to:{pathname:e}})}case m.TransactionType.tokenMethodSafeTransferFrom:{const e=`${l.CONFIRM_TRANSACTION_ROUTE}/${t}${l.CONFIRM_SAFE_TRANSFER_FROM_PATH}`;return o.default.createElement(c.Redirect,{to:{pathname:e}})}default:{const e=`${l.CONFIRM_TRANSACTION_ROUTE}/${t}${l.CONFIRM_TOKEN_METHOD_PATH}`;return o.default.createElement(c.Redirect,{to:{pathname:e}})}}const s=`${l.CONFIRM_TRANSACTION_ROUTE}/${t}${l.CONFIRM_SEND_ETHER_PATH}`;return o.default.createElement(c.Redirect,{to:{pathname:s}})}render(){const{txData:e}=this.props;if(e.txParams)return this.redirectToTransaction();if(e.msgParams){let t=`${l.CONFIRM_TRANSACTION_ROUTE}/${e.id}${l.SIGNATURE_REQUEST_PATH}`;return e.type===d.MESSAGE_TYPE.ETH_DECRYPT?t=`${l.CONFIRM_TRANSACTION_ROUTE}/${e.id}${l.DECRYPT_MESSAGE_REQUEST_PATH}`:e.type===d.MESSAGE_TYPE.ETH_GET_ENCRYPTION_PUBLIC_KEY&&(t=`${l.CONFIRM_TRANSACTION_ROUTE}/${e.id}${l.ENCRYPTION_PUBLIC_KEY_REQUEST_PATH}`),o.default.createElement(c.Redirect,{to:{pathname:t}})}return o.default.createElement(u.default,null)}}a.default=g,n=g,s="propTypes",r={txData:i.default.object},(s=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(a!==undefined){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(s))in n?Object.defineProperty(n,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[s]=r}}},{package:"$root$",file:"ui/pages/confirm-transaction-switch/confirm-transaction-switch.component.js"}],[4194,{"../../selectors":4436,"./confirm-transaction-switch.component":4193,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n,s=e("react-redux"),r=e("../../selectors"),o=(n=e("./confirm-transaction-switch.component"))&&n.__esModule?n:{default:n};var i=(0,s.connect)(((e,t)=>{const{metamask:{unapprovedTxs:a}}=e,{match:{params:n={},url:s}}=t,o=(null==s?void 0:s.match(/\d+/u))&&(null==s?void 0:s.match(/\d+/u)[0]),{id:i}=n,c=i||o,u=(0,r.unconfirmedTransactionsListSelector)(e);return{txData:u.length?a[c]||u[0]:{}}}))(o.default);a.default=i}}},{package:"$root$",file:"ui/pages/confirm-transaction-switch/confirm-transaction-switch.container.js"}],[4195,{"./confirm-transaction-switch.container":4194},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){var n;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var s=((n=e("./confirm-transaction-switch.container"))&&n.__esModule?n:{default:n}).default;a.default=s}}},{package:"$root$",file:"ui/pages/confirm-transaction-switch/index.js"}],[4196,{"../../../shared/constants/transaction":3417,"../../ducks/confirm-transaction/confirm-transaction.duck":4055,"../../ducks/send":4064,"../../helpers/constants/routes":4074,"../../hooks/useAssetDetails":4122,"../../selectors":4436,"../confirm-approve":4168,"../confirm-send-token":4186,"../confirm-token-transaction-base":4189,"../confirm-transaction-switch":4195,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=E;var n=h(e("react")),s=h(e("prop-types")),r=e("react-redux"),o=e("react-router-dom"),i=e("../../helpers/constants/routes"),c=e("../../selectors"),u=h(e("../confirm-approve")),l=h(e("../confirm-send-token")),d=h(e("../confirm-token-transaction-base")),m=h(e("../confirm-transaction-switch")),p=e("../../ducks/send"),f=e("../../../shared/constants/transaction"),g=e("../../ducks/confirm-transaction/confirm-transaction.duck"),T=e("../../hooks/useAssetDetails");function h(e){return e&&e.__esModule?e:{default:e}}function E({transaction:e}){const{txParams:{data:t,to:a,from:s}={}}=e,h=(0,r.useDispatch)(),E=(0,o.useHistory)(),{assetStandard:v,assetName:_,userBalance:y,tokenSymbol:S,decimals:k,tokenImage:A,tokenAmount:w,tokenId:b,toAddress:N}=(0,T.useAssetDetails)(a,s,t),{ethTransactionTotal:O,fiatTransactionTotal:C,hexTransactionTotal:I,hexMaximumTransactionFee:P}=(0,r.useSelector)((t=>(0,c.transactionFeeSelector)(t,e)));return n.default.createElement(o.Switch,null,n.default.createElement(o.Route,{exact:!0,path:`${i.CONFIRM_TRANSACTION_ROUTE}/:id?${i.CONFIRM_APPROVE_PATH}`,render:()=>n.default.createElement(u.default,{assetStandard:v,assetName:_,userBalance:y,tokenSymbol:S,decimals:k,tokenImage:A,tokenAmount:w,tokenId:b,userAddress:s,tokenAddress:a,toAddress:N,transaction:e,ethTransactionTotal:O,fiatTransactionTotal:C,hexTransactionTotal:I})}),n.default.createElement(o.Route,{exact:!0,path:`${i.CONFIRM_TRANSACTION_ROUTE}/:id?${i.CONFIRM_SET_APPROVAL_FOR_ALL_PATH}`,render:()=>n.default.createElement(u.default,{isSetApproveForAll:!0,assetStandard:v,assetName:_,userBalance:y,tokenSymbol:S,decimals:k,tokenImage:A,tokenAmount:w,tokenId:b,userAddress:s,tokenAddress:a,toAddress:N,transaction:e,ethTransactionTotal:O,fiatTransactionTotal:C,hexTransactionTotal:I})}),n.default.createElement(o.Route,{exact:!0,path:`${i.CONFIRM_TRANSACTION_ROUTE}/:id?${i.CONFIRM_TRANSFER_FROM_PATH}`,render:()=>n.default.createElement(d.default,{assetStandard:v,assetName:_,userBalance:y,tokenSymbol:S,decimals:k,image:A,tokenAddress:a,onEdit:async({txData:e})=>{const{id:t}=e;await h((0,p.editExistingTransaction)(f.AssetType.NFT,t.toString())),h((0,g.clearConfirmTransaction)()),E.push(i.SEND_ROUTE)},toAddress:N,tokenAmount:w,tokenId:b,userAddress:s,transaction:e,ethTransactionTotal:O,fiatTransactionTotal:C,hexMaximumTransactionFee:P})}),n.default.createElement(o.Route,{exact:!0,path:`${i.CONFIRM_TRANSACTION_ROUTE}/:id?${i.CONFIRM_SAFE_TRANSFER_FROM_PATH}`,render:()=>n.default.createElement(d.default,{assetStandard:v,assetName:_,userBalance:y,tokenSymbol:S,decimals:k,image:A,tokenAddress:a,toAddress:N,tokenAmount:w,tokenId:b,userAddress:s,transaction:e,ethTransactionTotal:O,fiatTransactionTotal:C,hexMaximumTransactionFee:P})}),n.default.createElement(o.Route,{exact:!0,path:`${i.CONFIRM_TRANSACTION_ROUTE}/:id?${i.CONFIRM_SEND_TOKEN_PATH}`,render:()=>n.default.createElement(l.default,{assetStandard:v,assetName:_,tokenSymbol:S,image:A,tokenAddress:a,toAddress:N,tokenAmount:w,tokenId:b,transaction:e,ethTransactionTotal:O,fiatTransactionTotal:C,hexMaximumTransactionFee:P})}),n.default.createElement(o.Route,{path:"*",component:m.default}))}E.propTypes={transaction:s.default.shape({origin:s.default.string,txParams:s.default.shape({data:s.default.string,to:s.default.string,from:s.default.string})})}}}},{package:"$root$",file:"ui/pages/confirm-transaction/confirm-token-transaction-switch.js"}],[4197,{"../../../shared/constants/app":3401,"../../components/ui/loading-screen":3973,"../../ducks/confirm-transaction/confirm-transaction.duck":4055,"../../ducks/history/history":4059,"../../ducks/send":4064,"../../helpers/constants/routes":4074,"../../helpers/utils/transactions.util":4106,"../../hooks/usePrevious":4133,"../../selectors":4436,"../../store/actions":4443,"../confirm-contract-interaction":4170,"../confirm-decrypt-message":4173,"../confirm-deploy-contract":4176,"../confirm-encryption-public-key":4179,"../confirm-send-ether":4184,"../confirm-signature-request":4187,"../confirm-transaction-switch":4195,"./confirm-token-transaction-switch":4196,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=w(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=e("react-redux"),r=e("react-router-dom"),o=A(e("../../components/ui/loading-screen")),i=A(e("../confirm-contract-interaction")),c=A(e("../confirm-deploy-contract")),u=A(e("../confirm-decrypt-message")),l=A(e("../confirm-encryption-public-key")),d=A(e("../confirm-send-ether")),m=A(e("../confirm-transaction-switch")),p=e("../../../shared/constants/app"),f=e("../../ducks/confirm-transaction/confirm-transaction.duck"),g=e("../../ducks/history/history"),T=e("../../ducks/send"),h=e("../../helpers/constants/routes"),E=e("../../helpers/utils/transactions.util"),v=e("../../hooks/usePrevious"),_=e("../../selectors"),y=e("../../store/actions"),S=A(e("../confirm-signature-request")),k=A(e("./confirm-token-transaction-switch"));function A(e){return e&&e.__esModule?e:{default:e}}function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(w=function(e){return e?a:t})(e)}var b=()=>{const e=(0,s.useDispatch)(),t=(0,r.useHistory)(),{id:a}=(0,r.useParams)(),[A,w]=(0,n.useState)(!1),[b,N]=(0,n.useState)(),O=(0,s.useSelector)(g.getMostRecentOverviewPage),C=(0,s.useSelector)(T.getSendTo),I=(0,s.useSelector)(_.getUnapprovedTransactions),P=(0,s.useSelector)(_.unconfirmedTransactionsListSelector),R=(0,s.useSelector)(_.unconfirmedTransactionsHashSelector),M=P.length||0,x=(0,n.useCallback)((()=>M?I[a]||R[a]||P[0]:{}),[a,M,I,R,P]),[F,D]=(0,n.useState)(x);(0,n.useEffect)((()=>{const t=x();D(t),null!=t&&t.id&&e((0,f.setTransactionToConfirm)(t.id))}),[e,x,a,M,I,R,P]);const{id:G,type:U}=F,L=G&&String(G),j=(0,E.isTokenMethodAction)(U),$=L&&(!a||a===L),H=(0,v.usePrevious)(a),W=(0,v.usePrevious)(L),B=(0,n.useCallback)((()=>{w(!1),b&&((0,y.disconnectGasFeeEstimatePoller)(b),(0,y.removePollingTokenFromAppState)(b))}),[b]);return(0,n.useEffect)((()=>{if(w(!0),(0,y.getGasFeeEstimatesAndStartPolling)().then((e=>{A?(N(e),(0,y.addPollingTokenToAppState)(e)):((0,y.disconnectGasFeeEstimatePoller)(e),(0,y.removePollingTokenFromAppState)(e))})),window.addEventListener("beforeunload",B),M||C){const{txParams:{data:t}={},origin:n}=F;n!==p.ORIGIN_METAMASK&&e((0,y.getContractMethodData)(t));const s=L||a;s&&e((0,f.setTransactionToConfirm)(s))}else t.replace(O);return()=>{B(),window.removeEventListener("beforeunload",B)}}),[]),(0,n.useEffect)((()=>{if(a&&L&&H!==a){const{txData:{txParams:{data:t}={},origin:n}={}}=F;e((0,f.clearConfirmTransaction)()),e((0,f.setTransactionToConfirm)(a)),n!==p.ORIGIN_METAMASK&&e((0,y.getContractMethodData)(t))}else!W||L||M?W&&L&&W!==L&&a!==L&&t.replace(O):e((0,y.setDefaultHomeActiveTabName)("activity")).then((()=>{t.replace(h.DEFAULT_ROUTE)}))}),[e,t,O,a,H,W,M,F,L]),j&&$?n.default.createElement(k.default,{transaction:F}):$?n.default.createElement(r.Switch,null,n.default.createElement(r.Route,{exact:!0,path:`${h.CONFIRM_TRANSACTION_ROUTE}/:id?${h.CONFIRM_DEPLOY_CONTRACT_PATH}`,component:c.default}),n.default.createElement(r.Route,{exact:!0,path:`${h.CONFIRM_TRANSACTION_ROUTE}/:id?${h.CONFIRM_SEND_ETHER_PATH}`,component:d.default}),n.default.createElement(r.Route,{exact:!0,path:`${h.CONFIRM_TRANSACTION_ROUTE}/:id?${h.CONFIRM_TOKEN_METHOD_PATH}`,component:i.default}),n.default.createElement(r.Route,{exact:!0,path:`${h.CONFIRM_TRANSACTION_ROUTE}/:id?${h.SIGNATURE_REQUEST_PATH}`,component:S.default}),n.default.createElement(r.Route,{exact:!0,path:`${h.CONFIRM_TRANSACTION_ROUTE}/:id?${h.DECRYPT_MESSAGE_REQUEST_PATH}`,component:u.default}),n.default.createElement(r.Route,{exact:!0,path:`${h.CONFIRM_TRANSACTION_ROUTE}/:id?${h.ENCRYPTION_PUBLIC_KEY_REQUEST_PATH}`,component:l.default}),n.default.createElement(r.Route,{path:"*",component:m.default})):n.default.createElement(o.default,null)};a.default=b}}},{package:"$root$",file:"ui/pages/confirm-transaction/confirm-transaction.component.js"}],[4198,{"./confirm-transaction.component":4197},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){var n;Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var s=((n=e("./confirm-transaction.component"))&&n.__esModule?n:{default:n}).default;a.default=s}}},{package:"$root$",file:"ui/pages/confirm-transaction/index.js"}],[4199,{"../../../../components/ui/button":3904,classnames:1980,"prop-types":3032,react:3177},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=c;var n=i(e("react")),s=i(e("prop-types")),r=i(e("classnames")),o=i(e("../../../../components/ui/button"));function i(e){return e&&e.__esModule?e:{default:e}}function c({onSubmit:e,onCancel:t,submitText:a,cancelText:s,loadingText:i,alerts:c,loading:u,submitAlerts:l}){return n.default.createElement("div",{className:"confirmation-footer"},c,l,n.default.createElement("div",{className:"confirmation-footer__actions"},t?n.default.createElement(o.default,{type:"secondary",onClick:t},s):null,n.default.createElement(o.default,{disabled:Boolean(u),type:"primary",onClick:e,className:(0,r.default)({centered:!t})},u?i:a)))}c.propTypes={alerts:s.default.node,onCancel:s.default.func,cancelText:s.default.string,onSubmit:s.default.func.isRequired,submitText:s.default.string.isRequired,loadingText:s.default.string,loading:s.default.bool,submitAlerts:s.default.node}}}},{package:"$root$",file:"ui/pages/confirmation/components/confirmation-footer/confirmation-footer.js"}],[4200,{"./confirmation-footer":4199},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirmation-footer"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirmation/components/confirmation-footer/index.js"}],[4201,{"../../../../../shared/constants/network":3409,"../../../../components/ui/box":3900,"../../../../components/ui/site-icon":4013,"../../../../components/ui/typography/typography":4040,"../../../../helpers/constants/design-system":4070,"prop-types":3032,react:3177,"react-redux":3130},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=m;var n=d(e("react")),s=d(e("prop-types")),r=e("react-redux"),o=d(e("../../../../components/ui/box")),i=d(e("../../../../components/ui/site-icon")),c=d(e("../../../../components/ui/typography/typography")),u=e("../../../../helpers/constants/design-system"),l=e("../../../../../shared/constants/network");function d(e){return e&&e.__esModule?e:{default:e}}function m({newNetwork:e}){const t=(0,r.useSelector)((e=>({nickname:e.metamask.provider.nickname,type:e.metamask.provider.type,chainId:e.metamask.provider.chainId})));return n.default.createElement(o.default,{className:"confirmation-network-switch",display:u.DISPLAY.FLEX,height:u.BLOCK_SIZES.FULL,justifyContent:u.JustifyContent.center,marginTop:8},n.default.createElement(o.default,{className:"confirmation-network-switch__icon",display:u.DISPLAY.BLOCK},t.chainId in l.CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP?n.default.createElement(i.default,{icon:l.CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP[t.chainId],name:t.nickname,size:64}):n.default.createElement("div",{className:"confirmation-network-switch__unknown-icon"},n.default.createElement("i",{className:"fa fa-question fa-2x"})),n.default.createElement(c.default,{color:u.TextColor.textDefault,variant:u.TypographyVariant.H6,fontWeight:u.FONT_WEIGHT.NORMAL,align:u.TEXT_ALIGN.CENTER,boxProps:{display:u.DISPLAY.FLEX,justifyContent:u.JustifyContent.center}},t.nickname||l.NETWORK_TO_NAME_MAP[t.type])),n.default.createElement(o.default,{className:"confirmation-network-switch__center-icon",display:u.DISPLAY.FLEX,alignItems:u.AlignItems.center,justifyContent:u.JustifyContent.center},n.default.createElement("i",{className:"fa fa-angle-right fa-lg confirmation-network-switch__check"}),n.default.createElement("div",{className:"confirmation-network-switch__dashed-line"})),n.default.createElement(o.default,{className:"confirmation-network-switch__icon",display:u.DISPLAY.BLOCK},e.chainId in l.CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP?n.default.createElement(i.default,{icon:l.CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP[e.chainId],name:e.nickname,size:64}):n.default.createElement("div",{className:"confirmation-network-switch__unknown-icon"},n.default.createElement("i",{className:"fa fa-question fa-2x"})),n.default.createElement(c.default,{color:u.TextColor.textDefault,variant:u.TypographyVariant.H6,fontWeight:u.FONT_WEIGHT.NORMAL,align:u.TEXT_ALIGN.CENTER,boxProps:{display:u.DISPLAY.FLEX,justifyContent:u.JustifyContent.center}},e.nickname)))}m.propTypes={newNetwork:s.default.shape({chainId:s.default.string.isRequired,nickname:s.default.string.isRequired})}}}},{package:"$root$",file:"ui/pages/confirmation/components/confirmation-network-switch/confirmation-network-switch.js"}],[4202,{"./confirmation-network-switch":4201},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirmation-network-switch"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirmation/components/confirmation-network-switch/index.js"}],[4203,{"../../../shared/constants/app":3401,"../../components/app/confirmation-warning-modal":3519,"../../components/app/metamask-template-renderer":3589,"../../components/app/network-display/network-display":3652,"../../components/component-library/icon/deprecated":3836,"../../components/ui/box":3900,"../../components/ui/callout":3906,"../../components/ui/site-origin":4015,"../../helpers/constants/design-system":4070,"../../helpers/constants/routes":4074,"../../hooks/useI18nContext":4129,"../../hooks/useOriginMetadata":4132,"../../selectors":4436,"./components/confirmation-footer":4200,"./templates":4206,immer:2694,lodash:2932,"prop-types":3032,react:3177,"react-redux":3130,"react-router-dom":3150},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=N;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=w(t);if(a&&a.has(e))return a.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,a&&a.set(e,n);return n}(e("react")),s=A(e("prop-types")),r=e("react-redux"),o=e("react-router-dom"),i=e("lodash"),c=e("immer"),u=e("../../../shared/constants/app"),l=A(e("../../components/ui/box")),d=A(e("../../components/app/metamask-template-renderer")),m=A(e("../../components/app/confirmation-warning-modal")),p=e("../../helpers/constants/routes"),f=e("../../helpers/constants/design-system"),g=e("../../hooks/useI18nContext"),T=e("../../hooks/useOriginMetadata"),h=e("../../selectors"),E=A(e("../../components/app/network-display/network-display")),v=A(e("../../components/ui/callout")),_=A(e("../../components/ui/site-origin")),y=e("../../components/component-library/icon/deprecated"),S=A(e("./components/confirmation-footer")),k=e("./templates");function A(e){return e&&e.__esModule?e:{default:e}}function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,a=new WeakMap;return(w=function(e){return e?a:t})(e)}const b=(0,c.produce)(((e,t)=>{var a;switch(t.type){case"dismiss":null!=e&&null!==(a=e[t.confirmationId])&&void 0!==a&&a[t.alertId]&&(e[t.confirmationId][t.alertId].dismissed=!0);break;case"set":e[t.confirmationId]||(e[t.confirmationId]={}),t.alerts.forEach((a=>{e[t.confirmationId][a.id]={...a,dismissed:!1}}));break;default:throw new Error("You must provide a type when dispatching an action for alertState")}}));function N({redirectToHomeOnZeroConfirmations:e=!0}){const t=(0,g.useI18nContext)(),a=(0,r.useDispatch)(),s=(0,o.useHistory)(),c=(0,r.useSelector)(h.getUnapprovedTemplatedConfirmations,i.isEqual),[A,w]=(0,n.useState)(0),N=c[A],O=(0,T.useOriginMetadata)(null==N?void 0:N.origin)||{},[C,I]=function(e){const[t,a]=(0,n.useReducer)(b,{});return(0,n.useEffect)((()=>{let t=!0;return e&&(0,k.getTemplateAlerts)(e).then((n=>{t&&n.length>0&&a({type:"set",confirmationId:e.id,alerts:n})})),()=>{t=!1}}),[e]),[t,(0,n.useCallback)((t=>{a({type:"dismiss",confirmationId:e.id,alertId:t})}),[e])]}(N),[P]=function(e){const[t,a]=(0,n.useState)({});return(0,n.useEffect)((()=>{let t=!0;return e&&(0,k.getTemplateState)(e).then((n=>{t&&Object.values(n).length>0&&a((t=>({...t,[e.id]:n})))})),()=>{t=!1}}),[e]),[t]}(N),[R,M]=(0,n.useState)(!1),x=(0,r.useSelector)(h.getUnapprovedTxCount),[F,D]=(0,n.useState)({}),G=(e,t)=>{D((a=>({...a,[e]:t})))},[U,L]=(0,n.useState)(!1),[j,$]=(0,n.useState)(),[H,W]=(0,n.useState)([]),B=[],q=(0,n.useMemo)((()=>N?(0,k.getTemplateValues)({...N},t,a,s,G):{}),[N,t,a,s]);if((0,n.useEffect)((()=>{0===c.length&&e?s.push(p.DEFAULT_ROUTE):c.length<=A&&w(c.length-1)}),[c,s,A,e]),!N)return null;const V=e=>{(null==e?void 0:e.length)>0?($(q.submitText),W(e),L(!0)):L(!1)};return n.default.createElement("div",{className:"confirmation-page"},c.length>1&&n.default.createElement("div",{className:"confirmation-page__navigation"},n.default.createElement("p",null,t("xOfYPending",[A+1,c.length])),A>0&&n.default.createElement("button",{className:"confirmation-page__navigation-button",onClick:()=>w(A-1)},n.default.createElement(y.Icon,{name:y.ICON_NAMES.ARROW_LEFT})),n.default.createElement("button",{className:"confirmation-page__navigation-button",disabled:A+1===c.length,onClick:()=>w(A+1)},n.default.createElement(y.Icon,{name:y.ICON_NAMES.ARROW_RIGHT}))),n.default.createElement("div",{className:"confirmation-page__content"},q.networkDisplay?n.default.createElement(l.default,{justifyContent:"center",marginTop:2},n.default.createElement(E.default,{indicatorSize:f.Size.XS,labelProps:{color:f.TextColor.textDefault}})):null,"metamask"===N.origin&&n.default.createElement(l.default,{alignItems:f.AlignItems.center,paddingTop:2,paddingRight:4,paddingLeft:4,paddingBottom:4,flexDirection:f.FLEX_DIRECTION.COLUMN},n.default.createElement(_.default,{chip:!0,siteOrigin:O.origin,title:O.origin,iconSrc:O.iconUrl,iconName:O.hostname})),n.default.createElement(d.default,{sections:q.content}),R&&n.default.createElement(m.default,{onSubmit:async()=>{const e=await q.onSubmit();await V(e),M(!1)},onCancel:q.onCancel})),n.default.createElement(S.default,{alerts:C[N.id]&&x>0&&Object.values(C[N.id]).filter((e=>!1===e.dismissed)).map(((e,t,a)=>n.default.createElement(v.default,{key:e.id,severity:e.severity,dismiss:()=>I(e.id),isFirst:0===t,isLast:t===a.length-1,isMultiple:a.length>1},n.default.createElement(d.default,{sections:e.content})))),onSubmit:async()=>{var e,t;if(L(!0),null!==(e=P[N.id])&&void 0!==e&&e.useWarningModal)M(!0);else{const e=(t=N.type,B.includes(t)?F[u.MESSAGE_TYPE.SNAP_DIALOG_PROMPT]:null),a=await q.onSubmit(e);V(a)}},onCancel:q.onCancel,submitText:q.submitText,cancelText:q.cancelText,loadingText:j||q.loadingText,loading:U,submitAlerts:H.map(((e,t)=>n.default.createElement(v.default,{key:e.id,severity:e.severity,isFirst:0===t},n.default.createElement(d.default,{sections:e.content}))))}))}N.propTypes={redirectToHomeOnZeroConfirmations:s.default.bool}}}},{package:"$root$",file:"ui/pages/confirmation/confirmation.js"}],[4204,{"./confirmation":4203},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s.default}});var n,s=(n=e("./confirmation"))&&n.__esModule?n:{default:n}}}},{package:"$root$",file:"ui/pages/confirmation/index.js"}]],[],{});