@mx-cartographer/experiences 7.6.18 → 7.6.19-alpha.mega1
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/dist/{ViewMoreMicroCard-rY-kN9MP.mjs → ViewMoreMicroCard-FlFj-I3z.mjs} +663 -752
- package/dist/microinsights/MicroCardTemplate.d.ts +9 -2
- package/dist/microinsights/beaticons/BeatMaterialIcon.d.ts +1 -1
- package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +3 -2
- package/dist/microinsights/cards/InsightCard.d.ts +0 -2
- package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +2 -5
- package/dist/microinsights/index.es.js +184 -90
- package/dist/trends/index.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import u, { useEffect as
|
|
3
|
-
import { observer as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { L as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useTheme as
|
|
12
|
-
import { useInView as
|
|
13
|
-
import {
|
|
14
|
-
import { b as
|
|
15
|
-
import
|
|
16
|
-
import { b as
|
|
17
|
-
import
|
|
18
|
-
import { makeAutoObservable as
|
|
19
|
-
import { G as
|
|
20
|
-
import { B as
|
|
21
|
-
import { u as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
const de = {
|
|
1
|
+
import { jsx as e, jsxs as _, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
+
import u, { useEffect as ie, useState as te } from "react";
|
|
3
|
+
import { observer as Z } from "mobx-react-lite";
|
|
4
|
+
import S from "@mui/material/Stack";
|
|
5
|
+
import oe from "@mui/material/Button";
|
|
6
|
+
import He from "@mui/material/Typography";
|
|
7
|
+
import { Icon as ke, Close as Fe, Error as Be, ChevronLeft as be, ChevronRight as Ie } from "@mxenabled/mx-icons";
|
|
8
|
+
import { L as Pe } from "./Loader-DUaFpDGv.mjs";
|
|
9
|
+
import X from "@mui/material/Box";
|
|
10
|
+
import re from "@mui/material/IconButton";
|
|
11
|
+
import { alpha as W, useTheme as le } from "@mui/material/styles";
|
|
12
|
+
import { useInView as ve } from "react-intersection-observer";
|
|
13
|
+
import { CategoryIcon as Ze, MerchantLogo as Ge, P as he, Text as Ee } from "@mxenabled/mxui";
|
|
14
|
+
import { b as Ue } from "./Category-CevNQ03n.mjs";
|
|
15
|
+
import ze from "@mui/material/styles/useTheme";
|
|
16
|
+
import { b as Ke } from "./Localization-2MODESHW.mjs";
|
|
17
|
+
import $e from "@mui/material/CircularProgress";
|
|
18
|
+
import { makeAutoObservable as ne, runInAction as ye } from "mobx";
|
|
19
|
+
import { G as ue, a as je, u as Ye, b as Xe } from "./useCombineEvents-CRwX-qWE.mjs";
|
|
20
|
+
import { B as pe } from "./BeatApi-De2IaqH2.mjs";
|
|
21
|
+
import { u as Qe } from "./useWidgetLoadTimer-hIOioiKx.mjs";
|
|
22
|
+
import qe from "@mui/material/Card";
|
|
23
|
+
import { CardActionArea as Je } from "@mui/material";
|
|
24
|
+
import et from "@mui/material/Avatar";
|
|
25
|
+
const _e = {
|
|
27
26
|
featureVersion: "spendVsIncomeTrends"
|
|
28
27
|
};
|
|
29
|
-
class
|
|
30
|
-
copyApi = new
|
|
28
|
+
class tt {
|
|
29
|
+
copyApi = new ue("/", "");
|
|
31
30
|
copyObject = {};
|
|
32
31
|
namespace = "experiences";
|
|
33
32
|
translationKey = "micro_insights";
|
|
34
33
|
constructor() {
|
|
35
|
-
|
|
34
|
+
ne(this);
|
|
36
35
|
}
|
|
37
36
|
// NOTE: Not sure if this is special case, but other stores have this deprecation todo
|
|
38
37
|
// DEPRECATED: Initialize api in constructor and use loadCopy instead
|
|
39
38
|
// TODO: Remove this function
|
|
40
|
-
initialize = async (
|
|
41
|
-
this.copyApi = new
|
|
39
|
+
initialize = async (t, o) => {
|
|
40
|
+
this.copyApi = new ue(t, o), await this.loadCopy();
|
|
42
41
|
};
|
|
43
42
|
loadCopy = async () => {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
this.copyObject =
|
|
43
|
+
const t = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
|
|
44
|
+
ye(() => {
|
|
45
|
+
this.copyObject = t[this.translationKey];
|
|
47
46
|
});
|
|
48
47
|
};
|
|
49
48
|
get cardsCopy() {
|
|
@@ -56,7 +55,7 @@ class Je {
|
|
|
56
55
|
return this.copyObject.zero_state;
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
const
|
|
58
|
+
const ae = {
|
|
60
59
|
BillAmountNotStandard: "BillAmountNotStandard",
|
|
61
60
|
CanadianUpcomingDeadlineAlert: "CanadianUpcomingDeadlineAlert",
|
|
62
61
|
DuplicatePaymentV2: "DuplicatePaymentV2",
|
|
@@ -73,59 +72,59 @@ const oe = {
|
|
|
73
72
|
WeeklyNewMerchantsV2: "WeeklyNewMerchantsV2",
|
|
74
73
|
MonthlySpendComparison: "MonthlySpendComparison",
|
|
75
74
|
MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
|
|
76
|
-
},
|
|
75
|
+
}, I = window?.app?.clientConfig?.microwidget_instance_id || "", Ce = {
|
|
77
76
|
INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
|
|
78
|
-
},
|
|
79
|
-
(i,
|
|
77
|
+
}, Ae = (i) => `on${i}Click`, Me = (i) => `on${i}View`, Se = (i) => `on${i}ViewFirstTime`, ce = (i) => i.replace(/([a-z])([A-Z])/g, "$1 $2"), it = () => Object.values(ae).reduce(
|
|
78
|
+
(i, t) => ({
|
|
80
79
|
...i,
|
|
81
|
-
[
|
|
82
|
-
action:
|
|
83
|
-
category:
|
|
84
|
-
label:
|
|
85
|
-
value:
|
|
80
|
+
[Ae(t)]: {
|
|
81
|
+
action: N.MICRO_BEAT_CLICKED,
|
|
82
|
+
category: L.BEAT_INTERACTION,
|
|
83
|
+
label: ce(t),
|
|
84
|
+
value: I
|
|
86
85
|
}
|
|
87
86
|
}),
|
|
88
87
|
{}
|
|
89
|
-
),
|
|
90
|
-
(i,
|
|
88
|
+
), ot = () => Object.values(ae).reduce(
|
|
89
|
+
(i, t) => ({
|
|
91
90
|
...i,
|
|
92
|
-
[
|
|
93
|
-
action:
|
|
94
|
-
category:
|
|
95
|
-
label:
|
|
96
|
-
value:
|
|
91
|
+
[Me(t)]: {
|
|
92
|
+
action: N.MICRO_BEAT_DISPLAYED,
|
|
93
|
+
category: L.BEAT_INTERACTION,
|
|
94
|
+
label: ce(t),
|
|
95
|
+
value: I
|
|
97
96
|
}
|
|
98
97
|
}),
|
|
99
98
|
{}
|
|
100
|
-
),
|
|
101
|
-
(i,
|
|
99
|
+
), rt = () => Object.values(ae).reduce(
|
|
100
|
+
(i, t) => ({
|
|
102
101
|
...i,
|
|
103
|
-
[
|
|
104
|
-
action:
|
|
105
|
-
category:
|
|
106
|
-
label:
|
|
107
|
-
value:
|
|
102
|
+
[Se(t)]: {
|
|
103
|
+
action: N.MICRO_BEAT_DISPLAYED_FIRST_TIME,
|
|
104
|
+
category: L.BEAT_INTERACTION,
|
|
105
|
+
label: ce(t),
|
|
106
|
+
value: I
|
|
108
107
|
}
|
|
109
108
|
}),
|
|
110
109
|
{}
|
|
111
|
-
),
|
|
110
|
+
), V = {
|
|
112
111
|
CARD: "Card",
|
|
113
112
|
CAROUSEL_CONTROL: "Carousel Control",
|
|
114
113
|
MICRO_WIDGET: "Micro Widget",
|
|
115
114
|
VIEW_MORE: "View More"
|
|
116
|
-
},
|
|
115
|
+
}, L = {
|
|
117
116
|
MICRO_WIDGET_INTERACTION: "Micro Widget Interaction",
|
|
118
117
|
BEAT_INTERACTION: "Beat Interaction"
|
|
119
|
-
},
|
|
118
|
+
}, v = {
|
|
120
119
|
ON_CAROUSEL_BACK_CLICK: "onCarouselBackClick",
|
|
121
120
|
ON_CAROUSEL_BACK_SWIPE: "onCarouselBackSwipe",
|
|
122
121
|
ON_CAROUSEL_FORWARD_CLICK: "onCarouselForwardClick",
|
|
123
122
|
ON_CAROUSEL_FORWARD_SWIPE: "onCarouselForwardSwipe",
|
|
124
123
|
ON_NO_RELEVANT_INSIGHTS_CLICKED: "onNoRelevantInsightsClicked",
|
|
125
124
|
ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
|
|
126
|
-
},
|
|
125
|
+
}, Oe = {
|
|
127
126
|
ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
|
|
128
|
-
},
|
|
127
|
+
}, N = {
|
|
129
128
|
CONTROL_BACKWARD: "Control Backward",
|
|
130
129
|
CONTROL_FORWARD: "Control Forward",
|
|
131
130
|
MICRO_BEAT_CLICKED: "Micro Beat Clicked",
|
|
@@ -133,104 +132,104 @@ const oe = {
|
|
|
133
132
|
MICRO_BEAT_DISPLAYED_FIRST_TIME: "Micro Beat Displayed For First Time",
|
|
134
133
|
SWIPE_BACKWARD: "Swipe Backward",
|
|
135
134
|
SWIPE_FORWARD: "Swipe Forward"
|
|
136
|
-
},
|
|
135
|
+
}, F = {
|
|
137
136
|
MICRO_WIDGET_CAROUSEL: "Micro Widget Carousel",
|
|
138
137
|
MICRO_WIDGET_CAROUSEL_ZERO_STATE: "Micro Widget Carousel Zero State",
|
|
139
138
|
MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS: "Micro Widget Carousel No Relevant Insights"
|
|
140
|
-
},
|
|
141
|
-
[
|
|
142
|
-
label:
|
|
143
|
-
name:
|
|
144
|
-
path:
|
|
145
|
-
value:
|
|
139
|
+
}, fe = {
|
|
140
|
+
[F.MICRO_WIDGET_CAROUSEL]: {
|
|
141
|
+
label: V.MICRO_WIDGET,
|
|
142
|
+
name: F.MICRO_WIDGET_CAROUSEL,
|
|
143
|
+
path: Ce.INSIGHTS_MICRO_WIDGET,
|
|
144
|
+
value: I
|
|
146
145
|
},
|
|
147
146
|
// zero state
|
|
148
|
-
[
|
|
149
|
-
label:
|
|
150
|
-
name:
|
|
151
|
-
path:
|
|
152
|
-
value:
|
|
147
|
+
[F.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
|
|
148
|
+
label: V.MICRO_WIDGET,
|
|
149
|
+
name: F.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
|
|
150
|
+
path: Ce.INSIGHTS_MICRO_WIDGET,
|
|
151
|
+
value: I
|
|
153
152
|
},
|
|
154
153
|
// no relevant cards
|
|
155
|
-
[
|
|
156
|
-
label:
|
|
157
|
-
name:
|
|
154
|
+
[F.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS]: {
|
|
155
|
+
label: V.MICRO_WIDGET,
|
|
156
|
+
name: F.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS,
|
|
158
157
|
path: "/micro-widget",
|
|
159
|
-
value:
|
|
158
|
+
value: I
|
|
160
159
|
}
|
|
161
|
-
},
|
|
160
|
+
}, me = {
|
|
162
161
|
// carousel control interaction events - clicks and swipes
|
|
163
|
-
[
|
|
164
|
-
action:
|
|
165
|
-
category:
|
|
166
|
-
label:
|
|
167
|
-
value:
|
|
162
|
+
[v.ON_CAROUSEL_BACK_CLICK]: {
|
|
163
|
+
action: N.CONTROL_BACKWARD,
|
|
164
|
+
category: L.MICRO_WIDGET_INTERACTION,
|
|
165
|
+
label: V.CAROUSEL_CONTROL,
|
|
166
|
+
value: I
|
|
168
167
|
},
|
|
169
|
-
[
|
|
170
|
-
action:
|
|
171
|
-
category:
|
|
172
|
-
label:
|
|
173
|
-
value:
|
|
168
|
+
[v.ON_CAROUSEL_FORWARD_CLICK]: {
|
|
169
|
+
action: N.CONTROL_FORWARD,
|
|
170
|
+
category: L.MICRO_WIDGET_INTERACTION,
|
|
171
|
+
label: V.CAROUSEL_CONTROL,
|
|
172
|
+
value: I
|
|
174
173
|
},
|
|
175
|
-
[
|
|
176
|
-
action:
|
|
177
|
-
category:
|
|
178
|
-
label:
|
|
179
|
-
value:
|
|
174
|
+
[v.ON_CAROUSEL_BACK_SWIPE]: {
|
|
175
|
+
action: N.SWIPE_BACKWARD,
|
|
176
|
+
category: L.MICRO_WIDGET_INTERACTION,
|
|
177
|
+
label: V.CAROUSEL_CONTROL,
|
|
178
|
+
value: I
|
|
180
179
|
},
|
|
181
|
-
[
|
|
182
|
-
action:
|
|
183
|
-
category:
|
|
184
|
-
label:
|
|
185
|
-
value:
|
|
180
|
+
[v.ON_CAROUSEL_FORWARD_SWIPE]: {
|
|
181
|
+
action: N.SWIPE_FORWARD,
|
|
182
|
+
category: L.MICRO_WIDGET_INTERACTION,
|
|
183
|
+
label: V.CAROUSEL_CONTROL,
|
|
184
|
+
value: I
|
|
186
185
|
},
|
|
187
186
|
// read more card events
|
|
188
|
-
[
|
|
189
|
-
action:
|
|
190
|
-
category:
|
|
191
|
-
label:
|
|
192
|
-
value:
|
|
187
|
+
[v.ON_VIEW_MORE_CLICKED]: {
|
|
188
|
+
action: N.MICRO_BEAT_CLICKED,
|
|
189
|
+
category: L.BEAT_INTERACTION,
|
|
190
|
+
label: V.VIEW_MORE,
|
|
191
|
+
value: I
|
|
193
192
|
},
|
|
194
|
-
[
|
|
195
|
-
action:
|
|
196
|
-
category:
|
|
197
|
-
label:
|
|
198
|
-
value:
|
|
193
|
+
[Oe.ON_VIEW_MORE_VIEWED]: {
|
|
194
|
+
action: N.MICRO_BEAT_DISPLAYED,
|
|
195
|
+
category: L.BEAT_INTERACTION,
|
|
196
|
+
label: V.VIEW_MORE,
|
|
197
|
+
value: I
|
|
199
198
|
},
|
|
200
|
-
...
|
|
201
|
-
...
|
|
202
|
-
...
|
|
203
|
-
},
|
|
204
|
-
throw
|
|
205
|
-
}),
|
|
206
|
-
throw
|
|
199
|
+
...it(),
|
|
200
|
+
...ot(),
|
|
201
|
+
...rt()
|
|
202
|
+
}, Re = async (i, t) => !t || !me[i] ? null : t.sendAnalyticEvent(me[i]).then((o) => o).catch((o) => {
|
|
203
|
+
throw o;
|
|
204
|
+
}), ge = async (i, t) => !t || !fe[i] ? null : t.sendAnalyticsPageview(fe[i]).then((o) => o).catch((o) => {
|
|
205
|
+
throw o;
|
|
207
206
|
});
|
|
208
|
-
class
|
|
209
|
-
onAnalyticEvent =
|
|
210
|
-
onAnalyticPageView =
|
|
211
|
-
beatApi = new
|
|
207
|
+
class lt {
|
|
208
|
+
onAnalyticEvent = Re;
|
|
209
|
+
onAnalyticPageView = ge;
|
|
210
|
+
beatApi = new pe("/", "");
|
|
212
211
|
constructor() {
|
|
213
|
-
|
|
212
|
+
ne(this);
|
|
214
213
|
}
|
|
215
|
-
initialize = async (
|
|
216
|
-
this.onAnalyticEvent = (
|
|
217
|
-
|
|
218
|
-
throw a.status === 401 &&
|
|
214
|
+
initialize = async (t, o, r) => {
|
|
215
|
+
this.onAnalyticEvent = (l, n) => {
|
|
216
|
+
Re(l, n).then((a) => a).catch((a) => {
|
|
217
|
+
throw a.status === 401 && r(), a;
|
|
219
218
|
});
|
|
220
|
-
}, this.onAnalyticPageView = (
|
|
221
|
-
|
|
222
|
-
throw a.status === 401 &&
|
|
219
|
+
}, this.onAnalyticPageView = (l, n) => {
|
|
220
|
+
ge(l, n).then((a) => a).catch((a) => {
|
|
221
|
+
throw a.status === 401 && r(), a;
|
|
223
222
|
});
|
|
224
|
-
}, this.beatApi = new
|
|
223
|
+
}, this.beatApi = new pe(t, o);
|
|
225
224
|
};
|
|
226
|
-
updateBeat = async (
|
|
227
|
-
this.beatApi.updateBeat(
|
|
225
|
+
updateBeat = async (t) => {
|
|
226
|
+
this.beatApi.updateBeat(t);
|
|
228
227
|
};
|
|
229
|
-
updateOffer = async (
|
|
230
|
-
this.beatApi.updateOffer(
|
|
228
|
+
updateOffer = async (t) => {
|
|
229
|
+
this.beatApi.updateOffer(t);
|
|
231
230
|
};
|
|
232
231
|
}
|
|
233
|
-
class
|
|
232
|
+
class nt {
|
|
234
233
|
copyStore;
|
|
235
234
|
endpoint = "/";
|
|
236
235
|
insightsMicroWidgetStore;
|
|
@@ -238,219 +237,66 @@ class lt {
|
|
|
238
237
|
token = "";
|
|
239
238
|
isInitialized = !1;
|
|
240
239
|
constructor() {
|
|
241
|
-
this.copyStore = new
|
|
240
|
+
this.copyStore = new tt(), this.insightsMicroWidgetStore = new lt(), ne(this);
|
|
242
241
|
}
|
|
243
|
-
initialize = async (
|
|
244
|
-
await this.copyStore.initialize(
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
this.session =
|
|
242
|
+
initialize = async (t, o, r) => {
|
|
243
|
+
await this.copyStore.initialize(t, o), await this.insightsMicroWidgetStore.initialize(t, o, r);
|
|
244
|
+
const l = await je(t, o, "1.0.0", "Micro Insights Carousel");
|
|
245
|
+
ye(() => {
|
|
246
|
+
this.session = l, this.isInitialized = !0;
|
|
248
247
|
});
|
|
249
248
|
};
|
|
250
249
|
}
|
|
251
|
-
const
|
|
250
|
+
const z = u.createContext(null), at = ({
|
|
252
251
|
onEvent: i,
|
|
253
|
-
onPageview:
|
|
254
|
-
store:
|
|
255
|
-
children:
|
|
256
|
-
}) => /* @__PURE__ */ e(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
className: "mx-micro-card-description",
|
|
277
|
-
color: "text.primary",
|
|
278
|
-
sx: {
|
|
279
|
-
display: "-webkit-box",
|
|
280
|
-
fontSize: 13,
|
|
281
|
-
letterSpacing: 0.48,
|
|
282
|
-
lineHeight: "20px",
|
|
283
|
-
overflow: "hidden",
|
|
284
|
-
pl: h ? 0 : 28,
|
|
285
|
-
pr: h ? 0 : 8,
|
|
286
|
-
WebkitBoxOrient: "vertical",
|
|
287
|
-
WebkitLineClamp: 2,
|
|
288
|
-
wordWrap: "break-word"
|
|
289
|
-
},
|
|
290
|
-
children: n && /* @__PURE__ */ e(
|
|
291
|
-
"span",
|
|
292
|
-
{
|
|
293
|
-
dangerouslySetInnerHTML: { __html: n },
|
|
294
|
-
style: { fontFamily: R.typography.fontFamily }
|
|
295
|
-
}
|
|
296
|
-
)
|
|
297
|
-
}
|
|
298
|
-
);
|
|
299
|
-
return /* @__PURE__ */ e(
|
|
300
|
-
Z,
|
|
301
|
-
{
|
|
302
|
-
"aria-hidden": !c,
|
|
303
|
-
"aria-label": t,
|
|
304
|
-
"aria-labelledby": "divButton",
|
|
305
|
-
"aria-roledescription": "slide",
|
|
306
|
-
ref: _,
|
|
307
|
-
role: "group",
|
|
308
|
-
sx: {
|
|
309
|
-
height: "100%",
|
|
310
|
-
minWidth: f ? `${f}px` : "100%",
|
|
311
|
-
fontFamily: R.typography.fontFamily
|
|
312
|
-
},
|
|
313
|
-
children: /* @__PURE__ */ e(
|
|
314
|
-
Z,
|
|
315
|
-
{
|
|
316
|
-
"aria-hidden": !c,
|
|
317
|
-
"aria-label": t,
|
|
318
|
-
id: "divButton",
|
|
319
|
-
onClick: () => C(),
|
|
320
|
-
onKeyDown: () => I(!1),
|
|
321
|
-
onKeyUp: () => I(!0),
|
|
322
|
-
ref: _,
|
|
323
|
-
role: "button",
|
|
324
|
-
sx: {
|
|
325
|
-
border: O ? "1px solid rgba(82, 138, 224, 0.8)" : void 0,
|
|
326
|
-
borderRadius: "8px",
|
|
327
|
-
height: "100%"
|
|
328
|
-
},
|
|
329
|
-
tabIndex: c ? 0 : -1,
|
|
330
|
-
children: /* @__PURE__ */ e(
|
|
331
|
-
je,
|
|
332
|
-
{
|
|
333
|
-
"aria-roledescription": "slide",
|
|
334
|
-
className: "mx-micro-card",
|
|
335
|
-
role: "group",
|
|
336
|
-
sx: {
|
|
337
|
-
backgroundColor: l,
|
|
338
|
-
boxSizing: "border-box",
|
|
339
|
-
cursor: "pointer",
|
|
340
|
-
height: r ? "100%" : 124,
|
|
341
|
-
p: 16,
|
|
342
|
-
...y,
|
|
343
|
-
"& .MuiCardHeader-avatar": {
|
|
344
|
-
mr: "8px"
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
variant: s,
|
|
348
|
-
children: /* @__PURE__ */ g(
|
|
349
|
-
k,
|
|
350
|
-
{
|
|
351
|
-
sx: {
|
|
352
|
-
alignItems: "space-between",
|
|
353
|
-
height: "100%"
|
|
354
|
-
},
|
|
355
|
-
children: [
|
|
356
|
-
/* @__PURE__ */ e(
|
|
357
|
-
qe,
|
|
358
|
-
{
|
|
359
|
-
avatar: p && a,
|
|
360
|
-
subheader: h && M,
|
|
361
|
-
sx: { p: 0 },
|
|
362
|
-
title: E,
|
|
363
|
-
titleTypographyProps: { fontSize: 15, fontWeight: 600, variant: "h3" }
|
|
364
|
-
}
|
|
365
|
-
),
|
|
366
|
-
/* @__PURE__ */ e(Qe, { sx: { p: 0 }, children: !h && M }),
|
|
367
|
-
!!o && /* @__PURE__ */ e(
|
|
368
|
-
Xe,
|
|
369
|
-
{
|
|
370
|
-
sx: {
|
|
371
|
-
mt: "auto",
|
|
372
|
-
p: 0
|
|
373
|
-
},
|
|
374
|
-
children: /* @__PURE__ */ e(
|
|
375
|
-
Z,
|
|
376
|
-
{
|
|
377
|
-
sx: (W) => ({
|
|
378
|
-
color: W.palette.primary.main,
|
|
379
|
-
fontSize: 14,
|
|
380
|
-
fontWeight: "bold",
|
|
381
|
-
px: 28,
|
|
382
|
-
fontFamily: W.typography.fontFamily,
|
|
383
|
-
...T
|
|
384
|
-
}),
|
|
385
|
-
children: o
|
|
386
|
-
}
|
|
387
|
-
)
|
|
388
|
-
}
|
|
389
|
-
)
|
|
390
|
-
]
|
|
391
|
-
}
|
|
392
|
-
)
|
|
393
|
-
}
|
|
394
|
-
)
|
|
395
|
-
}
|
|
396
|
-
)
|
|
397
|
-
}
|
|
398
|
-
);
|
|
399
|
-
}), rt = ({ beat: i }) => {
|
|
400
|
-
const { primary_category_guid: o, category_guids: t } = i, l = o || t?.[0] || Pe.UNCATEGORIZED;
|
|
401
|
-
return /* @__PURE__ */ e(Ze, { categoryGuid: l, size: 16, sx: { minWidth: 16 } });
|
|
402
|
-
}, at = ({ beat: i }) => {
|
|
403
|
-
const { category_guids: o, merchant_guids: t, primary_category_guid: l, primary_merchant_guid: n } = i;
|
|
252
|
+
onPageview: t,
|
|
253
|
+
store: o,
|
|
254
|
+
children: r
|
|
255
|
+
}) => /* @__PURE__ */ e(z.Provider, { value: { onEvent: i, onPageview: t, store: o, children: r }, children: r }), ct = ({ beat: i }) => {
|
|
256
|
+
const { primary_category_guid: t, category_guids: o } = i, r = t || o?.[0] || Ue.UNCATEGORIZED;
|
|
257
|
+
return /* @__PURE__ */ e(Ze, { categoryGuid: r, size: 32, sx: { minWidth: 32 } });
|
|
258
|
+
}, w = ({
|
|
259
|
+
bgColor: i,
|
|
260
|
+
name: t,
|
|
261
|
+
iconColor: o = "primary"
|
|
262
|
+
}) => /* @__PURE__ */ e(
|
|
263
|
+
et,
|
|
264
|
+
{
|
|
265
|
+
sx: {
|
|
266
|
+
bgcolor: i,
|
|
267
|
+
width: 32,
|
|
268
|
+
height: 32
|
|
269
|
+
},
|
|
270
|
+
variant: "rounded",
|
|
271
|
+
children: /* @__PURE__ */ e(ke, { color: o, fill: !0, name: t, size: 20 })
|
|
272
|
+
}
|
|
273
|
+
), st = ({ beat: i }) => {
|
|
274
|
+
const { category_guids: t, merchant_guids: o, primary_category_guid: r, primary_merchant_guid: l } = i;
|
|
404
275
|
return /* @__PURE__ */ e(
|
|
405
|
-
|
|
276
|
+
Ge,
|
|
406
277
|
{
|
|
407
|
-
categoryGuid:
|
|
408
|
-
merchantGuid:
|
|
409
|
-
size:
|
|
278
|
+
categoryGuid: r || t && t[0] || "",
|
|
279
|
+
merchantGuid: l || o[0],
|
|
280
|
+
size: 32,
|
|
410
281
|
sx: {
|
|
411
282
|
display: "flex",
|
|
412
|
-
mt: 2
|
|
283
|
+
mt: 2,
|
|
284
|
+
minWidth: 32
|
|
413
285
|
}
|
|
414
286
|
}
|
|
415
287
|
);
|
|
416
|
-
},
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
"svg",
|
|
425
|
-
{
|
|
426
|
-
"aria-hidden": !0,
|
|
427
|
-
className: "kyper-icon",
|
|
428
|
-
focusable: !1,
|
|
429
|
-
height: o || t,
|
|
430
|
-
style: l,
|
|
431
|
-
viewBox: n,
|
|
432
|
-
width: r || t,
|
|
433
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
434
|
-
children: /* @__PURE__ */ e(
|
|
435
|
-
"path",
|
|
436
|
-
{
|
|
437
|
-
d: "M16 1.5C16 0.671573 15.3284 0 14.5 0H1.5C0.671573 0 0 0.671573 0 1.5V14.5C0 15.3284 0.671573 16 1.5 16H14.5C15.3284 16 16 15.3284 16 14.5V1.5ZM12.8 5.1C13.0209 5.26568 13.0657 5.57909 12.9 5.8L9.90003 9.8C9.71746 10.0434 9.36163 10.0687 9.14648 9.85355L6.55413 7.2612L3.90003 10.8C3.73434 11.0209 3.42094 11.0657 3.20003 10.9C2.97912 10.7343 2.93434 10.4209 3.10003 10.2L6.10003 6.2C6.28259 5.95658 6.63843 5.93129 6.85358 6.14645L9.44593 8.7388L12.1 5.2C12.2657 4.97908 12.5791 4.93431 12.8 5.1Z",
|
|
438
|
-
fill: i
|
|
439
|
-
}
|
|
440
|
-
)
|
|
441
|
-
}
|
|
442
|
-
), ct = (i) => i ? i.data ? i.data.map((o) => {
|
|
443
|
-
const t = {};
|
|
444
|
-
return i.names?.map((l, n) => {
|
|
445
|
-
t[l] = o[n];
|
|
446
|
-
}), t;
|
|
447
|
-
}) : [] : [], dt = (i, o) => {
|
|
448
|
-
const t = ct(i), l = t.length / 2, n = t.slice(0, l), r = t.slice(l);
|
|
449
|
-
return !n.length || !r.length ? o.palette.primary.main : n[0].amount > r[0].amount ? o.palette.error.main : n[0].amount < r[0].amount ? o.palette.success.main : o.palette.primary.main;
|
|
288
|
+
}, dt = (i) => i ? i.data ? i.data.map((t) => {
|
|
289
|
+
const o = {};
|
|
290
|
+
return i.names?.map((r, l) => {
|
|
291
|
+
o[r] = t[l];
|
|
292
|
+
}), o;
|
|
293
|
+
}) : [] : [], ht = (i) => {
|
|
294
|
+
const t = dt(i), o = t.length / 2, r = t.slice(0, o), l = t.slice(o);
|
|
295
|
+
return !r.length || !l.length ? "primary" : r[0].amount > l[0].amount ? "error" : r[0].amount < l[0].amount ? "success" : "primary";
|
|
450
296
|
}, Et = ({ beat: i }) => {
|
|
451
|
-
const
|
|
452
|
-
return /* @__PURE__ */ e(
|
|
453
|
-
},
|
|
297
|
+
const t = ze(), o = ht(i.data_series), r = t.palette[o].main;
|
|
298
|
+
return /* @__PURE__ */ e(w, { bgColor: W(r, 0.15), iconColor: o, name: "bar_chart" });
|
|
299
|
+
}, Te = () => /* @__PURE__ */ _("svg", { fill: "none", height: "36", viewBox: "0 0 40 36", width: "40", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
454
300
|
/* @__PURE__ */ e(
|
|
455
301
|
"path",
|
|
456
302
|
{
|
|
@@ -694,7 +540,7 @@ const U = u.createContext(null), nt = ({
|
|
|
694
540
|
fillRule: "evenodd"
|
|
695
541
|
}
|
|
696
542
|
),
|
|
697
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ _("g", { filter: "url(#filter0_d_1565_98011)", children: [
|
|
698
544
|
/* @__PURE__ */ e("mask", { height: "22", id: "mask1_1565_98011", maskUnits: "userSpaceOnUse", width: "17", x: "16", y: "12", children: /* @__PURE__ */ e(
|
|
699
545
|
"path",
|
|
700
546
|
{
|
|
@@ -950,10 +796,10 @@ const U = u.createContext(null), nt = ({
|
|
|
950
796
|
),
|
|
951
797
|
/* @__PURE__ */ e("path", { d: "M17.9668 31.5737H19.4947", stroke: "#E4E8EE", strokeWidth: "0.264005" })
|
|
952
798
|
] }),
|
|
953
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ _("g", { filter: "url(#filter1_d_1565_98011)", children: [
|
|
954
800
|
/* @__PURE__ */ e("circle", { cx: "15.0441", cy: "16.0441", fill: "#CDD3DD", r: "15.0441" }),
|
|
955
801
|
/* @__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" }) }),
|
|
956
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ _("g", { mask: "url(#mask2_1565_98011)", children: [
|
|
957
803
|
/* @__PURE__ */ e("rect", { fill: "white", height: "31.1359", transform: "translate(0 0.162598)", width: "31.0101" }),
|
|
958
804
|
/* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "4.52002" }),
|
|
959
805
|
/* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "17.1758" }),
|
|
@@ -1143,8 +989,8 @@ const U = u.createContext(null), nt = ({
|
|
|
1143
989
|
fill: "#CDD3DD"
|
|
1144
990
|
}
|
|
1145
991
|
),
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ _("defs", { children: [
|
|
993
|
+
/* @__PURE__ */ _(
|
|
1148
994
|
"filter",
|
|
1149
995
|
{
|
|
1150
996
|
colorInterpolationFilters: "sRGB",
|
|
@@ -1187,7 +1033,7 @@ const U = u.createContext(null), nt = ({
|
|
|
1187
1033
|
]
|
|
1188
1034
|
}
|
|
1189
1035
|
),
|
|
1190
|
-
/* @__PURE__ */
|
|
1036
|
+
/* @__PURE__ */ _(
|
|
1191
1037
|
"filter",
|
|
1192
1038
|
{
|
|
1193
1039
|
colorInterpolationFilters: "sRGB",
|
|
@@ -1231,167 +1077,232 @@ const U = u.createContext(null), nt = ({
|
|
|
1231
1077
|
}
|
|
1232
1078
|
)
|
|
1233
1079
|
] })
|
|
1234
|
-
] }),
|
|
1235
|
-
0: (i) => /* @__PURE__ */ e(
|
|
1236
|
-
1: (i) => /* @__PURE__ */ e(
|
|
1237
|
-
2: (i) => /* @__PURE__ */ e(
|
|
1080
|
+
] }), ut = {
|
|
1081
|
+
0: (i, t) => /* @__PURE__ */ e(w, { bgColor: W(t.palette.primary.main, 0.15), name: "error" }),
|
|
1082
|
+
1: (i) => /* @__PURE__ */ e(ct, { beat: i }),
|
|
1083
|
+
2: (i) => /* @__PURE__ */ e(st, { beat: i }),
|
|
1238
1084
|
3: (i) => /* @__PURE__ */ e(Et, { beat: i }),
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
5: () => /* @__PURE__ */ e(He, {})
|
|
1085
|
+
4: (i, t) => /* @__PURE__ */ e(
|
|
1086
|
+
w,
|
|
1087
|
+
{
|
|
1088
|
+
bgColor: W(t.palette.secondary.main, 0.15),
|
|
1089
|
+
iconColor: "secondary",
|
|
1090
|
+
name: "info"
|
|
1091
|
+
}
|
|
1092
|
+
),
|
|
1093
|
+
5: (i, t) => /* @__PURE__ */ e(w, { bgColor: W(t.palette.primary.main, 0.15), name: "campaign" }),
|
|
1249
1094
|
// TODO: Waiting for the backend to accommodate icon types 6, 7, 8, and 9
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
// <BeatMaterialIcon
|
|
1253
|
-
// bgColor={alpha(theme.palette.success.main, 0.15)}
|
|
1254
|
-
// iconColor="success"
|
|
1255
|
-
// name="check_circle"
|
|
1256
|
-
// />
|
|
1257
|
-
// )
|
|
1258
|
-
// },
|
|
1259
|
-
// 7: (_, theme) => (
|
|
1260
|
-
// <BeatMaterialIcon bgColor={alpha(theme.palette.primary.main, 0.15)} name="today" />
|
|
1261
|
-
// ),
|
|
1262
|
-
// 8: (_, theme) => (
|
|
1263
|
-
// <BeatMaterialIcon bgColor={alpha(theme.palette.primary.main, 0.15)} name="calendar_clock" />
|
|
1264
|
-
// ),
|
|
1265
|
-
// 9: (_, theme) => (
|
|
1266
|
-
// <BeatMaterialIcon bgColor={alpha(theme.palette.primary.main, 0.15)} name="celebration" />
|
|
1267
|
-
// ),
|
|
1268
|
-
}, ut = ({ beat: i }) => {
|
|
1269
|
-
const o = me(), { icon_type: t } = i, l = t != null ? ht[t] : null;
|
|
1270
|
-
return l ? l(i, o) : /* @__PURE__ */ e(
|
|
1271
|
-
Ce,
|
|
1095
|
+
6: (i, t) => /* @__PURE__ */ e(
|
|
1096
|
+
w,
|
|
1272
1097
|
{
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
}
|
|
1098
|
+
bgColor: W(t.palette.success.main, 0.15),
|
|
1099
|
+
iconColor: "success",
|
|
1100
|
+
name: "check_circle"
|
|
1277
1101
|
}
|
|
1278
|
-
)
|
|
1279
|
-
|
|
1280
|
-
|
|
1102
|
+
),
|
|
1103
|
+
7: (i, t) => /* @__PURE__ */ e(w, { bgColor: W(t.palette.primary.main, 0.15), name: "today" }),
|
|
1104
|
+
8: (i, t) => /* @__PURE__ */ e(w, { bgColor: W(t.palette.primary.main, 0.15), name: "calendar_clock" }),
|
|
1105
|
+
9: (i, t) => /* @__PURE__ */ e(w, { bgColor: W(t.palette.primary.main, 0.15), name: "celebration" })
|
|
1106
|
+
}, pt = ({ beat: i }) => {
|
|
1107
|
+
const t = le(), { icon_type: o } = i, r = o != null ? ut[o] : null;
|
|
1108
|
+
return r ? r(i, t) : /* @__PURE__ */ e(w, { bgColor: W(t.palette.primary.main, 0.15), name: "error" });
|
|
1109
|
+
}, H = () => {
|
|
1110
|
+
const i = u.useContext(z);
|
|
1281
1111
|
if (!i)
|
|
1282
1112
|
throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
|
|
1283
1113
|
return i.store.copyStore;
|
|
1284
|
-
},
|
|
1285
|
-
const i = u.useContext(
|
|
1114
|
+
}, _t = () => {
|
|
1115
|
+
const i = u.useContext(z);
|
|
1286
1116
|
if (!i?.store?.insightsMicroWidgetStore)
|
|
1287
1117
|
throw new Error(
|
|
1288
1118
|
"useInsightsMicroWidgetStore() must be used within the InsightsMicroWidgetDataProvider"
|
|
1289
1119
|
);
|
|
1290
1120
|
return i.store.insightsMicroWidgetStore;
|
|
1291
|
-
},
|
|
1292
|
-
const i = u.useContext(
|
|
1121
|
+
}, K = () => {
|
|
1122
|
+
const i = u.useContext(z);
|
|
1293
1123
|
if (!i)
|
|
1294
1124
|
throw new Error("useEvent() must be used within the InsightsMicroWidgetDataProvider");
|
|
1295
1125
|
return { onEvent: i.onEvent };
|
|
1296
|
-
},
|
|
1297
|
-
const i = u.useContext(
|
|
1126
|
+
}, We = () => {
|
|
1127
|
+
const i = u.useContext(z);
|
|
1298
1128
|
if (!i)
|
|
1299
1129
|
throw new Error("usePageview() must be used within the InsightsMicroWidgetDataProvider");
|
|
1300
1130
|
return { onPageview: i.onPageview };
|
|
1301
|
-
},
|
|
1131
|
+
}, Ct = {
|
|
1302
1132
|
LARGE: 180,
|
|
1303
1133
|
STANDARD: 154,
|
|
1304
1134
|
XLARGE: 200,
|
|
1305
1135
|
XXLARGE: 248
|
|
1306
|
-
},
|
|
1136
|
+
}, ft = 50, we = 1, mt = {
|
|
1137
|
+
close: "Close"
|
|
1138
|
+
}, Rt = u.forwardRef(
|
|
1139
|
+
function({
|
|
1140
|
+
ariaLabel: t,
|
|
1141
|
+
cardSx: o,
|
|
1142
|
+
description: r,
|
|
1143
|
+
icon: l = /* @__PURE__ */ e(Be, {}),
|
|
1144
|
+
isActiveCard: n,
|
|
1145
|
+
hasCardEffect: a = !1,
|
|
1146
|
+
heightOverrides: h,
|
|
1147
|
+
onClose: p,
|
|
1148
|
+
onCardClick: f,
|
|
1149
|
+
onPrimaryAction: E,
|
|
1150
|
+
onSecondaryAction: c,
|
|
1151
|
+
primaryActionText: d,
|
|
1152
|
+
secondaryActionText: s,
|
|
1153
|
+
showIcon: R = !0,
|
|
1154
|
+
title: C,
|
|
1155
|
+
variant: g,
|
|
1156
|
+
widthOverrides: m
|
|
1157
|
+
}, x) {
|
|
1158
|
+
const O = !!(E && d), T = !!(c && s), A = /* @__PURE__ */ _(
|
|
1159
|
+
a ? qe : X,
|
|
1160
|
+
{
|
|
1161
|
+
"aria-hidden": !n,
|
|
1162
|
+
"aria-label": t,
|
|
1163
|
+
ref: x,
|
|
1164
|
+
sx: {
|
|
1165
|
+
backgroundColor: "background.paper",
|
|
1166
|
+
height: h ? "100%" : 124,
|
|
1167
|
+
minWidth: m ? `${m}px` : "100%",
|
|
1168
|
+
pb: 8,
|
|
1169
|
+
position: "relative",
|
|
1170
|
+
pt: 16,
|
|
1171
|
+
px: 16,
|
|
1172
|
+
...o
|
|
1173
|
+
},
|
|
1174
|
+
tabIndex: n ? 0 : -1,
|
|
1175
|
+
variant: g,
|
|
1176
|
+
children: [
|
|
1177
|
+
p && /* @__PURE__ */ e(
|
|
1178
|
+
re,
|
|
1179
|
+
{
|
|
1180
|
+
"aria-label": mt.close,
|
|
1181
|
+
onClick: p,
|
|
1182
|
+
sx: { minHeight: 40, minWidth: 40, position: "absolute", right: 4, top: 4 },
|
|
1183
|
+
children: /* @__PURE__ */ e(Fe, {})
|
|
1184
|
+
}
|
|
1185
|
+
),
|
|
1186
|
+
/* @__PURE__ */ _(S, { sx: { gap: 6, height: "100%", justifyContent: "space-between" }, children: [
|
|
1187
|
+
/* @__PURE__ */ _(S, { sx: { flexDirection: "row", gap: 12 }, children: [
|
|
1188
|
+
R && l,
|
|
1189
|
+
/* @__PURE__ */ _(S, { sx: { gap: 6 }, children: [
|
|
1190
|
+
/* @__PURE__ */ e(S, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: /* @__PURE__ */ e(he, { bold: !0, sx: { lineHeight: "16px" }, variant: "body1", children: C }) }),
|
|
1191
|
+
/* @__PURE__ */ e(
|
|
1192
|
+
he,
|
|
1193
|
+
{
|
|
1194
|
+
dangerouslySetInnerHTML: { __html: r },
|
|
1195
|
+
sx: {
|
|
1196
|
+
display: "-webkit-box",
|
|
1197
|
+
overflow: "hidden",
|
|
1198
|
+
textOverflow: "ellipsis",
|
|
1199
|
+
WebkitBoxOrient: "vertical",
|
|
1200
|
+
WebkitLineClamp: O ? 2 : 3
|
|
1201
|
+
},
|
|
1202
|
+
variant: "subtitle2"
|
|
1203
|
+
}
|
|
1204
|
+
)
|
|
1205
|
+
] })
|
|
1206
|
+
] }),
|
|
1207
|
+
O && /* @__PURE__ */ _(S, { sx: { alignItems: "center", flexDirection: "row", height: 28, pb: 4, pl: 36 }, children: [
|
|
1208
|
+
O && /* @__PURE__ */ e(oe, { onClick: E, size: "small", sx: { px: 8 }, variant: "text", children: /* @__PURE__ */ e(Ee, { bold: !0, variant: "body2", children: d }) }),
|
|
1209
|
+
T && /* @__PURE__ */ e(oe, { onClick: c, size: "small", sx: { px: 8 }, variant: "text", children: /* @__PURE__ */ e(Ee, { bold: !0, sx: { color: "text.secondary" }, variant: "body2", children: s }) })
|
|
1210
|
+
] })
|
|
1211
|
+
] })
|
|
1212
|
+
]
|
|
1213
|
+
}
|
|
1214
|
+
);
|
|
1215
|
+
return f ? /* @__PURE__ */ e(Je, { onClick: f, children: A }) : A;
|
|
1216
|
+
}
|
|
1217
|
+
), Q = Rt, gt = ({
|
|
1307
1218
|
ariaLabel: i,
|
|
1308
|
-
backgroundColor: o,
|
|
1309
1219
|
beat: t,
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
showIcon:
|
|
1317
|
-
|
|
1318
|
-
widthOverrides: d
|
|
1220
|
+
index: o,
|
|
1221
|
+
isActiveCard: r,
|
|
1222
|
+
onCardClick: l,
|
|
1223
|
+
posthog: n,
|
|
1224
|
+
widthOverrides: a,
|
|
1225
|
+
variant: h,
|
|
1226
|
+
showIcon: p,
|
|
1227
|
+
heightOverrides: f
|
|
1319
1228
|
}) => {
|
|
1320
|
-
const { ref: E, inView:
|
|
1321
|
-
threshold:
|
|
1322
|
-
}), { cardsCopy:
|
|
1323
|
-
|
|
1324
|
-
|
|
1229
|
+
const { ref: E, inView: c } = ve({
|
|
1230
|
+
threshold: we
|
|
1231
|
+
}), { cardsCopy: d } = H(), { onEvent: s } = K(), { updateBeat: R, updateOffer: C } = _t();
|
|
1232
|
+
ie(() => {
|
|
1233
|
+
c && (t.has_been_displayed ? s(Me(t.template)) : (t.guid.startsWith("OFR") ? C({
|
|
1325
1234
|
...t,
|
|
1326
1235
|
has_been_displayed: !0
|
|
1327
1236
|
}) : R({
|
|
1328
1237
|
...t,
|
|
1329
1238
|
has_been_displayed: !0
|
|
1330
|
-
}),
|
|
1331
|
-
}, [
|
|
1332
|
-
if (
|
|
1239
|
+
}), s(Se(t.template))));
|
|
1240
|
+
}, [c]), ie(() => {
|
|
1241
|
+
if (c && t)
|
|
1333
1242
|
if (t.template === "MarketingOffer") {
|
|
1334
1243
|
const m = t;
|
|
1335
|
-
|
|
1244
|
+
n?.capture("viewed_messaging_insight", {
|
|
1336
1245
|
template: t.template,
|
|
1337
1246
|
campaign_guid: m.campaign_guid,
|
|
1338
1247
|
campaign_name: m.pulse_campaign_name
|
|
1339
1248
|
});
|
|
1340
1249
|
} else
|
|
1341
|
-
|
|
1250
|
+
n?.capture("viewed_insight", {
|
|
1342
1251
|
beat_guid: t.guid,
|
|
1343
1252
|
template: t.template,
|
|
1344
|
-
position:
|
|
1253
|
+
position: o
|
|
1345
1254
|
});
|
|
1346
|
-
}, [t,
|
|
1347
|
-
const
|
|
1348
|
-
if (
|
|
1255
|
+
}, [t, o, c]);
|
|
1256
|
+
const g = () => {
|
|
1257
|
+
if (l && l(t), s(Ae(t.template)), t.template === "MarketingOffer") {
|
|
1349
1258
|
const m = t;
|
|
1350
|
-
|
|
1259
|
+
n?.capture("clicked_messaging_insight", {
|
|
1351
1260
|
template: t.template,
|
|
1352
1261
|
campaign_guid: m.campaign_guid,
|
|
1353
1262
|
campaign_name: m.pulse_campaign_name
|
|
1354
1263
|
});
|
|
1355
1264
|
} else
|
|
1356
|
-
|
|
1265
|
+
n?.capture("clicked_insight", {
|
|
1357
1266
|
beat_guid: t.guid,
|
|
1358
1267
|
template: t.template,
|
|
1359
|
-
position:
|
|
1268
|
+
position: o
|
|
1360
1269
|
});
|
|
1361
1270
|
};
|
|
1362
1271
|
return /* @__PURE__ */ e(
|
|
1363
|
-
|
|
1272
|
+
Q,
|
|
1364
1273
|
{
|
|
1365
|
-
actionText: t.micro_call_to_action || f.micro_card_cta,
|
|
1366
1274
|
ariaLabel: i,
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1275
|
+
cardSx: {
|
|
1276
|
+
borderRadius: 2
|
|
1277
|
+
},
|
|
1278
|
+
description: t?.html_micro_description && t?.html_micro_description.length > 0 ? t.html_micro_description : t.html_description || "",
|
|
1279
|
+
hasCardEffect: !0,
|
|
1280
|
+
heightOverrides: f,
|
|
1281
|
+
icon: /* @__PURE__ */ e(pt, { beat: t }),
|
|
1282
|
+
isActiveCard: r,
|
|
1283
|
+
onCardClick: g,
|
|
1284
|
+
onPrimaryAction: g,
|
|
1285
|
+
primaryActionText: t.micro_call_to_action || d.micro_card_cta,
|
|
1374
1286
|
ref: E,
|
|
1375
|
-
|
|
1376
|
-
showIcon: C,
|
|
1287
|
+
showIcon: p,
|
|
1377
1288
|
title: t.micro_title && t.micro_title.length > 0 ? t.micro_title : t.title,
|
|
1378
|
-
variant:
|
|
1379
|
-
widthOverrides:
|
|
1289
|
+
variant: h,
|
|
1290
|
+
widthOverrides: a
|
|
1380
1291
|
}
|
|
1381
1292
|
);
|
|
1382
|
-
},
|
|
1293
|
+
}, It = ({
|
|
1383
1294
|
currentBeatIndex: i,
|
|
1384
|
-
numBeats:
|
|
1385
|
-
onNextClick:
|
|
1386
|
-
onPreviousClick:
|
|
1387
|
-
scrollRightBoundary:
|
|
1388
|
-
scrollX:
|
|
1295
|
+
numBeats: t,
|
|
1296
|
+
onNextClick: o,
|
|
1297
|
+
onPreviousClick: r,
|
|
1298
|
+
scrollRightBoundary: l,
|
|
1299
|
+
scrollX: n,
|
|
1389
1300
|
shouldApplyDotAnimation: a = !1,
|
|
1390
|
-
visibleCardsCount:
|
|
1301
|
+
visibleCardsCount: h = 1
|
|
1391
1302
|
}) => {
|
|
1392
|
-
const
|
|
1393
|
-
return /* @__PURE__ */
|
|
1394
|
-
|
|
1303
|
+
const p = le(), { carouselCopy: f } = H(), E = Math.floor(n) > l || i - h + 1 === 0, c = n < 0 || t - 1 === i, d = p.palette.grey[500], s = p.palette.primary.main;
|
|
1304
|
+
return /* @__PURE__ */ _(
|
|
1305
|
+
S,
|
|
1395
1306
|
{
|
|
1396
1307
|
direction: "row",
|
|
1397
1308
|
sx: {
|
|
@@ -1406,30 +1317,30 @@ const U = u.createContext(null), nt = ({
|
|
|
1406
1317
|
},
|
|
1407
1318
|
children: [
|
|
1408
1319
|
/* @__PURE__ */ e(
|
|
1409
|
-
|
|
1320
|
+
re,
|
|
1410
1321
|
{
|
|
1411
|
-
"aria-disabled":
|
|
1412
|
-
"aria-label":
|
|
1413
|
-
disabled:
|
|
1414
|
-
onClick:
|
|
1322
|
+
"aria-disabled": E,
|
|
1323
|
+
"aria-label": f.previous_insight_cta_aria,
|
|
1324
|
+
disabled: E,
|
|
1325
|
+
onClick: r,
|
|
1415
1326
|
children: /* @__PURE__ */ e(
|
|
1416
|
-
|
|
1327
|
+
be,
|
|
1417
1328
|
{
|
|
1418
1329
|
style: {
|
|
1419
|
-
color:
|
|
1330
|
+
color: E ? d : s
|
|
1420
1331
|
}
|
|
1421
1332
|
}
|
|
1422
1333
|
)
|
|
1423
1334
|
}
|
|
1424
1335
|
),
|
|
1425
|
-
Array.from({ length:
|
|
1426
|
-
const
|
|
1336
|
+
Array.from({ length: t }).map((R, C) => {
|
|
1337
|
+
const g = C === i;
|
|
1427
1338
|
return /* @__PURE__ */ e(
|
|
1428
|
-
|
|
1339
|
+
X,
|
|
1429
1340
|
{
|
|
1430
1341
|
className: "mx-insights-micro-carousel-dots",
|
|
1431
1342
|
sx: {
|
|
1432
|
-
bgcolor:
|
|
1343
|
+
bgcolor: g ? s : d,
|
|
1433
1344
|
height: 8,
|
|
1434
1345
|
mr: 8,
|
|
1435
1346
|
// existing comment from meganthan "we were using `gap` instead of margin, but it doesn't work in safari browsers older than iOS 14.1"
|
|
@@ -1442,24 +1353,24 @@ const U = u.createContext(null), nt = ({
|
|
|
1442
1353
|
borderRadius: "50%",
|
|
1443
1354
|
p: 0
|
|
1444
1355
|
},
|
|
1445
|
-
width:
|
|
1356
|
+
width: g && a ? 24 : 8
|
|
1446
1357
|
}
|
|
1447
1358
|
},
|
|
1448
|
-
`carousel-button-${
|
|
1359
|
+
`carousel-button-${C}`
|
|
1449
1360
|
);
|
|
1450
1361
|
}),
|
|
1451
1362
|
/* @__PURE__ */ e(
|
|
1452
|
-
|
|
1363
|
+
re,
|
|
1453
1364
|
{
|
|
1454
|
-
"aria-disabled":
|
|
1455
|
-
"aria-label":
|
|
1456
|
-
disabled:
|
|
1457
|
-
onClick:
|
|
1365
|
+
"aria-disabled": c,
|
|
1366
|
+
"aria-label": f.next_insight_cta_aria,
|
|
1367
|
+
disabled: c,
|
|
1368
|
+
onClick: o,
|
|
1458
1369
|
children: /* @__PURE__ */ e(
|
|
1459
|
-
|
|
1370
|
+
Ie,
|
|
1460
1371
|
{
|
|
1461
1372
|
style: {
|
|
1462
|
-
color:
|
|
1373
|
+
color: c ? d : s
|
|
1463
1374
|
}
|
|
1464
1375
|
}
|
|
1465
1376
|
)
|
|
@@ -1468,158 +1379,158 @@ const U = u.createContext(null), nt = ({
|
|
|
1468
1379
|
]
|
|
1469
1380
|
}
|
|
1470
1381
|
);
|
|
1471
|
-
},
|
|
1382
|
+
}, vt = ({
|
|
1472
1383
|
activeCardIndex: i,
|
|
1473
|
-
beats:
|
|
1474
|
-
cardWidth:
|
|
1475
|
-
showCTAColocatedWithText:
|
|
1476
|
-
heightOverrides:
|
|
1477
|
-
onCardClick:
|
|
1384
|
+
beats: t,
|
|
1385
|
+
cardWidth: o,
|
|
1386
|
+
showCTAColocatedWithText: r,
|
|
1387
|
+
heightOverrides: l,
|
|
1388
|
+
onCardClick: n,
|
|
1478
1389
|
posthog: a,
|
|
1479
|
-
showIcon:
|
|
1480
|
-
variant:
|
|
1390
|
+
showIcon: h,
|
|
1391
|
+
variant: p
|
|
1481
1392
|
}) => {
|
|
1482
|
-
const { carouselCopy:
|
|
1483
|
-
showCTAColocatedWithText:
|
|
1484
|
-
heightOverrides:
|
|
1393
|
+
const { carouselCopy: f } = H(), E = {
|
|
1394
|
+
showCTAColocatedWithText: r,
|
|
1395
|
+
heightOverrides: l,
|
|
1485
1396
|
posthog: a,
|
|
1486
|
-
showIcon:
|
|
1487
|
-
variant:
|
|
1397
|
+
showIcon: h,
|
|
1398
|
+
variant: p
|
|
1488
1399
|
};
|
|
1489
|
-
return /* @__PURE__ */
|
|
1490
|
-
|
|
1491
|
-
const s =
|
|
1492
|
-
|
|
1400
|
+
return /* @__PURE__ */ _(Ne, { children: [
|
|
1401
|
+
t.map((c, d) => {
|
|
1402
|
+
const s = d + 1, R = t.length + 1, C = Ke(
|
|
1403
|
+
f.card_position_in_carousel_aria,
|
|
1493
1404
|
s.toString(),
|
|
1494
|
-
|
|
1495
|
-
),
|
|
1405
|
+
R.toString()
|
|
1406
|
+
), g = c.micro_title && c.micro_title.length > 0, m = c.micro_description && c.micro_description.length > 0, x = g ? c.micro_title : c.title, O = m ? c.micro_description : c.description;
|
|
1496
1407
|
return /* @__PURE__ */ e(
|
|
1497
|
-
|
|
1408
|
+
gt,
|
|
1498
1409
|
{
|
|
1499
|
-
ariaLabel: `${
|
|
1500
|
-
beat:
|
|
1501
|
-
index:
|
|
1502
|
-
isActiveCard:
|
|
1503
|
-
onCardClick:
|
|
1504
|
-
widthOverrides:
|
|
1505
|
-
...
|
|
1410
|
+
ariaLabel: `${C}: ${x}, ${O}`,
|
|
1411
|
+
beat: c,
|
|
1412
|
+
index: d,
|
|
1413
|
+
isActiveCard: d === i,
|
|
1414
|
+
onCardClick: n,
|
|
1415
|
+
widthOverrides: o || void 0,
|
|
1416
|
+
...E
|
|
1506
1417
|
},
|
|
1507
|
-
`${
|
|
1418
|
+
`${c.guid} ${d}`
|
|
1508
1419
|
);
|
|
1509
1420
|
}),
|
|
1510
1421
|
/* @__PURE__ */ e(
|
|
1511
|
-
|
|
1422
|
+
xt,
|
|
1512
1423
|
{
|
|
1513
|
-
isActiveCard: i ===
|
|
1514
|
-
onCardClick:
|
|
1515
|
-
widthOverrides:
|
|
1516
|
-
...
|
|
1424
|
+
isActiveCard: i === t.length,
|
|
1425
|
+
onCardClick: n,
|
|
1426
|
+
widthOverrides: o || void 0,
|
|
1427
|
+
...E
|
|
1517
1428
|
}
|
|
1518
1429
|
)
|
|
1519
1430
|
] });
|
|
1520
|
-
},
|
|
1431
|
+
}, yt = ({
|
|
1521
1432
|
analyticsMetadata: i,
|
|
1522
|
-
allowSingleCardPeeking:
|
|
1523
|
-
beats:
|
|
1524
|
-
showCTAColocatedWithText:
|
|
1525
|
-
heightOverrides:
|
|
1526
|
-
onCardClick:
|
|
1433
|
+
allowSingleCardPeeking: t = !1,
|
|
1434
|
+
beats: o = [],
|
|
1435
|
+
showCTAColocatedWithText: r,
|
|
1436
|
+
heightOverrides: l,
|
|
1437
|
+
onCardClick: n,
|
|
1527
1438
|
posthog: a,
|
|
1528
|
-
showCarouselControls:
|
|
1529
|
-
showIcon:
|
|
1530
|
-
showWithMargin:
|
|
1531
|
-
variant:
|
|
1532
|
-
widthOverrides:
|
|
1533
|
-
visibleCardsCount:
|
|
1439
|
+
showCarouselControls: h,
|
|
1440
|
+
showIcon: p,
|
|
1441
|
+
showWithMargin: f = !0,
|
|
1442
|
+
variant: E,
|
|
1443
|
+
widthOverrides: c,
|
|
1444
|
+
visibleCardsCount: d = 1
|
|
1534
1445
|
// Default to 1 card visible
|
|
1535
1446
|
}) => {
|
|
1536
|
-
const s = u.useRef(null),
|
|
1447
|
+
const s = u.useRef(null), R = u.useRef(null), [C, g] = u.useState(0), [m, x] = u.useState(null), [O, T] = u.useState(null), [y, A] = u.useState(null), { carouselCopy: B } = H(), { onEvent: b } = K();
|
|
1537
1448
|
u.useEffect(() => {
|
|
1538
|
-
if (s.current && !
|
|
1539
|
-
const
|
|
1540
|
-
let
|
|
1541
|
-
if (
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1449
|
+
if (s.current && !t) {
|
|
1450
|
+
const M = s.current.offsetWidth, G = 8;
|
|
1451
|
+
let P;
|
|
1452
|
+
if (d > 1) {
|
|
1453
|
+
const se = (M - (d - 1) * G) / d / 3;
|
|
1454
|
+
P = (M - se - (d - 1) * G) / d;
|
|
1544
1455
|
} else
|
|
1545
|
-
|
|
1546
|
-
|
|
1456
|
+
P = M;
|
|
1457
|
+
A(P);
|
|
1547
1458
|
}
|
|
1548
|
-
}, [
|
|
1549
|
-
const
|
|
1550
|
-
if (typeof
|
|
1551
|
-
const
|
|
1552
|
-
const
|
|
1459
|
+
}, [d, s.current?.offsetWidth]), u.useEffect(() => {
|
|
1460
|
+
const M = R.current?.offsetWidth;
|
|
1461
|
+
if (typeof M == "number" && t) {
|
|
1462
|
+
const G = (U) => {
|
|
1463
|
+
const de = [
|
|
1553
1464
|
{ maxWidth: 375, cardWidth: 268 },
|
|
1554
1465
|
{ maxWidth: 444, cardWidth: 300 },
|
|
1555
1466
|
{ maxWidth: 599, cardWidth: 350 },
|
|
1556
1467
|
{ maxWidth: 749, cardWidth: 450 },
|
|
1557
1468
|
{ maxWidth: 900, cardWidth: 600 }
|
|
1558
|
-
].find((
|
|
1559
|
-
return
|
|
1469
|
+
].find((Le) => U <= Le.maxWidth);
|
|
1470
|
+
return de ? de.cardWidth : 750;
|
|
1560
1471
|
};
|
|
1561
|
-
|
|
1562
|
-
const
|
|
1563
|
-
const
|
|
1564
|
-
typeof
|
|
1472
|
+
A(G(M));
|
|
1473
|
+
const P = () => {
|
|
1474
|
+
const U = R.current?.offsetWidth;
|
|
1475
|
+
typeof U == "number" && A(G(U));
|
|
1565
1476
|
};
|
|
1566
|
-
return window.addEventListener("resize",
|
|
1567
|
-
window.removeEventListener("resize",
|
|
1477
|
+
return window.addEventListener("resize", P), () => {
|
|
1478
|
+
window.removeEventListener("resize", P);
|
|
1568
1479
|
};
|
|
1569
1480
|
}
|
|
1570
|
-
}, [
|
|
1571
|
-
const
|
|
1572
|
-
|
|
1573
|
-
left:
|
|
1481
|
+
}, [t, R]);
|
|
1482
|
+
const $ = () => {
|
|
1483
|
+
b(v.ON_CAROUSEL_FORWARD_CLICK, i), s.current && y && s.current.scrollTo({
|
|
1484
|
+
left: C + y + 8,
|
|
1574
1485
|
top: 0,
|
|
1575
1486
|
behavior: "smooth"
|
|
1576
1487
|
});
|
|
1577
|
-
},
|
|
1578
|
-
|
|
1579
|
-
left: Math.max(0,
|
|
1488
|
+
}, j = () => {
|
|
1489
|
+
b(v.ON_CAROUSEL_BACK_CLICK, i), s.current && y && s.current.scrollTo({
|
|
1490
|
+
left: Math.max(0, C - (y + 8)),
|
|
1580
1491
|
top: 0,
|
|
1581
1492
|
behavior: "smooth"
|
|
1582
1493
|
});
|
|
1583
|
-
},
|
|
1584
|
-
s.current &&
|
|
1585
|
-
},
|
|
1586
|
-
if (!
|
|
1587
|
-
|
|
1588
|
-
},
|
|
1589
|
-
|
|
1590
|
-
}, Y = (
|
|
1591
|
-
|
|
1592
|
-
},
|
|
1593
|
-
return /* @__PURE__ */
|
|
1594
|
-
|
|
1494
|
+
}, q = () => {
|
|
1495
|
+
s.current && g(s.current.scrollLeft);
|
|
1496
|
+
}, J = () => {
|
|
1497
|
+
if (!O || !m) return;
|
|
1498
|
+
O - m > ft ? b(v.ON_CAROUSEL_FORWARD_SWIPE, i) : b(v.ON_CAROUSEL_BACK_SWIPE, i);
|
|
1499
|
+
}, ee = (M) => {
|
|
1500
|
+
x(M.targetTouches[0].clientX);
|
|
1501
|
+
}, Y = (M) => {
|
|
1502
|
+
x(null), T(M.targetTouches[0].clientX);
|
|
1503
|
+
}, D = y ? Math.round(C / (y + 8)) : 0, Ve = s.current ? s.current.scrollWidth - s.current.offsetWidth : 0;
|
|
1504
|
+
return /* @__PURE__ */ _(
|
|
1505
|
+
S,
|
|
1595
1506
|
{
|
|
1596
|
-
"aria-label":
|
|
1507
|
+
"aria-label": B.carousel_title,
|
|
1597
1508
|
"aria-roledescription": "carousel",
|
|
1598
|
-
ref:
|
|
1509
|
+
ref: R,
|
|
1599
1510
|
role: "group/region",
|
|
1600
1511
|
sx: {
|
|
1601
1512
|
alignItems: "center",
|
|
1602
1513
|
boxSizing: "border-box",
|
|
1603
|
-
height:
|
|
1604
|
-
width:
|
|
1514
|
+
height: l,
|
|
1515
|
+
width: c || "100%"
|
|
1605
1516
|
},
|
|
1606
1517
|
children: [
|
|
1607
1518
|
/* @__PURE__ */ e(
|
|
1608
|
-
|
|
1519
|
+
S,
|
|
1609
1520
|
{
|
|
1610
1521
|
direction: "row",
|
|
1611
|
-
onScroll:
|
|
1612
|
-
onTouchEnd:
|
|
1613
|
-
onTouchMove:
|
|
1522
|
+
onScroll: q,
|
|
1523
|
+
onTouchEnd: J,
|
|
1524
|
+
onTouchMove: ee,
|
|
1614
1525
|
onTouchStart: Y,
|
|
1615
1526
|
ref: s,
|
|
1616
1527
|
sx: {
|
|
1617
1528
|
alignItems: "center",
|
|
1618
|
-
height:
|
|
1529
|
+
height: l && "100%",
|
|
1619
1530
|
gap: 8,
|
|
1620
1531
|
listStyleType: "none",
|
|
1621
1532
|
m: 0,
|
|
1622
|
-
maxWidth:
|
|
1533
|
+
maxWidth: f ? "calc(100% - 32px)" : "100%",
|
|
1623
1534
|
overflowX: "auto",
|
|
1624
1535
|
overflowY: "hidden",
|
|
1625
1536
|
p: 0,
|
|
@@ -1631,48 +1542,48 @@ const U = u.createContext(null), nt = ({
|
|
|
1631
1542
|
}
|
|
1632
1543
|
},
|
|
1633
1544
|
children: /* @__PURE__ */ e(
|
|
1634
|
-
|
|
1545
|
+
vt,
|
|
1635
1546
|
{
|
|
1636
|
-
activeCardIndex:
|
|
1637
|
-
beats:
|
|
1547
|
+
activeCardIndex: D,
|
|
1548
|
+
beats: o,
|
|
1638
1549
|
cardWidth: y,
|
|
1639
|
-
heightOverrides:
|
|
1640
|
-
onCardClick:
|
|
1550
|
+
heightOverrides: l,
|
|
1551
|
+
onCardClick: n,
|
|
1641
1552
|
posthog: a,
|
|
1642
|
-
showCTAColocatedWithText:
|
|
1643
|
-
showIcon:
|
|
1644
|
-
variant:
|
|
1553
|
+
showCTAColocatedWithText: r,
|
|
1554
|
+
showIcon: p,
|
|
1555
|
+
variant: E
|
|
1645
1556
|
}
|
|
1646
1557
|
)
|
|
1647
1558
|
}
|
|
1648
1559
|
),
|
|
1649
|
-
|
|
1650
|
-
|
|
1560
|
+
h && /* @__PURE__ */ e(
|
|
1561
|
+
It,
|
|
1651
1562
|
{
|
|
1652
|
-
currentBeatIndex:
|
|
1653
|
-
numBeats:
|
|
1654
|
-
onNextClick:
|
|
1655
|
-
onPreviousClick:
|
|
1656
|
-
scrollRightBoundary:
|
|
1657
|
-
scrollX:
|
|
1658
|
-
shouldApplyDotAnimation:
|
|
1659
|
-
visibleCardsCount:
|
|
1563
|
+
currentBeatIndex: D + d - 1,
|
|
1564
|
+
numBeats: o.length + 1,
|
|
1565
|
+
onNextClick: $,
|
|
1566
|
+
onPreviousClick: j,
|
|
1567
|
+
scrollRightBoundary: Ve,
|
|
1568
|
+
scrollX: C,
|
|
1569
|
+
shouldApplyDotAnimation: t,
|
|
1570
|
+
visibleCardsCount: d
|
|
1660
1571
|
}
|
|
1661
1572
|
)
|
|
1662
1573
|
]
|
|
1663
1574
|
}
|
|
1664
1575
|
);
|
|
1665
|
-
},
|
|
1576
|
+
}, At = Z(yt), Mt = ({
|
|
1666
1577
|
analyticsMetadata: i,
|
|
1667
|
-
onCardClick:
|
|
1668
|
-
posthog:
|
|
1669
|
-
widthOverrides:
|
|
1578
|
+
onCardClick: t,
|
|
1579
|
+
posthog: o,
|
|
1580
|
+
widthOverrides: r
|
|
1670
1581
|
}) => {
|
|
1671
|
-
const { carouselCopy:
|
|
1672
|
-
|
|
1582
|
+
const { carouselCopy: l } = H(), { onEvent: n } = K(), a = () => {
|
|
1583
|
+
n && (n(v.ON_VIEW_MORE_CLICKED, i), t(), o?.capture("clicked_view_more"));
|
|
1673
1584
|
};
|
|
1674
|
-
return
|
|
1675
|
-
|
|
1585
|
+
return l ? /* @__PURE__ */ _(
|
|
1586
|
+
S,
|
|
1676
1587
|
{
|
|
1677
1588
|
alignItems: "center",
|
|
1678
1589
|
direction: "row",
|
|
@@ -1680,125 +1591,122 @@ const U = u.createContext(null), nt = ({
|
|
|
1680
1591
|
spacing: 2,
|
|
1681
1592
|
sx: {
|
|
1682
1593
|
padding: 16,
|
|
1683
|
-
width:
|
|
1594
|
+
width: r || void 0
|
|
1684
1595
|
},
|
|
1685
1596
|
children: [
|
|
1686
1597
|
/* @__PURE__ */ e(
|
|
1687
|
-
|
|
1598
|
+
He,
|
|
1688
1599
|
{
|
|
1689
|
-
sx: (
|
|
1690
|
-
color:
|
|
1600
|
+
sx: (h) => ({
|
|
1601
|
+
color: h.palette.primary.main,
|
|
1691
1602
|
fontSize: 18,
|
|
1692
1603
|
fontWeight: 700,
|
|
1693
1604
|
lineHeight: "24px"
|
|
1694
1605
|
}),
|
|
1695
1606
|
variant: "h3",
|
|
1696
|
-
children:
|
|
1607
|
+
children: l.carousel_title
|
|
1697
1608
|
}
|
|
1698
1609
|
),
|
|
1699
1610
|
/* @__PURE__ */ e(
|
|
1700
|
-
|
|
1611
|
+
oe,
|
|
1701
1612
|
{
|
|
1702
|
-
endIcon: /* @__PURE__ */ e(
|
|
1613
|
+
endIcon: /* @__PURE__ */ e(Ie, { size: 20 }),
|
|
1703
1614
|
onClick: a,
|
|
1704
1615
|
size: "small",
|
|
1705
|
-
sx: (
|
|
1706
|
-
color:
|
|
1616
|
+
sx: (h) => ({
|
|
1617
|
+
color: h.palette.primary.main
|
|
1707
1618
|
}),
|
|
1708
1619
|
variant: "text",
|
|
1709
|
-
children:
|
|
1620
|
+
children: l.view_all_insights_in_full_feed_cta_aria
|
|
1710
1621
|
}
|
|
1711
1622
|
)
|
|
1712
1623
|
]
|
|
1713
1624
|
}
|
|
1714
|
-
) : /* @__PURE__ */ e(
|
|
1715
|
-
},
|
|
1625
|
+
) : /* @__PURE__ */ e(Pe, {});
|
|
1626
|
+
}, St = Z(Mt), Ot = ({
|
|
1716
1627
|
heightOverrides: i,
|
|
1717
|
-
widthOverrides:
|
|
1718
|
-
children:
|
|
1628
|
+
widthOverrides: t,
|
|
1629
|
+
children: o
|
|
1719
1630
|
}) => {
|
|
1720
|
-
const { carouselCopy:
|
|
1631
|
+
const { carouselCopy: r } = H();
|
|
1721
1632
|
return /* @__PURE__ */ e(
|
|
1722
|
-
|
|
1633
|
+
X,
|
|
1723
1634
|
{
|
|
1724
|
-
"aria-label":
|
|
1635
|
+
"aria-label": r?.carousel_title,
|
|
1725
1636
|
"aria-roledescription": "carousel",
|
|
1726
1637
|
role: "group",
|
|
1727
1638
|
sx: {
|
|
1728
1639
|
boxSizing: "border-box",
|
|
1729
1640
|
height: i ? void 0 : "100%",
|
|
1730
1641
|
m: "0 auto",
|
|
1731
|
-
width:
|
|
1642
|
+
width: t ? void 0 : "100%"
|
|
1732
1643
|
},
|
|
1733
|
-
children:
|
|
1644
|
+
children: o
|
|
1734
1645
|
}
|
|
1735
1646
|
);
|
|
1736
|
-
},
|
|
1647
|
+
}, xe = ({
|
|
1737
1648
|
ariaLabel: i,
|
|
1738
|
-
heightOverrides:
|
|
1739
|
-
onCardClick:
|
|
1740
|
-
posthog:
|
|
1741
|
-
|
|
1742
|
-
variant: r
|
|
1649
|
+
heightOverrides: t,
|
|
1650
|
+
onCardClick: o,
|
|
1651
|
+
posthog: r,
|
|
1652
|
+
variant: l
|
|
1743
1653
|
}) => {
|
|
1744
|
-
const { cardsCopy:
|
|
1654
|
+
const { cardsCopy: n } = H(), { onEvent: a } = K(), { onPageview: h } = We();
|
|
1745
1655
|
u.useEffect(() => {
|
|
1746
|
-
h(
|
|
1656
|
+
h(F.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
|
|
1747
1657
|
}, []);
|
|
1748
|
-
const
|
|
1749
|
-
|
|
1658
|
+
const p = () => {
|
|
1659
|
+
o && o(), a(v.ON_NO_RELEVANT_INSIGHTS_CLICKED), r?.capture("clicked_insight", {
|
|
1750
1660
|
template: "no_relevant_insights"
|
|
1751
1661
|
});
|
|
1752
1662
|
};
|
|
1753
1663
|
return /* @__PURE__ */ e(
|
|
1754
|
-
|
|
1664
|
+
Q,
|
|
1755
1665
|
{
|
|
1756
|
-
actionText: a.micro_card_cta,
|
|
1757
1666
|
ariaLabel: i,
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
icon: /* @__PURE__ */ e(Me, {}),
|
|
1761
|
-
isZeroState: !0,
|
|
1762
|
-
onCardClick: C,
|
|
1763
|
-
posthog: l,
|
|
1764
|
-
showIcon: n,
|
|
1765
|
-
style: {
|
|
1766
|
-
linkTextStyle: {
|
|
1767
|
-
ml: 48
|
|
1768
|
-
}
|
|
1667
|
+
cardSx: {
|
|
1668
|
+
borderRadius: 2
|
|
1769
1669
|
},
|
|
1770
|
-
|
|
1771
|
-
|
|
1670
|
+
description: n.no_relevant_insights_card_description,
|
|
1671
|
+
hasCardEffect: !0,
|
|
1672
|
+
heightOverrides: t,
|
|
1673
|
+
icon: /* @__PURE__ */ e(Te, {}),
|
|
1674
|
+
onCardClick: p,
|
|
1675
|
+
onPrimaryAction: p,
|
|
1676
|
+
primaryActionText: n.micro_card_cta,
|
|
1677
|
+
title: n.no_relevant_insights_card_title,
|
|
1678
|
+
variant: l
|
|
1772
1679
|
}
|
|
1773
1680
|
);
|
|
1774
|
-
},
|
|
1681
|
+
}, ii = Z(xe), De = ({
|
|
1775
1682
|
ariaLabel: i,
|
|
1776
|
-
heightOverrides:
|
|
1777
|
-
onCardClick:
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
variant: r
|
|
1683
|
+
heightOverrides: t,
|
|
1684
|
+
onCardClick: o,
|
|
1685
|
+
showIcon: r,
|
|
1686
|
+
variant: l
|
|
1781
1687
|
}) => {
|
|
1782
|
-
const { onPageview:
|
|
1688
|
+
const { onPageview: n } = We(), { zeroStateCopy: a } = H();
|
|
1783
1689
|
return u.useEffect(() => {
|
|
1784
|
-
|
|
1690
|
+
n(F.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
|
|
1785
1691
|
}, []), /* @__PURE__ */ e(
|
|
1786
|
-
|
|
1692
|
+
Q,
|
|
1787
1693
|
{
|
|
1788
1694
|
ariaLabel: i,
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1695
|
+
cardSx: {
|
|
1696
|
+
borderRadius: 2
|
|
1697
|
+
},
|
|
1698
|
+
description: a.carousel_zero_state_description,
|
|
1699
|
+
hasCardEffect: !0,
|
|
1700
|
+
heightOverrides: t,
|
|
1701
|
+
icon: /* @__PURE__ */ e(Te, {}),
|
|
1702
|
+
onCardClick: o,
|
|
1703
|
+
showIcon: r,
|
|
1704
|
+
title: a.carousel_zero_state_title,
|
|
1705
|
+
variant: l
|
|
1798
1706
|
}
|
|
1799
1707
|
);
|
|
1800
|
-
},
|
|
1801
|
-
|
|
1708
|
+
}, oi = Z(De), Tt = () => /* @__PURE__ */ e(
|
|
1709
|
+
X,
|
|
1802
1710
|
{
|
|
1803
1711
|
sx: {
|
|
1804
1712
|
alignItems: "center",
|
|
@@ -1807,163 +1715,166 @@ const U = u.createContext(null), nt = ({
|
|
|
1807
1715
|
justifyContent: "center",
|
|
1808
1716
|
width: "100%"
|
|
1809
1717
|
},
|
|
1810
|
-
children: /* @__PURE__ */ e(
|
|
1718
|
+
children: /* @__PURE__ */ e($e, {})
|
|
1811
1719
|
}
|
|
1812
|
-
),
|
|
1720
|
+
), k = new nt(), Wt = ({
|
|
1813
1721
|
allowSingleCardPeeking: i,
|
|
1814
|
-
areBeatsLoading:
|
|
1815
|
-
beats:
|
|
1722
|
+
areBeatsLoading: t,
|
|
1723
|
+
beats: o = [],
|
|
1816
1724
|
// This also determines the length of the carousel controls (beat.length + 1)
|
|
1817
|
-
showCTAColocatedWithText:
|
|
1818
|
-
endpoint:
|
|
1819
|
-
heightOverrides:
|
|
1725
|
+
showCTAColocatedWithText: r = !0,
|
|
1726
|
+
endpoint: l = "/",
|
|
1727
|
+
heightOverrides: n,
|
|
1820
1728
|
logOutUser: a,
|
|
1821
|
-
onCardClick:
|
|
1729
|
+
onCardClick: h = () => {
|
|
1822
1730
|
},
|
|
1823
|
-
onEvent:
|
|
1731
|
+
onEvent: p = () => {
|
|
1824
1732
|
},
|
|
1825
|
-
onPageview:
|
|
1733
|
+
onPageview: f = () => {
|
|
1826
1734
|
},
|
|
1827
|
-
posthog:
|
|
1828
|
-
showBorder:
|
|
1829
|
-
showCarouselControls:
|
|
1735
|
+
posthog: E,
|
|
1736
|
+
showBorder: c = !0,
|
|
1737
|
+
showCarouselControls: d,
|
|
1830
1738
|
showHeader: s,
|
|
1831
|
-
showIcon:
|
|
1832
|
-
showWithMargin:
|
|
1833
|
-
token:
|
|
1834
|
-
userHasFullInsightFeedBeats:
|
|
1835
|
-
variant:
|
|
1836
|
-
visibleCardsCount:
|
|
1739
|
+
showIcon: R,
|
|
1740
|
+
showWithMargin: C = !0,
|
|
1741
|
+
token: g = "",
|
|
1742
|
+
userHasFullInsightFeedBeats: m,
|
|
1743
|
+
variant: x,
|
|
1744
|
+
visibleCardsCount: O = 1,
|
|
1837
1745
|
widthOverrides: T
|
|
1838
1746
|
}) => {
|
|
1839
|
-
const [y,
|
|
1840
|
-
|
|
1747
|
+
const [y, A] = te("STANDARD"), [B, b] = te(!1), [$, j] = te(!1), q = Ye([p], k), J = Xe([f], k);
|
|
1748
|
+
Qe({
|
|
1841
1749
|
widgetName: "InsightsMicroWidget",
|
|
1842
|
-
isLoaded:
|
|
1750
|
+
isLoaded: B
|
|
1843
1751
|
}), u.useEffect(() => {
|
|
1844
|
-
!
|
|
1845
|
-
}, [
|
|
1846
|
-
const
|
|
1847
|
-
|
|
1752
|
+
!k.isInitialized && !$ && (k.initialize(l, g, a).catch(() => j(!1)), j(!0));
|
|
1753
|
+
}, [l, g, a, k.isInitialized, $]), u.useEffect(() => {
|
|
1754
|
+
const D = window.innerHeight;
|
|
1755
|
+
D < 180 ? A("STANDARD") : D >= 180 && D < 200 ? A("LARGE") : D >= 200 && D < 248 ? A("XLARGE") : D >= 248 && A("XXLARGE");
|
|
1848
1756
|
}, [window.innerHeight]), u.useEffect(() => {
|
|
1849
|
-
|
|
1850
|
-
}, [
|
|
1851
|
-
const
|
|
1852
|
-
showCTAColocatedWithText:
|
|
1853
|
-
heightOverrides:
|
|
1854
|
-
onCardClick:
|
|
1855
|
-
posthog:
|
|
1856
|
-
showIcon:
|
|
1857
|
-
showWithMargin:
|
|
1757
|
+
b(!t && k.isInitialized);
|
|
1758
|
+
}, [t, k.isInitialized]);
|
|
1759
|
+
const ee = {
|
|
1760
|
+
showCTAColocatedWithText: r,
|
|
1761
|
+
heightOverrides: n,
|
|
1762
|
+
onCardClick: h,
|
|
1763
|
+
posthog: E,
|
|
1764
|
+
showIcon: R,
|
|
1765
|
+
showWithMargin: C,
|
|
1858
1766
|
widthOverrides: T
|
|
1859
1767
|
}, Y = {
|
|
1860
1768
|
carouselSize: y,
|
|
1861
|
-
variant:
|
|
1862
|
-
showCTAColocatedWithText:
|
|
1863
|
-
heightOverrides:
|
|
1864
|
-
onCardClick:
|
|
1865
|
-
posthog:
|
|
1866
|
-
showIcon:
|
|
1769
|
+
variant: x,
|
|
1770
|
+
showCTAColocatedWithText: r,
|
|
1771
|
+
heightOverrides: n,
|
|
1772
|
+
onCardClick: h,
|
|
1773
|
+
posthog: E,
|
|
1774
|
+
showIcon: R
|
|
1867
1775
|
};
|
|
1868
|
-
return /* @__PURE__ */ e(
|
|
1869
|
-
!
|
|
1870
|
-
|
|
1871
|
-
|
|
1776
|
+
return /* @__PURE__ */ e(at, { onEvent: q, onPageview: J, store: k, children: /* @__PURE__ */ _(Ot, { heightOverrides: n, widthOverrides: T, children: [
|
|
1777
|
+
!B && /* @__PURE__ */ e(Tt, {}),
|
|
1778
|
+
B && s && /* @__PURE__ */ e(
|
|
1779
|
+
St,
|
|
1872
1780
|
{
|
|
1873
|
-
analyticsMetadata:
|
|
1874
|
-
onCardClick:
|
|
1875
|
-
posthog:
|
|
1781
|
+
analyticsMetadata: _e,
|
|
1782
|
+
onCardClick: h,
|
|
1783
|
+
posthog: E,
|
|
1876
1784
|
widthOverrides: T
|
|
1877
1785
|
}
|
|
1878
1786
|
),
|
|
1879
|
-
|
|
1880
|
-
|
|
1787
|
+
B && !!o.length && /* @__PURE__ */ e(
|
|
1788
|
+
At,
|
|
1881
1789
|
{
|
|
1882
1790
|
allowSingleCardPeeking: i,
|
|
1883
|
-
analyticsMetadata:
|
|
1884
|
-
beats:
|
|
1885
|
-
showCarouselControls:
|
|
1886
|
-
variant:
|
|
1887
|
-
visibleCardsCount:
|
|
1888
|
-
...
|
|
1791
|
+
analyticsMetadata: _e,
|
|
1792
|
+
beats: o,
|
|
1793
|
+
showCarouselControls: d,
|
|
1794
|
+
variant: c ? x : void 0,
|
|
1795
|
+
visibleCardsCount: O,
|
|
1796
|
+
...ee
|
|
1889
1797
|
}
|
|
1890
1798
|
),
|
|
1891
|
-
|
|
1892
|
-
|
|
1799
|
+
B && !o.length && /* @__PURE__ */ e(
|
|
1800
|
+
S,
|
|
1893
1801
|
{
|
|
1894
1802
|
sx: {
|
|
1895
1803
|
alignItems: "center",
|
|
1896
|
-
height:
|
|
1804
|
+
height: n,
|
|
1897
1805
|
width: T || "100%"
|
|
1898
1806
|
},
|
|
1899
1807
|
children: /* @__PURE__ */ e(
|
|
1900
|
-
|
|
1808
|
+
S,
|
|
1901
1809
|
{
|
|
1902
1810
|
sx: {
|
|
1903
|
-
height: `calc(${
|
|
1904
|
-
width:
|
|
1811
|
+
height: `calc(${Ct[y]}px - 44px)`,
|
|
1812
|
+
width: C ? `calc(${T}px - 32px)` : "100%"
|
|
1905
1813
|
},
|
|
1906
|
-
children:
|
|
1814
|
+
children: m ? /* @__PURE__ */ e(xe, { ...Y }) : /* @__PURE__ */ e(De, { ...Y })
|
|
1907
1815
|
}
|
|
1908
1816
|
)
|
|
1909
1817
|
}
|
|
1910
1818
|
)
|
|
1911
1819
|
] }) });
|
|
1912
|
-
},
|
|
1913
|
-
|
|
1914
|
-
ariaLabel: o,
|
|
1820
|
+
}, ri = Z(Wt), wt = ({
|
|
1821
|
+
ariaLabel: i,
|
|
1915
1822
|
heightOverrides: t,
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1823
|
+
isActiveCard: o,
|
|
1824
|
+
onCardClick: r,
|
|
1825
|
+
posthog: l,
|
|
1826
|
+
widthOverrides: n,
|
|
1827
|
+
showIcon: a,
|
|
1828
|
+
variant: h
|
|
1921
1829
|
}) => {
|
|
1922
|
-
const
|
|
1923
|
-
threshold:
|
|
1924
|
-
}), { cardsCopy:
|
|
1925
|
-
|
|
1926
|
-
|
|
1830
|
+
const p = le(), { ref: f, inView: E } = ve({
|
|
1831
|
+
threshold: we
|
|
1832
|
+
}), { cardsCopy: c } = H(), { onEvent: d } = K();
|
|
1833
|
+
ie(() => {
|
|
1834
|
+
E && (d(Oe.ON_VIEW_MORE_VIEWED), l?.capture("viewed_insight", {
|
|
1927
1835
|
template: "view_more_card"
|
|
1928
1836
|
}));
|
|
1929
|
-
}, [
|
|
1837
|
+
}, [E]);
|
|
1930
1838
|
const s = () => {
|
|
1931
|
-
|
|
1839
|
+
r && r(), d(v.ON_VIEW_MORE_CLICKED), l?.capture("clicked_insight", {
|
|
1932
1840
|
template: "view_more_card"
|
|
1933
1841
|
});
|
|
1934
1842
|
};
|
|
1935
1843
|
return /* @__PURE__ */ e(
|
|
1936
|
-
|
|
1844
|
+
Q,
|
|
1937
1845
|
{
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1846
|
+
ariaLabel: i,
|
|
1847
|
+
cardSx: {
|
|
1848
|
+
borderRadius: 2
|
|
1849
|
+
},
|
|
1850
|
+
description: c.view_more_card_description,
|
|
1851
|
+
hasCardEffect: !0,
|
|
1941
1852
|
heightOverrides: t,
|
|
1942
|
-
icon: /* @__PURE__ */ e(
|
|
1943
|
-
isActiveCard:
|
|
1853
|
+
icon: /* @__PURE__ */ e(w, { bgColor: W(p.palette.primary.main, 0.15), name: "show_chart" }),
|
|
1854
|
+
isActiveCard: o,
|
|
1944
1855
|
onCardClick: s,
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1856
|
+
onPrimaryAction: s,
|
|
1857
|
+
primaryActionText: c.micro_card_cta,
|
|
1858
|
+
ref: f,
|
|
1859
|
+
showIcon: a,
|
|
1860
|
+
title: c.view_more_card_title,
|
|
1861
|
+
variant: h,
|
|
1862
|
+
widthOverrides: n
|
|
1951
1863
|
}
|
|
1952
1864
|
);
|
|
1953
|
-
},
|
|
1865
|
+
}, xt = Z(wt);
|
|
1954
1866
|
export {
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
Me as e
|
|
1867
|
+
nt as A,
|
|
1868
|
+
St as C,
|
|
1869
|
+
at as I,
|
|
1870
|
+
At as M,
|
|
1871
|
+
ii as N,
|
|
1872
|
+
_e as T,
|
|
1873
|
+
xt as V,
|
|
1874
|
+
oi as Z,
|
|
1875
|
+
gt as a,
|
|
1876
|
+
ri as b,
|
|
1877
|
+
Et as c,
|
|
1878
|
+
Te as d,
|
|
1879
|
+
Q as e
|
|
1969
1880
|
};
|