import{a as y,g as x,h as r,i as u,j as s,m as o,k as a,F as Q,a3 as d,v as c,I as k,J as w,Q as p,s as b,y as V,p as h,z as C,D as m}from"./index-DAvBaevK.js";import{Q as I}from"./QForm-CgLsd63I.js";import{Q as P}from"./QPage-B68JuyjH.js";import{u as z}from"./use-quasar-B5tVCAcV.js";import{f as B}from"./api-RGUeM09o.js";import{_ as E}from"./_plugin-vue_export-helper-DlAUqK2U.js";const S={class:"auth-shell"},N={key:1,class:"success-state"},R=y({__name:"RecoverPasswordPage",setup(F){const f=z(),l=m(!1),i=m(""),n=m(!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:s(()=>[o("div",S,[a(Q,{flat:"",bordered:"",class:"auth-card"},{default:s(()=>[a(d,null,{default:s(()=>[...e[1]||(e[1]=[o("div",{class:"text-overline text-primary"},"Recupero",-1),o("div",{class:"text-h4"},"Recover password",-1),o("div",{class:"text-body2 text-grey-7"},"Invia la mail di recupero password.",-1)])]),_:1}),a(c),a(d,null,{default:s(()=>[n.value?(r(),b("div",N,[a(V,{name:"mark_email_read",size:"56px",color:"positive"}),e[2]||(e[2]=o("div",{class:"text-h6"},"Email inviata",-1)),e[3]||(e[3]=o("div",{class:"text-body2 text-grey-7"}," Se l'indirizzo esiste, riceverai un messaggio con le istruzioni per reimpostare la password. ",-1)),a(p,{color:"primary",label:"Home",to:"/"})])):(r(),u(I,{key:0,class:"auth-form",onSubmit:k(v,["prevent"])},{default:s(()=>[a(w,{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=_=>i.value=_),outlined:"",type:"email",label:"Email",autocomplete:"email"},null,8,["modelValue"]),a(p,{color:"primary",label:"Invia email",type:"submit",loading:l.value},null,8,["loading"])]),_:1}))]),_:1}),a(c),n.value?C("",!0):(r(),u(d,{key:0,class:"auth-links"},{default:s(()=>[a(g,{to:"/login"},{default:s(()=>[...e[4]||(e[4]=[h("Torna al login",-1)])]),_:1})]),_:1}))]),_:1})])]),_:1})}}}),M=E(R,[["__scopeId","data-v-d3af4c7f"]]);export{M as default};
