@streamlayer/react 1.24.8-pre.84ab1b9 → 1.24.8-pre.a96f156

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.
@@ -1,420 +1,421 @@
1
- import { jsx as c, jsxs as N } from "react/jsx-runtime";
2
- import { h as Q } from "./index7.js";
3
- import { useEffect as w, useState as j, useRef as _, useMemo as J, useCallback as H, Component as X } from "react";
4
- import { s as G, u as V, c as K } from "./feature.js";
5
- import { e as D } from "./index3.js";
6
- import { d as Y } from "./index15.js";
7
- import { w as Z, q as $ } from "./hooks-DHRXtbBc.js";
8
- const ee = /* @__PURE__ */ G("div")({
1
+ import { jsx as m, jsxs as F } from "react/jsx-runtime";
2
+ import { h as z } from "./index7.js";
3
+ import { useEffect as I, useState as B, useRef as T, useMemo as J, useCallback as O, Component as Z } from "react";
4
+ import { s as _, u as N, c as V } from "./feature.js";
5
+ import { e as L } from "./index3.js";
6
+ import { d as Q } from "./index15.js";
7
+ import { w as X, q as Y } from "./hooks-DHRXtbBc.js";
8
+ const $ = /* @__PURE__ */ _("div")({
9
9
  name: "PauseAdOverlay",
10
10
  class: "pw9gih8",
11
11
  propsAsIs: !1
12
- }), te = /* @__PURE__ */ G("div")({
12
+ }), ee = /* @__PURE__ */ _("div")({
13
13
  name: "PauseAdContent",
14
14
  class: "p8lpomy",
15
15
  propsAsIs: !1
16
- }), re = /* @__PURE__ */ G("div")({
16
+ }), te = /* @__PURE__ */ _("div")({
17
17
  name: "PauseAdBottomLeft",
18
18
  class: "pv7u167",
19
19
  propsAsIs: !1
20
- }), ae = /* @__PURE__ */ G("button")({
20
+ }), re = /* @__PURE__ */ _("button")({
21
21
  name: "PauseAdPlayButton",
22
22
  class: "p1kh2yb0",
23
23
  propsAsIs: !1
24
- }), se = /* @__PURE__ */ G("div")({
24
+ }), ae = /* @__PURE__ */ _("div")({
25
25
  name: "PauseAdSidebarGradient",
26
26
  class: "pl8f94x",
27
27
  propsAsIs: !1
28
- }), ne = /* @__PURE__ */ G("div")({
28
+ }), se = /* @__PURE__ */ _("div")({
29
29
  name: "PauseAdSidebar",
30
30
  class: "p1m6zmrt",
31
31
  propsAsIs: !1
32
- }), z = /* @__PURE__ */ G("img")({
32
+ }), K = /* @__PURE__ */ _("img")({
33
33
  name: "ExternalAdContainer",
34
34
  class: "em3vwfa",
35
35
  propsAsIs: !1
36
- }), de = /* @__PURE__ */ G("iframe")({
36
+ }), ne = /* @__PURE__ */ _("iframe")({
37
37
  name: "GptAdIframe",
38
38
  class: "g1tibuhw",
39
39
  propsAsIs: !1
40
- }), oe = ({
40
+ }), de = ({
41
41
  vastUrl: s,
42
- isDesktop: p,
43
- content: t
44
- }) => (w(() => {
45
- t.imageSrc && t.id && D.emit("exposedPauseAd", {
42
+ isDesktop: h,
43
+ content: r
44
+ }) => (I(() => {
45
+ r.imageSrc && r.id && L.emit("exposedPauseAd", {
46
46
  action: "rendered",
47
47
  payload: {
48
- id: t.id,
49
- parentId: t.parentId
48
+ id: r.id,
49
+ parentId: r.parentId
50
50
  }
51
51
  });
52
- }, [t, s]), t?.imageSrc ? !t.adUrl || !p ? /* @__PURE__ */ c(z, { src: t.imageSrc }) : /* @__PURE__ */ c(
52
+ }, [r, s]), r?.imageSrc ? !r.adUrl || !h ? /* @__PURE__ */ m(K, { src: r.imageSrc }) : /* @__PURE__ */ m(
53
53
  "a",
54
54
  {
55
55
  onClick: () => {
56
- D.emit("exposedPauseAd", {
56
+ L.emit("exposedPauseAd", {
57
57
  action: "navigated",
58
58
  payload: {
59
- id: t.id,
60
- parentId: t.parentId
59
+ id: r.id,
60
+ parentId: r.parentId
61
61
  }
62
62
  });
63
63
  },
64
- href: t.adUrl,
64
+ href: r.adUrl,
65
65
  target: "_blank",
66
66
  rel: "noopener noreferrer",
67
- children: /* @__PURE__ */ c(z, { src: t.imageSrc })
67
+ children: /* @__PURE__ */ m(K, { src: r.imageSrc })
68
68
  }
69
- ) : null), ie = ({
69
+ ) : null), oe = ({
70
70
  vastUrl: s,
71
- sdk: p,
72
- onLoaded: t,
73
- onReady: u,
74
- product: v,
75
- platform: m,
76
- platformtype: y,
77
- pagetype: x,
78
- content: A,
79
- adWidth: n,
80
- adHeight: S,
81
- rdid: i,
82
- idtype: R,
83
- npa: W,
84
- isLat: C,
85
- targeting: b,
86
- containerRef: M
71
+ sdk: h,
72
+ onLoaded: r,
73
+ product: o,
74
+ platform: P,
75
+ platformtype: f,
76
+ pagetype: y,
77
+ content: w,
78
+ adWidth: k,
79
+ adHeight: d,
80
+ rdid: b,
81
+ idtype: i,
82
+ npa: C,
83
+ isLat: G,
84
+ targeting: U,
85
+ containerRef: D
87
86
  }) => {
88
- const { production: d } = V(p.options), T = V(p.deviceId), [l, h] = j(!1), [r, L] = j({ width: 0, height: 0 }), [f, U] = j({ width: 0, height: 0 }), g = _(null), P = J(() => {
87
+ const { production: E } = N(h.options), l = N(h.deviceId), [W, n] = B(!1), [g, a] = B({ width: 0, height: 0 }), [c, R] = B({ width: 0, height: 0 }), S = T(null), u = J(() => {
89
88
  const e = new URLSearchParams();
90
- return v && e.set("product", v), m && e.set("platform", m), y && e.set("platformtype", y), x && e.set("pagetype", x), A && e.set("content", A), n && e.set("width", n.toString()), S && e.set("height", S.toString()), W != null && e.set("npa", W.toString()), C != null && e.set("is_lat", C.toString()), b && e.set("targeting", new URLSearchParams(b).toString()), T && (e.set("rdid", T), e.set("idtype", "uuid")), i && e.set("rdid", i), R && e.set("idtype", R), s.startsWith("http") ? e.set("url", s) : e.set("slot", s), `https://${d ? "bell-ad.streamlayer.io" : "bell-ad-test.streamlayer.io"}?${e.toString()}`;
89
+ return o && e.set("product", o), P && e.set("platform", P), f && e.set("platformtype", f), y && e.set("pagetype", y), w && e.set("content", w), k && e.set("width", k.toString()), d && e.set("height", d.toString()), C != null && e.set("npa", C.toString()), G != null && e.set("is_lat", G.toString()), U && e.set("targeting", new URLSearchParams(U).toString()), l && (e.set("rdid", l), e.set("idtype", "uuid")), b && e.set("rdid", b), i && e.set("idtype", i), s.startsWith("http") ? e.set("url", s) : e.set("slot", s), `https://${E ? "bell-ad.streamlayer.io" : "bell-ad-test.streamlayer.io"}?${e.toString()}`;
91
90
  }, [
92
91
  s,
93
- v,
94
- m,
92
+ o,
93
+ P,
94
+ f,
95
95
  y,
96
- x,
97
- A,
98
- n,
99
- S,
100
- W,
96
+ w,
97
+ k,
98
+ d,
101
99
  C,
102
- i,
103
- R,
100
+ G,
104
101
  b,
105
- T,
106
- d
102
+ i,
103
+ U,
104
+ l,
105
+ E
107
106
  ]);
108
- w(() => {
109
- const e = M.current;
107
+ I(() => {
108
+ u && (L.emit("exposedPauseAd", {
109
+ action: "load",
110
+ payload: {}
111
+ }), n(!1));
112
+ }, [u]), I(() => {
113
+ const e = D.current;
110
114
  if (!e) return;
111
- const a = new ResizeObserver(([k]) => {
112
- const { width: I, height: O } = k.contentRect;
113
- L({ width: Math.round(I), height: Math.round(O) });
115
+ const t = new ResizeObserver(([x]) => {
116
+ const { width: A, height: j } = x.contentRect;
117
+ a({ width: Math.round(A), height: Math.round(j) });
114
118
  });
115
- return a.observe(e), () => a.disconnect();
116
- }, [M]), w(() => {
117
- const e = (a) => {
118
- const k = d ? "https://bell-ad.streamlayer.io" : "https://bell-ad-test.streamlayer.io";
119
- a.origin === k && a.data.id === "slGptAdCb" && (g.current && a.source !== g.current.contentWindow || (a.data?.type === "slGptAdLoaded" && (h(!0), t?.({
120
- id: a.data.creativeId,
121
- parentId: a.data.advertiserId,
122
- width: a.data.width,
123
- height: a.data.height
124
- }), U({ width: a.data.width, height: a.data.height })), a.data?.type === "slGptAdReady" && u?.({
125
- id: a.data.creativeId,
126
- parentId: a.data.advertiserId
119
+ return t.observe(e), () => t.disconnect();
120
+ }, [D]), I(() => {
121
+ const e = (t) => {
122
+ const x = E ? "https://bell-ad.streamlayer.io" : "https://bell-ad-test.streamlayer.io";
123
+ t.origin === x && t.data.id === "slGptAdCb" && (S.current && t.source !== S.current.contentWindow || (t.data?.type === "slGptAdLoaded" && (n(!0), r?.({
124
+ id: t.data.creativeId,
125
+ parentId: t.data.advertiserId,
126
+ width: t.data.width,
127
+ height: t.data.height
128
+ }), R({ width: t.data.width, height: t.data.height }), L.emit("exposedPauseAd", {
129
+ action: "rendered",
130
+ payload: {
131
+ id: t.data.creativeId,
132
+ parentId: t.data.advertiserId
133
+ }
134
+ })), t.data?.type === "slGptAdReady" && L.emit("exposedPauseAd", {
135
+ action: "loaded",
136
+ payload: {
137
+ id: t.data.creativeId,
138
+ parentId: t.data.advertiserId
139
+ }
127
140
  })));
128
141
  };
129
- return window.addEventListener("message", e), () => window.removeEventListener("message", e);
130
- }, [t, u, d]);
131
- const E = f.width > 0 && f.height > 0 ? Math.min(r.width / f.width, r.height / f.height) : 1;
132
- return /* @__PURE__ */ c("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ c(
133
- de,
142
+ return S.current?.setAttribute("allowtransparency", "true"), window.addEventListener("message", e), () => window.removeEventListener("message", e);
143
+ }, [r, E]);
144
+ const p = c.width > 0 && c.height > 0 ? Math.min(g.width / c.width, g.height / c.height) : 1;
145
+ return /* @__PURE__ */ m("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ m(
146
+ ne,
134
147
  {
135
- ref: g,
136
- src: P,
148
+ ref: S,
149
+ src: u,
137
150
  scrolling: "no",
138
151
  allow: "attribution-reporting",
139
- allowTransparency: !0,
140
152
  style: {
141
- opacity: l ? 1 : 0,
142
- width: f.width,
143
- height: f.height,
153
+ opacity: W ? 1 : 0,
154
+ width: c.width,
155
+ height: c.height,
144
156
  transformOrigin: "0 0",
145
- transform: `scale(${E})`
157
+ transform: `scale(${p})`
146
158
  }
147
159
  }
148
160
  ) });
149
- }, le = ({
161
+ }, ie = ({
150
162
  sdk: s,
151
- isClosing: p,
152
- adContent: t,
153
- externalPauseAdStore: u,
154
- onPlay: v,
155
- onClose: m,
163
+ isClosing: h,
164
+ adContent: r,
165
+ externalPauseAdStore: o,
166
+ onPlay: P,
167
+ onClose: f,
156
168
  onGptAdLoaded: y,
157
- onGptAdReady: x,
158
- vastUrl: A,
159
- product: n,
160
- platform: S,
161
- platformtype: i,
162
- pagetype: R,
163
- content: W,
164
- adWidth: C,
165
- adHeight: b,
166
- npa: M,
167
- isLat: d,
168
- targeting: T,
169
- options: l,
170
- isDesktop: h,
171
- isGptAd: r,
172
- rdid: L,
173
- idtype: f,
174
- gptAdLoaded: U
169
+ vastUrl: w,
170
+ product: k,
171
+ platform: d,
172
+ platformtype: b,
173
+ pagetype: i,
174
+ content: C,
175
+ adWidth: G,
176
+ adHeight: U,
177
+ npa: D,
178
+ isLat: E,
179
+ targeting: l,
180
+ options: W,
181
+ isDesktop: n,
182
+ isGptAd: g,
183
+ rdid: a,
184
+ idtype: c,
185
+ gptAdLoaded: R
175
186
  }) => {
176
- const g = l?.showPauseButton ?? !0, P = _(null), { ref: E, focusSelf: e } = Y.useFocusable({
187
+ const S = W?.showPauseButton ?? !0, u = T(null), { ref: p, focusSelf: e } = Q.useFocusable({
177
188
  focusKey: "sl-pause-ad-play",
178
- onEnterRelease: v,
189
+ onEnterRelease: P,
179
190
  isFocusBoundary: !0,
180
191
  forceFocus: !0
181
192
  });
182
- return w(() => () => {
183
- u.revalidate();
184
- }, [u]), w(() => {
185
- E.current && e();
186
- }, [E, e]), w(() => {
187
- if (!m)
193
+ return I(() => () => {
194
+ o.revalidate();
195
+ }, [o]), I(() => {
196
+ p.current && e();
197
+ }, [p, e]), I(() => {
198
+ if (!f)
188
199
  return () => {
189
200
  };
190
- const a = (k) => {
191
- const I = k.keyCode;
192
- if (I === 461 || I === 10009 || I === 27 || I === 8) {
193
- k.preventDefault(), k.stopPropagation(), k.stopImmediatePropagation(), m();
201
+ const t = (x) => {
202
+ const A = x.keyCode;
203
+ if (A === 461 || A === 10009 || A === 27 || A === 8) {
204
+ x.preventDefault(), x.stopPropagation(), x.stopImmediatePropagation(), f();
194
205
  return;
195
206
  }
196
207
  };
197
- return window.addEventListener("keydown", a, { capture: !0 }), () => window.removeEventListener("keydown", a, { capture: !0 });
198
- }, [m]), /* @__PURE__ */ c(
199
- ee,
208
+ return window.addEventListener("keydown", t, { capture: !0 }), () => window.removeEventListener("keydown", t, { capture: !0 });
209
+ }, [f]), /* @__PURE__ */ m(
210
+ $,
200
211
  {
201
- className: K("SL_PauseAd", p && "pause-ad-closing", r && !U && "pause-ad-preloading"),
202
- children: /* @__PURE__ */ N(te, { children: [
203
- g && /* @__PURE__ */ c(re, { children: /* @__PURE__ */ c(
204
- ae,
212
+ className: V("SL_PauseAd", h && "pause-ad-closing", g && !R && "pause-ad-preloading"),
213
+ children: /* @__PURE__ */ F(ee, { children: [
214
+ S && /* @__PURE__ */ m(te, { children: /* @__PURE__ */ m(
215
+ re,
205
216
  {
206
- ref: E,
207
- onClick: v,
208
- onMouseEnter: () => E.current.focus(),
217
+ ref: p,
218
+ onClick: P,
219
+ onMouseEnter: () => p.current.focus(),
209
220
  "aria-label": "Resume playback"
210
221
  }
211
222
  ) }),
212
- /* @__PURE__ */ c(se, { className: K("SL_PauseAdSidebar", h && "SL_PauseAdSidebar--desktop"), children: /* @__PURE__ */ N(ne, { ref: P, className: K(h && "SL_PauseAdSidebar__content--desktop"), children: [
213
- r && A && /* @__PURE__ */ c(
214
- ie,
223
+ /* @__PURE__ */ m(ae, { className: V("SL_PauseAdSidebar", n && "SL_PauseAdSidebar--desktop"), children: /* @__PURE__ */ F(se, { ref: u, className: V(n && "SL_PauseAdSidebar__content--desktop"), children: [
224
+ g && w && /* @__PURE__ */ m(
225
+ oe,
215
226
  {
216
- vastUrl: A,
217
- isDesktop: h,
218
- product: n,
219
- platform: S,
220
- platformtype: i,
221
- pagetype: R,
222
- content: W,
223
- adWidth: C,
224
- adHeight: b,
225
- npa: M,
226
- isLat: d,
227
- rdid: L,
228
- idtype: f,
229
- targeting: T,
230
- containerRef: P,
227
+ vastUrl: w,
228
+ isDesktop: n,
229
+ product: k,
230
+ platform: d,
231
+ platformtype: b,
232
+ pagetype: i,
233
+ content: C,
234
+ adWidth: G,
235
+ adHeight: U,
236
+ npa: D,
237
+ isLat: E,
238
+ rdid: a,
239
+ idtype: c,
240
+ targeting: l,
241
+ containerRef: u,
231
242
  onLoaded: y,
232
- onReady: x,
233
243
  sdk: s
234
244
  }
235
245
  ),
236
- !r && A && t && /* @__PURE__ */ c(oe, { content: t, isDesktop: h, vastUrl: A })
246
+ !g && w && r && /* @__PURE__ */ m(de, { content: r, isDesktop: n, vastUrl: w })
237
247
  ] }) })
238
248
  ] })
239
249
  }
240
250
  );
241
- }, ce = (s) => {
251
+ }, le = (s) => {
242
252
  if (!s) return !1;
243
253
  try {
244
254
  return s.startsWith("http") ? new URL(s).searchParams.get("output") === "ldjh" : !0;
245
255
  } catch {
246
256
  return !1;
247
257
  }
248
- }, pe = ({ showPauseAd: s, externalUrls: p, vastUrls: t, sdk: u, onClose: v, onRender: m, options: y, isDesktop: x }) => {
249
- const A = p ?? t, n = y?.pauseAdDelay ?? 0, S = y?.pauseAdRefetchInterval ?? 1e3 * 60 * 50, [i, R] = j(!1), [W, C] = j(!1), [b, M] = j(!1), d = _(), T = _(), l = A?.[0], h = l?.url, r = ce(h), L = _(h), f = _(""), U = _(""), g = _(null);
250
- L.current = h;
251
- const [P, E] = u.advertisement.getExternalPauseAd(r ? "" : h, {
252
- refetchInterval: S,
253
- $enabled: !r && (n === 0 || !!s),
254
- prefetch: !r && n === 0 && S > 0
255
- }), e = V(P), a = H((o) => {
256
- g.current = { id: o.id, parentId: o.parentId }, M(!0);
257
- }, []), k = H((o) => {
258
- D.emit("exposedPauseAd", {
259
- action: "rendered",
260
- payload: {
261
- id: o.id,
262
- parentId: o.parentId
263
- }
264
- });
265
- }, []), I = H(() => {
266
- if (v) {
267
- if (U.current = L.current, r)
268
- D.emit("exposedPauseAd", {
258
+ }, ce = ({ showPauseAd: s, externalUrls: h, vastUrls: r, sdk: o, onClose: P, onRender: f, options: y, isDesktop: w }) => {
259
+ const k = h ?? r, d = y?.pauseAdDelay ?? 0, b = y?.pauseAdRefetchInterval ?? 1e3 * 60 * 50, [i, C] = B(!1), [G, U] = B(!1), [D, E] = B(!1), l = T(), W = T(), n = k?.[0], g = n?.url, a = le(g), c = T(g), R = T(""), S = T(""), u = T(null);
260
+ c.current = g;
261
+ const [p, e] = o.advertisement.getExternalPauseAd(a ? "" : g, {
262
+ refetchInterval: b,
263
+ $enabled: !a && (d === 0 || !!s),
264
+ prefetch: !a && d === 0 && b > 0
265
+ }), t = N(p), x = O((v) => {
266
+ u.current = { id: v.id, parentId: v.parentId }, E(!0);
267
+ }, []), A = O(() => {
268
+ if (P) {
269
+ if (S.current = c.current, a)
270
+ L.emit("exposedPauseAd", {
269
271
  action: "closed",
270
- payload: g.current ? {
271
- id: g.current.id,
272
- parentId: g.current.parentId
272
+ payload: u.current ? {
273
+ id: u.current.id,
274
+ parentId: u.current.parentId
273
275
  } : {}
274
276
  });
275
277
  else {
276
- const o = P.get().data;
277
- D.emit("exposedPauseAd", {
278
+ const v = p.get().data;
279
+ L.emit("exposedPauseAd", {
278
280
  action: "closed",
279
- payload: o?.url === U.current ? {
280
- id: o?.id,
281
- parentId: o?.parentId
281
+ payload: v?.url === S.current ? {
282
+ id: v?.id,
283
+ parentId: v?.parentId
282
284
  } : {}
283
285
  });
284
286
  }
285
- v();
287
+ P();
286
288
  }
287
- }, [v, P, r]), O = H(() => {
288
- u.controlVideoPlayer({ play: !0 });
289
- }, [u]);
290
- w(() => {
291
- !r && E === L.current && e.error && (clearTimeout(d.current), I?.());
292
- }, [e, r, I, E]), w(() => {
293
- if (s && h) {
294
- if (f.current = L.current, U.current = "", r)
295
- g.current = null, M(!1), D.emit("exposedPauseAd", {
289
+ }, [P, p, a]), j = O(() => {
290
+ o.controlVideoPlayer({ play: !0 });
291
+ }, [o]);
292
+ I(() => {
293
+ !a && e === c.current && t.error && (clearTimeout(l.current), A?.());
294
+ }, [t, a, A, e]), I(() => {
295
+ if (s && g) {
296
+ if (R.current = c.current, S.current = "", a)
297
+ u.current = null, E(!1), L.emit("exposedPauseAd", {
296
298
  action: "enabled",
297
299
  payload: {}
298
300
  });
299
301
  else {
300
- const B = P.get().data;
301
- D.emit("exposedPauseAd", {
302
+ const M = p.get().data;
303
+ L.emit("exposedPauseAd", {
302
304
  action: "enabled",
303
- payload: B?.url === f.current ? {
304
- id: B?.id,
305
- parentId: B?.parentId
305
+ payload: M?.url === R.current ? {
306
+ id: M?.id,
307
+ parentId: M?.parentId
306
308
  } : {}
307
309
  });
308
310
  }
309
- const o = () => {
310
- if (r) {
311
- clearTimeout(d.current), C(!1), R(!0);
311
+ const v = () => {
312
+ if (a) {
313
+ clearTimeout(l.current), U(!1), C(!0);
312
314
  return;
313
315
  }
314
- const B = P.get(), F = B.data;
315
- (!F || F?.url === L.current) && (!B.loading && F?.imageSrc ? (clearTimeout(d.current), C(!1), R(!0)) : B.loading && (d.current = setTimeout(() => {
316
- o();
316
+ const M = p.get(), H = M.data;
317
+ (!H || H?.url === c.current) && (!M.loading && H?.imageSrc ? (clearTimeout(l.current), U(!1), C(!0)) : M.loading && (l.current = setTimeout(() => {
318
+ v();
317
319
  }, 200)));
318
320
  };
319
- clearTimeout(d.current), d.current = setTimeout(() => {
320
- o();
321
- }, n);
321
+ clearTimeout(l.current), l.current = setTimeout(() => {
322
+ v();
323
+ }, d);
322
324
  } else {
323
- if (U.current !== L.current && (U.current = "", f.current !== "")) {
324
- if (r)
325
- D.emit("exposedPauseAd", {
325
+ if (S.current !== c.current && (S.current = "", R.current !== "")) {
326
+ if (a)
327
+ L.emit("exposedPauseAd", {
326
328
  action: "disabled",
327
- payload: g.current ? {
328
- id: g.current.id,
329
- parentId: g.current.parentId
329
+ payload: u.current ? {
330
+ id: u.current.id,
331
+ parentId: u.current.parentId
330
332
  } : {}
331
333
  });
332
334
  else {
333
- const o = P.get().data;
334
- D.emit("exposedPauseAd", {
335
+ const v = p.get().data;
336
+ L.emit("exposedPauseAd", {
335
337
  action: "disabled",
336
- payload: f.current === o?.url ? {
337
- id: o?.id,
338
- parentId: o?.parentId
338
+ payload: R.current === v?.url ? {
339
+ id: v?.id,
340
+ parentId: v?.parentId
339
341
  } : {}
340
342
  });
341
343
  }
342
- f.current = "";
344
+ R.current = "";
343
345
  }
344
- C(!0), d.current = setTimeout(() => {
345
- R(!1);
346
+ U(!0), l.current = setTimeout(() => {
347
+ C(!1);
346
348
  }, 400);
347
349
  }
348
350
  return () => {
349
- d.current && clearTimeout(d.current);
351
+ l.current && clearTimeout(l.current);
350
352
  };
351
- }, [P, r, I, n, s, h]), w(() => (i && r && !b ? T.current = setTimeout(() => {
352
- I?.();
353
- }, 1e4) : clearTimeout(T.current), () => clearTimeout(T.current)), [i, r, b, I]);
354
- const q = i && (!r || b);
355
- return w(() => {
356
- m?.({ rendered: q });
357
- }, [q, m]), w(() => () => {
358
- m?.({ rendered: !1 });
359
- }, [m]), !i || !r && !e.data ? null : /* @__PURE__ */ c(
360
- le,
353
+ }, [p, a, A, d, s, g]), I(() => (i && a && !D ? W.current = setTimeout(() => {
354
+ A?.();
355
+ }, 1e4) : clearTimeout(W.current), () => clearTimeout(W.current)), [i, a, D, A]);
356
+ const q = i && (!a || D);
357
+ return I(() => {
358
+ f?.({ rendered: q });
359
+ }, [q, f]), I(() => () => {
360
+ f?.({ rendered: !1 });
361
+ }, [f]), !i || !a && !t.data ? null : /* @__PURE__ */ m(
362
+ ie,
361
363
  {
362
- onClose: I,
363
- isClosing: W,
364
- onPlay: O,
365
- vastUrl: h,
366
- product: l?.product,
367
- platform: l?.platform,
368
- platformtype: l?.platformtype,
369
- pagetype: l?.pagetype,
370
- content: l?.content,
371
- adWidth: l?.adWidth,
372
- adHeight: l?.adHeight,
373
- npa: l?.npa,
374
- isLat: l?.is_lat,
375
- targeting: l?.targeting,
364
+ onClose: A,
365
+ isClosing: G,
366
+ onPlay: j,
367
+ vastUrl: g,
368
+ product: n?.product,
369
+ platform: n?.platform,
370
+ platformtype: n?.platformtype,
371
+ pagetype: n?.pagetype,
372
+ content: n?.content,
373
+ adWidth: n?.adWidth,
374
+ adHeight: n?.adHeight,
375
+ npa: n?.npa,
376
+ isLat: n?.is_lat,
377
+ targeting: n?.targeting,
376
378
  options: y,
377
- isDesktop: x,
378
- isGptAd: r,
379
- gptAdLoaded: b,
380
- onGptAdLoaded: a,
381
- onGptAdReady: k,
382
- externalPauseAdStore: P,
383
- adContent: e.data,
384
- sdk: u
379
+ isDesktop: w,
380
+ isGptAd: a,
381
+ gptAdLoaded: D,
382
+ onGptAdLoaded: x,
383
+ externalPauseAdStore: p,
384
+ adContent: t.data,
385
+ sdk: o
385
386
  }
386
387
  );
387
388
  }, ue = ({
388
389
  showPauseAd: s,
389
- pauseAdExternalUrls: p,
390
- pauseAdVastUrl: t,
391
- videoPlayerController: u,
392
- onRenderPauseAd: v,
393
- onClosePauseAd: m,
390
+ pauseAdExternalUrls: h,
391
+ pauseAdVastUrl: r,
392
+ videoPlayerController: o,
393
+ onRenderPauseAd: P,
394
+ onClosePauseAd: f,
394
395
  children: y,
395
- options: x
396
+ options: w
396
397
  }) => {
397
- const A = p ?? t, n = Z(), S = $(), i = _();
398
- return w(() => n ? (u && (i.current = u, n.addVideoPlayerController(i.current)), () => {
399
- i.current && n.removeVideoPlayerController(i.current);
398
+ const k = h ?? r, d = X(), b = Y(), i = T();
399
+ return I(() => d ? (o && (i.current = o, d.addVideoPlayerController(i.current)), () => {
400
+ i.current && d.removeVideoPlayerController(i.current);
400
401
  }) : () => {
401
- }, [n, u]), n ? /* @__PURE__ */ c("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ N(
402
- Q,
402
+ }, [d, o]), d ? /* @__PURE__ */ m("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ F(
403
+ z,
403
404
  {
404
405
  style: y ? { position: "relative" } : {},
405
- customTheme: S.theme,
406
- themeMode: S.themeMode,
406
+ customTheme: b.theme,
407
+ themeMode: b.themeMode,
407
408
  children: [
408
409
  y,
409
- A && /* @__PURE__ */ c(
410
- pe,
410
+ k && /* @__PURE__ */ m(
411
+ ce,
411
412
  {
412
- sdk: n,
413
+ sdk: d,
413
414
  showPauseAd: s,
414
- externalUrls: A,
415
- onClose: m,
416
- onRender: v,
417
- options: x,
415
+ externalUrls: k,
416
+ onClose: f,
417
+ onRender: P,
418
+ options: w,
418
419
  isDesktop: !0
419
420
  }
420
421
  )
@@ -422,20 +423,20 @@ const ee = /* @__PURE__ */ G("div")({
422
423
  }
423
424
  ) }) : y;
424
425
  };
425
- class Ie extends X {
426
- constructor(p) {
427
- super(p), this.state = { hasError: !1 };
426
+ class ve extends Z {
427
+ constructor(h) {
428
+ super(h), this.state = { hasError: !1 };
428
429
  }
429
430
  static getDerivedStateFromError() {
430
431
  return { hasError: !0 };
431
432
  }
432
- componentDidCatch(p, t) {
433
- console.error(p, t.componentStack);
433
+ componentDidCatch(h, r) {
434
+ console.error(h, r.componentStack);
434
435
  }
435
436
  render() {
436
- return this.state.hasError ? this.props.children : /* @__PURE__ */ c(ue, { ...this.props });
437
+ return this.state.hasError ? this.props.children : /* @__PURE__ */ m(ue, { ...this.props });
437
438
  }
438
439
  }
439
440
  export {
440
- Ie as StreamLayerPauseAd
441
+ ve as StreamLayerPauseAd
441
442
  };