1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5165],{1690:(e,t,s)=>{s.d(t,{_t:()=>l,dN:()=>d,fB:()=>c,tK:()=>o,yp:()=>i});var r=s(86108);let a=e=>"number"==typeof e&&Number.isFinite(e)&&e>1;function l(e){if(!e)return[];let t=[],s=new Map;for(let t of e.over_under??[]){if("number"!=typeof t.line)continue;s.has(t.line)||s.set(t.line,{over:[],under:[]});let e=s.get(t.line);a(t.over)&&e.over.push({book:t.book,odds:t.over}),a(t.under)&&e.under.push({book:t.book,odds:t.under})}for(let[e,r]of s)r.over.length&&r.under.length&&t.push({marketKey:"OU",marketLabel:`Gols ${e}`,line:e,outcomes:[{key:"OVER",label:`Over ${e}`,quotes:r.over},{key:"UNDER",label:`Under ${e}`,quotes:r.under}]});{let s=[],r=[],l=[];for(let t of e.match_winner??[])a(t.home)&&s.push({book:t.book,odds:t.home}),a(t.draw)&&r.push({book:t.book,odds:t.draw}),a(t.away)&&l.push({book:t.book,odds:t.away});s.length&&r.length&&l.length&&t.push({marketKey:"1X2",marketLabel:"1X2",line:null,outcomes:[{key:"HOME",label:"Casa",quotes:s},{key:"DRAW",label:"Empate",quotes:r},{key:"AWAY",label:"Fora",quotes:l}]})}{let s=[],r=[];for(let t of e.btts??[])a(t.yes)&&s.push({book:t.book,odds:t.yes}),a(t.no)&&r.push({book:t.book,odds:t.no});s.length&&r.length&&t.push({marketKey:"BTTS",marketLabel:"Ambas marcam",line:null,outcomes:[{key:"YES",label:"Sim",quotes:s},{key:"NO",label:"N\xe3o",quotes:r}]})}{let s=new Map;for(let t of e.asian_handicap??[]){if("number"!=typeof t.line)continue;s.has(t.line)||s.set(t.line,{home:[],away:[]});let e=s.get(t.line);a(t.home)&&e.home.push({book:t.book,odds:t.home}),a(t.away)&&e.away.push({book:t.book,odds:t.away})}for(let[e,r]of s)r.home.length&&r.away.length&&t.push({marketKey:"AH",marketLabel:`Handicap ${e>0?"+":""}${e}`,line:e,outcomes:[{key:"HOME",label:`Casa ${e>0?"+":""}${e}`,quotes:r.home},{key:"AWAY",label:`Fora ${-e>0?"+":""}${-e}`,quotes:r.away}]})}return t}function n(e,t,s){if(s)for(let[r,l]of Object.entries(s)){let s=Number(r);if(!Number.isFinite(s))continue;e.has(s)||e.set(s,{over:[],under:[]});let n=e.get(s);a(l.over)&&n.over.push({book:t,odds:l.over}),a(l.under)&&n.under.push({book:t,odds:l.under})}}let o=2;function d(e){return(0,r.gm)(function(e){let t=(null==e?void 0:e.books)??[];if(!t.length)return[];let s=[];{let e=[],r=[],l=[];for(let s of t)a(s.home)&&e.push({book:s.name,odds:s.home}),a(s.draw)&&r.push({book:s.name,odds:s.draw}),a(s.away)&&l.push({book:s.name,odds:s.away});e.length&&r.length&&l.length&&s.push({marketKey:"1X2",marketLabel:"1X2",line:null,outcomes:[{key:"HOME",label:"Casa",quotes:e},{key:"DRAW",label:"Empate",quotes:r},{key:"AWAY",label:"Fora",quotes:l}]})}{let e=new Map;for(let s of t)n(e,s.name,s.ou);for(let[t,r]of e)r.over.length&&r.under.length&&s.push({marketKey:"OU",marketLabel:`Gols ${t}`,line:t,outcomes:[{key:"OVER",label:`Over ${t}`,quotes:r.over},{key:"UNDER",label:`Under ${t}`,quotes:r.under}]})}{let e=[],r=[];for(let s of t)a(s.bttsYes)&&e.push({book:s.name,odds:s.bttsYes}),a(s.bttsNo)&&r.push({book:s.name,odds:s.bttsNo});e.length&&r.length&&s.push({marketKey:"BTTS",marketLabel:"Ambas marcam",line:null,outcomes:[{key:"YES",label:"Sim",quotes:e},{key:"NO",label:"N\xe3o",quotes:r}]})}{let e=new Map;for(let s of t){if("number"!=typeof s.ahLine)continue;e.has(s.ahLine)||e.set(s.ahLine,{home:[],away:[]});let t=e.get(s.ahLine);a(s.ahHome)&&t.home.push({book:s.name,odds:s.ahHome}),a(s.ahAway)&&t.away.push({book:s.name,odds:s.ahAway})}for(let[t,r]of e)r.home.length&&r.away.length&&s.push({marketKey:"AH",marketLabel:`Handicap ${t>0?"+":""}${t}`,line:t,outcomes:[{key:"HOME",label:`Casa ${t>0?"+":""}${t}`,quotes:r.home},{key:"AWAY",label:`Fora ${-t>0?"+":""}${-t}`,quotes:r.away}]})}{let e=new Map;for(let s of t)n(e,s.name,s.cornersOu);for(let[t,r]of e)r.over.length&&r.under.length&&s.push({marketKey:"CORNERS",marketLabel:`Escanteios ${t}`,line:t,outcomes:[{key:"OVER",label:`Over ${t}`,quotes:r.over},{key:"UNDER",label:`Under ${t}`,quotes:r.under}]})}{let e=[],r=[],l=[];for(let s of t)a(s.fhHome)&&e.push({book:s.name,odds:s.fhHome}),a(s.fhDraw)&&r.push({book:s.name,odds:s.fhDraw}),a(s.fhAway)&&l.push({book:s.name,odds:s.fhAway});e.length&&r.length&&l.length&&s.push({marketKey:"1X2_1H",marketLabel:"1X2 1\xbaT",line:null,outcomes:[{key:"HOME",label:"Casa",quotes:e},{key:"DRAW",label:"Empate",quotes:r},{key:"AWAY",label:"Fora",quotes:l}]})}{let e=new Map;for(let s of t)n(e,s.name,s.fhOu);for(let[t,r]of e)r.over.length&&r.under.length&&s.push({marketKey:"OU_1H",marketLabel:`Gols 1\xbaT ${t}`,line:t,outcomes:[{key:"OVER",label:`Over ${t}`,quotes:r.over},{key:"UNDER",label:`Under ${t}`,quotes:r.under}]})}return s}(e.odds),!0)}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s={maxProfitPct:r.K6,...t};return(0,r.yG)(d(e),{delayedMinProfitPct:o,...s})}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.yG)(l(e),{maxProfitPct:r.K6,...t})}},2515:(e,t,s)=>{s.d(t,{f:()=>a});let r=new Set(["media.api-sports.io","api-sports.io","flagcdn.com"]);function a(e){if(e){try{let t=new URL(e);if("https:"===t.protocol&&r.has(t.hostname))return`/api/img?u=${encodeURIComponent(e)}`}catch{}return e}}},15239:(e,t,s)=>{s.d(t,{default:()=>a.a});var r=s(54652),a=s.n(r)},27421:(e,t,s)=>{s.d(t,{$U:()=>g,QV:()=>f,QZ:()=>p,Um:()=>r,ZY:()=>l,eg:()=>m,jV:()=>y,mN:()=>i,t6:()=>b});let r={"85%+":0,"75%+":1,"65%+":2,OUT_OF_RANGE:3},a={"65%":.93,"75%":1.15,"85%":1.44,"95%":1.96},l={goals:{edgeMinElapsed:20,backloadWeight:1,published:!0},corners:{edgeMinElapsed:60,backloadWeight:1.3,published:!0},shots:{edgeMinElapsed:60,backloadWeight:1.2,published:!0},shots_on:{edgeMinElapsed:60,backloadWeight:1.2,published:!0},cards:{edgeMinElapsed:60,backloadWeight:1.3,published:!1},fouls:{edgeMinElapsed:60,backloadWeight:1.2,published:!1},offsides:{edgeMinElapsed:60,backloadWeight:1.1,published:!1}},n={corners:{totalMinutes:90,minElapsed:20,secondHalfWeight:l.corners.backloadWeight},cards:{totalMinutes:90,minElapsed:20,secondHalfWeight:l.cards.backloadWeight},shots:{totalMinutes:90,minElapsed:20,secondHalfWeight:l.shots.backloadWeight},shots_on:{totalMinutes:90,minElapsed:20,secondHalfWeight:l.shots_on.backloadWeight},fouls:{totalMinutes:90,minElapsed:20,secondHalfWeight:l.fouls.backloadWeight},offsides:{totalMinutes:90,minElapsed:20,secondHalfWeight:l.offsides.backloadWeight},goals:{totalMinutes:90,minElapsed:20,secondHalfWeight:l.goals.backloadWeight}},o=new Set(["corners","goals"]),d=new Set(["ET","BT","P","PEN","AET"]);function i(e){return d.has(e??"")}let c=new Set(["1H","2H","ET","LIVE"]);function m(e,t){let s=e??"",r=d.has(s)?120:90;return c.has(s)?r+(Number.isFinite(t)&&t>0?t:4):r}let u=["corners","cards","shots","shots_on","fouls","offsides","goals"];function x(e){return Math.round(10*e)/10}function h(e){return"number"==typeof e&&Number.isFinite(e)?e:0}function p(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=s.totalMinutes??90,l=s.minElapsed??20,n=s.secondHalfWeight??1,o=Number.isFinite(e)&&e>0?e:0,d=Math.max(Number.isFinite(t)?t:0,l),i=d>
10?o/d:0,c=Math.max(0,r-(Number.isFinite(t)?t:0)),m=Math.max(0,i*c*n),u=o+m,h=Math.sqrt(m);return{projected:x(u),pace:i,remaining:c,sigma:x(h),intervals:function(e,t){let s=s=>({lower:x(e-s*t),upper:x(e+s*t)});return{"65%":s(a["65%"]),"75%":s(a["75%"]),"85%":s(a["85%"]),"95%":s(a["95%"])}}(u,h)}}function g(e,t){let s=t["85%"],r=t["75%"],a=t["65%"];return e<s.lower||e>s.upper?"85%+":e<r.lower||e>r.upper?"75%+":e<a.lower||e>a.upper?"65%+":"OUT_OF_RANGE"}function f(e,t,s,r,a){let l=g(s,t);if("OUT_OF_RANGE"===l)return null;let n=e>s?"OVER":"UNDER";return{line:s,recommendation:n,confidence:l,recommendedOdd:"OVER"===n?r??null:a??null,projected:e}}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;return Number.isFinite(e)&&e>=t}function j(e,t){if(!e)return 0;switch(t){case"corners":return h(e.corners);case"cards":return h(e.yellow)+h(e.red);case"shots":return h(e.shots_total);case"shots_on":return h(e.shots_on);case"fouls":return h(e.fouls);case"offsides":return h(e.offsides);case"goals":return h(e.goals)}}function v(e,t){let s=r[e.confidence]-r[t.confidence];if(0!==s)return s;let a=e.recommendedOdd??-1/0,l=t.recommendedOdd??-1/0;return a!==l?l-a:e.line-t.line}function w(e,t){let s=+!e.edge,r=+!t.edge;return s!==r?s-r:e.edge&&t.edge?v(e.edge,t.edge):0}function y(e,t,s,r,a){return u.map(d=>(function(e,t,s,r,a,d){let i=n[e],c=j(null==t?void 0:t.home,e)+j(null==t?void 0:t.away,e),m=p(c,s,{...i,totalMinutes:d??i.totalMinutes}),u=function(e,t,s){let r=[];for(let s of(null==t?void 0:t.books)??[]){let t="corners"===e?s.cornersOu:"goals"===e?s.ou:void 0;t&&Object.keys(t).length>0&&r.push({book:s.name,lines:t})}let a=null==s?void 0:s[e];return a&&Object.keys(a).length>0&&r.push({book:"EXTRA",lines:a}),r}(e,r,a),x=u.length>0||o.has(e),h=l[e],g=h.published&&b(s,h.edgeMinElapsed)&&c>0,w=null;if(g)for(let e of u){let t=function(e,t){let s=null;for(let[r,a]of Object.entries(t.lines)){let t=Number(r);
1if(!Number.isFinite(t))continue;let l=f(e.projected,e.intervals,t,a.over,a.under);l&&(null===s||0>v(l,s))&&(s=l)}return s?{edge:s,book:t.book}:null}(m,e);t&&(null===w||0>v(t.edge,w.edge))&&(w=t)}return{metric:e,current:c,projected:m.projected,pace:m.pace,remaining:m.remaining,sigma:m.sigma,intervals:m.intervals,edge:(null==w?void 0:w.edge)??null,book:(null==w?void 0:w.book)??null,projectionOnly:!x,impliedLine:x?null:Math.round(m.projected)-.5}})(d,e,t,s,r,a)).sort(w)}},54652:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var s in t)Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}(t,{default:function(){return d},getImageProps:function(){return o}});let r=s(28140),a=s(75040),l=s(81356),n=r._(s(71124));function o(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:n.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,s]of Object.entries(t))void 0===s&&delete t[e];return{props:t}}let d=l.Image},56635:(e,t,s)=>{s.d(t,{A:()=>l});var r=s(95155),a=s(18955);function l(e){let{m:t}=e,s=(0,a.c)("Football"),l=null!=t.cards_home||null!=t.cards_away,n=null!=t.fouls_home||null!=t.fouls_away;return l||n?(0,r.jsxs)("div",{className:"mt-0.5 flex items-center justify-end gap-3 text-[10px] text-muted-foreground",children:[l&&(0,r.jsxs)("span",{className:"flex items-center gap-1",title:s("statCards"),children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"inline-block h-2.5 w-[7px] rounded-[1px] bg-yellow-400"}),(0,r.jsxs)("span",{className:"tabular-nums",children:[t.cards_home??"â","â",t.cards_away??"â"]})]}),n&&(0,r.jsxs)("span",{className:"tabular-nums",children:[s("statFouls")," ",t.fouls_home??"â","â",t.fouls_away??"â"]})]}):null}},56761:(e,t,s)=>{s.d(t,{E:()=>n});var r=s(12115),a=s(86808),l=s(29779);function n(){let[e,t]=(0,r.useState)([]);return(0,r.useEffect)(()=>{let e=!0,s=null,r=async()=>{let s=await (0,l.rk)();e&&t(s)};r();let n=a.ND.channel("football-live-games").on("postgres_changes",{event:"*",schema:"football",table:"live_games"},()=>{s&&clearTimeout(s),s=setTimeout(r,400)}).subscribe(),o=setInterval(r,9e4);return()=>{e=!1,s&&clearTimeout(s),clearInterval(o),a.ND.removeChannel(n)}},[]),e}},82160:(e,t,s)=>{s.d(t,{Ay:()=>c,B2:()=>m,vy:()=>i});var r=s(95155),a=s(22952),l=s(18955),n=s(38437);let o=e=>(e??"").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase());function d(){let e=(0,l.c)("BlurredPremiumOverlay"),t=(0,n.c)().isTrialEligible;return{t:e,showTrialCta:t,badgeLabel:e(t?"trialBadge":"badge"),ctaLabel:e(t?"startTrialButton":"upgradeButton")}}function i(e){let{game:t}=e,{t:s,badgeLabel:l,ctaLabel:n}=d();return(0,r.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-[#FFBE1A]/10 border border-[#FFBE1A]/30 rounded-lg",children:[(0,r.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full bg-[#FFBE1A]/20 text-[#FFBE1A] text-xs font-medium",children:l}),(0,r.jsx)("p",{className:"text-sm text-slate-900 dark:text-white/80 flex-1",children:s("previewBanner",{homeTeam:o(t.homeTeam),awayTeam:o(t.awayTeam)})}),(0,r.jsx)(a.N_,{href:"/pricing",className:"shrink-0 bg-[#FFBE1A] hover:bg-[#FFBE1A]/90 text-black px-3 py-1.5 rounded-lg font-medium text-xs transition-colors",children:n})]})}function c(e){let{children:t,message:s,highlightedLabel:l,blurPx:n=6,active:o=!0,className:i="",compact:c=!1}=e,{t:m,badgeLabel:u,ctaLabel:x}=d();return o?(0,r.jsxs)("div",{className:`relative ${i}`,children:[(0,r.jsx)("div",{className:"select-none pointer-events-none",style:{filter:`blur(${n}px)`},"aria-hidden":"true",children:t}),(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:c?(0,r.jsx)(a.N_,{href:"/pricing",className:"inline-flex items-center rounded-full border border-[#FFBE1A]/35 bg-black/78 px-3 py-1.5 text-[11px] font-medium text-[#FFBE1A] backdrop-blur-sm shadow-lg",children:u}):(0,r.jsxs)("div",{className:"premium-overlay-card bg-black/70 backdrop-blur-sm border border-[#FFBE1A]/30 text-center shadow-lg rounded-xl px-6 py-4 max-w-xs",children:[(0,r.jsx)("div",{className:"inline-flex items-center rounded-full bg-[#FFBE1A]/15 text-[#FFBE1A] font-medium mb-2 px-3 py-1 text-xs",children:u}),l&&(0,r.jsxs)("div",{className:"mb-3 inline-flex items-center gap-1.5 rounded-full border border-amber-500/30 bg-amber-500/10 px-3 py-1 text-[11px] font-semibold uppercase tracking-wide text-amber-300",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"
1currentColor","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M12 2.25l2.91 5.89 6.5.95-4.7 4.58 1.11 6.48L12 17.1l-5.82 3.05 1.11-6.48-4.7-4.58 6.5-.95L12 2.25z"})}),l]}),(0,r.jsx)("p",{className:"premium-overlay-message text-white mb-3 text-sm font-medium leading-relaxed",children:s||m("defaultMessage")}),(0,r.jsx)(a.N_,{href:"/pricing",className:"inline-block bg-[#FFBE1A] hover:bg-[#FFBE1A]/90 text-black rounded-lg font-medium transition-colors px-4 py-2 text-sm",children:x})]})})]}):(0,r.jsx)(r.Fragment,{children:t})}function m(e){let{children:t,message:s,highlightedLabel:l,blurPx:n=5,compact:o=!1,actionLabel:i,onAction:c,align:m="center"}=e,{t:u,ctaLabel:x}=d(),h=!!(i&&c);return(0,r.jsxs)("div",{className:`relative overflow-hidden rounded-lg ${o?h?"min-h-[184px]":"min-h-[148px]":h?"min-h-[220px]":"min-h-[176px]"}`,children:[(0,r.jsx)("div",{className:"pointer-events-none select-none opacity-40",style:{filter:`blur(${n}px)`},"aria-hidden":"true",children:t}),(0,r.jsx)("div",{className:`absolute inset-0 z-10 flex justify-center p-3 ${"top"===m?"items-start pt-4":"items-center"}`,children:(0,r.jsxs)("div",{className:`w-full rounded-xl border border-[#FFBE1A]/30 bg-black/74 text-center shadow-lg backdrop-blur-sm ${o?"max-w-[17rem] px-4 py-3":"max-w-xs px-5 py-4"}`,children:[l&&(0,r.jsxs)("div",{className:"mb-2 inline-flex items-center gap-1.5 rounded-full border border-amber-500/30 bg-amber-500/10 px-3 py-1 text-[11px] font-semibold uppercase tracking-wide text-amber-300",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M12 2.25l2.91 5.89 6.5.95-4.7 4.58 1.11 6.48L12 17.1l-5.82 3.05 1.11-6.48-4.7-4.58 6.5-.95L12 2.25z"})}),l]}),(0,r.jsx)("p",{className:`text-white ${o?"mb-2 text-xs font-medium leading-relaxed":"mb-3 text-sm font-medium leading-relaxed"}`,children:s||u("unlockPredictionSection")}),h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:c,className:`inline-flex w-full items-center justify-center rounded-lg bg-emerald-500 font-semibold text-black transition-colors hover:bg-emerald-400 ${o?"px-3 py-1.5 text-xs":"px-4 py-2 text-sm"}`,children:i}),(0,r.jsx)(a.N_,{href:"/pricing",className:"mt-2 inline-block text-[10px] font-medium text-[#FFBE1A]/90 underline-offset-2 hover:underline",children:x})]}):(0,r.jsx)(a.N_,{href:"/pricing",className:`inline-flex items-center justify-center rounded-lg bg-[#FFBE1A] font-medium text-black transition-colors hover:bg-[#FFBE1A]/90 ${o?"px-3 py-1.5 text-xs":"px-4 py-2 text-sm"}`,children:x})]})})]})}},85165:(e,t,s)=>{s.r(t),s.d(t,{default:()=>e_});var r=s(95155),a=s(12115),l=s(18955),n=s(67909),o=s(51567),d=s(20552),i=s(29779),c=s(56761),m=s(1690),u=s(2515),x=s(82160),h=s(22454),p=s(22952),g=s(29079);let f={games:18,wins:11,draws:4,losses:3,win_pct:61,gf_avg:1.9,ga_avg:1.1,cf_avg:5.8,ca_avg:4.4,avg_total:3,over25_pct:58,btts_pct:52,clean_sheet_pct:39,failed_to_score_pct:18,fh_goals_avg:.8,sh_goals_avg:1.1,cards_avg:2},b=["W","W","D","L","W"];function j(e){let{recent:t,locale:s}=e;return t.length?(0,r.jsx)("span",{className:"inline-flex gap-0.5",children:[...t].slice(0,6).reverse().map((e,t)=>(0,r.jsx)("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded text-[9px] font-bold ${"W"===e?"bg-green-600 text-white":"L"===e?"bg-rose-500 text-white":"bg-amber-500 text-white"}`,children:(0,d.k)(e,s)},t))}):(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"â"})}function v(e,t){if(!e)return null;let s=(0,g.cm)(t);for(let t of e)for(let e of t)if((0,g.cm)(e.team.name)===s)return{rank:e.rank,points:e.points};return null}let w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null==e?"â":`${e}${t}`},y=(0,a.memo)(e=>{var t,s,n,c;let{homeTeam:m,awayTeam:u,leagueId:x,isPremium:g,children:y}=e,N=(0,l.c)("Football"),k=(0,o.Ym)(),_=(0,h.I)({queryKey:["footballCardStats",x,m],queryFn:()=>(0,i.Jm)(x,m,null),enabled:g&&!!m&&!!x,staleTime:18e5,gcTime:36e5}),F=(0,h.I)({queryKey:["footballCardStats",x,u],queryFn:()=>(0,i.Jm)(x,u,null),enabled:g&&!!u&&!!x,staleTime:18e5,gcTime:36e5}),C=(0,h.I)({queryKey:["footballCardStandings",x],queryFn:i.xL,enabled:g&&!!x,staleTime:18e5,gcTime:36e5}),M=(0,a.useMemo)(()=>{var e,t;return null==(t=C.data)||null==(e=t.find(e=>e.league_id===x))?void 0:e.data},[C.data,x]),$=g&&(_.isLoading||F.isLoading),E=g?null==(t=_.data)?void 0:t.overall:f,L=g?null==(s=F.data)?void 0:s.overall:f,S=g?(null==(n=_.data)?void 0:n.recent)??[]:b,A=g?(null==(c=F.data)?void 0:c.recent)??[]:b,B=g?v(M,m):{rank:3,points:37},T=g?v(M,u):{rank:8,points:24},O=[{label:N("analysis.record"),get:e=>e?`${e.wins}-${e.draws}-${e.losses}`:"â"},{label:N("analysis.winPct"),get:e=>w(null==e?void 0:e.win_pct,"%")},{label:N("analysis.goalsFor"),get:e=>w(null==e?void 0:e.gf_avg)},{label:N("analysis.goalsAgainst"),get:e=>w(null==e?void 0:e.ga_avg)},{label:N("analysis.cornersFor"),get:e=>w(null==e?void 0:e.cf_avg)},{label:N("analysis.cornersAgainst"),get:e=>w(null==e?void 0:e.ca_avg)},{label:N("analysis.over25"),get:e=>w(null==e?void 0:e.over25_pct,"%")},{label:N("analysis.btts"),get:e=>w(null==e?void 0:e.btts_pct,"%")},{label:N("analysis.cleanSheet"),get:e=>w(null==e?void 0:e.clean_sheet_pct,"%")},{label:N("analysis.goals1H"),get:e=>w(null==e?void 0:e.fh_goals_avg)},{label:N("analysis.goals2H"),get:e=>w(null==e?void 0:e.sh_goals_avg)},{label:N("analysis.failedToScore"),get:e=>w(null==e?void 0:e.failed_to_score_pct,"%")}],H=!!(null==E?void 0:E.games)||!!(null==L?void 0:L.games),W=g?"":"blur-[3px] select-none pointer-events-none";return(0,r.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,r.jsxs)("div",{className:"mb-2 grid grid-cols-[1fr_auto_1fr] items-center gap-2 border-b border-border/40 pb-2 text-xs",children:[(0,r.jsx)("span",{className:"truncate font-bold text-emerald-600 dark:text-emerald-400",title:(0,d.c)(m,k),children:(0,d.c)(m,k)}),(0,r.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"vs"}),(0,r.jsx)("span",{className:"truncate text-right font-bold text-sky-600 dark:text-sky-400",title:(0,d.c)(u,k),children:(0,d.c)(u,k)})]}),$?(0,r.jsx)("div",{className:"flex flex-1 items-center justify-center",children:(0,r.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-b-2 border-t-2 border-emerald-500/60"})}):!g||H?(0,r.jsxs)("div",{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pr-1 ${W}`,children:[(0,r.jsx)("div",{className:"text-center text-[9px] font-bold uppercase tracking-wide text-muted-foreground
1/80",children:N("flipCard.overallLabel")}),(0,r.jsxs)("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-2",children:[(0,r.jsx)(j,{recent:S,locale:k}),(0,r.jsx)("span",{className:"cursor-help text-[9px] font-semibold uppercase tracking-wide text-muted-foreground",title:N("statFormHint"),children:N("analysis.recentForm")}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(j,{recent:A,locale:k})})]}),(B||T)&&(0,r.jsxs)("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-2 text-xs",children:[(0,r.jsx)("span",{className:"font-semibold text-foreground",children:B?N("flipCard.standingValue",{rank:B.rank,points:B.points}):"â"}),(0,r.jsx)("span",{className:"text-[9px] font-semibold uppercase tracking-wide text-muted-foreground",children:N("flipCard.standing")}),(0,r.jsx)("span",{className:"text-right font-semibold text-foreground",children:T?N("flipCard.standingValue",{rank:T.rank,points:T.points}):"â"})]}),(0,r.jsx)("div",{className:"grid grid-cols-[1fr_auto_1fr] gap-x-2 gap-y-1.5 text-xs",children:O.map(e=>(0,r.jsxs)("div",{className:"contents",children:[(0,r.jsx)("span",{className:"font-semibold tabular-nums text-emerald-600 dark:text-emerald-400",children:e.get(E)}),(0,r.jsx)("span",{className:"text-center text-[10px] text-muted-foreground",children:e.label}),(0,r.jsx)("span",{className:"text-right font-semibold tabular-nums text-sky-600 dark:text-sky-400",children:e.get(L)})]},e.label))}),(0,r.jsx)("p",{className:"mt-1 text-[9px] italic text-muted-foreground/70",children:N("flipCard.note")})]}):(0,r.jsx)("div",{className:"flex flex-1 items-center justify-center px-3 text-center",children:(0,r.jsx)("p",{className:"text-[11px] italic text-muted-foreground",children:N("flipCard.noData")})}),y,!g&&(0,r.jsx)("div",{className:"mt-2 flex-shrink-0",children:(0,r.jsxs)(p.N_,{href:"/pricing",className:"flex items-center justify-center gap-1.5 rounded-md border border-border/40 px-3 py-2 text-[11px] font-medium text-muted-foreground transition-colors hover:border-emerald-500/40 hover:bg-emerald-500/5 hover:text-emerald-600 dark:hover:text-emerald-400",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-amber-400",children:[(0,r.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),N("premium.badge")]})})]})});y.displayName="FootballGameCardStats";var N=s(56635);function k(e){let{h2h:t,homeName:s,awayName:n,locale:o}=e,i=(0,l.c)("Football"),[c,m]=(0,a.useState)(!1);if(!t||t.games<=0)return null;let u=i(1===t.draws?"draw":"statDraws");return(0,r.jsxs)("div",{className:"rounded-md border border-border/40 px-2 py-1.5",children:[(0,r.jsxs)("div",{className:"mb-1.5 text-center text-[9px] font-bold uppercase tracking-wide text-muted-foreground/80",children:[i("flipCard.h2hLabel")," \xb7 ",t.games," ",i("games")]}),(0,r.jsxs)("div",{className:"grid grid-cols-3 items-end gap-2 text-center",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-base font-bold tabular-nums text-emerald-600 dark:text-emerald-400",children:t.home_wins}),(0,r.jsx)("div",{className:"truncate text-[9px] text-muted-foreground",title:s,children:s})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-base font-bold tabular-nums text-slate-500 dark:text-slate-300",children:t.draws}),(0,r.jsx)("div",{className:"text-[9px] text-muted-foreground",children:u})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-base font-bold tabular-nums text-sky-600 dark:text-sky-400",children:t.away_wins}),(0,r.jsx)("div",{className:"truncate text-[9px] text-muted-foreground",title:n,children:n})]})]}),t.matches&&t.matches.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{type:"button",onClick:()=>m(e=>!e),"aria-expanded":c,className:"mx-auto mt-2 flex w-fit items-center gap-1 rounded-lg border border-emerald-500/40 bg-emerald-500/5 px-2.5 py-1 text-[9px] font-semibold uppercase tracking-wide text-emerald-600 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 active:bg-emerald-500/15 dark:text-emerald-400",children:[i(c?"flipCard.h2hHide":"flipCard.h2hShowDates"),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:`transition-transform ${c?"rotate-180":""}`,children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})]}),c&&(0,r.jsx)("ul",{className:"mt-1 space-y-1 border-t border-border/30 pt-1",children:t.matches.map((e,t)=>(0,r.jsxs)("li",{className:"text-[10px]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:function(e,t){if(!e)return"â";let s=new Date(e);return Number.isNaN(s.getTime())?"â":s.toLocaleDateString("pt"===t?"pt-BR":"en-US",{day:"2-digit",month:"short",year:"numeric"})}(e.date,o)}),(0,r.jsxs)("span",{className:"truncate text-right text-foreground",children:[(0,d.c)(e.home_team,o)," ",(0,r.jsxs)("span",{className:"font-bold tabular-nums",children:[e.home_goals,"â",e.away_goals]})," ",(0,d.c)(e.away_team,o)]})]}),(0,r.jsx)(N.A,{m:e})]},t))})]})]})}let _="flex w-fit items-center gap-1 rounded-lg border border-emerald-500/40 bg-emerald-500/5 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide text-emerald-600 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 active:bg-emerald-500/15 dark:text-emerald-400";function F(e){let{open:t}=e;return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:`transition-transform ${t?"rotate-180":""}`,children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})}function C(e){let{recent:t,locale:s}=e;return t&&0!==t.length?(0,r.jsx)("span",{className:"inline-flex gap-0.5",children:[...t].slice(0,6).reverse().map((e,t)=>(0,r.jsx)("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded text-[9px] font-bold ${"W"===e?"bg-green-600 text-white":"L"===e?"bg-red-500 text-white":"bg-amber-500 text-white"}
1`,children:(0,d.k)(e,s)},t))}):(0,r.jsx)("span",{className:"text-muted-foreground text-xs",children:"â"})}function M(e){let{home:t,away:s,homeName:n,awayName:o,locale:i}=e,c=(0,l.c)("Football"),[m,u]=(0,a.useState)(!1),x=((null==t?void 0:t.length)??0)>0,h=((null==s?void 0:s.length)??0)>0;if(!x&&!h)return null;let p=e=>(0,r.jsx)("ul",{className:"space-y-0.5",children:e.slice(0,6).map((e,t)=>{let s;return(0,r.jsxs)("li",{className:"flex min-w-0 items-center gap-1.5 text-[10px] text-muted-foreground",children:[(0,r.jsx)("span",{className:`w-3 shrink-0 text-center font-bold ${"W"===(s=e.result)?"text-green-600 dark:text-green-400":"L"===s?"text-red-500":"text-amber-500"}`,children:(0,d.k)(e.result,i)}),(0,r.jsx)("span",{className:"w-9 shrink-0 tabular-nums opacity-70",children:(e=>{if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString("pt"===i?"pt-BR":"en-US",{day:"2-digit",month:"short"})})(e.date)}),(0,r.jsxs)("span",{className:"shrink-0 tabular-nums font-semibold text-foreground",children:[e.goals_for,"-",e.goals_against]}),(0,r.jsx)("span",{className:"shrink-0 opacity-60",children:e.home?c("recentHomeMark"):c("recentAwayMark")}),(0,r.jsx)("span",{className:"truncate",children:(0,d.c)(e.opponent,i)})]},t)})});return(0,r.jsxs)("div",{children:[(0,r.jsxs)("button",{type:"button",onClick:()=>u(e=>!e),"aria-expanded":m,className:_,children:[m?c("recentHide"):c("recentShow"),(0,r.jsx)(F,{open:m})]}),m&&(0,r.jsxs)("div",{className:"mt-1.5 grid grid-cols-2 gap-x-3 gap-y-1",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"mb-0.5 text-[10px] font-semibold text-foreground/80",children:n}),x?p(t):(0,r.jsx)("div",{className:"text-[10px] text-muted-foreground",children:c("recentNone")})]}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"mb-0.5 text-[10px] font-semibold text-foreground/80",children:o}),h?p(s):(0,r.jsx)("div",{className:"text-[10px] text-muted-foreground",children:c("recentNone")})]})]})]})}function $(e){let{chains:t,label:s,fromName:n,toName:o,locale:i}=e,c=(0,l.c)("Football"),[m,u]=(0,a.useState)(!1);if(!t||0===t.length)return null;let x=e=>{let[t,s]=e.split("-").map(e=>Number(e));return{w:Math.max(t,s),l:Math.min(t,s)}},h=e=>{if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleDateString("pt"===i?"pt-BR":"en-US",{day:"2-digit",month:"short",year:"numeric"})},p=t.some(e=>e.date1||e.date2);return(0,r.jsxs)("div",{className:"mt-1",children:[(0,r.jsx)("div",{className:"text-[11px] font-semibold text-foreground/80",children:s}),(0,r.jsx)("ul",{className:"mt-0.5 space-y-0.5",children:t.map((e,t)=>{let s=(0,d.c)(e.via,i),a=x(e.leg1),l=x(e.leg2),u=c("chainBeat",{winner:n,loser:s,ws:a.w,ls:a.l}),p=c("chainBeat",{winner:s,loser:o,ws:l.w,ls:l.l}),g=h(e.date1),f=h(e.date2);return(0,r.jsxs)("li",{className:"break-words text-[11px] text-muted-foreground",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-foreground",children:"â®"})," ",u," ",(0,r.jsx)("span",{className:"opacity-60",children:"\xb7"})," ",p]}),m&&(g||f)&&(0,r.jsxs)("ul",{className:"ml-3 mt-0.5 space-y-0.5 border-l border-border/40 pl-2 text-[10px] text-muted-foreground/80",children:[g&&(0,r.jsxs)("li",{children:["⢠",u," â ",g]}),f&&(0,r.jsxs)("li",{children:["⢠",p," â ",f]})]})]},t)})}),p&&(0,r.jsxs)("button",{type:"button",onClick:()=>u(e=>!e),"aria-expanded":m,className:`mt-1 ${_}`,children:[m?c("chainHideDates"):c("chainShowDates"),(0,r.jsx)(F,{open:m})]})]})}let E="mb-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground";function L(e){var t,s,a,n,o,d,i,c;let{dt:m,homeName:u,awayName:x,locale:h}=e,p=(0,l.c)("Football");return(0,r.jsxs)("section",{className:"mt-3","data-testid":"football-decision-tree",children:[(0,r.jsx)("div",{className:E,children:p("decisionTreeTitle")}),(0,r.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"text-[11px] font-semibold text-foreground",children:u}),(0,r.jsx)(C,{recent:null==(t=m.home_form)?void 0:t.recent,locale:h}),(0,r.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:[p("ppg"),": ",(null==(s=m.home_form)?void 0:s.ppg)??"â"," \xb7 ",null==(a=m.home_form)?void 0:a.record]})]}),(0,r.jsxs)("div",{className:"min-w-0 text-right",children:[(0,r.jsx)("div",{className:"text-[11px] font-semibold text-foreground",children:x}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(C,{recent:null==(n=m.away_form)?void 0:n.recent,locale:h})}),(0,r.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:[p("ppg"),": ",(null==(o=m.away_form)?void 0:o.ppg)??"â"," \xb7 ",null==(d=m.away_form)?void 0:d.record]})]})]}),(0,r.jsx)("div",{className:"text-center text-[9px] text-muted-foreground
1/70",children:p("formOrderHint")}),(0,r.jsx)(M,{home:null==(i=m.home_form)?void 0:i.recent_matches,away:null==(c=m.away_form)?void 0:c.recent_matches,homeName:u,awayName:x,locale:h}),m.h2h&&(0,r.jsx)(k,{h2h:m.h2h,homeName:u,awayName:x,locale:h}),m.transitive_chains&&(0,r.jsxs)("div",{children:[(0,r.jsx)($,{chains:m.transitive_chains.home_to_away,label:p("transitiveHome",{team:u,opp:x}),fromName:u,toName:x,locale:h}),(0,r.jsx)($,{chains:m.transitive_chains.away_to_home,label:p("transitiveAway",{team:x,opp:u}),fromName:x,toName:u,locale:h}),0===m.transitive_chains.home_to_away.length&&0===m.transitive_chains.away_to_home.length&&(0,r.jsx)("div",{className:"text-[11px] text-muted-foreground",children:p("noChains")})]})]})]})}function S(e){let{injuries:t,locale:s}=e,a=(0,l.c)("Football"),n=Array.from(t.reduce((e,t)=>{let s=t.team??"",r=e.get(s)??[];return r.push(t),e.set(s,r),e},new Map));return(0,r.jsxs)("section",{className:"mt-3","data-testid":"football-injuries",children:[(0,r.jsx)("div",{className:E,children:a("injuriesTitle")}),(0,r.jsx)("div",{className:"rounded-lg bg-muted/50 p-3",children:n.map(e=>{let[t,a]=e;return(0,r.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,r.jsx)("div",{className:"text-[11px] font-semibold text-foreground",children:(0,d.c)(t,s)}),(0,r.jsx)("ul",{className:"mt-0.5 space-y-0.5",children:a.map((e,t)=>(0,r.jsxs)("li",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[e.photo&&(0,r.jsx)("img",{src:(0,u.f)(e.photo),alt:"",loading:"lazy",className:"h-[14px] w-[14px] shrink-0 rounded-full object-cover"}),(0,r.jsx)("span",{className:"text-foreground text-[11px]",children:e.player}),e.reason&&(0,r.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["\xb7 ",e.reason]})]},t))})]},t)})})]})}function A(e){let{showTree:t,showInjuries:s}=e,a=(0,l.c)("Football");return(0,r.jsxs)("div",{"data-testid":"football-insights-skeleton",children:[t&&(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("div",{className:E,children:a("decisionTreeTitle")}),(0,r.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[0,1].map(e=>(0,r.jsxs)("div",{className:`space-y-1 ${1===e?"flex flex-col items-end":""}`,children:[(0,r.jsx)("span",{className:"block h-2.5 w-20 rounded bg-muted-foreground/25"}),(0,r.jsx)("span",{className:"inline-flex gap-0.5",children:[0,1,2,3,4].map(e=>(0,r.jsx)("span",{className:"inline-block h-4 w-4 rounded bg-slate-400/60"},e))}),(0,r.jsx)("span",{className:"block h-2 w-16 rounded bg-muted-foreground/15"})]},e))}),[0,1,2].map(e=>(0,r.jsx)("span",{className:"block h-2.5 w-full rounded bg-muted-foreground/10"},e))]})]}),s&&(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("div",{className:E,children:a("injuriesTitle")}),(0,r.jsx)("div",{className:"space-y-1.5 rounded-lg bg-muted/50 p-3",children:[0,1].map(e=>(0,r.jsx)("span",{className:"block h-2.5 w-32 rounded bg-muted-foreground/20"},e))})]})]})}function B(e){let{decisionTree:t,injuries:s,homeName:a,awayName:n,locale:o,unlocked:d,canClaimFree:i=!1,onClaimFree:c}=e,m=(0,l.c)("BlurredPremiumOverlay"),u=!!s&&s.length>0;return t||u?d?(0,r.jsxs)("div",{className:"border-t border-border/40 pt-1",children:[t&&(0,r.jsx)(L,{dt:t,homeName:a,awayName:n,locale:o}),u&&(0,r.jsx)(S,{injuries:s,locale:o})]}):(0,r.jsx)("div",{className:"mt-3 border-t border-border/40 pt-3",children:(0,r.jsx)(x.B2,{message:m(i?"freeUnlockPrompt":"unlockPredictionSection"),actionLabel:i?m("freeUnlockCta"):void 0,onAction:i?c:void 0,align:"center",compact:!0,children:(0,r.jsx)(A,{showTree:!!t,showInjuries:u})})}):null}var T=s(56328),O=s(27421);function H(e,t){if(!e)return 0;let s=e=>"number"==typeof e&&Number.isFinite(e)?e:0;switch(t){case"corners":return s(e.corners);case"cards":return s(e.yellow)+s(e.red);case"shots":return s(e.shots_total);case"shots_on":return s(e.shots_on)}}var W=s(29262),P=s(31664),V=s(48588),D=s(61605),R=s(86108);function U(e){return"85%+"===e?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border-emerald-500/30":"75%+"===e?"bg-amber-500/15 text-amber-600 dar
1k:text-amber-400 border-amber-500/30":"bg-sky-500/15 text-sky-600 dark:text-sky-400 border-sky-500/30"}function q(e){let{label:t,pulse:s}=e;return(0,r.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-red-500",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 shrink-0 rounded-full bg-red-500${s?" animate-pulse":""}`}),t]})}function G(e){if(null==e)return 0;let t="number"==typeof e?e:parseFloat(String(e).replace("%",""));return Number.isFinite(t)?t:0}function I(e){return null==e?"-":"string"==typeof e?e:Number.isInteger(e)?String(e):e.toFixed(2)}function Y(e,t){return null!=t&&t>0?`${e}+${t}'`:`${e}'`}function z(e){let{home:t,away:s}=e,a=G(t.possession),l=a+G(s.possession),n=l>0?a/l*100:50;return(0,r.jsxs)("div",{className:"flex h-1.5 w-full overflow-hidden rounded-full bg-muted",children:[(0,r.jsx)("div",{className:"h-full bg-emerald-500",style:{width:`${n}%`}}),(0,r.jsx)("div",{className:"h-full bg-emerald-500/30",style:{width:`${100-n}%`}})]})}function K(e){let{label:t,home:s,away:a,hint:l}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-2 text-[11px]",children:[(0,r.jsx)("span",{className:"w-10 shrink-0 text-left font-semibold tabular-nums text-foreground",children:I(s)}),(0,r.jsxs)("span",{className:`flex-1 text-center text-muted-foreground${l?" cursor-help":""}`,title:l,children:[t,l&&(0,r.jsx)("span",{"aria-hidden":!0,className:"ml-0.5 text-muted-foreground/60",children:"â"})]}),(0,r.jsx)("span",{className:"w-10 shrink-0 text-right font-semibold tabular-nums text-foreground",children:I(a)})]})}function X(e){let{home:t,away:s,t:a}=e,l=[{label:a("statXg"),home:t.xg,away:s.xg,hint:a("statXgHint")},{label:a("statShots"),home:t.shots_total,away:s.shots_total,count:!0},{label:a("statShotsOn"),home:t.shots_on,away:s.shots_on,count:!0},{label:a("statCorners"),home:t.corners,away:s.corners,count:!0},{label:a("statFouls"),home:t.fouls,away:s.fouls,count:!0},{label:a("statOffsides"),home:t.offsides,away:s.offsides,count:!0},{label:a("statSaves"),home:t.saves,away:s.saves,count:!0},{label:a("statPassesPct"),home:t.passes_pct,away:s.passes_pct}],n=(t.yellow??0)+(t.red??0),o=(s.yellow??0)+(s.red??0);(n>0||o>0)&&l.push({label:a("statCards"),home:n,away:o});let d=e=>null==e||0===e,i=l.filter(e=>e.count?!(d(e.home)&&d(e.away)):null!=e.home||null!=e.away),c=null!=t.possession||null!=s.possession;if(!c&&0===i.length)return null;let m=i.some(e=>e.count);return(0,r.jsxs)("div",{className:"mt-2 border-t border-red-500/15 pt-2",children:[(0,r.jsx)(q,{label:a("liveStatsTitle")}),c&&(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between text-[11px] font-semibold text-foreground",children:[(0,r.jsx)("span",{className:"tabular-nums",children:I(t.possession)}),(0,r.jsx)("span",{className:"text-[10px] font-normal text-muted-foreground",children:a("statPossession")}),(0,r.jsx)("span",{className:"tabular-nums",children:I(s.possession)})]}),(0,r.jsx)(z,{home:t,away:s})]}),(0,r.jsx)("div",{className:"space-y-1",children:i.map(e=>(0,r.jsx)(K,{label:e.label,home:e.home,away:e.away,hint:e.hint},e.label))}),!m&&(0,r.jsx)("p",{className:"mt-1.5 text-[10px] leading-tight text-muted-foreground/70",children:a("liveStatsLimited")})]})}function J(e){let{ev:t,t:s}=e,a=(t.type||"").toLowerCase(),l="goal"===a,n="card"===a,o=n&&(t.detail||"").toLowerCase().includes("red"),d=l?(0,r.jsx)("span",{children:"â½"}):n?(0,r.jsx)("span",{className:`inline-block h-3 w-2 rounded-[1px] ${o?"bg-red-500":"bg-yellow-400"}`}):"subst"===a?(0,r.jsx)("span",{className:"text-emerald-500",children:"â"}):"var"===a?(0,r.jsx)("span",{className:"text-[9px] font-bold text-muted-foreground",children:"VAR"}):(0,r.jsx)("span",{className:"text-muted-foreground/60",children:"â¢"});return(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[(0,r.jsx)("span",{className:"w-7 shrink-0 tabular-nums text-right text-red-500",children:null!=t.elapsed?`${t.elapsed}'`:""}
1),(0,r.jsx)("span",{"aria-hidden":!0,className:"flex w-5 shrink-0 justify-center",children:d}),(0,r.jsxs)("span",{className:"truncate",children:[t.player||t.detail||t.type,l&&t.assist&&(0,r.jsxs)("span",{className:"text-muted-foreground/60",children:[" (",s("assistLabel"),": ",t.assist,")"]}),t.team&&(0,r.jsxs)("span",{className:"text-muted-foreground/60",children:[" \xb7 ",t.team]})]})]})}function Q(e,t){switch(e){case"corners":return t("liveValue.corners");case"cards":return t("liveValue.cards");case"shots":return t("liveValue.shots");case"shots_on":return t("liveValue.shotsOn");case"fouls":return t("liveValue.fouls");case"offsides":return t("liveValue.offsides");case"goals":return t("liveValue.goals")}}function Z(e){let{result:t,t:s}=e,a=t.edge;if(!a)return null;let l=s("OVER"===a.recommendation?"liveValue.over":"liveValue.under"),n=s("liveValue.liveOdds"),o=t.book&&"EXTRA"!==t.book?t.book:null;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border bg-muted/40 px-2 py-1.5 text-[11px]",children:[(0,r.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 font-medium text-foreground",children:[(0,r.jsx)("span",{className:`shrink-0 rounded border px-1 py-0.5 text-[9px] font-bold ${U(a.confidence)}`,children:a.confidence}),(0,r.jsx)("span",{className:"font-semibold",children:Q(t.metric,s)}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[l," ",a.line]}),(0,r.jsxs)("span",{className:"text-muted-foreground/70",children:["\xb7 ",n]})]}),null!=a.recommendedOdd&&(0,r.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[(0,r.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:["@",a.recommendedOdd.toFixed(2)]}),o?` \xb7 ${o}`:""]})]})}function ee(e){let{edge:t,t:s}=e,a=s("OVER"===t.recommendation?"liveValue.over":"liveValue.under");return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border bg-muted/40 px-2 py-1.5 text-[11px]",children:[(0,r.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 font-medium text-foreground",children:[(0,r.jsx)("span",{className:`shrink-0 rounded border px-1 py-0.5 text-[9px] font-bold ${U(t.confidence)}`,children:t.confidence}),(0,r.jsx)("span",{className:"font-semibold",children:function(e,t){let s=[Q(e.metric,t)];return"home"===e.scope?s.push(t("liveValue.scopeHome")):"away"===e.scope&&s.push(t("liveValue.scopeAway")),"1h"===e.period&&s.push(t("liveValue.period1h")),s.join(" \xb7 ")}(t,s)}),(0,r.jsxs)("span",{className:"text-muted-foreground",children:[a," ",t.line]}),(0,r.jsxs)("span",{className:"text-muted-foreground/70",children:["\xb7 ",s("liveValue.liveOdds")]})]}),null!=t.recommendedOdd&&(0,r.jsx)("span",{className:"shrink-0 text-muted-foreground",children:(0,r.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:["@",t.recommendedOdd.toFixed(2)]})})]})}function et(e){let{result:t,t:s}=e,a=t.intervals["75%"];return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 px-2 py-1 text-[11px] text-muted-foreground",children:[(0,r.jsx)("span",{children:Q(t.metric,s)}),(0,r.jsxs)("span",{className:"tabular-nums",children:[s("liveValue.projected")," ",(0,r.jsx)("span",{className:"font-semibold text-foreground",children:t.projected})," ",(0,r.jsxs)("span",{className:"text-muted-foreground/60",children:["(75%: ",a.lower,"â",a.upper,")"]})]})]})}function es(e){var t,s;let{game:a,t:l}=e,n=a.elapsed??0,o={home:{...(null==(t=a.statistics)?void 0:t.home)??{},goals:a.goals_home},away:{...(null==(s=a.statistics)?void 0:s.away)??{},goals:a.goals_away}},d=function(e){let t=(null==e?void 0:e.over_under)??[];if(0===t.length)return{books:[]};let s=new Map;for(let e of t){if(!Number.isFinite(e.line))continue;let t=e.book||"LIVE",r=s.get(t)??{};r[String(e.line)]={over:e.over??null,under:e.under??null},s.set(t,r)}return{books:[...s.entries()].map(e=>{let[t,s]=e;return{name:t,ou:s}})}}(a.live_odds),i=function(e){let t=null==e?void 0:e.stat_lines;if(!t||0===t.length)return;let s={};for(let e of t)"total"===e.scope&&"ft"===e.period&&Number.isFinite(e.line)&&((s[e.metric]??={})[String(e.line)]={over:e.over??null,under:e.under??null});return Object.keys(s).length>0?s:void 0}(a.live_odds),c=(0,O.eg)(a.status_short,a.status_extra),m=(0,O.jV)(o,n,d,i,c),u=function(e,t,s,r,a){let l=null==r?void 0:r.stat_lines;if(!l||0===l.length||!(0,O.t6)(t))return[];let n="1H"===s,o=[];for(let s of l){if("total"===s.scope&&"ft"===s.period||"1h"===s.period&&!n||!Number.isFinite(s.line))continue;let r=O.ZY[s.metric];if(!r||!r.published||t<r.edgeMinElapsed)continue;let l=H((null==e?void 0:e.home)??void 0,s.metric),d=H((null==e?void 0:e.away)??void 0,s.metric),i="home"===s.scope?l:"away"===s.scope?d:l+d;if(i<=0)continue;let c="1h"===s.period?45:a,m=(0,O.QZ)(i,t,{totalMinutes:c,secondHalfWeight:r.backloadWeight}),u=(0,O.QV)(m.projected,m.intervals,s.line,s.over,s.under);u&&o.push({metric:s.metric,scope:s.scope,period:s.period,line:u.line,recommendation:u.recommendation,confidence:u.confidence,recommendedOdd:u.recommendedOdd,projected:u.projected})}let d={"85%+":0,"75%+":1,"65%+":2,OUT_OF_RANGE:3};return o.sort((e,t)=>
1d[e.confidence]-d[t.confidence]||(t.recommendedOdd??-1/0)-(e.recommendedOdd??-1/0))}(a.statistics,n,a.status_short,a.live_odds,c),x=(0,O.mN)(a.status_short),h=x?[]:m.filter(e=>null!=e.edge),p=x?[]:u,g=m.filter(e=>null==e.edge&&e.projected>0),f=h.length>0||p.length>0;return(0,O.t6)(n)?(0,r.jsxs)("div",{className:"mt-2 border-t border-red-500/15 pt-2",children:[(0,r.jsx)(q,{label:l("liveValue.title"),pulse:!0}),(0,r.jsxs)("div",{className:"space-y-1",children:[f?(0,r.jsxs)(r.Fragment,{children:[h.map(e=>(0,r.jsx)(Z,{result:e,t:l},e.metric)),p.map(e=>(0,r.jsx)(ee,{edge:e,t:l},`${e.metric}-${e.scope}-${e.period}-${e.line}`))]}):(0,r.jsx)("div",{className:"rounded-md border border-border bg-muted/40 px-2 py-1.5 text-[11px] text-muted-foreground",children:l("liveValue.noHighConfidence")}),g.map(e=>(0,r.jsx)(et,{result:e,t:l},e.metric))]}),(0,r.jsx)("p",{className:"mt-1.5 text-[10px] leading-tight text-muted-foreground/70",children:l("liveValue.disclaimer")})]}):(0,r.jsx)("div",{className:"mt-2 border-t border-red-500/15 pt-2 text-[11px] text-muted-foreground",children:l("liveValue.waiting")})}function er(e){var t;let{game:s}=e,a=(0,l.c)("Football"),n=(0,o.Ym)(),i=(s.events??[]).slice().sort((e,t)=>(t.elapsed??0)-(e.elapsed??0)).slice(0,6),c=s.statistics,u=!!c,x=i.length>0,h=(0,R.yG)((0,m._t)(s.live_odds),{maxProfitPct:R.K6});return u||x||0!==h.length?(0,r.jsxs)(r.Fragment,{children:[c&&(0,r.jsx)(X,{home:c.home,away:c.away,t:a}),(0,r.jsx)(es,{game:s,t:a}),(0,r.jsx)(D.A,{opportunities:h,homeTeam:(0,d.c)(s.home_team??"",n),awayTeam:(0,d.c)(s.away_team??"",n),updatedAt:null==(t=s.live_odds)?void 0:t.updated_at,compact:!0}),x&&(0,r.jsxs)("div",{className:"mt-2 border-t border-red-500/15 pt-2",children:[(0,r.jsx)(q,{label:a("liveEventsTitle")}),(0,r.jsx)("div",{className:"space-y-0.5",children:i.map((e,t)=>(0,r.jsx)(J,{ev:e,t:a},t))})]})]}):null}function ea(e){let{game:t}=e,s=(0,l.c)("Football");return(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-3 py-1.5",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-red-500",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"h-2 w-2 animate-pulse rounded-full bg-red-500"}),s("liveNow")]}),(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsxs)("span",{className:"text-lg font-bold tabular-nums text-foreground",children:[t.goals_home??0," - ",t.goals_away??0]}),null!=t.elapsed&&(0,r.jsx)("span",{className:"text-[11px] font-semibold text-red-500",children:Y(t.elapsed,t.status_extra)})]})]})}function el(e){let{name:t,rate:s}=e,a=null!=s&&s>=2.7;return(0,r.jsxs)("span",{className:`min-w-0 truncate ${a?"font-semibold text-amber-700 dark:text-amber-300":""}`,children:[t.split(" ")[0]," ",null!=s?s.toFixed(1):"â"]})}function en(e){var t;let{game:s,isPremium:n,cardRank:i,homeCardRate:c,awayCardRate:m,onAnalyzeTeams:h,onLeagueContext:p,onStandings:g}=e,f=(0,l.c)("BlurredPremiumOverlay"),b=(0,l.c)("Football"),j=(0,o.Ym)(),v=(0,d.c)(s.home_team,j),w=(0,d.c)(s.away_team,j),y=i&&i.cardsPerGame>=4.8,N=!!s.statistics||((null==(t=s.events)?void 0:t.length)??0)>0,k=(0,a.useMemo)(()=>(0,P.iB)(s,{home:v,away:w}),[s,v,w]);return(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-3",children:[s.league_name&&(0,r.jsxs)("div",{className:"mb-2 flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"truncate text-[10px] uppercase tracking-wide text-muted-foreground",children:s.league_name}),y&&i&&(0,r.jsxs)("span",{className:"shrink-0 rounded bg-amber-500/20 px-1.5 py-0.5 text-[9px] font-semibold text-amber-700 dark:text-amber-300",title:b("liveValue.highCardLeagueTip"),children:["\uD83D\uDFE8 ",b("liveValue.highCardLeague")," \xb7 ",i.cardsPerGame.toFixed(1),"/",b("liveValue.perGame")," \xb7 #",i.rank]})]}),(null!=c||null!=m)&&(0,r.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 text-[9px] text-muted-foreground",title:b("liveValue.teamCardsTip"),children:[(0,r.jsxs)("span",{className:"shrink-0",children:["\uD83D\uDFE8 ",b("liveValue.teamCards"),":"]}),(0,r.jsx)(el,{name:v,rate:c}
1),(0,r.jsx)("span",{className:"text-muted-foreground/50",children:"\xb7"}),(0,r.jsx)(el,{name:w,rate:m})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s.home_logo&&(0,r.jsx)("img",{src:(0,u.f)(s.home_logo),alt:"",width:20,height:20,className:"h-5 w-5 shrink-0 object-contain"}),(0,r.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:v})]}),(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-center px-2",children:[(0,r.jsxs)("span",{className:"text-lg font-bold tabular-nums text-foreground",children:[s.goals_home??0," - ",s.goals_away??0]}),null!=s.elapsed&&(0,r.jsx)("span",{className:"text-[11px] font-semibold text-red-500",children:Y(s.elapsed,s.status_extra)})]}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-2",children:[(0,r.jsx)("span",{className:"truncate text-right text-sm font-medium text-foreground",children:w}),s.away_logo&&(0,r.jsx)("img",{src:(0,u.f)(s.away_logo),alt:"",width:20,height:20,className:"h-5 w-5 shrink-0 object-contain"})]})]}),N&&(n?(0,r.jsx)(er,{game:s}):(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(x.B2,{message:f("unlockPredictionSection"),compact:!0,children:(0,r.jsx)(er,{game:s})})})),s.league_id&&(h||p||g)&&(0,r.jsxs)("div",{className:"mt-3 flex items-center gap-1.5 border-t border-border pt-3",children:[h&&(0,r.jsxs)("button",{type:"button",onClick:()=>h(s.league_id,s.home_team??"",s.away_team??""),className:"flex min-w-0 flex-1 items-center justify-center gap-1 rounded-lg border border-border bg-muted/50 px-1.5 py-1.5 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:[(0,r.jsx)("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),(0,r.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,r.jsx)("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),(0,r.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),(0,r.jsx)("span",{className:"truncate",children:b("analyzeTeams")})]}),p&&(0,r.jsxs)("button",{type:"button",onClick:()=>p(s.league_id),className:"flex min-w-0 flex-1 items-center justify-center gap-1 rounded-lg border border-border bg-muted/50 px-1.5 py-1.5 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:[(0,r.jsx)("path",{d:"M3 3v18h18"}),(0,r.jsx)("path",{d:"M18 17V9"}),(0,r.jsx)("path",{d:"M13 17V5"}),(0,r.jsx)("path",{d:"M8 17v-3"})]}),(0,r.jsx)("span",{className:"truncate",children:b("leagueContext")})]}),g&&(0,r.jsxs)("button",{type:"button",onClick:()=>g(s.league_id),className:"flex min-w-0 flex-1 items-center justify-center gap-1 rounded-lg border border-border bg-muted/50 px-1.5 py-1.5 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:[(0,r.jsx)("line",{x1:"8",x2:"21",y1:"6",y2:"6"}),(0,r.jsx)("line",{x1:"8",x2:"21",y1:"12",y2:"12"}),(0,r.jsx)("line",{x1:"8",x2:"21",y1:"18",y2:"18"}),(0,r.jsx)("line",{x1:"3",x2:"3.01",y1:"6",y2:"6"}),(0,r.jsx)("line",{x1:"3",x2:"3.01",y1:"12",y2:"12"}),(0,r.jsx)("line",{x1:"3",x2:"3.01",y1:"18",y2:"18"})]}),(0,r.jsx)("span",{className:"truncate",children:b("tabs.standings")})]})]}),(0,r.jsx)(W.A,{game:k})]})}function eo(e){let{label:t,open:s,onToggle:a}=e;return(0,r.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,r.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,r.jsxs)("button",{type:"button",onClick:a,"aria-expanded":s,className:"flex items-center gap-1.5 rounded-full border border-border bg-muted px-2.5 py-1 text-[10px] font-bold uppercase tracking-wide text-foreground transition-colors hover:border-emerald-500/50 hover:bg-emerald-500/5 hover:text-emerald-600 dark:hover:text-emerald-400",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:[(0,r.jsx)("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),(0,r.jsx)("path",{d:"M3 10h18"}),(0,r.jsx)("path",{d:"M8 2v4"}),(0,r.jsx)("path",{d:"M16 2v4"})]}),t,(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:`transition-transform ${s?"rotate-180":""}`,children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})]}),(0,r.jsx)("span",{className:"h-px flex-1 bg-border"})]})}function ed(e){let{books:t,homeTeam:s,awayTeam:n}=e,o=(0,l.c)("Football"),[d,i]=(0,a.useState)("main"),[c,m]=(0,a.useState)(!1),u=(e,t)=>
1s=>{var r,a;return(null==(a=s.ou)||null==(r=a[e])?void 0:r[t])??("2.5"===e?s[t]:null)??null},x=(e,t)=>s=>{var r,a;return(null==(a=s.fhOu)||null==(r=a[e])?void 0:r[t])??null},h=(e,t)=>s=>{var r,a;return(null==(a=s.cornersOu)||null==(r=a[e])?void 0:r[t])??null},p=e=>o("oddsCol.over",{line:e}),g=e=>o("oddsCol.under",{line:e}),f=[{id:"main",label:o("oddsMarket.main"),cols:[{key:"h",header:"1",get:e=>e.home},{key:"d",header:"X",get:e=>e.draw},{key:"a",header:"2",get:e=>e.away},{key:"o25",header:p("2.5"),get:u("2.5","over")},{key:"u25",header:g("2.5"),get:u("2.5","under")}]},{id:"goals",label:o("oddsMarket.goals"),hint:o("oddsMarket.goalsHint"),cols:[{key:"o15",header:p("1.5"),get:u("1.5","over")},{key:"u15",header:g("1.5"),get:u("1.5","under")},{key:"o25",header:p("2.5"),get:u("2.5","over")},{key:"u25",header:g("2.5"),get:u("2.5","under")},{key:"o35",header:p("3.5"),get:u("3.5","over")},{key:"u35",header:g("3.5"),get:u("3.5","under")}]},{id:"btts",label:o("oddsMarket.btts"),hint:o("oddsMarket.bttsHint"),cols:[{key:"by",header:o("oddsCol.yes"),get:e=>e.bttsYes??null},{key:"bn",header:o("oddsCol.no"),get:e=>e.bttsNo??null}]},{id:"doubleChance",label:o("oddsMarket.doubleChance"),hint:o("oddsMarket.doubleChanceHint",{home:s,away:n}),cols:[{key:"1x",header:o("oddsCol.dc1x"),get:e=>e.dc1x??null},{key:"12",header:o("oddsCol.dc12"),get:e=>e.dc12??null},{key:"x2",header:o("oddsCol.dcx2"),get:e=>e.dcx2??null}]},{id:"corners",label:o("oddsMarket.corners"),hint:o("oddsMarket.cornersHint"),cols:[{key:"o85",header:p("8.5"),get:h("8.5","over")},{key:"u85",header:g("8.5"),get:h("8.5","under")},{key:"o95",header:p("9.5"),get:h("9.5","over")},{key:"u95",header:g("9.5"),get:h("9.5","under")},{key:"o105",header:p("10.5"),get:h("10.5","over")},{key:"u105",header:g("10.5"),get:h("10.5","under")}]},{id:"firstHalf",label:o("oddsMarket.firstHalf"),hint:o("oddsMarket.firstHalfHint"),cols:[{key:"h",header:"1",get:e=>e.fhHome??null},{key:"d",header:"X",get:e=>e.fhDraw??null},{key:"a",header:"2",get:e=>e.fhAway??null},{key:"o05",header:p("0.5"),get:x("0.5","over")},{key:"u05",header:g("0.5"),get:x("0.5","under")},{key:"o15",header:p("1.5"),get:x("1.5","over")},{key:"u15",header:g("1.5"),get:x("1.5","under")}]},{id:"asianHandicap",label:o("oddsMarket.asianHandicap"),hint:o("oddsMarket.asianHandicapHint"),compare:!1,cols:[{key:"ahl",header:o("oddsCol.ahLine"),get:e=>e.ahLine??null,signed:!0},{key:"ahh",header:"1",get:e=>e.ahHome??null},{key:"aha",header:"2",get:e=>e.ahAway??null}]}].filter(e=>e.cols.some(e=>t.some(t=>null!==e.get(t))));if(0===f.length)return null;let b=f.find(e=>e.id===d)??f[0],j=b.cols.map(e=>{if(!1===b.compare||e.signed)return null;let s=t.map(e.get).filter(e=>"number"==typeof e);return s.length?Math.max(...s):null});return(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>m(e=>!e),"aria-expanded":c,className:"flex w-fit items-center gap-1 rounded-lg border border-emerald-500/40 bg-emerald-500/5 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide text-emerald-600 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 active:bg-emerald-500/15 dark:text-emerald-400",children:[o("oddsTitle"),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:`transition-transform ${c?"rotate-180":""}`,children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})]}),c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-1 mt-1 text-[10px] text-muted-foreground",children:(0,r.jsxs)("span",{className:"truncate",children:["1 = ",s," \xb7 X = ",o("draw")," \xb7 2 = ",n]})}),f.length>1&&(0,r.jsx)("div",{className:"-mx-1 mb-1.5 flex gap-1 overflow-x-auto px-1 pb-0.5",children:f.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>i(e.id),className:`whitespace-nowrap rounded-full px-2.5 py-1 text-[10px] font-semibold transition-colors ${e.id===b.id?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/70"}`,children:e.label},e.id))}),b.hint&&(0,r.jsx)("p",{className:"mb-1.5 text-[10px] leading-snug text-muted-foreground",children:b.hint}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full border-collapse text-[11px]",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-border text-[10px] uppercase text-muted-foreground",children:[(0,r.jsx)("th",{className:"px-1 py-0.5 text-left font-medium",children:o("book")}),b.cols.map(e=>(0,r.jsx)("th",{className:"whitespace-nowrap px-1 py-0.5 text-center font-medium",children:e.header},e.key))]})}),(0,r.jsx)("tbody",{children:t.map(e=>(0,r.jsxs)("tr",{className:"border-b border-border/50 last:border-0",children:[(0,r.jsx)("td",{className:"max-w-[90px] truncate px-1 py-0.5 text-left text-muted-foreground",title:e.name,children:e.name}),b.cols.map((t,s)=>{let a=t.get(e),l=j[s],n=null===a?"â":t.signed?`${a>0?"+":a<0?"â":""}${Math.abs(a)}`:a.toFixed(2);return(0,r.jsx)("td",{className:`px-1 py-0.5 text-center tabular-nums ${null!==a&&null!==l&&a===l?"font-bold text-green-600 dark:text-green-400":"text-foreground"}`,children:n},t.key)})]},e.name))})]})})]})]})}let ei=(0,a.memo)(e=>{var t;let{game:s,isPremium:n=!1,isFreePreview:i=!1,live:c=null,canClaimFree:h=!1,onClaimFree:p,onAnalyzeTeams:g,onLeagueContext:f,onStandings:b}=e,j=(0,l.c)("Football"),v=(0,l.c)("BlurredPremiumOverlay"),w=(0,o.Ym)(),[N,k]=(0,a.useState)(!1),[_,F]=(0,a.useState)(!1),C=e=>{e.stopPropagation(),k(e=>!e)},M=(0,d.c)(s.home_team,w),$=(0,d.c)(s.away_team,w),E=(0,a.useMemo)(()=>(0,m.yp)(s),[s.odds]),L=(0,a.useMemo)(()=>(0,P.WL)(s,c,{home:M,away:$}),[s,c,M,$]),S=!!(c&&(c.statistics||((null==(t=c.events)?void 0:t.length)??0)>0)),A=s.decision_tree,O=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return null==e?"â":e.toFixed(t)},H=e=>null==e?"â":`${Math.round(100*e)}
1%`,V=new Date(s.game_date).toLocaleString(w,{weekday:"short",day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}),R=s.win_probability_home??0,U=s.win_probability_draw??0,q=s.win_probability_away??0,G=s.extra_predictions,I=G?[{key:"shots",label:j("shots"),v:G.shots},{key:"shotsTarget",label:j("shotsTarget"),v:G.shots_target},{key:"htGoals",label:j("htGoals"),v:G.ht_goals},{key:"cards",label:j("cards"),v:G.cards},{key:"fouls",label:j("fouls"),v:G.fouls},{key:"offsides",label:j("offsides"),v:G.offsides}].filter(e=>e.v&&null!==e.v.total):[],Y=e=>{let t=(e??"").toUpperCase();return"HOME"===t?M:"AWAY"===t?$:j("draw")},z=Array.isArray(s.recommended_picks)?[...s.recommended_picks].sort((e,t)=>Number(t.is_primary)-Number(e.is_primary)||t.model_prob-e.model_prob):[],K=null!==s.win_probability_home&&null!==s.win_probability_away?{home:R,draw:U,away:q}:null,X=(()=>{let e=s.odds;if(!(null==e?void 0:e.home)||!(null==e?void 0:e.draw)||!(null==e?void 0:e.away))return null;let t=[1/e.home,1/e.draw,1/e.away],r=t[0]+t[1]+t[2];return r>0?{home:t[0]/r,draw:t[1]/r,away:t[2]/r}:null})(),J=e=>e.home>=e.draw&&e.home>=e.away?"home":e.away>=e.draw?"away":"draw",Q=e=>"home"===e?M:"away"===e?$:j("draw"),Z=K?J(K):null,ee=X?J(X):null,et=null!==Z&&null!==ee&&Z!==ee;return(0,r.jsx)("div",{className:"relative",style:{perspective:"1000px"},children:(0,r.jsxs)("div",{className:`relative transition-transform duration-500 ${N?"[transform:rotateY(180deg)]":""}`,style:{transformStyle:"preserve-3d"},children:[(0,r.jsxs)("div",{className:`rounded-xl border bg-card p-4 shadow-sm transition-shadow hover:shadow-md ${c?"border-red-500/40 ring-1 ring-red-500/30":"border-border"} ${N?"absolute inset-0 invisible":"relative"}`,style:{backfaceVisibility:"hidden"},children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-sm font-bold text-foreground",children:[s.home_logo&&(0,r.jsx)("img",{src:(0,u.f)(s.home_logo),alt:"",loading:"lazy",className:"h-5 w-5 shrink-0 object-contain"}),(0,r.jsx)("span",{className:"truncate",children:M}),(0,r.jsx)("span",{className:"shrink-0 font-normal text-muted-foreground",children:"x"}),s.away_logo&&(0,r.jsx)("img",{src:(0,u.f)(s.away_logo),alt:"",loading:"lazy",className:"h-5 w-5 shrink-0 object-contain"}),(0,r.jsx)("span",{className:"truncate",children:$})]}),(0,r.jsx)("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:V})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,r.jsx)(T.A,{sport:"football",gameId:s.api_fixture_id,gameDate:s.game_date,unlockScope:"football",canSubscribe:n||i,size:16}),(0,r.jsxs)("button",{type:"button",onClick:C,className:"flex shrink-0 items-center gap-1 rounded-lg border border-border bg-muted/50 px-2 py-1 text-[10px] font-medium text-muted-foreground transition-colors hover:border-emerald-500/50 hover:bg-emerald-500/5 hover:text-emerald-600 dark:hover:text-emerald-400",title:j("flipCard.flipToStats"),children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-emerald-500",children:[(0,r.jsx)("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),(0,r.jsx)("path",{d:"M21 3v5h-5"}),(0,r.jsx)("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),(0,r.jsx)("path",{d:"M8 16H3v5"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:j("flipCard.stats")})]})]})]}),c&&(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)(ea,{game:c}),S&&(n||i)&&(0,r.jsx)(er,{game:c})]}),(()=>{var e;let t=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mt-3 grid grid-cols-3 gap-2 text-center",children:[(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 p-2",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:j("goals")}),(0,r.jsxs)("div",{className:"text-lg font-bold text-foreground",children:[O(s.pred_goals_home)," ",(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"})," ",O(s.pred_goals_away)]}),(0,r.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:[j("total"),": ",O(s.pred_goals_total)]}),null!==s.pred_xg_home&&null!==s.pred_xg_away&&(0,r.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:[j("xg"),": ",O(s.pred_xg_home,1)," - ",O(s.pred_xg_away,1)]})]}),(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 p-2",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:j("corners")}),(0,r.jsx)("div",{className:"text-lg font-bold text-foreground",children:null===s.pred_corners_total?(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:j("noCorners")}):(0,r.jsxs)(r.Fragment,{children:[O(s.pred_corners_home,1)," ",(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"})," ",O(s.pred_corners_away,1)]})}),null!==s.pred_corners_total&&(0,r.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:[j("total"),": ",O(s.pred_corners_total)]})]}),(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 p-2",title:et?j("favoriteSplit",{model:Q(Z),market:Q(ee)}):void 0,children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:j("edge")}),(0,r.jsx)("div",{className:`text-sm font-bold leading-tight ${et?"text-amber-600 dar
1k:text-amber-400":"text-foreground"}`,children:et?j("favoriteUndefined"):Z?Q(Z):(null==A?void 0:A.edge)==="even"?j("edgeValue.even"):(null==A?void 0:A.edge)?Y(A.edge):"â"})]})]}),I.length>0&&(0,r.jsx)("div",{className:"mt-2 grid grid-cols-2 gap-2 text-center sm:grid-cols-4",children:I.map(e=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 p-2",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e.label}),(0,r.jsxs)("div",{className:"text-base font-bold text-foreground",children:[O(e.v.home)," ",(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"})," ",O(e.v.away)]}),(0,r.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:[j("total"),": ",O(e.v.total)]})]},e.key))}),(null==G?void 0:G.referee)&&(0,r.jsxs)("p",{className:"mt-2 text-[10px] leading-snug text-muted-foreground",children:["\uD83E\uDDD1ââï¸ ",j("refereeNote",{name:G.referee.name,avg:G.referee.cards_avg.toFixed(1),games:G.referee.games})]}),(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsxs)("div",{className:"flex h-5 w-full overflow-hidden rounded-full text-[10px] font-bold text-white",children:[(0,r.jsx)("div",{className:`flex items-center justify-center ${R>=q?"bg-green-600":"bg-red-500"}`,style:{width:`${100*R}%`},children:R>=.12?H(R):""}),(0,r.jsx)("div",{className:"flex items-center justify-center bg-slate-300 text-slate-700",style:{width:`${100*U}%`},children:U>=.12?H(U):""}),(0,r.jsx)("div",{className:`flex items-center justify-center ${q>R?"bg-green-600":"bg-red-500"}`,style:{width:`${100*q}%`},children:q>=.12?H(q):""})]}),(0,r.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2 text-[10px] text-muted-foreground",children:[(0,r.jsx)("span",{className:"max-w-[42%] truncate",children:M}),(0,r.jsx)("span",{className:"shrink-0",children:j("draw")}),(0,r.jsx)("span",{className:"max-w-[42%] truncate text-right",children:$})]})]}),(null==G?void 0:G.markets)&&(0,r.jsxs)("div",{className:"mt-3 rounded-lg bg-muted/50 p-3",children:[(0,r.jsx)("div",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:j("marketProbsTitle")}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-foreground",children:[(0,r.jsxs)("span",{children:[j("btts"),": ",(0,r.jsx)("b",{children:H(G.markets.btts)})]}),(0,r.jsxs)("span",{children:[j("oddsCol.over",{line:"1.5"}),": ",(0,r.jsx)("b",{children:H(G.markets.over["1.5"])})]}),(0,r.jsxs)("span",{children:[j("oddsCol.over",{line:"2.5"}),": ",(0,r.jsx)("b",{children:H(G.markets.over["2.5"])})]}),(0,r.jsxs)("span",{children:[j("oddsCol.over",{line:"3.5"}),": ",(0,r.jsx)("b",{children:H(G.markets.over["3.5"])})]}),(0,r.jsxs)("span",{children:[j("cleanSheet"),": ",(0,r.jsx)("b",{children:H(G.markets.clean_sheet.home)})," / ",(0,r.jsx)("b",{children:H(G.markets.clean_sheet.away)})]})]}),G.markets.top_scores&&G.markets.top_scores.length>0&&(0,r.jsxs)("div",{className:"mt-1.5 text-[11px] text-muted-foreground",children:[j("likelyScores"),":"," ",G.markets.top_scores.map((e,t)=>(0,r.jsxs)("span",{className:"text-foreground",children:[t>0&&(0,r.jsx)("span",{className:"text-muted-foreground",children:" \xb7 "}),(0,r.jsx)("b",{children:e.score})," (",H(e.p),")"]},e.score))]})]}),z.length>0?(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("div",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:j("recommendedPicksTitle")}),(0,r.jsx)("div",{className:"flex flex-col gap-1.5",children:z.map(e=>(0,r.jsxs)("div",{className:`flex items-center justify-between gap-2 rounded-md border px-2 py-1.5 text-[11px] ${e.is_primary?"border-emerald-500/40 bg-emerald-500/10":"border-border bg-muted/40"}`,children:[(0,r.jsxs)("span",{className:"flex items-center gap-1.5 font-medium text-foreground",children:[(0,r.jsx)("span",{className:`rounded border px-1 py-0.5 text-[9px] font-bold ${(e=>"85%+"===e?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border-emerald-500/30":"75%+"===e?"bg-amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/30":"bg-sky-500/15 text-sky-600 dark:text-sky-400 border-sky-500/30")(e.confidence_band)}`,children:e.confidence_band}),(e=>{let t=e.line;switch(e.strategy_key){case"match_result":return`${j("pickWin")} ${Y(e.selection)}`;case"double_chance":return"1X"===e.selection?`${M} ${j("pickOrDraw")}`:"X2"===e.selection?`${$} ${j("pickOrDraw")}`:`${M} ${j("pickOr")} ${$}`;case"over_under":return`${j(`ouSide.${e.selection.toLowerCase()}`)} ${t} ${j("goalsWord")}`;case"corners_ou":return`${j(`ouSide.${e.selection.toLowerCase()}`)} ${t} ${j("cornersWord")}`;case"btts":return"YES"===e.selection?j("pickBttsYes"):j("pickBttsNo");case"ht_over_under":return"OVER"===e.selection?j("pickGoal1H"):j("pickNoGoal1H");default:return`${e.selection}${null!=t?` ${t}`:""}`}})(e),(0,r.jsxs)("span",{className:"text-muted-foreground",children:["\xb7 ",H(e.model_prob)]})]}),null!=e.odds&&(0,r.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[(0,r.jsxs)("span",{className:"font-semibold text-foreground",children:["@",e.odds.toFixed(2)]}),e.book?` \xb7 ${e.book}`:""]})]},e.strategy_key))}),(0,r.jsx)("p",{className:"mt-1 text-[10px] leading-snug text-muted-foreground",children:j("recommendedPicksNote")})]}):(0,r.jsx)("p",{className:"mt-3 text-[11px] text-muted-foreground",children:j("noStrongPick")}),s.api_prediction&&(s.api_prediction.advice||s.api_prediction.winner_name)&&(0,r.jsxs)("div",{className:"mt-3 rounded-lg border border-border bg-muted/30 p-2.5",children:[(0,r.jsx)("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:j("apiSignalTitle")}),s.api_prediction.advice&&(0,r.jsxs)("div",{className:"text-[11px] text-foreground",children:[(0,r.jsxs)("span",{className:"font-semibold",children:[j("apiAdvice"),":"]})," ",s.api_prediction.advice]}),(s.api_prediction.percent_home||s.api_prediction.percent_away)&&(0,r.jsxs)("div",{className:"mt-0.5 flex flex-wrap gap-x-3 text-[10px] text-muted-foreground",children:[(0,r.jsxs)("span",{children:[M,": ",s.api_prediction.percent_home??"â"]}),(0,r.jsxs)("span",{children:[j("draw"),": ",s.api_prediction.percent_draw??"â"]}
1),(0,r.jsxs)("span",{children:[$,": ",s.api_prediction.percent_away??"â"]})]}),(0,r.jsx)("p",{className:"mt-1 text-[9px] italic text-muted-foreground/70",children:j("apiSignalNote")})]}),(null==(e=s.odds)?void 0:e.books)&&s.odds.books.length>0&&(0,r.jsx)(ed,{books:s.odds.books,homeTeam:M,awayTeam:$}),(0,r.jsx)(D.A,{opportunities:E,homeTeam:M,awayTeam:$,updatedAt:null}),s.lineups&&s.lineups.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-1.5 mt-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:j("lineupsTitle")}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:s.lineups.map((e,t)=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 p-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[e.logo&&(0,r.jsx)("img",{src:(0,u.f)(e.logo),alt:"",loading:"lazy",className:"h-4 w-4 shrink-0 object-contain"}),(0,r.jsx)("span",{className:"truncate text-[11px] font-semibold text-foreground",children:(0,d.c)(e.team,w)})]}),(0,r.jsxs)("div",{className:"mt-0.5 text-[10px] text-muted-foreground",children:[e.formation&&(0,r.jsxs)("span",{children:[j("formation"),": ",e.formation]}),e.formation&&e.coach&&(0,r.jsx)("span",{children:" \xb7 "}),e.coach&&(0,r.jsxs)("span",{children:[j("coach"),": ",e.coach]})]}),(0,r.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.startXI.map((e,t)=>(0,r.jsxs)("span",{className:"rounded border border-border bg-background px-1.5 py-0.5 text-[10px] text-foreground",children:[null!==e.number&&void 0!==e.number?`${e.number} `:"",e.name]},t))})]},t))})]})]}),a=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mt-3 grid grid-cols-3 gap-2 text-center",children:[{label:j("goals"),v:"1.4 - 1.2"},{label:j("corners"),v:"5.2 - 4.8"},{label:j("edge"),v:"â"}].map(e=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/50 p-2",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e.label}),(0,r.jsx)("div",{className:"text-sm font-bold leading-tight text-foreground",children:e.v})]},e.label))}),(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsxs)("div",{className:"flex h-5 w-full overflow-hidden rounded-full text-[10px] font-bold text-white",children:[(0,r.jsx)("div",{className:"flex items-center justify-center bg-slate-400",style:{width:"38%"},children:"38%"}),(0,r.jsx)("div",{className:"flex items-center justify-center bg-slate-300 text-slate-700",style:{width:"24%"},children:"24%"}),(0,r.jsx)("div",{className:"flex items-center justify-center bg-slate-400",style:{width:"38%"},children:"38%"})]}),(0,r.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2 text-[10px] text-muted-foreground",children:[(0,r.jsx)("span",{className:"max-w-[42%] truncate",children:M}),(0,r.jsx)("span",{className:"shrink-0",children:j("draw")}),(0,r.jsx)("span",{className:"max-w-[42%] truncate text-right",children:$})]})]}),(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("div",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:j("recommendedPicksTitle")}),(0,r.jsx)("div",{className:"space-y-1.5",children:[0,1].map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 px-2 py-2",children:[(0,r.jsx)("span",{className:"h-2.5 w-28 rounded bg-muted-foreground/25"}),(0,r.jsx)("span",{className:"h-2.5 w-10 rounded bg-muted-foreground/25"})]},e))})]}),(0,r.jsx)("div",{className:"mt-3 space-y-1.5",children:[0,1,2].map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsx)("span",{className:"h-2.5 w-16 rounded bg-muted-foreground/20"}),(0,r.jsx)("span",{className:"h-2.5 flex-1 rounded bg-muted-foreground/10"})]},e))})]}),l=n||i?t:(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)(x.B2,{message:h?v("freeUnlockPrompt"):v("unlockPredictionSection"),actionLabel:h?v("freeUnlockCta"):void 0,onAction:h?p:void 0,align:c?"top":"center",compact:!0,children:a})});return c&&(n||i)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eo,{label:j("preGameLabel"),open:_,onToggle:()=>F(e=>!e)}),_&&l]}):l})(),(g||f||b)&&(0,r.jsxs)("div",{className:"mt-3 flex items-center gap-1.5 border-t border-border pt-3",children:[g&&(0,r.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),g(s.league_id,s.home_team,s.away_team)},className:"flex min-w-0 flex-1 items-center justify-center gap-1 rounded-lg border border-border bg-muted/50 px-1.5 py-1.5 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:[(0,r.jsx)("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),(0,r.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,r.jsx)("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),(0,r.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),(0,r.jsx)("span",{className:"truncate",children:j("analyzeTeams")})]}),f&&(0,r.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),f(s.league_id)},className:"flex min-w-0 flex-1 items-center justify-center gap-1 rounded-lg border border-border bg-muted/50 px-1.5 py-1.5 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:[(0,r.jsx)("path",{d:"M3 3v18h18"}),(0,r.jsx)("path",{d:"M18 17V9"}),(0,r.jsx)("path",{d:"M13 17V5"}),(0,r.jsx)("path",{d:"M8 17v-3"})]}),(0,r.jsx)("span",{className:"truncate",children:j("leagueContext")})]}),b&&(0,r.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),b(s.league_id)},className:"flex min-w-0 flex-1 items-center justify-center gap-1 rounded-lg border border-border bg-muted/50 px-1.5 py-1.5 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:[(0,r.jsx)("line",{x1:"8",x2:"21",y1:"6",y2:"6"}),(0,r.jsx)("line",{x1:"8",x2:"21",y1:"12",y2:"12"}),(0,r.jsx)("line",{x1:"8",x2:"21",y1:"18",y2:"18"}),(0,r.jsx)("line",{x1:"3",x2:"3.01",y1:"6",y2:"6"}),(0,r.jsx)("line",{x1:"3",x2:"3.01",y1:"12",y2:"12"}),(0,r.jsx)("line",{x1:"3",x2:"3.01",y1:"18",y2:"18"})]}),(0,r.jsx)("span",{className:"truncate",children:j("tabs.standings")})]})]}),(0,r.jsx)(W.A,{game:L})]}),(0,r.jsx)("div",{className:`rounded-xl border border-emerald-500/30 bg-card p-4 shadow-sm [transform:rotateY(180deg)] ${N?"relative":"absolute inset-0 invisible"}`,style:{backfaceVisibility:"hidden"},children:(0,r.jsxs)("div",{className:"flex h-full flex-col",children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-emerald-500",children:[(0,r.jsx)("path",{d:"M3 3v18h18"}),(0,r.jsx)("path",{d:"m19 9-5 5-4-4-3 3"})]}),(0,r.jsx)("span",{className:"text-xs font-bold text-emerald-600 dark:text-emerald-400",children:j("flipCard.title")})]}),(0,r.jsx)("button",{type:"button",onClick:C,className:"rounded-md p-1 text-muted-foreground
1/70 transition-colors hover:bg-emerald-500/5 hover:text-emerald-600 dark:hover:text-emerald-400",title:j("flipCard.backToGame"),children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"min-h-0 flex-1",children:(0,r.jsx)(y,{homeTeam:s.home_team,awayTeam:s.away_team,leagueId:s.league_id,isPremium:n||i,children:(0,r.jsx)(B,{decisionTree:A,injuries:s.injuries,homeName:M,awayName:$,locale:w,unlocked:n||i,canClaimFree:h,onClaimFree:p})})})]})})]})})});ei.displayName="FootballGameCard";let ec=null,em=null,eu=["today","yesterday","week","month"],ex=["total","live","pregame"],eh=["total","match_result","over_under","double_chance","btts","corners_ou","ht_over_under"],ep=["all","goals","corners","cards","shots"],eg={settled:0,wins:0,losses:0,pushes:0,netUnits:0,winRate:null,roi:null};function ef(e){let{label:t,b:s}=e,a=(0,l.c)("Football"),n=s.settled>0,o=s.netUnits>=0;return(0,r.jsxs)("div",{className:"flex flex-col gap-1 rounded-xl border border-[#FF6B00]/20 bg-white/40 p-2.5 backdrop-blur-sm dark:bg-slate-800/50",children:[(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-[#FF6B00]",children:t}),n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,r.jsx)("span",{className:"text-2xl font-bold leading-none text-foreground",children:null!==s.winRate?`${Math.round(s.winRate)}%`:"â"}),(0,r.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground",children:a("resultsWr")})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-1.5 text-[11px]",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[(0,r.jsx)("span",{className:"font-semibold text-emerald-500",children:s.wins}),(0,r.jsx)("span",{className:"mx-px",children:"-"}),(0,r.jsx)("span",{className:"font-semibold text-red-500",children:s.losses})]}),(0,r.jsx)("span",{className:`font-semibold ${o?"text-emerald-500":"text-red-500"}`,children:function(e){let t=Math.round(10*e)/10,s=t>0?"+":"";return`${s}${t.toFixed(1)}u`}(s.netUnits)})]}),null!==s.roi&&(0,r.jsxs)("span",{className:"text-[10px] text-muted-foreground/60",children:[a("resultsRoi")," ",Math.round(s.roi),"%"]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-2xl font-bold leading-none text-muted-foreground/50",children:"-/-"}),(0,r.jsx)("span",{className:"text-[10px] text-muted-foreground/70",children:a("resultsNone")})]})]})}function eb(e){let{section:t,pregameGroup:s,liveMarket:n}=e,d=(0,l.c)("Football"),c=(0,o.Ym)(),{months:m,isLoading:u,error:x}=function(e){let[t,s]=(0,a.useState)(()=>ec?ec.data:null),[r,l]=(0,a.useState)(!1),[n,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;let t=!0;return ec&&Date.now()-ec.timestamp<3e5?void s(ec.data):(l(!0),em||(em=(0,i.HY)().then(e=>(ec={data:e,timestamp:Date.now()},e)).finally(()=>{em=null})),em.then(e=>{t&&(s(e),o(null),l(!1))}).catch(e=>{t&&(o(e instanceof Error?e.message:"Failed to load history"),l(!1))}),()=>{t=!1})},[e]),{months:t,isLoading:r,error:n}}(!0),[h,p]=(0,a.useState)(0);if(u&&!m)return(0,r.jsx)("p",{className:"mt-3 text-[11px] text-muted-foreground",children:d("resultsHistoryLoading")});if(x)return(0,r.jsx)("p",{className:"mt-3 text-[11px] text-muted-foreground",children:d("resultsHistoryError")});if(!m||0===m.length)return(0,r.jsx)("p",{className:"mt-3 text-[11px] text-muted-foreground",children:d("resultsEmpty")});let g="total"===t?"total":"live"===t?`live:${n}`:`pregame:${s}`,f=Math.ceil(m.length/6),b=Math.min(Math.max(h,0),f-1),j=m.slice(6*b,6*b+6);return(0,r.jsxs)("div",{className:"mt-3 border-t border-[#FF6B00]/15 pt-3",children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2 px-1",children:[(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:d("resultsMonthlyTitle")}),f>1&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>p(b-1),disabled:0===b,"aria-label":d("resultsHistoryNewer"),className:"flex h-5 w-5 items-center justify-center rounded-md border border-[#FF6B00]/20 text-[#FF6B00] transition-colors hover:bg-[#FF6B00]/10 disabled:cursor-not-allowed disabled:opacity-30",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("path",{d:"m15 18-6-6 6-6"})})}),(0,r.jsxs)("span",{className:"text-[10px] tabular-nums text-muted-foreground",children:[b+1,"/",f]}),(0,r.jsx)("button",{type:"button",onClick:()=>p(b+1),disabled:b>=f-1,"aria-label":d("resultsHistoryOlder"),className:"flex h-5 w-5 items-center justify-center rounded-md border border-[#FF6B00]/20 text-[#FF6B00] transition-colors hover:bg-[#FF6B00]/10 disabled:cursor-not-allowed disabled:opacity-30",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("path",{d:"m9 18 6-6-6-6"})})})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-3",children:j.map(e=>(0,r.jsx)(ef,{label:function(e,t){let[s,r]=e.split("-").map(Number),a=new Date(s,(r||1)-1,1).toLocaleDateString(t,{month:"short",year:"numeric"});return a.charAt(0).toUpperCase()+a.slice(1)}(e.month,c),b:e.groups[g]??eg},e.month))})]})}function ej(){let e=(0,l.c)("Football"),[t,s]=(0,a.useState)(null),[n,o]=(0,a.useState)(null),[d,c]=(0,a.useState)(!0),[m,u]=(0,a.useState)("total"),[x,h]=(0,a.useState)("total"),[p,g]=(0,a.useState)("all"),[f,b]=(0,a.useState)(!1),[j,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=!0;return(async()=>{let[t,r]=await Promise.all([(0,i.GY)(),(0,i.SD)()]);e&&(s(t),o(r),c(!1))})(),()=>{e=!1}},[]);let w=(0,a.useMemo)(()=>eu.map(e=>{var s,r,a,l;let o;return o="total"===m?function(e,t){let s=e.wins+t.wins,r=e.losses+t.losses,a=e.settled+t.settled,l=e.netUnits+t.netUnits,n=s+r;return{settled:a,wins:s,losses:r,pushes:e.pushes+t.pushes,netUnits:l,winRate:n>0?s/n*100:null,roi:a>0?l/a*100:null}}((null==t||null==(s=t.total)?void 0:s[e])??eg,(null==n||null==(r=n.all)?void 0:r[e])??eg):"live"===m?(null==n||null==(a=n[p])?void 0:a[e])??eg:(null==t||null==(l=t[x])?void 0:l[e])??eg,{period:e,b:o}}),[t,n,m,x,p]),y=(0,a.useMemo)(()=>w.some(e=>{let{b:t}=e;return t.settled>0}),[w]);return d?(0,r.jsx)("div",{className:"mb-4 h-28 animate-pulse rounded-2xl border border-[#FF6B00]/20 bg-[#FF6B00]/[
10.04]"}):(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsxs)("div",{className:"rounded-2xl border border-[#FF6B00]/20 bg-[#FF6B00]/[0.04] p-3 backdrop-blur-sm md:p-4",children:[(0,r.jsxs)("div",{className:"mb-2.5 flex flex-wrap items-center justify-between gap-2 px-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[#FF6B00]",children:[(0,r.jsx)("path",{d:"M3 3v18h18"}),(0,r.jsx)("path",{d:"m19 9-5 5-4-4-3 3"})]}),(0,r.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wider text-foreground",children:e("resultsTitle")}),(0,r.jsx)("button",{type:"button",onClick:()=>b(e=>!e),"aria-label":e("resultsInfoTitle"),"aria-expanded":f,className:`flex h-5 w-5 items-center justify-center rounded-full border transition-colors ${f?"border-[#FF6B00] bg-[#FF6B00] text-white":"border-[#FF6B00]/40 text-[#FF6B00] hover:bg-[#FF6B00]/10"}`,children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("path",{d:"M12 16v-4"}),(0,r.jsx)("path",{d:"M12 8h.01"})]})})]}),(0,r.jsx)("div",{className:"inline-flex gap-0.5 rounded-lg border border-[#FF6B00]/20 bg-white/40 p-0.5 dark:bg-slate-800/50",children:ex.map(t=>(0,r.jsx)("button",{type:"button",onClick:()=>u(t),className:`rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors ${m===t?"bg-[#FF6B00] text-white":"text-muted-foreground hover:text-foreground"}`,children:e(`resultsSection.${t}`)},t))})]}),f&&(0,r.jsxs)("div",{className:"mb-3 space-y-1.5 rounded-xl border border-[#FF6B00]/20 bg-white/50 p-3 text-[11px] leading-relaxed text-muted-foreground dark:bg-slate-800/60",children:[(0,r.jsx)("p",{className:"font-semibold text-foreground",children:e("resultsInfoTitle")}),(0,r.jsx)("p",{children:e("resultsInfoPregame")}),(0,r.jsx)("p",{children:e("resultsInfoLive")}),(0,r.jsx)("p",{children:e("resultsInfoWr")}),(0,r.jsx)("p",{children:e("resultsInfoUnits")}),(0,r.jsx)("p",{children:e("resultsInfoRoi")}),(0,r.jsx)("p",{className:"text-muted-foreground/70",children:e("resultsInfoPeriods")})]}),"pregame"===m&&(0,r.jsx)("div",{className:"mb-2.5 inline-flex flex-wrap gap-0.5 rounded-lg border border-[#FF6B00]/20 bg-white/40 p-0.5 dark:bg-slate-800/50",children:eh.map(t=>(0,r.jsx)("button",{type:"button",onClick:()=>h(t),className:`rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors ${x===t?"bg-[#FF6B00] text-white":"text-muted-foreground hover:text-foreground"}`,children:e(`resultsGroup.${t}`)},t))}),"live"===m&&(0,r.jsx)("div",{className:"mb-2.5 inline-flex flex-wrap gap-0.5 rounded-lg border border-red-500/30 bg-red-500/5 p-0.5",children:ep.map(t=>(0,r.jsx)("button",{type:"button",onClick:()=>g(t),className:`rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors ${p===t?"bg-red-500 text-white":"text-muted-foreground hover:text-foreground"}`,children:e(`liveMarket.${t}`)},t))}),!y&&(0,r.jsx)("p",{className:"mb-3 px-1 text-[11px] text-muted-foreground",children:e("resultsEmpty")}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:w.map(t=>{let{period:s,b:a}=t;return(0,r.jsx)(ef,{label:e(`period.${s}`),b:a},s)})}),(0,r.jsxs)("button",{type:"button",onClick:()=>v(e=>!e),"aria-expanded":j,className:"mt-2.5 flex w-full items-center justify-center gap-1 text-[11px] font-medium text-[#FF6B00] transition-colors hover:text-[#FF6B00]/80",children:[j?e("resultsHideHistory"):e("resultsViewHistory"),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`transition-transform duration-200 ${j?"rotate-180":""}`,children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})]}),j&&(0,r.jsx)(eb,{section:m,pregameGroup:x,liveMarket:p})]})})}function ev(){let{onAnalyzeTeams:e,onLeagueContext:t,onStandings:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,l.c)("Football"),u=(0,l.c)("Arbitrage"),h=(0,o.Ym)(),{isPremium:p,isLoading:g}=(0,V.Y)(),[f,b]=(0,a.useState)([]),[j,v]=(0,a.useState)([]),[w,y]=(0,a.useState)(!0),[N,k]=(0,a.useState)(""),[_,F]=(0,a.useState)("all"),[C,M]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=!0;return(async()=>{let[t,s]=await Promise.all([(0,i.EL)(),(0,i.Ky)()]);e&&(b(t),v(s),y(!1))})(),()=>{e=!1}},[]);let $=(0,c.E)(),E=(0,a.useMemo)(()=>{let e=new Map;for(let t of f)e.set(t.api_fixture_id,t);return e},[f]),L=(0,a.useMemo)(()=>{let e=new Map;
1return j.forEach(t=>e.set(t.id,{priority:t.priority,featured:t.featured})),[...$].sort((0,i.JF)(e)).map(e=>({live:e,scheduled:E.get(e.api_fixture_id)??null}))},[$,E,j]),S=(0,a.useMemo)(()=>new Set($.map(e=>e.api_fixture_id)),[$]),A=(0,a.useMemo)(()=>{let e=new Map;return j.forEach(t=>e.set(t.id,t)),e},[j]),B=(0,a.useMemo)(()=>{let e=new Map;for(let s of f)if(!e.has(s.league_id)){var t;e.set(s.league_id,s.league_name||(null==(t=A.get(s.league_id))?void 0:t.name)||s.league_id)}return Array.from(e,e=>{let[t,s]=e;return{id:t,name:s}})},[f,A]),T=(0,a.useMemo)(()=>{let e=N.trim().toLowerCase(),t=("all"===_?f:f.filter(e=>e.league_id===_)).filter(e=>!S.has(e.api_fixture_id));t=e?t.filter(t=>t.home_team.toLowerCase().includes(e)||t.away_team.toLowerCase().includes(e)||(0,d.c)(t.home_team,h).toLowerCase().includes(e)||(0,d.c)(t.away_team,h).toLowerCase().includes(e)):t;let s=new Map;for(let e of t){let t=A.get(e.league_id);s.has(e.league_id)||s.set(e.league_id,{id:e.league_id,name:e.league_name||(null==t?void 0:t.name)||e.league_id,featured:(null==t?void 0:t.featured)??!1,priority:(null==t?void 0:t.priority)??100,games:[]}),s.get(e.league_id).games.push(e)}return Array.from(s.values()).sort((e,t)=>e.featured!==t.featured?e.featured?-1:1:e.priority-t.priority)},[f,A,N,_,h,S]),O=(0,a.useMemo)(()=>new Set(L.filter(e=>(0,m.fB)(e.live.live_odds).length>0).map(e=>e.live.api_fixture_id)),[L]),H=(0,a.useMemo)(()=>{let e=new Set;for(let t of T)for(let s of t.games)(0,m.yp)(s).length>0&&e.add(s.api_fixture_id);return e},[T]),W=O.size+H.size,P=(0,a.useMemo)(()=>C?L.filter(e=>O.has(e.live.api_fixture_id)):L,[C,L,O]),D=(0,a.useMemo)(()=>C?T.map(e=>({...e,games:e.games.filter(e=>H.has(e.api_fixture_id))})).filter(e=>e.games.length>0):T,[C,T,H]);(0,a.useEffect)(()=>{C&&0===W&&M(!1)},[C,W]);let[R,U]=(0,a.useState)(null),[q,G]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(g)return;if(p){U(null),G(!0);return}let e=!0;return G(!1),(0,i.em)().then(t=>{e&&(U(t),G(!0))}),()=>{e=!1}},[p,g]);let I=(0,a.useCallback)(async e=>{let t=await (0,i.g1)(e);null!=t&&U(t)},[]),Y=!p&&!g&&q&&null==R,z=(0,a.useMemo)(()=>null!=R?f.find(e=>e.api_fixture_id===R)??null:null,[f,R]);return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(ej,{}),W>0&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>M(e=>!e),"aria-pressed":C,className:`inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs font-bold uppercase tracking-wide transition-colors ${C?"border-emerald-500/50 bg-emerald-500/20 text-emerald-700 dark:text-emerald-300":"border-border bg-background/60 text-muted-foreground hover:border-emerald-500/40 hover:text-emerald-600 dark:hover:text-emerald-300"}`,children:[(0,r.jsx)("span",{"aria-hidden":!0,children:"âï¸"}),u("filterOnly"),(0,r.jsx)("span",{className:`rounded-full px-1.5 py-0.5 text-[10px] tabular-nums ${C?"bg-emerald-500/30":"bg-muted text-foreground"}`,children:W})]}),C&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:u("filterActive")}
1)]}),P.length>0&&(0,r.jsxs)("section",{children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center gap-2 border-b border-red-500/30 pb-2",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"h-2 w-2 animate-pulse rounded-full bg-red-500"}),(0,r.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wide text-foreground",children:n("liveNow")}),(0,r.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:P.length})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:P.map(a=>{let{live:l,scheduled:n}=a;return n?(0,r.jsx)(ei,{game:n,isPremium:p,isFreePreview:!p&&n.api_fixture_id===R,canClaimFree:Y,onClaimFree:()=>I(n.api_fixture_id),live:l,onAnalyzeTeams:e,onLeagueContext:t,onStandings:s},l.api_fixture_id):(0,r.jsx)(en,{game:l,isPremium:p,onAnalyzeTeams:e,onLeagueContext:t,onStandings:s},l.api_fixture_id)})})]}),w?(0,r.jsxs)("div",{className:"flex items-center justify-center py-16",children:[(0,r.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-b-2 border-t-2 border-muted-foreground/40"}),(0,r.jsx)("span",{className:"ml-2 text-sm text-muted-foreground",children:n("loading")})]}):0===f.length?0===L.length?(0,r.jsxs)("div",{className:"rounded-xl border border-border bg-card p-8 text-center",children:[(0,r.jsx)("div",{className:"text-4xl",children:"â½"}),(0,r.jsx)("h3",{className:"mt-2 text-lg font-bold text-foreground",children:n("emptyTitle")}),(0,r.jsx)("p",{className:"mx-auto mt-1 max-w-md text-sm text-muted-foreground",children:n("emptyBody")})]}):null:(0,r.jsxs)(r.Fragment,{children:[!p&&z&&(0,r.jsx)(x.vy,{game:{leagueId:z.league_id,homeTeam:z.home_team,awayTeam:z.away_team}}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)("input",{type:"text",value:N,onChange:e=>k(e.target.value),placeholder:n("searchPlaceholder"),className:"w-full rounded-lg border border-border bg-background/60 px-3 py-2 text-sm outline-none focus:border-foreground
1/30 focus:ring-2 focus:ring-foreground/10"}),B.length>1&&(0,r.jsxs)("select",{value:_,onChange:e=>F(e.target.value),className:"rounded-lg border border-border bg-background/60 px-3 py-2 text-sm outline-none focus:border-foreground/30 focus:ring-2 focus:ring-foreground/10 sm:w-56",children:[(0,r.jsx)("option",{value:"all",children:n("allLeagues")}),B.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),D.map(a=>(0,r.jsxs)("section",{children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center gap-2 border-b border-border pb-2",children:[a.featured&&(0,r.jsx)("span",{"aria-hidden":!0,className:"text-lg",children:"\uD83C\uDFC6"}),(0,r.jsx)("h2",{className:"text-sm font-bold text-foreground",children:a.name}),a.featured&&(0,r.jsx)("span",{className:"ml-auto rounded-full bg-amber-500/15 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-amber-600 dark:text-amber-400",children:n("featured")}),(0,r.jsx)("span",{className:`${a.featured?"ml-1":"ml-auto"} text-xs text-muted-foreground`,children:a.games.length})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:a.games.map(a=>(0,r.jsx)(ei,{game:a,isPremium:p,isFreePreview:!p&&a.api_fixture_id===R,canClaimFree:Y,onClaimFree:()=>I(a.api_fixture_id),onAnalyzeTeams:e,onLeagueContext:t,onStandings:s},a.api_fixture_id))})]},a.id))]})]})}var ew=s(98013);let ey=(0,n.default)(()=>s.e(1458).then(s.bind(s,81458)),{loadableGenerated:{webpack:()=>[81458]},ssr:!1}),eN=(0,n.default)(()=>s.e(4266).then(s.bind(s,84266)),{loadableGenerated:{webpack:()=>[84266]},ssr:!1}),ek=(0,n.default)(()=>s.e(226).then(s.bind(s,90226)),{loadableGenerated:{webpack:()=>[90226]},ssr:!1});function e_(){let e=(0,l.c)("Football"),[t,s]=(0,a.useState)("games"),[n,o]=(0,a.useState)(void 0),[d,i]=(0,a.useState)(void 0),[c,m]=(0,a.useState)(void 0),u=(0,a.useCallback)((e,t,r)=>{o(e),i(t),m(r),s("teams")},[]),x=(0,a.useCallback)(e=>{o(e),s("leagues")},[]),h=(0,a.useCallback)(e=>{o(e),s("standings")},[]),p=[{key:"games",label:e("tabs.games"),icon:"â½"},{key:"teams",label:e("tabs.teams")},{key:"leagues",label:e("tabs.leagues")},{key:"standings",label:e("tabs.standings")}];return(0,r.jsxs)("div",{className:"flex flex-1 flex-col p-0 lg:p-6",children:[(0,r.jsxs)("div",{className:"mb-4 px-4 lg:px-0",children:[(0,r.jsx)("h1",{className:"text-xl font-bold text-foreground",children:e("dashboardTitle")}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:e("dashboardSubtitle")})]}),(0,r.jsx)("div",{className:"mb-4 px-4 lg:mb-6 lg:px-0",children:(0,r.jsx)("div",{className:"flex w-full border-b border-border/60",children:p.map(e=>(0,r.jsxs)("button",{onClick:()=>s(e.key),className:`flex flex-1 items-center justify-center gap-1 px-1 py-3 text-center text-xs font-medium transition-colors duration-150 md:px-5 md:text-sm ${t===e.key?"border-b-2 border-foreground text-foreground":"border-b-2 border-transparent text-muted-foreground hover:border-muted-foreground/50 hover:text-foreground/80"}`,children:[e.icon&&(0,r.jsx)("span",{className:"text-sm",children:e.icon}),e.label]},e.key))})}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto rounded-none bg-card px-4 pb-4 shadow-none md:rounded-xl md:border md:border-border/50 md:p-6 md:pb-6 md:shadow-xl",children:["games"===t&&(0,r.jsx)(ev,{onAnalyzeTeams:u,onLeagueContext:x,onStandings:h}),"teams"===t&&(0,r.jsx)(ew.A,{title:e("tabs.teams"),description:e("premium.teamGate"),requiresTeamAnalysis:!0,contentType:"team",children:(0,r.jsx)(ey,{initialLeagueId:n,initialHomeTeam:d,initialAwayTeam:c})}),"leagues"===t&&(0,r.jsx)(ew.A,{title:e("tabs.leagues"),description:e("premium.leagueGate"),requiresTeamAnalysis:!0,contentType:"league",children:(0,r.jsx)(eN,{initialLeagueId:n})}),"standings"===t&&(0,r.jsx)(ek,{initialLeagueId:n})]})]})}},98013:(e,t,s)=>{s.d(t,{A:()=>h});var r=s(95155),a=s(12115),l=s(18955),n=s(51567),o=s(15239),d=s(52619),i=s.n(d),c=s(33567),m=s(96100),u=s(86808),x=s(38437);let h=e=>{let{children:t,title:s,description:d,requiresTeamAnalysis:h=!1,requiresPremiumLeagues:p=!1,requiresEarlyAccess:g=!1,contentType:f}=e,b=(0,l.c)("PremiumContent"),j=(0,n.Ym)(),[v,w]=(0,a.useState)(null),[y,N]=(0,a.useState)(c.i.FREE),[k,_]=(0,a.useState)(!0),{user:F,isAdmin:C,loading:M}=(0,m.A)(),$=(0,x.c)();if((0,a.useEffect)(()=>{async function e(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(M)return void _(!0);if(!F&&!M){N(c.i.FREE),_(!1);return}if(C){N(c.i.MASTER),_(!1);return}if(F&&!C){_(!0);try{let t=e?await (0,c.Jo)(F):await (0,c.Bm)(F);N(t);let s=await fetch("/api/get-active-subscription",{method:"POST"}),r=await s.json();s.ok&&w(r.subscription||null)}catch(e){console.error("Error fetching subscription for PremiumContent:",e),N(c.i.FREE)}finally{_(!1)}}else N(c.i.FREE),_(!1)}e();let t=()=>{e(!0)};return window.addEventListener("subscriptionChanged",t),()=>window.removeEventListener("subscriptionChanged",t)},[F,C,M,u.ND]),k)return(0,r.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,r.jsx)("div",{className:"text-white",children:b("loading")})});let E=(0,c.Fe)(y),L=(!h||E.canAccessTeamAnalysis)&&(!p||E.canAccessPremiumLeagues)&&(!g||E.canAccessEarlyFeatures);if(F&&!M&&!L){let e="team"===f?"pt"===j?"https://storage.googleapis.com/finalskore_assets/Como_usar_3_analise_de_times.gif":"https://storage.googleapis.com/finalskore_assets/team-analysis-us.gif":"league"===f?"pt"===j?"https://storage.googleapis.com/finalskore_assets/league-analysis-pt.gif":"https://storage.googleapis.com/finalskore_assets/league-analysis-us.gif":null,t=y===c.i.FREE&&$.isTrialEligible,a=b(t?"startTrial":y===c.i.FREE?"viewPlans":"upgradePlan");return(0,r.jsxs)("div",{className:"bg-white/5 border border-white/10 rounded-xl p-8 text-center",children:[(0,r.jsx)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-[#FFBE1A]/10 text-[#FFBE1A] text-sm mb-4",children:b(t?"startTrial":"badgeLabel")}),(0,r.jsx)("h2",{className:"text-2xl font-bold mb-6",children:s}),(0,r.jsx)("p",{className:"text-white/70 text-lg mb-4",children:d}),t&&(0,r.jsx)("p",{className:"text-white/60 text-sm mb-6",children:b("trialPit
1ch")}),e&&(0,r.jsx)("div",{className:"max-w-3xl mx-auto mb-8",children:(0,r.jsx)("div",{className:"rounded-lg overflow-hidden border border-white/10",children:(0,r.jsx)(o.default,{src:e,alt:s,width:800,height:450,className:"w-full h-auto",unoptimized:!0})})}),(0,r.jsx)(i(),{href:"/pricing",className:"inline-block bg-[#FFBE1A] hover:bg-[#FFBE1A]/90 text-black px-6 py-3 rounded-lg font-medium text-lg transition-colors",children:a})]})}return(0,r.jsx)(r.Fragment,{children:t})}}}]);
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.