@mx-cartographer/experiences 7.0.52-alpha.mega4 → 7.0.52-alpha.mega6

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