import{r as a,j as e,f as x}from"./index-DVgsXMJe.js";import{S as f}from"./StatusPill-mE1jbIzg.js";import{m as g}from"./proxy-BdznxAXt.js";const h=[{id:"llm_orchestrator",label:"Multi-LLM Orchestrator",status:"active",description:"Routing cost/quality/fallback across providers."},{id:"command_system",label:"Command System ++",status:"active",description:"Prompt command parsing and execution modes."},{id:"autonomous_engine",label:"Autonomous Engine",status:"active",description:"Goal loop with manual / semi-auto / full-auto policies."},{id:"strategy_engine",label:"Strategy Engine",status:"active",description:"Long-term planning, prioritization and optimization."},{id:"dashboard_backend",label:"Dashboard Backend",status:"active",description:"Realtime operational state and telemetry endpoints."},{id:"saas_foundation",label:"SaaS Foundation",status:"active",description:"User/tenant isolation and usage tracking foundation."},{id:"approval_extensions",label:"Approval Extensions",status:"active",description:"Config-driven protection for sensitive route groups."}];function j({className:m=""}){const[s,l]=a.useState([]),[c,p]=a.useState(!0),[o,d]=a.useState("");a.useEffect(()=>{let t=!1;const n=async()=>{try{const r=await x("/ui/modules");if(t)return;l(Array.isArray(r.modules)?r.modules:[]),d("")}catch{if(t)return;l(h),d("Live module feed unavailable. Showing bundled module map.")}finally{t||p(!1)}};n();const i=window.setInterval(n,15e3);return()=>{t=!0,window.clearInterval(i)}},[]);const u=a.useMemo(()=>{const t=s.length,n=s.filter(i=>i.status==="active"||i.status==="running").length;return{total:t,active:n}},[s]);return e.jsx(g.section,{className:`hud-panel rounded-2xl p-4 ${m}`,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:.15},children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"font-display text-base text-neon-cyan",children:"Nexus Modules"}),e.jsxs("div",{className:"text-xs uppercase tracking-[0.3em] text-neon-cyan/60",children:[u.active,"/",u.total||"?"," up"]})]}),c&&e.jsx("p",{className:"text-xs text-neon-cyan/70",children:"Loading modules…"}),!!o&&e.jsx("p",{className:"text-xs text-rose-300",children:o}),e.jsxs("div",{className:"space-y-2",children:[s.map(t=>e.jsxs("div",{className:"rounded-xl border border-neon-cyan/15 bg-bg-800/70 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-sm text-white",children:t.label}),e.jsx(f,{label:t.status,status:t.status})]}),t.description&&e.jsx("p",{className:"mt-1 text-xs text-slate-300",children:t.description})]},t.id)),!c&&!s.length&&!o&&e.jsx("p",{className:"text-xs text-slate-400",children:"No module data."})]})]})})}export{j as NexusModules};
