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