@streamlayer/react-ui 1.22.6 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/app/Advertisement/index.js +11 -11
- package/lib/app/app/Features/Gamification/Leaderboard.js +9 -8
- package/lib/app/app/Navigation/index.js +1 -0
- package/lib/app/app/Notifications/Onboarding/Notification/index.js +12 -12
- package/lib/app/app/Notifications/index.js +31 -30
- package/lib/app/app/Points/index.js +19 -13
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +2 -1
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +5 -4
- package/lib/app/masters/BetPack/index.js +38 -36
- package/lib/assets/style.css +1 -1
- package/lib/hooks/analytics.js +12 -9
- package/lib/ui/advertisement/banner/index.js +3 -3
- package/lib/ui/advertisement/overlay/externalAd/index.js +7 -7
- package/lib/ui/advertisement/overlay/index.js +10 -10
- package/lib/ui/button/index.js +2 -2
- package/lib/ui/close-btn/index.js +23 -20
- package/lib/ui/gamification/detail/header/index.js +8 -8
- package/lib/ui/gamification/insight/index.js +6 -6
- package/lib/ui/gamification/invite-link/index.js +1 -1
- package/lib/ui/gamification/leaderboard/static.js +14 -13
- package/lib/ui/gamification/onboarding/index.js +15 -15
- package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +6 -6
- package/lib/ui/gamification/onboarding/slides/onboarding-rules/index.js +10 -10
- package/lib/ui/gamification/question/inapp/notification/index.js +1 -1
- package/lib/ui/gamification/question/inapp/onboarding/index.js +10 -9
- package/lib/ui/gamification/question/inapp/prediction-result/frames/index.js +27 -27
- package/lib/ui/gamification/question/index.js +23 -23
- package/lib/ui/gamification/question/insight/index.js +6 -6
- package/lib/ui/gamification/question/list/index.js +9 -9
- package/lib/ui/gamification/question/notification/index.js +13 -12
- package/lib/ui/gamification/question/notification/insight/index.js +11 -11
- package/lib/ui/gamification/question/notification/pill/index.js +5 -5
- package/lib/ui/gamification/question/notification/prediction-result/index.js +32 -32
- package/lib/ui/gamification/question/notification/tweet/index.js +3 -3
- package/lib/ui/gamification/question/twitter/index.js +4 -4
- package/lib/ui/gamification/tabs/index.js +8 -8
- package/lib/ui/gamification/vote/insight-details/index.js +6 -6
- package/lib/ui/gamification/vote/vote-option/index.js +20 -19
- package/lib/ui/navigation/button/index.js +9 -8
- package/lib/ui/theme/constants.d.ts +1 -0
- package/lib/ui/theme/constants.js +2 -1
- package/lib/ui/video-player/index.js +1 -0
- 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-
|
|
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-
|
|
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
|
|
47
|
-
P(
|
|
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
|
|
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:
|
|
57
|
+
ref: m,
|
|
58
58
|
style: {
|
|
59
|
-
height:
|
|
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()), [
|
|
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
|
|
116
|
-
return !
|
|
117
|
-
gamification:
|
|
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
|
|
25
|
+
const o = u(null), {
|
|
26
26
|
data: i,
|
|
27
27
|
hasMore: d,
|
|
28
28
|
loading: m,
|
|
29
|
-
key:
|
|
29
|
+
key: a
|
|
30
30
|
} = n(e.leaderboardList.$store), {
|
|
31
|
-
data:
|
|
32
|
-
} = n(e.deepLink.$store), [
|
|
31
|
+
data: t
|
|
32
|
+
} = n(e.deepLink.$store), [l, c] = k(o);
|
|
33
33
|
return !i.length && !m ? /* @__PURE__ */ r(y, {
|
|
34
|
-
deepLink:
|
|
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
|
-
},
|
|
45
|
-
ref:
|
|
44
|
+
}, a), t && /* @__PURE__ */ r(C, {
|
|
45
|
+
ref: o,
|
|
46
46
|
children: /* @__PURE__ */ r(I, {
|
|
47
|
-
|
|
47
|
+
"data-a": "intr",
|
|
48
|
+
onClick: () => l(t),
|
|
48
49
|
title: "Invite Friends",
|
|
49
50
|
description: "Challenge them now!"
|
|
50
51
|
})
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Container as
|
|
3
|
-
const y = ({ close:
|
|
4
|
-
var l, s, c, C, p, h, m,
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */ e(
|
|
7
|
-
((s = (l = t == null ? void 0 : t.titleCard) == null ? void 0 : l.media) == null ? void 0 : s.sponsorLogo) && /* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */ e(
|
|
9
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
12
|
-
((m = t == null ? void 0 : t.titleCard) == null ? void 0 : m.subtitle) && /* @__PURE__ */ e(E, { children: (
|
|
13
|
-
/* @__PURE__ */ e(I, { onClick:
|
|
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((
|
|
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(
|
|
20
|
-
for (const c of
|
|
19
|
+
if (Array.isArray(r)) {
|
|
20
|
+
for (const c of r)
|
|
21
21
|
if (c.contentBoxSize) {
|
|
22
|
-
const
|
|
23
|
-
|
|
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((
|
|
28
|
-
i.current =
|
|
29
|
-
}, []), a = I((
|
|
30
|
-
d(
|
|
27
|
+
}), []), s = I((r) => {
|
|
28
|
+
i.current = r;
|
|
29
|
+
}, []), a = I((r) => {
|
|
30
|
+
d(r);
|
|
31
31
|
}, []);
|
|
32
32
|
return h(() => {
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
l.unobserve(
|
|
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(), [
|
|
56
|
-
let
|
|
57
|
-
return l || (
|
|
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:
|
|
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 :
|
|
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 :
|
|
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:
|
|
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
|
|
121
|
-
return !n || !
|
|
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,
|
|
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
|
-
}),
|
|
134
|
-
},
|
|
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 [
|
|
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 &&
|
|
158
|
-
s.get().scrollPosition !== 0 &&
|
|
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 ||
|
|
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:
|
|
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
|
-
|
|
183
|
+
re as SDKNotifications
|
|
183
184
|
};
|
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
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
|
|
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
|
|
7
|
-
const
|
|
8
|
-
const
|
|
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 =
|
|
11
|
-
var
|
|
12
|
-
(
|
|
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
|
-
}, [
|
|
17
|
+
}, [n]), /* @__PURE__ */ a(y, { points: t, onClick: () => {
|
|
18
18
|
const r = e.status.get();
|
|
19
|
-
r === u.Suspended ? (e.openFeature(),
|
|
19
|
+
r === u.Suspended ? (e.openFeature(), s.emit("app", {
|
|
20
20
|
action: "open",
|
|
21
21
|
payload: {}
|
|
22
|
-
})
|
|
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__ */
|
|
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
|
|
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(
|
|
6
|
-
/* @__PURE__ */ e(
|
|
7
|
-
/* @__PURE__ */ r(
|
|
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
|
|
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
|
|
4
|
-
import { useStore as
|
|
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
|
|
7
|
-
import { EmergencyScreen as
|
|
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
|
|
12
|
-
import { Container as G, Header as T, HeaderTitle as z, CloseButton as
|
|
13
|
-
const
|
|
14
|
-
const [
|
|
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:
|
|
18
|
-
|
|
19
|
-
current:
|
|
20
|
-
canPrev:
|
|
21
|
-
canNext:
|
|
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
|
-
|
|
28
|
+
a == null || a(l);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[a]
|
|
31
31
|
);
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */ r(
|
|
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(
|
|
38
|
+
/* @__PURE__ */ r(U, { "data-a": "intr", onClick: t, children: /* @__PURE__ */ r(k, { name: "icon-close-btn-gray" }) })
|
|
39
39
|
] }),
|
|
40
|
-
/* @__PURE__ */ r(
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */ r(C, { onClick:
|
|
43
|
-
/* @__PURE__ */ r(C, { onClick:
|
|
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
|
-
}),
|
|
47
|
-
|
|
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:
|
|
50
|
-
actionFn: () =>
|
|
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, {}),
|
|
55
|
-
const
|
|
56
|
-
return
|
|
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",
|
|
60
|
-
children: /* @__PURE__ */ r(
|
|
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
|
-
|
|
66
|
-
|
|
67
|
+
Q as BetPack,
|
|
68
|
+
nr as BetPackOverlay
|
|
67
69
|
};
|