@streamlayer/react-ui 1.21.0 → 1.22.0

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 (52) hide show
  1. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +7 -7
  2. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +0 -1
  3. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +18 -22
  4. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +0 -1
  5. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
  6. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +1 -2
  7. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +16 -19
  8. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +0 -1
  9. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +25 -24
  10. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +1 -0
  11. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +14 -9
  12. package/lib/app/masters/BetPack/BetPackContent/index.js +64 -66
  13. package/lib/app/masters/BetPack/index.js +27 -27
  14. package/lib/app/masters/BetPack/utils.d.ts +1 -1
  15. package/lib/app/masters/BetPack/utils.js +8 -7
  16. package/lib/app/masters/Features/Gamification/index.d.ts +2 -0
  17. package/lib/app/masters/Features/Gamification/index.js +34 -29
  18. package/lib/app/masters/Features/index.d.ts +2 -0
  19. package/lib/app/masters/Features/index.js +12 -4
  20. package/lib/app/masters/Header/index.js +19 -23
  21. package/lib/app/masters/masters.js +68 -54
  22. package/lib/app/masters/useSdkResponsive.js +2 -2
  23. package/lib/app/masters/useSdkScroll.js +12 -12
  24. package/lib/app/useSdkResponsive.js +1 -1
  25. package/lib/app/useSdkScroll.js +1 -1
  26. package/lib/assets/style.css +1 -1
  27. package/lib/index-DSi8Qgfs.js +14 -0
  28. package/lib/index-DXvAPWiE.js +3743 -0
  29. package/lib/index-tnt2CtQe.js +55 -0
  30. package/lib/ui/advertisement/overlay/externalAd/index.d.ts +1 -1
  31. package/lib/ui/advertisement/overlay/externalAd/index.js +59 -40287
  32. package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +2 -0
  33. package/lib/ui/advertisement/overlay/externalAd/styles.js +34 -24
  34. package/lib/ui/advertisement/overlay/externalAd/vast-player/module.d.js +1 -0
  35. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.d.ts +19 -0
  36. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +33199 -0
  37. package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.d.ts +24 -0
  38. package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +8 -0
  39. package/lib/ui/gamification/vote/feedback/index.d.ts +1 -0
  40. package/lib/ui/gamification/vote/feedback/index.js +83 -73
  41. package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
  42. package/lib/ui/gamification/vote/feedback/styles.js +40 -39
  43. package/lib/ui/gamification/vote/index.js +94 -91
  44. package/lib/ui/icons/index.d.ts +1 -0
  45. package/lib/ui/icons/index.js +88 -79
  46. package/lib/ui/modal/index.js +31 -34
  47. package/lib/ui/theme/breakpoints.d.ts +1 -0
  48. package/lib/ui/theme/breakpoints.js +17 -9
  49. package/lib/ui/theme/masters-theme.js +1 -0
  50. package/lib/useVastAds-Dt_tRbpd.js +1284 -0
  51. package/package.json +18 -15
  52. package/lib/index-CLJzLXks.js +0 -64
@@ -1,32 +1,32 @@
1
1
  import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
2
  import { cx as y } from "@linaria/core";
3
3
  import R from "lodash.throttle";
4
- import { forwardRef as z, useState as k, useCallback as N, useMemo as A, memo as F, useRef as I, useEffect as O } from "react";
5
- import { useStore as w } from "@streamlayer/react-polyfills";
4
+ import { forwardRef as b, useState as C, useCallback as N, useMemo as A, memo as z, useRef as L, useEffect as O } from "react";
5
+ import { useStore as H } from "@streamlayer/react-polyfills";
6
6
  import { FeatureType as j } from "@streamlayer/sdk-web-types";
7
- import { BetPackContent as E } from "./BetPackContent/index.js";
8
- import { EmergencyScreen as M } from "./BetPackContent/EmergencyScreen/index.js";
9
- import { LoaderScreen as T } from "./BetPackContent/LoaderScreen/index.js";
10
- import { BetPackContainer as G } from "./styles.js";
7
+ import { BetPackContent as G } from "./BetPackContent/index.js";
8
+ import { EmergencyScreen as T } from "./BetPackContent/EmergencyScreen/index.js";
9
+ import { LoaderScreen as E } from "./BetPackContent/LoaderScreen/index.js";
10
+ import { BetPackContainer as M } from "./styles.js";
11
11
  import { defaultEventHandler as U } from "./utils.js";
12
12
  import { useOrientation as Y } from "../useOrientation.js";
13
- import { SvgIcon as C } from "../../../ui/icons/index.js";
14
- import { Container as q, Header as D, HeaderTitle as J, CloseButton as K, Main as Q, Footer as V, SlideSwitchButton as H, IconArrowPrev as W, buttonAvailable as B, IconArrowNext as X } from "./BetPackOverlay/styles.js";
15
- const ur = z(
13
+ import { SvgIcon as k } from "../../../ui/icons/index.js";
14
+ import { Container as q, Header as D, HeaderTitle as J, CloseButton as K, Main as Q, Footer as V, SlideSwitchButton as p, IconArrowPrev as W, buttonAvailable as B, IconArrowNext as X } from "./BetPackOverlay/styles.js";
15
+ const ur = b(
16
16
  ({ sdk: m, onEvent: o, close: u, isMobile: c }, h) => {
17
- const [i, d] = k(), [r, t] = k(), { orientation: s } = Y(), l = N(
17
+ const [i, d] = C(), [r, t] = C(), { orientation: s } = Y(), l = N(
18
18
  (a) => {
19
19
  if (a.type === "slBetPackReady") {
20
- const { next: P, prev: x, current: p, canNext: b, canPrev: L } = a.payload || {};
20
+ const { next: P, prev: x, current: w, canNext: F, canPrev: I } = a.payload || {};
21
21
  d({ next: P, prev: x }), t((n) => ({
22
- current: n != null && n.current ? n == null ? void 0 : n.current : p,
23
- canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev : L,
24
- canNext: b
22
+ current: n != null && n.current ? n == null ? void 0 : n.current : w,
23
+ canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev : I,
24
+ canNext: F
25
25
  }));
26
26
  }
27
27
  if (a.type === "slBetPackChangeCard") {
28
- const { current: P, canNext: x, canPrev: p } = a.payload || {};
29
- t({ current: P, canNext: x, canPrev: p });
28
+ const { current: P, canNext: x, canPrev: w } = a.payload || {};
29
+ t({ current: P, canNext: x, canPrev: w });
30
30
  }
31
31
  o == null || o(a);
32
32
  },
@@ -35,11 +35,11 @@ const ur = z(
35
35
  return /* @__PURE__ */ f(q, { ref: h, children: [
36
36
  /* @__PURE__ */ f(D, { children: [
37
37
  /* @__PURE__ */ f(J, { children: [
38
- /* @__PURE__ */ e(C, { name: "icon-trophy-bet-pack" }),
39
- "LiveMatch Experience",
38
+ /* @__PURE__ */ e(k, { name: "fgIcon" }),
39
+ "Featured Groups+",
40
40
  " "
41
41
  ] }),
42
- /* @__PURE__ */ e(K, { onClick: u, children: /* @__PURE__ */ e(C, { name: "icon-close-btn-gray" }) })
42
+ /* @__PURE__ */ e(K, { onClick: u, children: /* @__PURE__ */ e(k, { name: "icon-close-btn-gray" }) })
43
43
  ] }),
44
44
  /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(
45
45
  Z,
@@ -52,13 +52,13 @@ const ur = z(
52
52
  }
53
53
  ) }),
54
54
  !c && /* @__PURE__ */ f(V, { children: [
55
- /* @__PURE__ */ e(H, { onClick: i == null ? void 0 : i.prev, disabled: !(r != null && r.canPrev), children: /* @__PURE__ */ e(W, { name: "iconArrowPrev", className: y((r == null ? void 0 : r.canPrev) && B) }) }),
56
- /* @__PURE__ */ e(H, { onClick: i == null ? void 0 : i.next, disabled: !(r != null && r.canNext), children: /* @__PURE__ */ e(X, { name: "iconArrowPrev", className: y((r == null ? void 0 : r.canNext) && B) }) })
55
+ /* @__PURE__ */ e(p, { onClick: i == null ? void 0 : i.prev, disabled: !(r != null && r.canPrev), children: /* @__PURE__ */ e(W, { name: "iconArrowPrev", className: y((r == null ? void 0 : r.canPrev) && B) }) }),
56
+ /* @__PURE__ */ e(p, { onClick: i == null ? void 0 : i.next, disabled: !(r != null && r.canNext), children: /* @__PURE__ */ e(X, { name: "iconArrowPrev", className: y((r == null ? void 0 : r.canNext) && B) }) })
57
57
  ] })
58
58
  ] });
59
59
  }
60
- ), Z = F(({ sdk: m, swipeable: o = !0, heightOffset: u = 65, onEvent: c = U, centerPadding: h }) => {
61
- const i = w(m.featuresList.getStore()), d = A(() => m.getFeature(j.GAMES), [i]), r = w(m.getUserStore()), t = I(null), [s, l] = k(), g = N(() => {
60
+ ), Z = z(({ sdk: m, swipeable: o = !0, heightOffset: u = 65, onEvent: c = U, centerPadding: h }) => {
61
+ const i = H(m.featuresList.getStore()), d = A(() => m.getFeature(j.GAMES), [i]), r = H(m.getUserStore()), t = L(null), [s, l] = C(), g = N(() => {
62
62
  t.current && l(t.current.clientHeight);
63
63
  }, []);
64
64
  return O(() => {
@@ -68,8 +68,8 @@ const ur = z(
68
68
  return window.addEventListener("resize", a), () => {
69
69
  window.removeEventListener("resize", a);
70
70
  };
71
- }, []), r.data ? d ? /* @__PURE__ */ e(G, { ref: t, className: y("betPack", o && "isMobile"), children: /* @__PURE__ */ e(
72
- E,
71
+ }, []), r.data ? d ? /* @__PURE__ */ e(M, { ref: t, className: y("betPack", o && "isMobile"), children: /* @__PURE__ */ e(
72
+ G,
73
73
  {
74
74
  gamification: d,
75
75
  onEvent: c,
@@ -79,7 +79,7 @@ const ur = z(
79
79
  height: s ? s - u : void 0
80
80
  }
81
81
  ) }) : /* @__PURE__ */ e("div", { children: "no gamification" }) : r.error && !r.loading ? /* @__PURE__ */ e(
82
- M,
82
+ T,
83
83
  {
84
84
  actionFn: () => c({ type: "slHardRefresh" }),
85
85
  description: `You are not authorized to
@@ -87,7 +87,7 @@ view this resource.`,
87
87
  isMobile: o,
88
88
  height: s ? s - u : void 0
89
89
  }
90
- ) : /* @__PURE__ */ e(T, {});
90
+ ) : /* @__PURE__ */ e(E, {});
91
91
  });
92
92
  export {
93
93
  Z as BetPack,
@@ -1,4 +1,4 @@
1
- export type AllowedMessageType = 'slBetPackReady' | 'slOpenGameCenter' | 'slHardRefresh' | 'slBetPackChangeCard';
1
+ export type AllowedMessageType = 'slBetPackReady' | 'slOpenGameCenter' | 'slHardRefresh' | 'slBetPackChangeCard' | 'slVoted';
2
2
  declare global {
3
3
  interface Window {
4
4
  webkit?: {
@@ -1,10 +1,11 @@
1
- import { createLogger as n } from "@streamlayer/sdk-web-logger";
2
- const o = "slBetPackCb", w = n("betPack-ui"), d = (e, s = {}) => {
3
- var t, i;
4
- w.debug({ id: o, type: e, ...s }), (t = window.top) == null || t.postMessage({ id: o, type: e, ...s }, "*"), window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers[o] && window.webkit.messageHandlers[o].postMessage({ type: e, ...s }), (i = window.slBetPackCb) != null && i.postMessage && window.slBetPackCb.postMessage(JSON.stringify({ type: e, ...s, from: "base" }));
5
- }, a = (e) => {
6
- d(e.type);
1
+ import { createLogger as w } from "@streamlayer/sdk-web-logger";
2
+ const o = "slBetPackCb", g = w("betPack-ui"), r = (s, d = {}) => {
3
+ var a, t;
4
+ const { questionId: i, answerId: n } = d, e = { questionId: i, answerId: n };
5
+ g.debug({ id: o, type: s, ...e }), (a = window.top) == null || a.postMessage({ id: o, type: s, ...e }, "*"), window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers[o] && window.webkit.messageHandlers[o].postMessage({ type: s, ...e }), (t = window.slBetPackCb) != null && t.postMessage && window.slBetPackCb.postMessage(JSON.stringify({ type: s, ...e, from: "base" }));
6
+ }, c = (s) => {
7
+ r(s.type, s.payload);
7
8
  };
8
9
  export {
9
- a as defaultEventHandler
10
+ c as defaultEventHandler
10
11
  };
@@ -1,4 +1,5 @@
1
1
  import { AppNodeRef } from '../../..';
2
+ import { ResponsiveStore } from '../../useSdkResponsive';
2
3
  import { Gamification as GamificationClass } from '@streamlayer/feature-gamification';
3
4
  export declare const GamificationOverlay: React.FC<{
4
5
  gamification: GamificationClass;
@@ -11,5 +12,6 @@ export declare const GamificationOverlay: React.FC<{
11
12
  export declare const GamificationOverlayStandalone: React.FC<{
12
13
  gamification: GamificationClass;
13
14
  className?: string;
15
+ responsiveStore: ResponsiveStore;
14
16
  appNode: AppNodeRef;
15
17
  }>;
@@ -1,44 +1,49 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { styled as m } from "@linaria/react";
3
- import { useHideTransition as a } from "../../../../hooks/showIn.js";
4
- import { useStore as l } from "@streamlayer/react-polyfills";
5
- import { ModalPortal as p } from "../../../../ui/modal/index.js";
6
- import { ShowIn as u } from "../../../../ui/show-in/index.js";
7
- import { Question as c } from "./Question.js";
8
- import { Tabs as f } from "./Tabs.js";
9
- const d = () => u, h = /* @__PURE__ */ m(d())({
2
+ import { styled as u } from "@linaria/react";
3
+ import { useHideTransition as c } from "../../../../hooks/showIn.js";
4
+ import { useStore as t } from "@streamlayer/react-polyfills";
5
+ import { ModalPortal as d } from "../../../../ui/modal/index.js";
6
+ import { ShowIn as l } from "../../../../ui/show-in/index.js";
7
+ import { Question as f } from "./Question.js";
8
+ import { Tabs as k } from "./Tabs.js";
9
+ const h = () => l, y = /* @__PURE__ */ u(h())({
10
10
  name: "OpenedContainer",
11
11
  class: "o1seszvt",
12
12
  propsAsIs: !0
13
- }), G = ({
13
+ }), A = ({
14
14
  gamification: o,
15
- className: r
16
- }) => /* @__PURE__ */ n(f, {
17
- className: r,
15
+ className: e
16
+ }) => /* @__PURE__ */ n(k, {
17
+ className: e,
18
18
  gamification: o
19
- }), I = ({
19
+ }), D = ({
20
20
  gamification: o,
21
- className: r,
22
- appNode: e
21
+ responsiveStore: e,
22
+ className: i,
23
+ appNode: r
23
24
  }) => {
24
- const t = l(o.openedQuestion.$store), {
25
- hiding: i,
26
- onAnimationEnd: s
27
- } = a();
28
- return !e.current || !t ? null : /* @__PURE__ */ n(p, {
29
- container: e,
30
- useContainer: !1,
31
- children: /* @__PURE__ */ n(h, {
32
- className: r,
33
- hiding: i,
34
- onAnimationEnd: s,
35
- children: /* @__PURE__ */ n(c, {
25
+ const s = t(o.openedQuestion.$store), {
26
+ sdkInDesktopView: m
27
+ } = t(e, {
28
+ keys: ["sdkInDesktopView"]
29
+ }), {
30
+ hiding: a,
31
+ onAnimationEnd: p
32
+ } = c();
33
+ return !r.current || !s ? null : /* @__PURE__ */ n(d, {
34
+ container: r,
35
+ useContainer: !m,
36
+ children: /* @__PURE__ */ n(y, {
37
+ className: i,
38
+ hiding: a,
39
+ onAnimationEnd: p,
40
+ children: /* @__PURE__ */ n(f, {
36
41
  gamification: o
37
42
  })
38
43
  })
39
44
  });
40
45
  };
41
46
  export {
42
- G as GamificationOverlay,
43
- I as GamificationOverlayStandalone
47
+ A as GamificationOverlay,
48
+ D as GamificationOverlayStandalone
44
49
  };
@@ -1,6 +1,7 @@
1
1
  import { AppNodeRef } from '../..';
2
2
  import { Features } from '@streamlayer/sdk-web-features';
3
3
  import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
4
+ import { ResponsiveStore } from '../useSdkResponsive';
4
5
  /** render feature by type */
5
6
  export declare const ActiveFeature: React.FC<{
6
7
  sdk: StreamLayerSDK;
@@ -12,5 +13,6 @@ export declare const StandaloneFeature: React.FC<{
12
13
  sdk: StreamLayerSDK;
13
14
  feature: Features | null;
14
15
  appNode: AppNodeRef;
16
+ responsiveStore: ResponsiveStore;
15
17
  className?: string;
16
18
  }>;
@@ -1,18 +1,26 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { lazy as l, useMemo as a, Suspense as m } from "react";
3
- import { FeatureType as n } from "@streamlayer/sdk-web-types";
3
+ import { FeatureType as o } from "@streamlayer/sdk-web-types";
4
4
  import { FeatureProvider as u } from "./FeatureProvider.js";
5
5
  import { GamificationOverlayStandalone as f } from "./Gamification/index.js";
6
6
  const c = l(() => import("./Gamification/gamification-feature.js")), h = ({ sdk: e, feature: t, className: i }) => {
7
- const o = a(() => t && t.featureConfig.get().type === n.GAMES ? /* @__PURE__ */ r(u, { className: i, sdk: e, feature: t, children: /* @__PURE__ */ r(c, { className: i, gamification: t }) }) : null, [e, t, i]);
7
+ const n = a(() => t && t.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(u, { className: i, sdk: e, feature: t, children: /* @__PURE__ */ r(c, { className: i, gamification: t }) }) : null, [e, t, i]);
8
8
  return /* @__PURE__ */ r(
9
9
  m,
10
10
  {
11
11
  fallback: /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
12
- children: o
12
+ children: n
13
13
  }
14
14
  );
15
- }, v = ({ feature: e, className: t, appNode: i }) => e && e.featureConfig.get().type === n.GAMES ? /* @__PURE__ */ r(f, { className: t, appNode: i, gamification: e }) : null;
15
+ }, v = ({ feature: e, className: t, appNode: i, responsiveStore: n }) => e && e.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ r(
16
+ f,
17
+ {
18
+ responsiveStore: n,
19
+ className: t,
20
+ appNode: i,
21
+ gamification: e
22
+ }
23
+ ) : null;
16
24
  export {
17
25
  h as ActiveFeature,
18
26
  v as StandaloneFeature
@@ -1,38 +1,34 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { cx as a } from "@linaria/core";
3
- import { styled as s } from "@linaria/react";
4
- import { forwardRef as t } from "react";
5
- import { SvgIcon as c } from "../../../ui/icons/index.js";
6
- const i = /* @__PURE__ */ s("div")({
1
+ import { jsxs as r, jsx as s } from "react/jsx-runtime";
2
+ import { cx as t } from "@linaria/core";
3
+ import { styled as o } from "@linaria/react";
4
+ import { forwardRef as a } from "react";
5
+ import { SvgIcon as i } from "../../../ui/icons/index.js";
6
+ const c = /* @__PURE__ */ o("div")({
7
7
  name: "Navigation",
8
8
  class: "n1o1tw60",
9
9
  propsAsIs: !1
10
- }), m = /* @__PURE__ */ s("div")({
10
+ }), m = /* @__PURE__ */ o("div")({
11
11
  name: "Container",
12
12
  class: "co2rstw",
13
13
  propsAsIs: !1
14
- }), p = /* @__PURE__ */ s("div")({
14
+ }), l = /* @__PURE__ */ o("div")({
15
15
  name: "Title",
16
16
  class: "t1bqnx9c",
17
17
  propsAsIs: !1
18
- }), l = () => c, d = /* @__PURE__ */ s(l())({
19
- name: "HeaderIcon",
20
- class: "hlc2pcy",
21
- propsAsIs: !0
22
- }), f = "h1aqxe8k", g = t(({
23
- className: o
24
- }, n) => /* @__PURE__ */ r(i, {
25
- className: a(o, f),
26
- children: [/* @__PURE__ */ e(m, {
27
- children: /* @__PURE__ */ r(p, {
28
- children: [/* @__PURE__ */ e(d, {
29
- name: "icon-trivia-transparent"
30
- }), "Game Center"]
18
+ }), p = "hlc2pcy", I = a(({
19
+ className: e
20
+ }, n) => /* @__PURE__ */ r(c, {
21
+ className: t(e, p),
22
+ children: [/* @__PURE__ */ s(m, {
23
+ children: /* @__PURE__ */ r(l, {
24
+ children: [/* @__PURE__ */ s(i, {
25
+ name: "fgIcon"
26
+ }), "FG+ Game Center", " "]
31
27
  })
32
- }), /* @__PURE__ */ e("div", {
28
+ }), /* @__PURE__ */ s("div", {
33
29
  ref: n
34
30
  })]
35
31
  }));
36
32
  export {
37
- g as SDKHeader
33
+ I as SDKHeader
38
34
  };
@@ -1,85 +1,99 @@
1
1
  import { jsxs as f, jsx as a } from "react/jsx-runtime";
2
- import { cx as w } from "@linaria/core";
3
- import { SDKContainer as L, SDKScrollContainer as N } from "./styles.js";
4
- import { useSdkScroll as x } from "./useSdkScroll.js";
5
- import { useSdkFeature as y } from "../useSdkFeature.js";
2
+ import { cx as A } from "@linaria/core";
3
+ import { SDKContainer as E, SDKScrollContainer as L } from "./styles.js";
4
+ import { useSdkScroll as M } from "./useSdkScroll.js";
5
+ import { useSdkFeature as N } from "../useSdkFeature.js";
6
6
  import { useAnalyticsListener as h, newTabLinkListener as F } from "../../hooks/analytics.js";
7
- import A from "lodash.throttle";
8
- import { useState as b, useMemo as E, useRef as d, useEffect as p } from "react";
9
- import { useStore as c } from "@streamlayer/react-polyfills";
10
- import { FeatureType as I } from "@streamlayer/sdk-web-types";
7
+ import x from "lodash.throttle";
8
+ import { useState as b, useMemo as y, useCallback as C, useRef as p, useEffect as S } from "react";
9
+ import { useStore as m } from "@streamlayer/react-polyfills";
10
+ import { FeatureType as w } from "@streamlayer/sdk-web-types";
11
11
  import { resetCss as u } from "../../ui/theme/theme.js";
12
- import { BetPackOverlay as M } from "./BetPack/index.js";
13
- import { ActiveFeature as k, StandaloneFeature as z } from "./Features/index.js";
14
- import { SDKHeader as C } from "./Header/index.js";
15
- import { SDKNotifications as P } from "./Notifications/index.js";
16
- import { MastersContext as g } from "./useMastersContext.js";
17
- import { checkSdkInDesktopView as S, getScreenSize as v, useSdkResponsive as D } from "./useSdkResponsive.js";
18
- import { StreamLayerMastersThemeProvider as se } from "../../ui/theme/masters.js";
19
- const B = ({ sdk: e, className: t }) => {
20
- const [, r] = y(e);
21
- return /* @__PURE__ */ a(k, { className: t, feature: r, sdk: e });
22
- }, K = ({ sdk: e, className: t, appNode: r }) => {
23
- const o = c(e.featuresList.getStore());
24
- return o ? Array.from(o, (n) => {
25
- const s = e.getFeature(n);
26
- return s ? /* @__PURE__ */ a(z, { className: t, appNode: r, feature: s, sdk: e }, n) : null;
12
+ import { BetPackOverlay as I } from "./BetPack/index.js";
13
+ import { ActiveFeature as P, StandaloneFeature as z } from "./Features/index.js";
14
+ import { SDKHeader as g } from "./Header/index.js";
15
+ import { SDKNotifications as B } from "./Notifications/index.js";
16
+ import { MastersContext as D } from "./useMastersContext.js";
17
+ import { checkSdkInDesktopView as d, getScreenSize as v, useSdkResponsive as K } from "./useSdkResponsive.js";
18
+ import { StreamLayerMastersThemeProvider as ae } from "../../ui/theme/masters.js";
19
+ const G = ({ sdk: e, className: t }) => {
20
+ const [, r] = N(e);
21
+ return /* @__PURE__ */ a(P, { className: t, feature: r, sdk: e });
22
+ }, O = ({ sdk: e, className: t, appNode: r, responsiveStore: i }) => {
23
+ const n = m(e.featuresList.getStore());
24
+ return n ? Array.from(n, (o) => {
25
+ const c = e.getFeature(o);
26
+ return c ? /* @__PURE__ */ a(
27
+ z,
28
+ {
29
+ responsiveStore: i,
30
+ className: t,
31
+ appNode: r,
32
+ feature: c,
33
+ sdk: e
34
+ },
35
+ o
36
+ ) : null;
27
37
  }) : null;
28
- }, O = (e) => {
29
- const [t, r] = b(!S(v().size)), o = d(null);
30
- return p(() => {
31
- const n = A(() => {
32
- const s = v();
33
- r(!S(s.size));
38
+ }, R = (e) => {
39
+ const [t, r] = b(!d(v().size)), i = p(null);
40
+ return S(() => {
41
+ const n = x(() => {
42
+ const o = v();
43
+ r(!d(o.size));
34
44
  }, 200);
35
45
  return window.addEventListener("resize", n), () => {
36
46
  window.removeEventListener("resize", n);
37
47
  };
38
- }, []), h(o, { enabled: !0, event: "click", listener: F }), /* @__PURE__ */ a(M, { ref: o, ...e, isMobile: t });
39
- }, R = ({ sdk: e }) => {
40
- const t = d(null), r = c(e.status), o = c(e.sdkStore.slStreamId), n = d(null), [s] = D(t), [i, l] = x(t, s), m = r === "ready" && !!o.data;
41
- return p(() => {
48
+ }, []), h(i, { enabled: !0, event: "click", listener: F }), /* @__PURE__ */ a(I, { ref: i, ...e, isMobile: t });
49
+ }, j = ({ sdk: e }) => {
50
+ const t = p(null), r = m(e.status), i = m(e.sdkStore.slStreamId), n = p(null), [o] = K(t), [c, l] = M(t, o), s = r === "ready" && !!i.data;
51
+ return S(() => {
42
52
  window.requestAnimationFrame(() => {
43
53
  e.initializeApp().then(() => {
44
- e.openFeature(I.GAMES);
54
+ e.openFeature(w.GAMES);
45
55
  });
46
56
  });
47
- }, [e]), h(t, { enabled: !0, event: "click", listener: F }), p(() => {
57
+ }, [e]), h(t, { enabled: !0, event: "click", listener: F }), S(() => {
48
58
  import("./Features/Gamification/gamification-feature.js");
49
- }, []), /* @__PURE__ */ f(L, { ref: t, children: [
50
- /* @__PURE__ */ a(C, { className: w(u, "sl-hide-on-modal"), ref: n }),
51
- /* @__PURE__ */ f(N, { "data-nav": !0, className: "sl-hide-on-modal", ref: i, children: [
52
- m && /* @__PURE__ */ a(
53
- P,
59
+ }, []), /* @__PURE__ */ f(E, { ref: t, children: [
60
+ /* @__PURE__ */ a(g, { className: A(u), ref: n }),
61
+ /* @__PURE__ */ f(L, { className: "sl-hide-on-modal", ref: c, children: [
62
+ s && /* @__PURE__ */ a(
63
+ B,
54
64
  {
55
65
  sdk: e,
56
- scrollNode: i,
66
+ scrollNode: c,
57
67
  headerNode: n,
58
68
  appNode: t,
59
69
  scrollStore: l,
60
- responsiveStore: s
70
+ responsiveStore: o
61
71
  }
62
72
  ),
63
- m && /* @__PURE__ */ a(B, { className: u, sdk: e }),
64
- m && /* @__PURE__ */ a(K, { appNode: t, className: u, sdk: e })
73
+ s && /* @__PURE__ */ a(G, { className: u, sdk: e }),
74
+ s && /* @__PURE__ */ a(O, { responsiveStore: o, appNode: t, className: u, sdk: e })
65
75
  ] })
66
76
  ] });
67
- }, re = ({ sdk: e, betPack: t }) => {
68
- const [r, o] = b(t), s = !!c(e.userId()), i = E(() => ({ sdk: e }), [e]);
69
- return /* @__PURE__ */ f(g.Provider, { value: i, children: [
70
- r && s && /* @__PURE__ */ a(
71
- O,
77
+ }, oe = ({ sdk: e, betPack: t }) => {
78
+ const [r, i] = b(t), o = !!m(e.userId()), c = y(() => ({ sdk: e }), [e]), l = C(() => {
79
+ i(!1);
80
+ const s = e == null ? void 0 : e.getFeature(w.GAMES);
81
+ s == null || s.closeQuestion();
82
+ }, [e]);
83
+ return /* @__PURE__ */ f(D.Provider, { value: c, children: [
84
+ r && o && /* @__PURE__ */ a(
85
+ R,
72
86
  {
73
87
  sdk: e,
74
- onEvent: ({ type: l }) => l === "slOpenGameCenter" ? o(!1) : () => {
88
+ onEvent: ({ type: s }) => s === "slOpenGameCenter" ? l() : () => {
75
89
  },
76
- close: () => o(!1)
90
+ close: () => l()
77
91
  }
78
92
  ),
79
- !r && /* @__PURE__ */ a(R, { sdk: e })
93
+ !r && /* @__PURE__ */ a(j, { sdk: e })
80
94
  ] });
81
95
  };
82
96
  export {
83
- re as MastersApp,
84
- se as StreamLayerMastersThemeProvider
97
+ oe as MastersApp,
98
+ ae as StreamLayerMastersThemeProvider
85
99
  };
@@ -1,7 +1,7 @@
1
1
  import c from "lodash.throttle";
2
2
  import { useState as m, useEffect as u } from "react";
3
3
  import { BREAKPOINTS as r } from "../../ui/theme/constants.js";
4
- import { m as l } from "../../index-CLJzLXks.js";
4
+ import { m as l } from "../../index-DSi8Qgfs.js";
5
5
  const d = Object.keys(r), i = () => {
6
6
  const n = window.innerWidth;
7
7
  let e = "sm";
@@ -19,7 +19,7 @@ const d = Object.keys(r), i = () => {
19
19
  }, w = (n) => {
20
20
  var e;
21
21
  return (((e = n.current) == null ? void 0 : e.getBoundingClientRect().y) || 0) < -68;
22
- }, k = (n) => n >= r.xl, v = (n) => {
22
+ }, k = (n) => n >= r.lg, v = (n) => {
23
23
  const [e] = m(() => {
24
24
  const t = i();
25
25
  return l({
@@ -1,24 +1,24 @@
1
1
  import S from "lodash.throttle";
2
- import { useRef as m, useState as h, useEffect as b } from "react";
3
- import { useStore as g } from "@streamlayer/react-polyfills";
2
+ import { useRef as m, useState as g, useEffect as h } from "react";
3
+ import { useStore as b } from "@streamlayer/react-polyfills";
4
4
  import { BREAKPOINTS as c } from "../../ui/theme/constants.js";
5
- import { m as v } from "../../index-CLJzLXks.js";
6
- const C = (o, e, n) => {
5
+ import { m as v } from "../../index-DSi8Qgfs.js";
6
+ const D = (o, e, n) => {
7
7
  const t = e >= c.lg && e < c.xl ? 75 : 52;
8
8
  o.current && window.scrollTo({
9
9
  top: o.current.offsetTop - t,
10
10
  ...n
11
11
  });
12
- }, T = 15, D = (o, e) => {
13
- const n = m(null), t = m(0), [s] = h(
12
+ }, T = 15, L = (o, e) => {
13
+ const n = m(null), t = m(0), [s] = g(
14
14
  v({
15
15
  scrollPosition: 0,
16
16
  tabsShown: !0,
17
17
  scrollDirection: "forward"
18
18
  })
19
- ), i = g(e);
20
- return b(() => {
21
- const l = window.innerWidth < c.xl ? window : n.current;
19
+ ), i = b(e);
20
+ return h(() => {
21
+ const l = window.innerWidth < c.lg ? window : n.current;
22
22
  if (!l)
23
23
  return () => {
24
24
  };
@@ -28,7 +28,7 @@ const C = (o, e, n) => {
28
28
  if (!u)
29
29
  return;
30
30
  let r = 0;
31
- i.screen.size < c.xl ? r = ((a = o.current) == null ? void 0 : a.getBoundingClientRect().y) || 0 : r = u.scrollTop;
31
+ i.screen.size < c.lg ? r = ((a = o.current) == null ? void 0 : a.getBoundingClientRect().y) || 0 : r = u.scrollTop;
32
32
  const w = t.current - r;
33
33
  if (T > Math.abs(w))
34
34
  return;
@@ -45,6 +45,6 @@ const C = (o, e, n) => {
45
45
  }, [s, o, i.screen]), [n, s];
46
46
  };
47
47
  export {
48
- C as scrollIntoAppView,
49
- D as useSdkScroll
48
+ D as scrollIntoAppView,
49
+ L as useSdkScroll
50
50
  };
@@ -1,7 +1,7 @@
1
1
  import i from "lodash.throttle";
2
2
  import { useState as m, useEffect as a } from "react";
3
3
  import { BREAKPOINTS as r } from "../ui/theme/constants.js";
4
- import { m as u } from "../index-CLJzLXks.js";
4
+ import { m as u } from "../index-DSi8Qgfs.js";
5
5
  const o = Object.keys(r), c = () => {
6
6
  const t = window.innerWidth;
7
7
  let e = "sm";
@@ -3,7 +3,7 @@ import { useRef as u, useState as b, useEffect as g } from "react";
3
3
  import { useStore as k } from "@streamlayer/react-polyfills";
4
4
  import { BREAKPOINTS as a } from "../ui/theme/constants.js";
5
5
  import { checkSdkInDesktopView as m } from "./useSdkResponsive.js";
6
- import { m as v } from "../index-CLJzLXks.js";
6
+ import { m as v } from "../index-DSi8Qgfs.js";
7
7
  const I = (o, e, n) => {
8
8
  const t = e >= a.lg && e < a.xl ? 75 : 52;
9
9
  o.current && window.scrollTo({