import{ei as e,ii as t}from"./vendor-DkM0BOLc.js";import{vt as n}from"./index-CYbEqOJT.js";import{i as r,n as i,r as a,t as o}from"./tooltip--hVBqEyY.js";var s=e();function c({rating:e,rd:c,className:l,showRd:u=!0,atCeiling:d=!1}){let f=c<60?`high`:c<120?`medium`:`low`,p=f===`high`?`High confidence — many recent matches`:f===`medium`?`Moderate confidence`:`Low confidence — few matches or long inactive`,m=d?`${e}+`:`${e}`,h=u?`Glicko rating ${m}, uncertainty ±${c}. ${p}.${d?` At tier ceiling — true rating may be higher.`:``}`:`Glicko rating ${m}. ${p}.${d?` At tier ceiling — true rating may be higher.`:``}`;return(0,s.jsx)(a,{children:(0,s.jsxs)(o,{children:[(0,s.jsx)(r,{render:e=>(0,s.jsxs)(`span`,{...e,tabIndex:0,role:`img`,"aria-label":h,className:n(`inline-flex cursor-default items-baseline gap-0.5 font-mono text-sm font-bold tabular-nums focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] rounded-sm`,f===`high`&&`text-zinc-900 dark:text-zinc-100`,f===`medium`&&`text-zinc-700 dark:text-zinc-300`,f===`low`&&`text-zinc-400 dark:text-zinc-500`,l),children:[(0,s.jsx)(`span`,{"aria-hidden":`true`,"data-testid":d?`rating-at-ceiling`:void 0,children:m}),u&&(0,s.jsxs)(`span`,{"aria-hidden":`true`,className:`text-xs font-normal text-zinc-400 dark:text-zinc-500`,children:[`±`,c]})]})}),(0,s.jsx)(i,{children:(0,s.jsxs)(`div`,{className:`text-xs`,children:[(0,s.jsxs)(`p`,{className:`font-semibold`,children:[`Rating: `,m]}),(0,s.jsxs)(`p`,{children:[`Uncertainty: ±`,c]}),(0,s.jsx)(`p`,{className:`text-zinc-400`,children:p}),d&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`p`,{className:`mt-1 text-zinc-300`,children:`Capped at the Tier 2 (Challengers/VCL) rating ceiling — true rating may be higher.`}),(0,s.jsx)(`p`,{className:`mt-1`,children:(0,s.jsx)(t,{to:`/methodology#tier-ceiling`,className:`text-zinc-200 underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-none`,children:`Read the methodology →`})})]})]})})]})})}function l(e){if(!e||e.length!==2)return``;let t=[...e.toUpperCase()].map(e=>127462+e.charCodeAt(0)-65);return String.fromCodePoint(...t)}export{c as n,l as t};