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