@streamlayer/react 1.24.5 → 1.24.7

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 (166) hide show
  1. package/lib/cjs/advertisement.js +19607 -203
  2. package/lib/cjs/auth.js +4459 -1
  3. package/lib/cjs/bet-pack.js +15691 -1
  4. package/lib/cjs/index.js +19411 -1
  5. package/lib/cjs/insight.js +13509 -1
  6. package/lib/cjs/masters.js +20696 -1
  7. package/lib/cjs/notification.js +13087 -1
  8. package/lib/cjs/package.json +1 -0
  9. package/lib/cjs/pause-ad.js +8390 -1
  10. package/lib/cjs/points.js +7189 -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 +20696 -1
  16. package/lib/dist/es/index.js +20669 -10
  17. package/lib/dist/es/polyfills.js +92 -0
  18. package/lib/es/Question.js +66 -65
  19. package/lib/es/advertisement.js +3402 -3294
  20. package/lib/es/analytics.js +1 -1
  21. package/lib/es/bet-pack.js +1 -1
  22. package/lib/es/feature.js +192 -37
  23. package/lib/es/{index-DvqmgCor.js → index-D8wyDNJD.js} +1 -1
  24. package/lib/es/index.js +1 -1
  25. package/lib/es/index10.js +181 -7
  26. package/lib/es/index11.js +371 -181
  27. package/lib/es/index12.js +366 -2579
  28. package/lib/es/index13.js +789 -234
  29. package/lib/es/index14.js +293 -792
  30. package/lib/es/index15.js +2550 -305
  31. package/lib/es/index16.js +64 -66
  32. package/lib/es/index2.js +285 -279
  33. package/lib/es/index3.js +34 -4
  34. package/lib/es/index4.js +16 -17
  35. package/lib/es/index5.js +3 -19
  36. package/lib/es/index6.js +7 -5
  37. package/lib/es/index7.js +284 -5
  38. package/lib/es/index8.js +236 -281
  39. package/lib/es/index9.js +8 -179
  40. package/lib/es/insight.js +2 -2
  41. package/lib/es/masters2.js +199 -189
  42. package/lib/es/notification.js +27 -28
  43. package/lib/es/pause-ad.js +124 -149
  44. package/lib/es/points.js +23 -24
  45. package/lib/es/polymarket.js +3 -3
  46. package/lib/es/storage.js +4 -4
  47. package/lib/es/style.css +1 -0
  48. package/lib/es/useStreamLayerApp2.js +5579 -4475
  49. package/lib/source.css +1 -120
  50. package/package.json +126 -91
  51. package/lib/cjs/Question.js +0 -1
  52. package/lib/cjs/analytics.js +0 -1
  53. package/lib/cjs/feature.js +0 -1
  54. package/lib/cjs/gamification-feature.js +0 -1
  55. package/lib/cjs/gamification-feature2.js +0 -1
  56. package/lib/cjs/hooks-n9ax4LRT.js +0 -1
  57. package/lib/cjs/index-DvqmgCor.js +0 -5
  58. package/lib/cjs/index10.js +0 -1
  59. package/lib/cjs/index11.js +0 -1
  60. package/lib/cjs/index12.js +0 -1
  61. package/lib/cjs/index13.js +0 -1
  62. package/lib/cjs/index14.js +0 -4
  63. package/lib/cjs/index15.js +0 -1
  64. package/lib/cjs/index16.js +0 -5
  65. package/lib/cjs/index2.js +0 -1
  66. package/lib/cjs/index3.js +0 -1
  67. package/lib/cjs/index4.js +0 -5
  68. package/lib/cjs/index5.js +0 -1
  69. package/lib/cjs/index6.js +0 -1
  70. package/lib/cjs/index7.js +0 -1
  71. package/lib/cjs/index8.js +0 -1
  72. package/lib/cjs/index9.js +0 -7
  73. package/lib/cjs/masters2.js +0 -8
  74. package/lib/cjs/sl-types.js +0 -1
  75. package/lib/cjs/storage.js +0 -1
  76. package/lib/cjs/theme.js +0 -1
  77. package/lib/cjs/useStreamLayerApp2.js +0 -17
  78. package/lib/cjs/utils.js +0 -47
  79. package/lib/classic/app/advertisement.d.ts +0 -19
  80. package/lib/classic/app/app.d.ts +0 -23
  81. package/lib/classic/app/auth.d.ts +0 -4
  82. package/lib/classic/app/bet-pack.d.ts +0 -10
  83. package/lib/classic/app/insight.d.ts +0 -13
  84. package/lib/classic/app/masters.d.ts +0 -19
  85. package/lib/classic/app/notification.d.ts +0 -5
  86. package/lib/classic/app/pause-ad.d.ts +0 -27
  87. package/lib/classic/app/points.d.ts +0 -3
  88. package/lib/classic/app/polymarket.d.ts +0 -7
  89. package/lib/classic/app/useStreamLayerApp.d.ts +0 -1
  90. package/lib/classic/cjs/Question.js +0 -1
  91. package/lib/classic/cjs/advertisement.js +0 -203
  92. package/lib/classic/cjs/analytics.js +0 -1
  93. package/lib/classic/cjs/auth.js +0 -1
  94. package/lib/classic/cjs/bet-pack.js +0 -5
  95. package/lib/classic/cjs/feature.js +0 -1
  96. package/lib/classic/cjs/gamification-feature.js +0 -1
  97. package/lib/classic/cjs/hooks-n9ax4LRT.js +0 -1
  98. package/lib/classic/cjs/index-DvqmgCor.js +0 -5
  99. package/lib/classic/cjs/index.js +0 -1
  100. package/lib/classic/cjs/index10.js +0 -1
  101. package/lib/classic/cjs/index11.js +0 -1
  102. package/lib/classic/cjs/index12.js +0 -1
  103. package/lib/classic/cjs/index13.js +0 -4
  104. package/lib/classic/cjs/index2.js +0 -5
  105. package/lib/classic/cjs/index3.js +0 -1
  106. package/lib/classic/cjs/index4.js +0 -1
  107. package/lib/classic/cjs/index5.js +0 -1
  108. package/lib/classic/cjs/index6.js +0 -1
  109. package/lib/classic/cjs/index7.js +0 -7
  110. package/lib/classic/cjs/index8.js +0 -1
  111. package/lib/classic/cjs/index9.js +0 -1
  112. package/lib/classic/cjs/insight.js +0 -1
  113. package/lib/classic/cjs/notification.js +0 -1
  114. package/lib/classic/cjs/notification2.js +0 -1
  115. package/lib/classic/cjs/pause-ad.js +0 -1
  116. package/lib/classic/cjs/points.js +0 -1
  117. package/lib/classic/cjs/polymarket.js +0 -14
  118. package/lib/classic/cjs/sl-types.js +0 -1
  119. package/lib/classic/cjs/useStreamLayerApp.js +0 -1
  120. package/lib/classic/cjs/useStreamLayerApp2.js +0 -17
  121. package/lib/classic/cjs/utils.js +0 -47
  122. package/lib/classic/es/Question.js +0 -388
  123. package/lib/classic/es/advertisement.js +0 -38759
  124. package/lib/classic/es/analytics.js +0 -84
  125. package/lib/classic/es/auth.js +0 -11
  126. package/lib/classic/es/bet-pack.js +0 -3419
  127. package/lib/classic/es/feature.js +0 -59
  128. package/lib/classic/es/gamification-feature.js +0 -4
  129. package/lib/classic/es/hooks-n9ax4LRT.js +0 -97
  130. package/lib/classic/es/index-DvqmgCor.js +0 -3775
  131. package/lib/classic/es/index.js +0 -15
  132. package/lib/classic/es/index10.js +0 -2592
  133. package/lib/classic/es/index11.js +0 -317
  134. package/lib/classic/es/index12.js +0 -185
  135. package/lib/classic/es/index13.js +0 -820
  136. package/lib/classic/es/index2.js +0 -2597
  137. package/lib/classic/es/index3.js +0 -19
  138. package/lib/classic/es/index4.js +0 -6
  139. package/lib/classic/es/index5.js +0 -5
  140. package/lib/classic/es/index6.js +0 -285
  141. package/lib/classic/es/index7.js +0 -181
  142. package/lib/classic/es/index8.js +0 -7
  143. package/lib/classic/es/index9.js +0 -11
  144. package/lib/classic/es/insight.js +0 -79
  145. package/lib/classic/es/notification.js +0 -9
  146. package/lib/classic/es/notification2.js +0 -1127
  147. package/lib/classic/es/pause-ad.js +0 -257
  148. package/lib/classic/es/points.js +0 -77
  149. package/lib/classic/es/polymarket.js +0 -6617
  150. package/lib/classic/es/sl-types.js +0 -156
  151. package/lib/classic/es/useStreamLayerApp.js +0 -4
  152. package/lib/classic/es/useStreamLayerApp2.js +0 -11573
  153. package/lib/classic/es/utils.js +0 -76
  154. package/lib/classic/index.d.ts +0 -6
  155. package/lib/classic/masters.d.ts +0 -8
  156. package/lib/classic/source.css +0 -110
  157. package/lib/dist/cjs/gamification-feature.js +0 -1
  158. package/lib/dist/cjs/index-DvqmgCor.js +0 -5
  159. package/lib/dist/cjs/masters.js +0 -69
  160. package/lib/dist/es/gamification-feature.js +0 -4
  161. package/lib/dist/es/index-DvqmgCor.js +0 -3775
  162. package/lib/dist/es/masters.js +0 -22204
  163. package/lib/dist/index.d.ts +0 -1355
  164. package/lib/dist/source.css +0 -64
  165. package/lib/es/sl-types.js +0 -156
  166. package/lib/style.css +0 -1
@@ -1,317 +0,0 @@
1
- import { jsxs as O, jsx as e, Fragment as re } from "react/jsx-runtime";
2
- import { s as n, c as X } from "./sl-types.js";
3
- import { useState as h, useEffect as b, useCallback as A, forwardRef as le, useRef as V } from "react";
4
- import { B as f } from "./index6.js";
5
- import { G as ce, d as ue, b as ie } from "./index7.js";
6
- import { C as de } from "./useStreamLayerApp2.js";
7
- const pe = /* @__PURE__ */ n("div")({
8
- name: "CloseIconWrap",
9
- class: "c3v6bv6",
10
- propsAsIs: !1
11
- }), me = /* @__PURE__ */ n("div")({
12
- name: "TimerWrap",
13
- class: "teuhmro",
14
- propsAsIs: !1
15
- }), fe = () => f, ye = /* @__PURE__ */ n(fe())({
16
- name: "Icon",
17
- class: "i17rfxv5",
18
- propsAsIs: !0
19
- }), Xe = ({
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] = h(c === 0);
29
- b(() => {
30
- y(!c);
31
- }, [c]);
32
- const M = A(() => {
33
- d === de.ENABLED ? t?.() : y(!0);
34
- }, [d, t]);
35
- return p ? /* @__PURE__ */ O(pe, {
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(ye, {
46
- "data-a": "intr",
47
- name: l ? "iconSkip" : "icon-cross"
48
- })]
49
- }) : /* @__PURE__ */ e(me, {
50
- children: /* @__PURE__ */ e(ce, {
51
- className: o,
52
- isPlaying: i,
53
- duration: c,
54
- onTimerExpired: M
55
- })
56
- });
57
- }, ge = /* @__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
- }), he = /* @__PURE__ */ n("img")({
66
- name: "Poster",
67
- class: "p12ow7zo",
68
- propsAsIs: !1
69
- }), T = /* @__PURE__ */ n("div")({
70
- name: "Control",
71
- class: "cdpal9o",
72
- propsAsIs: !1
73
- }), be = "t1xke4ml", Pe = "h1yzxv57", ve = /* @__PURE__ */ n("div")({
74
- name: "VideoControls",
75
- class: "vxo8xch",
76
- propsAsIs: !1
77
- }), U = /* @__PURE__ */ n("button")({
78
- name: "ControlBtn",
79
- class: "coyuzu0",
80
- propsAsIs: !1
81
- }), Ae = () => U, Me = /* @__PURE__ */ n(Ae())({
82
- name: "MuteIcon",
83
- class: "musmi9a",
84
- propsAsIs: !0
85
- }), Ce = () => U, ke = /* @__PURE__ */ n(Ce())({
86
- name: "PauseIcon",
87
- class: "p1qe7rum",
88
- propsAsIs: !0
89
- }), we = () => U, Se = /* @__PURE__ */ n(we())({
90
- name: "PlayIcon",
91
- class: "psevery",
92
- propsAsIs: !0
93
- }), Z = /* @__PURE__ */ n("button")({
94
- name: "WebOSIconButton",
95
- class: "w1q3u7py",
96
- propsAsIs: !1
97
- }), xe = () => Z, R = /* @__PURE__ */ n(xe())({
98
- name: "WebOSIconButtonAnimation",
99
- class: "wdlqvum",
100
- propsAsIs: !0
101
- }), Be = () => R, We = /* @__PURE__ */ n(Be())({
102
- name: "WebOSIconButtonPlay",
103
- class: "w1ylz9ea",
104
- propsAsIs: !0
105
- }), Ee = () => R, Ne = /* @__PURE__ */ n(Ee())({
106
- name: "WebOSIconButtonPause",
107
- class: "w1iylt55",
108
- propsAsIs: !0
109
- }), Ve = () => R, Te = /* @__PURE__ */ n(Ve())({
110
- name: "WebOSIconButtonMute",
111
- class: "w8h4h7",
112
- propsAsIs: !0
113
- }), Oe = () => R, Re = /* @__PURE__ */ n(Oe())({
114
- name: "WebOSIconButtonUnmute",
115
- class: "w12l12kt",
116
- propsAsIs: !0
117
- }), $e = (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
- }, Y = new IntersectionObserver($e, { threshold: 0.5 }), H = /* @__PURE__ */ new Set(), je = (t) => {
121
- Y.observe(t), H.add(t);
122
- }, qe = (t) => {
123
- Y.unobserve(t), H.delete(t);
124
- }, ze = () => {
125
- for (const t of H)
126
- t instanceof HTMLVideoElement && !t.paused && t.pause();
127
- };
128
- function Fe(...t) {
129
- return A(
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 Le = ie(ge), Ue = ({ loading: t, autoPlay: a, played: o, playing: l, isMuted: i, unmute: c, mute: d, togglePlaying: p }) => !t && !a && !o ? /* @__PURE__ */ e(T, { children: l ? /* @__PURE__ */ e(f, { name: "icon-pause" }) : /* @__PURE__ */ e(f, { name: "icon-play" }) }) : o ? /* @__PURE__ */ O(ve, { children: [
141
- l ? /* @__PURE__ */ e(ke, { onClick: p }) : /* @__PURE__ */ e(Se, { onClick: p }),
142
- /* @__PURE__ */ e(Me, { className: X(!i && "muted"), onClick: i ? c : d })
143
- ] }) : null, He = ({
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: M
154
- }) => /* @__PURE__ */ O(re, { children: [
155
- !t && !(a && o) && /* @__PURE__ */ e(T, { "data-control-btn": "true", children: l ? y ? null : /* @__PURE__ */ e(We, { children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) : i ? /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(f, { name: "icon-pause" }) }) : /* @__PURE__ */ e(Z, { "data-control-icon": "true", children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) }),
156
- !t && a && o && M && /* @__PURE__ */ e(T, { children: p ? /* @__PURE__ */ e(Te, { onClick: c, children: /* @__PURE__ */ e(f, { name: "iconMute" }) }) : /* @__PURE__ */ e(Re, { onClick: d, children: /* @__PURE__ */ e(f, { name: "iconUnMute" }) }) })
157
- ] }), Ze = le(
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: M,
169
- onQuartile: $,
170
- autoPlay: C,
171
- playMuted: k,
172
- className: ee,
173
- muted: w,
174
- webos: x,
175
- hasNotPausedVideo: te
176
- }, ae) => {
177
- const u = V(null), se = Fe(u, ae), j = V(!1), q = V(!1), m = V(/* @__PURE__ */ new Set()), [D, G] = h(!1), [B, W] = h(!1), [z, K] = h(!1), [Q, E] = h(!0), [F, N] = h(k), [L, ne] = h(!1);
178
- b(() => {
179
- a && (N(k), G(!1));
180
- }, [a]);
181
- const P = A(() => {
182
- l?.({ muted: !1 });
183
- }, [l]), _ = A(() => {
184
- l?.({ muted: !0 });
185
- }, [l]), v = A((s) => {
186
- s?.stopPropagation(), u.current && (u.current.muted = !0), N(!0);
187
- }, []), S = A(
188
- (s) => {
189
- s?.stopPropagation(), u.current && (u.current.muted = !1), N(!1), L || ne(!0);
190
- },
191
- [L]
192
- );
193
- b(() => {
194
- w !== void 0 && (w ? v() : S());
195
- }, [v, w, S]);
196
- const J = (s) => {
197
- s.stopPropagation?.();
198
- const r = u?.current;
199
- if (r)
200
- if (B)
201
- r.pause();
202
- else {
203
- const g = u?.current;
204
- if (!g)
205
- return;
206
- ze(), g.play().catch((I) => console.log(I)), E(!1);
207
- }
208
- }, oe = () => {
209
- u?.current?.load(), E(!0);
210
- };
211
- return b(() => () => {
212
- P();
213
- }, [P]), b(() => {
214
- const s = u.current;
215
- return s ? (q.current = s.muted, N(s.muted), je(s), () => {
216
- qe(s);
217
- }) : () => {
218
- };
219
- }, []), b(() => {
220
- y?.();
221
- }, [y]), b(() => {
222
- m.current.clear(), j.current = !1;
223
- }, [a]), /* @__PURE__ */ O(
224
- Le,
225
- {
226
- webos: x,
227
- onClick: C && k ? F ? S : v : J,
228
- "data-a": "intr",
229
- autoFocus: !0,
230
- options: { focusKey: "video-play-btn" },
231
- className: X(B && !x && be, C && Pe, ee),
232
- style: o ? { aspectRatio: o } : {},
233
- children: [
234
- /* @__PURE__ */ e(
235
- Ie,
236
- {
237
- ref: se,
238
- src: a,
239
- autoPlay: C,
240
- onPlay: () => {
241
- G(!0), j.current && (i?.(), m.current.clear()), W(!0), E(!1), c?.(), k ? v() : _();
242
- },
243
- onTimeUpdate: (s) => {
244
- const r = s.target.duration, g = s.target.currentTime;
245
- if (r && g) {
246
- const I = Math.floor(g / r * 100);
247
- I >= 25 && I < 50 && !m.current.has(25) ? ($?.(25), m.current.add(25)) : I >= 50 && I < 75 && !m.current.has(50) ? ($?.(50), m.current.add(50)) : I >= 75 && !m.current.has(75) && ($?.(75), m.current.add(75));
248
- }
249
- },
250
- onVolumeChange: (s) => {
251
- const r = s.target.muted;
252
- q.current !== r && (M?.(r), q.current = r, (r !== w || w === void 0) && (r ? P() : _()));
253
- },
254
- onError: async (s) => {
255
- try {
256
- if (s.target instanceof HTMLVideoElement) {
257
- K(!0);
258
- const r = await (await fetch(s.target.src)).blob(), g = URL.createObjectURL(r);
259
- s.target.src = g;
260
- }
261
- } catch (r) {
262
- console.error("video fallback fetch failed", r), W(!0), E(!0);
263
- } finally {
264
- K(!1), P();
265
- }
266
- },
267
- onPause: () => {
268
- W(!1), d?.(), P();
269
- },
270
- onEnded: () => {
271
- W(!1), j.current = !0, oe(), p?.(), P();
272
- },
273
- style: { visibility: Q ? "hidden" : "visible" },
274
- controls: !1,
275
- playsInline: !0
276
- }
277
- ),
278
- /* @__PURE__ */ e(he, { src: t, style: { visibility: Q ? "visible" : "hidden" } }),
279
- !x && /* @__PURE__ */ e(
280
- Ue,
281
- {
282
- loading: z,
283
- autoPlay: C,
284
- played: D,
285
- playing: B,
286
- isMuted: F,
287
- unmute: S,
288
- mute: v,
289
- togglePlaying: J
290
- }
291
- ),
292
- x && /* @__PURE__ */ e(
293
- He,
294
- {
295
- loading: z,
296
- autoPlay: C,
297
- playMuted: k,
298
- playing: B,
299
- played: D,
300
- unmute: S,
301
- mute: v,
302
- isMuted: F,
303
- hasNotPausedVideo: te,
304
- hasInteractedWithAudio: L
305
- }
306
- ),
307
- z && /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(ue, {}) })
308
- ]
309
- }
310
- );
311
- }
312
- );
313
- export {
314
- Ze as F,
315
- ze as I,
316
- Xe as y
317
- };
@@ -1,185 +0,0 @@
1
- import { s as a } from "./sl-types.js";
2
- import { Q as i } from "./useStreamLayerApp2.js";
3
- import { jsxs as t, jsx as s, Fragment as U } from "react/jsx-runtime";
4
- import { memo as $, useMemo as w } from "react";
5
- import { F as y } from "./index11.js";
6
- import { B as T } from "./index6.js";
7
- const G = {
8
- [i.TWEET]: { label: "Insight", iconName: "icon-insight" },
9
- [i.PROMOTION]: { label: "Insight", iconName: "icon-insight" },
10
- [i.UNSET]: void 0,
11
- [i.FACTOID]: { label: "Insight", iconName: "icon-insight" },
12
- [i.POLL]: { label: "Poll", iconName: "icon-poll" },
13
- [i.TRIVIA]: { label: "Trivia", iconName: "icon-trivia" },
14
- [i.PREDICTION]: { label: "Prediction", iconName: "icon-prediction" }
15
- }, J = {
16
- [i.TWEET]: "Learn more",
17
- [i.FACTOID]: "Learn more",
18
- [i.POLL]: "Answer",
19
- [i.TRIVIA]: "Answer",
20
- [i.PREDICTION]: "Answer",
21
- [i.PROMOTION]: "",
22
- [i.UNSET]: ""
23
- }, K = (r) => r.split(/\s+/).map((n) => n[0]).join("").toUpperCase(), X = (r) => r ? r.toLocaleString("en-US") : "0", L = (r) => {
24
- const n = new Date(r);
25
- if (!n)
26
- return "";
27
- const c = /* @__PURE__ */ new Date(), o = Math.floor(c.getTime() - n.getTime());
28
- return o < 6e4 ? `${Math.floor(o / 1e3)}s` : o < 36e5 ? `${Math.floor(o / 6e4)}m` : o < 864e5 ? `${Math.floor(o / 36e5)}h` : n.getFullYear() === c.getFullYear() ? `${n.toLocaleDateString("en-US", {
29
- month: "short",
30
- day: "numeric"
31
- })}` : `${n.toLocaleDateString("en-US", {
32
- month: "2-digit",
33
- day: "2-digit",
34
- year: "2-digit"
35
- })}`;
36
- }, D = /* @__PURE__ */ a("div")({
37
- name: "Container",
38
- class: "cjq447q",
39
- propsAsIs: !1
40
- }), H = /* @__PURE__ */ a("div")({
41
- name: "ImageContainer",
42
- class: "i14egogb",
43
- propsAsIs: !1
44
- }), S = /* @__PURE__ */ a("img")({
45
- name: "Image",
46
- class: "i2g9g4l",
47
- propsAsIs: !1
48
- }), O = () => T, E = /* @__PURE__ */ a(O())({
49
- name: "TwitterIcon",
50
- class: "t1c454nm",
51
- propsAsIs: !0
52
- }), b = /* @__PURE__ */ a("div")({
53
- name: "Details",
54
- class: "d11nigc3",
55
- propsAsIs: !1
56
- }), x = /* @__PURE__ */ a("div")({
57
- name: "Name",
58
- class: "nrxa4k8",
59
- propsAsIs: !1
60
- }), C = /* @__PURE__ */ a("div")({
61
- name: "UserNameAndDate",
62
- class: "u1p051g3",
63
- propsAsIs: !1
64
- }), F = ({ image: r, name: n, userName: c, verified: o, createdTweet: p }) => {
65
- const m = p && L(p);
66
- return /* @__PURE__ */ t(D, { children: [
67
- r && /* @__PURE__ */ t(H, { children: [
68
- /* @__PURE__ */ s(S, { className: "SL_AccountImage", src: r }),
69
- /* @__PURE__ */ s(E, { name: "twitter" })
70
- ] }),
71
- /* @__PURE__ */ t(b, { children: [
72
- n && /* @__PURE__ */ t(x, { className: "SL_TweetAccountName", children: [
73
- n,
74
- " ",
75
- o && /* @__PURE__ */ s(T, { name: "icon-twitter-verified" })
76
- ] }),
77
- c && /* @__PURE__ */ t(C, { className: "SL_TweetAccountUserName", children: [
78
- "@",
79
- c,
80
- " ",
81
- m && `・ ${m}`
82
- ] })
83
- ] })
84
- ] });
85
- }, P = /* @__PURE__ */ a("div")({
86
- name: "Container",
87
- class: "c1kzqw87",
88
- propsAsIs: !1
89
- }), M = /* @__PURE__ */ a("div")({
90
- name: "Details",
91
- class: "d9r1hf9",
92
- propsAsIs: !1
93
- }), R = /* @__PURE__ */ a("div")({
94
- name: "Body",
95
- class: "bezygt5",
96
- propsAsIs: !1
97
- }), d = /* @__PURE__ */ a("div")({
98
- name: "ImagesContainer",
99
- class: "i1y8f7ym",
100
- propsAsIs: !1
101
- }), h = /* @__PURE__ */ a("div")({
102
- name: "ImagesBlock",
103
- class: "i18gwonx",
104
- propsAsIs: !1
105
- }), N = /* @__PURE__ */ a("img")({
106
- name: "Image",
107
- class: "i3g0xjd",
108
- propsAsIs: !1
109
- }), j = () => N, l = /* @__PURE__ */ a(j())({
110
- name: "ImageFullSize",
111
- class: "io8rt7p",
112
- propsAsIs: !0
113
- }), V = () => N, f = /* @__PURE__ */ a(V())({
114
- name: "ImageHalfSize",
115
- class: "i4hn3ox",
116
- propsAsIs: !0
117
- }), _ = new RegExp("\\s?https?://t.co[^\\s]+(\\s+)?$"), z = (r) => r?.replace(_, ""), Z = $(
118
- ({ image: r, body: n, muted: c, account: o, accountVerified: p, tweet: m, isDetail: u, controlVideo: v }) => {
119
- const e = m?.meta?.extendedEntities?.media, g = e?.find(
120
- ({ type: I }) => I === "photo"
121
- /* PHOTO */
122
- ), A = w(() => e?.[0]?.videoInfo?.variants?.findLast(
123
- ({ contentType: I }) => I === "video/mp4"
124
- /* VIDEO */
125
- )?.url, [e]);
126
- return /* @__PURE__ */ t(P, { children: [
127
- /* @__PURE__ */ t(M, { children: [
128
- /* @__PURE__ */ s(
129
- F,
130
- {
131
- image: r,
132
- name: m?.meta?.accountName,
133
- userName: o,
134
- verified: p,
135
- createdTweet: m?.date
136
- }
137
- ),
138
- /* @__PURE__ */ s(R, { children: z(n) }),
139
- !u && g && /* @__PURE__ */ s(d, { children: /* @__PURE__ */ s(l, { src: e?.[0].mediaUrlHttps }) }),
140
- u && g && /* @__PURE__ */ t(U, { children: [
141
- e?.length === 1 && /* @__PURE__ */ s(d, { children: /* @__PURE__ */ s(l, { src: e[0].mediaUrlHttps }) }),
142
- e?.length === 2 && /* @__PURE__ */ t(d, { children: [
143
- /* @__PURE__ */ s(f, { src: e[0].mediaUrlHttps }),
144
- /* @__PURE__ */ s(f, { src: e[1].mediaUrlHttps })
145
- ] }),
146
- e?.length === 3 && /* @__PURE__ */ t(d, { children: [
147
- /* @__PURE__ */ s(f, { src: e[0].mediaUrlHttps }),
148
- /* @__PURE__ */ t(h, { children: [
149
- /* @__PURE__ */ s(l, { src: e[1].mediaUrlHttps }),
150
- /* @__PURE__ */ s(l, { src: e[2].mediaUrlHttps })
151
- ] })
152
- ] }),
153
- e?.length === 4 && /* @__PURE__ */ t(d, { children: [
154
- /* @__PURE__ */ t(h, { children: [
155
- /* @__PURE__ */ s(l, { src: e[0].mediaUrlHttps }),
156
- /* @__PURE__ */ s(l, { src: e[1].mediaUrlHttps })
157
- ] }),
158
- /* @__PURE__ */ t(h, { children: [
159
- /* @__PURE__ */ s(l, { src: e[2].mediaUrlHttps }),
160
- /* @__PURE__ */ s(l, { src: e[3].mediaUrlHttps })
161
- ] })
162
- ] })
163
- ] })
164
- ] }),
165
- !g && (e?.[0]?.type === "video" || e?.[0]?.type === "animated_gif") && A && /* @__PURE__ */ s(
166
- y,
167
- {
168
- muted: c,
169
- source: A,
170
- poster: e[0].mediaUrlHttps,
171
- controlVideo: v
172
- }
173
- )
174
- ] });
175
- }
176
- );
177
- export {
178
- F as D,
179
- K as I,
180
- Z as N,
181
- G as e,
182
- z as j,
183
- J as o,
184
- X as s
185
- };