PageSourceSearch

https://www.rivalsleague.gg/assets/Team-QHw0yjzV.js

js rivalsleague.gg collected 2026-10-07 02:52:08 UTC 31,323 bytes, 1 lines download raw bytes

1import{q as mt,aB as ut,D as ht,M as xt,i as se,u as pt,h as gt,C as T,a5 as ft,aC as De,ai as Be,aD as bt,j as e,H as de,k as me,F as ue,L as ae,af as Nt,ax as xe,aE as he,a1 as pe,az as ge,aj as wt,aG as We,ae as ze,aw as jt,aH as yt}from"./index-C3eAXf3G.js";import{s as vt}from"./silo1-8KpclccR.js";import{n as X,u as St,g as te}from"./teamService-DMUFBxq_.js";import{f as Tt,a as Ue,g as At,b as Et}from"./matchService-Co3OCzsz.js";import{I as P}from"./input-CxfRGB8F.js";import{D as kt,a as _t,b as Lt,c as It,d as Mt,e as Ct}from"./dialog-Cw0mf2qM.js";import{S as Ot,a as Pt,b as Rt,c as Ft,d as Gt}from"./select-DftOImj0.js";import{T as Ke,a as qe,Y as Je}from"./youtube-CU3N8lms.js";import{M as Ye}from"./message-circle-HIBq8NwW.js";import{S as $t}from"./square-pen-Cr59rKKB.js";import"./index-Bi97J6py.js";import"./chevron-up-B_ecqvLs.js";const Z="season",Dt={en:{loading:"Loading team profile...",notFound:{title:"Team Not Found",message:"The team you're looking for doesn't exist.",back:"Back to Teams"},coach:"COACH:",teamStats:"TEAM STATS",matchWinrate:"WINRATE",sideWinrate:"WINRATE PER SIDE",mapWinBreakdown:"MAP WIN BREAKDOWN",lastMatches:"LAST 10 MATCHES",otherTeams:"OTHER TEAMS TO FOLLOW",season:"Season",playedAs:(s,n)=>`Played as ${s} in ${n}`,roles:{player:"Player",substitute:"Substitute",captain:"Captain",head_coach:"Head coach",strategic_coach:"Strategic coach",assistant_coach:"Assistant coach",performance_coach:"Performance coach",team_manager:"Team manager",staff:"Staff"},editProfile:{button:"Edit Team Profile",title:"Edit Team Profile",description:"Update your team's public profile information.",name:"Team Name",bio:"Bio",logo:"Logo URL",country:"Country",socialLinks:"Social Links",twitch:"Twitch",twitter:"Twitter / X",youtube:"YouTube",discord:"Discord",cancel:"Cancel",save:"Save Changes",saving:"Saving...",success:"Team profile updated successfully!",error:"Failed to update team profile. Please try again."}},sv:{loading:"Laddar lagprofil...",notFound:{title:"Lag hittades inte",message:"Laget du letar efter finns inte.",back:"Tillbaka till lag"},coach:"COACH:",teamStats:"LAGSTATISTIK",matchWinrate:"VINSTFREKVENS",sideWinrate:"VINSTFREKVENS PER SIDA",mapWinBreakdown:"KARTVINSTER",lastMatches:"SENASTE 10 MATCHERNA",otherTeams:"ANDRA LAG ATT FÖLJA",season:"Säsong",playedAs:(s,n)=>`Spelade som ${s} under ${n}`,roles:{player:"Spelare",substitute:"Reserv",captain:"Kapten",head_coach:"Huvudtränare",strategic_coach:"Strategisk tränare",assistant_coach:"Assisterande tränare",performance_coach:"Prestationstränare",team_manager:"Lagledare",staff:"Stab"},editProfile:{button:"Redigera lagprofil",title:"Redigera lagprofil",description:"Uppdatera ditt lags offentliga profilinformation.",name:"Lagnamn",bio:"Bio",logo:"Logotyp URL",country:"Land",socialLinks:"Sociala länkar",twitch:"Twitch",twitter:"Twitter / X",youtube:"YouTube",discord:"Discord",cancel:"Avbryt",save:"Spara ändringar",saving:"Sparar...",success:"Lagprofilen har uppdaterats!",error:"Kunde inte uppdatera lagprofilen. Försök igen."}}};function He(s,n){const r=s.toLowerCase();if(r==="defenders"||r==="defense"||r==="defending")return n==="cs2"?"CT":"Defense";if(r==="attackers"||r==="attack"||r==="attacking")return n==="cs2"?"T":"Attack";if(n==="lol"){if(r==="blue")return"Blue";if(r==="red")return"Red"}else if(n==="cs2"){if(r==="t"||r==="terrorist")return"T";if(r==="ct"||r==="counter-terrorist")return"CT"}return s.charAt(0).toUpperCase()+s.slice(1)}const Ve={id:"nip",gameslug:"lol",name:"NINJAS IN PYJAMAS",tricode:"NIP",country:"SE",region:"EUROPE",bio:"Ninjas in Pyjamas (often abbreviated to NIP and NiP) is a Swedish esports organization founded in 2000. The team competed in Counter Strike until their dissolution in 2007. In 2012, the team returned with a new heavily renowned CS:GO squad, which went on a record-breaking 87-0 map win streak.",logo:void 0,twitch:"https://twitch.tv/nipgaming",twitter:"https://twitter.com/nipgaming",youtube:"https://youtube.com/@nipgaming",discord:"nipgaming",rank:22,rank_points:939,players:[{id:"player1",username:"GRATISFACTION",fullname:"Jacob Ingvarsson",nationality:"SE",position:"Top",twitch:"#",twitter:"#",youtube:"#",discord:"#"},{id:"player2",username:"GRATISFACTION",fullname:"Jacob Ingvarsson",nationality:"SE",position:"Jungle",twitch:"#",twitter:"#",youtube:"#",discord:"#"},{id:"player3",username:"GRATISFACTION",fullname:"Jacob Ingvarsson",nationality:"SE",position:"Mid",twitch:"#",twitter:"#",youtube:"#",discord:"#"},{id:"player4",username:"GRATISFACTION",fullname:"Jacob Ingvarsson",nationality:"SE",position:"ADC",twitch:"#",twitter:"#",youtube:"#",discord:"#"},{id:"player5",username:"GRATISFACTION",fullname:"Jacob Ingvarsson",nationality:"SE",position:"Support",twitch:"#",twitter:"#",youtube:"#",discord:"#"}
1],coach:{id:"coach1",username:"GRATISFACTION",fullname:"Filip 'Gratisfaction' Ingvarsson",nationality:"SE"},stats:{wins:6,losses:4,map_stats:[{name:"VERTIGO",percentage:88},{name:"MIRAGE",percentage:88},{name:"INFERNO",percentage:88},{name:"ANCIENT",percentage:88},{name:"NUKE",percentage:88},{name:"OVERPASS",percentage:88},{name:"ANUBIS",percentage:88}]},recent_matches:[{id:"1",opponent_name:"TEAM LONG NAME",result:"WIN",score:"16-9",date:"2024-01-01"},{id:"2",opponent_name:"TEAM LONG NAME",result:"WIN",score:"16-12",date:"2024-01-02"},{id:"3",opponent_name:"TEAM LONG NAME",result:"WIN",score:"16-8",date:"2024-01-03"},{id:"4",opponent_name:"TEAM LONG NAME",result:"LOSS",score:"9-16",date:"2024-01-04"},{id:"5",opponent_name:"TEAM LONG NAME",result:"WIN",score:"16-14",date:"2024-01-05"},{id:"6",opponent_name:"TEAM LONG NAME",result:"WIN",score:"16-7",date:"2024-01-06"},{id:"7",opponent_name:"TEAM LONG NAME",result:"LOSS",score:"12-16",date:"2024-01-07"},{id:"8",opponent_name:"TEAM LONG NAME",result:"LOSS",score:"10-16",date:"2024-01-08"},{id:"9",opponent_name:"TEAM LONG NAME",result:"WIN",score:"16-11",date:"2024-01-09"},{id:"10",opponent_name:"TEAM LONG NAME",result:"LOSS",score:"8-16",date:"2024-01-10"}],related_teams:[{id:"team1",name:"TEAM LONG NAME",tricode:"TLN"},{id:"team2",name:"TEAM LONG NAME",tricode:"TLN"},{id:"team3",name:"TEAM LONG NAME",tricode:"TLN"},{id:"team4",name:"TEAM LONG NAME",tricode:"TLN"},{id:"team5",name:"TEAM LONG NAME",tricode:"TLN"}],created_at:"2024-01-01T00:00:00Z"},M=({href:s,handle:n,icon:r,label:c})=>{const b="w-12 h-12 bg-black border border-white/10 flex items-center justify-center hover:bg-white/10 transition-all duration-200";return!s&&n&&/^https?:\/\//i.test(n)&&(s=n),s?e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer","aria-label":c,className:b,children:e.jsx(r,{className:"w-5 h-5 text-white"})}):n?e.jsx("div",{"aria-label":c,title:`${c}: ${n}`,className:b,children:e.jsx(r,{className:"w-5 h-5 text-white"})}):null};function Qe(s){return"id"in s?s.id:s.matchid||s.gameid}function Bt(s,n){const r=s.split("-").map(N=>Number(N));if(r.length!==2||r.some(N=>Number.isNaN(N)))return s;const[c,b]=r[0]>=r[1]?r:[r[1],r[0]];return n==="win"?`${c}-${b}`:`${b}-${c}`}const Wt=({match:s,opponentLogo:n,opponentName:r,score:c,gameSlug:b,maps:N,mapImageUrls:v})=>{const A=se(),R="result"in s&&(s.result==="WIN"||s.result==="win"),B=Qe(s),C="enemy_team"in s?s.enemy_team:null,O="opponent_name"in s?s.opponent_name:C?typeof C=="string"?C.slice(0,8)+"...":C.name||"Unknown":"Unknown",W=r||O,U=c||s.score,H=(N||[]).map(F=>{const z=Et(F);return(v==null?void 0:v[z])||(v==null?void 0:v[F])||null}).filter(Boolean),_="relative flex flex-col items-center justify-center p-3 sm:p-4 min-h-[8.5rem] overflow-hidden group bg-surface-tint",V=e.jsxs(e.Fragment,{children:[H.length>0&&e.jsx("div",{className:"absolute inset-0 flex",children:H.map((F,z)=>e.jsx("div",{className:"h-full flex-1 bg-cover bg-center",style:{backgroundImage:`url(${F})`}},z))}),e.jsx("div",{className:"absolute inset-0 bg-surface-tint opacity-80 transition-opacity group-hover:opacity-70"}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center justify-center",children:[e.jsx(pe,{src:n||ge,name:W,className:"w-16 h-16 mb-3"}),e.jsx("span",{className:"text-[11px] text-white/80 uppercase tracking-wider text-center leading-tight font-medium line-clamp-2",children:W}),e.jsxs("span",{className:`text-[10px] font-medium mt-1 ${R?"text-win":"text-loss"}`,children:["[",R?"WON":"LOST"," ",U,"]"]})]})]});return b?e.jsx(ae,{to:A(`/${b}/match/${B}`),className:_,children:V}):e.jsx("div",{className:_,children:V})},zt=({player:s,gameSlug:n,roleLabel:r})=>{const c=se(),b="relative bg-black p-5 flex flex-col group hover:bg-black/80 transition-all duration-300",N=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute top-0 left-0 w-4 h-4 border-t-2 border-l-2 border-white/70"}),e.jsx("div",{className:"absolute top-0 right-0 w-4 h-4 border-t-2 border-r-2 border-white/70"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-4 h-4 border-b-2 border-l-2 border-white/70"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-4 h-4 border-b-2 border-r-2 border-white/70"}),e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx(xe,{value:s.nationality}),e.jsx("span",{className:"text-sm font-bold text-white uppercase tracking-wider",children:s.username})]}),e.jsx("div",{className:"text-xs text-white/50 mb-4 italic",children:s.fullname||s.position}),r&&e.jsx("span",{className:"absolute top-3 right-3 border border-accent px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-accent",children:r}),e.jsxs("div",{className:"relative mb-4 aspect-[4/5] bg-surface-tint",style:{backgroundImage:`url(${s.picture||vt})`,backgroundSize:"contain",backgroundPosition:"bottom center",backgroundRepeat:"no-repeat"},children:[e.jsx("div",{className:"absolute top-0 left-0 w-3 h-3 border-t-2 border-l-2 border-white/70 z-10"}),e.jsx("div",{className:"absolute top-0 right-0 w-3 h-3 border-t-2 border-r-2 border-white/70 z-10"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-3 h-3 border-b-2 border-l-2 border-white z-10"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-3 h-3 border-b-2 border-r-2 border-white z-10"})]}),e.jsxs("div",{className:"flex gap-2 mt-auto",children:[e.jsx(M,{href:s.twitch,icon:Ke,label:"Twitch"}),e.jsx(M,{href:s.twitter,icon:qe,label:"Twitter"}),e.jsx(M,{href:s.youtube,icon:Je,label:"YouTube"}),e.jsx(M,{handle:s.discord,icon:Ye,label:"Discord"})]})]});return s.profile_id?e.jsx(ae,{to:c(`/${n||"cs2"}/player/${s.profile_id}`),className:b,children:N}):e.jsx("div",{className:b,children:N})},Ut=({team:s,gameSlug:n})=>{const r=se();return e.jsxs(ae,{to:r(`/${n}/team/${s.id}`),className:"relative bg-black p-5 flex flex-col items-center group hover:bg-black/80 transition-all duration-300",children:[e.jsx("div",{className:"absolute top-0 left-0 w-4 h-4 border-t-2 border-l-2 border-white/70"}),e.jsx("div",{className:"absolute top-0 right-0 w-4 h-4 border-t-2 border-r-2 border-white/70"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-4 h-4 border-b-2 border-l-2 border-white/70"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-4 h-4 border-b-2 border-r-2 border-white/70"}),e.jsx(pe,{src:s.logo||ge,name:s.name,className:"w-20 h-20 mb-4"}),e.jsx("span",{className:"text-xs text-white/80 uppercase tracking-wider text-center font-medium",children:s.name})]})},ee=({children:s,className:n=""})=>e.jsxs("div",{className:`relative bg-black p-6 ${n}`,children:[e.jsx("div",{className:"absolute top-0 left-0 w-4 h-4 border-t-2 border-l-2 border-white/70"}),e.jsx("div",{className:"absolute top-0 right-0 w-4 h-4 border-t-2 border-r-2 border-white/70"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-4 h-4 border-b-2 border-l-2 border-white/70"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-4 h-4 border-b-2 border-r-2 border-white/70"}),s]}),Ht=({stat:s})=>{const n="name"in s?s.name:s.map.replace("de_","").toUpperCase(),r="percentage"in s?s.percentage:parseFloat(s.winrate)*100;return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-white/60 uppercase tracking-wider w-20 shrink-0",children:n}),e.jsx("div",{className:"flex-1 h-4 relative bg-surface-tint",children:e.jsx("div",{className:"h-full bg-accent",style:{width:`${r}%`}})}),e.jsxs("span",{className:"text-xs text-white font-medium w-12 text-right",children:[r.toFixed(1),"%"]})]})};async function Vt(s,n,r){const c=r??jt,b=await te(s,n,c);if(b)return b;const N=await te(s,n);if(!N)return null;if(N.seasons&&N.seasons.length>0){const v=yt(N.seasons);if(v!==c){const A=await te(s,n,v);if(A)return A}}return N}const ns=()=>{var Ee,ke,_e,Le,Ie,Me,Ce,Oe,Pe,Re,Fe,Ge,$e;const s=mt(Dt),{user:n}=ut(),{teamId:r,gameSlug:c}=ht(),b=xt(),N=se(),{language:v}=pt(),[A,R]=gt(),B=X(c||"lol"),C=bt(),O=A.get(Z),W=De(O)?O:null,U=["team",B,r,W??"latest"],[H,_]=T.useState({}),[V,F]=T.useState({}),[z,Xe]=T.useState({}),[Ze,fe]=T.useState(!1),[et,K]=T.useState(!1),[be,Ne]=T.useState(!1),[l,we]=T.useState({name:"",bio:"",logo:"",country:"",twitch:"",twitter:"",youtube:"",discord:""}),{data:tt,status:je}=ft({queryKey:U,enabled:!!r,staleTime:5*6e4,queryFn:async()=>
1{if(!r)return null;try{const a=C?await Vt(B,r,W):await te(B,r);return a?{...a,id:a.id||r}:ze()?{...Ve,id:r}:null}catch(a){if(console.error("Error fetching team:",a),ze())return{...Ve,id:r};throw a}}}),t=tt??null,L=(t==null?void 0:t.season)??null,ye=[...new Set([...(t==null?void 0:t.seasons)??[],...L?[L]:[]])].filter(De).sort((a,u)=>Number(a.slice(1))-Number(u.slice(1))),G=L?Be(L,v):null;T.useEffect(()=>{if(!t||!O||t.season===O)return;const a=new URLSearchParams(A);t.season?a.set(Z,t.season):a.delete(Z),R(a,{replace:!0,preventScrollReset:!0})},[C,t,O,A,R]);const st=a=>{const u=new URLSearchParams(A);u.set(Z,a),R(u,{replace:!0,preventScrollReset:!0})};T.useEffect(()=>{if(!(t!=null&&t.staff)||!(n!=null&&n.id)){fe(!1);return}fe(t.staff.includes(n.id))},[t==null?void 0:t.staff,n==null?void 0:n.id]);const at=()=>{var a;t&&(we({name:((a=t.current)==null?void 0:a.name)||t.name||"",bio:t.bio||"",logo:(t.current?t.current.logo:t.logo)||"",country:t.country||"",twitch:t.twitch||"",twitter:t.twitter||"",youtube:t.youtube||"",discord:t.discord||""}),K(!0))},I=(a,u)=>{we(o=>({...o,[a]:u}))},rt=async()=>{if(t){Ne(!0);try{const a={id:t.id,gameslug:X(c||t.gameslug||"lol"),name:l.name||void 0,bio:l.bio||void 0,logo:l.logo||void 0,country:l.country||void 0,twitch:l.twitch||void 0,twitter:l.twitter||void 0,youtube:l.youtube||void 0,discord:l.discord||void 0},u=await St(a);if(!u.success)throw new Error(u.error||"Update failed");b.setQueryData(U,o=>o&&{...o,...o.current?{current:{...o.current,name:l.name||o.current.name}}:{name:l.name||o.name},bio:l.bio||o.bio,logo:l.logo||o.logo,country:l.country||o.country,twitch:l.twitch||o.twitch,twitter:l.twitter||o.twitter,youtube:l.youtube||o.youtube,discord:l.discord||o.discord}),We.success(s.editProfile.success),K(!1)}catch(a){console.error("Error updating team profile:",a),We.error(s.editProfile.error)}finally{Ne(!1)}}};function nt(a){return typeof a=="string"?{id:a}:{id:a.id,cmId:a.cm_id,name:a.name}}T.useEffect(()=>{if(!(t!=null&&t.match_history)||t.match_history.length===0)return;let a=!1;const u=X(c||"lol"),o=t.match_history.slice(0,10),g={},oe={},ie=new Set,J=new Map,Y=[],le=new Map;for(const i of o){const d=i.matchid||i.gameid;if(d)if(i.maps&&i.maps.length>0&&(g[d]=i.maps,i.maps.forEach(j=>ie.add(j))),i.opponent)oe[d]={name:i.opponent.name||i.opponent.tag||"Unknown",logo:i.opponent.logo||null,score:i.score?Bt(i.score,i.result):void 0},!i.opponent.logo&&i.opponent.id&&le.set(d,i.opponent.id);else if(i.enemy_team){const j=nt(i.enemy_team);if(oe[d]={name:j.name||j.id.slice(0,8)+"..."},j.cmId){const S=J.get(j.cmId)||[];S.push(d),J.set(j.cmId,S)}}else Y.push({matchId:d,score:i.score})}F(g),_(oe);const ot=async()=>{if(ie.size!==0)try{const i=await fetch(`/api/storage/map-images-all?ids=${[...ie].join(",")}`);if(i.ok){const d=await i.json();d.urls&&!a&&Xe(d.urls)}}catch{}},it=async()=>{const i=[...J.keys()];if(i.length===0)return;const d=await Tt(i);a||_(j=>{const S={...j};for(const[w,f]of Object.entries(d))if(f)for(const E of J.get(w)||[])S[E]={...S[E],logo:f};return S})},lt=async()=>{if(Y.length===0)return;const i=new Map,d=new Map,j=await At(u,Y.map(({matchId:m})=>m)),S=Y.map(({matchId:m,score:x})=>{const p=j.get(m);return p?{matchId:m,score:x,summary:p}:null}),w={};for(const m of S){if(!m)continue;const{matchId:x,score:p,summary:y}=m,h=y.match;let k,Q=p;if(h&&(h.team_a===t.id||h.team_b===t.id)){const D=h.team_a===t.id;k=D?h.team_b:h.team_a,h.team_a_score!=null&&h.team_b_score!=null?Q=D?`${h.team_a_score}-${h.team_b_score}`:`${h.team_b_score}-${h.team_a_score}`:!D&&p&&(Q=p.split("-").reverse().join("-"))}else{const D=!!y.teams.b.id&&y.teams.b.id===t.id;k=D?y.teams.a.id:y.teams.b.id,D&&p&&(Q=p.split("-").reverse().join("-"))}const dt=k?y.teams.a.id===k?y.teams.a.name:y.teams.b.id===k?y.teams.b.name:"Unknown":"Unknown";w[x]={name:dt,score:Q},k&&(i.set(x,k),h!=null&&h.cm_match_id&&!d.has(k)&&d.set(k,h.cm_match_id))}if(a)return;_(m=>{const x={...m};for(const[p,y]of Object.entries(w))x[p]={...x[p],...y};return x});const f=[...new Set(i.values())];if(f.length===0)return;const E=[];for(let m=0;m<f.length;m+=2)E.push({id1:f[m],id2:f[m+1]||null});const ce=await Promise.all(E.map(({id1:m,id2:x})=>Ue(m,x,{gameslug:u,cmMatchId1:d.get(m),cmMatchId2:x?d.get(x):null}))),$={};ce.forEach((m,x)=>{const p=E[x];$[p.id1]=m.team1Logo,p.id2&&($[p.id2]=m.team2Logo)}
1),!a&&_(m=>{const x={...m};for(const[p,y]of i){const h=$[y];h&&(x[p]={...x[p],logo:h})}return x})},ct=async()=>{const i=[...new Set(le.values())];if(i.length===0)return;const d=[];for(let w=0;w<i.length;w+=2)d.push({id1:i[w],id2:i[w+1]||null});const j=await Promise.all(d.map(({id1:w,id2:f})=>Ue(w,f,{gameslug:u}))),S={};j.forEach((w,f)=>{S[d[f].id1]=w.team1Logo,d[f].id2&&(S[d[f].id2]=w.team2Logo)}),!a&&_(w=>{const f={...w};for(const[E,ce]of le){const $=S[ce];$&&(f[E]={...f[E],logo:$})}return f})};return ot(),it(),ct(),lt(),()=>{a=!0}},[t==null?void 0:t.match_history,t==null?void 0:t.id,c]);const re=((Ee=t==null?void 0:t.record)==null?void 0:Ee.wins)??((ke=t==null?void 0:t.stats)==null?void 0:ke.wins)??((_e=t==null?void 0:t.match_history)==null?void 0:_e.filter(a=>a.result==="win").length)??((Le=t==null?void 0:t.recent_matches)==null?void 0:Le.filter(a=>a.result==="WIN").length)??0,ve=((Ie=t==null?void 0:t.record)==null?void 0:Ie.losses)??((Me=t==null?void 0:t.stats)==null?void 0:Me.losses)??((Ce=t==null?void 0:t.match_history)==null?void 0:Ce.filter(a=>a.result==="loss").length)??((Oe=t==null?void 0:t.recent_matches)==null?void 0:Oe.filter(a=>a.result==="LOSS").length)??0,q=re+ve,Se=q>0?Math.round(re/q*100):0;if(r&&je==="pending")return e.jsxs(e.Fragment,{children:[e.jsx(de,{children:e.jsx("title",{children:"Loading... - RIVALS LEAGUE"})}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(me,{}),e.jsx("main",{className:"pt-20 flex items-center justify-center min-h-[60vh]",children:e.jsx("div",{className:"text-foreground/60",children:s.loading})}),e.jsx(ue,{})]})]});if(je==="error"||!t)return e.jsxs(e.Fragment,{children:[e.jsx(de,{children:e.jsx("title",{children:`${s.notFound.title} - RIVALS LEAGUE`})}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(me,{}),e.jsxs("main",{className:"pt-20 flex flex-col items-center justify-center min-h-[60vh]",children:[e.jsx("h1",{className:"text-2xl font-display font-bold mb-4",children:s.notFound.title}),e.jsx("p",{className:"text-foreground/60 mb-6",children:s.notFound.message}),e.jsx(ae,{to:c?N(`/${c}/teams`):"/test/teams",className:"hover:underline text-accent",children:s.notFound.back})]}),e.jsx(ue,{})]})]});const ne=((Pe=t.current)==null?void 0:Pe.name)||t.name,Te=L&&((Re=t.capsule)!=null&&Re.name)&&t.capsule.name!==ne?t.capsule.name:null,Ae=!!L&&!!((Fe=t.players)!=null&&Fe.some(a=>a.role));return e.jsxs(e.Fragment,{children:[e.jsx(de,{children:e.jsx("title",{children:`${ne} - RIVALS LEAGUE`})}),e.jsx("svg",{className:"hidden",children:e.jsx("defs",{children:e.jsxs("filter",{id:"noise-filter",children:[e.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",stitchTiles:"stitch",result:"noise"}),e.jsx("feColorMatrix",{type:"saturate",values:"0"})]})})}),e.jsxs("div",{className:"min-h-screen bg-black relative overflow-x-hidden",children:[e.jsx("div",{className:"pointer-events-none fixed inset-0 z-10 opacity-[0.2] overflow-hidden",style:{filter:"url(#noise-filter)"}}),e.jsx("div",{className:"relative z-50",children:e.jsx(me,{})}),e.jsxs("main",{className:"pt-16 3xl:pt-20 4xl:pt-24 relative z-20 3xl:[zoom:1.25] 4xl:[zoom:1.5]",children:[e.jsx(Nt,{}),e.jsx("section",{className:"py-12 lg:py-20",children:e.jsx("div",{className:"container mx-auto px-4 lg:px-16 xl:px-24 3xl:px-40 4xl:px-52",children:e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 lg:gap-16 items-start",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-5xl md:text-6xl lg:text-7xl font-display font-black mb-4 tracking-tight text-white",children:ne}),Te&&G&&e.jsx("p",{className:"text-white/60 uppercase tracking-wider text-sm mb-4",children:s.playedAs(Te,G)}),ye.length>0&&L&&e.jsx("div",{className:"mb-6",children:e.jsxs(Ot,{value:L,onValueChange:st,children:[e.jsx(Pt,{"aria-label":s.season,className:"h-10 3xl:h-12 4xl:h-14 w-full border-border bg-card text-white focus:border-accent focus:ring-accent/20 sm:w-[180px]",children:e.jsx(Rt,{placeholder:s.season})}),e.jsx(Ft,{className:"border-border bg-card",children:ye.map(a=>e.jsx(Gt,{value:a,className:"text-white focus:bg-secondary focus:text-white",children:Be(a,v)},a))})]})}),e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx(xe,{value:t.region==="EUROPE"?"EU":t.country,className:"text-2xl"}),e.jsx("span",{className:"text-white/60 uppercase tracking-wider text-lg",children:t.regi
1on||t.country})]}),e.jsx("div",{className:"w-full max-w-xl h-0.5 bg-muted-foreground mb-6"}),t.bio&&e.jsx("p",{className:"text-white/60 text-sm leading-relaxed mb-8 max-w-xl",children:t.bio}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(M,{href:t.twitch,icon:Ke,label:"Twitch"}),e.jsx(M,{href:t.twitter,icon:qe,label:"Twitter"}),e.jsx(M,{href:t.youtube,icon:Je,label:"YouTube"}),e.jsx(M,{handle:t.discord,icon:Ye,label:"Discord"})]}),Ze&&e.jsxs(he,{onClick:at,variant:"outline",className:"mt-4 border-accent text-accent",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),s.editProfile.button]})]}),e.jsx("div",{className:"relative flex justify-center lg:justify-end",children:e.jsx(pe,{src:t.logo||ge,name:t.name,className:"w-64 h-64 lg:w-80 lg:h-80"})})]})})}),t.players&&t.players.length>0&&e.jsx("section",{className:"py-12",children:e.jsx("div",{className:"container mx-auto px-4 lg:px-16 xl:px-24 3xl:px-40 4xl:px-52",children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:t.players.map(a=>e.jsx(zt,{player:a,gameSlug:c,roleLabel:Ae&&a.role&&a.role!=="player"?s.roles[a.role]:void 0},a.id))})})}),t.coach&&!Ae&&e.jsx("section",{className:"py-8",children:e.jsx("div",{className:"container mx-auto px-4 lg:px-16 xl:px-24 3xl:px-40 4xl:px-52",children:e.jsxs("div",{className:"relative bg-black px-6 py-4",children:[e.jsx("div",{className:"absolute top-0 left-0 w-4 h-4 border-t-2 border-l-2 border-white/70"}),e.jsx("div",{className:"absolute top-0 right-0 w-4 h-4 border-t-2 border-r-2 border-white/70"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-4 h-4 border-b-2 border-l-2 border-white/70"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-4 h-4 border-b-2 border-r-2 border-white/70"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-white uppercase tracking-[0.3em] text-sm font-bold",children:s.coach}),e.jsxs("span",{className:"flex items-center gap-2 text-white",children:[e.jsx(xe,{value:t.coach.nationality}),t.coach.fullname||t.coach.username]})]})]})})}),e.jsx("section",{className:"py-12",children:e.jsxs("div",{className:"container mx-auto px-4 lg:px-16 xl:px-24 3xl:px-40 4xl:px-52",children:[e.jsxs("h2",{className:"text-2xl font-display font-black tracking-wider mb-8 text-white",children:[s.teamStats,G&&e.jsxs("span",{className:"text-white/50",children:[" · ",G]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-8",children:[e.jsxs(ee,{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-white/60 uppercase tracking-wider text-sm",children:[s.matchWinrate,G&&` · ${G}`]}),e.jsx("span",{className:"text-3xl font-display font-black text-accent",children:q>0?`${Se}%`:"-"})]}),q>0&&e.jsx("div",{className:"mt-3 h-2 w-full rounded-full overflow-hidden bg-surface-tint",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500 bg-accent",style:{width:`${Se}%`}})})]}),t.side_winrates&&(Array.isArray(t.side_winrates)?t.side_winrates.length>0:Object.keys(t.side_winrates).length>0)&&e.jsxs(ee,{className:"flex-1",children:[e.jsx("span",{className:"text-white/60 uppercase tracking-wider text-sm block mb-3",children:s.sideWinrate}),e.jsx("div",{className:"space-y-2",children:(()=>{const a=X(c||"lol"),u=[];if(Array.isArray(t.side_winrates))for(const o of t.side_winrates){const g=o.wins+o.losses;u.push({key:o.side,label:He(o.side,a),wr:g>0?Math.round(o.wins/g*100):0})}else for(const[o,g]of Object.entries(t.side_winrates))u.push({key:o,label:He(o,a),wr:Math.round(g*100)});return u.map(o=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-white/60 uppercase tracking-wider w-20 shrink-0",children:o.label}),e.jsx("div",{className:"flex-1 h-3 rounded-full overflow-hidden bg-surface-tint",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500 bg-accent",style:{width:`${o.wr}%`}})}),e.jsxs("span",{className:"text-sm font-bold text-white w-12 text-right",children:[o.wr,"%"]})]},o.key))})()})]})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[(t.map_winrates&&t.map_winrates.length>0||((Ge=t.stats)==null?void 0:Ge.map_stats)&&t.stats.map_stats.length>0)&&e.jsxs(ee,{className:"w-full lg:w-80 lg:shrink-0",children:[e.jsx("h3",{className:"text-sm font-display font-bold tracking-wider mb-6 text-white uppercase",children:s.mapWinBreakdown}),e.jsx("div",{className:"space-y-3",children:(t.map_winrates||(($e=t.stats)==null?void 0:$e.map_stats)||[]).map((a,u)=>e.jsx(Ht,{stat:a},u))})]}),e.jsxs(ee,{className:"flex-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between mb-6",children:[e.jsx("h3",{className:"text-sm font-display font-bold tracking-wider text-white uppercase",children:s.lastMatches}),e.jsxs("div",{className:"text-3xl font-display font-black tracking-tight",children:[e.jsxs("span",{className:"text-win",children:[re,"W"]}),e.jsx("span",{className:"text-white/30 mx-2",children:"/"}),e.jsxs("span",{className:"text-loss",children:[ve,"L"]}
1)]})]}),e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-5 gap-1",children:(t.match_history||t.recent_matches||[]).slice(0,10).map((a,u)=>{const o=Qe(a)||String(u),g=H[o]||null;return e.jsx(Wt,{match:a,opponentLogo:(g==null?void 0:g.logo)||("opponent_logo"in a?a.opponent_logo:void 0),opponentName:g==null?void 0:g.name,score:g==null?void 0:g.score,gameSlug:c,maps:V[o],mapImageUrls:z},o)})})]})]})]})}),t.related_teams&&t.related_teams.length>0&&e.jsx("section",{className:"py-12 pb-20",children:e.jsxs("div",{className:"container mx-auto px-4 lg:px-16 xl:px-24 3xl:px-40 4xl:px-52",children:[e.jsx("h2",{className:"text-2xl font-display font-bold tracking-wider mb-8 text-white",children:s.otherTeams}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:t.related_teams.map(a=>e.jsx(Ut,{team:a,gameSlug:c||"lol"},a.id))})]})})]}),e.jsx("div",{className:"relative z-20",children:e.jsx(ue,{})})]}),e.jsx(kt,{open:et,onOpenChange:K,children:e.jsxs(_t,{className:"bg-background border-foreground
1/20 max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(Lt,{children:[e.jsx(It,{className:"text-foreground font-display uppercase",children:s.editProfile.title}),e.jsx(Mt,{className:"text-foreground/70 font-body",children:s.editProfile.description})]}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-foreground/70",children:s.editProfile.name}),e.jsx(P,{value:l.name,onChange:a=>I("name",a.target.value),className:"bg-background border-foreground/20"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-foreground/70",children:s.editProfile.country}),e.jsx(P,{value:l.country,onChange:a=>I("country",a.target.value),className:"bg-background border-foreground/20"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-foreground/70",children:s.editProfile.bio}),e.jsx("textarea",{value:l.bio,onChange:a=>I("bio",a.target.value),rows:3,className:"w-full bg-background border border-foreground
1/20 rounded-md px-3 py-2 text-sm text-foreground resize-none focus:outline-none focus:ring-2 focus:ring-accent"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-foreground/70",children:s.editProfile.logo}),e.jsx(P,{value:l.logo,onChange:a=>I("logo",a.target.value),placeholder:"https://...",className:"bg-background border-foreground/20"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground/90 uppercase tracking-wider",children:s.editProfile.socialLinks}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-foreground/70",children:s.editProfile.twitch}),e.jsx(P,{value:l.twitch,onChange:a=>I("twitch",a.target.value),placeholder:"https://twitch.tv/...",className:"bg-background border-foreground/20"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-foreground/70",children:s.editProfile.twitter}),e.jsx(P,{value:l.twitter,onChange:a=>I("twitter",a.target.value),placeholder:"https://twitter.com/...",className:"bg-background border-foreground
1/20"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-foreground/70",children:s.editProfile.youtube}),e.jsx(P,{value:l.youtube,onChange:a=>I("youtube",a.target.value),placeholder:"https://youtube.com/...",className:"bg-background border-foreground/20"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm text-foreground/70",children:s.editProfile.discord}),e.jsx(P,{value:l.discord,onChange:a=>I("discord",a.target.value),placeholder:"https://discord.gg/...",className:"bg-background border-foreground/20"})]})]})]})]}),e.jsxs(Ct,{className:"gap-2",children:[e.jsx(he,{variant:"outline",onClick:()=>K(!1),className:"border-foreground/20",children:s.editProfile.cancel}),e.jsx(he,{onClick:rt,disabled:be,className:"bg-accent text-accent-foreground hover:bg-accent/90",children:be?e.jsxs(e.Fragment,{children:[e.jsx(wt,{className:"w-4 h-4 mr-2 animate-spin"}),s.editProfile.saving]}):s.editProfile.save})]})]})})]})};export{ns 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.