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-C3WbSyGy.js";import{a as d,r as f}from"./runtime-dom.esm-bundler-1ANOfYkS.js";import{i as p}from"./router-BTERIw9L.js";var m={name:`RegisterComponent`,components:{},data(){return{name:``,email:``,password:``,dialogTitle:``,dialogMessage:``,dialogVisible:!1}},methods:{async register(){try{let e=await p.post(`/auth/register`,{name:this.name,email:this.email,password:this.password});this.showDialog(`Registrierung erfolgreich`,e.data?.message||`Ihr Konto wurde erfolgreich erstellt.`),this.name=``,this.email=``,this.password=``}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:`register`},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[11]||=c(`h2`,null,`Registrieren`,-1),c(`form`,{onSubmit:p[3]||=d((...e)=>b.register&&b.register(...e),[`prevent`])},[p[5]||=c(`label`,{for:`name`},`Name:`,-1),t(c(`input`,{type:`text`,id:`name`,"onUpdate:modelValue":p[0]||=e=>y.name=e,required:``},null,512),[[f,y.name]]),p[6]||=c(`label`,{for:`email`},`Email-Adresse:`,-1),t(c(`input`,{type:`email`,id:`email`,"onUpdate:modelValue":p[1]||=e=>y.email=e,required:``},null,512),[[f,y.email]]),p[7]||=c(`label`,{for:`password`},`Passwort:`,-1),t(c(`input`,{type:`password`,id:`password`,"onUpdate:modelValue":p[2]||=e=>y.password=e,required:``},null,512),[[f,y.password]]),p[8]||=c(`button`,{type:`submit`},`Registrieren`,-1)],32),c(`p`,null,[s(x,{to:`/login`},{default:n(()=>[...p[9]||=[a(`Login`,-1)]]),_:1})]),c(`p`,null,[s(x,{to:`/forgot-password`},{default:n(()=>[...p[10]||=[a(`Passwort vergessen?`,-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[4]||=(...e)=>b.closeDialog&&b.closeDialog(...e)},`Schließen`)])])):o(``,!0)])}var y=l(m,[[`render`,v],[`__scopeId`,`data-v-70d90412`]]);export{y as default};
//# sourceMappingURL=RegisterContent-sqCLJsFP.js.map