@mx-cartographer/experiences 7.1.4 → 7.1.5-alpha.sms1
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { jsx as e, jsxs as v } from "react/jsx-runtime";
|
|
2
2
|
import u, { useState as te, useEffect as oe } from "react";
|
|
3
3
|
import { observer as G } from "mobx-react-lite";
|
|
4
|
-
import
|
|
4
|
+
import Pe from "@mui/material/Button";
|
|
5
5
|
import K from "@mui/material/Stack";
|
|
6
|
-
import
|
|
7
|
-
import { ChevronLeft as
|
|
8
|
-
import { L as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
6
|
+
import Ge from "@mui/material/Typography";
|
|
7
|
+
import { ChevronLeft as Ue, ChevronRight as Se } from "@mxenabled/mx-icons";
|
|
8
|
+
import { L as be } from "./Loader-DUaFpDGv.mjs";
|
|
9
|
+
import b from "@mui/material/Box";
|
|
10
|
+
import pe from "@mui/material/IconButton";
|
|
11
11
|
import { useTheme as ze } from "@mui/material/styles";
|
|
12
|
-
import { useInView as
|
|
13
|
-
import { P as Ke, CategoryIcon as $e, useTokens as
|
|
14
|
-
import
|
|
12
|
+
import { useInView as Me } from "react-intersection-observer";
|
|
13
|
+
import { P as Ke, CategoryIcon as $e, useTokens as Ae, MerchantLogo as Ye, Icon as ie } from "@mxenabled/mxui";
|
|
14
|
+
import se from "@mui/material/styles/useTheme";
|
|
15
15
|
import { b as je } from "./Category-CevNQ03n.mjs";
|
|
16
16
|
import { css as Xe } from "@mxenabled/cssinjs";
|
|
17
17
|
import { b as Qe } from "./Localization-2MODESHW.mjs";
|
|
18
18
|
import qe from "@mui/material/CircularProgress";
|
|
19
|
-
import { makeAutoObservable as
|
|
20
|
-
import { G as
|
|
21
|
-
import { B as
|
|
19
|
+
import { makeAutoObservable as de, runInAction as Oe } from "mobx";
|
|
20
|
+
import { G as _e, a as Je, u as et, b as tt } from "./useCombineEvents-BUDIR1ba.mjs";
|
|
21
|
+
import { B as Ce } from "./BeatApi-DhJpgCLz.mjs";
|
|
22
22
|
import it from "@mui/material/Card";
|
|
23
23
|
import ot from "@mui/material/CardActions";
|
|
24
24
|
import rt from "@mui/material/CardContent";
|
|
25
25
|
import lt from "@mui/material/CardHeader";
|
|
26
|
-
const
|
|
26
|
+
const fe = {
|
|
27
27
|
featureVersion: "spendVsIncomeTrends"
|
|
28
28
|
};
|
|
29
29
|
class nt {
|
|
30
|
-
copyApi = new
|
|
30
|
+
copyApi = new _e("/", "");
|
|
31
31
|
copyObject = {};
|
|
32
32
|
namespace = "experiences";
|
|
33
33
|
translationKey = "micro_insights";
|
|
34
34
|
constructor() {
|
|
35
|
-
|
|
35
|
+
de(this);
|
|
36
36
|
}
|
|
37
37
|
// NOTE: Not sure if this is special case, but other stores have this deprecation todo
|
|
38
38
|
// DEPRECATED: Initialize api in constructor and use loadCopy instead
|
|
39
39
|
// TODO: Remove this function
|
|
40
40
|
initialize = async (o, t) => {
|
|
41
|
-
this.copyApi = new
|
|
41
|
+
this.copyApi = new _e(o, t), await this.loadCopy();
|
|
42
42
|
};
|
|
43
43
|
loadCopy = async () => {
|
|
44
44
|
const o = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
|
|
45
|
-
|
|
45
|
+
Oe(() => {
|
|
46
46
|
this.copyObject = o[this.translationKey];
|
|
47
47
|
});
|
|
48
48
|
};
|
|
@@ -73,12 +73,12 @@ const he = {
|
|
|
73
73
|
WeeklyNewMerchantsV2: "WeeklyNewMerchantsV2",
|
|
74
74
|
MonthlySpendComparison: "MonthlySpendComparison",
|
|
75
75
|
MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
|
|
76
|
-
}, S = window?.app?.clientConfig?.microwidget_instance_id || "",
|
|
76
|
+
}, S = window?.app?.clientConfig?.microwidget_instance_id || "", me = {
|
|
77
77
|
INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
|
|
78
|
-
},
|
|
78
|
+
}, Te = (i) => `on${i}Click`, We = (i) => `on${i}View`, we = (i) => `on${i}ViewFirstTime`, Ee = (i) => i.replace(/([a-z])([A-Z])/g, "$1 $2"), at = () => Object.values(he).reduce(
|
|
79
79
|
(i, o) => ({
|
|
80
80
|
...i,
|
|
81
|
-
[
|
|
81
|
+
[Te(o)]: {
|
|
82
82
|
action: w.MICRO_BEAT_CLICKED,
|
|
83
83
|
category: W.BEAT_INTERACTION,
|
|
84
84
|
label: Ee(o),
|
|
@@ -89,7 +89,7 @@ const he = {
|
|
|
89
89
|
), ct = () => Object.values(he).reduce(
|
|
90
90
|
(i, o) => ({
|
|
91
91
|
...i,
|
|
92
|
-
[
|
|
92
|
+
[We(o)]: {
|
|
93
93
|
action: w.MICRO_BEAT_DISPLAYED,
|
|
94
94
|
category: W.BEAT_INTERACTION,
|
|
95
95
|
label: Ee(o),
|
|
@@ -97,10 +97,10 @@ const he = {
|
|
|
97
97
|
}
|
|
98
98
|
}),
|
|
99
99
|
{}
|
|
100
|
-
),
|
|
100
|
+
), st = () => Object.values(he).reduce(
|
|
101
101
|
(i, o) => ({
|
|
102
102
|
...i,
|
|
103
|
-
[
|
|
103
|
+
[we(o)]: {
|
|
104
104
|
action: w.MICRO_BEAT_DISPLAYED_FIRST_TIME,
|
|
105
105
|
category: W.BEAT_INTERACTION,
|
|
106
106
|
label: Ee(o),
|
|
@@ -141,14 +141,14 @@ const he = {
|
|
|
141
141
|
[H.MICRO_WIDGET_CAROUSEL]: {
|
|
142
142
|
label: T.MICRO_WIDGET,
|
|
143
143
|
name: H.MICRO_WIDGET_CAROUSEL,
|
|
144
|
-
path:
|
|
144
|
+
path: me.INSIGHTS_MICRO_WIDGET,
|
|
145
145
|
value: S
|
|
146
146
|
},
|
|
147
147
|
// zero state
|
|
148
148
|
[H.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
|
|
149
149
|
label: T.MICRO_WIDGET,
|
|
150
150
|
name: H.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
|
|
151
|
-
path:
|
|
151
|
+
path: me.INSIGHTS_MICRO_WIDGET,
|
|
152
152
|
value: S
|
|
153
153
|
},
|
|
154
154
|
// no relevant cards
|
|
@@ -158,7 +158,7 @@ const he = {
|
|
|
158
158
|
path: "/micro-widget",
|
|
159
159
|
value: S
|
|
160
160
|
}
|
|
161
|
-
},
|
|
161
|
+
}, ge = {
|
|
162
162
|
// carousel control interaction events - clicks and swipes
|
|
163
163
|
[M.ON_CAROUSEL_BACK_CLICK]: {
|
|
164
164
|
action: w.CONTROL_BACKWARD,
|
|
@@ -199,29 +199,29 @@ const he = {
|
|
|
199
199
|
},
|
|
200
200
|
...at(),
|
|
201
201
|
...ct(),
|
|
202
|
-
...
|
|
203
|
-
},
|
|
202
|
+
...st()
|
|
203
|
+
}, Ie = async (i, o) => !o || !ge[i] ? null : o.sendAnalyticEvent(ge[i]).then((t) => t).catch((t) => {
|
|
204
204
|
throw t;
|
|
205
|
-
}),
|
|
205
|
+
}), ye = async (i, o) => !o || !Re[i] ? null : o.sendAnalyticsPageview(Re[i]).then((t) => t).catch((t) => {
|
|
206
206
|
throw t;
|
|
207
207
|
});
|
|
208
|
-
class
|
|
209
|
-
onAnalyticEvent =
|
|
210
|
-
onAnalyticPageView =
|
|
211
|
-
beatApi = new
|
|
208
|
+
class dt {
|
|
209
|
+
onAnalyticEvent = Ie;
|
|
210
|
+
onAnalyticPageView = ye;
|
|
211
|
+
beatApi = new Ce("/", "");
|
|
212
212
|
constructor() {
|
|
213
|
-
|
|
213
|
+
de(this);
|
|
214
214
|
}
|
|
215
215
|
initialize = async (o, t, r) => {
|
|
216
216
|
this.onAnalyticEvent = (n, l) => {
|
|
217
|
-
|
|
217
|
+
Ie(n, l).then((a) => a).catch((a) => {
|
|
218
218
|
throw a.status === 401 && r(), a;
|
|
219
219
|
});
|
|
220
220
|
}, this.onAnalyticPageView = (n, l) => {
|
|
221
|
-
|
|
221
|
+
ye(n, l).then((a) => a).catch((a) => {
|
|
222
222
|
throw a.status === 401 && r(), a;
|
|
223
223
|
});
|
|
224
|
-
}, this.beatApi = new
|
|
224
|
+
}, this.beatApi = new Ce(o, t);
|
|
225
225
|
};
|
|
226
226
|
updateBeat = async (o) => {
|
|
227
227
|
this.beatApi.updateBeat(o);
|
|
@@ -238,12 +238,12 @@ class ht {
|
|
|
238
238
|
token = "";
|
|
239
239
|
isInitialized = !1;
|
|
240
240
|
constructor() {
|
|
241
|
-
this.copyStore = new nt(), this.insightsMicroWidgetStore = new
|
|
241
|
+
this.copyStore = new nt(), this.insightsMicroWidgetStore = new dt(), de(this);
|
|
242
242
|
}
|
|
243
243
|
initialize = async (o, t, r) => {
|
|
244
244
|
await this.copyStore.initialize(o, t), await this.insightsMicroWidgetStore.initialize(o, t, r);
|
|
245
245
|
const n = await Je(o, t, "1.0.0", "Micro Insights Carousel");
|
|
246
|
-
|
|
246
|
+
Oe(() => {
|
|
247
247
|
this.session = n, this.isInitialized = !0;
|
|
248
248
|
});
|
|
249
249
|
};
|
|
@@ -261,7 +261,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
261
261
|
description: n,
|
|
262
262
|
heightOverrides: l,
|
|
263
263
|
icon: a,
|
|
264
|
-
isActiveCard:
|
|
264
|
+
isActiveCard: d,
|
|
265
265
|
isZeroState: p,
|
|
266
266
|
onCardClick: _ = () => {
|
|
267
267
|
},
|
|
@@ -271,8 +271,8 @@ const $ = u.createContext(null), Et = ({
|
|
|
271
271
|
title: m,
|
|
272
272
|
variant: c,
|
|
273
273
|
widthOverrides: E
|
|
274
|
-
},
|
|
275
|
-
const I =
|
|
274
|
+
}, R) {
|
|
275
|
+
const I = se(), [D, O] = u.useState(!1), { cardStyle: y, linkTextStyle: F } = f, z = c ? y : { border: "none", boxShadow: "none", ...y }, g = /* @__PURE__ */ e(
|
|
276
276
|
Ke,
|
|
277
277
|
{
|
|
278
278
|
className: "mx-micro-card-description",
|
|
@@ -299,13 +299,13 @@ const $ = u.createContext(null), Et = ({
|
|
|
299
299
|
}
|
|
300
300
|
);
|
|
301
301
|
return /* @__PURE__ */ e(
|
|
302
|
-
|
|
302
|
+
b,
|
|
303
303
|
{
|
|
304
|
-
"aria-hidden": !
|
|
304
|
+
"aria-hidden": !d,
|
|
305
305
|
"aria-label": t,
|
|
306
306
|
"aria-labelledby": "divButton",
|
|
307
307
|
"aria-roledescription": "slide",
|
|
308
|
-
ref:
|
|
308
|
+
ref: R,
|
|
309
309
|
role: "group",
|
|
310
310
|
sx: {
|
|
311
311
|
height: "100%",
|
|
@@ -313,22 +313,22 @@ const $ = u.createContext(null), Et = ({
|
|
|
313
313
|
fontFamily: I.typography.fontFamily
|
|
314
314
|
},
|
|
315
315
|
children: /* @__PURE__ */ e(
|
|
316
|
-
|
|
316
|
+
b,
|
|
317
317
|
{
|
|
318
|
-
"aria-hidden": !
|
|
318
|
+
"aria-hidden": !d,
|
|
319
319
|
"aria-label": t,
|
|
320
320
|
id: "divButton",
|
|
321
321
|
onClick: () => _(),
|
|
322
322
|
onKeyDown: () => O(!1),
|
|
323
323
|
onKeyUp: () => O(!0),
|
|
324
|
-
ref:
|
|
324
|
+
ref: R,
|
|
325
325
|
role: "button",
|
|
326
326
|
sx: {
|
|
327
|
-
border:
|
|
327
|
+
border: D ? "1px solid rgba(82, 138, 224, 0.8)" : void 0,
|
|
328
328
|
borderRadius: "8px",
|
|
329
329
|
height: "100%"
|
|
330
330
|
},
|
|
331
|
-
tabIndex:
|
|
331
|
+
tabIndex: d ? 0 : -1,
|
|
332
332
|
children: /* @__PURE__ */ e(
|
|
333
333
|
it,
|
|
334
334
|
{
|
|
@@ -359,13 +359,13 @@ const $ = u.createContext(null), Et = ({
|
|
|
359
359
|
lt,
|
|
360
360
|
{
|
|
361
361
|
avatar: C && a,
|
|
362
|
-
subheader: p &&
|
|
362
|
+
subheader: p && g,
|
|
363
363
|
sx: { color: h.headerColor, p: 0 },
|
|
364
364
|
title: m,
|
|
365
365
|
titleTypographyProps: { fontSize: 15, fontWeight: 600, variant: "h3" }
|
|
366
366
|
}
|
|
367
367
|
),
|
|
368
|
-
/* @__PURE__ */ e(rt, { sx: { p: 0 }, children: !p &&
|
|
368
|
+
/* @__PURE__ */ e(rt, { sx: { p: 0 }, children: !p && g }),
|
|
369
369
|
!!o && /* @__PURE__ */ e(
|
|
370
370
|
ot,
|
|
371
371
|
{
|
|
@@ -374,14 +374,14 @@ const $ = u.createContext(null), Et = ({
|
|
|
374
374
|
p: 0
|
|
375
375
|
},
|
|
376
376
|
children: /* @__PURE__ */ e(
|
|
377
|
-
|
|
377
|
+
b,
|
|
378
378
|
{
|
|
379
|
-
sx: (
|
|
380
|
-
color: h.buttonColor ? h.buttonColor :
|
|
379
|
+
sx: (x) => ({
|
|
380
|
+
color: h.buttonColor ? h.buttonColor : x.palette.primary.main,
|
|
381
381
|
fontSize: 14,
|
|
382
382
|
fontWeight: "bold",
|
|
383
383
|
px: 28,
|
|
384
|
-
fontFamily:
|
|
384
|
+
fontFamily: x.typography.fontFamily,
|
|
385
385
|
...F
|
|
386
386
|
}),
|
|
387
387
|
children: o
|
|
@@ -405,7 +405,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
405
405
|
i.primary_category_guid ? t(i.primary_category_guid) : i.category_guids?.length && t(i.category_guids[0]);
|
|
406
406
|
}, []), /* @__PURE__ */ e($e, { categoryGuid: o, size: 16, sx: { minWidth: 16 } });
|
|
407
407
|
}, pt = ({ beat: i }) => {
|
|
408
|
-
const o =
|
|
408
|
+
const o = Ae(), t = _t(o);
|
|
409
409
|
return /* @__PURE__ */ e(
|
|
410
410
|
Ye,
|
|
411
411
|
{
|
|
@@ -451,13 +451,13 @@ const $ = u.createContext(null), Et = ({
|
|
|
451
451
|
return i.names?.map((r, n) => {
|
|
452
452
|
t[r] = o[n];
|
|
453
453
|
}), t;
|
|
454
|
-
}) : [] : [],
|
|
454
|
+
}) : [] : [], Rt = (i, o) => {
|
|
455
455
|
const t = mt(i), r = t.length / 2, n = t.slice(0, r), l = t.slice(r);
|
|
456
456
|
return !n.length || !l.length ? o.Color.Primary300 : n[0].amount > l[0].amount ? o.Color.Error300 : n[0].amount < l[0].amount ? o.Color.Success300 : o.Color.Primary300;
|
|
457
|
-
},
|
|
458
|
-
const o =
|
|
457
|
+
}, gt = ({ beat: i }) => {
|
|
458
|
+
const o = Ae(), t = Rt(i.data_series, o);
|
|
459
459
|
return /* @__PURE__ */ e(ie, { name: "bar_chart", sx: { color: t } });
|
|
460
|
-
},
|
|
460
|
+
}, xe = () => /* @__PURE__ */ v("svg", { fill: "none", height: "36", viewBox: "0 0 40 36", width: "40", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
461
461
|
/* @__PURE__ */ e(
|
|
462
462
|
"path",
|
|
463
463
|
{
|
|
@@ -1238,9 +1238,9 @@ const $ = u.createContext(null), Et = ({
|
|
|
1238
1238
|
}
|
|
1239
1239
|
)
|
|
1240
1240
|
] })
|
|
1241
|
-
] }),
|
|
1242
|
-
const n =
|
|
1243
|
-
return r === 0 ? /* @__PURE__ */ e(ie, { fill: !0, name: "error", sx: { color: t || l } }) : r === 1 && i ? /* @__PURE__ */ e(ut, { beat: i }) : r === 2 && i ? /* @__PURE__ */ e(Ct, { beat: i }) : r === 3 && i ? /* @__PURE__ */ e(
|
|
1241
|
+
] }), ve = ({ beat: i, clientColorScheme: o, color: t, type: r }) => {
|
|
1242
|
+
const n = se(), l = o?.primary_300 ? o.primary_300 : n.palette.primary.main;
|
|
1243
|
+
return r === 0 ? /* @__PURE__ */ e(ie, { fill: !0, name: "error", sx: { color: t || l } }) : r === 1 && i ? /* @__PURE__ */ e(ut, { beat: i }) : r === 2 && i ? /* @__PURE__ */ e(Ct, { beat: i }) : r === 3 && i ? /* @__PURE__ */ e(gt, { beat: i }) : r === 5 && i ? /* @__PURE__ */ e(ie, { name: "campaign" }) : /* @__PURE__ */ e(
|
|
1244
1244
|
ie,
|
|
1245
1245
|
{
|
|
1246
1246
|
fill: !0,
|
|
@@ -1267,17 +1267,17 @@ const $ = u.createContext(null), Et = ({
|
|
|
1267
1267
|
if (!i)
|
|
1268
1268
|
throw new Error("useEvent() must be used within the InsightsMicroWidgetDataProvider");
|
|
1269
1269
|
return { onEvent: i.onEvent };
|
|
1270
|
-
},
|
|
1270
|
+
}, Le = () => {
|
|
1271
1271
|
const i = u.useContext($);
|
|
1272
1272
|
if (!i)
|
|
1273
1273
|
throw new Error("usePageview() must be used within the InsightsMicroWidgetDataProvider");
|
|
1274
1274
|
return { onPageview: i.onPageview };
|
|
1275
|
-
},
|
|
1275
|
+
}, Ne = {
|
|
1276
1276
|
LARGE: 180,
|
|
1277
1277
|
STANDARD: 154,
|
|
1278
1278
|
XLARGE: 200,
|
|
1279
1279
|
XXLARGE: 248
|
|
1280
|
-
}, yt = 50,
|
|
1280
|
+
}, yt = 50, Ve = 1, vt = ({
|
|
1281
1281
|
ariaLabel: i,
|
|
1282
1282
|
backgroundColor: o,
|
|
1283
1283
|
beat: t,
|
|
@@ -1285,24 +1285,24 @@ const $ = u.createContext(null), Et = ({
|
|
|
1285
1285
|
showCTAColocatedWithText: n = !0,
|
|
1286
1286
|
heightOverrides: l,
|
|
1287
1287
|
index: a,
|
|
1288
|
-
isActiveCard:
|
|
1288
|
+
isActiveCard: d,
|
|
1289
1289
|
onCardClick: p,
|
|
1290
1290
|
posthog: _,
|
|
1291
1291
|
showIcon: C,
|
|
1292
1292
|
variant: f,
|
|
1293
1293
|
widthOverrides: h
|
|
1294
1294
|
}) => {
|
|
1295
|
-
const { ref: m, inView: c } =
|
|
1296
|
-
threshold:
|
|
1297
|
-
}), { cardsCopy: E } = k(), { onEvent:
|
|
1295
|
+
const { ref: m, inView: c } = Me({
|
|
1296
|
+
threshold: Ve
|
|
1297
|
+
}), { cardsCopy: E } = k(), { onEvent: R } = Y(), { updateBeat: I, updateOffer: D } = It();
|
|
1298
1298
|
oe(() => {
|
|
1299
|
-
c && (t.has_been_displayed ?
|
|
1299
|
+
c && (t.has_been_displayed ? R(We(t.template)) : (t.guid.startsWith("OFR") ? D({
|
|
1300
1300
|
...t,
|
|
1301
1301
|
has_been_displayed: !0
|
|
1302
1302
|
}) : I({
|
|
1303
1303
|
...t,
|
|
1304
1304
|
has_been_displayed: !0
|
|
1305
|
-
}),
|
|
1305
|
+
}), R(we(t.template))));
|
|
1306
1306
|
}, [c]), oe(() => {
|
|
1307
1307
|
if (c && t)
|
|
1308
1308
|
if (t.template === "MarketingOffer") {
|
|
@@ -1320,7 +1320,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1320
1320
|
});
|
|
1321
1321
|
}, [t, a, c]);
|
|
1322
1322
|
const O = () => {
|
|
1323
|
-
if (p && p(t),
|
|
1323
|
+
if (p && p(t), R(Te(t.template)), t.template === "MarketingOffer") {
|
|
1324
1324
|
const y = t;
|
|
1325
1325
|
_?.capture("clicked_messaging_insight", {
|
|
1326
1326
|
template: t.template,
|
|
@@ -1343,8 +1343,8 @@ const $ = u.createContext(null), Et = ({
|
|
|
1343
1343
|
description: t?.html_micro_description && t?.html_micro_description.length > 0 ? t.html_micro_description : t.html_description,
|
|
1344
1344
|
fontColors: { buttonColor: r?.primary_300 },
|
|
1345
1345
|
heightOverrides: l,
|
|
1346
|
-
icon:
|
|
1347
|
-
|
|
1346
|
+
icon: ve && /* @__PURE__ */ e(
|
|
1347
|
+
ve,
|
|
1348
1348
|
{
|
|
1349
1349
|
beat: t,
|
|
1350
1350
|
clientColorScheme: r,
|
|
@@ -1352,7 +1352,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1352
1352
|
type: t?.icon_type
|
|
1353
1353
|
}
|
|
1354
1354
|
),
|
|
1355
|
-
isActiveCard:
|
|
1355
|
+
isActiveCard: d,
|
|
1356
1356
|
onCardClick: O,
|
|
1357
1357
|
posthog: _,
|
|
1358
1358
|
ref: m,
|
|
@@ -1371,7 +1371,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1371
1371
|
onPreviousClick: n,
|
|
1372
1372
|
scrollRightBoundary: l,
|
|
1373
1373
|
scrollX: a,
|
|
1374
|
-
shouldApplyNewAnimation:
|
|
1374
|
+
shouldApplyNewAnimation: d = !1,
|
|
1375
1375
|
visibleCardsCount: p = 1
|
|
1376
1376
|
}) => {
|
|
1377
1377
|
const _ = ze(), { carouselCopy: C } = k(), f = Math.floor(a) > l || o - p + 1 === 0, h = a < 0 || t - 1 === o, m = _.palette.grey[500], c = i?.primary_300 ?? _.palette.primary.main;
|
|
@@ -1391,14 +1391,14 @@ const $ = u.createContext(null), Et = ({
|
|
|
1391
1391
|
},
|
|
1392
1392
|
children: [
|
|
1393
1393
|
/* @__PURE__ */ e(
|
|
1394
|
-
|
|
1394
|
+
pe,
|
|
1395
1395
|
{
|
|
1396
1396
|
"aria-disabled": f,
|
|
1397
1397
|
"aria-label": C.previous_insight_cta_aria,
|
|
1398
1398
|
disabled: f,
|
|
1399
1399
|
onClick: n,
|
|
1400
1400
|
children: /* @__PURE__ */ e(
|
|
1401
|
-
|
|
1401
|
+
Ue,
|
|
1402
1402
|
{
|
|
1403
1403
|
style: {
|
|
1404
1404
|
color: f ? m : c
|
|
@@ -1407,10 +1407,10 @@ const $ = u.createContext(null), Et = ({
|
|
|
1407
1407
|
)
|
|
1408
1408
|
}
|
|
1409
1409
|
),
|
|
1410
|
-
Array.from({ length: t }).map((E,
|
|
1411
|
-
const I =
|
|
1410
|
+
Array.from({ length: t }).map((E, R) => {
|
|
1411
|
+
const I = R === o;
|
|
1412
1412
|
return /* @__PURE__ */ e(
|
|
1413
|
-
|
|
1413
|
+
b,
|
|
1414
1414
|
{
|
|
1415
1415
|
className: "mx-insights-micro-carousel-dots",
|
|
1416
1416
|
sx: {
|
|
@@ -1418,7 +1418,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1418
1418
|
height: 8,
|
|
1419
1419
|
mr: 8,
|
|
1420
1420
|
// existing comment from meganthan "we were using `gap` instead of margin, but it doesn't work in safari browsers older than iOS 14.1"
|
|
1421
|
-
...
|
|
1421
|
+
...d ? {
|
|
1422
1422
|
borderRadius: "4px",
|
|
1423
1423
|
transformOrigin: "center",
|
|
1424
1424
|
transition: "all 0.5s ease-out",
|
|
@@ -1427,21 +1427,21 @@ const $ = u.createContext(null), Et = ({
|
|
|
1427
1427
|
borderRadius: "50%",
|
|
1428
1428
|
p: 0
|
|
1429
1429
|
},
|
|
1430
|
-
width: I &&
|
|
1430
|
+
width: I && d ? 24 : 8
|
|
1431
1431
|
}
|
|
1432
1432
|
},
|
|
1433
|
-
`carousel-button-${
|
|
1433
|
+
`carousel-button-${R}`
|
|
1434
1434
|
);
|
|
1435
1435
|
}),
|
|
1436
1436
|
/* @__PURE__ */ e(
|
|
1437
|
-
|
|
1437
|
+
pe,
|
|
1438
1438
|
{
|
|
1439
1439
|
"aria-disabled": h,
|
|
1440
1440
|
"aria-label": C.next_insight_cta_aria,
|
|
1441
1441
|
disabled: h,
|
|
1442
1442
|
onClick: r,
|
|
1443
1443
|
children: /* @__PURE__ */ e(
|
|
1444
|
-
|
|
1444
|
+
Se,
|
|
1445
1445
|
{
|
|
1446
1446
|
style: {
|
|
1447
1447
|
color: h ? m : c
|
|
@@ -1461,7 +1461,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1461
1461
|
showCTAColocatedWithText: n,
|
|
1462
1462
|
heightOverrides: l,
|
|
1463
1463
|
onCardClick: a,
|
|
1464
|
-
posthog:
|
|
1464
|
+
posthog: d,
|
|
1465
1465
|
shouldApplyNewAnimation: p = !1,
|
|
1466
1466
|
showCarouselControls: _,
|
|
1467
1467
|
showIcon: C,
|
|
@@ -1471,21 +1471,21 @@ const $ = u.createContext(null), Et = ({
|
|
|
1471
1471
|
visibleCardsCount: c = 1
|
|
1472
1472
|
// Default to 1 card visible
|
|
1473
1473
|
}) => {
|
|
1474
|
-
const E = u.useRef(null),
|
|
1474
|
+
const E = u.useRef(null), R = u.useRef(null), [I, D] = u.useState(0), [O, y] = u.useState(null), [F, z] = u.useState(null), [g, x] = u.useState(null), [U, B] = u.useState(p), { carouselCopy: j } = k(), { onEvent: Z } = Y();
|
|
1475
1475
|
u.useEffect(() => {
|
|
1476
1476
|
if (E.current && !o) {
|
|
1477
|
-
const
|
|
1477
|
+
const s = E.current.offsetWidth, A = 8;
|
|
1478
1478
|
let N;
|
|
1479
1479
|
if (c > 1) {
|
|
1480
|
-
const J = (
|
|
1481
|
-
N = (
|
|
1480
|
+
const J = (s - (c - 1) * A) / c / 3;
|
|
1481
|
+
N = (s - J - (c - 1) * A) / c;
|
|
1482
1482
|
} else
|
|
1483
|
-
N =
|
|
1484
|
-
|
|
1483
|
+
N = s;
|
|
1484
|
+
x(N);
|
|
1485
1485
|
}
|
|
1486
1486
|
}, [c, E.current?.offsetWidth]), u.useEffect(() => {
|
|
1487
|
-
const
|
|
1488
|
-
if (typeof
|
|
1487
|
+
const s = R.current?.offsetWidth;
|
|
1488
|
+
if (typeof s == "number" && o) {
|
|
1489
1489
|
const A = (P) => {
|
|
1490
1490
|
B(!0);
|
|
1491
1491
|
const ee = [
|
|
@@ -1497,51 +1497,51 @@ const $ = u.createContext(null), Et = ({
|
|
|
1497
1497
|
].find((ce) => P <= ce.maxWidth);
|
|
1498
1498
|
return ee ? ee.cardWidth : 750;
|
|
1499
1499
|
};
|
|
1500
|
-
|
|
1500
|
+
x(A(s));
|
|
1501
1501
|
const N = () => {
|
|
1502
|
-
const P =
|
|
1503
|
-
typeof P == "number" &&
|
|
1502
|
+
const P = R.current?.offsetWidth;
|
|
1503
|
+
typeof P == "number" && x(A(P));
|
|
1504
1504
|
};
|
|
1505
1505
|
return window.addEventListener("resize", N), () => {
|
|
1506
1506
|
window.removeEventListener("resize", N);
|
|
1507
1507
|
};
|
|
1508
1508
|
}
|
|
1509
|
-
}, [o,
|
|
1509
|
+
}, [o, R]);
|
|
1510
1510
|
const X = () => {
|
|
1511
|
-
Z(M.ON_CAROUSEL_FORWARD_CLICK, i), E.current &&
|
|
1512
|
-
left: I +
|
|
1511
|
+
Z(M.ON_CAROUSEL_FORWARD_CLICK, i), E.current && g && E.current.scrollTo({
|
|
1512
|
+
left: I + g + 8,
|
|
1513
1513
|
top: 0,
|
|
1514
1514
|
behavior: "smooth"
|
|
1515
1515
|
});
|
|
1516
1516
|
}, le = () => {
|
|
1517
|
-
Z(M.ON_CAROUSEL_BACK_CLICK, i), E.current &&
|
|
1518
|
-
left: Math.max(0, I - (
|
|
1517
|
+
Z(M.ON_CAROUSEL_BACK_CLICK, i), E.current && g && E.current.scrollTo({
|
|
1518
|
+
left: Math.max(0, I - (g + 8)),
|
|
1519
1519
|
top: 0,
|
|
1520
1520
|
behavior: "smooth"
|
|
1521
1521
|
});
|
|
1522
1522
|
}, ne = () => {
|
|
1523
|
-
E.current &&
|
|
1523
|
+
E.current && D(E.current.scrollLeft);
|
|
1524
1524
|
}, Q = () => {
|
|
1525
1525
|
if (!F || !O) return;
|
|
1526
1526
|
F - O > yt ? Z(M.ON_CAROUSEL_FORWARD_SWIPE, i) : Z(M.ON_CAROUSEL_BACK_SWIPE, i);
|
|
1527
|
-
}, q = (
|
|
1528
|
-
y(
|
|
1529
|
-
}, L = (
|
|
1530
|
-
y(null), z(
|
|
1527
|
+
}, q = (s) => {
|
|
1528
|
+
y(s.targetTouches[0].clientX);
|
|
1529
|
+
}, L = (s) => {
|
|
1530
|
+
y(null), z(s.targetTouches[0].clientX);
|
|
1531
1531
|
}, ue = {
|
|
1532
1532
|
clientColorScheme: r,
|
|
1533
1533
|
showCTAColocatedWithText: n,
|
|
1534
1534
|
heightOverrides: l,
|
|
1535
|
-
posthog:
|
|
1535
|
+
posthog: d,
|
|
1536
1536
|
showIcon: C,
|
|
1537
1537
|
variant: h
|
|
1538
|
-
}, ae =
|
|
1538
|
+
}, ae = g ? Math.round(I / (g + 8)) : 0, Fe = E.current ? E.current.scrollWidth - E.current.offsetWidth : 0;
|
|
1539
1539
|
return /* @__PURE__ */ v(
|
|
1540
1540
|
K,
|
|
1541
1541
|
{
|
|
1542
1542
|
"aria-label": j.carousel_title,
|
|
1543
1543
|
"aria-roledescription": "carousel",
|
|
1544
|
-
ref:
|
|
1544
|
+
ref: R,
|
|
1545
1545
|
role: "group/region",
|
|
1546
1546
|
sx: {
|
|
1547
1547
|
alignItems: "center",
|
|
@@ -1577,24 +1577,24 @@ const $ = u.createContext(null), Et = ({
|
|
|
1577
1577
|
}
|
|
1578
1578
|
},
|
|
1579
1579
|
children: [
|
|
1580
|
-
t.map((
|
|
1580
|
+
t.map((s, A) => {
|
|
1581
1581
|
const N = A + 1, P = t.length + 1, J = Qe(
|
|
1582
1582
|
j.card_position_in_carousel_aria,
|
|
1583
1583
|
N.toString(),
|
|
1584
1584
|
P.toString()
|
|
1585
|
-
), ee =
|
|
1585
|
+
), ee = s.micro_title && s.micro_title.length > 0, ce = s.micro_description && s.micro_description.length > 0, Be = ee ? s.micro_title : s.title, Ze = ce ? s.micro_description : s.description;
|
|
1586
1586
|
return /* @__PURE__ */ e(
|
|
1587
1587
|
vt,
|
|
1588
1588
|
{
|
|
1589
|
-
ariaLabel: `${J}: ${
|
|
1590
|
-
beat:
|
|
1589
|
+
ariaLabel: `${J}: ${Be}, ${Ze}`,
|
|
1590
|
+
beat: s,
|
|
1591
1591
|
index: A,
|
|
1592
1592
|
isActiveCard: A === ae,
|
|
1593
1593
|
onCardClick: a,
|
|
1594
|
-
widthOverrides:
|
|
1594
|
+
widthOverrides: g || void 0,
|
|
1595
1595
|
...ue
|
|
1596
1596
|
},
|
|
1597
|
-
`${
|
|
1597
|
+
`${s.guid} ${A}`
|
|
1598
1598
|
);
|
|
1599
1599
|
}),
|
|
1600
1600
|
/* @__PURE__ */ e(
|
|
@@ -1602,7 +1602,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1602
1602
|
{
|
|
1603
1603
|
isActiveCard: ae === t.length,
|
|
1604
1604
|
onCardClick: a,
|
|
1605
|
-
widthOverrides:
|
|
1605
|
+
widthOverrides: g || void 0,
|
|
1606
1606
|
...ue
|
|
1607
1607
|
}
|
|
1608
1608
|
)
|
|
@@ -1617,9 +1617,9 @@ const $ = u.createContext(null), Et = ({
|
|
|
1617
1617
|
numBeats: t.length + 1,
|
|
1618
1618
|
onNextClick: X,
|
|
1619
1619
|
onPreviousClick: le,
|
|
1620
|
-
scrollRightBoundary:
|
|
1620
|
+
scrollRightBoundary: Fe,
|
|
1621
1621
|
scrollX: I,
|
|
1622
|
-
shouldApplyNewAnimation:
|
|
1622
|
+
shouldApplyNewAnimation: U,
|
|
1623
1623
|
visibleCardsCount: c
|
|
1624
1624
|
}
|
|
1625
1625
|
)
|
|
@@ -1633,7 +1633,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1633
1633
|
posthog: r,
|
|
1634
1634
|
widthOverrides: n
|
|
1635
1635
|
}) => {
|
|
1636
|
-
const { carouselCopy: l } = k(), { onEvent: a } = Y(),
|
|
1636
|
+
const { carouselCopy: l } = k(), { onEvent: a } = Y(), d = () => {
|
|
1637
1637
|
a && (a(M.ON_VIEW_MORE_CLICKED, i), t(), r?.capture("clicked_view_more"));
|
|
1638
1638
|
};
|
|
1639
1639
|
return l ? /* @__PURE__ */ v(
|
|
@@ -1649,9 +1649,10 @@ const $ = u.createContext(null), Et = ({
|
|
|
1649
1649
|
},
|
|
1650
1650
|
children: [
|
|
1651
1651
|
/* @__PURE__ */ e(
|
|
1652
|
-
|
|
1652
|
+
Ge,
|
|
1653
1653
|
{
|
|
1654
1654
|
sx: {
|
|
1655
|
+
color: o?.primary_300,
|
|
1655
1656
|
fontSize: 18,
|
|
1656
1657
|
fontWeight: 700,
|
|
1657
1658
|
lineHeight: "24px"
|
|
@@ -1660,42 +1661,19 @@ const $ = u.createContext(null), Et = ({
|
|
|
1660
1661
|
children: l.carousel_title
|
|
1661
1662
|
}
|
|
1662
1663
|
),
|
|
1663
|
-
/* @__PURE__ */
|
|
1664
|
-
|
|
1664
|
+
/* @__PURE__ */ e(
|
|
1665
|
+
Pe,
|
|
1665
1666
|
{
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
textDecoration: "none",
|
|
1672
|
-
":hover": {
|
|
1673
|
-
borderBottom: "none"
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
},
|
|
1677
|
-
underline: "none",
|
|
1678
|
-
children: [
|
|
1679
|
-
/* @__PURE__ */ e(
|
|
1680
|
-
pe,
|
|
1681
|
-
{
|
|
1682
|
-
sx: {
|
|
1683
|
-
color: o?.primary_300,
|
|
1684
|
-
fontSize: 15,
|
|
1685
|
-
fontWeight: 600,
|
|
1686
|
-
lineHeight: "20px"
|
|
1687
|
-
},
|
|
1688
|
-
variant: "body1",
|
|
1689
|
-
children: l.view_all_insights_in_full_feed_cta_aria
|
|
1690
|
-
}
|
|
1691
|
-
),
|
|
1692
|
-
/* @__PURE__ */ e(Me, { sx: { color: o?.primary_300, ml: "8px" } })
|
|
1693
|
-
]
|
|
1667
|
+
endIcon: /* @__PURE__ */ e(Se, { size: 20 }),
|
|
1668
|
+
onClick: d,
|
|
1669
|
+
size: "small",
|
|
1670
|
+
variant: "text",
|
|
1671
|
+
children: l.view_all_insights_in_full_feed_cta_aria
|
|
1694
1672
|
}
|
|
1695
1673
|
)
|
|
1696
1674
|
]
|
|
1697
1675
|
}
|
|
1698
|
-
) : /* @__PURE__ */ e(
|
|
1676
|
+
) : /* @__PURE__ */ e(be, {});
|
|
1699
1677
|
}, Tt = G(Ot), Wt = ({
|
|
1700
1678
|
heightOverrides: i,
|
|
1701
1679
|
widthOverrides: o,
|
|
@@ -1703,7 +1681,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1703
1681
|
}) => {
|
|
1704
1682
|
const { carouselCopy: r } = k();
|
|
1705
1683
|
return /* @__PURE__ */ e(
|
|
1706
|
-
|
|
1684
|
+
b,
|
|
1707
1685
|
{
|
|
1708
1686
|
"aria-label": r?.carousel_title,
|
|
1709
1687
|
"aria-roledescription": "carousel",
|
|
@@ -1717,7 +1695,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1717
1695
|
children: t
|
|
1718
1696
|
}
|
|
1719
1697
|
);
|
|
1720
|
-
},
|
|
1698
|
+
}, He = ({
|
|
1721
1699
|
ariaLabel: i,
|
|
1722
1700
|
carouselSize: o,
|
|
1723
1701
|
clientColorScheme: t,
|
|
@@ -1725,11 +1703,11 @@ const $ = u.createContext(null), Et = ({
|
|
|
1725
1703
|
onCardClick: n,
|
|
1726
1704
|
posthog: l,
|
|
1727
1705
|
showIcon: a,
|
|
1728
|
-
showWithMargin:
|
|
1706
|
+
showWithMargin: d,
|
|
1729
1707
|
variant: p,
|
|
1730
1708
|
widthOverrides: _
|
|
1731
1709
|
}) => {
|
|
1732
|
-
const { cardsCopy: C } = k(), { onEvent: f } = Y(), { onPageview: h } =
|
|
1710
|
+
const { cardsCopy: C } = k(), { onEvent: f } = Y(), { onPageview: h } = Le();
|
|
1733
1711
|
u.useEffect(() => {
|
|
1734
1712
|
h(H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
|
|
1735
1713
|
}, []);
|
|
@@ -1746,7 +1724,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1746
1724
|
description: C.no_relevant_insights_card_description,
|
|
1747
1725
|
fontColors: { buttonColor: t?.primary_300 },
|
|
1748
1726
|
heightOverrides: r,
|
|
1749
|
-
icon: /* @__PURE__ */ e(
|
|
1727
|
+
icon: /* @__PURE__ */ e(xe, {}),
|
|
1750
1728
|
isZeroState: !0,
|
|
1751
1729
|
onCardClick: m,
|
|
1752
1730
|
posthog: l,
|
|
@@ -1754,9 +1732,9 @@ const $ = u.createContext(null), Et = ({
|
|
|
1754
1732
|
style: {
|
|
1755
1733
|
cardStyle: {
|
|
1756
1734
|
card: {
|
|
1757
|
-
height: `calc(${
|
|
1735
|
+
height: `calc(${Ne[o]}px - 44px)`,
|
|
1758
1736
|
m: "0 auto",
|
|
1759
|
-
width:
|
|
1737
|
+
width: d ? "calc(100% - 32px)" : "100%"
|
|
1760
1738
|
},
|
|
1761
1739
|
description: {
|
|
1762
1740
|
WebkitLineClamp: 4
|
|
@@ -1771,7 +1749,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1771
1749
|
widthOverrides: _
|
|
1772
1750
|
}
|
|
1773
1751
|
);
|
|
1774
|
-
}, li = G(
|
|
1752
|
+
}, li = G(He), ke = ({
|
|
1775
1753
|
ariaLabel: i,
|
|
1776
1754
|
carouselSize: o,
|
|
1777
1755
|
heightOverrides: t,
|
|
@@ -1779,10 +1757,10 @@ const $ = u.createContext(null), Et = ({
|
|
|
1779
1757
|
posthog: n,
|
|
1780
1758
|
showIcon: l,
|
|
1781
1759
|
showWithMargin: a,
|
|
1782
|
-
variant:
|
|
1760
|
+
variant: d,
|
|
1783
1761
|
widthOverrides: p
|
|
1784
1762
|
}) => {
|
|
1785
|
-
const { onPageview: _ } =
|
|
1763
|
+
const { onPageview: _ } = Le(), { zeroStateCopy: C } = k();
|
|
1786
1764
|
return u.useEffect(() => {
|
|
1787
1765
|
_(H.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
|
|
1788
1766
|
}, []), /* @__PURE__ */ e(
|
|
@@ -1791,7 +1769,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1791
1769
|
ariaLabel: i,
|
|
1792
1770
|
description: C.carousel_zero_state_description,
|
|
1793
1771
|
heightOverrides: t,
|
|
1794
|
-
icon: /* @__PURE__ */ e(
|
|
1772
|
+
icon: /* @__PURE__ */ e(xe, {}),
|
|
1795
1773
|
isZeroState: !0,
|
|
1796
1774
|
onCardClick: r,
|
|
1797
1775
|
posthog: n,
|
|
@@ -1799,7 +1777,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1799
1777
|
style: {
|
|
1800
1778
|
cardStyle: {
|
|
1801
1779
|
card: {
|
|
1802
|
-
height: `calc(${
|
|
1780
|
+
height: `calc(${Ne[o]}px - 44px)`,
|
|
1803
1781
|
m: "0 auto",
|
|
1804
1782
|
width: a ? "calc(100% - 32px)" : "100%"
|
|
1805
1783
|
},
|
|
@@ -1809,12 +1787,12 @@ const $ = u.createContext(null), Et = ({
|
|
|
1809
1787
|
}
|
|
1810
1788
|
},
|
|
1811
1789
|
title: C.carousel_zero_state_title,
|
|
1812
|
-
variant:
|
|
1790
|
+
variant: d,
|
|
1813
1791
|
widthOverrides: p
|
|
1814
1792
|
}
|
|
1815
1793
|
);
|
|
1816
|
-
}, ni = G(
|
|
1817
|
-
|
|
1794
|
+
}, ni = G(ke), wt = () => /* @__PURE__ */ e(
|
|
1795
|
+
b,
|
|
1818
1796
|
{
|
|
1819
1797
|
sx: {
|
|
1820
1798
|
alignItems: "center",
|
|
@@ -1825,7 +1803,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1825
1803
|
},
|
|
1826
1804
|
children: /* @__PURE__ */ e(qe, {})
|
|
1827
1805
|
}
|
|
1828
|
-
), V = new ht(),
|
|
1806
|
+
), V = new ht(), Dt = ({
|
|
1829
1807
|
allowSingleCardPeeking: i,
|
|
1830
1808
|
areBeatsLoading: o,
|
|
1831
1809
|
beats: t = [],
|
|
@@ -1835,7 +1813,7 @@ const $ = u.createContext(null), Et = ({
|
|
|
1835
1813
|
showCTAColocatedWithText: n = !0,
|
|
1836
1814
|
endpoint: l = "/",
|
|
1837
1815
|
heightOverrides: a,
|
|
1838
|
-
logOutUser:
|
|
1816
|
+
logOutUser: d,
|
|
1839
1817
|
onCardClick: p = () => {
|
|
1840
1818
|
},
|
|
1841
1819
|
onEvent: _ = () => {
|
|
@@ -1847,21 +1825,21 @@ const $ = u.createContext(null), Et = ({
|
|
|
1847
1825
|
showBorder: m = !0,
|
|
1848
1826
|
showCarouselControls: c,
|
|
1849
1827
|
showHeader: E,
|
|
1850
|
-
showIcon:
|
|
1828
|
+
showIcon: R,
|
|
1851
1829
|
showWithMargin: I = !0,
|
|
1852
|
-
token:
|
|
1830
|
+
token: D = "",
|
|
1853
1831
|
useDarkMode: O,
|
|
1854
1832
|
userHasFullInsightFeedBeats: y,
|
|
1855
1833
|
variant: F,
|
|
1856
1834
|
visibleCardsCount: z = 1,
|
|
1857
|
-
widthOverrides:
|
|
1835
|
+
widthOverrides: g
|
|
1858
1836
|
}) => {
|
|
1859
|
-
const [
|
|
1837
|
+
const [x, U] = te("STANDARD"), [B, j] = te(!1), [Z, X] = te(!1), le = et([_], V), ne = tt([C], V);
|
|
1860
1838
|
u.useEffect(() => {
|
|
1861
|
-
!V.isInitialized && !Z && (V.initialize(l,
|
|
1862
|
-
}, [l,
|
|
1839
|
+
!V.isInitialized && !Z && (V.initialize(l, D, d).catch(() => X(!1)), X(!0));
|
|
1840
|
+
}, [l, D, d, V.isInitialized, Z]), u.useEffect(() => {
|
|
1863
1841
|
const L = window.innerHeight;
|
|
1864
|
-
L < 180 ?
|
|
1842
|
+
L < 180 ? U("STANDARD") : L >= 180 && L < 200 ? U("LARGE") : L >= 200 && L < 248 ? U("XLARGE") : L >= 248 && U("XXLARGE");
|
|
1865
1843
|
}, [window.innerHeight]), u.useEffect(() => {
|
|
1866
1844
|
j(!o && V.isInitialized);
|
|
1867
1845
|
}, [o, V.isInitialized]);
|
|
@@ -1870,32 +1848,32 @@ const $ = u.createContext(null), Et = ({
|
|
|
1870
1848
|
heightOverrides: a,
|
|
1871
1849
|
onCardClick: p,
|
|
1872
1850
|
posthog: f,
|
|
1873
|
-
showIcon:
|
|
1851
|
+
showIcon: R,
|
|
1874
1852
|
showWithMargin: I,
|
|
1875
1853
|
useDarkMode: O,
|
|
1876
|
-
widthOverrides:
|
|
1854
|
+
widthOverrides: g
|
|
1877
1855
|
}, q = {
|
|
1878
|
-
carouselSize:
|
|
1856
|
+
carouselSize: x,
|
|
1879
1857
|
variant: F,
|
|
1880
1858
|
...Q
|
|
1881
1859
|
};
|
|
1882
|
-
return /* @__PURE__ */ e(Et, { onEvent: le, onPageview: ne, store: V, children: /* @__PURE__ */ v(Wt, { heightOverrides: a, widthOverrides:
|
|
1860
|
+
return /* @__PURE__ */ e(Et, { onEvent: le, onPageview: ne, store: V, children: /* @__PURE__ */ v(Wt, { heightOverrides: a, widthOverrides: g, children: [
|
|
1883
1861
|
!B && /* @__PURE__ */ e(wt, {}),
|
|
1884
1862
|
B && E && /* @__PURE__ */ e(
|
|
1885
1863
|
Tt,
|
|
1886
1864
|
{
|
|
1887
|
-
analyticsMetadata:
|
|
1865
|
+
analyticsMetadata: fe,
|
|
1888
1866
|
clientColorScheme: r,
|
|
1889
1867
|
onCardClick: p,
|
|
1890
1868
|
posthog: f,
|
|
1891
|
-
widthOverrides:
|
|
1869
|
+
widthOverrides: g
|
|
1892
1870
|
}
|
|
1893
1871
|
),
|
|
1894
1872
|
B && !!t.length && /* @__PURE__ */ e(
|
|
1895
1873
|
At,
|
|
1896
1874
|
{
|
|
1897
1875
|
allowSingleCardPeeking: i,
|
|
1898
|
-
analyticsMetadata:
|
|
1876
|
+
analyticsMetadata: fe,
|
|
1899
1877
|
beats: t,
|
|
1900
1878
|
clientColorScheme: r,
|
|
1901
1879
|
shouldApplyNewAnimation: h,
|
|
@@ -1905,10 +1883,10 @@ const $ = u.createContext(null), Et = ({
|
|
|
1905
1883
|
...Q
|
|
1906
1884
|
}
|
|
1907
1885
|
),
|
|
1908
|
-
B && !t.length && y && /* @__PURE__ */ e(
|
|
1909
|
-
B && !t.length && !y && /* @__PURE__ */ e(
|
|
1886
|
+
B && !t.length && y && /* @__PURE__ */ e(He, { clientColorScheme: r, ...q }),
|
|
1887
|
+
B && !t.length && !y && /* @__PURE__ */ e(ke, { ...q })
|
|
1910
1888
|
] }) });
|
|
1911
|
-
}, ai = G(
|
|
1889
|
+
}, ai = G(Dt), xt = ({
|
|
1912
1890
|
isActiveCard: i,
|
|
1913
1891
|
ariaLabel: o,
|
|
1914
1892
|
clientColorScheme: t,
|
|
@@ -1916,11 +1894,11 @@ const $ = u.createContext(null), Et = ({
|
|
|
1916
1894
|
onCardClick: n,
|
|
1917
1895
|
posthog: l,
|
|
1918
1896
|
showIcon: a,
|
|
1919
|
-
variant:
|
|
1897
|
+
variant: d,
|
|
1920
1898
|
widthOverrides: p
|
|
1921
1899
|
}) => {
|
|
1922
|
-
const _ =
|
|
1923
|
-
threshold:
|
|
1900
|
+
const _ = se(), { ref: C, inView: f } = Me({
|
|
1901
|
+
threshold: Ve
|
|
1924
1902
|
}), { cardsCopy: h } = k(), { onEvent: m } = Y();
|
|
1925
1903
|
oe(() => {
|
|
1926
1904
|
f && (m(De.ON_VIEW_MORE_VIEWED), l?.capture("viewed_insight", {
|
|
@@ -1947,11 +1925,11 @@ const $ = u.createContext(null), Et = ({
|
|
|
1947
1925
|
ref: C,
|
|
1948
1926
|
showIcon: a,
|
|
1949
1927
|
title: h.view_more_card_title,
|
|
1950
|
-
variant:
|
|
1928
|
+
variant: d,
|
|
1951
1929
|
widthOverrides: p
|
|
1952
1930
|
}
|
|
1953
1931
|
);
|
|
1954
|
-
}, Lt = G(
|
|
1932
|
+
}, Lt = G(xt);
|
|
1955
1933
|
export {
|
|
1956
1934
|
ht as A,
|
|
1957
1935
|
vt as B,
|
|
@@ -1959,12 +1937,12 @@ export {
|
|
|
1959
1937
|
Et as I,
|
|
1960
1938
|
At as M,
|
|
1961
1939
|
li as N,
|
|
1962
|
-
|
|
1940
|
+
fe as T,
|
|
1963
1941
|
Lt as V,
|
|
1964
1942
|
ni as Z,
|
|
1965
1943
|
re as a,
|
|
1966
1944
|
ai as b,
|
|
1967
1945
|
ft as c,
|
|
1968
|
-
|
|
1969
|
-
|
|
1946
|
+
gt as d,
|
|
1947
|
+
xe as e
|
|
1970
1948
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, B as e, C as o, c as t, b as i, I as d, M as n, a as C, d as c, N as I, V as M, Z as g, e as h } from "../ViewMoreMicroCard-
|
|
1
|
+
import { A as s, B as e, C as o, c as t, b as i, I as d, M as n, a as C, d as c, N as I, V as M, Z as g, e as h } from "../ViewMoreMicroCard-K-RUX-V6.mjs";
|
|
2
2
|
export {
|
|
3
3
|
s as AppStore,
|
|
4
4
|
e as BeatCard,
|
package/dist/trends/index.es.js
CHANGED
|
@@ -19,7 +19,7 @@ import { DataGridPro as ut } from "@mui/x-data-grid-pro";
|
|
|
19
19
|
import { C as gt } from "../CurrencyText-kyC1aseI.mjs";
|
|
20
20
|
import { b as mt } from "../Localization-2MODESHW.mjs";
|
|
21
21
|
import { H as Ie } from "../HeaderCell-DjuifqHJ.mjs";
|
|
22
|
-
import { T as A, b as pt } from "../ViewMoreMicroCard-
|
|
22
|
+
import { T as A, b as pt } from "../ViewMoreMicroCard-K-RUX-V6.mjs";
|
|
23
23
|
import { A as y, W as ke } from "../WidgetContainer-DtPnPQZY.mjs";
|
|
24
24
|
import { c as Ct } from "../Category-CevNQ03n.mjs";
|
|
25
25
|
import { a as Ne, T as He } from "../TransactionDetails-_cXLXTd3.mjs";
|