PageSourceSearch

https://infrarails.ai/_next/static/chunks/14617-5e5f11b08acbd062.js

js infrarails.ai collected 2026-10-09 22:55:34 UTC 62,402 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14617],{6744:(e,s,t)=>{t.r(s),t.d(s,{SystemsContent:()=>eC,SystemsDashboard:()=>eA,default:()=>eD});var a=t(95155),l=t(12115),i=t(52619),n=t.n(i),r=t(20063),o=t(95706),c=t(90960),d=t(64269),m=t(78222),u=t(41398),x=t(71152),p=t(75444),h=t(81656),g=t(80011),b=t(40051),v=t(86948),j=t(3998),_=t(88376),f=t(11186),y=t(29945),w=t(64826),N=t(46767),k=t(94465),A=t(18332),S=t(9582),C=t(25563),M=t(78500),D=t(23327);function z(e){let{isOpen:s,onClose:t,totalCount:i,conflictCount:n,actionLabel:r,onOverride:o,onSkip:c,onMerge:d}=e,[m,u]=l.useState(null),[x,p]=l.useState(null),h=i-n,g=async(e,s)=>{u(e),p(null);try{await s(),t()}catch(e){p(e instanceof Error?e.message:"Action failed. Please try again.")}finally{u(null)}},b=null!==m;return(0,a.jsx)(k.aF,{open:s,onClose:t,title:"Conflicting assignments detected",description:r,size:"lg",closeOnBackdropClick:!b,closeOnEscape:!b,footer:(0,a.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,a.jsx)(j.$,{variant:"outline",size:"sm",onClick:t,disabled:b,children:"Cancel"})}),children:(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsx)(A.Fc,{variant:"warning",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(S.A,{className:"w-4 h-4 mt-0.5 shrink-0 text-amber-600","aria-hidden":"true"}),(0,a.jsxs)("p",{className:"text-sm text-amber-800",children:[(0,a.jsxs)("span",{className:"font-semibold",children:[n," of ",i," selected systems"]})," ","already have a conflicting assignment. Choose how to proceed:"]})]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"rounded-lg border border-slate-200 p-4 space-y-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"mt-0.5 rounded-full bg-red-50 p-1.5 shrink-0",children:(0,a.jsx)(S.A,{className:"w-4 h-4 text-red-600","aria-hidden":"true"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:"Override all"}),(0,a.jsxs)("p",{className:"text-xs text-slate-500 mt-0.5",children:["Applies to ",(0,a.jsxs)("span",{className:"font-medium text-slate-700",children:["all ",i," systems"]}),". Existing conflicting assignments are replaced."]})]}),(0,a.jsx)(j.$,{size:"sm",variant:"destructive",onClick:()=>g("override",o),disabled:b,"data-testid":"bulk-conflict-override","aria-label":"Override: apply to all ".concat(i," systems"),children:"override"===m?"Applying…":"Override"})]})}),(0,a.jsx)("div",{className:"rounded-lg border border-slate-200 p-4 space-y-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"mt-0.5 rounded-full bg-blue-50 p-1.5 shrink-0",children:(0,a.jsx)(C.A,{className:"w-4 h-4 text-blue-600","aria-hidden":"true"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:"Skip conflicts"}),(0,a.jsxs)("p",{className:"text-xs text-slate-500 mt-0.5",children:["Applies to"," ",(0,a.jsxs)("span",{className:"font-medium text-slate-700",children:[h," of ",i," systems"]}),"."," ",(0,a.jsxs)("span",{className:"font-medium text-slate-700",children:[n," ",1===n?"system":"systems"," skipped"]})," ","(existing assignments unchanged)."]})]}),(0,a.jsx)(j.$,{size:"sm",variant:"outline",onClick:()=>g("skip",c),disabled:b||0===h,"data-testid":"bulk-conflict-skip","aria-label":"Skip conflicts: apply to ".concat(h," of ").concat(i," systems"),children:"skip"===m?"Applying…":"Skip conflicts"})]})}),(0,a.jsx)("div",{className:"rounded-lg border border-slate-200 p-4 space-y-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"mt-0.5 rounded-full bg-green-50 p-1.5 shrink-0",children:(0,a.jsx)(M.A,{className:"w-4 h-4 text-green-600","aria-hidden":"true"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-slate-900",children:"Merge"}),(0,a.jsxs)("p",{className:"text-xs text-slate-500 mt-0.5",children:["Applies to ",(0,a.jsxs)("span",{className:"font-medium text-slate-700",children:["all ",i," systems"]}),". Adds the new assignment alongside existing ones — nothing is removed."]})]}),(0,a.jsx)(j.$,{size:"sm",variant:"default",onClick:()=>g("merge",d),disabled:b,"data-testid":"bulk-conflict-merge","aria-label":"Merge: add to all ".concat(i," systems without replacing"),children:"merge"===m?"Applying…":"Merge"})]})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500 bg-slate-50 rounded-md px-3 py-2",children:[(0,a.jsx)(D.A,{className:"w-3.5 h-3.5 shrink-0","aria-hidden":"true"}),(0,a.jsx)("span",{children:"This action will be logged in the audit trail."})]}),x&&(0,a.jsx)("p",{className:"text-sm text-red-600",role:"alert",children:x})]})})}var O=t(15870),R=t(79552),I=t(6191),E=t(86651),T=t(53842),L=t(41016),P=t(85921),G=t(17910),F=t(50906),$=t(42516),H=t(57828),U=t(93499),B=t(95707),K=t(80598),Z=t(26921),V=t(47937),q=t(65229),J=t(50069),W=t(31716),Y=t(64347),Q=t(91169),X=t(39867);t(24033),t(12108);var ee=t(63581),es=t(30940),et=t(91456),ea=t(90368),el=t(27937);let ei=[{value:"all",label:"All Statuses"},{value:"active",label:"Active"},{value:"pending_setup",label:"Pending Setup"},{value:"inactive",label:"Inactive"},{value:"new",label:"New"},{value:"shadow",label:"Shadow"},{value:"maintenance",label:"Maintenance"},{value:"degraded",label:"Degraded"},{value:"decommissioned",label:"Decommissioned"}],en=[{value:"all",label:"All AI Types"},{value:"LLM_CHATBOT",label:"LLM Chatbot"},{value:"AGENT",label:"AI Agent"},{value:"RAG_APP",label:"RAG App"},{value:"CLASSIFIER",label:"Classifier"},{value:"CODE_GENERATOR",label:"Code Generator"},{value:"MULTIMODAL",label:"Multimodal"},{value:"RECOMMENDATION_SYSTEM",label:"Recommender"},{value:"OTHER",label:"Other"}],er=[{value:"all",label:"All Regions"},{value:"us-east",label:"US East"},{value:"us-west",label:"US West"},{value:"eu-west",label:"EU West"},{value:"eu-central",label:"EU Central"},{value:"ap-south",label:"AP South"},{value:"ap-east",label:"AP East"},{value:"global",label:"Global"}],eo=[{value:"all",label:"All Risk Tiers"},{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"},{value:"minimal",label:"Minimal"}],ec=[{value:"all",label:"All Sources"},{value:"manual",label:"Manual"},{value:"discovered",label:"Discovered"},{value:"imported",label:"Imported"},{value:"api",label:"API"},{value:"shadow_ai",label:"Shadow AI"},{value:"evaluate",label:"Evaluate"},{value:"guard",label:"Guard"}],ed=[{value:"all",label:"All Decision Types"},{value:"claim_prioritization",label:"Claim Prioritization"},{value:"fraud_alert",label:"Fraud Alert"},{value:"credit_decision",label:"Credit Decision"},{value:"customer_routing",label:"Customer Routing"},{value:"payment_decision",label:"Payment Decision"},{value:"content_moderation",label:"Content Moderation"},{value:"employment_screening",label:"Employment Screening"},{value:"medical_triage",label:"Medical Triage"},{value:"risk_scoring",label:"Risk Scoring"},{value:"other",label:"Other"}],em={discovered:"☁",shadow_ai:"\uD83D\uDD0D",manual:"✋",imported:"\uD83D\uDCC4",evaluate:"\uD83D\uDD17",guard:"\uD83D\uDEE1",api:"⚡"},eu=[{value:"none",label:"No Grouping"},{value:"region",label:"By Region"},{value:"ai_type",label:"By AI Type"},{value:"status",label:"By Status"},{value:"group",label:"By Group"}],ex=[25,50,100,200],ep=[{id:"demo-001",name:"Customer Support Copilot",description:"GPT-4 powered customer support chatbot handling tier-1 inquiries across all channels.",status:"active",enabled:!0,system_type:"LLM_CHATBOT",ai_type_label:"LLM Chatbot",region:"us-east",risk_t
1ier:"medium",source_type:"manual",trust_score:82,trust_score_trend:2.1,guard_active:!0,monitor_active:!0,compliance_frameworks_passing:3,compliance_frameworks_total:4,last_seen:new Date(Date.now()-3e5).toISOString(),created_at:"2025-11-15T10:00:00Z",updated_at:new Date().toISOString(),owner_name:"Sarah Chen",organization_id:"demo-org"},{id:"demo-002",name:"Claims Processing Agent",description:"Autonomous agent that triages, validates, and routes insurance claims with human-in-the-loop approval.",status:"active",enabled:!0,system_type:"AGENT",ai_type_label:"AI Agent",region:"eu-west",risk_tier:"high",source_type:"manual",trust_score:71,trust_score_trend:-1.3,guard_active:!0,monitor_active:!0,compliance_frameworks_passing:2,compliance_frameworks_total:5,last_seen:new Date(Date.now()-6e5).toISOString(),created_at:"2025-10-20T08:30:00Z",updated_at:new Date().toISOString(),owner_name:"James Miller",organization_id:"demo-org"},{id:"demo-003",name:"Policy Knowledge Base",description:"RAG system over 50K+ internal policy documents for compliance and legal teams.",status:"active",enabled:!0,system_type:"RAG_APP",ai_type_label:"RAG Application",region:"us-west",risk_tier:"medium",source_type:"discovered",trust_score:88,trust_score_trend:.5,guard_active:!1,monitor_active:!0,compliance_frameworks_passing:4,compliance_frameworks_total:4,last_seen:new Date(Date.now()-12e4).toISOString(),created_at:"2025-09-05T14:20:00Z",updated_at:new Date().toISOString(),owner_name:"Lisa Park",organization_id:"demo-org"},{id:"demo-004",name:"Transaction Fraud Detector",description:"Real-time ML classifier scoring transactions for fraud risk across payment rails.",status:"active",enabled:!0,system_type:"CLASSIFIER",ai_type_label:"ML Classifier",region:"us-east",risk_tier:"critical",source_type:"api",trust_score:64,trust_score_trend:-3.2,guard_active:!0,monitor_active:!0,compliance_frameworks_passing:2,compliance_frameworks_total:6,last_seen:new Date(Date.now()-6e4).toISOString(),created_at:"2025-08-12T09:00:00Z",updated_at:new Date().toISOString(),owner_name:"Raj Patel",organization_id:"demo-org"},{id:"demo-005",name:"DevAssist Code Generator",description:"AI-powered code generation tool integrated into the internal IDE for engineering teams.",status:"active",enabled:!0,system_type:"CODE_GENERATOR",ai_type_label:"Code Generator",region:"global",risk_tier:"medium",source_type:"manual",trust_score:76,trust_score_trend:1.8,guard_active:!0,monitor_active:!1,compliance_frameworks_passing:3,compliance_frameworks_total:3,last_seen:new Date(Date.now()-9e5).toISOString(),created_at:"2026-01-10T11:45:00Z",updated_at:new Date().toISOString(),owner_name:"Alex Rivera",organization_id:"demo-org"},{id:"demo-006",name:"Content Moderation Pipeline",description:"Multimodal AI reviewing text, images, and video for policy violations across user-generated content.",status:"active",enabled:!0,system_type:"MULTIMODAL",ai_type_label:"Multimodal AI",region:"eu-central",risk_tier:"high",source_type:"manual",trust_score:73,trust_score_trend:.2,guard_active:!0,monitor_active:!0,compliance_frameworks_passing:3,compliance_frameworks_total:5,last_seen:new Date(Date.now()-18e4).toISOString(),created_at:"2025-12-01T16:30:00Z",updated_at:new Date().toISOString(),owner_name:"Maria Santos",organization_id:"demo-org"},{id:"demo-007",name:"Product Recommender v3",description:"Recommendation engine personalizing product suggestions across web and mobile storefronts.",status:"active",enabled:!0,system_type:"RECOMMENDATION_SYSTEM",ai_type_label:"Recommendation Engine",region:"ap-east",risk_tier:"low",source_type:"discovered",trust_score:91,trust_score_trend:.8,guard_active:!1,monitor_active:!0,compliance_frameworks_passing:2,compliance_frameworks_total:2,last_seen:new Date(Date.now()-24e4).toISOString(),created_at:"2025-07-22T13:10:00Z",updated_at:new Date().toISOString(),owner_name:"David Kim",organization_id:"demo-org"},{id:"demo-008",name:"HR Resume Screener",description:"ML classifier pre-screening resumes for open positions — under review for bias assessment.",status:"shadow",enabled:!1,system_type:"CLASSIFIER",ai_type_label:"ML Classifier",region:"us-west",risk_t
1ier:"critical",source_type:"shadow_ai",trust_score:42,trust_score_trend:-5.1,guard_active:!1,monitor_active:!1,compliance_frameworks_passing:0,compliance_frameworks_total:4,last_seen:new Date(Date.now()-72e5).toISOString(),created_at:"2026-02-18T08:00:00Z",updated_at:new Date().toISOString(),owner_name:"Unknown",organization_id:"demo-org"}];function eh(e){let{status:s}=e,t={active:{color:"bg-emerald-100 text-emerald-800",icon:(0,a.jsx)(C.A,{className:"w-3 h-3"}),label:"Active"},pending_setup:{color:"bg-amber-100 text-amber-700",icon:(0,a.jsx)(O.A,{className:"w-3 h-3"}),label:"Setup Required"},inactive:{color:"bg-slate-100 text-slate-600",icon:(0,a.jsx)(R.A,{className:"w-3 h-3"}),label:"Inactive"},new:{color:"bg-amber-100 text-amber-700",icon:(0,a.jsx)(I.A,{className:"w-3 h-3"}),label:"New"},shadow:{color:"bg-yellow-100 text-yellow-800",icon:(0,a.jsx)(E.A,{className:"w-3 h-3"}),label:"Shadow"},maintenance:{color:"bg-amber-100 text-amber-800",icon:(0,a.jsx)(T.A,{className:"w-3 h-3"}),label:"Maintenance"},degraded:{color:"bg-orange-100 text-orange-800",icon:(0,a.jsx)(S.A,{className:"w-3 h-3"}),label:"Degraded"},decommissioned:{color:"bg-red-100 text-red-800",icon:(0,a.jsx)(L.A,{className:"w-3 h-3"}),label:"Decommissioned"}},l=t[s]||t.inactive;return(0,a.jsxs)("span",{className:(0,d.cn)("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium",l.color),children:[l.icon," ",l.label]})}function eg(e){let{score:s}=e;if(null==s)return(0,a.jsx)("span",{className:"text-slate-400 text-xs",children:"--"});let t=s>=80?"text-emerald-600":s>=60?"text-amber-600":"text-red-600";return(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:(0,d.cn)("text-sm font-semibold",t),children:s.toFixed(0)}),(0,a.jsx)("div",{className:"w-12 h-1.5 bg-slate-100 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:(0,d.cn)("h-full rounded-full",s>=80?"bg-emerald-500":s>=60?"bg-amber-500":"bg-red-500"),style:{width:"".concat(Math.min(100,s),"%")}})})]})}function eb(e){let{tier:s}=e,t={critical:"bg-red-100 text-red-800",high:"bg-orange-100 text-orange-800",medium:"bg-amber-100 text-amber-800",low:"bg-blue-100 text-blue-800",minimal:"bg-slate-100 text-slate-600"};return(0,a.jsx)("span",{className:(0,d.cn)("px-1.5 py-0.5 rounded text-[10px] font-medium uppercase",t[s]||t.medium),children:s})}function ev(e){let{system:s}=e,t=function(e,s){var t,a;let l=null!=e.trust_score,i=!0===e.guard_active,n=!0===e.monitor_active&&!0!==e.monitoring_paused,r=(null!=(t=e.compliance_frameworks_total)?t:0)>0,o=r&&(null!=(a=e.compliance_frameworks_passing)?a:0)>0;return{evaluationDone:l,guardDone:i,monitorDone:n,complyAvailable:r,complyDone:o}}(s),l=function(e){let s=[e.evaluationDone?"Evaluation done":"Evaluation pending",e.guardDone?"Guard done":"Guard pending",e.monitorDone?"Monitor done":"Monitor pe
1nding"];return e.complyAvailable&&s.push(e.complyDone?"Comply done":"Comply pending"),s.join(" \xb7 ")}(t),i=function(e){let s=[e.evaluationDone?"Evaluation done":"Evaluation pending",e.guardDone?"Guard done":"Guard pending",e.monitorDone?"Monitor done":"Monitor pending"];return e.complyAvailable&&s.push(e.complyDone?"Comply done":"Comply pending"),"Setup status: ".concat(s.join(", "))}(t),n=[{done:t.evaluationDone,label:"Evaluation"},{done:t.guardDone,label:"Guard"},{done:t.monitorDone,label:"Monitor"},{done:t.complyDone,na:!t.complyAvailable,label:"Comply"}];return(0,a.jsx)(N.m_,{content:l,side:"top",align:"center",children:(0,a.jsx)("span",{className:"inline-flex items-center gap-1 cursor-default","aria-label":i,tabIndex:0,role:"img",children:n.map(e=>(0,a.jsx)("span",{className:(0,d.cn)("inline-block h-2 w-2 rounded-full",e.na?"bg-slate-300":e.done?"bg-emerald-500":"bg-amber-400")},e.label))})})}function ej(e){let{value:s,options:t,onChange:l,className:i}=e;return(0,a.jsx)("select",{value:s,onChange:e=>l(e.target.value),className:(0,d.cn)("px-2 py-1.5 text-xs border border-slate-200 rounded-md bg-white text-slate-700","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",i),children:t.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})}function e_(e){let{system:s,selected:t,onToggle:l,onQuickAction:i,onOpenPanel:r}=e;return(0,a.jsxs)("div",{className:(0,d.cn)("bg-white border rounded-lg p-4 hover:shadow-md transition-all",t?"border-blue-500 ring-1 ring-blue-200":"border-slate-200"),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:l,className:"rounded border-slate-300 text-blue-600 focus:ring-blue-500"}),(0,a.jsx)(n(),{href:"/app/systems/".concat(s.id),className:"text-sm font-semibold text-slate-900 hover:text-blue-600",children:s.name})]}),(0,a.jsx)(eh,{status:s.status})]}),s.description&&(0,a.jsx)("p",{className:"text-xs text-slate-500 mb-3 line-clamp-2",children:s.description}),s.business_unit_name&&(0,a.jsx)("div",{className:"mb-3",children:(0,a.jsx)("span",{className:"text-xs text-slate-500 bg-slate-100 px-1.5 py-0.5 rounded",children:s.business_unit_name})}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 mb-3 text-xs",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-slate-400",children:"AI Type"}),(0,a.jsx)("div",{className:"font-medium text-slate-700",children:s.ai_type_label})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-slate-400",children:"Region"}),(0,a.jsx)("div",{className:"font-medium text-slate-700",children:s.region})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-slate-400",children:"Trust Score"}),(0,a.jsx)(eg,{score:s.trust_score})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-slate-400",children:"Risk Tier"}),(0,a.jsx)("div",{children:(0,a.jsx)(eb,{tier:s.risk_tier})})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3 border-t border-slate-100",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(j.K,{"aria-label":"Evaluate",onClick:()=>i("evaluate"),icon:(0,a.jsx)(P.A,{className:"w-3.5 h-3.5"}),size:"xs",className:"!h-auto !w-auto !p-1.5 rounded-md hover:bg-blue-50 text-slate-400 hover:text-blue-600",title:"Evaluate"}),(0,a.jsx)(j.K,{"aria-label":s.guard_active?"Guard active":"Set up Guard",onClick:()=>i("guard"),icon:(0,a.jsx)(G.A,{className:"w-3.5 h-3.5"}),size:"xs",className:(0,d.cn)("!h-auto !w-auto !p-1.5 rounded-md",s.guard_active?"bg-blue-50 text-blue-600":"text-slate-400 hover:bg-slate-100 hover:text-slate-600"),title:s.guard_active?"Guard active":"Set up Guard"}),(0,a.jsx)(j.K,{"aria-label":s.monitor_active?"Monitor active":"Set up Monitor",onClick:()=>i("monitor"),icon:(0,a.jsx)(F.A,{className:"w-3.5 h-3.5"}),size:"xs",className:(0,d.cn)("!h-auto !w-auto !p-1.5 rounded-md",s.monitor_active?"bg-emerald-50 text-emerald-600":"text-slate-400 hover:bg-slate-100 hover:text-slate-600"),title:s.monitor_active?"Monitor active":"Set up Monitor"}),(0,a.jsx)(j.K,{"aria-label":"Compliance",onClick:()=>i("comply"),icon:(0,a.jsx)($.A,{className:"w-3.5 h-3.5"}),size:"xs",className:"!h-auto !w-auto !p-1.5 rounded-md hover:bg-purple-50 text-slate-400 hover:text-purple-600",title:"Compliance"})]}),(0,a.jsx)(j.K,{"aria-label":"Quick preview",type:"button",onClick:e=>{e.stopPropagation(),null==r||r()},icon:(0,a.jsx)(H.A,{className:"w-3.5 h-3.5"}),size:"xs",className:"!h-auto !w-auto !p-1 hover:bg-blue-50 text-slate-400 hover:text-blue-600",title:"Quick preview"}),(0,a.jsx)(n(),{href:"/app/systems/".concat(s.id),onClick:e=>e.stopPropagation(),className:"p-1 hover:bg-slate-100 rounded text-slate-400 hover:text-slate-600 transition-colors",title:"Open system page",children:(0,a.jsx)(U.A,{className:"w-3.5 h-3.5"})})]}),s.last_seen&&(0,a.jsxs)("div",{className:"text-[10px] text-slate-400 mt-2",children:["Last seen ",(0,d.fw)(s.last_seen)]})]})}let ef={active:"bg-emerald-500",pending_setup:"bg-amber-500",inactive:"bg-slate-400",new:"bg-amber-400",shadow:"bg-yellow-500",maintenance:"bg-amber-600",degraded:"bg-orange-500",decommissioned:"bg-red-500"},ey={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-amber-500",low:"bg-blue-500",minimal:"bg-slate-400"},ew=["critical","high","medium","low","minimal"];function eN(e,s){return 0===s?"0%":"".concat(Math.round(e/s*100),"%")}function ek(e){let{label:s,count:t,total:l,color:i}=e,n=l>0?t/l*100:0;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs mb-1",children:[(0,a.jsx)("span",{className:"text-slate-700 capitalize",children:s.replace(/_/g," ")}),(0,a.jsxs)("span",{className:"text-slate-500 tabular-nums",children:[t," ",(0,a.jsxs)("span",{className:"text-slate-400",children:["(",Math.round(n),"%)"]})]})]}),(0,a.jsx)("div",{className:"w-full h-1.5 bg-slate-100 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:(0,d.cn)("h-full rounded-full",i),style:{width:"".concat(Math.max(2,n),"%")}})})]})}function eA(){let{user:e,loading:s}=(0,o.As)(),[t,i]=(0,l.useState)([]),[r,d]=(0,l.useState)(null),[m,u]=(0,l.useState)(!0),[p,h]=(0,l.useState)(!1);(0,l.useEffect)(()=>
1{if(s||!e)return;let t=!1;return(async()=>{try{var e,s,a,l,n,r;u(!0);let o=await c.systemHubApi.list({page:1,page_size:200});if(t)return;i((null==(e=o.data)?void 0:e.systems)||[]),d(null!=(r=null!=(n=null==(s=o.data)?void 0:s.total)?n:null==(l=o.data)||null==(a=l.systems)?void 0:a.length)?r:0),h(!1)}catch(e){if(t)return;i(ep),d(ep.length),h(!0)}finally{t||u(!1)}})(),()=>{t=!0}},[s,e]);let g=(0,l.useMemo)(()=>{let e=null!=r?r:t.length,s=t.filter(e=>"active"===e.status).length,a=t.filter(e=>"pending_setup"===e.status).length,l=t.filter(e=>"shadow"===e.status).length,i=t.filter(e=>"number"==typeof e.trust_score),n=i.length>0?i.reduce((e,s)=>e+(s.trust_score||0),0)/i.length:0,o=t.filter(e=>"critical"===e.risk_tier||"high"===e.risk_tier).length,c=t.filter(e=>e.guard_active).length,d=t.filter(e=>e.monitor_active).length,m=t.filter(e=>e.guard_active&&e.monitor_active).length,u={};for(let e of t)u[e.status]=(u[e.status]||0)+1;let x={};for(let e of t)x[e.risk_tier]=(x[e.risk_tier]||0)+1;let p={};for(let e of t){let s=e.ai_type_label||e.system_type||"Unknown";p[s]=(p[s]||0)+1}let h=Object.entries(p).map(e=>{let[s,t]=e;return{label:s,count:t}}).sort((e,s)=>s.count-e.count),g=t.filter(e=>"number"==typeof e.trust_score).sort((e,s)=>(e.trust_score||0)-(s.trust_score||0)).slice(0,5);return{total:e,active:s,pendingSetup:a,shadow:l,avgTrustScore:n,scoredCount:i.length,highRisk:o,guardActive:c,monitorActive:d,bothActive:m,byStatus:u,byRiskTier:x,aiTypeRows:h,lowestScores:g}},[t,r]);if(m&&0===t.length)return(0,a.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:Array.from({length:6}).map((e,s)=>(0,a.jsx)("div",{className:"h-24 bg-white border border-slate-200 rounded-md animate-pulse"},s))});if(0===t.length)return(0,a.jsxs)("div",{className:"bg-white border border-slate-200 rounded-lg p-12 text-center",children:[(0,a.jsx)("div",{className:"w-16 h-16 bg-slate-100 rounded-lg flex items-center justify-center mx-auto mb-4",children:(0,a.jsx)(B.A,{className:"w-8 h-8 text-slate-400"})}),(0,a.jsx)("h2",{className:"text-lg font-semibold text-slate-900 mb-2",children:"No AI systems yet"}),(0,a.jsx)("p",{className:"text-sm text-slate-500 mb-6",children:"Register or discover AI systems to see organization-wide trust posture here."}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,a.jsx)(x.Bk,{permission:"systems.create",children:(0,a.jsxs)(n(),{href:"/app/systems/new",className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 transition-colors",children:[(0,a.jsx)(I.A,{className:"w-4 h-4"})," Register System"]})}),(0,a.jsxs)(n(),{href:"/app/discover?tab=sources",className:"inline-flex items-center gap-2 px-4 py-2 bg-white text-slate-700 text-sm font-medium border border-slate-300 rounded-md hover:bg-slate-50 transition-colors",children:[(0,a.jsx)(E.A,{className:"w-4 h-4"})," Discover Systems"]})]})]});let b=0===g.scoredCount?"slate":g.avgTrustScore>=80?"green":g.avgTrustScore>=60?"amber":"red";return(0,a.jsxs)("div",{className:"space-y-4",children:[p&&(0,a.jsx)("div",{className:"bg-amber-50 border border-amber-200 rounded-md px-3 py-2 text-xs text-amber-800",children:"Showing demo data — backend unreachable."}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:[(0,a.jsx)(v.hI,{title:"Total Systems",value:g.total,description:"all sources",icon:(0,a.jsx)(B.A,{className:"w-5 h-5"}),color:"blue"}),(0,a.jsx)(v.hI,{title:"Active",value:g.active,description:eN(g.active,g.total)+" of total",icon:(0,a.jsx)(C.A,{className:"w-5 h-5"}),color:"green"}),(0,a.jsx)(v.hI,{title:"Pending Setup",value:g.pendingSetup,description:g.pendingSetup>0?"needs attention":"all set",icon:(0,a.jsx)(O.A,{className:"w-5 h-5"}),color:g.pendingSetup>0?"amber":"slate"}),(0,a.jsx)(v.hI,{title:"Avg Trust Score",value:g.scoredCount>0?g.avgTrustScore.toFixed(0):"--",description:g.scoredCount>0?"across ".concat(g.scoredCount," scored"):"no scored systems",icon:(0,a.jsx)(K.A,{className:"w-5 h-5"}),color:b}),(0,a.jsx)(v.hI,{title:"High+Critical Risk",value:g.highRisk,description:eN(g.highRisk,g.total)+" of total",icon:(0,a.jsx)(S.A,{className:"w-5 h-5"}),color:g.highRisk>0?"red":"slate"}),(0,a.jsx)(v.hI,{title:"Guard + Monitor",value:eN(g.bothActive,g.total),description:"".concat(g.guardActive," guard \xb7 ").concat(g.monitorActive," monitor"),icon:(0,a.jsx)(G.A,{className:"w-5 h-5"}),color:"blue"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[(0,a.jsx)(v.Zp,{title:"By Status",padding:"md",children:(0,a.jsx)("div",{className:"space-y-2.5",children:Object.entries(g.byStatus).sort((e,s)=>s[1]-e[1]).map(e=>{let[s,t]=e;return(0,a.jsx)(ek,{label:s,count:t,total:g.total,color:ef[s]||"bg-slate-400"},s)})})}),(0,a.jsx)(v.Zp,{title:"By Risk Tier",padding:"md",children:(0,a.jsxs)("div",{className:"space-y-2.5",children:[ew.filter(e=>g.byRiskTier[e]>0).map(e=>(0,a.jsx)(ek,{label:e,count:g.byRiskTier[e]||0,total:g.total,color:ey[e]},e)),ew.every(e=>!g.byRiskTier[e])&&(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"No risk-tier data available."})]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[(0,a.jsx)(v.Zp,{title:"By AI Type",padding:"md",children:(0,a.jsx)("div",{className:"space-y-2.5",children:0===g.aiTypeRows.length?(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"No AI type data available."}):g.aiTypeRows.map(e=>(0,a.jsx)(ek,{label:e.label,count:e.count,total:g.total,color:"bg-blue-500"},e.label))})}),(0,a.jsx)(v.Zp,{title:"Lowest Trust Scores",subtitle:"Systems most in need of review",padding:"md",children:0===g.lowestScores.length?(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"No scored systems yet."}):(0,a.jsx)("ul",{className:"divide-y divide-slate-100",children:g.lowestScores.map(e=>(0,a.jsxs)("li",{className:"flex items-center justify-between py-2 first:pt-0 last:pb-0",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)(n(),{href:"/app/systems/".concat(e.id),className:"text-sm font-medium text-slate-900 hover:text-blue-600 truncate block",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,a.jsx)("span",{className:"text-[10px] text-slate-500",children:e.ai_type_label}
1),(0,a.jsx)(eb,{tier:e.risk_tier})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 ml-3",children:[(0,a.jsx)(Z.A,{className:"w-3.5 h-3.5 text-slate-400"}),(0,a.jsx)(eg,{score:e.trust_score})]})]},e.id))})})]})]})}function eS(){var e,s,t,i,h;let g=(0,r.useRouter)(),{user:N,loading:k}=(0,o.As)(),{hasPermission:A}=(0,p.Sk)(),[S,C]=(0,l.useState)([]),[M,D]=(0,l.useState)(0),[O,R]=(0,l.useState)(!0),[L,U]=(0,l.useState)(""),[Z,ep]=(0,l.useState)(""),[ef,ey]=(0,l.useState)("all"),[ew,eN]=(0,l.useState)("all"),[ek,eA]=(0,l.useState)("all"),[eS,eC]=(0,l.useState)("all"),[eM,eD]=(0,l.useState)("all"),[ez,eO]=(0,l.useState)("all"),[eR,eI]=(0,l.useState)("all"),[eE,eT]=(0,l.useState)(!1),[eL,eP]=(0,l.useState)("table"),[eG,eF]=(0,l.useState)("none"),[e$,eH]=(0,l.useState)("name"),[eU,eB]=(0,l.useState)("asc"),[eK,eZ]=(0,l.useState)(null),[eV,eq]=(0,l.useState)(!1),[eJ,eW]=(0,l.useState)(1),[eY,eQ]=(0,l.useState)(50),[eX,e0]=(0,l.useState)(new Set),[e5,e1]=(0,l.useState)(""),[e2,e3]=(0,l.useState)(!1),[e4,e6]=(0,l.useState)(""),[e8,e7]=(0,l.useState)(!1),[e9,se]=(0,l.useState)(null),[ss,st]=(0,l.useState)(null),[sa,sl]=(0,l.useState)([]),[si,sn]=(0,l.useState)(!1),[sr,so]=(0,l.useState)([]),[sc,sd]=(0,l.useState)(!1),[sm,su]=(0,l.useState)(null),[sx,sp]=(0,l.useState)(!1),sh=eX.size>0,sg=[ef,ew,ek,eS,eM,ez,eR].filter(e=>"all"!==e).length,sb=(0,l.useCallback)(async()=>{if(N)try{var e,s;R(!0);let t={page:eJ,page_size:eY,sort_by:e$,sort_dir:eU};Z&&(t.search=Z),"all"!==ef&&(t.status=ef),"all"!==ew&&(t.ai_type=ew),"all"!==ek&&(t.region=ek),"all"!==eS&&(t.risk_tier=eS),"all"!==eM&&(t.source_type=eM),"all"!==ez&&(t.owner_name=ez),"all"!==eR&&(t.decision_type=eR);let a=await c.systemHubApi.list(t);C((null==(e=a.data)?void 0:e.systems)||[]),D((null==(s=a.data)?void 0:s.total)||0),U("")}catch(e){C([]),D(0),U("Failed to load AI systems — the systems API is unreachable. Refresh to retry.")}finally{R(!1)}},[N,Z,ef,ew,ek,eS,eM,ez,eR,eJ,eY,e$,eU]);(0,l.useEffect)(()=>{!k&&N&&sb()},[k,N,sb]),(0,l.useEffect)(()=>{eW(1)},[Z,ef,ew,ek,eS,eM,ez,eR,eY]);let sv=(0,l.useMemo)(()=>{if("none"===eG)return{"":S};let e={};for(let s of S){let t="";switch(eG){case"region":t=s.region;break;case"ai_type":t=s.ai_type_label;break;case"status":t=s.status;break;case"group":t=s.group_name||"Ungrouped"}e[t]||(e[t]=[]),e[t].push(s)}return e},[S,eG]),sj=(0,l.useMemo)(()=>{let e=new Set;for(let s of S)s.owner_name&&e.add(s.owner_name);return[{value:"all",label:"All Owners"},...Array.from(e).sort().map(e=>({value:e,label:e}))]},[S]),s_=(0,l.useCallback)(e=>{e0(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},[]);(0,l.useCallback)(()=>{eX.size===S.length&&S.length>0?e0(new Set):e0(new Set(S.map(e=>e.id)))},[S,eX.size]);let sf=(0,l.useCallback)(()=>e0(new Set),[]),sy=(0,m.dj)(),[sw,sN]=(0,l.useState)(!1),sk=(0,l.useCallback)(async(e,s)=>{switch(e){case"evaluate":var t,a,l,i,n,r,o;if(sw)return;sN(!0);try{let e=await c.evaluationsApi.create(s.id,{mode:"STANDARD"}),r=null!=(n=null!=(i=null==e||null==(t=e.data)?void 0:t.id)?i:null==e||null==(a=e.data)?void 0:a.run_id)?n:null==e||null==(l=e.data)?void 0:l.evaluation_id;r?(sy.success("Evaluation started for ".concat(s.name),"Opening report..."),g.push("/app/reports/".concat(r))):(sy.success("Evaluation started for ".concat(s.name),"View the new run in the Evaluations tab."),g.push("/app/systems/".concat(s.id)))}catch(s){let e=(0,u._R)(s);sy.error("Failed to start evaluation",null!=(o=null!=(r=e.userMessage)?r:e.message)?o:"Please try again.")}finally{sN(!1)}break;case"detail":g.push("/app/systems/".concat(s.id));break;case"toggle":try{await c.systemHubApi.toggleEnabled(s.id,!s.enabled),sb()}catch(e){U("Failed to toggle system")}break;case"guard":g.push("/app/guard?tab=gateway&system_id=".concat(s.id));break;case"monitor":g.push("/app/guard?tab=trust-shield&system_id=".concat(s.id));break;case"comply":g.push("/app/compliance-center?system_id=".concat(s.id))}},[g,sb,sw,sy]),sA=(0,l.useCallback)(async e=>{let s=Array.from(eX);if(0!==s.length){if("evaluate"===e){if(sw)return;sN(!0);try{await c.systemHubApi.bulkAction(e,s),sy.success("Evaluation started for ".concat(s.length," ").concat(1===s.length?"system":"systems"),"View runs in the Evaluations tab."),sf(),sb()}catch(s){var t,a;let e=(0,u._R)(s);sy.error("Failed to start bulk evaluation",null!=(a=null!=(t=e.userMe
1ssage)?t:e.message)?a:"Please try again.")}finally{sN(!1)}return}try{await c.systemHubApi.bulkAction(e,s),sf(),sb()}catch(s){U("Failed to ".concat(e))}}},[eX,sf,sb,sw,sy]),sS=(0,l.useCallback)(()=>{let e=new Blob([JSON.stringify(S.filter(e=>eX.has(e.id)),null,2)],{type:"application/json"}),s=URL.createObjectURL(e),t=document.createElement("a");t.href=s,t.download="systems-export-".concat(new Date().toISOString().slice(0,10),".json"),t.click(),URL.revokeObjectURL(s)},[S,eX]),sC=(0,l.useCallback)(e=>{let s=Array.from(eX).join(",");g.push(e.replace("{selected}",s))},[eX,g]),sM=(0,l.useCallback)(async()=>{if(!e5.trim())return;let e=Array.from(eX);try{await c.systemHubApi.bulkAction("patch",e,{owner_name:e5.trim()}),e1(""),e3(!1),sf(),sb()}catch(e){U("Failed to assign owner")}},[eX,e5,sf,sb]),sD=(0,l.useCallback)(async()=>{if(e3(!0),sr.length>0||sc)return;let e=null==N?void 0:N.organization_id;if(!e)return void su("Could not determine your organization. Please reload and try again.");sd(!0),su(null);try{var s,t;let a=null!=(t=null==(s=(await c.organizationsApi.listMembers(e)).data)?void 0:s.members)?t:[];0===a.length&&su("No team members found in your organization."),so(a.map(e=>{var s,t,a,l,i;return{id:e.user_id,full_name:null!=(a=null!=(t=null!=(s=e.full_name)?s:e.name)?t:e.email)?a:e.user_id,email:null!=(l=e.email)?l:"",role_name:null!=(i=e.role_name)?i:""}}))}catch(e){su(e instanceof Error?e.message:"Failed to load team members. Please try again.")}finally{sd(!1)}},[N,sr.length,sc]),sz=(0,l.useCallback)(async()=>{if(!(sa.length>0)&&!si){sn(!0);try{var e,s;let t=null!=(s=null==(e=(await c.catalogApi.getFrameworks()).data)?void 0:e.frameworks)?s:[];sl(t.map(e=>{var s,t;return{id:e.id,name:null!=(t=null!=(s=e.name)?s:e.code)?t:e.id}}))}catch(e){}finally{sn(!1)}}},[sa.length,si]),sO=(0,l.useCallback)(async()=>{if(!e4)return;let e=Array.from(eX);try{await c.systemHubApi.bulkAction("patch",e,{risk_tier:e4}),e6(""),e7(!1),sf(),sb()}catch(e){U("Failed to set risk tier")}},[eX,e4,sf,sb]),sR=(0,l.useCallback)(async()=>{let e=Array.from(eX);try{await c.systemHubApi.bulkAction("enable",e),sf(),sb()}catch(e){U("Failed to enable systems")}},[eX,sf,sb]),sI=(0,l.useCallback)(async()=>{let e=Array.from(eX);try{await c.systemHubApi.bulkAction("disable",e),sf(),sb()}catch(e){U("Failed to disable systems")}},[eX,sf,sb]),sE=(0,l.useCallback)(async()=>{let e=Array.from(eX);try{await c.systemHubApi.bulkAction("patch",e,{system_status:"MAINTENANCE"}),sf(),sb()}catch(e){U("Failed to set maintenance mode")}},[eX,sf,sb]),sT=(0,l.useCallback)(()=>{var e,s;let t=Array.from(eX);if(0===t.length)return;if(!ss)return void sy.error("Select a framework first","Choose a compliance framework from the picker before applying.");let a=null!=(s=null==(e=sa.find(e=>e.id===ss))?void 0:e.name)?s:ss,l=S.filter(e=>eX.has(e.id)).filter(e=>{var s;return(null!=(s=e.compliance_frameworks_total)?s:0)>0}),i=l.length,n=t.length,r=new Set(l.map(e=>e.id)),o=t.filter(e=>!r.has(e)),d=async(e,s)=>{0!==e.length&&(await c.systemHubApi.bulkAction("apply_frameworks",e,{framework_ids:[ss],conflict_resolution:s}),sf(),st(null),sb(),sy.success("Frameworks applied to ".concat(e.length," ").concat(1===e.length?"system":"systems"),"Compliance assignments updated."))};if(0===i)return void d(t,"override");se({open:!0,conflictCount:i,totalCount:n,actionLabel:"Apply Framework: ".concat(a),pendingOverride:()=>d(t,"override"),pendingSkip:()=>d(o,"skip"),pendingMerge:()=>d(t,"merge")})},[eX,ss,sa,S,sf,sb,sy]),sL=(0,l.useMemo)(()=>{let e=S.filter(e=>eX.has(e.id)),s=e.filter(e=>"discovered"!==e.source_type&&"shadow_ai"!==e.source_type&&"shadow"!==e.status).length;return{known:e.length,capable:s,inapplicable:e.length-s}},[S,eX]),sP=sL.known>0&&0===sL.capable,sG=sP?"None of the selected systems are runtime-connected. Evaluate, Guard and Monitor need a connected system (discovered/shadow systems must be connected first).":void 0,sF=(0,l.useCallback)(()=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{title:sG,className:"inline-flex",children:(0,a.jsx)(j.$,{size:"xs",variant:"default",icon:(0,a.jsx)(P.A,{className:"w-3 h-3"}),disabled:sP,onClick:()=>sA("evaluate"),children:"Evaluate"})}),(0,a.jsx)("span",{title:sG,className:"inline-flex",children:(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(G.A,{className:"w-3 h-3"}),disabled:sP,onClick:()=>sA("enable_guard"),children:"Guard"})}),(0,a.jsx)("span",{title:sG,className:"inline-flex",children:(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(F.A,{className:"w-3 h-3"}),disabled:sP,onClick:()=>sA("enable_monitor"),children:"Monitor"})}),!sP&&sL.inapplicable>0&&(0,a.jsxs)("span",{className:"text-xs text-slate-500",children:[sL.inapplicable," of"," ",sL.known," not runtime-connected — will be skipped"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(V.A,{className:"w-3 h-3"}),onClick:()=>
1sC("/app/settings/rules?system_ids={selected}"),children:"Apply Rules"}),(0,a.jsxs)("div",{className:"inline-flex items-center gap-1",children:[(0,a.jsx)("div",{className:"w-48",children:(0,a.jsxs)(f.l6,{value:null!=ss?ss:"",onValueChange:st,onOpenChange:e=>{e&&sz()},children:[(0,a.jsx)(f.bq,{className:"h-7 text-xs px-2 min-w-0",children:(0,a.jsx)(f.yv,{placeholder:si?"Loading…":"Choose framework…"})}),(0,a.jsxs)(f.gC,{children:[sa.map(e=>(0,a.jsx)(f.eb,{value:e.id,children:e.name},e.id)),0===sa.length&&!si&&(0,a.jsx)(f.eb,{value:"__none",disabled:!0,children:"No frameworks found"})]})]})}),(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)($.A,{className:"w-3 h-3"}),disabled:!ss,onClick:sT,children:"Set Framework"}),ss&&(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(q.A,{className:"w-3 h-3"}),onClick:()=>st(null),"aria-label":"Clear framework selection"})]}),e2?(0,a.jsxs)("div",{className:"inline-flex items-center gap-1",children:[sc?(0,a.jsx)("span",{className:"text-xs text-slate-500 px-2",children:"Loading members..."}):sm?(0,a.jsx)("span",{className:"text-xs text-red-600 px-2 max-w-[180px]",title:sm,children:sm}):sr.length>0?(0,a.jsx)("div",{className:"w-52",children:(0,a.jsxs)(f.l6,{value:e5,onValueChange:e1,children:[(0,a.jsx)(f.bq,{className:"h-7 text-xs px-2 min-w-0",children:(0,a.jsx)(f.yv,{placeholder:"Select member..."})}),(0,a.jsx)(f.gC,{children:sr.map(e=>(0,a.jsxs)(f.eb,{value:e.full_name,children:[(0,a.jsx)("span",{className:"font-medium",children:e.full_name}),e.role_name&&(0,a.jsx)("span",{className:"ml-1.5 text-slate-400 text-[10px]",children:e.role_name}),e.email&&(0,a.jsx)("span",{className:"block text-[10px] text-slate-400",children:e.email})]},e.id))})]})}):(0,a.jsx)("span",{className:"text-xs text-slate-500 px-2",children:"No members available"}),(0,a.jsx)(j.$,{size:"xs",variant:"default",disabled:!e5.trim(),onClick:sM,children:"Apply"}),(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(q.A,{className:"w-3 h-3"}),onClick:()=>{e3(!1),e1(""),su(null)},"aria-label":"Cancel owner edit"})]}):(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(J.A,{className:"w-3 h-3"}),onClick:sD,children:"Assign Owner"}),e8?(0,a.jsxs)("div",{className:"inline-flex items-center gap-1",children:[(0,a.jsxs)("select",{value:e4,onChange:e=>e6(e.target.value),className:"h-7 px-2 text-xs border border-slate-300 rounded focus:ring-1 focus:ring-blue-500 focus:border-blue-500",autoFocus:!0,children:[(0,a.jsx)("option",{value:"",children:"Select tier..."}),(0,a.jsx)("option",{value:"LOW",children:"Low"}),(0,a.jsx)("option",{value:"MEDIUM",children:"Medium"}),(0,a.jsx)("option",{value:"HIGH",children:"High"}),(0,a.jsx)("option",{value:"CRITICAL",children:"Critical"})]}),(0,a.jsx)(j.$,{size:"xs",variant:"default",disabled:!e4,onClick:sO,children:"Apply"}),(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(q.A,{className:"w-3 h-3"}),onClick:()=>{e7(!1),e6("")},"aria-label":"Cancel risk tier edit"})]}):(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(K.A,{className:"w-3 h-3"}),onClick:()=>e7(!0),children:"Set Risk Tier"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(W.A,{className:"w-3 h-3"}),onClick:sR,children:"Enable"}),(0,a.jsx)(j.$,{size:"xs",variant:"destructive",icon:(0,a.jsx)(Y.A,{className:"w-3 h-3"}),onClick:sI,children:"Disable"}),(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(T.A,{className:"w-3 h-3"}),onClick:sE,children:"Maintenance"}),(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(Q.A,{className:"w-3 h-3"}),onClick:()=>sC("/app/systems/groups?action=add&system_ids={selected}"),children:"Add to Group"}),(0,a.jsx)(j.$,{size:"xs",variant:"outline",icon:(0,a.jsx)(X.A,{className:"w-3 h-3"}),onClick:sS,children:"Export"})]})]}),[sA,sC,sM,sO,sR,sI,sE,sS,sD,sT,sz,e2,e8,e5,e4,sr,sc,sm,ss,sa,si,sP,sG,sL]);(0,l.useCallback)(e=>{e$===e?eB(e=>"asc"===e?"desc":"asc"):(eH(e),eB("asc"))},[e$]);let s$=Math.ceil(M/eY)||1,sH=(0,l.useCallback)(()=>{ep(""),ey("all"),eN("all"),eA("all"),eC("all"),eD("all"),eO("all"),eI("all")},[]);return k||O&&0===S.length?(0,a.jsx)(b.LS,{}):N?(0,a.jsx)(x.Bk,{permission:"systems.view",fallback:(0,a.jsx)(x.cw,{}),children:(0,a.jsxs)(a.Fragment,{children:[L&&(0,a.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3 mb-4 flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs text-red-700",children:L}),(0,a.jsx)(j.K,{"aria-label":"Dismiss error",onClick:()=>U(""),icon:(0,a.jsx)(q.A,{className:"w-4 h-4"}),size:"xs",className:"!h-auto !w-auto text-red-400 hover:text-red-600"})]}),(0,a.jsx)("div",{children:O||L||0!==M||Z||0!==sg?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:[(0,a.jsxs)("div",{className:"relative flex-1 min-w-[200px]",children:[(0,a.jsx)(E.A,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-slate-400"}),(0,a.jsx)("input",{type:"text",placeholder:"Search systems...",value:Z,onChange:e=>ep(e.target.value),className:"w-full pl-8 pr-8 py-1.5 text-xs border border-slate-200 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"}),Z&&(0,a.jsx)(j.K,{"aria-label":"Clear search",onClick:()=>ep(""),icon:(0,a.jsx)(q.A,{className:"w-3 h-3 text-slate-400"}),size:"xs",className:"!h-auto !w-auto absolute right-2 top-1/2 -translate-y-1/2"})]}),(0,a.jsxs)(j.$,{variant:"ghost",onClick:()=>eT(!eE),className:(0,d.cn)("!inline-flex !items-center gap-1.5 !px-3 !py-1.5 !h-auto text-xs border rounded-md",eE||sg>0?"border-blue-300 bg-blue-50 !text-blue-700":"border-slate-200 bg-white !text-slate-600 hover:bg-slate-50"),children:[(0,a.jsx)(ee.A,{className:"w-3.5 h-3.5"}),"Filters",sg>0&&(0,a.jsx)("span",{className:"bg-blue-600 text-white text-[10px] px-1.5 py-0.5 rounded-full",children:sg})]}),(0,a.jsx)(ej,{value:eG,options:eu.map(e=>({value:e.value,label:e.label})),onChange:e=>eF(e)}),(0,a.jsxs)("div",{className:"flex items-center border border-slate-200 rounded-md overflow-hidden",children:[(0,a.jsx)(j.K,{"aria-label":"Table view",onClick:()=>eP("table"),icon:(0,a.jsx)(es.A,{className:"w-4 h-4"}),size:"xs",className:(0,d.cn)("!h-auto !w-auto !p-1.5 !rounded-none","table"===eL?"bg-slate-900 text-white hover:bg-slate-900":"bg-white text-slate-400 hover:text-slate-600")}),(0,a.jsx)(j.K,{"aria-label":"Card view",onClick:()=>eP("card"),icon:(0,a.jsx)(et.A,{className:"w-4 h-4"}),size:"xs",className:(0,d.cn)("!h-auto !w-auto !p-1.5 !rounded-none","card"===eL?"bg-slate-900 text-white hover:bg-slate-900":"bg-white text-slate-400 hover:text-slate-600")})]}),(0,a.jsx)(x.Bk,{permission:"systems.create",children:(0,a.jsx)(n(),{href:"/app/systems/new",children:(0,a.jsx)(j.$,{variant:"default",size:"sm",icon:(0,a.jsx)(I.A,{className:"w-3.5 h-3.5"}),children:"Add System"})})})]}),eE&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-3 p-3 bg-slate-50 border border-slate-200 rounded-md",children:[(0,a.jsx)(ej,{value:ef,options:ei,onChange:e
1y}),(0,a.jsx)(ej,{value:ew,options:en,onChange:eN}),(0,a.jsx)(ej,{value:ek,options:er,onChange:eA}),(0,a.jsx)(ej,{value:eS,options:eo,onChange:eC}),(0,a.jsx)(ej,{value:eM,options:ec,onChange:eD}),(0,a.jsx)(ej,{value:ez,options:sj,onChange:eO}),(0,a.jsx)(ej,{value:eR,options:ed,onChange:eI}),sg>0&&(0,a.jsx)(j.$,{variant:"ghost",onClick:sH,className:"!h-auto !p-0 text-xs !text-blue-600 hover:!text-blue-800 underline",children:"Clear all"})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,a.jsxs)(j.$,{variant:"ghost",onClick:()=>sp(e=>!e),className:(0,d.cn)("!inline-flex !items-center gap-1.5 !px-2.5 !py-1 !h-auto text-xs font-medium rounded-full border",sx?"bg-amber-100 border-amber-300 !text-amber-800":"bg-white border-slate-200 !text-slate-600 hover:bg-amber-50 hover:border-amber-200 hover:!text-amber-700"),children:[(0,a.jsx)("span",{children:"⚠️"}),"Unowned high-risk",sx&&(0,a.jsx)(q.A,{className:"w-3 h-3 ml-0.5"})]})}),(0,a.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,a.jsxs)("p",{className:"text-xs text-slate-500",children:[M," system",1!==M?"s":"",sg>0&&" (filtered)",sh&&(0,a.jsxs)("span",{className:"ml-2 text-blue-600 font-medium",children:[eX.size," selected"]})]})}),eX.size>1&&(0,a.jsxs)("div",{className:"mb-3 bg-blue-50 border border-blue-200 rounded-md",role:"region","aria-label":"Bulk actions",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-3",children:[(0,a.jsxs)("span",{className:"text-xs font-medium text-blue-800",children:[eX.size," selected — Bulk Actions"]}),(0,a.jsx)(j.$,{variant:"ghost",size:"xs",onClick:sf,children:"Clear"})]}),(0,a.jsx)("div",{className:"px-3 pb-3 space-y-2",children:sF()})]}),O&&S.length>0&&(0,a.jsx)("div",{className:"text-center py-2",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 text-xs text-slate-500",children:[(0,a.jsx)("div",{className:"w-3 h-3 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"}),"Loading..."]})}),"table"===eL?(()=>{let e=[{key:"name",header:"Name",sticky:!0,sortable:!0,render:e=>
1{let s=("high"===e.risk_tier||"critical"===e.risk_tier)&&!e.owner_name;return(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[em[e.source_type]&&(0,a.jsx)("span",{className:"text-xs",title:e.source_type,children:em[e.source_type]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-slate-900",children:e.name}),s&&(0,a.jsx)("span",{title:"High-risk system with no assigned owner",className:"inline-flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-xs font-medium text-amber-700 border border-amber-200",children:"⚠️ Unowned"})]}),e.description&&(0,a.jsx)("p",{className:"text-[10px] text-slate-400 mt-0.5 truncate max-w-[200px]",children:e.description}),e.business_unit_name&&(0,a.jsx)("span",{className:"text-xs text-slate-500 bg-slate-100 px-1.5 py-0.5 rounded mt-0.5 inline-block",children:e.business_unit_name})]})]})}},{key:"status",header:"Status",sortable:!0,render:e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(eh,{status:e.status}),(0,a.jsx)(ev,{system:e})]})},{key:"owner_name",header:"Owner",sortable:!0,render:e=>e.owner_name?(0,a.jsx)("span",{className:"text-sm text-slate-700",children:e.owner_name}):(0,a.jsx)("span",{className:"text-xs text-slate-400 italic",children:"Unassigned"})},{key:"risk_tier",header:"Risk",sortable:!0,render:e=>(0,a.jsx)(eb,{tier:e.risk_tier})},{key:"trust_score",header:"Trust Score",sortable:!0,render:e=>(0,a.jsx)(eg,{score:e.trust_score})}],s=Object.entries(sv).flatMap(e=>{let[,s]=e;return s}),t=sx?s.filter(e=>
1("high"===e.risk_tier||"critical"===e.risk_tier)&&!e.owner_name):s;return(0,a.jsxs)("div",{children:[Object.entries(sv).map(e=>{let[s,t]=e;return"none"!==eG&&s?(0,a.jsxs)("div",{className:"px-4 py-2 bg-slate-50 border border-slate-200 rounded-md mb-1 mt-2 text-xs font-semibold text-slate-700 uppercase tracking-wide",children:[s," (",t.length,")"]},s):null}),(0,a.jsx)(y.Y,{columns:e,data:t,rowKey:"id",loading:O&&S.length>0,loadingRows:5,onRowMoreActions:e=>{eZ(e),eq(!0)},moreActionsLabel:"Details",selectable:!0,selectedKeys:eX,onSelectionChange:e0,sortColumn:e$,sortDirection:"asc"===eU?"asc":"desc",onSort:(e,s)=>{eH(e),eB("asc"===s?"asc":"desc")},autoHideEmptyColumns:!1,ariaLabel:"AI systems inventory",renderRowExpand:e=>1===eX.size&&eX.has(e.id)?(0,a.jsxs)("div",{role:"region","aria-label":"Actions for ".concat(e.name),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("span",{className:"text-xs font-medium text-blue-800",children:[e.name," — Actions"]}),(0,a.jsx)(j.$,{variant:"ghost",size:"xs",onClick:sf,children:"Close"})]}),(0,a.jsx)("div",{className:"space-y-2",children:sF()})]}):null,emptyState:(0,a.jsxs)("div",{className:"p-8 text-center",children:[(0,a.jsx)(E.A,{className:"w-8 h-8 text-slate-300 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-sm text-slate-500",children:"No systems match your filters"}),(0,a.jsx)(j.$,{variant:"ghost",onClick:sH,className:"!h-auto !p-0 text-xs !text-blue-600 hover:!text-blue-800 mt-1",children:"Clear filters"})]})})]})})():(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:[Object.entries(sv).map(e=>{let[s,t]=e;return(0,a.jsxs)(l.Fragment,{children:["none"!==eG&&s&&(0,a.jsx)("div",{className:"col-span-full",children:(0,a.jsxs)("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:[s," (",t.length,")"]})}),t.map(e=>(0,a.jsx)(e_,{system:e,selected:eX.has(e.id),onToggle:()=>s_(e.id),onQuickAction:s=>sk(s,e),onOpenPanel:()=>{var s,t,a,l,i,n,r,o,c,d;window.dispatchEvent(new CustomEvent("nexxus:system-row-click",{detail:{id:e.id,name:e.name,system_type:null!=(s=e.system_type)?s:null,status:null!=(t=e.status)?t:null,criticality:null!=(a=e.risk_tier)?a:null,lifecycle_stage:null!=(l=e.lifecycle_stage)?l:null,owner_name:null!=(i=e.owner_name)?i:null,owner_confirmed:null!=(n=e.owner_confirmed)&&n,last_evaluation_at:null!=(r=e.last_evaluated_at)?r:null,last_verdict:null!=(o=e.last_verdict)?o:null,trust_score:null!=(c=e.trust_score)?c:null,description:null!=(d=e.description)?d:null}}))}},e.id))]},s||"__all")}),0===S.length&&!O&&(0,a.jsxs)(v.Zp,{padding:"none",className:"col-span-full p-8 text-center rounded-lg",children:[(0,a.jsx)(E.A,{className:"w-8 h-8 text-slate-300 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-sm text-slate-500",children:"No systems match your filters"}),(0,a.jsx)(j.$,{variant:"ghost",onClick:sH,className:"!h-auto !p-0 text-xs !text-blue-600 hover:!text-blue-800 mt-1",children:"Clear filters"})]})]}),M>eY&&(0,a.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-3 border-t border-slate-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-slate-500",children:"Rows per page:"}),(0,a.jsx)("select",{value:eY,onChange:e=>eQ(Number(e.target.value)),className:"px-2 py-1 text-xs border border-slate-200 rounded-md bg-white",children:ex.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-xs text-slate-500",children:[(eJ-1)*eY+1,"-",Math.min(eJ*eY,M)," of ",M]}),(0,a.jsx)(j.K,{"aria-label":"Previous page",onClick:()=>eW(Math.max(1,eJ-1)),disabled:1===eJ,icon:(0,a.jsx)(ea.A,{className:"w-4 h-4 text-slate-600"}),size:"xs",className:"!h-auto !w-auto !p-1 border border-slate-200 disabled:opacity-50 hover:bg-slate-50"}),(0,a.jsx)(j.K,{"aria-label":"Next page",onClick:()=>eW(Math.min(s$,eJ+1)),disabled:eJ===s$,icon:(0,a.jsx)(el.A,{className:"w-4 h-4 text-slate-600"}),size:"xs",className:"!h-auto !w-auto !p-1 border border-slate-200 disabled:opacity-50 hover:bg-slate-50"})]})]})]}):(0,a.jsx)(v.Zp,{padding:"md",children:(0,a.jsx)(_.X,{icon:(0,a.jsx)(B.A,{className:"h-6 w-6 text-slate-400"}),title:"Register your first AI system to start the lifecycle",description:"Every AI system flows through the connected Discover → Assess → Govern → Guard → Evaluate → Monitor → Comply lifecycle. Register one manually, or discover what's already running in your stack — we'll guide you to the next step from there.",action:A("systems.create")?{label:"Register System",href:"/app/systems/new"}:{label:"Discover Systems",href:"/app/discover?tab=sources"},secondaryAction:A("systems.create")?{label:"Discover Systems",href:"/app/discover?tab=sources"}:void 0})})}),(0,a.jsx)(w.Jm,{open:eV,onClose:()=>
1{eq(!1),eZ(null)},title:null!=(t=null==eK?void 0:eK.name)?t:"System Detail",subtitle:eK?"".concat(eK.ai_type_label," \xb7 ").concat(eK.region):void 0,recordId:null==eK?void 0:eK.id,footer:eK?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(n(),{href:"/app/systems/".concat(eK.id),className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[(0,a.jsx)(H.A,{className:"w-4 h-4"})," View Detail"]}),(0,a.jsxs)(j.$,{variant:"ghost",onClick:()=>{eq(!1),sk("evaluate",eK)},className:"!inline-flex !items-center gap-1.5 !px-3 !py-2 !h-auto text-sm font-medium !text-slate-700 bg-slate-100 rounded-lg hover:bg-slate-200",children:[(0,a.jsx)(P.A,{className:"w-4 h-4"})," Evaluate"]})]}):void 0,sections:eK?[{title:"Identity",content:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Status"}),(0,a.jsx)(eh,{status:eK.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Risk Tier"}),(0,a.jsx)(eb,{tier:eK.risk_tier})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"AI Type"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.ai_type_label})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Region"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.region})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Source"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5 capitalize",children:eK.source_type.replace(/_/g," ")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Owner"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.owner_name||"—"})]}),null!=eK.trust_score&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Trust Score"}),(0,a.jsx)(eg,{score:eK.trust_score})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Last Seen"}),(0,a.jsx)("p",{className:"text-xs text-slate-800 mt-0.5",children:eK.last_seen?(0,d.fw)(eK.last_seen):"—"})]})]})},{title:"Protection",content:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Guard"}),(0,a.jsx)("p",{className:"text-sm font-medium mt-0.5 ".concat(eK.guard_active?"text-emerald-700":"text-slate-500"),children:eK.guard_active?"Active":"Inactive"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Monitor"}),(0,a.jsx)("p",{className:"text-sm font-medium mt-0.5 ".concat(eK.monitor_active?"text-emerald-700":"text-slate-500"),children:eK.monitor_active?"Active":"Inactive"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Compliance"}),(0,a.jsxs)("p",{className:"text-sm text-slate-800 mt-0.5",children:[eK.compliance_frameworks_passing,"/",eK.compliance_frameworks_total," ","frameworks passing"]})]})]})},...eK.description?[{title:"Description",content:(0,a.jsx)("p",{className:"text-sm text-slate-700",children:eK.description})}]:[],...eK.policy_owner_name||eK.incident_response_owner_name||eK.authorized_by_name||eK.system_card_approved_by_name||eK.business_use_case||eK.affected_populations?[{title:"Ownership & Accountability",content:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[eK.policy_owner_name&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Policy Owner"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.policy_owner_name})]}),eK.incident_response_owner_name&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Incident Response Owner"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.incident_response_owner_name})]}),eK.authorized_by_name&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Authorized By"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.authorized_by_name})]}),eK.system_card_approved_by_name&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"System Card Approved By"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.system_card_approved_by_name})]}),eK.business_use_case&&(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Business Use Case"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.business_use_case})]}),eK.affected_populations&&(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Affected Populations"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.affected_populations})]})]})}]:[],...eK.gdpr_role||eK.art2_classification||eK.eu_market_exposure||(null!=(i=null==(e=eK.jurisdiction_regions)?void 0:e.length)?i:0)>0||eK.authorization_status&&"UNREVIEWED"!==eK.authorization_status?[{title:"Data & Privacy",content:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[eK.authorization_status&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"Authorization Status"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5 capitalize",children:eK.authorization_status.replace(/_/g," ").toLowerCase()})]}),"boolean"==typeof eK.eu_market_exposure&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"EU Market Exposure"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.eu_market_exposure?"Yes":"No"})]}),eK.art2_classification&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"EU AI Act Role (Art. 2/3)"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5 capitalize",children:eK.art2_classification.replace(/_/g," ")})]}),eK.gdpr_role&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-slate-500",children:"GDPR Role"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5 capitalize",children:eK.gdpr_role.replace(/_/g," ")})]}),(null!=(h=null==(s=eK.jurisdiction_regions)?void 0:s.length)?h:0)>0&&(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)("p",{className:"text-xs text-slate-500 mb-1",children:"Jurisdiction Regions"}),(0,a.jsx)("p",{className:"text-sm text-slate-800 mt-0.5",children:eK.jurisdiction_regions.join(", ")})]})]})}]:[]]:void 0}),e9&&(0,a.jsx)(z,{isOpen:e9.open,onClose:()=>se(null),totalCount:e9.totalCount,conflictCount:e9.conflictCount,actionLabel:e9.actionLabel,onOverride:e9.pendingOverride,onSkip:e9.pendingSkip,onMerge:e9.pendingMerge})]})}):(g.push("/login"),null)}function eC(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(b.LS,{}),children:(0,a.jsx)(eS,{})})}function eM(){return"analytics"===(0,r.useSearchParams)().get("view")?(0,a.jsx)(eA,{}):(0,a.jsx)(eC,{})}function eD(){let e="analytics"===(0,r.useSearchParams)().get("view");return(0,a.jsx)(h.PageShell,{title:e?"Inventory Analytics":"AI Systems / Use Cases",subtitle:e?"Fleet-level analytics — trust score distribution, risk tier breakdown, region & type charts":"Registered AI systems and their use cases in your organization",helpContent:g.nc.systems,children:(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(b.LS,{}),children:(0,a.jsx)(eM,{})})})}},59202:(e,s,t)=>{t.d(s,{dj:()=>d,j_:()=>c});var a=t(12115),l=t(75731),i=t(58270),n=t(89863);let r={sidebarOpen:!0,sidebarCollapsed:!1,theme:"system",reducedMotion:!1,highContrast:!1,toasts:[],modals:[],globalLoading:!1,loadingMessage:null,mobileMenuOpen:!1,commandPaletteOpen:!1},o=()=>"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,11)),c=(0,l.vt)()((0,n.Zr)((0,i.D)((e,s)=>({...r,setSidebarOpen:s=>e(e=>{e.sidebarOpen=s}),toggleSidebar:()=>e(e=>{e.sidebarOpen=!e.sidebarOpen}),setSidebarCollapsed:s=>e(e=>{e.sidebarCollapsed=s}),toggleSidebarCollapsed:()=>e(e=>{e.sidebarCollapsed=!e.sidebarCollapsed}),setTheme:s=>e(e=>{e.theme=s}),setReducedMotion:s=>e(e=>{e.reducedMotion=s}),setHighContrast:s=>e(e=>{e.highContrast=s}),addToast:t=>{var a;let l=o();e(e=>{e.toasts.push({id:l,duration:5e3,dismissible:!0,...t})});let i=null!=(a=t.duration)?a:5e3;return i>0&&setTimeout(()=>{s().removeToast(l)},i),l},removeToast:s=>e(e=>{e.toasts=e.toasts.filter(e=>e.id!==s)}),clearToasts:()=>e(e=>{e.toasts=[]}),openModal:s=>
1{let t=o();return e(e=>{e.modals.push({id:t,...s})}),t},closeModal:s=>e(e=>{e.modals=e.modals.filter(e=>e.id!==s)}),closeAllModals:()=>e(e=>{e.modals=[]}),setGlobalLoading:function(s){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e(e=>{e.globalLoading=s,e.loadingMessage=t})},setMobileMenuOpen:s=>e(e=>{e.mobileMenuOpen=s}),toggleMobileMenu:()=>e(e=>{e.mobileMenuOpen=!e.mobileMenuOpen}),setCommandPaletteOpen:s=>e(e=>{e.commandPaletteOpen=s}),toggleCommandPalette:()=>e(e=>{e.commandPaletteOpen=!e.commandPaletteOpen}),reset:()=>e(r)})),{name:"nexxus-ui",storage:(0,n.KU)(()=>localStorage),partialize:e=>({sidebarCollapsed:e.sidebarCollapsed,theme:e.theme,reducedMotion:e.reducedMotion,highContrast:e.highContrast})})),d=()=>{let e=c(e=>e.addToast),s=c(e=>e.removeToast);return(0,a.useMemo)(()=>({success:(s,t)=>e({type:"success",title:s,message:t}),error:(s,t)=>e({type:"error",title:s,message:t}),warning:(s,t)=>e({type:"warning",title:s,message:t}),info:(s,t)=>e({type:"info",title:s,message:t}),dismiss:s}),[e,s])}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.