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