@streamlayer/react 0.31.11 → 0.31.12
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 +150 -150
- package/lib/dist/es/masters.js +1 -1
- package/lib/dist/style.css +1 -1
- package/lib/es/gamification-feature.js +51 -51
- package/lib/style.css +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index4.js"),C=require("@nanostores/react"),z=require("./masters2.js"),y=require("@streamlayer/sdk-web-types"),D=require("react"),Ne=require("./index3.js");require("react-countup");const Ae=require("react-countdown-circle-timer"),b=require("./index2.js");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const Se=o.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),De=o.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),ze=()=>o.n1,Oe=o.styled_default(ze())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),_e=o.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ce=o.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),ke=()=>o.n1,be=o.styled_default(ke())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),de=({type:e,close:t,label:n})=>{const i=e?z.o[e]:{label:n,iconName:void 0};return s.jsxs(Se,{children:[s.jsxs(De,{children:[(i==null?void 0:i.iconName)&&s.jsx(Oe,{"data-type-trivia":e===y.QuestionType.TRIVIA,"data-type-poll":e===y.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(_e,{children:i.label})]}),s.jsx(Ce,{onClick:t,children:s.jsx(be,{name:"icon-cross"})})]})},ue=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),pe=e=>e?e.toLocaleString("en-US"):"0",we=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),Ee=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Le=e=>!isNaN(e.getTime()),Qe=o.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),$e=o.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=o.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),G=({indicator:e,title:t})=>s.jsxs(Qe,{children:[s.jsx($e,{children:t}),s.jsx(Re,{children:e})]}),Ue=o.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),qe=o.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=o.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),Q=({indicator:e,title:t})=>s.jsxs(Ue,{children:[s.jsx(qe,{children:e}),s.jsx(Pe,{children:t})]}),Ye=o.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),We=o.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ve=o.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=o.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Be=o.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),He=o.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ze=o.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=o.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Je=o.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ke=o.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Xe=o.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),et=o.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),tt=o.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),st=o.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),nt=o.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),it=o.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),ot=o.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",me=({avatar:e,name:t,points:n,friendsRank:i,rank:r,streak:u,correct:p,incorrect:m,inTop:c,successRate:I})=>s.jsxs(Ye,{children:[s.jsx(We,{children:s.jsxs(Fe,{children:[s.jsxs(ot,{children:[e&&s.jsx(Be,{alt:"avatar",src:e}),!e&&s.jsx(it,{children:ue(t||"")})]}),s.jsxs(He,{children:[s.jsx(Ze,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Ke,{children:[s.jsx(Je,{alt:"rank-icon",src:rt}),s.jsxs(Xe,{children:[pe(n),s.jsx(et,{children:"PTS"})]})]}),s.jsx(tt,{}),s.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),s.jsxs(Ve,{children:[s.jsxs(st,{children:[s.jsx(G,{indicator:i||0,title:"Friends rank"}),s.jsx(G,{indicator:r||0,title:"Global rank"})]}),s.jsxs(nt,{children:[s.jsx(Q,{indicator:u||0,title:"Win streak"}),s.jsx(Q,{indicator:p||0,title:"Correct"}),s.jsx(Q,{indicator:m||0,title:"Incorrect"}),s.jsx(Q,{indicator:`${I||0}%`,title:"Succ. rate"})]})]})]}),at=o.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),lt=o.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),ct=o.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),dt=({title:e,description:t})=>s.jsxs(at,{children:[s.jsx(o.n1,{name:"icon-check-circle"}),s.jsx(lt,{children:e}),s.jsx(ct,{children:t})]}),ut=o.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),pt=()=>o.n1,mt=o.styled_default(pt())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),J=o.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),K=o.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),It=o.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),q=o.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ft=o.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ht=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:n,questionType:i,hasCorrectAnswer:r,questionStatus:u})=>{const p=n&&(i===y.QuestionType.TRIVIA||i===y.QuestionType.PREDICTION);if(!p&&u!==y.QuestionStatus.RESOLVED||u===y.QuestionStatus.RESOLVED&&i===y.QuestionType.PREDICTION&&!n)return null;const m=i===y.QuestionType.PREDICTION&&!r,c=t?"correct":"incorrect",I=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ut,{"data-isPrediction":m,children:[u===y.QuestionStatus.RESOLVED&&i===y.QuestionType.TRIVIA&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(J,{children:s.jsx(o.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(K,{children:s.jsx(q,{children:"Question Expired"})}),s.jsx(ft,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),p&&m&&s.jsxs(s.Fragment,{children:[s.jsx(mt,{name:"icon-prediction"}),s.jsx(q,{children:"Stay tuned to see if your prediction was correct."})]}),p&&r&&s.jsxs(s.Fragment,{children:[s.jsx(J,{"data-feedbackType":c,children:s.jsx(o.n1,{name:c})}),s.jsx("div",{children:s.jsxs(K,{children:[s.jsx(It,{"data-feedbackType":c,children:I==null?void 0:I.title}),s.jsx(q,{children:I==null?void 0:I.description})]})})]})]})},yt=o.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),xt=o.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),gt=o.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),jt=o.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),Mt=o.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),vt=o.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Tt=o.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Nt=o.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),At=o.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),Ie=o.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),St=()=>Ie,Dt=o.styled_default(St())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),zt=()=>Ie,Ot=o.styled_default(zt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),_t=o.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ct=o.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),kt=o.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),bt=()=>o.n1,wt=o.styled_default(bt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),X={[y.QuestionImages.CENTERED]:e=>s.jsx(Dt,{alt:"option-icon",src:e}),[y.QuestionImages.TRANSPARENT]:e=>s.jsx(Nt,{children:s.jsx(At,{style:{backgroundImage:`url(${e})`}})}),[y.QuestionImages.ROUNDED]:e=>s.jsx(Ot,{alt:"option-icon",src:e}),[y.QuestionImages.NONE]:()=>null,[y.QuestionImages.UNSET]:()=>null},Et=({questionType:e,hasCorrectAnswer:t,correct:n,youVoted:i,questionVoted:r})=>{if(e===y.QuestionType.POLL&&i)return"correct";if(e===y.QuestionType.PREDICTION){if(t&&r)return i?n?"correct":"incorrect":"unset";if(i)return"correct"}return e===y.QuestionType.TRIVIA&&r&&i?n?"correct":"incorrect":"unset"},Lt=({questionType:e,questionVoted:t,correct:n,hasCorrectAnswer:i,questionStatus:r})=>e===y.QuestionType.TRIVIA?t&&n:e===y.QuestionType.PREDICTION?t&&n&&i||r===y.QuestionStatus.RESOLVED&&n:!1,Qt=e=>{var t;const{id:n,icon:i,text:r,percentageDecimal:u,onVote:p,youSelected:m,questionVoted:c,imageMode:I,answerTimeExpired:M,questionStatus:N,isLoading:j,questionType:v,correct:T,hasCorrectAnswer:a}=e,l=Et(e),d=Lt({questionType:v,questionVoted:c,correct:T,hasCorrectAnswer:a,questionStatus:N}),f=N===y.QuestionStatus.RESOLVED&&v===y.QuestionType.PREDICTION,x=c||f;return s.jsxs(Mt,{value:n,"data-selected":m,"data-answerState":l,disabled:c||j||M||f,"data-isNotChecked":c&&!m&&l!=="incorrect",onClick:p,children:[s.jsx(vt,{"data-answerState":l,style:{width:`${x?u:0}%`}}),s.jsxs(Tt,{children:[i&&I&&((t=X[I])==null?void 0:t.call(X,i)),s.jsx(_t,{children:r}),x&&s.jsxs(Ct,{children:[d&&s.jsx(wt,{name:"selected"}),s.jsx(kt,{children:s.jsx(Ne.d,{value:u,suffix:"%"})})]})]})]})},$t=[b.E.PRIMARY_GREEN1,b.E.SECONDARY_RED1,b.E.SECONDARY_RED1],Rt=[10,10,0],Ut=o.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),qt=b.E.SECONDARY_GREEN6,ee=b.E.SECONDARY_RED3,Pt=b.E.NEUTRALS_GRAY3,Yt=({isPlaying:e=!0,duration:t=30,onTimerExpired:n})=>{const[i,r]=D.useState(t>10?qt:ee),u=({remainingTime:c})=>s.jsx(Ut,{children:c}),p=D.useCallback(()=>{n==null||n(),r(Pt)},[n,r]),m=D.useCallback(c=>{c===10&&r(ee)},[r]);return s.jsx(Ae.CountdownCircleTimer,{isPlaying:e,duration:t,colors:$t,colorsTime:Rt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:p,onUpdate:m,children:u})},Wt=o.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Vt=o.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Ft=o.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Bt=()=>o.n1,Ht=o.styled_default(Bt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Zt=o.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Gt=o.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Jt=o.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Kt=({title:e,points:t,isPlayingTimer:n,isTimer:i,questionType:r,timerDuration:u,onTimerExpired:p})=>s.jsxs(Wt,{children:[s.jsxs(Vt,{children:[e&&s.jsx(Ft,{children:e}),t!==void 0&&r!==y.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Ht,{name:"icon-trophy"}),s.jsxs(Zt,{children:[s.jsx(Gt,{children:t}),s.jsx(Jt,{children:"PTS"})]})]})]}),i&&s.jsx(Yt,{isPlaying:n,onTimerExpired:p,duration:u})]}),Xt=({openedQuestion:e,isLoading:t,vote:n,close:i})=>{var r,u;const p=e.subject,m=e.type,c=(r=e.options)==null?void 0:r.options,[I,M]=D.useState(!1),[N,j]=D.useState(""),v=e==null?void 0:e.id,T=D.useCallback(async g=>{if(v){const h=g.currentTarget.value;j(h),await n(v,h)}},[v,j,n]),a=D.useCallback(()=>{M(!0),setTimeout(i,3e3)},[i]),l=D.useMemo(()=>e==null?void 0:e.answers.find(g=>g.youVoted===!0),[e]),d=D.useMemo(()=>!!(e!=null&&e.answers.find(g=>g.correct===!0)),[e]),f=D.useMemo(()=>e?e.answers.map(g=>{var h;return{...g,questionVoted:!!l,youSelected:N===g.id,isLoading:t,hasCorrectAnswer:d,questionType:e.type,answerTimeExpired:I,questionStatus:e.status,imageMode:(h=e.appearance)==null?void 0:h.images,onVote:T}}):[],[d,I,t,e,l,T,N]),x=c&&(c.case==="trivia"||c.case==="prediction")?c.value:void 0;return s.jsx(z.r,{"data-question-header":"true",children:s.jsx(yt,{children:s.jsxs(xt,{children:[x&&s.jsx(ht,{feedbackMessages:x,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:m,hasCorrectAnswer:d,questionStatus:e.status}),e.type!==y.QuestionType.PREDICTION&&s.jsx(Kt,{title:I?"Time expired":e.type===y.QuestionType.POLL?"Time remaining":"To win",points:I?void 0:100,onTimerExpired:a,questionType:e.type,isTimer:!t,isPlayingTimer:!l,timerDuration:l?0:Number(((u=e==null?void 0:e.appearance)==null?void 0:u.autoHideInterval)||"30")}),I?s.jsx(dt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(gt,{"data-isPrediction":e.type===y.QuestionType.PREDICTION,children:p}),s.jsx(jt,{children:f.map(g=>s.jsx(Qt,{...g},g.id))})]})]})})})},es=o.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ts=o.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ss=o.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ns=o.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),is=o.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),os=o.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),fe=({created:e,image:t,title:n,instantView:i})=>{const r=D.useMemo(()=>{if(e){const p=new Date(e);if(Le(p))return{date:we(p),time:Ee(p)}}return null},[e]),u=(i==null?void 0:i.image)||t;return s.jsxs(es,{children:[r&&s.jsxs(is,{children:[r.date," · ",r.time]}),(i==null?void 0:i.video)&&s.jsx(z.w,{source:i.video.url,poster:i.video.thumbnailUrl}),u&&s.jsx(os,{src:u}),s.jsxs(ts,{children:[s.jsx(ss,{children:(i==null?void 0:i.heading)||n}),s.jsx(ns,{children:i==null?void 0:i.body})]})]})},rs=o.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),as=o.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ls=({instantView:e,...t})=>s.jsxs(rs,{children:[s.jsx(fe,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(as,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(o.n1,{name:"icon-external-link"})]})]}),cs=o.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:n})=>{const{loading:i,data:r}=e;return r?s.jsx(Xt,{vote:t,close:n,openedQuestion:r,isLoading:!!i}):null},ps=({gamification:e})=>{var t;const n=C.useStore(e.openedQuestion.$store),i=C.useStore(e.openedQuestion.$extendedStore);if(!n)return null;const r=n.type;return s.jsxs(cs,{children:[s.jsx(de,{close:e.closeQuestion,type:((t=n.attributes)==null?void 0:t.type)||y.QuestionType.UNSET}),r==="question"&&s.jsx(us,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),r!=="question"&&s.jsx(ds,{openedQuestion:n})]})},ms=o.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Is=o.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),fs=o.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),hs=o.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var R=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(R||{});const te=({title:e,active:t,onClick:n})=>s.jsx(fs,{onClick:n,"data-selected":t,children:s.jsx(hs,{children:e})}),ys=({activePage:e="home",toggleActivePage:t})=>s.jsx(ms,{children:s.jsxs(Is,{"data-position":e==="home"?"left":"right",children:[s.jsx(te,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(te,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},W.apply(this,arguments)}function se(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},V(e,t)}function xs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V(e,t)}var ne=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function gs(e,t){return!!(e===t||ne(e)&&ne(t))}function js(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!gs(e[n],t[n]))return!1;return!0}function P(e,t){t===void 0&&(t=js);var n,i=[],r,u=!1;function p(){for(var m=[],c=0;c<arguments.length;c++)m[c]=arguments[c];return u&&n===this&&t(m,i)||(r=e.apply(this,m),u=!0,n=this,i=m),r}return p}var Ms=typeof performance=="object"&&typeof performance.now=="function",ie=Ms?function(){return performance.now()}:function(){return Date.now()};function oe(e){cancelAnimationFrame(e.id)}function vs(e,t){var n=ie();function i(){ie()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}var r={id:requestAnimationFrame(i)};return r}var Y=-1;function re(e){if(e===void 0&&(e=!1),Y===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Y=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Y}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var i=document.createElement("div"),r=i.style;return r.width="100px",r.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?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,n){return t};function As(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,r=e.getItemSize,u=e.getOffsetForIndexAndAlignment,p=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,c=e.initInstanceProps,I=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(N){xs(j,N);function j(T){var a;return a=N.call(this,T)||this,a._instanceProps=c(a.props,se(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:se(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=P(function(l,d,f,x){return a.props.onItemsRendered({overscanStartIndex:l,overscanStopIndex:d,visibleStartIndex:f,visibleStopIndex:x})}),a._callOnScroll=void 0,a._callOnScroll=P(function(l,d,f){return a.props.onScroll({scrollDirection:l,scrollOffset:d,scrollUpdateWasRequested:f})}),a._getItemStyle=void 0,a._getItemStyle=function(l){var d=a.props,f=d.direction,x=d.itemSize,g=d.layout,h=a._getItemStyleCache(I&&x,I&&g,I&&f),A;if(h.hasOwnProperty(l))A=h[l];else{var S=n(a.props,l,a._instanceProps),O=r(a.props,l,a._instanceProps),_=f==="horizontal"||g==="horizontal",E=f==="rtl",L=_?S:0;h[l]=A={position:"absolute",left:E?void 0:L,right:E?L:void 0,top:_?0:S,height:_?"100%":O,width:_?O:"100%"}}return A},a._getItemStyleCache=void 0,a._getItemStyleCache=P(function(l,d,f){return{}}),a._onScrollHorizontal=function(l){var d=l.currentTarget,f=d.clientWidth,x=d.scrollLeft,g=d.scrollWidth;a.setState(function(h){if(h.scrollOffset===x)return null;var A=a.props.direction,S=x;if(A==="rtl")switch(ae()){case"negative":S=-x;break;case"positive-descending":S=g-f-x;break}return S=Math.max(0,Math.min(S,g-f)),{isScrolling:!0,scrollDirection:h.scrollOffset<x?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(l){var d=l.currentTarget,f=d.clientHeight,x=d.scrollHeight,g=d.scrollTop;a.setState(function(h){if(h.scrollOffset===g)return null;var A=Math.max(0,Math.min(g,x-f));return{isScrolling:!0,scrollDirection:h.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(l){var d=a.props.outerRef;a._outerRef=l,typeof d=="function"?d(l):d!=null&&typeof d=="object"&&d.hasOwnProperty("current")&&(d.current=l)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&oe(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=vs(a._resetIsScrolling,Ts)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}j.getDerivedStateFromProps=function(a,l){return Ss(a,l),M(a),null};var v=j.prototype;return v.scrollTo=function(a){a=Math.max(0,a),this.setState(function(l){return l.scrollOffset===a?null:{scrollDirection:l.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(a,l){l===void 0&&(l="auto");var d=this.props,f=d.itemCount,x=d.layout,g=this.state.scrollOffset;a=Math.max(0,Math.min(a,f-1));var h=0;if(this._outerRef){var A=this._outerRef;x==="vertical"?h=A.scrollWidth>A.clientWidth?re():0:h=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(u(this.props,a,l,g,this._instanceProps,h))},v.componentDidMount=function(){var a=this.props,l=a.direction,d=a.initialScrollOffset,f=a.layout;if(typeof d=="number"&&this._outerRef!=null){var x=this._outerRef;l==="horizontal"||f==="horizontal"?x.scrollLeft=d:x.scrollTop=d}this._callPropsCallbacks()},v.componentDidUpdate=function(){var a=this.props,l=a.direction,d=a.layout,f=this.state,x=f.scrollOffset,g=f.scrollUpdateWasRequested;if(g&&this._outerRef!=null){var h=this._outerRef;if(l==="horizontal"||d==="horizontal")if(l==="rtl")switch(ae()){case"negative":h.scrollLeft=-x;break;case"positive-ascending":h.scrollLeft=x;break;default:var A=h.clientWidth,S=h.scrollWidth;h.scrollLeft=S-A-x;break}else h.scrollLeft=x;else h.scrollTop=x}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&oe(this._resetIsScrollingTimeoutId)},v.render=function(){var a=this.props,l=a.children,d=a.className,f=a.direction,x=a.height,g=a.innerRef,h=a.innerElementType,A=a.innerTagName,S=a.itemCount,O=a.itemData,_=a.itemKey,E=_===void 0?Ns:_,L=a.layout,he=a.outerElementType,ye=a.outerTagName,xe=a.style,ge=a.useIsScrolling,je=a.width,F=this.state.isScrolling,U=f==="horizontal"||L==="horizontal",Me=U?this._onScrollHorizontal:this._onScrollVertical,B=this._getRangeToRender(),ve=B[0],Te=B[1],H=[];if(S>0)for(var w=ve;w<=Te;w++)H.push(D.createElement(l,{data:O,key:E(w,O),index:w,isScrolling:ge?F:void 0,style:this._getItemStyle(w)}));var Z=i(this.props,this._instanceProps);return D.createElement(he||ye||"div",{className:d,onScroll:Me,ref:this._outerRefSetter,style:W({position:"relative",height:x,width:je,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},xe)},D.createElement(h||A||"div",{children:H,ref:g,style:{height:U?"100%":Z,pointerEvents:F?"none":void 0,width:U?Z:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var l=this._getRangeToRender(),d=l[0],f=l[1],x=l[2],g=l[3];this._callOnItemsRendered(d,f,x,g)}}if(typeof this.props.onScroll=="function"){var h=this.state,A=h.scrollDirection,S=h.scrollOffset,O=h.scrollUpdateWasRequested;this._callOnScroll(A,S,O)}},v._getRangeToRender=function(){var a=this.props,l=a.itemCount,d=a.overscanCount,f=this.state,x=f.isScrolling,g=f.scrollDirection,h=f.scrollOffset;if(l===0)return[0,0,0,0];var A=p(this.props,h,this._instanceProps),S=m(this.props,A,h,this._instanceProps),O=!x||g==="backward"?Math.max(1,d):1,_=!x||g==="forward"?Math.max(1,d):1;return[Math.max(0,A-O),Math.max(0,Math.min(l-1,S+_)),A,S]},j}(D.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Ss=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Ds=As({getItemOffset:function(t,n){var i=t.itemSize;return n*i},getItemSize:function(t,n){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var n=t.itemCount,i=t.itemSize;return i*n},getOffsetForIndexAndAlignment:function(t,n,i,r,u,p){var m=t.direction,c=t.height,I=t.itemCount,M=t.itemSize,N=t.layout,j=t.width,v=m==="horizontal"||N==="horizontal",T=v?j:c,a=Math.max(0,I*M-T),l=Math.min(a,n*M),d=Math.max(0,n*M-T+M+p);switch(i==="smart"&&(r>=d-T&&r<=l+T?i="auto":i="center"),i){case"start":return l;case"end":return d;case"center":{var f=Math.round(d+(l-d)/2);return f<Math.ceil(T/2)?0:f>a+Math.floor(T/2)?a:f}case"auto":default:return r>=d&&r<=l?r:r<d?d:l}},getStartIndexForOffset:function(t,n){var i=t.itemCount,r=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(n/r)))},getStopIndexForStartIndex:function(t,n,i){var r=t.direction,u=t.height,p=t.itemCount,m=t.itemSize,c=t.layout,I=t.width,M=r==="horizontal"||c==="horizontal",N=n*m,j=M?I:u,v=Math.ceil((j+i-N)/m);return Math.max(0,Math.min(p-1,n+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function zs(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,i=e.startIndex,r=e.stopIndex;return!(i>n||r<t)}function Os(e){for(var t=e.isItemLoaded,n=e.itemCount,i=e.minimumBatchSize,r=e.startIndex,u=e.stopIndex,p=[],m=null,c=null,I=r;I<=u;I++){var M=t(I);M?c!==null&&(p.push(m,c),m=c=null):(c=I,m===null&&(m=I))}if(c!==null){for(var N=Math.min(Math.max(c,m+i-1),n-1),j=c+1;j<=N&&!t(j);j++)c=j;p.push(m,c)}if(p.length)for(;p[1]-p[0]+1<i&&p[0]>0;){var v=p[0]-1;if(!t(v))p[0]=v;else break}return p}var _s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Cs=function(){function e(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),ks=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},le=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},bs=function(e){ks(t,e);function t(){var n,i,r,u;_s(this,t);for(var p=arguments.length,m=Array(p),c=0;c<p;c++)m[c]=arguments[c];return u=(i=(r=le(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(m))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(I){var M=I.visibleStartIndex,N=I.visibleStopIndex;r._lastRenderedStartIndex=M,r._lastRenderedStopIndex=N,r._ensureRowsLoaded(M,N)},r._setRef=function(I){r._listRef=I},i),le(r,u)}return Cs(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,r){var u=this.props,p=u.isItemLoaded,m=u.itemCount,c=u.minimumBatchSize,I=c===void 0?10:c,M=u.threshold,N=M===void 0?15:M,j=Os({isItemLoaded:p,itemCount:m,minimumBatchSize:I,startIndex:Math.max(0,i-N),stopIndex:Math.min(m-1,r+N)});(this._memoizedUnloadedRanges.length!==j.length||this._memoizedUnloadedRanges.some(function(v,T){return j[T]!==v}))&&(this._memoizedUnloadedRanges=j,this._loadUnloadedRanges(j))}},{key:"_loadUnloadedRanges",value:function(i){for(var r=this,u=this.props.loadMoreItems||this.props.loadMoreRows,p=function(I){var M=i[I],N=i[I+1],j=u(M,N);j!=null&&j.then(function(){if(zs({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:M,stopIndex:N})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(M,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)p(m)}}]),t}(D.PureComponent);const ws=o.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Es=o.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ls=o.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Qs=o.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),$s=o.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Rs=o.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Us=o.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),qs=()=>o.n1,Ps=o.styled_default(qs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Ys=({rank:e,avatar:t,name:n,points:i,isCurrentUser:r,openItemDetail:u,style:p})=>s.jsxs(ws,{onClick:u,style:p,children:[s.jsx(Es,{children:e||0}),s.jsxs($s,{children:[t?s.jsx(Ls,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Qs,{children:ue(n||"")}),s.jsxs(Rs,{children:[s.jsx(Us,{children:n||""}),r&&s.jsx(Ps,{name:"icon-star"})]})]}),s.jsx("div",{children:pe(i)})]}),Ws=o.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Vs=({items:e,currentUserId:t,openItemDetail:n,fetchMore:i})=>s.jsx(z.AutoSizer,{children:({width:r,height:u})=>s.jsx(bs,{isItemLoaded:p=>p<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:p,ref:m})=>s.jsx(Ws,{children:s.jsx(Ds,{itemSize:56,onItemsRendered:p,ref:m,itemCount:e.length,width:r,height:u,children:({index:c,style:I})=>s.jsx(Ys,{style:{...I,maxHeight:48},...e[c],openItemDetail:()=>n(e[c].userId),isCurrentUser:!!t&&t===e[c].userId},e[c].userId)})})})}),Fs=({deepLink:e})=>{const{data:t}=C.useStore(e.$store);return s.jsx(z.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}=C.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Vs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Fs,{deepLink:e.deepLink})},Hs=o.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Zs=o.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Gs=o.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Js=o.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Ks=()=>o.n1,$=o.styled_default(Ks())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Xs=()=>o.n1,en=o.styled_default(Xs())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),tn=o.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),sn=o.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),nn=o.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),on={[y.PickHistoryStatus.LOST]:s.jsx($,{name:"incorrectVoted"}),[y.PickHistoryStatus.WON]:s.jsx($,{name:"icon-check"}),[y.PickHistoryStatus.UNSET]:s.jsx($,{name:"icon-arrow"}),[y.PickHistoryStatus.DNP]:s.jsx($,{name:"icon-arrow"})},rn=({questionId:e,questionType:t,questionStatus:n,subject:i,openForVoting:r,openQuestion:u,status:p})=>{const m=z.o[t],c=on[p];return m?s.jsxs(Hs,{onClick:()=>u==null?void 0:u(e),children:[s.jsxs(sn,{children:[s.jsxs(Zs,{children:[s.jsx(en,{"data-type-trivia":t===y.QuestionType.TRIVIA,"data-type-poll":t===y.QuestionType.POLL,name:m.iconName}),s.jsxs(tn,{children:[m.label,t===y.QuestionType.TRIVIA&&n===y.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Gs,{children:i||""})]}),s.jsx(Js,{children:r?s.jsx(nn,{children:"Play"}):c})]}):null},an=o.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),ln=o.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),cn=({openInsight:e,questionId:t,...n})=>s.jsxs(an,{children:[s.jsx(fe,{questionId:t,...n}),e&&s.jsx(ln,{onClick:()=>e(t),children:"View Insight"})]}),dn=o.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),un=({questions:e,openQuestion:t})=>s.jsx(dn,{children:e==null?void 0:e.map(n=>{var i,r;if(n.type==="question"&&((i=n.attributes)==null?void 0:i.attributes.case)==="question"){const u=n.attributes.attributes.value;return s.jsx(rn,{openQuestion:t,...u},u.questionId)}if(n.type==="insight"&&((r=n.attributes)==null?void 0:r.attributes.case)==="insight"){const u=n.attributes.attributes.value;return s.jsx(cn,{openInsight:t,...u},u.questionId)}return null})}),pn=({store:e,openQuestion:t})=>{const n=C.useStore(e);return n!=null&&n.data?s.jsx(un,{openQuestion:t,questions:n.data}):s.jsx("div",{children:"wait questions..."})},mn=({userSummary:e})=>{var t,n;const i=C.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(me,{...i.data.summary,successRate:(n=i.data.percentage)==null?void 0:n.correct}):s.jsx("div",{children:"wait user..."})},In=({gamification:e})=>{const[t,n]=D.useState(R.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(z.a,{style:{paddingBottom:"4px"},children:s.jsx(ys,{activePage:t,toggleActivePage:n})}),t===R.HOME&&s.jsxs(z.r,{children:[s.jsx(z.a,{style:{paddingTop:"12px"},children:s.jsx(mn,{userSummary:e.userSummary})}),s.jsx(z.n,{children:s.jsx(pn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===R.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Bs,{gamification:e})})]})},fn=()=>z.d,ce=o.styled_default(fn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),hn=o.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),yn=({correct:e,incorrect:t})=>{const n=e+t;return n===0?0:Math.round(e/n*100)},xn=({gamification:e,className:t})=>{const n=C.useStore(e.openedQuestion.$store),i=C.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[n&&s.jsx(ce,{className:t,children:s.jsx(ps,{gamification:e})}),i&&s.jsx(ce,{className:t,children:s.jsxs(hn,{children:[s.jsx(de,{label:"Friend's Rank",close:e.closeUser}),s.jsx(z.a,{children:s.jsx(me,{...i,successRate:yn(i)})})]})}),s.jsx(z.r,{className:t,"data-nav":"true",children:s.jsx(In,{gamification:e})})]})};exports.default=xn;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index4.js"),C=require("@nanostores/react"),z=require("./masters2.js"),y=require("@streamlayer/sdk-web-types"),D=require("react"),de=require("./index3.js");require("react-countup");const Ae=require("react-countdown-circle-timer"),b=require("./index2.js");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const Se=o.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),De=o.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),ze=()=>o.n1,Oe=o.styled_default(ze())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),_e=o.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ce=o.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),ke=()=>o.n1,be=o.styled_default(ke())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ue=({type:e,close:t,label:n})=>{const i=e?z.o[e]:{label:n,iconName:void 0};return s.jsxs(Se,{children:[s.jsxs(De,{children:[(i==null?void 0:i.iconName)&&s.jsx(Oe,{"data-type-trivia":e===y.QuestionType.TRIVIA,"data-type-poll":e===y.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(_e,{children:i.label})]}),s.jsx(Ce,{onClick:t,children:s.jsx(be,{name:"icon-cross"})})]})},pe=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),me=e=>e?e.toLocaleString("en-US"):"0",we=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),Ee=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Le=e=>!isNaN(e.getTime()),Qe=o.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),$e=o.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=o.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),G=({indicator:e,title:t})=>s.jsxs(Qe,{children:[s.jsx($e,{children:t}),s.jsx(Re,{children:e})]}),Ue=o.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),qe=o.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=o.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),Q=({indicator:e,title:t})=>s.jsxs(Ue,{children:[s.jsx(qe,{children:e}),s.jsx(Pe,{children:t})]}),Ye=o.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),We=o.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ve=o.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=o.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Be=o.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),He=o.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ze=o.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=o.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Je=o.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ke=o.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Xe=o.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),et=o.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),tt=o.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),st=o.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),nt=o.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),it=o.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),ot=o.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",Ie=({avatar:e,name:t,points:n,friendsRank:i,rank:r,streak:u,correct:p,incorrect:m,inTop:c,successRate:I})=>s.jsxs(Ye,{children:[s.jsx(We,{children:s.jsxs(Fe,{children:[s.jsxs(ot,{children:[e&&s.jsx(Be,{alt:"avatar",src:e}),!e&&s.jsx(it,{children:pe(t||"")})]}),s.jsxs(He,{children:[s.jsx(Ze,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Ke,{children:[s.jsx(Je,{alt:"rank-icon",src:rt}),s.jsxs(Xe,{children:[me(n),s.jsx(et,{children:"PTS"})]})]}),s.jsx(tt,{}),s.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),s.jsxs(Ve,{children:[s.jsxs(st,{children:[s.jsx(G,{indicator:i||0,title:"Friends rank"}),s.jsx(G,{indicator:r||0,title:"Global rank"})]}),s.jsxs(nt,{children:[s.jsx(Q,{indicator:u||0,title:"Win streak"}),s.jsx(Q,{indicator:p||0,title:"Correct"}),s.jsx(Q,{indicator:m||0,title:"Incorrect"}),s.jsx(Q,{indicator:`${I||0}%`,title:"Succ. rate"})]})]})]}),at=o.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),lt=o.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),ct=o.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),dt=({title:e,description:t})=>s.jsxs(at,{children:[s.jsx(o.n1,{name:"icon-check-circle"}),s.jsx(lt,{children:e}),s.jsx(ct,{children:t})]}),ut=o.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),pt=()=>o.n1,mt=o.styled_default(pt())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),J=o.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),K=o.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),It=o.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),q=o.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ft=o.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ht=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:n,questionType:i,hasCorrectAnswer:r,questionStatus:u})=>{const p=n&&(i===y.QuestionType.TRIVIA||i===y.QuestionType.PREDICTION);if(!p&&u!==y.QuestionStatus.RESOLVED||u===y.QuestionStatus.RESOLVED&&i===y.QuestionType.PREDICTION&&!n)return null;const m=i===y.QuestionType.PREDICTION&&!r,c=t?"correct":"incorrect",I=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ut,{"data-isPrediction":m,children:[u===y.QuestionStatus.RESOLVED&&i===y.QuestionType.TRIVIA&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(J,{children:s.jsx(o.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(K,{children:s.jsx(q,{children:"Question Expired"})}),s.jsx(ft,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),p&&m&&s.jsxs(s.Fragment,{children:[s.jsx(mt,{name:"icon-prediction"}),s.jsx(q,{children:"Stay tuned to see if your prediction was correct."})]}),p&&r&&s.jsxs(s.Fragment,{children:[s.jsx(J,{"data-feedbackType":c,children:s.jsx(o.n1,{name:c})}),s.jsx("div",{children:s.jsxs(K,{children:[s.jsx(It,{"data-feedbackType":c,children:I==null?void 0:I.title}),s.jsx(q,{children:I==null?void 0:I.description})]})})]})]})},yt=o.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),xt=o.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),gt=o.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),jt=o.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),Mt=o.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),vt=o.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Tt=o.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Nt=o.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),At=o.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),fe=o.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),St=()=>fe,Dt=o.styled_default(St())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),zt=()=>fe,Ot=o.styled_default(zt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),_t=o.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ct=o.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),kt=o.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),bt=()=>o.n1,wt=o.styled_default(bt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),X={[y.QuestionImages.CENTERED]:e=>s.jsx(Dt,{alt:"option-icon",src:e}),[y.QuestionImages.TRANSPARENT]:e=>s.jsx(Nt,{children:s.jsx(At,{style:{backgroundImage:`url(${e})`}})}),[y.QuestionImages.ROUNDED]:e=>s.jsx(Ot,{alt:"option-icon",src:e}),[y.QuestionImages.NONE]:()=>null,[y.QuestionImages.UNSET]:()=>null},Et=({questionType:e,hasCorrectAnswer:t,correct:n,youVoted:i,questionVoted:r})=>{if(e===y.QuestionType.POLL&&i)return"correct";if(e===y.QuestionType.PREDICTION){if(t&&r)return i?n?"correct":"incorrect":"unset";if(i)return"correct"}return e===y.QuestionType.TRIVIA&&r&&i?n?"correct":"incorrect":"unset"},Lt=({questionType:e,questionVoted:t,correct:n,hasCorrectAnswer:i,questionStatus:r})=>e===y.QuestionType.TRIVIA?t&&n:e===y.QuestionType.PREDICTION?t&&n&&i||r===y.QuestionStatus.RESOLVED&&n:!1,Qt=e=>{var t;const{id:n,icon:i,text:r,percentageDecimal:u,onVote:p,youSelected:m,questionVoted:c,imageMode:I,answerTimeExpired:M,questionStatus:N,isLoading:j,questionType:v,correct:T,hasCorrectAnswer:a}=e,l=Et(e),d=Lt({questionType:v,questionVoted:c,correct:T,hasCorrectAnswer:a,questionStatus:N}),f=N===y.QuestionStatus.RESOLVED&&v===y.QuestionType.PREDICTION,x=c||f;return s.jsxs(Mt,{value:n,"data-selected":m,"data-answerState":l,disabled:c||j||M||f,"data-isNotChecked":c&&!m&&l!=="incorrect",onClick:p,children:[s.jsx(vt,{"data-answerState":l,style:{width:`${x?u:0}%`}}),s.jsxs(Tt,{children:[i&&I&&((t=X[I])==null?void 0:t.call(X,i)),s.jsx(_t,{children:r}),x&&s.jsxs(Ct,{children:[d&&s.jsx(wt,{name:"selected"}),s.jsx(kt,{children:s.jsx(de.d,{value:u,suffix:"%"})})]})]})]})},$t=[b.E.PRIMARY_GREEN1,b.E.SECONDARY_RED1,b.E.SECONDARY_RED1],Rt=[10,10,0],Ut=o.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),qt=b.E.SECONDARY_GREEN6,ee=b.E.SECONDARY_RED3,Pt=b.E.NEUTRALS_GRAY3,Yt=({isPlaying:e=!0,duration:t=30,onTimerExpired:n})=>{const[i,r]=D.useState(t>10?qt:ee),u=({remainingTime:c})=>s.jsx(Ut,{children:c}),p=D.useCallback(()=>{n==null||n(),r(Pt)},[n,r]),m=D.useCallback(c=>{c===10&&r(ee)},[r]);return s.jsx(Ae.CountdownCircleTimer,{isPlaying:e,duration:t,colors:$t,colorsTime:Rt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:p,onUpdate:m,children:u})},Wt=o.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Vt=o.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Ft=o.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Bt=()=>o.n1,Ht=o.styled_default(Bt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Zt=o.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Gt=o.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Jt=o.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Kt=({title:e,points:t,isPlayingTimer:n,isTimer:i,questionType:r,timerDuration:u,onTimerExpired:p})=>s.jsxs(Wt,{children:[s.jsxs(Vt,{children:[e&&s.jsx(Ft,{children:e}),t!==void 0&&r!==y.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Ht,{name:"icon-trophy"}),s.jsxs(Zt,{children:[s.jsx(Gt,{children:s.jsx(de.d,{value:t})}),s.jsx(Jt,{children:"PTS"})]})]})]}),i&&s.jsx(Yt,{isPlaying:n,onTimerExpired:p,duration:u})]}),Xt=({openedQuestion:e,isLoading:t,vote:n,close:i})=>{var r,u;const p=e.subject,m=e.type,c=(r=e.options)==null?void 0:r.options,[I,M]=D.useState(!1),[N,j]=D.useState(""),v=e==null?void 0:e.id,T=D.useCallback(async g=>{if(v){const h=g.currentTarget.value;j(h),await n(v,h)}},[v,j,n]),a=D.useCallback(()=>{M(!0),setTimeout(i,3e3)},[i]),l=D.useMemo(()=>e==null?void 0:e.answers.find(g=>g.youVoted===!0),[e]),d=D.useMemo(()=>!!(e!=null&&e.answers.find(g=>g.correct===!0)),[e]),f=D.useMemo(()=>e?e.answers.map(g=>{var h;return{...g,questionVoted:!!l,youSelected:N===g.id,isLoading:t,hasCorrectAnswer:d,questionType:e.type,answerTimeExpired:I,questionStatus:e.status,imageMode:(h=e.appearance)==null?void 0:h.images,onVote:T}}):[],[d,I,t,e,l,T,N]),x=c&&(c.case==="trivia"||c.case==="prediction")?c.value:void 0;return s.jsx(z.r,{"data-question-header":"true",children:s.jsx(yt,{children:s.jsxs(xt,{children:[x&&s.jsx(ht,{feedbackMessages:x,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:m,hasCorrectAnswer:d,questionStatus:e.status}),e.type!==y.QuestionType.PREDICTION&&s.jsx(Kt,{title:I?"Time expired":e.type===y.QuestionType.POLL?"Time remaining":"To win",points:I?void 0:l!=null&&l.correct?l==null?void 0:l.points:0,onTimerExpired:a,questionType:e.type,isTimer:!t,isPlayingTimer:!l,timerDuration:l?0:Number(((u=e==null?void 0:e.appearance)==null?void 0:u.autoHideInterval)||"30")}),I?s.jsx(dt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(gt,{"data-isPrediction":e.type===y.QuestionType.PREDICTION,children:p}),s.jsx(jt,{children:f.map(g=>s.jsx(Qt,{...g},g.id))})]})]})})})},es=o.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ts=o.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ss=o.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ns=o.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),is=o.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),os=o.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),he=({created:e,image:t,title:n,instantView:i})=>{const r=D.useMemo(()=>{if(e){const p=new Date(e);if(Le(p))return{date:we(p),time:Ee(p)}}return null},[e]),u=(i==null?void 0:i.image)||t;return s.jsxs(es,{children:[r&&s.jsxs(is,{children:[r.date," · ",r.time]}),(i==null?void 0:i.video)&&s.jsx(z.w,{source:i.video.url,poster:i.video.thumbnailUrl}),u&&s.jsx(os,{src:u}),s.jsxs(ts,{children:[s.jsx(ss,{children:(i==null?void 0:i.heading)||n}),s.jsx(ns,{children:i==null?void 0:i.body})]})]})},rs=o.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),as=o.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ls=({instantView:e,...t})=>s.jsxs(rs,{children:[s.jsx(he,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(as,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(o.n1,{name:"icon-external-link"})]})]}),cs=o.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:n})=>{const{loading:i,data:r}=e;return r?s.jsx(Xt,{vote:t,close:n,openedQuestion:r,isLoading:!!i}):null},ps=({gamification:e})=>{var t;const n=C.useStore(e.openedQuestion.$store),i=C.useStore(e.openedQuestion.$extendedStore);if(!n)return null;const r=n.type;return s.jsxs(cs,{children:[s.jsx(ue,{close:e.closeQuestion,type:((t=n.attributes)==null?void 0:t.type)||y.QuestionType.UNSET}),r==="question"&&s.jsx(us,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),r!=="question"&&s.jsx(ds,{openedQuestion:n})]})},ms=o.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Is=o.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),fs=o.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),hs=o.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var R=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(R||{});const te=({title:e,active:t,onClick:n})=>s.jsx(fs,{onClick:n,"data-selected":t,children:s.jsx(hs,{children:e})}),ys=({activePage:e="home",toggleActivePage:t})=>s.jsx(ms,{children:s.jsxs(Is,{"data-position":e==="home"?"left":"right",children:[s.jsx(te,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(te,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},W.apply(this,arguments)}function se(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},V(e,t)}function xs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V(e,t)}var ne=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function gs(e,t){return!!(e===t||ne(e)&&ne(t))}function js(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!gs(e[n],t[n]))return!1;return!0}function P(e,t){t===void 0&&(t=js);var n,i=[],r,u=!1;function p(){for(var m=[],c=0;c<arguments.length;c++)m[c]=arguments[c];return u&&n===this&&t(m,i)||(r=e.apply(this,m),u=!0,n=this,i=m),r}return p}var Ms=typeof performance=="object"&&typeof performance.now=="function",ie=Ms?function(){return performance.now()}:function(){return Date.now()};function oe(e){cancelAnimationFrame(e.id)}function vs(e,t){var n=ie();function i(){ie()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}var r={id:requestAnimationFrame(i)};return r}var Y=-1;function re(e){if(e===void 0&&(e=!1),Y===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Y=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Y}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var i=document.createElement("div"),r=i.style;return r.width="100px",r.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?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,n){return t};function As(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,r=e.getItemSize,u=e.getOffsetForIndexAndAlignment,p=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,c=e.initInstanceProps,I=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(N){xs(j,N);function j(T){var a;return a=N.call(this,T)||this,a._instanceProps=c(a.props,se(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:se(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=P(function(l,d,f,x){return a.props.onItemsRendered({overscanStartIndex:l,overscanStopIndex:d,visibleStartIndex:f,visibleStopIndex:x})}),a._callOnScroll=void 0,a._callOnScroll=P(function(l,d,f){return a.props.onScroll({scrollDirection:l,scrollOffset:d,scrollUpdateWasRequested:f})}),a._getItemStyle=void 0,a._getItemStyle=function(l){var d=a.props,f=d.direction,x=d.itemSize,g=d.layout,h=a._getItemStyleCache(I&&x,I&&g,I&&f),A;if(h.hasOwnProperty(l))A=h[l];else{var S=n(a.props,l,a._instanceProps),O=r(a.props,l,a._instanceProps),_=f==="horizontal"||g==="horizontal",E=f==="rtl",L=_?S:0;h[l]=A={position:"absolute",left:E?void 0:L,right:E?L:void 0,top:_?0:S,height:_?"100%":O,width:_?O:"100%"}}return A},a._getItemStyleCache=void 0,a._getItemStyleCache=P(function(l,d,f){return{}}),a._onScrollHorizontal=function(l){var d=l.currentTarget,f=d.clientWidth,x=d.scrollLeft,g=d.scrollWidth;a.setState(function(h){if(h.scrollOffset===x)return null;var A=a.props.direction,S=x;if(A==="rtl")switch(ae()){case"negative":S=-x;break;case"positive-descending":S=g-f-x;break}return S=Math.max(0,Math.min(S,g-f)),{isScrolling:!0,scrollDirection:h.scrollOffset<x?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(l){var d=l.currentTarget,f=d.clientHeight,x=d.scrollHeight,g=d.scrollTop;a.setState(function(h){if(h.scrollOffset===g)return null;var A=Math.max(0,Math.min(g,x-f));return{isScrolling:!0,scrollDirection:h.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(l){var d=a.props.outerRef;a._outerRef=l,typeof d=="function"?d(l):d!=null&&typeof d=="object"&&d.hasOwnProperty("current")&&(d.current=l)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&oe(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=vs(a._resetIsScrolling,Ts)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}j.getDerivedStateFromProps=function(a,l){return Ss(a,l),M(a),null};var v=j.prototype;return v.scrollTo=function(a){a=Math.max(0,a),this.setState(function(l){return l.scrollOffset===a?null:{scrollDirection:l.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(a,l){l===void 0&&(l="auto");var d=this.props,f=d.itemCount,x=d.layout,g=this.state.scrollOffset;a=Math.max(0,Math.min(a,f-1));var h=0;if(this._outerRef){var A=this._outerRef;x==="vertical"?h=A.scrollWidth>A.clientWidth?re():0:h=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(u(this.props,a,l,g,this._instanceProps,h))},v.componentDidMount=function(){var a=this.props,l=a.direction,d=a.initialScrollOffset,f=a.layout;if(typeof d=="number"&&this._outerRef!=null){var x=this._outerRef;l==="horizontal"||f==="horizontal"?x.scrollLeft=d:x.scrollTop=d}this._callPropsCallbacks()},v.componentDidUpdate=function(){var a=this.props,l=a.direction,d=a.layout,f=this.state,x=f.scrollOffset,g=f.scrollUpdateWasRequested;if(g&&this._outerRef!=null){var h=this._outerRef;if(l==="horizontal"||d==="horizontal")if(l==="rtl")switch(ae()){case"negative":h.scrollLeft=-x;break;case"positive-ascending":h.scrollLeft=x;break;default:var A=h.clientWidth,S=h.scrollWidth;h.scrollLeft=S-A-x;break}else h.scrollLeft=x;else h.scrollTop=x}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&oe(this._resetIsScrollingTimeoutId)},v.render=function(){var a=this.props,l=a.children,d=a.className,f=a.direction,x=a.height,g=a.innerRef,h=a.innerElementType,A=a.innerTagName,S=a.itemCount,O=a.itemData,_=a.itemKey,E=_===void 0?Ns:_,L=a.layout,ye=a.outerElementType,xe=a.outerTagName,ge=a.style,je=a.useIsScrolling,Me=a.width,F=this.state.isScrolling,U=f==="horizontal"||L==="horizontal",ve=U?this._onScrollHorizontal:this._onScrollVertical,B=this._getRangeToRender(),Te=B[0],Ne=B[1],H=[];if(S>0)for(var w=Te;w<=Ne;w++)H.push(D.createElement(l,{data:O,key:E(w,O),index:w,isScrolling:je?F:void 0,style:this._getItemStyle(w)}));var Z=i(this.props,this._instanceProps);return D.createElement(ye||xe||"div",{className:d,onScroll:ve,ref:this._outerRefSetter,style:W({position:"relative",height:x,width:Me,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},ge)},D.createElement(h||A||"div",{children:H,ref:g,style:{height:U?"100%":Z,pointerEvents:F?"none":void 0,width:U?Z:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var l=this._getRangeToRender(),d=l[0],f=l[1],x=l[2],g=l[3];this._callOnItemsRendered(d,f,x,g)}}if(typeof this.props.onScroll=="function"){var h=this.state,A=h.scrollDirection,S=h.scrollOffset,O=h.scrollUpdateWasRequested;this._callOnScroll(A,S,O)}},v._getRangeToRender=function(){var a=this.props,l=a.itemCount,d=a.overscanCount,f=this.state,x=f.isScrolling,g=f.scrollDirection,h=f.scrollOffset;if(l===0)return[0,0,0,0];var A=p(this.props,h,this._instanceProps),S=m(this.props,A,h,this._instanceProps),O=!x||g==="backward"?Math.max(1,d):1,_=!x||g==="forward"?Math.max(1,d):1;return[Math.max(0,A-O),Math.max(0,Math.min(l-1,S+_)),A,S]},j}(D.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Ss=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Ds=As({getItemOffset:function(t,n){var i=t.itemSize;return n*i},getItemSize:function(t,n){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var n=t.itemCount,i=t.itemSize;return i*n},getOffsetForIndexAndAlignment:function(t,n,i,r,u,p){var m=t.direction,c=t.height,I=t.itemCount,M=t.itemSize,N=t.layout,j=t.width,v=m==="horizontal"||N==="horizontal",T=v?j:c,a=Math.max(0,I*M-T),l=Math.min(a,n*M),d=Math.max(0,n*M-T+M+p);switch(i==="smart"&&(r>=d-T&&r<=l+T?i="auto":i="center"),i){case"start":return l;case"end":return d;case"center":{var f=Math.round(d+(l-d)/2);return f<Math.ceil(T/2)?0:f>a+Math.floor(T/2)?a:f}case"auto":default:return r>=d&&r<=l?r:r<d?d:l}},getStartIndexForOffset:function(t,n){var i=t.itemCount,r=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(n/r)))},getStopIndexForStartIndex:function(t,n,i){var r=t.direction,u=t.height,p=t.itemCount,m=t.itemSize,c=t.layout,I=t.width,M=r==="horizontal"||c==="horizontal",N=n*m,j=M?I:u,v=Math.ceil((j+i-N)/m);return Math.max(0,Math.min(p-1,n+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function zs(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,i=e.startIndex,r=e.stopIndex;return!(i>n||r<t)}function Os(e){for(var t=e.isItemLoaded,n=e.itemCount,i=e.minimumBatchSize,r=e.startIndex,u=e.stopIndex,p=[],m=null,c=null,I=r;I<=u;I++){var M=t(I);M?c!==null&&(p.push(m,c),m=c=null):(c=I,m===null&&(m=I))}if(c!==null){for(var N=Math.min(Math.max(c,m+i-1),n-1),j=c+1;j<=N&&!t(j);j++)c=j;p.push(m,c)}if(p.length)for(;p[1]-p[0]+1<i&&p[0]>0;){var v=p[0]-1;if(!t(v))p[0]=v;else break}return p}var _s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Cs=function(){function e(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),ks=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},le=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},bs=function(e){ks(t,e);function t(){var n,i,r,u;_s(this,t);for(var p=arguments.length,m=Array(p),c=0;c<p;c++)m[c]=arguments[c];return u=(i=(r=le(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(m))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(I){var M=I.visibleStartIndex,N=I.visibleStopIndex;r._lastRenderedStartIndex=M,r._lastRenderedStopIndex=N,r._ensureRowsLoaded(M,N)},r._setRef=function(I){r._listRef=I},i),le(r,u)}return Cs(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,r){var u=this.props,p=u.isItemLoaded,m=u.itemCount,c=u.minimumBatchSize,I=c===void 0?10:c,M=u.threshold,N=M===void 0?15:M,j=Os({isItemLoaded:p,itemCount:m,minimumBatchSize:I,startIndex:Math.max(0,i-N),stopIndex:Math.min(m-1,r+N)});(this._memoizedUnloadedRanges.length!==j.length||this._memoizedUnloadedRanges.some(function(v,T){return j[T]!==v}))&&(this._memoizedUnloadedRanges=j,this._loadUnloadedRanges(j))}},{key:"_loadUnloadedRanges",value:function(i){for(var r=this,u=this.props.loadMoreItems||this.props.loadMoreRows,p=function(I){var M=i[I],N=i[I+1],j=u(M,N);j!=null&&j.then(function(){if(zs({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:M,stopIndex:N})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(M,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)p(m)}}]),t}(D.PureComponent);const ws=o.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Es=o.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ls=o.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Qs=o.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),$s=o.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Rs=o.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Us=o.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),qs=()=>o.n1,Ps=o.styled_default(qs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Ys=({rank:e,avatar:t,name:n,points:i,isCurrentUser:r,openItemDetail:u,style:p})=>s.jsxs(ws,{onClick:u,style:p,children:[s.jsx(Es,{children:e||0}),s.jsxs($s,{children:[t?s.jsx(Ls,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Qs,{children:pe(n||"")}),s.jsxs(Rs,{children:[s.jsx(Us,{children:n||""}),r&&s.jsx(Ps,{name:"icon-star"})]})]}),s.jsx("div",{children:me(i)})]}),Ws=o.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Vs=({items:e,currentUserId:t,openItemDetail:n,fetchMore:i})=>s.jsx(z.AutoSizer,{children:({width:r,height:u})=>s.jsx(bs,{isItemLoaded:p=>p<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:p,ref:m})=>s.jsx(Ws,{children:s.jsx(Ds,{itemSize:56,onItemsRendered:p,ref:m,itemCount:e.length,width:r,height:u,children:({index:c,style:I})=>s.jsx(Ys,{style:{...I,maxHeight:48},...e[c],openItemDetail:()=>n(e[c].userId),isCurrentUser:!!t&&t===e[c].userId},e[c].userId)})})})}),Fs=({deepLink:e})=>{const{data:t}=C.useStore(e.$store);return s.jsx(z.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}=C.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Vs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Fs,{deepLink:e.deepLink})},Hs=o.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Zs=o.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Gs=o.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Js=o.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Ks=()=>o.n1,$=o.styled_default(Ks())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Xs=()=>o.n1,en=o.styled_default(Xs())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),tn=o.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),sn=o.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),nn=o.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),on={[y.PickHistoryStatus.LOST]:s.jsx($,{name:"incorrectVoted"}),[y.PickHistoryStatus.WON]:s.jsx($,{name:"icon-check"}),[y.PickHistoryStatus.UNSET]:s.jsx($,{name:"icon-arrow"}),[y.PickHistoryStatus.DNP]:s.jsx($,{name:"icon-arrow"})},rn=({questionId:e,questionType:t,questionStatus:n,subject:i,openForVoting:r,openQuestion:u,status:p})=>{const m=z.o[t],c=on[p];return m?s.jsxs(Hs,{onClick:()=>u==null?void 0:u(e),children:[s.jsxs(sn,{children:[s.jsxs(Zs,{children:[s.jsx(en,{"data-type-trivia":t===y.QuestionType.TRIVIA,"data-type-poll":t===y.QuestionType.POLL,name:m.iconName}),s.jsxs(tn,{children:[m.label,t===y.QuestionType.TRIVIA&&n===y.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Gs,{children:i||""})]}),s.jsx(Js,{children:r?s.jsx(nn,{children:"Play"}):c})]}):null},an=o.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),ln=o.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),cn=({openInsight:e,questionId:t,...n})=>s.jsxs(an,{children:[s.jsx(he,{questionId:t,...n}),e&&s.jsx(ln,{onClick:()=>e(t),children:"View Insight"})]}),dn=o.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),un=({questions:e,openQuestion:t})=>s.jsx(dn,{children:e==null?void 0:e.map(n=>{var i,r;if(n.type==="question"&&((i=n.attributes)==null?void 0:i.attributes.case)==="question"){const u=n.attributes.attributes.value;return s.jsx(rn,{openQuestion:t,...u},u.questionId)}if(n.type==="insight"&&((r=n.attributes)==null?void 0:r.attributes.case)==="insight"){const u=n.attributes.attributes.value;return s.jsx(cn,{openInsight:t,...u},u.questionId)}return null})}),pn=({store:e,openQuestion:t})=>{const n=C.useStore(e);return n!=null&&n.data?s.jsx(un,{openQuestion:t,questions:n.data}):s.jsx("div",{children:"wait questions..."})},mn=({userSummary:e})=>{var t,n;const i=C.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(Ie,{...i.data.summary,successRate:(n=i.data.percentage)==null?void 0:n.correct}):s.jsx("div",{children:"wait user..."})},In=({gamification:e})=>{const[t,n]=D.useState(R.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(z.a,{style:{paddingBottom:"4px"},children:s.jsx(ys,{activePage:t,toggleActivePage:n})}),t===R.HOME&&s.jsxs(z.r,{children:[s.jsx(z.a,{style:{paddingTop:"12px"},children:s.jsx(mn,{userSummary:e.userSummary})}),s.jsx(z.n,{children:s.jsx(pn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===R.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Bs,{gamification:e})})]})},fn=()=>z.d,ce=o.styled_default(fn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),hn=o.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),yn=({correct:e,incorrect:t})=>{const n=e+t;return n===0?0:Math.round(e/n*100)},xn=({gamification:e,className:t})=>{const n=C.useStore(e.openedQuestion.$store),i=C.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[n&&s.jsx(ce,{className:t,children:s.jsx(ps,{gamification:e})}),i&&s.jsx(ce,{className:t,children:s.jsxs(hn,{children:[s.jsx(ue,{label:"Friend's Rank",close:e.closeUser}),s.jsx(z.a,{children:s.jsx(Ie,{...i,successRate:yn(i)})})]})}),s.jsx(z.r,{className:t,"data-nav":"true",children:s.jsx(In,{gamification:e})})]})};exports.default=xn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),T=require("react"),Ae=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Se=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),De=()=>n.n1,ze=n.styled_default(De())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ke=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Oe=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),we=()=>n.n1,Ce=n.styled_default(we())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:r})=>{const i=e?n.o[e]:{label:r,iconName:void 0};return s.jsxs(Ae,{children:[s.jsxs(Se,{children:[(i==null?void 0:i.iconName)&&s.jsx(ze,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(ke,{children:i.label})]}),s.jsx(Oe,{onClick:t,children:s.jsx(Ce,{name:"icon-cross"})})]})},de=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ue=e=>e?e.toLocaleString("en-US"):"0",_e=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),be=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Ee=e=>!isNaN(e.getTime()),Le=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),$e=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),V=({indicator:e,title:t})=>s.jsxs(Le,{children:[s.jsx($e,{children:t}),s.jsx(Re,{children:e})]}),Qe=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Ue=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),_=({indicator:e,title:t})=>s.jsxs(Qe,{children:[s.jsx(Ue,{children:e}),s.jsx(Pe,{children:t})]}),qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Ye=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),We=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ve=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Be=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),He=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ze=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Je=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Ke=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Xe=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),et=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),tt=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),st=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),nt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),it=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",pe=({avatar:e,name:t,points:r,friendsRank:i,rank:a,streak:l,correct:c,incorrect:m,inTop:d,successRate:f})=>s.jsxs(qe,{children:[s.jsx(Ye,{children:s.jsxs(Fe,{children:[s.jsxs(it,{children:[e&&s.jsx(Ve,{alt:"avatar",src:e}),!e&&s.jsx(nt,{children:de(t||"")})]}),s.jsxs(Be,{children:[s.jsx(He,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Je,{children:[s.jsx(Ze,{alt:"rank-icon",src:rt}),s.jsxs(Ke,{children:[ue(r),s.jsx(Xe,{children:"PTS"})]})]}),s.jsx(et,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(We,{children:[s.jsxs(tt,{children:[s.jsx(V,{indicator:i||0,title:"Friends rank"}),s.jsx(V,{indicator:a||0,title:"Global rank"})]}),s.jsxs(st,{children:[s.jsx(_,{indicator:l||0,title:"Win streak"}),s.jsx(_,{indicator:c||0,title:"Correct"}),s.jsx(_,{indicator:m||0,title:"Incorrect"}),s.jsx(_,{indicator:`${f||0}%`,title:"Succ. rate"})]})]})]}),at=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),ot=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),lt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ct=({title:e,description:t})=>s.jsxs(at,{children:[s.jsx(n.n1,{name:"icon-check-circle"}),s.jsx(ot,{children:e}),s.jsx(lt,{children:t})]}),dt=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ut=()=>n.n1,pt=n.styled_default(ut())({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}),mt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),$=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ft=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ht=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:r,questionType:i,hasCorrectAnswer:a,questionStatus:l})=>{const c=r&&(i===n.QuestionType.TRIVIA||i===n.QuestionType.PREDICTION);if(!c&&l!==n.QuestionStatus.RESOLVED||l===n.QuestionStatus.RESOLVED&&i===n.QuestionType.PREDICTION&&!r)return null;const m=i===n.QuestionType.PREDICTION&&!a,d=t?"correct":"incorrect",f=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(dt,{"data-isPrediction":m,children:[l===n.QuestionStatus.RESOLVED&&i===n.QuestionType.TRIVIA&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(B,{children:s.jsx(n.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx($,{children:"Question Expired"})}),s.jsx(ft,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),c&&m&&s.jsxs(s.Fragment,{children:[s.jsx(pt,{name:"icon-prediction"}),s.jsx($,{children:"Stay tuned to see if your prediction was correct."})]}),c&&a&&s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-feedbackType":d,children:s.jsx(n.n1,{name:d})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(mt,{"data-feedbackType":d,children:f==null?void 0:f.title}),s.jsx($,{children:f==null?void 0:f.description})]})})]})]})},It=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),yt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),gt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),xt=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),jt=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),vt=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Mt=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Tt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Nt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),me=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),At=()=>me,St=n.styled_default(At())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Dt=()=>me,zt=n.styled_default(Dt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),kt=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ot=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),wt=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Ct=()=>n.n1,_t=n.styled_default(Ct())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(St,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Tt,{children:s.jsx(Nt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(zt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},bt=({questionType:e,hasCorrectAnswer:t,correct:r,youVoted:i,questionVoted:a})=>{if(e===n.QuestionType.POLL&&i)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&a)return i?r?"correct":"incorrect":"unset";if(i)return"correct"}return e===n.QuestionType.TRIVIA&&a&&i?r?"correct":"incorrect":"unset"},Et=({questionType:e,questionVoted:t,correct:r,hasCorrectAnswer:i,questionStatus:a})=>e===n.QuestionType.TRIVIA?t&&r:e===n.QuestionType.PREDICTION?t&&r&&i||a===n.QuestionStatus.RESOLVED&&r:!1,Lt=e=>{var t;const{id:r,icon:i,text:a,percentageDecimal:l,onVote:c,youSelected:m,questionVoted:d,imageMode:f,answerTimeExpired:v,questionStatus:g,isLoading:y,questionType:M,correct:N,hasCorrectAnswer:o}=e,u=bt(e),p=Et({questionType:M,questionVoted:d,correct:N,hasCorrectAnswer:o,questionStatus:g}),h=g===n.QuestionStatus.RESOLVED&&M===n.QuestionType.PREDICTION,I=d||h;return s.jsxs(jt,{value:r,"data-selected":m,"data-answerState":u,disabled:d||y||v||h,"data-isNotChecked":d&&!m&&u!=="incorrect",onClick:c,children:[s.jsx(vt,{"data-answerState":u,style:{width:`${I?l:0}%`}}),s.jsxs(Mt,{children:[i&&f&&((t=G[f])==null?void 0:t.call(G,i)),s.jsx(kt,{children:a}),I&&s.jsxs(Ot,{children:[p&&s.jsx(_t,{name:"selected"}),s.jsx(wt,{children:s.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,$t=({isPlaying:e,duration:t,startAt:r=0,updateInterval:i=0,onComplete:a,onUpdate:l})=>{let[c,m]=T.useState(r),d=T.useRef(0),f=T.useRef(r),v=T.useRef(r*-1e3),g=T.useRef(null),y=T.useRef(null),M=T.useRef(null),N=p=>{let h=p/1e3;if(y.current===null){y.current=h,g.current=requestAnimationFrame(N);return}let I=h-y.current,j=d.current+I;y.current=h,d.current=j;let x=f.current+(i===0?j:(j/i|0)*i),A=f.current+j,S=typeof t=="number"&&A>=t;m(S?t:x),S||(g.current=requestAnimationFrame(N))},o=()=>{g.current&&cancelAnimationFrame(g.current),M.current&&clearTimeout(M.current),y.current=null},u=T.useCallback(p=>{o(),d.current=0;let h=typeof p=="number"?p:r;f.current=h,m(h),e&&(g.current=requestAnimationFrame(N))},[e,r]);return Z(()=>{if(l==null||l(c),t&&c>=t){v.current+=t*1e3;let{shouldRepeat:p=!1,delay:h=0,newStartAt:I}=(a==null?void 0:a(v.current/1e3))||{};p&&(M.current=setTimeout(()=>u(I),h*1e3))}},[c,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),o),[e,t,i]),{elapsedTime:c,reset:u}},Rt=(e,t,r)=>{let i=e/2,a=t/2,l=i-a,c=2*l,m=r==="clockwise"?"1,0":"0,1",d=2*Math.PI*l;return{path:`m ${i},${a} a ${l},${l} 0 ${m} 0,${c} a ${l},${l} 0 ${m} 0,-${c}`,pathLength:d}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Qt=e=>({position:"relative",width:e,height:e}),Ut={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},fe=(e,t,r,i,a)=>{if(i===0)return t;let l=(a?i-e:e)/i;return t+r*l},K=e=>{var t,r;return(r=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,a,l,c)=>`#${a}${a}${l}${l}${c}${c}`).substring(1).match(/.{2}/g))==null?void 0:t.map(i=>parseInt(i,16)))!=null?r:[]},Pt=(e,t)=>{var r;let{colors:i,colorsTime:a,isSmoothColorTransition:l=!0}=e;if(typeof i=="string")return i;let c=(r=a==null?void 0:a.findIndex((y,M)=>y>=t&&t>=a[M+1]))!=null?r:-1;if(!a||c===-1)return i[0];if(!l)return i[c];let m=a[c]-t,d=a[c]-a[c+1],f=K(i[c]),v=K(i[c+1]),g=!!e.isGrowing;return`rgb(${f.map((y,M)=>fe(m,y,v[M]-y,d,g)|0).join(",")})`},qt=e=>{let{duration:t,initialRemainingTime:r,updateInterval:i,size:a=180,strokeWidth:l=12,trailStrokeWidth:c,isPlaying:m=!1,isGrowing:d=!1,rotation:f="clockwise",onComplete:v,onUpdate:g}=e,y=T.useRef(),M=Math.max(l,c??0),{path:N,pathLength:o}=Rt(a,M,f),{elapsedTime:u}=$t({isPlaying:m,duration:t,startAt:J(t,r),updateInterval:i,onUpdate:typeof g=="function"?h=>{let I=Math.ceil(t-h);I!==y.current&&(y.current=I,g(I))}:void 0,onComplete:typeof v=="function"?h=>{var I;let{shouldRepeat:j,delay:x,newInitialRemainingTime:A}=(I=v(h))!=null?I:{};if(j)return{shouldRepeat:j,delay:x,newStartAt:J(t,A)}}:void 0}),p=t-u;return{elapsedTime:u,path:N,pathLength:o,remainingTime:Math.ceil(p),rotation:f,size:a,stroke:Pt(e,p),strokeDashoffset:fe(u,0,o,t,d),strokeWidth:l}},he=e=>{let{children:t,strokeLinecap:r,trailColor:i,trailStrokeWidth:a}=e,{path:l,pathLength:c,stroke:m,strokeDashoffset:d,remainingTime:f,elapsedTime:v,size:g,strokeWidth:y}=qt(e);return T.createElement("div",{style:Qt(g)},T.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:l,fill:"none",stroke:i??"#d9d9d9",strokeWidth:a??y}),T.createElement("path",{d:l,fill:"none",stroke:m,strokeLinecap:r??"round",strokeWidth:y,strokeDasharray:c,strokeDashoffset:d})),typeof t=="function"&&T.createElement("div",{style:Ut},t({remainingTime:f,elapsedTime:v,color:m})))};he.displayName="CountdownCircleTimer";const Yt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Wt=[10,10,0],Ft=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Bt=n.E.NEUTRALS_GRAY3,Ht=({isPlaying:e=!0,duration:t=30,onTimerExpired:r})=>{const[i,a]=T.useState(t>10?Vt:X),l=({remainingTime:d})=>s.jsx(Ft,{children:d}),c=T.useCallback(()=>{r==null||r(),a(Bt)},[r,a]),m=T.useCallback(d=>{d===10&&a(X)},[a]);return s.jsx(he,{isPlaying:e,duration:t,colors:Yt,colorsTime:Wt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:c,onUpdate:m,children:l})},Gt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Zt=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Jt=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Kt=()=>n.n1,Xt=n.styled_default(Kt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),es=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),ts=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),ss=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),ns=({title:e,points:t,isPlayingTimer:r,isTimer:i,questionType:a,timerDuration:l,onTimerExpired:c})=>s.jsxs(Gt,{children:[s.jsxs(Zt,{children:[e&&s.jsx(Jt,{children:e}),t!==void 0&&a!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Xt,{name:"icon-trophy"}),s.jsxs(es,{children:[s.jsx(ts,{children:t}),s.jsx(ss,{children:"PTS"})]})]})]}),i&&s.jsx(Ht,{isPlaying:r,onTimerExpired:c,duration:l})]}),is=({openedQuestion:e,isLoading:t,vote:r,close:i})=>{var a,l;const c=e.subject,m=e.type,d=(a=e.options)==null?void 0:a.options,[f,v]=T.useState(!1),[g,y]=T.useState(""),M=e==null?void 0:e.id,N=T.useCallback(async j=>{if(M){const x=j.currentTarget.value;y(x),await r(M,x)}},[M,y,r]),o=T.useCallback(()=>{v(!0),setTimeout(i,3e3)},[i]),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]),h=T.useMemo(()=>e?e.answers.map(j=>{var x;return{...j,questionVoted:!!u,youSelected:g===j.id,isLoading:t,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:f,questionStatus:e.status,imageMode:(x=e.appearance)==null?void 0:x.images,onVote:N}}):[],[p,f,t,e,u,N,g]),I=d&&(d.case==="trivia"||d.case==="prediction")?d.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(It,{children:s.jsxs(yt,{children:[I&&s.jsx(ht,{feedbackMessages:I,questionVoted:!!u,questionVotedCorrectly:u==null?void 0:u.correct,questionType:m,hasCorrectAnswer:p,questionStatus:e.status}),e.type!==n.QuestionType.PREDICTION&&s.jsx(ns,{title:f?"Time expired":e.type===n.QuestionType.POLL?"Time remaining":"To win",points:f?void 0:100,onTimerExpired:o,questionType:e.type,isTimer:!t,isPlayingTimer:!u,timerDuration:u?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),f?s.jsx(ct,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(gt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:c}),s.jsx(xt,{children:h.map(j=>s.jsx(Lt,{...j},j.id))})]})]})})})},rs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),as=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),os=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ls=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),cs=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),ds=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),Ie=({created:e,image:t,title:r,instantView:i})=>{const a=T.useMemo(()=>{if(e){const c=new Date(e);if(Ee(c))return{date:_e(c),time:be(c)}}return null},[e]),l=(i==null?void 0:i.image)||t;return s.jsxs(rs,{children:[a&&s.jsxs(cs,{children:[a.date," · ",a.time]}),(i==null?void 0:i.video)&&s.jsx(n.w,{source:i.video.url,poster:i.video.thumbnailUrl}),l&&s.jsx(ds,{src:l}),s.jsxs(as,{children:[s.jsx(os,{children:(i==null?void 0:i.heading)||r}),s.jsx(ls,{children:i==null?void 0:i.body})]})]})},us=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ps=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ms=({instantView:e,...t})=>s.jsxs(us,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(ps,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.n1,{name:"icon-external-link"})]})]}),fs=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),hs=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ms,{created:e.attributes.created,...e.attributes.attributes.value}):null},Is=({extendedQuestion:e,vote:t,close:r})=>{const{loading:i,data:a}=e;return a?s.jsx(is,{vote:t,close:r,openedQuestion:a,isLoading:!!i}):null},ys=({gamification:e})=>{var t;const r=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedQuestion.$extendedStore);if(!r)return null;const a=r.type;return s.jsxs(fs,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=r.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(Is,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),a!=="question"&&s.jsx(hs,{openedQuestion:r})]})},gs=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),xs=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),js=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),vs=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var E=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(E||{});const ee=({title:e,active:t,onClick:r})=>s.jsx(js,{onClick:r,"data-selected":t,children:s.jsx(vs,{children:e})}),Ms=({activePage:e="home",toggleActivePage:t})=>s.jsx(gs,{children:s.jsxs(xs,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,a){return i.__proto__=a,i},P(e,t)}function Ts(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,P(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Ns(e,t){return!!(e===t||se(e)&&se(t))}function As(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!Ns(e[r],t[r]))return!1;return!0}function R(e,t){t===void 0&&(t=As);var r,i=[],a,l=!1;function c(){for(var m=[],d=0;d<arguments.length;d++)m[d]=arguments[d];return l&&r===this&&t(m,i)||(a=e.apply(this,m),l=!0,r=this,i=m),a}return c}var Ss=typeof performance=="object"&&typeof performance.now=="function",ne=Ss?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function Ds(e,t){var r=ne();function i(){ne()-r>=t?e.call(null):a.id=requestAnimationFrame(i)}var a={id:requestAnimationFrame(i)};return a}var Q=-1;function re(e){if(e===void 0&&(e=!1),Q===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Q=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Q}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),a=i.style;return a.width="100px",a.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?k="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?k="negative":k="positive-ascending"),document.body.removeChild(t),k}return k}var zs=150,ks=function(t,r){return t};function Os(e){var t,r=e.getItemOffset,i=e.getEstimatedTotalSize,a=e.getItemSize,l=e.getOffsetForIndexAndAlignment,c=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,d=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(g){Ts(y,g);function y(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,h,I){return o.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:p,visibleStartIndex:h,visibleStopIndex:I})}),o._callOnScroll=void 0,o._callOnScroll=R(function(u,p,h){return o.props.onScroll({scrollDirection:u,scrollOffset:p,scrollUpdateWasRequested:h})}),o._getItemStyle=void 0,o._getItemStyle=function(u){var p=o.props,h=p.direction,I=p.itemSize,j=p.layout,x=o._getItemStyleCache(f&&I,f&&j,f&&h),A;if(x.hasOwnProperty(u))A=x[u];else{var S=r(o.props,u,o._instanceProps),D=a(o.props,u,o._instanceProps),z=h==="horizontal"||j==="horizontal",w=h==="rtl",C=z?S:0;x[u]=A={position:"absolute",left:w?void 0:C,right:w?C:void 0,top:z?0:S,height:z?"100%":D,width:z?D:"100%"}}return A},o._getItemStyleCache=void 0,o._getItemStyleCache=R(function(u,p,h){return{}}),o._onScrollHorizontal=function(u){var p=u.currentTarget,h=p.clientWidth,I=p.scrollLeft,j=p.scrollWidth;o.setState(function(x){if(x.scrollOffset===I)return null;var A=o.props.direction,S=I;if(A==="rtl")switch(ae()){case"negative":S=-I;break;case"positive-descending":S=j-h-I;break}return S=Math.max(0,Math.min(S,j-h)),{isScrolling:!0,scrollDirection:x.scrollOffset<I?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(u){var p=u.currentTarget,h=p.clientHeight,I=p.scrollHeight,j=p.scrollTop;o.setState(function(x){if(x.scrollOffset===j)return null;var A=Math.max(0,Math.min(j,I-h));return{isScrolling:!0,scrollDirection:x.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(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=Ds(o._resetIsScrolling,zs)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}y.getDerivedStateFromProps=function(o,u){return ws(o,u),v(o),null};var M=y.prototype;return M.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)},M.scrollToItem=function(o,u){u===void 0&&(u="auto");var p=this.props,h=p.itemCount,I=p.layout,j=this.state.scrollOffset;o=Math.max(0,Math.min(o,h-1));var x=0;if(this._outerRef){var A=this._outerRef;I==="vertical"?x=A.scrollWidth>A.clientWidth?re():0:x=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(l(this.props,o,u,j,this._instanceProps,x))},M.componentDidMount=function(){var o=this.props,u=o.direction,p=o.initialScrollOffset,h=o.layout;if(typeof p=="number"&&this._outerRef!=null){var I=this._outerRef;u==="horizontal"||h==="horizontal"?I.scrollLeft=p:I.scrollTop=p}this._callPropsCallbacks()},M.componentDidUpdate=function(){var o=this.props,u=o.direction,p=o.layout,h=this.state,I=h.scrollOffset,j=h.scrollUpdateWasRequested;if(j&&this._outerRef!=null){var x=this._outerRef;if(u==="horizontal"||p==="horizontal")if(u==="rtl")switch(ae()){case"negative":x.scrollLeft=-I;break;case"positive-ascending":x.scrollLeft=I;break;default:var A=x.clientWidth,S=x.scrollWidth;x.scrollLeft=S-A-I;break}else x.scrollLeft=I;else x.scrollTop=I}this._callPropsCallbacks()},M.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},M.render=function(){var o=this.props,u=o.children,p=o.className,h=o.direction,I=o.height,j=o.innerRef,x=o.innerElementType,A=o.innerTagName,S=o.itemCount,D=o.itemData,z=o.itemKey,w=z===void 0?ks:z,C=o.layout,ye=o.outerElementType,ge=o.outerTagName,xe=o.style,je=o.useIsScrolling,ve=o.width,q=this.state.isScrolling,L=h==="horizontal"||C==="horizontal",Me=L?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),Te=Y[0],Ne=Y[1],W=[];if(S>0)for(var O=Te;O<=Ne;O++)W.push(T.createElement(u,{data:D,key:w(O,D),index:O,isScrolling:je?q:void 0,style:this._getItemStyle(O)}));var F=i(this.props,this._instanceProps);return T.createElement(ye||ge||"div",{className:p,onScroll:Me,ref:this._outerRefSetter,style:U({position:"relative",height:I,width:ve,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:h},xe)},T.createElement(x||A||"div",{children:W,ref:j,style:{height:L?"100%":F,pointerEvents:q?"none":void 0,width:L?F:"100%"}}))},M._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var u=this._getRangeToRender(),p=u[0],h=u[1],I=u[2],j=u[3];this._callOnItemsRendered(p,h,I,j)}}if(typeof this.props.onScroll=="function"){var x=this.state,A=x.scrollDirection,S=x.scrollOffset,D=x.scrollUpdateWasRequested;this._callOnScroll(A,S,D)}},M._getRangeToRender=function(){var o=this.props,u=o.itemCount,p=o.overscanCount,h=this.state,I=h.isScrolling,j=h.scrollDirection,x=h.scrollOffset;if(u===0)return[0,0,0,0];var A=c(this.props,x,this._instanceProps),S=m(this.props,A,x,this._instanceProps),D=!I||j==="backward"?Math.max(1,p):1,z=!I||j==="forward"?Math.max(1,p):1;return[Math.max(0,A-D),Math.max(0,Math.min(u-1,S+z)),A,S]},y}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var ws=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},Cs=Os({getItemOffset:function(t,r){var i=t.itemSize;return r*i},getItemSize:function(t,r){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var r=t.itemCount,i=t.itemSize;return i*r},getOffsetForIndexAndAlignment:function(t,r,i,a,l,c){var m=t.direction,d=t.height,f=t.itemCount,v=t.itemSize,g=t.layout,y=t.width,M=m==="horizontal"||g==="horizontal",N=M?y:d,o=Math.max(0,f*v-N),u=Math.min(o,r*v),p=Math.max(0,r*v-N+v+c);switch(i==="smart"&&(a>=p-N&&a<=u+N?i="auto":i="center"),i){case"start":return u;case"end":return p;case"center":{var h=Math.round(p+(u-p)/2);return h<Math.ceil(N/2)?0:h>o+Math.floor(N/2)?o:h}case"auto":default:return a>=p&&a<=u?a:a<p?p:u}},getStartIndexForOffset:function(t,r){var i=t.itemCount,a=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(r/a)))},getStopIndexForStartIndex:function(t,r,i){var a=t.direction,l=t.height,c=t.itemCount,m=t.itemSize,d=t.layout,f=t.width,v=a==="horizontal"||d==="horizontal",g=r*m,y=v?f:l,M=Math.ceil((y+i-g)/m);return Math.max(0,Math.min(c-1,r+M-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function _s(e){var t=e.lastRenderedStartIndex,r=e.lastRenderedStopIndex,i=e.startIndex,a=e.stopIndex;return!(i>r||a<t)}function bs(e){for(var t=e.isItemLoaded,r=e.itemCount,i=e.minimumBatchSize,a=e.startIndex,l=e.stopIndex,c=[],m=null,d=null,f=a;f<=l;f++){var v=t(f);v?d!==null&&(c.push(m,d),m=d=null):(d=f,m===null&&(m=f))}if(d!==null){for(var g=Math.min(Math.max(d,m+i-1),r-1),y=d+1;y<=g&&!t(y);y++)d=y;c.push(m,d)}if(c.length)for(;c[1]-c[0]+1<i&&c[0]>0;){var M=c[0]-1;if(!t(M))c[0]=M;else break}return c}var Es=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ls=function(){function e(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),$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},Rs=function(e){$s(t,e);function t(){var r,i,a,l;Es(this,t);for(var c=arguments.length,m=Array(c),d=0;d<c;d++)m[d]=arguments[d];return l=(i=(a=oe(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(f){var v=f.visibleStartIndex,g=f.visibleStopIndex;a._lastRenderedStartIndex=v,a._lastRenderedStopIndex=g,a._ensureRowsLoaded(v,g)},a._setRef=function(f){a._listRef=f},i),oe(a,l)}return Ls(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,a){var l=this.props,c=l.isItemLoaded,m=l.itemCount,d=l.minimumBatchSize,f=d===void 0?10:d,v=l.threshold,g=v===void 0?15:v,y=bs({isItemLoaded:c,itemCount:m,minimumBatchSize:f,startIndex:Math.max(0,i-g),stopIndex:Math.min(m-1,a+g)});(this._memoizedUnloadedRanges.length!==y.length||this._memoizedUnloadedRanges.some(function(M,N){return y[N]!==M}))&&(this._memoizedUnloadedRanges=y,this._loadUnloadedRanges(y))}},{key:"_loadUnloadedRanges",value:function(i){for(var a=this,l=this.props.loadMoreItems||this.props.loadMoreRows,c=function(f){var v=i[f],g=i[f+1],y=l(v,g);y!=null&&y.then(function(){if(_s({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:v,stopIndex:g})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(v,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)c(m)}}]),t}(T.PureComponent);const Qs=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Us=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ps=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),qs=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ys=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ws=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Fs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Vs=()=>n.n1,Bs=n.styled_default(Vs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Hs=({rank:e,avatar:t,name:r,points:i,isCurrentUser:a,openItemDetail:l,style:c})=>s.jsxs(Qs,{onClick:l,style:c,children:[s.jsx(Us,{children:e||0}),s.jsxs(Ys,{children:[t?s.jsx(Ps,{alt:"leaderboard-item-avatar",src:t}):s.jsx(qs,{children:de(r||"")}),s.jsxs(Ws,{children:[s.jsx(Fs,{children:r||""}),a&&s.jsx(Bs,{name:"icon-star"})]})]}),s.jsx("div",{children:ue(i)})]}),Gs=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Zs=({items:e,currentUserId:t,openItemDetail:r,fetchMore:i})=>s.jsx(n.AutoSizer,{children:({width:a,height:l})=>s.jsx(Rs,{isItemLoaded:c=>c<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:c,ref:m})=>s.jsx(Gs,{children:s.jsx(Cs,{itemSize:56,onItemsRendered:c,ref:m,itemCount:e.length,width:a,height:l,children:({index:d,style:f})=>s.jsx(Hs,{style:{...f,maxHeight:48},...e[d],openItemDetail:()=>r(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})})}),Js=({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."})},Ks=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Zs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Js,{deepLink:e.deepLink})},Xs=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),en=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),tn=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),sn=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),nn=()=>n.n1,b=n.styled_default(nn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),rn=()=>n.n1,an=n.styled_default(rn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),on=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),ln=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),cn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),dn={[n.PickHistoryStatus.LOST]:s.jsx(b,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(b,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(b,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(b,{name:"icon-arrow"})},un=({questionId:e,questionType:t,questionStatus:r,subject:i,openForVoting:a,openQuestion:l,status:c})=>{const m=n.o[t],d=dn[c];return m?s.jsxs(Xs,{onClick:()=>l==null?void 0:l(e),children:[s.jsxs(ln,{children:[s.jsxs(en,{children:[s.jsx(an,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:m.iconName}),s.jsxs(on,{children:[m.label,t===n.QuestionType.TRIVIA&&r===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(tn,{children:i||""})]}),s.jsx(sn,{children:a?s.jsx(cn,{children:"Play"}):d})]}):null},pn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),mn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),fn=({openInsight:e,questionId:t,...r})=>s.jsxs(pn,{children:[s.jsx(Ie,{questionId:t,...r}),e&&s.jsx(mn,{onClick:()=>e(t),children:"View Insight"})]}),hn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),In=({questions:e,openQuestion:t})=>s.jsx(hn,{children:e==null?void 0:e.map(r=>{var i,a;if(r.type==="question"&&((i=r.attributes)==null?void 0:i.attributes.case)==="question"){const l=r.attributes.attributes.value;return s.jsx(un,{openQuestion:t,...l},l.questionId)}if(r.type==="insight"&&((a=r.attributes)==null?void 0:a.attributes.case)==="insight"){const l=r.attributes.attributes.value;return s.jsx(fn,{openInsight:t,...l},l.questionId)}return null})}),yn=({store:e,openQuestion:t})=>{const r=n.useStore(e);return r!=null&&r.data?s.jsx(In,{openQuestion:t,questions:r.data}):s.jsx("div",{children:"wait questions..."})},gn=({userSummary:e})=>{var t,r;const i=n.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(pe,{...i.data.summary,successRate:(r=i.data.percentage)==null?void 0:r.correct}):s.jsx("div",{children:"wait user..."})},xn=({gamification:e})=>{const[t,r]=T.useState(E.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a,{style:{paddingBottom:"4px"},children:s.jsx(Ms,{activePage:t,toggleActivePage:r})}),t===E.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a,{style:{paddingTop:"12px"},children:s.jsx(gn,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(yn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===E.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Ks,{gamification:e})})]})},jn=()=>n.d$1,le=n.styled_default(jn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),vn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Mn=({correct:e,incorrect:t})=>{const r=e+t;return r===0?0:Math.round(e/r*100)},Tn=({gamification:e,className:t})=>{const r=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[r&&s.jsx(le,{className:t,children:s.jsx(ys,{gamification:e})}),i&&s.jsx(le,{className:t,children:s.jsxs(vn,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(pe,{...i,successRate:Mn(i)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(xn,{gamification:e})})]})};exports.default=Tn;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),T=require("react"),Ae=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Se=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),De=()=>n.n1,ze=n.styled_default(De())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ke=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Oe=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),we=()=>n.n1,Ce=n.styled_default(we())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:r})=>{const i=e?n.o[e]:{label:r,iconName:void 0};return s.jsxs(Ae,{children:[s.jsxs(Se,{children:[(i==null?void 0:i.iconName)&&s.jsx(ze,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(ke,{children:i.label})]}),s.jsx(Oe,{onClick:t,children:s.jsx(Ce,{name:"icon-cross"})})]})},de=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ue=e=>e?e.toLocaleString("en-US"):"0",_e=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),be=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Ee=e=>!isNaN(e.getTime()),Le=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),$e=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Re=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),V=({indicator:e,title:t})=>s.jsxs(Le,{children:[s.jsx($e,{children:t}),s.jsx(Re,{children:e})]}),Qe=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Ue=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),_=({indicator:e,title:t})=>s.jsxs(Qe,{children:[s.jsx(Ue,{children:e}),s.jsx(Pe,{children:t})]}),qe=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Ye=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),We=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ve=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Be=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),He=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ge=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ze=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Je=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Ke=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Xe=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),et=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),tt=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),st=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),nt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),it=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),rt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",pe=({avatar:e,name:t,points:r,friendsRank:i,rank:a,streak:l,correct:c,incorrect:m,inTop:u,successRate:f})=>s.jsxs(qe,{children:[s.jsx(Ye,{children:s.jsxs(Fe,{children:[s.jsxs(it,{children:[e&&s.jsx(Ve,{alt:"avatar",src:e}),!e&&s.jsx(nt,{children:de(t||"")})]}),s.jsxs(Be,{children:[s.jsx(He,{children:t}),s.jsxs(Ge,{children:[s.jsxs(Je,{children:[s.jsx(Ze,{alt:"rank-icon",src:rt}),s.jsxs(Ke,{children:[ue(r),s.jsx(Xe,{children:"PTS"})]})]}),s.jsx(et,{}),s.jsxs("div",{children:["TOP ",u||0,"%"]})]})]})]})}),s.jsxs(We,{children:[s.jsxs(tt,{children:[s.jsx(V,{indicator:i||0,title:"Friends rank"}),s.jsx(V,{indicator:a||0,title:"Global rank"})]}),s.jsxs(st,{children:[s.jsx(_,{indicator:l||0,title:"Win streak"}),s.jsx(_,{indicator:c||0,title:"Correct"}),s.jsx(_,{indicator:m||0,title:"Incorrect"}),s.jsx(_,{indicator:`${f||0}%`,title:"Succ. rate"})]})]})]}),at=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),ot=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),lt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ct=({title:e,description:t})=>s.jsxs(at,{children:[s.jsx(n.n1,{name:"icon-check-circle"}),s.jsx(ot,{children:e}),s.jsx(lt,{children:t})]}),dt=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ut=()=>n.n1,pt=n.styled_default(ut())({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}),mt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),$=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),ft=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ht=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:r,questionType:i,hasCorrectAnswer:a,questionStatus:l})=>{const c=r&&(i===n.QuestionType.TRIVIA||i===n.QuestionType.PREDICTION);if(!c&&l!==n.QuestionStatus.RESOLVED||l===n.QuestionStatus.RESOLVED&&i===n.QuestionType.PREDICTION&&!r)return null;const m=i===n.QuestionType.PREDICTION&&!a,u=t?"correct":"incorrect",f=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(dt,{"data-isPrediction":m,children:[l===n.QuestionStatus.RESOLVED&&i===n.QuestionType.TRIVIA&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(B,{children:s.jsx(n.n1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx($,{children:"Question Expired"})}),s.jsx(ft,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),c&&m&&s.jsxs(s.Fragment,{children:[s.jsx(pt,{name:"icon-prediction"}),s.jsx($,{children:"Stay tuned to see if your prediction was correct."})]}),c&&a&&s.jsxs(s.Fragment,{children:[s.jsx(B,{"data-feedbackType":u,children:s.jsx(n.n1,{name:u})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(mt,{"data-feedbackType":u,children:f==null?void 0:f.title}),s.jsx($,{children:f==null?void 0:f.description})]})})]})]})},It=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),yt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),gt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),xt=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),jt=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),vt=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Mt=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Tt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Nt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),me=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),At=()=>me,St=n.styled_default(At())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Dt=()=>me,zt=n.styled_default(Dt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),kt=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Ot=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),wt=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Ct=()=>n.n1,_t=n.styled_default(Ct())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(St,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Tt,{children:s.jsx(Nt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(zt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},bt=({questionType:e,hasCorrectAnswer:t,correct:r,youVoted:i,questionVoted:a})=>{if(e===n.QuestionType.POLL&&i)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&a)return i?r?"correct":"incorrect":"unset";if(i)return"correct"}return e===n.QuestionType.TRIVIA&&a&&i?r?"correct":"incorrect":"unset"},Et=({questionType:e,questionVoted:t,correct:r,hasCorrectAnswer:i,questionStatus:a})=>e===n.QuestionType.TRIVIA?t&&r:e===n.QuestionType.PREDICTION?t&&r&&i||a===n.QuestionStatus.RESOLVED&&r:!1,Lt=e=>{var t;const{id:r,icon:i,text:a,percentageDecimal:l,onVote:c,youSelected:m,questionVoted:u,imageMode:f,answerTimeExpired:v,questionStatus:g,isLoading:y,questionType:M,correct:N,hasCorrectAnswer:o}=e,d=bt(e),p=Et({questionType:M,questionVoted:u,correct:N,hasCorrectAnswer:o,questionStatus:g}),h=g===n.QuestionStatus.RESOLVED&&M===n.QuestionType.PREDICTION,I=u||h;return s.jsxs(jt,{value:r,"data-selected":m,"data-answerState":d,disabled:u||y||v||h,"data-isNotChecked":u&&!m&&d!=="incorrect",onClick:c,children:[s.jsx(vt,{"data-answerState":d,style:{width:`${I?l:0}%`}}),s.jsxs(Mt,{children:[i&&f&&((t=G[f])==null?void 0:t.call(G,i)),s.jsx(kt,{children:a}),I&&s.jsxs(Ot,{children:[p&&s.jsx(_t,{name:"selected"}),s.jsx(wt,{children:s.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,$t=({isPlaying:e,duration:t,startAt:r=0,updateInterval:i=0,onComplete:a,onUpdate:l})=>{let[c,m]=T.useState(r),u=T.useRef(0),f=T.useRef(r),v=T.useRef(r*-1e3),g=T.useRef(null),y=T.useRef(null),M=T.useRef(null),N=p=>{let h=p/1e3;if(y.current===null){y.current=h,g.current=requestAnimationFrame(N);return}let I=h-y.current,j=u.current+I;y.current=h,u.current=j;let x=f.current+(i===0?j:(j/i|0)*i),A=f.current+j,S=typeof t=="number"&&A>=t;m(S?t:x),S||(g.current=requestAnimationFrame(N))},o=()=>{g.current&&cancelAnimationFrame(g.current),M.current&&clearTimeout(M.current),y.current=null},d=T.useCallback(p=>{o(),u.current=0;let h=typeof p=="number"?p:r;f.current=h,m(h),e&&(g.current=requestAnimationFrame(N))},[e,r]);return Z(()=>{if(l==null||l(c),t&&c>=t){v.current+=t*1e3;let{shouldRepeat:p=!1,delay:h=0,newStartAt:I}=(a==null?void 0:a(v.current/1e3))||{};p&&(M.current=setTimeout(()=>d(I),h*1e3))}},[c,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),o),[e,t,i]),{elapsedTime:c,reset:d}},Rt=(e,t,r)=>{let i=e/2,a=t/2,l=i-a,c=2*l,m=r==="clockwise"?"1,0":"0,1",u=2*Math.PI*l;return{path:`m ${i},${a} a ${l},${l} 0 ${m} 0,${c} a ${l},${l} 0 ${m} 0,-${c}`,pathLength:u}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Qt=e=>({position:"relative",width:e,height:e}),Ut={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},fe=(e,t,r,i,a)=>{if(i===0)return t;let l=(a?i-e:e)/i;return t+r*l},K=e=>{var t,r;return(r=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,a,l,c)=>`#${a}${a}${l}${l}${c}${c}`).substring(1).match(/.{2}/g))==null?void 0:t.map(i=>parseInt(i,16)))!=null?r:[]},Pt=(e,t)=>{var r;let{colors:i,colorsTime:a,isSmoothColorTransition:l=!0}=e;if(typeof i=="string")return i;let c=(r=a==null?void 0:a.findIndex((y,M)=>y>=t&&t>=a[M+1]))!=null?r:-1;if(!a||c===-1)return i[0];if(!l)return i[c];let m=a[c]-t,u=a[c]-a[c+1],f=K(i[c]),v=K(i[c+1]),g=!!e.isGrowing;return`rgb(${f.map((y,M)=>fe(m,y,v[M]-y,u,g)|0).join(",")})`},qt=e=>{let{duration:t,initialRemainingTime:r,updateInterval:i,size:a=180,strokeWidth:l=12,trailStrokeWidth:c,isPlaying:m=!1,isGrowing:u=!1,rotation:f="clockwise",onComplete:v,onUpdate:g}=e,y=T.useRef(),M=Math.max(l,c??0),{path:N,pathLength:o}=Rt(a,M,f),{elapsedTime:d}=$t({isPlaying:m,duration:t,startAt:J(t,r),updateInterval:i,onUpdate:typeof g=="function"?h=>{let I=Math.ceil(t-h);I!==y.current&&(y.current=I,g(I))}:void 0,onComplete:typeof v=="function"?h=>{var I;let{shouldRepeat:j,delay:x,newInitialRemainingTime:A}=(I=v(h))!=null?I:{};if(j)return{shouldRepeat:j,delay:x,newStartAt:J(t,A)}}:void 0}),p=t-d;return{elapsedTime:d,path:N,pathLength:o,remainingTime:Math.ceil(p),rotation:f,size:a,stroke:Pt(e,p),strokeDashoffset:fe(d,0,o,t,u),strokeWidth:l}},he=e=>{let{children:t,strokeLinecap:r,trailColor:i,trailStrokeWidth:a}=e,{path:l,pathLength:c,stroke:m,strokeDashoffset:u,remainingTime:f,elapsedTime:v,size:g,strokeWidth:y}=qt(e);return T.createElement("div",{style:Qt(g)},T.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:l,fill:"none",stroke:i??"#d9d9d9",strokeWidth:a??y}),T.createElement("path",{d:l,fill:"none",stroke:m,strokeLinecap:r??"round",strokeWidth:y,strokeDasharray:c,strokeDashoffset:u})),typeof t=="function"&&T.createElement("div",{style:Ut},t({remainingTime:f,elapsedTime:v,color:m})))};he.displayName="CountdownCircleTimer";const Yt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Wt=[10,10,0],Ft=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Bt=n.E.NEUTRALS_GRAY3,Ht=({isPlaying:e=!0,duration:t=30,onTimerExpired:r})=>{const[i,a]=T.useState(t>10?Vt:X),l=({remainingTime:u})=>s.jsx(Ft,{children:u}),c=T.useCallback(()=>{r==null||r(),a(Bt)},[r,a]),m=T.useCallback(u=>{u===10&&a(X)},[a]);return s.jsx(he,{isPlaying:e,duration:t,colors:Yt,colorsTime:Wt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:c,onUpdate:m,children:l})},Gt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Zt=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Jt=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Kt=()=>n.n1,Xt=n.styled_default(Kt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),es=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),ts=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),ss=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),ns=({title:e,points:t,isPlayingTimer:r,isTimer:i,questionType:a,timerDuration:l,onTimerExpired:c})=>s.jsxs(Gt,{children:[s.jsxs(Zt,{children:[e&&s.jsx(Jt,{children:e}),t!==void 0&&a!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Xt,{name:"icon-trophy"}),s.jsxs(es,{children:[s.jsx(ts,{children:s.jsx(n.d,{value:t})}),s.jsx(ss,{children:"PTS"})]})]})]}),i&&s.jsx(Ht,{isPlaying:r,onTimerExpired:c,duration:l})]}),is=({openedQuestion:e,isLoading:t,vote:r,close:i})=>{var a,l;const c=e.subject,m=e.type,u=(a=e.options)==null?void 0:a.options,[f,v]=T.useState(!1),[g,y]=T.useState(""),M=e==null?void 0:e.id,N=T.useCallback(async j=>{if(M){const x=j.currentTarget.value;y(x),await r(M,x)}},[M,y,r]),o=T.useCallback(()=>{v(!0),setTimeout(i,3e3)},[i]),d=T.useMemo(()=>e==null?void 0:e.answers.find(j=>j.youVoted===!0),[e]),p=T.useMemo(()=>!!(e!=null&&e.answers.find(j=>j.correct===!0)),[e]),h=T.useMemo(()=>e?e.answers.map(j=>{var x;return{...j,questionVoted:!!d,youSelected:g===j.id,isLoading:t,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:f,questionStatus:e.status,imageMode:(x=e.appearance)==null?void 0:x.images,onVote:N}}):[],[p,f,t,e,d,N,g]),I=u&&(u.case==="trivia"||u.case==="prediction")?u.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(It,{children:s.jsxs(yt,{children:[I&&s.jsx(ht,{feedbackMessages:I,questionVoted:!!d,questionVotedCorrectly:d==null?void 0:d.correct,questionType:m,hasCorrectAnswer:p,questionStatus:e.status}),e.type!==n.QuestionType.PREDICTION&&s.jsx(ns,{title:f?"Time expired":e.type===n.QuestionType.POLL?"Time remaining":"To win",points:f?void 0:d!=null&&d.correct?d==null?void 0:d.points:0,onTimerExpired:o,questionType:e.type,isTimer:!t,isPlayingTimer:!d,timerDuration:d?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),f?s.jsx(ct,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(gt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:c}),s.jsx(xt,{children:h.map(j=>s.jsx(Lt,{...j},j.id))})]})]})})})},rs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),as=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),os=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ls=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),cs=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),ds=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),Ie=({created:e,image:t,title:r,instantView:i})=>{const a=T.useMemo(()=>{if(e){const c=new Date(e);if(Ee(c))return{date:_e(c),time:be(c)}}return null},[e]),l=(i==null?void 0:i.image)||t;return s.jsxs(rs,{children:[a&&s.jsxs(cs,{children:[a.date," · ",a.time]}),(i==null?void 0:i.video)&&s.jsx(n.w,{source:i.video.url,poster:i.video.thumbnailUrl}),l&&s.jsx(ds,{src:l}),s.jsxs(as,{children:[s.jsx(os,{children:(i==null?void 0:i.heading)||r}),s.jsx(ls,{children:i==null?void 0:i.body})]})]})},us=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ps=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ms=({instantView:e,...t})=>s.jsxs(us,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(ps,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.n1,{name:"icon-external-link"})]})]}),fs=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),hs=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ms,{created:e.attributes.created,...e.attributes.attributes.value}):null},Is=({extendedQuestion:e,vote:t,close:r})=>{const{loading:i,data:a}=e;return a?s.jsx(is,{vote:t,close:r,openedQuestion:a,isLoading:!!i}):null},ys=({gamification:e})=>{var t;const r=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedQuestion.$extendedStore);if(!r)return null;const a=r.type;return s.jsxs(fs,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=r.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),a==="question"&&s.jsx(Is,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),a!=="question"&&s.jsx(hs,{openedQuestion:r})]})},gs=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),xs=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),js=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),vs=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var E=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(E||{});const ee=({title:e,active:t,onClick:r})=>s.jsx(js,{onClick:r,"data-selected":t,children:s.jsx(vs,{children:e})}),Ms=({activePage:e="home",toggleActivePage:t})=>s.jsx(gs,{children:s.jsxs(xs,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,a){return i.__proto__=a,i},P(e,t)}function Ts(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,P(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Ns(e,t){return!!(e===t||se(e)&&se(t))}function As(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!Ns(e[r],t[r]))return!1;return!0}function R(e,t){t===void 0&&(t=As);var r,i=[],a,l=!1;function c(){for(var m=[],u=0;u<arguments.length;u++)m[u]=arguments[u];return l&&r===this&&t(m,i)||(a=e.apply(this,m),l=!0,r=this,i=m),a}return c}var Ss=typeof performance=="object"&&typeof performance.now=="function",ne=Ss?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function Ds(e,t){var r=ne();function i(){ne()-r>=t?e.call(null):a.id=requestAnimationFrame(i)}var a={id:requestAnimationFrame(i)};return a}var Q=-1;function re(e){if(e===void 0&&(e=!1),Q===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Q=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Q}var k=null;function ae(e){if(e===void 0&&(e=!1),k===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),a=i.style;return a.width="100px",a.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?k="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?k="negative":k="positive-ascending"),document.body.removeChild(t),k}return k}var zs=150,ks=function(t,r){return t};function Os(e){var t,r=e.getItemOffset,i=e.getEstimatedTotalSize,a=e.getItemSize,l=e.getOffsetForIndexAndAlignment,c=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,u=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(g){Ts(y,g);function y(N){var o;return o=g.call(this,N)||this,o._instanceProps=u(o.props,te(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:te(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=R(function(d,p,h,I){return o.props.onItemsRendered({overscanStartIndex:d,overscanStopIndex:p,visibleStartIndex:h,visibleStopIndex:I})}),o._callOnScroll=void 0,o._callOnScroll=R(function(d,p,h){return o.props.onScroll({scrollDirection:d,scrollOffset:p,scrollUpdateWasRequested:h})}),o._getItemStyle=void 0,o._getItemStyle=function(d){var p=o.props,h=p.direction,I=p.itemSize,j=p.layout,x=o._getItemStyleCache(f&&I,f&&j,f&&h),A;if(x.hasOwnProperty(d))A=x[d];else{var S=r(o.props,d,o._instanceProps),D=a(o.props,d,o._instanceProps),z=h==="horizontal"||j==="horizontal",w=h==="rtl",C=z?S:0;x[d]=A={position:"absolute",left:w?void 0:C,right:w?C:void 0,top:z?0:S,height:z?"100%":D,width:z?D:"100%"}}return A},o._getItemStyleCache=void 0,o._getItemStyleCache=R(function(d,p,h){return{}}),o._onScrollHorizontal=function(d){var p=d.currentTarget,h=p.clientWidth,I=p.scrollLeft,j=p.scrollWidth;o.setState(function(x){if(x.scrollOffset===I)return null;var A=o.props.direction,S=I;if(A==="rtl")switch(ae()){case"negative":S=-I;break;case"positive-descending":S=j-h-I;break}return S=Math.max(0,Math.min(S,j-h)),{isScrolling:!0,scrollDirection:x.scrollOffset<I?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(d){var p=d.currentTarget,h=p.clientHeight,I=p.scrollHeight,j=p.scrollTop;o.setState(function(x){if(x.scrollOffset===j)return null;var A=Math.max(0,Math.min(j,I-h));return{isScrolling:!0,scrollDirection:x.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(d){var p=o.props.outerRef;o._outerRef=d,typeof p=="function"?p(d):p!=null&&typeof p=="object"&&p.hasOwnProperty("current")&&(p.current=d)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&ie(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=Ds(o._resetIsScrolling,zs)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}y.getDerivedStateFromProps=function(o,d){return ws(o,d),v(o),null};var M=y.prototype;return M.scrollTo=function(o){o=Math.max(0,o),this.setState(function(d){return d.scrollOffset===o?null:{scrollDirection:d.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},M.scrollToItem=function(o,d){d===void 0&&(d="auto");var p=this.props,h=p.itemCount,I=p.layout,j=this.state.scrollOffset;o=Math.max(0,Math.min(o,h-1));var x=0;if(this._outerRef){var A=this._outerRef;I==="vertical"?x=A.scrollWidth>A.clientWidth?re():0:x=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(l(this.props,o,d,j,this._instanceProps,x))},M.componentDidMount=function(){var o=this.props,d=o.direction,p=o.initialScrollOffset,h=o.layout;if(typeof p=="number"&&this._outerRef!=null){var I=this._outerRef;d==="horizontal"||h==="horizontal"?I.scrollLeft=p:I.scrollTop=p}this._callPropsCallbacks()},M.componentDidUpdate=function(){var o=this.props,d=o.direction,p=o.layout,h=this.state,I=h.scrollOffset,j=h.scrollUpdateWasRequested;if(j&&this._outerRef!=null){var x=this._outerRef;if(d==="horizontal"||p==="horizontal")if(d==="rtl")switch(ae()){case"negative":x.scrollLeft=-I;break;case"positive-ascending":x.scrollLeft=I;break;default:var A=x.clientWidth,S=x.scrollWidth;x.scrollLeft=S-A-I;break}else x.scrollLeft=I;else x.scrollTop=I}this._callPropsCallbacks()},M.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},M.render=function(){var o=this.props,d=o.children,p=o.className,h=o.direction,I=o.height,j=o.innerRef,x=o.innerElementType,A=o.innerTagName,S=o.itemCount,D=o.itemData,z=o.itemKey,w=z===void 0?ks:z,C=o.layout,ye=o.outerElementType,ge=o.outerTagName,xe=o.style,je=o.useIsScrolling,ve=o.width,q=this.state.isScrolling,L=h==="horizontal"||C==="horizontal",Me=L?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),Te=Y[0],Ne=Y[1],W=[];if(S>0)for(var O=Te;O<=Ne;O++)W.push(T.createElement(d,{data:D,key:w(O,D),index:O,isScrolling:je?q:void 0,style:this._getItemStyle(O)}));var F=i(this.props,this._instanceProps);return T.createElement(ye||ge||"div",{className:p,onScroll:Me,ref:this._outerRefSetter,style:U({position:"relative",height:I,width:ve,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:h},xe)},T.createElement(x||A||"div",{children:W,ref:j,style:{height:L?"100%":F,pointerEvents:q?"none":void 0,width:L?F:"100%"}}))},M._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var d=this._getRangeToRender(),p=d[0],h=d[1],I=d[2],j=d[3];this._callOnItemsRendered(p,h,I,j)}}if(typeof this.props.onScroll=="function"){var x=this.state,A=x.scrollDirection,S=x.scrollOffset,D=x.scrollUpdateWasRequested;this._callOnScroll(A,S,D)}},M._getRangeToRender=function(){var o=this.props,d=o.itemCount,p=o.overscanCount,h=this.state,I=h.isScrolling,j=h.scrollDirection,x=h.scrollOffset;if(d===0)return[0,0,0,0];var A=c(this.props,x,this._instanceProps),S=m(this.props,A,x,this._instanceProps),D=!I||j==="backward"?Math.max(1,p):1,z=!I||j==="forward"?Math.max(1,p):1;return[Math.max(0,A-D),Math.max(0,Math.min(d-1,S+z)),A,S]},y}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var ws=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},Cs=Os({getItemOffset:function(t,r){var i=t.itemSize;return r*i},getItemSize:function(t,r){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var r=t.itemCount,i=t.itemSize;return i*r},getOffsetForIndexAndAlignment:function(t,r,i,a,l,c){var m=t.direction,u=t.height,f=t.itemCount,v=t.itemSize,g=t.layout,y=t.width,M=m==="horizontal"||g==="horizontal",N=M?y:u,o=Math.max(0,f*v-N),d=Math.min(o,r*v),p=Math.max(0,r*v-N+v+c);switch(i==="smart"&&(a>=p-N&&a<=d+N?i="auto":i="center"),i){case"start":return d;case"end":return p;case"center":{var h=Math.round(p+(d-p)/2);return h<Math.ceil(N/2)?0:h>o+Math.floor(N/2)?o:h}case"auto":default:return a>=p&&a<=d?a:a<p?p:d}},getStartIndexForOffset:function(t,r){var i=t.itemCount,a=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(r/a)))},getStopIndexForStartIndex:function(t,r,i){var a=t.direction,l=t.height,c=t.itemCount,m=t.itemSize,u=t.layout,f=t.width,v=a==="horizontal"||u==="horizontal",g=r*m,y=v?f:l,M=Math.ceil((y+i-g)/m);return Math.max(0,Math.min(c-1,r+M-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function _s(e){var t=e.lastRenderedStartIndex,r=e.lastRenderedStopIndex,i=e.startIndex,a=e.stopIndex;return!(i>r||a<t)}function bs(e){for(var t=e.isItemLoaded,r=e.itemCount,i=e.minimumBatchSize,a=e.startIndex,l=e.stopIndex,c=[],m=null,u=null,f=a;f<=l;f++){var v=t(f);v?u!==null&&(c.push(m,u),m=u=null):(u=f,m===null&&(m=f))}if(u!==null){for(var g=Math.min(Math.max(u,m+i-1),r-1),y=u+1;y<=g&&!t(y);y++)u=y;c.push(m,u)}if(c.length)for(;c[1]-c[0]+1<i&&c[0]>0;){var M=c[0]-1;if(!t(M))c[0]=M;else break}return c}var Es=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ls=function(){function e(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),$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},Rs=function(e){$s(t,e);function t(){var r,i,a,l;Es(this,t);for(var c=arguments.length,m=Array(c),u=0;u<c;u++)m[u]=arguments[u];return l=(i=(a=oe(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(f){var v=f.visibleStartIndex,g=f.visibleStopIndex;a._lastRenderedStartIndex=v,a._lastRenderedStopIndex=g,a._ensureRowsLoaded(v,g)},a._setRef=function(f){a._listRef=f},i),oe(a,l)}return Ls(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,a){var l=this.props,c=l.isItemLoaded,m=l.itemCount,u=l.minimumBatchSize,f=u===void 0?10:u,v=l.threshold,g=v===void 0?15:v,y=bs({isItemLoaded:c,itemCount:m,minimumBatchSize:f,startIndex:Math.max(0,i-g),stopIndex:Math.min(m-1,a+g)});(this._memoizedUnloadedRanges.length!==y.length||this._memoizedUnloadedRanges.some(function(M,N){return y[N]!==M}))&&(this._memoizedUnloadedRanges=y,this._loadUnloadedRanges(y))}},{key:"_loadUnloadedRanges",value:function(i){for(var a=this,l=this.props.loadMoreItems||this.props.loadMoreRows,c=function(f){var v=i[f],g=i[f+1],y=l(v,g);y!=null&&y.then(function(){if(_s({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:v,stopIndex:g})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(v,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<i.length;m+=2)c(m)}}]),t}(T.PureComponent);const Qs=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Us=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ps=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),qs=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Ys=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ws=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Fs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Vs=()=>n.n1,Bs=n.styled_default(Vs())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Hs=({rank:e,avatar:t,name:r,points:i,isCurrentUser:a,openItemDetail:l,style:c})=>s.jsxs(Qs,{onClick:l,style:c,children:[s.jsx(Us,{children:e||0}),s.jsxs(Ys,{children:[t?s.jsx(Ps,{alt:"leaderboard-item-avatar",src:t}):s.jsx(qs,{children:de(r||"")}),s.jsxs(Ws,{children:[s.jsx(Fs,{children:r||""}),a&&s.jsx(Bs,{name:"icon-star"})]})]}),s.jsx("div",{children:ue(i)})]}),Gs=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Zs=({items:e,currentUserId:t,openItemDetail:r,fetchMore:i})=>s.jsx(n.AutoSizer,{children:({width:a,height:l})=>s.jsx(Rs,{isItemLoaded:c=>c<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:c,ref:m})=>s.jsx(Gs,{children:s.jsx(Cs,{itemSize:56,onItemsRendered:c,ref:m,itemCount:e.length,width:a,height:l,children:({index:u,style:f})=>s.jsx(Hs,{style:{...f,maxHeight:48},...e[u],openItemDetail:()=>r(e[u].userId),isCurrentUser:!!t&&t===e[u].userId},e[u].userId)})})})}),Js=({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."})},Ks=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Zs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Js,{deepLink:e.deepLink})},Xs=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),en=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),tn=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),sn=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),nn=()=>n.n1,b=n.styled_default(nn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),rn=()=>n.n1,an=n.styled_default(rn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),on=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),ln=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),cn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),dn={[n.PickHistoryStatus.LOST]:s.jsx(b,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(b,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(b,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(b,{name:"icon-arrow"})},un=({questionId:e,questionType:t,questionStatus:r,subject:i,openForVoting:a,openQuestion:l,status:c})=>{const m=n.o[t],u=dn[c];return m?s.jsxs(Xs,{onClick:()=>l==null?void 0:l(e),children:[s.jsxs(ln,{children:[s.jsxs(en,{children:[s.jsx(an,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:m.iconName}),s.jsxs(on,{children:[m.label,t===n.QuestionType.TRIVIA&&r===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(tn,{children:i||""})]}),s.jsx(sn,{children:a?s.jsx(cn,{children:"Play"}):u})]}):null},pn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),mn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),fn=({openInsight:e,questionId:t,...r})=>s.jsxs(pn,{children:[s.jsx(Ie,{questionId:t,...r}),e&&s.jsx(mn,{onClick:()=>e(t),children:"View Insight"})]}),hn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),In=({questions:e,openQuestion:t})=>s.jsx(hn,{children:e==null?void 0:e.map(r=>{var i,a;if(r.type==="question"&&((i=r.attributes)==null?void 0:i.attributes.case)==="question"){const l=r.attributes.attributes.value;return s.jsx(un,{openQuestion:t,...l},l.questionId)}if(r.type==="insight"&&((a=r.attributes)==null?void 0:a.attributes.case)==="insight"){const l=r.attributes.attributes.value;return s.jsx(fn,{openInsight:t,...l},l.questionId)}return null})}),yn=({store:e,openQuestion:t})=>{const r=n.useStore(e);return r!=null&&r.data?s.jsx(In,{openQuestion:t,questions:r.data}):s.jsx("div",{children:"wait questions..."})},gn=({userSummary:e})=>{var t,r;const i=n.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(pe,{...i.data.summary,successRate:(r=i.data.percentage)==null?void 0:r.correct}):s.jsx("div",{children:"wait user..."})},xn=({gamification:e})=>{const[t,r]=T.useState(E.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a,{style:{paddingBottom:"4px"},children:s.jsx(Ms,{activePage:t,toggleActivePage:r})}),t===E.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a,{style:{paddingTop:"12px"},children:s.jsx(gn,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(yn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===E.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(Ks,{gamification:e})})]})},jn=()=>n.d$1,le=n.styled_default(jn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),vn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Mn=({correct:e,incorrect:t})=>{const r=e+t;return r===0?0:Math.round(e/r*100)},Tn=({gamification:e,className:t})=>{const r=n.useStore(e.openedQuestion.$store),i=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[r&&s.jsx(le,{className:t,children:s.jsx(ys,{gamification:e})}),i&&s.jsx(le,{className:t,children:s.jsxs(vn,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(pe,{...i,successRate:Mn(i)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(xn,{gamification:e})})]})};exports.default=Tn;
|
package/lib/dist/cjs/masters.js
CHANGED
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
`),c=`
|
|
27
27
|
`+n+(o.length?a("│"):" ")+" ";return n+u.join(c)+`
|
|
28
28
|
`+o.map(function(d,f){var g=f===o.length-1,T=d.nodes&&d.nodes.length,y=n+(g?" ":a("│"))+" ";return n+a(g?"└":"├")+a("─")+a(T?"┬":"─")+" "+e(d,y,s).slice(n.length+2)}).join("")};const u9=c9,Yi=Symbol("avvio.TimeTree.untrackNode"),Ja=Symbol("avvio.TimeTree.trackNode"),Ki=Symbol("avvio.TimeTree.getParent"),Wi=Symbol("avvio.TimeTree.getNode"),Zi=Symbol("avvio.TimeTree.addNode");let m9=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Ja](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[Yi](e){this.tableId.delete(e.id);const t=this.tableLabel.get(e.label);if(t.id){this.tableLabel.delete(e.label);return}t.pop(),t.length===0&&this.tableLabel.delete(e.label)}[Ki](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[Wi](e){return this.tableId.get(e)}[Zi](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Ja](this.root),this.root.id;const s=this[Ki](e),a=`${t}-${Math.random()}`,o={id:a,parent:e,start:n,label:t,nodes:[]};return s.nodes.push(o),this[Ja](o),a}start(e,t,n=Date.now()){return this[Zi](e,t,n)}stop(e,t=Date.now()){const n=this[Wi](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[Yi](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(s=>e(s))),n),t=e(this.toJSON());return u9(t)}};var d9=m9,dr={exports:{}},Is={exports:{}},Xa,Ji;function p9(){if(Ji)return Xa;Ji=1;var e=1e3,t=e*60,n=t*60,s=n*24,a=s*7,o=s*365.25;Xa=function(g,T){T=T||{};var y=typeof g;if(y==="string"&&g.length>0)return u(g);if(y==="number"&&isFinite(g))return T.long?d(g):c(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function u(g){if(g=String(g),!(g.length>100)){var T=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(g);if(T){var y=parseFloat(T[1]),b=(T[2]||"ms").toLowerCase();switch(b){case"years":case"year":case"yrs":case"yr":case"y":return y*o;case"weeks":case"week":case"w":return y*a;case"days":case"day":case"d":return y*s;case"hours":case"hour":case"hrs":case"hr":case"h":return y*n;case"minutes":case"minute":case"mins":case"min":case"m":return y*t;case"seconds":case"second":case"secs":case"sec":case"s":return y*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function c(g){var T=Math.abs(g);return T>=s?Math.round(g/s)+"d":T>=n?Math.round(g/n)+"h":T>=t?Math.round(g/t)+"m":T>=e?Math.round(g/e)+"s":g+"ms"}function d(g){var T=Math.abs(g);return T>=s?f(g,T,s,"day"):T>=n?f(g,T,n,"hour"):T>=t?f(g,T,t,"minute"):T>=e?f(g,T,e,"second"):g+" ms"}function f(g,T,y,b){var A=T>=y*1.5;return Math.round(g/y)+" "+b+(A?"s":"")}return Xa}function f9(e){n.debug=n,n.default=n,n.coerce=d,n.disable=o,n.enable=a,n.enabled=u,n.humanize=p9(),n.destroy=f,Object.keys(e).forEach(g=>{n[g]=e[g]}),n.names=[],n.skips=[],n.formatters={};function t(g){let T=0;for(let y=0;y<g.length;y++)T=(T<<5)-T+g.charCodeAt(y),T|=0;return n.colors[Math.abs(T)%n.colors.length]}n.selectColor=t;function n(g){let T,y=null,b,A;function R(...N){if(!R.enabled)return;const _=R,I=Number(new Date),P=I-(T||I);_.diff=P,_.prev=T,_.curr=I,T=I,N[0]=n.coerce(N[0]),typeof N[0]!="string"&&N.unshift("%O");let U=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(B,V)=>{if(B==="%%")return"%";U++;const D=n.formatters[V];if(typeof D=="function"){const $=N[U];B=D.call(_,$),N.splice(U,1),U--}return B}),n.formatArgs.call(_,N),(_.log||n.log).apply(_,N)}return R.namespace=g,R.useColors=n.useColors(),R.color=n.selectColor(g),R.extend=s,R.destroy=n.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(b!==n.namespaces&&(b=n.namespaces,A=n.enabled(g)),A),set:N=>{y=N}}),typeof n.init=="function"&&n.init(R),R}function s(g,T){const y=n(this.namespace+(typeof T>"u"?":":T)+g);return y.log=this.log,y}function a(g){n.save(g),n.namespaces=g,n.names=[],n.skips=[];let T;const y=(typeof g=="string"?g:"").split(/[\s,]+/),b=y.length;for(T=0;T<b;T++)y[T]&&(g=y[T].replace(/\*/g,".*?"),g[0]==="-"?n.skips.push(new RegExp("^"+g.slice(1)+"$")):n.names.push(new RegExp("^"+g+"$")))}function o(){const g=[...n.names.map(c),...n.skips.map(c).map(T=>"-"+T)].join(",");return n.enable(""),g}function u(g){if(g[g.length-1]==="*")return!0;let T,y;for(T=0,y=n.skips.length;T<y;T++)if(n.skips[T].test(g))return!1;for(T=0,y=n.names.length;T<y;T++)if(n.names[T].test(g))return!0;return!1}function c(g){return g.toString().substring(2,g.toString().length-2).replace(/\.\*\?$/,"*")}function d(g){return g instanceof Error?g.stack||g.message:g}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var h9=f9;(function(e,t){t.formatArgs=s,t.save=a,t.load=o,t.useColors=n,t.storage=u(),t.destroy=(()=>{let d=!1;return()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function s(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const f="color: "+this.color;d.splice(1,0,f,"color: inherit");let g=0,T=0;d[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(g++,y==="%c"&&(T=g))}),d.splice(T,0,f)}t.log=console.debug||console.log||(()=>{});function a(d){try{d?t.storage.setItem("debug",d):t.storage.removeItem("debug")}catch{}}function o(){let d;try{d=t.storage.getItem("debug")}catch{}return!d&&typeof W.process<"u"&&"env"in W.process&&(d=W.process.env.DEBUG),d}function u(){try{return localStorage}catch{}}e.exports=h9(t);const{formatters:c}=e.exports;c.j=function(d){try{return JSON.stringify(d)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}}})(Is,Is.exports);var cc=Is.exports;const g9=Bl,y9=$l.EventEmitter,T9=Ea.inherits,Ie=cc("avvio"),{AVV_ERR_READY_TIMEOUT:k9}=lc,es=Symbol.for("plugin-meta");function b9(e,t){return e[es]&&e[es].name?e[es].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
|
|
29
|
-
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function S9(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function Tn(e,t,n,s,a){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=a===void 0?e._timeout:a,this.name=b9(t,n),this.isAfter=s,this.q=g9(e,E9,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}T9(Tn,y9);Tn.prototype.exec=function(e,t){const n=this.func;let s=!1;const a=this.name;if(this.parent._error&&!this.isAfter){Ie("skipping loading of plugin as parent errored and it is not an after",a),W.process.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(d){return Ie("override errored",a),t(d)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ie("exec",a);let o;const u=d=>{if(s){Ie("loading complete",a);return}this._error=d,Ie(d?"exec errored":"exec completed",a),s=!0,o&&clearTimeout(o),t(d)};this.timeout>0&&(Ie("setting up timeout",a,this.timeout),o=setTimeout(function(){Ie("timed out",a),o=null;const d=new k9(a);d.fn=n,u(d)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,u);c&&typeof c.then=="function"&&(Ie("exec: resolving promise",a),c.then(()=>W.process.nextTick(u),d=>W.process.nextTick(u,d)))};Tn.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,s)=>{this._error=n,this.q.pause(),n?(Ie("rejecting promise",this.name,n),this._promise.reject(n)):(Ie("resolving promise",this.name),this._promise.resolve()),this._promise=null,W.process.nextTick(s,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=S9(),t=this._promise.promise,this.server?e():this.on("start",e)),t};Tn.prototype.enqueue=function(e,t){Ie("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};Tn.prototype.finish=function(e,t){Ie("finish",this.name,e);const n=()=>{this.loaded||(Ie("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const s=()=>{if(Ie("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const a=()=>{Ie("wrap"),queueMicrotask(s)};this._promise.resolve(),this._promise.promise.then(a,a),this._promise=null}else n();else Ie("delayed",this.name),this.q.drain=()=>{Ie("drain",this.name),this.q.drain=v9,queueMicrotask(s)}};queueMicrotask(s),this.q.resume()};function E9(e,t){const n=this;W.process.nextTick(pr.bind(n),e,t)}function pr(e,t){if(typeof e.func.then=="function"){e.func.then(s=>{typeof s.default=="function"&&(s=s.default),e.func=s,pr.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,s=>{e.finish(s,a=>{this._current.shift(),t(a)})})}function v9(){}dr.exports=Tn;dr.exports.loadPlugin=pr;var _9=dr.exports;const Xi=Bl,w9=$l.EventEmitter,A9=Ea.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:ts,AVV_ERR_CALLBACK_NOT_FN:Cn,AVV_ERR_PLUGIN_NOT_VALID:R9,AVV_ERR_ROOT_PLG_BOOTED:C9,AVV_ERR_READY_TIMEOUT:I9}=lc,N9=d9,Ns=_9,pn=cc("avvio"),oa=Symbol("kAvvio"),ns=Symbol("kThenifyDoNotWrap");function O9(e,t,n){const s=t.expose||{},a=s.use||"use",o=s.after||"after",u=s.ready||"ready",c=s.onClose||"onClose",d=s.close||"close";if(e[a])throw new ts(a);if(e[o])throw new ts(o);if(e[u])throw new ts(u);e[a]=function(f,g){return n.use(f,g),this},Object.defineProperty(e,"then",{get:uc.bind(n)}),e[oa]=!0,e[o]=function(f){return typeof f!="function"?n._loadRegistered():(n.after(as(f,this)),this)},e[u]=function(f){if(f&&typeof f!="function")throw new Cn(u,typeof f);return n.ready(f?as(f,this):void 0)},e[c]=function(f){if(typeof f!="function")throw new Cn(c,typeof f);return n.onClose(P9(f,this)),this},e[d]=function(f){if(f&&typeof f!="function")throw new Cn(d,typeof f);return f?(n.close(as(f,this)),this):n.close()}}function we(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof we)){const s=new we(e,t,n);return e&&O9(e,t,s),s}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new N9,this._readyQ=Xi(this,mc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=eo},this._closeQ=Xi(this,B9,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=eo},this._doStart=null,this._root=new Ns(this,L9.bind(this),t,!1,0),this._root.once("start",(s,a,o)=>{const u=this.pluginTree.start(null,a,o);this._root.once("loaded",(c,d,f)=>{this.pluginTree.stop(u,f)})}),Ns.loadPlugin.call(this,this._root,s=>{pn("root plugin ready");try{this.emit("preReady"),this._root=null}catch(a){s=s||this._error||a}if(s){if(this._error=s,this._readyQ.length()===0)throw s}else this.booted=!0;this._readyQ.resume()})}function L9(e,t,n){this._doStart=n,t.autostart&&this.start()}A9(we,w9);we.prototype.start=function(){return this.started=!0,W.process.nextTick(this._doStart),this};we.prototype.override=function(e,t,n){return e};function x9(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new R9(typeof e);return e}we.prototype[oa]=!0;we.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};we.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&W.process.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(we.prototype,"then",{get:uc});we.prototype._addPlugin=function(e,t,n){if(e=x9(e),t=t||{},this.booted)throw new C9;const s=this._current[0],a=new Ns(this,e,t,n);if(a.once("start",(o,u,c)=>{const d=this.pluginTree.start(s.name,u,c);a.once("loaded",(f,g,T)=>{this.pluginTree.stop(d,T)})}),s.loaded)throw new Error(a.name,s.name);return s.enqueue(a,o=>{o&&(this._error=o)}),a};we.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,s,a){mc.call(this,e,a)}return this};we.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};we.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Cn("close",typeof e)}else t=new Promise(function(n,s){e=function(a){if(a)return s(a);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),W.process.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};we.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Cn("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(a),this.start();const s=this._current[0].server;function a(o,u,c){o?n(o):t(s),W.process.nextTick(c)}})};we.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};we.prototype.toJSON=function(){return this.pluginTree.toJSON()};function eo(){}function uc(){if(this.booted){pn("thenify returning null because we are already booted");return}if(this[ns]){this[ns]=!1;return}return pn("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[ns]=!0,e(this._server)),t)}function mc(e,t){const n=this._server,s=this._error;let a;if(this._error=null,e.length===0)this._error=s,a=e(),a&&!a[oa]&&typeof a.then=="function"?a.then(()=>W.process.nextTick(t),o=>W.process.nextTick(t,o)):W.process.nextTick(t);else if(e.length===1)a=e(s),a&&!a[oa]&&typeof a.then=="function"?a.then(()=>W.process.nextTick(t),o=>W.process.nextTick(t,o)):W.process.nextTick(t);else if(this._timeout===0){const o=u=>{this._error=u,t(this._error)};e.length===2?e(s,o):e(s,n,o)}else M9.call(this,e,s,n,t)}function M9(e,t,n,s){const a=e.name;pn("setting up ready timeout",a,this._timeout);let o=setTimeout(()=>{pn("timed out",a),o=null;const c=new I9(a);c.fn=e,this._error=c,s(c)},this._timeout);e.length===2?e(t,u.bind(this)):e(t,n,u.bind(this));function u(c){o&&(clearTimeout(o),this._error=c,s(this._error))}}function B9(e,t){const n=this._server,s=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let a;s?a=e(n):a=e(this._error),a&&typeof a.then=="function"?(pn("resolving close/onClose promise"),a.then(()=>W.process.nextTick(t),o=>W.process.nextTick(t,o))):W.process.nextTick(t)}else e.length===2?e(s?n:this._error,t):s?e(n,t):e(this._error,n,t)}function P9(e,t){return n.bind(t);function n(s,a){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){W.process.nextTick(a)},a):W.process.nextTick(a)):e.length===1?(o=e(this),o&&o.then?o.then(function(){W.process.nextTick(a)},a):W.process.nextTick(a)):e(this,a)}}function as(e,t){return n.bind(t);function n(s,a){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){W.process.nextTick(a,s)},a):W.process.nextTick(a,s)):e.length===1?(o=e(s),o&&o.then?o.then(function(){W.process.nextTick(a)},a):W.process.nextTick(a)):e.length===2?e(s,a):e(s,this,a):W.process.nextTick(a)}}sr.exports=we;sr.exports.express=function(e){return we(e,{expose:{use:"load"}})};var U9=sr.exports;const F9=T6(U9);function D9(e,t=!0,n=!0){const s=t?"https://grpc-web.streamlayer.io:443":"https://grpc-web.next.streamlayer.io:443",a=F9(Object.create({}),{autostart:!1});return a.use(X6),a.use(H6,{sdkKey:e,host:s}),a.use(J6),a.use(Z6),a.use(OT),a.use(TT),n&&a.after(async(o,u,c)=>{if(o)throw o;await u.sdk.initializeApp(),c()}),a.onClose(()=>{console.log("close")}),a}const V9=(e,t,n,s)=>{const[a,o]=Z.useState(null);return Z.useEffect(()=>{let u=!1;if(!e)return console.error("streamlayer sdk key should be provided"),o(d=>(d!==null&&typeof d.disableApp=="function"&&d.disableApp(),null)),()=>{u=!0};const c=D9(e,n,s);if(t)for(const d of t)c.use(d);return c.ready().then(d=>{u||o(d.sdk)}).catch(d=>console.log(d)),()=>{u=!0,c.close(function(d){if(d)throw d})}},[e,n]),a};var dc=(e=>(e[e.UNSET=0]="UNSET",e[e.CONNECTED=1]="CONNECTED",e[e.READY=2]="READY",e))(dc||{});const fr=Z.createContext({status:0,sdk:null}),j9=({sdkKey:e,plugins:t,children:n,production:s=!0,autoEnable:a=!0})=>{const o=V9(e,t,s,a),u=Z.useMemo(()=>o?{sdk:o,status:2}:{status:1,sdk:null},[o]);return S.jsx(fr.Provider,{value:u,children:n})};const G9=({sdkKey:e,plugins:t,children:n,production:s=!0})=>S.jsx(j9,{sdkKey:e,plugins:t,production:s,autoEnable:!1,children:n}),q9=({children:e,overlays:t})=>{const{sdk:n,status:s}=Z.useContext(fr);if(s===dc.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return n?S.jsx("div",{className:"StreamLayerSDK",children:S.jsx(ao,{style:{height:"100%"},children:S.jsx(V2,{sdk:n,overlays:t,children:e})})}):e({})},pc=()=>{const{sdk:e}=Z.useContext(fr);return e},$9=({token:e,schema:t})=>{const n=pc();return Z.useEffect(()=>{e&&t&&n&&n.authorizationBypass(t,e)},[e,t,n]),null};var hr={},la=function(){return la=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},la.apply(this,arguments)},H9=function(){function e(t,n,s){var a=this;this.endVal=n,this.options=s,this.version="2.8.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(o){a.startTime||(a.startTime=o);var u=o-a.startTime;a.remaining=a.duration-u,a.useEasing?a.countDown?a.frameVal=a.startVal-a.easingFn(u,0,a.startVal-a.endVal,a.duration):a.frameVal=a.easingFn(u,a.startVal,a.endVal-a.startVal,a.duration):a.frameVal=a.startVal+(a.endVal-a.startVal)*(u/a.duration);var c=a.countDown?a.frameVal<a.endVal:a.frameVal>a.endVal;a.frameVal=c?a.endVal:a.frameVal,a.frameVal=Number(a.frameVal.toFixed(a.options.decimalPlaces)),a.printValue(a.frameVal),u<a.duration?a.rAF=requestAnimationFrame(a.count):a.finalEndVal!==null?a.update(a.finalEndVal):a.options.onCompleteCallback&&a.options.onCompleteCallback()},this.formatNumber=function(o){var u,c,d,f,g=o<0?"-":"";u=Math.abs(o).toFixed(a.options.decimalPlaces);var T=(u+="").split(".");if(c=T[0],d=T.length>1?a.options.decimal+T[1]:"",a.options.useGrouping){f="";for(var y=3,b=0,A=0,R=c.length;A<R;++A)a.options.useIndianSeparators&&A===4&&(y=2,b=1),A!==0&&b%y==0&&(f=a.options.separator+f),b++,f=c[R-A-1]+f;c=f}return a.options.numerals&&a.options.numerals.length&&(c=c.replace(/[0-9]/g,function(N){return a.options.numerals[+N]}),d=d.replace(/[0-9]/g,function(N){return a.options.numerals[+N]})),g+a.options.prefix+c+d+a.options.suffix},this.easeOutExpo=function(o,u,c,d){return c*(1-Math.pow(2,-10*o/d))*1024/1023+u},this.options=la(la({},this.defaults),s),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(n),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,this.options.separator===""&&(this.options.useGrouping=!1),this.el=typeof t=="string"?document.getElementById(t):t,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined",typeof window<"u"&&this.options.enableScrollSpy&&(this.error?console.error(this.error,t):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push(function(){return a.handleScroll(a)}),window.onscroll=function(){window.onScrollFns.forEach(function(o){return o()})},this.handleScroll(this)))}return e.prototype.handleScroll=function(t){if(t&&window&&!t.once){var n=window.innerHeight+window.scrollY,s=t.el.getBoundingClientRect(),a=s.top+window.pageYOffset,o=s.top+s.height+window.pageYOffset;o<n&&o>window.scrollY&&t.paused?(t.paused=!1,setTimeout(function(){return t.start()},t.options.scrollSpyDelay),t.options.scrollSpyOnce&&(t.once=!0)):(window.scrollY>o||a>n)&&!t.paused&&t.reset()}},e.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var n=t-this.startVal;if(Math.abs(n)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=t;var s=this.countDown?1:-1;this.endVal=t+s*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t,this.finalEndVal=null;this.finalEndVal!==null?this.useEasing=!1:this.useEasing=this.options.useEasing},e.prototype.start=function(t){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),t&&(this.options.onCompleteCallback=t),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},e.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},e.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},e.prototype.update=function(t){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,this.finalEndVal==null&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},e.prototype.printValue=function(t){var n;if(this.el){var s=this.formattingFn(t);!((n=this.options.plugin)===null||n===void 0)&&n.render?this.options.plugin.render(this.el,s):this.el.tagName==="INPUT"?this.el.value=s:this.el.tagName==="text"||this.el.tagName==="tspan"?this.el.textContent=s:this.el.innerHTML=s}},e.prototype.ensureNumber=function(t){return typeof t=="number"&&!isNaN(t)},e.prototype.validateValue=function(t){var n=Number(t);return this.ensureNumber(n)?n:(this.error="[CountUp] invalid start or end value: ".concat(t),null)},e.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},e}();const z9=Object.freeze(Object.defineProperty({__proto__:null,CountUp:H9},Symbol.toStringTag,{value:"Module"})),Q9=Pc(z9);Object.defineProperty(hr,"__esModule",{value:!0});var ve=Z,Y9=Q9;function K9(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,o,u,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(s=o.call(n)).done)&&(c.push(s.value),c.length!==t);d=!0);}catch(g){f=!0,a=g}finally{try{if(!d&&n.return!=null&&(u=n.return(),Object(u)!==u))return}finally{if(f)throw a}}return c}}function to(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function ca(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?to(Object(n),!0).forEach(function(s){W9(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):to(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function W9(e,t,n){return t=a4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Os(){return Os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Os.apply(this,arguments)}function Z9(e,t){if(e==null)return{};var n={},s=Object.keys(e),a,o;for(o=0;o<s.length;o++)a=s[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function fc(e,t){if(e==null)return{};var n=Z9(e,t),s,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)s=o[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function J9(e,t){return X9(e)||K9(e,t)||e4(e,t)||t4()}function X9(e){if(Array.isArray(e))return e}function e4(e,t){if(e){if(typeof e=="string")return no(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return no(e,t)}}function no(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function t4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
29
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function S9(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function Tn(e,t,n,s,a){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=a===void 0?e._timeout:a,this.name=b9(t,n),this.isAfter=s,this.q=g9(e,E9,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}T9(Tn,y9);Tn.prototype.exec=function(e,t){const n=this.func;let s=!1;const a=this.name;if(this.parent._error&&!this.isAfter){Ie("skipping loading of plugin as parent errored and it is not an after",a),W.process.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(d){return Ie("override errored",a),t(d)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ie("exec",a);let o;const u=d=>{if(s){Ie("loading complete",a);return}this._error=d,Ie(d?"exec errored":"exec completed",a),s=!0,o&&clearTimeout(o),t(d)};this.timeout>0&&(Ie("setting up timeout",a,this.timeout),o=setTimeout(function(){Ie("timed out",a),o=null;const d=new k9(a);d.fn=n,u(d)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,u);c&&typeof c.then=="function"&&(Ie("exec: resolving promise",a),c.then(()=>W.process.nextTick(u),d=>W.process.nextTick(u,d)))};Tn.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,s)=>{this._error=n,this.q.pause(),n?(Ie("rejecting promise",this.name,n),this._promise.reject(n)):(Ie("resolving promise",this.name),this._promise.resolve()),this._promise=null,W.process.nextTick(s,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=S9(),t=this._promise.promise,this.server?e():this.on("start",e)),t};Tn.prototype.enqueue=function(e,t){Ie("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};Tn.prototype.finish=function(e,t){Ie("finish",this.name,e);const n=()=>{this.loaded||(Ie("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const s=()=>{if(Ie("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const a=()=>{Ie("wrap"),queueMicrotask(s)};this._promise.resolve(),this._promise.promise.then(a,a),this._promise=null}else n();else Ie("delayed",this.name),this.q.drain=()=>{Ie("drain",this.name),this.q.drain=v9,queueMicrotask(s)}};queueMicrotask(s),this.q.resume()};function E9(e,t){const n=this;W.process.nextTick(pr.bind(n),e,t)}function pr(e,t){if(typeof e.func.then=="function"){e.func.then(s=>{typeof s.default=="function"&&(s=s.default),e.func=s,pr.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,s=>{e.finish(s,a=>{this._current.shift(),t(a)})})}function v9(){}dr.exports=Tn;dr.exports.loadPlugin=pr;var _9=dr.exports;const Xi=Bl,w9=$l.EventEmitter,A9=Ea.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:ts,AVV_ERR_CALLBACK_NOT_FN:Cn,AVV_ERR_PLUGIN_NOT_VALID:R9,AVV_ERR_ROOT_PLG_BOOTED:C9,AVV_ERR_READY_TIMEOUT:I9}=lc,N9=d9,Ns=_9,pn=cc("avvio"),oa=Symbol("kAvvio"),ns=Symbol("kThenifyDoNotWrap");function O9(e,t,n){const s=t.expose||{},a=s.use||"use",o=s.after||"after",u=s.ready||"ready",c=s.onClose||"onClose",d=s.close||"close";if(e[a])throw new ts(a);if(e[o])throw new ts(o);if(e[u])throw new ts(u);e[a]=function(f,g){return n.use(f,g),this},Object.defineProperty(e,"then",{get:uc.bind(n)}),e[oa]=!0,e[o]=function(f){return typeof f!="function"?n._loadRegistered():(n.after(as(f,this)),this)},e[u]=function(f){if(f&&typeof f!="function")throw new Cn(u,typeof f);return n.ready(f?as(f,this):void 0)},e[c]=function(f){if(typeof f!="function")throw new Cn(c,typeof f);return n.onClose(P9(f,this)),this},e[d]=function(f){if(f&&typeof f!="function")throw new Cn(d,typeof f);return f?(n.close(as(f,this)),this):n.close()}}function we(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof we)){const s=new we(e,t,n);return e&&O9(e,t,s),s}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new N9,this._readyQ=Xi(this,mc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=eo},this._closeQ=Xi(this,B9,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=eo},this._doStart=null,this._root=new Ns(this,L9.bind(this),t,!1,0),this._root.once("start",(s,a,o)=>{const u=this.pluginTree.start(null,a,o);this._root.once("loaded",(c,d,f)=>{this.pluginTree.stop(u,f)})}),Ns.loadPlugin.call(this,this._root,s=>{pn("root plugin ready");try{this.emit("preReady"),this._root=null}catch(a){s=s||this._error||a}if(s){if(this._error=s,this._readyQ.length()===0)throw s}else this.booted=!0;this._readyQ.resume()})}function L9(e,t,n){this._doStart=n,t.autostart&&this.start()}A9(we,w9);we.prototype.start=function(){return this.started=!0,W.process.nextTick(this._doStart),this};we.prototype.override=function(e,t,n){return e};function x9(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new R9(typeof e);return e}we.prototype[oa]=!0;we.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};we.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&W.process.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(we.prototype,"then",{get:uc});we.prototype._addPlugin=function(e,t,n){if(e=x9(e),t=t||{},this.booted)throw new C9;const s=this._current[0],a=new Ns(this,e,t,n);if(a.once("start",(o,u,c)=>{const d=this.pluginTree.start(s.name,u,c);a.once("loaded",(f,g,T)=>{this.pluginTree.stop(d,T)})}),s.loaded)throw new Error(a.name,s.name);return s.enqueue(a,o=>{o&&(this._error=o)}),a};we.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,s,a){mc.call(this,e,a)}return this};we.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};we.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Cn("close",typeof e)}else t=new Promise(function(n,s){e=function(a){if(a)return s(a);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),W.process.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};we.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Cn("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(a),this.start();const s=this._current[0].server;function a(o,u,c){o?n(o):t(s),W.process.nextTick(c)}})};we.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};we.prototype.toJSON=function(){return this.pluginTree.toJSON()};function eo(){}function uc(){if(this.booted){pn("thenify returning null because we are already booted");return}if(this[ns]){this[ns]=!1;return}return pn("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[ns]=!0,e(this._server)),t)}function mc(e,t){const n=this._server,s=this._error;let a;if(this._error=null,e.length===0)this._error=s,a=e(),a&&!a[oa]&&typeof a.then=="function"?a.then(()=>W.process.nextTick(t),o=>W.process.nextTick(t,o)):W.process.nextTick(t);else if(e.length===1)a=e(s),a&&!a[oa]&&typeof a.then=="function"?a.then(()=>W.process.nextTick(t),o=>W.process.nextTick(t,o)):W.process.nextTick(t);else if(this._timeout===0){const o=u=>{this._error=u,t(this._error)};e.length===2?e(s,o):e(s,n,o)}else M9.call(this,e,s,n,t)}function M9(e,t,n,s){const a=e.name;pn("setting up ready timeout",a,this._timeout);let o=setTimeout(()=>{pn("timed out",a),o=null;const c=new I9(a);c.fn=e,this._error=c,s(c)},this._timeout);e.length===2?e(t,u.bind(this)):e(t,n,u.bind(this));function u(c){o&&(clearTimeout(o),this._error=c,s(this._error))}}function B9(e,t){const n=this._server,s=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let a;s?a=e(n):a=e(this._error),a&&typeof a.then=="function"?(pn("resolving close/onClose promise"),a.then(()=>W.process.nextTick(t),o=>W.process.nextTick(t,o))):W.process.nextTick(t)}else e.length===2?e(s?n:this._error,t):s?e(n,t):e(this._error,n,t)}function P9(e,t){return n.bind(t);function n(s,a){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){W.process.nextTick(a)},a):W.process.nextTick(a)):e.length===1?(o=e(this),o&&o.then?o.then(function(){W.process.nextTick(a)},a):W.process.nextTick(a)):e(this,a)}}function as(e,t){return n.bind(t);function n(s,a){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){W.process.nextTick(a,s)},a):W.process.nextTick(a,s)):e.length===1?(o=e(s),o&&o.then?o.then(function(){W.process.nextTick(a)},a):W.process.nextTick(a)):e.length===2?e(s,a):e(s,this,a):W.process.nextTick(a)}}sr.exports=we;sr.exports.express=function(e){return we(e,{expose:{use:"load"}})};var U9=sr.exports;const F9=T6(U9);function D9(e,t=!0,n=!0){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-web.next.streamlayer.io:443",a=F9(Object.create({}),{autostart:!1});return a.use(X6),a.use(H6,{sdkKey:e,host:s}),a.use(J6),a.use(Z6),a.use(OT),a.use(TT),n&&a.after(async(o,u,c)=>{if(o)throw o;await u.sdk.initializeApp(),c()}),a.onClose(()=>{console.log("close")}),a}const V9=(e,t,n,s)=>{const[a,o]=Z.useState(null);return Z.useEffect(()=>{let u=!1;if(!e)return console.error("streamlayer sdk key should be provided"),o(d=>(d!==null&&typeof d.disableApp=="function"&&d.disableApp(),null)),()=>{u=!0};const c=D9(e,n,s);if(t)for(const d of t)c.use(d);return c.ready().then(d=>{u||o(d.sdk)}).catch(d=>console.log(d)),()=>{u=!0,c.close(function(d){if(d)throw d})}},[e,n]),a};var dc=(e=>(e[e.UNSET=0]="UNSET",e[e.CONNECTED=1]="CONNECTED",e[e.READY=2]="READY",e))(dc||{});const fr=Z.createContext({status:0,sdk:null}),j9=({sdkKey:e,plugins:t,children:n,production:s=!0,autoEnable:a=!0})=>{const o=V9(e,t,s,a),u=Z.useMemo(()=>o?{sdk:o,status:2}:{status:1,sdk:null},[o]);return S.jsx(fr.Provider,{value:u,children:n})};const G9=({sdkKey:e,plugins:t,children:n,production:s=!0})=>S.jsx(j9,{sdkKey:e,plugins:t,production:s,autoEnable:!1,children:n}),q9=({children:e,overlays:t})=>{const{sdk:n,status:s}=Z.useContext(fr);if(s===dc.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return n?S.jsx("div",{className:"StreamLayerSDK",children:S.jsx(ao,{style:{height:"100%"},children:S.jsx(V2,{sdk:n,overlays:t,children:e})})}):e({})},pc=()=>{const{sdk:e}=Z.useContext(fr);return e},$9=({token:e,schema:t})=>{const n=pc();return Z.useEffect(()=>{e&&t&&n&&n.authorizationBypass(t,e)},[e,t,n]),null};var hr={},la=function(){return la=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},la.apply(this,arguments)},H9=function(){function e(t,n,s){var a=this;this.endVal=n,this.options=s,this.version="2.8.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(o){a.startTime||(a.startTime=o);var u=o-a.startTime;a.remaining=a.duration-u,a.useEasing?a.countDown?a.frameVal=a.startVal-a.easingFn(u,0,a.startVal-a.endVal,a.duration):a.frameVal=a.easingFn(u,a.startVal,a.endVal-a.startVal,a.duration):a.frameVal=a.startVal+(a.endVal-a.startVal)*(u/a.duration);var c=a.countDown?a.frameVal<a.endVal:a.frameVal>a.endVal;a.frameVal=c?a.endVal:a.frameVal,a.frameVal=Number(a.frameVal.toFixed(a.options.decimalPlaces)),a.printValue(a.frameVal),u<a.duration?a.rAF=requestAnimationFrame(a.count):a.finalEndVal!==null?a.update(a.finalEndVal):a.options.onCompleteCallback&&a.options.onCompleteCallback()},this.formatNumber=function(o){var u,c,d,f,g=o<0?"-":"";u=Math.abs(o).toFixed(a.options.decimalPlaces);var T=(u+="").split(".");if(c=T[0],d=T.length>1?a.options.decimal+T[1]:"",a.options.useGrouping){f="";for(var y=3,b=0,A=0,R=c.length;A<R;++A)a.options.useIndianSeparators&&A===4&&(y=2,b=1),A!==0&&b%y==0&&(f=a.options.separator+f),b++,f=c[R-A-1]+f;c=f}return a.options.numerals&&a.options.numerals.length&&(c=c.replace(/[0-9]/g,function(N){return a.options.numerals[+N]}),d=d.replace(/[0-9]/g,function(N){return a.options.numerals[+N]})),g+a.options.prefix+c+d+a.options.suffix},this.easeOutExpo=function(o,u,c,d){return c*(1-Math.pow(2,-10*o/d))*1024/1023+u},this.options=la(la({},this.defaults),s),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(n),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,this.options.separator===""&&(this.options.useGrouping=!1),this.el=typeof t=="string"?document.getElementById(t):t,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined",typeof window<"u"&&this.options.enableScrollSpy&&(this.error?console.error(this.error,t):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push(function(){return a.handleScroll(a)}),window.onscroll=function(){window.onScrollFns.forEach(function(o){return o()})},this.handleScroll(this)))}return e.prototype.handleScroll=function(t){if(t&&window&&!t.once){var n=window.innerHeight+window.scrollY,s=t.el.getBoundingClientRect(),a=s.top+window.pageYOffset,o=s.top+s.height+window.pageYOffset;o<n&&o>window.scrollY&&t.paused?(t.paused=!1,setTimeout(function(){return t.start()},t.options.scrollSpyDelay),t.options.scrollSpyOnce&&(t.once=!0)):(window.scrollY>o||a>n)&&!t.paused&&t.reset()}},e.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var n=t-this.startVal;if(Math.abs(n)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=t;var s=this.countDown?1:-1;this.endVal=t+s*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t,this.finalEndVal=null;this.finalEndVal!==null?this.useEasing=!1:this.useEasing=this.options.useEasing},e.prototype.start=function(t){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),t&&(this.options.onCompleteCallback=t),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},e.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},e.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},e.prototype.update=function(t){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,this.finalEndVal==null&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},e.prototype.printValue=function(t){var n;if(this.el){var s=this.formattingFn(t);!((n=this.options.plugin)===null||n===void 0)&&n.render?this.options.plugin.render(this.el,s):this.el.tagName==="INPUT"?this.el.value=s:this.el.tagName==="text"||this.el.tagName==="tspan"?this.el.textContent=s:this.el.innerHTML=s}},e.prototype.ensureNumber=function(t){return typeof t=="number"&&!isNaN(t)},e.prototype.validateValue=function(t){var n=Number(t);return this.ensureNumber(n)?n:(this.error="[CountUp] invalid start or end value: ".concat(t),null)},e.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},e}();const z9=Object.freeze(Object.defineProperty({__proto__:null,CountUp:H9},Symbol.toStringTag,{value:"Module"})),Q9=Pc(z9);Object.defineProperty(hr,"__esModule",{value:!0});var ve=Z,Y9=Q9;function K9(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,o,u,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(s=o.call(n)).done)&&(c.push(s.value),c.length!==t);d=!0);}catch(g){f=!0,a=g}finally{try{if(!d&&n.return!=null&&(u=n.return(),Object(u)!==u))return}finally{if(f)throw a}}return c}}function to(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,s)}return n}function ca(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?to(Object(n),!0).forEach(function(s){W9(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):to(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function W9(e,t,n){return t=a4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Os(){return Os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Os.apply(this,arguments)}function Z9(e,t){if(e==null)return{};var n={},s=Object.keys(e),a,o;for(o=0;o<s.length;o++)a=s[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function fc(e,t){if(e==null)return{};var n=Z9(e,t),s,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)s=o[a],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function J9(e,t){return X9(e)||K9(e,t)||e4(e,t)||t4()}function X9(e){if(Array.isArray(e))return e}function e4(e,t){if(e){if(typeof e=="string")return no(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return no(e,t)}}function no(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function t4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
30
30
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a4(e){var t=n4(e,"string");return typeof t=="symbol"?t:String(t)}var s4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?ve.useLayoutEffect:ve.useEffect;function ze(e){var t=ve.useRef(e);return s4(function(){t.current=e}),ve.useCallback(function(){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return t.current.apply(void 0,s)},[])}var r4=function(t,n){var s=n.decimal,a=n.decimals,o=n.duration,u=n.easingFn,c=n.end,d=n.formattingFn,f=n.numerals,g=n.prefix,T=n.separator,y=n.start,b=n.suffix,A=n.useEasing,R=n.useGrouping,N=n.useIndianSeparators,_=n.enableScrollSpy,I=n.scrollSpyDelay,P=n.scrollSpyOnce,U=n.plugin;return new Y9.CountUp(t,c,{startVal:y,duration:o,decimal:s,decimalPlaces:a,easingFn:u,formattingFn:d,numerals:f,separator:T,prefix:g,suffix:b,plugin:U,useEasing:A,useIndianSeparators:N,useGrouping:R,enableScrollSpy:_,scrollSpyDelay:I,scrollSpyOnce:P})},i4=["ref","startOnMount","enableReinitialize","delay","onEnd","onStart","onPauseResume","onReset","onUpdate"],o4={decimal:".",separator:",",delay:null,prefix:"",suffix:"",duration:2,start:0,decimals:0,startOnMount:!0,enableReinitialize:!0,useEasing:!0,useGrouping:!0,useIndianSeparators:!1},hc=function(t){var n=Object.fromEntries(Object.entries(t).filter(function(ee){var ue=J9(ee,2),ce=ue[1];return ce!==void 0})),s=ve.useMemo(function(){return ca(ca({},o4),n)},[t]),a=s.ref,o=s.startOnMount,u=s.enableReinitialize,c=s.delay,d=s.onEnd,f=s.onStart,g=s.onPauseResume,T=s.onReset,y=s.onUpdate,b=fc(s,i4),A=ve.useRef(),R=ve.useRef(),N=ve.useRef(!1),_=ze(function(){return r4(typeof a=="string"?a:a.current,b)}),I=ze(function(ee){var ue=A.current;if(ue&&!ee)return ue;var ce=_();return A.current=ce,ce}),P=ze(function(){var ee=function(){return I(!0).start(function(){d==null||d({pauseResume:U,reset:B,start:D,update:V})})};c&&c>0?R.current=setTimeout(ee,c*1e3):ee(),f==null||f({pauseResume:U,reset:B,update:V})}),U=ze(function(){I().pauseResume(),g==null||g({reset:B,start:D,update:V})}),B=ze(function(){I().el&&(R.current&&clearTimeout(R.current),I().reset(),T==null||T({pauseResume:U,start:D,update:V}))}),V=ze(function(ee){I().update(ee),y==null||y({pauseResume:U,reset:B,start:D})}),D=ze(function(){B(),P()}),$=ze(function(ee){o&&(ee&&B(),P())});return ve.useEffect(function(){N.current?u&&$(!0):(N.current=!0,$())},[u,N,$,c,t.start,t.suffix,t.prefix,t.duration,t.separator,t.decimals,t.decimal,t.formattingFn]),ve.useEffect(function(){return function(){B()}},[B]),{start:D,pauseResume:U,reset:B,update:V,getCountUp:I}},l4=["className","redraw","containerProps","children","style"],c4=function(t){var n=t.className,s=t.redraw,a=t.containerProps,o=t.children,u=t.style,c=fc(t,l4),d=ve.useRef(null),f=ve.useRef(!1),g=hc(ca(ca({},c),{},{ref:d,startOnMount:typeof o!="function"||t.delay===0,enableReinitialize:!1})),T=g.start,y=g.reset,b=g.update,A=g.pauseResume,R=g.getCountUp,N=ze(function(){T()}),_=ze(function(U){t.preserveValue||y(),b(U)}),I=ze(function(){if(typeof t.children=="function"&&!(d.current instanceof Element)){console.error(`Couldn't find attached element to hook the CountUp instance into! Try to attach "containerRef" from the render prop to a an Element, eg. <span ref={containerRef} />.`);return}R()});ve.useEffect(function(){I()},[I]),ve.useEffect(function(){f.current&&_(t.end)},[t.end,_]);var P=s&&t;return ve.useEffect(function(){s&&f.current&&N()},[N,s,P]),ve.useEffect(function(){!s&&f.current&&N()},[N,s,t.start,t.suffix,t.prefix,t.duration,t.separator,t.decimals,t.decimal,t.className,t.formattingFn]),ve.useEffect(function(){f.current=!0},[]),typeof o=="function"?o({countUpRef:d,start:T,reset:y,update:b,pauseResume:A,getCountUp:R}):ve.createElement("span",Os({className:n,ref:d,style:u},a),typeof t.start<"u"?R().formattingFn(t.start):"")},u4=hr.default=c4;hr.useCountUp=hc;const gc=({value:e=0,decimals:t,duration:n=1,preserveValue:s=!0,...a})=>{const[,o]=e.toString().split("."),u=t??((o==null?void 0:o.length)||0);return S.jsx(u4,{end:e,...a,duration:n,decimals:u,enableScrollSpy:!1,preserveValue:s})},m4=O("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),d4=O("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),p4=()=>Ne,f4=O(p4())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),h4=O("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),g4=O("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),y4=O("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),T4=({points:e})=>S.jsxs(m4,{className:rs,children:[S.jsx(d4,{children:S.jsx(f4,{name:"icon-trophy"})}),S.jsxs(h4,{children:[S.jsx(g4,{children:"Total points"}),S.jsx(y4,{children:S.jsx(gc,{value:e})})]})]}),k4=({userSummary:e})=>{const[t,n]=Z.useState(0);return Z.useEffect(()=>{const s=e.subscribe(a=>{var o,u;(u=(o=a.data)==null?void 0:o.summary)!=null&&u.points&&n(a.data.summary.points)});return()=>{s()}},[e]),S.jsx(T4,{points:t})},b4=({sdk:e})=>{if(nt(e.sdkStore.status)!=="ready")return null;const t=e.getFeature(me.GAMES);return t?S.jsx(k4,{userSummary:t.userSummary.getStore()}):null},S4=()=>{const e=pc();return e?S.jsx("div",{className:"StreamLayerSDK",children:S.jsx(ao,{children:S.jsx(b4,{sdk:e})})}):null};exports.AutoSizer=Yo;exports.E=ss;exports.MastersStreamLayerProvider=G9;exports.MastersStreamLayerSDKReact=q9;exports.O=Ko;exports.PickHistoryStatus=Ro;exports.QuestionImages=fn;exports.QuestionStatus=Pe;exports.QuestionType=re;exports.StreamLayerLogin=$9;exports.StreamLayerSDKPoints=S4;exports.a=P2;exports.d=gc;exports.d$1=zs;exports.n=Wo;exports.n1=Ne;exports.o=zo;exports.r=Ts;exports.styled_default=O;exports.useStore=nt;exports.w=Qo;
|