@streamlayer/react 0.37.1 → 0.39.0

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