import{C as e,E as t,T as n,X as r,b as i,f as a,l as o,p as s,s as c,t as l,u}from"./_plugin-vue_export-helper-CfRVXrSo.js";import{a as d,r as f}from"./runtime-dom.esm-bundler-DdqN-WFI.js";import{i as p}from"./router-BSepcPus.js";var m={name:`ForgotPassword`,data(){return{email:``,dialogTitle:``,dialogMessage:``,dialogVisible:!1}},methods:{async submitForgotPassword(){try{let e=await p.post(`/auth/forgot-password`,{email:this.email});this.showDialog(`E-Mail gesendet`,e.data?.message||`Ein Link zum Zurücksetzen wurde an Ihre E-Mail-Adresse gesendet.`),this.email=``}catch(e){let t=e?.response?.data?.message||e?.message||`Ein unbekannter Fehler ist aufgetreten`;this.showDialog(`Fehler`,t)}},showDialog(e,t){this.dialogTitle=e,this.dialogMessage=t,this.dialogVisible=!0},closeDialog(){this.dialogVisible=!1}}},h={class:`forgot-password`},g={key:0,class:`dialog`},_={class:`dialog-content`};function v(l,p,m,v,y,b){let x=e(`router-link`);return i(),u(`div`,h,[p[7]||=c(`h2`,null,`Passwort vergessen`,-1),c(`form`,{onSubmit:p[1]||=d((...e)=>b.submitForgotPassword&&b.submitForgotPassword(...e),[`prevent`])},[p[3]||=c(`label`,{for:`email`},`Email-Adresse:`,-1),t(c(`input`,{type:`email`,id:`email`,"onUpdate:modelValue":p[0]||=e=>y.email=e,required:``},null,512),[[f,y.email]]),p[4]||=c(`button`,{type:`submit`},`Link zum Zurücksetzen senden`,-1)],32),c(`p`,null,[s(x,{to:`/login`},{default:n(()=>[...p[5]||=[a(`Login`,-1)]]),_:1})]),c(`p`,null,[s(x,{to:`/register`},{default:n(()=>[...p[6]||=[a(`Registrieren`,-1)]]),_:1})]),y.dialogVisible?(i(),u(`div`,g,[c(`div`,_,[c(`h3`,null,r(y.dialogTitle),1),c(`p`,null,r(y.dialogMessage),1),c(`button`,{type:`button`,onClick:p[2]||=(...e)=>b.closeDialog&&b.closeDialog(...e)},`Schließen`)])])):o(``,!0)])}var y=l(m,[[`render`,v],[`__scopeId`,`data-v-021070f7`]]);export{y as default};
//# sourceMappingURL=ForgotPasswordContent-NwgaxFG6.js.map