import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{Bn as t,Ci as n,Gn as r,Hn as i,Ht as a,Ir as o,Jn as s,Jt as c,Lt as l,Rr as u,Rt as d,Vt as f,Xt as p,Yt as m,_i as h,cn as g,ei as _,fr as v,ft as y,in as b,mt as x,nn as S,oi as C,on as w,pn as T,ri as ee,t as E,ui as D,vi as te,yi as O}from"./vendor-DlcENO3s.js";import{n as ne,r as re}from"./api-D_CxJQU5.js";import{I as ie,J as ae,K as oe,L as se,M as ce,a as le,b as ue,i as de,j as k,k as A,t as fe,w as j,y as pe,yt as M}from"./index-CgkkL22i.js";import{a as me,c as he,o as ge,r as N,s as P}from"./registry-CnKfGQBk.js";import{t as _e}from"./RatingBadge-r0i_-T7A.js";import{t as F}from"./flags-B3Juk3B9.js";import{t as ve}from"./rank-medal-BHRSkUIJ.js";import{t as ye}from"./AgentIcon-lhiw_nl7.js";import{t as be}from"./MapImage-bNV3KpGz.js";import{t as I}from"./WidgetEmpty-nkoGMrW1.js";import{d as xe,i as Se,s as L,t as Ce,u as R}from"./vendor-charts-TJs8E7y_.js";import{n as we,t as z}from"./Skeleton-ygl7Pn3B.js";import{n as B,t as Te}from"./seo-helpers-BPEHfU_C.js";import{n as V,r as H,t as Ee}from"./EditWidgetsButton-DgwLZuQC.js";import{t as De}from"./WatchButton-Bis93j9S.js";import{i as Oe,n as ke,r as Ae,t as je}from"./QueryError-DFsmVgax.js";import{t as Me}from"./WidgetStateContainer-CpUwyMlw.js";import{n as U,r as W}from"./formatters-BJnAEtbc.js";import{t as Ne}from"./expandable-search-VeTpQNlZ.js";import{a as Pe,i as Fe,n as Ie,o as Le,r as Re,t as ze}from"./RailPeek-DDHQDhNa.js";import{a as Be,i as Ve,n as He,r as Ue,t as G}from"./RatingChartWidget-BGaVUAqL.js";import{t as We}from"./EntityNotFound-Q2qLjiXV.js";var K=e(n(),1),q=C();function Ge({role:e,className:t}){return e?(0,q.jsx)(`span`,{className:M(`inline-flex shrink-0 items-center rounded-md border px-1.5 py-0.5 text-2xs font-semibold uppercase tracking-wider whitespace-nowrap`,Be(e),t),children:e}):null}var J=new Set([`glicko`,`acs`,`kd`,`adr`,`kast`,`hs_pct`]),Ke={glicko:`Glicko`,acs:`ACS`,kd:`K/D`,adr:`ADR`,kast:`KAST`,hs_pct:`HS%`},qe=[{value:`acs`,label:`ACS`},{value:`kd`,label:`K/D`},{value:`adr`,label:`ADR`},{value:`kast`,label:`KAST`},{value:`hs_pct`,label:`HS%`},{value:`glicko`,label:`Glicko`}];function Je(e){let{explicitStat:t}=e;return t&&J.has(t)?t:`acs`}var Y=new Set([`list`,`table`]);function Ye(e){let{explicitView:t}=e;return t&&Y.has(t)?t:`list`}var X=[5,20,50,100];function Xe(e){let{explicitMinMaps:t}=e;if(t!=null){let e=Number(t);if(Number.isFinite(e)&&X.includes(e))return e}return 5}function Ze(e){return!(!e||e.includes(`/img/base/ph/`))}function Qe(e){return e.startsWith(`//`)?`https:${e}`:e}function $e({selectedSlug:e,expanded:t,compact:n,isPinned:r=!1,onToggleVariant:i}){let{gameSlug:c}=te(),l=h(),u=ze(),{filters:f,setTier:p}=fe(),[m,g]=O(),_=(0,K.useMemo)(()=>Je({explicitStat:m.get(`stat`)}),[m]),v=(0,K.useCallback)(e=>{g(t=>(t.set(`stat`,e),t),{replace:!0})},[g]),y=Oe(`(min-width: 768px)`),b=(0,K.useMemo)(()=>Ye({explicitView:m.get(`view`)}),[m]),x=y?b:`list`,S=(0,K.useCallback)(e=>{g(t=>(e===`list`?t.delete(`view`):t.set(`view`,e),t),{replace:!0})},[g]),C=(0,K.useMemo)(()=>Xe({explicitMinMaps:m.get(`min_maps`)}),[m]),w=(0,K.useCallback)(e=>{g(t=>(t.set(`min_maps`,String(e)),t),{replace:!0})},[g]),T=f.role||`all`,[E,ne]=(0,K.useState)(``),[ae,oe]=(0,K.useState)(``),[ce,le]=(0,K.useState)(!1),ue=(0,K.useRef)(void 0),de=(0,K.useRef)(!1);(0,K.useEffect)(()=>{!de.current&&f.tier===null&&(de.current=!0,p(`vct`))},[f.tier,p]);let A=(0,K.useCallback)(e=>{ne(e),clearTimeout(ue.current),ue.current=setTimeout(()=>oe(e),300)},[]),j=ae.length>=2,me=(0,K.useRef)(null),he=ge(),{data:N,isLoading:_e,isError:ye,error:be,refetch:I,fetchNextPage:xe,hasNextPage:Se,isFetchingNextPage:L}=P(c,{stat:_,limit:50,tier:f.tier,region:f.region,subRegion:f.subRegion,tiers:[`t1`,`t2`,`gc`],role:T,minMaps:C,from:he}),Ce=(0,K.useMemo)(()=>N?.pages.flat(),[N]),{data:R,isLoading:we,isError:z,refetch:B}=ee({queryKey:[`playerSearch`,c,ae],queryFn:()=>re(`/games/${c}/players?${new URLSearchParams({q:ae,tiers:`t1,t2,gc`})}`),enabled:j,staleTime:300*1e3}),Te=x===`table`&&!j,V={limit:50,tier:f.tier,region:f.region,subRegion:f.subRegion,tiers:[`t1`,`t2`,`gc`],role:T,minMaps:C,from:he},H=e=>Te&&e!==_,Ee=P(c,{...V,stat:`acs`,enabled:H(`acs`)}),De=P(c,{...V,stat:`kd`,enabled:H(`kd`)}),Me=P(c,{...V,stat:`adr`,enabled:H(`adr`)}),W=P(c,{...V,stat:`kast`,enabled:H(`kast`)}),Le=P(c,{...V,stat:`hs_pct`,enabled:H(`hs_pct`)}),Be=P(c,{...V,stat:`glicko`,enabled:H(`glicko`)}),Ve={acs:Ee,kd:De,adr:Me,kast:W,hs_pct:Le,glicko:Be},He=(0,K.useMemo)(()=>{let e={acs:{},kd:{},adr:{},kast:{},hs_pct:{},glicko:{}};return qe.forEach(t=>{(t.value===_?N?.pages.flat():Ve[t.value].data?.pages.flat())?.forEach(n=>{e[t.value][n.player.id]=n.value})}),e},[N,_,Ee.data,De.data,Me.data,W.data,Le.data,Be.data]),Ue=Te&&(_e||Object.values(Ve).some(e=>e.isLoading&&e.fetchStatus!==`idle`)),G=Ce,We=(0,K.useMemo)(()=>G?.length?Math.max(...G.map(e=>e.value??0)):0,[G]),J=(0,K.useRef)(null);(0,K.useEffect)(()=>{let e=J.current;if(!e)return;let t=new IntersectionObserver(e=>{e[0].isIntersecting&&Se&&!L&&!j&&xe()},{threshold:0});return t.observe(e),()=>t.disconnect()},[Se,L,xe,j]);let Y=j?we:_e,X=!j&&ye;if(n){let t=(j?R:G)??[];return(0,q.jsxs)(Ie,{label:`Players`,isPinned:r,onExpand:()=>i?.(),children:[Y&&(0,q.jsx)(`div`,{className:`space-y-1`,children:Array.from({length:10}).map((e,t)=>(0,q.jsx)(`div`,{className:`mx-auto h-10 w-10 animate-pulse rounded-lg bg-zinc-100 dark:bg-zinc-800`},t))}),!j&&(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(G??[]).map(t=>{let n=F(t.player.country);return(0,q.jsx)(Re,{selected:e===t.player.slug,href:`/${c}/players/${t.player.slug}`,onClick:()=>l(`/${c}/players/${t.player.slug}`),rank:`#${t.rank}`,main:t.player.team?(0,q.jsx)(k,{name:t.player.team.name,slug:t.player.team.slug,abbreviation:t.player.team.abbreviation,size:`sm`}):(0,q.jsx)(`div`,{className:`flex h-6 w-6 items-center justify-center rounded bg-zinc-200 text-[8px] font-bold text-zinc-400 dark:bg-zinc-700`,children:`FA`}),peek:t.player.ign,onPeek:e=>u.show((0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[n&&(0,q.jsx)(`span`,{className:`text-sm`,children:n}),(0,q.jsx)(`span`,{className:`text-sm font-bold text-zinc-900 dark:text-zinc-100`,children:t.player.ign})]}),(0,q.jsxs)(`div`,{className:`text-xs text-zinc-500 dark:text-zinc-400`,children:[t.player.team?.name??`Free Agent`,t.player.role&&(0,q.jsxs)(`span`,{className:`ml-1 capitalize text-zinc-400`,children:[`· `,t.player.role]})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,q.jsxs)(`span`,{className:`font-mono font-bold tabular-nums text-zinc-700 dark:text-zinc-300`,children:[U(_,t.value),` `,(0,q.jsx)(`span`,{className:`font-sans text-zinc-400`,children:Ke[_]})]}),(0,q.jsxs)(`span`,{className:`text-zinc-400`,children:[`#`,t.rank]})]})]}),e),onPeekEnd:u.hide},t.player.id)}),(0,q.jsx)(`div`,{ref:J,className:`h-1`}),L&&(0,q.jsx)(`div`,{className:`flex justify-center py-2`,children:(0,q.jsx)(s,{size:14,className:`animate-spin text-zinc-400`})})]}),j&&z&&(0,q.jsx)(je,{message:`Failed to load player search`,onRetry:()=>void B(),className:`!py-4`}),j&&!z&&R&&(0,q.jsx)(`div`,{className:`space-y-0.5`,children:R.map(t=>{let n=F(t.country);return(0,q.jsx)(Re,{selected:e===t.slug,href:`/${c}/players/${t.slug}`,onClick:()=>l(`/${c}/players/${t.slug}`),main:t.team?(0,q.jsx)(k,{name:t.team.name,slug:t.team.slug,abbreviation:t.team.abbreviation,size:`sm`}):(0,q.jsx)(`div`,{className:`flex h-6 w-6 items-center justify-center rounded bg-zinc-200 text-[8px] font-bold text-zinc-400 dark:bg-zinc-700`,children:`FA`}),peek:t.ign,onPeek:e=>u.show((0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[n&&(0,q.jsx)(`span`,{className:`text-sm`,children:n}),(0,q.jsx)(`span`,{className:`text-sm font-bold text-zinc-900 dark:text-zinc-100`,children:t.ign})]}),(0,q.jsxs)(`div`,{className:`text-xs text-zinc-500 dark:text-zinc-400`,children:[t.team?.name??`Free Agent`,t.role&&(0,q.jsxs)(`span`,{className:`ml-1 capitalize text-zinc-400`,children:[`· `,t.role]})]})]}),e),onPeekEnd:u.hide},t.id)})}),!Y&&t.length===0&&(0,q.jsx)(`div`,{className:`py-6 text-center text-2xs text-zinc-500`,children:`Empty`}),u.portal]})}return t?(0,q.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden`,children:[ce&&(0,q.jsx)(ke,{onClose:()=>le(!1)}),(0,q.jsx)(pe,{title:`Players`,actions:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[x===`list`&&(0,q.jsx)(et,{value:_,onChange:e=>v(e)}),(0,q.jsx)(nt,{value:C,onChange:w}),y&&(0,q.jsx)(tt,{value:b,onChange:S}),(0,q.jsx)(Ne,{value:E,onChange:A,placeholder:`Search players...`,ariaLabel:`Search players`}),(0,q.jsx)(Ae,{open:ce,onToggle:()=>le(e=>!e)})]}),className:`flex min-h-0 flex-1 flex-col overflow-hidden`,seo:{description:`Browse Valorant pro player stats, rankings, ratings, and roles. Filter by league, region, and role to find the top performers.`},children:(0,q.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,q.jsxs)(`div`,{className:`mx-auto max-w-5xl`,children:[Y&&!(x===`table`&&!j)&&(0,q.jsx)(se,{kind:`table`}),!Y&&X&&(0,q.jsx)(ie,{error:be??Error(`Failed to load player leaderboard`),retry:()=>void I()}),!Y&&j&&z&&(0,q.jsx)(je,{message:`Failed to load player search`,onRetry:()=>void B()}),!Y&&j&&!z&&R&&(0,q.jsxs)(`div`,{className:`glk-card !p-0 overflow-hidden`,children:[(0,q.jsx)(`div`,{className:`divide-y divide-zinc-100 dark:divide-zinc-800/50`,children:R.map(e=>{let t=F(e.country);return(0,q.jsxs)(D,{to:`/${c}/players/${e.slug}`,"aria-label":`View profile for ${e.ign}${e.team?`, ${e.team.name}`:``}`,className:`group flex w-full items-center gap-3 px-3 py-2.5 text-left transition-colors duration-200 hover:bg-zinc-50 dark:hover:bg-zinc-800/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--glk-brand)]`,children:[(0,q.jsx)(it,{avatarUrl:e.avatarUrl,ign:e.ign,team:e.team}),(0,q.jsxs)(`div`,{className:`flex-1 overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`span`,{className:`truncate text-sm font-semibold text-zinc-900 transition-colors group-hover:text-[var(--glk-brand)] dark:text-zinc-100`,children:[t&&(0,q.jsx)(`span`,{className:`mr-1`,children:t}),e.ign]}),e.team?.abbreviation&&(0,q.jsx)(`span`,{className:`hidden flex-shrink-0 text-xs text-zinc-400 sm:inline`,children:e.team.abbreviation}),(0,q.jsx)(Ge,{role:e.role})]}),(0,q.jsxs)(`div`,{className:`truncate text-xs text-zinc-500 dark:text-zinc-400`,children:[e.team?.name??`Free Agent`,e.mapsPlayed>0&&(0,q.jsxs)(`span`,{className:`ml-1.5 text-zinc-400 dark:text-zinc-500`,children:[`· `,e.mapsPlayed,` maps`]})]})]}),e.careerAvgAcs!=null&&(0,q.jsx)(`span`,{className:`font-mono text-sm font-bold tabular-nums text-zinc-700 dark:text-zinc-300`,children:Math.round(e.careerAvgAcs)}),(0,q.jsx)(o,{size:14,className:`shrink-0 text-zinc-300 group-hover:text-zinc-500 dark:text-zinc-600 dark:group-hover:text-zinc-400`})]},e.id)})}),R.length===0&&(0,q.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-zinc-400`,children:[(0,q.jsx)(a,{size:28,strokeWidth:1.5}),(0,q.jsx)(`p`,{className:`text-sm`,children:`No players match your search`})]})]}),x===`table`&&!X&&!j&&(0,q.jsx)(rt,{gameSlug:c,rows:G??[],activeStat:_,onSort:v,valuesByStat:He,loading:Ue||_e,sentinelRef:J,isFetchingNextPage:L,roleFilter:T,tierActive:f.tier!==null}),x===`list`&&!Y&&!X&&!j&&G&&G.length>0&&(0,q.jsxs)(`div`,{className:`glk-card !p-0 overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-center gap-3 border-b border-zinc-200/80 bg-zinc-50/95 px-3 py-2 backdrop-blur-sm dark:border-zinc-800 dark:bg-zinc-900/95`,children:[(0,q.jsx)(`span`,{className:`w-8 text-center glk-eyebrow`,children:`#`}),(0,q.jsx)(`span`,{className:`w-9`}),(0,q.jsx)(`span`,{className:`flex-1 glk-eyebrow`,children:`Player`}),(0,q.jsx)(`span`,{className:`hidden w-20 text-center glk-eyebrow sm:block`,children:`Role`}),(0,q.jsx)(`span`,{className:`w-16 text-right glk-eyebrow`,children:Ke[_]}),(0,q.jsx)(`span`,{className:`w-4`})]}),(0,q.jsx)(`div`,{className:`divide-y divide-zinc-100 dark:divide-zinc-800/50`,children:G.map(e=>{let t=F(e.player.country),n=We>0?e.value/We*100:0,r=e.rank<=3;return(0,q.jsxs)(D,{to:`/${c}/players/${e.player.slug}`,"aria-label":`#${e.rank} ${e.player.ign}${e.player.team?`, ${e.player.team.name}`:``} — ${Ke[_]} ${U(_,e.value)}`,className:`group relative flex w-full items-center gap-3 px-3 py-2.5 text-left transition-colors duration-200 hover:bg-zinc-50 dark:hover:bg-zinc-800/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--glk-brand)]`,children:[(0,q.jsx)(`div`,{className:M(`pointer-events-none absolute inset-y-0 left-0 transition-all`,r?`bg-zinc-100 dark:bg-zinc-800/60`:`bg-zinc-50/40 dark:bg-zinc-900/40`),style:{width:`${n}%`}}),(0,q.jsx)(`div`,{className:`relative z-10 flex w-8 justify-center`,children:(0,q.jsx)(ve,{rank:e.rank})}),(0,q.jsx)(it,{avatarUrl:e.player.avatarUrl,ign:e.player.ign,team:e.player.team,highlight:r}),(0,q.jsxs)(`div`,{className:`relative z-10 flex-1 overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`span`,{className:M(`truncate text-sm font-semibold transition-colors group-hover:text-[var(--glk-brand)]`,r?`text-zinc-900 dark:text-zinc-50`:`text-zinc-900 dark:text-zinc-100`),children:[t&&(0,q.jsx)(`span`,{className:`mr-1`,children:t}),e.player.ign]}),e.player.team?.abbreviation&&(0,q.jsx)(`span`,{className:`hidden flex-shrink-0 text-xs text-zinc-400 sm:inline`,children:e.player.team.abbreviation})]}),(0,q.jsx)(`div`,{className:`truncate text-xs text-zinc-500 dark:text-zinc-400`,children:e.player.team?.name??`Free Agent`})]}),(0,q.jsx)(`div`,{className:`relative z-10 hidden w-20 justify-center sm:flex`,children:(0,q.jsx)(Ge,{role:e.player.role})}),(0,q.jsx)(`span`,{className:M(`relative z-10 w-16 text-right font-mono text-sm font-bold tabular-nums`,r?`text-zinc-900 dark:text-zinc-50`:`text-zinc-800 dark:text-zinc-200`),children:U(_,e.value)}),(0,q.jsx)(o,{size:14,className:`relative z-10 shrink-0 text-zinc-300 group-hover:text-zinc-500 dark:text-zinc-600 dark:group-hover:text-zinc-400`})]},e.player.id)})}),(0,q.jsx)(`div`,{ref:J,className:`h-1`}),L&&(0,q.jsx)(`div`,{className:`flex justify-center py-3`,children:(0,q.jsx)(s,{size:16,className:`animate-spin text-zinc-400`})})]}),x===`list`&&!Y&&!X&&!j&&G&&G.length===0&&(0,q.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-16 text-zinc-400`,children:[(0,q.jsx)(a,{size:32,strokeWidth:1.5}),(0,q.jsx)(`p`,{className:`text-sm`,children:`No players found`}),(0,q.jsx)(`p`,{className:`text-xs`,children:T!==`all`||f.tier!==null?`No players match the current filters`:`Try a different stat or clear filters`})]})]})})})]}):(0,q.jsxs)(Pe,{title:`Players`,width:`w-80`,scrollRef:me,actions:i?(0,q.jsx)(Fe,{isPinned:r,variant:`full`,onClick:i}):void 0,children:[(0,q.jsxs)(`div`,{className:`relative mb-2`,children:[(0,q.jsx)(`input`,{value:E,onChange:e=>A(e.target.value),placeholder:`Search...`,"aria-label":`Search players`,className:`w-full rounded-md border border-zinc-200 bg-zinc-50 px-2.5 py-1.5 pr-7 text-xs text-zinc-800 outline-none placeholder:text-zinc-400 focus:border-[var(--glk-brand)] focus:ring-1 focus:ring-[var(--glk-brand)]/20 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-200 dark:placeholder:text-zinc-500`}),E&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>A(``),"aria-label":`Clear search`,className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--glk-brand)]`,children:(0,q.jsx)(d,{size:12,"aria-hidden":`true`})})]}),Y&&(0,q.jsx)(`div`,{className:`space-y-1`,children:Array.from({length:8}).map((e,t)=>(0,q.jsx)(`div`,{className:`skeleton-shimmer rounded-lg h-10`,style:{opacity:1-t*.08}},t))}),!j&&X&&(0,q.jsx)(je,{message:`Failed to load players`,onRetry:()=>void I(),className:`!py-6`}),j&&z&&(0,q.jsx)(je,{message:`Failed to load player search`,onRetry:()=>void B(),className:`!py-6`}),j&&!z&&R&&(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[R.map(t=>{let n=F(t.country),r=e===t.slug;return(0,q.jsxs)(D,{to:`/${c}/players/${t.slug}`,"aria-label":`View profile for ${t.ign}${t.team?`, ${t.team.name}`:``}`,"aria-current":r?`page`:void 0,className:M(`group flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] focus-visible:ring-offset-1`,r?`bg-[var(--glk-brand)]/10`:`hover:bg-zinc-100 dark:hover:bg-zinc-800/60`),children:[(0,q.jsx)(`div`,{className:`flex h-5 w-5 flex-shrink-0 items-center justify-center`,children:t.team?(0,q.jsx)(k,{name:t.team.name,slug:t.team.slug,abbreviation:t.team.abbreviation,size:`sm`}):(0,q.jsx)(`div`,{className:`flex h-5 w-5 items-center justify-center rounded bg-zinc-200 text-[7px] font-bold text-zinc-400 dark:bg-zinc-800 dark:text-zinc-500`,children:`FA`})}),(0,q.jsxs)(`div`,{className:`flex-1 overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:M(`truncate text-xs font-semibold transition-colors`,r?`text-[var(--glk-brand)]`:`text-zinc-900 group-hover:text-[var(--glk-brand)] dark:text-zinc-100`),children:[n&&(0,q.jsx)(`span`,{className:`mr-1`,children:n}),t.ign]}),(0,q.jsxs)(`div`,{className:`text-xs text-zinc-500 dark:text-zinc-400`,children:[t.team?.abbreviation??t.team?.name??`—`,t.role&&(0,q.jsxs)(`span`,{className:`ml-1 text-zinc-400 dark:text-zinc-500`,children:[`· `,t.role]})]})]}),t.careerAvgAcs!=null&&(0,q.jsx)(`span`,{className:`glk-metric glk-metric-sm text-zinc-800 dark:text-zinc-200`,children:Math.round(t.careerAvgAcs)}),(0,q.jsx)(o,{size:14,className:M(`shrink-0 transition-colors`,r?`text-[var(--glk-brand)]`:`text-zinc-300 group-hover:text-[var(--glk-brand)] dark:text-zinc-600`)})]},t.id)}),R.length===0&&(0,q.jsx)(`div`,{className:`py-8 text-center text-xs text-zinc-500`,children:`No players found`})]}),!j&&!X&&G&&(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[G.map(t=>{let n=F(t.player.country),r=e===t.player.slug,i=t.rank<=3;return(0,q.jsxs)(D,{to:`/${c}/players/${t.player.slug}`,"aria-label":`#${t.rank} ${t.player.ign}${t.player.team?`, ${t.player.team.name}`:``} — ${Ke[_]} ${U(_,t.value)}`,"aria-current":r?`page`:void 0,className:M(`group flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] focus-visible:ring-offset-1`,r?`bg-[var(--glk-brand)]/10`:`hover:bg-zinc-100 dark:hover:bg-zinc-800/60`),children:[(0,q.jsx)(`span`,{className:M(`w-6 text-right glk-tabular text-xs font-bold`,i?`text-zinc-900 dark:text-zinc-100`:`text-zinc-400 dark:text-zinc-500`),children:t.rank}),(0,q.jsx)(`div`,{className:`flex h-5 w-5 flex-shrink-0 items-center justify-center`,children:t.player.team?(0,q.jsx)(k,{name:t.player.team.name,slug:t.player.team.slug,abbreviation:t.player.team.abbreviation,size:`sm`}):(0,q.jsx)(`div`,{className:`flex h-5 w-5 items-center justify-center rounded bg-zinc-200 text-[7px] font-bold text-zinc-400 dark:bg-zinc-800 dark:text-zinc-500`,children:`FA`})}),(0,q.jsxs)(`div`,{className:`flex-1 overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:M(`truncate text-xs font-semibold transition-colors`,r?`text-[var(--glk-brand)]`:`text-zinc-900 group-hover:text-[var(--glk-brand)] dark:text-zinc-100`),children:[n&&(0,q.jsx)(`span`,{className:`mr-1`,children:n}),t.player.ign]}),(0,q.jsxs)(`div`,{className:`text-xs text-zinc-500 dark:text-zinc-400`,children:[t.player.team?.abbreviation??t.player.team?.name??`—`,t.player.role&&(0,q.jsxs)(`span`,{className:`ml-1 text-zinc-400 dark:text-zinc-500`,children:[`· `,t.player.role]})]})]}),(0,q.jsx)(`span`,{className:`glk-metric glk-metric-sm text-zinc-800 dark:text-zinc-200`,children:U(_,t.value)}),(0,q.jsx)(o,{size:14,className:M(`shrink-0 transition-colors`,r?`text-[var(--glk-brand)]`:`text-zinc-300 group-hover:text-[var(--glk-brand)] dark:text-zinc-600`)})]},t.player.id)}),(0,q.jsx)(`div`,{ref:J,className:`h-1`}),L&&(0,q.jsx)(`div`,{className:`flex justify-center py-3`,children:(0,q.jsx)(s,{size:16,className:`animate-spin text-zinc-400`})}),G.length===0&&(0,q.jsx)(`div`,{className:`py-8 text-center text-xs text-zinc-500`,children:`No players found for this tier`})]})]})}function et({value:e,onChange:t}){return(0,q.jsx)(`div`,{role:`group`,"aria-label":`Sort by stat`,className:`inline-flex gap-0.5 rounded-lg border border-zinc-200 p-0.5 dark:border-zinc-800`,children:qe.map(n=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>t(n.value),"aria-pressed":e===n.value,className:M(`rounded-md px-2 py-1 text-xs font-semibold uppercase tracking-wider tabular-nums transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] focus-visible:ring-offset-1`,e===n.value?`bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900`:`text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200`),children:n.label},n.value))})}function tt({value:e,onChange:t}){return(0,q.jsx)(`div`,{role:`group`,"aria-label":`View mode`,className:`inline-flex gap-0.5 rounded-lg border border-zinc-200 p-0.5 dark:border-zinc-800`,children:[{value:`list`,label:`List`},{value:`table`,label:`Table`}].map(n=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>t(n.value),"aria-pressed":e===n.value,className:M(`rounded-md px-2 py-1 text-xs font-semibold uppercase tracking-wider transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] focus-visible:ring-offset-1`,e===n.value?`bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900`:`text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200`),children:n.label},n.value))})}function nt({value:e,onChange:t}){return(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Minimum maps played`,className:`inline-flex items-center gap-0.5 rounded-lg border border-zinc-200 p-0.5 dark:border-zinc-800`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`px-1.5 text-[10px] font-semibold uppercase tracking-wider text-zinc-400 dark:text-zinc-500`,children:`Min`}),X.map(n=>(0,q.jsx)(`button`,{type:`button`,onClick:()=>t(n),"aria-pressed":e===n,"aria-label":`Minimum ${n} maps`,className:M(`rounded-md px-2 py-1 text-xs font-semibold tabular-nums transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] focus-visible:ring-offset-1`,e===n?`bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900`:`text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200`),children:n},n))]})}function rt({gameSlug:e,rows:t,activeStat:n,onSort:r,valuesByStat:i,loading:o,sentinelRef:c,isFetchingNextPage:l,roleFilter:d,tierActive:f}){return o&&t.length===0?(0,q.jsx)(se,{kind:`table`}):t.length===0?(0,q.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-16 text-zinc-400`,children:[(0,q.jsx)(a,{size:32,strokeWidth:1.5}),(0,q.jsx)(`p`,{className:`text-sm`,children:`No players found`}),(0,q.jsx)(`p`,{className:`text-xs`,children:d!==`all`||f?`No players match the current filters`:`Try a different stat or clear filters`})]}):(0,q.jsxs)(`div`,{className:`glk-card !p-0 overflow-x-auto`,children:[(0,q.jsxs)(`table`,{className:`w-full min-w-[640px] border-collapse text-left`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{className:`sticky top-0 z-10 border-b border-zinc-200/80 bg-zinc-50/95 backdrop-blur-sm dark:border-zinc-800 dark:bg-zinc-900/95`,children:[(0,q.jsx)(`th`,{scope:`col`,className:`w-12 px-3 py-2 text-center glk-eyebrow`,children:`Rank`}),(0,q.jsx)(`th`,{scope:`col`,className:`px-3 py-2 glk-eyebrow`,children:`Player`}),(0,q.jsx)(`th`,{scope:`col`,className:`hidden w-20 px-3 py-2 text-center glk-eyebrow lg:table-cell`,children:`Role`}),qe.map(e=>{let t=e.value===n;return(0,q.jsx)(`th`,{scope:`col`,"aria-sort":t?`descending`:`none`,className:`w-16 px-2 py-2 text-right`,children:(0,q.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),"aria-pressed":t,className:M(`glk-eyebrow inline-flex w-full items-center justify-end gap-0.5 transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] focus-visible:ring-offset-1 rounded`,t?`text-zinc-900 dark:text-zinc-100`:`text-zinc-400 hover:text-zinc-700 dark:text-zinc-500 dark:hover:text-zinc-300`),children:[e.label,t&&(0,q.jsx)(u,{size:11,"aria-hidden":!0,className:`flex-shrink-0`})]})},e.value)})]})}),(0,q.jsx)(`tbody`,{className:`divide-y divide-zinc-100 dark:divide-zinc-800/50`,children:t.map(t=>{let r=F(t.player.country);return(0,q.jsxs)(`tr`,{className:`group transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-800/40`,children:[(0,q.jsx)(`td`,{className:`w-12 px-3 py-2 text-center`,children:(0,q.jsx)(`span`,{className:`glk-metric glk-metric-sm tabular-nums text-zinc-500 dark:text-zinc-400`,children:t.rank})}),(0,q.jsx)(`td`,{className:`px-3 py-2`,children:(0,q.jsxs)(D,{to:`/${e}/players/${t.player.slug}`,"aria-label":`View profile for ${t.player.ign}${t.player.team?`, ${t.player.team.name}`:``}`,className:`flex items-center gap-2.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] focus-visible:ring-offset-1 rounded`,children:[(0,q.jsx)(it,{avatarUrl:t.player.avatarUrl,ign:t.player.ign,team:t.player.team}),(0,q.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`truncate text-sm font-semibold text-zinc-900 transition-colors group-hover:text-[var(--glk-brand)] dark:text-zinc-100`,children:[r&&(0,q.jsx)(`span`,{className:`mr-1`,children:r}),t.player.ign]}),(0,q.jsx)(`div`,{className:`truncate text-xs text-zinc-500 dark:text-zinc-400`,children:t.player.team?.name??`Free Agent`})]})]})}),(0,q.jsx)(`td`,{className:`hidden w-20 px-3 py-2 text-center lg:table-cell`,children:(0,q.jsx)(`div`,{className:`flex justify-center`,children:(0,q.jsx)(Ge,{role:t.player.role})})}),qe.map(e=>{let r=i[e.value]?.[t.player.id];return(0,q.jsx)(`td`,{className:`w-16 px-2 py-2 text-right`,children:(0,q.jsx)(`span`,{className:M(`glk-metric glk-metric-sm tabular-nums`,e.value===n?`font-bold text-zinc-900 dark:text-zinc-100`:`text-zinc-600 dark:text-zinc-400`),children:r==null?`—`:U(e.value,r)})},e.value)})]},t.player.id)})})]}),(0,q.jsx)(`div`,{ref:c,className:`h-1`}),l&&(0,q.jsx)(`div`,{className:`flex justify-center py-3`,children:(0,q.jsx)(s,{size:16,className:`animate-spin text-zinc-400`})})]})}function it({avatarUrl:e,ign:t,team:n,highlight:r}){let[i,a]=(0,K.useState)(!1);(0,K.useEffect)(()=>{a(!1)},[e]);let o=Ze(e)&&!i;return(0,q.jsxs)(`div`,{className:`relative z-10 flex h-9 w-9 flex-shrink-0 items-center justify-center`,children:[o?(0,q.jsx)(`img`,{src:Qe(e),alt:`${t} avatar`,loading:`lazy`,onError:()=>a(!0),className:M(`h-9 w-9 rounded-lg object-cover bg-zinc-200 dark:bg-zinc-800`,r?`ring-2 ring-[var(--glk-brand)]`:`ring-1 ring-zinc-200 dark:ring-zinc-700`)}):n?(0,q.jsx)(k,{name:n.name,slug:n.slug,abbreviation:n.abbreviation,logoUrl:n.logoUrl,size:`md`}):(0,q.jsx)(`div`,{"aria-label":`${t} initials`,className:`flex h-9 w-9 items-center justify-center rounded-lg bg-zinc-200 text-xs font-bold text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400`,children:t.charAt(0).toUpperCase()}),o&&n&&(0,q.jsx)(`div`,{className:`absolute -bottom-0.5 -right-0.5 flex h-4 w-4 items-center justify-center rounded bg-white ring-1 ring-zinc-200 dark:bg-zinc-900 dark:ring-zinc-700`,children:(0,q.jsx)(k,{name:n.name,slug:n.slug,abbreviation:n.abbreviation,logoUrl:n.logoUrl,size:`xs`})})]})}function at(e,t){return t===`acs`?e.acs:t===`kd`?e.kills==null?null:e.kills/(e.deaths??1):t===`adr`?e.adr:null}function ot(e){if(e.length<2)return`stable`;let t=e.slice(-5),n=e.slice(-10,-5);if(n.length===0)return`stable`;let r=t.reduce((e,t)=>e+t,0)/t.length,i=n.reduce((e,t)=>e+t,0)/n.length;if(i===0)return`stable`;let a=(r-i)/i;return a>.05?`up`:a<-.05?`down`:`stable`}var st={acs:`ACS`,kd:`K/D`,adr:`ADR`},ct={up:`#22c55e`,down:`#ef4444`,stable:`#a1a1aa`};function lt({recentStats:e,className:n}){let[r,i]=(0,K.useState)(`acs`),a=e.slice().reverse(),o=a.map(e=>at(e,r)),s=[];o.forEach((e,t)=>{e!=null&&s.push(t)});let c=s.filter(e=>a[e].match.team1!=null&&a[e].match.team2!=null).map(e=>{let t=a[e],n=o[e],i=t.match.team1.id===t.teamId?t.match.team2.abbreviation??t.match.team2.name:t.match.team1.abbreviation??t.match.team1.name,s=t.match.playedAt,c=s?new Date(s).toLocaleDateString(void 0,{month:`short`,day:`numeric`}):null;return{value:Math.round(r===`kd`?n*100:n)/(r===`kd`?100:1),label:c?`${t.mapResult.mapName} vs ${i} · ${c}`:`${t.mapResult.mapName} vs ${i}`}}),l=ot(c.map(e=>e.value)),u=ct[l],d=`trend-gradient-${r}`,f=l===`up`?m:l===`down`?p:t,h=l===`up`?`Trending up`:l===`down`?`Trending down`:`Stable`,g=l===`up`?`text-green-500`:l===`down`?`text-red-500`:`text-zinc-400`;return c.length<2?(0,q.jsxs)(`div`,{className:M(`glk-card bg-zinc-50 dark:bg-zinc-900`,n),children:[(0,q.jsx)(`div`,{className:`mb-3 flex items-center justify-between`,children:(0,q.jsx)(`div`,{className:`flex gap-0.5 rounded-md bg-zinc-100 p-0.5 dark:bg-zinc-800`,children:[`acs`,`kd`,`adr`].map(e=>(0,q.jsx)(`button`,{onClick:()=>i(e),"aria-pressed":r===e,className:M(`rounded px-2 py-0.5 text-xs font-semibold uppercase transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] focus-visible:ring-offset-1`,r===e?`bg-white text-zinc-900 shadow-sm dark:bg-zinc-700 dark:text-zinc-100`:`text-zinc-400`),children:st[e]},e))})}),(0,q.jsx)(`p`,{className:`text-sm text-zinc-400`,children:`Not enough data for trend`})]}):(0,q.jsxs)(`div`,{className:M(`glk-card bg-zinc-50 dark:bg-zinc-900`,n),children:[(0,q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,q.jsx)(`div`,{className:`flex gap-0.5 rounded-md bg-zinc-100 p-0.5 dark:bg-zinc-800`,children:[`acs`,`kd`,`adr`].map(e=>(0,q.jsx)(`button`,{onClick:()=>i(e),className:M(`rounded px-2 py-0.5 text-xs font-semibold uppercase transition-colors`,r===e?`bg-white text-zinc-900 shadow-sm dark:bg-zinc-700 dark:text-zinc-100`:`text-zinc-400`),children:st[e]},e))}),(0,q.jsxs)(`div`,{className:M(`flex items-center gap-1 text-xs font-semibold`,g),children:[(0,q.jsx)(f,{size:12,"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:h})]})]}),(0,q.jsx)(`div`,{role:`img`,"aria-label":`${st[r]} performance trend over ${c.length} maps — ${h}`,children:(0,q.jsx)(xe,{width:`100%`,height:160,children:(0,q.jsxs)(Ce,{data:c,margin:{top:4,right:4,bottom:0,left:0},children:[(0,q.jsx)(`defs`,{children:(0,q.jsxs)(`linearGradient`,{id:d,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,q.jsx)(`stop`,{offset:`5%`,stopColor:u,stopOpacity:.3}),(0,q.jsx)(`stop`,{offset:`95%`,stopColor:u,stopOpacity:0})]})}),(0,q.jsx)(Se,{hide:!0,domain:[`dataMin - 10`,`dataMax + 10`]}),(0,q.jsx)(R,{contentStyle:{backgroundColor:`var(--color-card)`,border:`1px solid var(--color-border)`,borderRadius:`6px`,color:`var(--color-card-foreground)`,fontSize:`11px`},formatter:e=>{let t=typeof e==`number`?e:0;return[r===`kd`?t.toFixed(2):Math.round(t),st[r]]},labelFormatter:(e,t)=>t&&t.length>0?t[0].payload.label:``}),(0,q.jsx)(L,{type:`monotone`,dataKey:`value`,stroke:u,strokeWidth:2,fill:`url(#${d})`,dot:!1,activeDot:{r:3,fill:u}})]})})})]})}var ut=x(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Z({className:e,variant:t=`default`,render:n,...r}){return E({defaultTagName:`span`,props:y({className:M(ut({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var dt=50;function ft({isLive:e,date:t}){return e?(0,q.jsxs)(`span`,{"data-testid":`match-log-live-badge`,className:`inline-flex items-center gap-1 rounded bg-red-500/10 px-1 py-0.5 text-[10px] font-bold uppercase tracking-wide text-red-500 dark:text-red-400`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 rounded-full bg-red-500 animate-pulse`}),`Live`]}):(0,q.jsx)(`span`,{className:`text-zinc-400 text-2xs sm:text-xs`,children:t})}function pt({recentStats:e,gameSlug:t}){let[n,r]=(0,K.useState)(dt);(0,K.useEffect)(()=>{r(dt)},[e.length]);let i=(0,K.useMemo)(()=>e.slice(0,n),[e,n]),a=e.length>n;return e.length===0?(0,q.jsx)(`p`,{className:`text-sm text-zinc-400`,children:`No recent maps available.`}):(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{className:`border-b border-zinc-200 dark:border-zinc-800`,children:[(0,q.jsx)(`th`,{className:`pb-2 text-left glk-eyebrow`,children:`Result`}),(0,q.jsx)(`th`,{className:`pb-2 text-left glk-eyebrow`,children:`Map`}),(0,q.jsx)(`th`,{className:`pb-2 text-left glk-eyebrow`,children:`Opponent`}),(0,q.jsx)(`th`,{className:`hidden sm:table-cell pb-2 text-left glk-eyebrow`,children:`Agent`}),(0,q.jsx)(`th`,{className:`hidden sm:table-cell pb-2 text-right glk-eyebrow`,children:`ACS`}),(0,q.jsx)(`th`,{className:`hidden sm:table-cell pb-2 text-right glk-eyebrow`,children:`K/D`})]})}),(0,q.jsx)(`tbody`,{children:i.map(e=>{let n=e.mapResult.winnerId!=null&&e.mapResult.winnerId===e.teamId,r=e.mapResult.winnerId===null,i=e.match.team1.id===e.teamId?e.match.team2:e.match.team1,a=i.abbreviation??i.name,o=!e.match.playedAt&&e.match.status===`live`,s=e.match.playedAt?new Date(e.match.playedAt).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}):``,c=e.kills!=null&&e.deaths!=null?e.deaths===0?`—`:(e.kills/e.deaths).toFixed(2):`—`;return(0,q.jsxs)(`tr`,{className:`border-b border-zinc-100 dark:border-zinc-800/50`,children:[(0,q.jsx)(`td`,{className:`py-2`,children:(0,q.jsx)(`span`,{className:M(`inline-flex h-5 w-5 items-center justify-center rounded text-xs font-bold`,r?`bg-zinc-100 text-zinc-400 dark:bg-zinc-800 dark:text-zinc-500`:n?`bg-[var(--glk-win)]/10 text-[var(--glk-win)]`:`bg-red-500/10 text-red-500`),children:r?`–`:n?`W`:`L`})}),(0,q.jsx)(`td`,{className:`py-2 text-zinc-700 dark:text-zinc-300`,children:(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,q.jsx)(be,{name:e.mapResult.mapName,variant:`thumbnail`,className:`!h-3.5 !w-6 rounded-[2px] opacity-60`}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:e.mapResult.mapName})]})}),(0,q.jsx)(`td`,{className:`py-2 text-zinc-500`,children:e.match.id?(0,q.jsxs)(D,{to:`/${t}/matches/${e.match.id}`,className:`hover:underline hover:text-zinc-700 dark:hover:text-zinc-300 transition-colors`,children:[(0,q.jsx)(`span`,{className:`sm:hidden`,children:a}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:i.name}),` `,(0,q.jsx)(ft,{isLive:o,date:s})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`sm:hidden`,children:a}),(0,q.jsx)(`span`,{className:`hidden sm:inline`,children:i.name}),` `,(0,q.jsx)(ft,{isLive:o,date:s})]})}),(0,q.jsx)(`td`,{className:`hidden sm:table-cell py-2 text-zinc-700 dark:text-zinc-300`,children:(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,q.jsx)(ye,{name:e.agent??``,size:`xs`,showFallback:!1}),e.agent]})}),(0,q.jsx)(`td`,{className:`hidden sm:table-cell py-2 text-right glk-metric font-semibold text-zinc-900 dark:text-zinc-100`,children:e.acs??`—`}),(0,q.jsx)(`td`,{className:`hidden sm:table-cell py-2 text-right glk-metric text-zinc-700 dark:text-zinc-300`,children:c})]},e.id)})})]}),(0,q.jsxs)(`div`,{className:`mt-2 flex items-center justify-between`,children:[(0,q.jsxs)(`p`,{className:`text-xs text-zinc-400`,children:[n>=e.length?e.length:n,` of `,e.length,` `,W(e.length,`map`,`maps`)]}),a&&(0,q.jsx)(`button`,{onClick:()=>r(t=>Math.min(t+dt,e.length)),className:`text-xs font-semibold text-[var(--glk-brand)] hover:underline`,children:`Show more`})]})]})}function mt({results:e,mapName:t}){if(e.length===0)return null;let n=e.filter(e=>e===`W`).length,r=e.slice(-10);return(0,q.jsx)(`div`,{className:`flex gap-px`,role:`img`,"aria-label":`Recent results on ${t}: ${n}W ${e.length-n}L`,children:r.map((e,t)=>(0,q.jsx)(`div`,{className:`h-2.5 w-1.5 rounded-[1px] ${e===`W`?`bg-emerald-500`:`bg-rose-500`}`,style:{opacity:.35+t/Math.max(r.length-1,1)*.65}},t))})}function ht({winRate:e,size:t=28}){let n=(t-3)/2,r=t/2,i=t/2,a=2*Math.PI*n,o=a*e,s=Math.round(e*100);return(0,q.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,className:`flex-shrink-0`,"aria-hidden":`true`,children:[(0,q.jsx)(`circle`,{cx:r,cy:i,r:n,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.08`,strokeWidth:`2.5`}),(0,q.jsx)(`circle`,{cx:r,cy:i,r:n,fill:`none`,stroke:s>=50?`var(--glk-win)`:`var(--glk-loss)`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeDasharray:`${o} ${a}`,strokeDashoffset:a*.25,opacity:`0.7`}),(0,q.jsx)(`text`,{x:r,y:i+.5,textAnchor:`middle`,dominantBaseline:`middle`,className:`fill-zinc-600 dark:fill-zinc-300`,fontSize:`7`,fontWeight:`bold`,fontFamily:`var(--font-mono)`,children:s})]})}function gt({recentStats:e}){let t=(0,K.useMemo)(()=>{let t=new Map;for(let n of e){let e=n.mapResult.mapName,r=t.get(e)??{wins:0,losses:0,totalAcs:0,acsCount:0,results:[]},i=n.mapResult.winnerId!=null&&n.mapResult.winnerId===n.teamId;n.mapResult.winnerId!=null&&(i?(r.wins++,r.results.push(`W`)):(r.losses++,r.results.push(`L`))),n.acs!=null&&(r.totalAcs+=n.acs,r.acsCount++),t.set(e,r)}let n=[];for(let[e,r]of t){let t=r.wins+r.losses;n.push({mapName:e,wins:r.wins,losses:r.losses,total:t,winRate:t>0?r.wins/t:0,avgAcs:r.acsCount>0?Math.round(r.totalAcs/r.acsCount):0,results:r.results})}return n.sort((e,t)=>t.total-e.total)},[e]);return t.length===0?(0,q.jsx)(I,{icon:(0,q.jsx)(r,{size:24,strokeWidth:1.5,"aria-hidden":`true`}),message:`No map data yet`,submessage:`Map-specific performance will appear after matches are played.`}):(0,q.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>{let t=e.winRate>=.7&&e.total>=3,n=e.winRate<=.3&&e.total>=3;return(0,q.jsxs)(`div`,{className:`group relative overflow-hidden rounded-lg border transition-colors ${t?`border-emerald-200/50 bg-emerald-50/30 dark:border-emerald-800/20 dark:bg-emerald-900/5`:n?`border-red-200/30 bg-red-50/20 dark:border-red-900/20 dark:bg-red-900/5`:`border-zinc-100 dark:border-zinc-800/50`}`,"aria-label":`${e.mapName}: ${e.wins}W ${e.losses}L, ACS ${e.avgAcs}${t?` (best map)`:n?` (worst map)`:``}`,children:[(0,q.jsx)(`div`,{className:`absolute inset-0 opacity-[0.03] dark:opacity-[0.05]`,children:(0,q.jsx)(be,{name:e.mapName,variant:`strip`,index:0,total:1})}),(0,q.jsxs)(`div`,{className:`relative flex items-center gap-2.5 px-3 py-2`,children:[(0,q.jsx)(ht,{winRate:e.winRate}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(`span`,{className:`glk-eyebrow text-zinc-700 dark:text-zinc-300`,children:e.mapName}),t&&(0,q.jsx)(`span`,{className:`rounded bg-emerald-100 px-1 py-0.5 text-[8px] font-bold uppercase text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400`,children:`Best`}),n&&(0,q.jsx)(`span`,{className:`rounded bg-red-100 px-1 py-0.5 text-[8px] font-bold uppercase text-red-600 dark:bg-red-900/30 dark:text-red-400`,children:`Worst`})]}),(0,q.jsx)(`div`,{className:`mt-0.5`,children:(0,q.jsx)(mt,{results:e.results,mapName:e.mapName})})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-3 text-right`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`glk-metric-sm text-zinc-700 dark:text-zinc-200`,children:e.avgAcs}),(0,q.jsx)(`div`,{className:`text-2xs text-zinc-400`,children:`ACS`})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`span`,{className:`glk-tabular text-xs text-zinc-500`,children:[(0,q.jsxs)(`span`,{className:`font-bold text-emerald-600 dark:text-emerald-400`,children:[e.wins,`W`]}),` `,(0,q.jsxs)(`span`,{className:`font-bold text-red-500 dark:text-red-400`,children:[e.losses,`L`]})]}),(0,q.jsxs)(`div`,{className:`text-2xs text-zinc-400`,children:[e.total,` `,W(e.total,`map`,`maps`)]})]})]})]})]},e.mapName)})})}function _t({fkRate:e,total:t}){let n=Math.round(e*100),r=Math.max(e*100,2),i=Math.max((1-e)*100,2);return(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between glk-eyebrow`,children:[(0,q.jsx)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:`First Kills`}),(0,q.jsx)(`span`,{className:`text-red-500 dark:text-red-400`,children:`First Deaths`})]}),(0,q.jsxs)(`div`,{className:`flex h-5 gap-0.5 overflow-hidden rounded-md`,children:[(0,q.jsx)(`div`,{className:`flex items-center justify-end rounded-l-md bg-emerald-500/70 px-1.5 transition-all`,style:{width:`${r}%`},children:r>15&&(0,q.jsxs)(`span`,{className:`text-2xs font-bold text-white`,children:[n,`%`]})}),(0,q.jsx)(`div`,{className:`flex items-center rounded-r-md bg-red-500/50 px-1.5 transition-all`,style:{width:`${i}%`},children:i>15&&(0,q.jsxs)(`span`,{className:`text-2xs font-bold text-white`,children:[100-n,`%`]})})]}),(0,q.jsxs)(`div`,{className:`text-center text-2xs text-zinc-400`,children:[t,` opening duels`]})]})}function vt({diffs:e}){if(e.length<2)return null;let t=Math.max(Math.abs(Math.min(...e)),Math.abs(Math.max(...e)),1),n=e.length*6,r=e.filter(e=>e>0).length,i=e.filter(e=>e<0).length;return(0,q.jsxs)(`svg`,{width:`100%`,height:40,viewBox:`0 0 ${n} 40`,className:`overflow-visible`,role:`img`,"aria-label":`FK–FD per map: ${r} positive, ${i} negative across ${e.length} maps`,children:[(0,q.jsx)(`line`,{x1:`0`,y1:20,x2:n,y2:20,stroke:`currentColor`,strokeOpacity:`0.1`,strokeWidth:`1`}),e.map((n,r)=>{let i=r*6+3,a=Math.abs(n/t)*18,o=n>=0?20-a:20,s=n>=0?`#22c55e`:`#ef4444`;return(0,q.jsx)(`rect`,{x:i-1.5,y:o,width:`3`,height:Math.max(a,1),rx:`1`,fill:s,opacity:.3+r/e.length*.5},r)})]})}function yt({recentStats:e}){let t=(0,K.useMemo)(()=>{let t=0,n=0,r=0,i=0,a=0,o=0,s=0,c=[];for(let l of e)l.fk!=null&&l.fd!=null&&(t+=l.fk,n+=l.fd,c.push(l.fk-l.fd),r++),l.kills!=null&&l.deaths!=null&&(i+=l.kills,a+=l.deaths,o+=l.assists??0,s++);let l=t+n,u=l>0?t/l:.5,d=r>0?t/r:0,f=r>0?n/r:0,p=s>0?i/s:0,m=s>0?a/s:0,h=s>0?o/s:0,g=a>0?i/a:0,_=a>0?(i+o)/a:0,v=t-n;return{totalFk:t,totalFd:n,totalDuels:l,fkRate:u,avgFkPerMap:d,avgFdPerMap:f,avgKills:p,avgDeaths:m,avgAssists:h,kd:g,kda:_,fkDiff:v,diffs:c,fkMaps:r,kdMaps:s}},[e]);return t.fkMaps===0&&t.kdMaps===0?(0,q.jsx)(I,{icon:(0,q.jsx)(_,{size:24,strokeWidth:1.5,"aria-hidden":`true`}),message:`No impact data yet`,submessage:`Kill and opening-duel stats will appear after matches are logged.`}):(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[{label:`Avg Kills`,value:t.avgKills.toFixed(1),color:`text-zinc-900 dark:text-zinc-100`},{label:`Avg Deaths`,value:t.avgDeaths.toFixed(1),color:`text-zinc-900 dark:text-zinc-100`},{label:`K/D`,value:t.kd.toFixed(2),color:t.kd>=1?`text-emerald-600 dark:text-emerald-400`:`text-red-500`},{label:`KDA`,value:t.kda.toFixed(2),color:`text-zinc-900 dark:text-zinc-100`}].map(e=>(0,q.jsxs)(`div`,{className:`rounded-lg bg-zinc-100/80 px-2.5 py-2 dark:bg-zinc-800/40`,children:[(0,q.jsx)(`div`,{className:`glk-eyebrow`,children:e.label}),(0,q.jsx)(`div`,{className:`glk-metric-md ${e.color}`,children:e.value})]},e.label))}),t.fkMaps>0&&(0,q.jsxs)(`div`,{className:`rounded-lg bg-zinc-100/80 p-3 dark:bg-zinc-800/40`,children:[(0,q.jsxs)(`div`,{className:`mb-2 flex items-center gap-1 glk-eyebrow`,children:[`Opening Duels`,(0,q.jsx)(Ue,{text:`First Kill vs First Death ratio across all maps. Higher FK% means this player wins more opening engagements.`})]}),(0,q.jsx)(_t,{fkRate:t.fkRate,total:t.totalDuels}),(0,q.jsx)(`div`,{className:`mt-3 flex items-center justify-between`,children:(0,q.jsxs)(`div`,{className:`flex gap-3`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`glk-metric-sm text-emerald-600 dark:text-emerald-400`,children:t.avgFkPerMap.toFixed(1)}),(0,q.jsx)(`div`,{className:`text-2xs text-zinc-400`,children:`FK/map`})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`glk-metric-sm text-red-500`,children:t.avgFdPerMap.toFixed(1)}),(0,q.jsx)(`div`,{className:`text-2xs text-zinc-400`,children:`FD/map`})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`glk-metric-sm ${t.fkDiff>=0?`text-emerald-600 dark:text-emerald-400`:`text-red-500`}`,children:[t.fkDiff>=0?`+`:``,t.fkDiff]}),(0,q.jsx)(`div`,{className:`text-2xs text-zinc-400`,children:`FK diff`})]})]})}),t.diffs.length>2&&(0,q.jsxs)(`div`,{className:`mt-3`,children:[(0,q.jsx)(`div`,{className:`text-2xs text-zinc-400 mb-1`,children:`FK–FD per map (recent →)`}),(0,q.jsx)(vt,{diffs:t.diffs.slice().reverse()})]})]})]})}var bt={Jett:`Duelist`,Raze:`Duelist`,Reyna:`Duelist`,Phoenix:`Duelist`,Yoru:`Duelist`,Neon:`Duelist`,Iso:`Duelist`,Waylay:`Duelist`,Omen:`Controller`,Brimstone:`Controller`,Astra:`Controller`,Viper:`Controller`,Harbor:`Controller`,Clove:`Controller`,Sage:`Sentinel`,Cypher:`Sentinel`,Killjoy:`Sentinel`,Chamber:`Sentinel`,Deadlock:`Sentinel`,Vyse:`Sentinel`,Sova:`Initiator`,Breach:`Initiator`,Skye:`Initiator`,Kayo:`Initiator`,Fade:`Initiator`,Gekko:`Initiator`,Tejo:`Initiator`},xt={Duelist:`#ef4444`,Controller:`#3b82f6`,Sentinel:`#22c55e`,Initiator:`#f59e0b`};function St({agents:e,size:t=80}){let n=t/2,r=t/2,i=(t-8)/2,a=2*Math.PI*i,o=-a*.25,s=e.map(e=>`${e.agent} ${Math.round(e.pct*100)}%`).join(`, `);return(0,q.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,className:`flex-shrink-0`,role:`img`,"aria-label":`Agent usage ring: ${s}`,children:[e.map(e=>{let t=a*e.pct,s=(0,q.jsx)(`circle`,{cx:n,cy:r,r:i,fill:`none`,stroke:xt[bt[e.agent]??`Duelist`]??`#71717a`,strokeWidth:`5`,strokeLinecap:`round`,strokeDasharray:`${Math.max(t-2,1)} ${a-Math.max(t-2,1)}`,strokeDashoffset:-o,opacity:`0.65`},e.agent);return o+=t,s}),(0,q.jsx)(`text`,{x:n,y:r-3,textAnchor:`middle`,dominantBaseline:`middle`,className:`fill-zinc-800 dark:fill-zinc-200`,fontSize:`16`,fontWeight:`900`,children:e.length}),(0,q.jsx)(`text`,{x:n,y:r+10,textAnchor:`middle`,dominantBaseline:`middle`,className:`fill-zinc-400`,fontSize:`8`,fontWeight:`600`,children:`AGENTS`})]})}function Ct({recentStats:e}){let t=(0,K.useMemo)(()=>{let t=new Map;for(let n of e){if(!n.agent)continue;let e=t.get(n.agent)??{maps:0,totalAcs:0,acsCount:0,totalKills:0,totalDeaths:0,kdCount:0,wins:0};e.maps++,n.acs!=null&&(e.totalAcs+=n.acs,e.acsCount++),n.kills!=null&&n.deaths!=null&&(e.totalKills+=n.kills,e.totalDeaths+=n.deaths,e.kdCount++),n.mapResult.winnerId===n.teamId&&e.wins++,t.set(n.agent,e)}let n=e.filter(e=>e.agent).length,r=[];for(let[e,i]of t)r.push({agent:e,maps:i.maps,pct:n>0?i.maps/n:0,avgAcs:i.acsCount>0?Math.round(i.totalAcs/i.acsCount):0,avgKd:i.kdCount>0&&i.totalDeaths>0?i.totalKills/i.totalDeaths:null,winRate:i.maps>0?i.wins/i.maps:0,wins:i.wins,losses:i.maps-i.wins});return r.sort((e,t)=>t.maps-e.maps)},[e]);if(t.length===0)return(0,q.jsx)(I,{icon:(0,q.jsx)(b,{size:24,strokeWidth:1.5,"aria-hidden":`true`}),message:`No agent data yet`,submessage:`Stats will appear once this player has logged a map.`});let n=t[0],r=t.filter(e=>e.maps>=3).length;return(0,q.jsxs)(`div`,{className:`space-y-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,q.jsx)(St,{agents:t}),(0,q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(ye,{name:n.agent,size:`lg`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm font-black text-zinc-900 dark:text-zinc-100`,children:n.agent}),(0,q.jsxs)(`div`,{className:`text-2xs text-zinc-400`,children:[`Primary — `,Math.round(n.pct*100),`% pick rate`]})]})]}),(0,q.jsxs)(`div`,{className:`mt-1.5 flex gap-2`,children:[(0,q.jsx)(`span`,{className:`rounded bg-zinc-100 px-1.5 py-0.5 text-2xs font-bold text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300`,children:r>=4?`Flex player`:r>=2?`${r}-agent pool`:`One-trick`}),n.pct>=.6&&(0,q.jsx)(`span`,{className:`rounded bg-amber-100 px-1.5 py-0.5 text-2xs font-bold text-amber-700 dark:bg-amber-900/30 dark:text-amber-400`,children:`Specialist`})]})]})]}),(0,q.jsxs)(`div`,{className:`space-y-1`,children:[t.map(e=>{let t=xt[bt[e.agent]??`Duelist`]??`#71717a`,n=e.avgKd==null?``:`K/D ${e.avgKd.toFixed(2)}`;return(0,q.jsxs)(`div`,{className:`relative flex items-center gap-2 rounded-md px-2 py-1.5 overflow-hidden`,role:`row`,"aria-label":`${e.agent}: ${Math.round(e.pct*100)}% pick rate, ACS ${e.avgAcs}${n?`, `+n:``}, ${e.maps} maps`,children:[(0,q.jsx)(`div`,{className:`absolute inset-0 rounded-md`,style:{width:`${Math.max(e.pct*100,3)}%`,backgroundColor:t,opacity:.06}}),(0,q.jsx)(ye,{name:e.agent,size:`sm`,className:`relative z-10`}),(0,q.jsx)(`span`,{className:`relative z-10 w-12 sm:w-16 truncate text-xs font-semibold text-zinc-700 dark:text-zinc-300`,children:e.agent}),(0,q.jsx)(`div`,{className:`relative z-10 flex-1 min-w-0 h-2 rounded-full bg-zinc-200/60 dark:bg-zinc-700/30 overflow-hidden`,children:(0,q.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${Math.max(e.pct*100,3)}%`,backgroundColor:t,opacity:.6}})}),(0,q.jsxs)(`span`,{className:`relative z-10 w-8 text-right glk-metric-sm text-zinc-500`,children:[Math.round(e.pct*100),`%`]}),(0,q.jsx)(`span`,{className:`relative z-10 hidden sm:inline w-8 text-right glk-metric-sm text-zinc-700 dark:text-zinc-300`,children:e.avgAcs}),(0,q.jsx)(`span`,{className:M(`relative z-10 hidden sm:inline w-8 text-right glk-metric-sm`,e.avgKd!=null&&e.avgKd>=1?`text-emerald-600 dark:text-emerald-400`:`text-red-500`),children:e.avgKd==null?`—`:e.avgKd.toFixed(2)}),(0,q.jsx)(`span`,{className:`relative z-10 w-7 text-right glk-tabular text-2xs text-zinc-400`,children:e.maps})]},e.agent)}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2 px-2 glk-eyebrow`,children:[(0,q.jsx)(`span`,{className:`w-5`}),(0,q.jsx)(`span`,{className:`w-12 sm:w-16`}),(0,q.jsx)(`span`,{className:`flex-1 text-center`,children:`Usage`}),(0,q.jsx)(`span`,{className:`w-8 text-right`,children:`%`}),(0,q.jsx)(`span`,{className:`hidden sm:inline w-8 text-right`,children:`ACS`}),(0,q.jsx)(`span`,{className:`hidden sm:inline w-8 text-right`,children:`K/D`}),(0,q.jsx)(`span`,{className:`w-7 text-right`,children:`Maps`})]})]})]})}function wt({recentStats:e}){let t=(0,K.useMemo)(()=>{let t=new Map;for(let n of e){let e=n.match.team1?.id===n.teamId?n.match.team2:n.match.team1;if(!e)continue;let r=t.get(e.id)??{name:e.name,maps:0,wins:0,totalAcs:0,acsCount:0,totalKills:0,totalDeaths:0,kdCount:0};r.maps++,n.mapResult.winnerId===n.teamId&&r.wins++,n.acs!=null&&(r.totalAcs+=n.acs,r.acsCount++),n.kills!=null&&n.deaths!=null&&(r.totalKills+=n.kills,r.totalDeaths+=n.deaths,r.kdCount++),t.set(e.id,r)}let n=[];for(let[,e]of t)e.maps<2||n.push({name:e.name,maps:e.maps,wins:e.wins,losses:e.maps-e.wins,winRate:e.maps>0?e.wins/e.maps:0,avgAcs:e.acsCount>0?Math.round(e.totalAcs/e.acsCount):0,avgKd:e.kdCount>0&&e.totalDeaths>0?e.totalKills/e.totalDeaths:null});return n.sort((e,t)=>t.maps-e.maps).slice(0,8)},[e]);if(t.length===0)return(0,q.jsx)(I,{icon:(0,q.jsx)(a,{size:24,strokeWidth:1.5,"aria-hidden":`true`}),message:`Not enough opponent data`,submessage:`Requires matches against the same opponent 2+ times.`});let n=t.filter(e=>e.maps>=3),r=n.length>0?n.reduce((e,t)=>e.winRate<t.winRate?e:t):null,i=n.length>0?n.reduce((e,t)=>e.winRate>t.winRate?e:t):null;return(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(r||i)&&(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-2 mb-1`,children:[i&&i.winRate>=.6&&(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-emerald-100 px-1.5 py-0.5 text-2xs font-bold text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400`,children:[`Dominates vs `,i.name,(0,q.jsxs)(`span`,{className:`text-emerald-500`,children:[Math.round(i.winRate*100),`%`]})]}),r&&r.winRate<=.4&&(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-red-100 px-1.5 py-0.5 text-2xs font-bold text-red-600 dark:bg-red-900/30 dark:text-red-400`,children:[`Struggles vs `,r.name,(0,q.jsxs)(`span`,{className:`text-red-500`,children:[Math.round(r.winRate*100),`%`]})]})]}),(0,q.jsxs)(`div`,{className:`space-y-1`,children:[t.map(e=>(0,q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md px-2 py-1.5`,role:`row`,"aria-label":`vs ${e.name}: ${e.wins}W ${e.losses}L (${Math.round(e.winRate*100)}% win rate), ACS ${e.avgAcs}`,children:[(0,q.jsx)(`span`,{className:`w-20 sm:w-28 truncate text-xs font-semibold text-zinc-700 dark:text-zinc-300`,children:e.name}),(0,q.jsxs)(`div`,{className:`flex-1 min-w-0 h-3 rounded-full bg-zinc-200/60 dark:bg-zinc-700/30 overflow-hidden flex`,"aria-hidden":`true`,children:[(0,q.jsx)(`div`,{className:`h-full bg-emerald-500/60 transition-all`,style:{width:`${e.winRate*100}%`}}),(0,q.jsx)(`div`,{className:`h-full bg-red-500/40 transition-all`,style:{width:`${(1-e.winRate)*100}%`}})]}),(0,q.jsxs)(`span`,{className:`w-10 sm:w-12 text-right text-2xs tabular-nums text-zinc-500`,children:[(0,q.jsxs)(`span`,{className:`font-bold text-emerald-600 dark:text-emerald-400`,children:[e.wins,`W`]}),` `,(0,q.jsxs)(`span`,{className:`font-bold text-red-500`,children:[e.losses,`L`]})]}),(0,q.jsx)(`span`,{className:`hidden sm:inline w-8 text-right glk-metric-sm text-zinc-700 dark:text-zinc-200`,children:e.avgAcs}),(0,q.jsx)(`span`,{className:`hidden sm:inline w-8 text-right glk-metric-sm text-zinc-500`,children:e.avgKd==null?`—`:e.avgKd.toFixed(2)})]},e.name)),(0,q.jsxs)(`div`,{className:`flex items-center gap-2 px-2 glk-eyebrow`,children:[(0,q.jsx)(`span`,{className:`w-20 sm:w-28`,children:`Opponent`}),(0,q.jsx)(`span`,{className:`flex-1 text-center`,children:`Win Rate`}),(0,q.jsx)(`span`,{className:`w-10 sm:w-12 text-right`,children:`Record`}),(0,q.jsx)(`span`,{className:`hidden sm:inline w-8 text-right`,children:`ACS`}),(0,q.jsx)(`span`,{className:`hidden sm:inline w-8 text-right`,children:`K/D`})]})]})]})}function Tt(e,t){return de(le.playerSentiment,{gameSlug:e,playerSlug:t},{enabled:!!t})}function Et(e){let t=e.toLowerCase().replace(/[\s-]+/g,`_`);return t.includes(`favorite`)||t.includes(`favourite`)?w:t.includes(`clutch`)?l:t.includes(`rising`)?m:t.includes(`villain`)||t.includes(`liability`)?T:t.includes(`washed`)?f:t.includes(`inconsistent`)?c:t.includes(`underrated`)?g:t.includes(`overhyped`)?i:t.includes(`leader`)?v:t.includes(`neutral`)?a:S}function Dt(e){let t=e.toLowerCase().replace(/[\s-]+/g,`_`);return t.includes(`favorite`)||t.includes(`favourite`)||t.includes(`clutch`)||t.includes(`rising`)||t.includes(`underrated`)||t.includes(`leader`)?`text-emerald-500 dark:text-emerald-400`:t.includes(`villain`)||t.includes(`liability`)||t.includes(`washed`)||t.includes(`overhyped`)||t.includes(`inconsistent`)?`text-rose-500 dark:text-rose-400`:`text-zinc-400 dark:text-zinc-500`}function Ot(e){let t=e.toLowerCase().replace(/[\s-]+/g,`_`);return t.includes(`favorite`)||t.includes(`favourite`)||t.includes(`clutch`)||t.includes(`rising`)||t.includes(`underrated`)||t.includes(`leader`)?`bg-emerald-500/70 dark:bg-emerald-500/60`:t.includes(`villain`)||t.includes(`liability`)||t.includes(`washed`)||t.includes(`overhyped`)||t.includes(`inconsistent`)?`bg-rose-500/70 dark:bg-rose-500/60`:`bg-zinc-400/60 dark:bg-zinc-500/50`}function kt(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function At(e){return e.replace(/_/g,` `).toLowerCase()}function jt(e){return e>=.6?`Community Icon`:e>=.35?`Highly Rated`:e>=.15?`Gaining Hype`:e>-.15?`Mixed Opinions`:e>-.35?`Under Fire`:e>-.6?`Struggling`:`Fan Villain`}function Mt(e){return e>=.35?`text-emerald-400 bg-emerald-500/10 border-emerald-500/20`:e>=.15?`text-emerald-500/80 bg-emerald-500/5 border-emerald-500/10`:e>-.15?`text-zinc-400 bg-zinc-500/10 border-zinc-500/20`:e>-.35?`text-rose-500/80 bg-rose-500/5 border-rose-500/10`:`text-rose-400 bg-rose-500/10 border-rose-500/20`}function Nt({score:e,delta:t,verdict:n,verdictCls:r}){let i=e>=0,a=t>=0,o=a?m:p;return(0,q.jsxs)(`div`,{className:M(`flex items-center gap-4 rounded-xl border px-4 py-3`,r),children:[(0,q.jsxs)(`div`,{className:`flex-shrink-0 text-center`,children:[(0,q.jsxs)(`div`,{className:`glk-metric glk-metric-xl leading-none`,children:[i?`+`:``,e.toFixed(2)]}),(0,q.jsx)(`div`,{className:`mt-0.5 glk-eyebrow opacity-70`,children:`sentiment`})]}),(0,q.jsx)(`div`,{className:`h-10 w-px bg-current opacity-20`}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`div`,{className:`text-sm font-black uppercase tracking-wide leading-tight`,children:n}),(0,q.jsxs)(`div`,{className:`mt-1 flex items-center gap-1 text-xs font-medium opacity-75`,children:[(0,q.jsx)(o,{size:11,"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[a?`+`:``,t.toFixed(2),` vs prior 7d`]})]})]})]})}function Pt({label:e,count:t,maxCount:n}){let r=Et(e),i=Dt(e),a=Ot(e),o=n>0?t/n*100:0;return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 py-1`,children:[(0,q.jsx)(r,{size:12,className:M(`flex-shrink-0`,i),"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:M(`w-28 flex-shrink-0 text-xs font-semibold`,i),children:kt(e)}),(0,q.jsx)(`div`,{className:`flex h-2 flex-1 overflow-hidden rounded-full bg-zinc-100 dark:bg-zinc-800`,children:(0,q.jsx)(`div`,{className:M(`h-full rounded-full transition-all`,a),style:{width:`${o}%`}})}),(0,q.jsx)(`span`,{className:`w-5 flex-shrink-0 text-right text-xs font-bold tabular-nums text-zinc-500 dark:text-zinc-400`,children:t})]})}function Ft(){return(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(z,{className:`h-[72px] rounded-xl`}),(0,q.jsx)(we,{count:3,className:`h-6`})]})}function It({gameSlug:e,playerSlug:t}){let{data:n,isLoading:r,isError:i}=Tt(e,t);if(r)return(0,q.jsx)(Ft,{});if(i)return(0,q.jsx)(I,{icon:(0,q.jsx)(a,{size:22,strokeWidth:1.5,"aria-hidden":`true`}),message:`Couldn't load reputation data`});if(!n||n.mentionCount===0)return(0,q.jsx)(I,{icon:(0,q.jsx)(a,{size:22,strokeWidth:1.5,"aria-hidden":`true`}),message:`No community signals yet`,submessage:`Reputation builds as the community talks about this player`});let{currentSentiment:o,delta:s,mentionCount:c,topLabel:l,labels:u,topThemes:d}=n,f=jt(o),p=Mt(o),m=u.slice(0,5),h=m.reduce((e,t)=>Math.max(e,t.count),0);return(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(`div`,{className:`flex items-center justify-between px-0.5`,children:(0,q.jsx)(`span`,{className:`glk-eyebrow`,children:`Community scouting report · last 7d`})}),(0,q.jsx)(Nt,{score:o,delta:s,verdict:f,verdictCls:p}),l&&(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`glk-eyebrow`,children:`Top Label`}),(0,q.jsx)(`span`,{className:M(`glk-eyebrow rounded-full border px-2 py-0.5`,p),children:kt(l)})]}),m.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1.5 glk-eyebrow`,children:`Reputation Labels`}),(0,q.jsx)(`div`,{className:`space-y-0.5`,children:m.map(e=>(0,q.jsx)(Pt,{label:e.label,count:e.count,maxCount:h},e.label))})]}),d.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1.5 glk-eyebrow`,children:`Recurring Themes`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d.map(e=>(0,q.jsx)(`span`,{className:`rounded-full bg-zinc-100 px-2.5 py-0.5 text-xs font-medium text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400`,children:At(e.theme)},e.theme))})]}),(0,q.jsxs)(`p`,{className:`text-2xs text-zinc-400 dark:text-zinc-600`,children:[`Based on `,c,` community signal`,c===1?``:`s`]})]})}function Lt({status:e,isCoach:t,className:n}){return t?(0,q.jsx)(Z,{variant:`secondary`,className:M(`bg-teal-100 text-teal-700 dark:bg-teal-900/40 dark:text-teal-300 text-xs px-1.5 py-0 font-semibold`,n),children:`Coach`}):e===`active`?null:e===`free_agent`?(0,q.jsx)(Z,{variant:`secondary`,className:M(`bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300 text-xs px-1.5 py-0 font-semibold`,n),children:`Free Agent`}):e===`reserve`?(0,q.jsx)(Z,{variant:`secondary`,className:M(`bg-slate-100 text-slate-600 dark:bg-slate-800/60 dark:text-slate-300 text-xs px-1.5 py-0 font-semibold`,n),children:`Reserve`}):e===`inactive`?(0,q.jsx)(Z,{variant:`secondary`,className:M(`bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400 text-xs px-1.5 py-0 font-semibold`,n),children:`Inactive`}):e===`retired`?(0,q.jsx)(Z,{variant:`secondary`,className:M(`bg-zinc-200 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-400 text-xs px-1.5 py-0 font-semibold`,n),children:`Retired`}):(0,q.jsx)(Z,{variant:`outline`,className:M(`text-xs px-1.5 py-0 font-semibold`,n),children:e})}var Rt=[{id:`last20`,label:`Last 20`,count:20},{id:`last50`,label:`Last 50`,count:50},{id:`career`,label:`Career`,count:2e3}];function Q({label:e,value:t}){return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`glk-eyebrow`,children:e}),(0,q.jsx)(`div`,{className:`glk-metric text-lg sm:text-2xl font-bold text-zinc-900 dark:text-zinc-100`,children:t})]})}function $(e,t=0){return e==null?`—`:t>0?e.toFixed(t):Math.round(e).toString()}function zt(e){return e==null?null:Math.max(0,Math.min(1,e))}function Bt({rank:e,total:t,percentile:n}){let r=n==null?null:Math.max(1,Math.ceil(100-n));return(0,q.jsxs)(`div`,{"data-testid":`player-rank-tile`,className:`flex flex-col`,children:[(0,q.jsx)(`div`,{className:`glk-eyebrow`,children:`Pool rank`}),r==null?(0,q.jsxs)(`div`,{className:`glk-metric text-lg sm:text-2xl font-bold text-zinc-900 dark:text-zinc-100`,children:[`#`,e.toLocaleString()]}):(0,q.jsxs)(`div`,{className:`glk-metric text-lg sm:text-2xl font-bold text-zinc-900 dark:text-zinc-100`,children:[`Top `,r,`%`]}),(0,q.jsxs)(`div`,{className:`text-2xs text-zinc-400 glk-tabular`,children:[`#`,e.toLocaleString(),t==null?``:` of ${t.toLocaleString()}`]})]})}function Vt(e){if(e.length===0)return null;let t=0,n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0;for(let p of e)p.acs!=null&&(t+=p.acs,n++),p.kills!=null&&p.deaths!=null&&(r+=p.kills,i+=p.deaths,a++),p.adr!=null&&(o+=p.adr,s++),p.kast!=null&&p.kast>=0&&p.kast<=1&&(c+=p.kast,l++),p.hsPct!=null&&p.hsPct>=0&&p.hsPct<=1&&(u+=p.hsPct,d++),p.mapResult.winnerId===p.teamId&&f++;return{avgAcs:n>0?t/n:null,avgKd:a>0&&i>0?r/i:null,avgAdr:s>0?o/s:null,avgKast:l>0?c/l:null,avgHsPct:d>0?u/d:null,maps:e.length,wins:f,losses:e.length-f,winRate:e.length>0?f/e.length:null}}function Ht(){let{gameSlug:e,playerSlug:t}=te(),[n,r]=(0,K.useState)(`last20`),i=Rt.find(e=>e.id===n).count,{data:a,isLoading:o,isFetching:s,isError:c,error:l,refetch:u}=he(e,t,i),{isWatching:d,addToWatchlist:f,removeFromWatchlist:p,getPageWidgetConfig:m,updatePageWidgetConfig:h}=ce(),{data:g}=me(e,t),[_,v]=(0,K.useState)(!1);A(a?.ign);let y=(0,K.useMemo)(()=>{if(!a)return[];let e=Rt.find(e=>e.id===n).count;return a.recentStats.slice(0,e)},[a,n]),b=(0,K.useMemo)(()=>Vt(y),[y]),x=(0,K.useMemo)(()=>({gameSlug:e??``,playerSlug:t}),[e,t]),S=(0,K.useMemo)(()=>{let r=[];y.length>1&&r.push({key:`performanceTrend`,title:`Performance Trend — ${Rt.find(e=>e.id===n).label} (${y.length} ${W(y.length,`map`,`maps`)})`,size:`lg`,component:(0,q.jsx)(lt,{recentStats:y})}),y.length>0&&r.push({key:`agentPool`,title:`Agent Pool`,size:`sm`,component:(0,q.jsx)(Ct,{recentStats:y})},{key:`impact`,title:`Impact & Opening Duels`,size:`md`,component:(0,q.jsx)(yt,{recentStats:y})},{key:`mapPerformance`,title:`Map Performance`,size:`sm`,component:(0,q.jsx)(gt,{recentStats:y})},{key:`headToHead`,title:`Head to Head`,size:`sm`,component:(0,q.jsx)(wt,{recentStats:y})}),r.push({key:`reputation`,title:`Community Reputation`,size:`sm`,component:(0,q.jsx)(It,{gameSlug:e,playerSlug:t})});let i=N(`playerAgentPool`);i&&r.push({key:i.id,title:i.title,size:i.size??`sm`,component:(0,q.jsx)(Me,{def:i,ctx:x})});let o=N(`playerRatingTrend`);return o&&r.push({key:o.id,title:o.title,size:o.size??`sm`,component:(0,q.jsx)(Me,{def:o,ctx:x})}),!a?.isStaff&&g&&g.length>1&&r.push({key:`ratingHistory`,title:`Rating History`,size:`lg`,component:(0,q.jsx)(G,{history:g,currentRank:a?.rating?.rank,rankTotal:a?.rating?.rankTotal})}),y.length>0&&r.push({key:`matchLog`,title:`Match Log (${y.length})`,size:`lg`,component:(0,q.jsx)(pt,{recentStats:y,gameSlug:e})}),r},[y,g,a?.rating?.rank,a?.rating?.rankTotal,a?.isStaff,n,e,t,x]),C=`playerProfile`,w=m(C,{order:(0,K.useMemo)(()=>S.map(e=>e.key),[S]),sizes:{}}),T=(0,K.useMemo)(()=>{let e=new Map(S.map(e=>[e.key,e])),t=new Set(w.hidden),n=w.order.map(t=>e.get(t)).filter(e=>!!e&&!t.has(e.key)),r=new Set(n.map(e=>e.key)),i=S.filter(e=>!r.has(e.key)&&!t.has(e.key));return[...n,...i]},[S,w.order,w.hidden]),ee=e=>{h(C,{order:e})},E=e=>{h(C,{hidden:[...w.hidden,e]})};if(c&&l instanceof ne)return(0,q.jsx)(We,{entityType:`player`,gameSlug:e});if(o||c||!a)return(0,q.jsx)(pe,{title:`Player`,breadcrumbs:[{label:`Players`,href:`/${e}/players`}],className:`flex h-full flex-col overflow-hidden`,loadingKind:`detail`,emptyMessage:`Player not found.`,status:{isLoading:o,isError:c,error:c?Error(`Failed to load player`):null,isEmpty:!o&&!c&&!a,retry:()=>void u()},children:(0,q.jsx)(`div`,{})});let O=F(a.country),re=a.role?a.role.charAt(0).toUpperCase()+a.role.slice(1).toLowerCase():null,ie=a.role?Ve(a.role):null,se=Te(e),le=a.team?`${a.ign} — ${a.team.name}`:`${a.ign} — ${se} Player`,de=[`${a.ign}${a.realName?` (${a.realName})`:``} — ${se} ${re??`player`}${a.team?` for ${a.team.name}`:``}.`,a.careerAvgAcs==null?null:`Career ACS ${Math.round(a.careerAvgAcs)}.`,`Stats, agent pool, and match log on Glicko.`].filter(Boolean).join(` `),k=j({name:a.ign,url:typeof window<`u`?window.location.href:`https://glicko.app/${e}/players/${a.slug}`,alternateName:a.realName??void 0,nationality:a.country??void 0,affiliation:a.team?{name:a.team.name,url:`https://glicko.app/${e}/teams/${a.team.slug}`}:void 0});return(0,q.jsxs)(pe,{title:`${O?O+` `:``}${a.ign}`,breadcrumbs:[{label:`Players`,href:`/${e}/players`}],seo:{title:le,description:de,image:B(e??`valorant`,`player`,a.slug),type:`profile`},actions:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(De,{entry:{type:`player`,slug:a.slug,name:a.ign},isWatching:d(a.slug),onAdd:f,onRemove:p}),(0,q.jsx)(V,{editing:_,onToggle:()=>v(e=>!e)})]}),tabs:_?(0,q.jsx)(Ee,{}):void 0,className:`flex h-full flex-col overflow-hidden`,children:[(0,q.jsx)(ue,{data:k}),(0,q.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,q.jsxs)(`div`,{className:`mx-auto max-w-5xl`,children:[(0,q.jsxs)(`div`,{className:`glk-card mb-6`,children:[(0,q.jsxs)(`div`,{className:`mb-4 flex gap-3 sm:gap-4`,children:[a.avatarUrl?(0,q.jsx)(`img`,{src:a.avatarUrl.startsWith(`//`)?`https:${a.avatarUrl}`:a.avatarUrl,alt:a.ign,className:`h-16 w-16 rounded-full object-cover ring-2 ring-zinc-200 dark:ring-zinc-700 flex-shrink-0`}):(0,q.jsx)(`div`,{role:`img`,"aria-label":a.ign,className:`flex h-16 w-16 items-center justify-center rounded-full bg-zinc-200 text-xl font-bold text-zinc-500 ring-2 ring-zinc-200 dark:bg-zinc-800 dark:text-zinc-400 dark:ring-zinc-700 flex-shrink-0`,children:a.ign.charAt(0).toUpperCase()}),(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 sm:gap-2`,children:[(0,q.jsxs)(`h2`,{className:`text-xl sm:text-2xl font-black text-zinc-900 dark:text-zinc-100`,children:[O&&(0,q.jsx)(`span`,{className:`mr-1.5`,children:O}),a.ign]}),a.gcdVerified&&(0,q.jsx)(He,{}),re&&ie&&(0,q.jsx)(Z,{variant:`secondary`,className:`${ie} text-xs px-1.5 py-0 font-semibold`,children:re}),(0,q.jsx)(Lt,{status:a.status}),!a.isStaff&&a.rating&&(0,q.jsx)(_e,{rating:Math.round(a.rating.rating),rd:Math.round(a.rating.rd)})]}),(0,q.jsxs)(`p`,{className:`mt-0.5 text-sm text-zinc-400`,children:[[a.realName,a.country].filter(Boolean).join(` · `),a.team&&(0,q.jsxs)(`span`,{children:[` · `,(0,q.jsx)(D,{to:`/${e}/teams/${a.team.slug}`,className:`text-[var(--glk-brand)] hover:underline`,children:a.team.name})]})]}),a.gcdVerified&&(0,q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`span`,{className:M(oe(`vct`),`rounded px-1.5 py-0 text-2xs font-bold uppercase tracking-widest`),children:ae(`vct`)}),a.residentStatus&&(0,q.jsx)(`span`,{className:`text-xs text-zinc-400`,children:a.residentStatus}),a.contractEndDate&&(0,q.jsxs)(`span`,{className:`text-xs text-zinc-500`,children:[`Contract through `,new Date(a.contractEndDate).getFullYear()]})]})]})]}),(0,q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-2`,children:[(0,q.jsx)(`div`,{className:`flex gap-0.5 rounded-md bg-zinc-100 p-0.5 dark:bg-zinc-800`,children:Rt.map(e=>(0,q.jsxs)(`button`,{onClick:()=>r(e.id),"aria-pressed":n===e.id,className:M(`rounded px-2 py-1 text-xs sm:px-2.5 sm:text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--glk-brand)] focus-visible:ring-offset-1`,n===e.id?`bg-white text-zinc-900 shadow-sm dark:bg-zinc-700 dark:text-zinc-100`:`text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300`),children:[e.label,e.id===n&&s&&!o&&(0,q.jsx)(`span`,{className:`ml-1 inline-block h-2 w-2 animate-pulse rounded-full bg-zinc-400`})]},e.id))}),b&&(0,q.jsxs)(`div`,{className:`flex items-center gap-1 sm:gap-1.5 text-2xs sm:text-xs text-zinc-500`,children:[(0,q.jsx)(`span`,{className:`font-semibold text-zinc-600 dark:text-zinc-300`,children:b.maps}),` `,W(b.maps,`map`,`maps`),typeof a.recentStatsTotal==`number`&&a.recentStatsTotal>b.maps&&(0,q.jsxs)(`span`,{className:`text-zinc-400`,children:[`of `,a.recentStatsTotal,` career`]}),(0,q.jsx)(`span`,{className:`text-zinc-400`,children:`·`}),(0,q.jsxs)(`span`,{className:M(`font-semibold`,b.winRate&&b.winRate>=.5?`text-emerald-600 dark:text-emerald-400`:`text-zinc-600 dark:text-zinc-300`),children:[b.wins,`W–`,b.losses,`L`]}),b.winRate!=null&&(0,q.jsxs)(`span`,{className:`text-zinc-400`,children:[`(`,Math.round(b.winRate*100),`%)`]})]})]}),(0,q.jsxs)(`div`,{className:M(`grid grid-cols-3 gap-2 sm:grid-cols-5 sm:gap-4 md:flex md:flex-wrap md:gap-6 transition-opacity`,s&&!o&&`opacity-50`),children:[!a.isStaff&&a.rating&&a.rating.rank!=null&&(0,q.jsx)(Bt,{rank:a.rating.rank,total:a.rating.rankTotal,percentile:a.rating.percentile}),(0,q.jsx)(Q,{label:`ACS`,value:$(b?b.avgAcs:a.careerAvgAcs)}),(0,q.jsx)(Q,{label:`K/D`,value:$(b?b.avgKd:a.careerAvgKd,2)}),(0,q.jsx)(Q,{label:`ADR`,value:$(b?b.avgAdr:a.careerAvgAdr)}),(0,q.jsx)(Q,{label:`KAST`,value:b?.avgKast==null?(()=>{let e=zt(a.careerAvgKast);return e==null?`—`:`${$(e*100)}%`})():`${$(b.avgKast*100)}%`}),(0,q.jsx)(Q,{label:`HS%`,value:b?.avgHsPct==null?(()=>{let e=zt(a.careerAvgHsPct);return e==null?`—`:`${$(e*100)}%`})():`${$(b.avgHsPct*100)}%`})]})]}),(0,q.jsx)(H,{widgets:T,columns:3,editing:_,onReorder:ee,onHide:E})]})})]})}function Ut(){A(`Players`);let e=Oe(`(max-width: 767px)`),{variant:t,isPinned:n,togglePin:r}=Le(),{playerSlug:i}=te();return e?i?(0,q.jsx)(Ht,{}):(0,q.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:(0,q.jsx)($e,{selectedSlug:void 0})}):i?(0,q.jsxs)(`div`,{className:`flex h-full overflow-hidden`,children:[(0,q.jsx)($e,{selectedSlug:i,compact:t===`compact`,isPinned:n,onToggleVariant:r}),(0,q.jsx)(`div`,{className:`flex-1 min-w-0 overflow-hidden`,children:(0,q.jsx)(Ht,{})})]}):(0,q.jsx)(`div`,{className:`flex h-full justify-center overflow-hidden`,children:(0,q.jsx)($e,{selectedSlug:void 0,expanded:!0})})}export{Ut as default};