@streamlayer/react 0.32.3 → 0.32.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index4.js"),k=require("@nanostores/react"),z=require("./masters2.js"),y=require("@streamlayer/sdk-web-types"),D=require("react"),de=require("./index3.js");require("react-countup");const Ae=require("react-countdown-circle-timer"),b=require("./index2.js");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const Se=o.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),De=o.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),ze=()=>o.n1,Oe=o.styled_default(ze())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),_e=o.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),ke=o.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Ce=()=>o.n1,be=o.styled_default(Ce())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ue=({type:e,close:t,label:n})=>{const i=e?z.o[e]:{label:n,iconName:void 0};return s.jsxs(Se,{children:[s.jsxs(De,{children:[(i==null?void 0:i.iconName)&&s.jsx(Oe,{"data-type-trivia":e===y.QuestionType.TRIVIA,"data-type-poll":e===y.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(_e,{children:i.label})]}),s.jsx(ke,{onClick:t,children:s.jsx(be,{name:"icon-cross"})})]})},pe=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),me=e=>e?e.toLocaleString("en-US"):"0",we=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),Ee=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Le=e=>!isNaN(e.getTime()),$e=o.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Qe=o.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=o.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),G=({indicator:e,title:t})=>s.jsxs($e,{children:[s.jsx(Qe,{children:t}),s.jsx(Re,{children:e})]}),Ue=o.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),qe=o.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=o.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:t})=>s.jsxs(Ue,{children:[s.jsx(qe,{children:e}),s.jsx(Pe,{children:t})]}),Ye=o.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),We=o.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ve=o.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=o.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Be=o.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),He=o.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ze=o.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=o.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Je=o.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ke=o.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Xe=o.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),et=o.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),tt=o.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),st=o.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),nt=o.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),it=o.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),ot=o.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",Ie=({avatar:e,name:t,points:n,friendsRank:i,rank:r,streak:u,correct:p,incorrect:m,inTop:c,successRate:I})=>s.jsxs(Ye,{children:[s.jsx(We,{children:s.jsxs(Fe,{children:[s.jsxs(ot,{children:[e&&s.jsx(Be,{alt:"avatar",src:e}),!e&&s.jsx(it,{children:pe(t||"")})]}),s.jsxs(He,{children:[s.jsx(Ze,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Ke,{children:[s.jsx(Je,{alt:"rank-icon",src:rt}),s.jsxs(Xe,{children:[me(n),s.jsx(et,{children:"PTS"})]})]}),s.jsx(tt,{}),s.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),s.jsxs(Ve,{children:[s.jsxs(st,{children:[s.jsx(G,{indicator:i||0,title:"Friends rank"}),s.jsx(G,{indicator:r||0,title:"Global rank"})]}),s.jsxs(nt,{children:[s.jsx($,{indicator:u||0,title:"Win streak"}),s.jsx($,{indicator:p||0,title:"Correct"}),s.jsx($,{indicator:m||0,title:"Incorrect"}),s.jsx($,{indicator:`${I||0}%`,title:"Succ. rate"})]})]})]}),at=o.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),lt=()=>o.n1,ct=o.styled_default(lt())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),dt=()=>s.jsx(at,{children:s.jsx(ct,{name:"mastersLogo"})}),ut=o.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),pt=o.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),mt=o.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),It=({title:e,description:t})=>s.jsxs(ut,{children:[s.jsx(o.n1,{name:"icon-check-circle"}),s.jsx(pt,{children:e}),s.jsx(mt,{children:t})]}),ft=o.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ht=()=>o.n1,yt=o.styled_default(ht())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),J=o.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),K=o.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),xt=o.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),q=o.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),gt=o.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),jt=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:n,questionType:i,hasCorrectAnswer:r,questionStatus:u})=>{const p=n&&(i===y.QuestionType.TRIVIA||i===y.QuestionType.PREDICTION);if(!p&&u!==y.QuestionStatus.RESOLVED||u===y.QuestionStatus.RESOLVED&&i===y.QuestionType.PREDICTION&&!n)return null;const m=i===y.QuestionType.PREDICTION&&!r,c=t?"correct":"incorrect",I=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ft,{"data-isPrediction":m,children:[u===y.QuestionStatus.RESOLVED&&i===y.QuestionType.TRIVIA&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(J,{children:s.jsx(o.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(K,{children:s.jsx(q,{children:"Question Expired"})}),s.jsx(gt,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),p&&m&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{name:"icon-prediction"}),s.jsx(q,{children:"Stay tuned to see if your prediction was correct."})]}),p&&r&&s.jsxs(s.Fragment,{children:[s.jsx(J,{"data-feedbackType":c,children:s.jsx(o.n1,{name:c})}),s.jsx("div",{children:s.jsxs(K,{children:[s.jsx(xt,{"data-feedbackType":c,children:I==null?void 0:I.title}),s.jsx(q,{children:I==null?void 0:I.description})]})})]})]})},Mt=o.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),vt=o.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),Tt=o.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),Nt=o.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),At=o.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),St=o.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Dt=o.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),zt=o.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Ot=o.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),fe=o.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),_t=()=>fe,kt=o.styled_default(_t())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Ct=()=>fe,bt=o.styled_default(Ct())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),wt=o.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Et=o.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Lt=o.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),$t=()=>o.n1,Qt=o.styled_default($t())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),X={[y.QuestionImages.CENTERED]:e=>s.jsx(kt,{alt:"option-icon",src:e}),[y.QuestionImages.TRANSPARENT]:e=>s.jsx(zt,{children:s.jsx(Ot,{style:{backgroundImage:`url(${e})`}})}),[y.QuestionImages.ROUNDED]:e=>s.jsx(bt,{alt:"option-icon",src:e}),[y.QuestionImages.NONE]:()=>null,[y.QuestionImages.UNSET]:()=>null},Rt=({questionType:e,hasCorrectAnswer:t,correct:n,youVoted:i,questionVoted:r})=>{if(e===y.QuestionType.POLL&&i)return"correct";if(e===y.QuestionType.PREDICTION){if(t&&r)return i?n?"correct":"incorrect":"unset";if(i)return"correct"}return e===y.QuestionType.TRIVIA&&r&&i?n?"correct":"incorrect":"unset"},Ut=({questionType:e,questionVoted:t,correct:n,hasCorrectAnswer:i,questionStatus:r})=>e===y.QuestionType.TRIVIA?t&&n:e===y.QuestionType.PREDICTION?t&&n&&i||r===y.QuestionStatus.RESOLVED&&n:!1,qt=e=>{var t;const{id:n,icon:i,text:r,percentageDecimal:u,onVote:p,youSelected:m,questionVoted:c,imageMode:I,answerTimeExpired:M,questionStatus:N,isLoading:j,questionType:v,correct:T,hasCorrectAnswer:a}=e,l=Rt(e),d=Ut({questionType:v,questionVoted:c,correct:T,hasCorrectAnswer:a,questionStatus:N}),f=N===y.QuestionStatus.RESOLVED&&v===y.QuestionType.PREDICTION,x=c||f;return s.jsxs(At,{value:n,"data-selected":m,"data-answerState":l,disabled:c||j||M||f,"data-isNotChecked":c&&!m&&l!=="incorrect",onClick:p,children:[s.jsx(St,{"data-answerState":l,style:{width:`${x?u:0}%`}}),s.jsxs(Dt,{children:[i&&I&&((t=X[I])==null?void 0:t.call(X,i)),s.jsx(wt,{children:r}),x&&s.jsxs(Et,{children:[d&&s.jsx(Qt,{name:"selected"}),s.jsx(Lt,{children:s.jsx(de.d,{value:u,suffix:"%"})})]})]})]})},Pt=[b.E.PRIMARY_GREEN1,b.E.SECONDARY_RED1,b.E.SECONDARY_RED1],Yt=[10,10,0],Wt=o.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vt=b.E.SECONDARY_GREEN6,ee=b.E.SECONDARY_RED3,Ft=b.E.NEUTRALS_GRAY3,Bt=({isPlaying:e=!0,duration:t=30,onTimerExpired:n})=>{const[i,r]=D.useState(t>10?Vt:ee),u=({remainingTime:c})=>s.jsx(Wt,{children:c}),p=D.useCallback(()=>{n==null||n(),r(Ft)},[n,r]),m=D.useCallback(c=>{c===10&&r(ee)},[r]);return s.jsx(Ae.CountdownCircleTimer,{isPlaying:e,duration:t,colors:Pt,colorsTime:Yt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:p,onUpdate:m,children:u})},Ht=o.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Zt=o.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Gt=o.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Jt=()=>o.n1,Kt=o.styled_default(Jt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Xt=o.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),es=o.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),ts=o.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),ss=({title:e,points:t,isPlayingTimer:n,isTimer:i,questionType:r,timerDuration:u,onTimerExpired:p})=>s.jsxs(Ht,{children:[s.jsxs(Zt,{children:[e&&s.jsx(Gt,{children:e}),t!==void 0&&r!==y.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Kt,{name:"icon-trophy"}),s.jsxs(Xt,{children:[s.jsx(es,{children:s.jsx(de.d,{value:t})}),s.jsx(ts,{children:"PTS"})]})]})]}),i&&s.jsx(Bt,{isPlaying:n,onTimerExpired:p,duration:u})]}),ns=({openedQuestion:e,isLoading:t,vote:n,close:i})=>{var r,u;const p=e.subject,m=e.type,c=(r=e.options)==null?void 0:r.options,[I,M]=D.useState(!1),[N,j]=D.useState(""),v=e==null?void 0:e.id,T=D.useCallback(async g=>{if(v){const h=g.currentTarget.value;j(h),await n(v,h)}},[v,j,n]),a=D.useCallback(()=>{M(!0),setTimeout(i,3e3)},[i]),l=D.useMemo(()=>e==null?void 0:e.answers.find(g=>g.youVoted===!0),[e]),d=D.useMemo(()=>!!(e!=null&&e.answers.find(g=>g.correct===!0)),[e]),f=D.useMemo(()=>e?e.answers.map(g=>{var h;return{...g,questionVoted:!!l,youSelected:N===g.id,isLoading:t,hasCorrectAnswer:d,questionType:e.type,answerTimeExpired:I,questionStatus:e.status,imageMode:(h=e.appearance)==null?void 0:h.images,onVote:T}}):[],[d,I,t,e,l,T,N]),x=c&&(c.case==="trivia"||c.case==="prediction")?c.value:void 0;return s.jsx(z.r,{"data-question-header":"true",children:s.jsx(Mt,{children:s.jsxs(vt,{children:[x&&s.jsx(jt,{feedbackMessages:x,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:m,hasCorrectAnswer:d,questionStatus:e.status}),e.type!==y.QuestionType.PREDICTION&&s.jsx(ss,{title:I?"Time expired":e.type===y.QuestionType.POLL?"Time remaining":"To win",points:I?void 0:l!=null&&l.correct?l==null?void 0:l.points:0,onTimerExpired:a,questionType:e.type,isTimer:!t,isPlayingTimer:!l,timerDuration:l?0:Number(((u=e==null?void 0:e.appearance)==null?void 0:u.autoHideInterval)||"30")}),I?s.jsx(It,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(Tt,{"data-isPrediction":e.type===y.QuestionType.PREDICTION,children:p}),s.jsx(Nt,{children:f.map(g=>s.jsx(qt,{...g},g.id))})]})]})})})},is=o.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),os=o.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),rs=o.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),as=o.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),ls=o.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),cs=o.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),he=({created:e,image:t,title:n,instantView:i})=>{const r=D.useMemo(()=>{if(e){const p=new Date(e);if(Le(p))return{date:we(p),time:Ee(p)}}return null},[e]),u=(i==null?void 0:i.image)||t;return s.jsxs(is,{children:[r&&s.jsxs(ls,{children:[r.date," · ",r.time]}),(i==null?void 0:i.video)&&s.jsx(z.w,{source:i.video.url,poster:i.video.thumbnailUrl}),u&&s.jsx(cs,{src:u}),s.jsxs(os,{children:[s.jsx(rs,{children:(i==null?void 0:i.heading)||n}),s.jsx(as,{children:i==null?void 0:i.body})]})]})},ds=o.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),us=o.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ps=({instantView:e,...t})=>s.jsxs(ds,{children:[s.jsx(he,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(us,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(o.n1,{name:"icon-external-link"})]})]}),ms=o.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),Is=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ps,{created:e.attributes.created,...e.attributes.attributes.value}):null},fs=({extendedQuestion:e,vote:t,close:n})=>{const{loading:i,data:r}=e;return r?s.jsx(ns,{vote:t,close:n,openedQuestion:r,isLoading:!!i}):null},hs=({gamification:e})=>{var t;const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedQuestion.$extendedStore);if(!n)return null;const r=n.type;return s.jsxs(ms,{children:[s.jsx(ue,{close:e.closeQuestion,type:((t=n.attributes)==null?void 0:t.type)||y.QuestionType.UNSET}),r==="question"&&s.jsx(fs,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),r!=="question"&&s.jsx(Is,{openedQuestion:n}),s.jsx(dt,{sponsorLogo:""})]})},ys=o.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),xs=o.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),gs=o.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),js=o.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var R=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(R||{});const te=({title:e,active:t,onClick:n})=>s.jsx(gs,{onClick:n,"data-selected":t,children:s.jsx(js,{children:e})}),Ms=({activePage:e="home",toggleActivePage:t})=>s.jsx(ys,{children:s.jsxs(xs,{"data-position":e==="home"?"left":"right",children:[s.jsx(te,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(te,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},W.apply(this,arguments)}function se(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},V(e,t)}function vs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V(e,t)}var ne=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Ts(e,t){return!!(e===t||ne(e)&&ne(t))}function Ns(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Ts(e[n],t[n]))return!1;return!0}function P(e,t){t===void 0&&(t=Ns);var n,i=[],r,u=!1;function p(){for(var m=[],c=0;c<arguments.length;c++)m[c]=arguments[c];return u&&n===this&&t(m,i)||(r=e.apply(this,m),u=!0,n=this,i=m),r}return p}var As=typeof performance=="object"&&typeof performance.now=="function",ie=As?function(){return performance.now()}:function(){return Date.now()};function oe(e){cancelAnimationFrame(e.id)}function Ss(e,t){var n=ie();function i(){ie()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}var r={id:requestAnimationFrame(i)};return r}var Y=-1;function re(e){if(e===void 0&&(e=!1),Y===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Y=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Y}var C=null;function ae(e){if(e===void 0&&(e=!1),C===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var i=document.createElement("div"),r=i.style;return r.width="100px",r.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?C="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?C="negative":C="positive-ascending"),document.body.removeChild(t),C}return C}var Ds=150,zs=function(t,n){return t};function Os(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,r=e.getItemSize,u=e.getOffsetForIndexAndAlignment,p=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,c=e.initInstanceProps,I=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(N){vs(j,N);function j(T){var a;return a=N.call(this,T)||this,a._instanceProps=c(a.props,se(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:se(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=P(function(l,d,f,x){return a.props.onItemsRendered({overscanStartIndex:l,overscanStopIndex:d,visibleStartIndex:f,visibleStopIndex:x})}),a._callOnScroll=void 0,a._callOnScroll=P(function(l,d,f){return a.props.onScroll({scrollDirection:l,scrollOffset:d,scrollUpdateWasRequested:f})}),a._getItemStyle=void 0,a._getItemStyle=function(l){var d=a.props,f=d.direction,x=d.itemSize,g=d.layout,h=a._getItemStyleCache(I&&x,I&&g,I&&f),A;if(h.hasOwnProperty(l))A=h[l];else{var S=n(a.props,l,a._instanceProps),O=r(a.props,l,a._instanceProps),_=f==="horizontal"||g==="horizontal",E=f==="rtl",L=_?S:0;h[l]=A={position:"absolute",left:E?void 0:L,right:E?L:void 0,top:_?0:S,height:_?"100%":O,width:_?O:"100%"}}return A},a._getItemStyleCache=void 0,a._getItemStyleCache=P(function(l,d,f){return{}}),a._onScrollHorizontal=function(l){var d=l.currentTarget,f=d.clientWidth,x=d.scrollLeft,g=d.scrollWidth;a.setState(function(h){if(h.scrollOffset===x)return null;var A=a.props.direction,S=x;if(A==="rtl")switch(ae()){case"negative":S=-x;break;case"positive-descending":S=g-f-x;break}return S=Math.max(0,Math.min(S,g-f)),{isScrolling:!0,scrollDirection:h.scrollOffset<x?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(l){var d=l.currentTarget,f=d.clientHeight,x=d.scrollHeight,g=d.scrollTop;a.setState(function(h){if(h.scrollOffset===g)return null;var A=Math.max(0,Math.min(g,x-f));return{isScrolling:!0,scrollDirection:h.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(l){var d=a.props.outerRef;a._outerRef=l,typeof d=="function"?d(l):d!=null&&typeof d=="object"&&d.hasOwnProperty("current")&&(d.current=l)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&oe(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=Ss(a._resetIsScrolling,Ds)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}j.getDerivedStateFromProps=function(a,l){return _s(a,l),M(a),null};var v=j.prototype;return v.scrollTo=function(a){a=Math.max(0,a),this.setState(function(l){return l.scrollOffset===a?null:{scrollDirection:l.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(a,l){l===void 0&&(l="auto");var d=this.props,f=d.itemCount,x=d.layout,g=this.state.scrollOffset;a=Math.max(0,Math.min(a,f-1));var h=0;if(this._outerRef){var A=this._outerRef;x==="vertical"?h=A.scrollWidth>A.clientWidth?re():0:h=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(u(this.props,a,l,g,this._instanceProps,h))},v.componentDidMount=function(){var a=this.props,l=a.direction,d=a.initialScrollOffset,f=a.layout;if(typeof d=="number"&&this._outerRef!=null){var x=this._outerRef;l==="horizontal"||f==="horizontal"?x.scrollLeft=d:x.scrollTop=d}this._callPropsCallbacks()},v.componentDidUpdate=function(){var a=this.props,l=a.direction,d=a.layout,f=this.state,x=f.scrollOffset,g=f.scrollUpdateWasRequested;if(g&&this._outerRef!=null){var h=this._outerRef;if(l==="horizontal"||d==="horizontal")if(l==="rtl")switch(ae()){case"negative":h.scrollLeft=-x;break;case"positive-ascending":h.scrollLeft=x;break;default:var A=h.clientWidth,S=h.scrollWidth;h.scrollLeft=S-A-x;break}else h.scrollLeft=x;else h.scrollTop=x}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&oe(this._resetIsScrollingTimeoutId)},v.render=function(){var a=this.props,l=a.children,d=a.className,f=a.direction,x=a.height,g=a.innerRef,h=a.innerElementType,A=a.innerTagName,S=a.itemCount,O=a.itemData,_=a.itemKey,E=_===void 0?zs:_,L=a.layout,ye=a.outerElementType,xe=a.outerTagName,ge=a.style,je=a.useIsScrolling,Me=a.width,F=this.state.isScrolling,U=f==="horizontal"||L==="horizontal",ve=U?this._onScrollHorizontal:this._onScrollVertical,B=this._getRangeToRender(),Te=B[0],Ne=B[1],H=[];if(S>0)for(var w=Te;w<=Ne;w++)H.push(D.createElement(l,{data:O,key:E(w,O),index:w,isScrolling:je?F:void 0,style:this._getItemStyle(w)}));var Z=i(this.props,this._instanceProps);return D.createElement(ye||xe||"div",{className:d,onScroll:ve,ref:this._outerRefSetter,style:W({position:"relative",height:x,width:Me,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},ge)},D.createElement(h||A||"div",{children:H,ref:g,style:{height:U?"100%":Z,pointerEvents:F?"none":void 0,width:U?Z:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var l=this._getRangeToRender(),d=l[0],f=l[1],x=l[2],g=l[3];this._callOnItemsRendered(d,f,x,g)}}if(typeof this.props.onScroll=="function"){var h=this.state,A=h.scrollDirection,S=h.scrollOffset,O=h.scrollUpdateWasRequested;this._callOnScroll(A,S,O)}},v._getRangeToRender=function(){var a=this.props,l=a.itemCount,d=a.overscanCount,f=this.state,x=f.isScrolling,g=f.scrollDirection,h=f.scrollOffset;if(l===0)return[0,0,0,0];var A=p(this.props,h,this._instanceProps),S=m(this.props,A,h,this._instanceProps),O=!x||g==="backward"?Math.max(1,d):1,_=!x||g==="forward"?Math.max(1,d):1;return[Math.max(0,A-O),Math.max(0,Math.min(l-1,S+_)),A,S]},j}(D.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var _s=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},ks=Os({getItemOffset:function(t,n){var i=t.itemSize;return n*i},getItemSize:function(t,n){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var n=t.itemCount,i=t.itemSize;return i*n},getOffsetForIndexAndAlignment:function(t,n,i,r,u,p){var m=t.direction,c=t.height,I=t.itemCount,M=t.itemSize,N=t.layout,j=t.width,v=m==="horizontal"||N==="horizontal",T=v?j:c,a=Math.max(0,I*M-T),l=Math.min(a,n*M),d=Math.max(0,n*M-T+M+p);switch(i==="smart"&&(r>=d-T&&r<=l+T?i="auto":i="center"),i){case"start":return l;case"end":return d;case"center":{var f=Math.round(d+(l-d)/2);return f<Math.ceil(T/2)?0:f>a+Math.floor(T/2)?a:f}case"auto":default:return r>=d&&r<=l?r:r<d?d:l}},getStartIndexForOffset:function(t,n){var i=t.itemCount,r=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(n/r)))},getStopIndexForStartIndex:function(t,n,i){var r=t.direction,u=t.height,p=t.itemCount,m=t.itemSize,c=t.layout,I=t.width,M=r==="horizontal"||c==="horizontal",N=n*m,j=M?I:u,v=Math.ceil((j+i-N)/m);return Math.max(0,Math.min(p-1,n+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function Cs(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,i=e.startIndex,r=e.stopIndex;return!(i>n||r<t)}function bs(e){for(var t=e.isItemLoaded,n=e.itemCount,i=e.minimumBatchSize,r=e.startIndex,u=e.stopIndex,p=[],m=null,c=null,I=r;I<=u;I++){var M=t(I);M?c!==null&&(p.push(m,c),m=c=null):(c=I,m===null&&(m=I))}if(c!==null){for(var N=Math.min(Math.max(c,m+i-1),n-1),j=c+1;j<=N&&!t(j);j++)c=j;p.push(m,c)}if(p.length)for(;p[1]-p[0]+1<i&&p[0]>0;){var v=p[0]-1;if(!t(v))p[0]=v;else break}return p}var ws=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Es=function(){function e(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Ls=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},le=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},$s=function(e){Ls(t,e);function t(){var n,i,r,u;ws(this,t);for(var p=arguments.length,m=Array(p),c=0;c<p;c++)m[c]=arguments[c];return u=(i=(r=le(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(m))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(I){var M=I.visibleStartIndex,N=I.visibleStopIndex;r._lastRenderedStartIndex=M,r._lastRenderedStopIndex=N,r._ensureRowsLoaded(M,N)},r._setRef=function(I){r._listRef=I},i),le(r,u)}return Es(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,r){var u=this.props,p=u.isItemLoaded,m=u.itemCount,c=u.minimumBatchSize,I=c===void 0?10:c,M=u.threshold,N=M===void 0?15:M,j=bs({isItemLoaded:p,itemCount:m,minimumBatchSize:I,startIndex:Math.max(0,i-N),stopIndex:Math.min(m-1,r+N)});(this._memoizedUnloadedRanges.length!==j.length||this._memoizedUnloadedRanges.some(function(v,T){return j[T]!==v}))&&(this._memoizedUnloadedRanges=j,this._loadUnloadedRanges(j))}},{key:"_loadUnloadedRanges",value:function(i){for(var r=this,u=this.props.loadMoreItems||this.props.loadMoreRows,p=function(I){var M=i[I],N=i[I+1],j=u(M,N);j!=null&&j.then(function(){if(Cs({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:M,stopIndex:N})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(M,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)p(m)}}]),t}(D.PureComponent);const Qs=o.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Rs=o.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Us=o.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),qs=o.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ps=o.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ys=o.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Ws=o.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Vs=()=>o.n1,Fs=o.styled_default(Vs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Bs=({rank:e,avatar:t,name:n,points:i,isCurrentUser:r,openItemDetail:u,style:p})=>s.jsxs(Qs,{onClick:u,style:p,children:[s.jsx(Rs,{children:e||0}),s.jsxs(Ps,{children:[t?s.jsx(Us,{alt:"leaderboard-item-avatar",src:t}):s.jsx(qs,{children:pe(n||"")}),s.jsxs(Ys,{children:[s.jsx(Ws,{children:n||""}),r&&s.jsx(Fs,{name:"icon-star"})]})]}),s.jsx("div",{children:me(i)})]}),Hs=o.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Zs=({items:e,currentUserId:t,openItemDetail:n,fetchMore:i})=>s.jsx(z.AutoSizer,{children:({width:r,height:u})=>s.jsx($s,{isItemLoaded:p=>p<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:p,ref:m})=>s.jsx(Hs,{children:s.jsx(ks,{itemSize:56,onItemsRendered:p,ref:m,itemCount:e.length,width:r,height:u,children:({index:c,style:I})=>s.jsx(Bs,{style:{...I,maxHeight:48},...e[c],openItemDetail:()=>n(e[c].userId),isCurrentUser:!!t&&t===e[c].userId},e[c].userId)})})})}),Gs=({deepLink:e})=>{const{data:t}=k.useStore(e.$store),n=t==null?void 0:t.url,i=e.desktopLink;return s.jsx(z.O,{inviteLink:n||i,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},Js=({gamification:e})=>{const{data:t}=k.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Zs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Gs,{deepLink:e.deepLink})},Ks=o.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Xs=o.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),en=o.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),tn=o.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),sn=()=>o.n1,Q=o.styled_default(sn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),nn=()=>o.n1,on=o.styled_default(nn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),rn=o.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),an=o.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),ln=o.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),cn={[y.PickHistoryStatus.LOST]:s.jsx(Q,{name:"incorrectVoted"}),[y.PickHistoryStatus.WON]:s.jsx(Q,{name:"icon-check"}),[y.PickHistoryStatus.UNSET]:s.jsx(Q,{name:"icon-arrow"}),[y.PickHistoryStatus.DNP]:s.jsx(Q,{name:"icon-arrow"})},dn=({questionId:e,questionType:t,questionStatus:n,subject:i,openForVoting:r,openQuestion:u,status:p})=>{const m=z.o[t],c=cn[p];return m?s.jsxs(Ks,{onClick:()=>u==null?void 0:u(e),children:[s.jsxs(an,{children:[s.jsxs(Xs,{children:[s.jsx(on,{"data-type-trivia":t===y.QuestionType.TRIVIA,"data-type-poll":t===y.QuestionType.POLL,name:m.iconName}),s.jsxs(rn,{children:[m.label,t===y.QuestionType.TRIVIA&&n===y.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(en,{children:i||""})]}),s.jsx(tn,{children:r?s.jsx(ln,{children:"Play"}):c})]}):null},un=o.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),pn=o.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),mn=({openInsight:e,questionId:t,...n})=>s.jsxs(un,{children:[s.jsx(he,{questionId:t,...n}),e&&s.jsx(pn,{onClick:()=>e(t),children:"View Insight"})]}),In=o.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),fn=({questions:e,openQuestion:t})=>s.jsx(In,{children:e==null?void 0:e.map(n=>{var i,r;if(n.type==="question"&&((i=n.attributes)==null?void 0:i.attributes.case)==="question"){const u=n.attributes.attributes.value;return s.jsx(dn,{openQuestion:t,...u},u.questionId)}if(n.type==="insight"&&((r=n.attributes)==null?void 0:r.attributes.case)==="insight"){const u=n.attributes.attributes.value;return s.jsx(mn,{openInsight:t,...u},u.questionId)}return null})}),hn=({store:e,openQuestion:t})=>{const n=k.useStore(e);return n!=null&&n.data?s.jsx(fn,{openQuestion:t,questions:n.data}):s.jsx("div",{children:"wait questions..."})},yn=({userSummary:e})=>{var t,n;const i=k.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(Ie,{...i.data.summary,successRate:(n=i.data.percentage)==null?void 0:n.correct}):s.jsx("div",{children:"wait user..."})},xn=({gamification:e})=>{const[t,n]=D.useState(R.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(z.a,{style:{paddingBottom:"4px"},children:s.jsx(Ms,{activePage:t,toggleActivePage:n})}),t===R.HOME&&s.jsxs(z.r,{children:[s.jsx(z.a,{style:{paddingTop:"12px"},children:s.jsx(yn,{userSummary:e.userSummary})}),s.jsx(z.n,{children:s.jsx(hn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===R.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Js,{gamification:e})})]})},gn=()=>z.d,ce=o.styled_default(gn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),jn=o.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Mn=({correct:e,incorrect:t})=>{const n=e+t;return n===0?0:Math.round(e/n*100)},vn=({gamification:e,className:t})=>{const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[n&&s.jsx(ce,{className:t,children:s.jsx(hs,{gamification:e})}),i&&s.jsx(ce,{className:t,children:s.jsxs(jn,{children:[s.jsx(ue,{label:"Friend's Rank",close:e.closeUser}),s.jsx(z.a,{children:s.jsx(Ie,{...i,successRate:Mn(i)})})]})}),s.jsx(z.r,{className:t,"data-nav":"true",children:s.jsx(xn,{gamification:e})})]})};exports.default=vn;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index4.js"),k=require("@nanostores/react"),O=require("./masters2.js"),h=require("@streamlayer/sdk-web-types"),D=require("react"),de=require("./index3.js");require("react-countup");const Ae=require("react-countdown-circle-timer"),C=require("./index2.js");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const Se=o.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),De=o.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),ze=()=>o.n1,Oe=o.styled_default(ze())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),_e=o.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),ke=o.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Ce=()=>o.n1,be=o.styled_default(Ce())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ue=({type:e,close:t,label:n})=>{const i=e?O.o[e]:{label:n,iconName:void 0};return s.jsxs(Se,{children:[s.jsxs(De,{children:[(i==null?void 0:i.iconName)&&s.jsx(Oe,{"data-type-trivia":e===h.QuestionType.TRIVIA,"data-type-poll":e===h.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(_e,{children:i.label})]}),s.jsx(ke,{onClick:t,children:s.jsx(be,{name:"icon-cross"})})]})},pe=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),me=e=>e?e.toLocaleString("en-US"):"0",Ee=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),we=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Le=e=>!isNaN(e.getTime()),$e=o.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Qe=o.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=o.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),Z=({indicator:e,title:t})=>s.jsxs($e,{children:[s.jsx(Qe,{children:t}),s.jsx(Re,{children:e})]}),Ue=o.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),qe=o.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=o.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:t})=>s.jsxs(Ue,{children:[s.jsx(qe,{children:e}),s.jsx(Pe,{children:t})]}),Ye=o.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),We=o.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ve=o.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=o.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Be=o.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),He=o.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ge=o.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ze=o.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Je=o.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ke=o.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Xe=o.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),et=o.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),tt=o.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),st=o.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),nt=o.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),it=o.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),ot=o.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",Ie=({avatar:e,name:t,points:n,friendsRank:i,rank:r,streak:u,correct:p,incorrect:m,inTop:c,successRate:I})=>s.jsxs(Ye,{children:[s.jsx(We,{children:s.jsxs(Fe,{children:[s.jsxs(ot,{children:[e&&s.jsx(Be,{alt:"avatar",src:e}),!e&&s.jsx(it,{children:pe(t||"")})]}),s.jsxs(He,{children:[s.jsx(Ge,{children:t}),s.jsxs(Ze,{children:[s.jsxs(Ke,{children:[s.jsx(Je,{alt:"rank-icon",src:rt}),s.jsxs(Xe,{children:[me(n),s.jsx(et,{children:"PTS"})]})]}),s.jsx(tt,{}),s.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),s.jsxs(Ve,{children:[s.jsxs(st,{children:[s.jsx(Z,{indicator:i||0,title:"Friends rank"}),s.jsx(Z,{indicator:r||0,title:"Global rank"})]}),s.jsxs(nt,{children:[s.jsx($,{indicator:u||0,title:"Win streak"}),s.jsx($,{indicator:p||0,title:"Correct"}),s.jsx($,{indicator:m||0,title:"Incorrect"}),s.jsx($,{indicator:`${I||0}%`,title:"Succ. rate"})]})]})]}),at=o.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),lt=()=>o.n1,ct=o.styled_default(lt())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),dt=()=>s.jsx(at,{children:s.jsx(ct,{name:"mastersLogo"})}),ut=o.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),pt=o.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),mt=o.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),It=({title:e,description:t})=>s.jsxs(ut,{children:[s.jsx(o.n1,{name:"icon-check-circle"}),s.jsx(pt,{children:e}),s.jsx(mt,{children:t})]}),ft=o.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ht=()=>o.n1,yt=o.styled_default(ht())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),J=o.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),K=o.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),xt=o.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),q=o.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),gt=o.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),jt=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:n,questionType:i,hasCorrectAnswer:r,questionStatus:u})=>{const p=n&&(i===h.QuestionType.TRIVIA||i===h.QuestionType.PREDICTION);if(!p&&u!==h.QuestionStatus.RESOLVED||u===h.QuestionStatus.RESOLVED&&i===h.QuestionType.PREDICTION&&!n)return null;const m=i===h.QuestionType.PREDICTION&&!r,c=t?"correct":"incorrect",I=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ft,{"data-isPrediction":m,children:[u===h.QuestionStatus.RESOLVED&&i===h.QuestionType.TRIVIA&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(J,{children:s.jsx(o.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(K,{children:s.jsx(q,{children:"Question Expired"})}),s.jsx(gt,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),p&&m&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{name:"icon-prediction"}),s.jsx(q,{children:"Stay tuned to see if your prediction was correct."})]}),p&&r&&s.jsxs(s.Fragment,{children:[s.jsx(J,{"data-feedbackType":c,children:s.jsx(o.n1,{name:c})}),s.jsx("div",{children:s.jsxs(K,{children:[s.jsx(xt,{"data-feedbackType":c,children:I==null?void 0:I.title}),s.jsx(q,{children:I==null?void 0:I.description})]})})]})]})},Mt=o.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),vt=o.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),Tt=o.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),Nt=o.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),At=o.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),St=o.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Dt=o.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),zt=o.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Ot=o.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),fe=o.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),_t=()=>fe,kt=o.styled_default(_t())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Ct=()=>fe,bt=o.styled_default(Ct())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Et=o.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),wt=o.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Lt=o.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),$t=()=>o.n1,Qt=o.styled_default($t())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),X={[h.QuestionImages.CENTERED]:e=>s.jsx(kt,{alt:"option-icon",src:e}),[h.QuestionImages.TRANSPARENT]:e=>s.jsx(zt,{children:s.jsx(Ot,{style:{backgroundImage:`url(${e})`}})}),[h.QuestionImages.ROUNDED]:e=>s.jsx(bt,{alt:"option-icon",src:e}),[h.QuestionImages.NONE]:()=>null,[h.QuestionImages.UNSET]:()=>null},Rt=({questionType:e,hasCorrectAnswer:t,correct:n,youVoted:i,questionVoted:r})=>{if(e===h.QuestionType.POLL&&i)return"correct";if(e===h.QuestionType.PREDICTION){if(t&&r)return i?n?"correct":"incorrect":"unset";if(i)return"correct"}return e===h.QuestionType.TRIVIA&&r&&i?n?"correct":"incorrect":"unset"},Ut=({questionType:e,questionVoted:t,correct:n,hasCorrectAnswer:i,questionStatus:r})=>e===h.QuestionType.TRIVIA?t&&n:e===h.QuestionType.PREDICTION?t&&n&&i||r===h.QuestionStatus.RESOLVED&&n:!1,qt=e=>{var t;const{id:n,icon:i,text:r,percentageDecimal:u,onVote:p,youSelected:m,questionVoted:c,imageMode:I,answerTimeExpired:v,questionStatus:A,isLoading:j,questionType:T,correct:N,hasCorrectAnswer:a}=e,l=Rt(e),d=Ut({questionType:T,questionVoted:c,correct:N,hasCorrectAnswer:a,questionStatus:A}),f=A===h.QuestionStatus.RESOLVED&&T===h.QuestionType.PREDICTION,y=c||f;return s.jsxs(At,{value:n,"data-selected":m,"data-answerState":l,disabled:c||j||v||f,"data-isNotChecked":c&&!m&&l!=="incorrect",onClick:p,children:[s.jsx(St,{"data-answerState":l,style:{width:`${y?u:0}%`}}),s.jsxs(Dt,{children:[i&&I&&((t=X[I])==null?void 0:t.call(X,i)),s.jsx(Et,{children:r}),y&&s.jsxs(wt,{children:[d&&s.jsx(Qt,{name:"selected"}),s.jsx(Lt,{children:s.jsx(de.d,{value:u,suffix:"%"})})]})]})]})},Pt=[C.E.PRIMARY_GREEN1,C.E.SECONDARY_RED1,C.E.SECONDARY_RED1,C.E.NEUTRALS_GRAY3],Yt=[10,10,1,0],Wt=o.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vt=C.E.SECONDARY_GREEN6,ee=C.E.SECONDARY_RED3,Ft=C.E.NEUTRALS_GRAY3,Bt=({isPlaying:e=!0,duration:t=30,onTimerExpired:n})=>{const[i,r]=D.useState(t>10?Vt:ee),u=({remainingTime:c})=>s.jsx(Wt,{children:c}),p=D.useCallback(()=>{n==null||n(),r(Ft)},[n,r]),m=D.useCallback(c=>{c===10&&r(ee)},[r]);return s.jsx(Ae.CountdownCircleTimer,{isPlaying:e,duration:t,colors:Pt,colorsTime:Yt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:p,onUpdate:m,children:u})},Ht=o.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Gt=o.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Zt=o.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Jt=()=>o.n1,Kt=o.styled_default(Jt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Xt=o.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),es=o.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),ts=o.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),ss=({title:e,points:t,isPlayingTimer:n,isTimer:i,questionType:r,timerDuration:u,onTimerExpired:p})=>s.jsxs(Ht,{children:[s.jsxs(Gt,{children:[e&&s.jsx(Zt,{children:e}),t!==void 0&&r!==h.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Kt,{name:"icon-trophy"}),s.jsxs(Xt,{children:[s.jsx(es,{children:s.jsx(de.d,{value:t})}),s.jsx(ts,{children:"PTS"})]})]})]}),i&&s.jsx(Bt,{isPlaying:n,onTimerExpired:p,duration:u})]}),ns=({openedQuestion:e,isLoading:t,vote:n,close:i})=>{var r,u;const p=e.subject,m=e.type,c=(r=e.options)==null?void 0:r.options,[I,v]=D.useState(!1),[A,j]=D.useState(""),T=e==null?void 0:e.id,N=D.useCallback(async g=>{if(T){const z=g.currentTarget.value;j(z),await n(T,z)}},[T,j,n]),a=D.useCallback(()=>{v(!0),setTimeout(i,3e3)},[i]),l=D.useMemo(()=>e==null?void 0:e.answers.find(g=>g.youVoted===!0),[e]),d=D.useMemo(()=>!!(e!=null&&e.answers.find(g=>g.correct===!0)),[e]),f=D.useMemo(()=>e==null?void 0:e.answers.find(g=>g.correct===!0),[e]),y=D.useMemo(()=>e?e.answers.map(g=>{var z;return{...g,questionVoted:!!l,youSelected:A===g.id,isLoading:t,hasCorrectAnswer:d,questionType:e.type,answerTimeExpired:I,questionStatus:e.status,imageMode:(z=e.appearance)==null?void 0:z.images,onVote:N}}):[],[d,I,t,e,l,N,A]),S=c&&(c.case==="trivia"||c.case==="prediction")?c.value:void 0,x=D.useMemo(()=>{if(e.status===h.QuestionStatus.RESOLVED)return 0;if(!I)return l?l.correct?l.points:0:f==null?void 0:f.points},[I,l,f,e.status]),M=D.useMemo(()=>I?"Time expired":e.type===h.QuestionType.POLL?"Time remaining":l?"You won":"To win",[I,e.type,l]);return s.jsx(O.r,{"data-question-header":"true",children:s.jsx(Mt,{children:s.jsxs(vt,{children:[S&&s.jsx(jt,{feedbackMessages:S,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:m,hasCorrectAnswer:d,questionStatus:e.status}),e.type!==h.QuestionType.PREDICTION&&s.jsx(ss,{title:M,points:x,onTimerExpired:a,questionType:e.type,isTimer:!t,isPlayingTimer:!l,timerDuration:l?0:Number(((u=e==null?void 0:e.appearance)==null?void 0:u.autoHideInterval)||"30")}),I?s.jsx(It,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(Tt,{"data-isPrediction":e.type===h.QuestionType.PREDICTION,children:p}),s.jsx(Nt,{children:y.map(g=>s.jsx(qt,{...g},g.id))})]})]})})})},is=o.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),os=o.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),rs=o.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),as=o.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),ls=o.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),cs=o.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),he=({created:e,image:t,title:n,instantView:i})=>{const r=D.useMemo(()=>{if(e){const p=new Date(e);if(Le(p))return{date:Ee(p),time:we(p)}}return null},[e]),u=(i==null?void 0:i.image)||t;return s.jsxs(is,{children:[r&&s.jsxs(ls,{children:[r.date," · ",r.time]}),(i==null?void 0:i.video)&&s.jsx(O.w,{source:i.video.url,poster:i.video.thumbnailUrl}),u&&s.jsx(cs,{src:u}),s.jsxs(os,{children:[s.jsx(rs,{children:(i==null?void 0:i.heading)||n}),s.jsx(as,{children:i==null?void 0:i.body})]})]})},ds=o.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),us=o.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ps=({instantView:e,...t})=>s.jsxs(ds,{children:[s.jsx(he,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(us,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(o.n1,{name:"icon-external-link"})]})]}),ms=o.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),Is=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ps,{created:e.attributes.created,...e.attributes.attributes.value}):null},fs=({extendedQuestion:e,vote:t,close:n})=>{const{loading:i,data:r}=e;return r?s.jsx(ns,{vote:t,close:n,openedQuestion:r,isLoading:!!i}):null},hs=({gamification:e})=>{var t;const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedQuestion.$extendedStore);if(!n)return null;const r=n.type;return s.jsxs(ms,{children:[s.jsx(ue,{close:e.closeQuestion,type:((t=n.attributes)==null?void 0:t.type)||h.QuestionType.UNSET}),r==="question"&&s.jsx(fs,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),r!=="question"&&s.jsx(Is,{openedQuestion:n}),s.jsx(dt,{sponsorLogo:""})]})},ys=o.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),xs=o.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),gs=o.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),js=o.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var R=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(R||{});const te=({title:e,active:t,onClick:n})=>s.jsx(gs,{onClick:n,"data-selected":t,children:s.jsx(js,{children:e})}),Ms=({activePage:e="home",toggleActivePage:t})=>s.jsx(ys,{children:s.jsxs(xs,{"data-position":e==="home"?"left":"right",children:[s.jsx(te,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(te,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},W.apply(this,arguments)}function se(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},V(e,t)}function vs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V(e,t)}var ne=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Ts(e,t){return!!(e===t||ne(e)&&ne(t))}function Ns(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Ts(e[n],t[n]))return!1;return!0}function P(e,t){t===void 0&&(t=Ns);var n,i=[],r,u=!1;function p(){for(var m=[],c=0;c<arguments.length;c++)m[c]=arguments[c];return u&&n===this&&t(m,i)||(r=e.apply(this,m),u=!0,n=this,i=m),r}return p}var As=typeof performance=="object"&&typeof performance.now=="function",ie=As?function(){return performance.now()}:function(){return Date.now()};function oe(e){cancelAnimationFrame(e.id)}function Ss(e,t){var n=ie();function i(){ie()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}var r={id:requestAnimationFrame(i)};return r}var Y=-1;function re(e){if(e===void 0&&(e=!1),Y===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Y=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Y}var b=null;function ae(e){if(e===void 0&&(e=!1),b===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var i=document.createElement("div"),r=i.style;return r.width="100px",r.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?b="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?b="negative":b="positive-ascending"),document.body.removeChild(t),b}return b}var Ds=150,zs=function(t,n){return t};function Os(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,r=e.getItemSize,u=e.getOffsetForIndexAndAlignment,p=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,c=e.initInstanceProps,I=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(A){vs(j,A);function j(N){var a;return a=A.call(this,N)||this,a._instanceProps=c(a.props,se(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:se(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=P(function(l,d,f,y){return a.props.onItemsRendered({overscanStartIndex:l,overscanStopIndex:d,visibleStartIndex:f,visibleStopIndex:y})}),a._callOnScroll=void 0,a._callOnScroll=P(function(l,d,f){return a.props.onScroll({scrollDirection:l,scrollOffset:d,scrollUpdateWasRequested:f})}),a._getItemStyle=void 0,a._getItemStyle=function(l){var d=a.props,f=d.direction,y=d.itemSize,S=d.layout,x=a._getItemStyleCache(I&&y,I&&S,I&&f),M;if(x.hasOwnProperty(l))M=x[l];else{var g=n(a.props,l,a._instanceProps),z=r(a.props,l,a._instanceProps),_=f==="horizontal"||S==="horizontal",w=f==="rtl",L=_?g:0;x[l]=M={position:"absolute",left:w?void 0:L,right:w?L:void 0,top:_?0:g,height:_?"100%":z,width:_?z:"100%"}}return M},a._getItemStyleCache=void 0,a._getItemStyleCache=P(function(l,d,f){return{}}),a._onScrollHorizontal=function(l){var d=l.currentTarget,f=d.clientWidth,y=d.scrollLeft,S=d.scrollWidth;a.setState(function(x){if(x.scrollOffset===y)return null;var M=a.props.direction,g=y;if(M==="rtl")switch(ae()){case"negative":g=-y;break;case"positive-descending":g=S-f-y;break}return g=Math.max(0,Math.min(g,S-f)),{isScrolling:!0,scrollDirection:x.scrollOffset<y?"forward":"backward",scrollOffset:g,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(l){var d=l.currentTarget,f=d.clientHeight,y=d.scrollHeight,S=d.scrollTop;a.setState(function(x){if(x.scrollOffset===S)return null;var M=Math.max(0,Math.min(S,y-f));return{isScrolling:!0,scrollDirection:x.scrollOffset<M?"forward":"backward",scrollOffset:M,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(l){var d=a.props.outerRef;a._outerRef=l,typeof d=="function"?d(l):d!=null&&typeof d=="object"&&d.hasOwnProperty("current")&&(d.current=l)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&oe(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=Ss(a._resetIsScrolling,Ds)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}j.getDerivedStateFromProps=function(a,l){return _s(a,l),v(a),null};var T=j.prototype;return T.scrollTo=function(a){a=Math.max(0,a),this.setState(function(l){return l.scrollOffset===a?null:{scrollDirection:l.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},T.scrollToItem=function(a,l){l===void 0&&(l="auto");var d=this.props,f=d.itemCount,y=d.layout,S=this.state.scrollOffset;a=Math.max(0,Math.min(a,f-1));var x=0;if(this._outerRef){var M=this._outerRef;y==="vertical"?x=M.scrollWidth>M.clientWidth?re():0:x=M.scrollHeight>M.clientHeight?re():0}this.scrollTo(u(this.props,a,l,S,this._instanceProps,x))},T.componentDidMount=function(){var a=this.props,l=a.direction,d=a.initialScrollOffset,f=a.layout;if(typeof d=="number"&&this._outerRef!=null){var y=this._outerRef;l==="horizontal"||f==="horizontal"?y.scrollLeft=d:y.scrollTop=d}this._callPropsCallbacks()},T.componentDidUpdate=function(){var a=this.props,l=a.direction,d=a.layout,f=this.state,y=f.scrollOffset,S=f.scrollUpdateWasRequested;if(S&&this._outerRef!=null){var x=this._outerRef;if(l==="horizontal"||d==="horizontal")if(l==="rtl")switch(ae()){case"negative":x.scrollLeft=-y;break;case"positive-ascending":x.scrollLeft=y;break;default:var M=x.clientWidth,g=x.scrollWidth;x.scrollLeft=g-M-y;break}else x.scrollLeft=y;else x.scrollTop=y}this._callPropsCallbacks()},T.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&oe(this._resetIsScrollingTimeoutId)},T.render=function(){var a=this.props,l=a.children,d=a.className,f=a.direction,y=a.height,S=a.innerRef,x=a.innerElementType,M=a.innerTagName,g=a.itemCount,z=a.itemData,_=a.itemKey,w=_===void 0?zs:_,L=a.layout,ye=a.outerElementType,xe=a.outerTagName,ge=a.style,je=a.useIsScrolling,Me=a.width,F=this.state.isScrolling,U=f==="horizontal"||L==="horizontal",ve=U?this._onScrollHorizontal:this._onScrollVertical,B=this._getRangeToRender(),Te=B[0],Ne=B[1],H=[];if(g>0)for(var E=Te;E<=Ne;E++)H.push(D.createElement(l,{data:z,key:w(E,z),index:E,isScrolling:je?F:void 0,style:this._getItemStyle(E)}));var G=i(this.props,this._instanceProps);return D.createElement(ye||xe||"div",{className:d,onScroll:ve,ref:this._outerRefSetter,style:W({position:"relative",height:y,width:Me,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},ge)},D.createElement(x||M||"div",{children:H,ref:S,style:{height:U?"100%":G,pointerEvents:F?"none":void 0,width:U?G:"100%"}}))},T._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var l=this._getRangeToRender(),d=l[0],f=l[1],y=l[2],S=l[3];this._callOnItemsRendered(d,f,y,S)}}if(typeof this.props.onScroll=="function"){var x=this.state,M=x.scrollDirection,g=x.scrollOffset,z=x.scrollUpdateWasRequested;this._callOnScroll(M,g,z)}},T._getRangeToRender=function(){var a=this.props,l=a.itemCount,d=a.overscanCount,f=this.state,y=f.isScrolling,S=f.scrollDirection,x=f.scrollOffset;if(l===0)return[0,0,0,0];var M=p(this.props,x,this._instanceProps),g=m(this.props,M,x,this._instanceProps),z=!y||S==="backward"?Math.max(1,d):1,_=!y||S==="forward"?Math.max(1,d):1;return[Math.max(0,M-z),Math.max(0,Math.min(l-1,g+_)),M,g]},j}(D.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var _s=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},ks=Os({getItemOffset:function(t,n){var i=t.itemSize;return n*i},getItemSize:function(t,n){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var n=t.itemCount,i=t.itemSize;return i*n},getOffsetForIndexAndAlignment:function(t,n,i,r,u,p){var m=t.direction,c=t.height,I=t.itemCount,v=t.itemSize,A=t.layout,j=t.width,T=m==="horizontal"||A==="horizontal",N=T?j:c,a=Math.max(0,I*v-N),l=Math.min(a,n*v),d=Math.max(0,n*v-N+v+p);switch(i==="smart"&&(r>=d-N&&r<=l+N?i="auto":i="center"),i){case"start":return l;case"end":return d;case"center":{var f=Math.round(d+(l-d)/2);return f<Math.ceil(N/2)?0:f>a+Math.floor(N/2)?a:f}case"auto":default:return r>=d&&r<=l?r:r<d?d:l}},getStartIndexForOffset:function(t,n){var i=t.itemCount,r=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(n/r)))},getStopIndexForStartIndex:function(t,n,i){var r=t.direction,u=t.height,p=t.itemCount,m=t.itemSize,c=t.layout,I=t.width,v=r==="horizontal"||c==="horizontal",A=n*m,j=v?I:u,T=Math.ceil((j+i-A)/m);return Math.max(0,Math.min(p-1,n+T-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function Cs(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,i=e.startIndex,r=e.stopIndex;return!(i>n||r<t)}function bs(e){for(var t=e.isItemLoaded,n=e.itemCount,i=e.minimumBatchSize,r=e.startIndex,u=e.stopIndex,p=[],m=null,c=null,I=r;I<=u;I++){var v=t(I);v?c!==null&&(p.push(m,c),m=c=null):(c=I,m===null&&(m=I))}if(c!==null){for(var A=Math.min(Math.max(c,m+i-1),n-1),j=c+1;j<=A&&!t(j);j++)c=j;p.push(m,c)}if(p.length)for(;p[1]-p[0]+1<i&&p[0]>0;){var T=p[0]-1;if(!t(T))p[0]=T;else break}return p}var Es=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ws=function(){function e(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Ls=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},le=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},$s=function(e){Ls(t,e);function t(){var n,i,r,u;Es(this,t);for(var p=arguments.length,m=Array(p),c=0;c<p;c++)m[c]=arguments[c];return u=(i=(r=le(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(m))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(I){var v=I.visibleStartIndex,A=I.visibleStopIndex;r._lastRenderedStartIndex=v,r._lastRenderedStopIndex=A,r._ensureRowsLoaded(v,A)},r._setRef=function(I){r._listRef=I},i),le(r,u)}return ws(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,r){var u=this.props,p=u.isItemLoaded,m=u.itemCount,c=u.minimumBatchSize,I=c===void 0?10:c,v=u.threshold,A=v===void 0?15:v,j=bs({isItemLoaded:p,itemCount:m,minimumBatchSize:I,startIndex:Math.max(0,i-A),stopIndex:Math.min(m-1,r+A)});(this._memoizedUnloadedRanges.length!==j.length||this._memoizedUnloadedRanges.some(function(T,N){return j[N]!==T}))&&(this._memoizedUnloadedRanges=j,this._loadUnloadedRanges(j))}},{key:"_loadUnloadedRanges",value:function(i){for(var r=this,u=this.props.loadMoreItems||this.props.loadMoreRows,p=function(I){var v=i[I],A=i[I+1],j=u(v,A);j!=null&&j.then(function(){if(Cs({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:v,stopIndex:A})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(v,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)p(m)}}]),t}(D.PureComponent);const Qs=o.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Rs=o.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Us=o.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),qs=o.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ps=o.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ys=o.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Ws=o.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Vs=()=>o.n1,Fs=o.styled_default(Vs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Bs=({rank:e,avatar:t,name:n,points:i,isCurrentUser:r,openItemDetail:u,style:p})=>s.jsxs(Qs,{onClick:u,style:p,children:[s.jsx(Rs,{children:e||0}),s.jsxs(Ps,{children:[t?s.jsx(Us,{alt:"leaderboard-item-avatar",src:t}):s.jsx(qs,{children:pe(n||"")}),s.jsxs(Ys,{children:[s.jsx(Ws,{children:n||""}),r&&s.jsx(Fs,{name:"icon-star"})]})]}),s.jsx("div",{children:me(i)})]}),Hs=o.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Gs=({items:e,currentUserId:t,openItemDetail:n,fetchMore:i})=>s.jsx(O.AutoSizer,{children:({width:r,height:u})=>s.jsx($s,{isItemLoaded:p=>p<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:p,ref:m})=>s.jsx(Hs,{children:s.jsx(ks,{itemSize:56,onItemsRendered:p,ref:m,itemCount:e.length,width:r,height:u,children:({index:c,style:I})=>s.jsx(Bs,{style:{...I,maxHeight:48},...e[c],openItemDetail:()=>n(e[c].userId),isCurrentUser:!!t&&t===e[c].userId},e[c].userId)})})})}),Zs=({deepLink:e})=>{const{data:t}=k.useStore(e.$store),n=t==null?void 0:t.url,i=e.desktopLink;return s.jsx(O.O,{inviteLink:n||i,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},Js=({gamification:e})=>{const{data:t}=k.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Gs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Zs,{deepLink:e.deepLink})},Ks=o.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Xs=o.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),en=o.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),tn=o.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),sn=()=>o.n1,Q=o.styled_default(sn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),nn=()=>o.n1,on=o.styled_default(nn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),rn=o.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),an=o.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),ln=o.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),cn={[h.PickHistoryStatus.LOST]:s.jsx(Q,{name:"incorrectVoted"}),[h.PickHistoryStatus.WON]:s.jsx(Q,{name:"icon-check"}),[h.PickHistoryStatus.UNSET]:s.jsx(Q,{name:"icon-arrow"}),[h.PickHistoryStatus.DNP]:s.jsx(Q,{name:"icon-arrow"})},dn=({questionId:e,questionType:t,questionStatus:n,subject:i,openForVoting:r,openQuestion:u,status:p})=>{const m=O.o[t],c=cn[p];return m?s.jsxs(Ks,{onClick:()=>u==null?void 0:u(e),children:[s.jsxs(an,{children:[s.jsxs(Xs,{children:[s.jsx(on,{"data-type-trivia":t===h.QuestionType.TRIVIA,"data-type-poll":t===h.QuestionType.POLL,name:m.iconName}),s.jsxs(rn,{children:[m.label,t===h.QuestionType.TRIVIA&&n===h.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(en,{children:i||""})]}),s.jsx(tn,{children:r?s.jsx(ln,{children:"Play"}):c})]}):null},un=o.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),pn=o.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),mn=({openInsight:e,questionId:t,...n})=>s.jsxs(un,{children:[s.jsx(he,{questionId:t,...n}),e&&s.jsx(pn,{onClick:()=>e(t),children:"View Insight"})]}),In=o.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),fn=({questions:e,openQuestion:t})=>s.jsx(In,{children:e==null?void 0:e.map(n=>{var i,r;if(n.type==="question"&&((i=n.attributes)==null?void 0:i.attributes.case)==="question"){const u=n.attributes.attributes.value;return s.jsx(dn,{openQuestion:t,...u},u.questionId)}if(n.type==="insight"&&((r=n.attributes)==null?void 0:r.attributes.case)==="insight"){const u=n.attributes.attributes.value;return s.jsx(mn,{openInsight:t,...u},u.questionId)}return null})}),hn=({store:e,openQuestion:t})=>{const n=k.useStore(e);return n!=null&&n.data?s.jsx(fn,{openQuestion:t,questions:n.data}):s.jsx("div",{children:"wait questions..."})},yn=({userSummary:e})=>{var t,n;const i=k.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(Ie,{...i.data.summary,successRate:(n=i.data.percentage)==null?void 0:n.correct}):s.jsx("div",{children:"wait user..."})},xn=({gamification:e})=>{const[t,n]=D.useState(R.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(O.a,{style:{paddingBottom:"4px"},children:s.jsx(Ms,{activePage:t,toggleActivePage:n})}),t===R.HOME&&s.jsxs(O.r,{children:[s.jsx(O.a,{style:{paddingTop:"12px"},children:s.jsx(yn,{userSummary:e.userSummary})}),s.jsx(O.n,{children:s.jsx(hn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===R.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Js,{gamification:e})})]})},gn=()=>O.d,ce=o.styled_default(gn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),jn=o.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Mn=({correct:e,incorrect:t})=>{const n=e+t;return n===0?0:Math.round(e/n*100)},vn=({gamification:e,className:t})=>{const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[n&&s.jsx(ce,{className:t,children:s.jsx(hs,{gamification:e})}),i&&s.jsx(ce,{className:t,children:s.jsxs(jn,{children:[s.jsx(ue,{label:"Friend's Rank",close:e.closeUser}),s.jsx(O.a,{children:s.jsx(Ie,{...i,successRate:Mn(i)})})]})}),s.jsx(O.r,{className:t,"data-nav":"true",children:s.jsx(xn,{gamification:e})})]})};exports.default=vn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),T=require("react"),Ae=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Se=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),De=()=>n.n1,ze=n.styled_default(De())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ke=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Oe=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),we=()=>n.n1,Ce=n.styled_default(we())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:r})=>{const i=e?n.o[e]:{label:r,iconName:void 0};return s.jsxs(Ae,{children:[s.jsxs(Se,{children:[(i==null?void 0:i.iconName)&&s.jsx(ze,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(ke,{children:i.label})]}),s.jsx(Oe,{onClick:t,children:s.jsx(Ce,{name:"icon-cross"})})]})},de=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ue=e=>e?e.toLocaleString("en-US"):"0",_e=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),be=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Ee=e=>!isNaN(e.getTime()),Le=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),$e=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),V=({indicator:e,title:t})=>s.jsxs(Le,{children:[s.jsx($e,{children:t}),s.jsx(Re,{children:e})]}),Qe=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Ue=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),_=({indicator:e,title:t})=>s.jsxs(Qe,{children:[s.jsx(Ue,{children:e}),s.jsx(Pe,{children:t})]}),qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Ye=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),We=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ve=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Be=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),He=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ze=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Je=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Ke=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Xe=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),et=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),tt=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),st=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),nt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),it=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",pe=({avatar:e,name:t,points:r,friendsRank:i,rank:a,streak:l,correct:c,incorrect:m,inTop:u,successRate:f})=>s.jsxs(qe,{children:[s.jsx(Ye,{children:s.jsxs(Fe,{children:[s.jsxs(it,{children:[e&&s.jsx(Ve,{alt:"avatar",src:e}),!e&&s.jsx(nt,{children:de(t||"")})]}),s.jsxs(Be,{children:[s.jsx(He,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Je,{children:[s.jsx(Ze,{alt:"rank-icon",src:rt}),s.jsxs(Ke,{children:[ue(r),s.jsx(Xe,{children:"PTS"})]})]}),s.jsx(et,{}),s.jsxs("div",{children:["TOP ",u||0,"%"]})]})]})]})}),s.jsxs(We,{children:[s.jsxs(tt,{children:[s.jsx(V,{indicator:i||0,title:"Friends rank"}),s.jsx(V,{indicator:a||0,title:"Global rank"})]}),s.jsxs(st,{children:[s.jsx(_,{indicator:l||0,title:"Win streak"}),s.jsx(_,{indicator:c||0,title:"Correct"}),s.jsx(_,{indicator:m||0,title:"Incorrect"}),s.jsx(_,{indicator:`${f||0}%`,title:"Succ. rate"})]})]})]}),at=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),ot=()=>n.n1,lt=n.styled_default(ot())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),ct=()=>s.jsx(at,{children:s.jsx(lt,{name:"mastersLogo"})}),dt=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),ut=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),pt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),mt=({title:e,description:t})=>s.jsxs(dt,{children:[s.jsx(n.n1,{name:"icon-check-circle"}),s.jsx(ut,{children:e}),s.jsx(pt,{children:t})]}),ft=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ht=()=>n.n1,It=n.styled_default(ht())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),B=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),H=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),yt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),$=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),gt=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),xt=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:r,questionType:i,hasCorrectAnswer:a,questionStatus:l})=>{const c=r&&(i===n.QuestionType.TRIVIA||i===n.QuestionType.PREDICTION);if(!c&&l!==n.QuestionStatus.RESOLVED||l===n.QuestionStatus.RESOLVED&&i===n.QuestionType.PREDICTION&&!r)return null;const m=i===n.QuestionType.PREDICTION&&!a,u=t?"correct":"incorrect",f=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ft,{"data-isPrediction":m,children:[l===n.QuestionStatus.RESOLVED&&i===n.QuestionType.TRIVIA&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(B,{children:s.jsx(n.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx($,{children:"Question Expired"})}),s.jsx(gt,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),c&&m&&s.jsxs(s.Fragment,{children:[s.jsx(It,{name:"icon-prediction"}),s.jsx($,{children:"Stay tuned to see if your prediction was correct."})]}),c&&a&&s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-feedbackType":u,children:s.jsx(n.n1,{name:u})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(yt,{"data-feedbackType":u,children:f==null?void 0:f.title}),s.jsx($,{children:f==null?void 0:f.description})]})})]})]})},jt=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),vt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),Mt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),Tt=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),Nt=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),At=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),St=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Dt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),zt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),me=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),kt=()=>me,Ot=n.styled_default(kt())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),wt=()=>me,Ct=n.styled_default(wt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),_t=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),bt=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Et=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Lt=()=>n.n1,$t=n.styled_default(Lt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(Ot,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Dt,{children:s.jsx(zt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(Ct,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Rt=({questionType:e,hasCorrectAnswer:t,correct:r,youVoted:i,questionVoted:a})=>{if(e===n.QuestionType.POLL&&i)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&a)return i?r?"correct":"incorrect":"unset";if(i)return"correct"}return e===n.QuestionType.TRIVIA&&a&&i?r?"correct":"incorrect":"unset"},Qt=({questionType:e,questionVoted:t,correct:r,hasCorrectAnswer:i,questionStatus:a})=>e===n.QuestionType.TRIVIA?t&&r:e===n.QuestionType.PREDICTION?t&&r&&i||a===n.QuestionStatus.RESOLVED&&r:!1,Ut=e=>{var t;const{id:r,icon:i,text:a,percentageDecimal:l,onVote:c,youSelected:m,questionVoted:u,imageMode:f,answerTimeExpired:v,questionStatus:g,isLoading:y,questionType:M,correct:N,hasCorrectAnswer:o}=e,d=Rt(e),p=Qt({questionType:M,questionVoted:u,correct:N,hasCorrectAnswer:o,questionStatus:g}),h=g===n.QuestionStatus.RESOLVED&&M===n.QuestionType.PREDICTION,I=u||h;return s.jsxs(Nt,{value:r,"data-selected":m,"data-answerState":d,disabled:u||y||v||h,"data-isNotChecked":u&&!m&&d!=="incorrect",onClick:c,children:[s.jsx(At,{"data-answerState":d,style:{width:`${I?l:0}%`}}),s.jsxs(St,{children:[i&&f&&((t=G[f])==null?void 0:t.call(G,i)),s.jsx(_t,{children:a}),I&&s.jsxs(bt,{children:[p&&s.jsx($t,{name:"selected"}),s.jsx(Et,{children:s.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,Pt=({isPlaying:e,duration:t,startAt:r=0,updateInterval:i=0,onComplete:a,onUpdate:l})=>{let[c,m]=T.useState(r),u=T.useRef(0),f=T.useRef(r),v=T.useRef(r*-1e3),g=T.useRef(null),y=T.useRef(null),M=T.useRef(null),N=p=>{let h=p/1e3;if(y.current===null){y.current=h,g.current=requestAnimationFrame(N);return}let I=h-y.current,j=u.current+I;y.current=h,u.current=j;let x=f.current+(i===0?j:(j/i|0)*i),A=f.current+j,S=typeof t=="number"&&A>=t;m(S?t:x),S||(g.current=requestAnimationFrame(N))},o=()=>{g.current&&cancelAnimationFrame(g.current),M.current&&clearTimeout(M.current),y.current=null},d=T.useCallback(p=>{o(),u.current=0;let h=typeof p=="number"?p:r;f.current=h,m(h),e&&(g.current=requestAnimationFrame(N))},[e,r]);return Z(()=>{if(l==null||l(c),t&&c>=t){v.current+=t*1e3;let{shouldRepeat:p=!1,delay:h=0,newStartAt:I}=(a==null?void 0:a(v.current/1e3))||{};p&&(M.current=setTimeout(()=>d(I),h*1e3))}},[c,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),o),[e,t,i]),{elapsedTime:c,reset:d}},qt=(e,t,r)=>{let i=e/2,a=t/2,l=i-a,c=2*l,m=r==="clockwise"?"1,0":"0,1",u=2*Math.PI*l;return{path:`m ${i},${a} a ${l},${l} 0 ${m} 0,${c} a ${l},${l} 0 ${m} 0,-${c}`,pathLength:u}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Yt=e=>({position:"relative",width:e,height:e}),Wt={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},fe=(e,t,r,i,a)=>{if(i===0)return t;let l=(a?i-e:e)/i;return t+r*l},K=e=>{var t,r;return(r=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,a,l,c)=>`#${a}${a}${l}${l}${c}${c}`).substring(1).match(/.{2}/g))==null?void 0:t.map(i=>parseInt(i,16)))!=null?r:[]},Ft=(e,t)=>{var r;let{colors:i,colorsTime:a,isSmoothColorTransition:l=!0}=e;if(typeof i=="string")return i;let c=(r=a==null?void 0:a.findIndex((y,M)=>y>=t&&t>=a[M+1]))!=null?r:-1;if(!a||c===-1)return i[0];if(!l)return i[c];let m=a[c]-t,u=a[c]-a[c+1],f=K(i[c]),v=K(i[c+1]),g=!!e.isGrowing;return`rgb(${f.map((y,M)=>fe(m,y,v[M]-y,u,g)|0).join(",")})`},Vt=e=>{let{duration:t,initialRemainingTime:r,updateInterval:i,size:a=180,strokeWidth:l=12,trailStrokeWidth:c,isPlaying:m=!1,isGrowing:u=!1,rotation:f="clockwise",onComplete:v,onUpdate:g}=e,y=T.useRef(),M=Math.max(l,c??0),{path:N,pathLength:o}=qt(a,M,f),{elapsedTime:d}=Pt({isPlaying:m,duration:t,startAt:J(t,r),updateInterval:i,onUpdate:typeof g=="function"?h=>{let I=Math.ceil(t-h);I!==y.current&&(y.current=I,g(I))}:void 0,onComplete:typeof v=="function"?h=>{var I;let{shouldRepeat:j,delay:x,newInitialRemainingTime:A}=(I=v(h))!=null?I:{};if(j)return{shouldRepeat:j,delay:x,newStartAt:J(t,A)}}:void 0}),p=t-d;return{elapsedTime:d,path:N,pathLength:o,remainingTime:Math.ceil(p),rotation:f,size:a,stroke:Ft(e,p),strokeDashoffset:fe(d,0,o,t,u),strokeWidth:l}},he=e=>{let{children:t,strokeLinecap:r,trailColor:i,trailStrokeWidth:a}=e,{path:l,pathLength:c,stroke:m,strokeDashoffset:u,remainingTime:f,elapsedTime:v,size:g,strokeWidth:y}=Vt(e);return T.createElement("div",{style:Yt(g)},T.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:l,fill:"none",stroke:i??"#d9d9d9",strokeWidth:a??y}),T.createElement("path",{d:l,fill:"none",stroke:m,strokeLinecap:r??"round",strokeWidth:y,strokeDasharray:c,strokeDashoffset:u})),typeof t=="function"&&T.createElement("div",{style:Wt},t({remainingTime:f,elapsedTime:v,color:m})))};he.displayName="CountdownCircleTimer";const Bt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Ht=[10,10,0],Gt=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Zt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Jt=n.E.NEUTRALS_GRAY3,Kt=({isPlaying:e=!0,duration:t=30,onTimerExpired:r})=>{const[i,a]=T.useState(t>10?Zt:X),l=({remainingTime:u})=>s.jsx(Gt,{children:u}),c=T.useCallback(()=>{r==null||r(),a(Jt)},[r,a]),m=T.useCallback(u=>{u===10&&a(X)},[a]);return s.jsx(he,{isPlaying:e,duration:t,colors:Bt,colorsTime:Ht,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:c,onUpdate:m,children:l})},Xt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),es=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),ts=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),ss=()=>n.n1,ns=n.styled_default(ss())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),is=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),rs=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),as=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),os=({title:e,points:t,isPlayingTimer:r,isTimer:i,questionType:a,timerDuration:l,onTimerExpired:c})=>s.jsxs(Xt,{children:[s.jsxs(es,{children:[e&&s.jsx(ts,{children:e}),t!==void 0&&a!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(ns,{name:"icon-trophy"}),s.jsxs(is,{children:[s.jsx(rs,{children:s.jsx(n.d,{value:t})}),s.jsx(as,{children:"PTS"})]})]})]}),i&&s.jsx(Kt,{isPlaying:r,onTimerExpired:c,duration:l})]}),ls=({openedQuestion:e,isLoading:t,vote:r,close:i})=>{var a,l;const c=e.subject,m=e.type,u=(a=e.options)==null?void 0:a.options,[f,v]=T.useState(!1),[g,y]=T.useState(""),M=e==null?void 0:e.id,N=T.useCallback(async j=>{if(M){const x=j.currentTarget.value;y(x),await r(M,x)}},[M,y,r]),o=T.useCallback(()=>{v(!0),setTimeout(i,3e3)},[i]),d=T.useMemo(()=>e==null?void 0:e.answers.find(j=>j.youVoted===!0),[e]),p=T.useMemo(()=>!!(e!=null&&e.answers.find(j=>j.correct===!0)),[e]),h=T.useMemo(()=>e?e.answers.map(j=>{var x;return{...j,questionVoted:!!d,youSelected:g===j.id,isLoading:t,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:f,questionStatus:e.status,imageMode:(x=e.appearance)==null?void 0:x.images,onVote:N}}):[],[p,f,t,e,d,N,g]),I=u&&(u.case==="trivia"||u.case==="prediction")?u.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(jt,{children:s.jsxs(vt,{children:[I&&s.jsx(xt,{feedbackMessages:I,questionVoted:!!d,questionVotedCorrectly:d==null?void 0:d.correct,questionType:m,hasCorrectAnswer:p,questionStatus:e.status}),e.type!==n.QuestionType.PREDICTION&&s.jsx(os,{title:f?"Time expired":e.type===n.QuestionType.POLL?"Time remaining":"To win",points:f?void 0:d!=null&&d.correct?d==null?void 0:d.points:0,onTimerExpired:o,questionType:e.type,isTimer:!t,isPlayingTimer:!d,timerDuration:d?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),f?s.jsx(mt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(Mt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:c}),s.jsx(Tt,{children:h.map(j=>s.jsx(Ut,{...j},j.id))})]})]})})})},cs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ds=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),us=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ps=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),ms=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),fs=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),Ie=({created:e,image:t,title:r,instantView:i})=>{const a=T.useMemo(()=>{if(e){const c=new Date(e);if(Ee(c))return{date:_e(c),time:be(c)}}return null},[e]),l=(i==null?void 0:i.image)||t;return s.jsxs(cs,{children:[a&&s.jsxs(ms,{children:[a.date," · ",a.time]}),(i==null?void 0:i.video)&&s.jsx(n.w,{source:i.video.url,poster:i.video.thumbnailUrl}),l&&s.jsx(fs,{src:l}),s.jsxs(ds,{children:[s.jsx(us,{children:(i==null?void 0:i.heading)||r}),s.jsx(ps,{children:i==null?void 0:i.body})]})]})},hs=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Is=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ys=({instantView:e,...t})=>s.jsxs(hs,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(Is,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.n1,{name:"icon-external-link"})]})]}),gs=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),xs=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ys,{created:e.attributes.created,...e.attributes.attributes.value}):null},js=({extendedQuestion:e,vote:t,close:r})=>{const{loading:i,data:a}=e;return a?s.jsx(ls,{vote:t,close:r,openedQuestion:a,isLoading:!!i}):null},vs=({gamification:e})=>{var t;const r=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedQuestion.$extendedStore);if(!r)return null;const a=r.type;return s.jsxs(gs,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=r.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(js,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),a!=="question"&&s.jsx(xs,{openedQuestion:r}),s.jsx(ct,{sponsorLogo:""})]})},Ms=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Ts=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),Ns=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),As=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var E=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(E||{});const ee=({title:e,active:t,onClick:r})=>s.jsx(Ns,{onClick:r,"data-selected":t,children:s.jsx(As,{children:e})}),Ss=({activePage:e="home",toggleActivePage:t})=>s.jsx(Ms,{children:s.jsxs(Ts,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,a){return i.__proto__=a,i},P(e,t)}function Ds(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,P(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function zs(e,t){return!!(e===t||se(e)&&se(t))}function ks(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!zs(e[r],t[r]))return!1;return!0}function R(e,t){t===void 0&&(t=ks);var r,i=[],a,l=!1;function c(){for(var m=[],u=0;u<arguments.length;u++)m[u]=arguments[u];return l&&r===this&&t(m,i)||(a=e.apply(this,m),l=!0,r=this,i=m),a}return c}var Os=typeof performance=="object"&&typeof performance.now=="function",ne=Os?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function ws(e,t){var r=ne();function i(){ne()-r>=t?e.call(null):a.id=requestAnimationFrame(i)}var a={id:requestAnimationFrame(i)};return a}var Q=-1;function re(e){if(e===void 0&&(e=!1),Q===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Q=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Q}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),a=i.style;return a.width="100px",a.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?k="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?k="negative":k="positive-ascending"),document.body.removeChild(t),k}return k}var Cs=150,_s=function(t,r){return t};function bs(e){var t,r=e.getItemOffset,i=e.getEstimatedTotalSize,a=e.getItemSize,l=e.getOffsetForIndexAndAlignment,c=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,u=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(g){Ds(y,g);function y(N){var o;return o=g.call(this,N)||this,o._instanceProps=u(o.props,te(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:te(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=R(function(d,p,h,I){return o.props.onItemsRendered({overscanStartIndex:d,overscanStopIndex:p,visibleStartIndex:h,visibleStopIndex:I})}),o._callOnScroll=void 0,o._callOnScroll=R(function(d,p,h){return o.props.onScroll({scrollDirection:d,scrollOffset:p,scrollUpdateWasRequested:h})}),o._getItemStyle=void 0,o._getItemStyle=function(d){var p=o.props,h=p.direction,I=p.itemSize,j=p.layout,x=o._getItemStyleCache(f&&I,f&&j,f&&h),A;if(x.hasOwnProperty(d))A=x[d];else{var S=r(o.props,d,o._instanceProps),D=a(o.props,d,o._instanceProps),z=h==="horizontal"||j==="horizontal",w=h==="rtl",C=z?S:0;x[d]=A={position:"absolute",left:w?void 0:C,right:w?C:void 0,top:z?0:S,height:z?"100%":D,width:z?D:"100%"}}return A},o._getItemStyleCache=void 0,o._getItemStyleCache=R(function(d,p,h){return{}}),o._onScrollHorizontal=function(d){var p=d.currentTarget,h=p.clientWidth,I=p.scrollLeft,j=p.scrollWidth;o.setState(function(x){if(x.scrollOffset===I)return null;var A=o.props.direction,S=I;if(A==="rtl")switch(ae()){case"negative":S=-I;break;case"positive-descending":S=j-h-I;break}return S=Math.max(0,Math.min(S,j-h)),{isScrolling:!0,scrollDirection:x.scrollOffset<I?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(d){var p=d.currentTarget,h=p.clientHeight,I=p.scrollHeight,j=p.scrollTop;o.setState(function(x){if(x.scrollOffset===j)return null;var A=Math.max(0,Math.min(j,I-h));return{isScrolling:!0,scrollDirection:x.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(d){var p=o.props.outerRef;o._outerRef=d,typeof p=="function"?p(d):p!=null&&typeof p=="object"&&p.hasOwnProperty("current")&&(p.current=d)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&ie(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=ws(o._resetIsScrolling,Cs)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}y.getDerivedStateFromProps=function(o,d){return Es(o,d),v(o),null};var M=y.prototype;return M.scrollTo=function(o){o=Math.max(0,o),this.setState(function(d){return d.scrollOffset===o?null:{scrollDirection:d.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},M.scrollToItem=function(o,d){d===void 0&&(d="auto");var p=this.props,h=p.itemCount,I=p.layout,j=this.state.scrollOffset;o=Math.max(0,Math.min(o,h-1));var x=0;if(this._outerRef){var A=this._outerRef;I==="vertical"?x=A.scrollWidth>A.clientWidth?re():0:x=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(l(this.props,o,d,j,this._instanceProps,x))},M.componentDidMount=function(){var o=this.props,d=o.direction,p=o.initialScrollOffset,h=o.layout;if(typeof p=="number"&&this._outerRef!=null){var I=this._outerRef;d==="horizontal"||h==="horizontal"?I.scrollLeft=p:I.scrollTop=p}this._callPropsCallbacks()},M.componentDidUpdate=function(){var o=this.props,d=o.direction,p=o.layout,h=this.state,I=h.scrollOffset,j=h.scrollUpdateWasRequested;if(j&&this._outerRef!=null){var x=this._outerRef;if(d==="horizontal"||p==="horizontal")if(d==="rtl")switch(ae()){case"negative":x.scrollLeft=-I;break;case"positive-ascending":x.scrollLeft=I;break;default:var A=x.clientWidth,S=x.scrollWidth;x.scrollLeft=S-A-I;break}else x.scrollLeft=I;else x.scrollTop=I}this._callPropsCallbacks()},M.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},M.render=function(){var o=this.props,d=o.children,p=o.className,h=o.direction,I=o.height,j=o.innerRef,x=o.innerElementType,A=o.innerTagName,S=o.itemCount,D=o.itemData,z=o.itemKey,w=z===void 0?_s:z,C=o.layout,ye=o.outerElementType,ge=o.outerTagName,xe=o.style,je=o.useIsScrolling,ve=o.width,q=this.state.isScrolling,L=h==="horizontal"||C==="horizontal",Me=L?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),Te=Y[0],Ne=Y[1],W=[];if(S>0)for(var O=Te;O<=Ne;O++)W.push(T.createElement(d,{data:D,key:w(O,D),index:O,isScrolling:je?q:void 0,style:this._getItemStyle(O)}));var F=i(this.props,this._instanceProps);return T.createElement(ye||ge||"div",{className:p,onScroll:Me,ref:this._outerRefSetter,style:U({position:"relative",height:I,width:ve,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:h},xe)},T.createElement(x||A||"div",{children:W,ref:j,style:{height:L?"100%":F,pointerEvents:q?"none":void 0,width:L?F:"100%"}}))},M._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var d=this._getRangeToRender(),p=d[0],h=d[1],I=d[2],j=d[3];this._callOnItemsRendered(p,h,I,j)}}if(typeof this.props.onScroll=="function"){var x=this.state,A=x.scrollDirection,S=x.scrollOffset,D=x.scrollUpdateWasRequested;this._callOnScroll(A,S,D)}},M._getRangeToRender=function(){var o=this.props,d=o.itemCount,p=o.overscanCount,h=this.state,I=h.isScrolling,j=h.scrollDirection,x=h.scrollOffset;if(d===0)return[0,0,0,0];var A=c(this.props,x,this._instanceProps),S=m(this.props,A,x,this._instanceProps),D=!I||j==="backward"?Math.max(1,p):1,z=!I||j==="forward"?Math.max(1,p):1;return[Math.max(0,A-D),Math.max(0,Math.min(d-1,S+z)),A,S]},y}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Es=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},Ls=bs({getItemOffset:function(t,r){var i=t.itemSize;return r*i},getItemSize:function(t,r){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var r=t.itemCount,i=t.itemSize;return i*r},getOffsetForIndexAndAlignment:function(t,r,i,a,l,c){var m=t.direction,u=t.height,f=t.itemCount,v=t.itemSize,g=t.layout,y=t.width,M=m==="horizontal"||g==="horizontal",N=M?y:u,o=Math.max(0,f*v-N),d=Math.min(o,r*v),p=Math.max(0,r*v-N+v+c);switch(i==="smart"&&(a>=p-N&&a<=d+N?i="auto":i="center"),i){case"start":return d;case"end":return p;case"center":{var h=Math.round(p+(d-p)/2);return h<Math.ceil(N/2)?0:h>o+Math.floor(N/2)?o:h}case"auto":default:return a>=p&&a<=d?a:a<p?p:d}},getStartIndexForOffset:function(t,r){var i=t.itemCount,a=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(r/a)))},getStopIndexForStartIndex:function(t,r,i){var a=t.direction,l=t.height,c=t.itemCount,m=t.itemSize,u=t.layout,f=t.width,v=a==="horizontal"||u==="horizontal",g=r*m,y=v?f:l,M=Math.ceil((y+i-g)/m);return Math.max(0,Math.min(c-1,r+M-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function $s(e){var t=e.lastRenderedStartIndex,r=e.lastRenderedStopIndex,i=e.startIndex,a=e.stopIndex;return!(i>r||a<t)}function Rs(e){for(var t=e.isItemLoaded,r=e.itemCount,i=e.minimumBatchSize,a=e.startIndex,l=e.stopIndex,c=[],m=null,u=null,f=a;f<=l;f++){var v=t(f);v?u!==null&&(c.push(m,u),m=u=null):(u=f,m===null&&(m=f))}if(u!==null){for(var g=Math.min(Math.max(u,m+i-1),r-1),y=u+1;y<=g&&!t(y);y++)u=y;c.push(m,u)}if(c.length)for(;c[1]-c[0]+1<i&&c[0]>0;){var M=c[0]-1;if(!t(M))c[0]=M;else break}return c}var Qs=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Us=function(){function e(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),Ps=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},oe=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},qs=function(e){Ps(t,e);function t(){var r,i,a,l;Qs(this,t);for(var c=arguments.length,m=Array(c),u=0;u<c;u++)m[u]=arguments[u];return l=(i=(a=oe(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(f){var v=f.visibleStartIndex,g=f.visibleStopIndex;a._lastRenderedStartIndex=v,a._lastRenderedStopIndex=g,a._ensureRowsLoaded(v,g)},a._setRef=function(f){a._listRef=f},i),oe(a,l)}return Us(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,a){var l=this.props,c=l.isItemLoaded,m=l.itemCount,u=l.minimumBatchSize,f=u===void 0?10:u,v=l.threshold,g=v===void 0?15:v,y=Rs({isItemLoaded:c,itemCount:m,minimumBatchSize:f,startIndex:Math.max(0,i-g),stopIndex:Math.min(m-1,a+g)});(this._memoizedUnloadedRanges.length!==y.length||this._memoizedUnloadedRanges.some(function(M,N){return y[N]!==M}))&&(this._memoizedUnloadedRanges=y,this._loadUnloadedRanges(y))}},{key:"_loadUnloadedRanges",value:function(i){for(var a=this,l=this.props.loadMoreItems||this.props.loadMoreRows,c=function(f){var v=i[f],g=i[f+1],y=l(v,g);y!=null&&y.then(function(){if($s({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:v,stopIndex:g})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(v,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)c(m)}}]),t}(T.PureComponent);const Ys=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Ws=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Fs=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Vs=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Bs=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Hs=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Gs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Zs=()=>n.n1,Js=n.styled_default(Zs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Ks=({rank:e,avatar:t,name:r,points:i,isCurrentUser:a,openItemDetail:l,style:c})=>s.jsxs(Ys,{onClick:l,style:c,children:[s.jsx(Ws,{children:e||0}),s.jsxs(Bs,{children:[t?s.jsx(Fs,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Vs,{children:de(r||"")}),s.jsxs(Hs,{children:[s.jsx(Gs,{children:r||""}),a&&s.jsx(Js,{name:"icon-star"})]})]}),s.jsx("div",{children:ue(i)})]}),Xs=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),en=({items:e,currentUserId:t,openItemDetail:r,fetchMore:i})=>s.jsx(n.AutoSizer,{children:({width:a,height:l})=>s.jsx(qs,{isItemLoaded:c=>c<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:c,ref:m})=>s.jsx(Xs,{children:s.jsx(Ls,{itemSize:56,onItemsRendered:c,ref:m,itemCount:e.length,width:a,height:l,children:({index:u,style:f})=>s.jsx(Ks,{style:{...f,maxHeight:48},...e[u],openItemDetail:()=>r(e[u].userId),isCurrentUser:!!t&&t===e[u].userId},e[u].userId)})})})}),tn=({deepLink:e})=>{const{data:t}=n.useStore(e.$store),r=t==null?void 0:t.url,i=e.desktopLink;return s.jsx(n.O,{inviteLink:r||i,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},sn=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(en,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(tn,{deepLink:e.deepLink})},nn=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),rn=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),an=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),on=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),ln=()=>n.n1,b=n.styled_default(ln())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),cn=()=>n.n1,dn=n.styled_default(cn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),un=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),pn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),mn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),fn={[n.PickHistoryStatus.LOST]:s.jsx(b,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(b,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(b,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(b,{name:"icon-arrow"})},hn=({questionId:e,questionType:t,questionStatus:r,subject:i,openForVoting:a,openQuestion:l,status:c})=>{const m=n.o[t],u=fn[c];return m?s.jsxs(nn,{onClick:()=>l==null?void 0:l(e),children:[s.jsxs(pn,{children:[s.jsxs(rn,{children:[s.jsx(dn,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:m.iconName}),s.jsxs(un,{children:[m.label,t===n.QuestionType.TRIVIA&&r===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(an,{children:i||""})]}),s.jsx(on,{children:a?s.jsx(mn,{children:"Play"}):u})]}):null},In=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),yn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),gn=({openInsight:e,questionId:t,...r})=>s.jsxs(In,{children:[s.jsx(Ie,{questionId:t,...r}),e&&s.jsx(yn,{onClick:()=>e(t),children:"View Insight"})]}),xn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),jn=({questions:e,openQuestion:t})=>s.jsx(xn,{children:e==null?void 0:e.map(r=>{var i,a;if(r.type==="question"&&((i=r.attributes)==null?void 0:i.attributes.case)==="question"){const l=r.attributes.attributes.value;return s.jsx(hn,{openQuestion:t,...l},l.questionId)}if(r.type==="insight"&&((a=r.attributes)==null?void 0:a.attributes.case)==="insight"){const l=r.attributes.attributes.value;return s.jsx(gn,{openInsight:t,...l},l.questionId)}return null})}),vn=({store:e,openQuestion:t})=>{const r=n.useStore(e);return r!=null&&r.data?s.jsx(jn,{openQuestion:t,questions:r.data}):s.jsx("div",{children:"wait questions..."})},Mn=({userSummary:e})=>{var t,r;const i=n.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(pe,{...i.data.summary,successRate:(r=i.data.percentage)==null?void 0:r.correct}):s.jsx("div",{children:"wait user..."})},Tn=({gamification:e})=>{const[t,r]=T.useState(E.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a,{style:{paddingBottom:"4px"},children:s.jsx(Ss,{activePage:t,toggleActivePage:r})}),t===E.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a,{style:{paddingTop:"12px"},children:s.jsx(Mn,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(vn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===E.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(sn,{gamification:e})})]})},Nn=()=>n.d$1,le=n.styled_default(Nn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),An=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Sn=({correct:e,incorrect:t})=>{const r=e+t;return r===0?0:Math.round(e/r*100)},Dn=({gamification:e,className:t})=>{const r=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[r&&s.jsx(le,{className:t,children:s.jsx(vs,{gamification:e})}),i&&s.jsx(le,{className:t,children:s.jsxs(An,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(pe,{...i,successRate:Sn(i)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(Tn,{gamification:e})})]})};exports.default=Dn;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),j=require("react"),Ae=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Se=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),De=()=>n.n1,ze=n.styled_default(De())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ke=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Oe=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),we=()=>n.n1,_e=n.styled_default(we())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:r})=>{const i=e?n.o[e]:{label:r,iconName:void 0};return s.jsxs(Ae,{children:[s.jsxs(Se,{children:[(i==null?void 0:i.iconName)&&s.jsx(ze,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(ke,{children:i.label})]}),s.jsx(Oe,{onClick:t,children:s.jsx(_e,{name:"icon-cross"})})]})},de=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ue=e=>e?e.toLocaleString("en-US"):"0",Ce=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),be=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Ee=e=>!isNaN(e.getTime()),Le=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),$e=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),V=({indicator:e,title:t})=>s.jsxs(Le,{children:[s.jsx($e,{children:t}),s.jsx(Re,{children:e})]}),Qe=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Ue=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),C=({indicator:e,title:t})=>s.jsxs(Qe,{children:[s.jsx(Ue,{children:e}),s.jsx(Pe,{children:t})]}),qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Ye=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),We=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ve=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Be=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),He=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ze=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Je=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Ke=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Xe=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),et=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),tt=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),st=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),nt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),it=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",pe=({avatar:e,name:t,points:r,friendsRank:i,rank:a,streak:l,correct:c,incorrect:m,inTop:u,successRate:f})=>s.jsxs(qe,{children:[s.jsx(Ye,{children:s.jsxs(Fe,{children:[s.jsxs(it,{children:[e&&s.jsx(Ve,{alt:"avatar",src:e}),!e&&s.jsx(nt,{children:de(t||"")})]}),s.jsxs(Be,{children:[s.jsx(He,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Je,{children:[s.jsx(Ze,{alt:"rank-icon",src:rt}),s.jsxs(Ke,{children:[ue(r),s.jsx(Xe,{children:"PTS"})]})]}),s.jsx(et,{}),s.jsxs("div",{children:["TOP ",u||0,"%"]})]})]})]})}),s.jsxs(We,{children:[s.jsxs(tt,{children:[s.jsx(V,{indicator:i||0,title:"Friends rank"}),s.jsx(V,{indicator:a||0,title:"Global rank"})]}),s.jsxs(st,{children:[s.jsx(C,{indicator:l||0,title:"Win streak"}),s.jsx(C,{indicator:c||0,title:"Correct"}),s.jsx(C,{indicator:m||0,title:"Incorrect"}),s.jsx(C,{indicator:`${f||0}%`,title:"Succ. rate"})]})]})]}),at=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),ot=()=>n.n1,lt=n.styled_default(ot())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),ct=()=>s.jsx(at,{children:s.jsx(lt,{name:"mastersLogo"})}),dt=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),ut=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),pt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),mt=({title:e,description:t})=>s.jsxs(dt,{children:[s.jsx(n.n1,{name:"icon-check-circle"}),s.jsx(ut,{children:e}),s.jsx(pt,{children:t})]}),ft=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ht=()=>n.n1,It=n.styled_default(ht())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),B=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),H=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),yt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),$=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),gt=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),xt=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:r,questionType:i,hasCorrectAnswer:a,questionStatus:l})=>{const c=r&&(i===n.QuestionType.TRIVIA||i===n.QuestionType.PREDICTION);if(!c&&l!==n.QuestionStatus.RESOLVED||l===n.QuestionStatus.RESOLVED&&i===n.QuestionType.PREDICTION&&!r)return null;const m=i===n.QuestionType.PREDICTION&&!a,u=t?"correct":"incorrect",f=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ft,{"data-isPrediction":m,children:[l===n.QuestionStatus.RESOLVED&&i===n.QuestionType.TRIVIA&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(B,{children:s.jsx(n.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx($,{children:"Question Expired"})}),s.jsx(gt,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),c&&m&&s.jsxs(s.Fragment,{children:[s.jsx(It,{name:"icon-prediction"}),s.jsx($,{children:"Stay tuned to see if your prediction was correct."})]}),c&&a&&s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-feedbackType":u,children:s.jsx(n.n1,{name:u})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(yt,{"data-feedbackType":u,children:f==null?void 0:f.title}),s.jsx($,{children:f==null?void 0:f.description})]})})]})]})},jt=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),vt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),Mt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),Tt=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),Nt=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),At=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),St=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Dt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),zt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),me=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),kt=()=>me,Ot=n.styled_default(kt())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),wt=()=>me,_t=n.styled_default(wt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ct=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),bt=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Et=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Lt=()=>n.n1,$t=n.styled_default(Lt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(Ot,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Dt,{children:s.jsx(zt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(_t,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Rt=({questionType:e,hasCorrectAnswer:t,correct:r,youVoted:i,questionVoted:a})=>{if(e===n.QuestionType.POLL&&i)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&a)return i?r?"correct":"incorrect":"unset";if(i)return"correct"}return e===n.QuestionType.TRIVIA&&a&&i?r?"correct":"incorrect":"unset"},Qt=({questionType:e,questionVoted:t,correct:r,hasCorrectAnswer:i,questionStatus:a})=>e===n.QuestionType.TRIVIA?t&&r:e===n.QuestionType.PREDICTION?t&&r&&i||a===n.QuestionStatus.RESOLVED&&r:!1,Ut=e=>{var t;const{id:r,icon:i,text:a,percentageDecimal:l,onVote:c,youSelected:m,questionVoted:u,imageMode:f,answerTimeExpired:v,questionStatus:g,isLoading:y,questionType:M,correct:N,hasCorrectAnswer:o}=e,d=Rt(e),p=Qt({questionType:M,questionVoted:u,correct:N,hasCorrectAnswer:o,questionStatus:g}),h=g===n.QuestionStatus.RESOLVED&&M===n.QuestionType.PREDICTION,I=u||h;return s.jsxs(Nt,{value:r,"data-selected":m,"data-answerState":d,disabled:u||y||v||h,"data-isNotChecked":u&&!m&&d!=="incorrect",onClick:c,children:[s.jsx(At,{"data-answerState":d,style:{width:`${I?l:0}%`}}),s.jsxs(St,{children:[i&&f&&((t=G[f])==null?void 0:t.call(G,i)),s.jsx(Ct,{children:a}),I&&s.jsxs(bt,{children:[p&&s.jsx($t,{name:"selected"}),s.jsx(Et,{children:s.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var Z=typeof window>"u"?j.useEffect:j.useLayoutEffect,Pt=({isPlaying:e,duration:t,startAt:r=0,updateInterval:i=0,onComplete:a,onUpdate:l})=>{let[c,m]=j.useState(r),u=j.useRef(0),f=j.useRef(r),v=j.useRef(r*-1e3),g=j.useRef(null),y=j.useRef(null),M=j.useRef(null),N=p=>{let h=p/1e3;if(y.current===null){y.current=h,g.current=requestAnimationFrame(N);return}let I=h-y.current,A=u.current+I;y.current=h,u.current=A;let x=f.current+(i===0?A:(A/i|0)*i),S=f.current+A,T=typeof t=="number"&&S>=t;m(T?t:x),T||(g.current=requestAnimationFrame(N))},o=()=>{g.current&&cancelAnimationFrame(g.current),M.current&&clearTimeout(M.current),y.current=null},d=j.useCallback(p=>{o(),u.current=0;let h=typeof p=="number"?p:r;f.current=h,m(h),e&&(g.current=requestAnimationFrame(N))},[e,r]);return Z(()=>{if(l==null||l(c),t&&c>=t){v.current+=t*1e3;let{shouldRepeat:p=!1,delay:h=0,newStartAt:I}=(a==null?void 0:a(v.current/1e3))||{};p&&(M.current=setTimeout(()=>d(I),h*1e3))}},[c,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),o),[e,t,i]),{elapsedTime:c,reset:d}},qt=(e,t,r)=>{let i=e/2,a=t/2,l=i-a,c=2*l,m=r==="clockwise"?"1,0":"0,1",u=2*Math.PI*l;return{path:`m ${i},${a} a ${l},${l} 0 ${m} 0,${c} a ${l},${l} 0 ${m} 0,-${c}`,pathLength:u}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Yt=e=>({position:"relative",width:e,height:e}),Wt={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},fe=(e,t,r,i,a)=>{if(i===0)return t;let l=(a?i-e:e)/i;return t+r*l},K=e=>{var t,r;return(r=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,a,l,c)=>`#${a}${a}${l}${l}${c}${c}`).substring(1).match(/.{2}/g))==null?void 0:t.map(i=>parseInt(i,16)))!=null?r:[]},Ft=(e,t)=>{var r;let{colors:i,colorsTime:a,isSmoothColorTransition:l=!0}=e;if(typeof i=="string")return i;let c=(r=a==null?void 0:a.findIndex((y,M)=>y>=t&&t>=a[M+1]))!=null?r:-1;if(!a||c===-1)return i[0];if(!l)return i[c];let m=a[c]-t,u=a[c]-a[c+1],f=K(i[c]),v=K(i[c+1]),g=!!e.isGrowing;return`rgb(${f.map((y,M)=>fe(m,y,v[M]-y,u,g)|0).join(",")})`},Vt=e=>{let{duration:t,initialRemainingTime:r,updateInterval:i,size:a=180,strokeWidth:l=12,trailStrokeWidth:c,isPlaying:m=!1,isGrowing:u=!1,rotation:f="clockwise",onComplete:v,onUpdate:g}=e,y=j.useRef(),M=Math.max(l,c??0),{path:N,pathLength:o}=qt(a,M,f),{elapsedTime:d}=Pt({isPlaying:m,duration:t,startAt:J(t,r),updateInterval:i,onUpdate:typeof g=="function"?h=>{let I=Math.ceil(t-h);I!==y.current&&(y.current=I,g(I))}:void 0,onComplete:typeof v=="function"?h=>{var I;let{shouldRepeat:A,delay:x,newInitialRemainingTime:S}=(I=v(h))!=null?I:{};if(A)return{shouldRepeat:A,delay:x,newStartAt:J(t,S)}}:void 0}),p=t-d;return{elapsedTime:d,path:N,pathLength:o,remainingTime:Math.ceil(p),rotation:f,size:a,stroke:Ft(e,p),strokeDashoffset:fe(d,0,o,t,u),strokeWidth:l}},he=e=>{let{children:t,strokeLinecap:r,trailColor:i,trailStrokeWidth:a}=e,{path:l,pathLength:c,stroke:m,strokeDashoffset:u,remainingTime:f,elapsedTime:v,size:g,strokeWidth:y}=Vt(e);return j.createElement("div",{style:Yt(g)},j.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},j.createElement("path",{d:l,fill:"none",stroke:i??"#d9d9d9",strokeWidth:a??y}),j.createElement("path",{d:l,fill:"none",stroke:m,strokeLinecap:r??"round",strokeWidth:y,strokeDasharray:c,strokeDashoffset:u})),typeof t=="function"&&j.createElement("div",{style:Wt},t({remainingTime:f,elapsedTime:v,color:m})))};he.displayName="CountdownCircleTimer";const Bt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],Ht=[10,10,1,0],Gt=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Zt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Jt=n.E.NEUTRALS_GRAY3,Kt=({isPlaying:e=!0,duration:t=30,onTimerExpired:r})=>{const[i,a]=j.useState(t>10?Zt:X),l=({remainingTime:u})=>s.jsx(Gt,{children:u}),c=j.useCallback(()=>{r==null||r(),a(Jt)},[r,a]),m=j.useCallback(u=>{u===10&&a(X)},[a]);return s.jsx(he,{isPlaying:e,duration:t,colors:Bt,colorsTime:Ht,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:c,onUpdate:m,children:l})},Xt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),es=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),ts=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),ss=()=>n.n1,ns=n.styled_default(ss())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),is=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),rs=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),as=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),os=({title:e,points:t,isPlayingTimer:r,isTimer:i,questionType:a,timerDuration:l,onTimerExpired:c})=>s.jsxs(Xt,{children:[s.jsxs(es,{children:[e&&s.jsx(ts,{children:e}),t!==void 0&&a!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(ns,{name:"icon-trophy"}),s.jsxs(is,{children:[s.jsx(rs,{children:s.jsx(n.d,{value:t})}),s.jsx(as,{children:"PTS"})]})]})]}),i&&s.jsx(Kt,{isPlaying:r,onTimerExpired:c,duration:l})]}),ls=({openedQuestion:e,isLoading:t,vote:r,close:i})=>{var a,l;const c=e.subject,m=e.type,u=(a=e.options)==null?void 0:a.options,[f,v]=j.useState(!1),[g,y]=j.useState(""),M=e==null?void 0:e.id,N=j.useCallback(async T=>{if(M){const D=T.currentTarget.value;y(D),await r(M,D)}},[M,y,r]),o=j.useCallback(()=>{v(!0),setTimeout(i,3e3)},[i]),d=j.useMemo(()=>e==null?void 0:e.answers.find(T=>T.youVoted===!0),[e]),p=j.useMemo(()=>!!(e!=null&&e.answers.find(T=>T.correct===!0)),[e]),h=j.useMemo(()=>e==null?void 0:e.answers.find(T=>T.correct===!0),[e]),I=j.useMemo(()=>e?e.answers.map(T=>{var D;return{...T,questionVoted:!!d,youSelected:g===T.id,isLoading:t,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:f,questionStatus:e.status,imageMode:(D=e.appearance)==null?void 0:D.images,onVote:N}}):[],[p,f,t,e,d,N,g]),A=u&&(u.case==="trivia"||u.case==="prediction")?u.value:void 0,x=j.useMemo(()=>{if(e.status===n.QuestionStatus.RESOLVED)return 0;if(!f)return d?d.correct?d.points:0:h==null?void 0:h.points},[f,d,h,e.status]),S=j.useMemo(()=>f?"Time expired":e.type===n.QuestionType.POLL?"Time remaining":d?"You won":"To win",[f,e.type,d]);return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(jt,{children:s.jsxs(vt,{children:[A&&s.jsx(xt,{feedbackMessages:A,questionVoted:!!d,questionVotedCorrectly:d==null?void 0:d.correct,questionType:m,hasCorrectAnswer:p,questionStatus:e.status}),e.type!==n.QuestionType.PREDICTION&&s.jsx(os,{title:S,points:x,onTimerExpired:o,questionType:e.type,isTimer:!t,isPlayingTimer:!d,timerDuration:d?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),f?s.jsx(mt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(Mt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:c}),s.jsx(Tt,{children:I.map(T=>s.jsx(Ut,{...T},T.id))})]})]})})})},cs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ds=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),us=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ps=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),ms=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),fs=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),Ie=({created:e,image:t,title:r,instantView:i})=>{const a=j.useMemo(()=>{if(e){const c=new Date(e);if(Ee(c))return{date:Ce(c),time:be(c)}}return null},[e]),l=(i==null?void 0:i.image)||t;return s.jsxs(cs,{children:[a&&s.jsxs(ms,{children:[a.date," · ",a.time]}),(i==null?void 0:i.video)&&s.jsx(n.w,{source:i.video.url,poster:i.video.thumbnailUrl}),l&&s.jsx(fs,{src:l}),s.jsxs(ds,{children:[s.jsx(us,{children:(i==null?void 0:i.heading)||r}),s.jsx(ps,{children:i==null?void 0:i.body})]})]})},hs=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Is=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ys=({instantView:e,...t})=>s.jsxs(hs,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(Is,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.n1,{name:"icon-external-link"})]})]}),gs=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),xs=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ys,{created:e.attributes.created,...e.attributes.attributes.value}):null},js=({extendedQuestion:e,vote:t,close:r})=>{const{loading:i,data:a}=e;return a?s.jsx(ls,{vote:t,close:r,openedQuestion:a,isLoading:!!i}):null},vs=({gamification:e})=>{var t;const r=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedQuestion.$extendedStore);if(!r)return null;const a=r.type;return s.jsxs(gs,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=r.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(js,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),a!=="question"&&s.jsx(xs,{openedQuestion:r}),s.jsx(ct,{sponsorLogo:""})]})},Ms=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Ts=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),Ns=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),As=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var E=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(E||{});const ee=({title:e,active:t,onClick:r})=>s.jsx(Ns,{onClick:r,"data-selected":t,children:s.jsx(As,{children:e})}),Ss=({activePage:e="home",toggleActivePage:t})=>s.jsx(Ms,{children:s.jsxs(Ts,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,a){return i.__proto__=a,i},P(e,t)}function Ds(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,P(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function zs(e,t){return!!(e===t||se(e)&&se(t))}function ks(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!zs(e[r],t[r]))return!1;return!0}function R(e,t){t===void 0&&(t=ks);var r,i=[],a,l=!1;function c(){for(var m=[],u=0;u<arguments.length;u++)m[u]=arguments[u];return l&&r===this&&t(m,i)||(a=e.apply(this,m),l=!0,r=this,i=m),a}return c}var Os=typeof performance=="object"&&typeof performance.now=="function",ne=Os?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function ws(e,t){var r=ne();function i(){ne()-r>=t?e.call(null):a.id=requestAnimationFrame(i)}var a={id:requestAnimationFrame(i)};return a}var Q=-1;function re(e){if(e===void 0&&(e=!1),Q===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Q=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Q}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),a=i.style;return a.width="100px",a.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?k="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?k="negative":k="positive-ascending"),document.body.removeChild(t),k}return k}var _s=150,Cs=function(t,r){return t};function bs(e){var t,r=e.getItemOffset,i=e.getEstimatedTotalSize,a=e.getItemSize,l=e.getOffsetForIndexAndAlignment,c=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,u=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(g){Ds(y,g);function y(N){var o;return o=g.call(this,N)||this,o._instanceProps=u(o.props,te(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:te(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=R(function(d,p,h,I){return o.props.onItemsRendered({overscanStartIndex:d,overscanStopIndex:p,visibleStartIndex:h,visibleStopIndex:I})}),o._callOnScroll=void 0,o._callOnScroll=R(function(d,p,h){return o.props.onScroll({scrollDirection:d,scrollOffset:p,scrollUpdateWasRequested:h})}),o._getItemStyle=void 0,o._getItemStyle=function(d){var p=o.props,h=p.direction,I=p.itemSize,A=p.layout,x=o._getItemStyleCache(f&&I,f&&A,f&&h),S;if(x.hasOwnProperty(d))S=x[d];else{var T=r(o.props,d,o._instanceProps),D=a(o.props,d,o._instanceProps),z=h==="horizontal"||A==="horizontal",w=h==="rtl",_=z?T:0;x[d]=S={position:"absolute",left:w?void 0:_,right:w?_:void 0,top:z?0:T,height:z?"100%":D,width:z?D:"100%"}}return S},o._getItemStyleCache=void 0,o._getItemStyleCache=R(function(d,p,h){return{}}),o._onScrollHorizontal=function(d){var p=d.currentTarget,h=p.clientWidth,I=p.scrollLeft,A=p.scrollWidth;o.setState(function(x){if(x.scrollOffset===I)return null;var S=o.props.direction,T=I;if(S==="rtl")switch(ae()){case"negative":T=-I;break;case"positive-descending":T=A-h-I;break}return T=Math.max(0,Math.min(T,A-h)),{isScrolling:!0,scrollDirection:x.scrollOffset<I?"forward":"backward",scrollOffset:T,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(d){var p=d.currentTarget,h=p.clientHeight,I=p.scrollHeight,A=p.scrollTop;o.setState(function(x){if(x.scrollOffset===A)return null;var S=Math.max(0,Math.min(A,I-h));return{isScrolling:!0,scrollDirection:x.scrollOffset<S?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(d){var p=o.props.outerRef;o._outerRef=d,typeof p=="function"?p(d):p!=null&&typeof p=="object"&&p.hasOwnProperty("current")&&(p.current=d)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&ie(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=ws(o._resetIsScrolling,_s)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}y.getDerivedStateFromProps=function(o,d){return Es(o,d),v(o),null};var M=y.prototype;return M.scrollTo=function(o){o=Math.max(0,o),this.setState(function(d){return d.scrollOffset===o?null:{scrollDirection:d.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},M.scrollToItem=function(o,d){d===void 0&&(d="auto");var p=this.props,h=p.itemCount,I=p.layout,A=this.state.scrollOffset;o=Math.max(0,Math.min(o,h-1));var x=0;if(this._outerRef){var S=this._outerRef;I==="vertical"?x=S.scrollWidth>S.clientWidth?re():0:x=S.scrollHeight>S.clientHeight?re():0}this.scrollTo(l(this.props,o,d,A,this._instanceProps,x))},M.componentDidMount=function(){var o=this.props,d=o.direction,p=o.initialScrollOffset,h=o.layout;if(typeof p=="number"&&this._outerRef!=null){var I=this._outerRef;d==="horizontal"||h==="horizontal"?I.scrollLeft=p:I.scrollTop=p}this._callPropsCallbacks()},M.componentDidUpdate=function(){var o=this.props,d=o.direction,p=o.layout,h=this.state,I=h.scrollOffset,A=h.scrollUpdateWasRequested;if(A&&this._outerRef!=null){var x=this._outerRef;if(d==="horizontal"||p==="horizontal")if(d==="rtl")switch(ae()){case"negative":x.scrollLeft=-I;break;case"positive-ascending":x.scrollLeft=I;break;default:var S=x.clientWidth,T=x.scrollWidth;x.scrollLeft=T-S-I;break}else x.scrollLeft=I;else x.scrollTop=I}this._callPropsCallbacks()},M.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},M.render=function(){var o=this.props,d=o.children,p=o.className,h=o.direction,I=o.height,A=o.innerRef,x=o.innerElementType,S=o.innerTagName,T=o.itemCount,D=o.itemData,z=o.itemKey,w=z===void 0?Cs:z,_=o.layout,ye=o.outerElementType,ge=o.outerTagName,xe=o.style,je=o.useIsScrolling,ve=o.width,q=this.state.isScrolling,L=h==="horizontal"||_==="horizontal",Me=L?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),Te=Y[0],Ne=Y[1],W=[];if(T>0)for(var O=Te;O<=Ne;O++)W.push(j.createElement(d,{data:D,key:w(O,D),index:O,isScrolling:je?q:void 0,style:this._getItemStyle(O)}));var F=i(this.props,this._instanceProps);return j.createElement(ye||ge||"div",{className:p,onScroll:Me,ref:this._outerRefSetter,style:U({position:"relative",height:I,width:ve,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:h},xe)},j.createElement(x||S||"div",{children:W,ref:A,style:{height:L?"100%":F,pointerEvents:q?"none":void 0,width:L?F:"100%"}}))},M._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var d=this._getRangeToRender(),p=d[0],h=d[1],I=d[2],A=d[3];this._callOnItemsRendered(p,h,I,A)}}if(typeof this.props.onScroll=="function"){var x=this.state,S=x.scrollDirection,T=x.scrollOffset,D=x.scrollUpdateWasRequested;this._callOnScroll(S,T,D)}},M._getRangeToRender=function(){var o=this.props,d=o.itemCount,p=o.overscanCount,h=this.state,I=h.isScrolling,A=h.scrollDirection,x=h.scrollOffset;if(d===0)return[0,0,0,0];var S=c(this.props,x,this._instanceProps),T=m(this.props,S,x,this._instanceProps),D=!I||A==="backward"?Math.max(1,p):1,z=!I||A==="forward"?Math.max(1,p):1;return[Math.max(0,S-D),Math.max(0,Math.min(d-1,T+z)),S,T]},y}(j.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Es=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},Ls=bs({getItemOffset:function(t,r){var i=t.itemSize;return r*i},getItemSize:function(t,r){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var r=t.itemCount,i=t.itemSize;return i*r},getOffsetForIndexAndAlignment:function(t,r,i,a,l,c){var m=t.direction,u=t.height,f=t.itemCount,v=t.itemSize,g=t.layout,y=t.width,M=m==="horizontal"||g==="horizontal",N=M?y:u,o=Math.max(0,f*v-N),d=Math.min(o,r*v),p=Math.max(0,r*v-N+v+c);switch(i==="smart"&&(a>=p-N&&a<=d+N?i="auto":i="center"),i){case"start":return d;case"end":return p;case"center":{var h=Math.round(p+(d-p)/2);return h<Math.ceil(N/2)?0:h>o+Math.floor(N/2)?o:h}case"auto":default:return a>=p&&a<=d?a:a<p?p:d}},getStartIndexForOffset:function(t,r){var i=t.itemCount,a=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(r/a)))},getStopIndexForStartIndex:function(t,r,i){var a=t.direction,l=t.height,c=t.itemCount,m=t.itemSize,u=t.layout,f=t.width,v=a==="horizontal"||u==="horizontal",g=r*m,y=v?f:l,M=Math.ceil((y+i-g)/m);return Math.max(0,Math.min(c-1,r+M-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function $s(e){var t=e.lastRenderedStartIndex,r=e.lastRenderedStopIndex,i=e.startIndex,a=e.stopIndex;return!(i>r||a<t)}function Rs(e){for(var t=e.isItemLoaded,r=e.itemCount,i=e.minimumBatchSize,a=e.startIndex,l=e.stopIndex,c=[],m=null,u=null,f=a;f<=l;f++){var v=t(f);v?u!==null&&(c.push(m,u),m=u=null):(u=f,m===null&&(m=f))}if(u!==null){for(var g=Math.min(Math.max(u,m+i-1),r-1),y=u+1;y<=g&&!t(y);y++)u=y;c.push(m,u)}if(c.length)for(;c[1]-c[0]+1<i&&c[0]>0;){var M=c[0]-1;if(!t(M))c[0]=M;else break}return c}var Qs=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Us=function(){function e(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),Ps=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},oe=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},qs=function(e){Ps(t,e);function t(){var r,i,a,l;Qs(this,t);for(var c=arguments.length,m=Array(c),u=0;u<c;u++)m[u]=arguments[u];return l=(i=(a=oe(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(f){var v=f.visibleStartIndex,g=f.visibleStopIndex;a._lastRenderedStartIndex=v,a._lastRenderedStopIndex=g,a._ensureRowsLoaded(v,g)},a._setRef=function(f){a._listRef=f},i),oe(a,l)}return Us(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,a){var l=this.props,c=l.isItemLoaded,m=l.itemCount,u=l.minimumBatchSize,f=u===void 0?10:u,v=l.threshold,g=v===void 0?15:v,y=Rs({isItemLoaded:c,itemCount:m,minimumBatchSize:f,startIndex:Math.max(0,i-g),stopIndex:Math.min(m-1,a+g)});(this._memoizedUnloadedRanges.length!==y.length||this._memoizedUnloadedRanges.some(function(M,N){return y[N]!==M}))&&(this._memoizedUnloadedRanges=y,this._loadUnloadedRanges(y))}},{key:"_loadUnloadedRanges",value:function(i){for(var a=this,l=this.props.loadMoreItems||this.props.loadMoreRows,c=function(f){var v=i[f],g=i[f+1],y=l(v,g);y!=null&&y.then(function(){if($s({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:v,stopIndex:g})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(v,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)c(m)}}]),t}(j.PureComponent);const Ys=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Ws=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Fs=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Vs=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Bs=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Hs=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Gs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Zs=()=>n.n1,Js=n.styled_default(Zs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Ks=({rank:e,avatar:t,name:r,points:i,isCurrentUser:a,openItemDetail:l,style:c})=>s.jsxs(Ys,{onClick:l,style:c,children:[s.jsx(Ws,{children:e||0}),s.jsxs(Bs,{children:[t?s.jsx(Fs,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Vs,{children:de(r||"")}),s.jsxs(Hs,{children:[s.jsx(Gs,{children:r||""}),a&&s.jsx(Js,{name:"icon-star"})]})]}),s.jsx("div",{children:ue(i)})]}),Xs=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),en=({items:e,currentUserId:t,openItemDetail:r,fetchMore:i})=>s.jsx(n.AutoSizer,{children:({width:a,height:l})=>s.jsx(qs,{isItemLoaded:c=>c<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:c,ref:m})=>s.jsx(Xs,{children:s.jsx(Ls,{itemSize:56,onItemsRendered:c,ref:m,itemCount:e.length,width:a,height:l,children:({index:u,style:f})=>s.jsx(Ks,{style:{...f,maxHeight:48},...e[u],openItemDetail:()=>r(e[u].userId),isCurrentUser:!!t&&t===e[u].userId},e[u].userId)})})})}),tn=({deepLink:e})=>{const{data:t}=n.useStore(e.$store),r=t==null?void 0:t.url,i=e.desktopLink;return s.jsx(n.O,{inviteLink:r||i,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},sn=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(en,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(tn,{deepLink:e.deepLink})},nn=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),rn=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),an=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),on=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),ln=()=>n.n1,b=n.styled_default(ln())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),cn=()=>n.n1,dn=n.styled_default(cn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),un=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),pn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),mn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),fn={[n.PickHistoryStatus.LOST]:s.jsx(b,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(b,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(b,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(b,{name:"icon-arrow"})},hn=({questionId:e,questionType:t,questionStatus:r,subject:i,openForVoting:a,openQuestion:l,status:c})=>{const m=n.o[t],u=fn[c];return m?s.jsxs(nn,{onClick:()=>l==null?void 0:l(e),children:[s.jsxs(pn,{children:[s.jsxs(rn,{children:[s.jsx(dn,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:m.iconName}),s.jsxs(un,{children:[m.label,t===n.QuestionType.TRIVIA&&r===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(an,{children:i||""})]}),s.jsx(on,{children:a?s.jsx(mn,{children:"Play"}):u})]}):null},In=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),yn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),gn=({openInsight:e,questionId:t,...r})=>s.jsxs(In,{children:[s.jsx(Ie,{questionId:t,...r}),e&&s.jsx(yn,{onClick:()=>e(t),children:"View Insight"})]}),xn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),jn=({questions:e,openQuestion:t})=>s.jsx(xn,{children:e==null?void 0:e.map(r=>{var i,a;if(r.type==="question"&&((i=r.attributes)==null?void 0:i.attributes.case)==="question"){const l=r.attributes.attributes.value;return s.jsx(hn,{openQuestion:t,...l},l.questionId)}if(r.type==="insight"&&((a=r.attributes)==null?void 0:a.attributes.case)==="insight"){const l=r.attributes.attributes.value;return s.jsx(gn,{openInsight:t,...l},l.questionId)}return null})}),vn=({store:e,openQuestion:t})=>{const r=n.useStore(e);return r!=null&&r.data?s.jsx(jn,{openQuestion:t,questions:r.data}):s.jsx("div",{children:"wait questions..."})},Mn=({userSummary:e})=>{var t,r;const i=n.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(pe,{...i.data.summary,successRate:(r=i.data.percentage)==null?void 0:r.correct}):s.jsx("div",{children:"wait user..."})},Tn=({gamification:e})=>{const[t,r]=j.useState(E.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a,{style:{paddingBottom:"4px"},children:s.jsx(Ss,{activePage:t,toggleActivePage:r})}),t===E.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a,{style:{paddingTop:"12px"},children:s.jsx(Mn,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(vn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===E.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(sn,{gamification:e})})]})},Nn=()=>n.d$1,le=n.styled_default(Nn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),An=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Sn=({correct:e,incorrect:t})=>{const r=e+t;return r===0?0:Math.round(e/r*100)},Dn=({gamification:e,className:t})=>{const r=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[r&&s.jsx(le,{className:t,children:s.jsx(vs,{gamification:e})}),i&&s.jsx(le,{className:t,children:s.jsxs(An,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(pe,{...i,successRate:Sn(i)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(Tn,{gamification:e})})]})};exports.default=Dn;
|