@streamlayer/react 0.28.5 → 0.29.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/dist/cjs/masters.js +1 -0
- package/lib/dist/cjs/package.json +1 -0
- package/lib/dist/es/masters.js +9 -0
- package/lib/dist/es/package.json +1 -0
- package/lib/dist/index-b9208075.js +1589 -0
- package/lib/dist/index-edbd0748.cjs +1 -0
- package/lib/dist/index.d.ts +1530 -0
- package/lib/dist/masters-06dc3df7.cjs +29 -0
- package/lib/dist/masters-a2f6c191.js +20047 -0
- package/lib/dist/style.css +143 -0
- package/lib/masters.d.ts +4 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("./masters-06dc3df7.cjs"),j=require("react");const De=()=>i.e1,we=()=>i.e1,Oe=i.styled_default("div")({name:"a",class:"acysrl1",propsAsIs:!1}),Ee=i.styled_default("div")({name:"l",class:"lo57cjm",propsAsIs:!1}),ke=i.styled_default(De())({name:"p",class:"p14kwh4y",propsAsIs:!0}),be=i.styled_default("span")({name:"s",class:"sxun7sq",propsAsIs:!1}),Le=i.styled_default("button")({name:"c",class:"c1i8ida8",propsAsIs:!1}),Ce=i.styled_default(we())({name:"g",class:"g1m0xfmw",propsAsIs:!0}),me=({type:t,close:e,label:s})=>{const r=t?i.o[t]:{label:s,iconName:void 0};return n.jsxs(Oe,{children:[n.jsxs(Ee,{children:[(r==null?void 0:r.iconName)&&n.jsx(ke,{name:r.iconName}),(r==null?void 0:r.label)&&n.jsx(be,{children:r.label})]}),n.jsx(Le,{onClick:e,children:n.jsx(Ce,{name:"icon-cross"})})]})};const Re=i.styled_default("div")({name:"t",class:"taj61ja",propsAsIs:!1}),$e=i.styled_default("div")({name:"r",class:"r19fxewd",propsAsIs:!1}),Qe=i.styled_default("div")({name:"i",class:"i1whkbqh",propsAsIs:!1}),Z=({indicator:t,title:e})=>n.jsxs(Re,{children:[n.jsx($e,{children:e}),n.jsx(Qe,{children:t})]});const Ue=i.styled_default("div")({name:"i",class:"i4lbhzs",propsAsIs:!1}),qe=i.styled_default("div")({name:"o",class:"ordquhq",propsAsIs:!1}),Ye=i.styled_default("div")({name:"n",class:"nwzed99",propsAsIs:!1}),L=({indicator:t,title:e})=>n.jsxs(Ue,{children:[n.jsx(qe,{children:t}),n.jsx(Ye,{children:e})]});const Pe=i.styled_default("div")({name:"o",class:"o15y0waw",propsAsIs:!1}),Fe=i.styled_default("div")({name:"i",class:"ihjewwf",propsAsIs:!1}),We=i.styled_default("div")({name:"n",class:"n10e9lv8",propsAsIs:!1}),Ve=i.styled_default("div")({name:"r",class:"r13bxv",propsAsIs:!1}),He=i.styled_default("img")({name:"a",class:"a1fi59c9",propsAsIs:!1}),Be=i.styled_default("div")({name:"s",class:"s1kkihge",propsAsIs:!1}),Ge=i.styled_default("div")({name:"c",class:"cy4f4t",propsAsIs:!1}),Ze=i.styled_default("div")({name:"p",class:"p18cnlx1",propsAsIs:!1}),Je=i.styled_default("img")({name:"l",class:"lboqgs5",propsAsIs:!1}),Ke=i.styled_default("div")({name:"d",class:"d1oaal4",propsAsIs:!1}),Xe=i.styled_default("div")({name:"x",class:"x1yzgo0u",propsAsIs:!1}),et=i.styled_default("div")({name:"f",class:"f1l9i8s8",propsAsIs:!1}),tt=i.styled_default("div")({name:"g",class:"g4cgl4u",propsAsIs:!1}),st=i.styled_default("div")({name:"h",class:"h1qn1tmd",propsAsIs:!1}),nt=i.styled_default("div")({name:"u",class:"u1gsbhq4",propsAsIs:!1}),it=i.styled_default("div")({name:"m",class:"mvj8oco",propsAsIs:!1}),rt=i.styled_default("button")({name:"v",class:"viqiaf2",propsAsIs:!1}),at="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9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+Cjwvc3ZnPgo=",ge=({avatar:t,name:e,points:s,friendsRank:r,rank:a,streak:c,correct:p,incorrect:h,inTop:m,average:x})=>n.jsxs(Pe,{children:[n.jsx(Fe,{children:n.jsxs(Ve,{children:[n.jsxs(rt,{children:[t&&n.jsx(He,{alt:"avatar",src:t}),!t&&n.jsx(it,{children:i.e(e||"")})]}),n.jsxs(Be,{children:[n.jsx(Ge,{children:e}),n.jsxs(Ze,{children:[n.jsxs(Ke,{children:[n.jsx(Je,{alt:"rank-icon",src:at}),n.jsxs(Xe,{children:[i.a(s),n.jsx(et,{children:"PTS"})]})]}),n.jsx(tt,{}),n.jsxs("div",{children:["TOP ",m||0,"%"]})]})]})]})}),n.jsxs(We,{children:[n.jsxs(st,{children:[n.jsx(Z,{indicator:r||0,title:"Friends rank"}),n.jsx(Z,{indicator:a||0,title:"Global rank"})]}),n.jsxs(nt,{children:[n.jsx(L,{indicator:c||0,title:"Win streak"}),n.jsx(L,{indicator:p||0,title:"Correct"}),n.jsx(L,{indicator:h||0,title:"Incorrect"}),n.jsx(L,{indicator:`${x||0}%`,title:"Succ. rate"})]})]})]});const lt=()=>i.e1,ot=i.styled_default("div")({name:"c",class:"ciyeb68",propsAsIs:!1}),dt=i.styled_default(lt())({name:"n",class:"nfic4xc",propsAsIs:!0}),ct=i.styled_default("div")({name:"d",class:"d1pd1p66",propsAsIs:!1}),ut=i.styled_default("div")({name:"p",class:"p132yxcv",propsAsIs:!1}),pt=i.styled_default("span")({name:"l",class:"l4a8aw",propsAsIs:!1}),J=i.styled_default("span")({name:"g",class:"gzdx7pk",propsAsIs:!1}),ft=({feedbackMessages:t,questionVotedCorrectly:e,questionVoted:s,questionType:r,hasCorrectAnswer:a})=>{if(!(s&&(r===i.QuestionType.TRIVIA||r===i.QuestionType.PREDICTION)))return null;const c=r===i.QuestionType.PREDICTION&&!a,p=e?"correct":"incorrect",h=e?t.correctFeedback:t.incorrectFeedback;return n.jsxs(ot,{"data-isPrediction":c,children:[c&&n.jsxs(n.Fragment,{children:[n.jsx(dt,{name:"icon-prediction"}),n.jsx(J,{children:"Stay tuned to see if your prediction was correct."})]}),a&&n.jsxs(n.Fragment,{children:[n.jsx(ct,{"data-feedbackType":p,children:n.jsx(i.e1,{name:p})}),n.jsx("div",{children:n.jsxs(ut,{children:[n.jsx(pt,{"data-feedbackType":p,children:h==null?void 0:h.title}),n.jsx(J,{children:h==null?void 0:h.description})]})})]})]})};const ht=i.styled_default("div")({name:"o",class:"olc1eph",propsAsIs:!1}),mt=i.styled_default("div")({name:"n",class:"n1yoh29a",propsAsIs:!1}),gt=i.styled_default("div")({name:"p",class:"pjkr5mb",propsAsIs:!1}),yt=i.styled_default("div")({name:"r",class:"r82wnnx",propsAsIs:!1});const It=()=>ye,xt=()=>ye,vt=()=>i.e1,_t=i.styled_default("button")({name:"c",class:"cpm4u8k",propsAsIs:!1}),Mt=i.styled_default("div")({name:"l",class:"lwfomc3",propsAsIs:!1}),jt=i.styled_default("span")({name:"d",class:"dmltvg2",propsAsIs:!1}),Nt=i.styled_default("div")({name:"s",class:"stfjpqz",propsAsIs:!1}),zt=i.styled_default("div")({name:"p",class:"p198m24r",propsAsIs:!1}),ye=i.styled_default("img")({name:"r",class:"rbq5eu7",propsAsIs:!1}),Tt=i.styled_default(It())({name:"g",class:"g1iv6oeb",propsAsIs:!0}),St=i.styled_default(xt())({name:"h",class:"h1qtxlqc",propsAsIs:!0}),At=i.styled_default("span")({name:"u",class:"udm736q",propsAsIs:!1}),Dt=i.styled_default("span")({name:"b",class:"b1da34tx",propsAsIs:!1}),wt=i.styled_default("span")({name:"x",class:"x1dqwq83",propsAsIs:!1}),Ot=i.styled_default(vt())({name:"v",class:"v10s9my2",propsAsIs:!0}),K={[i.QuestionImages.CENTERED]:t=>n.jsx(Tt,{alt:"option-icon",src:t}),[i.QuestionImages.TRANSPARENT]:t=>n.jsx(Nt,{children:n.jsx(zt,{style:{backgroundImage:`url(${t})`}})}),[i.QuestionImages.ROUNDED]:t=>n.jsx(St,{alt:"option-icon",src:t}),[i.QuestionImages.NONE]:()=>null,[i.QuestionImages.UNSET]:()=>null},Et=({questionType:t,hasCorrectAnswer:e,correct:s,youVoted:r,questionVoted:a})=>{if(t===i.QuestionType.POLL&&r)return"correct";if(t===i.QuestionType.PREDICTION){if(e&&a)return r?s?"correct":"incorrect":s?"correct":"unset";if(r)return"correct"}return t===i.QuestionType.TRIVIA&&a?r?s?"correct":"incorrect":s?"correct":"unset":"unset"},kt=({questionType:t,questionVoted:e,correct:s,hasCorrectAnswer:r,questionStatus:a})=>t===i.QuestionType.TRIVIA?e&&s:t===i.QuestionType.PREDICTION?e&&s&&r||a===i.QuestionStatus.RESOLVED&&s:!1,bt=t=>{var e;const{id:s,icon:r,text:a,percentageDecimal:c,onVote:p,youSelected:h,questionVoted:m,imageMode:x=i.QuestionImages.ROUNDED,answerTimeExpired:_,questionStatus:v,isLoading:o,questionType:I,correct:y,hasCorrectAnswer:l}=t,f=Et(t),d=kt({questionType:I,questionVoted:m,correct:y,hasCorrectAnswer:l,questionStatus:v}),u=m||v===i.QuestionStatus.RESOLVED&&I===i.QuestionType.PREDICTION;return n.jsxs(_t,{value:s,"data-selected":h,"data-answerState":f,disabled:m||o||_,onClick:p,children:[u&&n.jsx(Mt,{"data-answerState":f,style:{width:`${c}%`}}),n.jsxs(jt,{children:[r&&((e=K[x])==null?void 0:e.call(K,r)),n.jsx(At,{children:a}),u&&n.jsxs(Dt,{children:[d&&n.jsx(Ot,{name:"selected"}),n.jsxs(wt,{children:[c,"%"]})]})]})]})};var X=typeof window>"u"?j.useEffect:j.useLayoutEffect,Lt=({isPlaying:t,duration:e,startAt:s=0,updateInterval:r=0,onComplete:a,onUpdate:c})=>{let[p,h]=j.useState(s),m=j.useRef(0),x=j.useRef(s),_=j.useRef(s*-1e3),v=j.useRef(null),o=j.useRef(null),I=j.useRef(null),y=d=>{let u=d/1e3;if(o.current===null){o.current=u,v.current=requestAnimationFrame(y);return}let g=u-o.current,N=m.current+g;o.current=u,m.current=N;let M=x.current+(r===0?N:(N/r|0)*r),z=x.current+N,T=typeof e=="number"&&z>=e;h(T?e:M),T||(v.current=requestAnimationFrame(y))},l=()=>{v.current&&cancelAnimationFrame(v.current),I.current&&clearTimeout(I.current),o.current=null},f=j.useCallback(d=>{l(),m.current=0;let u=typeof d=="number"?d:s;x.current=u,h(u),t&&(v.current=requestAnimationFrame(y))},[t,s]);return X(()=>{if(c==null||c(p),e&&p>=e){_.current+=e*1e3;let{shouldRepeat:d=!1,delay:u=0,newStartAt:g}=(a==null?void 0:a(_.current/1e3))||{};d&&(I.current=setTimeout(()=>f(g),u*1e3))}},[p,e]),X(()=>(t&&(v.current=requestAnimationFrame(y)),l),[t,e,r]),{elapsedTime:p,reset:f}},Ct=(t,e,s)=>{let r=t/2,a=e/2,c=r-a,p=2*c,h=s==="clockwise"?"1,0":"0,1",m=2*Math.PI*c;return{path:`m ${r},${a} a ${c},${c} 0 ${h} 0,${p} a ${c},${c} 0 ${h} 0,-${p}`,pathLength:m}},ee=(t,e)=>t===0||t===e?0:typeof e=="number"?t-e:0,Rt=t=>({position:"relative",width:t,height:t}),$t={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},Ie=(t,e,s,r,a)=>{if(r===0)return e;let c=(a?r-t:t)/r;return e+s*c},te=t=>{var e,s;return(s=(e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,a,c,p)=>`#${a}${a}${c}${c}${p}${p}`).substring(1).match(/.{2}/g))==null?void 0:e.map(r=>parseInt(r,16)))!=null?s:[]},Qt=(t,e)=>{var s;let{colors:r,colorsTime:a,isSmoothColorTransition:c=!0}=t;if(typeof r=="string")return r;let p=(s=a==null?void 0:a.findIndex((o,I)=>o>=e&&e>=a[I+1]))!=null?s:-1;if(!a||p===-1)return r[0];if(!c)return r[p];let h=a[p]-e,m=a[p]-a[p+1],x=te(r[p]),_=te(r[p+1]),v=!!t.isGrowing;return`rgb(${x.map((o,I)=>Ie(h,o,_[I]-o,m,v)|0).join(",")})`},Ut=t=>{let{duration:e,initialRemainingTime:s,updateInterval:r,size:a=180,strokeWidth:c=12,trailStrokeWidth:p,isPlaying:h=!1,isGrowing:m=!1,rotation:x="clockwise",onComplete:_,onUpdate:v}=t,o=j.useRef(),I=Math.max(c,p??0),{path:y,pathLength:l}=Ct(a,I,x),{elapsedTime:f}=Lt({isPlaying:h,duration:e,startAt:ee(e,s),updateInterval:r,onUpdate:typeof v=="function"?u=>{let g=Math.ceil(e-u);g!==o.current&&(o.current=g,v(g))}:void 0,onComplete:typeof _=="function"?u=>{var g;let{shouldRepeat:N,delay:M,newInitialRemainingTime:z}=(g=_(u))!=null?g:{};if(N)return{shouldRepeat:N,delay:M,newStartAt:ee(e,z)}}:void 0}),d=e-f;return{elapsedTime:f,path:y,pathLength:l,remainingTime:Math.ceil(d),rotation:x,size:a,stroke:Qt(t,d),strokeDashoffset:Ie(f,0,l,e,m),strokeWidth:c}},xe=t=>{let{children:e,strokeLinecap:s,trailColor:r,trailStrokeWidth:a}=t,{path:c,pathLength:p,stroke:h,strokeDashoffset:m,remainingTime:x,elapsedTime:_,size:v,strokeWidth:o}=Ut(t);return j.createElement("div",{style:Rt(v)},j.createElement("svg",{viewBox:`0 0 ${v} ${v}`,width:v,height:v,xmlns:"http://www.w3.org/2000/svg"},j.createElement("path",{d:c,fill:"none",stroke:r??"#d9d9d9",strokeWidth:a??o}),j.createElement("path",{d:c,fill:"none",stroke:h,strokeLinecap:s??"round",strokeWidth:o,strokeDasharray:p,strokeDashoffset:m})),typeof e=="function"&&j.createElement("div",{style:$t},e({remainingTime:x,elapsedTime:_,color:h})))};xe.displayName="CountdownCircleTimer";const qt=[i.E.PRIMARY_GREEN1,i.E.SECONDARY_RED1,i.E.SECONDARY_RED1],Yt=[10,10,0],Pt=i.styled_default("div")({name:"A",class:"a1f928zy",propsAsIs:!1}),Ft=i.E.SECONDARY_GREEN6,se=i.E.SECONDARY_RED3,Wt=i.E.NEUTRALS_GRAY3,Vt=({isPlaying:t=!0,duration:e=30,onTimerExpired:s})=>{const[r,a]=j.useState(e>10?Ft:se),c=({remainingTime:m})=>n.jsx(Pt,{children:m}),p=j.useCallback(()=>{s==null||s(),a(Wt)},[s,a]),h=j.useCallback(m=>{m===10&&a(se)},[a]);return n.jsx(xe,{isPlaying:t,duration:e,colors:qt,colorsTime:Yt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:p,onUpdate:h,children:c})};const Ht=()=>i.e1,Bt=i.styled_default("div")({name:"a",class:"a1r7f3z4",propsAsIs:!1}),Gt=i.styled_default("div")({name:"s",class:"sblndl",propsAsIs:!1}),Zt=i.styled_default("div")({name:"l",class:"l7ka1tv",propsAsIs:!1}),Jt=i.styled_default(Ht())({name:"p",class:"p1edlxt3",propsAsIs:!0}),Kt=i.styled_default("div")({name:"g",class:"ghm08u2",propsAsIs:!1}),Xt=i.styled_default("span")({name:"c",class:"c12nsh46",propsAsIs:!1}),es=i.styled_default("span")({name:"d",class:"dlr9eoc",propsAsIs:!1}),ts=({title:t,points:e,isPlayingTimer:s,isTimer:r,onTimerExpired:a})=>n.jsxs(Bt,{children:[n.jsxs(Gt,{children:[t&&n.jsx(Zt,{children:t}),e!==void 0&&n.jsxs(n.Fragment,{children:[n.jsx(Jt,{name:"icon-trophy"}),n.jsxs(Kt,{children:[n.jsx(Xt,{children:e}),n.jsx(es,{children:"PTS"})]})]})]}),r&&n.jsx(Vt,{isPlaying:s,onTimerExpired:a})]}),ss=({openedQuestion:t,vote:e})=>{var s;const r=t.subject,a=t.type,c=(s=t.options)==null?void 0:s.options,[p,h]=j.useState(!1),[m,x]=j.useState(!1),[_,v]=j.useState(""),o=t==null?void 0:t.id,I=j.useCallback(async u=>{if(o){const g=u.currentTarget.value;v(g),x(!0),await e(o,g),x(!1)}},[o,v,e]),y=j.useMemo(()=>t==null?void 0:t.answers.find(u=>u.youVoted===!0),[t]),l=j.useMemo(()=>!!(t!=null&&t.answers.find(u=>u.correct===!0)),[t]),f=j.useMemo(()=>t?t.answers.map(u=>({...u,questionVoted:!!y,youSelected:_===u.id,isLoading:m,hasCorrectAnswer:l,questionType:t.type,answerTimeExpired:p,questionStatus:t.status,onVote:I})):[],[l,p,m,t,y,I,_]),d=c&&(c.case==="trivia"||c.case==="prediction")?c.value:void 0;return n.jsx(i.r,{"data-question-header":"true",children:n.jsx(ht,{children:n.jsxs(mt,{children:[d&&n.jsx(ft,{feedbackMessages:d,questionVoted:!!y,questionVotedCorrectly:y==null?void 0:y.correct,questionType:a,hasCorrectAnswer:l}),n.jsx(ts,{title:p?"Expired":"To win",points:p?void 0:100,onTimerExpired:()=>h(!0),isTimer:!0}),n.jsx(gt,{children:r}),n.jsx(yt,{children:f.map(u=>n.jsx(bt,{...u},u.id))})]})})})};const ns=i.styled_default("div")({name:"e",class:"e18unvw4",propsAsIs:!1}),is=i.styled_default("div")({name:"r",class:"rs0uvk8",propsAsIs:!1}),rs=i.styled_default("h3")({name:"n",class:"n1hem4g7",propsAsIs:!1}),as=i.styled_default("div")({name:"i",class:"i193lbwv",propsAsIs:!1}),ls=i.styled_default("a")({name:"a",class:"a1dka9qs",propsAsIs:!1}),os=i.styled_default("div")({name:"l",class:"l1un98tk",propsAsIs:!1}),ds=({created:t,title:e,instantView:s})=>{const r=new Date(t),a=r.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),c=r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return n.jsxs(ns,{children:[n.jsxs(os,{children:[a,"・",c]}),(s==null?void 0:s.video)&&n.jsx(i.w,{source:s.video.url,poster:s.video.thumbnailUrl}),n.jsxs(is,{children:[n.jsx(rs,{children:(s==null?void 0:s.heading)||e}),n.jsx(as,{children:s==null?void 0:s.body}),(s==null?void 0:s.webLink)&&n.jsxs(ls,{href:s==null?void 0:s.webLink.url,target:"_blank",children:["Explore more of the Masters History",n.jsx(i.e1,{name:"icon-external-link"})]})]})]})};const cs=i.styled_default("div")({name:"d",class:"dk8r1eq",propsAsIs:!1}),us=({openedQuestion:t})=>{var e;return((e=t==null?void 0:t.attributes)==null?void 0:e.attributes.case)==="insight"?n.jsx(ds,{created:t.attributes.created,...t.attributes.attributes.value}):null},ps=({extendedQuestion:t,vote:e})=>{const{loading:s,data:r}=t;return!s&&r?n.jsx(ss,{vote:e,openedQuestion:r}):null},fs=({gamification:t})=>{var e;const s=i.useStore(t.openedQuestion.$store),r=i.useStore(t.openedQuestion.$extendedStore);if(!s)return null;const a=s.type;return n.jsxs(cs,{children:[n.jsx(me,{close:t.closeQuestion,type:((e=s.attributes)==null?void 0:e.type)||i.QuestionType.UNSET}),a==="question"&&n.jsx(ps,{vote:t.submitAnswer,extendedQuestion:r}),a!=="question"&&n.jsx(us,{openedQuestion:s})]})};const hs=i.styled_default("div")({name:"t",class:"tcim9sm",propsAsIs:!1}),ms=i.styled_default("div")({name:"e",class:"e8wco6o",propsAsIs:!1}),gs=i.styled_default("button")({name:"n",class:"n1ardwzl",propsAsIs:!1}),ys=i.styled_default("span")({name:"i",class:"i1vk8ojx",propsAsIs:!1});var E=(t=>(t.HOME="home",t.LEADERBOARD="leaderboard",t))(E||{});const ne=({title:t,active:e,onClick:s})=>n.jsx(gs,{onClick:s,"data-selected":e,children:n.jsx(ys,{children:t})}),Is=({activePage:t="home",toggleActivePage:e})=>n.jsx(hs,{children:n.jsxs(ms,{"data-position":t==="home"?"left":"right",children:[n.jsx(ne,{title:"Home",active:t==="home",onClick:()=>e("home")}),n.jsx(ne,{title:"Leader Board",active:t==="leaderboard",onClick:()=>e("leaderboard")})]})});let S;typeof window<"u"?S=window:typeof self<"u"?S=self:S=i.dist.global;let Y=null,P=null;const ie=20,R=S.clearTimeout,re=S.setTimeout,$=S.cancelAnimationFrame||S.mozCancelAnimationFrame||S.webkitCancelAnimationFrame,ae=S.requestAnimationFrame||S.mozRequestAnimationFrame||S.webkitRequestAnimationFrame;$==null||ae==null?(Y=R,P=function(e){return re(e,ie)}):(Y=function([e,s]){$(e),R(s)},P=function(e){const s=ae(function(){R(r),e()}),r=re(function(){$(s),e()},ie);return[s,r]});function xs(t){let e,s,r,a,c,p,h;const m=typeof document<"u"&&document.attachEvent;if(!m){p=function(d){const u=d.__resizeTriggers__,g=u.firstElementChild,N=u.lastElementChild,M=g.firstElementChild;N.scrollLeft=N.scrollWidth,N.scrollTop=N.scrollHeight,M.style.width=g.offsetWidth+1+"px",M.style.height=g.offsetHeight+1+"px",g.scrollLeft=g.scrollWidth,g.scrollTop=g.scrollHeight},c=function(d){return d.offsetWidth!==d.__resizeLast__.width||d.offsetHeight!==d.__resizeLast__.height},h=function(d){if(d.target.className&&typeof d.target.className.indexOf=="function"&&d.target.className.indexOf("contract-trigger")<0&&d.target.className.indexOf("expand-trigger")<0)return;const u=this;p(this),this.__resizeRAF__&&Y(this.__resizeRAF__),this.__resizeRAF__=P(function(){c(u)&&(u.__resizeLast__.width=u.offsetWidth,u.__resizeLast__.height=u.offsetHeight,u.__resizeListeners__.forEach(function(M){M.call(u,d)}))})};let o=!1,I="";r="animationstart";const y="Webkit Moz O ms".split(" ");let l="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),f="";{const d=document.createElement("fakeelement");if(d.style.animationName!==void 0&&(o=!0),o===!1){for(let u=0;u<y.length;u++)if(d.style[y[u]+"AnimationName"]!==void 0){f=y[u],I="-"+f.toLowerCase()+"-",r=l[u],o=!0;break}}}s="resizeanim",e="@"+I+"keyframes "+s+" { from { opacity: 0; } to { opacity: 0; } } ",a=I+"animation: 1ms "+s+"; "}const x=function(o){if(!o.getElementById("detectElementResize")){const I=(e||"")+".resize-triggers { "+(a||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',y=o.head||o.getElementsByTagName("head")[0],l=o.createElement("style");l.id="detectElementResize",l.type="text/css",t!=null&&l.setAttribute("nonce",t),l.styleSheet?l.styleSheet.cssText=I:l.appendChild(o.createTextNode(I)),y.appendChild(l)}};return{addResizeListener:function(o,I){if(m)o.attachEvent("onresize",I);else{if(!o.__resizeTriggers__){const y=o.ownerDocument,l=S.getComputedStyle(o);l&&l.position==="static"&&(o.style.position="relative"),x(y),o.__resizeLast__={},o.__resizeListeners__=[],(o.__resizeTriggers__=y.createElement("div")).className="resize-triggers";const f=y.createElement("div");f.className="expand-trigger",f.appendChild(y.createElement("div"));const d=y.createElement("div");d.className="contract-trigger",o.__resizeTriggers__.appendChild(f),o.__resizeTriggers__.appendChild(d),o.appendChild(o.__resizeTriggers__),p(o),o.addEventListener("scroll",h,!0),r&&(o.__resizeTriggers__.__animationListener__=function(g){g.animationName===s&&p(o)},o.__resizeTriggers__.addEventListener(r,o.__resizeTriggers__.__animationListener__))}o.__resizeListeners__.push(I)}},removeResizeListener:function(o,I){if(m)o.detachEvent("onresize",I);else if(o.__resizeListeners__.splice(o.__resizeListeners__.indexOf(I),1),!o.__resizeListeners__.length){o.removeEventListener("scroll",h,!0),o.__resizeTriggers__.__animationListener__&&(o.__resizeTriggers__.removeEventListener(r,o.__resizeTriggers__.__animationListener__),o.__resizeTriggers__.__animationListener__=null);try{o.__resizeTriggers__=!o.removeChild(o.__resizeTriggers__)}catch{}}}}}class vs extends j.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:s,disableWidth:r,onResize:a}=this.props;if(this._parentNode){var c,p,h,m;const x=window.getComputedStyle(this._parentNode)||{},_=parseFloat((c=x.paddingLeft)!==null&&c!==void 0?c:"0"),v=parseFloat((p=x.paddingRight)!==null&&p!==void 0?p:"0"),o=parseFloat((h=x.paddingTop)!==null&&h!==void 0?h:"0"),I=parseFloat((m=x.paddingBottom)!==null&&m!==void 0?m:"0"),y=this._parentNode.getBoundingClientRect(),l=y.height-o-I,f=y.width-_-v,d=this._parentNode.offsetHeight-o-I,u=this._parentNode.offsetWidth-_-v;(!s&&(this.state.height!==d||this.state.scaledHeight!==l)||!r&&(this.state.width!==u||this.state.scaledWidth!==f))&&(this.setState({height:d,width:u,scaledHeight:l,scaledWidth:f}),typeof a=="function"&&a({height:d,scaledHeight:l,scaledWidth:f,width:u}))}},this._setRef=s=>{this._autoSizer=s}}componentDidMount(){const{nonce:e}=this.props;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._parentNode!=null&&(typeof ResizeObserver<"u"?(this._resizeObserver=new ResizeObserver(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(this._parentNode)):(this._detectElementResize=xs(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize)),this._onResize()))}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),this._timeoutId!==null&&clearTimeout(this._timeoutId),this._resizeObserver&&(this._resizeObserver.observe(this._parentNode),this._resizeObserver.disconnect()))}render(){const{children:e,defaultHeight:s,defaultWidth:r,disableHeight:a=!1,disableWidth:c=!1,nonce:p,onResize:h,style:m={},tagName:x="div",..._}=this.props,{height:v,scaledHeight:o,scaledWidth:I,width:y}=this.state,l={overflow:"visible"},f={};let d=!1;return a||(v===0&&(d=!0),l.height=0,f.height=v,f.scaledHeight=o),c||(y===0&&(d=!0),l.width=0,f.width=y,f.scaledWidth=I),j.createElement(x,{ref:this._setRef,style:{...l,...m},..._},!d&&e(f))}}function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},F.apply(this,arguments)}function le(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function W(t,e){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},W(t,e)}function _s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,W(t,e)}var oe=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ms(t,e){return!!(t===e||oe(t)&&oe(e))}function js(t,e){if(t.length!==e.length)return!1;for(var s=0;s<t.length;s++)if(!Ms(t[s],e[s]))return!1;return!0}function Q(t,e){e===void 0&&(e=js);var s,r=[],a,c=!1;function p(){for(var h=[],m=0;m<arguments.length;m++)h[m]=arguments[m];return c&&s===this&&e(h,r)||(a=t.apply(this,h),c=!0,s=this,r=h),a}return p}var Ns=typeof performance=="object"&&typeof performance.now=="function",de=Ns?function(){return performance.now()}:function(){return Date.now()};function ce(t){cancelAnimationFrame(t.id)}function zs(t,e){var s=de();function r(){de()-s>=e?t.call(null):a.id=requestAnimationFrame(r)}var a={id:requestAnimationFrame(r)};return a}var U=-1;function ue(t){if(t===void 0&&(t=!1),U===-1||t){var e=document.createElement("div"),s=e.style;s.width="50px",s.height="50px",s.overflow="scroll",document.body.appendChild(e),U=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return U}var w=null;function pe(t){if(t===void 0&&(t=!1),w===null||t){var e=document.createElement("div"),s=e.style;s.width="50px",s.height="50px",s.overflow="scroll",s.direction="rtl";var r=document.createElement("div"),a=r.style;return a.width="100px",a.height="100px",e.appendChild(r),document.body.appendChild(e),e.scrollLeft>0?w="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?w="negative":w="positive-ascending"),document.body.removeChild(e),w}return w}var Ts=150,Ss=function(e,s){return e};function As(t){var e,s=t.getItemOffset,r=t.getEstimatedTotalSize,a=t.getItemSize,c=t.getOffsetForIndexAndAlignment,p=t.getStartIndexForOffset,h=t.getStopIndexForStartIndex,m=t.initInstanceProps,x=t.shouldResetStyleCacheOnItemSizeChange,_=t.validateProps;return e=function(v){_s(o,v);function o(y){var l;return l=v.call(this,y)||this,l._instanceProps=m(l.props,le(l)),l._outerRef=void 0,l._resetIsScrollingTimeoutId=null,l.state={instance:le(l),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof l.props.initialScrollOffset=="number"?l.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},l._callOnItemsRendered=void 0,l._callOnItemsRendered=Q(function(f,d,u,g){return l.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:d,visibleStartIndex:u,visibleStopIndex:g})}),l._callOnScroll=void 0,l._callOnScroll=Q(function(f,d,u){return l.props.onScroll({scrollDirection:f,scrollOffset:d,scrollUpdateWasRequested:u})}),l._getItemStyle=void 0,l._getItemStyle=function(f){var d=l.props,u=d.direction,g=d.itemSize,N=d.layout,M=l._getItemStyleCache(x&&g,x&&N,x&&u),z;if(M.hasOwnProperty(f))z=M[f];else{var T=s(l.props,f,l._instanceProps),A=a(l.props,f,l._instanceProps),D=u==="horizontal"||N==="horizontal",k=u==="rtl",b=D?T:0;M[f]=z={position:"absolute",left:k?void 0:b,right:k?b:void 0,top:D?0:T,height:D?"100%":A,width:D?A:"100%"}}return z},l._getItemStyleCache=void 0,l._getItemStyleCache=Q(function(f,d,u){return{}}),l._onScrollHorizontal=function(f){var d=f.currentTarget,u=d.clientWidth,g=d.scrollLeft,N=d.scrollWidth;l.setState(function(M){if(M.scrollOffset===g)return null;var z=l.props.direction,T=g;if(z==="rtl")switch(pe()){case"negative":T=-g;break;case"positive-descending":T=N-u-g;break}return T=Math.max(0,Math.min(T,N-u)),{isScrolling:!0,scrollDirection:M.scrollOffset<g?"forward":"backward",scrollOffset:T,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._onScrollVertical=function(f){var d=f.currentTarget,u=d.clientHeight,g=d.scrollHeight,N=d.scrollTop;l.setState(function(M){if(M.scrollOffset===N)return null;var z=Math.max(0,Math.min(N,g-u));return{isScrolling:!0,scrollDirection:M.scrollOffset<z?"forward":"backward",scrollOffset:z,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._outerRefSetter=function(f){var d=l.props.outerRef;l._outerRef=f,typeof d=="function"?d(f):d!=null&&typeof d=="object"&&d.hasOwnProperty("current")&&(d.current=f)},l._resetIsScrollingDebounced=function(){l._resetIsScrollingTimeoutId!==null&&ce(l._resetIsScrollingTimeoutId),l._resetIsScrollingTimeoutId=zs(l._resetIsScrolling,Ts)},l._resetIsScrolling=function(){l._resetIsScrollingTimeoutId=null,l.setState({isScrolling:!1},function(){l._getItemStyleCache(-1,null)})},l}o.getDerivedStateFromProps=function(l,f){return Ds(l,f),_(l),null};var I=o.prototype;return I.scrollTo=function(l){l=Math.max(0,l),this.setState(function(f){return f.scrollOffset===l?null:{scrollDirection:f.scrollOffset<l?"forward":"backward",scrollOffset:l,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},I.scrollToItem=function(l,f){f===void 0&&(f="auto");var d=this.props,u=d.itemCount,g=d.layout,N=this.state.scrollOffset;l=Math.max(0,Math.min(l,u-1));var M=0;if(this._outerRef){var z=this._outerRef;g==="vertical"?M=z.scrollWidth>z.clientWidth?ue():0:M=z.scrollHeight>z.clientHeight?ue():0}this.scrollTo(c(this.props,l,f,N,this._instanceProps,M))},I.componentDidMount=function(){var l=this.props,f=l.direction,d=l.initialScrollOffset,u=l.layout;if(typeof d=="number"&&this._outerRef!=null){var g=this._outerRef;f==="horizontal"||u==="horizontal"?g.scrollLeft=d:g.scrollTop=d}this._callPropsCallbacks()},I.componentDidUpdate=function(){var l=this.props,f=l.direction,d=l.layout,u=this.state,g=u.scrollOffset,N=u.scrollUpdateWasRequested;if(N&&this._outerRef!=null){var M=this._outerRef;if(f==="horizontal"||d==="horizontal")if(f==="rtl")switch(pe()){case"negative":M.scrollLeft=-g;break;case"positive-ascending":M.scrollLeft=g;break;default:var z=M.clientWidth,T=M.scrollWidth;M.scrollLeft=T-z-g;break}else M.scrollLeft=g;else M.scrollTop=g}this._callPropsCallbacks()},I.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ce(this._resetIsScrollingTimeoutId)},I.render=function(){var l=this.props,f=l.children,d=l.className,u=l.direction,g=l.height,N=l.innerRef,M=l.innerElementType,z=l.innerTagName,T=l.itemCount,A=l.itemData,D=l.itemKey,k=D===void 0?Ss:D,b=l.layout,_e=l.outerElementType,Me=l.outerTagName,je=l.style,Ne=l.useIsScrolling,ze=l.width,V=this.state.isScrolling,C=u==="horizontal"||b==="horizontal",Te=C?this._onScrollHorizontal:this._onScrollVertical,H=this._getRangeToRender(),Se=H[0],Ae=H[1],B=[];if(T>0)for(var O=Se;O<=Ae;O++)B.push(j.createElement(f,{data:A,key:k(O,A),index:O,isScrolling:Ne?V:void 0,style:this._getItemStyle(O)}));var G=r(this.props,this._instanceProps);return j.createElement(_e||Me||"div",{className:d,onScroll:Te,ref:this._outerRefSetter,style:F({position:"relative",height:g,width:ze,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:u},je)},j.createElement(M||z||"div",{children:B,ref:N,style:{height:C?"100%":G,pointerEvents:V?"none":void 0,width:C?G:"100%"}}))},I._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var l=this.props.itemCount;if(l>0){var f=this._getRangeToRender(),d=f[0],u=f[1],g=f[2],N=f[3];this._callOnItemsRendered(d,u,g,N)}}if(typeof this.props.onScroll=="function"){var M=this.state,z=M.scrollDirection,T=M.scrollOffset,A=M.scrollUpdateWasRequested;this._callOnScroll(z,T,A)}},I._getRangeToRender=function(){var l=this.props,f=l.itemCount,d=l.overscanCount,u=this.state,g=u.isScrolling,N=u.scrollDirection,M=u.scrollOffset;if(f===0)return[0,0,0,0];var z=p(this.props,M,this._instanceProps),T=h(this.props,z,M,this._instanceProps),A=!g||N==="backward"?Math.max(1,d):1,D=!g||N==="forward"?Math.max(1,d):1;return[Math.max(0,z-A),Math.max(0,Math.min(f-1,T+D)),z,T]},o}(j.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Ds=function(e,s){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,s.instance},ws=As({getItemOffset:function(e,s){var r=e.itemSize;return s*r},getItemSize:function(e,s){var r=e.itemSize;return r},getEstimatedTotalSize:function(e){var s=e.itemCount,r=e.itemSize;return r*s},getOffsetForIndexAndAlignment:function(e,s,r,a,c,p){var h=e.direction,m=e.height,x=e.itemCount,_=e.itemSize,v=e.layout,o=e.width,I=h==="horizontal"||v==="horizontal",y=I?o:m,l=Math.max(0,x*_-y),f=Math.min(l,s*_),d=Math.max(0,s*_-y+_+p);switch(r==="smart"&&(a>=d-y&&a<=f+y?r="auto":r="center"),r){case"start":return f;case"end":return d;case"center":{var u=Math.round(d+(f-d)/2);return u<Math.ceil(y/2)?0:u>l+Math.floor(y/2)?l:u}case"auto":default:return a>=d&&a<=f?a:a<d?d:f}},getStartIndexForOffset:function(e,s){var r=e.itemCount,a=e.itemSize;return Math.max(0,Math.min(r-1,Math.floor(s/a)))},getStopIndexForStartIndex:function(e,s,r){var a=e.direction,c=e.height,p=e.itemCount,h=e.itemSize,m=e.layout,x=e.width,_=a==="horizontal"||m==="horizontal",v=s*h,o=_?x:c,I=Math.ceil((o+r-v)/h);return Math.max(0,Math.min(p-1,s+I-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function Os(t){var e=t.lastRenderedStartIndex,s=t.lastRenderedStopIndex,r=t.startIndex,a=t.stopIndex;return!(r>s||a<e)}function Es(t){for(var e=t.isItemLoaded,s=t.itemCount,r=t.minimumBatchSize,a=t.startIndex,c=t.stopIndex,p=[],h=null,m=null,x=a;x<=c;x++){var _=e(x);_?m!==null&&(p.push(h,m),h=m=null):(m=x,h===null&&(h=x))}if(m!==null){for(var v=Math.min(Math.max(m,h+r-1),s-1),o=m+1;o<=v&&!e(o);o++)m=o;p.push(h,m)}if(p.length)for(;p[1]-p[0]+1<r&&p[0]>0;){var I=p[0]-1;if(!e(I))p[0]=I;else break}return p}var ks=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},bs=function(){function t(e,s){for(var r=0;r<s.length;r++){var a=s[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,s,r){return s&&t(e.prototype,s),r&&t(e,r),e}}(),Ls=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},fe=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},Cs=function(t){Ls(e,t);function e(){var s,r,a,c;ks(this,e);for(var p=arguments.length,h=Array(p),m=0;m<p;m++)h[m]=arguments[m];return c=(r=(a=fe(this,(s=e.__proto__||Object.getPrototypeOf(e)).call.apply(s,[this].concat(h))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(x){var _=x.visibleStartIndex,v=x.visibleStopIndex;a._lastRenderedStartIndex=_,a._lastRenderedStopIndex=v,a._ensureRowsLoaded(_,v)},a._setRef=function(x){a._listRef=x},r),fe(a,c)}return bs(e,[{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,a){var c=this.props,p=c.isItemLoaded,h=c.itemCount,m=c.minimumBatchSize,x=m===void 0?10:m,_=c.threshold,v=_===void 0?15:_,o=Es({isItemLoaded:p,itemCount:h,minimumBatchSize:x,startIndex:Math.max(0,r-v),stopIndex:Math.min(h-1,a+v)});(this._memoizedUnloadedRanges.length!==o.length||this._memoizedUnloadedRanges.some(function(I,y){return o[y]!==I}))&&(this._memoizedUnloadedRanges=o,this._loadUnloadedRanges(o))}},{key:"_loadUnloadedRanges",value:function(r){for(var a=this,c=this.props.loadMoreItems||this.props.loadMoreRows,p=function(x){var _=r[x],v=r[x+1],o=c(_,v);o!=null&&o.then(function(){if(Os({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:_,stopIndex:v})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(_,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},h=0;h<r.length;h+=2)p(h)}}]),e}(j.PureComponent);const Rs=()=>i.e1,$s=i.styled_default("div")({name:"a",class:"a1w9zony",propsAsIs:!1}),Qs=i.styled_default("div")({name:"l",class:"l16qcfv8",propsAsIs:!1}),Us=i.styled_default("img")({name:"p",class:"p1gmcc5f",propsAsIs:!1}),qs=i.styled_default("div")({name:"s",class:"s1doddh0",propsAsIs:!1}),Ys=i.styled_default("div")({name:"c",class:"c1js9xhe",propsAsIs:!1}),Ps=i.styled_default("div")({name:"d",class:"d1tmnqsh",propsAsIs:!1}),Fs=i.styled_default("span")({name:"g",class:"gi9h87j",propsAsIs:!1}),Ws=i.styled_default(Rs())({name:"x",class:"x13mk3z6",propsAsIs:!0}),Vs=({rank:t,avatar:e,name:s,points:r,isCurrentUser:a,openItemDetail:c,style:p})=>n.jsxs($s,{onClick:c,style:p,children:[n.jsx(Qs,{children:t||0}),n.jsxs(Ys,{children:[e?n.jsx(Us,{alt:"leaderboard-item-avatar",src:e}):n.jsx(qs,{children:i.e(s||"")}),n.jsxs(Ps,{children:[n.jsx(Fs,{children:s||""}),a&&n.jsx(Ws,{name:"icon-star"})]})]}),n.jsx("div",{children:i.a(r)})]}),Hs=({items:t,openItemDetail:e,fetchMore:s})=>n.jsx(vs,{children:({width:r,height:a})=>n.jsx(Cs,{isItemLoaded:c=>c<t.length,itemCount:t.length+1,loadMoreItems:s,children:({onItemsRendered:c,ref:p})=>n.jsx(ws,{itemSize:56,onItemsRendered:c,ref:p,itemCount:t.length,width:r,height:a,children:({index:h,style:m})=>n.jsx(Vs,{style:{...m,maxHeight:48},...t[h],openItemDetail:()=>e(t[h].userId)},t[h].userId)})})}),Bs=({leaderboardList:t,openUser:e})=>{const{data:s}=i.useStore(t.$store);return n.jsx(Hs,{fetchMore:t.fetchMore,items:s,openItemDetail:e})};const Gs=i.styled_default("button")({name:"a",class:"akly9h2",propsAsIs:!1}),Zs=i.styled_default("span")({name:"e",class:"eptoiz9",propsAsIs:!1}),Js=({disabled:t,variant:e="primary",onClick:s,children:r,...a})=>n.jsx(Gs,{onClick:s,disabled:t,"data-variant":e,...a,children:n.jsx(Zs,{children:r})});const Ks=()=>i.e1,Xs=()=>i.e1,en=i.styled_default("div")({name:"s",class:"s1lblda3",propsAsIs:!1}),tn=i.styled_default("div")({name:"a",class:"ascvb2g",propsAsIs:!1}),sn=i.styled_default("div")({name:"p",class:"p17rl8zy",propsAsIs:!1}),nn=i.styled_default("div")({name:"l",class:"l1vvttbn",propsAsIs:!1}),q=i.styled_default(Ks())({name:"c",class:"c6fk2ph",propsAsIs:!0}),rn=i.styled_default(Xs())({name:"d",class:"d1rdm136",propsAsIs:!0}),an=i.styled_default("div")({name:"f",class:"fwqnnel",propsAsIs:!1}),ln=i.styled_default("div")({name:"u",class:"ucyxnlg",propsAsIs:!1}),on={[i.PickHistoryStatus.LOST]:n.jsx(q,{name:"icon-cross"}),[i.PickHistoryStatus.WON]:n.jsx(q,{name:"icon-check"}),[i.PickHistoryStatus.UNSET]:void 0,[i.PickHistoryStatus.DNP]:n.jsx(q,{name:"icon-arrow"})},dn=({questionId:t,questionType:e,questionStatus:s,subject:r,openForVoting:a,openQuestion:c,status:p})=>{const h=i.o[e],m=on[p];return h?n.jsxs(en,{onClick:()=>c==null?void 0:c(t),children:[n.jsxs(ln,{children:[n.jsxs(tn,{children:[n.jsx(rn,{name:h.iconName}),n.jsxs(an,{children:[h.label,e===i.QuestionType.TRIVIA&&s===i.QuestionStatus.RESOLVED&&" • Expired"]})]}),n.jsx(sn,{children:r||""})]}),n.jsx(nn,{children:m||(a?n.jsx(Js,{children:"Play"}):null)})]}):null};const cn=i.styled_default("div")({name:"e",class:"e1jcgove",propsAsIs:!1}),un=i.styled_default("div")({name:"t",class:"t1bwp7hh",propsAsIs:!1}),pn=i.styled_default("div")({name:"i",class:"i1xav4cl",propsAsIs:!1}),fn=i.styled_default("h3")({name:"n",class:"n3qb30y",propsAsIs:!1}),hn=i.styled_default("div")({name:"a",class:"ap5d9g7",propsAsIs:!1}),mn=i.styled_default("button")({name:"l",class:"lvdbmlu",propsAsIs:!1}),gn=({title:t,instantView:e,openInsight:s,questionId:r})=>{const a=new Date,c=a.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),p=a.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return n.jsxs(cn,{children:[n.jsxs(un,{children:[c,"・",p]}),(e==null?void 0:e.video)&&n.jsx(i.w,{source:e.video.url,poster:e.video.thumbnailUrl}),n.jsxs(pn,{children:[n.jsx(fn,{children:(e==null?void 0:e.heading)||t}),n.jsx(hn,{children:e==null?void 0:e.body}),s&&n.jsx(mn,{onClick:()=>s(r),children:"View Insight"})]})]})};const yn=i.styled_default("div")({name:"t",class:"t19vr3p1",propsAsIs:!1}),In=({questions:t,openQuestion:e})=>n.jsx(yn,{children:t==null?void 0:t.map(s=>{var r,a;if(s.type==="question"&&((r=s.attributes)==null?void 0:r.attributes.case)==="question"){const c=s.attributes.attributes.value;return n.jsx(dn,{openQuestion:e,...c},c.questionId)}if(s.type==="insight"&&((a=s.attributes)==null?void 0:a.attributes.case)==="insight"){const c=s.attributes.attributes.value;return n.jsx(gn,{openInsight:e,...c},c.questionId)}return null})}),xn=({store:t,openQuestion:e})=>{const s=i.useStore(t);return s!=null&&s.data?n.jsx(In,{openQuestion:e,questions:s.data}):n.jsx("div",{children:"wait questions..."})},vn=({userSummary:t})=>{var e;const s=i.useStore(t.getStore());return(e=s.data)!=null&&e.summary?n.jsx(ge,{...s.data.summary,...s.data.percentage}):n.jsx("div",{children:"wait user..."})},_n=({gamification:t})=>{const[e,s]=j.useState(E.HOME);return n.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[n.jsxs(i.e$1,{children:[n.jsx(Is,{activePage:e,toggleActivePage:s}),e===E.HOME&&n.jsx(vn,{userSummary:t.userSummary})]}),e===E.HOME&&n.jsx(i.n,{children:n.jsx(xn,{openQuestion:t.openQuestion,store:t.feedList.getStore()})}),e===E.LEADERBOARD&&n.jsx(i.n,{style:{flex:"1 1 auto",paddingTop:0,paddingBottom:0},children:n.jsx(Bs,{openUser:t.openUser,leaderboardList:t.leaderboardList})})]})};const Mn=()=>i.f,he=i.styled_default(Mn())({name:"m",class:"m1ph66cs",propsAsIs:!0}),jn=i.styled_default("div")({name:"x",class:"xorme7i",propsAsIs:!1}),ve=({gamification:t,className:e})=>{const s=i.useStore(t.openedQuestion.$store),r=i.useStore(t.openedUser);return n.jsxs(n.Fragment,{children:[s&&n.jsx(he,{className:e,children:n.jsx(fs,{gamification:t})}),r&&n.jsx(he,{className:e,children:n.jsxs(jn,{children:[n.jsx(me,{label:"Friend's Rank",close:t.closeUser}),n.jsx(i.e$1,{children:n.jsx(ge,{...r})})]})}),n.jsx(i.r,{className:e,"data-nav":"true",children:n.jsx(_n,{gamification:t})})]})};exports.GamificationOverlay=ve;exports.default=ve;
|