@streamlayer/react 1.3.0 → 1.3.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.
@@ -1,335 +1,430 @@
1
- import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
- import { useEffect as F, useRef as z, useMemo as W } from "react";
3
- import { a as A, s as n, c as H, Q as K, e as g, u as I, L as Q } from "./provider.js";
4
- import { F as J, u as V, d as X } from "./index2.js";
5
- import { P as u, a as h, S as Y } from "./useStreamLayerApp2.js";
6
- const Z = /* @__PURE__ */ n("div")({
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { useEffect as Q, useRef as J, useMemo as V } from "react";
3
+ import { c as f, s as n, a as W, Q as X, e as $, u as N, L as Y } from "./provider.js";
4
+ import { F as Z, u as oo, d as eo } from "./index2.js";
5
+ import { N as I, a as no, b as so, P as h, c as b, S as io } from "./useStreamLayerApp2.js";
6
+ const ao = /* @__PURE__ */ n("div")({
7
7
  name: "Container",
8
8
  class: "c5b6wdg",
9
9
  propsAsIs: !1
10
- }), ee = "a1rlj479", oe = "s35f1di", ne = "sj4471g", se = "b12050d8", ae = "b1d5ybek", te = (e) => e === "left" || e === "right" ? oe : se, ie = (e) => e === "left" || e === "right" ? ne : ae, re = (e) => e === "left" ? "avdxyl3" : e === "right" ? "a1bisd08" : e === "top" ? "a1u9y2aj" : "a1qqaks", q = ({
11
- children: e,
10
+ }), to = "a1rlj479", ro = "s35f1di", lo = "sj4471g", co = "b12050d8", po = "b1d5ybek", mo = (o) => o === "left" || o === "right" ? ro : co, uo = (o) => o === "left" || o === "right" ? lo : po, vo = (o) => o === "left" ? "avdxyl3" : o === "right" ? "a1bisd08" : o === "top" ? "a1u9y2aj" : "a1qqaks", C = ({
11
+ children: o,
12
12
  style: s,
13
13
  className: r,
14
- enabled: a = !0,
15
- hiding: t,
16
- direction: i = "left",
17
- onAnimationEnd: l
18
- }) => /* @__PURE__ */ o(Z, {
14
+ enabled: i = !0,
15
+ hiding: a,
16
+ direction: l = "left",
17
+ onAnimationEnd: t
18
+ }) => /* @__PURE__ */ e(ao, {
19
19
  style: s,
20
- className: A(r, ee, re(i), a && !t && te(i), a && t && ie(i)),
21
- onAnimationEnd: l,
22
- children: e
23
- }), le = /* @__PURE__ */ n("a")({
20
+ className: f(r, to, vo(l), i && !a && mo(l), i && a && uo(l)),
21
+ onAnimationEnd: t,
22
+ children: o
23
+ }), ho = /* @__PURE__ */ n("a")({
24
24
  name: "Link",
25
25
  class: "l1sgte8c",
26
26
  propsAsIs: !1
27
- }), de = /* @__PURE__ */ n("div")({
27
+ }), Io = /* @__PURE__ */ n("div")({
28
28
  name: "BannerContainer",
29
29
  class: "b7yfc72",
30
30
  propsAsIs: !1
31
- }), ce = () => le, pe = /* @__PURE__ */ n(ce())({
31
+ }), go = () => ho, bo = /* @__PURE__ */ n(go())({
32
32
  name: "BannerLink",
33
33
  class: "bejjq94",
34
34
  propsAsIs: !0
35
- }), me = /* @__PURE__ */ n("img")({
35
+ }), Ao = /* @__PURE__ */ n("img")({
36
36
  name: "BannerImg",
37
37
  class: "b1j94hdr",
38
38
  propsAsIs: !1
39
- }), ue = ({ promotion: e, promotionId: s, hiding: r, direction: a = "bottom" }) => {
40
- var t;
41
- return (t = e.additionalBanner) != null && t.imageUrl ? /* @__PURE__ */ o(q, { direction: a, hiding: r, children: /* @__PURE__ */ o(de, { children: /* @__PURE__ */ o(
42
- pe,
39
+ }), yo = ({ promotion: o, promotionId: s, hiding: r, direction: i = "bottom" }) => {
40
+ var a;
41
+ return (a = o.additionalBanner) != null && a.imageUrl ? /* @__PURE__ */ e(C, { direction: i, hiding: r, children: /* @__PURE__ */ e(Io, { className: "BannerContainer", children: /* @__PURE__ */ e(
42
+ bo,
43
43
  {
44
- href: e.additionalBanner.url,
44
+ className: "BannerLink",
45
+ href: o.additionalBanner.url,
46
+ style: { backgroundImage: `url(${o.additionalBanner.imageUrl})` },
45
47
  "data-promo-id": s,
46
- "data-promo-type": e.type,
48
+ "data-promo-type": o.type,
47
49
  "data-analytics": "banner",
48
50
  target: "_blank",
49
- children: /* @__PURE__ */ o(me, { src: e.additionalBanner.imageUrl, alt: "promo" })
51
+ children: /* @__PURE__ */ e(Ao, { src: o.additionalBanner.imageUrl, alt: "promo" })
50
52
  }
51
53
  ) }) }) : null;
52
- }, ve = /* @__PURE__ */ n("div")({
54
+ }, fo = /* @__PURE__ */ n("div")({
55
+ name: "NotificationContent",
56
+ class: "n1ku6hz",
57
+ propsAsIs: !1
58
+ }), $o = /* @__PURE__ */ n("div")({
59
+ name: "NotificationContainer",
60
+ class: "nbxqmol",
61
+ propsAsIs: !1
62
+ }), No = /* @__PURE__ */ n("div")({
63
+ name: "Body",
64
+ class: "b1gu3eml",
65
+ propsAsIs: !1
66
+ }), Co = /* @__PURE__ */ n("div")({
67
+ name: "Title",
68
+ class: "t1u17zva",
69
+ propsAsIs: !1
70
+ }), So = /* @__PURE__ */ n("div")({
71
+ name: "Text",
72
+ class: "t10ko1g",
73
+ propsAsIs: !1
74
+ }), S = /* @__PURE__ */ n("div")({
75
+ name: "Media",
76
+ class: "mntc42e",
77
+ propsAsIs: !1
78
+ }), ko = () => S, G = /* @__PURE__ */ n(ko())({
79
+ name: "MediaImgFit",
80
+ class: "ml060eo",
81
+ propsAsIs: !0
82
+ }), Mo = () => S, k = /* @__PURE__ */ n(Mo())({
83
+ name: "MediaImgCentered",
84
+ class: "m1vqlvig",
85
+ propsAsIs: !0
86
+ }), To = () => k, Bo = /* @__PURE__ */ n(To())({
87
+ name: "MediaImgBottom",
88
+ class: "m1e7tvi5",
89
+ propsAsIs: !0
90
+ }), Eo = () => S, Lo = /* @__PURE__ */ n(Eo())({
91
+ name: "MediaImgSolid",
92
+ class: "mqvntt2",
93
+ propsAsIs: !0
94
+ }), xo = () => k, Oo = /* @__PURE__ */ n(xo())({
95
+ name: "MediaImgMiddle",
96
+ class: "m12jtj3u",
97
+ propsAsIs: !0
98
+ }), _o = /* @__PURE__ */ n("button")({
99
+ name: "Button",
100
+ class: "bkq1frv",
101
+ propsAsIs: !1
102
+ }), Po = () => W, jo = /* @__PURE__ */ n(Po())({
103
+ name: "StyledChevronRight",
104
+ class: "sis90pl",
105
+ propsAsIs: !0
106
+ }), Do = /* @__PURE__ */ n("div")({
107
+ name: "Logo",
108
+ class: "l9mjmz3",
109
+ propsAsIs: !1
110
+ }), Ro = {
111
+ [I.UNSET]: G,
112
+ [I.FIT]: G,
113
+ [I.CENTERED]: k,
114
+ [I.BOTTOM]: Bo,
115
+ [I.SOLID]: Lo,
116
+ [I.MIDDLE]: Oo
117
+ }, Fo = ({ notification: o, promotionId: s, hiding: r, direction: i = "left" }) => {
118
+ if (!o || !o.promotion || o.enabled !== no.NOTIFICATION_ENABLED)
119
+ return null;
120
+ const { title: a, body: l, image: t, promotion: m } = o, { sponsorLogo: u, sponsorLogoMode: v, imagePosition: p, ctaButton: d } = m, g = Ro[p];
121
+ return /* @__PURE__ */ e(C, { direction: i, hiding: r, children: /* @__PURE__ */ c($o, { children: [
122
+ v !== so.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ e(Do, { children: /* @__PURE__ */ e("img", { src: u, alt: a }) }),
123
+ /* @__PURE__ */ c(fo, { children: [
124
+ /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e("img", { src: t, alt: "" }) }),
125
+ /* @__PURE__ */ c(No, { children: [
126
+ a && /* @__PURE__ */ e(Co, { children: a }),
127
+ l && /* @__PURE__ */ e(So, { children: l })
128
+ ] }),
129
+ /* @__PURE__ */ e(_o, { name: "promo-button", style: { color: d == null ? void 0 : d.textColor, backgroundColor: d == null ? void 0 : d.color }, children: (d == null ? void 0 : d.label) || "Open" }),
130
+ /* @__PURE__ */ e(jo, { name: "chevronRight" })
131
+ ] })
132
+ ] }) });
133
+ }, qo = /* @__PURE__ */ n("div")({
53
134
  name: "OverlayContainer",
54
135
  class: "okzhq2w",
55
136
  propsAsIs: !1
56
- }), he = /* @__PURE__ */ n("div")({
137
+ }), Uo = /* @__PURE__ */ n("div")({
57
138
  name: "PromoOverlay",
58
139
  class: "pmgz5i",
59
140
  propsAsIs: !1
60
- }), ye = /* @__PURE__ */ n("div")({
141
+ }), wo = /* @__PURE__ */ n("div")({
61
142
  name: "Header",
62
143
  class: "hyxi3jt",
63
144
  propsAsIs: !1
64
- }), be = /* @__PURE__ */ n("div")({
145
+ }), Go = /* @__PURE__ */ n("div")({
65
146
  name: "HeaderContent",
66
147
  class: "h149e3gp",
67
148
  propsAsIs: !1
68
- }), Ae = "h10toh7", U = /* @__PURE__ */ n("img")({
149
+ }), zo = "h10toh7", z = /* @__PURE__ */ n("img")({
69
150
  name: "SponsorLogo",
70
151
  class: "s1jyea6t",
71
152
  propsAsIs: !1
72
- }), ge = /* @__PURE__ */ n("div")({
153
+ }), Ho = /* @__PURE__ */ n("div")({
73
154
  name: "SponsorName",
74
155
  class: "szpfa3h",
75
156
  propsAsIs: !1
76
- }), Ie = /* @__PURE__ */ n("div")({
157
+ }), Ko = /* @__PURE__ */ n("div")({
77
158
  name: "Media",
78
159
  class: "m1crmu01",
79
160
  propsAsIs: !1
80
- }), fe = /* @__PURE__ */ n("img")({
161
+ }), Wo = /* @__PURE__ */ n("img")({
81
162
  name: "PromoImg",
82
163
  class: "p1l37r8s",
83
164
  propsAsIs: !1
84
- }), $e = "s1nmch9k", D = /* @__PURE__ */ n("div")({
165
+ }), Qo = "s1nmch9k", H = /* @__PURE__ */ n("div")({
85
166
  name: "Content",
86
167
  class: "c1er0ljd",
87
168
  propsAsIs: !1
88
- }), ke = /* @__PURE__ */ n("div")({
169
+ }), Jo = /* @__PURE__ */ n("div")({
89
170
  name: "Description",
90
171
  class: "dydopmr",
91
172
  propsAsIs: !1
92
- }), Se = /* @__PURE__ */ n("div")({
173
+ }), Vo = /* @__PURE__ */ n("div")({
93
174
  name: "Sponsor",
94
175
  class: "s1w6nt04",
95
176
  propsAsIs: !1
96
- }), Ce = /* @__PURE__ */ n("div")({
177
+ }), Xo = /* @__PURE__ */ n("div")({
97
178
  name: "SponsorText",
98
179
  class: "s1evcmtq",
99
180
  propsAsIs: !1
100
- }), Me = /* @__PURE__ */ n("div")({
181
+ }), Yo = /* @__PURE__ */ n("div")({
101
182
  name: "ADLogo",
102
183
  class: "awodx0x",
103
184
  propsAsIs: !1
104
- }), Ne = /* @__PURE__ */ n("span")({
185
+ }), Zo = /* @__PURE__ */ n("span")({
105
186
  name: "SponsoredText",
106
187
  class: "s1q3n6oi",
107
188
  propsAsIs: !1
108
- }), Be = /* @__PURE__ */ n("div")({
189
+ }), oe = /* @__PURE__ */ n("div")({
109
190
  name: "CloseIconWrap",
110
191
  class: "c8d4xfk",
111
192
  propsAsIs: !1
112
- }), Ee = () => H, Te = /* @__PURE__ */ n(Ee())({
193
+ }), ee = () => W, ne = /* @__PURE__ */ n(ee())({
113
194
  name: "CloseIcon",
114
195
  class: "ct6oobh",
115
196
  propsAsIs: !0
116
- }), Le = /* @__PURE__ */ n("div")({
197
+ }), se = /* @__PURE__ */ n("div")({
117
198
  name: "ActionBtnWrap",
118
199
  class: "a1gyg7tt",
119
200
  propsAsIs: !1
120
- }), xe = /* @__PURE__ */ n("a")({
201
+ }), ie = /* @__PURE__ */ n("a")({
121
202
  name: "ActionButton",
122
203
  class: "a17rwbtk",
123
204
  propsAsIs: !1
124
- }), _e = /* @__PURE__ */ n("div")({
205
+ }), ae = /* @__PURE__ */ n("div")({
125
206
  name: "Title",
126
207
  class: "t3vxzaw",
127
208
  propsAsIs: !1
128
- }), je = "h10f3u0j", G = ({ promotion: e, promotionId: s, onClose: r }) => {
129
- var a, t, i, l, p, m, c, v, f, $, k, S, C, M, N, B, E, T, L, x, _, j, P, O, w, R;
130
- const y = e.type === u.INGAME_IAB11_LBAR || e.type === u.INGAME_IAB11, b = ((a = e.sponsor) == null ? void 0 : a.logo) && e.logoMode === h.CENTER;
131
- return /* @__PURE__ */ d(he, { className: "PromoOverlay", children: [
132
- /* @__PURE__ */ d(ye, { children: [
133
- /* @__PURE__ */ d(be, { className: A(!b && Ae), children: [
134
- ((t = e.sponsor) == null ? void 0 : t.logo) && e.logoMode === h.LEFT && /* @__PURE__ */ o(U, { src: (i = e.sponsor) == null ? void 0 : i.logo, alt: "promo" }),
135
- /* @__PURE__ */ d(
136
- Se,
209
+ }), te = "h10f3u0j", K = ({ promotion: o, promotionId: s, onClose: r }) => {
210
+ var i, a, l, t, m, u, v, p, d, g, M, T, B, E, L, x, O, _, P, j, D, R, F, q, U, w;
211
+ const A = o.type === h.INGAME_IAB11_LBAR || o.type === h.INGAME_IAB11, y = ((i = o.sponsor) == null ? void 0 : i.logo) && o.logoMode === b.CENTER;
212
+ return /* @__PURE__ */ c(Uo, { className: "PromoOverlay", children: [
213
+ /* @__PURE__ */ c(wo, { children: [
214
+ /* @__PURE__ */ c(Go, { className: f(!y && zo), children: [
215
+ ((a = o.sponsor) == null ? void 0 : a.logo) && o.logoMode === b.LEFT && /* @__PURE__ */ e(z, { src: (l = o.sponsor) == null ? void 0 : l.logo, alt: "promo" }),
216
+ /* @__PURE__ */ c(
217
+ Vo,
137
218
  {
138
219
  style: {
139
- paddingLeft: (l = e.sponsor) != null && l.logo && e.logoMode === h.LEFT ? "0px" : "8px"
220
+ paddingLeft: (t = o.sponsor) != null && t.logo && o.logoMode === b.LEFT ? "0px" : "8px"
140
221
  },
141
222
  children: [
142
- ((p = e.sponsor) == null ? void 0 : p.logo) && e.logoMode === h.LEFT && /* @__PURE__ */ o(ge, { children: (m = e.sponsor) == null ? void 0 : m.name }),
143
- /* @__PURE__ */ d(Ce, { children: [
144
- /* @__PURE__ */ o(Me, { children: "AD" }),
145
- /* @__PURE__ */ o(Ne, { children: "SPONSORED" })
223
+ ((m = o.sponsor) == null ? void 0 : m.logo) && o.logoMode === b.LEFT && /* @__PURE__ */ e(Ho, { children: (u = o.sponsor) == null ? void 0 : u.name }),
224
+ /* @__PURE__ */ c(Xo, { className: "SponsorText", children: [
225
+ /* @__PURE__ */ e(Yo, { children: "AD" }),
226
+ /* @__PURE__ */ e(Zo, { children: "SPONSORED" })
146
227
  ] })
147
228
  ]
148
229
  }
149
230
  )
150
231
  ] }),
151
- /* @__PURE__ */ o(Be, { onClick: r, children: /* @__PURE__ */ o(Te, { name: "icon-cross" }) })
232
+ /* @__PURE__ */ e(oe, { className: "ClosePromoIcon", onClick: r, children: /* @__PURE__ */ e(ne, { name: "icon-cross" }) })
152
233
  ] }),
153
- /* @__PURE__ */ d(Ie, { children: [
154
- b && /* @__PURE__ */ o(U, { className: $e, src: (c = e.sponsor) == null ? void 0 : c.logo, alt: "promo" }),
155
- /* @__PURE__ */ o(D, { children: (f = (v = e.banner) == null ? void 0 : v.video) != null && f.url ? /* @__PURE__ */ o(
156
- K,
234
+ /* @__PURE__ */ c(Ko, { children: [
235
+ y && /* @__PURE__ */ e(z, { className: Qo, src: (v = o.sponsor) == null ? void 0 : v.logo, alt: "promo" }),
236
+ /* @__PURE__ */ e(H, { children: (d = (p = o.banner) == null ? void 0 : p.video) != null && d.url ? /* @__PURE__ */ e(
237
+ X,
157
238
  {
158
- source: (k = ($ = e.banner) == null ? void 0 : $.video) == null ? void 0 : k.url,
159
- poster: (C = (S = e.banner) == null ? void 0 : S.video) == null ? void 0 : C.thumbnailUrl,
160
- aspectRatio: y ? "1/1" : "16/9",
239
+ source: (M = (g = o.banner) == null ? void 0 : g.video) == null ? void 0 : M.url,
240
+ poster: (B = (T = o.banner) == null ? void 0 : T.video) == null ? void 0 : B.thumbnailUrl,
241
+ aspectRatio: A ? "1/1" : "16/9",
161
242
  onPlay: () => {
162
- g.emit("advertisement", {
243
+ $.emit("advertisement", {
163
244
  action: "videoPlay",
164
245
  payload: {
165
246
  advertisementId: s,
166
- advertisementType: e.type
247
+ advertisementType: o.type
167
248
  }
168
249
  });
169
250
  }
170
251
  }
171
- ) : (M = e.banner) != null && M.imageUrl ? /* @__PURE__ */ o(fe, { style: y ? { aspectRatio: "1/1" } : {}, src: (N = e.banner) == null ? void 0 : N.imageUrl, alt: "promo" }) : null }),
172
- !y && /* @__PURE__ */ d(D, { children: [
173
- ((B = e.banner) == null ? void 0 : B.title) && /* @__PURE__ */ o(_e, { className: A(b && je), children: (E = e.banner) == null ? void 0 : E.title }),
174
- ((T = e.banner) == null ? void 0 : T.body) && /* @__PURE__ */ o(ke, { children: (L = e.banner) == null ? void 0 : L.body })
252
+ ) : (E = o.banner) != null && E.imageUrl ? /* @__PURE__ */ e(Wo, { style: A ? { aspectRatio: "1/1" } : {}, src: (L = o.banner) == null ? void 0 : L.imageUrl, alt: "promo" }) : null }),
253
+ !A && /* @__PURE__ */ c(H, { children: [
254
+ ((x = o.banner) == null ? void 0 : x.title) && /* @__PURE__ */ e(ae, { className: f("AdvTitle", y && te), children: (O = o.banner) == null ? void 0 : O.title }),
255
+ ((_ = o.banner) == null ? void 0 : _.body) && /* @__PURE__ */ e(Jo, { className: "AdvDescription", children: (P = o.banner) == null ? void 0 : P.body })
175
256
  ] })
176
257
  ] }),
177
- /* @__PURE__ */ o(Le, { children: /* @__PURE__ */ o(
178
- xe,
258
+ /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(
259
+ ie,
179
260
  {
180
- href: (x = e.banner) == null ? void 0 : x.url,
261
+ href: (j = o.banner) == null ? void 0 : j.url,
181
262
  style: {
182
- backgroundColor: ((j = (_ = e.banner) == null ? void 0 : _.ctaButton) == null ? void 0 : j.color) || "#009dc4",
183
- color: ((O = (P = e.banner) == null ? void 0 : P.ctaButton) == null ? void 0 : O.textColor) || "#fff"
263
+ backgroundColor: ((R = (D = o.banner) == null ? void 0 : D.ctaButton) == null ? void 0 : R.color) || "#009dc4",
264
+ color: ((q = (F = o.banner) == null ? void 0 : F.ctaButton) == null ? void 0 : q.textColor) || "#fff"
184
265
  },
185
266
  "data-analytics": "button",
186
267
  "data-promo-id": s,
187
- "data-promo-type": e.type,
268
+ "data-promo-type": o.type,
188
269
  target: "_blank",
189
- children: (R = (w = e.banner) == null ? void 0 : w.ctaButton) == null ? void 0 : R.label
270
+ children: (w = (U = o.banner) == null ? void 0 : U.ctaButton) == null ? void 0 : w.label
190
271
  }
191
272
  ) })
192
273
  ] });
193
- }, Pe = /* @__PURE__ */ n("div")({
274
+ }, re = /* @__PURE__ */ n("div")({
194
275
  name: "SidebarContainer",
195
276
  class: "s1abskp8",
196
277
  propsAsIs: !1
197
- }), Oe = ({
198
- children: e,
278
+ }), le = ({
279
+ children: o,
199
280
  direction: s,
200
281
  style: r,
201
- className: a,
202
- hiding: t
203
- }) => /* @__PURE__ */ o(q, {
282
+ className: i,
283
+ hiding: a
284
+ }) => /* @__PURE__ */ e(C, {
204
285
  direction: s,
205
286
  style: r,
206
- hiding: t,
207
- className: a,
208
- children: /* @__PURE__ */ o(Pe, {
209
- children: e
287
+ hiding: a,
288
+ className: i,
289
+ children: /* @__PURE__ */ e(re, {
290
+ children: o
210
291
  })
211
- }), we = (e) => (e == null ? void 0 : e.type) === u.INGAME_IAB11_LBAR || (e == null ? void 0 : e.type) === u.INGAME_IAB21_LBAR, Re = (e) => (e == null ? void 0 : e.type) === u.INGAME_IAB11 || (e == null ? void 0 : e.type) === u.INGAME_IAB21, Ue = ({ advertisement: e, skipTypeCheck: s, layoutMode: r = "side-by-side", sidebar: a, banner: t }) => {
212
- const i = I(e.data);
213
- return !i.data && i.loading ? null : i.error ? /* @__PURE__ */ d("div", { children: [
292
+ }), de = (o) => (o == null ? void 0 : o.type) === h.INGAME_IAB11_LBAR || (o == null ? void 0 : o.type) === h.INGAME_IAB21_LBAR, ce = (o) => (o == null ? void 0 : o.type) === h.INGAME_IAB11 || (o == null ? void 0 : o.type) === h.INGAME_IAB21, pe = ({ advertisement: o, skipTypeCheck: s, layoutMode: r = "side-by-side", sidebar: i, isNotification: a, banner: l }) => {
293
+ const t = N(o.data);
294
+ return !t.data && t.loading ? null : t.error ? /* @__PURE__ */ c("div", { children: [
214
295
  "error ",
215
- /* @__PURE__ */ o("button", { onClick: e.close, children: "close" })
216
- ] }) : i.data ? !a && !t && (s || Re(i.data)) ? /* @__PURE__ */ o(ve, { className: "PromoOverlayContainer", children: /* @__PURE__ */ o(G, { promotionId: e.id, promotion: i.data, onClose: e.close }) }) : a && (s || we(i.data)) ? /* @__PURE__ */ o(Oe, { className: "PromoSidebarContainer", direction: a, hiding: e.hiding, children: /* @__PURE__ */ o(G, { promotionId: e.id, promotion: i.data, onClose: e.close }) }) : t ? /* @__PURE__ */ o(ue, { promotionId: e.id, hiding: e.hiding, promotion: i.data, direction: t }) : null : /* @__PURE__ */ d("div", { children: [
296
+ /* @__PURE__ */ e("button", { onClick: o.close, children: "close" })
297
+ ] }) : t.data ? a ? /* @__PURE__ */ e(Fo, { notification: t.data.notification, promotionId: o.id }) : !i && !l && (s || ce(t.data.promotions)) ? /* @__PURE__ */ e(qo, { className: "PromoOverlayContainer", children: /* @__PURE__ */ e(K, { promotionId: o.id, promotion: t.data.promotions, onClose: o.close }) }) : i && (s || de(t.data.promotions)) ? /* @__PURE__ */ e(le, { className: "PromoSidebarContainer", direction: i, hiding: o.hiding, children: /* @__PURE__ */ e(K, { promotionId: o.id, promotion: t.data.promotions, onClose: o.close }) }) : l ? /* @__PURE__ */ e(
298
+ yo,
299
+ {
300
+ promotionId: o.id,
301
+ hiding: o.hiding,
302
+ promotion: t.data.promotions,
303
+ direction: l
304
+ }
305
+ ) : null : /* @__PURE__ */ c("div", { children: [
217
306
  "empty promo ",
218
- /* @__PURE__ */ o("button", { onClick: e.close, children: "close" })
307
+ /* @__PURE__ */ e("button", { onClick: o.close, children: "close" })
219
308
  ] });
220
- }, De = /* @__PURE__ */ n("div")({
309
+ }, me = /* @__PURE__ */ n("div")({
221
310
  name: "AdvertisementUIWrap",
222
311
  class: "aa6pjif",
223
312
  propsAsIs: !1
224
- }), Ge = (e) => {
225
- const s = e.target;
313
+ }), ue = (o) => {
314
+ const s = o.target;
226
315
  if (s instanceof HTMLAnchorElement && s.target === "_blank") {
227
- const r = s.getAttribute("data-promo-id") || "", a = s.getAttribute("data-promo-type") || u.UNSET;
228
- s.getAttribute("data-analytics") === "button" && g.emit("advertisement", {
316
+ const r = s.getAttribute("data-promo-id") || "", i = s.getAttribute("data-promo-type") || h.UNSET;
317
+ s.getAttribute("data-analytics") === "button" && $.emit("advertisement", {
229
318
  action: "buttonSelect",
230
319
  payload: {
231
320
  advertisementId: r,
232
- advertisementType: a
321
+ advertisementType: i
233
322
  }
234
- }), s.getAttribute("data-analytics") === "banner" && g.emit("advertisement", {
323
+ }), s.getAttribute("data-analytics") === "banner" && $.emit("advertisement", {
235
324
  action: "bannerSelect",
236
325
  payload: {
237
326
  advertisementId: r,
238
- advertisementType: a
327
+ advertisementType: i
239
328
  }
240
329
  });
241
330
  }
242
- }, qe = ({
243
- gamification: e,
331
+ }, ve = ({
332
+ gamification: o,
244
333
  layoutMode: s,
245
334
  skipTypeCheck: r,
246
- sidebar: a,
247
- banner: t,
248
- isMobileScreen: i,
249
- persistent: l
335
+ sidebar: i,
336
+ banner: a,
337
+ notification: l,
338
+ isMobileScreen: t,
339
+ persistent: m
250
340
  }) => {
251
- const p = z(null), m = I(e.advertisement.$list), c = W(
252
- () => e.advertisement.getActiveAdvertisement(l),
341
+ const u = J(null), v = N(o.advertisement.$list), p = V(
342
+ () => o.advertisement.getActiveAdvertisement(m),
253
343
  // fire getActiveNotification when notifications were updated
254
344
  // eslint-disable-next-line react-hooks/exhaustive-deps
255
- [m, l]
345
+ [v, m]
256
346
  );
257
- return Q(p, {
258
- enabled: !!c,
347
+ return Y(u, {
348
+ enabled: !!p,
259
349
  event: "click",
260
- listener: Ge
261
- }), c ? /* @__PURE__ */ o(De, {
262
- ref: p,
350
+ listener: ue
351
+ }), p ? /* @__PURE__ */ e(me, {
352
+ ref: u,
263
353
  style: {
264
- height: !t && !a ? "auto" : "100%"
354
+ height: !a && !i ? "auto" : "100%"
265
355
  },
266
- className: i ? "mobile-view" : "",
267
- children: /* @__PURE__ */ o(Ue, {
356
+ className: t ? "mobile-view" : "",
357
+ children: /* @__PURE__ */ e(pe, {
268
358
  skipTypeCheck: r,
269
- sidebar: a,
270
- banner: t,
271
- advertisement: c,
272
- layoutMode: s
359
+ sidebar: i,
360
+ banner: a,
361
+ advertisement: p,
362
+ layoutMode: s,
363
+ isNotification: l
273
364
  })
274
365
  }) : null;
275
- }, Fe = ({
276
- sdk: e,
366
+ }, he = ({
367
+ sdk: o,
277
368
  sidebar: s,
278
369
  banner: r,
279
- skipTypeCheck: a,
280
- event: t,
281
- layoutMode: i,
282
- isMobileScreen: l,
283
- persistent: p
370
+ skipTypeCheck: i,
371
+ event: a,
372
+ layoutMode: l,
373
+ isMobileScreen: t,
374
+ persistent: m,
375
+ notification: u
284
376
  }) => {
285
377
  const {
286
- deactivate: m
287
- } = J(e);
288
- F(() => {
289
- t ? e.createEventSession(t) : m();
290
- }, [t, m, e]);
291
- const c = I(e.featuresList.getStore());
378
+ deactivate: v
379
+ } = Z(o);
380
+ Q(() => {
381
+ a ? o.createEventSession(a) : v();
382
+ }, [a, v, o]);
383
+ const p = N(o.featuresList.getStore());
292
384
  if (s && r)
293
- return /* @__PURE__ */ o("div", {
385
+ return /* @__PURE__ */ e("div", {
294
386
  style: {
295
387
  color: "red"
296
388
  },
297
389
  children: "define either sidebar or banner, not both."
298
390
  });
299
- if (!c)
391
+ if (!p)
300
392
  return null;
301
- const v = e.getFeature(Y.GAMES);
302
- return v ? /* @__PURE__ */ o(qe, {
303
- gamification: v,
393
+ const d = o.getFeature(io.GAMES);
394
+ return d ? /* @__PURE__ */ e(ve, {
395
+ gamification: d,
304
396
  sidebar: s,
305
397
  banner: r,
306
- layoutMode: i,
307
- isMobileScreen: l,
308
- persistent: p,
309
- skipTypeCheck: a
398
+ layoutMode: l,
399
+ isMobileScreen: t,
400
+ persistent: m,
401
+ notification: u,
402
+ skipTypeCheck: i
310
403
  }) : null;
311
- }, Je = ({
312
- event: e,
404
+ }, fe = ({
405
+ event: o,
313
406
  sidebar: s,
314
407
  banner: r,
315
- isMobileScreen: a,
316
- persistent: t
408
+ isMobileScreen: i,
409
+ persistent: a,
410
+ notification: l
317
411
  }) => {
318
- const i = V();
319
- return i ? /* @__PURE__ */ o("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ o(X, { children: /* @__PURE__ */ o(
320
- Fe,
412
+ const t = oo();
413
+ return t ? /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(eo, { children: /* @__PURE__ */ e(
414
+ he,
321
415
  {
322
- sdk: i,
323
- event: e,
416
+ sdk: t,
417
+ event: o,
324
418
  sidebar: s,
325
419
  banner: r,
326
- isMobileScreen: a,
327
- persistent: t,
420
+ isMobileScreen: i,
421
+ persistent: a,
422
+ notification: l,
328
423
  layoutMode: "side-by-side"
329
424
  }
330
425
  ) }) }) : null;
331
426
  };
332
427
  export {
333
- Je as StreamLayerSDKAdvertisement,
334
- Fe as StreamLayerSDKAdvertisementUI
428
+ fe as StreamLayerSDKAdvertisement,
429
+ he as StreamLayerSDKAdvertisementUI
335
430
  };
package/lib/es/index2.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var fe = Object.defineProperty;
2
2
  var ke = (e, s, n) => s in e ? fe(e, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[s] = n;
3
3
  var m = (e, s, n) => ke(e, typeof s != "symbol" ? s + "" : s, n);
4
- import { C, e as G, Q as x, S as w } from "./useStreamLayerApp2.js";
5
- import { a4 as P, u, F as ye, s as h, T as re, i as Ne, p as be, b as Se, N as Ie, k as Ee, M as Ae, g as Ce, S as we, C as $e, h as De, O as le, m as q, l as Le, j as Te, n as Oe, o as de, q as xe, r as Re, t as Ve, v as M, w as Pe, x as ce, y as U, z as qe, A as H, I as O, c as pe, D as _e, E as Fe, G as Qe, e as Ke, H as R, J as j, K as Me, P as Ue, R as ze, a as ue, V as We, W as Be, L as _, _ as Ge, f as F, $ as He, a0 as je, X as Xe, Y as Ye, Z as Ze, a5 as Je, a2 as he, a3 as X } from "./provider.js";
4
+ import { C, h as G, Q as x, S as w } from "./useStreamLayerApp2.js";
5
+ import { a4 as P, u, F as ye, s as h, T as re, i as Ne, p as be, b as Se, N as Ie, k as Ee, M as Ae, f as Ce, S as we, C as $e, g as De, O as le, m as q, l as Le, h as Te, j as Oe, n as de, o as xe, q as Re, r as Ve, t as M, w as Pe, x as ce, y as U, z as qe, A as H, I as O, a as pe, D as _e, E as Fe, G as Qe, e as Ke, H as R, J as j, K as Me, P as Ue, R as ze, c as ue, V as We, W as Be, L as _, _ as Ge, v as F, $ as He, a0 as je, X as Xe, Y as Ye, Z as Ze, a5 as Je, a2 as he, a3 as X } from "./provider.js";
6
6
  import { jsx as t, jsxs as g, Fragment as L } from "react/jsx-runtime";
7
7
  import { createContext as es, useContext as z, useRef as D, useState as E, useEffect as k, useTransition as ss, lazy as ns, useMemo as $, Suspense as ts, forwardRef as os, useLayoutEffect as is, useCallback as V } from "react";
8
8
  window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as L, Fragment as E } from "react/jsx-runtime";
2
- import { u as C, F as r2, s as u, T as j, i as i2, p as a2, b as l2, N as d2, k as c2, M as p2, g as u2, S as C2, C as v2, h as h2, O as K, m as x, l as m2, j as g2, n as L2, o as X, q as f2, r as S2, t as y2, v as U, w as k2, x as J, y as _, I as e2, c as P, z as N2, A as b2, B as z, D as A2, E as I2, G as $2, e as E2, H as T, J as q, K as V2, P as w2, R as R2, a as H2, U as Q, V as T2, W as x2, L as F, X as F2, Y as D2, Z as M2, _ as O2, f as D, $ as U2, a0 as _2, a1 as P2, a2 as B2, a3 as G2 } from "./provider.js";
2
+ import { u as C, F as r2, s as u, T as j, i as i2, p as a2, b as l2, N as d2, k as c2, M as p2, f as u2, S as C2, C as v2, g as h2, O as K, m as x, l as m2, h as g2, j as L2, n as X, o as f2, q as S2, r as y2, t as U, w as k2, x as J, y as _, I as e2, a as P, z as N2, A as b2, B as z, D as A2, E as I2, G as $2, e as E2, H as T, J as q, K as V2, P as w2, R as R2, c as H2, U as Q, V as T2, W as x2, L as F, X as F2, Y as D2, Z as M2, _ as O2, v as D, $ as U2, a0 as _2, a1 as P2, a2 as B2, a3 as G2 } from "./provider.js";
3
3
  import { createContext as z2, useContext as s2, useRef as $, useState as b, useEffect as k, useTransition as q2, lazy as Q2, useMemo as H, Suspense as Z2, forwardRef as Y2, useLayoutEffect as W2, useCallback as R, Component as j2 } from "react";
4
4
  import { Q as K2, S as I } from "./useStreamLayerApp2.js";
5
5
  const M = /* @__PURE__ */ u("div")({