@mx-cartographer/experiences 8.0.0-alpha.sms2 → 9.0.0-alpha.mega1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/CHANGELOG.md +217 -0
  2. package/dist/{Account-Cp30A3ad.mjs → Account-BIKn4XEZ.mjs} +1 -1
  3. package/dist/Account-CMjOp7S2.mjs +118 -0
  4. package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
  5. package/dist/AccountDetailsHeader-BOV91g1o.mjs +95 -0
  6. package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
  7. package/dist/{AccountFields-CW6cIthP.mjs → AccountFields-BRRH37K1.mjs} +10 -11
  8. package/dist/{AccountListItem-DxmAs98Z.mjs → AccountListItem-Ds5C0mOT.mjs} +4 -4
  9. package/dist/{AccountStore-hIs-yA6W.mjs → AccountStore-BFKvXJSD.mjs} +79 -69
  10. package/dist/{Accounts-DUHkUyK4.mjs → Accounts-CuE8aSZN.mjs} +1 -1
  11. package/dist/{BudgetUtil-CIDAPPPT.mjs → BudgetUtil-CDSOZXem.mjs} +4 -4
  12. package/dist/CategorySelectorDrawer-C4aZYP4N.mjs +418 -0
  13. package/dist/CategoryStore-DEqAnHbi.mjs +186 -0
  14. package/dist/{CategoryUtil-DfVKKkRf.mjs → CategoryUtil-CFHBvaV4.mjs} +1 -1
  15. package/dist/{ConnectionsDrawer-CSo6AFkG.mjs → ConnectionsDrawer-BExzgE16.mjs} +5 -5
  16. package/dist/{CurrencyInput-BrGvhgVK.mjs → CurrencyInput-DDQ4DBrE.mjs} +1 -1
  17. package/dist/{CurrencyText-Dr0EZ7bp.mjs → CurrencyText-C-85TnUF.mjs} +3 -3
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CVsMhbZU.mjs} +3 -3
  19. package/dist/{DebtsStore-hi1cqrRk.mjs → DebtsStore-Dv_T7Dts.mjs} +12 -12
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-CWymUiuO.mjs} +32 -35
  21. package/dist/Drawer-Bet2ZPJo.mjs +176 -0
  22. package/dist/{ExportCsvAction-CQ1grpwo.mjs → ExportCsvAction-oG_Mn66T.mjs} +3 -3
  23. package/dist/{FinstrongStore-dKZOZ2hM.mjs → FinstrongStore-BjFkMTIL.mjs} +6 -6
  24. package/dist/GlobalAccountFilter-BpWlPAl5.mjs +316 -0
  25. package/dist/{GoalStore-CFeAJloA.mjs → GoalStore-Dbjgft2i.mjs} +155 -137
  26. package/dist/{Help-i4OasOO-.mjs → Help-BW_ar-4B.mjs} +2 -2
  27. package/dist/LineChart-DHj-Bufi.mjs +580 -0
  28. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-Cbr3417C.mjs} +10 -10
  29. package/dist/{ManageIncome-D_qVX5dN.mjs → ManageIncome-DIIyqDTp.mjs} +85 -85
  30. package/dist/{MicroWidgetContainer-BGpNl5ZS.mjs → MicroWidgetContainer-DSyYwRCU.mjs} +2 -2
  31. package/dist/{MiniWidgetContainer-D7MkHG15.mjs → MiniWidgetContainer-DKn7ndO6.mjs} +1 -1
  32. package/dist/NetWorthStore-B6ziBtaH.mjs +168 -0
  33. package/dist/NotificationSettings-e789PcRb.mjs +676 -0
  34. package/dist/{OriginalBalanceAction-62e0mU_3.mjs → OriginalBalanceAction-DFoG79Ba.mjs} +3 -3
  35. package/dist/{RecurringSettings-RfZ8Wuhh.mjs → RecurringSettings-BpCUcE8w.mjs} +4 -4
  36. package/dist/{RecurringTransactionsStore-D3EOKZ2B.mjs → RecurringTransactionsStore-D_--5PWH.mjs} +1 -1
  37. package/dist/{RecurringTransactions-Bhx56aA3.mjs → RepeatingTransaction-C2txVA9O.mjs} +3 -3
  38. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-CInvh-rQ.mjs} +1 -1
  39. package/dist/SpendingData-B7NuTQ9s.mjs +53 -0
  40. package/dist/SpendingLegend-BxefXiQd.mjs +193 -0
  41. package/dist/TransactionDetails-CPwv9xtZ.mjs +1374 -0
  42. package/dist/{TransactionStore-DgLrYW4C.mjs → TransactionStore-D2aMUClq.mjs} +128 -111
  43. package/dist/TrendsStore-BdsYfCc7.mjs +183 -0
  44. package/dist/{User-DqNX2GAK.mjs → User-CulNdZUr.mjs} +21 -20
  45. package/dist/ViewMoreMicroCard-CDWR16_h.mjs +1147 -0
  46. package/dist/WidgetContainer-mzejMmz2.mjs +555 -0
  47. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +1 -0
  48. package/dist/accounts/index.es.js +933 -232
  49. package/dist/accounts/stores/AccountStore.d.ts +6 -2
  50. package/dist/accounts/utils/AccountDetails.d.ts +5 -0
  51. package/dist/analytics/index.es.js +2 -2
  52. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  53. package/dist/budgets/index.es.js +561 -522
  54. package/dist/cashflow/index.es.js +397 -396
  55. package/dist/categories/components/CustomCategories/AddSubcategory.d.ts +1 -0
  56. package/dist/categories/components/CustomCategories/DeleteSubcategory.d.ts +1 -0
  57. package/dist/categories/components/CustomCategories/RenameSubcategory.d.ts +1 -0
  58. package/dist/categories/components/SubcategoryRow.d.ts +1 -0
  59. package/dist/categories/index.es.js +2 -2
  60. package/dist/categories/stores/CategoryStore.d.ts +5 -3
  61. package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
  62. package/dist/common/components/WidgetContainer.d.ts +7 -6
  63. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  64. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  65. package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
  66. package/dist/common/components/index.d.ts +2 -2
  67. package/dist/common/hooks/index.d.ts +1 -0
  68. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  69. package/dist/common/index.es.js +325 -306
  70. package/dist/common/stores/GlobalUiStore.d.ts +7 -4
  71. package/dist/common/types/localization/AccountsCopy.d.ts +6 -0
  72. package/dist/common/types/localization/CategoryCopy.d.ts +3 -0
  73. package/dist/common/types/localization/CommonCopy.d.ts +3 -0
  74. package/dist/common/types/localization/GoalsCopy.d.ts +3 -1
  75. package/dist/common/types/localization/MicroInsightsCopy.d.ts +1 -0
  76. package/dist/common/types/localization/TransactionsCopy.d.ts +4 -0
  77. package/dist/common/types/localization/TrendsCopy.d.ts +4 -0
  78. package/dist/dashboard/index.es.js +95 -125
  79. package/dist/debts/index.es.js +466 -460
  80. package/dist/{exportTransactionsToCSV-BFpuIAXW.mjs → exportTransactionsToCSV-BU1jTY0Q.mjs} +4 -4
  81. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  82. package/dist/finstrong/index.es.js +1660 -1553
  83. package/dist/goals/index.es.js +716 -677
  84. package/dist/goals/stores/GoalStore.d.ts +2 -0
  85. package/dist/help/index.es.js +14 -10
  86. package/dist/{hooks-C41HAxM5.mjs → hooks-fY_n74f7.mjs} +16 -16
  87. package/dist/investments/index.es.js +464 -457
  88. package/dist/merchants/index.es.js +1 -1
  89. package/dist/microinsights/MicroCardTemplate.d.ts +23 -0
  90. package/dist/microinsights/beaticons/BeatMaterialIcon.d.ts +8 -0
  91. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +1 -2
  92. package/dist/microinsights/beaticons/index.d.ts +1 -0
  93. package/dist/microinsights/cards/InsightCard.d.ts +0 -2
  94. package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +2 -5
  95. package/dist/microinsights/index.d.ts +2 -2
  96. package/dist/microinsights/index.es.js +824 -14
  97. package/dist/networth/components/NetWorthChart.d.ts +3 -2
  98. package/dist/networth/components/NetWorthList.d.ts +3 -3
  99. package/dist/networth/index.es.js +433 -438
  100. package/dist/networth/stores/NetWorthStore.d.ts +20 -9
  101. package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
  102. package/dist/notifications/index.es.js +5 -5
  103. package/dist/recurringtransactions/index.es.js +331 -325
  104. package/dist/settings/index.es.js +293 -285
  105. package/dist/spending/components/SpendingChart.d.ts +1 -1
  106. package/dist/spending/components/SpendingList.d.ts +1 -1
  107. package/dist/spending/components/SpendingTabLabel.d.ts +1 -0
  108. package/dist/spending/index.es.js +250 -235
  109. package/dist/transactions/index.es.js +288 -281
  110. package/dist/transactions/stores/TransactionStore.d.ts +5 -0
  111. package/dist/trends/components/TrendsTable.d.ts +0 -2
  112. package/dist/trends/index.es.js +876 -802
  113. package/dist/trends/utils/TrendsData.d.ts +1 -0
  114. package/dist/trends/utils/TrendsTable.d.ts +12 -0
  115. package/dist/{useAccountDisplayName-usSZCQ7I.mjs → useAccountDisplayName-DbkgGLdg.mjs} +2 -2
  116. package/dist/useAriaLive-B3_pRUio.mjs +35 -0
  117. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-dhmXeSyF.mjs} +1 -1
  118. package/dist/useWidgetLoadTimer-CrUzxN-P.mjs +19 -0
  119. package/package.json +26 -21
  120. package/dist/AccountDetailsContent-C1HumFnW.mjs +0 -683
  121. package/dist/AccountDetailsHeader-NMx79DGs.mjs +0 -87
  122. package/dist/CategorySelectorDrawer-DqDAA_5I.mjs +0 -399
  123. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  124. package/dist/ConnectDrawer-Dn1MlqLz.mjs +0 -545
  125. package/dist/Drawer-Dqe5EqvA.mjs +0 -163
  126. package/dist/LineChart-bc1D9xBE.mjs +0 -581
  127. package/dist/NetWorthStore-8FFC1Bs0.mjs +0 -150
  128. package/dist/NotificationSettings-BsWiYD94.mjs +0 -672
  129. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  130. package/dist/SpendingLegend-CZzDb-7d.mjs +0 -193
  131. package/dist/TransactionDetails-Duv1X9ec.mjs +0 -1379
  132. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  133. package/dist/ViewMoreMicroCard-CH9E-jOx.mjs +0 -1930
  134. package/dist/WidgetContainer-B1Jzb4XA.mjs +0 -565
  135. package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
  136. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
  137. package/dist/common/components/accountfilter/index.d.ts +0 -1
  138. package/dist/microinsights/cards/BaseCard.d.ts +0 -13
  139. package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
@@ -1,1930 +0,0 @@
1
- import { jsx as e, jsxs as g, Fragment as xe } 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 De 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 Ce } from "@mxenabled/mx-icons";
8
- import { L as ke } from "./Loader-BSWSYqvn.mjs";
9
- import Z from "@mui/material/Box";
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-Ccoew_sA.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 = {
26
- featureVersion: "spendVsIncomeTrends"
27
- };
28
- class qe {
29
- copyApi = new ce("/", "");
30
- copyObject = {};
31
- namespace = "experiences";
32
- translationKey = "micro_insights";
33
- constructor() {
34
- ie(this);
35
- }
36
- // NOTE: Not sure if this is special case, but other stores have this deprecation todo
37
- // DEPRECATED: Initialize api in constructor and use loadCopy instead
38
- // TODO: Remove this function
39
- initialize = async (o, t) => {
40
- this.copyApi = new ce(o, t), await this.loadCopy();
41
- };
42
- loadCopy = async () => {
43
- const o = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
44
- Re(() => {
45
- this.copyObject = o[this.translationKey];
46
- });
47
- };
48
- get cardsCopy() {
49
- return this.copyObject.cards;
50
- }
51
- get carouselCopy() {
52
- return this.copyObject.carousel;
53
- }
54
- get zeroStateCopy() {
55
- return this.copyObject.zero_state;
56
- }
57
- }
58
- const oe = {
59
- BillAmountNotStandard: "BillAmountNotStandard",
60
- CanadianUpcomingDeadlineAlert: "CanadianUpcomingDeadlineAlert",
61
- DuplicatePaymentV2: "DuplicatePaymentV2",
62
- IntroducePulse: "IntroducePulse",
63
- LargeTransaction: "LargeTransaction",
64
- MonthlySpendToIncomeComparisonV2: "MonthlySpendToIncomeComparisonV2",
65
- QuarterlySummary: "QuarterlySummary",
66
- SpendingPlanCategorySpending: "SpendingPlanCategorySpending",
67
- SubscriptionPriceIncrease: "SubscriptionPriceIncrease",
68
- UncategorizedTransactionsV2: "UncategorizedTransactionsV2",
69
- UpcomingBill: "UpcomingBill",
70
- UnifiedDeposit: "UnifiedDeposit",
71
- WeeklySpendingPlanSummary: "WeeklySpendingPlanSummary",
72
- WeeklyNewMerchantsV2: "WeeklyNewMerchantsV2",
73
- MonthlySpendComparison: "MonthlySpendComparison",
74
- MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
75
- }, v = window?.app?.clientConfig?.microwidget_instance_id || "", he = {
76
- INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
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(
78
- (i, o) => ({
79
- ...i,
80
- [ge(o)]: {
81
- action: L.MICRO_BEAT_CLICKED,
82
- category: D.BEAT_INTERACTION,
83
- label: le(o),
84
- value: v
85
- }
86
- }),
87
- {}
88
- ), et = () => Object.values(oe).reduce(
89
- (i, o) => ({
90
- ...i,
91
- [Ie(o)]: {
92
- action: L.MICRO_BEAT_DISPLAYED,
93
- category: D.BEAT_INTERACTION,
94
- label: le(o),
95
- value: v
96
- }
97
- }),
98
- {}
99
- ), tt = () => Object.values(oe).reduce(
100
- (i, o) => ({
101
- ...i,
102
- [ye(o)]: {
103
- action: L.MICRO_BEAT_DISPLAYED_FIRST_TIME,
104
- category: D.BEAT_INTERACTION,
105
- label: le(o),
106
- value: v
107
- }
108
- }),
109
- {}
110
- ), x = {
111
- CAROUSEL_CONTROL: "Carousel Control",
112
- MICRO_WIDGET: "Micro Widget",
113
- VIEW_MORE: "View More"
114
- }, D = {
115
- MICRO_WIDGET_INTERACTION: "Micro Widget Interaction",
116
- BEAT_INTERACTION: "Beat Interaction"
117
- }, S = {
118
- ON_CAROUSEL_BACK_CLICK: "onCarouselBackClick",
119
- ON_CAROUSEL_BACK_SWIPE: "onCarouselBackSwipe",
120
- ON_CAROUSEL_FORWARD_CLICK: "onCarouselForwardClick",
121
- ON_CAROUSEL_FORWARD_SWIPE: "onCarouselForwardSwipe",
122
- ON_NO_RELEVANT_INSIGHTS_CLICKED: "onNoRelevantInsightsClicked",
123
- ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
124
- }, ve = {
125
- ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
126
- }, L = {
127
- CONTROL_BACKWARD: "Control Backward",
128
- CONTROL_FORWARD: "Control Forward",
129
- MICRO_BEAT_CLICKED: "Micro Beat Clicked",
130
- MICRO_BEAT_DISPLAYED: "Micro Beat Displayed",
131
- MICRO_BEAT_DISPLAYED_FIRST_TIME: "Micro Beat Displayed For First Time",
132
- SWIPE_BACKWARD: "Swipe Backward",
133
- SWIPE_FORWARD: "Swipe Forward"
134
- }, H = {
135
- MICRO_WIDGET_CAROUSEL: "Micro Widget Carousel",
136
- MICRO_WIDGET_CAROUSEL_ZERO_STATE: "Micro Widget Carousel Zero State",
137
- MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS: "Micro Widget Carousel No Relevant Insights"
138
- }, ue = {
139
- [H.MICRO_WIDGET_CAROUSEL]: {
140
- label: x.MICRO_WIDGET,
141
- name: H.MICRO_WIDGET_CAROUSEL,
142
- path: he.INSIGHTS_MICRO_WIDGET,
143
- value: v
144
- },
145
- // zero state
146
- [H.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
147
- label: x.MICRO_WIDGET,
148
- name: H.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
149
- path: he.INSIGHTS_MICRO_WIDGET,
150
- value: v
151
- },
152
- // no relevant cards
153
- [H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS]: {
154
- label: x.MICRO_WIDGET,
155
- name: H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS,
156
- path: "/micro-widget",
157
- value: v
158
- }
159
- }, pe = {
160
- // carousel control interaction events - clicks and swipes
161
- [S.ON_CAROUSEL_BACK_CLICK]: {
162
- action: L.CONTROL_BACKWARD,
163
- category: D.MICRO_WIDGET_INTERACTION,
164
- label: x.CAROUSEL_CONTROL,
165
- value: v
166
- },
167
- [S.ON_CAROUSEL_FORWARD_CLICK]: {
168
- action: L.CONTROL_FORWARD,
169
- category: D.MICRO_WIDGET_INTERACTION,
170
- label: x.CAROUSEL_CONTROL,
171
- value: v
172
- },
173
- [S.ON_CAROUSEL_BACK_SWIPE]: {
174
- action: L.SWIPE_BACKWARD,
175
- category: D.MICRO_WIDGET_INTERACTION,
176
- label: x.CAROUSEL_CONTROL,
177
- value: v
178
- },
179
- [S.ON_CAROUSEL_FORWARD_SWIPE]: {
180
- action: L.SWIPE_FORWARD,
181
- category: D.MICRO_WIDGET_INTERACTION,
182
- label: x.CAROUSEL_CONTROL,
183
- value: v
184
- },
185
- // read more card events
186
- [S.ON_VIEW_MORE_CLICKED]: {
187
- action: L.MICRO_BEAT_CLICKED,
188
- category: D.BEAT_INTERACTION,
189
- label: x.VIEW_MORE,
190
- value: v
191
- },
192
- [ve.ON_VIEW_MORE_VIEWED]: {
193
- action: L.MICRO_BEAT_DISPLAYED,
194
- category: D.BEAT_INTERACTION,
195
- label: x.VIEW_MORE,
196
- value: v
197
- },
198
- ...Je(),
199
- ...et(),
200
- ...tt()
201
- }, _e = async (i, o) => !o || !pe[i] ? null : o.sendAnalyticEvent(pe[i]).then((t) => t).catch((t) => {
202
- throw t;
203
- }), fe = async (i, o) => !o || !ue[i] ? null : o.sendAnalyticsPageview(ue[i]).then((t) => t).catch((t) => {
204
- throw t;
205
- });
206
- class it {
207
- onAnalyticEvent = _e;
208
- onAnalyticPageView = fe;
209
- beatApi = new de("/", "");
210
- constructor() {
211
- ie(this);
212
- }
213
- initialize = async (o, t, l) => {
214
- this.onAnalyticEvent = (n, r) => {
215
- _e(n, r).then((a) => a).catch((a) => {
216
- throw a.status === 401 && l(), a;
217
- });
218
- }, this.onAnalyticPageView = (n, r) => {
219
- fe(n, r).then((a) => a).catch((a) => {
220
- throw a.status === 401 && l(), a;
221
- });
222
- }, this.beatApi = new de(o, t);
223
- };
224
- updateBeat = async (o) => {
225
- this.beatApi.updateBeat(o);
226
- };
227
- updateOffer = async (o) => {
228
- this.beatApi.updateOffer(o);
229
- };
230
- }
231
- class ot {
232
- copyStore;
233
- endpoint = "/";
234
- insightsMicroWidgetStore;
235
- session = null;
236
- token = "";
237
- isInitialized = !1;
238
- constructor() {
239
- this.copyStore = new qe(), this.insightsMicroWidgetStore = new it(), ie(this);
240
- }
241
- initialize = async (o, t, l) => {
242
- await this.copyStore.initialize(o, t), await this.insightsMicroWidgetStore.initialize(o, t, l);
243
- const n = await ze(o, t, "1.0.0", "Micro Insights Carousel");
244
- Re(() => {
245
- this.session = n, this.isInitialized = !0;
246
- });
247
- };
248
- }
249
- const U = u.createContext(null), lt = ({
250
- onEvent: i,
251
- onPageview: o,
252
- store: t,
253
- children: l
254
- }) => /* @__PURE__ */ e(U.Provider, { value: { onEvent: i, onPageview: o, store: t, children: l }, children: l }), j = u.forwardRef(function({
255
- actionText: o,
256
- ariaLabel: t,
257
- backgroundColor: l,
258
- description: n,
259
- heightOverrides: r,
260
- icon: a,
261
- isActiveCard: c,
262
- isZeroState: h,
263
- onCardClick: f = () => {
264
- },
265
- showIcon: p,
266
- style: d = {},
267
- title: E,
268
- variant: s,
269
- widthOverrides: C
270
- }, _) {
271
- const R = te(), [O, I] = u.useState(!1), { cardStyle: m, linkTextStyle: T } = d, y = s ? m : { border: "none", boxShadow: "none", ...m }, M = /* @__PURE__ */ e(
272
- Be,
273
- {
274
- className: "mx-micro-card-description",
275
- color: "text.primary",
276
- sx: {
277
- display: "-webkit-box",
278
- fontSize: 13,
279
- letterSpacing: 0.48,
280
- lineHeight: "20px",
281
- overflow: "hidden",
282
- pl: h ? 0 : 28,
283
- pr: h ? 0 : 8,
284
- WebkitBoxOrient: "vertical",
285
- WebkitLineClamp: 2,
286
- wordWrap: "break-word"
287
- },
288
- children: n && /* @__PURE__ */ e(
289
- "span",
290
- {
291
- dangerouslySetInnerHTML: { __html: n },
292
- style: { fontFamily: R.typography.fontFamily }
293
- }
294
- )
295
- }
296
- );
297
- return /* @__PURE__ */ e(
298
- Z,
299
- {
300
- "aria-hidden": !c,
301
- "aria-label": t,
302
- "aria-labelledby": "divButton",
303
- "aria-roledescription": "slide",
304
- ref: _,
305
- role: "group",
306
- sx: {
307
- height: "100%",
308
- minWidth: C ? `${C}px` : "100%",
309
- fontFamily: R.typography.fontFamily
310
- },
311
- children: /* @__PURE__ */ e(
312
- Z,
313
- {
314
- "aria-hidden": !c,
315
- "aria-label": t,
316
- id: "divButton",
317
- onClick: () => f(),
318
- onKeyDown: () => I(!1),
319
- onKeyUp: () => I(!0),
320
- ref: _,
321
- role: "button",
322
- sx: {
323
- border: O ? "1px solid rgba(82, 138, 224, 0.8)" : void 0,
324
- borderRadius: "8px",
325
- height: "100%"
326
- },
327
- tabIndex: c ? 0 : -1,
328
- children: /* @__PURE__ */ e(
329
- Ye,
330
- {
331
- "aria-roledescription": "slide",
332
- className: "mx-micro-card",
333
- role: "group",
334
- sx: {
335
- backgroundColor: l,
336
- boxSizing: "border-box",
337
- cursor: "pointer",
338
- height: r ? "100%" : 124,
339
- p: 16,
340
- ...y,
341
- "& .MuiCardHeader-avatar": {
342
- mr: "8px"
343
- }
344
- },
345
- variant: s,
346
- children: /* @__PURE__ */ g(
347
- k,
348
- {
349
- sx: {
350
- alignItems: "space-between",
351
- height: "100%"
352
- },
353
- children: [
354
- /* @__PURE__ */ e(
355
- Qe,
356
- {
357
- avatar: p && a,
358
- subheader: h && M,
359
- sx: { p: 0 },
360
- title: E,
361
- titleTypographyProps: { fontSize: 15, fontWeight: 600, variant: "h3" }
362
- }
363
- ),
364
- /* @__PURE__ */ e(Xe, { sx: { p: 0 }, children: !h && M }),
365
- !!o && /* @__PURE__ */ e(
366
- je,
367
- {
368
- sx: {
369
- mt: "auto",
370
- p: 0
371
- },
372
- children: /* @__PURE__ */ e(
373
- Z,
374
- {
375
- sx: (W) => ({
376
- color: W.palette.primary.main,
377
- fontSize: 14,
378
- fontWeight: "bold",
379
- px: 28,
380
- fontFamily: W.typography.fontFamily,
381
- ...T
382
- }),
383
- children: o
384
- }
385
- )
386
- }
387
- )
388
- ]
389
- }
390
- )
391
- }
392
- )
393
- }
394
- )
395
- }
396
- );
397
- }), nt = ({ beat: i }) => {
398
- const { primary_category_guid: o, category_guids: t } = i, l = o || t?.[0] || be.UNCATEGORIZED;
399
- return /* @__PURE__ */ e(Ze, { categoryGuid: l, size: 16, sx: { minWidth: 16 } });
400
- }, rt = ({ beat: i }) => {
401
- const { category_guids: o, merchant_guids: t, primary_category_guid: l, primary_merchant_guid: n } = i;
402
- return /* @__PURE__ */ e(
403
- Pe,
404
- {
405
- categoryGuid: l || o && o[0] || "",
406
- merchantGuid: n || t[0],
407
- size: 16,
408
- sx: {
409
- display: "flex",
410
- mt: 2
411
- }
412
- }
413
- );
414
- }, at = ({
415
- color: i = "currentColor",
416
- height: o,
417
- size: t = 16,
418
- styles: l,
419
- viewBox: n = "0 0 16 16",
420
- width: r
421
- }) => /* @__PURE__ */ e(
422
- "svg",
423
- {
424
- "aria-hidden": !0,
425
- className: "kyper-icon",
426
- focusable: !1,
427
- height: o || t,
428
- style: l,
429
- viewBox: n,
430
- width: r || t,
431
- xmlns: "http://www.w3.org/2000/svg",
432
- children: /* @__PURE__ */ e(
433
- "path",
434
- {
435
- d: "M16 1.5C16 0.671573 15.3284 0 14.5 0H1.5C0.671573 0 0 0.671573 0 1.5V14.5C0 15.3284 0.671573 16 1.5 16H14.5C15.3284 16 16 15.3284 16 14.5V1.5ZM12.8 5.1C13.0209 5.26568 13.0657 5.57909 12.9 5.8L9.90003 9.8C9.71746 10.0434 9.36163 10.0687 9.14648 9.85355L6.55413 7.2612L3.90003 10.8C3.73434 11.0209 3.42094 11.0657 3.20003 10.9C2.97912 10.7343 2.93434 10.4209 3.10003 10.2L6.10003 6.2C6.28259 5.95658 6.63843 5.93129 6.85358 6.14645L9.44593 8.7388L12.1 5.2C12.2657 4.97908 12.5791 4.93431 12.8 5.1Z",
436
- fill: i
437
- }
438
- )
439
- }
440
- ), st = (i) => i ? i.data ? i.data.map((o) => {
441
- const t = {};
442
- return i.names?.map((l, n) => {
443
- t[l] = o[n];
444
- }), t;
445
- }) : [] : [], ct = (i, o) => {
446
- const t = st(i), l = t.length / 2, n = t.slice(0, l), r = t.slice(l);
447
- 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;
448
- }, dt = ({ beat: i }) => {
449
- const o = te(), t = ct(i.data_series, o);
450
- return /* @__PURE__ */ e(Ve, { sx: { color: t } });
451
- }, Se = () => /* @__PURE__ */ g("svg", { fill: "none", height: "36", viewBox: "0 0 40 36", width: "40", xmlns: "http://www.w3.org/2000/svg", children: [
452
- /* @__PURE__ */ e(
453
- "path",
454
- {
455
- clipRule: "evenodd",
456
- d: "M24.9618 32.6003H9.92084C9.60559 32.6003 9.34766 32.3424 9.34766 32.0271V18.3125C9.34766 17.9972 9.60559 17.7393 9.92084 17.7393H24.9618C25.2771 17.7393 25.535 17.9972 25.535 18.3125V32.0271C25.535 32.3424 25.2771 32.6003 24.9618 32.6003Z",
457
- fill: "#CDD3DD",
458
- fillRule: "evenodd"
459
- }
460
- ),
461
- /* @__PURE__ */ e(
462
- "path",
463
- {
464
- clipRule: "evenodd",
465
- d: "M25.535 18.3124V19.5952H9.34766V18.3124C9.34766 17.9974 9.6055 17.7393 9.92084 17.7393H24.9618C25.2771 17.7393 25.535 17.9974 25.535 18.3124Z",
466
- fill: "#E8F6FF",
467
- fillRule: "evenodd"
468
- }
469
- ),
470
- /* @__PURE__ */ e(
471
- "path",
472
- {
473
- clipRule: "evenodd",
474
- d: "M10.8689 18.7157C10.8689 18.96 10.6709 19.158 10.4266 19.158C10.1824 19.158 9.98438 18.96 9.98438 18.7157C9.98438 18.4714 10.1824 18.2734 10.4266 18.2734C10.6709 18.2734 10.8689 18.4714 10.8689 18.7157Z",
475
- fill: "#C3E4FF",
476
- fillRule: "evenodd"
477
- }
478
- ),
479
- /* @__PURE__ */ e(
480
- "path",
481
- {
482
- clipRule: "evenodd",
483
- d: "M12.2986 18.7157C12.2986 18.96 12.1006 19.158 11.8563 19.158C11.6121 19.158 11.4141 18.96 11.4141 18.7157C11.4141 18.4714 11.6121 18.2734 11.8563 18.2734C12.1006 18.2734 12.2986 18.4714 12.2986 18.7157Z",
484
- fill: "#C3E4FF",
485
- fillRule: "evenodd"
486
- }
487
- ),
488
- /* @__PURE__ */ e(
489
- "path",
490
- {
491
- clipRule: "evenodd",
492
- d: "M13.7263 18.7157C13.7263 18.96 13.5283 19.158 13.2841 19.158C13.0398 19.158 12.8418 18.96 12.8418 18.7157C12.8418 18.4714 13.0398 18.2734 13.2841 18.2734C13.5283 18.2734 13.7263 18.4714 13.7263 18.7157Z",
493
- fill: "#C3E4FF",
494
- fillRule: "evenodd"
495
- }
496
- ),
497
- /* @__PURE__ */ e(
498
- "path",
499
- {
500
- clipRule: "evenodd",
501
- d: "M26.7313 35.6692H11.6904C11.3751 35.6692 11.1172 35.4112 11.1172 35.096V21.3813C11.1172 21.0661 11.3751 20.8081 11.6904 20.8081H26.7313C27.0466 20.8081 27.3045 21.0661 27.3045 21.3813V35.096C27.3045 35.4112 27.0466 35.6692 26.7313 35.6692Z",
502
- fill: "#E4E8EE",
503
- fillRule: "evenodd"
504
- }
505
- ),
506
- /* @__PURE__ */ e(
507
- "path",
508
- {
509
- clipRule: "evenodd",
510
- d: "M27.3045 21.3813V22.6641H11.1172V21.3813C11.1172 21.0662 11.375 20.8081 11.6904 20.8081H26.7313C27.0467 20.8081 27.3045 21.0662 27.3045 21.3813Z",
511
- fill: "#E8F6FF",
512
- fillRule: "evenodd"
513
- }
514
- ),
515
- /* @__PURE__ */ e(
516
- "path",
517
- {
518
- clipRule: "evenodd",
519
- d: "M12.6404 21.7846C12.6404 22.0288 12.4424 22.2268 12.1981 22.2268C11.9539 22.2268 11.7559 22.0288 11.7559 21.7846C11.7559 21.5403 11.9539 21.3423 12.1981 21.3423C12.4424 21.3423 12.6404 21.5403 12.6404 21.7846Z",
520
- fill: "#C3E4FF",
521
- fillRule: "evenodd"
522
- }
523
- ),
524
- /* @__PURE__ */ e(
525
- "path",
526
- {
527
- clipRule: "evenodd",
528
- d: "M14.0701 21.7846C14.0701 22.0288 13.8721 22.2268 13.6278 22.2268C13.3836 22.2268 13.1855 22.0288 13.1855 21.7846C13.1855 21.5403 13.3836 21.3423 13.6278 21.3423C13.8721 21.3423 14.0701 21.5403 14.0701 21.7846Z",
529
- fill: "#C3E4FF",
530
- fillRule: "evenodd"
531
- }
532
- ),
533
- /* @__PURE__ */ e(
534
- "path",
535
- {
536
- clipRule: "evenodd",
537
- d: "M15.4959 21.7846C15.4959 22.0288 15.2979 22.2268 15.0536 22.2268C14.8094 22.2268 14.6113 22.0288 14.6113 21.7846C14.6113 21.5403 14.8094 21.3423 15.0536 21.3423C15.2979 21.3423 15.4959 21.5403 15.4959 21.7846Z",
538
- fill: "#C3E4FF",
539
- fillRule: "evenodd"
540
- }
541
- ),
542
- /* @__PURE__ */ e(
543
- "path",
544
- {
545
- clipRule: "evenodd",
546
- d: "M38.0145 25.175H22.9736C22.6584 25.175 22.4004 24.9171 22.4004 24.6018V10.8871C22.4004 10.5719 22.6584 10.314 22.9736 10.314H38.0145C38.3298 10.314 38.5878 10.5719 38.5878 10.8871V24.6018C38.5878 24.9171 38.3298 25.175 38.0145 25.175Z",
547
- fill: "#EEF1F6",
548
- fillRule: "evenodd"
549
- }
550
- ),
551
- /* @__PURE__ */ e("mask", { height: "3", id: "mask0_1565_98011", maskUnits: "userSpaceOnUse", width: "17", x: "22", y: "10", children: /* @__PURE__ */ e(
552
- "path",
553
- {
554
- clipRule: "evenodd",
555
- d: "M22.4004 10.3022H38.5878V12.1582H22.4004V10.3022Z",
556
- fill: "white",
557
- fillRule: "evenodd"
558
- }
559
- ) }),
560
- /* @__PURE__ */ e("g", { mask: "url(#mask0_1565_98011)", children: /* @__PURE__ */ e(
561
- "path",
562
- {
563
- clipRule: "evenodd",
564
- d: "M38.5878 10.8754V12.1582H22.4004V10.8754C22.4004 10.5604 22.6582 10.3022 22.9736 10.3022H38.0146C38.3299 10.3022 38.5878 10.5604 38.5878 10.8754Z",
565
- fill: "#CDD3DD",
566
- fillRule: "evenodd"
567
- }
568
- ) }),
569
- /* @__PURE__ */ e(
570
- "path",
571
- {
572
- clipRule: "evenodd",
573
- d: "M23.9099 11.2802C23.9099 11.5244 23.7119 11.7224 23.4677 11.7224C23.2234 11.7224 23.0254 11.5244 23.0254 11.2802C23.0254 11.0359 23.2234 10.8379 23.4677 10.8379C23.7119 10.8379 23.9099 11.0359 23.9099 11.2802Z",
574
- fill: "#C3E4FF",
575
- fillRule: "evenodd"
576
- }
577
- ),
578
- /* @__PURE__ */ e(
579
- "path",
580
- {
581
- clipRule: "evenodd",
582
- d: "M25.3377 11.2802C25.3377 11.5244 25.1397 11.7224 24.8954 11.7224C24.6511 11.7224 24.4531 11.5244 24.4531 11.2802C24.4531 11.0359 24.6511 10.8379 24.8954 10.8379C25.1397 10.8379 25.3377 11.0359 25.3377 11.2802Z",
583
- fill: "#C3E4FF",
584
- fillRule: "evenodd"
585
- }
586
- ),
587
- /* @__PURE__ */ e(
588
- "path",
589
- {
590
- clipRule: "evenodd",
591
- d: "M26.7654 11.2802C26.7654 11.5244 26.5674 11.7224 26.3231 11.7224C26.0789 11.7224 25.8809 11.5244 25.8809 11.2802C25.8809 11.0359 26.0789 10.8379 26.3231 10.8379C26.5674 10.8379 26.7654 11.0359 26.7654 11.2802Z",
592
- fill: "#C3E4FF",
593
- fillRule: "evenodd"
594
- }
595
- ),
596
- /* @__PURE__ */ e(
597
- "path",
598
- {
599
- clipRule: "evenodd",
600
- d: "M29.1719 27.6866H32.7022V27.0142H29.1719V27.6866Z",
601
- fill: "#C3E4FF",
602
- fillRule: "evenodd"
603
- }
604
- ),
605
- /* @__PURE__ */ e(
606
- "path",
607
- {
608
- clipRule: "evenodd",
609
- d: "M29.1719 28.6871H39.2264V28.3726H29.1719V28.6871Z",
610
- fill: "#EEF1F6",
611
- fillRule: "evenodd"
612
- }
613
- ),
614
- /* @__PURE__ */ e(
615
- "path",
616
- {
617
- clipRule: "evenodd",
618
- d: "M29.1719 30.5064H39.5626V30.1919H29.1719V30.5064Z",
619
- fill: "#EEF1F6",
620
- fillRule: "evenodd"
621
- }
622
- ),
623
- /* @__PURE__ */ e(
624
- "path",
625
- {
626
- clipRule: "evenodd",
627
- d: "M29.1719 31.4156H40.0029V31.1011H29.1719V31.4156Z",
628
- fill: "#EEF1F6",
629
- fillRule: "evenodd"
630
- }
631
- ),
632
- /* @__PURE__ */ e(
633
- "path",
634
- {
635
- clipRule: "evenodd",
636
- d: "M29.1719 32.3253H35.7521V32.0107H29.1719V32.3253Z",
637
- fill: "#EEF1F6",
638
- fillRule: "evenodd"
639
- }
640
- ),
641
- /* @__PURE__ */ e(
642
- "path",
643
- {
644
- clipRule: "evenodd",
645
- d: "M29.1719 29.5953H40.0029V29.2808H29.1719V29.5953Z",
646
- fill: "#EEF1F6",
647
- fillRule: "evenodd"
648
- }
649
- ),
650
- /* @__PURE__ */ e(
651
- "path",
652
- {
653
- clipRule: "evenodd",
654
- d: "M9.98438 11.9322H13.1338V11.2598H9.98438V11.9322Z",
655
- fill: "#C3E4FF",
656
- fillRule: "evenodd"
657
- }
658
- ),
659
- /* @__PURE__ */ e(
660
- "path",
661
- {
662
- clipRule: "evenodd",
663
- d: "M9.98438 12.9327H18.954V12.6182H9.98438V12.9327Z",
664
- fill: "#D6EEFF",
665
- fillRule: "evenodd"
666
- }
667
- ),
668
- /* @__PURE__ */ e(
669
- "path",
670
- {
671
- clipRule: "evenodd",
672
- d: "M9.98438 14.7506H19.254V14.436H9.98438V14.7506Z",
673
- fill: "#D6EEFF",
674
- fillRule: "evenodd"
675
- }
676
- ),
677
- /* @__PURE__ */ e(
678
- "path",
679
- {
680
- clipRule: "evenodd",
681
- d: "M9.98438 15.6602H16.8127V15.3457H9.98438V15.6602Z",
682
- fill: "#D6EEFF",
683
- fillRule: "evenodd"
684
- }
685
- ),
686
- /* @__PURE__ */ e(
687
- "path",
688
- {
689
- clipRule: "evenodd",
690
- d: "M9.98438 13.8409H19.6468V13.5264H9.98438V13.8409Z",
691
- fill: "#D6EEFF",
692
- fillRule: "evenodd"
693
- }
694
- ),
695
- /* @__PURE__ */ g("g", { filter: "url(#filter0_d_1565_98011)", children: [
696
- /* @__PURE__ */ e("mask", { height: "22", id: "mask1_1565_98011", maskUnits: "userSpaceOnUse", width: "17", x: "16", y: "12", children: /* @__PURE__ */ e(
697
- "path",
698
- {
699
- clipRule: "evenodd",
700
- d: "M16.5098 12.2725H32.8412V33.707H16.5098V12.2725Z",
701
- fill: "white",
702
- fillRule: "evenodd"
703
- }
704
- ) }),
705
- /* @__PURE__ */ e("g", { mask: "url(#mask1_1565_98011)", children: /* @__PURE__ */ e(
706
- "path",
707
- {
708
- clipRule: "evenodd",
709
- d: "M32.3427 33.707H17.0083C16.7341 33.707 16.5098 33.4827 16.5098 33.2086V12.7709C16.5098 12.4968 16.7341 12.2725 17.0083 12.2725H32.3427C32.6169 12.2725 32.8412 12.4968 32.8412 12.7709V33.2086C32.8412 33.4827 32.6169 33.707 32.3427 33.707Z",
710
- fill: "white",
711
- fillRule: "evenodd"
712
- }
713
- ) }),
714
- /* @__PURE__ */ e(
715
- "path",
716
- {
717
- clipRule: "evenodd",
718
- d: "M20.875 21.5786H31.134V21.1816H20.875V21.5786Z",
719
- fill: "#E4E8EE",
720
- fillRule: "evenodd"
721
- }
722
- ),
723
- /* @__PURE__ */ e(
724
- "path",
725
- {
726
- clipRule: "evenodd",
727
- d: "M20.875 22.4077H28.1023V22.0107H20.875V22.4077Z",
728
- fill: "#E4E8EE",
729
- fillRule: "evenodd"
730
- }
731
- ),
732
- /* @__PURE__ */ e(
733
- "path",
734
- {
735
- clipRule: "evenodd",
736
- d: "M20.875 31.8461H27.8799V31.3003H20.875V31.8461Z",
737
- fill: "#E4E8EE",
738
- fillRule: "evenodd"
739
- }
740
- ),
741
- /* @__PURE__ */ e(
742
- "path",
743
- {
744
- clipRule: "evenodd",
745
- d: "M18.7308 22.7869C18.1849 22.7869 17.7383 22.3404 17.7383 21.7946C17.7383 21.2488 18.1849 20.8022 18.7308 20.8022C19.2767 20.8022 19.7233 21.2488 19.7233 21.7946C19.7233 22.3404 19.2767 22.7869 18.7308 22.7869Z",
746
- fill: "#E4E8EE",
747
- fillRule: "evenodd",
748
- stroke: "#E4E8EE",
749
- strokeWidth: "0.176004"
750
- }
751
- ),
752
- /* @__PURE__ */ e(
753
- "path",
754
- {
755
- clipRule: "evenodd",
756
- d: "M18.7308 29.3841C18.1849 29.3841 17.7383 28.9375 17.7383 28.3917C17.7383 27.8459 18.1849 27.3994 18.7308 27.3994C19.2767 27.3994 19.7233 27.8459 19.7233 28.3917C19.7233 28.9375 19.2767 29.3841 18.7308 29.3841Z",
757
- fill: "#E4E8EE",
758
- fillRule: "evenodd",
759
- stroke: "#E4E8EE",
760
- strokeWidth: "0.176004"
761
- }
762
- ),
763
- /* @__PURE__ */ e(
764
- "path",
765
- {
766
- clipRule: "evenodd",
767
- d: "M18.7308 26.0862C18.1849 26.0862 17.7383 25.6397 17.7383 25.0939C17.7383 24.5481 18.1849 24.1016 18.7308 24.1016C19.2767 24.1016 19.7233 24.5481 19.7233 25.0939C19.7233 25.6397 19.2767 26.0862 18.7308 26.0862Z",
768
- fill: "#E4E8EE",
769
- fillRule: "evenodd",
770
- stroke: "#E4E8EE",
771
- strokeWidth: "0.176004"
772
- }
773
- ),
774
- /* @__PURE__ */ e(
775
- "path",
776
- {
777
- clipRule: "evenodd",
778
- d: "M20.875 24.8764H31.134V24.4795H20.875V24.8764Z",
779
- fill: "#E4E8EE",
780
- fillRule: "evenodd"
781
- }
782
- ),
783
- /* @__PURE__ */ e(
784
- "path",
785
- {
786
- clipRule: "evenodd",
787
- d: "M20.875 25.707H28.1023V25.3101H20.875V25.707Z",
788
- fill: "#E4E8EE",
789
- fillRule: "evenodd"
790
- }
791
- ),
792
- /* @__PURE__ */ e(
793
- "path",
794
- {
795
- clipRule: "evenodd",
796
- d: "M20.875 28.1758H31.134V27.7788H20.875V28.1758Z",
797
- fill: "#E4E8EE",
798
- fillRule: "evenodd"
799
- }
800
- ),
801
- /* @__PURE__ */ e(
802
- "path",
803
- {
804
- clipRule: "evenodd",
805
- d: "M20.875 29.0049H28.1023V28.6079H20.875V29.0049Z",
806
- fill: "#E4E8EE",
807
- fillRule: "evenodd"
808
- }
809
- ),
810
- /* @__PURE__ */ e(
811
- "path",
812
- {
813
- clipRule: "evenodd",
814
- d: "M17.7383 18.0811L18.4668 18.657L19.758 17.1641",
815
- fill: "#E4E8EE",
816
- fillRule: "evenodd"
817
- }
818
- ),
819
- /* @__PURE__ */ e(
820
- "path",
821
- {
822
- d: "M17.7383 18.0811L18.4668 18.657L19.758 17.1641",
823
- stroke: "#E4E8EE",
824
- strokeWidth: "0.264005"
825
- }
826
- ),
827
- /* @__PURE__ */ e(
828
- "path",
829
- {
830
- clipRule: "evenodd",
831
- d: "M17.7383 14.7823L18.4668 15.3582L19.758 13.8652",
832
- fill: "#E4E8EE",
833
- fillRule: "evenodd"
834
- }
835
- ),
836
- /* @__PURE__ */ e(
837
- "path",
838
- {
839
- d: "M17.7383 14.7823L18.4668 15.3582L19.758 13.8652",
840
- stroke: "#E4E8EE",
841
- strokeWidth: "0.264005"
842
- }
843
- ),
844
- /* @__PURE__ */ e(
845
- "path",
846
- {
847
- clipRule: "evenodd",
848
- d: "M20.875 14.3389H31.134V13.8369H20.875V14.3389Z",
849
- fill: "#E4E8EE",
850
- fillRule: "evenodd"
851
- }
852
- ),
853
- /* @__PURE__ */ e(
854
- "path",
855
- {
856
- clipRule: "evenodd",
857
- d: "M20.875 15.3878H28.1023V14.8857H20.875V15.3878Z",
858
- fill: "#E4E8EE",
859
- fillRule: "evenodd"
860
- }
861
- ),
862
- /* @__PURE__ */ e(
863
- "path",
864
- {
865
- clipRule: "evenodd",
866
- d: "M20.4648 14.0869H31.545H20.4648Z",
867
- fill: "#E4E8EE",
868
- fillRule: "evenodd"
869
- }
870
- ),
871
- /* @__PURE__ */ e("path", { d: "M20.4648 14.0869H31.545", stroke: "#E4E8EE", strokeWidth: "0.0880018" }),
872
- /* @__PURE__ */ e(
873
- "path",
874
- {
875
- clipRule: "evenodd",
876
- d: "M20.4648 15.1372H28.4939H20.4648Z",
877
- fill: "#E4E8EE",
878
- fillRule: "evenodd"
879
- }
880
- ),
881
- /* @__PURE__ */ e("path", { d: "M20.4648 15.1372H28.4939", stroke: "#E4E8EE", strokeWidth: "0.0880018" }),
882
- /* @__PURE__ */ e(
883
- "path",
884
- {
885
- clipRule: "evenodd",
886
- d: "M20.875 17.6368H31.134V17.1348H20.875V17.6368Z",
887
- fill: "#E4E8EE",
888
- fillRule: "evenodd"
889
- }
890
- ),
891
- /* @__PURE__ */ e(
892
- "path",
893
- {
894
- clipRule: "evenodd",
895
- d: "M20.875 18.6861H28.1023V18.1841H20.875V18.6861Z",
896
- fill: "#E4E8EE",
897
- fillRule: "evenodd"
898
- }
899
- ),
900
- /* @__PURE__ */ e(
901
- "path",
902
- {
903
- clipRule: "evenodd",
904
- d: "M20.4648 17.3858H31.545H20.4648Z",
905
- fill: "#E4E8EE",
906
- fillRule: "evenodd"
907
- }
908
- ),
909
- /* @__PURE__ */ e("path", { d: "M20.4648 17.3858H31.545", stroke: "#E4E8EE", strokeWidth: "0.0880018" }),
910
- /* @__PURE__ */ e(
911
- "path",
912
- {
913
- clipRule: "evenodd",
914
- d: "M20.4648 18.4356H28.4939H20.4648Z",
915
- fill: "#E4E8EE",
916
- fillRule: "evenodd"
917
- }
918
- ),
919
- /* @__PURE__ */ e("path", { d: "M20.4648 18.4356H28.4939", stroke: "#E4E8EE", strokeWidth: "0.0880018" }),
920
- /* @__PURE__ */ e(
921
- "path",
922
- {
923
- clipRule: "evenodd",
924
- d: "M18.2832 19.8984H31.0117H18.2832Z",
925
- fill: "#E4E8EE",
926
- fillRule: "evenodd"
927
- }
928
- ),
929
- /* @__PURE__ */ e("path", { d: "M18.2832 19.8984H31.0117", stroke: "#E4E8EE", strokeWidth: "0.0880018" }),
930
- /* @__PURE__ */ e(
931
- "path",
932
- {
933
- clipRule: "evenodd",
934
- d: "M18.7295 30.8101V32.3377V30.8101Z",
935
- fill: "#E4E8EE",
936
- fillRule: "evenodd"
937
- }
938
- ),
939
- /* @__PURE__ */ e("path", { d: "M18.7295 30.8101V32.3377", stroke: "#E4E8EE", strokeWidth: "0.264005" }),
940
- /* @__PURE__ */ e(
941
- "path",
942
- {
943
- clipRule: "evenodd",
944
- d: "M17.9668 31.5737H19.4947H17.9668Z",
945
- fill: "#E4E8EE",
946
- fillRule: "evenodd"
947
- }
948
- ),
949
- /* @__PURE__ */ e("path", { d: "M17.9668 31.5737H19.4947", stroke: "#E4E8EE", strokeWidth: "0.264005" })
950
- ] }),
951
- /* @__PURE__ */ g("g", { filter: "url(#filter1_d_1565_98011)", children: [
952
- /* @__PURE__ */ e("circle", { cx: "15.0441", cy: "16.0441", fill: "#CDD3DD", r: "15.0441" }),
953
- /* @__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" }) }),
954
- /* @__PURE__ */ g("g", { mask: "url(#mask2_1565_98011)", children: [
955
- /* @__PURE__ */ e("rect", { fill: "white", height: "31.1359", transform: "translate(0 0.162598)", width: "31.0101" }),
956
- /* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "4.52002" }),
957
- /* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "17.1758" }),
958
- /* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "26.0186" }),
959
- /* @__PURE__ */ e("rect", { fill: "#A8B1BD", height: "3.0172", rx: "0.167622", width: "3.0172", x: "3.26953", y: "9.04541" }),
960
- /* @__PURE__ */ e(
961
- "rect",
962
- {
963
- fill: "#CDD3DD",
964
- height: "1.17336",
965
- rx: "0.167622",
966
- width: "10.9793",
967
- x: "6.87305",
968
- y: "4.52002"
969
- }
970
- ),
971
- /* @__PURE__ */ e(
972
- "rect",
973
- {
974
- fill: "#CDD3DD",
975
- height: "1.17336",
976
- rx: "0.167622",
977
- width: "10.9793",
978
- x: "6.87305",
979
- y: "17.1758"
980
- }
981
- ),
982
- /* @__PURE__ */ e(
983
- "rect",
984
- {
985
- fill: "#CDD3DD",
986
- height: "1.17336",
987
- rx: "0.167622",
988
- width: "10.9793",
989
- x: "6.87305",
990
- y: "26.0186"
991
- }
992
- ),
993
- /* @__PURE__ */ e(
994
- "rect",
995
- {
996
- fill: "#CDD3DD",
997
- height: "1.17336",
998
- rx: "0.167622",
999
- width: "10.9793",
1000
- x: "6.87305",
1001
- y: "9.04541"
1002
- }
1003
- ),
1004
- /* @__PURE__ */ e(
1005
- "rect",
1006
- {
1007
- fill: "#EEF1F6",
1008
- height: "0.880018",
1009
- rx: "0.167622",
1010
- width: "10.9793",
1011
- x: "3.26953",
1012
- y: "2.34131"
1013
- }
1014
- ),
1015
- /* @__PURE__ */ e(
1016
- "rect",
1017
- {
1018
- fill: "#EEF1F6",
1019
- height: "0.880018",
1020
- rx: "0.167622",
1021
- width: "10.9793",
1022
- x: "3.26953",
1023
- y: "14.9971"
1024
- }
1025
- ),
1026
- /* @__PURE__ */ e(
1027
- "rect",
1028
- {
1029
- fill: "#EEF1F6",
1030
- height: "0.880018",
1031
- rx: "0.167622",
1032
- width: "10.9793",
1033
- x: "3.26953",
1034
- y: "23.8389"
1035
- }
1036
- ),
1037
- /* @__PURE__ */ e(
1038
- "rect",
1039
- {
1040
- fill: "#EEF1F6",
1041
- height: "1.17336",
1042
- rx: "0.167622",
1043
- width: "8.50684",
1044
- x: "6.87305",
1045
- y: "6.36377"
1046
- }
1047
- ),
1048
- /* @__PURE__ */ e(
1049
- "rect",
1050
- {
1051
- fill: "#EEF1F6",
1052
- height: "1.17336",
1053
- rx: "0.167622",
1054
- width: "8.50684",
1055
- x: "6.87305",
1056
- y: "19.0195"
1057
- }
1058
- ),
1059
- /* @__PURE__ */ e(
1060
- "rect",
1061
- {
1062
- fill: "#EEF1F6",
1063
- height: "1.17336",
1064
- rx: "0.167622",
1065
- width: "8.50684",
1066
- x: "6.87305",
1067
- y: "27.8613"
1068
- }
1069
- ),
1070
- /* @__PURE__ */ e(
1071
- "rect",
1072
- {
1073
- fill: "#EEF1F6",
1074
- height: "1.17336",
1075
- rx: "0.167622",
1076
- width: "8.50684",
1077
- x: "6.87305",
1078
- y: "10.8892"
1079
- }
1080
- ),
1081
- /* @__PURE__ */ e(
1082
- "rect",
1083
- {
1084
- fill: "#A8B1BD",
1085
- height: "1.17336",
1086
- rx: "0.167622",
1087
- width: "5.15439",
1088
- x: "21.666",
1089
- y: "5.44238"
1090
- }
1091
- ),
1092
- /* @__PURE__ */ e(
1093
- "rect",
1094
- {
1095
- fill: "#A8B1BD",
1096
- height: "1.17336",
1097
- rx: "0.167622",
1098
- width: "5.15439",
1099
- x: "21.666",
1100
- y: "18.0972"
1101
- }
1102
- ),
1103
- /* @__PURE__ */ e(
1104
- "rect",
1105
- {
1106
- fill: "#A8B1BD",
1107
- height: "1.17336",
1108
- rx: "0.167622",
1109
- width: "5.15439",
1110
- x: "21.666",
1111
- y: "26.9399"
1112
- }
1113
- ),
1114
- /* @__PURE__ */ e(
1115
- "rect",
1116
- {
1117
- fill: "#A8B1BD",
1118
- height: "1.17336",
1119
- rx: "0.167622",
1120
- width: "5.15439",
1121
- x: "21.666",
1122
- y: "9.96826"
1123
- }
1124
- ),
1125
- /* @__PURE__ */ e("path", { d: "M2.64062 8.25H27.4487", stroke: "#E4E8EE", strokeWidth: "0.0838112" }),
1126
- /* @__PURE__ */ e("path", { d: "M2.64062 20.9058H27.4487", stroke: "#E4E8EE", strokeWidth: "0.0838112" }),
1127
- /* @__PURE__ */ e("path", { d: "M2.64062 29.7476H27.4487", stroke: "#E4E8EE", strokeWidth: "0.0838112" }),
1128
- /* @__PURE__ */ e("path", { d: "M2.64062 12.7759H27.4487", stroke: "#E4E8EE", strokeWidth: "0.0838112" }),
1129
- /* @__PURE__ */ e("path", { d: "M2.64062 3.72412H27.4487", stroke: "#E4E8EE", strokeWidth: "0.0838112" }),
1130
- /* @__PURE__ */ e("path", { d: "M2.64062 16.3799H27.4487", stroke: "#E4E8EE", strokeWidth: "0.0838112" }),
1131
- /* @__PURE__ */ e("path", { d: "M2.64062 25.2217H27.4487", stroke: "#E4E8EE", strokeWidth: "0.0838112" }),
1132
- /* @__PURE__ */ e("path", { d: "M2.64062 8.25H27.4487", stroke: "#E4E8EE", strokeWidth: "0.0838112" }),
1133
- /* @__PURE__ */ e("path", { d: "M2.64062 20.9058H27.4487", stroke: "#E4E8EE", strokeWidth: "0.0838112" }),
1134
- /* @__PURE__ */ e("path", { d: "M2.64062 29.7476H27.4487", stroke: "#E4E8EE", strokeWidth: "0.0838112" })
1135
- ] })
1136
- ] }),
1137
- /* @__PURE__ */ e(
1138
- "path",
1139
- {
1140
- d: "M24.1888 27.3166L24.4326 27.0728L25.6395 27.8404L32.2915 34.4924C32.4911 34.6919 32.4911 35.0154 32.2915 35.215C32.092 35.4145 31.7685 35.4145 31.569 35.215L24.9487 28.5947L24.1888 27.3166Z",
1141
- fill: "#CDD3DD"
1142
- }
1143
- ),
1144
- /* @__PURE__ */ g("defs", { children: [
1145
- /* @__PURE__ */ g(
1146
- "filter",
1147
- {
1148
- colorInterpolationFilters: "sRGB",
1149
- filterUnits: "userSpaceOnUse",
1150
- height: "22.1051",
1151
- id: "filter0_d_1565_98011",
1152
- width: "17.0025",
1153
- x: "16.1745",
1154
- y: "12.0629",
1155
- children: [
1156
- /* @__PURE__ */ e("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
1157
- /* @__PURE__ */ e(
1158
- "feColorMatrix",
1159
- {
1160
- in: "SourceAlpha",
1161
- result: "hardAlpha",
1162
- type: "matrix",
1163
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
1164
- }
1165
- ),
1166
- /* @__PURE__ */ e("feOffset", { dy: "0.125717" }),
1167
- /* @__PURE__ */ e("feGaussianBlur", { stdDeviation: "0.167622" }),
1168
- /* @__PURE__ */ e(
1169
- "feColorMatrix",
1170
- {
1171
- type: "matrix",
1172
- values: "0 0 0 0 0.341176 0 0 0 0 0.4 0 0 0 0 0.458824 0 0 0 0.15 0"
1173
- }
1174
- ),
1175
- /* @__PURE__ */ e("feBlend", { in2: "BackgroundImageFix", mode: "normal", result: "effect1_dropShadow_1565_98011" }),
1176
- /* @__PURE__ */ e(
1177
- "feBlend",
1178
- {
1179
- in: "SourceGraphic",
1180
- in2: "effect1_dropShadow_1565_98011",
1181
- mode: "normal",
1182
- result: "shape"
1183
- }
1184
- )
1185
- ]
1186
- }
1187
- ),
1188
- /* @__PURE__ */ g(
1189
- "filter",
1190
- {
1191
- colorInterpolationFilters: "sRGB",
1192
- filterUnits: "userSpaceOnUse",
1193
- height: "31.7646",
1194
- id: "filter1_d_1565_98011",
1195
- width: "31.7641",
1196
- x: "-0.838112",
1197
- y: "0.580944",
1198
- children: [
1199
- /* @__PURE__ */ e("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
1200
- /* @__PURE__ */ e(
1201
- "feColorMatrix",
1202
- {
1203
- in: "SourceAlpha",
1204
- result: "hardAlpha",
1205
- type: "matrix",
1206
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
1207
- }
1208
- ),
1209
- /* @__PURE__ */ e("feOffset", { dy: "0.419056" }),
1210
- /* @__PURE__ */ e("feGaussianBlur", { stdDeviation: "0.419056" }),
1211
- /* @__PURE__ */ e(
1212
- "feColorMatrix",
1213
- {
1214
- type: "matrix",
1215
- values: "0 0 0 0 0.341176 0 0 0 0 0.4 0 0 0 0 0.458824 0 0 0 0.16 0"
1216
- }
1217
- ),
1218
- /* @__PURE__ */ e("feBlend", { in2: "BackgroundImageFix", mode: "normal", result: "effect1_dropShadow_1565_98011" }),
1219
- /* @__PURE__ */ e(
1220
- "feBlend",
1221
- {
1222
- in: "SourceGraphic",
1223
- in2: "effect1_dropShadow_1565_98011",
1224
- mode: "normal",
1225
- result: "shape"
1226
- }
1227
- )
1228
- ]
1229
- }
1230
- )
1231
- ] })
1232
- ] }), Et = ({ beat: i }) => {
1233
- const { icon_type: o, icon_color: t } = i;
1234
- 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(
1235
- ae,
1236
- {
1237
- filled: !0,
1238
- sx: {
1239
- color: (l) => l.palette.primary.main
1240
- }
1241
- }
1242
- );
1243
- }, V = () => {
1244
- const i = u.useContext(U);
1245
- if (!i)
1246
- throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
1247
- return i.store.copyStore;
1248
- }, ht = () => {
1249
- const i = u.useContext(U);
1250
- if (!i?.store?.insightsMicroWidgetStore)
1251
- throw new Error(
1252
- "useInsightsMicroWidgetStore() must be used within the InsightsMicroWidgetDataProvider"
1253
- );
1254
- return i.store.insightsMicroWidgetStore;
1255
- }, z = () => {
1256
- const i = u.useContext(U);
1257
- if (!i)
1258
- throw new Error("useEvent() must be used within the InsightsMicroWidgetDataProvider");
1259
- return { onEvent: i.onEvent };
1260
- }, Me = () => {
1261
- const i = u.useContext(U);
1262
- if (!i)
1263
- throw new Error("usePageview() must be used within the InsightsMicroWidgetDataProvider");
1264
- return { onPageview: i.onPageview };
1265
- }, ut = {
1266
- LARGE: 180,
1267
- STANDARD: 154,
1268
- XLARGE: 200,
1269
- XXLARGE: 248
1270
- }, pt = 50, Ae = 1, _t = ({
1271
- ariaLabel: i,
1272
- backgroundColor: o,
1273
- beat: t,
1274
- showCTAColocatedWithText: l = !0,
1275
- heightOverrides: n,
1276
- index: r,
1277
- isActiveCard: a,
1278
- onCardClick: c,
1279
- posthog: h,
1280
- showIcon: f,
1281
- variant: p,
1282
- widthOverrides: d
1283
- }) => {
1284
- const { ref: E, inView: s } = me({
1285
- threshold: Ae
1286
- }), { cardsCopy: C } = V(), { onEvent: _ } = z(), { updateBeat: R, updateOffer: O } = ht();
1287
- ee(() => {
1288
- s && (t.has_been_displayed ? _(Ie(t.template)) : (t.guid.startsWith("OFR") ? O({
1289
- ...t,
1290
- has_been_displayed: !0
1291
- }) : R({
1292
- ...t,
1293
- has_been_displayed: !0
1294
- }), _(ye(t.template))));
1295
- }, [s]), ee(() => {
1296
- if (s && t)
1297
- if (t.template === "MarketingOffer") {
1298
- const m = t;
1299
- h?.capture("viewed_messaging_insight", {
1300
- template: t.template,
1301
- campaign_guid: m.campaign_guid,
1302
- campaign_name: m.pulse_campaign_name
1303
- });
1304
- } else
1305
- h?.capture("viewed_insight", {
1306
- beat_guid: t.guid,
1307
- template: t.template,
1308
- position: r
1309
- });
1310
- }, [t, r, s]);
1311
- const I = () => {
1312
- if (c && c(t), _(ge(t.template)), t.template === "MarketingOffer") {
1313
- const m = t;
1314
- h?.capture("clicked_messaging_insight", {
1315
- template: t.template,
1316
- campaign_guid: m.campaign_guid,
1317
- campaign_name: m.pulse_campaign_name
1318
- });
1319
- } else
1320
- h?.capture("clicked_insight", {
1321
- beat_guid: t.guid,
1322
- template: t.template,
1323
- position: r
1324
- });
1325
- };
1326
- return /* @__PURE__ */ e(
1327
- j,
1328
- {
1329
- actionText: t.micro_call_to_action || C.micro_card_cta,
1330
- ariaLabel: i,
1331
- backgroundColor: o,
1332
- description: t?.html_micro_description && t?.html_micro_description.length > 0 ? t.html_micro_description : t.html_description,
1333
- heightOverrides: n,
1334
- icon: /* @__PURE__ */ e(Et, { beat: t }),
1335
- isActiveCard: a,
1336
- onCardClick: I,
1337
- posthog: h,
1338
- ref: E,
1339
- showCTAColocatedWithText: l,
1340
- showIcon: f,
1341
- title: t.micro_title && t.micro_title.length > 0 ? t.micro_title : t.title,
1342
- variant: p,
1343
- widthOverrides: d
1344
- }
1345
- );
1346
- }, ft = ({
1347
- currentBeatIndex: i,
1348
- numBeats: o,
1349
- onNextClick: t,
1350
- onPreviousClick: l,
1351
- scrollRightBoundary: n,
1352
- scrollX: r,
1353
- shouldApplyDotAnimation: a = !1,
1354
- visibleCardsCount: c = 1
1355
- }) => {
1356
- const h = Fe(), { carouselCopy: f } = 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;
1357
- return /* @__PURE__ */ g(
1358
- k,
1359
- {
1360
- direction: "row",
1361
- sx: {
1362
- alignItems: "center",
1363
- justifyContent: "center",
1364
- pt: 4,
1365
- width: "100%",
1366
- // we were using `gap` instead of margin, but it doesn't work in safari browsers older than iOS 14.1
1367
- "& button:first-child": {
1368
- mr: 8
1369
- }
1370
- },
1371
- children: [
1372
- /* @__PURE__ */ e(
1373
- se,
1374
- {
1375
- "aria-disabled": p,
1376
- "aria-label": f.previous_insight_cta_aria,
1377
- disabled: p,
1378
- onClick: l,
1379
- children: /* @__PURE__ */ e(
1380
- He,
1381
- {
1382
- style: {
1383
- color: p ? E : s
1384
- }
1385
- }
1386
- )
1387
- }
1388
- ),
1389
- Array.from({ length: o }).map((C, _) => {
1390
- const R = _ === i;
1391
- return /* @__PURE__ */ e(
1392
- Z,
1393
- {
1394
- className: "mx-insights-micro-carousel-dots",
1395
- sx: {
1396
- bgcolor: R ? s : E,
1397
- height: 8,
1398
- mr: 8,
1399
- // existing comment from meganthan "we were using `gap` instead of margin, but it doesn't work in safari browsers older than iOS 14.1"
1400
- ...a ? {
1401
- borderRadius: "4px",
1402
- transformOrigin: "center",
1403
- transition: "all 0.5s ease-out",
1404
- willChange: "width, background-color"
1405
- } : {
1406
- borderRadius: "50%",
1407
- p: 0
1408
- },
1409
- width: R && a ? 24 : 8
1410
- }
1411
- },
1412
- `carousel-button-${_}`
1413
- );
1414
- }),
1415
- /* @__PURE__ */ e(
1416
- se,
1417
- {
1418
- "aria-disabled": d,
1419
- "aria-label": f.next_insight_cta_aria,
1420
- disabled: d,
1421
- onClick: t,
1422
- children: /* @__PURE__ */ e(
1423
- Ce,
1424
- {
1425
- style: {
1426
- color: d ? E : s
1427
- }
1428
- }
1429
- )
1430
- }
1431
- )
1432
- ]
1433
- }
1434
- );
1435
- }, Ct = ({
1436
- activeCardIndex: i,
1437
- beats: o,
1438
- cardWidth: t,
1439
- showCTAColocatedWithText: l,
1440
- heightOverrides: n,
1441
- onCardClick: r,
1442
- posthog: a,
1443
- showIcon: c,
1444
- variant: h
1445
- }) => {
1446
- const { carouselCopy: f } = V(), p = {
1447
- showCTAColocatedWithText: l,
1448
- heightOverrides: n,
1449
- posthog: a,
1450
- showIcon: c,
1451
- variant: h
1452
- };
1453
- return /* @__PURE__ */ g(xe, { children: [
1454
- o.map((d, E) => {
1455
- const s = E + 1, C = o.length + 1, _ = Ge(
1456
- f.card_position_in_carousel_aria,
1457
- s.toString(),
1458
- C.toString()
1459
- ), 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;
1460
- return /* @__PURE__ */ e(
1461
- _t,
1462
- {
1463
- ariaLabel: `${_}: ${I}, ${m}`,
1464
- beat: d,
1465
- index: E,
1466
- isActiveCard: E === i,
1467
- onCardClick: r,
1468
- widthOverrides: t || void 0,
1469
- ...p
1470
- },
1471
- `${d.guid} ${E}`
1472
- );
1473
- }),
1474
- /* @__PURE__ */ e(
1475
- At,
1476
- {
1477
- isActiveCard: i === o.length,
1478
- onCardClick: r,
1479
- widthOverrides: t || void 0,
1480
- ...p
1481
- }
1482
- )
1483
- ] });
1484
- }, mt = ({
1485
- analyticsMetadata: i,
1486
- allowSingleCardPeeking: o = !1,
1487
- beats: t = [],
1488
- showCTAColocatedWithText: l,
1489
- heightOverrides: n,
1490
- onCardClick: r,
1491
- posthog: a,
1492
- showCarouselControls: c,
1493
- showIcon: h,
1494
- showWithMargin: f = !0,
1495
- variant: p,
1496
- widthOverrides: d,
1497
- visibleCardsCount: E = 1
1498
- // Default to 1 card visible
1499
- }) => {
1500
- const s = u.useRef(null), C = 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();
1501
- u.useEffect(() => {
1502
- if (s.current && !o) {
1503
- const A = s.current.offsetWidth, b = 8;
1504
- let B;
1505
- if (E > 1) {
1506
- const ne = (A - (E - 1) * b) / E / 3;
1507
- B = (A - ne - (E - 1) * b) / E;
1508
- } else
1509
- B = A;
1510
- M(B);
1511
- }
1512
- }, [E, s.current?.offsetWidth]), u.useEffect(() => {
1513
- const A = C.current?.offsetWidth;
1514
- if (typeof A == "number" && o) {
1515
- const b = (G) => {
1516
- const re = [
1517
- { maxWidth: 375, cardWidth: 268 },
1518
- { maxWidth: 444, cardWidth: 300 },
1519
- { maxWidth: 599, cardWidth: 350 },
1520
- { maxWidth: 749, cardWidth: 450 },
1521
- { maxWidth: 900, cardWidth: 600 }
1522
- ].find((we) => G <= we.maxWidth);
1523
- return re ? re.cardWidth : 750;
1524
- };
1525
- M(b(A));
1526
- const B = () => {
1527
- const G = C.current?.offsetWidth;
1528
- typeof G == "number" && M(b(G));
1529
- };
1530
- return window.addEventListener("resize", B), () => {
1531
- window.removeEventListener("resize", B);
1532
- };
1533
- }
1534
- }, [o, C]);
1535
- const K = () => {
1536
- F(S.ON_CAROUSEL_FORWARD_CLICK, i), s.current && y && s.current.scrollTo({
1537
- left: _ + y + 8,
1538
- top: 0,
1539
- behavior: "smooth"
1540
- });
1541
- }, $ = () => {
1542
- F(S.ON_CAROUSEL_BACK_CLICK, i), s.current && y && s.current.scrollTo({
1543
- left: Math.max(0, _ - (y + 8)),
1544
- top: 0,
1545
- behavior: "smooth"
1546
- });
1547
- }, X = () => {
1548
- s.current && R(s.current.scrollLeft);
1549
- }, Q = () => {
1550
- if (!m || !O) return;
1551
- m - O > pt ? F(S.ON_CAROUSEL_FORWARD_SWIPE, i) : F(S.ON_CAROUSEL_BACK_SWIPE, i);
1552
- }, q = (A) => {
1553
- I(A.targetTouches[0].clientX);
1554
- }, Y = (A) => {
1555
- I(null), T(A.targetTouches[0].clientX);
1556
- }, w = y ? Math.round(_ / (y + 8)) : 0, We = s.current ? s.current.scrollWidth - s.current.offsetWidth : 0;
1557
- return /* @__PURE__ */ g(
1558
- k,
1559
- {
1560
- "aria-label": W.carousel_title,
1561
- "aria-roledescription": "carousel",
1562
- ref: C,
1563
- role: "group/region",
1564
- sx: {
1565
- alignItems: "center",
1566
- boxSizing: "border-box",
1567
- height: n,
1568
- width: d || "100%"
1569
- },
1570
- children: [
1571
- /* @__PURE__ */ e(
1572
- k,
1573
- {
1574
- direction: "row",
1575
- onScroll: X,
1576
- onTouchEnd: Q,
1577
- onTouchMove: q,
1578
- onTouchStart: Y,
1579
- ref: s,
1580
- sx: {
1581
- alignItems: "center",
1582
- height: n && "100%",
1583
- gap: 8,
1584
- listStyleType: "none",
1585
- m: 0,
1586
- maxWidth: f ? "calc(100% - 32px)" : "100%",
1587
- overflowX: "auto",
1588
- overflowY: "hidden",
1589
- p: 0,
1590
- scrollbarWidth: "none",
1591
- "-ms-overflow-style": "none",
1592
- "-webkit-overflow-scrolling": "touch",
1593
- "&::-webkit-scrollbar": {
1594
- display: "none"
1595
- }
1596
- },
1597
- children: /* @__PURE__ */ e(
1598
- Ct,
1599
- {
1600
- activeCardIndex: w,
1601
- beats: t,
1602
- cardWidth: y,
1603
- heightOverrides: n,
1604
- onCardClick: r,
1605
- posthog: a,
1606
- showCTAColocatedWithText: l,
1607
- showIcon: h,
1608
- variant: p
1609
- }
1610
- )
1611
- }
1612
- ),
1613
- c && /* @__PURE__ */ e(
1614
- ft,
1615
- {
1616
- currentBeatIndex: w + E - 1,
1617
- numBeats: t.length + 1,
1618
- onNextClick: K,
1619
- onPreviousClick: $,
1620
- scrollRightBoundary: We,
1621
- scrollX: _,
1622
- shouldApplyDotAnimation: o,
1623
- visibleCardsCount: E
1624
- }
1625
- )
1626
- ]
1627
- }
1628
- );
1629
- }, Rt = P(mt), gt = ({
1630
- analyticsMetadata: i,
1631
- onCardClick: o,
1632
- posthog: t,
1633
- widthOverrides: l
1634
- }) => {
1635
- const { carouselCopy: n } = V(), { onEvent: r } = z(), a = () => {
1636
- r && (r(S.ON_VIEW_MORE_CLICKED, i), o(), t?.capture("clicked_view_more"));
1637
- };
1638
- return n ? /* @__PURE__ */ g(
1639
- k,
1640
- {
1641
- alignItems: "center",
1642
- direction: "row",
1643
- justifyContent: "space-between",
1644
- spacing: 2,
1645
- sx: {
1646
- padding: 16,
1647
- width: l || void 0
1648
- },
1649
- children: [
1650
- /* @__PURE__ */ e(
1651
- Le,
1652
- {
1653
- sx: (c) => ({
1654
- color: c.palette.primary.main,
1655
- fontSize: 18,
1656
- fontWeight: 700,
1657
- lineHeight: "24px"
1658
- }),
1659
- variant: "h3",
1660
- children: n.carousel_title
1661
- }
1662
- ),
1663
- /* @__PURE__ */ e(
1664
- De,
1665
- {
1666
- endIcon: /* @__PURE__ */ e(Ce, { size: 20 }),
1667
- onClick: a,
1668
- size: "small",
1669
- sx: (c) => ({
1670
- color: c.palette.primary.main
1671
- }),
1672
- variant: "text",
1673
- children: n.view_all_insights_in_full_feed_cta_aria
1674
- }
1675
- )
1676
- ]
1677
- }
1678
- ) : /* @__PURE__ */ e(ke, {});
1679
- }, It = P(gt), yt = ({
1680
- heightOverrides: i,
1681
- widthOverrides: o,
1682
- children: t
1683
- }) => {
1684
- const { carouselCopy: l } = V();
1685
- return /* @__PURE__ */ e(
1686
- Z,
1687
- {
1688
- "aria-label": l?.carousel_title,
1689
- "aria-roledescription": "carousel",
1690
- role: "group",
1691
- sx: {
1692
- boxSizing: "border-box",
1693
- height: i ? void 0 : "100%",
1694
- m: "0 auto",
1695
- width: o ? void 0 : "100%"
1696
- },
1697
- children: t
1698
- }
1699
- );
1700
- }, Oe = ({
1701
- ariaLabel: i,
1702
- heightOverrides: o,
1703
- onCardClick: t,
1704
- posthog: l,
1705
- showIcon: n,
1706
- variant: r
1707
- }) => {
1708
- const { cardsCopy: a } = V(), { onEvent: c } = z(), { onPageview: h } = Me();
1709
- u.useEffect(() => {
1710
- h(H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
1711
- }, []);
1712
- const f = () => {
1713
- t && t(), c(S.ON_NO_RELEVANT_INSIGHTS_CLICKED), l?.capture("clicked_insight", {
1714
- template: "no_relevant_insights"
1715
- });
1716
- };
1717
- return /* @__PURE__ */ e(
1718
- j,
1719
- {
1720
- actionText: a.micro_card_cta,
1721
- ariaLabel: i,
1722
- description: a.no_relevant_insights_card_description,
1723
- heightOverrides: o,
1724
- icon: /* @__PURE__ */ e(Se, {}),
1725
- isZeroState: !0,
1726
- onCardClick: f,
1727
- posthog: l,
1728
- showIcon: n,
1729
- style: {
1730
- linkTextStyle: {
1731
- ml: 48
1732
- }
1733
- },
1734
- title: a.no_relevant_insights_card_title,
1735
- variant: r
1736
- }
1737
- );
1738
- }, Qt = P(Oe), Te = ({
1739
- ariaLabel: i,
1740
- heightOverrides: o,
1741
- onCardClick: t,
1742
- posthog: l,
1743
- showIcon: n,
1744
- variant: r
1745
- }) => {
1746
- const { onPageview: a } = Me(), { zeroStateCopy: c } = V();
1747
- return u.useEffect(() => {
1748
- a(H.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
1749
- }, []), /* @__PURE__ */ e(
1750
- j,
1751
- {
1752
- ariaLabel: i,
1753
- description: c.carousel_zero_state_description,
1754
- heightOverrides: o,
1755
- icon: /* @__PURE__ */ e(Se, {}),
1756
- isZeroState: !0,
1757
- onCardClick: t,
1758
- posthog: l,
1759
- showIcon: n,
1760
- title: c.carousel_zero_state_title,
1761
- variant: r
1762
- }
1763
- );
1764
- }, qt = P(Te), vt = () => /* @__PURE__ */ e(
1765
- Z,
1766
- {
1767
- sx: {
1768
- alignItems: "center",
1769
- display: "flex",
1770
- height: "100%",
1771
- justifyContent: "center",
1772
- width: "100%"
1773
- },
1774
- children: /* @__PURE__ */ e(Ue, {})
1775
- }
1776
- ), N = new ot(), St = ({
1777
- allowSingleCardPeeking: i,
1778
- areBeatsLoading: o,
1779
- beats: t = [],
1780
- // This also determines the length of the carousel controls (beat.length + 1)
1781
- showCTAColocatedWithText: l = !0,
1782
- endpoint: n = "/",
1783
- heightOverrides: r,
1784
- logOutUser: a,
1785
- onCardClick: c = () => {
1786
- },
1787
- onEvent: h = () => {
1788
- },
1789
- onPageview: f = () => {
1790
- },
1791
- posthog: p,
1792
- showBorder: d = !0,
1793
- showCarouselControls: E,
1794
- showHeader: s,
1795
- showIcon: C,
1796
- showWithMargin: _ = !0,
1797
- token: R = "",
1798
- userHasFullInsightFeedBeats: O,
1799
- variant: I,
1800
- visibleCardsCount: m = 1,
1801
- widthOverrides: T
1802
- }) => {
1803
- const [y, M] = J("STANDARD"), [W, F] = J(!1), [K, $] = J(!1), X = Ke([h], N), Q = $e([f], N);
1804
- u.useEffect(() => {
1805
- !N.isInitialized && !K && (N.initialize(n, R, a).catch(() => $(!1)), $(!0));
1806
- }, [n, R, a, N.isInitialized, K]), u.useEffect(() => {
1807
- const w = window.innerHeight;
1808
- w < 180 ? M("STANDARD") : w >= 180 && w < 200 ? M("LARGE") : w >= 200 && w < 248 ? M("XLARGE") : w >= 248 && M("XXLARGE");
1809
- }, [window.innerHeight]), u.useEffect(() => {
1810
- F(!o && N.isInitialized);
1811
- }, [o, N.isInitialized]);
1812
- const q = {
1813
- showCTAColocatedWithText: l,
1814
- heightOverrides: r,
1815
- onCardClick: c,
1816
- posthog: p,
1817
- showIcon: C,
1818
- showWithMargin: _,
1819
- widthOverrides: T
1820
- }, Y = {
1821
- carouselSize: y,
1822
- variant: I,
1823
- showCTAColocatedWithText: l,
1824
- heightOverrides: r,
1825
- onCardClick: c,
1826
- posthog: p,
1827
- showIcon: C
1828
- };
1829
- return /* @__PURE__ */ e(lt, { onEvent: X, onPageview: Q, store: N, children: /* @__PURE__ */ g(yt, { heightOverrides: r, widthOverrides: T, children: [
1830
- !W && /* @__PURE__ */ e(vt, {}),
1831
- W && s && /* @__PURE__ */ e(
1832
- It,
1833
- {
1834
- analyticsMetadata: Ee,
1835
- onCardClick: c,
1836
- posthog: p,
1837
- widthOverrides: T
1838
- }
1839
- ),
1840
- W && !!t.length && /* @__PURE__ */ e(
1841
- Rt,
1842
- {
1843
- allowSingleCardPeeking: i,
1844
- analyticsMetadata: Ee,
1845
- beats: t,
1846
- showCarouselControls: E,
1847
- variant: d ? I : void 0,
1848
- visibleCardsCount: m,
1849
- ...q
1850
- }
1851
- ),
1852
- W && !t.length && /* @__PURE__ */ e(
1853
- k,
1854
- {
1855
- sx: {
1856
- alignItems: "center",
1857
- height: r,
1858
- width: T || "100%"
1859
- },
1860
- children: /* @__PURE__ */ e(
1861
- k,
1862
- {
1863
- sx: {
1864
- height: `calc(${ut[y]}px - 44px)`,
1865
- width: _ ? `calc(${T}px - 32px)` : "100%"
1866
- },
1867
- children: O ? /* @__PURE__ */ e(Oe, { ...Y }) : /* @__PURE__ */ e(Te, { ...Y })
1868
- }
1869
- )
1870
- }
1871
- )
1872
- ] }) });
1873
- }, Jt = P(St), Mt = ({
1874
- isActiveCard: i,
1875
- ariaLabel: o,
1876
- heightOverrides: t,
1877
- onCardClick: l,
1878
- posthog: n,
1879
- showIcon: r,
1880
- variant: a,
1881
- widthOverrides: c
1882
- }) => {
1883
- const h = te(), { ref: f, inView: p } = me({
1884
- threshold: Ae
1885
- }), { cardsCopy: d } = V(), { onEvent: E } = z();
1886
- ee(() => {
1887
- p && (E(ve.ON_VIEW_MORE_VIEWED), n?.capture("viewed_insight", {
1888
- template: "view_more_card"
1889
- }));
1890
- }, [p]);
1891
- const s = () => {
1892
- l && l(), E(S.ON_VIEW_MORE_CLICKED), n?.capture("clicked_insight", {
1893
- template: "view_more_card"
1894
- });
1895
- };
1896
- return /* @__PURE__ */ e(
1897
- j,
1898
- {
1899
- actionText: d.micro_card_cta,
1900
- ariaLabel: o,
1901
- description: d.view_more_card_description,
1902
- heightOverrides: t,
1903
- icon: /* @__PURE__ */ e(at, { color: h.palette.primary.main }),
1904
- isActiveCard: i,
1905
- onCardClick: s,
1906
- posthog: n,
1907
- ref: f,
1908
- showIcon: r,
1909
- title: d.view_more_card_title,
1910
- variant: a,
1911
- widthOverrides: c
1912
- }
1913
- );
1914
- }, At = P(Mt);
1915
- export {
1916
- ot as A,
1917
- j as B,
1918
- It as C,
1919
- lt as I,
1920
- Rt as M,
1921
- Qt as N,
1922
- Ee as T,
1923
- At as V,
1924
- qt as Z,
1925
- _t as a,
1926
- Jt as b,
1927
- at as c,
1928
- dt as d,
1929
- Se as e
1930
- };