@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
@@ -1,84 +1,86 @@
1
- import { useEffect as c } from "react";
2
- import { e as s } from "./index3.js";
3
- import { A as v } from "./sl-types.js";
4
- let o = [], r = 0;
5
- const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (i) => {
6
- let e = [], t = {
1
+ import { useEffect } from "react";
2
+ import { e as eventBus } from "./index3.js";
3
+ import { A as A$1 } from "./sl-types.js";
4
+ let t = [], i = 0;
5
+ const s = 4, a = /* @__NO_SIDE_EFFECTS__ */ (r) => {
6
+ let f2 = [], e = {
7
7
  get() {
8
- return t.lc || t.listen(() => {
9
- })(), t.value;
8
+ return e.lc || e.listen(() => {
9
+ })(), e.value;
10
10
  },
11
11
  lc: 0,
12
- listen(n) {
13
- return t.lc = e.push(n), () => {
14
- for (let a = r + u; a < o.length; )
15
- o[a] === n ? o.splice(a, u) : a += u;
16
- let l = e.indexOf(n);
17
- ~l && (e.splice(l, 1), --t.lc || t.off());
12
+ listen(l) {
13
+ return e.lc = f2.push(l), () => {
14
+ for (let u = i + s; u < t.length; )
15
+ t[u] === l ? t.splice(u, s) : u += s;
16
+ let n = f2.indexOf(l);
17
+ ~n && (f2.splice(n, 1), --e.lc || e.off());
18
18
  };
19
19
  },
20
- notify(n, l) {
21
- let a = !o.length;
22
- for (let f of e)
23
- o.push(f, t.value, n, l);
24
- if (a) {
25
- for (r = 0; r < o.length; r += u)
26
- o[r](
27
- o[r + 1],
28
- o[r + 2],
29
- o[r + 3]
20
+ notify(l, n) {
21
+ let u = !t.length;
22
+ for (let o of f2)
23
+ t.push(o, e.value, l, n);
24
+ if (u) {
25
+ for (i = 0; i < t.length; i += s)
26
+ t[i](
27
+ t[i + 1],
28
+ t[i + 2],
29
+ t[i + 3]
30
30
  );
31
- o.length = 0;
31
+ t.length = 0;
32
32
  }
33
33
  },
34
34
  /* It will be called on last listener unsubscribing.
35
35
  We will redefine it in onMount and onStop. */
36
36
  off() {
37
37
  },
38
- set(n) {
39
- let l = t.value;
40
- l !== n && (t.value = n, t.notify(l));
38
+ set(l) {
39
+ let n = e.value;
40
+ n !== l && (e.value = l, e.notify(n));
41
41
  },
42
- subscribe(n) {
43
- let l = t.listen(n);
44
- return n(t.value), l;
42
+ subscribe(l) {
43
+ let n = e.listen(l);
44
+ return l(e.value), n;
45
45
  },
46
- value: i
46
+ value: r
47
47
  };
48
- return t;
49
- }, b = /* @__NO_SIDE_EFFECTS__ */ (i = {}) => {
50
- let e = /* @__PURE__ */ d(i);
51
- return e.setKey = function(t, n) {
48
+ return e;
49
+ };
50
+ const f$1 = /* @__NO_SIDE_EFFECTS__ */ (o = {}) => {
51
+ let e = /* @__PURE__ */ a(o);
52
+ return e.setKey = function(a2, t2) {
52
53
  let l = e.value;
53
- typeof n > "u" && t in e.value ? (e.value = { ...e.value }, delete e.value[t], e.notify(l, t)) : e.value[t] !== n && (e.value = {
54
+ typeof t2 > "u" && a2 in e.value ? (e.value = { ...e.value }, delete e.value[a2], e.notify(l, a2)) : e.value[a2] !== t2 && (e.value = {
54
55
  ...e.value,
55
- [t]: n
56
- }, e.notify(l, t));
56
+ [a2]: t2
57
+ }, e.notify(l, a2));
57
58
  }, e;
58
- }, y = (i) => [(e) => (...t) => (i && s.emit(i == null ? void 0 : i.type, i), e ? e(t) : null)], h = (i) => {
59
- const e = i.target;
60
- e instanceof HTMLAnchorElement && e.target === "_blank" && e.getAttribute("data-a") === "web-link" && s.emit("poll", {
59
+ };
60
+ const f = (t2) => [(r) => (...n) => (t2 && eventBus.emit(t2 == null ? void 0 : t2.type, t2), r ? r(n) : null)], A = (t2) => {
61
+ const e = t2.target;
62
+ e instanceof HTMLAnchorElement && e.target === "_blank" && e.getAttribute("data-a") === "web-link" && eventBus.emit("poll", {
61
63
  action: "navigated",
62
64
  payload: {}
63
- }), e instanceof Element && e.getAttribute("data-a") === "intr" && s.emit("interactions", {
65
+ }), e instanceof Element && e.getAttribute("data-a") === "intr" && eventBus.emit("interactions", {
64
66
  action: "tap",
65
67
  payload: {}
66
68
  });
67
- }, A = (i, e) => {
68
- const t = window.innerWidth < v.xl;
69
- c(() => {
70
- const n = t && e.useDomNode ? document : i.current, l = (a) => {
71
- e.listener(a, i);
69
+ }, b = (t2, e) => {
70
+ const r = window.innerWidth < A$1.xl;
71
+ useEffect(() => {
72
+ const n = r && e.useDomNode ? document : t2.current, i2 = (l) => {
73
+ e.listener(l, t2);
72
74
  };
73
- return e.enabled && (n == null || n.addEventListener(e.event, l)), () => {
74
- n == null || n.removeEventListener(e.event, l);
75
+ return e.enabled && (n == null || n.addEventListener(e.event, i2)), () => {
76
+ n == null || n.removeEventListener(e.event, i2);
75
77
  };
76
- }, [t, e.enabled, e.listener]);
78
+ }, [r, e.enabled, e.listener]);
77
79
  };
78
80
  export {
79
- h as A,
80
- y as a,
81
- A as b,
82
- d as c,
83
- b as f
81
+ A,
82
+ f as a,
83
+ b,
84
+ a as c,
85
+ f$1 as f
84
86
  };
package/lib/es/auth.js CHANGED
@@ -1,11 +1,17 @@
1
- import { useEffect as o } from "react";
2
- import { B as f } from "./hooks-B0Qttldg.js";
3
- const p = ({ token: t, schema: i }) => {
4
- const r = f();
5
- return o(() => {
6
- t && i && r && r.authorizationBypass(i, t), r && (r.withAuth = !0);
7
- }, [t, i, r]), null;
1
+ import { useEffect } from "react";
2
+ import { B } from "./hooks-WfHlJH12.js";
3
+ const StreamLayerLogin = ({ token, schema }) => {
4
+ const sdk = B();
5
+ useEffect(() => {
6
+ if (token && schema && sdk) {
7
+ void sdk.authorizationBypass(schema, token);
8
+ }
9
+ if (sdk) {
10
+ sdk.withAuth = true;
11
+ }
12
+ }, [token, schema, sdk]);
13
+ return null;
8
14
  };
9
15
  export {
10
- p as StreamLayerLogin
16
+ StreamLayerLogin
11
17
  };
@@ -1,20 +1,32 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { e as o } from "./index3.js";
3
- import { Q as i } from "./index4.js";
4
- import { useEffect as c } from "react";
5
- import { B as m } from "./hooks-B0Qttldg.js";
6
- const r = (t) => {
7
- const e = t.target;
8
- e instanceof Element && e.getAttribute("data-a") === "intr" && o.emit("interactions", {
9
- action: "tap",
10
- payload: {}
11
- });
12
- }, p = () => {
13
- const t = m();
14
- return c(() => (document == null || document.addEventListener("click", r), () => {
15
- document == null || document.removeEventListener("click", r);
16
- }), []), t ? /* @__PURE__ */ n(i, { sdk: t }) : null;
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { e as eventBus } from "./index3.js";
3
+ import { Q } from "./index4.js";
4
+ import { useEffect } from "react";
5
+ import { B } from "./hooks-WfHlJH12.js";
6
+ const clickListener = (event) => {
7
+ const target = event.target;
8
+ if (target instanceof Element) {
9
+ if (target.getAttribute("data-a") === "intr") {
10
+ eventBus.emit("interactions", {
11
+ action: "tap",
12
+ payload: {}
13
+ });
14
+ }
15
+ }
16
+ };
17
+ const BetPackProvider = () => {
18
+ const sdk = B();
19
+ useEffect(() => {
20
+ document == null ? void 0 : document.addEventListener("click", clickListener);
21
+ return () => {
22
+ document == null ? void 0 : document.removeEventListener("click", clickListener);
23
+ };
24
+ }, []);
25
+ if (!sdk) {
26
+ return null;
27
+ }
28
+ return /* @__PURE__ */ jsx(Q, { sdk });
17
29
  };
18
30
  export {
19
- p as BetPackProvider
31
+ BetPackProvider
20
32
  };
@@ -0,0 +1,108 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import "./sl-types.js";
5
+ import { S as SdkOverlayType } from "./useStreamLayerApp2.js";
6
+ const LEVELS = ["trace", "debug", "info", "warn", "error", "fatal"];
7
+ const LEVEL_MAP = {
8
+ trace: "debug",
9
+ debug: "debug",
10
+ info: "info",
11
+ warn: "warn",
12
+ error: "error",
13
+ fatal: "error"
14
+ };
15
+ const enabled = typeof window !== "undefined" && !!window.localStorage.getItem("SL_DEBUG");
16
+ function createLogFn(consoleFn, prefix) {
17
+ if (!enabled)
18
+ return () => {
19
+ };
20
+ return (...args) => {
21
+ if (args.length === 0)
22
+ return;
23
+ if (typeof args[0] === "string") {
24
+ consoleFn(`[${prefix}]`, ...args);
25
+ } else {
26
+ const [obj, ...rest] = args;
27
+ consoleFn(`[${prefix}]`, ...rest, obj);
28
+ }
29
+ };
30
+ }
31
+ function createLoggerInstance(bindings) {
32
+ const prefix = bindings.name || "app";
33
+ const instance = {
34
+ level: "trace",
35
+ child(childBindings, _options) {
36
+ return createLoggerInstance({ ...bindings, ...childBindings });
37
+ }
38
+ };
39
+ for (const level of LEVELS) {
40
+ const method = LEVEL_MAP[level];
41
+ const consoleFn = (...a) => console[method](...a);
42
+ instance[level] = createLogFn(consoleFn, prefix);
43
+ }
44
+ return instance;
45
+ }
46
+ const rootLogger = createLoggerInstance({});
47
+ const createLogger = (name, options) => rootLogger.child({ name }, options);
48
+ class EventBusEvent extends Event {
49
+ constructor(name, payload) {
50
+ super(name);
51
+ __publicField(this, "slEventBus");
52
+ this.slEventBus = payload;
53
+ }
54
+ }
55
+ const logger = createLogger("event-bus");
56
+ class EventBus {
57
+ constructor(name = "sl-event-bus") {
58
+ __publicField(this, "name");
59
+ __publicField(this, "listeners");
60
+ __publicField(this, "emit", (type, payload) => {
61
+ const event = new EventBusEvent(this.name, { ...payload, type });
62
+ logger.debug(event, "Emitting event");
63
+ window.dispatchEvent(event);
64
+ });
65
+ __publicField(this, "destroy", () => {
66
+ this.listeners.forEach((listener) => {
67
+ window.removeEventListener(this.name, listener);
68
+ this.listeners.delete(listener);
69
+ });
70
+ this.listeners.clear();
71
+ });
72
+ this.name = name;
73
+ this.listeners = /* @__PURE__ */ new Set();
74
+ }
75
+ listen(listener) {
76
+ window.addEventListener(this.name, listener);
77
+ this.listeners.add(listener);
78
+ return () => {
79
+ this.off(listener);
80
+ };
81
+ }
82
+ off(listener) {
83
+ window.removeEventListener(this.name, listener);
84
+ this.listeners.delete(listener);
85
+ }
86
+ }
87
+ window.slStore = /* @__PURE__ */ Object.create(null);
88
+ var FeatureSource;
89
+ (function(FeatureSource2) {
90
+ FeatureSource2["ORGANIZATION"] = "ORGANIZATION";
91
+ FeatureSource2["STREAM"] = "STREAM";
92
+ })(FeatureSource || (FeatureSource = {}));
93
+ ({
94
+ [SdkOverlayType.BETTING]: "betting",
95
+ [SdkOverlayType.GAMES]: "games",
96
+ [SdkOverlayType.PUBLIC_CHAT]: "publicChat",
97
+ [SdkOverlayType.TWITTER]: "twitter"
98
+ });
99
+ var FeatureStatus;
100
+ (function(FeatureStatus2) {
101
+ FeatureStatus2["Ready"] = "ready";
102
+ FeatureStatus2["Suspended"] = "suspended";
103
+ })(FeatureStatus || (FeatureStatus = {}));
104
+ export {
105
+ EventBus as E,
106
+ FeatureStatus as F,
107
+ createLogger as c
108
+ };
@@ -1,4 +1,4 @@
1
- import { B as f } from "./index2.js";
1
+ import { B } from "./index2.js";
2
2
  export {
3
- f as default
3
+ B as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { C as f } from "./masters2.js";
1
+ import { C } from "./masters2.js";
2
2
  export {
3
- f as default
3
+ C as default
4
4
  };
@@ -0,0 +1,98 @@
1
+ import { createContext, useEffect, useRef, useMemo, useContext, useState } from "react";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { $ } from "./useStreamLayerApp2.js";
4
+ const j = ({
5
+ event: e,
6
+ internal: o
7
+ }) => {
8
+ const r = B(), s = G();
9
+ return useEffect(() => {
10
+ r && (e && (r.createEventSession(e, o), s && (s.current = e)), !e && (s != null && s.current) && (r.createEventSession("", o), s.current = ""));
11
+ }, [e, o, s, r]), null;
12
+ };
13
+ var Y = /* @__PURE__ */ ((e) => (e[e.UNSET = 0] = "UNSET", e[e.CONNECTED = 1] = "CONNECTED", e[e.READY = 2] = "READY", e))(Y || {});
14
+ const w = {
15
+ status: 0,
16
+ sdk: null
17
+ }, i = createContext(w), q = ({
18
+ sdkKey: e,
19
+ theme: o,
20
+ themeMode: r,
21
+ plugins: s,
22
+ children: f,
23
+ event: p,
24
+ production: x = true,
25
+ autoEnable: K = true,
26
+ withAdNotification: N,
27
+ withAd: C = true,
28
+ betPack: a = false,
29
+ hideFriends: T,
30
+ skipOnboarding: S,
31
+ friendsTab: E = "enabled",
32
+ onDeepLinkHandled: u,
33
+ videoPlayerController: c,
34
+ onContentActivate: U,
35
+ containerId: h,
36
+ webOS: y
37
+ }) => {
38
+ const t = $({
39
+ sdkKey: e,
40
+ plugins: s,
41
+ production: x,
42
+ autoEnable: K,
43
+ onDeepLinkHandled: u,
44
+ videoPlayerController: c,
45
+ onContentActivate: U,
46
+ hideFriends: T,
47
+ skipOnboarding: S,
48
+ withAdNotification: N,
49
+ withAd: C,
50
+ friendsTab: E,
51
+ betPack: a,
52
+ webOS: y
53
+ }), l = useRef(""), D = useMemo(() => t ? { sdk: t, status: 2, event: l } : { status: 1, sdk: null, event: l }, [t]);
54
+ return useEffect(() => {
55
+ t && (t.options.setKey("friendsTab", E), t.options.setKey("theme", o), t.options.setKey("themeMode", r), t.options.setKey("skipOnboarding", S), t.options.setKey("betPack", a), t.options.setKey("containerId", h));
56
+ }, [t, E, o, r, S, a, h]), useEffect(() => () => {
57
+ u && (t == null || t.removeDeepLinkHandler(u)), c && (t == null || t.removeVideoPlayerController(c));
58
+ }, [t]), useEffect(() => {
59
+ localStorage.getItem("SL_DEBUG") && console.log("StreamLayerProvider mounted with props:", {
60
+ sdkKey: !!e,
61
+ onDeepLinkHandled: !!u,
62
+ videoPlayerController: !!c
63
+ });
64
+ }, [e, u, c]), /* @__PURE__ */ jsxs(i.Provider, { value: D, children: [
65
+ p !== void 0 && /* @__PURE__ */ jsx(j, { event: p }),
66
+ f
67
+ ] });
68
+ }, B = () => {
69
+ const { sdk: e } = useContext(i);
70
+ return e;
71
+ }, G = () => {
72
+ const { event: e } = useContext(i);
73
+ return e;
74
+ }, z = () => {
75
+ const { sdk: e } = useContext(i), [o, r] = useState({});
76
+ return useEffect(() => {
77
+ var s;
78
+ return e != null && e.options ? (s = e == null ? void 0 : e.options) == null ? void 0 : s.subscribe((f) => {
79
+ r({ theme: f.theme, themeMode: f.themeMode });
80
+ }) : () => {
81
+ };
82
+ }, [e == null ? void 0 : e.options]), o;
83
+ }, F = () => {
84
+ const { sdk: e } = useContext(i), [o, r] = useState({});
85
+ return useEffect(() => e != null && e.uiState ? e == null ? void 0 : e.uiState.subscribe((s) => {
86
+ r({ ...s });
87
+ }) : () => {
88
+ }, [e == null ? void 0 : e.uiState]), o;
89
+ };
90
+ export {
91
+ B,
92
+ F,
93
+ Y,
94
+ i,
95
+ j,
96
+ q,
97
+ z
98
+ };