@streamlayer/react 0.34.13 → 0.36.2

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index4.js"),S=require("@nanostores/react"),y=require("./masters2.js"),u=require("@streamlayer/sdk-web-types"),I=require("react"),W=require("./index3.js");require("react-countup");const je=require("react-countdown-circle-timer"),L=require("./index2.js"),pe=require("react-infinite-scroller");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("lodash.throttle");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const xe=t.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ne=t.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),ye=()=>t.c1,De=t.styled_default(ye())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),Te=t.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),ge=t.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),me=()=>t.c1,Ae=t.styled_default(me())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ne=({type:s,close:n,label:i})=>{const o=s?y.o[s]:{label:i,iconName:void 0};return e.jsxs(xe,{children:[e.jsxs(Ne,{children:[(o==null?void 0:o.iconName)&&e.jsx(De,{"data-type-trivia":s===u.QuestionType.TRIVIA,"data-type-poll":s===u.QuestionType.POLL,name:o.iconName}),(o==null?void 0:o.label)&&e.jsx(Te,{children:o.label})]}),e.jsx(ge,{onClick:n,children:e.jsx(Ae,{name:"icon-cross"})})]})},ie=s=>s.split(/\s+/).map(n=>n[0]).join("").toUpperCase(),ae=s=>s?s.toLocaleString("en-US"):"0",F=s=>s.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),B=s=>s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Z=s=>!isNaN(s.getTime()),he=t.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),fe=t.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),ze=t.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),J=({indicator:s,title:n})=>e.jsxs(he,{children:[e.jsx(fe,{children:n}),e.jsx(ze,{children:s})]}),Ee=t.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),ve=t.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Oe=t.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),Y=({indicator:s,title:n})=>e.jsxs(Ee,{children:[e.jsx(ve,{children:s}),e.jsx(Oe,{children:n})]}),Le=t.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Se=t.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ce=t.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),ke=t.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Qe=t.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),we=t.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),be=t.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),_e=t.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),$e=t.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ye=t.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Ue=t.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Re=t.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),qe=t.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Pe=t.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ve=t.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),We=t.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Fe=t.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Be="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",oe=({avatar:s,name:n,points:i,friendsRank:o,rank:a,streak:d,correct:r,incorrect:l,inTop:c,successRate:M})=>e.jsxs(Le,{children:[e.jsx(Se,{children:e.jsxs(ke,{children:[e.jsxs(Fe,{children:[s&&e.jsx(Qe,{alt:"avatar",src:s}),!s&&e.jsx(We,{children:ie(n||"")})]}),e.jsxs(we,{children:[e.jsx(be,{children:n}),e.jsxs(_e,{children:[e.jsxs(Ye,{children:[e.jsx($e,{alt:"rank-icon",src:Be}),e.jsxs(Ue,{children:[ae(i),e.jsx(Re,{children:"PTS"})]})]}),e.jsx(qe,{}),e.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),e.jsxs(Ce,{children:[e.jsxs(Pe,{children:[e.jsx(J,{indicator:o||0,title:"Friends rank"}),e.jsx(J,{indicator:a||0,title:"Global rank"})]}),e.jsxs(Ve,{children:[e.jsx(Y,{indicator:d||0,title:"Win streak"}),e.jsx(Y,{indicator:r||0,title:"Correct"}),e.jsx(Y,{indicator:l||0,title:"Incorrect"}),e.jsx(Y,{indicator:`${M||0}%`,title:"Succ. rate"})]})]})]}),Ze=t.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),Ge=()=>t.c1,He=t.styled_default(Ge())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),Je=()=>e.jsx(Ze,{children:e.jsx(He,{name:"mastersLogo"})}),Xe=t.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),Ke=t.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),es=t.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ss=({title:s,description:n})=>e.jsxs(Xe,{children:[e.jsx(t.c1,{name:"icon-check-circle"}),e.jsx(Ke,{children:s}),e.jsx(es,{children:n})]}),ts=t.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ns=()=>t.c1,is=t.styled_default(ns())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),_=t.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),U=t.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),as=t.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),w=t.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),V=t.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),os=({feedbackMessages:s,questionVotedCorrectly:n,questionVoted:i,questionType:o,hasCorrectAnswer:a,questionStatus:d,showExpiredNotification:r,showClosedNotificationTrivia:l,votedInCurrentRender:c,votedAfterQuestionClosed:M,enteredAnActiveQuestion:j,marketClosed:p})=>{const N=i&&(o===u.QuestionType.TRIVIA||o===u.QuestionType.PREDICTION)&&c&&d!==u.QuestionStatus.RESOLVED,D=o===u.QuestionType.PREDICTION&&!a,E=p&&o===u.QuestionType.PREDICTION&&!i&&!j||o===u.QuestionType.PREDICTION&&M&&c&&j,m=N&&D,v=N&&a,A=o===u.QuestionType.PREDICTION&&i&&c&&a,C=i&&o===u.QuestionType.POLL&&c;if(!r&&!l&&!m&&!v&&!E&&!C&&!A)return null;const z=n?"correct":"incorrect",f=n?s==null?void 0:s.correctFeedback:s==null?void 0:s.incorrectFeedback;return e.jsxs(ts,{"data-isPrediction":D,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(t.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(U,{children:e.jsx(w,{children:"Question Expired"})}),e.jsx(V,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(t.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(U,{children:e.jsx(w,{children:"Question Closed"})}),e.jsx(V,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),E&&e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(t.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(U,{children:e.jsx(w,{children:"Question Closed"})}),e.jsx(V,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),m&&e.jsxs(e.Fragment,{children:[e.jsx(is,{name:"icon-prediction"}),e.jsx(w,{children:"Stay tuned to see if your prediction was correct."})]}),C&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-feedbackType":"correct",children:e.jsx(t.c1,{name:"correct"})}),e.jsx(w,{children:"That's for answering. Please stay tuned for the next question."})]}),(v||A)&&e.jsxs(e.Fragment,{children:[e.jsx(_,{"data-feedbackType":z,children:e.jsx(t.c1,{name:z})}),e.jsx("div",{children:e.jsxs(U,{children:[e.jsx(as,{"data-feedbackType":z,children:f==null?void 0:f.title}),e.jsx(w,{children:f==null?void 0:f.description})]})})]})]})},rs=t.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),ls=t.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),ds=t.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),cs=t.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),us=t.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),Ms=t.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),Is=t.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),js=t.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),ps=t.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),re=t.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),xs=()=>re,Ns=t.styled_default(xs())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),ys=()=>re,Ds=t.styled_default(ys())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ts=t.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),gs=t.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),ms=t.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),As=t.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),hs=()=>t.c1,fs=t.styled_default(hs())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),X={[u.QuestionImages.CENTERED]:s=>e.jsx(Ns,{alt:"option-icon",src:s}),[u.QuestionImages.TRANSPARENT]:s=>e.jsx(js,{children:e.jsx(ps,{style:{backgroundImage:`url(${s})`}})}),[u.QuestionImages.ROUNDED]:s=>e.jsx(Ds,{alt:"option-icon",src:s}),[u.QuestionImages.NONE]:()=>null,[u.QuestionImages.UNSET]:()=>null},zs=({questionType:s,hasCorrectAnswer:n,correct:i,youVoted:o,questionVoted:a})=>{if(s===u.QuestionType.POLL&&o)return"correct";if(s===u.QuestionType.PREDICTION){if(n&&a)return o?i?"correct":"incorrect":"unset";if(o)return"correct"}return s===u.QuestionType.TRIVIA&&a&&o?i?"correct":"incorrect":"unset"},Es=({questionType:s,questionVoted:n,correct:i,hasCorrectAnswer:o,questionStatus:a})=>s===u.QuestionType.TRIVIA?n&&i:s===u.QuestionType.PREDICTION?n&&i&&o||a===u.QuestionStatus.RESOLVED&&i:!1,vs=s=>{var n;const{id:i,icon:o,text:a,percentageDecimal:d,points:r,onVote:l,markThatVoted:c,youSelected:M,questionVoted:j,imageMode:p,answerTimeExpired:N,questionStatus:D,isLoading:E,questionType:m,correct:v,hasCorrectAnswer:A,votedAfterQuestionClosed:C,enteredAnActiveQuestion:z,marketClosed:f}=s,O=zs(s),P=Es({questionType:m,questionVoted:j,correct:v,hasCorrectAnswer:A,questionStatus:D}),k=f&&m===u.QuestionType.PREDICTION,$=j||k,x=m===u.QuestionType.PREDICTION&&!j&&D!==u.QuestionStatus.RESOLVED;return e.jsxs(us,{value:i,"data-selected":M,"data-answer-state":O,disabled:j||E||N||k&&!z||k&&z&&C,"data-is-not-checked":j&&!M&&O!=="incorrect",onClick:g=>{c(m===u.QuestionType.PREDICTION?f:D===u.QuestionStatus.RESOLVED),l(g)},children:[e.jsx(Ms,{"data-answer-state":O,style:{width:`${$?d:0}%`}}),e.jsxs(Is,{children:[o&&p&&((n=X[p])==null?void 0:n.call(X,o)),e.jsx(Ts,{children:a}),x&&e.jsxs("div",{children:[e.jsx(W.d,{value:r}),e.jsx(ms,{children:"pts"})]}),$&&e.jsxs(gs,{children:[P&&e.jsx(fs,{name:"selected"}),e.jsx(As,{children:e.jsx(W.d,{value:d,suffix:"%"})})]})]})]})},Os=[L.E.PRIMARY_GREEN1,L.E.SECONDARY_RED1,L.E.SECONDARY_RED1,L.E.NEUTRALS_GRAY3],Ls=[10,10,1,0],Ss=t.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Cs=L.E.SECONDARY_GREEN6,K=L.E.SECONDARY_RED3,ks=L.E.NEUTRALS_GRAY3,Qs=({isPlaying:s=!0,duration:n=30,onTimerExpired:i})=>{const[o,a]=I.useState(n>10?Cs:K),d=({remainingTime:c})=>e.jsx(Ss,{children:c}),r=I.useCallback(()=>{i==null||i(),a(ks)},[i,a]),l=I.useCallback(c=>{c===10&&a(K)},[a]);return e.jsx(je.CountdownCircleTimer,{isPlaying:s,duration:n,colors:Os,colorsTime:Ls,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:o,onComplete:r,onUpdate:l,children:d})},ws=t.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),bs=t.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),_s=t.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),$s=()=>t.c1,Ys=t.styled_default($s())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Us=t.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Rs=t.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),qs=t.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Ps=({title:s,points:n,isPlayingTimer:i,isTimer:o,questionType:a,timerDuration:d,onTimerExpired:r})=>e.jsxs(ws,{style:{justifyContent:a===u.QuestionType.PREDICTION?"center":"space-between"},children:[e.jsxs(bs,{children:[s&&e.jsx(_s,{children:s}),n!==void 0&&a!==u.QuestionType.POLL&&e.jsxs(e.Fragment,{children:[e.jsx(Ys,{name:"icon-trophy"}),e.jsxs(Us,{children:[e.jsx(Rs,{children:e.jsx(W.d,{value:n})}),e.jsx(qs,{children:"PTS"})]})]})]}),o&&a!==u.QuestionType.PREDICTION&&e.jsx(Qs,{isPlaying:i,onTimerExpired:r,duration:d})]}),Vs=({openedQuestion:s,isLoading:n,vote:i,close:o})=>{var a,d;const r=s.subject,l=s.type,c=s.status,M=(a=s.options)==null?void 0:a.options,j=s.marketClosed,[p,N]=I.useState(!1),[D,E]=I.useState(!1),[m,v]=I.useState(!0),[A,C]=I.useState(!1),[z,f]=I.useState(""),O=s==null?void 0:s.id;I.useEffect(()=>{l===u.QuestionType.PREDICTION?j&&v(!1):c===u.QuestionStatus.RESOLVED&&v(!1)},[]);const P=I.useCallback(T=>{E(T),N(!0)},[]),k=I.useCallback(async T=>{if(O){const b=T.currentTarget.value;f(b),await i(O,b)}},[O,f,i]),$=I.useCallback(()=>{C(!0),setTimeout(o,3e3)},[o]),x=I.useMemo(()=>s==null?void 0:s.answers.find(T=>T.youVoted===!0),[s]),g=I.useMemo(()=>!!(s!=null&&s.answers.find(T=>T.correct===!0)),[s]),h=I.useMemo(()=>s==null?void 0:s.answers.find(T=>T.correct===!0),[s]),de=I.useMemo(()=>s?s.answers.map(T=>{var b;return{...T,questionVoted:!!x,youSelected:z===T.id,isLoading:n,hasCorrectAnswer:g,questionType:s.type,answerTimeExpired:A,questionStatus:c,imageMode:(b=s.appearance)==null?void 0:b.images,onVote:k}}):[],[g,A,n,s,x,c,k,z]),ce=M&&(M.case==="trivia"||M.case==="prediction")?M.value:void 0,Q=c===u.QuestionStatus.RESOLVED&&l===u.QuestionType.TRIVIA&&!x&&!m,G=l===u.QuestionType.TRIVIA&&D&&p&&m,H=I.useMemo(()=>l===u.QuestionType.PREDICTION?!!(x&&!g||x&&g&&h!=null&&h.youVoted):!0,[l,x,g,h]),ue=I.useMemo(()=>{if(l===u.QuestionType.PREDICTION&&x&&(!g||g&&h!=null&&h.youVoted))return x.points;if(!(Q||A))return c===u.QuestionStatus.RESOLVED?0:x?x.correct?x.points:0:h==null?void 0:h.points},[A,x,h,c,Q,l,g]),Me=I.useMemo(()=>l===u.QuestionType.PREDICTION&&x?g?g&&h!=null&&h.youVoted?"You won":"":"To win":Q||A?"Time expired":l===u.QuestionType.POLL?"Time remaining":x?"You won":"To win",[A,l,x,Q,g,h]),Ie=x||Q||G||l===u.QuestionType.TRIVIA&&c===u.QuestionStatus.RESOLVED&&m;return e.jsx(y.i,{"data-question-header":"true",children:e.jsx(rs,{children:e.jsxs(ls,{children:[e.jsx(os,{feedbackMessages:ce,questionVoted:!!x,questionVotedCorrectly:x==null?void 0:x.correct,questionType:l,hasCorrectAnswer:g,questionStatus:c,showExpiredNotification:Q,showClosedNotificationTrivia:G,votedInCurrentRender:p,votedAfterQuestionClosed:D,enteredAnActiveQuestion:m,marketClosed:j}),H&&e.jsx(Ps,{title:Me,points:ue,onTimerExpired:$,questionType:s.type,isTimer:!n,isPlayingTimer:!x,timerDuration:Ie?0:Number(((d=s==null?void 0:s.appearance)==null?void 0:d.autoHideInterval)||"30")}),A?e.jsx(ss,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{style:H?{}:{marginTop:0},children:r}),e.jsx(cs,{children:de.map(T=>e.jsx(vs,{...T,markThatVoted:P,votedAfterQuestionClosed:D,enteredAnActiveQuestion:m,marketClosed:j},T.id))})]})]})})})},Ws=t.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),Fs=t.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),Bs=t.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),Zs=t.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),Gs=t.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),Hs=t.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),le=({created:s,image:n,title:i,isPickHistory:o,instantView:a,notification:d})=>{const r=I.useMemo(()=>{if(s){const c=new Date(s);if(Z(c))return{date:F(c),time:B(c)}}return null},[s]),l=(a==null?void 0:a.image)||n;return e.jsxs(Ws,{children:[r&&e.jsxs(Gs,{children:[r.date," · ",r.time]}),(a==null?void 0:a.video)&&e.jsx(y.w,{source:a.video.url,poster:a.video.thumbnailUrl}),l&&!(a!=null&&a.video)&&e.jsx(Hs,{src:l}),e.jsxs(Fs,{children:[e.jsx(Bs,{children:o?i:a==null?void 0:a.heading}),e.jsx(Zs,{children:o?d==null?void 0:d.body:a==null?void 0:a.body})]})]})},Js=t.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Xs=t.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),Ks=({instantView:s,...n})=>e.jsxs(Js,{children:[e.jsx(le,{instantView:s,...n}),(s==null?void 0:s.webLink)&&e.jsxs(Xs,{href:s==null?void 0:s.webLink.url,target:"_blank",children:[s==null?void 0:s.webLink.label,e.jsx(t.c1,{name:"icon-external-link"})]})]}),et=t.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),st=t.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),tt=t.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),nt=({created:s,...n})=>{const i=I.useMemo(()=>{if(s){const o=new Date(s);if(Z(o))return{date:F(o),time:B(o)}}return null},[s]);return e.jsxs(et,{children:[i&&e.jsxs(st,{children:[i.date," · ",i.time]}),n.title&&e.jsx(tt,{children:n.title}),e.jsx(y.j,{...n})]})},it=t.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),at=({openedQuestion:s})=>{var n,i;return((n=s==null?void 0:s.attributes)==null?void 0:n.attributes.case)==="insight"?e.jsx(Ks,{created:s.attributes.created,...s.attributes.attributes.value}):((i=s==null?void 0:s.attributes)==null?void 0:i.attributes.case)==="tweet"?e.jsx(nt,{created:s.attributes.created,...s.attributes.attributes.value}):null},ot=({extendedQuestion:s,vote:n,close:i})=>{const{loading:o,data:a}=s;return a?e.jsx(Vs,{vote:n,close:i,openedQuestion:a,isLoading:!!o}):null},rt=({gamification:s})=>{var n;const i=S.useStore(s.openedQuestion.$store),o=S.useStore(s.openedQuestion.$extendedStore);if(!i)return null;const a=i.type;return e.jsxs(it,{children:[e.jsx(ne,{close:s.closeQuestion,type:((n=i.attributes)==null?void 0:n.type)||u.QuestionType.UNSET}),a==="question"&&e.jsx(ot,{vote:s.submitAnswer,close:s.closeQuestion,extendedQuestion:o}),a!=="question"&&e.jsx(at,{openedQuestion:i}),e.jsx(Je,{sponsorLogo:""})]})},lt=t.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),dt=t.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),ct=t.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),ut=t.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var q=(s=>(s.HOME="home",s.LEADERBOARD="leaderboard",s))(q||{});const ee=({title:s,active:n,onClick:i})=>e.jsx(ct,{onClick:i,"data-selected":n,children:e.jsx(ut,{children:s})}),Mt=({activePage:s="home",toggleActivePage:n})=>e.jsx(lt,{children:e.jsxs(dt,{"data-position":s==="home"?"left":"right",children:[e.jsx(ee,{title:"Home",active:s==="home",onClick:()=>n("home")}),e.jsx(ee,{title:"Friends",active:s==="leaderboard",onClick:()=>n("leaderboard")})]})}),It=t.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),jt=t.styled_default("img")({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!1}),pt=t.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),xt=t.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),Nt=t.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),yt=()=>t.c1,Dt=t.styled_default(yt())({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),Tt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iMTYiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xMC40NjE1IDEyLjY4NzVDOS40NDIzMSAxMi42ODc1IDguNjE1MzggMTMuNDY2NSA4LjYxNTM4IDE0LjQyNjZDOC42MTUzOCAxNS4zODY4IDkuNDQyMzEgMTYuMTY1OCAxMC40NjE1IDE2LjE2NThDMTEuNDgwOCAxNi4xNjU4IDEyLjMwNzcgMTUuMzg2OCAxMi4zMDc3IDE0LjQyNjZDMTIuMzA3NyAxMy40NjY1IDExLjQ4MDggMTIuNjg3NSAxMC40NjE1IDEyLjY4NzVaTTEwLjQ2MTUgMTYuMTY1OEM5LjEwODE3IDE2LjE2NTggOCAxNy4yMDk3IDggMTguNDg0NlYxOS43NTI3QzggMTkuNzUyNyA4LjYxNTM4IDIwLjIyMzcgMTAuNDYxNSAyMC4yMjM3QzEyLjMwNzcgMjAuMjIzNyAxMi45MjMxIDE5Ljc1MjcgMTIuOTIzMSAxOS43NTI3VjE4LjQ4NDZDMTIuOTIzMSAxNy4yMDk3IDExLjgxNDkgMTYuMTY1OCAxMC40NjE1IDE2LjE2NThaTTIxLjUzODUgMTIuNjg3NUMyMC41MTkyIDEyLjY4NzUgMTkuNjkyMyAxMy40NjY1IDE5LjY5MjMgMTQuNDI2NkMxOS42OTIzIDE1LjM4NjggMjAuNTE5MiAxNi4xNjU4IDIxLjUzODUgMTYuMTY1OEMyMi41NTc3IDE2LjE2NTggMjMuMzg0NiAxNS4zODY4IDIzLjM4NDYgMTQuNDI2NkMyMy4zODQ2IDEzLjQ2NjUgMjIuNTU3NyAxMi42ODc1IDIxLjUzODUgMTIuNjg3NVpNMjEuNTM4NSAxNi4xNjU4QzIwLjE4NTEgMTYuMTY1OCAxOS4wNzY5IDE3LjIwOTcgMTkuMDc2OSAxOC40ODQ2VjE5Ljc1MjdDMTkuMDc2OSAxOS43NTI3IDE5LjY5MjMgMjAuMjIzNyAyMS41Mzg1IDIwLjIyMzdDMjMuMzg0NiAyMC4yMjM3IDI0IDE5Ljc1MjcgMjQgMTkuNzUyN1YxOC40ODQ2QzI0IDE3LjIwOTcgMjIuODkxOCAxNi4xNjU4IDIxLjUzODUgMTYuMTY1OFpNMTYgMTUuMDA2M0MxNC45ODA4IDE1LjAwNjMgMTQuMTUzOCAxNS43ODUzIDE0LjE1MzggMTYuNzQ1NUMxNC4xNTM4IDE3LjcwNTYgMTQuOTgwOCAxOC40ODQ2IDE2IDE4LjQ4NDZDMTcuMDE5MiAxOC40ODQ2IDE3Ljg0NjIgMTcuNzA1NiAxNy44NDYyIDE2Ljc0NTVDMTcuODQ2MiAxNS43ODUzIDE3LjAxOTIgMTUuMDA2MyAxNiAxNS4wMDYzWk0xNiAxOC40ODQ2QzE0LjY0NjYgMTguNDg0NiAxMy41Mzg1IDE5LjUyODUgMTMuNTM4NSAyMC44MDM0VjIyLjA3MTVDMTMuNTM4NSAyMi4wNzE1IDE0LjE1MzggMjIuNTQyNSAxNiAyMi41NDI1QzE3Ljg0NjIgMjIuNTQyNSAxOC40NjE1IDIyLjA3MTUgMTguNDYxNSAyMi4wNzE1VjIwLjgwMzRDMTguNDYxNSAxOS41Mjg1IDE3LjM1MzQgMTguNDg0NiAxNiAxOC40ODQ2WiIgZmlsbD0iIzEwN0Q1NyIvPgo8cGF0aCBvcGFjaXR5PSIwLjUiIGQ9Ik0xMy4zOTA4IDlDMTIuMzEwMyA5IDExLjQzMzYgOS44MjU4NCAxMS40MzM2IDEwLjg0MzdDMTEuNDMzNiAxMS44NjE2IDEyLjMxMDMgMTIuNjg3NSAxMy4zOTA4IDEyLjY4NzVDMTQuNDcxMyAxMi42ODc1IDE1LjM0OCAxMS44NjE2IDE1LjM0OCAxMC44NDM3QzE1LjM0OCA5LjgyNTg0IDE0LjQ3MTMgOSAxMy4zOTA4IDlaTTEzLjM5MDggMTIuNjg3NUMxMy4xOTQ2IDEyLjY4NzUgMTIuOTk1OCAxMi42ODI3IDEyLjc5OTYgMTIuNzQ1MUMxMy4xOTIgMTMuMjM3MiAxMy4zOTA4IDEzLjg1NDIgMTMuMzkwOCAxNC41MzEyQzEzLjM5MDggMTQuNzc2MSAxMy4zMjk2IDE1LjAxNjEgMTMuMzI5NiAxNS4yNjFDMTMuODUyMSAxNC41MjQgMTQuNjk1NiAxNC4wMzkxIDE1LjY3NDIgMTMuOTE2NkMxNS4yMTggMTMuMTc5NiAxNC4zNjk0IDEyLjY4NzUgMTMuMzkwOCAxMi42ODc1Wk0xOC42MSA5QzE3LjUyOTUgOSAxNi42NTI4IDkuODI1ODQgMTYuNjUyOCAxMC44NDM3QzE2LjY1MjggMTEuODYxNiAxNy41Mjk1IDEyLjY4NzUgMTguNjEgMTIuNjg3NUMxOS42OTA1IDEyLjY4NzUgMjAuNTY3MiAxMS44NjE2IDIwLjU2NzIgMTAuODQzN0MyMC41NjcyIDkuODI1ODQgMTkuNjkwNSA5IDE4LjYxIDlaTTE4LjYxIDEyLjY4NzVDMTcuNjMxNCAxMi42ODc1IDE2Ljc4MjggMTMuMTc5NiAxNi4zMjY2IDEzLjkxNjZDMTcuMzA1MiAxNC4wMzkxIDE4LjE0ODcgMTQuNTI0IDE4LjY3MTIgMTUuMjYxQzE4LjY3MTIgMTUuMDE2MSAxOC42MSAxNC43NzYxIDE4LjYxIDE0LjUzMTJDMTguNjEgMTMuODU0MiAxOC44MDg4IDEzLjIzNzIgMTkuMjAxMiAxMi43NDUxQzE5LjAwNSAxMi42ODI3IDE4LjgwNjIgMTIuNjg3NSAxOC42MSAxMi42ODc1WiIgZmlsbD0iIzEwN0Q1NyIvPgo8L3N2Zz4K",gt=({title:s,description:n,onClick:i,className:o})=>e.jsxs(It,{onClick:i,className:o,children:[e.jsx(jt,{alt:"friends-icon",src:Tt}),e.jsxs(pt,{children:[e.jsx(xt,{children:s}),e.jsx(Nt,{children:n})]}),e.jsx(Dt,{name:"icon-copy"})]});function mt(s){var n=s.lastRenderedStartIndex,i=s.lastRenderedStopIndex,o=s.startIndex,a=s.stopIndex;return!(o>i||a<n)}function At(s){for(var n=s.isItemLoaded,i=s.itemCount,o=s.minimumBatchSize,a=s.startIndex,d=s.stopIndex,r=[],l=null,c=null,M=a;M<=d;M++){var j=n(M);j?c!==null&&(r.push(l,c),l=c=null):(c=M,l===null&&(l=M))}if(c!==null){for(var p=Math.min(Math.max(c,l+o-1),i-1),N=c+1;N<=p&&!n(N);N++)c=N;r.push(l,c)}if(r.length)for(;r[1]-r[0]+1<o&&r[0]>0;){var D=r[0]-1;if(!n(D))r[0]=D;else break}return r}var ht=function(s,n){if(!(s instanceof n))throw new TypeError("Cannot call a class as a function")},ft=function(){function s(n,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}return function(n,i,o){return i&&s(n.prototype,i),o&&s(n,o),n}}(),zt=function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);s.prototype=Object.create(n&&n.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(s,n):s.__proto__=n)},se=function(s,n){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:s};(function(s){zt(n,s);function n(){var i,o,a,d;ht(this,n);for(var r=arguments.length,l=Array(r),c=0;c<r;c++)l[c]=arguments[c];return d=(o=(a=se(this,(i=n.__proto__||Object.getPrototypeOf(n)).call.apply(i,[this].concat(l))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(M){var j=M.visibleStartIndex,p=M.visibleStopIndex;a._lastRenderedStartIndex=j,a._lastRenderedStopIndex=p,a._ensureRowsLoaded(j,p)},a._setRef=function(M){a._listRef=M},o),se(a,d)}return ft(n,[{key:"resetloadMoreItemsCache",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],o&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var o=this.props.children;return o({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(o,a){var d=this.props,r=d.isItemLoaded,l=d.itemCount,c=d.minimumBatchSize,M=c===void 0?10:c,j=d.threshold,p=j===void 0?15:j,N=At({isItemLoaded:r,itemCount:l,minimumBatchSize:M,startIndex:Math.max(0,o-p),stopIndex:Math.min(l-1,a+p)});(this._memoizedUnloadedRanges.length!==N.length||this._memoizedUnloadedRanges.some(function(D,E){return N[E]!==D}))&&(this._memoizedUnloadedRanges=N,this._loadUnloadedRanges(N))}},{key:"_loadUnloadedRanges",value:function(o){for(var a=this,d=this.props.loadMoreItems||this.props.loadMoreRows,r=function(M){var j=o[M],p=o[M+1],N=d(j,p);N!=null&&N.then(function(){if(mt({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:j,stopIndex:p})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(j,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},l=0;l<o.length;l+=2)r(l)}}]),n})(I.PureComponent);const Et=t.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),vt=t.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Ot=t.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Lt=t.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),St=t.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ct=t.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),kt=t.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Qt=()=>t.c1,wt=t.styled_default(Qt())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),bt=({rank:s,avatar:n,name:i,points:o,isCurrentUser:a,openItemDetail:d,style:r})=>e.jsxs(Et,{onClick:d,style:r,children:[e.jsx(vt,{children:s||0}),e.jsxs(St,{children:[n?e.jsx(Ot,{alt:"leaderboard-item-avatar",src:n}):e.jsx(Lt,{children:ie(i||"")}),e.jsxs(Ct,{children:[e.jsx(kt,{children:i||""}),a&&e.jsx(wt,{name:"icon-star"})]})]}),e.jsx("div",{children:ae(o)})]}),_t=t.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),$t=({items:s,currentUserId:n,openItemDetail:i,fetchMore:o,scrollNode:a,hasMore:d})=>e.jsx(pe,{loadMore:o,initialLoad:!1,hasMore:d,useWindow:!1,getScrollParent:()=>a.current,children:e.jsx(_t,{children:s.map(r=>e.jsx(bt,{...r,openItemDetail:()=>i(r.userId),isCurrentUser:!!n&&n===r.userId},r.userId))})}),Yt=({deepLink:s})=>e.jsx(y.O,{inviteLink:s,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s More Fun With Friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."}),Ut=t.styled_default("div")({name:"InviteLinkContainer",class:"i1chxfpe",propsAsIs:!1}),Rt=({gamification:s,scrollNode:n,scrollStore:i})=>{const{data:o,hasMore:a}=S.useStore(s.leaderboardList.$store),{data:d}=S.useStore(s.deepLink.$store);if(!(o!=null&&o.length))return e.jsx(Yt,{deepLink:d});const r=async()=>{if(d)try{await navigator.clipboard.writeText(d)}catch(l){console.error("Unable to copy to clipboard",l)}};return e.jsxs(e.Fragment,{children:[e.jsx($t,{items:o,scrollNode:n,scrollStore:i,fetchMore:s.leaderboardList.fetchMore,hasMore:a,openItemDetail:s.openUser,currentUserId:s.currentUserId.get()}),d&&e.jsx(Ut,{children:e.jsx(gt,{onClick:r,title:"Invite Friends",description:"Challenge them now!"})})]})},qt=t.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Pt=t.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Vt=t.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Wt=t.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Ft=()=>t.c1,R=t.styled_default(Ft())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Bt=()=>t.c1,Zt=t.styled_default(Bt())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),Gt=t.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),Ht=t.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),Jt=t.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),Xt={[u.PickHistoryStatus.LOST]:e.jsx(R,{name:"incorrectVoted"}),[u.PickHistoryStatus.WON]:e.jsx(R,{name:"icon-check"}),[u.PickHistoryStatus.UNSET]:e.jsx(R,{name:"icon-arrow"}),[u.PickHistoryStatus.DNP]:e.jsx(R,{name:"icon-arrow"})},Kt=({questionId:s,questionType:n,questionStatus:i,subject:o,openForVoting:a,openQuestion:d,status:r})=>{const l=y.o[n],c=Xt[r];return l?e.jsxs(qt,{onClick:()=>d==null?void 0:d(s),children:[e.jsxs(Ht,{children:[e.jsxs(Pt,{children:[e.jsx(Zt,{"data-type-trivia":n===u.QuestionType.TRIVIA,"data-type-poll":n===u.QuestionType.POLL,name:l.iconName}),e.jsxs(Gt,{children:[l.label,n===u.QuestionType.TRIVIA&&i===u.QuestionStatus.RESOLVED&&" • Expired"]})]}),e.jsx(Vt,{children:o||""})]}),e.jsx(Wt,{children:a?e.jsx(Jt,{children:"Play"}):c})]}):null},en=t.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),sn=t.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),tn=({openInsight:s,questionId:n,...i})=>e.jsxs(en,{children:[e.jsx(le,{questionId:n,...i,isPickHistory:!0}),s&&e.jsx(sn,{onClick:()=>s(n),children:"View Insight"})]}),nn=t.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),an=()=>y.c,on=t.styled_default(an())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),rn=t.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),ln=t.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),dn=({openTweet:s,created:n,...i})=>{const o=I.useMemo(()=>{if(n){const a=new Date(n);if(Z(a))return{date:F(a),time:B(a)}}return null},[n]);return e.jsxs(nn,{children:[o&&e.jsxs(rn,{children:[o.date," · ",o.time]}),i.title&&e.jsx(ln,{children:i.title}),e.jsx(y.j,{...i}),s&&e.jsx(on,{onClick:()=>s(i.tweetId),children:"View Insight"})]})},cn=t.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),un=({questions:s,openQuestion:n})=>e.jsx(cn,{children:s==null?void 0:s.map(i=>{var o,a,d;if(i.type==="question"&&((o=i.attributes)==null?void 0:o.attributes.case)==="question"){const r=i.attributes.attributes.value;return e.jsx(Kt,{openQuestion:n,...r},r.questionId)}if(i.type==="insight"&&((a=i.attributes)==null?void 0:a.attributes.case)==="insight"){const r=i.attributes.attributes.value,l=i.attributes.created;return e.jsx(tn,{openInsight:n,...r,created:l},r.questionId)}if(i.type==="tweet"&&((d=i.attributes)==null?void 0:d.attributes.case)==="tweet"){const r=i.attributes.attributes.value,l=i.attributes.id,c=i.attributes.created;return e.jsx(dn,{openTweet:n,...r,tweetId:l,created:c},l)}return null})}),Mn=({store:s,openQuestion:n})=>{const i=S.useStore(s);return i!=null&&i.data?e.jsx(un,{openQuestion:n,questions:i.data}):e.jsx("div",{children:"wait questions..."})},In=({userSummary:s})=>{var n;const[i,o]=I.useState(void 0);return I.useEffect(()=>{const a=s.subscribe(d=>{d!=null&&d.data&&o(d.data)});return()=>{a()}},[s]),i!=null&&i.summary?e.jsx(oe,{...i.summary,successRate:(n=i.percentage)==null?void 0:n.correct}):e.jsx("div",{children:"wait user..."})},jn=({gamification:s,className:n,scrollStore:i,scrollNode:o})=>{const[a,d]=I.useState(!1),[r,l]=I.useState(q.HOME),[,c]=I.useTransition(),M=p=>{c(()=>l(p))},j=p=>{c(()=>d(p))};return I.useEffect(()=>i.listen(p=>{if(p.scrollPosition===0){j(!1),i.setKey("tabsShown",!1);return}j(p.scrollDirection==="forward"),i.setKey("tabsShown",p.scrollDirection!=="forward")}),[i]),e.jsxs(y.p,{className:n,children:[e.jsx(y.C,{style:{top:a?"-60px":"0px"},children:e.jsx(Mt,{activePage:r,toggleActivePage:M})}),r===q.HOME&&e.jsxs(e.Fragment,{children:[e.jsx(y.n,{style:{paddingTop:"8px"},children:e.jsx(In,{userSummary:s.userSummary})}),e.jsx(y.e,{style:{flex:1},children:e.jsx(Mn,{openQuestion:s.openQuestion,store:s.feedList.getStore()})})]}),r===q.LEADERBOARD&&e.jsx(y.l,{children:e.jsx(Rt,{scrollStore:i,scrollNode:o,gamification:s})})]})},pn=()=>y.x,te=t.styled_default(pn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),xn=t.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Nn=({correct:s,incorrect:n})=>{const i=s+n;return i===0?0:Math.round(s/i*100)},yn=({gamification:s,scrollStore:n,className:i,appNode:o,scrollNode:a})=>{const d=S.useStore(s.openedQuestion.$store),r=S.useStore(s.openedUser);return e.jsxs(e.Fragment,{children:[d&&o.current&&y.Pk.createPortal(e.jsx(te,{className:i,children:e.jsx(rt,{gamification:s})}),o.current),r&&o.current&&y.Pk.createPortal(e.jsx(te,{className:i,children:e.jsxs(xn,{children:[e.jsx(ne,{label:"Friend's Rank",close:s.closeUser}),e.jsx(y.n,{children:e.jsx(oe,{...r,successRate:Nn(r)})})]})}),o.current),e.jsx(jn,{scrollStore:n,scrollNode:a,className:i,gamification:s})]})};exports.default=yn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./useSdkFeature.js"),k=require("@nanostores/react"),y=require("./masters2.js"),c=require("@streamlayer/sdk-web-types"),m=require("react"),z=require("./index3.js");require("react-countup");const he=require("react-countdown-circle-timer"),w=require("./index2.js"),fe=require("react-infinite-scroller");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("lodash.throttle");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const xe=t.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ie=t.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),ye=()=>t.c1,ve=t.styled_default(ye())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),je=t.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ce=t.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Ae=()=>t.c1,ge=t.styled_default(Ae())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ne=({type:s,close:n,label:a})=>{const o=s?y.o[s]:{label:a,iconName:void 0};return e.jsxs(xe,{children:[e.jsxs(Ie,{children:[(o==null?void 0:o.iconName)&&e.jsx(ve,{"data-type-trivia":s===c.QuestionType.TRIVIA,"data-type-poll":s===c.QuestionType.POLL,name:o.iconName}),(o==null?void 0:o.label)&&e.jsx(je,{children:o.label})]}),e.jsx(Ce,{onClick:n,children:e.jsx(ge,{name:"icon-cross"})})]})},ae=s=>s.split(/\s+/).map(n=>n[0]).join("").toUpperCase(),ie=s=>s?s.toLocaleString("en-US"):"0",H=s=>s.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),W=s=>s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),Y=s=>!isNaN(s.getTime()),_e=t.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),$e=t.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),be=t.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),K=({indicator:s,title:n})=>e.jsxs(_e,{children:[e.jsx($e,{children:n}),e.jsx(be,{children:s})]}),Te=t.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Se=t.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Re=t.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),O=({indicator:s,title:n})=>e.jsxs(Te,{children:[e.jsx(Se,{children:s}),e.jsx(Re,{children:n})]}),we=t.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),ke=t.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),qe=t.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Qe=t.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ee=t.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ne=t.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Le=t.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),De=t.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Pe=t.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Oe=t.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Me=t.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ve=t.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ue=t.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Fe=t.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Be=t.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),ze=t.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),He=t.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),We="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Trophy'%3e%3cpath%20id='Combined%20Shape'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.69197%204.66662C3.69197%205.99705%203.92914%207.17787%204.4035%208.20912C3.49966%208.02451%202.74487%207.66486%202.1391%207.13014C1.53333%206.59542%201.23046%206.0798%201.23046%205.58328V4.66662H3.69197ZM14.7686%204.66662V5.58328C14.7686%206.0798%2014.4658%206.59542%2013.86%207.13014C13.2542%207.66486%2012.4994%208.02451%2011.5956%208.20912C12.0699%207.17787%2012.3071%205.99705%2012.3071%204.66662H14.7686ZM15.9998%205.58329V4.36108C15.9998%204.10645%2015.9101%203.89002%2015.7306%203.71178C15.5511%203.53354%2015.3332%203.44442%2015.0768%203.44442H12.3076V2.52776C12.3076%202.10763%2012.1569%201.74797%2011.8556%201.44878C11.5544%201.14959%2011.1922%201%2010.7691%201H5.23072C4.80764%201%204.44547%201.14959%204.14419%201.44878C3.84291%201.74797%203.69227%202.10763%203.69227%202.52776V3.44442H0.923068C0.666659%203.44442%200.448714%203.53354%200.269228%203.71178C0.0897418%203.89002%200%204.10645%200%204.36108V5.58329C0%206.03525%200.13301%206.49039%200.399034%206.94872C0.665059%207.40705%201.02403%207.82082%201.47595%208.19003C1.92787%208.55924%202.48234%208.86957%203.13939%209.12101C3.79644%209.37246%204.48713%209.51409%205.21149%209.54592C5.48071%209.88967%205.7852%2010.192%206.12494%2010.453C6.36853%2010.6695%206.53679%2010.9002%206.62974%2011.1453C6.72269%2011.3904%206.76916%2011.6752%206.76916%2011.9999C6.76916%2012.3436%206.67141%2012.6333%206.4759%2012.8688C6.28038%2013.1043%205.96789%2013.2221%205.53841%2013.2221C5.05764%2013.2221%204.62976%2013.3669%204.25476%2013.6566C3.87977%2013.9462%203.69227%2014.3106%203.69227%2014.7499V15.361C3.69227%2015.4501%203.72112%2015.5233%203.77881%2015.5806C3.8365%2015.6379%203.91022%2015.6665%203.99996%2015.6665H11.9999C12.0896%2015.6665%2012.1633%2015.6379%2012.221%2015.5806C12.2787%2015.5233%2012.3076%2015.4501%2012.3076%2015.361V14.7499C12.3076%2014.3106%2012.1201%2013.9462%2011.7451%2013.6566C11.3701%2013.3669%2010.9422%2013.2221%2010.4614%2013.2221C10.0319%2013.2221%209.71945%2013.1043%209.52394%2012.8688C9.32843%2012.6333%209.23068%2012.3436%209.23068%2011.9999C9.23068%2011.6752%209.27715%2011.3904%209.3701%2011.1453C9.46305%2010.9002%209.63131%2010.6695%209.8749%2010.453C10.2146%2010.192%2010.5191%209.88967%2010.7884%209.54592C11.5127%209.51409%2012.2034%209.37246%2012.8604%209.12101C13.5175%208.86957%2014.072%208.55924%2014.5239%208.19003C14.9758%207.82082%2015.3348%207.40705%2015.6008%206.94872C15.8668%206.49039%2015.9998%206.03525%2015.9998%205.58329ZM6.76047%207.1798L8.05109%206.49997L9.3417%207.1798L9.09521%205.73989L10.1393%204.72015L8.69639%204.51007L8.05109%203.2L7.40578%204.51007L5.96283%204.72015L7.00696%205.73989L6.76047%207.1798Z'%20fill='%23F2C94C'/%3e%3c/g%3e%3c/svg%3e",oe=({avatar:s,name:n,points:a,friendsRank:o,rank:i,streak:u,correct:r,incorrect:l,inTop:d,successRate:p})=>e.jsxs(we,{children:[e.jsx(ke,{children:e.jsxs(Qe,{children:[e.jsxs(He,{children:[s&&e.jsx(Ee,{alt:"avatar",src:s}),!s&&e.jsx(ze,{children:ae(n||"")})]}),e.jsxs(Ne,{children:[e.jsx(Le,{children:n}),e.jsxs(De,{children:[e.jsxs(Oe,{children:[e.jsx(Pe,{alt:"rank-icon",src:We}),e.jsxs(Me,{children:[ie(a),e.jsx(Ve,{children:"PTS"})]})]}),e.jsx(Ue,{}),e.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),e.jsxs(qe,{children:[e.jsxs(Fe,{children:[e.jsx(K,{indicator:o||0,title:"Friends rank"}),e.jsx(K,{indicator:i||0,title:"Global rank"})]}),e.jsxs(Be,{children:[e.jsx(O,{indicator:u||0,title:"Win streak"}),e.jsx(O,{indicator:r||0,title:"Correct"}),e.jsx(O,{indicator:l||0,title:"Incorrect"}),e.jsx(O,{indicator:`${p||0}%`,title:"Succ. rate"})]})]})]}),Ye=t.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),Ze=()=>t.c1,Ge=t.styled_default(Ze())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),Ke=()=>e.jsx(Ye,{children:e.jsx(Ge,{name:"mastersLogo"})}),Je=t.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),Xe=t.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),es=t.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ss=({title:s,description:n})=>e.jsxs(Je,{children:[e.jsx(t.c1,{name:"icon-check-circle"}),e.jsx(Xe,{children:s}),e.jsx(es,{children:n})]}),ts=t.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ns=()=>t.c1,as=t.styled_default(ns())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),D=t.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),M=t.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),is=t.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),N=t.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),B=t.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),os=({feedbackMessages:s,questionVotedCorrectly:n,questionVoted:a,questionType:o,hasCorrectAnswer:i,questionStatus:u,showExpiredNotification:r,showClosedNotificationTrivia:l,votedInCurrentRender:d,votedAfterQuestionClosed:p,enteredAnActiveQuestion:f,marketClosed:I})=>{const h=a&&(o===c.QuestionType.TRIVIA||o===c.QuestionType.PREDICTION)&&d&&u!==c.QuestionStatus.RESOLVED,v=o===c.QuestionType.PREDICTION&&!i,T=I&&o===c.QuestionType.PREDICTION&&!a&&!f||o===c.QuestionType.PREDICTION&&p&&d&&f,A=h&&v,S=h&&i,g=o===c.QuestionType.PREDICTION&&a&&d&&i,q=a&&o===c.QuestionType.POLL&&d;if(!r&&!l&&!A&&!S&&!T&&!q&&!g)return null;const b=n?"correct":"incorrect",$=n?s==null?void 0:s.correctFeedback:s==null?void 0:s.incorrectFeedback;return e.jsxs(ts,{"data-isPrediction":v,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(D,{children:e.jsx(t.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(M,{children:e.jsx(N,{children:"Question Expired"})}),e.jsx(B,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx(D,{children:e.jsx(t.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(M,{children:e.jsx(N,{children:"Question Closed"})}),e.jsx(B,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),T&&e.jsxs(e.Fragment,{children:[e.jsx(D,{children:e.jsx(t.c1,{name:"questionExpired"})}),e.jsxs("div",{children:[e.jsx(M,{children:e.jsx(N,{children:"Question Closed"})}),e.jsx(B,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),A&&e.jsxs(e.Fragment,{children:[e.jsx(as,{name:"icon-prediction"}),e.jsx(N,{children:"Stay tuned to see if your prediction was correct."})]}),q&&e.jsxs(e.Fragment,{children:[e.jsx(D,{"data-feedback-type":"correct",children:e.jsx(t.c1,{name:"correct"})}),e.jsx(N,{children:"That's for answering. Please stay tuned for the next question."})]}),(S||g)&&e.jsxs(e.Fragment,{children:[e.jsx(D,{"data-feedback-type":b,children:e.jsx(t.c1,{name:b})}),e.jsx("div",{children:e.jsxs(M,{children:[e.jsx(is,{"data-feedback-type":b,children:$==null?void 0:$.title}),e.jsx(N,{children:$==null?void 0:$.description})]})})]})]})},rs=t.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),ls=t.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),ds=t.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),cs=t.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),us=t.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),ps=t.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),ms=t.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),hs=t.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),fs=t.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),re=t.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),xs=()=>re,Is=t.styled_default(xs())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),ys=()=>re,vs=t.styled_default(ys())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),js=t.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Cs=t.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),As=t.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),gs=t.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),_s=()=>t.c1,$s=t.styled_default(_s())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),J={[c.QuestionImages.CENTERED]:s=>e.jsx(Is,{alt:"option-icon",src:s}),[c.QuestionImages.TRANSPARENT]:s=>e.jsx(hs,{children:e.jsx(fs,{style:{backgroundImage:`url(${s})`}})}),[c.QuestionImages.ROUNDED]:s=>e.jsx(vs,{alt:"option-icon",src:s}),[c.QuestionImages.NONE]:()=>null,[c.QuestionImages.UNSET]:()=>null},bs=({questionType:s,hasCorrectAnswer:n,correct:a,youVoted:o,questionVoted:i})=>{if(s===c.QuestionType.POLL&&o)return"correct";if(s===c.QuestionType.PREDICTION){if(n&&i)return o?a?"correct":"incorrect":"unset";if(o)return"correct"}return s===c.QuestionType.TRIVIA&&i&&o?a?"correct":"incorrect":"unset"},Ts=({questionType:s,questionVoted:n,correct:a,hasCorrectAnswer:o,questionStatus:i})=>s===c.QuestionType.TRIVIA?n&&a:s===c.QuestionType.PREDICTION?n&&a&&o||i===c.QuestionStatus.RESOLVED&&a:!1,Ss=s=>{var n;const{id:a,icon:o,text:i,percentageDecimal:u,points:r,onVote:l,markThatVoted:d,youSelected:p,questionVoted:f,imageMode:I,answerTimeExpired:h,questionStatus:v,isLoading:T,questionType:A,correct:S,hasCorrectAnswer:g,votedAfterQuestionClosed:q,enteredAnActiveQuestion:b,marketClosed:$}=s,R=bs(s),F=Ts({questionType:A,questionVoted:f,correct:S,hasCorrectAnswer:g,questionStatus:v}),Q=$&&A===c.QuestionType.PREDICTION,P=f||Q,x=A===c.QuestionType.PREDICTION&&!f&&v!==c.QuestionStatus.RESOLVED;return e.jsxs(us,{value:a,"data-selected":p,"data-answer-state":R,disabled:f||T||h||Q&&!b||Q&&b&&q,"data-is-not-checked":f&&!p&&R!=="incorrect",onClick:C=>{d(A===c.QuestionType.PREDICTION?$:v===c.QuestionStatus.RESOLVED),l(C)},children:[e.jsx(ps,{"data-answer-state":R,style:{width:`${P?u:0}%`}}),e.jsxs(ms,{children:[o&&I&&((n=J[I])==null?void 0:n.call(J,o)),e.jsx(js,{children:i}),x&&e.jsxs("div",{children:[e.jsx(z.d,{value:r}),e.jsx(As,{children:"pts"})]}),P&&e.jsxs(Cs,{children:[F&&e.jsx($s,{name:"selected"}),e.jsx(gs,{children:e.jsx(z.d,{value:u,suffix:"%"})})]})]})]})},Rs=[w.E.PRIMARY_GREEN1,w.E.SECONDARY_RED1,w.E.SECONDARY_RED1,w.E.NEUTRALS_GRAY3],ws=[10,10,1,0],ks=t.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),qs=w.E.SECONDARY_GREEN6,X=w.E.SECONDARY_RED3,Qs=w.E.NEUTRALS_GRAY3,Es=({isPlaying:s=!0,duration:n=30,onTimerExpired:a})=>{const[o,i]=m.useState(n>10?qs:X),u=({remainingTime:d})=>e.jsx(ks,{children:d}),r=m.useCallback(()=>{a==null||a(),i(Qs)},[a,i]),l=m.useCallback(d=>{d===10&&i(X)},[i]);return e.jsx(he.CountdownCircleTimer,{isPlaying:s,duration:n,colors:Rs,colorsTime:ws,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:o,onComplete:r,onUpdate:l,children:u})},Ns=t.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Ls=t.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Ds=t.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Ps=()=>t.c1,Os=t.styled_default(Ps())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Ms=t.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Vs=t.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Us=t.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Fs=({title:s,points:n,isPlayingTimer:a,isTimer:o,questionType:i,timerDuration:u,onTimerExpired:r})=>e.jsxs(Ns,{style:{justifyContent:i===c.QuestionType.PREDICTION?"center":"space-between"},children:[e.jsxs(Ls,{children:[s&&e.jsx(Ds,{children:s}),n!==void 0&&i!==c.QuestionType.POLL&&e.jsxs(e.Fragment,{children:[e.jsx(Os,{name:"icon-trophy"}),e.jsxs(Ms,{children:[e.jsx(Vs,{children:e.jsx(z.d,{value:n})}),e.jsx(Us,{children:"PTS"})]})]})]}),o&&i!==c.QuestionType.PREDICTION&&e.jsx(Es,{isPlaying:a,onTimerExpired:r,duration:u})]}),Bs=({openedQuestion:s,isLoading:n,vote:a,close:o})=>{var i,u;const r=s.subject,l=s.type,d=s.status,p=(i=s.options)==null?void 0:i.options,f=s.marketClosed,[I,h]=m.useState(!1),[v,T]=m.useState(!1),[A,S]=m.useState(!0),[g,q]=m.useState(!1),[b,$]=m.useState(""),R=s==null?void 0:s.id;m.useEffect(()=>{l===c.QuestionType.PREDICTION?f&&S(!1):d===c.QuestionStatus.RESOLVED&&S(!1)},[]);const F=m.useCallback(j=>{T(j),h(!0)},[]),Q=m.useCallback(async j=>{if(R){const L=j.currentTarget.value;$(L),await a(R,L)}},[R,$,a]),P=m.useCallback(()=>{q(!0),setTimeout(o,3e3)},[o]),x=m.useMemo(()=>s==null?void 0:s.answers.find(j=>j.youVoted===!0),[s]),C=m.useMemo(()=>!!(s!=null&&s.answers.find(j=>j.correct===!0)),[s]),_=m.useMemo(()=>s==null?void 0:s.answers.find(j=>j.correct===!0),[s]),de=m.useMemo(()=>s?s.answers.map(j=>{var L;return{...j,questionVoted:!!x,youSelected:b===j.id,isLoading:n,hasCorrectAnswer:C,questionType:s.type,answerTimeExpired:g,questionStatus:d,imageMode:(L=s.appearance)==null?void 0:L.images,onVote:Q}}):[],[C,g,n,s,x,d,Q,b]),ce=p&&(p.case==="trivia"||p.case==="prediction")?p.value:void 0,E=d===c.QuestionStatus.RESOLVED&&l===c.QuestionType.TRIVIA&&!x&&!A,Z=l===c.QuestionType.TRIVIA&&v&&I&&A,G=m.useMemo(()=>l===c.QuestionType.PREDICTION?!!(x&&!C||x&&C&&_!=null&&_.youVoted):!0,[l,x,C,_]),ue=m.useMemo(()=>{if(l===c.QuestionType.PREDICTION&&x&&(!C||C&&_!=null&&_.youVoted))return x.points;if(!(E||g))return d===c.QuestionStatus.RESOLVED?0:x?x.correct?x.points:0:_==null?void 0:_.points},[g,x,_,d,E,l,C]),pe=m.useMemo(()=>l===c.QuestionType.PREDICTION&&x?C?C&&_!=null&&_.youVoted?"You won":"":"To win":E||g?"Time expired":l===c.QuestionType.POLL?"Time remaining":x?"You won":"To win",[g,l,x,E,C,_]),me=x||E||Z||l===c.QuestionType.TRIVIA&&d===c.QuestionStatus.RESOLVED&&A;return e.jsx(y.c,{"data-question-header":"true",children:e.jsx(rs,{children:e.jsxs(ls,{children:[e.jsx(os,{feedbackMessages:ce,questionVoted:!!x,questionVotedCorrectly:x==null?void 0:x.correct,questionType:l,hasCorrectAnswer:C,questionStatus:d,showExpiredNotification:E,showClosedNotificationTrivia:Z,votedInCurrentRender:I,votedAfterQuestionClosed:v,enteredAnActiveQuestion:A,marketClosed:f}),G&&e.jsx(Fs,{title:pe,points:ue,onTimerExpired:P,questionType:s.type,isTimer:!n,isPlayingTimer:!x,timerDuration:me?0:Number(((u=s==null?void 0:s.appearance)==null?void 0:u.autoHideInterval)||"30")}),g?e.jsx(ss,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{style:G?{}:{marginTop:0},children:r}),e.jsx(cs,{children:de.map(j=>e.jsx(Ss,{...j,markThatVoted:F,votedAfterQuestionClosed:v,enteredAnActiveQuestion:A,marketClosed:f},j.id))})]})]})})})},zs=t.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),Hs=t.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),Ws=t.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),Ys=t.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),Zs=t.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),Gs=t.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),le=({created:s,image:n,title:a,isPickHistory:o,instantView:i,notification:u})=>{const r=m.useMemo(()=>{if(s){const d=new Date(s);if(Y(d))return{date:H(d),time:W(d)}}return null},[s]),l=(i==null?void 0:i.image)||n;return e.jsxs(zs,{children:[r&&e.jsxs(Zs,{children:[r.date," · ",r.time]}),(i==null?void 0:i.video)&&e.jsx(y.w,{source:i.video.url,poster:i.video.thumbnailUrl}),l&&!(i!=null&&i.video)&&e.jsx(Gs,{src:l}),e.jsxs(Hs,{children:[e.jsx(Ws,{children:o?a:i==null?void 0:i.heading}),e.jsx(Ys,{children:o?u==null?void 0:u.body:i==null?void 0:i.body})]})]})},Ks=t.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Js=t.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),Xs=({instantView:s,...n})=>e.jsxs(Ks,{children:[e.jsx(le,{instantView:s,...n}),(s==null?void 0:s.webLink)&&e.jsxs(Js,{href:s==null?void 0:s.webLink.url,target:"_blank",children:[s==null?void 0:s.webLink.label,e.jsx(t.c1,{name:"icon-external-link"})]})]}),et=t.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),st=t.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),tt=t.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),nt=({created:s,...n})=>{const a=m.useMemo(()=>{if(s){const o=new Date(s);if(Y(o))return{date:H(o),time:W(o)}}return null},[s]);return e.jsxs(et,{children:[a&&e.jsxs(st,{children:[a.date," · ",a.time]}),n.title&&e.jsx(tt,{children:n.title}),e.jsx(y.j,{...n})]})},at=t.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),it=({openedQuestion:s})=>{var n,a;return((n=s==null?void 0:s.attributes)==null?void 0:n.attributes.case)==="insight"?e.jsx(Xs,{created:s.attributes.created,...s.attributes.attributes.value}):((a=s==null?void 0:s.attributes)==null?void 0:a.attributes.case)==="tweet"?e.jsx(nt,{created:s.attributes.created,...s.attributes.attributes.value}):null},ot=({extendedQuestion:s,vote:n,close:a})=>{const{loading:o,data:i}=s;return i?e.jsx(Bs,{vote:n,close:a,openedQuestion:i,isLoading:!!o}):null},rt=({gamification:s})=>{var n;const a=k.useStore(s.openedQuestion.$store),o=k.useStore(s.openedQuestion.$extendedStore);if(!a)return null;const i=a.type;return e.jsxs(at,{children:[e.jsx(ne,{close:s.closeQuestion,type:((n=a.attributes)==null?void 0:n.type)||c.QuestionType.UNSET}),i==="question"&&e.jsx(ot,{vote:s.submitAnswer,close:s.closeQuestion,extendedQuestion:o}),i!=="question"&&e.jsx(it,{openedQuestion:a}),e.jsx(Ke,{sponsorLogo:""})]})},lt=t.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),dt=t.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),ct=t.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),ut=t.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var U=(s=>(s.HOME="home",s.LEADERBOARD="leaderboard",s))(U||{});const ee=({title:s,active:n,onClick:a})=>e.jsx(ct,{onClick:a,"data-selected":n,children:e.jsx(ut,{children:s})}),pt=({activePage:s="home",toggleActivePage:n})=>e.jsx(lt,{children:e.jsxs(dt,{"data-position":s==="home"?"left":"right",children:[e.jsx(ee,{title:"Home",active:s==="home",onClick:()=>n("home")}),e.jsx(ee,{title:"Friends",active:s==="leaderboard",onClick:()=>n("leaderboard")})]})}),mt=t.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),ht=t.styled_default("img")({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!1}),ft=t.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),xt=t.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),It=t.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),yt=()=>t.c1,vt=t.styled_default(yt())({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),jt="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M10.4615%2012.6875C9.44231%2012.6875%208.61538%2013.4665%208.61538%2014.4266C8.61538%2015.3868%209.44231%2016.1658%2010.4615%2016.1658C11.4808%2016.1658%2012.3077%2015.3868%2012.3077%2014.4266C12.3077%2013.4665%2011.4808%2012.6875%2010.4615%2012.6875ZM10.4615%2016.1658C9.10817%2016.1658%208%2017.2097%208%2018.4846V19.7527C8%2019.7527%208.61538%2020.2237%2010.4615%2020.2237C12.3077%2020.2237%2012.9231%2019.7527%2012.9231%2019.7527V18.4846C12.9231%2017.2097%2011.8149%2016.1658%2010.4615%2016.1658ZM21.5385%2012.6875C20.5192%2012.6875%2019.6923%2013.4665%2019.6923%2014.4266C19.6923%2015.3868%2020.5192%2016.1658%2021.5385%2016.1658C22.5577%2016.1658%2023.3846%2015.3868%2023.3846%2014.4266C23.3846%2013.4665%2022.5577%2012.6875%2021.5385%2012.6875ZM21.5385%2016.1658C20.1851%2016.1658%2019.0769%2017.2097%2019.0769%2018.4846V19.7527C19.0769%2019.7527%2019.6923%2020.2237%2021.5385%2020.2237C23.3846%2020.2237%2024%2019.7527%2024%2019.7527V18.4846C24%2017.2097%2022.8918%2016.1658%2021.5385%2016.1658ZM16%2015.0063C14.9808%2015.0063%2014.1538%2015.7853%2014.1538%2016.7455C14.1538%2017.7056%2014.9808%2018.4846%2016%2018.4846C17.0192%2018.4846%2017.8462%2017.7056%2017.8462%2016.7455C17.8462%2015.7853%2017.0192%2015.0063%2016%2015.0063ZM16%2018.4846C14.6466%2018.4846%2013.5385%2019.5285%2013.5385%2020.8034V22.0715C13.5385%2022.0715%2014.1538%2022.5425%2016%2022.5425C17.8462%2022.5425%2018.4615%2022.0715%2018.4615%2022.0715V20.8034C18.4615%2019.5285%2017.3534%2018.4846%2016%2018.4846Z'%20fill='%23107D57'/%3e%3cpath%20opacity='0.5'%20d='M13.3908%209C12.3103%209%2011.4336%209.82584%2011.4336%2010.8437C11.4336%2011.8616%2012.3103%2012.6875%2013.3908%2012.6875C14.4713%2012.6875%2015.348%2011.8616%2015.348%2010.8437C15.348%209.82584%2014.4713%209%2013.3908%209ZM13.3908%2012.6875C13.1946%2012.6875%2012.9958%2012.6827%2012.7996%2012.7451C13.192%2013.2372%2013.3908%2013.8542%2013.3908%2014.5312C13.3908%2014.7761%2013.3296%2015.0161%2013.3296%2015.261C13.8521%2014.524%2014.6956%2014.0391%2015.6742%2013.9166C15.218%2013.1796%2014.3694%2012.6875%2013.3908%2012.6875ZM18.61%209C17.5295%209%2016.6528%209.82584%2016.6528%2010.8437C16.6528%2011.8616%2017.5295%2012.6875%2018.61%2012.6875C19.6905%2012.6875%2020.5672%2011.8616%2020.5672%2010.8437C20.5672%209.82584%2019.6905%209%2018.61%209ZM18.61%2012.6875C17.6314%2012.6875%2016.7828%2013.1796%2016.3266%2013.9166C17.3052%2014.0391%2018.1487%2014.524%2018.6712%2015.261C18.6712%2015.0161%2018.61%2014.7761%2018.61%2014.5312C18.61%2013.8542%2018.8088%2013.2372%2019.2012%2012.7451C19.005%2012.6827%2018.8062%2012.6875%2018.61%2012.6875Z'%20fill='%23107D57'/%3e%3c/svg%3e",Ct=({title:s,description:n,onClick:a,className:o})=>e.jsxs(mt,{onClick:a,className:o,children:[e.jsx(ht,{alt:"friends-icon",src:jt}),e.jsxs(ft,{children:[e.jsx(xt,{children:s}),e.jsx(It,{children:n})]}),e.jsx(vt,{name:"icon-copy"})]});function At(s){var n=s.lastRenderedStartIndex,a=s.lastRenderedStopIndex,o=s.startIndex,i=s.stopIndex;return!(o>a||i<n)}function gt(s){for(var n=s.isItemLoaded,a=s.itemCount,o=s.minimumBatchSize,i=s.startIndex,u=s.stopIndex,r=[],l=null,d=null,p=i;p<=u;p++){var f=n(p);f?d!==null&&(r.push(l,d),l=d=null):(d=p,l===null&&(l=p))}if(d!==null){for(var I=Math.min(Math.max(d,l+o-1),a-1),h=d+1;h<=I&&!n(h);h++)d=h;r.push(l,d)}if(r.length)for(;r[1]-r[0]+1<o&&r[0]>0;){var v=r[0]-1;if(!n(v))r[0]=v;else break}return r}var _t=function(s,n){if(!(s instanceof n))throw new TypeError("Cannot call a class as a function")},$t=function(){function s(n,a){for(var o=0;o<a.length;o++){var i=a[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}return function(n,a,o){return a&&s(n.prototype,a),o&&s(n,o),n}}(),bt=function(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);s.prototype=Object.create(n&&n.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(s,n):s.__proto__=n)},se=function(s,n){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n&&(typeof n=="object"||typeof n=="function")?n:s};(function(s){bt(n,s);function n(){var a,o,i,u;_t(this,n);for(var r=arguments.length,l=Array(r),d=0;d<r;d++)l[d]=arguments[d];return u=(o=(i=se(this,(a=n.__proto__||Object.getPrototypeOf(n)).call.apply(a,[this].concat(l))),i),i._lastRenderedStartIndex=-1,i._lastRenderedStopIndex=-1,i._memoizedUnloadedRanges=[],i._onItemsRendered=function(p){var f=p.visibleStartIndex,I=p.visibleStopIndex;i._lastRenderedStartIndex=f,i._lastRenderedStopIndex=I,i._ensureRowsLoaded(f,I)},i._setRef=function(p){i._listRef=p},o),se(i,u)}return $t(n,[{key:"resetloadMoreItemsCache",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],o&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var o=this.props.children;return o({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(o,i){var u=this.props,r=u.isItemLoaded,l=u.itemCount,d=u.minimumBatchSize,p=d===void 0?10:d,f=u.threshold,I=f===void 0?15:f,h=gt({isItemLoaded:r,itemCount:l,minimumBatchSize:p,startIndex:Math.max(0,o-I),stopIndex:Math.min(l-1,i+I)});(this._memoizedUnloadedRanges.length!==h.length||this._memoizedUnloadedRanges.some(function(v,T){return h[T]!==v}))&&(this._memoizedUnloadedRanges=h,this._loadUnloadedRanges(h))}},{key:"_loadUnloadedRanges",value:function(o){for(var i=this,u=this.props.loadMoreItems||this.props.loadMoreRows,r=function(p){var f=o[p],I=o[p+1],h=u(f,I);h!=null&&h.then(function(){if(At({lastRenderedStartIndex:i._lastRenderedStartIndex,lastRenderedStopIndex:i._lastRenderedStopIndex,startIndex:f,stopIndex:I})){if(i._listRef==null)return;typeof i._listRef.resetAfterIndex=="function"?i._listRef.resetAfterIndex(f,!0):(typeof i._listRef._getItemStyleCache=="function"&&i._listRef._getItemStyleCache(-1),i._listRef.forceUpdate())}})},l=0;l<o.length;l+=2)r(l)}}]),n})(m.PureComponent);const Tt=t.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),St=t.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Rt=t.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),wt=t.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),kt=t.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),qt=t.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Qt=t.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Et=()=>t.c1,Nt=t.styled_default(Et())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Lt=({rank:s,avatar:n,name:a,points:o,isCurrentUser:i,openItemDetail:u,style:r})=>e.jsxs(Tt,{onClick:u,style:r,children:[e.jsx(St,{children:s||0}),e.jsxs(kt,{children:[n?e.jsx(Rt,{alt:"leaderboard-item-avatar",src:n}):e.jsx(wt,{children:ae(a||"")}),e.jsxs(qt,{children:[e.jsx(Qt,{children:a||""}),i&&e.jsx(Nt,{name:"icon-star"})]})]}),e.jsx("div",{children:ie(o)})]}),Dt=t.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),Pt=({items:s,currentUserId:n,openItemDetail:a,fetchMore:o,scrollNode:i,hasMore:u})=>e.jsx(fe,{loadMore:o,initialLoad:!1,hasMore:u,useWindow:!1,getScrollParent:()=>i.current,children:e.jsx(Dt,{children:s.map(r=>e.jsx(Lt,{...r,openItemDetail:()=>a(r.userId),isCurrentUser:!!n&&n===r.userId},r.userId))})}),Ot=({appNode:s,deepLink:n})=>e.jsx(y.E,{appNode:s,inviteLink:n,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s More Fun With Friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."}),Mt=t.styled_default("div")({name:"InviteLinkContainer",class:"i1chxfpe",propsAsIs:!1}),Vt=({gamification:s,scrollNode:n,scrollStore:a,appNode:o})=>{const{data:i,hasMore:u}=k.useStore(s.leaderboardList.$store),{data:r}=k.useStore(s.deepLink.$store),[l,d]=y.Kk(o);return i!=null&&i.length?e.jsxs(e.Fragment,{children:[e.jsx(Pt,{items:i,scrollNode:n,scrollStore:a,fetchMore:s.leaderboardList.fetchMore,hasMore:u,openItemDetail:s.openUser,currentUserId:s.currentUserId.get()}),r&&e.jsx(Mt,{children:e.jsx(Ct,{onClick:()=>l(r),title:"Invite Friends",description:"Challenge them now!"})}),d]}):e.jsx(Ot,{appNode:o,deepLink:r})},Ut=t.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Ft=t.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Bt=t.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),zt=t.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Ht=()=>t.c1,V=t.styled_default(Ht())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Wt=()=>t.c1,Yt=t.styled_default(Wt())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),Zt=t.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),Gt=t.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),Kt=t.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),Jt={[c.PickHistoryStatus.LOST]:e.jsx(V,{name:"incorrectVoted"}),[c.PickHistoryStatus.WON]:e.jsx(V,{name:"icon-check"}),[c.PickHistoryStatus.UNSET]:e.jsx(V,{name:"icon-arrow"}),[c.PickHistoryStatus.DNP]:e.jsx(V,{name:"icon-arrow"})},Xt=({questionId:s,questionType:n,questionStatus:a,subject:o,openForVoting:i,openQuestion:u,status:r})=>{const l=y.o[n],d=Jt[r];return l?e.jsxs(Ut,{onClick:()=>u==null?void 0:u(s),children:[e.jsxs(Gt,{children:[e.jsxs(Ft,{children:[e.jsx(Yt,{"data-type-trivia":n===c.QuestionType.TRIVIA,"data-type-poll":n===c.QuestionType.POLL,name:l.iconName}),e.jsxs(Zt,{children:[l.label,n===c.QuestionType.TRIVIA&&a===c.QuestionStatus.RESOLVED&&" • Expired"]})]}),e.jsx(Bt,{children:o||""})]}),e.jsx(zt,{children:i?e.jsx(Kt,{children:"Play"}):d})]}):null},en=t.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),sn=t.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),tn=({openInsight:s,questionId:n,...a})=>e.jsxs(en,{children:[e.jsx(le,{questionId:n,...a,isPickHistory:!0}),s&&e.jsx(sn,{onClick:()=>s(n),children:"View Insight"})]}),nn=t.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),an=()=>y.c$1,on=t.styled_default(an())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),rn=t.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),ln=t.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),dn=({openTweet:s,created:n,...a})=>{const o=m.useMemo(()=>{if(n){const i=new Date(n);if(Y(i))return{date:H(i),time:W(i)}}return null},[n]);return e.jsxs(nn,{children:[o&&e.jsxs(rn,{children:[o.date," · ",o.time]}),a.title&&e.jsx(ln,{children:a.title}),e.jsx(y.j,{...a}),s&&e.jsx(on,{onClick:()=>s(a.tweetId),children:"View Insight"})]})},cn=t.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),un=({questions:s,openQuestion:n})=>e.jsx(cn,{children:s==null?void 0:s.map(a=>{var o,i,u;if(a.type==="question"&&((o=a.attributes)==null?void 0:o.attributes.case)==="question"){const r=a.attributes.attributes.value;return e.jsx(Xt,{openQuestion:n,...r},r.questionId)}if(a.type==="insight"&&((i=a.attributes)==null?void 0:i.attributes.case)==="insight"){const r=a.attributes.attributes.value,l=a.attributes.created;return e.jsx(tn,{openInsight:n,...r,created:l},r.questionId)}if(a.type==="tweet"&&((u=a.attributes)==null?void 0:u.attributes.case)==="tweet"){const r=a.attributes.attributes.value,l=a.attributes.id,d=a.attributes.created;return e.jsx(dn,{openTweet:n,...r,tweetId:l,created:d},l)}return null})}),pn=({store:s,openQuestion:n})=>{const a=k.useStore(s);return a!=null&&a.data?e.jsx(un,{openQuestion:n,questions:a.data}):e.jsx("div",{children:"wait questions..."})},mn=({userSummary:s})=>{var n;const[a,o]=m.useState(void 0);return m.useEffect(()=>{const i=s.subscribe(u=>{u!=null&&u.data&&o(u.data)});return()=>{i()}},[s]),a!=null&&a.summary?e.jsx(oe,{...a.summary,successRate:(n=a.percentage)==null?void 0:n.correct}):e.jsx("div",{children:"wait user..."})},hn=({gamification:s,className:n,scrollStore:a,scrollNode:o,appNode:i})=>{const[u,r]=m.useState(!1),[l,d]=m.useState(U.HOME),[,p]=m.useTransition(),f=h=>{p(()=>d(h))},I=h=>{p(()=>r(h))};return m.useEffect(()=>a.listen(h=>{if(h.scrollPosition===0){I(!1),a.setKey("tabsShown",!1);return}I(h.scrollDirection==="forward"),a.setKey("tabsShown",h.scrollDirection!=="forward")}),[a]),e.jsxs(y.p,{className:n,children:[e.jsx(y.C,{style:{top:u?"-60px":"0px"},children:e.jsx(pt,{activePage:l,toggleActivePage:f})}),l===U.HOME&&e.jsxs(e.Fragment,{children:[e.jsx(y.n,{style:{paddingTop:"8px"},children:e.jsx(mn,{userSummary:s.userSummary})}),e.jsx(y.a,{style:{flex:1},children:e.jsx(pn,{openQuestion:s.openQuestion,store:s.feedList.getStore()})})]}),l===U.LEADERBOARD&&e.jsx(y.l,{children:e.jsx(Vt,{appNode:i,scrollStore:a,scrollNode:o,gamification:s})})]})},fn=()=>y.l$1,te=t.styled_default(fn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),xn=t.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),In=({correct:s,incorrect:n})=>{const a=s+n;return a===0?0:Math.round(s/a*100)},yn=({gamification:s,scrollStore:n,className:a,appNode:o,scrollNode:i})=>{const u=k.useStore(s.openedQuestion.$store),r=k.useStore(s.openedUser);return e.jsxs(e.Fragment,{children:[u&&o.current&&y.Yk.createPortal(e.jsx(te,{className:a,children:e.jsx(rt,{gamification:s})}),o.current),r&&o.current&&y.Yk.createPortal(e.jsx(te,{className:a,children:e.jsxs(xn,{children:[e.jsx(ne,{label:"Friend's Rank",close:s.closeUser}),e.jsx(y.n,{children:e.jsx(oe,{...r,successRate:In(r)})})]})}),o.current),e.jsx(hn,{appNode:o,scrollStore:n,scrollNode:i,className:a,gamification:s})]})};exports.default=yn;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("./index2.js");const e=require("./masters2.js");require("react");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");require("@streamlayer/sdk-web-types");require("@nanostores/react");require("@streamlayer/sdk-web-interfaces");require("./index4.js");require("@streamlayer/sdk-web-notifications");require("lodash.throttle");exports.MastersStreamLayerProvider=e.MastersStreamLayerProvider;exports.MastersStreamLayerSDKReact=e.MastersStreamLayerSDKReact;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("./index2.js");const e=require("./masters2.js");require("react");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");require("@streamlayer/sdk-web-types");require("@nanostores/react");require("@streamlayer/sdk-web-interfaces");require("./useSdkFeature.js");require("@streamlayer/sdk-web-notifications");require("lodash.throttle");exports.MastersStreamLayerProvider=e.MastersStreamLayerProvider;exports.MastersStreamLayerSDKReact=e.MastersStreamLayerSDKReact;