@streamlayer/react 1.11.3-rc.5 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/lib/app/advertisement.d.ts +18 -0
  2. package/lib/app/app.d.ts +19 -0
  3. package/lib/{auth.d.ts → app/auth.d.ts} +4 -13
  4. package/lib/app/bet-pack.d.ts +20 -0
  5. package/lib/app/event.d.ts +4 -0
  6. package/lib/app/insight.d.ts +13 -0
  7. package/lib/app/masters.d.ts +28 -0
  8. package/lib/app/notification.d.ts +5 -0
  9. package/lib/app/points.d.ts +3 -0
  10. package/lib/app/provider.d.ts +43 -0
  11. package/lib/app/useStreamLayerApp.d.ts +19 -0
  12. package/lib/cjs/advertisement.js +1 -1
  13. package/lib/cjs/auth.js +1 -1
  14. package/lib/cjs/bet-pack.js +1 -0
  15. package/lib/cjs/gamification-feature.js +1 -1
  16. package/lib/cjs/gamification-feature2.js +1 -0
  17. package/lib/cjs/index.js +1 -1
  18. package/lib/cjs/index2.js +5 -0
  19. package/lib/cjs/insight.js +1 -1
  20. package/lib/cjs/masters.js +1 -0
  21. package/lib/cjs/masters2.js +9 -0
  22. package/lib/cjs/notification.js +1 -1
  23. package/lib/cjs/points.js +1 -1
  24. package/lib/cjs/provider.js +98 -85
  25. package/lib/cjs/useStreamLayerApp2.js +17 -15
  26. package/lib/classic/app/advertisement.d.ts +18 -0
  27. package/lib/classic/app/app.d.ts +19 -0
  28. package/lib/classic/{auth.d.ts → app/auth.d.ts} +4 -13
  29. package/lib/classic/app/bet-pack.d.ts +20 -0
  30. package/lib/classic/app/event.d.ts +4 -0
  31. package/lib/classic/app/insight.d.ts +13 -0
  32. package/lib/classic/app/masters.d.ts +28 -0
  33. package/lib/classic/app/notification.d.ts +5 -0
  34. package/lib/classic/app/points.d.ts +3 -0
  35. package/lib/classic/app/provider.d.ts +43 -0
  36. package/lib/classic/app/useStreamLayerApp.d.ts +19 -0
  37. package/lib/classic/cjs/advertisement.js +1 -1
  38. package/lib/classic/cjs/auth.js +1 -1
  39. package/lib/classic/cjs/bet-pack.js +1 -0
  40. package/lib/classic/cjs/gamification-feature.js +1 -1
  41. package/lib/classic/cjs/gamification-feature2.js +1 -0
  42. package/lib/classic/cjs/index.js +1 -1
  43. package/lib/classic/cjs/index2.js +5 -0
  44. package/lib/classic/cjs/insight.js +1 -1
  45. package/lib/classic/cjs/masters.js +1 -0
  46. package/lib/classic/cjs/masters2.js +9 -0
  47. package/lib/classic/cjs/notification.js +1 -1
  48. package/lib/classic/cjs/points.js +1 -1
  49. package/lib/classic/cjs/provider.js +98 -85
  50. package/lib/classic/cjs/useStreamLayerApp2.js +17 -15
  51. package/lib/classic/es/advertisement.js +617 -717
  52. package/lib/classic/es/auth.js +2 -5
  53. package/lib/classic/es/bet-pack.js +14 -0
  54. package/lib/classic/es/gamification-feature.js +1 -1
  55. package/lib/classic/es/gamification-feature2.js +4 -0
  56. package/lib/classic/es/index.js +14 -11
  57. package/lib/classic/es/index2.js +2890 -0
  58. package/lib/classic/es/insight.js +33 -33
  59. package/lib/classic/es/masters.js +8 -0
  60. package/lib/classic/es/masters2.js +981 -0
  61. package/lib/classic/es/notification.js +378 -453
  62. package/lib/classic/es/points.js +39 -64
  63. package/lib/classic/es/provider.js +16443 -13824
  64. package/lib/classic/es/useStreamLayerApp2.js +8187 -4455
  65. package/lib/classic/index.d.ts +14 -218
  66. package/lib/classic/masters.d.ts +9 -0
  67. package/lib/classic/style.css +1 -455
  68. package/lib/dist/cjs/gamification-feature.js +1 -0
  69. package/lib/dist/cjs/gamification-feature2.js +1 -0
  70. package/lib/dist/cjs/index.js +1 -0
  71. package/lib/dist/cjs/masters.js +223 -0
  72. package/lib/dist/cjs/package.json +1 -0
  73. package/lib/dist/es/gamification-feature.js +4 -0
  74. package/lib/dist/es/gamification-feature2.js +123 -0
  75. package/lib/dist/es/index.js +11 -0
  76. package/lib/dist/es/masters.js +45904 -0
  77. package/lib/dist/es/package.json +1 -0
  78. package/lib/dist/style.css +1 -0
  79. package/lib/es/advertisement.js +617 -717
  80. package/lib/es/auth.js +2 -5
  81. package/lib/es/bet-pack.js +14 -0
  82. package/lib/es/gamification-feature.js +1 -1
  83. package/lib/es/gamification-feature2.js +4 -0
  84. package/lib/es/index.js +14 -11
  85. package/lib/es/index2.js +2890 -0
  86. package/lib/es/insight.js +33 -33
  87. package/lib/es/masters.js +8 -0
  88. package/lib/es/masters2.js +981 -0
  89. package/lib/es/notification.js +378 -453
  90. package/lib/es/points.js +39 -64
  91. package/lib/es/provider.js +16267 -13641
  92. package/lib/es/useStreamLayerApp2.js +8187 -4455
  93. package/lib/index.d.ts +14 -218
  94. package/lib/masters.d.ts +9 -0
  95. package/lib/style.css +1 -1
  96. package/package.json +57 -3
  97. package/lib/advertisement.d.ts +0 -146
  98. package/lib/classic/advertisement.d.ts +0 -146
  99. package/lib/classic/insight.d.ts +0 -136
  100. package/lib/classic/notification.d.ts +0 -120
  101. package/lib/classic/points.d.ts +0 -12
  102. package/lib/classic/useStreamLayerApp.d.ts +0 -167
  103. package/lib/insight.d.ts +0 -136
  104. package/lib/notification.d.ts +0 -120
  105. package/lib/points.d.ts +0 -12
  106. package/lib/useStreamLayerApp.d.ts +0 -167
@@ -0,0 +1,9 @@
1
+ "use strict";const o=require("react/jsx-runtime"),e=require("./provider.js"),d=require("react"),x=require("./useStreamLayerApp2.js"),P=require("./index2.js"),U=e.styled_default("div")({name:"SDKContainer",class:"s8zgqze",propsAsIs:!1}),M=e.styled_default("div")({name:"SDKScrollContainer",class:"s6t897k",propsAsIs:!1}),V=e.styled_default("div")({name:"SDKContentContainer",class:"sw7pkvp",propsAsIs:!1}),G=()=>V,N=e.styled_default(G())({name:"SDKWhiteContainer",class:"s14gkn7u",propsAsIs:!0}),K=e.styled_default("div")({name:"TabsContainer",class:"t1yxstm9",propsAsIs:!1}),z=()=>N,q=e.styled_default(z())({name:"LeaderboardContainer",class:"ldpty1s",propsAsIs:!0}),Q=()=>N,Z=e.styled_default(Q())({name:"TabsNavContainer",class:"t136a59y",propsAsIs:!0}),W=e.styled_default("div")({name:"UserSummaryContainer",class:"u11vnm9m",propsAsIs:!1}),R=(s,t,n)=>{const r=t>=e.A.lg&&t<e.A.xl?75:52;s.current&&window.scrollTo({top:s.current.offsetTop-r,...n})},Y=15,X=(s,t)=>{const n=d.useRef(null),r=d.useRef(0),[i]=d.useState(e.h$1({scrollPosition:0,tabsShown:!0,scrollDirection:"forward"})),l=e.useStore(t);return d.useEffect(()=>{const a=window.innerWidth<e.A.xl?window:n.current;if(!a)return()=>{};const p=e.c(C=>{var c;const u=C.target;if(!u)return;let f=0;l.screen.size<e.A.xl?f=((c=s.current)==null?void 0:c.getBoundingClientRect().y)||0:f=u.scrollTop;const S=r.current-f;if(Y>Math.abs(S))return;const m=r.current<f?"forward":"backward";r.current=f,i.set({scrollPosition:Math.round(f),scrollDirection:m,tabsShown:i.get().tabsShown})},200);return a.addEventListener("scroll",p),()=>{a.removeEventListener("scroll",p)}},[i,s,l.screen]),[n,i]},I=e.styled_default("div")({name:"LoadingContainer",class:"l7wseip",propsAsIs:!1}),J=({feature:s,sdk:t,children:n,className:r,noWait:i})=>{const l=e.useStore(s.status),a=e.useStore(t.sdkStore.slStreamId);if(!i){if(a!=null&&a.loading&&!a.data)return o.jsx(I,{className:r,children:"Event is loading..."});if(!(a!=null&&a.data))return o.jsx(I,{className:r,children:"Event is forbidden..."});if(l!==e.FeatureStatus.Ready)return o.jsx(I,{className:r,children:"Wait feature..."})}return n},$=d.createContext({sdk:null}),A=()=>d.useContext($),e2=e.styled_default("div")({name:"QuestionContainer",class:"qwgkhsv",propsAsIs:!1}),s2=({openedQuestion:s})=>{var t,n;const{sdk:r}=A();return((t=s==null?void 0:s.attributes)==null?void 0:t.attributes.case)==="insight"?o.jsx(e.p,{...s.attributes.attributes.value,controlVideo:r==null?void 0:r.controlVideoPlayer}):((n=s==null?void 0:s.attributes)==null?void 0:n.attributes.case)==="tweet"?o.jsx(e.a,{...s.attributes.attributes.value,controlVideo:r==null?void 0:r.controlVideoPlayer}):null},t2=({extendedQuestion:s,vote:t,close:n})=>{const{loading:r,data:i}=s;return i?o.jsx(e.Bt,{vote:t,close:n,openedQuestion:i,isLoading:!!r}):o.jsx(e.Yt,{})},n2=({gamification:s})=>{var t;const n=e.useStore(s.openedQuestion.$store),r=e.useStore(s.openedQuestion.$extendedStore);if(!n)return null;const i=n.type;return o.jsxs(e2,{children:[o.jsx(e.b$1,{close:s.closeQuestion,type:((t=n.attributes)==null?void 0:t.type)||x.QuestionType.UNSET}),i==="question"&&o.jsx(t2,{vote:s.submitAnswer,close:s.closeQuestion,extendedQuestion:r}),i!=="question"&&o.jsx(s2,{openedQuestion:n}),o.jsx(e.i,{mastersLogo:!0})]})},o2=e.styled_default("div")({name:"InviteFriendsContainer",class:"i1b9agwt",propsAsIs:!1}),r2=({deepLink:s})=>o.jsx(o2,{children:o.jsx(e.M,{inviteLink:s,inviteCardTitle:"It’s More Fun With Friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})}),i2=e.styled_default("div")({name:"InviteLinkContainer",class:"ij36hcn",propsAsIs:!1}),l2=({gamification:s,scrollNode:t,scrollStore:n})=>{const r=d.useRef(null),{data:i,hasMore:l,loading:a,key:p}=e.useStore(s.leaderboardList.$store),{data:C}=e.useStore(s.deepLink.$store),[c,u]=e.T(r);return!i.length&&!a?o.jsx(r2,{deepLink:C}):o.jsxs(o.Fragment,{children:[o.jsx(e.S,{items:i,scrollNode:t,scrollStore:n,fetchMore:s.leaderboardList.fetchMore,hasMore:l,openItemDetail:s.openUser,currentUserId:s.currentUserId.get()},p),C&&o.jsx(i2,{ref:r,children:o.jsx(e.C,{onClick:()=>c(C),title:"Invite Friends",description:"Challenge them now!"})}),u]})},a2=({store:s,openQuestion:t})=>{const{sdk:n}=A(),r=e.useStore(s);return o.jsx(e.k,{openQuestion:t,questions:r.data,controlVideo:n==null?void 0:n.controlVideoPlayer})},d2=({userSummary:s})=>{var t;const[n,r]=d.useState(void 0);return d.useEffect(()=>{const i=s.$store.subscribe(l=>{l&&r(l)});return()=>{i()}},[s]),o.jsx(e.O,{loading:!(n!=null&&n.summary),...n==null?void 0:n.summary,successRate:(t=n==null?void 0:n.percentage)==null?void 0:t.correct})},c2=({gamification:s,className:t,scrollStore:n,scrollNode:r,appNode:i,style:l,responsiveStore:a})=>{const{tabsShown:p}=e.useStore(n,{keys:["tabsShown"]}),[C,c]=d.useState(e.m.HOME),[,u]=e.useTransition(),{sdkInDesktopView:f,screen:S}=e.useStore(a,{keys:["sdkInDesktopView"]}),m=v=>{u(()=>{var g;c(v),f===!1&&(((g=i.current)==null?void 0:g.getBoundingClientRect().y)||0)<0&&R(i,S.size,{behavior:"instant"})})};d.useEffect(()=>n.subscribe(v=>{if(v.scrollPosition===0){n.setKey("tabsShown",!0);return}a.get().sdkInDesktopView?n.setKey("tabsShown",v.scrollDirection==="backward"):n.setKey("tabsShown",v.scrollDirection==="forward")}),[n,a]);let L="0px";return f?L=p?"0px":"calc(8px - var(--header-height) - var(--header-offset))":L=p?"calc(var(--header-height) + var(--header-offset) - 2px)":"0px",o.jsxs(K,{className:t,style:l,children:[o.jsx(Z,{style:{top:L},children:o.jsx(e.b$2,{activePage:C,toggleActivePage:m})}),C===e.m.HOME&&o.jsxs(o.Fragment,{children:[o.jsx(N,{style:{paddingTop:"8px"},children:o.jsx(W,{children:o.jsx(d2,{userSummary:s.userSummary})})}),o.jsx(V,{style:{flex:1},children:o.jsx(a2,{openQuestion:s.openQuestion,store:s.feedList.getStore()})})]}),C===e.m.LEADERBOARD&&o.jsx(q,{children:o.jsx(l2,{scrollStore:n,scrollNode:r,gamification:s})})]})},u2=()=>e.x$1,b=e.styled_default(u2())({name:"OpenedContainer",class:"o1seszvt",propsAsIs:!0}),p2=e.styled_default("div")({name:"UserContainer",class:"u1pbry50",propsAsIs:!1}),C2=({correct:s,incorrect:t})=>{const n=s+t;return n===0?0:Math.round(s/n*100)},f2=({gamification:s,scrollStore:t,className:n,appNode:r,scrollNode:i,responsiveStore:l})=>o.jsx(c2,{appNode:r,scrollStore:t,scrollNode:i,className:n,gamification:s,responsiveStore:l}),S2=({gamification:s,className:t,appNode:n,responsiveStore:r})=>{const i=e.useStore(s.openedQuestion.$store),l=e.useStore(s.openedUser),{sdkInDesktopView:a}=e.useStore(r,{keys:["sdkInDesktopView"]}),{hiding:p,onAnimationEnd:C}=e.S$1();if(!n.current||!i&&!l)return null;const c=i?o.jsx(b,{className:t,hiding:p,onAnimationEnd:C,children:o.jsx(n2,{gamification:s})}):l?o.jsx(b,{className:t,hiding:p,onAnimationEnd:C,children:o.jsxs(p2,{children:[o.jsx(e.b$1,{label:"Friend's Rank",close:s.closeUser}),o.jsx(N,{children:o.jsx(e.O,{...l,successRate:C2(l)})})]})}):null;return o.jsx(e.x,{container:n,useContainer:!a,children:c})},h2=d.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature2.js"))),m2=({sdk:s,feature:t,className:n,scrollStore:r,appNode:i,scrollNode:l,responsiveStore:a})=>{const p=d.useMemo(()=>t&&t.featureConfig.get().type===x.SdkOverlayType.GAMES?o.jsx(J,{className:n,sdk:s,feature:t,children:o.jsx(h2,{appNode:i,scrollStore:r,scrollNode:l,className:n,responsiveStore:a,gamification:t})}):null,[s,t,n,a,r,l,i]);return o.jsx(d.Suspense,{fallback:o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:p})},v2=({feature:s,className:t,appNode:n,responsiveStore:r})=>s&&s.featureConfig.get().type===x.SdkOverlayType.GAMES?o.jsx(S2,{className:t,appNode:n,responsiveStore:r,gamification:s}):null,E2=e.styled_default("div")({name:"Container",class:"czz4rjk",propsAsIs:!1}),L2=e.styled_default("div")({name:"CloseIconWrap",class:"cxmojsy",propsAsIs:!1}),g2=()=>e.E1,_2=e.styled_default(g2())({name:"CloseIcon",class:"c1urm3yx",propsAsIs:!0}),x2=e.styled_default("div")({name:"Title",class:"tme976v",propsAsIs:!1}),N2=e.styled_default("img")({name:"SponsorLogo",class:"s1lal9yz",propsAsIs:!1}),I2=e.styled_default("div")({name:"PresentsTitle",class:"pnn1sv1",propsAsIs:!1}),T2=e.styled_default("div")({name:"Subtitle",class:"s1hjj1y8",propsAsIs:!1}),y2=e.styled_default("div")({name:"Description",class:"dz7yjzw",propsAsIs:!1}),R2=e.styled_default("button")({name:"ActionButton",class:"avpowqk",propsAsIs:!1}),D=({close:s,action:t,onboarding:n})=>{var r,i,l,a,p,C,c,u;return o.jsxs(E2,{children:[o.jsx(L2,{onClick:s,children:o.jsx(_2,{name:"icon-cross"})}),((i=(r=n==null?void 0:n.titleCard)==null?void 0:r.media)==null?void 0:i.sponsorLogo)&&o.jsxs(x2,{children:[o.jsx(N2,{alt:"sponsor-logo",src:(a=(l=n==null?void 0:n.titleCard)==null?void 0:l.media)==null?void 0:a.sponsorLogo}),o.jsx(I2,{children:"PRESENTS"})]}),((p=n==null?void 0:n.titleCard)==null?void 0:p.title)&&o.jsx(T2,{children:(C=n==null?void 0:n.titleCard)==null?void 0:C.title}),((c=n==null?void 0:n.titleCard)==null?void 0:c.subtitle)&&o.jsx(y2,{children:(u=n==null?void 0:n.titleCard)==null?void 0:u.subtitle}),o.jsx(R2,{onClick:t,children:"Play Now"})]})},A2="data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200%2092%2019'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.1701%200.953996C13.9047%200.873145%2013.6393%201.0177%2013.3739%201.1647C13.2797%201.21615%2013.2127%201.3068%2013.1904%201.4097L12.7736%203.33298C12.7588%203.40404%2012.8233%203.46774%2012.8952%203.45304C13.3342%203.35504%2013.7509%202.97528%2014.19%203.10758C14.6811%203.25703%2015.1722%202.64207%2015.6634%202.64942V0.429688C15.1698%200.432138%2014.6613%201.10345%2014.1701%200.953996Z'%20fill='%23006747'/%3e%3cpath%20d='M20.4404%206.84786C20.3362%206.77681%2020.2717%206.66166%2020.2717%206.53671V6.18635C20.2717%205.87275%2020.0138%205.61549%2019.6938%205.61549H19.4631C19.1878%205.61549%2018.9348%205.75269%2018.7859%205.98055L18.0418%207.11492C17.9674%207.22762%2017.8434%207.29377%2017.7094%207.29377H17.2084C16.9603%207.29377%2016.7321%207.42852%2016.6131%207.64412C16.4915%207.86708%2016.2757%208.02143%2016.0302%208.07288V0.181303C16.0302%200.0808513%2015.9483%200%2015.8466%200C15.7449%200%2015.663%200.0808513%2015.663%200.181303V0.426307V2.64604V8.07778C15.4175%208.02633%2015.2017%207.87198%2015.0801%207.64657C14.9636%207.43097%2014.7354%207.29622%2014.4848%207.29622H14.1475C13.8796%207.29622%2013.639%207.45057%2013.5298%207.69312L13.2496%208.31299C13.2049%208.41099%2013.1057%208.47469%2012.9965%208.47469C12.8874%208.47469%2012.7882%208.41099%2012.7435%208.31299L12.4633%207.69312C12.3541%207.45302%2012.1135%207.29622%2011.8456%207.29622H2.33802C2.26113%207.29622%202.19911%207.35747%202.19911%207.43342C2.19911%207.59512%202.06517%207.72498%201.90394%207.72498H1.49218C1.41529%207.72498%201.35328%207.78623%201.35328%207.86218V8.33504C1.35328%208.77849%201.26646%209.2097%201.09283%209.61886L0.842303%2010.2142C0.60914%2010.7655%200.5%2011.3363%200.5%2011.8974V13.2694C0.5%2013.6394%200.55457%2014.0142%200.66371%2014.3793C0.968807%2015.4034%201.66334%2016.2413%202.61831%2016.7362L4.13883%2017.5276C4.15868%2017.5374%204.181%2017.5423%204.20332%2017.5423L5.32697%2017.5521C5.5899%2017.5545%205.84787%2017.6207%206.07855%2017.7481L6.6813%2018.0813C6.70115%2018.0935%206.72595%2018.0984%206.75076%2018.0984H7.5569C7.83968%2018.0984%208.11997%2018.1744%208.36057%2018.3189C8.36057%2018.3189%208.75497%2018.5566%208.88891%2018.6326C9.10223%2018.7551%209.3602%2018.8727%209.80916%2018.8972C9.91086%2018.9021%2010.0126%2018.8653%2010.0895%2018.7943C10.1639%2018.7232%2010.2085%2018.6228%2010.2085%2018.5223V17.9882C10.2085%2017.6011%2010.4392%2017.2483%2010.7989%2017.0939L12.0317%2016.5598C12.2003%2016.4863%2012.3888%2016.4741%2012.5649%2016.528L13.0263%2016.6627C13.2223%2016.7191%2013.4306%2016.7215%2013.6266%2016.6627L14.718%2016.3418C14.8619%2016.3001%2015.0156%2016.3001%2015.162%2016.3442L15.606%2016.4667C15.8119%2016.5231%2015.9582%2016.7142%2015.9582%2016.9249V17.9931C15.9582%2018.4905%2016.3675%2018.8972%2016.871%2018.8972C17.2481%2018.8972%2017.578%2018.6595%2017.6921%2018.3042C17.8979%2017.6648%2018.0021%2016.9984%2018.0021%2016.3271V15.8714C18.0021%2015.548%2018.1385%2015.2368%2018.3767%2015.0138L18.8306%2014.59C19.1357%2014.3033%2019.3118%2013.8966%2019.3118%2013.4801V10.9468C19.3118%2010.5548%2019.4309%2010.175%2019.6591%209.85161C19.6764%209.82956%2019.6839%209.80016%2019.6839%209.77321V9.1754C19.6839%208.78584%2019.8029%208.40854%2020.0262%208.08758L20.4751%207.44322C20.4925%207.42117%2020.4999%207.39422%2020.4999%207.36482V6.96056C20.5024%206.88461%2020.4553%206.85766%2020.4404%206.84786ZM16.0302%2012.8554C16.3352%2012.9019%2016.5634%2013.0563%2016.5634%2013.2425C16.5634%2013.4287%2016.3377%2013.583%2016.0302%2013.6296V12.8554ZM2.98046%2016.6137L2.74978%2016.4937C2.12222%2016.1678%201.62117%2015.6827%201.27886%2015.0922V14.3523C1.67078%2014.9134%202.20407%2015.3912%202.85644%2015.7317L2.98046%2015.7954V16.6137ZM4.14131%2017.2189L3.52616%2016.9004V16.0821L4.13883%2016.4006H4.14131V17.2189ZM6.70115%2017.775L6.21498%2017.5055C5.94957%2017.3585%205.65191%2017.2801%205.34682%2017.2752V16.4226C5.6023%2016.4275%205.85531%2016.4937%206.07855%2016.6162L6.6813%2016.9494C6.68626%2016.9518%206.6937%2016.9518%206.70115%2016.9543V17.775ZM9.92822%2017.9882V18.4047V18.5223C9.92822%2018.5493%209.91582%2018.5762%209.89598%2018.5958C9.87613%2018.6154%209.85133%2018.6228%209.82404%2018.6228C9.43461%2018.6032%209.21137%2018.5027%209.0303%2018.3973C8.89883%2018.3214%208.50692%2018.0862%208.50444%2018.0862C8.25887%2017.9392%207.98106%2017.8583%207.69581%2017.8363V16.9788C7.92897%2017.0008%208.15718%2017.0694%208.36057%2017.1895L8.7004%2017.3904C9.07246%2017.6109%209.49662%2017.7358%209.92822%2017.7603V17.9882ZM13.2868%2016.4275C13.2272%2016.4251%2013.1652%2016.4153%2013.1057%2016.3981L12.6443%2016.2609C12.5451%2016.2315%2012.4434%2016.2217%2012.3417%2016.2217V15.3667C12.4161%2015.3667%2012.4905%2015.374%2012.5649%2015.3961L13.0263%2015.5308C13.1107%2015.5553%2013.1999%2015.5676%2013.2868%2015.5725V16.4275ZM16.1765%2016.6333C16.0872%2016.4275%2015.9111%2016.2634%2015.6854%2016.2021L15.2438%2016.0796C15.1397%2016.0478%2015.0305%2016.0355%2014.9214%2016.0355V15.1829C15.0057%2015.1804%2015.0901%2015.1902%2015.1719%2015.2172L15.5341%2015.3299C15.9185%2015.45%2016.1765%2015.7979%2016.1765%2016.1948V16.6333ZM17.449%2018.1474C17.4415%2018.1719%2017.4366%2018.1964%2017.4291%2018.2209C17.3522%2018.4611%2017.129%2018.6203%2016.876%2018.6203C16.8537%2018.6203%2016.8313%2018.6154%2016.809%2018.613V17.7628C16.8264%2017.7652%2016.8413%2017.7677%2016.8586%2017.7677C17.1067%2017.7677%2017.3324%2017.6305%2017.4515%2017.4222V18.1474H17.449ZM19.8302%207.48242C19.5524%207.87933%2019.4061%208.34484%2019.4061%208.82749V9.2489L19.1903%209.5576C18.91%209.95696%2018.7611%2010.4249%2018.7611%2010.91V13.0342C18.7611%2013.3772%2018.6173%2013.7129%2018.3643%2013.9481L17.9103%2014.3744C17.6052%2014.661%2017.4366%2015.0628%2017.449%2015.4794L17.4515%2015.5749C17.4688%2016.1262%2017.3969%2016.675%2017.2406%2017.2042C17.191%2017.3732%2017.0323%2017.4908%2016.8561%2017.4908C16.6354%2017.4908%2016.4543%2017.3144%2016.4543%2017.0939V16.1948C16.4543%2015.6754%2016.117%2015.2221%2015.6159%2015.0677L15.2538%2014.955C15.0528%2014.8938%2014.842%2014.8913%2014.6386%2014.9501L13.5472%2015.2686C13.4033%2015.3103%2013.2496%2015.3103%2013.1057%2015.2686L12.6443%2015.1339C12.4062%2015.0628%2012.1482%2015.08%2011.92%2015.178L10.9502%2015.5994C10.3301%2015.8689%209.9307%2016.4741%209.9307%2017.1429V17.4884C9.54871%2017.4663%209.17664%2017.3536%208.84674%2017.1576L8.50692%2016.9567C8.21919%2016.7877%207.89177%2016.697%207.5569%2016.697H6.78548L6.21498%2016.381C5.94461%2016.2315%205.63951%2016.1531%205.32945%2016.1507L4.23805%2016.1433L2.98542%2015.4916C1.08539%2014.5042%200.274278%2012.2821%201.10027%2010.322L1.3508%209.72666C1.53683%209.28565%201.63357%208.81769%201.63357%208.33749V8.00428H1.90394C2.17183%208.00428%202.40003%207.82053%202.46204%207.57307H11.8481C12.0044%207.57307%2012.1482%207.66372%2012.2102%207.80583L12.4905%208.42569C12.5798%208.62414%2012.7783%208.75154%2012.999%208.75154C13.2173%208.75154%2013.4182%208.62414%2013.5075%208.42569L13.7878%207.80338C13.8523%207.66127%2013.9937%207.57062%2014.15%207.57062H14.4873C14.6337%207.57062%2014.7676%207.64902%2014.837%207.77643C15.0082%208.09003%2015.3158%208.30074%2015.6655%208.35709V12.2575C15.1025%2012.3188%2014.6709%2012.6496%2014.6709%2013.0514C14.6709%2013.4973%2015.1967%2013.8574%2015.8466%2013.8574C16.4965%2013.8574%2017.0223%2013.4973%2017.0223%2013.0514C17.0223%2012.6496%2016.5907%2012.3163%2016.0277%2012.2575V8.35464C16.3774%208.29828%2016.685%208.08758%2016.8561%207.77398C16.9256%207.64657%2017.0595%207.56817%2017.2059%207.56817H17.7069C17.9376%207.56817%2018.1485%207.45302%2018.275%207.26192L19.0191%206.12755C19.1158%205.9781%2019.282%205.8899%2019.4631%205.8899H19.6938C19.8575%205.8899%2019.9914%206.0222%2019.9914%206.1839V6.53426C19.9914%206.70331%2020.0584%206.86501%2020.175%206.98506L19.8302%207.48242ZM15.663%2012.8554V13.6296C15.3579%2013.583%2015.1322%2013.4287%2015.1322%2013.2425C15.1322%2013.0563%2015.3579%2012.8995%2015.663%2012.8554Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M43.6355%2014.2212L45.783%206.63627C46.0175%205.80901%2046.629%205.14498%2047.4288%204.848L47.4874%204.60107H44.5028L39.434%2010.6989L37.4942%204.60107H34.7636L34.6978%204.848C35.1653%205.08213%2035.423%205.78176%2035.423%206.35097V6.38628C35.423%209.63469%2033.0443%2015.2183%2029.6984%2015.2183C28.3982%2015.2183%2027.7242%2014.2901%2027.7242%2013.5165C27.7242%2012.5794%2028.5003%2011.9129%2029.3191%2011.9129C30.112%2011.9129%2030.2342%2012.211%2030.6909%2012.211C30.9696%2012.211%2031.2366%2012.0667%2031.3701%2011.8195C31.5797%2011.4313%2031.4208%2010.9572%2031.0376%2010.7714L30.8283%2010.6705C28.8775%209.72228%2026.6152%2011.1582%2026.6152%2013.3453V13.3756C26.6152%2014.9675%2027.8525%2016.2989%2029.4275%2016.3545C33.4867%2016.4983%2036.2019%2010.9661%2036.6338%206.91684L36.9458%208.01243L38.5448%2012.8545H39.1504L44.1452%206.83425L42.0498%2014.229C41.8094%2015.0773%2041.1437%2015.7344%2040.2985%2015.958L40.2399%2016.2049H44.2561L44.3216%2015.958C43.7283%2015.6043%2043.4461%2014.8902%2043.6355%2014.2212Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M51.9847%2012.6335H50.0625C50.2808%2012.034%2050.4898%2011.4617%2050.5603%2011.2743C51.0465%209.97682%2051.971%209.45183%2052.8665%209.37842L52.8572%209.3862L51.9847%2012.6335ZM53.7159%208.72607H53.6817C51.8071%208.7283%2049.7916%208.91155%2048.719%2011.9903C47.8179%2014.5767%2047.5745%2015.6481%2046.8705%2015.6481C46.4204%2015.6481%2046.5297%2014.763%2045.8549%2014.763C45.5509%2014.763%2045.2332%2015.0093%2045.2104%2015.3661C45.1705%2015.9826%2045.9909%2016.3555%2046.6092%2016.3555C48.4929%2016.3555%2049.2148%2014.9671%2049.4505%2014.3203C49.481%2014.2358%2049.6473%2013.778%2049.8436%2013.2386H51.8231L51.4878%2014.4866C51.3107%2015.145%2050.9465%2015.6839%2050.3304%2015.9595L50.2772%2016.2062H53.5154L53.5755%2015.9595C53.1372%2015.5941%2052.9469%2015.0082%2053.089%2014.4627L54.3075%209.78302C54.4011%209.42403%2054.6472%209.12789%2054.9809%208.973L55.0338%208.72607H53.9785H53.7159Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M70.056%209.26026C70.1601%209.08619%2070.2595%208.82035%2070.2595%208.67186L70.2597%208.67103C70.2741%208.39018%2070.0208%208.17273%2069.7488%208.23196H69.7482C69.5304%208.27951%2069.373%208.47499%2069.3771%208.70023C69.3807%208.93436%2069.3341%209.18574%2069.2353%209.30836C69.0082%209.59116%2068.645%209.56697%2066.9717%209.08174V9.07896C66.8186%209.03363%2066.6504%208.98414%2066.4731%208.93492C66.4637%208.93241%2066.4549%208.92963%2066.4453%208.92657L66.4456%208.92741C65.6106%208.698%2064.5732%208.4875%2063.8929%208.82869C63.8874%208.83148%2063.8816%208.83453%2063.8764%208.83704C63.2118%209.17406%2062.7479%209.81223%2062.6086%2010.5502C62.5879%2010.6587%2062.5728%2010.7468%2062.5711%2010.7788V10.7799C62.5513%2011.1675%2062.9009%2011.4679%2063.2767%2011.3864L63.2773%2011.3858C63.5821%2011.3196%2063.7965%2011.0441%2063.7902%2010.7296C63.7836%2010.4117%2063.7205%209.98741%2063.8918%209.70267C64.1674%209.31059%2064.4537%209.28278%2065.7361%209.71462L64.3436%2014.4877C64.1514%2015.1456%2063.6812%2015.6848%2063.059%2015.9601L63.0001%2016.2073H66.3319L66.3977%2015.9601C65.9679%2015.595%2065.7906%2015.0088%2065.9453%2014.4635L67.1628%2010.1637C67.6969%2010.276%2068.2381%2010.305%2068.7651%2010.1531L68.9548%2010.0986C69.3787%209.97629%2069.8129%209.6668%2070.056%209.26026Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M71.3889%208.72607L71.3234%208.97328C71.736%209.26108%2071.9219%209.78079%2071.7886%2010.2671L70.5506%2014.4816C70.3584%2015.14%2069.8882%2015.6789%2069.2659%2015.9542L69.207%2016.2011H70.9696H71.1306H75.1868L75.7226%2014.2252H75.4709L75.3806%2014.4145C75.0447%2015.1206%2074.3372%2015.5699%2073.5614%2015.5699H71.8415L72.7572%2012.2623L73.4878%2012.2615C73.9807%2012.2612%2074.3512%2012.7153%2074.2568%2013.2036H74.5084L75.1094%2010.9679H74.8578C74.7122%2011.3814%2074.3253%2011.6578%2073.8904%2011.658L72.9243%2011.6592L73.5597%209.36341L75.3825%209.36202C75.9775%209.36146%2076.4229%209.9126%2076.304%2010.5015H76.5556L77.033%208.72607H71.3889Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M82.8655%2010.5324C82.6668%2011.2028%2082.0564%2011.6627%2081.3632%2011.6627L80.3076%2011.6636L80.9466%209.36726L82.0055%209.3667C82.6067%209.36642%2083.0379%209.9512%2082.8655%2010.5324ZM82.7978%208.72998H78.7711L78.7053%208.97691C79.0919%209.24636%2079.2791%209.71935%2079.1921%2010.1779L77.9311%2014.4846C77.739%2015.1431%2077.269%2015.682%2076.6465%2015.9573L76.5879%2016.2048H79.9164L79.9822%2015.9573C79.5524%2015.5922%2079.3754%2015.006%2079.5296%2014.4607L80.14%2012.2662H80.3944C80.7787%2012.2665%2081.1014%2012.5584%2081.1438%2012.9444C81.1578%2013.069%2081.3505%2014.5947%2081.5044%2015.1195C81.7059%2015.8052%2081.9705%2016.205%2082.5729%2016.205H84.0788L84.1375%2015.9578L83.9219%2015.8288C83.4966%2015.5738%2083.1885%2015.1773%2083.0508%2014.6531C82.9203%2014.1585%2082.677%2013.2372%2082.5578%2012.7495C82.4961%2012.4981%2082.1866%2012.2654%2081.8667%2012.2654L82.3741%2012.2651C83.284%2012.2645%2084.0827%2011.6525%2084.328%2010.7671C84.611%209.74382%2083.8495%208.72998%2082.7978%208.72998Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M60.6842%209.10931C60.576%209.10931%2060.3431%209.03478%2059.9858%208.88463C59.6281%208.73447%2059.2669%208.65967%2058.9027%208.65967C58.1467%208.65967%2057.5157%208.90687%2056.9997%209.4352C56.5703%209.87483%2056.3795%2010.3628%2056.3795%2010.7852C56.3795%2011.2349%2056.6399%2011.7635%2057.1616%2012.1909C57.6542%2012.5949%2058.1668%2012.982%2058.68%2013.3771C59.2196%2013.8134%2059.4897%2014.2158%2059.4897%2014.5431C59.4897%2015.2616%2059.0269%2015.6481%2058.0688%2015.6481C57.0953%2015.6481%2056.4221%2014.9276%2056.2063%2013.5782H55.9431L55.1777%2016.2045H55.4203C55.7366%2015.9807%2055.9615%2015.8366%2056.4202%2015.8366C56.858%2015.8366%2057.3257%2016.3558%2058.3229%2016.3558C59.1191%2016.3558%2059.7493%2016.189%2060.2892%2015.6434C60.7481%2015.1668%2060.9775%2014.4994%2060.9775%2013.9538C60.9775%2013.4494%2060.6644%2012.8613%2060.1174%2012.4375C59.648%2012.0741%2059.1453%2011.7496%2058.6596%2011.3948C58.1332%2010.9993%2057.87%2010.6637%2057.87%2010.2956C57.87%2010.0906%2057.9713%209.88651%2058.174%209.68213C58.43%209.42325%2058.773%209.36596%2059.232%209.36596C60.1529%209.36596%2060.7974%209.88429%2060.8516%2010.9746H61.0945L61.7368%208.65967H61.4939C61.2373%208.95971%2060.9675%209.10931%2060.6842%209.10931Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M89.1717%209.36569C90.0926%209.36569%2090.7374%209.88401%2090.7914%2010.9743H91.0345L91.6765%208.65967H91.4334C91.1771%208.95915%2090.9075%209.10903%2090.6237%209.10903C90.5158%209.10903%2090.2829%209.03423%2089.9252%208.88435C89.5676%208.73447%2089.2067%208.65967%2088.8422%208.65967C88.0864%208.65967%2087.4554%208.90687%2086.9395%209.43493C86.51%209.87455%2086.3192%2010.3628%2086.3192%2010.785C86.3192%2011.2351%2086.5796%2011.7629%2087.1014%2012.1909C87.5939%2012.5949%2088.1065%2012.9817%2088.6197%2013.3768C89.159%2013.8134%2089.4294%2014.2158%2089.4294%2014.5428C89.4294%2015.2613%2088.9666%2015.6478%2088.0085%2015.6478C87.035%2015.6478%2086.3619%2014.9274%2086.1458%2013.5782H85.8826L85.1172%2016.2045H85.3603C85.6763%2015.9807%2085.9013%2015.8366%2086.3597%2015.8366C86.7977%2015.8366%2087.2652%2016.3558%2088.2626%2016.3558C89.0588%2016.3558%2089.689%2016.1884%2090.2289%2015.6434C90.6878%2015.1662%2090.9172%2014.4991%2090.9172%2013.9538C90.9172%2013.4494%2090.6041%2012.8613%2090.0574%2012.4375C89.5877%2012.0738%2089.0853%2011.7493%2088.5996%2011.3945C88.0729%2010.9993%2087.8097%2010.6632%2087.8097%2010.295C87.8097%2010.0909%2087.911%209.88623%2088.1134%209.68185C88.3697%209.42297%2088.7128%209.36569%2089.1717%209.36569Z'%20fill='%23006747'/%3e%3c/svg%3e",y=[{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_1.png",tagline:"Featured groups+ experience",headline:o.jsxs(o.Fragment,{children:["Welcome to ",o.jsx("br",{})," Featured Groups +"]})},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_2.png",headline:"Get real-time insights"},{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"}],k2=e.styled_default("div")({name:"OnboardingContainer",class:"on59ra",propsAsIs:!1}),b2=()=>e.x$1,D2=e.styled_default(b2())({name:"OnboardingNotificationContainer",class:"op1wk5d",propsAsIs:!0}),j=e.styled_default("div")({name:"InnerContainer",class:"i1i1g2vj",propsAsIs:!1}),j2=({deepLink:s,onboardingOpts:t,notification:n,gamification:r,loading:i,sdk:l})=>{var a,p,C,c,u,f,S;const m=e.useStore(r.friends.getStore()),[L,v]=d.useState(void 0),g=d.useMemo(()=>{var h,_;const k=l.getInviter();return k?(_=(h=m.data)==null?void 0:h.find(({slId:H})=>H===k))==null?void 0:_.name:""},[m.data,l]);return d.useEffect(()=>{const h=s.$store.subscribe(_=>{_&&v(_.data)});return()=>{h()}},[s.$store]),o.jsx(k2,{children:o.jsx(e.rn,{loading:i,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:(a=t.rules)==null?void 0:a.buttonLabel,rulesTitle:(p=t.rules)==null?void 0:p.heading,termsTitle:"Terms and Conditions",termsText:(C=t.rules)==null?void 0:C.terms,steps:y,primaryColor:(c=t.inviteCard)==null?void 0:c.iconColor,inviteLink:L,inviteCardTitle:(u=t.inviteCard)==null?void 0:u.heading,inviteCardSubtext:(f=t.inviteCard)==null?void 0:f.subtext,inviteCardBtnLabel:(S=t.inviteCard)==null?void 0:S.buttonLabel,onClose:()=>{var h;(h=n.close)==null||h.call(n)},gamification:r,sdk:l,inviterName:g})})},w2=({sdk:s,notification:t,saveHeight:n,style:r,appNode:i,sdkInDesktopView:l,responsiveStore:a})=>{var p;const C=d.useRef(null),c=t.data.onboarding,[u,f]=d.useState(c==null?void 0:c.instantOpen),S=s.getFeature(x.SdkOverlayType.GAMES),m=d.useMemo(()=>y==null?void 0:y.map(({graphicSrc:h})=>h),[]),{screen:L}=e.useStore(a,{keys:["screen"]});(p=c==null?void 0:c.titleCard)!=null&&p.media&&(c.titleCard.media.sponsorLogo=A2),d.useLayoutEffect(()=>{var h;n(((h=C.current)==null?void 0:h.getBoundingClientRect().height)||0)},[n]);const{loading:v,throttled:g}=e.I(m);return u&&S&&c&&i.current&&!g?o.jsx(e.x,{container:i,useContainer:!l,children:o.jsx(j2,{notification:t,setOpened:f,gamification:S,onboardingOpts:c,deepLink:S.deepLink,loading:v,sdk:s})}):o.jsxs(o.Fragment,{children:[o.jsx(j,{ref:C,style:{position:"absolute",visibility:"hidden"},children:o.jsx(D,{close:()=>{},action:()=>{},onboarding:c})}),o.jsx(D2,{style:r,hiding:t.hiding,children:o.jsx(j,{children:o.jsx(D,{close:t.close,action:()=>{var h;f(!0),(((h=i.current)==null?void 0:h.getBoundingClientRect().y)||0)<0&&R(i,L.size,{behavior:"smooth"})},onboarding:c})})})]})},F2=()=>e.x$1,O2=e.styled_default(F2())({name:"Container",class:"c1f0y7nw",propsAsIs:!0}),B=e.styled_default("div")({name:"InnerContainer",class:"i1qa3p7a",propsAsIs:!1}),V2=()=>B,$2=e.styled_default(V2())({name:"HiddenContainer",class:"hrthymv",propsAsIs:!0}),B2=e.styled_default("div")({name:"NotificationRefreshing",class:"n13rok4i",propsAsIs:!1}),H2=()=>e.h$2,P2=e.styled_default(H2())({name:"Pill",class:"pht79xf",propsAsIs:!0}),U2=s=>{const[t,n]=d.useState(0),r=d.useRef(null),i=d.useCallback(a=>{r.current=a},[]);d.useEffect(()=>{var a;const p=(a=r.current)==null?void 0:a.getBoundingClientRect();p&&n(p.height)},[s]);const l=d.useCallback(a=>{n(a)},[]);return[i,t,l]},M2=({sdk:s,notification:t,appNode:n,responsiveStore:r})=>{var i,l;const{sdkInDesktopView:a}=e.useStore(r,{keys:["sdkInDesktopView"]}),{sdk:p}=A(),[C,c,u]=U2(t.id);return t.type===e.NotificationType.QUESTION?o.jsxs(o.Fragment,{children:[o.jsx($2,{ref:C,children:o.jsx(e.w,{...t})}),o.jsxs(O2,{style:{height:t.hiding?0:c},hiding:t.hiding,children:[o.jsx(B,{style:{height:"100%"},children:o.jsx(e.w,{...t,controlVideo:p==null?void 0:p.controlVideoPlayer})}),o.jsx(B2,{},t.id)]})]}):t.type===e.NotificationType.QUESTION_RESOLVED&&(l=(i=t.data)==null?void 0:i.question)!=null&&l.predictionResult?o.jsx(e.z$1,{style:{height:t.hiding?0:c},saveHeight:u,close:t.close,hiding:t.hiding,...t.data.question,mastersApp:!0}):t.type===e.NotificationType.ONBOARDING?o.jsx(w2,{style:{height:t.hiding?0:c},saveHeight:u,sdk:s,notification:t,sdkInDesktopView:a,appNode:n,responsiveStore:r}):null},G2="p1co32q0",K2=({pill:s,setPill:t,appNode:n,headerNode:r,scrollNode:i,responsiveStore:l,scrollStore:a})=>{var p,C;const{screen:c}=e.useStore(l,{keys:["screen"]}),{tabsShown:u,scrollPosition:f}=e.useStore(a,{keys:["tabsShown","scrollPosition"]});d.useEffect(()=>{l.get().sdkInDesktopView?f<50&&t(null):f>-50&&t(null)},[f,l,t]);const S=l.get().sdkInDesktopView?n:r;return!s||!S.current?null:e.Ik.createPortal(o.jsx(P2,{title:s.type===e.NotificationType.QUESTION_RESOLVED?"Prediction result":`New ${((C=e.e[(p=s.data)==null?void 0:p.questionType])==null?void 0:C.label)||"notification"}`,onClick:()=>{var m;l.get().sdkInDesktopView?(m=i.current)==null||m.scrollTo({top:0,behavior:"smooth"}):R(n,c.size,{behavior:"smooth"}),t(null)},className:e.cx_default(u&&G2,"sl-pill-button")}),S.current)},z2=({sdk:s,headerNode:t,scrollNode:n,responsiveStore:r,appNode:i,scrollStore:l})=>{const[a]=d.useState(s.getNotificationsStore()),p=e.useStore(a),[C,c]=d.useState(null),u=d.useMemo(()=>s.getActiveNotification(),[s,p]);return d.useEffect(()=>{u&&e.eventBus.emit("notification",{action:"rendered",payload:{questionId:u.data.questionId,questionType:u.data.questionType}})},[u]),d.useEffect(()=>{u&&(r.get().sdkInDesktopView||r.get().sdkInView)&&(!r.get().sdkInDesktopView&&r.get().sdkInView&&c(u),r.get().sdkInDesktopView&&window.requestAnimationFrame(()=>{l.get().scrollPosition!==0&&c(u)}))},[u]),d.useEffect(()=>{u||c(null)},[u]),o.jsxs(o.Fragment,{children:[!C&&u&&o.jsx(M2,{headerNode:t,appNode:i,sdk:s,notification:u,responsiveStore:r}),C&&o.jsx(K2,{pill:C,setPill:c,appNode:i,notification:u,headerNode:t,scrollNode:n,scrollStore:l,responsiveStore:r})]})},w=Object.keys(e.A),T=()=>{const s=window.innerWidth;let t="sm";for(let n=w.length-1;n>0;n--){const r=w[n];if(!(s<e.A[r])&&s>=e.A[r]){t=r;break}}return{name:t,size:e.A[t]}},F=s=>{var t;return(((t=s.current)==null?void 0:t.getBoundingClientRect().y)||0)<-68},O=s=>s>=e.A.xl,q2=s=>{const[t]=d.useState(()=>{const n=T();return e.h$1({screen:T(),sdkInView:F(s),sdkInDesktopView:O(n.size)})});return d.useEffect(()=>{const n=e.c(()=>{t.setKey("sdkInView",F(s))},200),r=e.c(()=>{const i=T();t.setKey("screen",i),t.setKey("sdkInDesktopView",O(i.size))},200);return window.addEventListener("scroll",n),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",n),window.removeEventListener("resize",r)}},[t,s]),[t]},Q2={...e.R,BG_TRANSPARENT:"rgba(0,0,0, .8)",BLUE_QUESTION_ACTION_BTN:"#1589ee",WHITE:"#FFFFFF",BLUE:"#2d6ffd",GREY_PRIMARY_ONBOARDING_INAPP:"#B5B7B8",GREY_PRIMARY:"#909395",PRIMARY_1:"#107D57",PRIMARY_2:"#006747",PRIMARY_TEXT:"#25282A",QUESTION_TYPE_ICON:"#107D57",SUCCESS:"#107D57",UNSUCCESS:"#DF2F3B",SECONDARY_RED1:"#DF2F3B",NEUTRALS_WHITE:"#FFFFFF",NEUTRALS_WHITE1:"#FFFFFF",NEUTRALS_GRAY1:"#F7F7F7",NEUTRALS_GRAY2:"#F2F2F1",NEUTRALS_GRAY3:"#E8E8E8",NEUTRALS_GRAY4:"#D9D9D6",NEUTRALS_GRAY5:"#B1B3B3",NEUTRALS_GRAY6:"#888B8D",NEUTRALS_GRAY7:"#6B6F73",NEUTRALS_GRAY9:"#25282A",SDK_CONTAINER_BG:"#F7F7F7",SDK_WHITE_CONTAINER_BG:"#fff",SDK_DARK_CONTAINER_BG:"#fff",SDK_PREDICTION_RESULT_SUCCESS_BG:"#fff",SDK_PREDICTION_RESULT_INCORRECT_BG:"#fff",SDK_PREDICTION_RESULT_SUCCESS_TEXT:"#107D57",SDK_PREDICTION_RESULT_ERROR_TITLE:"#090E13",SDK_PREDICTION_RESULT_ERROR_SUBTITLE:"#DF2F3B",SDK_PREDICTION_RESULT_CLOSE_ICON:"#6B6F73",SDK_PREDICTION_FEEDBACK_SUCCESS_ICON:"#107D57",SDK_PREDICTION_FEEDBACK_INCORRECT_RECT1:"#CD2525",SDK_PREDICTION_FEEDBACK_INCORRECT_RECT2:"#fff",PREDICTION_BG_LINES_CORRECT:"#01AB58",PREDICTION_BG_LINES_INCORRECT:"#888B8D",SKELETON_COLOR_1:"#f1efef",SKELETON_COLOR_2:"#f9f8f8",TABS_CONTAINER_BG:"#F2F2F1",TABS_ACTIVE_BG:"#FFFFFF",TABS_COLOR:"#6B6F73",TABS_ACTIVE_COLOR:"#107D57",CARD_BG:"#FFFFFF",CARD_BORDER:"#fff",BORDER:"#E8E8E8",VOTE_BTN_BG:"#F7F7F7",VOTE_BTN_BORDER:"rgb(232, 232, 232)",VOTE_BTN_DISABLED_BORDER:"#B1B3B3",VOTE_BTN_SELECTED_BORDER:"#25282A",VOTE_BTN_NOT_SELECTED_BORDER:"#E8E8E8",VOTE_BTN_SELECTED_BG:"#FFFFFF",VOTE_BTN_NOT_SELECTED_BG:"#FFFFFF",VOTE_BTN_NOT_SELECTED_BG_UNSET:"rgb(196, 196, 196)",VOTED_ANSWER_BG:"rgba(16, 125, 87, 0.10)",VOTED_BTN_RCT_BG:"rgba(16, 125, 87, 0.30)",IN_APP_BG:"rgba(255, 255, 255, 0.90)",IN_APP_QUESTION_TYPE_ICON:"#1D7BFF",IN_APP_QUESTION_TYPE_LABEL:"#82899E",IN_APP_QUESTION_QUOTE:"rgba(10, 14, 19, 0.70)",IN_APP_QUESTION_RESULT_SUBTITLE_BG:"#1D7BFF",IN_APP_QUESTION_RESULT_LINE:"#babfc5"},E={...e.D,REGULAR:"'Benton Sans', BentonSans, Arial, Helvetica, sans-serif",SERIF:"'Tiempos', 'Tiempos Text', Times New Roman, serif",COLOR:"#fff",WEIGHT_DEFAULT:"500"},Z2=Object.entries(Q2).reduce((s,[t,n])=>`
2
+ ${s}
3
+ --color-${t.toLowerCase().replaceAll("_","-")}: ${n};
4
+ `,"");`${Z2}${E.REGULAR}${E.REGULAR}${E.COLOR}${E.SERIF}${E.WEIGHT_DEFAULT}${E.WEIGHT_DEFAULT1}${E.WEIGHT_DEFAULT2}${E.WEIGHT_DEFAULT3}${e.D.SIZE_DEFAULT}${e.D.SIZE_DEFAULT1}${e.D.SIZE_DEFAULT2}${e.D.LINE_HEIGHT}${e.D.MARGIN_TITLE_DEFAULT}${e.s.down("xl")`
5
+ --header-offset: 0px;
6
+ --watch-live-header: 0px;
7
+ `}${e.s.intermediate("xl","lg")`
8
+ --header-offset: 0px;
9
+ `}`;const W2="m1ojpy2l",Y2=({children:s,style:t})=>o.jsx("div",{className:"StreamLayerSDKTheme",children:o.jsx("div",{className:e.cx_default("masters-theme",W2),style:t,children:s})}),X2=({sdk:s,className:t,scrollStore:n,appNode:r,scrollNode:i,responsiveStore:l})=>{const[,a]=e.p$1(s);return o.jsx(m2,{className:t,scrollNode:i,appNode:r,scrollStore:n,feature:a,responsiveStore:l,sdk:s})},J2=({sdk:s,className:t,appNode:n,responsiveStore:r})=>{const i=e.useStore(s.featuresList.getStore());return i?Array.from(i,l=>{const a=s.getFeature(l);return a?o.jsx(v2,{className:t,appNode:n,feature:a,responsiveStore:r,sdk:s},l):null}):null},e0=({responsiveStore:s,...t})=>{const{sdkInDesktopView:n}=e.useStore(s);return o.jsx(P.re,{...t,isMobile:!n})},s0=({sdk:s})=>{const t=d.useRef(null),[n,r]=d.useState(!0),i=d.useRef(null),[l]=q2(t),[a,p]=X(t,l),C=e.useStore(s.status),c=e.useStore(s.sdkStore.slStreamId),u=!!e.useStore(s.userId()),f=C==="ready"&&!!c.data;d.useEffect(()=>{window.requestAnimationFrame(()=>{s.initializeApp().then(()=>{s.openFeature(x.SdkOverlayType.GAMES)})})},[s]),e.L(t,{enabled:!0,event:"click",listener:e.b$3}),e.L(a,{enabled:!0,event:"scrollend",listener:e.y,useDomNode:!0}),e.L(a,{enabled:!0,event:"click",listener:e.w$1,useDomNode:!0});const S=d.useMemo(()=>({sdk:s}),[s]);return d.useEffect(()=>{Promise.resolve().then(()=>require("./gamification-feature2.js"))},[]),o.jsxs($.Provider,{value:S,children:[n&&u&&o.jsx(e0,{sdk:s,onEvent:({type:m})=>m==="slOpenGameCenter"?r(!1):()=>{},close:()=>r(!1),responsiveStore:l}),!n&&u&&o.jsx(U,{ref:t,children:o.jsxs(M,{className:"sl-hide-on-modal",ref:a,children:[f&&o.jsx(z2,{sdk:s,scrollNode:a,headerNode:i,appNode:t,scrollStore:p,responsiveStore:l}),f&&o.jsx(X2,{scrollStore:p,responsiveStore:l,scrollNode:a,appNode:t,className:e.f,sdk:s}),f&&o.jsx(J2,{responsiveStore:l,appNode:t,className:e.f,sdk:s})]})}),!u&&o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"You are not logged in."})]})},t0=({sdkKey:s,plugins:t,children:n,onDeepLinkHandled:r,videoPlayerController:i,production:l=!0})=>o.jsx(e.StreamLayerProvider,{sdkKey:s,plugins:t,production:l,autoEnable:!1,onDeepLinkHandled:r,videoPlayerController:i,children:n}),n0=({children:s,overlays:t})=>{const{sdk:n,status:r}=d.useContext(e.StreamLayerContext);return r===e.StreamLayerStatus.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),s({})):n?o.jsx("div",{className:"StreamLayerSDK",children:o.jsx(Y2,{style:{height:"100%"},children:o.jsx(s0,{sdk:n,overlays:t,children:s})})}):s({})};class o0 extends d.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){console.error(t,n.componentStack)}render(){return this.state.hasError?this.props.children({}):o.jsx(n0,{...this.props})}}exports.MastersStreamLayerProvider=t0;exports.MastersStreamLayerSDKReact=o0;exports.z=f2;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),e=require("./provider.js"),u=require("react"),d=require("./useStreamLayerApp2.js");require("@bufbuild/protobuf");const E=()=>f,Q=()=>f,O=()=>f,z=()=>f,D=()=>f,f=e.styled_default("div")({name:"g",class:"g1mxl69i",propsAsIs:!1}),L=e.styled_default(E())({name:"V",class:"v1jt3w2c",propsAsIs:!0}),I=e.styled_default(Q())({name:"I",class:"i178msgc",propsAsIs:!0}),M=e.styled_default(O())({name:"W",class:"witns0f",propsAsIs:!0}),C=e.styled_default(z())({name:"G",class:"gw2eqv8",propsAsIs:!0}),R=e.styled_default(D())({name:"H",class:"h8e6tlf",propsAsIs:!0}),P=e.styled_default("div")({name:"K",class:"k1d4kk25",propsAsIs:!1}),U={[d.QuestionImages.UNSET]:I,[d.QuestionImages.NONE]:I,[d.QuestionImages.ROUNDED]:M,[d.QuestionImages.CENTERED]:C,[d.QuestionImages.TRANSPARENT]:L},_=({src:l,imageMode:a=d.QuestionImages.UNSET,withVideo:n,fromInsight:i})=>{if(a===d.QuestionImages.NONE)return null;const t=i?R:U[a];return s.jsxs(t,{children:[s.jsx("img",{src:l,alt:""}),n&&s.jsx(P,{children:s.jsx(e.p1,{name:"icon-play"})})]})},V=()=>e.p1,K=()=>e.p1,F=()=>e.ge,W=()=>e.p1,B=()=>e.p1,G=()=>j,H=()=>j,Y=()=>j,Z=()=>e.p1,X=()=>e.p1,$=()=>k,J=()=>e.p1,ss=e.styled_default("div")({name:"Z",class:"z1qm1hyz",propsAsIs:!1}),es=e.styled_default("div")({name:"tt",class:"t27jvdr",propsAsIs:!1}),w=e.styled_default("div")({name:"L",class:"l1jox3sj",propsAsIs:!1}),ts=e.styled_default("div")({name:"et",class:"e19jnjng",propsAsIs:!1}),ls=e.styled_default("button")({name:"it",class:"ir43pdl",propsAsIs:!1}),as=e.styled_default(V())({name:"nt",class:"nbnqqq5",propsAsIs:!0}),ns=e.styled_default("div")({name:"ot",class:"o1bhnjnl",propsAsIs:!1}),is=e.styled_default("blockquote")({name:"rt",class:"r13lqzum",propsAsIs:!1}),os=e.styled_default("div")({name:"at",class:"a167n9j1",propsAsIs:!1}),ds=e.styled_default("div")({name:"ct",class:"c55pgud",propsAsIs:!1}),rs=({image:l,tweet:a,account:n,accountVerified:i,body:t,title:r})=>{var c;return s.jsxs(ds,{children:[r&&s.jsx(ns,{children:s.jsx(is,{children:r})}),s.jsx(e.j,{image:l,name:(c=a==null?void 0:a.meta)==null?void 0:c.accountName,userName:n,verified:i,createdTweet:a==null?void 0:a.date}),s.jsx(os,{children:e.B(t)})]})},cs=({title:l,questionType:a,questionTypeData:n})=>s.jsxs(w,{children:[s.jsx(e.P,{questionTypeData:n,questionType:a,questionStatus:d.QuestionStatus.UNSET}),l&&s.jsx(ts,{children:l})]}),ps=({tweet:l})=>l?s.jsx(w,{children:s.jsx(rs,{...l,controlVideo:()=>{}})}):null,us=({action:l,questionType:a,inApp:n,insight:i,tweet:t})=>{var r;const c=e.X[a],o=e.Z[a];if(!c||!n||!n.notification)return null;const{title:m,image:x,imageMode:h}=n.notification;let p=x;a===d.QuestionType.TWEET&&t!=null&&t.tweetMedia&&(p=t.tweetMedia.image),h===d.QuestionImages.NONE&&(p="");const y=n.useMediaFromContent&&(i==null?void 0:i.image),v=a===d.QuestionType.TWEET&&((r=t==null?void 0:t.tweetMedia)==null?void 0:r.video)||a===d.QuestionType.FACTOID&&(i==null?void 0:i.video);return s.jsx(es,{className:"SL_InApp",onClick:l,children:s.jsxs(ss,{style:p?{}:{paddingLeft:"1.5rem"},children:[p&&!y&&s.jsx(_,{src:p,imageMode:h,withVideo:!!v}),y&&s.jsx(_,{src:y,fromInsight:!0,withVideo:!!v}),a===d.QuestionType.TWEET?s.jsx(ps,{tweet:t}):s.jsx(cs,{questionTypeData:c,questionType:a,title:m}),s.jsx(ls,{name:"inapp-button",children:o||"Open"}),s.jsx(as,{name:"chevronRight"})]})})},fs=e.styled_default("div")({name:"ht",class:"hjq7nef",propsAsIs:!1}),A=e.styled_default("img")({name:"S",class:"s1wpz4bk",propsAsIs:!1}),ms=e.styled_default("div")({name:"mt",class:"m9a4mjd",propsAsIs:!1}),xs=e.styled_default(K())({name:"ft",class:"f1hieehz",propsAsIs:!0}),ys=e.styled_default(F())({name:"ut",class:"u1ourn5d",propsAsIs:!0}),js=e.styled_default("div")({name:"gt",class:"g1evqivf",propsAsIs:!1}),hs=e.styled_default("div")({name:"xt",class:"x1fon3ii",propsAsIs:!1}),vs=e.styled_default("div")({name:"wt",class:"w14r8hqz",propsAsIs:!1}),Is=e.styled_default("button")({name:"yt",class:"yxk4apw",propsAsIs:!1}),_s=({open:l,close:a,...n})=>{var i,t;return s.jsxs(fs,{onClick:()=>{l==null||l(),n&&(n.instantOpen=!0)},children:[s.jsxs(ms,{children:[s.jsx(A,{className:"on-light",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png"}),s.jsx(A,{className:"on-dark",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"})]}),s.jsxs(js,{children:[s.jsxs(hs,{children:[s.jsx(xs,{name:"icon-trophy-solid"}),(i=n==null?void 0:n.titleCard)==null?void 0:i.title]}),s.jsxs(vs,{children:[s.jsx("span",{children:(t=n==null?void 0:n.titleCard)==null?void 0:t.subtitle}),s.jsx(Is,{name:"inapp-button",children:"Play Now"})]})]}),s.jsx(ys,{close:r=>{r==null||r.stopPropagation(),a==null||a()}})]})},As=e.styled_default("div")({name:"bt",class:"bfwt6f4",propsAsIs:!1}),gs=e.styled_default(W())({name:"kt",class:"kyg779c",propsAsIs:!0}),Ts=e.styled_default(B())({name:"It",class:"i1evrlv8",propsAsIs:!0}),qs=e.styled_default("div")({name:"Ct",class:"c1ikdq9p",propsAsIs:!1}),ws=e.styled_default("div")({name:"St",class:"sa973kf",propsAsIs:!1}),Ns=e.styled_default("div")({name:"Nt",class:"n1f8vz8k",propsAsIs:!1}),Ss=e.styled_default("div")({name:"Tt",class:"t2aop6q",propsAsIs:!1}),ks=({step:l,children:a,answer:n,state:i="pending"})=>s.jsxs(As,{children:[s.jsx(qs,{children:s.jsx(Ts,{name:"icon-prediction"})}),s.jsx(ws,{children:s.jsx(Ns,{children:a},l)}),s.jsx(Ss,{className:i,children:s.jsxs("div",{children:[s.jsx(gs,{name:"icon-check"}),"Your Pick: ",n]})})]}),bs=e.styled_default("div")({name:"Et",class:"e1rehgb5",propsAsIs:!1}),j=e.styled_default("div")({name:"y",class:"ylp5m3t",propsAsIs:!1}),Es=e.styled_default(G())({name:"$t",class:"_o9k3m4",propsAsIs:!0}),Qs=e.styled_default(H())({name:"Lt",class:"l1f41dxb",propsAsIs:!0}),Os=e.styled_default(Y())({name:"zt",class:"z1vokrte",propsAsIs:!0}),zs=()=>s.jsxs(bs,{children:[s.jsx(Es,{children:s.jsx("div",{})}),s.jsx(Qs,{children:s.jsx("div",{})}),s.jsx(Os,{children:s.jsx("div",{})})]}),Ds=e.styled_default("div")({name:"qt",class:"q1ftib8q",propsAsIs:!1}),Ls=e.styled_default(Z())({name:"Rt",class:"r1m9yg5p",propsAsIs:!0}),Ms=()=>s.jsxs(Ds,{children:[s.jsx(Ls,{name:"icon-check"})," Prediction results are in!"]}),Cs=e.styled_default("div")({name:"Ot",class:"oa7jasz",propsAsIs:!1}),Rs=e.styled_default("div")({name:"Qt",class:"q13bebf9",propsAsIs:!1}),Ps=e.styled_default("div")({name:"Pt",class:"p1o3s78d",propsAsIs:!1}),Us=({title:l})=>s.jsxs(Cs,{children:[s.jsx(Rs,{children:"Results for"}),s.jsx(Ps,{children:l})]}),N=e.styled_default("div")({name:"z",class:"z19uba88",propsAsIs:!1}),S=e.styled_default("div")({name:"M",class:"me3836e",propsAsIs:!1}),k=e.styled_default(X())({name:"q",class:"q12u443i",propsAsIs:!0}),Vs=e.styled_default($())({name:"At",class:"andaq1w",propsAsIs:!0}),Ks=()=>s.jsxs(N,{children:[s.jsxs(S,{children:["Congratulations!",s.jsx("br",{}),"You answered correctly."]}),s.jsx(k,{name:"icon-check"})]}),Fs=({title:l})=>s.jsxs(N,{children:[s.jsxs(S,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",l]}),s.jsx(Vs,{name:"icon-cross"})]}),Ws=e.styled_default("div")({name:"_t",class:"_1tv8lyn",propsAsIs:!1}),Bs=e.styled_default("div")({name:"Ft",class:"f15gn2pe",propsAsIs:!1}),Gs=e.styled_default(J())({name:"Ut",class:"uz0guqg",propsAsIs:!0}),Hs=({points:l})=>s.jsxs(Ws,{children:[s.jsxs(Bs,{children:["You won ",s.jsx(e.a,{delay:.5,prefix:"+",suffix:" points",value:l})]}),s.jsx(Gs,{name:"icon-trophy-solid"})]}),g=e.styled_default("div")({name:"N",class:"nfeou2w",propsAsIs:!1}),T=e.styled_default("div")({name:"T",class:"tyhpuaw",propsAsIs:!1}),q={1:3e3,2:4e3,3:4e3,4:4e3},Ys=({close:l,action:a,setStep:n,votedAnswer:i,correct:t,correctAnswerTitle:r,questionTitle:c,step:o})=>{if(u.useEffect(()=>{if(n){const x=setTimeout(()=>{q[o+1]&&(t||o<3)?n(o+1):l==null||l()},q[o]);return()=>{x&&clearTimeout(x)}}return()=>{}},[n,o,l,t]),o===1)return s.jsx(g,{children:s.jsx(T,{children:s.jsx(Ms,{})})});let m="pending";return(o===3||o===4)&&(m=t?"correct":"incorrect"),s.jsx(g,{onClick:()=>a==null?void 0:a(),children:s.jsxs(T,{children:[o!==1&&s.jsx(zs,{},o),s.jsxs(ks,{state:m,step:o,answer:(i==null?void 0:i.title)||"unknown",children:[o===2&&s.jsx(Us,{title:c||"unknown"}),o===3&&t&&s.jsx(Ks,{}),o===3&&!t&&s.jsx(Fs,{title:r||"unknown"}),o===4&&s.jsx(Hs,{points:(i==null?void 0:i.points)||0})]})]})})},Zs=({close:l,action:a,votedAnswer:n,correct:i,correctAnswerTitle:t,questionTitle:r})=>{const[c,o]=u.useState(1);return s.jsx(Ys,{close:l,action:a,votedAnswer:n,correct:i,correctAnswerTitle:t,questionTitle:r,setStep:o,step:c,title:""})},Xs=e.styled_default("div")({name:"Ht",class:"hvynqnf",propsAsIs:!1}),$s=l=>s.jsx(Xs,{children:s.jsx(Zs,{...l})}),b=({sdk:l})=>{const[a]=u.useState(l.getNotificationsStore()),n=e.useStore(a),i=l.getFeature(d.SdkOverlayType.GAMES),t=u.useMemo(()=>l.getActiveNotification(),[l,n]);return u.useEffect(()=>{t&&e.eventBus.emit("notification",{action:"rendered",payload:{questionId:t.data.questionId,questionType:t.data.questionType}})},[t]),t&&t.type===e.NotificationType.QUESTION_RESOLVED?t.data.question&&t.data.questionType===d.QuestionType.PREDICTION?s.jsx($s,{action:t.action,close:t.close,...t.data.question}):null:t&&t.type===e.NotificationType.ONBOARDING?t.data.onboarding?s.jsx(_s,{open:i==null?void 0:i.openFeature,close:t.close,...t.data.onboarding}):null:t&&s.jsx(us,{...t.data,action:t.action})},Js=({theme:l})=>{const a=e.useStreamLayer(),n=e.useStreamLayerTheme(),i=e.useStreamLayerUI();return a&&i.appNotification?i.app?null:s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(e.h,{customTheme:l??n.theme,themeMode:n.themeMode,children:s.jsx(b,{sdk:a})})}):null};exports.StreamLayerSDKNotification=Js;exports.StreamLayerSDKNotificationUI=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./provider.js"),d=require("./useStreamLayerApp2.js"),s=require("react/jsx-runtime"),p=require("react"),m=e.styled_default("div")({name:"Media",class:"m1bcvojl",propsAsIs:!1}),E=()=>m,q=e.styled_default(E())({name:"MediaImgBottom",class:"m58gin0",propsAsIs:!0}),w=()=>m,v=e.styled_default(w())({name:"MediaImgSolid",class:"m1atm8do",propsAsIs:!0}),M=()=>m,Q=e.styled_default(M())({name:"MediaImgRounded",class:"myx3xoi",propsAsIs:!0}),L=()=>m,D=e.styled_default(L())({name:"MediaImgCentered",class:"m1bwv0gx",propsAsIs:!0}),O=()=>m,R=e.styled_default(O())({name:"MediaImgInsight",class:"mntjanp",propsAsIs:!0}),z=e.styled_default("div")({name:"VideoIcon",class:"v1kofb47",propsAsIs:!1}),B={[d.QuestionImages.UNSET]:v,[d.QuestionImages.NONE]:v,[d.QuestionImages.ROUNDED]:Q,[d.QuestionImages.CENTERED]:D,[d.QuestionImages.TRANSPARENT]:q},A=({src:n,imageMode:a=d.QuestionImages.UNSET,withVideo:i,fromInsight:l})=>{if(a===d.QuestionImages.NONE)return null;const t=l?R:B[a];return s.jsxs(t,{children:[s.jsx("img",{src:n,alt:""}),i&&s.jsx(z,{children:s.jsx(e.E1,{name:"icon-play"})})]})},P=e.styled_default("div")({name:"NotificationContent",class:"nuraq9m",propsAsIs:!1}),U=e.styled_default("div")({name:"NotificationContainer",class:"ns1nzpg",propsAsIs:!1}),N=e.styled_default("div")({name:"Body",class:"b1j59nzs",propsAsIs:!1}),V=e.styled_default("div")({name:"Title",class:"t9vmnpp",propsAsIs:!1}),F=e.styled_default("button")({name:"Button",class:"b14ivj5k",propsAsIs:!1}),K=()=>e.E1,W=e.styled_default(K())({name:"StyledChevronRight",class:"s1atci8n",propsAsIs:!0}),G=e.styled_default("div")({name:"QuoteWrap",class:"q4w8jgs",propsAsIs:!1}),Y=e.styled_default("blockquote")({name:"Quote",class:"qaa0kez",propsAsIs:!1}),H=e.styled_default("div")({name:"Body",class:"b1wvd52w",propsAsIs:!1}),J=e.styled_default("div")({name:"Container",class:"ccvukea",propsAsIs:!1}),X=({image:n,tweet:a,account:i,accountVerified:l,body:t,title:c})=>{var r;return s.jsxs(J,{children:[c&&s.jsx(G,{children:s.jsx(Y,{children:c})}),s.jsx(e.D$1,{image:n,name:(r=a==null?void 0:a.meta)==null?void 0:r.accountName,userName:i,verified:l,createdTweet:a==null?void 0:a.date}),s.jsx(H,{children:e.S$2(t)})]})},Z=({title:n,questionType:a,questionTypeData:i})=>s.jsxs(N,{children:[s.jsx(e.x$2,{questionTypeData:i,questionType:a,questionStatus:d.QuestionStatus.UNSET}),n&&s.jsx(V,{children:n})]}),ss=({tweet:n})=>n?s.jsx(N,{children:s.jsx(X,{...n,controlVideo:()=>{}})}):null,es=({action:n,questionType:a,inApp:i,insight:l,tweet:t})=>{var c;const r=e.e[a],o=e.o[a];if(!r||!i||!i.notification)return null;const{title:y,image:j,imageMode:I}=i.notification;let u=j;a===d.QuestionType.TWEET&&t!=null&&t.tweetMedia&&(u=t.tweetMedia.image),I===d.QuestionImages.NONE&&(u="");const x=i.useMediaFromContent&&(l==null?void 0:l.image),h=a===d.QuestionType.TWEET&&((c=t==null?void 0:t.tweetMedia)==null?void 0:c.video)||a===d.QuestionType.FACTOID&&(l==null?void 0:l.video);return s.jsx(U,{className:"SL_InApp",onClick:n,children:s.jsxs(P,{style:u?{}:{paddingLeft:"1.5rem"},children:[u&&!x&&s.jsx(A,{src:u,imageMode:I,withVideo:!!h}),x&&s.jsx(A,{src:x,fromInsight:!0,withVideo:!!h}),a===d.QuestionType.TWEET?s.jsx(ss,{tweet:t}):s.jsx(Z,{questionTypeData:r,questionType:a,title:y}),s.jsx(F,{name:"inapp-button",children:o||"Open"}),s.jsx(W,{name:"chevronRight"})]})})},ts=e.styled_default("div")({name:"NotificationContainer",class:"n11jcrxe",propsAsIs:!1}),$=e.styled_default("img")({name:"Icon",class:"i1vmpt6u",propsAsIs:!1}),ns=e.styled_default("div")({name:"IconContainer",class:"i180665s",propsAsIs:!1}),as=()=>e.E1,is=e.styled_default(as())({name:"TitleIcon",class:"t16zzzei",propsAsIs:!0}),ls=()=>e.b,os=e.styled_default(ls())({name:"Close",class:"c1sur0q2",propsAsIs:!0}),ds=e.styled_default("div")({name:"Body",class:"bai9j52",propsAsIs:!1}),cs=e.styled_default("div")({name:"Title",class:"t1bnt25p",propsAsIs:!1}),rs=e.styled_default("div")({name:"Description",class:"dmixjec",propsAsIs:!1}),us=e.styled_default("button")({name:"Button",class:"b1ubkw1q",propsAsIs:!1}),ps=({open:n,close:a,...i})=>{var l,t;return s.jsxs(ts,{onClick:()=>{n==null||n(),i&&(i.instantOpen=!0)},children:[s.jsxs(ns,{children:[s.jsx($,{className:"on-light",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png"}),s.jsx($,{className:"on-dark",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"})]}),s.jsxs(ds,{children:[s.jsxs(cs,{children:[s.jsx(is,{name:"icon-trophy-solid"}),(l=i==null?void 0:i.titleCard)==null?void 0:l.title]}),s.jsxs(rs,{children:[s.jsx("span",{children:(t=i==null?void 0:i.titleCard)==null?void 0:t.subtitle}),s.jsx(us,{name:"inapp-button",children:"Play Now"})]})]}),s.jsx(os,{close:c=>{c==null||c.stopPropagation(),a==null||a()}})]})},ms=e.styled_default("div")({name:"Container",class:"cef8huz",propsAsIs:!1}),ys=()=>e.E1,js=e.styled_default(ys())({name:"CheckIcon",class:"c1mo15kk",propsAsIs:!0}),xs=()=>e.E1,fs=e.styled_default(xs())({name:"PredictionIcon",class:"p16zkqnm",propsAsIs:!0}),Is=e.styled_default("div")({name:"PredictionIconContainer",class:"pjszi7a",propsAsIs:!1}),hs=e.styled_default("div")({name:"BodyContainer",class:"bftbmo3",propsAsIs:!1}),vs=e.styled_default("div")({name:"Body",class:"barrbyu",propsAsIs:!1}),As=e.styled_default("div")({name:"Subtitle",class:"sz7237i",propsAsIs:!1}),$s=({step:n,children:a,answer:i,state:l="pending"})=>s.jsxs(ms,{children:[s.jsx(Is,{children:s.jsx(fs,{name:"icon-prediction"})}),s.jsx(hs,{children:s.jsx(vs,{children:a},n)}),s.jsx(As,{className:l,children:s.jsxs("div",{children:[s.jsx(js,{name:"icon-check"}),"Your Pick: ",i]})})]}),_s=e.styled_default("div")({name:"Container",class:"ckyzolp",propsAsIs:!1}),f=e.styled_default("div")({name:"Line",class:"l16t1zr7",propsAsIs:!1}),gs=()=>f,Ts=e.styled_default(gs())({name:"Line1",class:"le78kvg",propsAsIs:!0}),Ns=()=>f,Cs=e.styled_default(Ns())({name:"Line2",class:"l1o7966d",propsAsIs:!0}),Ss=()=>f,bs=e.styled_default(Ss())({name:"Line3",class:"lu9lyxq",propsAsIs:!0}),ks=()=>s.jsxs(_s,{children:[s.jsx(Ts,{children:s.jsx("div",{})}),s.jsx(Cs,{children:s.jsx("div",{})}),s.jsx(bs,{children:s.jsx("div",{})})]}),Es=e.styled_default("div")({name:"Container",class:"c10jy6zf",propsAsIs:!1}),qs=()=>e.E1,ws=e.styled_default(qs())({name:"CheckIcon",class:"c1c7scay",propsAsIs:!0}),Ms=()=>s.jsxs(Es,{children:[s.jsx(ws,{name:"icon-check"})," Prediction results are in!"]}),Qs=e.styled_default("div")({name:"Container",class:"cf6k2yy",propsAsIs:!1}),Ls=e.styled_default("div")({name:"Caption",class:"c1c8xjus",propsAsIs:!1}),Ds=e.styled_default("div")({name:"Title",class:"t1d1uekn",propsAsIs:!1}),Os=({title:n})=>s.jsxs(Qs,{children:[s.jsx(Ls,{children:"Results for"}),s.jsx(Ds,{children:n})]}),C=e.styled_default("div")({name:"Container",class:"c181a1as",propsAsIs:!1}),S=e.styled_default("div")({name:"Title",class:"t1cduox6",propsAsIs:!1}),Rs=()=>e.E1,b=e.styled_default(Rs())({name:"CorrectIcon",class:"c1onrv6j",propsAsIs:!0}),zs=()=>b,Bs=e.styled_default(zs())({name:"InCorrectIcon",class:"i17n9o7e",propsAsIs:!0}),Ps=()=>s.jsxs(C,{children:[s.jsxs(S,{children:["Congratulations!",s.jsx("br",{}),"You answered correctly."]}),s.jsx(b,{name:"icon-check"})]}),Us=({title:n})=>s.jsxs(C,{children:[s.jsxs(S,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",n]}),s.jsx(Bs,{name:"icon-cross"})]}),Vs=e.styled_default("div")({name:"Container",class:"cnxgcs2",propsAsIs:!1}),Fs=e.styled_default("div")({name:"Title",class:"t903f8n",propsAsIs:!1}),Ks=()=>e.E1,Ws=e.styled_default(Ks())({name:"CheckIcon",class:"ceyu3qj",propsAsIs:!0}),Gs=({points:n})=>s.jsxs(Vs,{children:[s.jsxs(Fs,{children:["You won ",s.jsx(e.d,{delay:.5,prefix:"+",suffix:" points",value:n})]}),s.jsx(Ws,{name:"icon-trophy-solid"})]}),_=e.styled_default("div")({name:"Container",class:"cq3agu2",propsAsIs:!1}),g=e.styled_default("div")({name:"Body",class:"b16qj0do",propsAsIs:!1}),T={1:3e3,2:4e3,3:4e3,4:4e3},Ys=({close:n,action:a,setStep:i,votedAnswer:l,correct:t,correctAnswerTitle:c,questionTitle:r,step:o})=>{if(p.useEffect(()=>{if(i){const j=setTimeout(()=>{T[o+1]&&(t||o<3)?i(o+1):n==null||n()},T[o]);return()=>{j&&clearTimeout(j)}}return()=>{}},[i,o,n,t]),o===1)return s.jsx(_,{children:s.jsx(g,{children:s.jsx(Ms,{})})});let y="pending";return(o===3||o===4)&&(y=t?"correct":"incorrect"),s.jsx(_,{onClick:()=>a==null?void 0:a(),children:s.jsxs(g,{children:[o!==1&&s.jsx(ks,{},o),s.jsxs($s,{state:y,step:o,answer:(l==null?void 0:l.title)||"unknown",children:[o===2&&s.jsx(Os,{title:r||"unknown"}),o===3&&t&&s.jsx(Ps,{}),o===3&&!t&&s.jsx(Us,{title:c||"unknown"}),o===4&&s.jsx(Gs,{points:(l==null?void 0:l.points)||0})]})]})})},Hs=({close:n,action:a,votedAnswer:i,correct:l,correctAnswerTitle:t,questionTitle:c})=>{const[r,o]=p.useState(1);return s.jsx(Ys,{close:n,action:a,votedAnswer:i,correct:l,correctAnswerTitle:t,questionTitle:c,setStep:o,step:r,title:""})},Js=e.styled_default("div")({name:"NotificationContainer",class:"n1i4h28u",propsAsIs:!1}),Xs=n=>s.jsx(Js,{children:s.jsx(Hs,{...n})}),k=({sdk:n})=>{const[a]=p.useState(n.getNotificationsStore()),i=e.useStore(a),l=n.getFeature(d.SdkOverlayType.GAMES),t=p.useMemo(()=>n.getActiveNotification(),[n,i]);return p.useEffect(()=>{t&&e.eventBus.emit("notification",{action:"rendered",payload:{questionId:t.data.questionId,questionType:t.data.questionType}})},[t]),t&&t.type===e.NotificationType.QUESTION_RESOLVED?t.data.question&&t.data.questionType===d.QuestionType.PREDICTION?s.jsx(Xs,{action:t.action,close:t.close,...t.data.question}):null:t&&t.type===e.NotificationType.ONBOARDING?t.data.onboarding?s.jsx(ps,{open:l==null?void 0:l.openFeature,close:t.close,...t.data.onboarding}):null:t&&s.jsx(es,{...t.data,action:t.action})},Zs=({theme:n})=>{const a=e.useStreamLayer(),i=e.useStreamLayerTheme(),l=e.useStreamLayerUI();return a&&l.appNotification?l.app?null:s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(e.h,{customTheme:n??i.theme,themeMode:i.themeMode,children:s.jsx(k,{sdk:a})})}):null};exports.StreamLayerSDKNotification=Zs;exports.StreamLayerSDKNotificationUI=k;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("./provider.js"),u=require("react");require("nanostores");require("@bufbuild/protobuf");const c=require("./useStreamLayerApp2.js"),d=()=>e.p1,m=e.styled_default("div")({name:"v",class:"vo74vtj",propsAsIs:!1}),p=e.styled_default("div")({name:"S",class:"saa7tf1",propsAsIs:!1}),y=e.styled_default(d())({name:"w",class:"we3ylu3",propsAsIs:!0}),S=e.styled_default("div")({name:"b",class:"bw198ph",propsAsIs:!1}),f=e.styled_default("div")({name:"P",class:"p1warvjl",propsAsIs:!1}),v=e.styled_default("div")({name:"C",class:"conlc3z",propsAsIs:!1}),h=({points:s,onClick:r,className:a})=>t.jsxs(m,{className:a,onClick:r,children:[t.jsx(p,{children:t.jsx(y,{name:"icon-trophy-solid"})}),t.jsxs(S,{children:[t.jsx(f,{children:"Total points"}),t.jsx(v,{children:t.jsx(e.a,{value:s})})]})]}),j=({gamification:s})=>{const r=s.userSummary.$store,[a,o]=u.useState(0);return u.useEffect(()=>{const i=r.subscribe(l=>{var n;(n=l==null?void 0:l.summary)!=null&&n.points&&o(l.summary.points)});return()=>{i()}},[r]),t.jsx(h,{className:e.l,points:a,onClick:()=>{s.status.get()===e.FeatureStatus.Suspended?s.openFeature():s.status.get()===e.FeatureStatus.Ready&&s.closeFeature(!1)}})},x=({sdk:s})=>{if(!e.useStore(s.featuresList.getStore()))return null;const r=s.getFeature(c.SdkOverlayType.GAMES);return r?t.jsx(j,{gamification:r}):null},b=({theme:s})=>{const r=e.useStreamLayer(),a=e.useStreamLayerTheme();return r?t.jsx("div",{className:"StreamLayerSDK",children:t.jsx(e.h,{customTheme:s??a.theme,themeMode:a.themeMode,children:t.jsx(x,{sdk:r})})}):null};exports.StreamLayerSDKPoints=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),e=require("./provider.js"),c=require("./useStreamLayerApp2.js"),d=e.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),m=e.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),p=()=>e.E1,y=e.styled_default(p())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),S=e.styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),h=e.styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),f=e.styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),j=({points:s,onClick:r})=>t.jsxs(d,{className:e.f,onClick:r,children:[t.jsx(m,{children:t.jsx(y,{name:"icon-trophy-solid"})}),t.jsxs(S,{children:[t.jsx(h,{children:"Total points"}),t.jsx(f,{children:t.jsx(e.d,{value:s})})]})]}),v=({gamification:s})=>{const r=s.userSummary.$store,[n,l]=i.useState(0);return i.useEffect(()=>{const u=r.subscribe(a=>{var o;(o=a==null?void 0:a.summary)!=null&&o.points&&l(a.summary.points)});return()=>{u()}},[r]),t.jsx(j,{points:n,onClick:()=>{s.status.get()===e.FeatureStatus.Suspended?s.openFeature():s.status.get()===e.FeatureStatus.Ready&&s.closeFeature(!1)}})},x=({sdk:s})=>{if(!e.useStore(s.featuresList.getStore()))return null;const r=s.getFeature(c.SdkOverlayType.GAMES);return r?t.jsx(v,{gamification:r}):null},g=({theme:s})=>{const r=e.useStreamLayer(),n=e.useStreamLayerTheme();return r?t.jsx("div",{className:"StreamLayerSDK",children:t.jsx(e.h,{customTheme:s??n.theme,themeMode:n.themeMode,children:t.jsx(x,{sdk:r})})}):null};exports.StreamLayerSDKPoints=g;