import{a as y,g as x,h as r,i as u,j as o,m as s,k as a,F as Q,a3 as m,v as p,I as k,J as w,Q as c,s as b,y as V,p as h,z as C,D as d}from"./index-CLvovu40.js";import{Q as I}from"./QForm-DxIW6oMr.js";import{Q as P}from"./QPage-AlxqRIFS.js";import{u as z}from"./use-quasar-Do408P4O.js";import{f as B}from"./users-DP4IbzRG.js";import{_ as E}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./api-5Y4dWpBS.js";const S={class:"auth-shell"},N={key:1,class:"success-state"},R=y({__name:"RecoverPasswordPage",setup(F){const f=z(),l=d(!1),i=d(""),n=d(!1);async function v(){l.value=!0;try{const t=await B({email:i.value.trim()});if(t.error)throw new Error(t.error);n.value=!0}catch(t){f.notify({type:"negative",message:t instanceof Error?t.message:String(t)})}finally{l.value=!1}}return(t,e)=>{const g=x("router-link");return r(),u(P,{class:"auth-page"},{default:o(()=>[s("div",S,[a(Q,{flat:"",bordered:"",class:"auth-card"},{default:o(()=>[a(m,null,{default:o(()=>[...e[1]||(e[1]=[s("div",{class:"text-overline text-primary"},"Recupero",-1),s("div",{class:"text-h4"},"Recover password",-1),s("div",{class:"text-body2 text-grey-7"},"Invia la mail di recupero password.",-1)])]),_:1}),a(p),a(m,null,{default:o(()=>[n.value?(r(),b("div",N,[a(V,{name:"mark_email_read",size:"56px",color:"positive"}),e[2]||(e[2]=s("div",{class:"text-h6"},"Email inviata",-1)),e[3]||(e[3]=s("div",{class:"text-body2 text-grey-7"}," Se l'indirizzo esiste, riceverai un messaggio con le istruzioni per reimpostare la password. ",-1)),a(c,{color:"primary",label:"Home",to:"/"})])):(r(),u(I,{key:0,class:"auth-form",onSubmit:k(v,["prevent"])},{default:o(()=>[a(w,{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=_=>i.value=_),outlined:"",type:"email",label:"Email",autocomplete:"email"},null,8,["modelValue"]),a(c,{color:"primary",label:"Invia email",type:"submit",loading:l.value},null,8,["loading"])]),_:1}))]),_:1}),a(p),n.value?C("",!0):(r(),u(m,{key:0,class:"auth-links"},{default:o(()=>[a(g,{to:"/login"},{default:o(()=>[...e[4]||(e[4]=[h("Torna al login",-1)])]),_:1})]),_:1}))]),_:1})])]),_:1})}}}),U=E(R,[["__scopeId","data-v-a1301143"]]);export{U as default};
