@streamlayer/react 0.30.3 → 0.30.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("./index3.js"),k=require("@nanostores/react"),z=require("./masters2.js"),S=require("react"),g=require("@streamlayer/sdk-web-types"),C=require("./common.js"),Ne=require("react-countdown-circle-timer"),b=require("./index2.js");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("@lottiefiles/react-lottie-player");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const Te=r.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ae=r.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Se=()=>r.i1,De=r.styled_default(Se())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ze=r.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Oe=r.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),_e=()=>r.i1,ke=r.styled_default(_e())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ue=({type:e,close:t,label:n})=>{const i=e?z.o[e]:{label:n,iconName:void 0};return s.jsxs(Te,{children:[s.jsxs(Ae,{children:[(i==null?void 0:i.iconName)&&s.jsx(De,{name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(ze,{children:i.label})]}),s.jsx(Oe,{onClick:t,children:s.jsx(ke,{name:"icon-cross"})})]})},Ce=r.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),we=r.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),be=r.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),J=({indicator:e,title:t})=>s.jsxs(Ce,{children:[s.jsx(we,{children:t}),s.jsx(be,{children:e})]}),Ee=r.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Le=r.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Re=r.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),Q=({indicator:e,title:t})=>s.jsxs(Ee,{children:[s.jsx(Le,{children:e}),s.jsx(Re,{children:t})]}),Qe=r.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),$e=r.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ue=r.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),qe=r.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ye=r.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Pe=r.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),We=r.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Fe=r.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ve=r.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Be=r.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),He=r.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ze=r.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ge=r.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Je=r.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ke=r.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Xe=r.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),et=r.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),tt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",pe=({avatar:e,name:t,points:n,friendsRank:i,rank:o,streak:m,correct:p,incorrect:u,inTop:d,successRate:f})=>s.jsxs(Qe,{children:[s.jsx($e,{children:s.jsxs(qe,{children:[s.jsxs(et,{children:[e&&s.jsx(Ye,{alt:"avatar",src:e}),!e&&s.jsx(Xe,{children:C.o(t||"")})]}),s.jsxs(Pe,{children:[s.jsx(We,{children:t}),s.jsxs(Fe,{children:[s.jsxs(Be,{children:[s.jsx(Ve,{alt:"rank-icon",src:tt}),s.jsxs(He,{children:[C.i(n),s.jsx(Ze,{children:"PTS"})]})]}),s.jsx(Ge,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(Ue,{children:[s.jsxs(Je,{children:[s.jsx(J,{indicator:i||0,title:"Friends rank"}),s.jsx(J,{indicator:o||0,title:"Global rank"})]}),s.jsxs(Ke,{children:[s.jsx(Q,{indicator:m||0,title:"Win streak"}),s.jsx(Q,{indicator:p||0,title:"Correct"}),s.jsx(Q,{indicator:u||0,title:"Incorrect"}),s.jsx(Q,{indicator:`${f||0}%`,title:"Succ. rate"})]})]})]}),st=r.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),nt=r.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),it=r.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),rt=({title:e,description:t})=>s.jsxs(st,{children:[s.jsx(r.i1,{name:"icon-check-circle"}),s.jsx(nt,{children:e}),s.jsx(it,{children:t})]}),ot=r.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),at=()=>r.i1,lt=r.styled_default(at())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),K=r.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),X=r.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),ct=r.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),q=r.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),dt=r.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ut=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:n,questionType:i,hasCorrectAnswer:o,questionStatus:m})=>{const p=n&&(i===g.QuestionType.TRIVIA||i===g.QuestionType.PREDICTION);if(!p&&m!==g.QuestionStatus.RESOLVED)return null;const u=i===g.QuestionType.PREDICTION&&!o,d=t?"correct":"incorrect",f=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ot,{"data-isPrediction":u,children:[m===g.QuestionStatus.RESOLVED&&i===g.QuestionType.TRIVIA&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(K,{children:s.jsx(r.i1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(X,{children:s.jsx(q,{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."})]})]}),p&&u&&s.jsxs(s.Fragment,{children:[s.jsx(lt,{name:"icon-prediction"}),s.jsx(q,{children:"Stay tuned to see if your prediction was correct."})]}),p&&o&&s.jsxs(s.Fragment,{children:[s.jsx(K,{"data-feedbackType":d,children:s.jsx(r.i1,{name:d})}),s.jsx("div",{children:s.jsxs(X,{children:[s.jsx(ct,{"data-feedbackType":d,children:f==null?void 0:f.title}),s.jsx(q,{children:f==null?void 0:f.description})]})})]})]})},pt=r.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),mt=r.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),It=r.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),ft=r.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ht=r.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),xt=r.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),yt=r.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),gt=r.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),jt=r.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),me=r.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),Mt=()=>me,vt=r.styled_default(Mt())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Nt=()=>me,Tt=r.styled_default(Nt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),At=r.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),St=r.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Dt=r.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),zt=()=>r.i1,Ot=r.styled_default(zt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),ee={[g.QuestionImages.CENTERED]:e=>s.jsx(vt,{alt:"option-icon",src:e}),[g.QuestionImages.TRANSPARENT]:e=>s.jsx(gt,{children:s.jsx(jt,{style:{backgroundImage:`url(${e})`}})}),[g.QuestionImages.ROUNDED]:e=>s.jsx(Tt,{alt:"option-icon",src:e}),[g.QuestionImages.NONE]:()=>null,[g.QuestionImages.UNSET]:()=>null},_t=({questionType:e,hasCorrectAnswer:t,correct:n,youVoted:i,questionVoted:o})=>{if(e===g.QuestionType.POLL&&i)return"correct";if(e===g.QuestionType.PREDICTION){if(t&&o)return i?n?"correct":"incorrect":n?"correct":"unset";if(i)return"correct"}return e===g.QuestionType.TRIVIA&&o?i?n?"correct":"incorrect":n?"correct":"unset":"unset"},kt=({questionType:e,questionVoted:t,correct:n,hasCorrectAnswer:i,questionStatus:o})=>e===g.QuestionType.TRIVIA?t&&n:e===g.QuestionType.PREDICTION?t&&n&&i||o===g.QuestionStatus.RESOLVED&&n:!1,Ct=e=>{var t;const{id:n,icon:i,text:o,percentageDecimal:m,onVote:p,youSelected:u,questionVoted:d,imageMode:f=g.QuestionImages.ROUNDED,answerTimeExpired:M,questionStatus:T,isLoading:j,questionType:v,correct:N,hasCorrectAnswer:a}=e,l=_t(e),c=kt({questionType:v,questionVoted:d,correct:N,hasCorrectAnswer:a,questionStatus:T}),I=d||T===g.QuestionStatus.RESOLVED&&v===g.QuestionType.PREDICTION;return s.jsxs(ht,{value:n,"data-selected":u,"data-answerState":l,disabled:d||j||M,onClick:p,children:[I&&s.jsx(xt,{"data-answerState":l,style:{width:`${m}%`}}),s.jsxs(yt,{children:[i&&((t=ee[f])==null?void 0:t.call(ee,i)),s.jsx(At,{children:o}),I&&s.jsxs(St,{children:[c&&s.jsx(Ot,{name:"selected"}),s.jsxs(Dt,{children:[m,"%"]})]})]})]})},wt=[b.E.PRIMARY_GREEN1,b.E.SECONDARY_RED1,b.E.SECONDARY_RED1],bt=[10,10,0],Et=r.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Lt=b.E.SECONDARY_GREEN6,te=b.E.SECONDARY_RED3,Rt=b.E.NEUTRALS_GRAY3,Qt=({isPlaying:e=!0,duration:t=30,onTimerExpired:n})=>{const[i,o]=S.useState(t>10?Lt:te),m=({remainingTime:d})=>s.jsx(Et,{children:d}),p=S.useCallback(()=>{n==null||n(),o(Rt)},[n,o]),u=S.useCallback(d=>{d===10&&o(te)},[o]);return s.jsx(Ne.CountdownCircleTimer,{isPlaying:e,duration:t,colors:wt,colorsTime:bt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:p,onUpdate:u,children:m})},$t=r.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Ut=r.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),qt=r.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Yt=()=>r.i1,Pt=r.styled_default(Yt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Wt=r.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Ft=r.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Vt=r.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Bt=({title:e,points:t,isPlayingTimer:n,isTimer:i,onTimerExpired:o})=>s.jsxs($t,{children:[s.jsxs(Ut,{children:[e&&s.jsx(qt,{children:e}),t!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(Pt,{name:"icon-trophy"}),s.jsxs(Wt,{children:[s.jsx(Ft,{children:t}),s.jsx(Vt,{children:"PTS"})]})]})]}),i&&s.jsx(Qt,{isPlaying:n,onTimerExpired:o})]}),Ht=({openedQuestion:e,vote:t,close:n})=>{var i;const o=e.subject,m=e.type,p=(i=e.options)==null?void 0:i.options,[u,d]=S.useState(!1),[f,M]=S.useState(!1),[T,j]=S.useState(""),v=e==null?void 0:e.id,N=S.useCallback(async y=>{if(v){const h=y.currentTarget.value;j(h),M(!0),await t(v,h),M(!1)}},[v,j,t]),a=S.useCallback(()=>{d(!0),setTimeout(n,3e3)},[n]),l=S.useMemo(()=>e==null?void 0:e.answers.find(y=>y.youVoted===!0),[e]),c=S.useMemo(()=>!!(e!=null&&e.answers.find(y=>y.correct===!0)),[e]),I=S.useMemo(()=>e?e.answers.map(y=>({...y,questionVoted:!!l,youSelected:T===y.id,isLoading:f,hasCorrectAnswer:c,questionType:e.type,answerTimeExpired:u,questionStatus:e.status,onVote:N})):[],[c,u,f,e,l,N,T]),x=p&&(p.case==="trivia"||p.case==="prediction")?p.value:void 0;return s.jsx(z.r,{"data-question-header":"true",children:s.jsx(pt,{children:s.jsxs(mt,{children:[x&&s.jsx(ut,{feedbackMessages:x,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:m,hasCorrectAnswer:c,questionStatus:e.status}),s.jsx(Bt,{title:u?"Time expired":"To win",points:u?void 0:100,onTimerExpired:a,isTimer:!0}),u?s.jsx(rt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(It,{children:o}),s.jsx(ft,{children:I.map(y=>s.jsx(Ct,{...y},y.id))})]})]})})})},Zt=r.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),Gt=r.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),Jt=r.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),Kt=r.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),Xt=r.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),Ie=({created:e,title:t,instantView:n})=>{const i=S.useMemo(()=>{if(e){const o=new Date(e);if(C.r(o))return{date:C.a(o),time:C.n(o)}}return null},[e]);return s.jsxs(Zt,{children:[i&&s.jsxs(Xt,{children:[i.date," · ",i.time]}),(n==null?void 0:n.video)&&s.jsx(z.w,{source:n.video.url,poster:n.video.thumbnailUrl}),s.jsxs(Gt,{children:[s.jsx(Jt,{children:(n==null?void 0:n.heading)||t}),s.jsx(Kt,{children:n==null?void 0:n.body})]})]})},es=r.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ts=r.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ss=({instantView:e,...t})=>s.jsxs(es,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(ts,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(r.i1,{name:"icon-external-link"})]})]}),ns=r.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),is=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ss,{created:e.attributes.created,...e.attributes.attributes.value}):null},rs=({extendedQuestion:e,vote:t,close:n})=>{const{loading:i,data:o}=e;return!i&&o?s.jsx(Ht,{vote:t,close:n,openedQuestion:o}):null},os=({gamification:e})=>{var t;const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedQuestion.$extendedStore);if(!n)return null;const o=n.type;return s.jsxs(ns,{children:[s.jsx(ue,{close:e.closeQuestion,type:((t=n.attributes)==null?void 0:t.type)||g.QuestionType.UNSET}),o==="question"&&s.jsx(rs,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),o!=="question"&&s.jsx(is,{openedQuestion:n})]})},as=r.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),ls=r.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),cs=r.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),ds=r.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var $=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))($||{});const se=({title:e,active:t,onClick:n})=>s.jsx(cs,{onClick:n,"data-selected":t,children:s.jsx(ds,{children:e})}),us=({activePage:e="home",toggleActivePage:t})=>s.jsx(as,{children:s.jsxs(ls,{"data-position":e==="home"?"left":"right",children:[s.jsx(se,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(se,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},F.apply(this,arguments)}function ne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},V(e,t)}function ps(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V(e,t)}var ie=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function ms(e,t){return!!(e===t||ie(e)&&ie(t))}function Is(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ms(e[n],t[n]))return!1;return!0}function Y(e,t){t===void 0&&(t=Is);var n,i=[],o,m=!1;function p(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return m&&n===this&&t(u,i)||(o=e.apply(this,u),m=!0,n=this,i=u),o}return p}var fs=typeof performance=="object"&&typeof performance.now=="function",re=fs?function(){return performance.now()}:function(){return Date.now()};function oe(e){cancelAnimationFrame(e.id)}function hs(e,t){var n=re();function i(){re()-n>=t?e.call(null):o.id=requestAnimationFrame(i)}var o={id:requestAnimationFrame(i)};return o}var P=-1;function ae(e){if(e===void 0&&(e=!1),P===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),P=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return P}var w=null;function le(e){if(e===void 0&&(e=!1),w===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var i=document.createElement("div"),o=i.style;return o.width="100px",o.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?w="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?w="negative":w="positive-ascending"),document.body.removeChild(t),w}return w}var xs=150,ys=function(t,n){return t};function gs(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,o=e.getItemSize,m=e.getOffsetForIndexAndAlignment,p=e.getStartIndexForOffset,u=e.getStopIndexForStartIndex,d=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(T){ps(j,T);function j(N){var a;return a=T.call(this,N)||this,a._instanceProps=d(a.props,ne(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:ne(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=Y(function(l,c,I,x){return a.props.onItemsRendered({overscanStartIndex:l,overscanStopIndex:c,visibleStartIndex:I,visibleStopIndex:x})}),a._callOnScroll=void 0,a._callOnScroll=Y(function(l,c,I){return a.props.onScroll({scrollDirection:l,scrollOffset:c,scrollUpdateWasRequested:I})}),a._getItemStyle=void 0,a._getItemStyle=function(l){var c=a.props,I=c.direction,x=c.itemSize,y=c.layout,h=a._getItemStyleCache(f&&x,f&&y,f&&I),A;if(h.hasOwnProperty(l))A=h[l];else{var D=n(a.props,l,a._instanceProps),O=o(a.props,l,a._instanceProps),_=I==="horizontal"||y==="horizontal",L=I==="rtl",R=_?D:0;h[l]=A={position:"absolute",left:L?void 0:R,right:L?R:void 0,top:_?0:D,height:_?"100%":O,width:_?O:"100%"}}return A},a._getItemStyleCache=void 0,a._getItemStyleCache=Y(function(l,c,I){return{}}),a._onScrollHorizontal=function(l){var c=l.currentTarget,I=c.clientWidth,x=c.scrollLeft,y=c.scrollWidth;a.setState(function(h){if(h.scrollOffset===x)return null;var A=a.props.direction,D=x;if(A==="rtl")switch(le()){case"negative":D=-x;break;case"positive-descending":D=y-I-x;break}return D=Math.max(0,Math.min(D,y-I)),{isScrolling:!0,scrollDirection:h.scrollOffset<x?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(l){var c=l.currentTarget,I=c.clientHeight,x=c.scrollHeight,y=c.scrollTop;a.setState(function(h){if(h.scrollOffset===y)return null;var A=Math.max(0,Math.min(y,x-I));return{isScrolling:!0,scrollDirection:h.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(l){var c=a.props.outerRef;a._outerRef=l,typeof c=="function"?c(l):c!=null&&typeof c=="object"&&c.hasOwnProperty("current")&&(c.current=l)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&oe(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=hs(a._resetIsScrolling,xs)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}j.getDerivedStateFromProps=function(a,l){return js(a,l),M(a),null};var v=j.prototype;return v.scrollTo=function(a){a=Math.max(0,a),this.setState(function(l){return l.scrollOffset===a?null:{scrollDirection:l.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(a,l){l===void 0&&(l="auto");var c=this.props,I=c.itemCount,x=c.layout,y=this.state.scrollOffset;a=Math.max(0,Math.min(a,I-1));var h=0;if(this._outerRef){var A=this._outerRef;x==="vertical"?h=A.scrollWidth>A.clientWidth?ae():0:h=A.scrollHeight>A.clientHeight?ae():0}this.scrollTo(m(this.props,a,l,y,this._instanceProps,h))},v.componentDidMount=function(){var a=this.props,l=a.direction,c=a.initialScrollOffset,I=a.layout;if(typeof c=="number"&&this._outerRef!=null){var x=this._outerRef;l==="horizontal"||I==="horizontal"?x.scrollLeft=c:x.scrollTop=c}this._callPropsCallbacks()},v.componentDidUpdate=function(){var a=this.props,l=a.direction,c=a.layout,I=this.state,x=I.scrollOffset,y=I.scrollUpdateWasRequested;if(y&&this._outerRef!=null){var h=this._outerRef;if(l==="horizontal"||c==="horizontal")if(l==="rtl")switch(le()){case"negative":h.scrollLeft=-x;break;case"positive-ascending":h.scrollLeft=x;break;default:var A=h.clientWidth,D=h.scrollWidth;h.scrollLeft=D-A-x;break}else h.scrollLeft=x;else h.scrollTop=x}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&oe(this._resetIsScrollingTimeoutId)},v.render=function(){var a=this.props,l=a.children,c=a.className,I=a.direction,x=a.height,y=a.innerRef,h=a.innerElementType,A=a.innerTagName,D=a.itemCount,O=a.itemData,_=a.itemKey,L=_===void 0?ys:_,R=a.layout,fe=a.outerElementType,he=a.outerTagName,xe=a.style,ye=a.useIsScrolling,ge=a.width,B=this.state.isScrolling,U=I==="horizontal"||R==="horizontal",je=U?this._onScrollHorizontal:this._onScrollVertical,H=this._getRangeToRender(),Me=H[0],ve=H[1],Z=[];if(D>0)for(var E=Me;E<=ve;E++)Z.push(S.createElement(l,{data:O,key:L(E,O),index:E,isScrolling:ye?B:void 0,style:this._getItemStyle(E)}));var G=i(this.props,this._instanceProps);return S.createElement(fe||he||"div",{className:c,onScroll:je,ref:this._outerRefSetter,style:F({position:"relative",height:x,width:ge,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:I},xe)},S.createElement(h||A||"div",{children:Z,ref:y,style:{height:U?"100%":G,pointerEvents:B?"none":void 0,width:U?G:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var l=this._getRangeToRender(),c=l[0],I=l[1],x=l[2],y=l[3];this._callOnItemsRendered(c,I,x,y)}}if(typeof this.props.onScroll=="function"){var h=this.state,A=h.scrollDirection,D=h.scrollOffset,O=h.scrollUpdateWasRequested;this._callOnScroll(A,D,O)}},v._getRangeToRender=function(){var a=this.props,l=a.itemCount,c=a.overscanCount,I=this.state,x=I.isScrolling,y=I.scrollDirection,h=I.scrollOffset;if(l===0)return[0,0,0,0];var A=p(this.props,h,this._instanceProps),D=u(this.props,A,h,this._instanceProps),O=!x||y==="backward"?Math.max(1,c):1,_=!x||y==="forward"?Math.max(1,c):1;return[Math.max(0,A-O),Math.max(0,Math.min(l-1,D+_)),A,D]},j}(S.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var js=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Ms=gs({getItemOffset:function(t,n){var i=t.itemSize;return n*i},getItemSize:function(t,n){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var n=t.itemCount,i=t.itemSize;return i*n},getOffsetForIndexAndAlignment:function(t,n,i,o,m,p){var u=t.direction,d=t.height,f=t.itemCount,M=t.itemSize,T=t.layout,j=t.width,v=u==="horizontal"||T==="horizontal",N=v?j:d,a=Math.max(0,f*M-N),l=Math.min(a,n*M),c=Math.max(0,n*M-N+M+p);switch(i==="smart"&&(o>=c-N&&o<=l+N?i="auto":i="center"),i){case"start":return l;case"end":return c;case"center":{var I=Math.round(c+(l-c)/2);return I<Math.ceil(N/2)?0:I>a+Math.floor(N/2)?a:I}case"auto":default:return o>=c&&o<=l?o:o<c?c:l}},getStartIndexForOffset:function(t,n){var i=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(n/o)))},getStopIndexForStartIndex:function(t,n,i){var o=t.direction,m=t.height,p=t.itemCount,u=t.itemSize,d=t.layout,f=t.width,M=o==="horizontal"||d==="horizontal",T=n*u,j=M?f:m,v=Math.ceil((j+i-T)/u);return Math.max(0,Math.min(p-1,n+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function vs(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,i=e.startIndex,o=e.stopIndex;return!(i>n||o<t)}function Ns(e){for(var t=e.isItemLoaded,n=e.itemCount,i=e.minimumBatchSize,o=e.startIndex,m=e.stopIndex,p=[],u=null,d=null,f=o;f<=m;f++){var M=t(f);M?d!==null&&(p.push(u,d),u=d=null):(d=f,u===null&&(u=f))}if(d!==null){for(var T=Math.min(Math.max(d,u+i-1),n-1),j=d+1;j<=T&&!t(j);j++)d=j;p.push(u,d)}if(p.length)for(;p[1]-p[0]+1<i&&p[0]>0;){var v=p[0]-1;if(!t(v))p[0]=v;else break}return p}var Ts=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},As=function(){function e(t,n){for(var i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Ss=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)},ce=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},Ds=function(e){Ss(t,e);function t(){var n,i,o,m;Ts(this,t);for(var p=arguments.length,u=Array(p),d=0;d<p;d++)u[d]=arguments[d];return m=(i=(o=ce(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(u))),o),o._lastRenderedStartIndex=-1,o._lastRenderedStopIndex=-1,o._memoizedUnloadedRanges=[],o._onItemsRendered=function(f){var M=f.visibleStartIndex,T=f.visibleStopIndex;o._lastRenderedStartIndex=M,o._lastRenderedStopIndex=T,o._ensureRowsLoaded(M,T)},o._setRef=function(f){o._listRef=f},i),ce(o,m)}return As(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,o){var m=this.props,p=m.isItemLoaded,u=m.itemCount,d=m.minimumBatchSize,f=d===void 0?10:d,M=m.threshold,T=M===void 0?15:M,j=Ns({isItemLoaded:p,itemCount:u,minimumBatchSize:f,startIndex:Math.max(0,i-T),stopIndex:Math.min(u-1,o+T)});(this._memoizedUnloadedRanges.length!==j.length||this._memoizedUnloadedRanges.some(function(v,N){return j[N]!==v}))&&(this._memoizedUnloadedRanges=j,this._loadUnloadedRanges(j))}},{key:"_loadUnloadedRanges",value:function(i){for(var o=this,m=this.props.loadMoreItems||this.props.loadMoreRows,p=function(f){var M=i[f],T=i[f+1],j=m(M,T);j!=null&&j.then(function(){if(vs({lastRenderedStartIndex:o._lastRenderedStartIndex,lastRenderedStopIndex:o._lastRenderedStopIndex,startIndex:M,stopIndex:T})){if(o._listRef==null)return;typeof o._listRef.resetAfterIndex=="function"?o._listRef.resetAfterIndex(M,!0):(typeof o._listRef._getItemStyleCache=="function"&&o._listRef._getItemStyleCache(-1),o._listRef.forceUpdate())}})},u=0;u<i.length;u+=2)p(u)}}]),t}(S.PureComponent);const zs=r.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Os=r.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),_s=r.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),ks=r.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Cs=r.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),ws=r.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),bs=r.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Es=()=>r.i1,Ls=r.styled_default(Es())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Rs=({rank:e,avatar:t,name:n,points:i,isCurrentUser:o,openItemDetail:m,style:p})=>s.jsxs(zs,{onClick:m,style:p,children:[s.jsx(Os,{children:e||0}),s.jsxs(Cs,{children:[t?s.jsx(_s,{alt:"leaderboard-item-avatar",src:t}):s.jsx(ks,{children:C.o(n||"")}),s.jsxs(ws,{children:[s.jsx(bs,{children:n||""}),o&&s.jsx(Ls,{name:"icon-star"})]})]}),s.jsx("div",{children:C.i(i)})]}),Qs=r.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),$s=({items:e,currentUserId:t,openItemDetail:n,fetchMore:i})=>s.jsx(z.AutoSizer,{children:({width:o,height:m})=>s.jsx(Ds,{isItemLoaded:p=>p<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:p,ref:u})=>s.jsx(Qs,{children:s.jsx(Ms,{itemSize:56,onItemsRendered:p,ref:u,itemCount:e.length,width:o,height:m,children:({index:d,style:f})=>s.jsx(Rs,{style:{...f,maxHeight:48},...e[d],openItemDetail:()=>n(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})})}),Us=({deepLink:e})=>{const{data:t}=k.useStore(e.$store);return s.jsx(z.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."})},qs=({gamification:e})=>{const{data:t}=k.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx($s,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Us,{deepLink:e.deepLink})},Ys=r.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Ps=r.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Ws=r.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Fs=r.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Vs=()=>r.i1,W=r.styled_default(Vs())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Bs=()=>r.i1,Hs=r.styled_default(Bs())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),Zs=r.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),Gs=r.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),Js={[g.PickHistoryStatus.LOST]:s.jsx(W,{name:"icon-cross"}),[g.PickHistoryStatus.WON]:s.jsx(W,{name:"icon-check"}),[g.PickHistoryStatus.UNSET]:void 0,[g.PickHistoryStatus.DNP]:s.jsx(W,{name:"icon-arrow"})},Ks=({questionId:e,questionType:t,questionStatus:n,subject:i,openForVoting:o,openQuestion:m,status:p})=>{const u=z.o[t],d=Js[p];return u?s.jsxs(Ys,{onClick:()=>m==null?void 0:m(e),children:[s.jsxs(Gs,{children:[s.jsxs(Ps,{children:[s.jsx(Hs,{name:u.iconName}),s.jsxs(Zs,{children:[u.label,t===g.QuestionType.TRIVIA&&n===g.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Ws,{children:i||""})]}),s.jsx(Fs,{children:d||(o?s.jsx(z.c,{children:"Play"}):null)})]}):null},Xs=r.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),en=r.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),tn=({openInsight:e,questionId:t,...n})=>s.jsxs(Xs,{children:[s.jsx(Ie,{questionId:t,...n}),e&&s.jsx(en,{onClick:()=>e(t),children:"View Insight"})]}),sn=r.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),nn=({questions:e,openQuestion:t})=>s.jsx(sn,{children:e==null?void 0:e.map(n=>{var i,o;if(n.type==="question"&&((i=n.attributes)==null?void 0:i.attributes.case)==="question"){const m=n.attributes.attributes.value;return s.jsx(Ks,{openQuestion:t,...m},m.questionId)}if(n.type==="insight"&&((o=n.attributes)==null?void 0:o.attributes.case)==="insight"){const m=n.attributes.attributes.value;return s.jsx(tn,{openInsight:t,...m},m.questionId)}return null})}),rn=({store:e,openQuestion:t})=>{const n=k.useStore(e);return n!=null&&n.data?s.jsx(nn,{openQuestion:t,questions:n.data}):s.jsx("div",{children:"wait questions..."})},on=({userSummary:e})=>{var t,n;const i=k.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(pe,{...i.data.summary,successRate:(n=i.data.percentage)==null?void 0:n.correct}):s.jsx("div",{children:"wait user..."})},an=({gamification:e})=>{const[t,n]=S.useState($.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(z.a,{style:{paddingBottom:"4px"},children:s.jsx(us,{activePage:t,toggleActivePage:n})}),t===$.HOME&&s.jsxs(z.r,{children:[s.jsx(z.a,{style:{paddingTop:"12px"},children:s.jsx(on,{userSummary:e.userSummary})}),s.jsx(z.n,{children:s.jsx(rn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===$.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(qs,{gamification:e})})]})},ln=()=>z.d,de=r.styled_default(ln())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),cn=r.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),dn=({correct:e,incorrect:t})=>{const n=e+t;return n===0?0:Math.round(e/n*100)},un=({gamification:e,className:t})=>{const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[n&&s.jsx(de,{className:t,children:s.jsx(os,{gamification:e})}),i&&s.jsx(de,{className:t,children:s.jsxs(cn,{children:[s.jsx(ue,{label:"Friend's Rank",close:e.closeUser}),s.jsx(z.a,{children:s.jsx(pe,{...i,successRate:dn(i)})})]})}),s.jsx(z.r,{className:t,"data-nav":"true",children:s.jsx(an,{gamification:e})})]})};exports.default=un;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("./index3.js"),k=require("@nanostores/react"),z=require("./masters2.js"),S=require("react"),j=require("@streamlayer/sdk-web-types"),C=require("./common.js"),Ne=require("react-countdown-circle-timer"),w=require("./index2.js");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("@lottiefiles/react-lottie-player");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const Te=r.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Ae=r.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),Se=()=>r.i1,De=r.styled_default(Se())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ze=r.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Oe=r.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),_e=()=>r.i1,ke=r.styled_default(_e())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ue=({type:e,close:t,label:n})=>{const i=e?z.o[e]:{label:n,iconName:void 0};return s.jsxs(Te,{children:[s.jsxs(Ae,{children:[(i==null?void 0:i.iconName)&&s.jsx(De,{name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(ze,{children:i.label})]}),s.jsx(Oe,{onClick:t,children:s.jsx(ke,{name:"icon-cross"})})]})},Ce=r.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),be=r.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),we=r.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),J=({indicator:e,title:t})=>s.jsxs(Ce,{children:[s.jsx(be,{children:t}),s.jsx(we,{children:e})]}),Ee=r.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),Le=r.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Re=r.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:t})=>s.jsxs(Ee,{children:[s.jsx(Le,{children:e}),s.jsx(Re,{children:t})]}),$e=r.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),Qe=r.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ue=r.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),qe=r.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Pe=r.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ye=r.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),We=r.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Fe=r.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ve=r.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Be=r.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),He=r.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Ze=r.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),Ge=r.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Je=r.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ke=r.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Xe=r.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),et=r.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),tt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",pe=({avatar:e,name:t,points:n,friendsRank:i,rank:o,streak:m,correct:p,incorrect:u,inTop:d,successRate:I})=>s.jsxs($e,{children:[s.jsx(Qe,{children:s.jsxs(qe,{children:[s.jsxs(et,{children:[e&&s.jsx(Pe,{alt:"avatar",src:e}),!e&&s.jsx(Xe,{children:C.o(t||"")})]}),s.jsxs(Ye,{children:[s.jsx(We,{children:t}),s.jsxs(Fe,{children:[s.jsxs(Be,{children:[s.jsx(Ve,{alt:"rank-icon",src:tt}),s.jsxs(He,{children:[C.i(n),s.jsx(Ze,{children:"PTS"})]})]}),s.jsx(Ge,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(Ue,{children:[s.jsxs(Je,{children:[s.jsx(J,{indicator:i||0,title:"Friends rank"}),s.jsx(J,{indicator:o||0,title:"Global rank"})]}),s.jsxs(Ke,{children:[s.jsx($,{indicator:m||0,title:"Win streak"}),s.jsx($,{indicator:p||0,title:"Correct"}),s.jsx($,{indicator:u||0,title:"Incorrect"}),s.jsx($,{indicator:`${I||0}%`,title:"Succ. rate"})]})]})]}),st=r.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),nt=r.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),it=r.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),rt=({title:e,description:t})=>s.jsxs(st,{children:[s.jsx(r.i1,{name:"icon-check-circle"}),s.jsx(nt,{children:e}),s.jsx(it,{children:t})]}),ot=r.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),at=()=>r.i1,lt=r.styled_default(at())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),K=r.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),X=r.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),ct=r.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),P=r.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),dt=r.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ut=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:n,questionType:i,hasCorrectAnswer:o,questionStatus:m})=>{const p=n&&(i===j.QuestionType.TRIVIA||i===j.QuestionType.PREDICTION);if(!p&&m!==j.QuestionStatus.RESOLVED)return null;const u=i===j.QuestionType.PREDICTION&&!o,d=t?"correct":"incorrect",I=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(ot,{"data-isPrediction":u,children:[m===j.QuestionStatus.RESOLVED&&i===j.QuestionType.TRIVIA&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(K,{children:s.jsx(r.i1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(X,{children:s.jsx(P,{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."})]})]}),p&&u&&s.jsxs(s.Fragment,{children:[s.jsx(lt,{name:"icon-prediction"}),s.jsx(P,{children:"Stay tuned to see if your prediction was correct."})]}),p&&o&&s.jsxs(s.Fragment,{children:[s.jsx(K,{"data-feedbackType":d,children:s.jsx(r.i1,{name:d})}),s.jsx("div",{children:s.jsxs(X,{children:[s.jsx(ct,{"data-feedbackType":d,children:I==null?void 0:I.title}),s.jsx(P,{children:I==null?void 0:I.description})]})})]})]})},pt=r.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),mt=r.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),It=r.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),ft=r.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ht=r.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),xt=r.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),yt=r.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),gt=r.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),jt=r.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),me=r.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),Mt=()=>me,vt=r.styled_default(Mt())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),Nt=()=>me,Tt=r.styled_default(Nt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),At=r.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),St=r.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Dt=r.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),zt=()=>r.i1,Ot=r.styled_default(zt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),ee={[j.QuestionImages.CENTERED]:e=>s.jsx(vt,{alt:"option-icon",src:e}),[j.QuestionImages.TRANSPARENT]:e=>s.jsx(gt,{children:s.jsx(jt,{style:{backgroundImage:`url(${e})`}})}),[j.QuestionImages.ROUNDED]:e=>s.jsx(Tt,{alt:"option-icon",src:e}),[j.QuestionImages.NONE]:()=>null,[j.QuestionImages.UNSET]:()=>null},_t=({questionType:e,hasCorrectAnswer:t,correct:n,youVoted:i,questionVoted:o})=>{if(e===j.QuestionType.POLL&&i)return"correct";if(e===j.QuestionType.PREDICTION){if(t&&o)return i?n?"correct":"incorrect":n?"correct":"unset";if(i)return"correct"}return e===j.QuestionType.TRIVIA&&o?i?n?"correct":"incorrect":n?"correct":"unset":"unset"},kt=({questionType:e,questionVoted:t,correct:n,hasCorrectAnswer:i,questionStatus:o})=>e===j.QuestionType.TRIVIA?t&&n:e===j.QuestionType.PREDICTION?t&&n&&i||o===j.QuestionStatus.RESOLVED&&n:!1,Ct=e=>{var t;const{id:n,icon:i,text:o,percentageDecimal:m,onVote:p,youSelected:u,questionVoted:d,imageMode:I,answerTimeExpired:M,questionStatus:T,isLoading:g,questionType:v,correct:N,hasCorrectAnswer:a}=e,l=_t(e),c=kt({questionType:v,questionVoted:d,correct:N,hasCorrectAnswer:a,questionStatus:T}),f=d||T===j.QuestionStatus.RESOLVED&&v===j.QuestionType.PREDICTION;return s.jsxs(ht,{value:n,"data-selected":u,"data-answerState":l,disabled:d||g||M,onClick:p,children:[f&&s.jsx(xt,{"data-answerState":l,style:{width:`${m}%`}}),s.jsxs(yt,{children:[i&&I&&((t=ee[I])==null?void 0:t.call(ee,i)),s.jsx(At,{children:o}),f&&s.jsxs(St,{children:[c&&s.jsx(Ot,{name:"selected"}),s.jsxs(Dt,{children:[m,"%"]})]})]})]})},bt=[w.E.PRIMARY_GREEN1,w.E.SECONDARY_RED1,w.E.SECONDARY_RED1],wt=[10,10,0],Et=r.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Lt=w.E.SECONDARY_GREEN6,te=w.E.SECONDARY_RED3,Rt=w.E.NEUTRALS_GRAY3,$t=({isPlaying:e=!0,duration:t=30,onTimerExpired:n})=>{const[i,o]=S.useState(t>10?Lt:te),m=({remainingTime:d})=>s.jsx(Et,{children:d}),p=S.useCallback(()=>{n==null||n(),o(Rt)},[n,o]),u=S.useCallback(d=>{d===10&&o(te)},[o]);return s.jsx(Ne.CountdownCircleTimer,{isPlaying:e,duration:t,colors:bt,colorsTime:wt,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:p,onUpdate:u,children:m})},Qt=r.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Ut=r.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),qt=r.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Pt=()=>r.i1,Yt=r.styled_default(Pt())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Wt=r.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Ft=r.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),Vt=r.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),Bt=({title:e,points:t,isPlayingTimer:n,isTimer:i,onTimerExpired:o})=>s.jsxs(Qt,{children:[s.jsxs(Ut,{children:[e&&s.jsx(qt,{children:e}),t!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(Yt,{name:"icon-trophy"}),s.jsxs(Wt,{children:[s.jsx(Ft,{children:t}),s.jsx(Vt,{children:"PTS"})]})]})]}),i&&s.jsx($t,{isPlaying:n,onTimerExpired:o})]}),Ht=({openedQuestion:e,vote:t,close:n})=>{var i;const o=e.subject,m=e.type,p=(i=e.options)==null?void 0:i.options,[u,d]=S.useState(!1),[I,M]=S.useState(!1),[T,g]=S.useState(""),v=e==null?void 0:e.id,N=S.useCallback(async y=>{if(v){const h=y.currentTarget.value;g(h),M(!0),await t(v,h),M(!1)}},[v,g,t]),a=S.useCallback(()=>{d(!0),setTimeout(n,3e3)},[n]),l=S.useMemo(()=>e==null?void 0:e.answers.find(y=>y.youVoted===!0),[e]),c=S.useMemo(()=>!!(e!=null&&e.answers.find(y=>y.correct===!0)),[e]),f=S.useMemo(()=>e?e.answers.map(y=>{var h;return{...y,questionVoted:!!l,youSelected:T===y.id,isLoading:I,hasCorrectAnswer:c,questionType:e.type,answerTimeExpired:u,questionStatus:e.status,imageMode:(h=e.appearance)==null?void 0:h.images,onVote:N}}):[],[c,u,I,e,l,N,T]),x=p&&(p.case==="trivia"||p.case==="prediction")?p.value:void 0;return s.jsx(z.r,{"data-question-header":"true",children:s.jsx(pt,{children:s.jsxs(mt,{children:[x&&s.jsx(ut,{feedbackMessages:x,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:m,hasCorrectAnswer:c,questionStatus:e.status}),s.jsx(Bt,{title:u?"Time expired":"To win",points:u?void 0:100,onTimerExpired:a,isTimer:!0}),u?s.jsx(rt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(It,{children:o}),s.jsx(ft,{children:f.map(y=>s.jsx(Ct,{...y},y.id))})]})]})})})},Zt=r.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),Gt=r.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),Jt=r.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),Kt=r.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),Xt=r.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),Ie=({created:e,title:t,instantView:n})=>{const i=S.useMemo(()=>{if(e){const o=new Date(e);if(C.r(o))return{date:C.a(o),time:C.n(o)}}return null},[e]);return s.jsxs(Zt,{children:[i&&s.jsxs(Xt,{children:[i.date," · ",i.time]}),(n==null?void 0:n.video)&&s.jsx(z.w,{source:n.video.url,poster:n.video.thumbnailUrl}),s.jsxs(Gt,{children:[s.jsx(Jt,{children:(n==null?void 0:n.heading)||t}),s.jsx(Kt,{children:n==null?void 0:n.body})]})]})},es=r.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ts=r.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ss=({instantView:e,...t})=>s.jsxs(es,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(ts,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(r.i1,{name:"icon-external-link"})]})]}),ns=r.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),is=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ss,{created:e.attributes.created,...e.attributes.attributes.value}):null},rs=({extendedQuestion:e,vote:t,close:n})=>{const{loading:i,data:o}=e;return!i&&o?s.jsx(Ht,{vote:t,close:n,openedQuestion:o}):null},os=({gamification:e})=>{var t;const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedQuestion.$extendedStore);if(!n)return null;const o=n.type;return s.jsxs(ns,{children:[s.jsx(ue,{close:e.closeQuestion,type:((t=n.attributes)==null?void 0:t.type)||j.QuestionType.UNSET}),o==="question"&&s.jsx(rs,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),o!=="question"&&s.jsx(is,{openedQuestion:n})]})},as=r.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),ls=r.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),cs=r.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),ds=r.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var U=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(U||{});const se=({title:e,active:t,onClick:n})=>s.jsx(cs,{onClick:n,"data-selected":t,children:s.jsx(ds,{children:e})}),us=({activePage:e="home",toggleActivePage:t})=>s.jsx(as,{children:s.jsxs(ls,{"data-position":e==="home"?"left":"right",children:[s.jsx(se,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(se,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},F.apply(this,arguments)}function ne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},V(e,t)}function ps(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,V(e,t)}var ie=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function ms(e,t){return!!(e===t||ie(e)&&ie(t))}function Is(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ms(e[n],t[n]))return!1;return!0}function Y(e,t){t===void 0&&(t=Is);var n,i=[],o,m=!1;function p(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return m&&n===this&&t(u,i)||(o=e.apply(this,u),m=!0,n=this,i=u),o}return p}var fs=typeof performance=="object"&&typeof performance.now=="function",re=fs?function(){return performance.now()}:function(){return Date.now()};function oe(e){cancelAnimationFrame(e.id)}function hs(e,t){var n=re();function i(){re()-n>=t?e.call(null):o.id=requestAnimationFrame(i)}var o={id:requestAnimationFrame(i)};return o}var W=-1;function ae(e){if(e===void 0&&(e=!1),W===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),W=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return W}var b=null;function le(e){if(e===void 0&&(e=!1),b===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var i=document.createElement("div"),o=i.style;return o.width="100px",o.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?b="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?b="negative":b="positive-ascending"),document.body.removeChild(t),b}return b}var xs=150,ys=function(t,n){return t};function gs(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,o=e.getItemSize,m=e.getOffsetForIndexAndAlignment,p=e.getStartIndexForOffset,u=e.getStopIndexForStartIndex,d=e.initInstanceProps,I=e.shouldResetStyleCacheOnItemSizeChange,M=e.validateProps;return t=function(T){ps(g,T);function g(N){var a;return a=T.call(this,N)||this,a._instanceProps=d(a.props,ne(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:ne(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=Y(function(l,c,f,x){return a.props.onItemsRendered({overscanStartIndex:l,overscanStopIndex:c,visibleStartIndex:f,visibleStopIndex:x})}),a._callOnScroll=void 0,a._callOnScroll=Y(function(l,c,f){return a.props.onScroll({scrollDirection:l,scrollOffset:c,scrollUpdateWasRequested:f})}),a._getItemStyle=void 0,a._getItemStyle=function(l){var c=a.props,f=c.direction,x=c.itemSize,y=c.layout,h=a._getItemStyleCache(I&&x,I&&y,I&&f),A;if(h.hasOwnProperty(l))A=h[l];else{var D=n(a.props,l,a._instanceProps),O=o(a.props,l,a._instanceProps),_=f==="horizontal"||y==="horizontal",L=f==="rtl",R=_?D:0;h[l]=A={position:"absolute",left:L?void 0:R,right:L?R:void 0,top:_?0:D,height:_?"100%":O,width:_?O:"100%"}}return A},a._getItemStyleCache=void 0,a._getItemStyleCache=Y(function(l,c,f){return{}}),a._onScrollHorizontal=function(l){var c=l.currentTarget,f=c.clientWidth,x=c.scrollLeft,y=c.scrollWidth;a.setState(function(h){if(h.scrollOffset===x)return null;var A=a.props.direction,D=x;if(A==="rtl")switch(le()){case"negative":D=-x;break;case"positive-descending":D=y-f-x;break}return D=Math.max(0,Math.min(D,y-f)),{isScrolling:!0,scrollDirection:h.scrollOffset<x?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(l){var c=l.currentTarget,f=c.clientHeight,x=c.scrollHeight,y=c.scrollTop;a.setState(function(h){if(h.scrollOffset===y)return null;var A=Math.max(0,Math.min(y,x-f));return{isScrolling:!0,scrollDirection:h.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(l){var c=a.props.outerRef;a._outerRef=l,typeof c=="function"?c(l):c!=null&&typeof c=="object"&&c.hasOwnProperty("current")&&(c.current=l)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&oe(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=hs(a._resetIsScrolling,xs)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}g.getDerivedStateFromProps=function(a,l){return js(a,l),M(a),null};var v=g.prototype;return v.scrollTo=function(a){a=Math.max(0,a),this.setState(function(l){return l.scrollOffset===a?null:{scrollDirection:l.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(a,l){l===void 0&&(l="auto");var c=this.props,f=c.itemCount,x=c.layout,y=this.state.scrollOffset;a=Math.max(0,Math.min(a,f-1));var h=0;if(this._outerRef){var A=this._outerRef;x==="vertical"?h=A.scrollWidth>A.clientWidth?ae():0:h=A.scrollHeight>A.clientHeight?ae():0}this.scrollTo(m(this.props,a,l,y,this._instanceProps,h))},v.componentDidMount=function(){var a=this.props,l=a.direction,c=a.initialScrollOffset,f=a.layout;if(typeof c=="number"&&this._outerRef!=null){var x=this._outerRef;l==="horizontal"||f==="horizontal"?x.scrollLeft=c:x.scrollTop=c}this._callPropsCallbacks()},v.componentDidUpdate=function(){var a=this.props,l=a.direction,c=a.layout,f=this.state,x=f.scrollOffset,y=f.scrollUpdateWasRequested;if(y&&this._outerRef!=null){var h=this._outerRef;if(l==="horizontal"||c==="horizontal")if(l==="rtl")switch(le()){case"negative":h.scrollLeft=-x;break;case"positive-ascending":h.scrollLeft=x;break;default:var A=h.clientWidth,D=h.scrollWidth;h.scrollLeft=D-A-x;break}else h.scrollLeft=x;else h.scrollTop=x}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&oe(this._resetIsScrollingTimeoutId)},v.render=function(){var a=this.props,l=a.children,c=a.className,f=a.direction,x=a.height,y=a.innerRef,h=a.innerElementType,A=a.innerTagName,D=a.itemCount,O=a.itemData,_=a.itemKey,L=_===void 0?ys:_,R=a.layout,fe=a.outerElementType,he=a.outerTagName,xe=a.style,ye=a.useIsScrolling,ge=a.width,B=this.state.isScrolling,q=f==="horizontal"||R==="horizontal",je=q?this._onScrollHorizontal:this._onScrollVertical,H=this._getRangeToRender(),Me=H[0],ve=H[1],Z=[];if(D>0)for(var E=Me;E<=ve;E++)Z.push(S.createElement(l,{data:O,key:L(E,O),index:E,isScrolling:ye?B:void 0,style:this._getItemStyle(E)}));var G=i(this.props,this._instanceProps);return S.createElement(fe||he||"div",{className:c,onScroll:je,ref:this._outerRefSetter,style:F({position:"relative",height:x,width:ge,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},xe)},S.createElement(h||A||"div",{children:Z,ref:y,style:{height:q?"100%":G,pointerEvents:B?"none":void 0,width:q?G:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var l=this._getRangeToRender(),c=l[0],f=l[1],x=l[2],y=l[3];this._callOnItemsRendered(c,f,x,y)}}if(typeof this.props.onScroll=="function"){var h=this.state,A=h.scrollDirection,D=h.scrollOffset,O=h.scrollUpdateWasRequested;this._callOnScroll(A,D,O)}},v._getRangeToRender=function(){var a=this.props,l=a.itemCount,c=a.overscanCount,f=this.state,x=f.isScrolling,y=f.scrollDirection,h=f.scrollOffset;if(l===0)return[0,0,0,0];var A=p(this.props,h,this._instanceProps),D=u(this.props,A,h,this._instanceProps),O=!x||y==="backward"?Math.max(1,c):1,_=!x||y==="forward"?Math.max(1,c):1;return[Math.max(0,A-O),Math.max(0,Math.min(l-1,D+_)),A,D]},g}(S.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var js=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Ms=gs({getItemOffset:function(t,n){var i=t.itemSize;return n*i},getItemSize:function(t,n){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var n=t.itemCount,i=t.itemSize;return i*n},getOffsetForIndexAndAlignment:function(t,n,i,o,m,p){var u=t.direction,d=t.height,I=t.itemCount,M=t.itemSize,T=t.layout,g=t.width,v=u==="horizontal"||T==="horizontal",N=v?g:d,a=Math.max(0,I*M-N),l=Math.min(a,n*M),c=Math.max(0,n*M-N+M+p);switch(i==="smart"&&(o>=c-N&&o<=l+N?i="auto":i="center"),i){case"start":return l;case"end":return c;case"center":{var f=Math.round(c+(l-c)/2);return f<Math.ceil(N/2)?0:f>a+Math.floor(N/2)?a:f}case"auto":default:return o>=c&&o<=l?o:o<c?c:l}},getStartIndexForOffset:function(t,n){var i=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(n/o)))},getStopIndexForStartIndex:function(t,n,i){var o=t.direction,m=t.height,p=t.itemCount,u=t.itemSize,d=t.layout,I=t.width,M=o==="horizontal"||d==="horizontal",T=n*u,g=M?I:m,v=Math.ceil((g+i-T)/u);return Math.max(0,Math.min(p-1,n+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function vs(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,i=e.startIndex,o=e.stopIndex;return!(i>n||o<t)}function Ns(e){for(var t=e.isItemLoaded,n=e.itemCount,i=e.minimumBatchSize,o=e.startIndex,m=e.stopIndex,p=[],u=null,d=null,I=o;I<=m;I++){var M=t(I);M?d!==null&&(p.push(u,d),u=d=null):(d=I,u===null&&(u=I))}if(d!==null){for(var T=Math.min(Math.max(d,u+i-1),n-1),g=d+1;g<=T&&!t(g);g++)d=g;p.push(u,d)}if(p.length)for(;p[1]-p[0]+1<i&&p[0]>0;){var v=p[0]-1;if(!t(v))p[0]=v;else break}return p}var Ts=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},As=function(){function e(t,n){for(var i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Ss=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)},ce=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},Ds=function(e){Ss(t,e);function t(){var n,i,o,m;Ts(this,t);for(var p=arguments.length,u=Array(p),d=0;d<p;d++)u[d]=arguments[d];return m=(i=(o=ce(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(u))),o),o._lastRenderedStartIndex=-1,o._lastRenderedStopIndex=-1,o._memoizedUnloadedRanges=[],o._onItemsRendered=function(I){var M=I.visibleStartIndex,T=I.visibleStopIndex;o._lastRenderedStartIndex=M,o._lastRenderedStopIndex=T,o._ensureRowsLoaded(M,T)},o._setRef=function(I){o._listRef=I},i),ce(o,m)}return As(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,o){var m=this.props,p=m.isItemLoaded,u=m.itemCount,d=m.minimumBatchSize,I=d===void 0?10:d,M=m.threshold,T=M===void 0?15:M,g=Ns({isItemLoaded:p,itemCount:u,minimumBatchSize:I,startIndex:Math.max(0,i-T),stopIndex:Math.min(u-1,o+T)});(this._memoizedUnloadedRanges.length!==g.length||this._memoizedUnloadedRanges.some(function(v,N){return g[N]!==v}))&&(this._memoizedUnloadedRanges=g,this._loadUnloadedRanges(g))}},{key:"_loadUnloadedRanges",value:function(i){for(var o=this,m=this.props.loadMoreItems||this.props.loadMoreRows,p=function(I){var M=i[I],T=i[I+1],g=m(M,T);g!=null&&g.then(function(){if(vs({lastRenderedStartIndex:o._lastRenderedStartIndex,lastRenderedStopIndex:o._lastRenderedStopIndex,startIndex:M,stopIndex:T})){if(o._listRef==null)return;typeof o._listRef.resetAfterIndex=="function"?o._listRef.resetAfterIndex(M,!0):(typeof o._listRef._getItemStyleCache=="function"&&o._listRef._getItemStyleCache(-1),o._listRef.forceUpdate())}})},u=0;u<i.length;u+=2)p(u)}}]),t}(S.PureComponent);const zs=r.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Os=r.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),_s=r.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),ks=r.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Cs=r.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),bs=r.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),ws=r.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Es=()=>r.i1,Ls=r.styled_default(Es())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),Rs=({rank:e,avatar:t,name:n,points:i,isCurrentUser:o,openItemDetail:m,style:p})=>s.jsxs(zs,{onClick:m,style:p,children:[s.jsx(Os,{children:e||0}),s.jsxs(Cs,{children:[t?s.jsx(_s,{alt:"leaderboard-item-avatar",src:t}):s.jsx(ks,{children:C.o(n||"")}),s.jsxs(bs,{children:[s.jsx(ws,{children:n||""}),o&&s.jsx(Ls,{name:"icon-star"})]})]}),s.jsx("div",{children:C.i(i)})]}),$s=r.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),Qs=({items:e,currentUserId:t,openItemDetail:n,fetchMore:i})=>s.jsx(z.AutoSizer,{children:({width:o,height:m})=>s.jsx(Ds,{isItemLoaded:p=>p<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:p,ref:u})=>s.jsx($s,{children:s.jsx(Ms,{itemSize:56,onItemsRendered:p,ref:u,itemCount:e.length,width:o,height:m,children:({index:d,style:I})=>s.jsx(Rs,{style:{...I,maxHeight:48},...e[d],openItemDetail:()=>n(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})})}),Us=({deepLink:e})=>{const{data:t}=k.useStore(e.$store);return s.jsx(z.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."})},qs=({gamification:e})=>{const{data:t}=k.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(Qs,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Us,{deepLink:e.deepLink})},Ps=r.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),Ys=r.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),Ws=r.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),Fs=r.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),Vs=()=>r.i1,Q=r.styled_default(Vs())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),Bs=()=>r.i1,Hs=r.styled_default(Bs())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),Zs=r.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),Gs=r.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),Js=r.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),Ks={[j.PickHistoryStatus.LOST]:s.jsx(Q,{name:"icon-cross"}),[j.PickHistoryStatus.WON]:s.jsx(Q,{name:"icon-check"}),[j.PickHistoryStatus.UNSET]:s.jsx(Q,{name:"icon-arrow"}),[j.PickHistoryStatus.DNP]:s.jsx(Q,{name:"icon-arrow"})},Xs=({questionId:e,questionType:t,questionStatus:n,subject:i,openForVoting:o,openQuestion:m,status:p})=>{const u=z.o[t],d=Ks[p];return u?s.jsxs(Ps,{onClick:()=>m==null?void 0:m(e),children:[s.jsxs(Gs,{children:[s.jsxs(Ys,{children:[s.jsx(Hs,{name:u.iconName}),s.jsxs(Zs,{children:[u.label,t===j.QuestionType.TRIVIA&&n===j.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Ws,{children:i||""})]}),s.jsx(Fs,{children:o?s.jsx(Js,{children:"Play"}):d})]}):null},en=r.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),tn=r.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),sn=({openInsight:e,questionId:t,...n})=>s.jsxs(en,{children:[s.jsx(Ie,{questionId:t,...n}),e&&s.jsx(tn,{onClick:()=>e(t),children:"View Insight"})]}),nn=r.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),rn=({questions:e,openQuestion:t})=>s.jsx(nn,{children:e==null?void 0:e.map(n=>{var i,o;if(n.type==="question"&&((i=n.attributes)==null?void 0:i.attributes.case)==="question"){const m=n.attributes.attributes.value;return s.jsx(Xs,{openQuestion:t,...m},m.questionId)}if(n.type==="insight"&&((o=n.attributes)==null?void 0:o.attributes.case)==="insight"){const m=n.attributes.attributes.value;return s.jsx(sn,{openInsight:t,...m},m.questionId)}return null})}),on=({store:e,openQuestion:t})=>{const n=k.useStore(e);return n!=null&&n.data?s.jsx(rn,{openQuestion:t,questions:n.data}):s.jsx("div",{children:"wait questions..."})},an=({userSummary:e})=>{var t,n;const i=k.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(pe,{...i.data.summary,successRate:(n=i.data.percentage)==null?void 0:n.correct}):s.jsx("div",{children:"wait user..."})},ln=({gamification:e})=>{const[t,n]=S.useState(U.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(z.a,{style:{paddingBottom:"4px"},children:s.jsx(us,{activePage:t,toggleActivePage:n})}),t===U.HOME&&s.jsxs(z.r,{children:[s.jsx(z.a,{style:{paddingTop:"12px"},children:s.jsx(an,{userSummary:e.userSummary})}),s.jsx(z.n,{children:s.jsx(on,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===U.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(qs,{gamification:e})})]})},cn=()=>z.d,de=r.styled_default(cn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),dn=r.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),un=({correct:e,incorrect:t})=>{const n=e+t;return n===0?0:Math.round(e/n*100)},pn=({gamification:e,className:t})=>{const n=k.useStore(e.openedQuestion.$store),i=k.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[n&&s.jsx(de,{className:t,children:s.jsx(os,{gamification:e})}),i&&s.jsx(de,{className:t,children:s.jsxs(dn,{children:[s.jsx(ue,{label:"Friend's Rank",close:e.closeUser}),s.jsx(z.a,{children:s.jsx(pe,{...i,successRate:un(i)})})]})}),s.jsx(z.r,{className:t,"data-nav":"true",children:s.jsx(ln,{gamification:e})})]})};exports.default=pn;
@@ -1,6 +1,6 @@
1
- "use strict";const n=require("react/jsx-runtime"),ae=require("./index2.js"),T=require("react"),U=require("@streamlayer/sdk-web-types"),X=require("@nanostores/react"),de=require("@streamlayer/sdk-web-interfaces"),d=require("./index3.js"),fe=require("@streamlayer/sdk-web-notifications"),zt=require("@lottiefiles/react-lottie-player"),Ot=({feature:o,sdk:a,children:c,className:h})=>{const y=X.useStore(o.status),m=X.useStore(a.sdkStore.slStreamId);return m!=null&&m.loading?n.jsx("div",{className:h,children:"event is loading..."}):m!=null&&m.data?y!==de.FeatureStatus.Ready?n.jsx("div",{className:h,children:"wait feature..."}):c:n.jsx("div",{className:h,children:"event is forbidden..."})},Dt=T.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature.js"))),Pt=({sdk:o,feature:a,className:c})=>{const h=T.useMemo(()=>a&&a.featureConfig.get().type===U.FeatureType.GAMES?n.jsx(Ot,{className:c,sdk:o,feature:a,children:n.jsx(Dt,{className:c,gamification:a,sdk:o})}):null,[o,a,c]);return n.jsx(T.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:h})},qt=d.styled_default("button")({name:"SButton",class:"sxxa0c",propsAsIs:!1}),Mt=d.styled_default("span")({name:"ButtonIcon",class:"b193dcyu",propsAsIs:!1}),Gt=d.styled_default("span")({name:"ButtonLabel",class:"b40tuix",propsAsIs:!1}),$e=({disabled:o,active:a,onClick:c,label:h,icon:y})=>n.jsx(qt,{onClick:c,disabled:o,"data-selected":a,children:n.jsxs(n.Fragment,{children:[y&&n.jsx(Mt,{children:y}),n.jsx(Gt,{children:h})]})}),Wt=()=>d.i1,Ht=d.styled_default(Wt())({name:"ButtonIcon",class:"b1whzxvd",propsAsIs:!0}),le="channels",Qt=o=>{var a;return n.jsx($e,{...o,id:"channels",label:"Channels",icon:n.jsx(Ht,{name:"icon-btn-channels","data-selected":(a=o.active)==null?void 0:a.toString()})})},Yt=()=>d.i1,Vt=d.styled_default(Yt())({name:"ButtonIcon",class:"b11des7c",propsAsIs:!0}),J="featuredGroups",Kt=o=>{var a;return n.jsx($e,{...o,label:"FG+",id:"featuredGroups",icon:n.jsx(Vt,{name:"icon-btn-feature-groups","data-selected":(a=o.active)==null?void 0:a.toString()})})},Xt=()=>d.i1,Jt=d.styled_default(Xt())({name:"ButtonIcon",class:"b180jd7l",propsAsIs:!0}),xe="leaderboard",Zt=o=>{var a;return n.jsx($e,{...o,label:"Leader Board",id:"leaderboard",icon:n.jsx(Jt,{name:"icon-btn-leaderboard","data-selected":(a=o.active)==null?void 0:a.toString()})})},ei=d.styled_default("div")({name:"Buttons",class:"b6tbwuy",propsAsIs:!1}),ti=({children:o,className:a})=>n.jsx(ei,{className:a,children:o}),ii=()=>ti,ri=d.styled_default(ii())({name:"Navigation",class:"n19lpak2",propsAsIs:!0}),ni=({activeOverlay:o,setActiveOverlay:a,sdkReady:c,className:h})=>n.jsxs(ri,{className:h,children:[n.jsx(Qt,{active:o===le,onClick:()=>a(le)}),n.jsx(Kt,{active:o===J,disabled:!c,onClick:()=>{a(J)}}),n.jsx(Zt,{active:o===xe,onClick:()=>a(xe)})]}),lt={[U.QuestionType.TWEET]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.PROMOTION]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.UNSET]:void 0,[U.QuestionType.FACTOID]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.POLL]:{label:"Poll",iconName:"icon-poll"},[U.QuestionType.TRIVIA]:{label:"Trivia",iconName:"icon-trivia"},[U.QuestionType.PREDICTION]:{label:"Prediction",iconName:"icon-prediction"}},si=d.styled_default("div")({name:"Container",class:"c1bgb86j",propsAsIs:!1}),oi=d.styled_default("video")({name:"Player",class:"p6703cq",propsAsIs:!1}),ai=d.styled_default("img")({name:"Poster",class:"p12ow7zo",propsAsIs:!1}),li=d.styled_default("div")({name:"Control",class:"cdpal9o",propsAsIs:!1}),ct=({poster:o,source:a})=>{const c=T.useRef(null),[h,y]=T.useState(!1),[m,f]=T.useState(!0);return n.jsxs(si,{onClick:()=>{const s=c==null?void 0:c.current;s&&y(g=>g?(s.pause(),!1):(s.play(),f(!1),!0))},children:[n.jsx(oi,{ref:c,src:a,onEnded:()=>{var s;(s=c==null?void 0:c.current)==null||s.load(),y(!1),f(!0)},style:{visibility:m?"hidden":"visible"}}),n.jsx(ai,{src:o,style:{visibility:m?"visible":"hidden"}}),n.jsx(li,{children:!h&&n.jsx(d.i1,{name:"icon-play"})})]})},ci=d.styled_default("div")({name:"InsightContainer",class:"i1pqqgpo",propsAsIs:!1}),ui=d.styled_default("div")({name:"InsightContent",class:"igj7luu",propsAsIs:!1}),di=d.styled_default("h3")({name:"Title",class:"t1qne9g6",propsAsIs:!1}),hi=d.styled_default("div")({name:"Description",class:"dtpr98r",propsAsIs:!1}),pi=d.styled_default("button")({name:"ActionBtn",class:"a17iaqp8",propsAsIs:!1}),fi=({video:o,heading:a,body:c,action:h})=>n.jsxs(ci,{children:[(o==null?void 0:o.url)&&n.jsx(ct,{source:o.url,poster:o.thumbnailUrl}),n.jsxs(ui,{children:[n.jsx(di,{children:a}),n.jsx(hi,{children:c}),h&&n.jsx(pi,{onClick:h,children:"View Insight"})]})]}),ie=d.styled_default("div")({name:"BGWrap",class:"b1dqe0sz",propsAsIs:!1}),O=d.styled_default("div")({name:"BGLineBase",class:"b1v6w7ni",propsAsIs:!1}),yi=()=>O,mi=d.styled_default(yi())({name:"BGOneLineOne",class:"b2nqb1p",propsAsIs:!0}),xi=()=>O,gi=d.styled_default(xi())({name:"BGOneLineTwo",class:"b1xxgmbk",propsAsIs:!0}),wi=()=>O,_i=d.styled_default(wi())({name:"BGOneLineThree",class:"b63lwcb",propsAsIs:!0}),Ii=()=>O,Ye=d.styled_default(Ii())({name:"BGTwoLineOne",class:"b2iah4",propsAsIs:!0}),Ai=()=>O,Ve=d.styled_default(Ai())({name:"BGTwoLineTwo",class:"b1xezvf6",propsAsIs:!0}),bi=()=>O,Ke=d.styled_default(bi())({name:"BGTwoLineThree",class:"b1jz1hg0",propsAsIs:!0}),Ei=()=>O,Xe=d.styled_default(Ei())({name:"BGThreeLineOne",class:"b18ho1tk",propsAsIs:!0}),Bi=()=>O,Je=d.styled_default(Bi())({name:"BGThreeLineTwo",class:"b14uvjfm",propsAsIs:!0}),ji=()=>O,Ze=d.styled_default(ji())({name:"BGThreeLineThree",class:"b11c3ns7",propsAsIs:!0}),vi=()=>O,et=d.styled_default(vi())({name:"BGThreeLineFour",class:"b1bqhhet",propsAsIs:!0}),Ti=()=>O,Ci=d.styled_default(Ti())({name:"BGFourLineOne",class:"b1xyzi7o",propsAsIs:!0}),Fi=()=>O,Si=d.styled_default(Fi())({name:"BGFourLineTwo",class:"byo0rup",propsAsIs:!0}),$i=()=>O,ki=d.styled_default($i())({name:"BGFourLineThree",class:"b1oyiqgv",propsAsIs:!0}),Li=()=>O,Ni=d.styled_default(Li())({name:"BGFourLineFour",class:"bx3ddqw",propsAsIs:!0}),Ri=({step:o,correct:a})=>n.jsxs(n.Fragment,{children:[n.jsxs(ie,{"data-active":o===1,"data-first-screen":"true",children:[n.jsx(mi,{}),n.jsx(gi,{}),n.jsx(_i,{})]}),n.jsxs(ie,{"data-active":o===2,children:[n.jsx(Ye,{}),n.jsx(Ve,{}),n.jsx(Ke,{})]}),n.jsxs(ie,{"data-active":o===3,children:[n.jsx(Ye,{}),n.jsx(Ve,{}),n.jsx(Ke,{})]}),a?n.jsxs(n.Fragment,{children:[n.jsxs(ie,{"data-active":o===4,"data-correct":"false",children:[n.jsx(Xe,{}),n.jsx(Je,{}),n.jsx(Ze,{}),n.jsx(et,{})]}),n.jsxs(ie,{"data-active":o===5,"data-correct":"false","data-last-screen":"true",children:[n.jsx(Xe,{}),n.jsx(Je,{}),n.jsx(Ze,{}),n.jsx(et,{})]})]}):n.jsxs(ie,{"data-active":o===4,"data-correct":"false","data-last-screen":"true",children:[n.jsx(Ci,{}),n.jsx(Si,{}),n.jsx(ki,{}),n.jsx(Ni,{})]})]}),Ui=d.styled_default("div")({name:"Container",class:"c10131zw",propsAsIs:!1}),zi=d.styled_default("div")({name:"AnimateContent",class:"ar6k2eo",propsAsIs:!1}),re=d.styled_default("div")({name:"Content",class:"c1hwoq9l",propsAsIs:!1}),ne=d.styled_default("div")({name:"Title",class:"t4ujo4g",propsAsIs:!1}),he=d.styled_default("div")({name:"Subtitle",class:"s1pjil1h",propsAsIs:!1}),Oi=()=>he,tt=d.styled_default(Oi())({name:"SubtitleFG",class:"s1iorwr9",propsAsIs:!0}),ye=d.styled_default("div")({name:"AnswerText",class:"a51sv9d",propsAsIs:!1}),Di=()=>d.i1,Ae=d.styled_default(Di())({name:"FeedbackIcon",class:"f1lbk2ye",propsAsIs:!0}),it=d.styled_default("button")({name:"CloseButton",class:"crcvk3t",propsAsIs:!1}),Pi=()=>d.i1,rt=d.styled_default(Pi())({name:"CloseIcon",class:"c33p82r",propsAsIs:!0}),qi=({close:o,votedAnswer:a,correct:c,correctAnswerTitle:h})=>{const[y,m]=T.useState(1);return T.useEffect(()=>{const f=setInterval(()=>{m(s=>c&&s>4||!c&&s>3?s:++s)},6e3);return()=>clearInterval(f)},[c]),n.jsxs(Ui,{"data-bg-color-white":y>3,children:[n.jsx(Ri,{step:y,correct:c}),n.jsxs(zi,{"data-active-number":y,children:[n.jsxs(re,{children:[n.jsx(ne,{children:"Master"}),n.jsx(tt,{children:"FEATURED GROUPS +"})]}),n.jsxs(re,{children:[n.jsx(ne,{children:"Prediction results are in!"}),n.jsx(tt,{children:"FEATURED GROUPS +"})]}),n.jsxs(re,{children:[n.jsx(ne,{children:"Who holds the most birdies in golf?"}),n.jsxs(he,{children:["Your Pick: ",n.jsx(ye,{children:a==null?void 0:a.title})]})]}),c?n.jsxs(n.Fragment,{children:[n.jsxs(re,{"data-color-green":"true",children:[n.jsx(ne,{children:"Congratulations! You answered correctly."}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(ye,{children:a==null?void 0:a.title})]})]}),n.jsxs(re,{"data-color-green":"true",children:[n.jsx(it,{onClick:o,children:n.jsx(rt,{name:"icon-cross"})}),n.jsxs(ne,{children:["+",a==null?void 0:a.points," points"]}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(ye,{children:a==null?void 0:a.title})]})]})]}):n.jsxs(re,{children:[n.jsx(it,{onClick:o,children:n.jsx(rt,{name:"icon-cross"})}),n.jsxs(ne,{"data-incorrect":"true",children:["Better luck next time! Correct: ",h,"."]}),n.jsxs(he,{"data-incorrect":"true",children:[n.jsx(Ae,{name:"circleClose"}),"Your Pick: ",n.jsx(ye,{children:a==null?void 0:a.title})]})]})]})]})},Mi=d.styled_default("div")({name:"Container",class:"c1eptrjd",propsAsIs:!1}),Gi=d.styled_default("div")({name:"CloseIconWrap",class:"crylm65",propsAsIs:!1}),Wi=()=>d.i1,Hi=d.styled_default(Wi())({name:"CloseIcon",class:"c9mrcz7",propsAsIs:!0}),Qi=d.styled_default("div")({name:"Header",class:"hw3lzv4",propsAsIs:!1}),Yi=()=>d.i1,Vi=d.styled_default(Yi())({name:"TypeIcon",class:"t1rrb3kf",propsAsIs:!0}),Ki=d.styled_default("span")({name:"TypeName",class:"t1ydnjov",propsAsIs:!1}),Xi=d.styled_default("div")({name:"Question",class:"qlf90cl",propsAsIs:!1}),Ji=d.styled_default("button")({name:"AnswerButton",class:"a1e0nhcl",propsAsIs:!1}),Zi=d.styled_default("div")({name:"Container",class:"cjq447q",propsAsIs:!1}),er=d.styled_default("div")({name:"ImageContainer",class:"i14egogb",propsAsIs:!1}),tr=d.styled_default("img")({name:"Image",class:"i2g9g4l",propsAsIs:!1}),ir=d.styled_default("div")({name:"Details",class:"d1c454nm",propsAsIs:!1}),rr=d.styled_default("div")({name:"Name",class:"n11nigc3",propsAsIs:!1}),nr=d.styled_default("div")({name:"UserName",class:"urxa4k8",propsAsIs:!1}),sr=({image:o,name:a,userName:c,verified:h})=>n.jsxs(Zi,{children:[n.jsx(er,{children:n.jsx(tr,{src:o})}),n.jsxs(ir,{children:[n.jsxs(rr,{children:[a," ",h&&n.jsx(d.i1,{name:"icon-twitter-verified"})]}),n.jsx(nr,{children:c})]})]}),or=d.styled_default("div")({name:"Container",class:"c1t4f0x4",propsAsIs:!1}),ar=d.styled_default("button")({name:"ActionBtn",class:"a16w1nl6",propsAsIs:!1}),lr=d.styled_default("div")({name:"Body",class:"b14u54rf",propsAsIs:!1}),cr=d.styled_default("img")({name:"Image",class:"i1hxm6zo",propsAsIs:!1}),ur=d.styled_default("div")({name:"Details",class:"d1s19yop",propsAsIs:!1}),dr=d.styled_default("div")({name:"QuoteWrap",class:"q1qyx94r",propsAsIs:!1}),hr=d.styled_default("blockquote")({name:"Quote",class:"qs97clu",propsAsIs:!1}),pr=({account:o,body:a,image:c,title:h,action:y})=>n.jsxs(or,{children:[n.jsx(dr,{children:n.jsx(hr,{children:h})}),n.jsxs(ur,{children:[n.jsx(sr,{...o}),n.jsx(lr,{children:a}),c&&n.jsx(cr,{src:c})]}),y&&n.jsx(ar,{onClick:y,children:"View Tweet"})]}),nt=({close:o,action:a,data:{questionType:c,question:h,insight:y,tweet:m}})=>{const f=lt[c];return f?h!=null&&h.predictionResult?n.jsx(qi,{close:o,...h}):n.jsxs(Mi,{children:[n.jsx(Gi,{onClick:o,children:n.jsx(Hi,{name:"icon-cross"})}),c!==U.QuestionType.TWEET&&n.jsxs(Qi,{children:[n.jsx(Vi,{name:f.iconName}),n.jsx(Ki,{children:f.label})]}),c===U.QuestionType.FACTOID&&n.jsx(fi,{...y,action:a}),c===U.QuestionType.TWEET&&n.jsx(pr,{...m,action:a}),c!==U.QuestionType.FACTOID&&c!==U.QuestionType.TWEET&&n.jsxs(n.Fragment,{children:[n.jsx(Xi,{children:h==null?void 0:h.title}),n.jsx(Ji,{onClick:a,children:"Answer"})]})]}):null};var ut={},dt={},ge={};ge.byteLength=mr;ge.toByteArray=gr;ge.fromByteArray=Ir;var H=[],P=[],fr=typeof Uint8Array<"u"?Uint8Array:Array,be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var se=0,yr=be.length;se<yr;++se)H[se]=be[se],P[be.charCodeAt(se)]=se;P["-".charCodeAt(0)]=62;P["_".charCodeAt(0)]=63;function ht(o){var a=o.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=o.indexOf("=");c===-1&&(c=a);var h=c===a?0:4-c%4;return[c,h]}function mr(o){var a=ht(o),c=a[0],h=a[1];return(c+h)*3/4-h}function xr(o,a,c){return(a+c)*3/4-c}function gr(o){var a,c=ht(o),h=c[0],y=c[1],m=new fr(xr(o,h,y)),f=0,s=y>0?h-4:h,g;for(g=0;g<s;g+=4)a=P[o.charCodeAt(g)]<<18|P[o.charCodeAt(g+1)]<<12|P[o.charCodeAt(g+2)]<<6|P[o.charCodeAt(g+3)],m[f++]=a>>16&255,m[f++]=a>>8&255,m[f++]=a&255;return y===2&&(a=P[o.charCodeAt(g)]<<2|P[o.charCodeAt(g+1)]>>4,m[f++]=a&255),y===1&&(a=P[o.charCodeAt(g)]<<10|P[o.charCodeAt(g+1)]<<4|P[o.charCodeAt(g+2)]>>2,m[f++]=a>>8&255,m[f++]=a&255),m}function wr(o){return H[o>>18&63]+H[o>>12&63]+H[o>>6&63]+H[o&63]}function _r(o,a,c){for(var h,y=[],m=a;m<c;m+=3)h=(o[m]<<16&16711680)+(o[m+1]<<8&65280)+(o[m+2]&255),y.push(wr(h));return y.join("")}function Ir(o){for(var a,c=o.length,h=c%3,y=[],m=16383,f=0,s=c-h;f<s;f+=m)y.push(_r(o,f,f+m>s?s:f+m));return h===1?(a=o[c-1],y.push(H[a>>2]+H[a<<4&63]+"==")):h===2&&(a=(o[c-2]<<8)+o[c-1],y.push(H[a>>10]+H[a>>4&63]+H[a<<2&63]+"=")),y.join("")}var ke={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ke.read=function(o,a,c,h,y){var m,f,s=y*8-h-1,g=(1<<s)-1,E=g>>1,A=-7,j=c?y-1:0,x=c?-1:1,w=o[a+j];for(j+=x,m=w&(1<<-A)-1,w>>=-A,A+=s;A>0;m=m*256+o[a+j],j+=x,A-=8);for(f=m&(1<<-A)-1,m>>=-A,A+=h;A>0;f=f*256+o[a+j],j+=x,A-=8);if(m===0)m=1-E;else{if(m===g)return f?NaN:(w?-1:1)*(1/0);f=f+Math.pow(2,h),m=m-E}return(w?-1:1)*f*Math.pow(2,m-h)};ke.write=function(o,a,c,h,y,m){var f,s,g,E=m*8-y-1,A=(1<<E)-1,j=A>>1,x=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=h?0:m-1,_=h?1:-1,b=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(s=isNaN(a)?1:0,f=A):(f=Math.floor(Math.log(a)/Math.LN2),a*(g=Math.pow(2,-f))<1&&(f--,g*=2),f+j>=1?a+=x/g:a+=x*Math.pow(2,1-j),a*g>=2&&(f++,g/=2),f+j>=A?(s=0,f=A):f+j>=1?(s=(a*g-1)*Math.pow(2,y),f=f+j):(s=a*Math.pow(2,j-1)*Math.pow(2,y),f=0));y>=8;o[c+w]=s&255,w+=_,s/=256,y-=8);for(f=f<<y|s,E+=y;E>0;o[c+w]=f&255,w+=_,f/=256,E-=8);o[c+w-_]|=b*128};/*!
1
+ "use strict";const n=require("react/jsx-runtime"),ae=require("./index2.js"),T=require("react"),U=require("@streamlayer/sdk-web-types"),X=require("@nanostores/react"),de=require("@streamlayer/sdk-web-interfaces"),d=require("./index3.js"),fe=require("@streamlayer/sdk-web-notifications"),Ut=require("@lottiefiles/react-lottie-player"),zt=({feature:o,sdk:a,children:c,className:h})=>{const y=X.useStore(o.status),m=X.useStore(a.sdkStore.slStreamId);return m!=null&&m.loading?n.jsx("div",{className:h,children:"event is loading..."}):m!=null&&m.data?y!==de.FeatureStatus.Ready?n.jsx("div",{className:h,children:"wait feature..."}):c:n.jsx("div",{className:h,children:"event is forbidden..."})},Ot=T.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature.js"))),Dt=({sdk:o,feature:a,className:c})=>{const h=T.useMemo(()=>a&&a.featureConfig.get().type===U.FeatureType.GAMES?n.jsx(zt,{className:c,sdk:o,feature:a,children:n.jsx(Ot,{className:c,gamification:a,sdk:o})}):null,[o,a,c]);return n.jsx(T.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:h})},Pt=d.styled_default("button")({name:"SButton",class:"sxxa0c",propsAsIs:!1}),qt=d.styled_default("span")({name:"ButtonIcon",class:"b193dcyu",propsAsIs:!1}),Mt=d.styled_default("span")({name:"ButtonLabel",class:"b40tuix",propsAsIs:!1}),$e=({disabled:o,active:a,onClick:c,label:h,icon:y})=>n.jsx(Pt,{onClick:c,disabled:o,"data-selected":a,children:n.jsxs(n.Fragment,{children:[y&&n.jsx(qt,{children:y}),n.jsx(Mt,{children:h})]})}),Gt=()=>d.i1,Wt=d.styled_default(Gt())({name:"ButtonIcon",class:"b1whzxvd",propsAsIs:!0}),le="channels",Ht=o=>{var a;return n.jsx($e,{...o,id:"channels",label:"Channels",icon:n.jsx(Wt,{name:"icon-btn-channels","data-selected":(a=o.active)==null?void 0:a.toString()})})},Qt=()=>d.i1,Yt=d.styled_default(Qt())({name:"ButtonIcon",class:"b11des7c",propsAsIs:!0}),J="featuredGroups",Vt=o=>{var a;return n.jsx($e,{...o,label:"FG+",id:"featuredGroups",icon:n.jsx(Yt,{name:"icon-btn-feature-groups","data-selected":(a=o.active)==null?void 0:a.toString()})})},Kt=()=>d.i1,Xt=d.styled_default(Kt())({name:"ButtonIcon",class:"b180jd7l",propsAsIs:!0}),xe="leaderboard",Jt=o=>{var a;return n.jsx($e,{...o,label:"Leader Board",id:"leaderboard",icon:n.jsx(Xt,{name:"icon-btn-leaderboard","data-selected":(a=o.active)==null?void 0:a.toString()})})},Zt=d.styled_default("div")({name:"Buttons",class:"b6tbwuy",propsAsIs:!1}),ei=({children:o,className:a})=>n.jsx(Zt,{className:a,children:o}),ti=()=>ei,ii=d.styled_default(ti())({name:"Navigation",class:"n19lpak2",propsAsIs:!0}),ri=({activeOverlay:o,setActiveOverlay:a,sdkReady:c,className:h})=>n.jsxs(ii,{className:h,children:[n.jsx(Ht,{active:o===le,onClick:()=>a(le)}),n.jsx(Vt,{active:o===J,disabled:!c,onClick:()=>{a(J)}}),n.jsx(Jt,{active:o===xe,onClick:()=>a(xe)})]}),lt={[U.QuestionType.TWEET]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.PROMOTION]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.UNSET]:void 0,[U.QuestionType.FACTOID]:{label:"Insight",iconName:"icon-insight"},[U.QuestionType.POLL]:{label:"Poll",iconName:"icon-poll"},[U.QuestionType.TRIVIA]:{label:"Trivia",iconName:"icon-trivia"},[U.QuestionType.PREDICTION]:{label:"Prediction",iconName:"icon-prediction"}},ni=d.styled_default("div")({name:"Container",class:"c1bgb86j",propsAsIs:!1}),si=d.styled_default("video")({name:"Player",class:"p6703cq",propsAsIs:!1}),oi=d.styled_default("img")({name:"Poster",class:"p12ow7zo",propsAsIs:!1}),ai=d.styled_default("div")({name:"Control",class:"cdpal9o",propsAsIs:!1}),ct=({poster:o,source:a})=>{const c=T.useRef(null),[h,y]=T.useState(!1),[m,f]=T.useState(!0);return n.jsxs(ni,{onClick:()=>{const s=c==null?void 0:c.current;s&&y(g=>g?(s.pause(),!1):(s.play(),f(!1),!0))},children:[n.jsx(si,{ref:c,src:a,onEnded:()=>{var s;(s=c==null?void 0:c.current)==null||s.load(),y(!1),f(!0)},style:{visibility:m?"hidden":"visible"}}),n.jsx(oi,{src:o,style:{visibility:m?"visible":"hidden"}}),n.jsx(ai,{children:!h&&n.jsx(d.i1,{name:"icon-play"})})]})},li=d.styled_default("div")({name:"InsightContainer",class:"i1pqqgpo",propsAsIs:!1}),ci=d.styled_default("div")({name:"InsightContent",class:"igj7luu",propsAsIs:!1}),ui=d.styled_default("h3")({name:"Title",class:"t1qne9g6",propsAsIs:!1}),di=d.styled_default("div")({name:"Description",class:"dtpr98r",propsAsIs:!1}),hi=d.styled_default("button")({name:"ActionBtn",class:"a17iaqp8",propsAsIs:!1}),pi=({video:o,heading:a,body:c,action:h})=>n.jsxs(li,{children:[(o==null?void 0:o.url)&&n.jsx(ct,{source:o.url,poster:o.thumbnailUrl}),n.jsxs(ci,{children:[n.jsx(ui,{children:a}),n.jsx(di,{children:c}),h&&n.jsx(hi,{onClick:h,children:"View Insight"})]})]}),ie=d.styled_default("div")({name:"BGWrap",class:"b1dqe0sz",propsAsIs:!1}),O=d.styled_default("div")({name:"BGLineBase",class:"b1v6w7ni",propsAsIs:!1}),fi=()=>O,yi=d.styled_default(fi())({name:"BGOneLineOne",class:"b2nqb1p",propsAsIs:!0}),mi=()=>O,xi=d.styled_default(mi())({name:"BGOneLineTwo",class:"b1xxgmbk",propsAsIs:!0}),gi=()=>O,wi=d.styled_default(gi())({name:"BGOneLineThree",class:"b63lwcb",propsAsIs:!0}),_i=()=>O,Ye=d.styled_default(_i())({name:"BGTwoLineOne",class:"b2iah4",propsAsIs:!0}),Ii=()=>O,Ve=d.styled_default(Ii())({name:"BGTwoLineTwo",class:"b1xezvf6",propsAsIs:!0}),Ai=()=>O,Ke=d.styled_default(Ai())({name:"BGTwoLineThree",class:"b1jz1hg0",propsAsIs:!0}),bi=()=>O,Xe=d.styled_default(bi())({name:"BGThreeLineOne",class:"b18ho1tk",propsAsIs:!0}),Ei=()=>O,Je=d.styled_default(Ei())({name:"BGThreeLineTwo",class:"b14uvjfm",propsAsIs:!0}),Bi=()=>O,Ze=d.styled_default(Bi())({name:"BGThreeLineThree",class:"b11c3ns7",propsAsIs:!0}),ji=()=>O,et=d.styled_default(ji())({name:"BGThreeLineFour",class:"b1bqhhet",propsAsIs:!0}),vi=()=>O,Ti=d.styled_default(vi())({name:"BGFourLineOne",class:"b1xyzi7o",propsAsIs:!0}),Ci=()=>O,Fi=d.styled_default(Ci())({name:"BGFourLineTwo",class:"byo0rup",propsAsIs:!0}),Si=()=>O,$i=d.styled_default(Si())({name:"BGFourLineThree",class:"b1oyiqgv",propsAsIs:!0}),ki=()=>O,Li=d.styled_default(ki())({name:"BGFourLineFour",class:"bx3ddqw",propsAsIs:!0}),Ni=({step:o,correct:a})=>n.jsxs(n.Fragment,{children:[n.jsxs(ie,{"data-active":o===1,"data-first-screen":"true",children:[n.jsx(yi,{}),n.jsx(xi,{}),n.jsx(wi,{})]}),n.jsxs(ie,{"data-active":o===2,children:[n.jsx(Ye,{}),n.jsx(Ve,{}),n.jsx(Ke,{})]}),n.jsxs(ie,{"data-active":o===3,children:[n.jsx(Ye,{}),n.jsx(Ve,{}),n.jsx(Ke,{})]}),a?n.jsxs(n.Fragment,{children:[n.jsxs(ie,{"data-active":o===4,"data-correct":"false",children:[n.jsx(Xe,{}),n.jsx(Je,{}),n.jsx(Ze,{}),n.jsx(et,{})]}),n.jsxs(ie,{"data-active":o===5,"data-correct":"false","data-last-screen":"true",children:[n.jsx(Xe,{}),n.jsx(Je,{}),n.jsx(Ze,{}),n.jsx(et,{})]})]}):n.jsxs(ie,{"data-active":o===4,"data-correct":"false","data-last-screen":"true",children:[n.jsx(Ti,{}),n.jsx(Fi,{}),n.jsx($i,{}),n.jsx(Li,{})]})]}),Ri=d.styled_default("div")({name:"Container",class:"c10131zw",propsAsIs:!1}),Ui=d.styled_default("div")({name:"AnimateContent",class:"ar6k2eo",propsAsIs:!1}),re=d.styled_default("div")({name:"Content",class:"c1hwoq9l",propsAsIs:!1}),ne=d.styled_default("div")({name:"Title",class:"t4ujo4g",propsAsIs:!1}),he=d.styled_default("div")({name:"Subtitle",class:"s1pjil1h",propsAsIs:!1}),zi=()=>he,tt=d.styled_default(zi())({name:"SubtitleFG",class:"s1iorwr9",propsAsIs:!0}),ye=d.styled_default("div")({name:"AnswerText",class:"a51sv9d",propsAsIs:!1}),Oi=()=>d.i1,Ae=d.styled_default(Oi())({name:"FeedbackIcon",class:"f1lbk2ye",propsAsIs:!0}),it=d.styled_default("button")({name:"CloseButton",class:"crcvk3t",propsAsIs:!1}),Di=()=>d.i1,rt=d.styled_default(Di())({name:"CloseIcon",class:"c33p82r",propsAsIs:!0}),Pi=({close:o,votedAnswer:a,correct:c,correctAnswerTitle:h})=>{const[y,m]=T.useState(1);return T.useEffect(()=>{const f=setInterval(()=>{m(s=>c&&s>4||!c&&s>3?s:++s)},6e3);return()=>clearInterval(f)},[c]),n.jsxs(Ri,{"data-bg-color-white":y>3,children:[n.jsx(Ni,{step:y,correct:c}),n.jsxs(Ui,{"data-active-number":y,children:[n.jsxs(re,{children:[n.jsx(ne,{children:"Master"}),n.jsx(tt,{children:"FEATURED GROUPS +"})]}),n.jsxs(re,{children:[n.jsx(ne,{children:"Prediction results are in!"}),n.jsx(tt,{children:"FEATURED GROUPS +"})]}),n.jsxs(re,{children:[n.jsx(ne,{children:"Who holds the most birdies in golf?"}),n.jsxs(he,{children:["Your Pick: ",n.jsx(ye,{children:a==null?void 0:a.title})]})]}),c?n.jsxs(n.Fragment,{children:[n.jsxs(re,{"data-color-green":"true",children:[n.jsx(ne,{children:"Congratulations! You answered correctly."}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(ye,{children:a==null?void 0:a.title})]})]}),n.jsxs(re,{"data-color-green":"true",children:[n.jsx(it,{onClick:o,children:n.jsx(rt,{name:"icon-cross"})}),n.jsxs(ne,{children:["+",a==null?void 0:a.points," points"]}),n.jsxs(he,{children:[n.jsx(Ae,{name:"selected"}),"Your Pick: ",n.jsx(ye,{children:a==null?void 0:a.title})]})]})]}):n.jsxs(re,{children:[n.jsx(it,{onClick:o,children:n.jsx(rt,{name:"icon-cross"})}),n.jsxs(ne,{"data-incorrect":"true",children:["Better luck next time! Correct: ",h,"."]}),n.jsxs(he,{"data-incorrect":"true",children:[n.jsx(Ae,{name:"circleClose"}),"Your Pick: ",n.jsx(ye,{children:a==null?void 0:a.title})]})]})]})]})},qi=d.styled_default("div")({name:"Container",class:"c1eptrjd",propsAsIs:!1}),Mi=d.styled_default("div")({name:"CloseIconWrap",class:"crylm65",propsAsIs:!1}),Gi=()=>d.i1,Wi=d.styled_default(Gi())({name:"CloseIcon",class:"c9mrcz7",propsAsIs:!0}),Hi=d.styled_default("div")({name:"Header",class:"hw3lzv4",propsAsIs:!1}),Qi=()=>d.i1,Yi=d.styled_default(Qi())({name:"TypeIcon",class:"t1rrb3kf",propsAsIs:!0}),Vi=d.styled_default("span")({name:"TypeName",class:"t1ydnjov",propsAsIs:!1}),Ki=d.styled_default("div")({name:"Question",class:"qlf90cl",propsAsIs:!1}),Xi=d.styled_default("button")({name:"AnswerButton",class:"a1e0nhcl",propsAsIs:!1}),Ji=d.styled_default("div")({name:"Container",class:"cjq447q",propsAsIs:!1}),Zi=d.styled_default("div")({name:"ImageContainer",class:"i14egogb",propsAsIs:!1}),er=d.styled_default("img")({name:"Image",class:"i2g9g4l",propsAsIs:!1}),tr=d.styled_default("div")({name:"Details",class:"d1c454nm",propsAsIs:!1}),ir=d.styled_default("div")({name:"Name",class:"n11nigc3",propsAsIs:!1}),rr=d.styled_default("div")({name:"UserName",class:"urxa4k8",propsAsIs:!1}),nr=({image:o,name:a,userName:c,verified:h})=>n.jsxs(Ji,{children:[n.jsx(Zi,{children:n.jsx(er,{src:o})}),n.jsxs(tr,{children:[n.jsxs(ir,{children:[a," ",h&&n.jsx(d.i1,{name:"icon-twitter-verified"})]}),n.jsx(rr,{children:c})]})]}),sr=d.styled_default("div")({name:"Container",class:"c1t4f0x4",propsAsIs:!1}),or=d.styled_default("button")({name:"ActionBtn",class:"a16w1nl6",propsAsIs:!1}),ar=d.styled_default("div")({name:"Body",class:"b14u54rf",propsAsIs:!1}),lr=d.styled_default("img")({name:"Image",class:"i1hxm6zo",propsAsIs:!1}),cr=d.styled_default("div")({name:"Details",class:"d1s19yop",propsAsIs:!1}),ur=d.styled_default("div")({name:"QuoteWrap",class:"q1qyx94r",propsAsIs:!1}),dr=d.styled_default("blockquote")({name:"Quote",class:"qs97clu",propsAsIs:!1}),hr=({account:o,body:a,image:c,title:h,action:y})=>n.jsxs(sr,{children:[n.jsx(ur,{children:n.jsx(dr,{children:h})}),n.jsxs(cr,{children:[n.jsx(nr,{...o}),n.jsx(ar,{children:a}),c&&n.jsx(lr,{src:c})]}),y&&n.jsx(or,{onClick:y,children:"View Tweet"})]}),nt=({close:o,action:a,data:{questionType:c,question:h,insight:y,tweet:m}})=>{const f=lt[c];return f?h!=null&&h.predictionResult?n.jsx(Pi,{close:o,...h}):n.jsxs(qi,{children:[n.jsx(Mi,{onClick:o,children:n.jsx(Wi,{name:"icon-cross"})}),c!==U.QuestionType.TWEET&&n.jsxs(Hi,{children:[n.jsx(Yi,{name:f.iconName}),n.jsx(Vi,{children:f.label})]}),c===U.QuestionType.FACTOID&&n.jsx(pi,{...y,action:a}),c===U.QuestionType.TWEET&&n.jsx(hr,{...m,action:a}),c!==U.QuestionType.FACTOID&&c!==U.QuestionType.TWEET&&n.jsxs(n.Fragment,{children:[n.jsx(Ki,{children:h==null?void 0:h.title}),n.jsx(Xi,{onClick:a,children:"Answer"})]})]}):null};var ut={},dt={},ge={};ge.byteLength=yr;ge.toByteArray=xr;ge.fromByteArray=_r;var H=[],P=[],pr=typeof Uint8Array<"u"?Uint8Array:Array,be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var se=0,fr=be.length;se<fr;++se)H[se]=be[se],P[be.charCodeAt(se)]=se;P["-".charCodeAt(0)]=62;P["_".charCodeAt(0)]=63;function ht(o){var a=o.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=o.indexOf("=");c===-1&&(c=a);var h=c===a?0:4-c%4;return[c,h]}function yr(o){var a=ht(o),c=a[0],h=a[1];return(c+h)*3/4-h}function mr(o,a,c){return(a+c)*3/4-c}function xr(o){var a,c=ht(o),h=c[0],y=c[1],m=new pr(mr(o,h,y)),f=0,s=y>0?h-4:h,g;for(g=0;g<s;g+=4)a=P[o.charCodeAt(g)]<<18|P[o.charCodeAt(g+1)]<<12|P[o.charCodeAt(g+2)]<<6|P[o.charCodeAt(g+3)],m[f++]=a>>16&255,m[f++]=a>>8&255,m[f++]=a&255;return y===2&&(a=P[o.charCodeAt(g)]<<2|P[o.charCodeAt(g+1)]>>4,m[f++]=a&255),y===1&&(a=P[o.charCodeAt(g)]<<10|P[o.charCodeAt(g+1)]<<4|P[o.charCodeAt(g+2)]>>2,m[f++]=a>>8&255,m[f++]=a&255),m}function gr(o){return H[o>>18&63]+H[o>>12&63]+H[o>>6&63]+H[o&63]}function wr(o,a,c){for(var h,y=[],m=a;m<c;m+=3)h=(o[m]<<16&16711680)+(o[m+1]<<8&65280)+(o[m+2]&255),y.push(gr(h));return y.join("")}function _r(o){for(var a,c=o.length,h=c%3,y=[],m=16383,f=0,s=c-h;f<s;f+=m)y.push(wr(o,f,f+m>s?s:f+m));return h===1?(a=o[c-1],y.push(H[a>>2]+H[a<<4&63]+"==")):h===2&&(a=(o[c-2]<<8)+o[c-1],y.push(H[a>>10]+H[a>>4&63]+H[a<<2&63]+"=")),y.join("")}var ke={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ke.read=function(o,a,c,h,y){var m,f,s=y*8-h-1,g=(1<<s)-1,E=g>>1,A=-7,j=c?y-1:0,x=c?-1:1,w=o[a+j];for(j+=x,m=w&(1<<-A)-1,w>>=-A,A+=s;A>0;m=m*256+o[a+j],j+=x,A-=8);for(f=m&(1<<-A)-1,m>>=-A,A+=h;A>0;f=f*256+o[a+j],j+=x,A-=8);if(m===0)m=1-E;else{if(m===g)return f?NaN:(w?-1:1)*(1/0);f=f+Math.pow(2,h),m=m-E}return(w?-1:1)*f*Math.pow(2,m-h)};ke.write=function(o,a,c,h,y,m){var f,s,g,E=m*8-y-1,A=(1<<E)-1,j=A>>1,x=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=h?0:m-1,_=h?1:-1,b=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(s=isNaN(a)?1:0,f=A):(f=Math.floor(Math.log(a)/Math.LN2),a*(g=Math.pow(2,-f))<1&&(f--,g*=2),f+j>=1?a+=x/g:a+=x*Math.pow(2,1-j),a*g>=2&&(f++,g/=2),f+j>=A?(s=0,f=A):f+j>=1?(s=(a*g-1)*Math.pow(2,y),f=f+j):(s=a*Math.pow(2,j-1)*Math.pow(2,y),f=0));y>=8;o[c+w]=s&255,w+=_,s/=256,y-=8);for(f=f<<y|s,E+=y;E>0;o[c+w]=f&255,w+=_,f/=256,E-=8);o[c+w-_]|=b*128};/*!
2
2
  * The buffer module from node.js, for the browser.
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */(function(o){const a=ge,c=ke,h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=s,o.SlowBuffer=C,o.INSPECT_MAX_BYTES=50;const y=2147483647;o.kMaxLength=y,s.TYPED_ARRAY_SUPPORT=m(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function m(){try{const i=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(i,e),i.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function f(i){if(i>y)throw new RangeError('The value "'+i+'" is invalid for option "size"');const e=new Uint8Array(i);return Object.setPrototypeOf(e,s.prototype),e}function s(i,e,t){if(typeof i=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return j(i)}return g(i,e,t)}s.poolSize=8192;function g(i,e,t){if(typeof i=="string")return x(i,e);if(ArrayBuffer.isView(i))return _(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(M(i,ArrayBuffer)||i&&M(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(M(i,SharedArrayBuffer)||i&&M(i.buffer,SharedArrayBuffer)))return b(i,e,t);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const r=i.valueOf&&i.valueOf();if(r!=null&&r!==i)return s.from(r,e,t);const l=L(i);if(l)return l;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return s.from(i[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}s.from=function(i,e,t){return g(i,e,t)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function E(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function A(i,e,t){return E(i),i<=0?f(i):e!==void 0?typeof t=="string"?f(i).fill(e,t):f(i).fill(e):f(i)}s.alloc=function(i,e,t){return A(i,e,t)};function j(i){return E(i),f(i<0?0:B(i)|0)}s.allocUnsafe=function(i){return j(i)},s.allocUnsafeSlow=function(i){return j(i)};function x(i,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=R(i,e)|0;let r=f(t);const l=r.write(i,e);return l!==t&&(r=r.slice(0,l)),r}function w(i){const e=i.length<0?0:B(i.length)|0,t=f(e);for(let r=0;r<e;r+=1)t[r]=i[r]&255;return t}function _(i){if(M(i,Uint8Array)){const e=new Uint8Array(i);return b(e.buffer,e.byteOffset,e.byteLength)}return w(i)}function b(i,e,t){if(e<0||i.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&t===void 0?r=new Uint8Array(i):t===void 0?r=new Uint8Array(i,e):r=new Uint8Array(i,e,t),Object.setPrototypeOf(r,s.prototype),r}function L(i){if(s.isBuffer(i)){const e=B(i.length)|0,t=f(e);return t.length===0||i.copy(t,0,0,e),t}if(i.length!==void 0)return typeof i.length!="number"||Ie(i.length)?f(0):w(i);if(i.type==="Buffer"&&Array.isArray(i.data))return w(i.data)}function B(i){if(i>=y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y.toString(16)+" bytes");return i|0}function C(i){return+i!=i&&(i=0),s.alloc(+i)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(M(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),M(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,l=t.length;for(let u=0,p=Math.min(r,l);u<p;++u)if(e[u]!==t[u]){r=e[u],l=t[u];break}return r<l?-1:l<r?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);let r;if(t===void 0)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const l=s.allocUnsafe(t);let u=0;for(r=0;r<e.length;++r){let p=e[r];if(M(p,Uint8Array))u+p.length>l.length?(s.isBuffer(p)||(p=s.from(p)),p.copy(l,u)):Uint8Array.prototype.set.call(l,p,u);else if(s.isBuffer(p))p.copy(l,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=p.length}return l};function R(i,e){if(s.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||M(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const t=i.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&t===0)return 0;let l=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return _e(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Qe(i).length;default:if(l)return r?-1:_e(i).length;e=(""+e).toLowerCase(),l=!0}}s.byteLength=R;function Q(i,e,t){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(i||(i="utf8");;)switch(i){case"hex":return Ct(this,e,t);case"utf8":case"utf-8":return ze(this,e,t);case"ascii":return vt(this,e,t);case"latin1":case"binary":return Tt(this,e,t);case"base64":return Bt(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ft(this,e,t);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function D(i,e,t){const r=i[e];i[e]=i[t],i[t]=r}s.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)D(this,t,t+1);return this},s.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)D(this,t,t+3),D(this,t+1,t+2);return this},s.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)D(this,t,t+7),D(this,t+1,t+6),D(this,t+2,t+5),D(this,t+3,t+4);return this},s.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?ze(this,0,e):Q.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let e="";const t=o.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},h&&(s.prototype[h]=s.prototype.inspect),s.prototype.compare=function(e,t,r,l,u){if(M(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),l===void 0&&(l=0),u===void 0&&(u=this.length),t<0||r>e.length||l<0||u>this.length)throw new RangeError("out of range index");if(l>=u&&t>=r)return 0;if(l>=u)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,l>>>=0,u>>>=0,this===e)return 0;let p=u-l,I=r-t;const S=Math.min(p,I),F=this.slice(l,u),$=e.slice(t,r);for(let v=0;v<S;++v)if(F[v]!==$[v]){p=F[v],I=$[v];break}return p<I?-1:I<p?1:0};function Re(i,e,t,r,l){if(i.length===0)return-1;if(typeof t=="string"?(r=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Ie(t)&&(t=l?0:i.length-1),t<0&&(t=i.length+t),t>=i.length){if(l)return-1;t=i.length-1}else if(t<0)if(l)t=0;else return-1;if(typeof e=="string"&&(e=s.from(e,r)),s.isBuffer(e))return e.length===0?-1:Ue(i,e,t,r,l);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?l?Uint8Array.prototype.indexOf.call(i,e,t):Uint8Array.prototype.lastIndexOf.call(i,e,t):Ue(i,[e],t,r,l);throw new TypeError("val must be string, number or Buffer")}function Ue(i,e,t,r,l){let u=1,p=i.length,I=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(i.length<2||e.length<2)return-1;u=2,p/=2,I/=2,t/=2}function S($,v){return u===1?$[v]:$.readUInt16BE(v*u)}let F;if(l){let $=-1;for(F=t;F<p;F++)if(S(i,F)===S(e,$===-1?0:F-$)){if($===-1&&($=F),F-$+1===I)return $*u}else $!==-1&&(F-=F-$),$=-1}else for(t+I>p&&(t=p-I),F=t;F>=0;F--){let $=!0;for(let v=0;v<I;v++)if(S(i,F+v)!==S(e,v)){$=!1;break}if($)return F}return-1}s.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1},s.prototype.indexOf=function(e,t,r){return Re(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return Re(this,e,t,r,!1)};function _t(i,e,t,r){t=Number(t)||0;const l=i.length-t;r?(r=Number(r),r>l&&(r=l)):r=l;const u=e.length;r>u/2&&(r=u/2);let p;for(p=0;p<r;++p){const I=parseInt(e.substr(p*2,2),16);if(Ie(I))return p;i[t+p]=I}return p}function It(i,e,t,r){return pe(_e(e,i.length-t),i,t,r)}function At(i,e,t,r){return pe(Lt(e),i,t,r)}function bt(i,e,t,r){return pe(Qe(e),i,t,r)}function Et(i,e,t,r){return pe(Nt(e,i.length-t),i,t,r)}s.prototype.write=function(e,t,r,l){if(t===void 0)l="utf8",r=this.length,t=0;else if(r===void 0&&typeof t=="string")l=t,r=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(r)?(r=r>>>0,l===void 0&&(l="utf8")):(l=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const u=this.length-t;if((r===void 0||r>u)&&(r=u),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");l||(l="utf8");let p=!1;for(;;)switch(l){case"hex":return _t(this,e,t,r);case"utf8":case"utf-8":return It(this,e,t,r);case"ascii":case"latin1":case"binary":return At(this,e,t,r);case"base64":return bt(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Et(this,e,t,r);default:if(p)throw new TypeError("Unknown encoding: "+l);l=(""+l).toLowerCase(),p=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Bt(i,e,t){return e===0&&t===i.length?a.fromByteArray(i):a.fromByteArray(i.slice(e,t))}function ze(i,e,t){t=Math.min(i.length,t);const r=[];let l=e;for(;l<t;){const u=i[l];let p=null,I=u>239?4:u>223?3:u>191?2:1;if(l+I<=t){let S,F,$,v;switch(I){case 1:u<128&&(p=u);break;case 2:S=i[l+1],(S&192)===128&&(v=(u&31)<<6|S&63,v>127&&(p=v));break;case 3:S=i[l+1],F=i[l+2],(S&192)===128&&(F&192)===128&&(v=(u&15)<<12|(S&63)<<6|F&63,v>2047&&(v<55296||v>57343)&&(p=v));break;case 4:S=i[l+1],F=i[l+2],$=i[l+3],(S&192)===128&&(F&192)===128&&($&192)===128&&(v=(u&15)<<18|(S&63)<<12|(F&63)<<6|$&63,v>65535&&v<1114112&&(p=v))}}p===null?(p=65533,I=1):p>65535&&(p-=65536,r.push(p>>>10&1023|55296),p=56320|p&1023),r.push(p),l+=I}return jt(r)}const Oe=4096;function jt(i){const e=i.length;if(e<=Oe)return String.fromCharCode.apply(String,i);let t="",r=0;for(;r<e;)t+=String.fromCharCode.apply(String,i.slice(r,r+=Oe));return t}function vt(i,e,t){let r="";t=Math.min(i.length,t);for(let l=e;l<t;++l)r+=String.fromCharCode(i[l]&127);return r}function Tt(i,e,t){let r="";t=Math.min(i.length,t);for(let l=e;l<t;++l)r+=String.fromCharCode(i[l]);return r}function Ct(i,e,t){const r=i.length;(!e||e<0)&&(e=0),(!t||t<0||t>r)&&(t=r);let l="";for(let u=e;u<t;++u)l+=Rt[i[u]];return l}function Ft(i,e,t){const r=i.slice(e,t);let l="";for(let u=0;u<r.length-1;u+=2)l+=String.fromCharCode(r[u]+r[u+1]*256);return l}s.prototype.slice=function(e,t){const r=this.length;e=~~e,t=t===void 0?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t<e&&(t=e);const l=this.subarray(e,t);return Object.setPrototypeOf(l,s.prototype),l};function N(i,e,t){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+e>t)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||N(e,t,this.length);let l=this[e],u=1,p=0;for(;++p<t&&(u*=256);)l+=this[e+p]*u;return l},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||N(e,t,this.length);let l=this[e+--t],u=1;for(;t>0&&(u*=256);)l+=this[e+--t]*u;return l},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e=e>>>0,t||N(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],r=this[e+7];(t===void 0||r===void 0)&&ue(e,this.length-8);const l=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,u=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(l)+(BigInt(u)<<BigInt(32))}),s.prototype.readBigUInt64BE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],r=this[e+7];(t===void 0||r===void 0)&&ue(e,this.length-8);const l=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],u=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(l)<<BigInt(32))+BigInt(u)}),s.prototype.readIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||N(e,t,this.length);let l=this[e],u=1,p=0;for(;++p<t&&(u*=256);)l+=this[e+p]*u;return u*=128,l>=u&&(l-=Math.pow(2,8*t)),l},s.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||N(e,t,this.length);let l=t,u=1,p=this[e+--l];for(;l>0&&(u*=256);)p+=this[e+--l]*u;return u*=128,p>=u&&(p-=Math.pow(2,8*t)),p},s.prototype.readInt8=function(e,t){return e=e>>>0,t||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e=e>>>0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},s.prototype.readInt16BE=function(e,t){e=e>>>0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},s.prototype.readInt32LE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],r=this[e+7];(t===void 0||r===void 0)&&ue(e,this.length-8);const l=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(l)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],r=this[e+7];(t===void 0||r===void 0)&&ue(e,this.length-8);const l=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(l)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r)}),s.prototype.readFloatLE=function(e,t){return e=e>>>0,t||N(e,4,this.length),c.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e=e>>>0,t||N(e,4,this.length),c.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||N(e,8,this.length),c.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||N(e,8,this.length),c.read(this,e,!1,52,8)};function z(i,e,t,r,l,u){if(!s.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>l||e<u)throw new RangeError('"value" argument is out of bounds');if(t+r>i.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,l){if(e=+e,t=t>>>0,r=r>>>0,!l){const I=Math.pow(2,8*r)-1;z(this,e,t,r,I,0)}let u=1,p=0;for(this[t]=e&255;++p<r&&(u*=256);)this[t+p]=e/u&255;return t+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,r,l){if(e=+e,t=t>>>0,r=r>>>0,!l){const I=Math.pow(2,8*r)-1;z(this,e,t,r,I,0)}let u=r-1,p=1;for(this[t+u]=e&255;--u>=0&&(p*=256);)this[t+u]=e/p&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function De(i,e,t,r,l){He(e,r,l,i,t,7);let u=Number(e&BigInt(4294967295));i[t++]=u,u=u>>8,i[t++]=u,u=u>>8,i[t++]=u,u=u>>8,i[t++]=u;let p=Number(e>>BigInt(32)&BigInt(4294967295));return i[t++]=p,p=p>>8,i[t++]=p,p=p>>8,i[t++]=p,p=p>>8,i[t++]=p,t}function Pe(i,e,t,r,l){He(e,r,l,i,t,7);let u=Number(e&BigInt(4294967295));i[t+7]=u,u=u>>8,i[t+6]=u,u=u>>8,i[t+5]=u,u=u>>8,i[t+4]=u;let p=Number(e>>BigInt(32)&BigInt(4294967295));return i[t+3]=p,p=p>>8,i[t+2]=p,p=p>>8,i[t+1]=p,p=p>>8,i[t]=p,t+8}s.prototype.writeBigUInt64LE=K(function(e,t=0){return De(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=K(function(e,t=0){return Pe(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(e,t,r,l){if(e=+e,t=t>>>0,!l){const S=Math.pow(2,8*r-1);z(this,e,t,r,S-1,-S)}let u=0,p=1,I=0;for(this[t]=e&255;++u<r&&(p*=256);)e<0&&I===0&&this[t+u-1]!==0&&(I=1),this[t+u]=(e/p>>0)-I&255;return t+r},s.prototype.writeIntBE=function(e,t,r,l){if(e=+e,t=t>>>0,!l){const S=Math.pow(2,8*r-1);z(this,e,t,r,S-1,-S)}let u=r-1,p=1,I=0;for(this[t+u]=e&255;--u>=0&&(p*=256);)e<0&&I===0&&this[t+u+1]!==0&&(I=1),this[t+u]=(e/p>>0)-I&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=K(function(e,t=0){return De(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=K(function(e,t=0){return Pe(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function qe(i,e,t,r,l,u){if(t+r>i.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Me(i,e,t,r,l){return e=+e,t=t>>>0,l||qe(i,e,t,4),c.write(i,e,t,r,23,4),t+4}s.prototype.writeFloatLE=function(e,t,r){return Me(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return Me(this,e,t,!1,r)};function Ge(i,e,t,r,l){return e=+e,t=t>>>0,l||qe(i,e,t,8),c.write(i,e,t,r,52,8),t+8}s.prototype.writeDoubleLE=function(e,t,r){return Ge(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return Ge(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,l){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!l&&l!==0&&(l=this.length),t>=e.length&&(t=e.length),t||(t=0),l>0&&l<r&&(l=r),l===r||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("sourceEnd out of bounds");l>this.length&&(l=this.length),e.length-t<l-r&&(l=e.length-t+r);const u=l-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,r,l):Uint8Array.prototype.set.call(e,this.subarray(r,l),t),u},s.prototype.fill=function(e,t,r,l){if(typeof e=="string"){if(typeof t=="string"?(l=t,t=0,r=this.length):typeof r=="string"&&(l=r,r=this.length),l!==void 0&&typeof l!="string")throw new TypeError("encoding must be a string");if(typeof l=="string"&&!s.isEncoding(l))throw new TypeError("Unknown encoding: "+l);if(e.length===1){const p=e.charCodeAt(0);(l==="utf8"&&p<128||l==="latin1")&&(e=p)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t=t>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let u;if(typeof e=="number")for(u=t;u<r;++u)this[u]=e;else{const p=s.isBuffer(e)?e:s.from(e,l),I=p.length;if(I===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(u=0;u<r-t;++u)this[u+t]=p[u%I]}return this};const ee={};function we(i,e,t){ee[i]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(l){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:l,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}we("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),we("ERR_INVALID_ARG_TYPE",function(i,e){return`The "${i}" argument must be of type number. Received type ${typeof e}`},TypeError),we("ERR_OUT_OF_RANGE",function(i,e,t){let r=`The value of "${i}" is out of range.`,l=t;return Number.isInteger(t)&&Math.abs(t)>2**32?l=We(String(t)):typeof t=="bigint"&&(l=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(l=We(l)),l+="n"),r+=` It must be ${e}. Received ${l}`,r},RangeError);function We(i){let e="",t=i.length;const r=i[0]==="-"?1:0;for(;t>=r+4;t-=3)e=`_${i.slice(t-3,t)}${e}`;return`${i.slice(0,t)}${e}`}function St(i,e,t){te(e,"offset"),(i[e]===void 0||i[e+t]===void 0)&&ue(e,i.length-(t+1))}function He(i,e,t,r,l,u){if(i>t||i<e){const p=typeof e=="bigint"?"n":"";let I;throw u>3?e===0||e===BigInt(0)?I=`>= 0${p} and < 2${p} ** ${(u+1)*8}${p}`:I=`>= -(2${p} ** ${(u+1)*8-1}${p}) and < 2 ** ${(u+1)*8-1}${p}`:I=`>= ${e}${p} and <= ${t}${p}`,new ee.ERR_OUT_OF_RANGE("value",I,i)}St(r,l,u)}function te(i,e){if(typeof i!="number")throw new ee.ERR_INVALID_ARG_TYPE(e,"number",i)}function ue(i,e,t){throw Math.floor(i)!==i?(te(i,t),new ee.ERR_OUT_OF_RANGE(t||"offset","an integer",i)):e<0?new ee.ERR_BUFFER_OUT_OF_BOUNDS:new ee.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,i)}const $t=/[^+/0-9A-Za-z-_]/g;function kt(i){if(i=i.split("=")[0],i=i.trim().replace($t,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function _e(i,e){e=e||1/0;let t;const r=i.length;let l=null;const u=[];for(let p=0;p<r;++p){if(t=i.charCodeAt(p),t>55295&&t<57344){if(!l){if(t>56319){(e-=3)>-1&&u.push(239,191,189);continue}else if(p+1===r){(e-=3)>-1&&u.push(239,191,189);continue}l=t;continue}if(t<56320){(e-=3)>-1&&u.push(239,191,189),l=t;continue}t=(l-55296<<10|t-56320)+65536}else l&&(e-=3)>-1&&u.push(239,191,189);if(l=null,t<128){if((e-=1)<0)break;u.push(t)}else if(t<2048){if((e-=2)<0)break;u.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;u.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;u.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return u}function Lt(i){const e=[];for(let t=0;t<i.length;++t)e.push(i.charCodeAt(t)&255);return e}function Nt(i,e){let t,r,l;const u=[];for(let p=0;p<i.length&&!((e-=2)<0);++p)t=i.charCodeAt(p),r=t>>8,l=t%256,u.push(l),u.push(r);return u}function Qe(i){return a.toByteArray(kt(i))}function pe(i,e,t,r){let l;for(l=0;l<r&&!(l+t>=e.length||l>=i.length);++l)e[l+t]=i[l];return l}function M(i,e){return i instanceof e||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===e.name}function Ie(i){return i!==i}const Rt=function(){const i="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){const r=t*16;for(let l=0;l<16;++l)e[r+l]=i[t]+i[l]}return e}();function K(i){return typeof BigInt>"u"?Ut:i}function Ut(){throw new Error("BigInt not supported")}})(dt);var pt={exports:{}},k=pt.exports={},G,W;function ve(){throw new Error("setTimeout has not been defined")}function Te(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?G=setTimeout:G=ve}catch{G=ve}try{typeof clearTimeout=="function"?W=clearTimeout:W=Te}catch{W=Te}})();function ft(o){if(G===setTimeout)return setTimeout(o,0);if((G===ve||!G)&&setTimeout)return G=setTimeout,setTimeout(o,0);try{return G(o,0)}catch{try{return G.call(null,o,0)}catch{return G.call(this,o,0)}}}function Ar(o){if(W===clearTimeout)return clearTimeout(o);if((W===Te||!W)&&clearTimeout)return W=clearTimeout,clearTimeout(o);try{return W(o)}catch{try{return W.call(null,o)}catch{return W.call(this,o)}}}var Y=[],ce=!1,Z,me=-1;function br(){!ce||!Z||(ce=!1,Z.length?Y=Z.concat(Y):me=-1,Y.length&&yt())}function yt(){if(!ce){var o=ft(br);ce=!0;for(var a=Y.length;a;){for(Z=Y,Y=[];++me<a;)Z&&Z[me].run();me=-1,a=Y.length}Z=null,ce=!1,Ar(o)}}k.nextTick=function(o){var a=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)a[c-1]=arguments[c];Y.push(new mt(o,a)),Y.length===1&&!ce&&ft(yt)};function mt(o,a){this.fun=o,this.array=a}mt.prototype.run=function(){this.fun.apply(null,this.array)};k.title="browser";k.browser=!0;k.env={};k.argv=[];k.version="";k.versions={};function V(){}k.on=V;k.addListener=V;k.once=V;k.off=V;k.removeListener=V;k.removeAllListeners=V;k.emit=V;k.prependListener=V;k.prependOnceListener=V;k.listeners=function(o){return[]};k.binding=function(o){throw new Error("process.binding is not supported")};k.cwd=function(){return"/"};k.chdir=function(o){throw new Error("process.chdir is not supported")};k.umask=function(){return 0};var Er=pt.exports;(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const a=dt,c=Er,h=f=>f&&f.__esModule?f:{default:f},y=h(c),m=globalThis||void 0||self;Object.defineProperty(o,"Buffer",{enumerable:!0,get:()=>a.Buffer}),Object.defineProperty(o,"process",{enumerable:!0,get:()=>y.default}),o.global=m})(ut);let q;typeof window<"u"?q=window:typeof self<"u"?q=self:q=ut.global;let Ce=null,Fe=null;const st=20,Ee=q.clearTimeout,ot=q.setTimeout,Be=q.cancelAnimationFrame||q.mozCancelAnimationFrame||q.webkitCancelAnimationFrame,at=q.requestAnimationFrame||q.mozRequestAnimationFrame||q.webkitRequestAnimationFrame;Be==null||at==null?(Ce=Ee,Fe=function(a){return ot(a,st)}):(Ce=function([a,c]){Be(a),Ee(c)},Fe=function(a){const c=at(function(){Ee(h),a()}),h=ot(function(){Be(c),a()},st);return[c,h]});function Br(o){let a,c,h,y,m,f,s;const g=typeof document<"u"&&document.attachEvent;if(!g){f=function(B){const C=B.__resizeTriggers__,R=C.firstElementChild,Q=C.lastElementChild,D=R.firstElementChild;Q.scrollLeft=Q.scrollWidth,Q.scrollTop=Q.scrollHeight,D.style.width=R.offsetWidth+1+"px",D.style.height=R.offsetHeight+1+"px",R.scrollLeft=R.scrollWidth,R.scrollTop=R.scrollHeight},m=function(B){return B.offsetWidth!==B.__resizeLast__.width||B.offsetHeight!==B.__resizeLast__.height},s=function(B){if(B.target.className&&typeof B.target.className.indexOf=="function"&&B.target.className.indexOf("contract-trigger")<0&&B.target.className.indexOf("expand-trigger")<0)return;const C=this;f(this),this.__resizeRAF__&&Ce(this.__resizeRAF__),this.__resizeRAF__=Fe(function(){m(C)&&(C.__resizeLast__.width=C.offsetWidth,C.__resizeLast__.height=C.offsetHeight,C.__resizeListeners__.forEach(function(D){D.call(C,B)}))})};let x=!1,w="";h="animationstart";const _="Webkit Moz O ms".split(" ");let b="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),L="";{const B=document.createElement("fakeelement");if(B.style.animationName!==void 0&&(x=!0),x===!1){for(let C=0;C<_.length;C++)if(B.style[_[C]+"AnimationName"]!==void 0){L=_[C],w="-"+L.toLowerCase()+"-",h=b[C],x=!0;break}}}c="resizeanim",a="@"+w+"keyframes "+c+" { from { opacity: 0; } to { opacity: 0; } } ",y=w+"animation: 1ms "+c+"; "}const E=function(x){if(!x.getElementById("detectElementResize")){const w=(a||"")+".resize-triggers { "+(y||"")+'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%; }',_=x.head||x.getElementsByTagName("head")[0],b=x.createElement("style");b.id="detectElementResize",b.type="text/css",o!=null&&b.setAttribute("nonce",o),b.styleSheet?b.styleSheet.cssText=w:b.appendChild(x.createTextNode(w)),_.appendChild(b)}};return{addResizeListener:function(x,w){if(g)x.attachEvent("onresize",w);else{if(!x.__resizeTriggers__){const _=x.ownerDocument,b=q.getComputedStyle(x);b&&b.position==="static"&&(x.style.position="relative"),E(_),x.__resizeLast__={},x.__resizeListeners__=[],(x.__resizeTriggers__=_.createElement("div")).className="resize-triggers";const L=_.createElement("div");L.className="expand-trigger",L.appendChild(_.createElement("div"));const B=_.createElement("div");B.className="contract-trigger",x.__resizeTriggers__.appendChild(L),x.__resizeTriggers__.appendChild(B),x.appendChild(x.__resizeTriggers__),f(x),x.addEventListener("scroll",s,!0),h&&(x.__resizeTriggers__.__animationListener__=function(R){R.animationName===c&&f(x)},x.__resizeTriggers__.addEventListener(h,x.__resizeTriggers__.__animationListener__))}x.__resizeListeners__.push(w)}},removeResizeListener:function(x,w){if(g)x.detachEvent("onresize",w);else if(x.__resizeListeners__.splice(x.__resizeListeners__.indexOf(w),1),!x.__resizeListeners__.length){x.removeEventListener("scroll",s,!0),x.__resizeTriggers__.__animationListener__&&(x.__resizeTriggers__.removeEventListener(h,x.__resizeTriggers__.__animationListener__),x.__resizeTriggers__.__animationListener__=null);try{x.__resizeTriggers__=!x.removeChild(x.__resizeTriggers__)}catch{}}}}}class Le extends T.Component{constructor(...a){super(...a),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:c,disableWidth:h,onResize:y}=this.props;if(this._parentNode){var m,f,s,g;const E=window.getComputedStyle(this._parentNode)||{},A=parseFloat((m=E.paddingLeft)!==null&&m!==void 0?m:"0"),j=parseFloat((f=E.paddingRight)!==null&&f!==void 0?f:"0"),x=parseFloat((s=E.paddingTop)!==null&&s!==void 0?s:"0"),w=parseFloat((g=E.paddingBottom)!==null&&g!==void 0?g:"0"),_=this._parentNode.getBoundingClientRect(),b=_.height-x-w,L=_.width-A-j,B=this._parentNode.offsetHeight-x-w,C=this._parentNode.offsetWidth-A-j;(!c&&(this.state.height!==B||this.state.scaledHeight!==b)||!h&&(this.state.width!==C||this.state.scaledWidth!==L))&&(this.setState({height:B,width:C,scaledHeight:b,scaledWidth:L}),typeof y=="function"&&y({height:B,scaledHeight:b,scaledWidth:L,width:C}))}},this._setRef=c=>{this._autoSizer=c}}componentDidMount(){const{nonce:a}=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=Br(a),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:a,defaultHeight:c,defaultWidth:h,disableHeight:y=!1,disableWidth:m=!1,nonce:f,onResize:s,style:g={},tagName:E="div",...A}=this.props,{height:j,scaledHeight:x,scaledWidth:w,width:_}=this.state,b={overflow:"visible"},L={};let B=!1;return y||(j===0&&(B=!0),b.height=0,L.height=j,L.scaledHeight=x),m||(_===0&&(B=!0),b.width=0,L.width=_,L.scaledWidth=w),T.createElement(E,{ref:this._setRef,style:{...b,...g},...A},!B&&a(L))}}const jr=({src:o,className:a,style:c})=>n.jsx(Le,{className:a,style:c,children:({height:h,width:y})=>n.jsx(zt.Player,{autoplay:!0,loop:!1,controls:!1,src:`https://url-proxy.streamlayer.io?${o}`,style:{height:h,width:y}})}),vr=d.styled_default("div")({name:"Container",class:"c1htq1lb",propsAsIs:!1}),Tr=d.styled_default("div")({name:"Content",class:"cjyzpp7",propsAsIs:!1}),Cr=d.styled_default("div")({name:"Graphic",class:"g16mldgz",propsAsIs:!1}),Fr=d.styled_default("div")({name:"Headline",class:"h69js65",propsAsIs:!1}),Sr=d.styled_default("div")({name:"StepsContainer",class:"smm7qmo",propsAsIs:!1}),$r=d.styled_default("span")({name:"StepIndicator",class:"s17knuw2",propsAsIs:!1}),kr=({graphicSrc:o,headline:a,stepsCount:c,currentStep:h})=>n.jsxs(vr,{children:[n.jsxs(Tr,{children:[n.jsx(Cr,{children:n.jsx(jr,{src:o})}),a&&n.jsx(Fr,{children:a})]}),n.jsx(Sr,{children:Array.from({length:c}).map((y,m)=>n.jsx($r,{"data-active":h===m},m))})]}),Lr=d.styled_default("div")({name:"Container",class:"c1itm4k7",propsAsIs:!1}),Nr=d.styled_default("div")({name:"IconContainer",class:"i1w4fsni",propsAsIs:!1}),Rr=()=>d.i1,Ur=d.styled_default(Rr())({name:"InviteGameIcon",class:"i19m85r1",propsAsIs:!0}),zr=d.styled_default("div")({name:"Content",class:"c1mbu204",propsAsIs:!1}),Or=d.styled_default("div")({name:"Heading",class:"h1amdqtv",propsAsIs:!1}),Dr=d.styled_default("div")({name:"Subtext",class:"s1lhlj9j",propsAsIs:!1}),Pr=d.styled_default("div")({name:"LinkContainer",class:"l1wot35e",propsAsIs:!1}),qr=d.styled_default("div")({name:"LinkInfo",class:"l1jdw39q",propsAsIs:!1}),Mr=d.styled_default("span")({name:"LinkTitle",class:"l1cr5mk",propsAsIs:!1}),Gr=d.styled_default("span")({name:"LinkAddress",class:"lvi87q4",propsAsIs:!1}),Wr=()=>d.i1,Hr=d.styled_default(Wr())({name:"LinkIcon",class:"l1pqlvw3",propsAsIs:!0}),Qr=d.styled_default("div")({name:"SocialLinksContainer",class:"s1n7kzeh",propsAsIs:!1}),Yr=d.styled_default("a")({name:"SocialLink",class:"s2m9o9y",propsAsIs:!1}),Vr=d.styled_default("span")({name:"SocialLinkLabel",class:"sewjbbn",propsAsIs:!1}),xt=({inviteLink:o,socialLinks:a,inviteCardTitle:c,inviteCardSubtext:h,primaryColor:y,className:m})=>n.jsxs(Lr,{className:m,children:[n.jsx(Nr,{style:{backgroundColor:y},children:n.jsx(Ur,{name:"invite-game-icon"})}),n.jsxs(zr,{children:[n.jsx(Or,{children:c||""}),n.jsx(Dr,{children:h||""})]}),o&&n.jsxs(Pr,{onClick:async()=>{if(o)try{await navigator.clipboard.writeText(o)}catch(f){console.error("Unable to copy to clipboard",f)}},children:[n.jsxs(qr,{children:[n.jsx(Mr,{children:"Invite link"}),n.jsx(Gr,{children:o})]}),n.jsx(Hr,{name:"icon-copy"})]}),a&&a.length>0&&n.jsx(Qr,{children:a.map(({icon:f,link:s,label:g})=>n.jsxs(Yr,{href:s,target:"_blank",children:[n.jsx(d.i1,{name:f}),n.jsx(Vr,{children:g})]},s))})]}),Kr=d.styled_default("div")({name:"Container",class:"cm0bev",propsAsIs:!1}),Xr=d.styled_default("div")({name:"Content",class:"ce7x737",propsAsIs:!1}),Jr=d.styled_default("div")({name:"Title",class:"tc2tor6",propsAsIs:!1}),Zr=d.styled_default("div")({name:"RulesList",class:"r1k5klql",propsAsIs:!1}),en=d.styled_default("div")({name:"RulesItem",class:"r1tf3ft2",propsAsIs:!1}),tn=d.styled_default("div")({name:"RuleIcon",class:"rwpvg1k",propsAsIs:!1}),rn=d.styled_default("div")({name:"RuleText",class:"rbxiag0",propsAsIs:!1}),nn=d.styled_default("button")({name:"TermsButton",class:"t6cyrry",propsAsIs:!1}),sn=({rules:o,rulesTitle:a,primaryColor:c})=>n.jsxs(Kr,{children:[n.jsxs(Xr,{children:[n.jsx(Jr,{children:a}),n.jsx(Zr,{children:o==null?void 0:o.map(({label:h,icon:y},m)=>n.jsxs(en,{children:[y&&n.jsx(tn,{style:{backgroundColor:c},children:n.jsx(d.i1,{name:y,"data-icon":y})}),n.jsx(rn,{children:h})]},m))})]}),n.jsx(nn,{children:"See Terms and Conditions"})]}),on=d.styled_default("button")({name:"SButton",class:"s1nve60q",propsAsIs:!1}),an=d.styled_default("span")({name:"ButtonLabel",class:"b1xoswwx",propsAsIs:!1}),gt=({disabled:o,variant:a="primary",onClick:c,children:h,...y})=>n.jsx(on,{onClick:c,disabled:o,"data-variant":a,...y,children:n.jsx(an,{children:h})}),ln=d.styled_default("div")({name:"Container",class:"c18uddbs",propsAsIs:!1}),cn=d.styled_default("div")({name:"Content",class:"cvcfjf6",propsAsIs:!1}),un=d.styled_default("div")({name:"OnboardingHeader",class:"o1ie27lw",propsAsIs:!1}),dn=d.styled_default("button")({name:"CloseBtn",class:"c15cjkwi",propsAsIs:!1}),hn=()=>d.i1,pn=d.styled_default(hn())({name:"IconClose",class:"i1mavjt2",propsAsIs:!0}),fn=d.styled_default("div")({name:"OnboardingFooter",class:"o1x0dyzv",propsAsIs:!1}),yn=()=>gt,mn=d.styled_default(yn())({name:"OnboardingActionBtn",class:"o1jfi9c3",propsAsIs:!0}),oe={steps:!1,rules:!1,inviteCard:!1},xn=({gamification:o,steps:a,rules:c,rulesBtnLabel:h,rulesTitle:y,primaryColor:m,inviteLink:f,socialLinks:s,inviteCardTitle:g,inviteCardSubtext:E,inviteCardBtnLabel:A,onClose:j})=>{const[x,w]=T.useState(0),[_,b]=T.useState(oe);T.useEffect(()=>{a!=null&&a.length?b({...oe,steps:!0}):c!=null&&c.length?b({...oe,rules:!0}):b({...oe,inviteCard:!0})},[]);const L=T.useMemo(()=>_.steps&&x===0?"Continue":_.rules?h||"Got it":_.inviteCard?A||"Play Now":"Next",[_,x,h,A]),B=T.useCallback(()=>{a!=null&&a.length&&x<a.length-1?w(R=>++R):c!=null&&c.length&&_.steps?b({...oe,rules:!0}):_.rules&&b({...oe,inviteCard:!0})},[x,a==null?void 0:a.length,c==null?void 0:c.length,_,w,b]),C=async()=>{await o.onboardingStatus.submitInplay()};return n.jsx(Le,{children:({width:R,height:Q})=>n.jsxs(ln,{style:{width:R,height:Q},children:[n.jsx(un,{children:n.jsx(dn,{onClick:j,children:n.jsx(pn,{name:"icon-close-btn-gray"})})}),n.jsxs(cn,{children:[_.steps&&(a==null?void 0:a.length)&&n.jsx(kr,{stepsCount:a.length,currentStep:x,...a[x]}),_.rules&&n.jsx(sn,{rules:c,rulesTitle:y,primaryColor:m}),_.inviteCard&&n.jsx(xt,{inviteLink:f,inviteCardTitle:g,inviteCardSubtext:E,primaryColor:m,socialLinks:s})]}),n.jsx(fn,{children:n.jsx(mn,{onClick:_.inviteCard?C:B,children:L})})]})})},gn=d.styled_default("div")({name:"Container",class:"c1pgyo67",propsAsIs:!1}),wn="hx17qu6",Ne=({children:o,style:a,className:c,hiding:h})=>n.jsx(gn,{style:a,className:d.cx_default(c,h&&wn),children:o}),_n=d.styled_default("div")({name:"Container",class:"cocfo2g",propsAsIs:!1}),In=d.styled_default("div")({name:"CloseIconWrap",class:"c1pdhxdk",propsAsIs:!1}),An=()=>d.i1,bn=d.styled_default(An())({name:"CloseIcon",class:"c1funj3r",propsAsIs:!0}),En=d.styled_default("div")({name:"Title",class:"t1okg06y",propsAsIs:!1}),Bn=d.styled_default("img")({name:"SponsorLogo",class:"sb1n923",propsAsIs:!1}),jn=d.styled_default("div")({name:"PresentsTitle",class:"p1stllxd",propsAsIs:!1}),vn=d.styled_default("div")({name:"Subtitle",class:"s13kvdzw",propsAsIs:!1}),Tn=d.styled_default("div")({name:"Description",class:"dfvmv3t",propsAsIs:!1}),Cn=d.styled_default("button")({name:"ActionButton",class:"ay8e3j9",propsAsIs:!1}),Fn=({close:o,action:a,onboarding:c})=>{var h,y,m,f,s,g,E,A;return n.jsxs(_n,{children:[n.jsx(In,{onClick:o,children:n.jsx(bn,{name:"icon-cross"})}),((y=(h=c==null?void 0:c.titleCard)==null?void 0:h.media)==null?void 0:y.sponsorLogo)&&n.jsxs(En,{children:[n.jsx(Bn,{alt:"sponsor-logo",src:(f=(m=c==null?void 0:c.titleCard)==null?void 0:m.media)==null?void 0:f.sponsorLogo}),n.jsx(jn,{children:"PRESENTS"})]}),((s=c==null?void 0:c.titleCard)==null?void 0:s.title)&&n.jsx(vn,{children:(g=c==null?void 0:c.titleCard)==null?void 0:g.title}),((E=c==null?void 0:c.titleCard)==null?void 0:E.subtitle)&&n.jsx(Tn,{children:(A=c==null?void 0:c.titleCard)==null?void 0:A.subtitle}),n.jsx(Cn,{onClick:a,children:"Play Now"})]})},Sn=()=>Ne,$n=d.styled_default(Sn())({name:"OnboardingContainer",class:"o9squag",propsAsIs:!0}),kn=({hiding:o,deepLink:a,onboardingOpts:c,setOpened:h,notification:y,gamification:m})=>{var f,s,g,E,A,j;const{data:x}=X.useStore(a.$store);return n.jsx($n,{hiding:o,children:n.jsx(xn,{rules:[{label:"Answer as many questions as you like.",icon:"icon-btn-feature-groups"},{label:"Win points for each correct trivia or prediction answer.",icon:"icon-thumb-up"},{label:"Top the leader board and best your friends.",icon:"icon-trophy"}],rulesBtnLabel:(f=c.rules)==null?void 0:f.buttonLabel,rulesTitle:(s=c.rules)==null?void 0:s.heading,steps:[{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_01.json",headline:"Welcome to the Featured Groups +"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_02.json",headline:"Get real-time insights"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_03.json",headline:"Predictions, trivia & polls synced to match play"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_04.json",headline:"Win points for every answer you get right"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_05.json",headline:"Compete against friends on the leaderboard"}],primaryColor:(g=c.inviteCard)==null?void 0:g.iconColor,inviteLink:x==null?void 0:x.url,inviteCardTitle:(E=c.inviteCard)==null?void 0:E.heading,inviteCardSubtext:(A=c.inviteCard)==null?void 0:A.subtext,inviteCardBtnLabel:(j=c.inviteCard)==null?void 0:j.buttonLabel,onClose:()=>{var w;h(!1),(w=y.close)==null||w.call(y)},socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],gamification:m})})},Ln=({sdk:o,hiding:a,notification:c,NotificationContainer:h})=>{const[y,m]=T.useState(!1),f=o.getFeature(U.FeatureType.GAMES),s=c.data.onboarding;return y&&f&&s?n.jsx(kn,{notification:c,setOpened:m,gamification:f,onboardingOpts:s,deepLink:f.deepLink}):n.jsx(h,{hiding:a,children:n.jsx("div",{children:n.jsx(Fn,{close:c.close,action:()=>m(!0),onboarding:s})})})},Nn=()=>Ne,je=d.styled_default(Nn())({name:"Container",class:"ctckejh",propsAsIs:!0}),Rn=({sdk:o})=>{const a=o.getNotificationsStore(),c=X.useStore(a),h=T.useMemo(()=>{if(!(c!=null&&c.size))return null;for(const y of c.values())if(y.type===fe.NotificationType.ONBOARDING)return y;return c.values().next().value},[c]);return(h==null?void 0:h.type)===fe.NotificationType.QUESTION?n.jsx(je,{hiding:h.hiding,children:n.jsx("div",{children:n.jsx(nt,{...h})})}):(h==null?void 0:h.type)===fe.NotificationType.QUESTION_RESOLVED?n.jsx(je,{hiding:h.hiding,children:n.jsx("div",{children:n.jsx(nt,{...h})})}):(h==null?void 0:h.type)===fe.NotificationType.ONBOARDING?n.jsx(Ln,{NotificationContainer:je,sdk:o,notification:h,hiding:h.hiding}):null},Un=d.styled_default("div")({name:"SDKContainer",class:"stu11h7",propsAsIs:!1}),Se=d.styled_default("div")({name:"SDKScrollContainer",class:"s1ucohr1",propsAsIs:!1}),wt=d.styled_default("div")({name:"SDKContentContainer",class:"s1el4wvm",propsAsIs:!1}),zn=()=>wt,On=d.styled_default(zn())({name:"SDKWhiteContainer",class:"s1oe3036",propsAsIs:!0}),Dn=o=>{const a=T.useRef(""),[c,h]=T.useState(!1),y=X.useStore(o.status),m=X.useStore(o.userId()),f=y==="ready",[s,g]=T.useState(J),E=T.useCallback((x,w)=>{g(w),w===J?(x&&o.createEventSession(x),o.openFeature(U.FeatureType.GAMES)):o.closeFeature()},[o]);T.useEffect(()=>{!f&&s===J&&(g(le),o.closeFeature())},[f,s,o]);const A=x=>{a.current=x,o.initializeApp().then(({enabled:w,err:_})=>{if(h(!0),_){E(x,le);return}if(w){o.isUserAuthorized().then(b=>{if(b){E(x,J);return}else o.disableApp()});return}})},j=()=>{h(!1),o.disableApp()};return T.useEffect(()=>{if(!m){f&&(g(le),o.disableApp());return}m&&a.current&&c&&o.initializeApp().then(()=>{o.createEventSession(a.current)})},[m]),{sdkEnabled:c,sdkReady:f,activeOverlay:s,activateAndLoadOverlay:E,enableSdk:A,disableSdk:j,isLogged:!!m}},Pn=o=>{const a=X.useStore(o.getActiveFeature()),c=X.useStore(o.streamStore()),[h,y]=T.useState(null);return T.useEffect(()=>{const m=o.getFeatures();if(a)for(const[f,s]of m)f===a?s.status.get()===de.FeatureStatus.Suspended&&(s.enable(),y(s)):s.status.get()===de.FeatureStatus.Ready&&s.disable();else{for(const[,f]of m)f.status.get()===de.FeatureStatus.Ready&&f.disable();y(null)}return()=>{for(const[,f]of m)f.status.get()===de.FeatureStatus.Ready&&f.disable()}},[a,o,c]),[a,h]},qn=({sdk:o,className:a})=>{const[,c]=Pn(o);return n.jsx(Pt,{className:a,feature:c,sdk:o})},Mn=({sdk:o,overlays:a,children:c})=>{const{sdkEnabled:h,sdkReady:y,activeOverlay:m,activateAndLoadOverlay:f,enableSdk:s,disableSdk:g,isLogged:E}=Dn(o);return T.useEffect(()=>{Promise.resolve().then(()=>require("./gamification-feature.js"))},[]),n.jsxs(Un,{children:[h&&n.jsx(ni,{sdkReady:y,activeOverlay:m,className:ae.d,setActiveOverlay:A=>f("",A)}),y&&n.jsx(Rn,{sdk:o}),n.jsx(Se,{"data-nav":h.toString(),style:{display:!h||m===le?"block":"none"},children:c&&c({enableSdk:s,disableSdk:g})}),n.jsx(Se,{"data-nav":h.toString(),style:{display:m===xe?"block":"none"},children:a&&m===xe&&a[m]}),y&&m===J&&n.jsx(qn,{className:ae.d,sdk:o}),!E&&n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})};const Gn=({sdkKey:o,plugins:a,children:c,production:h=!0})=>n.jsx(ae.StreamLayerProvider,{sdkKey:o,plugins:a,production:h,autoEnable:!1,children:c}),Wn=({children:o,overlays:a})=>{const{sdk:c,status:h}=T.useContext(ae.StreamLayerContext);if(h===ae.StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return c?n.jsx("div",{className:"StreamLayerSDK",children:n.jsx(ae.s,{style:{height:"100%"},children:n.jsx(Mn,{sdk:c,overlays:a,children:o})})}):o({})};exports.AutoSizer=Le;exports.MastersStreamLayerProvider=Gn;exports.MastersStreamLayerSDKReact=Wn;exports.O=xt;exports.a=On;exports.c=gt;exports.d=Ne;exports.n=wt;exports.o=lt;exports.r=Se;exports.w=ct;
6
+ */(function(o){const a=ge,c=ke,h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=s,o.SlowBuffer=C,o.INSPECT_MAX_BYTES=50;const y=2147483647;o.kMaxLength=y,s.TYPED_ARRAY_SUPPORT=m(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function m(){try{const i=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(i,e),i.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function f(i){if(i>y)throw new RangeError('The value "'+i+'" is invalid for option "size"');const e=new Uint8Array(i);return Object.setPrototypeOf(e,s.prototype),e}function s(i,e,t){if(typeof i=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return j(i)}return g(i,e,t)}s.poolSize=8192;function g(i,e,t){if(typeof i=="string")return x(i,e);if(ArrayBuffer.isView(i))return _(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(M(i,ArrayBuffer)||i&&M(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(M(i,SharedArrayBuffer)||i&&M(i.buffer,SharedArrayBuffer)))return b(i,e,t);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const r=i.valueOf&&i.valueOf();if(r!=null&&r!==i)return s.from(r,e,t);const l=L(i);if(l)return l;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return s.from(i[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}s.from=function(i,e,t){return g(i,e,t)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function E(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function A(i,e,t){return E(i),i<=0?f(i):e!==void 0?typeof t=="string"?f(i).fill(e,t):f(i).fill(e):f(i)}s.alloc=function(i,e,t){return A(i,e,t)};function j(i){return E(i),f(i<0?0:B(i)|0)}s.allocUnsafe=function(i){return j(i)},s.allocUnsafeSlow=function(i){return j(i)};function x(i,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=R(i,e)|0;let r=f(t);const l=r.write(i,e);return l!==t&&(r=r.slice(0,l)),r}function w(i){const e=i.length<0?0:B(i.length)|0,t=f(e);for(let r=0;r<e;r+=1)t[r]=i[r]&255;return t}function _(i){if(M(i,Uint8Array)){const e=new Uint8Array(i);return b(e.buffer,e.byteOffset,e.byteLength)}return w(i)}function b(i,e,t){if(e<0||i.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&t===void 0?r=new Uint8Array(i):t===void 0?r=new Uint8Array(i,e):r=new Uint8Array(i,e,t),Object.setPrototypeOf(r,s.prototype),r}function L(i){if(s.isBuffer(i)){const e=B(i.length)|0,t=f(e);return t.length===0||i.copy(t,0,0,e),t}if(i.length!==void 0)return typeof i.length!="number"||Ie(i.length)?f(0):w(i);if(i.type==="Buffer"&&Array.isArray(i.data))return w(i.data)}function B(i){if(i>=y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y.toString(16)+" bytes");return i|0}function C(i){return+i!=i&&(i=0),s.alloc(+i)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(M(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),M(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,l=t.length;for(let u=0,p=Math.min(r,l);u<p;++u)if(e[u]!==t[u]){r=e[u],l=t[u];break}return r<l?-1:l<r?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);let r;if(t===void 0)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const l=s.allocUnsafe(t);let u=0;for(r=0;r<e.length;++r){let p=e[r];if(M(p,Uint8Array))u+p.length>l.length?(s.isBuffer(p)||(p=s.from(p)),p.copy(l,u)):Uint8Array.prototype.set.call(l,p,u);else if(s.isBuffer(p))p.copy(l,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=p.length}return l};function R(i,e){if(s.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||M(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const t=i.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&t===0)return 0;let l=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return _e(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Qe(i).length;default:if(l)return r?-1:_e(i).length;e=(""+e).toLowerCase(),l=!0}}s.byteLength=R;function Q(i,e,t){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(i||(i="utf8");;)switch(i){case"hex":return Tt(this,e,t);case"utf8":case"utf-8":return ze(this,e,t);case"ascii":return jt(this,e,t);case"latin1":case"binary":return vt(this,e,t);case"base64":return Et(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ct(this,e,t);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function D(i,e,t){const r=i[e];i[e]=i[t],i[t]=r}s.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)D(this,t,t+1);return this},s.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)D(this,t,t+3),D(this,t+1,t+2);return this},s.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)D(this,t,t+7),D(this,t+1,t+6),D(this,t+2,t+5),D(this,t+3,t+4);return this},s.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?ze(this,0,e):Q.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let e="";const t=o.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},h&&(s.prototype[h]=s.prototype.inspect),s.prototype.compare=function(e,t,r,l,u){if(M(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),l===void 0&&(l=0),u===void 0&&(u=this.length),t<0||r>e.length||l<0||u>this.length)throw new RangeError("out of range index");if(l>=u&&t>=r)return 0;if(l>=u)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,l>>>=0,u>>>=0,this===e)return 0;let p=u-l,I=r-t;const S=Math.min(p,I),F=this.slice(l,u),$=e.slice(t,r);for(let v=0;v<S;++v)if(F[v]!==$[v]){p=F[v],I=$[v];break}return p<I?-1:I<p?1:0};function Re(i,e,t,r,l){if(i.length===0)return-1;if(typeof t=="string"?(r=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Ie(t)&&(t=l?0:i.length-1),t<0&&(t=i.length+t),t>=i.length){if(l)return-1;t=i.length-1}else if(t<0)if(l)t=0;else return-1;if(typeof e=="string"&&(e=s.from(e,r)),s.isBuffer(e))return e.length===0?-1:Ue(i,e,t,r,l);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?l?Uint8Array.prototype.indexOf.call(i,e,t):Uint8Array.prototype.lastIndexOf.call(i,e,t):Ue(i,[e],t,r,l);throw new TypeError("val must be string, number or Buffer")}function Ue(i,e,t,r,l){let u=1,p=i.length,I=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(i.length<2||e.length<2)return-1;u=2,p/=2,I/=2,t/=2}function S($,v){return u===1?$[v]:$.readUInt16BE(v*u)}let F;if(l){let $=-1;for(F=t;F<p;F++)if(S(i,F)===S(e,$===-1?0:F-$)){if($===-1&&($=F),F-$+1===I)return $*u}else $!==-1&&(F-=F-$),$=-1}else for(t+I>p&&(t=p-I),F=t;F>=0;F--){let $=!0;for(let v=0;v<I;v++)if(S(i,F+v)!==S(e,v)){$=!1;break}if($)return F}return-1}s.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1},s.prototype.indexOf=function(e,t,r){return Re(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return Re(this,e,t,r,!1)};function wt(i,e,t,r){t=Number(t)||0;const l=i.length-t;r?(r=Number(r),r>l&&(r=l)):r=l;const u=e.length;r>u/2&&(r=u/2);let p;for(p=0;p<r;++p){const I=parseInt(e.substr(p*2,2),16);if(Ie(I))return p;i[t+p]=I}return p}function _t(i,e,t,r){return pe(_e(e,i.length-t),i,t,r)}function It(i,e,t,r){return pe(kt(e),i,t,r)}function At(i,e,t,r){return pe(Qe(e),i,t,r)}function bt(i,e,t,r){return pe(Lt(e,i.length-t),i,t,r)}s.prototype.write=function(e,t,r,l){if(t===void 0)l="utf8",r=this.length,t=0;else if(r===void 0&&typeof t=="string")l=t,r=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(r)?(r=r>>>0,l===void 0&&(l="utf8")):(l=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const u=this.length-t;if((r===void 0||r>u)&&(r=u),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");l||(l="utf8");let p=!1;for(;;)switch(l){case"hex":return wt(this,e,t,r);case"utf8":case"utf-8":return _t(this,e,t,r);case"ascii":case"latin1":case"binary":return It(this,e,t,r);case"base64":return At(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bt(this,e,t,r);default:if(p)throw new TypeError("Unknown encoding: "+l);l=(""+l).toLowerCase(),p=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Et(i,e,t){return e===0&&t===i.length?a.fromByteArray(i):a.fromByteArray(i.slice(e,t))}function ze(i,e,t){t=Math.min(i.length,t);const r=[];let l=e;for(;l<t;){const u=i[l];let p=null,I=u>239?4:u>223?3:u>191?2:1;if(l+I<=t){let S,F,$,v;switch(I){case 1:u<128&&(p=u);break;case 2:S=i[l+1],(S&192)===128&&(v=(u&31)<<6|S&63,v>127&&(p=v));break;case 3:S=i[l+1],F=i[l+2],(S&192)===128&&(F&192)===128&&(v=(u&15)<<12|(S&63)<<6|F&63,v>2047&&(v<55296||v>57343)&&(p=v));break;case 4:S=i[l+1],F=i[l+2],$=i[l+3],(S&192)===128&&(F&192)===128&&($&192)===128&&(v=(u&15)<<18|(S&63)<<12|(F&63)<<6|$&63,v>65535&&v<1114112&&(p=v))}}p===null?(p=65533,I=1):p>65535&&(p-=65536,r.push(p>>>10&1023|55296),p=56320|p&1023),r.push(p),l+=I}return Bt(r)}const Oe=4096;function Bt(i){const e=i.length;if(e<=Oe)return String.fromCharCode.apply(String,i);let t="",r=0;for(;r<e;)t+=String.fromCharCode.apply(String,i.slice(r,r+=Oe));return t}function jt(i,e,t){let r="";t=Math.min(i.length,t);for(let l=e;l<t;++l)r+=String.fromCharCode(i[l]&127);return r}function vt(i,e,t){let r="";t=Math.min(i.length,t);for(let l=e;l<t;++l)r+=String.fromCharCode(i[l]);return r}function Tt(i,e,t){const r=i.length;(!e||e<0)&&(e=0),(!t||t<0||t>r)&&(t=r);let l="";for(let u=e;u<t;++u)l+=Nt[i[u]];return l}function Ct(i,e,t){const r=i.slice(e,t);let l="";for(let u=0;u<r.length-1;u+=2)l+=String.fromCharCode(r[u]+r[u+1]*256);return l}s.prototype.slice=function(e,t){const r=this.length;e=~~e,t=t===void 0?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t<e&&(t=e);const l=this.subarray(e,t);return Object.setPrototypeOf(l,s.prototype),l};function N(i,e,t){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+e>t)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||N(e,t,this.length);let l=this[e],u=1,p=0;for(;++p<t&&(u*=256);)l+=this[e+p]*u;return l},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||N(e,t,this.length);let l=this[e+--t],u=1;for(;t>0&&(u*=256);)l+=this[e+--t]*u;return l},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e=e>>>0,t||N(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],r=this[e+7];(t===void 0||r===void 0)&&ue(e,this.length-8);const l=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,u=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(l)+(BigInt(u)<<BigInt(32))}),s.prototype.readBigUInt64BE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],r=this[e+7];(t===void 0||r===void 0)&&ue(e,this.length-8);const l=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],u=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(l)<<BigInt(32))+BigInt(u)}),s.prototype.readIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||N(e,t,this.length);let l=this[e],u=1,p=0;for(;++p<t&&(u*=256);)l+=this[e+p]*u;return u*=128,l>=u&&(l-=Math.pow(2,8*t)),l},s.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||N(e,t,this.length);let l=t,u=1,p=this[e+--l];for(;l>0&&(u*=256);)p+=this[e+--l]*u;return u*=128,p>=u&&(p-=Math.pow(2,8*t)),p},s.prototype.readInt8=function(e,t){return e=e>>>0,t||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e=e>>>0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},s.prototype.readInt16BE=function(e,t){e=e>>>0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},s.prototype.readInt32LE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],r=this[e+7];(t===void 0||r===void 0)&&ue(e,this.length-8);const l=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(l)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=K(function(e){e=e>>>0,te(e,"offset");const t=this[e],r=this[e+7];(t===void 0||r===void 0)&&ue(e,this.length-8);const l=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(l)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r)}),s.prototype.readFloatLE=function(e,t){return e=e>>>0,t||N(e,4,this.length),c.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e=e>>>0,t||N(e,4,this.length),c.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||N(e,8,this.length),c.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||N(e,8,this.length),c.read(this,e,!1,52,8)};function z(i,e,t,r,l,u){if(!s.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>l||e<u)throw new RangeError('"value" argument is out of bounds');if(t+r>i.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,l){if(e=+e,t=t>>>0,r=r>>>0,!l){const I=Math.pow(2,8*r)-1;z(this,e,t,r,I,0)}let u=1,p=0;for(this[t]=e&255;++p<r&&(u*=256);)this[t+p]=e/u&255;return t+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,r,l){if(e=+e,t=t>>>0,r=r>>>0,!l){const I=Math.pow(2,8*r)-1;z(this,e,t,r,I,0)}let u=r-1,p=1;for(this[t+u]=e&255;--u>=0&&(p*=256);)this[t+u]=e/p&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function De(i,e,t,r,l){He(e,r,l,i,t,7);let u=Number(e&BigInt(4294967295));i[t++]=u,u=u>>8,i[t++]=u,u=u>>8,i[t++]=u,u=u>>8,i[t++]=u;let p=Number(e>>BigInt(32)&BigInt(4294967295));return i[t++]=p,p=p>>8,i[t++]=p,p=p>>8,i[t++]=p,p=p>>8,i[t++]=p,t}function Pe(i,e,t,r,l){He(e,r,l,i,t,7);let u=Number(e&BigInt(4294967295));i[t+7]=u,u=u>>8,i[t+6]=u,u=u>>8,i[t+5]=u,u=u>>8,i[t+4]=u;let p=Number(e>>BigInt(32)&BigInt(4294967295));return i[t+3]=p,p=p>>8,i[t+2]=p,p=p>>8,i[t+1]=p,p=p>>8,i[t]=p,t+8}s.prototype.writeBigUInt64LE=K(function(e,t=0){return De(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=K(function(e,t=0){return Pe(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(e,t,r,l){if(e=+e,t=t>>>0,!l){const S=Math.pow(2,8*r-1);z(this,e,t,r,S-1,-S)}let u=0,p=1,I=0;for(this[t]=e&255;++u<r&&(p*=256);)e<0&&I===0&&this[t+u-1]!==0&&(I=1),this[t+u]=(e/p>>0)-I&255;return t+r},s.prototype.writeIntBE=function(e,t,r,l){if(e=+e,t=t>>>0,!l){const S=Math.pow(2,8*r-1);z(this,e,t,r,S-1,-S)}let u=r-1,p=1,I=0;for(this[t+u]=e&255;--u>=0&&(p*=256);)e<0&&I===0&&this[t+u+1]!==0&&(I=1),this[t+u]=(e/p>>0)-I&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||z(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=K(function(e,t=0){return De(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=K(function(e,t=0){return Pe(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function qe(i,e,t,r,l,u){if(t+r>i.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Me(i,e,t,r,l){return e=+e,t=t>>>0,l||qe(i,e,t,4),c.write(i,e,t,r,23,4),t+4}s.prototype.writeFloatLE=function(e,t,r){return Me(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return Me(this,e,t,!1,r)};function Ge(i,e,t,r,l){return e=+e,t=t>>>0,l||qe(i,e,t,8),c.write(i,e,t,r,52,8),t+8}s.prototype.writeDoubleLE=function(e,t,r){return Ge(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return Ge(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,l){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!l&&l!==0&&(l=this.length),t>=e.length&&(t=e.length),t||(t=0),l>0&&l<r&&(l=r),l===r||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(l<0)throw new RangeError("sourceEnd out of bounds");l>this.length&&(l=this.length),e.length-t<l-r&&(l=e.length-t+r);const u=l-r;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,r,l):Uint8Array.prototype.set.call(e,this.subarray(r,l),t),u},s.prototype.fill=function(e,t,r,l){if(typeof e=="string"){if(typeof t=="string"?(l=t,t=0,r=this.length):typeof r=="string"&&(l=r,r=this.length),l!==void 0&&typeof l!="string")throw new TypeError("encoding must be a string");if(typeof l=="string"&&!s.isEncoding(l))throw new TypeError("Unknown encoding: "+l);if(e.length===1){const p=e.charCodeAt(0);(l==="utf8"&&p<128||l==="latin1")&&(e=p)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t=t>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let u;if(typeof e=="number")for(u=t;u<r;++u)this[u]=e;else{const p=s.isBuffer(e)?e:s.from(e,l),I=p.length;if(I===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(u=0;u<r-t;++u)this[u+t]=p[u%I]}return this};const ee={};function we(i,e,t){ee[i]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(l){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:l,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}we("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),we("ERR_INVALID_ARG_TYPE",function(i,e){return`The "${i}" argument must be of type number. Received type ${typeof e}`},TypeError),we("ERR_OUT_OF_RANGE",function(i,e,t){let r=`The value of "${i}" is out of range.`,l=t;return Number.isInteger(t)&&Math.abs(t)>2**32?l=We(String(t)):typeof t=="bigint"&&(l=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(l=We(l)),l+="n"),r+=` It must be ${e}. Received ${l}`,r},RangeError);function We(i){let e="",t=i.length;const r=i[0]==="-"?1:0;for(;t>=r+4;t-=3)e=`_${i.slice(t-3,t)}${e}`;return`${i.slice(0,t)}${e}`}function Ft(i,e,t){te(e,"offset"),(i[e]===void 0||i[e+t]===void 0)&&ue(e,i.length-(t+1))}function He(i,e,t,r,l,u){if(i>t||i<e){const p=typeof e=="bigint"?"n":"";let I;throw u>3?e===0||e===BigInt(0)?I=`>= 0${p} and < 2${p} ** ${(u+1)*8}${p}`:I=`>= -(2${p} ** ${(u+1)*8-1}${p}) and < 2 ** ${(u+1)*8-1}${p}`:I=`>= ${e}${p} and <= ${t}${p}`,new ee.ERR_OUT_OF_RANGE("value",I,i)}Ft(r,l,u)}function te(i,e){if(typeof i!="number")throw new ee.ERR_INVALID_ARG_TYPE(e,"number",i)}function ue(i,e,t){throw Math.floor(i)!==i?(te(i,t),new ee.ERR_OUT_OF_RANGE(t||"offset","an integer",i)):e<0?new ee.ERR_BUFFER_OUT_OF_BOUNDS:new ee.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,i)}const St=/[^+/0-9A-Za-z-_]/g;function $t(i){if(i=i.split("=")[0],i=i.trim().replace(St,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function _e(i,e){e=e||1/0;let t;const r=i.length;let l=null;const u=[];for(let p=0;p<r;++p){if(t=i.charCodeAt(p),t>55295&&t<57344){if(!l){if(t>56319){(e-=3)>-1&&u.push(239,191,189);continue}else if(p+1===r){(e-=3)>-1&&u.push(239,191,189);continue}l=t;continue}if(t<56320){(e-=3)>-1&&u.push(239,191,189),l=t;continue}t=(l-55296<<10|t-56320)+65536}else l&&(e-=3)>-1&&u.push(239,191,189);if(l=null,t<128){if((e-=1)<0)break;u.push(t)}else if(t<2048){if((e-=2)<0)break;u.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;u.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;u.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return u}function kt(i){const e=[];for(let t=0;t<i.length;++t)e.push(i.charCodeAt(t)&255);return e}function Lt(i,e){let t,r,l;const u=[];for(let p=0;p<i.length&&!((e-=2)<0);++p)t=i.charCodeAt(p),r=t>>8,l=t%256,u.push(l),u.push(r);return u}function Qe(i){return a.toByteArray($t(i))}function pe(i,e,t,r){let l;for(l=0;l<r&&!(l+t>=e.length||l>=i.length);++l)e[l+t]=i[l];return l}function M(i,e){return i instanceof e||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===e.name}function Ie(i){return i!==i}const Nt=function(){const i="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){const r=t*16;for(let l=0;l<16;++l)e[r+l]=i[t]+i[l]}return e}();function K(i){return typeof BigInt>"u"?Rt:i}function Rt(){throw new Error("BigInt not supported")}})(dt);var pt={exports:{}},k=pt.exports={},G,W;function ve(){throw new Error("setTimeout has not been defined")}function Te(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?G=setTimeout:G=ve}catch{G=ve}try{typeof clearTimeout=="function"?W=clearTimeout:W=Te}catch{W=Te}})();function ft(o){if(G===setTimeout)return setTimeout(o,0);if((G===ve||!G)&&setTimeout)return G=setTimeout,setTimeout(o,0);try{return G(o,0)}catch{try{return G.call(null,o,0)}catch{return G.call(this,o,0)}}}function Ir(o){if(W===clearTimeout)return clearTimeout(o);if((W===Te||!W)&&clearTimeout)return W=clearTimeout,clearTimeout(o);try{return W(o)}catch{try{return W.call(null,o)}catch{return W.call(this,o)}}}var Y=[],ce=!1,Z,me=-1;function Ar(){!ce||!Z||(ce=!1,Z.length?Y=Z.concat(Y):me=-1,Y.length&&yt())}function yt(){if(!ce){var o=ft(Ar);ce=!0;for(var a=Y.length;a;){for(Z=Y,Y=[];++me<a;)Z&&Z[me].run();me=-1,a=Y.length}Z=null,ce=!1,Ir(o)}}k.nextTick=function(o){var a=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)a[c-1]=arguments[c];Y.push(new mt(o,a)),Y.length===1&&!ce&&ft(yt)};function mt(o,a){this.fun=o,this.array=a}mt.prototype.run=function(){this.fun.apply(null,this.array)};k.title="browser";k.browser=!0;k.env={};k.argv=[];k.version="";k.versions={};function V(){}k.on=V;k.addListener=V;k.once=V;k.off=V;k.removeListener=V;k.removeAllListeners=V;k.emit=V;k.prependListener=V;k.prependOnceListener=V;k.listeners=function(o){return[]};k.binding=function(o){throw new Error("process.binding is not supported")};k.cwd=function(){return"/"};k.chdir=function(o){throw new Error("process.chdir is not supported")};k.umask=function(){return 0};var br=pt.exports;(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const a=dt,c=br,h=f=>f&&f.__esModule?f:{default:f},y=h(c),m=globalThis||void 0||self;Object.defineProperty(o,"Buffer",{enumerable:!0,get:()=>a.Buffer}),Object.defineProperty(o,"process",{enumerable:!0,get:()=>y.default}),o.global=m})(ut);let q;typeof window<"u"?q=window:typeof self<"u"?q=self:q=ut.global;let Ce=null,Fe=null;const st=20,Ee=q.clearTimeout,ot=q.setTimeout,Be=q.cancelAnimationFrame||q.mozCancelAnimationFrame||q.webkitCancelAnimationFrame,at=q.requestAnimationFrame||q.mozRequestAnimationFrame||q.webkitRequestAnimationFrame;Be==null||at==null?(Ce=Ee,Fe=function(a){return ot(a,st)}):(Ce=function([a,c]){Be(a),Ee(c)},Fe=function(a){const c=at(function(){Ee(h),a()}),h=ot(function(){Be(c),a()},st);return[c,h]});function Er(o){let a,c,h,y,m,f,s;const g=typeof document<"u"&&document.attachEvent;if(!g){f=function(B){const C=B.__resizeTriggers__,R=C.firstElementChild,Q=C.lastElementChild,D=R.firstElementChild;Q.scrollLeft=Q.scrollWidth,Q.scrollTop=Q.scrollHeight,D.style.width=R.offsetWidth+1+"px",D.style.height=R.offsetHeight+1+"px",R.scrollLeft=R.scrollWidth,R.scrollTop=R.scrollHeight},m=function(B){return B.offsetWidth!==B.__resizeLast__.width||B.offsetHeight!==B.__resizeLast__.height},s=function(B){if(B.target.className&&typeof B.target.className.indexOf=="function"&&B.target.className.indexOf("contract-trigger")<0&&B.target.className.indexOf("expand-trigger")<0)return;const C=this;f(this),this.__resizeRAF__&&Ce(this.__resizeRAF__),this.__resizeRAF__=Fe(function(){m(C)&&(C.__resizeLast__.width=C.offsetWidth,C.__resizeLast__.height=C.offsetHeight,C.__resizeListeners__.forEach(function(D){D.call(C,B)}))})};let x=!1,w="";h="animationstart";const _="Webkit Moz O ms".split(" ");let b="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),L="";{const B=document.createElement("fakeelement");if(B.style.animationName!==void 0&&(x=!0),x===!1){for(let C=0;C<_.length;C++)if(B.style[_[C]+"AnimationName"]!==void 0){L=_[C],w="-"+L.toLowerCase()+"-",h=b[C],x=!0;break}}}c="resizeanim",a="@"+w+"keyframes "+c+" { from { opacity: 0; } to { opacity: 0; } } ",y=w+"animation: 1ms "+c+"; "}const E=function(x){if(!x.getElementById("detectElementResize")){const w=(a||"")+".resize-triggers { "+(y||"")+'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%; }',_=x.head||x.getElementsByTagName("head")[0],b=x.createElement("style");b.id="detectElementResize",b.type="text/css",o!=null&&b.setAttribute("nonce",o),b.styleSheet?b.styleSheet.cssText=w:b.appendChild(x.createTextNode(w)),_.appendChild(b)}};return{addResizeListener:function(x,w){if(g)x.attachEvent("onresize",w);else{if(!x.__resizeTriggers__){const _=x.ownerDocument,b=q.getComputedStyle(x);b&&b.position==="static"&&(x.style.position="relative"),E(_),x.__resizeLast__={},x.__resizeListeners__=[],(x.__resizeTriggers__=_.createElement("div")).className="resize-triggers";const L=_.createElement("div");L.className="expand-trigger",L.appendChild(_.createElement("div"));const B=_.createElement("div");B.className="contract-trigger",x.__resizeTriggers__.appendChild(L),x.__resizeTriggers__.appendChild(B),x.appendChild(x.__resizeTriggers__),f(x),x.addEventListener("scroll",s,!0),h&&(x.__resizeTriggers__.__animationListener__=function(R){R.animationName===c&&f(x)},x.__resizeTriggers__.addEventListener(h,x.__resizeTriggers__.__animationListener__))}x.__resizeListeners__.push(w)}},removeResizeListener:function(x,w){if(g)x.detachEvent("onresize",w);else if(x.__resizeListeners__.splice(x.__resizeListeners__.indexOf(w),1),!x.__resizeListeners__.length){x.removeEventListener("scroll",s,!0),x.__resizeTriggers__.__animationListener__&&(x.__resizeTriggers__.removeEventListener(h,x.__resizeTriggers__.__animationListener__),x.__resizeTriggers__.__animationListener__=null);try{x.__resizeTriggers__=!x.removeChild(x.__resizeTriggers__)}catch{}}}}}class Le extends T.Component{constructor(...a){super(...a),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:c,disableWidth:h,onResize:y}=this.props;if(this._parentNode){var m,f,s,g;const E=window.getComputedStyle(this._parentNode)||{},A=parseFloat((m=E.paddingLeft)!==null&&m!==void 0?m:"0"),j=parseFloat((f=E.paddingRight)!==null&&f!==void 0?f:"0"),x=parseFloat((s=E.paddingTop)!==null&&s!==void 0?s:"0"),w=parseFloat((g=E.paddingBottom)!==null&&g!==void 0?g:"0"),_=this._parentNode.getBoundingClientRect(),b=_.height-x-w,L=_.width-A-j,B=this._parentNode.offsetHeight-x-w,C=this._parentNode.offsetWidth-A-j;(!c&&(this.state.height!==B||this.state.scaledHeight!==b)||!h&&(this.state.width!==C||this.state.scaledWidth!==L))&&(this.setState({height:B,width:C,scaledHeight:b,scaledWidth:L}),typeof y=="function"&&y({height:B,scaledHeight:b,scaledWidth:L,width:C}))}},this._setRef=c=>{this._autoSizer=c}}componentDidMount(){const{nonce:a}=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=Er(a),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:a,defaultHeight:c,defaultWidth:h,disableHeight:y=!1,disableWidth:m=!1,nonce:f,onResize:s,style:g={},tagName:E="div",...A}=this.props,{height:j,scaledHeight:x,scaledWidth:w,width:_}=this.state,b={overflow:"visible"},L={};let B=!1;return y||(j===0&&(B=!0),b.height=0,L.height=j,L.scaledHeight=x),m||(_===0&&(B=!0),b.width=0,L.width=_,L.scaledWidth=w),T.createElement(E,{ref:this._setRef,style:{...b,...g},...A},!B&&a(L))}}const Br=({src:o,className:a,style:c})=>n.jsx(Le,{className:a,style:c,children:({height:h,width:y})=>n.jsx(Ut.Player,{autoplay:!0,loop:!1,controls:!1,src:`https://url-proxy.streamlayer.io?${o}`,style:{height:h,width:y}})}),jr=d.styled_default("div")({name:"Container",class:"c1htq1lb",propsAsIs:!1}),vr=d.styled_default("div")({name:"Content",class:"cjyzpp7",propsAsIs:!1}),Tr=d.styled_default("div")({name:"Graphic",class:"g16mldgz",propsAsIs:!1}),Cr=d.styled_default("div")({name:"Headline",class:"h69js65",propsAsIs:!1}),Fr=d.styled_default("div")({name:"StepsContainer",class:"smm7qmo",propsAsIs:!1}),Sr=d.styled_default("span")({name:"StepIndicator",class:"s17knuw2",propsAsIs:!1}),$r=({graphicSrc:o,headline:a,stepsCount:c,currentStep:h})=>n.jsxs(jr,{children:[n.jsxs(vr,{children:[n.jsx(Tr,{children:n.jsx(Br,{src:o})}),a&&n.jsx(Cr,{children:a})]}),n.jsx(Fr,{children:Array.from({length:c}).map((y,m)=>n.jsx(Sr,{"data-active":h===m},m))})]}),kr=d.styled_default("div")({name:"Container",class:"c1itm4k7",propsAsIs:!1}),Lr=d.styled_default("div")({name:"IconContainer",class:"i1w4fsni",propsAsIs:!1}),Nr=()=>d.i1,Rr=d.styled_default(Nr())({name:"InviteGameIcon",class:"i19m85r1",propsAsIs:!0}),Ur=d.styled_default("div")({name:"Content",class:"c1mbu204",propsAsIs:!1}),zr=d.styled_default("div")({name:"Heading",class:"h1amdqtv",propsAsIs:!1}),Or=d.styled_default("div")({name:"Subtext",class:"s1lhlj9j",propsAsIs:!1}),Dr=d.styled_default("div")({name:"LinkContainer",class:"l1wot35e",propsAsIs:!1}),Pr=d.styled_default("div")({name:"LinkInfo",class:"l1jdw39q",propsAsIs:!1}),qr=d.styled_default("span")({name:"LinkTitle",class:"l1cr5mk",propsAsIs:!1}),Mr=d.styled_default("span")({name:"LinkAddress",class:"lvi87q4",propsAsIs:!1}),Gr=()=>d.i1,Wr=d.styled_default(Gr())({name:"LinkIcon",class:"l1pqlvw3",propsAsIs:!0}),Hr=d.styled_default("div")({name:"SocialLinksContainer",class:"s1n7kzeh",propsAsIs:!1}),Qr=d.styled_default("a")({name:"SocialLink",class:"s2m9o9y",propsAsIs:!1}),Yr=d.styled_default("span")({name:"SocialLinkLabel",class:"sewjbbn",propsAsIs:!1}),xt=({inviteLink:o,socialLinks:a,inviteCardTitle:c,inviteCardSubtext:h,primaryColor:y,className:m})=>n.jsxs(kr,{className:m,children:[n.jsx(Lr,{style:{backgroundColor:y},children:n.jsx(Rr,{name:"invite-game-icon"})}),n.jsxs(Ur,{children:[n.jsx(zr,{children:c||""}),n.jsx(Or,{children:h||""})]}),o&&n.jsxs(Dr,{onClick:async()=>{if(o)try{await navigator.clipboard.writeText(o)}catch(f){console.error("Unable to copy to clipboard",f)}},children:[n.jsxs(Pr,{children:[n.jsx(qr,{children:"Invite link"}),n.jsx(Mr,{children:o})]}),n.jsx(Wr,{name:"icon-copy"})]}),a&&a.length>0&&n.jsx(Hr,{children:a.map(({icon:f,link:s,label:g})=>n.jsxs(Qr,{href:s,target:"_blank",children:[n.jsx(d.i1,{name:f}),n.jsx(Yr,{children:g})]},s))})]}),Vr=d.styled_default("div")({name:"Container",class:"cm0bev",propsAsIs:!1}),Kr=d.styled_default("div")({name:"Content",class:"ce7x737",propsAsIs:!1}),Xr=d.styled_default("div")({name:"Title",class:"tc2tor6",propsAsIs:!1}),Jr=d.styled_default("div")({name:"RulesList",class:"r1k5klql",propsAsIs:!1}),Zr=d.styled_default("div")({name:"RulesItem",class:"r1tf3ft2",propsAsIs:!1}),en=d.styled_default("div")({name:"RuleIcon",class:"rwpvg1k",propsAsIs:!1}),tn=d.styled_default("div")({name:"RuleText",class:"rbxiag0",propsAsIs:!1}),rn=d.styled_default("button")({name:"TermsButton",class:"t6cyrry",propsAsIs:!1}),nn=({rules:o,rulesTitle:a,primaryColor:c})=>n.jsxs(Vr,{children:[n.jsxs(Kr,{children:[n.jsx(Xr,{children:a}),n.jsx(Jr,{children:o==null?void 0:o.map(({label:h,icon:y},m)=>n.jsxs(Zr,{children:[y&&n.jsx(en,{style:{backgroundColor:c},children:n.jsx(d.i1,{name:y,"data-icon":y})}),n.jsx(tn,{children:h})]},m))})]}),n.jsx(rn,{children:"See Terms and Conditions"})]}),sn=d.styled_default("button")({name:"SButton",class:"s1nve60q",propsAsIs:!1}),on=d.styled_default("span")({name:"ButtonLabel",class:"b1xoswwx",propsAsIs:!1}),an=({disabled:o,variant:a="primary",onClick:c,children:h,...y})=>n.jsx(sn,{onClick:c,disabled:o,"data-variant":a,...y,children:n.jsx(on,{children:h})}),ln=d.styled_default("div")({name:"Container",class:"c18uddbs",propsAsIs:!1}),cn=d.styled_default("div")({name:"Content",class:"cvcfjf6",propsAsIs:!1}),un=d.styled_default("div")({name:"OnboardingHeader",class:"o1ie27lw",propsAsIs:!1}),dn=d.styled_default("button")({name:"CloseBtn",class:"c15cjkwi",propsAsIs:!1}),hn=()=>d.i1,pn=d.styled_default(hn())({name:"IconClose",class:"i1mavjt2",propsAsIs:!0}),fn=d.styled_default("div")({name:"OnboardingFooter",class:"o1x0dyzv",propsAsIs:!1}),yn=()=>an,mn=d.styled_default(yn())({name:"OnboardingActionBtn",class:"o1jfi9c3",propsAsIs:!0}),oe={steps:!1,rules:!1,inviteCard:!1},xn=({gamification:o,steps:a,rules:c,rulesBtnLabel:h,rulesTitle:y,primaryColor:m,inviteLink:f,socialLinks:s,inviteCardTitle:g,inviteCardSubtext:E,inviteCardBtnLabel:A,onClose:j})=>{const[x,w]=T.useState(0),[_,b]=T.useState(oe);T.useEffect(()=>{a!=null&&a.length?b({...oe,steps:!0}):c!=null&&c.length?b({...oe,rules:!0}):b({...oe,inviteCard:!0})},[]);const L=T.useMemo(()=>_.steps&&x===0?"Continue":_.rules?h||"Got it":_.inviteCard?A||"Play Now":"Next",[_,x,h,A]),B=T.useCallback(()=>{a!=null&&a.length&&x<a.length-1?w(R=>++R):c!=null&&c.length&&_.steps?b({...oe,rules:!0}):_.rules&&b({...oe,inviteCard:!0})},[x,a==null?void 0:a.length,c==null?void 0:c.length,_,w,b]),C=async()=>{await o.onboardingStatus.submitInplay()};return n.jsx(Le,{children:({width:R,height:Q})=>n.jsxs(ln,{style:{width:R,height:Q},children:[n.jsx(un,{children:n.jsx(dn,{onClick:j,children:n.jsx(pn,{name:"icon-close-btn-gray"})})}),n.jsxs(cn,{children:[_.steps&&(a==null?void 0:a.length)&&n.jsx($r,{stepsCount:a.length,currentStep:x,...a[x]}),_.rules&&n.jsx(nn,{rules:c,rulesTitle:y,primaryColor:m}),_.inviteCard&&n.jsx(xt,{inviteLink:f,inviteCardTitle:g,inviteCardSubtext:E,primaryColor:m,socialLinks:s})]}),n.jsx(fn,{children:n.jsx(mn,{onClick:_.inviteCard?C:B,children:L})})]})})},gn=d.styled_default("div")({name:"Container",class:"c1pgyo67",propsAsIs:!1}),wn="hx17qu6",Ne=({children:o,style:a,className:c,hiding:h})=>n.jsx(gn,{style:a,className:d.cx_default(c,h&&wn),children:o}),_n=d.styled_default("div")({name:"Container",class:"cocfo2g",propsAsIs:!1}),In=d.styled_default("div")({name:"CloseIconWrap",class:"c1pdhxdk",propsAsIs:!1}),An=()=>d.i1,bn=d.styled_default(An())({name:"CloseIcon",class:"c1funj3r",propsAsIs:!0}),En=d.styled_default("div")({name:"Title",class:"t1okg06y",propsAsIs:!1}),Bn=d.styled_default("img")({name:"SponsorLogo",class:"sb1n923",propsAsIs:!1}),jn=d.styled_default("div")({name:"PresentsTitle",class:"p1stllxd",propsAsIs:!1}),vn=d.styled_default("div")({name:"Subtitle",class:"s13kvdzw",propsAsIs:!1}),Tn=d.styled_default("div")({name:"Description",class:"dfvmv3t",propsAsIs:!1}),Cn=d.styled_default("button")({name:"ActionButton",class:"ay8e3j9",propsAsIs:!1}),Fn=({close:o,action:a,onboarding:c})=>{var h,y,m,f,s,g,E,A;return n.jsxs(_n,{children:[n.jsx(In,{onClick:o,children:n.jsx(bn,{name:"icon-cross"})}),((y=(h=c==null?void 0:c.titleCard)==null?void 0:h.media)==null?void 0:y.sponsorLogo)&&n.jsxs(En,{children:[n.jsx(Bn,{alt:"sponsor-logo",src:(f=(m=c==null?void 0:c.titleCard)==null?void 0:m.media)==null?void 0:f.sponsorLogo}),n.jsx(jn,{children:"PRESENTS"})]}),((s=c==null?void 0:c.titleCard)==null?void 0:s.title)&&n.jsx(vn,{children:(g=c==null?void 0:c.titleCard)==null?void 0:g.title}),((E=c==null?void 0:c.titleCard)==null?void 0:E.subtitle)&&n.jsx(Tn,{children:(A=c==null?void 0:c.titleCard)==null?void 0:A.subtitle}),n.jsx(Cn,{onClick:a,children:"Play Now"})]})},Sn=()=>Ne,$n=d.styled_default(Sn())({name:"OnboardingContainer",class:"o9squag",propsAsIs:!0}),kn=({hiding:o,deepLink:a,onboardingOpts:c,setOpened:h,notification:y,gamification:m})=>{var f,s,g,E,A,j;const{data:x}=X.useStore(a.$store);return n.jsx($n,{hiding:o,children:n.jsx(xn,{rules:[{label:"Answer as many questions as you like.",icon:"icon-btn-feature-groups"},{label:"Win points for each correct trivia or prediction answer.",icon:"icon-thumb-up"},{label:"Top the leader board and best your friends.",icon:"icon-trophy"}],rulesBtnLabel:(f=c.rules)==null?void 0:f.buttonLabel,rulesTitle:(s=c.rules)==null?void 0:s.heading,steps:[{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_01.json",headline:"Welcome to the Featured Groups +"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_02.json",headline:"Get real-time insights"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_03.json",headline:"Predictions, trivia & polls synced to match play"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_04.json",headline:"Win points for every answer you get right"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_05.json",headline:"Compete against friends on the leaderboard"}],primaryColor:(g=c.inviteCard)==null?void 0:g.iconColor,inviteLink:x==null?void 0:x.url,inviteCardTitle:(E=c.inviteCard)==null?void 0:E.heading,inviteCardSubtext:(A=c.inviteCard)==null?void 0:A.subtext,inviteCardBtnLabel:(j=c.inviteCard)==null?void 0:j.buttonLabel,onClose:()=>{var w;h(!1),(w=y.close)==null||w.call(y)},socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],gamification:m})})},Ln=({sdk:o,hiding:a,notification:c,NotificationContainer:h})=>{const[y,m]=T.useState(!1),f=o.getFeature(U.FeatureType.GAMES),s=c.data.onboarding;return y&&f&&s?n.jsx(kn,{notification:c,setOpened:m,gamification:f,onboardingOpts:s,deepLink:f.deepLink}):n.jsx(h,{hiding:a,children:n.jsx("div",{children:n.jsx(Fn,{close:c.close,action:()=>m(!0),onboarding:s})})})},Nn=()=>Ne,je=d.styled_default(Nn())({name:"Container",class:"ctckejh",propsAsIs:!0}),Rn=({sdk:o})=>{const a=o.getNotificationsStore(),c=X.useStore(a),h=T.useMemo(()=>{if(!(c!=null&&c.size))return null;for(const y of c.values())if(y.type===fe.NotificationType.ONBOARDING)return y;return c.values().next().value},[c]);return(h==null?void 0:h.type)===fe.NotificationType.QUESTION?n.jsx(je,{hiding:h.hiding,children:n.jsx("div",{children:n.jsx(nt,{...h})})}):(h==null?void 0:h.type)===fe.NotificationType.QUESTION_RESOLVED?n.jsx(je,{hiding:h.hiding,children:n.jsx("div",{children:n.jsx(nt,{...h})})}):(h==null?void 0:h.type)===fe.NotificationType.ONBOARDING?n.jsx(Ln,{NotificationContainer:je,sdk:o,notification:h,hiding:h.hiding}):null},Un=d.styled_default("div")({name:"SDKContainer",class:"stu11h7",propsAsIs:!1}),Se=d.styled_default("div")({name:"SDKScrollContainer",class:"s1ucohr1",propsAsIs:!1}),gt=d.styled_default("div")({name:"SDKContentContainer",class:"s1el4wvm",propsAsIs:!1}),zn=()=>gt,On=d.styled_default(zn())({name:"SDKWhiteContainer",class:"s1oe3036",propsAsIs:!0}),Dn=o=>{const a=T.useRef(""),[c,h]=T.useState(!1),y=X.useStore(o.status),m=X.useStore(o.userId()),f=y==="ready",[s,g]=T.useState(J),E=T.useCallback((x,w)=>{g(w),w===J?(x&&o.createEventSession(x),o.openFeature(U.FeatureType.GAMES)):o.closeFeature()},[o]);T.useEffect(()=>{!f&&s===J&&(g(le),o.closeFeature())},[f,s,o]);const A=x=>{a.current=x,o.initializeApp().then(({enabled:w,err:_})=>{if(h(!0),_){E(x,le);return}if(w){o.isUserAuthorized().then(b=>{if(b){E(x,J);return}else o.disableApp()});return}})},j=()=>{h(!1),o.disableApp()};return T.useEffect(()=>{if(!m){f&&(g(le),o.disableApp());return}m&&a.current&&c&&o.initializeApp().then(()=>{o.createEventSession(a.current)})},[m]),{sdkEnabled:c,sdkReady:f,activeOverlay:s,activateAndLoadOverlay:E,enableSdk:A,disableSdk:j,isLogged:!!m}},Pn=o=>{const a=X.useStore(o.getActiveFeature()),c=X.useStore(o.streamStore()),[h,y]=T.useState(null);return T.useEffect(()=>{const m=o.getFeatures();if(a)for(const[f,s]of m)f===a?s.status.get()===de.FeatureStatus.Suspended&&(s.enable(),y(s)):s.status.get()===de.FeatureStatus.Ready&&s.disable();else{for(const[,f]of m)f.status.get()===de.FeatureStatus.Ready&&f.disable();y(null)}return()=>{for(const[,f]of m)f.status.get()===de.FeatureStatus.Ready&&f.disable()}},[a,o,c]),[a,h]},qn=({sdk:o,className:a})=>{const[,c]=Pn(o);return n.jsx(Dt,{className:a,feature:c,sdk:o})},Mn=({sdk:o,overlays:a,children:c})=>{const{sdkEnabled:h,sdkReady:y,activeOverlay:m,activateAndLoadOverlay:f,enableSdk:s,disableSdk:g,isLogged:E}=Dn(o);return T.useEffect(()=>{Promise.resolve().then(()=>require("./gamification-feature.js"))},[]),n.jsxs(Un,{children:[h&&n.jsx(ri,{sdkReady:y,activeOverlay:m,className:ae.d,setActiveOverlay:A=>f("",A)}),y&&n.jsx(Rn,{sdk:o}),n.jsx(Se,{"data-nav":h.toString(),style:{display:!h||m===le?"block":"none"},children:c&&c({enableSdk:s,disableSdk:g})}),n.jsx(Se,{"data-nav":h.toString(),style:{display:m===xe?"block":"none"},children:a&&m===xe&&a[m]}),y&&m===J&&n.jsx(qn,{className:ae.d,sdk:o}),!E&&n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})};const Gn=({sdkKey:o,plugins:a,children:c,production:h=!0})=>n.jsx(ae.StreamLayerProvider,{sdkKey:o,plugins:a,production:h,autoEnable:!1,children:c}),Wn=({children:o,overlays:a})=>{const{sdk:c,status:h}=T.useContext(ae.StreamLayerContext);if(h===ae.StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return c?n.jsx("div",{className:"StreamLayerSDK",children:n.jsx(ae.s,{style:{height:"100%"},children:n.jsx(Mn,{sdk:c,overlays:a,children:o})})}):o({})};exports.AutoSizer=Le;exports.MastersStreamLayerProvider=Gn;exports.MastersStreamLayerSDKReact=Wn;exports.O=xt;exports.a=On;exports.d=Ne;exports.n=gt;exports.o=lt;exports.r=Se;exports.w=ct;