@mx-cartographer/experiences 8.2.2 → 8.2.4
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 +8 -0
- package/dist/{ViewMoreMicroCard-BB3Dusch.mjs → ViewMoreMicroCard-CQBFy9AF.mjs} +528 -527
- package/dist/microinsights/MicroCardTemplate.d.ts +2 -4
- package/dist/microinsights/cards/InsightCard.d.ts +2 -2
- package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +3 -4
- package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +3 -4
- package/dist/microinsights/cards/ZeroStateCard.d.ts +3 -4
- package/dist/microinsights/carousel/BeatList.d.ts +2 -2
- package/dist/microinsights/carousel/MicroBeatCarousel.d.ts +12 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/microinsights/interfaces.d.ts +12 -4
- package/dist/trends/index.es.js +2 -3
- package/package.json +1 -1
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import { jsx as o, jsxs as N, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { CategoryIcon as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { L as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { alpha as s, useTheme as
|
|
12
|
-
import { useInView as
|
|
1
|
+
import { jsx as o, jsxs as N, Fragment as Re } from "react/jsx-runtime";
|
|
2
|
+
import I, { useEffect as re, useState as ie } from "react";
|
|
3
|
+
import { observer as k } from "mobx-react-lite";
|
|
4
|
+
import G from "@mui/material/Stack";
|
|
5
|
+
import Ue from "@mui/material/Button";
|
|
6
|
+
import { CategoryIcon as ze, MerchantLogo as Ke, InstitutionLogo as Fe, P as me, Text as ue, H3 as He } from "@mxenabled/mxui";
|
|
7
|
+
import { Icon as $e, Close as je, ChevronLeft as Ye, ChevronRight as Oe } from "@mxenabled/mx-icons";
|
|
8
|
+
import { L as Xe } from "./Loader-CxeBwuPG.mjs";
|
|
9
|
+
import ae from "@mui/material/Box";
|
|
10
|
+
import Ce from "@mui/material/IconButton";
|
|
11
|
+
import { alpha as s, useTheme as F } from "@mui/material/styles";
|
|
12
|
+
import { useInView as We } from "react-intersection-observer";
|
|
13
13
|
import se from "@mui/material/styles/useTheme";
|
|
14
|
-
import { C as
|
|
15
|
-
import { b as
|
|
16
|
-
import
|
|
17
|
-
import { makeAutoObservable as ce, runInAction as
|
|
18
|
-
import { a as
|
|
19
|
-
import { G as
|
|
20
|
-
import { u as
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
copyApi = new Ce("/", "");
|
|
14
|
+
import { C as Ze } from "./Category-DEKZGLYe.mjs";
|
|
15
|
+
import { b as Qe } from "./Localization-DnoVyBNK.mjs";
|
|
16
|
+
import qe from "@mui/material/CircularProgress";
|
|
17
|
+
import { makeAutoObservable as ce, runInAction as we } from "mobx";
|
|
18
|
+
import { a as Je, u as et, b as tt } from "./Analytics-CkYXKvco.mjs";
|
|
19
|
+
import { G as he, B as ge } from "./GlobalCopyApi-wcnDUzMV.mjs";
|
|
20
|
+
import { u as ot } from "./useWidgetLoadTimer-CJb-RELP.mjs";
|
|
21
|
+
import { Card as nt, CardActionArea as it, Box as rt, IconButton as at, Stack as K, Button as Ie } from "@mui/material";
|
|
22
|
+
import st from "@mui/material/Avatar";
|
|
23
|
+
class ct {
|
|
24
|
+
copyApi = new he("/", "");
|
|
26
25
|
copyObject = {};
|
|
27
26
|
namespace = "experiences";
|
|
28
27
|
translationKey = "micro_insights";
|
|
@@ -33,11 +32,11 @@ class nt {
|
|
|
33
32
|
// DEPRECATED: Initialize api in constructor and use loadCopy instead
|
|
34
33
|
// TODO: Remove this function
|
|
35
34
|
initialize = async (e, n) => {
|
|
36
|
-
this.copyApi = new
|
|
35
|
+
this.copyApi = new he(e, n), await this.loadCopy();
|
|
37
36
|
};
|
|
38
37
|
loadCopy = async () => {
|
|
39
38
|
const e = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
|
|
40
|
-
|
|
39
|
+
we(() => {
|
|
41
40
|
this.copyObject = e[this.translationKey];
|
|
42
41
|
});
|
|
43
42
|
};
|
|
@@ -68,58 +67,58 @@ const le = {
|
|
|
68
67
|
WeeklyNewMerchantsV2: "WeeklyNewMerchantsV2",
|
|
69
68
|
MonthlySpendComparison: "MonthlySpendComparison",
|
|
70
69
|
MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
|
|
71
|
-
},
|
|
70
|
+
}, O = window?.app?.clientConfig?.microwidget_instance_id || "", Ee = {
|
|
72
71
|
INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
|
|
73
|
-
},
|
|
72
|
+
}, Ne = (t) => `on${t}Click`, Me = (t) => `on${t}View`, ve = (t) => `on${t}ViewFirstTime`, de = (t) => t.replace(/([a-z])([A-Z])/g, "$1 $2"), lt = () => Object.values(le).reduce(
|
|
74
73
|
(t, e) => ({
|
|
75
74
|
...t,
|
|
76
|
-
[
|
|
77
|
-
action:
|
|
75
|
+
[Ne(e)]: {
|
|
76
|
+
action: b.MICRO_BEAT_CLICKED,
|
|
78
77
|
category: L.BEAT_INTERACTION,
|
|
79
78
|
label: de(e),
|
|
80
|
-
value:
|
|
79
|
+
value: O
|
|
81
80
|
}
|
|
82
81
|
}),
|
|
83
82
|
{}
|
|
84
|
-
),
|
|
83
|
+
), dt = () => Object.values(le).reduce(
|
|
85
84
|
(t, e) => ({
|
|
86
85
|
...t,
|
|
87
|
-
[
|
|
88
|
-
action:
|
|
86
|
+
[Me(e)]: {
|
|
87
|
+
action: b.MICRO_BEAT_DISPLAYED,
|
|
89
88
|
category: L.BEAT_INTERACTION,
|
|
90
89
|
label: de(e),
|
|
91
|
-
value:
|
|
90
|
+
value: O
|
|
92
91
|
}
|
|
93
92
|
}),
|
|
94
93
|
{}
|
|
95
|
-
),
|
|
94
|
+
), _t = () => Object.values(le).reduce(
|
|
96
95
|
(t, e) => ({
|
|
97
96
|
...t,
|
|
98
|
-
[
|
|
99
|
-
action:
|
|
97
|
+
[ve(e)]: {
|
|
98
|
+
action: b.MICRO_BEAT_DISPLAYED_FIRST_TIME,
|
|
100
99
|
category: L.BEAT_INTERACTION,
|
|
101
100
|
label: de(e),
|
|
102
|
-
value:
|
|
101
|
+
value: O
|
|
103
102
|
}
|
|
104
103
|
}),
|
|
105
104
|
{}
|
|
106
|
-
),
|
|
105
|
+
), v = {
|
|
107
106
|
CAROUSEL_CONTROL: "Carousel Control",
|
|
108
107
|
MICRO_WIDGET: "Micro Widget",
|
|
109
108
|
VIEW_MORE: "View More"
|
|
110
109
|
}, L = {
|
|
111
110
|
MICRO_WIDGET_INTERACTION: "Micro Widget Interaction",
|
|
112
111
|
BEAT_INTERACTION: "Beat Interaction"
|
|
113
|
-
},
|
|
112
|
+
}, W = {
|
|
114
113
|
ON_CAROUSEL_BACK_CLICK: "onCarouselBackClick",
|
|
115
114
|
ON_CAROUSEL_BACK_SWIPE: "onCarouselBackSwipe",
|
|
116
115
|
ON_CAROUSEL_FORWARD_CLICK: "onCarouselForwardClick",
|
|
117
116
|
ON_CAROUSEL_FORWARD_SWIPE: "onCarouselForwardSwipe",
|
|
118
117
|
ON_NO_RELEVANT_INSIGHTS_CLICKED: "onNoRelevantInsightsClicked",
|
|
119
118
|
ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
|
|
120
|
-
},
|
|
119
|
+
}, Le = {
|
|
121
120
|
ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
|
|
122
|
-
},
|
|
121
|
+
}, b = {
|
|
123
122
|
CONTROL_BACKWARD: "Control Backward",
|
|
124
123
|
CONTROL_FORWARD: "Control Forward",
|
|
125
124
|
MICRO_BEAT_CLICKED: "Micro Beat Clicked",
|
|
@@ -127,95 +126,95 @@ const le = {
|
|
|
127
126
|
MICRO_BEAT_DISPLAYED_FIRST_TIME: "Micro Beat Displayed For First Time",
|
|
128
127
|
SWIPE_BACKWARD: "Swipe Backward",
|
|
129
128
|
SWIPE_FORWARD: "Swipe Forward"
|
|
130
|
-
},
|
|
129
|
+
}, B = {
|
|
131
130
|
MICRO_WIDGET_CAROUSEL: "Micro Widget Carousel",
|
|
132
131
|
MICRO_WIDGET_CAROUSEL_ZERO_STATE: "Micro Widget Carousel Zero State",
|
|
133
132
|
MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS: "Micro Widget Carousel No Relevant Insights"
|
|
134
|
-
},
|
|
135
|
-
[
|
|
136
|
-
label:
|
|
137
|
-
name:
|
|
138
|
-
path:
|
|
139
|
-
value:
|
|
133
|
+
}, fe = {
|
|
134
|
+
[B.MICRO_WIDGET_CAROUSEL]: {
|
|
135
|
+
label: v.MICRO_WIDGET,
|
|
136
|
+
name: B.MICRO_WIDGET_CAROUSEL,
|
|
137
|
+
path: Ee.INSIGHTS_MICRO_WIDGET,
|
|
138
|
+
value: O
|
|
140
139
|
},
|
|
141
140
|
// zero state
|
|
142
|
-
[
|
|
143
|
-
label:
|
|
144
|
-
name:
|
|
145
|
-
path:
|
|
146
|
-
value:
|
|
141
|
+
[B.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
|
|
142
|
+
label: v.MICRO_WIDGET,
|
|
143
|
+
name: B.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
|
|
144
|
+
path: Ee.INSIGHTS_MICRO_WIDGET,
|
|
145
|
+
value: O
|
|
147
146
|
},
|
|
148
147
|
// no relevant cards
|
|
149
|
-
[
|
|
150
|
-
label:
|
|
151
|
-
name:
|
|
148
|
+
[B.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS]: {
|
|
149
|
+
label: v.MICRO_WIDGET,
|
|
150
|
+
name: B.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS,
|
|
152
151
|
path: "/micro-widget",
|
|
153
|
-
value:
|
|
152
|
+
value: O
|
|
154
153
|
}
|
|
155
|
-
},
|
|
154
|
+
}, ye = {
|
|
156
155
|
// carousel control interaction events - clicks and swipes
|
|
157
|
-
[
|
|
158
|
-
action:
|
|
156
|
+
[W.ON_CAROUSEL_BACK_CLICK]: {
|
|
157
|
+
action: b.CONTROL_BACKWARD,
|
|
159
158
|
category: L.MICRO_WIDGET_INTERACTION,
|
|
160
|
-
label:
|
|
161
|
-
value:
|
|
159
|
+
label: v.CAROUSEL_CONTROL,
|
|
160
|
+
value: O
|
|
162
161
|
},
|
|
163
|
-
[
|
|
164
|
-
action:
|
|
162
|
+
[W.ON_CAROUSEL_FORWARD_CLICK]: {
|
|
163
|
+
action: b.CONTROL_FORWARD,
|
|
165
164
|
category: L.MICRO_WIDGET_INTERACTION,
|
|
166
|
-
label:
|
|
167
|
-
value:
|
|
165
|
+
label: v.CAROUSEL_CONTROL,
|
|
166
|
+
value: O
|
|
168
167
|
},
|
|
169
|
-
[
|
|
170
|
-
action:
|
|
168
|
+
[W.ON_CAROUSEL_BACK_SWIPE]: {
|
|
169
|
+
action: b.SWIPE_BACKWARD,
|
|
171
170
|
category: L.MICRO_WIDGET_INTERACTION,
|
|
172
|
-
label:
|
|
173
|
-
value:
|
|
171
|
+
label: v.CAROUSEL_CONTROL,
|
|
172
|
+
value: O
|
|
174
173
|
},
|
|
175
|
-
[
|
|
176
|
-
action:
|
|
174
|
+
[W.ON_CAROUSEL_FORWARD_SWIPE]: {
|
|
175
|
+
action: b.SWIPE_FORWARD,
|
|
177
176
|
category: L.MICRO_WIDGET_INTERACTION,
|
|
178
|
-
label:
|
|
179
|
-
value:
|
|
177
|
+
label: v.CAROUSEL_CONTROL,
|
|
178
|
+
value: O
|
|
180
179
|
},
|
|
181
180
|
// read more card events
|
|
182
|
-
[
|
|
183
|
-
action:
|
|
181
|
+
[W.ON_VIEW_MORE_CLICKED]: {
|
|
182
|
+
action: b.MICRO_BEAT_CLICKED,
|
|
184
183
|
category: L.BEAT_INTERACTION,
|
|
185
|
-
label:
|
|
186
|
-
value:
|
|
184
|
+
label: v.VIEW_MORE,
|
|
185
|
+
value: O
|
|
187
186
|
},
|
|
188
|
-
[
|
|
189
|
-
action:
|
|
187
|
+
[Le.ON_VIEW_MORE_VIEWED]: {
|
|
188
|
+
action: b.MICRO_BEAT_DISPLAYED,
|
|
190
189
|
category: L.BEAT_INTERACTION,
|
|
191
|
-
label:
|
|
192
|
-
value:
|
|
190
|
+
label: v.VIEW_MORE,
|
|
191
|
+
value: O
|
|
193
192
|
},
|
|
194
|
-
...
|
|
195
|
-
...
|
|
196
|
-
...
|
|
197
|
-
},
|
|
193
|
+
...lt(),
|
|
194
|
+
...dt(),
|
|
195
|
+
..._t()
|
|
196
|
+
}, Ae = async (t, e) => !e || !ye[t] ? null : e.sendAnalyticEvent(ye[t]).then((n) => n).catch((n) => {
|
|
198
197
|
throw n;
|
|
199
|
-
}),
|
|
198
|
+
}), Se = async (t, e) => !e || !fe[t] ? null : e.sendAnalyticsPageview(fe[t]).then((n) => n).catch((n) => {
|
|
200
199
|
throw n;
|
|
201
200
|
});
|
|
202
|
-
class
|
|
203
|
-
onAnalyticEvent =
|
|
204
|
-
onAnalyticPageView =
|
|
205
|
-
beatApi = new
|
|
201
|
+
class pt {
|
|
202
|
+
onAnalyticEvent = Ae;
|
|
203
|
+
onAnalyticPageView = Se;
|
|
204
|
+
beatApi = new ge("/", "");
|
|
206
205
|
constructor() {
|
|
207
206
|
ce(this);
|
|
208
207
|
}
|
|
209
|
-
initialize = async (e, n,
|
|
210
|
-
this.onAnalyticEvent = (
|
|
211
|
-
|
|
212
|
-
throw a.status === 401 &&
|
|
208
|
+
initialize = async (e, n, i) => {
|
|
209
|
+
this.onAnalyticEvent = (r, l) => {
|
|
210
|
+
Ae(r, l).then((a) => a).catch((a) => {
|
|
211
|
+
throw a.status === 401 && i(), a;
|
|
213
212
|
});
|
|
214
|
-
}, this.onAnalyticPageView = (
|
|
215
|
-
|
|
216
|
-
throw a.status === 401 &&
|
|
213
|
+
}, this.onAnalyticPageView = (r, l) => {
|
|
214
|
+
Se(r, l).then((a) => a).catch((a) => {
|
|
215
|
+
throw a.status === 401 && i(), a;
|
|
217
216
|
});
|
|
218
|
-
}, this.beatApi = new
|
|
217
|
+
}, this.beatApi = new ge(e, n);
|
|
219
218
|
};
|
|
220
219
|
updateBeat = async (e) => {
|
|
221
220
|
this.beatApi.updateBeat(e);
|
|
@@ -224,7 +223,7 @@ class st {
|
|
|
224
223
|
this.beatApi.updateOffer(e);
|
|
225
224
|
};
|
|
226
225
|
}
|
|
227
|
-
class
|
|
226
|
+
class mt {
|
|
228
227
|
copyStore;
|
|
229
228
|
endpoint = "/";
|
|
230
229
|
insightsMicroWidgetStore;
|
|
@@ -232,33 +231,33 @@ class ct {
|
|
|
232
231
|
token = "";
|
|
233
232
|
isInitialized = !1;
|
|
234
233
|
constructor() {
|
|
235
|
-
this.copyStore = new
|
|
234
|
+
this.copyStore = new ct(), this.insightsMicroWidgetStore = new pt(), ce(this);
|
|
236
235
|
}
|
|
237
|
-
initialize = async (e, n,
|
|
238
|
-
await this.copyStore.initialize(e, n), await this.insightsMicroWidgetStore.initialize(e, n,
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
this.session =
|
|
236
|
+
initialize = async (e, n, i) => {
|
|
237
|
+
await this.copyStore.initialize(e, n), await this.insightsMicroWidgetStore.initialize(e, n, i);
|
|
238
|
+
const r = await Je(e, n, "1.0.0", "Micro Insights Carousel");
|
|
239
|
+
we(() => {
|
|
240
|
+
this.session = r, this.isInitialized = !0;
|
|
242
241
|
});
|
|
243
242
|
};
|
|
244
243
|
}
|
|
245
|
-
const
|
|
244
|
+
const H = I.createContext(null), ut = ({
|
|
246
245
|
onEvent: t,
|
|
247
246
|
onPageview: e,
|
|
248
247
|
store: n,
|
|
249
|
-
children:
|
|
250
|
-
}) => /* @__PURE__ */ o(
|
|
251
|
-
const { primary_category_guid: e, category_guids: n } = t,
|
|
252
|
-
return /* @__PURE__ */ o(
|
|
248
|
+
children: i
|
|
249
|
+
}) => /* @__PURE__ */ o(H.Provider, { value: { onEvent: t, onPageview: e, store: n, children: i }, children: i }), Ct = ({ beat: t }) => {
|
|
250
|
+
const { primary_category_guid: e, category_guids: n } = t, i = e || n?.[0] || Ze.UNCATEGORIZED;
|
|
251
|
+
return /* @__PURE__ */ o(ze, { categoryGuid: i, size: 32, sx: { minWidth: 32 } });
|
|
253
252
|
}, c = ({
|
|
254
253
|
avatarSx: t,
|
|
255
254
|
bgColor: e,
|
|
256
255
|
name: n,
|
|
257
|
-
iconColor:
|
|
258
|
-
fill:
|
|
256
|
+
iconColor: i = "primary",
|
|
257
|
+
fill: r = !0,
|
|
259
258
|
sx: l
|
|
260
259
|
}) => /* @__PURE__ */ o(
|
|
261
|
-
|
|
260
|
+
st,
|
|
262
261
|
{
|
|
263
262
|
sx: {
|
|
264
263
|
bgcolor: e,
|
|
@@ -267,15 +266,15 @@ const Y = h.createContext(null), lt = ({
|
|
|
267
266
|
...t
|
|
268
267
|
},
|
|
269
268
|
variant: "rounded",
|
|
270
|
-
children: /* @__PURE__ */ o(
|
|
269
|
+
children: /* @__PURE__ */ o($e, { color: i, fill: r, name: n, size: 20, sx: l })
|
|
271
270
|
}
|
|
272
|
-
),
|
|
273
|
-
const { category_guids: e, merchant_guids: n, primary_category_guid:
|
|
271
|
+
), ht = ({ beat: t }) => {
|
|
272
|
+
const { category_guids: e, merchant_guids: n, primary_category_guid: i, primary_merchant_guid: r } = t;
|
|
274
273
|
return /* @__PURE__ */ o(
|
|
275
|
-
|
|
274
|
+
Ke,
|
|
276
275
|
{
|
|
277
|
-
categoryGuid:
|
|
278
|
-
merchantGuid:
|
|
276
|
+
categoryGuid: i || e && e[0] || "",
|
|
277
|
+
merchantGuid: r || n[0],
|
|
279
278
|
size: 32,
|
|
280
279
|
sx: {
|
|
281
280
|
display: "flex",
|
|
@@ -284,51 +283,51 @@ const Y = h.createContext(null), lt = ({
|
|
|
284
283
|
}
|
|
285
284
|
}
|
|
286
285
|
);
|
|
287
|
-
},
|
|
286
|
+
}, gt = (t) => t ? t.data ? t.data.map((e) => {
|
|
288
287
|
const n = {};
|
|
289
|
-
return t.names?.map((
|
|
290
|
-
n[
|
|
288
|
+
return t.names?.map((i, r) => {
|
|
289
|
+
n[i] = e[r];
|
|
291
290
|
}), n;
|
|
292
|
-
}) : [] : [], q = "primary", be = "success",
|
|
293
|
-
const e =
|
|
291
|
+
}) : [] : [], q = "primary", be = "success", De = "error", xe = (t) => {
|
|
292
|
+
const e = gt(t), n = Math.floor(e.length / 2);
|
|
294
293
|
if (n === 0 || n === e.length) return q;
|
|
295
|
-
const
|
|
296
|
-
return
|
|
297
|
-
},
|
|
298
|
-
const e = se(), n =
|
|
299
|
-
return /* @__PURE__ */ o(c, { bgColor: s(
|
|
300
|
-
},
|
|
294
|
+
const i = e[0]?.amount, r = e[n]?.amount;
|
|
295
|
+
return i == null || r == null ? q : i > r ? De : i < r ? be : q;
|
|
296
|
+
}, It = (t, e) => t < e ? be : t > e ? De : q, Et = ({ beat: t }) => {
|
|
297
|
+
const e = se(), n = xe(t.data_series), i = e.palette[n].main;
|
|
298
|
+
return /* @__PURE__ */ o(c, { bgColor: s(i, 0.15), iconColor: n, name: "bar_chart" });
|
|
299
|
+
}, ft = ({ beat: t }) => {
|
|
301
300
|
const e = se(), n = t.payload?.average_spend || 0;
|
|
302
|
-
let
|
|
301
|
+
let i = 0;
|
|
303
302
|
if (t.data_series?.data && t.data_series.data.length > 0) {
|
|
304
303
|
const a = (t.data_series.names || []).indexOf("amount");
|
|
305
|
-
a !== -1 && (
|
|
304
|
+
a !== -1 && (i = t.data_series.data[0][a] || 0);
|
|
306
305
|
}
|
|
307
|
-
const
|
|
306
|
+
const r = It(i, n);
|
|
308
307
|
return /* @__PURE__ */ o(
|
|
309
308
|
c,
|
|
310
309
|
{
|
|
311
|
-
bgColor: s(e.palette[
|
|
312
|
-
iconColor:
|
|
310
|
+
bgColor: s(e.palette[r].main, 0.15),
|
|
311
|
+
iconColor: r,
|
|
313
312
|
name: "timeline"
|
|
314
313
|
}
|
|
315
314
|
);
|
|
316
|
-
},
|
|
317
|
-
const e = se(), n =
|
|
315
|
+
}, yt = ({ beat: t }) => {
|
|
316
|
+
const e = se(), n = xe(t.data_series), i = e.palette[n].main;
|
|
318
317
|
return /* @__PURE__ */ o(
|
|
319
318
|
c,
|
|
320
319
|
{
|
|
321
|
-
bgColor: s(
|
|
320
|
+
bgColor: s(i, 0.15),
|
|
322
321
|
fill: !1,
|
|
323
322
|
iconColor: n,
|
|
324
323
|
name: "area_chart"
|
|
325
324
|
}
|
|
326
325
|
);
|
|
327
|
-
},
|
|
326
|
+
}, At = ({ beat: t }) => /* @__PURE__ */ o(Fe, { alt: t.institutionName || "", institutionGuid: t.institutionGuid || "" }), St = {
|
|
328
327
|
0: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "error" }),
|
|
329
|
-
1: (t) => /* @__PURE__ */ o(
|
|
330
|
-
2: (t) => /* @__PURE__ */ o(
|
|
331
|
-
3: (t) => /* @__PURE__ */ o(
|
|
328
|
+
1: (t) => /* @__PURE__ */ o(Ct, { beat: t }),
|
|
329
|
+
2: (t) => /* @__PURE__ */ o(ht, { beat: t }),
|
|
330
|
+
3: (t) => /* @__PURE__ */ o(Et, { beat: t }),
|
|
332
331
|
4: (t, e) => /* @__PURE__ */ o(
|
|
333
332
|
c,
|
|
334
333
|
{
|
|
@@ -361,7 +360,7 @@ const Y = h.createContext(null), lt = ({
|
|
|
361
360
|
sx: { color: "text.primary" }
|
|
362
361
|
}
|
|
363
362
|
),
|
|
364
|
-
12: (t) => /* @__PURE__ */ o(
|
|
363
|
+
12: (t) => /* @__PURE__ */ o(yt, { beat: t }),
|
|
365
364
|
13: () => /* @__PURE__ */ o(
|
|
366
365
|
c,
|
|
367
366
|
{
|
|
@@ -430,7 +429,7 @@ const Y = h.createContext(null), lt = ({
|
|
|
430
429
|
),
|
|
431
430
|
27: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "directions_car" }),
|
|
432
431
|
28: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "contract" }),
|
|
433
|
-
29: (t) => /* @__PURE__ */ o(
|
|
432
|
+
29: (t) => /* @__PURE__ */ o(ft, { beat: t }),
|
|
434
433
|
30: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "calendar_month" }),
|
|
435
434
|
31: (t, e) => /* @__PURE__ */ o(
|
|
436
435
|
c,
|
|
@@ -449,81 +448,80 @@ const Y = h.createContext(null), lt = ({
|
|
|
449
448
|
name: "storefront"
|
|
450
449
|
}
|
|
451
450
|
),
|
|
452
|
-
34: (t) => /* @__PURE__ */ o(
|
|
453
|
-
},
|
|
454
|
-
const e =
|
|
455
|
-
return
|
|
456
|
-
},
|
|
457
|
-
const t =
|
|
451
|
+
34: (t) => /* @__PURE__ */ o(At, { beat: t })
|
|
452
|
+
}, Tt = ({ beat: t }) => {
|
|
453
|
+
const e = F(), { icon_type: n } = t, i = n != null ? St[n] : null;
|
|
454
|
+
return i ? i(t, e) : /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "error" });
|
|
455
|
+
}, D = () => {
|
|
456
|
+
const t = I.useContext(H);
|
|
458
457
|
if (!t)
|
|
459
458
|
throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
|
|
460
459
|
return t.store.copyStore;
|
|
461
|
-
},
|
|
462
|
-
const t =
|
|
460
|
+
}, Rt = () => {
|
|
461
|
+
const t = I.useContext(H);
|
|
463
462
|
if (!t?.store?.insightsMicroWidgetStore)
|
|
464
463
|
throw new Error(
|
|
465
464
|
"useInsightsMicroWidgetStore() must be used within the InsightsMicroWidgetDataProvider"
|
|
466
465
|
);
|
|
467
466
|
return t.store.insightsMicroWidgetStore;
|
|
468
|
-
},
|
|
469
|
-
const t =
|
|
467
|
+
}, $ = () => {
|
|
468
|
+
const t = I.useContext(H);
|
|
470
469
|
if (!t)
|
|
471
470
|
throw new Error("useEvent() must be used within the InsightsMicroWidgetDataProvider");
|
|
472
471
|
return { onEvent: t.onEvent };
|
|
473
|
-
},
|
|
474
|
-
const t =
|
|
472
|
+
}, Be = () => {
|
|
473
|
+
const t = I.useContext(H);
|
|
475
474
|
if (!t)
|
|
476
475
|
throw new Error("usePageview() must be used within the InsightsMicroWidgetDataProvider");
|
|
477
476
|
return { onPageview: t.onPageview };
|
|
478
|
-
},
|
|
477
|
+
}, Ot = {
|
|
479
478
|
LARGE: 180,
|
|
480
479
|
STANDARD: 154,
|
|
481
480
|
XLARGE: 200,
|
|
482
481
|
XXLARGE: 248
|
|
483
|
-
},
|
|
482
|
+
}, Wt = 50, Pe = 1, J = I.forwardRef(
|
|
484
483
|
function({
|
|
485
484
|
ariaLabel: e,
|
|
486
|
-
|
|
487
|
-
closeAriaLabel: r,
|
|
485
|
+
closeAriaLabel: n,
|
|
488
486
|
description: i,
|
|
487
|
+
elevation: r,
|
|
489
488
|
icon: l,
|
|
490
489
|
isActiveCard: a,
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
title: S,
|
|
490
|
+
heightOverrides: u,
|
|
491
|
+
onClose: C,
|
|
492
|
+
onCardClick: E,
|
|
493
|
+
onPrimaryAction: h,
|
|
494
|
+
onSecondaryAction: d,
|
|
495
|
+
primaryActionText: _,
|
|
496
|
+
secondaryActionText: p,
|
|
497
|
+
title: g,
|
|
500
498
|
variant: y,
|
|
501
|
-
widthOverrides:
|
|
502
|
-
...
|
|
503
|
-
},
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
|
|
499
|
+
widthOverrides: S,
|
|
500
|
+
...w
|
|
501
|
+
}, T) {
|
|
502
|
+
const A = !!(h && _), R = /* @__PURE__ */ N(Re, { children: [
|
|
503
|
+
C && /* @__PURE__ */ o(
|
|
504
|
+
at,
|
|
507
505
|
{
|
|
508
|
-
"aria-label":
|
|
509
|
-
onClick: (
|
|
510
|
-
|
|
506
|
+
"aria-label": n,
|
|
507
|
+
onClick: (m) => {
|
|
508
|
+
m.stopPropagation(), C?.();
|
|
511
509
|
},
|
|
512
|
-
onMouseDown: (
|
|
513
|
-
|
|
510
|
+
onMouseDown: (m) => {
|
|
511
|
+
m.stopPropagation();
|
|
514
512
|
},
|
|
515
|
-
onTouchStart: (
|
|
516
|
-
|
|
513
|
+
onTouchStart: (m) => {
|
|
514
|
+
m.stopPropagation();
|
|
517
515
|
},
|
|
518
516
|
sx: { minHeight: 40, minWidth: 40, position: "absolute", right: 4, top: 4 },
|
|
519
|
-
children: /* @__PURE__ */ o(
|
|
517
|
+
children: /* @__PURE__ */ o(je, {})
|
|
520
518
|
}
|
|
521
519
|
),
|
|
522
|
-
/* @__PURE__ */ N(
|
|
523
|
-
/* @__PURE__ */ N(
|
|
520
|
+
/* @__PURE__ */ N(K, { sx: { gap: 6, height: "100%", justifyContent: "space-between" }, children: [
|
|
521
|
+
/* @__PURE__ */ N(K, { sx: { flexDirection: "row", gap: 12 }, children: [
|
|
524
522
|
l && l,
|
|
525
|
-
/* @__PURE__ */ N(
|
|
526
|
-
/* @__PURE__ */ o(
|
|
523
|
+
/* @__PURE__ */ N(K, { sx: { gap: 6 }, children: [
|
|
524
|
+
/* @__PURE__ */ o(K, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: /* @__PURE__ */ o(me, { bold: !0, sx: { lineHeight: "16px" }, variant: "body1", children: g }) }),
|
|
527
525
|
/* @__PURE__ */ o(
|
|
528
526
|
me,
|
|
529
527
|
{
|
|
@@ -533,7 +531,7 @@ const Y = h.createContext(null), lt = ({
|
|
|
533
531
|
overflow: "hidden",
|
|
534
532
|
textOverflow: "ellipsis",
|
|
535
533
|
WebkitBoxOrient: "vertical",
|
|
536
|
-
WebkitLineClamp:
|
|
534
|
+
WebkitLineClamp: A ? 2 : 3,
|
|
537
535
|
"& .bold-copy": {
|
|
538
536
|
fontWeight: "bold",
|
|
539
537
|
fontFamily: "inherit"
|
|
@@ -544,8 +542,8 @@ const Y = h.createContext(null), lt = ({
|
|
|
544
542
|
)
|
|
545
543
|
] })
|
|
546
544
|
] }),
|
|
547
|
-
|
|
548
|
-
|
|
545
|
+
A && /* @__PURE__ */ N(
|
|
546
|
+
K,
|
|
549
547
|
{
|
|
550
548
|
sx: {
|
|
551
549
|
alignItems: "center",
|
|
@@ -555,40 +553,40 @@ const Y = h.createContext(null), lt = ({
|
|
|
555
553
|
pl: l ? 36 : 0
|
|
556
554
|
},
|
|
557
555
|
children: [
|
|
558
|
-
|
|
559
|
-
|
|
556
|
+
A && /* @__PURE__ */ o(
|
|
557
|
+
Ie,
|
|
560
558
|
{
|
|
561
|
-
onClick: (
|
|
562
|
-
|
|
559
|
+
onClick: (m) => {
|
|
560
|
+
m.stopPropagation(), h?.();
|
|
563
561
|
},
|
|
564
|
-
onMouseDown: (
|
|
565
|
-
|
|
562
|
+
onMouseDown: (m) => {
|
|
563
|
+
m.stopPropagation();
|
|
566
564
|
},
|
|
567
|
-
onTouchStart: (
|
|
568
|
-
|
|
565
|
+
onTouchStart: (m) => {
|
|
566
|
+
m.stopPropagation();
|
|
569
567
|
},
|
|
570
568
|
size: "small",
|
|
571
569
|
sx: { px: 8, ml: l ? 0 : -8 },
|
|
572
570
|
variant: "text",
|
|
573
|
-
children: /* @__PURE__ */ o(ue, { bold: !0, variant: "body2", children:
|
|
571
|
+
children: /* @__PURE__ */ o(ue, { bold: !0, variant: "body2", children: _ })
|
|
574
572
|
}
|
|
575
573
|
),
|
|
576
|
-
|
|
577
|
-
|
|
574
|
+
!!(d && p) && /* @__PURE__ */ o(
|
|
575
|
+
Ie,
|
|
578
576
|
{
|
|
579
|
-
onClick: (
|
|
580
|
-
|
|
577
|
+
onClick: (m) => {
|
|
578
|
+
m.stopPropagation(), d?.();
|
|
581
579
|
},
|
|
582
|
-
onMouseDown: (
|
|
583
|
-
|
|
580
|
+
onMouseDown: (m) => {
|
|
581
|
+
m.stopPropagation();
|
|
584
582
|
},
|
|
585
|
-
onTouchStart: (
|
|
586
|
-
|
|
583
|
+
onTouchStart: (m) => {
|
|
584
|
+
m.stopPropagation();
|
|
587
585
|
},
|
|
588
586
|
size: "small",
|
|
589
587
|
sx: { px: 8 },
|
|
590
588
|
variant: "text",
|
|
591
|
-
children: /* @__PURE__ */ o(ue, { bold: !0, sx: { color: "text.secondary" }, variant: "body2", children:
|
|
589
|
+
children: /* @__PURE__ */ o(ue, { bold: !0, sx: { color: "text.secondary" }, variant: "body2", children: p })
|
|
592
590
|
}
|
|
593
591
|
)
|
|
594
592
|
]
|
|
@@ -597,92 +595,94 @@ const Y = h.createContext(null), lt = ({
|
|
|
597
595
|
] })
|
|
598
596
|
] });
|
|
599
597
|
return /* @__PURE__ */ o(
|
|
600
|
-
|
|
598
|
+
nt,
|
|
601
599
|
{
|
|
602
600
|
"aria-hidden": !a,
|
|
603
601
|
"aria-label": e,
|
|
604
|
-
|
|
602
|
+
elevation: r,
|
|
603
|
+
ref: T,
|
|
605
604
|
role: "group",
|
|
606
605
|
sx: {
|
|
607
606
|
backgroundColor: "background.paper",
|
|
608
|
-
height:
|
|
609
|
-
minWidth:
|
|
607
|
+
height: u ? "100%" : 120,
|
|
608
|
+
minWidth: S ? `${S}px` : "100%",
|
|
610
609
|
position: "relative",
|
|
611
610
|
my: 1,
|
|
612
|
-
|
|
611
|
+
borderRadius: 2
|
|
613
612
|
},
|
|
614
|
-
tabIndex:
|
|
613
|
+
tabIndex: E || !a ? -1 : 0,
|
|
615
614
|
variant: y,
|
|
616
|
-
...
|
|
617
|
-
children:
|
|
618
|
-
|
|
615
|
+
...w,
|
|
616
|
+
children: E ? /* @__PURE__ */ o(
|
|
617
|
+
it,
|
|
619
618
|
{
|
|
620
619
|
component: "div",
|
|
621
|
-
onClick:
|
|
620
|
+
onClick: E,
|
|
622
621
|
sx: {
|
|
623
622
|
pb: 8,
|
|
624
623
|
pt: 16,
|
|
625
624
|
px: 16,
|
|
626
625
|
height: "100%"
|
|
627
626
|
},
|
|
628
|
-
children:
|
|
627
|
+
children: R
|
|
629
628
|
}
|
|
630
|
-
) : /* @__PURE__ */ o(
|
|
629
|
+
) : /* @__PURE__ */ o(rt, { sx: { pb: 8, pt: 16, px: 16, height: "100%" }, children: R })
|
|
631
630
|
}
|
|
632
631
|
);
|
|
633
632
|
}
|
|
634
|
-
),
|
|
633
|
+
), wt = ({
|
|
635
634
|
ariaLabel: t,
|
|
636
635
|
beat: e,
|
|
637
|
-
|
|
636
|
+
elevation: n,
|
|
637
|
+
index: i,
|
|
638
638
|
isActiveCard: r,
|
|
639
|
-
onCardClick:
|
|
640
|
-
posthog:
|
|
641
|
-
widthOverrides:
|
|
642
|
-
variant:
|
|
643
|
-
showIcon:
|
|
644
|
-
heightOverrides:
|
|
639
|
+
onCardClick: l,
|
|
640
|
+
posthog: a,
|
|
641
|
+
widthOverrides: u,
|
|
642
|
+
variant: C,
|
|
643
|
+
showIcon: E,
|
|
644
|
+
heightOverrides: h
|
|
645
645
|
}) => {
|
|
646
|
-
const { ref: d, inView: _ } =
|
|
647
|
-
threshold:
|
|
648
|
-
}), { cardsCopy: p } =
|
|
646
|
+
const { ref: d, inView: _ } = We({
|
|
647
|
+
threshold: Pe
|
|
648
|
+
}), { cardsCopy: p } = D(), { onEvent: g } = $(), { updateBeat: y, updateOffer: S } = Rt();
|
|
649
649
|
re(() => {
|
|
650
|
-
_ && (e.has_been_displayed ?
|
|
650
|
+
_ && (e.has_been_displayed ? g(Me(e.template)) : (e.guid.startsWith("OFR") ? S({
|
|
651
651
|
...e,
|
|
652
652
|
has_been_displayed: !0
|
|
653
|
-
}) :
|
|
653
|
+
}) : y({
|
|
654
654
|
...e,
|
|
655
655
|
has_been_displayed: !0
|
|
656
|
-
}),
|
|
656
|
+
}), g(ve(e.template))));
|
|
657
657
|
}, [_]), re(() => {
|
|
658
658
|
if (_ && e)
|
|
659
659
|
if (e.template === "MarketingOffer") {
|
|
660
|
-
const
|
|
661
|
-
|
|
660
|
+
const T = e;
|
|
661
|
+
a?.capture("viewed_messaging_insight", {
|
|
662
662
|
template: e.template,
|
|
663
|
-
campaign_guid:
|
|
664
|
-
campaign_name:
|
|
663
|
+
campaign_guid: T.campaign_guid,
|
|
664
|
+
campaign_name: T.pulse_campaign_name
|
|
665
665
|
});
|
|
666
666
|
} else
|
|
667
|
-
|
|
667
|
+
a?.capture("viewed_insight", {
|
|
668
668
|
beat_guid: e.guid,
|
|
669
669
|
template: e.template,
|
|
670
|
-
position:
|
|
670
|
+
position: i
|
|
671
671
|
});
|
|
672
|
-
}, [e,
|
|
673
|
-
const
|
|
674
|
-
if (
|
|
675
|
-
const
|
|
676
|
-
|
|
672
|
+
}, [e, i, _]);
|
|
673
|
+
const w = () => {
|
|
674
|
+
if (l && l(e), g(Ne(e.template)), e.template === "MarketingOffer") {
|
|
675
|
+
const T = e;
|
|
676
|
+
a?.capture("clicked_messaging_insight", {
|
|
677
677
|
template: e.template,
|
|
678
|
-
campaign_guid:
|
|
679
|
-
campaign_name:
|
|
678
|
+
campaign_guid: T.campaign_guid,
|
|
679
|
+
campaign_name: T.pulse_campaign_name
|
|
680
680
|
});
|
|
681
681
|
} else
|
|
682
|
-
|
|
682
|
+
a?.capture("clicked_insight", {
|
|
683
683
|
beat_guid: e.guid,
|
|
684
684
|
template: e.template,
|
|
685
|
-
position:
|
|
685
|
+
position: i
|
|
686
686
|
});
|
|
687
687
|
};
|
|
688
688
|
return /* @__PURE__ */ o(
|
|
@@ -690,36 +690,33 @@ const Y = h.createContext(null), lt = ({
|
|
|
690
690
|
{
|
|
691
691
|
"aria-roledescription": "slide",
|
|
692
692
|
ariaLabel: t,
|
|
693
|
-
cardSx: {
|
|
694
|
-
borderRadius: 2
|
|
695
|
-
},
|
|
696
693
|
description: e?.html_micro_description && e?.html_micro_description.length > 0 ? e.html_micro_description : e.html_description || "",
|
|
697
|
-
|
|
698
|
-
heightOverrides:
|
|
699
|
-
icon:
|
|
694
|
+
elevation: n,
|
|
695
|
+
heightOverrides: h,
|
|
696
|
+
icon: E && /* @__PURE__ */ o(Tt, { beat: e }),
|
|
700
697
|
isActiveCard: r,
|
|
701
|
-
onCardClick:
|
|
702
|
-
onPrimaryAction:
|
|
698
|
+
onCardClick: w,
|
|
699
|
+
onPrimaryAction: w,
|
|
703
700
|
primaryActionText: e.micro_call_to_action || p?.micro_card_cta,
|
|
704
701
|
ref: d,
|
|
705
702
|
title: e.micro_title && e.micro_title.length > 0 ? e.micro_title : e.title,
|
|
706
|
-
variant:
|
|
707
|
-
widthOverrides:
|
|
703
|
+
variant: C,
|
|
704
|
+
widthOverrides: u
|
|
708
705
|
}
|
|
709
706
|
);
|
|
710
|
-
},
|
|
707
|
+
}, Nt = ({
|
|
711
708
|
currentBeatIndex: t,
|
|
712
709
|
numBeats: e,
|
|
713
710
|
onNextClick: n,
|
|
714
|
-
onPreviousClick:
|
|
715
|
-
scrollRightBoundary:
|
|
711
|
+
onPreviousClick: i,
|
|
712
|
+
scrollRightBoundary: r,
|
|
716
713
|
scrollX: l,
|
|
717
714
|
shouldApplyDotAnimation: a = !1,
|
|
718
715
|
visibleCardsCount: u = 1
|
|
719
716
|
}) => {
|
|
720
|
-
const
|
|
717
|
+
const C = F(), { carouselCopy: E } = D(), h = Math.floor(l) > r || t - u + 1 === 0, d = l < 0 || e - 1 === t, _ = C.palette.grey[500], p = C.palette.primary.main;
|
|
721
718
|
return /* @__PURE__ */ N(
|
|
722
|
-
|
|
719
|
+
G,
|
|
723
720
|
{
|
|
724
721
|
direction: "row",
|
|
725
722
|
sx: {
|
|
@@ -734,30 +731,30 @@ const Y = h.createContext(null), lt = ({
|
|
|
734
731
|
},
|
|
735
732
|
children: [
|
|
736
733
|
/* @__PURE__ */ o(
|
|
737
|
-
|
|
734
|
+
Ce,
|
|
738
735
|
{
|
|
739
|
-
"aria-disabled":
|
|
740
|
-
"aria-label":
|
|
741
|
-
disabled:
|
|
742
|
-
onClick:
|
|
736
|
+
"aria-disabled": h,
|
|
737
|
+
"aria-label": E?.previous_insight_cta_aria,
|
|
738
|
+
disabled: h,
|
|
739
|
+
onClick: i,
|
|
743
740
|
children: /* @__PURE__ */ o(
|
|
744
|
-
|
|
741
|
+
Ye,
|
|
745
742
|
{
|
|
746
743
|
style: {
|
|
747
|
-
color:
|
|
744
|
+
color: h ? _ : p
|
|
748
745
|
}
|
|
749
746
|
}
|
|
750
747
|
)
|
|
751
748
|
}
|
|
752
749
|
),
|
|
753
|
-
Array.from({ length: e }).map((
|
|
754
|
-
const
|
|
750
|
+
Array.from({ length: e }).map((g, y) => {
|
|
751
|
+
const S = y === t;
|
|
755
752
|
return /* @__PURE__ */ o(
|
|
756
|
-
|
|
753
|
+
ae,
|
|
757
754
|
{
|
|
758
755
|
className: "mx-insights-micro-carousel-dots",
|
|
759
756
|
sx: {
|
|
760
|
-
bgcolor:
|
|
757
|
+
bgcolor: S ? p : _,
|
|
761
758
|
height: 8,
|
|
762
759
|
mr: 8,
|
|
763
760
|
// existing comment from meganthan "we were using `gap` instead of margin, but it doesn't work in safari browsers older than iOS 14.1"
|
|
@@ -770,24 +767,24 @@ const Y = h.createContext(null), lt = ({
|
|
|
770
767
|
borderRadius: "50%",
|
|
771
768
|
p: 0
|
|
772
769
|
},
|
|
773
|
-
width:
|
|
770
|
+
width: S && a ? 24 : 8
|
|
774
771
|
}
|
|
775
772
|
},
|
|
776
|
-
`carousel-button-${
|
|
773
|
+
`carousel-button-${y}`
|
|
777
774
|
);
|
|
778
775
|
}),
|
|
779
776
|
/* @__PURE__ */ o(
|
|
780
|
-
|
|
777
|
+
Ce,
|
|
781
778
|
{
|
|
782
|
-
"aria-disabled":
|
|
783
|
-
"aria-label":
|
|
784
|
-
disabled:
|
|
779
|
+
"aria-disabled": d,
|
|
780
|
+
"aria-label": E?.next_insight_cta_aria,
|
|
781
|
+
disabled: d,
|
|
785
782
|
onClick: n,
|
|
786
783
|
children: /* @__PURE__ */ o(
|
|
787
|
-
|
|
784
|
+
Oe,
|
|
788
785
|
{
|
|
789
786
|
style: {
|
|
790
|
-
color:
|
|
787
|
+
color: d ? _ : p
|
|
791
788
|
}
|
|
792
789
|
}
|
|
793
790
|
)
|
|
@@ -796,131 +793,134 @@ const Y = h.createContext(null), lt = ({
|
|
|
796
793
|
]
|
|
797
794
|
}
|
|
798
795
|
);
|
|
799
|
-
},
|
|
796
|
+
}, Mt = ({
|
|
800
797
|
activeCardIndex: t,
|
|
801
798
|
beats: e,
|
|
802
799
|
cardWidth: n,
|
|
800
|
+
elevation: i,
|
|
803
801
|
heightOverrides: r,
|
|
804
|
-
onCardClick:
|
|
805
|
-
posthog:
|
|
806
|
-
showIcon:
|
|
807
|
-
variant:
|
|
802
|
+
onCardClick: l,
|
|
803
|
+
posthog: a,
|
|
804
|
+
showIcon: u,
|
|
805
|
+
variant: C
|
|
808
806
|
}) => {
|
|
809
|
-
const { carouselCopy:
|
|
807
|
+
const { carouselCopy: E } = D(), h = {
|
|
808
|
+
elevation: i,
|
|
810
809
|
heightOverrides: r,
|
|
811
|
-
posthog:
|
|
812
|
-
showIcon:
|
|
813
|
-
variant:
|
|
810
|
+
posthog: a,
|
|
811
|
+
showIcon: u,
|
|
812
|
+
variant: C
|
|
814
813
|
};
|
|
815
|
-
return /* @__PURE__ */ N(
|
|
814
|
+
return /* @__PURE__ */ N(Re, { children: [
|
|
816
815
|
e.map((d, _) => {
|
|
817
|
-
const p = _ + 1,
|
|
818
|
-
|
|
816
|
+
const p = _ + 1, g = e.length + 1, y = Qe(
|
|
817
|
+
E?.card_position_in_carousel_aria,
|
|
819
818
|
p.toString(),
|
|
820
|
-
|
|
821
|
-
), S = d.micro_title && d.micro_title.length > 0,
|
|
819
|
+
g.toString()
|
|
820
|
+
), S = d.micro_title && d.micro_title.length > 0, w = d.micro_description && d.micro_description.length > 0, T = S ? d.micro_title : d.title, A = w ? d.micro_description : d.description;
|
|
822
821
|
return /* @__PURE__ */ o(
|
|
823
|
-
|
|
822
|
+
wt,
|
|
824
823
|
{
|
|
825
|
-
ariaLabel: `${
|
|
824
|
+
ariaLabel: `${y}: ${T}, ${A}`,
|
|
826
825
|
beat: d,
|
|
827
826
|
index: _,
|
|
828
827
|
isActiveCard: _ === t,
|
|
829
|
-
onCardClick:
|
|
828
|
+
onCardClick: l,
|
|
830
829
|
widthOverrides: n || void 0,
|
|
831
|
-
...
|
|
830
|
+
...h
|
|
832
831
|
},
|
|
833
832
|
`${d.guid} ${_}`
|
|
834
833
|
);
|
|
835
834
|
}),
|
|
836
835
|
/* @__PURE__ */ o(
|
|
837
|
-
|
|
836
|
+
Gt,
|
|
838
837
|
{
|
|
839
838
|
isActiveCard: t === e.length,
|
|
840
|
-
onCardClick:
|
|
839
|
+
onCardClick: l,
|
|
841
840
|
widthOverrides: n || void 0,
|
|
842
|
-
...
|
|
841
|
+
...h
|
|
843
842
|
}
|
|
844
843
|
)
|
|
845
844
|
] });
|
|
846
|
-
},
|
|
845
|
+
}, vt = ({
|
|
847
846
|
analyticsMetadata: t,
|
|
848
|
-
allowSingleCardPeeking: e
|
|
847
|
+
allowSingleCardPeeking: e,
|
|
849
848
|
beats: n = [],
|
|
849
|
+
elevation: i,
|
|
850
850
|
heightOverrides: r,
|
|
851
|
-
onCardClick:
|
|
852
|
-
posthog:
|
|
853
|
-
showCarouselControls:
|
|
854
|
-
showIcon:
|
|
855
|
-
showWithMargin:
|
|
856
|
-
variant:
|
|
851
|
+
onCardClick: l,
|
|
852
|
+
posthog: a,
|
|
853
|
+
showCarouselControls: u,
|
|
854
|
+
showIcon: C,
|
|
855
|
+
showWithMargin: E = !0,
|
|
856
|
+
variant: h,
|
|
857
857
|
widthOverrides: d,
|
|
858
858
|
visibleCardsCount: _ = 1
|
|
859
859
|
// Default to 1 card visible
|
|
860
860
|
}) => {
|
|
861
|
-
const p =
|
|
862
|
-
|
|
861
|
+
const p = I.useRef(null), g = I.useRef(null), [y, S] = I.useState(0), [w, T] = I.useState(null), [A, ee] = I.useState(null), [R, m] = I.useState(null), { carouselCopy: j } = D(), { onEvent: M } = $();
|
|
862
|
+
I.useEffect(() => {
|
|
863
863
|
if (p.current && !e) {
|
|
864
|
-
const
|
|
865
|
-
let
|
|
864
|
+
const f = p.current.offsetWidth, U = 8;
|
|
865
|
+
let V;
|
|
866
866
|
if (_ > 1) {
|
|
867
|
-
const _e = (
|
|
868
|
-
|
|
867
|
+
const _e = (f - (_ - 1) * U) / _ / 3;
|
|
868
|
+
V = (f - _e - (_ - 1) * U) / _;
|
|
869
869
|
} else
|
|
870
|
-
|
|
871
|
-
|
|
870
|
+
V = f;
|
|
871
|
+
m(V);
|
|
872
872
|
}
|
|
873
|
-
}, [_, p.current?.offsetWidth]),
|
|
874
|
-
const
|
|
875
|
-
if (typeof
|
|
876
|
-
const
|
|
873
|
+
}, [_, p.current?.offsetWidth]), I.useEffect(() => {
|
|
874
|
+
const f = g.current?.offsetWidth;
|
|
875
|
+
if (typeof f == "number" && e) {
|
|
876
|
+
const U = (z) => {
|
|
877
877
|
const pe = [
|
|
878
878
|
{ maxWidth: 375, cardWidth: 268 },
|
|
879
879
|
{ maxWidth: 444, cardWidth: 300 },
|
|
880
880
|
{ maxWidth: 599, cardWidth: 350 },
|
|
881
881
|
{ maxWidth: 749, cardWidth: 450 },
|
|
882
882
|
{ maxWidth: 900, cardWidth: 600 }
|
|
883
|
-
].find((
|
|
883
|
+
].find((ke) => z <= ke.maxWidth);
|
|
884
884
|
return pe ? pe.cardWidth : 750;
|
|
885
885
|
};
|
|
886
|
-
|
|
887
|
-
const
|
|
888
|
-
const
|
|
889
|
-
typeof
|
|
886
|
+
m(U(f));
|
|
887
|
+
const V = () => {
|
|
888
|
+
const z = g.current?.offsetWidth;
|
|
889
|
+
typeof z == "number" && m(U(z));
|
|
890
890
|
};
|
|
891
|
-
return window.addEventListener("resize",
|
|
892
|
-
window.removeEventListener("resize",
|
|
891
|
+
return window.addEventListener("resize", V), () => {
|
|
892
|
+
window.removeEventListener("resize", V);
|
|
893
893
|
};
|
|
894
894
|
}
|
|
895
|
-
}, [e,
|
|
896
|
-
const
|
|
897
|
-
|
|
898
|
-
left:
|
|
895
|
+
}, [e, g]);
|
|
896
|
+
const P = () => {
|
|
897
|
+
M(W.ON_CAROUSEL_FORWARD_CLICK, t), p.current && R && p.current.scrollTo({
|
|
898
|
+
left: y + R + 8,
|
|
899
899
|
top: 0,
|
|
900
900
|
behavior: "smooth"
|
|
901
901
|
});
|
|
902
|
-
},
|
|
903
|
-
|
|
904
|
-
left: Math.max(0,
|
|
902
|
+
}, te = () => {
|
|
903
|
+
M(W.ON_CAROUSEL_BACK_CLICK, t), p.current && R && p.current.scrollTo({
|
|
904
|
+
left: Math.max(0, y - (R + 8)),
|
|
905
905
|
top: 0,
|
|
906
906
|
behavior: "smooth"
|
|
907
907
|
});
|
|
908
|
-
},
|
|
908
|
+
}, Y = () => {
|
|
909
909
|
p.current && S(p.current.scrollLeft);
|
|
910
|
-
},
|
|
911
|
-
if (!
|
|
912
|
-
|
|
913
|
-
},
|
|
914
|
-
|
|
915
|
-
},
|
|
916
|
-
|
|
917
|
-
},
|
|
910
|
+
}, X = () => {
|
|
911
|
+
if (!A || !w) return;
|
|
912
|
+
A - w > Wt ? M(W.ON_CAROUSEL_FORWARD_SWIPE, t) : M(W.ON_CAROUSEL_BACK_SWIPE, t);
|
|
913
|
+
}, oe = (f) => {
|
|
914
|
+
T(f.targetTouches[0].clientX);
|
|
915
|
+
}, ne = (f) => {
|
|
916
|
+
T(null), ee(f.targetTouches[0].clientX);
|
|
917
|
+
}, Z = R ? Math.round(y / (R + 8)) : 0, Q = p.current ? p.current.scrollWidth - p.current.offsetWidth : 0;
|
|
918
918
|
return /* @__PURE__ */ N(
|
|
919
|
-
|
|
919
|
+
G,
|
|
920
920
|
{
|
|
921
|
-
"aria-label":
|
|
921
|
+
"aria-label": j?.carousel_title,
|
|
922
922
|
"aria-roledescription": "carousel",
|
|
923
|
-
ref:
|
|
923
|
+
ref: g,
|
|
924
924
|
role: "region",
|
|
925
925
|
sx: {
|
|
926
926
|
alignItems: "center",
|
|
@@ -930,13 +930,13 @@ const Y = h.createContext(null), lt = ({
|
|
|
930
930
|
},
|
|
931
931
|
children: [
|
|
932
932
|
/* @__PURE__ */ o(
|
|
933
|
-
|
|
933
|
+
G,
|
|
934
934
|
{
|
|
935
935
|
direction: "row",
|
|
936
|
-
onScroll:
|
|
937
|
-
onTouchEnd:
|
|
938
|
-
onTouchMove:
|
|
939
|
-
onTouchStart:
|
|
936
|
+
onScroll: Y,
|
|
937
|
+
onTouchEnd: X,
|
|
938
|
+
onTouchMove: oe,
|
|
939
|
+
onTouchStart: ne,
|
|
940
940
|
ref: p,
|
|
941
941
|
sx: {
|
|
942
942
|
alignItems: "center",
|
|
@@ -944,7 +944,7 @@ const Y = h.createContext(null), lt = ({
|
|
|
944
944
|
gap: 8,
|
|
945
945
|
listStyleType: "none",
|
|
946
946
|
m: 0,
|
|
947
|
-
maxWidth:
|
|
947
|
+
maxWidth: E ? "calc(100% - 32px)" : "100%",
|
|
948
948
|
overflowX: "auto",
|
|
949
949
|
overflowY: "hidden",
|
|
950
950
|
p: 0,
|
|
@@ -956,29 +956,30 @@ const Y = h.createContext(null), lt = ({
|
|
|
956
956
|
}
|
|
957
957
|
},
|
|
958
958
|
children: /* @__PURE__ */ o(
|
|
959
|
-
|
|
959
|
+
Mt,
|
|
960
960
|
{
|
|
961
|
-
activeCardIndex:
|
|
961
|
+
activeCardIndex: Z,
|
|
962
962
|
beats: n,
|
|
963
|
-
cardWidth:
|
|
963
|
+
cardWidth: R,
|
|
964
|
+
elevation: i,
|
|
964
965
|
heightOverrides: r,
|
|
965
|
-
onCardClick:
|
|
966
|
-
posthog:
|
|
967
|
-
showIcon:
|
|
968
|
-
variant:
|
|
966
|
+
onCardClick: l,
|
|
967
|
+
posthog: a,
|
|
968
|
+
showIcon: C,
|
|
969
|
+
variant: h
|
|
969
970
|
}
|
|
970
971
|
)
|
|
971
972
|
}
|
|
972
973
|
),
|
|
973
|
-
|
|
974
|
-
|
|
974
|
+
u && /* @__PURE__ */ o(
|
|
975
|
+
Nt,
|
|
975
976
|
{
|
|
976
|
-
currentBeatIndex:
|
|
977
|
+
currentBeatIndex: Z + _ - 1,
|
|
977
978
|
numBeats: n.length + 1,
|
|
978
|
-
onNextClick:
|
|
979
|
-
onPreviousClick:
|
|
980
|
-
scrollRightBoundary:
|
|
981
|
-
scrollX:
|
|
979
|
+
onNextClick: P,
|
|
980
|
+
onPreviousClick: te,
|
|
981
|
+
scrollRightBoundary: Q,
|
|
982
|
+
scrollX: y,
|
|
982
983
|
shouldApplyDotAnimation: e,
|
|
983
984
|
visibleCardsCount: _
|
|
984
985
|
}
|
|
@@ -986,18 +987,18 @@ const Y = h.createContext(null), lt = ({
|
|
|
986
987
|
]
|
|
987
988
|
}
|
|
988
989
|
);
|
|
989
|
-
},
|
|
990
|
+
}, Lt = k(vt), bt = ({
|
|
990
991
|
analyticsMetadata: t,
|
|
991
992
|
onCardClick: e,
|
|
992
993
|
posthog: n,
|
|
993
|
-
widthOverrides:
|
|
994
|
-
headerSx:
|
|
994
|
+
widthOverrides: i,
|
|
995
|
+
headerSx: r
|
|
995
996
|
}) => {
|
|
996
|
-
const { carouselCopy: l } =
|
|
997
|
-
a && (a(
|
|
997
|
+
const { carouselCopy: l } = D(), { onEvent: a } = $(), u = () => {
|
|
998
|
+
a && (a(W.ON_VIEW_MORE_CLICKED, t), e(), n?.capture("clicked_view_more"));
|
|
998
999
|
};
|
|
999
1000
|
return l ? /* @__PURE__ */ N(
|
|
1000
|
-
|
|
1001
|
+
G,
|
|
1001
1002
|
{
|
|
1002
1003
|
alignItems: "center",
|
|
1003
1004
|
direction: "row",
|
|
@@ -1006,15 +1007,15 @@ const Y = h.createContext(null), lt = ({
|
|
|
1006
1007
|
sx: {
|
|
1007
1008
|
p: 16,
|
|
1008
1009
|
pb: 8,
|
|
1009
|
-
width:
|
|
1010
|
-
...
|
|
1010
|
+
width: i || void 0,
|
|
1011
|
+
...r
|
|
1011
1012
|
},
|
|
1012
1013
|
children: [
|
|
1013
|
-
/* @__PURE__ */ o(
|
|
1014
|
+
/* @__PURE__ */ o(He, { children: l.carousel_title }),
|
|
1014
1015
|
/* @__PURE__ */ o(
|
|
1015
|
-
|
|
1016
|
+
Ue,
|
|
1016
1017
|
{
|
|
1017
|
-
endIcon: /* @__PURE__ */ o(
|
|
1018
|
+
endIcon: /* @__PURE__ */ o(Oe, { size: 20 }),
|
|
1018
1019
|
onClick: u,
|
|
1019
1020
|
size: "small",
|
|
1020
1021
|
variant: "text",
|
|
@@ -1023,17 +1024,17 @@ const Y = h.createContext(null), lt = ({
|
|
|
1023
1024
|
)
|
|
1024
1025
|
]
|
|
1025
1026
|
}
|
|
1026
|
-
) : /* @__PURE__ */ o(
|
|
1027
|
-
},
|
|
1027
|
+
) : /* @__PURE__ */ o(Xe, {});
|
|
1028
|
+
}, Dt = k(bt), xt = ({
|
|
1028
1029
|
heightOverrides: t,
|
|
1029
1030
|
widthOverrides: e,
|
|
1030
1031
|
children: n
|
|
1031
1032
|
}) => {
|
|
1032
|
-
const { carouselCopy:
|
|
1033
|
+
const { carouselCopy: i } = D();
|
|
1033
1034
|
return /* @__PURE__ */ o(
|
|
1034
|
-
|
|
1035
|
+
ae,
|
|
1035
1036
|
{
|
|
1036
|
-
"aria-label":
|
|
1037
|
+
"aria-label": i?.carousel_title,
|
|
1037
1038
|
"aria-roledescription": "carousel",
|
|
1038
1039
|
role: "group",
|
|
1039
1040
|
sx: {
|
|
@@ -1045,20 +1046,21 @@ const Y = h.createContext(null), lt = ({
|
|
|
1045
1046
|
children: n
|
|
1046
1047
|
}
|
|
1047
1048
|
);
|
|
1048
|
-
},
|
|
1049
|
+
}, Ve = ({
|
|
1049
1050
|
ariaLabel: t,
|
|
1050
|
-
|
|
1051
|
-
|
|
1051
|
+
elevation: e,
|
|
1052
|
+
heightOverrides: n,
|
|
1053
|
+
onCardClick: i,
|
|
1052
1054
|
posthog: r,
|
|
1053
|
-
showIcon:
|
|
1054
|
-
variant:
|
|
1055
|
+
showIcon: l,
|
|
1056
|
+
variant: a
|
|
1055
1057
|
}) => {
|
|
1056
|
-
const { cardsCopy:
|
|
1057
|
-
|
|
1058
|
-
|
|
1058
|
+
const { cardsCopy: u } = D(), C = F(), { onEvent: E } = $(), { onPageview: h } = Be();
|
|
1059
|
+
I.useEffect(() => {
|
|
1060
|
+
h(B.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
|
|
1059
1061
|
}, []);
|
|
1060
1062
|
const d = () => {
|
|
1061
|
-
|
|
1063
|
+
i && i(), E(W.ON_NO_RELEVANT_INSIGHTS_CLICKED), r?.capture("clicked_insight", {
|
|
1062
1064
|
template: "no_relevant_insights"
|
|
1063
1065
|
});
|
|
1064
1066
|
};
|
|
@@ -1066,48 +1068,43 @@ const Y = h.createContext(null), lt = ({
|
|
|
1066
1068
|
J,
|
|
1067
1069
|
{
|
|
1068
1070
|
ariaLabel: t,
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
hasCardEffect: !0,
|
|
1074
|
-
heightOverrides: e,
|
|
1075
|
-
icon: i && /* @__PURE__ */ o(c, { bgColor: s(u.palette.primary.main, 0.15), name: "lightbulb" }),
|
|
1071
|
+
description: u.no_relevant_insights_card_description,
|
|
1072
|
+
elevation: e,
|
|
1073
|
+
heightOverrides: n,
|
|
1074
|
+
icon: l && /* @__PURE__ */ o(c, { bgColor: s(C.palette.primary.main, 0.15), name: "lightbulb" }),
|
|
1076
1075
|
onCardClick: d,
|
|
1077
1076
|
onPrimaryAction: d,
|
|
1078
|
-
primaryActionText:
|
|
1079
|
-
title:
|
|
1080
|
-
variant:
|
|
1077
|
+
primaryActionText: u.micro_card_cta,
|
|
1078
|
+
title: u.no_relevant_insights_card_title,
|
|
1079
|
+
variant: a
|
|
1081
1080
|
}
|
|
1082
1081
|
);
|
|
1083
|
-
},
|
|
1082
|
+
}, co = k(Ve), Ge = ({
|
|
1084
1083
|
ariaLabel: t,
|
|
1085
|
-
|
|
1086
|
-
|
|
1084
|
+
elevation: e,
|
|
1085
|
+
heightOverrides: n,
|
|
1086
|
+
onCardClick: i,
|
|
1087
1087
|
showIcon: r,
|
|
1088
|
-
variant:
|
|
1088
|
+
variant: l
|
|
1089
1089
|
}) => {
|
|
1090
|
-
const { onPageview:
|
|
1091
|
-
return
|
|
1092
|
-
|
|
1090
|
+
const { onPageview: a } = Be(), { zeroStateCopy: u } = D(), C = F();
|
|
1091
|
+
return I.useEffect(() => {
|
|
1092
|
+
a(B.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
|
|
1093
1093
|
}, []), /* @__PURE__ */ o(
|
|
1094
1094
|
J,
|
|
1095
1095
|
{
|
|
1096
1096
|
ariaLabel: t,
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
onCardClick: n,
|
|
1105
|
-
title: a.carousel_zero_state_title,
|
|
1106
|
-
variant: i
|
|
1097
|
+
description: u.carousel_zero_state_description,
|
|
1098
|
+
elevation: e,
|
|
1099
|
+
heightOverrides: n,
|
|
1100
|
+
icon: r && /* @__PURE__ */ o(c, { bgColor: s(C.palette.primary.main, 0.15), name: "lightbulb" }),
|
|
1101
|
+
onCardClick: i,
|
|
1102
|
+
title: u.carousel_zero_state_title,
|
|
1103
|
+
variant: l
|
|
1107
1104
|
}
|
|
1108
1105
|
);
|
|
1109
|
-
},
|
|
1110
|
-
|
|
1106
|
+
}, lo = k(Ge), Bt = () => /* @__PURE__ */ o(
|
|
1107
|
+
ae,
|
|
1111
1108
|
{
|
|
1112
1109
|
sx: {
|
|
1113
1110
|
alignItems: "center",
|
|
@@ -1116,130 +1113,137 @@ const Y = h.createContext(null), lt = ({
|
|
|
1116
1113
|
justifyContent: "center",
|
|
1117
1114
|
width: "100%"
|
|
1118
1115
|
},
|
|
1119
|
-
children: /* @__PURE__ */ o(
|
|
1116
|
+
children: /* @__PURE__ */ o(qe, {})
|
|
1120
1117
|
}
|
|
1121
|
-
),
|
|
1118
|
+
), Te = {
|
|
1122
1119
|
featureVersion: "spendVsIncomeTrends"
|
|
1123
|
-
},
|
|
1120
|
+
}, x = new mt(), Pt = ({
|
|
1124
1121
|
allowSingleCardPeeking: t = !0,
|
|
1125
1122
|
areBeatsLoading: e = !1,
|
|
1126
1123
|
beats: n = [],
|
|
1127
1124
|
// This also determines the length of the carousel controls (beat.length + 1)
|
|
1125
|
+
cardStyle: i = "elevation 1",
|
|
1128
1126
|
endpoint: r = "/",
|
|
1129
|
-
heightOverrides: i,
|
|
1130
1127
|
headerSx: l,
|
|
1131
|
-
|
|
1128
|
+
heightOverrides: a,
|
|
1129
|
+
logOutUser: u = () => {
|
|
1132
1130
|
},
|
|
1133
|
-
onCardClick:
|
|
1131
|
+
onCardClick: C = () => {
|
|
1134
1132
|
},
|
|
1135
|
-
onEvent:
|
|
1133
|
+
onEvent: E = () => {
|
|
1136
1134
|
},
|
|
1137
|
-
onPageview:
|
|
1135
|
+
onPageview: h = () => {
|
|
1138
1136
|
},
|
|
1139
1137
|
posthog: d,
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
visibleCardsCount: z = 1,
|
|
1149
|
-
widthOverrides: E
|
|
1138
|
+
showCarouselControls: _,
|
|
1139
|
+
showHeader: p,
|
|
1140
|
+
showIcon: g,
|
|
1141
|
+
showWithMargin: y = !0,
|
|
1142
|
+
token: S = "",
|
|
1143
|
+
userHasFullInsightFeedBeats: w,
|
|
1144
|
+
visibleCardsCount: T = 1,
|
|
1145
|
+
widthOverrides: A
|
|
1150
1146
|
}) => {
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1147
|
+
const R = (() => {
|
|
1148
|
+
if (i === "border") return "outlined";
|
|
1149
|
+
if (i === "elevation 1") return "elevation";
|
|
1150
|
+
if (i !== "flat")
|
|
1151
|
+
return "elevation";
|
|
1152
|
+
})(), m = i === "flat" ? 0 : 1, [j, M] = ie("STANDARD"), [P, te] = ie(!1), [Y, X] = ie(!1), oe = et([E], x), ne = tt([h], x);
|
|
1153
|
+
ot({
|
|
1153
1154
|
widgetName: "InsightsMicroWidget",
|
|
1154
|
-
isLoaded:
|
|
1155
|
-
}),
|
|
1156
|
-
!
|
|
1157
|
-
}, [r,
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
}, [window.innerHeight]),
|
|
1161
|
-
|
|
1162
|
-
}, [e,
|
|
1163
|
-
const
|
|
1164
|
-
heightOverrides:
|
|
1165
|
-
onCardClick:
|
|
1155
|
+
isLoaded: P
|
|
1156
|
+
}), I.useEffect(() => {
|
|
1157
|
+
!x.isInitialized && !Y && (x.initialize(r, S, u).catch(() => X(!1)), X(!0));
|
|
1158
|
+
}, [r, S, u, x.isInitialized, Y]), I.useEffect(() => {
|
|
1159
|
+
const f = window.innerHeight;
|
|
1160
|
+
f < 180 ? M("STANDARD") : f >= 180 && f < 200 ? M("LARGE") : f >= 200 && f < 248 ? M("XLARGE") : f >= 248 && M("XXLARGE");
|
|
1161
|
+
}, [window.innerHeight]), I.useEffect(() => {
|
|
1162
|
+
te(!e && x.isInitialized);
|
|
1163
|
+
}, [e, x.isInitialized]);
|
|
1164
|
+
const Z = {
|
|
1165
|
+
heightOverrides: a,
|
|
1166
|
+
onCardClick: C,
|
|
1166
1167
|
posthog: d,
|
|
1167
|
-
showIcon:
|
|
1168
|
-
showWithMargin:
|
|
1169
|
-
widthOverrides:
|
|
1170
|
-
},
|
|
1171
|
-
carouselSize:
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1168
|
+
showIcon: g,
|
|
1169
|
+
showWithMargin: y,
|
|
1170
|
+
widthOverrides: A
|
|
1171
|
+
}, Q = {
|
|
1172
|
+
carouselSize: j,
|
|
1173
|
+
elevation: m,
|
|
1174
|
+
variant: R,
|
|
1175
|
+
heightOverrides: a,
|
|
1176
|
+
onCardClick: C,
|
|
1175
1177
|
posthog: d,
|
|
1176
|
-
showIcon:
|
|
1178
|
+
showIcon: g
|
|
1177
1179
|
};
|
|
1178
|
-
return /* @__PURE__ */ o(
|
|
1179
|
-
!
|
|
1180
|
-
|
|
1181
|
-
|
|
1180
|
+
return /* @__PURE__ */ o(ut, { onEvent: oe, onPageview: ne, store: x, children: /* @__PURE__ */ N(xt, { heightOverrides: a, widthOverrides: A, children: [
|
|
1181
|
+
!P && /* @__PURE__ */ o(Bt, {}),
|
|
1182
|
+
P && p && /* @__PURE__ */ o(
|
|
1183
|
+
Dt,
|
|
1182
1184
|
{
|
|
1183
|
-
analyticsMetadata:
|
|
1185
|
+
analyticsMetadata: Te,
|
|
1184
1186
|
headerSx: l,
|
|
1185
|
-
onCardClick:
|
|
1187
|
+
onCardClick: C,
|
|
1186
1188
|
posthog: d,
|
|
1187
|
-
widthOverrides:
|
|
1189
|
+
widthOverrides: A
|
|
1188
1190
|
}
|
|
1189
1191
|
),
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
+
P && !!n.length && /* @__PURE__ */ o(
|
|
1193
|
+
Lt,
|
|
1192
1194
|
{
|
|
1193
1195
|
allowSingleCardPeeking: t,
|
|
1194
|
-
analyticsMetadata:
|
|
1196
|
+
analyticsMetadata: Te,
|
|
1195
1197
|
beats: n,
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1198
|
+
elevation: m,
|
|
1199
|
+
showCarouselControls: _,
|
|
1200
|
+
variant: R,
|
|
1201
|
+
visibleCardsCount: T,
|
|
1202
|
+
...Z
|
|
1200
1203
|
}
|
|
1201
1204
|
),
|
|
1202
|
-
|
|
1203
|
-
|
|
1205
|
+
P && !n.length && /* @__PURE__ */ o(
|
|
1206
|
+
G,
|
|
1204
1207
|
{
|
|
1205
1208
|
sx: {
|
|
1206
1209
|
alignItems: "center",
|
|
1207
|
-
height:
|
|
1208
|
-
width:
|
|
1210
|
+
height: a,
|
|
1211
|
+
width: A || "100%"
|
|
1209
1212
|
},
|
|
1210
1213
|
children: /* @__PURE__ */ o(
|
|
1211
|
-
|
|
1214
|
+
G,
|
|
1212
1215
|
{
|
|
1213
1216
|
sx: {
|
|
1214
|
-
height: `calc(${
|
|
1215
|
-
width:
|
|
1217
|
+
height: `calc(${Ot[j]}px - 44px)`,
|
|
1218
|
+
width: y ? `calc(${A}px - 32px)` : "100%"
|
|
1216
1219
|
},
|
|
1217
|
-
children:
|
|
1220
|
+
children: w ? /* @__PURE__ */ o(Ve, { ...Q }) : /* @__PURE__ */ o(Ge, { ...Q })
|
|
1218
1221
|
}
|
|
1219
1222
|
)
|
|
1220
1223
|
}
|
|
1221
1224
|
)
|
|
1222
1225
|
] }) });
|
|
1223
|
-
},
|
|
1226
|
+
}, _o = k(Pt), Vt = ({
|
|
1224
1227
|
ariaLabel: t,
|
|
1225
|
-
|
|
1226
|
-
|
|
1228
|
+
elevation: e,
|
|
1229
|
+
heightOverrides: n,
|
|
1230
|
+
isActiveCard: i,
|
|
1227
1231
|
onCardClick: r,
|
|
1228
|
-
posthog:
|
|
1229
|
-
widthOverrides:
|
|
1230
|
-
showIcon:
|
|
1231
|
-
variant:
|
|
1232
|
+
posthog: l,
|
|
1233
|
+
widthOverrides: a,
|
|
1234
|
+
showIcon: u,
|
|
1235
|
+
variant: C
|
|
1232
1236
|
}) => {
|
|
1233
|
-
const
|
|
1234
|
-
threshold:
|
|
1235
|
-
}), { cardsCopy: _ } =
|
|
1237
|
+
const E = F(), { ref: h, inView: d } = We({
|
|
1238
|
+
threshold: Pe
|
|
1239
|
+
}), { cardsCopy: _ } = D(), { onEvent: p } = $();
|
|
1236
1240
|
re(() => {
|
|
1237
|
-
d && (p(
|
|
1241
|
+
d && (p(Le.ON_VIEW_MORE_VIEWED), l?.capture("viewed_insight", {
|
|
1238
1242
|
template: "view_more_card"
|
|
1239
1243
|
}));
|
|
1240
1244
|
}, [d]);
|
|
1241
|
-
const
|
|
1242
|
-
r && r(), p(
|
|
1245
|
+
const g = () => {
|
|
1246
|
+
r && r(), p(W.ON_VIEW_MORE_CLICKED), l?.capture("clicked_insight", {
|
|
1243
1247
|
template: "view_more_card"
|
|
1244
1248
|
});
|
|
1245
1249
|
};
|
|
@@ -1248,36 +1252,33 @@ const Y = h.createContext(null), lt = ({
|
|
|
1248
1252
|
{
|
|
1249
1253
|
"aria-roledescription": "slide",
|
|
1250
1254
|
ariaLabel: t,
|
|
1251
|
-
cardSx: {
|
|
1252
|
-
borderRadius: 2
|
|
1253
|
-
},
|
|
1254
1255
|
description: _?.view_more_card_description,
|
|
1255
|
-
|
|
1256
|
-
heightOverrides:
|
|
1257
|
-
icon:
|
|
1258
|
-
isActiveCard:
|
|
1259
|
-
onCardClick:
|
|
1260
|
-
onPrimaryAction:
|
|
1256
|
+
elevation: e,
|
|
1257
|
+
heightOverrides: n,
|
|
1258
|
+
icon: u && /* @__PURE__ */ o(c, { bgColor: s(E.palette.primary.main, 0.15), name: "show_chart" }),
|
|
1259
|
+
isActiveCard: i,
|
|
1260
|
+
onCardClick: g,
|
|
1261
|
+
onPrimaryAction: g,
|
|
1261
1262
|
primaryActionText: _?.micro_card_cta,
|
|
1262
|
-
ref:
|
|
1263
|
+
ref: h,
|
|
1263
1264
|
title: _?.view_more_card_title,
|
|
1264
|
-
variant:
|
|
1265
|
-
widthOverrides:
|
|
1265
|
+
variant: C,
|
|
1266
|
+
widthOverrides: a
|
|
1266
1267
|
}
|
|
1267
1268
|
);
|
|
1268
|
-
},
|
|
1269
|
+
}, Gt = k(Vt);
|
|
1269
1270
|
export {
|
|
1270
|
-
|
|
1271
|
+
mt as A,
|
|
1271
1272
|
c as B,
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1273
|
+
Dt as C,
|
|
1274
|
+
wt as I,
|
|
1275
|
+
Lt as M,
|
|
1276
|
+
co as N,
|
|
1277
|
+
Te as T,
|
|
1278
|
+
Gt as V,
|
|
1279
|
+
lo as Z,
|
|
1280
|
+
_o as a,
|
|
1281
|
+
ut as b,
|
|
1281
1282
|
J as c,
|
|
1282
|
-
|
|
1283
|
+
Et as d
|
|
1283
1284
|
};
|