@streamlayer/react 0.29.9 → 0.29.10

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