@mx-cartographer/experiences 8.0.19 → 8.0.20
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 +8 -4
- package/dist/{AccountStore-DpYvNnql.mjs → AccountStore-B7zfcad7.mjs} +1 -1
- package/dist/{BudgetUtil-CLhRnCoX.mjs → BudgetUtil-DZpOoZQa.mjs} +1 -1
- package/dist/{GlobalAccountFilter-B73Pw1hJ.mjs → GlobalAccountFilter-CmnaZDS6.mjs} +27 -27
- package/dist/{Help-DBAosGjO.mjs → Help-BkmSY96v.mjs} +1 -1
- package/dist/{ManageIncome-CvfRTf-j.mjs → ManageIncome-BJ7c7plg.mjs} +1 -1
- package/dist/{NotificationSettings-D7VqsrZy.mjs → NotificationSettings-DBT37CVB.mjs} +1 -1
- package/dist/{RecurringSettings-DJIUgK5A.mjs → RecurringSettings-DnD0AqWa.mjs} +1 -1
- package/dist/{SpendingLegend-BCnXkPCD.mjs → SpendingLegend-CypdabwS.mjs} +1 -1
- package/dist/{TransactionDetails-KklNHa-s.mjs → TransactionDetails-D6XZakc-.mjs} +1 -1
- package/dist/WidgetContainer-DYKMArWw.mjs +468 -0
- package/dist/accounts/index.es.js +95 -93
- package/dist/budgets/index.es.js +448 -444
- package/dist/cashflow/index.es.js +233 -231
- package/dist/common/components/GlobalAccountFilter.d.ts +2 -1
- package/dist/common/components/WidgetContainer.d.ts +2 -1
- package/dist/common/components/WidgetDateRangeSelector.d.ts +12 -0
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/useWidgetHeaderStyles.d.ts +32 -0
- package/dist/common/index.es.js +133 -132
- package/dist/core/types/Widgets.d.ts +1 -0
- package/dist/dashboard/index.es.js +3 -3
- package/dist/debts/components/actions/DebtsPriorityAction.d.ts +2 -1
- package/dist/debts/components/debtspriority/DebtsPriorityButton.d.ts +2 -1
- package/dist/debts/index.es.js +589 -587
- package/dist/finstrong/FinstrongWidget.d.ts +1 -1
- package/dist/finstrong/index.es.js +737 -745
- package/dist/goals/GoalsWidget.d.ts +1 -1
- package/dist/goals/index.es.js +439 -438
- package/dist/help/HelpWidget.d.ts +1 -1
- package/dist/help/index.es.js +21 -12
- package/dist/investments/InvestmentsWidget.d.ts +1 -1
- package/dist/investments/index.es.js +418 -417
- package/dist/networth/index.es.js +265 -278
- package/dist/notifications/index.es.js +1 -1
- package/dist/recurringtransactions/RecurringTransactionsWidget.d.ts +1 -1
- package/dist/recurringtransactions/index.es.js +235 -232
- package/dist/settings/SettingsWidget.d.ts +1 -1
- package/dist/settings/index.es.js +283 -282
- package/dist/spending/index.es.js +109 -108
- package/dist/transactions/index.es.js +280 -277
- package/dist/trends/index.es.js +622 -615
- package/dist/{useScreenSize-B6JyS_Lj.mjs → useScreenSize-CUcpY7aJ.mjs} +1 -1
- package/package.json +1 -1
- package/dist/WidgetContainer-D-pbSa7L.mjs +0 -441
package/dist/debts/index.es.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import g from "react";
|
|
3
3
|
import { observer as D } from "mobx-react-lite";
|
|
4
|
-
import
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import { Text as l, P as
|
|
7
|
-
import { intervalToDuration as
|
|
8
|
-
import { addMonths as
|
|
9
|
-
import { fromUnixTime as
|
|
10
|
-
import { getUnixTime as
|
|
11
|
-
import { a as
|
|
12
|
-
import { D as
|
|
13
|
-
import { f as
|
|
14
|
-
import { f as
|
|
15
|
-
import { G as
|
|
16
|
-
import { u as
|
|
4
|
+
import f from "@mui/material/Stack";
|
|
5
|
+
import { useTheme as Y, Card as Ce, Stack as _, Box as W } from "@mui/material";
|
|
6
|
+
import { Text as l, P as ve, H3 as Le, InstitutionLogo as $e, Icon as oe } from "@mxenabled/mxui";
|
|
7
|
+
import { intervalToDuration as Oe, formatDuration as He } from "date-fns";
|
|
8
|
+
import { addMonths as ue } from "date-fns/addMonths";
|
|
9
|
+
import { fromUnixTime as be } from "date-fns/fromUnixTime";
|
|
10
|
+
import { getUnixTime as _e } from "date-fns/getUnixTime";
|
|
11
|
+
import { a as N, M as We, I as Ge } from "../DebtsStore-BZqNLaqd.mjs";
|
|
12
|
+
import { D as nn } from "../DebtsStore-BZqNLaqd.mjs";
|
|
13
|
+
import { f as P, a as je } from "../NumberFormatting-QCaNwbjv.mjs";
|
|
14
|
+
import { f as J, D as Q } from "../DateFormats-BMpMrZpW.mjs";
|
|
15
|
+
import { G as ze, v as ee, u as C, k as V, g as B, d as te, a as Ye, b as Ve } from "../hooks-BxkfR-Ff.mjs";
|
|
16
|
+
import { u as ae } from "../useScreenSize-CUcpY7aJ.mjs";
|
|
17
17
|
import { D as ie } from "../Drawer-Bbe4AMB1.mjs";
|
|
18
18
|
import { b as E } from "../Localization-CPkpIwIx.mjs";
|
|
19
|
-
import { A as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
19
|
+
import { A as Ke, u as Ue } from "../AccountDetailsHeader-D9gbTbUt.mjs";
|
|
20
|
+
import qe from "@mui/material/Card";
|
|
21
|
+
import Xe from "@mui/material/CardContent";
|
|
22
|
+
import Ze from "@mui/material/CardHeader";
|
|
23
23
|
import le from "@mui/material/Box";
|
|
24
|
-
import { useTheme as
|
|
25
|
-
import { LineChart as
|
|
26
|
-
import { A
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
24
|
+
import { useTheme as Je } from "@mui/material/styles";
|
|
25
|
+
import { LineChart as Qe } from "@mui/x-charts/LineChart";
|
|
26
|
+
import { A } from "../Analytics-0Xm_BjHU.mjs";
|
|
27
|
+
import ye from "@mui/material/Tab";
|
|
28
|
+
import et from "@mui/material/Tabs";
|
|
29
|
+
import De from "@mui/material/List";
|
|
30
30
|
import G from "@mui/material/Divider";
|
|
31
|
-
import { M as
|
|
31
|
+
import { M as tt, I as rt, O as nt } from "../OriginalBalanceAction-DjpvVVFz.mjs";
|
|
32
32
|
import ot from "@mui/material/TextField";
|
|
33
|
-
import { L as
|
|
33
|
+
import { L as re } from "../ListItemAction-4KB7P75M.mjs";
|
|
34
34
|
import { C as se } from "../CurrencyInput-DuMktPu3.mjs";
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import { Error as
|
|
39
|
-
import { T as
|
|
40
|
-
import { DataGridPro as
|
|
35
|
+
import fe from "@mui/material/Alert";
|
|
36
|
+
import xe from "@mui/material/AlertTitle";
|
|
37
|
+
import ge from "@mui/material/Paper";
|
|
38
|
+
import { Error as at, CheckCircle as Se } from "@mxenabled/mx-icons";
|
|
39
|
+
import { T as we } from "../TabContentContainer-j01JYR_7.mjs";
|
|
40
|
+
import { DataGridPro as it } from "@mui/x-data-grid-pro";
|
|
41
41
|
import { H as j } from "../HeaderCell-P8w6CmfO.mjs";
|
|
42
|
-
import { f as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import { C as
|
|
48
|
-
import { u as
|
|
49
|
-
import { L as
|
|
50
|
-
import { W as
|
|
51
|
-
import { E as
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
const t =
|
|
42
|
+
import { f as lt, A as z } from "../Account-BiB1F8lL.mjs";
|
|
43
|
+
import Te from "@mui/material/Button";
|
|
44
|
+
import st from "@mui/material/IconButton";
|
|
45
|
+
import ct from "@mui/material/ListItem";
|
|
46
|
+
import dt from "@mui/material/Popover";
|
|
47
|
+
import { C as pt } from "../ConnectDrawer-C0wjwcJt.mjs";
|
|
48
|
+
import { u as ht } from "../useWidgetLoadTimer-DgN1bTyu.mjs";
|
|
49
|
+
import { L as mt } from "../Loader-D3rjKx72.mjs";
|
|
50
|
+
import { W as ut } from "../WidgetContainer-DYKMArWw.mjs";
|
|
51
|
+
import { E as bt } from "../EmptyState-DHAkGsjk.mjs";
|
|
52
|
+
const _t = (r, o = 0, n = 0) => {
|
|
53
|
+
if (n === 0) return 0;
|
|
54
|
+
const t = o / (We * Ge);
|
|
55
55
|
return Math.ceil(
|
|
56
|
-
t === 0 ?
|
|
56
|
+
t === 0 ? r / n : -Math.log(1 - t * r / n) / Math.log(1 + t)
|
|
57
57
|
);
|
|
58
|
-
},
|
|
58
|
+
}, yt = (r, o, n, t, a) => {
|
|
59
59
|
const i = [];
|
|
60
|
-
if (
|
|
61
|
-
for (let
|
|
62
|
-
const p =
|
|
60
|
+
if (n === 0) {
|
|
61
|
+
for (let c = 0; c < r; c++) {
|
|
62
|
+
const p = o - t * (c + 1), h = o - t * c, u = p >= 0 ? t : h;
|
|
63
63
|
i.push({
|
|
64
64
|
balance: p >= 0 ? p : 0,
|
|
65
|
-
interest:
|
|
66
|
-
payment:
|
|
67
|
-
principal:
|
|
68
|
-
timestamp:
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
interest: n,
|
|
66
|
+
payment: u,
|
|
67
|
+
principal: u,
|
|
68
|
+
timestamp: _e(
|
|
69
|
+
ue(
|
|
70
|
+
be(a),
|
|
71
71
|
// convert seconds → Date
|
|
72
|
-
|
|
72
|
+
c + 1
|
|
73
73
|
// add (index + 1) months
|
|
74
74
|
)
|
|
75
75
|
)
|
|
@@ -77,101 +77,101 @@ const bt = (o, n = 0, r = 0) => {
|
|
|
77
77
|
}
|
|
78
78
|
return i;
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
for (let
|
|
82
|
-
const p =
|
|
80
|
+
const d = n / 1200;
|
|
81
|
+
for (let c = 0; c < r; c++) {
|
|
82
|
+
const p = _e(ue(be(a), c + 1)), h = Math.pow(1 + d, c), u = o * h - t * ((h - 1) / d), x = Math.pow(1 + d, c + 1), b = o * x - t * ((x - 1) / d), I = t + Math.min(b, 0), M = u * d;
|
|
83
83
|
i.push({
|
|
84
84
|
balance: Math.max(0, b),
|
|
85
|
-
interest:
|
|
86
|
-
payment:
|
|
87
|
-
principal:
|
|
85
|
+
interest: M,
|
|
86
|
+
payment: I,
|
|
87
|
+
principal: I - M,
|
|
88
88
|
timestamp: p
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
return i;
|
|
92
|
-
},
|
|
93
|
-
const { monthly_payment:
|
|
92
|
+
}, ft = (r) => (r[r.length - 1] || {}).timestamp, xt = (r) => {
|
|
93
|
+
const { monthly_payment: o, interest_rate: n, balance: t, payment_due_date: a } = r, i = _t(t, n ?? 0, o ?? 0), d = yt(
|
|
94
94
|
i,
|
|
95
95
|
t,
|
|
96
|
-
r ?? 0,
|
|
97
96
|
n ?? 0,
|
|
97
|
+
o ?? 0,
|
|
98
98
|
a
|
|
99
|
-
),
|
|
99
|
+
), c = ft(d);
|
|
100
100
|
return {
|
|
101
|
-
...
|
|
102
|
-
minimumFinalPayment:
|
|
103
|
-
minimumPayments:
|
|
101
|
+
...r,
|
|
102
|
+
minimumFinalPayment: c,
|
|
103
|
+
minimumPayments: d
|
|
104
104
|
};
|
|
105
|
-
},
|
|
106
|
-
const [
|
|
107
|
-
([a, i],
|
|
105
|
+
}, Ae = (r, o) => {
|
|
106
|
+
const [n, t] = r.reduce(
|
|
107
|
+
([a, i], d) => (d.is_paid_off || d.is_impossible ? i.push({ ...d, minimumPayments: [] }) : a.push(xt(d)), [a, i]),
|
|
108
108
|
[[], []]
|
|
109
109
|
);
|
|
110
|
-
switch (
|
|
111
|
-
case
|
|
112
|
-
|
|
110
|
+
switch (o) {
|
|
111
|
+
case N.FASTEST_PAYOFF_FIRST:
|
|
112
|
+
n.sort((a, i) => (a.minimumFinalPayment ?? 0) - (i.minimumFinalPayment ?? 0));
|
|
113
113
|
break;
|
|
114
|
-
case
|
|
115
|
-
|
|
114
|
+
case N.HIGHEST_INTEREST:
|
|
115
|
+
n.sort((a, i) => (i.interest_rate ?? 0) - (a.interest_rate ?? 0));
|
|
116
116
|
break;
|
|
117
|
-
case
|
|
118
|
-
|
|
117
|
+
case N.LOWEST_BALANCE:
|
|
118
|
+
n.sort((a, i) => a.balance - i.balance);
|
|
119
119
|
break;
|
|
120
|
-
case
|
|
121
|
-
|
|
120
|
+
case N.HIGHEST_BALANCE:
|
|
121
|
+
n.sort((a, i) => i.balance - a.balance);
|
|
122
122
|
break;
|
|
123
123
|
default:
|
|
124
|
-
|
|
124
|
+
n.sort((a, i) => a.balance - i.balance);
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
r.splice(0, r.length, ...n, ...t);
|
|
127
127
|
};
|
|
128
|
-
function
|
|
129
|
-
const t =
|
|
130
|
-
(
|
|
128
|
+
function gt(r, o, n = 0) {
|
|
129
|
+
const t = r.map((u) => ({ ...u })).filter(
|
|
130
|
+
(u) => u.interest_rate !== void 0 && u.monthly_payment !== void 0 && !u.is_paid_off
|
|
131
131
|
);
|
|
132
|
-
|
|
132
|
+
Ae(t, o);
|
|
133
133
|
let a = 0, i = 0;
|
|
134
|
-
const
|
|
135
|
-
for (; t.some((
|
|
136
|
-
let
|
|
137
|
-
for (const [
|
|
134
|
+
const d = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
|
|
135
|
+
for (; t.some((u) => u.balance >= 0.01 && !u.is_impossible); ) {
|
|
136
|
+
let u = !1;
|
|
137
|
+
for (const [x, b] of t.entries()) {
|
|
138
138
|
if (b.balance <= 0.01 || b.is_impossible) continue;
|
|
139
|
-
const
|
|
139
|
+
const M = (b.interest_rate ?? 0) / 100 / 12, k = b.balance * M;
|
|
140
140
|
let v = b.monthly_payment ?? 0;
|
|
141
|
-
|
|
142
|
-
const
|
|
143
|
-
if (
|
|
141
|
+
x === 0 && n && (v += n), b.balance += k;
|
|
142
|
+
const S = Math.min(b.balance, v + i);
|
|
143
|
+
if (S <= k) {
|
|
144
144
|
b.is_impossible = !0;
|
|
145
145
|
continue;
|
|
146
146
|
}
|
|
147
|
-
b.balance -=
|
|
147
|
+
b.balance -= S, b.balance = b.balance < 0.01 ? 0 : b.balance, a += k, b.balance <= 0 && (i += v), S > 0 && (u = !0);
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
u && c.setMonth(c.getMonth() + 1);
|
|
150
150
|
}
|
|
151
|
-
const p = t.some((
|
|
151
|
+
const p = t.some((u) => u.is_impossible && u.balance > 0), h = Oe({ start: d, end: c });
|
|
152
152
|
return {
|
|
153
|
-
payoffSavings: p ? "N/A" :
|
|
154
|
-
payoffDate: p ? "Never" :
|
|
155
|
-
payoffDuration: p ? "Stagnant" :
|
|
153
|
+
payoffSavings: p ? "N/A" : P(a, "0,0.00"),
|
|
154
|
+
payoffDate: p ? "Never" : J(c, Q.MONTH_YEAR),
|
|
155
|
+
payoffDuration: p ? "Stagnant" : He(h, { format: ["years", "months"] }) || "0 months"
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
const
|
|
159
|
-
if (!
|
|
158
|
+
const L = () => {
|
|
159
|
+
if (!g.useContext(ze))
|
|
160
160
|
throw new Error("useCateUiStore() must be used within the GlobalDataContext");
|
|
161
|
-
return
|
|
162
|
-
},
|
|
163
|
-
const t =
|
|
164
|
-
const
|
|
165
|
-
return
|
|
166
|
-
}, [
|
|
161
|
+
return ee().uiStore;
|
|
162
|
+
}, wt = ({ debts: r, onClickCta: o, sx: n }) => {
|
|
163
|
+
const t = Y(), { isMobile: a } = ae(), { debts: i } = C(), { selectedDebtPriority: d } = L(), { monthlyCashFlowProfile: c } = V(), { payoffDate: p, payoffSavings: h, payoffDuration: u } = g.useMemo(() => {
|
|
164
|
+
const x = c?.extra_payment ?? 0;
|
|
165
|
+
return gt(r, d, x);
|
|
166
|
+
}, [r, d, c]);
|
|
167
167
|
return /* @__PURE__ */ e(
|
|
168
|
-
|
|
168
|
+
Ce,
|
|
169
169
|
{
|
|
170
170
|
sx: {
|
|
171
171
|
boxShadow: t.shadows[2],
|
|
172
172
|
width: a ? "100%" : "186px",
|
|
173
173
|
minWidth: "186px",
|
|
174
|
-
...
|
|
174
|
+
...n
|
|
175
175
|
},
|
|
176
176
|
children: /* @__PURE__ */ s(_, { sx: { gap: "12px", p: "16px" }, children: [
|
|
177
177
|
/* @__PURE__ */ s(
|
|
@@ -190,11 +190,11 @@ const F = () => {
|
|
|
190
190
|
}
|
|
191
191
|
),
|
|
192
192
|
/* @__PURE__ */ s(_, { gap: a ? "4px" : "0", children: [
|
|
193
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "body2", children:
|
|
193
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body2", children: h }),
|
|
194
194
|
/* @__PURE__ */ e(l, { sx: { whiteSpace: "normal" }, variant: "caption", children: i.snowball_card_amount_description })
|
|
195
195
|
] }),
|
|
196
196
|
/* @__PURE__ */ s(_, { gap: a ? "4px" : "0", children: [
|
|
197
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "body2", children:
|
|
197
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body2", children: u }),
|
|
198
198
|
/* @__PURE__ */ e(l, { variant: "caption", children: i.snowball_card_duration_description })
|
|
199
199
|
] }),
|
|
200
200
|
/* @__PURE__ */ e(
|
|
@@ -202,7 +202,7 @@ const F = () => {
|
|
|
202
202
|
{
|
|
203
203
|
bold: !0,
|
|
204
204
|
color: t.palette.primary.main,
|
|
205
|
-
onClick:
|
|
205
|
+
onClick: o,
|
|
206
206
|
sx: { cursor: "pointer" },
|
|
207
207
|
variant: "body2",
|
|
208
208
|
children: i.snowball_card_cta
|
|
@@ -211,29 +211,29 @@ const F = () => {
|
|
|
211
211
|
] })
|
|
212
212
|
}
|
|
213
213
|
);
|
|
214
|
-
},
|
|
215
|
-
const
|
|
214
|
+
}, Ct = D(wt), vt = ({ isOpen: r, onClose: o }) => {
|
|
215
|
+
const n = Y(), { debts: t } = C(), [a, i] = g.useState(!1);
|
|
216
216
|
return /* @__PURE__ */ e(
|
|
217
217
|
ie,
|
|
218
218
|
{
|
|
219
219
|
ariaLabelClose: "",
|
|
220
|
-
isOpen:
|
|
221
|
-
onClose:
|
|
220
|
+
isOpen: r,
|
|
221
|
+
onClose: o,
|
|
222
222
|
title: t.snowball_drawer_title,
|
|
223
|
-
children: /* @__PURE__ */ s(_, { bgcolor:
|
|
223
|
+
children: /* @__PURE__ */ s(_, { bgcolor: n.palette.background.default, height: "100%", children: [
|
|
224
224
|
/* @__PURE__ */ s(_, { alignItems: "center", px: 24, py: 24, children: [
|
|
225
225
|
/* @__PURE__ */ s(_, { alignItems: "center", pb: 24, children: [
|
|
226
226
|
/* @__PURE__ */ e(l, { mb: 12, variant: "h3", children: t.snowball_drawer_subtitle }),
|
|
227
|
-
/* @__PURE__ */ e(l, { color:
|
|
228
|
-
/* @__PURE__ */ e(
|
|
229
|
-
/* @__PURE__ */ e(l, { color:
|
|
227
|
+
/* @__PURE__ */ e(l, { color: n.palette.secondary.main, variant: "body2", children: t.snowball_drawer_amount_description }),
|
|
228
|
+
/* @__PURE__ */ e(ve, { variant: "h1", children: t.snowball_drawer_savings }),
|
|
229
|
+
/* @__PURE__ */ e(l, { color: n.palette.secondary.main, variant: "body2", children: t.snowball_drawer_duration_description })
|
|
230
230
|
] }),
|
|
231
|
-
/* @__PURE__ */ s(
|
|
231
|
+
/* @__PURE__ */ s(Ce, { sx: { display: "grid", py: 16, px: 24 }, children: [
|
|
232
232
|
/* @__PURE__ */ e(l, { mb: 4, variant: "h3", children: t.snowball_drawer_question }),
|
|
233
233
|
/* @__PURE__ */ e(
|
|
234
234
|
l,
|
|
235
235
|
{
|
|
236
|
-
color:
|
|
236
|
+
color: n.palette.secondary.main,
|
|
237
237
|
mb: 8,
|
|
238
238
|
sx: { whiteSpace: a ? "normal" : "nowrap" },
|
|
239
239
|
variant: "subtitle2",
|
|
@@ -244,7 +244,7 @@ const F = () => {
|
|
|
244
244
|
l,
|
|
245
245
|
{
|
|
246
246
|
bold: !0,
|
|
247
|
-
color:
|
|
247
|
+
color: n.palette.primary.main,
|
|
248
248
|
onClick: () => i(!a),
|
|
249
249
|
sx: { cursor: "pointer" },
|
|
250
250
|
variant: "body2",
|
|
@@ -257,7 +257,7 @@ const F = () => {
|
|
|
257
257
|
/* @__PURE__ */ e(
|
|
258
258
|
l,
|
|
259
259
|
{
|
|
260
|
-
color:
|
|
260
|
+
color: n.palette.secondary.main,
|
|
261
261
|
px: 24,
|
|
262
262
|
sx: { textAlign: "center", whiteSpace: "normal" },
|
|
263
263
|
variant: "body2",
|
|
@@ -268,7 +268,7 @@ const F = () => {
|
|
|
268
268
|
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: E(t.snowball_drawer_month_header, 1) }),
|
|
269
269
|
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
|
|
270
270
|
] }),
|
|
271
|
-
/* @__PURE__ */ s(_, { bgcolor:
|
|
271
|
+
/* @__PURE__ */ s(_, { bgcolor: n.palette.background.paper, mb: 24, children: [
|
|
272
272
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
273
273
|
/* @__PURE__ */ e(
|
|
274
274
|
W,
|
|
@@ -280,7 +280,7 @@ const F = () => {
|
|
|
280
280
|
width: 20,
|
|
281
281
|
height: 20,
|
|
282
282
|
borderRadius: "50%",
|
|
283
|
-
backgroundColor:
|
|
283
|
+
backgroundColor: n.palette.success.main,
|
|
284
284
|
marginRight: 12
|
|
285
285
|
},
|
|
286
286
|
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
|
|
@@ -290,7 +290,7 @@ const F = () => {
|
|
|
290
290
|
_,
|
|
291
291
|
{
|
|
292
292
|
sx: {
|
|
293
|
-
borderBottom: `1px solid ${
|
|
293
|
+
borderBottom: `1px solid ${n.palette.neutral.light}`,
|
|
294
294
|
flexDirection: "row",
|
|
295
295
|
flexGrow: 1,
|
|
296
296
|
py: 14,
|
|
@@ -299,7 +299,7 @@ const F = () => {
|
|
|
299
299
|
children: [
|
|
300
300
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
301
301
|
/* @__PURE__ */ e(l, { variant: "body1", children: E(t.snowball_drawer_debt_label, "A") }),
|
|
302
|
-
/* @__PURE__ */ s(l, { color:
|
|
302
|
+
/* @__PURE__ */ s(l, { color: n.palette.secondary.main, variant: "caption", children: [
|
|
303
303
|
E(
|
|
304
304
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
305
305
|
"$100"
|
|
@@ -314,7 +314,7 @@ const F = () => {
|
|
|
314
314
|
l,
|
|
315
315
|
{
|
|
316
316
|
bold: !0,
|
|
317
|
-
color:
|
|
317
|
+
color: n.palette.success.main,
|
|
318
318
|
textAlign: "end",
|
|
319
319
|
variant: "tiny",
|
|
320
320
|
children: t.snowball_drawer_paid_label
|
|
@@ -334,7 +334,7 @@ const F = () => {
|
|
|
334
334
|
height: 20,
|
|
335
335
|
marginRight: 12,
|
|
336
336
|
borderRadius: "50%",
|
|
337
|
-
border: `3px solid ${
|
|
337
|
+
border: `3px solid ${n.palette.neutral.main}`
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
),
|
|
@@ -342,7 +342,7 @@ const F = () => {
|
|
|
342
342
|
_,
|
|
343
343
|
{
|
|
344
344
|
sx: {
|
|
345
|
-
borderBottom: `1px solid ${
|
|
345
|
+
borderBottom: `1px solid ${n.palette.neutral.light}`,
|
|
346
346
|
flexDirection: "row",
|
|
347
347
|
flexGrow: 1,
|
|
348
348
|
py: 14,
|
|
@@ -364,7 +364,7 @@ const F = () => {
|
|
|
364
364
|
height: 20,
|
|
365
365
|
marginRight: 12,
|
|
366
366
|
borderRadius: "50%",
|
|
367
|
-
border: `3px solid ${
|
|
367
|
+
border: `3px solid ${n.palette.neutral.main}`
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
),
|
|
@@ -381,8 +381,8 @@ const F = () => {
|
|
|
381
381
|
px: 24,
|
|
382
382
|
flexDirection: "row",
|
|
383
383
|
justifyContent: "space-between",
|
|
384
|
-
borderTop: `1px solid ${
|
|
385
|
-
borderBottom: `1px solid ${
|
|
384
|
+
borderTop: `1px solid ${n.palette.neutral.light}`,
|
|
385
|
+
borderBottom: `1px solid ${n.palette.neutral.light}`
|
|
386
386
|
},
|
|
387
387
|
children: [
|
|
388
388
|
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
|
|
@@ -395,7 +395,7 @@ const F = () => {
|
|
|
395
395
|
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: E(t.snowball_drawer_month_header, 2) }),
|
|
396
396
|
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
|
|
397
397
|
] }),
|
|
398
|
-
/* @__PURE__ */ s(_, { bgcolor:
|
|
398
|
+
/* @__PURE__ */ s(_, { bgcolor: n.palette.background.paper, mb: 24, children: [
|
|
399
399
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
400
400
|
/* @__PURE__ */ e(
|
|
401
401
|
W,
|
|
@@ -407,7 +407,7 @@ const F = () => {
|
|
|
407
407
|
width: 20,
|
|
408
408
|
height: 20,
|
|
409
409
|
borderRadius: "50%",
|
|
410
|
-
backgroundColor:
|
|
410
|
+
backgroundColor: n.palette.success.main,
|
|
411
411
|
marginRight: 12
|
|
412
412
|
},
|
|
413
413
|
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
|
|
@@ -417,7 +417,7 @@ const F = () => {
|
|
|
417
417
|
_,
|
|
418
418
|
{
|
|
419
419
|
sx: {
|
|
420
|
-
borderBottom: `1px solid ${
|
|
420
|
+
borderBottom: `1px solid ${n.palette.neutral.light}`,
|
|
421
421
|
flexDirection: "row",
|
|
422
422
|
flexGrow: 1,
|
|
423
423
|
py: 14,
|
|
@@ -426,7 +426,7 @@ const F = () => {
|
|
|
426
426
|
children: [
|
|
427
427
|
/* @__PURE__ */ s(_, { flexGrow: 1, children: [
|
|
428
428
|
/* @__PURE__ */ e(l, { variant: "body1", children: E(t.snowball_drawer_debt_label, "B") }),
|
|
429
|
-
/* @__PURE__ */ s(l, { color:
|
|
429
|
+
/* @__PURE__ */ s(l, { color: n.palette.secondary.main, variant: "caption", children: [
|
|
430
430
|
E(
|
|
431
431
|
t.snowball_drawer_rollover_explainer_pt1,
|
|
432
432
|
"$500"
|
|
@@ -441,7 +441,7 @@ const F = () => {
|
|
|
441
441
|
l,
|
|
442
442
|
{
|
|
443
443
|
bold: !0,
|
|
444
|
-
color:
|
|
444
|
+
color: n.palette.success.main,
|
|
445
445
|
textAlign: "end",
|
|
446
446
|
variant: "tiny",
|
|
447
447
|
children: t.snowball_drawer_paid_label
|
|
@@ -461,7 +461,7 @@ const F = () => {
|
|
|
461
461
|
height: 20,
|
|
462
462
|
marginRight: 12,
|
|
463
463
|
borderRadius: "50%",
|
|
464
|
-
border: `3px solid ${
|
|
464
|
+
border: `3px solid ${n.palette.neutral.main}`
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
),
|
|
@@ -489,8 +489,8 @@ const F = () => {
|
|
|
489
489
|
px: 24,
|
|
490
490
|
flexDirection: "row",
|
|
491
491
|
justifyContent: "space-between",
|
|
492
|
-
borderTop: `1px solid ${
|
|
493
|
-
borderBottom: `1px solid ${
|
|
492
|
+
borderTop: `1px solid ${n.palette.neutral.light}`,
|
|
493
|
+
borderBottom: `1px solid ${n.palette.neutral.light}`
|
|
494
494
|
},
|
|
495
495
|
children: [
|
|
496
496
|
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
|
|
@@ -503,7 +503,7 @@ const F = () => {
|
|
|
503
503
|
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: E(t.snowball_drawer_month_header, 3) }),
|
|
504
504
|
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
|
|
505
505
|
] }),
|
|
506
|
-
/* @__PURE__ */ s(_, { bgcolor:
|
|
506
|
+
/* @__PURE__ */ s(_, { bgcolor: n.palette.background.paper, mb: 24, children: [
|
|
507
507
|
/* @__PURE__ */ s(_, { alignItems: "center", flexDirection: "row", pl: 24, children: [
|
|
508
508
|
/* @__PURE__ */ e(
|
|
509
509
|
W,
|
|
@@ -515,7 +515,7 @@ const F = () => {
|
|
|
515
515
|
width: 20,
|
|
516
516
|
height: 20,
|
|
517
517
|
borderRadius: "50%",
|
|
518
|
-
backgroundColor:
|
|
518
|
+
backgroundColor: n.palette.success.main,
|
|
519
519
|
marginRight: 12
|
|
520
520
|
},
|
|
521
521
|
children: /* @__PURE__ */ e(l, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
|
|
@@ -539,7 +539,7 @@ const F = () => {
|
|
|
539
539
|
l,
|
|
540
540
|
{
|
|
541
541
|
bold: !0,
|
|
542
|
-
color:
|
|
542
|
+
color: n.palette.success.main,
|
|
543
543
|
textAlign: "end",
|
|
544
544
|
variant: "tiny",
|
|
545
545
|
children: t.snowball_drawer_paid_label
|
|
@@ -558,8 +558,8 @@ const F = () => {
|
|
|
558
558
|
px: 24,
|
|
559
559
|
flexDirection: "row",
|
|
560
560
|
justifyContent: "space-between",
|
|
561
|
-
borderTop: `1px solid ${
|
|
562
|
-
borderBottom: `1px solid ${
|
|
561
|
+
borderTop: `1px solid ${n.palette.neutral.light}`,
|
|
562
|
+
borderBottom: `1px solid ${n.palette.neutral.light}`
|
|
563
563
|
},
|
|
564
564
|
children: [
|
|
565
565
|
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
|
|
@@ -572,50 +572,50 @@ const F = () => {
|
|
|
572
572
|
] })
|
|
573
573
|
}
|
|
574
574
|
);
|
|
575
|
-
},
|
|
576
|
-
function
|
|
577
|
-
const [
|
|
578
|
-
Math.max(0, Math.min(255, Math.round(
|
|
579
|
-
Math.max(0, Math.min(255, Math.round(t *
|
|
580
|
-
Math.max(0, Math.min(255, Math.round(a *
|
|
575
|
+
}, Dt = D(vt), St = "#FF7B08";
|
|
576
|
+
function Tt(r, o) {
|
|
577
|
+
const [n, t, a] = r.replace(/^#/, "").match(/.{1,2}/g).map((d) => parseInt(d, 16)), i = [
|
|
578
|
+
Math.max(0, Math.min(255, Math.round(n * o))),
|
|
579
|
+
Math.max(0, Math.min(255, Math.round(t * o))),
|
|
580
|
+
Math.max(0, Math.min(255, Math.round(a * o)))
|
|
581
581
|
];
|
|
582
582
|
return `rgb(${i[0]}, ${i[1]}, ${i[2]})`;
|
|
583
583
|
}
|
|
584
|
-
const
|
|
585
|
-
sx:
|
|
586
|
-
height:
|
|
587
|
-
width:
|
|
584
|
+
const Ee = ({
|
|
585
|
+
sx: r,
|
|
586
|
+
height: o = 500,
|
|
587
|
+
width: n,
|
|
588
588
|
debts: t,
|
|
589
589
|
hoveredDebtGuid: a,
|
|
590
590
|
onClickArea: i,
|
|
591
|
-
onHoverArea:
|
|
591
|
+
onHoverArea: d
|
|
592
592
|
}) => {
|
|
593
|
-
const
|
|
593
|
+
const c = Je(), { onEvent: p } = B(), h = t.filter((m) => !m.is_impossible), u = [
|
|
594
594
|
...new Set(
|
|
595
|
-
|
|
595
|
+
h.flatMap((m) => m.dataset.map((w) => new Date(w.x).getTime()))
|
|
596
596
|
)
|
|
597
|
-
].sort((
|
|
598
|
-
const
|
|
599
|
-
let
|
|
600
|
-
const
|
|
601
|
-
const
|
|
602
|
-
return
|
|
597
|
+
].sort((m, w) => m - w).map((m) => new Date(m)), x = h.map((m) => {
|
|
598
|
+
const w = new Map(m.dataset.map((F) => [new Date(F.x).getTime(), F.y]));
|
|
599
|
+
let T = w.get(u[0].getTime()) ?? 0;
|
|
600
|
+
const R = u.map((F) => {
|
|
601
|
+
const K = w.get(F.getTime()) ?? T;
|
|
602
|
+
return T = K, { x: F, y: K };
|
|
603
603
|
});
|
|
604
|
-
return { ...
|
|
605
|
-
}), b =
|
|
606
|
-
(
|
|
604
|
+
return { ...m, dataset: R };
|
|
605
|
+
}), b = x.reduce(
|
|
606
|
+
(m, w) => m + (w.dataset[0]?.y ?? 0),
|
|
607
607
|
0
|
|
608
|
-
),
|
|
609
|
-
const
|
|
610
|
-
return { x:
|
|
611
|
-
}),
|
|
612
|
-
const
|
|
608
|
+
), I = u.map((m, w) => {
|
|
609
|
+
const T = w / (u.length - 1), R = b * (1 - T);
|
|
610
|
+
return { x: m, y: R };
|
|
611
|
+
}), M = Math.ceil(b / 100) * 100, k = u, v = x.map((m, w) => {
|
|
612
|
+
const T = 1 - w / x.length * 0.5, R = Tt(St, T);
|
|
613
613
|
return {
|
|
614
|
-
id: `debt-${
|
|
615
|
-
guid:
|
|
616
|
-
label:
|
|
617
|
-
data:
|
|
618
|
-
color:
|
|
614
|
+
id: `debt-${w}`,
|
|
615
|
+
guid: m.guid,
|
|
616
|
+
label: m.name,
|
|
617
|
+
data: m.dataset.map((F) => F.y),
|
|
618
|
+
color: R,
|
|
619
619
|
curve: "linear",
|
|
620
620
|
type: "line",
|
|
621
621
|
area: !0,
|
|
@@ -626,15 +626,15 @@ const Ae = ({
|
|
|
626
626
|
v.push({
|
|
627
627
|
id: "payoff-line",
|
|
628
628
|
label: "Payoff Line",
|
|
629
|
-
data:
|
|
630
|
-
color:
|
|
629
|
+
data: I.map((m) => m.y),
|
|
630
|
+
color: c.palette.grey[700],
|
|
631
631
|
curve: "linear",
|
|
632
632
|
type: "line",
|
|
633
633
|
stack: void 0,
|
|
634
634
|
showMark: !1,
|
|
635
635
|
disableHighlight: !0
|
|
636
636
|
});
|
|
637
|
-
const
|
|
637
|
+
const S = (m) => v.findIndex((w) => w?.guid === m);
|
|
638
638
|
return /* @__PURE__ */ e(
|
|
639
639
|
le,
|
|
640
640
|
{
|
|
@@ -651,21 +651,21 @@ const Ae = ({
|
|
|
651
651
|
}
|
|
652
652
|
},
|
|
653
653
|
children: /* @__PURE__ */ e(
|
|
654
|
-
|
|
654
|
+
Qe,
|
|
655
655
|
{
|
|
656
656
|
axisHighlight: { x: "none" },
|
|
657
657
|
disableLineItemHighlight: !0,
|
|
658
|
-
height:
|
|
658
|
+
height: o,
|
|
659
659
|
hideLegend: !0,
|
|
660
660
|
margin: { bottom: 24, left: 32, right: 72, top: 48 },
|
|
661
|
-
onAreaClick: (
|
|
661
|
+
onAreaClick: (m, w) => {
|
|
662
662
|
i?.();
|
|
663
|
-
const
|
|
664
|
-
p(
|
|
663
|
+
const T = v.find((R) => R.id === w.seriesId);
|
|
664
|
+
p(A.DEBTS_CLICK_CHART_AREA, { account_guid: T?.guid });
|
|
665
665
|
},
|
|
666
|
-
onHighlightChange: (
|
|
667
|
-
const
|
|
668
|
-
|
|
666
|
+
onHighlightChange: (m) => {
|
|
667
|
+
const w = v.find((T) => T.id === m?.seriesId)?.guid;
|
|
668
|
+
d?.(w ?? "");
|
|
669
669
|
},
|
|
670
670
|
series: v,
|
|
671
671
|
skipAnimation: !0,
|
|
@@ -687,45 +687,45 @@ const Ae = ({
|
|
|
687
687
|
strokeDasharray: "10 5",
|
|
688
688
|
strokeWidth: 1
|
|
689
689
|
},
|
|
690
|
-
[`& .MuiLineElement-series-debt-${
|
|
690
|
+
[`& .MuiLineElement-series-debt-${S(a ?? "0")}`]: {
|
|
691
691
|
opacity: 1
|
|
692
692
|
},
|
|
693
|
-
[`& .MuiAreaElement-series-debt-${
|
|
693
|
+
[`& .MuiAreaElement-series-debt-${S(a ?? "0")}`]: {
|
|
694
694
|
opacity: 1
|
|
695
695
|
},
|
|
696
696
|
"& .MuiChartsAxis-tickLabel > tspan": {
|
|
697
|
-
fontFamily:
|
|
697
|
+
fontFamily: c.typography.body2.fontFamily
|
|
698
698
|
},
|
|
699
|
-
...
|
|
699
|
+
...r
|
|
700
700
|
},
|
|
701
|
-
width:
|
|
701
|
+
width: n,
|
|
702
702
|
xAxis: [
|
|
703
703
|
{
|
|
704
|
-
data:
|
|
704
|
+
data: k,
|
|
705
705
|
disableTicks: !0,
|
|
706
|
-
min:
|
|
706
|
+
min: u[0],
|
|
707
707
|
scaleType: "time",
|
|
708
708
|
tickLabelMinGap: 24,
|
|
709
|
-
valueFormatter: (
|
|
709
|
+
valueFormatter: (m) => J(m, Q.MONTH_SHORT_YEAR)
|
|
710
710
|
}
|
|
711
711
|
],
|
|
712
712
|
yAxis: [
|
|
713
713
|
{
|
|
714
714
|
min: 0,
|
|
715
|
-
max:
|
|
715
|
+
max: M,
|
|
716
716
|
disableTicks: !0,
|
|
717
|
-
valueFormatter: (
|
|
717
|
+
valueFormatter: (m) => P(m, "0a")
|
|
718
718
|
}
|
|
719
719
|
]
|
|
720
720
|
}
|
|
721
721
|
)
|
|
722
722
|
}
|
|
723
723
|
);
|
|
724
|
-
},
|
|
725
|
-
const
|
|
724
|
+
}, At = () => {
|
|
725
|
+
const r = Y(), { debts: o } = C(), { selectedDebtChartData: n } = L();
|
|
726
726
|
return /* @__PURE__ */ s($, { children: [
|
|
727
727
|
/* @__PURE__ */ s(
|
|
728
|
-
|
|
728
|
+
qe,
|
|
729
729
|
{
|
|
730
730
|
sx: {
|
|
731
731
|
"& .MuiCardContent-root:last-child": {
|
|
@@ -733,70 +733,70 @@ const Ae = ({
|
|
|
733
733
|
}
|
|
734
734
|
},
|
|
735
735
|
children: [
|
|
736
|
-
/* @__PURE__ */ e(
|
|
737
|
-
/* @__PURE__ */ e(
|
|
736
|
+
/* @__PURE__ */ e(Ze, { sx: { pb: 0 }, title: /* @__PURE__ */ e(Le, { sx: { pb: 4 }, children: o.details_chart_title }) }),
|
|
737
|
+
/* @__PURE__ */ e(Xe, { sx: { p: 0 }, children: /* @__PURE__ */ e(Ee, { debts: [n], height: 250 }) })
|
|
738
738
|
]
|
|
739
739
|
}
|
|
740
740
|
),
|
|
741
741
|
/* @__PURE__ */ e(
|
|
742
742
|
l,
|
|
743
743
|
{
|
|
744
|
-
color:
|
|
744
|
+
color: r.palette.text.secondary,
|
|
745
745
|
sx: { whiteSpace: "normal", textAlign: "center", px: 8, py: 12 },
|
|
746
746
|
variant: "body2",
|
|
747
|
-
children:
|
|
747
|
+
children: o.details_chart_description
|
|
748
748
|
}
|
|
749
749
|
)
|
|
750
750
|
] });
|
|
751
|
-
},
|
|
752
|
-
const
|
|
753
|
-
return
|
|
751
|
+
}, Et = D(At), It = () => {
|
|
752
|
+
const r = Y(), { onEvent: o } = B(), { debts: n } = C(), { selectedDebtChartData: t, showCompleted: a, showError: i } = L();
|
|
753
|
+
return g.useEffect(() => o(A.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(De, { children: i || a ? /* @__PURE__ */ e(
|
|
754
754
|
l,
|
|
755
755
|
{
|
|
756
|
-
color:
|
|
756
|
+
color: r.palette.secondary.main,
|
|
757
757
|
component: "div",
|
|
758
758
|
sx: { p: 32, textAlign: "center", whiteSpace: "normal" },
|
|
759
759
|
variant: "body2",
|
|
760
|
-
children: i ?
|
|
760
|
+
children: i ? n.schedule_error_message : n.schedule_complete_message
|
|
761
761
|
}
|
|
762
762
|
) : /* @__PURE__ */ s($, { children: [
|
|
763
|
-
/* @__PURE__ */ s(
|
|
764
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children:
|
|
765
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children:
|
|
763
|
+
/* @__PURE__ */ s(f, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
|
|
764
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: n.schedule_month_heading }),
|
|
765
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "caption", children: n.schedule_amount_heading })
|
|
766
766
|
] }),
|
|
767
|
-
t.dataset.slice(1).map(({ x:
|
|
768
|
-
|
|
767
|
+
t.dataset.slice(1).map(({ x: d, y: c, payment: p }) => /* @__PURE__ */ e(f, { bgcolor: r.palette.background.paper, children: /* @__PURE__ */ e(f, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ s(
|
|
768
|
+
f,
|
|
769
769
|
{
|
|
770
770
|
sx: {
|
|
771
|
-
borderBottom: `1px solid ${
|
|
771
|
+
borderBottom: `1px solid ${r.palette.divider}`,
|
|
772
772
|
flexDirection: "row",
|
|
773
773
|
flexGrow: 1,
|
|
774
774
|
py: 14,
|
|
775
775
|
pr: 24
|
|
776
776
|
},
|
|
777
777
|
children: [
|
|
778
|
-
/* @__PURE__ */ s(
|
|
779
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children:
|
|
780
|
-
/* @__PURE__ */ e(l, { color:
|
|
778
|
+
/* @__PURE__ */ s(f, { flexGrow: 1, children: [
|
|
779
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: J(d, Q.MONTH_YEAR) }),
|
|
780
|
+
/* @__PURE__ */ e(l, { color: r.palette.secondary.main, variant: "caption", children: n.schedule_month_label })
|
|
781
781
|
] }),
|
|
782
|
-
/* @__PURE__ */ s(
|
|
783
|
-
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children:
|
|
782
|
+
/* @__PURE__ */ s(f, { children: [
|
|
783
|
+
/* @__PURE__ */ e(l, { bold: !0, variant: "body1", children: P(c, "0,0.00") }),
|
|
784
784
|
/* @__PURE__ */ e(
|
|
785
785
|
l,
|
|
786
786
|
{
|
|
787
787
|
bold: !0,
|
|
788
|
-
color:
|
|
788
|
+
color: r.palette.success.main,
|
|
789
789
|
textAlign: "end",
|
|
790
790
|
variant: "tiny",
|
|
791
|
-
children: `+${
|
|
791
|
+
children: `+${P(p, "0,0")}`
|
|
792
792
|
}
|
|
793
793
|
)
|
|
794
794
|
] })
|
|
795
795
|
]
|
|
796
796
|
}
|
|
797
|
-
) }) }, String(
|
|
798
|
-
/* @__PURE__ */ e(
|
|
799
|
-
|
|
797
|
+
) }) }, String(d))),
|
|
798
|
+
/* @__PURE__ */ e(f, { bgcolor: "background.paper", children: /* @__PURE__ */ s(
|
|
799
|
+
f,
|
|
800
800
|
{
|
|
801
801
|
sx: {
|
|
802
802
|
alignItems: "center",
|
|
@@ -806,135 +806,135 @@ const Ae = ({
|
|
|
806
806
|
px: 24
|
|
807
807
|
},
|
|
808
808
|
children: [
|
|
809
|
-
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "body1", children:
|
|
809
|
+
/* @__PURE__ */ e(l, { flexGrow: 1, variant: "body1", children: n.schedule_payoff_label }),
|
|
810
810
|
/* @__PURE__ */ e(l, { variant: "body1", children: "-" })
|
|
811
811
|
]
|
|
812
812
|
}
|
|
813
813
|
) })
|
|
814
814
|
] }) });
|
|
815
|
-
},
|
|
816
|
-
const { debts:
|
|
817
|
-
await
|
|
815
|
+
}, Mt = D(It), kt = D(({ debt: r }) => {
|
|
816
|
+
const { debts: o } = C(), { updateAccount: n } = te(), { onEvent: t } = B(), [a, i] = g.useState(r.interest_rate ?? 0), d = a < 0, c = async () => {
|
|
817
|
+
await n({ ...r.account, interest_rate: a }), r.interest_rate = a, t(A.DEBTS_SAVE_RATE_ACTION, { account_guid: r.guid });
|
|
818
818
|
}, p = () => {
|
|
819
819
|
setTimeout(() => {
|
|
820
|
-
i(
|
|
820
|
+
i(r.interest_rate ?? 0);
|
|
821
821
|
}, 250);
|
|
822
822
|
};
|
|
823
823
|
return /* @__PURE__ */ e(
|
|
824
|
-
|
|
824
|
+
re,
|
|
825
825
|
{
|
|
826
|
-
isSaveDisabled:
|
|
827
|
-
label: `${
|
|
826
|
+
isSaveDisabled: d,
|
|
827
|
+
label: `${o.details_interest_rate} (%)`,
|
|
828
828
|
onCancel: p,
|
|
829
|
-
onSave:
|
|
830
|
-
primaryText:
|
|
831
|
-
secondaryText:
|
|
832
|
-
zeroStateText:
|
|
829
|
+
onSave: c,
|
|
830
|
+
primaryText: o.details_interest_rate,
|
|
831
|
+
secondaryText: je(Number(r.interest_rate) / 100),
|
|
832
|
+
zeroStateText: r.interest_rate ? void 0 : o.add_interest_rate,
|
|
833
833
|
children: /* @__PURE__ */ e(
|
|
834
834
|
ot,
|
|
835
835
|
{
|
|
836
|
-
error:
|
|
836
|
+
error: d,
|
|
837
837
|
fullWidth: !0,
|
|
838
|
-
onChange: (
|
|
838
|
+
onChange: (h) => i(isNaN(parseFloat(h.target.value)) ? 0 : parseFloat(h.target.value)),
|
|
839
839
|
type: "number",
|
|
840
840
|
value: a
|
|
841
841
|
}
|
|
842
842
|
)
|
|
843
843
|
}
|
|
844
844
|
);
|
|
845
|
-
}),
|
|
846
|
-
const { debts:
|
|
847
|
-
await
|
|
845
|
+
}), Nt = D(({ debt: r }) => {
|
|
846
|
+
const { debts: o } = C(), { updateAccount: n } = te(), { onEvent: t } = B(), [a, i] = g.useState(r.monthly_payment ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
|
|
847
|
+
await n({ ...r.account, minimum_payment: a }), r.monthly_payment = a, t(A.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: r.guid });
|
|
848
848
|
}, p = () => {
|
|
849
849
|
setTimeout(() => {
|
|
850
|
-
i(
|
|
850
|
+
i(r.monthly_payment ?? 0);
|
|
851
851
|
}, 250);
|
|
852
852
|
};
|
|
853
853
|
return /* @__PURE__ */ e(
|
|
854
|
-
|
|
854
|
+
re,
|
|
855
855
|
{
|
|
856
|
-
isSaveDisabled:
|
|
857
|
-
label:
|
|
856
|
+
isSaveDisabled: d,
|
|
857
|
+
label: o.details_monthly_payment,
|
|
858
858
|
onCancel: p,
|
|
859
|
-
onSave:
|
|
860
|
-
primaryText:
|
|
861
|
-
secondaryText:
|
|
862
|
-
zeroStateText:
|
|
859
|
+
onSave: c,
|
|
860
|
+
primaryText: o.details_monthly_payment,
|
|
861
|
+
secondaryText: P(r.monthly_payment, "0,0"),
|
|
862
|
+
zeroStateText: r.monthly_payment ? void 0 : o.add_monthly_payment,
|
|
863
863
|
children: /* @__PURE__ */ e(
|
|
864
864
|
se,
|
|
865
865
|
{
|
|
866
866
|
amount: a,
|
|
867
867
|
autoFocus: !0,
|
|
868
|
-
error:
|
|
868
|
+
error: d,
|
|
869
869
|
fullWidth: !0,
|
|
870
870
|
minAmount: 0,
|
|
871
|
-
setAmount: (
|
|
871
|
+
setAmount: (h) => i(isNaN(Number(h)) ? a : Number(h)),
|
|
872
872
|
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
873
873
|
}
|
|
874
874
|
)
|
|
875
875
|
}
|
|
876
876
|
);
|
|
877
|
-
}),
|
|
878
|
-
const { debts:
|
|
879
|
-
await
|
|
877
|
+
}), Pt = D(({ debt: r }) => {
|
|
878
|
+
const { debts: o } = C(), { updateAccount: n } = te(), { onEvent: t } = B(), [a, i] = g.useState(r.original_balance ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
|
|
879
|
+
await n({ ...r.account, original_balance: a }), r.original_balance = a, t(A.DEBTS_SAVE_BALANCE_ACTION, { account_guid: r.guid });
|
|
880
880
|
}, p = () => {
|
|
881
881
|
setTimeout(() => {
|
|
882
|
-
i(
|
|
882
|
+
i(r.original_balance ?? 0);
|
|
883
883
|
}, 250);
|
|
884
884
|
};
|
|
885
885
|
return /* @__PURE__ */ e(
|
|
886
|
-
|
|
886
|
+
re,
|
|
887
887
|
{
|
|
888
|
-
isSaveDisabled:
|
|
889
|
-
label:
|
|
888
|
+
isSaveDisabled: d,
|
|
889
|
+
label: o.details_original_balance,
|
|
890
890
|
onCancel: p,
|
|
891
|
-
onSave:
|
|
892
|
-
primaryText:
|
|
893
|
-
secondaryText:
|
|
894
|
-
zeroStateText:
|
|
891
|
+
onSave: c,
|
|
892
|
+
primaryText: o.details_original_balance,
|
|
893
|
+
secondaryText: P(r.original_balance, "0,0"),
|
|
894
|
+
zeroStateText: r.original_balance ? void 0 : o.add_original_balance,
|
|
895
895
|
children: /* @__PURE__ */ e(
|
|
896
896
|
se,
|
|
897
897
|
{
|
|
898
898
|
amount: a,
|
|
899
899
|
autoFocus: !0,
|
|
900
|
-
error:
|
|
900
|
+
error: d,
|
|
901
901
|
fullWidth: !0,
|
|
902
902
|
minAmount: 0,
|
|
903
|
-
setAmount: (
|
|
903
|
+
setAmount: (h) => i(isNaN(Number(h)) ? a : Number(h)),
|
|
904
904
|
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
905
905
|
}
|
|
906
906
|
)
|
|
907
907
|
}
|
|
908
908
|
);
|
|
909
|
-
}),
|
|
910
|
-
const { onEvent:
|
|
911
|
-
return
|
|
912
|
-
|
|
913
|
-
/* @__PURE__ */ e(
|
|
909
|
+
}), Rt = () => {
|
|
910
|
+
const { onEvent: r } = B(), { selectedDebtChartData: o } = L();
|
|
911
|
+
return g.useEffect(() => r(A.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ s(f, { bgcolor: "background.paper", children: [
|
|
912
|
+
o?.goal && /* @__PURE__ */ s($, { children: [
|
|
913
|
+
/* @__PURE__ */ e(tt, { goal: o.goal }),
|
|
914
914
|
/* @__PURE__ */ e(G, {}),
|
|
915
|
-
/* @__PURE__ */ e(
|
|
915
|
+
/* @__PURE__ */ e(rt, { goal: o.goal }),
|
|
916
916
|
/* @__PURE__ */ e(G, {}),
|
|
917
|
-
/* @__PURE__ */ e(
|
|
917
|
+
/* @__PURE__ */ e(nt, { goal: o.goal }),
|
|
918
918
|
/* @__PURE__ */ e(G, {})
|
|
919
919
|
] }),
|
|
920
|
-
!
|
|
921
|
-
/* @__PURE__ */ e(
|
|
920
|
+
!o?.goal && o?.account && /* @__PURE__ */ s($, { children: [
|
|
921
|
+
/* @__PURE__ */ e(Nt, { debt: o }),
|
|
922
922
|
/* @__PURE__ */ e(G, {}),
|
|
923
|
-
/* @__PURE__ */ e(
|
|
923
|
+
/* @__PURE__ */ e(kt, { debt: o }),
|
|
924
924
|
/* @__PURE__ */ e(G, {}),
|
|
925
|
-
/* @__PURE__ */ e(
|
|
925
|
+
/* @__PURE__ */ e(Pt, { debt: o }),
|
|
926
926
|
/* @__PURE__ */ e(G, {})
|
|
927
927
|
] })
|
|
928
928
|
] });
|
|
929
|
-
},
|
|
930
|
-
const { debts:
|
|
931
|
-
return
|
|
932
|
-
t &&
|
|
933
|
-
}, [t]), !t && !a ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(
|
|
934
|
-
/* @__PURE__ */ e(
|
|
935
|
-
|
|
929
|
+
}, Bt = D(Rt), Ft = ({ setTabValue: r, sx: o }) => {
|
|
930
|
+
const { debts: n } = C(), { showError: t, showCompleted: a } = L();
|
|
931
|
+
return g.useEffect(() => {
|
|
932
|
+
t && r(1);
|
|
933
|
+
}, [t]), !t && !a ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ s(f, { gap: 16, children: [
|
|
934
|
+
/* @__PURE__ */ e(ge, { sx: { my: 16, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
935
|
+
fe,
|
|
936
936
|
{
|
|
937
|
-
icon: t ? /* @__PURE__ */ e(
|
|
937
|
+
icon: t ? /* @__PURE__ */ e(at, { filled: !0 }) : /* @__PURE__ */ e(Se, { color: "success", filled: !0 }),
|
|
938
938
|
severity: "error",
|
|
939
939
|
sx: {
|
|
940
940
|
alignItems: "start",
|
|
@@ -947,13 +947,13 @@ const Ae = ({
|
|
|
947
947
|
}
|
|
948
948
|
},
|
|
949
949
|
children: [
|
|
950
|
-
/* @__PURE__ */ e(
|
|
951
|
-
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "subtitle2", children: t ?
|
|
950
|
+
/* @__PURE__ */ e(xe, { sx: { fontWeight: 600, marginTop: 2 }, variant: "body1", children: t ? n.status_error_title : n.status_complete_title }),
|
|
951
|
+
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "subtitle2", children: t ? n.status_error_description : n.status_complete_description })
|
|
952
952
|
]
|
|
953
953
|
}
|
|
954
954
|
) }),
|
|
955
|
-
t && /* @__PURE__ */ e(
|
|
956
|
-
|
|
955
|
+
t && /* @__PURE__ */ e(ge, { sx: { mb: 16, mt: 100, mx: 24, ...o }, children: /* @__PURE__ */ s(
|
|
956
|
+
fe,
|
|
957
957
|
{
|
|
958
958
|
icon: /* @__PURE__ */ e($, {}),
|
|
959
959
|
severity: "error",
|
|
@@ -965,149 +965,149 @@ const Ae = ({
|
|
|
965
965
|
}
|
|
966
966
|
},
|
|
967
967
|
children: [
|
|
968
|
-
/* @__PURE__ */ e(
|
|
969
|
-
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "subtitle2", children:
|
|
968
|
+
/* @__PURE__ */ e(xe, { sx: { fontWeight: 600, marginTop: 2 }, variant: "body1", children: n.status_info_title }),
|
|
969
|
+
/* @__PURE__ */ e(l, { component: "p", sx: { whiteSpace: "wrap" }, variant: "subtitle2", children: n.status_info_description })
|
|
970
970
|
]
|
|
971
971
|
}
|
|
972
972
|
) })
|
|
973
973
|
] });
|
|
974
|
-
},
|
|
975
|
-
const { debts:
|
|
974
|
+
}, Lt = D(Ft), $t = () => {
|
|
975
|
+
const { debts: r } = C(), { showError: o, showCompleted: n } = L(), [t, a] = g.useState(0);
|
|
976
976
|
return /* @__PURE__ */ s($, { children: [
|
|
977
|
-
(
|
|
977
|
+
(o || n) && /* @__PURE__ */ e(Lt, { setTabValue: a, sx: { mt: -24 } }),
|
|
978
978
|
/* @__PURE__ */ s(
|
|
979
|
-
|
|
979
|
+
et,
|
|
980
980
|
{
|
|
981
|
-
"aria-label":
|
|
981
|
+
"aria-label": r.details_tabs_aria_label,
|
|
982
982
|
centered: !0,
|
|
983
|
-
onChange: (i,
|
|
983
|
+
onChange: (i, d) => a(d),
|
|
984
984
|
textColor: "primary",
|
|
985
985
|
value: t,
|
|
986
986
|
variant: "fullWidth",
|
|
987
987
|
children: [
|
|
988
988
|
/* @__PURE__ */ e(
|
|
989
|
-
|
|
989
|
+
ye,
|
|
990
990
|
{
|
|
991
991
|
"aria-controls": "debt-schedule-tabpanel-0",
|
|
992
992
|
id: "debt-schedule-tab-0",
|
|
993
|
-
label:
|
|
993
|
+
label: r.schedule_tab_label
|
|
994
994
|
}
|
|
995
995
|
),
|
|
996
996
|
/* @__PURE__ */ e(
|
|
997
|
-
|
|
997
|
+
ye,
|
|
998
998
|
{
|
|
999
999
|
"aria-controls": "debt-details-tabpanel-1",
|
|
1000
1000
|
id: "debt-details-tab-1",
|
|
1001
|
-
label:
|
|
1001
|
+
label: r.details_tab_label
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
]
|
|
1005
1005
|
}
|
|
1006
1006
|
),
|
|
1007
|
-
/* @__PURE__ */ e(
|
|
1008
|
-
/* @__PURE__ */ e(
|
|
1007
|
+
/* @__PURE__ */ e(we, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(Mt, {}) }),
|
|
1008
|
+
/* @__PURE__ */ e(we, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(Bt, {}) })
|
|
1009
1009
|
] });
|
|
1010
|
-
},
|
|
1011
|
-
const { debts:
|
|
1010
|
+
}, Ot = D($t), Ht = ({ isOpen: r, onClose: o }) => {
|
|
1011
|
+
const { debts: n } = C(), { showError: t, showCompleted: a } = L(), i = t || a ? /* @__PURE__ */ e($, {}) : /* @__PURE__ */ e(Et, {});
|
|
1012
1012
|
return /* @__PURE__ */ e(
|
|
1013
1013
|
ie,
|
|
1014
1014
|
{
|
|
1015
|
-
ariaLabelClose:
|
|
1016
|
-
isOpen:
|
|
1017
|
-
onClose:
|
|
1018
|
-
title:
|
|
1019
|
-
children: /* @__PURE__ */ s(
|
|
1020
|
-
/* @__PURE__ */ e(
|
|
1021
|
-
/* @__PURE__ */ e(
|
|
1015
|
+
ariaLabelClose: n.details_close_aria,
|
|
1016
|
+
isOpen: r,
|
|
1017
|
+
onClose: o,
|
|
1018
|
+
title: n.details_title,
|
|
1019
|
+
children: /* @__PURE__ */ s(f, { bgcolor: "background.default", children: [
|
|
1020
|
+
/* @__PURE__ */ e(Ke, { customDetailsChart: i }),
|
|
1021
|
+
/* @__PURE__ */ e(Ot, {})
|
|
1022
1022
|
] })
|
|
1023
1023
|
}
|
|
1024
1024
|
);
|
|
1025
|
-
},
|
|
1026
|
-
const { debts:
|
|
1027
|
-
|
|
1028
|
-
user_guid:
|
|
1025
|
+
}, Wt = D(() => {
|
|
1026
|
+
const { debts: r } = C(), { monthlyCashFlowProfile: o, updateMonthlyCashFlowProfile: n } = V(), { onEvent: t } = B(), [a, i] = g.useState(o?.extra_payment ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
|
|
1027
|
+
o && (await n({ ...o, extra_payment: a }), o.extra_payment = a, t(A.DEBTS_SAVE_PAYDOWN_ACTION, {
|
|
1028
|
+
user_guid: o?.user_guid
|
|
1029
1029
|
}));
|
|
1030
1030
|
}, p = () => {
|
|
1031
1031
|
setTimeout(() => {
|
|
1032
|
-
i(
|
|
1032
|
+
i(o?.extra_payment ?? 0);
|
|
1033
1033
|
}, 250);
|
|
1034
1034
|
};
|
|
1035
1035
|
return /* @__PURE__ */ e(
|
|
1036
|
-
|
|
1036
|
+
re,
|
|
1037
1037
|
{
|
|
1038
|
-
isSaveDisabled:
|
|
1039
|
-
label:
|
|
1038
|
+
isSaveDisabled: d,
|
|
1039
|
+
label: r.paydown_drawer_extra_payment,
|
|
1040
1040
|
onCancel: p,
|
|
1041
|
-
onSave:
|
|
1042
|
-
primaryText:
|
|
1043
|
-
secondaryText:
|
|
1044
|
-
zeroStateText:
|
|
1041
|
+
onSave: c,
|
|
1042
|
+
primaryText: r.paydown_drawer_extra_payment,
|
|
1043
|
+
secondaryText: P(o?.extra_payment, "0,0"),
|
|
1044
|
+
zeroStateText: o?.extra_payment ? void 0 : r.add_extra_payment,
|
|
1045
1045
|
children: /* @__PURE__ */ e(
|
|
1046
1046
|
se,
|
|
1047
1047
|
{
|
|
1048
1048
|
amount: a,
|
|
1049
1049
|
autoFocus: !0,
|
|
1050
|
-
error:
|
|
1050
|
+
error: d,
|
|
1051
1051
|
fullWidth: !0,
|
|
1052
1052
|
minAmount: 0,
|
|
1053
|
-
setAmount: (
|
|
1053
|
+
setAmount: (h) => i(isNaN(Number(h)) ? a : Number(h)),
|
|
1054
1054
|
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
1055
1055
|
}
|
|
1056
1056
|
)
|
|
1057
1057
|
}
|
|
1058
1058
|
);
|
|
1059
|
-
}),
|
|
1060
|
-
const { debts:
|
|
1061
|
-
return /* @__PURE__ */ s(
|
|
1062
|
-
/* @__PURE__ */ s(
|
|
1063
|
-
/* @__PURE__ */ s(
|
|
1064
|
-
/* @__PURE__ */ e(l, { variant: "body1", children:
|
|
1065
|
-
/* @__PURE__ */ e(
|
|
1066
|
-
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "body2", width: 208, children:
|
|
1059
|
+
}), Gt = () => {
|
|
1060
|
+
const { debts: r } = C(), { totalMonthlyPayments: o } = ee(), { monthlyCashFlowProfile: n } = V(), t = o + Number(n?.extra_payment);
|
|
1061
|
+
return /* @__PURE__ */ s(f, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
|
|
1062
|
+
/* @__PURE__ */ s(f, { p: 24, children: [
|
|
1063
|
+
/* @__PURE__ */ s(f, { alignItems: "center", gap: 4, mb: 24, children: [
|
|
1064
|
+
/* @__PURE__ */ e(l, { variant: "body1", children: r.paydown_drawer_mimimum_label }),
|
|
1065
|
+
/* @__PURE__ */ e(ve, { bold: !0, variant: "h1", children: P(o, "0,0") }),
|
|
1066
|
+
/* @__PURE__ */ e(l, { textAlign: "center", truncate: !1, variant: "body2", width: 208, children: r.paydown_drawer_minimum_info })
|
|
1067
1067
|
] }),
|
|
1068
|
-
/* @__PURE__ */ s(
|
|
1069
|
-
/* @__PURE__ */ e(l, { variant: "h3", children:
|
|
1070
|
-
/* @__PURE__ */ e(l, { truncate: !1, variant: "subtitle2", children:
|
|
1068
|
+
/* @__PURE__ */ s(f, { children: [
|
|
1069
|
+
/* @__PURE__ */ e(l, { variant: "h3", children: r.paydown_drawer_subtitle }),
|
|
1070
|
+
/* @__PURE__ */ e(l, { truncate: !1, variant: "subtitle2", children: r.paydown_drawer_description })
|
|
1071
1071
|
] })
|
|
1072
1072
|
] }),
|
|
1073
|
-
/* @__PURE__ */ e(
|
|
1074
|
-
/* @__PURE__ */ e(
|
|
1075
|
-
/* @__PURE__ */ e(l, { variant: "body2", children:
|
|
1076
|
-
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "body1", children:
|
|
1073
|
+
/* @__PURE__ */ e(f, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Wt, {}) }),
|
|
1074
|
+
/* @__PURE__ */ e(f, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ s(f, { gap: 4, children: [
|
|
1075
|
+
/* @__PURE__ */ e(l, { variant: "body2", children: r.paydown_drawer_total_payment }),
|
|
1076
|
+
/* @__PURE__ */ e(l, { bold: !0, textAlign: "right", variant: "body1", children: P(t, "0,0") })
|
|
1077
1077
|
] }) })
|
|
1078
1078
|
] });
|
|
1079
|
-
},
|
|
1080
|
-
const { debts:
|
|
1079
|
+
}, jt = D(Gt), zt = ({ isOpen: r, onClose: o }) => {
|
|
1080
|
+
const { debts: n } = C();
|
|
1081
1081
|
return /* @__PURE__ */ e(
|
|
1082
1082
|
ie,
|
|
1083
1083
|
{
|
|
1084
|
-
ariaLabelClose:
|
|
1085
|
-
isOpen:
|
|
1086
|
-
onClose:
|
|
1087
|
-
title:
|
|
1088
|
-
children: /* @__PURE__ */ e(
|
|
1084
|
+
ariaLabelClose: n.paydown_drawer_close_aria,
|
|
1085
|
+
isOpen: r,
|
|
1086
|
+
onClose: o,
|
|
1087
|
+
title: n.paydown_drawer_title,
|
|
1088
|
+
children: /* @__PURE__ */ e(jt, {})
|
|
1089
1089
|
}
|
|
1090
1090
|
);
|
|
1091
1091
|
};
|
|
1092
|
-
function
|
|
1093
|
-
const
|
|
1092
|
+
function Yt(r, o) {
|
|
1093
|
+
const n = (t) => {
|
|
1094
1094
|
if (typeof t == "number") return t;
|
|
1095
1095
|
if (t === "!" || t === "✓") return 1 / 0;
|
|
1096
1096
|
throw new Error("Unsupported value");
|
|
1097
1097
|
};
|
|
1098
|
-
return r
|
|
1098
|
+
return n(r) - n(o);
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1101
|
-
return
|
|
1100
|
+
function Vt(r) {
|
|
1101
|
+
return r.is_paid_off ? "✓" : r.priority === void 0 || r.is_impossible ? "!" : r.priority;
|
|
1102
1102
|
}
|
|
1103
|
-
const
|
|
1104
|
-
const
|
|
1103
|
+
const Kt = (r) => {
|
|
1104
|
+
const o = {
|
|
1105
1105
|
text: "#121417",
|
|
1106
1106
|
background: "#FFB252"
|
|
1107
1107
|
};
|
|
1108
|
-
return
|
|
1109
|
-
},
|
|
1110
|
-
const
|
|
1108
|
+
return r === "!" && (o.text = "#FFFFFF", o.background = "#DF320C"), r === "✓" && (o.text = "#FFFFFF", o.background = "#09A57F"), o;
|
|
1109
|
+
}, Ut = (r) => {
|
|
1110
|
+
const o = String(r.formattedValue), n = Kt(o);
|
|
1111
1111
|
return /* @__PURE__ */ e(
|
|
1112
1112
|
le,
|
|
1113
1113
|
{
|
|
@@ -1119,75 +1119,75 @@ const Vt = (o) => {
|
|
|
1119
1119
|
// Adjust the size as needed
|
|
1120
1120
|
height: 20,
|
|
1121
1121
|
borderRadius: "50%",
|
|
1122
|
-
backgroundColor:
|
|
1122
|
+
backgroundColor: n.background,
|
|
1123
1123
|
marginLeft: "10px"
|
|
1124
1124
|
},
|
|
1125
|
-
children: /* @__PURE__ */ e(l, { color:
|
|
1125
|
+
children: /* @__PURE__ */ e(l, { color: n.text, fontWeight: 700, variant: "body2", children: o })
|
|
1126
1126
|
}
|
|
1127
1127
|
);
|
|
1128
|
-
},
|
|
1129
|
-
const
|
|
1130
|
-
return /* @__PURE__ */ s(
|
|
1128
|
+
}, qt = (r) => {
|
|
1129
|
+
const o = r.row.account, n = lt[o.account_type];
|
|
1130
|
+
return /* @__PURE__ */ s(f, { alignItems: "center", flexDirection: "row", children: [
|
|
1131
1131
|
/* @__PURE__ */ e(
|
|
1132
|
-
|
|
1132
|
+
$e,
|
|
1133
1133
|
{
|
|
1134
|
-
alt: `${
|
|
1135
|
-
institutionGuid:
|
|
1134
|
+
alt: `${o.institutionName}`,
|
|
1135
|
+
institutionGuid: o.institution_guid || ""
|
|
1136
1136
|
}
|
|
1137
1137
|
),
|
|
1138
|
-
/* @__PURE__ */ s(
|
|
1139
|
-
/* @__PURE__ */ e(l, { variant: "body2", children:
|
|
1140
|
-
/* @__PURE__ */ e(l, { variant: "caption", children:
|
|
1138
|
+
/* @__PURE__ */ s(f, { ml: 12, children: [
|
|
1139
|
+
/* @__PURE__ */ e(l, { variant: "body2", children: o.name }),
|
|
1140
|
+
/* @__PURE__ */ e(l, { variant: "caption", children: n })
|
|
1141
1141
|
] })
|
|
1142
1142
|
] });
|
|
1143
|
-
},
|
|
1144
|
-
sx:
|
|
1145
|
-
debts:
|
|
1146
|
-
hoveredDebtGuid:
|
|
1143
|
+
}, Xt = ({
|
|
1144
|
+
sx: r = {},
|
|
1145
|
+
debts: o,
|
|
1146
|
+
hoveredDebtGuid: n,
|
|
1147
1147
|
onHoverRow: t,
|
|
1148
1148
|
onClickRow: a
|
|
1149
1149
|
}) => {
|
|
1150
|
-
const i =
|
|
1150
|
+
const i = Y(), { onEvent: d } = B(), { isMobile: c } = ae(), { debts: p, common: h } = C(), [u, x] = g.useState([
|
|
1151
1151
|
{ field: "priority", sort: "asc" }
|
|
1152
1152
|
]), b = [
|
|
1153
1153
|
{
|
|
1154
1154
|
field: "priority",
|
|
1155
1155
|
headerName: p.table_column_priority,
|
|
1156
1156
|
renderHeader: j,
|
|
1157
|
-
renderCell:
|
|
1158
|
-
sortComparator:
|
|
1157
|
+
renderCell: Ut,
|
|
1158
|
+
sortComparator: Yt,
|
|
1159
1159
|
sortable: !0,
|
|
1160
1160
|
hideSortIcons: !0,
|
|
1161
1161
|
type: "custom",
|
|
1162
1162
|
align: "left",
|
|
1163
1163
|
headerAlign: "left",
|
|
1164
|
-
minWidth:
|
|
1165
|
-
flex:
|
|
1164
|
+
minWidth: c ? 67 : 72,
|
|
1165
|
+
flex: c ? 0.2 : 0.4
|
|
1166
1166
|
},
|
|
1167
1167
|
{
|
|
1168
1168
|
field: "account",
|
|
1169
1169
|
headerName: p.table_column_account,
|
|
1170
1170
|
renderHeader: j,
|
|
1171
|
-
renderCell:
|
|
1171
|
+
renderCell: qt,
|
|
1172
1172
|
sortable: !1,
|
|
1173
1173
|
type: "custom",
|
|
1174
1174
|
align: "left",
|
|
1175
1175
|
headerAlign: "left",
|
|
1176
|
-
minWidth:
|
|
1176
|
+
minWidth: c ? 180 : 225,
|
|
1177
1177
|
flex: 1
|
|
1178
1178
|
},
|
|
1179
1179
|
{
|
|
1180
1180
|
field: "balance",
|
|
1181
1181
|
headerName: p.table_column_balance,
|
|
1182
1182
|
renderHeader: j,
|
|
1183
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children:
|
|
1183
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children: P(y.value, "0,0") }),
|
|
1184
1184
|
sortable: !0,
|
|
1185
|
-
hideSortIcons:
|
|
1185
|
+
hideSortIcons: c,
|
|
1186
1186
|
type: "number",
|
|
1187
1187
|
align: "left",
|
|
1188
1188
|
headerAlign: "left",
|
|
1189
|
-
minWidth:
|
|
1190
|
-
flex:
|
|
1189
|
+
minWidth: c ? 70 : 122,
|
|
1190
|
+
flex: c ? 0.4 : 0.6
|
|
1191
1191
|
},
|
|
1192
1192
|
{
|
|
1193
1193
|
field: "interest_rate",
|
|
@@ -1195,7 +1195,7 @@ const Vt = (o) => {
|
|
|
1195
1195
|
renderHeader: j,
|
|
1196
1196
|
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children: isNaN(y.value) ? "---" : `${Number(y.value).toFixed(2)}%` }),
|
|
1197
1197
|
sortable: !0,
|
|
1198
|
-
hideSortIcons:
|
|
1198
|
+
hideSortIcons: c,
|
|
1199
1199
|
type: "number",
|
|
1200
1200
|
align: "left",
|
|
1201
1201
|
headerAlign: "left",
|
|
@@ -1206,9 +1206,9 @@ const Vt = (o) => {
|
|
|
1206
1206
|
field: "projected_payoff_date",
|
|
1207
1207
|
headerName: p.table_column_payoff_date,
|
|
1208
1208
|
renderHeader: j,
|
|
1209
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children: y.value ?
|
|
1209
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children: y.value ? J(y.value, Q.MONTH_SHORT_YEAR) : "---" }),
|
|
1210
1210
|
sortable: !0,
|
|
1211
|
-
hideSortIcons:
|
|
1211
|
+
hideSortIcons: c,
|
|
1212
1212
|
type: "number",
|
|
1213
1213
|
align: "left",
|
|
1214
1214
|
headerAlign: "left",
|
|
@@ -1219,22 +1219,22 @@ const Vt = (o) => {
|
|
|
1219
1219
|
field: "monthly_payment",
|
|
1220
1220
|
headerName: p.table_column_amount_due,
|
|
1221
1221
|
renderHeader: j,
|
|
1222
|
-
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children: typeof y.value == "number" ?
|
|
1222
|
+
renderCell: (y) => /* @__PURE__ */ e(l, { color: i.palette.text.primary, variant: "body2", children: typeof y.value == "number" ? P(y.value, "0,0") : "---" }),
|
|
1223
1223
|
sortable: !0,
|
|
1224
|
-
hideSortIcons:
|
|
1224
|
+
hideSortIcons: c,
|
|
1225
1225
|
type: "number",
|
|
1226
1226
|
align: "left",
|
|
1227
1227
|
headerAlign: "left",
|
|
1228
1228
|
minWidth: 122,
|
|
1229
1229
|
flex: 0.6
|
|
1230
1230
|
}
|
|
1231
|
-
],
|
|
1231
|
+
], I = [
|
|
1232
1232
|
...b.slice(0, 3),
|
|
1233
1233
|
{
|
|
1234
1234
|
field: "chevron",
|
|
1235
1235
|
headerClassName: "chevron-header",
|
|
1236
1236
|
headerName: "",
|
|
1237
|
-
renderCell: () => /* @__PURE__ */ e(_, { "aria-label":
|
|
1237
|
+
renderCell: () => /* @__PURE__ */ e(_, { "aria-label": h.see_details, role: "button", children: /* @__PURE__ */ e(oe, { name: "chevron_right" }) }),
|
|
1238
1238
|
sortable: !1,
|
|
1239
1239
|
hideSortIcons: !0,
|
|
1240
1240
|
type: "custom",
|
|
@@ -1242,18 +1242,18 @@ const Vt = (o) => {
|
|
|
1242
1242
|
headerAlign: "right",
|
|
1243
1243
|
width: 20
|
|
1244
1244
|
}
|
|
1245
|
-
],
|
|
1245
|
+
], M = g.useMemo(() => o.map((y, m) => ({
|
|
1246
1246
|
...y,
|
|
1247
|
-
id:
|
|
1248
|
-
priority:
|
|
1249
|
-
})), [
|
|
1250
|
-
const
|
|
1251
|
-
t?.(
|
|
1247
|
+
id: m,
|
|
1248
|
+
priority: Vt(y)
|
|
1249
|
+
})), [o]), k = (y) => {
|
|
1250
|
+
const T = y.target.closest("[data-id]")?.getAttribute("data-id"), R = o[Number(T)];
|
|
1251
|
+
t?.(R?.guid ?? "");
|
|
1252
1252
|
}, v = (y) => {
|
|
1253
|
-
|
|
1254
|
-
},
|
|
1255
|
-
|
|
1256
|
-
}, O = (y) =>
|
|
1253
|
+
c || k(y);
|
|
1254
|
+
}, S = (y) => {
|
|
1255
|
+
c && k(y);
|
|
1256
|
+
}, O = (y) => M.find((m) => m.guid === y)?.id;
|
|
1257
1257
|
return /* @__PURE__ */ e(
|
|
1258
1258
|
le,
|
|
1259
1259
|
{
|
|
@@ -1264,37 +1264,37 @@ const Vt = (o) => {
|
|
|
1264
1264
|
overflowX: "auto",
|
|
1265
1265
|
overflowY: "visible",
|
|
1266
1266
|
boxShadow: "none",
|
|
1267
|
-
...
|
|
1267
|
+
...r
|
|
1268
1268
|
},
|
|
1269
1269
|
children: /* @__PURE__ */ e(
|
|
1270
|
-
|
|
1270
|
+
it,
|
|
1271
1271
|
{
|
|
1272
|
-
columns:
|
|
1272
|
+
columns: c ? I : b,
|
|
1273
1273
|
disableColumnFilter: !0,
|
|
1274
1274
|
disableColumnMenu: !0,
|
|
1275
1275
|
hideFooter: !0,
|
|
1276
|
-
initialState: { sorting: { sortModel:
|
|
1276
|
+
initialState: { sorting: { sortModel: u } },
|
|
1277
1277
|
onRowClick: (y) => {
|
|
1278
|
-
a(),
|
|
1278
|
+
a(), d(A.DEBTS_CLICK_TABLE_ROW, { account_guid: y.row.guid });
|
|
1279
1279
|
},
|
|
1280
1280
|
onSortModelChange: (y) => {
|
|
1281
|
-
|
|
1281
|
+
x(y), d(A.DEBTS_CLICK_TABLE_SORT);
|
|
1282
1282
|
},
|
|
1283
|
-
rows:
|
|
1283
|
+
rows: M,
|
|
1284
1284
|
slotProps: {
|
|
1285
1285
|
baseIconButton: { color: "secondary", sx: { ml: 8 } },
|
|
1286
1286
|
row: {
|
|
1287
1287
|
onMouseEnter: v,
|
|
1288
|
-
onMouseLeave: () => !
|
|
1289
|
-
onTouchStart:
|
|
1290
|
-
onClick:
|
|
1288
|
+
onMouseLeave: () => !c && t?.(""),
|
|
1289
|
+
onTouchStart: S,
|
|
1290
|
+
onClick: c ? S : void 0
|
|
1291
1291
|
}
|
|
1292
1292
|
},
|
|
1293
|
-
sortModel:
|
|
1293
|
+
sortModel: u,
|
|
1294
1294
|
sortingOrder: ["asc", "desc"],
|
|
1295
1295
|
sx: {
|
|
1296
1296
|
"& .chevron-header": { display: "none" },
|
|
1297
|
-
[`& .MuiDataGrid-row[data-id="${O(
|
|
1297
|
+
[`& .MuiDataGrid-row[data-id="${O(n)}"]`]: {
|
|
1298
1298
|
backgroundColor: i.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
|
|
1299
1299
|
filter: "brightness(98%)"
|
|
1300
1300
|
}
|
|
@@ -1303,81 +1303,82 @@ const Vt = (o) => {
|
|
|
1303
1303
|
)
|
|
1304
1304
|
}
|
|
1305
1305
|
);
|
|
1306
|
-
},
|
|
1307
|
-
buttonText:
|
|
1308
|
-
disabled:
|
|
1309
|
-
|
|
1310
|
-
|
|
1306
|
+
}, Zt = ({
|
|
1307
|
+
buttonText: r,
|
|
1308
|
+
disabled: o,
|
|
1309
|
+
isDesktop: n = !1,
|
|
1310
|
+
isOpen: t,
|
|
1311
|
+
onClick: a
|
|
1311
1312
|
}) => {
|
|
1312
|
-
const
|
|
1313
|
-
return
|
|
1314
|
-
|
|
1313
|
+
const i = t ? "unfold_less" : "unfold_more";
|
|
1314
|
+
return n ? /* @__PURE__ */ e(
|
|
1315
|
+
Te,
|
|
1315
1316
|
{
|
|
1316
1317
|
"aria-controls": "prioritize-debts",
|
|
1317
1318
|
"aria-describedby": "prioritize-debts",
|
|
1318
1319
|
"aria-haspopup": !0,
|
|
1319
1320
|
"aria-label": "prioritize-debts",
|
|
1320
|
-
disabled:
|
|
1321
|
-
onClick:
|
|
1322
|
-
startIcon: /* @__PURE__ */ e(
|
|
1323
|
-
sx: { justifyContent: "start"
|
|
1324
|
-
children:
|
|
1321
|
+
disabled: o,
|
|
1322
|
+
onClick: a,
|
|
1323
|
+
startIcon: /* @__PURE__ */ e(oe, { name: i }),
|
|
1324
|
+
sx: { justifyContent: "start" },
|
|
1325
|
+
children: r
|
|
1325
1326
|
}
|
|
1326
1327
|
) : /* @__PURE__ */ e(
|
|
1327
|
-
|
|
1328
|
+
st,
|
|
1328
1329
|
{
|
|
1329
1330
|
"aria-controls": "prioritize-debts",
|
|
1330
1331
|
"aria-describedby": "prioritize-debts",
|
|
1331
1332
|
"aria-haspopup": !0,
|
|
1332
1333
|
"aria-label": "prioritize-debts",
|
|
1333
|
-
disabled:
|
|
1334
|
-
onClick:
|
|
1335
|
-
children: /* @__PURE__ */ e(
|
|
1334
|
+
disabled: o,
|
|
1335
|
+
onClick: a,
|
|
1336
|
+
children: /* @__PURE__ */ e(oe, { name: i })
|
|
1336
1337
|
}
|
|
1337
1338
|
);
|
|
1338
|
-
},
|
|
1339
|
-
const { onEvent:
|
|
1339
|
+
}, Jt = D(({ buttonEl: r, onClose: o }) => {
|
|
1340
|
+
const { onEvent: n } = B(), { debts: t } = C(), { selectedDebtPriority: a, setSelectedDebtPriority: i } = L(), d = !!r, c = [
|
|
1340
1341
|
{
|
|
1341
|
-
priority:
|
|
1342
|
+
priority: N.FASTEST_PAYOFF_FIRST,
|
|
1342
1343
|
text: t.priority_sort_fastest_payoff
|
|
1343
1344
|
},
|
|
1344
1345
|
{
|
|
1345
|
-
priority:
|
|
1346
|
+
priority: N.HIGHEST_INTEREST,
|
|
1346
1347
|
text: t.priority_sort_highest_interest
|
|
1347
1348
|
},
|
|
1348
1349
|
{
|
|
1349
|
-
priority:
|
|
1350
|
+
priority: N.LOWEST_BALANCE,
|
|
1350
1351
|
text: t.priority_sort_lowest_balance
|
|
1351
1352
|
},
|
|
1352
1353
|
{
|
|
1353
|
-
priority:
|
|
1354
|
+
priority: N.HIGHEST_BALANCE,
|
|
1354
1355
|
text: t.priority_sort_highest_balance
|
|
1355
1356
|
}
|
|
1356
|
-
], p = (
|
|
1357
|
-
i(
|
|
1357
|
+
], p = (h) => {
|
|
1358
|
+
i(h), n(A.DEBTS_CLICK_PRIORITY, { debts_priority: h });
|
|
1358
1359
|
};
|
|
1359
1360
|
return /* @__PURE__ */ e(
|
|
1360
|
-
|
|
1361
|
+
dt,
|
|
1361
1362
|
{
|
|
1362
|
-
anchorEl:
|
|
1363
|
+
anchorEl: r,
|
|
1363
1364
|
anchorOrigin: {
|
|
1364
1365
|
vertical: "bottom",
|
|
1365
1366
|
horizontal: "left"
|
|
1366
1367
|
},
|
|
1367
1368
|
id: "prioritize-debts",
|
|
1368
|
-
onClose:
|
|
1369
|
-
open:
|
|
1369
|
+
onClose: o,
|
|
1370
|
+
open: d,
|
|
1370
1371
|
transformOrigin: {
|
|
1371
1372
|
vertical: "top",
|
|
1372
1373
|
horizontal: "left"
|
|
1373
1374
|
},
|
|
1374
|
-
children: /* @__PURE__ */ e(
|
|
1375
|
-
|
|
1375
|
+
children: /* @__PURE__ */ e(De, { children: c.map(({ priority: h, text: u }) => /* @__PURE__ */ s(
|
|
1376
|
+
ct,
|
|
1376
1377
|
{
|
|
1377
|
-
onClick: () => p(
|
|
1378
|
+
onClick: () => p(h),
|
|
1378
1379
|
sx: {
|
|
1379
|
-
bgcolor: a ===
|
|
1380
|
-
color: a ===
|
|
1380
|
+
bgcolor: a === h ? "primary.main" : void 0,
|
|
1381
|
+
color: a === h ? "#fff" : void 0,
|
|
1381
1382
|
justifyContent: "space-between",
|
|
1382
1383
|
minHeight: 44,
|
|
1383
1384
|
minWidth: 268,
|
|
@@ -1390,42 +1391,43 @@ const Vt = (o) => {
|
|
|
1390
1391
|
}
|
|
1391
1392
|
},
|
|
1392
1393
|
children: [
|
|
1393
|
-
/* @__PURE__ */ e(l, { color: "inherit", variant: "body2", children:
|
|
1394
|
-
a ===
|
|
1394
|
+
/* @__PURE__ */ e(l, { color: "inherit", variant: "body2", children: u }),
|
|
1395
|
+
a === h && /* @__PURE__ */ e(Se, { color: "inherit", filled: !0, fontSize: "small" })
|
|
1395
1396
|
]
|
|
1396
1397
|
},
|
|
1397
|
-
|
|
1398
|
+
h
|
|
1398
1399
|
)) })
|
|
1399
1400
|
}
|
|
1400
1401
|
);
|
|
1401
|
-
}),
|
|
1402
|
-
const { onEvent: n } = B(), { debts:
|
|
1403
|
-
|
|
1404
|
-
},
|
|
1405
|
-
|
|
1406
|
-
},
|
|
1407
|
-
[
|
|
1408
|
-
[
|
|
1409
|
-
[
|
|
1410
|
-
[
|
|
1411
|
-
})[
|
|
1402
|
+
}), Qt = D(({ disabled: r, isDesktop: o }) => {
|
|
1403
|
+
const { onEvent: n } = B(), { debts: t } = C(), { selectedDebtPriority: a } = L(), [i, d] = g.useState(null), c = (x) => {
|
|
1404
|
+
d(x.currentTarget), n(A.DEBTS_CLICK_PRIORITIZE);
|
|
1405
|
+
}, p = () => {
|
|
1406
|
+
d(null);
|
|
1407
|
+
}, h = !!i, u = g.useMemo(() => ({
|
|
1408
|
+
[N.FASTEST_PAYOFF_FIRST]: t.priority_sort_fastest_payoff,
|
|
1409
|
+
[N.HIGHEST_INTEREST]: t.priority_sort_highest_interest,
|
|
1410
|
+
[N.HIGHEST_BALANCE]: t.priority_sort_highest_balance,
|
|
1411
|
+
[N.LOWEST_BALANCE]: t.priority_sort_lowest_balance
|
|
1412
|
+
})[a] ?? t.priority_sort_lowest_balance, [a]);
|
|
1412
1413
|
return /* @__PURE__ */ s(_, { children: [
|
|
1413
1414
|
/* @__PURE__ */ e(
|
|
1414
|
-
|
|
1415
|
+
Zt,
|
|
1415
1416
|
{
|
|
1416
|
-
buttonText:
|
|
1417
|
-
disabled:
|
|
1418
|
-
|
|
1417
|
+
buttonText: u,
|
|
1418
|
+
disabled: r,
|
|
1419
|
+
isDesktop: o,
|
|
1420
|
+
isOpen: h,
|
|
1419
1421
|
onClick: c
|
|
1420
1422
|
}
|
|
1421
1423
|
),
|
|
1422
|
-
/* @__PURE__ */ e(
|
|
1424
|
+
/* @__PURE__ */ e(Jt, { buttonEl: i, onClose: p })
|
|
1423
1425
|
] });
|
|
1424
|
-
}),
|
|
1425
|
-
const t =
|
|
1426
|
-
|
|
1426
|
+
}), er = (r, o, n = 0) => {
|
|
1427
|
+
const t = r.map((p) => ({ ...p }));
|
|
1428
|
+
Ae(t, o);
|
|
1427
1429
|
const a = /* @__PURE__ */ new Date(), i = [];
|
|
1428
|
-
let
|
|
1430
|
+
let d = 0, c = 1;
|
|
1429
1431
|
for (const p of t)
|
|
1430
1432
|
i.push({
|
|
1431
1433
|
...p,
|
|
@@ -1433,186 +1435,186 @@ const Vt = (o) => {
|
|
|
1433
1435
|
dataset: [{ x: new Date(a), y: p.balance }]
|
|
1434
1436
|
});
|
|
1435
1437
|
for (; t.some((p) => p.balance >= 0.01 && !p.is_impossible); ) {
|
|
1436
|
-
let p = !1,
|
|
1437
|
-
for (const [
|
|
1438
|
+
let p = !1, h = !1, u = !1;
|
|
1439
|
+
for (const [x, b] of t.entries()) {
|
|
1438
1440
|
if (b.balance <= 0.01) continue;
|
|
1439
|
-
const
|
|
1440
|
-
let O =
|
|
1441
|
-
!
|
|
1442
|
-
const
|
|
1443
|
-
if (
|
|
1444
|
-
b.is_impossible = !0, i[
|
|
1441
|
+
const I = i[x].dataset, k = (b.interest_rate ?? 0) / 100 / 12, v = b.balance * k, S = b.monthly_payment ?? 0;
|
|
1442
|
+
let O = S, y = 0;
|
|
1443
|
+
!u && n > 0 && (O += n, u = !0), !h && d > 0 && (y = d, h = !0), b.balance += v;
|
|
1444
|
+
const m = Math.min(b.balance, O + y);
|
|
1445
|
+
if (m <= v) {
|
|
1446
|
+
b.is_impossible = !0, i[x].is_impossible = !0, i[x].priority = void 0, I.push({ x: new Date(a), y: b.balance });
|
|
1445
1447
|
continue;
|
|
1446
1448
|
}
|
|
1447
|
-
b.balance -=
|
|
1449
|
+
b.balance -= m, b.balance = b.balance < 0.01 ? 0 : b.balance, I.push({
|
|
1448
1450
|
x: new Date(a),
|
|
1449
1451
|
y: Math.max(0, b.balance),
|
|
1450
|
-
payment:
|
|
1452
|
+
payment: m,
|
|
1451
1453
|
extra: y
|
|
1452
|
-
}), b.balance <= 0 && (
|
|
1454
|
+
}), b.balance <= 0 && (d += S, i[x].projected_payoff_date = new Date(a)), m > 0 && (p = !0);
|
|
1453
1455
|
}
|
|
1454
1456
|
p && a.setMonth(a.getMonth() + 1);
|
|
1455
1457
|
}
|
|
1456
1458
|
return i.forEach((p) => {
|
|
1457
1459
|
(p.interest_rate === void 0 || p.monthly_payment === void 0) && (p.projected_payoff_date = void 0);
|
|
1458
1460
|
}), i.forEach((p) => {
|
|
1459
|
-
p.priority = !p.is_paid_off && !p.is_impossible ?
|
|
1461
|
+
p.priority = !p.is_paid_off && !p.is_impossible ? c++ : void 0;
|
|
1460
1462
|
}), i;
|
|
1461
|
-
},
|
|
1462
|
-
description:
|
|
1463
|
-
header:
|
|
1464
|
-
onClickHandler:
|
|
1465
|
-
primaryButton:
|
|
1466
|
-
}),
|
|
1467
|
-
const { debts:
|
|
1468
|
-
return /* @__PURE__ */ e(
|
|
1469
|
-
|
|
1463
|
+
}, tr = (r, o, n) => ({
|
|
1464
|
+
description: o ? r.empty_state_description : r.empty_state_description_no_aggregation,
|
|
1465
|
+
header: o ? r.empty_state_header : r.empty_state_header_no_aggregation,
|
|
1466
|
+
onClickHandler: o ? n : void 0,
|
|
1467
|
+
primaryButton: o ? r.connect_accounts : void 0
|
|
1468
|
+
}), rr = D(({ disabled: r, onClick: o }) => {
|
|
1469
|
+
const { debts: n } = C(), { totalMonthlyPayments: t } = ee(), { monthlyCashFlowProfile: a } = V(), i = t + Number(a?.extra_payment), d = n.paydown_button_long;
|
|
1470
|
+
return /* @__PURE__ */ e(f, { alignItems: "center", sx: { flex: 1, flexShrink: 0 }, children: /* @__PURE__ */ e(
|
|
1471
|
+
Te,
|
|
1470
1472
|
{
|
|
1471
1473
|
"aria-controls": "extra-paydown",
|
|
1472
1474
|
"aria-describedby": "extra-paydown",
|
|
1473
1475
|
"aria-haspopup": !0,
|
|
1474
1476
|
"aria-label": "extra-paydown",
|
|
1475
|
-
disabled:
|
|
1476
|
-
onClick:
|
|
1477
|
-
sx: { justifyContent: "start"
|
|
1478
|
-
children: E(d,
|
|
1477
|
+
disabled: r,
|
|
1478
|
+
onClick: o,
|
|
1479
|
+
sx: { justifyContent: "start" },
|
|
1480
|
+
children: E(d, P(i, "0,0"))
|
|
1479
1481
|
}
|
|
1480
|
-
);
|
|
1481
|
-
}),
|
|
1482
|
-
const { isDesktop:
|
|
1483
|
-
config: { show_connections_widget_in_master:
|
|
1484
|
-
} =
|
|
1485
|
-
isAccountDataLoaded:
|
|
1482
|
+
) });
|
|
1483
|
+
}), nr = ({ onBackClick: r, onMenuClick: o, sx: n }) => {
|
|
1484
|
+
const { isDesktop: t, isMobile: a } = ae(), { connect: i, debts: d } = C(), { onEvent: c } = B(), {
|
|
1485
|
+
config: { show_connections_widget_in_master: p }
|
|
1486
|
+
} = Ye(), { isInitialized: h } = Ve(), { setSelectedAccount: u } = Ue(), { selectedDebtPriority: x, setSelectedDebtChartData: b } = L(), {
|
|
1487
|
+
isAccountDataLoaded: I,
|
|
1486
1488
|
loadAccountData: M,
|
|
1487
1489
|
detailedAccounts: k,
|
|
1488
|
-
visibleDebtAccounts:
|
|
1489
|
-
} =
|
|
1490
|
-
|
|
1490
|
+
visibleDebtAccounts: v
|
|
1491
|
+
} = te(), { isAllGoalDataLoaded: S, loadGoalData: O, monthlyCashFlowProfile: y } = V(), { debts: m } = ee(), [w, T] = g.useState(!1), [R, F] = g.useState(!1), [K, ce] = g.useState(!1), [U, Ie] = g.useState(""), [Me, de] = g.useState(!1);
|
|
1492
|
+
ht({
|
|
1491
1493
|
widgetName: "DebtsWidget",
|
|
1492
|
-
isLoaded:
|
|
1494
|
+
isLoaded: S
|
|
1493
1495
|
});
|
|
1494
|
-
const
|
|
1495
|
-
const H =
|
|
1496
|
-
return
|
|
1497
|
-
}, [
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
}, []),
|
|
1501
|
-
|
|
1502
|
-
}, [
|
|
1503
|
-
const
|
|
1504
|
-
const H =
|
|
1505
|
-
H &&
|
|
1506
|
-
},
|
|
1507
|
-
|
|
1508
|
-
},
|
|
1509
|
-
|
|
1496
|
+
const q = g.useMemo(() => {
|
|
1497
|
+
const H = y?.extra_payment ?? 0;
|
|
1498
|
+
return er(m, x, H);
|
|
1499
|
+
}, [m, x, y]);
|
|
1500
|
+
g.useEffect(() => {
|
|
1501
|
+
I || M().finally(), c(A.DEBTS_VIEW);
|
|
1502
|
+
}, []), g.useEffect(() => {
|
|
1503
|
+
h && O().finally();
|
|
1504
|
+
}, [h]);
|
|
1505
|
+
const pe = (H) => Ie(H), he = () => {
|
|
1506
|
+
const H = v.find((ne) => ne.guid === U), me = q.find((ne) => ne.guid === U);
|
|
1507
|
+
H && u(H), me && b(me), T(!0);
|
|
1508
|
+
}, ke = () => c(A.DEBTS_CLICK_FILTER), Ne = () => {
|
|
1509
|
+
ce(!0), c(A.DEBTS_CLICK_SNOWBALL_CTA);
|
|
1510
|
+
}, Pe = () => {
|
|
1511
|
+
F(!0), c(A.DEBTS_CLICK_PAYDOWN);
|
|
1510
1512
|
};
|
|
1511
|
-
if (!
|
|
1512
|
-
return /* @__PURE__ */ e(
|
|
1513
|
-
const
|
|
1514
|
-
i,
|
|
1513
|
+
if (!h || !S)
|
|
1514
|
+
return /* @__PURE__ */ e(mt, {});
|
|
1515
|
+
const Re = k.length === 0, Be = v.length === 0, Fe = m.length === 0, X = Re || Be || Fe, Z = tr(
|
|
1515
1516
|
d,
|
|
1516
|
-
|
|
1517
|
+
p,
|
|
1518
|
+
() => de(!0)
|
|
1517
1519
|
);
|
|
1518
1520
|
return /* @__PURE__ */ s(
|
|
1519
|
-
|
|
1521
|
+
ut,
|
|
1520
1522
|
{
|
|
1521
|
-
actions: [
|
|
1522
|
-
/* @__PURE__ */ e(Jt, { disabled: Z }, "prioritize-debts"),
|
|
1523
|
-
/* @__PURE__ */ e(tr, { disabled: Z, onClick: Ne }, "extra-paydown")
|
|
1524
|
-
],
|
|
1523
|
+
actions: [/* @__PURE__ */ e(Qt, { disabled: X }, "prioritize-debts")],
|
|
1525
1524
|
allowedAccountTypes: [
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1525
|
+
z.CREDIT_CARD,
|
|
1526
|
+
z.LOAN,
|
|
1527
|
+
z.MORTGAGE,
|
|
1528
|
+
z.LINE_OF_CREDIT,
|
|
1529
|
+
z.CHECKING_LINE_OF_CREDIT
|
|
1531
1530
|
],
|
|
1532
|
-
|
|
1533
|
-
|
|
1531
|
+
hasDivider: !0,
|
|
1532
|
+
onAccountsFilterClick: ke,
|
|
1533
|
+
onBackClick: r,
|
|
1534
|
+
onMenuClick: o,
|
|
1535
|
+
slotComponent: /* @__PURE__ */ e(rr, { disabled: X, onClick: Pe }, "extra-paydown"),
|
|
1534
1536
|
sx: n,
|
|
1535
|
-
title:
|
|
1537
|
+
title: d.title,
|
|
1536
1538
|
children: [
|
|
1537
|
-
/* @__PURE__ */ s(
|
|
1538
|
-
|
|
1539
|
-
|
|
1539
|
+
/* @__PURE__ */ s(f, { sx: { pt: 48, px: t ? "48px" : "24px" }, children: [
|
|
1540
|
+
X && /* @__PURE__ */ e(
|
|
1541
|
+
bt,
|
|
1540
1542
|
{
|
|
1541
|
-
header:
|
|
1543
|
+
header: Z.header,
|
|
1542
1544
|
icon: "note_stack",
|
|
1543
|
-
onClick:
|
|
1544
|
-
primaryButton:
|
|
1545
|
-
subText:
|
|
1545
|
+
onClick: Z.onClickHandler,
|
|
1546
|
+
primaryButton: Z.primaryButton,
|
|
1547
|
+
subText: Z.description,
|
|
1546
1548
|
sx: { maxWidth: 400 }
|
|
1547
1549
|
}
|
|
1548
1550
|
),
|
|
1549
|
-
!
|
|
1551
|
+
!X && /* @__PURE__ */ s($, { children: [
|
|
1550
1552
|
/* @__PURE__ */ s(
|
|
1551
|
-
|
|
1553
|
+
f,
|
|
1552
1554
|
{
|
|
1553
1555
|
sx: {
|
|
1554
|
-
alignItems:
|
|
1555
|
-
flexDirection:
|
|
1556
|
-
mx:
|
|
1556
|
+
alignItems: a ? "flex-start" : "flex-end",
|
|
1557
|
+
flexDirection: a ? "column" : "row",
|
|
1558
|
+
mx: a ? "-12px" : 0
|
|
1557
1559
|
},
|
|
1558
1560
|
children: [
|
|
1559
1561
|
/* @__PURE__ */ e(
|
|
1560
|
-
|
|
1562
|
+
Ee,
|
|
1561
1563
|
{
|
|
1562
|
-
debts:
|
|
1563
|
-
height:
|
|
1564
|
-
hoveredDebtGuid:
|
|
1565
|
-
onClickArea:
|
|
1566
|
-
onHoverArea:
|
|
1567
|
-
sx: { mr:
|
|
1564
|
+
debts: q,
|
|
1565
|
+
height: a ? 250 : void 0,
|
|
1566
|
+
hoveredDebtGuid: U,
|
|
1567
|
+
onClickArea: he,
|
|
1568
|
+
onHoverArea: pe,
|
|
1569
|
+
sx: { mr: a ? "4px" : "-48px" }
|
|
1568
1570
|
}
|
|
1569
1571
|
),
|
|
1570
1572
|
/* @__PURE__ */ e(
|
|
1571
|
-
|
|
1573
|
+
Ct,
|
|
1572
1574
|
{
|
|
1573
|
-
debts:
|
|
1574
|
-
onClickCta:
|
|
1575
|
-
sx: { mb:
|
|
1575
|
+
debts: q,
|
|
1576
|
+
onClickCta: Ne,
|
|
1577
|
+
sx: { mb: a ? "0px" : "64px" }
|
|
1576
1578
|
}
|
|
1577
1579
|
)
|
|
1578
1580
|
]
|
|
1579
1581
|
}
|
|
1580
1582
|
),
|
|
1581
|
-
/* @__PURE__ */ e(
|
|
1582
|
-
|
|
1583
|
+
/* @__PURE__ */ e(f, { sx: { mx: a ? "-24px" : 0 }, children: /* @__PURE__ */ e(
|
|
1584
|
+
Xt,
|
|
1583
1585
|
{
|
|
1584
|
-
debts:
|
|
1585
|
-
hoveredDebtGuid:
|
|
1586
|
-
onClickRow:
|
|
1587
|
-
onHoverRow:
|
|
1586
|
+
debts: q,
|
|
1587
|
+
hoveredDebtGuid: U,
|
|
1588
|
+
onClickRow: he,
|
|
1589
|
+
onHoverRow: pe
|
|
1588
1590
|
}
|
|
1589
1591
|
) })
|
|
1590
1592
|
] })
|
|
1591
1593
|
] }),
|
|
1592
1594
|
/* @__PURE__ */ e(
|
|
1593
|
-
|
|
1595
|
+
Dt,
|
|
1594
1596
|
{
|
|
1595
|
-
isOpen:
|
|
1596
|
-
onClose: () =>
|
|
1597
|
+
isOpen: K,
|
|
1598
|
+
onClose: () => ce(!1)
|
|
1597
1599
|
}
|
|
1598
1600
|
),
|
|
1599
|
-
/* @__PURE__ */ e(
|
|
1600
|
-
/* @__PURE__ */ e(
|
|
1601
|
+
/* @__PURE__ */ e(Ht, { isOpen: w, onClose: () => T(!1) }),
|
|
1602
|
+
/* @__PURE__ */ e(zt, { isOpen: R, onClose: () => F(!1) }),
|
|
1601
1603
|
/* @__PURE__ */ e(
|
|
1602
|
-
|
|
1604
|
+
pt,
|
|
1603
1605
|
{
|
|
1604
|
-
onClose: () =>
|
|
1605
|
-
showConnectWidget:
|
|
1606
|
-
title:
|
|
1606
|
+
onClose: () => de(!1),
|
|
1607
|
+
showConnectWidget: Me,
|
|
1608
|
+
title: i.mini_title
|
|
1607
1609
|
}
|
|
1608
1610
|
)
|
|
1609
1611
|
]
|
|
1610
1612
|
}
|
|
1611
1613
|
);
|
|
1612
|
-
},
|
|
1614
|
+
}, en = D(nr);
|
|
1613
1615
|
export {
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1616
|
+
Ee as DebtsChart,
|
|
1617
|
+
nn as DebtsStore,
|
|
1618
|
+
Xt as DebtsTable,
|
|
1619
|
+
en as DebtsWidget
|
|
1618
1620
|
};
|