@streamlayer/react 1.24.6 → 1.24.8-pre.11da316

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 (167) hide show
  1. package/lib/app/advertisement.d.ts +5 -0
  2. package/lib/cjs/advertisement.js +19657 -203
  3. package/lib/cjs/auth.js +4459 -1
  4. package/lib/cjs/bet-pack.js +15728 -1
  5. package/lib/cjs/index.js +19469 -1
  6. package/lib/cjs/insight.js +13571 -1
  7. package/lib/cjs/masters.js +20735 -1
  8. package/lib/cjs/notification.js +13118 -1
  9. package/lib/cjs/package.json +1 -0
  10. package/lib/cjs/pause-ad.js +8390 -1
  11. package/lib/cjs/points.js +7220 -1
  12. package/lib/cjs/polyfills.js +69 -0
  13. package/lib/cjs/polymarket.js +16395 -14
  14. package/lib/cjs/style.css +1 -0
  15. package/lib/cjs/useStreamLayerApp.js +4705 -1
  16. package/lib/dist/cjs/index.js +20735 -1
  17. package/lib/dist/es/index.js +20708 -10
  18. package/lib/dist/es/polyfills.js +92 -0
  19. package/lib/es/Question.js +75 -72
  20. package/lib/es/advertisement.js +9223 -8168
  21. package/lib/es/analytics.js +35 -31
  22. package/lib/es/auth.js +1 -1
  23. package/lib/es/bet-pack.js +1 -1
  24. package/lib/es/feature.js +60 -56
  25. package/lib/{classic/es/hooks-n9ax4LRT.js → es/hooks-42q2i9Iw.js} +25 -23
  26. package/lib/{dist/es/index-CfSdnrfA.js → es/index-sWgEw6jy.js} +1 -1
  27. package/lib/es/index.js +1 -1
  28. package/lib/es/index10.js +181 -7
  29. package/lib/es/index11.js +371 -181
  30. package/lib/es/index12.js +116 -128
  31. package/lib/es/index13.js +101 -97
  32. package/lib/es/index14.js +14 -14
  33. package/lib/es/index15.js +384 -414
  34. package/lib/es/index16.js +380 -382
  35. package/lib/es/index2.js +53 -56
  36. package/lib/es/index3.js +34 -4
  37. package/lib/es/index4.js +2 -2
  38. package/lib/es/index5.js +272 -16
  39. package/lib/es/index6.js +1 -1
  40. package/lib/es/index8.js +8 -282
  41. package/lib/es/index9.js +133 -75
  42. package/lib/es/insight.js +2 -2
  43. package/lib/es/masters.js +1 -1
  44. package/lib/es/masters2.js +34 -35
  45. package/lib/es/notification.js +28 -28
  46. package/lib/es/pause-ad.js +20 -20
  47. package/lib/es/points.js +9 -9
  48. package/lib/es/polymarket.js +38 -38
  49. package/lib/es/storage.js +19 -19
  50. package/lib/es/style.css +1 -0
  51. package/lib/es/useStreamLayerApp.js +1 -1
  52. package/lib/es/useStreamLayerApp2.js +6756 -5470
  53. package/lib/es/utils.js +86 -41
  54. package/lib/source.css +1 -120
  55. package/package.json +99 -83
  56. package/lib/cjs/Question.js +0 -1
  57. package/lib/cjs/analytics.js +0 -1
  58. package/lib/cjs/feature.js +0 -1
  59. package/lib/cjs/gamification-feature.js +0 -1
  60. package/lib/cjs/gamification-feature2.js +0 -1
  61. package/lib/cjs/hooks-n9ax4LRT.js +0 -1
  62. package/lib/cjs/index-CfSdnrfA.js +0 -5
  63. package/lib/cjs/index10.js +0 -1
  64. package/lib/cjs/index11.js +0 -1
  65. package/lib/cjs/index12.js +0 -1
  66. package/lib/cjs/index13.js +0 -4
  67. package/lib/cjs/index14.js +0 -1
  68. package/lib/cjs/index15.js +0 -1
  69. package/lib/cjs/index16.js +0 -5
  70. package/lib/cjs/index2.js +0 -1
  71. package/lib/cjs/index3.js +0 -1
  72. package/lib/cjs/index4.js +0 -5
  73. package/lib/cjs/index5.js +0 -1
  74. package/lib/cjs/index6.js +0 -1
  75. package/lib/cjs/index7.js +0 -1
  76. package/lib/cjs/index8.js +0 -1
  77. package/lib/cjs/index9.js +0 -7
  78. package/lib/cjs/masters2.js +0 -8
  79. package/lib/cjs/storage.js +0 -1
  80. package/lib/cjs/theme.js +0 -1
  81. package/lib/cjs/useStreamLayerApp2.js +0 -17
  82. package/lib/cjs/utils.js +0 -47
  83. package/lib/classic/app/advertisement.d.ts +0 -19
  84. package/lib/classic/app/app.d.ts +0 -23
  85. package/lib/classic/app/auth.d.ts +0 -4
  86. package/lib/classic/app/bet-pack.d.ts +0 -10
  87. package/lib/classic/app/insight.d.ts +0 -13
  88. package/lib/classic/app/masters.d.ts +0 -19
  89. package/lib/classic/app/notification.d.ts +0 -5
  90. package/lib/classic/app/pause-ad.d.ts +0 -27
  91. package/lib/classic/app/points.d.ts +0 -3
  92. package/lib/classic/app/polymarket.d.ts +0 -7
  93. package/lib/classic/app/useStreamLayerApp.d.ts +0 -1
  94. package/lib/classic/cjs/Question.js +0 -1
  95. package/lib/classic/cjs/advertisement.js +0 -203
  96. package/lib/classic/cjs/analytics.js +0 -1
  97. package/lib/classic/cjs/auth.js +0 -1
  98. package/lib/classic/cjs/bet-pack.js +0 -5
  99. package/lib/classic/cjs/feature.js +0 -1
  100. package/lib/classic/cjs/gamification-feature.js +0 -1
  101. package/lib/classic/cjs/hooks-n9ax4LRT.js +0 -1
  102. package/lib/classic/cjs/index-CfSdnrfA.js +0 -5
  103. package/lib/classic/cjs/index.js +0 -1
  104. package/lib/classic/cjs/index10.js +0 -1
  105. package/lib/classic/cjs/index11.js +0 -1
  106. package/lib/classic/cjs/index12.js +0 -1
  107. package/lib/classic/cjs/index13.js +0 -4
  108. package/lib/classic/cjs/index2.js +0 -5
  109. package/lib/classic/cjs/index3.js +0 -1
  110. package/lib/classic/cjs/index4.js +0 -1
  111. package/lib/classic/cjs/index5.js +0 -1
  112. package/lib/classic/cjs/index6.js +0 -1
  113. package/lib/classic/cjs/index7.js +0 -7
  114. package/lib/classic/cjs/index8.js +0 -1
  115. package/lib/classic/cjs/index9.js +0 -1
  116. package/lib/classic/cjs/insight.js +0 -1
  117. package/lib/classic/cjs/notification.js +0 -1
  118. package/lib/classic/cjs/notification2.js +0 -1
  119. package/lib/classic/cjs/pause-ad.js +0 -1
  120. package/lib/classic/cjs/points.js +0 -1
  121. package/lib/classic/cjs/polymarket.js +0 -14
  122. package/lib/classic/cjs/useStreamLayerApp.js +0 -1
  123. package/lib/classic/cjs/useStreamLayerApp2.js +0 -17
  124. package/lib/classic/cjs/utils.js +0 -47
  125. package/lib/classic/es/Question.js +0 -503
  126. package/lib/classic/es/advertisement.js +0 -38792
  127. package/lib/classic/es/analytics.js +0 -84
  128. package/lib/classic/es/auth.js +0 -11
  129. package/lib/classic/es/bet-pack.js +0 -3418
  130. package/lib/classic/es/feature.js +0 -210
  131. package/lib/classic/es/gamification-feature.js +0 -4
  132. package/lib/classic/es/index-CfSdnrfA.js +0 -3775
  133. package/lib/classic/es/index.js +0 -15
  134. package/lib/classic/es/index10.js +0 -321
  135. package/lib/classic/es/index11.js +0 -2592
  136. package/lib/classic/es/index12.js +0 -185
  137. package/lib/classic/es/index13.js +0 -820
  138. package/lib/classic/es/index2.js +0 -2605
  139. package/lib/classic/es/index3.js +0 -19
  140. package/lib/classic/es/index4.js +0 -6
  141. package/lib/classic/es/index5.js +0 -4
  142. package/lib/classic/es/index6.js +0 -285
  143. package/lib/classic/es/index7.js +0 -181
  144. package/lib/classic/es/index8.js +0 -7
  145. package/lib/classic/es/index9.js +0 -11
  146. package/lib/classic/es/insight.js +0 -79
  147. package/lib/classic/es/notification.js +0 -9
  148. package/lib/classic/es/notification2.js +0 -1126
  149. package/lib/classic/es/pause-ad.js +0 -232
  150. package/lib/classic/es/points.js +0 -76
  151. package/lib/classic/es/polymarket.js +0 -6617
  152. package/lib/classic/es/useStreamLayerApp.js +0 -4
  153. package/lib/classic/es/useStreamLayerApp2.js +0 -11627
  154. package/lib/classic/es/utils.js +0 -76
  155. package/lib/classic/index.d.ts +0 -6
  156. package/lib/classic/masters.d.ts +0 -8
  157. package/lib/classic/source.css +0 -110
  158. package/lib/dist/cjs/gamification-feature.js +0 -1
  159. package/lib/dist/cjs/index-CfSdnrfA.js +0 -5
  160. package/lib/dist/cjs/masters.js +0 -69
  161. package/lib/dist/es/gamification-feature.js +0 -4
  162. package/lib/dist/es/masters.js +0 -22387
  163. package/lib/dist/index.d.ts +0 -1357
  164. package/lib/dist/source.css +0 -64
  165. package/lib/es/hooks-n9ax4LRT.js +0 -97
  166. package/lib/es/index-CfSdnrfA.js +0 -3775
  167. package/lib/style.css +0 -1
@@ -1,15 +0,0 @@
1
- import { h as r } from "./index8.js";
2
- import { D as m } from "./index2.js";
3
- import { a as S, x as s } from "./notification2.js";
4
- import { V as L, g as i, Y as f, _ as x, q as D } from "./hooks-n9ax4LRT.js";
5
- export {
6
- L as StreamLayerProvider,
7
- i as StreamLayerSDKEvent,
8
- S as StreamLayerSDKNotification,
9
- s as StreamLayerSDKNotificationUI,
10
- m as StreamLayerSDKReact,
11
- r as StreamLayerThemeProvider,
12
- f as useStreamLayer,
13
- x as useStreamLayerTheme,
14
- D as useStreamLayerUI
15
- };
@@ -1,321 +0,0 @@
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 "./index6.js";
5
- import { G as ue, d as ie, b as de } from "./index7.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",
18
- propsAsIs: !0
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
27
- }) => {
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
55
- })
56
- });
57
- }, he = /* @__PURE__ */ n("div")({
58
- name: "Container",
59
- class: "c1bgb86j",
60
- propsAsIs: !1
61
- }), Ie = /* @__PURE__ */ n("video")({
62
- name: "Player",
63
- class: "p6703cq",
64
- propsAsIs: !1
65
- }), be = /* @__PURE__ */ n("img")({
66
- name: "Poster",
67
- class: "p12ow7zo",
68
- propsAsIs: !1
69
- }), R = /* @__PURE__ */ n("div")({
70
- name: "Control",
71
- class: "cdpal9o",
72
- propsAsIs: !1
73
- }), Pe = "t1xke4ml", Ae = "h1yzxv57", ve = /* @__PURE__ */ n("div")({
74
- name: "VideoControls",
75
- class: "vxo8xch",
76
- propsAsIs: !1
77
- }), D = /* @__PURE__ */ n("button")({
78
- name: "ControlBtn",
79
- class: "coyuzu0",
80
- propsAsIs: !1
81
- }), Ce = () => D, Me = /* @__PURE__ */ n(Ce())({
82
- name: "MuteIcon",
83
- class: "musmi9a",
84
- propsAsIs: !0
85
- }), ke = () => D, we = /* @__PURE__ */ n(ke())({
86
- name: "PauseIcon",
87
- class: "p1qe7rum",
88
- propsAsIs: !0
89
- }), Ve = () => D, xe = /* @__PURE__ */ n(Ve())({
90
- name: "PlayIcon",
91
- class: "psevery",
92
- propsAsIs: !0
93
- }), Y = /* @__PURE__ */ n("button")({
94
- name: "WebOSIconButton",
95
- class: "w1q3u7py",
96
- propsAsIs: !1
97
- }), Ee = () => Y, L = /* @__PURE__ */ n(Ee())({
98
- name: "WebOSIconButtonAnimation",
99
- class: "wdlqvum",
100
- propsAsIs: !0
101
- }), Ne = () => L, Oe = /* @__PURE__ */ n(Ne())({
102
- name: "WebOSIconButtonPlay",
103
- class: "w1ylz9ea",
104
- propsAsIs: !0
105
- }), Se = () => L, We = /* @__PURE__ */ n(Se())({
106
- name: "WebOSIconButtonPause",
107
- class: "w1iylt55",
108
- propsAsIs: !0
109
- }), Be = () => L, Re = /* @__PURE__ */ n(Be())({
110
- name: "WebOSIconButtonMute",
111
- class: "w8h4h7",
112
- propsAsIs: !0
113
- }), Te = () => L, Le = /* @__PURE__ */ n(Te())({
114
- name: "WebOSIconButtonUnmute",
115
- class: "w12l12kt",
116
- propsAsIs: !0
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]
138
- );
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,
229
- {
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 } : {},
237
- children: [
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, {}) })
312
- ]
313
- }
314
- );
315
- }
316
- );
317
- export {
318
- He as O,
319
- Ye as V,
320
- Ze as y
321
- };