!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]="47b7bd56-3d01-4611-bd3a-4abe1f779857",e._sentryDebugIdIdentifier="sentry-dbid-47b7bd56-3d01-4611-bd3a-4abe1f779857")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[36678],{33398:(e,t,l)=>{l.d(t,{A:()=>o});var r=l(6029),n=l(10174),s=l(52466);function o(e){let{isFollowed:t,disabled:l,onClick:o,isOnOverlay:a}=e;return(0,r.jsx)(n.D7,{onClick:o,disabled:l,bg:"[transparent]",children:(0,r.jsx)(s.zQC,{icon:t?"follow-active":"follow-default",fill:a?"onColor.primary":t?"primary.default":"neutral.default",style:{width:24,height:24}})})}},36678:(e,t,l)=>{l.d(t,{n6:()=>k,MC:()=>v.MC,gY:()=>E,G:()=>M,ey:()=>I});var r=l(6029),n=l(87827),s=l(46787),o=l(10174),a=l(19621),i=l(62042),d=l(76356),u=l(93338),c=l(55729),x=l(90248),h=l(494),f=l(18970),b=l(52466),v=l(17135),g=l(41164),y=l(67087),m=l(66331),p=l(96861),j=l(36882),w=l(70251),C=l(64006);function k(e){let t=(0,c.useRef)(null),l=(0,h.d4)(t=>t.favorites.events[e.event.id],h.bN),[n,s]=(0,y.jr)(l,"homeTeam","awayTeam",l),[o,d]=(0,y.jr)(l,"homeScore","awayScore",l),u=(0,a.ZC)(null==l?void 0:l.status.type);return((0,c.useEffect)(()=>{e.mutate&&u&&(null==l?void 0:l.status.type)&&u!==l.status.type&&e.mutate()},[e.mutate,u,null==l?void 0:l.status.type]),l)?(0,r.jsx)(f.y$,{value:{event:l,leftTeam:n,rightTeam:s,leftScore:o,rightScore:d},children:(0,r.jsx)(C.tj,{event:l,className:(0,i.cx)("event-hl-".concat(l.id),(0,i.AH)({display:"block",br:"2xs",_hover:{bg:"surface.s2"},_active:{bg:"surface.s0"}})),onClick:t=>{e.onClick&&e.onClick(t,(null==l?void 0:l.id)||-1,e.isMobile)},children:(0,r.jsx)("div",{ref:t,children:(0,r.jsx)(v.n6,{...e,event:l,location:e.location})})})}):null}let S=()=>{let{event:e,leftTeam:t,rightTeam:l}=(0,c.useContext)(f.y$),{location:n}=(0,v.lv)();return(0,r.jsx)(w.h,{id:e.id,tournament:e.tournament,leftTeam:t,rightTeam:l,type:j.b.Event,location:n})},E=e=>(0,r.jsx)(k,{...e,children:S}),A=e=>{let{referenceId:t,isReferenceTeamId:l}=e,n=(0,y.h2)(t,l),a={background:"colors.neutrals.nLv3",char:"?"};switch(n){case s.h18.Win:a={background:"colors.secondary.default",char:"W"};break;case s.h18.OvertimeLoss:case s.h18.Lose:a={background:"colors.status.error.default",char:"L"};break;case s.h18.Draw:a={background:"colors.neutrals.nLv3",char:"D"}}return(0,r.jsx)(d.az,{w:"xl",h:"xl",br:"50%",mx:"xs",style:{backgroundColor:u.S.var(a.background)},children:(0,r.jsx)(o.EY,{textStyle:"display.small",color:"onColor.primary",lineHeight:"24px",w:"xl",textAlign:"center",display:"block",children:a.char})})},D=e=>{let{event:t,leftTeam:l,rightTeam:n}=(0,c.useContext)(f.y$);return[s.XUj.NotStarted,s.XUj.InProgress].includes(t.status.type)?(0,r.jsx)(w.h,{type:j.b.Event,location:j.y.MatchesSection,id:t.id,tournament:t.tournament,leftTeam:l,rightTeam:n}):(0,r.jsx)(A,{...e})},I=e=>{let{referenceId:t,isReferenceTeamId:l,incidentsMap:n,...s}=e;return e=>(0,r.jsx)(k,{incidents:n?n[e.event.id]:void 0,isReferenceTeamId:l,...s,...e,children:()=>(0,r.jsx)(D,{referenceId:t,isReferenceTeamId:l})})},z=e=>{let{value:t}=e;return(0,r.jsx)(d.so,{w:"xl",h:"xl",align:"center",justify:"center",color:"onColor.default",backgroundColor:t>0?"secondary.default":"neutrals.nLv3",children:t})},M=e=>{let{statistics:t,player:l,isOnBench:a,incidents:i,isReferenceTeamId:u,selectedStatistic:h}=e;return e=>(0,r.jsx)(k,{incidents:i,entity:s.wNW.Player,...e,isReferenceTeamId:u,children:(0,g.rK)(e.event)?()=>{let{openEventPlayerStatistics:e}=(0,m.d)(),{event:i,leftTeam:u,rightTeam:v}=(0,c.useContext)(f.y$),g=i.status.type,y=i.tournament.category.sport,C=g===s.XUj.NotStarted,k=y.slug===s.QCR.Football||"rating"===h,S=[s.QCR.Basketball,s.QCR.Volleyball].includes(y.slug)&&h&&"rating"!==h,E=!k&&!S;if(a&&y.slug===s.QCR.Football)return(0,r.jsx)(d.az,{w:"xl",h:"xl",children:(0,r.jsx)(b.IKQ,{width:24,height:24,fill:"onSurface.nLv3"})});if(C)return(0,r.jsx)(w.h,{id:i.id,type:j.b.Event,location:j.y.MatchesSection,tournament:i.tournament,leftTeam:u,rightTeam:v});if(!i.hasEventPlayerStatistics)return(0,r.jsx)(d.so,{w:"xl",h:"xl",align:"center",justify:"center",children:(0,r.jsx)(o.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,r.jsx)(x.A,{id:"N/A"})})});let A=E?(0,r.jsx)(b.Abd,{width:24,height:24,fill:"onColor.primary"}):(0,r.jsxs)(r.Fragment,{children:[k&&(0,r.jsx)(n.G,{rating:null==t?void 0:t.rating}),S&&(0,r.jsx)(z,{value:(null==t?void 0:t[h])||0})]});return(0,r.jsx)(o.K0,{onClickCapture:t=>{t.preventDefault(),t.stopPropagation(),i.hasEventPlayerStatistics&&l&&e({event:i,player:l},p._l.EventCell)},variant:E?"filled":"clear",colorPalette:E?"secondary":void 0,children:A})}:null})}},70251:(e,t,l)=>{l.d(t,{h:()=>j,x:()=>S});var r=l(6029),n=l(46787),s=l(19621),o=l(76356),a=l(55729),i=l(494),d=l(23240),u=l(62389),c=l(95084),x=l(72753),h=l(10174),f=l(90248),b=l(52466);let v=e=>{let{image:t,name:l,LinkComponent:n}=e,s=(0,r.jsxs)(o.so,{align:"center",cursor:"pointer",gap:"lg",children:[t,(0,r.jsx)(o.az,{style:{width:"102px"},textAlign:"start",children:(0,r.jsx)(h.EY,{color:"neutrals.nLv1",textStyle:"body.medium",children:l})})]});return(0,r.jsx)(o.az,{my:"md",children:n?(0,r.jsx)(n,{children:s}):s})},g=e=>{let{isEventFollowed:t,entities:l=[],onDeleteClick:n,menuPosition:s,isMenuInverted:a,ref:i}=e,{textDirection:d}=(0,h.$c)(),{isMobile:u}=(0,h.$c)();return"rtl"===d&&(s="right"===s?"left":"right"),(0,r.jsx)(o.az,{ref:i,position:"absolute",w:"[174px]",bg:"surface.s1",elevation:"3",br:"md",py:"sm",zIndex:"popover",style:{...((e,t,l)=>{if(l)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%)"}}})(u,s,a),whiteSpace:"normal"},children:t&&n?(0,r.jsxs)(o.so,{tabIndex:0,px:"lg",py:"sm",minH:"4xl",align:"center",br:"md",onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(null==n||n(e))},onClick:n,cursor:"pointer",children:[(0,r.jsx)(b.xV8,{fill:"error.default",width:24,height:24,mr:"lg"}),(0,r.jsx)(o.az,{style:{width:"102px"},children:(0,r.jsx)(h.EY,{color:"neutrals.nLv1",textStyle:"body.medium",children:(0,r.jsx)(f.A,{id:"remove_from_favourites"})})})]}):(0,r.jsxs)(o.az,{px:"lg",minH:"4xl",children:[(0,r.jsx)(o.az,{textAlign:"start",children:(0,r.jsx)(h.EY,{color:"neutrals.nLv3",textStyle:"assistive.default",pb:"sm",children:(0,r.jsx)(f.A,{id:"favorites.becauseYouFollow"})})}),l.map(e=>(0,r.jsx)(v,{...e},e.entityType+e.id))]})})};var y=l(53594),m=l(33398);let p=e=>{e.stopPropagation(),e.preventDefault()};function j(e){let{children:t,id:l,leftTeam:h,rightTeam:f,tournament:b,menuPosition:v,isMenuInverted:j,isOnOverlay:w,location:C,type:k}=e,S=(0,a.useMemo)(()=>(0,y.fB)(),[]),E=(0,a.useMemo)(()=>(0,y.KL)(),[]),A=(0,a.useMemo)(()=>({leftTeam:h,rightTeam:f,tournament:b}),[h.id,f.id,b.id]),D=(0,i.d4)(e=>S(e,l)),I=(0,i.d4)(e=>E(e,A)),z=(0,i.d4)(x.fg),M=D!==x.dE.NotFollowed&&!!D,F=M||!!I.length,{invertedMenu:_}=(0,d.l)(),L=(0,i.wA)(),P=()=>{L((0,u.q$)(n.bq7.Events,l)),L((0,u.q$)(n.bq7.MutedEvents,l)),(0,c.g2)({id:l,type:k,location:C,isFollowed:!1})},[T,Y]=(0,a.useState)(!1),N=(0,a.useCallback)(()=>Y(!1),[]),R=(0,s.jz)(N),$=e=>{p(e),z||(F?M?P():Y(e=>!e):(L((0,u.UQ)(n.bq7.Events,l)),(0,c.g2)({id:l,type:k,location:C,isFollowed:!0})))};return(0,r.jsxs)(o.az,{ref:R,w:"fit",children:["function"==typeof t?t({disabled:z,isFollowed:F,isOnOverlay:w,isOpen:T,onClick:$}):(0,r.jsx)(m.A,{"aria-label":F?"Remove from favourites":"Add to favourites",disabled:z,isFollowed:F,isOnOverlay:w,onClick:$}),F&&T&&!M&&(0,r.jsx)(g,{isEventFollowed:M,entities:I,menuPosition:v,isMenuInverted:_||j,onDeleteClick:e=>{p(e),P(),N()}})]})}var w=l(18970),C=l(36882),k=l(83677);function S(e){let{id:t,uniqueStage:l,menuPosition:h,location:f,isSubstageCell:b}=e,v=(0,a.useContext)(w.Ws),p=(0,a.useMemo)(()=>(0,y.BD)(),[]),j=(0,a.useMemo)(()=>(0,y.jM)(),[]),S=(0,i.d4)(e=>p(e,t)),E=(0,i.d4)(e=>j(e,null==l?void 0:l.id)),A=(0,i.d4)(x.fg),D=E&&l?(0,k.P3)({uniqueStage:l,sportSlug:v}):void 0,{invertedMenu:I}=(0,d.l)(),z=(0,i.wA)(),[M,F]=(0,a.useState)(!1),_=()=>F(!1),L=(0,s.jz)(_),P=S||E,T=E&&!b;return(0,r.jsxs)(o.az,{ref:L,position:"relative",w:"fit",children:[(0,r.jsx)(m.A,{disabled:A,isFollowed:P,onClick:e=>{e.stopPropagation(),e.preventDefault(),A||(P?F(e=>!e):(z((0,u.UQ)(n.bq7.Stages,t)),(0,c.g2)({id:t,type:b?C.b.Substage:C.b.Stage,location:f,isFollowed:!0})))}}),P&&M&&(0,r.jsx)(g,{entities:D?[D]:void 0,isEventFollowed:S&&!T,menuPosition:h,isMenuInverted:I,onDeleteClick:e=>{e.stopPropagation(),e.preventDefault(),z((0,u.q$)(n.bq7.Stages,t)),(0,c.g2)({id:t,type:b?C.b.Substage:C.b.Stage,location:f,isFollowed:!1}),_()}})]})}}}]);