@streamlayer/react 1.23.2 → 1.24.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 (174) hide show
  1. package/lib/app/masters.d.ts +0 -1
  2. package/lib/cjs/Question.js +1 -1
  3. package/lib/cjs/advertisement.js +203 -28
  4. package/lib/cjs/analytics.js +1 -1
  5. package/lib/cjs/auth.js +1 -1
  6. package/lib/cjs/bet-pack.js +1 -1
  7. package/lib/cjs/feature.js +1 -1
  8. package/lib/cjs/gamification-feature.js +1 -1
  9. package/lib/cjs/gamification-feature2.js +1 -1
  10. package/lib/cjs/hooks-n9ax4LRT.js +1 -0
  11. package/lib/cjs/index-ByUNFvMk.js +5 -0
  12. package/lib/cjs/index.js +1 -1
  13. package/lib/cjs/index10.js +1 -1
  14. package/lib/cjs/index11.js +1 -3
  15. package/lib/cjs/index12.js +1 -1
  16. package/lib/cjs/index13.js +1 -3
  17. package/lib/cjs/index14.js +4 -1
  18. package/lib/cjs/index15.js +1 -1
  19. package/lib/cjs/index16.js +5 -3
  20. package/lib/cjs/index2.js +1 -1
  21. package/lib/cjs/index3.js +1 -1
  22. package/lib/cjs/index4.js +5 -3
  23. package/lib/cjs/index5.js +1 -1
  24. package/lib/cjs/index6.js +1 -1
  25. package/lib/cjs/index7.js +1 -1
  26. package/lib/cjs/index8.js +1 -1
  27. package/lib/cjs/index9.js +7 -1
  28. package/lib/cjs/insight.js +1 -1
  29. package/lib/cjs/masters.js +1 -1
  30. package/lib/cjs/masters2.js +8 -1
  31. package/lib/cjs/notification.js +1 -1
  32. package/lib/cjs/pause-ad.js +1 -1
  33. package/lib/cjs/points.js +1 -1
  34. package/lib/cjs/polymarket.js +14 -9
  35. package/lib/cjs/sl-types.js +1 -1
  36. package/lib/cjs/storage.js +1 -1
  37. package/lib/cjs/theme.js +1 -1
  38. package/lib/cjs/useStreamLayerApp.js +1 -1
  39. package/lib/cjs/useStreamLayerApp2.js +17 -3
  40. package/lib/cjs/utils.js +47 -1
  41. package/lib/classic/app/masters.d.ts +0 -1
  42. package/lib/classic/cjs/Question.js +1 -1
  43. package/lib/classic/cjs/advertisement.js +203 -28
  44. package/lib/classic/cjs/analytics.js +1 -1
  45. package/lib/classic/cjs/auth.js +1 -1
  46. package/lib/classic/cjs/bet-pack.js +5 -3
  47. package/lib/classic/cjs/feature.js +1 -1
  48. package/lib/classic/cjs/gamification-feature.js +1 -1
  49. package/lib/classic/cjs/hooks-n9ax4LRT.js +1 -0
  50. package/lib/classic/cjs/index-ByUNFvMk.js +5 -0
  51. package/lib/classic/cjs/index.js +1 -1
  52. package/lib/classic/cjs/index10.js +1 -1
  53. package/lib/classic/cjs/index11.js +1 -1
  54. package/lib/classic/cjs/index12.js +1 -1
  55. package/lib/classic/cjs/index13.js +4 -3
  56. package/lib/classic/cjs/index2.js +5 -3
  57. package/lib/classic/cjs/index3.js +1 -1
  58. package/lib/classic/cjs/index4.js +1 -1
  59. package/lib/classic/cjs/index5.js +1 -1
  60. package/lib/classic/cjs/index6.js +1 -1
  61. package/lib/classic/cjs/index7.js +7 -1
  62. package/lib/classic/cjs/index8.js +1 -1
  63. package/lib/classic/cjs/index9.js +1 -3
  64. package/lib/classic/cjs/insight.js +1 -1
  65. package/lib/classic/cjs/notification.js +1 -1
  66. package/lib/classic/cjs/notification2.js +1 -1
  67. package/lib/classic/cjs/pause-ad.js +1 -1
  68. package/lib/classic/cjs/points.js +1 -1
  69. package/lib/classic/cjs/polymarket.js +14 -9
  70. package/lib/classic/cjs/sl-types.js +1 -1
  71. package/lib/classic/cjs/useStreamLayerApp.js +1 -1
  72. package/lib/classic/cjs/useStreamLayerApp2.js +17 -3
  73. package/lib/classic/cjs/utils.js +47 -1
  74. package/lib/classic/es/Question.js +258 -275
  75. package/lib/classic/es/advertisement.js +22128 -38694
  76. package/lib/classic/es/analytics.js +55 -57
  77. package/lib/classic/es/auth.js +8 -14
  78. package/lib/classic/es/bet-pack.js +2413 -2455
  79. package/lib/classic/es/feature.js +46 -95
  80. package/lib/classic/es/gamification-feature.js +2 -2
  81. package/lib/classic/es/hooks-n9ax4LRT.js +97 -0
  82. package/lib/classic/es/index-ByUNFvMk.js +3775 -0
  83. package/lib/classic/es/index.js +13 -16
  84. package/lib/classic/es/index10.js +2587 -83
  85. package/lib/classic/es/index11.js +305 -3087
  86. package/lib/classic/es/index12.js +121 -124
  87. package/lib/classic/es/index13.js +559 -589
  88. package/lib/classic/es/index2.js +1755 -2114
  89. package/lib/classic/es/index3.js +13 -13
  90. package/lib/classic/es/index4.js +4 -283
  91. package/lib/classic/es/index5.js +5 -5
  92. package/lib/classic/es/index6.js +285 -10
  93. package/lib/classic/es/index7.js +179 -6
  94. package/lib/classic/es/index8.js +5 -10
  95. package/lib/classic/es/index9.js +8 -318
  96. package/lib/classic/es/insight.js +54 -61
  97. package/lib/classic/es/notification.js +5 -5
  98. package/lib/classic/es/notification2.js +730 -787
  99. package/lib/classic/es/pause-ad.js +168 -191
  100. package/lib/classic/es/points.js +47 -55
  101. package/lib/classic/es/polymarket.js +4058 -4289
  102. package/lib/classic/es/sl-types.js +128 -298
  103. package/lib/classic/es/useStreamLayerApp.js +2 -2
  104. package/lib/classic/es/useStreamLayerApp2.js +9090 -11121
  105. package/lib/classic/es/utils.js +28 -28
  106. package/lib/classic/index.d.ts +0 -1
  107. package/lib/classic/source.css +110 -0
  108. package/lib/dist/cjs/gamification-feature.js +1 -1
  109. package/lib/dist/cjs/index-ByUNFvMk.js +5 -0
  110. package/lib/dist/cjs/index.js +1 -1
  111. package/lib/dist/cjs/masters.js +69 -3
  112. package/lib/dist/es/gamification-feature.js +2 -2
  113. package/lib/dist/es/index-ByUNFvMk.js +3775 -0
  114. package/lib/dist/es/index.js +7 -10
  115. package/lib/dist/es/masters.js +16944 -19645
  116. package/lib/dist/index.d.ts +7 -17
  117. package/lib/dist/source.css +64 -0
  118. package/lib/es/Question.js +101 -105
  119. package/lib/es/advertisement.js +22128 -38694
  120. package/lib/es/analytics.js +55 -57
  121. package/lib/es/auth.js +8 -14
  122. package/lib/es/bet-pack.js +18 -29
  123. package/lib/es/feature.js +46 -95
  124. package/lib/es/gamification-feature.js +2 -2
  125. package/lib/es/gamification-feature2.js +2 -2
  126. package/lib/es/hooks-n9ax4LRT.js +97 -0
  127. package/lib/es/index-ByUNFvMk.js +3775 -0
  128. package/lib/es/index.js +13 -17
  129. package/lib/es/index10.js +8 -274
  130. package/lib/es/index11.js +172 -837
  131. package/lib/es/index12.js +2587 -183
  132. package/lib/es/index13.js +258 -314
  133. package/lib/es/index14.js +813 -81
  134. package/lib/es/index15.js +305 -3087
  135. package/lib/es/index16.js +803 -1005
  136. package/lib/es/index2.js +980 -1133
  137. package/lib/es/index3.js +4 -3
  138. package/lib/es/index4.js +2401 -2431
  139. package/lib/es/index5.js +13 -13
  140. package/lib/es/index6.js +5 -285
  141. package/lib/es/index7.js +7 -10
  142. package/lib/es/index8.js +283 -5
  143. package/lib/es/index9.js +180 -10
  144. package/lib/es/insight.js +54 -61
  145. package/lib/es/masters.js +5 -7
  146. package/lib/es/masters2.js +538 -708
  147. package/lib/es/notification.js +663 -719
  148. package/lib/es/pause-ad.js +168 -191
  149. package/lib/es/points.js +48 -56
  150. package/lib/es/polymarket.js +4058 -4289
  151. package/lib/es/sl-types.js +128 -317
  152. package/lib/es/storage.js +74 -75
  153. package/lib/es/theme.js +3 -190
  154. package/lib/es/useStreamLayerApp.js +2 -2
  155. package/lib/es/useStreamLayerApp2.js +9090 -11121
  156. package/lib/es/utils.js +28 -28
  157. package/lib/index.d.ts +0 -1
  158. package/lib/source.css +120 -0
  159. package/lib/style.css +1 -1
  160. package/package.json +21 -24
  161. package/lib/cjs/hooks-WfHlJH12.js +0 -1
  162. package/lib/cjs/index-eShKGO10.js +0 -1
  163. package/lib/cjs/style.css +0 -1
  164. package/lib/classic/cjs/hooks-WfHlJH12.js +0 -1
  165. package/lib/classic/cjs/index-eShKGO10.js +0 -1
  166. package/lib/classic/cjs/style.css +0 -1
  167. package/lib/classic/es/hooks-WfHlJH12.js +0 -98
  168. package/lib/classic/es/index-eShKGO10.js +0 -3757
  169. package/lib/classic/style.css +0 -1
  170. package/lib/dist/cjs/index-eShKGO10.js +0 -1
  171. package/lib/dist/es/index-eShKGO10.js +0 -3757
  172. package/lib/dist/style.css +0 -1
  173. package/lib/es/hooks-WfHlJH12.js +0 -98
  174. package/lib/es/index-eShKGO10.js +0 -3757
@@ -1,86 +1,84 @@
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 = {
1
+ import { useEffect as c } from "react";
2
+ import { e as s } from "./index3.js";
3
+ import { A as v } from "./index9.js";
4
+ let i = [], r = 0;
5
+ const u = 4, d = /* @__NO_SIDE_EFFECTS__ */ (a) => {
6
+ let e = [], t = {
7
7
  get() {
8
- return e.lc || e.listen(() => {
9
- })(), e.value;
8
+ return t.lc || t.listen(() => {
9
+ })(), t.value;
10
10
  },
11
11
  lc: 0,
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());
12
+ listen(n) {
13
+ return t.lc = e.push(n), () => {
14
+ for (let o = r + u; o < i.length; )
15
+ i[o] === n ? i.splice(o, u) : o += u;
16
+ let l = e.indexOf(n);
17
+ ~l && (e.splice(l, 1), --t.lc || t.off());
18
18
  };
19
19
  },
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]
20
+ notify(n, l) {
21
+ let o = !i.length;
22
+ for (let f of e)
23
+ i.push(f, t.value, n, l);
24
+ if (o) {
25
+ for (r = 0; r < i.length; r += u)
26
+ i[r](
27
+ i[r + 1],
28
+ i[r + 2],
29
+ i[r + 3]
30
30
  );
31
- t.length = 0;
31
+ i.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(l) {
39
- let n = e.value;
40
- n !== l && (e.value = l, e.notify(n));
38
+ set(n) {
39
+ let l = t.value;
40
+ l !== n && (t.value = n, t.notify(l));
41
41
  },
42
- subscribe(l) {
43
- let n = e.listen(l);
44
- return l(e.value), n;
42
+ subscribe(n) {
43
+ let l = t.listen(n);
44
+ return n(t.value), l;
45
45
  },
46
- value: r
46
+ value: a
47
47
  };
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) {
48
+ return t;
49
+ }, b = /* @__NO_SIDE_EFFECTS__ */ (a = {}) => {
50
+ let e = /* @__PURE__ */ d(a);
51
+ return e.setKey = function(t, n) {
53
52
  let l = 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 = {
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 = {
55
54
  ...e.value,
56
- [a2]: t2
57
- }, e.notify(l, a2));
55
+ [t]: n
56
+ }, e.notify(l, t));
58
57
  }, e;
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", {
58
+ }, y = (a) => [(e) => (...t) => (a && s.emit(a?.type, a), e ? e(t) : null)], h = (a) => {
59
+ const e = a.target;
60
+ e instanceof HTMLAnchorElement && e.target === "_blank" && e.getAttribute("data-a") === "web-link" && s.emit("poll", {
63
61
  action: "navigated",
64
62
  payload: {}
65
- }), e instanceof Element && e.getAttribute("data-a") === "intr" && eventBus.emit("interactions", {
63
+ }), e instanceof Element && e.getAttribute("data-a") === "intr" && s.emit("interactions", {
66
64
  action: "tap",
67
65
  payload: {}
68
66
  });
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);
67
+ }, A = (a, e) => {
68
+ const t = window.innerWidth < v.xl;
69
+ c(() => {
70
+ const n = t && e.useDomNode ? document : a.current, l = (o) => {
71
+ e.listener(o, a);
74
72
  };
75
- return e.enabled && (n == null || n.addEventListener(e.event, i2)), () => {
76
- n == null || n.removeEventListener(e.event, i2);
73
+ return e.enabled && n?.addEventListener(e.event, l), () => {
74
+ n?.removeEventListener(e.event, l);
77
75
  };
78
- }, [r, e.enabled, e.listener]);
76
+ }, [t, e.enabled, e.listener]);
79
77
  };
80
78
  export {
81
79
  A,
82
- f as a,
83
- b,
84
- a as c,
85
- f$1 as f
80
+ h as a,
81
+ d as b,
82
+ b as f,
83
+ y as u
86
84
  };
package/lib/es/auth.js CHANGED
@@ -1,17 +1,11 @@
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;
1
+ import { useEffect as o } from "react";
2
+ import { Y as f } from "./hooks-n9ax4LRT.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;
14
8
  };
15
9
  export {
16
- StreamLayerLogin
10
+ p as StreamLayerLogin
17
11
  };
@@ -1,32 +1,21 @@
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 });
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { e as i } from "./index3.js";
3
+ import { useEffect as n } from "react";
4
+ import "./sl-types.js";
5
+ import { D as c } from "./index4.js";
6
+ import { Y as m } from "./hooks-n9ax4LRT.js";
7
+ const r = (t) => {
8
+ const e = t.target;
9
+ e instanceof Element && e.getAttribute("data-a") === "intr" && i.emit("interactions", {
10
+ action: "tap",
11
+ payload: {}
12
+ });
13
+ }, l = () => {
14
+ const t = m();
15
+ return n(() => (document?.addEventListener("click", r), () => {
16
+ document?.removeEventListener("click", r);
17
+ }), []), t ? /* @__PURE__ */ o(c, { sdk: t }) : null;
29
18
  };
30
19
  export {
31
- BetPackProvider
20
+ l as BetPackProvider
32
21
  };
package/lib/es/feature.js CHANGED
@@ -1,108 +1,59 @@
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);
1
+ import { pino as a } from "pino";
4
2
  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 });
3
+ import "nanostores";
4
+ import { S as s } from "./useStreamLayerApp2.js";
5
+ const d = a({
6
+ level: "trace",
7
+ enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
8
+ browser: {
9
+ write: (t) => {
10
+ console.log(t);
37
11
  }
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
12
  }
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;
13
+ }), l = (t, e) => d.child({ name: t }, e);
14
+ class c extends Event {
15
+ slEventBus;
16
+ constructor(e, n) {
17
+ super(e), this.slEventBus = n;
53
18
  }
54
19
  }
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();
20
+ const v = l("event-bus");
21
+ class h {
22
+ name;
23
+ listeners;
24
+ constructor(e = "sl-event-bus") {
25
+ this.name = e, this.listeners = /* @__PURE__ */ new Set();
74
26
  }
75
- listen(listener) {
76
- window.addEventListener(this.name, listener);
77
- this.listeners.add(listener);
78
- return () => {
79
- this.off(listener);
27
+ emit = (e, n) => {
28
+ const i = new c(this.name, { ...n, type: e });
29
+ v.debug(i, "Emitting event"), window.dispatchEvent(i);
30
+ };
31
+ listen(e) {
32
+ return window.addEventListener(this.name, e), this.listeners.add(e), () => {
33
+ this.off(e);
80
34
  };
81
35
  }
82
- off(listener) {
83
- window.removeEventListener(this.name, listener);
84
- this.listeners.delete(listener);
36
+ off(e) {
37
+ window.removeEventListener(this.name, e), this.listeners.delete(e);
85
38
  }
39
+ destroy = () => {
40
+ this.listeners.forEach((e) => {
41
+ window.removeEventListener(this.name, e), this.listeners.delete(e);
42
+ }), this.listeners.clear();
43
+ };
86
44
  }
87
45
  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 = {}));
46
+ var o;
47
+ (function(t) {
48
+ t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
49
+ })(o || (o = {}));
50
+ s.BETTING + "", s.GAMES + "", s.PUBLIC_CHAT + "", s.TWITTER + "";
51
+ var r;
52
+ (function(t) {
53
+ t.Ready = "ready", t.Suspended = "suspended";
54
+ })(r || (r = {}));
104
55
  export {
105
- EventBus as E,
106
- FeatureStatus as F,
107
- createLogger as c
56
+ h as E,
57
+ r as F,
58
+ l as c
108
59
  };
@@ -1,4 +1,4 @@
1
- import { B } from "./index2.js";
1
+ import { B as f } from "./index2.js";
2
2
  export {
3
- B as default
3
+ f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { C } from "./masters2.js";
1
+ import { C as f } from "./masters2.js";
2
2
  export {
3
- C as default
3
+ f as default
4
4
  };
@@ -0,0 +1,97 @@
1
+ import { useRef as w, useMemo as A, useEffect as r, useContext as l, useState as b, createContext as N } from "react";
2
+ import { jsxs as O, jsx as T } from "react/jsx-runtime";
3
+ import { z as L } from "./useStreamLayerApp2.js";
4
+ const x = ({
5
+ event: e,
6
+ internal: i
7
+ }) => {
8
+ const o = j(), n = I();
9
+ return r(() => {
10
+ o && (e && (o.createEventSession(e, i), n && (n.current = e)), !e && n?.current && (o.createEventSession("", i), n.current = ""));
11
+ }, [e, i, n, o]), null;
12
+ };
13
+ var M = /* @__PURE__ */ ((e) => (e[e.UNSET = 0] = "UNSET", e[e.CONNECTED = 1] = "CONNECTED", e[e.READY = 2] = "READY", e))(M || {});
14
+ const H = {
15
+ status: 0,
16
+ sdk: null
17
+ }, d = N(H), F = ({
18
+ sdkKey: e,
19
+ theme: i,
20
+ themeMode: o,
21
+ plugins: n,
22
+ children: h,
23
+ event: v,
24
+ production: y = !0,
25
+ autoEnable: f = !0,
26
+ withAdNotification: C,
27
+ withAd: E = !0,
28
+ betPack: u = !1,
29
+ hideFriends: S,
30
+ skipOnboarding: c,
31
+ friendsTab: p = "enabled",
32
+ onDeepLinkHandled: s,
33
+ videoPlayerController: a,
34
+ onContentActivate: g,
35
+ containerId: k,
36
+ webOS: D,
37
+ gamification: K
38
+ }) => {
39
+ const t = L({
40
+ sdkKey: e,
41
+ plugins: n,
42
+ production: y,
43
+ autoEnable: f,
44
+ onDeepLinkHandled: s,
45
+ videoPlayerController: a,
46
+ onContentActivate: g,
47
+ hideFriends: S,
48
+ skipOnboarding: c,
49
+ withAdNotification: C,
50
+ withAd: E,
51
+ friendsTab: p,
52
+ betPack: u,
53
+ webOS: D,
54
+ gamification: K
55
+ }), m = w(""), P = A(() => t ? { sdk: t, status: 2, event: m } : { status: 1, sdk: null, event: m }, [t]);
56
+ return r(() => {
57
+ t && (t.options.setKey("friendsTab", p), t.options.setKey("theme", i), t.options.setKey("themeMode", o), t.options.setKey("skipOnboarding", c), t.options.setKey("betPack", u), t.options.setKey("containerId", k));
58
+ }, [t, p, i, o, c, u, k]), r(() => () => {
59
+ s && t?.removeDeepLinkHandler(s), a && t?.removeVideoPlayerController(a);
60
+ }, [t]), r(() => {
61
+ localStorage.getItem("SL_DEBUG") && console.log("StreamLayerProvider mounted with props:", {
62
+ sdkKey: !!e,
63
+ onDeepLinkHandled: !!s,
64
+ videoPlayerController: !!a
65
+ });
66
+ }, [e, s, a]), /* @__PURE__ */ O(d.Provider, { value: P, children: [
67
+ v !== void 0 && /* @__PURE__ */ T(x, { event: v }),
68
+ h
69
+ ] });
70
+ }, j = () => {
71
+ const { sdk: e } = l(d);
72
+ return e;
73
+ }, I = () => {
74
+ const { event: e } = l(d);
75
+ return e;
76
+ }, V = () => {
77
+ const { sdk: e } = l(d), [i, o] = b({});
78
+ return r(() => e?.options ? e?.options?.subscribe((n) => {
79
+ o({ theme: n.theme, themeMode: n.themeMode });
80
+ }) : () => {
81
+ }, [e?.options]), i;
82
+ }, _ = () => {
83
+ const { sdk: e } = l(d), [i, o] = b({});
84
+ return r(() => e?.uiState ? e?.uiState.subscribe((n) => {
85
+ o({ ...n });
86
+ }) : () => {
87
+ }, [e?.uiState]), i;
88
+ };
89
+ export {
90
+ F as V,
91
+ j as Y,
92
+ V as _,
93
+ x as g,
94
+ d as i,
95
+ M as j,
96
+ _ as q
97
+ };