import{j as e}from"./query-ATBhtd3K.js";import{r as s,O as b}from"./vendor-EnoIVk-c.js";import{b as g,L as k,a as v}from"./routing-nZgBtxly.js";import{g as w,U as j,V as L,X as S,Y as F,F as $}from"./en-IUV4ZXKH-BjYNERUx.js";import{u as f}from"./i18n-BYxb14hm.js";import{F as y,C as A}from"./CookiePreferences-DxD0u90z.js";import{F as R}from"./ArrowsRightLeftIcon-CMDe963r.js";import{F as C}from"./CommandLineIcon-BBerq9Nd.js";import{F as K,a as N}from"./ChevronLeftIcon-CMXd_XZQ.js";import{K as E}from"./privacy-QEJYcmMw.js";import{r as x,L as h}from"./routing-BgsGBuSe.js";import{u as H}from"./useAuth-CqtZE9nt.js";import{u as P}from"./KnowledgeBaseContext-CgnF8K-_.js";import"./index-D4SjcYxX.js";import"./AuthContext-CYne_gJM.js";function D({title:t,titleId:r,...n},i){return s.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:i,"aria-labelledby":r},n),t?s.createElement("title",{id:r},t):null,s.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 M=s.forwardRef(D);function O({href:t,to:r,...n}){return e.jsx(k,{to:t??"",...n})}function T({isCollapsed:t,toggleCollapsed:r,navigationMenu:n}){const{t:i}=f(),o=(l,u)=>i(`Administration.${l}`,u),{t:m}=f(),c=(l,u)=>m(`Sidebar.${l}`,u),p=g(),a=s.useCallback(()=>{r()},[r]);w({"browse:sidebar-toggle":a});const d=[{name:o("users"),href:"/admin/users",icon:M,description:o("usersDescription")},{name:o("oauthSettings"),href:"/admin/security",icon:y,description:o("oauthSettingsDescription")},{name:o("exchange"),href:"/admin/exchange",icon:R,description:o("exchangeDescription")},{name:o("devops"),href:"/admin/devops",icon:C,description:o("devopsDescription")}];return e.jsx(j,{title:o("title"),items:d,currentPath:p,LinkComponent:O,...n&&{dropdownContent:n},isCollapsed:t,icons:{chevronLeft:N,bars:K},collapseSidebarLabel:c("collapseSidebar"),expandSidebarLabel:c("expandSidebar")})}function re(){const{t}=f(),r=s.useContext(E),{isAuthenticated:n,isAdmin:i,isModerator:o,token:m}=H(),{activeKnowledgeBase:c}=P(),p=v();return c?e.jsx(L,{token:m,children:e.jsx(S,{baseUrl:c.backendUrl,children:e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex flex-col",children:[e.jsxs("div",{className:"flex flex-1",children:[e.jsx(F,{Link:h,routes:x,t:a=>t(`Navigation.${a}`),tHome:a=>t(`Home.${a}`),brandingLink:"/",collapsible:!0,storageKey:"admin-sidebar-collapsed",isAuthenticated:n,isAdmin:i,isModerator:o,children:(a,d,l)=>e.jsx(T,{isCollapsed:a,toggleCollapsed:d,navigationMenu:l})}),e.jsx("main",{className:"flex-1 p-6 flex flex-col",children:e.jsx("div",{className:"max-w-7xl mx-auto flex-1 flex flex-col w-full",children:e.jsx(b,{})})})]}),e.jsx($,{Link:h,routes:x,t:(a,d)=>t(`Footer.${a}`,d),CookiePreferences:A,...(r==null?void 0:r.openKeyboardHelp)&&{onOpenKeyboardHelp:r.openKeyboardHelp}})]})})}):(p.push("/know"),null)}export{re as default};
//# sourceMappingURL=layout-D9y4fNSa.js.map
