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