\n//
\n_react[\"default\"].createElement(_react[\"default\"].Fragment,null,/*#__PURE__*/_react[\"default\"].createElement(Style.StepActionTitle,{style:customTitleStyle.style},(0,_langManager.__)(\"reset_confirm_title\",\"Confirm reset\")),/*#__PURE__*/_react[\"default\"].createElement(Style.StepActionDescription,{style:customStepActionDescription.style},(0,_langManager.__)(\"reset_confirm_desc\",\"By resetting pCloud Pass, you will permanently delete the passwords and other items you've saved. How do you want to proceed?\")),/*#__PURE__*/_react[\"default\"].createElement(ButtonsWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(_ButtonDefault[\"default\"],{size:\"big\",color:\"lightgray4\",borderRadius:\"8\",textSize:\"bigger\",onClick:function onClick(){dispatch((0,_userSlice.setResetData)(\"\"));// navigate(navigateOnCancel);\nonStepChange(navigateOnCancel);}},(0,_langManager.__)(\"Cancel\")),/*#__PURE__*/_react[\"default\"].createElement(_ButtonDefault[\"default\"],{size:\"big\",loading:loading?1:0,disabled:loading,color:\"red\",borderRadius:\"8\",textSize:\"bigger\"// onClick={debounce(onResetClick, 500)}\n,onClick:onResetClick},(0,_langManager.__)(\"Reset\")))));};var _default=ResetConfirmationStepAction;exports[\"default\"]=_default;var ButtonsWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"ResetConfirmationStepAction__ButtonsWrapper\",componentId:\"sc-90s5ic-0\"})([\"display:flex;margin-top:36px;& > a{margin:0px 5px;&:first-of-type{margin-left:0px;}&:last-of-type{margin-right:0px;}}@media screen and (max-width:768px){flex-direction:column-reverse;& > a{margin:5px 0px;&:first-of-type{margin-bottom:0px;}&:last-of-type{margin-top:0px;}}}\"]);","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");var _typeof=require(\"@babel/runtime/helpers/typeof\");Object.defineProperty(exports,\"__esModule\",{value:true});exports[\"default\"]=void 0;var _slicedToArray2=_interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));var _react=_interopRequireWildcard(require(\"react\"));var _styledComponents=_interopRequireDefault(require(\"styled-components\"));var _reactRedux=require(\"react-redux\");var _ButtonDefault=_interopRequireDefault(require(\"../../../../resources/components/ButtonDefault\"));var Style=_interopRequireWildcard(require(\"../common.style\"));var _navigation=require(\"../navigation\");var _EnterEventListener=_interopRequireDefault(require(\"../../EnterEventListener\"));var _langManager=require(\"../../../../lib/langManager\");var _toast=require(\"../../../../lib/toast\");var _userSlice=require(\"../../../../lib/state/reducers/pass/userSlice\");var _resetMethods=require(\"./resetMethods\");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!==\"function\")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||_typeof(obj)!==\"object\"&&typeof obj!==\"function\"){return{\"default\":obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!==\"default\"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj[\"default\"]=obj;if(cache){cache.set(obj,newObj);}return newObj;}// import { useNavigate } from \"react-router-dom\";\n// import Button from \"../../Button\";\n//done\n//done\n//done\n//done\n//done\n// import { useNavigationPath } from \"../../../lib/hooks\";\n//done\n//done\n//done\nvar ResetStep=function ResetStep(_ref){var _ref$onStepChange=_ref.onStepChange,onStepChange=_ref$onStepChange===void 0?function(){}:_ref$onStepChange,_ref$customTitleStyle=_ref.customTitleStyle,customTitleStyle=_ref$customTitleStyle===void 0?{}:_ref$customTitleStyle,_ref$customResetWarni=_ref.customResetWarningMsg,customResetWarningMsg=_ref$customResetWarni===void 0?{}:_ref$customResetWarni,_ref$customButtonStyl=_ref.customButtonStyle,customButtonStyle=_ref$customButtonStyl===void 0?{}:_ref$customButtonStyl,_ref$customLinkStyle=_ref.customLinkStyle,customLinkStyle=_ref$customLinkStyle===void 0?{}:_ref$customLinkStyle;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2[\"default\"])(_useState,2),loading=_useState2[0],setLoading=_useState2[1];// const dispatch = useDispatch();\n// const navigateHook = useNavigate();\n// const navigate = useNavigationPath(navigateHook, dispatch);\nvar email=(0,_reactRedux.useSelector)(_userSlice.selectEmailVerificationState);var passToken=(0,_reactRedux.useSelector)(_userSlice.selectPassToken);(0,_react.useEffect)(function(){if(!email&&!passToken){// navigate(LOGIN_PATH);\nonStepChange(_navigation.LOGIN_PATH);}},[email,passToken]);var onSubmit=function onSubmit(e){e===null||e===void 0?void 0:e.preventDefault();if(loading){return;}setLoading(true);var params={};if(passToken){params.auth=passToken;}if(email){params.email=email;}(0,_resetMethods.prepareResetMethod)(params,function(){// navigate(RESET_VERIFICATION_PATH);\nonStepChange(_navigation.RESET_VERIFICATION_PATH);},function(){setLoading(true);(0,_toast.toastError)((0,_langManager.__)(\"something_went_wrong_error_msg\",\"Something went wrong. Please try again.\"));});};return/*#__PURE__*/_react[\"default\"].createElement(Container,{className:\"inner-animation animation-type-slide\"},/*#__PURE__*/_react[\"default\"].createElement(_EnterEventListener[\"default\"],{onSubmit:onSubmit}),/*#__PURE__*/_react[\"default\"].createElement(StepTitle,{style:customTitleStyle.style},(0,_langManager.__)(\"reset_title\",\"Reset pCloud Pass\")),/*#__PURE__*/_react[\"default\"].createElement(AlignWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(WarnWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(Style.WarnMessage,{style:customResetWarningMsg.style},(0,_langManager.__)(\"reset_title_warrning_msg1\",\"Unfortunately, without your Master Password or your Recovery Words, there is no way to recover the access the data you store in pCloud Pass.\"),(0,_langManager.__)(\"reset_title_warrning_msg2\",\"Your only option is to reset pCloud Pass and start from scratch. Resetting pCloud Pass will permanently delete your passwords and other items you've saved. How do you wish to proceed?\"))),/*#__PURE__*/_react[\"default\"].createElement(ButtonsWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(_ButtonDefault[\"default\"],{size:\"big\",loading:loading?1:0,color:\"pPassPurple\",borderRadius:\"8\",textSize:\"bigger\",onClick:onSubmit,style:customButtonStyle.style},(0,_langManager.__)(\"reset_title\",\"Reset pCloud Pass\"))),/*#__PURE__*/_react[\"default\"].createElement(Style.LinkWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(Style.Link,{onClick:function onClick(){/*navigate(ACCESS_RECOVERY_PATH)*/onStepChange(_navigation.ACCESS_RECOVERY_PATH);},style:customLinkStyle.style},(0,_langManager.__)(\"setup_access_enter_recovery_title\",\"Enter recovery words\")))));};var _default=ResetStep;exports[\"default\"]=_default;var Container=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"ResetStep__Container\",componentId:\"sc-2saoth-0\"})([\"display:flex;align-items:center;justify-content:flex-start;flex-direction:column;max-width:480px;margin:0 auto;\"]);var StepTitle=/*#__PURE__*/_styledComponents[\"default\"].h2.withConfig({displayName:\"ResetStep__StepTitle\",componentId:\"sc-2saoth-1\"})([\"font-size:23px;font-weight:bold;line-height:1.22;letter-spacing:-0.23px;text-align:center;color:#000;margin:0px;padding:0px;margin-bottom:42px;margin-top:50px;\"]);var ButtonsWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"ResetStep__ButtonsWrapper\",componentId:\"sc-2saoth-2\"})([\"margin-top:32px;\"]);var AlignWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"ResetStep__AlignWrapper\",componentId:\"sc-2saoth-3\"})([\"max-width:400px;width:100%;margin:0 auto;box-sizing:border-box;\"]);var WarnWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"ResetStep__WarnWrapper\",componentId:\"sc-2saoth-4\"})([\"margin-bottom:35px;\"]);","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.verifyResetCodeMethod=exports.resetAccountMethod=exports.prepareResetMethod=void 0;var _regenerator=_interopRequireDefault(require(\"@babel/runtime/regenerator\"));var _asyncToGenerator2=_interopRequireDefault(require(\"@babel/runtime/helpers/asyncToGenerator\"));var _passMethods=require(\"../../../../lib/passMethods\");var _toast=require(\"../../../../lib/toast\");var _langManager=require(\"../../../../lib/langManager\");// import { prepareReset, resetAccount, verifyResetCode } from \"../../../lib/methods\";\n//done\n//done\nvar prepareResetMethod=/*#__PURE__*/function(){var _ref=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee(params){var onSuccess,onError,_yield$prepareReset,result,_args=arguments;return _regenerator[\"default\"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:onSuccess=_args.length>1&&_args[1]!==undefined?_args[1]:function(){};onError=_args.length>2&&_args[2]!==undefined?_args[2]:function(){};if(!Object.keys(params).length){console.error(\"params are mandatory!\");onError();}_context.prev=3;_context.next=6;return(0,_passMethods.prepareReset)(params);case 6:_yield$prepareReset=_context.sent;result=_yield$prepareReset.result;if(!(result===0)){_context.next=11;break;}onSuccess();return _context.abrupt(\"return\");case 11:if(!(result===2019)){_context.next=14;break;}onError((0,_langManager.__)(\"error_2255\",\"You reached the limit of this action. Try again later.\"));return _context.abrupt(\"return\");case 14:onError();_context.next=21;break;case 17:_context.prev=17;_context.t0=_context[\"catch\"](3);console.log(_context.t0);onError();case 21:case\"end\":return _context.stop();}},_callee,null,[[3,17]]);}));return function prepareResetMethod(_x){return _ref.apply(this,arguments);};}();exports.prepareResetMethod=prepareResetMethod;var verifyResetCodeMethod=/*#__PURE__*/function(){var _ref2=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee2(params){var onSuccess,onError,_yield$verifyResetCod,result,_args2=arguments;return _regenerator[\"default\"].wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:onSuccess=_args2.length>1&&_args2[1]!==undefined?_args2[1]:function(){};onError=_args2.length>2&&_args2[2]!==undefined?_args2[2]:function(){};if(!Object.keys(params).length){console.error(\"params are mandatory!\");onError();}_context2.prev=3;_context2.next=6;return(0,_passMethods.verifyResetCode)(params);case 6:_yield$verifyResetCod=_context2.sent;result=_yield$verifyResetCod.result;if(!(result===0)){_context2.next=11;break;}onSuccess();return _context2.abrupt(\"return\");case 11:if(!(result===1016)){_context2.next=14;break;}onError((0,_langManager.__)(\"login_error_2012\",\"Incorrect security code.\"));return _context2.abrupt(\"return\");case 14:onError();_context2.next=21;break;case 17:_context2.prev=17;_context2.t0=_context2[\"catch\"](3);console.log(\"verifyResetCodeMethod ERROR\",_context2.t0);onError();case 21:case\"end\":return _context2.stop();}},_callee2,null,[[3,17]]);}));return function verifyResetCodeMethod(_x2){return _ref2.apply(this,arguments);};}();exports.verifyResetCodeMethod=verifyResetCodeMethod;var resetAccountMethod=/*#__PURE__*/function(){var _ref4=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee3(_ref3){var auth,code,onSuccess,onError,_yield$resetAccount,result,_args3=arguments;return _regenerator[\"default\"].wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:auth=_ref3.auth,code=_ref3.code;onSuccess=_args3.length>1&&_args3[1]!==undefined?_args3[1]:function(){};onError=_args3.length>2&&_args3[2]!==undefined?_args3[2]:function(){};if(!auth){console.error(\"auth is mandatory!\");}if(!code){console.error(\"code is mandatory!\");}_context3.prev=5;_context3.next=8;return(0,_passMethods.resetAccount)({auth:auth,code:code});case 8:_yield$resetAccount=_context3.sent;result=_yield$resetAccount.result;if(!(result===0)){_context3.next=13;break;}onSuccess();return _context3.abrupt(\"return\");case 13:if(!(result===2004)){_context3.next=16;break;}(0,_toast.toastError)((0,_langManager.__)(\"reset_code_expired\",\"Reset request expired.\"));return _context3.abrupt(\"return\");case 16:if(!(result===1016)){_context3.next=19;break;}(0,_toast.toastError)((0,_langManager.__)(\"error_verification_code_expired\",\"Action failed due to expired verification code.\"));return _context3.abrupt(\"return\");case 19:onError();_context3.next=26;break;case 22:_context3.prev=22;_context3.t0=_context3[\"catch\"](5);console.log(\"resetAccountMethod ERROR\",_context3.t0);onError();case 26:case\"end\":return _context3.stop();}},_callee3,null,[[5,22]]);}));return function resetAccountMethod(_x3){return _ref4.apply(this,arguments);};}();exports.resetAccountMethod=resetAccountMethod;","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");var _typeof=require(\"@babel/runtime/helpers/typeof\");Object.defineProperty(exports,\"__esModule\",{value:true});exports[\"default\"]=void 0;var _defineProperty2=_interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));var _slicedToArray2=_interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));var _react=_interopRequireWildcard(require(\"react\"));var _styledComponents=_interopRequireDefault(require(\"styled-components\"));var _reactRedux=require(\"react-redux\");var _reactComponentify=_interopRequireDefault(require(\"react-componentify\"));var Style=_interopRequireWildcard(require(\"../common.style\"));var _ButtonDefault=_interopRequireDefault(require(\"../../../../resources/components/ButtonDefault\"));var _checkEmail=_interopRequireDefault(require(\"../../../../resources/images/pcloud-pass/check-email.svg\"));var paths=_interopRequireWildcard(require(\"../../../../authentication/components/passUserAuthentication/navigation\"));var _resetMethods=require(\"../ResetStep/resetMethods\");var _userSlice=require(\"../../../../lib/state/reducers/pass/userSlice\");var _langManager=require(\"../../../../lib/langManager\");var _utils=require(\"../../../../lib/utils\");var _toast=require(\"../../../../lib/toast\");var _componentifyConverters=require(\"../../../../lib/componentifyConverters\");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!==\"function\")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||_typeof(obj)!==\"object\"&&typeof obj!==\"function\"){return{\"default\":obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!==\"default\"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj[\"default\"]=obj;if(cache){cache.set(obj,newObj);}return newObj;}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 _objectSpread(target){for(var i=1;i\n_react[\"default\"].createElement(_react[\"default\"].Fragment,null,/*#__PURE__*/_react[\"default\"].createElement(Style.StepActionTitle,{style:customTitleStyle.style},(0,_langManager.__)(\"verify_with_master_pass_modal_title\",\"Verify your identity\")),/*#__PURE__*/_react[\"default\"].createElement(Style.Form,{onSubmit:onContinueClick},/*#__PURE__*/_react[\"default\"].createElement(Style.MessageBox,null,/*#__PURE__*/_react[\"default\"].createElement(\"div\",{className:\"icon-wrapper\"},/*#__PURE__*/_react[\"default\"].createElement(_checkEmail[\"default\"],{fill:\"#746de4\"})),/*#__PURE__*/_react[\"default\"].createElement(Style.Message,null,/*#__PURE__*/_react[\"default\"].createElement(_reactComponentify[\"default\"],{text:(0,_langManager.__)(\"verification_code_message\",\"We've sent an email with a verification code to %email%\",{email:emailParam}),converters:[_componentifyConverters.boldConverter,_componentifyConverters.spanClassTagConverter]}))),/*#__PURE__*/_react[\"default\"].createElement(Style.ErrorText,null,error),/*#__PURE__*/_react[\"default\"].createElement(Style.InputWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(Style.StyledInput,{type:\"text\",value:verificationCode,onChange:onCodeChange,placeholder:(0,_langManager.__)(\"enter_verification_code_placeholder\",\"Enter verification code\"),autoFocus:true,style:customInputStyle.style})),/*#__PURE__*/_react[\"default\"].createElement(Style.ButtonWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(ButtonDefaultCustom,{size:\"big\",color:\"pPassPurple\",borderRadius:\"8\",textSize:\"bigger\"// style={{ marginTop: \"30px\" }}\n,style:disabledForm?_objectSpread(_objectSpread({},customButtonStyle.style),customButtonStyle.styleDisabled):customButtonStyle.style,disabled:disabledForm,loading:loading?1:0// onClick={debounce(onContinueClick, 500)}\n,onClick:onContinueClick},(0,_langManager.__)(\"Continue\")))),/*#__PURE__*/_react[\"default\"].createElement(Style.LinkWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(Style.Link,{onClick:(0,_utils.debounce)(onResendCodeClick,500),style:customLinkStyle.style},(0,_langManager.__)(\"verification_code_not_receiving_code\",\"Not receiving the code?\"))))// \n);};var _default=ResetVerificationCodeStepAction;exports[\"default\"]=_default;var ButtonDefaultCustom=/*#__PURE__*/(0,_styledComponents[\"default\"])(_ButtonDefault[\"default\"]).withConfig({displayName:\"ResetVerificationCodeStepAction__ButtonDefaultCustom\",componentId:\"sc-13k5oar-0\"})([\"margin-top:30px;\"]);","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");var _typeof=require(\"@babel/runtime/helpers/typeof\");Object.defineProperty(exports,\"__esModule\",{value:true});exports[\"default\"]=void 0;var _slicedToArray2=_interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));var _react=_interopRequireWildcard(require(\"react\"));var _styledComponents=_interopRequireDefault(require(\"styled-components\"));var _tick=_interopRequireDefault(require(\"../../../../resources/images/pcloud-pass/tick.svg\"));var _AnimationContainer=require(\"../../../../resources/components/Animation/AnimationContainer\");var _langManager=require(\"../../../../lib/langManager\");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!==\"function\")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||_typeof(obj)!==\"object\"&&typeof obj!==\"function\"){return{\"default\":obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!==\"default\"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj[\"default\"]=obj;if(cache){cache.set(obj,newObj);}return newObj;}//done\n// import { scale } from \"../../../style/animations.style\";\n//done\nvar PasswordRequirements=function PasswordRequirements(_ref){var password=_ref.password,_ref$onRequirementsMe=_ref.onRequirementsMeet,onRequirementsMeet=_ref$onRequirementsMe===void 0?function(){}:_ref$onRequirementsMe,_ref$onRequerementsRe=_ref.onRequerementsReject,onRequerementsReject=_ref$onRequerementsRe===void 0?function(){}:_ref$onRequerementsRe,_ref$customPasswordRe=_ref.customPasswordRequirments,customPasswordRequirments=_ref$customPasswordRe===void 0?{}:_ref$customPasswordRe,_ref$customPasswordRe2=_ref.customPasswordRequirmentsTitle,customPasswordRequirmentsTitle=_ref$customPasswordRe2===void 0?{}:_ref$customPasswordRe2;var DEFAULT_REQUIREMENTS=[{regexExpression:/.{12,}/,reqText:(0,_langManager.__)(\"setup_create_master_pass_tips_1\",\"at least 12 characters\"),valid:false,reqId:1},{regexExpression:/[*@!#%&()^~{}]+/,reqText:(0,_langManager.__)(\"setup_create_master_pass_tips_2\",\"uppercase letters, symbols and numbers\"),valid:false,reqId:2}];var _useState=(0,_react.useState)(DEFAULT_REQUIREMENTS),_useState2=(0,_slicedToArray2[\"default\"])(_useState,2),requirements=_useState2[0],setRequirements=_useState2[1];// REMOVE REQUIREMENTS\n// useEffect(() => {\n// let requirementsCopy = [...requirements];\n// requirementsCopy = requirementsCopy.map((req) => ({\n// ...req,\n// valid: req.regexExpression.test(password),\n// }));\n// setRequirements(requirementsCopy);\n// if (requirementsCopy.some(({ valid }) => !valid)) {\n// onRequerementsReject();\n// } else {\n// onRequirementsMeet();\n// }\n// }, [password]);\nreturn/*#__PURE__*/_react[\"default\"].createElement(RequirementsContainer,{style:customPasswordRequirments.style},/*#__PURE__*/_react[\"default\"].createElement(RequirementsTitle,{style:customPasswordRequirmentsTitle.style},(0,_langManager.__)(\"setup_create_master_pass_tips_title\",\"A strong Master Password should contain:\")),/*#__PURE__*/_react[\"default\"].createElement(RequirementsList,null,requirements.map(function(_ref2){var reqText=_ref2.reqText,valid=_ref2.valid,reqId=_ref2.reqId;return/*#__PURE__*/_react[\"default\"].createElement(Requirement,{key:reqId},/*#__PURE__*/_react[\"default\"].createElement(\"span\",null,reqText));})));};var _default=PasswordRequirements;exports[\"default\"]=_default;var RequirementsContainer=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"PasswordRequirements__RequirementsContainer\",componentId:\"sc-smxxu4-0\"})([\"padding:17px 20px;border-radius:8px;background-color:#f8f8f8;margin:26px 0px 30px 0px;\"]);var RequirementsTitle=/*#__PURE__*/_styledComponents[\"default\"].h4.withConfig({displayName:\"PasswordRequirements__RequirementsTitle\",componentId:\"sc-smxxu4-1\"})([\"font-size:15px;font-weight:500;line-height:1;text-align:left;color:#000;padding:0px;margin:0px;margin-bottom:12px;\"]);var RequirementsList=/*#__PURE__*/_styledComponents[\"default\"].ul.withConfig({displayName:\"PasswordRequirements__RequirementsList\",componentId:\"sc-smxxu4-2\"})([\"font-size:13px;line-height:1.15;text-align:left;color:#000;margin-bottom:12px;list-style:disc;\"]);var Requirement=/*#__PURE__*/_styledComponents[\"default\"].li.withConfig({displayName:\"PasswordRequirements__Requirement\",componentId:\"sc-smxxu4-3\"})([\"align-items:center;justify-content:flex-start;margin:4px 30px;&:first-of-type{margin-top:0px;}&:last-of-type{margin-bottom:0px;}\"]);var RequirementsCoution=/*#__PURE__*/_styledComponents[\"default\"].p.withConfig({displayName:\"PasswordRequirements__RequirementsCoution\",componentId:\"sc-smxxu4-4\"})([\"font-size:13px;font-weight:bold;line-height:1.15;text-align:left;color:#000;\"]);var IconWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"PasswordRequirements__IconWrapper\",componentId:\"sc-smxxu4-5\"})([\"display:inline-block;background-color:#ccc;width:15px;height:15px;border-radius:50%;margin-right:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all 200ms ease-in-out;&.valid{background-color:#5cb900;animation-name:\",\";animation-duration:400ms;animation-timing-function:ease-in-out;animation-direction:normal;animation-iteration-count:1;animation-delay:20ms;}\"],_AnimationContainer.scale);","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");var _typeof=require(\"@babel/runtime/helpers/typeof\");Object.defineProperty(exports,\"__esModule\",{value:true});exports[\"default\"]=void 0;var _defineProperty2=_interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));var _toConsumableArray2=_interopRequireDefault(require(\"@babel/runtime/helpers/toConsumableArray\"));var _slicedToArray2=_interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));var _react=_interopRequireWildcard(require(\"react\"));var _reactRedux=require(\"react-redux\");var _styledComponents=_interopRequireDefault(require(\"styled-components\"));var Style=_interopRequireWildcard(require(\"../common.style\"));var _ButtonDefault=_interopRequireDefault(require(\"../../../../resources/components/ButtonDefault\"));var _pass_view=_interopRequireDefault(require(\"../../../../resources/images/svg/pass_view.svg\"));var _pass_hide=_interopRequireDefault(require(\"../../../../resources/images/svg/pass_hide.svg\"));var _tick=_interopRequireDefault(require(\"../../../../resources/images/pcloud-pass/tick.svg\"));var _PasswordStrengthMeter=_interopRequireDefault(require(\"./PasswordStrengthMeter\"));var _PasswordRequirements=_interopRequireDefault(require(\"./PasswordRequirements\"));var _TransitionAnimation=_interopRequireDefault(require(\"../../../../resources/components/Animation/TransitionAnimation\"));var _navigation=require(\"../navigation\");var _EnterEventListener=_interopRequireDefault(require(\"../../EnterEventListener\"));var _langManager=require(\"../../../../lib/langManager\");var _toast=require(\"../../../../lib/toast\");var _methods=require(\"./methods\");var _userSlice=require(\"../../../../lib/state/reducers/pass/userSlice\");var _layoutSlice=require(\"../../../../lib/state/reducers/pass/layoutSlice\");var _utils=require(\"../utils.pass\");var _constants=require(\"../constants.pass\");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!==\"function\")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||_typeof(obj)!==\"object\"&&typeof obj!==\"function\"){return{\"default\":obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!==\"default\"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj[\"default\"]=obj;if(cache){cache.set(obj,newObj);}return newObj;}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 _objectSpread(target){for(var i=1;i
{\n// dispatch(setNavigationPath(path));\n// if (route.pathname !== path) {\n// navigateRef.current(path + route.search /* , { replace: true } */);\n// }\n// };\nvar onPasswordChange=function onPasswordChange(event){var value=event.target.value;setPassword(value);};var onPasswordRepeatChange=function onPasswordRepeatChange(event){var value=event.target.value;setPasswordRepeat(value);if(errorMessage){setErrorMessage(\"\");}};var onError=function onError(error){setLoading(false);console.log(\"🚀 ~ file: SetPassStepAction.js ~ line 77 ~ onSubmit ~ error\",error);if(error===2016){// navigate(LOGIN_PATH);\nonStepChange(_navigation.LOGIN_PATH);return;}if(error===1016){setErrorMessage((0,_langManager.__)(\"error_verification_code_expired\",\"Action failed due to expired verification code.\"));return;}(0,_toast.toastError)((0,_langManager.__)(\"something_went_wrong_error_msg\",\"Something went wrong. Please try again.\"));};var onSubmit=function onSubmit(e){e===null||e===void 0?void 0:e.preventDefault();if(!requirementsAreMet||!password.length||password!==passwordRepeat||loading){return;}setLoading(true);if(action===\"setpass\"){(0,_methods.setUpPassMethod)({password:password,inviteRequestCode:inviteRequestCode,isExtension:isExtension,resetDesktopSettings:resetDesktopSettings,resetExtensionSettings:resetExtensionSettings,returnAppFocus:returnAppFocus,isWebviewPage:isWebviewPage,isProduction:isProduction,dontCloseWebviewModal:isWebviewPage&¤tPath&&(currentPath==_navigation.SETUP_PASS_PATH||currentPath==_navigation.RECOVERY_WORDS_PATH),skipVerificationCodeStep:skipVerificationCodeStep,onSuccess:function onSuccess(_ref2){var privateKey=_ref2.privateKey,invertPrivKey=_ref2.invertPrivKey;_onSuccess(privateKey,invertPrivKey);},onError:onError,onSuccessToken:function onSuccessToken(_ref3){var pcauth=_ref3.pcauth,locationid=_ref3.locationid,passToken=_ref3.passToken;if(isWebviewPage&&page===_constants.CHECKOUT_PAGE){(0,_utils.sendLoginSuccessMessage)({isProduction:isProduction});}else if(!skipRecoveryWordsStepAfterSignup){onStepChange(_navigation.RECOVERY_WORDS_PATH);}_onSuccessToken({pcauth:pcauth,locationid:locationid,passToken:passToken});}});}else if(action===\"recoverypass\"){(0,_methods.recoveryPassMethod)(password,isExtension,resetDesktopSettings,resetExtensionSettings,returnAppFocus,function(_ref4){var privateKey=_ref4.privateKey,encryptedPrivateKey=_ref4.encryptedPrivateKey;/*navigate(HOME_PATH)*/onStepChange(_navigation.HOME_PATH);_onSuccess(privateKey,encryptedPrivateKey);},onError,_onSuccessToken);}else if(action===\"resetpass\"){// navigate(RESET_CONFIRM_PATH);\nonStepChange(_navigation.RESET_CONFIRM_PATH);dispatch((0,_userSlice.setResetData)(password));}};var onHidePass=function onHidePass(id){var elements=(0,_toConsumableArray2[\"default\"])(visiblePasswords);var elementIndex=elements.indexOf(id);if(elementIndex!==-1){elements.splice(elementIndex,1);setVisiblePasswords(elements);}};var onShowPass=function onShowPass(id){setVisiblePasswords([].concat((0,_toConsumableArray2[\"default\"])(visiblePasswords),[id]));};var renderShowPass=function renderShowPass(id,password){var showPass=visiblePasswords.indexOf(id)!==-1;return/*#__PURE__*/_react[\"default\"].createElement(PassIconWrapper,{className:\"clickable\"},/*#__PURE__*/_react[\"default\"].createElement(_TransitionAnimation[\"default\"],{trigger:Boolean(password.length),type:\"fade\"},showPass?/*#__PURE__*/_react[\"default\"].createElement(_pass_view[\"default\"],{fill:\"#898991\",style:{marginLeft:\"10px\"},onClick:function onClick(){return onHidePass(id);}}):/*#__PURE__*/_react[\"default\"].createElement(_pass_hide[\"default\"],{fill:\"#898991\",style:{marginLeft:\"10px\"},onClick:function onClick(){return onShowPass(id);}})));};var renderMatchPass=function renderMatchPass(){return/*#__PURE__*/_react[\"default\"].createElement(_TransitionAnimation[\"default\"],{trigger:Boolean(password&&password===passwordRepeat),type:\"fade\"},/*#__PURE__*/_react[\"default\"].createElement(PassIconWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(_tick[\"default\"],{width:\"15px\",height:\"15px\",fill:\"#898991\"})));};return/*#__PURE__*/ (// \n_react[\"default\"].createElement(_react[\"default\"].Fragment,null,/*#__PURE__*/_react[\"default\"].createElement(_EnterEventListener[\"default\"],{onSubmit:onSubmit,arrayOfDependancies:[password,passwordRepeat,loading]}),/*#__PURE__*/_react[\"default\"].createElement(Style.StepActionTitle,{style:customTitleStyle.style},(0,_langManager.__)(\"setup_verified_acc_button\",\"Create Master Password\")),/*#__PURE__*/_react[\"default\"].createElement(Style.StepActionDescription,{style:customStepActionDescription.style},(0,_langManager.__)(\"setup_create_master_pass_desc\",\"You'll use the Master password to access everything you store in pCloud Pass. We do not know or save your Master Password on our servers\")),/*#__PURE__*/_react[\"default\"].createElement(_PasswordRequirements[\"default\"],{password:password,customPasswordRequirments:customPasswordRequirments,customPasswordRequirmentsTitle:customPasswordRequirmentsTitle}),/*#__PURE__*/_react[\"default\"].createElement(FormWrapper,{style:customSetPassForm.style},/*#__PURE__*/_react[\"default\"].createElement(Style.ErrorText,null,errorMessage),/*#__PURE__*/_react[\"default\"].createElement(InputWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(Style.StyledInput,{type:visiblePasswords.indexOf(0)!==-1?\"text\":\"password\",placeholder:(0,_langManager.__)(\"setup_create_master_pass_placeholder_pass\",\"Master Password\"),value:password,onChange:onPasswordChange,autoFocus:true,style:customInputStyle.style}),renderShowPass(0,password),/*#__PURE__*/_react[\"default\"].createElement(_PasswordStrengthMeter[\"default\"],{password:password,numberOfSections:6,onRequirementsMeet:function onRequirementsMeet(){return setRequirementsAreMet(true);},onRequerementsReject:function onRequerementsReject(){return setRequirementsAreMet(false);}})),/*#__PURE__*/_react[\"default\"].createElement(InputWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(Style.StyledInput,{type:visiblePasswords.indexOf(1)!==-1?\"text\":\"password\",placeholder:(0,_langManager.__)(\"setup_create_master_pass_placeholder_repeat\",\"Repeat Master Password\"),value:passwordRepeat,onChange:onPasswordRepeatChange,style:customInputStyle.style}),password&&passwordRepeat&&password===passwordRepeat?renderMatchPass():renderShowPass(1,passwordRepeat)),/*#__PURE__*/_react[\"default\"].createElement(ButtonDefaultCustom,{disabled:!requirementsAreMet||!password.length||password!==passwordRepeat,size:\"big\",loading:loading?1:0,color:\"pPassPurple\",style:loading?_objectSpread(_objectSpread({},customButtonStyle.style),customButtonStyle.styleDisabled):customButtonStyle.style,borderRadius:\"8\",textSize:\"bigger\",onClick:onSubmit},buttonText)))// {/* */}\n);};var _default=SetPassStepAction;exports[\"default\"]=_default;var FormWrapper=/*#__PURE__*/_styledComponents[\"default\"].form.withConfig({displayName:\"SetPassStepAction__FormWrapper\",componentId:\"sc-1qx2lh2-0\"})([\"margin-top:30px;\"]);var InputWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"SetPassStepAction__InputWrapper\",componentId:\"sc-1qx2lh2-1\"})([\"margin:12px 0px;position:relative;&:first-of-type{margin-top:0px;}&:last-of-type{margin-bottom:0px;}\"]);var PassIconWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"SetPassStepAction__PassIconWrapper\",componentId:\"sc-1qx2lh2-2\"})([\"display:inline-block;position:absolute;top:11px;right:11px;&.clickable{cursor:pointer;}\"]);var ButtonDefaultCustom=/*#__PURE__*/(0,_styledComponents[\"default\"])(_ButtonDefault[\"default\"]).withConfig({displayName:\"SetPassStepAction__ButtonDefaultCustom\",componentId:\"sc-1qx2lh2-3\"})([\"margin-top:30px;\"]);","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.setUpPassMethod=exports.resetPassMethod=exports.recoveryPassMethod=void 0;var _regenerator=_interopRequireDefault(require(\"@babel/runtime/regenerator\"));var _asyncToGenerator2=_interopRequireDefault(require(\"@babel/runtime/helpers/asyncToGenerator\"));var _pmenc=require(\"@pcloud/pmenc\");var _store=_interopRequireDefault(require(\"../../../../lib/state/store\"));var _userSlice=require(\"../../../../lib/state/reducers/pass/userSlice\");var _toast=require(\"../../../../lib/toast\");var _langManager=require(\"../../../../lib/langManager\");var _methods=require(\"../methods\");var _passMethods=require(\"../../../../lib/passMethods\");//done\n//done\n// import { db, resetDatabase } from \"../../../lib/db\";\n//done\n//done\n// import { changeKeysByEmail, registerUserMethod, resetByCodeAccountMethod, loginUserMethod } from \"../methods\";\n//done\n// import { changeKeys } from \"../../../lib/methods\";\n//done\n// const addKeys = async (key1, key2) => {\n// try {\n// // await db.addKeys({ privateKey: key1, invertPrivKey: key2 });\n// } catch (error) {\n// console.log(\"🚀 ~ file: SetPassStepAction.js ~ line 45 ~ addKeys ~ error\", error);\n// }\n// };\nvar setUpPassMethod=/*#__PURE__*/function(){var _ref2=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee(_ref){var password,_ref$inviteRequestCod,inviteRequestCode,_ref$isExtension,isExtension,_ref$resetDesktopSett,resetDesktopSettings,_ref$resetExtensionSe,resetExtensionSettings,_ref$returnAppFocus,returnAppFocus,_ref$isWebviewPage,isWebviewPage,_ref$isProduction,isProduction,_ref$dontCloseWebview,dontCloseWebviewModal,_ref$skipVerification,skipVerificationCodeStep,_ref$onSuccess,onSuccess,_ref$onSuccessToken,onSuccessToken,_ref$onError,onError,state,_state$passUser,_state$passUser2,isDesktop,emailVerificationState,codeVerificationState,osVersion,appVersion,appDeviceInfo,data,privateKey,invertPrivKey,seed,encryptedPrivateKey,publicKey,params;return _regenerator[\"default\"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:password=_ref.password,_ref$inviteRequestCod=_ref.inviteRequestCode,inviteRequestCode=_ref$inviteRequestCod===void 0?\"\":_ref$inviteRequestCod,_ref$isExtension=_ref.isExtension,isExtension=_ref$isExtension===void 0?false:_ref$isExtension,_ref$resetDesktopSett=_ref.resetDesktopSettings,resetDesktopSettings=_ref$resetDesktopSett===void 0?function(){}:_ref$resetDesktopSett,_ref$resetExtensionSe=_ref.resetExtensionSettings,resetExtensionSettings=_ref$resetExtensionSe===void 0?function(){}:_ref$resetExtensionSe,_ref$returnAppFocus=_ref.returnAppFocus,returnAppFocus=_ref$returnAppFocus===void 0?function(){}:_ref$returnAppFocus,_ref$isWebviewPage=_ref.isWebviewPage,isWebviewPage=_ref$isWebviewPage===void 0?false:_ref$isWebviewPage,_ref$isProduction=_ref.isProduction,isProduction=_ref$isProduction===void 0?false:_ref$isProduction,_ref$dontCloseWebview=_ref.dontCloseWebviewModal,dontCloseWebviewModal=_ref$dontCloseWebview===void 0?false:_ref$dontCloseWebview,_ref$skipVerification=_ref.skipVerificationCodeStep,skipVerificationCodeStep=_ref$skipVerification===void 0?false:_ref$skipVerification,_ref$onSuccess=_ref.onSuccess,onSuccess=_ref$onSuccess===void 0?function(){}:_ref$onSuccess,_ref$onSuccessToken=_ref.onSuccessToken,onSuccessToken=_ref$onSuccessToken===void 0?function(){}:_ref$onSuccessToken,_ref$onError=_ref.onError,onError=_ref$onError===void 0?function(){}:_ref$onError;state=_store[\"default\"].getState();_state$passUser=state.passUser,_state$passUser2=_state$passUser===void 0?{}:_state$passUser,isDesktop=_state$passUser2.isDesktop,emailVerificationState=_state$passUser2.emailVerificationState,codeVerificationState=_state$passUser2.codeVerificationState,osVersion=_state$passUser2.osVersion,appVersion=_state$passUser2.appVersion,appDeviceInfo=_state$passUser2.appDeviceInfo;_context.prev=3;_context.next=6;return _pmenc.ppassWeb.setupMasterPassword(password);case 6:data=_context.sent;if(data){privateKey=data.privateKey,invertPrivKey=data.invertPrivKey,seed=data.seed,encryptedPrivateKey=data.encryptedPrivateKey,publicKey=data.publicKey;params={email:emailVerificationState,code:codeVerificationState,termsaccepted:\"yes\",privatekey:encryptedPrivateKey,publickey:publicKey,userPrivateKey:privateKey,os:osVersion};if(isDesktop){if(appVersion){params.appversion=appVersion;}if(appDeviceInfo){params.device=appDeviceInfo;}}if(inviteRequestCode){params.inviterequestcode=inviteRequestCode;}if(skipVerificationCodeStep){params.skipverification=true;}(0,_methods.registerUserMethod)(params,{isExtension:isExtension,isDesktop:isDesktop,resetDesktopSettings:resetDesktopSettings,resetExtensionSettings:resetExtensionSettings,returnAppFocus:returnAppFocus,isWebviewPage:isWebviewPage,isProduction:isProduction,dontCloseWebviewModal:dontCloseWebviewModal,onSuccessCb:function onSuccessCb(){// addKeys(privateKey, invertPrivKey); //pass keys to password-manager-shared / add keys into db\n_store[\"default\"].dispatch((0,_userSlice.setPublicKey)(\"\"));_store[\"default\"].dispatch((0,_userSlice.setEncryptedPrivateKey)(\"\"));_store[\"default\"].dispatch((0,_userSlice.setEmailVerificationState)(\"\"));console.log(\"SEEEEEEDDDD \",seed);_store[\"default\"].dispatch((0,_userSlice.setRecoveryWords)(seed));_store[\"default\"].dispatch((0,_userSlice.setIsUnlocked)(true));_store[\"default\"].dispatch((0,_userSlice.setCodeVerificationState)(\"\"));onSuccess({privateKey:privateKey,invertPrivKey:invertPrivKey});},onSuccessToken:onSuccessToken,onError:onError});}else{onError();}_context.next=13;break;case 10:_context.prev=10;_context.t0=_context[\"catch\"](3);onError(_context.t0);case 13:case\"end\":return _context.stop();}},_callee,null,[[3,10]]);}));return function setUpPassMethod(_x){return _ref2.apply(this,arguments);};}();exports.setUpPassMethod=setUpPassMethod;var recoveryPassMethod=/*#__PURE__*/function(){var _ref3=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee2(password){var isExtension,resetDesktopSettings,resetExtensionSettings,returnAppFocus,onSuccess,onError,onSuccessToken,state,_state$passUser3,_state$passUser4,_state$passUser4$pass,passToken,_state$passUser4$user,userinfo,emailVerificationState,recoveryWords,encryptedPrivateKeyState,publicKeyState,token,email,data,encryptedPrivateKey,privateKey,_state$passUser5,isDesktop,appVersion,osVersion,appDeviceInfo,params,_args2=arguments;return _regenerator[\"default\"].wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:isExtension=_args2.length>1&&_args2[1]!==undefined?_args2[1]:false;resetDesktopSettings=_args2.length>2&&_args2[2]!==undefined?_args2[2]:function(){};resetExtensionSettings=_args2.length>3&&_args2[3]!==undefined?_args2[3]:function(){};returnAppFocus=_args2.length>4&&_args2[4]!==undefined?_args2[4]:function(){};onSuccess=_args2.length>5&&_args2[5]!==undefined?_args2[5]:function(){};onError=_args2.length>6&&_args2[6]!==undefined?_args2[6]:function(){};onSuccessToken=_args2.length>7&&_args2[7]!==undefined?_args2[7]:function(){};state=_store[\"default\"].getState();_state$passUser3=state.passUser,_state$passUser4=_state$passUser3===void 0?{}:_state$passUser3,_state$passUser4$pass=_state$passUser4.passToken,passToken=_state$passUser4$pass===void 0?{}:_state$passUser4$pass,_state$passUser4$user=_state$passUser4.userinfo,userinfo=_state$passUser4$user===void 0?{}:_state$passUser4$user,emailVerificationState=_state$passUser4.emailVerificationState,recoveryWords=_state$passUser4.recoveryWords,encryptedPrivateKeyState=_state$passUser4.encryptedPrivateKey,publicKeyState=_state$passUser4.publicKey;token=passToken.token;email=userinfo.email;_context2.prev=11;_context2.next=14;return _pmenc.ppassWeb.changeMasterPasswordFromSeed(recoveryWords,password,publicKeyState,encryptedPrivateKeyState);case 14:data=_context2.sent;if(data){encryptedPrivateKey=data.encryptedPrivateKey,privateKey=data.privateKey;_state$passUser5=state.passUser,isDesktop=_state$passUser5.isDesktop,appVersion=_state$passUser5.appVersion,osVersion=_state$passUser5.osVersion,appDeviceInfo=_state$passUser5.appDeviceInfo;params={privatekey:encryptedPrivateKey,userPrivateKey:privateKey};if(emailVerificationState){params.email=emailVerificationState;params.os=osVersion;}if(token){params.auth=token;}if(isDesktop){if(appVersion){params.appversion=appVersion;}if(appDeviceInfo){params.device=appDeviceInfo;}}if(token){(0,_passMethods.changeKeys)(params).then(function(successData){if(successData.result===0){_store[\"default\"].dispatch((0,_userSlice.setEncryptedPrivateKey)(encryptedPrivateKey));var _params={email:email,os:osVersion,auth:token,logout:1};if(isDesktop){if(appVersion){_params.appversion=appVersion;}if(appDeviceInfo){_params.device=appDeviceInfo;}}(0,_methods.loginUserMethod)(_params,{userPrivateKey:privateKey,isExtension:isExtension,isDesktop:isDesktop,resetDesktopSettings:resetDesktopSettings,resetExtensionSettings:resetExtensionSettings,returnAppFocus:returnAppFocus,onSuccessCb:function onSuccessCb(){_store[\"default\"].dispatch((0,_userSlice.setIsUnlocked)(true));// addKeys(privateKey, encryptedPrivateKey);\n// onSuccess();\nonSuccess({privateKey:privateKey,encryptedPrivateKey:encryptedPrivateKey});(0,_toast.toastSuccess)((0,_langManager.__)(\"setup_access_recovered_succ_msg\",\"Access recovered. Your Master Password has been updated.\"));},onError:onError,onSuccessToken:onSuccessToken});}else{onError();}})[\"catch\"](function(error){onError(error);});}else{(0,_methods.changeKeysByEmail)(params,{isExtension:isExtension,isDesktop:isDesktop,resetDesktopSettings:resetDesktopSettings,resetExtensionSettings:resetExtensionSettings,returnAppFocus:returnAppFocus,onSuccessCb:function onSuccessCb(){// addKeys(privateKey, encryptedPrivateKey);\n_store[\"default\"].dispatch((0,_userSlice.setIsUnlocked)(true));// onSuccess();\nonSuccess({privateKey:privateKey,encryptedPrivateKey:encryptedPrivateKey});(0,_toast.toastSuccess)((0,_langManager.__)(\"setup_access_recovered_succ_msg\",\"Access recovered. Your Master Password has been updated.\"));},onError:onError,onSuccessToken:onSuccessToken});}}else{onError(\"\");}_context2.next=21;break;case 18:_context2.prev=18;_context2.t0=_context2[\"catch\"](11);onError(_context2.t0);case 21:case\"end\":return _context2.stop();}},_callee2,null,[[11,18]]);}));return function recoveryPassMethod(_x2){return _ref3.apply(this,arguments);};}();exports.recoveryPassMethod=recoveryPassMethod;var resetPassMethod=/*#__PURE__*/function(){var _ref5=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee3(_ref4){var password,isExtension,_ref4$resetDesktopSet,resetDesktopSettings,_ref4$resetExtensionS,resetExtensionSettings,_ref4$returnAppFocus,returnAppFocus,_ref4$resetDatabase,resetDatabase,_ref4$onSuccess,onSuccess,_ref4$onResetSuccess,onResetSuccess,_ref4$onSuccessToken,onSuccessToken,_ref4$onError,onError,state,_state$passUser6,_state$passUser7,passToken,emailVerificationState,codeVerificationState,isDesktop,osVersion,appVersion,appDeviceInfo,token,data,privateKey,invertPrivKey,seed,encryptedPrivateKey,publicKey,params;return _regenerator[\"default\"].wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:password=_ref4.password,isExtension=_ref4.isExtension,_ref4$resetDesktopSet=_ref4.resetDesktopSettings,resetDesktopSettings=_ref4$resetDesktopSet===void 0?function(){}:_ref4$resetDesktopSet,_ref4$resetExtensionS=_ref4.resetExtensionSettings,resetExtensionSettings=_ref4$resetExtensionS===void 0?function(){}:_ref4$resetExtensionS,_ref4$returnAppFocus=_ref4.returnAppFocus,returnAppFocus=_ref4$returnAppFocus===void 0?function(){}:_ref4$returnAppFocus,_ref4$resetDatabase=_ref4.resetDatabase,resetDatabase=_ref4$resetDatabase===void 0?function(){}:_ref4$resetDatabase,_ref4$onSuccess=_ref4.onSuccess,onSuccess=_ref4$onSuccess===void 0?function(){}:_ref4$onSuccess,_ref4$onResetSuccess=_ref4.onResetSuccess,onResetSuccess=_ref4$onResetSuccess===void 0?function(){}:_ref4$onResetSuccess,_ref4$onSuccessToken=_ref4.onSuccessToken,onSuccessToken=_ref4$onSuccessToken===void 0?function(){}:_ref4$onSuccessToken,_ref4$onError=_ref4.onError,onError=_ref4$onError===void 0?function(){}:_ref4$onError;state=_store[\"default\"].getState();_state$passUser6=state.passUser,_state$passUser7=_state$passUser6===void 0?{}:_state$passUser6,passToken=_state$passUser7.passToken,emailVerificationState=_state$passUser7.emailVerificationState,codeVerificationState=_state$passUser7.codeVerificationState,isDesktop=_state$passUser7.isDesktop,osVersion=_state$passUser7.osVersion,appVersion=_state$passUser7.appVersion,appDeviceInfo=_state$passUser7.appDeviceInfo;token=passToken.token;_context3.prev=4;_context3.next=7;return _pmenc.ppassWeb.setupMasterPassword(password);case 7:data=_context3.sent;if(data){privateKey=data.privateKey,invertPrivKey=data.invertPrivKey,seed=data.seed,encryptedPrivateKey=data.encryptedPrivateKey,publicKey=data.publicKey;resetDatabase();_store[\"default\"].dispatch((0,_userSlice.deletePassToken)());params={auth:token,email:emailVerificationState,code:codeVerificationState,os:osVersion,privatekey:encryptedPrivateKey,publickey:publicKey,userPrivateKey:privateKey};if(isDesktop){if(appVersion){params.appversion=appVersion;}if(appDeviceInfo){params.device=appDeviceInfo;}}(0,_methods.resetByCodeAccountMethod)(params,{isExtension:isExtension,isDesktop:isDesktop,resetDesktopSettings:resetDesktopSettings,resetExtensionSettings:resetExtensionSettings,returnAppFocus:returnAppFocus,onSuccessCb:function onSuccessCb(){// addKeys(privateKey, invertPrivKey);\n_store[\"default\"].dispatch((0,_userSlice.setPublicKey)(\"\"));_store[\"default\"].dispatch((0,_userSlice.setEncryptedPrivateKey)(\"\"));_store[\"default\"].dispatch((0,_userSlice.setRecoveryWords)(seed));_store[\"default\"].dispatch((0,_userSlice.setIsUnlocked)(true));onSuccess({privateKey:privateKey,invertPrivKey:invertPrivKey});// onResetSuccess({privateKey, invertPrivKey});\n},onSuccessToken:onSuccessToken,onError:onError});}else{onError();}_context3.next=14;break;case 11:_context3.prev=11;_context3.t0=_context3[\"catch\"](4);onError(_context3.t0);case 14:case\"end\":return _context3.stop();}},_callee3,null,[[4,11]]);}));return function resetPassMethod(_x3){return _ref5.apply(this,arguments);};}();exports.resetPassMethod=resetPassMethod;","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.Wrapper=exports.WarnMessage=exports.SubHeading=exports.StyledInput=exports.StepTitleInfo=exports.StepTitle=exports.StepPlanInfo=exports.StepDescriptionInfo=exports.StepDescription=exports.StepActionTitleCenter=exports.StepActionTitle=exports.StepActionDescription=exports.SocialButtonWrapper=exports.SocialButton=exports.SigninOptionsWrapper=exports.RightBox=exports.ModalContentWrapper=exports.MessageVerify=exports.MessageBoxVerify=exports.MessageBoxDelete=exports.MessageBox=exports.Message=exports.ListItemLink=exports.ListItem=exports.LinkWrapper=exports.LinkDescription=exports.LinkButton=exports.Link=exports.LeftBox=exports.InputWrapper=exports.Input=exports.InfoBoxWrapperInfo=exports.InfoBoxWrapper=exports.ImagePlaceHolder=exports.Heading=exports.FormWrapper=exports.Form=exports.FooterText=exports.FooterLink=exports.Footer=exports.FlexContainer=exports.ErrorText=exports.ErrorMessage=exports.ErrorContainer=exports.ErrorBox=exports.ContinueWith=exports.CheckoutInfo=exports.ButtonWrapper=exports.ButtonLink=exports.Button=exports.ActionBoxWrapper=void 0;var _styledComponents=_interopRequireDefault(require(\"styled-components\"));var InfoBoxWrapperInfo=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__InfoBoxWrapperInfo\",componentId:\"sc-1tugrps-0\"})([\"display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px;box-sizing:border-box;width:100%;@media screen and (max-width:910px){min-width:0px;text-align:center;max-width:400px;padding:60px 20px;}\"]);exports.InfoBoxWrapperInfo=InfoBoxWrapperInfo;var InfoBoxWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__InfoBoxWrapper\",componentId:\"sc-1tugrps-1\"})([\"max-width:486px;min-width:320px;padding:20px;box-sizing:border-box;text-align:left;width:100%;margin:0 auto;.login-form{.login-button-facebook{margin:0 !important;}}@media screen and (max-width:910px){min-width:0px;max-width:400px;padding:60px 20px;}\"]);exports.InfoBoxWrapper=InfoBoxWrapper;var ImagePlaceHolder=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__ImagePlaceHolder\",componentId:\"sc-1tugrps-2\"})([\"width:160px;height:160px;border-radius:50%;background-color:#ffffff;border:1px solid #f2f2f2;margin:0px 0px 30px 0px;@media screen and (max-width:910px){margin:0px auto 30px auto;}\"]);exports.ImagePlaceHolder=ImagePlaceHolder;var StepTitleInfo=/*#__PURE__*/_styledComponents[\"default\"].h2.withConfig({displayName:\"commonstyle__StepTitleInfo\",componentId:\"sc-1tugrps-3\"})([\"font-size:32px;font-weight:bold;line-height:1.19;letter-spacing:-0.32px;color:#000;padding:0px;width:100%;@media screen and (max-width:910px){text-align:center;}\"]);exports.StepTitleInfo=StepTitleInfo;var StepTitle=/*#__PURE__*/_styledComponents[\"default\"].h2.withConfig({displayName:\"commonstyle__StepTitle\",componentId:\"sc-1tugrps-4\"})([\"font-size:32px;font-weight:bold;line-height:1.19;letter-spacing:-0.32px;text-align:left;color:#000;padding:0px;margin:0px 0px 16px 0px;max-width:360px;width:100%;@media screen and (max-width:910px){text-align:center;}\"]);exports.StepTitle=StepTitle;var StepDescription=/*#__PURE__*/_styledComponents[\"default\"].p.withConfig({displayName:\"commonstyle__StepDescription\",componentId:\"sc-1tugrps-5\"})([\"font-size:19px;font-weight:normal;line-height:1.32;letter-spacing:normal;text-align:left;color:#000;padding:0px;margin:0px;max-width:360px;width:100%;@media screen and (max-width:910px){text-align:center;}\"]);exports.StepDescription=StepDescription;var StepDescriptionInfo=/*#__PURE__*/_styledComponents[\"default\"].p.withConfig({displayName:\"commonstyle__StepDescriptionInfo\",componentId:\"sc-1tugrps-6\"})([\"font-size:19px;font-weight:normal;line-height:1.32;letter-spacing:normal;color:#000;padding:0px;width:100%;margin-bottom:35px;@media screen and (max-width:910px){text-align:center;}\"]);exports.StepDescriptionInfo=StepDescriptionInfo;var CheckoutInfo=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__CheckoutInfo\",componentId:\"sc-1tugrps-7\"})([\"padding:32px 20px 24px 20px;margin:0 auto;background-color:#f8f7fd;\"]);exports.CheckoutInfo=CheckoutInfo;var StepPlanInfo=/*#__PURE__*/_styledComponents[\"default\"].p.withConfig({displayName:\"commonstyle__StepPlanInfo\",componentId:\"sc-1tugrps-8\"})([\"font-size:18px;font-weight:normal;line-height:1.32;letter-spacing:normal;color:#000;padding:0px;width:100%;margin:24px 0 65px 0;@media screen and (max-width:910px){text-align:center;margin-bottom:0;}\"]);exports.StepPlanInfo=StepPlanInfo;var ActionBoxWrapper=/*#__PURE__*/(0,_styledComponents[\"default\"])(InfoBoxWrapper).withConfig({displayName:\"commonstyle__ActionBoxWrapper\",componentId:\"sc-1tugrps-9\"})([\"max-width:400px;\"]);exports.ActionBoxWrapper=ActionBoxWrapper;var StepActionTitle=/*#__PURE__*/_styledComponents[\"default\"].h3.withConfig({displayName:\"commonstyle__StepActionTitle\",componentId:\"sc-1tugrps-10\"})([\"font-size:23px;font-weight:bold;line-height:1.22;letter-spacing:normal;text-align:left;color:#000;padding:0px;margin:0px 0px 20px 0px;max-width:360px;width:100%;@media screen and (max-width:910px){text-align:center;margin:0px auto 20px auto;}\"]);exports.StepActionTitle=StepActionTitle;var StepActionTitleCenter=/*#__PURE__*/(0,_styledComponents[\"default\"])(StepActionTitle).withConfig({displayName:\"commonstyle__StepActionTitleCenter\",componentId:\"sc-1tugrps-11\"})([\"text-align:center;margin:0;max-width:100%;\"]);exports.StepActionTitleCenter=StepActionTitleCenter;var StepActionDescription=/*#__PURE__*/_styledComponents[\"default\"].p.withConfig({displayName:\"commonstyle__StepActionDescription\",componentId:\"sc-1tugrps-12\"})([\"font-size:15px;font-weight:normal;font-stretch:normal;font-style:normal;line-height:1.4;letter-spacing:normal;text-align:left;color:#000;max-width:360px;width:100%;margin-bottom:16px;@media screen and (max-width:910px){text-align:center;}\"]);exports.StepActionDescription=StepActionDescription;var StyledInput=/*#__PURE__*/_styledComponents[\"default\"].input.withConfig({displayName:\"commonstyle__StyledInput\",componentId:\"sc-1tugrps-13\"})([\"border-radius:5px;border:solid 1px #a1a1a1;background-color:#fff;width:100%;height:40px;font-size:15px;line-height:40px;padding:11px 34px 11px 11px;box-sizing:border-box;outline:none;border:solid 1px \",\";&::-ms-reveal{display:none;}&:disabled{border:solid 1px #ebebeb;background-color:#f4f4f4;color:#888;}&[type=\\\"email\\\"],&:read-only{padding-right:35px !important;}&::placeholder{font-size:15px;color:rgba(0,0,0,0.54);}\"],function(_ref){var used=_ref.used;return used?\"none\":\"#a1a1a1\";});exports.StyledInput=StyledInput;var LinkWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__LinkWrapper\",componentId:\"sc-1tugrps-14\"})([\"text-align:center;margin-top:25px;\"]);exports.LinkWrapper=LinkWrapper;var LinkDescription=/*#__PURE__*/_styledComponents[\"default\"].span.withConfig({displayName:\"commonstyle__LinkDescription\",componentId:\"sc-1tugrps-15\"})([\"font-size:15px;padding-right:3px;\"]);exports.LinkDescription=LinkDescription;var LinkButton=/*#__PURE__*/_styledComponents[\"default\"].a.withConfig({displayName:\"commonstyle__LinkButton\",componentId:\"sc-1tugrps-16\"})([\"display:inline-block;font-size:15px;font-weight:500;font-stretch:normal;font-style:normal;line-height:1.2;letter-spacing:normal;text-align:center;color:#746de4;cursor:pointer;\"]);exports.LinkButton=LinkButton;var Link=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__Link\",componentId:\"sc-1tugrps-17\"})([\"display:inline-block;font-size:15px;font-weight:500;font-stretch:normal;font-style:normal;line-height:1.2;letter-spacing:normal;text-align:center;color:#746de4;cursor:pointer;\"]);exports.Link=Link;var ListItemLink=/*#__PURE__*/(0,_styledComponents[\"default\"])(Link).withConfig({displayName:\"commonstyle__ListItemLink\",componentId:\"sc-1tugrps-18\"})([\"font-size:13px;margin-left:5px;\"]);exports.ListItemLink=ListItemLink;var FooterText=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__FooterText\",componentId:\"sc-1tugrps-19\"})([\"font-size:15px;text-align:center;margin-top:24px;\"]);exports.FooterText=FooterText;var ErrorMessage=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__ErrorMessage\",componentId:\"sc-1tugrps-20\"})([\"padding:20px;font-size:13px;line-height:1.23;letter-spacing:normal;text-align:center;color:#f73c3c;strong,b{font-weight:bold;}\"]);exports.ErrorMessage=ErrorMessage;var ErrorText=/*#__PURE__*/(0,_styledComponents[\"default\"])(ErrorMessage).withConfig({displayName:\"commonstyle__ErrorText\",componentId:\"sc-1tugrps-21\"})([\"padding:0;text-align:left;min-height:16px;\"]);exports.ErrorText=ErrorText;var ErrorContainer=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__ErrorContainer\",componentId:\"sc-1tugrps-22\"})([\"border-radius:8px;border:solid 1px #ffeaea;background-color:#ffeeee75;overflow:hidden;\"]);exports.ErrorContainer=ErrorContainer;var WarnMessage=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__WarnMessage\",componentId:\"sc-1tugrps-23\"})([\"padding:18px 24px;border-radius:5px;border:solid 1px #fcf2d5;background-color:#fff8e0;font-size:13px;line-height:1.23;text-align:center;color:#000;\"]);exports.WarnMessage=WarnMessage;var FlexContainer=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__FlexContainer\",componentId:\"sc-1tugrps-24\"})([\"display:flex;width:100%;height:\",\";justify-content:space-between;align-items:center;background-color:\",\";@media screen and (max-width:910px){flex-direction:column;height:inherit;}\"],function(_ref2){var isWebviewPage=_ref2.isWebviewPage;return isWebviewPage?\"100vh\":\"calc(100vh - 60px)\";},function(_ref3){var isWebviewPage=_ref3.isWebviewPage;return isWebviewPage?\"transparent\":\"#ffffff\";});exports.FlexContainer=FlexContainer;var LeftBox=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__LeftBox\",componentId:\"sc-1tugrps-25\"})([\"position:relative;z-index:2;background-color:#f8f7fd;width:56%;height:100%;display:flex;align-items:center;justify-content:center;@media screen and (max-width:910px){width:100%;.selected-plan-features,svg{display:none;}}\"]);exports.LeftBox=LeftBox;var RightBox=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__RightBox\",componentId:\"sc-1tugrps-26\"})([\"position:relative;z-index:1;width:44%;height:100%;display:flex;align-items:center;justify-content:center;@media screen and (max-width:910px){width:100%;flex-direction:column;}\"]);exports.RightBox=RightBox;var Wrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__Wrapper\",componentId:\"sc-1tugrps-27\"})([\"width:100%;max-width:360px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;margin:0 auto;\"]);exports.Wrapper=Wrapper;var FormWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__FormWrapper\",componentId:\"sc-1tugrps-28\"})([\"width:100%;max-width:400px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;\"]);exports.FormWrapper=FormWrapper;var Heading=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__Heading\",componentId:\"sc-1tugrps-29\"})([\"width:100%;color:#000;font-size:20px;text-align:center;display:block;font-weight:bold;margin-bottom:\",\";&.login-title,&.register-title{text-align:left;}&.webview{text-align:center;}@media only screen and (max-width:425px){margin:20px 0 20px 0;&.webview{margin:20px 0 0 0;}}\"],function(props){return props.subTitle?\"5px\":\"0\";});exports.Heading=Heading;var SubHeading=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__SubHeading\",componentId:\"sc-1tugrps-30\"})([\"width:100%;color:#999;font-size:13px;text-align:center;font-weight:normal;margin:10px 0 5px 0;&.external{margin-bottom:35px;}\"]);exports.SubHeading=SubHeading;var Form=/*#__PURE__*/_styledComponents[\"default\"].form.withConfig({displayName:\"commonstyle__Form\",componentId:\"sc-1tugrps-31\"})([\"width:100%;margin-top:24px;\"]);exports.Form=Form;var InputWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__InputWrapper\",componentId:\"sc-1tugrps-32\"})([\"width:100%;position:relative;margin:12px auto;&:first-of-type{margin-top:0px;}&:last-of-type{margin-bottom:0px;}.edit-email-icon{position:absolute;top:50%;margin-top:-8px;right:10px;cursor:pointer;}\"]);exports.InputWrapper=InputWrapper;var Input=/*#__PURE__*/_styledComponents[\"default\"].input.withConfig({displayName:\"commonstyle__Input\",componentId:\"sc-1tugrps-33\"})([\"line-height:40px;height:40px;padding:0 10px 0 10px;border:1px solid #ccc;font-size:14px;border-radius:5px;box-sizing:border-box;min-width:initial;width:100%;outline:none;&:disabled{border:solid 1px #ebebeb;background-color:#f4f4f4;color:#888;}&[type=\\\"email\\\"],&:read-only{padding-right:35px !important;}&[type=\\\"password\\\"]{padding-right:35px !important;}\"]);exports.Input=Input;var SigninOptionsWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__SigninOptionsWrapper\",componentId:\"sc-1tugrps-34\"})([\"display:flex;justify-content:space-between;align-items:center;font-size:12px;margin:16px auto;margin-bottom:-14px;label{margin-right:10px;}button{margin-left:10px;}\"]);exports.SigninOptionsWrapper=SigninOptionsWrapper;var MessageBox=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__MessageBox\",componentId:\"sc-1tugrps-35\"})([\"padding:22px;border-radius:8px;box-shadow:0 2px 0 0 rgba(0,0,0,0.02);border:solid 1px #e8e7ff;background-color:#fafafe;display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;svg{margin-right:20px;flex-shrink:0;}&:last-of-type{margin-bottom:0px;}\"]);exports.MessageBox=MessageBox;var MessageBoxVerify=/*#__PURE__*/(0,_styledComponents[\"default\"])(MessageBox).withConfig({displayName:\"commonstyle__MessageBoxVerify\",componentId:\"sc-1tugrps-36\"})([\"margin-bottom:10px;\"]);exports.MessageBoxVerify=MessageBoxVerify;var MessageBoxDelete=/*#__PURE__*/(0,_styledComponents[\"default\"])(MessageBox).withConfig({displayName:\"commonstyle__MessageBoxDelete\",componentId:\"sc-1tugrps-37\"})([\"align-items:flex-start;margin-bottom:32px;\"]);exports.MessageBoxDelete=MessageBoxDelete;var Message=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__Message\",componentId:\"sc-1tugrps-38\"})([\"font-size:13px;text-align:left;color:#000;width:100%;line-height:20px;strong,b{font-weight:bold;}span{max-height:20px;}.ellipsis{font-weight:bold;text-overflow:ellipsis;max-width:235px;white-space:nowrap;display:inline-block;overflow:hidden;vertical-align:bottom;}\"]);exports.Message=Message;var MessageVerify=/*#__PURE__*/(0,_styledComponents[\"default\"])(Message).withConfig({displayName:\"commonstyle__MessageVerify\",componentId:\"sc-1tugrps-39\"})([\".ellipsis{max-width:325px;}\"]);exports.MessageVerify=MessageVerify;var ErrorBox=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__ErrorBox\",componentId:\"sc-1tugrps-40\"})([\"display:flex;align-items:center;justify-content:center;margin-bottom:5px;svg{display:none;}&:last-of-type{margin-bottom:0px;}\"]);exports.ErrorBox=ErrorBox;var Button=/*#__PURE__*/_styledComponents[\"default\"].button.withConfig({displayName:\"commonstyle__Button\",componentId:\"sc-1tugrps-41\"})([\"font-family:inherit !important;width:100%;height:32px;padding:6px 10px;border-radius:4px;background-color:#17bed0;border:none;font-size:14px;font-weight:600;text-align:center;color:#fff;cursor:pointer;&:disabled{background-color:#f3f2f1;color:#a19f9d;cursor:auto;}\"]);exports.Button=Button;var ButtonWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__ButtonWrapper\",componentId:\"sc-1tugrps-42\"})([\"margin-top:30px;position:relative;\"]);exports.ButtonWrapper=ButtonWrapper;var ButtonLink=/*#__PURE__*/_styledComponents[\"default\"].button.withConfig({displayName:\"commonstyle__ButtonLink\",componentId:\"sc-1tugrps-43\"})([\"font-size:\",\";font-family:inherit !important;background-color:transparent;border:none;color:\",\";padding:0;cursor:pointer;\"],function(_ref4){var fontSize=_ref4.fontSize;return fontSize||\"0.813rem\";},function(_ref5){var color=_ref5.color;return color||\"#17bed0\";});exports.ButtonLink=ButtonLink;var FooterLink=/*#__PURE__*/(0,_styledComponents[\"default\"])(ButtonLink).withConfig({displayName:\"commonstyle__FooterLink\",componentId:\"sc-1tugrps-44\"})([\"font-size:0.875rem;margin-left:0.25rem;\"]);exports.FooterLink=FooterLink;var SocialButtonWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__SocialButtonWrapper\",componentId:\"sc-1tugrps-45\"})([\"width:100%;max-width:350px;\"]);exports.SocialButtonWrapper=SocialButtonWrapper;var SocialButton=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__SocialButton\",componentId:\"sc-1tugrps-46\"})([\"position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:calc(33% - 6px);height:40px;line-height:40px;text-align:center;border:none;border-radius:8px;background-color:#f2f2f4;cursor:pointer;\"]);exports.SocialButton=SocialButton;var ContinueWith=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__ContinueWith\",componentId:\"sc-1tugrps-47\"})([\"font-size:12px;text-align:center;color:#a19f9d;margin:10px auto;\"]);exports.ContinueWith=ContinueWith;var Footer=/*#__PURE__*/_styledComponents[\"default\"].footer.withConfig({displayName:\"commonstyle__Footer\",componentId:\"sc-1tugrps-48\"})([\"width:100%;margin:0 auto;margin-top:24px;padding:0;text-align:center;background:transparent;height:auto;&:hover{background-color:transparent;color:#000;}\"]);exports.Footer=Footer;var ListItem=/*#__PURE__*/_styledComponents[\"default\"].li.withConfig({displayName:\"commonstyle__ListItem\",componentId:\"sc-1tugrps-49\"})([\"font-family:Roboto;font-size:13px;font-weight:normal;font-stretch:normal;font-style:normal;line-height:1.38;letter-spacing:normal;text-align:left;margin-bottom:15px;margin-left:10px;\"]);exports.ListItem=ListItem;var ModalContentWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"commonstyle__ModalContentWrapper\",componentId:\"sc-1tugrps-50\"})([\"max-height:calc(85vh - 215px);min-height:300px;overflow-y:auto;box-sizing:content-box;padding:5px;margin-bottom:25px;&::-webkit-scrollbar{width:5px;border-radius:3px;}&::-webkit-scrollbar-track{background:#eaeaea;border-radius:3px;}&::-webkit-scrollbar-thumb{background:#aaa;border-radius:3px;transition:background 200ms ease-in-out;}&::-webkit-scrollbar-thumb:hover{background:#555;}\"]);exports.ModalContentWrapper=ModalContentWrapper;","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.resetByCodeAccountMethod=exports.registerUserMethod=exports.pcloudTokenInit=exports.loginUserMethod=exports.changeKeysByEmail=void 0;var _objectWithoutProperties2=_interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));var _regenerator=_interopRequireDefault(require(\"@babel/runtime/regenerator\"));var _defineProperty2=_interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));var _asyncToGenerator2=_interopRequireDefault(require(\"@babel/runtime/helpers/asyncToGenerator\"));var _utils=require(\"../../../lib/utils\");var _userSlice=require(\"../../../lib/state/reducers/pass/userSlice\");var _layoutSlice=require(\"../../../lib/state/reducers/pass/layoutSlice\");var _utils2=require(\"./utils.pass\");var _constants=require(\"../../components/passUserAuthentication/constants.pass\");var _passMethods=require(\"../../../lib/passMethods\");var _store=_interopRequireDefault(require(\"../../../lib/state/store\"));var _apiMethod=_interopRequireDefault(require(\"../../../api/apiMethod\"));var _excluded=[\"result\"],_excluded2=[\"result\"];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 _objectSpread(target){for(var i=1;i {\n// console.error(ret);\n// getCloudToken({ auth: passToken }).then(({ result, cloudtoken, locationid }) => {\n// if (result === 0) {\n// setPcloudTokenSuccess({ pcauth: cloudtoken, locationid }, opts);\n// }\n// });\n// }\n);}};exports.pcloudTokenInit=pcloudTokenInit;var onSuccessLogin=/*#__PURE__*/function(){var _ref7=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee(pcloudLoginData,opts){var isDesktop,returnAppFocus,_opts$onSuccessCb,onSuccessCb;return _regenerator[\"default\"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:console.log(\"@!!!!!!!!!!!!!!!!!!!!!!!!111\",opts);isDesktop=opts.isDesktop,returnAppFocus=opts.returnAppFocus,_opts$onSuccessCb=opts.onSuccessCb,onSuccessCb=_opts$onSuccessCb===void 0?function(){}:_opts$onSuccessCb;if(isDesktop){returnAppFocus();}try{// await db.setSecuritySettings({ lastDbVersion: db.verno });\n}catch(error){console.log(\"🚀 ~ file: methods.js:182 ~ onSuccessLogin ~ error\",error);}setPassTokenSuccess(pcloudLoginData,opts);setUserInfoSuccess(pcloudLoginData,opts);pcloudTokenInit(pcloudLoginData,opts);onSuccessCb();case 8:case\"end\":return _context.stop();}},_callee);}));return function onSuccessLogin(_x,_x2){return _ref7.apply(this,arguments);};}();var loginUserMethod=/*#__PURE__*/function(){var _ref8=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee2(params,opts){var _opts$onError2,onError,userPrivateKey,loginResponse;return _regenerator[\"default\"].wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_opts$onError2=opts.onError,onError=_opts$onError2===void 0?function(){}:_opts$onError2,userPrivateKey=opts.userPrivateKey;_context2.prev=1;_context2.next=4;return(0,_passMethods.loginAccount)(params,userPrivateKey);case 4:loginResponse=_context2.sent;console.log(\"login response !!!!!!!! \",loginResponse,opts,params);onSuccessLogin(_objectSpread({},loginResponse),opts);_context2.next=12;break;case 9:_context2.prev=9;_context2.t0=_context2[\"catch\"](1);onError(_context2.t0);case 12:case\"end\":return _context2.stop();}},_callee2,null,[[1,9]]);}));return function loginUserMethod(_x3,_x4){return _ref8.apply(this,arguments);};}();exports.loginUserMethod=loginUserMethod;var registerUserMethod=/*#__PURE__*/function(){var _ref9=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee3(params,opts){var _opts$onError3,onError,_yield$registerAccoun,result,restData;return _regenerator[\"default\"].wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_opts$onError3=opts.onError,onError=_opts$onError3===void 0?function(){}:_opts$onError3;_context3.prev=1;_context3.next=4;return(0,_passMethods.registerAccount)(params);case 4:_yield$registerAccoun=_context3.sent;result=_yield$registerAccoun.result;restData=(0,_objectWithoutProperties2[\"default\"])(_yield$registerAccoun,_excluded);if(result===0){onSuccessLogin(_objectSpread({},restData),opts);}else{onError(result);}_context3.next=13;break;case 10:_context3.prev=10;_context3.t0=_context3[\"catch\"](1);onError(_context3.t0);case 13:case\"end\":return _context3.stop();}},_callee3,null,[[1,10]]);}));return function registerUserMethod(_x5,_x6){return _ref9.apply(this,arguments);};}();exports.registerUserMethod=registerUserMethod;var resetByCodeAccountMethod=/*#__PURE__*/function(){var _ref10=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee4(params,opts){var _opts$onError4,onError,_yield$resetByCodeAcc,result,restData;return _regenerator[\"default\"].wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:console.log(\"resetByCodeAccountMethod \",params,opts);_opts$onError4=opts.onError,onError=_opts$onError4===void 0?function(){}:_opts$onError4;_context4.prev=2;_context4.next=5;return(0,_passMethods.resetByCodeAccount)(params);case 5:_yield$resetByCodeAcc=_context4.sent;result=_yield$resetByCodeAcc.result;restData=(0,_objectWithoutProperties2[\"default\"])(_yield$resetByCodeAcc,_excluded2);if(result===0){onSuccessLogin(_objectSpread({},restData),opts);}else{onError();}_context4.next=14;break;case 11:_context4.prev=11;_context4.t0=_context4[\"catch\"](2);onError(_context4.t0);case 14:case\"end\":return _context4.stop();}},_callee4,null,[[2,11]]);}));return function resetByCodeAccountMethod(_x7,_x8){return _ref10.apply(this,arguments);};}();exports.resetByCodeAccountMethod=resetByCodeAccountMethod;var changeKeysByEmail=/*#__PURE__*/function(){var _ref11=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee5(params,opts){var _opts$onError5,onError,response;return _regenerator[\"default\"].wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_opts$onError5=opts.onError,onError=_opts$onError5===void 0?function(){}:_opts$onError5;_context5.prev=1;_context5.next=4;return(0,_passMethods.changeKeys)(params);case 4:response=_context5.sent;onSuccessLogin(_objectSpread({},response),opts);_context5.next=11;break;case 8:_context5.prev=8;_context5.t0=_context5[\"catch\"](1);onError(_context5.t0);case 11:case\"end\":return _context5.stop();}},_callee5,null,[[1,8]]);}));return function changeKeysByEmail(_x9,_x10){return _ref11.apply(this,arguments);};}();exports.changeKeysByEmail=changeKeysByEmail;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});exports.sendLoginSuccessMessage=exports.detectOS=void 0;var sendLoginSuccessMessage=function sendLoginSuccessMessage(_ref){var pcauth=_ref.pcauth,locationid=_ref.locationid,isProduction=_ref.isProduction;var targetOrigin=isProduction?\"https://www.pcloud.com\":\"*\";window.parent.postMessage({message:\"pass-login-success\"// data: {\n// pcauth,\n// locationid\n// }\n},targetOrigin);};exports.sendLoginSuccessMessage=sendLoginSuccessMessage;var detectOS=function detectOS(showVersion,shortOS){var os;var result;var osVersion;var nAgt=navigator.userAgent;var nVer=navigator.appVersion;var clientStrings=[{s:'Windows 10',r:/(Windows 10|Windows NT 10.0)/},{s:'Windows 8',r:/(Windows 8.1|Windows NT 6.3)/},{s:'Windows 8',r:/(Windows 8|Windows NT 6.2)/},{s:'Windows 7',r:/(Windows 7|Windows NT 6.1)/},{s:'Windows Vista',r:/Windows NT 6.0/},{s:'Windows Server 2003',r:/Windows NT 5.2/},{s:'Windows XP',r:/(Windows NT 5.1|Windows XP)/},{s:'Windows 2000',r:/(Windows NT 5.0|Windows 2000)/},{s:'Windows ME',r:/(Win 9x 4.90|Windows ME)/},{s:'Windows 98',r:/(Windows 98|Win98)/},{s:'Windows 95',r:/(Windows 95|Win95|Windows_95)/},{s:'Windows NT 4.0',r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:'Windows CE',r:/Windows CE/},{s:'Windows 3.11',r:/Win16/},{s:'Windows Phone',r:/Windows Phone/},{s:'Android',r:/Android/},{s:'Open BSD',r:/OpenBSD/},{s:'Sun OS',r:/SunOS/},{s:'Linux',r:/(Linux|X11)/},{s:'iOS',r:/(iPhone|iPad|iPod)/},{s:'Mac OS X',r:/Mac OS X/},{s:'Mac OS',r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:'QNX',r:/QNX/},{s:'UNIX',r:/UNIX/},{s:'BeOS',r:/BeOS/},{s:'OS/2',r:/OS\\/2/},{s:'Search Bot',r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\\/Teoma|ia_archiver)/}];for(var id in clientStrings){var cs=clientStrings[id];if(cs.r.test(nAgt)){os=cs.s;break;}}if(/Windows/.test(os)){osVersion=/Windows (.*)/.exec(os)[1];os='Windows';}switch(os){case'Android':osVersion=/Android ([\\.\\_\\d]+)/.exec(nAgt)[1];break;case'iOS':osVersion=/OS (\\d+)_(\\d+)_?(\\d+)?/.exec(nVer);osVersion=osVersion[1]+'.'+osVersion[2]+'.'+(osVersion[3]|0);break;case'Linux':osVersion=nVer.indexOf(\"Linux i686\")!=-1?'32bit':'64bit';}if(!os){os='Linux';}result=os+(osVersion?' '+osVersion:'');if(showVersion){result=osVersion;}if(shortOS){result=osVersion=='Phone'?os+' phone':os.split(' ')[0].replace(/\\d+/,'');result=result.toLowerCase();}return result;};exports.detectOS=detectOS;","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.verifyTokenTFAWithCode=exports.verifyTokenTFAWithBackupCode=exports.verifyResetCode=exports.verifyRegisterCode=exports.unlockAccount=exports.switchActiveDevice=exports.resetByCodeAccount=exports.resetAccount=exports.registerAccount=exports.prepareReset=exports.prepareRegister=exports.onLogoutUserSuccess=exports.logoutUser=exports.loginAccount=exports.getKeysByEmail=exports.getKeys=exports.getInviteRequestInfo=exports.getInvitationInfo=exports.getCloudToken=exports.changeKeys=void 0;var _objectWithoutProperties2=_interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));var _regenerator=_interopRequireDefault(require(\"@babel/runtime/regenerator\"));var _defineProperty2=_interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));var _asyncToGenerator2=_interopRequireDefault(require(\"@babel/runtime/helpers/asyncToGenerator\"));var _pmenc=require(\"@pcloud/pmenc\");var _passApi=require(\"../api/passApi\");var _utils=require(\"./utils\");var _store=_interopRequireDefault(require(\"../lib/state/store\"));var _userSlice=require(\"./state/reducers/pass/userSlice\");var _excluded=[\"email\",\"termsaccepted\"],_excluded2=[\"email\",\"code\",\"privatekey\",\"publickey\",\"termsaccepted\",\"userPrivateKey\"],_excluded3=[\"auth\",\"email\",\"code\",\"privatekey\",\"publickey\",\"userPrivateKey\"];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 _objectSpread(target){for(var i=1;i {\n// resetDatabase();\n// store.dispatch(setIsUnlocked(false));\n// store.dispatch(openModal(\"\"));\n// store.dispatch(setModalProps({}));\n// };\nexports.changeKeys=changeKeys;var unlockAccount=/*#__PURE__*/function(){var _ref24=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee14(_ref23){var password,publicKey,encryptedPrivateKey,onSuccess,onError,data,privateKey,invertPrivateKey,_args14=arguments;return _regenerator[\"default\"].wrap(function _callee14$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:password=_ref23.password,publicKey=_ref23.publicKey,encryptedPrivateKey=_ref23.encryptedPrivateKey;onSuccess=_args14.length>1&&_args14[1]!==undefined?_args14[1]:function(){};onError=_args14.length>2?_args14[2]:undefined;_context14.next=5;return _pmenc.ppassWeb.decryptMasterPasswordFromPassword(password,publicKey,encryptedPrivateKey);case 5:data=_context14.sent;console.log(\"UNLOCK DATA\",{password:password,publicKey:publicKey,encryptedPrivateKey:encryptedPrivateKey},data);if(data){privateKey=data.privateKey,invertPrivateKey=data.invertPrivateKey;console.log(\"unlock Account data \",privateKey,invertPrivateKey);try{// await db.addKeys({ privateKey, invertPrivKey: invertPrivateKey });\nonSuccess({privateKey:privateKey,invertPrivKey:invertPrivateKey});try{// await db.setSecuritySettings({ lastDbVersion: db.verno });\n}catch(error){console.log(\"🚀 ~ file: passMethods.js:647 ~ unlockAccount ~ error\",error);}_store[\"default\"].dispatch((0,_userSlice.setIsUnlocked)(true));// onSuccess();\n}catch(error){onError(error);console.log(\"🚀 ~ file: SetPassStepAction.js ~ line 45 ~ addKeys ~ error\",error);}}else{onError();}case 8:case\"end\":return _context14.stop();}},_callee14);}));return function unlockAccount(_x17){return _ref24.apply(this,arguments);};}();exports.unlockAccount=unlockAccount;var onLogoutUserSuccess=function onLogoutUserSuccess(_ref25){var _ref25$isDesktop=_ref25.isDesktop,isDesktop=_ref25$isDesktop===void 0?false:_ref25$isDesktop,_ref25$isExtension=_ref25.isExtension,isExtension=_ref25$isExtension===void 0?false:_ref25$isExtension,_ref25$resetDesktopSe=_ref25.resetDesktopSettings,resetDesktopSettings=_ref25$resetDesktopSe===void 0?function(){}:_ref25$resetDesktopSe,_ref25$resetExtension=_ref25.resetExtensionSettings,resetExtensionSettings=_ref25$resetExtension===void 0?function(){}:_ref25$resetExtension,_ref25$resetDatabase=_ref25.resetDatabase,resetDatabase=_ref25$resetDatabase===void 0?function(){}:_ref25$resetDatabase;var state=_store[\"default\"].getState();var _state$passUser=state.passUser,_state$passUser2=_state$passUser===void 0?{}:_state$passUser,token=_state$passUser2.passToken.token,pcloudToken=_state$passUser2.pcloudToken,isDesktopSleepMode=_state$passUser2.isDesktopSleepMode;if(!pcloudToken&&!token){return;}if(isDesktop&&isDesktopSleepMode){return;}console.log(\"LOGOUT\");if(isExtension||isDesktop){setItemToLocalStorage({locationid:\"\"});setItemToLocalStorage({pcauth:\"\"});setItemToLocalStorage({passtoken:\"\"});setItemToLocalStorage({restrictedPassToken:\"\"});}else{(0,_utils.setcookie)(\"restrictedPassToken\",\"\",-1);(0,_utils.setcookie)(\"passtoken\",\"\",-1);}_store[\"default\"].dispatch((0,_userSlice.setDataFetched)(false));_store[\"default\"].dispatch((0,_userSlice.deleteUserInfo)());_store[\"default\"].dispatch((0,_userSlice.setLogged)(false));_store[\"default\"].dispatch((0,_userSlice.deletePassToken)());_store[\"default\"].dispatch((0,_userSlice.setRestrictedPassToken)(\"\"));_store[\"default\"].dispatch((0,_userSlice.setIsUnlocked)(false));_store[\"default\"].dispatch((0,_userSlice.setIsUnlocked)(false));_store[\"default\"].dispatch((0,_userSlice.setSwitchDeviceData)({canSwitchDevice:false,currentActiveDevice:\"\",currentActiveOs:\"\",switchDeviceError:false}));if(typeof localStorage!==\"undefined\"){if(isDesktop){localStorage.removeItem(\"persist:root\");localStorage.removeItem(\"lockInterval\");localStorage.removeItem(\"lockOnEvent\");}else{localStorage.clear();}// localStorage.clear();\n}if(isExtension){resetExtensionSettings();}if(isDesktop){resetDesktopSettings();// setDefaultDesktopSettings(); //TODO\n}resetDatabase();};exports.onLogoutUserSuccess=onLogoutUserSuccess;var logoutUser=/*#__PURE__*/function(){var _ref27=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee15(_ref26){var _ref26$isDesktop,isDesktop,_ref26$isExtension,isExtension,_ref26$resetDesktopSe,resetDesktopSettings,_ref26$resetExtension,resetExtensionSettings,_ref26$onSuccess,onSuccess,_ref26$resetDatabase,resetDatabase,state,_state$passUser3,_state$passUser4,token;return _regenerator[\"default\"].wrap(function _callee15$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:_ref26$isDesktop=_ref26.isDesktop,isDesktop=_ref26$isDesktop===void 0?false:_ref26$isDesktop,_ref26$isExtension=_ref26.isExtension,isExtension=_ref26$isExtension===void 0?false:_ref26$isExtension,_ref26$resetDesktopSe=_ref26.resetDesktopSettings,resetDesktopSettings=_ref26$resetDesktopSe===void 0?function(){}:_ref26$resetDesktopSe,_ref26$resetExtension=_ref26.resetExtensionSettings,resetExtensionSettings=_ref26$resetExtension===void 0?function(){}:_ref26$resetExtension,_ref26$onSuccess=_ref26.onSuccess,onSuccess=_ref26$onSuccess===void 0?function(){}:_ref26$onSuccess,_ref26$resetDatabase=_ref26.resetDatabase,resetDatabase=_ref26$resetDatabase===void 0?function(){}:_ref26$resetDatabase;state=_store[\"default\"].getState();_state$passUser3=state.passUser,_state$passUser4=_state$passUser3===void 0?{}:_state$passUser3,token=_state$passUser4.passToken.token;if(token){_context15.next=5;break;}return _context15.abrupt(\"return\");case 5:return _context15.abrupt(\"return\",logout({auth:token}).then(function(_ref28){var result=_ref28.result;if(result===0){onLogoutUserSuccess({isDesktop:isDesktop,isExtension:isExtension,resetDesktopSettings:resetDesktopSettings,resetExtensionSettings:resetExtensionSettings,resetDatabase:resetDatabase});onSuccess();}})[\"catch\"](function(error){console.log(\"🚀 ~ file: passMethods.js ~ line 586 ~ .then ~ error\",error);}));case 6:case\"end\":return _context15.stop();}},_callee15);}));return function logoutUser(_x18){return _ref27.apply(this,arguments);};}();/* 2FA */ // export const getSecret = async ({ auth }) => {\n// const method = \"user/tfa/getsecret\";\n// const data = await signData(method, []);\n// const { signature, timestamp } = data;\n// return passApiMethod(method, {\n// auth,\n// signature,\n// timestamp,\n// });\n// };\n// export const activateTFA = async ({ auth, code, secret }) => {\n// const method = \"user/tfa/activate\";\n// const data = await signData(method, [code, secret]);\n// const { signature, timestamp } = data;\n// return passApiMethod(method, {\n// auth,\n// code,\n// secret,\n// signature,\n// timestamp,\n// });\n// };\n// export const getRecoveryCodeTFA = async ({ auth }) => {\n// const method = \"user/tfa/getrecoverycodes\";\n// const data = await signData(method, []);\n// const { signature, timestamp } = data;\n// return passApiMethod(method, {\n// auth,\n// signature,\n// timestamp,\n// });\n// };\n// export const deactivateTFA = async ({ auth }) => {\n// const method = \"user/tfa/deactivate\";\n// const data = await signData(method, []);\n// const { signature, timestamp } = data;\n// return passApiMethod(method, {\n// auth,\n// signature,\n// timestamp,\n// });\n// };\n// export const resetRecoveryCodesTFA = async ({ auth }) => {\n// const method = \"user/tfa/resetrecoverycodes\";\n// const data = await signData(method, []);\n// const { signature, timestamp } = data;\n// return passApiMethod(method, {\n// auth,\n// signature,\n// timestamp,\n// });\n// };\n// /* 2FA */\n/* 2FA LOGIN*/exports.logoutUser=logoutUser;var verifyTokenTFAWithCode=/*#__PURE__*/function(){var _ref30=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee16(_ref29){var token,code,method;return _regenerator[\"default\"].wrap(function _callee16$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:token=_ref29.token,code=_ref29.code;method=\"user/tfa/verifytoken\";return _context16.abrupt(\"return\",(0,_passApi.passApiMethod)(method,{token:token,code:code}));case 3:case\"end\":return _context16.stop();}},_callee16);}));return function verifyTokenTFAWithCode(_x19){return _ref30.apply(this,arguments);};}();exports.verifyTokenTFAWithCode=verifyTokenTFAWithCode;var verifyTokenTFAWithBackupCode=/*#__PURE__*/function(){var _ref32=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee17(_ref31){var token,recoverycode,method;return _regenerator[\"default\"].wrap(function _callee17$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:token=_ref31.token,recoverycode=_ref31.recoverycode;method=\"user/tfa/verifytoken\";return _context17.abrupt(\"return\",(0,_passApi.passApiMethod)(method,{token:token,recoverycode:recoverycode}));case 3:case\"end\":return _context17.stop();}},_callee17);}));return function verifyTokenTFAWithBackupCode(_x20){return _ref32.apply(this,arguments);};}();/* 2FA LOGIN*/exports.verifyTokenTFAWithBackupCode=verifyTokenTFAWithBackupCode;var switchActiveDevice=/*#__PURE__*/function(){var _ref34=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee18(_ref33){var auth,os;return _regenerator[\"default\"].wrap(function _callee18$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:auth=_ref33.auth,os=_ref33.os;return _context18.abrupt(\"return\",(0,_passApi.passApiMethod)(\"user/setactivedevice\",{auth:auth,os:os}));case 2:case\"end\":return _context18.stop();}},_callee18);}));return function switchActiveDevice(_x21){return _ref34.apply(this,arguments);};}();/* FAMILY */exports.switchActiveDevice=switchActiveDevice;var getInvitationInfo=/*#__PURE__*/function(){var _ref35=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee19(familyinvitecode){return _regenerator[\"default\"].wrap(function _callee19$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:return _context19.abrupt(\"return\",(0,_passApi.passApiMethod)(\"family/getinvitationinfo\",familyinvitecode));case 1:case\"end\":return _context19.stop();}},_callee19);}));return function getInvitationInfo(_x22){return _ref35.apply(this,arguments);};}();exports.getInvitationInfo=getInvitationInfo;var getInviteRequestInfo=/*#__PURE__*/function(){var _ref36=(0,_asyncToGenerator2[\"default\"])(/*#__PURE__*/_regenerator[\"default\"].mark(function _callee20(inviterequestcode){return _regenerator[\"default\"].wrap(function _callee20$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:return _context20.abrupt(\"return\",(0,_passApi.passApiMethod)(\"contact/getinviterequestinfo\",inviterequestcode));case 1:case\"end\":return _context20.stop();}},_callee20);}));return function getInviteRequestInfo(_x23){return _ref36.apply(this,arguments);};}();exports.getInviteRequestInfo=getInviteRequestInfo;","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");var _typeof=require(\"@babel/runtime/helpers/typeof\");Object.defineProperty(exports,\"__esModule\",{value:true});exports[\"default\"]=void 0;var _react=_interopRequireDefault(require(\"react\"));var _styledComponents=_interopRequireDefault(require(\"styled-components\"));var _langManager=require(\"../../lib/langManager\");var _edit_email=_interopRequireDefault(require(\"../../../src/resources/images/pcloud-pass/edit_email.svg\"));var Style=_interopRequireWildcard(require(\"../../authentication/components/passUserAuthentication/common.style\"));function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!==\"function\")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||_typeof(obj)!==\"object\"&&typeof obj!==\"function\"){return{\"default\":obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!==\"default\"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj[\"default\"]=obj;if(cache){cache.set(obj,newObj);}return newObj;}//done\n//done\n//done\nvar InputEmail=function InputEmail(_ref){var _ref$value=_ref.value,value=_ref$value===void 0?\"\":_ref$value,_ref$placeholder=_ref.placeholder,placeholder=_ref$placeholder===void 0?\"email_input_placeholder\":_ref$placeholder,_ref$readOnly=_ref.readOnly,readOnly=_ref$readOnly===void 0?false:_ref$readOnly,_ref$onChange=_ref.onChange,onChange=_ref$onChange===void 0?function(){}:_ref$onChange,_ref$onEditClick=_ref.onEditClick,onEditClick=_ref$onEditClick===void 0?function(){}:_ref$onEditClick,_ref$customInputStyle=_ref.customInputStyle,customInputStyle=_ref$customInputStyle===void 0?{}:_ref$customInputStyle;return/*#__PURE__*/_react[\"default\"].createElement(Wrapper,null,/*#__PURE__*/_react[\"default\"].createElement(Style.StyledInput,{type:\"email\",placeholder:(0,_langManager.__)(placeholder),value:value,onChange:onChange,readOnly:readOnly,disabled:readOnly,autoFocus:true,autoComplete:\"on\",style:customInputStyle.style}),readOnly?/*#__PURE__*/_react[\"default\"].createElement(EditWrapper,null,/*#__PURE__*/_react[\"default\"].createElement(_edit_email[\"default\"],{onClick:onEditClick})):null);};var _default=InputEmail;exports[\"default\"]=_default;var Wrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"InputEmail__Wrapper\",componentId:\"sc-10iyu8x-0\"})([\"position:relative;\"]);var EditWrapper=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"InputEmail__EditWrapper\",componentId:\"sc-10iyu8x-1\"})([\"position:absolute;top:12px;right:12px;cursor:pointer;\"]);","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");var _typeof=require(\"@babel/runtime/helpers/typeof\");Object.defineProperty(exports,\"__esModule\",{value:true});exports[\"default\"]=void 0;var _defineProperty2=_interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));var _slicedToArray2=_interopRequireDefault(require(\"@babel/runtime/helpers/slicedToArray\"));var _react=_interopRequireWildcard(require(\"react\"));var _reactTooltip=require(\"react-tooltip\");var _styledComponents=_interopRequireDefault(require(\"styled-components\"));var _TransitionAnimation=_interopRequireDefault(require(\"../../resources/components/Animation/TransitionAnimation\"));var _common=require(\"../../authentication/components/Forms/common.style\");var _pass_view=_interopRequireDefault(require(\"../../resources/images/svg/pass_view.svg\"));var _pass_hide=_interopRequireDefault(require(\"../../resources/images/svg/pass_hide.svg\"));var _passGenerator=_interopRequireDefault(require(\"../../resources/images/pcloud-pass/pass-generator.svg\"));var Style=_interopRequireWildcard(require(\"../../authentication/components/passUserAuthentication/common.style\"));var _copy_pass_base=_interopRequireDefault(require(\"../../resources/images/pcloud-pass/copy_pass_base.svg\"));var _utils=require(\"../../lib/utils\");var _langManager=require(\"../../lib/langManager\");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!==\"function\")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||_typeof(obj)!==\"object\"&&typeof obj!==\"function\"){return{\"default\":obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!==\"default\"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj[\"default\"]=obj;if(cache){cache.set(obj,newObj);}return newObj;}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 _objectSpread(target){for(var i=1;i input{outline:none;border-color:#fe5a5a;}}input{width:40px;height:48px;box-sizing:border-box;border-radius:5px;border:solid 1px #a1a1a1;line-height:1;font-size:26px;padding:10px;text-align:center;&:nth-child(\",\"){margin-right:8px;}&:focus{outline:none;border-color:#7c7c7c;}}\"],function(_ref2){var chunk=_ref2.chunk;return chunk;});var ErrorMessage=/*#__PURE__*/_styledComponents[\"default\"].div.withConfig({displayName:\"VerificationCodeInputs__ErrorMessage\",componentId:\"sc-frlhe7-2\"})([\"font-size:13px;font-weight:600;color:#fe5a5a;text-align:left;grid-template-columns:repeat(\",\",40px [col-start]);display:grid;column-gap:8px;& > span{min-height:16px;display:grid;grid-column-start:1;grid-column-end:\",\";}\"],function(_ref3){var codelength=_ref3.codelength;return codelength;},function(_ref4){var codelength=_ref4.codelength;return codelength-1;});","\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.RecoveryWordsList=void 0;var _styledComponents=_interopRequireDefault(require(\"styled-components\"));var RecoveryWordsList=/*#__PURE__*/_styledComponents[\"default\"].p.withConfig({displayName:\"recoveryWordsstyle__RecoveryWordsList\",componentId:\"sc-15siag3-0\"})([\"font-size:17px;font-weight:500;line-height:1.59;letter-spacing:normal;text-align:center;color:#000;word-spacing:16px;\"]);exports.RecoveryWordsList=RecoveryWordsList;","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t `'${s}'`).join(\",\") : \"\"\n\t\t}. Find the full error at: https://bit.ly/3cXEKWf`\n\t)\n}\n","import {\n\tDRAFT_STATE,\n\tDRAFTABLE,\n\thasSet,\n\tObjectish,\n\tDrafted,\n\tAnyObject,\n\tAnyMap,\n\tAnySet,\n\tImmerState,\n\thasMap,\n\tArchtype,\n\tdie\n} from \"../internal\"\n\n/** Returns true if the given value is an Immer draft */\n/*#__PURE__*/\nexport function isDraft(value: any): boolean {\n\treturn !!value && !!value[DRAFT_STATE]\n}\n\n/** Returns true if the given value can be drafted by Immer */\n/*#__PURE__*/\nexport function isDraftable(value: any): boolean {\n\tif (!value) return false\n\treturn (\n\t\tisPlainObject(value) ||\n\t\tArray.isArray(value) ||\n\t\t!!value[DRAFTABLE] ||\n\t\t!!value.constructor?.[DRAFTABLE] ||\n\t\tisMap(value) ||\n\t\tisSet(value)\n\t)\n}\n\nconst objectCtorString = Object.prototype.constructor.toString()\n/*#__PURE__*/\nexport function isPlainObject(value: any): boolean {\n\tif (!value || typeof value !== \"object\") return false\n\tconst proto = Object.getPrototypeOf(value)\n\tif (proto === null) {\n\t\treturn true\n\t}\n\tconst Ctor =\n\t\tObject.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n\n\tif (Ctor === Object) return true\n\n\treturn (\n\t\ttypeof Ctor == \"function\" &&\n\t\tFunction.toString.call(Ctor) === objectCtorString\n\t)\n}\n\n/** Get the underlying object that is represented by the given draft */\n/*#__PURE__*/\nexport function original(value: T): T | undefined\nexport function original(value: Drafted): any {\n\tif (!isDraft(value)) die(23, value)\n\treturn value[DRAFT_STATE].base_\n}\n\n/*#__PURE__*/\nexport const ownKeys: (target: AnyObject) => PropertyKey[] =\n\ttypeof Reflect !== \"undefined\" && Reflect.ownKeys\n\t\t? Reflect.ownKeys\n\t\t: typeof Object.getOwnPropertySymbols !== \"undefined\"\n\t\t? obj =>\n\t\t\t\tObject.getOwnPropertyNames(obj).concat(\n\t\t\t\t\tObject.getOwnPropertySymbols(obj) as any\n\t\t\t\t)\n\t\t: /* istanbul ignore next */ Object.getOwnPropertyNames\n\nexport const getOwnPropertyDescriptors =\n\tObject.getOwnPropertyDescriptors ||\n\tfunction getOwnPropertyDescriptors(target: any) {\n\t\t// Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n\t\tconst res: any = {}\n\t\townKeys(target).forEach(key => {\n\t\t\tres[key] = Object.getOwnPropertyDescriptor(target, key)\n\t\t})\n\t\treturn res\n\t}\n\nexport function each(\n\tobj: T,\n\titer: (key: string | number, value: any, source: T) => void,\n\tenumerableOnly?: boolean\n): void\nexport function each(obj: any, iter: any, enumerableOnly = false) {\n\tif (getArchtype(obj) === Archtype.Object) {\n\t\t;(enumerableOnly ? Object.keys : ownKeys)(obj).forEach(key => {\n\t\t\tif (!enumerableOnly || typeof key !== \"symbol\") iter(key, obj[key], obj)\n\t\t})\n\t} else {\n\t\tobj.forEach((entry: any, index: any) => iter(index, entry, obj))\n\t}\n}\n\n/*#__PURE__*/\nexport function getArchtype(thing: any): Archtype {\n\t/* istanbul ignore next */\n\tconst state: undefined | ImmerState = thing[DRAFT_STATE]\n\treturn state\n\t\t? state.type_ > 3\n\t\t\t? state.type_ - 4 // cause Object and Array map back from 4 and 5\n\t\t\t: (state.type_ as any) // others are the same\n\t\t: Array.isArray(thing)\n\t\t? Archtype.Array\n\t\t: isMap(thing)\n\t\t? Archtype.Map\n\t\t: isSet(thing)\n\t\t? Archtype.Set\n\t\t: Archtype.Object\n}\n\n/*#__PURE__*/\nexport function has(thing: any, prop: PropertyKey): boolean {\n\treturn getArchtype(thing) === Archtype.Map\n\t\t? thing.has(prop)\n\t\t: Object.prototype.hasOwnProperty.call(thing, prop)\n}\n\n/*#__PURE__*/\nexport function get(thing: AnyMap | AnyObject, prop: PropertyKey): any {\n\t// @ts-ignore\n\treturn getArchtype(thing) === Archtype.Map ? thing.get(prop) : thing[prop]\n}\n\n/*#__PURE__*/\nexport function set(thing: any, propOrOldValue: PropertyKey, value: any) {\n\tconst t = getArchtype(thing)\n\tif (t === Archtype.Map) thing.set(propOrOldValue, value)\n\telse if (t === Archtype.Set) {\n\t\tthing.add(value)\n\t} else thing[propOrOldValue] = value\n}\n\n/*#__PURE__*/\nexport function is(x: any, y: any): boolean {\n\t// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n\tif (x === y) {\n\t\treturn x !== 0 || 1 / x === 1 / y\n\t} else {\n\t\treturn x !== x && y !== y\n\t}\n}\n\n/*#__PURE__*/\nexport function isMap(target: any): target is AnyMap {\n\treturn hasMap && target instanceof Map\n}\n\n/*#__PURE__*/\nexport function isSet(target: any): target is AnySet {\n\treturn hasSet && target instanceof Set\n}\n/*#__PURE__*/\nexport function latest(state: ImmerState): any {\n\treturn state.copy_ || state.base_\n}\n\n/*#__PURE__*/\nexport function shallowCopy(base: any) {\n\tif (Array.isArray(base)) return Array.prototype.slice.call(base)\n\tconst descriptors = getOwnPropertyDescriptors(base)\n\tdelete descriptors[DRAFT_STATE as any]\n\tlet keys = ownKeys(descriptors)\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tconst key: any = keys[i]\n\t\tconst desc = descriptors[key]\n\t\tif (desc.writable === false) {\n\t\t\tdesc.writable = true\n\t\t\tdesc.configurable = true\n\t\t}\n\t\t// like object.assign, we will read any _own_, get/set accessors. This helps in dealing\n\t\t// with libraries that trap values, like mobx or vue\n\t\t// unlike object.assign, non-enumerables will be copied as well\n\t\tif (desc.get || desc.set)\n\t\t\tdescriptors[key] = {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true, // could live with !!desc.set as well here...\n\t\t\t\tenumerable: desc.enumerable,\n\t\t\t\tvalue: base[key]\n\t\t\t}\n\t}\n\treturn Object.create(Object.getPrototypeOf(base), descriptors)\n}\n\n/**\n * Freezes draftable objects. Returns the original object.\n * By default freezes shallowly, but if the second argument is `true` it will freeze recursively.\n *\n * @param obj\n * @param deep\n */\nexport function freeze(obj: T, deep?: boolean): T\nexport function freeze(obj: any, deep: boolean = false): T {\n\tif (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj\n\tif (getArchtype(obj) > 1 /* Map or Set */) {\n\t\tobj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections as any\n\t}\n\tObject.freeze(obj)\n\tif (deep) each(obj, (key, value) => freeze(value, true), true)\n\treturn obj\n}\n\nfunction dontMutateFrozenCollections() {\n\tdie(2)\n}\n\nexport function isFrozen(obj: any): boolean {\n\tif (obj == null || typeof obj !== \"object\") return true\n\t// See #600, IE dies on non-objects in Object.isFrozen\n\treturn Object.isFrozen(obj)\n}\n","import {\n\tImmerState,\n\tPatch,\n\tImmerScope,\n\tDrafted,\n\tAnyObject,\n\tImmerBaseState,\n\tAnyMap,\n\tAnySet,\n\tProxyType,\n\tdie\n} from \"../internal\"\n\n/** Plugin utilities */\nconst plugins: {\n\tPatches?: {\n\t\tgeneratePatches_(\n\t\t\tstate: ImmerState,\n\t\t\tbasePath: PatchPath,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tgenerateReplacementPatches_(\n\t\t\tbase: any,\n\t\t\treplacement: any,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tapplyPatches_(draft: T, patches: Patch[]): T\n\t}\n\tES5?: {\n\t\twillFinalizeES5_(scope: ImmerScope, result: any, isReplaced: boolean): void\n\t\tcreateES5Proxy_(\n\t\t\tbase: T,\n\t\t\tparent?: ImmerState\n\t\t): Drafted\n\t\thasChanges_(state: ES5ArrayState | ES5ObjectState): boolean\n\t}\n\tMapSet?: {\n\t\tproxyMap_(target: T, parent?: ImmerState): T\n\t\tproxySet_(target: T, parent?: ImmerState): T\n\t}\n} = {}\n\ntype Plugins = typeof plugins\n\nexport function getPlugin(\n\tpluginKey: K\n): Exclude {\n\tconst plugin = plugins[pluginKey]\n\tif (!plugin) {\n\t\tdie(18, pluginKey)\n\t}\n\t// @ts-ignore\n\treturn plugin\n}\n\nexport function loadPlugin(\n\tpluginKey: K,\n\timplementation: Plugins[K]\n): void {\n\tif (!plugins[pluginKey]) plugins[pluginKey] = implementation\n}\n\n/** ES5 Plugin */\n\ninterface ES5BaseState extends ImmerBaseState {\n\tassigned_: {[key: string]: any}\n\tparent_?: ImmerState\n\trevoked_: boolean\n}\n\nexport interface ES5ObjectState extends ES5BaseState {\n\ttype_: ProxyType.ES5Object\n\tdraft_: Drafted\n\tbase_: AnyObject\n\tcopy_: AnyObject | null\n}\n\nexport interface ES5ArrayState extends ES5BaseState {\n\ttype_: ProxyType.ES5Array\n\tdraft_: Drafted\n\tbase_: any\n\tcopy_: any\n}\n\n/** Map / Set plugin */\n\nexport interface MapState extends ImmerBaseState {\n\ttype_: ProxyType.Map\n\tcopy_: AnyMap | undefined\n\tassigned_: Map | undefined\n\tbase_: AnyMap\n\trevoked_: boolean\n\tdraft_: Drafted\n}\n\nexport interface SetState extends ImmerBaseState {\n\ttype_: ProxyType.Set\n\tcopy_: AnySet | undefined\n\tbase_: AnySet\n\tdrafts_: Map // maps the original value to the draft value in the new set\n\trevoked_: boolean\n\tdraft_: Drafted\n}\n\n/** Patches plugin */\n\nexport type PatchPath = (string | number)[]\n","import {\n\tPatch,\n\tPatchListener,\n\tDrafted,\n\tImmer,\n\tDRAFT_STATE,\n\tImmerState,\n\tProxyType,\n\tgetPlugin\n} from \"../internal\"\nimport {die} from \"../utils/errors\"\n\n/** Each scope represents a `produce` call. */\n\nexport interface ImmerScope {\n\tpatches_?: Patch[]\n\tinversePatches_?: Patch[]\n\tcanAutoFreeze_: boolean\n\tdrafts_: any[]\n\tparent_?: ImmerScope\n\tpatchListener_?: PatchListener\n\timmer_: Immer\n\tunfinalizedDrafts_: number\n}\n\nlet currentScope: ImmerScope | undefined\n\nexport function getCurrentScope() {\n\tif (__DEV__ && !currentScope) die(0)\n\treturn currentScope!\n}\n\nfunction createScope(\n\tparent_: ImmerScope | undefined,\n\timmer_: Immer\n): ImmerScope {\n\treturn {\n\t\tdrafts_: [],\n\t\tparent_,\n\t\timmer_,\n\t\t// Whenever the modified draft contains a draft from another scope, we\n\t\t// need to prevent auto-freezing so the unowned draft can be finalized.\n\t\tcanAutoFreeze_: true,\n\t\tunfinalizedDrafts_: 0\n\t}\n}\n\nexport function usePatchesInScope(\n\tscope: ImmerScope,\n\tpatchListener?: PatchListener\n) {\n\tif (patchListener) {\n\t\tgetPlugin(\"Patches\") // assert we have the plugin\n\t\tscope.patches_ = []\n\t\tscope.inversePatches_ = []\n\t\tscope.patchListener_ = patchListener\n\t}\n}\n\nexport function revokeScope(scope: ImmerScope) {\n\tleaveScope(scope)\n\tscope.drafts_.forEach(revokeDraft)\n\t// @ts-ignore\n\tscope.drafts_ = null\n}\n\nexport function leaveScope(scope: ImmerScope) {\n\tif (scope === currentScope) {\n\t\tcurrentScope = scope.parent_\n\t}\n}\n\nexport function enterScope(immer: Immer) {\n\treturn (currentScope = createScope(currentScope, immer))\n}\n\nfunction revokeDraft(draft: Drafted) {\n\tconst state: ImmerState = draft[DRAFT_STATE]\n\tif (\n\t\tstate.type_ === ProxyType.ProxyObject ||\n\t\tstate.type_ === ProxyType.ProxyArray\n\t)\n\t\tstate.revoke_()\n\telse state.revoked_ = true\n}\n","import {\n\tImmerScope,\n\tDRAFT_STATE,\n\tisDraftable,\n\tNOTHING,\n\tPatchPath,\n\teach,\n\thas,\n\tfreeze,\n\tImmerState,\n\tisDraft,\n\tSetState,\n\tset,\n\tProxyType,\n\tgetPlugin,\n\tdie,\n\trevokeScope,\n\tisFrozen,\n\tshallowCopy\n} from \"../internal\"\n\nexport function processResult(result: any, scope: ImmerScope) {\n\tscope.unfinalizedDrafts_ = scope.drafts_.length\n\tconst baseDraft = scope.drafts_![0]\n\tconst isReplaced = result !== undefined && result !== baseDraft\n\tif (!scope.immer_.useProxies_)\n\t\tgetPlugin(\"ES5\").willFinalizeES5_(scope, result, isReplaced)\n\tif (isReplaced) {\n\t\tif (baseDraft[DRAFT_STATE].modified_) {\n\t\t\trevokeScope(scope)\n\t\t\tdie(4)\n\t\t}\n\t\tif (isDraftable(result)) {\n\t\t\t// Finalize the result in case it contains (or is) a subset of the draft.\n\t\t\tresult = finalize(scope, result)\n\t\t\tif (!scope.parent_) maybeFreeze(scope, result)\n\t\t}\n\t\tif (scope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(\n\t\t\t\tbaseDraft[DRAFT_STATE].base_,\n\t\t\t\tresult,\n\t\t\t\tscope.patches_,\n\t\t\t\tscope.inversePatches_!\n\t\t\t)\n\t\t}\n\t} else {\n\t\t// Finalize the base draft.\n\t\tresult = finalize(scope, baseDraft, [])\n\t}\n\trevokeScope(scope)\n\tif (scope.patches_) {\n\t\tscope.patchListener_!(scope.patches_, scope.inversePatches_!)\n\t}\n\treturn result !== NOTHING ? result : undefined\n}\n\nfunction finalize(rootScope: ImmerScope, value: any, path?: PatchPath) {\n\t// Don't recurse in tho recursive data structures\n\tif (isFrozen(value)) return value\n\n\tconst state: ImmerState = value[DRAFT_STATE]\n\t// A plain object, might need freezing, might contain drafts\n\tif (!state) {\n\t\teach(\n\t\t\tvalue,\n\t\t\t(key, childValue) =>\n\t\t\t\tfinalizeProperty(rootScope, state, value, key, childValue, path),\n\t\t\ttrue // See #590, don't recurse into non-enumerable of non drafted objects\n\t\t)\n\t\treturn value\n\t}\n\t// Never finalize drafts owned by another scope.\n\tif (state.scope_ !== rootScope) return value\n\t// Unmodified draft, return the (frozen) original\n\tif (!state.modified_) {\n\t\tmaybeFreeze(rootScope, state.base_, true)\n\t\treturn state.base_\n\t}\n\t// Not finalized yet, let's do that now\n\tif (!state.finalized_) {\n\t\tstate.finalized_ = true\n\t\tstate.scope_.unfinalizedDrafts_--\n\t\tconst result =\n\t\t\t// For ES5, create a good copy from the draft first, with added keys and without deleted keys.\n\t\t\tstate.type_ === ProxyType.ES5Object || state.type_ === ProxyType.ES5Array\n\t\t\t\t? (state.copy_ = shallowCopy(state.draft_))\n\t\t\t\t: state.copy_\n\t\t// Finalize all children of the copy\n\t\t// For sets we clone before iterating, otherwise we can get in endless loop due to modifying during iteration, see #628\n\t\t// To preserve insertion order in all cases we then clear the set\n\t\t// And we let finalizeProperty know it needs to re-add non-draft children back to the target\n\t\tlet resultEach = result\n\t\tlet isSet = false\n\t\tif (state.type_ === ProxyType.Set) {\n\t\t\tresultEach = new Set(result)\n\t\t\tresult.clear()\n\t\t\tisSet = true\n\t\t}\n\t\teach(resultEach, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, result, key, childValue, path, isSet)\n\t\t)\n\t\t// everything inside is frozen, we can freeze here\n\t\tmaybeFreeze(rootScope, result, false)\n\t\t// first time finalizing, let's create those patches\n\t\tif (path && rootScope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generatePatches_(\n\t\t\t\tstate,\n\t\t\t\tpath,\n\t\t\t\trootScope.patches_,\n\t\t\t\trootScope.inversePatches_!\n\t\t\t)\n\t\t}\n\t}\n\treturn state.copy_\n}\n\nfunction finalizeProperty(\n\trootScope: ImmerScope,\n\tparentState: undefined | ImmerState,\n\ttargetObject: any,\n\tprop: string | number,\n\tchildValue: any,\n\trootPath?: PatchPath,\n\ttargetIsSet?: boolean\n) {\n\tif (__DEV__ && childValue === targetObject) die(5)\n\tif (isDraft(childValue)) {\n\t\tconst path =\n\t\t\trootPath &&\n\t\t\tparentState &&\n\t\t\tparentState!.type_ !== ProxyType.Set && // Set objects are atomic since they have no keys.\n\t\t\t!has((parentState as Exclude).assigned_!, prop) // Skip deep patches for assigned keys.\n\t\t\t\t? rootPath!.concat(prop)\n\t\t\t\t: undefined\n\t\t// Drafts owned by `scope` are finalized here.\n\t\tconst res = finalize(rootScope, childValue, path)\n\t\tset(targetObject, prop, res)\n\t\t// Drafts from another scope must prevented to be frozen\n\t\t// if we got a draft back from finalize, we're in a nested produce and shouldn't freeze\n\t\tif (isDraft(res)) {\n\t\t\trootScope.canAutoFreeze_ = false\n\t\t} else return\n\t} else if (targetIsSet) {\n\t\ttargetObject.add(childValue)\n\t}\n\t// Search new objects for unfinalized drafts. Frozen objects should never contain drafts.\n\tif (isDraftable(childValue) && !isFrozen(childValue)) {\n\t\tif (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n\t\t\t// optimization: if an object is not a draft, and we don't have to\n\t\t\t// deepfreeze everything, and we are sure that no drafts are left in the remaining object\n\t\t\t// cause we saw and finalized all drafts already; we can stop visiting the rest of the tree.\n\t\t\t// This benefits especially adding large data tree's without further processing.\n\t\t\t// See add-data.js perf test\n\t\t\treturn\n\t\t}\n\t\tfinalize(rootScope, childValue)\n\t\t// immer deep freezes plain objects, so if there is no parent state, we freeze as well\n\t\tif (!parentState || !parentState.scope_.parent_)\n\t\t\tmaybeFreeze(rootScope, childValue)\n\t}\n}\n\nfunction maybeFreeze(scope: ImmerScope, value: any, deep = false) {\n\t// we never freeze for a non-root scope; as it would prevent pruning for drafts inside wrapping objects\n\tif (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n\t\tfreeze(value, deep)\n\t}\n}\n","import {\n\teach,\n\thas,\n\tis,\n\tisDraftable,\n\tshallowCopy,\n\tlatest,\n\tImmerBaseState,\n\tImmerState,\n\tDrafted,\n\tAnyObject,\n\tAnyArray,\n\tObjectish,\n\tgetCurrentScope,\n\tDRAFT_STATE,\n\tdie,\n\tcreateProxy,\n\tProxyType\n} from \"../internal\"\n\ninterface ProxyBaseState extends ImmerBaseState {\n\tassigned_: {\n\t\t[property: string]: boolean\n\t}\n\tparent_?: ImmerState\n\trevoke_(): void\n}\n\nexport interface ProxyObjectState extends ProxyBaseState {\n\ttype_: ProxyType.ProxyObject\n\tbase_: any\n\tcopy_: any\n\tdraft_: Drafted\n}\n\nexport interface ProxyArrayState extends ProxyBaseState {\n\ttype_: ProxyType.ProxyArray\n\tbase_: AnyArray\n\tcopy_: AnyArray | null\n\tdraft_: Drafted\n}\n\ntype ProxyState = ProxyObjectState | ProxyArrayState\n\n/**\n * Returns a new draft of the `base` object.\n *\n * The second argument is the parent draft-state (used internally).\n */\nexport function createProxyProxy(\n\tbase: T,\n\tparent?: ImmerState\n): Drafted {\n\tconst isArray = Array.isArray(base)\n\tconst state: ProxyState = {\n\t\ttype_: isArray ? ProxyType.ProxyArray : (ProxyType.ProxyObject as any),\n\t\t// Track which produce call this is associated with.\n\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t// True for both shallow and deep changes.\n\t\tmodified_: false,\n\t\t// Used during finalization.\n\t\tfinalized_: false,\n\t\t// Track which properties have been assigned (true) or deleted (false).\n\t\tassigned_: {},\n\t\t// The parent draft state.\n\t\tparent_: parent,\n\t\t// The base state.\n\t\tbase_: base,\n\t\t// The base proxy.\n\t\tdraft_: null as any, // set below\n\t\t// The base copy with any updated values.\n\t\tcopy_: null,\n\t\t// Called by the `produce` function.\n\t\trevoke_: null as any,\n\t\tisManual_: false\n\t}\n\n\t// the traps must target something, a bit like the 'real' base.\n\t// but also, we need to be able to determine from the target what the relevant state is\n\t// (to avoid creating traps per instance to capture the state in closure,\n\t// and to avoid creating weird hidden properties as well)\n\t// So the trick is to use 'state' as the actual 'target'! (and make sure we intercept everything)\n\t// Note that in the case of an array, we put the state in an array to have better Reflect defaults ootb\n\tlet target: T = state as any\n\tlet traps: ProxyHandler