import{C as k,ac as x,an as R,ao as T,ap as q,aq as A,ar as I,r as B,as as U,N as r,D as v,E as i,Q as n,P as w,u as e,at as D,K as P,a3 as F,O as m,S as _,R as o,V as M}from"./vendor-BGtMsOoo.js";import{Q as O,b9 as Q,i as j}from"./index-CRze-aDK.js";const z={class:"mt-8 md:mt-9"},H=k({__name:"forgot-password-form",emits:["succeeded"],setup(C,{emit:g}){const l=g,f=x(),{forgotPassword:s,loading:c}=O(),b=R(T({email:q().required().email().max(64)})),{errors:d,meta:u,handleSubmit:y}=A({validationSchema:b,initialValues:{email:""},validateOnMount:!1}),{value:p}=I("email"),h=B(!1),$=y(async t=>{const a=f.resolve({name:"ResetPassword"}).path;await s({email:`${t.email}`,resetPasswordUrlPath:a})?l("succeeded"):h.value=!0});return U(p,()=>{h.value=!1}),(t,a)=>{const S=r("VcInput"),E=r("VcAlert"),N=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=>D(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",z,[h.value?(i(),P(E,{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(Q))]),_:1})):F("",!0),n(N,{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)}}}),K={key:0},L={class:"mb-4 text-base"},G={key:1},J={class:"mb-5 text-base"},Y=k({__name:"forgot-password",setup(C){const{t:g}=M();j({title:g("pages.forgot_password.meta.title")});const l=B(!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",G,[w("div",J,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",K,[w("div",L,o(s.$t("pages.forgot_password.email_will_be_sended_message")),1),n(e(H),{onSucceeded:c[0]||(c[0]=y=>f())})]))]),_:1},8,["status-color"])}}});export{Y as default};
//# sourceMappingURL=forgot-password-C3OppTx5.js.map
