import{aI as m,v as o,f as u,e as i,ao as t,L as l,aX as d}from"./app-k0jcl5PQ.js";import{B as g}from"./CCtuxSlD.chunk.js";import{u as h}from"./ApI7cEru.chunk.js";const p="settings.settingsLayout",S=e=>{const{hasPermissions:n}=d(),r=h();if(e)return n(e);const s=o.getCurrentAppLink();return s.application!==i.SETTINGS?!0:r.some(c=>c.modules.some(a=>"appLink"in a?a.appLink.action===s.action:!1))};function j(e){var s;const n=S(e.requiredPermissions);if(m.useEffect(()=>{n||o.trigger({application:i.SETTINGS,action:u.Settings.HOME},{replace:!0})},[n]),!n)return t.jsx(t.Fragment,{});const r=e.breadcrumbs.map((c,a)=>({name:c,appLink:{application:i.SETTINGS,action:u.Settings.HOME},active:a===e.breadcrumbs.length-1}));return t.jsxs("div",{className:"px-3",children:[t.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[t.jsx("h1",{className:"h2",children:e.heading}),(s=e.headingButton)==null?void 0:s.call(e)]}),t.jsx("div",{className:"pb-3",children:t.jsx(g,{breadcrumbs:[{name:l.getPhrase(p,"settingsBreadcrumb"),appLink:{application:i.SETTINGS,action:u.Settings.HOME}},...r]})}),e.description&&t.jsxs(t.Fragment,{children:[t.jsx("p",{children:e.description}),t.jsx("hr",{})]}),e.children]})}export{j as S};
//# sourceMappingURL=EHuWazu9.chunk.js.map
