!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]="ae4794fb-716b-4889-ab64-aa5faf83c3f3",e._sentryDebugIdIdentifier="sentry-dbid-ae4794fb-716b-4889-ab64-aa5faf83c3f3")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12514],{12514:(e,t,i)=>{i.r(t),i.d(t,{default:()=>W});var r=i(6029),n=i(21377),s=i(21501),a=i(55729),l=i(45860),o=i(46222),c=i(18970),d=i(83713),u=i(80021),m=i(36824),h=i(64082),p=i(99064),g=i(6695),x=i(27956),f=i(14632),y=i(41735),v=i(56591);let j=(e,t)=>{if(e.length<2)return;let i=48;for(;i;){for(let i=0;i1&&(r.x-=1),n.x90.5?120:90,u=(s=[...e],a=r.getBoundingClientRect().width,s&&s.length?(s.forEach(e=>{let t=(e.time>d?d:e.time)/d*a,i=function(e,t,i){if(e<=16)return e;if(t-e<=16)return 16-(t-e);if(90===i){let i=t/2;return e>i&&e<=i+16?e-i:e>=i-16&&e<=i?16-(i-e):8}{if(120!==i)return 8;let r=45/i*t,n=90/i*t,s=105/i*t;if(e>r&&e<=r+16)return e-r;if(e>=r-16&&e<=r)return 16-(r-e)+3;if(e>n&&e<=n+16)return e-n;else if(e>=n-16&&e<=n)return 16-(n-e)+3;else if(e>s&&e<=s+16)return e-s;else if(e>=s-16&&e<=s)return 16-(s-e)+3;else return 8}}(t,a,d);e.x=t-i}),j(s.filter(e=>e.isHome),a),j(s.filter(e=>!e.isHome),a),s):[]);(0,v.A)(o.current).selectAll("*").remove();let m=(0,v.A)("g.incident-group").selectAll("svg").data(u.filter(e=>"goal"===e.incidentType||"inGamePenalty"===e.incidentType),e=>`${e.time}-${e.incidentType}-${e.isHome}`),h=m.enter().append("svg").attr("viewBox","0 0 16 16").attr("x",e=>e.x).attr("width",16).attr("height",16).attr("opacity",0).attr("y",e=>e.isHome?-4:68).style("fill",e=>"ownGoal"===e.incidentClass||"missed"===e.incidentClass?l.colors.error.default:e.isHome?i.primary:i.secondary);m.merge(h),h.append("path").attr("d",e=>"penalty"===e.incidentClass?"M8.07 5.45c2.63 0 4.77 2.14 4.77 4.77 0 2.63-2.14 4.77-4.77 4.77-2.63 0-4.77-2.14-4.77-4.77 0-2.63 2.14-4.77 4.77-4.77zm.19 1.2h-.2c-.92 0-1.75.35-2.39.92l.63.37-.45 1.69-1.37.49v.12c0 .45.08.89.24 1.29l.64-.33 1.06 1.18-.17.94c.54.32 1.16.5 1.82.5 1.98 0 3.59-1.61 3.59-3.59 0-1.04-.44-1.96-1.14-2.62l-.6.55-1.86-.78.2-.73zm1.52 2.78.95 1.73-1.42 1.56-1.41-.55v-2.06l1.88-.68zM15 1v6.75h-1.5V2.5h-11v5.25H1V1h14z":"ownGoal"===e.incidentClass?"M5 1v2.25h8.75V7.1c.77.84 1.25 1.94 1.25 3.17 0 2.61-2.12 4.73-4.73 4.73a4.74 4.74 0 0 1-4.73-4.73c0-2.6 2.13-4.72 4.73-4.72.71 0 1.38.17 1.98.45V4.75H5V7H4L1 4l3-3h1zm5.46 5.73h-.19c-.91 0-1.73.35-2.36.91l.62.37-.45 1.67-1.36.48v.12c0 .45.09.88.24 1.28l.63-.32 1.05 1.17-.17.93c.53.31 1.14.49 1.8.49l.01-.01a3.55 3.55 0 0 0 3.55-3.55c0-1.02-.44-1.94-1.13-2.59l-.59.55-1.84-.78.19-.72zm1.5 2.75.94 1.72-1.4 1.55-1.4-.55v-2.04l1.86-.68z":"missed"===e.incidentClass?"m10.6 7 1.399 1.524-2.522 2.474L12 13.474 10.6 15 8 12.448 5.399 15 4 13.474l2.522-2.476L4 8.524 5.399 7l2.6 2.549L10.6 7zM15 1v6.75h-1.5V2.5h-11v5.25H1V1h14z":"M8 1c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.14-7-7 3.14-7 7-7zm-.01 1.73c-1.35 0-2.57.52-3.5 1.35l.92.55-.66 2.48-2.01.72V8c0 .67.13 1.31.36 1.9l.94-.48 1.55 1.73-.25 1.38c.78.46 1.69.73 2.66.73a5.29 5.29 0 0 0 5.26-5.28c0-1.51-.65-2.87-1.67-3.83l-.88.81-2.72-1.15.29-1.07c-.1-.01-.19-.01-.29-.01zm2.51 4.1 1.39 2.54-2.07 2.29-2.08-.81V7.83l2.76-1z"),h.transition().attr("opacity",1).attr("y",e=>e.isHome?-20:84);let p=(0,v.A)("g.incident-group").selectAll("image").data(u.filter(e=>"goal"!==e.incidentType&&"inGamePenalty"!==e.incidentType),e=>`${e.time}-${e.incidentType}-${e.incidentClass}-${e.isHome}`),g=p.enter().append("image").attr("width",16).attr("height",16).attr("y",e=>e.isHome?-4:68).attr("opacity",0).attr("href",e=>`${n}icon-${e.incidentClass}-card.svg`).attr("x",e=>e.x);p.merge(g),g.transition().attr("opacity",1).attr("y",e=>e.isHome?-20:84)}(s)},100,[e,t,i]),(0,r.jsx)("g",{className:"incident-group",ref:o})}let b=y.default.svg` overflow: visible; height: ${80}px; width: 100%; shape-rendering: crispEdges; user-select: none; -webkit-tap-highlight-color: transparent; .start, .live { shape-rendering: geometricPrecision; } .incident-group svg { shape-rendering: auto; } `,w=[n.XUj.Postponed,n.XUj.Delayed,n.XUj.Canceled,n.XUj.Interrupted,n.XUj.Suspended,n.XUj.WillContinue],C=Object.assign({},x,f,g);function L(e){var t,{colors:i={},hideIncidents:l}=e,o=(0,h.T)(e,["colors","hideIncidents"]);let c=(0,a.useRef)(null),d=(0,s.ZC)(o.isLive),u=(0,y.useTheme)(),m=w.includes(null==(t=o.status)?void 0:t.type),g="rtl"===u.settings.textDirection,x=(0,a.useMemo)(()=>Object.assign({primary:u.colors.secondary.default,secondary:u.colors.primary.default,primaryBackground:u.colors.secondary.highlight,secondaryBackground:u.colors.primary.highlight},i),[...Object.values(i),u]),{primary:f,secondary:v,primaryBackground:j,secondaryBackground:L}=x;return(0,s.st)(function(){var e,t,i,r,s,a,l;let d,h,p,g,x,y;if(!o.liveForm.length)return;let{liveForm:k,isLive:b}=o,w=c.current,z=C.select(w),{duration:T,halftimeDuration:A,endDuration:_}=(d=90,h=90,p=105,g=120,x=45,y=90,(null==(i=k[45])?void 0:i.minute)===45.5&&(d+=1,x+=1,y+=1,h+=1,p+=1,g+=1),(null==(r=k[h])?void 0:r.minute)===90.5&&(d+=1,y+=1,p+=1,g+=1,h+=1),(null==(s=k[p])?void 0:s.minute)===105.5&&(d+=1,g+=1),(null==(a=k[g])?void 0:a.minute)===120.5&&(d+=1),(null==(l=k[h])?void 0:l.minute)===91&&(d+=30),{duration:d,halftimeDuration:x,endDuration:y}),H=null==w?void 0:w.getBoundingClientRect();if(!H)return;let I=H.height,S=H.width/T,N=H.height/2,M=N/3,X=(null!=(e=o.bg)?e:o.backgroundColor)?"rgba(0, 0, 0, 0)":void 0,U=[{height:H.height,y:0,fill:null!=X?X:u.colors.surface.s1},{height:N,y:0,fill:null!=X?X:j},{height:N,y:N,fill:null!=X?X:L}],W=z.select("g.background-group").selectAll("rect").data(U);W.enter().append("rect").attr("width",b?0:k.length*S).merge(W).attr("x",0).attr("y",e=>e.y).attr("height",e=>e.height).attr("fill",e=>e.fill).transition().attr("width",k.length*S).duration(300*(b?2:1)).ease(C.easeLinear);let $=z.select("g.bars-group").selectAll("rect").data(k),F=e=>Math.min(Math.abs(e.value)/100,1)*N,P=e=>Math.min(N-Math.sign(e.value)*F(e),N);$.exit().transition().attr("height",0).attr("y",N).duration(300).remove();let V=$.enter().append("rect").attr("x",(e,t)=>S*t).attr("y",e=>b?N:e.value>=0?2*M:N).attr("height",()=>b?0:M).attr("width",S).attr("fill",e=>e.value>=0?f:v).attr("stroke-width",1).transition().attr("y",e=>P(e)).attr("height",e=>F(e));b?V.delay((e,t)=>t*(600/k.length)):V.duration(300),V=$.transition().attr("x",(e,t)=>S*t).attr("y",e=>P(e)).attr("height",e=>F(e)).attr("width",S).attr("fill",e=>e.value>=0?f:v),b&&V.delay((e,t)=>t*(600/k.length)),V.duration(300).ease(C.easeLinear);let E={id:"liveLine",x1:k.length*S,y1:0,x2:k.length*S,y2:I,strokeColor:b||m?u.colors.sofaSingles.live:"transparent",strokeWidth:2},O=[{id:"top",x1:0,y1:0,x2:k.length*S,y2:0,strokeWidth:1,strokeLinecap:"square",strokeColor:u.colors.onSurface.nLv1},{id:"leftL",x1:0,x2:0,y1:0,y2:16,strokeWidth:1,strokeLinecap:"square",strokeColor:u.colors.onSurface.nLv1},{id:"halftime",x1:S*A,y1:-1,x2:S*A,y2:I+1,strokeColor:u.colors.surface.s1}];if(o.liveForm.length>=45&&o.liveForm.find(e=>e.minute>=46)&&O.push({id:"halftimeL",x1:S*A+1,y1:0,x2:S*A+1,y2:16,strokeWidth:1,strokeLinecap:"square",strokeColor:u.colors.onSurface.nLv1}),T>100){let e=S*_;O.push({id:"end",x1:e,y1:-1,x2:e,y2:I+1,strokeColor:u.colors.surface.s1}),O.push({id:"endL",x1:e+1,y1:0,x2:e+1,y2:16,strokeWidth:1,strokeLinecap:"square",strokeColor:u.colors.onSurface.nLv1}),e=S*(_+(T-_)/2),O.push({id:"et",x1:e,y1:-1,x2:e,y2:I+1,strokeColor:u.colors.surface.s1}),T>105&&o.liveForm.find(e=>e.minute>=106)&&O.push({id:"etL",x1:e+1,y1:0,x2:e+1,y2:16,strokeWidth:1,strokeLinecap:"square",strokeColor:u.colors.onSurface.nLv1})}O.push(E);let D=z.select("g.lines-group").selectAll("line").data(O,e=>e.id);D.exit().remove(),D.enter().append("line").attr("x1",e=>e.x1).attr("y1",e=>e.y1).attr("x2",e=>e.x2).attr("y2",e=>e.y2).attr("stroke-width",e=>{var t;return null!=(t=e.strokeWidth)?t:2}).merge(D).transition().attr("x1",e=>e.x1).attr("x2",e=>e.x2).attr("stroke",e=>e.strokeColor||u.colors.onSurface.nLv5).duration(300*(b?2:1)).ease(C.easeLinear);let q=z.select("g.lines-group").selectAll("circle.live").data([O.find(e=>"liveLine"===e.id)]),B=z.select("g.lines-group").selectAll("circle.start").data([{}]);b||m?(q.enter().append("circle").attr("cy",0).attr("r",0).attr("cx",e=>e.x1).attr("stroke",u.colors.sofaSingles.live).attr("stroke-width",2).attr("fill",u.colors.surface.s1).attr("class","live").transition().delay(1e3).duration(100).attr("r",3),q.merge(q).attr("r",3*((null==(t=o.status)?void 0:t.code)!==n.sum.Halftime)).transition().duration(300*(b?2:1)).ease(C.easeLinear).attr("cx",e=>e.x1),B.enter().append("circle").attr("cy",78).attr("r",3).attr("cx",0).attr("stroke",u.colors.secondary.default).attr("stroke-width",2).attr("fill",u.colors.surface.s1).attr("class","start")):q.remove()},100,[o.liveForm,o.incidents,o.isLive,d,o.status,u.colors,o.bg,o.backgroundColor]),(0,r.jsx)(p.az,Object.assign({grow:1,bg:"onSurface.nLv5",h:80},o,{children:(0,r.jsxs)(b,Object.assign({ref:c,transform:g?"scale(-1,1)":void 0},{children:[(0,r.jsx)("g",{className:"background-group"}),(0,r.jsx)("g",{className:"bars-group"}),(0,r.jsx)("g",{className:"lines-group"}),!l&&(0,r.jsx)(k,{liveForm:o.liveForm,incidents:o.incidents,colors:x,incidentIconPath:o.incidentIconPath})]}))}))}var z=i(91603),T=i(76356),A=i(33144),_=i(28349),H=i(90248),I=i(82536);function S(e){let{isOpen:t,setIsOpen:i,leftTeamId:n,leftTeamName:s,rightTeamId:a,rightTeamName:l}=e;return(0,r.jsxs)(I.A,{isOpen:t,setIsOpen:i,header:"attack_momentum",children:[(0,r.jsx)(T.az,{px:"lg",pt:"sm",maxW:{md:"[320px]"},children:(0,r.jsx)(_.EY,{textAlign:"start",textStyle:"body.mediumParagraph",mb:"sm",display:"block",children:(0,r.jsx)(H.A,{id:"attack_momentum_description"})})}),(0,r.jsxs)(T.az,{px:"lg",maxW:{md:"[320px]"},children:[(0,r.jsx)(_.EY,{color:"secondary.default",display:"block",textStyle:"assistive.default",py:"xs",children:(0,r.jsx)(H.A,{id:"attack_momentum_first",values:{teamName:s}})}),(0,r.jsxs)(T.so,{align:"center",children:[(0,r.jsxs)(T.so,{pr:"md",direction:"column",gap:"lg",children:[(0,r.jsx)(A.p,{size:24,id:n}),(0,r.jsx)(A.p,{size:24,id:a})]}),(0,r.jsx)(_._V,{width:"[127px]",height:"[140px]",srcSet:"/static/images/exportable-bitmap-info@2x.png 2x, /static/images/exportable-bitmap-info@3x.png 3x",src:"/static/images/exportable-bitmap-info.png",alt:"Attack Momentum Legend"})]}),(0,r.jsx)(_.EY,{color:"primary.default",display:"block",textStyle:"assistive.default",py:"xs",children:(0,r.jsx)(H.A,{id:"attack_momentum_away",values:{teamName:l}})})]})]})}let N=e=>{let{liveForm:t,isLive:i,leftTeamId:n,leftTeamName:s,rightTeamId:l,rightTeamName:o,incidents:c,status:d,colors:u}=e,[m,h]=(0,a.useState)(!1);return(0,r.jsxs)(T.az,{position:"relative",px:"sm",children:[(0,r.jsxs)(T.so,{direction:"row",align:"flex-end",overflow:"hidden",children:[(0,r.jsxs)(T.so,{direction:"column",justify:"space-around",h:"[108px]",pb:"[28px]",me:"2xs",children:[(0,r.jsx)(z.p,{id:n,size:20,name:s}),(0,r.jsx)(z.p,{id:l,size:20,name:o})]}),(0,r.jsx)(T.so,{direction:"column",grow:1,children:(0,r.jsx)(T.az,{py:"[28px]",children:(0,r.jsx)(L,{isLive:i,liveForm:t,incidents:c,status:d,colors:u,cursor:"pointer",onClick:()=>{h(!0)}})})})]}),(0,r.jsx)(S,{isOpen:m,setIsOpen:h,leftTeamId:n,leftTeamName:s,rightTeamId:l,rightTeamName:o})]})};var M=i(87397),X=i(63561),U=i(15257);let W=()=>{let{event:e,leftTeam:t,rightTeam:i,location:h}=(0,a.useContext)(c.y$),{status:p,detailId:g}=e,x=(0,s.hX)(),f=p.type===n.XUj.NotStarted,y=p.type===n.XUj.Finished||e.isAwarded,v=p.type===n.XUj.InProgress,j=([n.XUj.Postponed,n.XUj.Canceled].includes(p.type),h===c.cb.Widget),{graphPoints:k,error:b}=(0,U._)(e),{data:w}=(0,l.Ay)(n.bnp.incidents(e.id),(0,X.rf)(e)),C=(0,a.useMemo)(()=>(null==w?void 0:w.incidents)?w.incidents.filter(e=>"goal"===e.incidentType||"inGamePenalty"===e.incidentType||"card"===e.incidentType&&("red"===e.incidentClass||"yellowRed"===e.incidentClass)&&e.time&&e.time>-1).map(e=>({incidentType:e.incidentType,incidentClass:e.incidentClass,time:e.time,isHome:e.isHome})).reverse():void 0,[null==w?void 0:w.incidents]);return x?(0,r.jsx)(M.u,{}):b?v?(0,r.jsx)(u.z,{event:e}):y?(0,r.jsx)(m.n,{event:e}):null:k?f?null:(0,r.jsxs)(o.Zp,{children:[(0,r.jsx)(o.Zp.Header,{titleId:"attack_momentum",actionComponent:j||"number"==typeof g&&1!==g?null:(0,r.jsx)(d.w,{type:"attack_momentum",event:e})}),(0,r.jsx)(N,{leftTeamId:t.id,leftTeamName:t.name,rightTeamId:i.id,rightTeamName:i.name,isLive:v,liveForm:k||[],incidents:C,status:e.status})]}):(0,r.jsx)(M.u,{})}}}]);