!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]="061b7620-da96-463f-a1ec-94a3d550fd92",e._sentryDebugIdIdentifier="sentry-dbid-061b7620-da96-463f-a1ec-94a3d550fd92")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[65613],{9220:(e,t,n)=>{n.d(t,{hF:()=>x,cH:()=>f.c,Pc:()=>p,Ez:()=>g,jv:()=>h,JJ:()=>j,SI:()=>y});var r=n(6029),s=n(46787),a=n(10174),l=n(76356),o=n(55729),i=n(18970),d=n(52466);let c=e=>{let{value:t}=e;return(0,r.jsx)(a.EY,{textStyle:"display.small",color:"secondary.default",children:t})};function u(e){let{comment:t}=e;switch((0,o.useContext)(i.Ws)){case s.QCR.Football:switch(t.type){case s.zZK.ScoreChange:switch(t.goalType){case"ownGoal":return(0,r.jsx)(d.NcS,{icon:"football-own-goal",fill:"error.default"});case"penalty":return(0,r.jsx)(d.NcS,{icon:"football-penalty",fill:"secondary.default"});default:return(0,r.jsx)(d.NcS,{icon:"football-ball",fill:"secondary.default"})}case s.zZK.YellowCard:return(0,r.jsx)(d.CvR,{icon:"card-yellow"});case s.zZK.YellowRedCard:return(0,r.jsx)(d.CvR,{icon:"card-double-yellow"});case s.zZK.RedCard:return(0,r.jsx)(d.CvR,{icon:"card-red"});case s.zZK.PenaltyMissed:case s.zZK.PenaltySaved:return(0,r.jsx)(d.NcS,{icon:"penalty-missed",fill:"error.default"});case s.zZK.PenaltyScored:return(0,r.jsx)(d.NcS,{icon:"football-penalty",fill:"secondary.default"});case s.zZK.Injury:return(0,r.jsx)(d.NcS,{icon:"substitution-injured"});case s.zZK.Substitution:return(0,r.jsx)(d.NcS,{icon:"substitution"});case s.zZK.VideoAssistantReferee:case s.zZK.VideoAssistantRefereeOver:return(0,r.jsx)(d.NcS,{icon:"var",fill:"primary.default",w:16,h:16})}break;case s.QCR.Basketball:if(t.type===s.zZK.ScoreChange)switch(t.goalType){case"freeThrowMade":return(0,r.jsx)(c,{value:1});case"twoPointMade":return(0,r.jsx)(c,{value:2});case"threePointMade":return(0,r.jsx)(c,{value:3})}break;case s.QCR.AmericanFootball:switch(t.type){case s.zZK.Touchdown:return(0,r.jsx)(d.CvR,{icon:"af-touchdown",fill:"secondary.default",w:16,h:16});case s.zZK.ExtraPoint:return(0,r.jsx)(d.CvR,{icon:"af-extra-point",fill:"secondary.default",w:16,h:16});case s.zZK.TwoPointConversion:return(0,r.jsx)(d.CvR,{icon:"af-two-point-conversion",fill:"secondary.default",w:16,h:16});case s.zZK.FieldGoal:return(0,r.jsx)(d.CvR,{icon:"af-field-goal",fill:"secondary.default",w:16,h:16})}break;case s.QCR.IceHockey:{let e={w:[16,24],h:[16,24]};switch(t.type){case s.zZK.ScoreChange:case"penaltyScored":switch(t.goalType){case"penaltyGoal":case"shootoutGoal":return(0,r.jsx)(d.CvR,{icon:"hockey-penalty",fill:"secondary.default",...e});default:return"powerplay"===t.strength?(0,r.jsx)(d.CvR,{icon:"hockey-powerplay-goal",fill:"secondary.default",...e}):"shorthanded"===t.strength?(0,r.jsx)(d.CvR,{icon:"hockey-shorthanded-goal",fill:"secondary.default",...e}):(0,r.jsx)(d.CvR,{icon:"hockey-pak",fill:"secondary.default",...e})}case"penaltyMissed":case"penaltySaved":return(0,r.jsx)(d.NcS,{icon:"penalty-missed",fill:"error.default",...e});case"suspension":return(0,r.jsx)(d.CvR,{icon:"suspension",...e});case"goalkeeperOut":return(0,r.jsx)(d.NcS,{icon:"goalie-out",...e});case"goalkeeperBack":return(0,r.jsx)(d.NcS,{icon:"goalie-in",...e})}}}switch(t.type){case s.zZK.MatchEnded:return(0,r.jsx)(d.NcS,{icon:"full-time"});case s.zZK.PeriodScore:return(0,r.jsx)(d.NcS,{icon:"half-time"});case s.zZK.PeriodEnd:return(0,r.jsx)(d.NcS,{icon:"quarter-end"});default:return null}}var m=n(12337);let x=e=>{let{children:t}=e;return(0,r.jsx)(l.so,{align:"center",children:t})},y=e=>{let{children:t,isUppercase:n}=e;return(0,r.jsx)(a.EY,{display:"block",textStyle:"display.medium",mb:"xs",textTransform:n?"uppercase":void 0,children:t})},h=e=>{let{children:t,secondary:n}=e;return(0,r.jsx)(a.EY,{display:"block",color:n?"neutrals.nLv3":void 0,mt:n?"xs":void 0,textStyle:"body.small",children:t})},j=e=>{let{comment:t}=e,{time:n,timeSeconds:d,addedTime:c,reversedPeriodTime:x,reversedPeriodTimeSeconds:y}=t,h=(0,o.useContext)(i.Ws),j=h===s.QCR.Football&&0===t.time||h===s.QCR.AmericanFootball&&["periodEnd","matchEnded"].includes(t.type)||h===s.QCR.IceHockey&&"PEN"===t.periodName;return(0,r.jsxs)(l.ov,{flexDirection:"column",minW:"3xl",children:[(0,r.jsx)(u,{comment:t}),j?(0,r.jsx)(a.EY,{color:"neutrals.nLv3",textStyle:"assistive.default",children:"-"}):(0,r.jsx)(m.k,{time:n,timeSeconds:d,addedTime:c,reversedPeriodTime:x,reversedPeriodTimeSeconds:y})]})};var f=n(42526);let p=e=>{let{children:t,image:n,secondary:s}=e;return(0,r.jsxs)(l.so,{mt:"xs",gap:"sm",align:"center",children:[n,(0,r.jsx)(a.EY,{color:s?"neutrals.nLv3":void 0,textStyle:"body.small",children:t})]})};var v=n(94446);let g=e=>{let{id:t,teamId:n,small:s}=e;return(0,r.jsxs)(l.az,{position:"relative",w:s?"xl":"2xl",h:s?"xl":"2xl",children:[(0,r.jsx)(v.t,{id:t,size:s?24:32}),n&&(0,r.jsx)(l.az,{position:"absolute",top:s?"md":"[18px]",left:s?"md":"-2xs",children:(0,r.jsx)(v.p,{id:n,size:16})})]})}},29695:(e,t,n)=>{n.d(t,{y:()=>C});var r=n(6029),s=n(33144),a=n(55729),l=n(18970),o=n(96678),i=n(9220);let d=e=>{let{comment:t}=e,{event:n}=(0,a.useContext)(l.y$),{ref:d,isSelected:c,color:u}=(0,o.qF)(t.id),{isHome:m,player:x,playerIn:y,playerOut:h,goalkeeper:j}=t,f=m?n.homeTeam:n.awayTeam;return(0,r.jsxs)(i.hF,{children:[(0,r.jsx)(i.JJ,{comment:t}),(0,r.jsx)(i.cH,{image:(0,r.jsx)(s.p,{id:f.id,size:24}),players:[x,y,h,j],ref:d,isSelected:c,borderColor:u,children:t.text&&(0,r.jsx)(i.jv,{children:t.text})})]})},c=e=>{let{comment:t}=e,{event:n}=(0,a.useContext)(l.y$),{ref:d,isSelected:c,color:u}=(0,o.qF)(t.id),m=t.isHome?n.homeTeam:n.awayTeam;return(0,r.jsxs)(i.hF,{children:[(0,r.jsx)(i.JJ,{comment:t}),(0,r.jsxs)(i.cH,{image:(0,r.jsx)(s.p,{id:m.id,size:24}),players:[t.player],isSelected:c,ref:d,borderColor:u,children:[(0,r.jsx)(i.jv,{children:t.text}),(0,r.jsx)(i.jv,{secondary:!0,children:function(e){switch(e){case"offensive":return"Offensive zone";case"defensive":return"Defensive zone";default:return"Neutral zone"}}(t.zone)})]})]})};var u=n(10174),m=n(67087),x=n(76356);let y=e=>{let{player1Id:t,player2Id:n,player1TeamId:s,player2TeamId:a}=e;return n?(0,r.jsxs)(x.az,{position:"relative",w:"3xl",h:"xl",flexShrink:0,children:[(0,r.jsx)(x.az,{position:"absolute",left:"0",zIndex:"button",children:(0,r.jsx)(i.Ez,{id:t,teamId:s,small:!0})}),(0,r.jsx)(x.az,{position:"absolute",right:"0",children:(0,r.jsx)(i.Ez,{id:n,teamId:a,small:!0})})]}):(0,r.jsx)(i.Ez,{id:t,teamId:s,small:!0})};function h(e,t){let n=t?e.name:e.shortName||e.name;return e.jerseyNumber&&(n="".concat(n," #").concat(e.jerseyNumber)),n}let j=e=>{let{comment:t}=e,{leftTeam:n,rightTeam:s}=(0,a.useContext)(l.y$),d=(0,m.g3)(),{ref:c,isSelected:x,color:j}=(0,o.qF)(t.id),{player:f,assist1:p,assist2:v,isHome:g,homeScore:b,awayScore:w}=t,C=(d?!g:g)?n:s,[S,z]=d?[w,b]:[b,w];return(0,r.jsxs)(i.hF,{children:[(0,r.jsx)(i.JJ,{comment:t}),(0,r.jsxs)(i.cH,{image:f&&(0,r.jsx)(i.Ez,{id:f.id,teamId:C.id}),players:[f,p,v],isSelected:x,ref:c,borderColor:j,children:[(0,r.jsx)(i.SI,{children:function(e){switch(e.goalType){case"emptyNetGoal":return"Empty Net Goal!";case"penaltyGoal":return"Penalty Shot Goal!";case"shootoutGoal":return"Shootout Goal!";default:return"Goal!"}}(t)}),f&&(0,r.jsx)(u.EY,{display:"block",mb:"sm",children:h(f,!0)}),p&&(0,r.jsxs)(i.Pc,{image:(0,r.jsx)(y,{player1Id:p.id,player2Id:null==v?void 0:v.id}),secondary:!0,children:[v?"Assists":"Assist",": ",h(p),v?", ".concat(h(v)):""]}),C.nameCode&&void 0!==S&&void 0!==z&&(0,r.jsxs)(i.jv,{secondary:!0,children:[C.nameCode," ",S," - ",z]})]})]})},f=e=>{let{comment:t}=e,{event:n}=(0,a.useContext)(l.y$),{ref:d,isSelected:c,color:u}=(0,o.qF)(t.id),m=t.isHome?n.homeTeam:n.awayTeam,x=t.goalkeeper;return(0,r.jsxs)(i.hF,{children:[(0,r.jsx)(i.JJ,{comment:t}),(0,r.jsxs)(i.cH,{image:(0,r.jsx)(s.p,{id:m.id,size:24}),players:[x],isSelected:c,ref:d,borderColor:u,children:[(0,r.jsx)(i.SI,{children:function(e){switch(e.type){case"goalkeeperOut":return"Goalkeeper Out";case"goalkeeperBack":return"Goalkeeper Back In";default:return null}}(t)}),x&&(0,r.jsx)(i.Pc,{image:(0,r.jsx)(i.Ez,{id:x.id,small:!0,teamId:m.id}),children:h(x,!0)})]})]})},p=e=>{let{comment:t}=e,{event:n}=(0,a.useContext)(l.y$),{ref:d,isSelected:c,color:u}=(0,o.qF)(t.id),{isHome:m,player:x,goalkeeper:y}=t,j=m?n.homeTeam:n.awayTeam,f=m?n.awayTeam:n.homeTeam;return(0,r.jsxs)(i.hF,{children:[(0,r.jsx)(i.JJ,{comment:t}),(0,r.jsxs)(i.cH,{image:(0,r.jsx)(s.p,{id:j.id,size:24}),players:[x,y],isSelected:c,ref:d,borderColor:u,children:[(0,r.jsx)(i.SI,{children:function(e){switch(e.type){case"penaltyMissed":return"PEN"===e.periodName?"Shootout Shot Missed":"Penalty Shot Missed";case"penaltySaved":return"PEN"===e.periodName?"Shootout Shot Saved":"Penalty Shot Saved";default:return null}}(t)}),x&&(0,r.jsx)(i.Pc,{image:(0,r.jsx)(i.Ez,{id:x.id,teamId:j.id,small:!0}),children:h(x,!0)}),"penaltySaved"===t.type&&y&&(0,r.jsxs)(i.Pc,{image:(0,r.jsx)(i.Ez,{id:y.id,teamId:f.id,small:!0}),secondary:!0,children:["Saved by: ",h(y,!0)]})]})]})};var v=n(89827);let g=e=>{let{penalizedPlayer:t,penaltyServedByPlayer:n,penaltyDrawnByPlayer:s}=e;return t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.Pc,{image:(0,r.jsx)(y,{player1Id:t.id,player2Id:null==n?void 0:n.id}),children:[h(t,!0),(0,r.jsx)("br",{}),n&&"Served by: ".concat(h(n,!0))]}),s&&(0,r.jsxs)(i.jv,{secondary:!0,children:["Against: ",h(s,!0)]})]}):(0,r.jsxs)(r.Fragment,{children:[n&&(0,r.jsxs)(i.Pc,{image:(0,r.jsx)(i.Ez,{id:n.id,small:!0}),children:["Served by: ",h(n,!0)]}),s&&(0,r.jsxs)(i.jv,{secondary:!0,children:["Against: ",h(s,!0)]})]})},b=e=>{let{comment:t}=e,{event:n}=(0,a.useContext)(l.y$),{ref:d,isSelected:c,color:u}=(0,o.qF)(t.id),m=t.isHome?n.homeTeam:n.awayTeam,x=t.penalizedPlayer,y=t.penaltyServedByPlayer,h=t.penaltyDrawnByPlayer;return(0,r.jsxs)(i.hF,{children:[(0,r.jsx)(i.JJ,{comment:t}),(0,r.jsxs)(i.cH,{image:(0,r.jsx)(s.p,{id:m.id,size:24}),players:[x,y,h],isSelected:c,ref:d,borderColor:u,children:[(0,r.jsx)(i.SI,{children:function(e){var t;let n=function(e){switch(null==e?void 0:e.severity){case"major":return"Major";case"minor":return"Minor";case"bench":return"Bench";case"game":return"Game";case"doubleMinor":return"Double Minor";default:return"Suspension"}}(e.penaltyType),r=null==(t=e.penaltyType)?void 0:t.description,s=e.duration?(0,v.M)(e.duration/60):void 0,a="".concat(n,": ");return r&&(a+=r),s&&(a+=" | ".concat(s,"'")),a}(t)}),(0,r.jsx)(g,{penalizedPlayer:x,penaltyServedByPlayer:y,penaltyDrawnByPlayer:h})]})]})};var w=n(46517);let C=e=>{let{comment:t}=e;switch(t.type){case"scoreChange":case"penaltyScored":return(0,r.jsx)(j,{comment:t});case"penaltyMissed":case"penaltySaved":return(0,r.jsx)(p,{comment:t});case"faceOff":return(0,r.jsx)(c,{comment:t});case"suspension":return(0,r.jsx)(b,{comment:t});case"goalkeeperOut":case"goalkeeperBack":return(0,r.jsx)(f,{comment:t});case"shotOffTarget":case"shotSaved":case"shotBlocked":case"hit":return(0,r.jsx)(d,{comment:t});default:return(0,r.jsx)(w.b,{comment:t,preferTeamImage:!0})}}},42526:(e,t,n)=>{n.d(t,{c:()=>u});var r=n(6029),s=n(76356),a=n(93338),l=n(55729),o=n(18970),i=n(69487),d=n(66331),c=n(96861);let u=e=>{let{children:t,image:n,players:u,isSelected:m,borderColor:x,bg:y,elevation:h,ref:j}=e,[f,p]=(0,l.useState)(!1),{event:v}=(0,l.useContext)(o.y$),{openEventPlayerStatistics:g}=(0,d.d)(),b=null==u?void 0:u.filter(e=>!!e),w=v.hasEventPlayerStatistics&&b&&b.length>0,C=(0,l.useCallback)(e=>{w&&(e.preventDefault(),b.length>1?p(!0):g({event:v,player:b[0]},c._l.TextCommentary))},[b,v]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.so,{ref:j,grow:1,bg:y||{base:"surface.s1",md:"surface.s2"},elevation:h,br:"md",p:"sm",style:{border:"1.5px solid ".concat(m&&x?a.S.var(x):"transparent")},justify:"space-between",gap:"sm",onClick:C,cursor:w?"pointer":void 0,children:[(0,r.jsx)(s.az,{alignSelf:"center",children:t}),n]}),b&&(null==b?void 0:b.length)>1&&(0,r.jsx)(i.Ay,{isOpen:f,setIsOpen:p,players:b,onPlayerClick:e=>{p(!1),g({event:v,player:e},c._l.TextCommentary)}})]})}},46517:(e,t,n)=>{n.d(t,{b:()=>u});var r=n(6029),s=n(33144),a=n(46787),l=n(55729),o=n(90248),i=n(18970),d=n(9220),c=n(42526);let u=e=>{let{comment:t,preferTeamImage:n}=e,{event:u}=(0,l.useContext)(i.y$),{isHome:m,player:x,playerIn:y,playerOut:h,goalkeeper:j}=t,f=void 0===m?void 0:m?u.homeTeam:u.awayTeam,p=n&&f?(0,r.jsx)(s.p,{id:f.id,size:24}):x&&(0,r.jsx)(d.Ez,{id:x.id,teamId:null==f?void 0:f.id}),v={[a.zZK.ShotOnTarget]:"shotOnTarget",[a.zZK.Substitution]:"substitution",[a.zZK.Injury]:"injury",[a.zZK.InjuryReturn]:"commentary_injury_return",[a.zZK.YellowCard]:"yellowCard",[a.zZK.RedCard]:"redCard",[a.zZK.PenaltyMissed]:"penaltyMissed",[a.zZK.PenaltyAwarded]:"penaltyNotAwarded.false",[a.zZK.PenaltySaved]:"football_commentary_penalty_saved",[a.zZK.VideoAssistantReferee]:"varDecision",[a.zZK.VideoAssistantRefereeOver]:"commentary_var_check_over"}[t.type],g=t.text;return(0,r.jsxs)(d.hF,{children:[(0,r.jsx)(d.JJ,{comment:t}),(0,r.jsxs)(c.c,{image:p,players:[x,y,h,j],children:[v&&(0,r.jsx)(d.SI,{children:(0,r.jsx)(o.A,{id:v})}),g&&(0,r.jsx)(d.jv,{children:g})]})]})}},47580:(e,t,n)=>{n.d(t,{A:()=>r});function r(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n=t)&&(n=t);else{let r=-1;for(let s of e)null!=(s=t(s,++r,e))&&(n=s)&&(n=s)}return n}},50747:(e,t,n)=>{n.d(t,{Ay:()=>d,Z4:()=>c});var r=n(47580),s=n(66466),a=n(39984);function l(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(et))}function o(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}var i=n(42943);function d(e,t,n){if(!(!(d=(e=Float64Array.from((0,i.n)(e,n))).length)||isNaN(t*=1))){if(t<=0||d<2)return(0,s.A)(e);if(t>=1)return(0,r.A)(e);var d,c=(d-1)*t,u=Math.floor(c),m=(0,r.A)((function e(t,n,r=0,s=1/0,i){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),s=Math.floor(Math.min(t.length-1,s)),!(r<=n&&n<=s))return t;for(i=void 0===i?l:function(e=a.A){if(e===a.A)return l;if("function"!=typeof e)throw TypeError("compare is not a function");return(t,n)=>{let r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(i);s>r;){if(s-r>600){let a=s-r+1,l=n-r+1,o=Math.log(a),d=.5*Math.exp(2*o/3),c=.5*Math.sqrt(o*d*(a-d)/a)*(l-a/2<0?-1:1),u=Math.max(r,Math.floor(n-l*d/a+c)),m=Math.min(s,Math.floor(n+(a-l)*d/a+c));e(t,n,u,m,i)}let a=t[n],l=r,d=s;for(o(t,r,n),i(t[s],a)>0&&o(t,r,s);li(t[l],a);)++l;for(;i(t[d],a)>0;)--d}0===i(t[r],a)?o(t,r,d):o(t,++d,s),d<=n&&(r=d+1),n<=d&&(s=d-1)}return t})(e,u).subarray(0,u+1));return m+((0,s.A)(e.subarray(u+1))-m)*(c-u)}}function c(e,t,n=i.A){if(!(!(r=e.length)||isNaN(t*=1))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,a=Math.floor(s),l=+n(e[a],a,e);return l+(n(e[a+1],a+1,e)-l)*(s-a)}}},66466:(e,t,n)=>{n.d(t,{A:()=>r});function r(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let s of e)null!=(s=t(s,++r,e))&&(n>s||void 0===n&&s>=s)&&(n=s)}return n}},66978:(e,t,n)=>{n.d(t,{A:()=>function e(){var t,n=[],o=[],i=[];function d(){var e=0,t=Math.max(1,o.length);for(i=Array(t-1);++e0?i[t-1]:n[0],t{n.r(t),n.d(t,{default:()=>$});var r=n(6029),s=n(32523),a=n(46787),l=n(55729),o=n(18970),i=n(74610),d=n(22830),c=n(46222),u=n(10174),m=n(76356),x=n(90248),y=n(41164),h=function(e){return e.All="all",e.KeyEvents="key-events",e}({});let j=e=>[a.QCR.AmericanFootball,a.QCR.Basketball].includes(e),f=e=>{let{selectedTab:t,onTabChange:n}=e,{event:s}=(0,l.useContext)(o.y$),a=j((0,y.c5)(s));return(0,r.jsx)(m.az,{p:"sm",borderBottom:a?void 0:"1px solid",borderColor:a?void 0:"neutrals.nLv4",elevation:{base:void 0,mdDown:"2"},bg:{base:void 0,mdDown:"surface.s1"},children:(0,r.jsx)(u.tU,{variant:"tertiary",initialValue:h.All,value:t,onChange:n,children:(0,r.jsxs)(u.tU.List,{p:"sm",children:[(0,r.jsx)(u.tU.Tab,{tabKey:h.All,children:(0,r.jsx)(x.A,{id:"all"})}),(0,r.jsx)(u.tU.Tab,{tabKey:h.KeyEvents,children:(0,r.jsx)(x.A,{id:"commentary_key_events"})})]})})})};var p=n(94565),v=n(81484),g=n(18858);let b=e=>{let{periods:t,selectedPeriod:n,onPeriodChange:s}=e,a=(0,l.useContext)(o.Ws),i=(0,g.Ay)();if(!t.length||!j(a))return null;let d=t.map(e=>({tabKey:e,tabValue:(0,r.jsx)(v.fP,{id:e,short:!0})}));return(0,r.jsx)(p.PI,{top:i,bg:"surface.s1",zIndex:p.Py.Sticky-1,children:(0,r.jsx)(m.az,{p:"sm",bg:"surface.s1",borderBottom:"1px solid {colors.neutrals.nLv4}",children:(0,r.jsx)(u.tU,{variant:"secondary",initialValue:n,onChange:s,fullWidthTabs:!0,children:(0,r.jsx)(u.tU.List,{children:d.map((e,t)=>(0,r.jsx)(u.tU.Tab,{tabKey:e.tabKey,children:e.tabValue},t))})})})})};var w=n(14868),C=n(45860),S=n(9220),z=n(40076);let T=e=>{let{event:t}=(0,l.useContext)(o.y$),n=e.isHome?t.homeTeam:t.awayTeam,r=e.player,s=function(e,t){let n=e.isHome?t.homeTeam.shortName:t.awayTeam.shortName;switch(e.type){case"touchdown":return"Touchdown ".concat(n,"!");case"fieldGoalMiss":return"Missed Field Goal";case"twoPointConversion":return"2-PT Conversion";case"turnoverOnDowns":return"Turnover on Downs";case"fourthDownConversion":return"4th Down Conversion";case"passInterception":return"Interception";case"passInterceptionReturn":return"Interception Return";case"tenYardsPlay":return"".concat(e.yardsGained," Yard ").concat("run"===e.playType?"Run":"Pass");case"fieldGoal":return"Field Goal";case"extraPoint":return"Extra Point";case"safety":return"Safety";default:return null}}(e,t);return{team:n,player:r,title:s,text:function(e){return"twoMinuteWarning"===e.type?"Two-Minute Warning":e.text}(e),downDistance:function(e,t){if("extraPoint"===e.type){let n=1===e.teamHalf?t.homeTeam.nameCode:t.awayTeam.nameCode;return"XP attempt from ".concat(n," ").concat(e.yardline)}let n={currentDown:e.down,currentTeamHalf:e.teamHalf,currentPossession:e.possession,currentYardline:e.yardline,currentYardsToFirstDown:e.yardsToFirstDown,isGoalPossession:e.isGoal};return(0,z.XE)(n,t)}(e,t)}},I=e=>{let{comment:t}=e,{player:n,team:s,title:a,text:l,downDistance:o}=T(t);return(0,r.jsxs)(m.so,{children:[(0,r.jsx)(S.JJ,{comment:t}),(0,r.jsxs)(S.cH,{bg:"surface.s0",image:n&&(0,r.jsx)(S.Ez,{id:n.id,teamId:s.id}),players:[n],children:[a&&(0,r.jsx)(S.SI,{children:a}),l&&(0,r.jsx)(S.jv,{children:l}),o&&(0,r.jsx)(S.jv,{secondary:!0,children:o})]})]})},P=e=>{let{comments:t}=e;return(0,r.jsx)(m.so,{direction:"column",gap:"lg",p:"lg",children:t.map(e=>(0,r.jsx)(I,{comment:e},e.id))})};var k=n(33144),A=n(22375);let E=e=>{let{drive:t}=e;return(0,r.jsxs)(m.so,{gap:"lg",align:"center",children:[(0,r.jsx)(k.p,{id:t.teamId,w:32,h:32}),(0,r.jsxs)(m.so,{direction:"column",align:"flex-start",children:[(0,r.jsx)(u.EY,{textStyle:"display.medium",color:null!==t.endReason?"neutrals.nLv1":"status.live",children:t.endReason||(0,r.jsx)(x.A,{id:"inProgress"})}),(0,r.jsx)(u.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:(0,r.jsx)(x.A,{id:"am_football_drive_summary",values:{plays:t.playCount,yards:t.netDriveYards,time:(0,A.OV)(t.durationSeconds)}})})]})]})},N=e=>{let{comment:t,drive:n,defaultOpened:s=!1}=e;return(0,r.jsxs)(p.nD.Item,{defaultOpened:s,bg:"surface.s1",elevation:[2,void 0],br:["lg",void 0],borderTop:[void 0,"onSurface.nLv4"],borderBottom:[void 0,"onSurface.nLv4"],mt:-1,overflow:"hidden",children:[(0,r.jsx)(p.nD.Trigger,{children:(0,r.jsx)(E,{drive:n})}),(0,r.jsx)(p.nD.Content,{children:(0,r.jsx)(P,{comments:t})})]})},K=e=>{let{comment:t}=e,{player:n,team:s,title:a,text:l,downDistance:o}=T(t);return(0,r.jsxs)(m.so,{children:[(0,r.jsx)(S.JJ,{comment:t}),(0,r.jsxs)(S.cH,{image:n&&(0,r.jsx)(S.Ez,{id:n.id,teamId:s.id}),players:[n],elevation:{mdDown:"2"},children:[a&&(0,r.jsx)(S.SI,{children:a}),l&&(0,r.jsx)(S.jv,{children:l}),o&&(0,r.jsx)(S.jv,{secondary:!0,children:o})]})]})},R=e=>{let{comment:t}=e,{player:n,team:s,title:a,text:l,downDistance:o}=T(t);return(0,r.jsxs)(m.so,{br:"lg",elevation:{mdDown:"2"},bg:{mdDown:"surface.s1"},py:{md:"md"},px:{md:"lg"},children:[(0,r.jsx)(S.JJ,{comment:t}),(0,r.jsxs)(S.cH,{bg:{base:"surface.s1",md:"surface.s0"},image:n&&(0,r.jsx)(S.Ez,{id:n.id,teamId:s.id}),players:[n],children:[a&&(0,r.jsx)(S.SI,{children:a}),l&&(0,r.jsx)(S.jv,{children:l}),o&&(0,r.jsx)(S.jv,{secondary:!0,children:o})]})]})},M=e=>{let{selectedTab:t,selectedPeriod:n,comments:s,periods:i}=e,{drives:c}=(()=>{let{event:e}=(0,l.useContext)(o.y$),t=(0,d.j)((0,y.c5)(e)),{data:n}=(0,C.Ay)(t?a.bnp.commentary(e.id,t):null,(0,y.rf)(e));return{drives:null==n?void 0:n.drives}})();if(t===h.KeyEvents)return(0,r.jsx)(m.so,{p:"md",direction:"column",gap:"md",children:s.map(e=>(0,r.jsx)(K,{comment:e},e.id))});let u=s.findIndex(e=>!!Array.isArray(e)||void 0!==e.driveId);return(0,r.jsx)(p.nD,{children:(0,r.jsxs)(m.so,{p:{mdDown:"md"},direction:"column",gap:{mdDown:"md"},children:[(0,r.jsx)(m.az,{hideBelow:"md",children:(0,r.jsx)(m.cG,{})}),s.map((e,t)=>{let s=function(e){return Array.isArray(e)?e:[e]}(e),a=function(e,t){return void 0===e||void 0===t?null:t.find(t=>t.id===e)}(s[0].driveId,c);return a?(0,r.jsx)(N,{comment:s,drive:a,defaultOpened:function(e,t,n){return 0!==e.length&&[e[0],e[e.length-1]].includes(t)&&n}(i||[],n,u===t)},s[0].id):(0,r.jsx)(R,{comment:s[0]},s[0].id)})]})})};var F=n(67087);let Z={freeThrowMade:"basketball_free_throw_made",twoPointMade:"basketball_two_points_made",threePointMade:"basketball_three_points_made"},_=e=>{let{comment:t}=e,{event:n}=(0,l.useContext)(o.y$),{homeTeam:s,awayTeam:a}=n,i="ownGoal"===t.goalType,d="penalty"===t.goalType,c=!i&&!d,u=t.player,m=t.isHome?s.id:a.id;return u?(0,r.jsxs)(S.hF,{children:[(0,r.jsx)(S.JJ,{comment:t}),(0,r.jsxs)(S.cH,{image:(0,r.jsx)(S.Ez,{id:u.id,teamId:m}),players:[u],children:[(0,r.jsx)(S.SI,{isUppercase:c,children:c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.A,{id:"goal"}),"!"]}):(0,r.jsx)(x.A,{id:t.goalType})}),(0,r.jsx)(S.jv,{children:t.text})]})]}):null},D=e=>{let{comment:t}=e,{event:n}=(0,l.useContext)(o.y$),s=t.isHome?n.homeTeam:n.awayTeam;return t.playerIn&&t.playerOut?(0,r.jsxs)(S.hF,{children:[(0,r.jsx)(S.JJ,{comment:t}),(0,r.jsxs)(S.cH,{image:(0,r.jsx)(k.p,{size:24,id:s.id,name:s.name}),players:[t.playerIn,t.playerOut],children:[(0,r.jsx)(S.SI,{children:(0,r.jsx)(x.A,{id:"substitution"})}),(0,r.jsxs)(S.Pc,{image:(0,r.jsx)(S.Ez,{id:t.playerIn.id,small:!0}),children:[t.playerIn.name,(0,r.jsxs)(u.EY,{ml:"2xs",textStyle:"body.small",color:"secondary.default",children:["(",(0,r.jsx)(x.A,{id:"substitution.in"}),")"]})]}),(0,r.jsxs)(S.Pc,{image:(0,r.jsx)(S.Ez,{id:t.playerOut.id,small:!0}),children:[t.playerOut.name,(0,r.jsxs)(u.EY,{ml:"2xs",textStyle:"body.small",color:"status.error.default",children:["(",(0,r.jsx)(x.A,{id:"substitution_out"}),")"]})]})]})]}):null};var H=n(46517),J=n(29695);let G={[a.QCR.Football]:e=>{let{comment:t}=e;switch(t.type){case"scoreChange":case"penaltyScored":return(0,r.jsx)(_,{comment:t});case"substitution":return(0,r.jsx)(D,{comment:t});default:return(0,r.jsx)(H.b,{comment:t})}},[a.QCR.Basketball]:function(e){let{comment:t}=e,{event:n}=(0,l.useContext)(o.y$),[s,a]=(0,F.jr)(t,"homeScore","awayScore"),{isHome:i,player:d,playerIn:c,playerOut:m,goalkeeper:y}=t,h=void 0===i?void 0:i?n.homeTeam:n.awayTeam,j=d&&(0,r.jsx)(S.Ez,{id:d.id,teamId:null==h?void 0:h.id}),f=function(e){if("scoreChange"===e.type&&e.goalType)return Z[e.goalType]}(t),p=t.text,v="scoreChange"===t.type&&!!(null==h?void 0:h.nameCode)&&void 0!==s&&void 0!==a;return(0,r.jsxs)(S.hF,{children:[(0,r.jsx)(S.JJ,{comment:t}),(0,r.jsxs)(S.cH,{image:j,players:[d,c,m,y],children:[f&&(0,r.jsx)(S.SI,{children:(0,r.jsx)(x.A,{id:f})}),p&&(0,r.jsx)(S.jv,{children:p}),v&&(0,r.jsx)(u.EY,{textStyle:"assistive.default",color:"neutrals.nLv3",children:"".concat(h.nameCode," ").concat(s," - ").concat(a)})]})]})},[a.QCR.IceHockey]:J.y},O=e=>{let{comments:t}=e,n=G[(0,l.useContext)(o.Ws)];return(0,r.jsx)(m.so,{p:"md",direction:"column",gap:"md",children:t.map(e=>(0,r.jsx)(n,{comment:e},e.id))})},B=e=>{let{selectedTab:t,selectedPeriod:n,comments:s,periods:i}=e;return(0,l.useContext)(o.Ws)===a.QCR.AmericanFootball?(0,r.jsx)(M,{selectedTab:t,selectedPeriod:n,comments:s,periods:i}):(0,r.jsx)(O,{comments:s})},Y=e=>{let{selectedTab:t,selectedPeriod:n,comments:s,periods:i}=e,{isMobile:d}=(0,u.$c)(),{event:m,location:x}=(0,l.useContext)(o.y$),[j,f]=(0,l.useState)(!1),p=function(e,t,n){return t===h.KeyEvents?n.filter(e=>Object.values(a.zZK).includes(e.type)):e===a.QCR.AmericanFootball?function(e){let t=[],n=null,r=null;for(let s of e)void 0!==s.driveId?(s.driveId!==r&&(n=[],t.push(n),r=s.driveId),n&&n.push(s)):(t.push(s),r=null);return t.map(e=>Array.isArray(e)&&1===e.length?e[0]:e)}(n.filter(e=>"timeout"!==e.type||void 0!==e.driveId)):n}((0,y.c5)(m),t,s),v=x&&[o.cb.EventPage].includes(x)&&p.length>10&&!d;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B,{selectedTab:t,selectedPeriod:n,comments:function(e,t){return t?e:e.slice(0,10)}(p,j||d||x===o.cb.Widget),periods:i}),(0,r.jsx)(c.Zp.Footer,{ctaParams:v?{messageId:j?"show_less":"show_more",onClick:()=>f(e=>!e),icon:j?w.X.Up:w.X.Down}:void 0,defaultHeight:{base:"[0px]",md:"lg"}})]})},Q=e=>{let{periodComments:t,periods:n}=e,s=(0,l.useContext)(o.Ws),{location:i}=(0,l.useContext)(o.y$),d=i===o.cb.Widget,[u,m]=(0,l.useState)(s===a.QCR.Basketball&&n.length?n[n.length-1]:"all"),[x,y]=(0,l.useState)(h.All),j=t[u];return(0,r.jsxs)(c.Zp,{variant:d?"never":"desktop-only",children:[!d&&(0,r.jsx)(c.Zp.Header,{titleId:"commentary",visibility:"desktop-only"}),(0,r.jsx)(b,{periods:n,selectedPeriod:u,onPeriodChange:m}),s!==a.QCR.Basketball&&(0,r.jsx)(f,{selectedTab:x,onTabChange:y}),(0,r.jsx)(Y,{selectedTab:x,selectedPeriod:u,comments:j,periods:n})]})},$=()=>{let e=(0,l.useContext)(o.Ws),{textCommentary:t,periods:n}=(0,d.q)(e!==a.QCR.Basketball);return t?(0,r.jsx)(i.t,{tag:"TextCommentary",children:(0,r.jsx)(Q,{periodComments:t,periods:n})}):(0,r.jsx)(s.E,{uniqueKey:"text-commentary-container-cl",rows:10,rowHeight:56,animate:!0})}}}]);