@mx-cartographer/experiences 7.11.20 → 7.11.21

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