-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy path56859.6d4545a7.iframe.bundle.js
1 lines (1 loc) · 77.3 KB
/
56859.6d4545a7.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[56859],{"./shared/constants/security-provider.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{K$:()=>SECURITY_PROVIDER_UTM_SOURCE,NE:()=>FALSE_POSITIVE_REPORT_BASE_URL,O5:()=>SecurityProvider,W4:()=>BlockaidReason,ob:()=>SECURITY_PROVIDER_CONFIG,p0:()=>BlockaidResultType});var SecurityProvider,BlockaidReason,BlockaidResultType,SecurityAlertSource,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@metamask/transaction-controller/dist/types.mjs");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}(SecurityProvider||(SecurityProvider={})).Blockaid="blockaid";var SECURITY_PROVIDER_CONFIG=_define_property({},"blockaid",{tKeyName:"blockaid",url:"https://blockaid.io/"});!function(BlockaidReason){BlockaidReason.approvalFarming="approval_farming",BlockaidReason.blurFarming="blur_farming",BlockaidReason.maliciousDomain="malicious_domain",BlockaidReason.permitFarming="permit_farming",BlockaidReason.rawNativeTokenTransfer="raw_native_token_transfer",BlockaidReason.rawSignatureFarming="raw_signature_farming",BlockaidReason.seaportFarming="seaport_farming",BlockaidReason.setApprovalForAll="set_approval_for_all",BlockaidReason.tradeOrderFarming="trade_order_farming",BlockaidReason.transferFarming="transfer_farming",BlockaidReason.transferFromFarming="transfer_from_farming",BlockaidReason.other="other",BlockaidReason.errored="Error",BlockaidReason.notApplicable="NotApplicable",BlockaidReason.inProgress="validation_in_progress"}(BlockaidReason||(BlockaidReason={})),function(BlockaidResultType){BlockaidResultType.Malicious="Malicious",BlockaidResultType.Warning="Warning",BlockaidResultType.Benign="Benign",BlockaidResultType.Errored="Error",BlockaidResultType.NotApplicable="NotApplicable",BlockaidResultType.Loading="loading"}(BlockaidResultType||(BlockaidResultType={}));var FALSE_POSITIVE_REPORT_BASE_URL="https://blockaid-false-positive-portal.metamask.io",SECURITY_PROVIDER_UTM_SOURCE="metamask-ppom";_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__.D_.swap,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__.D_.swapApproval,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__.D_.swapAndSend,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__.D_.bridgeApproval,_metamask_transaction_controller__WEBPACK_IMPORTED_MODULE_0__.D_.bridge,function(SecurityAlertSource){SecurityAlertSource.API="api",SecurityAlertSource.Local="local"}(SecurityAlertSource||(SecurityAlertSource={}))},"./ui/components/app/alert-system/alert-modal/alert-modal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{F:()=>AcknowledgeCheckboxBase,W:()=>AlertModal1});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_metamask_snaps_sdk__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@metamask/snaps-sdk/dist/ui/components/button.mjs"),_shared_constants_security_provider__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./shared/constants/security-provider.ts"),_component_library__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/components/component-library/index.ts"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/hooks/useI18nContext.js"),_hooks_useAlerts__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/hooks/useAlerts.ts"),_contexts_alertActionHandler__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/components/app/alert-system/contexts/alertActionHandler.tsx"),_contexts_alertMetricsContext__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/components/app/alert-system/contexts/alertMetricsContext.tsx");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}function _iterable_to_array(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _non_iterable_spread(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _to_consumable_array(arr){return _array_without_holes(arr)||_iterable_to_array(arr)||_unsupported_iterable_to_array(arr)||_non_iterable_spread()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}function getSeverityStyle(severity){switch(severity){case _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI.Warning:return{background:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.i0.warningMuted,icon:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Li.warningDefault};case _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI.Danger:return{background:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.i0.errorMuted,icon:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Li.errorDefault};default:return{background:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.i0.backgroundDefault,icon:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Li.infoDefault}}}function AlertHeader(param){var _ref,selectedAlert=param.selectedAlert,customTitle=param.customTitle,t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_4__.P)(),severity=selectedAlert.severity,reason=selectedAlert.reason,severityStyle=getSeverityStyle(severity);return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{gap:3,display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.Block,alignItems:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.k2.center,textAlign:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nO.Center},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.In,{name:severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI.Info?_component_library__WEBPACK_IMPORTED_MODULE_2__.$M.Info:_component_library__WEBPACK_IMPORTED_MODULE_2__.$M.Danger,size:_component_library__WEBPACK_IMPORTED_MODULE_2__.lK.Xl,color:severityStyle.icon}),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.EY,{variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.J3.headingSm,color:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.r7.inherit,marginTop:3,marginBottom:4},null!==(_ref=null!=customTitle?customTitle:reason)&&void 0!==_ref?_ref:t("alert")))}function BlockaidAlertDetails(){var t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_4__.P)();return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.EY,{textAlign:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nO.Center,variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.J3.bodyMd},t("blockaidAlertInfo"))}function AlertDetails(param){var _selectedAlert_alertDetails,_selectedAlert_alertDetails1,selectedAlert=param.selectedAlert,customDetails=param.customDetails,t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_4__.P)(),severityStyle=getSeverityStyle(selectedAlert.severity);return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{key:selectedAlert.key,display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.InlineBlock,padding:customDetails?0:2,width:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Zf.Full,backgroundColor:customDetails?void 0:severityStyle.background,borderRadius:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Z6.SM},null!=customDetails?customDetails:react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,null,!!selectedAlert.content&&selectedAlert.content,!!selectedAlert.message&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.EY,{variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.J3.bodyMd,"data-testid":"alert-modal__selected-alert"},selectedAlert.message),(null===(_selectedAlert_alertDetails=selectedAlert.alertDetails)||void 0===_selectedAlert_alertDetails?void 0:_selectedAlert_alertDetails.length)?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.EY,{variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.J3.bodyMdBold,marginTop:1},t("alertModalDetails")):null,react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{as:"ul",className:"alert-modal__alert-details",paddingLeft:6},null===(_selectedAlert_alertDetails1=selectedAlert.alertDetails)||void 0===_selectedAlert_alertDetails1?void 0:_selectedAlert_alertDetails1.map(function(detail,index){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{as:"li",key:"".concat(selectedAlert.key,"-detail-").concat(index)},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.EY,{variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.J3.bodyMd},detail))}))))}function AcknowledgeCheckboxBase(param){var selectedAlert=param.selectedAlert,onCheckboxClick=param.onCheckboxClick,isConfirmed=param.isConfirmed,label=param.label;if(selectedAlert.isBlocking||selectedAlert.severity!==_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI.Danger)return null;var t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_4__.P)(),severityStyle=getSeverityStyle(selectedAlert.severity);return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.Flex,padding:4,width:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Zf.Full,backgroundColor:severityStyle.background,borderRadius:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Z6.LG,marginTop:4},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.Sc,{label:null!=label?label:t("alertModalAcknowledge"),"data-testid":"alert-modal-acknowledge-checkbox",isChecked:isConfirmed,onChange:onCheckboxClick,alignItems:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.k2.flexStart,className:"alert-modal__acknowledge-checkbox"}))}function AcknowledgeButton(param){var onAcknowledgeClick=param.onAcknowledgeClick,isConfirmed=param.isConfirmed,hasActions=param.hasActions,isBlocking=param.isBlocking,t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_4__.P)();return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.$n,{variant:hasActions?_metamask_snaps_sdk__WEBPACK_IMPORTED_MODULE_8__.Ak.Secondary:_metamask_snaps_sdk__WEBPACK_IMPORTED_MODULE_8__.Ak.Primary,width:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Zf.Full,onClick:onAcknowledgeClick,size:_component_library__WEBPACK_IMPORTED_MODULE_2__.Mp.Lg,"data-testid":"alert-modal-button",disabled:!isBlocking&&!isConfirmed},t("gotIt"))}function ActionButton(param){var action=param.action,onClose=param.onClose,alertKey=param.alertKey,processAction=(0,_contexts_alertActionHandler__WEBPACK_IMPORTED_MODULE_6__.Qh)().processAction,trackAlertActionClicked=(0,_contexts_alertMetricsContext__WEBPACK_IMPORTED_MODULE_7__.r)().trackAlertActionClicked,handleClick=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(){action&&(trackAlertActionClicked(alertKey),processAction(action.key),onClose({recursive:!0}))},[action,onClose,processAction,trackAlertActionClicked,alertKey]);if(!action)return null;var key=action.key,label=action.label,dataTestId="alert-modal-action-".concat(key);return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.$n,{"data-testid":dataTestId,key:key,variant:_metamask_snaps_sdk__WEBPACK_IMPORTED_MODULE_8__.Ak.Primary,width:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Zf.Full,size:_component_library__WEBPACK_IMPORTED_MODULE_2__.Mp.Lg,onClick:handleClick},label)}function AlertModal1(param){var _selectedAlert_actions,ownerId=param.ownerId,onAcknowledgeClick=param.onAcknowledgeClick,alertKey=param.alertKey,onClose=param.onClose,headerStartAccessory=param.headerStartAccessory,customTitle=param.customTitle,customDetails=param.customDetails,customAcknowledgeCheckbox=param.customAcknowledgeCheckbox,customAcknowledgeButton=param.customAcknowledgeButton,_param_showCloseIcon=param.showCloseIcon,showCloseIcon=void 0===_param_showCloseIcon||_param_showCloseIcon,_useAlerts=(0,_hooks_useAlerts__WEBPACK_IMPORTED_MODULE_5__.A)(ownerId),isAlertConfirmed=_useAlerts.isAlertConfirmed,setAlertConfirmed=_useAlerts.setAlertConfirmed,alerts=_useAlerts.alerts,trackAlertRender=(0,_contexts_alertMetricsContext__WEBPACK_IMPORTED_MODULE_7__.r)().trackAlertRender,handleClose=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];onClose.apply(void 0,_to_consumable_array(args))},[onClose]),selectedAlert=alerts.find(function(alert){return alert.key===alertKey});(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function(){selectedAlert&&trackAlertRender(selectedAlert.key)},[selectedAlert,trackAlertRender]);var isConfirmed=!!selectedAlert&&isAlertConfirmed(selectedAlert.key),isAlertDanger=!!selectedAlert&&selectedAlert.severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI.Danger,handleCheckboxClick=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(){selectedAlert&&setAlertConfirmed(selectedAlert.key,!isConfirmed)},[isConfirmed,selectedAlert,setAlertConfirmed]);return selectedAlert?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.aF,{isOpen:!0,onClose:handleClose,"data-testid":"alert-modal"},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.mH,null),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.$m,null,react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.rQ,{onClose:showCloseIcon?handleClose:void 0,startAccessory:headerStartAccessory,paddingBottom:0,display:headerStartAccessory?_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.InlineFlex:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.Block,closeButtonProps:{"data-testid":"alert-modal-close-button"},endAccessory:showCloseIcon?void 0:null}),react__WEBPACK_IMPORTED_MODULE_0__.createElement(AlertHeader,{selectedAlert:selectedAlert,customTitle:customTitle}),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.cw,null,selectedAlert.provider===_shared_constants_security_provider__WEBPACK_IMPORTED_MODULE_1__.O5.Blockaid?react__WEBPACK_IMPORTED_MODULE_0__.createElement(BlockaidAlertDetails,null):react__WEBPACK_IMPORTED_MODULE_0__.createElement(AlertDetails,{selectedAlert:selectedAlert,customDetails:customDetails}),null!=customAcknowledgeCheckbox?customAcknowledgeCheckbox:react__WEBPACK_IMPORTED_MODULE_0__.createElement(AcknowledgeCheckboxBase,{selectedAlert:selectedAlert,isConfirmed:isConfirmed,onCheckboxClick:handleCheckboxClick})),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.jl,null,react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.Flex,flexDirection:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.bo.Column,gap:4,paddingTop:2,width:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Zf.Full},null!=customAcknowledgeButton?customAcknowledgeButton:react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0__.createElement(AcknowledgeButton,{onAcknowledgeClick:onAcknowledgeClick,isConfirmed:!isAlertDanger||isConfirmed,hasActions:!!selectedAlert.actions,isBlocking:selectedAlert.isBlocking}),(null!==(_selectedAlert_actions=selectedAlert.actions)&&void 0!==_selectedAlert_actions?_selectedAlert_actions:[]).map(function(action){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(ActionButton,{key:action.key,action:action,onClose:handleClose,alertKey:selectedAlert.key})})))))):null}try{AcknowledgeCheckboxBase.displayName="AcknowledgeCheckboxBase",AcknowledgeCheckboxBase.__docgenInfo={description:"",displayName:"AcknowledgeCheckboxBase",props:{selectedAlert:{defaultValue:null,description:"",name:"selectedAlert",required:!0,type:{name:"Alert"}},onCheckboxClick:{defaultValue:null,description:"",name:"onCheckboxClick",required:!0,type:{name:"() => void"}},isConfirmed:{defaultValue:null,description:"",name:"isConfirmed",required:!0,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/alert-system/alert-modal/alert-modal.tsx#AcknowledgeCheckboxBase"]={docgenInfo:AcknowledgeCheckboxBase.__docgenInfo,name:"AcknowledgeCheckboxBase",path:"ui/components/app/alert-system/alert-modal/alert-modal.tsx#AcknowledgeCheckboxBase"})}catch(__react_docgen_typescript_loader_error){}try{AlertModal1.displayName="AlertModal",AlertModal1.__docgenInfo={description:"",displayName:"AlertModal",props:{alertKey:{defaultValue:null,description:"The unique key representing the specific alert field.",name:"alertKey",required:!0,type:{name:"string"}},customAcknowledgeButton:{defaultValue:null,description:"The custom button component for acknowledging the alert.",name:"customAcknowledgeButton",required:!1,type:{name:"ReactNode"}},customAcknowledgeCheckbox:{defaultValue:null,description:"The custom checkbox component for acknowledging the alert.",name:"customAcknowledgeCheckbox",required:!1,type:{name:"ReactNode"}},customDetails:{defaultValue:null,description:"The custom details component for the alert.",name:"customDetails",required:!1,type:{name:"ReactNode"}},customTitle:{defaultValue:null,description:"The custom title for the alert.",name:"customTitle",required:!1,type:{name:"string"}},headerStartAccessory:{defaultValue:null,description:"The start (left) content area of ModalHeader.\nIt overrides `startAccessory` of ModalHeaderDefault and by default no content is present.",name:"headerStartAccessory",required:!1,type:{name:"ReactNode"}},onAcknowledgeClick:{defaultValue:null,description:"The function invoked when the user acknowledges the alert.",name:"onAcknowledgeClick",required:!0,type:{name:"() => void"}},onClose:{defaultValue:null,description:"The function to be executed when the modal needs to be closed.",name:"onClose",required:!0,type:{name:"(request?: { recursive?: boolean | undefined; } | undefined) => void"}},ownerId:{defaultValue:null,description:"The owner ID of the relevant alert from the `confirmAlerts` reducer.",name:"ownerId",required:!0,type:{name:"string"}},showCloseIcon:{defaultValue:{value:"true"},description:"Whether to show the close icon in the modal header.",name:"showCloseIcon",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/alert-system/alert-modal/alert-modal.tsx#AlertModal"]={docgenInfo:AlertModal1.__docgenInfo,name:"AlertModal",path:"ui/components/app/alert-system/alert-modal/alert-modal.tsx#AlertModal"})}catch(__react_docgen_typescript_loader_error){}},"./ui/components/app/alert-system/alert-modal/index.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{W:()=>_alert_modal__WEBPACK_IMPORTED_MODULE_0__.W});var _alert_modal__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/components/app/alert-system/alert-modal/alert-modal.tsx");try{AlertModal.displayName="AlertModal",AlertModal.__docgenInfo={description:"",displayName:"AlertModal",props:{alertKey:{defaultValue:null,description:"The unique key representing the specific alert field.",name:"alertKey",required:!0,type:{name:"string"}},customAcknowledgeButton:{defaultValue:null,description:"The custom button component for acknowledging the alert.",name:"customAcknowledgeButton",required:!1,type:{name:"ReactNode"}},customAcknowledgeCheckbox:{defaultValue:null,description:"The custom checkbox component for acknowledging the alert.",name:"customAcknowledgeCheckbox",required:!1,type:{name:"ReactNode"}},customDetails:{defaultValue:null,description:"The custom details component for the alert.",name:"customDetails",required:!1,type:{name:"ReactNode"}},customTitle:{defaultValue:null,description:"The custom title for the alert.",name:"customTitle",required:!1,type:{name:"string"}},headerStartAccessory:{defaultValue:null,description:"The start (left) content area of ModalHeader.\nIt overrides `startAccessory` of ModalHeaderDefault and by default no content is present.",name:"headerStartAccessory",required:!1,type:{name:"ReactNode"}},onAcknowledgeClick:{defaultValue:null,description:"The function invoked when the user acknowledges the alert.",name:"onAcknowledgeClick",required:!0,type:{name:"() => void"}},onClose:{defaultValue:null,description:"The function to be executed when the modal needs to be closed.",name:"onClose",required:!0,type:{name:"(request?: { recursive?: boolean | undefined; } | undefined) => void"}},ownerId:{defaultValue:null,description:"The owner ID of the relevant alert from the `confirmAlerts` reducer.",name:"ownerId",required:!0,type:{name:"string"}},showCloseIcon:{defaultValue:{value:"true"},description:"Whether to show the close icon in the modal header.",name:"showCloseIcon",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/alert-system/alert-modal/index.tsx#AlertModal"]={docgenInfo:AlertModal.__docgenInfo,name:"AlertModal",path:"ui/components/app/alert-system/alert-modal/index.tsx#AlertModal"})}catch(__react_docgen_typescript_loader_error){}},"./ui/components/app/alert-system/contexts/alertActionHandler.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Qh:()=>useAlertActionHandler,U1:()=>AlertActionHandlerProvider});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),AlertActionHandlerContext=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(void 0),AlertActionHandlerProvider=function(param){var children=param.children,onProcessAction=param.onProcessAction,processAction=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(_actionKey){onProcessAction(_actionKey)},[onProcessAction]);return react__WEBPACK_IMPORTED_MODULE_0__.createElement(AlertActionHandlerContext.Provider,{value:{processAction:processAction}},children)},useAlertActionHandler=function(){var context=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(AlertActionHandlerContext);if(!context)throw Error("useAlertActionHandler must be used within an AlertActionHandlerProvider");return context};try{AlertActionHandlerProvider.displayName="AlertActionHandlerProvider",AlertActionHandlerProvider.__docgenInfo={description:"",displayName:"AlertActionHandlerProvider",props:{onProcessAction:{defaultValue:null,description:"",name:"onProcessAction",required:!0,type:{name:"(actionKey: string) => void"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/alert-system/contexts/alertActionHandler.tsx#AlertActionHandlerProvider"]={docgenInfo:AlertActionHandlerProvider.__docgenInfo,name:"AlertActionHandlerProvider",path:"ui/components/app/alert-system/contexts/alertActionHandler.tsx#AlertActionHandlerProvider"})}catch(__react_docgen_typescript_loader_error){}},"./ui/components/app/alert-system/inline-alert/inline-alert.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>InlineAlert});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_component_library__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/components/component-library/index.ts"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/hooks/useI18nContext.js"),_utils__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/components/app/alert-system/utils.ts");function InlineAlert(param){var onClick=param.onClick,_param_severity=param.severity,severity=void 0===_param_severity?_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI.Info:_param_severity,style=param.style,t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_4__.P)();return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,null,react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{"data-testid":"inline-alert",backgroundColor:(0,_utils__WEBPACK_IMPORTED_MODULE_5__.aw)(severity),borderRadius:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Z6.SM,gap:1,display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.InlineFlex,alignItems:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.k2.center,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()({"inline-alert":!0,"inline-alert__info":severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI.Info,"inline-alert__warning":severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI.Warning,"inline-alert__danger":severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI.Danger}),style:style,onClick:onClick},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.In,{name:severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI.Info?_component_library__WEBPACK_IMPORTED_MODULE_2__.$M.Info:_component_library__WEBPACK_IMPORTED_MODULE_2__.$M.Danger,size:_component_library__WEBPACK_IMPORTED_MODULE_2__.lK.Sm}),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.EY,{variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.J3.bodySm,color:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.r7.inherit},t("alert")),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.In,{name:_component_library__WEBPACK_IMPORTED_MODULE_2__.$M.ArrowRight,size:_component_library__WEBPACK_IMPORTED_MODULE_2__.lK.Xs})))}try{inlinealert.displayName="inlinealert",inlinealert.__docgenInfo={description:"",displayName:"inlinealert",props:{onClick:{defaultValue:null,description:"The onClick handler for the inline alerts",name:"onClick",required:!1,type:{name:"(() => void)"}},severity:{defaultValue:{value:"Severity.Info"},description:"The severity of the alert, e.g. Severity.Warning",name:"severity",required:!1,type:{name:"enum",value:[{value:'"danger"'},{value:'"warning"'},{value:'"info"'},{value:'"success"'}]}},style:{defaultValue:null,description:"Additional styles to apply to the inline alert",name:"style",required:!1,type:{name:"CSSProperties"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/alert-system/inline-alert/inline-alert.tsx#inlinealert"]={docgenInfo:inlinealert.__docgenInfo,name:"inlinealert",path:"ui/components/app/alert-system/inline-alert/inline-alert.tsx#inlinealert"})}catch(__react_docgen_typescript_loader_error){}},"./ui/components/app/alert-system/multiple-alert-modal/index.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{C:()=>_multiple_alert_modal__WEBPACK_IMPORTED_MODULE_0__.C});var _multiple_alert_modal__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/components/app/alert-system/multiple-alert-modal/multiple-alert-modal.tsx");try{MultipleAlertModal.displayName="MultipleAlertModal",MultipleAlertModal.__docgenInfo={description:"",displayName:"MultipleAlertModal",props:{alertKey:{defaultValue:null,description:"The key of the initial alert to display.",name:"alertKey",required:!1,type:{name:"string"}},onFinalAcknowledgeClick:{defaultValue:null,description:"The function to be executed when the button in the alert modal is clicked.",name:"onFinalAcknowledgeClick",required:!0,type:{name:"() => void"}},onClose:{defaultValue:null,description:"The function to be executed when the modal needs to be closed.",name:"onClose",required:!0,type:{name:"(request?: { recursive?: boolean | undefined; } | undefined) => void"}},ownerId:{defaultValue:null,description:"The unique identifier of the entity that owns the alert.",name:"ownerId",required:!0,type:{name:"string"}},showCloseIcon:{defaultValue:{value:"true"},description:"Whether to show the close icon in the modal header.",name:"showCloseIcon",required:!1,type:{name:"boolean"}},skipAlertNavigation:{defaultValue:{value:"false"},description:"Whether to skip the unconfirmed alerts validation and close the modal directly.",name:"skipAlertNavigation",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/alert-system/multiple-alert-modal/index.tsx#MultipleAlertModal"]={docgenInfo:MultipleAlertModal.__docgenInfo,name:"MultipleAlertModal",path:"ui/components/app/alert-system/multiple-alert-modal/index.tsx#MultipleAlertModal"})}catch(__react_docgen_typescript_loader_error){}},"./ui/components/app/alert-system/multiple-alert-modal/multiple-alert-modal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{C:()=>MultipleAlertModal1});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_component_library__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/components/component-library/index.ts"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/hooks/useI18nContext.js"),_hooks_useAlerts__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/hooks/useAlerts.ts"),_alert_modal__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/components/app/alert-system/alert-modal/index.tsx");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}function PreviousButton(param){var selectedIndex=param.selectedIndex,onBackButtonClick=param.onBackButtonClick,t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_3__.P)();return selectedIndex+1>1?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_1__.a2,{iconName:_component_library__WEBPACK_IMPORTED_MODULE_1__.$M.ArrowLeft,ariaLabel:t("back"),size:_component_library__WEBPACK_IMPORTED_MODULE_1__.f3.Sm,onClick:onBackButtonClick,className:"confirm_nav__left_btn","data-testid":"alert-modal-back-button",borderRadius:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Z6.full,color:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Li.iconAlternative,backgroundColor:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.i0.backgroundAlternative}):null}function NextButton(param){var selectedIndex=param.selectedIndex,alertsLength=param.alertsLength,onNextButtonClick=param.onNextButtonClick,t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_3__.P)();return selectedIndex+1<alertsLength?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_1__.a2,{iconName:_component_library__WEBPACK_IMPORTED_MODULE_1__.$M.ArrowRight,ariaLabel:t("next"),size:_component_library__WEBPACK_IMPORTED_MODULE_1__.f3.Sm,onClick:onNextButtonClick,className:"confirm_nav__right_btn","data-testid":"alert-modal-next-button",borderRadius:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Z6.full,color:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Li.iconAlternative,backgroundColor:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.i0.backgroundAlternative}):null}function PageNumber(param){var selectedIndex=param.selectedIndex,alertsLength=param.alertsLength,t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_3__.P)();return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_1__.EY,{variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.J3.bodySm,color:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.r7.textAlternative,marginInline:1,style:{whiteSpace:"nowrap"}},"".concat(selectedIndex+1," ").concat(t("ofTextNofM")," ").concat(alertsLength))}function PageNavigation(param){var alerts=param.alerts,onBackButtonClick=param.onBackButtonClick,onNextButtonClick=param.onNextButtonClick,selectedIndex=param.selectedIndex;return alerts.length<=1?null:react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_1__.az,{display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.nl.Flex,alignItems:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.k2.center},react__WEBPACK_IMPORTED_MODULE_0__.createElement(PreviousButton,{selectedIndex:selectedIndex,onBackButtonClick:onBackButtonClick}),react__WEBPACK_IMPORTED_MODULE_0__.createElement(PageNumber,{selectedIndex:selectedIndex,alertsLength:alerts.length}),react__WEBPACK_IMPORTED_MODULE_0__.createElement(NextButton,{selectedIndex:selectedIndex,alertsLength:alerts.length,onNextButtonClick:onNextButtonClick}))}function MultipleAlertModal1(param){var _alerts_selectedIndex,alertKey=param.alertKey,onClose=param.onClose,onFinalAcknowledgeClick=param.onFinalAcknowledgeClick,ownerId=param.ownerId,_param_showCloseIcon=param.showCloseIcon,_param_skipAlertNavigation=param.skipAlertNavigation,skipAlertNavigation=void 0!==_param_skipAlertNavigation&&_param_skipAlertNavigation,_useAlerts=(0,_hooks_useAlerts__WEBPACK_IMPORTED_MODULE_4__.A)(ownerId),isAlertConfirmed=_useAlerts.isAlertConfirmed,alerts=_useAlerts.fieldAlerts,initialAlertIndex=alerts.findIndex(function(alert){return alert.key===alertKey}),_useState=_sliced_to_array((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(-1===initialAlertIndex?0:initialAlertIndex),2),selectedIndex=_useState[0],setSelectedIndex=_useState[1],selectedAlert=null!==(_alerts_selectedIndex=alerts[selectedIndex])&&void 0!==_alerts_selectedIndex?_alerts_selectedIndex:alerts[0],hasUnconfirmedAlerts=alerts.some(function(alert){return!isAlertConfirmed(alert.key)&&alert.severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.AI.Danger}),handleBackButtonClick=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(){setSelectedIndex(function(prevIndex){return prevIndex>0?prevIndex-1:prevIndex})},[]),handleNextButtonClick=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(){setSelectedIndex(function(prevIndex){return prevIndex+1})},[]),handleAcknowledgeClick=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function(){if(skipAlertNavigation){onFinalAcknowledgeClick();return}if(selectedIndex+1===alerts.length){if(!hasUnconfirmedAlerts){onFinalAcknowledgeClick();return}setSelectedIndex(0);return}handleNextButtonClick()},[onFinalAcknowledgeClick,handleNextButtonClick,selectedIndex,alerts.length,hasUnconfirmedAlerts,skipAlertNavigation]);return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_alert_modal__WEBPACK_IMPORTED_MODULE_5__.W,{ownerId:ownerId,onAcknowledgeClick:handleAcknowledgeClick,alertKey:null==selectedAlert?void 0:selectedAlert.key,onClose:onClose,headerStartAccessory:react__WEBPACK_IMPORTED_MODULE_0__.createElement(PageNavigation,{alerts:alerts,onBackButtonClick:handleBackButtonClick,onNextButtonClick:handleNextButtonClick,selectedIndex:selectedIndex}),showCloseIcon:void 0===_param_showCloseIcon||_param_showCloseIcon})}try{MultipleAlertModal1.displayName="MultipleAlertModal",MultipleAlertModal1.__docgenInfo={description:"",displayName:"MultipleAlertModal",props:{alertKey:{defaultValue:null,description:"The key of the initial alert to display.",name:"alertKey",required:!1,type:{name:"string"}},onFinalAcknowledgeClick:{defaultValue:null,description:"The function to be executed when the button in the alert modal is clicked.",name:"onFinalAcknowledgeClick",required:!0,type:{name:"() => void"}},onClose:{defaultValue:null,description:"The function to be executed when the modal needs to be closed.",name:"onClose",required:!0,type:{name:"(request?: { recursive?: boolean | undefined; } | undefined) => void"}},ownerId:{defaultValue:null,description:"The unique identifier of the entity that owns the alert.",name:"ownerId",required:!0,type:{name:"string"}},showCloseIcon:{defaultValue:{value:"true"},description:"Whether to show the close icon in the modal header.",name:"showCloseIcon",required:!1,type:{name:"boolean"}},skipAlertNavigation:{defaultValue:{value:"false"},description:"Whether to skip the unconfirmed alerts validation and close the modal directly.",name:"skipAlertNavigation",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/alert-system/multiple-alert-modal/multiple-alert-modal.tsx#MultipleAlertModal"]={docgenInfo:MultipleAlertModal1.__docgenInfo,name:"MultipleAlertModal",path:"ui/components/app/alert-system/multiple-alert-modal/multiple-alert-modal.tsx#MultipleAlertModal"})}catch(__react_docgen_typescript_loader_error){}},"./ui/components/app/alert-system/utils.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Sp:()=>getBannerAlertSeverity,aw:()=>getSeverityBackground});var _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_component_library__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/components/component-library/index.ts");function getSeverityBackground(severity){switch(severity){case _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_0__.AI.Danger:return _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_0__.i0.errorMuted;case _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_0__.AI.Warning:return _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_0__.i0.warningMuted;default:return _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_0__.i0.primaryMuted}}function getBannerAlertSeverity(severity){switch(severity){case _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_0__.AI.Danger:return _component_library__WEBPACK_IMPORTED_MODULE_1__.OU.Danger;case _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_0__.AI.Warning:return _component_library__WEBPACK_IMPORTED_MODULE_1__.OU.Warning;default:return _component_library__WEBPACK_IMPORTED_MODULE_1__.OU.Info}}},"./ui/components/app/confirm/info/row/alert-row/alert-row.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{n:()=>ConfirmInfoAlertRow});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_alert_system_inline_alert_inline_alert__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/components/app/alert-system/inline-alert/inline-alert.tsx"),_hooks_useAlerts__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/hooks/useAlerts.ts"),_row__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/components/app/confirm/info/row/row.tsx"),_component_library__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/components/component-library/index.ts"),_alert_system_multiple_alert_modal__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/components/app/alert-system/multiple-alert-modal/index.tsx"),_alert_system_contexts_alertMetricsContext__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/components/app/alert-system/contexts/alertMetricsContext.tsx");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}function _object_without_properties(source,excluded){if(null==source)return{};var key,i,target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _object_without_properties_loose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}function getAlertTextColors(variant){switch(variant){case _row__WEBPACK_IMPORTED_MODULE_4__.aj.Critical:case _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_1__.AI.Danger:return _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_1__.r7.errorDefault;case _row__WEBPACK_IMPORTED_MODULE_4__.aj.Warning:case _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_1__.AI.Warning:return _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_1__.r7.warningDefault;case _row__WEBPACK_IMPORTED_MODULE_4__.aj.Default:case _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_1__.AI.Info:return _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_1__.r7.infoDefault;default:return _helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_1__.r7.textDefault}}var ConfirmInfoAlertRow=function(_param){var _fieldAlerts_,_fieldAlerts_1,alertKey=_param.alertKey,ownerId=_param.ownerId,variant=_param.variant,_param_isShownWithAlertsOnly=_param.isShownWithAlertsOnly,rowProperties=_object_without_properties(_param,["alertKey","ownerId","variant","isShownWithAlertsOnly"]),trackInlineAlertClicked=(0,_alert_system_contexts_alertMetricsContext__WEBPACK_IMPORTED_MODULE_7__.r)().trackInlineAlertClicked,fieldAlerts=(0,(0,_hooks_useAlerts__WEBPACK_IMPORTED_MODULE_3__.A)(ownerId).getFieldAlerts)(alertKey),hasFieldAlert=fieldAlerts.length>0,selectedAlertSeverity=null===(_fieldAlerts_=fieldAlerts[0])||void 0===_fieldAlerts_?void 0:_fieldAlerts_.severity,selectedAlertKey=null===(_fieldAlerts_1=fieldAlerts[0])||void 0===_fieldAlerts_1?void 0:_fieldAlerts_1.key,_useState=_sliced_to_array((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),2),alertModalVisible=_useState[0],setAlertModalVisible=_useState[1],handleModalClose=function(){setAlertModalVisible(!1)},confirmInfoRowProps=_object_spread_props(_object_spread({},rowProperties),{style:_object_spread({background:"transparent"},rowProperties.style),color:getAlertTextColors(null!=variant?variant:selectedAlertSeverity),variant:variant});if(void 0!==_param_isShownWithAlertsOnly&&_param_isShownWithAlertsOnly&&!hasFieldAlert)return null;var inlineAlert=hasFieldAlert?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_5__.az,{marginLeft:1},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_alert_system_inline_alert_inline_alert__WEBPACK_IMPORTED_MODULE_2__.A,{onClick:function(){setAlertModalVisible(!0),trackInlineAlertClicked(selectedAlertKey)},severity:selectedAlertSeverity})):null;return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,alertModalVisible&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_alert_system_multiple_alert_modal__WEBPACK_IMPORTED_MODULE_6__.C,{alertKey:selectedAlertKey,ownerId:ownerId,onFinalAcknowledgeClick:handleModalClose,onClose:handleModalClose,showCloseIcon:!1,skipAlertNavigation:!0}),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_row__WEBPACK_IMPORTED_MODULE_4__.z$,_object_spread_props(_object_spread({},confirmInfoRowProps),{labelChildren:inlineAlert})))};try{ConfirmInfoAlertRow.displayName="ConfirmInfoAlertRow",ConfirmInfoAlertRow.__docgenInfo={description:"",displayName:"ConfirmInfoAlertRow",props:{label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},tooltip:{defaultValue:null,description:"",name:"tooltip",required:!1,type:{name:"string"}},variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"default"'},{value:'"critical"'},{value:'"warning"'}]}},style:{defaultValue:null,description:"",name:"style",required:!1,type:{name:"CSSProperties"}},labelChildren:{defaultValue:null,description:"",name:"labelChildren",required:!1,type:{name:"ReactNode"}},color:{defaultValue:null,description:"",name:"color",required:!1,type:{name:"enum",value:[{value:'"text-default"'},{value:'"text-alternative"'},{value:'"text-alternative-soft"'},{value:'"text-muted"'},{value:'"overlay-inverse"'},{value:'"primary-default"'},{value:'"primary-inverse"'},{value:'"error-default"'},{value:'"error-alternative"'},{value:'"error-inverse"'},{value:'"success-default"'},{value:'"success-inverse"'},{value:'"warning-default"'},{value:'"warning-inverse"'},{value:'"info-default"'},{value:'"info-inverse"'},{value:'"inherit"'},{value:'"goerli"'},{value:'"sepolia"'},{value:'"linea-goerli"'},{value:'"linea-goerli-inverse"'},{value:'"linea-sepolia"'},{value:'"linea-sepolia-inverse"'},{value:'"linea-mainnet"'},{value:'"linea-mainnet-inverse"'},{value:'"goerli-inverse"'},{value:'"sepolia-inverse"'},{value:'"transparent"'}]}},copyEnabled:{defaultValue:null,description:"",name:"copyEnabled",required:!1,type:{name:"boolean"}},copyText:{defaultValue:null,description:"",name:"copyText",required:!1,type:{name:"string"}},"data-testid":{defaultValue:null,description:"",name:"data-testid",required:!1,type:{name:"string"}},collapsed:{defaultValue:null,description:"",name:"collapsed",required:!1,type:{name:"boolean"}},alertKey:{defaultValue:null,description:"",name:"alertKey",required:!0,type:{name:"string"}},ownerId:{defaultValue:null,description:"",name:"ownerId",required:!0,type:{name:"string"}},isShownWithAlertsOnly:{defaultValue:{value:"false"},description:"Determines whether to display the row only when an alert is present.",name:"isShownWithAlertsOnly",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/confirm/info/row/alert-row/alert-row.tsx#ConfirmInfoAlertRow"]={docgenInfo:ConfirmInfoAlertRow.__docgenInfo,name:"ConfirmInfoAlertRow",path:"ui/components/app/confirm/info/row/alert-row/alert-row.tsx#ConfirmInfoAlertRow"})}catch(__react_docgen_typescript_loader_error){}},"./ui/components/app/confirm/info/row/constants.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{GH:()=>AlertActionKey,Oh:()=>TEST_ADDRESS,oE:()=>RowAlertKey});var RowAlertKey,AlertActionKey,TEST_ADDRESS="0x5CfE73b6021E818B776b421B1c4Db2474086a7e1";!function(RowAlertKey){RowAlertKey.EstimatedFee="estimatedFee",RowAlertKey.SigningInWith="signingInWith",RowAlertKey.RequestFrom="requestFrom",RowAlertKey.Resimulation="resimulation",RowAlertKey.Speed="speed",RowAlertKey.To="to"}(RowAlertKey||(RowAlertKey={})),function(AlertActionKey){AlertActionKey.Buy="buy",AlertActionKey.ShowAdvancedGasFeeModal="showAdvancedGasModal",AlertActionKey.ShowGasFeeModal="showGasFeeModal"}(AlertActionKey||(AlertActionKey={}))},"./ui/components/app/confirm/info/row/section.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{C:()=>ConfirmInfoSection});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_component_library__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/components/component-library/index.ts"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/helpers/constants/design-system.ts"),ConfirmInfoSection=function(param){var children=param.children,noPadding=param.noPadding,_param_style=param.style,dataTestId=param["data-testid"];return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_1__.az,{"data-testid":dataTestId,backgroundColor:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.i0.backgroundDefault,borderRadius:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Z6.MD,padding:noPadding?0:2,marginBottom:4,style:void 0===_param_style?{}:_param_style},children)};try{ConfirmInfoSection.displayName="ConfirmInfoSection",ConfirmInfoSection.__docgenInfo={description:"",displayName:"ConfirmInfoSection",props:{noPadding:{defaultValue:null,description:"",name:"noPadding",required:!1,type:{name:"boolean"}},style:{defaultValue:{value:"{}"},description:"",name:"style",required:!1,type:{name:"CSSProperties"}},"data-testid":{defaultValue:null,description:"",name:"data-testid",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/confirm/info/row/section.tsx#ConfirmInfoSection"]={docgenInfo:ConfirmInfoSection.__docgenInfo,name:"ConfirmInfoSection",path:"ui/components/app/confirm/info/row/section.tsx#ConfirmInfoSection"})}catch(__react_docgen_typescript_loader_error){}},"./ui/components/app/name/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>_name__WEBPACK_IMPORTED_MODULE_0__.A});var _name__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/components/app/name/name.tsx")},"./ui/hooks/useAlerts.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>hooks_useAlerts});var es=__webpack_require__("./node_modules/react-redux/es/index.js"),react=__webpack_require__("./node_modules/react/index.js"),reselect=__webpack_require__("./node_modules/reselect/dist/reselect.mjs");function selectAlerts(state,ownerId){var _state_confirmAlerts_alerts_ownerId;return null!==(_state_confirmAlerts_alerts_ownerId=state.confirmAlerts.alerts[ownerId])&&void 0!==_state_confirmAlerts_alerts_ownerId?_state_confirmAlerts_alerts_ownerId:[]}var selectGeneralAlerts=(0,reselect.Mz)(function(state,ownerId){return selectAlerts(state,ownerId)},function(alerts){return alerts.filter(function(alert){return!alert.field})}),selectFieldAlerts=(0,reselect.Mz)(function(state,ownerId){return selectAlerts(state,ownerId)},function(alerts){return alerts.filter(function(alert){return alert.field})});function selectConfirmedAlertKeys(state,ownerId){var ownerConfirmed=state.confirmAlerts.confirmed[ownerId]||{};return Object.keys(ownerConfirmed).filter(function(key){return ownerConfirmed[key]})}var confirm_alerts=__webpack_require__("./ui/ducks/confirm-alerts/confirm-alerts.ts"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function sortAlertsBySeverity(alerts){var _obj,severityOrder=(_define_property(_obj={},design_system.AI.Danger,3),_define_property(_obj,design_system.AI.Warning,2),_define_property(_obj,design_system.AI.Info,1),_obj);return alerts.sort(function(a,b){return severityOrder[b.severity]-severityOrder[a.severity]})}let hooks_useAlerts=function(ownerId){var dispatch=(0,es.wA)(),alerts=sortAlertsBySeverity((0,es.d4)(function(state){return selectAlerts(state,ownerId)})),confirmedAlertKeys=(0,es.d4)(function(state){return selectConfirmedAlertKeys(state,ownerId)}),generalAlerts=sortAlertsBySeverity((0,es.d4)(function(state){return selectGeneralAlerts(state,ownerId)})),fieldAlerts=sortAlertsBySeverity((0,es.d4)(function(state){return selectFieldAlerts(state,ownerId)})),getFieldAlerts=(0,react.useCallback)(function(field){return field?alerts.filter(function(alert){return alert.field===field}):[]},[alerts]),setAlertConfirmed=(0,react.useCallback)(function(alertKey,isConfirmed){dispatch((0,confirm_alerts.G0)(ownerId,alertKey,isConfirmed))},[dispatch,confirm_alerts.G0,ownerId]),isAlertConfirmed=(0,react.useCallback)(function(alertKey){return confirmedAlertKeys.includes(alertKey)},[confirmedAlertKeys]),unconfirmedDangerAlerts=alerts.filter(function(alert){return!isAlertConfirmed(alert.key)&&alert.severity===design_system.AI.Danger}),hasAlerts=alerts.length>0,dangerAlerts=alerts.filter(function(alert){return alert.severity===design_system.AI.Danger}),hasUnconfirmedDangerAlerts=unconfirmedDangerAlerts.length>0,unconfirmedFieldDangerAlerts=fieldAlerts.filter(function(alert){return!isAlertConfirmed(alert.key)&&alert.severity===design_system.AI.Danger});return{alerts:alerts,fieldAlerts:fieldAlerts,generalAlerts:generalAlerts,getFieldAlerts:getFieldAlerts,hasAlerts:hasAlerts,dangerAlerts:dangerAlerts,hasDangerAlerts:(null==dangerAlerts?void 0:dangerAlerts.length)>0,hasUnconfirmedDangerAlerts:hasUnconfirmedDangerAlerts,isAlertConfirmed:isAlertConfirmed,setAlertConfirmed:setAlertConfirmed,unconfirmedDangerAlerts:unconfirmedDangerAlerts,unconfirmedFieldDangerAlerts:unconfirmedFieldDangerAlerts,hasUnconfirmedFieldDangerAlerts:unconfirmedFieldDangerAlerts.length>0}}},"./ui/hooks/useAsyncResult.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>useAsyncResult,_:()=>useAsyncResultOrThrow});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}function useAsyncResult(asyncFn){var dependencies=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],_useState=_sliced_to_array((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({pending:!0}),2),result=_useState[0],setResult=_useState[1];return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function(){setResult({pending:!0});var cancelled=!1;return asyncFn().then(function(value){cancelled||setResult({pending:!1,value:value})}).catch(function(error){cancelled||setResult({pending:!1,error:error})}),function(){cancelled=!0}},dependencies),result}function useAsyncResultOrThrow(asyncFn){var deps=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],result=useAsyncResult(asyncFn,deps);if(result.error)throw result.error;return result}},"./ui/hooks/useFiatFormatter.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{y:()=>useFiatFormatter});var react_redux__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react-redux/es/index.js"),_ducks_locale_locale__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/ducks/locale/locale.ts"),_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/ducks/metamask/metamask.js"),_helpers_utils_util__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/helpers/utils/util.js"),useFiatFormatter=function(){var locale=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_ducks_locale_locale__WEBPACK_IMPORTED_MODULE_1__.gA),fiatCurrency=(0,react_redux__WEBPACK_IMPORTED_MODULE_0__.d4)(_ducks_metamask_metamask__WEBPACK_IMPORTED_MODULE_2__.Fx);return function(fiatAmount){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},shorten=options.shorten;try{var formatter=new Intl.NumberFormat(locale,{style:"currency",currency:fiatCurrency});if(!shorten)return formatter.format(fiatAmount);var parts=formatter.formatToParts(fiatAmount),currencySymbol="",numberString="";parts.forEach(function(part){"currency"===part.type?currencySymbol+=part.value:numberString+=part.value});var shortenedNumberString=(0,_helpers_utils_util__WEBPACK_IMPORTED_MODULE_3__.l1)(numberString,{truncatedCharLimit:15,truncatedStartChars:12,truncatedEndChars:0,skipCharacterInEnd:!0});return parts.findIndex(function(part){return"currency"===part.type})<parts.findIndex(function(part){return"integer"===part.type})?"".concat(currencySymbol).concat(shortenedNumberString):"".concat(shortenedNumberString).concat(currencySymbol)}catch(error){var formattedNumber=new Intl.NumberFormat(locale).format(fiatAmount),shortenedNumberString1=(0,_helpers_utils_util__WEBPACK_IMPORTED_MODULE_3__.l1)(formattedNumber,{truncatedCharLimit:15,truncatedStartChars:12,truncatedEndChars:0,skipCharacterInEnd:!0});if(shorten)return"".concat(shortenedNumberString1," ").concat(fiatCurrency);return"".concat(formattedNumber," ").concat(fiatCurrency)}}}},"./ui/pages/confirmations/components/simulation-details/asset-pill.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{a:()=>AssetPill});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_metamask_name_controller__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@metamask/name-controller/dist/types.mjs"),react_redux__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react-redux/es/index.js"),_components_component_library__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/components/component-library/index.ts"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_components_app_name__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/components/app/name/index.ts"),_shared_constants_transaction__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./shared/constants/transaction.ts"),_shared_modules_selectors_networks__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./shared/modules/selectors/networks.ts"),_shared_constants_network__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./shared/constants/network.ts"),NativeAssetPill=function(param){var chainId=param.chainId,imgSrc=_shared_constants_network__WEBPACK_IMPORTED_MODULE_7__.RB[chainId],networkConfigurationsByChainId=(0,react_redux__WEBPACK_IMPORTED_MODULE_1__.d4)(_shared_modules_selectors_networks__WEBPACK_IMPORTED_MODULE_6__.hX),nativeCurrency=(null==networkConfigurationsByChainId?void 0:networkConfigurationsByChainId[chainId]).nativeCurrency;return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.Flex,flexDirection:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.bo.Row,borderRadius:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Z6.pill,alignItems:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.k2.center,backgroundColor:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.i0.backgroundAlternative,gap:1,style:{padding:"1px 8px 1px 4px"}},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_2__.Gn,{name:nativeCurrency,size:_components_component_library__WEBPACK_IMPORTED_MODULE_2__.LM.Xs,src:imgSrc,borderColor:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.cG.borderDefault}),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_2__.EY,{ellipsis:!0,variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.J3.bodyMd},nativeCurrency))},AssetPill=function(param){var asset=param.asset,chainId=asset.chainId;return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{"data-testid":"simulation-details-asset-pill",style:{flexShrink:1,flexBasis:"auto",minWidth:0}},asset.standard===_shared_constants_transaction__WEBPACK_IMPORTED_MODULE_5__.ph.none?react__WEBPACK_IMPORTED_MODULE_0__.createElement(NativeAssetPill,{chainId:chainId}):react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_name__WEBPACK_IMPORTED_MODULE_4__.A,{preferContractSymbol:!0,type:_metamask_name_controller__WEBPACK_IMPORTED_MODULE_8__.k.ETHEREUM_ADDRESS,value:asset.address,variation:chainId}))};try{AssetPill.displayName="AssetPill",AssetPill.__docgenInfo={description:"Displays a pill with an asset's icon and name.",displayName:"AssetPill",props:{asset:{defaultValue:null,description:"",name:"asset",required:!0,type:{name:"AssetIdentifier"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/simulation-details/asset-pill.tsx#AssetPill"]={docgenInfo:AssetPill.__docgenInfo,name:"AssetPill",path:"ui/pages/confirmations/components/simulation-details/asset-pill.tsx#AssetPill"})}catch(__react_docgen_typescript_loader_error){}},"./ui/pages/confirmations/components/simulation-details/fiat-display.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{LJ:()=>TotalFiatDisplay,Z9:()=>calculateTotalFiat,m8:()=>IndividualFiatDisplay});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_redux__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react-redux/es/index.js"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/hooks/useI18nContext.js"),_components_component_library__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/components/component-library/index.ts"),_components_ui_tooltip__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/components/ui/tooltip/index.js"),_hooks_useFiatFormatter__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/hooks/useFiatFormatter.ts"),_selectors__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/selectors/index.js"),_types__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./ui/pages/confirmations/components/simulation-details/types.ts");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}var textStyle={color:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.r7.textAlternative,variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.J3.bodySm,paddingRight:2,textAlign:"right"},FiatNotAvailableDisplay=function(){var t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_3__.P)();return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_4__.EY,textStyle,t("simulationDetailsFiatNotAvailable"))};function calculateTotalFiat(fiatAmounts){return fiatAmounts.reduce(function(total,fiat){return total+(fiat===_types__WEBPACK_IMPORTED_MODULE_8__.k?0:fiat)},0)}var IndividualFiatDisplay=function(param){var fiatAmount=param.fiatAmount,_param_shorten=param.shorten,shorten=void 0!==_param_shorten&&_param_shorten,shouldShowFiat=(0,react_redux__WEBPACK_IMPORTED_MODULE_1__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_7__.rrv),fiatFormatter=(0,_hooks_useFiatFormatter__WEBPACK_IMPORTED_MODULE_6__.y)();if(!shouldShowFiat||fiatAmount===_types__WEBPACK_IMPORTED_MODULE_8__.k)return null;var fiatDisplayValue=fiatFormatter(Math.abs(fiatAmount),{shorten:shorten});return shorten?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_ui_tooltip__WEBPACK_IMPORTED_MODULE_5__.A,{position:"bottom",title:fiatDisplayValue,interactive:!0},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_4__.EY,_object_spread_props(_object_spread({},textStyle),{"data-testid":"individual-fiat-display"}),fiatDisplayValue)):react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_4__.EY,_object_spread_props(_object_spread({},textStyle),{"data-testid":"individual-fiat-display"}),fiatDisplayValue)},TotalFiatDisplay=function(param){var fiatAmounts=param.fiatAmounts,shouldShowFiat=(0,react_redux__WEBPACK_IMPORTED_MODULE_1__.d4)(_selectors__WEBPACK_IMPORTED_MODULE_7__.rrv),t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_3__.P)(),fiatFormatter=(0,_hooks_useFiatFormatter__WEBPACK_IMPORTED_MODULE_6__.y)(),totalFiat=calculateTotalFiat(fiatAmounts);return shouldShowFiat?0===totalFiat?react__WEBPACK_IMPORTED_MODULE_0__.createElement(FiatNotAvailableDisplay,null):react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_4__.EY,textStyle,t("simulationDetailsTotalFiat",[fiatFormatter(Math.abs(totalFiat))])):null};try{calculateTotalFiat.displayName="calculateTotalFiat",calculateTotalFiat.__docgenInfo={description:"",displayName:"calculateTotalFiat",props:{}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/simulation-details/fiat-display.tsx#calculateTotalFiat"]={docgenInfo:calculateTotalFiat.__docgenInfo,name:"calculateTotalFiat",path:"ui/pages/confirmations/components/simulation-details/fiat-display.tsx#calculateTotalFiat"})}catch(__react_docgen_typescript_loader_error){}try{IndividualFiatDisplay.displayName="IndividualFiatDisplay",IndividualFiatDisplay.__docgenInfo={description:"Displays the fiat value of a single balance change.",displayName:"IndividualFiatDisplay",props:{fiatAmount:{defaultValue:null,description:"",name:"fiatAmount",required:!0,type:{name:"FiatAmount"}},shorten:{defaultValue:{value:"false"},description:"",name:"shorten",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/simulation-details/fiat-display.tsx#IndividualFiatDisplay"]={docgenInfo:IndividualFiatDisplay.__docgenInfo,name:"IndividualFiatDisplay",path:"ui/pages/confirmations/components/simulation-details/fiat-display.tsx#IndividualFiatDisplay"})}catch(__react_docgen_typescript_loader_error){}try{TotalFiatDisplay.displayName="TotalFiatDisplay",TotalFiatDisplay.__docgenInfo={description:"Displays the total fiat value of a list of balance changes.",displayName:"TotalFiatDisplay",props:{fiatAmounts:{defaultValue:null,description:"",name:"fiatAmounts",required:!0,type:{name:"FiatAmount[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/simulation-details/fiat-display.tsx#TotalFiatDisplay"]={docgenInfo:TotalFiatDisplay.__docgenInfo,name:"TotalFiatDisplay",path:"ui/pages/confirmations/components/simulation-details/fiat-display.tsx#TotalFiatDisplay"})}catch(__react_docgen_typescript_loader_error){}},"./ui/pages/confirmations/components/simulation-details/types.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>FIAT_UNAVAILABLE});var FIAT_UNAVAILABLE=null},"./ui/pages/confirmations/components/simulation-details/useLoadingTime.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{H:()=>useLoadingTime});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}function useLoadingTime(){var loadingStart=_sliced_to_array((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(Date.now()),1)[0],_useState1=_sliced_to_array((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),2),loadingTime=_useState1[0],setLoadingTime=_useState1[1];return{loadingTime:loadingTime,setLoadingComplete:function(){void 0===loadingTime&&setLoadingTime((Date.now()-loadingStart)/1e3)}}}},"./ui/pages/confirmations/utils/token.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Mh:()=>ERC20_DEFAULT_DECIMALS,OS:()=>memoizedGetTokenStandardAndDetails,a6:()=>parseTokenDetailDecimals,tT:()=>fetchErc20Decimals});var lodash__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/lodash/lodash.js"),_store_actions__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/__mocks__/actions.js");function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}function _ts_generator(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}}var ERC20_DEFAULT_DECIMALS=18,parseTokenDetailDecimals=function(decStr){if(decStr)for(var _i=0,_iter=[10,16];_i<_iter.length;_i++){var parsedDec=parseInt(decStr,_iter[_i]);if(isFinite(parsedDec))return parsedDec}},memoizedGetTokenStandardAndDetails=(0,lodash__WEBPACK_IMPORTED_MODULE_0__.memoize)(function(){var _ref=_async_to_generator(function(tokenAddress,userAddress,tokenId){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(_state.trys.push([0,2,,3]),!tokenAddress)return[2,{}];return[4,(0,_store_actions__WEBPACK_IMPORTED_MODULE_1__.getTokenStandardAndDetails)(tokenAddress,userAddress,tokenId)];case 1:return[2,_state.sent()];case 2:return _state.sent(),[2,{}];case 3:return[2]}})});return function(tokenAddress,userAddress,tokenId){return _ref.apply(this,arguments)}}()),fetchErc20Decimals=function(){var _ref=_async_to_generator(function(address){var decimals;return _ts_generator(this,function(_state){switch(_state.label){case 0:return _state.trys.push([0,2,,3]),[4,memoizedGetTokenStandardAndDetails(address)];case 1:return[2,null!=(decimals=parseTokenDetailDecimals(_state.sent().decimals))?decimals:ERC20_DEFAULT_DECIMALS];case 2:return _state.sent(),[2,ERC20_DEFAULT_DECIMALS];case 3:return[2]}})});return function fetchErc20Decimals(address){return _ref.apply(this,arguments)}}()}}]);