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