@streamlayer/react 1.23.0 → 1.23.2

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/pause-ad.d.ts +2 -4
  2. package/lib/app/polymarket.d.ts +7 -0
  3. package/lib/cjs/Question.js +1 -1
  4. package/lib/cjs/advertisement.js +28 -223
  5. package/lib/cjs/analytics.js +1 -1
  6. package/lib/cjs/auth.js +1 -1
  7. package/lib/cjs/bet-pack.js +1 -1
  8. package/lib/cjs/feature.js +1 -0
  9. package/lib/cjs/gamification-feature.js +1 -1
  10. package/lib/cjs/gamification-feature2.js +1 -1
  11. package/lib/cjs/hooks-WfHlJH12.js +1 -0
  12. package/lib/cjs/index-eShKGO10.js +1 -5
  13. package/lib/cjs/index.js +1 -1
  14. package/lib/cjs/index10.js +1 -4
  15. package/lib/cjs/index11.js +3 -1
  16. package/lib/cjs/index12.js +1 -1
  17. package/lib/cjs/index13.js +3 -1
  18. package/lib/cjs/index14.js +1 -1
  19. package/lib/cjs/index15.js +1 -5
  20. package/lib/cjs/index16.js +3 -0
  21. package/lib/cjs/index2.js +1 -1
  22. package/lib/cjs/index3.js +1 -1
  23. package/lib/cjs/index4.js +3 -5
  24. package/lib/cjs/index5.js +1 -1
  25. package/lib/cjs/index6.js +1 -1
  26. package/lib/cjs/index7.js +1 -1
  27. package/lib/cjs/index8.js +1 -1
  28. package/lib/cjs/index9.js +1 -1
  29. package/lib/cjs/insight.js +1 -1
  30. package/lib/cjs/masters.js +1 -1
  31. package/lib/cjs/masters2.js +1 -13
  32. package/lib/cjs/notification.js +1 -1
  33. package/lib/cjs/pause-ad.js +1 -1
  34. package/lib/cjs/points.js +1 -1
  35. package/lib/cjs/polymarket.js +9 -0
  36. package/lib/cjs/sl-types.js +1 -15
  37. package/lib/cjs/storage.js +1 -1
  38. package/lib/cjs/style.css +1 -0
  39. package/lib/cjs/theme.js +1 -17
  40. package/lib/cjs/useStreamLayerApp.js +1 -1
  41. package/lib/cjs/useStreamLayerApp2.js +3 -17
  42. package/lib/cjs/utils.js +1 -47
  43. package/lib/classic/app/pause-ad.d.ts +2 -4
  44. package/lib/classic/app/polymarket.d.ts +7 -0
  45. package/lib/classic/cjs/Question.js +1 -1
  46. package/lib/classic/cjs/advertisement.js +28 -223
  47. package/lib/classic/cjs/analytics.js +1 -1
  48. package/lib/classic/cjs/auth.js +1 -1
  49. package/lib/classic/cjs/bet-pack.js +3 -5
  50. package/lib/classic/cjs/feature.js +1 -0
  51. package/lib/classic/cjs/gamification-feature.js +1 -1
  52. package/lib/classic/cjs/hooks-WfHlJH12.js +1 -0
  53. package/lib/classic/cjs/index-eShKGO10.js +1 -5
  54. package/lib/classic/cjs/index.js +1 -1
  55. package/lib/classic/cjs/index10.js +1 -1
  56. package/lib/classic/cjs/index11.js +1 -1
  57. package/lib/classic/cjs/index12.js +1 -4
  58. package/lib/classic/cjs/index13.js +3 -0
  59. package/lib/classic/cjs/index2.js +3 -5
  60. package/lib/classic/cjs/index3.js +1 -1
  61. package/lib/classic/cjs/index4.js +1 -1
  62. package/lib/classic/cjs/index5.js +1 -1
  63. package/lib/classic/cjs/index6.js +1 -1
  64. package/lib/classic/cjs/index7.js +1 -1
  65. package/lib/classic/cjs/index8.js +1 -1
  66. package/lib/classic/cjs/index9.js +3 -1
  67. package/lib/classic/cjs/insight.js +1 -1
  68. package/lib/classic/cjs/notification.js +1 -1
  69. package/lib/classic/cjs/notification2.js +1 -1
  70. package/lib/classic/cjs/pause-ad.js +1 -1
  71. package/lib/classic/cjs/points.js +1 -1
  72. package/lib/classic/cjs/polymarket.js +9 -0
  73. package/lib/classic/cjs/sl-types.js +1 -15
  74. package/lib/classic/cjs/style.css +1 -0
  75. package/lib/classic/cjs/useStreamLayerApp.js +1 -1
  76. package/lib/classic/cjs/useStreamLayerApp2.js +3 -17
  77. package/lib/classic/cjs/utils.js +1 -47
  78. package/lib/classic/es/Question.js +277 -264
  79. package/lib/classic/es/advertisement.js +34990 -18881
  80. package/lib/classic/es/analytics.js +58 -56
  81. package/lib/classic/es/auth.js +14 -8
  82. package/lib/classic/es/bet-pack.js +2448 -2418
  83. package/lib/classic/es/feature.js +108 -0
  84. package/lib/classic/es/gamification-feature.js +2 -2
  85. package/lib/classic/es/hooks-WfHlJH12.js +98 -0
  86. package/lib/classic/es/index-eShKGO10.js +948 -948
  87. package/lib/classic/es/index.js +13 -13
  88. package/lib/classic/es/index10.js +83 -2295
  89. package/lib/classic/es/index11.js +3095 -179
  90. package/lib/classic/es/index12.js +174 -821
  91. package/lib/classic/es/index13.js +850 -0
  92. package/lib/classic/es/index2.js +2099 -1763
  93. package/lib/classic/es/index3.js +11 -11
  94. package/lib/classic/es/index4.js +127 -127
  95. package/lib/classic/es/index5.js +3 -5
  96. package/lib/classic/es/index6.js +10 -11
  97. package/lib/classic/es/index7.js +6 -62
  98. package/lib/classic/es/index8.js +9 -316
  99. package/lib/classic/es/index9.js +316 -82
  100. package/lib/classic/es/insight.js +58 -53
  101. package/lib/classic/es/notification.js +5 -5
  102. package/lib/classic/es/notification2.js +765 -722
  103. package/lib/classic/es/pause-ad.js +190 -167
  104. package/lib/classic/es/points.js +55 -47
  105. package/lib/classic/es/polymarket.js +6848 -0
  106. package/lib/classic/es/sl-types.js +193 -125
  107. package/lib/classic/es/useStreamLayerApp.js +2 -2
  108. package/lib/classic/es/useStreamLayerApp2.js +9727 -7592
  109. package/lib/classic/es/utils.js +28 -28
  110. package/lib/classic/index.d.ts +1 -0
  111. package/lib/classic/style.css +1 -0
  112. package/lib/dist/cjs/gamification-feature.js +1 -1
  113. package/lib/dist/cjs/index-eShKGO10.js +1 -5
  114. package/lib/dist/cjs/index.js +1 -1
  115. package/lib/dist/cjs/masters.js +3 -77
  116. package/lib/dist/es/gamification-feature.js +2 -2
  117. package/lib/dist/es/index-eShKGO10.js +948 -948
  118. package/lib/dist/es/index.js +7 -8
  119. package/lib/dist/es/masters.js +18212 -14741
  120. package/lib/dist/index.d.ts +29 -8
  121. package/lib/dist/style.css +1 -1
  122. package/lib/es/Question.js +108 -106
  123. package/lib/es/advertisement.js +34990 -18881
  124. package/lib/es/analytics.js +58 -56
  125. package/lib/es/auth.js +14 -8
  126. package/lib/es/bet-pack.js +29 -17
  127. package/lib/es/feature.js +108 -0
  128. package/lib/es/gamification-feature.js +2 -2
  129. package/lib/es/gamification-feature2.js +2 -2
  130. package/lib/es/hooks-WfHlJH12.js +98 -0
  131. package/lib/es/index-eShKGO10.js +948 -948
  132. package/lib/es/index.js +14 -13
  133. package/lib/es/index10.js +258 -816
  134. package/lib/es/index11.js +837 -170
  135. package/lib/es/index12.js +181 -312
  136. package/lib/es/index13.js +316 -82
  137. package/lib/es/index14.js +83 -2350
  138. package/lib/es/index15.js +3069 -1224
  139. package/lib/es/index16.js +1453 -0
  140. package/lib/es/index2.js +1118 -984
  141. package/lib/es/index3.js +3 -62
  142. package/lib/es/index4.js +2424 -2407
  143. package/lib/es/index5.js +11 -11
  144. package/lib/es/index6.js +127 -127
  145. package/lib/es/index7.js +10 -7
  146. package/lib/es/index8.js +5 -9
  147. package/lib/es/index9.js +10 -265
  148. package/lib/es/insight.js +58 -53
  149. package/lib/es/masters.js +6 -5
  150. package/lib/es/masters2.js +696 -558
  151. package/lib/es/notification.js +697 -655
  152. package/lib/es/pause-ad.js +190 -167
  153. package/lib/es/points.js +56 -48
  154. package/lib/es/polymarket.js +6848 -0
  155. package/lib/es/sl-types.js +200 -132
  156. package/lib/es/storage.js +75 -74
  157. package/lib/es/theme.js +177 -31
  158. package/lib/es/useStreamLayerApp.js +2 -2
  159. package/lib/es/useStreamLayerApp2.js +9727 -7592
  160. package/lib/es/utils.js +28 -28
  161. package/lib/index.d.ts +1 -0
  162. package/lib/style.css +1 -1
  163. package/package.json +33 -20
  164. package/lib/cjs/hooks-B0Qttldg.js +0 -1
  165. package/lib/classic/cjs/hooks-B0Qttldg.js +0 -1
  166. package/lib/classic/es/hooks-B0Qttldg.js +0 -98
  167. package/lib/es/hooks-B0Qttldg.js +0 -98
package/lib/es/index13.js CHANGED
@@ -1,87 +1,321 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { d as x } from "./index14.js";
3
- import { useEffect as h, useState as d, useCallback as p } from "react";
4
- import { s as f, N as O, I as k, O as y, S as E } from "./sl-types.js";
5
- import { CountdownCircleTimer as g } from "react-countdown-circle-timer";
6
- import { B as P } from "./index6.js";
7
- const v = (i) => {
8
- const { Component: o, options: t, customOptions: s, autoFocus: r, ...l } = i, e = x.useFocusable({
9
- ...t,
10
- ...s,
11
- onEnterPress: () => {
12
- var a;
13
- return (a = i.onClick) == null ? void 0 : a.call(i, { currentTarget: e.ref.current, stopPropagation: () => {
14
- } });
15
- }
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { s as styled_default, c as cx_default } from "./sl-types.js";
3
+ import { useState, useEffect, useCallback, forwardRef, useRef } from "react";
4
+ import { B as B1 } from "./index6.js";
5
+ import { G, d as d$1, O as O$1 } from "./index14.js";
6
+ import { C as CloseTimerAuto } from "./useStreamLayerApp2.js";
7
+ const g = /* @__PURE__ */ styled_default("div")({
8
+ name: "CloseIconWrap",
9
+ class: "c3v6bv6",
10
+ propsAsIs: false
11
+ }), h = /* @__PURE__ */ styled_default("div")({
12
+ name: "TimerWrap",
13
+ class: "teuhmro",
14
+ propsAsIs: false
15
+ }), A$1 = () => B1, C$1 = /* @__PURE__ */ styled_default(A$1())({
16
+ name: "Icon",
17
+ class: "i17rfxv5",
18
+ propsAsIs: true
19
+ }), y$1 = ({
20
+ close: r2,
21
+ className: a2,
22
+ timerClassName: m,
23
+ skipIcon: o2,
24
+ isPlaying: c2 = true,
25
+ duration: e2 = 0,
26
+ autoClose: n2
27
+ }) => {
28
+ const [p2, i2] = useState(e2 === 0);
29
+ useEffect(() => {
30
+ i2(!e2);
31
+ }, [e2]);
32
+ const l2 = useCallback(() => {
33
+ n2 === CloseTimerAuto.ENABLED ? r2 == null || r2() : i2(true);
34
+ }, [n2, r2]);
35
+ return p2 ? /* @__PURE__ */ jsxs(g, {
36
+ "data-a": "intr",
37
+ onClick: r2,
38
+ className: a2,
39
+ style: o2 ? {
40
+ width: "auto"
41
+ } : {},
42
+ children: [o2 && /* @__PURE__ */ jsx("span", {
43
+ "data-a": "intr",
44
+ children: "Skip"
45
+ }), /* @__PURE__ */ jsx(C$1, {
46
+ "data-a": "intr",
47
+ name: o2 ? "iconSkip" : "icon-cross"
48
+ })]
49
+ }) : /* @__PURE__ */ jsx(h, {
50
+ children: /* @__PURE__ */ jsx(G, {
51
+ className: m,
52
+ isPlaying: c2,
53
+ duration: e2,
54
+ onTimerExpired: l2
55
+ })
16
56
  });
17
- return h(() => {
18
- r && e.focusSelf();
19
- }, []), /* @__PURE__ */ n(o, { ...l, ...e, "data-is-with-focus": "true" });
20
57
  };
21
- function B(i, o) {
22
- return ({ webos: t, options: s, ...r }) => t ? /* @__PURE__ */ n(v, { Component: i, options: o, customOptions: s, ...r }) : /* @__PURE__ */ n(i, { ...r });
58
+ const i = /* @__PURE__ */ styled_default("div")({
59
+ name: "Container",
60
+ class: "c1bgb86j",
61
+ propsAsIs: false
62
+ }), A = /* @__PURE__ */ styled_default("video")({
63
+ name: "Player",
64
+ class: "p6703cq",
65
+ propsAsIs: false
66
+ }), b = /* @__PURE__ */ styled_default("img")({
67
+ name: "Poster",
68
+ class: "p12ow7zo",
69
+ propsAsIs: false
70
+ }), B = /* @__PURE__ */ styled_default("div")({
71
+ name: "Control",
72
+ class: "cdpal9o",
73
+ propsAsIs: false
74
+ }), x = "t1xke4ml", y = "h1yzxv57", P = /* @__PURE__ */ styled_default("div")({
75
+ name: "VideoControls",
76
+ class: "vxo8xch",
77
+ propsAsIs: false
78
+ }), n = /* @__PURE__ */ styled_default("button")({
79
+ name: "ControlBtn",
80
+ class: "coyuzu0",
81
+ propsAsIs: false
82
+ }), t = () => n, O = /* @__PURE__ */ styled_default(t())({
83
+ name: "MuteIcon",
84
+ class: "musmi9a",
85
+ propsAsIs: true
86
+ }), e = () => n, S = /* @__PURE__ */ styled_default(e())({
87
+ name: "PauseIcon",
88
+ class: "p1qe7rum",
89
+ propsAsIs: true
90
+ }), c = () => n, W = /* @__PURE__ */ styled_default(c())({
91
+ name: "PlayIcon",
92
+ class: "psevery",
93
+ propsAsIs: true
94
+ }), a = /* @__PURE__ */ styled_default("button")({
95
+ name: "WebOSIconButton",
96
+ class: "w1q3u7py",
97
+ propsAsIs: false
98
+ }), p = () => a, o = /* @__PURE__ */ styled_default(p())({
99
+ name: "WebOSIconButtonAnimation",
100
+ class: "wdlqvum",
101
+ propsAsIs: true
102
+ }), l = () => o, d = /* @__PURE__ */ styled_default(l())({
103
+ name: "WebOSIconButtonPlay",
104
+ class: "w1ylz9ea",
105
+ propsAsIs: true
106
+ }), r = () => o, C = /* @__PURE__ */ styled_default(r())({
107
+ name: "WebOSIconButtonPause",
108
+ class: "w1iylt55",
109
+ propsAsIs: true
110
+ }), u = () => o, f = /* @__PURE__ */ styled_default(u())({
111
+ name: "WebOSIconButtonMute",
112
+ class: "w8h4h7",
113
+ propsAsIs: true
114
+ }), I = () => o, v = /* @__PURE__ */ styled_default(I())({
115
+ name: "WebOSIconButtonUnmute",
116
+ class: "w12l12kt",
117
+ propsAsIs: true
118
+ });
119
+ const It = (r2) => {
120
+ for (const s of r2)
121
+ s.isIntersecting ? s.target instanceof HTMLVideoElement && s.target.autoplay && s.target.play() : s.target instanceof HTMLVideoElement && !s.target.paused && s.target.pause();
122
+ }, $ = new IntersectionObserver(It, { threshold: 0.5 }), D = /* @__PURE__ */ new Set(), Bt = (r2) => {
123
+ $.observe(r2), D.add(r2);
124
+ }, Ot = (r2) => {
125
+ $.unobserve(r2), D.delete(r2);
126
+ }, wt = () => {
127
+ for (const r2 of D)
128
+ r2 instanceof HTMLVideoElement && !r2.paused && r2.pause();
129
+ };
130
+ function yt(...r2) {
131
+ return useCallback(
132
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
133
+ (s) => {
134
+ for (const c2 of r2)
135
+ c2 !== null && (typeof c2 == "function" ? c2(s) : c2 && (c2.current = s));
136
+ },
137
+ // Re-run the callback if the array of refs changes
138
+ // eslint-disable-next-line react-hooks/exhaustive-deps
139
+ [...r2]
140
+ );
23
141
  }
24
- const w = [10, 10, 1, 0], I = /* @__PURE__ */ f("div")({
25
- name: "RemainingTimeCircle",
26
- class: "r165427",
27
- propsAsIs: !1
28
- }), S = /* @__PURE__ */ f("div")({
29
- name: "RemainingTime",
30
- class: "r17garf3",
31
- propsAsIs: !1
32
- }), b = y, c = O, u = E, F = ({
33
- className: i,
34
- duration: o = 30,
35
- onTimerExpired: t,
36
- isPlaying: s = !0
37
- }) => /* @__PURE__ */ n(g, {
38
- isPlaying: s,
39
- strokeWidth: 0,
40
- duration: o,
41
- colors: c,
42
- size: 24,
43
- onComplete: t,
44
- children: ({
45
- remainingTime: r
46
- }) => /* @__PURE__ */ n(S, {
47
- className: i,
48
- children: o === 0 ? 0 : r
49
- })
50
- }), j = ({
51
- isPlaying: i = !0,
52
- duration: o = 30,
53
- onTimerExpired: t
54
- }) => {
55
- const [s, r] = d(o > 10 ? b : c), [l, e] = d(2);
56
- h(() => {
57
- o === 0 && (e(0), r(u));
58
- }, [o]);
59
- const a = ({
60
- remainingTime: m
61
- }) => /* @__PURE__ */ n(I, {
62
- children: o === 0 ? 0 : m
63
- }), C = p(() => {
64
- t == null || t(), r(u);
65
- }, [t, r]), T = p((m) => {
66
- m === 10 && r(c);
67
- }, [r]);
68
- return /* @__PURE__ */ n(g, {
69
- isPlaying: i,
70
- duration: o,
71
- colors: k,
72
- colorsTime: w,
73
- size: 32,
74
- strokeWidth: l,
75
- trailStrokeWidth: 2,
76
- trailColor: s,
77
- onComplete: C,
78
- onUpdate: T,
79
- children: a
80
- });
81
- }, G = ({ height: i = "37px", width: o = "37px" }) => /* @__PURE__ */ n("div", { style: { height: i, width: o }, children: /* @__PURE__ */ n(P, { name: "loader" }) });
142
+ const Lt = O$1(i), Pt = ({ loading: r2, autoPlay: s, played: c2, playing: i2, isMuted: f2, unmute: d2, mute: h2, togglePlaying: l2 }) => !r2 && !s && !c2 ? /* @__PURE__ */ jsx(B, { children: i2 ? /* @__PURE__ */ jsx(B1, { name: "icon-pause" }) : /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) : c2 ? /* @__PURE__ */ jsxs(P, { children: [
143
+ i2 ? /* @__PURE__ */ jsx(S, { onClick: l2 }) : /* @__PURE__ */ jsx(W, { onClick: l2 }),
144
+ /* @__PURE__ */ jsx(O, { className: cx_default(!f2 && "muted"), onClick: f2 ? d2 : h2 })
145
+ ] }) : null, Tt = ({
146
+ loading: r2,
147
+ autoPlay: s,
148
+ playMuted: c2,
149
+ playing: i2,
150
+ played: f$1,
151
+ unmute: d$12,
152
+ mute: h2,
153
+ isMuted: l2,
154
+ hasNotPausedVideo: p2,
155
+ hasInteractedWithAudio: w
156
+ }) => /* @__PURE__ */ jsxs(Fragment, { children: [
157
+ !r2 && !(s && c2) && /* @__PURE__ */ jsx(B, { "data-control-btn": "true", children: i2 ? p2 ? null : /* @__PURE__ */ jsx(d, { children: /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) : f$1 ? /* @__PURE__ */ jsx(C, { children: /* @__PURE__ */ jsx(B1, { name: "icon-pause" }) }) : /* @__PURE__ */ jsx(a, { "data-control-icon": "true", children: /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) }),
158
+ !r2 && s && c2 && w && /* @__PURE__ */ jsx(B, { children: l2 ? /* @__PURE__ */ jsx(f, { onClick: d$12, children: /* @__PURE__ */ jsx(B1, { name: "iconMute" }) }) : /* @__PURE__ */ jsx(v, { onClick: h2, children: /* @__PURE__ */ jsx(B1, { name: "iconUnMute" }) }) })
159
+ ] }), Et = forwardRef(
160
+ ({
161
+ poster: r2,
162
+ source: s,
163
+ aspectRatio: c2,
164
+ controlVideo: i2,
165
+ onReplay: f2,
166
+ onPlay: d2,
167
+ onPause: h2,
168
+ onEnd: l2,
169
+ onRender: p2,
170
+ onMute: w,
171
+ onQuartile: u2,
172
+ autoPlay: v2,
173
+ playMuted: S2,
174
+ className: K,
175
+ muted: y$12,
176
+ webos: T,
177
+ hasNotPausedVideo: V
178
+ }, R) => {
179
+ const n2 = useRef(null), Q = yt(n2, R), x$1 = useRef(false), E = useRef(false), m = useRef(/* @__PURE__ */ new Set()), [z, G2] = useState(false), [W2, k] = useState(false), [j, J] = useState(false), [X, H] = useState(true), [A$12, U] = useState(S2), [q, tt] = useState(false);
180
+ useEffect(() => {
181
+ s && (U(S2), G2(false));
182
+ }, [s]);
183
+ const C2 = useCallback(() => {
184
+ i2 == null || i2({ muted: false });
185
+ }, [i2]), Y = useCallback(() => {
186
+ i2 == null || i2({ muted: true });
187
+ }, [i2]), I2 = useCallback((t2) => {
188
+ t2 == null || t2.stopPropagation(), n2.current && (n2.current.muted = true), U(true);
189
+ }, []), L = useCallback(
190
+ (t2) => {
191
+ t2 == null || t2.stopPropagation(), n2.current && (n2.current.muted = false), U(false), q || tt(true);
192
+ },
193
+ [q]
194
+ );
195
+ useEffect(() => {
196
+ y$12 !== void 0 && (y$12 ? I2() : L());
197
+ }, [I2, y$12, L]);
198
+ const Z = (t2) => {
199
+ var b2;
200
+ (b2 = t2.stopPropagation) == null || b2.call(t2);
201
+ const o2 = n2 == null ? void 0 : n2.current;
202
+ if (o2)
203
+ if (W2)
204
+ o2.pause();
205
+ else {
206
+ const a2 = n2 == null ? void 0 : n2.current;
207
+ if (!a2)
208
+ return;
209
+ wt(), a2.play().catch((rt) => console.log(rt)), H(false);
210
+ }
211
+ }, et = () => {
212
+ var t2;
213
+ (t2 = n2 == null ? void 0 : n2.current) == null || t2.load(), H(true);
214
+ };
215
+ return useEffect(() => () => {
216
+ C2();
217
+ }, [C2]), useEffect(() => {
218
+ const t2 = n2.current;
219
+ return t2 ? (E.current = t2.muted, U(t2.muted), Bt(t2), () => {
220
+ Ot(t2);
221
+ }) : () => {
222
+ };
223
+ }, []), useEffect(() => {
224
+ p2 == null || p2();
225
+ }, [p2]), useEffect(() => {
226
+ m.current.clear(), x$1.current = false;
227
+ }, [s]), /* @__PURE__ */ jsxs(
228
+ Lt,
229
+ {
230
+ webos: T,
231
+ onClick: v2 && S2 ? A$12 ? L : I2 : Z,
232
+ "data-a": "intr",
233
+ autoFocus: true,
234
+ options: { focusKey: "video-play-btn" },
235
+ className: cx_default(W2 && !T && x, v2 && y, K),
236
+ style: c2 ? { aspectRatio: c2 } : {},
237
+ children: [
238
+ /* @__PURE__ */ jsx(
239
+ A,
240
+ {
241
+ ref: Q,
242
+ src: s,
243
+ autoPlay: v2,
244
+ onPlay: () => {
245
+ G2(true), x$1.current && (f2 == null || f2(), m.current.clear()), k(true), H(false), d2 == null || d2(), S2 ? I2() : Y();
246
+ },
247
+ onTimeUpdate: (t2) => {
248
+ const o2 = t2.target.duration, b2 = t2.target.currentTime;
249
+ if (o2 && b2) {
250
+ const a2 = Math.floor(b2 / o2 * 100);
251
+ a2 >= 25 && a2 < 50 && !m.current.has(25) ? (u2 == null || u2(25), m.current.add(25)) : a2 >= 50 && a2 < 75 && !m.current.has(50) ? (u2 == null || u2(50), m.current.add(50)) : a2 >= 75 && !m.current.has(75) && (u2 == null || u2(75), m.current.add(75));
252
+ }
253
+ },
254
+ onVolumeChange: (t2) => {
255
+ const o2 = t2.target.muted;
256
+ E.current !== o2 && (w == null || w(o2), E.current = o2, (o2 !== y$12 || y$12 === void 0) && (o2 ? C2() : Y()));
257
+ },
258
+ onError: async (t2) => {
259
+ try {
260
+ if (t2.target instanceof HTMLVideoElement) {
261
+ J(true);
262
+ const b2 = await (await fetch(t2.target.src)).blob(), a2 = URL.createObjectURL(b2);
263
+ t2.target.src = a2;
264
+ }
265
+ } catch (o2) {
266
+ console.error("video fallback fetch failed", o2), k(true), H(true);
267
+ } finally {
268
+ J(false), C2();
269
+ }
270
+ },
271
+ onPause: () => {
272
+ k(false), h2 == null || h2(), C2();
273
+ },
274
+ onEnded: () => {
275
+ k(false), x$1.current = true, et(), l2 == null || l2(), C2();
276
+ },
277
+ style: { visibility: X ? "hidden" : "visible" },
278
+ controls: false,
279
+ playsInline: true
280
+ }
281
+ ),
282
+ /* @__PURE__ */ jsx(b, { src: r2, style: { visibility: X ? "visible" : "hidden" } }),
283
+ !T && /* @__PURE__ */ jsx(
284
+ Pt,
285
+ {
286
+ loading: j,
287
+ autoPlay: v2,
288
+ played: z,
289
+ playing: W2,
290
+ isMuted: A$12,
291
+ unmute: L,
292
+ mute: I2,
293
+ togglePlaying: Z
294
+ }
295
+ ),
296
+ T && /* @__PURE__ */ jsx(
297
+ Tt,
298
+ {
299
+ loading: j,
300
+ autoPlay: v2,
301
+ playMuted: S2,
302
+ playing: W2,
303
+ played: z,
304
+ unmute: L,
305
+ mute: I2,
306
+ isMuted: A$12,
307
+ hasNotPausedVideo: V,
308
+ hasInteractedWithAudio: q
309
+ }
310
+ ),
311
+ j && /* @__PURE__ */ jsx(B, { children: /* @__PURE__ */ jsx(d$1, {}) })
312
+ ]
313
+ }
314
+ );
315
+ }
316
+ );
82
317
  export {
83
- F as G,
84
- j as L,
85
- B as O,
86
- G as d
318
+ Et as E,
319
+ wt as w,
320
+ y$1 as y
87
321
  };