@mx-cartographer/experiences 7.11.20 → 7.11.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{AccountDetailsHeader-DCTCLB3K.mjs → AccountDetailsHeader-DkBNsLsI.mjs} +2 -2
- package/dist/{AccountListItem-CZk-bo6j.mjs → AccountListItem-BIVhda6q.mjs} +2 -2
- package/dist/{AccountStore-Cw54qb7Y.mjs → AccountStore-Brc0MNSF.mjs} +1 -1
- package/dist/BudgetUtil--_QXyszn.mjs +479 -0
- package/dist/{CategorySelectorDrawer-Blb22HWt.mjs → CategorySelectorDrawer-5n6Pil_E.mjs} +1 -1
- package/dist/{Connect-Df7iVTcV.mjs → Connect-eYIWqCEr.mjs} +1 -1
- package/dist/{ConnectDrawer-CVt-8rPJ.mjs → ConnectDrawer-CioFo6Wy.mjs} +2 -2
- package/dist/{ConnectionsDrawer-c7HaKeRj.mjs → ConnectionsDrawer-DqhSaMrJ.mjs} +2 -2
- package/dist/{CurrencyInput-bcKNJ22c.mjs → CurrencyInput-DuMktPu3.mjs} +1 -1
- package/dist/{ExportCsvAction-B5Mn5uyb.mjs → ExportCsvAction-Bg6gO_Cz.mjs} +3 -3
- package/dist/{GlobalAccountFilter-CbwySv6c.mjs → GlobalAccountFilter-B73Pw1hJ.mjs} +1 -1
- package/dist/{GoalStore-DXIP9dLt.mjs → GoalStore-0bd-Upkc.mjs} +1 -1
- package/dist/{Help-COWDMsJq.mjs → Help-CINT6-wG.mjs} +1 -1
- package/dist/{LineChart-DVn1AamK.mjs → LineChart-B1qbKR8q.mjs} +1 -1
- package/dist/{ListItemAction-5YhgdUZW.mjs → ListItemAction-CfXGuY7a.mjs} +1 -1
- package/dist/{ManageIncome-_ZP3uPwX.mjs → ManageIncome-C0ddaiMR.mjs} +10 -10
- package/dist/{MicroWidgetContainer-CMES42I1.mjs → MicroWidgetContainer-B_EnfvCq.mjs} +1 -1
- package/dist/{MiniWidgetContainer-DhEx4qKi.mjs → MiniWidgetContainer-Cu72GNsE.mjs} +1 -1
- package/dist/{NotificationSettings-D8uSK6m9.mjs → NotificationSettings-DCbMa5mg.mjs} +4 -4
- package/dist/{OriginalBalanceAction-DuVHcBdO.mjs → OriginalBalanceAction-CW_xOa6Z.mjs} +3 -3
- package/dist/{RecurringSettings-CSrJUzaC.mjs → RecurringSettings-CD1_vCES.mjs} +2 -2
- package/dist/{SpendingLegend-Cpd_jtoX.mjs → SpendingLegend-DHi0vx8B.mjs} +1 -1
- package/dist/StatusIndicator-wyBzyHJc.mjs +252 -0
- package/dist/{Transaction-BR682Yj5.mjs → Transaction-B_2AG36b.mjs} +1 -1
- package/dist/TransactionDetails-CgC3Qu7o.mjs +1474 -0
- package/dist/{TransactionStore-BbjZQa-N.mjs → TransactionStore-DIbZkSVI.mjs} +2 -2
- package/dist/{ViewMoreMicroCard-Bf1J0zYY.mjs → ViewMoreMicroCard-CLHlPWC-.mjs} +1 -1
- package/dist/{WidgetContainer-DSs6lJbr.mjs → WidgetContainer-BSCjBupR.mjs} +2 -2
- package/dist/accounts/index.es.js +13 -13
- package/dist/analytics/index.es.js +11 -11
- package/dist/budgets/api/BudgetsApi.d.ts +2 -0
- package/dist/budgets/components/MerchantBudgetDetailsDrawer.d.ts +17 -0
- package/dist/budgets/components/shared/BudgetDetailsTopSection.d.ts +13 -0
- package/dist/budgets/index.es.js +550 -609
- package/dist/budgets/store/BudgetsStore.d.ts +6 -0
- package/dist/budgets/utils/BudgetUtil.d.ts +5 -0
- package/dist/cashflow/index.es.js +8 -8
- package/dist/categories/index.es.js +1 -1
- package/dist/common/index.es.js +254 -224
- package/dist/common/types/localization/BudgetsCopy.d.ts +4 -0
- package/dist/dashboard/index.es.js +4 -4
- package/dist/debts/index.es.js +8 -8
- package/dist/{exportTransactionsToCSV-CKHt_UOp.mjs → exportTransactionsToCSV-EwhjfqsJ.mjs} +1 -1
- package/dist/finstrong/index.es.js +10 -10
- package/dist/goals/index.es.js +10 -10
- package/dist/help/index.es.js +4 -4
- package/dist/{hooks-zu7yblbi.mjs → hooks-BxkfR-Ff.mjs} +5 -5
- package/dist/insights/index.es.js +103 -104
- package/dist/investments/index.es.js +4 -4
- package/dist/merchants/index.es.js +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/index.es.js +6 -6
- package/dist/notifications/index.es.js +2 -2
- package/dist/recurringtransactions/index.es.js +9 -9
- package/dist/settings/index.es.js +7 -7
- package/dist/spending/index.es.js +8 -8
- package/dist/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.d.ts +5 -0
- package/dist/transactions/components/shared/transactiondetails/actions/index.d.ts +1 -0
- package/dist/transactions/index.es.js +16 -16
- package/dist/trends/index.es.js +12 -12
- package/dist/{useAccountDisplayName-CxYB0Wpw.mjs → useAccountDisplayName-DKwT1mWv.mjs} +1 -1
- package/dist/{useInsightsEnabled-CYLDtNYt.mjs → useInsightsEnabled-DL_oNyI0.mjs} +1 -1
- package/dist/{useWidgetLoadTimer-Bmgv_UeH.mjs → useWidgetLoadTimer-DgN1bTyu.mjs} +1 -1
- package/package.json +1 -1
- package/dist/BudgetUtil-QbRXtLKn.mjs +0 -101
- package/dist/StatusIndicator-0iX3Gnnu.mjs +0 -55
- package/dist/TransactionDetails-BEKQKH03.mjs +0 -1261
- package/dist/TransactionList-CXiLG0Ur.mjs +0 -204
- package/dist/User-BIgPTsU6.mjs +0 -372
package/dist/budgets/index.es.js
CHANGED
|
@@ -1,135 +1,130 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as e, Fragment as Ve } from "react/jsx-runtime";
|
|
2
2
|
import l from "react";
|
|
3
3
|
import { observer as w } from "mobx-react-lite";
|
|
4
|
-
import { endOfMonth as
|
|
5
|
-
import { isAfter as
|
|
6
|
-
import { startOfMonth as
|
|
7
|
-
import { startOfToday as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { Text as S, CategoryIcon as H, Icon as
|
|
15
|
-
import { u as D,
|
|
4
|
+
import { endOfMonth as Ce } from "date-fns/endOfMonth";
|
|
5
|
+
import { isAfter as Ke } from "date-fns/isAfter";
|
|
6
|
+
import { startOfMonth as re } from "date-fns/startOfMonth";
|
|
7
|
+
import { startOfToday as oe } from "date-fns/startOfToday";
|
|
8
|
+
import Se from "@mui/material/Alert";
|
|
9
|
+
import Ae from "@mui/material/Snackbar";
|
|
10
|
+
import v from "@mui/material/Stack";
|
|
11
|
+
import ie from "@mui/material/styles/useTheme";
|
|
12
|
+
import K from "@mui/material/Box";
|
|
13
|
+
import X from "@mui/material/List";
|
|
14
|
+
import { Text as S, CategoryIcon as H, Icon as j, H2 as Xe, H3 as Me } from "@mxenabled/mxui";
|
|
15
|
+
import { u as D, m as E, i as ce, l as Y, p as le, a as Le, g as Z, b as q, h as J, d as Ne } from "../hooks-BxkfR-Ff.mjs";
|
|
16
16
|
import { f as T } from "../NumberFormatting-QCaNwbjv.mjs";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { b as
|
|
17
|
+
import ke from "@mui/material/Button";
|
|
18
|
+
import de from "@mui/material/Divider";
|
|
19
|
+
import Q from "@mui/material/ListItem";
|
|
20
|
+
import ue from "@mui/material/ListItemAvatar";
|
|
21
|
+
import ee from "@mui/material/ListItemButton";
|
|
22
|
+
import te from "@mui/material/ListItemText";
|
|
23
|
+
import { b as N } from "../Localization-CPkpIwIx.mjs";
|
|
24
24
|
import { D as $ } from "../Drawer-DV4NTsFg.mjs";
|
|
25
|
-
import
|
|
26
|
-
import { C as
|
|
25
|
+
import Ye from "@mui/material/ListItemSecondaryAction";
|
|
26
|
+
import { C as Ze } from "../CurrencyInput-DuMktPu3.mjs";
|
|
27
27
|
import { D as U } from "../Dialog-DdCwLgrl.mjs";
|
|
28
|
-
import { C as
|
|
29
|
-
import * as
|
|
30
|
-
import
|
|
31
|
-
import { useTheme as
|
|
32
|
-
import { u as
|
|
33
|
-
import { L as
|
|
34
|
-
import { E as
|
|
28
|
+
import { C as qe } from "../ConnectionsDrawer-DqhSaMrJ.mjs";
|
|
29
|
+
import * as M from "d3";
|
|
30
|
+
import Je from "@mui/material/Tooltip";
|
|
31
|
+
import { useTheme as $e, alpha as Qe } from "@mui/material/styles";
|
|
32
|
+
import { u as me } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
33
|
+
import { L as ge } from "../Loader-D3rjKx72.mjs";
|
|
34
|
+
import { E as _e } from "../EmptyState-DHAkGsjk.mjs";
|
|
35
35
|
import { A as P } from "../Analytics-i5h6BxR1.mjs";
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import { e as
|
|
39
|
-
import { T as
|
|
40
|
-
import { T as
|
|
41
|
-
import
|
|
42
|
-
import
|
|
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
|
-
import { u as
|
|
51
|
-
import { W as
|
|
52
|
-
import { u as
|
|
53
|
-
import { M as
|
|
54
|
-
import {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
import { f as Ct } from "../DateFormats-BMpMrZpW.mjs";
|
|
60
|
-
const St = w(() => {
|
|
61
|
-
const { budgets: t } = D(), { totalBudgeted: n } = E(), { incomeTotal: i } = me(), s = i - n;
|
|
62
|
-
return /* @__PURE__ */ u(x, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
|
|
63
|
-
/* @__PURE__ */ u(x, { alignItems: "center", children: [
|
|
36
|
+
import De from "@mui/material/Tab";
|
|
37
|
+
import et from "@mui/material/Tabs";
|
|
38
|
+
import { e as tt } from "../exportTransactionsToCSV-EwhjfqsJ.mjs";
|
|
39
|
+
import { T as xe } from "../StatusIndicator-wyBzyHJc.mjs";
|
|
40
|
+
import { T as nt, c as ot } from "../TransactionDetails-CgC3Qu7o.mjs";
|
|
41
|
+
import ve from "@mui/material/Card";
|
|
42
|
+
import Te from "@mui/material/CardContent";
|
|
43
|
+
import { S as Be } from "../StatusBar-BK_uYHAB.mjs";
|
|
44
|
+
import { S as Pe } from "../SingleSegmentDonut-BgbLgwHi.mjs";
|
|
45
|
+
import { u as at, b as rt } from "../CategorySelectorDrawer-5n6Pil_E.mjs";
|
|
46
|
+
import Ge from "@mui/material/CardHeader";
|
|
47
|
+
import { subDays as st } from "date-fns/subDays";
|
|
48
|
+
import it from "@mui/material/IconButton";
|
|
49
|
+
import { M as ct } from "../ManageIncome-C0ddaiMR.mjs";
|
|
50
|
+
import { u as je } from "../useWidgetLoadTimer-DgN1bTyu.mjs";
|
|
51
|
+
import { W as lt } from "../WidgetContainer-BSCjBupR.mjs";
|
|
52
|
+
import { u as dt, g as ut, C as mt } from "../BudgetUtil--_QXyszn.mjs";
|
|
53
|
+
import { M as gt } from "../MiniWidgetContainer-Cu72GNsE.mjs";
|
|
54
|
+
import { b as Ee } from "../CategoryUtil-BVixr0d5.mjs";
|
|
55
|
+
const pt = w(() => {
|
|
56
|
+
const { budgets: t } = D(), { totalBudgeted: o } = E(), { incomeTotal: i } = ce(), s = i - o;
|
|
57
|
+
return /* @__PURE__ */ m(v, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
|
|
58
|
+
/* @__PURE__ */ m(v, { alignItems: "center", children: [
|
|
64
59
|
/* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: T(i, "0,0") }),
|
|
65
60
|
/* @__PURE__ */ e(S, { color: "secondary", variant: "Small", children: t.projected_income })
|
|
66
61
|
] }),
|
|
67
62
|
/* @__PURE__ */ e(S, { bold: !0, justifyContent: "center", variant: "Body", children: "-" }),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: T(
|
|
63
|
+
/* @__PURE__ */ m(v, { alignItems: "center", children: [
|
|
64
|
+
/* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: T(o, "0,0") }),
|
|
70
65
|
/* @__PURE__ */ e(S, { color: "secondary", variant: "Small", children: t.budgeted })
|
|
71
66
|
] }),
|
|
72
67
|
/* @__PURE__ */ e(S, { bold: !0, justifyContent: "center", variant: "Body", children: "=" }),
|
|
73
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ m(v, { alignItems: "center", children: [
|
|
74
69
|
/* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: T(s, "0,0") }),
|
|
75
70
|
/* @__PURE__ */ e(S, { color: "secondary", variant: "Small", children: t.remaining })
|
|
76
71
|
] })
|
|
77
72
|
] });
|
|
78
|
-
}),
|
|
73
|
+
}), ht = w(
|
|
79
74
|
({ category: t }) => {
|
|
80
|
-
const { budgets:
|
|
81
|
-
const a = i.find((c) => c.category_guid === t.guid), r = T(t.totalAverageAmount, "0,0"),
|
|
82
|
-
return `${r} - ${
|
|
83
|
-
}, [
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */ e(
|
|
86
|
-
/* @__PURE__ */ e(
|
|
87
|
-
/* @__PURE__ */ e(
|
|
75
|
+
const { budgets: o } = D(), { budgets: i } = E(), s = l.useMemo(() => {
|
|
76
|
+
const a = i.find((c) => c.category_guid === t.guid), r = T(t.totalAverageAmount, "0,0"), n = a ? N(o.recalculate_previous_budget, T(a.amount, "0,0")) : o.recalculate_new_budget;
|
|
77
|
+
return `${r} - ${n}`;
|
|
78
|
+
}, [o, i]);
|
|
79
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
80
|
+
/* @__PURE__ */ e(Q, { children: /* @__PURE__ */ m(ee, { children: [
|
|
81
|
+
/* @__PURE__ */ e(ue, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid, variant: "filled" }) }),
|
|
82
|
+
/* @__PURE__ */ e(te, { primary: t.name, secondary: s })
|
|
88
83
|
] }) }),
|
|
89
|
-
/* @__PURE__ */ e(
|
|
84
|
+
/* @__PURE__ */ e(de, {})
|
|
90
85
|
] }, t.guid);
|
|
91
86
|
}
|
|
92
|
-
),
|
|
93
|
-
const { budgets:
|
|
94
|
-
await a(g), c(!1), r(
|
|
87
|
+
), ft = ({ onRecalculateBudgets: t }) => {
|
|
88
|
+
const { budgets: o, common: i } = D(), { spendCategories: s } = Y(), { recalculateBudgets: a, setAlert: r } = E(), [n, c] = l.useState(!1), g = s.filter((u) => u.totalAverageAmount > 0), d = async () => {
|
|
89
|
+
await a(g), c(!1), r(o.alert_recalculated_budgets), t?.();
|
|
95
90
|
};
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */ e(
|
|
98
|
-
/* @__PURE__ */ e(S, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children:
|
|
91
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
92
|
+
/* @__PURE__ */ e(ke, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: o.recalculate_button }),
|
|
93
|
+
/* @__PURE__ */ e(S, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children: o.recalculate_help }),
|
|
99
94
|
/* @__PURE__ */ e(
|
|
100
95
|
$,
|
|
101
96
|
{
|
|
102
97
|
ariaLabelClose: i.close_aria,
|
|
103
|
-
isOpen:
|
|
98
|
+
isOpen: n,
|
|
104
99
|
onClose: () => c(!1),
|
|
105
100
|
onPrimaryAction: d,
|
|
106
|
-
title:
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */ e(S, { bold: !0, variant: "Body", children:
|
|
110
|
-
/* @__PURE__ */ e(S, { variant: "ParagraphSmall", children:
|
|
101
|
+
title: o.recalculate_title,
|
|
102
|
+
children: /* @__PURE__ */ m(v, { children: [
|
|
103
|
+
/* @__PURE__ */ m(v, { mx: 24, my: 16, children: [
|
|
104
|
+
/* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: o.recalculate_description_top }),
|
|
105
|
+
/* @__PURE__ */ e(S, { variant: "ParagraphSmall", children: o.recalculate_description_bottom })
|
|
111
106
|
] }),
|
|
112
|
-
/* @__PURE__ */ e(
|
|
107
|
+
/* @__PURE__ */ e(K, { bgcolor: "background.paper", children: /* @__PURE__ */ e(X, { children: g.map((u) => /* @__PURE__ */ e(ht, { category: u }, u.guid)) }) })
|
|
113
108
|
] })
|
|
114
109
|
}
|
|
115
110
|
)
|
|
116
111
|
] });
|
|
117
|
-
},
|
|
112
|
+
}, pe = ({
|
|
118
113
|
amount: t,
|
|
119
|
-
categoryName:
|
|
114
|
+
categoryName: o,
|
|
120
115
|
onAmountChanged: i
|
|
121
116
|
}) => {
|
|
122
|
-
const { budgets: s } = D(), { totalBudgeted: a } = E(), { incomeTotal: r } =
|
|
123
|
-
return /* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
/* @__PURE__ */ e(S, { children:
|
|
117
|
+
const { budgets: s } = D(), { totalBudgeted: a } = E(), { incomeTotal: r } = ce(), n = r - a;
|
|
118
|
+
return /* @__PURE__ */ m(v, { gap: 16, children: [
|
|
119
|
+
/* @__PURE__ */ m(v, { children: [
|
|
120
|
+
/* @__PURE__ */ e(S, { children: N(
|
|
126
121
|
s.add_description_top,
|
|
127
|
-
T(
|
|
122
|
+
T(n, "0,0")
|
|
128
123
|
) }),
|
|
129
|
-
/* @__PURE__ */ e(S, { children:
|
|
124
|
+
/* @__PURE__ */ e(S, { children: N(s.add_description_bottom, o) })
|
|
130
125
|
] }),
|
|
131
126
|
/* @__PURE__ */ e(
|
|
132
|
-
|
|
127
|
+
Ze,
|
|
133
128
|
{
|
|
134
129
|
amount: t,
|
|
135
130
|
autoFocus: !0,
|
|
@@ -140,136 +135,136 @@ const St = w(() => {
|
|
|
140
135
|
}
|
|
141
136
|
)
|
|
142
137
|
] });
|
|
143
|
-
},
|
|
144
|
-
const { budgets: i, common: s } = D(), [a, r] = l.useState(!1), [
|
|
138
|
+
}, yt = w(({ category: t, onAddBudget: o }) => {
|
|
139
|
+
const { budgets: i, common: s } = D(), [a, r] = l.useState(!1), [n, c] = l.useState(
|
|
145
140
|
`${t.totalAmount === 0 ? "" : t.totalAmount}`
|
|
146
141
|
);
|
|
147
|
-
return /* @__PURE__ */
|
|
148
|
-
/* @__PURE__ */ e(
|
|
149
|
-
/* @__PURE__ */ e(
|
|
142
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
143
|
+
/* @__PURE__ */ e(Q, { children: /* @__PURE__ */ m(ee, { onClick: () => r(!0), children: [
|
|
144
|
+
/* @__PURE__ */ e(ue, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid }) }),
|
|
150
145
|
/* @__PURE__ */ e(
|
|
151
|
-
|
|
146
|
+
te,
|
|
152
147
|
{
|
|
153
148
|
primary: t.name,
|
|
154
149
|
secondary: T(t.totalAmount, "0,0")
|
|
155
150
|
}
|
|
156
151
|
),
|
|
157
|
-
/* @__PURE__ */ e(
|
|
152
|
+
/* @__PURE__ */ e(Ye, { children: /* @__PURE__ */ e(j, { name: "add", size: 20 }) })
|
|
158
153
|
] }) }, t.guid),
|
|
159
154
|
/* @__PURE__ */ e(
|
|
160
155
|
U,
|
|
161
156
|
{
|
|
162
157
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
163
|
-
disablePrimaryButton: Number(
|
|
158
|
+
disablePrimaryButton: Number(n) <= 0,
|
|
164
159
|
isOpen: a,
|
|
165
160
|
onClose: () => r(!1),
|
|
166
|
-
onPrimaryAction: () =>
|
|
161
|
+
onPrimaryAction: () => o(t, Number(n)),
|
|
167
162
|
primaryText: i.add_save_button,
|
|
168
|
-
children: /* @__PURE__ */ e(
|
|
163
|
+
children: /* @__PURE__ */ e(pe, { amount: n, categoryName: t.name, onAmountChanged: c })
|
|
169
164
|
}
|
|
170
165
|
)
|
|
171
166
|
] });
|
|
172
|
-
}),
|
|
173
|
-
const { budgets: i } = D(), { addBudget: s, setAlert: a, unbudgetedCategories: r } = E(),
|
|
174
|
-
await s(c, g), t?.(), a(
|
|
167
|
+
}), ze = w(({ onAddBudget: t, onRecalculateBudgets: o }) => {
|
|
168
|
+
const { budgets: i } = D(), { addBudget: s, setAlert: a, unbudgetedCategories: r } = E(), n = async (c, g) => {
|
|
169
|
+
await s(c, g), t?.(), a(N(i.alert_budget_created, c.name));
|
|
175
170
|
};
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */ e(
|
|
178
|
-
/* @__PURE__ */ e(
|
|
179
|
-
|
|
171
|
+
return /* @__PURE__ */ m(v, { children: [
|
|
172
|
+
/* @__PURE__ */ e(pt, {}),
|
|
173
|
+
/* @__PURE__ */ e(K, { bgcolor: "background.paper", children: /* @__PURE__ */ e(X, { children: r.map((c) => /* @__PURE__ */ e(
|
|
174
|
+
yt,
|
|
180
175
|
{
|
|
181
176
|
category: c,
|
|
182
|
-
onAddBudget:
|
|
177
|
+
onAddBudget: n
|
|
183
178
|
},
|
|
184
179
|
c.guid
|
|
185
180
|
)) }) }),
|
|
186
|
-
/* @__PURE__ */ e(
|
|
181
|
+
/* @__PURE__ */ e(ft, { onRecalculateBudgets: o })
|
|
187
182
|
] });
|
|
188
|
-
}),
|
|
189
|
-
const
|
|
183
|
+
}), we = 5, Fe = 100, se = 25, _t = (t) => {
|
|
184
|
+
const o = (a) => {
|
|
190
185
|
a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
|
|
191
186
|
}, i = (a) => {
|
|
192
187
|
a.subject.fx = a.x, a.subject.fy = a.y;
|
|
193
188
|
}, s = (a) => {
|
|
194
189
|
a.active || t.alphaTarget(0), a.subject.fx = null, a.subject.fy = null;
|
|
195
190
|
};
|
|
196
|
-
return
|
|
197
|
-
},
|
|
198
|
-
let
|
|
199
|
-
|
|
200
|
-
const i =
|
|
191
|
+
return M.drag().on("start", o).on("drag", i).on("end", s);
|
|
192
|
+
}, bt = (t) => {
|
|
193
|
+
let o = t.transaction_total / t.amount;
|
|
194
|
+
o < 0 ? o = 0 : o > 1 && (o = 1);
|
|
195
|
+
const i = o * 2 * Math.PI, s = M.interpolate(0, i), a = M.arc().cornerRadius(5).innerRadius(t.radius - we * 2).outerRadius(t.radius - we).startAngle(0).endAngle(0);
|
|
201
196
|
return (r) => (a.endAngle(s(r)), a(t) || "");
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
},
|
|
197
|
+
}, Ct = (t) => {
|
|
198
|
+
M.selectAll(".bubble").call(_t(t));
|
|
199
|
+
}, Ie = (t, o, i) => Math.min(Math.max(t, o), i), Bt = (t, o, i) => {
|
|
205
200
|
t.alpha(1).restart().force(
|
|
206
201
|
"x",
|
|
207
|
-
|
|
202
|
+
M.forceX().x(i / 2).strength(0.01)
|
|
208
203
|
).force(
|
|
209
204
|
"y",
|
|
210
|
-
|
|
205
|
+
M.forceY().y(o / 2).strength(0.02)
|
|
211
206
|
).on("tick", () => {
|
|
212
207
|
const s = t.nodes();
|
|
213
208
|
s.forEach((a) => {
|
|
214
|
-
const r = a.radius ??
|
|
215
|
-
a.x =
|
|
216
|
-
}),
|
|
209
|
+
const r = a.radius ?? se;
|
|
210
|
+
a.x = Ie(a.x ?? 0, r, i - r), a.y = Ie(a.y ?? 0, r, o - r);
|
|
211
|
+
}), M.selectAll(".bubble").data(s).attr("transform", (a) => `translate(${a.x},${a.y})`);
|
|
217
212
|
});
|
|
218
|
-
},
|
|
219
|
-
const
|
|
220
|
-
const c = Math.max(
|
|
213
|
+
}, Ue = (t, o) => M.scaleLinear().domain([t, o]).range([se, Fe]), St = (t) => {
|
|
214
|
+
const o = t.reduce((r, n) => {
|
|
215
|
+
const c = Math.max(n.transaction_total, n.amount);
|
|
221
216
|
return c > r ? c : r;
|
|
222
|
-
}, 0), i = t.reduce((r,
|
|
223
|
-
const c = Math.max(
|
|
217
|
+
}, 0), i = t.reduce((r, n) => {
|
|
218
|
+
const c = Math.max(n.transaction_total, n.amount);
|
|
224
219
|
return c < r ? c : r;
|
|
225
|
-
},
|
|
226
|
-
const
|
|
220
|
+
}, o), s = Ue(i, o), a = t.map((r) => {
|
|
221
|
+
const n = s(Math.max(r.transaction_total, r.amount)) || 25;
|
|
227
222
|
return {
|
|
228
223
|
...r,
|
|
229
|
-
radius:
|
|
224
|
+
radius: n
|
|
230
225
|
};
|
|
231
226
|
});
|
|
232
|
-
return
|
|
233
|
-
},
|
|
234
|
-
const a = Math.PI *
|
|
235
|
-
let
|
|
227
|
+
return M.forceSimulation(a).velocityDecay(0.05).force("collide", M.forceCollide((r) => r.radius + 2).strength(0.7));
|
|
228
|
+
}, At = (t, o, i) => {
|
|
229
|
+
const a = Math.PI * se ** 2 * t, r = i < 400 || o < 300, n = r ? 40 : 20, c = Math.max(100, i - n), g = Math.max(100, o - n), d = c * g;
|
|
230
|
+
let u = se;
|
|
236
231
|
if (a < d) {
|
|
237
|
-
const h = Math.sqrt(d / (t * Math.PI)),
|
|
238
|
-
|
|
232
|
+
const h = Math.sqrt(d / (t * Math.PI)), b = Math.min(c, g) / 4;
|
|
233
|
+
u = Math.min(Fe, h, b);
|
|
239
234
|
}
|
|
240
|
-
return r && t <= 3 && (
|
|
241
|
-
},
|
|
242
|
-
const { maxRadius: r, minRadius:
|
|
243
|
-
return
|
|
244
|
-
},
|
|
245
|
-
const r =
|
|
235
|
+
return r && t <= 3 && (u = Math.min(u, 45)), { minRadius: Math.max(20, u * 0.6), maxRadius: u };
|
|
236
|
+
}, xt = (t, o, i, s, a) => {
|
|
237
|
+
const { maxRadius: r, minRadius: n } = At(t, o, a);
|
|
238
|
+
return M.scaleLinear().domain([s, i]).range([n, r]);
|
|
239
|
+
}, vt = (t, o, i = !1, s, a) => {
|
|
240
|
+
const r = o.map((d) => Math.max(d.transaction_total, d.amount)), n = Math.min(...r), c = Math.max(...r), g = i ? xt(t.length, s, c, n, a) : Ue(n, c);
|
|
246
241
|
return t.map((d) => ({
|
|
247
242
|
...d,
|
|
248
243
|
radius: g(Math.max(d.transaction_total, d.amount))
|
|
249
244
|
}));
|
|
250
|
-
},
|
|
251
|
-
const
|
|
245
|
+
}, Oe = 5, Tt = 2e3, Dt = ({ bubble: t }) => {
|
|
246
|
+
const o = ie(), {
|
|
252
247
|
amount: i,
|
|
253
248
|
guid: s,
|
|
254
249
|
budgetColors: { mercury: a },
|
|
255
250
|
radius: r,
|
|
256
|
-
transaction_total:
|
|
251
|
+
transaction_total: n
|
|
257
252
|
} = t, c = `mercury-${s}`;
|
|
258
253
|
l.useEffect(() => {
|
|
259
|
-
|
|
260
|
-
}, [i, r,
|
|
261
|
-
const g =
|
|
254
|
+
M.select(`.${c}`).selectAll(".status").remove(), M.select(`.${c}`).append("path").transition().duration(Tt).delay(0).attr("class", "status").attr("style", `fill: ${a}; fill-opacity: 1;`).attrTween("d", () => bt(t));
|
|
255
|
+
}, [i, r, n]);
|
|
256
|
+
const g = M.arc().innerRadius((d) => d - 2 * Oe).outerRadius((d) => d - Oe).startAngle(0).endAngle(2 * Math.PI);
|
|
262
257
|
return /* @__PURE__ */ e("g", { className: c, children: /* @__PURE__ */ e(
|
|
263
258
|
"path",
|
|
264
259
|
{
|
|
265
260
|
d: g(r) || "",
|
|
266
|
-
style: { fill:
|
|
261
|
+
style: { fill: o.palette.common.white, fillOpacity: 0.35 }
|
|
267
262
|
}
|
|
268
263
|
) });
|
|
269
|
-
},
|
|
270
|
-
function
|
|
264
|
+
}, Et = l.memo(Dt), F = 75, be = 50;
|
|
265
|
+
function wt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
271
266
|
} }) {
|
|
272
|
-
const [s, a] = l.useState(!1), r =
|
|
267
|
+
const [s, a] = l.useState(!1), r = $e(), { availableWidth: n } = le(), c = l.useMemo(() => {
|
|
273
268
|
if (t)
|
|
274
269
|
return {
|
|
275
270
|
amount: t.amount,
|
|
@@ -282,18 +277,18 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
282
277
|
if (!t) return;
|
|
283
278
|
const {
|
|
284
279
|
budgetColors: { background: g, text: d },
|
|
285
|
-
category: { icon:
|
|
280
|
+
category: { icon: u, name: p },
|
|
286
281
|
guid: h,
|
|
287
|
-
description:
|
|
288
|
-
radius:
|
|
289
|
-
x:
|
|
290
|
-
y:
|
|
291
|
-
} = t, A =
|
|
282
|
+
description: b,
|
|
283
|
+
radius: y,
|
|
284
|
+
x: _,
|
|
285
|
+
y: x
|
|
286
|
+
} = t, A = n < 400 ? -8 : -12;
|
|
292
287
|
let C = A, f = A;
|
|
293
|
-
|
|
288
|
+
y > F ? (C = -14, f = -45) : y > be && (f = -32);
|
|
294
289
|
let B = 32;
|
|
295
|
-
|
|
296
|
-
const I = `${t.category.name}: ${
|
|
290
|
+
y <= F && (B = n < 400 ? 16 : 24);
|
|
291
|
+
const I = `${t.category.name}: ${b}`, L = {
|
|
297
292
|
modifiers: [
|
|
298
293
|
{
|
|
299
294
|
name: "offset",
|
|
@@ -304,27 +299,27 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
304
299
|
(k.key === "Enter" || k.key === " ") && (k.preventDefault(), i(t));
|
|
305
300
|
}, O = () => {
|
|
306
301
|
a(!0);
|
|
307
|
-
},
|
|
302
|
+
}, z = () => {
|
|
308
303
|
a(!1);
|
|
309
304
|
};
|
|
310
|
-
return /* @__PURE__ */
|
|
305
|
+
return /* @__PURE__ */ m(
|
|
311
306
|
"g",
|
|
312
307
|
{
|
|
313
|
-
"aria-label": `${p} - ${
|
|
308
|
+
"aria-label": `${p} - ${b}`,
|
|
314
309
|
className: "bubble",
|
|
315
310
|
id: `bubble-${h}`,
|
|
316
|
-
onBlur:
|
|
311
|
+
onBlur: z,
|
|
317
312
|
onClick: () => i(t),
|
|
318
313
|
onFocus: O,
|
|
319
314
|
onKeyDown: R,
|
|
320
315
|
onMouseEnter: () => a(!0),
|
|
321
316
|
onMouseLeave: () => a(!1),
|
|
322
317
|
role: "button",
|
|
323
|
-
style: { cursor:
|
|
318
|
+
style: { cursor: o ? "pointer" : "default" },
|
|
324
319
|
tabIndex: 0,
|
|
325
320
|
textAnchor: "middle",
|
|
326
|
-
x:
|
|
327
|
-
y:
|
|
321
|
+
x: _,
|
|
322
|
+
y: x,
|
|
328
323
|
children: [
|
|
329
324
|
/* @__PURE__ */ e("style", { children: `
|
|
330
325
|
.bubble:focus,
|
|
@@ -338,9 +333,9 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
338
333
|
stroke-opacity: 0.8;
|
|
339
334
|
}
|
|
340
335
|
` }),
|
|
341
|
-
/* @__PURE__ */ e(
|
|
342
|
-
/* @__PURE__ */ e("svg", { x: C, y: f, children: /* @__PURE__ */ e(
|
|
343
|
-
|
|
336
|
+
/* @__PURE__ */ e(Je, { open: s, slotProps: { popper: L }, title: I, children: /* @__PURE__ */ e("circle", { fill: g, id: `circle-${h}`, r: y }) }),
|
|
337
|
+
/* @__PURE__ */ e("svg", { x: C, y: f, children: /* @__PURE__ */ e(j, { name: u, size: B, sx: { fill: d } }) }),
|
|
338
|
+
y > F && /* @__PURE__ */ e(
|
|
344
339
|
S,
|
|
345
340
|
{
|
|
346
341
|
bold: !0,
|
|
@@ -352,7 +347,7 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
352
347
|
children: p
|
|
353
348
|
}
|
|
354
349
|
),
|
|
355
|
-
|
|
350
|
+
y > be && /* @__PURE__ */ e(
|
|
356
351
|
S,
|
|
357
352
|
{
|
|
358
353
|
bold: !0,
|
|
@@ -360,11 +355,11 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
360
355
|
id: `budget-description-${h}-1`,
|
|
361
356
|
sx: { fill: d },
|
|
362
357
|
variant: "Body",
|
|
363
|
-
y:
|
|
364
|
-
children:
|
|
358
|
+
y: y <= F ? 12 : 24,
|
|
359
|
+
children: y <= F ? b.split(" ")[0] : b
|
|
365
360
|
}
|
|
366
361
|
),
|
|
367
|
-
|
|
362
|
+
y <= F && y > be && /* @__PURE__ */ e(
|
|
368
363
|
S,
|
|
369
364
|
{
|
|
370
365
|
component: "text",
|
|
@@ -372,72 +367,72 @@ function kt({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
372
367
|
sx: { fill: d },
|
|
373
368
|
variant: "XSmall",
|
|
374
369
|
y: 28,
|
|
375
|
-
children:
|
|
370
|
+
children: b.split(" ")[1]
|
|
376
371
|
}
|
|
377
372
|
),
|
|
378
|
-
/* @__PURE__ */ e(
|
|
373
|
+
/* @__PURE__ */ e(Et, { bubble: c })
|
|
379
374
|
]
|
|
380
375
|
},
|
|
381
376
|
h
|
|
382
377
|
);
|
|
383
378
|
}
|
|
384
|
-
const
|
|
379
|
+
const It = ({
|
|
385
380
|
height: t,
|
|
386
|
-
width:
|
|
381
|
+
width: o,
|
|
387
382
|
isDraggable: i = !1,
|
|
388
383
|
onClick: s = () => {
|
|
389
384
|
}
|
|
390
385
|
}) => {
|
|
391
|
-
const [a, r] = l.useState([]),
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
const
|
|
395
|
-
h.forEach((
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
vx:
|
|
399
|
-
vy:
|
|
400
|
-
x:
|
|
401
|
-
y:
|
|
386
|
+
const [a, r] = l.useState([]), n = l.useRef(null), c = l.useRef(!1), { detailedBudgets: g } = E(), d = l.useCallback(() => {
|
|
387
|
+
const u = n.current, p = St(g), h = p.nodes();
|
|
388
|
+
if (u) {
|
|
389
|
+
const b = u.nodes(), y = new Map(b.map((_) => [_.guid, _]));
|
|
390
|
+
h.forEach((_) => {
|
|
391
|
+
const x = y.get(_.guid);
|
|
392
|
+
x && Object.assign(_, {
|
|
393
|
+
vx: x.vx,
|
|
394
|
+
vy: x.vy,
|
|
395
|
+
x: x.x,
|
|
396
|
+
y: x.y
|
|
402
397
|
});
|
|
403
398
|
});
|
|
404
399
|
}
|
|
405
|
-
|
|
400
|
+
n.current = p, c.current = !1, r(h);
|
|
406
401
|
}, [g]);
|
|
407
402
|
return l.useEffect(() => {
|
|
408
403
|
d();
|
|
409
404
|
}, [d]), l.useEffect(() => () => {
|
|
410
|
-
|
|
405
|
+
n.current && (n.current.stop(), n.current = null);
|
|
411
406
|
}, []), l.useEffect(() => {
|
|
412
|
-
const
|
|
413
|
-
if (!
|
|
414
|
-
const p =
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
}, 0), r([...
|
|
418
|
-
}, [t,
|
|
419
|
-
},
|
|
407
|
+
const u = n.current;
|
|
408
|
+
if (!u) return;
|
|
409
|
+
const p = u.nodes(), h = o > 0 && o < 450 || t > 0 && t < 300, b = vt(p, g, h, t, o);
|
|
410
|
+
u.nodes(b), Bt(u, t, o), i && setTimeout(() => {
|
|
411
|
+
Ct(u);
|
|
412
|
+
}, 0), r([...b]);
|
|
413
|
+
}, [t, o, i, g]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(o), children: a.map((u) => /* @__PURE__ */ e(wt, { bubble: u, isDraggable: i, onClick: s }, u.guid)) });
|
|
414
|
+
}, Ot = w(It), Rt = ({
|
|
420
415
|
isMiniWidget: t = !1,
|
|
421
|
-
onConnectAccountsClick:
|
|
416
|
+
onConnectAccountsClick: o,
|
|
422
417
|
createBudgetOnClick: i
|
|
423
418
|
}) => {
|
|
424
|
-
const { config: s } =
|
|
425
|
-
|
|
426
|
-
const { data: C, isSuccess: f } = await a(
|
|
427
|
-
|
|
419
|
+
const { config: s } = Le(), { recalculateBudgets: a } = E(), { spendCategories: r } = Y(), { budgets: n } = D(), { availableWidth: c } = le(), { isMobile: g } = me(c), d = t && g, [u, p] = l.useState(!1), [h, b] = l.useState(!1), [y, _] = l.useState(!1), x = l.useMemo(() => [...r.filter((C) => C.totalAverageAmount > 0)], [r]), A = async () => {
|
|
420
|
+
_(!0);
|
|
421
|
+
const { data: C, isSuccess: f } = await a(x);
|
|
422
|
+
_(!1), f ? (C.length === 0 && b(!0), p(!1)) : p(!0);
|
|
428
423
|
};
|
|
429
|
-
return
|
|
430
|
-
|
|
424
|
+
return y ? /* @__PURE__ */ e(ge, {}) : u ? /* @__PURE__ */ e(
|
|
425
|
+
_e,
|
|
431
426
|
{
|
|
432
|
-
header:
|
|
427
|
+
header: n.autogenerate_budgets_error_header,
|
|
433
428
|
icon: "error",
|
|
434
429
|
iconColor: "#4D4D4D",
|
|
435
430
|
onClick: (C) => {
|
|
436
431
|
C === "primary" ? A() : i();
|
|
437
432
|
},
|
|
438
|
-
primaryButton:
|
|
439
|
-
secondaryButton:
|
|
440
|
-
subText:
|
|
433
|
+
primaryButton: n.autogenerate_budgets_error_primary_button,
|
|
434
|
+
secondaryButton: n.zero_state_generate_budgets_secondary_button,
|
|
435
|
+
subText: n.autogenerate_budgets_error_subheader,
|
|
441
436
|
sx: {
|
|
442
437
|
width: { sm: 468 },
|
|
443
438
|
".buttons-footer": {
|
|
@@ -447,18 +442,18 @@ const $t = ({
|
|
|
447
442
|
...d && { justifyContent: "center", mt: 0, svg: { height: 32, width: 32 } }
|
|
448
443
|
}
|
|
449
444
|
}
|
|
450
|
-
) : /* @__PURE__ */ e(
|
|
451
|
-
|
|
445
|
+
) : /* @__PURE__ */ e(Ve, { children: h ? /* @__PURE__ */ e(
|
|
446
|
+
_e,
|
|
452
447
|
{
|
|
453
|
-
header:
|
|
448
|
+
header: n.zero_state_generate_budgets_header,
|
|
454
449
|
icon: "error",
|
|
455
450
|
iconColor: "#4D4D4D",
|
|
456
451
|
onClick: (C) => {
|
|
457
|
-
C === "primary" ?
|
|
452
|
+
C === "primary" ? o() : i();
|
|
458
453
|
},
|
|
459
|
-
primaryButton: s.show_connections_widget_in_master ?
|
|
460
|
-
secondaryButton:
|
|
461
|
-
subText:
|
|
454
|
+
primaryButton: s.show_connections_widget_in_master ? n.zero_state_generate_budgets_primary_button : void 0,
|
|
455
|
+
secondaryButton: n.zero_state_generate_budgets_secondary_button,
|
|
456
|
+
subText: n.zero_state_generate_budgets_subheader,
|
|
462
457
|
sx: {
|
|
463
458
|
width: t ? "100%" : { sm: 500 },
|
|
464
459
|
height: t ? "100%" : { sm: 468 },
|
|
@@ -473,17 +468,17 @@ const $t = ({
|
|
|
473
468
|
}
|
|
474
469
|
}
|
|
475
470
|
) : /* @__PURE__ */ e(
|
|
476
|
-
|
|
471
|
+
_e,
|
|
477
472
|
{
|
|
478
|
-
header:
|
|
473
|
+
header: n.create_budgets_title,
|
|
479
474
|
icon: "bubble_chart",
|
|
480
475
|
iconColor: "#1A1A1A",
|
|
481
476
|
onClick: (C) => {
|
|
482
477
|
C === "primary" ? A() : i();
|
|
483
478
|
},
|
|
484
|
-
primaryButton:
|
|
485
|
-
secondaryButton: t ? void 0 :
|
|
486
|
-
subText:
|
|
479
|
+
primaryButton: n.empty_state_primary_button,
|
|
480
|
+
secondaryButton: t ? void 0 : n.empty_state_secondary_button,
|
|
481
|
+
subText: n.empty_state_subheader,
|
|
487
482
|
sx: {
|
|
488
483
|
width: t ? "100%" : { sm: 432 },
|
|
489
484
|
height: t ? "100%" : { sm: 468 },
|
|
@@ -498,50 +493,50 @@ const $t = ({
|
|
|
498
493
|
}
|
|
499
494
|
}
|
|
500
495
|
) });
|
|
501
|
-
},
|
|
496
|
+
}, He = w(
|
|
502
497
|
({
|
|
503
498
|
createBudgetOnClick: t = () => {
|
|
504
499
|
},
|
|
505
|
-
height:
|
|
500
|
+
height: o,
|
|
506
501
|
isDraggable: i = !1,
|
|
507
502
|
isMiniWidget: s = !1,
|
|
508
503
|
shouldShowZeroState: a,
|
|
509
504
|
unavailableWidth: r = 24
|
|
510
505
|
}) => {
|
|
511
|
-
const { onEvent:
|
|
512
|
-
c(A),
|
|
506
|
+
const { onEvent: n } = Z(), { setSelectedBudget: c } = E(), { isInitialized: g } = q(), { accounts: d } = D(), { availableWidth: u } = le(), { isMobile: p } = me(), [h, b] = l.useState(!1), y = l.useMemo(() => u - r, [u]), _ = (A) => {
|
|
507
|
+
c(A), n(P.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
513
508
|
budget_category: A.category.name,
|
|
514
509
|
click_type: "bubble"
|
|
515
510
|
});
|
|
516
|
-
},
|
|
517
|
-
|
|
511
|
+
}, x = () => {
|
|
512
|
+
b(!0), n(P.ACCOUNTS_CLICK_CONNECT);
|
|
518
513
|
};
|
|
519
|
-
return /* @__PURE__ */
|
|
520
|
-
|
|
514
|
+
return /* @__PURE__ */ m(
|
|
515
|
+
K,
|
|
521
516
|
{
|
|
522
517
|
ml: a || p ? 0 : 24,
|
|
523
518
|
sx: { alignSelf: "center", ...s && { height: "100%" } },
|
|
524
519
|
children: [
|
|
525
520
|
a || !g ? /* @__PURE__ */ e(
|
|
526
|
-
|
|
521
|
+
Rt,
|
|
527
522
|
{
|
|
528
523
|
createBudgetOnClick: t,
|
|
529
524
|
isMiniWidget: s,
|
|
530
|
-
onConnectAccountsClick:
|
|
525
|
+
onConnectAccountsClick: x
|
|
531
526
|
}
|
|
532
527
|
) : /* @__PURE__ */ e(
|
|
533
|
-
|
|
528
|
+
Ot,
|
|
534
529
|
{
|
|
535
|
-
height:
|
|
530
|
+
height: o,
|
|
536
531
|
isDraggable: i,
|
|
537
|
-
onClick:
|
|
538
|
-
width:
|
|
532
|
+
onClick: _,
|
|
533
|
+
width: y
|
|
539
534
|
}
|
|
540
535
|
),
|
|
541
536
|
/* @__PURE__ */ e(
|
|
542
|
-
|
|
537
|
+
qe,
|
|
543
538
|
{
|
|
544
|
-
onClose: () =>
|
|
539
|
+
onClose: () => b(!1),
|
|
545
540
|
showConnectionsWidget: h,
|
|
546
541
|
title: d.manage_connections
|
|
547
542
|
}
|
|
@@ -550,76 +545,76 @@ const $t = ({
|
|
|
550
545
|
}
|
|
551
546
|
);
|
|
552
547
|
}
|
|
553
|
-
),
|
|
548
|
+
), We = ({ budget: t }) => {
|
|
554
549
|
const {
|
|
555
|
-
amount:
|
|
550
|
+
amount: o,
|
|
556
551
|
budgetColors: { background: i },
|
|
557
552
|
category: { name: s },
|
|
558
553
|
category_guid: a,
|
|
559
554
|
percentage: r,
|
|
560
|
-
transaction_total:
|
|
555
|
+
transaction_total: n
|
|
561
556
|
} = t, c = [
|
|
562
557
|
{
|
|
563
558
|
color: i,
|
|
564
559
|
percentage: `${r}%`
|
|
565
560
|
}
|
|
566
561
|
];
|
|
567
|
-
return /* @__PURE__ */ e(
|
|
562
|
+
return /* @__PURE__ */ e(ve, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ m(v, { alignItems: "center", gap: 16, children: [
|
|
568
563
|
/* @__PURE__ */ e(H, { categoryGuid: a, size: 56 }),
|
|
569
|
-
/* @__PURE__ */ e(
|
|
564
|
+
/* @__PURE__ */ e(Xe, { variant: "H1", children: `${T(n, "0,0")} / ${T(o, "0,0")}` }),
|
|
570
565
|
/* @__PURE__ */ e(S, { bold: !0, variant: "XSmall", children: s }),
|
|
571
|
-
/* @__PURE__ */ e(
|
|
566
|
+
/* @__PURE__ */ e(Be, { data: c, height: 10 })
|
|
572
567
|
] }) }) });
|
|
573
|
-
},
|
|
568
|
+
}, Mt = w(() => {
|
|
574
569
|
const { budgets: t } = D();
|
|
575
|
-
return /* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */ e(
|
|
570
|
+
return /* @__PURE__ */ m(v, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
|
|
571
|
+
/* @__PURE__ */ e(j, { color: "secondary", name: "bubble_chart", sx: { fontSize: 32 } }),
|
|
577
572
|
/* @__PURE__ */ e(S, { bold: !0, color: "secondary", variant: "Small", children: t.zero_state_no_sub_budgets }),
|
|
578
573
|
/* @__PURE__ */ e(S, { color: "text.secondary", variant: "XSmall", children: t.zero_state_no_sub_budgets_description })
|
|
579
574
|
] });
|
|
580
|
-
}),
|
|
575
|
+
}), Lt = w(({ budget: t }) => {
|
|
581
576
|
const {
|
|
582
|
-
amount:
|
|
577
|
+
amount: o,
|
|
583
578
|
budgetColors: { background: i },
|
|
584
579
|
category: s,
|
|
585
580
|
percentage: a,
|
|
586
581
|
transaction_total: r
|
|
587
|
-
} = t, { setSelectedSubBudget:
|
|
588
|
-
return /* @__PURE__ */ e(
|
|
589
|
-
/* @__PURE__ */ e(
|
|
582
|
+
} = t, { setSelectedSubBudget: n } = E();
|
|
583
|
+
return /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ m(ee, { onClick: () => n(t), children: [
|
|
584
|
+
/* @__PURE__ */ e(ue, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Pe, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
|
|
590
585
|
/* @__PURE__ */ e(
|
|
591
|
-
|
|
586
|
+
te,
|
|
592
587
|
{
|
|
593
|
-
primary: /* @__PURE__ */ e(
|
|
594
|
-
secondary: /* @__PURE__ */ e(
|
|
588
|
+
primary: /* @__PURE__ */ e(v, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: t.category.name }) }),
|
|
589
|
+
secondary: /* @__PURE__ */ e(v, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(S, { fontWeight: 400, variant: "Body", children: `
|
|
595
590
|
${T(r, "0,0")} /
|
|
596
|
-
${T(
|
|
591
|
+
${T(o, "0,0")}
|
|
597
592
|
` }) })
|
|
598
593
|
}
|
|
599
594
|
)
|
|
600
595
|
] }) });
|
|
601
|
-
}),
|
|
602
|
-
const { budgets: i, common: s } = D(), { setExpandedGuid: a, setOnSelect: r } =
|
|
596
|
+
}), Nt = w(({ category: t, parentBudget: o }) => {
|
|
597
|
+
const { budgets: i, common: s } = D(), { setExpandedGuid: a, setOnSelect: r } = at(), { addBudget: n } = E(), [c, g] = l.useState(!1), [d, u] = l.useState(!1), [p, h] = l.useState(""), [b, y] = l.useState(void 0);
|
|
603
598
|
l.useEffect(() => {
|
|
604
599
|
r((A) => {
|
|
605
600
|
const C = t.subCategories.find((f) => f.guid === A);
|
|
606
|
-
C && (
|
|
601
|
+
C && (y(C), h(`${C.currentAmount === 0 ? "" : C.currentAmount}`), u(!0));
|
|
607
602
|
});
|
|
608
603
|
}, []);
|
|
609
|
-
const
|
|
604
|
+
const _ = () => {
|
|
610
605
|
a(t.guid), g(!0);
|
|
611
|
-
},
|
|
612
|
-
|
|
606
|
+
}, x = async () => {
|
|
607
|
+
b && Number(p) > 0 && (await n(b, Number(p), o.guid), u(!1), g(!1), y(void 0));
|
|
613
608
|
};
|
|
614
|
-
return /* @__PURE__ */
|
|
615
|
-
/* @__PURE__ */ e(
|
|
616
|
-
/* @__PURE__ */
|
|
617
|
-
/* @__PURE__ */ e(
|
|
609
|
+
return /* @__PURE__ */ m(K, { children: [
|
|
610
|
+
/* @__PURE__ */ e(Q, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(ee, { onClick: _, children: /* @__PURE__ */ e(te, { children: /* @__PURE__ */ m(v, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
611
|
+
/* @__PURE__ */ m(v, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
612
|
+
/* @__PURE__ */ e(j, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.light" } }),
|
|
618
613
|
/* @__PURE__ */ e(S, { bold: !0, sx: { color: "primary.light" }, variant: "Body", children: i.add_sub_budget_button })
|
|
619
614
|
] }),
|
|
620
|
-
/* @__PURE__ */ e(
|
|
615
|
+
/* @__PURE__ */ e(j, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
|
|
621
616
|
] }) }) }) }),
|
|
622
|
-
/* @__PURE__ */ e(
|
|
617
|
+
/* @__PURE__ */ e(de, {}),
|
|
623
618
|
/* @__PURE__ */ e(
|
|
624
619
|
$,
|
|
625
620
|
{
|
|
@@ -627,7 +622,7 @@ const $t = ({
|
|
|
627
622
|
isOpen: c,
|
|
628
623
|
onClose: () => g(!1),
|
|
629
624
|
title: i.add_sub_budget_title,
|
|
630
|
-
children: /* @__PURE__ */ e(
|
|
625
|
+
children: /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(rt, { category: t, subCategories: t.subCategories }) })
|
|
631
626
|
}
|
|
632
627
|
),
|
|
633
628
|
/* @__PURE__ */ e(
|
|
@@ -636,82 +631,82 @@ const $t = ({
|
|
|
636
631
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
637
632
|
disablePrimaryButton: Number(p) <= 0,
|
|
638
633
|
isOpen: d,
|
|
639
|
-
onClose: () =>
|
|
640
|
-
onPrimaryAction:
|
|
634
|
+
onClose: () => u(!1),
|
|
635
|
+
onPrimaryAction: x,
|
|
641
636
|
primaryText: i.add_save_button,
|
|
642
637
|
children: /* @__PURE__ */ e(
|
|
643
|
-
|
|
638
|
+
pe,
|
|
644
639
|
{
|
|
645
640
|
amount: p,
|
|
646
|
-
categoryName:
|
|
641
|
+
categoryName: b?.name || "",
|
|
647
642
|
onAmountChanged: h
|
|
648
643
|
}
|
|
649
644
|
)
|
|
650
645
|
}
|
|
651
646
|
)
|
|
652
647
|
] });
|
|
653
|
-
}),
|
|
654
|
-
const { category:
|
|
648
|
+
}), kt = w(({ budget: t }) => {
|
|
649
|
+
const { category: o, subBudgets: i } = t, { budgets: s, common: a } = D(), { deleteBudget: r, selectedSubBudget: n, setSelectedSubBudget: c, updateBudget: g } = E(), { filter: d, setFilter: u } = J(), [p, h] = l.useState(!1), [b, y] = l.useState(!1), [_, x] = l.useState("");
|
|
655
650
|
l.useEffect(() => {
|
|
656
|
-
|
|
651
|
+
n && (x(`${n.amount}`), u({
|
|
657
652
|
...d,
|
|
658
|
-
custom: (B) => B.category_guid ===
|
|
653
|
+
custom: (B) => B.category_guid === n.category_guid
|
|
659
654
|
}));
|
|
660
|
-
}, [
|
|
655
|
+
}, [n]);
|
|
661
656
|
const A = async () => {
|
|
662
|
-
|
|
663
|
-
...
|
|
664
|
-
amount: Number(
|
|
657
|
+
n && await g({
|
|
658
|
+
...n,
|
|
659
|
+
amount: Number(_)
|
|
665
660
|
});
|
|
666
661
|
}, C = async () => {
|
|
667
|
-
|
|
662
|
+
n && await r(n.guid), y(!1), f();
|
|
668
663
|
}, f = () => {
|
|
669
|
-
|
|
664
|
+
u({
|
|
670
665
|
...d,
|
|
671
666
|
custom: (B) => B.category_guid === t.category_guid || B.top_level_category_guid === t.category_guid
|
|
672
667
|
}), c(void 0);
|
|
673
668
|
};
|
|
674
|
-
return /* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
676
|
-
i.length === 0 ? /* @__PURE__ */ e(
|
|
677
|
-
/* @__PURE__ */ e(
|
|
678
|
-
/* @__PURE__ */ e(
|
|
669
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
670
|
+
/* @__PURE__ */ m(X, { sx: { bgcolor: "background.paper" }, children: [
|
|
671
|
+
i.length === 0 ? /* @__PURE__ */ e(Mt, {}) : i.map((B) => /* @__PURE__ */ m(l.Fragment, { children: [
|
|
672
|
+
/* @__PURE__ */ e(Lt, { budget: B }),
|
|
673
|
+
/* @__PURE__ */ e(de, {})
|
|
679
674
|
] }, B.guid)),
|
|
680
|
-
/* @__PURE__ */ e(
|
|
675
|
+
/* @__PURE__ */ e(Nt, { category: o, parentBudget: t })
|
|
681
676
|
] }),
|
|
682
677
|
/* @__PURE__ */ e(
|
|
683
678
|
$,
|
|
684
679
|
{
|
|
685
680
|
ariaLabelClose: a.close_aria,
|
|
686
|
-
isOpen: !!
|
|
681
|
+
isOpen: !!n,
|
|
687
682
|
onClose: f,
|
|
688
683
|
onPrimaryAction: () => h(!0),
|
|
689
|
-
onSecondaryAction: () =>
|
|
684
|
+
onSecondaryAction: () => y(!0),
|
|
690
685
|
primaryText: s.details_edit_button,
|
|
691
686
|
secondaryText: s.details_delete_button,
|
|
692
687
|
title: s.details_title,
|
|
693
|
-
children:
|
|
694
|
-
/* @__PURE__ */ e(
|
|
695
|
-
/* @__PURE__ */ e(
|
|
688
|
+
children: n && /* @__PURE__ */ m(v, { gap: 24, children: [
|
|
689
|
+
/* @__PURE__ */ e(We, { budget: n }),
|
|
690
|
+
/* @__PURE__ */ e(xe, { height: "100%" })
|
|
696
691
|
] })
|
|
697
692
|
}
|
|
698
693
|
),
|
|
699
|
-
|
|
694
|
+
n && /* @__PURE__ */ m(l.Fragment, { children: [
|
|
700
695
|
/* @__PURE__ */ e(
|
|
701
696
|
U,
|
|
702
697
|
{
|
|
703
698
|
copy: { close_aria: a.close_aria, title: s.details_edit_title },
|
|
704
|
-
disablePrimaryButton: Number(
|
|
699
|
+
disablePrimaryButton: Number(_) <= 0,
|
|
705
700
|
isOpen: p,
|
|
706
701
|
onClose: () => h(!1),
|
|
707
702
|
onPrimaryAction: A,
|
|
708
703
|
primaryText: s.edit_save_button,
|
|
709
704
|
children: /* @__PURE__ */ e(
|
|
710
|
-
|
|
705
|
+
pe,
|
|
711
706
|
{
|
|
712
|
-
amount:
|
|
713
|
-
categoryName:
|
|
714
|
-
onAmountChanged:
|
|
707
|
+
amount: _,
|
|
708
|
+
categoryName: n.category.name,
|
|
709
|
+
onAmountChanged: x
|
|
715
710
|
}
|
|
716
711
|
)
|
|
717
712
|
}
|
|
@@ -720,35 +715,35 @@ const $t = ({
|
|
|
720
715
|
U,
|
|
721
716
|
{
|
|
722
717
|
copy: { close_aria: a.close_aria, title: s.delete_title },
|
|
723
|
-
isOpen:
|
|
724
|
-
onClose: () =>
|
|
718
|
+
isOpen: b,
|
|
719
|
+
onClose: () => y(!1),
|
|
725
720
|
onPrimaryAction: C,
|
|
726
721
|
primaryColor: "error",
|
|
727
722
|
primaryText: "Delete",
|
|
728
723
|
secondaryColor: "secondary",
|
|
729
|
-
children: /* @__PURE__ */ e(S, { variant: "Paragraph", children:
|
|
724
|
+
children: /* @__PURE__ */ e(S, { variant: "Paragraph", children: N(s.delete_description, n.category.name) })
|
|
730
725
|
}
|
|
731
726
|
)
|
|
732
727
|
] })
|
|
733
728
|
] });
|
|
734
|
-
}),
|
|
735
|
-
const { is_mobile_webview:
|
|
729
|
+
}), $t = w(({ budget: t }) => {
|
|
730
|
+
const { is_mobile_webview: o } = Le(), { setAlert: i } = E(), { budgets: s, common: a, transactions: r } = D(), { isDesktop: n, isSmallTablet: c, isTablet: g } = me(), {
|
|
736
731
|
sortedTransactions: d,
|
|
737
|
-
sortedTransactionsWithSplits:
|
|
732
|
+
sortedTransactionsWithSplits: u,
|
|
738
733
|
tags: p
|
|
739
|
-
} =
|
|
740
|
-
() => d.find((B) => B.guid ===
|
|
741
|
-
[
|
|
734
|
+
} = J(), [h, b] = l.useState(0), [y, _] = l.useState(""), x = l.useMemo(
|
|
735
|
+
() => d.find((B) => B.guid === y),
|
|
736
|
+
[y, d]
|
|
742
737
|
), A = (B, I) => {
|
|
743
|
-
|
|
738
|
+
b(I);
|
|
744
739
|
}, C = () => {
|
|
745
|
-
|
|
746
|
-
}, f = d.length > 0 && !
|
|
747
|
-
return /* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */ e(
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
|
|
740
|
+
tt(u, p), i(s.alert_csv_downloaded);
|
|
741
|
+
}, f = d.length > 0 && !o && (n || g && !c);
|
|
742
|
+
return /* @__PURE__ */ m(v, { gap: 24, children: [
|
|
743
|
+
/* @__PURE__ */ e(We, { budget: t }),
|
|
744
|
+
/* @__PURE__ */ m(v, { children: [
|
|
745
|
+
/* @__PURE__ */ m(
|
|
746
|
+
et,
|
|
752
747
|
{
|
|
753
748
|
onChange: A,
|
|
754
749
|
sx: { width: "100%" },
|
|
@@ -756,94 +751,94 @@ const $t = ({
|
|
|
756
751
|
value: h,
|
|
757
752
|
variant: "fullWidth",
|
|
758
753
|
children: [
|
|
759
|
-
/* @__PURE__ */ e(
|
|
760
|
-
/* @__PURE__ */ e(
|
|
754
|
+
/* @__PURE__ */ e(De, { label: s.details_transactions_tab }),
|
|
755
|
+
/* @__PURE__ */ e(De, { label: s.details_subbudgets_tab })
|
|
761
756
|
]
|
|
762
757
|
}
|
|
763
758
|
),
|
|
764
|
-
h === 0 && /* @__PURE__ */
|
|
765
|
-
f && /* @__PURE__ */ e(
|
|
766
|
-
|
|
759
|
+
h === 0 && /* @__PURE__ */ m(v, { children: [
|
|
760
|
+
f && /* @__PURE__ */ e(v, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
|
|
761
|
+
ke,
|
|
767
762
|
{
|
|
768
763
|
onClick: C,
|
|
769
|
-
startIcon: /* @__PURE__ */ e(
|
|
764
|
+
startIcon: /* @__PURE__ */ e(j, { name: "ios_share" }),
|
|
770
765
|
variant: "text",
|
|
771
766
|
children: r.export_csv_btn
|
|
772
767
|
}
|
|
773
768
|
) }),
|
|
774
|
-
/* @__PURE__ */ e(
|
|
769
|
+
/* @__PURE__ */ e(xe, { height: "100%", onClick: _ })
|
|
775
770
|
] }),
|
|
776
|
-
h === 1 && /* @__PURE__ */ e(
|
|
771
|
+
h === 1 && /* @__PURE__ */ e(kt, { budget: t }),
|
|
777
772
|
/* @__PURE__ */ e(
|
|
778
773
|
$,
|
|
779
774
|
{
|
|
780
775
|
ariaLabelClose: a.close_aria,
|
|
781
|
-
isOpen: !!
|
|
782
|
-
onClose: () =>
|
|
776
|
+
isOpen: !!x,
|
|
777
|
+
onClose: () => _(""),
|
|
783
778
|
title: s.details_transaction_drawer,
|
|
784
|
-
children:
|
|
779
|
+
children: x && /* @__PURE__ */ e(nt, { transaction: x })
|
|
785
780
|
}
|
|
786
781
|
)
|
|
787
782
|
] })
|
|
788
783
|
] });
|
|
789
|
-
}),
|
|
790
|
-
const { selectedAccountGuids: t } =
|
|
784
|
+
}), Pt = w(() => {
|
|
785
|
+
const { selectedAccountGuids: t } = q(), { budgets: o, common: i } = D(), {
|
|
791
786
|
alert: s,
|
|
792
787
|
dateRange: a,
|
|
793
788
|
deleteBudget: r,
|
|
794
|
-
selectedBudget:
|
|
789
|
+
selectedBudget: n,
|
|
795
790
|
selectedSubBudget: c,
|
|
796
791
|
setAlert: g,
|
|
797
792
|
setSelectedBudget: d,
|
|
798
|
-
updateBudget:
|
|
799
|
-
} = E(), { setFilter: p } =
|
|
793
|
+
updateBudget: u
|
|
794
|
+
} = E(), { setFilter: p } = J(), [h, b] = l.useState(!1), [y, _] = l.useState(!1), [x, A] = l.useState(!1), [C, f] = l.useState("");
|
|
800
795
|
l.useEffect(() => {
|
|
801
|
-
|
|
796
|
+
n && !c && (f(`${n.amount}`), b(!0), p({
|
|
802
797
|
accounts: t,
|
|
803
798
|
dateRange: a,
|
|
804
|
-
custom: (O) => O.category_guid ===
|
|
799
|
+
custom: (O) => O.category_guid === n.category_guid || O.top_level_category_guid === n.category_guid,
|
|
805
800
|
showSplits: !0
|
|
806
801
|
}));
|
|
807
|
-
}, [
|
|
802
|
+
}, [n]);
|
|
808
803
|
const B = async () => {
|
|
809
|
-
|
|
810
|
-
...
|
|
804
|
+
n && (await u({
|
|
805
|
+
...n,
|
|
811
806
|
amount: Number(C),
|
|
812
|
-
percentage:
|
|
813
|
-
}),
|
|
807
|
+
percentage: n.category.totalAmount / Number(C) * 100
|
|
808
|
+
}), _(!1), g(N(o.alert_budget_updated, n.category.name)));
|
|
814
809
|
}, I = async () => {
|
|
815
|
-
|
|
816
|
-
},
|
|
817
|
-
|
|
810
|
+
n && (await r(n.guid), g(N(o.alert_budget_deleted, n.category.name))), L();
|
|
811
|
+
}, L = () => {
|
|
812
|
+
b(!1), setTimeout(() => {
|
|
818
813
|
d(void 0);
|
|
819
814
|
}, 250);
|
|
820
815
|
}, R = () => {
|
|
821
|
-
|
|
816
|
+
_(!1), f(`${n?.amount}`);
|
|
822
817
|
};
|
|
823
|
-
if (
|
|
824
|
-
return /* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
818
|
+
if (n)
|
|
819
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
820
|
+
/* @__PURE__ */ m(
|
|
826
821
|
$,
|
|
827
822
|
{
|
|
828
823
|
ariaLabelClose: i.close_aria,
|
|
829
824
|
isOpen: h,
|
|
830
|
-
onClose:
|
|
831
|
-
onPrimaryAction: () =>
|
|
825
|
+
onClose: L,
|
|
826
|
+
onPrimaryAction: () => _(!0),
|
|
832
827
|
onSecondaryAction: () => A(!0),
|
|
833
|
-
primaryText:
|
|
828
|
+
primaryText: o.details_edit_button,
|
|
834
829
|
secondaryColor: "error",
|
|
835
|
-
secondaryText:
|
|
836
|
-
title:
|
|
830
|
+
secondaryText: o.details_delete_button,
|
|
831
|
+
title: o.details_title,
|
|
837
832
|
children: [
|
|
838
|
-
/* @__PURE__ */ e(
|
|
833
|
+
/* @__PURE__ */ e($t, { budget: n }),
|
|
839
834
|
/* @__PURE__ */ e(
|
|
840
|
-
|
|
835
|
+
Ae,
|
|
841
836
|
{
|
|
842
837
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
843
838
|
autoHideDuration: 3500,
|
|
844
839
|
onClose: () => g(""),
|
|
845
840
|
open: !!s,
|
|
846
|
-
children: /* @__PURE__ */ e(
|
|
841
|
+
children: /* @__PURE__ */ e(Se, { closeText: "", onClose: () => g(""), severity: "success", variant: "filled", children: s })
|
|
847
842
|
}
|
|
848
843
|
)
|
|
849
844
|
]
|
|
@@ -852,18 +847,18 @@ const $t = ({
|
|
|
852
847
|
/* @__PURE__ */ e(
|
|
853
848
|
U,
|
|
854
849
|
{
|
|
855
|
-
copy: { close_aria: i.close_aria, title:
|
|
850
|
+
copy: { close_aria: i.close_aria, title: o.details_edit_title },
|
|
856
851
|
disablePrimaryButton: Number(C) <= 0,
|
|
857
|
-
isOpen:
|
|
852
|
+
isOpen: y,
|
|
858
853
|
onClose: R,
|
|
859
854
|
onPrimaryAction: B,
|
|
860
855
|
onSecondaryAction: R,
|
|
861
|
-
primaryText:
|
|
856
|
+
primaryText: o.edit_save_button,
|
|
862
857
|
children: /* @__PURE__ */ e(
|
|
863
|
-
|
|
858
|
+
pe,
|
|
864
859
|
{
|
|
865
860
|
amount: C,
|
|
866
|
-
categoryName:
|
|
861
|
+
categoryName: n.category.name,
|
|
867
862
|
onAmountChanged: f
|
|
868
863
|
}
|
|
869
864
|
)
|
|
@@ -872,79 +867,79 @@ const $t = ({
|
|
|
872
867
|
/* @__PURE__ */ e(
|
|
873
868
|
U,
|
|
874
869
|
{
|
|
875
|
-
copy: { close_aria: i.close_aria, title:
|
|
876
|
-
isOpen:
|
|
870
|
+
copy: { close_aria: i.close_aria, title: o.delete_title },
|
|
871
|
+
isOpen: x,
|
|
877
872
|
onClose: () => A(!1),
|
|
878
873
|
onPrimaryAction: I,
|
|
879
874
|
primaryColor: "error",
|
|
880
|
-
primaryText:
|
|
875
|
+
primaryText: o.details_delete_button,
|
|
881
876
|
secondaryColor: "secondary",
|
|
882
|
-
children: /* @__PURE__ */ e(S, { variant: "Paragraph", children:
|
|
877
|
+
children: /* @__PURE__ */ e(S, { variant: "Paragraph", children: N(o.delete_description, n.category.name) })
|
|
883
878
|
}
|
|
884
879
|
)
|
|
885
880
|
] });
|
|
886
|
-
}),
|
|
881
|
+
}), Gt = ({ budget: t, onClick: o }) => {
|
|
887
882
|
const {
|
|
888
883
|
amount: i,
|
|
889
884
|
budgetColors: { background: s, description: a },
|
|
890
885
|
category_guid: r,
|
|
891
|
-
description:
|
|
886
|
+
description: n,
|
|
892
887
|
percentage: c,
|
|
893
888
|
subBudgets: g,
|
|
894
889
|
transaction_total: d
|
|
895
890
|
} = t;
|
|
896
|
-
return /* @__PURE__ */ e(
|
|
897
|
-
/* @__PURE__ */ e(
|
|
891
|
+
return /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ m(ee, { onClick: () => o?.(t), children: [
|
|
892
|
+
/* @__PURE__ */ e(ue, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Pe, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: r, variant: "basic" }) }) }),
|
|
898
893
|
/* @__PURE__ */ e(
|
|
899
|
-
|
|
894
|
+
te,
|
|
900
895
|
{
|
|
901
|
-
primary: /* @__PURE__ */
|
|
896
|
+
primary: /* @__PURE__ */ m(v, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
902
897
|
/* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: t.category.name }),
|
|
903
898
|
/* @__PURE__ */ e(S, { fontWeight: 400, variant: "Body", children: `
|
|
904
899
|
${T(d, "0,0")} /
|
|
905
900
|
${T(i, "0,0")}
|
|
906
901
|
` })
|
|
907
902
|
] }),
|
|
908
|
-
secondary: /* @__PURE__ */
|
|
903
|
+
secondary: /* @__PURE__ */ m(v, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
909
904
|
/* @__PURE__ */ e(S, { variant: "XSmall", children: `${g.length} Sub-budgets` }),
|
|
910
|
-
/* @__PURE__ */ e(S, { bold: c > 100, color: a, variant: "XSmall", children:
|
|
905
|
+
/* @__PURE__ */ e(S, { bold: c > 100, color: a, variant: "XSmall", children: n })
|
|
911
906
|
] })
|
|
912
907
|
}
|
|
913
908
|
)
|
|
914
909
|
] }) });
|
|
915
|
-
},
|
|
916
|
-
const { onEvent: t } =
|
|
910
|
+
}, jt = w(() => {
|
|
911
|
+
const { onEvent: t } = Z(), { budgets: o } = D(), { detailedBudgets: i, setSelectedBudget: s } = E(), a = (r) => {
|
|
917
912
|
s(r), t(P.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
918
913
|
budget_category: r.category.name,
|
|
919
914
|
click_type: "list"
|
|
920
915
|
});
|
|
921
916
|
};
|
|
922
|
-
return /* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */ e(
|
|
924
|
-
/* @__PURE__ */ e(
|
|
925
|
-
/* @__PURE__ */ e(
|
|
926
|
-
/* @__PURE__ */ e(
|
|
917
|
+
return /* @__PURE__ */ m(ve, { elevation: 2, children: [
|
|
918
|
+
/* @__PURE__ */ e(Ge, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Me, { children: o.budget_categories_title }) }),
|
|
919
|
+
/* @__PURE__ */ e(Te, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(X, { children: i.map((r) => /* @__PURE__ */ m(l.Fragment, { children: [
|
|
920
|
+
/* @__PURE__ */ e(Gt, { budget: r, onClick: a }),
|
|
921
|
+
/* @__PURE__ */ e(de, {})
|
|
927
922
|
] }, r.guid)) }) })
|
|
928
923
|
] });
|
|
929
|
-
}),
|
|
930
|
-
const t =
|
|
924
|
+
}), zt = w(() => {
|
|
925
|
+
const t = ie(), { onEvent: o } = Z(), { visibleAccounts: i } = Ne(), { budgets: s, common: a, recurring: r } = D(), { incomeCategories: n, spendCategories: c } = Y(), { detailedBudgets: g, totalBudgeted: d } = E(), { incomeTotal: u } = ce(), { setFilter: p } = J(), [h, b] = l.useState(!1), [y, _] = l.useMemo(() => {
|
|
931
926
|
const f = c.reduce((R, O) => R + O.totalAmount, 0);
|
|
932
927
|
let B = f / d;
|
|
933
928
|
B > 1 && (B = 1);
|
|
934
929
|
let I = t.palette.success.main;
|
|
935
930
|
B > 0.8 && B < 1 ? I = t.palette.warning.main : B >= 1 && (I = t.palette.error.main);
|
|
936
|
-
const
|
|
931
|
+
const L = [
|
|
937
932
|
{
|
|
938
933
|
color: I,
|
|
939
934
|
percentage: `${B}`
|
|
940
935
|
}
|
|
941
936
|
];
|
|
942
|
-
return [f,
|
|
943
|
-
}, [g, c]), [
|
|
937
|
+
return [f, L];
|
|
938
|
+
}, [g, c]), [x, A] = l.useMemo(() => {
|
|
944
939
|
const f = Math.abs(
|
|
945
|
-
|
|
940
|
+
n.reduce((L, R) => L + R.totalAmount, 0)
|
|
946
941
|
);
|
|
947
|
-
let B = f /
|
|
942
|
+
let B = f / u;
|
|
948
943
|
B > 1 && (B = 1);
|
|
949
944
|
const I = [
|
|
950
945
|
{
|
|
@@ -953,45 +948,45 @@ const $t = ({
|
|
|
953
948
|
}
|
|
954
949
|
];
|
|
955
950
|
return [f, I];
|
|
956
|
-
}, [
|
|
951
|
+
}, [n, u]), C = () => {
|
|
957
952
|
p({
|
|
958
953
|
accounts: i.map((f) => f.guid),
|
|
959
954
|
dateRange: {
|
|
960
|
-
start:
|
|
955
|
+
start: st(/* @__PURE__ */ new Date(), 90),
|
|
961
956
|
end: /* @__PURE__ */ new Date()
|
|
962
957
|
}
|
|
963
|
-
}),
|
|
958
|
+
}), b(!0), o(P.BUDGETS_CLICK_EDIT_INCOME);
|
|
964
959
|
};
|
|
965
|
-
return /* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */ e(
|
|
967
|
-
/* @__PURE__ */ e(
|
|
968
|
-
/* @__PURE__ */
|
|
960
|
+
return /* @__PURE__ */ m(ve, { elevation: 2, sx: { overflow: "visible" }, children: [
|
|
961
|
+
/* @__PURE__ */ e(Ge, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Me, { children: s.overview_title }) }),
|
|
962
|
+
/* @__PURE__ */ e(Te, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ m(v, { gap: 24, children: [
|
|
963
|
+
/* @__PURE__ */ m(v, { gap: 8, children: [
|
|
969
964
|
/* @__PURE__ */ e(S, { bold: !0, sx: { mb: 8 }, variant: "Body", children: s.spending_title }),
|
|
970
|
-
/* @__PURE__ */ e(
|
|
971
|
-
/* @__PURE__ */ e(S, { variant: "Small", children:
|
|
965
|
+
/* @__PURE__ */ e(Be, { data: _, height: 16 }),
|
|
966
|
+
/* @__PURE__ */ e(S, { variant: "Small", children: N(
|
|
972
967
|
s.spending_description,
|
|
973
|
-
T(
|
|
968
|
+
T(y, "0,0"),
|
|
974
969
|
T(d, "0,0")
|
|
975
970
|
) })
|
|
976
971
|
] }),
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */
|
|
972
|
+
/* @__PURE__ */ m(v, { gap: 8, children: [
|
|
973
|
+
/* @__PURE__ */ m(v, { alignItems: "center", direction: "row", gap: 4, mb: -4, children: [
|
|
979
974
|
/* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: s.income_title }),
|
|
980
975
|
/* @__PURE__ */ e(
|
|
981
|
-
|
|
976
|
+
it,
|
|
982
977
|
{
|
|
983
978
|
"aria-label": r.manage_income,
|
|
984
979
|
onClick: C,
|
|
985
980
|
sx: { p: 0 },
|
|
986
|
-
children: /* @__PURE__ */ e(
|
|
981
|
+
children: /* @__PURE__ */ e(j, { color: "primary", name: "edit" })
|
|
987
982
|
}
|
|
988
983
|
)
|
|
989
984
|
] }),
|
|
990
|
-
/* @__PURE__ */ e(
|
|
991
|
-
/* @__PURE__ */ e(S, { variant: "Small", children:
|
|
985
|
+
/* @__PURE__ */ e(Be, { data: A, height: 16 }),
|
|
986
|
+
/* @__PURE__ */ e(S, { variant: "Small", children: N(
|
|
992
987
|
s.income_description,
|
|
993
|
-
T(
|
|
994
|
-
T(
|
|
988
|
+
T(x, "0,0"),
|
|
989
|
+
T(u, "0,0")
|
|
995
990
|
) })
|
|
996
991
|
] })
|
|
997
992
|
] }) }),
|
|
@@ -1000,136 +995,136 @@ const $t = ({
|
|
|
1000
995
|
{
|
|
1001
996
|
ariaLabelClose: a.close_aria,
|
|
1002
997
|
isOpen: h,
|
|
1003
|
-
onClose: () =>
|
|
998
|
+
onClose: () => b(!1),
|
|
1004
999
|
title: r.manage_income,
|
|
1005
|
-
children: /* @__PURE__ */ e(
|
|
1000
|
+
children: /* @__PURE__ */ e(ct, { forOverview: !0 })
|
|
1006
1001
|
}
|
|
1007
1002
|
)
|
|
1008
1003
|
] });
|
|
1009
|
-
}),
|
|
1010
|
-
const i =
|
|
1011
|
-
alert:
|
|
1004
|
+
}), Re = 480, Wn = w(({ onBackClick: t, sx: o }) => {
|
|
1005
|
+
const i = ie(), { onEvent: s } = Z(), { visibleAccounts: a } = Ne(), { budgets: r, common: n } = D(), { isInitialized: c, selectedAccounts: g, setDisplayedDate: d } = q(), {
|
|
1006
|
+
alert: u,
|
|
1012
1007
|
dateRange: p,
|
|
1013
1008
|
isDataLoaded: h,
|
|
1014
|
-
loadBudgetData:
|
|
1015
|
-
setDateRange:
|
|
1016
|
-
setAlert:
|
|
1017
|
-
setTheme:
|
|
1009
|
+
loadBudgetData: b,
|
|
1010
|
+
setDateRange: y,
|
|
1011
|
+
setAlert: _,
|
|
1012
|
+
setTheme: x,
|
|
1018
1013
|
detailedBudgets: A
|
|
1019
|
-
} = E(), { setDateRange: C } =
|
|
1020
|
-
|
|
1014
|
+
} = E(), { setDateRange: C } = ce(), { loadDateRangeCategoryTotals: f, loadMonthlyCategoryTotals: B } = Y(), { isSmallTablet: I, isMobile: L, isSmallMobile: R } = me(), O = I || L || R, [z, k] = l.useState(!1);
|
|
1015
|
+
je({
|
|
1021
1016
|
widgetName: "BubbleBudgetsWidget",
|
|
1022
1017
|
isLoaded: h
|
|
1023
1018
|
}), l.useEffect(() => {
|
|
1024
|
-
|
|
1019
|
+
x(i), h || b().finally(() => {
|
|
1025
1020
|
s(P.BUDGETS_VIEW);
|
|
1026
1021
|
});
|
|
1027
|
-
}, []), l.useEffect(() => (
|
|
1028
|
-
|
|
1022
|
+
}, []), l.useEffect(() => (y({ start: re(oe()), end: Ce(oe()) }), () => {
|
|
1023
|
+
y({ start: re(oe()), end: Ce(oe()) });
|
|
1029
1024
|
}), [a]), l.useEffect(() => {
|
|
1030
1025
|
c && (d(p.start, p.end), f(g, p.start, p.end).finally(), B(g).finally(), C(p));
|
|
1031
1026
|
}, [c, g, p]);
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1034
|
-
},
|
|
1027
|
+
const he = (V) => {
|
|
1028
|
+
y({ start: V[0] || /* @__PURE__ */ new Date(), end: V[1] || /* @__PURE__ */ new Date() });
|
|
1029
|
+
}, fe = () => {
|
|
1035
1030
|
s(P.BUDGETS_CLICK_FILTER);
|
|
1036
|
-
},
|
|
1031
|
+
}, ne = () => {
|
|
1037
1032
|
k(!0), s(P.BUDGETS_CLICK_ADD);
|
|
1038
|
-
},
|
|
1033
|
+
}, ye = () => {
|
|
1039
1034
|
k(!1);
|
|
1040
|
-
},
|
|
1035
|
+
}, G = () => {
|
|
1041
1036
|
k(!1);
|
|
1042
|
-
},
|
|
1043
|
-
return !c || !h ? /* @__PURE__ */ e(
|
|
1044
|
-
|
|
1037
|
+
}, W = Ke(p.end, re(/* @__PURE__ */ new Date()));
|
|
1038
|
+
return !c || !h ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ m(
|
|
1039
|
+
lt,
|
|
1045
1040
|
{
|
|
1046
1041
|
actions: [
|
|
1047
1042
|
{
|
|
1048
1043
|
iconName: "add",
|
|
1049
1044
|
label: r.add_title,
|
|
1050
|
-
onClick:
|
|
1045
|
+
onClick: ne
|
|
1051
1046
|
}
|
|
1052
1047
|
],
|
|
1053
1048
|
calendarActions: {
|
|
1054
|
-
onRangeChanged:
|
|
1055
|
-
shouldDisableNext:
|
|
1049
|
+
onRangeChanged: he,
|
|
1050
|
+
shouldDisableNext: W,
|
|
1056
1051
|
shouldDisablePicker: !0
|
|
1057
1052
|
},
|
|
1058
|
-
onAccountsFilterClick:
|
|
1053
|
+
onAccountsFilterClick: fe,
|
|
1059
1054
|
onBackClick: t,
|
|
1060
|
-
sx:
|
|
1055
|
+
sx: o,
|
|
1061
1056
|
title: r.budgets_title,
|
|
1062
1057
|
children: [
|
|
1063
|
-
/* @__PURE__ */
|
|
1064
|
-
|
|
1058
|
+
/* @__PURE__ */ m(
|
|
1059
|
+
v,
|
|
1065
1060
|
{
|
|
1066
1061
|
direction: O ? "column" : "row",
|
|
1067
1062
|
height: "100%",
|
|
1068
1063
|
sx: { justifyContent: "center" },
|
|
1069
1064
|
width: "100%",
|
|
1070
1065
|
children: [
|
|
1071
|
-
/* @__PURE__ */ e(
|
|
1072
|
-
|
|
1066
|
+
/* @__PURE__ */ e(v, { height: O ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
|
|
1067
|
+
He,
|
|
1073
1068
|
{
|
|
1074
|
-
createBudgetOnClick:
|
|
1069
|
+
createBudgetOnClick: ne,
|
|
1075
1070
|
height: O ? 450 : 800,
|
|
1076
1071
|
isDraggable: !0,
|
|
1077
1072
|
shouldShowZeroState: A.length === 0,
|
|
1078
|
-
unavailableWidth: O ? 0 :
|
|
1073
|
+
unavailableWidth: O ? 0 : Re
|
|
1079
1074
|
}
|
|
1080
1075
|
) }),
|
|
1081
|
-
A.length !== 0 && /* @__PURE__ */
|
|
1082
|
-
|
|
1076
|
+
A.length !== 0 && /* @__PURE__ */ m(
|
|
1077
|
+
v,
|
|
1083
1078
|
{
|
|
1084
1079
|
gap: 24,
|
|
1085
1080
|
height: "100%",
|
|
1086
1081
|
sx: { mr: 24, mt: 48 },
|
|
1087
|
-
width: O ? "100%" :
|
|
1082
|
+
width: O ? "100%" : Re,
|
|
1088
1083
|
children: [
|
|
1089
|
-
/* @__PURE__ */ e(
|
|
1090
|
-
/* @__PURE__ */ e(
|
|
1084
|
+
/* @__PURE__ */ e(zt, {}),
|
|
1085
|
+
/* @__PURE__ */ e(jt, {})
|
|
1091
1086
|
]
|
|
1092
1087
|
}
|
|
1093
1088
|
)
|
|
1094
1089
|
]
|
|
1095
1090
|
}
|
|
1096
1091
|
),
|
|
1097
|
-
/* @__PURE__ */ e(
|
|
1092
|
+
/* @__PURE__ */ e(Pt, {}),
|
|
1098
1093
|
/* @__PURE__ */ e(
|
|
1099
1094
|
$,
|
|
1100
1095
|
{
|
|
1101
|
-
ariaLabelClose:
|
|
1102
|
-
isOpen:
|
|
1096
|
+
ariaLabelClose: n.close_aria,
|
|
1097
|
+
isOpen: z,
|
|
1103
1098
|
onClose: () => k(!1),
|
|
1104
1099
|
title: r.add_new_title,
|
|
1105
1100
|
children: /* @__PURE__ */ e(
|
|
1106
|
-
|
|
1101
|
+
ze,
|
|
1107
1102
|
{
|
|
1108
|
-
onAddBudget:
|
|
1109
|
-
onRecalculateBudgets:
|
|
1103
|
+
onAddBudget: ye,
|
|
1104
|
+
onRecalculateBudgets: G
|
|
1110
1105
|
}
|
|
1111
1106
|
)
|
|
1112
1107
|
}
|
|
1113
1108
|
),
|
|
1114
1109
|
/* @__PURE__ */ e(
|
|
1115
|
-
|
|
1110
|
+
Ae,
|
|
1116
1111
|
{
|
|
1117
1112
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1118
1113
|
autoHideDuration: 3500,
|
|
1119
1114
|
onClose: () => {
|
|
1120
|
-
|
|
1115
|
+
_("");
|
|
1121
1116
|
},
|
|
1122
|
-
open: !!
|
|
1117
|
+
open: !!u,
|
|
1123
1118
|
children: /* @__PURE__ */ e(
|
|
1124
|
-
|
|
1119
|
+
Se,
|
|
1125
1120
|
{
|
|
1126
1121
|
closeText: "",
|
|
1127
1122
|
onClose: () => {
|
|
1128
|
-
|
|
1123
|
+
_("");
|
|
1129
1124
|
},
|
|
1130
1125
|
severity: "success",
|
|
1131
1126
|
variant: "filled",
|
|
1132
|
-
children:
|
|
1127
|
+
children: u
|
|
1133
1128
|
}
|
|
1134
1129
|
)
|
|
1135
1130
|
}
|
|
@@ -1137,60 +1132,60 @@ const $t = ({
|
|
|
1137
1132
|
]
|
|
1138
1133
|
}
|
|
1139
1134
|
);
|
|
1140
|
-
}),
|
|
1135
|
+
}), Ft = ({
|
|
1141
1136
|
budgetsCopy: t,
|
|
1142
|
-
difference:
|
|
1137
|
+
difference: o,
|
|
1143
1138
|
handleAddClick: i,
|
|
1144
1139
|
shouldShowZeroState: s
|
|
1145
1140
|
}) => {
|
|
1146
|
-
const { availableHeight: a = 0 } =
|
|
1141
|
+
const { availableHeight: a = 0 } = le(), r = l.useRef(null);
|
|
1147
1142
|
l.useEffect(() => {
|
|
1148
1143
|
a > 0 && r.current === null && (r.current = a);
|
|
1149
1144
|
}, [a]);
|
|
1150
|
-
const
|
|
1145
|
+
const n = l.useMemo(() => {
|
|
1151
1146
|
const c = r.current ?? a;
|
|
1152
1147
|
return c > 0 ? Math.round(Math.max(120, Math.min(450, c * 0.8))) - 40 : 450;
|
|
1153
1148
|
}, [a]);
|
|
1154
|
-
return /* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ m(v, { sx: { height: "100%", justifyContent: "space-between" }, children: [
|
|
1155
1150
|
/* @__PURE__ */ e(
|
|
1156
|
-
|
|
1151
|
+
He,
|
|
1157
1152
|
{
|
|
1158
1153
|
createBudgetOnClick: i,
|
|
1159
|
-
height:
|
|
1154
|
+
height: n,
|
|
1160
1155
|
isMiniWidget: !0,
|
|
1161
1156
|
shouldShowZeroState: s
|
|
1162
1157
|
}
|
|
1163
1158
|
),
|
|
1164
|
-
!s && /* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */ e(S, { bold: !0, color:
|
|
1166
|
-
/* @__PURE__ */ e(S, { children:
|
|
1159
|
+
!s && /* @__PURE__ */ m(K, { ml: 16, children: [
|
|
1160
|
+
/* @__PURE__ */ e(S, { bold: !0, color: o < 0 ? "error.main" : "success.main", children: T(Math.abs(o), "0,0") }),
|
|
1161
|
+
/* @__PURE__ */ e(S, { children: o < 0 ? t.overspent_in_budgets : t.left_in_budgets })
|
|
1167
1162
|
] })
|
|
1168
1163
|
] });
|
|
1169
|
-
},
|
|
1170
|
-
const
|
|
1164
|
+
}, Ut = (t) => {
|
|
1165
|
+
const o = ie(), { onEvent: i } = Z(), { detailedBudgets: s, isDataLoaded: a, loadBudgetData: r, setTheme: n } = E(), { budgets: c, common: g } = D(), { isInitialized: d, selectedAccounts: u } = q(), { loadDateRangeCategoryTotals: p, loadMonthlyCategoryTotals: h } = Y(), b = dt(), [y, _] = l.useState(!1);
|
|
1171
1166
|
l.useEffect(() => {
|
|
1172
1167
|
a || r().finally();
|
|
1173
1168
|
}, []), l.useEffect(() => {
|
|
1174
|
-
o
|
|
1175
|
-
}, [
|
|
1169
|
+
n(o);
|
|
1170
|
+
}, [o]), l.useEffect(() => {
|
|
1176
1171
|
d && !a && (p(
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
).finally(), h(
|
|
1181
|
-
}, [d,
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1172
|
+
u,
|
|
1173
|
+
re(/* @__PURE__ */ new Date()),
|
|
1174
|
+
Ce(/* @__PURE__ */ new Date())
|
|
1175
|
+
).finally(), h(u).finally());
|
|
1176
|
+
}, [d, u, a]);
|
|
1177
|
+
const x = () => {
|
|
1178
|
+
_(!0), i(P.BUDGETS_CLICK_ADD);
|
|
1184
1179
|
}, A = () => {
|
|
1185
|
-
|
|
1186
|
-
}, C = () =>
|
|
1187
|
-
if (
|
|
1180
|
+
_(!1);
|
|
1181
|
+
}, C = () => _(!1);
|
|
1182
|
+
if (je({
|
|
1188
1183
|
widgetName: "BubbleBudgetsMiniWidget",
|
|
1189
1184
|
isLoaded: a
|
|
1190
|
-
}), !d || !a) return /* @__PURE__ */ e(
|
|
1185
|
+
}), !d || !a) return /* @__PURE__ */ e(ge, {});
|
|
1191
1186
|
const f = s.length === 0;
|
|
1192
|
-
return /* @__PURE__ */
|
|
1193
|
-
|
|
1187
|
+
return /* @__PURE__ */ m(
|
|
1188
|
+
gt,
|
|
1194
1189
|
{
|
|
1195
1190
|
contentStyles: { height: "calc(100% - 66px)", ":last-child": { pb: 0 } },
|
|
1196
1191
|
primaryCtaLabel: f ? c.get_started_cta : c.details_cta,
|
|
@@ -1199,11 +1194,11 @@ const $t = ({
|
|
|
1199
1194
|
...t,
|
|
1200
1195
|
children: [
|
|
1201
1196
|
/* @__PURE__ */ e(
|
|
1202
|
-
|
|
1197
|
+
Ft,
|
|
1203
1198
|
{
|
|
1204
1199
|
budgetsCopy: c,
|
|
1205
|
-
difference:
|
|
1206
|
-
handleAddClick:
|
|
1200
|
+
difference: b,
|
|
1201
|
+
handleAddClick: x,
|
|
1207
1202
|
shouldShowZeroState: f
|
|
1208
1203
|
}
|
|
1209
1204
|
),
|
|
@@ -1211,11 +1206,11 @@ const $t = ({
|
|
|
1211
1206
|
$,
|
|
1212
1207
|
{
|
|
1213
1208
|
ariaLabelClose: g.close_aria,
|
|
1214
|
-
isOpen:
|
|
1215
|
-
onClose: () =>
|
|
1209
|
+
isOpen: y,
|
|
1210
|
+
onClose: () => _(!1),
|
|
1216
1211
|
title: c.add_new_title,
|
|
1217
1212
|
children: /* @__PURE__ */ e(
|
|
1218
|
-
|
|
1213
|
+
ze,
|
|
1219
1214
|
{
|
|
1220
1215
|
onAddBudget: A,
|
|
1221
1216
|
onRecalculateBudgets: C
|
|
@@ -1226,67 +1221,57 @@ const $t = ({
|
|
|
1226
1221
|
]
|
|
1227
1222
|
}
|
|
1228
1223
|
);
|
|
1229
|
-
},
|
|
1224
|
+
}, Vn = w(Ut), ae = {
|
|
1230
1225
|
CANCEL_DELETE: "Cancel - Delete",
|
|
1231
1226
|
END_SAVE: "End - Save",
|
|
1232
1227
|
END_DELETE: "End - Delete",
|
|
1233
1228
|
START_DELETE: "Start - Delete"
|
|
1234
|
-
},
|
|
1229
|
+
}, Ht = ({ onClose: t, onEvent: o, onViewHistory: i }) => {
|
|
1235
1230
|
const {
|
|
1236
1231
|
alert: s,
|
|
1237
1232
|
dateRange: a,
|
|
1238
1233
|
deleteBudget: r,
|
|
1239
|
-
selectedBudget:
|
|
1234
|
+
selectedBudget: n,
|
|
1240
1235
|
selectedSubBudget: c,
|
|
1241
1236
|
setAlert: g,
|
|
1242
1237
|
setSelectedBudget: d,
|
|
1243
|
-
updateBudget:
|
|
1244
|
-
} = E(), { budgets: p, common: h } = D(), { isCopyLoaded:
|
|
1238
|
+
updateBudget: u
|
|
1239
|
+
} = E(), { budgets: p, common: h } = D(), { isCopyLoaded: b, selectedAccountGuids: y } = q(), _ = $e(), { setFilter: x } = J(), [A, C] = l.useState(""), [f, B] = l.useState(null), [I, L] = l.useState(!1), R = l.useRef(!1);
|
|
1245
1240
|
if (l.useEffect(() => {
|
|
1246
|
-
!
|
|
1247
|
-
accounts:
|
|
1241
|
+
!n || c || (C(`${n.amount}`), x({
|
|
1242
|
+
accounts: y,
|
|
1248
1243
|
dateRange: a,
|
|
1249
|
-
custom: ({ category_guid:
|
|
1250
|
-
const { category_guid:
|
|
1251
|
-
return
|
|
1244
|
+
custom: ({ category_guid: G, top_level_category_guid: W }) => {
|
|
1245
|
+
const { category_guid: V } = n;
|
|
1246
|
+
return G === V || W === V;
|
|
1252
1247
|
},
|
|
1253
1248
|
showSplits: !0
|
|
1254
|
-
}),
|
|
1255
|
-
}, [
|
|
1256
|
-
if (!
|
|
1249
|
+
}), L(!0));
|
|
1250
|
+
}, [n]), !b) return /* @__PURE__ */ e(ge, {});
|
|
1251
|
+
if (!n) return null;
|
|
1257
1252
|
const O = () => {
|
|
1258
|
-
C(""), B(null),
|
|
1253
|
+
C(""), B(null), L(!1), setTimeout(() => {
|
|
1259
1254
|
d(void 0), t?.();
|
|
1260
1255
|
}, 250);
|
|
1261
|
-
},
|
|
1262
|
-
f === "delete" &&
|
|
1256
|
+
}, z = () => {
|
|
1257
|
+
f === "delete" && o?.(ae.CANCEL_DELETE, A), C(n.amount ? `${n.amount}` : ""), B(null);
|
|
1263
1258
|
}, k = async () => {
|
|
1264
1259
|
if (f === "edit") {
|
|
1265
1260
|
if (R.current) return;
|
|
1266
|
-
R.current = !0, await
|
|
1267
|
-
...
|
|
1261
|
+
R.current = !0, await u({
|
|
1262
|
+
...n,
|
|
1268
1263
|
amount: Number(A)
|
|
1269
|
-
}),
|
|
1270
|
-
|
|
1264
|
+
}), o?.(ae.END_SAVE, A), g(
|
|
1265
|
+
N(p.alert_budget_updated, n.category.name)
|
|
1271
1266
|
), B(null), R.current = !1;
|
|
1272
1267
|
}
|
|
1273
|
-
f === "delete" && (await r(
|
|
1274
|
-
},
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
},
|
|
1281
|
-
near: {
|
|
1282
|
-
iconColor: "warning"
|
|
1283
|
-
}
|
|
1284
|
-
};
|
|
1285
|
-
let X = K.on;
|
|
1286
|
-
F >= 100 ? X = K.off : F >= 50 && (X = K.near);
|
|
1287
|
-
const { iconColor: se } = X, Oe = (Y, _e) => M(Y, /* @__PURE__ */ e("b", { children: _e }));
|
|
1288
|
-
return /* @__PURE__ */ u(l.Fragment, { children: [
|
|
1289
|
-
/* @__PURE__ */ u(
|
|
1268
|
+
f === "delete" && (await r(n.guid), o?.(ae.END_DELETE, A), O());
|
|
1269
|
+
}, { remainingAmount: he, spentPercentage: fe, iconColor: ne } = ut(
|
|
1270
|
+
n.transaction_total ?? 0,
|
|
1271
|
+
n.amount ?? 0
|
|
1272
|
+
), ye = (G, W) => N(G, /* @__PURE__ */ e("b", { children: W }));
|
|
1273
|
+
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
1274
|
+
/* @__PURE__ */ m(
|
|
1290
1275
|
$,
|
|
1291
1276
|
{
|
|
1292
1277
|
ariaLabelClose: h.close_aria,
|
|
@@ -1301,7 +1286,7 @@ const $t = ({
|
|
|
1301
1286
|
/* EDIT */
|
|
1302
1287
|
),
|
|
1303
1288
|
onSecondaryAction: () => {
|
|
1304
|
-
|
|
1289
|
+
o?.(ae.START_DELETE, A), B(
|
|
1305
1290
|
"delete"
|
|
1306
1291
|
/* DELETE */
|
|
1307
1292
|
);
|
|
@@ -1314,102 +1299,58 @@ const $t = ({
|
|
|
1314
1299
|
pr: 24
|
|
1315
1300
|
}
|
|
1316
1301
|
},
|
|
1317
|
-
title:
|
|
1302
|
+
title: N(p.details_type_title, n.category.name),
|
|
1318
1303
|
children: [
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
|
|
1304
|
+
/* @__PURE__ */ e(
|
|
1305
|
+
ot,
|
|
1321
1306
|
{
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
sx: {
|
|
1333
|
-
alignItems: "center",
|
|
1334
|
-
flexDirection: "row",
|
|
1335
|
-
gap: 12,
|
|
1336
|
-
justifyContent: "space-between",
|
|
1337
|
-
pt: 16,
|
|
1338
|
-
px: 24
|
|
1339
|
-
},
|
|
1340
|
-
children: [
|
|
1341
|
-
/* @__PURE__ */ e(Ce, { bold: !0, variant: "subtitle1", children: _t(o.start_date) }),
|
|
1342
|
-
i && /* @__PURE__ */ e(De, { endIcon: /* @__PURE__ */ e(ft, {}), onClick: i, sx: { height: 28 }, children: /* @__PURE__ */ e(S, { bold: !0, variant: "body2", children: "Spending History" }) })
|
|
1343
|
-
]
|
|
1344
|
-
}
|
|
1345
|
-
),
|
|
1346
|
-
/* @__PURE__ */ e(
|
|
1347
|
-
bt,
|
|
1348
|
-
{
|
|
1349
|
-
amount: /* @__PURE__ */ u(x, { sx: { alignItems: "baseline", flexDirection: "row", gap: 4 }, children: [
|
|
1350
|
-
/* @__PURE__ */ e(Ge, { children: T(o.transaction_total, "0,0.00") }),
|
|
1351
|
-
/* @__PURE__ */ e(Ce, { color: "text.secondary", variant: "body2", children: "/" }),
|
|
1352
|
-
/* @__PURE__ */ e(Ce, { color: "text.secondary", variant: "body2", children: T(o.amount, "0,0.00") })
|
|
1353
|
-
] }),
|
|
1354
|
-
completeColor: `${se}.main`,
|
|
1355
|
-
icon: /* @__PURE__ */ e(
|
|
1356
|
-
H,
|
|
1357
|
-
{
|
|
1358
|
-
categoryGuid: o.category.guid,
|
|
1359
|
-
size: 44,
|
|
1360
|
-
sx: {
|
|
1361
|
-
bgcolor: at(Le(o.category.guid, y), 0.15),
|
|
1362
|
-
border: `1px solid ${Le(o.category.guid, y)}`,
|
|
1363
|
-
color: "text.primary"
|
|
1364
|
-
}
|
|
1365
|
-
}
|
|
1366
|
-
),
|
|
1367
|
-
label: Oe(
|
|
1368
|
-
p.spent_label,
|
|
1369
|
-
Ct(new Date(o.start_date * 1e3), { month: "short" })
|
|
1370
|
-
),
|
|
1371
|
-
leftLabel: M(p.percent_spent, F.toFixed()),
|
|
1372
|
-
percentComplete: F,
|
|
1373
|
-
rightLabel: M(
|
|
1374
|
-
p.balance_left,
|
|
1375
|
-
T(re, "0,0.00")
|
|
1376
|
-
),
|
|
1377
|
-
sx: {
|
|
1378
|
-
pb: 24,
|
|
1379
|
-
pt: 16,
|
|
1380
|
-
px: 24
|
|
1381
|
-
}
|
|
1307
|
+
amount: n.amount,
|
|
1308
|
+
icon: /* @__PURE__ */ e(
|
|
1309
|
+
H,
|
|
1310
|
+
{
|
|
1311
|
+
categoryGuid: n.category.guid,
|
|
1312
|
+
size: 44,
|
|
1313
|
+
sx: {
|
|
1314
|
+
bgcolor: Qe(Ee(n.category.guid, _), 0.15),
|
|
1315
|
+
border: `1px solid ${Ee(n.category.guid, _)}`,
|
|
1316
|
+
color: "text.primary"
|
|
1382
1317
|
}
|
|
1383
|
-
|
|
1384
|
-
|
|
1318
|
+
}
|
|
1319
|
+
),
|
|
1320
|
+
iconColor: ne,
|
|
1321
|
+
onViewHistory: i,
|
|
1322
|
+
remainingAmount: he,
|
|
1323
|
+
spentPercentage: fe,
|
|
1324
|
+
startDate: n.start_date,
|
|
1325
|
+
totalTransaction: n.transaction_total
|
|
1385
1326
|
}
|
|
1386
1327
|
),
|
|
1387
|
-
/* @__PURE__ */ e(
|
|
1328
|
+
/* @__PURE__ */ e(xe, {}),
|
|
1388
1329
|
s && /* @__PURE__ */ e(
|
|
1389
|
-
|
|
1330
|
+
Ae,
|
|
1390
1331
|
{
|
|
1391
1332
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
1392
1333
|
autoHideDuration: 3500,
|
|
1393
1334
|
onClose: () => g(""),
|
|
1394
1335
|
open: !!s,
|
|
1395
|
-
children: /* @__PURE__ */ e(
|
|
1336
|
+
children: /* @__PURE__ */ e(Se, { closeText: "", onClose: () => g(""), severity: "success", variant: "filled", children: s })
|
|
1396
1337
|
}
|
|
1397
1338
|
)
|
|
1398
1339
|
]
|
|
1399
1340
|
}
|
|
1400
1341
|
),
|
|
1401
1342
|
f && /* @__PURE__ */ e(
|
|
1402
|
-
|
|
1343
|
+
mt,
|
|
1403
1344
|
{
|
|
1404
1345
|
closeAriaLabel: h.close_aria,
|
|
1405
|
-
content:
|
|
1346
|
+
content: ye(
|
|
1406
1347
|
p[f === "edit" ? "edit_budget_content" : "delete_description"],
|
|
1407
|
-
|
|
1348
|
+
n.category.name
|
|
1408
1349
|
),
|
|
1409
|
-
handleInputChange: (
|
|
1410
|
-
handleModalClose:
|
|
1350
|
+
handleInputChange: (G) => C(G.toString()),
|
|
1351
|
+
handleModalClose: z,
|
|
1411
1352
|
handlePrimaryAction: k,
|
|
1412
|
-
handleSecondaryAction:
|
|
1353
|
+
handleSecondaryAction: z,
|
|
1413
1354
|
inputLabel: f === "edit" ? p.details_edit_title : "",
|
|
1414
1355
|
inputValue: A,
|
|
1415
1356
|
isOpen: !0,
|
|
@@ -1421,9 +1362,9 @@ const $t = ({
|
|
|
1421
1362
|
}
|
|
1422
1363
|
)
|
|
1423
1364
|
] });
|
|
1424
|
-
},
|
|
1365
|
+
}, Kn = w(Ht);
|
|
1425
1366
|
export {
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1367
|
+
Vn as BubbleBudgetsMiniWidget,
|
|
1368
|
+
Wn as BubbleBudgetsWidget,
|
|
1369
|
+
Kn as BudgetDetailsDrawerV2
|
|
1429
1370
|
};
|