@streamlayer/react 0.29.11 → 0.30.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 -0
- package/lib/{app-c9828ece.cjs → app-36051bbe.cjs} +1 -1
- package/lib/{app-e4b43a5c.js → app-c53bb384.js} +5 -5
- package/lib/cjs/auth.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/dist/cjs/masters.js +1 -1
- package/lib/dist/es/masters.js +1 -1
- package/lib/dist/index-bcabe854.js +1464 -0
- package/lib/dist/index-f504e8d3.cjs +1 -0
- package/lib/dist/index.d.ts +1 -0
- package/lib/dist/masters-3c9c6ffe.js +26765 -0
- package/lib/dist/masters-fe5f1486.cjs +297 -0
- package/lib/dist/style.css +1 -196
- package/lib/es/auth.js +2 -2
- package/lib/es/index.js +2 -2
- package/lib/es/masters.js +5 -4
- package/lib/es/points.js +40 -40
- package/lib/index-15f61ac8.js +151 -0
- package/lib/index-565f26fb.cjs +1 -0
- package/lib/{index-0d23b24e.js → index-89366251.js} +5 -5
- package/lib/index-af5c5738.cjs +1 -0
- package/lib/{index-89c19a6e.cjs → index-dd93a61a.cjs} +2 -2
- package/lib/index-e26b3493.js +1410 -0
- package/lib/masters-bf25c11c.js +2415 -0
- package/lib/masters-f135002d.cjs +6 -0
- package/lib/style.css +1 -1
- package/package.json +3 -3
- package/lib/dist/index-56687fbe.cjs +0 -1
- package/lib/dist/index-b7b397b9.js +0 -1740
- package/lib/dist/masters-791400ce.js +0 -20468
- package/lib/dist/masters-8c3bc143.cjs +0 -29
- package/lib/index-60fabb42.cjs +0 -6
- package/lib/index-81810ce0.js +0 -950
- package/lib/index-9a1075fa.cjs +0 -1
- package/lib/index-d3a5d095.js +0 -2851
- package/lib/masters-a0c5967c.js +0 -693
- package/lib/masters-b0b09591.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters-fe5f1486.cjs"),T=require("react"),Ne=n.styled_default("div")({name:"Container",class:"Container_c1vwopgc",propsAsIs:!1}),Ae=n.styled_default("div")({name:"QuestionTypeWrap",class:"QuestionTypeWrap_qyktpt0",propsAsIs:!1}),_e=()=>n.i1,Se=n.styled_default(_e())({name:"QuestionTypeIcon",class:"QuestionTypeIcon_q951jdx",propsAsIs:!0}),De=n.styled_default("span")({name:"QuestionTypeTitle",class:"QuestionTypeTitle_qss5f0e",propsAsIs:!1}),ze=n.styled_default("button")({name:"CloseButton",class:"CloseButton_c1ao1jtv",propsAsIs:!1}),Ce=()=>n.i1,ke=n.styled_default(Ce())({name:"CloseIcon",class:"CloseIcon_cvsl7l3",propsAsIs:!0}),ce=({type:e,close:t,label:i})=>{const r=e?n.o[e]:{label:i,iconName:void 0};return s.jsxs(Ne,{children:[s.jsxs(Ae,{children:[(r==null?void 0:r.iconName)&&s.jsx(Se,{name:r.iconName}),(r==null?void 0:r.label)&&s.jsx(De,{children:r.label})]}),s.jsx(ze,{onClick:t,children:s.jsx(ke,{name:"icon-cross"})})]})},Oe=n.styled_default("div")({name:"Container",class:"Container_c1zy8a",propsAsIs:!1}),we=n.styled_default("div")({name:"Title",class:"Title_t1vih9p5",propsAsIs:!1}),be=n.styled_default("div")({name:"Indicator",class:"Indicator_i1fbnvpb",propsAsIs:!1}),B=({indicator:e,title:t})=>s.jsxs(Oe,{children:[s.jsx(we,{children:t}),s.jsx(be,{children:e})]}),Ee=n.styled_default("div")({name:"Container",class:"Container_ctmhwyc",propsAsIs:!1}),$e=n.styled_default("div")({name:"Indicator",class:"Indicator_i1jri200",propsAsIs:!1}),Le=n.styled_default("div")({name:"Title",class:"Title_t8s05oq",propsAsIs:!1}),b=({indicator:e,title:t})=>s.jsxs(Ee,{children:[s.jsx($e,{children:e}),s.jsx(Le,{children:t})]}),Re=n.styled_default("div")({name:"Container",class:"Container_c1yrpn9o",propsAsIs:!1}),Qe=n.styled_default("div")({name:"TopInfo",class:"TopInfo_t17fwahh",propsAsIs:!1}),Ue=n.styled_default("div")({name:"BottomInfo",class:"BottomInfo_by6w7e9",propsAsIs:!1}),Pe=n.styled_default("div")({name:"User",class:"User_u1g7arbm",propsAsIs:!1}),qe=n.styled_default("img")({name:"Avatar",class:"Avatar_a1ldeata",propsAsIs:!1}),Ye=n.styled_default("div")({name:"UserInfo",class:"UserInfo_u10d4koz",propsAsIs:!1}),We=n.styled_default("div")({name:"UserName",class:"UserName_u1q6roj0",propsAsIs:!1}),Fe=n.styled_default("div")({name:"UserRating",class:"UserRating_ui0m425",propsAsIs:!1}),Be=n.styled_default("img")({name:"TrophyIcon",class:"TrophyIcon_t1el3mrn",propsAsIs:!1}),Ve=n.styled_default("div")({name:"Rts",class:"Rts_r2vgnxv",propsAsIs:!1}),He=n.styled_default("div")({name:"RtsIndicator",class:"RtsIndicator_roqn06j",propsAsIs:!1}),Ge=n.styled_default("div")({name:"RtsLabel",class:"RtsLabel_r15adx7c",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Divider",class:"Divider_dv59lta",propsAsIs:!1}),Je=n.styled_default("div")({name:"Ranks",class:"Ranks_r55lotb",propsAsIs:!1}),Ke=n.styled_default("div")({name:"Statistics",class:"Statistics_s1knfgqt",propsAsIs:!1}),Xe=n.styled_default("div")({name:"AvatarPlaceholder",class:"AvatarPlaceholder_a1mqo824",propsAsIs:!1}),et=n.styled_default("button")({name:"UserAccountBtn",class:"UserAccountBtn_uxareh6",propsAsIs:!1}),tt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZ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x(Qe,{children:s.jsxs(Pe,{children:[s.jsxs(et,{children:[e&&s.jsx(qe,{alt:"avatar",src:e}),!e&&s.jsx(Xe,{children:n.o$1(t||"")})]}),s.jsxs(Ye,{children:[s.jsx(We,{children:t}),s.jsxs(Fe,{children:[s.jsxs(Ve,{children:[s.jsx(Be,{alt:"rank-icon",src:tt}),s.jsxs(He,{children:[n.i(i),s.jsx(Ge,{children:"PTS"})]})]}),s.jsx(Ze,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(Ue,{children:[s.jsxs(Je,{children:[s.jsx(B,{indicator:r||0,title:"Friends rank"}),s.jsx(B,{indicator:o||0,title:"Global rank"})]}),s.jsxs(Ke,{children:[s.jsx(b,{indicator:c||0,title:"Win streak"}),s.jsx(b,{indicator:l||0,title:"Correct"}),s.jsx(b,{indicator:m||0,title:"Incorrect"}),s.jsx(b,{indicator:`${h||0}%`,title:"Succ. rate"})]})]})]}),st=n.styled_default("div")({name:"Container",class:"Container_c38csyt",propsAsIs:!1}),nt=n.styled_default("div")({name:"Title",class:"Title_ty221rx",propsAsIs:!1}),it=n.styled_default("div")({name:"Description",class:"Description_dlaj9xp",propsAsIs:!1}),rt=({title:e,description:t})=>s.jsxs(st,{children:[s.jsx(n.i1,{name:"icon-check-circle"}),s.jsx(nt,{children:e}),s.jsx(it,{children:t})]}),ot=n.styled_default("div")({name:"Container",class:"Container_c16sbdnm",propsAsIs:!1}),at=()=>n.i1,lt=n.styled_default(at())({name:"IconPrediction",class:"IconPrediction_ibhorgl",propsAsIs:!0}),V=n.styled_default("div")({name:"FeedbackIconWrap",class:"FeedbackIconWrap_f1g20ja7",propsAsIs:!1}),H=n.styled_default("div")({name:"FeedbackHeader",class:"FeedbackHeader_f455ozj",propsAsIs:!1}),ct=n.styled_default("span")({name:"FeedbackTitle",class:"FeedbackTitle_f1913njx",propsAsIs:!1}),$=n.styled_default("span")({name:"FeedbackDescription",class:"FeedbackDescription_fzfk69z",propsAsIs:!1}),dt=n.styled_default("div")({name:"FeedbackText",class:"FeedbackText_fx87qaj",propsAsIs:!1}),ut=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:i,questionType:r,hasCorrectAnswer:o,questionStatus:c})=>{const l=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION);if(!l&&c!==n.QuestionStatus.RESOLVED)return null;const m=r===n.QuestionType.PREDICTION&&!o,d=t?"correct":"incorrect",h=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ot,{"data-isPrediction":m,children:[c===n.QuestionStatus.RESOLVED&&r===n.QuestionType.TRIVIA&&!i&&s.jsxs(s.Fragment,{children:[s.jsx(V,{children:s.jsx(n.i1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(H,{children:s.jsx($,{children:"Question Expired"})}),s.jsx(dt,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),l&&m&&s.jsxs(s.Fragment,{children:[s.jsx(lt,{name:"icon-prediction"}),s.jsx($,{children:"Stay tuned to see if your prediction was correct."})]}),l&&o&&s.jsxs(s.Fragment,{children:[s.jsx(V,{"data-feedbackType":d,children:s.jsx(n.i1,{name:d})}),s.jsx("div",{children:s.jsxs(H,{children:[s.jsx(ct,{"data-feedbackType":d,children:h==null?void 0:h.title}),s.jsx($,{children:h==null?void 0:h.description})]})})]})]})},pt=n.styled_default("div")({name:"Container",class:"Container_c14ielyq",propsAsIs:!1}),mt=n.styled_default("div")({name:"Content",class:"Content_c1tlqx57",propsAsIs:!1}),ft=n.styled_default("div")({name:"Title",class:"Title_t1hq58md",propsAsIs:!1}),ht=n.styled_default("div")({name:"Options",class:"Options_o1c8nxcx",propsAsIs:!1}),It=n.styled_default("button")({name:"ButtonContainer",class:"ButtonContainer_b1b6dl8t",propsAsIs:!1}),yt=n.styled_default("div")({name:"ButtonPct",class:"ButtonPct_b4iik8i",propsAsIs:!1}),gt=n.styled_default("span")({name:"ButtonBody",class:"ButtonBody_b1gq1lnf",propsAsIs:!1}),xt=n.styled_default("div")({name:"IconContainer",class:"IconContainer_i1j65z51",propsAsIs:!1}),Mt=n.styled_default("div")({name:"IconWrap",class:"IconWrap_i19tpfua",propsAsIs:!1}),ue=n.styled_default("img")({name:"Icon",class:"Icon_i1tubmma",propsAsIs:!1}),jt=()=>ue,vt=n.styled_default(jt())({name:"IconDefault",class:"IconDefault_i1grrgwj",propsAsIs:!0}),Tt=()=>ue,Nt=n.styled_default(Tt())({name:"IconCircle",class:"IconCircle_ibemyq8",propsAsIs:!0}),At=n.styled_default("span")({name:"Title",class:"Title_t1dceht",propsAsIs:!1}),_t=n.styled_default("span")({name:"Indicators",class:"Indicators_i116q4vq",propsAsIs:!1}),St=n.styled_default("span")({name:"Percentage",class:"Percentage_p17ajcu2",propsAsIs:!1}),Dt=()=>n.i1,zt=n.styled_default(Dt())({name:"CheckIcon",class:"CheckIcon_cu9kmlb",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(vt,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(xt,{children:s.jsx(Mt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(Nt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Ct=({questionType:e,hasCorrectAnswer:t,correct:i,youVoted:r,questionVoted:o})=>{if(e===n.QuestionType.POLL&&r)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&o)return r?i?"correct":"incorrect":i?"correct":"unset";if(r)return"correct"}return e===n.QuestionType.TRIVIA&&o?r?i?"correct":"incorrect":i?"correct":"unset":"unset"},kt=({questionType:e,questionVoted:t,correct:i,hasCorrectAnswer:r,questionStatus:o})=>e===n.QuestionType.TRIVIA?t&&i:e===n.QuestionType.PREDICTION?t&&i&&r||o===n.QuestionStatus.RESOLVED&&i:!1,Ot=e=>{var t;const{id:i,icon:r,text:o,percentageDecimal:c,onVote:l,youSelected:m,questionVoted:d,imageMode:h=n.QuestionImages.ROUNDED,answerTimeExpired:j,questionStatus:g,isLoading:I,questionType:v,correct:N,hasCorrectAnswer:a}=e,u=Ct(e),p=kt({questionType:v,questionVoted:d,correct:N,hasCorrectAnswer:a,questionStatus:g}),f=d||g===n.QuestionStatus.RESOLVED&&v===n.QuestionType.PREDICTION;return s.jsxs(It,{value:i,"data-selected":m,"data-answerState":u,disabled:d||I||j,onClick:l,children:[f&&s.jsx(yt,{"data-answerState":u,style:{width:`${c}%`}}),s.jsxs(gt,{children:[r&&((t=G[h])==null?void 0:t.call(G,r)),s.jsx(At,{children:o}),f&&s.jsxs(_t,{children:[p&&s.jsx(zt,{name:"selected"}),s.jsxs(St,{children:[c,"%"]})]})]})]})};var Z=typeof window>"u"?T.useEffect:T.useLayoutEffect,wt=({isPlaying:e,duration:t,startAt:i=0,updateInterval:r=0,onComplete:o,onUpdate:c})=>{let[l,m]=T.useState(i),d=T.useRef(0),h=T.useRef(i),j=T.useRef(i*-1e3),g=T.useRef(null),I=T.useRef(null),v=T.useRef(null),N=p=>{let f=p/1e3;if(I.current===null){I.current=f,g.current=requestAnimationFrame(N);return}let y=f-I.current,x=d.current+y;I.current=f,d.current=x;let M=h.current+(r===0?x:(x/r|0)*r),A=h.current+x,_=typeof t=="number"&&A>=t;m(_?t:M),_||(g.current=requestAnimationFrame(N))},a=()=>{g.current&&cancelAnimationFrame(g.current),v.current&&clearTimeout(v.current),I.current=null},u=T.useCallback(p=>{a(),d.current=0;let f=typeof p=="number"?p:i;h.current=f,m(f),e&&(g.current=requestAnimationFrame(N))},[e,i]);return Z(()=>{if(c==null||c(l),t&&l>=t){j.current+=t*1e3;let{shouldRepeat:p=!1,delay:f=0,newStartAt:y}=(o==null?void 0:o(j.current/1e3))||{};p&&(v.current=setTimeout(()=>u(y),f*1e3))}},[l,t]),Z(()=>(e&&(g.current=requestAnimationFrame(N)),a),[e,t,r]),{elapsedTime:l,reset:u}},bt=(e,t,i)=>{let r=e/2,o=t/2,c=r-o,l=2*c,m=i==="clockwise"?"1,0":"0,1",d=2*Math.PI*c;return{path:`m ${r},${o} a ${c},${c} 0 ${m} 0,${l} a ${c},${c} 0 ${m} 0,-${l}`,pathLength:d}},J=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Et=e=>({position:"relative",width:e,height:e}),$t={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},pe=(e,t,i,r,o)=>{if(r===0)return t;let c=(o?r-e:e)/r;return t+i*c},K=e=>{var t,i;return(i=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,o,c,l)=>`#${o}${o}${c}${c}${l}${l}`).substring(1).match(/.{2}/g))==null?void 0:t.map(r=>parseInt(r,16)))!=null?i:[]},Lt=(e,t)=>{var i;let{colors:r,colorsTime:o,isSmoothColorTransition:c=!0}=e;if(typeof r=="string")return r;let l=(i=o==null?void 0:o.findIndex((I,v)=>I>=t&&t>=o[v+1]))!=null?i:-1;if(!o||l===-1)return r[0];if(!c)return r[l];let m=o[l]-t,d=o[l]-o[l+1],h=K(r[l]),j=K(r[l+1]),g=!!e.isGrowing;return`rgb(${h.map((I,v)=>pe(m,I,j[v]-I,d,g)|0).join(",")})`},Rt=e=>{let{duration:t,initialRemainingTime:i,updateInterval:r,size:o=180,strokeWidth:c=12,trailStrokeWidth:l,isPlaying:m=!1,isGrowing:d=!1,rotation:h="clockwise",onComplete:j,onUpdate:g}=e,I=T.useRef(),v=Math.max(c,l??0),{path:N,pathLength:a}=bt(o,v,h),{elapsedTime:u}=wt({isPlaying:m,duration:t,startAt:J(t,i),updateInterval:r,onUpdate:typeof g=="function"?f=>{let y=Math.ceil(t-f);y!==I.current&&(I.current=y,g(y))}:void 0,onComplete:typeof j=="function"?f=>{var y;let{shouldRepeat:x,delay:M,newInitialRemainingTime:A}=(y=j(f))!=null?y:{};if(x)return{shouldRepeat:x,delay:M,newStartAt:J(t,A)}}:void 0}),p=t-u;return{elapsedTime:u,path:N,pathLength:a,remainingTime:Math.ceil(p),rotation:h,size:o,stroke:Lt(e,p),strokeDashoffset:pe(u,0,a,t,d),strokeWidth:c}},me=e=>{let{children:t,strokeLinecap:i,trailColor:r,trailStrokeWidth:o}=e,{path:c,pathLength:l,stroke:m,strokeDashoffset:d,remainingTime:h,elapsedTime:j,size:g,strokeWidth:I}=Rt(e);return T.createElement("div",{style:Et(g)},T.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},T.createElement("path",{d:c,fill:"none",stroke:r??"#d9d9d9",strokeWidth:o??I}),T.createElement("path",{d:c,fill:"none",stroke:m,strokeLinecap:i??"round",strokeWidth:I,strokeDasharray:l,strokeDashoffset:d})),typeof t=="function"&&T.createElement("div",{style:$t},t({remainingTime:h,elapsedTime:j,color:m})))};me.displayName="CountdownCircleTimer";const Qt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1],Ut=[10,10,0],Pt=n.styled_default("div")({name:"RemainingTime",class:"RemainingTime_r165427",propsAsIs:!1}),qt=n.E.SECONDARY_GREEN6,X=n.E.SECONDARY_RED3,Yt=n.E.NEUTRALS_GRAY3,Wt=({isPlaying:e=!0,duration:t=30,onTimerExpired:i})=>{const[r,o]=T.useState(t>10?qt:X),c=({remainingTime:d})=>s.jsx(Pt,{children:d}),l=T.useCallback(()=>{i==null||i(),o(Yt)},[i,o]),m=T.useCallback(d=>{d===10&&o(X)},[o]);return s.jsx(me,{isPlaying:e,duration:t,colors:Qt,colorsTime:Ut,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:l,onUpdate:m,children:c})},Ft=n.styled_default("div")({name:"WinBarContainer",class:"WinBarContainer_wie6cqo",propsAsIs:!1}),Bt=n.styled_default("div")({name:"Content",class:"Content_cgizw4u",propsAsIs:!1}),Vt=n.styled_default("div")({name:"Title",class:"Title_t1l3ucjp",propsAsIs:!1}),Ht=()=>n.i1,Gt=n.styled_default(Ht())({name:"WinIcon",class:"WinIcon_wx7j799",propsAsIs:!0}),Zt=n.styled_default("div")({name:"Points",class:"Points_p4lwuj0",propsAsIs:!1}),Jt=n.styled_default("span")({name:"PointsCount",class:"PointsCount_po9i64o",propsAsIs:!1}),Kt=n.styled_default("span")({name:"PointsUnits",class:"PointsUnits_pe5g05h",propsAsIs:!1}),Xt=({title:e,points:t,isPlayingTimer:i,isTimer:r,onTimerExpired:o})=>s.jsxs(Ft,{children:[s.jsxs(Bt,{children:[e&&s.jsx(Vt,{children:e}),t!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(Gt,{name:"icon-trophy"}),s.jsxs(Zt,{children:[s.jsx(Jt,{children:t}),s.jsx(Kt,{children:"PTS"})]})]})]}),r&&s.jsx(Wt,{isPlaying:i,onTimerExpired:o})]}),es=({openedQuestion:e,vote:t,close:i})=>{var r;const o=e.subject,c=e.type,l=(r=e.options)==null?void 0:r.options,[m,d]=T.useState(!1),[h,j]=T.useState(!1),[g,I]=T.useState(""),v=e==null?void 0:e.id,N=T.useCallback(async x=>{if(v){const M=x.currentTarget.value;I(M),j(!0),await t(v,M),j(!1)}},[v,I,t]),a=T.useCallback(()=>{d(!0),setTimeout(i,3e3)},[i]),u=T.useMemo(()=>e==null?void 0:e.answers.find(x=>x.youVoted===!0),[e]),p=T.useMemo(()=>!!(e!=null&&e.answers.find(x=>x.correct===!0)),[e]),f=T.useMemo(()=>e?e.answers.map(x=>({...x,questionVoted:!!u,youSelected:g===x.id,isLoading:h,hasCorrectAnswer:p,questionType:e.type,answerTimeExpired:m,questionStatus:e.status,onVote:N})):[],[p,m,h,e,u,N,g]),y=l&&(l.case==="trivia"||l.case==="prediction")?l.value:void 0;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(pt,{children:s.jsxs(mt,{children:[y&&s.jsx(ut,{feedbackMessages:y,questionVoted:!!u,questionVotedCorrectly:u==null?void 0:u.correct,questionType:c,hasCorrectAnswer:p,questionStatus:e.status}),s.jsx(Xt,{title:m?"Time expired":"To win",points:m?void 0:100,onTimerExpired:a,isTimer:!0}),m?s.jsx(rt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(ft,{children:o}),s.jsx(ht,{children:f.map(x=>s.jsx(Ot,{...x},x.id))})]})]})})})},ts=n.styled_default("div")({name:"Container",class:"Container_cgn5uen",propsAsIs:!1}),ss=n.styled_default("div")({name:"Content",class:"Content_c1px8nt6",propsAsIs:!1}),ns=n.styled_default("h3")({name:"Title",class:"Title_t5et2jt",propsAsIs:!1}),is=n.styled_default("div")({name:"Description",class:"Description_d1i2kpk2",propsAsIs:!1}),rs=n.styled_default("div")({name:"DateWrap",class:"DateWrap_dd3lh3p",propsAsIs:!1}),fe=({created:e,title:t,instantView:i})=>{const r=T.useMemo(()=>{if(e){const o=new Date(e);if(n.r$1(o))return{date:n.a(o),time:n.n(o)}}return null},[e]);return s.jsxs(ts,{children:[r&&s.jsxs(rs,{children:[r.date," · ",r.time]}),(i==null?void 0:i.video)&&s.jsx(n.w,{source:i.video.url,poster:i.video.thumbnailUrl}),s.jsxs(ss,{children:[s.jsx(ns,{children:(i==null?void 0:i.heading)||t}),s.jsx(is,{children:i==null?void 0:i.body})]})]})},os=n.styled_default("div")({name:"Container",class:"Container_c1euiow",propsAsIs:!1}),as=n.styled_default("a")({name:"WebLinkBtn",class:"WebLinkBtn_w19zie3h",propsAsIs:!1}),ls=({instantView:e,...t})=>s.jsxs(os,{children:[s.jsx(fe,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(as,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.i1,{name:"icon-external-link"})]})]}),cs=n.styled_default("div")({name:"QuestionContainer",class:"QuestionContainer_qdri6g3",propsAsIs:!1}),ds=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ls,{created:e.attributes.created,...e.attributes.attributes.value}):null},us=({extendedQuestion:e,vote:t,close:i})=>{const{loading:r,data:o}=e;return!r&&o?s.jsx(es,{vote:t,close:i,openedQuestion:o}):null},ps=({gamification:e})=>{var t;const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const o=i.type;return s.jsxs(cs,{children:[s.jsx(ce,{close:e.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),o==="question"&&s.jsx(us,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:r}),o!=="question"&&s.jsx(ds,{openedQuestion:i})]})},ms=n.styled_default("div")({name:"Container",class:"Container_c115qtkr",propsAsIs:!1}),fs=n.styled_default("div")({name:"STabs",class:"STabs_sxnslc8",propsAsIs:!1}),hs=n.styled_default("button")({name:"Button",class:"Button_b1umzux0",propsAsIs:!1}),Is=n.styled_default("span")({name:"Title",class:"Title_tspsaas",propsAsIs:!1});var k=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(k||{});const ee=({title:e,active:t,onClick:i})=>s.jsx(hs,{onClick:i,"data-selected":t,children:s.jsx(Is,{children:e})}),ys=({activePage:e="home",toggleActivePage:t})=>s.jsx(ms,{children:s.jsxs(fs,{"data-position":e==="home"?"left":"right",children:[s.jsx(ee,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(ee,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},U.apply(this,arguments)}function te(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},P(e,t)}function gs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,P(e,t)}var se=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function xs(e,t){return!!(e===t||se(e)&&se(t))}function Ms(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!xs(e[i],t[i]))return!1;return!0}function L(e,t){t===void 0&&(t=Ms);var i,r=[],o,c=!1;function l(){for(var m=[],d=0;d<arguments.length;d++)m[d]=arguments[d];return c&&i===this&&t(m,r)||(o=e.apply(this,m),c=!0,i=this,r=m),o}return l}var js=typeof performance=="object"&&typeof performance.now=="function",ne=js?function(){return performance.now()}:function(){return Date.now()};function ie(e){cancelAnimationFrame(e.id)}function vs(e,t){var i=ne();function r(){ne()-i>=t?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var R=-1;function re(e){if(e===void 0&&(e=!1),R===-1||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",document.body.appendChild(t),R=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return R}var z=null;function oe(e){if(e===void 0&&(e=!1),z===null||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",i.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?z="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?z="negative":z="positive-ascending"),document.body.removeChild(t),z}return z}var Ts=150,Ns=function(t,i){return t};function As(e){var t,i=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,c=e.getOffsetForIndexAndAlignment,l=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,d=e.initInstanceProps,h=e.shouldResetStyleCacheOnItemSizeChange,j=e.validateProps;return t=function(g){gs(I,g);function I(N){var a;return a=g.call(this,N)||this,a._instanceProps=d(a.props,te(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:te(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=L(function(u,p,f,y){return a.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:p,visibleStartIndex:f,visibleStopIndex:y})}),a._callOnScroll=void 0,a._callOnScroll=L(function(u,p,f){return a.props.onScroll({scrollDirection:u,scrollOffset:p,scrollUpdateWasRequested:f})}),a._getItemStyle=void 0,a._getItemStyle=function(u){var p=a.props,f=p.direction,y=p.itemSize,x=p.layout,M=a._getItemStyleCache(h&&y,h&&x,h&&f),A;if(M.hasOwnProperty(u))A=M[u];else{var _=i(a.props,u,a._instanceProps),S=o(a.props,u,a._instanceProps),D=f==="horizontal"||x==="horizontal",O=f==="rtl",w=D?_:0;M[u]=A={position:"absolute",left:O?void 0:w,right:O?w:void 0,top:D?0:_,height:D?"100%":S,width:D?S:"100%"}}return A},a._getItemStyleCache=void 0,a._getItemStyleCache=L(function(u,p,f){return{}}),a._onScrollHorizontal=function(u){var p=u.currentTarget,f=p.clientWidth,y=p.scrollLeft,x=p.scrollWidth;a.setState(function(M){if(M.scrollOffset===y)return null;var A=a.props.direction,_=y;if(A==="rtl")switch(oe()){case"negative":_=-y;break;case"positive-descending":_=x-f-y;break}return _=Math.max(0,Math.min(_,x-f)),{isScrolling:!0,scrollDirection:M.scrollOffset<y?"forward":"backward",scrollOffset:_,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(u){var p=u.currentTarget,f=p.clientHeight,y=p.scrollHeight,x=p.scrollTop;a.setState(function(M){if(M.scrollOffset===x)return null;var A=Math.max(0,Math.min(x,y-f));return{isScrolling:!0,scrollDirection:M.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(u){var p=a.props.outerRef;a._outerRef=u,typeof p=="function"?p(u):p!=null&&typeof p=="object"&&p.hasOwnProperty("current")&&(p.current=u)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&ie(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=vs(a._resetIsScrolling,Ts)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}I.getDerivedStateFromProps=function(a,u){return _s(a,u),j(a),null};var v=I.prototype;return v.scrollTo=function(a){a=Math.max(0,a),this.setState(function(u){return u.scrollOffset===a?null:{scrollDirection:u.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(a,u){u===void 0&&(u="auto");var p=this.props,f=p.itemCount,y=p.layout,x=this.state.scrollOffset;a=Math.max(0,Math.min(a,f-1));var M=0;if(this._outerRef){var A=this._outerRef;y==="vertical"?M=A.scrollWidth>A.clientWidth?re():0:M=A.scrollHeight>A.clientHeight?re():0}this.scrollTo(c(this.props,a,u,x,this._instanceProps,M))},v.componentDidMount=function(){var a=this.props,u=a.direction,p=a.initialScrollOffset,f=a.layout;if(typeof p=="number"&&this._outerRef!=null){var y=this._outerRef;u==="horizontal"||f==="horizontal"?y.scrollLeft=p:y.scrollTop=p}this._callPropsCallbacks()},v.componentDidUpdate=function(){var a=this.props,u=a.direction,p=a.layout,f=this.state,y=f.scrollOffset,x=f.scrollUpdateWasRequested;if(x&&this._outerRef!=null){var M=this._outerRef;if(u==="horizontal"||p==="horizontal")if(u==="rtl")switch(oe()){case"negative":M.scrollLeft=-y;break;case"positive-ascending":M.scrollLeft=y;break;default:var A=M.clientWidth,_=M.scrollWidth;M.scrollLeft=_-A-y;break}else M.scrollLeft=y;else M.scrollTop=y}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ie(this._resetIsScrollingTimeoutId)},v.render=function(){var a=this.props,u=a.children,p=a.className,f=a.direction,y=a.height,x=a.innerRef,M=a.innerElementType,A=a.innerTagName,_=a.itemCount,S=a.itemData,D=a.itemKey,O=D===void 0?Ns:D,w=a.layout,Ie=a.outerElementType,ye=a.outerTagName,ge=a.style,xe=a.useIsScrolling,Me=a.width,q=this.state.isScrolling,E=f==="horizontal"||w==="horizontal",je=E?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),ve=Y[0],Te=Y[1],W=[];if(_>0)for(var C=ve;C<=Te;C++)W.push(T.createElement(u,{data:S,key:O(C,S),index:C,isScrolling:xe?q:void 0,style:this._getItemStyle(C)}));var F=r(this.props,this._instanceProps);return T.createElement(Ie||ye||"div",{className:p,onScroll:je,ref:this._outerRefSetter,style:U({position:"relative",height:y,width:Me,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},ge)},T.createElement(M||A||"div",{children:W,ref:x,style:{height:E?"100%":F,pointerEvents:q?"none":void 0,width:E?F:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var u=this._getRangeToRender(),p=u[0],f=u[1],y=u[2],x=u[3];this._callOnItemsRendered(p,f,y,x)}}if(typeof this.props.onScroll=="function"){var M=this.state,A=M.scrollDirection,_=M.scrollOffset,S=M.scrollUpdateWasRequested;this._callOnScroll(A,_,S)}},v._getRangeToRender=function(){var a=this.props,u=a.itemCount,p=a.overscanCount,f=this.state,y=f.isScrolling,x=f.scrollDirection,M=f.scrollOffset;if(u===0)return[0,0,0,0];var A=l(this.props,M,this._instanceProps),_=m(this.props,A,M,this._instanceProps),S=!y||x==="backward"?Math.max(1,p):1,D=!y||x==="forward"?Math.max(1,p):1;return[Math.max(0,A-S),Math.max(0,Math.min(u-1,_+D)),A,_]},I}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var _s=function(t,i){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,i.instance},Ss=As({getItemOffset:function(t,i){var r=t.itemSize;return i*r},getItemSize:function(t,i){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var i=t.itemCount,r=t.itemSize;return r*i},getOffsetForIndexAndAlignment:function(t,i,r,o,c,l){var m=t.direction,d=t.height,h=t.itemCount,j=t.itemSize,g=t.layout,I=t.width,v=m==="horizontal"||g==="horizontal",N=v?I:d,a=Math.max(0,h*j-N),u=Math.min(a,i*j),p=Math.max(0,i*j-N+j+l);switch(r==="smart"&&(o>=p-N&&o<=u+N?r="auto":r="center"),r){case"start":return u;case"end":return p;case"center":{var f=Math.round(p+(u-p)/2);return f<Math.ceil(N/2)?0:f>a+Math.floor(N/2)?a:f}case"auto":default:return o>=p&&o<=u?o:o<p?p:u}},getStartIndexForOffset:function(t,i){var r=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(i/o)))},getStopIndexForStartIndex:function(t,i,r){var o=t.direction,c=t.height,l=t.itemCount,m=t.itemSize,d=t.layout,h=t.width,j=o==="horizontal"||d==="horizontal",g=i*m,I=j?h:c,v=Math.ceil((I+r-g)/m);return Math.max(0,Math.min(l-1,i+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function Ds(e){var t=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,r=e.startIndex,o=e.stopIndex;return!(r>i||o<t)}function zs(e){for(var t=e.isItemLoaded,i=e.itemCount,r=e.minimumBatchSize,o=e.startIndex,c=e.stopIndex,l=[],m=null,d=null,h=o;h<=c;h++){var j=t(h);j?d!==null&&(l.push(m,d),m=d=null):(d=h,m===null&&(m=h))}if(d!==null){for(var g=Math.min(Math.max(d,m+r-1),i-1),I=d+1;I<=g&&!t(I);I++)d=I;l.push(m,d)}if(l.length)for(;l[1]-l[0]+1<r&&l[0]>0;){var v=l[0]-1;if(!t(v))l[0]=v;else break}return l}var Cs=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ks=function(){function e(t,i){for(var r=0;r<i.length;r++){var o=i[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),Os=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},ae=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},ws=function(e){Os(t,e);function t(){var i,r,o,c;Cs(this,t);for(var l=arguments.length,m=Array(l),d=0;d<l;d++)m[d]=arguments[d];return c=(r=(o=ae(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(m))),o),o._lastRenderedStartIndex=-1,o._lastRenderedStopIndex=-1,o._memoizedUnloadedRanges=[],o._onItemsRendered=function(h){var j=h.visibleStartIndex,g=h.visibleStopIndex;o._lastRenderedStartIndex=j,o._lastRenderedStopIndex=g,o._ensureRowsLoaded(j,g)},o._setRef=function(h){o._listRef=h},r),ae(o,c)}return ks(t,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,o){var c=this.props,l=c.isItemLoaded,m=c.itemCount,d=c.minimumBatchSize,h=d===void 0?10:d,j=c.threshold,g=j===void 0?15:j,I=zs({isItemLoaded:l,itemCount:m,minimumBatchSize:h,startIndex:Math.max(0,r-g),stopIndex:Math.min(m-1,o+g)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(v,N){return I[N]!==v}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(r){for(var o=this,c=this.props.loadMoreItems||this.props.loadMoreRows,l=function(h){var j=r[h],g=r[h+1],I=c(j,g);I!=null&&I.then(function(){if(Ds({lastRenderedStartIndex:o._lastRenderedStartIndex,lastRenderedStopIndex:o._lastRenderedStopIndex,startIndex:j,stopIndex:g})){if(o._listRef==null)return;typeof o._listRef.resetAfterIndex=="function"?o._listRef.resetAfterIndex(j,!0):(typeof o._listRef._getItemStyleCache=="function"&&o._listRef._getItemStyleCache(-1),o._listRef.forceUpdate())}})},m=0;m<r.length;m+=2)l(m)}}]),t}(T.PureComponent);const bs=n.styled_default("div")({name:"Container",class:"Container_culdu4a",propsAsIs:!1}),Es=n.styled_default("div")({name:"Position",class:"Position_pwf8e69",propsAsIs:!1}),$s=n.styled_default("img")({name:"Avatar",class:"Avatar_atf4yh4",propsAsIs:!1}),Ls=n.styled_default("div")({name:"AvatarPlaceholder",class:"AvatarPlaceholder_a1dg29ja",propsAsIs:!1}),Rs=n.styled_default("div")({name:"Content",class:"Content_c10a68rc",propsAsIs:!1}),Qs=n.styled_default("div")({name:"NameContainer",class:"NameContainer_nc4kck5",propsAsIs:!1}),Us=n.styled_default("span")({name:"Name",class:"Name_njsrqgr",propsAsIs:!1}),Ps=()=>n.i1,qs=n.styled_default(Ps())({name:"CurrentUserBadge",class:"CurrentUserBadge_c17uc4zr",propsAsIs:!0}),Ys=({rank:e,avatar:t,name:i,points:r,isCurrentUser:o,openItemDetail:c,style:l})=>s.jsxs(bs,{onClick:c,style:l,children:[s.jsx(Es,{children:e||0}),s.jsxs(Rs,{children:[t?s.jsx($s,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Ls,{children:n.o$1(i||"")}),s.jsxs(Qs,{children:[s.jsx(Us,{children:i||""}),o&&s.jsx(qs,{name:"icon-star"})]})]}),s.jsx("div",{children:n.i(r)})]}),Ws=({items:e,currentUserId:t,openItemDetail:i,fetchMore:r})=>s.jsx(n.AutoSizer,{children:({width:o,height:c})=>s.jsx(ws,{isItemLoaded:l=>l<e.length,itemCount:e.length+1,loadMoreItems:r,children:({onItemsRendered:l,ref:m})=>s.jsx(Ss,{itemSize:56,onItemsRendered:l,ref:m,itemCount:e.length,width:o,height:c,children:({index:d,style:h})=>s.jsx(Ys,{style:{...h,maxHeight:48},...e[d],openItemDetail:()=>i(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})}),Fs=({deepLink:e})=>{const{data:t}=n.useStore(e.$store);return s.jsx(n.O,{inviteLink:t==null?void 0:t.url,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},Bs=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Ws,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Fs,{deepLink:e.deepLink})},Vs=n.styled_default("div")({name:"QuestionItem",class:"QuestionItem_q1w97g3p",propsAsIs:!1}),Hs=n.styled_default("div")({name:"QuestionCaption",class:"QuestionCaption_q2sl39u",propsAsIs:!1}),Gs=n.styled_default("div")({name:"QuestionBody",class:"QuestionBody_qd5h0uc",propsAsIs:!1}),Zs=n.styled_default("div")({name:"QuestionAction",class:"QuestionAction_q105uluy",propsAsIs:!1}),Js=()=>n.i1,Q=n.styled_default(Js())({name:"QuestionActionIcon",class:"QuestionActionIcon_q1fa0b9h",propsAsIs:!0}),Ks=()=>n.i1,Xs=n.styled_default(Ks())({name:"QuestionTypeIcon",class:"QuestionTypeIcon_qxlt78s",propsAsIs:!0}),en=n.styled_default("div")({name:"QuestionTypeLabel",class:"QuestionTypeLabel_qmg0vkx",propsAsIs:!1}),tn=n.styled_default("div")({name:"QuestionContent",class:"QuestionContent_q1uz5j1g",propsAsIs:!1}),sn={[n.PickHistoryStatus.LOST]:s.jsx(Q,{name:"icon-cross"}),[n.PickHistoryStatus.WON]:s.jsx(Q,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:void 0,[n.PickHistoryStatus.DNP]:s.jsx(Q,{name:"icon-arrow"})},nn=({questionId:e,questionType:t,questionStatus:i,subject:r,openForVoting:o,openQuestion:c,status:l})=>{const m=n.o[t],d=sn[l];return m?s.jsxs(Vs,{onClick:()=>c==null?void 0:c(e),children:[s.jsxs(tn,{children:[s.jsxs(Hs,{children:[s.jsx(Xs,{name:m.iconName}),s.jsxs(en,{children:[m.label,t===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Gs,{children:r||""})]}),s.jsx(Zs,{children:d||(o?s.jsx(n.c,{children:"Play"}):null)})]}):null},rn=n.styled_default("div")({name:"Container",class:"Container_cll3md7",propsAsIs:!1}),on=n.styled_default("button")({name:"ActionBtn",class:"ActionBtn_a10g1iik",propsAsIs:!1}),an=({openInsight:e,questionId:t,...i})=>s.jsxs(rn,{children:[s.jsx(fe,{questionId:t,...i}),e&&s.jsx(on,{onClick:()=>e(t),children:"View Insight"})]}),ln=n.styled_default("div")({name:"QuestionsContainer",class:"QuestionsContainer_qvghv3l",propsAsIs:!1}),cn=({questions:e,openQuestion:t})=>s.jsx(ln,{children:e==null?void 0:e.map(i=>{var r,o;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const c=i.attributes.attributes.value;return s.jsx(nn,{openQuestion:t,...c},c.questionId)}if(i.type==="insight"&&((o=i.attributes)==null?void 0:o.attributes.case)==="insight"){const c=i.attributes.attributes.value;return s.jsx(an,{openInsight:t,...c},c.questionId)}return null})}),dn=({store:e,openQuestion:t})=>{const i=n.useStore(e);return i!=null&&i.data?s.jsx(cn,{openQuestion:t,questions:i.data}):s.jsx("div",{children:"wait questions..."})},un=({userSummary:e})=>{var t,i;const r=n.useStore(e.getStore());return(t=r.data)!=null&&t.summary?s.jsx(de,{...r.data.summary,successRate:(i=r.data.percentage)==null?void 0:i.correct}):s.jsx("div",{children:"wait user..."})},pn=({gamification:e})=>{const[t,i]=T.useState(k.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[s.jsxs(n.a$1,{children:[s.jsx(ys,{activePage:t,toggleActivePage:i}),t===k.HOME&&s.jsx(un,{userSummary:e.userSummary})]}),t===k.HOME&&s.jsx(n.s,{children:s.jsx(dn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})}),t===k.LEADERBOARD&&s.jsx(n.a$1,{style:{flex:"1 1 auto",paddingTop:0,paddingBottom:0},children:s.jsx(Bs,{gamification:e})})]})},mn=()=>n.x,le=n.styled_default(mn())({name:"OpenedContainer",class:"OpenedContainer_oar61gl",propsAsIs:!0}),fn=n.styled_default("div")({name:"UserContainer",class:"UserContainer_u14zaal4",propsAsIs:!1}),hn=({correct:e,incorrect:t})=>{const i=e+t;return i===0?0:Math.round(e/i*100)},he=({gamification:e,className:t})=>{const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[i&&s.jsx(le,{className:t,children:s.jsx(ps,{gamification:e})}),r&&s.jsx(le,{className:t,children:s.jsxs(fn,{children:[s.jsx(ce,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a$1,{children:s.jsx(de,{...r,successRate:hn(r)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(pn,{gamification:e})})]})};exports.GamificationOverlay=he;exports.default=he;
|
package/lib/dist/index.d.ts
CHANGED
|
@@ -1515,6 +1515,7 @@ declare module "app/provider" {
|
|
|
1515
1515
|
}>;
|
|
1516
1516
|
}
|
|
1517
1517
|
declare module "app/masters" {
|
|
1518
|
+
import '@streamlayer/react-ui/style.css';
|
|
1518
1519
|
import { StreamLayerProps } from "app/provider";
|
|
1519
1520
|
export const MastersStreamLayerProvider: React.FC<StreamLayerProps & {
|
|
1520
1521
|
children: React.ReactNode;
|