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