@mx-cartographer/experiences 8.2.3 → 8.2.4

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