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