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