@streamlayer/react 1.24.5 → 1.24.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/lib/cjs/Question.js +1 -1
  2. package/lib/cjs/advertisement.js +26 -26
  3. package/lib/cjs/bet-pack.js +1 -1
  4. package/lib/cjs/feature.js +1 -1
  5. package/lib/cjs/{index-DvqmgCor.js → index-CfSdnrfA.js} +1 -1
  6. package/lib/cjs/index10.js +1 -1
  7. package/lib/cjs/index11.js +1 -1
  8. package/lib/cjs/index12.js +1 -1
  9. package/lib/cjs/index13.js +4 -1
  10. package/lib/cjs/index14.js +1 -4
  11. package/lib/cjs/index15.js +1 -1
  12. package/lib/cjs/index16.js +2 -2
  13. package/lib/cjs/index2.js +1 -1
  14. package/lib/cjs/index4.js +3 -3
  15. package/lib/cjs/index6.js +1 -1
  16. package/lib/cjs/index7.js +1 -1
  17. package/lib/cjs/index9.js +2 -2
  18. package/lib/cjs/insight.js +1 -1
  19. package/lib/cjs/masters2.js +3 -3
  20. package/lib/cjs/notification.js +1 -1
  21. package/lib/cjs/pause-ad.js +1 -1
  22. package/lib/cjs/points.js +1 -1
  23. package/lib/cjs/polymarket.js +1 -1
  24. package/lib/cjs/storage.js +1 -1
  25. package/lib/cjs/useStreamLayerApp2.js +13 -13
  26. package/lib/classic/cjs/Question.js +1 -1
  27. package/lib/classic/cjs/advertisement.js +26 -26
  28. package/lib/classic/cjs/bet-pack.js +3 -3
  29. package/lib/classic/cjs/feature.js +1 -1
  30. package/lib/classic/cjs/{index-DvqmgCor.js → index-CfSdnrfA.js} +1 -1
  31. package/lib/classic/cjs/index10.js +1 -1
  32. package/lib/classic/cjs/index11.js +1 -1
  33. package/lib/classic/cjs/index12.js +1 -1
  34. package/lib/classic/cjs/index13.js +1 -1
  35. package/lib/classic/cjs/index2.js +2 -2
  36. package/lib/classic/cjs/index5.js +1 -1
  37. package/lib/classic/cjs/index7.js +2 -2
  38. package/lib/classic/cjs/index8.js +1 -1
  39. package/lib/classic/cjs/index9.js +1 -1
  40. package/lib/classic/cjs/insight.js +1 -1
  41. package/lib/classic/cjs/notification2.js +1 -1
  42. package/lib/classic/cjs/pause-ad.js +1 -1
  43. package/lib/classic/cjs/points.js +1 -1
  44. package/lib/classic/cjs/polymarket.js +1 -1
  45. package/lib/classic/cjs/useStreamLayerApp2.js +13 -13
  46. package/lib/classic/es/Question.js +313 -198
  47. package/lib/classic/es/advertisement.js +1988 -1955
  48. package/lib/classic/es/bet-pack.js +12 -13
  49. package/lib/classic/es/feature.js +188 -37
  50. package/lib/{es/index-DvqmgCor.js → classic/es/index-CfSdnrfA.js} +1 -1
  51. package/lib/classic/es/index10.js +309 -2580
  52. package/lib/classic/es/index11.js +2580 -305
  53. package/lib/classic/es/index12.js +12 -12
  54. package/lib/classic/es/index13.js +2 -2
  55. package/lib/classic/es/index2.js +129 -121
  56. package/lib/classic/es/index5.js +0 -1
  57. package/lib/classic/es/index7.js +2 -2
  58. package/lib/classic/es/index8.js +1 -1
  59. package/lib/classic/es/index9.js +1 -1
  60. package/lib/classic/es/insight.js +1 -1
  61. package/lib/classic/es/notification2.js +137 -138
  62. package/lib/classic/es/pause-ad.js +124 -149
  63. package/lib/classic/es/points.js +3 -4
  64. package/lib/classic/es/polymarket.js +1 -1
  65. package/lib/classic/es/useStreamLayerApp2.js +2931 -2877
  66. package/lib/classic/source.css +1 -1
  67. package/lib/dist/cjs/{index-DvqmgCor.js → index-CfSdnrfA.js} +1 -1
  68. package/lib/dist/cjs/masters.js +31 -31
  69. package/lib/dist/es/{index-DvqmgCor.js → index-CfSdnrfA.js} +1 -1
  70. package/lib/dist/es/masters.js +7957 -7774
  71. package/lib/dist/index.d.ts +2 -0
  72. package/lib/es/Question.js +66 -65
  73. package/lib/es/advertisement.js +1988 -1955
  74. package/lib/es/bet-pack.js +1 -1
  75. package/lib/es/feature.js +188 -37
  76. package/lib/{classic/es/index-DvqmgCor.js → es/index-CfSdnrfA.js} +1 -1
  77. package/lib/es/index10.js +1 -1
  78. package/lib/es/index11.js +12 -12
  79. package/lib/es/index12.js +366 -2579
  80. package/lib/es/index13.js +789 -234
  81. package/lib/es/index14.js +293 -792
  82. package/lib/es/index15.js +2580 -305
  83. package/lib/es/index16.js +41 -42
  84. package/lib/es/index2.js +279 -271
  85. package/lib/es/index4.js +15 -16
  86. package/lib/es/index6.js +0 -1
  87. package/lib/es/index7.js +1 -1
  88. package/lib/es/index9.js +2 -2
  89. package/lib/es/insight.js +1 -1
  90. package/lib/es/masters2.js +194 -183
  91. package/lib/es/notification.js +22 -23
  92. package/lib/es/pause-ad.js +124 -149
  93. package/lib/es/points.js +20 -21
  94. package/lib/es/polymarket.js +1 -1
  95. package/lib/es/storage.js +1 -1
  96. package/lib/es/useStreamLayerApp2.js +2931 -2877
  97. package/lib/source.css +1 -1
  98. package/lib/style.css +1 -1
  99. package/package.json +72 -53
  100. package/lib/cjs/sl-types.js +0 -1
  101. package/lib/classic/cjs/sl-types.js +0 -1
  102. package/lib/classic/es/sl-types.js +0 -156
  103. package/lib/es/sl-types.js +0 -156
package/lib/es/index14.js CHANGED
@@ -1,820 +1,321 @@
1
- import { jsx as e, jsxs as o, Fragment as B } from "react/jsx-runtime";
2
- import { useState as $, useRef as ee, useEffect as _, useCallback as N, useLayoutEffect as ze, useMemo as K } from "react";
3
- import { s, c as pe } from "./sl-types.js";
4
- import { i as le } from "./index10.js";
5
- import { B as E } from "./index8.js";
6
- import { Q as t, a as se, d as G, A as Ye } from "./useStreamLayerApp2.js";
7
- import { b as Me, L as Ue } from "./index9.js";
8
- import { p as Ce } from "./index5.js";
9
- const On = /* @__PURE__ */ s("div")({
10
- name: "SDKContainer",
11
- class: "sopqfe6",
12
- propsAsIs: !1
13
- }), Ke = /* @__PURE__ */ s("div")({
14
- name: "SDKScrollContainer",
15
- class: "s102vcph",
16
- propsAsIs: !1
17
- }), $e = /* @__PURE__ */ s("div")({
18
- name: "SDKContentContainer",
19
- class: "s1meqjjv",
20
- propsAsIs: !1
21
- }), _e = () => $e, Ee = /* @__PURE__ */ s(_e())({
22
- name: "SDKWhiteContainer",
23
- class: "s1burm22",
24
- propsAsIs: !0
25
- }), He = () => Ee, Sn = /* @__PURE__ */ s(He())({
26
- name: "SDKSummaryContainer",
27
- class: "sm5r3j5",
28
- propsAsIs: !0
29
- }), Vn = /* @__PURE__ */ s("div")({
30
- name: "TabsContainer",
31
- class: "tysxwr6",
32
- propsAsIs: !1
33
- }), Ze = () => $e, Ln = /* @__PURE__ */ s(Ze())({
34
- name: "LeaderboardContainer",
35
- class: "l9er3b1",
36
- propsAsIs: !0
37
- }), Ge = () => Ee, jn = /* @__PURE__ */ s(Ge())({
38
- name: "TabsNavContainer",
39
- class: "t19dtrb3",
40
- propsAsIs: !0
41
- }), Qn = /* @__PURE__ */ s("div")({
42
- name: "UserSummaryContainer",
43
- class: "u1552n3j",
44
- propsAsIs: !1
45
- });
46
- let Je = class {
47
- observers = /* @__PURE__ */ new Set();
48
- subscribe(a) {
49
- this.observers.add(a);
50
- }
51
- unsubscribe(a) {
52
- this.observers.delete(a);
53
- }
54
- notify(a) {
55
- this.observers.forEach((c) => c(a));
56
- }
57
- };
58
- const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
59
- const [n, a] = $(Xe), c = ee(null);
60
- _(() => {
61
- const p = (h) => {
62
- a(h);
63
- };
64
- return J.subscribe(p), () => {
65
- J.unsubscribe(p);
66
- };
67
- }, []);
68
- const l = N((p) => {
69
- const h = { hiding: !0, finished: !1 };
70
- c.current && clearTimeout(c.current), p?.delay ? c.current = setTimeout(() => {
71
- J.notify(h);
72
- }, p?.delay) : J.notify(h);
73
- }, []), r = N(() => {
74
- n.hiding && (c.current = null, J.notify({ hiding: !1, finished: !0 }));
75
- }, [n.hiding]);
76
- return {
77
- ...n,
78
- runAnimation: l,
79
- onAnimationEnd: r
80
- };
81
- }, ss = /* @__PURE__ */ s("div")({
82
- name: "Container",
83
- class: "c1pgyo67",
84
- propsAsIs: !1
85
- }), ns = "sx17qu6", ts = "h1692c5m", be = ({
86
- children: n,
87
- style: a,
88
- className: c,
89
- enabled: l = !0,
90
- hiding: r,
91
- onAnimationEnd: p
92
- }) => /* @__PURE__ */ e(ss, {
93
- style: a,
94
- className: pe(c, l && ns, l && r && ts),
95
- onAnimationEnd: p,
96
- children: n
97
- }), rs = () => be, as = /* @__PURE__ */ s(rs())({
98
- name: "GrowingContainer",
99
- class: "gck55ev",
1
+ import { jsxs as T, jsx as e, Fragment as le } from "react/jsx-runtime";
2
+ import { s as n, c as Z } from "./feature.js";
3
+ import { useState as I, useEffect as b, useCallback as v, forwardRef as ce, useRef as B } from "react";
4
+ import { B as f } from "./index8.js";
5
+ import { G as ue, d as ie, b as de } from "./index9.js";
6
+ import { C as pe } from "./useStreamLayerApp2.js";
7
+ const me = /* @__PURE__ */ n("div")({
8
+ name: "CloseIconWrap",
9
+ class: "c3v6bv6",
10
+ propsAsIs: !1
11
+ }), fe = /* @__PURE__ */ n("div")({
12
+ name: "TimerWrap",
13
+ class: "teuhmro",
14
+ propsAsIs: !1
15
+ }), ye = () => f, ge = /* @__PURE__ */ n(ye())({
16
+ name: "Icon",
17
+ class: "i17rfxv5",
100
18
  propsAsIs: !0
101
- }), we = ({
102
- children: n,
103
- style: a,
104
- enabled: c,
105
- animate: l,
106
- ...r
19
+ }), Ze = ({
20
+ close: t,
21
+ className: a,
22
+ timerClassName: o,
23
+ skipIcon: l,
24
+ isPlaying: i = !0,
25
+ duration: c = 0,
26
+ autoClose: d
107
27
  }) => {
108
- const p = ee(null);
109
- return /* @__PURE__ */ e(as, {
110
- ...r,
111
- enabled: c && l,
112
- style: {
113
- ...a,
114
- ...(() => {
115
- const h = p?.current, v = (h && window.getComputedStyle(h))?.getPropertyValue("height");
116
- return c ? {
117
- height: l ? v : 0
118
- } : {};
119
- })()
120
- },
121
- children: /* @__PURE__ */ e("div", {
122
- ref: p,
123
- children: n
28
+ const [p, y] = I(c === 0);
29
+ b(() => {
30
+ y(!c);
31
+ }, [c]);
32
+ const C = v(() => {
33
+ d === pe.ENABLED ? t?.() : y(!0);
34
+ }, [d, t]);
35
+ return p ? /* @__PURE__ */ T(me, {
36
+ "data-a": "intr",
37
+ onClick: t,
38
+ className: a,
39
+ style: l ? {
40
+ width: "auto"
41
+ } : {},
42
+ children: [l && /* @__PURE__ */ e("span", {
43
+ "data-a": "intr",
44
+ children: "Skip"
45
+ }), /* @__PURE__ */ e(ge, {
46
+ "data-a": "intr",
47
+ name: l ? "iconSkip" : "icon-cross"
48
+ })]
49
+ }) : /* @__PURE__ */ e(fe, {
50
+ children: /* @__PURE__ */ e(ue, {
51
+ className: o,
52
+ isPlaying: i,
53
+ duration: c,
54
+ onTimerExpired: C
124
55
  })
125
56
  });
126
- }, is = /* @__PURE__ */ s("div")({
57
+ }, he = /* @__PURE__ */ n("div")({
127
58
  name: "Container",
128
- class: "c1gcvmcj",
59
+ class: "c1bgb86j",
129
60
  propsAsIs: !1
130
- }), os = /* @__PURE__ */ s("div")({
131
- name: "Title",
132
- class: "tnr592a",
61
+ }), Ie = /* @__PURE__ */ n("video")({
62
+ name: "Player",
63
+ class: "p6703cq",
133
64
  propsAsIs: !1
134
- }), cs = /* @__PURE__ */ s("div")({
135
- name: "Description",
136
- class: "d1e8jqpv",
65
+ }), be = /* @__PURE__ */ n("img")({
66
+ name: "Poster",
67
+ class: "p12ow7zo",
137
68
  propsAsIs: !1
138
- }), ls = () => E, ds = /* @__PURE__ */ s(ls())({
139
- name: "Icon",
140
- class: "i1vs651k",
141
- propsAsIs: !0
142
- }), ps = ({ icon: n, title: a, description: c }) => /* @__PURE__ */ o(is, { children: [
143
- /* @__PURE__ */ e(ds, { name: n }),
144
- /* @__PURE__ */ e(os, { children: a }),
145
- /* @__PURE__ */ e(cs, { children: c })
146
- ] }), us = () => we, ms = /* @__PURE__ */ s(us())({
147
- name: "ShowInContainer",
148
- class: "s16sbdnm",
149
- propsAsIs: !0
150
- }), Q = /* @__PURE__ */ s("div")({
151
- name: "FeedbackContainer",
152
- class: "fbhorgl",
69
+ }), R = /* @__PURE__ */ n("div")({
70
+ name: "Control",
71
+ class: "cdpal9o",
153
72
  propsAsIs: !1
154
- }), Ae = "s1g20ja7", hs = /* @__PURE__ */ s("div")({
155
- name: "Container",
156
- class: "c455ozj",
73
+ }), Pe = "t1xke4ml", Ae = "h1yzxv57", ve = /* @__PURE__ */ n("div")({
74
+ name: "VideoControls",
75
+ class: "vxo8xch",
157
76
  propsAsIs: !1
158
- }), Is = () => E, ve = /* @__PURE__ */ s(Is())({
159
- name: "IconPrediction",
160
- class: "i1913njx",
161
- propsAsIs: !0
162
- }), X = /* @__PURE__ */ s("div")({
163
- name: "FeedbackIconWrap",
164
- class: "fzfk69z",
165
- propsAsIs: !1
166
- }), te = /* @__PURE__ */ s("div")({
167
- name: "FeedbackHeader",
168
- class: "fx87qaj",
169
- propsAsIs: !1
170
- }), fs = /* @__PURE__ */ s("span")({
171
- name: "FeedbackTitle",
172
- class: "fvek9ew",
173
- propsAsIs: !1
174
- }), W = /* @__PURE__ */ s("span")({
175
- name: "FeedbackDescription",
176
- class: "f1kbtp09",
177
- propsAsIs: !1
178
- }), As = /* @__PURE__ */ s("div")({
179
- name: "FeedbackTitleWrap",
180
- class: "f4i8rro",
181
- propsAsIs: !1
182
- }), vs = /* @__PURE__ */ s("div")({
183
- name: "FeedbackResultDescriptionWrap",
184
- class: "fqyssr",
185
- propsAsIs: !1
186
- }), ys = () => W, Ts = /* @__PURE__ */ s(ys())({
187
- name: "FeedbackDynamicDescription",
188
- class: "fyv794i",
189
- propsAsIs: !0
190
- }), Cs = () => W, $s = /* @__PURE__ */ s(Cs())({
191
- name: "FeedbackResultDescription",
192
- class: "f1jkj9vx",
193
- propsAsIs: !0
194
- }), de = /* @__PURE__ */ s("div")({
195
- name: "FeedbackText",
196
- class: "f1pxh3a6",
197
- propsAsIs: !1
198
- }), Es = /* @__PURE__ */ s("span")({
199
- name: "DynamicWrap",
200
- class: "d1afvufn",
201
- propsAsIs: !1
202
- }), bs = /* @__PURE__ */ s("div")({
203
- name: "EarlyFeedbackDescription",
204
- class: "eq8u24d",
205
- propsAsIs: !1
206
- }), ye = ({
207
- feedbackMessages: n,
208
- questionVotedCorrectly: a,
209
- questionVoted: c,
210
- questionType: l,
211
- hasCorrectAnswer: r,
212
- showExpiredNotification: p,
213
- showClosedNotificationTrivia: h,
214
- votedInCurrentRender: v,
215
- votedAfterQuestionClosed: i,
216
- voteErrorMessage: m,
217
- enteredAnActiveQuestion: b,
218
- marketClosed: g,
219
- percentsAnimated: y,
220
- votedAnswer: O,
221
- isEarlyPrediction: I,
222
- correctAnswer: T,
223
- onAnimationEnd: q
224
- }) => {
225
- const P = c && (l === t.TRIVIA || l === t.PREDICTION), k = l === t.PREDICTION && !r, S = g && l === t.PREDICTION && !c || l === t.PREDICTION && i && v && b, C = P && k, V = P && r, f = l === t.PREDICTION && c && v && r, F = c && l === t.POLL && v, w = a ? "correct" : "incorrect", L = a ? n?.correctFeedback : n?.incorrectFeedback;
226
- return p || h || C || V || S || F || f || m ? /* @__PURE__ */ e(
227
- ms,
228
- {
229
- enabled: v,
230
- animate: !m && p ? !0 : y,
231
- onAnimationEnd: q,
232
- children: /* @__PURE__ */ o(hs, { "data-prediction": k, children: [
233
- m && !S && /* @__PURE__ */ o(Q, { children: [
234
- !I && /* @__PURE__ */ e(ve, { name: "questionExpired" }),
235
- /* @__PURE__ */ e(W, { children: m })
236
- ] }),
237
- !m && p && /* @__PURE__ */ o(Q, { children: [
238
- !I && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { name: "questionExpired" }) }),
239
- /* @__PURE__ */ o("div", { children: [
240
- /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(W, { children: "Question Expired" }) }),
241
- /* @__PURE__ */ e(de, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
242
- ] })
243
- ] }),
244
- !m && h && /* @__PURE__ */ o(Q, { className: pe(Ae), children: [
245
- /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { name: "questionExpired" }) }),
246
- /* @__PURE__ */ o("div", { children: [
247
- /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(W, { children: "Question Closed" }) }),
248
- /* @__PURE__ */ e(de, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
249
- ] })
250
- ] }),
251
- S && /* @__PURE__ */ o(Q, { children: [
252
- !I && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { name: "questionExpired" }) }),
253
- /* @__PURE__ */ o("div", { children: [
254
- /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(W, { children: I ? r ? "The results are already in!" : "Question is Closed" : "Question Closed" }) }),
255
- /* @__PURE__ */ e(de, { children: I ? /* @__PURE__ */ e(bs, { children: r ? `Correct: ${T?.text}` : "Event affecting the outcome has occurred." }) : "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
256
- ] })
257
- ] }),
258
- !m && C && /* @__PURE__ */ o(Q, { children: [
259
- !I && /* @__PURE__ */ e(ve, { name: "icon-prediction" }),
260
- /* @__PURE__ */ o(Ts, { children: [
261
- "Your pick has been recorded. ",
262
- /* @__PURE__ */ e(Es, { children: "We’ll notify you of the result." })
263
- ] })
264
- ] }),
265
- !m && F && /* @__PURE__ */ o(Q, { children: [
266
- !I && /* @__PURE__ */ e(X, { "data-feedback-type": "correct", children: /* @__PURE__ */ e(E, { name: "correct" }) }),
267
- /* @__PURE__ */ e(W, { children: "Thanks for answering. Please stay tuned for the next question." })
268
- ] }),
269
- !m && (V || f) && /* @__PURE__ */ o(Q, { className: pe(h && Ae), children: [
270
- !I && /* @__PURE__ */ e(X, { "data-feedback-type": w, children: /* @__PURE__ */ e(E, { name: w }) }),
271
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ o(te, { children: [
272
- I ? /* @__PURE__ */ e(As, { children: w === "incorrect" ? /* @__PURE__ */ o(B, { children: [
273
- /* @__PURE__ */ e("div", { children: "So close!" }),
274
- /* @__PURE__ */ e("div", { children: "Better luck next time" })
275
- ] }) : /* @__PURE__ */ o(B, { children: [
276
- /* @__PURE__ */ e("div", { children: "That’s correct!" }),
277
- /* @__PURE__ */ e("div", { children: "You chose wisely." })
278
- ] }) }) : /* @__PURE__ */ e(fs, { "data-feedback-type": w, children: L?.title }),
279
- I ? /* @__PURE__ */ o(vs, { children: [
280
- /* @__PURE__ */ o("div", { children: [
281
- "Your pick: ",
282
- O?.text
283
- ] }),
284
- /* @__PURE__ */ e("div", { children: w === "incorrect" ? `Correct: ${T?.text}` : "" })
285
- ] }) : /* @__PURE__ */ e($s, { children: L?.description })
286
- ] }) })
287
- ] })
288
- ] })
289
- }
290
- ) : null;
291
- }, ws = /* @__PURE__ */ s("div")({
292
- name: "Container",
293
- class: "c1hygj0s",
294
- propsAsIs: !1
295
- }), gs = /* @__PURE__ */ s("div")({
296
- name: "Title",
297
- class: "t1r84tez",
77
+ }), D = /* @__PURE__ */ n("button")({
78
+ name: "ControlBtn",
79
+ class: "coyuzu0",
298
80
  propsAsIs: !1
299
- }), Ps = /* @__PURE__ */ s("div")({
300
- name: "Description",
301
- class: "d1aj1a7k",
302
- propsAsIs: !1
303
- }), Rs = /* @__PURE__ */ s("div")({
304
- name: "AdditionalDescription",
305
- class: "ax09ezs",
306
- propsAsIs: !1
307
- }), Ds = () => E, qs = /* @__PURE__ */ s(Ds())({
308
- name: "Icon",
309
- class: "inkrac",
81
+ }), Ce = () => D, Me = /* @__PURE__ */ n(Ce())({
82
+ name: "MuteIcon",
83
+ class: "musmi9a",
310
84
  propsAsIs: !0
311
- }), ks = ({ icon: n, title: a, description: c, additionalDescription: l }) => /* @__PURE__ */ o(ws, { children: [
312
- n && /* @__PURE__ */ e(qs, { name: n }),
313
- /* @__PURE__ */ e(gs, { children: a }),
314
- /* @__PURE__ */ e(Ps, { children: c }),
315
- l && /* @__PURE__ */ e(Rs, { children: l })
316
- ] }), ge = /* @__PURE__ */ s("div")({
317
- name: "Container",
318
- class: "c14ielyq",
319
- propsAsIs: !1
320
- }), xs = () => Ke, Ns = /* @__PURE__ */ s(xs())({
321
- name: "QuestionScrollContainer",
322
- class: "q1tlqx57",
85
+ }), ke = () => D, we = /* @__PURE__ */ n(ke())({
86
+ name: "PauseIcon",
87
+ class: "p1qe7rum",
323
88
  propsAsIs: !0
324
- }), Os = /* @__PURE__ */ s("div")({
325
- name: "TopShadow",
326
- class: "t1hq58md",
327
- propsAsIs: !1
328
- }), Ss = /* @__PURE__ */ s("div")({
329
- name: "BottomShadow",
330
- class: "b1c8nxcx",
331
- propsAsIs: !1
332
- }), Vs = /* @__PURE__ */ s("div")({
333
- name: "SponsorLogo",
334
- class: "siozuc3",
335
- propsAsIs: !1
336
- }), Pe = /* @__PURE__ */ s("div")({
337
- name: "Content",
338
- class: "cpnc44r",
339
- propsAsIs: !1
340
- }), Ls = /* @__PURE__ */ s("div")({
341
- name: "Title",
342
- class: "tq7p3w0",
343
- propsAsIs: !1
344
- }), js = /* @__PURE__ */ s("div")({
345
- name: "OptionsWrap",
346
- class: "o1jlfj9g",
347
- propsAsIs: !1
348
- }), Re = /* @__PURE__ */ s("div")({
349
- name: "Options",
350
- class: "o84pmnd",
351
- propsAsIs: !1
352
- }), Qs = () => be, Te = /* @__PURE__ */ s(Qs())({
353
- name: "AlertContainer",
354
- class: "a1dybjw9",
89
+ }), Ve = () => D, xe = /* @__PURE__ */ n(Ve())({
90
+ name: "PlayIcon",
91
+ class: "psevery",
355
92
  propsAsIs: !0
356
- }), Ws = /* @__PURE__ */ s("div")({
357
- name: "EarlyPrediction",
358
- class: "e1l05ict",
93
+ }), Y = /* @__PURE__ */ n("button")({
94
+ name: "WebOSIconButton",
95
+ class: "w1q3u7py",
359
96
  propsAsIs: !1
360
- }), Bs = () => E, Fs = /* @__PURE__ */ s(Bs())({
361
- name: "EarlyPredictionIcon",
362
- class: "ez9juex",
97
+ }), Ee = () => Y, L = /* @__PURE__ */ n(Ee())({
98
+ name: "WebOSIconButtonAnimation",
99
+ class: "wdlqvum",
363
100
  propsAsIs: !0
364
- }), zs = () => E, Ys = /* @__PURE__ */ s(zs())({
365
- name: "SponsorIcon",
366
- class: "s8p4aob",
101
+ }), Ne = () => L, Oe = /* @__PURE__ */ n(Ne())({
102
+ name: "WebOSIconButtonPlay",
103
+ class: "w1ylz9ea",
367
104
  propsAsIs: !0
368
- }), Ms = /* @__PURE__ */ s("button")({
369
- name: "ButtonContainer",
370
- class: "b1b6dl8t",
371
- propsAsIs: !1
372
- }), Us = /* @__PURE__ */ s("div")({
373
- name: "ButtonPctWrap",
374
- class: "b4iik8i",
375
- propsAsIs: !1
376
- }), Ks = /* @__PURE__ */ s("div")({
377
- name: "ButtonPct",
378
- class: "b1gq1lnf",
379
- propsAsIs: !1
380
- }), _s = /* @__PURE__ */ s("span")({
381
- name: "ButtonBody",
382
- class: "b1j65z51",
383
- propsAsIs: !1
384
- }), Hs = /* @__PURE__ */ s("div")({
385
- name: "IconContainer",
386
- class: "i19tpfua",
387
- propsAsIs: !1
388
- }), Zs = /* @__PURE__ */ s("div")({
389
- name: "IconWrap",
390
- class: "i1tubmma",
391
- propsAsIs: !1
392
- }), De = /* @__PURE__ */ s("img")({
393
- name: "Icon",
394
- class: "i1grrgwj",
395
- propsAsIs: !1
396
- }), Gs = () => De, Js = /* @__PURE__ */ s(Gs())({
397
- name: "IconDefault",
398
- class: "ibemyq8",
105
+ }), Se = () => L, We = /* @__PURE__ */ n(Se())({
106
+ name: "WebOSIconButtonPause",
107
+ class: "w1iylt55",
399
108
  propsAsIs: !0
400
- }), Xs = () => De, en = /* @__PURE__ */ s(Xs())({
401
- name: "IconCircle",
402
- class: "i1dceht",
109
+ }), Be = () => L, Re = /* @__PURE__ */ n(Be())({
110
+ name: "WebOSIconButtonMute",
111
+ class: "w8h4h7",
403
112
  propsAsIs: !0
404
- }), sn = /* @__PURE__ */ s("span")({
405
- name: "Title",
406
- class: "t116q4vq",
407
- propsAsIs: !1
408
- }), nn = /* @__PURE__ */ s("span")({
409
- name: "Indicators",
410
- class: "i17ajcu2",
411
- propsAsIs: !1
412
- }), tn = /* @__PURE__ */ s("div")({
413
- name: "PtsWrap",
414
- class: "pu9kmlb",
415
- propsAsIs: !1
416
- }), rn = /* @__PURE__ */ s("span")({
417
- name: "Pts",
418
- class: "p1j2j0s0",
419
- propsAsIs: !1
420
- }), an = /* @__PURE__ */ s("span")({
421
- name: "Percentage",
422
- class: "p1mzj1sj",
423
- propsAsIs: !1
424
- }), on = () => E, cn = /* @__PURE__ */ s(on())({
425
- name: "CheckIcon",
426
- class: "cichgz8",
113
+ }), Te = () => L, Le = /* @__PURE__ */ n(Te())({
114
+ name: "WebOSIconButtonUnmute",
115
+ class: "w12l12kt",
427
116
  propsAsIs: !0
428
- }), ln = {
429
- [G.CENTERED]: (n) => /* @__PURE__ */ e(Js, { "data-testid": "vote-icon", alt: "option-icon", src: n }),
430
- [G.TRANSPARENT]: (n) => /* @__PURE__ */ e(Hs, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(Zs, { style: { backgroundImage: `url(${n})` } }) }),
431
- [G.ROUNDED]: (n) => /* @__PURE__ */ e(en, { "data-testid": "vote-icon", alt: "option-icon", src: n }),
432
- [G.NONE]: () => null,
433
- [G.UNSET]: () => null
434
- }, dn = ({ questionType: n, hasCorrectAnswer: a, correct: c, youVoted: l, questionVoted: r }) => {
435
- if (n === t.POLL && l)
436
- return "voted";
437
- if (n === t.PREDICTION) {
438
- if (!a && r)
439
- return l ? "voted" : "unset";
440
- if (a && r)
441
- return l ? c ? "correct" : "incorrect" : "unset";
442
- if (l)
443
- return "correct";
444
- }
445
- return n === t.TRIVIA && r && l ? c ? "correct" : "incorrect" : "unset";
446
- }, pn = ({
447
- questionType: n,
448
- questionVoted: a,
449
- correct: c,
450
- hasCorrectAnswer: l,
451
- questionStatus: r
452
- }) => n === t.TRIVIA ? a && c : n === t.PREDICTION ? a && c && l || r === se.RESOLVED && c : !1, un = Me(Ms), mn = (n) => {
453
- const {
454
- // option props
455
- id: a,
456
- icon: c,
457
- text: l,
458
- percentageDecimal: r,
459
- points: p,
460
- // extra props
461
- onVote: h,
462
- markThatVoted: v,
463
- firstOption: i,
464
- onPercentsAnimated: m,
465
- youSelected: b,
466
- youVoted: g,
467
- questionVoted: y,
468
- imageMode: O,
469
- answerTimeExpired: I,
470
- questionStatus: T,
471
- isLoading: q,
472
- questionType: P,
473
- correct: k,
474
- hasCorrectAnswer: S,
475
- marketClosed: C,
476
- isEarlyPrediction: V,
477
- isAd: f,
478
- webos: F
479
- } = n, [w, L] = $(0), z = dn(n), H = pn({ questionType: P, questionVoted: y, correct: k, hasCorrectAnswer: S, questionStatus: T }), x = C && P === t.PREDICTION, ne = y || x, Y = P === t.PREDICTION && !y && !C && !f, Z = y && !b && z !== "incorrect" && !g;
480
- return ze(() => {
481
- L(0), requestAnimationFrame(() => {
482
- L(r);
483
- });
484
- }, [r]), /* @__PURE__ */ o(
485
- un,
486
- {
487
- value: a,
488
- webos: F,
489
- autoFocus: i,
490
- "data-selected": b,
491
- "data-answer-state": z,
492
- disabled: y || q || I || x,
493
- "data-is-not-checked": Z,
494
- "data-a": "intr",
495
- onClick: (re) => {
496
- v(
497
- P === t.PREDICTION ? C : T === se.RESOLVED
498
- ), h(re);
499
- },
500
- "data-is-ad": f,
501
- children: [
502
- /* @__PURE__ */ e(Us, { children: /* @__PURE__ */ e(
503
- Ks,
504
- {
505
- "data-answer-state": z,
506
- "data-is-not-checked": Z,
507
- style: { width: `${ne ? w : 0}%` },
508
- onTransitionEnd: () => {
509
- x || m?.();
510
- },
511
- "data-is-ad": f
512
- }
513
- ) }),
514
- /* @__PURE__ */ o(_s, { "data-a": "intr", children: [
515
- c && O && ln[O]?.(c),
516
- /* @__PURE__ */ e(sn, { "data-a": "intr", children: l }),
517
- Y && /* @__PURE__ */ o(tn, { children: [
518
- p,
519
- /* @__PURE__ */ e(rn, { children: "pts" })
520
- ] }),
521
- ne && /* @__PURE__ */ o(nn, { children: [
522
- H && /* @__PURE__ */ e(cn, { name: V ? "selectedBetPack" : "selected" }),
523
- /* @__PURE__ */ e(an, { children: /* @__PURE__ */ e(Ce, { value: r, suffix: "%" }) })
524
- ] })
525
- ] })
526
- ]
527
- }
117
+ }), Ue = (t) => {
118
+ for (const a of t)
119
+ a.isIntersecting ? a.target instanceof HTMLVideoElement && a.target.autoplay && a.target.play() : a.target instanceof HTMLVideoElement && !a.target.paused && a.target.pause();
120
+ }, ee = new IntersectionObserver(Ue, { threshold: 0.5 }), F = /* @__PURE__ */ new Set(), je = (t) => {
121
+ ee.observe(t), F.add(t);
122
+ }, ze = (t) => {
123
+ ee.unobserve(t), F.delete(t);
124
+ }, He = () => {
125
+ for (const t of F)
126
+ t instanceof HTMLVideoElement && !t.paused && t.pause();
127
+ };
128
+ function qe(...t) {
129
+ return v(
130
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
131
+ (a) => {
132
+ for (const o of t)
133
+ o !== null && (typeof o == "function" ? o(a) : o && (o.current = a));
134
+ },
135
+ // Re-run the callback if the array of refs changes
136
+ // eslint-disable-next-line react-hooks/exhaustive-deps
137
+ [...t]
528
138
  );
529
- }, hn = () => we, In = /* @__PURE__ */ s(hn())({
530
- name: "ShowInContainer",
531
- class: "sie6cqo",
532
- propsAsIs: !0
533
- }), fn = /* @__PURE__ */ s("div")({
534
- name: "WinBarContainer",
535
- class: "wgizw4u",
536
- propsAsIs: !1
537
- }), An = /* @__PURE__ */ s("div")({
538
- name: "Content",
539
- class: "c1l3ucjp",
540
- propsAsIs: !1
541
- }), vn = /* @__PURE__ */ s("div")({
542
- name: "Title",
543
- class: "tx7j799",
544
- propsAsIs: !1
545
- }), yn = () => E, Tn = /* @__PURE__ */ s(yn())({
546
- name: "WinIcon",
547
- class: "w4lwuj0",
548
- propsAsIs: !0
549
- }), Cn = /* @__PURE__ */ s("div")({
550
- name: "Points",
551
- class: "po9i64o",
552
- propsAsIs: !1
553
- }), $n = /* @__PURE__ */ s("span")({
554
- name: "PointsCount",
555
- class: "pe5g05h",
556
- propsAsIs: !1
557
- }), En = /* @__PURE__ */ s("span")({
558
- name: "PointsUnits",
559
- class: "p1hdtpmb",
560
- propsAsIs: !1
561
- }), bn = ({
562
- title: n,
563
- points: a,
564
- isPlayingTimer: c,
565
- isTimer: l,
566
- animatePoints: r,
567
- questionType: p,
568
- timerDuration: h,
569
- votedInCurrentRender: v,
570
- percentsAnimated: i,
571
- onTimerExpired: m
572
- }) => /* @__PURE__ */ e(
573
- In,
574
- {
575
- enabled: p === t.PREDICTION && v,
576
- animate: i,
577
- children: /* @__PURE__ */ o(
578
- fn,
139
+ }
140
+ const $e = de(he), De = ({ loading: t, autoPlay: a, played: o, playing: l, isMuted: i, unmute: c, mute: d, togglePlaying: p }) => !t && !a && !o ? /* @__PURE__ */ e(R, { children: l ? /* @__PURE__ */ e(f, { name: "icon-pause" }) : /* @__PURE__ */ e(f, { name: "icon-play" }) }) : o ? /* @__PURE__ */ T(ve, { children: [
141
+ l ? /* @__PURE__ */ e(we, { onClick: p }) : /* @__PURE__ */ e(xe, { onClick: p }),
142
+ /* @__PURE__ */ e(Me, { className: Z(!i && "muted"), onClick: i ? c : d })
143
+ ] }) : null, Fe = ({
144
+ loading: t,
145
+ autoPlay: a,
146
+ playMuted: o,
147
+ playing: l,
148
+ played: i,
149
+ unmute: c,
150
+ mute: d,
151
+ isMuted: p,
152
+ hasNotPausedVideo: y,
153
+ hasInteractedWithAudio: C
154
+ }) => /* @__PURE__ */ T(le, { children: [
155
+ !t && !(a && o) && /* @__PURE__ */ e(R, { "data-control-btn": "true", children: l ? y ? null : /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) : i ? /* @__PURE__ */ e(We, { children: /* @__PURE__ */ e(f, { name: "icon-pause" }) }) : /* @__PURE__ */ e(Y, { "data-control-icon": "true", children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) }),
156
+ !t && a && o && C && /* @__PURE__ */ e(R, { children: p ? /* @__PURE__ */ e(Re, { onClick: c, children: /* @__PURE__ */ e(f, { name: "iconMute" }) }) : /* @__PURE__ */ e(Le, { onClick: d, children: /* @__PURE__ */ e(f, { name: "iconUnMute" }) }) })
157
+ ] }), Ye = ce(
158
+ ({
159
+ poster: t,
160
+ source: a,
161
+ aspectRatio: o,
162
+ controlVideo: l,
163
+ onReplay: i,
164
+ onPlay: c,
165
+ onPause: d,
166
+ onEnd: p,
167
+ onRender: y,
168
+ onMute: C,
169
+ onMuteClick: x,
170
+ onQuartile: U,
171
+ autoPlay: M,
172
+ playMuted: k,
173
+ className: te,
174
+ muted: w,
175
+ webos: E,
176
+ hasNotPausedVideo: ae
177
+ }, se) => {
178
+ const u = B(null), ne = qe(u, se), j = B(!1), z = B(!1), m = B(/* @__PURE__ */ new Set()), [G, K] = I(!1), [N, O] = I(!1), [H, _] = I(!1), [J, S] = I(!0), [q, W] = I(k), [$, oe] = I(!1);
179
+ b(() => {
180
+ a && (W(k), K(!1));
181
+ }, [a]);
182
+ const P = v(() => {
183
+ l?.({ muted: !1 });
184
+ }, [l]), Q = v(() => {
185
+ l?.({ muted: !0 });
186
+ }, [l]), A = v(
187
+ (s) => {
188
+ s?.stopPropagation(), u.current && (u.current.muted = !0), W(!0), s && x?.(!0);
189
+ },
190
+ [x]
191
+ ), V = v(
192
+ (s) => {
193
+ s?.stopPropagation(), u.current && (u.current.muted = !1), W(!1), $ || oe(!0), s && x?.(!1);
194
+ },
195
+ [$, x]
196
+ );
197
+ b(() => {
198
+ w !== void 0 && (w ? A() : V());
199
+ }, [A, w, V]);
200
+ const X = (s) => {
201
+ s.stopPropagation?.();
202
+ const r = u?.current;
203
+ if (r)
204
+ if (N)
205
+ r.pause();
206
+ else {
207
+ const g = u?.current;
208
+ if (!g)
209
+ return;
210
+ He(), g.play().catch((h) => console.log(h)), S(!1);
211
+ }
212
+ }, re = () => {
213
+ u?.current?.load(), S(!0);
214
+ };
215
+ return b(() => () => {
216
+ P();
217
+ }, [P]), b(() => {
218
+ const s = u.current;
219
+ return s ? (z.current = s.muted, W(s.muted), je(s), () => {
220
+ ze(s);
221
+ }) : () => {
222
+ };
223
+ }, []), b(() => {
224
+ y?.();
225
+ }, [y]), b(() => {
226
+ m.current.clear(), j.current = !1;
227
+ }, [a]), /* @__PURE__ */ T(
228
+ $e,
579
229
  {
580
- style: {
581
- justifyContent: p === t.PREDICTION ? "center" : "space-between"
582
- },
230
+ webos: E,
231
+ onClick: M && k ? q ? V : A : X,
232
+ "data-a": "intr",
233
+ autoFocus: !0,
234
+ options: { focusKey: "video-play-btn" },
235
+ className: Z(N && !E && Pe, M && Ae, te),
236
+ style: o ? { aspectRatio: o } : {},
583
237
  children: [
584
- /* @__PURE__ */ o(An, { children: [
585
- n && /* @__PURE__ */ e(vn, { children: n }),
586
- a !== void 0 && p !== t.POLL && /* @__PURE__ */ o(B, { children: [
587
- /* @__PURE__ */ e(Tn, { name: "icon-trophy" }),
588
- /* @__PURE__ */ o(Cn, { children: [
589
- /* @__PURE__ */ e($n, { children: r ? /* @__PURE__ */ e(Ce, { value: a, delay: 0.3 }) : a }),
590
- /* @__PURE__ */ e(En, { children: "PTS" })
591
- ] })
592
- ] })
593
- ] }),
594
- l && p !== t.PREDICTION && /* @__PURE__ */ e(Ue, { isPlaying: c, onTimerExpired: m, duration: h })
238
+ /* @__PURE__ */ e(
239
+ Ie,
240
+ {
241
+ ref: ne,
242
+ src: a,
243
+ autoPlay: M,
244
+ onPlay: () => {
245
+ K(!0), j.current && (i?.(), m.current.clear()), O(!0), S(!1), c?.(), k ? A() : Q();
246
+ },
247
+ onTimeUpdate: (s) => {
248
+ const r = s.target.duration, g = s.target.currentTime;
249
+ if (r && g) {
250
+ const h = Math.floor(g / r * 100);
251
+ h >= 25 && h < 50 && !m.current.has(25) ? (U?.(25), m.current.add(25)) : h >= 50 && h < 75 && !m.current.has(50) ? (U?.(50), m.current.add(50)) : h >= 75 && !m.current.has(75) && (U?.(75), m.current.add(75));
252
+ }
253
+ },
254
+ onVolumeChange: (s) => {
255
+ const r = s.target.muted;
256
+ z.current !== r && (C?.(r), z.current = r, (r !== w || w === void 0) && (r ? P() : Q()));
257
+ },
258
+ onError: async (s) => {
259
+ try {
260
+ if (s.target instanceof HTMLVideoElement) {
261
+ _(!0);
262
+ const r = await (await fetch(s.target.src)).blob(), g = URL.createObjectURL(r);
263
+ s.target.src = g;
264
+ }
265
+ } catch (r) {
266
+ console.error("video fallback fetch failed", r), O(!0), S(!0);
267
+ } finally {
268
+ _(!1), P();
269
+ }
270
+ },
271
+ onPause: () => {
272
+ O(!1), d?.(), P();
273
+ },
274
+ onEnded: () => {
275
+ O(!1), j.current = !0, re(), p?.(), P();
276
+ },
277
+ style: { visibility: J ? "hidden" : "visible" },
278
+ controls: !1,
279
+ playsInline: !0
280
+ }
281
+ ),
282
+ /* @__PURE__ */ e(be, { src: t, style: { visibility: J ? "visible" : "hidden" } }),
283
+ !E && /* @__PURE__ */ e(
284
+ De,
285
+ {
286
+ loading: H,
287
+ autoPlay: M,
288
+ played: G,
289
+ playing: N,
290
+ isMuted: q,
291
+ unmute: V,
292
+ mute: A,
293
+ togglePlaying: X
294
+ }
295
+ ),
296
+ E && /* @__PURE__ */ e(
297
+ Fe,
298
+ {
299
+ loading: H,
300
+ autoPlay: M,
301
+ playMuted: k,
302
+ playing: N,
303
+ played: G,
304
+ unmute: V,
305
+ mute: A,
306
+ isMuted: q,
307
+ hasNotPausedVideo: ae,
308
+ hasInteractedWithAudio: $
309
+ }
310
+ ),
311
+ H && /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ie, {}) })
595
312
  ]
596
313
  }
597
- )
314
+ );
598
315
  }
599
- ), wn = (n, a) => n === "already_voted" ? a === t.POLL ? "You’ve already answered this question on another device." : "You’ve already answered this question on another device. So the points for this answer won't tally." : "Something went wrong, please try again", Bn = () => /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ o(Pe, { children: [
600
- /* @__PURE__ */ e(le, { loading: !0, style: { height: "40px", borderRadius: "100px" } }),
601
- /* @__PURE__ */ e(le, { loading: !0, style: { height: "24px", margin: "16px 0" } }),
602
- /* @__PURE__ */ e(Re, { children: Array.from({ length: 5 }).map((n, a) => /* @__PURE__ */ e(le, { loading: !0, style: { height: "44px" } }, a)) })
603
- ] }) }), Fn = ({
604
- openedQuestion: n,
605
- isLoading: a,
606
- vote: c,
607
- close: l,
608
- isEarlyPrediction: r,
609
- mastersApp: p,
610
- webos: h
611
- }) => {
612
- const v = n.subject, i = n.type, m = n.status, b = n.options?.options, g = n.marketClosed, y = n.id, O = ee(), I = ee(), T = p ? !1 : n?.adUnit === Ye.STANDART, [q, P] = $(!1), [k, S] = $(!1), [C, V] = $(!0), [f, F] = $(!1), [w, L] = $(!1), [z, H] = $(""), [x, ne] = $(""), [Y, Z] = $(!1), [re, qe] = $(!1), [ue, ke] = $(!1), { runAnimation: M, finished: me } = es();
613
- _(() => {
614
- me && l(y);
615
- }, [l, me]), _(() => {
616
- i === t.PREDICTION ? g && V(!1) : m === se.RESOLVED && V(!1);
617
- }, []);
618
- const xe = N((u) => {
619
- S(u), P(!0);
620
- }, []), Ne = N(() => {
621
- r && P(!1);
622
- }, [r]), ae = ee(!1), he = N(() => {
623
- I.current && clearTimeout(I.current), I.current = setTimeout(() => {
624
- ke(!0), M({ delay: 5500 });
625
- }, 4e3);
626
- }, [M]), Ie = N(
627
- async (u) => {
628
- if (!ae.current && (ae.current = !0, y)) {
629
- const D = u.currentTarget.value;
630
- H(D);
631
- try {
632
- await c(y, D), T && he();
633
- } catch (U) {
634
- ne(wn(U.message, i)), H(""), console.error("Error while voting", U), ae.current = !1;
635
- }
636
- }
637
- },
638
- [i, y, H, c, T, he]
639
- ), Oe = N(() => {
640
- F(!0), M({ delay: 3500 });
641
- }, [M]), Se = N(() => {
642
- L(!0), M({ delay: 3500 });
643
- }, [M]), d = n?.answers.find((u) => u.youVoted === !0), A = K(
644
- () => !!n?.answers.find((u) => u.correct === !0),
645
- [n]
646
- ), R = K(
647
- () => n?.answers.find((u) => u.correct === !0),
648
- [n]
649
- );
650
- _(() => {
651
- d && q && !re && (O.current = setTimeout(Se, 1e4), qe(!0));
652
- }, [d]), _(() => () => {
653
- clearTimeout(O.current), clearTimeout(I.current);
654
- }, []);
655
- const ie = K(() => n ? n.answers.map((u) => ({
656
- ...u,
657
- questionVoted: !!d,
658
- youSelected: z === u.id,
659
- isLoading: a,
660
- hasCorrectAnswer: A,
661
- questionType: n.type,
662
- answerTimeExpired: f,
663
- questionStatus: m,
664
- imageMode: n.appearance?.images,
665
- onVote: Ie
666
- })) : [], [
667
- A,
668
- f,
669
- a,
670
- n,
671
- d,
672
- m,
673
- Ie,
674
- z
675
- ]);
676
- _(() => {
677
- const u = ie.some(({ percentageDecimal: U }) => U !== 0), D = d && i === t.PREDICTION;
678
- x && (r || !u || g && D) && Z(!0);
679
- }, [ie, x, r, g, i, d]);
680
- const fe = b && (b.case === "trivia" || b.case === "prediction") ? b.value : void 0, j = m === se.RESOLVED && i === t.TRIVIA && !d && !C, oe = i === t.TRIVIA && k, ce = K(() => T ? !1 : i === t.PREDICTION ? r ? !1 : !!(d && !A || d && A && R?.youVoted) : !0, [i, d, A, R, r, T]), Ve = K(() => {
681
- if (i === t.PREDICTION && d && (!A || A && R?.youVoted))
682
- return d.points;
683
- if (!(j || f))
684
- return d ? d.correct ? d.pointsEarned : 0 : R?.points;
685
- }, [f, d, R, j, i, A]), Le = K(() => i === t.PREDICTION && d ? A ? A && R?.youVoted ? "You won" : "" : "To win" : j || f ? "Time expired" : i === t.POLL ? "Time remaining" : d ? "You won" : "To win", [f, i, d, j, A, R]), je = !ce || ce && i === t.PREDICTION && q && !Y, Qe = (i === t.TRIVIA || i === t.PREDICTION) && d && A && R?.youVoted, We = d || j || oe || i === t.TRIVIA && m === se.RESOLVED && C, Be = !r && (f || w) || ue, Fe = () => {
686
- const u = () => i === t.TRIVIA ? d?.correct ? `That's correct!
687
- You chose wisely.` : `So close!
688
- Better luck next time.` : i === t.POLL ? `Thanks for answering.
689
- Please stay tuned for the next question.` : i === t.PREDICTION ? "Stay tuned to see if your prediction was correct." : "", D = () => i === t.TRIVIA ? `Your Pick: ${R?.text}` : i === t.POLL || i === t.PREDICTION ? `Your Pick: ${d?.text}` : "", U = () => i === t.TRIVIA && b?.case === "trivia" ? b?.value.explanation : i === t.PREDICTION ? v : "";
690
- return ue ? /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
691
- ks,
692
- {
693
- title: u(),
694
- description: D(),
695
- ...d?.correct || i === t.POLL || i === t.PREDICTION ? { icon: "icon-correct" } : {},
696
- ...i === t.TRIVIA || i === t.PREDICTION ? { additionalDescription: U() } : {}
697
- }
698
- ) }) : !r && (f || w) ? /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
699
- ps,
700
- {
701
- icon: "icon-check-circle",
702
- title: "More to come...",
703
- description: w ? /* @__PURE__ */ o(B, { children: [
704
- "Stay tuned for more questions ",
705
- /* @__PURE__ */ e("br", {}),
706
- " and insights."
707
- ] }) : /* @__PURE__ */ o(B, { children: [
708
- "Watch for additional enhanced stream ",
709
- /* @__PURE__ */ e("br", {}),
710
- " interactive experience."
711
- ] })
712
- }
713
- ) }) : null;
714
- };
715
- return /* @__PURE__ */ o(Ns, { children: [
716
- r && /* @__PURE__ */ e(Os, {}),
717
- /* @__PURE__ */ e(ge, { style: r ? { marginTop: "-40px" } : {}, children: /* @__PURE__ */ o(Pe, { children: [
718
- !r && !T && /* @__PURE__ */ e(
719
- ye,
720
- {
721
- feedbackMessages: fe,
722
- questionVoted: !!d,
723
- questionVotedCorrectly: d?.correct,
724
- questionType: i,
725
- hasCorrectAnswer: A,
726
- showExpiredNotification: j,
727
- showClosedNotificationTrivia: oe,
728
- votedInCurrentRender: q,
729
- votedAfterQuestionClosed: k,
730
- enteredAnActiveQuestion: C,
731
- marketClosed: g,
732
- percentsAnimated: Y,
733
- voteErrorMessage: x,
734
- votedAnswer: d
735
- }
736
- ),
737
- ce && /* @__PURE__ */ e(
738
- bn,
739
- {
740
- title: Le,
741
- points: Ve,
742
- onTimerExpired: Oe,
743
- questionType: n.type,
744
- isTimer: !a,
745
- isPlayingTimer: !d,
746
- animatePoints: Qe,
747
- timerDuration: We ? 0 : Number(n?.appearance?.autoHideInterval || "30"),
748
- votedInCurrentRender: q,
749
- percentsAnimated: Y
750
- }
751
- ),
752
- Be ? Fe() : /* @__PURE__ */ o(B, { children: [
753
- r && /* @__PURE__ */ o(Ws, { children: [
754
- /* @__PURE__ */ e(Fs, { name: "iconEarlyPrediction" }),
755
- "EARLY PREDICTION"
756
- ] }),
757
- /* @__PURE__ */ e(Ls, { style: je ? { marginTop: 0 } : {}, children: v }),
758
- r && /* @__PURE__ */ e(
759
- ye,
760
- {
761
- feedbackMessages: fe,
762
- questionVoted: !!d,
763
- questionVotedCorrectly: d?.correct,
764
- questionType: i,
765
- hasCorrectAnswer: A,
766
- showExpiredNotification: j,
767
- showClosedNotificationTrivia: oe,
768
- votedInCurrentRender: q,
769
- votedAfterQuestionClosed: k,
770
- enteredAnActiveQuestion: C,
771
- marketClosed: g,
772
- percentsAnimated: Y,
773
- voteErrorMessage: x,
774
- isEarlyPrediction: r,
775
- correctAnswer: R,
776
- votedAnswer: d,
777
- onAnimationEnd: Ne
778
- }
779
- ),
780
- /* @__PURE__ */ o(js, { children: [
781
- /* @__PURE__ */ e(Re, { children: ie.sort((u, D) => u.id > D.id ? 1 : -1).map((u, D) => /* @__PURE__ */ e(
782
- mn,
783
- {
784
- ...u,
785
- firstOption: D === 0,
786
- markThatVoted: xe,
787
- onPercentsAnimated: () => Z(!0),
788
- votedAfterQuestionClosed: k,
789
- enteredAnActiveQuestion: C,
790
- marketClosed: g,
791
- isEarlyPrediction: r,
792
- isAd: T,
793
- webos: h
794
- },
795
- u.id
796
- )) }),
797
- r && /* @__PURE__ */ o(B, { children: [
798
- /* @__PURE__ */ e(Ss, {}),
799
- /* @__PURE__ */ e(Vs, { children: /* @__PURE__ */ e(Ys, { name: "mastersLogoWhite" }) })
800
- ] })
801
- ] })
802
- ] })
803
- ] }) })
804
- ] });
805
- };
316
+ );
806
317
  export {
807
- Ln as C,
808
- Fn as Q,
809
- jn as S,
810
- Bn as Z,
811
- Ee as a,
812
- Ke as c,
813
- Qn as d,
814
- be as f,
815
- Vn as l,
816
- Sn as m,
817
- $e as n,
818
- On as p,
819
- es as y
318
+ He as O,
319
+ Ye as V,
320
+ Ze as y
820
321
  };