@streamlayer/react 0.30.0 → 0.30.1
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/app.js +1 -0
- package/lib/cjs/auth.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +4 -0
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +6 -0
- package/lib/cjs/points.js +1 -1
- package/lib/dist/cjs/gamification-feature.js +1 -0
- package/lib/dist/cjs/index.js +1 -0
- package/lib/dist/cjs/masters.js +297 -1
- package/lib/dist/{index-bcabe854.js → es/gamification-feature.js} +522 -523
- package/lib/dist/es/index.js +9 -0
- package/lib/dist/es/masters.js +26797 -7
- package/lib/dist/index.d.ts +6 -5
- package/lib/dist/style.css +1 -1
- package/lib/{app-c53bb384.js → es/app.js} +1 -1
- package/lib/es/auth.js +2 -2
- package/lib/{index-e26b3493.js → es/gamification-feature.js} +542 -543
- package/lib/es/index.js +2 -2
- package/lib/{index-89366251.js → es/index2.js} +12 -12
- package/lib/es/masters.js +3 -3
- package/lib/es/masters2.js +2433 -0
- package/lib/es/points.js +45 -36
- package/lib/style.css +1 -1
- package/package.json +10 -10
- package/lib/app-36051bbe.cjs +0 -1
- package/lib/dist/index-f504e8d3.cjs +0 -1
- package/lib/dist/masters-3c9c6ffe.js +0 -26765
- package/lib/dist/masters-fe5f1486.cjs +0 -297
- package/lib/index-af5c5738.cjs +0 -1
- package/lib/index-dd93a61a.cjs +0 -4
- package/lib/masters-bf25c11c.js +0 -2415
- package/lib/masters-f135002d.cjs +0 -6
- /package/lib/{common-f34b9d88.cjs → cjs/common.js} +0 -0
- /package/lib/{index-565f26fb.cjs → cjs/index3.js} +0 -0
- /package/lib/{common-2d2a3ba3.js → es/common.js} +0 -0
- /package/lib/{index-15f61ac8.js → es/index3.js} +0 -0
package/lib/index-af5c5738.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index-565f26fb.cjs"),O=require("@nanostores/react"),D=require("./masters-f135002d.cjs"),A=require("react"),g=require("@streamlayer/sdk-web-types"),k=require("./common-f34b9d88.cjs"),Ne=require("react-countdown-circle-timer"),w=require("./index-dd93a61a.cjs");require("@streamlayer/sdk-web-interfaces");require("@streamlayer/sdk-web-notifications");require("@lottiefiles/react-lottie-player");require("./cjs/useStreamLayerApp.js");require("@streamlayer/sdk-web");const _e=o.styled_default("div")({name:"Container",class:"Container_c1vwopgc",propsAsIs:!1}),Ae=o.styled_default("div")({name:"QuestionTypeWrap",class:"QuestionTypeWrap_qyktpt0",propsAsIs:!1}),Se=()=>o.i1,De=o.styled_default(Se())({name:"QuestionTypeIcon",class:"QuestionTypeIcon_q951jdx",propsAsIs:!0}),ze=o.styled_default("span")({name:"QuestionTypeTitle",class:"QuestionTypeTitle_qss5f0e",propsAsIs:!1}),Ce=o.styled_default("button")({name:"CloseButton",class:"CloseButton_c1ao1jtv",propsAsIs:!1}),Oe=()=>o.i1,ke=o.styled_default(Oe())({name:"CloseIcon",class:"CloseIcon_cvsl7l3",propsAsIs:!0}),ue=({type:e,close:t,label:n})=>{const i=e?D.o[e]:{label:n,iconName:void 0};return s.jsxs(_e,{children:[s.jsxs(Ae,{children:[(i==null?void 0:i.iconName)&&s.jsx(De,{name:i.iconName}),(i==null?void 0:i.label)&&s.jsx(ze,{children:i.label})]}),s.jsx(Ce,{onClick:t,children:s.jsx(ke,{name:"icon-cross"})})]})},be=o.styled_default("div")({name:"Container",class:"Container_c1zy8a",propsAsIs:!1}),we=o.styled_default("div")({name:"Title",class:"Title_t1vih9p5",propsAsIs:!1}),Ee=o.styled_default("div")({name:"Indicator",class:"Indicator_i1fbnvpb",propsAsIs:!1}),J=({indicator:e,title:t})=>s.jsxs(be,{children:[s.jsx(we,{children:t}),s.jsx(Ee,{children:e})]}),Le=o.styled_default("div")({name:"Container",class:"Container_ctmhwyc",propsAsIs:!1}),Qe=o.styled_default("div")({name:"Indicator",class:"Indicator_i1jri200",propsAsIs:!1}),Re=o.styled_default("div")({name:"Title",class:"Title_t8s05oq",propsAsIs:!1}),$=({indicator:e,title:t})=>s.jsxs(Le,{children:[s.jsx(Qe,{children:e}),s.jsx(Re,{children:t})]}),$e=o.styled_default("div")({name:"Container",class:"Container_c1yrpn9o",propsAsIs:!1}),Ue=o.styled_default("div")({name:"TopInfo",class:"TopInfo_t17fwahh",propsAsIs:!1}),qe=o.styled_default("div")({name:"BottomInfo",class:"BottomInfo_by6w7e9",propsAsIs:!1}),Pe=o.styled_default("div")({name:"User",class:"User_u1g7arbm",propsAsIs:!1}),Ye=o.styled_default("img")({name:"Avatar",class:"Avatar_a1ldeata",propsAsIs:!1}),We=o.styled_default("div")({name:"UserInfo",class:"UserInfo_u10d4koz",propsAsIs:!1}),Fe=o.styled_default("div")({name:"UserName",class:"UserName_u1q6roj0",propsAsIs:!1}),Be=o.styled_default("div")({name:"UserRating",class:"UserRating_ui0m425",propsAsIs:!1}),Ve=o.styled_default("img")({name:"TrophyIcon",class:"TrophyIcon_t1el3mrn",propsAsIs:!1}),He=o.styled_default("div")({name:"Rts",class:"Rts_r2vgnxv",propsAsIs:!1}),Ge=o.styled_default("div")({name:"RtsIndicator",class:"RtsIndicator_roqn06j",propsAsIs:!1}),Ze=o.styled_default("div")({name:"RtsLabel",class:"RtsLabel_r15adx7c",propsAsIs:!1}),Je=o.styled_default("div")({name:"Divider",class:"Divider_dv59lta",propsAsIs:!1}),Ke=o.styled_default("div")({name:"Ranks",class:"Ranks_r55lotb",propsAsIs:!1}),Xe=o.styled_default("div")({name:"Statistics",class:"Statistics_s1knfgqt",propsAsIs:!1}),et=o.styled_default("div")({name:"AvatarPlaceholder",class:"AvatarPlaceholder_a1mqo824",propsAsIs:!1}),tt=o.styled_default("button")({name:"UserAccountBtn",class:"UserAccountBtn_uxareh6",propsAsIs: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DA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",pe=({avatar:e,name:t,points:n,friendsRank:i,rank:r,streak:m,correct:p,incorrect:u,inTop:d,successRate:f})=>s.jsxs($e,{children:[s.jsx(Ue,{children:s.jsxs(Pe,{children:[s.jsxs(tt,{children:[e&&s.jsx(Ye,{alt:"avatar",src:e}),!e&&s.jsx(et,{children:k.o(t||"")})]}),s.jsxs(We,{children:[s.jsx(Fe,{children:t}),s.jsxs(Be,{children:[s.jsxs(He,{children:[s.jsx(Ve,{alt:"rank-icon",src:st}),s.jsxs(Ge,{children:[k.i(n),s.jsx(Ze,{children:"PTS"})]})]}),s.jsx(Je,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(qe,{children:[s.jsxs(Ke,{children:[s.jsx(J,{indicator:i||0,title:"Friends rank"}),s.jsx(J,{indicator:r||0,title:"Global rank"})]}),s.jsxs(Xe,{children:[s.jsx($,{indicator:m||0,title:"Win streak"}),s.jsx($,{indicator:p||0,title:"Correct"}),s.jsx($,{indicator:u||0,title:"Incorrect"}),s.jsx($,{indicator:`${f||0}%`,title:"Succ. rate"})]})]})]}),nt=o.styled_default("div")({name:"Container",class:"Container_c38csyt",propsAsIs:!1}),it=o.styled_default("div")({name:"Title",class:"Title_ty221rx",propsAsIs:!1}),ot=o.styled_default("div")({name:"Description",class:"Description_dlaj9xp",propsAsIs:!1}),rt=({title:e,description:t})=>s.jsxs(nt,{children:[s.jsx(o.i1,{name:"icon-check-circle"}),s.jsx(it,{children:e}),s.jsx(ot,{children:t})]}),at=o.styled_default("div")({name:"Container",class:"Container_c16sbdnm",propsAsIs:!1}),lt=()=>o.i1,ct=o.styled_default(lt())({name:"IconPrediction",class:"IconPrediction_ibhorgl",propsAsIs:!0}),K=o.styled_default("div")({name:"FeedbackIconWrap",class:"FeedbackIconWrap_f1g20ja7",propsAsIs:!1}),X=o.styled_default("div")({name:"FeedbackHeader",class:"FeedbackHeader_f455ozj",propsAsIs:!1}),dt=o.styled_default("span")({name:"FeedbackTitle",class:"FeedbackTitle_f1913njx",propsAsIs:!1}),q=o.styled_default("span")({name:"FeedbackDescription",class:"FeedbackDescription_fzfk69z",propsAsIs:!1}),ut=o.styled_default("div")({name:"FeedbackText",class:"FeedbackText_fx87qaj",propsAsIs:!1}),pt=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:n,questionType:i,hasCorrectAnswer:r,questionStatus:m})=>{const p=n&&(i===g.QuestionType.TRIVIA||i===g.QuestionType.PREDICTION);if(!p&&m!==g.QuestionStatus.RESOLVED)return null;const u=i===g.QuestionType.PREDICTION&&!r,d=t?"correct":"incorrect",f=t?e.correctFeedback:e.incorrectFeedback;return s.jsxs(at,{"data-isPrediction":u,children:[m===g.QuestionStatus.RESOLVED&&i===g.QuestionType.TRIVIA&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(K,{children:s.jsx(o.i1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(X,{children:s.jsx(q,{children:"Question Expired"})}),s.jsx(ut,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),p&&u&&s.jsxs(s.Fragment,{children:[s.jsx(ct,{name:"icon-prediction"}),s.jsx(q,{children:"Stay tuned to see if your prediction was correct."})]}),p&&r&&s.jsxs(s.Fragment,{children:[s.jsx(K,{"data-feedbackType":d,children:s.jsx(o.i1,{name:d})}),s.jsx("div",{children:s.jsxs(X,{children:[s.jsx(dt,{"data-feedbackType":d,children:f==null?void 0:f.title}),s.jsx(q,{children:f==null?void 0:f.description})]})})]})]})},mt=o.styled_default("div")({name:"Container",class:"Container_c14ielyq",propsAsIs:!1}),It=o.styled_default("div")({name:"Content",class:"Content_c1tlqx57",propsAsIs:!1}),ft=o.styled_default("div")({name:"Title",class:"Title_t1hq58md",propsAsIs:!1}),ht=o.styled_default("div")({name:"Options",class:"Options_o1c8nxcx",propsAsIs:!1}),yt=o.styled_default("button")({name:"ButtonContainer",class:"ButtonContainer_b1b6dl8t",propsAsIs:!1}),xt=o.styled_default("div")({name:"ButtonPct",class:"ButtonPct_b4iik8i",propsAsIs:!1}),gt=o.styled_default("span")({name:"ButtonBody",class:"ButtonBody_b1gq1lnf",propsAsIs:!1}),Mt=o.styled_default("div")({name:"IconContainer",class:"IconContainer_i1j65z51",propsAsIs:!1}),jt=o.styled_default("div")({name:"IconWrap",class:"IconWrap_i19tpfua",propsAsIs:!1}),me=o.styled_default("img")({name:"Icon",class:"Icon_i1tubmma",propsAsIs:!1}),vt=()=>me,Tt=o.styled_default(vt())({name:"IconDefault",class:"IconDefault_i1grrgwj",propsAsIs:!0}),Nt=()=>me,_t=o.styled_default(Nt())({name:"IconCircle",class:"IconCircle_ibemyq8",propsAsIs:!0}),At=o.styled_default("span")({name:"Title",class:"Title_t1dceht",propsAsIs:!1}),St=o.styled_default("span")({name:"Indicators",class:"Indicators_i116q4vq",propsAsIs:!1}),Dt=o.styled_default("span")({name:"Percentage",class:"Percentage_p17ajcu2",propsAsIs:!1}),zt=()=>o.i1,Ct=o.styled_default(zt())({name:"CheckIcon",class:"CheckIcon_cu9kmlb",propsAsIs:!0}),ee={[g.QuestionImages.CENTERED]:e=>s.jsx(Tt,{alt:"option-icon",src:e}),[g.QuestionImages.TRANSPARENT]:e=>s.jsx(Mt,{children:s.jsx(jt,{style:{backgroundImage:`url(${e})`}})}),[g.QuestionImages.ROUNDED]:e=>s.jsx(_t,{alt:"option-icon",src:e}),[g.QuestionImages.NONE]:()=>null,[g.QuestionImages.UNSET]:()=>null},Ot=({questionType:e,hasCorrectAnswer:t,correct:n,youVoted:i,questionVoted:r})=>{if(e===g.QuestionType.POLL&&i)return"correct";if(e===g.QuestionType.PREDICTION){if(t&&r)return i?n?"correct":"incorrect":n?"correct":"unset";if(i)return"correct"}return e===g.QuestionType.TRIVIA&&r?i?n?"correct":"incorrect":n?"correct":"unset":"unset"},kt=({questionType:e,questionVoted:t,correct:n,hasCorrectAnswer:i,questionStatus:r})=>e===g.QuestionType.TRIVIA?t&&n:e===g.QuestionType.PREDICTION?t&&n&&i||r===g.QuestionStatus.RESOLVED&&n:!1,bt=e=>{var t;const{id:n,icon:i,text:r,percentageDecimal:m,onVote:p,youSelected:u,questionVoted:d,imageMode:f=g.QuestionImages.ROUNDED,answerTimeExpired:j,questionStatus:N,isLoading:M,questionType:v,correct:T,hasCorrectAnswer:a}=e,l=Ot(e),c=kt({questionType:v,questionVoted:d,correct:T,hasCorrectAnswer:a,questionStatus:N}),I=d||N===g.QuestionStatus.RESOLVED&&v===g.QuestionType.PREDICTION;return s.jsxs(yt,{value:n,"data-selected":u,"data-answerState":l,disabled:d||M||j,onClick:p,children:[I&&s.jsx(xt,{"data-answerState":l,style:{width:`${m}%`}}),s.jsxs(gt,{children:[i&&((t=ee[f])==null?void 0:t.call(ee,i)),s.jsx(At,{children:r}),I&&s.jsxs(St,{children:[c&&s.jsx(Ct,{name:"selected"}),s.jsxs(Dt,{children:[m,"%"]})]})]})]})},wt=[w.E.PRIMARY_GREEN1,w.E.SECONDARY_RED1,w.E.SECONDARY_RED1],Et=[10,10,0],Lt=o.styled_default("div")({name:"RemainingTime",class:"RemainingTime_r165427",propsAsIs:!1}),Qt=w.E.SECONDARY_GREEN6,te=w.E.SECONDARY_RED3,Rt=w.E.NEUTRALS_GRAY3,$t=({isPlaying:e=!0,duration:t=30,onTimerExpired:n})=>{const[i,r]=A.useState(t>10?Qt:te),m=({remainingTime:d})=>s.jsx(Lt,{children:d}),p=A.useCallback(()=>{n==null||n(),r(Rt)},[n,r]),u=A.useCallback(d=>{d===10&&r(te)},[r]);return s.jsx(Ne.CountdownCircleTimer,{isPlaying:e,duration:t,colors:wt,colorsTime:Et,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:i,onComplete:p,onUpdate:u,children:m})},Ut=o.styled_default("div")({name:"WinBarContainer",class:"WinBarContainer_wie6cqo",propsAsIs:!1}),qt=o.styled_default("div")({name:"Content",class:"Content_cgizw4u",propsAsIs:!1}),Pt=o.styled_default("div")({name:"Title",class:"Title_t1l3ucjp",propsAsIs:!1}),Yt=()=>o.i1,Wt=o.styled_default(Yt())({name:"WinIcon",class:"WinIcon_wx7j799",propsAsIs:!0}),Ft=o.styled_default("div")({name:"Points",class:"Points_p4lwuj0",propsAsIs:!1}),Bt=o.styled_default("span")({name:"PointsCount",class:"PointsCount_po9i64o",propsAsIs:!1}),Vt=o.styled_default("span")({name:"PointsUnits",class:"PointsUnits_pe5g05h",propsAsIs:!1}),Ht=({title:e,points:t,isPlayingTimer:n,isTimer:i,onTimerExpired:r})=>s.jsxs(Ut,{children:[s.jsxs(qt,{children:[e&&s.jsx(Pt,{children:e}),t!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(Wt,{name:"icon-trophy"}),s.jsxs(Ft,{children:[s.jsx(Bt,{children:t}),s.jsx(Vt,{children:"PTS"})]})]})]}),i&&s.jsx($t,{isPlaying:n,onTimerExpired:r})]}),Gt=({openedQuestion:e,vote:t,close:n})=>{var i;const r=e.subject,m=e.type,p=(i=e.options)==null?void 0:i.options,[u,d]=A.useState(!1),[f,j]=A.useState(!1),[N,M]=A.useState(""),v=e==null?void 0:e.id,T=A.useCallback(async x=>{if(v){const h=x.currentTarget.value;M(h),j(!0),await t(v,h),j(!1)}},[v,M,t]),a=A.useCallback(()=>{d(!0),setTimeout(n,3e3)},[n]),l=A.useMemo(()=>e==null?void 0:e.answers.find(x=>x.youVoted===!0),[e]),c=A.useMemo(()=>!!(e!=null&&e.answers.find(x=>x.correct===!0)),[e]),I=A.useMemo(()=>e?e.answers.map(x=>({...x,questionVoted:!!l,youSelected:N===x.id,isLoading:f,hasCorrectAnswer:c,questionType:e.type,answerTimeExpired:u,questionStatus:e.status,onVote:T})):[],[c,u,f,e,l,T,N]),y=p&&(p.case==="trivia"||p.case==="prediction")?p.value:void 0;return s.jsx(D.r,{"data-question-header":"true",children:s.jsx(mt,{children:s.jsxs(It,{children:[y&&s.jsx(pt,{feedbackMessages:y,questionVoted:!!l,questionVotedCorrectly:l==null?void 0:l.correct,questionType:m,hasCorrectAnswer:c,questionStatus:e.status}),s.jsx(Ht,{title:u?"Time expired":"To win",points:u?void 0:100,onTimerExpired:a,isTimer:!0}),u?s.jsx(rt,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(ft,{children:r}),s.jsx(ht,{children:I.map(x=>s.jsx(bt,{...x},x.id))})]})]})})})},Zt=o.styled_default("div")({name:"Container",class:"Container_cgn5uen",propsAsIs:!1}),Jt=o.styled_default("div")({name:"Content",class:"Content_c1px8nt6",propsAsIs:!1}),Kt=o.styled_default("h3")({name:"Title",class:"Title_t5et2jt",propsAsIs:!1}),Xt=o.styled_default("div")({name:"Description",class:"Description_d1i2kpk2",propsAsIs:!1}),es=o.styled_default("div")({name:"DateWrap",class:"DateWrap_dd3lh3p",propsAsIs:!1}),Ie=({created:e,title:t,instantView:n})=>{const i=A.useMemo(()=>{if(e){const r=new Date(e);if(k.r(r))return{date:k.a(r),time:k.n(r)}}return null},[e]);return s.jsxs(Zt,{children:[i&&s.jsxs(es,{children:[i.date," · ",i.time]}),(n==null?void 0:n.video)&&s.jsx(D.w,{source:n.video.url,poster:n.video.thumbnailUrl}),s.jsxs(Jt,{children:[s.jsx(Kt,{children:(n==null?void 0:n.heading)||t}),s.jsx(Xt,{children:n==null?void 0:n.body})]})]})},ts=o.styled_default("div")({name:"Container",class:"Container_c1euiow",propsAsIs:!1}),ss=o.styled_default("a")({name:"WebLinkBtn",class:"WebLinkBtn_w19zie3h",propsAsIs:!1}),ns=({instantView:e,...t})=>s.jsxs(ts,{children:[s.jsx(Ie,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(ss,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(o.i1,{name:"icon-external-link"})]})]}),is=o.styled_default("div")({name:"QuestionContainer",class:"QuestionContainer_qdri6g3",propsAsIs:!1}),os=({openedQuestion:e})=>{var t;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ns,{created:e.attributes.created,...e.attributes.attributes.value}):null},rs=({extendedQuestion:e,vote:t,close:n})=>{const{loading:i,data:r}=e;return!i&&r?s.jsx(Gt,{vote:t,close:n,openedQuestion:r}):null},as=({gamification:e})=>{var t;const n=O.useStore(e.openedQuestion.$store),i=O.useStore(e.openedQuestion.$extendedStore);if(!n)return null;const r=n.type;return s.jsxs(is,{children:[s.jsx(ue,{close:e.closeQuestion,type:((t=n.attributes)==null?void 0:t.type)||g.QuestionType.UNSET}),r==="question"&&s.jsx(rs,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:i}),r!=="question"&&s.jsx(os,{openedQuestion:n})]})},ls=o.styled_default("div")({name:"Container",class:"Container_c115qtkr",propsAsIs:!1}),cs=o.styled_default("div")({name:"STabs",class:"STabs_sxnslc8",propsAsIs:!1}),ds=o.styled_default("button")({name:"Button",class:"Button_b1umzux0",propsAsIs:!1}),us=o.styled_default("span")({name:"Title",class:"Title_tspsaas",propsAsIs:!1});var L=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(L||{});const se=({title:e,active:t,onClick:n})=>s.jsx(ds,{onClick:n,"data-selected":t,children:s.jsx(us,{children:e})}),ps=({activePage:e="home",toggleActivePage:t})=>s.jsx(ls,{children:s.jsxs(cs,{"data-position":e==="home"?"left":"right",children:[s.jsx(se,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(se,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},F.apply(this,arguments)}function ne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},B(e,t)}function ms(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,B(e,t)}var ie=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Is(e,t){return!!(e===t||ie(e)&&ie(t))}function fs(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Is(e[n],t[n]))return!1;return!0}function P(e,t){t===void 0&&(t=fs);var n,i=[],r,m=!1;function p(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return m&&n===this&&t(u,i)||(r=e.apply(this,u),m=!0,n=this,i=u),r}return p}var hs=typeof performance=="object"&&typeof performance.now=="function",oe=hs?function(){return performance.now()}:function(){return Date.now()};function re(e){cancelAnimationFrame(e.id)}function ys(e,t){var n=oe();function i(){oe()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}var r={id:requestAnimationFrame(i)};return r}var Y=-1;function ae(e){if(e===void 0&&(e=!1),Y===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Y=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Y}var b=null;function le(e){if(e===void 0&&(e=!1),b===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var i=document.createElement("div"),r=i.style;return r.width="100px",r.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?b="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?b="negative":b="positive-ascending"),document.body.removeChild(t),b}return b}var xs=150,gs=function(t,n){return t};function Ms(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,r=e.getItemSize,m=e.getOffsetForIndexAndAlignment,p=e.getStartIndexForOffset,u=e.getStopIndexForStartIndex,d=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,j=e.validateProps;return t=function(N){ms(M,N);function M(T){var a;return a=N.call(this,T)||this,a._instanceProps=d(a.props,ne(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:ne(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=P(function(l,c,I,y){return a.props.onItemsRendered({overscanStartIndex:l,overscanStopIndex:c,visibleStartIndex:I,visibleStopIndex:y})}),a._callOnScroll=void 0,a._callOnScroll=P(function(l,c,I){return a.props.onScroll({scrollDirection:l,scrollOffset:c,scrollUpdateWasRequested:I})}),a._getItemStyle=void 0,a._getItemStyle=function(l){var c=a.props,I=c.direction,y=c.itemSize,x=c.layout,h=a._getItemStyleCache(f&&y,f&&x,f&&I),_;if(h.hasOwnProperty(l))_=h[l];else{var S=n(a.props,l,a._instanceProps),z=r(a.props,l,a._instanceProps),C=I==="horizontal"||x==="horizontal",Q=I==="rtl",R=C?S:0;h[l]=_={position:"absolute",left:Q?void 0:R,right:Q?R:void 0,top:C?0:S,height:C?"100%":z,width:C?z:"100%"}}return _},a._getItemStyleCache=void 0,a._getItemStyleCache=P(function(l,c,I){return{}}),a._onScrollHorizontal=function(l){var c=l.currentTarget,I=c.clientWidth,y=c.scrollLeft,x=c.scrollWidth;a.setState(function(h){if(h.scrollOffset===y)return null;var _=a.props.direction,S=y;if(_==="rtl")switch(le()){case"negative":S=-y;break;case"positive-descending":S=x-I-y;break}return S=Math.max(0,Math.min(S,x-I)),{isScrolling:!0,scrollDirection:h.scrollOffset<y?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(l){var c=l.currentTarget,I=c.clientHeight,y=c.scrollHeight,x=c.scrollTop;a.setState(function(h){if(h.scrollOffset===x)return null;var _=Math.max(0,Math.min(x,y-I));return{isScrolling:!0,scrollDirection:h.scrollOffset<_?"forward":"backward",scrollOffset:_,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(l){var c=a.props.outerRef;a._outerRef=l,typeof c=="function"?c(l):c!=null&&typeof c=="object"&&c.hasOwnProperty("current")&&(c.current=l)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&re(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=ys(a._resetIsScrolling,xs)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}M.getDerivedStateFromProps=function(a,l){return js(a,l),j(a),null};var v=M.prototype;return v.scrollTo=function(a){a=Math.max(0,a),this.setState(function(l){return l.scrollOffset===a?null:{scrollDirection:l.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(a,l){l===void 0&&(l="auto");var c=this.props,I=c.itemCount,y=c.layout,x=this.state.scrollOffset;a=Math.max(0,Math.min(a,I-1));var h=0;if(this._outerRef){var _=this._outerRef;y==="vertical"?h=_.scrollWidth>_.clientWidth?ae():0:h=_.scrollHeight>_.clientHeight?ae():0}this.scrollTo(m(this.props,a,l,x,this._instanceProps,h))},v.componentDidMount=function(){var a=this.props,l=a.direction,c=a.initialScrollOffset,I=a.layout;if(typeof c=="number"&&this._outerRef!=null){var y=this._outerRef;l==="horizontal"||I==="horizontal"?y.scrollLeft=c:y.scrollTop=c}this._callPropsCallbacks()},v.componentDidUpdate=function(){var a=this.props,l=a.direction,c=a.layout,I=this.state,y=I.scrollOffset,x=I.scrollUpdateWasRequested;if(x&&this._outerRef!=null){var h=this._outerRef;if(l==="horizontal"||c==="horizontal")if(l==="rtl")switch(le()){case"negative":h.scrollLeft=-y;break;case"positive-ascending":h.scrollLeft=y;break;default:var _=h.clientWidth,S=h.scrollWidth;h.scrollLeft=S-_-y;break}else h.scrollLeft=y;else h.scrollTop=y}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&re(this._resetIsScrollingTimeoutId)},v.render=function(){var a=this.props,l=a.children,c=a.className,I=a.direction,y=a.height,x=a.innerRef,h=a.innerElementType,_=a.innerTagName,S=a.itemCount,z=a.itemData,C=a.itemKey,Q=C===void 0?gs:C,R=a.layout,he=a.outerElementType,ye=a.outerTagName,xe=a.style,ge=a.useIsScrolling,Me=a.width,V=this.state.isScrolling,U=I==="horizontal"||R==="horizontal",je=U?this._onScrollHorizontal:this._onScrollVertical,H=this._getRangeToRender(),ve=H[0],Te=H[1],G=[];if(S>0)for(var E=ve;E<=Te;E++)G.push(A.createElement(l,{data:z,key:Q(E,z),index:E,isScrolling:ge?V:void 0,style:this._getItemStyle(E)}));var Z=i(this.props,this._instanceProps);return A.createElement(he||ye||"div",{className:c,onScroll:je,ref:this._outerRefSetter,style:F({position:"relative",height:y,width:Me,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:I},xe)},A.createElement(h||_||"div",{children:G,ref:x,style:{height:U?"100%":Z,pointerEvents:V?"none":void 0,width:U?Z:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var l=this._getRangeToRender(),c=l[0],I=l[1],y=l[2],x=l[3];this._callOnItemsRendered(c,I,y,x)}}if(typeof this.props.onScroll=="function"){var h=this.state,_=h.scrollDirection,S=h.scrollOffset,z=h.scrollUpdateWasRequested;this._callOnScroll(_,S,z)}},v._getRangeToRender=function(){var a=this.props,l=a.itemCount,c=a.overscanCount,I=this.state,y=I.isScrolling,x=I.scrollDirection,h=I.scrollOffset;if(l===0)return[0,0,0,0];var _=p(this.props,h,this._instanceProps),S=u(this.props,_,h,this._instanceProps),z=!y||x==="backward"?Math.max(1,c):1,C=!y||x==="forward"?Math.max(1,c):1;return[Math.max(0,_-z),Math.max(0,Math.min(l-1,S+C)),_,S]},M}(A.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var js=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},vs=Ms({getItemOffset:function(t,n){var i=t.itemSize;return n*i},getItemSize:function(t,n){var i=t.itemSize;return i},getEstimatedTotalSize:function(t){var n=t.itemCount,i=t.itemSize;return i*n},getOffsetForIndexAndAlignment:function(t,n,i,r,m,p){var u=t.direction,d=t.height,f=t.itemCount,j=t.itemSize,N=t.layout,M=t.width,v=u==="horizontal"||N==="horizontal",T=v?M:d,a=Math.max(0,f*j-T),l=Math.min(a,n*j),c=Math.max(0,n*j-T+j+p);switch(i==="smart"&&(r>=c-T&&r<=l+T?i="auto":i="center"),i){case"start":return l;case"end":return c;case"center":{var I=Math.round(c+(l-c)/2);return I<Math.ceil(T/2)?0:I>a+Math.floor(T/2)?a:I}case"auto":default:return r>=c&&r<=l?r:r<c?c:l}},getStartIndexForOffset:function(t,n){var i=t.itemCount,r=t.itemSize;return Math.max(0,Math.min(i-1,Math.floor(n/r)))},getStopIndexForStartIndex:function(t,n,i){var r=t.direction,m=t.height,p=t.itemCount,u=t.itemSize,d=t.layout,f=t.width,j=r==="horizontal"||d==="horizontal",N=n*u,M=j?f:m,v=Math.ceil((M+i-N)/u);return Math.max(0,Math.min(p-1,n+v-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function Ts(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,i=e.startIndex,r=e.stopIndex;return!(i>n||r<t)}function Ns(e){for(var t=e.isItemLoaded,n=e.itemCount,i=e.minimumBatchSize,r=e.startIndex,m=e.stopIndex,p=[],u=null,d=null,f=r;f<=m;f++){var j=t(f);j?d!==null&&(p.push(u,d),u=d=null):(d=f,u===null&&(u=f))}if(d!==null){for(var N=Math.min(Math.max(d,u+i-1),n-1),M=d+1;M<=N&&!t(M);M++)d=M;p.push(u,d)}if(p.length)for(;p[1]-p[0]+1<i&&p[0]>0;){var v=p[0]-1;if(!t(v))p[0]=v;else break}return p}var _s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},As=function(){function e(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),Ss=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},ce=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Ds=function(e){Ss(t,e);function t(){var n,i,r,m;_s(this,t);for(var p=arguments.length,u=Array(p),d=0;d<p;d++)u[d]=arguments[d];return m=(i=(r=ce(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(u))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(f){var j=f.visibleStartIndex,N=f.visibleStopIndex;r._lastRenderedStartIndex=j,r._lastRenderedStopIndex=N,r._ensureRowsLoaded(j,N)},r._setRef=function(f){r._listRef=f},i),ce(r,m)}return As(t,[{key:"resetloadMoreItemsCache",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],i&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var i=this.props.children;return i({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(i,r){var m=this.props,p=m.isItemLoaded,u=m.itemCount,d=m.minimumBatchSize,f=d===void 0?10:d,j=m.threshold,N=j===void 0?15:j,M=Ns({isItemLoaded:p,itemCount:u,minimumBatchSize:f,startIndex:Math.max(0,i-N),stopIndex:Math.min(u-1,r+N)});(this._memoizedUnloadedRanges.length!==M.length||this._memoizedUnloadedRanges.some(function(v,T){return M[T]!==v}))&&(this._memoizedUnloadedRanges=M,this._loadUnloadedRanges(M))}},{key:"_loadUnloadedRanges",value:function(i){for(var r=this,m=this.props.loadMoreItems||this.props.loadMoreRows,p=function(f){var j=i[f],N=i[f+1],M=m(j,N);M!=null&&M.then(function(){if(Ts({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:j,stopIndex:N})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(j,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},u=0;u<i.length;u+=2)p(u)}}]),t}(A.PureComponent);const zs=o.styled_default("div")({name:"Container",class:"Container_culdu4a",propsAsIs:!1}),Cs=o.styled_default("div")({name:"Position",class:"Position_pwf8e69",propsAsIs:!1}),Os=o.styled_default("img")({name:"Avatar",class:"Avatar_atf4yh4",propsAsIs:!1}),ks=o.styled_default("div")({name:"AvatarPlaceholder",class:"AvatarPlaceholder_a1dg29ja",propsAsIs:!1}),bs=o.styled_default("div")({name:"Content",class:"Content_c10a68rc",propsAsIs:!1}),ws=o.styled_default("div")({name:"NameContainer",class:"NameContainer_nc4kck5",propsAsIs:!1}),Es=o.styled_default("span")({name:"Name",class:"Name_njsrqgr",propsAsIs:!1}),Ls=()=>o.i1,Qs=o.styled_default(Ls())({name:"CurrentUserBadge",class:"CurrentUserBadge_c17uc4zr",propsAsIs:!0}),Rs=({rank:e,avatar:t,name:n,points:i,isCurrentUser:r,openItemDetail:m,style:p})=>s.jsxs(zs,{onClick:m,style:p,children:[s.jsx(Cs,{children:e||0}),s.jsxs(bs,{children:[t?s.jsx(Os,{alt:"leaderboard-item-avatar",src:t}):s.jsx(ks,{children:k.o(n||"")}),s.jsxs(ws,{children:[s.jsx(Es,{children:n||""}),r&&s.jsx(Qs,{name:"icon-star"})]})]}),s.jsx("div",{children:k.i(i)})]}),$s=({items:e,currentUserId:t,openItemDetail:n,fetchMore:i})=>s.jsx(D.AutoSizer,{children:({width:r,height:m})=>s.jsx(Ds,{isItemLoaded:p=>p<e.length,itemCount:e.length+1,loadMoreItems:i,children:({onItemsRendered:p,ref:u})=>s.jsx(vs,{itemSize:56,onItemsRendered:p,ref:u,itemCount:e.length,width:r,height:m,children:({index:d,style:f})=>s.jsx(Rs,{style:{...f,maxHeight:48},...e[d],openItemDetail:()=>n(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})}),Us=({deepLink:e})=>{const{data:t}=O.useStore(e.$store);return s.jsx(D.O,{inviteLink:t==null?void 0:t.url,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},qs=({gamification:e})=>{const{data:t}=O.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx($s,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(Us,{deepLink:e.deepLink})},Ps=o.styled_default("div")({name:"QuestionItem",class:"QuestionItem_q1w97g3p",propsAsIs:!1}),Ys=o.styled_default("div")({name:"QuestionCaption",class:"QuestionCaption_q2sl39u",propsAsIs:!1}),Ws=o.styled_default("div")({name:"QuestionBody",class:"QuestionBody_qd5h0uc",propsAsIs:!1}),Fs=o.styled_default("div")({name:"QuestionAction",class:"QuestionAction_q105uluy",propsAsIs:!1}),Bs=()=>o.i1,W=o.styled_default(Bs())({name:"QuestionActionIcon",class:"QuestionActionIcon_q1fa0b9h",propsAsIs:!0}),Vs=()=>o.i1,Hs=o.styled_default(Vs())({name:"QuestionTypeIcon",class:"QuestionTypeIcon_qxlt78s",propsAsIs:!0}),Gs=o.styled_default("div")({name:"QuestionTypeLabel",class:"QuestionTypeLabel_qmg0vkx",propsAsIs:!1}),Zs=o.styled_default("div")({name:"QuestionContent",class:"QuestionContent_q1uz5j1g",propsAsIs:!1}),Js={[g.PickHistoryStatus.LOST]:s.jsx(W,{name:"icon-cross"}),[g.PickHistoryStatus.WON]:s.jsx(W,{name:"icon-check"}),[g.PickHistoryStatus.UNSET]:void 0,[g.PickHistoryStatus.DNP]:s.jsx(W,{name:"icon-arrow"})},Ks=({questionId:e,questionType:t,questionStatus:n,subject:i,openForVoting:r,openQuestion:m,status:p})=>{const u=D.o[t],d=Js[p];return u?s.jsxs(Ps,{onClick:()=>m==null?void 0:m(e),children:[s.jsxs(Zs,{children:[s.jsxs(Ys,{children:[s.jsx(Hs,{name:u.iconName}),s.jsxs(Gs,{children:[u.label,t===g.QuestionType.TRIVIA&&n===g.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(Ws,{children:i||""})]}),s.jsx(Fs,{children:d||(r?s.jsx(D.c,{children:"Play"}):null)})]}):null},Xs=o.styled_default("div")({name:"Container",class:"Container_cll3md7",propsAsIs:!1}),en=o.styled_default("button")({name:"ActionBtn",class:"ActionBtn_a10g1iik",propsAsIs:!1}),tn=({openInsight:e,questionId:t,...n})=>s.jsxs(Xs,{children:[s.jsx(Ie,{questionId:t,...n}),e&&s.jsx(en,{onClick:()=>e(t),children:"View Insight"})]}),sn=o.styled_default("div")({name:"QuestionsContainer",class:"QuestionsContainer_qvghv3l",propsAsIs:!1}),nn=({questions:e,openQuestion:t})=>s.jsx(sn,{children:e==null?void 0:e.map(n=>{var i,r;if(n.type==="question"&&((i=n.attributes)==null?void 0:i.attributes.case)==="question"){const m=n.attributes.attributes.value;return s.jsx(Ks,{openQuestion:t,...m},m.questionId)}if(n.type==="insight"&&((r=n.attributes)==null?void 0:r.attributes.case)==="insight"){const m=n.attributes.attributes.value;return s.jsx(tn,{openInsight:t,...m},m.questionId)}return null})}),on=({store:e,openQuestion:t})=>{const n=O.useStore(e);return n!=null&&n.data?s.jsx(nn,{openQuestion:t,questions:n.data}):s.jsx("div",{children:"wait questions..."})},rn=({userSummary:e})=>{var t,n;const i=O.useStore(e.getStore());return(t=i.data)!=null&&t.summary?s.jsx(pe,{...i.data.summary,successRate:(n=i.data.percentage)==null?void 0:n.correct}):s.jsx("div",{children:"wait user..."})},an=({gamification:e})=>{const[t,n]=A.useState(L.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[s.jsxs(D.a,{children:[s.jsx(ps,{activePage:t,toggleActivePage:n}),t===L.HOME&&s.jsx(rn,{userSummary:e.userSummary})]}),t===L.HOME&&s.jsx(D.s,{children:s.jsx(on,{openQuestion:e.openQuestion,store:e.feedList.getStore()})}),t===L.LEADERBOARD&&s.jsx(D.a,{style:{flex:"1 1 auto",paddingTop:0,paddingBottom:0},children:s.jsx(qs,{gamification:e})})]})},ln=()=>D.x,de=o.styled_default(ln())({name:"OpenedContainer",class:"OpenedContainer_oar61gl",propsAsIs:!0}),cn=o.styled_default("div")({name:"UserContainer",class:"UserContainer_u14zaal4",propsAsIs:!1}),dn=({correct:e,incorrect:t})=>{const n=e+t;return n===0?0:Math.round(e/n*100)},fe=({gamification:e,className:t})=>{const n=O.useStore(e.openedQuestion.$store),i=O.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[n&&s.jsx(de,{className:t,children:s.jsx(as,{gamification:e})}),i&&s.jsx(de,{className:t,children:s.jsxs(cn,{children:[s.jsx(ue,{label:"Friend's Rank",close:e.closeUser}),s.jsx(D.a,{children:s.jsx(pe,{...i,successRate:dn(i)})})]})}),s.jsx(D.r,{className:t,"data-nav":"true",children:s.jsx(an,{gamification:e})})]})};exports.GamificationOverlay=fe;exports.default=fe;
|
package/lib/index-dd93a61a.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";const N=require("react/jsx-runtime"),r=require("react"),Y=require("./cjs/useStreamLayerApp.js");var T=(R=>(R[R.UNSET=0]="UNSET",R[R.CONNECTED=1]="CONNECTED",R[R.READY=2]="READY",R))(T||{});const S=r.createContext({status:0,sdk:null}),a=({sdkKey:R,plugins:E,children:A,production:t=!0,autoEnable:s=!0})=>{const _=Y.useStreamLayerApp(R,E,t,s),G=r.useMemo(()=>_?{sdk:_,status:2}:{status:1,sdk:null},[_]);return N.jsx(S.Provider,{value:G,children:A})},D={BG_TRANSPARENT:"rgba(0,0,0, .8)",BG_TRANSPARENT_VOTE_CONTAINER:"rgba(10, 14, 19, 0.8)",BG_TRANSPARENT_ITEM:"rgba(0, 0, 0, 0.7)",BG_TRANSPARENT_ITEM_VOTE:"rgba(255, 255, 255, 0.1)",BG_TRANSPARENT_ITEM_SUCCESS:"rgba(0, 139, 251, 0.2)",BG_TRANSPARENT_ITEM_ERROR:"rgba(205, 37, 37, 0.2)",BG_TRANSPARENT_VOTE_PROGRESS:"rgba(255, 255, 255, 0.2)",BG_TRANSPARENT_VOTE_PROGRESS_SUCCESS:"rgba(60, 139, 251, 0.5)",BG_TRANSPARENT_VOTE_PROGRESS_ERROR:"rgba(205, 37, 37, 0.5)",BG_TRANSPARENT_ONBOARDING_INAPP:"rgba(138, 159, 182, 0.2)",LEADERBOARD_UNIT:"rgba(255, 255, 255, 0.5)",BLUE_PRIMARY:"#1589EE",RED_PRIMARY:"#CD2525",RED_SECONDARY:"#EB5757",BLUE_QUESTION_ACTION_BTN:"#1589ee",WHITE:"#FFFFFF",GREY_1:"#909395",GREY_2:"#22262b",GREY_3:"#2d3135",GREY_4:"#53565a",GREY_PRIMARY_ONBOARDING_INAPP:"#B5B7B8",BLACK_1:"#161a1f",GREEN_1:"#F7B801",RED_1:"#A30000",RED_2:"#FF4170",GREY_PRIMARY:"#909395",DIVIDER_COLOR_SECONDARY:"#53565a",GREEN_PRIMARY_BTN:"#009B77"},O={PRIMARY_GREEN1:"#107D57",PRIMARY_GREEN2:"#006747",PRIMARY_GREEN3:"#1C4932",PRIMARY_GREEN4:"#193526",SECONDARY_RED1:"#DF2F3B",SECONDARY_RED2:"#BA0C2F",SECONDARY_RED3:"#f9d6d8",SECONDARY_YELLOW:"#fce300",SECONDARY_GREEN5:"#C0DC8F",SECONDARY_GREEN6:"#cee5de",NEUTRALS_WHITE:"#FFFFFF",NEUTRALS_GRAY1:"#F7F7F7",NEUTRALS_GRAY2:"#F2F2F1",NEUTRALS_GRAY3:"#E8E8E8",NEUTRALS_GRAY4:"#D9D9D6",NEUTRALS_GRAY5:"#B1B3B3",NEUTRALS_GRAY6:"#888B8D",NEUTRALS_GRAY7:"#6B6F73",NEUTRALS_GRAY8:"#53565A",NEUTRALS_GRAY9:"#25282A",NEUTRALS_BLACK:"#000000"},e=Object.assign({},D,O);Object.keys(e).reduce((R,E)=>{const A=e[E];return`
|
|
2
|
-
${R}
|
|
3
|
-
--color-${E.toLowerCase().replaceAll("_","-")}: ${A};
|
|
4
|
-
`},"");const B="StreamLayerCSSReset",C="theme_ttkj0ah",P=({children:R,style:E})=>N.jsx("div",{className:"StreamLayerSDKTheme",children:N.jsx("div",{className:C,style:E,children:R})});exports.E=e;exports.StreamLayerContext=S;exports.StreamLayerProvider=a;exports.StreamLayerStatus=T;exports.c=B;exports.s=P;
|