import{aA as H,b as s,a8 as S,a7 as _,a9 as I,d as T,o as A,c as D,P as g,br as N}from"./app-QjDgb7aF.js";import{F as j}from"./suspense-jJyLIr98.js";import{F as B}from"./split-B5EOpoau.js";import{F as R}from"./section-Dbg05qO2.js";import{b as q,E as v,j as h,g as J,i as t,k as o,q as W,I as r,u as a,J as n,D as m,p as Y,F as z,H as G,a as p,f as y}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const K={class:"_formRoot"},te=q({__name:"email-settings",setup(L){let u=p(!1),d=p(null),c=p(!1),f=p(""),b=p(0),k=p(""),V=p("");async function P(){const i=await T("admin/meta");u.value=i.enableEmail,d.value=i.email,c.value=i.smtpSecure,f.value=i.smtpHost,b.value=i.smtpPort,k.value=i.smtpUser,V.value=i.smtpPass}async function U(){const{canceled:i,result:l}=await A({title:s.ts.destination,type:"email",placeholder:D.maintainerEmail});i||g("admin/send-email",{to:l,subject:"Test email",text:"Yo"})}function x(){g("admin/update-meta",{enableEmail:u.value,email:d.value,smtpSecure:c.value,smtpHost:f.value,smtpPort:b.value,smtpUser:k.value,smtpPass:V.value}).then(()=>{N()})}const F=y(()=>[{asFullButton:!0,icon:"ph-test-tube ph-bold ph-lg",text:s.ts.testEmail,handler:U},{asFullButton:!0,icon:"ph-check ph-bold ph-lg",text:s.ts.save,handler:x}]),M=y(()=>[]);return H({title:s.ts.emailServer,icon:"ph-envelope-simple-open ph-bold ph-lg"}),(i,l)=>{const E=v("MkPageHeader"),C=v("MkSpacer"),w=v("MkStickyContainer");return h(),J(w,null,{header:t(()=>[o(E,{actions:F.value,tabs:M.value,"display-back-button":!0},null,8,["actions","tabs"])]),default:t(()=>[o(C,{"content-max":700,"margin-min":16,"margin-max":32},{default:t(()=>[o(j,{p:P},{default:t(()=>[W("div",K,[o(S,{modelValue:a(u),"onUpdate:modelValue":l[0]||(l[0]=e=>r(u)?u.value=e:u=e),class:"_formBlock"},{label:t(()=>[n(m(a(s).ts.enableEmail)+" ("+m(a(s).ts.recommended)+")",1)]),caption:t(()=>[n(m(a(s).ts.emailConfigInfo),1)]),_:1},8,["modelValue"]),a(u)?(h(),Y(z,{key:0},[o(_,{modelValue:a(d),"onUpdate:modelValue":l[1]||(l[1]=e=>r(d)?d.value=e:d=e),type:"email",class:"_formBlock"},{label:t(()=>[n(m(a(s).ts.emailAddress),1)]),_:1},8,["modelValue"]),o(R,null,{label:t(()=>[n(m(a(s).ts.smtpConfig),1)]),default:t(()=>[o(B,{"min-width":280},{default:t(()=>[o(_,{modelValue:a(f),"onUpdate:modelValue":l[2]||(l[2]=e=>r(f)?f.value=e:f=e),class:"_formBlock"},{label:t(()=>[n(m(a(s).ts.smtpHost),1)]),_:1},8,["modelValue"]),o(_,{modelValue:a(b),"onUpdate:modelValue":l[3]||(l[3]=e=>r(b)?b.value=e:b=e),type:"number",class:"_formBlock"},{label:t(()=>[n(m(a(s).ts.smtpPort),1)]),_:1},8,["modelValue"])]),_:1}),o(B,{"min-width":280},{default:t(()=>[o(_,{modelValue:a(k),"onUpdate:modelValue":l[4]||(l[4]=e=>r(k)?k.value=e:k=e),class:"_formBlock"},{label:t(()=>[n(m(a(s).ts.smtpUser),1)]),_:1},8,["modelValue"]),o(_,{modelValue:a(V),"onUpdate:modelValue":l[5]||(l[5]=e=>r(V)?V.value=e:V=e),type:"password",class:"_formBlock"},{label:t(()=>[n(m(a(s).ts.smtpPass),1)]),_:1},8,["modelValue"])]),_:1}),o(I,{class:"_formBlock"},{default:t(()=>[n(m(a(s).ts.emptyToDisableSmtpAuth),1)]),_:1}),o(S,{modelValue:a(c),"onUpdate:modelValue":l[6]||(l[6]=e=>r(c)?c.value=e:c=e),class:"_formBlock"},{label:t(()=>[n(m(a(s).ts.smtpSecure),1)]),caption:t(()=>[n(m(a(s).ts.smtpSecureInfo),1)]),_:1},8,["modelValue"])]),_:1})],64)):G("",!0)])]),_:1})]),_:1})]),_:1})}}});export{te as default};
//# sourceMappingURL=email-settings-DR5G73-n.js.map
