!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2d1c7687-3546-431e-90a2-0f8a7b049a94",e._sentryDebugIdIdentifier="sentry-dbid-2d1c7687-3546-431e-90a2-0f8a7b049a94")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[857],{7447:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(6029),a=n(28349),o=n(54409);function l(e){let{isFollowed:t,disabled:n,onClick:l,isOnOverlay:i,isInDesktopHeader:s}=e;return(0,r.jsx)(a.D7,{onClick:l,disabled:n,bg:s?"surface.s2":"[transparent]",children:(0,r.jsx)(o.zQC,{icon:t?"follow-active":"follow-default",fill:i?"onColor.primary":t||s?"primary.default":"neutral.default",style:{width:24,height:24}})})}},8973:(e,t,n)=>{n.d(t,{b:()=>r,y:()=>a});var r=function(e){return e.Event="event",e.Team="team",e.UniqueTournament="unique_tournament",e.Tournament="tournament",e.Player="player",e.Stage="stage",e.Substage="substage",e.UniqueStages="unique_stage",e.Constructor="constructor",e.Driver="driver",e}({}),a=function(e){return e.MainMatches="main_matches",e.MainLeagues="main_leagues",e.Header="header",e.EventHeader="event_header",e.EventsTab="events_tab",e.EventWidget="event_widget",e.MatchesSection="matches_section",e.H2HSection="h2h_section",e.FloatingHeader="floating_header",e.Favorites="favorites",e.PlayerStatistics="player_statistics",e.RacesTab="races_tab",e.FightNight="fight_night",e.Fights="fights",e.PopularPlayers="popular_players",e.PopularTeams="popular_teams",e.Search="search",e.Popup="popup",e}({})},39969:(e,t,n)=>{n.d(t,{h:()=>j,x:()=>_});var r=n(6029),a=n(21377),o=n(99064),l=n(55729),i=n(494),s=n(24313),d=n(70757),c=n(61836),u=n(10794),f=n(28349),h=n(76356),p=n(90248),m=n(54409);let g=(e,t,n)=>{if(n)switch(t){case"right":return{top:"-8px",left:0,transform:"translateY(-100%)"};case"bottom":return{};default:return{top:"-8px",right:0,transform:"translateY(-100%)"}}switch(t){case"right":return{bottom:"-8px",left:0,transform:"translateY(100%)"};case"bottom":return e?{transform:"translateX(-100%)"}:{};default:return{bottom:"-8px",right:0,transform:"translateY(100%)"}}},v=e=>{let{image:t,name:n,LinkComponent:a}=e,o=(0,r.jsxs)(h.so,{align:"center",cursor:"pointer",gap:"lg",children:[t,(0,r.jsx)(h.az,{style:{width:"102px"},textAlign:"start",children:(0,r.jsx)(f.EY,{color:"neutrals.nLv1",textStyle:"body.medium",children:n})})]});return(0,r.jsx)(h.az,{my:"md",children:a?(0,r.jsx)(a,{children:o}):o})},x=(0,l.forwardRef)((e,t)=>{let{isEventFollowed:n,entities:a=[],onDeleteClick:o,menuPosition:l,isMenuInverted:i}=e,{textDirection:s}=(0,f.$c)(),{isMobile:d}=(0,f.$c)();return"rtl"===s&&(l="right"===l?"left":"right"),(0,r.jsx)(h.az,{ref:t,position:"absolute",w:"[174px]",bg:"surface.s1",elevation:"3",br:"md",py:"sm",zIndex:"popover",style:{...g(d,l,i),whiteSpace:"normal"},children:n&&o?(0,r.jsxs)(h.so,{tabIndex:0,px:"lg",py:"sm",minH:"4xl",align:"center",br:"md",onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(null==o||o(e))},onClick:o,cursor:"pointer",children:[(0,r.jsx)(m.xV8,{fill:"error.default",width:24,height:24,mr:"lg"}),(0,r.jsx)(h.az,{style:{width:"102px"},children:(0,r.jsx)(f.EY,{color:"neutrals.nLv1",textStyle:"body.medium",children:(0,r.jsx)(p.A,{id:"remove_from_favourites"})})})]}):(0,r.jsxs)(h.az,{px:"lg",minH:"4xl",children:[(0,r.jsx)(h.az,{textAlign:"start",children:(0,r.jsx)(f.EY,{color:"neutrals.nLv3",textStyle:"assistive.default",pb:"sm",children:(0,r.jsx)(p.A,{id:"favorites.becauseYouFollow"})})}),a.map(e=>(0,r.jsx)(v,{...e},e.entityType+e.id))]})})});var b=n(37356),y=n(7447);let w=e=>{e.stopPropagation(),e.preventDefault()};function j(e){let{id:t,leftTeam:n,rightTeam:f,tournament:h,menuPosition:p,isMenuInverted:m,isOnOverlay:g,location:v,type:j,isInDesktopHeader:C}=e,k=(0,l.useMemo)(()=>(0,b.fB)(),[]),S=(0,l.useMemo)(()=>(0,b.KL)(),[]),_=(0,l.useMemo)(()=>({leftTeam:n,rightTeam:f,tournament:h}),[n.id,f.id,h.id]),E=(0,i.d4)(e=>k(e,t)),I=(0,i.d4)(e=>S(e,_)),z=(0,i.d4)(u.fg),D=E!==u.dE.NotFollowed&&!!E,F=D||!!I.length,{invertedMenu:P}=(0,s.l)(),M=(0,i.wA)(),T=()=>{M((0,d.q$)(a.bq7.Events,t)),M((0,d.q$)(a.bq7.MutedEvents,t)),(0,c.g2)({id:t,type:j,location:v,isFollowed:!1})},A=()=>{M((0,d.UQ)(a.bq7.Events,t)),(0,c.g2)({id:t,type:j,location:v,isFollowed:!0})},[L,q]=(0,l.useState)(!1),Q=()=>q(e=>!e),N=(0,l.useCallback)(()=>q(!1),[]),H=(0,o.jz)(N);return(0,r.jsxs)(o.az,{ref:H,w:"fit-content",children:[(0,r.jsx)(y.A,{"aria-label":F?"Remove from favourites":"Add to favourites",disabled:z,isFollowed:F,isOnOverlay:g,onClick:e=>{w(e),z||(F?D?T():Q():A())},isInDesktopHeader:C}),F&&L&&!D&&(0,r.jsx)(x,{isEventFollowed:D,entities:I,menuPosition:p,isMenuInverted:P||m,onDeleteClick:e=>{w(e),T(),N()}})]})}var C=n(62859),k=n(8973),S=n(37470);function _(e){let{id:t,uniqueStage:n,menuPosition:f,location:h,isSubstageCell:p}=e,m=(0,l.useContext)(C.Ws),g=(0,l.useMemo)(()=>(0,b.BD)(),[]),v=(0,l.useMemo)(()=>(0,b.jM)(),[]),w=(0,i.d4)(e=>g(e,t)),j=(0,i.d4)(e=>v(e,null==n?void 0:n.id)),_=(0,i.d4)(u.fg),E=j&&n?(0,S.P3)({uniqueStage:n,sportSlug:m}):void 0,{invertedMenu:I}=(0,s.l)(),z=(0,i.wA)(),D=()=>{z((0,d.UQ)(a.bq7.Stages,t)),(0,c.g2)({id:t,type:p?k.b.Substage:k.b.Stage,location:h,isFollowed:!0})},F=()=>{z((0,d.q$)(a.bq7.Stages,t)),(0,c.g2)({id:t,type:p?k.b.Substage:k.b.Stage,location:h,isFollowed:!1})},[P,M]=(0,l.useState)(!1),T=()=>M(e=>!e),A=()=>M(!1),L=(0,o.jz)(A),q=w||j,Q=j&&!p;return(0,r.jsxs)(o.az,{ref:L,position:"relative",w:"fit-content",children:[(0,r.jsx)(y.A,{disabled:_,isFollowed:q,onClick:e=>{e.stopPropagation(),e.preventDefault(),_||(q?T():D())}}),q&&P&&(0,r.jsx)(x,{entities:E?[E]:void 0,isEventFollowed:w&&!Q,menuPosition:f,isMenuInverted:I,onDeleteClick:e=>{e.stopPropagation(),e.preventDefault(),F(),A()}})]})}},46009:(e,t,n)=>{n.d(t,{w:()=>a,e:()=>m});var r=n(55729);let a=(0,r.createContext)("");var o=n(6029),l=n(28349),i=n(76356),s=n(494),d=n(54409),c=n(61836),u=n(10794),f=n(70757),h=n(12759);let p=e=>{e.stopPropagation(),e.preventDefault()};function m(e){let{entity:t,id:n,location:a,type:m,isOnOverlay:g,isDisabled:v,hasNoBorder:x=!1,onClick:b,isNewButton:y}=e,w=(0,s.wA)(),j=(0,s.d4)(e=>(0,u.Ql)(e,t,n),s.bN),C="boolean"==typeof j?j:j!==u.dE.NotFollowed,k=(0,s.d4)(u.fg)||v,S=(0,r.useCallback)(()=>{if(!k){if(C){let e=j===u.dE.Favorite?(0,h.Hz)(t):t;w((0,f.q$)(e,n))}else{let e=(0,h.Hz)(t);w((0,f.UQ)(e,n))}(0,c.g2)({id:n,type:m,location:a,isFollowed:!C})}},[C,k,t,n]);return y?(0,o.jsx)(l.D7,{disabled:k,onClick:e=>{p(e),null==b||b(),S()},children:(0,o.jsx)(d.zQC,{icon:C?"follow-active":"follow-default",style:{width:24,height:24}})}):(0,o.jsx)(i.I4.button,{border:x?"1.5px solid transparent":void 0,alignItems:"center",appearance:"none",cursor:"pointer",display:"inline-flex",isolation:"isolate",justifyContent:"center",outline:"none",position:"relative",userSelect:"none",flexShrink:"0",whiteSpace:"nowrap",h:"[32px]",w:"[32px]",px:"[0px]",textStyle:"action.button.primary",gap:"xs",br:"sm",color:"primary.default",backgroundColor:"[transparent]",disabled:k,_disabled:{opacity:.5,color:"neutral.default",cursor:"not-allowed"},_hover:k?{}:{bg:"primary.default/8"},_active:k?{}:{bg:"primary.default/15"},_focusVisible:{},onClick:e=>{p(e),null==b||b(),S()},children:C?(0,o.jsx)(d.zQC,{icon:"follow-active",m:"0",fill:g?"onColor.primary":"primary.default"}):(0,o.jsx)(d.zQC,{icon:"follow-default",m:"0",fill:g?"onColor.primary":"neutral.default"})})}},53486:(e,t,n)=>{n.d(t,{n6:()=>_,MC:()=>h.MC,gY:()=>I,G:()=>P,ey:()=>F});var r=n(6029),a=n(87827),o=n(21377),l=n(21501),i=n(99064),s=n(55729),d=n(90248),c=n(494),u=n(62859),f=n(54409),h=n(60988),p=n(41735);let m=p.default.span.withConfig({componentId:"sc-8e60f6ed-0"})(["padding:3px;color:white;font-size:12px;font-weight:600;min-width:44px;border-radius:4px;text-align:center;display:inline-block;background:",";"],e=>e.isWinner?e.theme.colors.secondary.default:e.theme.colors.onSurface.nLv3),g=function(e){let{points:t,isWinner:n,...a}=e;return(0,r.jsx)(m,{isWinner:n,...a,children:"number"==typeof t?"".concat(t," pts"):"-"})};var v=n(8703),x=n(65078),b=n(16620),y=n(48886),w=n(8973),j=n(39969),C=n(13266);let k=(0,p.default)(C.tj).withConfig({componentId:"sc-3f813a14-0"})(["display:block;border-radius:2px;:hover{background:",";}:active{background:",";}"],e=>e.theme.colors.surface.s2,e=>e.theme.colors.surface.s0),S=(0,p.default)(i.$n).withConfig({componentId:"sc-3f813a14-1"})(["display:inline-block;&:hover > *{transform:scale(1.1);}"]);function _(e){let t=(0,s.useRef)(null),n=(0,c.d4)(t=>t.favorites.events[e.event.id],c.bN),[a,o]=(0,x.jr)(n,"homeTeam","awayTeam",n),[i,d]=(0,x.jr)(n,"homeScore","awayScore",n),f=(0,l.ZC)(null==n?void 0:n.status.type);return((0,s.useEffect)(()=>{e.mutate&&f&&(null==n?void 0:n.status.type)&&f!==n.status.type&&e.mutate()},[e.mutate,f,null==n?void 0:n.status.type]),n)?(0,r.jsx)(u.y$.Provider,{value:{event:n,leftTeam:a,rightTeam:o,leftScore:i,rightScore:d},children:(0,r.jsx)(k,{event:n,className:"event-hl-".concat(n.id),onClick:t=>{e.onClick&&e.onClick(t,(null==n?void 0:n.id)||-1,e.isMobile)},children:(0,r.jsx)("div",{ref:t,children:(0,r.jsx)(h.n6,{...e,event:n,location:e.location})})})}):null}let E=()=>{let{event:e,leftTeam:t,rightTeam:n}=(0,s.useContext)(u.y$),{location:a}=(0,h.lv)();return(0,r.jsx)(j.h,{id:e.id,tournament:e.tournament,leftTeam:t,rightTeam:n,type:w.b.Event,location:a})},I=e=>(0,r.jsx)(_,{...e,children:E}),z=e=>{let{referenceId:t,isReferenceTeamId:n}=e,a=(0,x.h2)(t,n),l={background:"onSurface.nLv3",char:"?"};switch(a){case o.h18.Win:l={background:"secondary.default",char:"W"};break;case o.h18.OvertimeLoss:case o.h18.Lose:l={background:"error.default",char:"L"};break;case o.h18.Draw:l={background:"onSurface.nLv3",char:"D"}}return(0,r.jsx)(i.az,{w:24,h:24,br:"50%",bg:l.background,mx:"xs",children:(0,r.jsx)(i.EY,{font:"display.small",color:"onColor.primary",lineHeight:"24px",w:24,align:"center",as:"div",children:l.char})})},D=e=>{let{event:t,leftTeam:n,rightTeam:a}=(0,s.useContext)(u.y$);return[o.XUj.NotStarted,o.XUj.InProgress].includes(t.status.type)?(0,r.jsx)(j.h,{type:w.b.Event,location:w.y.MatchesSection,id:t.id,tournament:t.tournament,leftTeam:n,rightTeam:a}):(0,r.jsx)(z,{...e})},F=e=>{let{referenceId:t,isReferenceTeamId:n,incidentsMap:a,...o}=e;return e=>(0,r.jsx)(_,{incidents:a?a[e.event.id]:void 0,isReferenceTeamId:n,...o,...e,children:()=>(0,r.jsx)(D,{referenceId:t,isReferenceTeamId:n})})},P=e=>{let{rating:t,points:n,player:l,playedFor:c,isOnBench:h,incidents:p,isReferenceTeamId:m}=e;return e=>(0,r.jsx)(_,{incidents:p,entity:o.wNW.Player,...e,isReferenceTeamId:m,children:(0,v.rK)(e.event)?()=>{let{openEventPlayerStatistics:e}=(0,b.d)(),{event:p,leftTeam:m,rightTeam:v}=(0,s.useContext)(u.y$),x=p.status.type,C=p.tournament.category.sport,k=p.winnerCode===o.Jfo.Left?m.id:v.id,_=C.slug===o.QCR.Football,E=C.slug===o.QCR.Basketball,I=C.slug===o.QCR.Volleyball,z=x===o.XUj.NotStarted,D=(E||I)&&void 0!==n,F=!_&&!D;return h&&C.slug===o.QCR.Football?(0,r.jsx)(i.az,{w:"28",h:"28",children:(0,r.jsx)(f.IKQ,{width:24,height:24,fill:"onSurface.nLv3"})}):z?(0,r.jsx)(j.h,{id:p.id,type:w.b.Event,location:w.y.MatchesSection,tournament:p.tournament,leftTeam:m,rightTeam:v}):p.hasEventPlayerStatistics?(0,r.jsxs)(S,{onClickCapture:t=>{t.preventDefault(),t.stopPropagation(),p.hasEventPlayerStatistics&&l&&e({event:p,player:l},y._.EventCell)},variant:F?void 0:"unshielded",colorScheme:F?"secondary":void 0,p:"0",w:D?48:28,h:"28",children:[_&&(0,r.jsx)(a.G,{rating:t}),D&&(0,r.jsx)(g,{points:n,isWinner:k===c}),F&&(0,r.jsx)(f.Abd,{width:24,height:24,fill:"onColor.primary"})]}):(0,r.jsx)(i.so,{w:"28",h:"28",align:"center",justify:"center",children:(0,r.jsx)(i.EY,{font:"assistive.default",color:"onSurface.nLv3",children:(0,r.jsx)(d.A,{id:"N/A"})})})}:null})}}}]);