@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.
- package/CHANGELOG.md +217 -0
- package/dist/{Account-Cp30A3ad.mjs → Account-BIKn4XEZ.mjs} +1 -1
- package/dist/Account-CMjOp7S2.mjs +118 -0
- package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
- package/dist/AccountDetailsHeader-BOV91g1o.mjs +95 -0
- package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
- package/dist/{AccountFields-CW6cIthP.mjs → AccountFields-BRRH37K1.mjs} +10 -11
- package/dist/{AccountListItem-DxmAs98Z.mjs → AccountListItem-Ds5C0mOT.mjs} +4 -4
- package/dist/{AccountStore-hIs-yA6W.mjs → AccountStore-BFKvXJSD.mjs} +79 -69
- package/dist/{Accounts-DUHkUyK4.mjs → Accounts-CuE8aSZN.mjs} +1 -1
- package/dist/{BudgetUtil-CIDAPPPT.mjs → BudgetUtil-CDSOZXem.mjs} +4 -4
- package/dist/CategorySelectorDrawer-C4aZYP4N.mjs +418 -0
- package/dist/CategoryStore-DEqAnHbi.mjs +186 -0
- package/dist/{CategoryUtil-DfVKKkRf.mjs → CategoryUtil-CFHBvaV4.mjs} +1 -1
- package/dist/{ConnectionsDrawer-CSo6AFkG.mjs → ConnectionsDrawer-BExzgE16.mjs} +5 -5
- package/dist/{CurrencyInput-BrGvhgVK.mjs → CurrencyInput-DDQ4DBrE.mjs} +1 -1
- package/dist/{CurrencyText-Dr0EZ7bp.mjs → CurrencyText-C-85TnUF.mjs} +3 -3
- package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CVsMhbZU.mjs} +3 -3
- package/dist/{DebtsStore-hi1cqrRk.mjs → DebtsStore-Dv_T7Dts.mjs} +12 -12
- package/dist/{Dialog-CDV0kKxj.mjs → Dialog-CWymUiuO.mjs} +32 -35
- package/dist/Drawer-Bet2ZPJo.mjs +176 -0
- package/dist/{ExportCsvAction-CQ1grpwo.mjs → ExportCsvAction-oG_Mn66T.mjs} +3 -3
- package/dist/{FinstrongStore-dKZOZ2hM.mjs → FinstrongStore-BjFkMTIL.mjs} +6 -6
- package/dist/GlobalAccountFilter-BpWlPAl5.mjs +316 -0
- package/dist/{GoalStore-CFeAJloA.mjs → GoalStore-Dbjgft2i.mjs} +155 -137
- package/dist/{Help-i4OasOO-.mjs → Help-BW_ar-4B.mjs} +2 -2
- package/dist/LineChart-DHj-Bufi.mjs +580 -0
- package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-Cbr3417C.mjs} +10 -10
- package/dist/{ManageIncome-D_qVX5dN.mjs → ManageIncome-DIIyqDTp.mjs} +85 -85
- package/dist/{MicroWidgetContainer-BGpNl5ZS.mjs → MicroWidgetContainer-DSyYwRCU.mjs} +2 -2
- package/dist/{MiniWidgetContainer-D7MkHG15.mjs → MiniWidgetContainer-DKn7ndO6.mjs} +1 -1
- package/dist/NetWorthStore-B6ziBtaH.mjs +168 -0
- package/dist/NotificationSettings-e789PcRb.mjs +676 -0
- package/dist/{OriginalBalanceAction-62e0mU_3.mjs → OriginalBalanceAction-DFoG79Ba.mjs} +3 -3
- package/dist/{RecurringSettings-RfZ8Wuhh.mjs → RecurringSettings-BpCUcE8w.mjs} +4 -4
- package/dist/{RecurringTransactionsStore-D3EOKZ2B.mjs → RecurringTransactionsStore-D_--5PWH.mjs} +1 -1
- package/dist/{RecurringTransactions-Bhx56aA3.mjs → RepeatingTransaction-C2txVA9O.mjs} +3 -3
- package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-CInvh-rQ.mjs} +1 -1
- package/dist/SpendingData-B7NuTQ9s.mjs +53 -0
- package/dist/SpendingLegend-BxefXiQd.mjs +193 -0
- package/dist/TransactionDetails-CPwv9xtZ.mjs +1374 -0
- package/dist/{TransactionStore-DgLrYW4C.mjs → TransactionStore-D2aMUClq.mjs} +128 -111
- package/dist/TrendsStore-BdsYfCc7.mjs +183 -0
- package/dist/{User-DqNX2GAK.mjs → User-CulNdZUr.mjs} +21 -20
- package/dist/ViewMoreMicroCard-CDWR16_h.mjs +1147 -0
- package/dist/WidgetContainer-mzejMmz2.mjs +555 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +1 -0
- package/dist/accounts/index.es.js +933 -232
- package/dist/accounts/stores/AccountStore.d.ts +6 -2
- package/dist/accounts/utils/AccountDetails.d.ts +5 -0
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/components/AddBudgets.d.ts +2 -1
- package/dist/budgets/index.es.js +561 -522
- package/dist/cashflow/index.es.js +397 -396
- package/dist/categories/components/CustomCategories/AddSubcategory.d.ts +1 -0
- package/dist/categories/components/CustomCategories/DeleteSubcategory.d.ts +1 -0
- package/dist/categories/components/CustomCategories/RenameSubcategory.d.ts +1 -0
- package/dist/categories/components/SubcategoryRow.d.ts +1 -0
- package/dist/categories/index.es.js +2 -2
- package/dist/categories/stores/CategoryStore.d.ts +5 -3
- package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
- package/dist/common/components/WidgetContainer.d.ts +7 -6
- package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
- package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
- package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
- package/dist/common/components/index.d.ts +2 -2
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
- package/dist/common/index.es.js +325 -306
- package/dist/common/stores/GlobalUiStore.d.ts +7 -4
- package/dist/common/types/localization/AccountsCopy.d.ts +6 -0
- package/dist/common/types/localization/CategoryCopy.d.ts +3 -0
- package/dist/common/types/localization/CommonCopy.d.ts +3 -0
- package/dist/common/types/localization/GoalsCopy.d.ts +3 -1
- package/dist/common/types/localization/MicroInsightsCopy.d.ts +1 -0
- package/dist/common/types/localization/TransactionsCopy.d.ts +4 -0
- package/dist/common/types/localization/TrendsCopy.d.ts +4 -0
- package/dist/dashboard/index.es.js +95 -125
- package/dist/debts/index.es.js +466 -460
- package/dist/{exportTransactionsToCSV-BFpuIAXW.mjs → exportTransactionsToCSV-BU1jTY0Q.mjs} +4 -4
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
- package/dist/finstrong/index.es.js +1660 -1553
- package/dist/goals/index.es.js +716 -677
- package/dist/goals/stores/GoalStore.d.ts +2 -0
- package/dist/help/index.es.js +14 -10
- package/dist/{hooks-C41HAxM5.mjs → hooks-fY_n74f7.mjs} +16 -16
- package/dist/investments/index.es.js +464 -457
- package/dist/merchants/index.es.js +1 -1
- package/dist/microinsights/MicroCardTemplate.d.ts +23 -0
- package/dist/microinsights/beaticons/BeatMaterialIcon.d.ts +8 -0
- package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +1 -2
- package/dist/microinsights/beaticons/index.d.ts +1 -0
- package/dist/microinsights/cards/InsightCard.d.ts +0 -2
- package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +2 -5
- package/dist/microinsights/index.d.ts +2 -2
- package/dist/microinsights/index.es.js +824 -14
- package/dist/networth/components/NetWorthChart.d.ts +3 -2
- package/dist/networth/components/NetWorthList.d.ts +3 -3
- package/dist/networth/index.es.js +433 -438
- package/dist/networth/stores/NetWorthStore.d.ts +20 -9
- package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
- package/dist/notifications/index.es.js +5 -5
- package/dist/recurringtransactions/index.es.js +331 -325
- package/dist/settings/index.es.js +293 -285
- package/dist/spending/components/SpendingChart.d.ts +1 -1
- package/dist/spending/components/SpendingList.d.ts +1 -1
- package/dist/spending/components/SpendingTabLabel.d.ts +1 -0
- package/dist/spending/index.es.js +250 -235
- package/dist/transactions/index.es.js +288 -281
- package/dist/transactions/stores/TransactionStore.d.ts +5 -0
- package/dist/trends/components/TrendsTable.d.ts +0 -2
- package/dist/trends/index.es.js +876 -802
- package/dist/trends/utils/TrendsData.d.ts +1 -0
- package/dist/trends/utils/TrendsTable.d.ts +12 -0
- package/dist/{useAccountDisplayName-usSZCQ7I.mjs → useAccountDisplayName-DbkgGLdg.mjs} +2 -2
- package/dist/useAriaLive-B3_pRUio.mjs +35 -0
- package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-dhmXeSyF.mjs} +1 -1
- package/dist/useWidgetLoadTimer-CrUzxN-P.mjs +19 -0
- package/package.json +26 -21
- package/dist/AccountDetailsContent-C1HumFnW.mjs +0 -683
- package/dist/AccountDetailsHeader-NMx79DGs.mjs +0 -87
- package/dist/CategorySelectorDrawer-DqDAA_5I.mjs +0 -399
- package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
- package/dist/ConnectDrawer-Dn1MlqLz.mjs +0 -545
- package/dist/Drawer-Dqe5EqvA.mjs +0 -163
- package/dist/LineChart-bc1D9xBE.mjs +0 -581
- package/dist/NetWorthStore-8FFC1Bs0.mjs +0 -150
- package/dist/NotificationSettings-BsWiYD94.mjs +0 -672
- package/dist/SpendingData-DPQ96k3x.mjs +0 -55
- package/dist/SpendingLegend-CZzDb-7d.mjs +0 -193
- package/dist/TransactionDetails-Duv1X9ec.mjs +0 -1379
- package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
- package/dist/ViewMoreMicroCard-CH9E-jOx.mjs +0 -1930
- package/dist/WidgetContainer-B1Jzb4XA.mjs +0 -565
- package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
- package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
- package/dist/common/components/accountfilter/index.d.ts +0 -1
- package/dist/microinsights/cards/BaseCard.d.ts +0 -13
- package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
package/dist/debts/index.es.js
CHANGED
|
@@ -1,69 +1,70 @@
|
|
|
1
|
-
import { jsx as e, jsxs as s, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import { Text as l, H3 as
|
|
7
|
-
import { intervalToDuration as
|
|
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
|
|
12
|
-
import { a as
|
|
13
|
-
import { f as U,
|
|
14
|
-
import { f as
|
|
15
|
-
import { G as
|
|
16
|
-
import { u as
|
|
17
|
-
import { D as re } from "../Drawer-
|
|
18
|
-
import { b as
|
|
19
|
-
import { A as
|
|
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
|
|
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
|
|
26
|
-
import {
|
|
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
|
|
30
|
-
import
|
|
31
|
-
import { M as ze, I as Xe, O as Ve } from "../OriginalBalanceAction-
|
|
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-
|
|
34
|
-
import { C as
|
|
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
|
|
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
|
|
42
|
-
import {
|
|
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
|
-
|
|
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 =
|
|
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
|
-
},
|
|
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
|
|
59
|
+
const p = o - t * (c + 1), m = o - t * c, b = p >= 0 ? t : m;
|
|
59
60
|
i.push({
|
|
60
|
-
balance:
|
|
61
|
+
balance: p >= 0 ? p : 0,
|
|
61
62
|
interest: r,
|
|
62
|
-
payment:
|
|
63
|
-
principal:
|
|
63
|
+
payment: b,
|
|
64
|
+
principal: b,
|
|
64
65
|
timestamp: de(
|
|
65
66
|
se(
|
|
66
|
-
ce(
|
|
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
|
|
77
|
+
const d = r / 1200;
|
|
77
78
|
for (let c = 0; c < a; c++) {
|
|
78
|
-
const
|
|
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:
|
|
83
|
-
principal:
|
|
84
|
-
timestamp:
|
|
83
|
+
payment: A,
|
|
84
|
+
principal: A - B,
|
|
85
|
+
timestamp: p
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
return i;
|
|
88
|
-
},
|
|
89
|
-
const { monthly_payment:
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
), c =
|
|
94
|
+
o ?? 0,
|
|
95
|
+
n
|
|
96
|
+
), c = ot(d);
|
|
96
97
|
return {
|
|
97
98
|
...a,
|
|
98
99
|
minimumFinalPayment: c,
|
|
99
|
-
minimumPayments:
|
|
100
|
+
minimumPayments: d
|
|
100
101
|
};
|
|
101
|
-
},
|
|
102
|
+
}, we = (a, o) => {
|
|
102
103
|
const [r, t] = a.reduce(
|
|
103
|
-
([
|
|
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 (
|
|
107
|
-
case
|
|
108
|
-
r.sort((
|
|
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
|
|
111
|
-
r.sort((
|
|
111
|
+
case k.HIGHEST_INTEREST:
|
|
112
|
+
r.sort((n, i) => (i.interest_rate ?? 0) - (n.interest_rate ?? 0));
|
|
112
113
|
break;
|
|
113
|
-
case
|
|
114
|
-
r.sort((
|
|
114
|
+
case k.LOWEST_BALANCE:
|
|
115
|
+
r.sort((n, i) => n.balance - i.balance);
|
|
115
116
|
break;
|
|
116
|
-
case
|
|
117
|
-
r.sort((
|
|
117
|
+
case k.HIGHEST_BALANCE:
|
|
118
|
+
r.sort((n, i) => i.balance - n.balance);
|
|
118
119
|
break;
|
|
119
120
|
default:
|
|
120
|
-
r.sort((
|
|
121
|
+
r.sort((n, i) => n.balance - i.balance);
|
|
121
122
|
}
|
|
122
123
|
a.splice(0, a.length, ...r, ...t);
|
|
123
124
|
};
|
|
124
|
-
function
|
|
125
|
-
const t = a.map((
|
|
126
|
-
(
|
|
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
|
-
|
|
129
|
-
let
|
|
130
|
-
const
|
|
131
|
-
for (; t.some((
|
|
132
|
-
let
|
|
133
|
-
for (const [
|
|
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,
|
|
136
|
+
const B = (h.interest_rate ?? 0) / 100 / 12, M = h.balance * B;
|
|
136
137
|
let C = h.monthly_payment ?? 0;
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
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 -=
|
|
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
|
-
|
|
146
|
+
b && c.setMonth(c.getMonth() + 1);
|
|
146
147
|
}
|
|
147
|
-
const
|
|
148
|
+
const p = t.some((b) => b.is_impossible && b.balance > 0), m = Ee({ start: d, end: c });
|
|
148
149
|
return {
|
|
149
|
-
payoffSavings:
|
|
150
|
-
payoffDate:
|
|
151
|
-
payoffDuration:
|
|
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 (!
|
|
156
|
+
if (!x.useContext(ke))
|
|
156
157
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
157
158
|
return Z().uiStore;
|
|
158
|
-
},
|
|
159
|
-
const t =
|
|
160
|
-
const
|
|
161
|
-
return
|
|
162
|
-
}, [a,
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
193
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Small", children:
|
|
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:
|
|
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
|
-
},
|
|
211
|
-
const r =
|
|
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:
|
|
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(
|
|
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:
|
|
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(!
|
|
245
|
+
onClick: () => i(!n),
|
|
245
246
|
sx: { cursor: "pointer" },
|
|
246
247
|
variant: "Small",
|
|
247
|
-
children:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
300
|
+
E(
|
|
300
301
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
301
302
|
"$100"
|
|
302
303
|
),
|
|
303
|
-
/* @__PURE__ */ e("strong", { children:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
427
|
+
E(
|
|
427
428
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
428
429
|
"$500"
|
|
429
430
|
),
|
|
430
|
-
/* @__PURE__ */ e("strong", { children:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
},
|
|
572
|
-
function
|
|
573
|
-
const [r, t,
|
|
574
|
-
Math.max(0, Math.min(255, Math.round(r *
|
|
575
|
-
Math.max(0, Math.min(255, Math.round(t *
|
|
576
|
-
Math.max(0, Math.min(255, Math.round(
|
|
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
|
|
581
|
+
const Ce = ({
|
|
581
582
|
sx: a,
|
|
582
|
-
height:
|
|
583
|
+
height: o = 500,
|
|
583
584
|
width: r,
|
|
584
585
|
debts: t,
|
|
585
|
-
hoveredDebtGuid:
|
|
586
|
+
hoveredDebtGuid: n,
|
|
586
587
|
onClickArea: i,
|
|
587
|
-
onHoverArea:
|
|
588
|
+
onHoverArea: d
|
|
588
589
|
}) => {
|
|
589
|
-
const c =
|
|
590
|
+
const c = He(), { onEvent: p } = F(), m = t.filter((u) => !u.is_impossible), b = [
|
|
590
591
|
...new Set(
|
|
591
|
-
m.flatMap((
|
|
592
|
+
m.flatMap((u) => u.dataset.map((f) => new Date(f.x).getTime()))
|
|
592
593
|
)
|
|
593
|
-
].sort((
|
|
594
|
-
const f = new Map(
|
|
595
|
-
let
|
|
596
|
-
const
|
|
597
|
-
const
|
|
598
|
-
return
|
|
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 { ...
|
|
601
|
-
}), h =
|
|
602
|
-
(
|
|
601
|
+
return { ...u, dataset: P };
|
|
602
|
+
}), h = w.reduce(
|
|
603
|
+
(u, f) => u + (f.dataset[0]?.y ?? 0),
|
|
603
604
|
0
|
|
604
|
-
),
|
|
605
|
-
const
|
|
606
|
-
return { x:
|
|
607
|
-
}), B = Math.ceil(h / 100) * 100,
|
|
608
|
-
const
|
|
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:
|
|
612
|
-
label:
|
|
613
|
-
data:
|
|
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:
|
|
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
|
|
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
|
-
|
|
651
|
+
Ge,
|
|
651
652
|
{
|
|
652
653
|
axisHighlight: { x: "none" },
|
|
653
654
|
disableLineItemHighlight: !0,
|
|
654
|
-
height:
|
|
655
|
-
|
|
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
|
|
658
|
-
|
|
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: (
|
|
661
|
-
const f = C.find((
|
|
662
|
-
|
|
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-${
|
|
687
|
+
[`& .MuiLineElement-series-debt-${I(n ?? "0")}`]: {
|
|
689
688
|
opacity: 1
|
|
690
689
|
},
|
|
691
|
-
[`& .MuiAreaElement-series-debt-${
|
|
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:
|
|
704
|
-
scaleType: "time",
|
|
705
|
-
min: u[0],
|
|
701
|
+
data: M,
|
|
706
702
|
disableTicks: !0,
|
|
707
|
-
|
|
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: (
|
|
714
|
+
valueFormatter: (u) => N(u, "0a")
|
|
716
715
|
}
|
|
717
716
|
]
|
|
718
717
|
}
|
|
719
718
|
)
|
|
720
719
|
}
|
|
721
720
|
);
|
|
722
|
-
},
|
|
723
|
-
const a =
|
|
724
|
-
return /* @__PURE__ */ s(
|
|
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(
|
|
735
|
-
/* @__PURE__ */ e($e, { sx: { p: 0 }, children: /* @__PURE__ */ e(
|
|
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:
|
|
744
|
+
children: o.details_chart_description
|
|
746
745
|
}
|
|
747
746
|
)
|
|
748
747
|
] });
|
|
749
|
-
},
|
|
750
|
-
const a =
|
|
751
|
-
return
|
|
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(
|
|
761
|
-
/* @__PURE__ */ s(
|
|
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:
|
|
766
|
-
|
|
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(
|
|
777
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children: U(
|
|
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(
|
|
781
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "Body", children:
|
|
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: `+${
|
|
788
|
+
children: `+${N(p, "0,0")}`
|
|
790
789
|
}
|
|
791
790
|
)
|
|
792
791
|
] })
|
|
793
792
|
]
|
|
794
793
|
}
|
|
795
|
-
) }) }, String(
|
|
796
|
-
/* @__PURE__ */ e(
|
|
797
|
-
|
|
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
|
-
},
|
|
814
|
-
const { debts:
|
|
815
|
-
await r({ ...a.account, interest_rate:
|
|
816
|
-
},
|
|
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:
|
|
825
|
-
label: `${
|
|
826
|
-
onCancel:
|
|
823
|
+
isSaveDisabled: d,
|
|
824
|
+
label: `${o.details_interest_rate} (%)`,
|
|
825
|
+
onCancel: p,
|
|
827
826
|
onSave: c,
|
|
828
|
-
primaryText:
|
|
829
|
-
secondaryText:
|
|
830
|
-
zeroStateText: a.interest_rate ? void 0 :
|
|
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:
|
|
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:
|
|
837
|
+
value: n
|
|
839
838
|
}
|
|
840
839
|
)
|
|
841
840
|
}
|
|
842
841
|
);
|
|
843
|
-
}),
|
|
844
|
-
const { debts:
|
|
845
|
-
await r({ ...a.account, minimum_payment:
|
|
846
|
-
},
|
|
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:
|
|
855
|
-
label:
|
|
856
|
-
onCancel:
|
|
853
|
+
isSaveDisabled: d,
|
|
854
|
+
label: o.details_monthly_payment,
|
|
855
|
+
onCancel: p,
|
|
857
856
|
onSave: c,
|
|
858
|
-
primaryText:
|
|
859
|
-
secondaryText:
|
|
860
|
-
zeroStateText: a.monthly_payment ? void 0 :
|
|
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
|
-
|
|
861
|
+
oe,
|
|
863
862
|
{
|
|
864
|
-
amount:
|
|
863
|
+
amount: n,
|
|
865
864
|
autoFocus: !0,
|
|
866
|
-
error:
|
|
865
|
+
error: d,
|
|
867
866
|
fullWidth: !0,
|
|
868
867
|
minAmount: 0,
|
|
869
|
-
setAmount: (m) => i(isNaN(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
|
-
}),
|
|
876
|
-
const { debts:
|
|
877
|
-
await r({ ...a.account, original_balance:
|
|
878
|
-
},
|
|
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:
|
|
887
|
-
label:
|
|
888
|
-
onCancel:
|
|
885
|
+
isSaveDisabled: d,
|
|
886
|
+
label: o.details_original_balance,
|
|
887
|
+
onCancel: p,
|
|
889
888
|
onSave: c,
|
|
890
|
-
primaryText:
|
|
891
|
-
secondaryText:
|
|
892
|
-
zeroStateText: a.original_balance ? void 0 :
|
|
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
|
-
|
|
893
|
+
oe,
|
|
895
894
|
{
|
|
896
|
-
amount:
|
|
895
|
+
amount: n,
|
|
897
896
|
autoFocus: !0,
|
|
898
|
-
error:
|
|
897
|
+
error: d,
|
|
899
898
|
fullWidth: !0,
|
|
900
899
|
minAmount: 0,
|
|
901
|
-
setAmount: (m) => i(isNaN(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:
|
|
909
|
-
return
|
|
910
|
-
|
|
911
|
-
/* @__PURE__ */ e(ze, { goal:
|
|
912
|
-
/* @__PURE__ */ e(
|
|
913
|
-
/* @__PURE__ */ e(Xe, { goal:
|
|
914
|
-
/* @__PURE__ */ e(
|
|
915
|
-
/* @__PURE__ */ e(Ve, { goal:
|
|
916
|
-
/* @__PURE__ */ e(
|
|
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
|
-
!
|
|
919
|
-
/* @__PURE__ */ e(
|
|
920
|
-
/* @__PURE__ */ e(
|
|
921
|
-
/* @__PURE__ */ e(
|
|
922
|
-
/* @__PURE__ */ e(
|
|
923
|
-
/* @__PURE__ */ e(
|
|
924
|
-
/* @__PURE__ */ e(
|
|
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
|
-
},
|
|
928
|
-
const { debts: r } = S(), { showError: t, showCompleted:
|
|
929
|
-
return
|
|
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 && !
|
|
932
|
-
/* @__PURE__ */ e(ue, { sx: { my: 16, mx: 24, ...
|
|
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(
|
|
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, ...
|
|
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(
|
|
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
|
-
},
|
|
973
|
-
const { debts: a } = S(), { showError:
|
|
974
|
-
return /* @__PURE__ */ s(
|
|
975
|
-
(
|
|
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,
|
|
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(
|
|
1006
|
-
/* @__PURE__ */ e(be, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(
|
|
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
|
-
},
|
|
1009
|
-
const { debts: r } = S(), { showError: t, showCompleted:
|
|
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:
|
|
1014
|
+
onClose: o,
|
|
1016
1015
|
title: r.details_title,
|
|
1017
|
-
children: /* @__PURE__ */ s(
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1019
|
-
/* @__PURE__ */ e(
|
|
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
|
-
},
|
|
1024
|
-
const { debts: a } = S(), { monthlyCashFlowProfile:
|
|
1025
|
-
|
|
1026
|
-
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
|
-
},
|
|
1027
|
+
}, p = () => {
|
|
1029
1028
|
setTimeout(() => {
|
|
1030
|
-
i(
|
|
1029
|
+
i(o?.extra_payment ?? 0);
|
|
1031
1030
|
}, 250);
|
|
1032
1031
|
};
|
|
1033
1032
|
return /* @__PURE__ */ e(
|
|
1034
1033
|
Q,
|
|
1035
1034
|
{
|
|
1036
|
-
isSaveDisabled:
|
|
1035
|
+
isSaveDisabled: d,
|
|
1037
1036
|
label: a.paydown_drawer_extra_payment,
|
|
1038
|
-
onCancel:
|
|
1037
|
+
onCancel: p,
|
|
1039
1038
|
onSave: c,
|
|
1040
1039
|
primaryText: a.paydown_drawer_extra_payment,
|
|
1041
|
-
secondaryText:
|
|
1042
|
-
zeroStateText:
|
|
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
|
-
|
|
1043
|
+
oe,
|
|
1045
1044
|
{
|
|
1046
|
-
amount:
|
|
1045
|
+
amount: n,
|
|
1047
1046
|
autoFocus: !0,
|
|
1048
|
-
error:
|
|
1047
|
+
error: d,
|
|
1049
1048
|
fullWidth: !0,
|
|
1050
1049
|
minAmount: 0,
|
|
1051
|
-
setAmount: (m) => i(isNaN(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
|
-
}),
|
|
1058
|
-
const { debts: a } = S(), { totalMonthlyPayments:
|
|
1059
|
-
return /* @__PURE__ */ s(
|
|
1060
|
-
/* @__PURE__ */ s(
|
|
1061
|
-
/* @__PURE__ */ s(
|
|
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(
|
|
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(
|
|
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(
|
|
1072
|
-
/* @__PURE__ */ e(
|
|
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:
|
|
1073
|
+
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "Body", children: N(t, "0,0") })
|
|
1075
1074
|
] }) })
|
|
1076
1075
|
] });
|
|
1077
|
-
},
|
|
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:
|
|
1083
|
+
onClose: o,
|
|
1085
1084
|
title: r.paydown_drawer_title,
|
|
1086
|
-
children: /* @__PURE__ */ e(
|
|
1085
|
+
children: /* @__PURE__ */ e(It, {})
|
|
1087
1086
|
}
|
|
1088
1087
|
);
|
|
1089
1088
|
};
|
|
1090
|
-
function
|
|
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(
|
|
1095
|
+
return r(a) - r(o);
|
|
1097
1096
|
}
|
|
1098
|
-
function
|
|
1097
|
+
function Pt(a) {
|
|
1099
1098
|
return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
|
|
1100
1099
|
}
|
|
1101
|
-
const
|
|
1102
|
-
const
|
|
1100
|
+
const kt = (a) => {
|
|
1101
|
+
const o = {
|
|
1103
1102
|
text: "#121417",
|
|
1104
1103
|
background: "#FFB252"
|
|
1105
1104
|
};
|
|
1106
|
-
return a === "!" && (
|
|
1107
|
-
},
|
|
1108
|
-
const
|
|
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:
|
|
1122
|
+
children: /* @__PURE__ */ e(l, { color: r.text, fontWeight: 700, variant: "Small", children: o })
|
|
1124
1123
|
}
|
|
1125
1124
|
);
|
|
1126
|
-
},
|
|
1127
|
-
const
|
|
1128
|
-
return /* @__PURE__ */ s(
|
|
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
|
-
|
|
1129
|
+
Ae,
|
|
1131
1130
|
{
|
|
1132
|
-
alt: `${
|
|
1133
|
-
institutionGuid:
|
|
1131
|
+
alt: `${o.institutionName}`,
|
|
1132
|
+
institutionGuid: o.institution_guid || ""
|
|
1134
1133
|
}
|
|
1135
1134
|
),
|
|
1136
|
-
/* @__PURE__ */ s(
|
|
1137
|
-
/* @__PURE__ */ e(l, { variant: "Small", children:
|
|
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:
|
|
1142
|
+
debts: o,
|
|
1144
1143
|
hoveredDebtGuid: r,
|
|
1145
1144
|
onHoverRow: t,
|
|
1146
|
-
onClickRow:
|
|
1145
|
+
onClickRow: n
|
|
1147
1146
|
}) => {
|
|
1148
|
-
const i =
|
|
1147
|
+
const i = V(), { onEvent: d } = F(), { isMobile: c } = K(), { debts: p } = S(), [m, b] = x.useState([
|
|
1149
1148
|
{ field: "priority", sort: "asc" }
|
|
1150
|
-
]),
|
|
1149
|
+
]), w = [
|
|
1151
1150
|
{
|
|
1152
1151
|
field: "priority",
|
|
1153
|
-
headerName:
|
|
1154
|
-
renderHeader:
|
|
1155
|
-
renderCell:
|
|
1156
|
-
sortComparator:
|
|
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:
|
|
1168
|
-
renderHeader:
|
|
1169
|
-
renderCell:
|
|
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:
|
|
1180
|
-
renderHeader:
|
|
1181
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children:
|
|
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:
|
|
1193
|
-
renderHeader:
|
|
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:
|
|
1206
|
-
renderHeader:
|
|
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:
|
|
1219
|
-
renderHeader:
|
|
1220
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "Small", children: typeof y.value == "number" ?
|
|
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
|
-
...
|
|
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
|
-
],
|
|
1242
|
+
], A = x.useMemo(() => o.map((y, R) => ({
|
|
1244
1243
|
...y,
|
|
1245
|
-
id:
|
|
1246
|
-
priority:
|
|
1247
|
-
})), [
|
|
1248
|
-
const f = y.target.closest("[data-id]")?.getAttribute("data-id"),
|
|
1249
|
-
t?.(
|
|
1250
|
-
},
|
|
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
|
-
},
|
|
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 :
|
|
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
|
-
|
|
1274
|
+
n(), d(T.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
|
|
1276
1275
|
},
|
|
1277
1276
|
onSortModelChange: (y) => {
|
|
1278
|
-
|
|
1277
|
+
b(y), d(T.DEBTS_CLICK_TABLE_SORT);
|
|
1279
1278
|
},
|
|
1280
|
-
rows:
|
|
1279
|
+
rows: A,
|
|
1281
1280
|
slotProps: {
|
|
1282
1281
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
|
1283
1282
|
row: {
|
|
1284
|
-
onMouseEnter:
|
|
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="${
|
|
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
|
-
},
|
|
1303
|
-
const { isDesktop: t, isTablet:
|
|
1304
|
-
return t ||
|
|
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
|
-
},
|
|
1328
|
-
const { onEvent: r } = F(), { debts: t } = S(), { selectedDebtPriority:
|
|
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:
|
|
1329
|
+
priority: k.FASTEST_PAYOFF_FIRST,
|
|
1331
1330
|
text: t.priority_sort_fastest_payoff
|
|
1332
1331
|
},
|
|
1333
1332
|
{
|
|
1334
|
-
priority:
|
|
1333
|
+
priority: k.HIGHEST_INTEREST,
|
|
1335
1334
|
text: t.priority_sort_highest_interest
|
|
1336
1335
|
},
|
|
1337
1336
|
{
|
|
1338
|
-
priority:
|
|
1337
|
+
priority: k.LOWEST_BALANCE,
|
|
1339
1338
|
text: t.priority_sort_lowest_balance
|
|
1340
1339
|
},
|
|
1341
1340
|
{
|
|
1342
|
-
priority:
|
|
1341
|
+
priority: k.HIGHEST_BALANCE,
|
|
1343
1342
|
text: t.priority_sort_highest_balance
|
|
1344
1343
|
}
|
|
1345
|
-
],
|
|
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:
|
|
1358
|
-
open:
|
|
1356
|
+
onClose: o,
|
|
1357
|
+
open: d,
|
|
1359
1358
|
transformOrigin: {
|
|
1360
1359
|
vertical: "top",
|
|
1361
1360
|
horizontal: "left"
|
|
1362
1361
|
},
|
|
1363
|
-
children: /* @__PURE__ */ e(
|
|
1362
|
+
children: /* @__PURE__ */ e(fe, { children: c.map(({ priority: m, text: b }) => /* @__PURE__ */ s(
|
|
1364
1363
|
Je,
|
|
1365
1364
|
{
|
|
1366
|
-
onClick: () =>
|
|
1365
|
+
onClick: () => p(m),
|
|
1367
1366
|
sx: {
|
|
1368
|
-
bgcolor:
|
|
1369
|
-
color:
|
|
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:
|
|
1383
|
-
|
|
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
|
-
}),
|
|
1391
|
-
const { onEvent: a } = F(), { debts:
|
|
1392
|
-
|
|
1393
|
-
},
|
|
1394
|
-
|
|
1395
|
-
}, c = !!t,
|
|
1396
|
-
[
|
|
1397
|
-
[
|
|
1398
|
-
[
|
|
1399
|
-
[
|
|
1400
|
-
})[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(
|
|
1403
|
-
/* @__PURE__ */ e(
|
|
1401
|
+
/* @__PURE__ */ e(Lt, { buttonText: p, isOpen: c, onClick: i }),
|
|
1402
|
+
/* @__PURE__ */ e($t, { buttonEl: t, onClose: d })
|
|
1404
1403
|
] });
|
|
1405
|
-
}), Ht = (a,
|
|
1406
|
-
const t = a.map((
|
|
1407
|
-
|
|
1408
|
-
const
|
|
1409
|
-
let
|
|
1410
|
-
for (const
|
|
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
|
-
...
|
|
1411
|
+
...p,
|
|
1413
1412
|
// Start with the initial balance
|
|
1414
|
-
dataset: [{ x: new Date(
|
|
1413
|
+
dataset: [{ x: new Date(n), y: p.balance }]
|
|
1415
1414
|
});
|
|
1416
|
-
for (; t.some((
|
|
1417
|
-
let
|
|
1418
|
-
for (const [
|
|
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
|
|
1421
|
-
let y =
|
|
1422
|
-
!
|
|
1423
|
-
const
|
|
1424
|
-
if (
|
|
1425
|
-
h.is_impossible = !0, i[
|
|
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 -=
|
|
1429
|
-
x: new Date(
|
|
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:
|
|
1432
|
-
extra:
|
|
1433
|
-
}), h.balance <= 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
|
-
|
|
1434
|
+
p && n.setMonth(n.getMonth() + 1);
|
|
1436
1435
|
}
|
|
1437
|
-
return i.forEach((
|
|
1438
|
-
(
|
|
1439
|
-
}), i.forEach((
|
|
1440
|
-
|
|
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
|
-
},
|
|
1443
|
-
const { debts:
|
|
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:
|
|
1452
|
+
children: E(d, N(i, "0,0"))
|
|
1454
1453
|
}
|
|
1455
1454
|
);
|
|
1456
|
-
}), Wt = ({ onBackClick: a, sx:
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
}, [
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
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 !
|
|
1479
|
-
|
|
1478
|
+
return !d || !A ? /* @__PURE__ */ e(et, {}) : /* @__PURE__ */ s(
|
|
1479
|
+
We,
|
|
1480
1480
|
{
|
|
1481
|
-
accountOptions: f,
|
|
1482
1481
|
actions: [
|
|
1483
|
-
/* @__PURE__ */ e(
|
|
1484
|
-
/* @__PURE__ */ e(
|
|
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:
|
|
1492
|
+
onAccountsFilterClick: Se,
|
|
1487
1493
|
onBackClick: a,
|
|
1488
|
-
sx:
|
|
1489
|
-
title:
|
|
1494
|
+
sx: o,
|
|
1495
|
+
title: n.title,
|
|
1490
1496
|
children: [
|
|
1491
|
-
/* @__PURE__ */ s(
|
|
1497
|
+
/* @__PURE__ */ s(g, { sx: { px: r ? "48px" : "24px" }, children: [
|
|
1492
1498
|
/* @__PURE__ */ s(
|
|
1493
|
-
|
|
1499
|
+
g,
|
|
1494
1500
|
{
|
|
1495
1501
|
sx: {
|
|
1496
|
-
alignItems:
|
|
1497
|
-
flexDirection:
|
|
1498
|
-
mx:
|
|
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
|
-
|
|
1508
|
+
Ce,
|
|
1503
1509
|
{
|
|
1504
|
-
debts:
|
|
1505
|
-
height:
|
|
1506
|
-
hoveredDebtGuid:
|
|
1510
|
+
debts: H,
|
|
1511
|
+
height: t ? 250 : void 0,
|
|
1512
|
+
hoveredDebtGuid: P,
|
|
1507
1513
|
onClickArea: ie,
|
|
1508
|
-
onHoverArea:
|
|
1509
|
-
sx: { mr:
|
|
1514
|
+
onHoverArea: ne,
|
|
1515
|
+
sx: { mr: t ? "4px" : "-48px" }
|
|
1510
1516
|
}
|
|
1511
1517
|
),
|
|
1512
1518
|
/* @__PURE__ */ e(
|
|
1513
|
-
|
|
1519
|
+
st,
|
|
1514
1520
|
{
|
|
1515
|
-
debts:
|
|
1516
|
-
onClickCta:
|
|
1517
|
-
sx: { mb:
|
|
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(
|
|
1529
|
+
/* @__PURE__ */ e(g, { sx: { mx: t ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1524
1530
|
Ft,
|
|
1525
1531
|
{
|
|
1526
|
-
debts:
|
|
1527
|
-
hoveredDebtGuid:
|
|
1532
|
+
debts: H,
|
|
1533
|
+
hoveredDebtGuid: P,
|
|
1528
1534
|
onClickRow: ie,
|
|
1529
|
-
onHoverRow:
|
|
1535
|
+
onHoverRow: ne
|
|
1530
1536
|
}
|
|
1531
1537
|
) })
|
|
1532
1538
|
] }),
|
|
1533
1539
|
/* @__PURE__ */ e(
|
|
1534
|
-
|
|
1540
|
+
dt,
|
|
1535
1541
|
{
|
|
1536
|
-
isOpen:
|
|
1537
|
-
onClose: () =>
|
|
1542
|
+
isOpen: f,
|
|
1543
|
+
onClose: () => D(!1)
|
|
1538
1544
|
}
|
|
1539
1545
|
),
|
|
1540
|
-
/* @__PURE__ */ e(
|
|
1541
|
-
/* @__PURE__ */ e(
|
|
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
|
-
},
|
|
1551
|
+
}, Fr = v(Wt);
|
|
1546
1552
|
export {
|
|
1547
|
-
|
|
1548
|
-
|
|
1553
|
+
Ce as DebtsChart,
|
|
1554
|
+
Or as DebtsStore,
|
|
1549
1555
|
Ft as DebtsTable,
|
|
1550
|
-
|
|
1556
|
+
Fr as DebtsWidget
|
|
1551
1557
|
};
|