@mx-cartographer/experiences 8.0.0-alpha.sms2 → 9.0.0-alpha.mega1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +217 -0
- package/dist/{Account-Cp30A3ad.mjs → Account-BIKn4XEZ.mjs} +1 -1
- package/dist/Account-CMjOp7S2.mjs +118 -0
- package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
- package/dist/AccountDetailsHeader-BOV91g1o.mjs +95 -0
- package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
- package/dist/{AccountFields-CW6cIthP.mjs → AccountFields-BRRH37K1.mjs} +10 -11
- package/dist/{AccountListItem-DxmAs98Z.mjs → AccountListItem-Ds5C0mOT.mjs} +4 -4
- package/dist/{AccountStore-hIs-yA6W.mjs → AccountStore-BFKvXJSD.mjs} +79 -69
- package/dist/{Accounts-DUHkUyK4.mjs → Accounts-CuE8aSZN.mjs} +1 -1
- package/dist/{BudgetUtil-CIDAPPPT.mjs → BudgetUtil-CDSOZXem.mjs} +4 -4
- package/dist/CategorySelectorDrawer-C4aZYP4N.mjs +418 -0
- package/dist/CategoryStore-DEqAnHbi.mjs +186 -0
- package/dist/{CategoryUtil-DfVKKkRf.mjs → CategoryUtil-CFHBvaV4.mjs} +1 -1
- package/dist/{ConnectionsDrawer-CSo6AFkG.mjs → ConnectionsDrawer-BExzgE16.mjs} +5 -5
- package/dist/{CurrencyInput-BrGvhgVK.mjs → CurrencyInput-DDQ4DBrE.mjs} +1 -1
- package/dist/{CurrencyText-Dr0EZ7bp.mjs → CurrencyText-C-85TnUF.mjs} +3 -3
- package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CVsMhbZU.mjs} +3 -3
- package/dist/{DebtsStore-hi1cqrRk.mjs → DebtsStore-Dv_T7Dts.mjs} +12 -12
- package/dist/{Dialog-CDV0kKxj.mjs → Dialog-CWymUiuO.mjs} +32 -35
- package/dist/Drawer-Bet2ZPJo.mjs +176 -0
- package/dist/{ExportCsvAction-CQ1grpwo.mjs → ExportCsvAction-oG_Mn66T.mjs} +3 -3
- package/dist/{FinstrongStore-dKZOZ2hM.mjs → FinstrongStore-BjFkMTIL.mjs} +6 -6
- package/dist/GlobalAccountFilter-BpWlPAl5.mjs +316 -0
- package/dist/{GoalStore-CFeAJloA.mjs → GoalStore-Dbjgft2i.mjs} +155 -137
- package/dist/{Help-i4OasOO-.mjs → Help-BW_ar-4B.mjs} +2 -2
- package/dist/LineChart-DHj-Bufi.mjs +580 -0
- package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-Cbr3417C.mjs} +10 -10
- package/dist/{ManageIncome-D_qVX5dN.mjs → ManageIncome-DIIyqDTp.mjs} +85 -85
- package/dist/{MicroWidgetContainer-BGpNl5ZS.mjs → MicroWidgetContainer-DSyYwRCU.mjs} +2 -2
- package/dist/{MiniWidgetContainer-D7MkHG15.mjs → MiniWidgetContainer-DKn7ndO6.mjs} +1 -1
- package/dist/NetWorthStore-B6ziBtaH.mjs +168 -0
- package/dist/NotificationSettings-e789PcRb.mjs +676 -0
- package/dist/{OriginalBalanceAction-62e0mU_3.mjs → OriginalBalanceAction-DFoG79Ba.mjs} +3 -3
- package/dist/{RecurringSettings-RfZ8Wuhh.mjs → RecurringSettings-BpCUcE8w.mjs} +4 -4
- package/dist/{RecurringTransactionsStore-D3EOKZ2B.mjs → RecurringTransactionsStore-D_--5PWH.mjs} +1 -1
- package/dist/{RecurringTransactions-Bhx56aA3.mjs → RepeatingTransaction-C2txVA9O.mjs} +3 -3
- package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-CInvh-rQ.mjs} +1 -1
- package/dist/SpendingData-B7NuTQ9s.mjs +53 -0
- package/dist/SpendingLegend-BxefXiQd.mjs +193 -0
- package/dist/TransactionDetails-CPwv9xtZ.mjs +1374 -0
- package/dist/{TransactionStore-DgLrYW4C.mjs → TransactionStore-D2aMUClq.mjs} +128 -111
- package/dist/TrendsStore-BdsYfCc7.mjs +183 -0
- package/dist/{User-DqNX2GAK.mjs → User-CulNdZUr.mjs} +21 -20
- package/dist/ViewMoreMicroCard-CDWR16_h.mjs +1147 -0
- package/dist/WidgetContainer-mzejMmz2.mjs +555 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +1 -0
- package/dist/accounts/index.es.js +933 -232
- package/dist/accounts/stores/AccountStore.d.ts +6 -2
- package/dist/accounts/utils/AccountDetails.d.ts +5 -0
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/components/AddBudgets.d.ts +2 -1
- package/dist/budgets/index.es.js +561 -522
- package/dist/cashflow/index.es.js +397 -396
- package/dist/categories/components/CustomCategories/AddSubcategory.d.ts +1 -0
- package/dist/categories/components/CustomCategories/DeleteSubcategory.d.ts +1 -0
- package/dist/categories/components/CustomCategories/RenameSubcategory.d.ts +1 -0
- package/dist/categories/components/SubcategoryRow.d.ts +1 -0
- package/dist/categories/index.es.js +2 -2
- package/dist/categories/stores/CategoryStore.d.ts +5 -3
- package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
- package/dist/common/components/WidgetContainer.d.ts +7 -6
- package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
- package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
- package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
- package/dist/common/components/index.d.ts +2 -2
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
- package/dist/common/index.es.js +325 -306
- package/dist/common/stores/GlobalUiStore.d.ts +7 -4
- package/dist/common/types/localization/AccountsCopy.d.ts +6 -0
- package/dist/common/types/localization/CategoryCopy.d.ts +3 -0
- package/dist/common/types/localization/CommonCopy.d.ts +3 -0
- package/dist/common/types/localization/GoalsCopy.d.ts +3 -1
- package/dist/common/types/localization/MicroInsightsCopy.d.ts +1 -0
- package/dist/common/types/localization/TransactionsCopy.d.ts +4 -0
- package/dist/common/types/localization/TrendsCopy.d.ts +4 -0
- package/dist/dashboard/index.es.js +95 -125
- package/dist/debts/index.es.js +466 -460
- package/dist/{exportTransactionsToCSV-BFpuIAXW.mjs → exportTransactionsToCSV-BU1jTY0Q.mjs} +4 -4
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
- package/dist/finstrong/index.es.js +1660 -1553
- package/dist/goals/index.es.js +716 -677
- package/dist/goals/stores/GoalStore.d.ts +2 -0
- package/dist/help/index.es.js +14 -10
- package/dist/{hooks-C41HAxM5.mjs → hooks-fY_n74f7.mjs} +16 -16
- package/dist/investments/index.es.js +464 -457
- package/dist/merchants/index.es.js +1 -1
- package/dist/microinsights/MicroCardTemplate.d.ts +23 -0
- package/dist/microinsights/beaticons/BeatMaterialIcon.d.ts +8 -0
- package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +1 -2
- package/dist/microinsights/beaticons/index.d.ts +1 -0
- package/dist/microinsights/cards/InsightCard.d.ts +0 -2
- package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +2 -5
- package/dist/microinsights/index.d.ts +2 -2
- package/dist/microinsights/index.es.js +824 -14
- package/dist/networth/components/NetWorthChart.d.ts +3 -2
- package/dist/networth/components/NetWorthList.d.ts +3 -3
- package/dist/networth/index.es.js +433 -438
- package/dist/networth/stores/NetWorthStore.d.ts +20 -9
- package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
- package/dist/notifications/index.es.js +5 -5
- package/dist/recurringtransactions/index.es.js +331 -325
- package/dist/settings/index.es.js +293 -285
- package/dist/spending/components/SpendingChart.d.ts +1 -1
- package/dist/spending/components/SpendingList.d.ts +1 -1
- package/dist/spending/components/SpendingTabLabel.d.ts +1 -0
- package/dist/spending/index.es.js +250 -235
- package/dist/transactions/index.es.js +288 -281
- package/dist/transactions/stores/TransactionStore.d.ts +5 -0
- package/dist/trends/components/TrendsTable.d.ts +0 -2
- package/dist/trends/index.es.js +876 -802
- package/dist/trends/utils/TrendsData.d.ts +1 -0
- package/dist/trends/utils/TrendsTable.d.ts +12 -0
- package/dist/{useAccountDisplayName-usSZCQ7I.mjs → useAccountDisplayName-DbkgGLdg.mjs} +2 -2
- package/dist/useAriaLive-B3_pRUio.mjs +35 -0
- package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-dhmXeSyF.mjs} +1 -1
- package/dist/useWidgetLoadTimer-CrUzxN-P.mjs +19 -0
- package/package.json +26 -21
- package/dist/AccountDetailsContent-C1HumFnW.mjs +0 -683
- package/dist/AccountDetailsHeader-NMx79DGs.mjs +0 -87
- package/dist/CategorySelectorDrawer-DqDAA_5I.mjs +0 -399
- package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
- package/dist/ConnectDrawer-Dn1MlqLz.mjs +0 -545
- package/dist/Drawer-Dqe5EqvA.mjs +0 -163
- package/dist/LineChart-bc1D9xBE.mjs +0 -581
- package/dist/NetWorthStore-8FFC1Bs0.mjs +0 -150
- package/dist/NotificationSettings-BsWiYD94.mjs +0 -672
- package/dist/SpendingData-DPQ96k3x.mjs +0 -55
- package/dist/SpendingLegend-CZzDb-7d.mjs +0 -193
- package/dist/TransactionDetails-Duv1X9ec.mjs +0 -1379
- package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
- package/dist/ViewMoreMicroCard-CH9E-jOx.mjs +0 -1930
- package/dist/WidgetContainer-B1Jzb4XA.mjs +0 -565
- package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
- package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
- package/dist/common/components/accountfilter/index.d.ts +0 -1
- package/dist/microinsights/cards/BaseCard.d.ts +0 -13
- package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
package/dist/budgets/index.es.js
CHANGED
|
@@ -1,78 +1,79 @@
|
|
|
1
|
-
import { jsxs as g, jsx as e, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as g, jsx as e, Fragment as ze } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
3
|
import { observer as E } from "mobx-react-lite";
|
|
4
|
-
import { endOfMonth as
|
|
4
|
+
import { endOfMonth as ue } from "date-fns/endOfMonth";
|
|
5
5
|
import { startOfMonth as J } from "date-fns/startOfMonth";
|
|
6
6
|
import F from "@mui/material/Box";
|
|
7
7
|
import B from "@mui/material/Stack";
|
|
8
8
|
import ee from "@mui/material/styles/useTheme";
|
|
9
|
-
import { Text as
|
|
9
|
+
import { Text as y, CategoryIcon as H, Icon as P, H2 as Ue, H3 as xe } from "@mxenabled/mxui";
|
|
10
10
|
import W from "@mui/material/List";
|
|
11
|
-
import { u as w, i as D, j as te, m as K,
|
|
11
|
+
import { u as w, i as D, j as te, m as K, p as ne, g as X, b as oe, h as ae, a as Fe, d as ve } from "../hooks-fY_n74f7.mjs";
|
|
12
12
|
import { f as T } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
13
|
-
import
|
|
13
|
+
import Ae from "@mui/material/Button";
|
|
14
14
|
import re from "@mui/material/Divider";
|
|
15
15
|
import V from "@mui/material/ListItem";
|
|
16
16
|
import se from "@mui/material/ListItemAvatar";
|
|
17
17
|
import Y from "@mui/material/ListItemButton";
|
|
18
18
|
import Z from "@mui/material/ListItemText";
|
|
19
|
-
import { b as
|
|
20
|
-
import { D as
|
|
21
|
-
import
|
|
22
|
-
import { C as
|
|
23
|
-
import {
|
|
24
|
-
import { C as
|
|
19
|
+
import { b as L } from "../Localization-2MODESHW.mjs";
|
|
20
|
+
import { D as $ } from "../Drawer-Bet2ZPJo.mjs";
|
|
21
|
+
import He from "@mui/material/ListItemSecondaryAction";
|
|
22
|
+
import { C as We } from "../CurrencyInput-DDQ4DBrE.mjs";
|
|
23
|
+
import { a as z } from "../Dialog-CWymUiuO.mjs";
|
|
24
|
+
import { C as Ke } from "../ConnectionsDrawer-BExzgE16.mjs";
|
|
25
25
|
import * as O from "d3";
|
|
26
|
-
import
|
|
27
|
-
import { useTheme as
|
|
28
|
-
import { L as
|
|
26
|
+
import Xe from "@mui/material/Tooltip";
|
|
27
|
+
import { useTheme as Ve } from "@mui/material/styles";
|
|
28
|
+
import { L as ge } from "../Loader-BSWSYqvn.mjs";
|
|
29
29
|
import { u as ie } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
30
|
-
import { E as
|
|
31
|
-
import { A as
|
|
32
|
-
import { u as
|
|
33
|
-
import { M as
|
|
34
|
-
import {
|
|
30
|
+
import { E as le } from "../EmptyState-DoxNUae-.mjs";
|
|
31
|
+
import { A as N, W as Ye } from "../WidgetContainer-mzejMmz2.mjs";
|
|
32
|
+
import { u as Ze } from "../BudgetUtil-CDSOZXem.mjs";
|
|
33
|
+
import { M as qe } from "../MiniWidgetContainer-DKn7ndO6.mjs";
|
|
34
|
+
import { u as Te } from "../useWidgetLoadTimer-CrUzxN-P.mjs";
|
|
35
|
+
import { isAfter as Je } from "date-fns/isAfter";
|
|
35
36
|
import { startOfToday as q } from "date-fns/startOfToday";
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import { e as
|
|
41
|
-
import { T as
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import { S as
|
|
45
|
-
import { S as
|
|
46
|
-
import { u as
|
|
47
|
-
import
|
|
48
|
-
import { subDays as
|
|
49
|
-
import
|
|
50
|
-
import { M as
|
|
51
|
-
const
|
|
37
|
+
import we from "@mui/material/Alert";
|
|
38
|
+
import De from "@mui/material/Snackbar";
|
|
39
|
+
import ye from "@mui/material/Tab";
|
|
40
|
+
import Qe from "@mui/material/Tabs";
|
|
41
|
+
import { e as et } from "../exportTransactionsToCSV-BU1jTY0Q.mjs";
|
|
42
|
+
import { T as Ee, a as tt } from "../TransactionDetails-CPwv9xtZ.mjs";
|
|
43
|
+
import pe from "@mui/material/Card";
|
|
44
|
+
import he from "@mui/material/CardContent";
|
|
45
|
+
import { S as me } from "../StatusBar-CPfSXe80.mjs";
|
|
46
|
+
import { S as Ie } from "../SingleSegmentDonut-PsRQPkmV.mjs";
|
|
47
|
+
import { u as nt, C as ot } from "../CategorySelectorDrawer-C4aZYP4N.mjs";
|
|
48
|
+
import Oe from "@mui/material/CardHeader";
|
|
49
|
+
import { subDays as at } from "date-fns/subDays";
|
|
50
|
+
import rt from "@mui/material/IconButton";
|
|
51
|
+
import { M as st } from "../ManageIncome-DIIyqDTp.mjs";
|
|
52
|
+
const it = E(() => {
|
|
52
53
|
const { budgets: t } = w(), { totalBudgeted: o } = D(), { incomeTotal: i } = te(), s = i - o;
|
|
53
54
|
return /* @__PURE__ */ g(B, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
|
|
54
55
|
/* @__PURE__ */ g(B, { alignItems: "center", children: [
|
|
55
|
-
/* @__PURE__ */ e(
|
|
56
|
-
/* @__PURE__ */ e(
|
|
56
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: T(i, "0,0") }),
|
|
57
|
+
/* @__PURE__ */ e(y, { color: "secondary", variant: "Small", children: t.projected_income })
|
|
57
58
|
] }),
|
|
58
|
-
/* @__PURE__ */ e(
|
|
59
|
+
/* @__PURE__ */ e(y, { bold: !0, justifyContent: "center", variant: "Body", children: "-" }),
|
|
59
60
|
/* @__PURE__ */ g(B, { alignItems: "center", children: [
|
|
60
|
-
/* @__PURE__ */ e(
|
|
61
|
-
/* @__PURE__ */ e(
|
|
61
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: T(o, "0,0") }),
|
|
62
|
+
/* @__PURE__ */ e(y, { color: "secondary", variant: "Small", children: t.budgeted })
|
|
62
63
|
] }),
|
|
63
|
-
/* @__PURE__ */ e(
|
|
64
|
+
/* @__PURE__ */ e(y, { bold: !0, justifyContent: "center", variant: "Body", children: "=" }),
|
|
64
65
|
/* @__PURE__ */ g(B, { alignItems: "center", children: [
|
|
65
|
-
/* @__PURE__ */ e(
|
|
66
|
-
/* @__PURE__ */ e(
|
|
66
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: T(s, "0,0") }),
|
|
67
|
+
/* @__PURE__ */ e(y, { color: "secondary", variant: "Small", children: t.remaining })
|
|
67
68
|
] })
|
|
68
69
|
] });
|
|
69
|
-
}),
|
|
70
|
+
}), ct = E(
|
|
70
71
|
({ category: t }) => {
|
|
71
|
-
const { budgets: o } = w(), { budgets: i } = D(), s =
|
|
72
|
-
const a = i.find((
|
|
73
|
-
return `${
|
|
72
|
+
const { budgets: o } = w(), { budgets: i } = D(), s = l.useMemo(() => {
|
|
73
|
+
const a = i.find((c) => c.category_guid === t.guid), r = T(t.totalAverageAmount, "0,0"), n = a ? L(o.recalculate_previous_budget, T(a.amount, "0,0")) : o.recalculate_new_budget;
|
|
74
|
+
return `${r} - ${n}`;
|
|
74
75
|
}, [o, i]);
|
|
75
|
-
return /* @__PURE__ */ g(
|
|
76
|
+
return /* @__PURE__ */ g(l.Fragment, { children: [
|
|
76
77
|
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ g(Y, { children: [
|
|
77
78
|
/* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid, variant: "filled" }) }),
|
|
78
79
|
/* @__PURE__ */ e(Z, { primary: t.name, secondary: s })
|
|
@@ -80,27 +81,27 @@ const ct = E(() => {
|
|
|
80
81
|
/* @__PURE__ */ e(re, {})
|
|
81
82
|
] }, t.guid);
|
|
82
83
|
}
|
|
83
|
-
),
|
|
84
|
-
const { budgets: o, common: i } = w(), { spendCategories: s } = K(), { recalculateBudgets: a, setAlert:
|
|
85
|
-
await a(d),
|
|
84
|
+
), lt = ({ onRecalculateBudgets: t }) => {
|
|
85
|
+
const { budgets: o, common: i } = w(), { spendCategories: s } = K(), { recalculateBudgets: a, setAlert: r } = D(), [n, c] = l.useState(!1), d = s.filter((u) => u.totalAverageAmount > 0), m = async () => {
|
|
86
|
+
await a(d), c(!1), r(o.alert_recalculated_budgets), t?.();
|
|
86
87
|
};
|
|
87
|
-
return /* @__PURE__ */ g(
|
|
88
|
-
/* @__PURE__ */ e(
|
|
89
|
-
/* @__PURE__ */ e(
|
|
88
|
+
return /* @__PURE__ */ g(l.Fragment, { children: [
|
|
89
|
+
/* @__PURE__ */ e(Ae, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: o.recalculate_button }),
|
|
90
|
+
/* @__PURE__ */ e(y, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children: o.recalculate_help }),
|
|
90
91
|
/* @__PURE__ */ e(
|
|
91
|
-
|
|
92
|
+
$,
|
|
92
93
|
{
|
|
93
94
|
ariaLabelClose: i.close_aria,
|
|
94
|
-
isOpen:
|
|
95
|
-
onClose: () =>
|
|
95
|
+
isOpen: n,
|
|
96
|
+
onClose: () => c(!1),
|
|
96
97
|
onPrimaryAction: m,
|
|
97
98
|
title: o.recalculate_title,
|
|
98
99
|
children: /* @__PURE__ */ g(B, { children: [
|
|
99
100
|
/* @__PURE__ */ g(B, { mx: 24, my: 16, children: [
|
|
100
|
-
/* @__PURE__ */ e(
|
|
101
|
-
/* @__PURE__ */ e(
|
|
101
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: o.recalculate_description_top }),
|
|
102
|
+
/* @__PURE__ */ e(y, { variant: "ParagraphSmall", children: o.recalculate_description_bottom })
|
|
102
103
|
] }),
|
|
103
|
-
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(W, { children: d.map((u) => /* @__PURE__ */ e(
|
|
104
|
+
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(W, { children: d.map((u) => /* @__PURE__ */ e(ct, { category: u }, u.guid)) }) })
|
|
104
105
|
] })
|
|
105
106
|
}
|
|
106
107
|
)
|
|
@@ -110,17 +111,17 @@ const ct = E(() => {
|
|
|
110
111
|
categoryName: o,
|
|
111
112
|
onAmountChanged: i
|
|
112
113
|
}) => {
|
|
113
|
-
const { budgets: s } = w(), { totalBudgeted: a } = D(), { incomeTotal:
|
|
114
|
+
const { budgets: s } = w(), { totalBudgeted: a } = D(), { incomeTotal: r } = te(), n = r - a;
|
|
114
115
|
return /* @__PURE__ */ g(B, { gap: 16, children: [
|
|
115
116
|
/* @__PURE__ */ g(B, { children: [
|
|
116
|
-
/* @__PURE__ */ e(
|
|
117
|
+
/* @__PURE__ */ e(y, { children: L(
|
|
117
118
|
s.add_description_top,
|
|
118
|
-
T(
|
|
119
|
+
T(n, "0,0")
|
|
119
120
|
) }),
|
|
120
|
-
/* @__PURE__ */ e(
|
|
121
|
+
/* @__PURE__ */ e(y, { children: L(s.add_description_bottom, o) })
|
|
121
122
|
] }),
|
|
122
123
|
/* @__PURE__ */ e(
|
|
123
|
-
|
|
124
|
+
We,
|
|
124
125
|
{
|
|
125
126
|
amount: t,
|
|
126
127
|
autoFocus: !0,
|
|
@@ -131,12 +132,12 @@ const ct = E(() => {
|
|
|
131
132
|
}
|
|
132
133
|
)
|
|
133
134
|
] });
|
|
134
|
-
},
|
|
135
|
-
const { budgets: i, common: s } = w(), [a,
|
|
135
|
+
}, dt = E(({ category: t, onAddBudget: o }) => {
|
|
136
|
+
const { budgets: i, common: s } = w(), [a, r] = l.useState(!1), [n, c] = l.useState(
|
|
136
137
|
`${t.totalAmount === 0 ? "" : t.totalAmount}`
|
|
137
138
|
);
|
|
138
|
-
return /* @__PURE__ */ g(
|
|
139
|
-
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ g(Y, { onClick: () =>
|
|
139
|
+
return /* @__PURE__ */ g(l.Fragment, { children: [
|
|
140
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ g(Y, { onClick: () => r(!0), children: [
|
|
140
141
|
/* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid }) }),
|
|
141
142
|
/* @__PURE__ */ e(
|
|
142
143
|
Z,
|
|
@@ -145,38 +146,38 @@ const ct = E(() => {
|
|
|
145
146
|
secondary: T(t.totalAmount, "0,0")
|
|
146
147
|
}
|
|
147
148
|
),
|
|
148
|
-
/* @__PURE__ */ e(
|
|
149
|
+
/* @__PURE__ */ e(He, { children: /* @__PURE__ */ e(P, { name: "add", size: 20 }) })
|
|
149
150
|
] }) }, t.guid),
|
|
150
151
|
/* @__PURE__ */ e(
|
|
151
|
-
|
|
152
|
+
z,
|
|
152
153
|
{
|
|
153
154
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
154
|
-
disablePrimaryButton: Number(
|
|
155
|
+
disablePrimaryButton: Number(n) <= 0,
|
|
155
156
|
isOpen: a,
|
|
156
|
-
onClose: () =>
|
|
157
|
-
onPrimaryAction: () => o(t, Number(
|
|
157
|
+
onClose: () => r(!1),
|
|
158
|
+
onPrimaryAction: () => o(t, Number(n)),
|
|
158
159
|
primaryText: i.add_save_button,
|
|
159
|
-
children: /* @__PURE__ */ e(ce, { amount:
|
|
160
|
+
children: /* @__PURE__ */ e(ce, { amount: n, categoryName: t.name, onAmountChanged: c })
|
|
160
161
|
}
|
|
161
162
|
)
|
|
162
163
|
] });
|
|
163
|
-
}),
|
|
164
|
-
const { budgets:
|
|
165
|
-
await
|
|
164
|
+
}), Re = E(({ onAddBudget: t, onRecalculateBudgets: o }) => {
|
|
165
|
+
const { budgets: i } = w(), { addBudget: s, setAlert: a, unbudgetedCategories: r } = D(), n = async (c, d) => {
|
|
166
|
+
await s(c, d), t?.(), a(L(i.alert_budget_created, c.name));
|
|
166
167
|
};
|
|
167
168
|
return /* @__PURE__ */ g(B, { children: [
|
|
168
|
-
/* @__PURE__ */ e(
|
|
169
|
-
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(W, { children:
|
|
170
|
-
|
|
169
|
+
/* @__PURE__ */ e(it, {}),
|
|
170
|
+
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(W, { children: r.map((c) => /* @__PURE__ */ e(
|
|
171
|
+
dt,
|
|
171
172
|
{
|
|
172
|
-
category:
|
|
173
|
+
category: c,
|
|
173
174
|
onAddBudget: n
|
|
174
175
|
},
|
|
175
|
-
|
|
176
|
+
c.guid
|
|
176
177
|
)) }) }),
|
|
177
|
-
/* @__PURE__ */ e(
|
|
178
|
+
/* @__PURE__ */ e(lt, { onRecalculateBudgets: o })
|
|
178
179
|
] });
|
|
179
|
-
}),
|
|
180
|
+
}), _e = 5, Me = 100, Q = 25, ut = (t) => {
|
|
180
181
|
const o = (a) => {
|
|
181
182
|
a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
|
|
182
183
|
}, i = (a) => {
|
|
@@ -185,14 +186,14 @@ const ct = E(() => {
|
|
|
185
186
|
a.active || t.alphaTarget(0), a.subject.fx = null, a.subject.fy = null;
|
|
186
187
|
};
|
|
187
188
|
return O.drag().on("start", o).on("drag", i).on("end", s);
|
|
188
|
-
},
|
|
189
|
+
}, mt = (t) => {
|
|
189
190
|
let o = t.transaction_total / t.amount;
|
|
190
191
|
o < 0 ? o = 0 : o > 1 && (o = 1);
|
|
191
|
-
const i = o * 2 * Math.PI, s = O.interpolate(0, i), a = O.arc().cornerRadius(5).innerRadius(t.radius -
|
|
192
|
-
return (
|
|
193
|
-
},
|
|
194
|
-
O.selectAll(".bubble").call(
|
|
195
|
-
},
|
|
192
|
+
const i = o * 2 * Math.PI, s = O.interpolate(0, i), a = O.arc().cornerRadius(5).innerRadius(t.radius - _e * 2).outerRadius(t.radius - _e).startAngle(0).endAngle(0);
|
|
193
|
+
return (r) => (a.endAngle(s(r)), a(t) || "");
|
|
194
|
+
}, gt = (t) => {
|
|
195
|
+
O.selectAll(".bubble").call(ut(t));
|
|
196
|
+
}, Ce = (t, o, i) => Math.min(Math.max(t, o), i), pt = (t, o, i) => {
|
|
196
197
|
t.alpha(1).restart().force(
|
|
197
198
|
"x",
|
|
198
199
|
O.forceX().x(i / 2).strength(0.01)
|
|
@@ -202,65 +203,65 @@ const ct = E(() => {
|
|
|
202
203
|
).on("tick", () => {
|
|
203
204
|
const s = t.nodes();
|
|
204
205
|
s.forEach((a) => {
|
|
205
|
-
const
|
|
206
|
-
a.x =
|
|
206
|
+
const r = a.radius ?? Q;
|
|
207
|
+
a.x = Ce(a.x ?? 0, r, i - r), a.y = Ce(a.y ?? 0, r, o - r);
|
|
207
208
|
}), O.selectAll(".bubble").data(s).attr("transform", (a) => `translate(${a.x},${a.y})`);
|
|
208
209
|
});
|
|
209
|
-
},
|
|
210
|
-
const o = t.reduce((
|
|
211
|
-
const
|
|
212
|
-
return
|
|
213
|
-
}, 0), i = t.reduce((
|
|
214
|
-
const
|
|
215
|
-
return
|
|
216
|
-
}, o), s =
|
|
217
|
-
const
|
|
210
|
+
}, Le = (t, o) => O.scaleLinear().domain([t, o]).range([Q, Me]), ht = (t) => {
|
|
211
|
+
const o = t.reduce((r, n) => {
|
|
212
|
+
const c = Math.max(n.transaction_total, n.amount);
|
|
213
|
+
return c > r ? c : r;
|
|
214
|
+
}, 0), i = t.reduce((r, n) => {
|
|
215
|
+
const c = Math.max(n.transaction_total, n.amount);
|
|
216
|
+
return c < r ? c : r;
|
|
217
|
+
}, o), s = Le(i, o), a = t.map((r) => {
|
|
218
|
+
const n = s(Math.max(r.transaction_total, r.amount)) || 25;
|
|
218
219
|
return {
|
|
219
|
-
...
|
|
220
|
-
radius:
|
|
220
|
+
...r,
|
|
221
|
+
radius: n
|
|
221
222
|
};
|
|
222
223
|
});
|
|
223
|
-
return O.forceSimulation(a).velocityDecay(0.05).force("collide", O.forceCollide((
|
|
224
|
-
},
|
|
225
|
-
const a = Math.PI * Q ** 2 * t,
|
|
224
|
+
return O.forceSimulation(a).velocityDecay(0.05).force("collide", O.forceCollide((r) => r.radius + 2).strength(0.7));
|
|
225
|
+
}, ft = (t, o, i) => {
|
|
226
|
+
const a = Math.PI * Q ** 2 * t, r = i < 400 || o < 300, n = r ? 40 : 20, c = Math.max(100, i - n), d = Math.max(100, o - n), m = c * d;
|
|
226
227
|
let u = Q;
|
|
227
228
|
if (a < m) {
|
|
228
|
-
const h = Math.sqrt(m / (t * Math.PI)),
|
|
229
|
-
u = Math.min(
|
|
229
|
+
const h = Math.sqrt(m / (t * Math.PI)), b = Math.min(c, d) / 4;
|
|
230
|
+
u = Math.min(Me, h, b);
|
|
230
231
|
}
|
|
231
|
-
return
|
|
232
|
-
},
|
|
233
|
-
const { maxRadius:
|
|
234
|
-
return O.scaleLinear().domain([s, i]).range([
|
|
232
|
+
return r && t <= 3 && (u = Math.min(u, 45)), { minRadius: Math.max(20, u * 0.6), maxRadius: u };
|
|
233
|
+
}, bt = (t, o, i, s, a) => {
|
|
234
|
+
const { maxRadius: r, minRadius: n } = ft(t, o, a);
|
|
235
|
+
return O.scaleLinear().domain([s, i]).range([n, r]);
|
|
235
236
|
}, yt = (t, o, i = !1, s, a) => {
|
|
236
|
-
const
|
|
237
|
+
const r = o.map((m) => Math.max(m.transaction_total, m.amount)), n = Math.min(...r), c = Math.max(...r), d = i ? bt(t.length, s, c, n, a) : Le(n, c);
|
|
237
238
|
return t.map((m) => ({
|
|
238
239
|
...m,
|
|
239
240
|
radius: d(Math.max(m.transaction_total, m.amount))
|
|
240
241
|
}));
|
|
241
|
-
},
|
|
242
|
+
}, Be = 5, _t = 2e3, Ct = ({ bubble: t }) => {
|
|
242
243
|
const o = ee(), {
|
|
243
244
|
amount: i,
|
|
244
245
|
guid: s,
|
|
245
246
|
budgetColors: { mercury: a },
|
|
246
|
-
radius:
|
|
247
|
-
transaction_total:
|
|
248
|
-
} = t,
|
|
249
|
-
|
|
250
|
-
O.select(`.${
|
|
251
|
-
}, [i,
|
|
252
|
-
const d = O.arc().innerRadius((m) => m - 2 *
|
|
253
|
-
return /* @__PURE__ */ e("g", { className:
|
|
247
|
+
radius: r,
|
|
248
|
+
transaction_total: n
|
|
249
|
+
} = t, c = `mercury-${s}`;
|
|
250
|
+
l.useEffect(() => {
|
|
251
|
+
O.select(`.${c}`).selectAll(".status").remove(), O.select(`.${c}`).append("path").transition().duration(_t).delay(0).attr("class", "status").attr("style", `fill: ${a}; fill-opacity: 1;`).attrTween("d", () => mt(t));
|
|
252
|
+
}, [i, r, n]);
|
|
253
|
+
const d = O.arc().innerRadius((m) => m - 2 * Be).outerRadius((m) => m - Be).startAngle(0).endAngle(2 * Math.PI);
|
|
254
|
+
return /* @__PURE__ */ e("g", { className: c, children: /* @__PURE__ */ e(
|
|
254
255
|
"path",
|
|
255
256
|
{
|
|
256
|
-
d: d(
|
|
257
|
+
d: d(r) || "",
|
|
257
258
|
style: { fill: o.palette.common.white, fillOpacity: 0.35 }
|
|
258
259
|
}
|
|
259
260
|
) });
|
|
260
|
-
},
|
|
261
|
-
function
|
|
261
|
+
}, Bt = l.memo(Ct), j = 75, de = 50;
|
|
262
|
+
function St({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
262
263
|
} }) {
|
|
263
|
-
const [s, a] =
|
|
264
|
+
const [s, a] = l.useState(!1), r = Ve(), { availableWidth: n } = ne(), c = l.useMemo(() => {
|
|
264
265
|
if (t)
|
|
265
266
|
return {
|
|
266
267
|
amount: t.amount,
|
|
@@ -273,49 +274,49 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
273
274
|
if (!t) return;
|
|
274
275
|
const {
|
|
275
276
|
budgetColors: { background: d, text: m },
|
|
276
|
-
category: { icon: u, name:
|
|
277
|
+
category: { icon: u, name: f },
|
|
277
278
|
guid: h,
|
|
278
|
-
description:
|
|
279
|
-
radius:
|
|
280
|
-
x:
|
|
281
|
-
y
|
|
282
|
-
} = t,
|
|
283
|
-
let
|
|
284
|
-
|
|
279
|
+
description: b,
|
|
280
|
+
radius: p,
|
|
281
|
+
x: _,
|
|
282
|
+
y: S
|
|
283
|
+
} = t, C = n < 400 ? -8 : -12;
|
|
284
|
+
let v = C, A = C;
|
|
285
|
+
p > j ? (v = -14, A = -45) : p > de && (A = -32);
|
|
285
286
|
let x = 32;
|
|
286
|
-
|
|
287
|
-
const
|
|
287
|
+
p <= j && (x = n < 400 ? 16 : 24);
|
|
288
|
+
const R = `${t.category.name}: ${b}`, M = {
|
|
288
289
|
modifiers: [
|
|
289
290
|
{
|
|
290
291
|
name: "offset",
|
|
291
292
|
options: { offset: [0, 15] }
|
|
292
293
|
}
|
|
293
294
|
]
|
|
294
|
-
},
|
|
295
|
+
}, I = (U) => {
|
|
295
296
|
(U.key === "Enter" || U.key === " ") && (U.preventDefault(), i(t));
|
|
296
|
-
},
|
|
297
|
+
}, k = () => {
|
|
297
298
|
a(!0);
|
|
298
|
-
},
|
|
299
|
+
}, G = () => {
|
|
299
300
|
a(!1);
|
|
300
301
|
};
|
|
301
302
|
return /* @__PURE__ */ g(
|
|
302
303
|
"g",
|
|
303
304
|
{
|
|
304
|
-
"aria-label": `${
|
|
305
|
+
"aria-label": `${f} - ${b}`,
|
|
305
306
|
className: "bubble",
|
|
306
307
|
id: `bubble-${h}`,
|
|
307
|
-
onBlur:
|
|
308
|
+
onBlur: G,
|
|
308
309
|
onClick: () => i(t),
|
|
309
|
-
onFocus:
|
|
310
|
-
onKeyDown:
|
|
310
|
+
onFocus: k,
|
|
311
|
+
onKeyDown: I,
|
|
311
312
|
onMouseEnter: () => a(!0),
|
|
312
313
|
onMouseLeave: () => a(!1),
|
|
313
314
|
role: "button",
|
|
314
315
|
style: { cursor: o ? "pointer" : "default" },
|
|
315
316
|
tabIndex: 0,
|
|
316
317
|
textAnchor: "middle",
|
|
317
|
-
x:
|
|
318
|
-
y,
|
|
318
|
+
x: _,
|
|
319
|
+
y: S,
|
|
319
320
|
children: [
|
|
320
321
|
/* @__PURE__ */ e("style", { children: `
|
|
321
322
|
.bubble:focus,
|
|
@@ -324,15 +325,15 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
324
325
|
}
|
|
325
326
|
.bubble:focus circle,
|
|
326
327
|
.bubble:focus-visible circle {
|
|
327
|
-
stroke: ${
|
|
328
|
+
stroke: ${r.palette.primary.main};
|
|
328
329
|
stroke-width: 3;
|
|
329
330
|
stroke-opacity: 0.8;
|
|
330
331
|
}
|
|
331
332
|
` }),
|
|
332
|
-
/* @__PURE__ */ e(
|
|
333
|
-
/* @__PURE__ */ e("svg", { x:
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
/* @__PURE__ */ e(Xe, { open: s, slotProps: { popper: M }, title: R, children: /* @__PURE__ */ e("circle", { fill: d, id: `circle-${h}`, r: p }) }),
|
|
334
|
+
/* @__PURE__ */ e("svg", { x: v, y: A, children: /* @__PURE__ */ e(P, { name: u, size: x, sx: { fill: m } }) }),
|
|
335
|
+
p > j && /* @__PURE__ */ e(
|
|
336
|
+
y,
|
|
336
337
|
{
|
|
337
338
|
bold: !0,
|
|
338
339
|
component: "text",
|
|
@@ -340,95 +341,95 @@ function xt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
|
340
341
|
sx: { fill: m },
|
|
341
342
|
variant: "Small",
|
|
342
343
|
y: 4,
|
|
343
|
-
children:
|
|
344
|
+
children: f
|
|
344
345
|
}
|
|
345
346
|
),
|
|
346
|
-
|
|
347
|
-
|
|
347
|
+
p > de && /* @__PURE__ */ e(
|
|
348
|
+
y,
|
|
348
349
|
{
|
|
349
350
|
bold: !0,
|
|
350
351
|
component: "text",
|
|
351
352
|
id: `budget-description-${h}-1`,
|
|
352
353
|
sx: { fill: m },
|
|
353
354
|
variant: "Body",
|
|
354
|
-
y:
|
|
355
|
-
children:
|
|
355
|
+
y: p <= j ? 12 : 24,
|
|
356
|
+
children: p <= j ? b.split(" ")[0] : b
|
|
356
357
|
}
|
|
357
358
|
),
|
|
358
|
-
|
|
359
|
-
|
|
359
|
+
p <= j && p > de && /* @__PURE__ */ e(
|
|
360
|
+
y,
|
|
360
361
|
{
|
|
361
362
|
component: "text",
|
|
362
363
|
id: `budget-description-${h}-2`,
|
|
363
364
|
sx: { fill: m },
|
|
364
365
|
variant: "XSmall",
|
|
365
366
|
y: 28,
|
|
366
|
-
children:
|
|
367
|
+
children: b.split(" ")[1]
|
|
367
368
|
}
|
|
368
369
|
),
|
|
369
|
-
/* @__PURE__ */ e(
|
|
370
|
+
/* @__PURE__ */ e(Bt, { bubble: c })
|
|
370
371
|
]
|
|
371
372
|
},
|
|
372
373
|
h
|
|
373
374
|
);
|
|
374
375
|
}
|
|
375
|
-
const
|
|
376
|
+
const xt = ({
|
|
376
377
|
height: t,
|
|
377
378
|
width: o,
|
|
378
379
|
isDraggable: i = !1,
|
|
379
380
|
onClick: s = () => {
|
|
380
381
|
}
|
|
381
382
|
}) => {
|
|
382
|
-
const [a,
|
|
383
|
-
const u =
|
|
383
|
+
const [a, r] = l.useState([]), n = l.useRef(null), c = l.useRef(!1), { detailedBudgets: d } = D(), m = l.useCallback(() => {
|
|
384
|
+
const u = n.current, f = ht(d), h = f.nodes();
|
|
384
385
|
if (u) {
|
|
385
|
-
const
|
|
386
|
-
h.forEach((
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
vx:
|
|
390
|
-
vy:
|
|
391
|
-
x:
|
|
392
|
-
y:
|
|
386
|
+
const b = u.nodes(), p = new Map(b.map((_) => [_.guid, _]));
|
|
387
|
+
h.forEach((_) => {
|
|
388
|
+
const S = p.get(_.guid);
|
|
389
|
+
S && Object.assign(_, {
|
|
390
|
+
vx: S.vx,
|
|
391
|
+
vy: S.vy,
|
|
392
|
+
x: S.x,
|
|
393
|
+
y: S.y
|
|
393
394
|
});
|
|
394
395
|
});
|
|
395
396
|
}
|
|
396
|
-
|
|
397
|
+
n.current = f, c.current = !1, r(h);
|
|
397
398
|
}, [d]);
|
|
398
|
-
return
|
|
399
|
+
return l.useEffect(() => {
|
|
399
400
|
m();
|
|
400
|
-
}, [m]),
|
|
401
|
-
|
|
402
|
-
}, []),
|
|
403
|
-
const u =
|
|
401
|
+
}, [m]), l.useEffect(() => () => {
|
|
402
|
+
n.current && (n.current.stop(), n.current = null);
|
|
403
|
+
}, []), l.useEffect(() => {
|
|
404
|
+
const u = n.current;
|
|
404
405
|
if (!u) return;
|
|
405
|
-
const
|
|
406
|
-
u.nodes(
|
|
407
|
-
|
|
408
|
-
}, 0),
|
|
409
|
-
}, [t, o, i, d]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(o), children: a.map((u) => /* @__PURE__ */ e(
|
|
410
|
-
},
|
|
406
|
+
const f = u.nodes(), h = o > 0 && o < 450 || t > 0 && t < 300, b = yt(f, d, h, t, o);
|
|
407
|
+
u.nodes(b), pt(u, t, o), i && setTimeout(() => {
|
|
408
|
+
gt(u);
|
|
409
|
+
}, 0), r([...b]);
|
|
410
|
+
}, [t, o, i, d]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(o), children: a.map((u) => /* @__PURE__ */ e(St, { bubble: u, isDraggable: i, onClick: s }, u.guid)) });
|
|
411
|
+
}, vt = E(xt), At = ({
|
|
411
412
|
isMiniWidget: t = !1,
|
|
412
413
|
onConnectAccountsClick: o,
|
|
413
414
|
createBudgetOnClick: i
|
|
414
415
|
}) => {
|
|
415
|
-
const { recalculateBudgets: s } = D(), { spendCategories: a } = K(), { budgets:
|
|
416
|
-
|
|
417
|
-
const { data:
|
|
418
|
-
|
|
416
|
+
const { recalculateBudgets: s } = D(), { spendCategories: a } = K(), { budgets: r } = w(), { availableWidth: n } = ne(), { isMobile: c } = ie(n), d = t && c, [m, u] = l.useState(!1), [f, h] = l.useState(!1), [b, p] = l.useState(!1), _ = l.useMemo(() => [...a.filter((C) => C.totalAverageAmount > 0)], [a]), S = async () => {
|
|
417
|
+
p(!0);
|
|
418
|
+
const { data: C, isSuccess: v } = await s(_);
|
|
419
|
+
p(!1), v ? (C.length === 0 && h(!0), u(!1)) : u(!0);
|
|
419
420
|
};
|
|
420
|
-
return
|
|
421
|
-
|
|
421
|
+
return b ? /* @__PURE__ */ e(ge, {}) : m ? /* @__PURE__ */ e(
|
|
422
|
+
le,
|
|
422
423
|
{
|
|
423
|
-
header:
|
|
424
|
+
header: r.autogenerate_budgets_error_header,
|
|
424
425
|
icon: "error",
|
|
425
426
|
iconColor: "#4D4D4D",
|
|
426
|
-
onClick: (
|
|
427
|
-
|
|
427
|
+
onClick: (C) => {
|
|
428
|
+
C === "primary" ? S() : i();
|
|
428
429
|
},
|
|
429
|
-
primaryButton:
|
|
430
|
-
secondaryButton:
|
|
431
|
-
subText:
|
|
430
|
+
primaryButton: r.autogenerate_budgets_error_primary_button,
|
|
431
|
+
secondaryButton: r.zero_state_generate_budgets_secondary_button,
|
|
432
|
+
subText: r.autogenerate_budgets_error_subheader,
|
|
432
433
|
sx: {
|
|
433
434
|
width: { sm: 468 },
|
|
434
435
|
".buttons-footer": {
|
|
@@ -438,18 +439,18 @@ const vt = ({
|
|
|
438
439
|
...d && { justifyContent: "center", mt: 0, svg: { height: 32, width: 32 } }
|
|
439
440
|
}
|
|
440
441
|
}
|
|
441
|
-
) : /* @__PURE__ */ e(
|
|
442
|
-
|
|
442
|
+
) : /* @__PURE__ */ e(ze, { children: f ? /* @__PURE__ */ e(
|
|
443
|
+
le,
|
|
443
444
|
{
|
|
444
|
-
header:
|
|
445
|
+
header: r.zero_state_generate_budgets_header,
|
|
445
446
|
icon: "error",
|
|
446
447
|
iconColor: "#4D4D4D",
|
|
447
|
-
onClick: (
|
|
448
|
-
|
|
448
|
+
onClick: (C) => {
|
|
449
|
+
C === "primary" ? o() : i();
|
|
449
450
|
},
|
|
450
|
-
primaryButton:
|
|
451
|
-
secondaryButton:
|
|
452
|
-
subText:
|
|
451
|
+
primaryButton: r.zero_state_generate_budgets_primary_button,
|
|
452
|
+
secondaryButton: r.zero_state_generate_budgets_secondary_button,
|
|
453
|
+
subText: r.zero_state_generate_budgets_subheader,
|
|
453
454
|
sx: {
|
|
454
455
|
width: t ? "100%" : { sm: 500 },
|
|
455
456
|
height: t ? "100%" : { sm: 468 },
|
|
@@ -464,17 +465,17 @@ const vt = ({
|
|
|
464
465
|
}
|
|
465
466
|
}
|
|
466
467
|
) : /* @__PURE__ */ e(
|
|
467
|
-
|
|
468
|
+
le,
|
|
468
469
|
{
|
|
469
|
-
header:
|
|
470
|
+
header: r.create_budgets_title,
|
|
470
471
|
icon: "bubble_chart",
|
|
471
472
|
iconColor: "#1A1A1A",
|
|
472
|
-
onClick: (
|
|
473
|
-
|
|
473
|
+
onClick: (C) => {
|
|
474
|
+
C === "primary" ? S() : i();
|
|
474
475
|
},
|
|
475
|
-
primaryButton:
|
|
476
|
-
secondaryButton: t ? void 0 :
|
|
477
|
-
subText:
|
|
476
|
+
primaryButton: r.empty_state_primary_button,
|
|
477
|
+
secondaryButton: t ? void 0 : r.empty_state_secondary_button,
|
|
478
|
+
subText: r.empty_state_subheader,
|
|
478
479
|
sx: {
|
|
479
480
|
width: t ? "100%" : { sm: 432 },
|
|
480
481
|
height: t ? "100%" : { sm: 468 },
|
|
@@ -489,7 +490,7 @@ const vt = ({
|
|
|
489
490
|
}
|
|
490
491
|
}
|
|
491
492
|
) });
|
|
492
|
-
},
|
|
493
|
+
}, ke = E(
|
|
493
494
|
({
|
|
494
495
|
createBudgetOnClick: t = () => {
|
|
495
496
|
},
|
|
@@ -497,42 +498,42 @@ const vt = ({
|
|
|
497
498
|
isDraggable: i = !1,
|
|
498
499
|
isMiniWidget: s = !1,
|
|
499
500
|
shouldShowZeroState: a,
|
|
500
|
-
unavailableWidth:
|
|
501
|
+
unavailableWidth: r = 24
|
|
501
502
|
}) => {
|
|
502
|
-
const { onEvent:
|
|
503
|
-
|
|
504
|
-
budget_category:
|
|
503
|
+
const { onEvent: n } = X(), { setSelectedBudget: c } = D(), { isInitialized: d } = oe(), { accounts: m } = w(), { availableWidth: u } = ne(), { isMobile: f } = ie(), [h, b] = l.useState(!1), p = l.useMemo(() => u - r, [u]), _ = (C) => {
|
|
504
|
+
c(C), n(N.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
505
|
+
budget_category: C.category.name,
|
|
505
506
|
click_type: "bubble"
|
|
506
507
|
});
|
|
507
|
-
},
|
|
508
|
-
|
|
508
|
+
}, S = () => {
|
|
509
|
+
b(!0), n(N.ACCOUNTS_CLICK_CONNECT);
|
|
509
510
|
};
|
|
510
511
|
return /* @__PURE__ */ g(
|
|
511
512
|
F,
|
|
512
513
|
{
|
|
513
|
-
ml: a ||
|
|
514
|
+
ml: a || f ? 0 : 24,
|
|
514
515
|
sx: { alignSelf: "center", ...s && { height: "100%" } },
|
|
515
516
|
children: [
|
|
516
517
|
a || !d ? /* @__PURE__ */ e(
|
|
517
|
-
|
|
518
|
+
At,
|
|
518
519
|
{
|
|
519
520
|
createBudgetOnClick: t,
|
|
520
521
|
isMiniWidget: s,
|
|
521
|
-
onConnectAccountsClick:
|
|
522
|
+
onConnectAccountsClick: S
|
|
522
523
|
}
|
|
523
524
|
) : /* @__PURE__ */ e(
|
|
524
|
-
|
|
525
|
+
vt,
|
|
525
526
|
{
|
|
526
527
|
height: o,
|
|
527
528
|
isDraggable: i,
|
|
528
|
-
onClick:
|
|
529
|
-
width:
|
|
529
|
+
onClick: _,
|
|
530
|
+
width: p
|
|
530
531
|
}
|
|
531
532
|
),
|
|
532
533
|
/* @__PURE__ */ e(
|
|
533
|
-
|
|
534
|
+
Ke,
|
|
534
535
|
{
|
|
535
|
-
onClose: () =>
|
|
536
|
+
onClose: () => b(!1),
|
|
536
537
|
showConnectionsWidget: h,
|
|
537
538
|
title: m.manage_connections
|
|
538
539
|
}
|
|
@@ -541,381 +542,408 @@ const vt = ({
|
|
|
541
542
|
}
|
|
542
543
|
);
|
|
543
544
|
}
|
|
544
|
-
),
|
|
545
|
+
), Tt = ({
|
|
545
546
|
budgetsCopy: t,
|
|
546
547
|
difference: o,
|
|
547
548
|
handleAddClick: i,
|
|
548
549
|
shouldShowZeroState: s
|
|
549
550
|
}) => {
|
|
550
|
-
const { availableHeight: a = 0 } = ne(),
|
|
551
|
-
|
|
552
|
-
a > 0 &&
|
|
551
|
+
const { availableHeight: a = 0 } = ne(), r = l.useRef(null);
|
|
552
|
+
l.useEffect(() => {
|
|
553
|
+
a > 0 && r.current === null && (r.current = a);
|
|
553
554
|
}, [a]);
|
|
554
|
-
const
|
|
555
|
-
const
|
|
556
|
-
return
|
|
555
|
+
const n = l.useMemo(() => {
|
|
556
|
+
const c = r.current ?? a;
|
|
557
|
+
return c > 0 ? Math.round(Math.max(120, Math.min(450, c * 0.8))) - 40 : 450;
|
|
557
558
|
}, [a]);
|
|
558
559
|
return /* @__PURE__ */ g(B, { sx: { height: "100%", justifyContent: "space-between" }, children: [
|
|
559
560
|
/* @__PURE__ */ e(
|
|
560
|
-
|
|
561
|
+
ke,
|
|
561
562
|
{
|
|
562
563
|
createBudgetOnClick: i,
|
|
563
|
-
height:
|
|
564
|
+
height: n,
|
|
564
565
|
isMiniWidget: !0,
|
|
565
566
|
shouldShowZeroState: s
|
|
566
567
|
}
|
|
567
568
|
),
|
|
568
569
|
!s && /* @__PURE__ */ g(F, { ml: 16, children: [
|
|
569
|
-
/* @__PURE__ */ e(
|
|
570
|
-
/* @__PURE__ */ e(
|
|
570
|
+
/* @__PURE__ */ e(y, { bold: !0, color: o < 0 ? "error.main" : "success.main", children: T(Math.abs(o), "0,0") }),
|
|
571
|
+
/* @__PURE__ */ e(y, { children: o < 0 ? t.overspent_in_budgets : t.left_in_budgets })
|
|
571
572
|
] })
|
|
572
573
|
] });
|
|
573
|
-
},
|
|
574
|
-
const o = ee(), { onEvent: i } = X(), {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}, []),
|
|
578
|
-
|
|
579
|
-
}, [o]),
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
u && !n && p(
|
|
583
|
-
C,
|
|
574
|
+
}, wt = (t) => {
|
|
575
|
+
const o = ee(), { onEvent: i } = X(), { detailedBudgets: s, isDataLoaded: a, loadBudgetData: r, setTheme: n } = D(), { budgets: c, common: d } = w(), { isInitialized: m, selectedAccounts: u } = oe(), { loadDateRangeCategoryTotals: f } = K(), h = Ze(), [b, p] = l.useState(!1);
|
|
576
|
+
l.useEffect(() => {
|
|
577
|
+
a || r().finally();
|
|
578
|
+
}, []), l.useEffect(() => {
|
|
579
|
+
n(o);
|
|
580
|
+
}, [o]), l.useEffect(() => {
|
|
581
|
+
m && !a && f(
|
|
582
|
+
u,
|
|
584
583
|
J(/* @__PURE__ */ new Date()),
|
|
585
|
-
|
|
584
|
+
ue(/* @__PURE__ */ new Date())
|
|
586
585
|
).finally();
|
|
587
|
-
}, [u,
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
},
|
|
591
|
-
|
|
592
|
-
|
|
586
|
+
}, [m, u, a]);
|
|
587
|
+
const _ = () => {
|
|
588
|
+
p(!0), i(N.BUDGETS_CLICK_ADD);
|
|
589
|
+
}, S = () => {
|
|
590
|
+
p(!1);
|
|
591
|
+
}, C = () => p(!1);
|
|
592
|
+
if (Te({
|
|
593
|
+
widgetName: "BubbleBudgetsMiniWidget",
|
|
594
|
+
isLoaded: a
|
|
595
|
+
}), !m || !a) return /* @__PURE__ */ e(ge, {});
|
|
596
|
+
const v = s.length === 0;
|
|
597
|
+
return /* @__PURE__ */ g(
|
|
598
|
+
qe,
|
|
593
599
|
{
|
|
594
600
|
contentStyles: { height: "calc(100% - 66px)", ":last-child": { pb: 0 } },
|
|
595
|
-
primaryCtaLabel:
|
|
601
|
+
primaryCtaLabel: v ? c.get_started_cta : c.details_cta,
|
|
596
602
|
sx: { height: "100%" },
|
|
597
|
-
title:
|
|
603
|
+
title: c.budgets_title,
|
|
598
604
|
...t,
|
|
599
605
|
children: [
|
|
600
606
|
/* @__PURE__ */ e(
|
|
601
|
-
|
|
607
|
+
Tt,
|
|
602
608
|
{
|
|
603
|
-
budgetsCopy:
|
|
604
|
-
difference:
|
|
605
|
-
handleAddClick:
|
|
606
|
-
shouldShowZeroState:
|
|
609
|
+
budgetsCopy: c,
|
|
610
|
+
difference: h,
|
|
611
|
+
handleAddClick: _,
|
|
612
|
+
shouldShowZeroState: v
|
|
607
613
|
}
|
|
608
614
|
),
|
|
609
615
|
/* @__PURE__ */ e(
|
|
610
|
-
|
|
616
|
+
$,
|
|
611
617
|
{
|
|
612
|
-
ariaLabelClose:
|
|
613
|
-
isOpen:
|
|
614
|
-
onClose: () =>
|
|
615
|
-
title:
|
|
616
|
-
children: /* @__PURE__ */ e(
|
|
618
|
+
ariaLabelClose: d.close_aria,
|
|
619
|
+
isOpen: b,
|
|
620
|
+
onClose: () => p(!1),
|
|
621
|
+
title: c.add_new_title,
|
|
622
|
+
children: /* @__PURE__ */ e(
|
|
623
|
+
Re,
|
|
624
|
+
{
|
|
625
|
+
onAddBudget: S,
|
|
626
|
+
onRecalculateBudgets: C
|
|
627
|
+
}
|
|
628
|
+
)
|
|
617
629
|
}
|
|
618
630
|
)
|
|
619
631
|
]
|
|
620
632
|
}
|
|
621
633
|
);
|
|
622
|
-
},
|
|
634
|
+
}, Ln = E(wt), Ne = ({ budget: t }) => {
|
|
623
635
|
const {
|
|
624
636
|
amount: o,
|
|
625
637
|
budgetColors: { background: i },
|
|
626
638
|
category: { name: s },
|
|
627
639
|
category_guid: a,
|
|
628
|
-
percentage:
|
|
629
|
-
transaction_total:
|
|
630
|
-
} = t,
|
|
640
|
+
percentage: r,
|
|
641
|
+
transaction_total: n
|
|
642
|
+
} = t, c = [
|
|
631
643
|
{
|
|
632
644
|
color: i,
|
|
633
|
-
percentage: `${
|
|
645
|
+
percentage: `${r}%`
|
|
634
646
|
}
|
|
635
647
|
];
|
|
636
|
-
return /* @__PURE__ */ e(
|
|
648
|
+
return /* @__PURE__ */ e(pe, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(he, { children: /* @__PURE__ */ g(B, { alignItems: "center", gap: 16, children: [
|
|
637
649
|
/* @__PURE__ */ e(H, { categoryGuid: a, size: 56 }),
|
|
638
|
-
/* @__PURE__ */ e(
|
|
639
|
-
/* @__PURE__ */ e(
|
|
640
|
-
/* @__PURE__ */ e(
|
|
650
|
+
/* @__PURE__ */ e(Ue, { variant: "H1", children: `${T(n, "0,0")} / ${T(o, "0,0")}` }),
|
|
651
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "XSmall", children: s }),
|
|
652
|
+
/* @__PURE__ */ e(me, { data: c, height: 10 })
|
|
641
653
|
] }) }) });
|
|
642
|
-
},
|
|
654
|
+
}, Dt = E(() => {
|
|
643
655
|
const { budgets: t } = w();
|
|
644
656
|
return /* @__PURE__ */ g(B, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
|
|
645
657
|
/* @__PURE__ */ e(P, { color: "secondary", name: "bubble_chart", sx: { fontSize: 32 } }),
|
|
646
|
-
/* @__PURE__ */ e(
|
|
647
|
-
/* @__PURE__ */ e(
|
|
658
|
+
/* @__PURE__ */ e(y, { bold: !0, color: "secondary", variant: "Small", children: t.zero_state_no_sub_budgets }),
|
|
659
|
+
/* @__PURE__ */ e(y, { color: "text.secondary", variant: "XSmall", children: t.zero_state_no_sub_budgets_description })
|
|
648
660
|
] });
|
|
649
|
-
}),
|
|
661
|
+
}), Et = E(({ budget: t }) => {
|
|
650
662
|
const {
|
|
651
663
|
amount: o,
|
|
652
664
|
budgetColors: { background: i },
|
|
653
665
|
category: s,
|
|
654
666
|
percentage: a,
|
|
655
|
-
transaction_total:
|
|
656
|
-
} = t, { setSelectedSubBudget:
|
|
657
|
-
return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ g(Y, { onClick: () =>
|
|
658
|
-
/* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(
|
|
667
|
+
transaction_total: r
|
|
668
|
+
} = t, { setSelectedSubBudget: n } = D();
|
|
669
|
+
return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ g(Y, { onClick: () => n(t), children: [
|
|
670
|
+
/* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Ie, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
|
|
659
671
|
/* @__PURE__ */ e(
|
|
660
672
|
Z,
|
|
661
673
|
{
|
|
662
|
-
primary: /* @__PURE__ */ e(B, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(
|
|
663
|
-
secondary: /* @__PURE__ */ e(B, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(
|
|
664
|
-
${T(
|
|
674
|
+
primary: /* @__PURE__ */ e(B, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: t.category.name }) }),
|
|
675
|
+
secondary: /* @__PURE__ */ e(B, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(y, { fontWeight: 400, variant: "Body", children: `
|
|
676
|
+
${T(r, "0,0")} /
|
|
665
677
|
${T(o, "0,0")}
|
|
666
678
|
` }) })
|
|
667
679
|
}
|
|
668
680
|
)
|
|
669
681
|
] }) });
|
|
670
|
-
}),
|
|
671
|
-
const { budgets: i, common: s } = w(), { setExpandedGuid: a, setOnSelect:
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
|
|
682
|
+
}), It = E(({ category: t, parentBudget: o }) => {
|
|
683
|
+
const { budgets: i, common: s } = w(), { setExpandedGuid: a, setOnSelect: r } = nt(), { addBudget: n } = D(), [c, d] = l.useState(!1), [m, u] = l.useState(!1), [f, h] = l.useState(""), [b, p] = l.useState(void 0);
|
|
684
|
+
l.useEffect(() => {
|
|
685
|
+
r((C) => {
|
|
686
|
+
const v = t.subCategories.find((A) => A.guid === C);
|
|
687
|
+
v && (p(v), h(`${v.currentAmount === 0 ? "" : v.currentAmount}`), u(!0));
|
|
676
688
|
});
|
|
677
689
|
}, []);
|
|
678
|
-
const
|
|
690
|
+
const _ = () => {
|
|
679
691
|
a(t.guid), d(!0);
|
|
680
|
-
},
|
|
681
|
-
|
|
692
|
+
}, S = async () => {
|
|
693
|
+
b && Number(f) > 0 && (await n(b, Number(f), o.guid), u(!1), d(!1), p(void 0));
|
|
682
694
|
};
|
|
683
695
|
return /* @__PURE__ */ g(F, { children: [
|
|
684
|
-
/* @__PURE__ */ e(V, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Y, { onClick:
|
|
696
|
+
/* @__PURE__ */ e(V, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Y, { onClick: _, children: /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ g(B, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
685
697
|
/* @__PURE__ */ g(B, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
686
698
|
/* @__PURE__ */ e(P, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.light" } }),
|
|
687
|
-
/* @__PURE__ */ e(
|
|
699
|
+
/* @__PURE__ */ e(y, { bold: !0, sx: { color: "primary.light" }, variant: "Body", children: i.add_sub_budget_button })
|
|
688
700
|
] }),
|
|
689
701
|
/* @__PURE__ */ e(P, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
|
|
690
702
|
] }) }) }) }),
|
|
691
703
|
/* @__PURE__ */ e(re, {}),
|
|
692
704
|
/* @__PURE__ */ e(
|
|
693
|
-
|
|
705
|
+
$,
|
|
694
706
|
{
|
|
695
707
|
ariaLabelClose: s.close_aria,
|
|
696
|
-
isOpen:
|
|
708
|
+
isOpen: c,
|
|
697
709
|
onClose: () => d(!1),
|
|
698
710
|
title: i.add_sub_budget_title,
|
|
699
|
-
children: /* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(
|
|
711
|
+
children: /* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(ot, { category: t, subCategories: t.subCategories }) })
|
|
700
712
|
}
|
|
701
713
|
),
|
|
702
714
|
/* @__PURE__ */ e(
|
|
703
|
-
|
|
715
|
+
z,
|
|
704
716
|
{
|
|
705
717
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
706
|
-
disablePrimaryButton: Number(
|
|
718
|
+
disablePrimaryButton: Number(f) <= 0,
|
|
707
719
|
isOpen: m,
|
|
708
720
|
onClose: () => u(!1),
|
|
709
|
-
onPrimaryAction:
|
|
721
|
+
onPrimaryAction: S,
|
|
710
722
|
primaryText: i.add_save_button,
|
|
711
723
|
children: /* @__PURE__ */ e(
|
|
712
724
|
ce,
|
|
713
725
|
{
|
|
714
|
-
amount:
|
|
715
|
-
categoryName:
|
|
726
|
+
amount: f,
|
|
727
|
+
categoryName: b?.name || "",
|
|
716
728
|
onAmountChanged: h
|
|
717
729
|
}
|
|
718
730
|
)
|
|
719
731
|
}
|
|
720
732
|
)
|
|
721
733
|
] });
|
|
722
|
-
}),
|
|
723
|
-
const { category: o, subBudgets: i } = t, { budgets: s, common: a } = w(), { deleteBudget:
|
|
724
|
-
|
|
725
|
-
|
|
734
|
+
}), Ot = E(({ budget: t }) => {
|
|
735
|
+
const { category: o, subBudgets: i } = t, { budgets: s, common: a } = w(), { deleteBudget: r, selectedSubBudget: n, setSelectedSubBudget: c, updateBudget: d } = D(), { filter: m, setFilter: u } = ae(), [f, h] = l.useState(!1), [b, p] = l.useState(!1), [_, S] = l.useState("");
|
|
736
|
+
l.useEffect(() => {
|
|
737
|
+
n && (S(`${n.amount}`), u({
|
|
726
738
|
...m,
|
|
727
|
-
custom: (x) => x.category_guid ===
|
|
739
|
+
custom: (x) => x.category_guid === n.category_guid
|
|
728
740
|
}));
|
|
729
|
-
}, [
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
...
|
|
733
|
-
amount: Number(
|
|
741
|
+
}, [n]);
|
|
742
|
+
const C = async () => {
|
|
743
|
+
n && await d({
|
|
744
|
+
...n,
|
|
745
|
+
amount: Number(_)
|
|
734
746
|
});
|
|
735
|
-
},
|
|
736
|
-
|
|
737
|
-
},
|
|
747
|
+
}, v = async () => {
|
|
748
|
+
n && await r(n.guid), p(!1), A();
|
|
749
|
+
}, A = () => {
|
|
738
750
|
u({
|
|
739
751
|
...m,
|
|
740
752
|
custom: (x) => x.category_guid === t.category_guid || x.top_level_category_guid === t.category_guid
|
|
741
|
-
}),
|
|
753
|
+
}), c(void 0);
|
|
742
754
|
};
|
|
743
|
-
return /* @__PURE__ */ g(
|
|
755
|
+
return /* @__PURE__ */ g(l.Fragment, { children: [
|
|
744
756
|
/* @__PURE__ */ g(W, { sx: { bgcolor: "background.paper" }, children: [
|
|
745
|
-
i.length === 0 ? /* @__PURE__ */ e(
|
|
746
|
-
/* @__PURE__ */ e(
|
|
757
|
+
i.length === 0 ? /* @__PURE__ */ e(Dt, {}) : i.map((x) => /* @__PURE__ */ g(l.Fragment, { children: [
|
|
758
|
+
/* @__PURE__ */ e(Et, { budget: x }),
|
|
747
759
|
/* @__PURE__ */ e(re, {})
|
|
748
760
|
] }, x.guid)),
|
|
749
|
-
/* @__PURE__ */ e(
|
|
761
|
+
/* @__PURE__ */ e(It, { category: o, parentBudget: t })
|
|
750
762
|
] }),
|
|
751
763
|
/* @__PURE__ */ e(
|
|
752
|
-
|
|
764
|
+
$,
|
|
753
765
|
{
|
|
754
766
|
ariaLabelClose: a.close_aria,
|
|
755
|
-
isOpen: !!
|
|
756
|
-
onClose:
|
|
767
|
+
isOpen: !!n,
|
|
768
|
+
onClose: A,
|
|
757
769
|
onPrimaryAction: () => h(!0),
|
|
758
|
-
onSecondaryAction: () =>
|
|
770
|
+
onSecondaryAction: () => p(!0),
|
|
759
771
|
primaryText: s.details_edit_button,
|
|
760
772
|
secondaryText: s.details_delete_button,
|
|
761
773
|
title: s.details_title,
|
|
762
|
-
children:
|
|
763
|
-
/* @__PURE__ */ e(
|
|
764
|
-
/* @__PURE__ */ e(
|
|
774
|
+
children: n && /* @__PURE__ */ g(B, { gap: 24, children: [
|
|
775
|
+
/* @__PURE__ */ e(Ne, { budget: n }),
|
|
776
|
+
/* @__PURE__ */ e(Ee, { height: "100%" })
|
|
765
777
|
] })
|
|
766
778
|
}
|
|
767
779
|
),
|
|
768
|
-
|
|
780
|
+
n && /* @__PURE__ */ g(l.Fragment, { children: [
|
|
769
781
|
/* @__PURE__ */ e(
|
|
770
|
-
|
|
782
|
+
z,
|
|
771
783
|
{
|
|
772
784
|
copy: { close_aria: a.close_aria, title: s.details_edit_title },
|
|
773
|
-
disablePrimaryButton: Number(
|
|
774
|
-
isOpen:
|
|
785
|
+
disablePrimaryButton: Number(_) <= 0,
|
|
786
|
+
isOpen: f,
|
|
775
787
|
onClose: () => h(!1),
|
|
776
|
-
onPrimaryAction:
|
|
788
|
+
onPrimaryAction: C,
|
|
777
789
|
primaryText: s.edit_save_button,
|
|
778
790
|
children: /* @__PURE__ */ e(
|
|
779
791
|
ce,
|
|
780
792
|
{
|
|
781
|
-
amount:
|
|
782
|
-
categoryName:
|
|
783
|
-
onAmountChanged:
|
|
793
|
+
amount: _,
|
|
794
|
+
categoryName: n.category.name,
|
|
795
|
+
onAmountChanged: S
|
|
784
796
|
}
|
|
785
797
|
)
|
|
786
798
|
}
|
|
787
799
|
),
|
|
788
800
|
/* @__PURE__ */ e(
|
|
789
|
-
|
|
801
|
+
z,
|
|
790
802
|
{
|
|
791
803
|
copy: { close_aria: a.close_aria, title: s.delete_title },
|
|
792
|
-
isOpen:
|
|
793
|
-
onClose: () =>
|
|
794
|
-
onPrimaryAction:
|
|
804
|
+
isOpen: b,
|
|
805
|
+
onClose: () => p(!1),
|
|
806
|
+
onPrimaryAction: v,
|
|
795
807
|
primaryColor: "error",
|
|
796
808
|
primaryText: "Delete",
|
|
797
809
|
secondaryColor: "secondary",
|
|
798
|
-
children: /* @__PURE__ */ e(
|
|
810
|
+
children: /* @__PURE__ */ e(y, { variant: "Paragraph", children: L(s.delete_description, n.category.name) })
|
|
799
811
|
}
|
|
800
812
|
)
|
|
801
813
|
] })
|
|
802
814
|
] });
|
|
803
815
|
}), Rt = E(({ budget: t }) => {
|
|
804
|
-
const { is_mobile_webview: o } =
|
|
816
|
+
const { is_mobile_webview: o } = Fe(), { setAlert: i } = D(), { budgets: s, common: a, transactions: r } = w(), { isDesktop: n, isSmallTablet: c, isTablet: d } = ie(), {
|
|
805
817
|
sortedTransactions: m,
|
|
806
818
|
sortedTransactionsWithSplits: u,
|
|
807
|
-
tags:
|
|
808
|
-
} = ae(), [h,
|
|
809
|
-
() => m.find((x) => x.guid ===
|
|
810
|
-
[
|
|
811
|
-
),
|
|
812
|
-
|
|
813
|
-
},
|
|
814
|
-
|
|
815
|
-
},
|
|
819
|
+
tags: f
|
|
820
|
+
} = ae(), [h, b] = l.useState(0), [p, _] = l.useState(""), S = l.useMemo(
|
|
821
|
+
() => m.find((x) => x.guid === p),
|
|
822
|
+
[p, m]
|
|
823
|
+
), C = (x, R) => {
|
|
824
|
+
b(R);
|
|
825
|
+
}, v = () => {
|
|
826
|
+
et(u, f), i(s.alert_csv_downloaded);
|
|
827
|
+
}, A = m.length > 0 && !o && (n || d && !c);
|
|
816
828
|
return /* @__PURE__ */ g(B, { gap: 24, children: [
|
|
817
|
-
/* @__PURE__ */ e(
|
|
829
|
+
/* @__PURE__ */ e(Ne, { budget: t }),
|
|
818
830
|
/* @__PURE__ */ g(B, { children: [
|
|
819
831
|
/* @__PURE__ */ g(
|
|
820
|
-
|
|
832
|
+
Qe,
|
|
821
833
|
{
|
|
822
|
-
onChange:
|
|
834
|
+
onChange: C,
|
|
823
835
|
sx: { width: "100%" },
|
|
824
836
|
textColor: "primary",
|
|
825
837
|
value: h,
|
|
826
838
|
variant: "fullWidth",
|
|
827
839
|
children: [
|
|
828
|
-
/* @__PURE__ */ e(
|
|
829
|
-
/* @__PURE__ */ e(
|
|
840
|
+
/* @__PURE__ */ e(ye, { label: s.details_transactions_tab }),
|
|
841
|
+
/* @__PURE__ */ e(ye, { label: s.details_subbudgets_tab })
|
|
830
842
|
]
|
|
831
843
|
}
|
|
832
844
|
),
|
|
833
845
|
h === 0 && /* @__PURE__ */ g(B, { children: [
|
|
834
|
-
|
|
835
|
-
|
|
846
|
+
A && /* @__PURE__ */ e(B, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
|
|
847
|
+
Ae,
|
|
836
848
|
{
|
|
837
|
-
onClick:
|
|
849
|
+
onClick: v,
|
|
838
850
|
startIcon: /* @__PURE__ */ e(P, { name: "ios_share" }),
|
|
839
851
|
variant: "text",
|
|
840
|
-
children:
|
|
852
|
+
children: r.export_csv_btn
|
|
841
853
|
}
|
|
842
854
|
) }),
|
|
843
|
-
/* @__PURE__ */ e(
|
|
855
|
+
/* @__PURE__ */ e(Ee, { height: "100%", onClick: _ })
|
|
844
856
|
] }),
|
|
845
|
-
h === 1 && /* @__PURE__ */ e(
|
|
857
|
+
h === 1 && /* @__PURE__ */ e(Ot, { budget: t }),
|
|
846
858
|
/* @__PURE__ */ e(
|
|
847
|
-
|
|
859
|
+
$,
|
|
848
860
|
{
|
|
849
861
|
ariaLabelClose: a.close_aria,
|
|
850
|
-
isOpen: !!
|
|
851
|
-
onClose: () =>
|
|
862
|
+
isOpen: !!S,
|
|
863
|
+
onClose: () => _(""),
|
|
852
864
|
title: s.details_transaction_drawer,
|
|
853
|
-
children:
|
|
865
|
+
children: S && /* @__PURE__ */ e(tt, { transaction: S })
|
|
854
866
|
}
|
|
855
867
|
)
|
|
856
868
|
] })
|
|
857
869
|
] });
|
|
858
|
-
}),
|
|
870
|
+
}), Mt = E(() => {
|
|
859
871
|
const { selectedAccountGuids: t } = oe(), { budgets: o, common: i } = w(), {
|
|
860
|
-
|
|
861
|
-
|
|
872
|
+
alert: s,
|
|
873
|
+
dateRange: a,
|
|
874
|
+
deleteBudget: r,
|
|
862
875
|
selectedBudget: n,
|
|
863
|
-
selectedSubBudget:
|
|
864
|
-
setAlert:
|
|
865
|
-
setSelectedBudget:
|
|
866
|
-
updateBudget:
|
|
867
|
-
} = D(), { setFilter:
|
|
868
|
-
|
|
869
|
-
n && !
|
|
876
|
+
selectedSubBudget: c,
|
|
877
|
+
setAlert: d,
|
|
878
|
+
setSelectedBudget: m,
|
|
879
|
+
updateBudget: u
|
|
880
|
+
} = D(), { setFilter: f } = ae(), [h, b] = l.useState(!1), [p, _] = l.useState(!1), [S, C] = l.useState(!1), [v, A] = l.useState("");
|
|
881
|
+
l.useEffect(() => {
|
|
882
|
+
n && !c && (A(`${n.amount}`), b(!0), f({
|
|
870
883
|
accounts: t,
|
|
871
|
-
dateRange:
|
|
872
|
-
custom: (
|
|
884
|
+
dateRange: a,
|
|
885
|
+
custom: (k) => k.category_guid === n.category_guid || k.top_level_category_guid === n.category_guid,
|
|
873
886
|
showSplits: !0
|
|
874
887
|
}));
|
|
875
888
|
}, [n]);
|
|
876
|
-
const
|
|
877
|
-
n && (await
|
|
889
|
+
const x = async () => {
|
|
890
|
+
n && (await u({
|
|
878
891
|
...n,
|
|
879
|
-
amount: Number(
|
|
880
|
-
percentage: n.category.totalAmount / Number(
|
|
881
|
-
}),
|
|
882
|
-
},
|
|
883
|
-
n && (await
|
|
884
|
-
},
|
|
885
|
-
|
|
886
|
-
|
|
892
|
+
amount: Number(v),
|
|
893
|
+
percentage: n.category.totalAmount / Number(v) * 100
|
|
894
|
+
}), _(!1), d(L(o.alert_budget_updated, n.category.name)));
|
|
895
|
+
}, R = async () => {
|
|
896
|
+
n && (await r(n.guid), d(L(o.alert_budget_deleted, n.category.name))), M();
|
|
897
|
+
}, M = () => {
|
|
898
|
+
b(!1), setTimeout(() => {
|
|
899
|
+
m(void 0);
|
|
887
900
|
}, 250);
|
|
901
|
+
}, I = () => {
|
|
902
|
+
_(!1), A(`${n?.amount}`);
|
|
888
903
|
};
|
|
889
904
|
if (n)
|
|
890
|
-
return /* @__PURE__ */ g(
|
|
891
|
-
/* @__PURE__ */
|
|
892
|
-
|
|
905
|
+
return /* @__PURE__ */ g(l.Fragment, { children: [
|
|
906
|
+
/* @__PURE__ */ g(
|
|
907
|
+
$,
|
|
893
908
|
{
|
|
894
909
|
ariaLabelClose: i.close_aria,
|
|
895
|
-
isOpen:
|
|
896
|
-
onClose:
|
|
897
|
-
onPrimaryAction: () =>
|
|
898
|
-
onSecondaryAction: () =>
|
|
910
|
+
isOpen: h,
|
|
911
|
+
onClose: M,
|
|
912
|
+
onPrimaryAction: () => _(!0),
|
|
913
|
+
onSecondaryAction: () => C(!0),
|
|
899
914
|
primaryText: o.details_edit_button,
|
|
900
915
|
secondaryColor: "error",
|
|
901
916
|
secondaryText: o.details_delete_button,
|
|
902
917
|
title: o.details_title,
|
|
903
|
-
children:
|
|
918
|
+
children: [
|
|
919
|
+
/* @__PURE__ */ e(Rt, { budget: n }),
|
|
920
|
+
/* @__PURE__ */ e(
|
|
921
|
+
De,
|
|
922
|
+
{
|
|
923
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
924
|
+
autoHideDuration: 3500,
|
|
925
|
+
onClose: () => d(""),
|
|
926
|
+
open: !!s,
|
|
927
|
+
children: /* @__PURE__ */ e(we, { closeText: "", onClose: () => d(""), severity: "success", variant: "filled", children: s })
|
|
928
|
+
}
|
|
929
|
+
)
|
|
930
|
+
]
|
|
904
931
|
}
|
|
905
932
|
),
|
|
906
933
|
/* @__PURE__ */ e(
|
|
907
|
-
|
|
934
|
+
z,
|
|
908
935
|
{
|
|
909
936
|
copy: { close_aria: i.close_aria, title: o.details_edit_title },
|
|
910
|
-
disablePrimaryButton: Number(
|
|
937
|
+
disablePrimaryButton: Number(v) <= 0,
|
|
911
938
|
isOpen: p,
|
|
912
|
-
onClose:
|
|
913
|
-
onPrimaryAction:
|
|
939
|
+
onClose: I,
|
|
940
|
+
onPrimaryAction: x,
|
|
941
|
+
onSecondaryAction: I,
|
|
914
942
|
primaryText: o.edit_save_button,
|
|
915
943
|
children: /* @__PURE__ */ e(
|
|
916
944
|
ce,
|
|
917
945
|
{
|
|
918
|
-
amount:
|
|
946
|
+
amount: v,
|
|
919
947
|
categoryName: n.category.name,
|
|
920
948
|
onAmountChanged: A
|
|
921
949
|
}
|
|
@@ -923,16 +951,16 @@ const vt = ({
|
|
|
923
951
|
}
|
|
924
952
|
),
|
|
925
953
|
/* @__PURE__ */ e(
|
|
926
|
-
|
|
954
|
+
z,
|
|
927
955
|
{
|
|
928
956
|
copy: { close_aria: i.close_aria, title: o.delete_title },
|
|
929
957
|
isOpen: S,
|
|
930
|
-
onClose: () =>
|
|
931
|
-
onPrimaryAction:
|
|
958
|
+
onClose: () => C(!1),
|
|
959
|
+
onPrimaryAction: R,
|
|
932
960
|
primaryColor: "error",
|
|
933
961
|
primaryText: o.details_delete_button,
|
|
934
962
|
secondaryColor: "secondary",
|
|
935
|
-
children: /* @__PURE__ */ e(
|
|
963
|
+
children: /* @__PURE__ */ e(y, { variant: "Paragraph", children: L(o.delete_description, n.category.name) })
|
|
936
964
|
}
|
|
937
965
|
)
|
|
938
966
|
] });
|
|
@@ -940,171 +968,175 @@ const vt = ({
|
|
|
940
968
|
const {
|
|
941
969
|
amount: i,
|
|
942
970
|
budgetColors: { background: s, description: a },
|
|
943
|
-
category_guid:
|
|
944
|
-
description:
|
|
945
|
-
percentage:
|
|
971
|
+
category_guid: r,
|
|
972
|
+
description: n,
|
|
973
|
+
percentage: c,
|
|
946
974
|
subBudgets: d,
|
|
947
975
|
transaction_total: m
|
|
948
976
|
} = t;
|
|
949
977
|
return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ g(Y, { onClick: () => o?.(t), children: [
|
|
950
|
-
/* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(
|
|
978
|
+
/* @__PURE__ */ e(se, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Ie, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: r, variant: "basic" }) }) }),
|
|
951
979
|
/* @__PURE__ */ e(
|
|
952
980
|
Z,
|
|
953
981
|
{
|
|
954
982
|
primary: /* @__PURE__ */ g(B, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
955
|
-
/* @__PURE__ */ e(
|
|
956
|
-
/* @__PURE__ */ e(
|
|
983
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: t.category.name }),
|
|
984
|
+
/* @__PURE__ */ e(y, { fontWeight: 400, variant: "Body", children: `
|
|
957
985
|
${T(m, "0,0")} /
|
|
958
986
|
${T(i, "0,0")}
|
|
959
987
|
` })
|
|
960
988
|
] }),
|
|
961
989
|
secondary: /* @__PURE__ */ g(B, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
962
|
-
/* @__PURE__ */ e(
|
|
963
|
-
/* @__PURE__ */ e(
|
|
990
|
+
/* @__PURE__ */ e(y, { variant: "XSmall", children: `${d.length} Sub-budgets` }),
|
|
991
|
+
/* @__PURE__ */ e(y, { bold: c > 100, color: a, variant: "XSmall", children: n })
|
|
964
992
|
] })
|
|
965
993
|
}
|
|
966
994
|
)
|
|
967
995
|
] }) });
|
|
968
|
-
},
|
|
969
|
-
const { onEvent: t } = X(), { budgets: o } = w(), { detailedBudgets: i, setSelectedBudget: s } = D(), a = (
|
|
970
|
-
s(
|
|
971
|
-
budget_category:
|
|
996
|
+
}, kt = E(() => {
|
|
997
|
+
const { onEvent: t } = X(), { budgets: o } = w(), { detailedBudgets: i, setSelectedBudget: s } = D(), a = (r) => {
|
|
998
|
+
s(r), t(N.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
999
|
+
budget_category: r.category.name,
|
|
972
1000
|
click_type: "list"
|
|
973
1001
|
});
|
|
974
1002
|
};
|
|
975
|
-
return /* @__PURE__ */ g(
|
|
976
|
-
/* @__PURE__ */ e(
|
|
977
|
-
/* @__PURE__ */ e(
|
|
978
|
-
/* @__PURE__ */ e(Lt, { budget:
|
|
1003
|
+
return /* @__PURE__ */ g(pe, { elevation: 2, children: [
|
|
1004
|
+
/* @__PURE__ */ e(Oe, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(xe, { children: o.budget_categories_title }) }),
|
|
1005
|
+
/* @__PURE__ */ e(he, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(W, { children: i.map((r) => /* @__PURE__ */ g(l.Fragment, { children: [
|
|
1006
|
+
/* @__PURE__ */ e(Lt, { budget: r, onClick: a }),
|
|
979
1007
|
/* @__PURE__ */ e(re, {})
|
|
980
|
-
] },
|
|
1008
|
+
] }, r.guid)) }) })
|
|
981
1009
|
] });
|
|
982
|
-
}),
|
|
983
|
-
const t = ee(), { onEvent: o } = X(), { visibleAccounts: i } =
|
|
984
|
-
const
|
|
985
|
-
let x =
|
|
1010
|
+
}), Nt = E(() => {
|
|
1011
|
+
const t = ee(), { onEvent: o } = X(), { visibleAccounts: i } = ve(), { budgets: s, common: a, recurring: r } = w(), { incomeCategories: n, spendCategories: c } = K(), { detailedBudgets: d, totalBudgeted: m } = D(), { incomeTotal: u } = te(), { setFilter: f } = ae(), [h, b] = l.useState(!1), [p, _] = l.useMemo(() => {
|
|
1012
|
+
const A = c.reduce((I, k) => I + k.totalAmount, 0);
|
|
1013
|
+
let x = A / m;
|
|
986
1014
|
x > 1 && (x = 1);
|
|
987
|
-
let
|
|
988
|
-
x > 0.8 && x < 1 ?
|
|
1015
|
+
let R = t.palette.success.main;
|
|
1016
|
+
x > 0.8 && x < 1 ? R = t.palette.warning.main : x >= 1 && (R = t.palette.error.main);
|
|
989
1017
|
const M = [
|
|
990
1018
|
{
|
|
991
|
-
color:
|
|
1019
|
+
color: R,
|
|
992
1020
|
percentage: `${x}`
|
|
993
1021
|
}
|
|
994
1022
|
];
|
|
995
|
-
return [
|
|
996
|
-
}, [d,
|
|
997
|
-
const
|
|
998
|
-
|
|
1023
|
+
return [A, M];
|
|
1024
|
+
}, [d, c]), [S, C] = l.useMemo(() => {
|
|
1025
|
+
const A = Math.abs(
|
|
1026
|
+
n.reduce((M, I) => M + I.totalAmount, 0)
|
|
999
1027
|
);
|
|
1000
|
-
let x =
|
|
1028
|
+
let x = A / u;
|
|
1001
1029
|
x > 1 && (x = 1);
|
|
1002
|
-
const
|
|
1030
|
+
const R = [
|
|
1003
1031
|
{
|
|
1004
1032
|
color: t.palette.secondary.main,
|
|
1005
1033
|
percentage: `${x}`
|
|
1006
1034
|
}
|
|
1007
1035
|
];
|
|
1008
|
-
return [
|
|
1009
|
-
}, [
|
|
1010
|
-
|
|
1011
|
-
accounts: i.map((
|
|
1036
|
+
return [A, R];
|
|
1037
|
+
}, [n, u]), v = () => {
|
|
1038
|
+
f({
|
|
1039
|
+
accounts: i.map((A) => A.guid),
|
|
1012
1040
|
dateRange: {
|
|
1013
|
-
start:
|
|
1041
|
+
start: at(/* @__PURE__ */ new Date(), 90),
|
|
1014
1042
|
end: /* @__PURE__ */ new Date()
|
|
1015
1043
|
}
|
|
1016
|
-
}),
|
|
1044
|
+
}), b(!0), o(N.BUDGETS_CLICK_EDIT_INCOME);
|
|
1017
1045
|
};
|
|
1018
|
-
return /* @__PURE__ */ g(
|
|
1019
|
-
/* @__PURE__ */ e(
|
|
1020
|
-
/* @__PURE__ */ e(
|
|
1046
|
+
return /* @__PURE__ */ g(pe, { elevation: 2, sx: { overflow: "visible" }, children: [
|
|
1047
|
+
/* @__PURE__ */ e(Oe, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(xe, { children: s.overview_title }) }),
|
|
1048
|
+
/* @__PURE__ */ e(he, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ g(B, { gap: 24, children: [
|
|
1021
1049
|
/* @__PURE__ */ g(B, { gap: 8, children: [
|
|
1022
|
-
/* @__PURE__ */ e(
|
|
1023
|
-
/* @__PURE__ */ e(
|
|
1024
|
-
/* @__PURE__ */ e(
|
|
1050
|
+
/* @__PURE__ */ e(y, { bold: !0, sx: { mb: 8 }, variant: "Body", children: s.spending_title }),
|
|
1051
|
+
/* @__PURE__ */ e(me, { data: _, height: 16 }),
|
|
1052
|
+
/* @__PURE__ */ e(y, { variant: "Small", children: L(
|
|
1025
1053
|
s.spending_description,
|
|
1026
|
-
T(
|
|
1054
|
+
T(p, "0,0"),
|
|
1027
1055
|
T(m, "0,0")
|
|
1028
1056
|
) })
|
|
1029
1057
|
] }),
|
|
1030
1058
|
/* @__PURE__ */ g(B, { gap: 8, children: [
|
|
1031
1059
|
/* @__PURE__ */ g(B, { alignItems: "center", direction: "row", gap: 4, mb: -4, children: [
|
|
1032
|
-
/* @__PURE__ */ e(
|
|
1060
|
+
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: s.income_title }),
|
|
1033
1061
|
/* @__PURE__ */ e(
|
|
1034
|
-
|
|
1062
|
+
rt,
|
|
1035
1063
|
{
|
|
1036
|
-
"aria-label":
|
|
1037
|
-
onClick:
|
|
1064
|
+
"aria-label": r.manage_income,
|
|
1065
|
+
onClick: v,
|
|
1038
1066
|
sx: { p: 0 },
|
|
1039
1067
|
children: /* @__PURE__ */ e(P, { color: "primary", name: "edit" })
|
|
1040
1068
|
}
|
|
1041
1069
|
)
|
|
1042
1070
|
] }),
|
|
1043
|
-
/* @__PURE__ */ e(
|
|
1044
|
-
/* @__PURE__ */ e(
|
|
1071
|
+
/* @__PURE__ */ e(me, { data: C, height: 16 }),
|
|
1072
|
+
/* @__PURE__ */ e(y, { variant: "Small", children: L(
|
|
1045
1073
|
s.income_description,
|
|
1046
|
-
T(
|
|
1074
|
+
T(S, "0,0"),
|
|
1047
1075
|
T(u, "0,0")
|
|
1048
1076
|
) })
|
|
1049
1077
|
] })
|
|
1050
1078
|
] }) }),
|
|
1051
1079
|
/* @__PURE__ */ e(
|
|
1052
|
-
|
|
1080
|
+
$,
|
|
1053
1081
|
{
|
|
1054
1082
|
ariaLabelClose: a.close_aria,
|
|
1055
1083
|
isOpen: h,
|
|
1056
|
-
onClose: () =>
|
|
1057
|
-
title:
|
|
1058
|
-
children: /* @__PURE__ */ e(
|
|
1084
|
+
onClose: () => b(!1),
|
|
1085
|
+
title: r.manage_income,
|
|
1086
|
+
children: /* @__PURE__ */ e(st, { forOverview: !0 })
|
|
1059
1087
|
}
|
|
1060
1088
|
)
|
|
1061
1089
|
] });
|
|
1062
|
-
}),
|
|
1063
|
-
const i = ee(), { onEvent: s } = X(), {
|
|
1064
|
-
alert:
|
|
1065
|
-
dateRange:
|
|
1066
|
-
isDataLoaded:
|
|
1067
|
-
loadBudgetData:
|
|
1068
|
-
setDateRange:
|
|
1069
|
-
setAlert:
|
|
1070
|
-
setTheme:
|
|
1071
|
-
detailedBudgets:
|
|
1072
|
-
} = D(), { setDateRange:
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1090
|
+
}), Se = 480, kn = E(({ onBackClick: t, sx: o }) => {
|
|
1091
|
+
const i = ee(), { onEvent: s } = X(), { visibleAccounts: a } = ve(), { budgets: r, common: n } = w(), { isInitialized: c, selectedAccounts: d, setDisplayedDate: m } = oe(), {
|
|
1092
|
+
alert: u,
|
|
1093
|
+
dateRange: f,
|
|
1094
|
+
isDataLoaded: h,
|
|
1095
|
+
loadBudgetData: b,
|
|
1096
|
+
setDateRange: p,
|
|
1097
|
+
setAlert: _,
|
|
1098
|
+
setTheme: S,
|
|
1099
|
+
detailedBudgets: C
|
|
1100
|
+
} = D(), { setDateRange: v } = te(), { loadDateRangeCategoryTotals: A } = K(), { isSmallTablet: x, isMobile: R, isSmallMobile: M } = ie(), I = x || R || M, [k, G] = l.useState(!1);
|
|
1101
|
+
Te({
|
|
1102
|
+
widgetName: "BubbleBudgetsWidget",
|
|
1103
|
+
isLoaded: h
|
|
1104
|
+
}), l.useEffect(() => {
|
|
1105
|
+
S(i), h || b().finally(() => {
|
|
1106
|
+
s(N.BUDGETS_VIEW);
|
|
1076
1107
|
});
|
|
1077
|
-
}, []),
|
|
1078
|
-
|
|
1079
|
-
}), [
|
|
1080
|
-
|
|
1081
|
-
}, [
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
}, Ne = () => {
|
|
1085
|
-
s(k.BUDGETS_CLICK_FILTER);
|
|
1086
|
-
}, _e = () => {
|
|
1087
|
-
le(!0), s(k.BUDGETS_CLICK_ADD);
|
|
1108
|
+
}, []), l.useEffect(() => (p({ start: J(q()), end: ue(q()) }), () => {
|
|
1109
|
+
p({ start: J(q()), end: ue(q()) });
|
|
1110
|
+
}), [a]), l.useEffect(() => {
|
|
1111
|
+
c && (m(f.start, f.end), A(d, f.start, f.end).finally(), v(f));
|
|
1112
|
+
}, [c, d, f]);
|
|
1113
|
+
const U = (be) => {
|
|
1114
|
+
p({ start: be[0] || /* @__PURE__ */ new Date(), end: be[1] || /* @__PURE__ */ new Date() });
|
|
1088
1115
|
}, $e = () => {
|
|
1089
|
-
|
|
1090
|
-
},
|
|
1091
|
-
|
|
1092
|
-
|
|
1116
|
+
s(N.BUDGETS_CLICK_FILTER);
|
|
1117
|
+
}, fe = () => {
|
|
1118
|
+
G(!0), s(N.BUDGETS_CLICK_ADD);
|
|
1119
|
+
}, Pe = () => {
|
|
1120
|
+
G(!1);
|
|
1121
|
+
}, Ge = () => {
|
|
1122
|
+
G(!1);
|
|
1123
|
+
}, je = Je(f.end, J(/* @__PURE__ */ new Date()));
|
|
1124
|
+
return !c || !h ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ g(
|
|
1125
|
+
Ye,
|
|
1093
1126
|
{
|
|
1094
|
-
accountOptions: n,
|
|
1095
1127
|
actions: [
|
|
1096
1128
|
{
|
|
1097
1129
|
iconName: "add",
|
|
1098
1130
|
label: r.add_title,
|
|
1099
|
-
onClick:
|
|
1131
|
+
onClick: fe
|
|
1100
1132
|
}
|
|
1101
1133
|
],
|
|
1102
1134
|
calendarActions: {
|
|
1103
|
-
onRangeChanged:
|
|
1104
|
-
shouldDisableNext:
|
|
1135
|
+
onRangeChanged: U,
|
|
1136
|
+
shouldDisableNext: je,
|
|
1105
1137
|
shouldDisablePicker: !0
|
|
1106
1138
|
},
|
|
1107
|
-
onAccountsFilterClick:
|
|
1139
|
+
onAccountsFilterClick: $e,
|
|
1108
1140
|
onBackClick: t,
|
|
1109
1141
|
sx: o,
|
|
1110
1142
|
title: r.budgets_title,
|
|
@@ -1112,66 +1144,73 @@ const vt = ({
|
|
|
1112
1144
|
/* @__PURE__ */ g(
|
|
1113
1145
|
B,
|
|
1114
1146
|
{
|
|
1115
|
-
direction:
|
|
1147
|
+
direction: I ? "column" : "row",
|
|
1116
1148
|
height: "100%",
|
|
1117
1149
|
sx: { justifyContent: "center" },
|
|
1118
1150
|
width: "100%",
|
|
1119
1151
|
children: [
|
|
1120
|
-
/* @__PURE__ */ e(B, { height:
|
|
1121
|
-
|
|
1152
|
+
/* @__PURE__ */ e(B, { height: I ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
|
|
1153
|
+
ke,
|
|
1122
1154
|
{
|
|
1123
|
-
createBudgetOnClick:
|
|
1124
|
-
height:
|
|
1155
|
+
createBudgetOnClick: fe,
|
|
1156
|
+
height: I ? 450 : 800,
|
|
1125
1157
|
isDraggable: !0,
|
|
1126
|
-
shouldShowZeroState:
|
|
1127
|
-
unavailableWidth:
|
|
1158
|
+
shouldShowZeroState: C.length === 0,
|
|
1159
|
+
unavailableWidth: I ? 0 : Se
|
|
1128
1160
|
}
|
|
1129
1161
|
) }),
|
|
1130
|
-
|
|
1162
|
+
C.length !== 0 && /* @__PURE__ */ g(
|
|
1131
1163
|
B,
|
|
1132
1164
|
{
|
|
1133
1165
|
gap: 24,
|
|
1134
1166
|
height: "100%",
|
|
1135
1167
|
sx: { mr: 24, mt: 48 },
|
|
1136
|
-
width:
|
|
1168
|
+
width: I ? "100%" : Se,
|
|
1137
1169
|
children: [
|
|
1138
|
-
/* @__PURE__ */ e(
|
|
1139
|
-
/* @__PURE__ */ e(
|
|
1170
|
+
/* @__PURE__ */ e(Nt, {}),
|
|
1171
|
+
/* @__PURE__ */ e(kt, {})
|
|
1140
1172
|
]
|
|
1141
1173
|
}
|
|
1142
1174
|
)
|
|
1143
1175
|
]
|
|
1144
1176
|
}
|
|
1145
1177
|
),
|
|
1146
|
-
/* @__PURE__ */ e(
|
|
1178
|
+
/* @__PURE__ */ e(Mt, {}),
|
|
1147
1179
|
/* @__PURE__ */ e(
|
|
1148
|
-
|
|
1180
|
+
$,
|
|
1149
1181
|
{
|
|
1150
|
-
ariaLabelClose:
|
|
1151
|
-
isOpen:
|
|
1152
|
-
onClose: () =>
|
|
1182
|
+
ariaLabelClose: n.close_aria,
|
|
1183
|
+
isOpen: k,
|
|
1184
|
+
onClose: () => G(!1),
|
|
1153
1185
|
title: r.add_new_title,
|
|
1154
|
-
children: /* @__PURE__ */ e(
|
|
1186
|
+
children: /* @__PURE__ */ e(
|
|
1187
|
+
Re,
|
|
1188
|
+
{
|
|
1189
|
+
onAddBudget: Pe,
|
|
1190
|
+
onRecalculateBudgets: Ge
|
|
1191
|
+
}
|
|
1192
|
+
)
|
|
1155
1193
|
}
|
|
1156
1194
|
),
|
|
1157
1195
|
/* @__PURE__ */ e(
|
|
1158
|
-
|
|
1196
|
+
De,
|
|
1159
1197
|
{
|
|
1160
1198
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1161
1199
|
autoHideDuration: 3500,
|
|
1162
1200
|
onClose: () => {
|
|
1163
|
-
|
|
1201
|
+
_("");
|
|
1164
1202
|
},
|
|
1165
|
-
open: !!
|
|
1203
|
+
open: !!u,
|
|
1166
1204
|
children: /* @__PURE__ */ e(
|
|
1167
|
-
|
|
1205
|
+
we,
|
|
1168
1206
|
{
|
|
1207
|
+
closeText: "",
|
|
1169
1208
|
onClose: () => {
|
|
1170
|
-
|
|
1209
|
+
_("");
|
|
1171
1210
|
},
|
|
1172
1211
|
severity: "success",
|
|
1173
1212
|
variant: "filled",
|
|
1174
|
-
children:
|
|
1213
|
+
children: u
|
|
1175
1214
|
}
|
|
1176
1215
|
)
|
|
1177
1216
|
}
|
|
@@ -1181,6 +1220,6 @@ const vt = ({
|
|
|
1181
1220
|
);
|
|
1182
1221
|
});
|
|
1183
1222
|
export {
|
|
1184
|
-
|
|
1185
|
-
|
|
1223
|
+
Ln as BubbleBudgetsMiniWidget,
|
|
1224
|
+
kn as BubbleBudgetsWidget
|
|
1186
1225
|
};
|