1import{j as e}from"./vendor-query-CsHYnmF8.js";import{F as k,c as v}from"./index-wKN3roZE.js";import{S as n,l as h}from"./useMentorSkills-C08zVMtX.js";import{u as N}from"./vendor-i18n-FzC2q7WE.js";import"./vendor-react-CmGg2B8n.js";import"./vendor-supabase-DinKeC8L.js";import"./vendor-ui-CakNjGXO.js";function W({skills:c,streak:m}){const{t:a}=N(),x=480,d=360,i={x:x/2,y:d/2},g=120,p=t=>Math.PI*2*t/n.length-Math.PI/2,l=(t,r)=>{const s=p(t),o=r/100*g;return{x:i.x+o*Math.cos(s),y:i.y+o*Math.sin(s)}},f=new Map(c.map(t=>[t.skill_name,t])),u=n.map((t,r)=>{const s=f.get(t);return l(r,(s==null?void 0:s.score)||0)}),y=u.map(t=>`${t.x},${t.y}`).join(" ");return e.jsxs("div",{className:"flex flex-col gap-4 py-2",children:[m>0&&e.jsx("div",{className:"flex justify-end",children:e.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-warning/10 border border-warning/20",children:[e.jsx(k,{className:"w-3.5 h-3.5 text-warning"}),e.jsx("span",{className:"text-xs font-bold text-warning",children:a("mentorUi.skills.dayStreak","{{count}}d streak",{count:m})})]})}),e.jsxs("svg",{viewBox:`0 0 ${x} ${d}`,className:"w-full max-w-[480px] mx-auto",children:[e.jsx("defs",{children:e.jsxs("radialGradient",{id:"radarFill",cx:"50%",cy:"50%",r:"50%",children:[e.jsx("stop",{offset:"0%",stopColor:"hsl(var(--primary))",stopOpacity:"0.35"}),e.jsx("stop",{offset:"100%",stopColor:"hsl(var(--primary))",stopOpacity:"0.08"})]})}),[25,50,75,100].map(t=>{const r=n.map((s,o)=>l(o,t));return e.jsx("polygon",{points:r.map(s=>`${s.x},${s.y}`).join(" "),fill:"none",stroke:"hsl(var(--muted-foreground))",strokeWidth:"1",opacity:t===100?.55:.3},t)}),n.map((t,r)=>{const s=l(r,100);return e.jsx("line",{x1:i.x,y1:i.y,x2:s.x,y2:s.y,stroke:"hsl(var(--muted-foreground))",strokeWidth:"1",opacity:"0.35"},r)}),e.jsx("polygon",{points:y,fill:"url(#radarFill)",stroke:"hsl(var(--primary))",strokeWidth:"1.75",strokeLinejoin:"round"}),u.map((t,r)=>e.jsx("circle",{cx:t.x,cy:t.y,r:"3",fill:"hsl(var(--background))",stroke:"hsl(var(--primary))",strokeWidth:"1.5"},r)),n.map((t,r)=>{const s=l(r,138),o=Math.cos(p(r)),j=o>.2?"start":o<-.2?"end":"middle";return e.jsx("text",{x:s.x,y:s.y,textAnchor:j,dominantBaseline:"middle",className:"fill-foreground",fontSize:"11",fontWeight:"500",children:h(a,t)},t)})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2 max-sm:gap-1.5",children:c.map(t=>e.jsxs("div",{className:"flex items-center justify-between gap-1.5 px-3 py-2 max-sm:px-2 max-sm:py-1.5 rounded-lg border border-border/40 text-sm max-sm:text-[11px]",children:[e.jsx("span",{className:"text-foreground font-medium truncate",children:h(a,t.skill_name)}),e.jsx("span",{className:v("font-semibold tabular-nums",t.score>=70?"text-primary":t.score>=40?"text-muted-foreground":"text-destructive"),children:t.score})]},t.skill_name))}),c.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center",children:a("mentorUi.skills.completeExercisesToTrack","Complete exercises to start tracking skills.")})]})}export{W as SkillRadar};
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.