-
Notifications
You must be signed in to change notification settings - Fork 31
/
18079.3b709e3f.iframe.bundle.js
1 lines (1 loc) · 18.4 KB
/
18079.3b709e3f.iframe.bundle.js
1
(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[18079],{"./ui/components/ui/loading-indicator/loading-indicator.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>LoadingIndicator});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__),_component_library__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/components/component-library/index.ts");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function _object_without_properties(source,excluded){if(null==source)return{};var key,i,target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _object_without_properties_loose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}function LoadingIndicator(_param){var alt=_param.alt,title=_param.title,isLoading=_param.isLoading,_param_children=_param.children,props=_object_without_properties(_param,["alt","title","isLoading","children"]);return isLoading?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_1__.az,_object_spread({className:"loading-indicator"},props),react__WEBPACK_IMPORTED_MODULE_0__.createElement("img",{className:"loading-indicator__spinner",alt:alt,title:title,src:"images/loading.svg"})):void 0===_param_children?null:_param_children}LoadingIndicator.propTypes={isLoading:prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool.isRequired,alt:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string.isRequired,title:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string.isRequired,children:prop_types__WEBPACK_IMPORTED_MODULE_2___default().node},LoadingIndicator.__docgenInfo={description:"",methods:[],displayName:"LoadingIndicator",props:{children:{defaultValue:{value:"null",computed:!1},description:"",type:{name:"node"},required:!1},isLoading:{description:"",type:{name:"bool"},required:!0},alt:{description:"",type:{name:"string"},required:!0},title:{description:"",type:{name:"string"},required:!0}}}},"./ui/pages/confirmations/components/security-provider-banner-alert/blockaid-banner-alert/blockaid-banner-alert.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{i8:()=>REASON_TO_DESCRIPTION_TKEY,cJ:()=>REASON_TO_TITLE_TKEY,Ay:()=>blockaid_banner_alert});var _obj,_obj1,react=__webpack_require__("./node_modules/react/index.js"),prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),esm_exports=__webpack_require__("./node_modules/@sentry/core/build/esm/exports.js"),ppom_release_package=__webpack_require__("./node_modules/@blockaid/ppom_release/package.json"),network=__webpack_require__("./shared/constants/network.ts"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),i18n=__webpack_require__("./ui/contexts/i18n.js"),security_provider=__webpack_require__("./shared/constants/security-provider.ts"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),useTransactionEventFragment=__webpack_require__("./ui/pages/confirmations/hooks/useTransactionEventFragment.js"),security_provider_banner_alert=__webpack_require__("./ui/pages/confirmations/components/security-provider-banner-alert/security-provider-banner-alert.js"),loading_indicator=__webpack_require__("./ui/components/ui/loading-indicator/loading-indicator.js");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function _object_without_properties(source,excluded){if(null==source)return{};var key,i,target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _object_without_properties_loose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}var zlib=__webpack_require__("?e569"),REASON_TO_DESCRIPTION_TKEY=Object.freeze((_define_property(_obj={},security_provider.W4.approvalFarming,"blockaidDescriptionApproveFarming"),_define_property(_obj,security_provider.W4.permitFarming,"blockaidDescriptionApproveFarming"),_define_property(_obj,security_provider.W4.setApprovalForAll,"blockaidDescriptionApproveFarming"),_define_property(_obj,security_provider.W4.blurFarming,"blockaidDescriptionBlurFarming"),_define_property(_obj,security_provider.W4.errored,"blockaidDescriptionErrored"),_define_property(_obj,security_provider.W4.seaportFarming,"blockaidDescriptionSeaportFarming"),_define_property(_obj,security_provider.W4.maliciousDomain,"blockaidDescriptionMaliciousDomain"),_define_property(_obj,security_provider.W4.rawSignatureFarming,"blockaidDescriptionMightLoseAssets"),_define_property(_obj,security_provider.W4.tradeOrderFarming,"blockaidDescriptionMightLoseAssets"),_define_property(_obj,security_provider.W4.rawNativeTokenTransfer,"blockaidDescriptionTransferFarming"),_define_property(_obj,security_provider.W4.transferFarming,"blockaidDescriptionTransferFarming"),_define_property(_obj,security_provider.W4.transferFromFarming,"blockaidDescriptionTransferFarming"),_define_property(_obj,security_provider.W4.other,"blockaidDescriptionMightLoseAssets"),_obj)),REASON_TO_TITLE_TKEY=Object.freeze((_define_property(_obj1={},security_provider.W4.errored,"blockaidTitleMayNotBeSafe"),_define_property(_obj1,security_provider.W4.rawSignatureFarming,"blockaidTitleSuspicious"),_obj1));function BlockaidBannerAlert(_param){var _zlib_gzipSync,_ref,_zlib_gzipSync1,jsonData,encodedData,title,description,txData=_param.txData,props=_object_without_properties(_param,["txData"]),securityAlertResponse=txData.securityAlertResponse,origin=txData.origin,msgParams=txData.msgParams,type=txData.type,txParams=txData.txParams,chainId=txData.chainId,t=(0,react.useContext)(i18n.gJ),updateTransactionEventFragment=(0,useTransactionEventFragment.W)().updateTransactionEventFragment;if(!securityAlertResponse||0===Object.keys(securityAlertResponse).length)return null;if(securityAlertResponse.result_type===security_provider.p0.Loading)return react.createElement(loading_indicator.A,{isLoading:!0,style:{position:"relative",flex:"0 0 auto",margin:"8px auto 0"}});var block=securityAlertResponse.block,features=securityAlertResponse.features,reason=securityAlertResponse.reason,resultType=securityAlertResponse.result_type;if(resultType===security_provider.p0.Benign)return null;resultType===security_provider.p0.Warning?(title=t(REASON_TO_TITLE_TKEY[security_provider.W4.errored]),description=t("blockaidDescriptionWarning")):(REASON_TO_DESCRIPTION_TKEY[reason]||(0,esm_exports.Cp)("BlockaidBannerAlert: Unidentified reason '".concat(reason,"'")),title=t(REASON_TO_TITLE_TKEY[reason]||"blockaidTitleDeceptive"),description=t(REASON_TO_DESCRIPTION_TKEY[reason]||REASON_TO_DESCRIPTION_TKEY.other));var details=(null==features?void 0:features.length)?react.createElement(component_library.EY,{as:"ul",overflowWrap:design_system.Np.BreakWord},features.map(function(feature,i){return react.createElement("li",{key:"blockaid-detail-".concat(i)},"• ",feature)})):null,isFailedResultType=resultType===security_provider.p0.Errored,severity=resultType===security_provider.p0.Malicious?component_library.OU.Danger:component_library.OU.Warning,reportUrl=(jsonData=JSON.stringify({blockNumber:block,blockaidVersion:ppom_release_package.rE,chain:network.qJ[chainId],classification:isFailedResultType?"error":reason,domain:null!==(_ref=null!=origin?origin:null==msgParams?void 0:msgParams.origin)&&void 0!==_ref?_ref:null==txParams?void 0:txParams.origin,jsonRpcMethod:type,jsonRpcParams:JSON.stringify(null!=txParams?txParams:msgParams),resultType:isFailedResultType?security_provider.p0.Errored:resultType,reproduce:JSON.stringify(features)}),encodedData=null!==(_zlib_gzipSync1=null==zlib?void 0:null===(_zlib_gzipSync=zlib.gzipSync)||void 0===_zlib_gzipSync?void 0:_zlib_gzipSync.call(zlib,jsonData))&&void 0!==_zlib_gzipSync1?_zlib_gzipSync1:jsonData,"".concat(security_provider.NE,"?data=").concat(encodeURIComponent(encodedData.toString("base64")),"&utm_source=").concat(security_provider.K$));return react.createElement(security_provider_banner_alert.A,_object_spread({description:description,details:details,provider:security_provider.O5.Blockaid,reportUrl:reportUrl,severity:severity,title:title,onClickSupportLink:function(){updateTransactionEventFragment({properties:{external_link_clicked:"security_alert_support_link"}},txData.id)}},props))}BlockaidBannerAlert.propTypes={txData:prop_types_default().object};let blockaid_banner_alert=BlockaidBannerAlert;BlockaidBannerAlert.__docgenInfo={description:"",methods:[],displayName:"BlockaidBannerAlert",props:{txData:{description:"",type:{name:"object"},required:!1}}}},"./ui/pages/confirmations/components/security-provider-banner-alert/security-provider-banner-alert.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__),_components_component_library__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/components/component-library/index.ts"),_components_ui_disclosure__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/components/ui/disclosure/index.js"),_components_ui_disclosure_disclosure_constants__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/components/ui/disclosure/disclosure.constants.ts"),_contexts_i18n__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/contexts/i18n.js"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_shared_constants_security_provider__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./shared/constants/security-provider.ts"),_helpers_constants_zendesk_url__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/helpers/constants/zendesk-url.js");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function _object_without_properties(source,excluded){if(null==source)return{};var key,i,target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _object_without_properties_loose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}function SecurityProviderBannerAlert(_param){var description=_param.description,details=_param.details,onClickSupportLink=_param.onClickSupportLink,provider=_param.provider,severity=_param.severity,title=_param.title,reportUrl=_param.reportUrl,props=_object_without_properties(_param,["description","details","onClickSupportLink","provider","severity","title","reportUrl"]),t=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_contexts_i18n__WEBPACK_IMPORTED_MODULE_4__.gJ);return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_1__.b8,_object_spread({"data-testid":"security-provider-banner-alert",title:title,severity:severity},props),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_1__.EY,{marginTop:2},description),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_1__.az,{marginTop:3},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_ui_disclosure__WEBPACK_IMPORTED_MODULE_2__.A,{title:t("seeDetails"),variant:_components_ui_disclosure_disclosure_constants__WEBPACK_IMPORTED_MODULE_3__.h.Arrow},details,react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_1__.EY,{marginTop:3,display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.nl.Flex},t("somethingDoesntLookRight",[react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_1__.vx,{key:"security-provider-button-supporturl-".concat(provider),size:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.or.inherit,href:reportUrl||_helpers_constants_zendesk_url__WEBPACK_IMPORTED_MODULE_7__.A.SUPPORT_URL,externalLink:!0,onClick:onClickSupportLink},t("reportIssue"))])))),provider&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_1__.EY,{marginTop:3,display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.nl.Flex,alignItems:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.k2.center,color:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.Q1.textAlternative,variant:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.J3.bodySm},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_1__.In,{className:"disclosure__summary--icon",color:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.Li.primaryDefault,name:_components_component_library__WEBPACK_IMPORTED_MODULE_1__.$M.SecurityTick,size:_components_component_library__WEBPACK_IMPORTED_MODULE_1__.lK.Sm,marginInlineEnd:1}),t("securityProviderPoweredBy",[react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_1__.vx,{key:"security-provider-button-link-".concat(provider),size:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.or.inherit,href:_shared_constants_security_provider__WEBPACK_IMPORTED_MODULE_6__.ob[provider].url,externalLink:!0},t(_shared_constants_security_provider__WEBPACK_IMPORTED_MODULE_6__.ob[provider].tKeyName))])))}SecurityProviderBannerAlert.propTypes={description:prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_8___default().string,prop_types__WEBPACK_IMPORTED_MODULE_8___default().element]).isRequired,severity:prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOf([_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.AI.Danger,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.AI.Warning]).isRequired,title:prop_types__WEBPACK_IMPORTED_MODULE_8___default().string.isRequired,details:prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_8___default().string,prop_types__WEBPACK_IMPORTED_MODULE_8___default().element]),provider:prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOf(Object.values(_shared_constants_security_provider__WEBPACK_IMPORTED_MODULE_6__.O5)),onClickSupportLink:prop_types__WEBPACK_IMPORTED_MODULE_8___default().func,reportUrl:prop_types__WEBPACK_IMPORTED_MODULE_8___default().string};let __WEBPACK_DEFAULT_EXPORT__=SecurityProviderBannerAlert;SecurityProviderBannerAlert.__docgenInfo={description:"",methods:[],displayName:"SecurityProviderBannerAlert",props:{description:{description:"Description content that may be plain text or contain hyperlinks",type:{name:"union",value:[{name:"string"},{name:"element"}]},required:!0},severity:{description:"Severity level",type:{name:"enum",value:[{value:"Severity.Danger",computed:!0},{value:"Severity.Warning",computed:!0}]},required:!0},title:{description:"Title to be passed as <BannerAlert> param",type:{name:"string"},required:!0},details:{description:"Additional details to be displayed under the description",type:{name:"union",value:[{name:"string"},{name:"element"}]},required:!1},provider:{description:"Name of the security provider",type:{name:"enum",computed:!0,value:"Object.values(SecurityProvider)"},required:!1},onClickSupportLink:{description:"Function to be called when the support link is clicked",type:{name:"func"},required:!1},reportUrl:{description:"URL to open when report an issue link is clicked",type:{name:"string"},required:!1}}}},"?e569":()=>{}}]);