"use strict";(self["webpackChunkcoreclear_portal"]=self["webpackChunkcoreclear_portal"]||[]).push([[58],{9844:(s,e,r)=>{r.r(e),r.d(e,{default:()=>q});var t=r(2202),a=r(8819),o=r(7179),l=r(3385),i=r(5223),n=r(4437),d=r(6035),c=r(9789),p=r(3422),w=r(6904),u=r(2469),m=r(1302),h=r(5294),f=r(5234),g=r(5952),P=r(5838),C=r(2370),v=function(){var s=this,e=s._self._c;return e(d.Z,{staticClass:"fill-height",attrs:{fluid:""}},[e(h.Z,{staticClass:"align-center justify-center"},[e(n.Z,{attrs:{cols:"12",sm:"8",md:"6",lg:"4"}},[e(t.Z,{attrs:{border:"left","close-text":"Close Alert",type:s.alertType,transition:"scale-transition",prominent:""},model:{value:s.alert,callback:function(e){s.alert=e},expression:"alert"}},[s._v(" "+s._s(s.alertMessage)+" ")]),e("div",{staticClass:"text-center"},[s.passwordResetSuccess?e(o.Z,{staticClass:"white--text mx-auto mt-3",attrs:{color:s.getAppColors.primary,rounded:"",large:"",to:"/"}},[s._v(" Go to Login ")]):s._e()],1),s.passwordResetSuccess?s._e():e(p.Z5,[e(l.Z,{directives:[{name:"show",rawName:"v-show",value:!s.loading,expression:"!loading"}],staticClass:"elevation-12 rounded-lg"},[e(P.Z,{attrs:{color:s.getAppColors.primary,dark:""}},[e(a.Z,{attrs:{size:"50px"}},[e(u.Z,{attrs:{alt:"Logo",src:r(9344),contain:""}})],1),e(C.qW,{attrs:{dark:""}},[s._v(" core"),e("strong",[s._v("CLEAR")]),s._v(" Portal ")])],1),e(i.EB,[s._v("Reset Password")]),e(i.ZB,[e(w.Z,{ref:"form",model:{value:s.valid,callback:function(e){s.valid=e},expression:"valid"}},[e(g.Z,{attrs:{"prepend-icon":"lock",color:s.getAppColors.primary,"append-icon":s.showPassword?"mdi-eye":"mdi-eye-off",label:"Password",name:"password",type:s.showPassword?"text":"password",autocomplete:"current-password",rules:s.passwordRules,required:""},on:{"click:append":function(e){s.showPassword=!s.showPassword}},model:{value:s.password,callback:function(e){s.password=e},expression:"password"}}),e(g.Z,{attrs:{"prepend-icon":"lock",color:s.getAppColors.primary,"append-icon":s.showConfirmPassword?"mdi-eye":"mdi-eye-off",label:"Confirm Password",name:"confirmPassword",type:s.showConfirmPassword?"text":"password",autocomplete:"current-password",rules:s.confirmPasswordRules,required:""},on:{keyup:function(e){return!e.type.indexOf("key")&&s._k(e.keyCode,"enter",13,e.key,"Enter")?null:s.submit.apply(null,arguments)},"click:append":function(e){s.showConfirmPassword=!s.showConfirmPassword}},model:{value:s.confirmPassword,callback:function(e){s.confirmPassword=e},expression:"confirmPassword"}})],1)],1),e(i.h7,[e(o.Z,{attrs:{text:"",rounded:"",large:"",to:"/"}},[s._v("Cancel")]),e(f.Z),e(o.Z,{staticClass:"white--text",attrs:{color:s.getAppColors.primary,disabled:!s.valid,loading:s.loading,rounded:"",large:""},on:{click:s.submit}},[s._v(" Reset password ")])],1)],1)],1),e(c.Z,{attrs:{"hide-overlay":"",persistent:"",transition:"dialog-bottom-transition",width:"300"},model:{value:s.loading,callback:function(e){s.loading=e},expression:"loading"}},[e(l.Z,{attrs:{color:s.getAppColors.primary,dark:""}},[e(i.ZB,[s._v(" Please wait... "),e(m.Z,{staticClass:"mb-0",attrs:{indeterminate:"",color:"white"}})],1)],1)],1)],1)],1)],1)},y=[],k=r(9669),Z=r.n(k),_=r(629),b={name:"ResetPassword",data(){return{loading:!1,valid:!1,showPassword:!1,showConfirmPassword:!1,alert:!1,alertMessage:"",alertType:"success",password:"",confirmPassword:"",passwordRules:[s=>!!s||"Password is required",s=>s.length>=8||"Password must be at least 8 characters"],confirmPasswordRules:[s=>!!s||"Password is required",s=>s.length>=8||"Password must be at least 8 characters",s=>this.password===s||"Password must match"],passwordResetSuccess:!1}},computed:{...(0,_.Se)(["getAppColors","getInternalLoginController"])},methods:{openAlert(s,e){this.alertType=s,this.alertMessage=e,this.alert=!0},submit(){this.$refs.form.validate()&&(this.loading=!0,this.alert=!1,this.doResetPassword())},async doResetPassword(){let s=new FormData;s.append("password",this.password),s.append("confirm_password",this.confirmPassword);try{let e=await Z().post(""+(this.getInternalLoginController+"/do_reset_password/"+this.$route.params.reset_key+"/1"),s,{withCredentials:!0,crossDomain:!0});this.loading=!1,!0===e.data.success?(this.passwordResetSuccess=!0,this.openAlert("success",e.data.message)):this.openAlert("error",e.data.message)}catch(e){this.openAlert(e.message),console.error(e)}}}},x=b,R=r(1001),A=(0,R.Z)(x,v,y,!1,null,null,null),q=A.exports}}]);
//# sourceMappingURL=resetPassword.7f00bf84.js.map