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