import{k as v,j as r,Q as w,u as L,c as x,M as k,O as S}from"./index-DoPpOINE.js";import{r as c,O as j}from"./vendor-DJo4KD8w.js";import{b as $,L as F,u as y}from"./routing-o1npPvOW.js";import{u as p}from"./i18n-BbpF47i1.js";import{F as R,C as A}from"./CookiePreferences-D5wgmVC7.js";import{F as K}from"./ArrowsRightLeftIcon-BzLgl5o9.js";import{F as N}from"./CommandLineIcon-Ba4gpk8e.js";import{F as C,a as E}from"./ChevronLeftIcon-BLyRNZuL.js";import{K as H}from"./privacy-NaGU1hj4.js";import{r as b,L as h}from"./routing-BybXhU8X.js";import"./XMarkIcon-KMKD47CF.js";function M({title:n,titleId:o,...s},a){return c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":o},s),n?c.createElement("title",{id:o},n):null,c.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"}))}const O=c.forwardRef(M);function D({href:n,to:o,...s}){return r.jsx(F,{to:n??"",...s})}function B({isCollapsed:n,toggleCollapsed:o,navigationMenu:s}){const{t:a}=p(),e=(t,i)=>a(`Administration.${t}`,i),{t:d}=p(),l=(t,i)=>d(`Sidebar.${t}`,i),m=$(),f=c.useCallback(()=>{o()},[o]);v({"shell:sidebar-toggle":f});const u=[{name:e("users"),href:"/admin/users",icon:O,description:e("usersDescription")},{name:e("oauthSettings"),href:"/admin/security",icon:R,description:e("oauthSettingsDescription")},{name:e("exchange"),href:"/admin/exchange",icon:K,description:e("exchangeDescription")},{name:e("devops"),href:"/admin/devops",icon:N,description:e("devopsDescription")}];return r.jsx(w,{title:e("title"),items:u,currentPath:m,LinkComponent:D,...s&&{dropdownContent:s},isCollapsed:n,icons:{chevronLeft:E,bars:C},collapseSidebarLabel:l("collapseSidebar"),expandSidebarLabel:l("expandSidebar")})}function P(){const{t:n}=p(),o=c.useContext(H),s=L(),a=x(s.activeSession$),e=x(a==null?void 0:a.user$),d=(a==null?void 0:a.kb)??null,l=y();if(!d)return l.push("/know"),null;const m=!!e,f=(e==null?void 0:e.isAdmin)??!1,u=(e==null?void 0:e.isModerator)??!1;return r.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex flex-col",children:[r.jsxs("div",{className:"flex flex-1",children:[r.jsx(k,{Link:h,routes:b,t:t=>n(`Navigation.${t}`),tHome:t=>n(`Home.${t}`),brandingLink:"/",collapsible:!0,storageKey:"admin-sidebar-collapsed",isAuthenticated:m,isAdmin:f,isModerator:u,children:(t,i,g)=>r.jsx(B,{isCollapsed:t,toggleCollapsed:i,navigationMenu:g})}),r.jsx("main",{className:"flex-1 p-6 flex flex-col",children:r.jsx("div",{className:"max-w-7xl mx-auto flex-1 flex flex-col w-full",children:r.jsx(j,{})})})]}),r.jsx(S,{Link:h,routes:b,t:(t,i)=>n(`Footer.${t}`,i),CookiePreferences:A,...(o==null?void 0:o.openKeyboardHelp)&&{onOpenKeyboardHelp:o.openKeyboardHelp}})]})}function V(){return r.jsx(P,{})}export{V as default};
//# sourceMappingURL=layout-G6HeeKIH.js.map
