import{K as B,ag as x,at as E,aB as N,as as A,ar as I,au as M,r as k,av as R,S as r,L as V,M as i,V as n,U as w,b as e,az as q,P,a7 as z,T as m,X as _,W as o,Z as F}from"./vendor-bSWkQivH.js";import{Q as L,aU as j,i as D}from"./index-Dqv5IkpS.js";const H={class:"mt-8 md:mt-9"},K=B({__name:"forgot-password-form",emits:["succeeded"],setup(C,{emit:g}){const l=g,f=x(),{forgotPassword:s,loading:c}=L(),b=E(N({email:A().required().email().max(64)})),{errors:d,meta:u,handleSubmit:y}=I({validationSchema:b,initialValues:{email:""},validateOnMount:!1}),{value:p}=M("email"),h=k(!1),$=y(async t=>{const a=f.resolve({name:"ResetPassword"}).path;await s({email:`${t.email}`,resetPasswordUrlPath:a})?l("succeeded"):h.value=!0});return R(p,()=>{h.value=!1}),(t,a)=>{const S=r("VcInput"),T=r("VcAlert"),U=r("VcButton");return i(),V("form",{class:"text-start",onSubmit:a[1]||(a[1]=(...v)=>e($)&&e($)(...v))},[n(S,{modelValue:e(p),"onUpdate:modelValue":a[0]||(a[0]=v=>q(p)?p.value=v:null),modelModifiers:{trim:!0},class:"mb-4",label:t.$t("common.labels.email"),placeholder:t.$t("common.placeholders.email"),type:"email",name:"email",required:"",message:e(d).email,error:!!e(d).email,maxlength:64},null,8,["modelValue","label","placeholder","message","error"]),w("div",H,[h.value?(i(),P(T,{key:0,color:"danger",size:"sm",variant:"solid-light",class:"mb-4 text-xs",icon:""},{default:m(()=>[_(o(t.$t("shared.account.forgot_password_form.error_alert"))+" ",1),n(e(j))]),_:1})):z("",!0),n(U,{type:"submit",class:"mt-6 w-full lg:mt-3 lg:w-48",loading:e(c),disabled:!e(u).valid||e(u).pending},{default:m(()=>[_(o(t.$t("common.buttons.submit")),1)]),_:1},8,["loading","disabled"])])],32)}}}),O={key:0},Q={class:"mb-4 text-base"},W={key:1},X={class:"mb-5 text-base"},J=B({__name:"forgot-password",setup(C){const{t:g}=F();D({title:g("pages.forgot_password.meta.title")});const l=k(!1);function f(){l.value=!0}return(s,c)=>{const b=r("VcTypography"),d=r("VcButton"),u=r("VcEmptyPage");return i(),P(u,{icon:"outline-security",image:"sign-in.jpg","status-color":l.value?"success":"secondary"},{default:m(()=>[n(b,{tag:"h1",class:"order-first mb-3"},{default:m(()=>[_(o(s.$t("pages.forgot_password.header")),1)]),_:1}),l.value?(i(),V("div",W,[w("div",X,o(s.$t("pages.forgot_password.reset_link_was_sent_message")),1),n(d,{to:"/","min-width":"12rem"},{default:m(()=>[_(o(s.$t("pages.forgot_password.home_button")),1)]),_:1})])):(i(),V("div",O,[w("div",Q,o(s.$t("pages.forgot_password.email_will_be_sended_message")),1),n(e(K),{onSucceeded:c[0]||(c[0]=y=>f())})]))]),_:1},8,["status-color"])}}});export{J as default};
//# sourceMappingURL=forgot-password-KXDmHmJU.js.map
