1import{o as w}from"./rolldown-runtime-ChpBd9eV.js";import{An as C,En as $,La as V,Ma as R,Ta as _,Yt as A,da as d,gt as k}from"./chat-page-evUfHQgD.js";import{Ka as E}from"./market-core-DitXLvJ-.js";import{D as F,E as S}from"./education-page-vD6yUpCZ.js";var q=w(V(),1),e=_(),p={critical:{bg:"bg-red-500/10",border:"border-red-500/30",text:"text-red-400",badge:"bg-red-500 text-white"},high:{bg:"bg-orange-500/10",border:"border-orange-500/30",text:"text-orange-400",badge:"bg-orange-500 text-white"},medium:{bg:"bg-yellow-500/10",border:"border-yellow-500/30",text:"text-yellow-400",badge:"bg-yellow-500 text-black"},low:{bg:"bg-blue-500/10",border:"border-blue-500/30",text:"text-blue-400",badge:"bg-blue-500 text-white"}},D=({className:a="",maxItems:o=5,compact:u=!1})=>{const r=R(),{topViolations:n,totalViolations:c,criticalCount:b,highCount:g,loading:h,error:j,hasActiveViolations:N,hasCriticalViolations:x,hasAccountRestriction:i}=E();if(h)return(0,e.jsxs)("div",{className:`bg-slate-800/50 rounded-xl p-4 animate-pulse ${a}`,children:[(0,e.jsx)("div",{className:"h-6 bg-slate-700 rounded w-1/3 mb-4"}),(0,e.jsx)("div",{className:"space-y-3",children:[1,2,3].map(t=>(0,e.jsx)("div",{className:"h-12 bg-slate-700/50 rounded"},t))})]});if(j)return(0,e.jsx)("div",{className:`bg-slate-800/50 rounded-xl p-4 ${a}`,children:(0,e.jsx)("p",{className:"text-red-400 text-sm",children:"Failed to load violation data"})});const l=Array.isArray(n)?n:[];if(!c)return(0,e.jsx)(d.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`bg-gradient-to-br from-green-500/10 to-emerald-500/10 border border-green-500/30 rounded-xl p-4 ${a}`,children:(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("div",{className:"p-2 rounded-lg bg-green-500/20",children:(0,e.jsx)(k,{className:"w-6 h-6 text-green-400"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:`${i?"text-amber-400":"text-green-400"} font-semibold`,children:i?"No Open Rule Misses":"Clean Record"}),(0,e.jsx)("p",{className:"text-slate-400 text-sm",children:i?"The current reset timer or acknowledgment still controls access.":"No unresolved rule misses detected"})]})]})});const y=l.slice(0,o);return(0,e.jsxs)(d.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`bg-slate-800/50 border border-slate-700/50 rounded-xl overflow-hidden ${a}`,children:[(0,e.jsx)("div",{className:"p-4 border-b border-slate-700/50",children:(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("div",{className:`p-2 rounded-lg ${x?"bg-red-500/20":"bg-orange-500/20"}`,children:(0,e.jsx)(A,{className:`w-5 h-5 ${x?"text-red-400":"text-orange-400"}`})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"text-white font-semibold",children:"Rules to Review"}),(0,e.jsxs)("p",{className:"text-slate-400 text-sm",children:[c," total ⢠",b," critical ⢠",g," high"]})]})]}),N&&(0,e.jsxs)("button",{onClick:()=>r("/education?mode=remediation"),className:"flex items-center gap-2 px-3 py-1.5 bg-gradient-to-r from-blue-500 to-purple-500 text-white text-sm font-medium rounded-lg hover:opacity-90 transition-opacity",children:[(0,e.jsx)(C,{className:"w-4 h-4"}),"Start Reset"]})]})}),(0,e.jsx)("div",{className:"divide-y divide-slate-700/30",children:y.map((t,f)=>{const m=p[(t.severity||"medium").toLowerCase()]||p.medium,s=F(t.type),v=s?S(t.type):"/education?mode=remediation";return(0,e.jsx)(d.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:f*.05},className:"p-3 hover:bg-slate-700/30 transition-colors cursor-pointer group",onClick:()=>r(v),children:(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,e.jsx)("span",{className:`px-2 py-0.5 text-xs font-bold rounded ${m.badge}`,children:t.severity.toUpperCase()}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-white font-medium truncate",children:s?.title||t.dis
1playName}),t.isActive&&(0,e.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] bg-red-500/20 text-red-400 rounded",children:"ACTIVE"})]}),!u&&(0,e.jsx)("p",{className:"text-slate-400 text-xs truncate mt-0.5",children:s?.description||t.impactStatement})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3 ml-3",children:[(0,e.jsxs)("span",{className:`text-lg font-bold ${m.text}`,children:[t.count,"x"]}),s&&(0,e.jsx)("span",{className:"px-2 py-1 text-xs bg-emerald-500/20 text-emerald-400 rounded font-medium",children:s.shortLabel}),(0,e.jsx)($,{className:"w-4 h-4 text-slate-500 group-hover:text-white transition-colors"})]})]})},t.type)})}),l.length>o&&(0,e.jsx)("div",{className:"p-3 bg-slate-800/30 text-center",children:(0,e.jsxs)("button",{onClick:()=>r("/education?mode=remediation"),className:"text-blue-400 text-sm hover:text-blue-300 transition-colors",children:["View all ",l.length," rule types â"]})})]})};export{D as default};
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.