@mx-cartographer/experiences 7.0.34-alpha.sms1 → 7.0.35
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,39 +1,38 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
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
|
-
import { observer as
|
|
4
|
-
import
|
|
5
|
-
import { useTheme as Me, ThemeProvider as Ue } from "@mui/material/styles";
|
|
6
|
-
import ze from "@mui/material/Link";
|
|
3
|
+
import { observer as G } from "mobx-react-lite";
|
|
4
|
+
import Ge from "@mui/material/Link";
|
|
7
5
|
import K from "@mui/material/Stack";
|
|
8
6
|
import pe from "@mui/material/Typography";
|
|
9
|
-
import { ChevronLeft as
|
|
10
|
-
import { L as
|
|
7
|
+
import { ChevronLeft as be, ChevronRight as Me } from "@mxenabled/mx-icons";
|
|
8
|
+
import { L as Ue } from "./Loader-DUaFpDGv.mjs";
|
|
11
9
|
import U from "@mui/material/Box";
|
|
12
10
|
import _e from "@mui/material/IconButton";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
11
|
+
import { useTheme as ze } from "@mui/material/styles";
|
|
12
|
+
import { useInView as Ae } from "react-intersection-observer";
|
|
13
|
+
import { P as Ke, CategoryIcon as $e, useTokens as Oe, MerchantLogo as Ye, Icon as ie } from "@mxenabled/mxui";
|
|
14
|
+
import se from "@mui/material/styles/useTheme";
|
|
15
|
+
import { b as je } from "./Category-CevNQ03n.mjs";
|
|
16
|
+
import { css as Xe } from "@mxenabled/cssinjs";
|
|
17
|
+
import { b as Qe } from "./Localization-2MODESHW.mjs";
|
|
18
|
+
import qe from "@mui/material/CircularProgress";
|
|
19
|
+
import { makeAutoObservable as de, runInAction as Te } from "mobx";
|
|
20
|
+
import { G as Ce, a as Je, u as et, b as tt } from "./useCombineEvents-BUDIR1ba.mjs";
|
|
22
21
|
import { B as fe } from "./BeatApi-DhJpgCLz.mjs";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
22
|
+
import it from "@mui/material/Card";
|
|
23
|
+
import ot from "@mui/material/CardActions";
|
|
24
|
+
import rt from "@mui/material/CardContent";
|
|
25
|
+
import lt from "@mui/material/CardHeader";
|
|
27
26
|
const me = {
|
|
28
27
|
featureVersion: "spendVsIncomeTrends"
|
|
29
28
|
};
|
|
30
|
-
class
|
|
29
|
+
class nt {
|
|
31
30
|
copyApi = new Ce("/", "");
|
|
32
31
|
copyObject = {};
|
|
33
32
|
namespace = "experiences";
|
|
34
33
|
translationKey = "micro_insights";
|
|
35
34
|
constructor() {
|
|
36
|
-
|
|
35
|
+
de(this);
|
|
37
36
|
}
|
|
38
37
|
// NOTE: Not sure if this is special case, but other stores have this deprecation todo
|
|
39
38
|
// DEPRECATED: Initialize api in constructor and use loadCopy instead
|
|
@@ -43,8 +42,8 @@ class ct {
|
|
|
43
42
|
};
|
|
44
43
|
loadCopy = async () => {
|
|
45
44
|
const o = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
|
|
46
|
-
|
|
47
|
-
this.copyObject = o[this.translationKey]
|
|
45
|
+
Te(() => {
|
|
46
|
+
this.copyObject = o[this.translationKey];
|
|
48
47
|
});
|
|
49
48
|
};
|
|
50
49
|
get cardsCopy() {
|
|
@@ -57,7 +56,7 @@ class ct {
|
|
|
57
56
|
return this.copyObject.zero_state;
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
|
-
const
|
|
59
|
+
const he = {
|
|
61
60
|
BillAmountNotStandard: "BillAmountNotStandard",
|
|
62
61
|
CanadianUpcomingDeadlineAlert: "CanadianUpcomingDeadlineAlert",
|
|
63
62
|
DuplicatePaymentV2: "DuplicatePaymentV2",
|
|
@@ -76,45 +75,45 @@ const Ee = {
|
|
|
76
75
|
MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
|
|
77
76
|
}, S = window?.app?.clientConfig?.microwidget_instance_id || "", ge = {
|
|
78
77
|
INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
|
|
79
|
-
},
|
|
78
|
+
}, We = (i) => `on${i}Click`, we = (i) => `on${i}View`, xe = (i) => `on${i}ViewFirstTime`, Ee = (i) => i.replace(/([a-z])([A-Z])/g, "$1 $2"), at = () => Object.values(he).reduce(
|
|
80
79
|
(i, o) => ({
|
|
81
80
|
...i,
|
|
82
|
-
[
|
|
83
|
-
action:
|
|
84
|
-
category:
|
|
85
|
-
label:
|
|
81
|
+
[We(o)]: {
|
|
82
|
+
action: w.MICRO_BEAT_CLICKED,
|
|
83
|
+
category: W.BEAT_INTERACTION,
|
|
84
|
+
label: Ee(o),
|
|
86
85
|
value: S
|
|
87
86
|
}
|
|
88
87
|
}),
|
|
89
88
|
{}
|
|
90
|
-
),
|
|
89
|
+
), ct = () => Object.values(he).reduce(
|
|
91
90
|
(i, o) => ({
|
|
92
91
|
...i,
|
|
93
|
-
[
|
|
94
|
-
action:
|
|
95
|
-
category:
|
|
96
|
-
label:
|
|
92
|
+
[we(o)]: {
|
|
93
|
+
action: w.MICRO_BEAT_DISPLAYED,
|
|
94
|
+
category: W.BEAT_INTERACTION,
|
|
95
|
+
label: Ee(o),
|
|
97
96
|
value: S
|
|
98
97
|
}
|
|
99
98
|
}),
|
|
100
99
|
{}
|
|
101
|
-
),
|
|
100
|
+
), st = () => Object.values(he).reduce(
|
|
102
101
|
(i, o) => ({
|
|
103
102
|
...i,
|
|
104
|
-
[
|
|
105
|
-
action:
|
|
106
|
-
category:
|
|
107
|
-
label:
|
|
103
|
+
[xe(o)]: {
|
|
104
|
+
action: w.MICRO_BEAT_DISPLAYED_FIRST_TIME,
|
|
105
|
+
category: W.BEAT_INTERACTION,
|
|
106
|
+
label: Ee(o),
|
|
108
107
|
value: S
|
|
109
108
|
}
|
|
110
109
|
}),
|
|
111
110
|
{}
|
|
112
|
-
),
|
|
111
|
+
), T = {
|
|
113
112
|
CARD: "Card",
|
|
114
113
|
CAROUSEL_CONTROL: "Carousel Control",
|
|
115
114
|
MICRO_WIDGET: "Micro Widget",
|
|
116
115
|
VIEW_MORE: "View More"
|
|
117
|
-
},
|
|
116
|
+
}, W = {
|
|
118
117
|
MICRO_WIDGET_INTERACTION: "Micro Widget Interaction",
|
|
119
118
|
BEAT_INTERACTION: "Beat Interaction"
|
|
120
119
|
}, M = {
|
|
@@ -124,9 +123,9 @@ const Ee = {
|
|
|
124
123
|
ON_CAROUSEL_FORWARD_SWIPE: "onCarouselForwardSwipe",
|
|
125
124
|
ON_NO_RELEVANT_INSIGHTS_CLICKED: "onNoRelevantInsightsClicked",
|
|
126
125
|
ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
|
|
127
|
-
},
|
|
126
|
+
}, De = {
|
|
128
127
|
ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
|
|
129
|
-
},
|
|
128
|
+
}, w = {
|
|
130
129
|
CONTROL_BACKWARD: "Control Backward",
|
|
131
130
|
CONTROL_FORWARD: "Control Forward",
|
|
132
131
|
MICRO_BEAT_CLICKED: "Micro Beat Clicked",
|
|
@@ -134,84 +133,84 @@ const Ee = {
|
|
|
134
133
|
MICRO_BEAT_DISPLAYED_FIRST_TIME: "Micro Beat Displayed For First Time",
|
|
135
134
|
SWIPE_BACKWARD: "Swipe Backward",
|
|
136
135
|
SWIPE_FORWARD: "Swipe Forward"
|
|
137
|
-
},
|
|
136
|
+
}, H = {
|
|
138
137
|
MICRO_WIDGET_CAROUSEL: "Micro Widget Carousel",
|
|
139
138
|
MICRO_WIDGET_CAROUSEL_ZERO_STATE: "Micro Widget Carousel Zero State",
|
|
140
139
|
MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS: "Micro Widget Carousel No Relevant Insights"
|
|
141
140
|
}, Re = {
|
|
142
|
-
[
|
|
143
|
-
label:
|
|
144
|
-
name:
|
|
141
|
+
[H.MICRO_WIDGET_CAROUSEL]: {
|
|
142
|
+
label: T.MICRO_WIDGET,
|
|
143
|
+
name: H.MICRO_WIDGET_CAROUSEL,
|
|
145
144
|
path: ge.INSIGHTS_MICRO_WIDGET,
|
|
146
145
|
value: S
|
|
147
146
|
},
|
|
148
147
|
// zero state
|
|
149
|
-
[
|
|
150
|
-
label:
|
|
151
|
-
name:
|
|
148
|
+
[H.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
|
|
149
|
+
label: T.MICRO_WIDGET,
|
|
150
|
+
name: H.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
|
|
152
151
|
path: ge.INSIGHTS_MICRO_WIDGET,
|
|
153
152
|
value: S
|
|
154
153
|
},
|
|
155
154
|
// no relevant cards
|
|
156
|
-
[
|
|
157
|
-
label:
|
|
158
|
-
name:
|
|
155
|
+
[H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS]: {
|
|
156
|
+
label: T.MICRO_WIDGET,
|
|
157
|
+
name: H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS,
|
|
159
158
|
path: "/micro-widget",
|
|
160
159
|
value: S
|
|
161
160
|
}
|
|
162
161
|
}, Ie = {
|
|
163
162
|
// carousel control interaction events - clicks and swipes
|
|
164
163
|
[M.ON_CAROUSEL_BACK_CLICK]: {
|
|
165
|
-
action:
|
|
166
|
-
category:
|
|
167
|
-
label:
|
|
164
|
+
action: w.CONTROL_BACKWARD,
|
|
165
|
+
category: W.MICRO_WIDGET_INTERACTION,
|
|
166
|
+
label: T.CAROUSEL_CONTROL,
|
|
168
167
|
value: S
|
|
169
168
|
},
|
|
170
169
|
[M.ON_CAROUSEL_FORWARD_CLICK]: {
|
|
171
|
-
action:
|
|
172
|
-
category:
|
|
173
|
-
label:
|
|
170
|
+
action: w.CONTROL_FORWARD,
|
|
171
|
+
category: W.MICRO_WIDGET_INTERACTION,
|
|
172
|
+
label: T.CAROUSEL_CONTROL,
|
|
174
173
|
value: S
|
|
175
174
|
},
|
|
176
175
|
[M.ON_CAROUSEL_BACK_SWIPE]: {
|
|
177
|
-
action:
|
|
178
|
-
category:
|
|
179
|
-
label:
|
|
176
|
+
action: w.SWIPE_BACKWARD,
|
|
177
|
+
category: W.MICRO_WIDGET_INTERACTION,
|
|
178
|
+
label: T.CAROUSEL_CONTROL,
|
|
180
179
|
value: S
|
|
181
180
|
},
|
|
182
181
|
[M.ON_CAROUSEL_FORWARD_SWIPE]: {
|
|
183
|
-
action:
|
|
184
|
-
category:
|
|
185
|
-
label:
|
|
182
|
+
action: w.SWIPE_FORWARD,
|
|
183
|
+
category: W.MICRO_WIDGET_INTERACTION,
|
|
184
|
+
label: T.CAROUSEL_CONTROL,
|
|
186
185
|
value: S
|
|
187
186
|
},
|
|
188
187
|
// read more card events
|
|
189
188
|
[M.ON_VIEW_MORE_CLICKED]: {
|
|
190
|
-
action:
|
|
191
|
-
category:
|
|
192
|
-
label:
|
|
189
|
+
action: w.MICRO_BEAT_CLICKED,
|
|
190
|
+
category: W.BEAT_INTERACTION,
|
|
191
|
+
label: T.VIEW_MORE,
|
|
193
192
|
value: S
|
|
194
193
|
},
|
|
195
|
-
[
|
|
196
|
-
action:
|
|
197
|
-
category:
|
|
198
|
-
label:
|
|
194
|
+
[De.ON_VIEW_MORE_VIEWED]: {
|
|
195
|
+
action: w.MICRO_BEAT_DISPLAYED,
|
|
196
|
+
category: W.BEAT_INTERACTION,
|
|
197
|
+
label: T.VIEW_MORE,
|
|
199
198
|
value: S
|
|
200
199
|
},
|
|
201
|
-
...
|
|
202
|
-
...
|
|
203
|
-
...
|
|
200
|
+
...at(),
|
|
201
|
+
...ct(),
|
|
202
|
+
...st()
|
|
204
203
|
}, ye = async (i, o) => !o || !Ie[i] ? null : o.sendAnalyticEvent(Ie[i]).then((t) => t).catch((t) => {
|
|
205
204
|
throw t;
|
|
206
205
|
}), ve = async (i, o) => !o || !Re[i] ? null : o.sendAnalyticsPageview(Re[i]).then((t) => t).catch((t) => {
|
|
207
206
|
throw t;
|
|
208
207
|
});
|
|
209
|
-
class
|
|
208
|
+
class dt {
|
|
210
209
|
onAnalyticEvent = ye;
|
|
211
210
|
onAnalyticPageView = ve;
|
|
212
211
|
beatApi = new fe("/", "");
|
|
213
212
|
constructor() {
|
|
214
|
-
|
|
213
|
+
de(this);
|
|
215
214
|
}
|
|
216
215
|
initialize = async (o, t, r) => {
|
|
217
216
|
this.onAnalyticEvent = (l, n) => {
|
|
@@ -231,7 +230,7 @@ class Et {
|
|
|
231
230
|
this.beatApi.updateOffer(o);
|
|
232
231
|
};
|
|
233
232
|
}
|
|
234
|
-
class
|
|
233
|
+
class ht {
|
|
235
234
|
copyStore;
|
|
236
235
|
endpoint = "/";
|
|
237
236
|
insightsMicroWidgetStore;
|
|
@@ -239,17 +238,17 @@ class ut {
|
|
|
239
238
|
token = "";
|
|
240
239
|
isInitialized = !1;
|
|
241
240
|
constructor() {
|
|
242
|
-
this.copyStore = new
|
|
241
|
+
this.copyStore = new nt(), this.insightsMicroWidgetStore = new dt(), de(this);
|
|
243
242
|
}
|
|
244
243
|
initialize = async (o, t, r) => {
|
|
245
244
|
await this.copyStore.initialize(o, t), await this.insightsMicroWidgetStore.initialize(o, t, r);
|
|
246
|
-
const l = await
|
|
247
|
-
|
|
245
|
+
const l = await Je(o, t, "1.0.0", "Micro Insights Carousel");
|
|
246
|
+
Te(() => {
|
|
248
247
|
this.session = l, this.isInitialized = !0;
|
|
249
248
|
});
|
|
250
249
|
};
|
|
251
250
|
}
|
|
252
|
-
const $ = u.createContext(null),
|
|
251
|
+
const $ = u.createContext(null), Et = ({
|
|
253
252
|
onEvent: i,
|
|
254
253
|
onPageview: o,
|
|
255
254
|
store: t,
|
|
@@ -273,8 +272,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
273
272
|
variant: c,
|
|
274
273
|
widthOverrides: E
|
|
275
274
|
}, g) {
|
|
276
|
-
const
|
|
277
|
-
|
|
275
|
+
const I = se(), [x, O] = u.useState(!1), { cardStyle: y, linkTextStyle: F } = f, z = c ? y : { border: "none", boxShadow: "none", ...y }, R = /* @__PURE__ */ e(
|
|
276
|
+
Ke,
|
|
278
277
|
{
|
|
279
278
|
className: "mx-micro-card-description",
|
|
280
279
|
color: h.textColor ? "undefined" : "text.primary",
|
|
@@ -294,7 +293,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
294
293
|
"span",
|
|
295
294
|
{
|
|
296
295
|
dangerouslySetInnerHTML: { __html: l },
|
|
297
|
-
style: { fontFamily:
|
|
296
|
+
style: { fontFamily: I.typography.fontFamily }
|
|
298
297
|
}
|
|
299
298
|
)
|
|
300
299
|
}
|
|
@@ -311,7 +310,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
311
310
|
sx: {
|
|
312
311
|
height: "100%",
|
|
313
312
|
minWidth: E ? `${E}px` : "100%",
|
|
314
|
-
fontFamily:
|
|
313
|
+
fontFamily: I.typography.fontFamily
|
|
315
314
|
},
|
|
316
315
|
children: /* @__PURE__ */ e(
|
|
317
316
|
U,
|
|
@@ -325,13 +324,13 @@ const $ = u.createContext(null), pt = ({
|
|
|
325
324
|
ref: g,
|
|
326
325
|
role: "button",
|
|
327
326
|
sx: {
|
|
328
|
-
border:
|
|
327
|
+
border: x ? "1px solid rgba(82, 138, 224, 0.8)" : void 0,
|
|
329
328
|
borderRadius: "8px",
|
|
330
329
|
height: "100%"
|
|
331
330
|
},
|
|
332
331
|
tabIndex: d ? 0 : -1,
|
|
333
332
|
children: /* @__PURE__ */ e(
|
|
334
|
-
|
|
333
|
+
it,
|
|
335
334
|
{
|
|
336
335
|
"aria-roledescription": "slide",
|
|
337
336
|
className: "mx-micro-card",
|
|
@@ -348,7 +347,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
348
347
|
}
|
|
349
348
|
},
|
|
350
349
|
variant: c,
|
|
351
|
-
children: /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ v(
|
|
352
351
|
K,
|
|
353
352
|
{
|
|
354
353
|
sx: {
|
|
@@ -357,7 +356,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
357
356
|
},
|
|
358
357
|
children: [
|
|
359
358
|
/* @__PURE__ */ e(
|
|
360
|
-
|
|
359
|
+
lt,
|
|
361
360
|
{
|
|
362
361
|
avatar: C && a,
|
|
363
362
|
subheader: p && R,
|
|
@@ -366,9 +365,9 @@ const $ = u.createContext(null), pt = ({
|
|
|
366
365
|
titleTypographyProps: { fontSize: 15, fontWeight: 600, variant: "h3" }
|
|
367
366
|
}
|
|
368
367
|
),
|
|
369
|
-
/* @__PURE__ */ e(
|
|
368
|
+
/* @__PURE__ */ e(rt, { sx: { p: 0 }, children: !p && R }),
|
|
370
369
|
!!o && /* @__PURE__ */ e(
|
|
371
|
-
|
|
370
|
+
ot,
|
|
372
371
|
{
|
|
373
372
|
sx: {
|
|
374
373
|
mt: "auto",
|
|
@@ -377,13 +376,13 @@ const $ = u.createContext(null), pt = ({
|
|
|
377
376
|
children: /* @__PURE__ */ e(
|
|
378
377
|
U,
|
|
379
378
|
{
|
|
380
|
-
sx: (
|
|
381
|
-
color: h.buttonColor ? h.buttonColor :
|
|
379
|
+
sx: (D) => ({
|
|
380
|
+
color: h.buttonColor ? h.buttonColor : D.palette.primary.main,
|
|
382
381
|
fontSize: 14,
|
|
383
382
|
fontWeight: "bold",
|
|
384
383
|
px: 28,
|
|
385
|
-
fontFamily:
|
|
386
|
-
...
|
|
384
|
+
fontFamily: D.typography.fontFamily,
|
|
385
|
+
...F
|
|
387
386
|
}),
|
|
388
387
|
children: o
|
|
389
388
|
}
|
|
@@ -400,15 +399,15 @@ const $ = u.createContext(null), pt = ({
|
|
|
400
399
|
}
|
|
401
400
|
);
|
|
402
401
|
}
|
|
403
|
-
),
|
|
404
|
-
const [o, t] = te(
|
|
402
|
+
), ut = ({ beat: i }) => {
|
|
403
|
+
const [o, t] = te(je.UNCATEGORIZED);
|
|
405
404
|
return oe(() => {
|
|
406
405
|
i.primary_category_guid ? t(i.primary_category_guid) : i.category_guids?.length && t(i.category_guids[0]);
|
|
407
|
-
}, []), /* @__PURE__ */ e(
|
|
408
|
-
},
|
|
409
|
-
const o =
|
|
406
|
+
}, []), /* @__PURE__ */ e($e, { categoryGuid: o, size: 16, sx: { minWidth: 16 } });
|
|
407
|
+
}, pt = ({ beat: i }) => {
|
|
408
|
+
const o = Oe(), t = _t(o);
|
|
410
409
|
return /* @__PURE__ */ e(
|
|
411
|
-
|
|
410
|
+
Ye,
|
|
412
411
|
{
|
|
413
412
|
categoryGuid: i.primary_category_guid || i.category_guids && i.category_guids[0] || "",
|
|
414
413
|
className: t,
|
|
@@ -416,12 +415,12 @@ const $ = u.createContext(null), pt = ({
|
|
|
416
415
|
size: 16
|
|
417
416
|
}
|
|
418
417
|
);
|
|
419
|
-
},
|
|
418
|
+
}, _t = (i) => Xe({
|
|
420
419
|
marginTop: i.Spacing.XTiny,
|
|
421
420
|
"& .kyper-categoryicon": {
|
|
422
421
|
display: "flex"
|
|
423
422
|
}
|
|
424
|
-
}),
|
|
423
|
+
}), Ct = G(pt), ft = ({
|
|
425
424
|
color: i = "currentColor",
|
|
426
425
|
height: o,
|
|
427
426
|
size: t = 16,
|
|
@@ -447,18 +446,18 @@ const $ = u.createContext(null), pt = ({
|
|
|
447
446
|
}
|
|
448
447
|
)
|
|
449
448
|
}
|
|
450
|
-
),
|
|
449
|
+
), mt = (i) => i ? i.data ? i.data.map((o) => {
|
|
451
450
|
const t = {};
|
|
452
451
|
return i.names?.map((r, l) => {
|
|
453
452
|
t[r] = o[l];
|
|
454
453
|
}), t;
|
|
455
|
-
}) : [] : [],
|
|
456
|
-
const t =
|
|
454
|
+
}) : [] : [], gt = (i, o) => {
|
|
455
|
+
const t = mt(i), r = t.length / 2, l = t.slice(0, r), n = t.slice(r);
|
|
457
456
|
return !l.length || !n.length ? o.Color.Primary300 : l[0].amount > n[0].amount ? o.Color.Error300 : l[0].amount < n[0].amount ? o.Color.Success300 : o.Color.Primary300;
|
|
458
|
-
},
|
|
459
|
-
const o =
|
|
457
|
+
}, Rt = ({ beat: i }) => {
|
|
458
|
+
const o = Oe(), t = gt(i.data_series, o);
|
|
460
459
|
return /* @__PURE__ */ e(ie, { name: "bar_chart", sx: { color: t } });
|
|
461
|
-
},
|
|
460
|
+
}, Le = () => /* @__PURE__ */ v("svg", { fill: "none", height: "36", viewBox: "0 0 40 36", width: "40", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
462
461
|
/* @__PURE__ */ e(
|
|
463
462
|
"path",
|
|
464
463
|
{
|
|
@@ -702,7 +701,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
702
701
|
fillRule: "evenodd"
|
|
703
702
|
}
|
|
704
703
|
),
|
|
705
|
-
/* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ v("g", { filter: "url(#filter0_d_1565_98011)", children: [
|
|
706
705
|
/* @__PURE__ */ e("mask", { height: "22", id: "mask1_1565_98011", maskUnits: "userSpaceOnUse", width: "17", x: "16", y: "12", children: /* @__PURE__ */ e(
|
|
707
706
|
"path",
|
|
708
707
|
{
|
|
@@ -958,10 +957,10 @@ const $ = u.createContext(null), pt = ({
|
|
|
958
957
|
),
|
|
959
958
|
/* @__PURE__ */ e("path", { d: "M17.9668 31.5737H19.4947", stroke: "#E4E8EE", strokeWidth: "0.264005" })
|
|
960
959
|
] }),
|
|
961
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ v("g", { filter: "url(#filter1_d_1565_98011)", children: [
|
|
962
961
|
/* @__PURE__ */ e("circle", { cx: "15.0441", cy: "16.0441", fill: "#CDD3DD", r: "15.0441" }),
|
|
963
962
|
/* @__PURE__ */ e("mask", { height: "30", id: "mask2_1565_98011", maskUnits: "userSpaceOnUse", width: "30", x: "0", y: "1", children: /* @__PURE__ */ e("circle", { cx: "15.0435", cy: "16.0445", fill: "#F8F9FB", r: "14.3951" }) }),
|
|
964
|
-
/* @__PURE__ */
|
|
963
|
+
/* @__PURE__ */ v("g", { mask: "url(#mask2_1565_98011)", children: [
|
|
965
964
|
/* @__PURE__ */ e("rect", { fill: "white", height: "31.1359", transform: "translate(0 0.162598)", width: "31.0101" }),
|
|
966
965
|
/* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "4.52002" }),
|
|
967
966
|
/* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "17.1758" }),
|
|
@@ -1151,8 +1150,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1151
1150
|
fill: "#CDD3DD"
|
|
1152
1151
|
}
|
|
1153
1152
|
),
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ v("defs", { children: [
|
|
1154
|
+
/* @__PURE__ */ v(
|
|
1156
1155
|
"filter",
|
|
1157
1156
|
{
|
|
1158
1157
|
colorInterpolationFilters: "sRGB",
|
|
@@ -1195,7 +1194,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1195
1194
|
]
|
|
1196
1195
|
}
|
|
1197
1196
|
),
|
|
1198
|
-
/* @__PURE__ */
|
|
1197
|
+
/* @__PURE__ */ v(
|
|
1199
1198
|
"filter",
|
|
1200
1199
|
{
|
|
1201
1200
|
colorInterpolationFilters: "sRGB",
|
|
@@ -1240,8 +1239,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1240
1239
|
)
|
|
1241
1240
|
] })
|
|
1242
1241
|
] }), Se = ({ beat: i, clientColorScheme: o, color: t, type: r }) => {
|
|
1243
|
-
const l =
|
|
1244
|
-
return r === 0 ? /* @__PURE__ */ e(ie, { fill: !0, name: "error", sx: { color: t || n } }) : r === 1 && i ? /* @__PURE__ */ e(
|
|
1242
|
+
const l = se(), n = o?.primary_300 ? o.primary_300 : l.palette.primary.main;
|
|
1243
|
+
return r === 0 ? /* @__PURE__ */ e(ie, { fill: !0, name: "error", sx: { color: t || n } }) : r === 1 && i ? /* @__PURE__ */ e(ut, { beat: i }) : r === 2 && i ? /* @__PURE__ */ e(Ct, { beat: i }) : r === 3 && i ? /* @__PURE__ */ e(Rt, { beat: i }) : r === 5 && i ? /* @__PURE__ */ e(ie, { name: "campaign" }) : /* @__PURE__ */ e(
|
|
1245
1244
|
ie,
|
|
1246
1245
|
{
|
|
1247
1246
|
fill: !0,
|
|
@@ -1251,34 +1250,34 @@ const $ = u.createContext(null), pt = ({
|
|
|
1251
1250
|
}
|
|
1252
1251
|
}
|
|
1253
1252
|
);
|
|
1254
|
-
},
|
|
1253
|
+
}, k = () => {
|
|
1255
1254
|
const i = u.useContext($);
|
|
1256
1255
|
if (!i)
|
|
1257
1256
|
throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
|
|
1258
1257
|
return i.store.copyStore;
|
|
1259
|
-
},
|
|
1258
|
+
}, It = () => {
|
|
1260
1259
|
const i = u.useContext($);
|
|
1261
1260
|
if (!i?.store?.insightsMicroWidgetStore)
|
|
1262
1261
|
throw new Error(
|
|
1263
1262
|
"useInsightsMicroWidgetStore() must be used within the InsightsMicroWidgetDataProvider"
|
|
1264
1263
|
);
|
|
1265
1264
|
return i.store.insightsMicroWidgetStore;
|
|
1266
|
-
},
|
|
1265
|
+
}, Y = () => {
|
|
1267
1266
|
const i = u.useContext($);
|
|
1268
1267
|
if (!i)
|
|
1269
1268
|
throw new Error("useEvent() must be used within the InsightsMicroWidgetDataProvider");
|
|
1270
1269
|
return { onEvent: i.onEvent };
|
|
1271
|
-
},
|
|
1270
|
+
}, Ne = () => {
|
|
1272
1271
|
const i = u.useContext($);
|
|
1273
1272
|
if (!i)
|
|
1274
1273
|
throw new Error("usePageview() must be used within the InsightsMicroWidgetDataProvider");
|
|
1275
1274
|
return { onPageview: i.onPageview };
|
|
1276
|
-
},
|
|
1275
|
+
}, Ve = {
|
|
1277
1276
|
LARGE: 180,
|
|
1278
1277
|
STANDARD: 154,
|
|
1279
1278
|
XLARGE: 200,
|
|
1280
1279
|
XXLARGE: 248
|
|
1281
|
-
},
|
|
1280
|
+
}, yt = 50, He = 1, vt = ({
|
|
1282
1281
|
ariaLabel: i,
|
|
1283
1282
|
backgroundColor: o,
|
|
1284
1283
|
beat: t,
|
|
@@ -1293,25 +1292,25 @@ const $ = u.createContext(null), pt = ({
|
|
|
1293
1292
|
variant: f,
|
|
1294
1293
|
widthOverrides: h
|
|
1295
1294
|
}) => {
|
|
1296
|
-
const { ref: m, inView: c } =
|
|
1297
|
-
threshold:
|
|
1298
|
-
}), { cardsCopy: E } =
|
|
1295
|
+
const { ref: m, inView: c } = Ae({
|
|
1296
|
+
threshold: He
|
|
1297
|
+
}), { cardsCopy: E } = k(), { onEvent: g } = Y(), { updateBeat: I, updateOffer: x } = It();
|
|
1299
1298
|
oe(() => {
|
|
1300
|
-
c && (t.has_been_displayed ? g(
|
|
1299
|
+
c && (t.has_been_displayed ? g(we(t.template)) : (t.guid.startsWith("OFR") ? x({
|
|
1301
1300
|
...t,
|
|
1302
1301
|
has_been_displayed: !0
|
|
1303
|
-
}) :
|
|
1302
|
+
}) : I({
|
|
1304
1303
|
...t,
|
|
1305
1304
|
has_been_displayed: !0
|
|
1306
|
-
}), g(
|
|
1305
|
+
}), g(xe(t.template))));
|
|
1307
1306
|
}, [c]), oe(() => {
|
|
1308
1307
|
if (c && t)
|
|
1309
1308
|
if (t.template === "MarketingOffer") {
|
|
1310
|
-
const
|
|
1309
|
+
const y = t;
|
|
1311
1310
|
_?.capture("viewed_messaging_insight", {
|
|
1312
1311
|
template: t.template,
|
|
1313
|
-
campaign_guid:
|
|
1314
|
-
campaign_name:
|
|
1312
|
+
campaign_guid: y.campaign_guid,
|
|
1313
|
+
campaign_name: y.pulse_campaign_name
|
|
1315
1314
|
});
|
|
1316
1315
|
} else
|
|
1317
1316
|
_?.capture("viewed_insight", {
|
|
@@ -1321,12 +1320,12 @@ const $ = u.createContext(null), pt = ({
|
|
|
1321
1320
|
});
|
|
1322
1321
|
}, [t, a, c]);
|
|
1323
1322
|
const O = () => {
|
|
1324
|
-
if (p && p(t), g(
|
|
1325
|
-
const
|
|
1323
|
+
if (p && p(t), g(We(t.template)), t.template === "MarketingOffer") {
|
|
1324
|
+
const y = t;
|
|
1326
1325
|
_?.capture("clicked_messaging_insight", {
|
|
1327
1326
|
template: t.template,
|
|
1328
|
-
campaign_guid:
|
|
1329
|
-
campaign_name:
|
|
1327
|
+
campaign_guid: y.campaign_guid,
|
|
1328
|
+
campaign_name: y.pulse_campaign_name
|
|
1330
1329
|
});
|
|
1331
1330
|
} else
|
|
1332
1331
|
_?.capture("clicked_insight", {
|
|
@@ -1364,7 +1363,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1364
1363
|
widthOverrides: h
|
|
1365
1364
|
}
|
|
1366
1365
|
);
|
|
1367
|
-
},
|
|
1366
|
+
}, St = ({
|
|
1368
1367
|
clientColorScheme: i,
|
|
1369
1368
|
currentBeatIndex: o,
|
|
1370
1369
|
numBeats: t,
|
|
@@ -1375,8 +1374,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1375
1374
|
shouldApplyNewAnimation: d = !1,
|
|
1376
1375
|
visibleCardsCount: p = 1
|
|
1377
1376
|
}) => {
|
|
1378
|
-
const _ =
|
|
1379
|
-
return /* @__PURE__ */
|
|
1377
|
+
const _ = ze(), { carouselCopy: C } = k(), f = Math.floor(a) > n || o - p + 1 === 0, h = a < 0 || t - 1 === o, m = _.palette.grey[500], c = i?.primary_300 ?? _.palette.primary.main;
|
|
1378
|
+
return /* @__PURE__ */ v(
|
|
1380
1379
|
K,
|
|
1381
1380
|
{
|
|
1382
1381
|
direction: "row",
|
|
@@ -1399,7 +1398,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1399
1398
|
disabled: f,
|
|
1400
1399
|
onClick: l,
|
|
1401
1400
|
children: /* @__PURE__ */ e(
|
|
1402
|
-
|
|
1401
|
+
be,
|
|
1403
1402
|
{
|
|
1404
1403
|
style: {
|
|
1405
1404
|
color: f ? m : c
|
|
@@ -1409,13 +1408,13 @@ const $ = u.createContext(null), pt = ({
|
|
|
1409
1408
|
}
|
|
1410
1409
|
),
|
|
1411
1410
|
Array.from({ length: t }).map((E, g) => {
|
|
1412
|
-
const
|
|
1411
|
+
const I = g === o;
|
|
1413
1412
|
return /* @__PURE__ */ e(
|
|
1414
1413
|
U,
|
|
1415
1414
|
{
|
|
1416
1415
|
className: "mx-insights-micro-carousel-dots",
|
|
1417
1416
|
sx: {
|
|
1418
|
-
bgcolor:
|
|
1417
|
+
bgcolor: I ? c : m,
|
|
1419
1418
|
height: 8,
|
|
1420
1419
|
mr: 8,
|
|
1421
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"
|
|
@@ -1428,7 +1427,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1428
1427
|
borderRadius: "50%",
|
|
1429
1428
|
p: 0
|
|
1430
1429
|
},
|
|
1431
|
-
width:
|
|
1430
|
+
width: I && d ? 24 : 8
|
|
1432
1431
|
}
|
|
1433
1432
|
},
|
|
1434
1433
|
`carousel-button-${g}`
|
|
@@ -1442,7 +1441,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1442
1441
|
disabled: h,
|
|
1443
1442
|
onClick: r,
|
|
1444
1443
|
children: /* @__PURE__ */ e(
|
|
1445
|
-
|
|
1444
|
+
Me,
|
|
1446
1445
|
{
|
|
1447
1446
|
style: {
|
|
1448
1447
|
color: h ? m : c
|
|
@@ -1454,7 +1453,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1454
1453
|
]
|
|
1455
1454
|
}
|
|
1456
1455
|
);
|
|
1457
|
-
},
|
|
1456
|
+
}, Mt = ({
|
|
1458
1457
|
analyticsMetadata: i,
|
|
1459
1458
|
allowSingleCardPeeking: o = !1,
|
|
1460
1459
|
beats: t = [],
|
|
@@ -1472,75 +1471,75 @@ const $ = u.createContext(null), pt = ({
|
|
|
1472
1471
|
visibleCardsCount: c = 1
|
|
1473
1472
|
// Default to 1 card visible
|
|
1474
1473
|
}) => {
|
|
1475
|
-
const E = u.useRef(null), g = u.useRef(null), [
|
|
1474
|
+
const E = u.useRef(null), g = u.useRef(null), [I, x] = u.useState(0), [O, y] = u.useState(null), [F, z] = u.useState(null), [R, D] = u.useState(null), [b, B] = u.useState(p), { carouselCopy: j } = k(), { onEvent: Z } = Y();
|
|
1476
1475
|
u.useEffect(() => {
|
|
1477
1476
|
if (E.current && !o) {
|
|
1478
1477
|
const s = E.current.offsetWidth, A = 8;
|
|
1479
|
-
let
|
|
1478
|
+
let N;
|
|
1480
1479
|
if (c > 1) {
|
|
1481
1480
|
const J = (s - (c - 1) * A) / c / 3;
|
|
1482
|
-
|
|
1481
|
+
N = (s - J - (c - 1) * A) / c;
|
|
1483
1482
|
} else
|
|
1484
|
-
|
|
1485
|
-
N
|
|
1483
|
+
N = s;
|
|
1484
|
+
D(N);
|
|
1486
1485
|
}
|
|
1487
1486
|
}, [c, E.current?.offsetWidth]), u.useEffect(() => {
|
|
1488
1487
|
const s = g.current?.offsetWidth;
|
|
1489
1488
|
if (typeof s == "number" && o) {
|
|
1490
|
-
const A = (
|
|
1491
|
-
|
|
1489
|
+
const A = (P) => {
|
|
1490
|
+
B(!0);
|
|
1492
1491
|
const ee = [
|
|
1493
1492
|
{ maxWidth: 375, cardWidth: 268 },
|
|
1494
1493
|
{ maxWidth: 444, cardWidth: 300 },
|
|
1495
1494
|
{ maxWidth: 599, cardWidth: 350 },
|
|
1496
1495
|
{ maxWidth: 749, cardWidth: 450 },
|
|
1497
1496
|
{ maxWidth: 900, cardWidth: 600 }
|
|
1498
|
-
].find((
|
|
1497
|
+
].find((ce) => P <= ce.maxWidth);
|
|
1499
1498
|
return ee ? ee.cardWidth : 750;
|
|
1500
1499
|
};
|
|
1501
|
-
|
|
1502
|
-
const
|
|
1503
|
-
const
|
|
1504
|
-
typeof
|
|
1500
|
+
D(A(s));
|
|
1501
|
+
const N = () => {
|
|
1502
|
+
const P = g.current?.offsetWidth;
|
|
1503
|
+
typeof P == "number" && D(A(P));
|
|
1505
1504
|
};
|
|
1506
|
-
return window.addEventListener("resize",
|
|
1507
|
-
window.removeEventListener("resize",
|
|
1505
|
+
return window.addEventListener("resize", N), () => {
|
|
1506
|
+
window.removeEventListener("resize", N);
|
|
1508
1507
|
};
|
|
1509
1508
|
}
|
|
1510
1509
|
}, [o, g]);
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1513
|
-
left:
|
|
1510
|
+
const X = () => {
|
|
1511
|
+
Z(M.ON_CAROUSEL_FORWARD_CLICK, i), E.current && R && E.current.scrollTo({
|
|
1512
|
+
left: I + R + 8,
|
|
1514
1513
|
top: 0,
|
|
1515
1514
|
behavior: "smooth"
|
|
1516
1515
|
});
|
|
1517
|
-
},
|
|
1518
|
-
|
|
1519
|
-
left: Math.max(0,
|
|
1516
|
+
}, le = () => {
|
|
1517
|
+
Z(M.ON_CAROUSEL_BACK_CLICK, i), E.current && R && E.current.scrollTo({
|
|
1518
|
+
left: Math.max(0, I - (R + 8)),
|
|
1520
1519
|
top: 0,
|
|
1521
1520
|
behavior: "smooth"
|
|
1522
1521
|
});
|
|
1523
1522
|
}, ne = () => {
|
|
1524
|
-
E.current &&
|
|
1525
|
-
},
|
|
1526
|
-
if (!
|
|
1527
|
-
|
|
1528
|
-
}, Q = (s) => {
|
|
1529
|
-
v(s.targetTouches[0].clientX);
|
|
1523
|
+
E.current && x(E.current.scrollLeft);
|
|
1524
|
+
}, Q = () => {
|
|
1525
|
+
if (!F || !O) return;
|
|
1526
|
+
F - O > yt ? Z(M.ON_CAROUSEL_FORWARD_SWIPE, i) : Z(M.ON_CAROUSEL_BACK_SWIPE, i);
|
|
1530
1527
|
}, q = (s) => {
|
|
1531
|
-
|
|
1532
|
-
},
|
|
1528
|
+
y(s.targetTouches[0].clientX);
|
|
1529
|
+
}, L = (s) => {
|
|
1530
|
+
y(null), z(s.targetTouches[0].clientX);
|
|
1531
|
+
}, ue = {
|
|
1533
1532
|
clientColorScheme: r,
|
|
1534
1533
|
showCTAColocatedWithText: l,
|
|
1535
1534
|
heightOverrides: n,
|
|
1536
1535
|
posthog: d,
|
|
1537
1536
|
showIcon: C,
|
|
1538
1537
|
variant: h
|
|
1539
|
-
},
|
|
1540
|
-
return /* @__PURE__ */
|
|
1538
|
+
}, ae = R ? Math.round(I / (R + 8)) : 0, Be = E.current ? E.current.scrollWidth - E.current.offsetWidth : 0;
|
|
1539
|
+
return /* @__PURE__ */ v(
|
|
1541
1540
|
K,
|
|
1542
1541
|
{
|
|
1543
|
-
"aria-label":
|
|
1542
|
+
"aria-label": j.carousel_title,
|
|
1544
1543
|
"aria-roledescription": "carousel",
|
|
1545
1544
|
ref: g,
|
|
1546
1545
|
role: "group/region",
|
|
@@ -1551,14 +1550,14 @@ const $ = u.createContext(null), pt = ({
|
|
|
1551
1550
|
width: m || "100%"
|
|
1552
1551
|
},
|
|
1553
1552
|
children: [
|
|
1554
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ v(
|
|
1555
1554
|
K,
|
|
1556
1555
|
{
|
|
1557
1556
|
direction: "row",
|
|
1558
1557
|
onScroll: ne,
|
|
1559
|
-
onTouchEnd:
|
|
1560
|
-
onTouchMove:
|
|
1561
|
-
onTouchStart:
|
|
1558
|
+
onTouchEnd: Q,
|
|
1559
|
+
onTouchMove: q,
|
|
1560
|
+
onTouchStart: L,
|
|
1562
1561
|
ref: E,
|
|
1563
1562
|
sx: {
|
|
1564
1563
|
alignItems: "center",
|
|
@@ -1579,65 +1578,65 @@ const $ = u.createContext(null), pt = ({
|
|
|
1579
1578
|
},
|
|
1580
1579
|
children: [
|
|
1581
1580
|
t.map((s, A) => {
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
), ee = s.micro_title && s.micro_title.length > 0,
|
|
1581
|
+
const N = A + 1, P = t.length + 1, J = Qe(
|
|
1582
|
+
j.card_position_in_carousel_aria,
|
|
1583
|
+
N.toString(),
|
|
1584
|
+
P.toString()
|
|
1585
|
+
), ee = s.micro_title && s.micro_title.length > 0, ce = s.micro_description && s.micro_description.length > 0, Ze = ee ? s.micro_title : s.title, Pe = ce ? s.micro_description : s.description;
|
|
1587
1586
|
return /* @__PURE__ */ e(
|
|
1588
|
-
|
|
1587
|
+
vt,
|
|
1589
1588
|
{
|
|
1590
|
-
ariaLabel: `${J}: ${
|
|
1589
|
+
ariaLabel: `${J}: ${Ze}, ${Pe}`,
|
|
1591
1590
|
beat: s,
|
|
1592
1591
|
index: A,
|
|
1593
|
-
isActiveCard: A ===
|
|
1592
|
+
isActiveCard: A === ae,
|
|
1594
1593
|
onCardClick: a,
|
|
1595
1594
|
widthOverrides: R || void 0,
|
|
1596
|
-
...
|
|
1595
|
+
...ue
|
|
1597
1596
|
},
|
|
1598
1597
|
`${s.guid} ${A}`
|
|
1599
1598
|
);
|
|
1600
1599
|
}),
|
|
1601
1600
|
/* @__PURE__ */ e(
|
|
1602
|
-
|
|
1601
|
+
Lt,
|
|
1603
1602
|
{
|
|
1604
|
-
isActiveCard:
|
|
1603
|
+
isActiveCard: ae === t.length,
|
|
1605
1604
|
onCardClick: a,
|
|
1606
1605
|
widthOverrides: R || void 0,
|
|
1607
|
-
...
|
|
1606
|
+
...ue
|
|
1608
1607
|
}
|
|
1609
1608
|
)
|
|
1610
1609
|
]
|
|
1611
1610
|
}
|
|
1612
1611
|
),
|
|
1613
1612
|
_ && /* @__PURE__ */ e(
|
|
1614
|
-
|
|
1613
|
+
St,
|
|
1615
1614
|
{
|
|
1616
1615
|
clientColorScheme: r,
|
|
1617
|
-
currentBeatIndex:
|
|
1616
|
+
currentBeatIndex: ae + c - 1,
|
|
1618
1617
|
numBeats: t.length + 1,
|
|
1619
|
-
onNextClick:
|
|
1620
|
-
onPreviousClick:
|
|
1621
|
-
scrollRightBoundary:
|
|
1622
|
-
scrollX:
|
|
1623
|
-
shouldApplyNewAnimation:
|
|
1618
|
+
onNextClick: X,
|
|
1619
|
+
onPreviousClick: le,
|
|
1620
|
+
scrollRightBoundary: Be,
|
|
1621
|
+
scrollX: I,
|
|
1622
|
+
shouldApplyNewAnimation: b,
|
|
1624
1623
|
visibleCardsCount: c
|
|
1625
1624
|
}
|
|
1626
1625
|
)
|
|
1627
1626
|
]
|
|
1628
1627
|
}
|
|
1629
1628
|
);
|
|
1630
|
-
},
|
|
1629
|
+
}, At = G(Mt), Ot = ({
|
|
1631
1630
|
analyticsMetadata: i,
|
|
1632
1631
|
clientColorScheme: o,
|
|
1633
1632
|
onCardClick: t,
|
|
1634
1633
|
posthog: r,
|
|
1635
1634
|
widthOverrides: l
|
|
1636
1635
|
}) => {
|
|
1637
|
-
const { carouselCopy: n } =
|
|
1636
|
+
const { carouselCopy: n } = k(), { onEvent: a } = Y(), d = () => {
|
|
1638
1637
|
a && (a(M.ON_VIEW_MORE_CLICKED, i), t(), r?.capture("clicked_view_more"));
|
|
1639
1638
|
};
|
|
1640
|
-
return n ? /* @__PURE__ */
|
|
1639
|
+
return n ? /* @__PURE__ */ v(
|
|
1641
1640
|
K,
|
|
1642
1641
|
{
|
|
1643
1642
|
alignItems: "center",
|
|
@@ -1661,8 +1660,8 @@ const $ = u.createContext(null), pt = ({
|
|
|
1661
1660
|
children: n.carousel_title
|
|
1662
1661
|
}
|
|
1663
1662
|
),
|
|
1664
|
-
/* @__PURE__ */
|
|
1665
|
-
|
|
1663
|
+
/* @__PURE__ */ v(
|
|
1664
|
+
Ge,
|
|
1666
1665
|
{
|
|
1667
1666
|
onClick: d,
|
|
1668
1667
|
sx: {
|
|
@@ -1690,19 +1689,19 @@ const $ = u.createContext(null), pt = ({
|
|
|
1690
1689
|
children: n.view_all_insights_in_full_feed_cta_aria
|
|
1691
1690
|
}
|
|
1692
1691
|
),
|
|
1693
|
-
/* @__PURE__ */ e(
|
|
1692
|
+
/* @__PURE__ */ e(Me, { sx: { color: o?.primary_300, ml: "8px" } })
|
|
1694
1693
|
]
|
|
1695
1694
|
}
|
|
1696
1695
|
)
|
|
1697
1696
|
]
|
|
1698
1697
|
}
|
|
1699
|
-
) : /* @__PURE__ */ e(
|
|
1700
|
-
},
|
|
1698
|
+
) : /* @__PURE__ */ e(Ue, {});
|
|
1699
|
+
}, Tt = G(Ot), Wt = ({
|
|
1701
1700
|
heightOverrides: i,
|
|
1702
1701
|
widthOverrides: o,
|
|
1703
1702
|
children: t
|
|
1704
1703
|
}) => {
|
|
1705
|
-
const { carouselCopy: r } =
|
|
1704
|
+
const { carouselCopy: r } = k();
|
|
1706
1705
|
return /* @__PURE__ */ e(
|
|
1707
1706
|
U,
|
|
1708
1707
|
{
|
|
@@ -1718,7 +1717,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1718
1717
|
children: t
|
|
1719
1718
|
}
|
|
1720
1719
|
);
|
|
1721
|
-
},
|
|
1720
|
+
}, ke = ({
|
|
1722
1721
|
ariaLabel: i,
|
|
1723
1722
|
carouselSize: o,
|
|
1724
1723
|
clientColorScheme: t,
|
|
@@ -1730,9 +1729,9 @@ const $ = u.createContext(null), pt = ({
|
|
|
1730
1729
|
variant: p,
|
|
1731
1730
|
widthOverrides: _
|
|
1732
1731
|
}) => {
|
|
1733
|
-
const { cardsCopy: C } =
|
|
1732
|
+
const { cardsCopy: C } = k(), { onEvent: f } = Y(), { onPageview: h } = Ne();
|
|
1734
1733
|
u.useEffect(() => {
|
|
1735
|
-
h(
|
|
1734
|
+
h(H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
|
|
1736
1735
|
}, []);
|
|
1737
1736
|
const m = () => {
|
|
1738
1737
|
l && l(), f(M.ON_NO_RELEVANT_INSIGHTS_CLICKED), n?.capture("clicked_insight", {
|
|
@@ -1747,7 +1746,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1747
1746
|
description: C.no_relevant_insights_card_description,
|
|
1748
1747
|
fontColors: { buttonColor: t?.primary_300 },
|
|
1749
1748
|
heightOverrides: r,
|
|
1750
|
-
icon: /* @__PURE__ */ e(
|
|
1749
|
+
icon: /* @__PURE__ */ e(Le, {}),
|
|
1751
1750
|
isZeroState: !0,
|
|
1752
1751
|
onCardClick: m,
|
|
1753
1752
|
posthog: n,
|
|
@@ -1755,7 +1754,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1755
1754
|
style: {
|
|
1756
1755
|
cardStyle: {
|
|
1757
1756
|
card: {
|
|
1758
|
-
height: `calc(${
|
|
1757
|
+
height: `calc(${Ve[o]}px - 44px)`,
|
|
1759
1758
|
m: "0 auto",
|
|
1760
1759
|
width: d ? "calc(100% - 32px)" : "100%"
|
|
1761
1760
|
},
|
|
@@ -1772,7 +1771,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1772
1771
|
widthOverrides: _
|
|
1773
1772
|
}
|
|
1774
1773
|
);
|
|
1775
|
-
},
|
|
1774
|
+
}, li = G(ke), Fe = ({
|
|
1776
1775
|
ariaLabel: i,
|
|
1777
1776
|
carouselSize: o,
|
|
1778
1777
|
heightOverrides: t,
|
|
@@ -1783,16 +1782,16 @@ const $ = u.createContext(null), pt = ({
|
|
|
1783
1782
|
variant: d,
|
|
1784
1783
|
widthOverrides: p
|
|
1785
1784
|
}) => {
|
|
1786
|
-
const { onPageview: _ } =
|
|
1785
|
+
const { onPageview: _ } = Ne(), { zeroStateCopy: C } = k();
|
|
1787
1786
|
return u.useEffect(() => {
|
|
1788
|
-
_(
|
|
1787
|
+
_(H.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
|
|
1789
1788
|
}, []), /* @__PURE__ */ e(
|
|
1790
1789
|
re,
|
|
1791
1790
|
{
|
|
1792
1791
|
ariaLabel: i,
|
|
1793
1792
|
description: C.carousel_zero_state_description,
|
|
1794
1793
|
heightOverrides: t,
|
|
1795
|
-
icon: /* @__PURE__ */ e(
|
|
1794
|
+
icon: /* @__PURE__ */ e(Le, {}),
|
|
1796
1795
|
isZeroState: !0,
|
|
1797
1796
|
onCardClick: r,
|
|
1798
1797
|
posthog: l,
|
|
@@ -1800,7 +1799,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1800
1799
|
style: {
|
|
1801
1800
|
cardStyle: {
|
|
1802
1801
|
card: {
|
|
1803
|
-
height: `calc(${
|
|
1802
|
+
height: `calc(${Ve[o]}px - 44px)`,
|
|
1804
1803
|
m: "0 auto",
|
|
1805
1804
|
width: a ? "calc(100% - 32px)" : "100%"
|
|
1806
1805
|
},
|
|
@@ -1814,7 +1813,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1814
1813
|
widthOverrides: p
|
|
1815
1814
|
}
|
|
1816
1815
|
);
|
|
1817
|
-
},
|
|
1816
|
+
}, ni = G(Fe), wt = () => /* @__PURE__ */ e(
|
|
1818
1817
|
U,
|
|
1819
1818
|
{
|
|
1820
1819
|
sx: {
|
|
@@ -1824,9 +1823,9 @@ const $ = u.createContext(null), pt = ({
|
|
|
1824
1823
|
justifyContent: "center",
|
|
1825
1824
|
width: "100%"
|
|
1826
1825
|
},
|
|
1827
|
-
children: /* @__PURE__ */ e(
|
|
1826
|
+
children: /* @__PURE__ */ e(qe, {})
|
|
1828
1827
|
}
|
|
1829
|
-
),
|
|
1828
|
+
), V = new ht(), xt = ({
|
|
1830
1829
|
allowSingleCardPeeking: i,
|
|
1831
1830
|
areBeatsLoading: o,
|
|
1832
1831
|
beats: t = [],
|
|
@@ -1849,73 +1848,67 @@ const $ = u.createContext(null), pt = ({
|
|
|
1849
1848
|
showCarouselControls: c,
|
|
1850
1849
|
showHeader: E,
|
|
1851
1850
|
showIcon: g,
|
|
1852
|
-
showWithMargin:
|
|
1853
|
-
token:
|
|
1851
|
+
showWithMargin: I = !0,
|
|
1852
|
+
token: x = "",
|
|
1854
1853
|
useDarkMode: O,
|
|
1855
|
-
userHasFullInsightFeedBeats:
|
|
1856
|
-
variant:
|
|
1854
|
+
userHasFullInsightFeedBeats: y,
|
|
1855
|
+
variant: F,
|
|
1857
1856
|
visibleCardsCount: z = 1,
|
|
1858
1857
|
widthOverrides: R
|
|
1859
1858
|
}) => {
|
|
1860
|
-
const
|
|
1859
|
+
const [D, b] = te("STANDARD"), [B, j] = te(!1), [Z, X] = te(!1), le = et([_], V), ne = tt([C], V);
|
|
1861
1860
|
u.useEffect(() => {
|
|
1862
|
-
!
|
|
1863
|
-
}, [n,
|
|
1864
|
-
const
|
|
1865
|
-
|
|
1861
|
+
!V.isInitialized && !Z && (V.initialize(n, x, d).catch(() => X(!1)), X(!0));
|
|
1862
|
+
}, [n, x, d, V.isInitialized, Z]), u.useEffect(() => {
|
|
1863
|
+
const L = window.innerHeight;
|
|
1864
|
+
L < 180 ? b("STANDARD") : L >= 180 && L < 200 ? b("LARGE") : L >= 200 && L < 248 ? b("XLARGE") : L >= 248 && b("XXLARGE");
|
|
1866
1865
|
}, [window.innerHeight]), u.useEffect(() => {
|
|
1867
|
-
|
|
1868
|
-
}, [o,
|
|
1866
|
+
j(!o && V.isInitialized);
|
|
1867
|
+
}, [o, V.isInitialized]);
|
|
1869
1868
|
const Q = {
|
|
1870
1869
|
showCTAColocatedWithText: l,
|
|
1871
1870
|
heightOverrides: a,
|
|
1872
1871
|
onCardClick: p,
|
|
1873
1872
|
posthog: f,
|
|
1874
1873
|
showIcon: g,
|
|
1875
|
-
showWithMargin:
|
|
1874
|
+
showWithMargin: I,
|
|
1876
1875
|
useDarkMode: O,
|
|
1877
1876
|
widthOverrides: R
|
|
1878
1877
|
}, q = {
|
|
1879
|
-
carouselSize:
|
|
1880
|
-
variant:
|
|
1878
|
+
carouselSize: D,
|
|
1879
|
+
variant: F,
|
|
1881
1880
|
...Q
|
|
1882
1881
|
};
|
|
1883
|
-
return (
|
|
1884
|
-
|
|
1885
|
-
/* @__PURE__ */
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
V && !t.length && v && /* @__PURE__ */ e(Fe, { clientColorScheme: r, ...q }),
|
|
1914
|
-
V && !t.length && !v && /* @__PURE__ */ e(Be, { ...q })
|
|
1915
|
-
] }) })
|
|
1916
|
-
] })
|
|
1917
|
-
);
|
|
1918
|
-
}, di = P(Lt), Nt = ({
|
|
1882
|
+
return /* @__PURE__ */ e(Et, { onEvent: le, onPageview: ne, store: V, children: /* @__PURE__ */ v(Wt, { heightOverrides: a, widthOverrides: R, children: [
|
|
1883
|
+
!B && /* @__PURE__ */ e(wt, {}),
|
|
1884
|
+
B && E && /* @__PURE__ */ e(
|
|
1885
|
+
Tt,
|
|
1886
|
+
{
|
|
1887
|
+
analyticsMetadata: me,
|
|
1888
|
+
clientColorScheme: r,
|
|
1889
|
+
onCardClick: p,
|
|
1890
|
+
posthog: f,
|
|
1891
|
+
widthOverrides: R
|
|
1892
|
+
}
|
|
1893
|
+
),
|
|
1894
|
+
B && !!t.length && /* @__PURE__ */ e(
|
|
1895
|
+
At,
|
|
1896
|
+
{
|
|
1897
|
+
allowSingleCardPeeking: i,
|
|
1898
|
+
analyticsMetadata: me,
|
|
1899
|
+
beats: t,
|
|
1900
|
+
clientColorScheme: r,
|
|
1901
|
+
shouldApplyNewAnimation: h,
|
|
1902
|
+
showCarouselControls: c,
|
|
1903
|
+
variant: m ? F : void 0,
|
|
1904
|
+
visibleCardsCount: z,
|
|
1905
|
+
...Q
|
|
1906
|
+
}
|
|
1907
|
+
),
|
|
1908
|
+
B && !t.length && y && /* @__PURE__ */ e(ke, { clientColorScheme: r, ...q }),
|
|
1909
|
+
B && !t.length && !y && /* @__PURE__ */ e(Fe, { ...q })
|
|
1910
|
+
] }) });
|
|
1911
|
+
}, ai = G(xt), Dt = ({
|
|
1919
1912
|
isActiveCard: i,
|
|
1920
1913
|
ariaLabel: o,
|
|
1921
1914
|
clientColorScheme: t,
|
|
@@ -1926,11 +1919,11 @@ const $ = u.createContext(null), pt = ({
|
|
|
1926
1919
|
variant: d,
|
|
1927
1920
|
widthOverrides: p
|
|
1928
1921
|
}) => {
|
|
1929
|
-
const _ =
|
|
1930
|
-
threshold:
|
|
1931
|
-
}), { cardsCopy: h } =
|
|
1922
|
+
const _ = se(), { ref: C, inView: f } = Ae({
|
|
1923
|
+
threshold: He
|
|
1924
|
+
}), { cardsCopy: h } = k(), { onEvent: m } = Y();
|
|
1932
1925
|
oe(() => {
|
|
1933
|
-
f && (m(
|
|
1926
|
+
f && (m(De.ON_VIEW_MORE_VIEWED), n?.capture("viewed_insight", {
|
|
1934
1927
|
template: "view_more_card"
|
|
1935
1928
|
}));
|
|
1936
1929
|
}, [f]);
|
|
@@ -1947,7 +1940,7 @@ const $ = u.createContext(null), pt = ({
|
|
|
1947
1940
|
description: h.view_more_card_description,
|
|
1948
1941
|
fontColors: { buttonColor: t?.primary_300 },
|
|
1949
1942
|
heightOverrides: r,
|
|
1950
|
-
icon: /* @__PURE__ */ e(
|
|
1943
|
+
icon: /* @__PURE__ */ e(ft, { color: t?.primary_300 ?? _.palette.primary.main }),
|
|
1951
1944
|
isActiveCard: i,
|
|
1952
1945
|
onCardClick: c,
|
|
1953
1946
|
posthog: n,
|
|
@@ -1958,20 +1951,20 @@ const $ = u.createContext(null), pt = ({
|
|
|
1958
1951
|
widthOverrides: p
|
|
1959
1952
|
}
|
|
1960
1953
|
);
|
|
1961
|
-
},
|
|
1954
|
+
}, Lt = G(Dt);
|
|
1962
1955
|
export {
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1956
|
+
ht as A,
|
|
1957
|
+
vt as B,
|
|
1958
|
+
Tt as C,
|
|
1959
|
+
Et as I,
|
|
1960
|
+
At as M,
|
|
1961
|
+
li as N,
|
|
1969
1962
|
me as T,
|
|
1970
|
-
|
|
1971
|
-
|
|
1963
|
+
Lt as V,
|
|
1964
|
+
ni as Z,
|
|
1972
1965
|
re as a,
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1966
|
+
ai as b,
|
|
1967
|
+
ft as c,
|
|
1968
|
+
Rt as d,
|
|
1969
|
+
Le as e
|
|
1977
1970
|
};
|
|
@@ -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-BAz2NyEO.mjs";
|
|
2
2
|
export {
|
|
3
3
|
s as AppStore,
|
|
4
4
|
e as BeatCard,
|
package/dist/trends/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ import { C as st } from "../CurrencyText-YUhH2caW.mjs";
|
|
|
20
20
|
import { c as Me } from "../Category-CevNQ03n.mjs";
|
|
21
21
|
import { b as rt } from "../Localization-2MODESHW.mjs";
|
|
22
22
|
import { H as be } from "../HeaderCell-DjuifqHJ.mjs";
|
|
23
|
-
import { T as A, b as at } from "../ViewMoreMicroCard-
|
|
23
|
+
import { T as A, b as at } from "../ViewMoreMicroCard-BAz2NyEO.mjs";
|
|
24
24
|
import { A as y, W as Ae } from "../WidgetContainer-CPBhSP3k.mjs";
|
|
25
25
|
import { a as Re, T as ke } from "../TransactionDetails-BafSm7_T.mjs";
|
|
26
26
|
import { D as fe } from "../Drawer-kEE73B87.mjs";
|