@streamlayer/react-ui 1.22.3 → 1.22.5
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/masters/BetPack/BetPackContent/EmergencyScreen/styles.js +1 -1
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +1 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +3 -3
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +4 -3
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +17 -18
- package/lib/app/masters/BetPack/BetPackContent/index.js +335 -87
- package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +95 -3
- package/lib/app/masters/BetPack/BetPackContent/styles.js +11 -57
- package/lib/app/masters/Features/Gamification/index.d.ts +1 -0
- package/lib/app/masters/Features/Gamification/index.js +36 -30
- package/lib/app/masters/Features/index.d.ts +1 -0
- package/lib/app/masters/Features/index.js +13 -12
- package/lib/app/masters/Notifications/index.d.ts +1 -0
- package/lib/app/masters/Notifications/index.js +97 -94
- package/lib/app/masters/Points/index.js +16 -25
- package/lib/app/masters/masters.d.ts +1 -0
- package/lib/app/masters/masters.js +71 -60
- package/lib/app/masters/story/index.d.ts +0 -1
- package/lib/app/masters/story/index.js +25 -37
- package/lib/app/masters/styles.d.ts +1 -0
- package/lib/app/masters/styles.js +16 -15
- package/lib/app/masters/useSdkResponsive.js +20 -19
- package/lib/app/masters/useSdkScroll.d.ts +1 -1
- package/lib/app/masters/useSdkScroll.js +33 -33
- package/lib/assets/style.css +1 -1
- package/lib/styles-BfnMua4o.js +2841 -0
- package/lib/ui/advertisement/overlay/externalAd/index.js +49 -41
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +11 -2
- package/lib/ui/advertisement/overlay/externalAd/styles.js +55 -38
- package/lib/ui/gamification/question/notification/prediction-result/index.js +43 -43
- package/lib/ui/modal/index.d.ts +1 -0
- package/lib/ui/modal/index.js +36 -31
- package/lib/ui/questions/insight/index.js +24 -16
- package/lib/ui/questions/insight/styles.d.ts +1 -0
- package/lib/ui/questions/insight/styles.js +14 -13
- package/lib/ui/theme/constants.d.ts +2 -0
- package/lib/ui/theme/constants.js +6 -4
- package/lib/ui/theme/masters-theme.js +7 -4
- package/lib/ui/theme/theme.js +3 -0
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +29 -28
- package/package.json +16 -17
- package/lib/app/masters/BetPack/BetPackContent/constants.d.ts +0 -13
- package/lib/app/masters/BetPack/BetPackContent/constants.js +0 -22
- package/lib/app/masters/BetPack/typings.d.js +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { useState as l } from "react";
|
|
3
3
|
import { ScreenContainer as t } from "../ScreenContainer/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import { EndScreenSponsorIcon as
|
|
4
|
+
import { S as i, a as m, b as p, c, d as o } from "../../../../../styles-BfnMua4o.js";
|
|
5
|
+
import { EndScreenSponsorIcon as S, EndScreenMedia as h } from "./styles.js";
|
|
6
6
|
const E = ({ onEvent: s, height: r }) => {
|
|
7
|
-
const [
|
|
7
|
+
const [a, d] = l(
|
|
8
8
|
0
|
|
9
9
|
/* FIRST */
|
|
10
10
|
);
|
|
11
|
-
return
|
|
12
|
-
/* @__PURE__ */ e(
|
|
11
|
+
return a === 0 ? /* @__PURE__ */ e(t, { height: r, children: /* @__PURE__ */ n(i, { children: [
|
|
12
|
+
/* @__PURE__ */ e(S, {}),
|
|
13
13
|
/* @__PURE__ */ n(m, { children: [
|
|
14
14
|
/* @__PURE__ */ e(p, { children: "Great picks!" }),
|
|
15
15
|
/* @__PURE__ */ e(c, { children: "Stay in the Enhanced Stream for live results, predictions, trivia, polls, and match insights." })
|
|
@@ -18,7 +18,7 @@ const E = ({ onEvent: s, height: r }) => {
|
|
|
18
18
|
o,
|
|
19
19
|
{
|
|
20
20
|
onClick: () => {
|
|
21
|
-
|
|
21
|
+
d(
|
|
22
22
|
1
|
|
23
23
|
/* LAST */
|
|
24
24
|
);
|
|
@@ -28,7 +28,7 @@ const E = ({ onEvent: s, height: r }) => {
|
|
|
28
28
|
}
|
|
29
29
|
)
|
|
30
30
|
] }) }, "end") : /* @__PURE__ */ e(t, { height: r, children: /* @__PURE__ */ n(i, { children: [
|
|
31
|
-
/* @__PURE__ */ e(
|
|
31
|
+
/* @__PURE__ */ e(h, { src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/bet_pack_end_screen.png" }),
|
|
32
32
|
/* @__PURE__ */ e(c, { children: "Look for more live match insights, predictions and more." }),
|
|
33
33
|
/* @__PURE__ */ e(o, { onClick: () => s({ type: "slOpenGameCenter" }), children: "Open Game Center" })
|
|
34
34
|
] }) }, "end");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ScreenContainerBox as
|
|
3
|
-
const i = ({ children:
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { ScreenContainerBox as n } from "./styles.js";
|
|
3
|
+
const i = ({ children: e }) => /* @__PURE__ */ r(n, { className: "ScreenContainer", children: /* @__PURE__ */ r("div", { children: e }) });
|
|
4
4
|
export {
|
|
5
5
|
i as ScreenContainer
|
|
6
6
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { SwiperClass } from 'swiper/react';
|
|
2
|
+
export declare const StartScreen: React.FC<{
|
|
2
3
|
countQuestionsAvailable: number;
|
|
3
|
-
sliderRef: React.MutableRefObject<
|
|
4
|
-
}
|
|
4
|
+
sliderRef: React.MutableRefObject<SwiperClass | undefined>;
|
|
5
|
+
}>;
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
|
|
9
|
-
/* @__PURE__ */ e(
|
|
10
|
-
/* @__PURE__ */ e(h, { children: "The First Five" })
|
|
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";
|
|
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: [
|
|
8
|
+
/* @__PURE__ */ e(h, { children: "FEATURED GROUPS+" }),
|
|
9
|
+
/* @__PURE__ */ e(l, { children: "The First Five" })
|
|
11
10
|
] }),
|
|
12
|
-
/* @__PURE__ */ e(
|
|
11
|
+
/* @__PURE__ */ e(S, { children: "Tee off with these five initial predictions for today’s play." }),
|
|
13
12
|
/* @__PURE__ */ r(
|
|
14
|
-
|
|
13
|
+
d,
|
|
15
14
|
{
|
|
16
15
|
onClick: () => {
|
|
17
|
-
var
|
|
18
|
-
(
|
|
16
|
+
var n;
|
|
17
|
+
(n = o.current) == null || n.slideNext();
|
|
19
18
|
},
|
|
20
19
|
children: [
|
|
21
|
-
|
|
22
|
-
/* @__PURE__ */ e(
|
|
20
|
+
t ? `${t} questions available` : "See all questions",
|
|
21
|
+
/* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(m, { name: "iconArrowRight" }) })
|
|
23
22
|
]
|
|
24
23
|
}
|
|
25
24
|
),
|
|
26
|
-
/* @__PURE__ */ e(
|
|
27
|
-
] }) }, "start")
|
|
25
|
+
/* @__PURE__ */ e(f, { children: "Note: Some questions may have been resolved as a result of today’s play." })
|
|
26
|
+
] }) }, "start");
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
v as StartScreen
|
|
30
29
|
};
|
|
@@ -1,93 +1,322 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ConnectError as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
return
|
|
15
|
-
|
|
1
|
+
import { jsx as L, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { ConnectError as Q, Code as q } from "@connectrpc/connect";
|
|
3
|
+
import { useCallback as G, useSyncExternalStore as V, useRef as H, useMemo as X, useEffect as j, useState as Y } from "react";
|
|
4
|
+
import K from "lodash.throttle";
|
|
5
|
+
import { f as U, g as _, m as k, h as J, i as R, j as W, C as Z, k as F } from "../../../../styles-BfnMua4o.js";
|
|
6
|
+
import { EmergencyScreen as E } from "./EmergencyScreen/index.js";
|
|
7
|
+
import { EndScreen as ee } from "./EndScreen/index.js";
|
|
8
|
+
import { LoaderScreen as te } from "./LoaderScreen/index.js";
|
|
9
|
+
import { QuestionScreen as ae } from "./QuestionScreen/index.js";
|
|
10
|
+
import { ScreenContainer as ie } from "./ScreenContainer/index.js";
|
|
11
|
+
import { StartScreen as se } from "./StartScreen/index.js";
|
|
12
|
+
function le(o, e, u) {
|
|
13
|
+
let c = new Set(e).add(void 0);
|
|
14
|
+
return o.listen((n, s, f) => {
|
|
15
|
+
c.has(f) && u(n, s, f);
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
(n) =>
|
|
21
|
-
[
|
|
22
|
-
),
|
|
23
|
-
return
|
|
18
|
+
function ne(o, e = {}) {
|
|
19
|
+
let u = G(
|
|
20
|
+
(n) => e.keys ? le(o, e.keys, n) : o.listen(n),
|
|
21
|
+
[e.keys, o]
|
|
22
|
+
), c = o.get.bind(o);
|
|
23
|
+
return V(u, c, c);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
function re(o, e, u, c) {
|
|
26
|
+
return o.params.createElements && Object.keys(c).forEach((n) => {
|
|
27
|
+
if (!u[n] && u.auto === !0) {
|
|
28
|
+
let s = U(o.el, `.${c[n]}`)[0];
|
|
29
|
+
s || (s = _("div", c[n]), s.className = c[n], o.el.append(s)), u[n] = s, e[n] = s;
|
|
30
|
+
}
|
|
31
|
+
}), u;
|
|
32
|
+
}
|
|
33
|
+
function P(o) {
|
|
34
|
+
return o === void 0 && (o = ""), `.${o.trim().replace(/([\.:!+\/])/g, "\\$1").replace(/ /g, ".")}`;
|
|
35
|
+
}
|
|
36
|
+
function oe(o) {
|
|
37
|
+
let {
|
|
38
|
+
swiper: e,
|
|
39
|
+
extendParams: u,
|
|
40
|
+
on: c,
|
|
41
|
+
emit: n
|
|
42
|
+
} = o;
|
|
43
|
+
const s = "swiper-pagination";
|
|
44
|
+
u({
|
|
45
|
+
pagination: {
|
|
46
|
+
el: null,
|
|
47
|
+
bulletElement: "span",
|
|
48
|
+
clickable: !1,
|
|
49
|
+
hideOnClick: !1,
|
|
50
|
+
renderBullet: null,
|
|
51
|
+
renderProgressbar: null,
|
|
52
|
+
renderFraction: null,
|
|
53
|
+
renderCustom: null,
|
|
54
|
+
progressbarOpposite: !1,
|
|
55
|
+
type: "bullets",
|
|
56
|
+
// 'bullets' or 'progressbar' or 'fraction' or 'custom'
|
|
57
|
+
dynamicBullets: !1,
|
|
58
|
+
dynamicMainBullets: 1,
|
|
59
|
+
formatFractionCurrent: (t) => t,
|
|
60
|
+
formatFractionTotal: (t) => t,
|
|
61
|
+
bulletClass: `${s}-bullet`,
|
|
62
|
+
bulletActiveClass: `${s}-bullet-active`,
|
|
63
|
+
modifierClass: `${s}-`,
|
|
64
|
+
currentClass: `${s}-current`,
|
|
65
|
+
totalClass: `${s}-total`,
|
|
66
|
+
hiddenClass: `${s}-hidden`,
|
|
67
|
+
progressbarFillClass: `${s}-progressbar-fill`,
|
|
68
|
+
progressbarOppositeClass: `${s}-progressbar-opposite`,
|
|
69
|
+
clickableClass: `${s}-clickable`,
|
|
70
|
+
lockClass: `${s}-lock`,
|
|
71
|
+
horizontalClass: `${s}-horizontal`,
|
|
72
|
+
verticalClass: `${s}-vertical`,
|
|
73
|
+
paginationDisabledClass: `${s}-disabled`
|
|
74
|
+
}
|
|
75
|
+
}), e.pagination = {
|
|
76
|
+
el: null,
|
|
77
|
+
bullets: []
|
|
78
|
+
};
|
|
79
|
+
let f, g = 0;
|
|
80
|
+
function v() {
|
|
81
|
+
return !e.params.pagination.el || !e.pagination.el || Array.isArray(e.pagination.el) && e.pagination.el.length === 0;
|
|
82
|
+
}
|
|
83
|
+
function A(t, a) {
|
|
84
|
+
const {
|
|
85
|
+
bulletActiveClass: i
|
|
86
|
+
} = e.params.pagination;
|
|
87
|
+
t && (t = t[`${a === "prev" ? "previous" : "next"}ElementSibling`], t && (t.classList.add(`${i}-${a}`), t = t[`${a === "prev" ? "previous" : "next"}ElementSibling`], t && t.classList.add(`${i}-${a}-${a}`)));
|
|
88
|
+
}
|
|
89
|
+
function I(t, a, i) {
|
|
90
|
+
if (t = t % i, a = a % i, a === t + 1)
|
|
91
|
+
return "next";
|
|
92
|
+
if (a === t - 1)
|
|
93
|
+
return "previous";
|
|
94
|
+
}
|
|
95
|
+
function z(t) {
|
|
96
|
+
const a = t.target.closest(P(e.params.pagination.bulletClass));
|
|
97
|
+
if (!a)
|
|
98
|
+
return;
|
|
99
|
+
t.preventDefault();
|
|
100
|
+
const i = R(a) * e.params.slidesPerGroup;
|
|
101
|
+
if (e.params.loop) {
|
|
102
|
+
if (e.realIndex === i) return;
|
|
103
|
+
const r = I(e.realIndex, i, e.slides.length);
|
|
104
|
+
r === "next" ? e.slideNext() : r === "previous" ? e.slidePrev() : e.slideToLoop(i);
|
|
105
|
+
} else
|
|
106
|
+
e.slideTo(i);
|
|
107
|
+
}
|
|
108
|
+
function S() {
|
|
109
|
+
const t = e.rtl, a = e.params.pagination;
|
|
110
|
+
if (v()) return;
|
|
111
|
+
let i = e.pagination.el;
|
|
112
|
+
i = k(i);
|
|
113
|
+
let r, y;
|
|
114
|
+
const B = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.slides.length, T = e.params.loop ? Math.ceil(B / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
115
|
+
if (e.params.loop ? (y = e.previousRealIndex || 0, r = e.params.slidesPerGroup > 1 ? Math.floor(e.realIndex / e.params.slidesPerGroup) : e.realIndex) : typeof e.snapIndex < "u" ? (r = e.snapIndex, y = e.previousSnapIndex) : (y = e.previousIndex || 0, r = e.activeIndex || 0), a.type === "bullets" && e.pagination.bullets && e.pagination.bullets.length > 0) {
|
|
116
|
+
const d = e.pagination.bullets;
|
|
117
|
+
let x, C, O;
|
|
118
|
+
if (a.dynamicBullets && (f = J(d[0], e.isHorizontal() ? "width" : "height"), i.forEach((m) => {
|
|
119
|
+
m.style[e.isHorizontal() ? "width" : "height"] = `${f * (a.dynamicMainBullets + 4)}px`;
|
|
120
|
+
}), a.dynamicMainBullets > 1 && y !== void 0 && (g += r - (y || 0), g > a.dynamicMainBullets - 1 ? g = a.dynamicMainBullets - 1 : g < 0 && (g = 0)), x = Math.max(r - g, 0), C = x + (Math.min(d.length, a.dynamicMainBullets) - 1), O = (C + x) / 2), d.forEach((m) => {
|
|
121
|
+
const h = [...["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((b) => `${a.bulletActiveClass}${b}`)].map((b) => typeof b == "string" && b.includes(" ") ? b.split(" ") : b).flat();
|
|
122
|
+
m.classList.remove(...h);
|
|
123
|
+
}), i.length > 1)
|
|
124
|
+
d.forEach((m) => {
|
|
125
|
+
const h = R(m);
|
|
126
|
+
h === r ? m.classList.add(...a.bulletActiveClass.split(" ")) : e.isElement && m.setAttribute("part", "bullet"), a.dynamicBullets && (h >= x && h <= C && m.classList.add(...`${a.bulletActiveClass}-main`.split(" ")), h === x && A(m, "prev"), h === C && A(m, "next"));
|
|
127
|
+
});
|
|
128
|
+
else {
|
|
129
|
+
const m = d[r];
|
|
130
|
+
if (m && m.classList.add(...a.bulletActiveClass.split(" ")), e.isElement && d.forEach((h, b) => {
|
|
131
|
+
h.setAttribute("part", b === r ? "bullet-active" : "bullet");
|
|
132
|
+
}), a.dynamicBullets) {
|
|
133
|
+
const h = d[x], b = d[C];
|
|
134
|
+
for (let M = x; M <= C; M += 1)
|
|
135
|
+
d[M] && d[M].classList.add(...`${a.bulletActiveClass}-main`.split(" "));
|
|
136
|
+
A(h, "prev"), A(b, "next");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (a.dynamicBullets) {
|
|
140
|
+
const m = Math.min(d.length, a.dynamicMainBullets + 4), h = (f * m - f) / 2 - O * f, b = t ? "right" : "left";
|
|
141
|
+
d.forEach((M) => {
|
|
142
|
+
M.style[e.isHorizontal() ? b : "top"] = `${h}px`;
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
i.forEach((d, x) => {
|
|
147
|
+
if (a.type === "fraction" && (d.querySelectorAll(P(a.currentClass)).forEach((C) => {
|
|
148
|
+
C.textContent = a.formatFractionCurrent(r + 1);
|
|
149
|
+
}), d.querySelectorAll(P(a.totalClass)).forEach((C) => {
|
|
150
|
+
C.textContent = a.formatFractionTotal(T);
|
|
151
|
+
})), a.type === "progressbar") {
|
|
152
|
+
let C;
|
|
153
|
+
a.progressbarOpposite ? C = e.isHorizontal() ? "vertical" : "horizontal" : C = e.isHorizontal() ? "horizontal" : "vertical";
|
|
154
|
+
const O = (r + 1) / T;
|
|
155
|
+
let m = 1, h = 1;
|
|
156
|
+
C === "horizontal" ? m = O : h = O, d.querySelectorAll(P(a.progressbarFillClass)).forEach((b) => {
|
|
157
|
+
b.style.transform = `translate3d(0,0,0) scaleX(${m}) scaleY(${h})`, b.style.transitionDuration = `${e.params.speed}ms`;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
a.type === "custom" && a.renderCustom ? (d.innerHTML = a.renderCustom(e, r + 1, T), x === 0 && n("paginationRender", d)) : (x === 0 && n("paginationRender", d), n("paginationUpdate", d)), e.params.watchOverflow && e.enabled && d.classList[e.isLocked ? "add" : "remove"](a.lockClass);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function l() {
|
|
164
|
+
const t = e.params.pagination;
|
|
165
|
+
if (v()) return;
|
|
166
|
+
const a = e.virtual && e.params.virtual.enabled ? e.virtual.slides.length : e.grid && e.params.grid.rows > 1 ? e.slides.length / Math.ceil(e.params.grid.rows) : e.slides.length;
|
|
167
|
+
let i = e.pagination.el;
|
|
168
|
+
i = k(i);
|
|
169
|
+
let r = "";
|
|
170
|
+
if (t.type === "bullets") {
|
|
171
|
+
let y = e.params.loop ? Math.ceil(a / e.params.slidesPerGroup) : e.snapGrid.length;
|
|
172
|
+
e.params.freeMode && e.params.freeMode.enabled && y > a && (y = a);
|
|
173
|
+
for (let B = 0; B < y; B += 1)
|
|
174
|
+
t.renderBullet ? r += t.renderBullet.call(e, B, t.bulletClass) : r += `<${t.bulletElement} ${e.isElement ? 'part="bullet"' : ""} class="${t.bulletClass}"></${t.bulletElement}>`;
|
|
175
|
+
}
|
|
176
|
+
t.type === "fraction" && (t.renderFraction ? r = t.renderFraction.call(e, t.currentClass, t.totalClass) : r = `<span class="${t.currentClass}"></span> / <span class="${t.totalClass}"></span>`), t.type === "progressbar" && (t.renderProgressbar ? r = t.renderProgressbar.call(e, t.progressbarFillClass) : r = `<span class="${t.progressbarFillClass}"></span>`), e.pagination.bullets = [], i.forEach((y) => {
|
|
177
|
+
t.type !== "custom" && (y.innerHTML = r || ""), t.type === "bullets" && e.pagination.bullets.push(...y.querySelectorAll(P(t.bulletClass)));
|
|
178
|
+
}), t.type !== "custom" && n("paginationRender", i[0]);
|
|
179
|
+
}
|
|
180
|
+
function p() {
|
|
181
|
+
e.params.pagination = re(e, e.originalParams.pagination, e.params.pagination, {
|
|
182
|
+
el: "swiper-pagination"
|
|
183
|
+
});
|
|
184
|
+
const t = e.params.pagination;
|
|
185
|
+
if (!t.el) return;
|
|
186
|
+
let a;
|
|
187
|
+
typeof t.el == "string" && e.isElement && (a = e.el.querySelector(t.el)), !a && typeof t.el == "string" && (a = [...document.querySelectorAll(t.el)]), a || (a = t.el), !(!a || a.length === 0) && (e.params.uniqueNavElements && typeof t.el == "string" && Array.isArray(a) && a.length > 1 && (a = [...e.el.querySelectorAll(t.el)], a.length > 1 && (a = a.find((i) => W(i, ".swiper")[0] === e.el))), Array.isArray(a) && a.length === 1 && (a = a[0]), Object.assign(e.pagination, {
|
|
188
|
+
el: a
|
|
189
|
+
}), a = k(a), a.forEach((i) => {
|
|
190
|
+
t.type === "bullets" && t.clickable && i.classList.add(...(t.clickableClass || "").split(" ")), i.classList.add(t.modifierClass + t.type), i.classList.add(e.isHorizontal() ? t.horizontalClass : t.verticalClass), t.type === "bullets" && t.dynamicBullets && (i.classList.add(`${t.modifierClass}${t.type}-dynamic`), g = 0, t.dynamicMainBullets < 1 && (t.dynamicMainBullets = 1)), t.type === "progressbar" && t.progressbarOpposite && i.classList.add(t.progressbarOppositeClass), t.clickable && i.addEventListener("click", z), e.enabled || i.classList.add(t.lockClass);
|
|
191
|
+
}));
|
|
192
|
+
}
|
|
193
|
+
function $() {
|
|
194
|
+
const t = e.params.pagination;
|
|
195
|
+
if (v()) return;
|
|
196
|
+
let a = e.pagination.el;
|
|
197
|
+
a && (a = k(a), a.forEach((i) => {
|
|
198
|
+
i.classList.remove(t.hiddenClass), i.classList.remove(t.modifierClass + t.type), i.classList.remove(e.isHorizontal() ? t.horizontalClass : t.verticalClass), t.clickable && (i.classList.remove(...(t.clickableClass || "").split(" ")), i.removeEventListener("click", z));
|
|
199
|
+
})), e.pagination.bullets && e.pagination.bullets.forEach((i) => i.classList.remove(...t.bulletActiveClass.split(" ")));
|
|
200
|
+
}
|
|
201
|
+
c("changeDirection", () => {
|
|
202
|
+
if (!e.pagination || !e.pagination.el) return;
|
|
203
|
+
const t = e.params.pagination;
|
|
204
|
+
let {
|
|
205
|
+
el: a
|
|
206
|
+
} = e.pagination;
|
|
207
|
+
a = k(a), a.forEach((i) => {
|
|
208
|
+
i.classList.remove(t.horizontalClass, t.verticalClass), i.classList.add(e.isHorizontal() ? t.horizontalClass : t.verticalClass);
|
|
209
|
+
});
|
|
210
|
+
}), c("init", () => {
|
|
211
|
+
e.params.pagination.enabled === !1 ? w() : (p(), l(), S());
|
|
212
|
+
}), c("activeIndexChange", () => {
|
|
213
|
+
typeof e.snapIndex > "u" && S();
|
|
214
|
+
}), c("snapIndexChange", () => {
|
|
215
|
+
S();
|
|
216
|
+
}), c("snapGridLengthChange", () => {
|
|
217
|
+
l(), S();
|
|
218
|
+
}), c("destroy", () => {
|
|
219
|
+
$();
|
|
220
|
+
}), c("enable disable", () => {
|
|
221
|
+
let {
|
|
222
|
+
el: t
|
|
223
|
+
} = e.pagination;
|
|
224
|
+
t && (t = k(t), t.forEach((a) => a.classList[e.enabled ? "remove" : "add"](e.params.pagination.lockClass)));
|
|
225
|
+
}), c("lock unlock", () => {
|
|
226
|
+
S();
|
|
227
|
+
}), c("click", (t, a) => {
|
|
228
|
+
const i = a.target, r = k(e.pagination.el);
|
|
229
|
+
if (e.params.pagination.el && e.params.pagination.hideOnClick && r && r.length > 0 && !i.classList.contains(e.params.pagination.bulletClass)) {
|
|
230
|
+
if (e.navigation && (e.navigation.nextEl && i === e.navigation.nextEl || e.navigation.prevEl && i === e.navigation.prevEl)) return;
|
|
231
|
+
const y = r[0].classList.contains(e.params.pagination.hiddenClass);
|
|
232
|
+
n(y === !0 ? "paginationShow" : "paginationHide"), r.forEach((B) => B.classList.toggle(e.params.pagination.hiddenClass));
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
const D = () => {
|
|
236
|
+
e.el.classList.remove(e.params.pagination.paginationDisabledClass);
|
|
237
|
+
let {
|
|
238
|
+
el: t
|
|
239
|
+
} = e.pagination;
|
|
240
|
+
t && (t = k(t), t.forEach((a) => a.classList.remove(e.params.pagination.paginationDisabledClass))), p(), l(), S();
|
|
241
|
+
}, w = () => {
|
|
242
|
+
e.el.classList.add(e.params.pagination.paginationDisabledClass);
|
|
243
|
+
let {
|
|
244
|
+
el: t
|
|
245
|
+
} = e.pagination;
|
|
246
|
+
t && (t = k(t), t.forEach((a) => a.classList.add(e.params.pagination.paginationDisabledClass))), $();
|
|
247
|
+
};
|
|
248
|
+
Object.assign(e.pagination, {
|
|
249
|
+
enable: D,
|
|
250
|
+
disable: w,
|
|
251
|
+
render: l,
|
|
252
|
+
update: S,
|
|
253
|
+
init: p,
|
|
254
|
+
destroy: $
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
const ce = ({ data: o, gamification: e, onEvent: u, swipeable: c, autoplay: n }) => {
|
|
258
|
+
const s = H(), f = H(), { listOfQuestions: g, countQuestionsAvailable: v } = X(() => {
|
|
259
|
+
const l = o ? Object.values(o) : [];
|
|
28
260
|
return {
|
|
29
|
-
listOfQuestions:
|
|
30
|
-
countQuestionsAvailable:
|
|
261
|
+
listOfQuestions: l,
|
|
262
|
+
countQuestionsAvailable: l.filter(({ marketClosed: p }) => !p).length
|
|
31
263
|
};
|
|
32
|
-
}, [
|
|
33
|
-
async (
|
|
264
|
+
}, [o]), A = G(
|
|
265
|
+
async (l, p) => {
|
|
34
266
|
try {
|
|
35
|
-
await
|
|
267
|
+
await e.betPackVote(l, p), u({
|
|
36
268
|
type: "slVoted",
|
|
37
269
|
payload: {
|
|
38
|
-
questionId:
|
|
39
|
-
answerId:
|
|
270
|
+
questionId: l,
|
|
271
|
+
answerId: p
|
|
40
272
|
}
|
|
41
273
|
});
|
|
42
274
|
} finally {
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
(
|
|
275
|
+
s.current && clearTimeout(s.current), n && (s.current = setTimeout(() => {
|
|
276
|
+
var $;
|
|
277
|
+
($ = f.current) == null || $.slideNext();
|
|
46
278
|
}, 2e3));
|
|
47
279
|
}
|
|
48
280
|
},
|
|
49
|
-
[
|
|
281
|
+
[e, u, n]
|
|
50
282
|
);
|
|
51
|
-
|
|
283
|
+
j(() => (u({
|
|
52
284
|
type: "slBetPackReady",
|
|
53
285
|
payload: {
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
55
|
-
// @ts-expect-error
|
|
56
286
|
next: () => {
|
|
57
|
-
var
|
|
58
|
-
return (
|
|
287
|
+
var l;
|
|
288
|
+
return (l = f.current) == null ? void 0 : l.slideNext();
|
|
59
289
|
},
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
61
|
-
// @ts-expect-error
|
|
62
290
|
prev: () => {
|
|
63
|
-
var
|
|
64
|
-
return (
|
|
291
|
+
var l;
|
|
292
|
+
return (l = f.current) == null ? void 0 : l.slidePrev();
|
|
65
293
|
},
|
|
66
294
|
current: 0,
|
|
67
295
|
canNext: !0,
|
|
68
296
|
canPrev: !1
|
|
69
297
|
}
|
|
70
298
|
}), () => {
|
|
71
|
-
|
|
72
|
-
}), [
|
|
73
|
-
const
|
|
74
|
-
var
|
|
75
|
-
|
|
299
|
+
s.current && clearTimeout(s.current);
|
|
300
|
+
}), [u]);
|
|
301
|
+
const I = (l) => {
|
|
302
|
+
var $;
|
|
303
|
+
const p = l.realIndex;
|
|
304
|
+
if (u({
|
|
76
305
|
type: "slBetPackChangeCard",
|
|
77
306
|
payload: {
|
|
78
|
-
current:
|
|
79
|
-
canNext:
|
|
80
|
-
canPrev:
|
|
307
|
+
current: p,
|
|
308
|
+
canNext: p < Object.keys(o).length + 1,
|
|
309
|
+
canPrev: p >= 1
|
|
81
310
|
}
|
|
82
|
-
}),
|
|
83
|
-
|
|
311
|
+
}), p !== 0 && p !== Object.keys(o).length + 1 && (($ = g[p - 1]) != null && $.id)) {
|
|
312
|
+
e.openQuestion(g[p - 1].id, {
|
|
84
313
|
openedFrom: "bet-pack",
|
|
85
314
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
86
315
|
// @ts-expect-error
|
|
87
316
|
attributes: {
|
|
88
|
-
id:
|
|
89
|
-
type:
|
|
90
|
-
status:
|
|
317
|
+
id: g[p - 1].id,
|
|
318
|
+
type: g[p - 1].type,
|
|
319
|
+
status: g[p - 1].status,
|
|
91
320
|
attributes: {
|
|
92
321
|
case: void 0
|
|
93
322
|
}
|
|
@@ -95,58 +324,77 @@ const I = ({ data: t, gamification: s, onEvent: c, swipeable: o, overlay: n, aut
|
|
|
95
324
|
});
|
|
96
325
|
return;
|
|
97
326
|
}
|
|
98
|
-
|
|
99
|
-
};
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
327
|
+
e.closeQuestion();
|
|
328
|
+
}, [z, S] = Y(1.1);
|
|
329
|
+
return j(() => {
|
|
330
|
+
const l = K(() => {
|
|
331
|
+
var w;
|
|
332
|
+
const p = (w = f.current) == null ? void 0 : w.size;
|
|
333
|
+
if (!p)
|
|
334
|
+
return;
|
|
335
|
+
const D = 1 + 30 / (p / 100) / 100 * 2;
|
|
336
|
+
S(Math.ceil(D * 1e3) / 1e3);
|
|
337
|
+
}, 200);
|
|
338
|
+
return window.addEventListener("resize", l), l(), () => {
|
|
339
|
+
window.removeEventListener("resize", l);
|
|
340
|
+
};
|
|
341
|
+
}, []), /* @__PURE__ */ N(
|
|
342
|
+
Z,
|
|
104
343
|
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
344
|
+
slidesPerView: z,
|
|
345
|
+
spaceBetween: 12,
|
|
346
|
+
centeredSlides: !0,
|
|
347
|
+
centerInsufficientSlides: !0,
|
|
348
|
+
allowTouchMove: c,
|
|
349
|
+
pagination: {
|
|
350
|
+
clickable: !0
|
|
351
|
+
},
|
|
352
|
+
modules: [oe],
|
|
353
|
+
onSlideChange: I,
|
|
354
|
+
onBeforeSlideChangeStart: () => {
|
|
355
|
+
s.current && clearTimeout(s.current);
|
|
356
|
+
},
|
|
357
|
+
onSwiper: (l) => {
|
|
358
|
+
f.current = l;
|
|
110
359
|
},
|
|
111
|
-
ref: l,
|
|
112
360
|
children: [
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
115
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ L(F, { children: /* @__PURE__ */ L(se, { sliderRef: f, countQuestionsAvailable: v }) }),
|
|
362
|
+
g.map((l) => l ? /* @__PURE__ */ L(F, { children: /* @__PURE__ */ L(ie, { children: /* @__PURE__ */ L(ae, { question: l, vote: A }) }, l.id) }) : null),
|
|
363
|
+
/* @__PURE__ */ L(F, { children: /* @__PURE__ */ L(ee, { onEvent: u }) })
|
|
116
364
|
]
|
|
117
365
|
}
|
|
118
366
|
);
|
|
119
|
-
},
|
|
120
|
-
const
|
|
121
|
-
return
|
|
122
|
-
|
|
367
|
+
}, Le = ({ gamification: o, autoplay: e, overlay: u, swipeable: c, onEvent: n }) => {
|
|
368
|
+
const s = ne(o.betPack.getStore()), { error: f, loading: g, data: v } = s;
|
|
369
|
+
return g || !Object.hasOwn(s, "data") ? /* @__PURE__ */ L(te, {}) : f ? /* @__PURE__ */ L(
|
|
370
|
+
E,
|
|
123
371
|
{
|
|
124
372
|
onEvent: n,
|
|
125
373
|
actionFn: () => n({ type: "slHardRefresh" }),
|
|
126
|
-
description:
|
|
374
|
+
description: f instanceof Q && f.code !== q.InvalidArgument ? `The event ID was not
|
|
127
375
|
specified or is invalid.` : `The server is unable to
|
|
128
376
|
handle this request.`
|
|
129
377
|
}
|
|
130
|
-
) : !
|
|
131
|
-
|
|
378
|
+
) : !v || !v.timestamp || !v.data || !Object.keys(v.data).length ? /* @__PURE__ */ L(
|
|
379
|
+
E,
|
|
132
380
|
{
|
|
133
381
|
onEvent: n,
|
|
134
382
|
actionFn: () => n({ type: "slHardRefresh" }),
|
|
135
383
|
description: `It looks like we couldn't
|
|
136
384
|
load the questions.`
|
|
137
385
|
}
|
|
138
|
-
) : /* @__PURE__ */
|
|
139
|
-
|
|
386
|
+
) : /* @__PURE__ */ L(
|
|
387
|
+
ce,
|
|
140
388
|
{
|
|
141
|
-
data:
|
|
142
|
-
gamification:
|
|
389
|
+
data: v.data,
|
|
390
|
+
gamification: o,
|
|
143
391
|
onEvent: n,
|
|
144
|
-
swipeable:
|
|
145
|
-
autoplay:
|
|
146
|
-
overlay:
|
|
392
|
+
swipeable: c,
|
|
393
|
+
autoplay: e,
|
|
394
|
+
overlay: u
|
|
147
395
|
}
|
|
148
396
|
);
|
|
149
397
|
};
|
|
150
398
|
export {
|
|
151
|
-
|
|
399
|
+
Le as BetPackContent
|
|
152
400
|
};
|