@mx-cartographer/experiences 7.4.0 → 7.4.2

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