@mx-cartographer/experiences 8.0.0-alpha.sms2 → 9.0.0-alpha.mega1

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 (139) hide show
  1. package/CHANGELOG.md +217 -0
  2. package/dist/{Account-Cp30A3ad.mjs → Account-BIKn4XEZ.mjs} +1 -1
  3. package/dist/Account-CMjOp7S2.mjs +118 -0
  4. package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
  5. package/dist/AccountDetailsHeader-BOV91g1o.mjs +95 -0
  6. package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
  7. package/dist/{AccountFields-CW6cIthP.mjs → AccountFields-BRRH37K1.mjs} +10 -11
  8. package/dist/{AccountListItem-DxmAs98Z.mjs → AccountListItem-Ds5C0mOT.mjs} +4 -4
  9. package/dist/{AccountStore-hIs-yA6W.mjs → AccountStore-BFKvXJSD.mjs} +79 -69
  10. package/dist/{Accounts-DUHkUyK4.mjs → Accounts-CuE8aSZN.mjs} +1 -1
  11. package/dist/{BudgetUtil-CIDAPPPT.mjs → BudgetUtil-CDSOZXem.mjs} +4 -4
  12. package/dist/CategorySelectorDrawer-C4aZYP4N.mjs +418 -0
  13. package/dist/CategoryStore-DEqAnHbi.mjs +186 -0
  14. package/dist/{CategoryUtil-DfVKKkRf.mjs → CategoryUtil-CFHBvaV4.mjs} +1 -1
  15. package/dist/{ConnectionsDrawer-CSo6AFkG.mjs → ConnectionsDrawer-BExzgE16.mjs} +5 -5
  16. package/dist/{CurrencyInput-BrGvhgVK.mjs → CurrencyInput-DDQ4DBrE.mjs} +1 -1
  17. package/dist/{CurrencyText-Dr0EZ7bp.mjs → CurrencyText-C-85TnUF.mjs} +3 -3
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CVsMhbZU.mjs} +3 -3
  19. package/dist/{DebtsStore-hi1cqrRk.mjs → DebtsStore-Dv_T7Dts.mjs} +12 -12
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-CWymUiuO.mjs} +32 -35
  21. package/dist/Drawer-Bet2ZPJo.mjs +176 -0
  22. package/dist/{ExportCsvAction-CQ1grpwo.mjs → ExportCsvAction-oG_Mn66T.mjs} +3 -3
  23. package/dist/{FinstrongStore-dKZOZ2hM.mjs → FinstrongStore-BjFkMTIL.mjs} +6 -6
  24. package/dist/GlobalAccountFilter-BpWlPAl5.mjs +316 -0
  25. package/dist/{GoalStore-CFeAJloA.mjs → GoalStore-Dbjgft2i.mjs} +155 -137
  26. package/dist/{Help-i4OasOO-.mjs → Help-BW_ar-4B.mjs} +2 -2
  27. package/dist/LineChart-DHj-Bufi.mjs +580 -0
  28. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-Cbr3417C.mjs} +10 -10
  29. package/dist/{ManageIncome-D_qVX5dN.mjs → ManageIncome-DIIyqDTp.mjs} +85 -85
  30. package/dist/{MicroWidgetContainer-BGpNl5ZS.mjs → MicroWidgetContainer-DSyYwRCU.mjs} +2 -2
  31. package/dist/{MiniWidgetContainer-D7MkHG15.mjs → MiniWidgetContainer-DKn7ndO6.mjs} +1 -1
  32. package/dist/NetWorthStore-B6ziBtaH.mjs +168 -0
  33. package/dist/NotificationSettings-e789PcRb.mjs +676 -0
  34. package/dist/{OriginalBalanceAction-62e0mU_3.mjs → OriginalBalanceAction-DFoG79Ba.mjs} +3 -3
  35. package/dist/{RecurringSettings-RfZ8Wuhh.mjs → RecurringSettings-BpCUcE8w.mjs} +4 -4
  36. package/dist/{RecurringTransactionsStore-D3EOKZ2B.mjs → RecurringTransactionsStore-D_--5PWH.mjs} +1 -1
  37. package/dist/{RecurringTransactions-Bhx56aA3.mjs → RepeatingTransaction-C2txVA9O.mjs} +3 -3
  38. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-CInvh-rQ.mjs} +1 -1
  39. package/dist/SpendingData-B7NuTQ9s.mjs +53 -0
  40. package/dist/SpendingLegend-BxefXiQd.mjs +193 -0
  41. package/dist/TransactionDetails-CPwv9xtZ.mjs +1374 -0
  42. package/dist/{TransactionStore-DgLrYW4C.mjs → TransactionStore-D2aMUClq.mjs} +128 -111
  43. package/dist/TrendsStore-BdsYfCc7.mjs +183 -0
  44. package/dist/{User-DqNX2GAK.mjs → User-CulNdZUr.mjs} +21 -20
  45. package/dist/ViewMoreMicroCard-CDWR16_h.mjs +1147 -0
  46. package/dist/WidgetContainer-mzejMmz2.mjs +555 -0
  47. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +1 -0
  48. package/dist/accounts/index.es.js +933 -232
  49. package/dist/accounts/stores/AccountStore.d.ts +6 -2
  50. package/dist/accounts/utils/AccountDetails.d.ts +5 -0
  51. package/dist/analytics/index.es.js +2 -2
  52. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  53. package/dist/budgets/index.es.js +561 -522
  54. package/dist/cashflow/index.es.js +397 -396
  55. package/dist/categories/components/CustomCategories/AddSubcategory.d.ts +1 -0
  56. package/dist/categories/components/CustomCategories/DeleteSubcategory.d.ts +1 -0
  57. package/dist/categories/components/CustomCategories/RenameSubcategory.d.ts +1 -0
  58. package/dist/categories/components/SubcategoryRow.d.ts +1 -0
  59. package/dist/categories/index.es.js +2 -2
  60. package/dist/categories/stores/CategoryStore.d.ts +5 -3
  61. package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
  62. package/dist/common/components/WidgetContainer.d.ts +7 -6
  63. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  64. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  65. package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
  66. package/dist/common/components/index.d.ts +2 -2
  67. package/dist/common/hooks/index.d.ts +1 -0
  68. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  69. package/dist/common/index.es.js +325 -306
  70. package/dist/common/stores/GlobalUiStore.d.ts +7 -4
  71. package/dist/common/types/localization/AccountsCopy.d.ts +6 -0
  72. package/dist/common/types/localization/CategoryCopy.d.ts +3 -0
  73. package/dist/common/types/localization/CommonCopy.d.ts +3 -0
  74. package/dist/common/types/localization/GoalsCopy.d.ts +3 -1
  75. package/dist/common/types/localization/MicroInsightsCopy.d.ts +1 -0
  76. package/dist/common/types/localization/TransactionsCopy.d.ts +4 -0
  77. package/dist/common/types/localization/TrendsCopy.d.ts +4 -0
  78. package/dist/dashboard/index.es.js +95 -125
  79. package/dist/debts/index.es.js +466 -460
  80. package/dist/{exportTransactionsToCSV-BFpuIAXW.mjs → exportTransactionsToCSV-BU1jTY0Q.mjs} +4 -4
  81. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  82. package/dist/finstrong/index.es.js +1660 -1553
  83. package/dist/goals/index.es.js +716 -677
  84. package/dist/goals/stores/GoalStore.d.ts +2 -0
  85. package/dist/help/index.es.js +14 -10
  86. package/dist/{hooks-C41HAxM5.mjs → hooks-fY_n74f7.mjs} +16 -16
  87. package/dist/investments/index.es.js +464 -457
  88. package/dist/merchants/index.es.js +1 -1
  89. package/dist/microinsights/MicroCardTemplate.d.ts +23 -0
  90. package/dist/microinsights/beaticons/BeatMaterialIcon.d.ts +8 -0
  91. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +1 -2
  92. package/dist/microinsights/beaticons/index.d.ts +1 -0
  93. package/dist/microinsights/cards/InsightCard.d.ts +0 -2
  94. package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +2 -5
  95. package/dist/microinsights/index.d.ts +2 -2
  96. package/dist/microinsights/index.es.js +824 -14
  97. package/dist/networth/components/NetWorthChart.d.ts +3 -2
  98. package/dist/networth/components/NetWorthList.d.ts +3 -3
  99. package/dist/networth/index.es.js +433 -438
  100. package/dist/networth/stores/NetWorthStore.d.ts +20 -9
  101. package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
  102. package/dist/notifications/index.es.js +5 -5
  103. package/dist/recurringtransactions/index.es.js +331 -325
  104. package/dist/settings/index.es.js +293 -285
  105. package/dist/spending/components/SpendingChart.d.ts +1 -1
  106. package/dist/spending/components/SpendingList.d.ts +1 -1
  107. package/dist/spending/components/SpendingTabLabel.d.ts +1 -0
  108. package/dist/spending/index.es.js +250 -235
  109. package/dist/transactions/index.es.js +288 -281
  110. package/dist/transactions/stores/TransactionStore.d.ts +5 -0
  111. package/dist/trends/components/TrendsTable.d.ts +0 -2
  112. package/dist/trends/index.es.js +876 -802
  113. package/dist/trends/utils/TrendsData.d.ts +1 -0
  114. package/dist/trends/utils/TrendsTable.d.ts +12 -0
  115. package/dist/{useAccountDisplayName-usSZCQ7I.mjs → useAccountDisplayName-DbkgGLdg.mjs} +2 -2
  116. package/dist/useAriaLive-B3_pRUio.mjs +35 -0
  117. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-dhmXeSyF.mjs} +1 -1
  118. package/dist/useWidgetLoadTimer-CrUzxN-P.mjs +19 -0
  119. package/package.json +26 -21
  120. package/dist/AccountDetailsContent-C1HumFnW.mjs +0 -683
  121. package/dist/AccountDetailsHeader-NMx79DGs.mjs +0 -87
  122. package/dist/CategorySelectorDrawer-DqDAA_5I.mjs +0 -399
  123. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  124. package/dist/ConnectDrawer-Dn1MlqLz.mjs +0 -545
  125. package/dist/Drawer-Dqe5EqvA.mjs +0 -163
  126. package/dist/LineChart-bc1D9xBE.mjs +0 -581
  127. package/dist/NetWorthStore-8FFC1Bs0.mjs +0 -150
  128. package/dist/NotificationSettings-BsWiYD94.mjs +0 -672
  129. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  130. package/dist/SpendingLegend-CZzDb-7d.mjs +0 -193
  131. package/dist/TransactionDetails-Duv1X9ec.mjs +0 -1379
  132. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  133. package/dist/ViewMoreMicroCard-CH9E-jOx.mjs +0 -1930
  134. package/dist/WidgetContainer-B1Jzb4XA.mjs +0 -565
  135. package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
  136. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
  137. package/dist/common/components/accountfilter/index.d.ts +0 -1
  138. package/dist/microinsights/cards/BaseCard.d.ts +0 -13
  139. package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
@@ -1,69 +1,70 @@
1
- import { jsx as e, jsxs as s, Fragment as H } from "react/jsx-runtime";
2
- import g from "react";
3
- import { observer as D } from "mobx-react-lite";
4
- import w from "@mui/material/Stack";
5
- import { useTheme as X, Card as _e, Stack as _, Box as W } from "@mui/material";
6
- import { Text as l, H3 as De, InstitutionLogo as Te, Icon as te } from "@mxenabled/mxui";
7
- import { intervalToDuration as Ae, formatDuration as Ee } from "date-fns";
1
+ import { jsx as e, jsxs as s, Fragment as O } from "react/jsx-runtime";
2
+ import x from "react";
3
+ import { observer as v } from "mobx-react-lite";
4
+ import g from "@mui/material/Stack";
5
+ import { useTheme as V, Card as _e, Stack as _, Box as W } from "@mui/material";
6
+ import { Text as l, P as ye, H3 as Te, InstitutionLogo as Ae, Icon as te } from "@mxenabled/mxui";
7
+ import { intervalToDuration as Ee, formatDuration as Ie } from "date-fns";
8
8
  import { addMonths as se } from "date-fns/addMonths";
9
9
  import { fromUnixTime as ce } from "date-fns/fromUnixTime";
10
10
  import { getUnixTime as de } from "date-fns/getUnixTime";
11
- import { D as P, M as Ie, I as Be } from "../DebtsStore-hi1cqrRk.mjs";
12
- import { a as Lr } from "../DebtsStore-hi1cqrRk.mjs";
13
- import { f as U, a as q } from "../Dialog-CDV0kKxj.mjs";
14
- import { f as k, a as Me } from "../NumberFormatting-DjTD0t3W.mjs";
15
- import { G as Pe, x as Z, u as S, l as V, g as F, d as J, n as ke, b as Ne } from "../hooks-C41HAxM5.mjs";
16
- import { u as Y } from "../useScreenSize-B6JyS_Lj.mjs";
17
- import { D as re } from "../Drawer-Dqe5EqvA.mjs";
18
- import { b as I } from "../Localization-2MODESHW.mjs";
19
- import { A as Fe, u as Re } from "../AccountDetailsHeader-NMx79DGs.mjs";
11
+ import { D as k, M as Be, I as Me } from "../DebtsStore-Dv_T7Dts.mjs";
12
+ import { a as Or } from "../DebtsStore-Dv_T7Dts.mjs";
13
+ import { f as U, D as q } from "../Dialog-CWymUiuO.mjs";
14
+ import { f as N, a as Pe } from "../NumberFormatting-DjTD0t3W.mjs";
15
+ import { G as ke, w as Z, u as S, l as Y, g as F, d as J, b as Ne } from "../hooks-fY_n74f7.mjs";
16
+ import { u as K } from "../useScreenSize-B6JyS_Lj.mjs";
17
+ import { D as re } from "../Drawer-Bet2ZPJo.mjs";
18
+ import { b as E } from "../Localization-2MODESHW.mjs";
19
+ import { A as Re, u as Fe } from "../AccountDetailsHeader-BOV91g1o.mjs";
20
20
  import Le from "@mui/material/Card";
21
21
  import $e from "@mui/material/CardContent";
22
- import He from "@mui/material/CardHeader";
23
- import { LineChart as Oe } from "@mui/x-charts";
22
+ import Oe from "@mui/material/CardHeader";
24
23
  import ae from "@mui/material/Box";
25
- import { useTheme as We } from "@mui/material/styles";
26
- import { A as T, W as Ge } from "../WidgetContainer-B1Jzb4XA.mjs";
24
+ import { useTheme as He } from "@mui/material/styles";
25
+ import { LineChart as Ge } from "@mui/x-charts/LineChart";
26
+ import { A as T, W as We } from "../WidgetContainer-mzejMmz2.mjs";
27
27
  import pe from "@mui/material/Tab";
28
28
  import je from "@mui/material/Tabs";
29
- import ye from "@mui/material/List";
30
- import G from "@mui/material/Divider";
31
- import { M as ze, I as Xe, O as Ve } from "../OriginalBalanceAction-62e0mU_3.mjs";
29
+ import fe from "@mui/material/List";
30
+ import j from "@mui/material/Divider";
31
+ import { M as ze, I as Xe, O as Ve } from "../OriginalBalanceAction-DFoG79Ba.mjs";
32
32
  import Ye from "@mui/material/TextField";
33
- import { L as Q } from "../ListItemAction-BNCWQAN_.mjs";
34
- import { C as ne } from "../CurrencyInput-BrGvhgVK.mjs";
33
+ import { L as Q } from "../ListItemAction-Cbr3417C.mjs";
34
+ import { C as oe } from "../CurrencyInput-DDQ4DBrE.mjs";
35
35
  import me from "@mui/material/Alert";
36
36
  import he from "@mui/material/AlertTitle";
37
37
  import ue from "@mui/material/Paper";
38
- import { Error as Ke, CheckCircle as fe } from "@mxenabled/mx-icons";
38
+ import { Error as Ke, CheckCircle as ge } from "@mxenabled/mx-icons";
39
39
  import { T as be } from "../TabContentContainer-CnMXkVqr.mjs";
40
40
  import { DataGridPro as Ue } from "@mui/x-data-grid-pro";
41
- import { H as j } from "../HeaderCell-DjuifqHJ.mjs";
42
- import { h as qe } from "../ConnectDrawer-Dn1MlqLz.mjs";
41
+ import { H as z } from "../HeaderCell-DjuifqHJ.mjs";
42
+ import { e as qe, A as X } from "../Account-CMjOp7S2.mjs";
43
43
  import xe from "@mui/material/Button";
44
44
  import Ze from "@mui/material/IconButton";
45
45
  import Je from "@mui/material/ListItem";
46
46
  import Qe from "@mui/material/Popover";
47
47
  import { L as et } from "../Loader-BSWSYqvn.mjs";
48
- const tt = (a, n = 0, r = 0) => {
48
+ import { u as tt } from "../useWidgetLoadTimer-CrUzxN-P.mjs";
49
+ const rt = (a, o = 0, r = 0) => {
49
50
  if (r === 0) return 0;
50
- const t = n / (Ie * Be);
51
+ const t = o / (Be * Me);
51
52
  return Math.ceil(
52
53
  t === 0 ? a / r : -Math.log(1 - t * a / r) / Math.log(1 + t)
53
54
  );
54
- }, rt = (a, n, r, t, o) => {
55
+ }, at = (a, o, r, t, n) => {
55
56
  const i = [];
56
57
  if (r === 0) {
57
58
  for (let c = 0; c < a; c++) {
58
- const d = n - t * (c + 1), m = n - t * c, u = d >= 0 ? t : m;
59
+ const p = o - t * (c + 1), m = o - t * c, b = p >= 0 ? t : m;
59
60
  i.push({
60
- balance: d >= 0 ? d : 0,
61
+ balance: p >= 0 ? p : 0,
61
62
  interest: r,
62
- payment: u,
63
- principal: u,
63
+ payment: b,
64
+ principal: b,
64
65
  timestamp: de(
65
66
  se(
66
- ce(o),
67
+ ce(n),
67
68
  // convert seconds → Date
68
69
  c + 1
69
70
  // add (index + 1) months
@@ -73,99 +74,99 @@ const tt = (a, n = 0, r = 0) => {
73
74
  }
74
75
  return i;
75
76
  }
76
- const p = r / 1200;
77
+ const d = r / 1200;
77
78
  for (let c = 0; c < a; c++) {
78
- const d = de(se(ce(o), c + 1)), m = Math.pow(1 + p, c), u = n * m - t * ((m - 1) / p), x = Math.pow(1 + p, c + 1), h = n * x - t * ((x - 1) / p), v = t + Math.min(h, 0), B = u * p;
79
+ const p = de(se(ce(n), c + 1)), m = Math.pow(1 + d, c), b = o * m - t * ((m - 1) / d), w = Math.pow(1 + d, c + 1), h = o * w - t * ((w - 1) / d), A = t + Math.min(h, 0), B = b * d;
79
80
  i.push({
80
81
  balance: Math.max(0, h),
81
82
  interest: B,
82
- payment: v,
83
- principal: v - B,
84
- timestamp: d
83
+ payment: A,
84
+ principal: A - B,
85
+ timestamp: p
85
86
  });
86
87
  }
87
88
  return i;
88
- }, at = (a) => (a[a.length - 1] || {}).timestamp, nt = (a) => {
89
- const { monthly_payment: n, interest_rate: r, balance: t, payment_due_date: o } = a, i = tt(t, r ?? 0, n ?? 0), p = rt(
89
+ }, ot = (a) => (a[a.length - 1] || {}).timestamp, nt = (a) => {
90
+ const { monthly_payment: o, interest_rate: r, balance: t, payment_due_date: n } = a, i = rt(t, r ?? 0, o ?? 0), d = at(
90
91
  i,
91
92
  t,
92
93
  r ?? 0,
93
- n ?? 0,
94
- o
95
- ), c = at(p);
94
+ o ?? 0,
95
+ n
96
+ ), c = ot(d);
96
97
  return {
97
98
  ...a,
98
99
  minimumFinalPayment: c,
99
- minimumPayments: p
100
+ minimumPayments: d
100
101
  };
101
- }, ge = (a, n) => {
102
+ }, we = (a, o) => {
102
103
  const [r, t] = a.reduce(
103
- ([o, i], p) => (p.is_paid_off || p.is_impossible ? i.push({ ...p, minimumPayments: [] }) : o.push(nt(p)), [o, i]),
104
+ ([n, i], d) => (d.is_paid_off || d.is_impossible ? i.push({ ...d, minimumPayments: [] }) : n.push(nt(d)), [n, i]),
104
105
  [[], []]
105
106
  );
106
- switch (n) {
107
- case P.FASTEST_PAYOFF_FIRST:
108
- r.sort((o, i) => (o.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
107
+ switch (o) {
108
+ case k.FASTEST_PAYOFF_FIRST:
109
+ r.sort((n, i) => (n.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
109
110
  break;
110
- case P.HIGHEST_INTEREST:
111
- r.sort((o, i) => (i.interest_rate ?? 0) - (o.interest_rate ?? 0));
111
+ case k.HIGHEST_INTEREST:
112
+ r.sort((n, i) => (i.interest_rate ?? 0) - (n.interest_rate ?? 0));
112
113
  break;
113
- case P.LOWEST_BALANCE:
114
- r.sort((o, i) => o.balance - i.balance);
114
+ case k.LOWEST_BALANCE:
115
+ r.sort((n, i) => n.balance - i.balance);
115
116
  break;
116
- case P.HIGHEST_BALANCE:
117
- r.sort((o, i) => i.balance - o.balance);
117
+ case k.HIGHEST_BALANCE:
118
+ r.sort((n, i) => i.balance - n.balance);
118
119
  break;
119
120
  default:
120
- r.sort((o, i) => o.balance - i.balance);
121
+ r.sort((n, i) => n.balance - i.balance);
121
122
  }
122
123
  a.splice(0, a.length, ...r, ...t);
123
124
  };
124
- function ot(a, n, r = 0) {
125
- const t = a.map((u) => ({ ...u })).filter(
126
- (u) => u.interest_rate !== void 0 && u.monthly_payment !== void 0 && !u.is_paid_off
125
+ function it(a, o, r = 0) {
126
+ const t = a.map((b) => ({ ...b })).filter(
127
+ (b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
127
128
  );
128
- ge(t, n);
129
- let o = 0, i = 0;
130
- const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
131
- for (; t.some((u) => u.balance >= 0.01 && !u.is_impossible); ) {
132
- let u = !1;
133
- for (const [x, h] of t.entries()) {
129
+ we(t, o);
130
+ let n = 0, i = 0;
131
+ const d = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
132
+ for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
133
+ let b = !1;
134
+ for (const [w, h] of t.entries()) {
134
135
  if (h.balance <= 0.01 || h.is_impossible) continue;
135
- const B = (h.interest_rate ?? 0) / 100 / 12, N = h.balance * B;
136
+ const B = (h.interest_rate ?? 0) / 100 / 12, M = h.balance * B;
136
137
  let C = h.monthly_payment ?? 0;
137
- x === 0 && r && (C += r), h.balance += N;
138
- const A = Math.min(h.balance, C + i);
139
- if (A <= N) {
138
+ w === 0 && r && (C += r), h.balance += M;
139
+ const I = Math.min(h.balance, C + i);
140
+ if (I <= M) {
140
141
  h.is_impossible = !0;
141
142
  continue;
142
143
  }
143
- h.balance -= A, h.balance = h.balance < 0.01 ? 0 : h.balance, o += N, h.balance <= 0 && (i += C), A > 0 && (u = !0);
144
+ h.balance -= I, h.balance = h.balance < 0.01 ? 0 : h.balance, n += M, h.balance <= 0 && (i += C), I > 0 && (b = !0);
144
145
  }
145
- u && c.setMonth(c.getMonth() + 1);
146
+ b && c.setMonth(c.getMonth() + 1);
146
147
  }
147
- const d = t.some((u) => u.is_impossible && u.balance > 0), m = Ae({ start: p, end: c });
148
+ const p = t.some((b) => b.is_impossible && b.balance > 0), m = Ee({ start: d, end: c });
148
149
  return {
149
- payoffSavings: d ? "N/A" : k(o, "0,0.00"),
150
- payoffDate: d ? "Never" : U(c, q.MONTH_YEAR),
151
- payoffDuration: d ? "Stagnant" : Ee(m, { format: ["years", "months"] }) || "0 months"
150
+ payoffSavings: p ? "N/A" : N(n, "0,0.00"),
151
+ payoffDate: p ? "Never" : U(c, q.MONTH_YEAR),
152
+ payoffDuration: p ? "Stagnant" : Ie(m, { format: ["years", "months"] }) || "0 months"
152
153
  };
153
154
  }
154
155
  const L = () => {
155
- if (!g.useContext(Pe))
156
+ if (!x.useContext(ke))
156
157
  throw new Error("useCateUiStore() must be used within the GlobalDataContext");
157
158
  return Z().uiStore;
158
- }, it = ({ debts: a, onClickCta: n, sx: r }) => {
159
- const t = X(), { isMobile: o } = Y(), { debts: i } = S(), { selectedDebtPriority: p } = L(), { monthlyCashFlowProfile: c } = V(), { payoffDate: d, payoffSavings: m, payoffDuration: u } = g.useMemo(() => {
160
- const x = c?.extra_payment ?? 0;
161
- return ot(a, p, x);
162
- }, [a, p, c]);
159
+ }, lt = ({ debts: a, onClickCta: o, sx: r }) => {
160
+ const t = V(), { isMobile: n } = K(), { debts: i } = S(), { selectedDebtPriority: d } = L(), { monthlyCashFlowProfile: c } = Y(), { payoffDate: p, payoffSavings: m, payoffDuration: b } = x.useMemo(() => {
161
+ const w = c?.extra_payment ?? 0;
162
+ return it(a, d, w);
163
+ }, [a, d, c]);
163
164
  return /* @__PURE__ */ e(
164
165
  _e,
165
166
  {
166
167
  sx: {
167
168
  boxShadow: t.shadows[2],
168
- width: o ? "100%" : "186px",
169
+ width: n ? "100%" : "186px",
169
170
  minWidth: "186px",
170
171
  ...r
171
172
  },
@@ -173,7 +174,7 @@ const L = () => {
173
174
  /* @__PURE__ */ s(
174
175
  _,
175
176
  {
176
- gap: o ? "4px" : "0",
177
+ gap: n ? "4px" : "0",
177
178
  sx: {
178
179
  borderBottom: "1px solid",
179
180
  borderBottomColor: t.palette.grey[300],
@@ -181,16 +182,16 @@ const L = () => {
181
182
  },
182
183
  children: [
183
184
  /* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_date_description }),
184
- /* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "Small", children: d })
185
+ /* @__PURE__ */ e(l, { bold: !0, color: t.palette.primary.main, variant: "Small", children: p })
185
186
  ]
186
187
  }
187
188
  ),
188
- /* @__PURE__ */ s(_, { gap: o ? "4px" : "0", children: [
189
+ /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
189
190
  /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: m }),
190
191
  /* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "XSmall", children: i.snowball_card_amount_description })
191
192
  ] }),
192
- /* @__PURE__ */ s(_, { gap: o ? "4px" : "0", children: [
193
- /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: u }),
193
+ /* @__PURE__ */ s(_, { gap: n ? "4px" : "0", children: [
194
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Small", children: b }),
194
195
  /* @__PURE__ */ e(l, { variant: "XSmall", children: i.snowball_card_duration_description })
195
196
  ] }),
196
197
  /* @__PURE__ */ e(
@@ -198,7 +199,7 @@ const L = () => {
198
199
  {
199
200
  bold: !0,
200
201
  color: t.palette.primary.main,
201
- onClick: n,
202
+ onClick: o,
202
203
  sx: { cursor: "pointer" },
203
204
  variant: "Small",
204
205
  children: i.snowball_card_cta
@@ -207,21 +208,21 @@ const L = () => {
207
208
  ] })
208
209
  }
209
210
  );
210
- }, lt = D(it), st = ({ isOpen: a, onClose: n }) => {
211
- const r = X(), { debts: t } = S(), [o, i] = g.useState(!1);
211
+ }, st = v(lt), ct = ({ isOpen: a, onClose: o }) => {
212
+ const r = V(), { debts: t } = S(), [n, i] = x.useState(!1);
212
213
  return /* @__PURE__ */ e(
213
214
  re,
214
215
  {
215
216
  ariaLabelClose: "",
216
217
  isOpen: a,
217
- onClose: n,
218
+ onClose: o,
218
219
  title: t.snowball_drawer_title,
219
220
  children: /* @__PURE__ */ s(_, { bgcolor: r.palette.background.default, height: "100%", children: [
220
221
  /* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
221
222
  /* @__PURE__ */ s(_, { alignItems: "center", pb: 24, children: [
222
223
  /* @__PURE__ */ e(l, { mb: 12, variant: "H3", children: t.snowball_drawer_subtitle }),
223
224
  /* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_amount_description }),
224
- /* @__PURE__ */ e(l, { variant: "H1", children: t.snowball_drawer_savings }),
225
+ /* @__PURE__ */ e(ye, { variant: "H1", children: t.snowball_drawer_savings }),
225
226
  /* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "Small", children: t.snowball_drawer_duration_description })
226
227
  ] }),
227
228
  /* @__PURE__ */ s(_e, { sx: { display: "grid", py: 16, px: 24 }, children: [
@@ -231,7 +232,7 @@ const L = () => {
231
232
  {
232
233
  color: r.palette.secondary.main,
233
234
  mb: 8,
234
- sx: { whiteSpace: o ? "normal" : "nowrap" },
235
+ sx: { whiteSpace: n ? "normal" : "nowrap" },
235
236
  variant: "ParagraphSmall",
236
237
  children: t.snowball_drawer_answer
237
238
  }
@@ -241,10 +242,10 @@ const L = () => {
241
242
  {
242
243
  bold: !0,
243
244
  color: r.palette.primary.main,
244
- onClick: () => i(!o),
245
+ onClick: () => i(!n),
245
246
  sx: { cursor: "pointer" },
246
247
  variant: "Small",
247
- children: o ? t.snowball_drawer_less : t.snowball_drawer_more
248
+ children: n ? t.snowball_drawer_less : t.snowball_drawer_more
248
249
  }
249
250
  )
250
251
  ] })
@@ -261,7 +262,7 @@ const L = () => {
261
262
  }
262
263
  ),
263
264
  /* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
264
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 1) }),
265
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 1) }),
265
266
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
266
267
  ] }),
267
268
  /* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
@@ -294,13 +295,13 @@ const L = () => {
294
295
  },
295
296
  children: [
296
297
  /* @__PURE__ */ s(_, { flexGrow: 1, children: [
297
- /* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "A") }),
298
+ /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "A") }),
298
299
  /* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
299
- I(
300
+ E(
300
301
  t.snowball_drawer_rollover_explainer_pt1,
301
302
  "$100"
302
303
  ),
303
- /* @__PURE__ */ e("strong", { children: I(t.snowball_drawer_debt_label, "B") }),
304
+ /* @__PURE__ */ e("strong", { children: E(t.snowball_drawer_debt_label, "B") }),
304
305
  t.snowball_drawer_rollover_explainer_pt2
305
306
  ] })
306
307
  ] }),
@@ -345,7 +346,7 @@ const L = () => {
345
346
  pr: 24
346
347
  },
347
348
  children: [
348
- /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "B") }),
349
+ /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "B") }),
349
350
  /* @__PURE__ */ e(l, { variant: "Body", children: "$400.00" })
350
351
  ]
351
352
  }
@@ -365,7 +366,7 @@ const L = () => {
365
366
  }
366
367
  ),
367
368
  /* @__PURE__ */ s(_, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
368
- /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }),
369
+ /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }),
369
370
  /* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
370
371
  ] })
371
372
  ] }),
@@ -388,7 +389,7 @@ const L = () => {
388
389
  )
389
390
  ] }),
390
391
  /* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
391
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 2) }),
392
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 2) }),
392
393
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
393
394
  ] }),
394
395
  /* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
@@ -421,13 +422,13 @@ const L = () => {
421
422
  },
422
423
  children: [
423
424
  /* @__PURE__ */ s(_, { flexGrow: 1, children: [
424
- /* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "B") }),
425
+ /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "B") }),
425
426
  /* @__PURE__ */ s(l, { color: r.palette.secondary.main, variant: "XSmall", children: [
426
- I(
427
+ E(
427
428
  t.snowball_drawer_rollover_explainer_pt1,
428
429
  "$500"
429
430
  ),
430
- /* @__PURE__ */ e("strong", { children: I(t.snowball_drawer_debt_label, "C") }),
431
+ /* @__PURE__ */ e("strong", { children: E(t.snowball_drawer_debt_label, "C") }),
431
432
  t.snowball_drawer_rollover_explainer_pt2
432
433
  ] })
433
434
  ] }),
@@ -471,7 +472,7 @@ const L = () => {
471
472
  pr: 24
472
473
  },
473
474
  children: [
474
- /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }),
475
+ /* @__PURE__ */ e(l, { flexGrow: 1, variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }),
475
476
  /* @__PURE__ */ e(l, { variant: "Body", children: "$1,000.00" })
476
477
  ]
477
478
  }
@@ -496,7 +497,7 @@ const L = () => {
496
497
  )
497
498
  ] }),
498
499
  /* @__PURE__ */ s(_, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
499
- /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: I(t.snowball_drawer_month_header, 3) }),
500
+ /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: E(t.snowball_drawer_month_header, 3) }),
500
501
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: t.snowball_drawer_payment_header })
501
502
  ] }),
502
503
  /* @__PURE__ */ s(_, { bgcolor: r.palette.background.paper, mb: 24, children: [
@@ -528,7 +529,7 @@ const L = () => {
528
529
  pr: 24
529
530
  },
530
531
  children: [
531
- /* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: I(t.snowball_drawer_debt_label, "C") }) }),
532
+ /* @__PURE__ */ e(_, { flexGrow: 1, children: /* @__PURE__ */ e(l, { variant: "Body", children: E(t.snowball_drawer_debt_label, "C") }) }),
532
533
  /* @__PURE__ */ s(_, { children: [
533
534
  /* @__PURE__ */ e(l, { variant: "Body", children: "$1,500.00" }),
534
535
  /* @__PURE__ */ e(
@@ -568,50 +569,50 @@ const L = () => {
568
569
  ] })
569
570
  }
570
571
  );
571
- }, ct = D(st), dt = "#FF7B08";
572
- function pt(a, n) {
573
- const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), i = [
574
- Math.max(0, Math.min(255, Math.round(r * n))),
575
- Math.max(0, Math.min(255, Math.round(t * n))),
576
- Math.max(0, Math.min(255, Math.round(o * n)))
572
+ }, dt = v(ct), pt = "#FF7B08";
573
+ function mt(a, o) {
574
+ const [r, t, n] = a.replace(/^#/, "").match(/.{1,2}/g).map((d) => parseInt(d, 16)), i = [
575
+ Math.max(0, Math.min(255, Math.round(r * o))),
576
+ Math.max(0, Math.min(255, Math.round(t * o))),
577
+ Math.max(0, Math.min(255, Math.round(n * o)))
577
578
  ];
578
579
  return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
579
580
  }
580
- const we = ({
581
+ const Ce = ({
581
582
  sx: a,
582
- height: n = 500,
583
+ height: o = 500,
583
584
  width: r,
584
585
  debts: t,
585
- hoveredDebtGuid: o,
586
+ hoveredDebtGuid: n,
586
587
  onClickArea: i,
587
- onHoverArea: p
588
+ onHoverArea: d
588
589
  }) => {
589
- const c = We(), { onEvent: d } = F(), m = t.filter((b) => !b.is_impossible), u = [
590
+ const c = He(), { onEvent: p } = F(), m = t.filter((u) => !u.is_impossible), b = [
590
591
  ...new Set(
591
- m.flatMap((b) => b.dataset.map((f) => new Date(f.x).getTime()))
592
+ m.flatMap((u) => u.dataset.map((f) => new Date(f.x).getTime()))
592
593
  )
593
- ].sort((b, f) => b - f).map((b) => new Date(b)), x = m.map((b) => {
594
- const f = new Map(b.dataset.map((R) => [new Date(R.x).getTime(), R.y]));
595
- let E = f.get(u[0].getTime()) ?? 0;
596
- const $ = u.map((R) => {
597
- const z = f.get(R.getTime()) ?? E;
598
- return E = z, { x: R, y: z };
594
+ ].sort((u, f) => u - f).map((u) => new Date(u)), w = m.map((u) => {
595
+ const f = new Map(u.dataset.map(($) => [new Date($.x).getTime(), $.y]));
596
+ let D = f.get(b[0].getTime()) ?? 0;
597
+ const P = b.map(($) => {
598
+ const H = f.get($.getTime()) ?? D;
599
+ return D = H, { x: $, y: H };
599
600
  });
600
- return { ...b, dataset: $ };
601
- }), h = x.reduce(
602
- (b, f) => b + (f.dataset[0]?.y ?? 0),
601
+ return { ...u, dataset: P };
602
+ }), h = w.reduce(
603
+ (u, f) => u + (f.dataset[0]?.y ?? 0),
603
604
  0
604
- ), v = u.map((b, f) => {
605
- const E = f / (u.length - 1), $ = h * (1 - E);
606
- return { x: b, y: $ };
607
- }), B = Math.ceil(h / 100) * 100, N = u, C = x.map((b, f) => {
608
- const E = 1 - f / x.length * 0.5, $ = pt(dt, E);
605
+ ), A = b.map((u, f) => {
606
+ const D = f / (b.length - 1), P = h * (1 - D);
607
+ return { x: u, y: P };
608
+ }), B = Math.ceil(h / 100) * 100, M = b, C = w.map((u, f) => {
609
+ const D = 1 - f / w.length * 0.5, P = mt(pt, D);
609
610
  return {
610
611
  id: `debt-${f}`,
611
- guid: b.guid,
612
- label: b.name,
613
- data: b.dataset.map((R) => R.y),
614
- color: $,
612
+ guid: u.guid,
613
+ label: u.name,
614
+ data: u.dataset.map(($) => $.y),
615
+ color: P,
615
616
  curve: "linear",
616
617
  type: "line",
617
618
  area: !0,
@@ -622,7 +623,7 @@ const we = ({
622
623
  C.push({
623
624
  id: "payoff-line",
624
625
  label: "Payoff Line",
625
- data: v.map((b) => b.y),
626
+ data: A.map((u) => u.y),
626
627
  color: c.palette.grey[700],
627
628
  curve: "linear",
628
629
  type: "line",
@@ -630,7 +631,7 @@ const we = ({
630
631
  showMark: !1,
631
632
  disableHighlight: !0
632
633
  });
633
- const A = (b) => C.findIndex((f) => f?.guid === b);
634
+ const I = (u) => C.findIndex((f) => f?.guid === u);
634
635
  return /* @__PURE__ */ e(
635
636
  ae,
636
637
  {
@@ -647,27 +648,25 @@ const we = ({
647
648
  }
648
649
  },
649
650
  children: /* @__PURE__ */ e(
650
- Oe,
651
+ Ge,
651
652
  {
652
653
  axisHighlight: { x: "none" },
653
654
  disableLineItemHighlight: !0,
654
- height: n,
655
- onAreaClick: (b, f) => {
655
+ height: o,
656
+ hideLegend: !0,
657
+ margin: { bottom: 24, left: 32, right: 72, top: 48 },
658
+ onAreaClick: (u, f) => {
656
659
  i?.();
657
- const E = C.find(($) => $.id === f.seriesId);
658
- d(T.DEBTS_CLICK_CHART_AREA, { account_guid: E?.guid });
660
+ const D = C.find((P) => P.id === f.seriesId);
661
+ p(T.DEBTS_CLICK_CHART_AREA, { account_guid: D?.guid });
659
662
  },
660
- onHighlightChange: (b) => {
661
- const f = C.find((E) => E.id === b?.seriesId)?.guid;
662
- p?.(f ?? "");
663
+ onHighlightChange: (u) => {
664
+ const f = C.find((D) => D.id === u?.seriesId)?.guid;
665
+ d?.(f ?? "");
663
666
  },
664
667
  series: C,
665
668
  skipAnimation: !0,
666
- slotProps: {
667
- legend: {
668
- hidden: !0
669
- }
670
- },
669
+ slotProps: { tooltip: { trigger: "none" } },
671
670
  sx: {
672
671
  p: 4,
673
672
  "& .MuiBarLabel-root": {
@@ -685,10 +684,10 @@ const we = ({
685
684
  strokeDasharray: "10 5",
686
685
  strokeWidth: 1
687
686
  },
688
- [`& .MuiLineElement-series-debt-${A(o ?? "0")}`]: {
687
+ [`& .MuiLineElement-series-debt-${I(n ?? "0")}`]: {
689
688
  opacity: 1
690
689
  },
691
- [`& .MuiAreaElement-series-debt-${A(o ?? "0")}`]: {
690
+ [`& .MuiAreaElement-series-debt-${I(n ?? "0")}`]: {
692
691
  opacity: 1
693
692
  },
694
693
  "& .MuiChartsAxis-tickLabel > tspan": {
@@ -696,15 +695,15 @@ const we = ({
696
695
  },
697
696
  ...a
698
697
  },
699
- tooltip: { trigger: "none" },
700
698
  width: r,
701
699
  xAxis: [
702
700
  {
703
- data: N,
704
- scaleType: "time",
705
- min: u[0],
701
+ data: M,
706
702
  disableTicks: !0,
707
- valueFormatter: (b) => U(b, q.MONTH_SHORT_YEAR)
703
+ min: b[0],
704
+ scaleType: "time",
705
+ tickLabelMinGap: 24,
706
+ valueFormatter: (u) => U(u, q.MONTH_SHORT_YEAR)
708
707
  }
709
708
  ],
710
709
  yAxis: [
@@ -712,16 +711,16 @@ const we = ({
712
711
  min: 0,
713
712
  max: B,
714
713
  disableTicks: !0,
715
- valueFormatter: (b) => k(b, "0a")
714
+ valueFormatter: (u) => N(u, "0a")
716
715
  }
717
716
  ]
718
717
  }
719
718
  )
720
719
  }
721
720
  );
722
- }, mt = () => {
723
- const a = X(), { debts: n } = S(), { selectedDebtChartData: r } = L();
724
- return /* @__PURE__ */ s(H, { children: [
721
+ }, ht = () => {
722
+ const a = V(), { debts: o } = S(), { selectedDebtChartData: r } = L();
723
+ return /* @__PURE__ */ s(O, { children: [
725
724
  /* @__PURE__ */ s(
726
725
  Le,
727
726
  {
@@ -731,8 +730,8 @@ const we = ({
731
730
  }
732
731
  },
733
732
  children: [
734
- /* @__PURE__ */ e(He, { sx: { pb: 0 }, title: /* @__PURE__ */ e(De, { sx: { pb: 4 }, children: n.details_chart_title }) }),
735
- /* @__PURE__ */ e($e, { sx: { p: 0 }, children: /* @__PURE__ */ e(we, { debts: [r], height: 250 }) })
733
+ /* @__PURE__ */ e(Oe, { sx: { pb: 0 }, title: /* @__PURE__ */ e(Te, { sx: { pb: 4 }, children: o.details_chart_title }) }),
734
+ /* @__PURE__ */ e($e, { sx: { p: 0 }, children: /* @__PURE__ */ e(Ce, { debts: [r], height: 250 }) })
736
735
  ]
737
736
  }
738
737
  ),
@@ -742,13 +741,13 @@ const we = ({
742
741
  color: a.palette.text.secondary,
743
742
  sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
744
743
  variant: "Small",
745
- children: n.details_chart_description
744
+ children: o.details_chart_description
746
745
  }
747
746
  )
748
747
  ] });
749
- }, ht = D(mt), ut = () => {
750
- const a = X(), { onEvent: n } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: o, showError: i } = L();
751
- return g.useEffect(() => n(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(ye, { children: i || o ? /* @__PURE__ */ e(
748
+ }, ut = v(ht), bt = () => {
749
+ const a = V(), { onEvent: o } = F(), { debts: r } = S(), { selectedDebtChartData: t, showCompleted: n, showError: i } = L();
750
+ return x.useEffect(() => o(T.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(fe, { children: i || n ? /* @__PURE__ */ e(
752
751
  l,
753
752
  {
754
753
  color: a.palette.secondary.main,
@@ -757,13 +756,13 @@ const we = ({
757
756
  variant: "Small",
758
757
  children: i ? r.schedule_error_message : r.schedule_complete_message
759
758
  }
760
- ) : /* @__PURE__ */ s(H, { children: [
761
- /* @__PURE__ */ s(w, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
759
+ ) : /* @__PURE__ */ s(O, { children: [
760
+ /* @__PURE__ */ s(g, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
762
761
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_month_heading }),
763
762
  /* @__PURE__ */ e(l, { bold: !0, variant: "XSmall", children: r.schedule_amount_heading })
764
763
  ] }),
765
- t.dataset.slice(1).map(({ x: p, y: c, payment: d }) => /* @__PURE__ */ e(w, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(w, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
766
- w,
764
+ t.dataset.slice(1).map(({ x: d, y: c, payment: p }) => /* @__PURE__ */ e(g, { bgcolor: a.palette.background.paper, children: /* @__PURE__ */ e(g, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
765
+ g,
767
766
  {
768
767
  sx: {
769
768
  borderBottom: `1px solid ${a.palette.border.light}`,
@@ -773,12 +772,12 @@ const we = ({
773
772
  pr: 24
774
773
  },
775
774
  children: [
776
- /* @__PURE__ */ s(w, { flexGrow: 1, children: [
777
- /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: U(p, q.MONTH_YEAR) }),
775
+ /* @__PURE__ */ s(g, { flexGrow: 1, children: [
776
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: U(d, q.MONTH_YEAR) }),
778
777
  /* @__PURE__ */ e(l, { color: a.palette.secondary.main, variant: "XSmall", children: r.schedule_month_label })
779
778
  ] }),
780
- /* @__PURE__ */ s(w, { children: [
781
- /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: k(c, "0,0.00") }),
779
+ /* @__PURE__ */ s(g, { children: [
780
+ /* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: N(c, "0,0.00") }),
782
781
  /* @__PURE__ */ e(
783
782
  l,
784
783
  {
@@ -786,15 +785,15 @@ const we = ({
786
785
  color: a.palette.success.main,
787
786
  textAlign: "end",
788
787
  variant: "Tiny",
789
- children: `+${k(d, "0,0")}`
788
+ children: `+${N(p, "0,0")}`
790
789
  }
791
790
  )
792
791
  ] })
793
792
  ]
794
793
  }
795
- ) }) }, String(p))),
796
- /* @__PURE__ */ e(w, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
797
- w,
794
+ ) }) }, String(d))),
795
+ /* @__PURE__ */ e(g, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
796
+ g,
798
797
  {
799
798
  sx: {
800
799
  alignItems: "center",
@@ -810,10 +809,10 @@ const we = ({
810
809
  }
811
810
  ) })
812
811
  ] }) });
813
- }, bt = D(ut), _t = D(({ debt: a }) => {
814
- const { debts: n } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [o, i] = g.useState(a.interest_rate ?? 0), p = o < 0, c = async () => {
815
- await r({ ...a.account, interest_rate: o }), a.interest_rate = o, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
816
- }, d = () => {
812
+ }, _t = v(bt), yt = v(({ debt: a }) => {
813
+ const { debts: o } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [n, i] = x.useState(a.interest_rate ?? 0), d = n < 0, c = async () => {
814
+ await r({ ...a.account, interest_rate: n }), a.interest_rate = n, t(T.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
815
+ }, p = () => {
817
816
  setTimeout(() => {
818
817
  i(a.interest_rate ?? 0);
819
818
  }, 250);
@@ -821,29 +820,29 @@ const we = ({
821
820
  return /* @__PURE__ */ e(
822
821
  Q,
823
822
  {
824
- isSaveDisabled: p,
825
- label: `${n.details_interest_rate} (%)`,
826
- onCancel: d,
823
+ isSaveDisabled: d,
824
+ label: `${o.details_interest_rate} (%)`,
825
+ onCancel: p,
827
826
  onSave: c,
828
- primaryText: n.details_interest_rate,
829
- secondaryText: Me(Number(a.interest_rate) / 100),
830
- zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
827
+ primaryText: o.details_interest_rate,
828
+ secondaryText: Pe(Number(a.interest_rate) / 100),
829
+ zeroStateText: a.interest_rate ? void 0 : o.add_interest_rate,
831
830
  children: /* @__PURE__ */ e(
832
831
  Ye,
833
832
  {
834
- error: p,
833
+ error: d,
835
834
  fullWidth: !0,
836
835
  onChange: (m) => i(isNaN(parseFloat(m.target.value)) ? 0 : parseFloat(m.target.value)),
837
836
  type: "number",
838
- value: o
837
+ value: n
839
838
  }
840
839
  )
841
840
  }
842
841
  );
843
- }), yt = D(({ debt: a }) => {
844
- const { debts: n } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [o, i] = g.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
845
- await r({ ...a.account, minimum_payment: o }), a.monthly_payment = o, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
846
- }, d = () => {
842
+ }), ft = v(({ debt: a }) => {
843
+ const { debts: o } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [n, i] = x.useState(a.monthly_payment ?? 0), d = n < 0 || n > 9999999999e-2, c = async () => {
844
+ await r({ ...a.account, minimum_payment: n }), a.monthly_payment = n, t(T.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
845
+ }, p = () => {
847
846
  setTimeout(() => {
848
847
  i(a.monthly_payment ?? 0);
849
848
  }, 250);
@@ -851,31 +850,31 @@ const we = ({
851
850
  return /* @__PURE__ */ e(
852
851
  Q,
853
852
  {
854
- isSaveDisabled: p,
855
- label: n.details_monthly_payment,
856
- onCancel: d,
853
+ isSaveDisabled: d,
854
+ label: o.details_monthly_payment,
855
+ onCancel: p,
857
856
  onSave: c,
858
- primaryText: n.details_monthly_payment,
859
- secondaryText: k(a.monthly_payment, "0,0"),
860
- zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
857
+ primaryText: o.details_monthly_payment,
858
+ secondaryText: N(a.monthly_payment, "0,0"),
859
+ zeroStateText: a.monthly_payment ? void 0 : o.add_monthly_payment,
861
860
  children: /* @__PURE__ */ e(
862
- ne,
861
+ oe,
863
862
  {
864
- amount: o,
863
+ amount: n,
865
864
  autoFocus: !0,
866
- error: p,
865
+ error: d,
867
866
  fullWidth: !0,
868
867
  minAmount: 0,
869
- setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
868
+ setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
870
869
  sx: { ".MuiTypography-Body": { p: 0 } }
871
870
  }
872
871
  )
873
872
  }
874
873
  );
875
- }), ft = D(({ debt: a }) => {
876
- const { debts: n } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [o, i] = g.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
877
- await r({ ...a.account, original_balance: o }), a.original_balance = o, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
878
- }, d = () => {
874
+ }), gt = v(({ debt: a }) => {
875
+ const { debts: o } = S(), { updateAccount: r } = J(), { onEvent: t } = F(), [n, i] = x.useState(a.original_balance ?? 0), d = n < 0 || n > 9999999999e-2, c = async () => {
876
+ await r({ ...a.account, original_balance: n }), a.original_balance = n, t(T.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
877
+ }, p = () => {
879
878
  setTimeout(() => {
880
879
  i(a.original_balance ?? 0);
881
880
  }, 250);
@@ -883,56 +882,56 @@ const we = ({
883
882
  return /* @__PURE__ */ e(
884
883
  Q,
885
884
  {
886
- isSaveDisabled: p,
887
- label: n.details_original_balance,
888
- onCancel: d,
885
+ isSaveDisabled: d,
886
+ label: o.details_original_balance,
887
+ onCancel: p,
889
888
  onSave: c,
890
- primaryText: n.details_original_balance,
891
- secondaryText: k(a.original_balance, "0,0"),
892
- zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
889
+ primaryText: o.details_original_balance,
890
+ secondaryText: N(a.original_balance, "0,0"),
891
+ zeroStateText: a.original_balance ? void 0 : o.add_original_balance,
893
892
  children: /* @__PURE__ */ e(
894
- ne,
893
+ oe,
895
894
  {
896
- amount: o,
895
+ amount: n,
897
896
  autoFocus: !0,
898
- error: p,
897
+ error: d,
899
898
  fullWidth: !0,
900
899
  minAmount: 0,
901
- setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
900
+ setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
902
901
  sx: { ".MuiTypography-Body": { p: 0 } }
903
902
  }
904
903
  )
905
904
  }
906
905
  );
907
906
  }), xt = () => {
908
- const { onEvent: a } = F(), { selectedDebtChartData: n } = L();
909
- return g.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(w, { bgcolor: "background.paper", children: [
910
- n?.goal && /* @__PURE__ */ s(H, { children: [
911
- /* @__PURE__ */ e(ze, { goal: n.goal }),
912
- /* @__PURE__ */ e(G, {}),
913
- /* @__PURE__ */ e(Xe, { goal: n.goal }),
914
- /* @__PURE__ */ e(G, {}),
915
- /* @__PURE__ */ e(Ve, { goal: n.goal }),
916
- /* @__PURE__ */ e(G, {})
907
+ const { onEvent: a } = F(), { selectedDebtChartData: o } = L();
908
+ return x.useEffect(() => a(T.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(g, { bgcolor: "background.paper", children: [
909
+ o?.goal && /* @__PURE__ */ s(O, { children: [
910
+ /* @__PURE__ */ e(ze, { goal: o.goal }),
911
+ /* @__PURE__ */ e(j, {}),
912
+ /* @__PURE__ */ e(Xe, { goal: o.goal }),
913
+ /* @__PURE__ */ e(j, {}),
914
+ /* @__PURE__ */ e(Ve, { goal: o.goal }),
915
+ /* @__PURE__ */ e(j, {})
917
916
  ] }),
918
- !n?.goal && n?.account && /* @__PURE__ */ s(H, { children: [
919
- /* @__PURE__ */ e(yt, { debt: n }),
920
- /* @__PURE__ */ e(G, {}),
921
- /* @__PURE__ */ e(_t, { debt: n }),
922
- /* @__PURE__ */ e(G, {}),
923
- /* @__PURE__ */ e(ft, { debt: n }),
924
- /* @__PURE__ */ e(G, {})
917
+ !o?.goal && o?.account && /* @__PURE__ */ s(O, { children: [
918
+ /* @__PURE__ */ e(ft, { debt: o }),
919
+ /* @__PURE__ */ e(j, {}),
920
+ /* @__PURE__ */ e(yt, { debt: o }),
921
+ /* @__PURE__ */ e(j, {}),
922
+ /* @__PURE__ */ e(gt, { debt: o }),
923
+ /* @__PURE__ */ e(j, {})
925
924
  ] })
926
925
  ] });
927
- }, gt = D(xt), wt = ({ setTabValue: a, sx: n }) => {
928
- const { debts: r } = S(), { showError: t, showCompleted: o } = L();
929
- return g.useEffect(() => {
926
+ }, wt = v(xt), Ct = ({ setTabValue: a, sx: o }) => {
927
+ const { debts: r } = S(), { showError: t, showCompleted: n } = L();
928
+ return x.useEffect(() => {
930
929
  t && a(1);
931
- }, [t]), !t && !o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ s(w, { gap: 16, children: [
932
- /* @__PURE__ */ e(ue, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ s(
930
+ }, [t]), !t && !n ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ s(g, { gap: 16, children: [
931
+ /* @__PURE__ */ e(ue, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
933
932
  me,
934
933
  {
935
- icon: t ? /* @__PURE__ */ e(Ke, { filled: !0 }) : /* @__PURE__ */ e(fe, { color: "success", filled: !0 }),
934
+ icon: t ? /* @__PURE__ */ e(Ke, { filled: !0 }) : /* @__PURE__ */ e(ge, { color: "success", filled: !0 }),
936
935
  severity: "error",
937
936
  sx: {
938
937
  alignItems: "start",
@@ -950,10 +949,10 @@ const we = ({
950
949
  ]
951
950
  }
952
951
  ) }),
953
- t && /* @__PURE__ */ e(ue, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ s(
952
+ t && /* @__PURE__ */ e(ue, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
954
953
  me,
955
954
  {
956
- icon: /* @__PURE__ */ e(H, {}),
955
+ icon: /* @__PURE__ */ e(O, {}),
957
956
  severity: "error",
958
957
  sx: {
959
958
  borderRadius: 2,
@@ -969,16 +968,16 @@ const we = ({
969
968
  }
970
969
  ) })
971
970
  ] });
972
- }, Ct = D(wt), St = () => {
973
- const { debts: a } = S(), { showError: n, showCompleted: r } = L(), [t, o] = g.useState(0);
974
- return /* @__PURE__ */ s(H, { children: [
975
- (n || r) && /* @__PURE__ */ e(Ct, { setTabValue: o, sx: { mt: -24 } }),
971
+ }, St = v(Ct), vt = () => {
972
+ const { debts: a } = S(), { showError: o, showCompleted: r } = L(), [t, n] = x.useState(0);
973
+ return /* @__PURE__ */ s(O, { children: [
974
+ (o || r) && /* @__PURE__ */ e(St, { setTabValue: n, sx: { mt: -24 } }),
976
975
  /* @__PURE__ */ s(
977
976
  je,
978
977
  {
979
978
  "aria-label": a.details_tabs_aria_label,
980
979
  centered: !0,
981
- onChange: (i, p) => o(p),
980
+ onChange: (i, d) => n(d),
982
981
  textColor: "primary",
983
982
  value: t,
984
983
  variant: "fullWidth",
@@ -1002,110 +1001,110 @@ const we = ({
1002
1001
  ]
1003
1002
  }
1004
1003
  ),
1005
- /* @__PURE__ */ e(be, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(bt, {}) }),
1006
- /* @__PURE__ */ e(be, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(gt, {}) })
1004
+ /* @__PURE__ */ e(be, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(_t, {}) }),
1005
+ /* @__PURE__ */ e(be, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(wt, {}) })
1007
1006
  ] });
1008
- }, vt = D(St), Dt = ({ isOpen: a, onClose: n }) => {
1009
- const { debts: r } = S(), { showError: t, showCompleted: o } = L(), i = t || o ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ e(ht, {});
1007
+ }, Dt = v(vt), Tt = ({ isOpen: a, onClose: o }) => {
1008
+ const { debts: r } = S(), { showError: t, showCompleted: n } = L(), i = t || n ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ e(ut, {});
1010
1009
  return /* @__PURE__ */ e(
1011
1010
  re,
1012
1011
  {
1013
1012
  ariaLabelClose: r.details_close_aria,
1014
1013
  isOpen: a,
1015
- onClose: n,
1014
+ onClose: o,
1016
1015
  title: r.details_title,
1017
- children: /* @__PURE__ */ s(w, { bgcolor: "background.default", children: [
1018
- /* @__PURE__ */ e(Fe, { customDetailsChart: i }),
1019
- /* @__PURE__ */ e(vt, {})
1016
+ children: /* @__PURE__ */ s(g, { bgcolor: "background.default", children: [
1017
+ /* @__PURE__ */ e(Re, { customDetailsChart: i }),
1018
+ /* @__PURE__ */ e(Dt, {})
1020
1019
  ] })
1021
1020
  }
1022
1021
  );
1023
- }, Tt = D(() => {
1024
- const { debts: a } = S(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = V(), { onEvent: t } = F(), [o, i] = g.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
1025
- n && (await r({ ...n, extra_payment: o }), n.extra_payment = o, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1026
- user_guid: n?.user_guid
1022
+ }, At = v(() => {
1023
+ const { debts: a } = S(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: r } = Y(), { onEvent: t } = F(), [n, i] = x.useState(o?.extra_payment ?? 0), d = n < 0 || n > 9999999999e-2, c = async () => {
1024
+ o && (await r({ ...o, extra_payment: n }), o.extra_payment = n, t(T.DEBTS_SAVE_PAYDOWN_ACTION, {
1025
+ user_guid: o?.user_guid
1027
1026
  }));
1028
- }, d = () => {
1027
+ }, p = () => {
1029
1028
  setTimeout(() => {
1030
- i(n?.extra_payment ?? 0);
1029
+ i(o?.extra_payment ?? 0);
1031
1030
  }, 250);
1032
1031
  };
1033
1032
  return /* @__PURE__ */ e(
1034
1033
  Q,
1035
1034
  {
1036
- isSaveDisabled: p,
1035
+ isSaveDisabled: d,
1037
1036
  label: a.paydown_drawer_extra_payment,
1038
- onCancel: d,
1037
+ onCancel: p,
1039
1038
  onSave: c,
1040
1039
  primaryText: a.paydown_drawer_extra_payment,
1041
- secondaryText: k(n?.extra_payment, "0,0"),
1042
- zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
1040
+ secondaryText: N(o?.extra_payment, "0,0"),
1041
+ zeroStateText: o?.extra_payment ? void 0 : a.add_extra_payment,
1043
1042
  children: /* @__PURE__ */ e(
1044
- ne,
1043
+ oe,
1045
1044
  {
1046
- amount: o,
1045
+ amount: n,
1047
1046
  autoFocus: !0,
1048
- error: p,
1047
+ error: d,
1049
1048
  fullWidth: !0,
1050
1049
  minAmount: 0,
1051
- setAmount: (m) => i(isNaN(Number(m)) ? o : Number(m)),
1050
+ setAmount: (m) => i(isNaN(Number(m)) ? n : Number(m)),
1052
1051
  sx: { ".MuiTypography-Body": { p: 0 } }
1053
1052
  }
1054
1053
  )
1055
1054
  }
1056
1055
  );
1057
- }), At = () => {
1058
- const { debts: a } = S(), { totalMonthlyPayments: n } = Z(), { monthlyCashFlowProfile: r } = V(), t = n + Number(r?.extra_payment);
1059
- return /* @__PURE__ */ s(w, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1060
- /* @__PURE__ */ s(w, { p: 24, children: [
1061
- /* @__PURE__ */ s(w, { alignItems: "center", gap: 4, mb: 24, children: [
1056
+ }), Et = () => {
1057
+ const { debts: a } = S(), { totalMonthlyPayments: o } = Z(), { monthlyCashFlowProfile: r } = Y(), t = o + Number(r?.extra_payment);
1058
+ return /* @__PURE__ */ s(g, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
1059
+ /* @__PURE__ */ s(g, { p: 24, children: [
1060
+ /* @__PURE__ */ s(g, { alignItems: "center", gap: 4, mb: 24, children: [
1062
1061
  /* @__PURE__ */ e(l, { variant: "Body", children: a.paydown_drawer_mimimum_label }),
1063
- /* @__PURE__ */ e(l, { bold: !0, variant: "H1", children: k(n, "0,0") }),
1062
+ /* @__PURE__ */ e(ye, { bold: !0, variant: "H1", children: N(o, "0,0") }),
1064
1063
  /* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "Small", width: 208, children: a.paydown_drawer_minimum_info })
1065
1064
  ] }),
1066
- /* @__PURE__ */ s(w, { children: [
1065
+ /* @__PURE__ */ s(g, { children: [
1067
1066
  /* @__PURE__ */ e(l, { variant: "H3", children: a.paydown_drawer_subtitle }),
1068
1067
  /* @__PURE__ */ e(l, { truncate: !1, variant: "ParagraphSmall", children: a.paydown_drawer_description })
1069
1068
  ] })
1070
1069
  ] }),
1071
- /* @__PURE__ */ e(w, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Tt, {}) }),
1072
- /* @__PURE__ */ e(w, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(w, { gap: 4, children: [
1070
+ /* @__PURE__ */ e(g, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(At, {}) }),
1071
+ /* @__PURE__ */ e(g, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(g, { gap: 4, children: [
1073
1072
  /* @__PURE__ */ e(l, { variant: "Small", children: a.paydown_drawer_total_payment }),
1074
- /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: k(t, "0,0") })
1073
+ /* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: N(t, "0,0") })
1075
1074
  ] }) })
1076
1075
  ] });
1077
- }, Et = D(At), It = ({ isOpen: a, onClose: n }) => {
1076
+ }, It = v(Et), Bt = ({ isOpen: a, onClose: o }) => {
1078
1077
  const { debts: r } = S();
1079
1078
  return /* @__PURE__ */ e(
1080
1079
  re,
1081
1080
  {
1082
1081
  ariaLabelClose: r.paydown_drawer_close_aria,
1083
1082
  isOpen: a,
1084
- onClose: n,
1083
+ onClose: o,
1085
1084
  title: r.paydown_drawer_title,
1086
- children: /* @__PURE__ */ e(Et, {})
1085
+ children: /* @__PURE__ */ e(It, {})
1087
1086
  }
1088
1087
  );
1089
1088
  };
1090
- function Bt(a, n) {
1089
+ function Mt(a, o) {
1091
1090
  const r = (t) => {
1092
1091
  if (typeof t == "number") return t;
1093
1092
  if (t === "!" || t === "✓") return 1 / 0;
1094
1093
  throw new Error("Unsupported value");
1095
1094
  };
1096
- return r(a) - r(n);
1095
+ return r(a) - r(o);
1097
1096
  }
1098
- function Mt(a) {
1097
+ function Pt(a) {
1099
1098
  return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
1100
1099
  }
1101
- const Pt = (a) => {
1102
- const n = {
1100
+ const kt = (a) => {
1101
+ const o = {
1103
1102
  text: "#121417",
1104
1103
  background: "#FFB252"
1105
1104
  };
1106
- return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
1107
- }, kt = (a) => {
1108
- const n = String(a.formattedValue), r = Pt(n);
1105
+ return a === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), a === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
1106
+ }, Nt = (a) => {
1107
+ const o = String(a.formattedValue), r = kt(o);
1109
1108
  return /* @__PURE__ */ e(
1110
1109
  ae,
1111
1110
  {
@@ -1120,40 +1119,40 @@ const Pt = (a) => {
1120
1119
  backgroundColor: r.background,
1121
1120
  marginLeft: "10px"
1122
1121
  },
1123
- children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: n })
1122
+ children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: o })
1124
1123
  }
1125
1124
  );
1126
- }, Nt = (a) => {
1127
- const n = a.row.account, r = qe[n.account_type];
1128
- return /* @__PURE__ */ s(w, { alignItems: "center", flexDirection: "row", children: [
1125
+ }, Rt = (a) => {
1126
+ const o = a.row.account, r = qe[o.account_type];
1127
+ return /* @__PURE__ */ s(g, { alignItems: "center", flexDirection: "row", children: [
1129
1128
  /* @__PURE__ */ e(
1130
- Te,
1129
+ Ae,
1131
1130
  {
1132
- alt: `${n.institutionName}`,
1133
- institutionGuid: n.institution_guid || ""
1131
+ alt: `${o.institutionName}`,
1132
+ institutionGuid: o.institution_guid || ""
1134
1133
  }
1135
1134
  ),
1136
- /* @__PURE__ */ s(w, { ml: 12, children: [
1137
- /* @__PURE__ */ e(l, { variant: "Small", children: n.name }),
1135
+ /* @__PURE__ */ s(g, { ml: 12, children: [
1136
+ /* @__PURE__ */ e(l, { variant: "Small", children: o.name }),
1138
1137
  /* @__PURE__ */ e(l, { variant: "XSmall", children: r })
1139
1138
  ] })
1140
1139
  ] });
1141
1140
  }, Ft = ({
1142
1141
  sx: a = {},
1143
- debts: n,
1142
+ debts: o,
1144
1143
  hoveredDebtGuid: r,
1145
1144
  onHoverRow: t,
1146
- onClickRow: o
1145
+ onClickRow: n
1147
1146
  }) => {
1148
- const i = X(), { onEvent: p } = F(), { isMobile: c } = Y(), { debts: d } = S(), [m, u] = g.useState([
1147
+ const i = V(), { onEvent: d } = F(), { isMobile: c } = K(), { debts: p } = S(), [m, b] = x.useState([
1149
1148
  { field: "priority", sort: "asc" }
1150
- ]), x = [
1149
+ ]), w = [
1151
1150
  {
1152
1151
  field: "priority",
1153
- headerName: d.table_column_priority,
1154
- renderHeader: j,
1155
- renderCell: kt,
1156
- sortComparator: Bt,
1152
+ headerName: p.table_column_priority,
1153
+ renderHeader: z,
1154
+ renderCell: Nt,
1155
+ sortComparator: Mt,
1157
1156
  sortable: !0,
1158
1157
  hideSortIcons: !0,
1159
1158
  type: "custom",
@@ -1164,9 +1163,9 @@ const Pt = (a) => {
1164
1163
  },
1165
1164
  {
1166
1165
  field: "account",
1167
- headerName: d.table_column_account,
1168
- renderHeader: j,
1169
- renderCell: Nt,
1166
+ headerName: p.table_column_account,
1167
+ renderHeader: z,
1168
+ renderCell: Rt,
1170
1169
  sortable: !1,
1171
1170
  type: "custom",
1172
1171
  align: "left",
@@ -1176,9 +1175,9 @@ const Pt = (a) => {
1176
1175
  },
1177
1176
  {
1178
1177
  field: "balance",
1179
- headerName: d.table_column_balance,
1180
- renderHeader: j,
1181
- renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: k(y.value, "0,0") }),
1178
+ headerName: p.table_column_balance,
1179
+ renderHeader: z,
1180
+ renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: N(y.value, "0,0") }),
1182
1181
  sortable: !0,
1183
1182
  hideSortIcons: c,
1184
1183
  type: "number",
@@ -1189,8 +1188,8 @@ const Pt = (a) => {
1189
1188
  },
1190
1189
  {
1191
1190
  field: "interest_rate",
1192
- headerName: d.table_column_interest_rate,
1193
- renderHeader: j,
1191
+ headerName: p.table_column_interest_rate,
1192
+ renderHeader: z,
1194
1193
  renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: isNaN(y.value) ? "---" : `${Number(y.value).toFixed(2)}%` }),
1195
1194
  sortable: !0,
1196
1195
  hideSortIcons: c,
@@ -1202,8 +1201,8 @@ const Pt = (a) => {
1202
1201
  },
1203
1202
  {
1204
1203
  field: "projected_payoff_date",
1205
- headerName: d.table_column_payoff_date,
1206
- renderHeader: j,
1204
+ headerName: p.table_column_payoff_date,
1205
+ renderHeader: z,
1207
1206
  renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: y.value ? U(y.value, q.MONTH_SHORT_YEAR) : "---" }),
1208
1207
  sortable: !0,
1209
1208
  hideSortIcons: c,
@@ -1215,9 +1214,9 @@ const Pt = (a) => {
1215
1214
  },
1216
1215
  {
1217
1216
  field: "monthly_payment",
1218
- headerName: d.table_column_amount_due,
1219
- renderHeader: j,
1220
- renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof y.value == "number" ? k(y.value, "0,0") : "---" }),
1217
+ headerName: p.table_column_amount_due,
1218
+ renderHeader: z,
1219
+ renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof y.value == "number" ? N(y.value, "0,0") : "---" }),
1221
1220
  sortable: !0,
1222
1221
  hideSortIcons: c,
1223
1222
  type: "number",
@@ -1227,7 +1226,7 @@ const Pt = (a) => {
1227
1226
  flex: 0.6
1228
1227
  }
1229
1228
  ], h = [
1230
- ...x.slice(0, 3),
1229
+ ...w.slice(0, 3),
1231
1230
  {
1232
1231
  field: "chevron",
1233
1232
  headerName: "",
@@ -1240,18 +1239,18 @@ const Pt = (a) => {
1240
1239
  headerAlign: "right",
1241
1240
  width: 20
1242
1241
  }
1243
- ], v = g.useMemo(() => n.map((y, M) => ({
1242
+ ], A = x.useMemo(() => o.map((y, R) => ({
1244
1243
  ...y,
1245
- id: M,
1246
- priority: Mt(y)
1247
- })), [n]), B = (y) => {
1248
- const f = y.target.closest("[data-id]")?.getAttribute("data-id"), E = n[Number(f)];
1249
- t?.(E?.guid ?? "");
1250
- }, N = (y) => {
1244
+ id: R,
1245
+ priority: Pt(y)
1246
+ })), [o]), B = (y) => {
1247
+ const f = y.target.closest("[data-id]")?.getAttribute("data-id"), D = o[Number(f)];
1248
+ t?.(D?.guid ?? "");
1249
+ }, M = (y) => {
1251
1250
  c || B(y);
1252
1251
  }, C = (y) => {
1253
1252
  c && B(y);
1254
- }, A = (y) => v.find((M) => M.guid === y)?.id;
1253
+ }, I = (y) => A.find((R) => R.guid === y)?.id;
1255
1254
  return /* @__PURE__ */ e(
1256
1255
  ae,
1257
1256
  {
@@ -1266,22 +1265,22 @@ const Pt = (a) => {
1266
1265
  children: /* @__PURE__ */ e(
1267
1266
  Ue,
1268
1267
  {
1269
- columns: c ? h : x,
1268
+ columns: c ? h : w,
1270
1269
  disableColumnFilter: !0,
1271
1270
  disableColumnMenu: !0,
1272
1271
  hideFooter: !0,
1273
1272
  initialState: { sorting: { sortModel: m } },
1274
1273
  onRowClick: (y) => {
1275
- o(), p(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
1274
+ n(), d(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
1276
1275
  },
1277
1276
  onSortModelChange: (y) => {
1278
- u(y), p(T.DEBTS_CLICK_TABLE_SORT);
1277
+ b(y), d(T.DEBTS_CLICK_TABLE_SORT);
1279
1278
  },
1280
- rows: v,
1279
+ rows: A,
1281
1280
  slotProps: {
1282
1281
  baseIconButton: { color: "secondary", sx: { ml: 8 } },
1283
1282
  row: {
1284
- onMouseEnter: N,
1283
+ onMouseEnter: M,
1285
1284
  onMouseLeave: () => !c && t?.(""),
1286
1285
  onTouchStart: C,
1287
1286
  onClick: c ? C : void 0
@@ -1290,7 +1289,7 @@ const Pt = (a) => {
1290
1289
  sortModel: m,
1291
1290
  sortingOrder: ["asc", "desc"],
1292
1291
  sx: {
1293
- [`& .MuiDataGrid-row[data-id="${A(r)}"]`]: {
1292
+ [`& .MuiDataGrid-row[data-id="${I(r)}"]`]: {
1294
1293
  backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
1295
1294
  filter: "brightness(98%)"
1296
1295
  }
@@ -1299,9 +1298,9 @@ const Pt = (a) => {
1299
1298
  )
1300
1299
  }
1301
1300
  );
1302
- }, Rt = ({ buttonText: a, isOpen: n, onClick: r }) => {
1303
- const { isDesktop: t, isTablet: o } = Y(), i = n ? "unfold_less" : "unfold_more";
1304
- return t || o ? /* @__PURE__ */ e(
1301
+ }, Lt = ({ buttonText: a, isOpen: o, onClick: r }) => {
1302
+ const { isDesktop: t, isTablet: n } = K(), i = o ? "unfold_less" : "unfold_more";
1303
+ return t || n ? /* @__PURE__ */ e(
1305
1304
  xe,
1306
1305
  {
1307
1306
  "aria-controls": "prioritize-debts",
@@ -1324,25 +1323,25 @@ const Pt = (a) => {
1324
1323
  children: /* @__PURE__ */ e(te, { name: i })
1325
1324
  }
1326
1325
  );
1327
- }, Lt = D(({ buttonEl: a, onClose: n }) => {
1328
- const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: o, setSelectedDebtPriority: i } = L(), p = !!a, c = [
1326
+ }, $t = v(({ buttonEl: a, onClose: o }) => {
1327
+ const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority: n, setSelectedDebtPriority: i } = L(), d = !!a, c = [
1329
1328
  {
1330
- priority: P.FASTEST_PAYOFF_FIRST,
1329
+ priority: k.FASTEST_PAYOFF_FIRST,
1331
1330
  text: t.priority_sort_fastest_payoff
1332
1331
  },
1333
1332
  {
1334
- priority: P.HIGHEST_INTEREST,
1333
+ priority: k.HIGHEST_INTEREST,
1335
1334
  text: t.priority_sort_highest_interest
1336
1335
  },
1337
1336
  {
1338
- priority: P.LOWEST_BALANCE,
1337
+ priority: k.LOWEST_BALANCE,
1339
1338
  text: t.priority_sort_lowest_balance
1340
1339
  },
1341
1340
  {
1342
- priority: P.HIGHEST_BALANCE,
1341
+ priority: k.HIGHEST_BALANCE,
1343
1342
  text: t.priority_sort_highest_balance
1344
1343
  }
1345
- ], d = (m) => {
1344
+ ], p = (m) => {
1346
1345
  i(m), r(T.DEBTS_CLICK_PRIORITY, { debts_priority: m });
1347
1346
  };
1348
1347
  return /* @__PURE__ */ e(
@@ -1354,19 +1353,19 @@ const Pt = (a) => {
1354
1353
  horizontal: "left"
1355
1354
  },
1356
1355
  id: "prioritize-debts",
1357
- onClose: n,
1358
- open: p,
1356
+ onClose: o,
1357
+ open: d,
1359
1358
  transformOrigin: {
1360
1359
  vertical: "top",
1361
1360
  horizontal: "left"
1362
1361
  },
1363
- children: /* @__PURE__ */ e(ye, { children: c.map(({ priority: m, text: u }) => /* @__PURE__ */ s(
1362
+ children: /* @__PURE__ */ e(fe, { children: c.map(({ priority: m, text: b }) => /* @__PURE__ */ s(
1364
1363
  Je,
1365
1364
  {
1366
- onClick: () => d(m),
1365
+ onClick: () => p(m),
1367
1366
  sx: {
1368
- bgcolor: o === m ? "primary.main" : void 0,
1369
- color: o === m ? "#fff" : void 0,
1367
+ bgcolor: n === m ? "primary.main" : void 0,
1368
+ color: n === m ? "#fff" : void 0,
1370
1369
  justifyContent: "space-between",
1371
1370
  minHeight: 44,
1372
1371
  minWidth: 268,
@@ -1379,68 +1378,68 @@ const Pt = (a) => {
1379
1378
  }
1380
1379
  },
1381
1380
  children: [
1382
- /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: u }),
1383
- o === m && /* @__PURE__ */ e(fe, { color: "inherit", filled: !0, fontSize: "small" })
1381
+ /* @__PURE__ */ e(l, { color: "inherit", variant: "Small", children: b }),
1382
+ n === m && /* @__PURE__ */ e(ge, { color: "inherit", filled: !0, fontSize: "small" })
1384
1383
  ]
1385
1384
  },
1386
1385
  m
1387
1386
  )) })
1388
1387
  }
1389
1388
  );
1390
- }), $t = D(() => {
1391
- const { onEvent: a } = F(), { debts: n } = S(), { selectedDebtPriority: r } = L(), [t, o] = g.useState(null), i = (m) => {
1392
- o(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1393
- }, p = () => {
1394
- o(null);
1395
- }, c = !!t, d = g.useMemo(() => ({
1396
- [P.FASTEST_PAYOFF_FIRST]: n.priority_sort_fastest_payoff,
1397
- [P.HIGHEST_INTEREST]: n.priority_sort_highest_interest,
1398
- [P.HIGHEST_BALANCE]: n.priority_sort_highest_balance,
1399
- [P.LOWEST_BALANCE]: n.priority_sort_lowest_balance
1400
- })[r] ?? n.priority_sort_lowest_balance, [r]);
1389
+ }), Ot = v(() => {
1390
+ const { onEvent: a } = F(), { debts: o } = S(), { selectedDebtPriority: r } = L(), [t, n] = x.useState(null), i = (m) => {
1391
+ n(m.currentTarget), a(T.DEBTS_CLICK_PRIORITIZE);
1392
+ }, d = () => {
1393
+ n(null);
1394
+ }, c = !!t, p = x.useMemo(() => ({
1395
+ [k.FASTEST_PAYOFF_FIRST]: o.priority_sort_fastest_payoff,
1396
+ [k.HIGHEST_INTEREST]: o.priority_sort_highest_interest,
1397
+ [k.HIGHEST_BALANCE]: o.priority_sort_highest_balance,
1398
+ [k.LOWEST_BALANCE]: o.priority_sort_lowest_balance
1399
+ })[r] ?? o.priority_sort_lowest_balance, [r]);
1401
1400
  return /* @__PURE__ */ s(_, { children: [
1402
- /* @__PURE__ */ e(Rt, { buttonText: d, isOpen: c, onClick: i }),
1403
- /* @__PURE__ */ e(Lt, { buttonEl: t, onClose: p })
1401
+ /* @__PURE__ */ e(Lt, { buttonText: p, isOpen: c, onClick: i }),
1402
+ /* @__PURE__ */ e($t, { buttonEl: t, onClose: d })
1404
1403
  ] });
1405
- }), Ht = (a, n, r = 0) => {
1406
- const t = a.map((d) => ({ ...d }));
1407
- ge(t, n);
1408
- const o = /* @__PURE__ */ new Date(), i = [];
1409
- let p = 0, c = 1;
1410
- for (const d of t)
1404
+ }), Ht = (a, o, r = 0) => {
1405
+ const t = a.map((p) => ({ ...p }));
1406
+ we(t, o);
1407
+ const n = /* @__PURE__ */ new Date(), i = [];
1408
+ let d = 0, c = 1;
1409
+ for (const p of t)
1411
1410
  i.push({
1412
- ...d,
1411
+ ...p,
1413
1412
  // Start with the initial balance
1414
- dataset: [{ x: new Date(o), y: d.balance }]
1413
+ dataset: [{ x: new Date(n), y: p.balance }]
1415
1414
  });
1416
- for (; t.some((d) => d.balance >= 0.01 && !d.is_impossible); ) {
1417
- let d = !1, m = !1, u = !1;
1418
- for (const [x, h] of t.entries()) {
1415
+ for (; t.some((p) => p.balance >= 0.01 && !p.is_impossible); ) {
1416
+ let p = !1, m = !1, b = !1;
1417
+ for (const [w, h] of t.entries()) {
1419
1418
  if (h.balance <= 0.01) continue;
1420
- const v = i[x].dataset, N = (h.interest_rate ?? 0) / 100 / 12, C = h.balance * N, A = h.monthly_payment ?? 0;
1421
- let y = A, M = 0;
1422
- !u && r > 0 && (y += r, u = !0), !m && p > 0 && (M = p, m = !0), h.balance += C;
1423
- const b = Math.min(h.balance, y + M);
1424
- if (b <= C) {
1425
- h.is_impossible = !0, i[x].is_impossible = !0, i[x].priority = void 0, v.push({ x: new Date(o), y: h.balance });
1419
+ const A = i[w].dataset, M = (h.interest_rate ?? 0) / 100 / 12, C = h.balance * M, I = h.monthly_payment ?? 0;
1420
+ let y = I, R = 0;
1421
+ !b && r > 0 && (y += r, b = !0), !m && d > 0 && (R = d, m = !0), h.balance += C;
1422
+ const u = Math.min(h.balance, y + R);
1423
+ if (u <= C) {
1424
+ h.is_impossible = !0, i[w].is_impossible = !0, i[w].priority = void 0, A.push({ x: new Date(n), y: h.balance });
1426
1425
  continue;
1427
1426
  }
1428
- h.balance -= b, h.balance = h.balance < 0.01 ? 0 : h.balance, v.push({
1429
- x: new Date(o),
1427
+ h.balance -= u, h.balance = h.balance < 0.01 ? 0 : h.balance, A.push({
1428
+ x: new Date(n),
1430
1429
  y: Math.max(0, h.balance),
1431
- payment: b,
1432
- extra: M
1433
- }), h.balance <= 0 && (p += A, i[x].projected_payoff_date = new Date(o)), b > 0 && (d = !0);
1430
+ payment: u,
1431
+ extra: R
1432
+ }), h.balance <= 0 && (d += I, i[w].projected_payoff_date = new Date(n)), u > 0 && (p = !0);
1434
1433
  }
1435
- d && o.setMonth(o.getMonth() + 1);
1434
+ p && n.setMonth(n.getMonth() + 1);
1436
1435
  }
1437
- return i.forEach((d) => {
1438
- (d.interest_rate === void 0 || d.monthly_payment === void 0) && (d.projected_payoff_date = void 0);
1439
- }), i.forEach((d) => {
1440
- d.priority = !d.is_paid_off && !d.is_impossible ? c++ : void 0;
1436
+ return i.forEach((p) => {
1437
+ (p.interest_rate === void 0 || p.monthly_payment === void 0) && (p.projected_payoff_date = void 0);
1438
+ }), i.forEach((p) => {
1439
+ p.priority = !p.is_paid_off && !p.is_impossible ? c++ : void 0;
1441
1440
  }), i;
1442
- }, Ot = D(({ onClick: a }) => {
1443
- const { debts: n } = S(), { isDesktop: r } = Y(), { totalMonthlyPayments: t } = Z(), { monthlyCashFlowProfile: o } = V(), i = t + Number(o?.extra_payment), p = r ? n.paydown_button_long : n.paydown_button_short;
1441
+ }, Gt = v(({ onClick: a }) => {
1442
+ const { debts: o } = S(), { isDesktop: r } = K(), { totalMonthlyPayments: t } = Z(), { monthlyCashFlowProfile: n } = Y(), i = t + Number(n?.extra_payment), d = r ? o.paydown_button_long : o.paydown_button_short;
1444
1443
  return /* @__PURE__ */ e(
1445
1444
  xe,
1446
1445
  {
@@ -1450,102 +1449,109 @@ const Pt = (a) => {
1450
1449
  "aria-label": "extra-paydown",
1451
1450
  onClick: a,
1452
1451
  sx: { justifyContent: "start", minWidth: 100, mx: 4 },
1453
- children: I(p, k(i, "0,0"))
1452
+ children: E(d, N(i, "0,0"))
1454
1453
  }
1455
1454
  );
1456
- }), Wt = ({ onBackClick: a, sx: n }) => {
1457
- const [r, t] = g.useState(!1), [o, i] = g.useState(!1), [p, c] = g.useState(!1), [d, m] = g.useState(""), { isDesktop: u, isMobile: x } = Y(), { debts: h } = S(), { onEvent: v } = F(), { onLoad: B } = ke(), { isCopyLoaded: N, isInitialized: C, setSelectedAccounts: A } = Ne(), { setSelectedAccount: y } = Re(), { selectedDebtPriority: M, setSelectedDebtChartData: b } = L(), { visibleDebtAccounts: f } = J(), { goalsLoaded: E, loadGoals: $, monthlyCashFlowProfile: R } = V(), { debts: z } = Z(), K = g.useMemo(() => {
1458
- const O = R?.extra_payment ?? 0;
1459
- return Ht(z, M, O);
1460
- }, [z, M, R]);
1461
- g.useEffect(() => {
1462
- A(f), v(T.DEBTS_VIEW);
1463
- }, []), g.useEffect(() => {
1464
- A(f);
1465
- }, [f]), g.useEffect(() => {
1466
- C && $().finally(() => {
1467
- B?.("DebtsWidget");
1468
- });
1469
- }, [C]);
1470
- const oe = (O) => m(O), ie = () => {
1471
- const O = f.find((ee) => ee.guid === d), le = K.find((ee) => ee.guid === d);
1472
- O && y(O), le && b(le), t(!0);
1473
- }, Ce = () => v(T.DEBTS_CLICK_FILTER), Se = () => {
1474
- c(!0), v(T.DEBTS_CLICK_SNOWBALL_CTA);
1475
- }, ve = () => {
1476
- i(!0), v(T.DEBTS_CLICK_PAYDOWN);
1455
+ }), Wt = ({ onBackClick: a, sx: o }) => {
1456
+ const { isDesktop: r, isMobile: t } = K(), { debts: n } = S(), { onEvent: i } = F(), { isInitialized: d } = Ne(), { setSelectedAccount: c } = Fe(), { selectedDebtPriority: p, setSelectedDebtChartData: m } = L(), { isAccountDataLoaded: b, loadAccountData: w, visibleDebtAccounts: h } = J(), { isAllGoalDataLoaded: A, loadGoalData: B, monthlyCashFlowProfile: M } = Y(), { debts: C } = Z(), [I, y] = x.useState(!1), [R, u] = x.useState(!1), [f, D] = x.useState(!1), [P, $] = x.useState("");
1457
+ tt({
1458
+ widgetName: "DebtsWidget",
1459
+ isLoaded: A
1460
+ });
1461
+ const H = x.useMemo(() => {
1462
+ const G = M?.extra_payment ?? 0;
1463
+ return Ht(C, p, G);
1464
+ }, [C, p, M]);
1465
+ x.useEffect(() => {
1466
+ b || w().finally(), i(T.DEBTS_VIEW);
1467
+ }, []), x.useEffect(() => {
1468
+ d && B().finally();
1469
+ }, [d]);
1470
+ const ne = (G) => $(G), ie = () => {
1471
+ const G = h.find((ee) => ee.guid === P), le = H.find((ee) => ee.guid === P);
1472
+ G && c(G), le && m(le), y(!0);
1473
+ }, Se = () => i(T.DEBTS_CLICK_FILTER), ve = () => {
1474
+ D(!0), i(T.DEBTS_CLICK_SNOWBALL_CTA);
1475
+ }, De = () => {
1476
+ u(!0), i(T.DEBTS_CLICK_PAYDOWN);
1477
1477
  };
1478
- return !E || !N || !C ? /* @__PURE__ */ e(et, {}) : /* @__PURE__ */ s(
1479
- Ge,
1478
+ return !d || !A ? /* @__PURE__ */ e(et, {}) : /* @__PURE__ */ s(
1479
+ We,
1480
1480
  {
1481
- accountOptions: f,
1482
1481
  actions: [
1483
- /* @__PURE__ */ e($t, {}, "prioritize-debts"),
1484
- /* @__PURE__ */ e(Ot, { onClick: ve }, "extra-paydown")
1482
+ /* @__PURE__ */ e(Ot, {}, "prioritize-debts"),
1483
+ /* @__PURE__ */ e(Gt, { onClick: De }, "extra-paydown")
1484
+ ],
1485
+ allowedAccountTypes: [
1486
+ X.CREDIT_CARD,
1487
+ X.LOAN,
1488
+ X.MORTGAGE,
1489
+ X.LINE_OF_CREDIT,
1490
+ X.CHECKING_LINE_OF_CREDIT
1485
1491
  ],
1486
- onAccountsFilterClick: Ce,
1492
+ onAccountsFilterClick: Se,
1487
1493
  onBackClick: a,
1488
- sx: n,
1489
- title: h.title,
1494
+ sx: o,
1495
+ title: n.title,
1490
1496
  children: [
1491
- /* @__PURE__ */ s(w, { sx: { px: u ? "48px" : "24px" }, children: [
1497
+ /* @__PURE__ */ s(g, { sx: { px: r ? "48px" : "24px" }, children: [
1492
1498
  /* @__PURE__ */ s(
1493
- w,
1499
+ g,
1494
1500
  {
1495
1501
  sx: {
1496
- alignItems: x ? "flex-start" : "flex-end",
1497
- flexDirection: x ? "column" : "row",
1498
- mx: x ? "-12px" : 0
1502
+ alignItems: t ? "flex-start" : "flex-end",
1503
+ flexDirection: t ? "column" : "row",
1504
+ mx: t ? "-12px" : 0
1499
1505
  },
1500
1506
  children: [
1501
1507
  /* @__PURE__ */ e(
1502
- we,
1508
+ Ce,
1503
1509
  {
1504
- debts: K,
1505
- height: x ? 250 : void 0,
1506
- hoveredDebtGuid: d,
1510
+ debts: H,
1511
+ height: t ? 250 : void 0,
1512
+ hoveredDebtGuid: P,
1507
1513
  onClickArea: ie,
1508
- onHoverArea: oe,
1509
- sx: { mr: x ? "4px" : "-48px" }
1514
+ onHoverArea: ne,
1515
+ sx: { mr: t ? "4px" : "-48px" }
1510
1516
  }
1511
1517
  ),
1512
1518
  /* @__PURE__ */ e(
1513
- lt,
1519
+ st,
1514
1520
  {
1515
- debts: K,
1516
- onClickCta: Se,
1517
- sx: { mb: x ? "0px" : "64px" }
1521
+ debts: H,
1522
+ onClickCta: ve,
1523
+ sx: { mb: t ? "0px" : "64px" }
1518
1524
  }
1519
1525
  )
1520
1526
  ]
1521
1527
  }
1522
1528
  ),
1523
- /* @__PURE__ */ e(w, { sx: { mx: x ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1529
+ /* @__PURE__ */ e(g, { sx: { mx: t ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1524
1530
  Ft,
1525
1531
  {
1526
- debts: K,
1527
- hoveredDebtGuid: d,
1532
+ debts: H,
1533
+ hoveredDebtGuid: P,
1528
1534
  onClickRow: ie,
1529
- onHoverRow: oe
1535
+ onHoverRow: ne
1530
1536
  }
1531
1537
  ) })
1532
1538
  ] }),
1533
1539
  /* @__PURE__ */ e(
1534
- ct,
1540
+ dt,
1535
1541
  {
1536
- isOpen: p,
1537
- onClose: () => c(!1)
1542
+ isOpen: f,
1543
+ onClose: () => D(!1)
1538
1544
  }
1539
1545
  ),
1540
- /* @__PURE__ */ e(Dt, { isOpen: r, onClose: () => t(!1) }),
1541
- /* @__PURE__ */ e(It, { isOpen: o, onClose: () => i(!1) })
1546
+ /* @__PURE__ */ e(Tt, { isOpen: I, onClose: () => y(!1) }),
1547
+ /* @__PURE__ */ e(Bt, { isOpen: R, onClose: () => u(!1) })
1542
1548
  ]
1543
1549
  }
1544
1550
  );
1545
- }, Nr = D(Wt);
1551
+ }, Fr = v(Wt);
1546
1552
  export {
1547
- we as DebtsChart,
1548
- Lr as DebtsStore,
1553
+ Ce as DebtsChart,
1554
+ Or as DebtsStore,
1549
1555
  Ft as DebtsTable,
1550
- Nr as DebtsWidget
1556
+ Fr as DebtsWidget
1551
1557
  };