@mx-cartographer/experiences 7.3.0-alpha.sms1 → 7.3.1
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 +75 -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-DNSgmdyv.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-CtGTg0XS.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-C4PkIYP6.mjs +48 -0
- 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 +328 -304
- 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 +3 -3
- 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/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
- package/dist/useAriaLive-B3_pRUio.mjs +0 -35
package/dist/trends/index.es.js
CHANGED
|
@@ -1,75 +1,440 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as f, jsx as e, Fragment as rt } from "react/jsx-runtime";
|
|
2
|
+
import d, { useRef as at, useState as it, useEffect as ct } from "react";
|
|
3
|
+
import { observer as H } from "mobx-react-lite";
|
|
4
|
+
import { CategoryIcon as Se, Text as K, Icon as fe, P as he, H3 as Pe, ChevronRightIcon as lt } from "@mxenabled/mxui";
|
|
5
|
+
import W from "@mui/material/Box";
|
|
6
6
|
import b from "@mui/material/Stack";
|
|
7
|
-
import
|
|
8
|
-
import { addSeconds as
|
|
9
|
-
import { differenceInCalendarMonths as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { a as
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
|
|
51
|
-
|
|
7
|
+
import _e from "@mui/material/Button";
|
|
8
|
+
import { addSeconds as $e } from "date-fns/addSeconds";
|
|
9
|
+
import { differenceInCalendarMonths as Ae } from "date-fns/differenceInCalendarMonths";
|
|
10
|
+
import { useTheme as be } from "@mui/material/styles";
|
|
11
|
+
import { LineChart as dt } from "@mui/x-charts";
|
|
12
|
+
import { u as ee } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
13
|
+
import { u as ut } from "../useDimensions-27p2evRx.mjs";
|
|
14
|
+
import ht from "@mui/material/Card";
|
|
15
|
+
import gt from "@mui/material/CardContent";
|
|
16
|
+
import Re from "@mui/material/Divider";
|
|
17
|
+
import We from "@mui/material/Grid";
|
|
18
|
+
import { u as O, m as U, g as P, b as me, h as xe, d as ve, x as pe, f as He, q as mt, n as pt, a as Ct } from "../hooks-Cy8JnjCg.mjs";
|
|
19
|
+
import { b as Fe } from "../Localization-2MODESHW.mjs";
|
|
20
|
+
import { C as Te } from "../CurrencyText-kyC1aseI.mjs";
|
|
21
|
+
import { useTheme as ze, Card as yt, CardContent as ft, Box as _t, Stack as Tt } from "@mui/material";
|
|
22
|
+
import { f as J, D as z } from "../Dialog-CWW597AF.mjs";
|
|
23
|
+
import { C as Me, c as St } from "../Category-CevNQ03n.mjs";
|
|
24
|
+
import { f as oe, a as bt } from "../NumberFormatting-Buh7u8Oi.mjs";
|
|
25
|
+
import { a as xt, g as vt, L as Ke } from "../TrendsStore-5PvDT_o6.mjs";
|
|
26
|
+
import { T as Gn } from "../TrendsStore-5PvDT_o6.mjs";
|
|
27
|
+
import { i as wt, c as Dt, d as It, e as Et, f as Lt, h as Mt, b as je, g as Ye, j as Oe } from "../SpendingData-D5vsfYKo.mjs";
|
|
28
|
+
import At from "@mui/material/ToggleButton";
|
|
29
|
+
import Rt from "@mui/material/ToggleButtonGroup";
|
|
30
|
+
import { DataGridPro as kt } from "@mui/x-data-grid-pro";
|
|
31
|
+
import { H as Ge } from "../HeaderCell-DjuifqHJ.mjs";
|
|
32
|
+
import { T as G, b as Ht } from "../ViewMoreMicroCard-lihSDk2J.mjs";
|
|
33
|
+
import { A as w, W as Ue } from "../WidgetContainer-BnTgAfQn.mjs";
|
|
34
|
+
import { a as Xe, T as Ze } from "../TransactionDetails-BUoNbsu-.mjs";
|
|
35
|
+
import { D as ke } from "../Drawer-kEE73B87.mjs";
|
|
36
|
+
import { L as ge } from "../Loader-DUaFpDGv.mjs";
|
|
37
|
+
import { L as Ne } from "../LineChart-eK4IQImU.mjs";
|
|
38
|
+
import { M as Nt } from "../MiniWidgetContainer-BdgBvpga.mjs";
|
|
39
|
+
import { subMonths as Wt } from "date-fns";
|
|
40
|
+
import { TrendingUp as Ot, TrendingDown as Gt, MultilineChart as Bt, ExpandLess as Vt, ExpandMore as Pt } from "@mxenabled/mx-icons";
|
|
41
|
+
import { M as $t } from "../MicroWidgetContainer-CFdMGJKg.mjs";
|
|
42
|
+
import Ft from "@mui/material/Collapse";
|
|
43
|
+
import zt from "@mui/material/List";
|
|
44
|
+
import Kt from "@mui/material/ListItem";
|
|
45
|
+
import jt from "@mui/material/ListItemButton";
|
|
46
|
+
import Yt from "@mui/material/ListItemIcon";
|
|
47
|
+
import Ut from "@mui/material/ListItemText";
|
|
48
|
+
import qe from "@mui/material/styles/useTheme";
|
|
49
|
+
import Xt from "@mui/material/Paper";
|
|
50
|
+
import { b as Zt } from "../CategoryUtil-BR3H5i6n.mjs";
|
|
51
|
+
import { E as qt } from "../ExportCsvAction-DNSgmdyv.mjs";
|
|
52
|
+
import { u as Qt } from "../useInsightsEnabled-BxytCjq5.mjs";
|
|
53
|
+
import { E as Jt } from "../EmptyState-DA_lfRBv.mjs";
|
|
54
|
+
import { l as eo } from "../ConnectDrawer-CbxHKlRv.mjs";
|
|
55
|
+
const Qe = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
56
|
+
const { categories: t } = O(), { getCategoryName: n } = U(), r = n(o);
|
|
57
|
+
return /* @__PURE__ */ f(b, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
|
|
58
|
+
/* @__PURE__ */ e(
|
|
59
|
+
W,
|
|
60
|
+
{
|
|
61
|
+
"aria-label": Fe(t.category_icon_label_aria, r),
|
|
62
|
+
mb: 4,
|
|
63
|
+
role: "img",
|
|
64
|
+
children: /* @__PURE__ */ e(Se, { categoryGuid: s })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ e(K, { variant: "Body", children: r })
|
|
68
|
+
] });
|
|
69
|
+
}, to = ({
|
|
70
|
+
categoryGuids: { guid: o, topLevelGuid: s },
|
|
71
|
+
hoveredAreaData: t,
|
|
72
|
+
cursorPosition: n,
|
|
73
|
+
chartContainerRef: r
|
|
74
|
+
}) => {
|
|
75
|
+
const u = be(), h = at(null), [g, c] = it({ x: n.x, y: n.y });
|
|
76
|
+
if (ct(() => {
|
|
77
|
+
(() => {
|
|
78
|
+
const l = h.current, _ = r.current;
|
|
79
|
+
if (!l || !_) return;
|
|
80
|
+
const m = l.getBoundingClientRect(), i = _.getBoundingClientRect();
|
|
81
|
+
let T = n.x, y = n.y;
|
|
82
|
+
T + m.width * 2 > i.right ? T = n.x - m.width : T - m.width < i.left && (T = n.x), y + m.height * 2 > i.bottom && (y = n.y - m.height), c({ x: T, y });
|
|
83
|
+
})();
|
|
84
|
+
}, [n, r]), !t) return null;
|
|
85
|
+
const p = t.reduce((C, l) => C + l.y, 0);
|
|
86
|
+
return /* @__PURE__ */ e(
|
|
87
|
+
ht,
|
|
88
|
+
{
|
|
89
|
+
ref: h,
|
|
90
|
+
sx: {
|
|
91
|
+
position: "absolute",
|
|
92
|
+
top: g.y,
|
|
93
|
+
left: g.x,
|
|
94
|
+
width: 250,
|
|
95
|
+
pointerEvents: "none"
|
|
96
|
+
},
|
|
97
|
+
children: /* @__PURE__ */ f(gt, { children: [
|
|
98
|
+
/* @__PURE__ */ f(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
99
|
+
/* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: s }),
|
|
100
|
+
/* @__PURE__ */ e(K, { variant: "Small", children: `${t.length}-month total` }),
|
|
101
|
+
/* @__PURE__ */ e(Te, { amount: p, bold: !0, formatString: "0,0", variant: "body2" })
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
|
|
104
|
+
/* @__PURE__ */ e(We, { container: !0, children: t.map((C, l) => /* @__PURE__ */ f(d.Fragment, { children: [
|
|
105
|
+
l > 0 && l % 3 === 0 && /* @__PURE__ */ e(Re, { sx: { my: 16, width: "100%" } }),
|
|
106
|
+
/* @__PURE__ */ e(We, { item: !0, xs: 4, children: /* @__PURE__ */ f(W, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
107
|
+
/* @__PURE__ */ e(K, { color: u.palette.text.secondary, variant: "XSmall", children: C.x }),
|
|
108
|
+
/* @__PURE__ */ e(
|
|
109
|
+
Te,
|
|
110
|
+
{
|
|
111
|
+
amount: C.y,
|
|
112
|
+
bold: !0,
|
|
113
|
+
formatString: "0,0",
|
|
114
|
+
variant: "Body"
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] }) })
|
|
118
|
+
] }, l)) })
|
|
119
|
+
] })
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}, oo = H(to), no = ({
|
|
123
|
+
categoryGuids: { guid: o, topLevelGuid: s },
|
|
124
|
+
itemData: { dataIndex: t },
|
|
125
|
+
series: n,
|
|
126
|
+
xData: r
|
|
127
|
+
}) => {
|
|
128
|
+
const u = ze(), h = n.data[t], g = r[t];
|
|
129
|
+
return h === void 0 || !g ? null : /* @__PURE__ */ e(yt, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ f(_t, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
130
|
+
/* @__PURE__ */ e(Qe, { categoryGuid: o, topLevelCategoryGuid: s }),
|
|
131
|
+
/* @__PURE__ */ e(K, { color: u.palette.text.secondary, variant: "Small", children: J(g, z.MONTH_SHORT_YEAR) }),
|
|
132
|
+
/* @__PURE__ */ e(Te, { amount: String(h), bold: !0, formatString: "0,0", variant: "Body" })
|
|
133
|
+
] }) }) });
|
|
134
|
+
}, so = ({
|
|
135
|
+
sx: o,
|
|
136
|
+
categoryGuids: s,
|
|
137
|
+
hoveredLegend: t,
|
|
138
|
+
legendRef: n,
|
|
139
|
+
onHoverLegend: r,
|
|
140
|
+
onClickLegend: u
|
|
141
|
+
}) => {
|
|
142
|
+
const { isMobile: h } = ee(), { getCategoryName: g } = U();
|
|
143
|
+
return /* @__PURE__ */ e(
|
|
144
|
+
b,
|
|
145
|
+
{
|
|
146
|
+
direction: "row",
|
|
147
|
+
flexWrap: "wrap",
|
|
148
|
+
gap: h ? 2 : 6,
|
|
149
|
+
justifyContent: "start",
|
|
150
|
+
ref: n,
|
|
151
|
+
sx: o,
|
|
152
|
+
children: s.map(({ guid: c, top_level_guid: p }) => {
|
|
153
|
+
const C = t === c, l = Me[c], _ = Me[p], m = l ?? _ ?? Me.default, i = m + "33";
|
|
154
|
+
return /* @__PURE__ */ f(
|
|
155
|
+
_e,
|
|
156
|
+
{
|
|
157
|
+
onClick: () => u(c),
|
|
158
|
+
onMouseEnter: () => r(c),
|
|
159
|
+
onMouseLeave: () => r(null),
|
|
160
|
+
sx: {
|
|
161
|
+
color: "text.primary",
|
|
162
|
+
fontWeight: "normal",
|
|
163
|
+
display: "flex",
|
|
164
|
+
justifyContent: "center",
|
|
165
|
+
alignItems: "center",
|
|
166
|
+
paddingX: 8,
|
|
167
|
+
paddingY: 4,
|
|
168
|
+
borderRadius: 1,
|
|
169
|
+
opacity: C ? 1 : 0.7
|
|
170
|
+
},
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ e(
|
|
173
|
+
W,
|
|
174
|
+
{
|
|
175
|
+
sx: {
|
|
176
|
+
width: 16,
|
|
177
|
+
height: 16,
|
|
178
|
+
marginRight: h ? 5 : 10,
|
|
179
|
+
borderRadius: "2px",
|
|
180
|
+
backgroundColor: t ? C ? m : i : m
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
/* @__PURE__ */ e(K, { variant: "Body", children: g(c) })
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
c
|
|
188
|
+
);
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
}, ro = ({
|
|
193
|
+
onHoverArea: o,
|
|
194
|
+
onHoverPoint: s,
|
|
195
|
+
onHoverLegend: t,
|
|
196
|
+
onClickLegend: n,
|
|
197
|
+
stackedDatasets: r,
|
|
198
|
+
unstackedDatasets: u = [],
|
|
199
|
+
availableHeight: h = 0,
|
|
200
|
+
minimumHeight: g = 350
|
|
201
|
+
}) => {
|
|
202
|
+
const c = be(), { isMobile: p } = ee(), [C, { height: l }] = ut(), _ = d.useRef(null), [m, i] = d.useState(0);
|
|
203
|
+
d.useEffect(() => {
|
|
204
|
+
const a = Math.max(h - l, g);
|
|
205
|
+
i(a);
|
|
206
|
+
}, [h, l]);
|
|
207
|
+
const [T, y] = d.useState(null), [L, x] = d.useState({
|
|
208
|
+
hoveredSeriesId: null,
|
|
209
|
+
hoveredAreaData: null,
|
|
210
|
+
isAreaHovered: !1,
|
|
211
|
+
cursorPos: { x: 0, y: 0 }
|
|
212
|
+
}), { hoveredSeriesId: v, hoveredAreaData: A, isAreaHovered: R, cursorPos: M } = L, k = R && v && A, E = !k, X = [...r, ...u], ne = X[0]?.dataset.length ?? 0, B = X.flatMap((a) => a.dataset.map((S) => S.x)), Ce = X.flatMap((a) => a.dataset.map((S) => S.y)), ae = r[0]?.dataset?.map(
|
|
213
|
+
(a, S) => r.reduce((I, Y) => I + Y.dataset[S]?.y || 0, 0)
|
|
214
|
+
) ?? [0], Z = Math.max(...ae), ie = Math.max(
|
|
215
|
+
...u.flatMap((a) => a.dataset.map((S) => S.y))
|
|
216
|
+
), q = Math.floor(Math.min(...Ce) / 100) * 100, ce = Math.ceil(Math.max(Z, ie) / 100) * 100, $ = r.map((a, S) => ({
|
|
217
|
+
id: `stacked-${S}`,
|
|
218
|
+
guid: a.category_guid,
|
|
219
|
+
top_level_guid: a.top_level_category_guid,
|
|
220
|
+
area: !0,
|
|
221
|
+
color: r[S].category_color ?? c.palette.primary.main,
|
|
222
|
+
data: a.dataset.map((I) => I.y),
|
|
223
|
+
label: r[S].category_name,
|
|
224
|
+
stack: "total",
|
|
225
|
+
type: "line",
|
|
226
|
+
highlightScope: { highlight: "item" },
|
|
227
|
+
valueFormatter: (I) => oe(I, "0,0")
|
|
228
|
+
})), te = u.map((a, S) => ({
|
|
229
|
+
id: `unstacked-${S}`,
|
|
230
|
+
guid: a.category_guid,
|
|
231
|
+
top_level_guid: a.top_level_category_guid,
|
|
232
|
+
area: !1,
|
|
233
|
+
color: a.category_color,
|
|
234
|
+
data: a.dataset.map((I) => I.y),
|
|
235
|
+
label: a.category_name,
|
|
236
|
+
type: "line",
|
|
237
|
+
valueFormatter: (I) => oe(I, "0,0")
|
|
238
|
+
})), se = [...$, ...te], re = [
|
|
239
|
+
...$.map(({ guid: a, top_level_guid: S }) => ({
|
|
240
|
+
guid: a,
|
|
241
|
+
top_level_guid: S
|
|
242
|
+
})),
|
|
243
|
+
...te.map(({ guid: a, top_level_guid: S }) => ({
|
|
244
|
+
guid: a,
|
|
245
|
+
top_level_guid: S
|
|
246
|
+
}))
|
|
247
|
+
], j = (a) => {
|
|
248
|
+
const I = a.startsWith("stacked-") ? r[parseInt(a.split("-")[1])] : u[parseInt(a.split("-")[1])];
|
|
249
|
+
return {
|
|
250
|
+
guid: I?.category_guid,
|
|
251
|
+
topLevelGuid: I?.top_level_category_guid
|
|
252
|
+
};
|
|
253
|
+
}, D = (a) => {
|
|
254
|
+
y(a), t?.(a ?? "");
|
|
255
|
+
}, V = (a) => {
|
|
256
|
+
n?.(a ?? "");
|
|
257
|
+
}, F = () => {
|
|
258
|
+
const a = j(String(v)).guid;
|
|
259
|
+
a && n?.(a);
|
|
260
|
+
}, le = (a) => {
|
|
261
|
+
const S = String(a?.seriesId), I = j(S).guid, Y = se.find((de) => de.id === S), De = Y && a?.dataIndex !== void 0, Ie = Y && a?.dataIndex === void 0;
|
|
262
|
+
if (De)
|
|
263
|
+
x({
|
|
264
|
+
hoveredSeriesId: S,
|
|
265
|
+
hoveredAreaData: null,
|
|
266
|
+
isAreaHovered: !1,
|
|
267
|
+
cursorPos: M
|
|
268
|
+
}), s?.(I);
|
|
269
|
+
else if (Ie) {
|
|
270
|
+
const de = Y?.data.map((Ee, Le) => ({
|
|
271
|
+
x: B[Le],
|
|
272
|
+
y: Ee
|
|
273
|
+
})) ?? [];
|
|
274
|
+
x({
|
|
275
|
+
hoveredSeriesId: S,
|
|
276
|
+
hoveredAreaData: de,
|
|
277
|
+
isAreaHovered: !0,
|
|
278
|
+
cursorPos: M
|
|
279
|
+
}), o?.(I);
|
|
280
|
+
} else
|
|
281
|
+
x({
|
|
282
|
+
hoveredSeriesId: null,
|
|
283
|
+
hoveredAreaData: null,
|
|
284
|
+
isAreaHovered: !1,
|
|
285
|
+
cursorPos: M
|
|
286
|
+
});
|
|
287
|
+
}, we = (a) => {
|
|
288
|
+
const S = a.currentTarget.getBoundingClientRect();
|
|
289
|
+
x((I) => ({
|
|
290
|
+
...I,
|
|
291
|
+
cursorPos: {
|
|
292
|
+
x: a.clientX - S.left,
|
|
293
|
+
y: a.clientY - S.top
|
|
294
|
+
}
|
|
295
|
+
}));
|
|
296
|
+
}, ye = {
|
|
297
|
+
p: 4,
|
|
298
|
+
"& .MuiBarLabel-root": {
|
|
299
|
+
fontSize: 10,
|
|
300
|
+
fontWeight: 600
|
|
301
|
+
},
|
|
302
|
+
"& .MuiAreaElement-root": {
|
|
303
|
+
opacity: 0.4,
|
|
304
|
+
transition: "opacity 0.3s ease"
|
|
305
|
+
},
|
|
306
|
+
"& .MuiAreaElement-root:hover": {
|
|
307
|
+
opacity: 1
|
|
308
|
+
},
|
|
309
|
+
'& [class*="MuiLineElement-series-unstacked-"]': {
|
|
310
|
+
strokeWidth: 3
|
|
311
|
+
},
|
|
312
|
+
...T && $.reduce((a, S, I) => {
|
|
313
|
+
const Y = `.MuiAreaElement-series-stacked-${I}`;
|
|
314
|
+
return a[Y] = {
|
|
315
|
+
opacity: $[I].guid === T ? 0.9 : 0.2
|
|
316
|
+
}, a;
|
|
317
|
+
}, {})
|
|
318
|
+
};
|
|
319
|
+
return /* @__PURE__ */ e(
|
|
320
|
+
W,
|
|
321
|
+
{
|
|
322
|
+
onMouseMove: we,
|
|
323
|
+
ref: _,
|
|
324
|
+
sx: {
|
|
325
|
+
position: "relative",
|
|
326
|
+
touchAction: "pan-y",
|
|
327
|
+
"& svg": {
|
|
328
|
+
touchAction: "pan-y",
|
|
329
|
+
userSelect: "none"
|
|
330
|
+
},
|
|
331
|
+
"& .recharts-wrapper": {
|
|
332
|
+
touchAction: "pan-y"
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
children: /* @__PURE__ */ f(
|
|
336
|
+
b,
|
|
337
|
+
{
|
|
338
|
+
direction: { xs: "column", md: "column" },
|
|
339
|
+
spacing: { xs: 0, md: 4 },
|
|
340
|
+
sx: { width: "100%", position: "relative" },
|
|
341
|
+
children: [
|
|
342
|
+
/* @__PURE__ */ e(
|
|
343
|
+
dt,
|
|
344
|
+
{
|
|
345
|
+
height: m,
|
|
346
|
+
margin: { bottom: 50 },
|
|
347
|
+
onAreaClick: F,
|
|
348
|
+
onHighlightChange: le,
|
|
349
|
+
series: se,
|
|
350
|
+
skipAnimation: !0,
|
|
351
|
+
slotProps: {
|
|
352
|
+
legend: {
|
|
353
|
+
hidden: !0
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
slots: {
|
|
357
|
+
itemContent: (a) => E && v ? /* @__PURE__ */ e(
|
|
358
|
+
no,
|
|
359
|
+
{
|
|
360
|
+
categoryGuids: j(v),
|
|
361
|
+
xData: B,
|
|
362
|
+
...a
|
|
363
|
+
}
|
|
364
|
+
) : null
|
|
365
|
+
},
|
|
366
|
+
sx: ye,
|
|
367
|
+
tooltip: {
|
|
368
|
+
trigger: E ? "item" : "none"
|
|
369
|
+
},
|
|
370
|
+
xAxis: [
|
|
371
|
+
{
|
|
372
|
+
data: B,
|
|
373
|
+
scaleType: "time",
|
|
374
|
+
valueFormatter: (a) => J(a, z.MONTH_SHORT_YEAR),
|
|
375
|
+
tickNumber: ne
|
|
376
|
+
// How many ticks to show on the x-axis
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
yAxis: [
|
|
380
|
+
{
|
|
381
|
+
min: q,
|
|
382
|
+
max: ce || 100
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
/* @__PURE__ */ e(
|
|
388
|
+
so,
|
|
389
|
+
{
|
|
390
|
+
categoryGuids: re,
|
|
391
|
+
hoveredLegend: T,
|
|
392
|
+
legendRef: C,
|
|
393
|
+
onClickLegend: V,
|
|
394
|
+
onHoverLegend: D,
|
|
395
|
+
sx: { px: p ? 0 : 24 }
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
k && /* @__PURE__ */ e(
|
|
399
|
+
oo,
|
|
400
|
+
{
|
|
401
|
+
categoryGuids: j(v),
|
|
402
|
+
chartContainerRef: _,
|
|
403
|
+
cursorPosition: M,
|
|
404
|
+
hoveredAreaData: A.map((a) => ({
|
|
405
|
+
...a,
|
|
406
|
+
x: J(a.x, z.MONTH_SHORT_YEAR)
|
|
407
|
+
}))
|
|
408
|
+
}
|
|
409
|
+
)
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
)
|
|
413
|
+
}
|
|
414
|
+
);
|
|
415
|
+
}, Je = ({ selectedTab: o, onTabChange: s }) => /* @__PURE__ */ e(
|
|
416
|
+
Rt,
|
|
52
417
|
{
|
|
53
418
|
exclusive: !0,
|
|
54
|
-
onChange:
|
|
419
|
+
onChange: s,
|
|
55
420
|
orientation: "horizontal",
|
|
56
|
-
value:
|
|
57
|
-
children: ["Chart", "Table"].map((
|
|
421
|
+
value: o,
|
|
422
|
+
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(At, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(fe, { name: "table_chart_view" }) : /* @__PURE__ */ e(fe, { name: "format_list_bulleted" }) }, t))
|
|
58
423
|
}
|
|
59
|
-
),
|
|
60
|
-
const { trends:
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
), c =
|
|
65
|
-
|
|
66
|
-
|
|
424
|
+
), et = ({ selectedDateRange: o, selectedCategoryGuid: s }) => {
|
|
425
|
+
const { trends: t } = O(), { isMobile: n, isDesktop: r } = ee(), { getCategoryName: u } = U(), h = d.useMemo(() => {
|
|
426
|
+
const g = J(
|
|
427
|
+
o.start,
|
|
428
|
+
n ? z.MONTH_SHORT_YEAR : z.MONTH_YEAR
|
|
429
|
+
), c = J(
|
|
430
|
+
o.end,
|
|
431
|
+
n ? z.MONTH_SHORT_YEAR : z.MONTH_YEAR
|
|
67
432
|
);
|
|
68
|
-
return `${
|
|
69
|
-
}, [
|
|
70
|
-
return /* @__PURE__ */
|
|
433
|
+
return `${g} - ${c}`;
|
|
434
|
+
}, [o, n]);
|
|
435
|
+
return /* @__PURE__ */ f(W, { sx: { mr: 10, minWidth: "60%" }, children: [
|
|
71
436
|
/* @__PURE__ */ e(
|
|
72
|
-
|
|
437
|
+
K,
|
|
73
438
|
{
|
|
74
439
|
display: "block",
|
|
75
440
|
fontWeight: 700,
|
|
@@ -79,271 +444,271 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
79
444
|
textOverflow: "unset"
|
|
80
445
|
},
|
|
81
446
|
variant: r ? "H3" : "Body",
|
|
82
|
-
children:
|
|
447
|
+
children: u(s) || t.sub_title
|
|
83
448
|
}
|
|
84
449
|
),
|
|
85
|
-
/* @__PURE__ */ e(
|
|
450
|
+
/* @__PURE__ */ e(K, { variant: r ? "Body" : "Small", children: h })
|
|
86
451
|
] });
|
|
87
|
-
},
|
|
88
|
-
const
|
|
89
|
-
return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex:
|
|
90
|
-
},
|
|
91
|
-
const { getCategoryName:
|
|
92
|
-
return /* @__PURE__ */
|
|
452
|
+
}, ao = (o) => {
|
|
453
|
+
const s = o.row[o.field];
|
|
454
|
+
return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(Te, { amount: s, variant: "Small" }) });
|
|
455
|
+
}, io = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
|
|
456
|
+
const { getCategoryName: t } = U(), { categories: n } = O(), r = n.default_categories[o]?.replace(/&/g, "&") ?? t(o);
|
|
457
|
+
return /* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "center", children: [
|
|
93
458
|
/* @__PURE__ */ e(
|
|
94
|
-
|
|
459
|
+
W,
|
|
95
460
|
{
|
|
96
|
-
"aria-label":
|
|
461
|
+
"aria-label": Fe(n.category_icon_label_aria, r),
|
|
97
462
|
role: "img",
|
|
98
|
-
children: /* @__PURE__ */ e(
|
|
463
|
+
children: /* @__PURE__ */ e(Se, { categoryGuid: s })
|
|
99
464
|
}
|
|
100
465
|
),
|
|
101
|
-
/* @__PURE__ */ e(
|
|
466
|
+
/* @__PURE__ */ e(K, { sx: { ml: 12, pb: 6 }, variant: "Small", children: r })
|
|
102
467
|
] });
|
|
103
|
-
},
|
|
104
|
-
|
|
468
|
+
}, co = (o) => /* @__PURE__ */ e(b, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
|
|
469
|
+
io,
|
|
105
470
|
{
|
|
106
|
-
categoryGuid:
|
|
107
|
-
topLevelCategoryGuid:
|
|
471
|
+
categoryGuid: o.row.category,
|
|
472
|
+
topLevelCategoryGuid: o.row.top_level_category_guid
|
|
108
473
|
}
|
|
109
|
-
) }),
|
|
110
|
-
const
|
|
111
|
-
for (;
|
|
112
|
-
const r =
|
|
113
|
-
|
|
474
|
+
) }), lo = (o, s) => {
|
|
475
|
+
const t = [], n = new Date(o);
|
|
476
|
+
for (; n <= s; ) {
|
|
477
|
+
const r = J(n, z.MONTH);
|
|
478
|
+
t.push(r), n.setMonth(n.getMonth() + 1);
|
|
114
479
|
}
|
|
115
|
-
return
|
|
116
|
-
},
|
|
117
|
-
monthlyCategoryTotals:
|
|
118
|
-
selectedDateRange:
|
|
119
|
-
selectedCategory:
|
|
120
|
-
onClickRow:
|
|
480
|
+
return t;
|
|
481
|
+
}, tt = ({
|
|
482
|
+
monthlyCategoryTotals: o,
|
|
483
|
+
selectedDateRange: s,
|
|
484
|
+
selectedCategory: t,
|
|
485
|
+
onClickRow: n,
|
|
121
486
|
height: r = "100dvh",
|
|
122
|
-
sx:
|
|
487
|
+
sx: u = {}
|
|
123
488
|
}) => {
|
|
124
|
-
const { onEvent:
|
|
125
|
-
{ field:
|
|
126
|
-
]),
|
|
489
|
+
const { onEvent: h } = P(), g = J(/* @__PURE__ */ new Date(), z.MONTH_SHORT), [c, p] = d.useState([
|
|
490
|
+
{ field: g, sort: "desc" }
|
|
491
|
+
]), C = d.useMemo(() => lo(s.start, s.end), [s]), l = [
|
|
127
492
|
{
|
|
128
493
|
field: "category",
|
|
129
494
|
flex: 1,
|
|
130
495
|
headerName: "Category",
|
|
131
496
|
minWidth: 175,
|
|
132
|
-
renderHeader:
|
|
133
|
-
renderCell:
|
|
497
|
+
renderHeader: Ge,
|
|
498
|
+
renderCell: co,
|
|
134
499
|
sortable: !0,
|
|
135
500
|
type: "string"
|
|
136
501
|
},
|
|
137
|
-
...
|
|
502
|
+
...C.map(
|
|
138
503
|
(m) => ({
|
|
139
504
|
field: m,
|
|
140
505
|
flex: 1,
|
|
141
506
|
headerName: m,
|
|
142
507
|
minWidth: 100,
|
|
143
|
-
renderHeader:
|
|
144
|
-
renderCell:
|
|
508
|
+
renderHeader: Ge,
|
|
509
|
+
renderCell: ao,
|
|
145
510
|
align: "right",
|
|
146
511
|
headerAlign: "right",
|
|
147
512
|
sortable: !0,
|
|
148
513
|
hideSortIcons: !1,
|
|
149
514
|
type: "number",
|
|
150
|
-
sortComparator:
|
|
515
|
+
sortComparator: xt
|
|
151
516
|
})
|
|
152
517
|
)
|
|
153
|
-
],
|
|
154
|
-
const m =
|
|
155
|
-
(
|
|
156
|
-
),
|
|
157
|
-
(
|
|
518
|
+
], _ = d.useMemo(() => {
|
|
519
|
+
const m = o.filter(
|
|
520
|
+
(y) => !wt(y) && !Dt(y)
|
|
521
|
+
), T = (t ? m.filter(
|
|
522
|
+
(y) => y.category_guid === t || y.top_level_category_guid === t
|
|
158
523
|
) : m).reduce(
|
|
159
|
-
(
|
|
160
|
-
const { category_guid:
|
|
161
|
-
|
|
162
|
-
id:
|
|
163
|
-
category:
|
|
164
|
-
category_guid:
|
|
165
|
-
top_level_category_guid:
|
|
524
|
+
(y, L) => {
|
|
525
|
+
const { category_guid: x, top_level_category_guid: v, month: A, total: R, year: M } = L, k = t ? x : v;
|
|
526
|
+
y[k] || (y[k] = {
|
|
527
|
+
id: k,
|
|
528
|
+
category: k,
|
|
529
|
+
category_guid: x,
|
|
530
|
+
top_level_category_guid: v
|
|
166
531
|
});
|
|
167
|
-
const
|
|
168
|
-
return
|
|
532
|
+
const E = J(new Date(M, A - 1), z.MONTH_SHORT);
|
|
533
|
+
return y[k][E] || (y[k][E] = 0), y[k][E] = y[k][E] + Math.abs(R), y;
|
|
169
534
|
},
|
|
170
535
|
{}
|
|
171
536
|
);
|
|
172
|
-
return Object.values(
|
|
173
|
-
}, [
|
|
174
|
-
return /* @__PURE__ */ e(
|
|
175
|
-
|
|
537
|
+
return Object.values(T);
|
|
538
|
+
}, [o, t]);
|
|
539
|
+
return /* @__PURE__ */ e(W, { sx: { height: r, width: "100%", overflowX: "auto", boxShadow: "none", ...u }, children: /* @__PURE__ */ e(
|
|
540
|
+
kt,
|
|
176
541
|
{
|
|
177
|
-
columns:
|
|
542
|
+
columns: l,
|
|
178
543
|
disableColumnFilter: !0,
|
|
179
544
|
disableColumnMenu: !0,
|
|
180
545
|
hideFooter: !0,
|
|
181
546
|
initialState: { sorting: { sortModel: c } },
|
|
182
547
|
onRowClick: (m) => {
|
|
183
|
-
|
|
184
|
-
...
|
|
185
|
-
listItem:
|
|
548
|
+
n?.(m.row.category), h(w.TRENDS_CLICK_LIST_ITEM, {
|
|
549
|
+
...G,
|
|
550
|
+
listItem: St[m.row.category]
|
|
186
551
|
});
|
|
187
552
|
},
|
|
188
553
|
onSortModelChange: (m) => {
|
|
189
|
-
|
|
554
|
+
p(m), h(w.TRENDS_CLICK_TABLE_SORT, G);
|
|
190
555
|
},
|
|
191
|
-
rows:
|
|
556
|
+
rows: _,
|
|
192
557
|
slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
|
|
193
558
|
sortModel: c,
|
|
194
559
|
sortingOrder: ["asc", "desc"]
|
|
195
560
|
}
|
|
196
561
|
) });
|
|
197
|
-
},
|
|
562
|
+
}, uo = {
|
|
198
563
|
title: "Transaction List"
|
|
199
|
-
},
|
|
200
|
-
categoryGuid:
|
|
201
|
-
dateRange:
|
|
202
|
-
isOpen:
|
|
203
|
-
onClose:
|
|
564
|
+
}, ho = ({
|
|
565
|
+
categoryGuid: o,
|
|
566
|
+
dateRange: s,
|
|
567
|
+
isOpen: t,
|
|
568
|
+
onClose: n
|
|
204
569
|
}) => {
|
|
205
|
-
const { onEvent: r } =
|
|
206
|
-
() => c.find((m) => m.guid ===
|
|
207
|
-
[
|
|
570
|
+
const { onEvent: r } = P(), { selectedAccountGuids: u } = me(), { common: h } = O(), { setFilter: g, sortedTransactions: c } = xe(), [p, C] = d.useState(""), l = d.useMemo(
|
|
571
|
+
() => c.find((m) => m.guid === p),
|
|
572
|
+
[p, c]
|
|
208
573
|
);
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
accounts:
|
|
212
|
-
dateRange:
|
|
213
|
-
custom: (m) =>
|
|
214
|
-
showSplits: !!
|
|
574
|
+
d.useEffect(() => {
|
|
575
|
+
g({
|
|
576
|
+
accounts: u,
|
|
577
|
+
dateRange: s,
|
|
578
|
+
custom: (m) => o === "" || o === m.category_guid || o === m.top_level_category_guid,
|
|
579
|
+
showSplits: !!o
|
|
215
580
|
});
|
|
216
|
-
}, [
|
|
217
|
-
const
|
|
218
|
-
|
|
581
|
+
}, [u, o, s]), d.useEffect(() => r(w.TRENDS_VIEW_TRANSACTIONS), []);
|
|
582
|
+
const _ = () => {
|
|
583
|
+
C(""), n();
|
|
219
584
|
};
|
|
220
|
-
return /* @__PURE__ */
|
|
221
|
-
|
|
585
|
+
return /* @__PURE__ */ f(
|
|
586
|
+
ke,
|
|
222
587
|
{
|
|
223
|
-
ariaLabelClose:
|
|
224
|
-
isOpen:
|
|
225
|
-
onClose:
|
|
226
|
-
title:
|
|
588
|
+
ariaLabelClose: h.close_aria,
|
|
589
|
+
isOpen: t,
|
|
590
|
+
onClose: _,
|
|
591
|
+
title: uo.title,
|
|
227
592
|
children: [
|
|
228
|
-
|
|
229
|
-
!
|
|
593
|
+
l && /* @__PURE__ */ e(Xe, { transaction: l }),
|
|
594
|
+
!l && /* @__PURE__ */ e(Ze, { onClick: C })
|
|
230
595
|
]
|
|
231
596
|
}
|
|
232
597
|
);
|
|
233
|
-
},
|
|
234
|
-
const { onEvent:
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
return window.addEventListener("resize",
|
|
238
|
-
}, []),
|
|
239
|
-
|
|
240
|
-
}, [
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
598
|
+
}, go = H(ho), mo = ({ onBackClick: o, sx: s }) => {
|
|
599
|
+
const { onEvent: t } = P(), { isDesktop: n, isTablet: r, isMobile: u } = ee(), { visibleAccounts: h } = ve(), { loadMonthlyCategoryTotals: g, monthlyCategoryTotals: c, getCategoryName: p } = U(), { sortedTransactions: C } = xe(), { selectedDateRange: l, setSelectedDateRange: _ } = pe(), { isCopyLoaded: m, isInitialized: i, selectedAccounts: T, setSelectedAccounts: y } = me(), { trends: L } = O(), [x, v] = d.useState(!1), [A, R] = d.useState(!1), [M, k] = d.useState("Chart"), [E, X] = d.useState(""), [ne, B] = d.useState(window.innerHeight), ae = ne - (u ? 315 : 345);
|
|
600
|
+
d.useEffect(() => {
|
|
601
|
+
const D = () => B(window.innerHeight);
|
|
602
|
+
return window.addEventListener("resize", D), () => window.removeEventListener("resize", D);
|
|
603
|
+
}, []), d.useEffect(() => {
|
|
604
|
+
y(h);
|
|
605
|
+
}, [h]), d.useEffect(() => {
|
|
606
|
+
i && g(
|
|
607
|
+
T,
|
|
608
|
+
l.start,
|
|
609
|
+
l.end
|
|
245
610
|
).finally(() => {
|
|
246
|
-
|
|
611
|
+
v(!0);
|
|
247
612
|
});
|
|
248
|
-
}, [
|
|
249
|
-
const
|
|
250
|
-
if (!
|
|
251
|
-
const
|
|
613
|
+
}, [i, T, l]);
|
|
614
|
+
const Z = d.useMemo(() => {
|
|
615
|
+
if (!x) return { stackedDatasets: [], unstackedDatasets: [] };
|
|
616
|
+
const D = vt(
|
|
252
617
|
c,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
),
|
|
256
|
-
(
|
|
257
|
-
) :
|
|
618
|
+
l.start,
|
|
619
|
+
l.end
|
|
620
|
+
), V = E.length ? D.filter(
|
|
621
|
+
(F) => F.top_level_category_guid === E || F.category_guid === E
|
|
622
|
+
) : It(D);
|
|
258
623
|
return {
|
|
259
|
-
stackedDatasets:
|
|
260
|
-
unstackedDatasets:
|
|
624
|
+
stackedDatasets: V.filter(Et),
|
|
625
|
+
unstackedDatasets: V.filter(Lt)
|
|
261
626
|
};
|
|
262
|
-
}, [c,
|
|
263
|
-
|
|
264
|
-
},
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
time_period:
|
|
627
|
+
}, [c, E, l]), ie = (D, V) => {
|
|
628
|
+
k(V ?? M), t(w.TRENDS_CLICK_TOGGLE_VIEW);
|
|
629
|
+
}, q = (D) => {
|
|
630
|
+
const V = $e(D?.[0], 1), F = D?.[1], le = Ae(F, V);
|
|
631
|
+
_({ start: V, end: F }), t(w.TRENDS_CLICK_TIME_WINDOW, {
|
|
632
|
+
time_period: le + "M"
|
|
268
633
|
});
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
-
},
|
|
280
|
-
|
|
634
|
+
}, ce = () => {
|
|
635
|
+
t(w.TRENDS_CLICK_FILTER);
|
|
636
|
+
}, $ = (D) => {
|
|
637
|
+
X(D);
|
|
638
|
+
}, te = (D) => {
|
|
639
|
+
X(D), t(w.TRENDS_CLICK_LEGEND, { category: p(D) });
|
|
640
|
+
}, se = (D) => {
|
|
641
|
+
t(w.TRENDS_HOVER_LEGEND, { category: p(D) });
|
|
642
|
+
}, re = (D) => {
|
|
643
|
+
t(w.TRENDS_HOVER_AREA, { category: D });
|
|
644
|
+
}, j = (D) => {
|
|
645
|
+
t(w.TRENDS_HOVER_POINT, { category: D });
|
|
281
646
|
};
|
|
282
|
-
return !m || !
|
|
283
|
-
|
|
647
|
+
return !m || !i || !x ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
|
|
648
|
+
Ue,
|
|
284
649
|
{
|
|
285
|
-
accountOptions:
|
|
286
|
-
calendarActions: { onRangeChanged:
|
|
287
|
-
dateRange:
|
|
650
|
+
accountOptions: h,
|
|
651
|
+
calendarActions: { onRangeChanged: q },
|
|
652
|
+
dateRange: l,
|
|
288
653
|
dateRangeVariant: "timeframebuttons",
|
|
289
|
-
onAccountsFilterClick:
|
|
290
|
-
onBackClick:
|
|
291
|
-
sx:
|
|
292
|
-
title:
|
|
654
|
+
onAccountsFilterClick: ce,
|
|
655
|
+
onBackClick: o,
|
|
656
|
+
sx: s,
|
|
657
|
+
title: L.title,
|
|
293
658
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ f(
|
|
295
660
|
b,
|
|
296
661
|
{
|
|
297
662
|
sx: {
|
|
298
663
|
// eslint-disable-next-line no-nested-ternary
|
|
299
|
-
px:
|
|
664
|
+
px: n ? 48 : r ? 24 : 12
|
|
300
665
|
},
|
|
301
666
|
children: [
|
|
302
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ f(
|
|
303
668
|
b,
|
|
304
669
|
{
|
|
305
670
|
flexDirection: "row",
|
|
306
671
|
justifyContent: "space-between",
|
|
307
|
-
sx: { pb:
|
|
672
|
+
sx: { pb: u ? 12 : 24, pt: u ? 24 : 48 },
|
|
308
673
|
children: [
|
|
309
674
|
/* @__PURE__ */ e(
|
|
310
|
-
|
|
675
|
+
et,
|
|
311
676
|
{
|
|
312
|
-
selectedCategoryGuid:
|
|
313
|
-
selectedDateRange:
|
|
677
|
+
selectedCategoryGuid: E,
|
|
678
|
+
selectedDateRange: l
|
|
314
679
|
}
|
|
315
680
|
),
|
|
316
|
-
/* @__PURE__ */ e(
|
|
681
|
+
/* @__PURE__ */ e(Je, { onTabChange: ie, selectedTab: M })
|
|
317
682
|
]
|
|
318
683
|
}
|
|
319
684
|
),
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */ e(
|
|
322
|
-
/* @__PURE__ */ e(
|
|
323
|
-
|
|
685
|
+
/* @__PURE__ */ f(b, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
686
|
+
/* @__PURE__ */ e(W, { flexGrow: 1, children: E && /* @__PURE__ */ f(_e, { onClick: () => X(""), sx: { p: 0, pr: 5 }, children: [
|
|
687
|
+
/* @__PURE__ */ e(fe, { name: "arrow_back" }),
|
|
688
|
+
L.all_categories
|
|
324
689
|
] }) }),
|
|
325
|
-
/* @__PURE__ */ e(
|
|
690
|
+
/* @__PURE__ */ e(_e, { onClick: () => R(!0), sx: { px: 5 }, children: `${L.view_transactions} (${C.length})` })
|
|
326
691
|
] }),
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
|
|
329
|
-
|
|
692
|
+
/* @__PURE__ */ f(W, { children: [
|
|
693
|
+
M === "Chart" && /* @__PURE__ */ e(
|
|
694
|
+
ro,
|
|
330
695
|
{
|
|
331
|
-
availableHeight:
|
|
332
|
-
onClickLegend:
|
|
333
|
-
onHoverArea:
|
|
334
|
-
onHoverLegend:
|
|
335
|
-
onHoverPoint:
|
|
336
|
-
stackedDatasets:
|
|
337
|
-
unstackedDatasets:
|
|
696
|
+
availableHeight: ae,
|
|
697
|
+
onClickLegend: te,
|
|
698
|
+
onHoverArea: re,
|
|
699
|
+
onHoverLegend: se,
|
|
700
|
+
onHoverPoint: j,
|
|
701
|
+
stackedDatasets: Z.stackedDatasets,
|
|
702
|
+
unstackedDatasets: Z.unstackedDatasets
|
|
338
703
|
}
|
|
339
704
|
),
|
|
340
|
-
|
|
341
|
-
|
|
705
|
+
M === "Table" && /* @__PURE__ */ e(
|
|
706
|
+
tt,
|
|
342
707
|
{
|
|
343
708
|
monthlyCategoryTotals: c,
|
|
344
|
-
onClickRow:
|
|
345
|
-
selectedCategory:
|
|
346
|
-
selectedDateRange:
|
|
709
|
+
onClickRow: $,
|
|
710
|
+
selectedCategory: E,
|
|
711
|
+
selectedDateRange: l
|
|
347
712
|
}
|
|
348
713
|
)
|
|
349
714
|
] })
|
|
@@ -351,27 +716,27 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
351
716
|
}
|
|
352
717
|
),
|
|
353
718
|
/* @__PURE__ */ e(
|
|
354
|
-
|
|
719
|
+
go,
|
|
355
720
|
{
|
|
356
|
-
categoryGuid:
|
|
357
|
-
dateRange:
|
|
358
|
-
isOpen:
|
|
359
|
-
onClose: () =>
|
|
721
|
+
categoryGuid: E,
|
|
722
|
+
dateRange: l,
|
|
723
|
+
isOpen: A,
|
|
724
|
+
onClose: () => R(!1)
|
|
360
725
|
}
|
|
361
726
|
)
|
|
362
727
|
]
|
|
363
728
|
}
|
|
364
729
|
);
|
|
365
|
-
},
|
|
366
|
-
const
|
|
730
|
+
}, Rn = H(mo), po = () => {
|
|
731
|
+
const o = be(), { monthlyCategoryTotals: s } = U(), { trends: t } = O(), n = Mt(s);
|
|
367
732
|
return /* @__PURE__ */ e(
|
|
368
|
-
|
|
733
|
+
Ne,
|
|
369
734
|
{
|
|
370
735
|
baseline: "min",
|
|
371
|
-
colors: [
|
|
372
|
-
datasets: [
|
|
736
|
+
colors: [o.palette.primary.main],
|
|
737
|
+
datasets: [n],
|
|
373
738
|
height: 300,
|
|
374
|
-
labels: [
|
|
739
|
+
labels: [t.spending_label],
|
|
375
740
|
showArea: !0,
|
|
376
741
|
showAverage: !0,
|
|
377
742
|
showLegend: !0,
|
|
@@ -380,36 +745,36 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
380
745
|
valueFormatterString: "0,0"
|
|
381
746
|
}
|
|
382
747
|
);
|
|
383
|
-
},
|
|
384
|
-
const { visibleAccounts:
|
|
385
|
-
return
|
|
386
|
-
|
|
387
|
-
}, [
|
|
388
|
-
|
|
389
|
-
}, [
|
|
390
|
-
|
|
748
|
+
}, Co = H(po), yo = ({ onPrimaryCtaClick: o, sx: s }) => {
|
|
749
|
+
const { visibleAccounts: t } = ve(), { loadMonthlyCategoryTotals: n, monthlyTotalsLoaded: r } = U(), { isInitialized: u } = He(), { trends: h } = O(), { isCopyLoaded: g, selectedAccounts: c, setSelectedAccounts: p } = me();
|
|
750
|
+
return d.useEffect(() => {
|
|
751
|
+
p(t);
|
|
752
|
+
}, [t]), d.useEffect(() => {
|
|
753
|
+
u && n(c).finally();
|
|
754
|
+
}, [u, c]), !g || !u ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
755
|
+
Nt,
|
|
391
756
|
{
|
|
392
|
-
onPrimaryCtaClick:
|
|
393
|
-
primaryCtaLabel:
|
|
394
|
-
subTitle:
|
|
395
|
-
sx:
|
|
396
|
-
title:
|
|
397
|
-
children: r ? /* @__PURE__ */ e(
|
|
757
|
+
onPrimaryCtaClick: o,
|
|
758
|
+
primaryCtaLabel: h.primary_cta,
|
|
759
|
+
subTitle: h.sub_title,
|
|
760
|
+
sx: s,
|
|
761
|
+
title: h.mini_title,
|
|
762
|
+
children: r ? /* @__PURE__ */ e(Co, {}) : /* @__PURE__ */ e(ge, {})
|
|
398
763
|
}
|
|
399
764
|
);
|
|
400
|
-
},
|
|
401
|
-
title:
|
|
402
|
-
totalAmount:
|
|
403
|
-
transactionType:
|
|
404
|
-
percentage:
|
|
765
|
+
}, kn = H(yo), fo = 70, Be = ({
|
|
766
|
+
title: o,
|
|
767
|
+
totalAmount: s,
|
|
768
|
+
transactionType: t,
|
|
769
|
+
percentage: n,
|
|
405
770
|
secondaryLabel: r,
|
|
406
|
-
shouldDisplayPercentage:
|
|
771
|
+
shouldDisplayPercentage: u
|
|
407
772
|
}) => {
|
|
408
|
-
const { availableWidth:
|
|
773
|
+
const { availableWidth: h } = mt(), g = d.useRef(null), c = d.useRef(null), p = bt(Number(Math.abs(n)), {
|
|
409
774
|
style: "percent",
|
|
410
775
|
minimumIntegerDigits: 1
|
|
411
|
-
}),
|
|
412
|
-
return /* @__PURE__ */
|
|
776
|
+
}), C = h === 288 && oe(s, "0,0.00").length > 10 ? oe(s, "0,0") : oe(s, "0,0.00"), l = t === "spending" ? n > 0 : n >= 0, _ = t === "spending" ? "error.main" : "success.main", m = t === "spending" ? "success.main" : "text.secondary", i = g?.current, T = c?.current, y = i && T ? i.scrollWidth > T.clientWidth - fo : !1;
|
|
777
|
+
return /* @__PURE__ */ f(
|
|
413
778
|
b,
|
|
414
779
|
{
|
|
415
780
|
sx: {
|
|
@@ -422,7 +787,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
422
787
|
py: 8
|
|
423
788
|
},
|
|
424
789
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
790
|
+
/* @__PURE__ */ f(
|
|
426
791
|
b,
|
|
427
792
|
{
|
|
428
793
|
sx: {
|
|
@@ -431,25 +796,25 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
431
796
|
justifyContent: "space-between"
|
|
432
797
|
},
|
|
433
798
|
children: [
|
|
434
|
-
/* @__PURE__ */ e(
|
|
435
|
-
|
|
436
|
-
|
|
799
|
+
/* @__PURE__ */ e(he, { color: "text.secondary", variant: "caption", children: o }),
|
|
800
|
+
u && /* @__PURE__ */ f(b, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
801
|
+
l ? /* @__PURE__ */ e(Ot, { size: 20, sx: { color: _ } }) : /* @__PURE__ */ e(Gt, { size: 20, sx: { color: m } }),
|
|
437
802
|
/* @__PURE__ */ e(
|
|
438
|
-
|
|
803
|
+
he,
|
|
439
804
|
{
|
|
440
805
|
sx: {
|
|
441
|
-
color:
|
|
806
|
+
color: l ? _ : m,
|
|
442
807
|
fontWeight: 600
|
|
443
808
|
},
|
|
444
809
|
variant: "body2",
|
|
445
|
-
children:
|
|
810
|
+
children: p
|
|
446
811
|
}
|
|
447
812
|
)
|
|
448
813
|
] })
|
|
449
814
|
]
|
|
450
815
|
}
|
|
451
816
|
),
|
|
452
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ f(
|
|
453
818
|
b,
|
|
454
819
|
{
|
|
455
820
|
ref: c,
|
|
@@ -460,17 +825,17 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
460
825
|
},
|
|
461
826
|
children: [
|
|
462
827
|
/* @__PURE__ */ e(
|
|
463
|
-
|
|
828
|
+
W,
|
|
464
829
|
{
|
|
465
|
-
ref:
|
|
830
|
+
ref: g,
|
|
466
831
|
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
467
|
-
children: /* @__PURE__ */ e(
|
|
832
|
+
children: /* @__PURE__ */ e(Pe, { children: C })
|
|
468
833
|
}
|
|
469
834
|
),
|
|
470
|
-
|
|
471
|
-
|
|
835
|
+
u && h >= 450 && !y && /* @__PURE__ */ e(
|
|
836
|
+
he,
|
|
472
837
|
{
|
|
473
|
-
color:
|
|
838
|
+
color: l ? _ : m,
|
|
474
839
|
variant: "caption",
|
|
475
840
|
children: r
|
|
476
841
|
}
|
|
@@ -481,49 +846,49 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
481
846
|
]
|
|
482
847
|
}
|
|
483
848
|
);
|
|
484
|
-
},
|
|
485
|
-
const { trends:
|
|
486
|
-
return /* @__PURE__ */
|
|
487
|
-
/* @__PURE__ */ e(
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */ e(
|
|
490
|
-
/* @__PURE__ */ e(
|
|
849
|
+
}, _o = H(() => {
|
|
850
|
+
const { trends: o } = O();
|
|
851
|
+
return /* @__PURE__ */ f(b, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
|
852
|
+
/* @__PURE__ */ e(Bt, { size: 32 }),
|
|
853
|
+
/* @__PURE__ */ f(b, { children: [
|
|
854
|
+
/* @__PURE__ */ e(he, { fontWeight: 600, variant: "body1", children: o.zero_state_content_header }),
|
|
855
|
+
/* @__PURE__ */ e(he, { color: "text.secondary", variant: "subtitle2", children: o.zero_state_content_description })
|
|
491
856
|
] })
|
|
492
857
|
] });
|
|
493
|
-
}),
|
|
494
|
-
const { visibleAccounts:
|
|
495
|
-
start:
|
|
858
|
+
}), Hn = H(({ onCtaClick: o }) => {
|
|
859
|
+
const { visibleAccounts: s } = ve(), { onEvent: t } = P(), { monthlyCategoryTotals: n, loadMonthlyCategoryTotals: r, monthlyTotalsLoaded: u } = U(), h = {
|
|
860
|
+
start: Wt(/* @__PURE__ */ new Date(), 1),
|
|
496
861
|
end: /* @__PURE__ */ new Date()
|
|
497
|
-
}, { trends:
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}, [
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
state:
|
|
862
|
+
}, { trends: g } = O(), { selectedAccounts: c, setSelectedAccounts: p, isInitialized: C } = me();
|
|
863
|
+
d.useEffect(() => {
|
|
864
|
+
p(s);
|
|
865
|
+
}, [s]), d.useEffect(() => {
|
|
866
|
+
C && r(c, h.start).then(() => {
|
|
867
|
+
t(w.TRENDS_LOAD_WIDGET, {
|
|
868
|
+
state: s?.length ? "default" : "zeroState"
|
|
504
869
|
});
|
|
505
870
|
});
|
|
506
|
-
}, [
|
|
507
|
-
const { spendingData:
|
|
871
|
+
}, [C, c]);
|
|
872
|
+
const { spendingData: l, incomeData: _ } = d.useMemo(
|
|
508
873
|
() => ({
|
|
509
|
-
spendingData:
|
|
510
|
-
incomeData:
|
|
874
|
+
spendingData: je(n, h),
|
|
875
|
+
incomeData: Ye(n, h)
|
|
511
876
|
}),
|
|
512
|
-
[
|
|
513
|
-
), [m,
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
),
|
|
877
|
+
[n, h]
|
|
878
|
+
), [m, i] = l, [T, y] = _, L = Oe(i.y, m.y), x = Oe(y.y, T.y), v = C && !s?.length, A = () => {
|
|
879
|
+
t(
|
|
880
|
+
v ? w.TRENDS_CLICK_GET_STARTED : w.TRENDS_CLICK_VIEW_MORE
|
|
881
|
+
), o();
|
|
517
882
|
};
|
|
518
|
-
return !
|
|
519
|
-
|
|
883
|
+
return !u || !C ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
884
|
+
$t,
|
|
520
885
|
{
|
|
521
886
|
className: "mx-trends-microwidget",
|
|
522
|
-
ctaLabel:
|
|
523
|
-
onCTAClick:
|
|
524
|
-
subHeader:
|
|
525
|
-
title:
|
|
526
|
-
children:
|
|
887
|
+
ctaLabel: g.micro_primary_cta_label,
|
|
888
|
+
onCTAClick: A,
|
|
889
|
+
subHeader: v ? void 0 : g.micro_subheader,
|
|
890
|
+
title: g.title,
|
|
891
|
+
children: v ? /* @__PURE__ */ e(_o, {}) : /* @__PURE__ */ f(
|
|
527
892
|
b,
|
|
528
893
|
{
|
|
529
894
|
sx: {
|
|
@@ -533,24 +898,24 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
533
898
|
},
|
|
534
899
|
children: [
|
|
535
900
|
/* @__PURE__ */ e(
|
|
536
|
-
|
|
901
|
+
Be,
|
|
537
902
|
{
|
|
538
|
-
percentage:
|
|
539
|
-
secondaryLabel:
|
|
540
|
-
shouldDisplayPercentage:
|
|
541
|
-
title:
|
|
542
|
-
totalAmount:
|
|
903
|
+
percentage: L,
|
|
904
|
+
secondaryLabel: g.micro_secondary_label,
|
|
905
|
+
shouldDisplayPercentage: i.y !== 0 && m.y !== 0,
|
|
906
|
+
title: g.spending_label,
|
|
907
|
+
totalAmount: i.y,
|
|
543
908
|
transactionType: "spending"
|
|
544
909
|
}
|
|
545
910
|
),
|
|
546
911
|
/* @__PURE__ */ e(
|
|
547
|
-
|
|
912
|
+
Be,
|
|
548
913
|
{
|
|
549
|
-
percentage:
|
|
550
|
-
secondaryLabel:
|
|
551
|
-
shouldDisplayPercentage:
|
|
552
|
-
title:
|
|
553
|
-
totalAmount:
|
|
914
|
+
percentage: x,
|
|
915
|
+
secondaryLabel: g.micro_secondary_label,
|
|
916
|
+
shouldDisplayPercentage: y.y !== 0 && T.y !== 0,
|
|
917
|
+
title: g.income_label,
|
|
918
|
+
totalAmount: y.y,
|
|
554
919
|
transactionType: "income"
|
|
555
920
|
}
|
|
556
921
|
)
|
|
@@ -559,21 +924,21 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
559
924
|
)
|
|
560
925
|
}
|
|
561
926
|
);
|
|
562
|
-
}),
|
|
563
|
-
({ isExpanded:
|
|
564
|
-
const
|
|
565
|
-
return /* @__PURE__ */ e(
|
|
927
|
+
}), To = H(
|
|
928
|
+
({ isExpanded: o, onClick: s }) => {
|
|
929
|
+
const t = qe();
|
|
930
|
+
return /* @__PURE__ */ e(Kt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(jt, { onClick: s, sx: { justifyContent: "center" }, children: /* @__PURE__ */ f(
|
|
566
931
|
b,
|
|
567
932
|
{
|
|
568
|
-
sx: { color:
|
|
933
|
+
sx: { color: t.palette.primary.main, flexDirection: "row", alignItems: "center" },
|
|
569
934
|
children: [
|
|
570
|
-
/* @__PURE__ */ e(
|
|
571
|
-
/* @__PURE__ */ e(
|
|
572
|
-
|
|
935
|
+
/* @__PURE__ */ e(Ut, { children: /* @__PURE__ */ e(K, { bold: !0, variant: "body2", children: o ? "View less" : "View more" }) }),
|
|
936
|
+
/* @__PURE__ */ e(Yt, { sx: { color: t.palette.primary.main }, children: o ? /* @__PURE__ */ e(Vt, {}) : /* @__PURE__ */ e(
|
|
937
|
+
Pt,
|
|
573
938
|
{
|
|
574
939
|
sx: {
|
|
575
940
|
transition: "transform 0.3s ease-in-out",
|
|
576
|
-
transform:
|
|
941
|
+
transform: o ? "rotate(180deg)" : "rotate(0deg)"
|
|
577
942
|
}
|
|
578
943
|
}
|
|
579
944
|
) })
|
|
@@ -581,129 +946,129 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
581
946
|
}
|
|
582
947
|
) }) });
|
|
583
948
|
}
|
|
584
|
-
),
|
|
949
|
+
), Ve = H(
|
|
585
950
|
({
|
|
586
|
-
totalAmount:
|
|
587
|
-
guid:
|
|
588
|
-
name:
|
|
589
|
-
transactions:
|
|
951
|
+
totalAmount: o,
|
|
952
|
+
guid: s,
|
|
953
|
+
name: t,
|
|
954
|
+
transactions: n,
|
|
590
955
|
onClick: r,
|
|
591
|
-
isLastItem:
|
|
592
|
-
showDivider:
|
|
956
|
+
isLastItem: u = !1,
|
|
957
|
+
showDivider: h = !0
|
|
593
958
|
}) => {
|
|
594
|
-
const { trends:
|
|
595
|
-
r?.(), c(
|
|
596
|
-
...
|
|
597
|
-
listItem:
|
|
959
|
+
const { trends: g } = O(), { onEvent: c } = P(), p = `${n.length} ${n.length === 1 ? g.transaction : g.transactions}`, C = () => {
|
|
960
|
+
r?.(), c(w.TRENDS_CLICK_LIST_ITEM, {
|
|
961
|
+
...G,
|
|
962
|
+
listItem: t
|
|
598
963
|
});
|
|
599
964
|
};
|
|
600
|
-
return /* @__PURE__ */
|
|
965
|
+
return /* @__PURE__ */ f(d.Fragment, { children: [
|
|
601
966
|
/* @__PURE__ */ e(
|
|
602
|
-
|
|
967
|
+
Ke,
|
|
603
968
|
{
|
|
604
|
-
leftIcon:
|
|
605
|
-
onClick:
|
|
606
|
-
rightContent:
|
|
607
|
-
rightIcon: r ? /* @__PURE__ */ e(
|
|
608
|
-
subtitle:
|
|
609
|
-
title:
|
|
969
|
+
leftIcon: s ? /* @__PURE__ */ e(Se, { categoryGuid: s }) : void 0,
|
|
970
|
+
onClick: C,
|
|
971
|
+
rightContent: oe(Math.abs(o), "0,0.00"),
|
|
972
|
+
rightIcon: r ? /* @__PURE__ */ e(lt, {}) : void 0,
|
|
973
|
+
subtitle: p,
|
|
974
|
+
title: t
|
|
610
975
|
}
|
|
611
976
|
),
|
|
612
|
-
|
|
613
|
-
] },
|
|
977
|
+
h && /* @__PURE__ */ e(Re, { sx: { ml: u ? 24 : 68 } })
|
|
978
|
+
] }, s);
|
|
614
979
|
}
|
|
615
|
-
),
|
|
616
|
-
({ availableHeight:
|
|
617
|
-
const { collapsedCategories:
|
|
618
|
-
|
|
619
|
-
const
|
|
620
|
-
|
|
621
|
-
}, [
|
|
622
|
-
const
|
|
623
|
-
|
|
624
|
-
...
|
|
980
|
+
), So = H(
|
|
981
|
+
({ availableHeight: o = 0, onCategoryClick: s }) => {
|
|
982
|
+
const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: r } = pe(), { isLargeDesktop: u, isDesktop: h } = ee(), { trends: g } = O(), { onEvent: c } = P(), [p, C] = d.useState(!1), l = h || u;
|
|
983
|
+
d.useEffect(() => {
|
|
984
|
+
const i = Math.floor(o / 64) - 1, T = n.length + t.length;
|
|
985
|
+
i !== n.length && (r(l ? Math.max(i, 5) : 5), C(i >= T));
|
|
986
|
+
}, [o]);
|
|
987
|
+
const _ = () => {
|
|
988
|
+
C(!p), c(w.TRENDS_CLICK_VIEW_MORE, {
|
|
989
|
+
...G
|
|
625
990
|
});
|
|
626
|
-
}, m =
|
|
627
|
-
return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */
|
|
628
|
-
/* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(
|
|
629
|
-
|
|
630
|
-
|
|
991
|
+
}, m = n.length + (p ? t.length : 0);
|
|
992
|
+
return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f(zt, { children: [
|
|
993
|
+
/* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Pe, { children: g.categories }) }),
|
|
994
|
+
n.map((i, T) => /* @__PURE__ */ e(
|
|
995
|
+
Ve,
|
|
631
996
|
{
|
|
632
|
-
...
|
|
633
|
-
isLastItem:
|
|
634
|
-
onClick:
|
|
997
|
+
...i,
|
|
998
|
+
isLastItem: T === m - 1,
|
|
999
|
+
onClick: i.transactions.length > 0 ? () => s(i) : void 0,
|
|
635
1000
|
showDivider: !0
|
|
636
1001
|
},
|
|
637
|
-
|
|
1002
|
+
i.guid
|
|
638
1003
|
)),
|
|
639
1004
|
/* @__PURE__ */ e(
|
|
640
|
-
|
|
1005
|
+
Ft,
|
|
641
1006
|
{
|
|
642
|
-
in:
|
|
1007
|
+
in: p,
|
|
643
1008
|
sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
|
|
644
|
-
children:
|
|
645
|
-
const
|
|
1009
|
+
children: t.map((i, T) => {
|
|
1010
|
+
const y = n.length + T;
|
|
646
1011
|
return /* @__PURE__ */ e(
|
|
647
|
-
|
|
1012
|
+
Ve,
|
|
648
1013
|
{
|
|
649
|
-
...
|
|
650
|
-
isLastItem:
|
|
651
|
-
onClick:
|
|
1014
|
+
...i,
|
|
1015
|
+
isLastItem: y === m - 1,
|
|
1016
|
+
onClick: i.transactions.length > 0 ? () => s(i) : void 0,
|
|
652
1017
|
showDivider: !0
|
|
653
1018
|
},
|
|
654
|
-
|
|
1019
|
+
i.guid
|
|
655
1020
|
);
|
|
656
1021
|
})
|
|
657
1022
|
}
|
|
658
1023
|
),
|
|
659
|
-
|
|
1024
|
+
t.length > 0 && /* @__PURE__ */ e(To, { isExpanded: p, onClick: _ })
|
|
660
1025
|
] }) });
|
|
661
1026
|
}
|
|
662
|
-
),
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
},
|
|
666
|
-
return /* @__PURE__ */ e(
|
|
667
|
-
|
|
1027
|
+
), bo = ({ beats: o, onInsightCardClick: s }) => {
|
|
1028
|
+
const t = ze(), { onEvent: n } = P(), { isMobile: r, isDesktop: u, isLargeDesktop: h } = ee(), { beatStore: g, endpoint: c, sessionToken: p } = He(), C = t.palette.mode === "dark", l = u || h, _ = l || r ? 1 : 2, m = () => null, i = (A) => {
|
|
1029
|
+
s?.(A), n(w.TRENDS_CLICK_INSIGHT, G);
|
|
1030
|
+
}, T = l ? 200 : 170, y = l ? 170 : 124, L = l ? 56 : 0, x = o.length > 0 ? T + L : y, v = l && o.length > 0 ? T : void 0;
|
|
1031
|
+
return /* @__PURE__ */ e(Tt, { sx: { height: x }, children: /* @__PURE__ */ e(
|
|
1032
|
+
Ht,
|
|
668
1033
|
{
|
|
669
|
-
areBeatsLoading:
|
|
670
|
-
beats:
|
|
1034
|
+
areBeatsLoading: g.isLoading,
|
|
1035
|
+
beats: o,
|
|
671
1036
|
endpoint: c,
|
|
672
|
-
heightOverrides:
|
|
1037
|
+
heightOverrides: v,
|
|
673
1038
|
logOutUser: m,
|
|
674
|
-
onCardClick:
|
|
1039
|
+
onCardClick: i,
|
|
675
1040
|
showBorder: !0,
|
|
676
1041
|
showCTAColocatedWithText: !1,
|
|
677
1042
|
showCarouselControls: !0,
|
|
678
|
-
showHeader:
|
|
1043
|
+
showHeader: l,
|
|
679
1044
|
showIcon: !0,
|
|
680
1045
|
showWithMargin: !1,
|
|
681
|
-
token:
|
|
682
|
-
useDarkMode:
|
|
1046
|
+
token: p,
|
|
1047
|
+
useDarkMode: C,
|
|
683
1048
|
userHasFullInsightFeedBeats: !1,
|
|
684
1049
|
variant: "outlined",
|
|
685
|
-
visibleCardsCount:
|
|
1050
|
+
visibleCardsCount: _
|
|
686
1051
|
}
|
|
687
1052
|
) });
|
|
688
|
-
},
|
|
689
|
-
const { onEvent:
|
|
690
|
-
categoryDetailsChartData: { monthlyAmounts:
|
|
691
|
-
} =
|
|
1053
|
+
}, xo = H(bo), vo = H(({ chartLabel: o, chartColor: s }) => {
|
|
1054
|
+
const { onEvent: t } = P(), {
|
|
1055
|
+
categoryDetailsChartData: { monthlyAmounts: n, tooltipLabels: r }
|
|
1056
|
+
} = pe();
|
|
692
1057
|
return /* @__PURE__ */ e(b, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
|
|
693
|
-
|
|
1058
|
+
Ne,
|
|
694
1059
|
{
|
|
695
1060
|
baseline: "min",
|
|
696
|
-
colors: [
|
|
1061
|
+
colors: [s],
|
|
697
1062
|
curveType: "bump",
|
|
698
1063
|
customTooltipLabels: r,
|
|
699
|
-
datasets: [
|
|
1064
|
+
datasets: [n],
|
|
700
1065
|
height: 265,
|
|
701
|
-
labels: [
|
|
1066
|
+
labels: [o],
|
|
702
1067
|
markStyles: () => ({
|
|
703
|
-
stroke:
|
|
1068
|
+
stroke: s
|
|
704
1069
|
}),
|
|
705
1070
|
onItemClick: () => {
|
|
706
|
-
|
|
1071
|
+
t(w.TRENDS_CLICK_CHART, G);
|
|
707
1072
|
},
|
|
708
1073
|
showArea: !0,
|
|
709
1074
|
showAverage: !0,
|
|
@@ -718,100 +1083,100 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
718
1083
|
valueFormatterString: "0,0"
|
|
719
1084
|
}
|
|
720
1085
|
) });
|
|
721
|
-
}),
|
|
722
|
-
const
|
|
723
|
-
if (!
|
|
1086
|
+
}), wo = H(({ onClose: o }) => {
|
|
1087
|
+
const s = qe(), { onEvent: t } = P(), { common: n, trends: r } = O(), { selectedCategoryData: u, selectedDateRangeMonthRange: h } = pe(), { sortedTransactions: g } = xe(), [c, p] = d.useState(null);
|
|
1088
|
+
if (!u)
|
|
724
1089
|
return null;
|
|
725
|
-
const { guid:
|
|
726
|
-
() =>
|
|
727
|
-
[c,
|
|
728
|
-
),
|
|
729
|
-
|
|
1090
|
+
const { guid: C, name: l, is_income: _, totalAmount: m } = u, i = _ ? r.category_income : r.category_spending, T = Zt(C, s), y = _ ? r.income_label : r.spending_label, L = ` ${u.transactions.length === 1 ? r.transaction : r.transactions} (${u.transactions.length})`, x = d.useMemo(
|
|
1091
|
+
() => g.find((R) => R.guid === c),
|
|
1092
|
+
[c, g]
|
|
1093
|
+
), v = (R) => R.category_guid === C || R.top_level_category_guid === C, A = () => {
|
|
1094
|
+
o?.(), t(w.TRENDS_CLICK_BACK, G);
|
|
730
1095
|
};
|
|
731
|
-
return /* @__PURE__ */
|
|
732
|
-
|
|
1096
|
+
return /* @__PURE__ */ f(
|
|
1097
|
+
ke,
|
|
733
1098
|
{
|
|
734
1099
|
ariaLabelClose: r.close_category_details,
|
|
735
1100
|
isOpen: !0,
|
|
736
|
-
onClose:
|
|
1101
|
+
onClose: A,
|
|
737
1102
|
shouldShowHeaderShadow: !0,
|
|
738
|
-
title:
|
|
1103
|
+
title: i,
|
|
739
1104
|
children: [
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
1105
|
+
/* @__PURE__ */ f(b, { sx: { alignItems: "center", height: "100%" }, children: [
|
|
1106
|
+
/* @__PURE__ */ f(Xt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
|
|
742
1107
|
/* @__PURE__ */ e(
|
|
743
|
-
|
|
1108
|
+
Ke,
|
|
744
1109
|
{
|
|
745
|
-
leftIcon: /* @__PURE__ */ e(
|
|
746
|
-
rightContent:
|
|
747
|
-
subtitle:
|
|
748
|
-
title:
|
|
1110
|
+
leftIcon: /* @__PURE__ */ e(Se, { categoryGuid: C }),
|
|
1111
|
+
rightContent: oe(Math.abs(m), "0,0.00"),
|
|
1112
|
+
subtitle: h,
|
|
1113
|
+
title: l
|
|
749
1114
|
}
|
|
750
1115
|
),
|
|
751
|
-
/* @__PURE__ */ e(
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
/* @__PURE__ */ e(
|
|
754
|
-
/* @__PURE__ */ e(
|
|
1116
|
+
/* @__PURE__ */ e(vo, { chartColor: T, chartLabel: y }),
|
|
1117
|
+
/* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
|
|
1118
|
+
/* @__PURE__ */ e(K, { bold: !0, variant: "body1", children: L }),
|
|
1119
|
+
/* @__PURE__ */ e(qt, { filter: v })
|
|
755
1120
|
] })
|
|
756
1121
|
] }),
|
|
757
1122
|
/* @__PURE__ */ e(
|
|
758
|
-
|
|
1123
|
+
Ze,
|
|
759
1124
|
{
|
|
760
1125
|
bgcolor: "transparent",
|
|
761
|
-
filter:
|
|
1126
|
+
filter: v,
|
|
762
1127
|
height: "calc(100vh - 475px)",
|
|
763
|
-
onClick:
|
|
1128
|
+
onClick: p
|
|
764
1129
|
}
|
|
765
1130
|
)
|
|
766
1131
|
] }),
|
|
767
1132
|
/* @__PURE__ */ e(
|
|
768
|
-
|
|
1133
|
+
ke,
|
|
769
1134
|
{
|
|
770
|
-
ariaLabelClose:
|
|
771
|
-
isOpen: !!
|
|
772
|
-
onClose: () =>
|
|
1135
|
+
ariaLabelClose: n.close_aria,
|
|
1136
|
+
isOpen: !!x,
|
|
1137
|
+
onClose: () => p(""),
|
|
773
1138
|
title: r.transaction,
|
|
774
|
-
children:
|
|
1139
|
+
children: x && /* @__PURE__ */ e(Xe, { transaction: x })
|
|
775
1140
|
}
|
|
776
1141
|
)
|
|
777
1142
|
]
|
|
778
1143
|
}
|
|
779
1144
|
);
|
|
780
|
-
}),
|
|
781
|
-
const
|
|
782
|
-
return [
|
|
783
|
-
},
|
|
784
|
-
const [
|
|
1145
|
+
}), Do = (o, s) => {
|
|
1146
|
+
const t = Ye(o, s), n = je(o, s);
|
|
1147
|
+
return [t, n].filter((r) => r.length > 0);
|
|
1148
|
+
}, Io = (o, s) => {
|
|
1149
|
+
const [t, n] = o, r = t, u = n ?? t, h = [];
|
|
785
1150
|
if (r) {
|
|
786
|
-
const
|
|
787
|
-
|
|
1151
|
+
const g = r.reduce((c, p) => c + p.y, 0);
|
|
1152
|
+
h.push({ label: s.income_label, amount: g });
|
|
788
1153
|
}
|
|
789
|
-
if (
|
|
790
|
-
const
|
|
791
|
-
|
|
1154
|
+
if (u) {
|
|
1155
|
+
const g = u.reduce((c, p) => c + p.y, 0);
|
|
1156
|
+
h.push({ label: s.spending_label, amount: g });
|
|
792
1157
|
}
|
|
793
|
-
return
|
|
794
|
-
},
|
|
795
|
-
availableHeight:
|
|
796
|
-
minHeight:
|
|
797
|
-
selectedDateRange:
|
|
798
|
-
totals:
|
|
1158
|
+
return h;
|
|
1159
|
+
}, Eo = ({
|
|
1160
|
+
availableHeight: o = 0,
|
|
1161
|
+
minHeight: s = 500,
|
|
1162
|
+
selectedDateRange: t,
|
|
1163
|
+
totals: n
|
|
799
1164
|
}) => {
|
|
800
|
-
const r =
|
|
801
|
-
return
|
|
802
|
-
const
|
|
803
|
-
|
|
804
|
-
}, [
|
|
805
|
-
|
|
1165
|
+
const r = be(), { onEvent: u } = P(), { trends: h } = O(), { isSmallMobile: g, isMobile: c, isSmallTablet: p, isTablet: C } = ee(), l = [r.palette.chart?.chart1, r.palette.chart?.chart2], _ = Do(n, t), m = Io(_, h), [i, T] = d.useState(0), y = 458, L = 195, x = 56, v = c || g ? L : p || C ? y : i;
|
|
1166
|
+
return d.useEffect(() => {
|
|
1167
|
+
const R = Math.max(o - x, s);
|
|
1168
|
+
T(R);
|
|
1169
|
+
}, [o]), /* @__PURE__ */ e(
|
|
1170
|
+
Ne,
|
|
806
1171
|
{
|
|
807
1172
|
baseline: "min",
|
|
808
|
-
colors:
|
|
1173
|
+
colors: l,
|
|
809
1174
|
curveType: "bump",
|
|
810
|
-
datasets:
|
|
811
|
-
height:
|
|
1175
|
+
datasets: _,
|
|
1176
|
+
height: v,
|
|
812
1177
|
labels: m,
|
|
813
1178
|
onItemClick: () => {
|
|
814
|
-
|
|
1179
|
+
u(w.TRENDS_CLICK_CHART, G);
|
|
815
1180
|
},
|
|
816
1181
|
showArea: !0,
|
|
817
1182
|
showAxisHighlight: !0,
|
|
@@ -824,7 +1189,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
824
1189
|
valueFormatterString: "0.0a"
|
|
825
1190
|
}
|
|
826
1191
|
);
|
|
827
|
-
},
|
|
1192
|
+
}, Lo = H(Eo), Mo = [
|
|
828
1193
|
"BillAmountNotStandard",
|
|
829
1194
|
"CategorySpendingV2",
|
|
830
1195
|
"CostOfLivingToIncome",
|
|
@@ -858,112 +1223,112 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
858
1223
|
"WeeklyNewMerchantsV2",
|
|
859
1224
|
"WeeklyNoSpendDays",
|
|
860
1225
|
"WeeklySmallPurchasesSummary"
|
|
861
|
-
],
|
|
862
|
-
const { onEvent:
|
|
863
|
-
isCopyLoaded:
|
|
864
|
-
isInitialized:
|
|
865
|
-
selectedAccounts:
|
|
866
|
-
selectedAccountGuids:
|
|
867
|
-
setSelectedAccounts:
|
|
868
|
-
} =
|
|
869
|
-
() =>
|
|
870
|
-
[
|
|
1226
|
+
], Ao = ({ onBackClick: o, onInsightCardClick: s, sx: t }) => {
|
|
1227
|
+
const { onEvent: n } = P(), { onLoad: r } = pt(), { config: u } = Ct(), { isLargeDesktop: h, isDesktop: g, isMobile: c } = ee(), { visibleAccounts: p } = ve(), { loadDateRangeCategoryTotals: C, loadMonthlyCategoryTotals: l, monthlyCategoryTotals: _ } = U(), { setFilter: m } = xe(), { selectedDateRange: i, setSelectedCategoryData: T, setSelectedDateRange: y } = pe(), {
|
|
1228
|
+
isCopyLoaded: L,
|
|
1229
|
+
isInitialized: x,
|
|
1230
|
+
selectedAccounts: v,
|
|
1231
|
+
selectedAccountGuids: A,
|
|
1232
|
+
setSelectedAccounts: R
|
|
1233
|
+
} = me(), { trends: M, connect: k } = O(), { beatStore: E } = He(), ne = Qt() && u.show_insights_widget_in_master, B = g || h, [Ce, ae] = d.useState(!1), [Z, ie] = d.useState(!1), [q, ce] = d.useState("Chart"), [$, te] = d.useState(""), [se, re] = d.useState(!1), [j, D] = d.useState(window.innerHeight), V = B ? 56 : 0, F = j - 208, le = j - (ne ? 550 + V : 266), [we, ye] = d.useState(!1), a = u.show_connections_widget_in_master ? "buttons" : "no-buttons", S = d.useMemo(
|
|
1234
|
+
() => p && p.length === 0 || _.length === 0,
|
|
1235
|
+
[p, _]
|
|
871
1236
|
);
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
}, [
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
const
|
|
878
|
-
return window.addEventListener("resize",
|
|
879
|
-
}, []),
|
|
880
|
-
|
|
881
|
-
}, [
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1237
|
+
d.useEffect(() => {
|
|
1238
|
+
x && E.loadBeats().finally(() => ie(!0));
|
|
1239
|
+
}, [x]);
|
|
1240
|
+
const I = d.useMemo(() => Z ? E.getFilteredBeats({ templates: Mo }) : [], [Z]);
|
|
1241
|
+
d.useEffect(() => {
|
|
1242
|
+
const N = () => D(window.innerHeight);
|
|
1243
|
+
return window.addEventListener("resize", N), () => window.removeEventListener("resize", N);
|
|
1244
|
+
}, []), d.useEffect(() => {
|
|
1245
|
+
R(p);
|
|
1246
|
+
}, [p]), d.useEffect(() => {
|
|
1247
|
+
x && C(v, i.start, i.end).then(() => {
|
|
1248
|
+
l(
|
|
1249
|
+
v,
|
|
1250
|
+
i.start,
|
|
1251
|
+
i.end
|
|
887
1252
|
);
|
|
888
1253
|
}).finally(() => {
|
|
889
|
-
|
|
890
|
-
...
|
|
891
|
-
time_period: `${
|
|
1254
|
+
ae(!0), n(w.TRENDS_LOAD_WIDGET, {
|
|
1255
|
+
...G,
|
|
1256
|
+
time_period: `${Ae(i.end, i.start)}M`
|
|
892
1257
|
}), r?.("TrendsWidget");
|
|
893
1258
|
});
|
|
894
|
-
}, [
|
|
895
|
-
if (
|
|
896
|
-
const
|
|
897
|
-
accounts:
|
|
898
|
-
dateRange: { start:
|
|
1259
|
+
}, [x, v, i]), d.useEffect(() => {
|
|
1260
|
+
if (_.length !== 0) {
|
|
1261
|
+
const N = {
|
|
1262
|
+
accounts: A,
|
|
1263
|
+
dateRange: { start: i.start, end: i.end }
|
|
899
1264
|
};
|
|
900
1265
|
m({
|
|
901
|
-
...
|
|
902
|
-
custom: (
|
|
903
|
-
(
|
|
1266
|
+
...N,
|
|
1267
|
+
custom: (Q) => !!_.find(
|
|
1268
|
+
(ue) => ue.top_level_category_guid === Q.top_level_category_guid || ue.category_guid === Q.category_guid
|
|
904
1269
|
)
|
|
905
1270
|
});
|
|
906
1271
|
}
|
|
907
|
-
}, [
|
|
908
|
-
const
|
|
909
|
-
|
|
910
|
-
},
|
|
911
|
-
|
|
912
|
-
},
|
|
913
|
-
|
|
914
|
-
},
|
|
915
|
-
|
|
916
|
-
...
|
|
917
|
-
toggleView:
|
|
1272
|
+
}, [_]);
|
|
1273
|
+
const Y = (N) => {
|
|
1274
|
+
T(N), re(!0);
|
|
1275
|
+
}, De = () => {
|
|
1276
|
+
T(null), re(!1);
|
|
1277
|
+
}, Ie = () => {
|
|
1278
|
+
ye(!0), n(w.TRENDS_CLICK_CONNECT_ACCOUNTS);
|
|
1279
|
+
}, de = (N, Q) => {
|
|
1280
|
+
ce(Q ?? q), n(w.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
1281
|
+
...G,
|
|
1282
|
+
toggleView: Q
|
|
918
1283
|
});
|
|
919
|
-
},
|
|
920
|
-
const
|
|
921
|
-
|
|
922
|
-
...
|
|
923
|
-
time_period:
|
|
1284
|
+
}, Ee = (N) => {
|
|
1285
|
+
const Q = $e(N?.[0], 1), ue = N?.[1], st = Ae(ue, Q);
|
|
1286
|
+
y({ start: Q, end: ue }), n(w.TRENDS_CLICK_TIME_WINDOW, {
|
|
1287
|
+
...G,
|
|
1288
|
+
time_period: st + "M"
|
|
924
1289
|
});
|
|
925
|
-
},
|
|
926
|
-
|
|
927
|
-
...
|
|
928
|
-
filterValue:
|
|
1290
|
+
}, Le = (N) => {
|
|
1291
|
+
n(w.TRENDS_CLICK_FILTER, {
|
|
1292
|
+
...G,
|
|
1293
|
+
filterValue: N
|
|
929
1294
|
});
|
|
930
|
-
},
|
|
931
|
-
|
|
932
|
-
},
|
|
933
|
-
|
|
1295
|
+
}, ot = (N) => {
|
|
1296
|
+
te(N);
|
|
1297
|
+
}, nt = () => {
|
|
1298
|
+
te(""), n(w.TRENDS_CLICK_ALL_CATEGORIES, G);
|
|
934
1299
|
};
|
|
935
|
-
return !
|
|
936
|
-
|
|
1300
|
+
return !L || !Ce ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
|
|
1301
|
+
Ue,
|
|
937
1302
|
{
|
|
938
|
-
accountOptions:
|
|
939
|
-
calendarActions: { onRangeChanged:
|
|
940
|
-
dateRange:
|
|
1303
|
+
accountOptions: p,
|
|
1304
|
+
calendarActions: { onRangeChanged: Ee },
|
|
1305
|
+
dateRange: i,
|
|
941
1306
|
dateRangeVariant: c ? "timeframetabs" : "timeframebuttons",
|
|
942
|
-
onAccountsFilterClick:
|
|
943
|
-
onBackClick:
|
|
944
|
-
sx:
|
|
945
|
-
title:
|
|
1307
|
+
onAccountsFilterClick: Le,
|
|
1308
|
+
onBackClick: o,
|
|
1309
|
+
sx: t,
|
|
1310
|
+
title: M.title,
|
|
946
1311
|
children: [
|
|
947
|
-
|
|
948
|
-
|
|
1312
|
+
S && /* @__PURE__ */ e(
|
|
1313
|
+
Jt,
|
|
949
1314
|
{
|
|
950
|
-
header:
|
|
1315
|
+
header: M.zero_state_content_header,
|
|
951
1316
|
icon: "",
|
|
952
|
-
onClick:
|
|
953
|
-
primaryButton:
|
|
954
|
-
subText:
|
|
955
|
-
sx: { height:
|
|
956
|
-
variant:
|
|
1317
|
+
onClick: Ie,
|
|
1318
|
+
primaryButton: M.empty_state_primary,
|
|
1319
|
+
subText: M.empty_state_sub_text,
|
|
1320
|
+
sx: { height: F },
|
|
1321
|
+
variant: a
|
|
957
1322
|
}
|
|
958
1323
|
),
|
|
959
|
-
!
|
|
1324
|
+
!S && /* @__PURE__ */ f(
|
|
960
1325
|
b,
|
|
961
1326
|
{
|
|
962
1327
|
sx: {
|
|
963
1328
|
px: c ? 0 : 48
|
|
964
1329
|
},
|
|
965
1330
|
children: [
|
|
966
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ f(
|
|
967
1332
|
b,
|
|
968
1333
|
{
|
|
969
1334
|
flexDirection: "row",
|
|
@@ -971,79 +1336,79 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
971
1336
|
sx: { pb: c ? 12 : 24, pt: c ? 24 : 48 },
|
|
972
1337
|
children: [
|
|
973
1338
|
/* @__PURE__ */ e(
|
|
974
|
-
|
|
1339
|
+
et,
|
|
975
1340
|
{
|
|
976
|
-
selectedCategoryGuid:
|
|
977
|
-
selectedDateRange:
|
|
1341
|
+
selectedCategoryGuid: $,
|
|
1342
|
+
selectedDateRange: i
|
|
978
1343
|
}
|
|
979
1344
|
),
|
|
980
|
-
/* @__PURE__ */ e(
|
|
1345
|
+
/* @__PURE__ */ e(Je, { onTabChange: de, selectedTab: q })
|
|
981
1346
|
]
|
|
982
1347
|
}
|
|
983
1348
|
),
|
|
984
|
-
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(
|
|
985
|
-
/* @__PURE__ */ e(
|
|
986
|
-
|
|
1349
|
+
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(W, { flexGrow: 1, children: $ && /* @__PURE__ */ f(_e, { onClick: nt, sx: { p: 0, pr: 5 }, children: [
|
|
1350
|
+
/* @__PURE__ */ e(fe, { name: "arrow_back" }),
|
|
1351
|
+
M.all_categories
|
|
987
1352
|
] }) }) }),
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
|
|
990
|
-
/* @__PURE__ */ e(
|
|
991
|
-
|
|
1353
|
+
/* @__PURE__ */ f(b, { flexDirection: B ? "row" : "column", gap: B ? 48 : 16, children: [
|
|
1354
|
+
q === "Chart" && /* @__PURE__ */ f(rt, { children: [
|
|
1355
|
+
/* @__PURE__ */ e(W, { sx: { width: B ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
1356
|
+
Lo,
|
|
992
1357
|
{
|
|
993
|
-
availableHeight:
|
|
1358
|
+
availableHeight: F,
|
|
994
1359
|
minHeight: 450,
|
|
995
|
-
selectedDateRange:
|
|
996
|
-
totals:
|
|
1360
|
+
selectedDateRange: i,
|
|
1361
|
+
totals: _
|
|
997
1362
|
}
|
|
998
1363
|
) }),
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
ne &&
|
|
1001
|
-
|
|
1364
|
+
/* @__PURE__ */ f(b, { gap: 16, sx: { width: B ? "32%" : "100%" }, children: [
|
|
1365
|
+
ne && Z && I.length > 0 && /* @__PURE__ */ e(
|
|
1366
|
+
xo,
|
|
1002
1367
|
{
|
|
1003
|
-
beats:
|
|
1004
|
-
onInsightCardClick:
|
|
1368
|
+
beats: I,
|
|
1369
|
+
onInsightCardClick: s
|
|
1005
1370
|
}
|
|
1006
1371
|
),
|
|
1007
1372
|
/* @__PURE__ */ e(
|
|
1008
|
-
|
|
1373
|
+
So,
|
|
1009
1374
|
{
|
|
1010
|
-
availableHeight:
|
|
1011
|
-
onCategoryClick:
|
|
1375
|
+
availableHeight: le,
|
|
1376
|
+
onCategoryClick: Y
|
|
1012
1377
|
}
|
|
1013
1378
|
)
|
|
1014
1379
|
] })
|
|
1015
1380
|
] }),
|
|
1016
|
-
|
|
1017
|
-
|
|
1381
|
+
q === "Table" && /* @__PURE__ */ e(W, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1382
|
+
tt,
|
|
1018
1383
|
{
|
|
1019
1384
|
height: "unset",
|
|
1020
|
-
monthlyCategoryTotals:
|
|
1021
|
-
onClickRow:
|
|
1022
|
-
selectedCategory:
|
|
1023
|
-
selectedDateRange:
|
|
1385
|
+
monthlyCategoryTotals: _,
|
|
1386
|
+
onClickRow: ot,
|
|
1387
|
+
selectedCategory: $,
|
|
1388
|
+
selectedDateRange: i
|
|
1024
1389
|
}
|
|
1025
1390
|
) })
|
|
1026
1391
|
] }),
|
|
1027
|
-
|
|
1392
|
+
se && /* @__PURE__ */ e(wo, { onClose: De })
|
|
1028
1393
|
]
|
|
1029
1394
|
}
|
|
1030
1395
|
),
|
|
1031
1396
|
/* @__PURE__ */ e(
|
|
1032
|
-
|
|
1397
|
+
eo,
|
|
1033
1398
|
{
|
|
1034
|
-
onClose: () =>
|
|
1035
|
-
showConnectWidget:
|
|
1036
|
-
title:
|
|
1399
|
+
onClose: () => ye(!1),
|
|
1400
|
+
showConnectWidget: we,
|
|
1401
|
+
title: k.mini_title
|
|
1037
1402
|
}
|
|
1038
1403
|
)
|
|
1039
1404
|
]
|
|
1040
1405
|
}
|
|
1041
1406
|
);
|
|
1042
|
-
},
|
|
1407
|
+
}, Nn = H(Ao);
|
|
1043
1408
|
export {
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1409
|
+
Rn as TrendsFullWidget,
|
|
1410
|
+
Hn as TrendsMicroWidget,
|
|
1411
|
+
kn as TrendsMiniWidget,
|
|
1412
|
+
Gn as TrendsStore,
|
|
1413
|
+
Nn as TrendsWidget
|
|
1049
1414
|
};
|