@streamlayer/react 1.24.6 → 1.24.8

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 (155) hide show
  1. package/lib/cjs/advertisement.js +19606 -203
  2. package/lib/cjs/auth.js +4459 -1
  3. package/lib/cjs/bet-pack.js +15690 -1
  4. package/lib/cjs/index.js +19410 -1
  5. package/lib/cjs/insight.js +13508 -1
  6. package/lib/cjs/masters.js +20695 -1
  7. package/lib/cjs/notification.js +13086 -1
  8. package/lib/cjs/package.json +1 -0
  9. package/lib/cjs/pause-ad.js +8390 -1
  10. package/lib/cjs/points.js +7188 -1
  11. package/lib/cjs/polyfills.js +69 -0
  12. package/lib/cjs/polymarket.js +16394 -14
  13. package/lib/cjs/style.css +1 -0
  14. package/lib/cjs/useStreamLayerApp.js +4711 -1
  15. package/lib/dist/cjs/index.js +20695 -1
  16. package/lib/dist/es/index.js +20668 -10
  17. package/lib/dist/es/polyfills.js +92 -0
  18. package/lib/es/advertisement.js +2821 -2746
  19. package/lib/es/analytics.js +1 -1
  20. package/lib/es/feature.js +60 -56
  21. package/lib/es/index10.js +181 -7
  22. package/lib/es/index11.js +371 -181
  23. package/lib/es/index12.js +19 -19
  24. package/lib/es/index13.js +44 -44
  25. package/lib/es/index14.js +30 -30
  26. package/lib/es/index15.js +384 -414
  27. package/lib/es/index16.js +66 -67
  28. package/lib/es/index2.js +35 -38
  29. package/lib/es/index3.js +34 -4
  30. package/lib/es/index4.js +3 -3
  31. package/lib/es/index5.js +270 -16
  32. package/lib/es/index6.js +0 -1
  33. package/lib/es/index8.js +236 -281
  34. package/lib/es/index9.js +8 -179
  35. package/lib/es/masters2.js +33 -34
  36. package/lib/es/notification.js +25 -25
  37. package/lib/es/points.js +10 -10
  38. package/lib/es/storage.js +14 -14
  39. package/lib/es/style.css +1 -0
  40. package/lib/es/useStreamLayerApp2.js +5654 -4604
  41. package/lib/source.css +1 -120
  42. package/package.json +99 -83
  43. package/lib/cjs/Question.js +0 -1
  44. package/lib/cjs/analytics.js +0 -1
  45. package/lib/cjs/feature.js +0 -1
  46. package/lib/cjs/gamification-feature.js +0 -1
  47. package/lib/cjs/gamification-feature2.js +0 -1
  48. package/lib/cjs/hooks-n9ax4LRT.js +0 -1
  49. package/lib/cjs/index-CfSdnrfA.js +0 -5
  50. package/lib/cjs/index10.js +0 -1
  51. package/lib/cjs/index11.js +0 -1
  52. package/lib/cjs/index12.js +0 -1
  53. package/lib/cjs/index13.js +0 -4
  54. package/lib/cjs/index14.js +0 -1
  55. package/lib/cjs/index15.js +0 -1
  56. package/lib/cjs/index16.js +0 -5
  57. package/lib/cjs/index2.js +0 -1
  58. package/lib/cjs/index3.js +0 -1
  59. package/lib/cjs/index4.js +0 -5
  60. package/lib/cjs/index5.js +0 -1
  61. package/lib/cjs/index6.js +0 -1
  62. package/lib/cjs/index7.js +0 -1
  63. package/lib/cjs/index8.js +0 -1
  64. package/lib/cjs/index9.js +0 -7
  65. package/lib/cjs/masters2.js +0 -8
  66. package/lib/cjs/storage.js +0 -1
  67. package/lib/cjs/theme.js +0 -1
  68. package/lib/cjs/useStreamLayerApp2.js +0 -17
  69. package/lib/cjs/utils.js +0 -47
  70. package/lib/classic/app/advertisement.d.ts +0 -19
  71. package/lib/classic/app/app.d.ts +0 -23
  72. package/lib/classic/app/auth.d.ts +0 -4
  73. package/lib/classic/app/bet-pack.d.ts +0 -10
  74. package/lib/classic/app/insight.d.ts +0 -13
  75. package/lib/classic/app/masters.d.ts +0 -19
  76. package/lib/classic/app/notification.d.ts +0 -5
  77. package/lib/classic/app/pause-ad.d.ts +0 -27
  78. package/lib/classic/app/points.d.ts +0 -3
  79. package/lib/classic/app/polymarket.d.ts +0 -7
  80. package/lib/classic/app/useStreamLayerApp.d.ts +0 -1
  81. package/lib/classic/cjs/Question.js +0 -1
  82. package/lib/classic/cjs/advertisement.js +0 -203
  83. package/lib/classic/cjs/analytics.js +0 -1
  84. package/lib/classic/cjs/auth.js +0 -1
  85. package/lib/classic/cjs/bet-pack.js +0 -5
  86. package/lib/classic/cjs/feature.js +0 -1
  87. package/lib/classic/cjs/gamification-feature.js +0 -1
  88. package/lib/classic/cjs/hooks-n9ax4LRT.js +0 -1
  89. package/lib/classic/cjs/index-CfSdnrfA.js +0 -5
  90. package/lib/classic/cjs/index.js +0 -1
  91. package/lib/classic/cjs/index10.js +0 -1
  92. package/lib/classic/cjs/index11.js +0 -1
  93. package/lib/classic/cjs/index12.js +0 -1
  94. package/lib/classic/cjs/index13.js +0 -4
  95. package/lib/classic/cjs/index2.js +0 -5
  96. package/lib/classic/cjs/index3.js +0 -1
  97. package/lib/classic/cjs/index4.js +0 -1
  98. package/lib/classic/cjs/index5.js +0 -1
  99. package/lib/classic/cjs/index6.js +0 -1
  100. package/lib/classic/cjs/index7.js +0 -7
  101. package/lib/classic/cjs/index8.js +0 -1
  102. package/lib/classic/cjs/index9.js +0 -1
  103. package/lib/classic/cjs/insight.js +0 -1
  104. package/lib/classic/cjs/notification.js +0 -1
  105. package/lib/classic/cjs/notification2.js +0 -1
  106. package/lib/classic/cjs/pause-ad.js +0 -1
  107. package/lib/classic/cjs/points.js +0 -1
  108. package/lib/classic/cjs/polymarket.js +0 -14
  109. package/lib/classic/cjs/useStreamLayerApp.js +0 -1
  110. package/lib/classic/cjs/useStreamLayerApp2.js +0 -17
  111. package/lib/classic/cjs/utils.js +0 -47
  112. package/lib/classic/es/Question.js +0 -503
  113. package/lib/classic/es/advertisement.js +0 -38792
  114. package/lib/classic/es/analytics.js +0 -84
  115. package/lib/classic/es/auth.js +0 -11
  116. package/lib/classic/es/bet-pack.js +0 -3418
  117. package/lib/classic/es/feature.js +0 -210
  118. package/lib/classic/es/gamification-feature.js +0 -4
  119. package/lib/classic/es/hooks-n9ax4LRT.js +0 -97
  120. package/lib/classic/es/index.js +0 -15
  121. package/lib/classic/es/index10.js +0 -321
  122. package/lib/classic/es/index11.js +0 -2592
  123. package/lib/classic/es/index12.js +0 -185
  124. package/lib/classic/es/index13.js +0 -820
  125. package/lib/classic/es/index2.js +0 -2605
  126. package/lib/classic/es/index3.js +0 -19
  127. package/lib/classic/es/index4.js +0 -6
  128. package/lib/classic/es/index5.js +0 -4
  129. package/lib/classic/es/index6.js +0 -285
  130. package/lib/classic/es/index7.js +0 -181
  131. package/lib/classic/es/index8.js +0 -7
  132. package/lib/classic/es/index9.js +0 -11
  133. package/lib/classic/es/insight.js +0 -79
  134. package/lib/classic/es/notification.js +0 -9
  135. package/lib/classic/es/notification2.js +0 -1126
  136. package/lib/classic/es/pause-ad.js +0 -232
  137. package/lib/classic/es/points.js +0 -76
  138. package/lib/classic/es/polymarket.js +0 -6617
  139. package/lib/classic/es/useStreamLayerApp.js +0 -4
  140. package/lib/classic/es/useStreamLayerApp2.js +0 -11627
  141. package/lib/classic/es/utils.js +0 -76
  142. package/lib/classic/index.d.ts +0 -6
  143. package/lib/classic/masters.d.ts +0 -8
  144. package/lib/classic/source.css +0 -110
  145. package/lib/dist/cjs/gamification-feature.js +0 -1
  146. package/lib/dist/cjs/index-CfSdnrfA.js +0 -5
  147. package/lib/dist/cjs/masters.js +0 -69
  148. package/lib/dist/es/gamification-feature.js +0 -4
  149. package/lib/dist/es/index-CfSdnrfA.js +0 -3775
  150. package/lib/dist/es/masters.js +0 -22387
  151. package/lib/dist/index.d.ts +0 -1357
  152. package/lib/dist/source.css +0 -64
  153. package/lib/es/index-CfSdnrfA.js +0 -3775
  154. package/lib/style.css +0 -1
  155. /package/lib/{classic/es/index-CfSdnrfA.js → es/index-D8wyDNJD.js} +0 -0
@@ -1,210 +0,0 @@
1
- import y, { forwardRef as A, createElement as O } from "react";
2
- import { listenKeys as _ } from "nanostores";
3
- import { pino as M } from "pino";
4
- import { S as g } from "./useStreamLayerApp2.js";
5
- var B = function() {
6
- const t = Array.prototype.slice.call(arguments).filter(Boolean), n = {}, r = [];
7
- t.forEach((a) => {
8
- (a ? a.split(" ") : []).forEach((c) => {
9
- if (c.startsWith("atm_")) {
10
- const [, p] = c.split("_");
11
- n[p] = c;
12
- } else
13
- r.push(c);
14
- });
15
- });
16
- const o = [];
17
- for (const a in n)
18
- Object.prototype.hasOwnProperty.call(n, a) && o.push(n[a]);
19
- return o.push(...r), o.join(" ");
20
- }, R = B;
21
- function D(e) {
22
- var t = /* @__PURE__ */ Object.create(null);
23
- return function(n) {
24
- return t[n] === void 0 && (t[n] = e(n)), t[n];
25
- };
26
- }
27
- var H = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, x = /* @__PURE__ */ D(
28
- function(e) {
29
- return H.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
30
- }
31
- /* Z+1 */
32
- ), j = (e) => e.toUpperCase() === e, q = (e) => (t) => e.indexOf(t) === -1, U = (e, t) => {
33
- const n = {};
34
- return Object.keys(e).filter(q(t)).forEach((r) => {
35
- n[r] = e[r];
36
- }), n;
37
- };
38
- function z(e, t, n) {
39
- const r = U(t, n);
40
- if (!e) {
41
- const o = typeof x == "function" ? { default: x } : x;
42
- Object.keys(r).forEach((a) => {
43
- o.default(a) || delete r[a];
44
- });
45
- }
46
- return r;
47
- }
48
- var V = (e, t) => {
49
- };
50
- function F(e) {
51
- let t = "";
52
- return (n) => {
53
- const r = (a, d) => {
54
- const { as: c = e, class: p = t } = a, v = n.propsAsIs === void 0 ? !(typeof c == "string" && c.indexOf("-") === -1 && !j(c[0])) : n.propsAsIs, u = z(v, a, [
55
- "as",
56
- "class"
57
- ]);
58
- u.ref = d, u.className = n.atomic ? R(n.class, u.className || p) : R(u.className || p, n.class);
59
- const { vars: i } = n;
60
- if (i) {
61
- const s = {};
62
- for (const l in i) {
63
- const h = i[l], S = h[0], N = h[1] || "", b = typeof S == "function" ? S(a) : S;
64
- V(b, n.name), s[`--${l}`] = `${b}${N}`;
65
- }
66
- const f = u.style || {}, m = Object.keys(f);
67
- m.length > 0 && m.forEach((l) => {
68
- s[l] = f[l];
69
- }), u.style = s;
70
- }
71
- return e.__wyw_meta && e !== c ? (u.as = c, O(e, u)) : O(c, u);
72
- }, o = A ? A(r) : (
73
- // React.forwardRef won't available on older React versions and in Preact
74
- // Fallback to a innerRef prop in that case
75
- ((a) => {
76
- const d = U(a, ["innerRef"]);
77
- return r(d, a.innerRef);
78
- })
79
- );
80
- return o.displayName = n.name, o.__wyw_meta = {
81
- className: n.class || t,
82
- extends: e
83
- }, o;
84
- };
85
- }
86
- var ae = F, E = { exports: {} }, k = {};
87
- var T;
88
- function G() {
89
- if (T) return k;
90
- T = 1;
91
- var e = y;
92
- function t(i, s) {
93
- return i === s && (i !== 0 || 1 / i === 1 / s) || i !== i && s !== s;
94
- }
95
- var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, o = e.useEffect, a = e.useLayoutEffect, d = e.useDebugValue;
96
- function c(i, s) {
97
- var f = s(), m = r({ inst: { value: f, getSnapshot: s } }), l = m[0].inst, h = m[1];
98
- return a(
99
- function() {
100
- l.value = f, l.getSnapshot = s, p(l) && h({ inst: l });
101
- },
102
- [i, f, s]
103
- ), o(
104
- function() {
105
- return p(l) && h({ inst: l }), i(function() {
106
- p(l) && h({ inst: l });
107
- });
108
- },
109
- [i]
110
- ), d(f), f;
111
- }
112
- function p(i) {
113
- var s = i.getSnapshot;
114
- i = i.value;
115
- try {
116
- var f = s();
117
- return !n(i, f);
118
- } catch {
119
- return !0;
120
- }
121
- }
122
- function v(i, s) {
123
- return s();
124
- }
125
- var u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : c;
126
- return k.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : u, k;
127
- }
128
- var C;
129
- function W() {
130
- return C || (C = 1, E.exports = G()), E.exports;
131
- }
132
- var $ = W();
133
- const w = (e, t) => (n) => {
134
- e.current !== n && (e.current = n, t());
135
- };
136
- function X(e, { keys: t, deps: n = [e, t] } = {}) {
137
- const r = y.useRef();
138
- r.current = e.get();
139
- const o = y.useCallback((d) => (w(r, d)(e.value), t?.length > 0 ? _(e, t, w(r, d)) : e.listen(w(r, d))), n), a = () => r.current;
140
- return y.useSyncExternalStore ? y.useSyncExternalStore(o, a, a) : $.useSyncExternalStore(o, a, a);
141
- }
142
- const ie = X, K = () => [
143
- !1,
144
- (e) => {
145
- window.requestAnimationFrame(() => e());
146
- }
147
- ], se = y.useTransition || K, Y = M({
148
- level: "trace",
149
- enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
150
- browser: {
151
- write: (e) => {
152
- console.log(e);
153
- }
154
- }
155
- }), Q = (e, t) => Y.child({ name: e }, t);
156
- class Z extends Event {
157
- slEventBus;
158
- constructor(t, n) {
159
- super(t), this.slEventBus = n;
160
- }
161
- }
162
- const J = Q("event-bus");
163
- class oe {
164
- name;
165
- listeners;
166
- constructor(t = "sl-event-bus") {
167
- this.name = t, this.listeners = /* @__PURE__ */ new Set();
168
- }
169
- emit = (t, n) => {
170
- const r = new Z(this.name, { ...n, type: t });
171
- J.debug(r, "Emitting event"), window.dispatchEvent(r);
172
- };
173
- listen(t) {
174
- return window.addEventListener(this.name, t), this.listeners.add(t), () => {
175
- this.off(t);
176
- };
177
- }
178
- off(t) {
179
- window.removeEventListener(this.name, t), this.listeners.delete(t);
180
- }
181
- destroy = () => {
182
- this.listeners.forEach((t) => {
183
- window.removeEventListener(this.name, t), this.listeners.delete(t);
184
- }), this.listeners.clear();
185
- };
186
- }
187
- var I;
188
- (function(e) {
189
- e[e.ONBOARDING = 1] = "ONBOARDING", e[e.QUESTION = 2] = "QUESTION", e[e.QUESTION_RESOLVED = 3] = "QUESTION_RESOLVED";
190
- })(I || (I = {}));
191
- window.slStore = /* @__PURE__ */ Object.create(null);
192
- var P;
193
- (function(e) {
194
- e.ORGANIZATION = "ORGANIZATION", e.STREAM = "STREAM";
195
- })(P || (P = {}));
196
- g.BETTING + "", g.GAMES + "", g.PUBLIC_CHAT + "", g.TWITTER + "";
197
- var L;
198
- (function(e) {
199
- e.Ready = "ready", e.Suspended = "suspended";
200
- })(L || (L = {}));
201
- export {
202
- oe as E,
203
- L as F,
204
- I as N,
205
- Q as a,
206
- se as b,
207
- R as c,
208
- ae as s,
209
- ie as u
210
- };
@@ -1,4 +0,0 @@
1
- import { B as f } from "./index2.js";
2
- export {
3
- f as default
4
- };
@@ -1,97 +0,0 @@
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
- };
@@ -1,15 +0,0 @@
1
- import { h as r } from "./index8.js";
2
- import { D as m } from "./index2.js";
3
- import { a as S, x as s } from "./notification2.js";
4
- import { V as L, g as i, Y as f, _ as x, q as D } from "./hooks-n9ax4LRT.js";
5
- export {
6
- L as StreamLayerProvider,
7
- i as StreamLayerSDKEvent,
8
- S as StreamLayerSDKNotification,
9
- s as StreamLayerSDKNotificationUI,
10
- m as StreamLayerSDKReact,
11
- r as StreamLayerThemeProvider,
12
- f as useStreamLayer,
13
- x as useStreamLayerTheme,
14
- D as useStreamLayerUI
15
- };
@@ -1,321 +0,0 @@
1
- import { jsxs as T, jsx as e, Fragment as le } from "react/jsx-runtime";
2
- import { s as n, c as Z } from "./feature.js";
3
- import { useState as I, useEffect as b, useCallback as v, forwardRef as ce, useRef as B } from "react";
4
- import { B as f } from "./index6.js";
5
- import { G as ue, d as ie, b as de } from "./index7.js";
6
- import { C as pe } from "./useStreamLayerApp2.js";
7
- const me = /* @__PURE__ */ n("div")({
8
- name: "CloseIconWrap",
9
- class: "c3v6bv6",
10
- propsAsIs: !1
11
- }), fe = /* @__PURE__ */ n("div")({
12
- name: "TimerWrap",
13
- class: "teuhmro",
14
- propsAsIs: !1
15
- }), ye = () => f, ge = /* @__PURE__ */ n(ye())({
16
- name: "Icon",
17
- class: "i17rfxv5",
18
- propsAsIs: !0
19
- }), Ze = ({
20
- close: t,
21
- className: a,
22
- timerClassName: o,
23
- skipIcon: l,
24
- isPlaying: i = !0,
25
- duration: c = 0,
26
- autoClose: d
27
- }) => {
28
- const [p, y] = I(c === 0);
29
- b(() => {
30
- y(!c);
31
- }, [c]);
32
- const C = v(() => {
33
- d === pe.ENABLED ? t?.() : y(!0);
34
- }, [d, t]);
35
- return p ? /* @__PURE__ */ T(me, {
36
- "data-a": "intr",
37
- onClick: t,
38
- className: a,
39
- style: l ? {
40
- width: "auto"
41
- } : {},
42
- children: [l && /* @__PURE__ */ e("span", {
43
- "data-a": "intr",
44
- children: "Skip"
45
- }), /* @__PURE__ */ e(ge, {
46
- "data-a": "intr",
47
- name: l ? "iconSkip" : "icon-cross"
48
- })]
49
- }) : /* @__PURE__ */ e(fe, {
50
- children: /* @__PURE__ */ e(ue, {
51
- className: o,
52
- isPlaying: i,
53
- duration: c,
54
- onTimerExpired: C
55
- })
56
- });
57
- }, he = /* @__PURE__ */ n("div")({
58
- name: "Container",
59
- class: "c1bgb86j",
60
- propsAsIs: !1
61
- }), Ie = /* @__PURE__ */ n("video")({
62
- name: "Player",
63
- class: "p6703cq",
64
- propsAsIs: !1
65
- }), be = /* @__PURE__ */ n("img")({
66
- name: "Poster",
67
- class: "p12ow7zo",
68
- propsAsIs: !1
69
- }), R = /* @__PURE__ */ n("div")({
70
- name: "Control",
71
- class: "cdpal9o",
72
- propsAsIs: !1
73
- }), Pe = "t1xke4ml", Ae = "h1yzxv57", ve = /* @__PURE__ */ n("div")({
74
- name: "VideoControls",
75
- class: "vxo8xch",
76
- propsAsIs: !1
77
- }), D = /* @__PURE__ */ n("button")({
78
- name: "ControlBtn",
79
- class: "coyuzu0",
80
- propsAsIs: !1
81
- }), Ce = () => D, Me = /* @__PURE__ */ n(Ce())({
82
- name: "MuteIcon",
83
- class: "musmi9a",
84
- propsAsIs: !0
85
- }), ke = () => D, we = /* @__PURE__ */ n(ke())({
86
- name: "PauseIcon",
87
- class: "p1qe7rum",
88
- propsAsIs: !0
89
- }), Ve = () => D, xe = /* @__PURE__ */ n(Ve())({
90
- name: "PlayIcon",
91
- class: "psevery",
92
- propsAsIs: !0
93
- }), Y = /* @__PURE__ */ n("button")({
94
- name: "WebOSIconButton",
95
- class: "w1q3u7py",
96
- propsAsIs: !1
97
- }), Ee = () => Y, L = /* @__PURE__ */ n(Ee())({
98
- name: "WebOSIconButtonAnimation",
99
- class: "wdlqvum",
100
- propsAsIs: !0
101
- }), Ne = () => L, Oe = /* @__PURE__ */ n(Ne())({
102
- name: "WebOSIconButtonPlay",
103
- class: "w1ylz9ea",
104
- propsAsIs: !0
105
- }), Se = () => L, We = /* @__PURE__ */ n(Se())({
106
- name: "WebOSIconButtonPause",
107
- class: "w1iylt55",
108
- propsAsIs: !0
109
- }), Be = () => L, Re = /* @__PURE__ */ n(Be())({
110
- name: "WebOSIconButtonMute",
111
- class: "w8h4h7",
112
- propsAsIs: !0
113
- }), Te = () => L, Le = /* @__PURE__ */ n(Te())({
114
- name: "WebOSIconButtonUnmute",
115
- class: "w12l12kt",
116
- propsAsIs: !0
117
- }), Ue = (t) => {
118
- for (const a of t)
119
- a.isIntersecting ? a.target instanceof HTMLVideoElement && a.target.autoplay && a.target.play() : a.target instanceof HTMLVideoElement && !a.target.paused && a.target.pause();
120
- }, ee = new IntersectionObserver(Ue, { threshold: 0.5 }), F = /* @__PURE__ */ new Set(), je = (t) => {
121
- ee.observe(t), F.add(t);
122
- }, ze = (t) => {
123
- ee.unobserve(t), F.delete(t);
124
- }, He = () => {
125
- for (const t of F)
126
- t instanceof HTMLVideoElement && !t.paused && t.pause();
127
- };
128
- function qe(...t) {
129
- return v(
130
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
131
- (a) => {
132
- for (const o of t)
133
- o !== null && (typeof o == "function" ? o(a) : o && (o.current = a));
134
- },
135
- // Re-run the callback if the array of refs changes
136
- // eslint-disable-next-line react-hooks/exhaustive-deps
137
- [...t]
138
- );
139
- }
140
- const $e = de(he), De = ({ loading: t, autoPlay: a, played: o, playing: l, isMuted: i, unmute: c, mute: d, togglePlaying: p }) => !t && !a && !o ? /* @__PURE__ */ e(R, { children: l ? /* @__PURE__ */ e(f, { name: "icon-pause" }) : /* @__PURE__ */ e(f, { name: "icon-play" }) }) : o ? /* @__PURE__ */ T(ve, { children: [
141
- l ? /* @__PURE__ */ e(we, { onClick: p }) : /* @__PURE__ */ e(xe, { onClick: p }),
142
- /* @__PURE__ */ e(Me, { className: Z(!i && "muted"), onClick: i ? c : d })
143
- ] }) : null, Fe = ({
144
- loading: t,
145
- autoPlay: a,
146
- playMuted: o,
147
- playing: l,
148
- played: i,
149
- unmute: c,
150
- mute: d,
151
- isMuted: p,
152
- hasNotPausedVideo: y,
153
- hasInteractedWithAudio: C
154
- }) => /* @__PURE__ */ T(le, { children: [
155
- !t && !(a && o) && /* @__PURE__ */ e(R, { "data-control-btn": "true", children: l ? y ? null : /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) : i ? /* @__PURE__ */ e(We, { children: /* @__PURE__ */ e(f, { name: "icon-pause" }) }) : /* @__PURE__ */ e(Y, { "data-control-icon": "true", children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) }),
156
- !t && a && o && C && /* @__PURE__ */ e(R, { children: p ? /* @__PURE__ */ e(Re, { onClick: c, children: /* @__PURE__ */ e(f, { name: "iconMute" }) }) : /* @__PURE__ */ e(Le, { onClick: d, children: /* @__PURE__ */ e(f, { name: "iconUnMute" }) }) })
157
- ] }), Ye = ce(
158
- ({
159
- poster: t,
160
- source: a,
161
- aspectRatio: o,
162
- controlVideo: l,
163
- onReplay: i,
164
- onPlay: c,
165
- onPause: d,
166
- onEnd: p,
167
- onRender: y,
168
- onMute: C,
169
- onMuteClick: x,
170
- onQuartile: U,
171
- autoPlay: M,
172
- playMuted: k,
173
- className: te,
174
- muted: w,
175
- webos: E,
176
- hasNotPausedVideo: ae
177
- }, se) => {
178
- const u = B(null), ne = qe(u, se), j = B(!1), z = B(!1), m = B(/* @__PURE__ */ new Set()), [G, K] = I(!1), [N, O] = I(!1), [H, _] = I(!1), [J, S] = I(!0), [q, W] = I(k), [$, oe] = I(!1);
179
- b(() => {
180
- a && (W(k), K(!1));
181
- }, [a]);
182
- const P = v(() => {
183
- l?.({ muted: !1 });
184
- }, [l]), Q = v(() => {
185
- l?.({ muted: !0 });
186
- }, [l]), A = v(
187
- (s) => {
188
- s?.stopPropagation(), u.current && (u.current.muted = !0), W(!0), s && x?.(!0);
189
- },
190
- [x]
191
- ), V = v(
192
- (s) => {
193
- s?.stopPropagation(), u.current && (u.current.muted = !1), W(!1), $ || oe(!0), s && x?.(!1);
194
- },
195
- [$, x]
196
- );
197
- b(() => {
198
- w !== void 0 && (w ? A() : V());
199
- }, [A, w, V]);
200
- const X = (s) => {
201
- s.stopPropagation?.();
202
- const r = u?.current;
203
- if (r)
204
- if (N)
205
- r.pause();
206
- else {
207
- const g = u?.current;
208
- if (!g)
209
- return;
210
- He(), g.play().catch((h) => console.log(h)), S(!1);
211
- }
212
- }, re = () => {
213
- u?.current?.load(), S(!0);
214
- };
215
- return b(() => () => {
216
- P();
217
- }, [P]), b(() => {
218
- const s = u.current;
219
- return s ? (z.current = s.muted, W(s.muted), je(s), () => {
220
- ze(s);
221
- }) : () => {
222
- };
223
- }, []), b(() => {
224
- y?.();
225
- }, [y]), b(() => {
226
- m.current.clear(), j.current = !1;
227
- }, [a]), /* @__PURE__ */ T(
228
- $e,
229
- {
230
- webos: E,
231
- onClick: M && k ? q ? V : A : X,
232
- "data-a": "intr",
233
- autoFocus: !0,
234
- options: { focusKey: "video-play-btn" },
235
- className: Z(N && !E && Pe, M && Ae, te),
236
- style: o ? { aspectRatio: o } : {},
237
- children: [
238
- /* @__PURE__ */ e(
239
- Ie,
240
- {
241
- ref: ne,
242
- src: a,
243
- autoPlay: M,
244
- onPlay: () => {
245
- K(!0), j.current && (i?.(), m.current.clear()), O(!0), S(!1), c?.(), k ? A() : Q();
246
- },
247
- onTimeUpdate: (s) => {
248
- const r = s.target.duration, g = s.target.currentTime;
249
- if (r && g) {
250
- const h = Math.floor(g / r * 100);
251
- h >= 25 && h < 50 && !m.current.has(25) ? (U?.(25), m.current.add(25)) : h >= 50 && h < 75 && !m.current.has(50) ? (U?.(50), m.current.add(50)) : h >= 75 && !m.current.has(75) && (U?.(75), m.current.add(75));
252
- }
253
- },
254
- onVolumeChange: (s) => {
255
- const r = s.target.muted;
256
- z.current !== r && (C?.(r), z.current = r, (r !== w || w === void 0) && (r ? P() : Q()));
257
- },
258
- onError: async (s) => {
259
- try {
260
- if (s.target instanceof HTMLVideoElement) {
261
- _(!0);
262
- const r = await (await fetch(s.target.src)).blob(), g = URL.createObjectURL(r);
263
- s.target.src = g;
264
- }
265
- } catch (r) {
266
- console.error("video fallback fetch failed", r), O(!0), S(!0);
267
- } finally {
268
- _(!1), P();
269
- }
270
- },
271
- onPause: () => {
272
- O(!1), d?.(), P();
273
- },
274
- onEnded: () => {
275
- O(!1), j.current = !0, re(), p?.(), P();
276
- },
277
- style: { visibility: J ? "hidden" : "visible" },
278
- controls: !1,
279
- playsInline: !0
280
- }
281
- ),
282
- /* @__PURE__ */ e(be, { src: t, style: { visibility: J ? "visible" : "hidden" } }),
283
- !E && /* @__PURE__ */ e(
284
- De,
285
- {
286
- loading: H,
287
- autoPlay: M,
288
- played: G,
289
- playing: N,
290
- isMuted: q,
291
- unmute: V,
292
- mute: A,
293
- togglePlaying: X
294
- }
295
- ),
296
- E && /* @__PURE__ */ e(
297
- Fe,
298
- {
299
- loading: H,
300
- autoPlay: M,
301
- playMuted: k,
302
- playing: N,
303
- played: G,
304
- unmute: V,
305
- mute: A,
306
- isMuted: q,
307
- hasNotPausedVideo: ae,
308
- hasInteractedWithAudio: $
309
- }
310
- ),
311
- H && /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ie, {}) })
312
- ]
313
- }
314
- );
315
- }
316
- );
317
- export {
318
- He as O,
319
- Ye as V,
320
- Ze as y
321
- };