-
Notifications
You must be signed in to change notification settings - Fork 31
/
51346.9b5237c4.iframe.bundle.js
1 lines (1 loc) · 30.4 KB
/
51346.9b5237c4.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[51346],{"./ui/pages/settings/advanced-tab/advanced-tab.component.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>AdvancedTab});var _obj,prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),react=__webpack_require__("./node_modules/react/index.js"),metametrics=__webpack_require__("./shared/constants/metametrics.ts"),preferences=__webpack_require__("./shared/constants/preferences.ts"),smartTransactions=__webpack_require__("./shared/constants/smartTransactions.ts"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),ui_button=__webpack_require__("./ui/components/ui/button/index.js"),text_field=__webpack_require__("./ui/components/ui/text-field/index.js"),toggle_button=__webpack_require__("./ui/components/ui/toggle-button/index.js"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),Buffer=__webpack_require__("./node_modules/buffer/index.js").Buffer;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 _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 _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 ExportableContentType={JSON:"application/json",TXT:"text/plain"},ExtensionForContentType=(_define_property(_obj={},ExportableContentType.JSON,".json"),_define_property(_obj,ExportableContentType.TXT,".txt"),_obj);function exportAsFile(filename,data,contentType){return _exportAsFile.apply(this,arguments)}function _exportAsFile(){return(_exportAsFile=_async_to_generator(function(filename,data,contentType){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(!ExtensionForContentType[contentType])throw Error("Unsupported file type: ".concat(contentType));if(!supportsShowSaveFilePicker())return[3,2];return[4,saveFileUsingFilePicker(filename,data,contentType)];case 1:return _state.sent(),[3,3];case 2:saveFileUsingDataUri(filename,data,contentType),_state.label=3;case 3:return[2]}})})).apply(this,arguments)}function supportsShowSaveFilePicker(){return"undefined"!=typeof window&&void 0!==window.showSaveFilePicker&&void 0!==window.Blob}function saveFileUsingFilePicker(filename,data,contentType){return _saveFileUsingFilePicker.apply(this,arguments)}function _saveFileUsingFilePicker(){return(_saveFileUsingFilePicker=_async_to_generator(function(filename,data,contentType){var blob,fileExtension,writable;return _ts_generator(this,function(_state){switch(_state.label){case 0:return blob=new window.Blob([data],{contentType:contentType}),fileExtension=ExtensionForContentType[contentType],[4,window.showSaveFilePicker({suggestedName:filename,types:[{description:filename,accept:_define_property({},contentType,[fileExtension])}]})];case 1:return[4,_state.sent().createWritable()];case 2:return[4,(writable=_state.sent()).write(blob)];case 3:return _state.sent(),[4,writable.close()];case 4:return _state.sent(),[2]}})})).apply(this,arguments)}function saveFileUsingDataUri(filename,data,contentType){var b64=Buffer.from(data,"utf8").toString("base64"),elem=document.createElement("a");elem.href="data:".concat(contentType,";Base64,").concat(b64),elem.download=filename,document.body.appendChild(elem),elem.click(),document.body.removeChild(elem)}var settings_search=__webpack_require__("./ui/helpers/utils/settings-search.js"),util=__webpack_require__("./app/scripts/lib/util.ts"),app=__webpack_require__("./shared/constants/app.ts");function _assert_this_initialized(self){if(void 0===self)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function advanced_tab_component_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 advanced_tab_component_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){advanced_tab_component_asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){advanced_tab_component_asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}function _class_call_check(instance,Constructor){if(!(instance instanceof Constructor))throw TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _create_class(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}function advanced_tab_component_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 _get_prototype_of(o){return(_get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of(subClass,superClass)}function _possible_constructor_return(self,call){return call&&("object"===_type_of(call)||"function"==typeof call)?call:_assert_this_initialized(self)}function _set_prototype_of(o,p){return(_set_prototype_of=Object.setPrototypeOf||function setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _type_of(obj){return obj&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj}function _is_native_reflect_construct(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _create_super(Derived){var hasNativeReflectConstruct=_is_native_reflect_construct();return function _createSuperInternal(){var result,Super=_get_prototype_of(Derived);return result=hasNativeReflectConstruct?Reflect.construct(Super,arguments,_get_prototype_of(this).constructor):Super.apply(this,arguments),_possible_constructor_return(this,result)}}function advanced_tab_component_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 AdvancedTab=function(PureComponent){_inherits(AdvancedTab,PureComponent);var _super=_create_super(AdvancedTab);function AdvancedTab(){_class_call_check(this,AdvancedTab),_this=_super.apply(this,arguments),advanced_tab_component_define_property(_assert_this_initialized(_this),"state",{autoLockTimeLimit:_this.props.autoLockTimeLimit,autoLockTimeLimitBeforeNormalization:_this.props.autoLockTimeLimit,lockTimeError:""}),advanced_tab_component_define_property(_assert_this_initialized(_this),"settingsRefs",Array((0,settings_search.FF)(_this.context.t,_this.context.t("advanced"))).fill(void 0).map(function(){return react.createRef()}));var _this,_this1=_assert_this_initialized(_this);return advanced_tab_component_define_property(_assert_this_initialized(_this),"backupUserData",advanced_tab_component_async_to_generator(function(){var _ref;return advanced_tab_component_ts_generator(this,function(_state){switch(_state.label){case 0:return[4,_this1.props.backupUserData()];case 1:return exportAsFile((_ref=_state.sent()).fileName,_ref.data,ExportableContentType.JSON),_this1.context.trackEvent({event:"User Data Exported",category:"Backup",properties:{}}),[2]}})})),_this}return _create_class(AdvancedTab,[{key:"componentDidUpdate",value:function componentDidUpdate(){var t=this.context.t;(0,settings_search.K8)(t,t("advanced"),this.settingsRefs)}},{key:"componentDidMount",value:function componentDidMount(){var t=this.context.t,hideErrorInSettings=this.props.hideErrorInSettings;(0,settings_search.K8)(t,t("advanced"),this.settingsRefs),hideErrorInSettings()}},{key:"getTextFromFile",value:function getTextFromFile(file){return advanced_tab_component_async_to_generator(function(){return advanced_tab_component_ts_generator(this,function(_state){return[2,new Promise(function(resolve,reject){var reader=new window.FileReader;reader.onload=function(e){resolve(e.target.result)},reader.onerror=function(e){reject(e)},reader.readAsText(file)})]})})()}},{key:"renderStateLogs",value:function renderStateLogs(){var t=this.context.t,displayErrorInSettings=this.props.displayErrorInSettings;return react.createElement(component_library.az,{className:"settings-page__content-row",display:design_system.nl.Flex,flexDirection:design_system.bo.Column,ref:this.settingsRefs[0],"data-testid":"advanced-setting-state-logs"},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("stateLogs")),react.createElement("span",{className:"settings-page__content-description"},t("stateLogsDescription"))),react.createElement("div",{className:"settings-page__content-item"},react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(ui_button.A,{type:"secondary",large:!0,"data-testid":"advanced-setting-state-logs-button",onClick:function(){var _ref;window.logStateString((_ref=advanced_tab_component_async_to_generator(function(err,result){return advanced_tab_component_ts_generator(this,function(_state){switch(_state.label){case 0:if(!err)return[3,1];return displayErrorInSettings(t("stateLogError")),[3,4];case 1:return _state.trys.push([1,3,,4]),[4,exportAsFile("".concat(t("stateLogFileName"),".json"),result,ExportableContentType.JSON)];case 2:return _state.sent(),[3,4];case 3:return displayErrorInSettings(_state.sent().message),[3,4];case 4:return[2]}})}),function(err,result){return _ref.apply(this,arguments)}))}},t("downloadStateLogs")))))}},{key:"renderResetAccount",value:function renderResetAccount(){var _this=this,t=this.context.t,showResetAccountConfirmationModal=this.props.showResetAccountConfirmationModal;return react.createElement(component_library.az,{ref:this.settingsRefs[1],className:"settings-page__content-row",display:design_system.nl.Flex,flexDirection:design_system.bo.Column,"data-testid":"advanced-setting-reset-account"},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("clearActivity")),react.createElement("span",{className:"settings-page__content-description"},t("clearActivityDescription"))),react.createElement("div",{className:"settings-page__content-item"},react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(ui_button.A,{type:"danger",large:!0,className:"settings-tab__button--red",onClick:function(event){event.preventDefault(),_this.context.trackEvent({category:metametrics.FZ.Settings,event:metametrics.gP.AccountReset,properties:{}}),showResetAccountConfirmationModal()}},t("clearActivityButton")))))}},{key:"renderToggleStxOptIn",value:function renderToggleStxOptIn(){var t=this.context.t,_this_props=this.props,smartTransactionsEnabled=_this_props.smartTransactionsEnabled,setSmartTransactionsEnabled=_this_props.setSmartTransactionsEnabled,learMoreLink=react.createElement(component_library.vx,{size:component_library.wL.Inherit,textProps:{variant:design_system.J3.bodyMd,alignItems:design_system.k2.flexStart},as:"a",href:smartTransactions.ru,target:"_blank",rel:"noopener noreferrer"},t("learnMoreUpperCase"));return react.createElement(component_library.az,{ref:this.settingsRefs[2],className:"settings-page__content-row","data-testid":"advanced-setting-enable-smart-transactions",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,justifyContent:design_system.A9.spaceBetween,gap:4},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("smartTransactions")),react.createElement("div",{className:"settings-page__content-description"},t("stxOptInDescription",[learMoreLink]))),react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(toggle_button.A,{value:smartTransactionsEnabled,onToggle:function(oldValue){setSmartTransactionsEnabled(!oldValue)},offLabel:t("off"),onLabel:t("on"),dataTestId:"settings-page-stx-opt-in-toggle"})))}},{key:"renderHexDataOptIn",value:function renderHexDataOptIn(){var t=this.context.t,_this_props=this.props,sendHexData=_this_props.sendHexData,setHexDataFeatureFlag=_this_props.setHexDataFeatureFlag;return react.createElement(component_library.az,{ref:this.settingsRefs[3],className:"settings-page__content-row",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,justifyContent:design_system.A9.spaceBetween,gap:4,"data-testid":"advanced-setting-hex-data"},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("showHexData")),react.createElement("div",{className:"settings-page__content-description"},t("showHexDataDescription"))),react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(toggle_button.A,{value:sendHexData,onToggle:function(value){return setHexDataFeatureFlag(!value)},offLabel:t("off"),onLabel:t("on"),className:"hex-data-toggle"})))}},{key:"renderShowConversionInTestnets",value:function renderShowConversionInTestnets(){var t=this.context.t,_this_props=this.props,showFiatInTestnets=_this_props.showFiatInTestnets,setShowFiatConversionOnTestnetsPreference=_this_props.setShowFiatConversionOnTestnetsPreference;return react.createElement(component_library.az,{ref:this.settingsRefs[4],className:"settings-page__content-row",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,justifyContent:design_system.A9.spaceBetween,gap:4,"data-testid":"advanced-setting-show-testnet-conversion"},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("showFiatConversionInTestnets")),react.createElement("div",{className:"settings-page__content-description"},t("showFiatConversionInTestnetsDescription"))),react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(toggle_button.A,{value:showFiatInTestnets,onToggle:function(value){return setShowFiatConversionOnTestnetsPreference(!value)},offLabel:t("off"),onLabel:t("on"),className:"show-fiat-on-testnets-toggle"})))}},{key:"renderToggleTestNetworks",value:function renderToggleTestNetworks(){var t=this.context.t,_this_props=this.props,showTestNetworks=_this_props.showTestNetworks,setShowTestNetworks=_this_props.setShowTestNetworks;return react.createElement(component_library.az,{ref:this.settingsRefs[5],className:"settings-page__content-row","data-testid":"advanced-setting-show-testnet-conversion",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,justifyContent:design_system.A9.spaceBetween,gap:4},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("showTestnetNetworks")),react.createElement("div",{className:"settings-page__content-description"},t("showTestnetNetworksDescription"))),react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(toggle_button.A,{value:showTestNetworks,onToggle:function(value){return setShowTestNetworks(!value)},offLabel:t("off"),onLabel:t("on")})))}},{key:"renderToggleExtensionInFullSizeView",value:function renderToggleExtensionInFullSizeView(){var t=this.context.t,_this_props=this.props,showExtensionInFullSizeView=_this_props.showExtensionInFullSizeView,setShowExtensionInFullSizeView=_this_props.setShowExtensionInFullSizeView;return react.createElement(component_library.az,{ref:this.settingsRefs[8],className:"settings-page__content-row","data-testid":"advanced-setting-show-extension-in-full-size-view",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,justifyContent:design_system.A9.spaceBetween,gap:4},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("showExtensionInFullSizeView")),react.createElement("div",{className:"settings-page__content-description"},t("showExtensionInFullSizeViewDescription"))),react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(toggle_button.A,{value:showExtensionInFullSizeView,onToggle:function(value){return setShowExtensionInFullSizeView(!value)},offLabel:t("off"),onLabel:t("on")})))}},{key:"renderUseNonceOptIn",value:function renderUseNonceOptIn(){var t=this.context.t,_this_props=this.props,useNonceField=_this_props.useNonceField,setUseNonceField=_this_props.setUseNonceField;return react.createElement(component_library.az,{ref:this.settingsRefs[6],className:"settings-page__content-row","data-testid":"advanced-setting-custom-nonce",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,justifyContent:design_system.A9.spaceBetween,gap:4},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("nonceField")),react.createElement("div",{className:"settings-page__content-description"},t("nonceFieldDesc"))),react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(toggle_button.A,{className:"custom-nonce-toggle",value:useNonceField,onToggle:function(value){return setUseNonceField(!value)},offLabel:t("off"),onLabel:t("on")})))}},{key:"renderAutoLockTimeLimit",value:function renderAutoLockTimeLimit(){var _this=this,t=this.context.t,lockTimeError=this.state.lockTimeError,setAutoLockTimeLimit=this.props.setAutoLockTimeLimit;return react.createElement(component_library.az,{ref:this.settingsRefs[7],className:"settings-page__content-row","data-testid":"advanced-setting-auto-lock",display:design_system.nl.Flex,flexDirection:design_system.bo.Column},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("autoLockTimeLimit")),react.createElement("div",{className:"settings-page__content-description"},t("autoLockTimeLimitDescription"))),react.createElement("div",{className:"settings-page__content-item"},react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(text_field.A,{id:"autoTimeout","data-testid":"auto-lockout-time",placeholder:"0",value:this.state.autoLockTimeLimitBeforeNormalization,onChange:function(e){return _this.handleLockChange(e.target.value)},error:lockTimeError,fullWidth:!0,margin:"dense",min:0}),react.createElement(ui_button.A,{type:"primary","data-testid":"auto-lockout-button",className:"settings-tab__rpc-save-button",disabled:""!==lockTimeError,onClick:function(){setAutoLockTimeLimit(_this.state.autoLockTimeLimit)}},t("save")))))}},{key:"renderDismissSeedBackupReminderControl",value:function renderDismissSeedBackupReminderControl(){var t=this.context.t,_this_props=this.props,dismissSeedBackUpReminder=_this_props.dismissSeedBackUpReminder,setDismissSeedBackUpReminder=_this_props.setDismissSeedBackUpReminder;return react.createElement(component_library.az,{ref:this.settingsRefs[9],className:"settings-page__content-row","data-testid":"advanced-setting-dismiss-reminder",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,justifyContent:design_system.A9.spaceBetween,gap:4},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("dismissReminderField")),react.createElement("div",{className:"settings-page__content-description"},t("dismissReminderDescriptionField"))),react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(toggle_button.A,{value:dismissSeedBackUpReminder,onToggle:function(value){return setDismissSeedBackUpReminder(!value)},offLabel:t("off"),onLabel:t("on")})))}},{key:"handleLockChange",value:function handleLockChange(autoLockTimeLimitBeforeNormalization){var t=this.context.t;if(""===autoLockTimeLimitBeforeNormalization){this.setState({autoLockTimeLimitBeforeNormalization:autoLockTimeLimitBeforeNormalization,autoLockTimeLimit:preferences.i,lockTimeError:""});return}var autoLockTimeLimitAfterNormalization=Number(autoLockTimeLimitBeforeNormalization);if(Number.isNaN(autoLockTimeLimitAfterNormalization)||autoLockTimeLimitAfterNormalization<0||autoLockTimeLimitAfterNormalization>10080){this.setState({autoLockTimeLimitBeforeNormalization:autoLockTimeLimitBeforeNormalization,autoLockTimeLimit:null,lockTimeError:t("lockTimeInvalid")});return}this.setState({autoLockTimeLimitBeforeNormalization:autoLockTimeLimitBeforeNormalization,autoLockTimeLimit:autoLockTimeLimitAfterNormalization,lockTimeError:""})}},{key:"renderUserDataBackup",value:function renderUserDataBackup(){var t=this.context.t;return react.createElement(component_library.az,{ref:this.settingsRefs[10],className:"settings-page__content-row","data-testid":"advanced-setting-data-backup",display:design_system.nl.Flex,flexDirection:design_system.bo.Column},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("exportYourData")),react.createElement("span",{className:"settings-page__content-description"},t("exportYourDataDescription"))),react.createElement("div",{className:"settings-page__content-item"},react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(ui_button.A,{"data-testid":"export-data-button",type:"secondary",large:!0,onClick:this.backupUserData},t("exportYourDataButton")))))}},{key:"renderOverrideContentSecurityPolicyHeader",value:function renderOverrideContentSecurityPolicyHeader(){var t=this.context.t,_this_props=this.props,overrideContentSecurityPolicyHeader=_this_props.overrideContentSecurityPolicyHeader,setOverrideContentSecurityPolicyHeader=_this_props.setOverrideContentSecurityPolicyHeader;return react.createElement(component_library.az,{ref:this.settingsRefs[11],className:"settings-page__content-row","data-testid":"advanced-setting-override-content-security-policy-header",display:design_system.nl.Flex,flexDirection:design_system.bo.Row,justifyContent:design_system.A9.spaceBetween,gap:4},react.createElement("div",{className:"settings-page__content-item"},react.createElement("span",null,t("overrideContentSecurityPolicyHeader")),react.createElement("div",{className:"settings-page__content-description"},t("overrideContentSecurityPolicyHeaderDescription"))),react.createElement("div",{className:"settings-page__content-item-col"},react.createElement(toggle_button.A,{value:overrideContentSecurityPolicyHeader,onToggle:function(value){return setOverrideContentSecurityPolicyHeader(!value)},offLabel:t("off"),onLabel:t("on")})))}},{key:"render",value:function render(){var errorInSettings=this.props.errorInSettings;return react.createElement("div",{className:"settings-page__body"},errorInSettings?react.createElement("div",{className:"settings-tab__error"},errorInSettings):null,this.renderStateLogs(),this.renderResetAccount(),this.renderToggleStxOptIn(),this.renderHexDataOptIn(),this.renderShowConversionInTestnets(),this.renderToggleTestNetworks(),this.renderToggleExtensionInFullSizeView(),this.renderUseNonceOptIn(),this.renderAutoLockTimeLimit(),this.renderUserDataBackup(),this.renderDismissSeedBackupReminderControl(),(0,util.uo)()===app.Yb?this.renderOverrideContentSecurityPolicyHeader():null)}}]),AdvancedTab}(react.PureComponent);advanced_tab_component_define_property(AdvancedTab,"contextTypes",{t:prop_types_default().func,trackEvent:prop_types_default().func}),advanced_tab_component_define_property(AdvancedTab,"propTypes",{setUseNonceField:prop_types_default().func,useNonceField:prop_types_default().bool,setHexDataFeatureFlag:prop_types_default().func,displayErrorInSettings:prop_types_default().func,hideErrorInSettings:prop_types_default().func,showResetAccountConfirmationModal:prop_types_default().func,errorInSettings:prop_types_default().string,sendHexData:prop_types_default().bool,showFiatInTestnets:prop_types_default().bool,showTestNetworks:prop_types_default().bool,smartTransactionsEnabled:prop_types_default().bool,autoLockTimeLimit:prop_types_default().number,setAutoLockTimeLimit:prop_types_default().func.isRequired,setShowFiatConversionOnTestnetsPreference:prop_types_default().func.isRequired,setShowTestNetworks:prop_types_default().func.isRequired,setSmartTransactionsEnabled:prop_types_default().func.isRequired,setDismissSeedBackUpReminder:prop_types_default().func.isRequired,dismissSeedBackUpReminder:prop_types_default().bool.isRequired,backupUserData:prop_types_default().func.isRequired,showExtensionInFullSizeView:prop_types_default().bool,setShowExtensionInFullSizeView:prop_types_default().func.isRequired,overrideContentSecurityPolicyHeader:prop_types_default().bool,setOverrideContentSecurityPolicyHeader:prop_types_default().func.isRequired}),AdvancedTab.__docgenInfo={description:"",methods:[{name:"getTextFromFile",docblock:null,modifiers:["async"],params:[{name:"file",optional:!1,type:null}],returns:null},{name:"backupUserData",docblock:null,modifiers:["async"],params:[],returns:null},{name:"renderStateLogs",docblock:null,modifiers:[],params:[],returns:null},{name:"renderResetAccount",docblock:null,modifiers:[],params:[],returns:null},{name:"renderToggleStxOptIn",docblock:null,modifiers:[],params:[],returns:null},{name:"renderHexDataOptIn",docblock:null,modifiers:[],params:[],returns:null},{name:"renderShowConversionInTestnets",docblock:null,modifiers:[],params:[],returns:null},{name:"renderToggleTestNetworks",docblock:null,modifiers:[],params:[],returns:null},{name:"renderToggleExtensionInFullSizeView",docblock:null,modifiers:[],params:[],returns:null},{name:"renderUseNonceOptIn",docblock:null,modifiers:[],params:[],returns:null},{name:"renderAutoLockTimeLimit",docblock:null,modifiers:[],params:[],returns:null},{name:"renderDismissSeedBackupReminderControl",docblock:null,modifiers:[],params:[],returns:null},{name:"handleLockChange",docblock:null,modifiers:[],params:[{name:"autoLockTimeLimitBeforeNormalization",optional:!1,type:null}],returns:null},{name:"renderUserDataBackup",docblock:null,modifiers:[],params:[],returns:null},{name:"renderOverrideContentSecurityPolicyHeader",docblock:null,modifiers:[],params:[],returns:null}],displayName:"AdvancedTab",props:{setUseNonceField:{description:"",type:{name:"func"},required:!1},useNonceField:{description:"",type:{name:"bool"},required:!1},setHexDataFeatureFlag:{description:"",type:{name:"func"},required:!1},displayErrorInSettings:{description:"",type:{name:"func"},required:!1},hideErrorInSettings:{description:"",type:{name:"func"},required:!1},showResetAccountConfirmationModal:{description:"",type:{name:"func"},required:!1},errorInSettings:{description:"",type:{name:"string"},required:!1},sendHexData:{description:"",type:{name:"bool"},required:!1},showFiatInTestnets:{description:"",type:{name:"bool"},required:!1},showTestNetworks:{description:"",type:{name:"bool"},required:!1},smartTransactionsEnabled:{description:"",type:{name:"bool"},required:!1},autoLockTimeLimit:{description:"",type:{name:"number"},required:!1},setAutoLockTimeLimit:{description:"",type:{name:"func"},required:!0},setShowFiatConversionOnTestnetsPreference:{description:"",type:{name:"func"},required:!0},setShowTestNetworks:{description:"",type:{name:"func"},required:!0},setSmartTransactionsEnabled:{description:"",type:{name:"func"},required:!0},setDismissSeedBackUpReminder:{description:"",type:{name:"func"},required:!0},dismissSeedBackUpReminder:{description:"",type:{name:"bool"},required:!0},backupUserData:{description:"",type:{name:"func"},required:!0},showExtensionInFullSizeView:{description:"",type:{name:"bool"},required:!1},setShowExtensionInFullSizeView:{description:"",type:{name:"func"},required:!0},overrideContentSecurityPolicyHeader:{description:"",type:{name:"bool"},required:!1},setOverrideContentSecurityPolicyHeader:{description:"",type:{name:"func"},required:!0}},context:{t:{type:{name:"func"},required:!1},trackEvent:{type:{name:"func"},required:!1}}}}}]);