import{b as y,a as n,D as M,h as c,i as V,j as s,K as o,E as t,z as a,t as _,u as k,l as i,A as B}from"./vue-y3KLWBaS.js";import{i as l,r as h,a5 as v,M as x,a3 as P,P as A,n as C}from"./app-JmgyQoR0.js";const E=["onSubmit"],N={class:"main _formRoot"},S={class:"sub"},q={key:1,class:"bafecedb"},D=y({__name:"MkForgotPassword",emits:["done","closed"],setup($,{emit:b}){const f=b;let d=n(),u=n(""),m=n(""),p=n(!1);async function g(){p.value=!0,await A("request-reset-password",{username:u.value,email:m.value}),f("done"),d.value.close()}return(z,e)=>{const w=M("MkA");return c(),V(P,{ref_key:"dialog",ref:d,width:370,height:400,onClose:e[2]||(e[2]=r=>d.value.close()),onClosed:e[3]||(e[3]=r=>f("closed"))},{header:s(()=>[o(t(a(l).ts.forgotPassword),1)]),default:s(()=>[a(h).enableEmail?(c(),_("form",{key:0,class:"bafeceda",onSubmit:B(g,["prevent"])},[k("div",N,[i(v,{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=r=>u.value=r),class:"_formBlock",type:"text",pattern:"^[a-zA-Z0-9_]+$",spellcheck:!1,autofocus:"",required:""},{label:s(()=>[o(t(a(l).ts.username),1)]),prefix:s(()=>[o("@")]),_:1},8,["modelValue"]),i(v,{modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=r=>m.value=r),class:"_formBlock",type:"email",spellcheck:!1,required:""},{label:s(()=>[o(t(a(l).ts.emailAddress),1)]),caption:s(()=>[o(t(a(l).ts._forgotPassword.enterEmail),1)]),_:1},8,["modelValue"]),i(x,{class:"_formBlock",type:"submit",disabled:p.value,primary:"",style:{margin:"0 auto"}},{default:s(()=>[o(t(a(l).ts.send),1)]),_:1},8,["disabled"])]),k("div",S,[i(w,{to:"/about",class:"_link"},{default:s(()=>[o(t(a(l).ts._forgotPassword.ifNoEmail),1)]),_:1})])],40,E)):(c(),_("div",q,t(a(l).ts._forgotPassword.contactAdmin),1))]),_:1},512)}}}),U=C(D,[["__scopeId","data-v-0c7759f3"]]);export{U as default};
