@streamlayer/react 1.23.1 → 1.23.2

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 (159) hide show
  1. package/lib/cjs/Question.js +1 -1
  2. package/lib/cjs/advertisement.js +28 -223
  3. package/lib/cjs/analytics.js +1 -1
  4. package/lib/cjs/auth.js +1 -1
  5. package/lib/cjs/bet-pack.js +1 -1
  6. package/lib/cjs/feature.js +1 -1
  7. package/lib/cjs/gamification-feature.js +1 -1
  8. package/lib/cjs/gamification-feature2.js +1 -1
  9. package/lib/cjs/hooks-WfHlJH12.js +1 -1
  10. package/lib/cjs/index-eShKGO10.js +1 -5
  11. package/lib/cjs/index.js +1 -1
  12. package/lib/cjs/index10.js +1 -1
  13. package/lib/cjs/index11.js +3 -4
  14. package/lib/cjs/index12.js +1 -1
  15. package/lib/cjs/index13.js +3 -1
  16. package/lib/cjs/index14.js +1 -1
  17. package/lib/cjs/index15.js +1 -1
  18. package/lib/cjs/index16.js +3 -5
  19. package/lib/cjs/index2.js +1 -1
  20. package/lib/cjs/index3.js +1 -1
  21. package/lib/cjs/index4.js +3 -5
  22. package/lib/cjs/index5.js +1 -1
  23. package/lib/cjs/index6.js +1 -1
  24. package/lib/cjs/index7.js +1 -1
  25. package/lib/cjs/index8.js +1 -1
  26. package/lib/cjs/index9.js +1 -1
  27. package/lib/cjs/insight.js +1 -1
  28. package/lib/cjs/masters.js +1 -1
  29. package/lib/cjs/masters2.js +1 -13
  30. package/lib/cjs/notification.js +1 -1
  31. package/lib/cjs/pause-ad.js +1 -1
  32. package/lib/cjs/points.js +1 -1
  33. package/lib/cjs/polymarket.js +5 -15
  34. package/lib/cjs/sl-types.js +1 -15
  35. package/lib/cjs/storage.js +1 -1
  36. package/lib/cjs/style.css +1 -0
  37. package/lib/cjs/theme.js +1 -17
  38. package/lib/cjs/useStreamLayerApp.js +1 -1
  39. package/lib/cjs/useStreamLayerApp2.js +3 -17
  40. package/lib/cjs/utils.js +1 -47
  41. package/lib/classic/cjs/Question.js +1 -1
  42. package/lib/classic/cjs/advertisement.js +28 -223
  43. package/lib/classic/cjs/analytics.js +1 -1
  44. package/lib/classic/cjs/auth.js +1 -1
  45. package/lib/classic/cjs/bet-pack.js +3 -5
  46. package/lib/classic/cjs/feature.js +1 -1
  47. package/lib/classic/cjs/gamification-feature.js +1 -1
  48. package/lib/classic/cjs/hooks-WfHlJH12.js +1 -1
  49. package/lib/classic/cjs/index-eShKGO10.js +1 -5
  50. package/lib/classic/cjs/index.js +1 -1
  51. package/lib/classic/cjs/index10.js +1 -1
  52. package/lib/classic/cjs/index11.js +1 -1
  53. package/lib/classic/cjs/index12.js +1 -1
  54. package/lib/classic/cjs/index13.js +3 -4
  55. package/lib/classic/cjs/index2.js +3 -5
  56. package/lib/classic/cjs/index3.js +1 -1
  57. package/lib/classic/cjs/index4.js +1 -1
  58. package/lib/classic/cjs/index5.js +1 -1
  59. package/lib/classic/cjs/index6.js +1 -1
  60. package/lib/classic/cjs/index7.js +1 -1
  61. package/lib/classic/cjs/index8.js +1 -1
  62. package/lib/classic/cjs/index9.js +3 -1
  63. package/lib/classic/cjs/insight.js +1 -1
  64. package/lib/classic/cjs/notification.js +1 -1
  65. package/lib/classic/cjs/notification2.js +1 -1
  66. package/lib/classic/cjs/pause-ad.js +1 -1
  67. package/lib/classic/cjs/points.js +1 -1
  68. package/lib/classic/cjs/polymarket.js +5 -15
  69. package/lib/classic/cjs/sl-types.js +1 -15
  70. package/lib/classic/cjs/style.css +1 -0
  71. package/lib/classic/cjs/useStreamLayerApp.js +1 -1
  72. package/lib/classic/cjs/useStreamLayerApp2.js +3 -17
  73. package/lib/classic/cjs/utils.js +1 -47
  74. package/lib/classic/es/Question.js +277 -264
  75. package/lib/classic/es/advertisement.js +34990 -18881
  76. package/lib/classic/es/analytics.js +58 -56
  77. package/lib/classic/es/auth.js +14 -8
  78. package/lib/classic/es/bet-pack.js +2448 -2419
  79. package/lib/classic/es/feature.js +93 -48
  80. package/lib/classic/es/gamification-feature.js +2 -2
  81. package/lib/classic/es/hooks-WfHlJH12.js +78 -78
  82. package/lib/classic/es/index-eShKGO10.js +948 -948
  83. package/lib/classic/es/index.js +13 -13
  84. package/lib/classic/es/index10.js +68 -67
  85. package/lib/classic/es/index11.js +2903 -2159
  86. package/lib/classic/es/index12.js +124 -119
  87. package/lib/classic/es/index13.js +581 -566
  88. package/lib/classic/es/index2.js +2098 -1763
  89. package/lib/classic/es/index3.js +11 -11
  90. package/lib/classic/es/index4.js +127 -127
  91. package/lib/classic/es/index5.js +3 -4
  92. package/lib/classic/es/index6.js +8 -3
  93. package/lib/classic/es/index7.js +6 -5
  94. package/lib/classic/es/index8.js +8 -7
  95. package/lib/classic/es/index9.js +225 -223
  96. package/lib/classic/es/insight.js +58 -53
  97. package/lib/classic/es/notification.js +3 -3
  98. package/lib/classic/es/notification2.js +764 -722
  99. package/lib/classic/es/pause-ad.js +190 -167
  100. package/lib/classic/es/points.js +55 -48
  101. package/lib/classic/es/polymarket.js +4209 -4031
  102. package/lib/classic/es/sl-types.js +193 -125
  103. package/lib/classic/es/useStreamLayerApp.js +2 -2
  104. package/lib/classic/es/useStreamLayerApp2.js +9714 -7603
  105. package/lib/classic/es/utils.js +28 -28
  106. package/lib/classic/index.d.ts +1 -0
  107. package/lib/classic/style.css +1 -0
  108. package/lib/dist/cjs/gamification-feature.js +1 -1
  109. package/lib/dist/cjs/index-eShKGO10.js +1 -5
  110. package/lib/dist/cjs/index.js +1 -1
  111. package/lib/dist/cjs/masters.js +3 -77
  112. package/lib/dist/es/gamification-feature.js +2 -2
  113. package/lib/dist/es/index-eShKGO10.js +948 -948
  114. package/lib/dist/es/index.js +7 -8
  115. package/lib/dist/es/masters.js +18197 -14750
  116. package/lib/dist/index.d.ts +12 -2
  117. package/lib/dist/style.css +1 -1
  118. package/lib/es/Question.js +108 -106
  119. package/lib/es/advertisement.js +34990 -18881
  120. package/lib/es/analytics.js +58 -56
  121. package/lib/es/auth.js +14 -8
  122. package/lib/es/bet-pack.js +29 -17
  123. package/lib/es/feature.js +93 -48
  124. package/lib/es/gamification-feature.js +2 -2
  125. package/lib/es/gamification-feature2.js +2 -2
  126. package/lib/es/hooks-WfHlJH12.js +78 -78
  127. package/lib/es/index-eShKGO10.js +948 -948
  128. package/lib/es/index.js +14 -13
  129. package/lib/es/index10.js +176 -166
  130. package/lib/es/index11.js +581 -566
  131. package/lib/es/index12.js +124 -119
  132. package/lib/es/index13.js +225 -223
  133. package/lib/es/index14.js +68 -67
  134. package/lib/es/index15.js +2903 -2159
  135. package/lib/es/index16.js +1005 -806
  136. package/lib/es/index2.js +1117 -984
  137. package/lib/es/index3.js +3 -4
  138. package/lib/es/index4.js +2424 -2407
  139. package/lib/es/index5.js +11 -11
  140. package/lib/es/index6.js +127 -127
  141. package/lib/es/index7.js +8 -3
  142. package/lib/es/index8.js +5 -5
  143. package/lib/es/index9.js +8 -7
  144. package/lib/es/insight.js +58 -53
  145. package/lib/es/masters.js +6 -5
  146. package/lib/es/masters2.js +696 -559
  147. package/lib/es/notification.js +696 -655
  148. package/lib/es/pause-ad.js +190 -167
  149. package/lib/es/points.js +56 -49
  150. package/lib/es/polymarket.js +4209 -4031
  151. package/lib/es/sl-types.js +200 -132
  152. package/lib/es/storage.js +75 -74
  153. package/lib/es/theme.js +177 -31
  154. package/lib/es/useStreamLayerApp.js +2 -2
  155. package/lib/es/useStreamLayerApp2.js +9714 -7603
  156. package/lib/es/utils.js +28 -28
  157. package/lib/index.d.ts +1 -0
  158. package/lib/style.css +1 -1
  159. package/package.json +23 -20
package/lib/es/index2.js CHANGED
@@ -1,934 +1,1062 @@
1
- var Ce = Object.defineProperty;
2
- var Ee = (e, t, n) => t in e ? Ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var k = (e, t, n) => Ee(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { useState as S, useEffect as y, useRef as x, PureComponent as Re, useCallback as j, lazy as xe, useMemo as w, Suspense as Le, forwardRef as be, useLayoutEffect as De, useContext as Y } from "react";
5
- import { i as Z, F as Te, z as Oe, Y as X } from "./hooks-WfHlJH12.js";
6
- import { jsx as i, jsxs as f, Fragment as L } from "react/jsx-runtime";
7
- import { I as _e, S as N, f as R, h as ee, Q as V } from "./useStreamLayerApp2.js";
8
- import { h as Me } from "./index8.js";
9
- import { A as T, u as v, s as u, b as Ue, c as C, a as z } from "./sl-types.js";
10
- import { l as Be, a as Fe, m as ze, d as Pe, n as Ve, C as qe, S as je, b as Ke, f as G, p as Qe, c as Ge } from "./index11.js";
11
- import { M as We, a as He, k as Je, z as ke, c as ye, T as Ne, I as Ye, t as Ze, f as Xe, w as te, D as et, p as tt } from "./index16.js";
12
- import K from "lodash.throttle";
13
- import { f as Se, a as nt, b as st, A as ot } from "./analytics.js";
14
- import { m as B } from "./theme.js";
15
- import { F as it, c as M } from "./feature.js";
16
- import "nanostores";
17
- import { p as W, h as at, e as rt } from "./Question.js";
18
- import { y as lt } from "./index10.js";
19
- import { B as D } from "./index6.js";
20
- import dt from "react-infinite-scroller";
21
- import { I as ct, s as pt, e as ut } from "./index12.js";
22
- import "uuid";
23
- import "@nanostores/query";
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { M as M$1, a as T$1, k, z as z$3, c as createSingleStore, T as T$2, I as I$4, t as tn, f as f$6, w as w$2, D as D$2, p as p$5 } from "./index16.js";
5
+ import { useState, useEffect, useRef, PureComponent, useCallback, lazy, useMemo, Suspense, forwardRef, useLayoutEffect, useContext } from "react";
6
+ import { i as i$7, F as F$2, z as z$4, Y } from "./hooks-WfHlJH12.js";
7
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
8
+ import { I as InvitationFrom, S as SdkOverlayType, f as Code, i as createContextKey, Q as QuestionType } from "./useStreamLayerApp2.js";
9
+ import { h as h$1 } from "./index8.js";
10
+ import { A as A$2, u as useStore, s as styled_default, b as useTransition, c as cx_default, a as NotificationType } from "./sl-types.js";
11
+ import { l as l$3, a as S$1, m as m$5, d as d$4, n as n$4, C as C$2, S as S$2, b as a$5, f as f$5, p as p$4, c as c$5 } from "./index11.js";
12
+ import i$6 from "lodash.throttle";
13
+ import { f as f$3, a as f$4, b as b$3, A as A$3 } from "./analytics.js";
14
+ import { m as m$6 } from "./theme.js";
15
+ import { F as FeatureStatus, c as createLogger } from "./feature.js";
16
+ import { p as p$3, h as ht, e as e$8 } from "./Question.js";
17
+ import { y as y$1 } from "./index10.js";
18
+ import { B as B1 } from "./index6.js";
19
+ import m$4 from "react-infinite-scroller";
20
+ import { I as I$3, s, e as e$7 } from "./index12.js";
24
21
  import "./storage.js";
25
22
  import "./index7.js";
26
- import { createPortal as mt } from "react-dom";
27
- import { e as ht } from "./index3.js";
23
+ import { createPortal } from "react-dom";
24
+ import { e as eventBus } from "./index3.js";
28
25
  import "./notification.js";
29
- const ne = Object.keys(T), se = () => {
30
- const e = window.innerWidth;
31
- let t = "sm";
32
- for (let n = ne.length - 1; n > 0; n--) {
33
- const o = ne[n];
34
- if (!(e < T[o]) && e >= T[o]) {
35
- t = o;
26
+ const o$5 = Object.keys(A$2), c$4 = () => {
27
+ const t2 = window.innerWidth;
28
+ let e2 = "sm";
29
+ for (let n2 = o$5.length - 1; n2 > 0; n2--) {
30
+ const s2 = o$5[n2];
31
+ if (!(t2 < A$2[s2]) && t2 >= A$2[s2]) {
32
+ e2 = s2;
36
33
  break;
37
34
  }
38
35
  }
39
36
  return {
40
- name: t,
41
- size: T[t]
37
+ name: e2,
38
+ size: A$2[e2]
42
39
  };
43
- }, oe = (e) => {
44
- var t;
45
- return (((t = e.current) == null ? void 0 : t.getBoundingClientRect().y) || 0) < -68;
46
- }, P = () => window.matchMedia("(orientation: landscape)").matches, vt = (e) => {
47
- const [t] = S(() => Se({
48
- screen: se(),
49
- sdkInView: oe(e),
50
- sdkInDesktopView: P()
40
+ }, d$3 = (t2) => {
41
+ var e2;
42
+ return (((e2 = t2.current) == null ? void 0 : e2.getBoundingClientRect().y) || 0) < -68;
43
+ }, w$1 = () => window.matchMedia("(orientation: landscape)").matches, h = (t2) => {
44
+ const [e2] = useState(() => f$3({
45
+ screen: c$4(),
46
+ sdkInView: d$3(t2),
47
+ sdkInDesktopView: w$1()
51
48
  }));
52
- return y(() => {
53
- const n = K(() => {
54
- t.setKey("sdkInView", oe(e));
55
- }, 200), o = K(() => {
56
- const s = se();
57
- t.setKey("screen", s), t.setKey("sdkInDesktopView", P());
49
+ return useEffect(() => {
50
+ const n2 = i$6(() => {
51
+ e2.setKey("sdkInView", d$3(t2));
52
+ }, 200), s2 = i$6(() => {
53
+ const k2 = c$4();
54
+ e2.setKey("screen", k2), e2.setKey("sdkInDesktopView", w$1());
58
55
  }, 200);
59
- return window.addEventListener("scroll", n), window.addEventListener("resize", o), () => {
60
- window.removeEventListener("scroll", n), window.removeEventListener("resize", o);
56
+ return window.addEventListener("scroll", n2), window.addEventListener("resize", s2), () => {
57
+ window.removeEventListener("scroll", n2), window.removeEventListener("resize", s2);
61
58
  };
62
- }, [t, e]), [t];
63
- }, H = (e, t, n) => {
64
- const o = t >= T.lg && t < T.xl ? 75 : 52;
65
- e.current && window.scrollTo({
66
- top: e.current.offsetTop - o,
67
- ...n
59
+ }, [e2, t2]), [e2];
60
+ };
61
+ const I$2 = (o2, e2, n2) => {
62
+ const t2 = e2 >= A$2.lg && e2 < A$2.xl ? 75 : 52;
63
+ o2.current && window.scrollTo({
64
+ top: o2.current.offsetTop - t2,
65
+ ...n2
68
66
  });
69
- }, ft = 15, gt = (e, t) => {
70
- const n = x(null), o = x(0), [s] = S(
71
- Se({
67
+ }, T = 15, L = (o2, e2) => {
68
+ const n2 = useRef(null), t2 = useRef(0), [s2] = useState(
69
+ f$3({
72
70
  scrollPosition: 0,
73
- tabsShown: !0,
71
+ tabsShown: true,
74
72
  scrollDirection: "forward"
75
73
  })
76
- ), r = v(t);
77
- return y(() => {
78
- const l = P() ? n.current : window;
79
- if (!l)
74
+ ), d2 = useStore(e2);
75
+ return useEffect(() => {
76
+ const c2 = w$1() ? n2.current : window;
77
+ if (!c2)
80
78
  return () => {
81
79
  };
82
- const d = K((a) => {
83
- var c;
84
- const m = a.target;
85
- if (!m)
80
+ const l2 = i$6((p2) => {
81
+ var f2;
82
+ const i2 = p2.target;
83
+ if (!i2)
86
84
  return;
87
- let p = 0;
88
- P() ? p = m.scrollTop : p = ((c = e.current) == null ? void 0 : c.getBoundingClientRect().y) || 0;
89
- const h = o.current - p;
90
- if (ft > Math.abs(h))
85
+ let r2 = 0;
86
+ w$1() ? r2 = i2.scrollTop : r2 = ((f2 = o2.current) == null ? void 0 : f2.getBoundingClientRect().y) || 0;
87
+ const w2 = t2.current - r2;
88
+ if (T > Math.abs(w2))
91
89
  return;
92
- const g = o.current < p ? "forward" : "backward";
93
- o.current = p, s.set({
94
- scrollPosition: Math.round(p),
95
- scrollDirection: g,
96
- tabsShown: s.get().tabsShown
90
+ const S2 = t2.current < r2 ? "forward" : "backward";
91
+ t2.current = r2, s2.set({
92
+ scrollPosition: Math.round(r2),
93
+ scrollDirection: S2,
94
+ tabsShown: s2.get().tabsShown
97
95
  });
98
96
  }, 200);
99
- return l.addEventListener("scroll", d), () => {
100
- l.removeEventListener("scroll", d);
97
+ return c2.addEventListener("scroll", l2), () => {
98
+ c2.removeEventListener("scroll", l2);
101
99
  };
102
- }, [s, e, r.screen]), [n, s];
103
- }, q = /* @__PURE__ */ u("div")({
100
+ }, [s2, o2, d2.screen]), [n2, s2];
101
+ };
102
+ const o$4 = /* @__PURE__ */ styled_default("div")({
104
103
  name: "LoadingContainer",
105
104
  class: "lclc0ej",
106
- propsAsIs: !1
107
- }), It = ({
108
- feature: e,
109
- sdk: t,
110
- children: n,
111
- className: o,
112
- noWait: s
105
+ propsAsIs: false
106
+ }), v$2 = ({
107
+ feature: n2,
108
+ sdk: a2,
109
+ children: s2,
110
+ className: r2,
111
+ noWait: d2
113
112
  }) => {
114
- const r = v(e.status), l = v(t.sdkStore.slStreamId);
115
- if (!s) {
116
- if (l != null && l.loading && !l.data)
117
- return /* @__PURE__ */ i(q, {
118
- className: o,
113
+ const f2 = useStore(n2.status), t2 = useStore(a2.sdkStore.slStreamId);
114
+ if (!d2) {
115
+ if (t2 != null && t2.loading && !t2.data)
116
+ return /* @__PURE__ */ jsx(o$4, {
117
+ className: r2,
119
118
  children: "Event is loading..."
120
119
  });
121
- if (!(l != null && l.data))
122
- return /* @__PURE__ */ i(q, {
123
- className: o,
120
+ if (!(t2 != null && t2.data))
121
+ return /* @__PURE__ */ jsx(o$4, {
122
+ className: r2,
124
123
  children: "Event is forbidden..."
125
124
  });
126
- if (r !== it.Ready)
127
- return /* @__PURE__ */ i(q, {
128
- className: o,
125
+ if (f2 !== FeatureStatus.Ready)
126
+ return /* @__PURE__ */ jsx(o$4, {
127
+ className: r2,
129
128
  children: "Wait feature..."
130
129
  });
131
130
  }
132
- return n;
133
- }, bt = /* @__PURE__ */ u("div")({
131
+ return s2;
132
+ };
133
+ const t$3 = /* @__PURE__ */ styled_default("div")({
134
134
  name: "Container",
135
135
  class: "c115qtkr",
136
- propsAsIs: !1
137
- }), kt = /* @__PURE__ */ u("div")({
136
+ propsAsIs: false
137
+ }), n$3 = /* @__PURE__ */ styled_default("div")({
138
138
  name: "STabs",
139
139
  class: "sxnslc8",
140
- propsAsIs: !1
141
- }), yt = /* @__PURE__ */ u("button")({
140
+ propsAsIs: false
141
+ }), o$3 = /* @__PURE__ */ styled_default("button")({
142
142
  name: "Button",
143
143
  class: "b1umzux0",
144
- propsAsIs: !1
145
- }), Nt = /* @__PURE__ */ u("span")({
144
+ propsAsIs: false
145
+ }), e$6 = /* @__PURE__ */ styled_default("span")({
146
146
  name: "Title",
147
147
  class: "tspsaas",
148
- propsAsIs: !1
148
+ propsAsIs: false
149
149
  });
150
- var _ = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(_ || {});
151
- const ie = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ i(yt, { "data-a": "intr", onClick: n, "data-selected": t, children: /* @__PURE__ */ i(Nt, { "data-a": "intr", children: e }) }), St = ({ activePage: e = "home", toggleActivePage: t }) => /* @__PURE__ */ i(bt, { children: /* @__PURE__ */ f(kt, { "data-position": e === "home" ? "left" : "right", children: [
152
- /* @__PURE__ */ i(ie, { title: "Home", active: e === "home", onClick: () => t(
150
+ var m$3 = /* @__PURE__ */ ((r2) => (r2.HOME = "home", r2.LEADERBOARD = "leaderboard", r2))(m$3 || {});
151
+ const o$2 = ({ title: r2, active: e2, onClick: n2 }) => /* @__PURE__ */ jsx(o$3, { "data-a": "intr", onClick: n2, "data-selected": e2, children: /* @__PURE__ */ jsx(e$6, { "data-a": "intr", children: r2 }) }), b$2 = ({ activePage: r2 = "home", toggleActivePage: e2 }) => /* @__PURE__ */ jsx(t$3, { children: /* @__PURE__ */ jsxs(n$3, { "data-position": r2 === "home" ? "left" : "right", children: [
152
+ /* @__PURE__ */ jsx(o$2, { title: "Home", active: r2 === "home", onClick: () => e2(
153
153
  "home"
154
154
  /* HOME */
155
155
  ) }),
156
- /* @__PURE__ */ i(
157
- ie,
156
+ /* @__PURE__ */ jsx(
157
+ o$2,
158
158
  {
159
159
  title: "Friends",
160
- active: e === "leaderboard",
161
- onClick: () => t(
160
+ active: r2 === "leaderboard",
161
+ onClick: () => e2(
162
162
  "leaderboard"
163
163
  /* LEADERBOARD */
164
164
  )
165
165
  }
166
166
  )
167
- ] }) }), $t = /* @__PURE__ */ u("div")({
167
+ ] }) });
168
+ const r$5 = /* @__PURE__ */ styled_default("div")({
168
169
  name: "Container",
169
170
  class: "c1ux29ft",
170
- propsAsIs: !1
171
- }), At = () => D, wt = /* @__PURE__ */ u(At())({
171
+ propsAsIs: false
172
+ }), o$1 = () => B1, a$4 = /* @__PURE__ */ styled_default(o$1())({
172
173
  name: "FriendsIcon",
173
174
  class: "f10ncfg2",
174
- propsAsIs: !0
175
- }), Ct = /* @__PURE__ */ u("div")({
175
+ propsAsIs: true
176
+ }), p$2 = /* @__PURE__ */ styled_default("div")({
176
177
  name: "Content",
177
178
  class: "c1yc07bd",
178
- propsAsIs: !1
179
- }), Et = /* @__PURE__ */ u("div")({
179
+ propsAsIs: false
180
+ }), i$5 = /* @__PURE__ */ styled_default("div")({
180
181
  name: "Title",
181
182
  class: "tj6cq7w",
182
- propsAsIs: !1
183
- }), Rt = /* @__PURE__ */ u("div")({
183
+ propsAsIs: false
184
+ }), l$2 = /* @__PURE__ */ styled_default("div")({
184
185
  name: "Description",
185
186
  class: "d1ag78xo",
186
- propsAsIs: !1
187
- }), xt = () => D, Lt = /* @__PURE__ */ u(xt())({
187
+ propsAsIs: false
188
+ }), e$5 = () => B1, I$1 = /* @__PURE__ */ styled_default(e$5())({
188
189
  name: "ArrowInviteIcon",
189
190
  class: "awohrz6",
190
- propsAsIs: !0
191
- }), Dt = ({ title: e, description: t, onClick: n, className: o }) => {
192
- const [s] = nt({
191
+ propsAsIs: true
192
+ });
193
+ const C$1 = ({ title: o2, description: t2, onClick: r2, className: e2 }) => {
194
+ const [c2] = f$4({
193
195
  type: "invitation",
194
196
  action: "sent",
195
197
  payload: {
196
- from: _e.TITLE_CARD
198
+ from: InvitationFrom.TITLE_CARD
197
199
  }
198
200
  });
199
- return /* @__PURE__ */ f($t, { "data-a": "intr", onClick: s(n), className: o, children: [
200
- /* @__PURE__ */ i(wt, { name: "icon-friends" }),
201
- /* @__PURE__ */ f(Ct, { children: [
202
- /* @__PURE__ */ i(Et, { children: e }),
203
- /* @__PURE__ */ i(Rt, { children: t })
201
+ return /* @__PURE__ */ jsxs(r$5, { "data-a": "intr", onClick: c2(r2), className: e2, children: [
202
+ /* @__PURE__ */ jsx(a$4, { name: "icon-friends" }),
203
+ /* @__PURE__ */ jsxs(p$2, { children: [
204
+ /* @__PURE__ */ jsx(i$5, { children: o2 }),
205
+ /* @__PURE__ */ jsx(l$2, { children: t2 })
204
206
  ] }),
205
- /* @__PURE__ */ i(Lt, { name: "icon-copy" })
207
+ /* @__PURE__ */ jsx(I$1, { name: "icon-copy" })
206
208
  ] });
207
209
  };
208
- function Tt(e) {
209
- var t = e.lastRenderedStartIndex, n = e.lastRenderedStopIndex, o = e.startIndex, s = e.stopIndex;
210
- return !(o > n || s < t);
210
+ function isRangeVisible(_ref) {
211
+ var lastRenderedStartIndex = _ref.lastRenderedStartIndex, lastRenderedStopIndex = _ref.lastRenderedStopIndex, startIndex = _ref.startIndex, stopIndex = _ref.stopIndex;
212
+ return !(startIndex > lastRenderedStopIndex || stopIndex < lastRenderedStartIndex);
211
213
  }
212
- function Ot(e) {
213
- for (var t = e.isItemLoaded, n = e.itemCount, o = e.minimumBatchSize, s = e.startIndex, r = e.stopIndex, l = [], d = null, a = null, c = s; c <= r; c++) {
214
- var m = t(c);
215
- m ? a !== null && (l.push(d, a), d = a = null) : (a = c, d === null && (d = c));
214
+ function scanForUnloadedRanges(_ref) {
215
+ var isItemLoaded = _ref.isItemLoaded, itemCount = _ref.itemCount, minimumBatchSize = _ref.minimumBatchSize, startIndex = _ref.startIndex, stopIndex = _ref.stopIndex;
216
+ var unloadedRanges = [];
217
+ var rangeStartIndex = null;
218
+ var rangeStopIndex = null;
219
+ for (var _index = startIndex; _index <= stopIndex; _index++) {
220
+ var loaded = isItemLoaded(_index);
221
+ if (!loaded) {
222
+ rangeStopIndex = _index;
223
+ if (rangeStartIndex === null) {
224
+ rangeStartIndex = _index;
225
+ }
226
+ } else if (rangeStopIndex !== null) {
227
+ unloadedRanges.push(rangeStartIndex, rangeStopIndex);
228
+ rangeStartIndex = rangeStopIndex = null;
229
+ }
216
230
  }
217
- if (a !== null) {
218
- for (var p = Math.min(Math.max(a, d + o - 1), n - 1), h = a + 1; h <= p && !t(h); h++)
219
- a = h;
220
- l.push(d, a);
231
+ if (rangeStopIndex !== null) {
232
+ var potentialStopIndex = Math.min(Math.max(rangeStopIndex, rangeStartIndex + minimumBatchSize - 1), itemCount - 1);
233
+ for (var _index2 = rangeStopIndex + 1; _index2 <= potentialStopIndex; _index2++) {
234
+ if (!isItemLoaded(_index2)) {
235
+ rangeStopIndex = _index2;
236
+ } else {
237
+ break;
238
+ }
239
+ }
240
+ unloadedRanges.push(rangeStartIndex, rangeStopIndex);
221
241
  }
222
- if (l.length)
223
- for (; l[1] - l[0] + 1 < o && l[0] > 0; ) {
224
- var g = l[0] - 1;
225
- if (!t(g))
226
- l[0] = g;
227
- else
242
+ if (unloadedRanges.length) {
243
+ while (unloadedRanges[1] - unloadedRanges[0] + 1 < minimumBatchSize && unloadedRanges[0] > 0) {
244
+ var _index3 = unloadedRanges[0] - 1;
245
+ if (!isItemLoaded(_index3)) {
246
+ unloadedRanges[0] = _index3;
247
+ } else {
228
248
  break;
249
+ }
229
250
  }
230
- return l;
251
+ }
252
+ return unloadedRanges;
231
253
  }
232
- var _t = function(e, t) {
233
- if (!(e instanceof t))
254
+ var classCallCheck = function(instance, Constructor) {
255
+ if (!(instance instanceof Constructor)) {
234
256
  throw new TypeError("Cannot call a class as a function");
235
- }, Mt = /* @__PURE__ */ function() {
236
- function e(t, n) {
237
- for (var o = 0; o < n.length; o++) {
238
- var s = n[o];
239
- s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(t, s.key, s);
257
+ }
258
+ };
259
+ var createClass = /* @__PURE__ */ function() {
260
+ function defineProperties(target, props) {
261
+ for (var i2 = 0; i2 < props.length; i2++) {
262
+ var descriptor = props[i2];
263
+ descriptor.enumerable = descriptor.enumerable || false;
264
+ descriptor.configurable = true;
265
+ if ("value" in descriptor) descriptor.writable = true;
266
+ Object.defineProperty(target, descriptor.key, descriptor);
240
267
  }
241
268
  }
242
- return function(t, n, o) {
243
- return n && e(t.prototype, n), o && e(t, o), t;
269
+ return function(Constructor, protoProps, staticProps) {
270
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
271
+ if (staticProps) defineProperties(Constructor, staticProps);
272
+ return Constructor;
244
273
  };
245
- }(), Ut = function(e, t) {
246
- if (typeof t != "function" && t !== null)
247
- throw new TypeError("Super expression must either be null or a function, not " + typeof t);
248
- e.prototype = Object.create(t && t.prototype, {
274
+ }();
275
+ var inherits = function(subClass, superClass) {
276
+ if (typeof superClass !== "function" && superClass !== null) {
277
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
278
+ }
279
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
249
280
  constructor: {
250
- value: e,
251
- enumerable: !1,
252
- writable: !0,
253
- configurable: !0
281
+ value: subClass,
282
+ enumerable: false,
283
+ writable: true,
284
+ configurable: true
254
285
  }
255
- }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
256
- }, ae = function(e, t) {
257
- if (!e)
286
+ });
287
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
288
+ };
289
+ var possibleConstructorReturn = function(self, call) {
290
+ if (!self) {
258
291
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
259
- return t && (typeof t == "object" || typeof t == "function") ? t : e;
292
+ }
293
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
260
294
  };
261
- (function(e) {
262
- Ut(t, e);
263
- function t() {
264
- var n, o, s, r;
265
- _t(this, t);
266
- for (var l = arguments.length, d = Array(l), a = 0; a < l; a++)
267
- d[a] = arguments[a];
268
- return r = (o = (s = ae(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(d))), s), s._lastRenderedStartIndex = -1, s._lastRenderedStopIndex = -1, s._memoizedUnloadedRanges = [], s._onItemsRendered = function(c) {
269
- var m = c.visibleStartIndex, p = c.visibleStopIndex;
270
- s._lastRenderedStartIndex = m, s._lastRenderedStopIndex = p, s._ensureRowsLoaded(m, p);
271
- }, s._setRef = function(c) {
272
- s._listRef = c;
273
- }, o), ae(s, r);
295
+ (function(_PureComponent) {
296
+ inherits(InfiniteLoader2, _PureComponent);
297
+ function InfiniteLoader2() {
298
+ var _ref;
299
+ var _temp, _this, _ret;
300
+ classCallCheck(this, InfiniteLoader2);
301
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
302
+ args[_key] = arguments[_key];
303
+ }
304
+ return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = InfiniteLoader2.__proto__ || Object.getPrototypeOf(InfiniteLoader2)).call.apply(_ref, [this].concat(args))), _this), _this._lastRenderedStartIndex = -1, _this._lastRenderedStopIndex = -1, _this._memoizedUnloadedRanges = [], _this._onItemsRendered = function(_ref2) {
305
+ var visibleStartIndex = _ref2.visibleStartIndex, visibleStopIndex = _ref2.visibleStopIndex;
306
+ _this._lastRenderedStartIndex = visibleStartIndex;
307
+ _this._lastRenderedStopIndex = visibleStopIndex;
308
+ _this._ensureRowsLoaded(visibleStartIndex, visibleStopIndex);
309
+ }, _this._setRef = function(listRef) {
310
+ _this._listRef = listRef;
311
+ }, _temp), possibleConstructorReturn(_this, _ret);
274
312
  }
275
- return Mt(t, [{
313
+ createClass(InfiniteLoader2, [{
276
314
  key: "resetloadMoreItemsCache",
277
- value: function() {
278
- var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
279
- this._memoizedUnloadedRanges = [], o && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
315
+ value: function resetloadMoreItemsCache() {
316
+ var autoReload = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
317
+ this._memoizedUnloadedRanges = [];
318
+ if (autoReload) {
319
+ this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
320
+ }
280
321
  }
281
322
  }, {
282
323
  key: "componentDidMount",
283
- value: function() {
324
+ value: function componentDidMount() {
284
325
  }
285
326
  }, {
286
327
  key: "render",
287
- value: function() {
288
- var o = this.props.children;
289
- return o({
328
+ value: function render() {
329
+ var children = this.props.children;
330
+ return children({
290
331
  onItemsRendered: this._onItemsRendered,
291
332
  ref: this._setRef
292
333
  });
293
334
  }
294
335
  }, {
295
336
  key: "_ensureRowsLoaded",
296
- value: function(o, s) {
297
- var r = this.props, l = r.isItemLoaded, d = r.itemCount, a = r.minimumBatchSize, c = a === void 0 ? 10 : a, m = r.threshold, p = m === void 0 ? 15 : m, h = Ot({
298
- isItemLoaded: l,
299
- itemCount: d,
300
- minimumBatchSize: c,
301
- startIndex: Math.max(0, o - p),
302
- stopIndex: Math.min(d - 1, s + p)
337
+ value: function _ensureRowsLoaded(startIndex, stopIndex) {
338
+ var _props = this.props, isItemLoaded = _props.isItemLoaded, itemCount = _props.itemCount, _props$minimumBatchSi = _props.minimumBatchSize, minimumBatchSize = _props$minimumBatchSi === void 0 ? 10 : _props$minimumBatchSi, _props$threshold = _props.threshold, threshold = _props$threshold === void 0 ? 15 : _props$threshold;
339
+ var unloadedRanges = scanForUnloadedRanges({
340
+ isItemLoaded,
341
+ itemCount,
342
+ minimumBatchSize,
343
+ startIndex: Math.max(0, startIndex - threshold),
344
+ stopIndex: Math.min(itemCount - 1, stopIndex + threshold)
303
345
  });
304
- (this._memoizedUnloadedRanges.length !== h.length || this._memoizedUnloadedRanges.some(function(g, b) {
305
- return h[b] !== g;
306
- })) && (this._memoizedUnloadedRanges = h, this._loadUnloadedRanges(h));
346
+ if (this._memoizedUnloadedRanges.length !== unloadedRanges.length || this._memoizedUnloadedRanges.some(function(startOrStop, index) {
347
+ return unloadedRanges[index] !== startOrStop;
348
+ })) {
349
+ this._memoizedUnloadedRanges = unloadedRanges;
350
+ this._loadUnloadedRanges(unloadedRanges);
351
+ }
307
352
  }
308
353
  }, {
309
354
  key: "_loadUnloadedRanges",
310
- value: function(o) {
311
- for (var s = this, r = this.props.loadMoreItems || this.props.loadMoreRows, l = function(c) {
312
- var m = o[c], p = o[c + 1], h = r(m, p);
313
- h != null && h.then(function() {
314
- if (Tt({
315
- lastRenderedStartIndex: s._lastRenderedStartIndex,
316
- lastRenderedStopIndex: s._lastRenderedStopIndex,
317
- startIndex: m,
318
- stopIndex: p
319
- })) {
320
- if (s._listRef == null)
321
- return;
322
- typeof s._listRef.resetAfterIndex == "function" ? s._listRef.resetAfterIndex(m, !0) : (typeof s._listRef._getItemStyleCache == "function" && s._listRef._getItemStyleCache(-1), s._listRef.forceUpdate());
323
- }
324
- });
325
- }, d = 0; d < o.length; d += 2)
326
- l(d);
355
+ value: function _loadUnloadedRanges(unloadedRanges) {
356
+ var _this2 = this;
357
+ var loadMoreItems = this.props.loadMoreItems || this.props.loadMoreRows;
358
+ var _loop = function _loop2(i22) {
359
+ var startIndex = unloadedRanges[i22];
360
+ var stopIndex = unloadedRanges[i22 + 1];
361
+ var promise = loadMoreItems(startIndex, stopIndex);
362
+ if (promise != null) {
363
+ promise.then(function() {
364
+ if (isRangeVisible({
365
+ lastRenderedStartIndex: _this2._lastRenderedStartIndex,
366
+ lastRenderedStopIndex: _this2._lastRenderedStopIndex,
367
+ startIndex,
368
+ stopIndex
369
+ })) {
370
+ if (_this2._listRef == null) {
371
+ return;
372
+ }
373
+ if (typeof _this2._listRef.resetAfterIndex === "function") {
374
+ _this2._listRef.resetAfterIndex(startIndex, true);
375
+ } else {
376
+ if (typeof _this2._listRef._getItemStyleCache === "function") {
377
+ _this2._listRef._getItemStyleCache(-1);
378
+ }
379
+ _this2._listRef.forceUpdate();
380
+ }
381
+ }
382
+ });
383
+ }
384
+ };
385
+ for (var i2 = 0; i2 < unloadedRanges.length; i2 += 2) {
386
+ _loop(i2);
387
+ }
327
388
  }
328
- }]), t;
329
- })(Re);
330
- const Bt = /* @__PURE__ */ u("div")({
389
+ }]);
390
+ return InfiniteLoader2;
391
+ })(PureComponent);
392
+ const r$4 = /* @__PURE__ */ styled_default("div")({
331
393
  name: "Container",
332
394
  class: "culdu4a",
333
- propsAsIs: !1
334
- }), Ft = /* @__PURE__ */ u("div")({
395
+ propsAsIs: false
396
+ }), t$2 = /* @__PURE__ */ styled_default("div")({
335
397
  name: "Position",
336
398
  class: "pwf8e69",
337
- propsAsIs: !1
338
- }), zt = /* @__PURE__ */ u("img")({
399
+ propsAsIs: false
400
+ }), c$3 = /* @__PURE__ */ styled_default("img")({
339
401
  name: "Avatar",
340
402
  class: "atf4yh4",
341
- propsAsIs: !1
342
- }), Pt = /* @__PURE__ */ u("div")({
403
+ propsAsIs: false
404
+ }), p$1 = /* @__PURE__ */ styled_default("div")({
343
405
  name: "AvatarPlaceholder",
344
406
  class: "a1dg29ja",
345
- propsAsIs: !1
346
- }), Vt = /* @__PURE__ */ u("div")({
407
+ propsAsIs: false
408
+ }), l$1 = /* @__PURE__ */ styled_default("div")({
347
409
  name: "Content",
348
410
  class: "c10a68rc",
349
- propsAsIs: !1
350
- }), qt = /* @__PURE__ */ u("div")({
411
+ propsAsIs: false
412
+ }), m$2 = /* @__PURE__ */ styled_default("div")({
351
413
  name: "NameContainer",
352
414
  class: "nc4kck5",
353
- propsAsIs: !1
354
- }), jt = /* @__PURE__ */ u("span")({
415
+ propsAsIs: false
416
+ }), i$4 = /* @__PURE__ */ styled_default("span")({
355
417
  name: "Name",
356
418
  class: "njsrqgr",
357
- propsAsIs: !1
358
- }), Kt = () => D, Qt = /* @__PURE__ */ u(Kt())({
419
+ propsAsIs: false
420
+ }), e$4 = () => B1, d$2 = /* @__PURE__ */ styled_default(e$4())({
359
421
  name: "CurrentUserBadge",
360
422
  class: "c17uc4zr",
361
- propsAsIs: !0
362
- }), Gt = ({
363
- friendsRank: e,
364
- avatar: t,
365
- name: n,
366
- userId: o,
367
- points: s,
368
- isCurrentUser: r,
369
- style: l
370
- }) => /* @__PURE__ */ f(Bt, { "data-name": o, style: l, children: [
371
- /* @__PURE__ */ i(Ft, { children: e || 0 }),
372
- /* @__PURE__ */ f(Vt, { children: [
373
- t ? /* @__PURE__ */ i(zt, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ i(Pt, { children: ct(n || "") }),
374
- /* @__PURE__ */ f(qt, { children: [
375
- /* @__PURE__ */ i(jt, { children: n || "" }),
376
- r && /* @__PURE__ */ i(Qt, { name: "icon-star" })
423
+ propsAsIs: true
424
+ });
425
+ const N$1 = ({
426
+ friendsRank: i2,
427
+ avatar: a2,
428
+ name: t2,
429
+ userId: n2,
430
+ points: o2,
431
+ isCurrentUser: d2,
432
+ style: m2
433
+ }) => /* @__PURE__ */ jsxs(r$4, { "data-name": n2, style: m2, children: [
434
+ /* @__PURE__ */ jsx(t$2, { children: i2 || 0 }),
435
+ /* @__PURE__ */ jsxs(l$1, { children: [
436
+ a2 ? /* @__PURE__ */ jsx(c$3, { alt: "leaderboard-item-avatar", src: a2 }) : /* @__PURE__ */ jsx(p$1, { children: I$3(t2 || "") }),
437
+ /* @__PURE__ */ jsxs(m$2, { children: [
438
+ /* @__PURE__ */ jsx(i$4, { children: t2 || "" }),
439
+ d2 && /* @__PURE__ */ jsx(d$2, { name: "icon-star" })
377
440
  ] })
378
441
  ] }),
379
- /* @__PURE__ */ i("div", { children: pt(s) })
380
- ] }), Wt = /* @__PURE__ */ u("div")({
442
+ /* @__PURE__ */ jsx("div", { children: s(o2) })
443
+ ] });
444
+ const u$1 = /* @__PURE__ */ styled_default("div")({
381
445
  name: "Container",
382
446
  class: "c16btbfp",
383
- propsAsIs: !1
384
- }), Ht = ({
385
- items: e,
386
- currentUserId: t,
387
- openItemDetail: n,
388
- fetchMore: o,
389
- scrollNode: s,
390
- hasMore: r
447
+ propsAsIs: false
448
+ }), S = ({
449
+ items: s2,
450
+ currentUserId: e2,
451
+ openItemDetail: o2,
452
+ fetchMore: n2,
453
+ scrollNode: i2,
454
+ hasMore: d2
391
455
  }) => {
392
- const l = j((d) => {
393
- const a = d.target.getAttribute("data-name");
394
- a && n(a);
395
- }, [n]);
396
- return /* @__PURE__ */ i(dt, {
397
- loadMore: o,
398
- initialLoad: !1,
399
- hasMore: r,
400
- useWindow: !1,
401
- getScrollParent: () => s.current,
402
- children: /* @__PURE__ */ i(Wt, {
456
+ const l2 = useCallback((r2) => {
457
+ const a2 = r2.target.getAttribute("data-name");
458
+ a2 && o2(a2);
459
+ }, [o2]);
460
+ return /* @__PURE__ */ jsx(m$4, {
461
+ loadMore: n2,
462
+ initialLoad: false,
463
+ hasMore: d2,
464
+ useWindow: false,
465
+ getScrollParent: () => i2.current,
466
+ children: /* @__PURE__ */ jsx(u$1, {
403
467
  "data-a": "intr",
404
- onClick: l,
405
- children: e.map((d) => /* @__PURE__ */ i(Gt, {
406
- ...d,
407
- isCurrentUser: !!t && t === d.userId
408
- }, d.userId))
468
+ onClick: l2,
469
+ children: s2.map((r2) => /* @__PURE__ */ jsx(N$1, {
470
+ ...r2,
471
+ isCurrentUser: !!e2 && e2 === r2.userId
472
+ }, r2.userId))
409
473
  })
410
474
  });
411
- }, Jt = /* @__PURE__ */ u("div")({
475
+ };
476
+ const r$3 = /* @__PURE__ */ styled_default("div")({
412
477
  name: "InviteFriendsContainer",
413
478
  class: "i1c9dygq",
414
- propsAsIs: !1
415
- }), Yt = ({
416
- deepLink: e
417
- }) => /* @__PURE__ */ i(Jt, {
418
- children: /* @__PURE__ */ i(We, {
419
- inviteLink: e,
479
+ propsAsIs: false
480
+ }), a$3 = ({
481
+ deepLink: i2
482
+ }) => /* @__PURE__ */ jsx(r$3, {
483
+ children: /* @__PURE__ */ jsx(M$1, {
484
+ inviteLink: i2,
420
485
  inviteCardTitle: "It’s More Fun With Friends",
421
486
  inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
422
487
  })
423
- }), Zt = /* @__PURE__ */ u("div")({
488
+ });
489
+ const v$1 = /* @__PURE__ */ styled_default("div")({
424
490
  name: "InviteLinkContainer",
425
491
  class: "i1odbhm4",
426
- propsAsIs: !1
427
- }), Xt = ({
428
- gamification: e,
429
- scrollNode: t,
430
- scrollStore: n,
431
- leaderboardList: o
492
+ propsAsIs: false
493
+ }), x$3 = ({
494
+ gamification: r2,
495
+ scrollNode: t2,
496
+ scrollStore: o2,
497
+ leaderboardList: i2
432
498
  }) => {
433
- const s = x(null), {
434
- data: r,
435
- hasMore: l,
436
- loading: d,
437
- key: a
438
- } = v(o.$store), {
439
- data: c
440
- } = v(e.deepLink.$store), [m, p] = He(s);
441
- return !r.length && !d ? /* @__PURE__ */ i(Yt, {
442
- deepLink: c
443
- }) : /* @__PURE__ */ f(L, {
444
- children: [/* @__PURE__ */ i(Ht, {
445
- items: r,
446
- scrollNode: t,
447
- scrollStore: n,
448
- fetchMore: o.fetchMore,
449
- hasMore: l,
450
- openItemDetail: e.openUser,
451
- currentUserId: e.currentUserId.get()
452
- }, a), c && /* @__PURE__ */ i(Zt, {
453
- ref: s,
454
- children: /* @__PURE__ */ i(Dt, {
499
+ const s2 = useRef(null), {
500
+ data: d2,
501
+ hasMore: m2,
502
+ loading: a2,
503
+ key: l2
504
+ } = useStore(i2.$store), {
505
+ data: n2
506
+ } = useStore(r2.deepLink.$store), [c2, f2] = T$1(s2);
507
+ return !d2.length && !a2 ? /* @__PURE__ */ jsx(a$3, {
508
+ deepLink: n2
509
+ }) : /* @__PURE__ */ jsxs(Fragment, {
510
+ children: [/* @__PURE__ */ jsx(S, {
511
+ items: d2,
512
+ scrollNode: t2,
513
+ scrollStore: o2,
514
+ fetchMore: i2.fetchMore,
515
+ hasMore: m2,
516
+ openItemDetail: r2.openUser,
517
+ currentUserId: r2.currentUserId.get()
518
+ }, l2), n2 && /* @__PURE__ */ jsx(v$1, {
519
+ ref: s2,
520
+ children: /* @__PURE__ */ jsx(C$1, {
455
521
  "data-a": "intr",
456
- onClick: () => m(c),
522
+ onClick: () => c2(n2),
457
523
  title: "Invite Friends",
458
524
  description: "Challenge them now!"
459
525
  })
460
- }), p]
526
+ }), f2]
461
527
  });
462
- }, en = ({
463
- gamification: e,
464
- scrollNode: t,
465
- scrollStore: n
466
- }) => e.leaderboardList ? /* @__PURE__ */ i(Xt, {
467
- leaderboardList: e.leaderboardList,
468
- gamification: e,
469
- scrollNode: t,
470
- scrollStore: n
471
- }) : null, tn = ({ store: e, openQuestion: t }) => {
472
- const { sdk: n } = W(), o = v(e);
473
- return /* @__PURE__ */ i(Je, { openQuestion: t, questions: o.data, controlVideo: n == null ? void 0 : n.controlVideoPlayer });
474
- }, nn = ({ userSummary: e }) => {
475
- var t;
476
- const [n, o] = S(void 0);
477
- return y(() => {
478
- const s = e.$store.subscribe((r) => {
479
- r && o(r);
528
+ }, E = ({
529
+ gamification: r2,
530
+ scrollNode: t2,
531
+ scrollStore: o2
532
+ }) => r2.leaderboardList ? /* @__PURE__ */ jsx(x$3, {
533
+ leaderboardList: r2.leaderboardList,
534
+ gamification: r2,
535
+ scrollNode: t2,
536
+ scrollStore: o2
537
+ }) : null;
538
+ const a$2 = ({ store: t2, openQuestion: r2 }) => {
539
+ const { sdk: o2 } = p$3(), e2 = useStore(t2);
540
+ return /* @__PURE__ */ jsx(k, { openQuestion: r2, questions: e2.data, controlVideo: o2 == null ? void 0 : o2.controlVideoPlayer });
541
+ };
542
+ const b$1 = ({ userSummary: r2 }) => {
543
+ var e2;
544
+ const [t2, s2] = useState(void 0);
545
+ return useEffect(() => {
546
+ const c2 = r2.$store.subscribe((o2) => {
547
+ o2 && s2(o2);
480
548
  });
481
549
  return () => {
482
- s();
550
+ c2();
483
551
  };
484
- }, [e]), /* @__PURE__ */ i(ke, { loading: !(n != null && n.summary), ...n == null ? void 0 : n.summary, successRate: (t = n == null ? void 0 : n.percentage) == null ? void 0 : t.correct });
485
- }, sn = ({ gamification: e, className: t, scrollStore: n, scrollNode: o, appNode: s, style: r, responsiveStore: l }) => {
486
- const { tabsShown: d } = v(n, { keys: ["tabsShown"] }), a = v(e.friendsTabEnabled), [c, m] = S(_.HOME), [, p] = Ue(), { sdkInDesktopView: h, screen: g } = v(l, { keys: ["sdkInDesktopView"] }), b = (I) => {
487
- p(() => {
488
- var U;
489
- m(I), h === !1 && (((U = s.current) == null ? void 0 : U.getBoundingClientRect().y) || 0) < 0 && H(s, g.size, { behavior: "instant" });
552
+ }, [r2]), /* @__PURE__ */ jsx(z$3, { loading: !(t2 != null && t2.summary), ...t2 == null ? void 0 : t2.summary, successRate: (e2 = t2 == null ? void 0 : t2.percentage) == null ? void 0 : e2.correct });
553
+ };
554
+ const W = ({ gamification: s2, className: w2, scrollStore: t2, scrollNode: y2, appNode: c2, style: k2, responsiveStore: i2 }) => {
555
+ const { tabsShown: u2 } = useStore(t2, { keys: ["tabsShown"] }), o2 = useStore(s2.friendsTabEnabled), [a2, h2] = useState(m$3.HOME), [, T2] = useTransition(), { sdkInDesktopView: l2, screen: g2 } = useStore(i2, { keys: ["sdkInDesktopView"] }), x2 = (r2) => {
556
+ T2(() => {
557
+ var b2;
558
+ h2(r2), l2 === false && (((b2 = c2.current) == null ? void 0 : b2.getBoundingClientRect().y) || 0) < 0 && I$2(c2, g2.size, { behavior: "instant" });
490
559
  });
491
560
  };
492
- y(() => n.subscribe((I) => {
493
- if (I.scrollPosition === 0) {
494
- n.setKey("tabsShown", !0);
561
+ useEffect(() => t2.subscribe((r2) => {
562
+ if (r2.scrollPosition === 0) {
563
+ t2.setKey("tabsShown", true);
495
564
  return;
496
565
  }
497
- l.get().sdkInDesktopView ? n.setKey("tabsShown", I.scrollDirection === "backward") : n.setKey("tabsShown", I.scrollDirection === "forward");
498
- }), [n, l]), y(() => {
499
- a || m(_.HOME);
500
- }, [a]);
501
- let $ = "0px";
502
- return h ? $ = d ? "0px" : "calc(0px - var(--header-height))" : $ = d ? "var(--header-height)" : "0px", /* @__PURE__ */ f(Be, { className: C(t, "SL-Tabs", "sl-hide-on-modal"), style: r, children: [
503
- a && /* @__PURE__ */ i(
504
- Fe,
566
+ i2.get().sdkInDesktopView ? t2.setKey("tabsShown", r2.scrollDirection === "backward") : t2.setKey("tabsShown", r2.scrollDirection === "forward");
567
+ }), [t2, i2]), useEffect(() => {
568
+ o2 || h2(m$3.HOME);
569
+ }, [o2]);
570
+ let m2 = "0px";
571
+ return l2 ? m2 = u2 ? "0px" : "calc(0px - var(--header-height))" : m2 = u2 ? "var(--header-height)" : "0px", /* @__PURE__ */ jsxs(l$3, { className: cx_default(w2, "SL-Tabs", "sl-hide-on-modal"), style: k2, children: [
572
+ o2 && /* @__PURE__ */ jsx(
573
+ S$1,
505
574
  {
506
575
  style: {
507
- top: $
576
+ top: m2
508
577
  },
509
- children: /* @__PURE__ */ i(St, { activePage: c, toggleActivePage: b })
578
+ children: /* @__PURE__ */ jsx(b$2, { activePage: a2, toggleActivePage: x2 })
510
579
  }
511
580
  ),
512
- c === _.HOME && /* @__PURE__ */ f(L, { children: [
513
- /* @__PURE__ */ i(ze, { children: /* @__PURE__ */ i(Pe, { children: /* @__PURE__ */ i(nn, { userSummary: e.userSummary }) }) }),
514
- /* @__PURE__ */ i(Ve, { style: { flex: 1 }, children: /* @__PURE__ */ i(tn, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
581
+ a2 === m$3.HOME && /* @__PURE__ */ jsxs(Fragment, { children: [
582
+ /* @__PURE__ */ jsx(m$5, { children: /* @__PURE__ */ jsx(d$4, { children: /* @__PURE__ */ jsx(b$1, { userSummary: s2.userSummary }) }) }),
583
+ /* @__PURE__ */ jsx(n$4, { style: { flex: 1 }, children: /* @__PURE__ */ jsx(a$2, { openQuestion: s2.openQuestion, store: s2.feedList.getStore() }) })
515
584
  ] }),
516
- c === _.LEADERBOARD && /* @__PURE__ */ i(qe, { children: /* @__PURE__ */ i(en, { scrollStore: n, scrollNode: o, gamification: e }) })
585
+ a2 === m$3.LEADERBOARD && /* @__PURE__ */ jsx(C$2, { children: /* @__PURE__ */ jsx(E, { scrollStore: t2, scrollNode: y2, gamification: s2 }) })
517
586
  ] });
518
- }, on = () => G, re = /* @__PURE__ */ u(on())({
587
+ };
588
+ const R = () => f$5, u = /* @__PURE__ */ styled_default(R())({
519
589
  name: "OpenedContainer",
520
590
  class: "ouvguos",
521
- propsAsIs: !0
522
- }), le = "t1eu4lbg", an = /* @__PURE__ */ u("div")({
591
+ propsAsIs: true
592
+ }), f$2 = "t1eu4lbg", V = /* @__PURE__ */ styled_default("div")({
523
593
  name: "UserContainer",
524
594
  class: "uuv2xqo",
525
- propsAsIs: !1
526
- }), rn = ({
527
- correct: e,
528
- incorrect: t
595
+ propsAsIs: false
596
+ }), j$1 = ({
597
+ correct: e2,
598
+ incorrect: t2
529
599
  }) => {
530
- const n = e + t;
531
- return n === 0 ? 0 : Math.round(e / n * 100);
532
- }, Ps = ({
533
- gamification: e,
534
- scrollStore: t,
535
- className: n,
536
- appNode: o,
537
- scrollNode: s,
538
- responsiveStore: r
539
- }) => /* @__PURE__ */ i(sn, {
540
- appNode: o,
541
- scrollStore: t,
542
- scrollNode: s,
543
- className: n,
544
- gamification: e,
545
- responsiveStore: r
546
- }), ln = ({
547
- gamification: e,
548
- muted: t,
549
- sdk: n,
550
- className: o,
551
- appNode: s,
552
- responsiveStore: r
600
+ const n2 = e2 + t2;
601
+ return n2 === 0 ? 0 : Math.round(e2 / n2 * 100);
602
+ }, B$2 = ({
603
+ gamification: e2,
604
+ scrollStore: t2,
605
+ className: n2,
606
+ appNode: r2,
607
+ scrollNode: p2,
608
+ responsiveStore: a2
609
+ }) => /* @__PURE__ */ jsx(W, {
610
+ appNode: r2,
611
+ scrollStore: t2,
612
+ scrollNode: p2,
613
+ className: n2,
614
+ gamification: e2,
615
+ responsiveStore: a2
616
+ }), J$2 = ({
617
+ gamification: e2,
618
+ muted: t2,
619
+ sdk: n2,
620
+ className: r2,
621
+ appNode: p2,
622
+ responsiveStore: a2
553
623
  }) => {
554
624
  const {
555
- topNavigation: l
556
- } = W(), d = v(e.openedQuestionId), a = v(e.openedQuestion.$store), c = v(e.openedUser || ye(void 0)), {
557
- sdkInDesktopView: m
558
- } = v(r, {
625
+ topNavigation: c2
626
+ } = p$3(), C2 = useStore(e2.openedQuestionId), S2 = useStore(e2.openedQuestion.$store), s2 = useStore(e2.openedUser || createSingleStore(void 0)), {
627
+ sdkInDesktopView: v2
628
+ } = useStore(a2, {
559
629
  keys: ["sdkInDesktopView"]
560
630
  }), {
561
- hiding: p,
562
- onAnimationEnd: h
563
- } = je();
564
- if (!d && !c)
631
+ hiding: m2,
632
+ onAnimationEnd: d2
633
+ } = S$2();
634
+ if (!C2 && !s2)
565
635
  return null;
566
- const g = a ? /* @__PURE__ */ i(re, {
567
- className: C(o, !l && le),
568
- hiding: p,
569
- onAnimationEnd: h,
570
- children: /* @__PURE__ */ i(at, {
571
- muted: t,
572
- sdk: n,
573
- gamification: e
636
+ const x2 = S2 ? /* @__PURE__ */ jsx(u, {
637
+ className: cx_default(r2, !c2 && f$2),
638
+ hiding: m2,
639
+ onAnimationEnd: d2,
640
+ children: /* @__PURE__ */ jsx(ht, {
641
+ muted: t2,
642
+ sdk: n2,
643
+ gamification: e2
574
644
  })
575
- }) : c ? /* @__PURE__ */ i(re, {
576
- className: C(o, !l && le),
577
- hiding: p,
578
- onAnimationEnd: h,
579
- children: /* @__PURE__ */ f(an, {
580
- children: [/* @__PURE__ */ i(lt, {
645
+ }) : s2 ? /* @__PURE__ */ jsx(u, {
646
+ className: cx_default(r2, !c2 && f$2),
647
+ hiding: m2,
648
+ onAnimationEnd: d2,
649
+ children: /* @__PURE__ */ jsxs(V, {
650
+ children: [/* @__PURE__ */ jsx(y$1, {
581
651
  label: "Friend's Rank",
582
- close: e.closeUser
583
- }), /* @__PURE__ */ i(Ke, {
584
- children: /* @__PURE__ */ i(ke, {
585
- ...c,
586
- successRate: rn(c)
652
+ close: e2.closeUser
653
+ }), /* @__PURE__ */ jsx(a$5, {
654
+ children: /* @__PURE__ */ jsx(z$3, {
655
+ ...s2,
656
+ successRate: j$1(s2)
587
657
  })
588
658
  })]
589
659
  })
590
660
  }) : null;
591
- return /* @__PURE__ */ i(Ne, {
592
- container: s,
593
- useContainer: !m,
594
- children: g
661
+ return /* @__PURE__ */ jsx(T$2, {
662
+ container: p2,
663
+ useContainer: !v2,
664
+ children: x2
595
665
  });
596
- }, dn = xe(() => import("./gamification-feature.js")), cn = ({ sdk: e, feature: t, className: n, scrollStore: o, appNode: s, scrollNode: r, responsiveStore: l }) => {
597
- const d = w(() => t && t.featureConfig.get().type === N.GAMES ? /* @__PURE__ */ i(It, { className: n, sdk: e, feature: t, children: /* @__PURE__ */ i(
598
- dn,
666
+ };
667
+ const d$1 = lazy(() => import("./gamification-feature.js")), x$2 = ({ sdk: i2, feature: t2, className: n2, scrollStore: e2, appNode: o2, scrollNode: a2, responsiveStore: l2 }) => {
668
+ const u2 = useMemo(() => t2 && t2.featureConfig.get().type === SdkOverlayType.GAMES ? /* @__PURE__ */ jsx(v$2, { className: n2, sdk: i2, feature: t2, children: /* @__PURE__ */ jsx(
669
+ d$1,
599
670
  {
600
- appNode: s,
601
- scrollStore: o,
602
- scrollNode: r,
603
- className: n,
604
- responsiveStore: l,
605
- gamification: t
671
+ appNode: o2,
672
+ scrollStore: e2,
673
+ scrollNode: a2,
674
+ className: n2,
675
+ responsiveStore: l2,
676
+ gamification: t2
606
677
  }
607
- ) }) : null, [e, t, n, l, o, r, s]);
608
- return /* @__PURE__ */ i(
609
- Le,
678
+ ) }) : null, [i2, t2, n2, l2, e2, a2, o2]);
679
+ return /* @__PURE__ */ jsx(
680
+ Suspense,
610
681
  {
611
- fallback: /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
612
- children: d
682
+ fallback: /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
683
+ children: u2
613
684
  }
614
685
  );
615
- }, pn = ({ feature: e, sdk: t, muted: n, className: o, appNode: s, responsiveStore: r }) => e && e.featureConfig.get().type === N.GAMES ? /* @__PURE__ */ i(
616
- ln,
686
+ }, A$1 = ({ feature: i2, sdk: t2, muted: n2, className: e2, appNode: o2, responsiveStore: a2 }) => i2 && i2.featureConfig.get().type === SdkOverlayType.GAMES ? /* @__PURE__ */ jsx(
687
+ J$2,
617
688
  {
618
- className: o,
619
- appNode: s,
620
- muted: n,
621
- sdk: t,
622
- responsiveStore: r,
623
- gamification: e
689
+ className: e2,
690
+ appNode: o2,
691
+ muted: n2,
692
+ sdk: t2,
693
+ responsiveStore: a2,
694
+ gamification: i2
624
695
  }
625
696
  ) : null;
626
697
  window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
627
- function un(e) {
628
- return e instanceof DOMException && // everything except Firefox
629
- (e.code === 22 || // Firefox
630
- e.code === 1014 || // test name field too, because code might not be present
698
+ function isQuotaExceededError(err) {
699
+ return err instanceof DOMException && // everything except Firefox
700
+ (err.code === 22 || // Firefox
701
+ err.code === 1014 || // test name field too, because code might not be present
631
702
  // everything except Firefox
632
- e.name === "QuotaExceededError" || // Firefox
633
- e.name === "NS_ERROR_DOM_QUOTA_REACHED");
703
+ err.name === "QuotaExceededError" || // Firefox
704
+ err.name === "NS_ERROR_DOM_QUOTA_REACHED");
634
705
  }
635
- class mn {
636
- constructor(t = "main", n = window.localStorage) {
637
- k(this, "delimiter", ":");
638
- k(this, "prefix");
639
- k(this, "storage");
640
- k(this, "clear", () => {
641
- for (const t in window.localStorage)
642
- t.startsWith(this.prefix) && this.storage.removeItem(t);
706
+ class Storage {
707
+ constructor(prefix = "main", storage = window.localStorage) {
708
+ __publicField(this, "delimiter", ":");
709
+ __publicField(this, "prefix");
710
+ __publicField(this, "storage");
711
+ __publicField(this, "clear", () => {
712
+ for (const key in window.localStorage) {
713
+ if (key.startsWith(this.prefix)) {
714
+ this.storage.removeItem(key);
715
+ }
716
+ }
643
717
  });
644
- k(this, "generateKey", (t) => `${this.prefix}${this.delimiter}${t.join(this.delimiter)}`);
645
- k(this, "write", (...t) => {
646
- const n = t.pop() || "", o = this.generateKey(t);
718
+ __publicField(this, "generateKey", (keyParts) => `${this.prefix}${this.delimiter}${keyParts.join(this.delimiter)}`);
719
+ __publicField(this, "write", (...keyParts) => {
720
+ const value = keyParts.pop() || "";
721
+ const key = this.generateKey(keyParts);
647
722
  try {
648
- this.storage.setItem(o, n);
649
- } catch (s) {
650
- un(s) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(o, n));
723
+ this.storage.setItem(key, value);
724
+ } catch (err) {
725
+ if (isQuotaExceededError(err) && this.storage === window.sessionStorage) {
726
+ window.sessionStorage.removeItem("slstreamlogs");
727
+ this.storage.setItem(key, value);
728
+ }
651
729
  }
652
730
  });
653
- k(this, "read", (...t) => {
654
- const n = this.storage.getItem(this.generateKey(t));
655
- return n === null ? void 0 : n;
731
+ __publicField(this, "read", (...keyParts) => {
732
+ const value = this.storage.getItem(this.generateKey(keyParts));
733
+ return value === null ? void 0 : value;
656
734
  });
657
- k(this, "remove", (...t) => {
658
- this.storage.removeItem(this.generateKey(t));
735
+ __publicField(this, "remove", (...keyParts) => {
736
+ this.storage.removeItem(this.generateKey(keyParts));
659
737
  });
660
- this.prefix = `sl-sdk${this.delimiter}${t}`, this.storage = n;
738
+ this.prefix = `sl-sdk${this.delimiter}${prefix}`;
739
+ this.storage = storage;
661
740
  }
662
741
  }
663
- var de;
664
- (function(e) {
665
- e.Init = "init", e.Ready = "ready", e.Connecting = "connecting", e.Connected = "connected", e.Disconnected = "disconnected", e.Failed = "failed", e.Reconnect = "reconnect", e.Reconnecting = "reconnecting";
666
- })(de || (de = {}));
667
- M("grpc:stream");
668
- R.Unknown, R.Internal, R.DeadlineExceeded, R.ResourceExhausted, R.FailedPrecondition, R.Unavailable, R.DataLoss;
669
- M("grpc:retry");
670
- ee(10, { description: "Number of attempts to retry" }), ee(3e4, { description: "Max delay between retries in milliseconds" });
671
- var A;
672
- (function(e) {
673
- e.SCHEMA = "schema", e.EXTERNAL_TOKEN = "eToken", e.TOKEN = "token";
674
- })(A || (A = {}));
675
- class hn extends mn {
742
+ var ServerStreamSubscriptionStatus;
743
+ (function(ServerStreamSubscriptionStatus2) {
744
+ ServerStreamSubscriptionStatus2["Init"] = "init";
745
+ ServerStreamSubscriptionStatus2["Ready"] = "ready";
746
+ ServerStreamSubscriptionStatus2["Connecting"] = "connecting";
747
+ ServerStreamSubscriptionStatus2["Connected"] = "connected";
748
+ ServerStreamSubscriptionStatus2["Disconnected"] = "disconnected";
749
+ ServerStreamSubscriptionStatus2["Failed"] = "failed";
750
+ ServerStreamSubscriptionStatus2["Reconnect"] = "reconnect";
751
+ ServerStreamSubscriptionStatus2["Reconnecting"] = "reconnecting";
752
+ })(ServerStreamSubscriptionStatus || (ServerStreamSubscriptionStatus = {}));
753
+ createLogger("grpc:stream");
754
+ /* @__PURE__ */ new Set([
755
+ Code.Unknown,
756
+ Code.Internal,
757
+ Code.DeadlineExceeded,
758
+ Code.ResourceExhausted,
759
+ Code.FailedPrecondition,
760
+ Code.Unavailable,
761
+ Code.DataLoss
762
+ ]);
763
+ createLogger("grpc:retry");
764
+ ({
765
+ retryAttempts: createContextKey(10, { description: "Number of attempts to retry" }),
766
+ retryDelay: createContextKey(3e4, { description: "Max delay between retries in milliseconds" })
767
+ });
768
+ var KEY_PREFIX$2;
769
+ (function(KEY_PREFIX2) {
770
+ KEY_PREFIX2["SCHEMA"] = "schema";
771
+ KEY_PREFIX2["EXTERNAL_TOKEN"] = "eToken";
772
+ KEY_PREFIX2["TOKEN"] = "token";
773
+ })(KEY_PREFIX$2 || (KEY_PREFIX$2 = {}));
774
+ class UserStorage extends Storage {
676
775
  constructor() {
677
776
  super("user");
678
777
  // Schema
679
- k(this, "setSchema", (n) => {
680
- this.write(A.SCHEMA, n);
778
+ __publicField(this, "setSchema", (value) => {
779
+ this.write(KEY_PREFIX$2.SCHEMA, value);
780
+ });
781
+ __publicField(this, "getSchema", () => {
782
+ return this.read(KEY_PREFIX$2.SCHEMA);
681
783
  });
682
- k(this, "getSchema", () => this.read(A.SCHEMA));
683
784
  // Token
684
- k(this, "setToken", (n) => {
685
- this.write(A.TOKEN, n);
785
+ __publicField(this, "setToken", (value) => {
786
+ this.write(KEY_PREFIX$2.TOKEN, value);
787
+ });
788
+ __publicField(this, "getToken", () => {
789
+ return this.read(KEY_PREFIX$2.TOKEN);
686
790
  });
687
- k(this, "getToken", () => this.read(A.TOKEN));
688
791
  // External Token
689
- k(this, "setExternalToken", (n) => {
690
- this.write(A.EXTERNAL_TOKEN, n);
792
+ __publicField(this, "setExternalToken", (value) => {
793
+ this.write(KEY_PREFIX$2.EXTERNAL_TOKEN, value);
794
+ });
795
+ __publicField(this, "getExternalToken", () => {
796
+ return this.read(KEY_PREFIX$2.EXTERNAL_TOKEN);
691
797
  });
692
- k(this, "getExternalToken", () => this.read(A.EXTERNAL_TOKEN));
693
- k(this, "removeToken", () => {
694
- this.remove(A.TOKEN);
798
+ __publicField(this, "removeToken", () => {
799
+ this.remove(KEY_PREFIX$2.TOKEN);
695
800
  });
696
801
  }
697
802
  }
698
- var ce;
699
- (function(e) {
700
- e.DISABLED = "disabled", e.INITIALIZATION = "initialization", e.READY = "ready", e.FAILED = "failed", e.SUSPENDED = "suspended";
701
- })(ce || (ce = {}));
702
- var pe;
703
- (function(e) {
704
- e.SHOWED = "showed", e.EVENT = "ev";
705
- })(pe || (pe = {}));
706
- var ue;
707
- (function(e) {
708
- e.ONBOARDING = "onboarding", e.ONBOARDING_IO = "onboarding_io", e.QUESTION_RECEIVED = "q-received", e.QUESTION_OPENED = "q-opened";
709
- })(ue || (ue = {}));
710
- var me;
711
- (function(e) {
712
- e.ALLOWED = "allowed", e.DISALLOWED = "disallowed";
713
- })(me || (me = {}));
714
- var he;
715
- (function(e) {
716
- e.UNKNOWN = "unknown", e.ALREADY_VOTED = "already_voted";
717
- })(he || (he = {}));
718
- M("deep_link");
719
- M("bypass");
720
- new hn();
721
- M("video_player");
722
- var ve;
723
- (function(e) {
724
- e.Unset = "unset", e.Required = "required", e.Optional = "optional", e.Completed = "completed", e.Disabled = "disabled", e.Unavailable = "unavailable";
725
- })(ve || (ve = {}));
726
- V.POLL, V.PREDICTION, V.TRIVIA;
727
- const vn = {
728
- [N.GAMES]: !0
729
- }, fn = /* @__PURE__ */ u("div")({
803
+ var CoreStatus;
804
+ (function(CoreStatus2) {
805
+ CoreStatus2["DISABLED"] = "disabled";
806
+ CoreStatus2["INITIALIZATION"] = "initialization";
807
+ CoreStatus2["READY"] = "ready";
808
+ CoreStatus2["FAILED"] = "failed";
809
+ CoreStatus2["SUSPENDED"] = "suspended";
810
+ })(CoreStatus || (CoreStatus = {}));
811
+ var KEY_PREFIX$1;
812
+ (function(KEY_PREFIX2) {
813
+ KEY_PREFIX2["SHOWED"] = "showed";
814
+ KEY_PREFIX2["EVENT"] = "ev";
815
+ })(KEY_PREFIX$1 || (KEY_PREFIX$1 = {}));
816
+ var KEY_PREFIX;
817
+ (function(KEY_PREFIX2) {
818
+ KEY_PREFIX2["ONBOARDING"] = "onboarding";
819
+ KEY_PREFIX2["ONBOARDING_IO"] = "onboarding_io";
820
+ KEY_PREFIX2["QUESTION_RECEIVED"] = "q-received";
821
+ KEY_PREFIX2["QUESTION_OPENED"] = "q-opened";
822
+ })(KEY_PREFIX || (KEY_PREFIX = {}));
823
+ var InteractiveAllowed;
824
+ (function(InteractiveAllowed2) {
825
+ InteractiveAllowed2["ALLOWED"] = "allowed";
826
+ InteractiveAllowed2["DISALLOWED"] = "disallowed";
827
+ })(InteractiveAllowed || (InteractiveAllowed = {}));
828
+ var ERROR;
829
+ (function(ERROR2) {
830
+ ERROR2["UNKNOWN"] = "unknown";
831
+ ERROR2["ALREADY_VOTED"] = "already_voted";
832
+ })(ERROR || (ERROR = {}));
833
+ createLogger("deep_link");
834
+ createLogger("bypass");
835
+ new UserStorage();
836
+ createLogger("video_player");
837
+ var OnboardingStatus;
838
+ (function(OnboardingStatus2) {
839
+ OnboardingStatus2["Unset"] = "unset";
840
+ OnboardingStatus2["Required"] = "required";
841
+ OnboardingStatus2["Optional"] = "optional";
842
+ OnboardingStatus2["Completed"] = "completed";
843
+ OnboardingStatus2["Disabled"] = "disabled";
844
+ OnboardingStatus2["Unavailable"] = "unavailable";
845
+ })(OnboardingStatus || (OnboardingStatus = {}));
846
+ /* @__PURE__ */ new Set([QuestionType.POLL, QuestionType.PREDICTION, QuestionType.TRIVIA]);
847
+ const AvailableFeatures = {
848
+ [SdkOverlayType.GAMES]: true
849
+ };
850
+ const n$2 = /* @__PURE__ */ styled_default("div")({
730
851
  name: "Buttons",
731
852
  class: "b5o8qbl",
732
- propsAsIs: !1
733
- }), gn = ({
734
- children: e,
735
- className: t
736
- }) => /* @__PURE__ */ i(fn, {
737
- className: t,
738
- children: e
739
- }), $e = /* @__PURE__ */ u("div")({
853
+ propsAsIs: false
854
+ }), i$3 = ({
855
+ children: o2,
856
+ className: s2
857
+ }) => /* @__PURE__ */ jsx(n$2, {
858
+ className: s2,
859
+ children: o2
860
+ });
861
+ const n$1 = /* @__PURE__ */ styled_default("div")({
740
862
  name: "Navigation",
741
863
  class: "n6tbwuy",
742
- propsAsIs: !1
743
- }), In = () => gn, fe = /* @__PURE__ */ u(In())({
864
+ propsAsIs: false
865
+ }), t$1 = () => i$3, e$3 = /* @__PURE__ */ styled_default(t$1())({
744
866
  name: "NavigationItems",
745
867
  class: "n1up4z7v",
746
- propsAsIs: !0
747
- }), bn = /* @__PURE__ */ u("button")({
868
+ propsAsIs: true
869
+ });
870
+ const o = /* @__PURE__ */ styled_default("button")({
748
871
  name: "SButton",
749
872
  class: "sxxa0c",
750
- propsAsIs: !1
751
- }), kn = /* @__PURE__ */ u("span")({
873
+ propsAsIs: false
874
+ }), n = /* @__PURE__ */ styled_default("span")({
752
875
  name: "ButtonIcon",
753
876
  class: "b193dcyu",
754
- propsAsIs: !1
755
- }), yn = /* @__PURE__ */ u("span")({
877
+ propsAsIs: false
878
+ }), a$1 = /* @__PURE__ */ styled_default("span")({
756
879
  name: "ButtonLabel",
757
880
  class: "b40tuix",
758
- propsAsIs: !1
759
- }), Nn = "s14xk0af", Sn = "ha3mg7c", $n = "h103yr45", F = ({ disabled: e, active: t, onClick: n, label: o, icon: s, id: r }) => /* @__PURE__ */ i(
760
- bn,
881
+ propsAsIs: false
882
+ }), e$2 = "s14xk0af", c$2 = "ha3mg7c", r$2 = "h103yr45";
883
+ const i$2 = ({ disabled: n$12, active: r2, onClick: a2, label: c2, icon: o$12, id: t2 }) => /* @__PURE__ */ jsx(
884
+ o,
761
885
  {
762
- onClick: n,
886
+ onClick: a2,
763
887
  "data-a": "intr",
764
- disabled: e,
765
- className: C(
766
- t && Nn,
767
- !t && (r === "channels" || r === "featuredGroups") && Sn,
768
- !t && r === "leaderboard" && $n
888
+ disabled: n$12,
889
+ className: cx_default(
890
+ r2 && e$2,
891
+ !r2 && (t2 === "channels" || t2 === "featuredGroups") && c$2,
892
+ !r2 && t2 === "leaderboard" && r$2
769
893
  ),
770
- children: /* @__PURE__ */ f(L, { children: [
771
- s && /* @__PURE__ */ i(kn, { children: s }),
772
- /* @__PURE__ */ i(yn, { children: o })
894
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
895
+ o$12 && /* @__PURE__ */ jsx(n, { children: o$12 }),
896
+ /* @__PURE__ */ jsx(a$1, { children: c2 })
773
897
  ] })
774
898
  }
775
- ), An = () => D, wn = /* @__PURE__ */ u(An())({
899
+ );
900
+ const g = () => B1, x$1 = /* @__PURE__ */ styled_default(g())({
776
901
  name: "ButtonIcon",
777
902
  class: "b11wpe79",
778
- propsAsIs: !0
779
- }), Cn = /* @__PURE__ */ u("div")({
903
+ propsAsIs: true
904
+ }), F$1 = /* @__PURE__ */ styled_default("div")({
780
905
  name: "Container",
781
906
  class: "calnblm",
782
- propsAsIs: !1
783
- }), En = /* @__PURE__ */ u("div")({
907
+ propsAsIs: false
908
+ }), D$1 = /* @__PURE__ */ styled_default("div")({
784
909
  name: "Title",
785
910
  class: "t1438p52",
786
- propsAsIs: !1
787
- }), Rn = /* @__PURE__ */ u("div")({
911
+ propsAsIs: false
912
+ }), N = /* @__PURE__ */ styled_default("div")({
788
913
  name: "CloseIconWrap",
789
914
  class: "c17srj38",
790
- propsAsIs: !1
791
- }), xn = () => D, Ln = /* @__PURE__ */ u(xn())({
915
+ propsAsIs: false
916
+ }), B$1 = () => B1, j = /* @__PURE__ */ styled_default(B$1())({
792
917
  name: "CloseIcon",
793
918
  class: "clqia8k",
794
- propsAsIs: !0
795
- }), Dn = () => D, Tn = /* @__PURE__ */ u(Dn())({
919
+ propsAsIs: true
920
+ }), w = () => B1, G$1 = /* @__PURE__ */ styled_default(w())({
796
921
  name: "DashboardIcon",
797
922
  class: "df5w958",
798
- propsAsIs: !0
799
- }), On = "h12x6aiv", _n = be(({
800
- sdk: e,
801
- className: t
802
- }, n) => {
803
- const o = () => {
804
- e.closeFeature();
923
+ propsAsIs: true
924
+ }), M = "h12x6aiv", z$2 = forwardRef(({
925
+ sdk: s2,
926
+ className: l2
927
+ }, p2) => {
928
+ const a2 = () => {
929
+ s2.closeFeature();
805
930
  };
806
- return /* @__PURE__ */ f($e, {
807
- className: C(t, On),
808
- children: [/* @__PURE__ */ f(Cn, {
809
- children: [/* @__PURE__ */ f(En, {
810
- children: [/* @__PURE__ */ i(Tn, {
931
+ return /* @__PURE__ */ jsxs(n$1, {
932
+ className: cx_default(l2, M),
933
+ children: [/* @__PURE__ */ jsxs(F$1, {
934
+ children: [/* @__PURE__ */ jsxs(D$1, {
935
+ children: [/* @__PURE__ */ jsx(G$1, {
811
936
  name: "dashboard"
812
937
  }), "Dashboard"]
813
- }), /* @__PURE__ */ i(Rn, {
938
+ }), /* @__PURE__ */ jsx(N, {
814
939
  "data-a": "intr",
815
- onClick: o,
816
- children: /* @__PURE__ */ i(Ln, {
940
+ onClick: a2,
941
+ children: /* @__PURE__ */ jsx(j, {
817
942
  name: "icon-cross"
818
943
  })
819
944
  })]
820
- }), /* @__PURE__ */ i("div", {
821
- ref: n
945
+ }), /* @__PURE__ */ jsx("div", {
946
+ ref: p2
822
947
  })]
823
948
  });
824
- }), Mn = be(({
825
- sdk: e,
826
- className: t
827
- }, n) => {
828
- const o = v(e.sdkStore.organizationSettings), s = v(e.sdkStore.streamSettings), r = v(e.getActiveFeature()), l = w(() => {
829
- const a = (s == null ? void 0 : s.data) || (o == null ? void 0 : o.data);
830
- return a != null && a.overlays ? a.overlays : [];
831
- }, [o, s]), d = w(() => [...l.filter(({
832
- enableSdkButton: a,
833
- type: c
834
- }) => c === N.GAMES || a).map((a) => ({
835
- id: a.type,
836
- onClick: () => e.openFeature(a.type),
837
- disabled: !(a.type in vn),
838
- label: a.name,
839
- icon: /* @__PURE__ */ i("img", {
840
- src: a.icon,
949
+ }), J$1 = forwardRef(({
950
+ sdk: s2,
951
+ className: l2
952
+ }, p2) => {
953
+ const a2 = useStore(s2.sdkStore.organizationSettings), r2 = useStore(s2.sdkStore.streamSettings), i2 = useStore(s2.getActiveFeature()), f2 = useMemo(() => {
954
+ const o2 = (r2 == null ? void 0 : r2.data) || (a2 == null ? void 0 : a2.data);
955
+ return o2 != null && o2.overlays ? o2.overlays : [];
956
+ }, [a2, r2]), d2 = useMemo(() => [...f2.filter(({
957
+ enableSdkButton: o2,
958
+ type: m2
959
+ }) => m2 === SdkOverlayType.GAMES || o2).map((o2) => ({
960
+ id: o2.type,
961
+ onClick: () => s2.openFeature(o2.type),
962
+ disabled: !(o2.type in AvailableFeatures),
963
+ label: o2.name,
964
+ icon: /* @__PURE__ */ jsx("img", {
965
+ src: o2.icon,
841
966
  alt: ""
842
967
  }),
843
968
  /** multiplied by 10 to add the ability to insert custom buttons between our buttons */
844
- position: a.position * 10
845
- }))].sort((a, c) => a.position - c.position), [l, e]);
846
- return /* @__PURE__ */ f($e, {
847
- className: t,
848
- children: [d.length !== 0 && /* @__PURE__ */ i(fe, {
849
- children: [/* @__PURE__ */ i(F, {
969
+ position: o2.position * 10
970
+ }))].sort((o2, m2) => o2.position - m2.position), [f2, s2]);
971
+ return /* @__PURE__ */ jsxs(n$1, {
972
+ className: l2,
973
+ children: [d2.length !== 0 && /* @__PURE__ */ jsx(e$3, {
974
+ children: [/* @__PURE__ */ jsx(i$2, {
850
975
  id: "Channels",
851
- onClick: () => e.closeFeature(),
976
+ onClick: () => s2.closeFeature(),
852
977
  label: "Channels",
853
- active: r === 0
854
- }, "Channels"), ...d.map((a) => a.id === N.GAMES ? /* @__PURE__ */ i(F, {
855
- ...a,
856
- active: a.id === r,
978
+ active: i2 === 0
979
+ }, "Channels"), ...d2.map((o2) => o2.id === SdkOverlayType.GAMES ? /* @__PURE__ */ jsx(i$2, {
980
+ ...o2,
981
+ active: o2.id === i2,
857
982
  label: "StreamLayer +",
858
983
  id: "featuredGroups",
859
- icon: /* @__PURE__ */ i(wn, {
984
+ icon: /* @__PURE__ */ jsx(x$1, {
860
985
  name: "icon-btn-feature-groups",
861
- "data-selected": a.id === r
986
+ "data-selected": o2.id === i2
862
987
  })
863
- }, a.id) : /* @__PURE__ */ i(F, {
864
- ...a,
988
+ }, o2.id) : /* @__PURE__ */ jsx(i$2, {
989
+ ...o2,
865
990
  icon: void 0,
866
- active: a.id === r
867
- }, a.id))]
868
- }), !d.length && /* @__PURE__ */ i(fe, {
869
- children: [/* @__PURE__ */ i(F, {
991
+ active: o2.id === i2
992
+ }, o2.id))]
993
+ }), !d2.length && /* @__PURE__ */ jsx(e$3, {
994
+ children: [/* @__PURE__ */ jsx(i$2, {
870
995
  id: "empty",
871
996
  label: "No Features...",
872
- active: !1,
873
- disabled: !0
997
+ active: false,
998
+ disabled: true
874
999
  }, "empty")]
875
- }), /* @__PURE__ */ i("div", {
876
- ref: n
1000
+ }), /* @__PURE__ */ jsx("div", {
1001
+ ref: p2
877
1002
  })]
878
1003
  });
879
- }), Un = /* @__PURE__ */ u("div")({
1004
+ });
1005
+ const a = /* @__PURE__ */ styled_default("div")({
880
1006
  name: "Container",
881
1007
  class: "c1qjj4d4",
882
- propsAsIs: !1
883
- }), Bn = /* @__PURE__ */ u("div")({
1008
+ propsAsIs: false
1009
+ }), c$1 = /* @__PURE__ */ styled_default("div")({
884
1010
  name: "CloseIconWrap",
885
1011
  class: "c1lg6b8a",
886
- propsAsIs: !1
887
- }), Fn = () => D, zn = /* @__PURE__ */ u(Fn())({
1012
+ propsAsIs: false
1013
+ }), e$1 = () => B1, l = /* @__PURE__ */ styled_default(e$1())({
888
1014
  name: "CloseIcon",
889
1015
  class: "c159el66",
890
- propsAsIs: !0
891
- }), Pn = /* @__PURE__ */ u("div")({
1016
+ propsAsIs: true
1017
+ }), p = /* @__PURE__ */ styled_default("div")({
892
1018
  name: "Title",
893
1019
  class: "t16xmufv",
894
- propsAsIs: !1
895
- }), Vn = /* @__PURE__ */ u("img")({
1020
+ propsAsIs: false
1021
+ }), i$1 = /* @__PURE__ */ styled_default("img")({
896
1022
  name: "SponsorLogo",
897
1023
  class: "s83lc21",
898
- propsAsIs: !1
899
- }), qn = /* @__PURE__ */ u("div")({
1024
+ propsAsIs: false
1025
+ }), r$1 = /* @__PURE__ */ styled_default("div")({
900
1026
  name: "PresentsTitle",
901
1027
  class: "p1p7igia",
902
- propsAsIs: !1
903
- }), jn = /* @__PURE__ */ u("div")({
1028
+ propsAsIs: false
1029
+ }), m$1 = /* @__PURE__ */ styled_default("div")({
904
1030
  name: "Subtitle",
905
1031
  class: "s1eftsbu",
906
- propsAsIs: !1
907
- }), Kn = /* @__PURE__ */ u("div")({
1032
+ propsAsIs: false
1033
+ }), I = /* @__PURE__ */ styled_default("div")({
908
1034
  name: "Description",
909
1035
  class: "d8uezec",
910
- propsAsIs: !1
911
- }), Qn = /* @__PURE__ */ u("button")({
1036
+ propsAsIs: false
1037
+ }), f$1 = /* @__PURE__ */ styled_default("button")({
912
1038
  name: "ActionButton",
913
1039
  class: "a1h1bk90",
914
- propsAsIs: !1
915
- }), ge = ({ close: e, action: t, onboarding: n }) => {
916
- var o, s, r, l, d, a, c, m;
917
- return /* @__PURE__ */ f(Un, { children: [
918
- /* @__PURE__ */ i(Bn, { "data-a": "intr", onClick: e, children: /* @__PURE__ */ i(zn, { name: "icon-cross" }) }),
919
- ((s = (o = n == null ? void 0 : n.titleCard) == null ? void 0 : o.media) == null ? void 0 : s.sponsorLogo) && /* @__PURE__ */ f(Pn, { children: [
920
- /* @__PURE__ */ i(Vn, { alt: "sponsor-logo", src: (l = (r = n == null ? void 0 : n.titleCard) == null ? void 0 : r.media) == null ? void 0 : l.sponsorLogo }),
921
- /* @__PURE__ */ i(qn, { children: "PRESENTS" })
1040
+ propsAsIs: false
1041
+ });
1042
+ const y = ({ close: r2, action: S2, onboarding: t2 }) => {
1043
+ var l$12, s2, c2, C2, p$12, h2, m2, i2;
1044
+ return /* @__PURE__ */ jsxs(a, { children: [
1045
+ /* @__PURE__ */ jsx(c$1, { "data-a": "intr", onClick: r2, children: /* @__PURE__ */ jsx(l, { name: "icon-cross" }) }),
1046
+ ((s2 = (l$12 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : l$12.media) == null ? void 0 : s2.sponsorLogo) && /* @__PURE__ */ jsxs(p, { children: [
1047
+ /* @__PURE__ */ jsx(i$1, { alt: "sponsor-logo", src: (C2 = (c2 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : c2.media) == null ? void 0 : C2.sponsorLogo }),
1048
+ /* @__PURE__ */ jsx(r$1, { children: "PRESENTS" })
922
1049
  ] }),
923
- ((d = n == null ? void 0 : n.titleCard) == null ? void 0 : d.title) && /* @__PURE__ */ i(jn, { children: (a = n == null ? void 0 : n.titleCard) == null ? void 0 : a.title }),
924
- ((c = n == null ? void 0 : n.titleCard) == null ? void 0 : c.subtitle) && /* @__PURE__ */ i(Kn, { children: (m = n == null ? void 0 : n.titleCard) == null ? void 0 : m.subtitle }),
925
- /* @__PURE__ */ i(Qn, { "data-a": "intr", onClick: t, children: "Play Now" })
1050
+ ((p$12 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : p$12.title) && /* @__PURE__ */ jsx(m$1, { children: (h2 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : h2.title }),
1051
+ ((m2 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : m2.subtitle) && /* @__PURE__ */ jsx(I, { children: (i2 = t2 == null ? void 0 : t2.titleCard) == null ? void 0 : i2.subtitle }),
1052
+ /* @__PURE__ */ jsx(f$1, { "data-a": "intr", onClick: S2, children: "Play Now" })
926
1053
  ] });
927
- }, Q = [{
1054
+ };
1055
+ const C = [{
928
1056
  graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_1.png",
929
1057
  tagline: "",
930
- headline: /* @__PURE__ */ f(L, {
931
- children: ["Welcome to ", /* @__PURE__ */ i("br", {}), " Live Challenge"]
1058
+ headline: /* @__PURE__ */ jsxs(Fragment, {
1059
+ children: ["Welcome to ", /* @__PURE__ */ jsx("br", {}), " Live Challenge"]
932
1060
  })
933
1061
  }, {
934
1062
  graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_2.png",
@@ -936,51 +1064,51 @@ const vn = {
936
1064
  }, {
937
1065
  graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/dark/step_3.png",
938
1066
  headline: "Win points and play against friends."
939
- }], Gn = /* @__PURE__ */ u("div")({
1067
+ }], z$1 = /* @__PURE__ */ styled_default("div")({
940
1068
  name: "OnboardingContainer",
941
1069
  class: "o1xni1kr",
942
- propsAsIs: !1
943
- }), Wn = () => G, Hn = /* @__PURE__ */ u(Wn())({
1070
+ propsAsIs: false
1071
+ }), D = () => f$5, G = /* @__PURE__ */ styled_default(D())({
944
1072
  name: "OnboardingNotificationContainer",
945
1073
  class: "o1vnouv7",
946
- propsAsIs: !0
947
- }), Ie = /* @__PURE__ */ u("div")({
1074
+ propsAsIs: true
1075
+ }), x = /* @__PURE__ */ styled_default("div")({
948
1076
  name: "InnerContainer",
949
1077
  class: "i59uefw",
950
- propsAsIs: !1
951
- }), Jn = /* @__PURE__ */ u("div")({
1078
+ propsAsIs: false
1079
+ }), U$1 = /* @__PURE__ */ styled_default("div")({
952
1080
  name: "OnboardingOverlap",
953
1081
  class: "ovnr8ov",
954
- propsAsIs: !1
955
- }), Yn = ({
956
- deepLink: e,
957
- onboardingOpts: t,
958
- notification: n,
959
- gamification: o,
960
- loading: s,
961
- sdk: r,
962
- throttled: l
1082
+ propsAsIs: false
1083
+ }), J = ({
1084
+ deepLink: l2,
1085
+ onboardingOpts: e2,
1086
+ notification: o2,
1087
+ gamification: d2,
1088
+ loading: s2,
1089
+ sdk: c2,
1090
+ throttled: I2
963
1091
  }) => {
964
- var d, a, c, m, p, h, g;
965
- const b = v(o.friends ? o.friends.getStore() : ye({
1092
+ var a2, b2, h2, f2, v2, t2, m2;
1093
+ const u2 = useStore(d2.friends ? d2.friends.getStore() : createSingleStore({
966
1094
  data: []
967
- })), [$, I] = S(void 0), U = w(() => {
968
- var E, O;
969
- const J = r.getInviter();
970
- return J ? (O = (E = b.data) == null ? void 0 : E.find(({
971
- slId: we
972
- }) => we === J)) == null ? void 0 : O.name : "";
973
- }, [b.data, r]);
974
- return y(() => {
975
- const E = e.$store.subscribe((O) => {
976
- O && I(O.data);
1095
+ })), [r2, S2] = useState(void 0), g2 = useMemo(() => {
1096
+ var p2, w2;
1097
+ const i2 = c2.getInviter();
1098
+ return i2 ? (w2 = (p2 = u2.data) == null ? void 0 : p2.find(({
1099
+ slId: B2
1100
+ }) => B2 === i2)) == null ? void 0 : w2.name : "";
1101
+ }, [u2.data, c2]);
1102
+ return useEffect(() => {
1103
+ const i2 = l2.$store.subscribe((p2) => {
1104
+ p2 && S2(p2.data);
977
1105
  });
978
1106
  return () => {
979
- E();
1107
+ i2();
980
1108
  };
981
- }, [e.$store]), /* @__PURE__ */ f(Gn, {
982
- children: [/* @__PURE__ */ i(Ze, {
983
- loading: s,
1109
+ }, [l2.$store]), /* @__PURE__ */ jsxs(z$1, {
1110
+ children: [/* @__PURE__ */ jsx(tn, {
1111
+ loading: s2,
984
1112
  rules: [{
985
1113
  label: "Answer as many questions as you like.",
986
1114
  icon: "icon-btn-feature-groups"
@@ -991,392 +1119,396 @@ const vn = {
991
1119
  label: "Top the leader board and best your friends.",
992
1120
  icon: "icon-trophy"
993
1121
  }],
994
- rulesBtnLabel: (d = t.rules) == null ? void 0 : d.buttonLabel,
995
- rulesTitle: (a = t.rules) == null ? void 0 : a.heading,
1122
+ rulesBtnLabel: (a2 = e2.rules) == null ? void 0 : a2.buttonLabel,
1123
+ rulesTitle: (b2 = e2.rules) == null ? void 0 : b2.heading,
996
1124
  termsTitle: "Terms and Conditions",
997
- termsText: (c = t.rules) == null ? void 0 : c.terms,
998
- steps: Q,
999
- primaryColor: (m = t.inviteCard) == null ? void 0 : m.iconColor,
1000
- inviteLink: $,
1001
- inviteCardTitle: (p = t.inviteCard) == null ? void 0 : p.heading,
1002
- inviteCardSubtext: (h = t.inviteCard) == null ? void 0 : h.subtext,
1003
- inviteCardBtnLabel: (g = t.inviteCard) == null ? void 0 : g.buttonLabel,
1125
+ termsText: (h2 = e2.rules) == null ? void 0 : h2.terms,
1126
+ steps: C,
1127
+ primaryColor: (f2 = e2.inviteCard) == null ? void 0 : f2.iconColor,
1128
+ inviteLink: r2,
1129
+ inviteCardTitle: (v2 = e2.inviteCard) == null ? void 0 : v2.heading,
1130
+ inviteCardSubtext: (t2 = e2.inviteCard) == null ? void 0 : t2.subtext,
1131
+ inviteCardBtnLabel: (m2 = e2.inviteCard) == null ? void 0 : m2.buttonLabel,
1004
1132
  onClose: () => {
1005
- var E;
1006
- (E = n.close) == null || E.call(n);
1133
+ var i2;
1134
+ (i2 = o2.close) == null || i2.call(o2);
1007
1135
  },
1008
- gamification: o,
1009
- sdk: r,
1010
- inviterName: U
1011
- }), l && /* @__PURE__ */ i(Jn, {})]
1136
+ gamification: d2,
1137
+ sdk: c2,
1138
+ inviterName: g2
1139
+ }), I2 && /* @__PURE__ */ jsx(U$1, {})]
1012
1140
  });
1013
- }, Zn = ({
1014
- sdk: e,
1015
- notification: t,
1016
- saveHeight: n,
1017
- style: o,
1018
- appNode: s,
1019
- sdkInDesktopView: r,
1020
- responsiveStore: l
1141
+ }, ie = ({
1142
+ sdk: l2,
1143
+ notification: e2,
1144
+ saveHeight: o2,
1145
+ style: d2,
1146
+ appNode: s2,
1147
+ sdkInDesktopView: c2,
1148
+ responsiveStore: I2
1021
1149
  }) => {
1022
- const d = x(null), a = t.data.onboarding, [c, m] = S(a == null ? void 0 : a.instantOpen), p = e.getFeature(N.GAMES), h = w(() => Q == null ? void 0 : Q.map(({
1023
- graphicSrc: I
1024
- }) => I), []), {
1025
- screen: g
1026
- } = v(l, {
1150
+ const u2 = useRef(null), r2 = e2.data.onboarding, [S2, g2] = useState(r2 == null ? void 0 : r2.instantOpen), a2 = l2.getFeature(SdkOverlayType.GAMES), b2 = useMemo(() => C == null ? void 0 : C.map(({
1151
+ graphicSrc: t2
1152
+ }) => t2), []), {
1153
+ screen: h2
1154
+ } = useStore(I2, {
1027
1155
  keys: ["screen"]
1028
1156
  });
1029
- De(() => {
1030
- var I;
1031
- n(((I = d.current) == null ? void 0 : I.getBoundingClientRect().height) || 0);
1032
- }, [n]);
1157
+ useLayoutEffect(() => {
1158
+ var t2;
1159
+ o2(((t2 = u2.current) == null ? void 0 : t2.getBoundingClientRect().height) || 0);
1160
+ }, [o2]);
1033
1161
  const {
1034
- loading: b,
1035
- throttled: $
1036
- } = Ye(h);
1037
- return c && p && a && s.current ? /* @__PURE__ */ i(Ne, {
1038
- container: s,
1039
- useContainer: !r,
1040
- children: /* @__PURE__ */ i(Yn, {
1041
- throttled: $,
1042
- notification: t,
1043
- setOpened: m,
1044
- gamification: p,
1045
- onboardingOpts: a,
1046
- deepLink: p.deepLink,
1047
- loading: b,
1048
- renderToNode: s,
1049
- sdk: e
1162
+ loading: f2,
1163
+ throttled: v2
1164
+ } = I$4(b2);
1165
+ return S2 && a2 && r2 && s2.current ? /* @__PURE__ */ jsx(T$2, {
1166
+ container: s2,
1167
+ useContainer: !c2,
1168
+ children: /* @__PURE__ */ jsx(J, {
1169
+ throttled: v2,
1170
+ notification: e2,
1171
+ setOpened: g2,
1172
+ gamification: a2,
1173
+ onboardingOpts: r2,
1174
+ deepLink: a2.deepLink,
1175
+ loading: f2,
1176
+ renderToNode: s2,
1177
+ sdk: l2
1050
1178
  })
1051
- }) : /* @__PURE__ */ f(L, {
1052
- children: [/* @__PURE__ */ i(Ie, {
1053
- ref: d,
1179
+ }) : /* @__PURE__ */ jsxs(Fragment, {
1180
+ children: [/* @__PURE__ */ jsx(x, {
1181
+ ref: u2,
1054
1182
  style: {
1055
1183
  position: "absolute",
1056
1184
  visibility: "hidden"
1057
1185
  },
1058
- children: /* @__PURE__ */ i(ge, {
1186
+ children: /* @__PURE__ */ jsx(y, {
1059
1187
  close: () => {
1060
1188
  },
1061
1189
  action: () => {
1062
1190
  },
1063
- onboarding: a
1191
+ onboarding: r2
1064
1192
  })
1065
- }), /* @__PURE__ */ i(Hn, {
1066
- style: o,
1067
- hiding: t.hiding,
1068
- children: /* @__PURE__ */ i(Ie, {
1069
- children: /* @__PURE__ */ i(ge, {
1070
- close: t.close,
1193
+ }), /* @__PURE__ */ jsx(G, {
1194
+ style: d2,
1195
+ hiding: e2.hiding,
1196
+ children: /* @__PURE__ */ jsx(x, {
1197
+ children: /* @__PURE__ */ jsx(y, {
1198
+ close: e2.close,
1071
1199
  action: () => {
1072
- var I;
1073
- m(!0), (((I = s.current) == null ? void 0 : I.getBoundingClientRect().y) || 0) < 0 && H(s, g.size, {
1200
+ var m2;
1201
+ g2(true), (((m2 = s2.current) == null ? void 0 : m2.getBoundingClientRect().y) || 0) < 0 && I$2(s2, h2.size, {
1074
1202
  behavior: "smooth"
1075
1203
  });
1076
1204
  },
1077
- onboarding: a
1205
+ onboarding: r2
1078
1206
  })
1079
1207
  })
1080
1208
  })]
1081
1209
  });
1082
- }, Xn = () => G, es = /* @__PURE__ */ u(Xn())({
1210
+ };
1211
+ const e = () => f$5, c = /* @__PURE__ */ styled_default(e())({
1083
1212
  name: "Container",
1084
1213
  class: "c8ol1ve",
1085
- propsAsIs: !0
1086
- }), Ae = /* @__PURE__ */ u("div")({
1214
+ propsAsIs: true
1215
+ }), t = /* @__PURE__ */ styled_default("div")({
1087
1216
  name: "InnerContainer",
1088
1217
  class: "iqfywam",
1089
- propsAsIs: !1
1090
- }), ts = () => Ae, ns = /* @__PURE__ */ u(ts())({
1218
+ propsAsIs: false
1219
+ }), i = () => t, m = /* @__PURE__ */ styled_default(i())({
1091
1220
  name: "HiddenContainer",
1092
1221
  class: "hokmtod",
1093
- propsAsIs: !0
1094
- }), ss = /* @__PURE__ */ u("div")({
1222
+ propsAsIs: true
1223
+ }), f = /* @__PURE__ */ styled_default("div")({
1095
1224
  name: "NotificationRefreshing",
1096
1225
  class: "n192d1q8",
1097
- propsAsIs: !1
1098
- }), os = () => Xe, is = /* @__PURE__ */ u(os())({
1226
+ propsAsIs: false
1227
+ }), r = () => f$6, d = /* @__PURE__ */ styled_default(r())({
1099
1228
  name: "Pill",
1100
1229
  class: "p1lha68t",
1101
- propsAsIs: !0
1102
- }), as = (e) => {
1103
- const [t, n] = S(0), o = x(null), s = w(() => new ResizeObserver((d) => {
1230
+ propsAsIs: true
1231
+ });
1232
+ const v = (r2) => {
1233
+ const [e2, d2] = useState(0), i2 = useRef(null), l2 = useMemo(() => new ResizeObserver((n2) => {
1104
1234
  window.requestAnimationFrame(() => {
1105
- var a;
1106
- if (Array.isArray(d)) {
1107
- for (const c of d)
1108
- if (c.contentBoxSize) {
1109
- const m = (a = o.current) == null ? void 0 : a.getBoundingClientRect();
1110
- m && n(m.height);
1235
+ var f2;
1236
+ if (Array.isArray(n2)) {
1237
+ for (const c2 of n2)
1238
+ if (c2.contentBoxSize) {
1239
+ const o2 = (f2 = i2.current) == null ? void 0 : f2.getBoundingClientRect();
1240
+ o2 && d2(o2.height);
1111
1241
  }
1112
1242
  }
1113
1243
  });
1114
- }), []), r = j((d) => {
1115
- o.current = d;
1116
- }, []), l = j((d) => {
1117
- n(d);
1244
+ }), []), s2 = useCallback((n2) => {
1245
+ i2.current = n2;
1246
+ }, []), a2 = useCallback((n2) => {
1247
+ d2(n2);
1118
1248
  }, []);
1119
- return y(() => {
1120
- const d = o.current;
1121
- return d ? (s.observe(d), () => {
1122
- s.unobserve(d);
1249
+ return useEffect(() => {
1250
+ const n2 = i2.current;
1251
+ return n2 ? (l2.observe(n2), () => {
1252
+ l2.unobserve(n2);
1123
1253
  }) : () => {
1124
1254
  };
1125
- }, [e]), y(() => () => {
1126
- s.disconnect();
1127
- }), [r, t, l];
1128
- }, rs = ({
1129
- sdk: e,
1130
- notification: t,
1131
- appNode: n,
1132
- responsiveStore: o,
1133
- hasActiveFeature: s
1255
+ }, [r2]), useEffect(() => () => {
1256
+ l2.disconnect();
1257
+ }), [s2, e2, a2];
1258
+ }, Q = ({
1259
+ sdk: r2,
1260
+ notification: e2,
1261
+ appNode: d2,
1262
+ responsiveStore: i2,
1263
+ hasActiveFeature: l2
1134
1264
  }) => {
1135
- var r, l;
1265
+ var t$12, m$12;
1136
1266
  const {
1137
- sdkInDesktopView: d
1138
- } = v(o, {
1267
+ sdkInDesktopView: s2
1268
+ } = useStore(i2, {
1139
1269
  keys: ["sdkInDesktopView"]
1140
1270
  }), {
1141
- sdk: a
1142
- } = W(), [c, m, p] = as(t.id);
1143
- let h = m;
1144
- return s || (h = "auto"), t.type === z.QUESTION ? /* @__PURE__ */ f(L, {
1145
- children: [/* @__PURE__ */ i(ns, {
1146
- ref: c,
1147
- children: /* @__PURE__ */ i(te, {
1148
- ...t
1271
+ sdk: a2
1272
+ } = p$3(), [n2, f$12, c$12] = v(e2.id);
1273
+ let o2 = f$12;
1274
+ return l2 || (o2 = "auto"), e2.type === NotificationType.QUESTION ? /* @__PURE__ */ jsxs(Fragment, {
1275
+ children: [/* @__PURE__ */ jsx(m, {
1276
+ ref: n2,
1277
+ children: /* @__PURE__ */ jsx(w$2, {
1278
+ ...e2
1149
1279
  })
1150
- }), /* @__PURE__ */ f(es, {
1280
+ }), /* @__PURE__ */ jsxs(c, {
1151
1281
  style: {
1152
- height: t.hiding ? 0 : h
1282
+ height: e2.hiding ? 0 : o2
1153
1283
  },
1154
- hiding: t.hiding,
1155
- children: [/* @__PURE__ */ i(Ae, {
1284
+ hiding: e2.hiding,
1285
+ children: [/* @__PURE__ */ jsx(t, {
1156
1286
  style: {
1157
1287
  height: "100%"
1158
1288
  },
1159
- children: /* @__PURE__ */ i(te, {
1160
- ...t,
1161
- controlVideo: a == null ? void 0 : a.controlVideoPlayer
1289
+ children: /* @__PURE__ */ jsx(w$2, {
1290
+ ...e2,
1291
+ controlVideo: a2 == null ? void 0 : a2.controlVideoPlayer
1162
1292
  })
1163
- }), /* @__PURE__ */ i(ss, {}, t.id)]
1293
+ }), /* @__PURE__ */ jsx(f, {}, e2.id)]
1164
1294
  })]
1165
- }) : t.type === z.QUESTION_RESOLVED && (l = (r = t.data) == null ? void 0 : r.question) != null && l.predictionResult ? /* @__PURE__ */ i(et, {
1295
+ }) : e2.type === NotificationType.QUESTION_RESOLVED && ((m$12 = (t$12 = e2.data) == null ? void 0 : t$12.question) != null && m$12.predictionResult) ? /* @__PURE__ */ jsx(D$2, {
1166
1296
  style: {
1167
- height: t.hiding ? 0 : m
1297
+ height: e2.hiding ? 0 : f$12
1168
1298
  },
1169
- saveHeight: p,
1170
- close: t.close,
1171
- hiding: t.hiding,
1172
- ...t.data.question
1173
- }) : t.type === z.ONBOARDING ? /* @__PURE__ */ i(Zn, {
1299
+ saveHeight: c$12,
1300
+ close: e2.close,
1301
+ hiding: e2.hiding,
1302
+ ...e2.data.question
1303
+ }) : e2.type === NotificationType.ONBOARDING ? /* @__PURE__ */ jsx(ie, {
1174
1304
  style: {
1175
- height: t.hiding ? 0 : h
1305
+ height: e2.hiding ? 0 : o2
1176
1306
  },
1177
- saveHeight: p,
1178
- sdk: e,
1179
- notification: t,
1180
- sdkInDesktopView: d,
1181
- appNode: n,
1182
- responsiveStore: o
1307
+ saveHeight: c$12,
1308
+ sdk: r2,
1309
+ notification: e2,
1310
+ sdkInDesktopView: s2,
1311
+ appNode: d2,
1312
+ responsiveStore: i2
1183
1313
  }) : null;
1184
- }, ls = "p7vfi6t", ds = ({
1185
- pill: e,
1186
- setPill: t,
1187
- appNode: n,
1188
- headerNode: o,
1189
- scrollNode: s,
1190
- responsiveStore: r,
1191
- scrollStore: l
1314
+ }, F = "p7vfi6t", U = ({
1315
+ pill: r2,
1316
+ setPill: e2,
1317
+ appNode: d$12,
1318
+ headerNode: i2,
1319
+ scrollNode: l2,
1320
+ responsiveStore: s2,
1321
+ scrollStore: a2
1192
1322
  }) => {
1193
- var d, a;
1323
+ var t2, m2;
1194
1324
  const {
1195
- screen: c
1196
- } = v(r, {
1325
+ screen: n2
1326
+ } = useStore(s2, {
1197
1327
  keys: ["screen"]
1198
1328
  }), {
1199
- tabsShown: m,
1200
- scrollPosition: p
1201
- } = v(l, {
1329
+ tabsShown: f2,
1330
+ scrollPosition: c2
1331
+ } = useStore(a2, {
1202
1332
  keys: ["tabsShown", "scrollPosition"]
1203
1333
  });
1204
- y(() => {
1205
- r.get().sdkInDesktopView ? p < 50 && t(null) : p > -50 && t(null);
1206
- }, [p, r, t]);
1207
- const h = r.get().sdkInDesktopView ? n : o;
1208
- return !e || !h.current ? null : mt(/* @__PURE__ */ i(is, {
1209
- title: e.type === z.QUESTION_RESOLVED ? "Prediction result" : `New ${((a = ut[(d = e.data) == null ? void 0 : d.questionType]) == null ? void 0 : a.label) || "notification"}`,
1334
+ useEffect(() => {
1335
+ s2.get().sdkInDesktopView ? c2 < 50 && e2(null) : c2 > -50 && e2(null);
1336
+ }, [c2, s2, e2]);
1337
+ const o2 = s2.get().sdkInDesktopView ? d$12 : i2;
1338
+ return !r2 || !o2.current ? null : createPortal(/* @__PURE__ */ jsx(d, {
1339
+ title: r2.type === NotificationType.QUESTION_RESOLVED ? "Prediction result" : `New ${((m2 = e$7[(t2 = r2.data) == null ? void 0 : t2.questionType]) == null ? void 0 : m2.label) || "notification"}`,
1210
1340
  "data-a": "intr",
1211
1341
  onClick: () => {
1212
- var g;
1213
- r.get().sdkInDesktopView ? (g = s.current) == null || g.scrollTo({
1342
+ var g2;
1343
+ s2.get().sdkInDesktopView ? (g2 = l2.current) == null || g2.scrollTo({
1214
1344
  top: 0,
1215
1345
  behavior: "smooth"
1216
- }) : H(n, c.size, {
1346
+ }) : I$2(d$12, n2.size, {
1217
1347
  behavior: "smooth"
1218
- }), t(null);
1348
+ }), e2(null);
1219
1349
  },
1220
- className: C(m && ls, "sl-pill-button")
1221
- }), h.current);
1222
- }, cs = ({
1223
- sdk: e,
1224
- headerNode: t,
1225
- scrollNode: n,
1226
- responsiveStore: o,
1227
- appNode: s,
1228
- scrollStore: r,
1229
- hasActiveFeature: l
1350
+ className: cx_default(f2 && F, "sl-pill-button")
1351
+ }), o2.current);
1352
+ }, ne = ({
1353
+ sdk: r2,
1354
+ headerNode: e2,
1355
+ scrollNode: d2,
1356
+ responsiveStore: i2,
1357
+ appNode: l2,
1358
+ scrollStore: s2,
1359
+ hasActiveFeature: a2
1230
1360
  }) => {
1231
- const [d] = S(e.getNotificationsStore()), a = v(d), [c, m] = S(null), p = w(() => e.getActiveNotification(), [e, a]);
1232
- return y(() => {
1233
- p && ht.emit("notification", {
1361
+ const [n2] = useState(r2.getNotificationsStore()), f2 = useStore(n2), [c2, o2] = useState(null), t2 = useMemo(() => r2.getActiveNotification(), [r2, f2]);
1362
+ return useEffect(() => {
1363
+ t2 && eventBus.emit("notification", {
1234
1364
  action: "rendered",
1235
1365
  payload: {
1236
- questionId: p.data.questionId,
1237
- questionType: p.data.questionType
1366
+ questionId: t2.data.questionId,
1367
+ questionType: t2.data.questionType
1238
1368
  }
1239
1369
  });
1240
- }, [p]), y(() => {
1370
+ }, [t2]), useEffect(() => {
1241
1371
  const {
1242
- sdkInDesktopView: h,
1243
- sdkInView: g
1244
- } = o.get();
1245
- p && (h || g) && (!h && g && m(p), h && window.requestAnimationFrame(() => {
1246
- r.get().scrollPosition !== 0 && m(p);
1372
+ sdkInDesktopView: m2,
1373
+ sdkInView: g2
1374
+ } = i2.get();
1375
+ t2 && (m2 || g2) && (!m2 && g2 && o2(t2), m2 && window.requestAnimationFrame(() => {
1376
+ s2.get().scrollPosition !== 0 && o2(t2);
1247
1377
  }));
1248
- }, [p]), y(() => {
1249
- p || m(null);
1250
- }, [p]), /* @__PURE__ */ f(L, {
1251
- children: [!c && p && /* @__PURE__ */ i(rs, {
1252
- appNode: s,
1253
- sdk: e,
1254
- hasActiveFeature: l,
1255
- notification: p,
1256
- responsiveStore: o
1257
- }), c && /* @__PURE__ */ i(ds, {
1258
- pill: c,
1259
- setPill: m,
1260
- appNode: s,
1261
- notification: p,
1262
- headerNode: t,
1263
- scrollNode: n,
1264
- scrollStore: r,
1265
- responsiveStore: o
1378
+ }, [t2]), useEffect(() => {
1379
+ t2 || o2(null);
1380
+ }, [t2]), /* @__PURE__ */ jsxs(Fragment, {
1381
+ children: [!c2 && t2 && /* @__PURE__ */ jsx(Q, {
1382
+ appNode: l2,
1383
+ sdk: r2,
1384
+ hasActiveFeature: a2,
1385
+ notification: t2,
1386
+ responsiveStore: i2
1387
+ }), c2 && /* @__PURE__ */ jsx(U, {
1388
+ pill: c2,
1389
+ setPill: o2,
1390
+ appNode: l2,
1391
+ notification: t2,
1392
+ headerNode: e2,
1393
+ scrollNode: d2,
1394
+ scrollStore: s2,
1395
+ responsiveStore: i2
1266
1396
  })]
1267
1397
  });
1268
- }, ps = (e) => {
1269
- const t = v(e.status), n = v(e.sdkStore.slStreamId), o = v(e.userId()), s = v(e.getActiveFeature()), r = t === "ready" && !!n.data;
1270
- return y(() => {
1271
- const l = e.getFeature(N.GAMES);
1272
- l && s !== N.GAMES && (l.closeQuestion(), l.closeUser()), l == null || l.openedQuestionId.subscribe((d) => {
1273
- d && s !== N.GAMES && e.openFeature(N.GAMES);
1398
+ };
1399
+ const A = (e2) => {
1400
+ const u2 = useStore(e2.status), a2 = useStore(e2.sdkStore.slStreamId), c2 = useStore(e2.userId()), r2 = useStore(e2.getActiveFeature()), n2 = u2 === "ready" && !!a2.data;
1401
+ return useEffect(() => {
1402
+ const t2 = e2.getFeature(SdkOverlayType.GAMES);
1403
+ t2 && r2 !== SdkOverlayType.GAMES && (t2.closeQuestion(), t2.closeUser()), t2 == null || t2.openedQuestionId.subscribe((p2) => {
1404
+ p2 && r2 !== SdkOverlayType.GAMES && e2.openFeature(SdkOverlayType.GAMES);
1274
1405
  });
1275
- }, [s, e]), {
1276
- sdkReady: r,
1277
- activeFeature: s,
1278
- isLogged: !!o
1406
+ }, [r2, e2]), {
1407
+ sdkReady: n2,
1408
+ activeFeature: r2,
1409
+ isLogged: !!c2
1279
1410
  };
1280
- }, us = ({
1281
- sdk: e,
1282
- className: t,
1283
- scrollStore: n,
1284
- appNode: o,
1285
- scrollNode: s,
1286
- responsiveStore: r
1411
+ };
1412
+ const z = ({
1413
+ sdk: e2,
1414
+ className: l2,
1415
+ scrollStore: o2,
1416
+ appNode: a2,
1417
+ scrollNode: m2,
1418
+ responsiveStore: r2
1287
1419
  }) => {
1288
- const [, l] = tt(e);
1289
- return /* @__PURE__ */ i(cn, {
1290
- className: t,
1291
- scrollNode: s,
1292
- appNode: o,
1293
- scrollStore: n,
1294
- feature: l,
1295
- responsiveStore: r,
1296
- sdk: e
1420
+ const [, t2] = p$5(e2);
1421
+ return /* @__PURE__ */ jsx(x$2, {
1422
+ className: l2,
1423
+ scrollNode: m2,
1424
+ appNode: a2,
1425
+ scrollStore: o2,
1426
+ feature: t2,
1427
+ responsiveStore: r2,
1428
+ sdk: e2
1297
1429
  });
1298
- }, ms = ({
1299
- sdk: e,
1300
- muted: t,
1301
- className: n,
1302
- appNode: o,
1303
- responsiveStore: s
1430
+ }, B = ({
1431
+ sdk: e2,
1432
+ muted: l2,
1433
+ className: o2,
1434
+ appNode: a2,
1435
+ responsiveStore: m2
1304
1436
  }) => {
1305
- const r = v(e.featuresList.getStore());
1306
- return r ? Array.from(r, (l) => {
1307
- const d = e.getFeature(l);
1308
- return d ? /* @__PURE__ */ i(pn, {
1309
- className: n,
1310
- muted: t,
1311
- appNode: o,
1312
- feature: d,
1313
- responsiveStore: s,
1314
- sdk: e
1315
- }, l) : null;
1437
+ const r2 = useStore(e2.featuresList.getStore());
1438
+ return r2 ? Array.from(r2, (t2) => {
1439
+ const i2 = e2.getFeature(t2);
1440
+ return i2 ? /* @__PURE__ */ jsx(A$1, {
1441
+ className: o2,
1442
+ muted: l2,
1443
+ appNode: a2,
1444
+ feature: i2,
1445
+ responsiveStore: m2,
1446
+ sdk: e2
1447
+ }, t2) : null;
1316
1448
  }) : null;
1317
- }, hs = ({
1318
- sdk: e,
1319
- muted: t,
1320
- topNavigation: n
1449
+ }, oe = ({
1450
+ sdk: e2,
1451
+ muted: l2,
1452
+ topNavigation: o2
1321
1453
  }) => {
1322
- const [o, s] = S(!0), r = x(null), l = v(e.uiState), d = x(null), [a] = vt(r), [c, m] = gt(r, a), {
1323
- sdkReady: p,
1324
- activeFeature: h,
1325
- isLogged: g
1326
- } = ps(e), b = !!p;
1327
- st(r, {
1328
- enabled: b,
1454
+ const [a2, m2] = useState(true), r2 = useRef(null), t2 = useStore(e2.uiState), i2 = useRef(null), [c2] = h(r2), [p2, d2] = L(r2, c2), {
1455
+ sdkReady: x2,
1456
+ activeFeature: f2,
1457
+ isLogged: N2
1458
+ } = A(e2), s2 = !!x2;
1459
+ b$3(r2, {
1460
+ enabled: s2,
1329
1461
  event: "click",
1330
- listener: ot
1462
+ listener: A$3
1331
1463
  });
1332
- const $ = w(() => ({
1333
- sdk: e,
1334
- topNavigation: n
1335
- }), [e, n]);
1336
- return y(() => {
1464
+ const g2 = useMemo(() => ({
1465
+ sdk: e2,
1466
+ topNavigation: o2
1467
+ }), [e2, o2]);
1468
+ return useEffect(() => {
1337
1469
  import("./gamification-feature.js");
1338
- }, []), /* @__PURE__ */ i(rt.Provider, {
1339
- value: $,
1340
- children: /* @__PURE__ */ f(Qe, {
1341
- ref: (I) => {
1342
- r.current = I, s(!!I);
1470
+ }, []), /* @__PURE__ */ jsx(e$8.Provider, {
1471
+ value: g2,
1472
+ children: /* @__PURE__ */ jsxs(p$4, {
1473
+ ref: (S2) => {
1474
+ r2.current = S2, m2(!!S2);
1343
1475
  },
1344
- className: n ? "" : "c10llmat",
1345
- children: [b && n && l.app && /* @__PURE__ */ i(Mn, {
1346
- className: C(B, "sl-hide-on-modal"),
1347
- sdk: e,
1348
- ref: d
1349
- }), b && !n && !!h && l.app && /* @__PURE__ */ i(_n, {
1350
- className: C(B, "sl-hide-on-modal"),
1351
- sdk: e,
1352
- ref: d
1353
- }), /* @__PURE__ */ f(Ge, {
1476
+ className: o2 ? "" : "c10llmat",
1477
+ children: [s2 && o2 && t2.app && /* @__PURE__ */ jsx(J$1, {
1478
+ className: cx_default(m$6, "sl-hide-on-modal"),
1479
+ sdk: e2,
1480
+ ref: i2
1481
+ }), s2 && !o2 && !!f2 && t2.app && /* @__PURE__ */ jsx(z$2, {
1482
+ className: cx_default(m$6, "sl-hide-on-modal"),
1483
+ sdk: e2,
1484
+ ref: i2
1485
+ }), /* @__PURE__ */ jsxs(c$5, {
1354
1486
  className: "sl-hide-on-modal",
1355
- ref: c,
1356
- "data-nav": (!!h && b).toString(),
1357
- children: [b && l.app && /* @__PURE__ */ i(cs, {
1358
- sdk: e,
1359
- scrollNode: c,
1360
- headerNode: d,
1361
- appNode: r,
1362
- scrollStore: m,
1363
- responsiveStore: a,
1364
- hasActiveFeature: !!h
1365
- }), b && l.app && /* @__PURE__ */ i(us, {
1366
- scrollStore: m,
1367
- responsiveStore: a,
1368
- scrollNode: c,
1369
- appNode: r,
1370
- className: B,
1371
- sdk: e
1372
- }), b && o && /* @__PURE__ */ i(ms, {
1373
- muted: t,
1374
- responsiveStore: a,
1375
- appNode: r,
1376
- className: B,
1377
- sdk: e
1487
+ ref: p2,
1488
+ "data-nav": (!!f2 && s2).toString(),
1489
+ children: [s2 && t2.app && /* @__PURE__ */ jsx(ne, {
1490
+ sdk: e2,
1491
+ scrollNode: p2,
1492
+ headerNode: i2,
1493
+ appNode: r2,
1494
+ scrollStore: d2,
1495
+ responsiveStore: c2,
1496
+ hasActiveFeature: !!f2
1497
+ }), s2 && t2.app && /* @__PURE__ */ jsx(z, {
1498
+ scrollStore: d2,
1499
+ responsiveStore: c2,
1500
+ scrollNode: p2,
1501
+ appNode: r2,
1502
+ className: m$6,
1503
+ sdk: e2
1504
+ }), s2 && a2 && /* @__PURE__ */ jsx(B, {
1505
+ muted: l2,
1506
+ responsiveStore: c2,
1507
+ appNode: r2,
1508
+ className: m$6,
1509
+ sdk: e2
1378
1510
  })]
1379
- }), b && !g && o && l.app && /* @__PURE__ */ i("div", {
1511
+ }), s2 && !N2 && a2 && t2.app && /* @__PURE__ */ jsx("div", {
1380
1512
  style: {
1381
1513
  display: "flex",
1382
1514
  alignItems: "center",
@@ -1388,13 +1520,14 @@ const vn = {
1388
1520
  })]
1389
1521
  })
1390
1522
  });
1391
- }, Vs = ({ event: e, topNavigation: t, theme: n, muted: o, withSidebarNotification: s = !0 }) => {
1392
- const { sdk: r, status: l } = Y(Z), d = Te(), a = Oe(), { event: c } = Y(Z);
1393
- if (l === X.UNSET)
1523
+ };
1524
+ const b = ({ event: p2, topNavigation: S2, theme: c2, muted: u2, withSidebarNotification: d2 = true }) => {
1525
+ const { sdk: t2, status: i2 } = useContext(i$7), e2 = F$2(), m2 = z$4(), { event: a2 } = useContext(i$7);
1526
+ if (i2 === Y.UNSET)
1394
1527
  throw new Error("Wrap app in `StreamLayerProvider`");
1395
- return l === X.CONNECTED ? /* @__PURE__ */ i("div", { className: "StreamLayerSDK", children: "wait" }) : r === null ? /* @__PURE__ */ i("div", { className: "StreamLayerSDK", children: "sdk not initialized" }) : !d.app && !d.appNotification && !d.appSidebar || !d.app && !d.appSidebar && d.appNotification && !s ? null : /* @__PURE__ */ i("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ i(Me, { customTheme: n ?? a.theme, themeMode: a.themeMode, children: /* @__PURE__ */ i(hs, { sdk: r, muted: o, event: (c == null ? void 0 : c.current) || e, topNavigation: t }) }) });
1528
+ return i2 === Y.CONNECTED ? /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: "wait" }) : t2 === null ? /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: "sdk not initialized" }) : !e2.app && !e2.appNotification && !e2.appSidebar || !e2.app && !e2.appSidebar && e2.appNotification && !d2 ? null : /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsx(h$1, { customTheme: c2 ?? m2.theme, themeMode: m2.themeMode, children: /* @__PURE__ */ jsx(oe, { sdk: t2, muted: u2, event: (a2 == null ? void 0 : a2.current) || p2, topNavigation: S2 }) }) });
1396
1529
  };
1397
1530
  export {
1398
- Ps as B,
1399
- Vs as b
1531
+ B$2 as B,
1532
+ b
1400
1533
  };