@streamlayer/react 1.21.3 → 1.22.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.
Files changed (168) hide show
  1. package/lib/app/masters.d.ts +2 -5
  2. package/lib/app/pause-ad.d.ts +1 -10
  3. package/lib/app/useStreamLayerApp.d.ts +1 -23
  4. package/lib/cjs/Question.js +1 -0
  5. package/lib/cjs/advertisement.js +40 -40
  6. package/lib/cjs/analytics.js +1 -0
  7. package/lib/cjs/auth.js +1 -1
  8. package/lib/cjs/bet-pack.js +1 -1
  9. package/lib/cjs/gamification-feature.js +1 -1
  10. package/lib/cjs/hooks-B0Qttldg.js +1 -0
  11. package/lib/cjs/index-DSi8Qgfs.js +1 -0
  12. package/lib/cjs/index.js +1 -1
  13. package/lib/cjs/index10.js +1 -0
  14. package/lib/cjs/index11.js +4 -0
  15. package/lib/cjs/index12.js +1 -0
  16. package/lib/cjs/index13.js +1 -0
  17. package/lib/cjs/index14.js +1 -0
  18. package/lib/cjs/index15.js +1 -0
  19. package/lib/cjs/index16.js +5 -0
  20. package/lib/cjs/index2.js +1 -5
  21. package/lib/cjs/index3.js +1 -0
  22. package/lib/cjs/index4.js +5 -0
  23. package/lib/cjs/index5.js +1 -0
  24. package/lib/cjs/index6.js +1 -0
  25. package/lib/cjs/index7.js +5 -0
  26. package/lib/cjs/index8.js +1 -0
  27. package/lib/cjs/index9.js +1 -0
  28. package/lib/cjs/insight.js +1 -1
  29. package/lib/cjs/masters.js +1 -1
  30. package/lib/cjs/masters2.js +6 -6
  31. package/lib/cjs/notification.js +1 -1
  32. package/lib/cjs/pause-ad.js +1 -1
  33. package/lib/cjs/points.js +1 -1
  34. package/lib/cjs/sl-types.js +15 -0
  35. package/lib/cjs/storage.js +1 -0
  36. package/lib/cjs/theme.js +17 -0
  37. package/lib/cjs/useStreamLayerApp.js +1 -1
  38. package/lib/cjs/useStreamLayerApp2.js +17 -16
  39. package/lib/cjs/utils.js +47 -0
  40. package/lib/cjs/vast-client.min.js +1 -0
  41. package/lib/classic/app/masters.d.ts +2 -5
  42. package/lib/classic/app/pause-ad.d.ts +1 -10
  43. package/lib/classic/app/useStreamLayerApp.d.ts +1 -23
  44. package/lib/classic/cjs/Question.js +1 -0
  45. package/lib/classic/cjs/advertisement.js +40 -40
  46. package/lib/classic/cjs/analytics.js +1 -0
  47. package/lib/classic/cjs/auth.js +1 -1
  48. package/lib/classic/cjs/bet-pack.js +4 -4
  49. package/lib/classic/cjs/gamification-feature.js +1 -1
  50. package/lib/classic/cjs/hooks-B0Qttldg.js +1 -0
  51. package/lib/classic/cjs/index-DSi8Qgfs.js +1 -0
  52. package/lib/classic/cjs/index.js +1 -1
  53. package/lib/classic/cjs/index10.js +1 -0
  54. package/lib/classic/cjs/index11.js +1 -0
  55. package/lib/classic/cjs/index12.js +1 -0
  56. package/lib/classic/cjs/index13.js +4 -0
  57. package/lib/classic/cjs/index2.js +5 -0
  58. package/lib/classic/cjs/index3.js +1 -0
  59. package/lib/classic/cjs/index4.js +1 -0
  60. package/lib/classic/cjs/index5.js +1 -0
  61. package/lib/classic/cjs/index6.js +5 -0
  62. package/lib/classic/cjs/index7.js +1 -0
  63. package/lib/classic/cjs/index8.js +1 -0
  64. package/lib/classic/cjs/index9.js +1 -0
  65. package/lib/classic/cjs/insight.js +1 -1
  66. package/lib/classic/cjs/notification.js +1 -1
  67. package/lib/classic/cjs/notification2.js +1 -0
  68. package/lib/classic/cjs/pause-ad.js +1 -1
  69. package/lib/classic/cjs/points.js +1 -1
  70. package/lib/classic/cjs/sl-types.js +15 -0
  71. package/lib/classic/cjs/useStreamLayerApp.js +1 -1
  72. package/lib/classic/cjs/useStreamLayerApp2.js +17 -16
  73. package/lib/classic/cjs/utils.js +47 -0
  74. package/lib/classic/cjs/vast-client.min.js +1 -0
  75. package/lib/classic/es/Question.js +392 -0
  76. package/lib/classic/es/advertisement.js +10375 -10374
  77. package/lib/classic/es/analytics.js +28 -0
  78. package/lib/classic/es/auth.js +4 -4
  79. package/lib/classic/es/bet-pack.js +55 -51
  80. package/lib/classic/es/gamification-feature.js +1 -1
  81. package/lib/classic/es/hooks-B0Qttldg.js +98 -0
  82. package/lib/classic/es/index-DSi8Qgfs.js +65 -0
  83. package/lib/classic/es/index.js +14 -15
  84. package/lib/classic/es/index10.js +87 -0
  85. package/lib/classic/es/index11.js +2355 -0
  86. package/lib/classic/es/index12.js +183 -0
  87. package/lib/classic/es/index13.js +835 -0
  88. package/lib/classic/es/index2.js +2621 -0
  89. package/lib/classic/es/index3.js +64 -0
  90. package/lib/classic/es/index4.js +19 -0
  91. package/lib/classic/es/index5.js +285 -0
  92. package/lib/classic/es/{index-l-eyvmpL.js → index6.js} +937 -937
  93. package/lib/classic/es/index7.js +7 -0
  94. package/lib/classic/es/index8.js +11 -0
  95. package/lib/classic/es/index9.js +319 -0
  96. package/lib/classic/es/insight.js +31 -32
  97. package/lib/classic/es/notification.js +7 -1006
  98. package/lib/classic/es/notification2.js +1117 -0
  99. package/lib/classic/es/pause-ad.js +139 -138
  100. package/lib/classic/es/points.js +39 -38
  101. package/lib/classic/es/sl-types.js +258 -0
  102. package/lib/classic/es/useStreamLayerApp.js +1 -2
  103. package/lib/classic/es/useStreamLayerApp2.js +4798 -2735
  104. package/lib/classic/es/utils.js +76 -0
  105. package/lib/{es/vast-client.min-B0NUra1B.js → classic/es/vast-client.min.js} +338 -338
  106. package/lib/classic/index.d.ts +5 -13
  107. package/lib/classic/masters.d.ts +1 -1
  108. package/lib/dist/cjs/index.js +1 -1
  109. package/lib/dist/cjs/masters.js +34 -33
  110. package/lib/dist/es/index.js +2 -2
  111. package/lib/dist/es/masters.js +10563 -8870
  112. package/lib/dist/index.d.ts +1332 -0
  113. package/lib/dist/style.css +1 -1
  114. package/lib/es/Question.js +136 -0
  115. package/lib/es/advertisement.js +10375 -10374
  116. package/lib/es/analytics.js +28 -0
  117. package/lib/es/auth.js +4 -4
  118. package/lib/es/bet-pack.js +7 -6
  119. package/lib/es/gamification-feature.js +1 -1
  120. package/lib/es/hooks-B0Qttldg.js +98 -0
  121. package/lib/es/index-DSi8Qgfs.js +65 -0
  122. package/lib/es/index.js +13 -14
  123. package/lib/es/index10.js +267 -0
  124. package/lib/es/index11.js +835 -0
  125. package/lib/es/index12.js +183 -0
  126. package/lib/es/index13.js +319 -0
  127. package/lib/es/index14.js +87 -0
  128. package/lib/es/index15.js +2355 -0
  129. package/lib/es/index16.js +1254 -0
  130. package/lib/es/index2.js +1349 -3364
  131. package/lib/es/index3.js +64 -0
  132. package/lib/es/index4.js +3418 -0
  133. package/lib/es/index5.js +19 -0
  134. package/lib/es/index6.js +285 -0
  135. package/lib/es/{index-l-eyvmpL.js → index7.js} +937 -937
  136. package/lib/es/index8.js +7 -0
  137. package/lib/es/index9.js +11 -0
  138. package/lib/es/insight.js +31 -32
  139. package/lib/es/masters.js +6 -5
  140. package/lib/es/masters2.js +189 -176
  141. package/lib/es/notification.js +141 -136
  142. package/lib/es/pause-ad.js +140 -139
  143. package/lib/es/points.js +40 -38
  144. package/lib/es/sl-types.js +277 -0
  145. package/lib/es/storage.js +113 -0
  146. package/lib/es/theme.js +47 -0
  147. package/lib/es/useStreamLayerApp.js +1 -2
  148. package/lib/es/useStreamLayerApp2.js +4798 -2735
  149. package/lib/es/utils.js +76 -0
  150. package/lib/{classic/es/vast-client.min-B0NUra1B.js → es/vast-client.min.js} +338 -338
  151. package/lib/index.d.ts +5 -13
  152. package/lib/masters.d.ts +1 -1
  153. package/lib/style.css +1 -1
  154. package/package.json +16 -51
  155. package/lib/app/event.d.ts +0 -6
  156. package/lib/app/provider.d.ts +0 -49
  157. package/lib/cjs/index-l-eyvmpL.js +0 -5
  158. package/lib/cjs/provider.js +0 -84
  159. package/lib/cjs/vast-client.min-B0NUra1B.js +0 -1
  160. package/lib/classic/app/event.d.ts +0 -6
  161. package/lib/classic/app/provider.d.ts +0 -49
  162. package/lib/classic/cjs/index-l-eyvmpL.js +0 -5
  163. package/lib/classic/cjs/provider.js +0 -68
  164. package/lib/classic/cjs/vast-client.min-B0NUra1B.js +0 -1
  165. package/lib/classic/es/provider.js +0 -7619
  166. package/lib/dist/cjs/gamification-feature2.js +0 -1
  167. package/lib/dist/es/gamification-feature2.js +0 -285
  168. package/lib/es/provider.js +0 -7695
@@ -1,130 +1,131 @@
1
- import { jsx as l, jsxs as L } from "react/jsx-runtime";
2
- import { j as K, k as M, i as k, s as m, l as _, n as $, e as F, u as N, d as j, h as q } from "./provider.js";
3
- import "nanostores";
4
- import { useRef as D, useCallback as I, useState as R, useEffect as T, Component as O } from "react";
5
- import "lodash.throttle";
6
- import "react-dom";
7
- import "react-countup";
8
- import { c as z } from "./vast-client.min-B0NUra1B.js";
9
- const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Promise((s, t) => {
10
- const o = new Image();
11
- o.onload = () => s(e), o.onerror = () => t(), o.src = e;
12
- }), V = () => {
13
- const e = D(0);
14
- return [I(async (s) => {
15
- var t, o, r, c, d, n, h, i, y, g, f;
1
+ import { jsx as l, jsxs as D } from "react/jsx-runtime";
2
+ import { h as F } from "./index7.js";
3
+ import { s as v, c as V, u as M } from "./sl-types.js";
4
+ import { d as N } from "./index11.js";
5
+ import { useRef as x, useCallback as L, useState as U, useEffect as k, Component as j } from "react";
6
+ import { c as q, e as S } from "./index3.js";
7
+ import { _ as $ } from "./vast-client.min.js";
8
+ import { i as z } from "./index-DSi8Qgfs.js";
9
+ import { B as O, z as G } from "./hooks-B0Qttldg.js";
10
+ const Q = {}, W = new $(), w = z(Q), E = q("ui:gam-static"), B = (e) => new Promise((s, t) => {
11
+ const n = new Image();
12
+ n.onload = () => s(e), n.onerror = () => t(), n.src = e;
13
+ }), _ = () => {
14
+ const e = x(0);
15
+ return [L(async (s) => {
16
+ var t, n, r, u, c, a, h, i, y, P, A;
16
17
  if ((t = w.get()[s]) != null && t.imageSrc)
17
18
  return { success: !0 };
18
- const v = Date.now();
19
- e.current = v, w.setKey(s, { id: "", url: s });
19
+ const f = Date.now();
20
+ e.current = f, w.setKey(s, { id: "", url: s });
20
21
  try {
21
- k.emit("exposedPauseAd", {
22
+ S.emit("exposedPauseAd", {
22
23
  action: "load",
23
24
  payload: {}
24
25
  });
25
- const u = await J.get(s);
26
- if (E.debug(u, "parsedVAST"), e.current === v && w.get()[s].url) {
27
- const a = u.ads.find((p) => p.creatives.length > 0);
28
- if (a) {
29
- E.debug(a, "validAd");
30
- const p = a.creatives.find((A) => A.type === "nonlinear");
31
- if (p) {
32
- E.debug(p, "nonlinear");
33
- const A = (r = (o = p.variations) == null ? void 0 : o[0]) == null ? void 0 : r.staticResource, C = (d = (c = p.variations) == null ? void 0 : c[0]) == null ? void 0 : d.nonlinearClickThroughURLTemplate;
34
- if (A)
35
- return await U(A), w.setKey(s, {
36
- id: a.id || "",
26
+ const p = await W.get(s);
27
+ if (E.debug(p, "parsedVAST"), e.current === f && w.get()[s].url) {
28
+ const o = p.ads.find((m) => m.creatives.length > 0);
29
+ if (o) {
30
+ E.debug(o, "validAd");
31
+ const m = o.creatives.find((d) => d.type === "nonlinear");
32
+ if (m) {
33
+ E.debug(m, "nonlinear");
34
+ const d = (r = (n = m.variations) == null ? void 0 : n[0]) == null ? void 0 : r.staticResource, I = (c = (u = m.variations) == null ? void 0 : u[0]) == null ? void 0 : c.nonlinearClickThroughURLTemplate;
35
+ if (d)
36
+ return await B(d), w.setKey(s, {
37
+ id: o.id || "",
37
38
  url: s,
38
- imageSrc: A,
39
- adUrl: C
40
- }), k.emit("exposedPauseAd", {
39
+ imageSrc: d,
40
+ adUrl: I
41
+ }), S.emit("exposedPauseAd", {
41
42
  action: "loaded",
42
43
  payload: {
43
- id: a.id || ""
44
+ id: o.id || ""
44
45
  }
45
46
  }), { success: !0 };
46
47
  }
47
- const P = a.creatives.find((A) => A.type === "companion");
48
- E.debug(P, "companion");
49
- const b = (y = (i = (h = (n = P == null ? void 0 : P.variations) == null ? void 0 : n[0]) == null ? void 0 : h.staticResources) == null ? void 0 : i[0]) == null ? void 0 : y.url, S = (f = (g = P == null ? void 0 : P.variations) == null ? void 0 : g[0]) == null ? void 0 : f.companionClickThroughURLTemplate;
50
- if (b)
51
- return await U(b), w.setKey(s, {
52
- id: a.id || "",
48
+ const g = o.creatives.find((d) => d.type === "companion");
49
+ E.debug(g, "companion");
50
+ const T = (y = (i = (h = (a = g == null ? void 0 : g.variations) == null ? void 0 : a[0]) == null ? void 0 : h.staticResources) == null ? void 0 : i[0]) == null ? void 0 : y.url, C = (A = (P = g == null ? void 0 : g.variations) == null ? void 0 : P[0]) == null ? void 0 : A.companionClickThroughURLTemplate;
51
+ if (T)
52
+ return await B(T), w.setKey(s, {
53
+ id: o.id || "",
53
54
  url: s,
54
- imageSrc: b,
55
- adUrl: S
56
- }), k.emit("exposedPauseAd", {
55
+ imageSrc: T,
56
+ adUrl: C
57
+ }), S.emit("exposedPauseAd", {
57
58
  action: "loaded",
58
59
  payload: {
59
- id: a.id || ""
60
+ id: o.id || ""
60
61
  }
61
62
  }), { success: !0 };
62
63
  }
63
64
  }
64
- } catch (u) {
65
- console.error("Error parsing VAST", u);
65
+ } catch (p) {
66
+ console.error("Error parsing VAST", p);
66
67
  }
67
68
  return { success: !1 };
68
69
  }, []), w];
69
- }, Q = /* @__PURE__ */ m("div")({
70
+ }, H = /* @__PURE__ */ v("div")({
70
71
  name: "PauseAdOverlay",
71
72
  class: "pw9gih8",
72
73
  propsAsIs: !1
73
- }), H = /* @__PURE__ */ m("div")({
74
+ }), J = /* @__PURE__ */ v("div")({
74
75
  name: "PauseAdContent",
75
76
  class: "p8lpomy",
76
77
  propsAsIs: !1
77
- }), W = /* @__PURE__ */ m("div")({
78
+ }), X = /* @__PURE__ */ v("div")({
78
79
  name: "PauseAdTopLeft",
79
80
  class: "pv7u167",
80
81
  propsAsIs: !1
81
- }), X = /* @__PURE__ */ m("h2")({
82
+ }), Y = /* @__PURE__ */ v("h2")({
82
83
  name: "PauseAdTitle",
83
84
  class: "p1kh2yb0",
84
85
  propsAsIs: !1
85
- }), Y = /* @__PURE__ */ m("p")({
86
+ }), Z = /* @__PURE__ */ v("p")({
86
87
  name: "PauseAdCaption",
87
88
  class: "pl8f94x",
88
89
  propsAsIs: !1
89
- }), Z = /* @__PURE__ */ m("div")({
90
+ }), ee = /* @__PURE__ */ v("div")({
90
91
  name: "PauseAdBottomLeft",
91
92
  class: "p1m6zmrt",
92
93
  propsAsIs: !1
93
- }), ee = /* @__PURE__ */ m("button")({
94
+ }), se = /* @__PURE__ */ v("button")({
94
95
  name: "PauseAdPlayButton",
95
96
  class: "pm3vwfa",
96
97
  propsAsIs: !1
97
- }), se = /* @__PURE__ */ m("div")({
98
+ }), re = /* @__PURE__ */ v("div")({
98
99
  name: "PauseAdSidebarGradient",
99
100
  class: "p1tibuhw",
100
101
  propsAsIs: !1
101
- }), re = /* @__PURE__ */ m("div")({
102
+ }), te = /* @__PURE__ */ v("div")({
102
103
  name: "PauseAdSidebar",
103
104
  class: "ptqqrqd",
104
105
  propsAsIs: !1
105
- }), te = /* @__PURE__ */ m("span")({
106
+ }), oe = /* @__PURE__ */ v("span")({
106
107
  name: "PauseAdTitleDescription",
107
108
  class: "p14estxv",
108
109
  propsAsIs: !1
109
- }), B = /* @__PURE__ */ m("img")({
110
+ }), K = /* @__PURE__ */ v("img")({
110
111
  name: "ExternalAdContainer",
111
112
  class: "e1dpvfl1",
112
113
  propsAsIs: !1
113
- }), ae = ({ vastUrl: e, isDesktop: s }) => {
114
+ }), ne = ({ vastUrl: e, isDesktop: s }) => {
114
115
  var t;
115
- const [, o] = V(), r = F(o, { keys: [e] });
116
- return T(() => {
117
- r && r[e] && r[e].imageSrc && r[e].id && k.emit("exposedPauseAd", {
116
+ const [, n] = _(), r = M(n, { keys: [e] });
117
+ return k(() => {
118
+ r && r[e] && r[e].imageSrc && r[e].id && S.emit("exposedPauseAd", {
118
119
  action: "rendered",
119
120
  payload: {
120
121
  id: r[e].id
121
122
  }
122
123
  });
123
- }, [r, e]), (t = r == null ? void 0 : r[e]) != null && t.imageSrc ? !r[e].adUrl || !s ? /* @__PURE__ */ l(B, { src: r[e].imageSrc }) : /* @__PURE__ */ l(
124
+ }, [r, e]), (t = r == null ? void 0 : r[e]) != null && t.imageSrc ? !r[e].adUrl || !s ? /* @__PURE__ */ l(K, { src: r[e].imageSrc }) : /* @__PURE__ */ l(
124
125
  "a",
125
126
  {
126
127
  onClick: () => {
127
- k.emit("exposedPauseAd", {
128
+ S.emit("exposedPauseAd", {
128
129
  action: "navigated",
129
130
  payload: {
130
131
  id: r[e].id
@@ -134,144 +135,144 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
134
135
  href: r[e].adUrl,
135
136
  target: "_blank",
136
137
  rel: "noopener noreferrer",
137
- children: /* @__PURE__ */ l(B, { src: r[e].imageSrc })
138
+ children: /* @__PURE__ */ l(K, { src: r[e].imageSrc })
138
139
  }
139
140
  ) : null;
140
- }, oe = ({ isClosing: e, title: s, caption: t, onPlay: o, onClose: r, vastUrl: c, options: d, isDesktop: n }) => {
141
- const h = (d == null ? void 0 : d.showPauseButton) ?? !0, { ref: i, focusSelf: y } = _.useFocusable({
141
+ }, ae = ({ isClosing: e, title: s, caption: t, onPlay: n, onClose: r, vastUrl: u, options: c, isDesktop: a }) => {
142
+ const h = (c == null ? void 0 : c.showPauseButton) ?? !0, { ref: i, focusSelf: y } = N.useFocusable({
142
143
  focusKey: "sl-pause-ad-play",
143
- onEnterRelease: o,
144
+ onEnterRelease: n,
144
145
  isFocusBoundary: !0,
145
146
  forceFocus: !0
146
147
  });
147
- return T(() => {
148
+ return k(() => {
148
149
  i.current && y();
149
- }, [i, y]), T(() => {
150
+ }, [i, y]), k(() => {
150
151
  if (!r)
151
152
  return () => {
152
153
  };
153
- const g = (f) => {
154
- const v = f.keyCode;
155
- if (v === 461 || v === 10009 || v === 27 || v === 8) {
156
- f.preventDefault(), f.stopPropagation(), f.stopImmediatePropagation(), r();
154
+ const P = (A) => {
155
+ const f = A.keyCode;
156
+ if (f === 461 || f === 10009 || f === 27 || f === 8) {
157
+ A.preventDefault(), A.stopPropagation(), A.stopImmediatePropagation(), r();
157
158
  return;
158
159
  }
159
160
  };
160
- return window.addEventListener("keydown", g, { capture: !0 }), () => window.removeEventListener("keydown", g, { capture: !0 });
161
- }, [r]), /* @__PURE__ */ l(Q, { className: $("SL_PauseAdOverlay", e && "pause-ad-closing"), children: /* @__PURE__ */ L(H, { children: [
162
- /* @__PURE__ */ L(W, { children: [
163
- /* @__PURE__ */ l(X, { children: s }),
164
- /* @__PURE__ */ l(Y, { children: t })
161
+ return window.addEventListener("keydown", P, { capture: !0 }), () => window.removeEventListener("keydown", P, { capture: !0 });
162
+ }, [r]), /* @__PURE__ */ l(H, { className: V("SL_PauseAdOverlay", e && "pause-ad-closing"), children: /* @__PURE__ */ D(J, { children: [
163
+ /* @__PURE__ */ D(X, { children: [
164
+ /* @__PURE__ */ l(Y, { children: s }),
165
+ /* @__PURE__ */ l(Z, { children: t })
165
166
  ] }),
166
- h && /* @__PURE__ */ l(Z, { children: /* @__PURE__ */ l(
167
- ee,
167
+ h && /* @__PURE__ */ l(ee, { children: /* @__PURE__ */ l(
168
+ se,
168
169
  {
169
170
  ref: i,
170
- onClick: o,
171
+ onClick: n,
171
172
  onMouseEnter: () => i.current.focus(),
172
173
  "aria-label": "Resume playback"
173
174
  }
174
175
  ) }),
175
- /* @__PURE__ */ l(se, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ L(re, { children: [
176
- c && /* @__PURE__ */ l(ae, { isDesktop: n, vastUrl: c }),
177
- /* @__PURE__ */ l(te, { children: "ADVERTISEMENT" })
176
+ /* @__PURE__ */ l(re, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ D(te, { children: [
177
+ u && /* @__PURE__ */ l(ne, { isDesktop: a, vastUrl: u }),
178
+ /* @__PURE__ */ l(oe, { children: "ADVERTISEMENT" })
178
179
  ] }) })
179
180
  ] }) });
180
- }, ne = ({ showPauseAd: e, vastUrls: s, title: t, caption: o, sdk: r, onClose: c, onRender: d, options: n, isDesktop: h }) => {
181
- const i = (n == null ? void 0 : n.pauseAdDelay) ?? 5e3, [y, g] = R(!1), [f, v] = R(!1), u = D(), a = s == null ? void 0 : s[0].url, p = D(a);
182
- p.current = a;
183
- const [P, b] = V(), S = I(() => {
184
- c && (k.emit("exposedPauseAd", {
181
+ }, ie = ({ showPauseAd: e, vastUrls: s, title: t, caption: n, sdk: r, onClose: u, onRender: c, options: a, isDesktop: h }) => {
182
+ const i = (a == null ? void 0 : a.pauseAdDelay) ?? 5e3, [y, P] = U(!1), [A, f] = U(!1), p = x(), o = s == null ? void 0 : s[0].url, m = x(o), g = x("");
183
+ m.current = o;
184
+ const [T, C] = _(), d = L(() => {
185
+ u && (g.current = m.current, S.emit("exposedPauseAd", {
185
186
  action: "closed",
186
187
  payload: {}
187
- }), c());
188
- }, [c]), A = I(() => {
188
+ }), u());
189
+ }, [u]), I = L(() => {
189
190
  r.controlVideoPlayer({ play: !0 });
190
191
  }, [r]);
191
- return T(() => {
192
- if (e && a) {
193
- k.emit("exposedPauseAd", {
192
+ return k(() => {
193
+ if (e && o) {
194
+ S.emit("exposedPauseAd", {
194
195
  action: "enabled",
195
196
  payload: {}
196
- }), P(a).then((x) => {
197
- p.current === a && (x == null ? void 0 : x.success) !== !0 && (clearTimeout(u.current), S == null || S());
197
+ }), T(o).then((b) => {
198
+ m.current === o && (b == null ? void 0 : b.success) !== !0 && (clearTimeout(p.current), d == null || d());
198
199
  }).catch(() => {
199
- p.current === a && (clearTimeout(u.current), S == null || S());
200
+ m.current === o && (clearTimeout(p.current), d == null || d());
200
201
  });
201
- const C = () => {
202
- const x = b.get()[p.current];
203
- x != null && x.imageSrc ? (clearTimeout(u.current), v(!1), g(!0)) : u.current = setTimeout(() => {
204
- C();
202
+ const R = () => {
203
+ const b = C.get()[m.current];
204
+ b != null && b.imageSrc ? (clearTimeout(p.current), f(!1), P(!0)) : p.current = setTimeout(() => {
205
+ R();
205
206
  }, 200);
206
207
  };
207
- u.current = setTimeout(() => {
208
- C();
208
+ p.current = setTimeout(() => {
209
+ R();
209
210
  }, i);
210
211
  } else
211
- k.emit("exposedPauseAd", {
212
+ g.current !== m.current && (g.current = "", S.emit("exposedPauseAd", {
212
213
  action: "disabled",
213
214
  payload: {}
214
- }), v(!0), u.current = setTimeout(() => {
215
- g(!1);
215
+ })), f(!0), p.current = setTimeout(() => {
216
+ P(!1);
216
217
  }, 400);
217
218
  return () => {
218
- u.current && clearTimeout(u.current);
219
+ p.current && clearTimeout(p.current);
219
220
  };
220
- }, [b, P, S, i, e, a]), T(() => {
221
- d == null || d({ rendered: y });
222
- }, [y, d]), T(() => () => {
223
- d == null || d({ rendered: !1 });
224
- }, [d]), y ? /* @__PURE__ */ l(
225
- oe,
221
+ }, [C, T, d, i, e, o]), k(() => {
222
+ c == null || c({ rendered: y });
223
+ }, [y, c]), k(() => () => {
224
+ c == null || c({ rendered: !1 });
225
+ }, [c]), y ? /* @__PURE__ */ l(
226
+ ae,
226
227
  {
227
- onClose: S,
228
- isClosing: f,
228
+ onClose: d,
229
+ isClosing: A,
229
230
  title: t,
230
- caption: o,
231
- onPlay: A,
232
- vastUrl: a,
233
- options: n,
231
+ caption: n,
232
+ onPlay: I,
233
+ vastUrl: o,
234
+ options: a,
234
235
  isDesktop: h
235
236
  }
236
237
  ) : null;
237
- }, ie = ({
238
+ }, le = ({
238
239
  showPauseAd: e,
239
240
  pauseAdVastUrl: s,
240
241
  videoPlayerController: t,
241
- onRenderPauseAd: o,
242
+ onRenderPauseAd: n,
242
243
  onClosePauseAd: r,
243
- children: c,
244
- options: d
244
+ children: u,
245
+ options: c
245
246
  }) => {
246
- const n = N(), h = j(), i = D();
247
- return T(() => n ? (t && (i.current = t, n.addVideoPlayerController(i.current)), () => {
248
- i.current && n.removeVideoPlayerController(i.current);
247
+ const a = O(), h = G(), i = x();
248
+ return k(() => a ? (t && (i.current = t, a.addVideoPlayerController(i.current)), () => {
249
+ i.current && a.removeVideoPlayerController(i.current);
249
250
  }) : () => {
250
- }, [n, t]), n ? /* @__PURE__ */ l("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ L(
251
- q,
251
+ }, [a, t]), a ? /* @__PURE__ */ l("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ D(
252
+ F,
252
253
  {
253
- style: c ? { position: "relative" } : {},
254
+ style: u ? { position: "relative" } : {},
254
255
  customTheme: h.theme,
255
256
  themeMode: h.themeMode,
256
257
  children: [
257
- c,
258
+ u,
258
259
  s && /* @__PURE__ */ l(
259
- ne,
260
+ ie,
260
261
  {
261
- sdk: n,
262
+ sdk: a,
262
263
  showPauseAd: e,
263
264
  vastUrls: s,
264
265
  onClose: r,
265
- onRender: o,
266
- options: d,
266
+ onRender: n,
267
+ options: c,
267
268
  isDesktop: !0
268
269
  }
269
270
  )
270
271
  ]
271
272
  }
272
- ) }) : c;
273
+ ) }) : u;
273
274
  };
274
- class ye extends O {
275
+ class Ae extends j {
275
276
  constructor(s) {
276
277
  super(s), this.state = { hasError: !1 };
277
278
  }
@@ -282,9 +283,9 @@ class ye extends O {
282
283
  console.error(s, t.componentStack);
283
284
  }
284
285
  render() {
285
- return this.state.hasError ? this.props.children : /* @__PURE__ */ l(ie, { ...this.props });
286
+ return this.state.hasError ? this.props.children : /* @__PURE__ */ l(le, { ...this.props });
286
287
  }
287
288
  }
288
289
  export {
289
- ye as StreamLayerPauseAd
290
+ Ae as StreamLayerPauseAd
290
291
  };
@@ -1,75 +1,76 @@
1
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { useState as u, useEffect as d } from "react";
3
- import { s as a, B as y, m as h, f as S, e as f, F as c, i as r, u as v, d as g, h as k } from "./provider.js";
4
- import "nanostores";
5
- import "lodash.throttle";
6
- import "react-dom";
7
- import "react-countup";
8
- import { S as A } from "./useStreamLayerApp2.js";
9
- const I = /* @__PURE__ */ a("div")({
1
+ import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
+ import { m as u, h as d } from "./index7.js";
3
+ import { useState as f, useEffect as y } from "react";
4
+ import { s as o, u as h } from "./sl-types.js";
5
+ import { F as c, e as a } from "./index3.js";
6
+ import { d as S } from "./index4.js";
7
+ import { B as v } from "./index5.js";
8
+ import { S as g } from "./useStreamLayerApp2.js";
9
+ import { B as k, z as A } from "./hooks-B0Qttldg.js";
10
+ const I = /* @__PURE__ */ o("div")({
10
11
  name: "PointsContainer",
11
12
  class: "psiob9b",
12
13
  propsAsIs: !1
13
- }), P = /* @__PURE__ */ a("div")({
14
+ }), P = /* @__PURE__ */ o("div")({
14
15
  name: "PointsIcon",
15
16
  class: "p1gqe4lh",
16
17
  propsAsIs: !1
17
- }), b = () => y, T = /* @__PURE__ */ a(b())({
18
+ }), b = () => v, B = /* @__PURE__ */ o(b())({
18
19
  name: "PointsSvg",
19
20
  class: "p15syg2y",
20
21
  propsAsIs: !0
21
- }), F = /* @__PURE__ */ a("div")({
22
+ }), F = /* @__PURE__ */ o("div")({
22
23
  name: "PointsBody",
23
24
  class: "p12n4f2h",
24
25
  propsAsIs: !1
25
- }), L = /* @__PURE__ */ a("div")({
26
+ }), T = /* @__PURE__ */ o("div")({
26
27
  name: "PointsTitle",
27
28
  class: "poqmx89",
28
29
  propsAsIs: !1
29
- }), x = /* @__PURE__ */ a("div")({
30
+ }), x = /* @__PURE__ */ o("div")({
30
31
  name: "PointsValue",
31
32
  class: "prj9b3v",
32
33
  propsAsIs: !1
33
- }), B = ({ points: s, onClick: e }) => /* @__PURE__ */ m(I, { className: h, onClick: e, children: [
34
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(T, { name: "icon-trophy-solid" }) }),
35
- /* @__PURE__ */ m(F, { children: [
36
- /* @__PURE__ */ t(L, { children: "Total points" }),
37
- /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(S, { value: s }) })
34
+ }), C = ({ points: s, onClick: t }) => /* @__PURE__ */ p(I, { className: u, onClick: t, children: [
35
+ /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(B, { name: "icon-trophy-solid" }) }),
36
+ /* @__PURE__ */ p(F, { children: [
37
+ /* @__PURE__ */ e(T, { children: "Total points" }),
38
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(S, { value: s }) })
38
39
  ] })
39
- ] }), C = ({ gamification: s }) => {
40
- const e = s.userSummary.$store, [o, l] = u(0);
41
- return d(() => {
42
- const n = e.subscribe((i) => {
43
- var p;
44
- (p = i == null ? void 0 : i.summary) != null && p.points && l(i.summary.points);
40
+ ] }), j = ({ gamification: s }) => {
41
+ const t = s.userSummary.$store, [n, l] = f(0);
42
+ return y(() => {
43
+ const r = t.subscribe((i) => {
44
+ var m;
45
+ (m = i == null ? void 0 : i.summary) != null && m.points && l(i.summary.points);
45
46
  });
46
47
  return () => {
47
- n();
48
+ r();
48
49
  };
49
- }, [e]), /* @__PURE__ */ t(B, { points: o, onClick: () => {
50
- const n = s.status.get();
51
- n === c.Suspended ? (s.openFeature(), r.emit("app", {
50
+ }, [t]), /* @__PURE__ */ e(C, { points: n, onClick: () => {
51
+ const r = s.status.get();
52
+ r === c.Suspended ? (s.openFeature(), a.emit("app", {
52
53
  action: "open",
53
54
  payload: {}
54
- }), r.emit("interactions", {
55
+ }), a.emit("interactions", {
55
56
  action: "tap",
56
57
  payload: {}
57
- })) : n === c.Ready && (s.closeFeature(!1), r.emit("app", {
58
+ })) : r === c.Ready && (s.closeFeature(!1), a.emit("app", {
58
59
  action: "close",
59
60
  payload: {}
60
- }), r.emit("interactions", {
61
+ }), a.emit("interactions", {
61
62
  action: "tap",
62
63
  payload: {}
63
64
  }));
64
65
  } });
65
- }, j = ({ sdk: s }) => {
66
- if (!f(s.featuresList.getStore()))
66
+ }, L = ({ sdk: s }) => {
67
+ if (!h(s.featuresList.getStore()))
67
68
  return null;
68
- const e = s.getFeature(A.GAMES);
69
- return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
69
+ const t = s.getFeature(g.GAMES);
70
+ return t ? /* @__PURE__ */ e(j, { gamification: t }) : null;
70
71
  }, R = ({ theme: s }) => {
71
- const e = v(), o = g();
72
- return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(k, { customTheme: s ?? o.theme, themeMode: o.themeMode, children: /* @__PURE__ */ t(j, { sdk: e }) }) }) : null;
72
+ const t = k(), n = A();
73
+ return t ? /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(d, { customTheme: s ?? n.theme, themeMode: n.themeMode, children: /* @__PURE__ */ e(L, { sdk: t }) }) }) : null;
73
74
  };
74
75
  export {
75
76
  R as StreamLayerSDKPoints