@streamlayer/react 1.24.6 → 1.24.8-pre.11da316

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/advertisement.d.ts +5 -0
  2. package/lib/cjs/advertisement.js +19657 -203
  3. package/lib/cjs/auth.js +4459 -1
  4. package/lib/cjs/bet-pack.js +15728 -1
  5. package/lib/cjs/index.js +19469 -1
  6. package/lib/cjs/insight.js +13571 -1
  7. package/lib/cjs/masters.js +20735 -1
  8. package/lib/cjs/notification.js +13118 -1
  9. package/lib/cjs/package.json +1 -0
  10. package/lib/cjs/pause-ad.js +8390 -1
  11. package/lib/cjs/points.js +7220 -1
  12. package/lib/cjs/polyfills.js +69 -0
  13. package/lib/cjs/polymarket.js +16395 -14
  14. package/lib/cjs/style.css +1 -0
  15. package/lib/cjs/useStreamLayerApp.js +4705 -1
  16. package/lib/dist/cjs/index.js +20735 -1
  17. package/lib/dist/es/index.js +20708 -10
  18. package/lib/dist/es/polyfills.js +92 -0
  19. package/lib/es/Question.js +75 -72
  20. package/lib/es/advertisement.js +9223 -8168
  21. package/lib/es/analytics.js +35 -31
  22. package/lib/es/auth.js +1 -1
  23. package/lib/es/bet-pack.js +1 -1
  24. package/lib/es/feature.js +60 -56
  25. package/lib/{classic/es/hooks-n9ax4LRT.js → es/hooks-42q2i9Iw.js} +25 -23
  26. package/lib/{dist/es/index-CfSdnrfA.js → es/index-sWgEw6jy.js} +1 -1
  27. package/lib/es/index.js +1 -1
  28. package/lib/es/index10.js +181 -7
  29. package/lib/es/index11.js +371 -181
  30. package/lib/es/index12.js +116 -128
  31. package/lib/es/index13.js +101 -97
  32. package/lib/es/index14.js +14 -14
  33. package/lib/es/index15.js +384 -414
  34. package/lib/es/index16.js +380 -382
  35. package/lib/es/index2.js +53 -56
  36. package/lib/es/index3.js +34 -4
  37. package/lib/es/index4.js +2 -2
  38. package/lib/es/index5.js +272 -16
  39. package/lib/es/index6.js +1 -1
  40. package/lib/es/index8.js +8 -282
  41. package/lib/es/index9.js +133 -75
  42. package/lib/es/insight.js +2 -2
  43. package/lib/es/masters.js +1 -1
  44. package/lib/es/masters2.js +34 -35
  45. package/lib/es/notification.js +28 -28
  46. package/lib/es/pause-ad.js +20 -20
  47. package/lib/es/points.js +9 -9
  48. package/lib/es/polymarket.js +38 -38
  49. package/lib/es/storage.js +19 -19
  50. package/lib/es/style.css +1 -0
  51. package/lib/es/useStreamLayerApp.js +1 -1
  52. package/lib/es/useStreamLayerApp2.js +6756 -5470
  53. package/lib/es/utils.js +86 -41
  54. package/lib/source.css +1 -120
  55. package/package.json +99 -83
  56. package/lib/cjs/Question.js +0 -1
  57. package/lib/cjs/analytics.js +0 -1
  58. package/lib/cjs/feature.js +0 -1
  59. package/lib/cjs/gamification-feature.js +0 -1
  60. package/lib/cjs/gamification-feature2.js +0 -1
  61. package/lib/cjs/hooks-n9ax4LRT.js +0 -1
  62. package/lib/cjs/index-CfSdnrfA.js +0 -5
  63. package/lib/cjs/index10.js +0 -1
  64. package/lib/cjs/index11.js +0 -1
  65. package/lib/cjs/index12.js +0 -1
  66. package/lib/cjs/index13.js +0 -4
  67. package/lib/cjs/index14.js +0 -1
  68. package/lib/cjs/index15.js +0 -1
  69. package/lib/cjs/index16.js +0 -5
  70. package/lib/cjs/index2.js +0 -1
  71. package/lib/cjs/index3.js +0 -1
  72. package/lib/cjs/index4.js +0 -5
  73. package/lib/cjs/index5.js +0 -1
  74. package/lib/cjs/index6.js +0 -1
  75. package/lib/cjs/index7.js +0 -1
  76. package/lib/cjs/index8.js +0 -1
  77. package/lib/cjs/index9.js +0 -7
  78. package/lib/cjs/masters2.js +0 -8
  79. package/lib/cjs/storage.js +0 -1
  80. package/lib/cjs/theme.js +0 -1
  81. package/lib/cjs/useStreamLayerApp2.js +0 -17
  82. package/lib/cjs/utils.js +0 -47
  83. package/lib/classic/app/advertisement.d.ts +0 -19
  84. package/lib/classic/app/app.d.ts +0 -23
  85. package/lib/classic/app/auth.d.ts +0 -4
  86. package/lib/classic/app/bet-pack.d.ts +0 -10
  87. package/lib/classic/app/insight.d.ts +0 -13
  88. package/lib/classic/app/masters.d.ts +0 -19
  89. package/lib/classic/app/notification.d.ts +0 -5
  90. package/lib/classic/app/pause-ad.d.ts +0 -27
  91. package/lib/classic/app/points.d.ts +0 -3
  92. package/lib/classic/app/polymarket.d.ts +0 -7
  93. package/lib/classic/app/useStreamLayerApp.d.ts +0 -1
  94. package/lib/classic/cjs/Question.js +0 -1
  95. package/lib/classic/cjs/advertisement.js +0 -203
  96. package/lib/classic/cjs/analytics.js +0 -1
  97. package/lib/classic/cjs/auth.js +0 -1
  98. package/lib/classic/cjs/bet-pack.js +0 -5
  99. package/lib/classic/cjs/feature.js +0 -1
  100. package/lib/classic/cjs/gamification-feature.js +0 -1
  101. package/lib/classic/cjs/hooks-n9ax4LRT.js +0 -1
  102. package/lib/classic/cjs/index-CfSdnrfA.js +0 -5
  103. package/lib/classic/cjs/index.js +0 -1
  104. package/lib/classic/cjs/index10.js +0 -1
  105. package/lib/classic/cjs/index11.js +0 -1
  106. package/lib/classic/cjs/index12.js +0 -1
  107. package/lib/classic/cjs/index13.js +0 -4
  108. package/lib/classic/cjs/index2.js +0 -5
  109. package/lib/classic/cjs/index3.js +0 -1
  110. package/lib/classic/cjs/index4.js +0 -1
  111. package/lib/classic/cjs/index5.js +0 -1
  112. package/lib/classic/cjs/index6.js +0 -1
  113. package/lib/classic/cjs/index7.js +0 -7
  114. package/lib/classic/cjs/index8.js +0 -1
  115. package/lib/classic/cjs/index9.js +0 -1
  116. package/lib/classic/cjs/insight.js +0 -1
  117. package/lib/classic/cjs/notification.js +0 -1
  118. package/lib/classic/cjs/notification2.js +0 -1
  119. package/lib/classic/cjs/pause-ad.js +0 -1
  120. package/lib/classic/cjs/points.js +0 -1
  121. package/lib/classic/cjs/polymarket.js +0 -14
  122. package/lib/classic/cjs/useStreamLayerApp.js +0 -1
  123. package/lib/classic/cjs/useStreamLayerApp2.js +0 -17
  124. package/lib/classic/cjs/utils.js +0 -47
  125. package/lib/classic/es/Question.js +0 -503
  126. package/lib/classic/es/advertisement.js +0 -38792
  127. package/lib/classic/es/analytics.js +0 -84
  128. package/lib/classic/es/auth.js +0 -11
  129. package/lib/classic/es/bet-pack.js +0 -3418
  130. package/lib/classic/es/feature.js +0 -210
  131. package/lib/classic/es/gamification-feature.js +0 -4
  132. package/lib/classic/es/index-CfSdnrfA.js +0 -3775
  133. package/lib/classic/es/index.js +0 -15
  134. package/lib/classic/es/index10.js +0 -321
  135. package/lib/classic/es/index11.js +0 -2592
  136. package/lib/classic/es/index12.js +0 -185
  137. package/lib/classic/es/index13.js +0 -820
  138. package/lib/classic/es/index2.js +0 -2605
  139. package/lib/classic/es/index3.js +0 -19
  140. package/lib/classic/es/index4.js +0 -6
  141. package/lib/classic/es/index5.js +0 -4
  142. package/lib/classic/es/index6.js +0 -285
  143. package/lib/classic/es/index7.js +0 -181
  144. package/lib/classic/es/index8.js +0 -7
  145. package/lib/classic/es/index9.js +0 -11
  146. package/lib/classic/es/insight.js +0 -79
  147. package/lib/classic/es/notification.js +0 -9
  148. package/lib/classic/es/notification2.js +0 -1126
  149. package/lib/classic/es/pause-ad.js +0 -232
  150. package/lib/classic/es/points.js +0 -76
  151. package/lib/classic/es/polymarket.js +0 -6617
  152. package/lib/classic/es/useStreamLayerApp.js +0 -4
  153. package/lib/classic/es/useStreamLayerApp2.js +0 -11627
  154. package/lib/classic/es/utils.js +0 -76
  155. package/lib/classic/index.d.ts +0 -6
  156. package/lib/classic/masters.d.ts +0 -8
  157. package/lib/classic/source.css +0 -110
  158. package/lib/dist/cjs/gamification-feature.js +0 -1
  159. package/lib/dist/cjs/index-CfSdnrfA.js +0 -5
  160. package/lib/dist/cjs/masters.js +0 -69
  161. package/lib/dist/es/gamification-feature.js +0 -4
  162. package/lib/dist/es/masters.js +0 -22387
  163. package/lib/dist/index.d.ts +0 -1357
  164. package/lib/dist/source.css +0 -64
  165. package/lib/es/hooks-n9ax4LRT.js +0 -97
  166. package/lib/es/index-CfSdnrfA.js +0 -3775
  167. package/lib/style.css +0 -1
@@ -0,0 +1,92 @@
1
+ import 'core-js/stable/index.js';
2
+ import 'regenerator-runtime/runtime.js';
3
+ import require$$2 from 'text-encoding-utf-8';
4
+ import 'intersection-observer';
5
+ import require$$4 from 'resize-observer-polyfill';
6
+ import require$$5 from 'web-streams-polyfill';
7
+ import 'whatwg-fetch';
8
+ import 'abortcontroller-polyfill/dist/polyfill-patch-fetch.js';
9
+
10
+ function getDefaultExportFromCjs (x) {
11
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
12
+ }
13
+
14
+ var polyfills$1 = {};
15
+
16
+ var hasRequiredPolyfills;
17
+
18
+ function requirePolyfills () {
19
+ if (hasRequiredPolyfills) return polyfills$1;
20
+ hasRequiredPolyfills = 1;
21
+ // TextEncoder/TextDecoder pure JS polyfill (Chrome 38)
22
+ // The package only exports classes; must assign globals for SDK compatibility
23
+ var _textEncoding = require$$2;
24
+ if (typeof window.TextEncoder === 'undefined') window.TextEncoder = _textEncoding.TextEncoder;
25
+ if (typeof window.TextDecoder === 'undefined') window.TextDecoder = _textEncoding.TextDecoder;
26
+ // IntersectionObserver polyfill (Chrome 51)
27
+ if (typeof window.ResizeObserver === 'undefined') { // ResizeObserver polyfill (Chrome 64)
28
+ var _RO = require$$4;
29
+ window.ResizeObserver = _RO.default || _RO;
30
+ }
31
+ var _streams = require$$5;
32
+ if (typeof window.ReadableStream === 'undefined') window.ReadableStream = _streams.ReadableStream;
33
+ if (typeof window.WritableStream === 'undefined') window.WritableStream = _streams.WritableStream;
34
+ if (typeof window.TransformStream === 'undefined') window.TransformStream = _streams.TransformStream;
35
+ // fetch/Response/Headers/Request polyfill (Chrome 42)
36
+ // AbortController + patched fetch (Chrome 66)
37
+
38
+ // whatwg-fetch does not implement Response.body (ReadableStream).
39
+ // ConnectRPC requires response.body to parse gRPC-Web frames.
40
+ // Wrap fetch to synthesize .body from .arrayBuffer().
41
+ (function() {
42
+ var origFetch = window.fetch;
43
+ window.fetch = function(input, init) {
44
+ return origFetch.apply(this, arguments).then(function(response) {
45
+ if (response.body) return response;
46
+ var _stream = null;
47
+ Object.defineProperty(response, 'body', {
48
+ get: function() {
49
+ if (!_stream) {
50
+ var clone = response.clone();
51
+ _stream = new ReadableStream({
52
+ start: function(controller) {
53
+ clone.arrayBuffer().then(function(buf) {
54
+ controller.enqueue(new Uint8Array(buf));
55
+ controller.close();
56
+ }, function(err) {
57
+ controller.error(err);
58
+ });
59
+ }
60
+ });
61
+ }
62
+ return _stream;
63
+ }
64
+ });
65
+ return response;
66
+ });
67
+ };
68
+ })();
69
+
70
+ // MediaQueryList.addEventListener/removeEventListener polyfill (Chrome 50)
71
+ // Chrome 32 only has the legacy addListener/removeListener API.
72
+ // MediaQueryList is not exposed as a global constructor in Chrome 32,
73
+ // so we obtain the prototype from an actual instance via matchMedia.
74
+ if (typeof window.matchMedia === 'function') {
75
+ var _mql = window.matchMedia('(min-width:0)');
76
+ if (_mql && !_mql.addEventListener) {
77
+ var _mqlProto = Object.getPrototypeOf(_mql);
78
+ _mqlProto.addEventListener = function (type, listener) {
79
+ if (type === 'change') this.addListener(listener);
80
+ };
81
+ _mqlProto.removeEventListener = function (type, listener) {
82
+ if (type === 'change') this.removeListener(listener);
83
+ };
84
+ }
85
+ }
86
+ return polyfills$1;
87
+ }
88
+
89
+ var polyfillsExports = requirePolyfills();
90
+ var polyfills = /*@__PURE__*/getDefaultExportFromCjs(polyfillsExports);
91
+
92
+ export { polyfills as default };
@@ -1,135 +1,138 @@
1
1
  import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { s as l, u as p } from "./feature.js";
3
- import { createContext as E, useContext as N, useRef as k, useEffect as q, useState as $ } from "react";
4
- import { O as C, d as D, f as L, a as R } from "./index12.js";
2
+ import { s as u, u as c } from "./feature.js";
3
+ import { createContext as E, useContext as N, useRef as $, useEffect as q, useState as C } from "react";
4
+ import { O as D, d as L, f as O, a as R } from "./index12.js";
5
5
  import { Q as V, Z as F } from "./index13.js";
6
- import { y as P } from "./utils.js";
7
- import { Q as A, A as Q } from "./useStreamLayerApp2.js";
6
+ import { k as P } from "./utils.js";
7
+ import { Q, A as T } from "./useStreamLayerApp2.js";
8
8
  const j = E({
9
9
  sdk: null,
10
10
  topNavigation: !1
11
- }), H = () => N(j), O = /* @__PURE__ */ l("div")({
11
+ }), M = () => N(j), Z = /* @__PURE__ */ u("div")({
12
12
  name: "QuestionAdvertisementContainer",
13
13
  class: "qwludgs",
14
14
  propsAsIs: !1
15
- }), Z = /* @__PURE__ */ l("div")({
15
+ }), B = /* @__PURE__ */ u("div")({
16
16
  name: "QuestionAdvertisementText",
17
17
  class: "qvce6pv",
18
18
  propsAsIs: !1
19
- }), _ = /* @__PURE__ */ l("div")({
19
+ }), H = /* @__PURE__ */ u("div")({
20
20
  name: "QuestionAdvertisementImage",
21
21
  class: "qsid7hx",
22
22
  propsAsIs: !1
23
- }), B = ({
23
+ }), Y = ({
24
24
  sponsorLogo: e,
25
- id: a,
26
- setAdShowed: n
25
+ id: s,
26
+ setAdShowed: a
27
27
  }) => {
28
- const s = k();
29
- return q(() => (s.current = setTimeout(() => {
30
- n(!0);
28
+ const i = $();
29
+ return q(() => (i.current = setTimeout(() => {
30
+ a(!0);
31
31
  }, 5e3), () => {
32
- clearTimeout(s.current);
33
- }), [n, a]), /* @__PURE__ */ m(O, {
34
- children: [/* @__PURE__ */ t(Z, {
32
+ clearTimeout(i.current);
33
+ }), [a, s]), /* @__PURE__ */ m(Z, {
34
+ children: [/* @__PURE__ */ t(B, {
35
35
  children: "PRESENTED BY"
36
- }), /* @__PURE__ */ t(_, {
36
+ }), /* @__PURE__ */ t(H, {
37
37
  children: /* @__PURE__ */ t("img", {
38
38
  src: e,
39
39
  alt: "ad-sponsor-logo"
40
40
  })
41
41
  })]
42
42
  });
43
- }, h = /* @__PURE__ */ l("div")({
43
+ }, h = /* @__PURE__ */ u("div")({
44
44
  name: "QuestionContainer",
45
45
  class: "q14ckf9e",
46
46
  propsAsIs: !1
47
- }), Y = ({
47
+ }), _ = ({
48
48
  openedQuestion: e,
49
- muted: a,
50
- webos: n
49
+ muted: s,
50
+ webos: a,
51
+ factoidMode: i
51
52
  }) => {
52
53
  const {
53
- sdk: s
54
- } = H();
55
- return e?.attributes?.attributes.case === "insight" ? /* @__PURE__ */ t(L, {
54
+ sdk: n
55
+ } = M();
56
+ return e?.attributes?.attributes.case === "insight" ? /* @__PURE__ */ t(O, {
56
57
  ...e.attributes.attributes.value,
57
- muted: a,
58
- controlVideo: s?.controlVideoPlayer,
59
- webos: n,
58
+ muted: s,
59
+ controlVideo: n?.controlVideoPlayer,
60
+ webos: a,
60
61
  questionId: e.id,
61
62
  fireEvent: e.fireEvent,
62
- isEventFired: e.isEventFired
63
+ isEventFired: e.isEventFired,
64
+ mode: i
63
65
  }) : e?.attributes?.attributes.case === "tweet" ? /* @__PURE__ */ t(R, {
64
66
  ...e.attributes.attributes.value,
65
- muted: a,
66
- controlVideo: s?.controlVideoPlayer
67
+ muted: s,
68
+ controlVideo: n?.controlVideoPlayer
67
69
  }) : null;
68
70
  }, z = ({
69
71
  extendedQuestion: e,
70
- vote: a,
71
- close: n,
72
- webos: s
72
+ vote: s,
73
+ close: a,
74
+ webos: i
73
75
  }) => {
74
76
  const {
75
- loading: u,
76
- data: r
77
+ loading: n,
78
+ data: d
77
79
  } = e;
78
- return r ? /* @__PURE__ */ t(V, {
79
- webos: s,
80
- vote: a,
81
- close: n,
82
- openedQuestion: r,
83
- isLoading: !!u
80
+ return d ? /* @__PURE__ */ t(V, {
81
+ webos: i,
82
+ vote: s,
83
+ close: a,
84
+ openedQuestion: d,
85
+ isLoading: !!n
84
86
  }) : /* @__PURE__ */ t(F, {});
85
- }, oe = ({
87
+ }, te = ({
86
88
  gamification: e,
87
- sdk: a,
88
- muted: n,
89
- skipAutoClose: s,
90
- hideSponsor: u,
91
- className: r,
89
+ sdk: s,
90
+ muted: a,
91
+ skipAutoClose: i,
92
+ hideSponsor: n,
93
+ className: d,
92
94
  hideHeader: w,
93
- webos: c
95
+ webos: p
94
96
  }) => {
95
- const i = p(e.openedQuestion.$store), o = p(e.openedQuestion.$extendedStore), [T, I] = $(!1), U = p(a.options), f = i?.attributes?.type === A.FACTOID, b = i?.attributes?.backgroundImage, d = o.data?.backgroundImage, S = f ? b?.landscapeUrl ?? d?.landscapeUrl : d?.landscapeUrl, x = f ? b?.portraitUrl ?? d?.portraitUrl : d?.portraitUrl, v = P({
96
- containerId: U.containerId,
97
- landscapeUrl: S,
98
- portraitUrl: x
97
+ const r = c(e.openedQuestion.$store), o = c(e.openedQuestion.$extendedStore), [I, U] = C(!1), S = c(s.options), f = r?.attributes?.type === Q.FACTOID, b = r?.attributes?.backgroundImage, l = o.data?.backgroundImage, x = f ? b?.landscapeUrl ?? l?.landscapeUrl : l?.landscapeUrl, k = f ? b?.portraitUrl ?? l?.portraitUrl : l?.portraitUrl, v = P({
98
+ containerId: S.containerId,
99
+ landscapeUrl: x,
100
+ portraitUrl: k
99
101
  });
100
- if (!i || !o.data)
102
+ if (!r || !o.data)
101
103
  return null;
102
- const g = i.type, y = o.data?.options?.options.case === "factoid" ? o.data.options.options.value.closeTimer : void 0;
103
- return o.data && (o.data.adUnit === Q.STANDART || o.data.promotion?.adUnit === Q.STANDART) && !T ? /* @__PURE__ */ m(h, {
104
- className: r,
105
- children: [v, /* @__PURE__ */ t(B, {
104
+ const g = r.type, A = o.data?.options?.options.case === "factoid" ? o.data.options.options.value : void 0, y = A?.closeTimer;
105
+ return o.data && (o.data.adUnit === T.STANDART || o.data.promotion?.adUnit === T.STANDART) && !I ? /* @__PURE__ */ m(h, {
106
+ className: d,
107
+ children: [v, /* @__PURE__ */ t(Y, {
106
108
  id: o.data.id,
107
- setAdShowed: I,
109
+ setAdShowed: U,
108
110
  sponsorLogo: o.data.promotion?.sponsor?.logo || o.data.sponsorship?.logo || ""
109
111
  })]
110
112
  }) : /* @__PURE__ */ m(h, {
111
- className: r,
112
- children: [v, !w && /* @__PURE__ */ t(C, {
113
- closeTimer: s ? void 0 : y,
113
+ className: d,
114
+ children: [v, !w && /* @__PURE__ */ t(D, {
115
+ closeTimer: i ? void 0 : y,
114
116
  close: e.closeQuestion,
115
- type: i.attributes?.type || A.UNSET,
116
- webos: c
117
+ type: r.attributes?.type || Q.UNSET,
118
+ webos: p
117
119
  }), g === "question" && /* @__PURE__ */ t(z, {
118
- webos: c,
120
+ webos: p,
119
121
  vote: e.submitAnswer,
120
122
  close: e.closeQuestion,
121
123
  extendedQuestion: o
122
- }), g !== "question" && /* @__PURE__ */ t(Y, {
123
- muted: n,
124
- openedQuestion: i,
125
- webos: c
126
- }), !u && /* @__PURE__ */ t(D, {
124
+ }), g !== "question" && /* @__PURE__ */ t(_, {
125
+ muted: a,
126
+ openedQuestion: r,
127
+ webos: p,
128
+ factoidMode: A?.mode
129
+ }), !n && /* @__PURE__ */ t(L, {
127
130
  sponsorLogo: o.data?.promotion?.sponsor?.logo || o.data?.sponsorship?.logo
128
131
  })]
129
132
  });
130
133
  };
131
134
  export {
132
- oe as _,
133
135
  j as e,
134
- H as p
136
+ M as p,
137
+ te as t
135
138
  };