@streamlayer/react 0.34.3 → 0.34.5
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/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/masters.js +1 -1
- package/lib/dist/es/gamification-feature.js +497 -463
- package/lib/dist/es/masters.js +1 -1
- package/lib/dist/style.css +1 -1
- package/lib/es/gamification-feature.js +496 -462
- package/lib/style.css +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./index4.js"),Q=require("@nanostores/react"),M=require("./masters2.js"),c=require("@streamlayer/sdk-web-types"),I=require("react"),B=require("./index3.js");require("react-countup");const xe=require("react-countdown-circle-timer"),E=require("./index2.js"),je=require("react-infinite-scroller");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("lodash.throttle");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const me=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),ye=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Me=()=>n.c1,he=n.styled_default(Me())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),fe=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ne=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Te=()=>n.c1,Ae=n.styled_default(Te())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ne=({type:s,close:t,label:i})=>{const o=s?M.o[s]:{label:i,iconName:void 0};return e.jsxs(me,{children:[e.jsxs(ye,{children:[(o==null?void 0:o.iconName)&&e.jsx(he,{"data-type-trivia":s===c.QuestionType.TRIVIA,"data-type-poll":s===c.QuestionType.POLL,name:o.iconName}),(o==null?void 0:o.label)&&e.jsx(fe,{children:o.label})]}),e.jsx(Ne,{onClick:t,children:e.jsx(Ae,{name:"icon-cross"})})]})},ie=s=>s.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ae=s=>s?s.toLocaleString("en-US"):"0",W=s=>s.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),F=s=>s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),H=s=>!isNaN(s.getTime()),ge=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),De=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),ve=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),J=({indicator:s,title:t})=>e.jsxs(ge,{children:[e.jsx(De,{children:t}),e.jsx(ve,{children:s})]}),Se=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),ke=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),ze=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),R=({indicator:s,title:t})=>e.jsxs(Se,{children:[e.jsx(ke,{children:s}),e.jsx(ze,{children:t})]}),Ee=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Qe=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ce=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),be=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Oe=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Le=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),we=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),_e=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),$e=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Re=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),qe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ue=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ye=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ve=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Be=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),We=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Fe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43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k1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",oe=({avatar:s,name:t,points:i,friendsRank:o,rank:a,streak:u,correct:r,incorrect:l,inTop:d,successRate:p})=>e.jsxs(Ee,{children:[e.jsx(Qe,{children:e.jsxs(be,{children:[e.jsxs(We,{children:[s&&e.jsx(Oe,{alt:"avatar",src:s}),!s&&e.jsx(Be,{children:ie(t||"")})]}),e.jsxs(Le,{children:[e.jsx(we,{children:t}),e.jsxs(_e,{children:[e.jsxs(Re,{children:[e.jsx($e,{alt:"rank-icon",src:Fe}),e.jsxs(qe,{children:[ae(i),e.jsx(Ue,{children:"PTS"})]})]}),e.jsx(Ye,{}),e.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(J,{indicator:o||0,title:"Friends rank"}),e.jsx(J,{indicator:a||0,title:"Global rank"})]}),e.jsxs(Ve,{children:[e.jsx(R,{indicator:u||0,title:"Win streak"}),e.jsx(R,{indicator:r||0,title:"Correct"}),e.jsx(R,{indicator:l||0,title:"Incorrect"}),e.jsx(R,{indicator:`${p||0}%`,title:"Succ. rate"})]})]})]}),He=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),Ge=()=>n.c1,Ze=n.styled_default(Ge())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),Je=()=>e.jsx(He,{children:e.jsx(Ze,{name:"mastersLogo"})}),Ke=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),Xe=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),es=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ss=({title:s,description:t})=>e.jsxs(Ke,{children:[e.jsx(n.c1,{name:"icon-check-circle"}),e.jsx(Xe,{children:s}),e.jsx(es,{children:t})]}),ts=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ns=()=>n.c1,is=n.styled_default(ns())({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}),as=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),L=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),V=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),os=({feedbackMessages:s,questionVotedCorrectly:t,questionVoted:i,questionType:o,hasCorrectAnswer:a,questionStatus:u,showExpiredNotification:r,showClosedNotificationTrivia:l,votedInCurrentRender:d,votedAfterQuestionClosed:p,enteredAnActiveQuestion:x,marketClosed:j})=>{const y=i&&(o===c.QuestionType.TRIVIA||o===c.QuestionType.PREDICTION)&&d&&u!==c.QuestionStatus.RESOLVED,h=o===c.QuestionType.PREDICTION&&!a,S=j&&o===c.QuestionType.PREDICTION&&!i&&!x||o===c.QuestionType.PREDICTION&&p&&d&&x,T=y&&h,k=y&&a,A=o===c.QuestionType.PREDICTION&&i&&d&&a,C=i&&o===c.QuestionType.POLL&&d;if(!r&&!l&&!T&&!k&&!S&&!C&&!A)return null;const v=t?"correct":"incorrect",D=t?s==null?void 0:s.correctFeedback:s==null?void 0:s.incorrectFeedback;return e.jsxs(ts,{"data-isPrediction":h,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(n.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(q,{children:e.jsx(L,{children:"Question Expired"})}),e.jsx(V,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(n.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(q,{children:e.jsx(L,{children:"Question Closed"})}),e.jsx(V,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),S&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(n.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(q,{children:e.jsx(L,{children:"Question Closed"})}),e.jsx(V,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),T&&e.jsxs(e.Fragment,{children:[e.jsx(is,{name:"icon-prediction"}),e.jsx(L,{children:"Stay tuned to see if your prediction was correct."})]}),C&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-feedbackType":"correct",children:e.jsx(n.c1,{name:"correct"})}),e.jsx(L,{children:"That's for answering. Please stay tuned for the next question."})]}),(k||A)&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-feedbackType":v,children:e.jsx(n.c1,{name:v})}),e.jsx("div",{children:e.jsxs(q,{children:[e.jsx(as,{"data-feedbackType":v,children:D==null?void 0:D.title}),e.jsx(L,{children:D==null?void 0:D.description})]})})]})]})},rs=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),ls=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),ds=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),cs=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),us=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),ps=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Is=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),xs=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),js=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),re=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),ms=()=>re,ys=n.styled_default(ms())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Ms=()=>re,hs=n.styled_default(Ms())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),fs=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ns=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Ts=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),As=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),gs=()=>n.c1,Ds=n.styled_default(gs())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),K={[c.QuestionImages.CENTERED]:s=>e.jsx(ys,{alt:"option-icon",src:s}),[c.QuestionImages.TRANSPARENT]:s=>e.jsx(xs,{children:e.jsx(js,{style:{backgroundImage:`url(${s})`}})}),[c.QuestionImages.ROUNDED]:s=>e.jsx(hs,{alt:"option-icon",src:s}),[c.QuestionImages.NONE]:()=>null,[c.QuestionImages.UNSET]:()=>null},vs=({questionType:s,hasCorrectAnswer:t,correct:i,youVoted:o,questionVoted:a})=>{if(s===c.QuestionType.POLL&&o)return"correct";if(s===c.QuestionType.PREDICTION){if(t&&a)return o?i?"correct":"incorrect":"unset";if(o)return"correct"}return s===c.QuestionType.TRIVIA&&a&&o?i?"correct":"incorrect":"unset"},Ss=({questionType:s,questionVoted:t,correct:i,hasCorrectAnswer:o,questionStatus:a})=>s===c.QuestionType.TRIVIA?t&&i:s===c.QuestionType.PREDICTION?t&&i&&o||a===c.QuestionStatus.RESOLVED&&i:!1,ks=s=>{var t;const{id:i,icon:o,text:a,percentageDecimal:u,points:r,onVote:l,markThatVoted:d,youSelected:p,questionVoted:x,imageMode:j,answerTimeExpired:y,questionStatus:h,isLoading:S,questionType:T,correct:k,hasCorrectAnswer:A,votedAfterQuestionClosed:C,enteredAnActiveQuestion:v,marketClosed:D}=s,z=vs(s),P=Ss({questionType:T,questionVoted:x,correct:k,hasCorrectAnswer:A,questionStatus:h}),b=D&&T===c.QuestionType.PREDICTION,$=x||b,m=T===c.QuestionType.PREDICTION&&!x&&h!==c.QuestionStatus.RESOLVED;return e.jsxs(us,{value:i,"data-selected":p,"data-answer-state":z,disabled:x||S||y||b&&!v||b&&v&&C,"data-is-not-checked":x&&!p&&z!=="incorrect",onClick:N=>{d(T===c.QuestionType.PREDICTION?D:h===c.QuestionStatus.RESOLVED),l(N)},children:[e.jsx(ps,{"data-answer-state":z,style:{width:`${$?u:0}%`}}),e.jsxs(Is,{children:[o&&j&&((t=K[j])==null?void 0:t.call(K,o)),e.jsx(fs,{children:a}),m&&e.jsxs("div",{children:[e.jsx(B.d,{value:r}),e.jsx(Ts,{children:"pts"})]}),$&&e.jsxs(Ns,{children:[P&&e.jsx(Ds,{name:"selected"}),e.jsx(As,{children:e.jsx(B.d,{value:u,suffix:"%"})})]})]})]})},zs=[E.E.PRIMARY_GREEN1,E.E.SECONDARY_RED1,E.E.SECONDARY_RED1,E.E.NEUTRALS_GRAY3],Es=[10,10,1,0],Qs=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Cs=E.E.SECONDARY_GREEN6,X=E.E.SECONDARY_RED3,bs=E.E.NEUTRALS_GRAY3,Os=({isPlaying:s=!0,duration:t=30,onTimerExpired:i})=>{const[o,a]=I.useState(t>10?Cs:X),u=({remainingTime:d})=>e.jsx(Qs,{children:d}),r=I.useCallback(()=>{i==null||i(),a(bs)},[i,a]),l=I.useCallback(d=>{d===10&&a(X)},[a]);return e.jsx(xe.CountdownCircleTimer,{isPlaying:s,duration:t,colors:zs,colorsTime:Es,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:o,onComplete:r,onUpdate:l,children:u})},Ls=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),ws=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),_s=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),$s=()=>n.c1,Rs=n.styled_default($s())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),qs=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Us=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Ys=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Ps=({title:s,points:t,isPlayingTimer:i,isTimer:o,questionType:a,timerDuration:u,onTimerExpired:r})=>e.jsxs(Ls,{style:{justifyContent:a===c.QuestionType.PREDICTION?"center":"space-between"},children:[e.jsxs(ws,{children:[s&&e.jsx(_s,{children:s}),t!==void 0&&a!==c.QuestionType.POLL&&e.jsxs(e.Fragment,{children:[e.jsx(Rs,{name:"icon-trophy"}),e.jsxs(qs,{children:[e.jsx(Us,{children:e.jsx(B.d,{value:t})}),e.jsx(Ys,{children:"PTS"})]})]})]}),o&&a!==c.QuestionType.PREDICTION&&e.jsx(Os,{isPlaying:i,onTimerExpired:r,duration:u})]}),Vs=({openedQuestion:s,isLoading:t,vote:i,close:o})=>{var a,u;const r=s.subject,l=s.type,d=s.status,p=(a=s.options)==null?void 0:a.options,x=s.marketClosed,[j,y]=I.useState(!1),[h,S]=I.useState(!1),[T,k]=I.useState(!0),[A,C]=I.useState(!1),[v,D]=I.useState(""),z=s==null?void 0:s.id;I.useEffect(()=>{l===c.QuestionType.PREDICTION?x&&k(!1):d===c.QuestionStatus.RESOLVED&&k(!1)},[]);const P=I.useCallback(f=>{S(f),y(!0)},[]),b=I.useCallback(async f=>{if(z){const w=f.currentTarget.value;D(w),await i(z,w)}},[z,D,i]),$=I.useCallback(()=>{C(!0),setTimeout(o,3e3)},[o]),m=I.useMemo(()=>s==null?void 0:s.answers.find(f=>f.youVoted===!0),[s]),N=I.useMemo(()=>!!(s!=null&&s.answers.find(f=>f.correct===!0)),[s]),g=I.useMemo(()=>s==null?void 0:s.answers.find(f=>f.correct===!0),[s]),de=I.useMemo(()=>s?s.answers.map(f=>{var w;return{...f,questionVoted:!!m,youSelected:v===f.id,isLoading:t,hasCorrectAnswer:N,questionType:s.type,answerTimeExpired:A,questionStatus:d,imageMode:(w=s.appearance)==null?void 0:w.images,onVote:b}}):[],[N,A,t,s,m,d,b,v]),ce=p&&(p.case==="trivia"||p.case==="prediction")?p.value:void 0,O=d===c.QuestionStatus.RESOLVED&&l===c.QuestionType.TRIVIA&&!m&&!T,G=l===c.QuestionType.TRIVIA&&h&&j&&T,Z=I.useMemo(()=>l===c.QuestionType.PREDICTION?!!(m&&!N||m&&N&&g!=null&&g.youVoted):!0,[l,m,N,g]),ue=I.useMemo(()=>{if(l===c.QuestionType.PREDICTION&&m&&(!N||N&&g!=null&&g.youVoted))return m.points;if(!(O||A))return d===c.QuestionStatus.RESOLVED?0:m?m.correct?m.points:0:g==null?void 0:g.points},[A,m,g,d,O,l,N]),pe=I.useMemo(()=>l===c.QuestionType.PREDICTION&&m?N?N&&g!=null&&g.youVoted?"You won":"":"To win":O||A?"Time expired":l===c.QuestionType.POLL?"Time remaining":m?"You won":"To win",[A,l,m,O,N,g]),Ie=m||O||G||l===c.QuestionType.TRIVIA&&d===c.QuestionStatus.RESOLVED&&T;return e.jsx(M.r,{"data-question-header":"true",children:e.jsx(rs,{children:e.jsxs(ls,{children:[e.jsx(os,{feedbackMessages:ce,questionVoted:!!m,questionVotedCorrectly:m==null?void 0:m.correct,questionType:l,hasCorrectAnswer:N,questionStatus:d,showExpiredNotification:O,showClosedNotificationTrivia:G,votedInCurrentRender:j,votedAfterQuestionClosed:h,enteredAnActiveQuestion:T,marketClosed:x}),Z&&e.jsx(Ps,{title:pe,points:ue,onTimerExpired:$,questionType:s.type,isTimer:!t,isPlayingTimer:!m,timerDuration:Ie?0:Number(((u=s==null?void 0:s.appearance)==null?void 0:u.autoHideInterval)||"30")}),A?e.jsx(ss,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{style:Z?{}:{marginTop:0},children:r}),e.jsx(cs,{children:de.map(f=>e.jsx(ks,{...f,markThatVoted:P,votedAfterQuestionClosed:h,enteredAnActiveQuestion:T,marketClosed:x},f.id))})]})]})})})},Bs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),Ws=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),Fs=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),Gs=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),Zs=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),le=({created:s,image:t,title:i,isPickHistory:o,instantView:a,notification:u})=>{const r=I.useMemo(()=>{if(s){const d=new Date(s);if(H(d))return{date:W(d),time:F(d)}}return null},[s]),l=(a==null?void 0:a.image)||t;return e.jsxs(Bs,{children:[r&&e.jsxs(Gs,{children:[r.date," · ",r.time]}),(a==null?void 0:a.video)&&e.jsx(M.w,{source:a.video.url,poster:a.video.thumbnailUrl}),l&&!(a!=null&&a.video)&&e.jsx(Zs,{src:l}),e.jsxs(Ws,{children:[e.jsx(Fs,{children:o?i:a==null?void 0:a.heading}),e.jsx(Hs,{children:o?u==null?void 0:u.body:a==null?void 0:a.body})]})]})},Js=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Ks=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),Xs=({instantView:s,...t})=>e.jsxs(Js,{children:[e.jsx(le,{instantView:s,...t}),(s==null?void 0:s.webLink)&&e.jsxs(Ks,{href:s==null?void 0:s.webLink.url,target:"_blank",children:[s==null?void 0:s.webLink.label,e.jsx(n.c1,{name:"icon-external-link"})]})]}),et=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),st=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),tt=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),nt=({created:s,...t})=>{const i=I.useMemo(()=>{if(s){const o=new Date(s);if(H(o))return{date:W(o),time:F(o)}}return null},[s]);return e.jsxs(et,{children:[i&&e.jsxs(st,{children:[i.date," · ",i.time]}),t.title&&e.jsx(tt,{children:t.title}),e.jsx(M.u,{...t})]})},it=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),at=({openedQuestion:s})=>{var t,i;return((t=s==null?void 0:s.attributes)==null?void 0:t.attributes.case)==="insight"?e.jsx(Xs,{created:s.attributes.created,...s.attributes.attributes.value}):((i=s==null?void 0:s.attributes)==null?void 0:i.attributes.case)==="tweet"?e.jsx(nt,{created:s.attributes.created,...s.attributes.attributes.value}):null},ot=({extendedQuestion:s,vote:t,close:i})=>{const{loading:o,data:a}=s;return a?e.jsx(Vs,{vote:t,close:i,openedQuestion:a,isLoading:!!o}):null},rt=({gamification:s})=>{var t;const i=Q.useStore(s.openedQuestion.$store),o=Q.useStore(s.openedQuestion.$extendedStore);if(!i)return null;const a=i.type;return e.jsxs(it,{children:[e.jsx(ne,{close:s.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||c.QuestionType.UNSET}),a==="question"&&e.jsx(ot,{vote:s.submitAnswer,close:s.closeQuestion,extendedQuestion:o}),a!=="question"&&e.jsx(at,{openedQuestion:i}),e.jsx(Je,{sponsorLogo:""})]})},lt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),dt=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),ct=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),ut=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var Y=(s=>(s.HOME="home",s.LEADERBOARD="leaderboard",s))(Y||{});const ee=({title:s,active:t,onClick:i})=>e.jsx(ct,{onClick:i,"data-selected":t,children:e.jsx(ut,{children:s})}),pt=({activePage:s="home",toggleActivePage:t})=>e.jsx(lt,{children:e.jsxs(dt,{"data-position":s==="home"?"left":"right",children:[e.jsx(ee,{title:"Home",active:s==="home",onClick:()=>t("home")}),e.jsx(ee,{title:"Friends",active:s==="leaderboard",onClick:()=>t("leaderboard")})]})});function It(s){var t=s.lastRenderedStartIndex,i=s.lastRenderedStopIndex,o=s.startIndex,a=s.stopIndex;return!(o>i||a<t)}function xt(s){for(var t=s.isItemLoaded,i=s.itemCount,o=s.minimumBatchSize,a=s.startIndex,u=s.stopIndex,r=[],l=null,d=null,p=a;p<=u;p++){var x=t(p);x?d!==null&&(r.push(l,d),l=d=null):(d=p,l===null&&(l=p))}if(d!==null){for(var j=Math.min(Math.max(d,l+o-1),i-1),y=d+1;y<=j&&!t(y);y++)d=y;r.push(l,d)}if(r.length)for(;r[1]-r[0]+1<o&&r[0]>0;){var h=r[0]-1;if(!t(h))r[0]=h;else break}return r}var jt=function(s,t){if(!(s instanceof t))throw new TypeError("Cannot call a class as a function")},mt=function(){function s(t,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,i,o){return i&&s(t.prototype,i),o&&s(t,o),t}}(),yt=function(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);s.prototype=Object.create(t&&t.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(s,t):s.__proto__=t)},se=function(s,t){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:s};(function(s){yt(t,s);function t(){var i,o,a,u;jt(this,t);for(var r=arguments.length,l=Array(r),d=0;d<r;d++)l[d]=arguments[d];return u=(o=(a=se(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(l))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(p){var x=p.visibleStartIndex,j=p.visibleStopIndex;a._lastRenderedStartIndex=x,a._lastRenderedStopIndex=j,a._ensureRowsLoaded(x,j)},a._setRef=function(p){a._listRef=p},o),se(a,u)}return mt(t,[{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,a){var u=this.props,r=u.isItemLoaded,l=u.itemCount,d=u.minimumBatchSize,p=d===void 0?10:d,x=u.threshold,j=x===void 0?15:x,y=xt({isItemLoaded:r,itemCount:l,minimumBatchSize:p,startIndex:Math.max(0,o-j),stopIndex:Math.min(l-1,a+j)});(this._memoizedUnloadedRanges.length!==y.length||this._memoizedUnloadedRanges.some(function(h,S){return y[S]!==h}))&&(this._memoizedUnloadedRanges=y,this._loadUnloadedRanges(y))}},{key:"_loadUnloadedRanges",value:function(o){for(var a=this,u=this.props.loadMoreItems||this.props.loadMoreRows,r=function(p){var x=o[p],j=o[p+1],y=u(x,j);y!=null&&y.then(function(){if(It({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:x,stopIndex:j})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(x,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},l=0;l<o.length;l+=2)r(l)}}]),t})(I.PureComponent);const Mt=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),ht=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),ft=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Nt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Tt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),At=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),gt=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Dt=()=>n.c1,vt=n.styled_default(Dt())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),St=({rank:s,avatar:t,name:i,points:o,isCurrentUser:a,openItemDetail:u,style:r})=>e.jsxs(Mt,{onClick:u,style:r,children:[e.jsx(ht,{children:s||0}),e.jsxs(Tt,{children:[t?e.jsx(ft,{alt:"leaderboard-item-avatar",src:t}):e.jsx(Nt,{children:ie(i||"")}),e.jsxs(At,{children:[e.jsx(gt,{children:i||""}),a&&e.jsx(vt,{name:"icon-star"})]})]}),e.jsx("div",{children:ae(o)})]}),kt=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),zt=({items:s,currentUserId:t,openItemDetail:i,fetchMore:o,scrollNode:a,hasMore:u})=>e.jsx(je,{loadMore:o,initialLoad:!1,hasMore:u,useWindow:!1,getScrollParent:()=>a.current,children:e.jsx(kt,{children:s.map(r=>e.jsx(St,{...r,openItemDetail:()=>i(r.userId),isCurrentUser:!!t&&t===r.userId},r.userId))})}),Et=({deepLink:s})=>{const{data:t}=Q.useStore(s.$store);return e.jsx(M.O,{inviteLink:t,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."})},Qt=({gamification:s,scrollNode:t,scrollStore:i})=>{const{data:o,hasMore:a}=Q.useStore(s.leaderboardList.$store);return o!=null&&o.length?e.jsx(zt,{items:o,scrollNode:t,scrollStore:i,fetchMore:s.leaderboardList.fetchMore,hasMore:a,openItemDetail:s.openUser,currentUserId:s.currentUserId.get()}):e.jsx(Et,{deepLink:s.deepLink})},Ct=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),bt=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Ot=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Lt=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),wt=()=>n.c1,U=n.styled_default(wt())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),_t=()=>n.c1,$t=n.styled_default(_t())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),Rt=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),qt=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),Ut=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),Yt={[c.PickHistoryStatus.LOST]:e.jsx(U,{name:"incorrectVoted"}),[c.PickHistoryStatus.WON]:e.jsx(U,{name:"icon-check"}),[c.PickHistoryStatus.UNSET]:e.jsx(U,{name:"icon-arrow"}),[c.PickHistoryStatus.DNP]:e.jsx(U,{name:"icon-arrow"})},Pt=({questionId:s,questionType:t,questionStatus:i,subject:o,openForVoting:a,openQuestion:u,status:r})=>{const l=M.o[t],d=Yt[r];return l?e.jsxs(Ct,{onClick:()=>u==null?void 0:u(s),children:[e.jsxs(qt,{children:[e.jsxs(bt,{children:[e.jsx($t,{"data-type-trivia":t===c.QuestionType.TRIVIA,"data-type-poll":t===c.QuestionType.POLL,name:l.iconName}),e.jsxs(Rt,{children:[l.label,t===c.QuestionType.TRIVIA&&i===c.QuestionStatus.RESOLVED&&" • Expired"]})]}),e.jsx(Ot,{children:o||""})]}),e.jsx(Lt,{children:a?e.jsx(Ut,{children:"Play"}):d})]}):null},Vt=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),Bt=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),Wt=({openInsight:s,questionId:t,...i})=>e.jsxs(Vt,{children:[e.jsx(le,{questionId:t,...i,isPickHistory:!0}),s&&e.jsx(Bt,{onClick:()=>s(t),children:"View Insight"})]}),Ft=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),Ht=()=>M.c,Gt=n.styled_default(Ht())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),Zt=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),Jt=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),Kt=({openTweet:s,created:t,...i})=>{const o=I.useMemo(()=>{if(t){const a=new Date(t);if(H(a))return{date:W(a),time:F(a)}}return null},[t]);return e.jsxs(Ft,{children:[o&&e.jsxs(Zt,{children:[o.date," · ",o.time]}),i.title&&e.jsx(Jt,{children:i.title}),e.jsx(M.u,{...i}),s&&e.jsx(Gt,{onClick:()=>s(i.tweetId),children:"View Insight"})]})},Xt=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),en=({questions:s,openQuestion:t})=>e.jsx(Xt,{children:s==null?void 0:s.map(i=>{var o,a,u;if(i.type==="question"&&((o=i.attributes)==null?void 0:o.attributes.case)==="question"){const r=i.attributes.attributes.value;return e.jsx(Pt,{openQuestion:t,...r},r.questionId)}if(i.type==="insight"&&((a=i.attributes)==null?void 0:a.attributes.case)==="insight"){const r=i.attributes.attributes.value,l=i.attributes.created;return e.jsx(Wt,{openInsight:t,...r,created:l},r.questionId)}if(i.type==="tweet"&&((u=i.attributes)==null?void 0:u.attributes.case)==="tweet"){const r=i.attributes.attributes.value,l=i.attributes.id,d=i.attributes.created;return e.jsx(Kt,{openTweet:t,...r,tweetId:l,created:d},l)}return null})}),sn=({store:s,openQuestion:t})=>{const i=Q.useStore(s);return i!=null&&i.data?e.jsx(en,{openQuestion:t,questions:i.data}):e.jsx("div",{children:"wait questions..."})},tn=({userSummary:s})=>{var t;const[i,o]=I.useState(void 0);return I.useEffect(()=>{const a=s.subscribe(u=>{u!=null&&u.data&&o(u.data)});return()=>{a()}},[s]),i!=null&&i.summary?e.jsx(oe,{...i.summary,successRate:(t=i.percentage)==null?void 0:t.correct}):e.jsx("div",{children:"wait user..."})},nn=({gamification:s,className:t,scrollStore:i,scrollNode:o})=>{const[a,u]=I.useState(!1),[r,l]=I.useState(Y.HOME),[,d]=I.useTransition(),p=j=>{d(()=>l(j))},x=j=>{d(()=>u(j))};return I.useEffect(()=>i.listen(j=>{if(j.scrollPosition===0){x(!1),i.setKey("tabsShown",!1);return}x(j.scrollDirection==="forward"),i.setKey("tabsShown",j.scrollDirection!=="forward")}),[i]),e.jsxs("div",{className:t,children:[e.jsx(M.a,{style:{paddingBottom:"8px",position:"sticky",transition:"top calc(var(--animation-duration) / 2) var(--animation-function)",top:a?"-60px":"0px"},children:e.jsx(pt,{activePage:r,toggleActivePage:p})}),r===Y.HOME&&e.jsxs(e.Fragment,{children:[e.jsx(M.a,{style:{paddingTop:"8px"},children:e.jsx(tn,{userSummary:s.userSummary})}),e.jsx(M.n,{children:e.jsx(sn,{openQuestion:s.openQuestion,store:s.feedList.getStore()})})]}),r===Y.LEADERBOARD&&e.jsx(M.a,{style:{paddingTop:"8px"},children:e.jsx(Qt,{scrollStore:i,scrollNode:o,gamification:s})})]})},an=()=>M.x,te=n.styled_default(an())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),on=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),rn=({correct:s,incorrect:t})=>{const i=s+t;return i===0?0:Math.round(s/i*100)},ln=({gamification:s,scrollStore:t,className:i,appNode:o,scrollNode:a})=>{const u=Q.useStore(s.openedQuestion.$store),r=Q.useStore(s.openedUser);return e.jsxs(e.Fragment,{children:[u&&o.current&&M.Pk.createPortal(e.jsx(te,{className:i,children:e.jsx(rt,{gamification:s})}),o.current),r&&o.current&&M.Pk.createPortal(e.jsx(te,{className:i,children:e.jsxs(on,{children:[e.jsx(ne,{label:"Friend's Rank",close:s.closeUser}),e.jsx(M.a,{children:e.jsx(oe,{...r,successRate:rn(r)})})]})}),o.current),e.jsx(nn,{scrollStore:t,scrollNode:a,className:i,gamification:s})]})};exports.default=ln;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index4.js"),S=require("@nanostores/react"),y=require("./masters2.js"),c=require("@streamlayer/sdk-web-types"),I=require("react"),W=require("./index3.js");require("react-countup");const je=require("react-countdown-circle-timer"),L=require("./index2.js"),pe=require("react-infinite-scroller");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("lodash.throttle");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const xe=t.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ne=t.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),ye=()=>t.c1,De=t.styled_default(ye())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),Te=t.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),ge=t.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),me=()=>t.c1,Ae=t.styled_default(me())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ne=({type:s,close:n,label:i})=>{const o=s?y.o[s]:{label:i,iconName:void 0};return e.jsxs(xe,{children:[e.jsxs(Ne,{children:[(o==null?void 0:o.iconName)&&e.jsx(De,{"data-type-trivia":s===c.QuestionType.TRIVIA,"data-type-poll":s===c.QuestionType.POLL,name:o.iconName}),(o==null?void 0:o.label)&&e.jsx(Te,{children:o.label})]}),e.jsx(ge,{onClick:n,children:e.jsx(Ae,{name:"icon-cross"})})]})},ie=s=>s.split(/\s+/).map(n=>n[0]).join("").toUpperCase(),ae=s=>s?s.toLocaleString("en-US"):"0",B=s=>s.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),F=s=>s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Z=s=>!isNaN(s.getTime()),he=t.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),fe=t.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),ze=t.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),J=({indicator:s,title:n})=>e.jsxs(he,{children:[e.jsx(fe,{children:n}),e.jsx(ze,{children:s})]}),Ee=t.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),ve=t.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Oe=t.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),Y=({indicator:s,title:n})=>e.jsxs(Ee,{children:[e.jsx(ve,{children:s}),e.jsx(Oe,{children:n})]}),Le=t.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Se=t.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),ke=t.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Ce=t.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Qe=t.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),we=t.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),be=t.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),_e=t.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),$e=t.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ye=t.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Ue=t.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Re=t.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),qe=t.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Pe=t.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ve=t.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),We=t.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Be=t.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Fe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4y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ExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",oe=({avatar:s,name:n,points:i,friendsRank:o,rank:a,streak:u,correct:r,incorrect:l,inTop:d,successRate:M})=>e.jsxs(Le,{children:[e.jsx(Se,{children:e.jsxs(Ce,{children:[e.jsxs(Be,{children:[s&&e.jsx(Qe,{alt:"avatar",src:s}),!s&&e.jsx(We,{children:ie(n||"")})]}),e.jsxs(we,{children:[e.jsx(be,{children:n}),e.jsxs(_e,{children:[e.jsxs(Ye,{children:[e.jsx($e,{alt:"rank-icon",src:Fe}),e.jsxs(Ue,{children:[ae(i),e.jsx(Re,{children:"PTS"})]})]}),e.jsx(qe,{}),e.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),e.jsxs(ke,{children:[e.jsxs(Pe,{children:[e.jsx(J,{indicator:o||0,title:"Friends rank"}),e.jsx(J,{indicator:a||0,title:"Global rank"})]}),e.jsxs(Ve,{children:[e.jsx(Y,{indicator:u||0,title:"Win streak"}),e.jsx(Y,{indicator:r||0,title:"Correct"}),e.jsx(Y,{indicator:l||0,title:"Incorrect"}),e.jsx(Y,{indicator:`${M||0}%`,title:"Succ. rate"})]})]})]}),Ze=t.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),Ge=()=>t.c1,He=t.styled_default(Ge())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),Je=()=>e.jsx(Ze,{children:e.jsx(He,{name:"mastersLogo"})}),Xe=t.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),Ke=t.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),es=t.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ss=({title:s,description:n})=>e.jsxs(Xe,{children:[e.jsx(t.c1,{name:"icon-check-circle"}),e.jsx(Ke,{children:s}),e.jsx(es,{children:n})]}),ts=t.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ns=()=>t.c1,is=t.styled_default(ns())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),_=t.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),U=t.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),as=t.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),w=t.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),V=t.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),os=({feedbackMessages:s,questionVotedCorrectly:n,questionVoted:i,questionType:o,hasCorrectAnswer:a,questionStatus:u,showExpiredNotification:r,showClosedNotificationTrivia:l,votedInCurrentRender:d,votedAfterQuestionClosed:M,enteredAnActiveQuestion:j,marketClosed:p})=>{const N=i&&(o===c.QuestionType.TRIVIA||o===c.QuestionType.PREDICTION)&&d&&u!==c.QuestionStatus.RESOLVED,D=o===c.QuestionType.PREDICTION&&!a,E=p&&o===c.QuestionType.PREDICTION&&!i&&!j||o===c.QuestionType.PREDICTION&&M&&d&&j,m=N&&D,v=N&&a,A=o===c.QuestionType.PREDICTION&&i&&d&&a,k=i&&o===c.QuestionType.POLL&&d;if(!r&&!l&&!m&&!v&&!E&&!k&&!A)return null;const z=n?"correct":"incorrect",f=n?s==null?void 0:s.correctFeedback:s==null?void 0:s.incorrectFeedback;return e.jsxs(ts,{"data-isPrediction":D,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(t.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(U,{children:e.jsx(w,{children:"Question Expired"})}),e.jsx(V,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(t.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(U,{children:e.jsx(w,{children:"Question Closed"})}),e.jsx(V,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),E&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(t.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(U,{children:e.jsx(w,{children:"Question Closed"})}),e.jsx(V,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),m&&e.jsxs(e.Fragment,{children:[e.jsx(is,{name:"icon-prediction"}),e.jsx(w,{children:"Stay tuned to see if your prediction was correct."})]}),k&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-feedbackType":"correct",children:e.jsx(t.c1,{name:"correct"})}),e.jsx(w,{children:"That's for answering. Please stay tuned for the next question."})]}),(v||A)&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-feedbackType":z,children:e.jsx(t.c1,{name:z})}),e.jsx("div",{children:e.jsxs(U,{children:[e.jsx(as,{"data-feedbackType":z,children:f==null?void 0:f.title}),e.jsx(w,{children:f==null?void 0:f.description})]})})]})]})},rs=t.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),ls=t.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),ds=t.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),cs=t.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),us=t.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),Ms=t.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Is=t.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),js=t.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),ps=t.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),re=t.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),xs=()=>re,Ns=t.styled_default(xs())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),ys=()=>re,Ds=t.styled_default(ys())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ts=t.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),gs=t.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),ms=t.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),As=t.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),hs=()=>t.c1,fs=t.styled_default(hs())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),X={[c.QuestionImages.CENTERED]:s=>e.jsx(Ns,{alt:"option-icon",src:s}),[c.QuestionImages.TRANSPARENT]:s=>e.jsx(js,{children:e.jsx(ps,{style:{backgroundImage:`url(${s})`}})}),[c.QuestionImages.ROUNDED]:s=>e.jsx(Ds,{alt:"option-icon",src:s}),[c.QuestionImages.NONE]:()=>null,[c.QuestionImages.UNSET]:()=>null},zs=({questionType:s,hasCorrectAnswer:n,correct:i,youVoted:o,questionVoted:a})=>{if(s===c.QuestionType.POLL&&o)return"correct";if(s===c.QuestionType.PREDICTION){if(n&&a)return o?i?"correct":"incorrect":"unset";if(o)return"correct"}return s===c.QuestionType.TRIVIA&&a&&o?i?"correct":"incorrect":"unset"},Es=({questionType:s,questionVoted:n,correct:i,hasCorrectAnswer:o,questionStatus:a})=>s===c.QuestionType.TRIVIA?n&&i:s===c.QuestionType.PREDICTION?n&&i&&o||a===c.QuestionStatus.RESOLVED&&i:!1,vs=s=>{var n;const{id:i,icon:o,text:a,percentageDecimal:u,points:r,onVote:l,markThatVoted:d,youSelected:M,questionVoted:j,imageMode:p,answerTimeExpired:N,questionStatus:D,isLoading:E,questionType:m,correct:v,hasCorrectAnswer:A,votedAfterQuestionClosed:k,enteredAnActiveQuestion:z,marketClosed:f}=s,O=zs(s),P=Es({questionType:m,questionVoted:j,correct:v,hasCorrectAnswer:A,questionStatus:D}),C=f&&m===c.QuestionType.PREDICTION,$=j||C,x=m===c.QuestionType.PREDICTION&&!j&&D!==c.QuestionStatus.RESOLVED;return e.jsxs(us,{value:i,"data-selected":M,"data-answer-state":O,disabled:j||E||N||C&&!z||C&&z&&k,"data-is-not-checked":j&&!M&&O!=="incorrect",onClick:g=>{d(m===c.QuestionType.PREDICTION?f:D===c.QuestionStatus.RESOLVED),l(g)},children:[e.jsx(Ms,{"data-answer-state":O,style:{width:`${$?u:0}%`}}),e.jsxs(Is,{children:[o&&p&&((n=X[p])==null?void 0:n.call(X,o)),e.jsx(Ts,{children:a}),x&&e.jsxs("div",{children:[e.jsx(W.d,{value:r}),e.jsx(ms,{children:"pts"})]}),$&&e.jsxs(gs,{children:[P&&e.jsx(fs,{name:"selected"}),e.jsx(As,{children:e.jsx(W.d,{value:u,suffix:"%"})})]})]})]})},Os=[L.E.PRIMARY_GREEN1,L.E.SECONDARY_RED1,L.E.SECONDARY_RED1,L.E.NEUTRALS_GRAY3],Ls=[10,10,1,0],Ss=t.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),ks=L.E.SECONDARY_GREEN6,K=L.E.SECONDARY_RED3,Cs=L.E.NEUTRALS_GRAY3,Qs=({isPlaying:s=!0,duration:n=30,onTimerExpired:i})=>{const[o,a]=I.useState(n>10?ks:K),u=({remainingTime:d})=>e.jsx(Ss,{children:d}),r=I.useCallback(()=>{i==null||i(),a(Cs)},[i,a]),l=I.useCallback(d=>{d===10&&a(K)},[a]);return e.jsx(je.CountdownCircleTimer,{isPlaying:s,duration:n,colors:Os,colorsTime:Ls,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:o,onComplete:r,onUpdate:l,children:u})},ws=t.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),bs=t.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),_s=t.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),$s=()=>t.c1,Ys=t.styled_default($s())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Us=t.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Rs=t.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),qs=t.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Ps=({title:s,points:n,isPlayingTimer:i,isTimer:o,questionType:a,timerDuration:u,onTimerExpired:r})=>e.jsxs(ws,{style:{justifyContent:a===c.QuestionType.PREDICTION?"center":"space-between"},children:[e.jsxs(bs,{children:[s&&e.jsx(_s,{children:s}),n!==void 0&&a!==c.QuestionType.POLL&&e.jsxs(e.Fragment,{children:[e.jsx(Ys,{name:"icon-trophy"}),e.jsxs(Us,{children:[e.jsx(Rs,{children:e.jsx(W.d,{value:n})}),e.jsx(qs,{children:"PTS"})]})]})]}),o&&a!==c.QuestionType.PREDICTION&&e.jsx(Qs,{isPlaying:i,onTimerExpired:r,duration:u})]}),Vs=({openedQuestion:s,isLoading:n,vote:i,close:o})=>{var a,u;const r=s.subject,l=s.type,d=s.status,M=(a=s.options)==null?void 0:a.options,j=s.marketClosed,[p,N]=I.useState(!1),[D,E]=I.useState(!1),[m,v]=I.useState(!0),[A,k]=I.useState(!1),[z,f]=I.useState(""),O=s==null?void 0:s.id;I.useEffect(()=>{l===c.QuestionType.PREDICTION?j&&v(!1):d===c.QuestionStatus.RESOLVED&&v(!1)},[]);const P=I.useCallback(T=>{E(T),N(!0)},[]),C=I.useCallback(async T=>{if(O){const b=T.currentTarget.value;f(b),await i(O,b)}},[O,f,i]),$=I.useCallback(()=>{k(!0),setTimeout(o,3e3)},[o]),x=I.useMemo(()=>s==null?void 0:s.answers.find(T=>T.youVoted===!0),[s]),g=I.useMemo(()=>!!(s!=null&&s.answers.find(T=>T.correct===!0)),[s]),h=I.useMemo(()=>s==null?void 0:s.answers.find(T=>T.correct===!0),[s]),de=I.useMemo(()=>s?s.answers.map(T=>{var b;return{...T,questionVoted:!!x,youSelected:z===T.id,isLoading:n,hasCorrectAnswer:g,questionType:s.type,answerTimeExpired:A,questionStatus:d,imageMode:(b=s.appearance)==null?void 0:b.images,onVote:C}}):[],[g,A,n,s,x,d,C,z]),ce=M&&(M.case==="trivia"||M.case==="prediction")?M.value:void 0,Q=d===c.QuestionStatus.RESOLVED&&l===c.QuestionType.TRIVIA&&!x&&!m,G=l===c.QuestionType.TRIVIA&&D&&p&&m,H=I.useMemo(()=>l===c.QuestionType.PREDICTION?!!(x&&!g||x&&g&&h!=null&&h.youVoted):!0,[l,x,g,h]),ue=I.useMemo(()=>{if(l===c.QuestionType.PREDICTION&&x&&(!g||g&&h!=null&&h.youVoted))return x.points;if(!(Q||A))return d===c.QuestionStatus.RESOLVED?0:x?x.correct?x.points:0:h==null?void 0:h.points},[A,x,h,d,Q,l,g]),Me=I.useMemo(()=>l===c.QuestionType.PREDICTION&&x?g?g&&h!=null&&h.youVoted?"You won":"":"To win":Q||A?"Time expired":l===c.QuestionType.POLL?"Time remaining":x?"You won":"To win",[A,l,x,Q,g,h]),Ie=x||Q||G||l===c.QuestionType.TRIVIA&&d===c.QuestionStatus.RESOLVED&&m;return e.jsx(y.r,{"data-question-header":"true",children:e.jsx(rs,{children:e.jsxs(ls,{children:[e.jsx(os,{feedbackMessages:ce,questionVoted:!!x,questionVotedCorrectly:x==null?void 0:x.correct,questionType:l,hasCorrectAnswer:g,questionStatus:d,showExpiredNotification:Q,showClosedNotificationTrivia:G,votedInCurrentRender:p,votedAfterQuestionClosed:D,enteredAnActiveQuestion:m,marketClosed:j}),H&&e.jsx(Ps,{title:Me,points:ue,onTimerExpired:$,questionType:s.type,isTimer:!n,isPlayingTimer:!x,timerDuration:Ie?0:Number(((u=s==null?void 0:s.appearance)==null?void 0:u.autoHideInterval)||"30")}),A?e.jsx(ss,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{style:H?{}:{marginTop:0},children:r}),e.jsx(cs,{children:de.map(T=>e.jsx(vs,{...T,markThatVoted:P,votedAfterQuestionClosed:D,enteredAnActiveQuestion:m,marketClosed:j},T.id))})]})]})})})},Ws=t.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),Bs=t.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),Fs=t.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),Zs=t.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),Gs=t.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),Hs=t.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),le=({created:s,image:n,title:i,isPickHistory:o,instantView:a,notification:u})=>{const r=I.useMemo(()=>{if(s){const d=new Date(s);if(Z(d))return{date:B(d),time:F(d)}}return null},[s]),l=(a==null?void 0:a.image)||n;return e.jsxs(Ws,{children:[r&&e.jsxs(Gs,{children:[r.date," · ",r.time]}),(a==null?void 0:a.video)&&e.jsx(y.w,{source:a.video.url,poster:a.video.thumbnailUrl}),l&&!(a!=null&&a.video)&&e.jsx(Hs,{src:l}),e.jsxs(Bs,{children:[e.jsx(Fs,{children:o?i:a==null?void 0:a.heading}),e.jsx(Zs,{children:o?u==null?void 0:u.body:a==null?void 0:a.body})]})]})},Js=t.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Xs=t.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),Ks=({instantView:s,...n})=>e.jsxs(Js,{children:[e.jsx(le,{instantView:s,...n}),(s==null?void 0:s.webLink)&&e.jsxs(Xs,{href:s==null?void 0:s.webLink.url,target:"_blank",children:[s==null?void 0:s.webLink.label,e.jsx(t.c1,{name:"icon-external-link"})]})]}),et=t.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),st=t.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),tt=t.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),nt=({created:s,...n})=>{const i=I.useMemo(()=>{if(s){const o=new Date(s);if(Z(o))return{date:B(o),time:F(o)}}return null},[s]);return e.jsxs(et,{children:[i&&e.jsxs(st,{children:[i.date," · ",i.time]}),n.title&&e.jsx(tt,{children:n.title}),e.jsx(y.u,{...n})]})},it=t.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),at=({openedQuestion:s})=>{var n,i;return((n=s==null?void 0:s.attributes)==null?void 0:n.attributes.case)==="insight"?e.jsx(Ks,{created:s.attributes.created,...s.attributes.attributes.value}):((i=s==null?void 0:s.attributes)==null?void 0:i.attributes.case)==="tweet"?e.jsx(nt,{created:s.attributes.created,...s.attributes.attributes.value}):null},ot=({extendedQuestion:s,vote:n,close:i})=>{const{loading:o,data:a}=s;return a?e.jsx(Vs,{vote:n,close:i,openedQuestion:a,isLoading:!!o}):null},rt=({gamification:s})=>{var n;const i=S.useStore(s.openedQuestion.$store),o=S.useStore(s.openedQuestion.$extendedStore);if(!i)return null;const a=i.type;return e.jsxs(it,{children:[e.jsx(ne,{close:s.closeQuestion,type:((n=i.attributes)==null?void 0:n.type)||c.QuestionType.UNSET}),a==="question"&&e.jsx(ot,{vote:s.submitAnswer,close:s.closeQuestion,extendedQuestion:o}),a!=="question"&&e.jsx(at,{openedQuestion:i}),e.jsx(Je,{sponsorLogo:""})]})},lt=t.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),dt=t.styled_default("img")({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!1}),ct=t.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),ut=t.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),Mt=t.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),It=()=>t.c1,jt=t.styled_default(It())({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),pt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iMTYiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xMC40NjE1IDEyLjY4NzVDOS40NDIzMSAxMi42ODc1IDguNjE1MzggMTMuNDY2NSA4LjYxNTM4IDE0LjQyNjZDOC42MTUzOCAxNS4zODY4IDkuNDQyMzEgMTYuMTY1OCAxMC40NjE1IDE2LjE2NThDMTEuNDgwOCAxNi4xNjU4IDEyLjMwNzcgMTUuMzg2OCAxMi4zMDc3IDE0LjQyNjZDMTIuMzA3NyAxMy40NjY1IDExLjQ4MDggMTIuNjg3NSAxMC40NjE1IDEyLjY4NzVaTTEwLjQ2MTUgMTYuMTY1OEM5LjEwODE3IDE2LjE2NTggOCAxNy4yMDk3IDggMTguNDg0NlYxOS43NTI3QzggMTkuNzUyNyA4LjYxNTM4IDIwLjIyMzcgMTAuNDYxNSAyMC4yMjM3QzEyLjMwNzcgMjAuMjIzNyAxMi45MjMxIDE5Ljc1MjcgMTIuOTIzMSAxOS43NTI3VjE4LjQ4NDZDMTIuOTIzMSAxNy4yMDk3IDExLjgxNDkgMTYuMTY1OCAx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wMzkxIDE4LjE0ODcgMTQuNTI0IDE4LjY3MTIgMTUuMjYxQzE4LjY3MTIgMTUuMDE2MSAxOC42MSAxNC43NzYxIDE4LjYxIDE0LjUzMTJDMTguNjEgMTMuODU0MiAxOC44MDg4IDEzLjIzNzIgMTkuMjAxMiAxMi43NDUxQzE5LjAwNSAxMi42ODI3IDE4LjgwNjIgMTIuNjg3NSAxOC42MSAxMi42ODc1WiIgZmlsbD0iIzEwN0Q1NyIvPgo8L3N2Zz4K",xt=({title:s,description:n,onClick:i})=>e.jsxs(lt,{onClick:i,children:[e.jsx(dt,{alt:"friends-icon",src:pt}),e.jsxs(ct,{children:[e.jsx(ut,{children:s}),e.jsx(Mt,{children:n})]}),e.jsx(jt,{name:"icon-copy"})]}),Nt=t.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),yt=t.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),Dt=t.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),Tt=t.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var q=(s=>(s.HOME="home",s.LEADERBOARD="leaderboard",s))(q||{});const ee=({title:s,active:n,onClick:i})=>e.jsx(Dt,{onClick:i,"data-selected":n,children:e.jsx(Tt,{children:s})}),gt=({activePage:s="home",toggleActivePage:n})=>e.jsx(Nt,{children:e.jsxs(yt,{"data-position":s==="home"?"left":"right",children:[e.jsx(ee,{title:"Home",active:s==="home",onClick:()=>n("home")}),e.jsx(ee,{title:"Friends",active:s==="leaderboard",onClick:()=>n("leaderboard")})]})});function mt(s){var n=s.lastRenderedStartIndex,i=s.lastRenderedStopIndex,o=s.startIndex,a=s.stopIndex;return!(o>i||a<n)}function At(s){for(var n=s.isItemLoaded,i=s.itemCount,o=s.minimumBatchSize,a=s.startIndex,u=s.stopIndex,r=[],l=null,d=null,M=a;M<=u;M++){var j=n(M);j?d!==null&&(r.push(l,d),l=d=null):(d=M,l===null&&(l=M))}if(d!==null){for(var p=Math.min(Math.max(d,l+o-1),i-1),N=d+1;N<=p&&!n(N);N++)d=N;r.push(l,d)}if(r.length)for(;r[1]-r[0]+1<o&&r[0]>0;){var D=r[0]-1;if(!n(D))r[0]=D;else break}return r}var ht=function(s,n){if(!(s instanceof n))throw new TypeError("Cannot call a class as a function")},ft=function(){function s(n,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}return function(n,i,o){return i&&s(n.prototype,i),o&&s(n,o),n}}(),zt=function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);s.prototype=Object.create(n&&n.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(s,n):s.__proto__=n)},se=function(s,n){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:s};(function(s){zt(n,s);function n(){var i,o,a,u;ht(this,n);for(var r=arguments.length,l=Array(r),d=0;d<r;d++)l[d]=arguments[d];return u=(o=(a=se(this,(i=n.__proto__||Object.getPrototypeOf(n)).call.apply(i,[this].concat(l))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(M){var j=M.visibleStartIndex,p=M.visibleStopIndex;a._lastRenderedStartIndex=j,a._lastRenderedStopIndex=p,a._ensureRowsLoaded(j,p)},a._setRef=function(M){a._listRef=M},o),se(a,u)}return ft(n,[{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,a){var u=this.props,r=u.isItemLoaded,l=u.itemCount,d=u.minimumBatchSize,M=d===void 0?10:d,j=u.threshold,p=j===void 0?15:j,N=At({isItemLoaded:r,itemCount:l,minimumBatchSize:M,startIndex:Math.max(0,o-p),stopIndex:Math.min(l-1,a+p)});(this._memoizedUnloadedRanges.length!==N.length||this._memoizedUnloadedRanges.some(function(D,E){return N[E]!==D}))&&(this._memoizedUnloadedRanges=N,this._loadUnloadedRanges(N))}},{key:"_loadUnloadedRanges",value:function(o){for(var a=this,u=this.props.loadMoreItems||this.props.loadMoreRows,r=function(M){var j=o[M],p=o[M+1],N=u(j,p);N!=null&&N.then(function(){if(mt({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:j,stopIndex:p})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(j,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},l=0;l<o.length;l+=2)r(l)}}]),n})(I.PureComponent);const Et=t.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),vt=t.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ot=t.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Lt=t.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),St=t.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),kt=t.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Ct=t.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Qt=()=>t.c1,wt=t.styled_default(Qt())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),bt=({rank:s,avatar:n,name:i,points:o,isCurrentUser:a,openItemDetail:u,style:r})=>e.jsxs(Et,{onClick:u,style:r,children:[e.jsx(vt,{children:s||0}),e.jsxs(St,{children:[n?e.jsx(Ot,{alt:"leaderboard-item-avatar",src:n}):e.jsx(Lt,{children:ie(i||"")}),e.jsxs(kt,{children:[e.jsx(Ct,{children:i||""}),a&&e.jsx(wt,{name:"icon-star"})]})]}),e.jsx("div",{children:ae(o)})]}),_t=t.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),$t=({items:s,currentUserId:n,openItemDetail:i,fetchMore:o,scrollNode:a,hasMore:u})=>e.jsx(pe,{loadMore:o,initialLoad:!1,hasMore:u,useWindow:!1,getScrollParent:()=>a.current,children:e.jsx(_t,{children:s.map(r=>e.jsx(bt,{...r,openItemDetail:()=>i(r.userId),isCurrentUser:!!n&&n===r.userId},r.userId))})}),Yt=({deepLink:s})=>{const{data:n}=S.useStore(s.$store);return e.jsx(y.O,{inviteLink:n,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."})},Ut=({gamification:s,scrollNode:n,scrollStore:i})=>{const{data:o,hasMore:a}=S.useStore(s.leaderboardList.$store);return o!=null&&o.length?e.jsx($t,{items:o,scrollNode:n,scrollStore:i,fetchMore:s.leaderboardList.fetchMore,hasMore:a,openItemDetail:s.openUser,currentUserId:s.currentUserId.get()}):e.jsx(Yt,{deepLink:s.deepLink})},Rt=t.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),qt=t.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Pt=t.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Vt=t.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Wt=()=>t.c1,R=t.styled_default(Wt())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Bt=()=>t.c1,Ft=t.styled_default(Bt())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),Zt=t.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),Gt=t.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),Ht=t.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),Jt={[c.PickHistoryStatus.LOST]:e.jsx(R,{name:"incorrectVoted"}),[c.PickHistoryStatus.WON]:e.jsx(R,{name:"icon-check"}),[c.PickHistoryStatus.UNSET]:e.jsx(R,{name:"icon-arrow"}),[c.PickHistoryStatus.DNP]:e.jsx(R,{name:"icon-arrow"})},Xt=({questionId:s,questionType:n,questionStatus:i,subject:o,openForVoting:a,openQuestion:u,status:r})=>{const l=y.o[n],d=Jt[r];return l?e.jsxs(Rt,{onClick:()=>u==null?void 0:u(s),children:[e.jsxs(Gt,{children:[e.jsxs(qt,{children:[e.jsx(Ft,{"data-type-trivia":n===c.QuestionType.TRIVIA,"data-type-poll":n===c.QuestionType.POLL,name:l.iconName}),e.jsxs(Zt,{children:[l.label,n===c.QuestionType.TRIVIA&&i===c.QuestionStatus.RESOLVED&&" • Expired"]})]}),e.jsx(Pt,{children:o||""})]}),e.jsx(Vt,{children:a?e.jsx(Ht,{children:"Play"}):d})]}):null},Kt=t.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),en=t.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),sn=({openInsight:s,questionId:n,...i})=>e.jsxs(Kt,{children:[e.jsx(le,{questionId:n,...i,isPickHistory:!0}),s&&e.jsx(en,{onClick:()=>s(n),children:"View Insight"})]}),tn=t.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),nn=()=>y.c,an=t.styled_default(nn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),on=t.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),rn=t.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),ln=({openTweet:s,created:n,...i})=>{const o=I.useMemo(()=>{if(n){const a=new Date(n);if(Z(a))return{date:B(a),time:F(a)}}return null},[n]);return e.jsxs(tn,{children:[o&&e.jsxs(on,{children:[o.date," · ",o.time]}),i.title&&e.jsx(rn,{children:i.title}),e.jsx(y.u,{...i}),s&&e.jsx(an,{onClick:()=>s(i.tweetId),children:"View Insight"})]})},dn=t.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),cn=({questions:s,openQuestion:n})=>e.jsx(dn,{children:s==null?void 0:s.map(i=>{var o,a,u;if(i.type==="question"&&((o=i.attributes)==null?void 0:o.attributes.case)==="question"){const r=i.attributes.attributes.value;return e.jsx(Xt,{openQuestion:n,...r},r.questionId)}if(i.type==="insight"&&((a=i.attributes)==null?void 0:a.attributes.case)==="insight"){const r=i.attributes.attributes.value,l=i.attributes.created;return e.jsx(sn,{openInsight:n,...r,created:l},r.questionId)}if(i.type==="tweet"&&((u=i.attributes)==null?void 0:u.attributes.case)==="tweet"){const r=i.attributes.attributes.value,l=i.attributes.id,d=i.attributes.created;return e.jsx(ln,{openTweet:n,...r,tweetId:l,created:d},l)}return null})}),un=({store:s,openQuestion:n})=>{const i=S.useStore(s);return i!=null&&i.data?e.jsx(cn,{openQuestion:n,questions:i.data}):e.jsx("div",{children:"wait questions..."})},Mn=({userSummary:s})=>{var n;const[i,o]=I.useState(void 0);return I.useEffect(()=>{const a=s.subscribe(u=>{u!=null&&u.data&&o(u.data)});return()=>{a()}},[s]),i!=null&&i.summary?e.jsx(oe,{...i.summary,successRate:(n=i.percentage)==null?void 0:n.correct}):e.jsx("div",{children:"wait user..."})},In=({gamification:s,className:n,scrollStore:i,scrollNode:o})=>{const[a,u]=I.useState(!1),[r,l]=I.useState(q.HOME),[,d]=I.useTransition(),M=p=>{d(()=>l(p))},j=p=>{d(()=>u(p))};return I.useEffect(()=>i.listen(p=>{if(p.scrollPosition===0){j(!1),i.setKey("tabsShown",!1);return}j(p.scrollDirection==="forward"),i.setKey("tabsShown",p.scrollDirection!=="forward")}),[i]),e.jsxs("div",{className:n,children:[e.jsx(y.a,{style:{paddingBottom:"8px",position:"sticky",transition:"top calc(var(--animation-duration) / 2) var(--animation-function)",top:a?"-60px":"0px"},children:e.jsx(gt,{activePage:r,toggleActivePage:M})}),r===q.HOME&&e.jsxs(e.Fragment,{children:[e.jsx(y.a,{style:{paddingTop:"8px"},children:e.jsx(Mn,{userSummary:s.userSummary})}),e.jsx(y.n,{children:e.jsx(un,{openQuestion:s.openQuestion,store:s.feedList.getStore()})})]}),r===q.LEADERBOARD&&e.jsxs(e.Fragment,{children:[e.jsx(y.a,{style:{paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(Ut,{scrollStore:i,scrollNode:o,gamification:s})}),e.jsx(y.a,{style:{position:"sticky",bottom:"0",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(xt,{title:"Invite Friends",description:"Challenge them now!"})})]})]})},jn=()=>y.x,te=t.styled_default(jn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),pn=t.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),xn=({correct:s,incorrect:n})=>{const i=s+n;return i===0?0:Math.round(s/i*100)},Nn=({gamification:s,scrollStore:n,className:i,appNode:o,scrollNode:a})=>{const u=S.useStore(s.openedQuestion.$store),r=S.useStore(s.openedUser);return e.jsxs(e.Fragment,{children:[u&&o.current&&y.Pk.createPortal(e.jsx(te,{className:i,children:e.jsx(rt,{gamification:s})}),o.current),r&&o.current&&y.Pk.createPortal(e.jsx(te,{className:i,children:e.jsxs(pn,{children:[e.jsx(ne,{label:"Friend's Rank",close:s.closeUser}),e.jsx(y.a,{children:e.jsx(oe,{...r,successRate:xn(r)})})]})}),o.current),e.jsx(In,{scrollStore:n,scrollNode:a,className:i,gamification:s})]})};exports.default=Nn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Me=Object.defineProperty;var ge=(e,s,i)=>s in e?Me(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i;var U=(e,s,i)=>(ge(e,typeof s!="symbol"?s+"":s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("./masters.js"),u=require("react"),Te=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),ve=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Ne=()=>n.c1,Ae=n.styled_default(Ne())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),De=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Se=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),ke=()=>n.c1,Ee=n.styled_default(ke())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ie=({type:e,close:s,label:i})=>{const r=e?n.o[e]:{label:i,iconName:void 0};return t.jsxs(Te,{children:[t.jsxs(ve,{children:[(r==null?void 0:r.iconName)&&t.jsx(Ae,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:r.iconName}),(r==null?void 0:r.label)&&t.jsx(De,{children:r.label})]}),t.jsx(Se,{onClick:s,children:t.jsx(Ee,{name:"icon-cross"})})]})},oe=e=>e.split(/\s+/).map(s=>s[0]).join("").toUpperCase(),re=e=>e?e.toLocaleString("en-US"):"0",V=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),W=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),F=e=>!isNaN(e.getTime()),Le=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),we=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Ce=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),G=({indicator:e,title:s})=>t.jsxs(Le,{children:[t.jsx(we,{children:s}),t.jsx(Ce,{children:e})]}),be=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),ze=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Oe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:s})=>t.jsxs(be,{children:[t.jsx(ze,{children:e}),t.jsx(Oe,{children:s})]}),Qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),$e=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),_e=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Re=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Pe=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ue=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),qe=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ye=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ve=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),We=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Fe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Be=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),He=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Ge=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Je=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Ke=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Xe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub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=({avatar:e,name:s,points:i,friendsRank:r,rank:o,streak:l,correct:a,incorrect:d,inTop:c,successRate:m})=>t.jsxs(Qe,{children:[t.jsx($e,{children:t.jsxs(Re,{children:[t.jsxs(Ke,{children:[e&&t.jsx(Pe,{alt:"avatar",src:e}),!e&&t.jsx(Je,{children:oe(s||"")})]}),t.jsxs(Ue,{children:[t.jsx(qe,{children:s}),t.jsxs(Ye,{children:[t.jsxs(We,{children:[t.jsx(Ve,{alt:"rank-icon",src:Xe}),t.jsxs(Fe,{children:[re(i),t.jsx(Be,{children:"PTS"})]})]}),t.jsx(He,{}),t.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),t.jsxs(_e,{children:[t.jsxs(Ge,{children:[t.jsx(G,{indicator:r||0,title:"Friends rank"}),t.jsx(G,{indicator:o||0,title:"Global rank"})]}),t.jsxs(Ze,{children:[t.jsx($,{indicator:l||0,title:"Win streak"}),t.jsx($,{indicator:a||0,title:"Correct"}),t.jsx($,{indicator:d||0,title:"Incorrect"}),t.jsx($,{indicator:`${m||0}%`,title:"Succ. rate"})]})]})]}),es=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),ss=()=>n.c1,ts=n.styled_default(ss())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),ns=()=>t.jsx(es,{children:t.jsx(ts,{name:"mastersLogo"})}),is=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),os=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),rs=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),as=({title:e,description:s})=>t.jsxs(is,{children:[t.jsx(n.c1,{name:"icon-check-circle"}),t.jsx(os,{children:e}),t.jsx(rs,{children:s})]}),ls=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ds=()=>n.c1,cs=n.styled_default(ds())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),O=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),_=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),us=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),b=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),q=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ps=({feedbackMessages:e,questionVotedCorrectly:s,questionVoted:i,questionType:r,hasCorrectAnswer:o,questionStatus:l,showExpiredNotification:a,showClosedNotificationTrivia:d,votedInCurrentRender:c,votedAfterQuestionClosed:m,enteredAnActiveQuestion:h,marketClosed:p})=>{const I=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION)&&c&&l!==n.QuestionStatus.RESOLVED,f=r===n.QuestionType.PREDICTION&&!o,N=p&&r===n.QuestionType.PREDICTION&&!i&&!h||r===n.QuestionType.PREDICTION&&m&&c&&h,x=I&&f,M=I&&o,y=r===n.QuestionType.PREDICTION&&i&&c&&o,T=i&&r===n.QuestionType.POLL&&c;if(!a&&!d&&!x&&!M&&!N&&!T&&!y)return null;const g=s?"correct":"incorrect",v=s?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return t.jsxs(ls,{"data-isPrediction":f,children:[a&&t.jsxs(t.Fragment,{children:[t.jsx(O,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(b,{children:"Question Expired"})}),t.jsx(q,{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(O,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(b,{children:"Question Closed"})}),t.jsx(q,{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(O,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(b,{children:"Question Closed"})}),t.jsx(q,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),x&&t.jsxs(t.Fragment,{children:[t.jsx(cs,{name:"icon-prediction"}),t.jsx(b,{children:"Stay tuned to see if your prediction was correct."})]}),T&&t.jsxs(t.Fragment,{children:[t.jsx(O,{"data-feedbackType":"correct",children:t.jsx(n.c1,{name:"correct"})}),t.jsx(b,{children:"That's for answering. Please stay tuned for the next question."})]}),(M||y)&&t.jsxs(t.Fragment,{children:[t.jsx(O,{"data-feedbackType":g,children:t.jsx(n.c1,{name:g})}),t.jsx("div",{children:t.jsxs(_,{children:[t.jsx(us,{"data-feedbackType":g,children:v==null?void 0:v.title}),t.jsx(b,{children:v==null?void 0:v.description})]})})]})]})},ms=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),hs=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),Is=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),fs=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ys=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),xs=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),js=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Ms=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),gs=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),le=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),Ts=()=>le,vs=n.styled_default(Ts())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Ns=()=>le,As=n.styled_default(Ns())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ds=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ss=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),ks=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),Es=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),Ls=()=>n.c1,ws=n.styled_default(Ls())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),Z={[n.QuestionImages.CENTERED]:e=>t.jsx(vs,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>t.jsx(Ms,{children:t.jsx(gs,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>t.jsx(As,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Cs=({questionType:e,hasCorrectAnswer:s,correct:i,youVoted:r,questionVoted:o})=>{if(e===n.QuestionType.POLL&&r)return"correct";if(e===n.QuestionType.PREDICTION){if(s&&o)return r?i?"correct":"incorrect":"unset";if(r)return"correct"}return e===n.QuestionType.TRIVIA&&o&&r?i?"correct":"incorrect":"unset"},bs=({questionType:e,questionVoted:s,correct:i,hasCorrectAnswer:r,questionStatus:o})=>e===n.QuestionType.TRIVIA?s&&i:e===n.QuestionType.PREDICTION?s&&i&&r||o===n.QuestionStatus.RESOLVED&&i:!1,zs=e=>{var s;const{id:i,icon:r,text:o,percentageDecimal:l,points:a,onVote:d,markThatVoted:c,youSelected:m,questionVoted:h,imageMode:p,answerTimeExpired:I,questionStatus:f,isLoading:N,questionType:x,correct:M,hasCorrectAnswer:y,votedAfterQuestionClosed:T,enteredAnActiveQuestion:g,marketClosed:v}=e,k=Cs(e),w=bs({questionType:x,questionVoted:h,correct:M,hasCorrectAnswer:y,questionStatus:f}),L=v&&x===n.QuestionType.PREDICTION,Q=h||L,j=x===n.QuestionType.PREDICTION&&!h&&f!==n.QuestionStatus.RESOLVED;return t.jsxs(ys,{value:i,"data-selected":m,"data-answer-state":k,disabled:h||N||I||L&&!g||L&&g&&T,"data-is-not-checked":h&&!m&&k!=="incorrect",onClick:D=>{c(x===n.QuestionType.PREDICTION?v:f===n.QuestionStatus.RESOLVED),d(D)},children:[t.jsx(xs,{"data-answer-state":k,style:{width:`${Q?l:0}%`}}),t.jsxs(js,{children:[r&&p&&((s=Z[p])==null?void 0:s.call(Z,r)),t.jsx(Ds,{children:o}),j&&t.jsxs("div",{children:[t.jsx(n.d,{value:a}),t.jsx(ks,{children:"pts"})]}),Q&&t.jsxs(Ss,{children:[w&&t.jsx(ws,{name:"selected"}),t.jsx(Es,{children:t.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var J=typeof window>"u"?u.useEffect:u.useLayoutEffect,Os=({isPlaying:e,duration:s,startAt:i=0,updateInterval:r=0,onComplete:o,onUpdate:l})=>{let[a,d]=u.useState(i),c=u.useRef(0),m=u.useRef(i),h=u.useRef(i*-1e3),p=u.useRef(null),I=u.useRef(null),f=u.useRef(null),N=y=>{let T=y/1e3;if(I.current===null){I.current=T,p.current=requestAnimationFrame(N);return}let g=T-I.current,v=c.current+g;I.current=T,c.current=v;let k=m.current+(r===0?v:(v/r|0)*r),w=m.current+v,L=typeof s=="number"&&w>=s;d(L?s:k),L||(p.current=requestAnimationFrame(N))},x=()=>{p.current&&cancelAnimationFrame(p.current),f.current&&clearTimeout(f.current),I.current=null},M=u.useCallback(y=>{x(),c.current=0;let T=typeof y=="number"?y:i;m.current=T,d(T),e&&(p.current=requestAnimationFrame(N))},[e,i]);return J(()=>{if(l==null||l(a),s&&a>=s){h.current+=s*1e3;let{shouldRepeat:y=!1,delay:T=0,newStartAt:g}=(o==null?void 0:o(h.current/1e3))||{};y&&(f.current=setTimeout(()=>M(g),T*1e3))}},[a,s]),J(()=>(e&&(p.current=requestAnimationFrame(N)),x),[e,s,r]),{elapsedTime:a,reset:M}},Qs=(e,s,i)=>{let r=e/2,o=s/2,l=r-o,a=2*l,d=i==="clockwise"?"1,0":"0,1",c=2*Math.PI*l;return{path:`m ${r},${o} a ${l},${l} 0 ${d} 0,${a} a ${l},${l} 0 ${d} 0,-${a}`,pathLength:c}},K=(e,s)=>e===0||e===s?0:typeof s=="number"?e-s:0,$s=e=>({position:"relative",width:e,height:e}),_s={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},de=(e,s,i,r,o)=>{if(r===0)return s;let l=(o?r-e:e)/r;return s+i*l},X=e=>{var s,i;return(i=(s=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,o,l,a)=>`#${o}${o}${l}${l}${a}${a}`).substring(1).match(/.{2}/g))==null?void 0:s.map(r=>parseInt(r,16)))!=null?i:[]},Rs=(e,s)=>{var i;let{colors:r,colorsTime:o,isSmoothColorTransition:l=!0}=e;if(typeof r=="string")return r;let a=(i=o==null?void 0:o.findIndex((I,f)=>I>=s&&s>=o[f+1]))!=null?i:-1;if(!o||a===-1)return r[0];if(!l)return r[a];let d=o[a]-s,c=o[a]-o[a+1],m=X(r[a]),h=X(r[a+1]),p=!!e.isGrowing;return`rgb(${m.map((I,f)=>de(d,I,h[f]-I,c,p)|0).join(",")})`},Ps=e=>{let{duration:s,initialRemainingTime:i,updateInterval:r,size:o=180,strokeWidth:l=12,trailStrokeWidth:a,isPlaying:d=!1,isGrowing:c=!1,rotation:m="clockwise",onComplete:h,onUpdate:p}=e,I=u.useRef(),f=Math.max(l,a??0),{path:N,pathLength:x}=Qs(o,f,m),{elapsedTime:M}=Os({isPlaying:d,duration:s,startAt:K(s,i),updateInterval:r,onUpdate:typeof p=="function"?T=>{let g=Math.ceil(s-T);g!==I.current&&(I.current=g,p(g))}:void 0,onComplete:typeof h=="function"?T=>{var g;let{shouldRepeat:v,delay:k,newInitialRemainingTime:w}=(g=h(T))!=null?g:{};if(v)return{shouldRepeat:v,delay:k,newStartAt:K(s,w)}}:void 0}),y=s-M;return{elapsedTime:M,path:N,pathLength:x,remainingTime:Math.ceil(y),rotation:m,size:o,stroke:Rs(e,y),strokeDashoffset:de(M,0,x,s,c),strokeWidth:l}},ce=e=>{let{children:s,strokeLinecap:i,trailColor:r,trailStrokeWidth:o}=e,{path:l,pathLength:a,stroke:d,strokeDashoffset:c,remainingTime:m,elapsedTime:h,size:p,strokeWidth:I}=Ps(e);return u.createElement("div",{style:$s(p)},u.createElement("svg",{viewBox:`0 0 ${p} ${p}`,width:p,height:p,xmlns:"http://www.w3.org/2000/svg"},u.createElement("path",{d:l,fill:"none",stroke:r??"#d9d9d9",strokeWidth:o??I}),u.createElement("path",{d:l,fill:"none",stroke:d,strokeLinecap:i??"round",strokeWidth:I,strokeDasharray:a,strokeDashoffset:c})),typeof s=="function"&&u.createElement("div",{style:_s},s({remainingTime:m,elapsedTime:h,color:d})))};ce.displayName="CountdownCircleTimer";const Us=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],qs=[10,10,1,0],Ys=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vs=n.E.SECONDARY_GREEN6,ee=n.E.SECONDARY_RED3,Ws=n.E.NEUTRALS_GRAY3,Fs=({isPlaying:e=!0,duration:s=30,onTimerExpired:i})=>{const[r,o]=u.useState(s>10?Vs:ee),l=({remainingTime:c})=>t.jsx(Ys,{children:c}),a=u.useCallback(()=>{i==null||i(),o(Ws)},[i,o]),d=u.useCallback(c=>{c===10&&o(ee)},[o]);return t.jsx(ce,{isPlaying:e,duration:s,colors:Us,colorsTime:qs,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:a,onUpdate:d,children:l})},Bs=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Gs=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Zs=()=>n.c1,Js=n.styled_default(Zs())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Ks=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Xs=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),et=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),st=({title:e,points:s,isPlayingTimer:i,isTimer:r,questionType:o,timerDuration:l,onTimerExpired:a})=>t.jsxs(Bs,{style:{justifyContent:o===n.QuestionType.PREDICTION?"center":"space-between"},children:[t.jsxs(Hs,{children:[e&&t.jsx(Gs,{children:e}),s!==void 0&&o!==n.QuestionType.POLL&&t.jsxs(t.Fragment,{children:[t.jsx(Js,{name:"icon-trophy"}),t.jsxs(Ks,{children:[t.jsx(Xs,{children:t.jsx(n.d,{value:s})}),t.jsx(et,{children:"PTS"})]})]})]}),r&&o!==n.QuestionType.PREDICTION&&t.jsx(Fs,{isPlaying:i,onTimerExpired:a,duration:l})]}),tt=({openedQuestion:e,isLoading:s,vote:i,close:r})=>{var o,l;const a=e.subject,d=e.type,c=e.status,m=(o=e.options)==null?void 0:o.options,h=e.marketClosed,[p,I]=u.useState(!1),[f,N]=u.useState(!1),[x,M]=u.useState(!0),[y,T]=u.useState(!1),[g,v]=u.useState(""),k=e==null?void 0:e.id;u.useEffect(()=>{d===n.QuestionType.PREDICTION?h&&M(!1):c===n.QuestionStatus.RESOLVED&&M(!1)},[]);const w=u.useCallback(A=>{N(A),I(!0)},[]),L=u.useCallback(async A=>{if(k){const z=A.currentTarget.value;v(z),await i(k,z)}},[k,v,i]),Q=u.useCallback(()=>{T(!0),setTimeout(r,3e3)},[r]),j=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.youVoted===!0),[e]),D=u.useMemo(()=>!!(e!=null&&e.answers.find(A=>A.correct===!0)),[e]),E=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.correct===!0),[e]),Ie=u.useMemo(()=>e?e.answers.map(A=>{var z;return{...A,questionVoted:!!j,youSelected:g===A.id,isLoading:s,hasCorrectAnswer:D,questionType:e.type,answerTimeExpired:y,questionStatus:c,imageMode:(z=e.appearance)==null?void 0:z.images,onVote:L}}):[],[D,y,s,e,j,c,L,g]),fe=m&&(m.case==="trivia"||m.case==="prediction")?m.value:void 0,C=c===n.QuestionStatus.RESOLVED&&d===n.QuestionType.TRIVIA&&!j&&!x,B=d===n.QuestionType.TRIVIA&&f&&p&&x,H=u.useMemo(()=>d===n.QuestionType.PREDICTION?!!(j&&!D||j&&D&&E!=null&&E.youVoted):!0,[d,j,D,E]),ye=u.useMemo(()=>{if(d===n.QuestionType.PREDICTION&&j&&(!D||D&&E!=null&&E.youVoted))return j.points;if(!(C||y))return c===n.QuestionStatus.RESOLVED?0:j?j.correct?j.points:0:E==null?void 0:E.points},[y,j,E,c,C,d,D]),xe=u.useMemo(()=>d===n.QuestionType.PREDICTION&&j?D?D&&E!=null&&E.youVoted?"You won":"":"To win":C||y?"Time expired":d===n.QuestionType.POLL?"Time remaining":j?"You won":"To win",[y,d,j,C,D,E]),je=j||C||B||d===n.QuestionType.TRIVIA&&c===n.QuestionStatus.RESOLVED&&x;return t.jsx(n.r,{"data-question-header":"true",children:t.jsx(ms,{children:t.jsxs(hs,{children:[t.jsx(ps,{feedbackMessages:fe,questionVoted:!!j,questionVotedCorrectly:j==null?void 0:j.correct,questionType:d,hasCorrectAnswer:D,questionStatus:c,showExpiredNotification:C,showClosedNotificationTrivia:B,votedInCurrentRender:p,votedAfterQuestionClosed:f,enteredAnActiveQuestion:x,marketClosed:h}),H&&t.jsx(st,{title:xe,points:ye,onTimerExpired:Q,questionType:e.type,isTimer:!s,isPlayingTimer:!j,timerDuration:je?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),y?t.jsx(as,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):t.jsxs(t.Fragment,{children:[t.jsx(Is,{style:H?{}:{marginTop:0},children:a}),t.jsx(fs,{children:Ie.map(A=>t.jsx(zs,{...A,markThatVoted:w,votedAfterQuestionClosed:f,enteredAnActiveQuestion:x,marketClosed:h},A.id))})]})]})})})},nt=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),it=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ot=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),rt=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),at=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),lt=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),ue=({created:e,image:s,title:i,isPickHistory:r,instantView:o,notification:l})=>{const a=u.useMemo(()=>{if(e){const c=new Date(e);if(F(c))return{date:V(c),time:W(c)}}return null},[e]),d=(o==null?void 0:o.image)||s;return t.jsxs(nt,{children:[a&&t.jsxs(at,{children:[a.date," · ",a.time]}),(o==null?void 0:o.video)&&t.jsx(n.w,{source:o.video.url,poster:o.video.thumbnailUrl}),d&&!(o!=null&&o.video)&&t.jsx(lt,{src:d}),t.jsxs(it,{children:[t.jsx(ot,{children:r?i:o==null?void 0:o.heading}),t.jsx(rt,{children:r?l==null?void 0:l.body:o==null?void 0:o.body})]})]})},dt=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ct=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ut=({instantView:e,...s})=>t.jsxs(dt,{children:[t.jsx(ue,{instantView:e,...s}),(e==null?void 0:e.webLink)&&t.jsxs(ct,{href:e==null?void 0:e.webLink.url,target:"_blank",children:[e==null?void 0:e.webLink.label,t.jsx(n.c1,{name:"icon-external-link"})]})]}),pt=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),mt=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),ht=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),It=({created:e,...s})=>{const i=u.useMemo(()=>{if(e){const r=new Date(e);if(F(r))return{date:V(r),time:W(r)}}return null},[e]);return t.jsxs(pt,{children:[i&&t.jsxs(mt,{children:[i.date," · ",i.time]}),s.title&&t.jsx(ht,{children:s.title}),t.jsx(n.u,{...s})]})},ft=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),yt=({openedQuestion:e})=>{var s,i;return((s=e==null?void 0:e.attributes)==null?void 0:s.attributes.case)==="insight"?t.jsx(ut,{created:e.attributes.created,...e.attributes.attributes.value}):((i=e==null?void 0:e.attributes)==null?void 0:i.attributes.case)==="tweet"?t.jsx(It,{created:e.attributes.created,...e.attributes.attributes.value}):null},xt=({extendedQuestion:e,vote:s,close:i})=>{const{loading:r,data:o}=e;return o?t.jsx(tt,{vote:s,close:i,openedQuestion:o,isLoading:!!r}):null},jt=({gamification:e})=>{var s;const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const o=i.type;return t.jsxs(ft,{children:[t.jsx(ie,{close:e.closeQuestion,type:((s=i.attributes)==null?void 0:s.type)||n.QuestionType.UNSET}),o==="question"&&t.jsx(xt,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:r}),o!=="question"&&t.jsx(yt,{openedQuestion:i}),t.jsx(ns,{sponsorLogo:""})]})},Mt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),gt=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),Tt=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),vt=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var P=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(P||{});const se=({title:e,active:s,onClick:i})=>t.jsx(Tt,{onClick:i,"data-selected":s,children:t.jsx(vt,{children:e})}),Nt=({activePage:e="home",toggleActivePage:s})=>t.jsx(Mt,{children:t.jsxs(gt,{"data-position":e==="home"?"left":"right",children:[t.jsx(se,{title:"Home",active:e==="home",onClick:()=>s("home")}),t.jsx(se,{title:"Friends",active:e==="leaderboard",onClick:()=>s("leaderboard")})]})});function At(e){var s=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,r=e.startIndex,o=e.stopIndex;return!(r>i||o<s)}function Dt(e){for(var s=e.isItemLoaded,i=e.itemCount,r=e.minimumBatchSize,o=e.startIndex,l=e.stopIndex,a=[],d=null,c=null,m=o;m<=l;m++){var h=s(m);h?c!==null&&(a.push(d,c),d=c=null):(c=m,d===null&&(d=m))}if(c!==null){for(var p=Math.min(Math.max(c,d+r-1),i-1),I=c+1;I<=p&&!s(I);I++)c=I;a.push(d,c)}if(a.length)for(;a[1]-a[0]+1<r&&a[0]>0;){var f=a[0]-1;if(!s(f))a[0]=f;else break}return a}var St=function(e,s){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")},kt=function(){function e(s,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(s,o.key,o)}}return function(s,i,r){return i&&e(s.prototype,i),r&&e(s,r),s}}(),Et=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)},te=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};(function(e){Et(s,e);function s(){var i,r,o,l;St(this,s);for(var a=arguments.length,d=Array(a),c=0;c<a;c++)d[c]=arguments[c];return l=(r=(o=te(this,(i=s.__proto__||Object.getPrototypeOf(s)).call.apply(i,[this].concat(d))),o),o._lastRenderedStartIndex=-1,o._lastRenderedStopIndex=-1,o._memoizedUnloadedRanges=[],o._onItemsRendered=function(m){var h=m.visibleStartIndex,p=m.visibleStopIndex;o._lastRenderedStartIndex=h,o._lastRenderedStopIndex=p,o._ensureRowsLoaded(h,p)},o._setRef=function(m){o._listRef=m},r),te(o,l)}return kt(s,[{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 l=this.props,a=l.isItemLoaded,d=l.itemCount,c=l.minimumBatchSize,m=c===void 0?10:c,h=l.threshold,p=h===void 0?15:h,I=Dt({isItemLoaded:a,itemCount:d,minimumBatchSize:m,startIndex:Math.max(0,r-p),stopIndex:Math.min(d-1,o+p)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(f,N){return I[N]!==f}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(r){for(var o=this,l=this.props.loadMoreItems||this.props.loadMoreRows,a=function(m){var h=r[m],p=r[m+1],I=l(h,p);I!=null&&I.then(function(){if(At({lastRenderedStartIndex:o._lastRenderedStartIndex,lastRenderedStopIndex:o._lastRenderedStopIndex,startIndex:h,stopIndex:p})){if(o._listRef==null)return;typeof o._listRef.resetAfterIndex=="function"?o._listRef.resetAfterIndex(h,!0):(typeof o._listRef._getItemStyleCache=="function"&&o._listRef._getItemStyleCache(-1),o._listRef.forceUpdate())}})},d=0;d<r.length;d+=2)a(d)}}]),s})(u.PureComponent);const Lt=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),wt=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ct=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),bt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),zt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ot=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Qt=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),$t=()=>n.c1,_t=n.styled_default($t())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0});var pe={exports:{}},Rt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Pt=Rt,Ut=Pt;function me(){}function he(){}he.resetWarningCache=me;var qt=function(){function e(r,o,l,a,d,c){if(c!==Ut){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}e.isRequired=e;function s(){return e}var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:s,element:e,elementType:e,instanceOf:s,node:e,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:he,resetWarningCache:me};return i.PropTypes=i,i};pe.exports=qt();var Yt=pe.exports;const S=n.getDefaultExportFromCjs(Yt);class Y extends u.Component{constructor(s){super(s),this.scrollListener=this.scrollListener.bind(this),this.eventListenerOptions=this.eventListenerOptions.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this)}componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}componentDidUpdate(){if(this.props.isReverse&&this.loadMore){const s=this.getParentElement(this.scrollComponent);s.scrollTop=s.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let s=!1;const i={get passive(){s=!0}};try{document.addEventListener("test",null,i),document.removeEventListener("test",null,i)}catch{}return s}eventListenerOptions(){let s=this.props.useCapture;return this.isPassiveSupported()?s={useCapture:this.props.useCapture,passive:!0}:s={passive:!1},s}setDefaultLoader(s){this.defaultLoader=s}detachMousewheelListener(){let s=window;this.props.useWindow===!1&&(s=this.scrollComponent.parentNode),s.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let s=window;this.props.useWindow===!1&&(s=this.getParentElement(this.scrollComponent)),s.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),s.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(s){const i=this.props.getScrollParent&&this.props.getScrollParent();return i??(s&&s.parentNode)}filterProps(s){return s}attachScrollListener(){const s=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!s)return;let i=window;this.props.useWindow===!1&&(i=s),i.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),i.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),i.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(s){s.deltaY===1&&!this.isPassiveSupported()&&s.preventDefault()}scrollListener(){const s=this.scrollComponent,i=window,r=this.getParentElement(s);let o;if(this.props.useWindow){const l=document.documentElement||document.body.parentNode||document.body,a=i.pageYOffset!==void 0?i.pageYOffset:l.scrollTop;this.props.isReverse?o=a:o=this.calculateOffset(s,a)}else this.props.isReverse?o=r.scrollTop:o=s.scrollHeight-r.scrollTop-r.clientHeight;o<Number(this.props.threshold)&&s&&s.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=r.scrollHeight,this.beforeScrollTop=r.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(s,i){return s?this.calculateTopPosition(s)+(s.offsetHeight-i-window.innerHeight):0}calculateTopPosition(s){return s?s.offsetTop+this.calculateTopPosition(s.offsetParent):0}render(){const s=this.filterProps(this.props),{children:i,element:r,hasMore:o,initialLoad:l,isReverse:a,loader:d,loadMore:c,pageStart:m,ref:h,threshold:p,useCapture:I,useWindow:f,getScrollParent:N,...x}=s;x.ref=y=>{this.scrollComponent=y,h&&h(y)};const M=[i];return o&&(d?a?M.unshift(d):M.push(d):this.defaultLoader&&(a?M.unshift(this.defaultLoader):M.push(this.defaultLoader))),u.createElement(r,x,M)}}U(Y,"propTypes",{children:S.node.isRequired,element:S.node,hasMore:S.bool,initialLoad:S.bool,isReverse:S.bool,loader:S.node,loadMore:S.func.isRequired,pageStart:S.number,ref:S.func,getScrollParent:S.func,threshold:S.number,useCapture:S.bool,useWindow:S.bool}),U(Y,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const Vt=({rank:e,avatar:s,name:i,points:r,isCurrentUser:o,openItemDetail:l,style:a})=>t.jsxs(Lt,{onClick:l,style:a,children:[t.jsx(wt,{children:e||0}),t.jsxs(zt,{children:[s?t.jsx(Ct,{alt:"leaderboard-item-avatar",src:s}):t.jsx(bt,{children:oe(i||"")}),t.jsxs(Ot,{children:[t.jsx(Qt,{children:i||""}),o&&t.jsx(_t,{name:"icon-star"})]})]}),t.jsx("div",{children:re(r)})]}),Wt=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),Ft=({items:e,currentUserId:s,openItemDetail:i,fetchMore:r,scrollNode:o,hasMore:l})=>t.jsx(Y,{loadMore:r,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>o.current,children:t.jsx(Wt,{children:e.map(a=>t.jsx(Vt,{...a,openItemDetail:()=>i(a.userId),isCurrentUser:!!s&&s===a.userId},a.userId))})}),Bt=({deepLink:e})=>{const{data:s}=n.useStore(e.$store);return t.jsx(n.O,{inviteLink:s,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."})},Ht=({gamification:e,scrollNode:s,scrollStore:i})=>{const{data:r,hasMore:o}=n.useStore(e.leaderboardList.$store);return r!=null&&r.length?t.jsx(Ft,{items:r,scrollNode:s,scrollStore:i,fetchMore:e.leaderboardList.fetchMore,hasMore:o,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):t.jsx(Bt,{deepLink:e.deepLink})},Gt=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Zt=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Jt=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Kt=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Xt=()=>n.c1,R=n.styled_default(Xt())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),en=()=>n.c1,sn=n.styled_default(en())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),tn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),nn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),on=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),rn={[n.PickHistoryStatus.LOST]:t.jsx(R,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:t.jsx(R,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:t.jsx(R,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:t.jsx(R,{name:"icon-arrow"})},an=({questionId:e,questionType:s,questionStatus:i,subject:r,openForVoting:o,openQuestion:l,status:a})=>{const d=n.o[s],c=rn[a];return d?t.jsxs(Gt,{onClick:()=>l==null?void 0:l(e),children:[t.jsxs(nn,{children:[t.jsxs(Zt,{children:[t.jsx(sn,{"data-type-trivia":s===n.QuestionType.TRIVIA,"data-type-poll":s===n.QuestionType.POLL,name:d.iconName}),t.jsxs(tn,{children:[d.label,s===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),t.jsx(Jt,{children:r||""})]}),t.jsx(Kt,{children:o?t.jsx(on,{children:"Play"}):c})]}):null},ln=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),dn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),cn=({openInsight:e,questionId:s,...i})=>t.jsxs(ln,{children:[t.jsx(ue,{questionId:s,...i,isPickHistory:!0}),e&&t.jsx(dn,{onClick:()=>e(s),children:"View Insight"})]}),un=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),pn=()=>n.c,mn=n.styled_default(pn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),hn=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),In=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),fn=({openTweet:e,created:s,...i})=>{const r=u.useMemo(()=>{if(s){const o=new Date(s);if(F(o))return{date:V(o),time:W(o)}}return null},[s]);return t.jsxs(un,{children:[r&&t.jsxs(hn,{children:[r.date," · ",r.time]}),i.title&&t.jsx(In,{children:i.title}),t.jsx(n.u,{...i}),e&&t.jsx(mn,{onClick:()=>e(i.tweetId),children:"View Insight"})]})},yn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),xn=({questions:e,openQuestion:s})=>t.jsx(yn,{children:e==null?void 0:e.map(i=>{var r,o,l;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const a=i.attributes.attributes.value;return t.jsx(an,{openQuestion:s,...a},a.questionId)}if(i.type==="insight"&&((o=i.attributes)==null?void 0:o.attributes.case)==="insight"){const a=i.attributes.attributes.value,d=i.attributes.created;return t.jsx(cn,{openInsight:s,...a,created:d},a.questionId)}if(i.type==="tweet"&&((l=i.attributes)==null?void 0:l.attributes.case)==="tweet"){const a=i.attributes.attributes.value,d=i.attributes.id,c=i.attributes.created;return t.jsx(fn,{openTweet:s,...a,tweetId:d,created:c},d)}return null})}),jn=({store:e,openQuestion:s})=>{const i=n.useStore(e);return i!=null&&i.data?t.jsx(xn,{openQuestion:s,questions:i.data}):t.jsx("div",{children:"wait questions..."})},Mn=({userSummary:e})=>{var s;const[i,r]=u.useState(void 0);return u.useEffect(()=>{const o=e.subscribe(l=>{l!=null&&l.data&&r(l.data)});return()=>{o()}},[e]),i!=null&&i.summary?t.jsx(ae,{...i.summary,successRate:(s=i.percentage)==null?void 0:s.correct}):t.jsx("div",{children:"wait user..."})},gn=({gamification:e,className:s,scrollStore:i,scrollNode:r})=>{const[o,l]=u.useState(!1),[a,d]=u.useState(P.HOME),[,c]=u.useTransition(),m=p=>{c(()=>d(p))},h=p=>{c(()=>l(p))};return u.useEffect(()=>i.listen(p=>{if(p.scrollPosition===0){h(!1),i.setKey("tabsShown",!1);return}h(p.scrollDirection==="forward"),i.setKey("tabsShown",p.scrollDirection!=="forward")}),[i]),t.jsxs("div",{className:s,children:[t.jsx(n.a,{style:{paddingBottom:"8px",position:"sticky",transition:"top calc(var(--animation-duration) / 2) var(--animation-function)",top:o?"-60px":"0px"},children:t.jsx(Nt,{activePage:a,toggleActivePage:m})}),a===P.HOME&&t.jsxs(t.Fragment,{children:[t.jsx(n.a,{style:{paddingTop:"8px"},children:t.jsx(Mn,{userSummary:e.userSummary})}),t.jsx(n.n,{children:t.jsx(jn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),a===P.LEADERBOARD&&t.jsx(n.a,{style:{paddingTop:"8px"},children:t.jsx(Ht,{scrollStore:i,scrollNode:r,gamification:e})})]})},Tn=()=>n.x,ne=n.styled_default(Tn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),vn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Nn=({correct:e,incorrect:s})=>{const i=e+s;return i===0?0:Math.round(e/i*100)},An=({gamification:e,scrollStore:s,className:i,appNode:r,scrollNode:o})=>{const l=n.useStore(e.openedQuestion.$store),a=n.useStore(e.openedUser);return t.jsxs(t.Fragment,{children:[l&&r.current&&n.Pk.createPortal(t.jsx(ne,{className:i,children:t.jsx(jt,{gamification:e})}),r.current),a&&r.current&&n.Pk.createPortal(t.jsx(ne,{className:i,children:t.jsxs(vn,{children:[t.jsx(ie,{label:"Friend's Rank",close:e.closeUser}),t.jsx(n.a,{children:t.jsx(ae,{...a,successRate:Nn(a)})})]})}),r.current),t.jsx(gn,{scrollStore:s,scrollNode:o,className:i,gamification:e})]})};exports.default=An;
|
|
1
|
+
"use strict";var Ne=Object.defineProperty;var Te=(e,s,i)=>s in e?Ne(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i;var Y=(e,s,i)=>(Te(e,typeof s!="symbol"?s+"":s,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("./masters.js"),u=require("react"),ge=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),De=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),fe=()=>n.c1,Ae=n.styled_default(fe())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ve=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ee=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Le=()=>n.c1,ze=n.styled_default(Le())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ie=({type:e,close:s,label:i})=>{const r=e?n.o[e]:{label:i,iconName:void 0};return t.jsxs(ge,{children:[t.jsxs(De,{children:[(r==null?void 0:r.iconName)&&t.jsx(Ae,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:r.iconName}),(r==null?void 0:r.label)&&t.jsx(ve,{children:r.label})]}),t.jsx(Ee,{onClick:s,children:t.jsx(ze,{name:"icon-cross"})})]})},oe=e=>e.split(/\s+/).map(s=>s[0]).join("").toUpperCase(),re=e=>e?e.toLocaleString("en-US"):"0",V=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),W=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),F=e=>!isNaN(e.getTime()),Oe=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Se=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Ce=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),Z=({indicator:e,title:s})=>t.jsxs(Oe,{children:[t.jsx(Se,{children:s}),t.jsx(Ce,{children:e})]}),ke=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),we=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Qe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:s})=>t.jsxs(ke,{children:[t.jsx(we,{children:e}),t.jsx(Qe,{children:s})]}),be=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),$e=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),_e=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Re=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ue=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ye=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Pe=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),qe=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ve=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),We=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Fe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Be=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),He=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ge=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",props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w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",ae=({avatar:e,name:s,points:i,friendsRank:r,rank:o,streak:l,correct:a,incorrect:d,inTop:c,successRate:M})=>t.jsxs(be,{children:[t.jsx($e,{children:t.jsxs(Re,{children:[t.jsxs(Xe,{children:[e&&t.jsx(Ue,{alt:"avatar",src:e}),!e&&t.jsx(Je,{children:oe(s||"")})]}),t.jsxs(Ye,{children:[t.jsx(Pe,{children:s}),t.jsxs(qe,{children:[t.jsxs(We,{children:[t.jsx(Ve,{alt:"rank-icon",src:Ke}),t.jsxs(Fe,{children:[re(i),t.jsx(Be,{children:"PTS"})]})]}),t.jsx(He,{}),t.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),t.jsxs(_e,{children:[t.jsxs(Ze,{children:[t.jsx(Z,{indicator:r||0,title:"Friends rank"}),t.jsx(Z,{indicator:o||0,title:"Global rank"})]}),t.jsxs(Ge,{children:[t.jsx($,{indicator:l||0,title:"Win streak"}),t.jsx($,{indicator:a||0,title:"Correct"}),t.jsx($,{indicator:d||0,title:"Incorrect"}),t.jsx($,{indicator:`${M||0}%`,title:"Succ. rate"})]})]})]}),es=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),ss=()=>n.c1,ts=n.styled_default(ss())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),ns=()=>t.jsx(es,{children:t.jsx(ts,{name:"mastersLogo"})}),is=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),os=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),rs=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),as=({title:e,description:s})=>t.jsxs(is,{children:[t.jsx(n.c1,{name:"icon-check-circle"}),t.jsx(os,{children:e}),t.jsx(rs,{children:s})]}),ls=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ds=()=>n.c1,cs=n.styled_default(ds())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),Q=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),_=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),us=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),k=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),P=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ps=({feedbackMessages:e,questionVotedCorrectly:s,questionVoted:i,questionType:r,hasCorrectAnswer:o,questionStatus:l,showExpiredNotification:a,showClosedNotificationTrivia:d,votedInCurrentRender:c,votedAfterQuestionClosed:M,enteredAnActiveQuestion:I,marketClosed:p})=>{const j=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION)&&c&&l!==n.QuestionStatus.RESOLVED,x=r===n.QuestionType.PREDICTION&&!o,f=p&&r===n.QuestionType.PREDICTION&&!i&&!I||r===n.QuestionType.PREDICTION&&M&&c&&I,y=j&&x,N=j&&o,m=r===n.QuestionType.PREDICTION&&i&&c&&o,g=i&&r===n.QuestionType.POLL&&c;if(!a&&!d&&!y&&!N&&!f&&!g&&!m)return null;const T=s?"correct":"incorrect",D=s?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return t.jsxs(ls,{"data-isPrediction":x,children:[a&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(k,{children:"Question Expired"})}),t.jsx(P,{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(Q,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(k,{children:"Question Closed"})}),t.jsx(P,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),f&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{children:t.jsx(n.c1,{name:"questionExpired"})}),t.jsxs("div",{children:[t.jsx(_,{children:t.jsx(k,{children:"Question Closed"})}),t.jsx(P,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),y&&t.jsxs(t.Fragment,{children:[t.jsx(cs,{name:"icon-prediction"}),t.jsx(k,{children:"Stay tuned to see if your prediction was correct."})]}),g&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{"data-feedbackType":"correct",children:t.jsx(n.c1,{name:"correct"})}),t.jsx(k,{children:"That's for answering. Please stay tuned for the next question."})]}),(N||m)&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{"data-feedbackType":T,children:t.jsx(n.c1,{name:T})}),t.jsx("div",{children:t.jsxs(_,{children:[t.jsx(us,{"data-feedbackType":T,children:D==null?void 0:D.title}),t.jsx(k,{children:D==null?void 0:D.description})]})})]})]})},Ms=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),Is=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),js=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),xs=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ms=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),ys=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),hs=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Ns=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Ts=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),le=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),gs=()=>le,Ds=n.styled_default(gs())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),fs=()=>le,As=n.styled_default(fs())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),vs=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Es=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Ls=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),zs=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),Os=()=>n.c1,Ss=n.styled_default(Os())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>t.jsx(Ds,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>t.jsx(Ns,{children:t.jsx(Ts,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>t.jsx(As,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Cs=({questionType:e,hasCorrectAnswer:s,correct:i,youVoted:r,questionVoted:o})=>{if(e===n.QuestionType.POLL&&r)return"correct";if(e===n.QuestionType.PREDICTION){if(s&&o)return r?i?"correct":"incorrect":"unset";if(r)return"correct"}return e===n.QuestionType.TRIVIA&&o&&r?i?"correct":"incorrect":"unset"},ks=({questionType:e,questionVoted:s,correct:i,hasCorrectAnswer:r,questionStatus:o})=>e===n.QuestionType.TRIVIA?s&&i:e===n.QuestionType.PREDICTION?s&&i&&r||o===n.QuestionStatus.RESOLVED&&i:!1,ws=e=>{var s;const{id:i,icon:r,text:o,percentageDecimal:l,points:a,onVote:d,markThatVoted:c,youSelected:M,questionVoted:I,imageMode:p,answerTimeExpired:j,questionStatus:x,isLoading:f,questionType:y,correct:N,hasCorrectAnswer:m,votedAfterQuestionClosed:g,enteredAnActiveQuestion:T,marketClosed:D}=e,L=Cs(e),S=ks({questionType:y,questionVoted:I,correct:N,hasCorrectAnswer:m,questionStatus:x}),O=D&&y===n.QuestionType.PREDICTION,b=I||O,h=y===n.QuestionType.PREDICTION&&!I&&x!==n.QuestionStatus.RESOLVED;return t.jsxs(ms,{value:i,"data-selected":M,"data-answer-state":L,disabled:I||f||j||O&&!T||O&&T&&g,"data-is-not-checked":I&&!M&&L!=="incorrect",onClick:v=>{c(y===n.QuestionType.PREDICTION?D:x===n.QuestionStatus.RESOLVED),d(v)},children:[t.jsx(ys,{"data-answer-state":L,style:{width:`${b?l:0}%`}}),t.jsxs(hs,{children:[r&&p&&((s=G[p])==null?void 0:s.call(G,r)),t.jsx(vs,{children:o}),h&&t.jsxs("div",{children:[t.jsx(n.d,{value:a}),t.jsx(Ls,{children:"pts"})]}),b&&t.jsxs(Es,{children:[S&&t.jsx(Ss,{name:"selected"}),t.jsx(zs,{children:t.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var J=typeof window>"u"?u.useEffect:u.useLayoutEffect,Qs=({isPlaying:e,duration:s,startAt:i=0,updateInterval:r=0,onComplete:o,onUpdate:l})=>{let[a,d]=u.useState(i),c=u.useRef(0),M=u.useRef(i),I=u.useRef(i*-1e3),p=u.useRef(null),j=u.useRef(null),x=u.useRef(null),f=m=>{let g=m/1e3;if(j.current===null){j.current=g,p.current=requestAnimationFrame(f);return}let T=g-j.current,D=c.current+T;j.current=g,c.current=D;let L=M.current+(r===0?D:(D/r|0)*r),S=M.current+D,O=typeof s=="number"&&S>=s;d(O?s:L),O||(p.current=requestAnimationFrame(f))},y=()=>{p.current&&cancelAnimationFrame(p.current),x.current&&clearTimeout(x.current),j.current=null},N=u.useCallback(m=>{y(),c.current=0;let g=typeof m=="number"?m:i;M.current=g,d(g),e&&(p.current=requestAnimationFrame(f))},[e,i]);return J(()=>{if(l==null||l(a),s&&a>=s){I.current+=s*1e3;let{shouldRepeat:m=!1,delay:g=0,newStartAt:T}=(o==null?void 0:o(I.current/1e3))||{};m&&(x.current=setTimeout(()=>N(T),g*1e3))}},[a,s]),J(()=>(e&&(p.current=requestAnimationFrame(f)),y),[e,s,r]),{elapsedTime:a,reset:N}},bs=(e,s,i)=>{let r=e/2,o=s/2,l=r-o,a=2*l,d=i==="clockwise"?"1,0":"0,1",c=2*Math.PI*l;return{path:`m ${r},${o} a ${l},${l} 0 ${d} 0,${a} a ${l},${l} 0 ${d} 0,-${a}`,pathLength:c}},X=(e,s)=>e===0||e===s?0:typeof s=="number"?e-s:0,$s=e=>({position:"relative",width:e,height:e}),_s={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},de=(e,s,i,r,o)=>{if(r===0)return s;let l=(o?r-e:e)/r;return s+i*l},K=e=>{var s,i;return(i=(s=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,o,l,a)=>`#${o}${o}${l}${l}${a}${a}`).substring(1).match(/.{2}/g))==null?void 0:s.map(r=>parseInt(r,16)))!=null?i:[]},Rs=(e,s)=>{var i;let{colors:r,colorsTime:o,isSmoothColorTransition:l=!0}=e;if(typeof r=="string")return r;let a=(i=o==null?void 0:o.findIndex((j,x)=>j>=s&&s>=o[x+1]))!=null?i:-1;if(!o||a===-1)return r[0];if(!l)return r[a];let d=o[a]-s,c=o[a]-o[a+1],M=K(r[a]),I=K(r[a+1]),p=!!e.isGrowing;return`rgb(${M.map((j,x)=>de(d,j,I[x]-j,c,p)|0).join(",")})`},Us=e=>{let{duration:s,initialRemainingTime:i,updateInterval:r,size:o=180,strokeWidth:l=12,trailStrokeWidth:a,isPlaying:d=!1,isGrowing:c=!1,rotation:M="clockwise",onComplete:I,onUpdate:p}=e,j=u.useRef(),x=Math.max(l,a??0),{path:f,pathLength:y}=bs(o,x,M),{elapsedTime:N}=Qs({isPlaying:d,duration:s,startAt:X(s,i),updateInterval:r,onUpdate:typeof p=="function"?g=>{let T=Math.ceil(s-g);T!==j.current&&(j.current=T,p(T))}:void 0,onComplete:typeof I=="function"?g=>{var T;let{shouldRepeat:D,delay:L,newInitialRemainingTime:S}=(T=I(g))!=null?T:{};if(D)return{shouldRepeat:D,delay:L,newStartAt:X(s,S)}}:void 0}),m=s-N;return{elapsedTime:N,path:f,pathLength:y,remainingTime:Math.ceil(m),rotation:M,size:o,stroke:Rs(e,m),strokeDashoffset:de(N,0,y,s,c),strokeWidth:l}},ce=e=>{let{children:s,strokeLinecap:i,trailColor:r,trailStrokeWidth:o}=e,{path:l,pathLength:a,stroke:d,strokeDashoffset:c,remainingTime:M,elapsedTime:I,size:p,strokeWidth:j}=Us(e);return u.createElement("div",{style:$s(p)},u.createElement("svg",{viewBox:`0 0 ${p} ${p}`,width:p,height:p,xmlns:"http://www.w3.org/2000/svg"},u.createElement("path",{d:l,fill:"none",stroke:r??"#d9d9d9",strokeWidth:o??j}),u.createElement("path",{d:l,fill:"none",stroke:d,strokeLinecap:i??"round",strokeWidth:j,strokeDasharray:a,strokeDashoffset:c})),typeof s=="function"&&u.createElement("div",{style:_s},s({remainingTime:M,elapsedTime:I,color:d})))};ce.displayName="CountdownCircleTimer";const Ys=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],Ps=[10,10,1,0],qs=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vs=n.E.SECONDARY_GREEN6,ee=n.E.SECONDARY_RED3,Ws=n.E.NEUTRALS_GRAY3,Fs=({isPlaying:e=!0,duration:s=30,onTimerExpired:i})=>{const[r,o]=u.useState(s>10?Vs:ee),l=({remainingTime:c})=>t.jsx(qs,{children:c}),a=u.useCallback(()=>{i==null||i(),o(Ws)},[i,o]),d=u.useCallback(c=>{c===10&&o(ee)},[o]);return t.jsx(ce,{isPlaying:e,duration:s,colors:Ys,colorsTime:Ps,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:a,onUpdate:d,children:l})},Bs=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Zs=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Gs=()=>n.c1,Js=n.styled_default(Gs())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Xs=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Ks=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),et=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),st=({title:e,points:s,isPlayingTimer:i,isTimer:r,questionType:o,timerDuration:l,onTimerExpired:a})=>t.jsxs(Bs,{style:{justifyContent:o===n.QuestionType.PREDICTION?"center":"space-between"},children:[t.jsxs(Hs,{children:[e&&t.jsx(Zs,{children:e}),s!==void 0&&o!==n.QuestionType.POLL&&t.jsxs(t.Fragment,{children:[t.jsx(Js,{name:"icon-trophy"}),t.jsxs(Xs,{children:[t.jsx(Ks,{children:t.jsx(n.d,{value:s})}),t.jsx(et,{children:"PTS"})]})]})]}),r&&o!==n.QuestionType.PREDICTION&&t.jsx(Fs,{isPlaying:i,onTimerExpired:a,duration:l})]}),tt=({openedQuestion:e,isLoading:s,vote:i,close:r})=>{var o,l;const a=e.subject,d=e.type,c=e.status,M=(o=e.options)==null?void 0:o.options,I=e.marketClosed,[p,j]=u.useState(!1),[x,f]=u.useState(!1),[y,N]=u.useState(!0),[m,g]=u.useState(!1),[T,D]=u.useState(""),L=e==null?void 0:e.id;u.useEffect(()=>{d===n.QuestionType.PREDICTION?I&&N(!1):c===n.QuestionStatus.RESOLVED&&N(!1)},[]);const S=u.useCallback(A=>{f(A),j(!0)},[]),O=u.useCallback(async A=>{if(L){const w=A.currentTarget.value;D(w),await i(L,w)}},[L,D,i]),b=u.useCallback(()=>{g(!0),setTimeout(r,3e3)},[r]),h=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.youVoted===!0),[e]),v=u.useMemo(()=>!!(e!=null&&e.answers.find(A=>A.correct===!0)),[e]),z=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.correct===!0),[e]),je=u.useMemo(()=>e?e.answers.map(A=>{var w;return{...A,questionVoted:!!h,youSelected:T===A.id,isLoading:s,hasCorrectAnswer:v,questionType:e.type,answerTimeExpired:m,questionStatus:c,imageMode:(w=e.appearance)==null?void 0:w.images,onVote:O}}):[],[v,m,s,e,h,c,O,T]),xe=M&&(M.case==="trivia"||M.case==="prediction")?M.value:void 0,C=c===n.QuestionStatus.RESOLVED&&d===n.QuestionType.TRIVIA&&!h&&!y,B=d===n.QuestionType.TRIVIA&&x&&p&&y,H=u.useMemo(()=>d===n.QuestionType.PREDICTION?!!(h&&!v||h&&v&&z!=null&&z.youVoted):!0,[d,h,v,z]),me=u.useMemo(()=>{if(d===n.QuestionType.PREDICTION&&h&&(!v||v&&z!=null&&z.youVoted))return h.points;if(!(C||m))return c===n.QuestionStatus.RESOLVED?0:h?h.correct?h.points:0:z==null?void 0:z.points},[m,h,z,c,C,d,v]),ye=u.useMemo(()=>d===n.QuestionType.PREDICTION&&h?v?v&&z!=null&&z.youVoted?"You won":"":"To win":C||m?"Time expired":d===n.QuestionType.POLL?"Time remaining":h?"You won":"To win",[m,d,h,C,v,z]),he=h||C||B||d===n.QuestionType.TRIVIA&&c===n.QuestionStatus.RESOLVED&&y;return t.jsx(n.r,{"data-question-header":"true",children:t.jsx(Ms,{children:t.jsxs(Is,{children:[t.jsx(ps,{feedbackMessages:xe,questionVoted:!!h,questionVotedCorrectly:h==null?void 0:h.correct,questionType:d,hasCorrectAnswer:v,questionStatus:c,showExpiredNotification:C,showClosedNotificationTrivia:B,votedInCurrentRender:p,votedAfterQuestionClosed:x,enteredAnActiveQuestion:y,marketClosed:I}),H&&t.jsx(st,{title:ye,points:me,onTimerExpired:b,questionType:e.type,isTimer:!s,isPlayingTimer:!h,timerDuration:he?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),m?t.jsx(as,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):t.jsxs(t.Fragment,{children:[t.jsx(js,{style:H?{}:{marginTop:0},children:a}),t.jsx(xs,{children:je.map(A=>t.jsx(ws,{...A,markThatVoted:S,votedAfterQuestionClosed:x,enteredAnActiveQuestion:y,marketClosed:I},A.id))})]})]})})})},nt=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),it=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ot=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),rt=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),at=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),lt=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),ue=({created:e,image:s,title:i,isPickHistory:r,instantView:o,notification:l})=>{const a=u.useMemo(()=>{if(e){const c=new Date(e);if(F(c))return{date:V(c),time:W(c)}}return null},[e]),d=(o==null?void 0:o.image)||s;return t.jsxs(nt,{children:[a&&t.jsxs(at,{children:[a.date," · ",a.time]}),(o==null?void 0:o.video)&&t.jsx(n.w,{source:o.video.url,poster:o.video.thumbnailUrl}),d&&!(o!=null&&o.video)&&t.jsx(lt,{src:d}),t.jsxs(it,{children:[t.jsx(ot,{children:r?i:o==null?void 0:o.heading}),t.jsx(rt,{children:r?l==null?void 0:l.body:o==null?void 0:o.body})]})]})},dt=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ct=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ut=({instantView:e,...s})=>t.jsxs(dt,{children:[t.jsx(ue,{instantView:e,...s}),(e==null?void 0:e.webLink)&&t.jsxs(ct,{href:e==null?void 0:e.webLink.url,target:"_blank",children:[e==null?void 0:e.webLink.label,t.jsx(n.c1,{name:"icon-external-link"})]})]}),pt=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),Mt=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),It=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),jt=({created:e,...s})=>{const i=u.useMemo(()=>{if(e){const r=new Date(e);if(F(r))return{date:V(r),time:W(r)}}return null},[e]);return t.jsxs(pt,{children:[i&&t.jsxs(Mt,{children:[i.date," · ",i.time]}),s.title&&t.jsx(It,{children:s.title}),t.jsx(n.u,{...s})]})},xt=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),mt=({openedQuestion:e})=>{var s,i;return((s=e==null?void 0:e.attributes)==null?void 0:s.attributes.case)==="insight"?t.jsx(ut,{created:e.attributes.created,...e.attributes.attributes.value}):((i=e==null?void 0:e.attributes)==null?void 0:i.attributes.case)==="tweet"?t.jsx(jt,{created:e.attributes.created,...e.attributes.attributes.value}):null},yt=({extendedQuestion:e,vote:s,close:i})=>{const{loading:r,data:o}=e;return o?t.jsx(tt,{vote:s,close:i,openedQuestion:o,isLoading:!!r}):null},ht=({gamification:e})=>{var s;const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const o=i.type;return t.jsxs(xt,{children:[t.jsx(ie,{close:e.closeQuestion,type:((s=i.attributes)==null?void 0:s.type)||n.QuestionType.UNSET}),o==="question"&&t.jsx(yt,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:r}),o!=="question"&&t.jsx(mt,{openedQuestion:i}),t.jsx(ns,{sponsorLogo:""})]})},Nt=n.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),Tt=n.styled_default("img")({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!1}),gt=n.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),Dt=n.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),ft=n.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),At=()=>n.c1,vt=n.styled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Pgo8L3N2Zz4K",Lt=({title:e,description:s,onClick:i})=>t.jsxs(Nt,{onClick:i,children:[t.jsx(Tt,{alt:"friends-icon",src:Et}),t.jsxs(gt,{children:[t.jsx(Dt,{children:e}),t.jsx(ft,{children:s})]}),t.jsx(vt,{name:"icon-copy"})]}),zt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Ot=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),St=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),Ct=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var U=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(U||{});const se=({title:e,active:s,onClick:i})=>t.jsx(St,{onClick:i,"data-selected":s,children:t.jsx(Ct,{children:e})}),kt=({activePage:e="home",toggleActivePage:s})=>t.jsx(zt,{children:t.jsxs(Ot,{"data-position":e==="home"?"left":"right",children:[t.jsx(se,{title:"Home",active:e==="home",onClick:()=>s("home")}),t.jsx(se,{title:"Friends",active:e==="leaderboard",onClick:()=>s("leaderboard")})]})});function wt(e){var s=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,r=e.startIndex,o=e.stopIndex;return!(r>i||o<s)}function Qt(e){for(var s=e.isItemLoaded,i=e.itemCount,r=e.minimumBatchSize,o=e.startIndex,l=e.stopIndex,a=[],d=null,c=null,M=o;M<=l;M++){var I=s(M);I?c!==null&&(a.push(d,c),d=c=null):(c=M,d===null&&(d=M))}if(c!==null){for(var p=Math.min(Math.max(c,d+r-1),i-1),j=c+1;j<=p&&!s(j);j++)c=j;a.push(d,c)}if(a.length)for(;a[1]-a[0]+1<r&&a[0]>0;){var x=a[0]-1;if(!s(x))a[0]=x;else break}return a}var bt=function(e,s){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")},$t=function(){function e(s,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(s,o.key,o)}}return function(s,i,r){return i&&e(s.prototype,i),r&&e(s,r),s}}(),_t=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)},te=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};(function(e){_t(s,e);function s(){var i,r,o,l;bt(this,s);for(var a=arguments.length,d=Array(a),c=0;c<a;c++)d[c]=arguments[c];return l=(r=(o=te(this,(i=s.__proto__||Object.getPrototypeOf(s)).call.apply(i,[this].concat(d))),o),o._lastRenderedStartIndex=-1,o._lastRenderedStopIndex=-1,o._memoizedUnloadedRanges=[],o._onItemsRendered=function(M){var I=M.visibleStartIndex,p=M.visibleStopIndex;o._lastRenderedStartIndex=I,o._lastRenderedStopIndex=p,o._ensureRowsLoaded(I,p)},o._setRef=function(M){o._listRef=M},r),te(o,l)}return $t(s,[{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 l=this.props,a=l.isItemLoaded,d=l.itemCount,c=l.minimumBatchSize,M=c===void 0?10:c,I=l.threshold,p=I===void 0?15:I,j=Qt({isItemLoaded:a,itemCount:d,minimumBatchSize:M,startIndex:Math.max(0,r-p),stopIndex:Math.min(d-1,o+p)});(this._memoizedUnloadedRanges.length!==j.length||this._memoizedUnloadedRanges.some(function(x,f){return j[f]!==x}))&&(this._memoizedUnloadedRanges=j,this._loadUnloadedRanges(j))}},{key:"_loadUnloadedRanges",value:function(r){for(var o=this,l=this.props.loadMoreItems||this.props.loadMoreRows,a=function(M){var I=r[M],p=r[M+1],j=l(I,p);j!=null&&j.then(function(){if(wt({lastRenderedStartIndex:o._lastRenderedStartIndex,lastRenderedStopIndex:o._lastRenderedStopIndex,startIndex:I,stopIndex:p})){if(o._listRef==null)return;typeof o._listRef.resetAfterIndex=="function"?o._listRef.resetAfterIndex(I,!0):(typeof o._listRef._getItemStyleCache=="function"&&o._listRef._getItemStyleCache(-1),o._listRef.forceUpdate())}})},d=0;d<r.length;d+=2)a(d)}}]),s})(u.PureComponent);const Rt=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Ut=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Yt=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Pt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),qt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Vt=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Wt=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Ft=()=>n.c1,Bt=n.styled_default(Ft())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0});var pe={exports:{}},Ht="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zt=Ht,Gt=Zt;function Me(){}function Ie(){}Ie.resetWarningCache=Me;var Jt=function(){function e(r,o,l,a,d,c){if(c!==Gt){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}}e.isRequired=e;function s(){return e}var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:s,element:e,elementType:e,instanceOf:s,node:e,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:Ie,resetWarningCache:Me};return i.PropTypes=i,i};pe.exports=Jt();var Xt=pe.exports;const E=n.getDefaultExportFromCjs(Xt);class q extends u.Component{constructor(s){super(s),this.scrollListener=this.scrollListener.bind(this),this.eventListenerOptions=this.eventListenerOptions.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this)}componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}componentDidUpdate(){if(this.props.isReverse&&this.loadMore){const s=this.getParentElement(this.scrollComponent);s.scrollTop=s.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let s=!1;const i={get passive(){s=!0}};try{document.addEventListener("test",null,i),document.removeEventListener("test",null,i)}catch{}return s}eventListenerOptions(){let s=this.props.useCapture;return this.isPassiveSupported()?s={useCapture:this.props.useCapture,passive:!0}:s={passive:!1},s}setDefaultLoader(s){this.defaultLoader=s}detachMousewheelListener(){let s=window;this.props.useWindow===!1&&(s=this.scrollComponent.parentNode),s.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let s=window;this.props.useWindow===!1&&(s=this.getParentElement(this.scrollComponent)),s.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),s.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(s){const i=this.props.getScrollParent&&this.props.getScrollParent();return i??(s&&s.parentNode)}filterProps(s){return s}attachScrollListener(){const s=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!s)return;let i=window;this.props.useWindow===!1&&(i=s),i.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),i.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),i.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(s){s.deltaY===1&&!this.isPassiveSupported()&&s.preventDefault()}scrollListener(){const s=this.scrollComponent,i=window,r=this.getParentElement(s);let o;if(this.props.useWindow){const l=document.documentElement||document.body.parentNode||document.body,a=i.pageYOffset!==void 0?i.pageYOffset:l.scrollTop;this.props.isReverse?o=a:o=this.calculateOffset(s,a)}else this.props.isReverse?o=r.scrollTop:o=s.scrollHeight-r.scrollTop-r.clientHeight;o<Number(this.props.threshold)&&s&&s.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=r.scrollHeight,this.beforeScrollTop=r.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(s,i){return s?this.calculateTopPosition(s)+(s.offsetHeight-i-window.innerHeight):0}calculateTopPosition(s){return s?s.offsetTop+this.calculateTopPosition(s.offsetParent):0}render(){const s=this.filterProps(this.props),{children:i,element:r,hasMore:o,initialLoad:l,isReverse:a,loader:d,loadMore:c,pageStart:M,ref:I,threshold:p,useCapture:j,useWindow:x,getScrollParent:f,...y}=s;y.ref=m=>{this.scrollComponent=m,I&&I(m)};const N=[i];return o&&(d?a?N.unshift(d):N.push(d):this.defaultLoader&&(a?N.unshift(this.defaultLoader):N.push(this.defaultLoader))),u.createElement(r,y,N)}}Y(q,"propTypes",{children:E.node.isRequired,element:E.node,hasMore:E.bool,initialLoad:E.bool,isReverse:E.bool,loader:E.node,loadMore:E.func.isRequired,pageStart:E.number,ref:E.func,getScrollParent:E.func,threshold:E.number,useCapture:E.bool,useWindow:E.bool}),Y(q,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const Kt=({rank:e,avatar:s,name:i,points:r,isCurrentUser:o,openItemDetail:l,style:a})=>t.jsxs(Rt,{onClick:l,style:a,children:[t.jsx(Ut,{children:e||0}),t.jsxs(qt,{children:[s?t.jsx(Yt,{alt:"leaderboard-item-avatar",src:s}):t.jsx(Pt,{children:oe(i||"")}),t.jsxs(Vt,{children:[t.jsx(Wt,{children:i||""}),o&&t.jsx(Bt,{name:"icon-star"})]})]}),t.jsx("div",{children:re(r)})]}),en=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),sn=({items:e,currentUserId:s,openItemDetail:i,fetchMore:r,scrollNode:o,hasMore:l})=>t.jsx(q,{loadMore:r,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>o.current,children:t.jsx(en,{children:e.map(a=>t.jsx(Kt,{...a,openItemDetail:()=>i(a.userId),isCurrentUser:!!s&&s===a.userId},a.userId))})}),tn=({deepLink:e})=>{const{data:s}=n.useStore(e.$store);return t.jsx(n.O,{inviteLink:s,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."})},nn=({gamification:e,scrollNode:s,scrollStore:i})=>{const{data:r,hasMore:o}=n.useStore(e.leaderboardList.$store);return r!=null&&r.length?t.jsx(sn,{items:r,scrollNode:s,scrollStore:i,fetchMore:e.leaderboardList.fetchMore,hasMore:o,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):t.jsx(tn,{deepLink:e.deepLink})},on=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),rn=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),an=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),ln=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),dn=()=>n.c1,R=n.styled_default(dn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),cn=()=>n.c1,un=n.styled_default(cn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),pn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),Mn=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),In=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),jn={[n.PickHistoryStatus.LOST]:t.jsx(R,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:t.jsx(R,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:t.jsx(R,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:t.jsx(R,{name:"icon-arrow"})},xn=({questionId:e,questionType:s,questionStatus:i,subject:r,openForVoting:o,openQuestion:l,status:a})=>{const d=n.o[s],c=jn[a];return d?t.jsxs(on,{onClick:()=>l==null?void 0:l(e),children:[t.jsxs(Mn,{children:[t.jsxs(rn,{children:[t.jsx(un,{"data-type-trivia":s===n.QuestionType.TRIVIA,"data-type-poll":s===n.QuestionType.POLL,name:d.iconName}),t.jsxs(pn,{children:[d.label,s===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),t.jsx(an,{children:r||""})]}),t.jsx(ln,{children:o?t.jsx(In,{children:"Play"}):c})]}):null},mn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),yn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),hn=({openInsight:e,questionId:s,...i})=>t.jsxs(mn,{children:[t.jsx(ue,{questionId:s,...i,isPickHistory:!0}),e&&t.jsx(yn,{onClick:()=>e(s),children:"View Insight"})]}),Nn=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),Tn=()=>n.c,gn=n.styled_default(Tn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),Dn=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),fn=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),An=({openTweet:e,created:s,...i})=>{const r=u.useMemo(()=>{if(s){const o=new Date(s);if(F(o))return{date:V(o),time:W(o)}}return null},[s]);return t.jsxs(Nn,{children:[r&&t.jsxs(Dn,{children:[r.date," · ",r.time]}),i.title&&t.jsx(fn,{children:i.title}),t.jsx(n.u,{...i}),e&&t.jsx(gn,{onClick:()=>e(i.tweetId),children:"View Insight"})]})},vn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),En=({questions:e,openQuestion:s})=>t.jsx(vn,{children:e==null?void 0:e.map(i=>{var r,o,l;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const a=i.attributes.attributes.value;return t.jsx(xn,{openQuestion:s,...a},a.questionId)}if(i.type==="insight"&&((o=i.attributes)==null?void 0:o.attributes.case)==="insight"){const a=i.attributes.attributes.value,d=i.attributes.created;return t.jsx(hn,{openInsight:s,...a,created:d},a.questionId)}if(i.type==="tweet"&&((l=i.attributes)==null?void 0:l.attributes.case)==="tweet"){const a=i.attributes.attributes.value,d=i.attributes.id,c=i.attributes.created;return t.jsx(An,{openTweet:s,...a,tweetId:d,created:c},d)}return null})}),Ln=({store:e,openQuestion:s})=>{const i=n.useStore(e);return i!=null&&i.data?t.jsx(En,{openQuestion:s,questions:i.data}):t.jsx("div",{children:"wait questions..."})},zn=({userSummary:e})=>{var s;const[i,r]=u.useState(void 0);return u.useEffect(()=>{const o=e.subscribe(l=>{l!=null&&l.data&&r(l.data)});return()=>{o()}},[e]),i!=null&&i.summary?t.jsx(ae,{...i.summary,successRate:(s=i.percentage)==null?void 0:s.correct}):t.jsx("div",{children:"wait user..."})},On=({gamification:e,className:s,scrollStore:i,scrollNode:r})=>{const[o,l]=u.useState(!1),[a,d]=u.useState(U.HOME),[,c]=u.useTransition(),M=p=>{c(()=>d(p))},I=p=>{c(()=>l(p))};return u.useEffect(()=>i.listen(p=>{if(p.scrollPosition===0){I(!1),i.setKey("tabsShown",!1);return}I(p.scrollDirection==="forward"),i.setKey("tabsShown",p.scrollDirection!=="forward")}),[i]),t.jsxs("div",{className:s,children:[t.jsx(n.a,{style:{paddingBottom:"8px",position:"sticky",transition:"top calc(var(--animation-duration) / 2) var(--animation-function)",top:o?"-60px":"0px"},children:t.jsx(kt,{activePage:a,toggleActivePage:M})}),a===U.HOME&&t.jsxs(t.Fragment,{children:[t.jsx(n.a,{style:{paddingTop:"8px"},children:t.jsx(zn,{userSummary:e.userSummary})}),t.jsx(n.n,{children:t.jsx(Ln,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),a===U.LEADERBOARD&&t.jsxs(t.Fragment,{children:[t.jsx(n.a,{style:{paddingTop:"8px",paddingBottom:"8px"},children:t.jsx(nn,{scrollStore:i,scrollNode:r,gamification:e})}),t.jsx(n.a,{style:{position:"sticky",bottom:"0",paddingTop:"8px",paddingBottom:"8px"},children:t.jsx(Lt,{title:"Invite Friends",description:"Challenge them now!"})})]})]})},Sn=()=>n.x,ne=n.styled_default(Sn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),Cn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),kn=({correct:e,incorrect:s})=>{const i=e+s;return i===0?0:Math.round(e/i*100)},wn=({gamification:e,scrollStore:s,className:i,appNode:r,scrollNode:o})=>{const l=n.useStore(e.openedQuestion.$store),a=n.useStore(e.openedUser);return t.jsxs(t.Fragment,{children:[l&&r.current&&n.Pk.createPortal(t.jsx(ne,{className:i,children:t.jsx(ht,{gamification:e})}),r.current),a&&r.current&&n.Pk.createPortal(t.jsx(ne,{className:i,children:t.jsxs(Cn,{children:[t.jsx(ie,{label:"Friend's Rank",close:e.closeUser}),t.jsx(n.a,{children:t.jsx(ae,{...a,successRate:kn(a)})})]})}),r.current),t.jsx(On,{scrollStore:s,scrollNode:o,className:i,gamification:e})]})};exports.default=wn;
|