import{r as b,k as s}from"./index-BVfpSx5Q.js";import{L as N}from"./layout-NiehYZnq.js";import{P as y,K as o,C as r,S as d,f as g}from"./ui-DGkmnhL-.js";import{C as a,D as E,c as S,g as x}from"./darpaResilience-ekJN43-w.js";const e={surface:"rgba(255,255,255,0.025)",border:"rgba(255,255,255,0.08)",text:"#f5f5f5",dim:"#8a8a8a",muted:"#5e5e5e",accent:"#c9b787"},n={sovereign:"#ef4444",classified:"#f59e0b",confidential:"#3b82f6",internal:"#10b981",public:"#8a8a8a"},C={"air-gapped":"AIR-GAPPED","egress-filtered":"EGRESS FILTERED","full-mesh":"FULL MESH","read-only-external":"READ-ONLY EXT"};function I(){const[i,m]=b.useState(null),u=i?a.filter(l=>l.securityLevel===i):a,h=a.filter(l=>l.enclaveStatus==="active").length,f=a.reduce((l,t)=>l+t.isolationScore,0)/a.length,j=new Set(a.flatMap(l=>l.agents)).size,c=E.find(l=>l.id==="ssith");return s.jsxs(N,{children:[s.jsx(y,{label:`DARPA RESILIENCE · v${S}`,title:"Capability Compartments",subtitle:"SSITH/CHERI-inspired — capability-based isolation with memory-safe bounds, zero-trust compartmentalization, and enclave security.",status:"LIVE"}),s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6",children:[s.jsx(o,{label:"ACTIVE ENCLAVES",value:`${h}/${a.length}`,sub:"compartments live",accent:e.accent}),s.jsx(o,{label:"ISOLATION SCORE",value:x(f),sub:"mean enclave isolation",accent:e.accent}),s.jsx(o,{label:"AGENTS GOVERNED",value:j.toString(),sub:"across all compartments",accent:e.accent}),s.jsx(o,{label:"SECURITY LEVELS",value:"5",sub:"sovereign → public",accent:e.accent})]}),s.jsxs(r,{className:"mb-6 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:e.accent}}),s.jsx("span",{className:"text-xs font-mono",style:{color:e.dim},children:"DARPA PROGRAM REFERENCE"})]}),s.jsx("div",{className:"text-sm mb-1",style:{color:e.text},children:c.fullName}),s.jsxs("div",{className:"text-xs",style:{color:e.dim},children:["Office: ",c.office," · GitHub: ",s.jsx("span",{style:{color:e.accent},children:c.github})]}),s.jsx("div",{className:"text-xs mt-2",style:{color:e.muted},children:c.innovation})]}),s.jsx(d,{children:"Security Levels"}),s.jsx("div",{className:"flex gap-2 mb-6 flex-wrap",children:Object.entries(n).map(([l,t])=>{const v=a.filter(p=>p.securityLevel===l).length;return s.jsxs("button",{onClick:()=>m(i===l?null:l),className:"px-3 py-1.5 rounded text-xs font-mono uppercase transition-all",style:{backgroundColor:i===l?t+"22":e.surface,border:`1px solid ${i===l?t:e.border}`,color:i===l?t:e.dim},children:[l," (",v,")"]},l)})}),s.jsx(d,{children:"Enclave Registry"}),s.jsx("div",{className:"space-y-4 mb-8",children:u.map(l=>s.jsxs(r,{className:"p-4",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"text-xs font-mono",style:{color:e.dim},children:l.id}),s.jsx("span",{className:"text-xs font-mono px-2 py-0.5 rounded",style:{backgroundColor:n[l.securityLevel]+"15",color:n[l.securityLevel]},children:l.securityLevel.toUpperCase()}),s.jsx(g,{status:l.enclaveStatus==="active"?"ok":"info",label:l.enclaveStatus.toUpperCase()})]}),s.jsx("div",{className:"text-sm font-medium",style:{color:e.text},children:l.name})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("div",{className:"text-lg font-mono font-bold",style:{color:e.accent},children:x(l.isolationScore)}),s.jsx("div",{className:"text-xs",style:{color:e.dim},children:"isolation"})]})]}),s.jsxs("div",{className:"p-3 rounded mb-3",style:{backgroundColor:"rgba(201,183,135,0.05)",border:`1px solid ${e.border}`},children:[s.jsx("div",{className:"text-xs font-mono mb-2",style:{color:e.dim},children:"CHERI CAPABILITY BOUNDS"}),s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs",style:{color:e.dim},children:"Base"}),s.jsx("div",{className:"text-xs font-mono",style:{color:e.accent},children:l.cheriBounds.base})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs",style:{color:e.dim},children:"Length"}),s.jsx("div",{className:"text-xs font-mono",style:{color:e.text},children:l.cheriBounds.length})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs",style:{color:e.dim},children:"Permissions"}),s.jsx("div",{className:"flex gap-1 flex-wrap",children:l.cheriBounds.permissions.map(t=>s.jsx("span",{className:"text-xs font-mono px-1 py-0.5 rounded",style:{backgroundColor:e.surface,border:`1px solid ${e.border}`,color:e.accent,fontSize:"10px"},children:t},t))})]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs mb-1",style:{color:e.dim},children:"Agents"}),s.jsx("div",{className:"flex gap-1 flex-wrap",children:l.agents.map(t=>s.jsx("span",{className:"text-xs font-mono px-1 py-0.5 rounded",style:{backgroundColor:e.surface,color:e.text,fontSize:"10px"},children:t},t))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs mb-1",style:{color:e.dim},children:"Tools"}),s.jsx("div",{className:"flex gap-1 flex-wrap",children:l.tools.map(t=>s.jsx("span",{className:"text-xs font-mono px-1 py-0.5 rounded",style:{backgroundColor:e.surface,color:e.text,fontSize:"10px"},children:t},t))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs",style:{color:e.dim},children:"Network Policy"}),s.jsx("div",{className:"text-xs font-mono mt-1",style:{color:l.networkPolicy==="air-gapped"?"#ef4444":e.accent},children:C[l.networkPolicy]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs",style:{color:e.dim},children:"Last Pen Test"}),s.jsx("div",{className:"text-sm font-mono",style:{color:e.text},children:l.lastPenTest})]})]})]},l.id))})]})}export{I as CapabilityCompartments};