(this["webpackJsonpmetta-frontend"]=this["webpackJsonpmetta-frontend"]||[]).push([[9],{1091:function(e,s,t){},1104:function(e,s,t){"use strict";t.r(s);var r=t(3),a=t(20),n=t(2),c=t(33),o=t(31),d=t(62),i=t(48),l=t(56),u=t(19),m=u.d().shape({NewPassword:u.f().required("New password is required"),ConfirmPassword:u.f().oneOf([u.e("NewPassword"),null],"Passwords don't match!").required("Confirm password is required"),OldPassword:u.f().required("Old password is required")}),j=t(26),b=t(23),h=t(57),w=(t(1091),t(1));s.default=Object(o.b)((function(e){var s=e.user;return{theUserId:s.currentUser.email,changePasswordRequestFinished:s.changePasswordRequestCompletedSuccessfully,isFetching:s.isFetching,errorMessage:s.errorMessage}}),(function(e){return{sendChangePassword:function(s){var t=s.UserId,r=s.OldPassword,a=s.NewPassword;return e(Object(h.b)({UserId:t,newPassword:a,password:r}))},clearState:function(){return e({type:b.a.POST_USER_CLEAR_STATE})}}}))((function(e){var s,t=e.theUserId,o=e.isFetching,u=e.errorMessage,b=e.clearState,h=e.sendChangePassword,f=e.changePasswordRequestFinished,p=Object(n.useState)(!1),O=Object(a.a)(p,2),x=O[0],g=O[1],P=function(){g(!x)},N=function(e){f&&e.resetForm(),b()},y=Object(l.a)((function(){return Object(w.jsx)("div",{className:"text-center pt-4",children:Object(w.jsx)("button",{type:"submit",className:"btn btn-primary btn-block mt-2",children:"Submit"})})}));return Object(w.jsx)("div",{className:"col-md-6 mt-5 center",children:Object(w.jsx)("div",{className:"panel panel-white",children:Object(w.jsx)("div",{className:"panel-body p-3",children:Object(w.jsx)(c.d,{initialValues:Object(r.a)({},(s=t,{UserId:s,OldPassword:"",NewPassword:"",ConfirmPassword:""})),validationSchema:m,onSubmit:function(e){console.log(e),h(e)},children:function(e){return Object(w.jsxs)(c.c,{className:"msform m-t-md",children:[Object(w.jsxs)("div",{className:"login-box",children:[Object(w.jsx)(d.b,{to:"",className:"logo-name text-lg text-center",children:"Metta"}),Object(w.jsxs)("div",{className:"mt-4",children:[Object(w.jsx)("div",{className:"form-group",children:Object(w.jsx)(j.e,{type:"".concat(x?"text":"password"),fonticon:"".concat(x?"eye-slash":"eye"),groupiconaction:P,label:"",placeholder:"Old Password",name:"OldPassword"})}),Object(w.jsx)("div",{className:"form-group",children:Object(w.jsx)(j.e,{type:"".concat(x?"text":"password"),fonticon:"".concat(x?"eye-slash":"eye"),groupiconaction:P,label:"",placeholder:"New Password",name:"NewPassword"})}),Object(w.jsx)("div",{className:"form-group",children:Object(w.jsx)(j.e,{type:"".concat(x?"text":"password"),fonticon:"".concat(x?"eye-slash":"eye"),groupiconaction:P,label:"",placeholder:"Confirm Password",name:"ConfirmPassword"})})]}),Object(w.jsx)(y,{defaultHeight:!1,isLoading:o}),Object(w.jsx)("p",{className:"text-center m-t-xs text-sm",children:"2021 \xa9 Metta"})]}),u?Object(w.jsx)(i.a,{message:u,onclose:function(s){return N(e)}}):null,0==!!u&&f?Object(w.jsx)(i.a,{success:!0,message:"Password changed successfully",onclose:function(s){return N(e)}}):null]})}})})})})}))}}]);
//# sourceMappingURL=9.8d1e6bf9.chunk.js.map