System.register(["./index-legacy-DQdImDha.js?v=1773287522785","./index-legacy-DgZ0-E4f.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-IFFYkvEY.js?v=1773287522785","./useLoading-legacy-IiShPpjk.js?v=1773287522785","./useTableData-legacy-3kc3lnk4.js?v=1773287522785","./mail-legacy-BX4bHMTA.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-LjZ-8uGn.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./index-legacy-BJO1GMTD.js?v=1773287522785","./useLoop-legacy-CgPln_xQ.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.js?v=1773287522785","./data-legacy-B9xdUIE5.js?v=1773287522785"],(function(e,t){"use strict";var a,l,s,i,n,o,c,r,d,u,m,_,p,g,h,y,x,v,f,w,b,S,j,M,k,R,C,P,$,B,z,E,L,U,q,D;return{setters:[e=>{a=e.i,l=e.v,s=e.h,i=e.x,n=e.hp,o=e.m},e=>{c=e._},e=>{r=e._},e=>{d=e.u},e=>{u=e.u},e=>{m=e.am,_=e.an,p=e.ao,g=e.ap,h=e.aq},e=>{y=e._},e=>{x=e.k,v=e.R,f=e.r,w=e.e,b=e.$,S=e.Z,j=e.a0,M=e.S,k=e.a9,R=e._,C=e.aa,P=e.N,$=e.am,B=e.a8,z=e.j},e=>{E=e.a1,L=e.b,U=e.B},e=>{q=e._},e=>{D=e.u},null,null],execute:function(){const t={class:"p-20px"},H={class:"w-260px"},N=x({__name:"hostname",emits:["refresh"],setup(e,{expose:a,emit:l}){const s=l,{t:i}=v(),n=f(null),o=w({hostname:""}),r={hostname:{trigger:["input","blur"],validator:()=>""!==o.hostname.trim()||new Error(i("Mail.Setting.index_50"))}};return a({onConfirm:async()=>{await(n.value?.validate()),await m(P(o)),s("refresh")}}),(e,a)=>{const l=L,s=E,i=y,d=c;return b(),S("div",t,[j(i,{ref_key:"formRef",ref:n,model:M(o),rules:r},{default:k((()=>[j(s,{label:e.$t("Mail.Setting.index_48"),path:"hostname"},{default:k((()=>[R("div",H,[j(l,{value:M(o).hostname,"onUpdate:value":a[0]||(a[0]=e=>M(o).hostname=e)},null,8,["value"])])])),_:1},8,["label"])])),_:1},8,["model"]),j(d,{class:"mt-8px"},{default:k((()=>[R("li",null,C(e.$t("Mail.Setting.index_49")),1)])),_:1})])}}}),O=x({__name:"log",emits:["close","close-env"],setup(e,{emit:t}){const l=t,{t:s}=v(),i=f(s("Mail.Setting.index_47")),n=async()=>{const{message:e}=await _();a(e)&&(i.value=e.result||s("Mail.Setting.index_47"))},{loop:o}=D((async()=>{await n()}),1),c=$();return(async()=>{(async()=>{await p(),l("close"),l("close-env"),c.push("/mail/domain")})(),await n(),o()})(),(e,t)=>{const a=q;return b(),B(a,{log:M(i)},null,8,["log"])}}}),T={class:"flex flex-col h-full overflow-hidden"},Z={class:"flex-1 p-20px overflow-auto"};e("default",x({__name:"index",emits:["close"],setup(e,{emit:t}){const m=t,{t:_}=v(),p=["Redis-install","Redis-Passwd","SElinux"],{table:y,columns:x}=u([{key:"env",title:_("Mail.Setting.index_39"),width:150},{key:"details",title:_("Mail.Setting.index_40"),ellipsis:{tooltip:!0},render:e=>{let t="";const{env:a,status:l,details:s}=e,i=p.includes(a);return t=s&&i?l?"Ready":s:l?"Ready":""!=s?s:"Abnormity",j("span",{class:l?"text-primary":"text-error"},[t])}},{key:"action",title:_("Public.Table.Operation"),width:120,render:e=>{const{env:t,status:a,details:l}=e;return p.includes(t)||!l||a?_("Mail.Setting.index_41"):j("a",{class:"bt-link",href:"javascript:;",onClick:()=>{"HostName"===e.env?w(e):P(e)}},[_("Public.Btn.Repair")])}}]),f=l(_("Mail.Setting.index_42"),{onRefresh:()=>{E()}}),w=e=>{f.data.row=e,f.show=!0},P=e=>{s({title:_("Mail.Setting.index_43"),content:_("Mail.Setting.index_44"),onConfirm:async()=>{const{env:t}=e;let a="";switch(t){case"Postfix-Version":case"Postfix-install":case"Sqlite-support":a="repair_postfix";break;case"Rspamd-install":a="install_rspamd";break;case"Dovecot-install":a="repair_dovecot"}await g(t,a),E()}})},{loading:$,setLoading:B}=d(),E=async()=>{try{B(!0);const{message:e}=await h();a(e)&&(y.data=Object.entries(e).map((([e,t])=>({env:e,details:t.msg,status:t.status}))))}finally{B(!1)}},L=()=>{m("close")},q=l(_("Mail.Setting.index_45"),{onCloseEnv:()=>{L()}}),D=async()=>{y.data.every((e=>e.status))?q.show=!0:o.error(_("Mail.Setting.index_46"))};return E(),(e,t)=>{const a=r,l=c,s=i,o=U,d=n;return b(),S("div",T,[R("div",Z,[j(a,{"max-height":364,"single-line":!1,loading:M($),data:M(y).data,columns:M(x)},null,8,["loading","data","columns"]),j(l,{class:"mt-20px"},{default:k((()=>[R("li",null,C(e.$t("Mail.Setting.index_38")),1)])),_:1}),j(s,{show:M(f).show,"onUpdate:show":t[0]||(t[0]=e=>M(f).show=e),title:M(f).title,data:M(f).data,width:500,footer:!0,component:N},null,8,["show","title","data"]),j(s,{show:M(q).show,"onUpdate:show":t[1]||(t[1]=e=>M(q).show=e),title:M(q).title,data:M(q).data,"hide-close":!0,width:700,height:490,component:O},null,8,["show","title","data"])]),j(d,null,{default:k((()=>[j(o,{class:"cancel-btn",color:"#cbcbcb",size:"small",onClick:L},{default:k((()=>[z(C(e.$t("Public.Btn.Cancel")),1)])),_:1}),j(o,{type:"primary",size:"small",onClick:E},{default:k((()=>[z(C(e.$t("Public.Btn.Refresh")),1)])),_:1}),j(o,{type:"primary",size:"small",onClick:D},{default:k((()=>[z(C(e.$t("Public.Btn.Submit")),1)])),_:1})])),_:1})])}}}))}}}));
