import{j as e}from"./@radix-C7hRs6Kx.js";import{I as m}from"./InlineAvatar-Cfz4WSLK.js";import{u as x,S as c,A as d,a as f,g as u,b as v,r,c as h,d as p,l as g}from"./index-D2iSHVZq.js";import{u as j,h as N,O as b}from"./@react-router-CNP6g_RL.js";import"./@tanstack-CSxjHCME.js";import"./@reactflow-CQi1Z1Wq.js";function w({children:s,isActiveOverride:t,...n}){const a=j(),i=t?t(a.pathname):!1;return e.jsx(N,{...n,className:({isActive:l})=>` ${i||l?"bg-primary-50 text-theme-text-brand":"hover:bg-neutral-200"} block rounded-md px-4 py-1 text-text-sm font-semibold `,children:s})}function o({items:s}){return e.jsx("nav",{className:"flex w-full flex-col items-center",children:e.jsx("ul",{className:"flex w-full flex-row flex-wrap items-center gap-1 lg:flex-col lg:items-start",children:s.map(t=>e.jsx("li",{className:"lg:w-full",children:e.jsx(w,{end:!0,to:t.href,isActiveOverride:t.isActiveOverride,children:t.name})},t.name))})})}function y(){var a,i,l;const{data:s,isError:t,isPending:n}=x({throwOnError:!0});return n?e.jsx(c,{className:"h-9 w-full"}):t?null:e.jsxs("div",{className:"flex w-full items-center gap-2 rounded-md border border-theme-border-moderate bg-theme-surface-primary p-2",children:[e.jsxs(d,{size:"md",type:"square",children:[e.jsx(f,{src:u(((a=s.body)==null?void 0:a.server_name)||"default")}),e.jsx(v,{size:"md",children:((i=s.body)==null?void 0:i.server_name[0])||"D"})]}),e.jsx("p",{className:"truncate text-text-sm font-semibold",children:(l=s.body)==null?void 0:l.server_name})]})}function S(){function s(){return[{name:"General",href:r.settings.general},{name:"Members",href:r.settings.members},{name:"API Tokens",href:r.settings.apiTokens},{name:"Repositories",href:r.settings.repositories.overview},{name:"Secrets",href:r.settings.secrets.overview,isActiveOverride:n=>n.startsWith(r.settings.secrets.overview)},{name:"Connectors",href:r.settings.connectors.overview},{name:"Service Accounts",href:r.settings.service_accounts.overview,isActiveOverride:n=>n.startsWith(r.settings.service_accounts.overview)},{name:"Notifications",href:r.settings.notifications}]}const t=s();return e.jsx(o,{items:t})}function A(){function s(){return[{name:"Profile",href:r.settings.profile}]}const t=s();return e.jsx(o,{items:t})}function I(){const{data:s,isPending:t,isError:n}=h();return t?e.jsx(c,{className:"h-[70px] w-full"}):n?null:e.jsxs("div",{className:"rounded-md border border-theme-border-moderate bg-theme-surface-primary p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center",children:[e.jsx(p,{className:"h-4 w-4 fill-theme-text-brand"}),e.jsx("p",{className:"ml-2 text-text-sm  font-semibold",children:"Open source"})]}),e.jsxs("p",{className:"mb-1 text-text-sm text-theme-text-tertiary",children:["ZenML v",s.version]}),e.jsxs("p",{className:"text-text-sm text-theme-text-tertiary",children:["UI Version ","v0.32.1"]})]})}function L(){const{data:s}=g();return e.jsxs("div",{className:"layout-container flex flex-col gap-7 pt-5 lg:flex-row lg:px-10",children:[e.jsxs("div",{className:"flex shrink-0 flex-col gap-4 lg:w-[200px]",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-text-xs font-semibold uppercase text-theme-text-tertiary",children:"Server"}),e.jsx(y,{}),e.jsx(S,{})]}),s?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-text-xs font-semibold uppercase text-theme-text-tertiary",children:"Account"}),e.jsx(m,{username:s.name})]}):e.jsx(c,{className:"h-[70px] w-full"}),e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(A,{})}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-text-xs font-semibold uppercase text-theme-text-tertiary",children:"Version"}),e.jsx(I,{})]})]}),e.jsx("div",{className:"w-full",children:e.jsx(b,{})})]})}export{L as default};
