@streamlayer/react-ui 1.13.0 → 1.13.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.
@@ -13,4 +13,6 @@ export declare const AdvertisementUI: React.FC<{
13
13
  skipAutoClose?: boolean;
14
14
  externalAd?: Advertisement['externalAd'];
15
15
  controlVideo: ControlVideoCb;
16
+ advertisementPaused: boolean;
17
+ togglePause: (flag: boolean) => void;
16
18
  }>;
@@ -1,47 +1,53 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { PromotionType as r } from "@streamlayer/sdk-web-types";
3
- import { Banner as _ } from "./banner/index.js";
4
- import { Notification as a } from "./notification/index.js";
5
- import { Overlay as A } from "./overlay/index.js";
6
- import { Sidebar as M } from "./sidebar/index.js";
7
- import { OverlayContainer as d } from "./overlay/styles.js";
8
- const p = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11_LBAR || (i == null ? void 0 : i.type) === r.INGAME_IAB21_LBAR, q = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11 || (i == null ? void 0 : i.type) === r.INGAME_IAB21, P = ({
3
+ import { Banner as p } from "./banner/index.js";
4
+ import { Notification as q } from "./notification/index.js";
5
+ import { Overlay as N } from "./overlay/index.js";
6
+ import { Sidebar as E } from "./sidebar/index.js";
7
+ import { OverlayContainer as G } from "./overlay/styles.js";
8
+ const O = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11_LBAR || (i == null ? void 0 : i.type) === r.INGAME_IAB21_LBAR, a = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11 || (i == null ? void 0 : i.type) === r.INGAME_IAB21, x = ({
9
9
  advertisement: i,
10
- close: t,
10
+ close: l,
11
11
  skipTypeCheck: u,
12
- skipAutoClose: l,
13
- layoutMode: E = "side-by-side",
12
+ skipAutoClose: I,
13
+ layoutMode: d = "side-by-side",
14
14
  sidebar: n,
15
- isNotification: B,
15
+ isNotification: _,
16
16
  banner: f,
17
- markAsViewed: I,
18
- open: N,
17
+ markAsViewed: t,
18
+ open: M,
19
19
  externalAd: y,
20
- controlVideo: c
21
- }) => i.promotion ? B && i.notification ? /* @__PURE__ */ o(a, { open: N, notification: i.notification, promotionId: i.question.id }) : !n && !f && (u || q(i.promotion)) ? /* @__PURE__ */ o(d, { className: "PromoOverlayContainer", children: /* @__PURE__ */ o(
22
- A,
20
+ controlVideo: c,
21
+ advertisementPaused: A,
22
+ togglePause: B
23
+ }) => i.promotion ? _ && i.notification ? /* @__PURE__ */ o(q, { open: M, notification: i.notification, promotionId: i.question.id }) : !n && !f && (u || a(i.promotion)) ? /* @__PURE__ */ o(G, { className: "PromoOverlayContainer", children: /* @__PURE__ */ o(
24
+ N,
23
25
  {
24
- markAsViewed: I,
26
+ markAsViewed: t,
25
27
  promotionId: i.question.id,
26
28
  promotion: i.promotion,
27
- onClose: t,
28
- skipAutoClose: l,
29
+ onClose: l,
30
+ skipAutoClose: I,
29
31
  externalAd: y,
30
- controlVideo: c
32
+ controlVideo: c,
33
+ advertisementPaused: A,
34
+ togglePause: B
31
35
  }
32
- ) }) : n && (u || p(i.promotion)) ? /* @__PURE__ */ o(M, { className: "PromoSidebarContainer", direction: n, hiding: !1, children: /* @__PURE__ */ o(
33
- A,
36
+ ) }) : n && (u || O(i.promotion)) ? /* @__PURE__ */ o(E, { className: "PromoSidebarContainer", direction: n, hiding: !1, children: /* @__PURE__ */ o(
37
+ N,
34
38
  {
35
- markAsViewed: I,
39
+ markAsViewed: t,
36
40
  promotionId: i.question.id,
37
41
  promotion: i.promotion,
38
42
  externalAd: y,
39
- onClose: t,
43
+ onClose: l,
40
44
  controlVideo: c,
41
- skipAutoClose: l
45
+ skipAutoClose: I,
46
+ advertisementPaused: A,
47
+ togglePause: B
42
48
  }
43
49
  ) }) : f ? /* @__PURE__ */ o(
44
- _,
50
+ p,
45
51
  {
46
52
  promotionId: i.question.id,
47
53
  hiding: !1,
@@ -50,5 +56,5 @@ const p = (i) => (i == null ? void 0 : i.type) === r.INGAME_IAB11_LBAR || (i ==
50
56
  }
51
57
  ) : null : null;
52
58
  export {
53
- P as AdvertisementUI
59
+ x as AdvertisementUI
54
60
  };
@@ -11,5 +11,7 @@ export type OverlayProps = {
11
11
  inSidebar?: boolean;
12
12
  externalAd?: Advertisement['externalAd'];
13
13
  controlVideo: ControlVideoCb;
14
+ advertisementPaused: boolean;
15
+ togglePause: (flag: boolean) => void;
14
16
  };
15
17
  export declare const Overlay: React.FC<OverlayProps>;
@@ -1,101 +1,113 @@
1
- import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
- import { cx as W } from "@linaria/core";
3
- import { useState as Z, useEffect as $ } from "react";
4
- import { eventBus as oo } from "@streamlayer/sdk-web-interfaces";
5
- import { PromotionType as q, PromotionLogoMode as l, AutoPlayVideo as eo, PromotionButtonType as ro } from "@streamlayer/sdk-web-types";
6
- import { CloseButton as to } from "../../close-btn/index.js";
7
- import { VideoPlayer as no } from "../../video-player/index.js";
8
- import { ExternalAdOverlay as ao } from "./externalAd/index.js";
9
- import { PromoOverlay as lo, Header as io, HeaderContent as so, headerContentShift as mo, SponsorLogo as z, Sponsor as co, SponsorName as po, SponsorText as uo, ADLogo as yo, SponsoredText as fo, Media as bo, shiftMedia as go, Content as J, PromoImg as ho, Title as Po, hideOnMobile as Ao, Description as To, ActionBtnWrap as No, ActionButton as vo } from "./styles.js";
10
- import { OverlayContainer as _o } from "./styles.js";
11
- const Do = (c) => {
12
- var y, f, b, g, h, P, A, T, N, v, x, B, C, E, O, M, S, L, I, D, R, U, _, k, F, V, j, G, H, w;
13
- const { promotion: o, controlVideo: t, skipAutoClose: K, promotionId: a, onClose: Q, markAsViewed: i, externalAd: p } = c, s = o.type === q.INGAME_IAB11_LBAR || o.type === q.INGAME_IAB11, d = ((y = o.sponsor) == null ? void 0 : y.logo) && o.logoMode === l.CENTER, X = !!((b = (f = o.banner) == null ? void 0 : f.video) != null && b.url), m = o.autoPlayVideo === eo.ENABLED, [Y, u] = Z(!X || !m);
14
- if ($(() => {
15
- a && o.type && i && i();
16
- }, [a, o.type, i]), $(() => () => {
17
- t == null || t({ muted: !1 });
18
- }, [t]), p)
19
- return /* @__PURE__ */ e(ao, { ...c, externalAd: p });
20
- let n = (g = o.banner) == null ? void 0 : g.url;
21
- return n && n.indexOf("http") !== 0 && (n = `https://${n}`), /* @__PURE__ */ r(lo, { className: "PromoOverlay", children: [
22
- /* @__PURE__ */ r(io, { children: [
23
- /* @__PURE__ */ r(so, { className: W(!d && mo), children: [
24
- ((h = o.sponsor) == null ? void 0 : h.logo) && o.logoMode === l.LEFT && /* @__PURE__ */ e(z, { src: (P = o.sponsor) == null ? void 0 : P.logo, alt: "promo" }),
25
- /* @__PURE__ */ r(
26
- co,
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import { cx as $ } from "@linaria/core";
3
+ import { useEffect as c } from "react";
4
+ import { eventBus as Z } from "@streamlayer/sdk-web-interfaces";
5
+ import { PromotionType as q, PromotionLogoMode as i, AutoPlayVideo as oo, PromotionButtonType as eo } from "@streamlayer/sdk-web-types";
6
+ import { CloseButton as ro } from "../../close-btn/index.js";
7
+ import { VideoPlayer as to } from "../../video-player/index.js";
8
+ import { ExternalAdOverlay as no } from "./externalAd/index.js";
9
+ import { PromoOverlay as ao, Header as lo, HeaderContent as io, headerContentShift as so, SponsorLogo as z, Sponsor as mo, SponsorName as po, SponsorText as co, ADLogo as yo, SponsoredText as uo, Media as fo, shiftMedia as bo, Content as J, PromoImg as ho, Title as Ao, hideOnMobile as To, Description as vo, ActionBtnWrap as No, ActionButton as xo } from "./styles.js";
10
+ import { OverlayContainer as Uo } from "./styles.js";
11
+ const Io = (y) => {
12
+ var f, b, h, A, T, v, N, x, P, B, C, E, g, O, M, L, S, I, D, R, U, _, k, F, V, j, G, H, w, W;
13
+ const {
14
+ promotion: o,
15
+ advertisementPaused: K,
16
+ togglePause: r,
17
+ controlVideo: n,
18
+ skipAutoClose: Q,
19
+ promotionId: l,
20
+ onClose: X,
21
+ markAsViewed: s,
22
+ externalAd: u
23
+ } = y, d = o.type === q.INGAME_IAB11_LBAR || o.type === q.INGAME_IAB11, m = ((f = o.sponsor) == null ? void 0 : f.logo) && o.logoMode === i.CENTER, Y = !!((h = (b = o.banner) == null ? void 0 : b.video) != null && h.url), p = o.autoPlayVideo === oo.ENABLED;
24
+ if (c(() => {
25
+ r == null || r(Y || p);
26
+ }, []), c(() => {
27
+ l && o.type && s && s();
28
+ }, [l, o.type, s]), c(() => () => {
29
+ n == null || n({ muted: !1 });
30
+ }, [n]), u)
31
+ return /* @__PURE__ */ e(no, { ...y, externalAd: u });
32
+ let a = (A = o.banner) == null ? void 0 : A.url;
33
+ return a && a.indexOf("http") !== 0 && (a = `https://${a}`), /* @__PURE__ */ t(ao, { className: "PromoOverlay", children: [
34
+ /* @__PURE__ */ t(lo, { children: [
35
+ /* @__PURE__ */ t(io, { className: $(!m && so), children: [
36
+ ((T = o.sponsor) == null ? void 0 : T.logo) && o.logoMode === i.LEFT && /* @__PURE__ */ e(z, { src: (v = o.sponsor) == null ? void 0 : v.logo, alt: "promo" }),
37
+ /* @__PURE__ */ t(
38
+ mo,
27
39
  {
28
40
  style: {
29
- paddingLeft: (A = o.sponsor) != null && A.logo && o.logoMode === l.LEFT ? "0px" : "8px"
41
+ paddingLeft: (N = o.sponsor) != null && N.logo && o.logoMode === i.LEFT ? "0px" : "8px"
30
42
  },
31
43
  children: [
32
- ((T = o.sponsor) == null ? void 0 : T.logo) && o.logoMode === l.LEFT && /* @__PURE__ */ e(po, { children: (N = o.sponsor) == null ? void 0 : N.name }),
33
- /* @__PURE__ */ r(uo, { className: "SponsorText", children: [
44
+ ((x = o.sponsor) == null ? void 0 : x.logo) && o.logoMode === i.LEFT && /* @__PURE__ */ e(po, { children: (P = o.sponsor) == null ? void 0 : P.name }),
45
+ /* @__PURE__ */ t(co, { className: "SponsorText", children: [
34
46
  /* @__PURE__ */ e(yo, { children: "AD" }),
35
- /* @__PURE__ */ e(fo, { children: "SPONSORED" })
47
+ /* @__PURE__ */ e(uo, { children: "SPONSORED" })
36
48
  ] })
37
49
  ]
38
50
  }
39
51
  )
40
52
  ] }),
41
53
  /* @__PURE__ */ e(
42
- to,
54
+ ro,
43
55
  {
44
56
  className: "ClosePromoIcon",
45
- close: Q,
46
- autoClose: (v = o.closeTimer) == null ? void 0 : v.auto,
47
- duration: K ? 0 : (x = o.closeTimer) == null ? void 0 : x.seconds,
48
- isPlaying: Y
57
+ close: X,
58
+ autoClose: (B = o.closeTimer) == null ? void 0 : B.auto,
59
+ duration: Q ? 0 : (C = o.closeTimer) == null ? void 0 : C.seconds,
60
+ isPlaying: !K
49
61
  }
50
62
  )
51
63
  ] }),
52
- /* @__PURE__ */ r(bo, { children: [
53
- d && /* @__PURE__ */ e(z, { className: go, src: (B = o.sponsor) == null ? void 0 : B.logo, alt: "promo" }),
54
- /* @__PURE__ */ e(J, { children: (E = (C = o.banner) == null ? void 0 : C.video) != null && E.url ? /* @__PURE__ */ e(
55
- no,
64
+ /* @__PURE__ */ t(fo, { children: [
65
+ m && /* @__PURE__ */ e(z, { className: bo, src: (E = o.sponsor) == null ? void 0 : E.logo, alt: "promo" }),
66
+ /* @__PURE__ */ e(J, { children: (O = (g = o.banner) == null ? void 0 : g.video) != null && O.url ? /* @__PURE__ */ e(
67
+ to,
56
68
  {
57
- source: (M = (O = o.banner) == null ? void 0 : O.video) == null ? void 0 : M.url,
58
- poster: (L = (S = o.banner) == null ? void 0 : S.video) == null ? void 0 : L.thumbnailUrl,
59
- aspectRatio: s ? "1/1" : "16/9",
69
+ source: (L = (M = o.banner) == null ? void 0 : M.video) == null ? void 0 : L.url,
70
+ poster: (I = (S = o.banner) == null ? void 0 : S.video) == null ? void 0 : I.thumbnailUrl,
71
+ aspectRatio: d ? "1/1" : "16/9",
60
72
  onPause: () => {
61
- m && u(!1);
73
+ p && (r == null || r(!0));
62
74
  },
63
75
  onPlay: () => {
64
- oo.emit("advertisement", {
76
+ Z.emit("advertisement", {
65
77
  action: "videoPlay",
66
78
  payload: {
67
- id: a,
79
+ id: l,
68
80
  type: o.type
69
81
  }
70
- }), u(!0);
82
+ }), r == null || r(!1);
71
83
  },
72
- controlVideo: t,
73
- autoPlay: m
84
+ controlVideo: n,
85
+ autoPlay: p
74
86
  }
75
- ) : (I = o.banner) != null && I.imageUrl ? /* @__PURE__ */ e(ho, { style: s ? { aspectRatio: "1/1" } : {}, src: (D = o.banner) == null ? void 0 : D.imageUrl, alt: "promo" }) : null }),
76
- !s && /* @__PURE__ */ r(J, { children: [
77
- ((R = o.banner) == null ? void 0 : R.title) && /* @__PURE__ */ e(Po, { className: W("AdvTitle", d && Ao), children: (U = o.banner) == null ? void 0 : U.title }),
78
- ((_ = o.banner) == null ? void 0 : _.body) && /* @__PURE__ */ e(To, { className: "AdvDescription", children: (k = o.banner) == null ? void 0 : k.body })
87
+ ) : (D = o.banner) != null && D.imageUrl ? /* @__PURE__ */ e(ho, { style: d ? { aspectRatio: "1/1" } : {}, src: (R = o.banner) == null ? void 0 : R.imageUrl, alt: "promo" }) : null }),
88
+ !d && /* @__PURE__ */ t(J, { children: [
89
+ ((U = o.banner) == null ? void 0 : U.title) && /* @__PURE__ */ e(Ao, { className: $("AdvTitle", m && To), children: (_ = o.banner) == null ? void 0 : _.title }),
90
+ ((k = o.banner) == null ? void 0 : k.body) && /* @__PURE__ */ e(vo, { className: "AdvDescription", children: (F = o.banner) == null ? void 0 : F.body })
79
91
  ] })
80
92
  ] }),
81
- o.buttonType !== ro.NO_BUTTON && /* @__PURE__ */ e(No, { children: /* @__PURE__ */ e(
82
- vo,
93
+ o.buttonType !== eo.NO_BUTTON && /* @__PURE__ */ e(No, { children: /* @__PURE__ */ e(
94
+ xo,
83
95
  {
84
- href: n,
96
+ href: a,
85
97
  style: {
86
- backgroundColor: ((V = (F = o.banner) == null ? void 0 : F.ctaButton) == null ? void 0 : V.color) || "#009dc4",
87
- color: ((G = (j = o.banner) == null ? void 0 : j.ctaButton) == null ? void 0 : G.textColor) || "#fff"
98
+ backgroundColor: ((j = (V = o.banner) == null ? void 0 : V.ctaButton) == null ? void 0 : j.color) || "#009dc4",
99
+ color: ((H = (G = o.banner) == null ? void 0 : G.ctaButton) == null ? void 0 : H.textColor) || "#fff"
88
100
  },
89
101
  "data-analytics": "button",
90
- "data-promo-id": a,
102
+ "data-promo-id": l,
91
103
  "data-promo-type": o.type,
92
104
  target: "_blank",
93
- children: (w = (H = o.banner) == null ? void 0 : H.ctaButton) == null ? void 0 : w.label
105
+ children: (W = (w = o.banner) == null ? void 0 : w.ctaButton) == null ? void 0 : W.label
94
106
  }
95
107
  ) })
96
108
  ] });
97
109
  };
98
110
  export {
99
- Do as Overlay,
100
- _o as OverlayContainer
111
+ Io as Overlay,
112
+ Uo as OverlayContainer
101
113
  };
@@ -1,37 +1,45 @@
1
- import { jsxs as t, jsx as a, Fragment as p } from "react/jsx-runtime";
2
- import { QuestionType as l } from "@streamlayer/sdk-web-types";
3
- import { QuestionTypeData as T } from "../../constants.js";
4
- import { Insight as f } from "./insight/index.js";
5
- import { Container as E, CloseIconWrap as I, CloseIcon as h, Header as C, TypeIcon as A, TypeName as W, Question as s, AnswerButton as x } from "./styles.js";
6
- import { Tweet as D } from "./tweet/index.js";
7
- const k = ({
8
- close: d,
1
+ import { jsxs as m, jsx as a, Fragment as T } from "react/jsx-runtime";
2
+ import { QuestionType as o } from "@streamlayer/sdk-web-types";
3
+ import { QuestionTypeData as f } from "../../constants.js";
4
+ import { Insight as E } from "./insight/index.js";
5
+ import { Container as I, CloseIconWrap as h, CloseIcon as C, Header as A, TypeIcon as W, TypeName as s, Question as x, AnswerButton as D } from "./styles.js";
6
+ import { Tweet as g } from "./tweet/index.js";
7
+ const w = ({
8
+ close: i,
9
9
  action: n,
10
10
  controlVideo: c,
11
- data: { questionType: r, question: o, insight: e, tweet: i }
11
+ data: { questionType: r, question: t, insight: e, tweet: p }
12
12
  }) => {
13
- const m = T[r];
14
- return m ? /* @__PURE__ */ t(E, { style: r === l.TWEET ? { paddingTop: "12px" } : {}, children: [
15
- /* @__PURE__ */ a(I, { onClick: d, children: /* @__PURE__ */ a(h, { name: "icon-cross" }) }),
16
- r !== l.TWEET && /* @__PURE__ */ t(C, { children: [
13
+ const l = f[r];
14
+ return l ? /* @__PURE__ */ m(I, { onClick: n, style: r === o.TWEET ? { paddingTop: "12px" } : {}, children: [
15
+ /* @__PURE__ */ a(
16
+ h,
17
+ {
18
+ onClick: (d) => {
19
+ d.stopPropagation(), i && i(d);
20
+ },
21
+ children: /* @__PURE__ */ a(C, { name: "icon-cross" })
22
+ }
23
+ ),
24
+ r !== o.TWEET && /* @__PURE__ */ m(A, { children: [
17
25
  /* @__PURE__ */ a(
18
- A,
26
+ W,
19
27
  {
20
- "data-type-trivia": r === l.TRIVIA,
21
- "data-type-poll": r === l.POLL,
22
- name: m.iconName
28
+ "data-type-trivia": r === o.TRIVIA,
29
+ "data-type-poll": r === o.POLL,
30
+ name: l.iconName
23
31
  }
24
32
  ),
25
- /* @__PURE__ */ a(W, { children: m.label })
33
+ /* @__PURE__ */ a(s, { children: l.label })
26
34
  ] }),
27
- r === l.FACTOID && e && /* @__PURE__ */ a(f, { ...e, action: n, controlVideo: c }),
28
- r === l.TWEET && i && /* @__PURE__ */ a(D, { ...i, action: n, controlVideo: c }),
29
- r !== l.FACTOID && r !== l.TWEET && /* @__PURE__ */ t(p, { children: [
30
- /* @__PURE__ */ a(s, { children: o == null ? void 0 : o.title }),
31
- /* @__PURE__ */ a(x, { onClick: n, children: "Answer" })
35
+ r === o.FACTOID && e && /* @__PURE__ */ a(E, { ...e, action: n, controlVideo: c }),
36
+ r === o.TWEET && p && /* @__PURE__ */ a(g, { ...p, action: n, controlVideo: c }),
37
+ r !== o.FACTOID && r !== o.TWEET && /* @__PURE__ */ m(T, { children: [
38
+ /* @__PURE__ */ a(x, { children: t == null ? void 0 : t.title }),
39
+ /* @__PURE__ */ a(D, { children: "Answer" })
32
40
  ] })
33
41
  ] }) : null;
34
42
  };
35
43
  export {
36
- k as Notification
44
+ w as Notification
37
45
  };
@@ -1,95 +1,97 @@
1
- import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
- import { useState as y, useLayoutEffect as U } from "react";
3
- import { QuestionImages as a, QuestionType as i, QuestionStatus as D } from "@streamlayer/sdk-web-types";
4
- import { AnimatedCounter as W } from "../../../animated-counter/index.js";
5
- import { IconDefault as $, IconContainer as F, IconWrap as M, IconCircle as z, ButtonContainer as G, ButtonPctWrap as H, ButtonPct as J, ButtonBody as K, Title as X, Pts as Y, Indicators as Z, CheckIcon as _, Percentage as q } from "./styles.js";
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { useState as V, useLayoutEffect as W } from "react";
3
+ import { QuestionImages as a, QuestionType as o, QuestionStatus as p } from "@streamlayer/sdk-web-types";
4
+ import { AnimatedCounter as $ } from "../../../animated-counter/index.js";
5
+ import { IconDefault as y, IconContainer as F, IconWrap as M, IconCircle as z, ButtonContainer as G, ButtonPctWrap as H, ButtonPct as J, ButtonBody as K, Title as X, Pts as Y, Indicators as Z, CheckIcon as _, Percentage as q } from "./styles.js";
6
6
  const E = {
7
- [a.CENTERED]: (t) => /* @__PURE__ */ e($, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
7
+ [a.CENTERED]: (t) => /* @__PURE__ */ e(y, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
8
8
  [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
9
9
  [a.ROUNDED]: (t) => /* @__PURE__ */ e(z, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
10
10
  [a.NONE]: () => null,
11
11
  [a.UNSET]: () => null
12
- }, tt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: o, questionVoted: r }) => {
13
- if (t === i.POLL && o)
12
+ }, tt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
13
+ if (t === o.POLL && r)
14
14
  return "voted";
15
- if (t === i.PREDICTION) {
16
- if (c && r)
17
- return o ? n ? "correct" : "incorrect" : "unset";
18
- if (o)
15
+ if (t === o.PREDICTION) {
16
+ if (!c && i)
17
+ return r ? "voted" : "unset";
18
+ if (c && i)
19
+ return r ? n ? "correct" : "incorrect" : "unset";
20
+ if (r)
19
21
  return "correct";
20
22
  }
21
- return t === i.TRIVIA && r && o ? n ? "correct" : "incorrect" : "unset";
23
+ return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
22
24
  }, et = ({
23
25
  questionType: t,
24
26
  questionVoted: c,
25
27
  correct: n,
26
- hasCorrectAnswer: o,
27
- questionStatus: r
28
- }) => t === i.TRIVIA ? c && n : t === i.PREDICTION ? c && n && o || r === D.RESOLVED && n : !1, st = (t) => {
29
- var p;
28
+ hasCorrectAnswer: r,
29
+ questionStatus: i
30
+ }) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === p.RESOLVED && n : !1, st = (t) => {
31
+ var S;
30
32
  const {
31
33
  // option props
32
34
  id: c,
33
35
  icon: n,
34
- text: o,
35
- percentageDecimal: r,
36
- points: g,
36
+ text: r,
37
+ percentageDecimal: i,
38
+ points: D,
37
39
  // extra props
38
- onVote: w,
39
- markThatVoted: A,
40
- onPercentsAnimated: I,
41
- youSelected: m,
42
- youVoted: O,
40
+ onVote: v,
41
+ markThatVoted: O,
42
+ onPercentsAnimated: f,
43
+ youSelected: h,
44
+ youVoted: g,
43
45
  questionVoted: s,
44
46
  imageMode: C,
45
- answerTimeExpired: v,
47
+ answerTimeExpired: w,
46
48
  questionStatus: P,
47
- isLoading: k,
49
+ isLoading: A,
48
50
  questionType: d,
49
- correct: x,
50
- hasCorrectAnswer: L,
51
- votedAfterQuestionClosed: B,
51
+ correct: k,
52
+ hasCorrectAnswer: x,
53
+ votedAfterQuestionClosed: L,
52
54
  enteredAnActiveQuestion: R,
53
- marketClosed: h
54
- } = t, [Q, T] = y(0), l = tt(t), V = et({ questionType: d, questionVoted: s, correct: x, hasCorrectAnswer: L, questionStatus: P }), u = h && d === i.PREDICTION, N = s || u, b = d === i.PREDICTION && !s && !h, S = s && !m && l !== "incorrect" && !O;
55
- return console.log({ isNotChecked: S, questionVoted: s, youSelected: m, answerState: l }), U(() => {
55
+ marketClosed: I
56
+ } = t, [B, T] = V(0), m = tt(t), Q = et({ questionType: d, questionVoted: s, correct: k, hasCorrectAnswer: x, questionStatus: P }), u = I && d === o.PREDICTION, N = s || u, b = d === o.PREDICTION && !s && !I, j = s && !h && m !== "incorrect" && !g;
57
+ return W(() => {
56
58
  T(0), requestAnimationFrame(() => {
57
- T(r);
59
+ T(i);
58
60
  });
59
- }, [r]), /* @__PURE__ */ f(
61
+ }, [i]), /* @__PURE__ */ l(
60
62
  G,
61
63
  {
62
64
  value: c,
63
- "data-selected": m,
64
- "data-answer-state": l,
65
- disabled: s || k || v || u && !R || u && R && B,
66
- "data-is-not-checked": S,
67
- onClick: (j) => {
68
- A(
69
- d === i.PREDICTION ? h : P === D.RESOLVED
70
- ), w(j);
65
+ "data-selected": h,
66
+ "data-answer-state": m,
67
+ disabled: s || A || w || u && !R || u && R && L,
68
+ "data-is-not-checked": j,
69
+ onClick: (U) => {
70
+ O(
71
+ d === o.PREDICTION ? I : P === p.RESOLVED
72
+ ), v(U);
71
73
  },
72
74
  children: [
73
75
  /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
74
76
  J,
75
77
  {
76
- "data-answer-state": l,
77
- style: { width: `${N ? Q : 0}%` },
78
+ "data-answer-state": m,
79
+ style: { width: `${N ? B : 0}%` },
78
80
  onTransitionEnd: () => {
79
- u || I == null || I();
81
+ u || f == null || f();
80
82
  }
81
83
  }
82
84
  ) }),
83
- /* @__PURE__ */ f(K, { children: [
84
- n && C && ((p = E[C]) == null ? void 0 : p.call(E, n)),
85
- /* @__PURE__ */ e(X, { children: o }),
86
- b && /* @__PURE__ */ f("div", { children: [
87
- g,
85
+ /* @__PURE__ */ l(K, { children: [
86
+ n && C && ((S = E[C]) == null ? void 0 : S.call(E, n)),
87
+ /* @__PURE__ */ e(X, { children: r }),
88
+ b && /* @__PURE__ */ l("div", { children: [
89
+ D,
88
90
  /* @__PURE__ */ e(Y, { children: "pts" })
89
91
  ] }),
90
- N && /* @__PURE__ */ f(Z, { children: [
91
- V && /* @__PURE__ */ e(_, { name: "selected" }),
92
- /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(W, { value: r, suffix: "%" }) })
92
+ N && /* @__PURE__ */ l(Z, { children: [
93
+ Q && /* @__PURE__ */ e(_, { name: "selected" }),
94
+ /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e($, { value: i, suffix: "%" }) })
93
95
  ] })
94
96
  ] })
95
97
  ]
@@ -52,6 +52,9 @@ export declare const COLORS: {
52
52
  VOTE_BTN_NOT_SELECTED_BORDER: string;
53
53
  VOTE_BTN_SELECTED_BG: string;
54
54
  VOTE_BTN_NOT_SELECTED_BG: string;
55
+ VOTE_BTN_NOT_SELECTED_BG_UNSET: string;
56
+ VOTED_ANSWER_BG: string;
57
+ VOTED_BTN_RCT_BG: string;
55
58
  };
56
59
  export declare const COLORS_ADVERTISEMENT: {
57
60
  BG_PRIMARY: string;
@@ -1,4 +1,4 @@
1
- const T = {
1
+ const R = {
2
2
  BLUE_QUESTION_ACTION_BTN: "#1589ee",
3
3
  WHITE: "#FFFFFF",
4
4
  BLUE: "#2d6ffd",
@@ -36,7 +36,7 @@ const T = {
36
36
  SDK_PREDICTION_FEEDBACK_SUCCESS_ICON: "#107D57",
37
37
  SDK_PREDICTION_FEEDBACK_INCORRECT_RECT1: "#CD2525",
38
38
  SDK_PREDICTION_FEEDBACK_INCORRECT_RECT2: "#fff",
39
- PREDICTION_BG_LINES_CORRECT: "#095CD1",
39
+ PREDICTION_BG_LINES_CORRECT: "#01AB58",
40
40
  PREDICTION_BG_LINES_INCORRECT: "#888B8D",
41
41
  SKELETON_COLOR_1: "#f1efef",
42
42
  SKELETON_COLOR_2: "#f9f8f8",
@@ -48,12 +48,15 @@ const T = {
48
48
  CARD_BORDER: "#fff",
49
49
  BORDER: "#E8E8E8",
50
50
  VOTE_BTN_BG: "#F7F7F7",
51
- VOTE_BTN_BORDER: "transparent",
51
+ VOTE_BTN_BORDER: "rgb(232, 232, 232)",
52
52
  VOTE_BTN_DISABLED_BORDER: "#B1B3B3",
53
53
  VOTE_BTN_SELECTED_BORDER: "#25282A",
54
54
  VOTE_BTN_NOT_SELECTED_BORDER: "#E8E8E8",
55
55
  VOTE_BTN_SELECTED_BG: "#FFFFFF",
56
- VOTE_BTN_NOT_SELECTED_BG: "#FFFFFF"
56
+ VOTE_BTN_NOT_SELECTED_BG: "#FFFFFF",
57
+ VOTE_BTN_NOT_SELECTED_BG_UNSET: "rgb(196, 196, 196)",
58
+ VOTED_ANSWER_BG: "#FFFFFF",
59
+ VOTED_BTN_RCT_BG: "#2d5694"
57
60
  }, F = {
58
61
  BG_PRIMARY: "#13212b",
59
62
  BG_SECONDARY: "#152430",
@@ -64,7 +67,7 @@ const T = {
64
67
  TEXT_SECONDARY: "rgba(255, 255, 255, 0.8)",
65
68
  TEXT_SECONDARY1: "#878787",
66
69
  WHITE: "#fff"
67
- }, D = ["#107D57", "#DF2F3B", "#DF2F3B", "#E8E8E8"], I = "#cee5de", O = "#f9d6d8", S = "#E8E8E8", A = {
70
+ }, D = ["#107D57", "#DF2F3B", "#DF2F3B", "#E8E8E8"], O = "#cee5de", S = "#f9d6d8", I = "#E8E8E8", A = {
68
71
  REGULAR: "'SF Pro Text', Arial, Helvetica, sans-serif",
69
72
  SERIF: "'SF Pro Display', Arial, Helvetica, sans-serif",
70
73
  COLOR: "#fff",
@@ -77,33 +80,33 @@ const T = {
77
80
  SIZE_DEFAULT2: "12px",
78
81
  LINE_HEIGHT: "24px",
79
82
  MARGIN_TITLE_DEFAULT: "24px 0px"
80
- }, C = {
83
+ }, N = {
81
84
  xs: 324,
82
85
  sm: 576,
83
86
  md: 768,
84
87
  lg: 992,
85
88
  xl: 1200,
86
89
  xxl: 1440
87
- }, N = {
90
+ }, C = {
88
91
  landscape: "landscape",
89
92
  portrait: "portrait"
90
- }, B = Object.entries(T).reduce((E, [_, R]) => `
93
+ }, B = Object.entries(R).reduce((E, [_, T]) => `
91
94
  ${E}
92
- --color-${_.toLowerCase().replaceAll("_", "-")}: ${R};
93
- `, ""), L = Object.entries(F).reduce((E, [_, R]) => `
95
+ --color-${_.toLowerCase().replaceAll("_", "-")}: ${T};
96
+ `, ""), L = Object.entries(F).reduce((E, [_, T]) => `
94
97
  ${E}
95
- --color-adv-${_.toLowerCase().replaceAll("_", "-")}: ${R};
98
+ --color-adv-${_.toLowerCase().replaceAll("_", "-")}: ${T};
96
99
  `, "");
97
100
  export {
98
- C as BREAKPOINTS,
99
- T as COLORS,
101
+ N as BREAKPOINTS,
102
+ R as COLORS,
100
103
  F as COLORS_ADVERTISEMENT,
101
104
  A as FONT,
102
- N as ORIENTATION,
105
+ C as ORIENTATION,
103
106
  D as TIMER_COLORS,
104
- S as TIMER_GRAY,
105
- I as TIMER_GREEN,
106
- O as TIMER_RED,
107
+ I as TIMER_GRAY,
108
+ O as TIMER_GREEN,
109
+ S as TIMER_RED,
107
110
  B as colors,
108
111
  L as colorsAdvertisement
109
112
  };