!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]="87e28bf7-3760-4e0c-b119-f4ffc5dcda09",e._sentryDebugIdIdentifier="sentry-dbid-87e28bf7-3760-4e0c-b119-f4ffc5dcda09")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9469],{17352:(e,t,n)=>{n.d(t,{Iz:()=>y,K$:()=>g,Q3:()=>c,T8:()=>p,bZ:()=>m,d4:()=>x,do:()=>v,kS:()=>h,mK:()=>d,mt:()=>f});var o=n(21377),i=n(12962),r=n(98516),l=n(9329),s=n(89194),a=n(75067);let d=(e,t,n)=>{let o=(e||0)+(t||0)+(n||0),i=0===o?0:(e||0)/o*100,l=0===o?0:(t||0)/o*100,s=0===o?0:(n||0)/o*100,a=parseFloat((0,r.M)(i)),d=parseFloat((0,r.M)(l)),c=parseFloat((0,r.M)(s)),u=100-(a+d+c);if(0!==u){let e=i%1,t=s%1,n=Math.max(e,l%1,t);n===e?a+=u:n===t?c+=u:d+=u}return{leftPercentage:a,middlePercentage:d,rightPercentage:c}},c=e=>{let t=Object.keys(a.Qf);return Object.keys(e).some(n=>t.includes(n)&&Object.values(e[+n]).some(e=>!!e))},u=e=>{switch(e){case o.gbi.One:case o.gbi.Yes:return s.m.Left;case o.gbi.Two:case o.gbi.No:return s.m.Right;default:return s.m.Middle}},v=e=>{switch(e){case o.rjx.WillBothTeamsScore:return l.NT;case o.rjx.FirstTeamToScore:return l.dT;default:return l.o3}},p=e=>[i.M.DesktopEventPage,i.M.MobileEventPage].includes(e)?"event_details":e===i.M.DesktopWidget?"event_widget":void 0,g=(e,t)=>{switch(e){case o.rjx.WhoWillWin:return t?"who_will_win_daily_10x":"who_will_win";case o.rjx.WillBothTeamsScore:return"will_both_teams_score";case o.rjx.FirstTeamToScore:return"first_team_to_score";default:return}},f=e=>{switch(e){case o.rjx.WhoWillWin:return"1";case o.rjx.WillBothTeamsScore:return"2";case o.rjx.FirstTeamToScore:return"3";default:return}},m=e=>1e3*e.startTimestamp>Date.now()&&e.status.type===o.XUj.NotStarted;function x(e,t){return Object.values(s.m).find(n=>{var o,i;return(null==e||null==(i=e.position)||null==(o=i[n])?void 0:o.voteOption)===t})}function h(e,t,n,o,i){var r,l;let s=n.voteModelKey,a=null==(r=n.position[o])?void 0:r.voteApiKey,d=i?u(i):void 0,c=d?null==(l=n.position[d])?void 0:l.voteApiKey:void 0,v=c===a;if(e&&a){let n=e[s],o=n[a],i=n[c],r=a in n?v?o:o+1:1,l=c&&c in n?v?i:i-1:0;t({...e,[s]:{...e[s],[a]:r,...c&&{[c]:l}}},{revalidate:!1,populateCache:!0})}}function y(e,t){return e?s.w.Votable:t?s.w.Transform:s.w.NoAnimation}},25355:(e,t,n)=>{n.d(t,{N:()=>d});var o=n(78383),i=n.n(o),r=n(55729),l=n(76410),s=n(29953),a=n(92494);let d=(e,t,n)=>{let o=(0,r.useContext)(s.A),d=(0,r.useRef)({onRewardedSlotReady:i(),onRewardedSlotGranted:i(),onRewardedSlotClosed:i(),onRewardedSlotRenderEnded:i()}),c=(0,r.useCallback)(()=>{googletag.cmd.push(()=>{googletag.pubads().removeEventListener("rewardedSlotReady",d.current.onRewardedSlotReady),googletag.pubads().removeEventListener("rewardedSlotGranted",d.current.onRewardedSlotGranted),googletag.pubads().removeEventListener("rewardedSlotClosed",d.current.onRewardedSlotClosed),googletag.pubads().removeEventListener("slotRenderEnded",d.current.onRewardedSlotRenderEnded)})},[]);return(0,r.useEffect)(()=>c,[]),{showRewardedAd:(0,r.useCallback)(async()=>(c(),new Promise(o=>{let{path:i,format:r,position:s}=e;googletag.cmd.push(()=>{var e;let a;if(d.current.onRewardedSlotReady=e=>{e.slot===a&&(e.makeRewardedVisible(),(0,l.Te)({provider:"google",position:i}),o())},d.current.onRewardedSlotGranted=e=>{var n;e.slot===a&&(null==(n=e.payload)?void 0:n.amount)&&t()},d.current.onRewardedSlotClosed=e=>{e.slot===a&&(googletag.destroySlots([a]),null==n||n())},d.current.onRewardedSlotRenderEnded=e=>{e.slot===a&&e.isEmpty&&(t(),(0,l.Fk)({id:3,provider:"google",position:i,type:"rewarded"}))},!(a=null==(e=googletag.defineOutOfPageSlot(i,googletag.enums.OutOfPageFormat.REWARDED))?void 0:e.setTargeting("ad_format",r).setTargeting("ad_position",s).addService(googletag.pubads())))return void o();googletag.enableServices(),googletag.pubads().addEventListener("rewardedSlotReady",d.current.onRewardedSlotReady),googletag.pubads().addEventListener("rewardedSlotGranted",d.current.onRewardedSlotGranted),googletag.pubads().addEventListener("rewardedSlotClosed",d.current.onRewardedSlotClosed),googletag.pubads().addEventListener("slotRenderEnded",d.current.onRewardedSlotRenderEnded),googletag.display(a)})})),[e]),isEnabled:(null==o?void 0:o.provider)===a.w.Google}}},29469:(e,t,n)=>{n.d(t,{A:()=>W});var o=n(6029),i=n(76356),r=n(81278),l=n(55729),s=n(65789),a=n(75751),d=n(19168),c=n(70448),u=n(95083),v=n(41249),p=n(90248),g=n(90112),f=n(9127),m=n(41735),x=n(22648);let h=e=>{let{isCancelable:t,isOpen:n,portalsContainerId:i,onClose:r}=e,l=(0,m.useTheme)();return((0,v.NF)(n),"undefined"==typeof document)?null:(0,o.jsx)(v.ZL,{id:i,children:(0,o.jsx)(g.N,{children:n&&(0,o.jsxs)(f.m.div,{animate:{backgroundColor:l.colors.overlay.darken2},exit:{backgroundColor:"rgba(0,0,0,0)",transition:{delay:.1}},transition:{duration:.2,ease:"easeIn"},style:{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",inset:0,overflow:"hidden",zIndex:v.Py.ModalBackdrop},onClick:r,"data-testid":"modal",children:[(0,o.jsx)(x.a,{size:56,spinnerColor:"#fff"}),t&&(0,o.jsx)(v.$n,{borderStyle:"rounded",colorScheme:"onColor",style:{position:"absolute",bottom:"10%",left:"50%",transform:"translateX(-50%)"},color:"secondary",onClick:r,children:(0,o.jsx)(p.A,{id:"basic.cancel"})})]},"overlay")})})};function y(e){let{onChangeVote:t,onChangeVoteContinue:n,onChangeVoteClose:r,isModalOpen:l,isLoaderOpen:s,onLoaderExit:a}=e;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(h,{isOpen:s,onClose:a,isCancelable:!0}),(0,o.jsx)(u.$n,{variant:"clear",size:"tertiary",onClick:t,children:(0,o.jsx)(p.A,{id:"basic.changeVote"})}),(0,o.jsx)(v.aF,{isOpen:l,children:(0,o.jsxs)(i.az,{w:"[312px]",bg:"surface.s1",p:"lg",br:"lg",elevation:"3",mx:"auto",children:[(0,o.jsx)(v.EY,{font:"display.large",color:"onSurface.nLv1",lineHeight:"24px",mb:"sm",as:"div",children:(0,o.jsx)(p.A,{id:"profile.changeVoteTooltipDescription"})}),(0,o.jsx)(v.EY,{font:"body.medium",color:"onSurface.nLv1",as:"div",children:(0,o.jsx)(p.A,{id:"change_vote_watch_ad"})}),(0,o.jsxs)(i.so,{justify:"flex-end",mt:"xl",children:[(0,o.jsx)(u.$n,{variant:"clear",onClick:r,children:(0,o.jsx)(p.A,{id:"close_window_button"})}),(0,o.jsx)(u.$n,{variant:"clear",onClick:n,children:(0,o.jsx)(p.A,{id:"pickem.continue"})})]})]})})]})}var j=n(75414);function b(e){let{totalVotes:t,isLoading:n}=e;return(0,o.jsx)(u.EY,{textStyle:"body.small",color:"neutrals.nLv3",children:!n&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.A,{id:"prediction_total_votes"}),": ",(0,j.A)(t)]})})}function w(e){let{event:t,isVotingEnabled:n,activeVoteType:r,changeVoteBtn:l}=e,{totalVotes:s,isLoading:a}=(0,c.sr)(t,r),{hasNotStarted:d}=(0,c.N6)(t);return d?n?(0,o.jsx)(i.so,{justify:"center",align:"center",minH:"2xl",children:(0,o.jsx)(u.EY,{textStyle:"body.small",color:"neutrals.nLv3",children:(0,o.jsx)(p.A,{id:"change_vote_info_text"})})}):(0,o.jsxs)(i.so,{justify:"space-between",align:"center",minH:"2xl",children:[(0,o.jsx)(b,{totalVotes:s,isLoading:a}),l]}):(0,o.jsxs)(i.so,{justify:"space-between",align:"center",minH:"2xl",children:[(0,o.jsx)(b,{totalVotes:s,isLoading:a}),(0,o.jsx)(u.EY,{textStyle:"body.small",color:"neutrals.nLv3",children:(0,o.jsx)(p.A,{id:"voting_ended_status"})})]})}function T(e){let{titleId:t,voteType:n}=e;return t?(0,o.jsx)(u.EY,{textStyle:"display.medium",color:"neutrals.nLv1",children:t&&(0,o.jsx)(p.A,{id:t})},n):null}function _(e){let{sliderOptions:t,initialIndex:n,setActiveVoteType:i}=e,[r,s]=(0,l.useState)(n);return(0,l.useEffect)(()=>{i(t[r])},[r]),(0,o.jsx)(v.VQ,{mx:"lg",h:"40px",centerVertically:!0,controls:[r,s],buttonProps:{variant:"unshielded"},children:t.map(e=>{let t=c.HD[e];return(0,o.jsx)(T,{titleId:t,voteType:e},e)})})}function S(e){let{sliderOptions:t}=e;if(t.length>1)return(0,o.jsx)(_,{...e});let n=t[0],r=c.HD[n];return(0,o.jsx)(i.so,{h:"3xl",justify:"center",align:"center",children:(0,o.jsx)(T,{titleId:r,voteType:n})})}var R=n(89042);let C=(0,n(62042).Fj)({base:{h:"sm",br:"xs",mx:"xs"},variants:{type:{default:{w:"sm",bg:"neutrals.nLv4"},active:{w:"xl",bg:"primary.default"}}}}),E=(0,i.I4)("div",C);function k(e){let{sliderOptions:t,activeVoteType:n}=e;return t.length>1?(0,o.jsx)(i.so,{align:"center",justify:"center",mb:"md",children:t.map(e=>(0,o.jsx)(E,{type:n===e?"active":"default"},"".concat(e,"-dot")))}):null}var A=n(54409),V=n(70591),I=n(76410);function L(e){let{isInWidget:t}=e;return(0,o.jsx)(s.Zp,{isInverseDesktop:t,children:(0,o.jsx)(i.az,{py:"sm",px:"lg",children:(0,o.jsxs)(i.so,{align:"center",justify:"space-between",children:[(0,o.jsx)(v._V,{h:36,w:52,src:"/static/images/weekly-challenge/predictions-cta.svg",alt:"Weekly challenge trophies"}),(0,o.jsx)(V.N_,{routeKey:"user.weeklyChallenge",onClick:()=>{(0,I.Wk)({type:"weekly_challenge",location:"event_details"})},children:(0,o.jsxs)(i.so,{cursor:"pointer",align:"center",children:[(0,o.jsx)(u.EY,{color:"primary.default",textStyle:"display.micro",children:(0,o.jsx)(p.A,{id:"view_weekly_challenge"})}),(0,o.jsx)(A.CCT,{fill:"primary.default"})]})})]})})})}function W(e){let{event:t}=e,n=(0,r.useRouter)(),d=e.event.tournament.category.sport.slug,u=c.Ej[d]||c.il,[v,p]=(0,l.useState)(u[0]),[g,f]=(0,l.useState)(0),[m,x]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{if(n.query.voteType&&!m){p(u.find(e=>"".concat(e)===n.query.voteType)||u[0]);let e=u.findIndex(e=>"".concat(e)===n.query.voteType);f(e<0?0:e)}x(!0)},[]),m)?0===u.length||t.awayTeam.disabled||t.homeTeam.disabled?null:(0,o.jsx)(a.t,{tag:"EventVotes",children:(0,o.jsx)(N,{sliderOptions:u,initialIndex:g,activeVoteType:v,setActiveVoteType:p,...e})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.Zp,{isInverseDesktop:e.isInWidget,children:(0,o.jsx)(i.az,{h:"[130px]"})}),(0,o.jsx)(i.az,{h:"sm",mb:"md"})]})}function N(e){let{event:t,placement:n,isInWidget:r,initialIndex:a,sliderOptions:u,setActiveVoteType:v,activeVoteType:p}=e,g=(0,c.T8)(n),{userVote:f}=(0,c.tV)(t,p),{hasNotStarted:m}=(0,c.N6)(t),[x,h]=(0,l.useState)(!1),[j,b]=(0,l.useState)(!1),T=m&&!(0,d.ux)(t)&&!f||j,{autoShowAd:_,canEditVote:C,grantReward:E,hasRevisitedChangeVote:A,setAutoShowAd:V}=(0,c.a8)(t,p,x,h,b),{isModalOpen:I,onChangeVote:W,onShowAd:N,setAdCanceled:F,setIsModalOpen:D,setShowLoader:O,showLoader:M}=(0,c.$d)(t.id,n,_,A,p,()=>V(!1),()=>{E(),O(!1)});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.Zp,{isInverseDesktop:r,"data-testid":"predictions",children:[(0,o.jsx)(S,{sliderOptions:u,initialIndex:a,setActiveVoteType:v}),(0,o.jsx)(i.az,{px:"lg",py:"sm",children:(0,o.jsx)(R.A,{location:g,voteType:p,enableVoteChange:x})}),(0,o.jsx)(i.az,{px:"lg",children:(0,o.jsx)(w,{event:t,activeVoteType:p,isVotingEnabled:T,changeVoteBtn:(C||A)&&(0,o.jsx)(y,{onChangeVote:W,onChangeVoteClose:()=>D(!1),onChangeVoteContinue:N,isModalOpen:I,isLoaderOpen:M,onLoaderExit:()=>{O(!1),F(!0)}})})}),(0,o.jsx)(s.Zp.Footer,{defaultHeight:"sm"})]}),(0,o.jsx)(k,{sliderOptions:u,activeVoteType:p}),(0,o.jsx)(L,{isInWidget:r})]})}},32259:(e,t,n)=>{n.d(t,{a:()=>r});var o=n(65078),i=n(89194);function r(e,t){return(0,o.g3)(e)?{...t,[i.m.Left]:t[i.m.Right],[i.m.Right]:t[i.m.Left]}:t}},42796:(e,t,n)=>{n.d(t,{e1:()=>r,sJ:()=>i,u_:()=>o});let o=[n(21377).QCR.Football],i=["IT","US"],r="has-voted-daily-10x"},70448:(e,t,n)=>{n.d(t,{_7:()=>p._7,NT:()=>u.NT,w:()=>v.w,il:()=>u.il,dT:()=>u.dT,Ej:()=>u.Ej,HD:()=>p.HD,mR:()=>v.m,o3:()=>u.o3,d4:()=>d.d4,Iz:()=>d.Iz,mt:()=>d.mt,T8:()=>d.T8,Q3:()=>d.Q3,bZ:()=>d.bZ,kS:()=>d.kS,wH:()=>g.wH,a8:()=>o.a8,$d:()=>o.$d,sr:()=>i.s,N6:()=>r.N,tV:()=>l.t,CU:()=>c});var o=n(84570),i=n(96169),r=n(87966);n(32259);var l=n(77562),s=n(1815),a=n(76410),d=n(17352);function c(e){let{voteType:t,isDailyBonus:n,eventId:o,location:i}=e,r=(0,d.K$)(t,n),l=(0,d.mt)(t)||"";return{impressionRef:(0,s.e)(()=>{r&&(0,a.M_)({type:r,id:o,position:l,location:i})},{sendInterval:3e4}),logOnEventVote:()=>{r&&(0,a.Tc)({id:o,type:r,position:l,location:i})}}}var u=n(9329),v=n(89194),p=n(75067),g=n(39332)},75067:(e,t,n)=>{n.d(t,{HD:()=>s,Qf:()=>l,_7:()=>i,fw:()=>r});var o=n(21377);let i={[o.rjx.WhoWillWin]:"who_will_win",[o.rjx.WillBothTeamsScore]:"will_both_teams_score",[o.rjx.FirstTeamToScore]:"first_team_to_score"},r={[o.rjx.WhoWillWin]:"who_will_win_edit",[o.rjx.WillBothTeamsScore]:"will_both_teams_score_edit",[o.rjx.FirstTeamToScore]:"first_team_to_score_edit"},l={[o.rjx.WhoWillWin]:"fullTime",[o.rjx.WillBothTeamsScore]:"bothTeamsToScore",[o.rjx.FirstTeamToScore]:"firstTeamToScore"},s={[o.rjx.WhoWillWin]:"who_will_win",[o.rjx.WillBothTeamsScore]:"will_both_teams_score_title",[o.rjx.FirstTeamToScore]:"who_will_score_first_title"}},77562:(e,t,n)=>{n.d(t,{t:()=>d});var o=n(21377),i=n(494),r=n(45860),l=n(88339),s=n(75067),a=n(39332);let d=(e,t)=>{var n,d,c;let u=(0,i.d4)(l.$F),v=(0,i.d4)(a.wH),{data:p,isLoading:g,mutate:f}=(0,r.Ay)((null==u?void 0:u.id)?o.VfS.futurePredictions(u.id):null),m=null==p||null==(d=p.predictions)||null==(n=d.find)?void 0:n.call(d,t=>t.eventId===e.id),x=null==(c=v[e.id])?void 0:c[t],h=null==x?void 0:x.current,y=null==x?void 0:x.prev;return{userVote:(null==m?void 0:m.votes[s.Qf[t]])||h,oldVote:y,eventFuturePrediction:m,userFuturePredictions:p,areFuturePredictionsLoading:g,mutateFuturePredictions:f}}},84570:(e,t,n)=>{n.d(t,{a8:()=>j,$d:()=>_,dV:()=>m,NC:()=>g});var o=n(55729),i=n(494),r=n(62859),l=n(75067),s=n(5815);let a=e=>({type:s.UG.ADD_CHANGED_VOTE,payload:e}),d=e=>({type:s.UG.REMOVE_CHANGED_VOTE,payload:e});var c=n(37567),u=n(17352),v=n(96169),p=n(77562);let g=(e,t)=>{let n=(0,i.wA)(),{event:s}=(0,o.useContext)(r.y$),{data:a,mutate:g}=(0,v.s)(s,e),{userVote:f,oldVote:m,userFuturePredictions:x,eventFuturePrediction:h,mutateFuturePredictions:y}=(0,p.t)(s,e),j=(n,o)=>{(0,u.kS)(a,g,t,o,f),(null==x?void 0:x.predictions)&&(null==h?void 0:h.votes)!==void 0&&(h.votes={...h.votes,[l.Qf[e]]:n},y({predictions:[...x.predictions.filter(e=>e.eventId!==s.id),h]},!1))};return{handleChangeVote:(t,o)=>{n(d({eventId:s.id,voteType:e})),j(t,o),m||n((0,c.sP)({eventId:s.id,type:e,vote:t}))}}};var f=n(39332);let m=(e,t)=>!!(0,i.d4)(f.am).find(n=>{var o;return n.eventId===e&&(null==(o=n.voteTypes[t])?void 0:o.isChangeVoteRewarded)});var x=n(81278),h=n(76410),y=n(87966);let j=(e,t,n,r,s)=>{let d=(0,i.wA)(),c=(0,x.useRouter)(),u=m(e.id,t),{userVote:v}=(0,p.t)(e,t),{hasNotStarted:g}=(0,y.N)(e),[f,j]=(0,o.useState)(!1),b=(0,o.useRef)(t);b.current=t;let w=g&&!n&&u,T=g&&!u&&!!v;(0,o.useEffect)(()=>{j("true"===c.query.editVote&&c.query.voteType==="".concat(t))},[]),(0,o.useEffect)(()=>{r(!1)},[t]),(0,o.useEffect)(()=>{s(n&&u)},[n,u]);let _=(0,o.useCallback)(()=>{r(!0);let t=b.current;d(a({eventId:e.id,voteType:t})),f?(0,h.ke)({action:"reward",location:"user_profile",type:l.fw[t]}):(0,h.ke)({action:"reward",location:"event_details",type:l._7[t]})},[e.id,t]);return{hasRevisitedChangeVote:w,canEditVote:T,autoShowAd:f,setAutoShowAd:j,grantReward:_}};var b=n(25355),w=n(98095),T=n(12962);let _=(e,t,n,i,r,s,a,d)=>{let{hasAdBlock:c}=(0,w.j)(),[v,p]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[m,x]=(0,o.useState)(!1),{showRewardedAd:y,isEnabled:j}=(0,b.N)(T.A[t].Google,a,d),_=(0,o.useCallback)(async n=>{n.preventDefault(),n.stopPropagation(),(0,h.tN)({type:l._7[r],position:(0,u.mt)(r)||"",location:(0,u.T8)(t),id:e}),x(!1),p(!0),await y(),p(!1)},[y,i,r]),S=(0,o.useCallback)(()=>{if(i||!j){null==a||a();return}x(!0)},[i,j,a]);return(0,o.useEffect)(()=>{(async()=>{n&&(c?null==a||a():(g||i||(p(!0),await y(),p(!1)),f(!1)),s())})()},[n,c,y]),{onChangeVote:S,setShowLoader:p,setAdCanceled:f,showLoader:v,onShowAd:_,isModalOpen:m,setIsModalOpen:x}}},87966:(e,t,n)=>{n.d(t,{N:()=>r});var o=n(55729),i=n(17352);let r=e=>{let[t,n]=(0,o.useState)((0,i.bZ)(e));return(0,o.useEffect)(()=>{let t=setInterval(()=>{n((0,i.bZ)(e))},1e3);return()=>{clearInterval(t)}},[]),{hasNotStarted:t}}},89042:(e,t,n)=>{n.d(t,{A:()=>E});var o=n(6029),i=n(21377),r=n(76356),l=n(55729),s=n(494),a=n(62859),d=n(19168),c=n(33144),u=n(41249),v=n(90248),p=n(54409),g=n(58918),f=n(57126),m=n(41735),x=n(94497),h=n(70448);let y=(0,m.keyframes)(["from{left:50%;transform:translateX(-50%);}to{left:0;}"]),j=(0,m.default)(u.so).withConfig({componentId:"sc-ace7c0c8-0"})(["position:absolute;",""],e=>{let{buttonState:t}=e;return t===h.w.NoAnimation?(0,m.css)(["left:0;"]):t===h.w.Transform?(0,m.css)(["animation:"," 0.35s ease-out forwards;"],y):null}),b=(0,m.default)(u.az).withConfig({componentId:"sc-ace7c0c8-1"})(["position:absolute;right:0;",""],e=>{let{buttonState:t}=e;return t===h.w.NoAnimation?(0,m.css)(["opacity:1;"]):t===h.w.Transform?(0,m.css)(["opacity:0;animation:"," 0.2s 0.35s ease-in forwards;"],x.qG):(0,m.css)(["opacity:0;"])});function w(e){var t;let{isSelected:n,...r}=e,{percentage:l,team:a,buttonPositionType:d,isVotingEnabled:m,voteConfig:x,animate:y}=r,w=(0,s.d4)(f.xl),T=x.position[d],_=(0,h.Iz)(m,y),S=null==a?void 0:a.sport.slug,R=(null==a||null==(t=a.subTeams)?void 0:t.length)===2&&S===i.QCR.Tennis,C=x.isTranslated&&(null==T?void 0:T.text),E=w&&(null==T?void 0:T.inverseTeamsText);return(0,o.jsxs)(u.so,{position:"relative",w:"100%",align:"center",justify:"center",h:24,children:[(0,o.jsx)(j,{buttonState:_,align:"center",children:R&&(null==a?void 0:a.subTeams)?(0,o.jsx)(g.K,{size:24,sport:S,teams:a.subTeams,hideFlags:!0,ignoreLink:!0}):a?(0,o.jsx)(c.p,{size:24,id:a.id,name:a.name}):(null==T?void 0:T.voteOption)===i.gbi.NoGoal?(0,o.jsx)(p.U7g,{fill:"onSurface.nLv1"}):(0,o.jsx)(u.EY,{font:"display.micro",c:n?"primary.default":"onSurface.nLv1",mt:1,textTransform:"uppercase",children:C?(0,o.jsx)(v.A,{id:T.text}):E?(0,o.jsx)(o.Fragment,{children:T.inverseTeamsText}):(0,o.jsx)(o.Fragment,{children:null==T?void 0:T.text})})}),!m&&(0,o.jsx)(b,{buttonState:_,children:(0,o.jsxs)(u.EY,{as:"div",font:"display.small",c:n?"primary.default":"onSurface.nLv1",children:[null!=l?l:0,"%"]})})]})}function T(e){let{isVotingEnabled:t,votedPositionType:n,voteConfig:i,buttonPositionType:r,isChangeVoteActive:l,onVote:s}=e,a=!l&&void 0!==n&&n===r;return(0,o.jsx)(u.so,{as:t?"button":"div",align:"center",justify:"center",px:"lg",py:"xs",w:"100%",br:"xxl",bg:a?"primary.highlight":"surface.s1",border:t||a?"primary.default":"onSurface.nLv4",hoverBg:t?"primary.highlight":void 0,cursor:t?"pointer":"default",userSelect:"none",onClick:()=>{if(t){var e;let t=null==(e=i.position[r])?void 0:e.voteOption;t&&s(t,r)}},"data-testid":"prediction_option",children:(0,o.jsx)(w,{isSelected:a,...e})})}var _=n(42796),S=n(84570),R=n(37567);function C(e){var t,n;let{isDailyBonus:c,eventVoteLocation:u,voteType:v,config:p,enableVoteChange:g}=e,f=(0,s.wA)(),{event:m,leftTeam:x,rightTeam:y}=(0,l.useContext)(a.y$),{userVote:j}=(0,h.tV)(m,v),b=(0,S.dV)(m.id,v),{eventVotes:w,data:C,isLoading:E,mutate:k}=(0,h.sr)(m,v),{handleChangeVote:A}=(0,S.NC)(v,p),[V,I]=(0,d.yR)(_.e1,!1),[L,W]=(0,l.useState)(!1),N=(0,h.bZ)(m),F=(0,h.d4)(p,j),D=b&&g,O=N&&!(0,d.ux)(m)&&!j||D;(0,l.useEffect)(()=>{W(!1)},[v]);let{impressionRef:M,logOnEventVote:z}=(0,h.CU)({voteType:v,isDailyBonus:c,eventId:m.id,location:u}),B={voteConfig:p,votedPositionType:F,isVotingEnabled:O,isChangeVoteActive:D,animate:L,onVote:(e,t)=>{W(!0),b&&g?(A(e,t),f((0,R.eM)({eventId:m.id,type:v,vote:e,oldVote:j,isDailyBonus:c}))):((0,h.kS)(C,k,p,t),f((0,R.eM)({eventId:m.id,type:v,vote:e,isDailyBonus:c})),f((0,R.sP)({eventId:m.id,type:v,vote:e}))),z(),c&&I(!0)}},H=w.voteMiddle.isAvailable&&!!p.position[h.mR.Middle],G=w.voteLeft.isAvailable&&!!p.position[h.mR.Left],P=w.voteRight.isAvailable&&!!p.position[h.mR.Right],$=(null==(t=p.position[h.mR.Left])?void 0:t.voteOption)===i.gbi.One,K=(null==(n=p.position[h.mR.Right])?void 0:n.voteOption)===i.gbi.Two;return E?(0,o.jsx)(r.az,{h:"2xl"}):(0,o.jsxs)(r.so,{ref:M,justify:"center",gap:"sm",children:[G&&(0,o.jsx)(T,{buttonPositionType:h.mR.Left,percentage:w[h.mR.Left].percentage,team:$?x:void 0,...B}),H&&(0,o.jsx)(T,{buttonPositionType:h.mR.Middle,percentage:w[h.mR.Middle].percentage,...B}),P&&(0,o.jsx)(T,{buttonPositionType:h.mR.Right,percentage:w[h.mR.Right].percentage,team:K?y:void 0,...B})]})}function E(e){let{location:t,voteType:n,isDailyBonus:r,enableVoteChange:l}=e;switch(n){case i.rjx.WhoWillWin:return(0,o.jsx)(C,{config:h.o3,voteType:i.rjx.WhoWillWin,eventVoteLocation:t,isDailyBonus:r,enableVoteChange:l});case i.rjx.WillBothTeamsScore:return(0,o.jsx)(C,{config:h.NT,voteType:i.rjx.WillBothTeamsScore,eventVoteLocation:t,isDailyBonus:r,enableVoteChange:l});case i.rjx.FirstTeamToScore:return(0,o.jsx)(C,{config:h.dT,voteType:i.rjx.FirstTeamToScore,eventVoteLocation:t,isDailyBonus:r,enableVoteChange:l});default:return null}}},96169:(e,t,n)=>{n.d(t,{s:()=>d});var o=n(21377),i=n(45860);function r(e,t){if(void 0!==e&&void 0!==t)return t in e?e[t]:void 0}var l=n(32259),s=n(89194),a=n(17352);function d(e,t){let{data:n,isLoading:d,mutate:c}=(0,i.Ay)(o.bnp.votes(e.id),{refreshInterval:6e4,dedupingInterval:6e4}),{voteModelKey:u,position:v}=(0,a.do)(t),p=(0,l.a)(e,v),g=p[s.m.Left],f=v[s.m.Middle],m=p[s.m.Right],x=r(n,u),h=r(x,null==g?void 0:g.voteApiKey),y=r(x,null==f?void 0:f.voteApiKey),j=r(x,null==m?void 0:m.voteApiKey),b=(!h||h<0?0:h)+(!j||j<0?0:j)+(!y||y<0?0:y),{leftPercentage:w,middlePercentage:T,rightPercentage:_}=(0,a.mK)(h,y,j);return{data:n,isLoading:d,mutate:c,totalVotes:b,eventVotes:{[s.m.Left]:{isAvailable:"number"==typeof h,count:h,percentage:w},[s.m.Middle]:{isAvailable:"number"==typeof y,count:y,percentage:T},[s.m.Right]:{isAvailable:"number"==typeof j,count:j,percentage:_}}}}}}]);