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