import{_ as A,b as _,u as R,g as m,h as l,i as t,d as I,c as S,o as D}from"./index-CTxlYqj4.js";import{p}from"./parameters-1TAbI5b7.js";import{_ as g}from"./ConnectedLayout-CuQwWdiY.js";import{u as b}from"./parameters.store-BXTaWfO7.js";import"./VContainer-CC8lqRXa.js";/* empty css              */import"./tag-Dx3OexMp.js";import"./VApp-tsfSFSQl.js";import"./layout-BFr6o7er.js";import"./ssrBoot-DGgZQEVC.js";import"./global.store-C4iiNxy1.js";import"./admin-CjK02gmr.js";import"./layout.store-3tdRwdnE.js";import"./VAvatar-x_79C0tA.js";import"./VProgressCircular-ubzZW5PC.js";import"./forwardRefs-BSESyuUp.js";import"./VMenu-DTm7W1Hp.js";import"./VCard-DRptUN8Y.js";import"./VRow-B-csPNw7.js";import"./VSheet-BV83IblO.js";const h={getCapabilities(){return A.get("/capabilities/")}},H={__name:"AdminLayout",setup(x){const{$gettext:i}=_(),c=R(),e=b(),o=m(!1),n=m("/rspamd"),d=l(()=>c.authUser),E=l(()=>e.imapMigrationEnabled),u=()=>{window.location=n.value},r=[],M=[{text:i("Dashboard"),to:{name:"Dashboard"},exact:!0,icon:"mdi-view-dashboard-outline"},{text:i("Domains"),to:{name:"DomainList"},icon:"mdi-domain",roles:[t.DOMAIN_ADMIN,t.RESELLER,t.SUPER_ADMIN]},{text:i("Identities"),to:{name:"Identities"},icon:"mdi-account",roles:[t.DOMAIN_ADMIN,t.RESELLER,t.SUPER_ADMIN]},{text:i("Alarms"),to:{name:"Alarms"},icon:"mdi-bell"},{icon:"mdi-history",text:i("Monitoring"),roles:[t.SUPER_ADMIN,t.RESELLER,t.DOMAIN_ADMIN],children:[{text:i("Statistics"),to:{name:"Statistics"},roles:[t.SUPER_ADMIN]},{text:i("Audit trail"),to:{name:"AuditTrail"},roles:[t.SUPER_ADMIN]},{text:i("Messages"),to:{name:"MessageLog"},roles:[t.DOMAIN_ADMIN,t.RESELLER,t.SUPER_ADMIN]}]},{icon:"mdi-email-sync-outline",text:i("IMAP Migration"),roles:[t.SUPER_ADMIN,t.RESELLER],condition:()=>E.value,children:[{text:i("Email providers"),to:{name:"ProvidersList"},roles:[t.SUPER_ADMIN,t.RESELLER]},{text:i("Migrations"),to:{name:"MigrationsList"},roles:[t.RESELLER,t.SUPER_ADMIN]}]},{icon:"mdi-cog",text:i("Settings"),children:r,roles:[t.SUPER_ADMIN]},{icon:"mdi-email-check-outline",text:"Rspamd",action:u,roles:[t.SUPER_ADMIN],condition:()=>o.value},{icon:"mdi-information",text:i("Information"),roles:[t.SUPER_ADMIN],to:{name:"Information"},withBell:!0}];return I(()=>{d.value.role===t.SUPER_ADMIN&&(p.getGlobalApplications().then(a=>{a.data.forEach(s=>{r.push({text:s.label,to:{name:"ParametersEdit",params:{app:s.name}}})})}),e.imapMigrationEnabled===null&&p.getGlobalApplication("imap_migration").then(a=>{e.imapMigrationEnabled=a.data.params.enabled_imapmigration}),h.getCapabilities().then(a=>{o.value="rspamd"in a.data.capabilities,o.value&&(n.value=a.data.capabilities.rspamd.location||"/rspamd")}))}),(a,s)=>(D(),S(g,{"menu-items":M}))}};export{H as default};
