@streamlayer/react-ui 1.21.0 → 1.22.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/masters/BetPack/BetPackContent/EmergencyScreen/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +18 -22
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +1 -2
- package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +16 -19
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +0 -1
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +25 -24
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +1 -0
- package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +14 -9
- package/lib/app/masters/BetPack/BetPackContent/index.js +64 -66
- package/lib/app/masters/BetPack/index.js +27 -27
- package/lib/app/masters/BetPack/utils.d.ts +1 -1
- package/lib/app/masters/BetPack/utils.js +8 -7
- package/lib/app/masters/Features/Gamification/index.d.ts +2 -0
- package/lib/app/masters/Features/Gamification/index.js +34 -29
- package/lib/app/masters/Features/index.d.ts +2 -0
- package/lib/app/masters/Features/index.js +12 -4
- package/lib/app/masters/Header/index.js +19 -23
- package/lib/app/masters/masters.js +68 -54
- package/lib/app/masters/useSdkResponsive.js +2 -2
- package/lib/app/masters/useSdkScroll.js +12 -12
- package/lib/app/useSdkResponsive.js +1 -1
- package/lib/app/useSdkScroll.js +1 -1
- package/lib/assets/style.css +1 -1
- package/lib/index-DSi8Qgfs.js +14 -0
- package/lib/index-DXvAPWiE.js +3743 -0
- package/lib/index-tnt2CtQe.js +55 -0
- package/lib/ui/advertisement/overlay/externalAd/index.d.ts +1 -1
- package/lib/ui/advertisement/overlay/externalAd/index.js +59 -40287
- package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +2 -0
- package/lib/ui/advertisement/overlay/externalAd/styles.js +34 -24
- package/lib/ui/advertisement/overlay/externalAd/vast-player/module.d.js +1 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.d.ts +19 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +33199 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.d.ts +24 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +8 -0
- package/lib/ui/gamification/vote/feedback/index.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/index.js +83 -73
- package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
- package/lib/ui/gamification/vote/feedback/styles.js +40 -39
- package/lib/ui/gamification/vote/index.js +94 -91
- package/lib/ui/icons/index.d.ts +1 -0
- package/lib/ui/icons/index.js +88 -79
- package/lib/ui/modal/index.js +31 -34
- package/lib/ui/theme/breakpoints.d.ts +1 -0
- package/lib/ui/theme/breakpoints.js +17 -9
- package/lib/ui/theme/masters-theme.js +1 -0
- package/lib/useVastAds-Dt_tRbpd.js +1284 -0
- package/package.json +18 -15
- package/lib/index-CLJzLXks.js +0 -64
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { cx as s } from "@linaria/core";
|
|
3
3
|
import { useDynamicParentFont as a } from "../ScreenContainer/useDynamicParentFont.js";
|
|
4
|
-
import { EmergencyContainer as
|
|
5
|
-
const d = ({ actionFn:
|
|
6
|
-
const { container:
|
|
7
|
-
return /* @__PURE__ */ m(
|
|
8
|
-
/* @__PURE__ */ e(
|
|
9
|
-
/* @__PURE__ */ e(y, { children:
|
|
10
|
-
/* @__PURE__ */ e(f, { onClick:
|
|
4
|
+
import { EmergencyContainer as l, EmergencyScreenTitle as g, EmergencyScreenDescription as y, EmergencyScreenButton as f } from "./styles.js";
|
|
5
|
+
const d = ({ actionFn: n, description: r, isMobile: c, height: o }) => {
|
|
6
|
+
const { container: t, fontSize: i } = a(o);
|
|
7
|
+
return /* @__PURE__ */ m(l, { style: { fontSize: i }, ref: t, className: s("betPack", !!c && "isMobile"), children: [
|
|
8
|
+
/* @__PURE__ */ e(g, { children: "Something went wrong." }),
|
|
9
|
+
/* @__PURE__ */ e(y, { children: r }),
|
|
10
|
+
/* @__PURE__ */ e(f, { onClick: n, children: "Try again" })
|
|
11
11
|
] });
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { ScreenContainer as
|
|
4
|
-
import { ScreenWrap as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
onEvent: s,
|
|
8
|
-
swipeable: c
|
|
9
|
-
}) => {
|
|
10
|
-
const [l, a] = p(
|
|
2
|
+
import { useState as a } from "react";
|
|
3
|
+
import { ScreenContainer as c } from "../ScreenContainer/index.js";
|
|
4
|
+
import { ScreenWrap as i, EndFirstScreenWrap as p, EndScreenMain as t, SponsorIcon as m, EndScreenTitle as h, EndScreenDescription as S, EndScreenButton as d, EndLastScreenWrap as u, EndScreenMedia as E, EndLastScreenDescription as b } from "./styles.js";
|
|
5
|
+
const x = ({ height: r, onEvent: o }) => {
|
|
6
|
+
const [s, l] = a(
|
|
11
7
|
0
|
|
12
8
|
/* FIRST */
|
|
13
9
|
);
|
|
14
|
-
return
|
|
15
|
-
/* @__PURE__ */ n(
|
|
16
|
-
/* @__PURE__ */ e(
|
|
17
|
-
/* @__PURE__ */ e(
|
|
18
|
-
/* @__PURE__ */ n(
|
|
10
|
+
return s === 0 ? /* @__PURE__ */ e(c, { height: r, children: /* @__PURE__ */ e(i, { children: /* @__PURE__ */ n(p, { children: [
|
|
11
|
+
/* @__PURE__ */ n(t, { children: [
|
|
12
|
+
/* @__PURE__ */ e(m, { name: "icon-masters-logo" }),
|
|
13
|
+
/* @__PURE__ */ e(h, { children: "Great picks!" }),
|
|
14
|
+
/* @__PURE__ */ n(S, { children: [
|
|
19
15
|
"As results come in we’ll send you",
|
|
20
16
|
/* @__PURE__ */ e("br", {}),
|
|
21
17
|
"live updates right here."
|
|
22
18
|
] })
|
|
23
19
|
] }),
|
|
24
20
|
/* @__PURE__ */ e(
|
|
25
|
-
|
|
21
|
+
d,
|
|
26
22
|
{
|
|
27
23
|
onClick: () => {
|
|
28
|
-
|
|
24
|
+
l(
|
|
29
25
|
1
|
|
30
26
|
/* LAST */
|
|
31
27
|
);
|
|
@@ -33,18 +29,18 @@ const y = ({
|
|
|
33
29
|
children: "Continue"
|
|
34
30
|
}
|
|
35
31
|
)
|
|
36
|
-
] }) }) }, "end") : /* @__PURE__ */ e(
|
|
37
|
-
/* @__PURE__ */ n(
|
|
38
|
-
/* @__PURE__ */ e(
|
|
39
|
-
/* @__PURE__ */ n(
|
|
32
|
+
] }) }) }, "end") : /* @__PURE__ */ e(c, { height: r, children: /* @__PURE__ */ e(i, { children: /* @__PURE__ */ n(u, { children: [
|
|
33
|
+
/* @__PURE__ */ n(t, { children: [
|
|
34
|
+
/* @__PURE__ */ e(E, { src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/bet_pack_end_screen.png" }),
|
|
35
|
+
/* @__PURE__ */ n(b, { children: [
|
|
40
36
|
"Look for more live match insights,",
|
|
41
37
|
/* @__PURE__ */ e("br", {}),
|
|
42
38
|
"predictions and more."
|
|
43
39
|
] })
|
|
44
40
|
] }),
|
|
45
|
-
/* @__PURE__ */ e(
|
|
41
|
+
/* @__PURE__ */ e(d, { onClick: () => o({ type: "slOpenGameCenter" }), children: "Open Game Center" })
|
|
46
42
|
] }) }) }, "end");
|
|
47
43
|
};
|
|
48
44
|
export {
|
|
49
|
-
|
|
45
|
+
x as EndScreen
|
|
50
46
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ScreenContainerBox as
|
|
3
|
-
import { useDynamicParentFont as
|
|
4
|
-
const
|
|
5
|
-
const { container:
|
|
6
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { ScreenContainerBox as i } from "./styles.js";
|
|
3
|
+
import { useDynamicParentFont as c } from "./useDynamicParentFont.js";
|
|
4
|
+
const s = ({ children: o, height: r }) => {
|
|
5
|
+
const { container: e, fontSize: t } = c(r);
|
|
6
|
+
return /* @__PURE__ */ n(i, { style: { height: r, fontSize: t }, ref: e, children: /* @__PURE__ */ n("div", { children: o }) });
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
s as ScreenContainer
|
|
10
10
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export declare const useDynamicParentFont: (height?: number
|
|
1
|
+
export declare const useDynamicParentFont: (height?: number) => {
|
|
2
2
|
container: import('react').MutableRefObject<HTMLDivElement | null>;
|
|
3
3
|
fontSize: string;
|
|
4
|
-
calcHeight: number | undefined;
|
|
5
4
|
};
|
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
const
|
|
3
|
-
const [
|
|
4
|
-
return
|
|
1
|
+
import { useState as _, useRef as d, useEffect as h } from "react";
|
|
2
|
+
const l = "16px", w = 17, m = 21, p = 24, T = (o) => o < 0.9 ? p : o < 1.17 ? m : w, S = (o) => {
|
|
3
|
+
const [E, u] = _(l), c = d(null), e = d();
|
|
4
|
+
return h(() => {
|
|
5
5
|
const t = c.current, n = () => {
|
|
6
6
|
e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
|
|
7
7
|
if (t) {
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const s = getComputedStyle(t), i = +s.width.replace("px", ""), v = +s.height.replace("px", "") / i, a = i / T(v);
|
|
9
|
+
u(`${a < 20 ? a : 20}px`);
|
|
10
10
|
}
|
|
11
11
|
e.current = void 0;
|
|
12
12
|
}, 200);
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
}, o = () => {
|
|
16
|
-
s(), n();
|
|
13
|
+
}, r = () => {
|
|
14
|
+
n();
|
|
17
15
|
};
|
|
18
|
-
return window.screen.orientation.addEventListener("change",
|
|
19
|
-
window.screen.orientation.removeEventListener("change",
|
|
16
|
+
return window.screen.orientation.addEventListener("change", r), window.addEventListener("orientationchange", r), window.addEventListener("resize", n), t == null || t.addEventListener("transitionend", n, !1), n(), () => {
|
|
17
|
+
window.screen.orientation.removeEventListener("change", r), window.removeEventListener("orientationchange", r), window.removeEventListener("resize", n), t == null || t.removeEventListener("transitionend", n), e.current && clearTimeout(e.current);
|
|
20
18
|
};
|
|
21
|
-
}, []),
|
|
19
|
+
}, []), h(() => (e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
|
|
22
20
|
if (c.current) {
|
|
23
|
-
const t = getComputedStyle(c.current), n = +t.width.replace("px", ""),
|
|
24
|
-
|
|
21
|
+
const t = getComputedStyle(c.current), n = +t.width.replace("px", ""), s = +t.height.replace("px", "") / n, i = n / T(s);
|
|
22
|
+
u(`${i < 20 ? i : 20}px`), e.current = void 0;
|
|
25
23
|
}
|
|
26
24
|
}, 200), () => {
|
|
27
25
|
e.current && clearTimeout(e.current);
|
|
28
|
-
}), [
|
|
26
|
+
}), [o]), {
|
|
29
27
|
container: c,
|
|
30
|
-
fontSize:
|
|
31
|
-
calcHeight: _ === "landscape" && r !== void 0 && E ? r + 30 : r
|
|
28
|
+
fontSize: E
|
|
32
29
|
};
|
|
33
30
|
};
|
|
34
31
|
export {
|
|
35
|
-
|
|
32
|
+
S as useDynamicParentFont
|
|
36
33
|
};
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ScreenContainer as
|
|
3
|
-
import { ScreenWrap as
|
|
4
|
-
const
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */ e(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/* @__PURE__ */ e(h, { children: [
|
|
14
|
-
"Swipe to answer today’s",
|
|
15
|
-
/* @__PURE__ */ r("br", {}),
|
|
16
|
-
"question cards."
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { ScreenContainer as a } from "../ScreenContainer/index.js";
|
|
3
|
+
import { ScreenWrap as c, Main as s, SponsorIcon as l, StartScreenSponsor as S, StartScreenTitle as h, StartScreenDescription as d, StartScreenButton as p, IconArrowRight as m, StartScreenNote as f } from "./styles.js";
|
|
4
|
+
const x = ({ height: o, countQuestionsAvailable: t, sliderRef: i }) => /* @__PURE__ */ e(a, { height: o, children: /* @__PURE__ */ r(c, { children: [
|
|
5
|
+
/* @__PURE__ */ r(s, { children: [
|
|
6
|
+
/* @__PURE__ */ e(l, { name: "icon-masters-logo" }),
|
|
7
|
+
/* @__PURE__ */ e(S, { children: "Featured Groups+" }),
|
|
8
|
+
/* @__PURE__ */ e(h, { children: "The First Five" }),
|
|
9
|
+
/* @__PURE__ */ r(d, { children: [
|
|
10
|
+
"Tee off with these five initial",
|
|
11
|
+
/* @__PURE__ */ e("br", {}),
|
|
12
|
+
"predictions for today’s play."
|
|
17
13
|
] })
|
|
18
14
|
] }),
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
15
|
+
/* @__PURE__ */ r(
|
|
16
|
+
p,
|
|
21
17
|
{
|
|
22
18
|
onClick: () => {
|
|
23
|
-
var
|
|
24
|
-
(
|
|
19
|
+
var n;
|
|
20
|
+
(n = i.current) == null || n.slickNext();
|
|
25
21
|
},
|
|
26
22
|
children: [
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */
|
|
23
|
+
t ? `${t} questions available` : "See all questions",
|
|
24
|
+
/* @__PURE__ */ e(m, { name: "iconArrowRight" })
|
|
29
25
|
]
|
|
30
26
|
}
|
|
31
|
-
)
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ r(f, { children: [
|
|
29
|
+
"Note: Some questions may have been",
|
|
30
|
+
/* @__PURE__ */ e("br", {}),
|
|
31
|
+
"resolved as a result of today’s play."
|
|
32
|
+
] })
|
|
32
33
|
] }) }, "start");
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
x as StartScreen
|
|
35
36
|
};
|
|
@@ -6,3 +6,4 @@ export declare const StartScreenSponsor: import('@linaria/react').StyledComponen
|
|
|
6
6
|
export declare const StartScreenTitle: any;
|
|
7
7
|
export declare const StartScreenDescription: any;
|
|
8
8
|
export declare const StartScreenButton: any;
|
|
9
|
+
export declare const StartScreenNote: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
import { ScreenTitle as
|
|
2
|
+
import { ScreenTitle as t, ScreenDescription as r, ScreenButton as n } from "../../styles.js";
|
|
3
3
|
import { SvgIcon as e } from "../../../../../ui/icons/index.js";
|
|
4
4
|
const I = /* @__PURE__ */ s("div")({
|
|
5
5
|
name: "ScreenWrap",
|
|
6
6
|
class: "s991vvm",
|
|
7
7
|
propsAsIs: !1
|
|
8
|
-
}),
|
|
8
|
+
}), A = /* @__PURE__ */ s("div")({
|
|
9
9
|
name: "Main",
|
|
10
10
|
class: "mnbj36g",
|
|
11
11
|
propsAsIs: !1
|
|
12
|
-
}), o = () => e,
|
|
12
|
+
}), o = () => e, u = /* @__PURE__ */ s(o())({
|
|
13
13
|
name: "IconArrowRight",
|
|
14
14
|
class: "izrvgt",
|
|
15
15
|
propsAsIs: !0
|
|
@@ -21,26 +21,31 @@ const I = /* @__PURE__ */ s("div")({
|
|
|
21
21
|
name: "StartScreenSponsor",
|
|
22
22
|
class: "s1oq8jlq",
|
|
23
23
|
propsAsIs: !1
|
|
24
|
-
}), p = () =>
|
|
24
|
+
}), p = () => t, g = /* @__PURE__ */ s(p())({
|
|
25
25
|
name: "StartScreenTitle",
|
|
26
26
|
class: "se4nn9a",
|
|
27
27
|
propsAsIs: !0
|
|
28
|
-
}), a = () =>
|
|
28
|
+
}), a = () => r, x = /* @__PURE__ */ s(a())({
|
|
29
29
|
name: "StartScreenDescription",
|
|
30
30
|
class: "sofug8s",
|
|
31
31
|
propsAsIs: !0
|
|
32
|
-
}), S = () =>
|
|
32
|
+
}), S = () => n, d = /* @__PURE__ */ s(S())({
|
|
33
33
|
name: "StartScreenButton",
|
|
34
34
|
class: "s18s0pjp",
|
|
35
35
|
propsAsIs: !0
|
|
36
|
+
}), _ = /* @__PURE__ */ s("div")({
|
|
37
|
+
name: "StartScreenNote",
|
|
38
|
+
class: "s1pgosw8",
|
|
39
|
+
propsAsIs: !1
|
|
36
40
|
});
|
|
37
41
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
u as IconArrowRight,
|
|
43
|
+
A as Main,
|
|
40
44
|
I as ScreenWrap,
|
|
41
45
|
f as SponsorIcon,
|
|
42
|
-
|
|
46
|
+
d as StartScreenButton,
|
|
43
47
|
x as StartScreenDescription,
|
|
48
|
+
_ as StartScreenNote,
|
|
44
49
|
v as StartScreenSponsor,
|
|
45
50
|
g as StartScreenTitle
|
|
46
51
|
};
|
|
@@ -1,108 +1,114 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as R } from "react/jsx-runtime";
|
|
2
2
|
import { ConnectError as T, Code as N } from "@connectrpc/connect";
|
|
3
3
|
import { cx as A } from "@linaria/core";
|
|
4
|
-
import { useCallback as P, useSyncExternalStore as F, useRef as b, useState as
|
|
5
|
-
import { EmergencyScreen as
|
|
6
|
-
import { EndScreen as
|
|
4
|
+
import { useCallback as P, useSyncExternalStore as F, useRef as b, useState as B, useMemo as M, useEffect as S } from "react";
|
|
5
|
+
import { EmergencyScreen as v } from "./EmergencyScreen/index.js";
|
|
6
|
+
import { EndScreen as V } from "./EndScreen/index.js";
|
|
7
7
|
import { LoaderScreen as D } from "./LoaderScreen/index.js";
|
|
8
8
|
import { QuestionScreen as H } from "./QuestionScreen/index.js";
|
|
9
|
-
import { ScreenContainer as
|
|
10
|
-
import { StartScreen as
|
|
9
|
+
import { ScreenContainer as I } from "./ScreenContainer/index.js";
|
|
10
|
+
import { StartScreen as L } from "./StartScreen/index.js";
|
|
11
11
|
import { settings as x } from "./constants.js";
|
|
12
|
-
import { Carousel as
|
|
13
|
-
function z(t,
|
|
14
|
-
let
|
|
15
|
-
return t.listen((
|
|
16
|
-
|
|
12
|
+
import { Carousel as w, desktopDots as K } from "./styles.js";
|
|
13
|
+
function z(t, o, c) {
|
|
14
|
+
let l = new Set(o).add(void 0);
|
|
15
|
+
return t.listen((n, s, p) => {
|
|
16
|
+
l.has(p) && c(n, s, p);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
(
|
|
22
|
-
[
|
|
23
|
-
),
|
|
24
|
-
return F(
|
|
19
|
+
function G(t, o = {}) {
|
|
20
|
+
let c = P(
|
|
21
|
+
(n) => o.keys ? z(t, o.keys, n) : t.listen(n),
|
|
22
|
+
[o.keys, t]
|
|
23
|
+
), l = t.get.bind(t);
|
|
24
|
+
return F(c, l, l);
|
|
25
25
|
}
|
|
26
|
-
const re = ({ gamification: t, autoplay:
|
|
27
|
-
const i = b(),
|
|
28
|
-
const e =
|
|
26
|
+
const re = ({ gamification: t, autoplay: o, swipeable: c, changeHeightOnInit: l, height: n, onEvent: s, centerPadding: p }) => {
|
|
27
|
+
const i = b(), d = b(null), [C, O] = B(!1), { data: r, error: f, loading: y } = G(t.betPack.getStore()), { listOfQuestions: m, countQuestionsAvailable: Q } = M(() => {
|
|
28
|
+
const e = r ? Object.values(r) : [];
|
|
29
29
|
return {
|
|
30
30
|
listOfQuestions: e,
|
|
31
|
-
countQuestionsAvailable: e.filter(({ marketClosed:
|
|
31
|
+
countQuestionsAvailable: e.filter(({ marketClosed: u }) => !u).length
|
|
32
32
|
};
|
|
33
|
-
}, [
|
|
34
|
-
|
|
35
|
-
!f && !y &&
|
|
33
|
+
}, [r]);
|
|
34
|
+
S(() => {
|
|
35
|
+
!f && !y && r !== void 0 && !C && s({
|
|
36
36
|
type: "slBetPackReady",
|
|
37
37
|
payload: {
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
39
39
|
// @ts-expect-error
|
|
40
40
|
next: () => {
|
|
41
41
|
var e;
|
|
42
|
-
return (e =
|
|
42
|
+
return (e = d.current) == null ? void 0 : e.slickNext();
|
|
43
43
|
},
|
|
44
44
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
45
45
|
// @ts-expect-error
|
|
46
46
|
prev: () => {
|
|
47
47
|
var e;
|
|
48
|
-
return (e =
|
|
48
|
+
return (e = d.current) == null ? void 0 : e.slickPrev();
|
|
49
49
|
},
|
|
50
50
|
current: 0,
|
|
51
51
|
canNext: !0,
|
|
52
52
|
canPrev: !1
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
}, [
|
|
55
|
+
}, [r, f, y, s]);
|
|
56
56
|
const h = P(
|
|
57
|
-
async (e,
|
|
57
|
+
async (e, u) => {
|
|
58
58
|
try {
|
|
59
|
-
O(!0), await t.betPackVote(e,
|
|
59
|
+
O(!0), await t.betPackVote(e, u), s({
|
|
60
|
+
type: "slVoted",
|
|
61
|
+
payload: {
|
|
62
|
+
questionId: e,
|
|
63
|
+
answerId: u
|
|
64
|
+
}
|
|
65
|
+
});
|
|
60
66
|
} finally {
|
|
61
|
-
i.current && clearTimeout(i.current),
|
|
67
|
+
i.current && clearTimeout(i.current), o && (i.current = setTimeout(() => {
|
|
62
68
|
var k;
|
|
63
|
-
(k =
|
|
69
|
+
(k = d.current) == null || k.slickNext();
|
|
64
70
|
}, 2e3));
|
|
65
71
|
}
|
|
66
72
|
},
|
|
67
|
-
[t,
|
|
73
|
+
[t, s, o]
|
|
68
74
|
);
|
|
69
|
-
if (
|
|
75
|
+
if (S(() => () => {
|
|
70
76
|
i.current && clearTimeout(i.current);
|
|
71
77
|
}, []), y)
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
if (!f && (
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
|
|
78
|
+
return /* @__PURE__ */ a(D, {});
|
|
79
|
+
if (!f && (r == null || !Object.keys(r).length))
|
|
80
|
+
return /* @__PURE__ */ a(
|
|
81
|
+
v,
|
|
76
82
|
{
|
|
77
|
-
actionFn: () =>
|
|
83
|
+
actionFn: () => s({ type: "slHardRefresh" }),
|
|
78
84
|
description: `It looks like we couldn't
|
|
79
85
|
load the questions.`,
|
|
80
|
-
isMobile:
|
|
81
|
-
height:
|
|
86
|
+
isMobile: c,
|
|
87
|
+
height: n
|
|
82
88
|
}
|
|
83
89
|
);
|
|
84
90
|
if (f)
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
|
|
91
|
+
return /* @__PURE__ */ a(
|
|
92
|
+
v,
|
|
87
93
|
{
|
|
88
|
-
actionFn: () =>
|
|
94
|
+
actionFn: () => s({ type: "slHardRefresh" }),
|
|
89
95
|
description: f instanceof T && f.code !== N.InvalidArgument ? `The event ID was not
|
|
90
96
|
specified or is invalid.` : `The server is unable to
|
|
91
97
|
handle this request.`,
|
|
92
|
-
isMobile:
|
|
93
|
-
height:
|
|
98
|
+
isMobile: c,
|
|
99
|
+
height: n
|
|
94
100
|
}
|
|
95
101
|
);
|
|
96
102
|
const j = (e) => {
|
|
97
|
-
var
|
|
98
|
-
if (
|
|
103
|
+
var u;
|
|
104
|
+
if (s({
|
|
99
105
|
type: "slBetPackChangeCard",
|
|
100
106
|
payload: {
|
|
101
107
|
current: e,
|
|
102
|
-
canNext: e < Object.keys(
|
|
108
|
+
canNext: e < Object.keys(r).length + 1,
|
|
103
109
|
canPrev: e >= 1
|
|
104
110
|
}
|
|
105
|
-
}), e !== 0 && e !== Object.keys(
|
|
111
|
+
}), e !== 0 && e !== Object.keys(r).length + 1 && ((u = m[e - 1]) != null && u.id)) {
|
|
106
112
|
t.openQuestion(m[e - 1].id, {
|
|
107
113
|
openedFrom: "bet-pack",
|
|
108
114
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -119,32 +125,24 @@ handle this request.`,
|
|
|
119
125
|
return;
|
|
120
126
|
}
|
|
121
127
|
t.closeQuestion();
|
|
122
|
-
}, g = (e) => e ? /* @__PURE__ */
|
|
128
|
+
}, g = (e) => e ? /* @__PURE__ */ a(I, { height: n, children: /* @__PURE__ */ a(H, { question: e, vote: h }) }, e.id) : null;
|
|
123
129
|
return /* @__PURE__ */ R(
|
|
124
|
-
|
|
130
|
+
w,
|
|
125
131
|
{
|
|
126
132
|
...x,
|
|
127
|
-
swipe:
|
|
128
|
-
onInit:
|
|
133
|
+
swipe: c,
|
|
134
|
+
onInit: l,
|
|
129
135
|
centerPadding: p || x.centerPadding,
|
|
130
136
|
afterChange: j,
|
|
131
137
|
beforeChange: () => {
|
|
132
138
|
i.current && clearTimeout(i.current);
|
|
133
139
|
},
|
|
134
|
-
ref:
|
|
135
|
-
className: A(!
|
|
140
|
+
ref: d,
|
|
141
|
+
className: A(!c && K),
|
|
136
142
|
children: [
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
height: o,
|
|
141
|
-
sliderRef: l,
|
|
142
|
-
countQuestionsAvailable: Q,
|
|
143
|
-
swipeable: r
|
|
144
|
-
}
|
|
145
|
-
),
|
|
146
|
-
Object.values(n).map(g),
|
|
147
|
-
/* @__PURE__ */ u(M, { onEvent: c, height: o, swipeable: r })
|
|
143
|
+
/* @__PURE__ */ a(L, { height: n, sliderRef: d, countQuestionsAvailable: Q }),
|
|
144
|
+
Object.values(r).map(g),
|
|
145
|
+
/* @__PURE__ */ a(V, { onEvent: s, height: n })
|
|
148
146
|
]
|
|
149
147
|
}
|
|
150
148
|
);
|