import{F as N}from"./section-yxO0GkeZ.js";import{$ as i,a4 as A,i as t,a5 as E,a2 as m,f as w,v as F,P as b}from"./app-JmgyQoR0.js";import{b as h,a as d,w as k,e as x,c as g,h as I,t as R,l as n,j as a,K as s,E as u,z as l,a0 as S,u as B}from"./vue-y3KLWBaS.js";const M={class:"_formRoot"},C=B("i",{class:"ph-envelope-simple-open ph-bold ph-lg"},null,-1),z=h({__name:"email",setup(D){const c=d(i.email),T=p=>{w("i/update",{receiveAnnouncementEmail:p})},q=()=>{F({title:t.ts.password,type:"password"}).then(({canceled:p,result:e})=>{p||b("i/update-email",{password:e,email:c.value})})},f=d(i.emailNotificationTypes.includes("mention")),r=d(i.emailNotificationTypes.includes("reply")),v=d(i.emailNotificationTypes.includes("quote")),_=d(i.emailNotificationTypes.includes("follow")),V=d(i.emailNotificationTypes.includes("receiveFollowRequest")),y=d(i.emailNotificationTypes.includes("groupInvited")),U=()=>{w("i/update",{emailNotificationTypes:[f.value?"mention":null,r.value?"reply":null,v.value?"quote":null,_.value?"follow":null,V.value?"receiveFollowRequest":null,y.value?"groupInvited":null].filter(p=>p!=null)})};return k([f,r,v,_,V,y],()=>{U()}),x(()=>{k(c,()=>{q()})}),g(()=>[]),g(()=>[]),A({title:t.ts.email,icon:"ph-envelope-simple-open ph-bold ph-lg"}),(p,e)=>(I(),R("div",M,[n(N,null,{label:a(()=>[s(u(l(t).ts.emailAddress),1)]),default:a(()=>[n(E,{modelValue:c.value,"onUpdate:modelValue":e[0]||(e[0]=o=>c.value=o),type:"email","manual-save":""},S({prefix:a(()=>[C]),_:2},[l(i).email&&!l(i).emailVerified?{name:"caption",fn:a(()=>[s(u(l(t).ts.verificationEmailSent),1)]),key:"0"}:c.value===l(i).email&&l(i).emailVerified?{name:"caption",fn:a(()=>[B("i",{class:"ph-check ph-bold ph-lg",style:{color:"var(--success)"}}),s(" "+u(l(t).ts.emailVerified),1)]),key:"1"}:void 0]),1032,["modelValue"])]),_:1}),n(N,null,{default:a(()=>[n(m,{"model-value":l(i).receiveAnnouncementEmail,"onUpdate:modelValue":T},{default:a(()=>[s(u(l(t).ts.receiveAnnouncementFromInstance),1)]),_:1},8,["model-value"])]),_:1}),n(N,null,{label:a(()=>[s(u(l(t).ts.emailNotification),1)]),default:a(()=>[n(m,{modelValue:f.value,"onUpdate:modelValue":e[1]||(e[1]=o=>f.value=o),class:"_formBlock"},{default:a(()=>[s(u(l(t).ts._notification._types.mention),1)]),_:1},8,["modelValue"]),n(m,{modelValue:r.value,"onUpdate:modelValue":e[2]||(e[2]=o=>r.value=o),class:"_formBlock"},{default:a(()=>[s(u(l(t).ts._notification._types.reply),1)]),_:1},8,["modelValue"]),n(m,{modelValue:v.value,"onUpdate:modelValue":e[3]||(e[3]=o=>v.value=o),class:"_formBlock"},{default:a(()=>[s(u(l(t).ts._notification._types.quote),1)]),_:1},8,["modelValue"]),n(m,{modelValue:_.value,"onUpdate:modelValue":e[4]||(e[4]=o=>_.value=o),class:"_formBlock"},{default:a(()=>[s(u(l(t).ts._notification._types.follow),1)]),_:1},8,["modelValue"]),n(m,{modelValue:V.value,"onUpdate:modelValue":e[5]||(e[5]=o=>V.value=o),class:"_formBlock"},{default:a(()=>[s(u(l(t).ts._notification._types.receiveFollowRequest),1)]),_:1},8,["modelValue"]),n(m,{modelValue:y.value,"onUpdate:modelValue":e[6]||(e[6]=o=>y.value=o),class:"_formBlock"},{default:a(()=>[s(u(l(t).ts._notification._types.groupInvited),1)]),_:1},8,["modelValue"])]),_:1})]))}});export{z as default};
