@streamlayer/react-ui 1.22.6 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/lib/app/app/Advertisement/index.js +11 -11
  2. package/lib/app/app/Features/Gamification/Leaderboard.js +9 -8
  3. package/lib/app/app/Navigation/index.js +1 -0
  4. package/lib/app/app/Notifications/Onboarding/Notification/index.js +12 -12
  5. package/lib/app/app/Notifications/index.js +31 -30
  6. package/lib/app/app/Points/index.js +19 -13
  7. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +2 -1
  8. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +5 -4
  9. package/lib/app/masters/BetPack/index.js +38 -36
  10. package/lib/app/masters/Points/index.js +24 -16
  11. package/lib/assets/style.css +1 -1
  12. package/lib/hooks/analytics.js +12 -9
  13. package/lib/ui/advertisement/banner/index.js +3 -3
  14. package/lib/ui/advertisement/overlay/externalAd/index.js +7 -7
  15. package/lib/ui/advertisement/overlay/index.js +10 -10
  16. package/lib/ui/button/index.js +2 -2
  17. package/lib/ui/close-btn/index.js +23 -20
  18. package/lib/ui/gamification/detail/header/index.js +8 -8
  19. package/lib/ui/gamification/insight/index.js +6 -6
  20. package/lib/ui/gamification/invite-link/index.js +1 -1
  21. package/lib/ui/gamification/leaderboard/static.js +14 -13
  22. package/lib/ui/gamification/onboarding/index.js +15 -15
  23. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +6 -6
  24. package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +10 -10
  25. package/lib/ui/gamification/question/inapp/notification/index.js +1 -1
  26. package/lib/ui/gamification/question/inapp/onboarding/index.js +10 -9
  27. package/lib/ui/gamification/question/inapp/prediction-result/frames/index.js +27 -27
  28. package/lib/ui/gamification/question/index.js +23 -23
  29. package/lib/ui/gamification/question/insight/index.js +6 -6
  30. package/lib/ui/gamification/question/list/index.js +9 -9
  31. package/lib/ui/gamification/question/notification/index.js +13 -12
  32. package/lib/ui/gamification/question/notification/pill/index.js +7 -7
  33. package/lib/ui/gamification/question/notification/prediction-result/index.js +32 -32
  34. package/lib/ui/gamification/question/twitter/index.js +4 -4
  35. package/lib/ui/gamification/tabs/index.js +8 -8
  36. package/lib/ui/gamification/vote/insight-details/index.js +6 -6
  37. package/lib/ui/gamification/vote/vote-option/index.js +20 -19
  38. package/lib/ui/navigation/button/index.js +9 -8
  39. package/lib/ui/theme/constants.d.ts +1 -0
  40. package/lib/ui/theme/constants.js +2 -1
  41. package/lib/ui/video-player/index.js +1 -0
  42. package/package.json +15 -15
@@ -15,13 +15,13 @@ const W = /* @__PURE__ */ L("div")({
15
15
  const t = o.target;
16
16
  if (t instanceof HTMLAnchorElement && t.target === "_blank") {
17
17
  const r = t.getAttribute("data-promo-id") || "", i = t.getAttribute("data-promo-type") || N.UNSET;
18
- t.getAttribute("data-analytics") === "button" && h.emit("advertisement", {
18
+ t.getAttribute("data-a") === "button" && h.emit("advertisement", {
19
19
  action: "buttonSelect",
20
20
  payload: {
21
21
  id: r,
22
22
  type: i
23
23
  }
24
- }), t.getAttribute("data-analytics") === "banner" && h.emit("advertisement", {
24
+ }), t.getAttribute("data-a") === "banner" && h.emit("advertisement", {
25
25
  action: "bannerSelect",
26
26
  payload: {
27
27
  id: r,
@@ -43,20 +43,20 @@ const W = /* @__PURE__ */ L("div")({
43
43
  controlVideo: v
44
44
  }) => {
45
45
  var y, g, A;
46
- const l = I(null), e = S(o.advertisement.$store);
47
- P(l, {
46
+ const m = I(null), e = S(o.advertisement.$store);
47
+ P(m, {
48
48
  enabled: !!e.data,
49
49
  event: "click",
50
50
  listener: k
51
51
  });
52
- const m = !d && !s;
52
+ const l = !d && !s;
53
53
  if (e.data === void 0 || !p && e.isViewed)
54
54
  return null;
55
55
  const n = ((A = (g = (y = e == null ? void 0 : e.data) == null ? void 0 : y.notification) == null ? void 0 : g.promotion) == null ? void 0 : A.mode) === U.LOWER_THIRD;
56
56
  return /* @__PURE__ */ a(W, {
57
- ref: l,
57
+ ref: m,
58
58
  style: {
59
- height: m ? "auto" : "100%"
59
+ height: l ? "auto" : "100%"
60
60
  },
61
61
  className: b("SL-AdvertisementUIWrap", u && "mobile-view", n && "SL-AdvertisementUIWrap--lower-third"),
62
62
  children: /* @__PURE__ */ a(V, {
@@ -88,7 +88,7 @@ const W = /* @__PURE__ */ L("div")({
88
88
  persistent: p,
89
89
  notification: f
90
90
  }) => {
91
- const v = S(o.featuresList.getStore()), [l, e] = w(!r);
91
+ const v = S(o.featuresList.getStore()), [m, e] = w(!r);
92
92
  if (E(() => {
93
93
  if (r) {
94
94
  const n = document.createElement("script");
@@ -112,9 +112,9 @@ const W = /* @__PURE__ */ L("div")({
112
112
  });
113
113
  if (!v)
114
114
  return null;
115
- const m = o.getFeature(T.GAMES);
116
- return !m || r && !l ? null : /* @__PURE__ */ a(j, {
117
- gamification: m,
115
+ const l = o.getFeature(T.GAMES);
116
+ return !l || r && !m ? null : /* @__PURE__ */ a(j, {
117
+ gamification: l,
118
118
  sidebar: t,
119
119
  banner: i,
120
120
  layoutMode: c,
@@ -22,16 +22,16 @@ const C = /* @__PURE__ */ h("div")({
22
22
  scrollNode: s,
23
23
  scrollStore: p
24
24
  }) => {
25
- const t = u(null), {
25
+ const o = u(null), {
26
26
  data: i,
27
27
  hasMore: d,
28
28
  loading: m,
29
- key: l
29
+ key: a
30
30
  } = n(e.leaderboardList.$store), {
31
- data: o
32
- } = n(e.deepLink.$store), [a, c] = k(t);
31
+ data: t
32
+ } = n(e.deepLink.$store), [l, c] = k(o);
33
33
  return !i.length && !m ? /* @__PURE__ */ r(y, {
34
- deepLink: o
34
+ deepLink: t
35
35
  }) : /* @__PURE__ */ f(L, {
36
36
  children: [/* @__PURE__ */ r(b, {
37
37
  items: i,
@@ -41,10 +41,11 @@ const C = /* @__PURE__ */ h("div")({
41
41
  hasMore: d,
42
42
  openItemDetail: e.openUser,
43
43
  currentUserId: e.currentUserId.get()
44
- }, l), o && /* @__PURE__ */ r(C, {
45
- ref: t,
44
+ }, a), t && /* @__PURE__ */ r(C, {
45
+ ref: o,
46
46
  children: /* @__PURE__ */ r(I, {
47
- onClick: () => a(o),
47
+ "data-a": "intr",
48
+ onClick: () => l(t),
48
49
  title: "Invite Friends",
49
50
  description: "Challenge them now!"
50
51
  })
@@ -47,6 +47,7 @@ const g = () => h, x = /* @__PURE__ */ n(g())({
47
47
  name: "dashboard"
48
48
  }), "Dashboard"]
49
49
  }), /* @__PURE__ */ e(N, {
50
+ "data-a": "intr",
50
51
  onClick: a,
51
52
  children: /* @__PURE__ */ e(j, {
52
53
  name: "icon-cross"
@@ -1,16 +1,16 @@
1
- import { jsxs as S, jsx as e } from "react/jsx-runtime";
2
- import { Container as L, CloseIconWrap as P, CloseIcon as T, Title as f, SponsorLogo as j, PresentsTitle as k, Subtitle as r, Description as E, ActionButton as I } from "./styles.js";
3
- const y = ({ close: i, action: x, onboarding: t }) => {
4
- var l, s, c, C, p, h, m, u;
5
- return /* @__PURE__ */ S(L, { children: [
6
- /* @__PURE__ */ e(P, { onClick: i, children: /* @__PURE__ */ e(T, { name: "icon-cross" }) }),
7
- ((s = (l = t == null ? void 0 : t.titleCard) == null ? void 0 : l.media) == null ? void 0 : s.sponsorLogo) && /* @__PURE__ */ S(f, { children: [
8
- /* @__PURE__ */ e(j, { alt: "sponsor-logo", src: (C = (c = t == null ? void 0 : t.titleCard) == null ? void 0 : c.media) == null ? void 0 : C.sponsorLogo }),
9
- /* @__PURE__ */ e(k, { children: "PRESENTS" })
1
+ import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
+ import { Container as x, CloseIconWrap as L, CloseIcon as P, Title as T, SponsorLogo as f, PresentsTitle as j, Subtitle as k, Description as E, ActionButton as I } from "./styles.js";
3
+ const y = ({ close: r, action: S, onboarding: t }) => {
4
+ var l, s, c, C, p, h, m, i;
5
+ return /* @__PURE__ */ u(x, { children: [
6
+ /* @__PURE__ */ e(L, { "data-a": "intr", onClick: r, children: /* @__PURE__ */ e(P, { name: "icon-cross" }) }),
7
+ ((s = (l = t == null ? void 0 : t.titleCard) == null ? void 0 : l.media) == null ? void 0 : s.sponsorLogo) && /* @__PURE__ */ u(T, { children: [
8
+ /* @__PURE__ */ e(f, { alt: "sponsor-logo", src: (C = (c = t == null ? void 0 : t.titleCard) == null ? void 0 : c.media) == null ? void 0 : C.sponsorLogo }),
9
+ /* @__PURE__ */ e(j, { children: "PRESENTS" })
10
10
  ] }),
11
- ((p = t == null ? void 0 : t.titleCard) == null ? void 0 : p.title) && /* @__PURE__ */ e(r, { children: (h = t == null ? void 0 : t.titleCard) == null ? void 0 : h.title }),
12
- ((m = t == null ? void 0 : t.titleCard) == null ? void 0 : m.subtitle) && /* @__PURE__ */ e(E, { children: (u = t == null ? void 0 : t.titleCard) == null ? void 0 : u.subtitle }),
13
- /* @__PURE__ */ e(I, { onClick: x, children: "Play Now" })
11
+ ((p = t == null ? void 0 : t.titleCard) == null ? void 0 : p.title) && /* @__PURE__ */ e(k, { children: (h = t == null ? void 0 : t.titleCard) == null ? void 0 : h.title }),
12
+ ((m = t == null ? void 0 : t.titleCard) == null ? void 0 : m.subtitle) && /* @__PURE__ */ e(E, { children: (i = t == null ? void 0 : t.titleCard) == null ? void 0 : i.subtitle }),
13
+ /* @__PURE__ */ e(I, { "data-a": "intr", onClick: S, children: "Play Now" })
14
14
  ] });
15
15
  };
16
16
  export {
@@ -13,26 +13,26 @@ import { PredictionResult as C } from "../../../ui/gamification/question/notific
13
13
  import { Onboarding as x } from "./Onboarding/index.js";
14
14
  import { HiddenContainer as P, Container as z, InnerContainer as B, NotificationRefreshing as H, Pill as S } from "./styles.js";
15
15
  const v = (n) => {
16
- const [e, d] = k(0), i = E(null), l = D(() => new ResizeObserver((o) => {
16
+ const [e, d] = k(0), i = E(null), l = D(() => new ResizeObserver((r) => {
17
17
  window.requestAnimationFrame(() => {
18
18
  var f;
19
- if (Array.isArray(o)) {
20
- for (const c of o)
19
+ if (Array.isArray(r)) {
20
+ for (const c of r)
21
21
  if (c.contentBoxSize) {
22
- const r = (f = i.current) == null ? void 0 : f.getBoundingClientRect();
23
- r && d(r.height);
22
+ const o = (f = i.current) == null ? void 0 : f.getBoundingClientRect();
23
+ o && d(o.height);
24
24
  }
25
25
  }
26
26
  });
27
- }), []), s = I((o) => {
28
- i.current = o;
29
- }, []), a = I((o) => {
30
- d(o);
27
+ }), []), s = I((r) => {
28
+ i.current = r;
29
+ }, []), a = I((r) => {
30
+ d(r);
31
31
  }, []);
32
32
  return h(() => {
33
- const o = i.current;
34
- return o ? (l.observe(o), () => {
35
- l.unobserve(o);
33
+ const r = i.current;
34
+ return r ? (l.observe(r), () => {
35
+ l.unobserve(r);
36
36
  }) : () => {
37
37
  };
38
38
  }, [n]), h(() => () => {
@@ -52,17 +52,17 @@ const v = (n) => {
52
52
  keys: ["sdkInDesktopView"]
53
53
  }), {
54
54
  sdk: a
55
- } = O(), [o, f, c] = v(e.id);
56
- let r = f;
57
- return l || (r = "auto"), e.type === p.QUESTION ? /* @__PURE__ */ w(b, {
55
+ } = O(), [r, f, c] = v(e.id);
56
+ let o = f;
57
+ return l || (o = "auto"), e.type === p.QUESTION ? /* @__PURE__ */ w(b, {
58
58
  children: [/* @__PURE__ */ u(P, {
59
- ref: o,
59
+ ref: r,
60
60
  children: /* @__PURE__ */ u(N, {
61
61
  ...e
62
62
  })
63
63
  }), /* @__PURE__ */ w(z, {
64
64
  style: {
65
- height: e.hiding ? 0 : r
65
+ height: e.hiding ? 0 : o
66
66
  },
67
67
  hiding: e.hiding,
68
68
  children: [/* @__PURE__ */ u(B, {
@@ -85,7 +85,7 @@ const v = (n) => {
85
85
  ...e.data.question
86
86
  }) : e.type === p.ONBOARDING ? /* @__PURE__ */ u(x, {
87
87
  style: {
88
- height: e.hiding ? 0 : r
88
+ height: e.hiding ? 0 : o
89
89
  },
90
90
  saveHeight: c,
91
91
  sdk: n,
@@ -105,7 +105,7 @@ const v = (n) => {
105
105
  }) => {
106
106
  var t, m;
107
107
  const {
108
- screen: o
108
+ screen: r
109
109
  } = y(s, {
110
110
  keys: ["screen"]
111
111
  }), {
@@ -117,21 +117,22 @@ const v = (n) => {
117
117
  h(() => {
118
118
  s.get().sdkInDesktopView ? c < 50 && e(null) : c > -50 && e(null);
119
119
  }, [c, s, e]);
120
- const r = s.get().sdkInDesktopView ? d : i;
121
- return !n || !r.current ? null : q.createPortal(/* @__PURE__ */ u(S, {
120
+ const o = s.get().sdkInDesktopView ? d : i;
121
+ return !n || !o.current ? null : q.createPortal(/* @__PURE__ */ u(S, {
122
122
  title: n.type === p.QUESTION_RESOLVED ? "Prediction result" : `New ${((m = A[(t = n.data) == null ? void 0 : t.questionType]) == null ? void 0 : m.label) || "notification"}`,
123
+ "data-a": "intr",
123
124
  onClick: () => {
124
125
  var g;
125
126
  s.get().sdkInDesktopView ? (g = l.current) == null || g.scrollTo({
126
127
  top: 0,
127
128
  behavior: "smooth"
128
- }) : T(d, o.size, {
129
+ }) : T(d, r.size, {
129
130
  behavior: "smooth"
130
131
  }), e(null);
131
132
  },
132
133
  className: V(f && F, "sl-pill-button")
133
- }), r.current);
134
- }, oe = ({
134
+ }), o.current);
135
+ }, re = ({
135
136
  sdk: n,
136
137
  headerNode: e,
137
138
  scrollNode: d,
@@ -140,7 +141,7 @@ const v = (n) => {
140
141
  scrollStore: s,
141
142
  hasActiveFeature: a
142
143
  }) => {
143
- const [o] = k(n.getNotificationsStore()), f = y(o), [c, r] = k(null), t = D(() => n.getActiveNotification(), [n, f]);
144
+ const [r] = k(n.getNotificationsStore()), f = y(r), [c, o] = k(null), t = D(() => n.getActiveNotification(), [n, f]);
144
145
  return h(() => {
145
146
  t && R.emit("notification", {
146
147
  action: "rendered",
@@ -154,11 +155,11 @@ const v = (n) => {
154
155
  sdkInDesktopView: m,
155
156
  sdkInView: g
156
157
  } = i.get();
157
- t && (m || g) && (!m && g && r(t), m && window.requestAnimationFrame(() => {
158
- s.get().scrollPosition !== 0 && r(t);
158
+ t && (m || g) && (!m && g && o(t), m && window.requestAnimationFrame(() => {
159
+ s.get().scrollPosition !== 0 && o(t);
159
160
  }));
160
161
  }, [t]), h(() => {
161
- t || r(null);
162
+ t || o(null);
162
163
  }, [t]), /* @__PURE__ */ w(b, {
163
164
  children: [!c && t && /* @__PURE__ */ u(Q, {
164
165
  appNode: l,
@@ -168,7 +169,7 @@ const v = (n) => {
168
169
  responsiveStore: i
169
170
  }), c && /* @__PURE__ */ u(U, {
170
171
  pill: c,
171
- setPill: r,
172
+ setPill: o,
172
173
  appNode: l,
173
174
  notification: t,
174
175
  headerNode: e,
@@ -179,5 +180,5 @@ const v = (n) => {
179
180
  });
180
181
  };
181
182
  export {
182
- oe as SDKNotifications
183
+ re as SDKNotifications
183
184
  };
@@ -1,34 +1,40 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { useState as a, useEffect as c } from "react";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { useState as p, useEffect as c } from "react";
3
3
  import { useStore as l } from "@streamlayer/react-polyfills";
4
- import { FeatureStatus as u, eventBus as i } from "@streamlayer/sdk-web-interfaces";
4
+ import { FeatureStatus as u, eventBus as s } from "@streamlayer/sdk-web-interfaces";
5
5
  import { FeatureType as f } from "@streamlayer/sdk-web-types";
6
- import { Points as S } from "../../../ui/gamification/points/index.js";
7
- const y = ({ gamification: e }) => {
8
- const o = e.userSummary.$store, [t, p] = a(0);
6
+ import { Points as y } from "../../../ui/gamification/points/index.js";
7
+ const S = ({ gamification: e }) => {
8
+ const n = e.userSummary.$store, [t, m] = p(0);
9
9
  return c(() => {
10
- const r = o.subscribe((s) => {
11
- var n;
12
- (n = s == null ? void 0 : s.summary) != null && n.points && p(s.summary.points);
10
+ const r = n.subscribe((o) => {
11
+ var i;
12
+ (i = o == null ? void 0 : o.summary) != null && i.points && m(o.summary.points);
13
13
  });
14
14
  return () => {
15
15
  r();
16
16
  };
17
- }, [o]), /* @__PURE__ */ m(S, { points: t, onClick: () => {
17
+ }, [n]), /* @__PURE__ */ a(y, { points: t, onClick: () => {
18
18
  const r = e.status.get();
19
- r === u.Suspended ? (e.openFeature(), i.emit("app", {
19
+ r === u.Suspended ? (e.openFeature(), s.emit("app", {
20
20
  action: "open",
21
21
  payload: {}
22
- })) : r === u.Ready && (e.closeFeature(!1), i.emit("app", {
22
+ }), s.emit("interactions", {
23
+ action: "tap",
24
+ payload: {}
25
+ })) : r === u.Ready && (e.closeFeature(!1), s.emit("app", {
23
26
  action: "close",
24
27
  payload: {}
28
+ }), s.emit("interactions", {
29
+ action: "tap",
30
+ payload: {}
25
31
  }));
26
32
  } });
27
33
  }, k = ({ sdk: e }) => {
28
34
  if (!l(e.featuresList.getStore()))
29
35
  return null;
30
36
  const t = e.getFeature(f.GAMES);
31
- return t ? /* @__PURE__ */ m(y, { gamification: t }) : null;
37
+ return t ? /* @__PURE__ */ a(S, { gamification: t }) : null;
32
38
  };
33
39
  export {
34
40
  k as StreamLayerSDKPoints
@@ -17,6 +17,7 @@ const E = ({ onEvent: s, height: r }) => {
17
17
  /* @__PURE__ */ e(
18
18
  o,
19
19
  {
20
+ "data-a": "intr",
20
21
  onClick: () => {
21
22
  d(
22
23
  1
@@ -30,7 +31,7 @@ const E = ({ onEvent: s, height: r }) => {
30
31
  ] }) }, "end") : /* @__PURE__ */ e(t, { height: r, children: /* @__PURE__ */ n(i, { children: [
31
32
  /* @__PURE__ */ e(h, { src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/bet_pack_end_screen.png" }),
32
33
  /* @__PURE__ */ e(c, { children: "Look for more live match insights, predictions and more." }),
33
- /* @__PURE__ */ e(o, { onClick: () => s({ type: "slOpenGameCenter" }), children: "Open Game Center" })
34
+ /* @__PURE__ */ e(o, { "data-a": "intr", onClick: () => s({ type: "slOpenGameCenter" }), children: "Open Game Center" })
34
35
  ] }) }, "end");
35
36
  };
36
37
  export {
@@ -1,10 +1,10 @@
1
1
  import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
2
  import { ScreenContainer as i } from "../ScreenContainer/index.js";
3
- import { S as c, e as s, a, b as l, c as S, d } from "../../../../../styles-BfnMua4o.js";
3
+ import { S as a, e as c, a as s, b as l, c as S, d } from "../../../../../styles-BfnMua4o.js";
4
4
  import { StartScreenSponsor as h, NextButton as p, IconArrowRight as m, StartScreenNote as f } from "./styles.js";
5
- const v = ({ countQuestionsAvailable: t, sliderRef: o }) => /* @__PURE__ */ e(i, { children: /* @__PURE__ */ r(c, { children: [
6
- /* @__PURE__ */ e(s, {}),
7
- /* @__PURE__ */ r(a, { children: [
5
+ const v = ({ countQuestionsAvailable: t, sliderRef: o }) => /* @__PURE__ */ e(i, { children: /* @__PURE__ */ r(a, { children: [
6
+ /* @__PURE__ */ e(c, {}),
7
+ /* @__PURE__ */ r(s, { children: [
8
8
  /* @__PURE__ */ e(h, { children: "FEATURED GROUPS+" }),
9
9
  /* @__PURE__ */ e(l, { children: "The First Five" })
10
10
  ] }),
@@ -12,6 +12,7 @@ const v = ({ countQuestionsAvailable: t, sliderRef: o }) => /* @__PURE__ */ e(i,
12
12
  /* @__PURE__ */ r(
13
13
  d,
14
14
  {
15
+ "data-a": "intr",
15
16
  onClick: () => {
16
17
  var n;
17
18
  (n = o.current) == null || n.slideNext();
@@ -1,67 +1,69 @@
1
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
2
  import { cx as P } from "@linaria/core";
3
- import { forwardRef as b, useState as B, useCallback as F, memo as H, useMemo as L } from "react";
4
- import { useStore as k } from "@streamlayer/react-polyfills";
3
+ import { forwardRef as b, useState as y, useCallback as I, memo as F, useMemo as H, useEffect as L } from "react";
4
+ import { useStore as B } from "@streamlayer/react-polyfills";
5
5
  import { FeatureType as p } from "@streamlayer/sdk-web-types";
6
- import { BetPackContent as I } from "./BetPackContent/index.js";
7
- import { EmergencyScreen as M } from "./BetPackContent/EmergencyScreen/index.js";
6
+ import { BetPackContent as M } from "./BetPackContent/index.js";
7
+ import { EmergencyScreen as O } from "./BetPackContent/EmergencyScreen/index.js";
8
8
  import { LoaderScreen as x } from "./BetPackContent/LoaderScreen/index.js";
9
9
  import { BetPackContainer as R } from "./styles.js";
10
10
  import { defaultEventHandler as j } from "./utils.js";
11
- import { SvgIcon as y } from "../../../ui/icons/index.js";
12
- import { Container as G, Header as T, HeaderTitle as z, CloseButton as O, Main as U, Footer as Y, SlideSwitchButton as C, IconArrowPrev as q, buttonAvailable as g, IconArrowNext as D } from "./BetPackOverlay/styles.js";
13
- const er = b(({ sdk: n, onEvent: i, close: t }, a) => {
14
- const [e, d] = B(), [o, h] = B(), N = F(
11
+ import { SvgIcon as k } from "../../../ui/icons/index.js";
12
+ import { Container as G, Header as T, HeaderTitle as z, CloseButton as U, Main as Y, Footer as q, SlideSwitchButton as C, IconArrowPrev as D, buttonAvailable as g, IconArrowNext as J } from "./BetPackOverlay/styles.js";
13
+ const nr = b(({ sdk: c, onEvent: a, close: t }, i) => {
14
+ const [o, m] = y(), [e, h] = y(), w = I(
15
15
  (l) => {
16
16
  if (l.type === "slBetPackReady") {
17
- const { next: s, prev: u, current: f, canNext: w, canPrev: A } = l.payload || {};
18
- d({ next: s, prev: u }), h((c) => ({
19
- current: c != null && c.current ? c == null ? void 0 : c.current : f,
20
- canPrev: c != null && c.current ? c == null ? void 0 : c.canPrev : A,
21
- canNext: w
17
+ const { next: s, prev: u, current: f, canNext: N, canPrev: A } = l.payload || {};
18
+ m({ next: s, prev: u }), h((n) => ({
19
+ current: n != null && n.current ? n == null ? void 0 : n.current : f,
20
+ canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev : A,
21
+ canNext: N
22
22
  }));
23
23
  }
24
24
  if (l.type === "slBetPackChangeCard") {
25
25
  const { current: s, canNext: u, canPrev: f } = l.payload || {};
26
26
  h({ current: s, canNext: u, canPrev: f });
27
27
  }
28
- i == null || i(l);
28
+ a == null || a(l);
29
29
  },
30
- [i]
30
+ [a]
31
31
  );
32
- return /* @__PURE__ */ m(G, { ref: a, children: [
33
- /* @__PURE__ */ m(T, { children: [
34
- /* @__PURE__ */ m(z, { children: [
35
- /* @__PURE__ */ r(y, { name: "fgIcon" }),
32
+ return /* @__PURE__ */ d(G, { ref: i, children: [
33
+ /* @__PURE__ */ d(T, { children: [
34
+ /* @__PURE__ */ d(z, { children: [
35
+ /* @__PURE__ */ r(k, { name: "fgIcon" }),
36
36
  "Featured Groups+"
37
37
  ] }),
38
- /* @__PURE__ */ r(O, { onClick: t, children: /* @__PURE__ */ r(y, { name: "icon-close-btn-gray" }) })
38
+ /* @__PURE__ */ r(U, { "data-a": "intr", onClick: t, children: /* @__PURE__ */ r(k, { name: "icon-close-btn-gray" }) })
39
39
  ] }),
40
- /* @__PURE__ */ r(U, { children: /* @__PURE__ */ r(K, { sdk: n, onEvent: N, overlay: !0 }) }),
41
- /* @__PURE__ */ m(Y, { children: [
42
- /* @__PURE__ */ r(C, { onClick: e == null ? void 0 : e.prev, disabled: !(o != null && o.canPrev), children: /* @__PURE__ */ r(q, { name: "iconArrowPrev", className: P((o == null ? void 0 : o.canPrev) && g) }) }),
43
- /* @__PURE__ */ r(C, { onClick: e == null ? void 0 : e.next, disabled: !(o != null && o.canNext), children: /* @__PURE__ */ r(D, { name: "iconArrowPrev", className: P((o == null ? void 0 : o.canNext) && g) }) })
40
+ /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(Q, { sdk: c, onEvent: w, overlay: !0 }) }),
41
+ /* @__PURE__ */ d(q, { children: [
42
+ /* @__PURE__ */ r(C, { "data-a": "intr", onClick: o == null ? void 0 : o.prev, disabled: !(e != null && e.canPrev), children: /* @__PURE__ */ r(D, { "data-a": "intr", name: "iconArrowPrev", className: P((e == null ? void 0 : e.canPrev) && g) }) }),
43
+ /* @__PURE__ */ r(C, { "data-a": "intr", onClick: o == null ? void 0 : o.next, disabled: !(e != null && e.canNext), children: /* @__PURE__ */ r(J, { "data-a": "intr", name: "iconArrowPrev", className: P((e == null ? void 0 : e.canNext) && g) }) })
44
44
  ] })
45
45
  ] });
46
- }), J = ({ user: n, gamification: i, overlay: t, swipeable: a, onEvent: e }) => n.data ? i ? /* @__PURE__ */ r(I, { overlay: t, gamification: i, onEvent: e, swipeable: a }) : /* @__PURE__ */ r(x, {}) : n.error && !n.loading ? /* @__PURE__ */ r(
47
- M,
46
+ }), K = ({ user: c, gamification: a, overlay: t, swipeable: i, onEvent: o }) => c.data ? a ? /* @__PURE__ */ r(M, { overlay: t, gamification: a, onEvent: o, swipeable: i }) : /* @__PURE__ */ r(x, {}) : c.error && !c.loading ? /* @__PURE__ */ r(
47
+ O,
48
48
  {
49
- onEvent: e,
50
- actionFn: () => e({ type: "slHardRefresh" }),
49
+ onEvent: o,
50
+ actionFn: () => o({ type: "slHardRefresh" }),
51
51
  description: `You are not authorized to
52
52
  view this resource.`
53
53
  }
54
- ) : /* @__PURE__ */ r(x, {}), K = H(({ sdk: n, swipeable: i = !0, onEvent: t = j, overlay: a }) => {
55
- const e = k(n.featuresList.getStore()), d = L(() => n.getFeature(p.GAMES), [e]), o = k(n.getUserStore());
56
- return /* @__PURE__ */ r(
54
+ ) : /* @__PURE__ */ r(x, {}), Q = F(({ sdk: c, swipeable: a = !0, onEvent: t = j, overlay: i }) => {
55
+ const o = B(c.featuresList.getStore()), m = H(() => c.getFeature(p.GAMES), [o]), e = B(c.getUserStore());
56
+ return L(() => (c.writeOverlaySessionId(), () => {
57
+ c.writeOverlaySessionId("");
58
+ }), []), /* @__PURE__ */ r(
57
59
  R,
58
60
  {
59
- className: P("SL-BetPack", a && "SL-BetPack--overlay", !a && "SL-BetPack--standalone"),
60
- children: /* @__PURE__ */ r(J, { overlay: a, user: o, gamification: d, onEvent: t, swipeable: i })
61
+ className: P("SL-BetPack", i && "SL-BetPack--overlay", !i && "SL-BetPack--standalone"),
62
+ children: /* @__PURE__ */ r(K, { overlay: i, user: e, gamification: m, onEvent: t, swipeable: a })
61
63
  }
62
64
  );
63
65
  });
64
66
  export {
65
- K as BetPack,
66
- er as BetPackOverlay
67
+ Q as BetPack,
68
+ nr as BetPackOverlay
67
69
  };
@@ -1,25 +1,33 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { useState as m, useEffect as f } from "react";
3
- import { useStore as c } from "@streamlayer/react-polyfills";
4
- import { FeatureType as p } from "@streamlayer/sdk-web-types";
5
- import { Points as S } from "../../../ui/gamification/points/index.js";
6
- const a = ({ gamification: r }) => {
7
- const o = r.userSummary.$store, [t, u] = m(0);
8
- return f(() => {
9
- const i = o.subscribe((e) => {
2
+ import { useState as c, useEffect as a, useCallback as f } from "react";
3
+ import { useStore as p } from "@streamlayer/react-polyfills";
4
+ import { eventBus as l } from "@streamlayer/sdk-web-interfaces";
5
+ import { FeatureType as S } from "@streamlayer/sdk-web-types";
6
+ import { Points as y } from "../../../ui/gamification/points/index.js";
7
+ const P = ({ gamification: t }) => {
8
+ const o = t.userSummary.$store, [r, i] = c(0);
9
+ a(() => {
10
+ const u = o.subscribe((e) => {
10
11
  var s;
11
- (s = e == null ? void 0 : e.summary) != null && s.points && u(e.summary.points);
12
+ (s = e == null ? void 0 : e.summary) != null && s.points && i(e.summary.points);
12
13
  });
13
14
  return () => {
14
- i();
15
+ u();
15
16
  };
16
- }, [o]), /* @__PURE__ */ n(S, { points: t });
17
- }, b = ({ sdk: r }) => {
18
- if (!c(r.featuresList.getStore()))
17
+ }, [o]);
18
+ const m = f(() => {
19
+ l.emit("interactions", {
20
+ action: "tap",
21
+ payload: {}
22
+ });
23
+ }, []);
24
+ return /* @__PURE__ */ n(y, { onClick: m, points: r });
25
+ }, x = ({ sdk: t }) => {
26
+ if (!p(t.featuresList.getStore()))
19
27
  return null;
20
- const t = r.getFeature(p.GAMES);
21
- return t ? /* @__PURE__ */ n(a, { gamification: t }) : null;
28
+ const r = t.getFeature(S.GAMES);
29
+ return r ? /* @__PURE__ */ n(P, { gamification: r }) : null;
22
30
  };
23
31
  export {
24
- b as StreamLayerSDKPoints
32
+ x as StreamLayerSDKPoints
25
33
  };