@streamlayer/react 0.32.6 → 0.32.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/index4.js +1 -1
- package/lib/cjs/masters2.js +2 -2
- package/lib/cjs/points.js +1 -1
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/masters.js +11 -11
- package/lib/dist/es/gamification-feature.js +738 -656
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +1382 -1382
- package/lib/dist/index.d.ts +4 -7
- package/lib/dist/style.css +1 -1
- package/lib/es/gamification-feature.js +646 -564
- package/lib/es/index4.js +38 -37
- package/lib/es/masters2.js +348 -343
- package/lib/es/points.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +8 -8
package/lib/cjs/masters2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),le=require("./index2.js"),A=require("react"),U=require("@streamlayer/sdk-web-types"),Z=require("@nanostores/react"),he=require("@streamlayer/sdk-web-interfaces"),d=require("./index4.js"),me=require("@streamlayer/sdk-web-notifications"),Dt=({feature:o,sdk:s,children:c,className:f})=>{const y=Z.useStore(o.status),m=Z.useStore(s.sdkStore.slStreamId);return m!=null&&m.loading?n.jsx("div",{className:f,children:"event is loading..."}):m!=null&&m.data?y!==he.FeatureStatus.Ready?n.jsx("div",{className:f,children:"wait feature..."}):c:n.jsx("div",{className:f,children:"event is forbidden..."})},qt=A.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature.js"))),Pt=({sdk:o,feature:s,className:c})=>{const f=A.useMemo(()=>s&&s.featureConfig.get().type===U.FeatureType.GAMES?n.jsx(Dt,{className:c,sdk:o,feature:s,children:n.jsx(qt,{className:c,gamification:s,sdk:o})}):null,[o,s,c]);return n.jsx(A.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:f})},Mt=d.styled_default("button")({name:"SButton",class:"sxxa0c",propsAsIs:!1}),Wt=d.styled_default("span")({name:"ButtonIcon",class:"b193dcyu",propsAsIs:!1}),Gt=d.styled_default("span")({name:"ButtonLabel",class:"b40tuix",propsAsIs:!1}),ke=({disabled:o,active:s,onClick:c,label:f,icon:y})=>n.jsx(Mt,{onClick:c,disabled:o,"data-selected":s,children:n.jsxs(n.Fragment,{children:[y&&n.jsx(Wt,{children:y}),n.jsx(Gt,{children:f})]})}),Ht=()=>d.n1,Qt=d.styled_default(Ht())({name:"ButtonIcon",class:"b1whzxvd",propsAsIs:!0}),ce="channels",Yt=o=>{var s;return n.jsx(ke,{...o,id:"channels",label:"Channels",icon:n.jsx(Qt,{name:"icon-btn-channels","data-selected":(s=o.active)==null?void 0:s.toString()})})},Vt=()=>d.n1,Kt=d.styled_default(Vt())({name:"ButtonIcon",class:"b11des7c",propsAsIs:!0}),X="featuredGroups",Xt=o=>{var s;return n.jsx(ke,{...o,label:"FG+",id:"featuredGroups",icon:n.jsx(Kt,{name:"icon-btn-feature-groups","data-selected":(s=o.active)==null?void 0:s.toString()})})},Jt=()=>d.n1,Zt=d.styled_default(Jt())({name:"ButtonIcon",class:"b180jd7l",propsAsIs:!0}),ge="leaderboard",ei=o=>{var s;return n.jsx(ke,{...o,label:"Leader Board",id:"leaderboard",icon:n.jsx(Zt,{name:"icon-btn-leaderboard","data-selected":(s=o.active)==null?void 0:s.toString()})})},ti=d.styled_default("div")({name:"Buttons",class:"b6tbwuy",propsAsIs:!1}),ii=({children:o,className:s})=>n.jsx(ti,{className:s,children:o}),ri=()=>ii,ni=d.styled_default(ri())({name:"Navigation",class:"n19lpak2",propsAsIs:!0}),si=({activeOverlay:o,setActiveOverlay:s,sdkReady:c,className:f})=>n.jsxs(ni,{className:f,children:[n.jsx(Yt,{active:o===ce,onClick:()=>s(ce)}),n.jsx(Xt,{active:o===X,disabled:!c,onClick:()=>{s(X)}}),n.jsx(ei,{active:o===ge,onClick:()=>s(ge)})]}),ut={[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"}},oi=d.styled_default("div")({name:"Container",class:"c1bgb86j",propsAsIs:!1}),ai=d.styled_default("video")({name:"Player",class:"p6703cq",propsAsIs:!1}),li=d.styled_default("img")({name:"Poster",class:"p12ow7zo",propsAsIs:!1}),ci=d.styled_default("div")({name:"Control",class:"cdpal9o",propsAsIs:!1}),dt=({poster:o,source:s})=>{const c=A.useRef(null),[f,y]=A.useState(!1),[m,h]=A.useState(!0);return n.jsxs(oi,{onClick:()=>{const a=c==null?void 0:c.current;a&&y(g=>g?(a.pause(),!1):(a.play(),h(!1),!0))},children:[n.jsx(ai,{ref:c,src:s,onEnded:()=>{var a;(a=c==null?void 0:c.current)==null||a.load(),y(!1),h(!0)},style:{visibility:m?"hidden":"visible"}}),n.jsx(li,{src:o,style:{visibility:m?"visible":"hidden"}}),n.jsx(ci,{children:!f&&n.jsx(d.n1,{name:"icon-play"})})]})},ui=d.styled_default("div")({name:"InsightContainer",class:"i1pqqgpo",propsAsIs:!1}),di=d.styled_default("img")({name:"Image",class:"igj7luu",propsAsIs:!1}),hi=d.styled_default("div")({name:"InsightContent",class:"i1qne9g6",propsAsIs:!1}),pi=d.styled_default("h3")({name:"Title",class:"ttpr98r",propsAsIs:!1}),fi=d.styled_default("div")({name:"Description",class:"d17iaqp8",propsAsIs:!1}),yi=d.styled_default("button")({name:"ActionBtn",class:"a16t3y7s",propsAsIs:!1}),mi=({video:o,image:s,heading:c,body:f,action:y})=>n.jsxs(ui,{children:[(o==null?void 0:o.url)&&n.jsx(dt,{source:o.url,poster:o.thumbnailUrl}),s&&!(o!=null&&o.url)&&n.jsx(di,{src:s}),n.jsxs(hi,{children:[n.jsx(pi,{children:c}),n.jsx(fi,{children:f}),y&&n.jsx(yi,{onClick:y,children:"View Insight"})]})]}),xi=d.styled_default("div")({name:"Container",class:"c1eptrjd",propsAsIs:!1}),gi=d.styled_default("div")({name:"CloseIconWrap",class:"crylm65",propsAsIs:!1}),wi=()=>d.n1,_i=d.styled_default(wi())({name:"CloseIcon",class:"c9mrcz7",propsAsIs:!0}),Ii=d.styled_default("div")({name:"Header",class:"hw3lzv4",propsAsIs:!1}),Ai=()=>d.n1,vi=d.styled_default(Ai())({name:"TypeIcon",class:"t1rrb3kf",propsAsIs:!0}),bi=d.styled_default("span")({name:"TypeName",class:"t1ydnjov",propsAsIs:!1}),Ei=d.styled_default("div")({name:"Question",class:"qlf90cl",propsAsIs:!1}),Bi=d.styled_default("button")({name:"AnswerButton",class:"a1e0nhcl",propsAsIs:!1}),ji=d.styled_default("div")({name:"Container",class:"cjq447q",propsAsIs:!1}),Ti=d.styled_default("div")({name:"ImageContainer",class:"i14egogb",propsAsIs:!1}),Ci=d.styled_default("img")({name:"Image",class:"i2g9g4l",propsAsIs:!1}),Fi=d.styled_default("div")({name:"Details",class:"d1c454nm",propsAsIs:!1}),$i=d.styled_default("div")({name:"Name",class:"n11nigc3",propsAsIs:!1}),Si=d.styled_default("div")({name:"UserName",class:"urxa4k8",propsAsIs:!1}),ki=({image:o,name:s,userName:c,verified:f})=>n.jsxs(ji,{children:[n.jsx(Ti,{children:n.jsx(Ci,{src:o})}),n.jsxs(Fi,{children:[n.jsxs($i,{children:[s," ",f&&n.jsx(d.n1,{name:"icon-twitter-verified"})]}),n.jsx(Si,{children:c})]})]}),Li=d.styled_default("div")({name:"Container",class:"c1t4f0x4",propsAsIs:!1}),Ri=d.styled_default("button")({name:"ActionBtn",class:"a16w1nl6",propsAsIs:!1}),Ni=d.styled_default("div")({name:"Body",class:"b14u54rf",propsAsIs:!1}),Ui=d.styled_default("img")({name:"Image",class:"i1hxm6zo",propsAsIs:!1}),zi=d.styled_default("div")({name:"Details",class:"d1s19yop",propsAsIs:!1}),Oi=d.styled_default("div")({name:"QuoteWrap",class:"q1qyx94r",propsAsIs:!1}),Di=d.styled_default("blockquote")({name:"Quote",class:"qs97clu",propsAsIs:!1}),qi=({account:o,body:s,image:c,title:f,action:y})=>n.jsxs(Li,{children:[n.jsx(Oi,{children:n.jsx(Di,{children:f})}),n.jsxs(zi,{children:[n.jsx(ki,{...o}),n.jsx(Ni,{children:s}),c&&n.jsx(Ui,{src:c})]}),y&&n.jsx(Ri,{onClick:y,children:"View Tweet"})]}),Qe=({close:o,action:s,data:{questionType:c,question:f,insight:y,tweet:m}})=>{const h=ut[c];return h?n.jsxs(xi,{children:[n.jsx(gi,{onClick:o,children:n.jsx(_i,{name:"icon-cross"})}),c!==U.QuestionType.TWEET&&n.jsxs(Ii,{children:[n.jsx(vi,{"data-type-trivia":c===U.QuestionType.TRIVIA,"data-type-poll":c===U.QuestionType.POLL,name:h.iconName}),n.jsx(bi,{children:h.label})]}),c===U.QuestionType.FACTOID&&n.jsx(mi,{...y,action:s}),c===U.QuestionType.TWEET&&n.jsx(qi,{...m,action:s}),c!==U.QuestionType.FACTOID&&c!==U.QuestionType.TWEET&&n.jsxs(n.Fragment,{children:[n.jsx(Ei,{children:f==null?void 0:f.title}),n.jsx(Bi,{onClick:s,children:"Answer"})]})]}):null},ie=d.styled_default("div")({name:"BGWrap",class:"b1dqe0sz",propsAsIs:!1}),O=d.styled_default("div")({name:"BGLineBase",class:"b1v6w7ni",propsAsIs:!1}),Pi=()=>O,Mi=d.styled_default(Pi())({name:"BGOneLineOne",class:"b2nqb1p",propsAsIs:!0}),Wi=()=>O,Gi=d.styled_default(Wi())({name:"BGOneLineTwo",class:"b1xxgmbk",propsAsIs:!0}),Hi=()=>O,Qi=d.styled_default(Hi())({name:"BGOneLineThree",class:"b63lwcb",propsAsIs:!0}),Yi=()=>O,Ye=d.styled_default(Yi())({name:"BGTwoLineOne",class:"b2iah4",propsAsIs:!0}),Vi=()=>O,Ve=d.styled_default(Vi())({name:"BGTwoLineTwo",class:"b1xezvf6",propsAsIs:!0}),Ki=()=>O,Ke=d.styled_default(Ki())({name:"BGTwoLineThree",class:"b1jz1hg0",propsAsIs:!0}),Xi=()=>O,Xe=d.styled_default(Xi())({name:"BGThreeLineOne",class:"b18ho1tk",propsAsIs:!0}),Ji=()=>O,Je=d.styled_default(Ji())({name:"BGThreeLineTwo",class:"b14uvjfm",propsAsIs:!0}),Zi=()=>O,Ze=d.styled_default(Zi())({name:"BGThreeLineThree",class:"b11c3ns7",propsAsIs:!0}),er=()=>O,et=d.styled_default(er())({name:"BGThreeLineFour",class:"b1bqhhet",propsAsIs:!0}),tr=()=>O,ir=d.styled_default(tr())({name:"BGFourLineOne",class:"b1xyzi7o",propsAsIs:!0}),rr=()=>O,nr=d.styled_default(rr())({name:"BGFourLineTwo",class:"byo0rup",propsAsIs:!0}),sr=()=>O,or=d.styled_default(sr())({name:"BGFourLineThree",class:"b1oyiqgv",propsAsIs:!0}),ar=()=>O,lr=d.styled_default(ar())({name:"BGFourLineFour",class:"bx3ddqw",propsAsIs:!0}),cr=({step:o,correct:s})=>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(Qi,{})]}),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,{})]}),s?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(ir,{}),n.jsx(nr,{}),n.jsx(or,{}),n.jsx(lr,{})]})]}),ur=d.styled_default("div")({name:"Container",class:"c1pgyo67",propsAsIs:!1}),dr="hx17qu6",we=({children:o,style:s,className:c,hiding:f})=>n.jsx(ur,{style:s,className:d.cx_default(c,f&&dr),children:o}),hr=118,pr=()=>we,fr=d.styled_default(pr())({name:"Container",class:"c10131zw",propsAsIs:!0}),yr=d.styled_default("div")({name:"InnerContainer",class:"ir6k2eo",propsAsIs:!1}),re=d.styled_default("div")({name:"Content",class:"c1hwoq9l",propsAsIs:!1}),ne=d.styled_default("div")({name:"Title",class:"t4ujo4g",propsAsIs:!1}),pe=d.styled_default("div")({name:"Subtitle",class:"s1pjil1h",propsAsIs:!1}),mr=()=>pe,tt=d.styled_default(mr())({name:"SubtitleFG",class:"s1iorwr9",propsAsIs:!0}),ye=d.styled_default("div")({name:"AnswerText",class:"a51sv9d",propsAsIs:!1}),xr=()=>d.n1,be=d.styled_default(xr())({name:"FeedbackIcon",class:"f1lbk2ye",propsAsIs:!0}),it=d.styled_default("button")({name:"CloseButton",class:"crcvk3t",propsAsIs:!1}),gr=()=>d.n1,rt=d.styled_default(gr())({name:"CloseIcon",class:"c33p82r",propsAsIs:!0}),se=(o,s)=>o===s?"translateY(0px)":o>s?"translateY(100%)":"translateY(-100%)",wr=({close:o,votedAnswer:s,correct:c,correctAnswerTitle:f,questionTitle:y,saveHeight:m,style:h,hiding:a})=>{const[g,I]=A.useState(1),_=A.useRef({});A.useEffect(()=>{const x=setInterval(()=>{I(w=>c&&w>4||!c&&w>3?w:++w)},6e3);return()=>clearInterval(x)},[c]),A.useEffect(()=>{var x,w;_.current[g]&&m(((w=(x=_.current[g])==null?void 0:x.getBoundingClientRect())==null?void 0:w.height)||hr)},[g,m]);const E=x=>w=>{_.current&&(_.current[x]=w)};return n.jsx(fr,{style:h.height?h:{...h,paddingTop:0,paddingBottom:0},hiding:a,children:n.jsxs(yr,{style:{height:h.height,minHeight:h.height,backgroundColor:g>3?"var(--color-white)":"var(--color-primary-green2)"},children:[n.jsx(cr,{step:g,correct:c}),n.jsxs(re,{ref:E(1),style:{transform:se(1,g)},children:[n.jsx(ne,{children:"Master"}),n.jsx(tt,{children:"FEATURED GROUPS +"})]}),n.jsxs(re,{ref:E(2),style:{transform:se(2,g)},children:[n.jsx(ne,{children:"Prediction results are in!"}),n.jsx(tt,{children:"FEATURED GROUPS +"})]}),n.jsxs(re,{ref:E(3),style:{transform:se(3,g)},children:[n.jsx(ne,{children:y}),n.jsx(pe,{children:n.jsxs(ye,{children:["Your Pick: ",s==null?void 0:s.title]})})]}),c?n.jsxs(n.Fragment,{children:[n.jsxs(re,{ref:E(4),style:{transform:se(4,g),color:"var(--color-primary-green1)"},children:[n.jsx(ne,{children:"Congratulations! You answered correctly."}),n.jsxs(pe,{children:[n.jsx(be,{name:"selected"}),n.jsxs(ye,{children:["Your Pick: ",s==null?void 0:s.title]})]})]}),n.jsxs(re,{ref:E(5),style:{transform:se(5,g),color:"var(--color-primary-green1)"},children:[n.jsxs(ne,{children:["+",s==null?void 0:s.points," points"]}),n.jsxs(pe,{children:[n.jsx(be,{name:"selected"}),n.jsxs(ye,{children:["Your Pick: ",s==null?void 0:s.title]})]}),n.jsx(it,{onClick:o,children:n.jsx(rt,{name:"icon-cross"})})]})]}):n.jsxs(re,{ref:E(4),style:{transform:se(4,g)},children:[n.jsxs(ne,{style:{color:"var(--color-neutrals-gray9)"},children:["Better luck next time! Correct: ",f,"."]}),n.jsxs(pe,{style:{color:"var(--color-secondary-red1)"},children:[n.jsx(be,{name:"circleClose"}),n.jsxs(ye,{children:["Your Pick: ",s==null?void 0:s.title]})]}),n.jsx(it,{onClick:o,children:n.jsx(rt,{name:"icon-cross"})})]})]})})};var ht={},pt={},_e={};_e.byteLength=Ar;_e.toByteArray=br;_e.fromByteArray=jr;var H=[],q=[],_r=typeof Uint8Array<"u"?Uint8Array:Array,Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var oe=0,Ir=Ee.length;oe<Ir;++oe)H[oe]=Ee[oe],q[Ee.charCodeAt(oe)]=oe;q["-".charCodeAt(0)]=62;q["_".charCodeAt(0)]=63;function ft(o){var s=o.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=o.indexOf("=");c===-1&&(c=s);var f=c===s?0:4-c%4;return[c,f]}function Ar(o){var s=ft(o),c=s[0],f=s[1];return(c+f)*3/4-f}function vr(o,s,c){return(s+c)*3/4-c}function br(o){var s,c=ft(o),f=c[0],y=c[1],m=new _r(vr(o,f,y)),h=0,a=y>0?f-4:f,g;for(g=0;g<a;g+=4)s=q[o.charCodeAt(g)]<<18|q[o.charCodeAt(g+1)]<<12|q[o.charCodeAt(g+2)]<<6|q[o.charCodeAt(g+3)],m[h++]=s>>16&255,m[h++]=s>>8&255,m[h++]=s&255;return y===2&&(s=q[o.charCodeAt(g)]<<2|q[o.charCodeAt(g+1)]>>4,m[h++]=s&255),y===1&&(s=q[o.charCodeAt(g)]<<10|q[o.charCodeAt(g+1)]<<4|q[o.charCodeAt(g+2)]>>2,m[h++]=s>>8&255,m[h++]=s&255),m}function Er(o){return H[o>>18&63]+H[o>>12&63]+H[o>>6&63]+H[o&63]}function Br(o,s,c){for(var f,y=[],m=s;m<c;m+=3)f=(o[m]<<16&16711680)+(o[m+1]<<8&65280)+(o[m+2]&255),y.push(Er(f));return y.join("")}function jr(o){for(var s,c=o.length,f=c%3,y=[],m=16383,h=0,a=c-f;h<a;h+=m)y.push(Br(o,h,h+m>a?a:h+m));return f===1?(s=o[c-1],y.push(H[s>>2]+H[s<<4&63]+"==")):f===2&&(s=(o[c-2]<<8)+o[c-1],y.push(H[s>>10]+H[s>>4&63]+H[s<<2&63]+"=")),y.join("")}var Le={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Le.read=function(o,s,c,f,y){var m,h,a=y*8-f-1,g=(1<<a)-1,I=g>>1,_=-7,E=c?y-1:0,x=c?-1:1,w=o[s+E];for(E+=x,m=w&(1<<-_)-1,w>>=-_,_+=a;_>0;m=m*256+o[s+E],E+=x,_-=8);for(h=m&(1<<-_)-1,m>>=-_,_+=f;_>0;h=h*256+o[s+E],E+=x,_-=8);if(m===0)m=1-I;else{if(m===g)return h?NaN:(w?-1:1)*(1/0);h=h+Math.pow(2,f),m=m-I}return(w?-1:1)*h*Math.pow(2,m-f)};Le.write=function(o,s,c,f,y,m){var h,a,g,I=m*8-y-1,_=(1<<I)-1,E=_>>1,x=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=f?0:m-1,v=f?1:-1,B=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(a=isNaN(s)?1:0,h=_):(h=Math.floor(Math.log(s)/Math.LN2),s*(g=Math.pow(2,-h))<1&&(h--,g*=2),h+E>=1?s+=x/g:s+=x*Math.pow(2,1-E),s*g>=2&&(h++,g/=2),h+E>=_?(a=0,h=_):h+E>=1?(a=(s*g-1)*Math.pow(2,y),h=h+E):(a=s*Math.pow(2,E-1)*Math.pow(2,y),h=0));y>=8;o[c+w]=a&255,w+=v,a/=256,y-=8);for(h=h<<y|a,I+=y;I>0;o[c+w]=h&255,w+=v,h/=256,I-=8);o[c+w-v]|=B*128};/*!
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),le=require("./index2.js"),A=require("react"),U=require("@streamlayer/sdk-web-types"),Z=require("@nanostores/react"),he=require("@streamlayer/sdk-web-interfaces"),d=require("./index4.js"),me=require("@streamlayer/sdk-web-notifications"),Pt=({feature:o,sdk:n,children:c,className:f})=>{const m=Z.useStore(o.status),y=Z.useStore(n.sdkStore.slStreamId);return y!=null&&y.loading?s.jsx("div",{className:f,children:"event is loading..."}):y!=null&&y.data?m!==he.FeatureStatus.Ready?s.jsx("div",{className:f,children:"wait feature..."}):c:s.jsx("div",{className:f,children:"event is forbidden..."})},Mt=A.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature.js"))),Wt=({sdk:o,feature:n,className:c})=>{const f=A.useMemo(()=>n&&n.featureConfig.get().type===U.FeatureType.GAMES?s.jsx(Pt,{className:c,sdk:o,feature:n,children:s.jsx(Mt,{className:c,gamification:n,sdk:o})}):null,[o,n,c]);return s.jsx(A.Suspense,{fallback:s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:f})},Gt=d.styled_default("button")({name:"SButton",class:"sxxa0c",propsAsIs:!1}),Ht=d.styled_default("span")({name:"ButtonIcon",class:"b193dcyu",propsAsIs:!1}),Qt=d.styled_default("span")({name:"ButtonLabel",class:"b40tuix",propsAsIs:!1}),ke=({disabled:o,active:n,onClick:c,label:f,icon:m})=>s.jsx(Gt,{onClick:c,disabled:o,"data-selected":n,children:s.jsxs(s.Fragment,{children:[m&&s.jsx(Ht,{children:m}),s.jsx(Qt,{children:f})]})}),Yt=()=>d.o1,Vt=d.styled_default(Yt())({name:"ButtonIcon",class:"b1whzxvd",propsAsIs:!0}),ce="channels",Kt=o=>{var n;return s.jsx(ke,{...o,id:"channels",label:"Channels",icon:s.jsx(Vt,{name:"icon-btn-channels","data-selected":(n=o.active)==null?void 0:n.toString()})})},Xt=()=>d.o1,Jt=d.styled_default(Xt())({name:"ButtonIcon",class:"b11des7c",propsAsIs:!0}),X="featuredGroups",Zt=o=>{var n;return s.jsx(ke,{...o,label:"FG+",id:"featuredGroups",icon:s.jsx(Jt,{name:"icon-btn-feature-groups","data-selected":(n=o.active)==null?void 0:n.toString()})})},ei=()=>d.o1,ti=d.styled_default(ei())({name:"ButtonIcon",class:"b180jd7l",propsAsIs:!0}),ge="leaderboard",ii=o=>{var n;return s.jsx(ke,{...o,label:"Leader Board",id:"leaderboard",icon:s.jsx(ti,{name:"icon-btn-leaderboard","data-selected":(n=o.active)==null?void 0:n.toString()})})},ri=d.styled_default("div")({name:"Buttons",class:"b6tbwuy",propsAsIs:!1}),ni=({children:o,className:n})=>s.jsx(ri,{className:n,children:o}),si=()=>ni,oi=d.styled_default(si())({name:"Navigation",class:"n19lpak2",propsAsIs:!0}),ai=({activeOverlay:o,setActiveOverlay:n,sdkReady:c,className:f})=>s.jsxs(oi,{className:f,children:[s.jsx(Kt,{active:o===ce,onClick:()=>n(ce)}),s.jsx(Zt,{active:o===X,disabled:!c,onClick:()=>{n(X)}}),s.jsx(ii,{active:o===ge,onClick:()=>n(ge)})]}),ut={[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"}},li=d.styled_default("div")({name:"Container",class:"c1bgb86j",propsAsIs:!1}),ci=d.styled_default("video")({name:"Player",class:"p6703cq",propsAsIs:!1}),ui=d.styled_default("img")({name:"Poster",class:"p12ow7zo",propsAsIs:!1}),di=d.styled_default("div")({name:"Control",class:"cdpal9o",propsAsIs:!1}),dt=({poster:o,source:n})=>{const c=A.useRef(null),[f,m]=A.useState(!1),[y,h]=A.useState(!0);return s.jsxs(li,{onClick:()=>{const a=c==null?void 0:c.current;a&&m(g=>g?(a.pause(),!1):(a.play(),h(!1),!0))},children:[s.jsx(ci,{ref:c,src:n,onEnded:()=>{var a;(a=c==null?void 0:c.current)==null||a.load(),m(!1),h(!0)},style:{visibility:y?"hidden":"visible"}}),s.jsx(ui,{src:o,style:{visibility:y?"visible":"hidden"}}),s.jsx(di,{children:!f&&s.jsx(d.o1,{name:"icon-play"})})]})},hi=d.styled_default("div")({name:"InsightContainer",class:"i1pqqgpo",propsAsIs:!1}),pi=d.styled_default("img")({name:"Image",class:"igj7luu",propsAsIs:!1}),fi=d.styled_default("div")({name:"InsightContent",class:"i1qne9g6",propsAsIs:!1}),yi=d.styled_default("h3")({name:"Title",class:"ttpr98r",propsAsIs:!1}),mi=d.styled_default("div")({name:"Description",class:"d17iaqp8",propsAsIs:!1}),xi=d.styled_default("button")({name:"ActionBtn",class:"a16t3y7s",propsAsIs:!1}),gi=({video:o,image:n,heading:c,body:f,action:m})=>s.jsxs(hi,{children:[(o==null?void 0:o.url)&&s.jsx(dt,{source:o.url,poster:o.thumbnailUrl}),n&&!(o!=null&&o.url)&&s.jsx(pi,{src:n}),s.jsxs(fi,{children:[s.jsx(yi,{children:c}),s.jsx(mi,{children:f}),m&&s.jsx(xi,{onClick:m,children:"View Insight"})]})]}),wi=d.styled_default("div")({name:"Container",class:"c1eptrjd",propsAsIs:!1}),_i=d.styled_default("div")({name:"CloseIconWrap",class:"crylm65",propsAsIs:!1}),Ii=()=>d.o1,Ai=d.styled_default(Ii())({name:"CloseIcon",class:"c9mrcz7",propsAsIs:!0}),vi=d.styled_default("div")({name:"Header",class:"hw3lzv4",propsAsIs:!1}),bi=()=>d.o1,Ei=d.styled_default(bi())({name:"TypeIcon",class:"t1rrb3kf",propsAsIs:!0}),Bi=d.styled_default("span")({name:"TypeName",class:"t1ydnjov",propsAsIs:!1}),ji=d.styled_default("div")({name:"Question",class:"qlf90cl",propsAsIs:!1}),Ti=d.styled_default("button")({name:"AnswerButton",class:"a1e0nhcl",propsAsIs:!1}),Ci=d.styled_default("div")({name:"Container",class:"cjq447q",propsAsIs:!1}),Fi=d.styled_default("div")({name:"ImageContainer",class:"i14egogb",propsAsIs:!1}),$i=d.styled_default("img")({name:"Image",class:"i2g9g4l",propsAsIs:!1}),Si=()=>d.o1,ki=d.styled_default(Si())({name:"TwitterIcon",class:"t1c454nm",propsAsIs:!0}),Li=d.styled_default("div")({name:"Details",class:"d11nigc3",propsAsIs:!1}),Ri=d.styled_default("div")({name:"Name",class:"nrxa4k8",propsAsIs:!1}),Ni=d.styled_default("div")({name:"UserName",class:"u1p051g3",propsAsIs:!1}),Ui=({image:o,name:n,userName:c,verified:f})=>s.jsxs(Ci,{children:[o&&s.jsxs(Fi,{children:[s.jsx($i,{src:o}),s.jsx(ki,{name:"twitter"})]}),s.jsxs(Li,{children:[s.jsxs(Ri,{children:[n," ",f&&s.jsx(d.o1,{name:"icon-twitter-verified"})]}),c&&s.jsxs(Ni,{children:["@",c]})]})]}),zi=d.styled_default("div")({name:"Container",class:"c1kzqw87",propsAsIs:!1}),Oi=d.styled_default("div")({name:"Details",class:"d9r1hf9",propsAsIs:!1}),Di=d.styled_default("div")({name:"Body",class:"bezygt5",propsAsIs:!1}),ht=({image:o,body:n,account:c,accountVerified:f})=>s.jsx(zi,{children:s.jsxs(Oi,{children:[s.jsx(Ui,{image:o,name:c,userName:c,verified:f}),s.jsx(Di,{children:n})]})}),qi=d.styled_default("div")({name:"Container",class:"c1t4f0x4",propsAsIs:!1}),Pi=d.styled_default("button")({name:"ActionBtn",class:"a16w1nl6",propsAsIs:!1}),Mi=d.styled_default("div")({name:"QuoteWrap",class:"q14u54rf",propsAsIs:!1}),Wi=d.styled_default("blockquote")({name:"Quote",class:"q1hxm6zo",propsAsIs:!1}),Gi=({action:o,...n})=>s.jsxs(qi,{children:[n.title&&s.jsx(Mi,{children:s.jsx(Wi,{children:n.title})}),s.jsx(ht,{...n}),o&&s.jsx(Pi,{onClick:o,children:"View Insight"})]}),Qe=({close:o,action:n,data:{questionType:c,question:f,insight:m,tweet:y}})=>{const h=ut[c];return h?s.jsxs(wi,{children:[s.jsx(_i,{onClick:o,children:s.jsx(Ai,{name:"icon-cross"})}),c!==U.QuestionType.TWEET&&s.jsxs(vi,{children:[s.jsx(Ei,{"data-type-trivia":c===U.QuestionType.TRIVIA,"data-type-poll":c===U.QuestionType.POLL,name:h.iconName}),s.jsx(Bi,{children:h.label})]}),c===U.QuestionType.FACTOID&&s.jsx(gi,{...m,action:n}),c===U.QuestionType.TWEET&&s.jsx(Gi,{...y,action:n}),c!==U.QuestionType.FACTOID&&c!==U.QuestionType.TWEET&&s.jsxs(s.Fragment,{children:[s.jsx(ji,{children:f==null?void 0:f.title}),s.jsx(Ti,{onClick:n,children:"Answer"})]})]}):null},ie=d.styled_default("div")({name:"BGWrap",class:"b1dqe0sz",propsAsIs:!1}),O=d.styled_default("div")({name:"BGLineBase",class:"b1v6w7ni",propsAsIs:!1}),Hi=()=>O,Qi=d.styled_default(Hi())({name:"BGOneLineOne",class:"b2nqb1p",propsAsIs:!0}),Yi=()=>O,Vi=d.styled_default(Yi())({name:"BGOneLineTwo",class:"b1xxgmbk",propsAsIs:!0}),Ki=()=>O,Xi=d.styled_default(Ki())({name:"BGOneLineThree",class:"b63lwcb",propsAsIs:!0}),Ji=()=>O,Ye=d.styled_default(Ji())({name:"BGTwoLineOne",class:"b2iah4",propsAsIs:!0}),Zi=()=>O,Ve=d.styled_default(Zi())({name:"BGTwoLineTwo",class:"b1xezvf6",propsAsIs:!0}),er=()=>O,Ke=d.styled_default(er())({name:"BGTwoLineThree",class:"b1jz1hg0",propsAsIs:!0}),tr=()=>O,Xe=d.styled_default(tr())({name:"BGThreeLineOne",class:"b18ho1tk",propsAsIs:!0}),ir=()=>O,Je=d.styled_default(ir())({name:"BGThreeLineTwo",class:"b14uvjfm",propsAsIs:!0}),rr=()=>O,Ze=d.styled_default(rr())({name:"BGThreeLineThree",class:"b11c3ns7",propsAsIs:!0}),nr=()=>O,et=d.styled_default(nr())({name:"BGThreeLineFour",class:"b1bqhhet",propsAsIs:!0}),sr=()=>O,or=d.styled_default(sr())({name:"BGFourLineOne",class:"b1xyzi7o",propsAsIs:!0}),ar=()=>O,lr=d.styled_default(ar())({name:"BGFourLineTwo",class:"byo0rup",propsAsIs:!0}),cr=()=>O,ur=d.styled_default(cr())({name:"BGFourLineThree",class:"b1oyiqgv",propsAsIs:!0}),dr=()=>O,hr=d.styled_default(dr())({name:"BGFourLineFour",class:"bx3ddqw",propsAsIs:!0}),pr=({step:o,correct:n})=>s.jsxs(s.Fragment,{children:[s.jsxs(ie,{"data-active":o===1,"data-first-screen":"true",children:[s.jsx(Qi,{}),s.jsx(Vi,{}),s.jsx(Xi,{})]}),s.jsxs(ie,{"data-active":o===2,children:[s.jsx(Ye,{}),s.jsx(Ve,{}),s.jsx(Ke,{})]}),s.jsxs(ie,{"data-active":o===3,children:[s.jsx(Ye,{}),s.jsx(Ve,{}),s.jsx(Ke,{})]}),n?s.jsxs(s.Fragment,{children:[s.jsxs(ie,{"data-active":o===4,"data-correct":"false",children:[s.jsx(Xe,{}),s.jsx(Je,{}),s.jsx(Ze,{}),s.jsx(et,{})]}),s.jsxs(ie,{"data-active":o===5,"data-correct":"false","data-last-screen":"true",children:[s.jsx(Xe,{}),s.jsx(Je,{}),s.jsx(Ze,{}),s.jsx(et,{})]})]}):s.jsxs(ie,{"data-active":o===4,"data-correct":"false","data-last-screen":"true",children:[s.jsx(or,{}),s.jsx(lr,{}),s.jsx(ur,{}),s.jsx(hr,{})]})]}),fr=d.styled_default("div")({name:"Container",class:"c1pgyo67",propsAsIs:!1}),yr="hx17qu6",we=({children:o,style:n,className:c,hiding:f})=>s.jsx(fr,{style:n,className:d.cx_default(c,f&&yr),children:o}),mr=118,xr=()=>we,gr=d.styled_default(xr())({name:"Container",class:"c10131zw",propsAsIs:!0}),wr=d.styled_default("div")({name:"InnerContainer",class:"ir6k2eo",propsAsIs:!1}),re=d.styled_default("div")({name:"Content",class:"c1hwoq9l",propsAsIs:!1}),ne=d.styled_default("div")({name:"Title",class:"t4ujo4g",propsAsIs:!1}),pe=d.styled_default("div")({name:"Subtitle",class:"s1pjil1h",propsAsIs:!1}),_r=()=>pe,tt=d.styled_default(_r())({name:"SubtitleFG",class:"s1iorwr9",propsAsIs:!0}),ye=d.styled_default("div")({name:"AnswerText",class:"a51sv9d",propsAsIs:!1}),Ir=()=>d.o1,be=d.styled_default(Ir())({name:"FeedbackIcon",class:"f1lbk2ye",propsAsIs:!0}),it=d.styled_default("button")({name:"CloseButton",class:"crcvk3t",propsAsIs:!1}),Ar=()=>d.o1,rt=d.styled_default(Ar())({name:"CloseIcon",class:"c33p82r",propsAsIs:!0}),se=(o,n)=>o===n?"translateY(0px)":o>n?"translateY(100%)":"translateY(-100%)",vr=({close:o,votedAnswer:n,correct:c,correctAnswerTitle:f,questionTitle:m,saveHeight:y,style:h,hiding:a})=>{const[g,I]=A.useState(1),_=A.useRef({});A.useEffect(()=>{const x=setInterval(()=>{I(w=>c&&w>4||!c&&w>3?w:++w)},6e3);return()=>clearInterval(x)},[c]),A.useEffect(()=>{var x,w;_.current[g]&&y(((w=(x=_.current[g])==null?void 0:x.getBoundingClientRect())==null?void 0:w.height)||mr)},[g,y]);const E=x=>w=>{_.current&&(_.current[x]=w)};return s.jsx(gr,{style:h.height?h:{...h,paddingTop:0,paddingBottom:0},hiding:a,children:s.jsxs(wr,{style:{height:h.height,minHeight:h.height,backgroundColor:g>3?"var(--color-white)":"var(--color-primary-green2)"},children:[s.jsx(pr,{step:g,correct:c}),s.jsxs(re,{ref:E(1),style:{transform:se(1,g)},children:[s.jsx(ne,{children:"Master"}),s.jsx(tt,{children:"FEATURED GROUPS +"})]}),s.jsxs(re,{ref:E(2),style:{transform:se(2,g)},children:[s.jsx(ne,{children:"Prediction results are in!"}),s.jsx(tt,{children:"FEATURED GROUPS +"})]}),s.jsxs(re,{ref:E(3),style:{transform:se(3,g)},children:[s.jsx(ne,{children:m}),s.jsx(pe,{children:s.jsxs(ye,{children:["Your Pick: ",n==null?void 0:n.title]})})]}),c?s.jsxs(s.Fragment,{children:[s.jsxs(re,{ref:E(4),style:{transform:se(4,g),color:"var(--color-primary-green1)"},children:[s.jsx(ne,{children:"Congratulations! You answered correctly."}),s.jsxs(pe,{children:[s.jsx(be,{name:"selected"}),s.jsxs(ye,{children:["Your Pick: ",n==null?void 0:n.title]})]})]}),s.jsxs(re,{ref:E(5),style:{transform:se(5,g),color:"var(--color-primary-green1)"},children:[s.jsxs(ne,{children:["+",n==null?void 0:n.points," points"]}),s.jsxs(pe,{children:[s.jsx(be,{name:"selected"}),s.jsxs(ye,{children:["Your Pick: ",n==null?void 0:n.title]})]}),s.jsx(it,{onClick:o,children:s.jsx(rt,{name:"icon-cross"})})]})]}):s.jsxs(re,{ref:E(4),style:{transform:se(4,g)},children:[s.jsxs(ne,{style:{color:"var(--color-neutrals-gray9)"},children:["Better luck next time! Correct: ",f,"."]}),s.jsxs(pe,{style:{color:"var(--color-secondary-red1)"},children:[s.jsx(be,{name:"circleClose"}),s.jsxs(ye,{children:["Your Pick: ",n==null?void 0:n.title]})]}),s.jsx(it,{onClick:o,children:s.jsx(rt,{name:"icon-cross"})})]})]})})};var pt={},ft={},_e={};_e.byteLength=Br;_e.toByteArray=Tr;_e.fromByteArray=$r;var H=[],q=[],br=typeof Uint8Array<"u"?Uint8Array:Array,Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var oe=0,Er=Ee.length;oe<Er;++oe)H[oe]=Ee[oe],q[Ee.charCodeAt(oe)]=oe;q["-".charCodeAt(0)]=62;q["_".charCodeAt(0)]=63;function yt(o){var n=o.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=o.indexOf("=");c===-1&&(c=n);var f=c===n?0:4-c%4;return[c,f]}function Br(o){var n=yt(o),c=n[0],f=n[1];return(c+f)*3/4-f}function jr(o,n,c){return(n+c)*3/4-c}function Tr(o){var n,c=yt(o),f=c[0],m=c[1],y=new br(jr(o,f,m)),h=0,a=m>0?f-4:f,g;for(g=0;g<a;g+=4)n=q[o.charCodeAt(g)]<<18|q[o.charCodeAt(g+1)]<<12|q[o.charCodeAt(g+2)]<<6|q[o.charCodeAt(g+3)],y[h++]=n>>16&255,y[h++]=n>>8&255,y[h++]=n&255;return m===2&&(n=q[o.charCodeAt(g)]<<2|q[o.charCodeAt(g+1)]>>4,y[h++]=n&255),m===1&&(n=q[o.charCodeAt(g)]<<10|q[o.charCodeAt(g+1)]<<4|q[o.charCodeAt(g+2)]>>2,y[h++]=n>>8&255,y[h++]=n&255),y}function Cr(o){return H[o>>18&63]+H[o>>12&63]+H[o>>6&63]+H[o&63]}function Fr(o,n,c){for(var f,m=[],y=n;y<c;y+=3)f=(o[y]<<16&16711680)+(o[y+1]<<8&65280)+(o[y+2]&255),m.push(Cr(f));return m.join("")}function $r(o){for(var n,c=o.length,f=c%3,m=[],y=16383,h=0,a=c-f;h<a;h+=y)m.push(Fr(o,h,h+y>a?a:h+y));return f===1?(n=o[c-1],m.push(H[n>>2]+H[n<<4&63]+"==")):f===2&&(n=(o[c-2]<<8)+o[c-1],m.push(H[n>>10]+H[n>>4&63]+H[n<<2&63]+"=")),m.join("")}var Le={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Le.read=function(o,n,c,f,m){var y,h,a=m*8-f-1,g=(1<<a)-1,I=g>>1,_=-7,E=c?m-1:0,x=c?-1:1,w=o[n+E];for(E+=x,y=w&(1<<-_)-1,w>>=-_,_+=a;_>0;y=y*256+o[n+E],E+=x,_-=8);for(h=y&(1<<-_)-1,y>>=-_,_+=f;_>0;h=h*256+o[n+E],E+=x,_-=8);if(y===0)y=1-I;else{if(y===g)return h?NaN:(w?-1:1)*(1/0);h=h+Math.pow(2,f),y=y-I}return(w?-1:1)*h*Math.pow(2,y-f)};Le.write=function(o,n,c,f,m,y){var h,a,g,I=y*8-m-1,_=(1<<I)-1,E=_>>1,x=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=f?0:y-1,v=f?1:-1,B=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(a=isNaN(n)?1:0,h=_):(h=Math.floor(Math.log(n)/Math.LN2),n*(g=Math.pow(2,-h))<1&&(h--,g*=2),h+E>=1?n+=x/g:n+=x*Math.pow(2,1-E),n*g>=2&&(h++,g/=2),h+E>=_?(a=0,h=_):h+E>=1?(a=(n*g-1)*Math.pow(2,m),h=h+E):(a=n*Math.pow(2,E-1)*Math.pow(2,m),h=0));m>=8;o[c+w]=a&255,w+=v,a/=256,m-=8);for(h=h<<m|a,I+=m;I>0;o[c+w]=h&255,w+=v,h/=256,I-=8);o[c+w-v]|=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 s=_e,c=Le,f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=a,o.SlowBuffer=C,o.INSPECT_MAX_BYTES=50;const y=2147483647;o.kMaxLength=y,a.TYPED_ARRAY_SUPPORT=m(),!a.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(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function h(i){if(i>y)throw new RangeError('The value "'+i+'" is invalid for option "size"');const e=new Uint8Array(i);return Object.setPrototypeOf(e,a.prototype),e}function a(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 E(i)}return g(i,e,t)}a.poolSize=8192;function g(i,e,t){if(typeof i=="string")return x(i,e);if(ArrayBuffer.isView(i))return v(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 a.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 a.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)}a.from=function(i,e,t){return g(i,e,t)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function I(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 _(i,e,t){return I(i),i<=0?h(i):e!==void 0?typeof t=="string"?h(i).fill(e,t):h(i).fill(e):h(i)}a.alloc=function(i,e,t){return _(i,e,t)};function E(i){return I(i),h(i<0?0:j(i)|0)}a.allocUnsafe=function(i){return E(i)},a.allocUnsafeSlow=function(i){return E(i)};function x(i,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=N(i,e)|0;let r=h(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:j(i.length)|0,t=h(e);for(let r=0;r<e;r+=1)t[r]=i[r]&255;return t}function v(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,a.prototype),r}function L(i){if(a.isBuffer(i)){const e=j(i.length)|0,t=h(e);return t.length===0||i.copy(t,0,0,e),t}if(i.length!==void 0)return typeof i.length!="number"||ve(i.length)?h(0):w(i);if(i.type==="Buffer"&&Array.isArray(i.data))return w(i.data)}function j(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),a.alloc(+i)}a.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==a.prototype},a.compare=function(e,t){if(M(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),M(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.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},a.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}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return a.alloc(0);let r;if(t===void 0)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const l=a.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?(a.isBuffer(p)||(p=a.from(p)),p.copy(l,u)):Uint8Array.prototype.set.call(l,p,u);else if(a.isBuffer(p))p.copy(l,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=p.length}return l};function N(i,e){if(a.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 Ae(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return He(i).length;default:if(l)return r?-1:Ae(i).length;e=(""+e).toLowerCase(),l=!0}}a.byteLength=N;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 $t(this,e,t);case"utf8":case"utf-8":return Ue(this,e,t);case"ascii":return Ct(this,e,t);case"latin1":case"binary":return Ft(this,e,t);case"base64":return jt(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return St(this,e,t);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),r=!0}}a.prototype._isBuffer=!0;function D(i,e,t){const r=i[e];i[e]=i[t],i[t]=r}a.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},a.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},a.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},a.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?Ue(this,0,e):Q.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:a.compare(this,e)===0},a.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+">"},f&&(a.prototype[f]=a.prototype.inspect),a.prototype.compare=function(e,t,r,l,u){if(M(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.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,b=r-t;const $=Math.min(p,b),F=this.slice(l,u),S=e.slice(t,r);for(let T=0;T<$;++T)if(F[T]!==S[T]){p=F[T],b=S[T];break}return p<b?-1:b<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,ve(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=a.from(e,r)),a.isBuffer(e))return e.length===0?-1:Ne(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):Ne(i,[e],t,r,l);throw new TypeError("val must be string, number or Buffer")}function Ne(i,e,t,r,l){let u=1,p=i.length,b=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,b/=2,t/=2}function $(S,T){return u===1?S[T]:S.readUInt16BE(T*u)}let F;if(l){let S=-1;for(F=t;F<p;F++)if($(i,F)===$(e,S===-1?0:F-S)){if(S===-1&&(S=F),F-S+1===b)return S*u}else S!==-1&&(F-=F-S),S=-1}else for(t+b>p&&(t=p-b),F=t;F>=0;F--){let S=!0;for(let T=0;T<b;T++)if($(i,F+T)!==$(e,T)){S=!1;break}if(S)return F}return-1}a.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1},a.prototype.indexOf=function(e,t,r){return Re(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return Re(this,e,t,r,!1)};function At(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 b=parseInt(e.substr(p*2,2),16);if(ve(b))return p;i[t+p]=b}return p}function vt(i,e,t,r){return fe(Ae(e,i.length-t),i,t,r)}function bt(i,e,t,r){return fe(Nt(e),i,t,r)}function Et(i,e,t,r){return fe(He(e),i,t,r)}function Bt(i,e,t,r){return fe(Ut(e,i.length-t),i,t,r)}a.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 At(this,e,t,r);case"utf8":case"utf-8":return vt(this,e,t,r);case"ascii":case"latin1":case"binary":return bt(this,e,t,r);case"base64":return Et(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}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jt(i,e,t){return e===0&&t===i.length?s.fromByteArray(i):s.fromByteArray(i.slice(e,t))}function Ue(i,e,t){t=Math.min(i.length,t);const r=[];let l=e;for(;l<t;){const u=i[l];let p=null,b=u>239?4:u>223?3:u>191?2:1;if(l+b<=t){let $,F,S,T;switch(b){case 1:u<128&&(p=u);break;case 2:$=i[l+1],($&192)===128&&(T=(u&31)<<6|$&63,T>127&&(p=T));break;case 3:$=i[l+1],F=i[l+2],($&192)===128&&(F&192)===128&&(T=(u&15)<<12|($&63)<<6|F&63,T>2047&&(T<55296||T>57343)&&(p=T));break;case 4:$=i[l+1],F=i[l+2],S=i[l+3],($&192)===128&&(F&192)===128&&(S&192)===128&&(T=(u&15)<<18|($&63)<<12|(F&63)<<6|S&63,T>65535&&T<1114112&&(p=T))}}p===null?(p=65533,b=1):p>65535&&(p-=65536,r.push(p>>>10&1023|55296),p=56320|p&1023),r.push(p),l+=b}return Tt(r)}const ze=4096;function Tt(i){const e=i.length;if(e<=ze)return String.fromCharCode.apply(String,i);let t="",r=0;for(;r<e;)t+=String.fromCharCode.apply(String,i.slice(r,r+=ze));return t}function Ct(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 Ft(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 $t(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+=zt[i[u]];return l}function St(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}a.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,a.prototype),l};function R(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")}a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||R(e,t,this.length);let l=this[e],u=1,p=0;for(;++p<t&&(u*=256);)l+=this[e+p]*u;return l},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||R(e,t,this.length);let l=this[e+--t],u=1;for(;t>0&&(u*=256);)l+=this[e+--t]*u;return l},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e=e>>>0,t||R(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||R(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.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)&&de(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))}),a.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)&&de(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)}),a.prototype.readIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||R(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},a.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||R(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},a.prototype.readInt8=function(e,t){return e=e>>>0,t||R(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,t){e=e>>>0,t||R(e,2,this.length);const r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},a.prototype.readInt16BE=function(e,t){e=e>>>0,t||R(e,2,this.length);const r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},a.prototype.readInt32LE=function(e,t){return e=e>>>0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e=e>>>0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.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)&&de(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)}),a.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)&&de(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)}),a.prototype.readFloatLE=function(e,t){return e=e>>>0,t||R(e,4,this.length),c.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e=e>>>0,t||R(e,4,this.length),c.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||R(e,8,this.length),c.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||R(e,8,this.length),c.read(this,e,!1,52,8)};function z(i,e,t,r,l,u){if(!a.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")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,l){if(e=+e,t=t>>>0,r=r>>>0,!l){const b=Math.pow(2,8*r)-1;z(this,e,t,r,b,0)}let u=1,p=0;for(this[t]=e&255;++p<r&&(u*=256);)this[t+p]=e/u&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,l){if(e=+e,t=t>>>0,r=r>>>0,!l){const b=Math.pow(2,8*r)-1;z(this,e,t,r,b,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},a.prototype.writeUint8=a.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},a.prototype.writeUint16LE=a.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},a.prototype.writeUint16BE=a.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},a.prototype.writeUint32LE=a.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},a.prototype.writeUint32BE=a.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 Oe(i,e,t,r,l){Ge(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 De(i,e,t,r,l){Ge(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}a.prototype.writeBigUInt64LE=K(function(e,t=0){return Oe(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=K(function(e,t=0){return De(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,r,l){if(e=+e,t=t>>>0,!l){const $=Math.pow(2,8*r-1);z(this,e,t,r,$-1,-$)}let u=0,p=1,b=0;for(this[t]=e&255;++u<r&&(p*=256);)e<0&&b===0&&this[t+u-1]!==0&&(b=1),this[t+u]=(e/p>>0)-b&255;return t+r},a.prototype.writeIntBE=function(e,t,r,l){if(e=+e,t=t>>>0,!l){const $=Math.pow(2,8*r-1);z(this,e,t,r,$-1,-$)}let u=r-1,p=1,b=0;for(this[t+u]=e&255;--u>=0&&(p*=256);)e<0&&b===0&&this[t+u+1]!==0&&(b=1),this[t+u]=(e/p>>0)-b&255;return t+r},a.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},a.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},a.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},a.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},a.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},a.prototype.writeBigInt64LE=K(function(e,t=0){return Oe(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=K(function(e,t=0){return De(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 Pe(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}a.prototype.writeFloatLE=function(e,t,r){return Pe(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return Pe(this,e,t,!1,r)};function Me(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}a.prototype.writeDoubleLE=function(e,t,r){return Me(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return Me(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,l){if(!a.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},a.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"&&!a.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=a.isBuffer(e)?e:a.from(e,l),b=p.length;if(b===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(u=0;u<r-t;++u)this[u+t]=p[u%b]}return this};const ee={};function Ie(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}`}}}Ie("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ie("ERR_INVALID_ARG_TYPE",function(i,e){return`The "${i}" argument must be of type number. Received type ${typeof e}`},TypeError),Ie("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 kt(i,e,t){te(e,"offset"),(i[e]===void 0||i[e+t]===void 0)&&de(e,i.length-(t+1))}function Ge(i,e,t,r,l,u){if(i>t||i<e){const p=typeof e=="bigint"?"n":"";let b;throw u>3?e===0||e===BigInt(0)?b=`>= 0${p} and < 2${p} ** ${(u+1)*8}${p}`:b=`>= -(2${p} ** ${(u+1)*8-1}${p}) and < 2 ** ${(u+1)*8-1}${p}`:b=`>= ${e}${p} and <= ${t}${p}`,new ee.ERR_OUT_OF_RANGE("value",b,i)}kt(r,l,u)}function te(i,e){if(typeof i!="number")throw new ee.ERR_INVALID_ARG_TYPE(e,"number",i)}function de(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 Lt=/[^+/0-9A-Za-z-_]/g;function Rt(i){if(i=i.split("=")[0],i=i.trim().replace(Lt,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function Ae(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 Nt(i){const e=[];for(let t=0;t<i.length;++t)e.push(i.charCodeAt(t)&255);return e}function Ut(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 He(i){return s.toByteArray(Rt(i))}function fe(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 ve(i){return i!==i}const zt=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"?Ot:i}function Ot(){throw new Error("BigInt not supported")}})(pt);var yt={exports:{}},k=yt.exports={},W,G;function Te(){throw new Error("setTimeout has not been defined")}function Ce(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?W=setTimeout:W=Te}catch{W=Te}try{typeof clearTimeout=="function"?G=clearTimeout:G=Ce}catch{G=Ce}})();function mt(o){if(W===setTimeout)return setTimeout(o,0);if((W===Te||!W)&&setTimeout)return W=setTimeout,setTimeout(o,0);try{return W(o,0)}catch{try{return W.call(null,o,0)}catch{return W.call(this,o,0)}}}function Tr(o){if(G===clearTimeout)return clearTimeout(o);if((G===Ce||!G)&&clearTimeout)return G=clearTimeout,clearTimeout(o);try{return G(o)}catch{try{return G.call(null,o)}catch{return G.call(this,o)}}}var Y=[],ue=!1,J,xe=-1;function Cr(){!ue||!J||(ue=!1,J.length?Y=J.concat(Y):xe=-1,Y.length&&xt())}function xt(){if(!ue){var o=mt(Cr);ue=!0;for(var s=Y.length;s;){for(J=Y,Y=[];++xe<s;)J&&J[xe].run();xe=-1,s=Y.length}J=null,ue=!1,Tr(o)}}k.nextTick=function(o){var s=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)s[c-1]=arguments[c];Y.push(new gt(o,s)),Y.length===1&&!ue&&mt(xt)};function gt(o,s){this.fun=o,this.array=s}gt.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 Fr=yt.exports;(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const s=pt,c=Fr,f=h=>h&&h.__esModule?h:{default:h},y=f(c),m=globalThis||void 0||self;Object.defineProperty(o,"Buffer",{enumerable:!0,get:()=>s.Buffer}),Object.defineProperty(o,"process",{enumerable:!0,get:()=>y.default}),o.global=m})(ht);let P;typeof window<"u"?P=window:typeof self<"u"?P=self:P=ht.global;let Fe=null,$e=null;const nt=20,Be=P.clearTimeout,st=P.setTimeout,je=P.cancelAnimationFrame||P.mozCancelAnimationFrame||P.webkitCancelAnimationFrame,ot=P.requestAnimationFrame||P.mozRequestAnimationFrame||P.webkitRequestAnimationFrame;je==null||ot==null?(Fe=Be,$e=function(s){return st(s,nt)}):(Fe=function([s,c]){je(s),Be(c)},$e=function(s){const c=ot(function(){Be(f),s()}),f=st(function(){je(c),s()},nt);return[c,f]});function $r(o){let s,c,f,y,m,h,a;const g=typeof document<"u"&&document.attachEvent;if(!g){h=function(j){const C=j.__resizeTriggers__,N=C.firstElementChild,Q=C.lastElementChild,D=N.firstElementChild;Q.scrollLeft=Q.scrollWidth,Q.scrollTop=Q.scrollHeight,D.style.width=N.offsetWidth+1+"px",D.style.height=N.offsetHeight+1+"px",N.scrollLeft=N.scrollWidth,N.scrollTop=N.scrollHeight},m=function(j){return j.offsetWidth!==j.__resizeLast__.width||j.offsetHeight!==j.__resizeLast__.height},a=function(j){if(j.target.className&&typeof j.target.className.indexOf=="function"&&j.target.className.indexOf("contract-trigger")<0&&j.target.className.indexOf("expand-trigger")<0)return;const C=this;h(this),this.__resizeRAF__&&Fe(this.__resizeRAF__),this.__resizeRAF__=$e(function(){m(C)&&(C.__resizeLast__.width=C.offsetWidth,C.__resizeLast__.height=C.offsetHeight,C.__resizeListeners__.forEach(function(D){D.call(C,j)}))})};let x=!1,w="";f="animationstart";const v="Webkit Moz O ms".split(" ");let B="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),L="";{const j=document.createElement("fakeelement");if(j.style.animationName!==void 0&&(x=!0),x===!1){for(let C=0;C<v.length;C++)if(j.style[v[C]+"AnimationName"]!==void 0){L=v[C],w="-"+L.toLowerCase()+"-",f=B[C],x=!0;break}}}c="resizeanim",s="@"+w+"keyframes "+c+" { from { opacity: 0; } to { opacity: 0; } } ",y=w+"animation: 1ms "+c+"; "}const I=function(x){if(!x.getElementById("detectElementResize")){const w=(s||"")+".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%; }',v=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)),v.appendChild(B)}};return{addResizeListener:function(x,w){if(g)x.attachEvent("onresize",w);else{if(!x.__resizeTriggers__){const v=x.ownerDocument,B=P.getComputedStyle(x);B&&B.position==="static"&&(x.style.position="relative"),I(v),x.__resizeLast__={},x.__resizeListeners__=[],(x.__resizeTriggers__=v.createElement("div")).className="resize-triggers";const L=v.createElement("div");L.className="expand-trigger",L.appendChild(v.createElement("div"));const j=v.createElement("div");j.className="contract-trigger",x.__resizeTriggers__.appendChild(L),x.__resizeTriggers__.appendChild(j),x.appendChild(x.__resizeTriggers__),h(x),x.addEventListener("scroll",a,!0),f&&(x.__resizeTriggers__.__animationListener__=function(N){N.animationName===c&&h(x)},x.__resizeTriggers__.addEventListener(f,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",a,!0),x.__resizeTriggers__.__animationListener__&&(x.__resizeTriggers__.removeEventListener(f,x.__resizeTriggers__.__animationListener__),x.__resizeTriggers__.__animationListener__=null);try{x.__resizeTriggers__=!x.removeChild(x.__resizeTriggers__)}catch{}}}}}class wt extends A.Component{constructor(...s){super(...s),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:f,onResize:y}=this.props;if(this._parentNode){var m,h,a,g;const I=window.getComputedStyle(this._parentNode)||{},_=parseFloat((m=I.paddingLeft)!==null&&m!==void 0?m:"0"),E=parseFloat((h=I.paddingRight)!==null&&h!==void 0?h:"0"),x=parseFloat((a=I.paddingTop)!==null&&a!==void 0?a:"0"),w=parseFloat((g=I.paddingBottom)!==null&&g!==void 0?g:"0"),v=this._parentNode.getBoundingClientRect(),B=v.height-x-w,L=v.width-_-E,j=this._parentNode.offsetHeight-x-w,C=this._parentNode.offsetWidth-_-E;(!c&&(this.state.height!==j||this.state.scaledHeight!==B)||!f&&(this.state.width!==C||this.state.scaledWidth!==L))&&(this.setState({height:j,width:C,scaledHeight:B,scaledWidth:L}),typeof y=="function"&&y({height:j,scaledHeight:B,scaledWidth:L,width:C}))}},this._setRef=c=>{this._autoSizer=c}}componentDidMount(){const{nonce:s}=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=$r(s),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:s,defaultHeight:c,defaultWidth:f,disableHeight:y=!1,disableWidth:m=!1,nonce:h,onResize:a,style:g={},tagName:I="div",..._}=this.props,{height:E,scaledHeight:x,scaledWidth:w,width:v}=this.state,B={overflow:"visible"},L={};let j=!1;return y||(E===0&&(j=!0),B.height=0,L.height=E,L.scaledHeight=x),m||(v===0&&(j=!0),B.width=0,L.width=v,L.scaledWidth=w),A.createElement(I,{ref:this._setRef,style:{...B,...g},..._},!j&&s(L))}}const Sr=d.styled_default("div")({name:"Container",class:"c1htq1lb",propsAsIs:!1}),kr=d.styled_default("div")({name:"Content",class:"cjyzpp7",propsAsIs:!1}),Lr=d.styled_default("div")({name:"Graphic",class:"g16mldgz",propsAsIs:!1}),Rr=d.styled_default("div")({name:"Headline",class:"h69js65",propsAsIs:!1}),Nr=d.styled_default("div")({name:"StepsContainer",class:"smm7qmo",propsAsIs:!1}),Ur=d.styled_default("span")({name:"StepIndicator",class:"s17knuw2",propsAsIs:!1}),zr=({width:o,graphicSrc:s,headline:c,stepsCount:f,currentStep:y})=>n.jsxs(Sr,{children:[n.jsxs(kr,{children:[n.jsx(Lr,{"data-centered":y===0,children:n.jsx("img",{src:s,alt:c,width:o||300})}),c&&n.jsx(Rr,{children:c})]}),n.jsx(Nr,{children:Array.from({length:f}).map((m,h)=>n.jsx(Ur,{"data-active":y===h},h))})]}),Or=d.styled_default("div")({name:"Container",class:"c1itm4k7",propsAsIs:!1}),Dr=d.styled_default("div")({name:"IconContainer",class:"i1w4fsni",propsAsIs:!1}),qr=()=>d.n1,Pr=d.styled_default(qr())({name:"InviteGameIcon",class:"i19m85r1",propsAsIs:!0}),Mr=d.styled_default("div")({name:"Content",class:"c1mbu204",propsAsIs:!1}),Wr=d.styled_default("div")({name:"Heading",class:"h1amdqtv",propsAsIs:!1}),Gr=d.styled_default("div")({name:"Subtext",class:"s1lhlj9j",propsAsIs:!1}),Hr=d.styled_default("div")({name:"LinkContainer",class:"l1wot35e",propsAsIs:!1}),Qr=d.styled_default("div")({name:"LinkInfo",class:"l1jdw39q",propsAsIs:!1}),Yr=d.styled_default("span")({name:"LinkTitle",class:"l1cr5mk",propsAsIs:!1}),Vr=d.styled_default("span")({name:"LinkAddress",class:"lvi87q4",propsAsIs:!1}),Kr=()=>d.n1,Xr=d.styled_default(Kr())({name:"LinkIcon",class:"l1pqlvw3",propsAsIs:!0}),Jr=d.styled_default("div")({name:"SocialLinksContainer",class:"s1n7kzeh",propsAsIs:!1}),Zr=d.styled_default("a")({name:"SocialLink",class:"s2m9o9y",propsAsIs:!1}),en=d.styled_default("span")({name:"SocialLinkLabel",class:"sewjbbn",propsAsIs:!1}),_t=({inviteLink:o,socialLinks:s,inviteCardTitle:c,inviteCardSubtext:f,primaryColor:y,className:m})=>n.jsxs(Or,{className:m,children:[n.jsx(Dr,{style:{backgroundColor:y},children:n.jsx(Pr,{name:"invite-game-icon"})}),n.jsxs(Mr,{children:[n.jsx(Wr,{children:c||""}),n.jsx(Gr,{children:f||""})]}),o&&n.jsxs(Hr,{onClick:async()=>{if(o)try{await navigator.clipboard.writeText(o)}catch(h){console.error("Unable to copy to clipboard",h)}},children:[n.jsxs(Qr,{children:[n.jsx(Yr,{children:"Invite link"}),n.jsx(Vr,{children:o})]}),n.jsx(Xr,{name:"icon-copy"})]}),s&&s.length>0&&n.jsx(Jr,{children:s.map(({icon:h,link:a,label:g})=>n.jsxs(Zr,{href:a,target:"_blank",children:[n.jsx(d.n1,{name:h}),n.jsx(en,{children:g})]},a))})]}),tn=d.styled_default("div")({name:"Container",class:"cm0bev",propsAsIs:!1}),rn=d.styled_default("div")({name:"Content",class:"ce7x737",propsAsIs:!1}),nn=d.styled_default("div")({name:"Title",class:"tc2tor6",propsAsIs:!1}),sn=d.styled_default("div")({name:"RulesList",class:"r1k5klql",propsAsIs:!1}),on=d.styled_default("div")({name:"RulesItem",class:"r1tf3ft2",propsAsIs:!1}),an=d.styled_default("div")({name:"RuleIcon",class:"rwpvg1k",propsAsIs:!1}),ln=d.styled_default("div")({name:"RuleText",class:"rbxiag0",propsAsIs:!1}),cn=d.styled_default("button")({name:"TermsButton",class:"t6cyrry",propsAsIs:!1}),un=({rules:o,rulesTitle:s,primaryColor:c})=>n.jsxs(tn,{children:[n.jsxs(rn,{children:[n.jsx(nn,{children:s}),n.jsx(sn,{children:o==null?void 0:o.map(({label:f,icon:y},m)=>n.jsxs(on,{children:[y&&n.jsx(an,{style:{backgroundColor:c},children:n.jsx(d.n1,{name:y,"data-icon":y})}),n.jsx(ln,{children:f})]},m))})]}),n.jsx(cn,{children:"See Terms and Conditions"})]}),dn=d.styled_default("button")({name:"SButton",class:"s1nve60q",propsAsIs:!1}),hn=d.styled_default("span")({name:"ButtonLabel",class:"b1xoswwx",propsAsIs:!1}),pn=({disabled:o,variant:s="primary",onClick:c,children:f,...y})=>n.jsx(dn,{onClick:c,disabled:o,"data-variant":s,...y,children:n.jsx(hn,{children:f})}),fn=d.styled_default("div")({name:"Container",class:"c18uddbs",propsAsIs:!1}),yn=d.styled_default("div")({name:"Content",class:"cvcfjf6",propsAsIs:!1}),mn=d.styled_default("div")({name:"OnboardingHeader",class:"o1ie27lw",propsAsIs:!1}),xn=d.styled_default("button")({name:"CloseBtn",class:"c15cjkwi",propsAsIs:!1}),gn=()=>d.n1,wn=d.styled_default(gn())({name:"IconClose",class:"i1mavjt2",propsAsIs:!0}),_n=d.styled_default("div")({name:"OnboardingFooter",class:"o1x0dyzv",propsAsIs:!1}),In=()=>pn,An=d.styled_default(In())({name:"OnboardingActionBtn",class:"o1jfi9c3",propsAsIs:!0}),ae={steps:!1,rules:!1,inviteCard:!1},vn=({gamification:o,steps:s,rules:c,rulesBtnLabel:f,rulesTitle:y,primaryColor:m,inviteLink:h,socialLinks:a,inviteCardTitle:g,inviteCardSubtext:I,inviteCardBtnLabel:_,onClose:E})=>{const[x,w]=A.useState(0),[v,B]=A.useState(ae);A.useEffect(()=>{s!=null&&s.length?B({...ae,steps:!0}):c!=null&&c.length?B({...ae,rules:!0}):B({...ae,inviteCard:!0})},[]);const L=A.useMemo(()=>v.steps&&x===0?"Continue":v.rules?f||"Got it":v.inviteCard?_||"Play Now":"Next",[v,x,f,_]),j=A.useCallback(()=>{s!=null&&s.length&&x<s.length-1?w(N=>++N):c!=null&&c.length&&v.steps?B({...ae,rules:!0}):v.rules&&B({...ae,inviteCard:!0})},[x,s==null?void 0:s.length,c==null?void 0:c.length,v,w,B]),C=async()=>{await o.onboardingStatus.submitInplay()};return n.jsx(wt,{children:({width:N,height:Q})=>n.jsxs(fn,{style:{width:N,height:Q},children:[n.jsx(mn,{children:n.jsx(xn,{onClick:E,children:n.jsx(wn,{name:"icon-close-btn-gray"})})}),n.jsxs(yn,{children:[v.steps&&(s==null?void 0:s.length)&&n.jsx(zr,{stepsCount:s.length,currentStep:x,...s[x]}),v.rules&&n.jsx(un,{rules:c,rulesTitle:y,primaryColor:m}),v.inviteCard&&n.jsx(_t,{inviteLink:h,inviteCardTitle:g,inviteCardSubtext:I,primaryColor:m,socialLinks:a})]}),n.jsx(_n,{children:n.jsx(An,{onClick:v.inviteCard?C:j,children:L})})]})})},bn=d.styled_default("div")({name:"Container",class:"cocfo2g",propsAsIs:!1}),En=d.styled_default("div")({name:"CloseIconWrap",class:"c1pdhxdk",propsAsIs:!1}),Bn=()=>d.n1,jn=d.styled_default(Bn())({name:"CloseIcon",class:"c1funj3r",propsAsIs:!0}),Tn=d.styled_default("div")({name:"Title",class:"t1okg06y",propsAsIs:!1}),Cn=d.styled_default("img")({name:"SponsorLogo",class:"sb1n923",propsAsIs:!1}),Fn=d.styled_default("div")({name:"PresentsTitle",class:"p1stllxd",propsAsIs:!1}),$n=d.styled_default("div")({name:"Subtitle",class:"s13kvdzw",propsAsIs:!1}),Sn=d.styled_default("div")({name:"Description",class:"dfvmv3t",propsAsIs:!1}),kn=d.styled_default("button")({name:"ActionButton",class:"ay8e3j9",propsAsIs:!1}),at=({close:o,action:s,onboarding:c})=>{var f,y,m,h,a,g,I,_;return n.jsxs(bn,{children:[n.jsx(En,{onClick:o,children:n.jsx(jn,{name:"icon-cross"})}),((y=(f=c==null?void 0:c.titleCard)==null?void 0:f.media)==null?void 0:y.sponsorLogo)&&n.jsxs(Tn,{children:[n.jsx(Cn,{alt:"sponsor-logo",src:(h=(m=c==null?void 0:c.titleCard)==null?void 0:m.media)==null?void 0:h.sponsorLogo}),n.jsx(Fn,{children:"PRESENTS"})]}),((a=c==null?void 0:c.titleCard)==null?void 0:a.title)&&n.jsx($n,{children:(g=c==null?void 0:c.titleCard)==null?void 0:g.title}),((I=c==null?void 0:c.titleCard)==null?void 0:I.subtitle)&&n.jsx(Sn,{children:(_=c==null?void 0:c.titleCard)==null?void 0:_.subtitle}),n.jsx(kn,{onClick:s,children:"Play Now"})]})},Ln=d.styled_default("div")({name:"OnboardingContainer",class:"o9squag",propsAsIs:!1}),Rn=()=>we,Nn=d.styled_default(Rn())({name:"OnboardingNotificationContainer",class:"o1c8wcli",propsAsIs:!0}),lt=d.styled_default("div")({name:"InnerContainer",class:"i18oyadd",propsAsIs:!1}),Un="cebdc0u",zn=({deepLink:o,onboardingOpts:s,notification:c,gamification:f})=>{var y,m,h,a,g,I;const[_,E]=A.useState(void 0);return A.useEffect(()=>{const x=o.$store.subscribe(w=>{w&&E(w.data)});return()=>{x()}},[o.$store]),n.jsx(Ln,{className:d.cx_default(c.hiding&&Un),children:n.jsx(vn,{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:(y=s.rules)==null?void 0:y.buttonLabel,rulesTitle:(m=s.rules)==null?void 0:m.heading,steps:[{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_1.png",headline:"Welcome to the Featured Groups +",width:80},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_2.png",headline:"Get real-time insights",width:264},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_3.png",headline:"Predictions, trivia & polls synced to match play"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_4.png",headline:"Win points for every answer you get right"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_5.png",headline:"Compete against friends on the leaderboard"}],primaryColor:(h=s.inviteCard)==null?void 0:h.iconColor,inviteLink:_==null?void 0:_.url,inviteCardTitle:(a=s.inviteCard)==null?void 0:a.heading,inviteCardSubtext:(g=s.inviteCard)==null?void 0:g.subtext,inviteCardBtnLabel:(I=s.inviteCard)==null?void 0:I.buttonLabel,onClose:()=>{var x;(x=c.close)==null||x.call(c)},socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],gamification:f})})},On=({sdk:o,notification:s,saveHeight:c,style:f})=>{const y=A.useRef(null),[m,h]=A.useState(!1),a=o.getFeature(U.FeatureType.GAMES),g=s.data.onboarding;return A.useLayoutEffect(()=>{var I;c(((I=y.current)==null?void 0:I.getBoundingClientRect().height)||0)},[c]),m&&a&&g?n.jsx(zn,{notification:s,setOpened:h,gamification:a,onboardingOpts:g,deepLink:a.deepLink}):n.jsxs(n.Fragment,{children:[n.jsx(lt,{ref:I=>{y.current=I},style:{position:"absolute",visibility:"hidden"},children:n.jsx(at,{close:()=>{},action:()=>{},onboarding:g})}),n.jsx(Nn,{style:f,hiding:s.hiding,children:n.jsx(lt,{children:n.jsx(at,{close:s.close,action:()=>h(!0),onboarding:g})})})]})},Dn=()=>we,qn=d.styled_default(Dn())({name:"Container",class:"ctckejh",propsAsIs:!0}),ct=d.styled_default("div")({name:"InnerContainer",class:"i1ri7tzr",propsAsIs:!1}),Pn=o=>{const[s,c]=A.useState(0),f=A.useRef(null),y=A.useCallback(h=>{f.current=h},[]);A.useEffect(()=>{var h;const a=(h=f.current)==null?void 0:h.getBoundingClientRect();a&&c(a.height)},[o]);const m=A.useCallback(h=>{c(h)},[]);return[y,s,m]},Mn=({sdk:o,notification:s})=>{var c,f;const[y,m,h]=Pn(s.id);return s.type===me.NotificationType.QUESTION?n.jsxs(n.Fragment,{children:[n.jsx(ct,{ref:y,style:{position:"absolute",visibility:"hidden"},children:n.jsx(Qe,{...s})}),n.jsx(qn,{style:{height:s.hiding?0:m},hiding:s.hiding,children:n.jsx(ct,{style:{height:"100%"},children:n.jsx(Qe,{...s})})})]}):s.type===me.NotificationType.QUESTION_RESOLVED&&(f=(c=s.data)==null?void 0:c.question)!=null&&f.predictionResult?n.jsx(wr,{style:{height:s.hiding?0:m},saveHeight:h,close:s.close,hiding:s.hiding,...s.data.question}):s.type===me.NotificationType.ONBOARDING?n.jsx(On,{style:{height:s.hiding?0:m},saveHeight:h,sdk:o,notification:s}):null},Wn=({sdk:o})=>{const[s]=A.useState(o.getNotificationsStore()),c=Z.useStore(s),f=A.useMemo(()=>{if(!(c!=null&&c.size))return null;for(const y of c.values())if(y.type===me.NotificationType.ONBOARDING)return y;return c.values().next().value},[c]);return f?n.jsx(Mn,{sdk:o,notification:f}):null},Gn=d.styled_default("div")({name:"SDKContainer",class:"stu11h7",propsAsIs:!1}),Se=d.styled_default("div")({name:"SDKScrollContainer",class:"s1ucohr1",propsAsIs:!1}),It=d.styled_default("div")({name:"SDKContentContainer",class:"s1el4wvm",propsAsIs:!1}),Hn=()=>It,Qn=d.styled_default(Hn())({name:"SDKWhiteContainer",class:"s1oe3036",propsAsIs:!0}),Yn=o=>{const s=A.useRef(""),[c,f]=A.useState(!1),y=Z.useStore(o.status),m=Z.useStore(o.userId()),h=y==="ready",[a,g]=A.useState(X),I=A.useCallback((x,w)=>{g(w),w===X?(x&&o.createEventSession(x),window.requestAnimationFrame(()=>{o.openFeature(U.FeatureType.GAMES)})):o.closeFeature()},[o]);A.useEffect(()=>{!h&&a===X&&(g(ce),o.closeFeature())},[h,a,o]);const _=x=>{s.current=x,f(!0),o.initializeApp().then(({enabled:w,err:v})=>{if(v){I(x,ce);return}if(w){o.isUserAuthorized().then(B=>{if(B){I(x,X);return}else o.disableApp()});return}})},E=()=>{f(!1),o.disableApp()};return A.useEffect(()=>{if(!m){h&&(g(ce),o.disableApp());return}m&&s.current&&c&&o.initializeApp().then(()=>{o.createEventSession(s.current)})},[m]),{sdkEnabled:c,sdkReady:h,activeOverlay:a,activateAndLoadOverlay:I,activateEventWithId:_,deactivate:E,isLogged:!!m}},Vn=o=>{const s=Z.useStore(o.getActiveFeature()),c=Z.useStore(o.streamStore()),[f,y]=A.useState(null);return A.useEffect(()=>{const m=o.getFeatures();if(s)for(const[h,a]of m)h===s?a.status.get()===he.FeatureStatus.Suspended&&(a.enable(),y(a)):a.status.get()===he.FeatureStatus.Ready&&a.disable();else{for(const[,h]of m)h.status.get()===he.FeatureStatus.Ready&&h.disable();y(null)}return()=>{for(const[,h]of m)h.status.get()===he.FeatureStatus.Ready&&h.disable()}},[s,o,c]),[s,f]},Kn=({sdk:o,className:s})=>{const[,c]=Vn(o);return n.jsx(Pt,{className:s,feature:c,sdk:o})},Xn=({sdk:o,overlays:s,children:c})=>{const{sdkEnabled:f,sdkReady:y,activeOverlay:m,activateAndLoadOverlay:h,activateEventWithId:a,deactivate:g,isLogged:I}=Yn(o);return A.useEffect(()=>{Promise.resolve().then(()=>require("./gamification-feature.js"))},[]),n.jsxs(Gn,{children:[f&&n.jsx(si,{sdkReady:y,activeOverlay:m,className:le.d,setActiveOverlay:_=>h("",_)}),y&&n.jsx(Wn,{sdk:o}),n.jsx(Se,{"data-nav":f.toString(),style:{display:!f||m===ce?"block":"none"},children:c&&c({activateEventWithId:a,deactivate:g})}),n.jsx(Se,{"data-nav":f.toString(),style:{display:m===ge?"block":"none"},children:s&&m===ge&&s[m]}),y&&m===X&&n.jsx(Kn,{className:le.d,sdk:o}),!I&&n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})};const Jn=({sdkKey:o,plugins:s,children:c,production:f=!0})=>n.jsx(le.StreamLayerProvider,{sdkKey:o,plugins:s,production:f,autoEnable:!1,children:c}),Zn=({children:o,overlays:s})=>{const{sdk:c,status:f}=A.useContext(le.StreamLayerContext);if(f===le.StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return c?n.jsx("div",{className:"StreamLayerSDK",children:n.jsx(le.s,{style:{height:"100%"},children:n.jsx(Xn,{sdk:c,overlays:s,children:o})})}):o({})};exports.AutoSizer=wt;exports.MastersStreamLayerProvider=Jn;exports.MastersStreamLayerSDKReact=Zn;exports.O=_t;exports.a=Qn;exports.f=we;exports.n=It;exports.o=ut;exports.r=Se;exports.w=dt;
|
|
6
|
+
*/(function(o){const n=_e,c=Le,f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=a,o.SlowBuffer=C,o.INSPECT_MAX_BYTES=50;const m=2147483647;o.kMaxLength=m,a.TYPED_ARRAY_SUPPORT=y(),!a.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 y(){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(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function h(i){if(i>m)throw new RangeError('The value "'+i+'" is invalid for option "size"');const e=new Uint8Array(i);return Object.setPrototypeOf(e,a.prototype),e}function a(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 E(i)}return g(i,e,t)}a.poolSize=8192;function g(i,e,t){if(typeof i=="string")return x(i,e);if(ArrayBuffer.isView(i))return v(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 a.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 a.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)}a.from=function(i,e,t){return g(i,e,t)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function I(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 _(i,e,t){return I(i),i<=0?h(i):e!==void 0?typeof t=="string"?h(i).fill(e,t):h(i).fill(e):h(i)}a.alloc=function(i,e,t){return _(i,e,t)};function E(i){return I(i),h(i<0?0:j(i)|0)}a.allocUnsafe=function(i){return E(i)},a.allocUnsafeSlow=function(i){return E(i)};function x(i,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=N(i,e)|0;let r=h(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:j(i.length)|0,t=h(e);for(let r=0;r<e;r+=1)t[r]=i[r]&255;return t}function v(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,a.prototype),r}function L(i){if(a.isBuffer(i)){const e=j(i.length)|0,t=h(e);return t.length===0||i.copy(t,0,0,e),t}if(i.length!==void 0)return typeof i.length!="number"||ve(i.length)?h(0):w(i);if(i.type==="Buffer"&&Array.isArray(i.data))return w(i.data)}function j(i){if(i>=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return i|0}function C(i){return+i!=i&&(i=0),a.alloc(+i)}a.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==a.prototype},a.compare=function(e,t){if(M(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),M(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.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},a.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}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return a.alloc(0);let r;if(t===void 0)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const l=a.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?(a.isBuffer(p)||(p=a.from(p)),p.copy(l,u)):Uint8Array.prototype.set.call(l,p,u);else if(a.isBuffer(p))p.copy(l,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=p.length}return l};function N(i,e){if(a.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 Ae(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return He(i).length;default:if(l)return r?-1:Ae(i).length;e=(""+e).toLowerCase(),l=!0}}a.byteLength=N;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 kt(this,e,t);case"utf8":case"utf-8":return Ue(this,e,t);case"ascii":return $t(this,e,t);case"latin1":case"binary":return St(this,e,t);case"base64":return Ct(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lt(this,e,t);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),r=!0}}a.prototype._isBuffer=!0;function D(i,e,t){const r=i[e];i[e]=i[t],i[t]=r}a.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},a.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},a.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},a.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?Ue(this,0,e):Q.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:a.compare(this,e)===0},a.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+">"},f&&(a.prototype[f]=a.prototype.inspect),a.prototype.compare=function(e,t,r,l,u){if(M(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.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,b=r-t;const $=Math.min(p,b),F=this.slice(l,u),S=e.slice(t,r);for(let T=0;T<$;++T)if(F[T]!==S[T]){p=F[T],b=S[T];break}return p<b?-1:b<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,ve(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=a.from(e,r)),a.isBuffer(e))return e.length===0?-1:Ne(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):Ne(i,[e],t,r,l);throw new TypeError("val must be string, number or Buffer")}function Ne(i,e,t,r,l){let u=1,p=i.length,b=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,b/=2,t/=2}function $(S,T){return u===1?S[T]:S.readUInt16BE(T*u)}let F;if(l){let S=-1;for(F=t;F<p;F++)if($(i,F)===$(e,S===-1?0:F-S)){if(S===-1&&(S=F),F-S+1===b)return S*u}else S!==-1&&(F-=F-S),S=-1}else for(t+b>p&&(t=p-b),F=t;F>=0;F--){let S=!0;for(let T=0;T<b;T++)if($(i,F+T)!==$(e,T)){S=!1;break}if(S)return F}return-1}a.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1},a.prototype.indexOf=function(e,t,r){return Re(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return Re(this,e,t,r,!1)};function bt(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 b=parseInt(e.substr(p*2,2),16);if(ve(b))return p;i[t+p]=b}return p}function Et(i,e,t,r){return fe(Ae(e,i.length-t),i,t,r)}function Bt(i,e,t,r){return fe(zt(e),i,t,r)}function jt(i,e,t,r){return fe(He(e),i,t,r)}function Tt(i,e,t,r){return fe(Ot(e,i.length-t),i,t,r)}a.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 bt(this,e,t,r);case"utf8":case"utf-8":return Et(this,e,t,r);case"ascii":case"latin1":case"binary":return Bt(this,e,t,r);case"base64":return jt(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tt(this,e,t,r);default:if(p)throw new TypeError("Unknown encoding: "+l);l=(""+l).toLowerCase(),p=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ct(i,e,t){return e===0&&t===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(e,t))}function Ue(i,e,t){t=Math.min(i.length,t);const r=[];let l=e;for(;l<t;){const u=i[l];let p=null,b=u>239?4:u>223?3:u>191?2:1;if(l+b<=t){let $,F,S,T;switch(b){case 1:u<128&&(p=u);break;case 2:$=i[l+1],($&192)===128&&(T=(u&31)<<6|$&63,T>127&&(p=T));break;case 3:$=i[l+1],F=i[l+2],($&192)===128&&(F&192)===128&&(T=(u&15)<<12|($&63)<<6|F&63,T>2047&&(T<55296||T>57343)&&(p=T));break;case 4:$=i[l+1],F=i[l+2],S=i[l+3],($&192)===128&&(F&192)===128&&(S&192)===128&&(T=(u&15)<<18|($&63)<<12|(F&63)<<6|S&63,T>65535&&T<1114112&&(p=T))}}p===null?(p=65533,b=1):p>65535&&(p-=65536,r.push(p>>>10&1023|55296),p=56320|p&1023),r.push(p),l+=b}return Ft(r)}const ze=4096;function Ft(i){const e=i.length;if(e<=ze)return String.fromCharCode.apply(String,i);let t="",r=0;for(;r<e;)t+=String.fromCharCode.apply(String,i.slice(r,r+=ze));return t}function $t(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 St(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 kt(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+=Dt[i[u]];return l}function Lt(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}a.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,a.prototype),l};function R(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")}a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||R(e,t,this.length);let l=this[e],u=1,p=0;for(;++p<t&&(u*=256);)l+=this[e+p]*u;return l},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||R(e,t,this.length);let l=this[e+--t],u=1;for(;t>0&&(u*=256);)l+=this[e+--t]*u;return l},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e=e>>>0,t||R(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||R(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.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)&&de(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))}),a.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)&&de(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)}),a.prototype.readIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||R(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},a.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||R(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},a.prototype.readInt8=function(e,t){return e=e>>>0,t||R(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,t){e=e>>>0,t||R(e,2,this.length);const r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r},a.prototype.readInt16BE=function(e,t){e=e>>>0,t||R(e,2,this.length);const r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r},a.prototype.readInt32LE=function(e,t){return e=e>>>0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e=e>>>0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.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)&&de(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)}),a.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)&&de(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)}),a.prototype.readFloatLE=function(e,t){return e=e>>>0,t||R(e,4,this.length),c.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e=e>>>0,t||R(e,4,this.length),c.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||R(e,8,this.length),c.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||R(e,8,this.length),c.read(this,e,!1,52,8)};function z(i,e,t,r,l,u){if(!a.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")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,l){if(e=+e,t=t>>>0,r=r>>>0,!l){const b=Math.pow(2,8*r)-1;z(this,e,t,r,b,0)}let u=1,p=0;for(this[t]=e&255;++p<r&&(u*=256);)this[t+p]=e/u&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,l){if(e=+e,t=t>>>0,r=r>>>0,!l){const b=Math.pow(2,8*r)-1;z(this,e,t,r,b,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},a.prototype.writeUint8=a.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},a.prototype.writeUint16LE=a.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},a.prototype.writeUint16BE=a.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},a.prototype.writeUint32LE=a.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},a.prototype.writeUint32BE=a.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 Oe(i,e,t,r,l){Ge(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 De(i,e,t,r,l){Ge(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}a.prototype.writeBigUInt64LE=K(function(e,t=0){return Oe(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=K(function(e,t=0){return De(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,r,l){if(e=+e,t=t>>>0,!l){const $=Math.pow(2,8*r-1);z(this,e,t,r,$-1,-$)}let u=0,p=1,b=0;for(this[t]=e&255;++u<r&&(p*=256);)e<0&&b===0&&this[t+u-1]!==0&&(b=1),this[t+u]=(e/p>>0)-b&255;return t+r},a.prototype.writeIntBE=function(e,t,r,l){if(e=+e,t=t>>>0,!l){const $=Math.pow(2,8*r-1);z(this,e,t,r,$-1,-$)}let u=r-1,p=1,b=0;for(this[t+u]=e&255;--u>=0&&(p*=256);)e<0&&b===0&&this[t+u+1]!==0&&(b=1),this[t+u]=(e/p>>0)-b&255;return t+r},a.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},a.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},a.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},a.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},a.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},a.prototype.writeBigInt64LE=K(function(e,t=0){return Oe(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=K(function(e,t=0){return De(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 Pe(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}a.prototype.writeFloatLE=function(e,t,r){return Pe(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return Pe(this,e,t,!1,r)};function Me(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}a.prototype.writeDoubleLE=function(e,t,r){return Me(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return Me(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,l){if(!a.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},a.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"&&!a.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=a.isBuffer(e)?e:a.from(e,l),b=p.length;if(b===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(u=0;u<r-t;++u)this[u+t]=p[u%b]}return this};const ee={};function Ie(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}`}}}Ie("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ie("ERR_INVALID_ARG_TYPE",function(i,e){return`The "${i}" argument must be of type number. Received type ${typeof e}`},TypeError),Ie("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 Rt(i,e,t){te(e,"offset"),(i[e]===void 0||i[e+t]===void 0)&&de(e,i.length-(t+1))}function Ge(i,e,t,r,l,u){if(i>t||i<e){const p=typeof e=="bigint"?"n":"";let b;throw u>3?e===0||e===BigInt(0)?b=`>= 0${p} and < 2${p} ** ${(u+1)*8}${p}`:b=`>= -(2${p} ** ${(u+1)*8-1}${p}) and < 2 ** ${(u+1)*8-1}${p}`:b=`>= ${e}${p} and <= ${t}${p}`,new ee.ERR_OUT_OF_RANGE("value",b,i)}Rt(r,l,u)}function te(i,e){if(typeof i!="number")throw new ee.ERR_INVALID_ARG_TYPE(e,"number",i)}function de(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 Nt=/[^+/0-9A-Za-z-_]/g;function Ut(i){if(i=i.split("=")[0],i=i.trim().replace(Nt,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function Ae(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 zt(i){const e=[];for(let t=0;t<i.length;++t)e.push(i.charCodeAt(t)&255);return e}function Ot(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 He(i){return n.toByteArray(Ut(i))}function fe(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 ve(i){return i!==i}const Dt=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"?qt:i}function qt(){throw new Error("BigInt not supported")}})(ft);var mt={exports:{}},k=mt.exports={},W,G;function Te(){throw new Error("setTimeout has not been defined")}function Ce(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?W=setTimeout:W=Te}catch{W=Te}try{typeof clearTimeout=="function"?G=clearTimeout:G=Ce}catch{G=Ce}})();function xt(o){if(W===setTimeout)return setTimeout(o,0);if((W===Te||!W)&&setTimeout)return W=setTimeout,setTimeout(o,0);try{return W(o,0)}catch{try{return W.call(null,o,0)}catch{return W.call(this,o,0)}}}function Sr(o){if(G===clearTimeout)return clearTimeout(o);if((G===Ce||!G)&&clearTimeout)return G=clearTimeout,clearTimeout(o);try{return G(o)}catch{try{return G.call(null,o)}catch{return G.call(this,o)}}}var Y=[],ue=!1,J,xe=-1;function kr(){!ue||!J||(ue=!1,J.length?Y=J.concat(Y):xe=-1,Y.length&>())}function gt(){if(!ue){var o=xt(kr);ue=!0;for(var n=Y.length;n;){for(J=Y,Y=[];++xe<n;)J&&J[xe].run();xe=-1,n=Y.length}J=null,ue=!1,Sr(o)}}k.nextTick=function(o){var n=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)n[c-1]=arguments[c];Y.push(new wt(o,n)),Y.length===1&&!ue&&xt(gt)};function wt(o,n){this.fun=o,this.array=n}wt.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 Lr=mt.exports;(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const n=ft,c=Lr,f=h=>h&&h.__esModule?h:{default:h},m=f(c),y=globalThis||void 0||self;Object.defineProperty(o,"Buffer",{enumerable:!0,get:()=>n.Buffer}),Object.defineProperty(o,"process",{enumerable:!0,get:()=>m.default}),o.global=y})(pt);let P;typeof window<"u"?P=window:typeof self<"u"?P=self:P=pt.global;let Fe=null,$e=null;const nt=20,Be=P.clearTimeout,st=P.setTimeout,je=P.cancelAnimationFrame||P.mozCancelAnimationFrame||P.webkitCancelAnimationFrame,ot=P.requestAnimationFrame||P.mozRequestAnimationFrame||P.webkitRequestAnimationFrame;je==null||ot==null?(Fe=Be,$e=function(n){return st(n,nt)}):(Fe=function([n,c]){je(n),Be(c)},$e=function(n){const c=ot(function(){Be(f),n()}),f=st(function(){je(c),n()},nt);return[c,f]});function Rr(o){let n,c,f,m,y,h,a;const g=typeof document<"u"&&document.attachEvent;if(!g){h=function(j){const C=j.__resizeTriggers__,N=C.firstElementChild,Q=C.lastElementChild,D=N.firstElementChild;Q.scrollLeft=Q.scrollWidth,Q.scrollTop=Q.scrollHeight,D.style.width=N.offsetWidth+1+"px",D.style.height=N.offsetHeight+1+"px",N.scrollLeft=N.scrollWidth,N.scrollTop=N.scrollHeight},y=function(j){return j.offsetWidth!==j.__resizeLast__.width||j.offsetHeight!==j.__resizeLast__.height},a=function(j){if(j.target.className&&typeof j.target.className.indexOf=="function"&&j.target.className.indexOf("contract-trigger")<0&&j.target.className.indexOf("expand-trigger")<0)return;const C=this;h(this),this.__resizeRAF__&&Fe(this.__resizeRAF__),this.__resizeRAF__=$e(function(){y(C)&&(C.__resizeLast__.width=C.offsetWidth,C.__resizeLast__.height=C.offsetHeight,C.__resizeListeners__.forEach(function(D){D.call(C,j)}))})};let x=!1,w="";f="animationstart";const v="Webkit Moz O ms".split(" ");let B="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),L="";{const j=document.createElement("fakeelement");if(j.style.animationName!==void 0&&(x=!0),x===!1){for(let C=0;C<v.length;C++)if(j.style[v[C]+"AnimationName"]!==void 0){L=v[C],w="-"+L.toLowerCase()+"-",f=B[C],x=!0;break}}}c="resizeanim",n="@"+w+"keyframes "+c+" { from { opacity: 0; } to { opacity: 0; } } ",m=w+"animation: 1ms "+c+"; "}const I=function(x){if(!x.getElementById("detectElementResize")){const w=(n||"")+".resize-triggers { "+(m||"")+'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%; }',v=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)),v.appendChild(B)}};return{addResizeListener:function(x,w){if(g)x.attachEvent("onresize",w);else{if(!x.__resizeTriggers__){const v=x.ownerDocument,B=P.getComputedStyle(x);B&&B.position==="static"&&(x.style.position="relative"),I(v),x.__resizeLast__={},x.__resizeListeners__=[],(x.__resizeTriggers__=v.createElement("div")).className="resize-triggers";const L=v.createElement("div");L.className="expand-trigger",L.appendChild(v.createElement("div"));const j=v.createElement("div");j.className="contract-trigger",x.__resizeTriggers__.appendChild(L),x.__resizeTriggers__.appendChild(j),x.appendChild(x.__resizeTriggers__),h(x),x.addEventListener("scroll",a,!0),f&&(x.__resizeTriggers__.__animationListener__=function(N){N.animationName===c&&h(x)},x.__resizeTriggers__.addEventListener(f,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",a,!0),x.__resizeTriggers__.__animationListener__&&(x.__resizeTriggers__.removeEventListener(f,x.__resizeTriggers__.__animationListener__),x.__resizeTriggers__.__animationListener__=null);try{x.__resizeTriggers__=!x.removeChild(x.__resizeTriggers__)}catch{}}}}}class _t extends A.Component{constructor(...n){super(...n),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:f,onResize:m}=this.props;if(this._parentNode){var y,h,a,g;const I=window.getComputedStyle(this._parentNode)||{},_=parseFloat((y=I.paddingLeft)!==null&&y!==void 0?y:"0"),E=parseFloat((h=I.paddingRight)!==null&&h!==void 0?h:"0"),x=parseFloat((a=I.paddingTop)!==null&&a!==void 0?a:"0"),w=parseFloat((g=I.paddingBottom)!==null&&g!==void 0?g:"0"),v=this._parentNode.getBoundingClientRect(),B=v.height-x-w,L=v.width-_-E,j=this._parentNode.offsetHeight-x-w,C=this._parentNode.offsetWidth-_-E;(!c&&(this.state.height!==j||this.state.scaledHeight!==B)||!f&&(this.state.width!==C||this.state.scaledWidth!==L))&&(this.setState({height:j,width:C,scaledHeight:B,scaledWidth:L}),typeof m=="function"&&m({height:j,scaledHeight:B,scaledWidth:L,width:C}))}},this._setRef=c=>{this._autoSizer=c}}componentDidMount(){const{nonce:n}=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=Rr(n),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:n,defaultHeight:c,defaultWidth:f,disableHeight:m=!1,disableWidth:y=!1,nonce:h,onResize:a,style:g={},tagName:I="div",..._}=this.props,{height:E,scaledHeight:x,scaledWidth:w,width:v}=this.state,B={overflow:"visible"},L={};let j=!1;return m||(E===0&&(j=!0),B.height=0,L.height=E,L.scaledHeight=x),y||(v===0&&(j=!0),B.width=0,L.width=v,L.scaledWidth=w),A.createElement(I,{ref:this._setRef,style:{...B,...g},..._},!j&&n(L))}}const Nr=d.styled_default("div")({name:"Container",class:"c1htq1lb",propsAsIs:!1}),Ur=d.styled_default("div")({name:"Content",class:"cjyzpp7",propsAsIs:!1}),zr=d.styled_default("div")({name:"Graphic",class:"g16mldgz",propsAsIs:!1}),Or=d.styled_default("div")({name:"Headline",class:"h69js65",propsAsIs:!1}),Dr=d.styled_default("div")({name:"StepsContainer",class:"smm7qmo",propsAsIs:!1}),qr=d.styled_default("span")({name:"StepIndicator",class:"s17knuw2",propsAsIs:!1}),Pr=({width:o,graphicSrc:n,headline:c,stepsCount:f,currentStep:m})=>s.jsxs(Nr,{children:[s.jsxs(Ur,{children:[s.jsx(zr,{"data-centered":m===0,children:s.jsx("img",{src:n,alt:c,width:o||300})}),c&&s.jsx(Or,{children:c})]}),s.jsx(Dr,{children:Array.from({length:f}).map((y,h)=>s.jsx(qr,{"data-active":m===h},h))})]}),Mr=d.styled_default("div")({name:"Container",class:"c1itm4k7",propsAsIs:!1}),Wr=d.styled_default("div")({name:"IconContainer",class:"i1w4fsni",propsAsIs:!1}),Gr=()=>d.o1,Hr=d.styled_default(Gr())({name:"InviteGameIcon",class:"i19m85r1",propsAsIs:!0}),Qr=d.styled_default("div")({name:"Content",class:"c1mbu204",propsAsIs:!1}),Yr=d.styled_default("div")({name:"Heading",class:"h1amdqtv",propsAsIs:!1}),Vr=d.styled_default("div")({name:"Subtext",class:"s1lhlj9j",propsAsIs:!1}),Kr=d.styled_default("div")({name:"LinkContainer",class:"l1wot35e",propsAsIs:!1}),Xr=d.styled_default("div")({name:"LinkInfo",class:"l1jdw39q",propsAsIs:!1}),Jr=d.styled_default("span")({name:"LinkTitle",class:"l1cr5mk",propsAsIs:!1}),Zr=d.styled_default("span")({name:"LinkAddress",class:"lvi87q4",propsAsIs:!1}),en=()=>d.o1,tn=d.styled_default(en())({name:"LinkIcon",class:"l1pqlvw3",propsAsIs:!0}),rn=d.styled_default("div")({name:"SocialLinksContainer",class:"s1n7kzeh",propsAsIs:!1}),nn=d.styled_default("a")({name:"SocialLink",class:"s2m9o9y",propsAsIs:!1}),sn=d.styled_default("span")({name:"SocialLinkLabel",class:"sewjbbn",propsAsIs:!1}),It=({inviteLink:o,socialLinks:n,inviteCardTitle:c,inviteCardSubtext:f,primaryColor:m,className:y})=>s.jsxs(Mr,{className:y,children:[s.jsx(Wr,{style:{backgroundColor:m},children:s.jsx(Hr,{name:"invite-game-icon"})}),s.jsxs(Qr,{children:[s.jsx(Yr,{children:c||""}),s.jsx(Vr,{children:f||""})]}),o&&s.jsxs(Kr,{onClick:async()=>{if(o)try{await navigator.clipboard.writeText(o)}catch(h){console.error("Unable to copy to clipboard",h)}},children:[s.jsxs(Xr,{children:[s.jsx(Jr,{children:"Invite link"}),s.jsx(Zr,{children:o})]}),s.jsx(tn,{name:"icon-copy"})]}),n&&n.length>0&&s.jsx(rn,{children:n.map(({icon:h,link:a,label:g})=>s.jsxs(nn,{href:a,target:"_blank",children:[s.jsx(d.o1,{name:h}),s.jsx(sn,{children:g})]},a))})]}),on=d.styled_default("div")({name:"Container",class:"cm0bev",propsAsIs:!1}),an=d.styled_default("div")({name:"Content",class:"ce7x737",propsAsIs:!1}),ln=d.styled_default("div")({name:"Title",class:"tc2tor6",propsAsIs:!1}),cn=d.styled_default("div")({name:"RulesList",class:"r1k5klql",propsAsIs:!1}),un=d.styled_default("div")({name:"RulesItem",class:"r1tf3ft2",propsAsIs:!1}),dn=d.styled_default("div")({name:"RuleIcon",class:"rwpvg1k",propsAsIs:!1}),hn=d.styled_default("div")({name:"RuleText",class:"rbxiag0",propsAsIs:!1}),pn=d.styled_default("button")({name:"TermsButton",class:"t6cyrry",propsAsIs:!1}),fn=({rules:o,rulesTitle:n,primaryColor:c})=>s.jsxs(on,{children:[s.jsxs(an,{children:[s.jsx(ln,{children:n}),s.jsx(cn,{children:o==null?void 0:o.map(({label:f,icon:m},y)=>s.jsxs(un,{children:[m&&s.jsx(dn,{style:{backgroundColor:c},children:s.jsx(d.o1,{name:m,"data-icon":m})}),s.jsx(hn,{children:f})]},y))})]}),s.jsx(pn,{children:"See Terms and Conditions"})]}),yn=d.styled_default("button")({name:"SButton",class:"s1nve60q",propsAsIs:!1}),mn=d.styled_default("span")({name:"ButtonLabel",class:"b1xoswwx",propsAsIs:!1}),At=({disabled:o,variant:n="primary",onClick:c,children:f,...m})=>s.jsx(yn,{onClick:c,disabled:o,"data-variant":n,...m,children:s.jsx(mn,{children:f})}),xn=d.styled_default("div")({name:"Container",class:"c18uddbs",propsAsIs:!1}),gn=d.styled_default("div")({name:"Content",class:"cvcfjf6",propsAsIs:!1}),wn=d.styled_default("div")({name:"OnboardingHeader",class:"o1ie27lw",propsAsIs:!1}),_n=d.styled_default("button")({name:"CloseBtn",class:"c15cjkwi",propsAsIs:!1}),In=()=>d.o1,An=d.styled_default(In())({name:"IconClose",class:"i1mavjt2",propsAsIs:!0}),vn=d.styled_default("div")({name:"OnboardingFooter",class:"o1x0dyzv",propsAsIs:!1}),bn=()=>At,En=d.styled_default(bn())({name:"OnboardingActionBtn",class:"o1jfi9c3",propsAsIs:!0}),ae={steps:!1,rules:!1,inviteCard:!1},Bn=({gamification:o,steps:n,rules:c,rulesBtnLabel:f,rulesTitle:m,primaryColor:y,inviteLink:h,socialLinks:a,inviteCardTitle:g,inviteCardSubtext:I,inviteCardBtnLabel:_,onClose:E})=>{const[x,w]=A.useState(0),[v,B]=A.useState(ae);A.useEffect(()=>{n!=null&&n.length?B({...ae,steps:!0}):c!=null&&c.length?B({...ae,rules:!0}):B({...ae,inviteCard:!0})},[]);const L=A.useMemo(()=>v.steps&&x===0?"Continue":v.rules?f||"Got it":v.inviteCard?_||"Play Now":"Next",[v,x,f,_]),j=A.useCallback(()=>{n!=null&&n.length&&x<n.length-1?w(N=>++N):c!=null&&c.length&&v.steps?B({...ae,rules:!0}):v.rules&&B({...ae,inviteCard:!0})},[x,n==null?void 0:n.length,c==null?void 0:c.length,v,w,B]),C=async()=>{await o.onboardingStatus.submitInplay()};return s.jsx(_t,{children:({width:N,height:Q})=>s.jsxs(xn,{style:{width:N,height:Q},children:[s.jsx(wn,{children:s.jsx(_n,{onClick:E,children:s.jsx(An,{name:"icon-close-btn-gray"})})}),s.jsxs(gn,{children:[v.steps&&(n==null?void 0:n.length)&&s.jsx(Pr,{stepsCount:n.length,currentStep:x,...n[x]}),v.rules&&s.jsx(fn,{rules:c,rulesTitle:m,primaryColor:y}),v.inviteCard&&s.jsx(It,{inviteLink:h,inviteCardTitle:g,inviteCardSubtext:I,primaryColor:y,socialLinks:a})]}),s.jsx(vn,{children:s.jsx(En,{onClick:v.inviteCard?C:j,children:L})})]})})},jn=d.styled_default("div")({name:"Container",class:"cocfo2g",propsAsIs:!1}),Tn=d.styled_default("div")({name:"CloseIconWrap",class:"c1pdhxdk",propsAsIs:!1}),Cn=()=>d.o1,Fn=d.styled_default(Cn())({name:"CloseIcon",class:"c1funj3r",propsAsIs:!0}),$n=d.styled_default("div")({name:"Title",class:"t1okg06y",propsAsIs:!1}),Sn=d.styled_default("img")({name:"SponsorLogo",class:"sb1n923",propsAsIs:!1}),kn=d.styled_default("div")({name:"PresentsTitle",class:"p1stllxd",propsAsIs:!1}),Ln=d.styled_default("div")({name:"Subtitle",class:"s13kvdzw",propsAsIs:!1}),Rn=d.styled_default("div")({name:"Description",class:"dfvmv3t",propsAsIs:!1}),Nn=d.styled_default("button")({name:"ActionButton",class:"ay8e3j9",propsAsIs:!1}),at=({close:o,action:n,onboarding:c})=>{var f,m,y,h,a,g,I,_;return s.jsxs(jn,{children:[s.jsx(Tn,{onClick:o,children:s.jsx(Fn,{name:"icon-cross"})}),((m=(f=c==null?void 0:c.titleCard)==null?void 0:f.media)==null?void 0:m.sponsorLogo)&&s.jsxs($n,{children:[s.jsx(Sn,{alt:"sponsor-logo",src:(h=(y=c==null?void 0:c.titleCard)==null?void 0:y.media)==null?void 0:h.sponsorLogo}),s.jsx(kn,{children:"PRESENTS"})]}),((a=c==null?void 0:c.titleCard)==null?void 0:a.title)&&s.jsx(Ln,{children:(g=c==null?void 0:c.titleCard)==null?void 0:g.title}),((I=c==null?void 0:c.titleCard)==null?void 0:I.subtitle)&&s.jsx(Rn,{children:(_=c==null?void 0:c.titleCard)==null?void 0:_.subtitle}),s.jsx(Nn,{onClick:n,children:"Play Now"})]})},Un=d.styled_default("div")({name:"OnboardingContainer",class:"o9squag",propsAsIs:!1}),zn=()=>we,On=d.styled_default(zn())({name:"OnboardingNotificationContainer",class:"o1c8wcli",propsAsIs:!0}),lt=d.styled_default("div")({name:"InnerContainer",class:"i18oyadd",propsAsIs:!1}),Dn="cebdc0u",qn=({deepLink:o,onboardingOpts:n,notification:c,gamification:f})=>{var m,y,h,a,g,I;const[_,E]=A.useState(void 0);return A.useEffect(()=>{const x=o.$store.subscribe(w=>{w&&E(w.data)});return()=>{x()}},[o.$store]),s.jsx(Un,{className:d.cx_default(c.hiding&&Dn),children:s.jsx(Bn,{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:(m=n.rules)==null?void 0:m.buttonLabel,rulesTitle:(y=n.rules)==null?void 0:y.heading,steps:[{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_1.png",headline:"Welcome to the Featured Groups +",width:80},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_2.png",headline:"Get real-time insights",width:264},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_3.png",headline:"Predictions, trivia & polls synced to match play"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_4.png",headline:"Win points for every answer you get right"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_5.png",headline:"Compete against friends on the leaderboard"}],primaryColor:(h=n.inviteCard)==null?void 0:h.iconColor,inviteLink:_==null?void 0:_.url,inviteCardTitle:(a=n.inviteCard)==null?void 0:a.heading,inviteCardSubtext:(g=n.inviteCard)==null?void 0:g.subtext,inviteCardBtnLabel:(I=n.inviteCard)==null?void 0:I.buttonLabel,onClose:()=>{var x;(x=c.close)==null||x.call(c)},socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],gamification:f})})},Pn=({sdk:o,notification:n,saveHeight:c,style:f})=>{const m=A.useRef(null),[y,h]=A.useState(!1),a=o.getFeature(U.FeatureType.GAMES),g=n.data.onboarding;return A.useLayoutEffect(()=>{var I;c(((I=m.current)==null?void 0:I.getBoundingClientRect().height)||0)},[c]),y&&a&&g?s.jsx(qn,{notification:n,setOpened:h,gamification:a,onboardingOpts:g,deepLink:a.deepLink}):s.jsxs(s.Fragment,{children:[s.jsx(lt,{ref:I=>{m.current=I},style:{position:"absolute",visibility:"hidden"},children:s.jsx(at,{close:()=>{},action:()=>{},onboarding:g})}),s.jsx(On,{style:f,hiding:n.hiding,children:s.jsx(lt,{children:s.jsx(at,{close:n.close,action:()=>h(!0),onboarding:g})})})]})},Mn=()=>we,Wn=d.styled_default(Mn())({name:"Container",class:"ctckejh",propsAsIs:!0}),ct=d.styled_default("div")({name:"InnerContainer",class:"i1ri7tzr",propsAsIs:!1}),Gn=o=>{const[n,c]=A.useState(0),f=A.useRef(null),m=A.useCallback(h=>{f.current=h},[]);A.useEffect(()=>{var h;const a=(h=f.current)==null?void 0:h.getBoundingClientRect();a&&c(a.height)},[o]);const y=A.useCallback(h=>{c(h)},[]);return[m,n,y]},Hn=({sdk:o,notification:n})=>{var c,f;const[m,y,h]=Gn(n.id);return n.type===me.NotificationType.QUESTION?s.jsxs(s.Fragment,{children:[s.jsx(ct,{ref:m,style:{position:"absolute",visibility:"hidden"},children:s.jsx(Qe,{...n})}),s.jsx(Wn,{style:{height:n.hiding?0:y},hiding:n.hiding,children:s.jsx(ct,{style:{height:"100%"},children:s.jsx(Qe,{...n})})})]}):n.type===me.NotificationType.QUESTION_RESOLVED&&(f=(c=n.data)==null?void 0:c.question)!=null&&f.predictionResult?s.jsx(vr,{style:{height:n.hiding?0:y},saveHeight:h,close:n.close,hiding:n.hiding,...n.data.question}):n.type===me.NotificationType.ONBOARDING?s.jsx(Pn,{style:{height:n.hiding?0:y},saveHeight:h,sdk:o,notification:n}):null},Qn=({sdk:o})=>{const[n]=A.useState(o.getNotificationsStore()),c=Z.useStore(n),f=A.useMemo(()=>{if(!(c!=null&&c.size))return null;for(const m of c.values())if(m.type===me.NotificationType.ONBOARDING)return m;return c.values().next().value},[c]);return f?s.jsx(Hn,{sdk:o,notification:f}):null},Yn=d.styled_default("div")({name:"SDKContainer",class:"stu11h7",propsAsIs:!1}),Se=d.styled_default("div")({name:"SDKScrollContainer",class:"s1ucohr1",propsAsIs:!1}),vt=d.styled_default("div")({name:"SDKContentContainer",class:"s1el4wvm",propsAsIs:!1}),Vn=()=>vt,Kn=d.styled_default(Vn())({name:"SDKWhiteContainer",class:"s1oe3036",propsAsIs:!0}),Xn=o=>{const n=A.useRef(""),[c,f]=A.useState(!1),m=Z.useStore(o.status),y=Z.useStore(o.userId()),h=m==="ready",[a,g]=A.useState(X),I=A.useCallback((x,w)=>{g(w),w===X?(x&&o.createEventSession(x),window.requestAnimationFrame(()=>{o.openFeature(U.FeatureType.GAMES)})):o.closeFeature()},[o]);A.useEffect(()=>{!h&&a===X&&(g(ce),o.closeFeature())},[h,a,o]);const _=x=>{n.current=x,f(!0),o.initializeApp().then(({enabled:w,err:v})=>{if(v){I(x,ce);return}if(w){o.isUserAuthorized().then(B=>{if(B){I(x,X);return}else o.disableApp()});return}})},E=()=>{f(!1),o.disableApp()};return A.useEffect(()=>{if(!y){h&&(g(ce),o.disableApp());return}y&&n.current&&c&&o.initializeApp().then(()=>{o.createEventSession(n.current)})},[y]),{sdkEnabled:c,sdkReady:h,activeOverlay:a,activateAndLoadOverlay:I,activateEventWithId:_,deactivate:E,isLogged:!!y}},Jn=o=>{const n=Z.useStore(o.getActiveFeature()),c=Z.useStore(o.streamStore()),[f,m]=A.useState(null);return A.useEffect(()=>{const y=o.getFeatures();if(n)for(const[h,a]of y)h===n?a.status.get()===he.FeatureStatus.Suspended&&(a.enable(),m(a)):a.status.get()===he.FeatureStatus.Ready&&a.disable();else{for(const[,h]of y)h.status.get()===he.FeatureStatus.Ready&&h.disable();m(null)}return()=>{for(const[,h]of y)h.status.get()===he.FeatureStatus.Ready&&h.disable()}},[n,o,c]),[n,f]},Zn=({sdk:o,className:n})=>{const[,c]=Jn(o);return s.jsx(Wt,{className:n,feature:c,sdk:o})},es=({sdk:o,overlays:n,children:c})=>{const{sdkEnabled:f,sdkReady:m,activeOverlay:y,activateAndLoadOverlay:h,activateEventWithId:a,deactivate:g,isLogged:I}=Xn(o);return A.useEffect(()=>{Promise.resolve().then(()=>require("./gamification-feature.js"))},[]),s.jsxs(Yn,{children:[f&&s.jsx(ai,{sdkReady:m,activeOverlay:y,className:le.d,setActiveOverlay:_=>h("",_)}),m&&s.jsx(Qn,{sdk:o}),s.jsx(Se,{"data-nav":f.toString(),style:{display:!f||y===ce?"block":"none"},children:c&&c({activateEventWithId:a,deactivate:g})}),s.jsx(Se,{"data-nav":f.toString(),style:{display:y===ge?"block":"none"},children:n&&y===ge&&n[y]}),m&&y===X&&s.jsx(Zn,{className:le.d,sdk:o}),!I&&s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})};const ts=({sdkKey:o,plugins:n,children:c,production:f=!0})=>s.jsx(le.StreamLayerProvider,{sdkKey:o,plugins:n,production:f,autoEnable:!1,children:c}),is=({children:o,overlays:n})=>{const{sdk:c,status:f}=A.useContext(le.StreamLayerContext);if(f===le.StreamLayerStatus.UNSET)throw new Error("Wrap app in `StreamLayerProvider`");return c?s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(le.s,{style:{height:"100%"},children:s.jsx(es,{sdk:c,overlays:n,children:o})})}):o({})};exports.AutoSizer=_t;exports.MastersStreamLayerProvider=ts;exports.MastersStreamLayerSDKReact=is;exports.O=It;exports.a=Kn;exports.c=At;exports.f=we;exports.n=vt;exports.o=ut;exports.r=Se;exports.u=ht;exports.w=dt;
|
package/lib/cjs/points.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),u=require("./index2.js"),c=require("@nanostores/react"),o=require("react"),p=require("@streamlayer/sdk-web-types"),m=require("./index3.js"),r=require("./index4.js");require("react-countup");const y=require("./app.js");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const S=r.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),x=r.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),j=()=>r.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),u=require("./index2.js"),c=require("@nanostores/react"),o=require("react"),p=require("@streamlayer/sdk-web-types"),m=require("./index3.js"),r=require("./index4.js");require("react-countup");const y=require("./app.js");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const S=r.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),x=r.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),j=()=>r.o1,q=r.styled_default(j())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),v=r.styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),f=r.styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),h=r.styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),P=({points:e})=>s.jsxs(S,{className:u.d,children:[s.jsx(x,{children:s.jsx(q,{name:"icon-trophy"})}),s.jsxs(v,{children:[s.jsx(f,{children:"Total points"}),s.jsx(h,{children:s.jsx(m.d,{value:e})})]})]}),b=({userSummary:e})=>{const[t,l]=o.useState(0);return o.useEffect(()=>{const d=e.subscribe(n=>{var a,i;(i=(a=n.data)==null?void 0:a.summary)!=null&&i.points&&l(n.data.summary.points)});return()=>{d()}},[e]),s.jsx(P,{points:t})},g=({sdk:e})=>{if(c.useStore(e.sdkStore.status)!=="ready")return null;const t=e.getFeature(p.FeatureType.GAMES);return t?s.jsx(b,{userSummary:t.userSummary.getStore()}):null},A=()=>{const e=y.useStreamLayer();return e?s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(u.s,{children:s.jsx(g,{sdk:e})})}):null};exports.StreamLayerSDKPoints=A;
|