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