@mx-cartographer/experiences 7.1.3 → 7.1.4-ram1-alpha-finstrong-credit-score-graph-check
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 +4 -0
- package/dist/{Account-8IUM_CLv.mjs → Account-CpRTVIHg.mjs} +1 -1
- package/dist/{AccountDetailsContent-CuZSSAEc.mjs → AccountDetailsContent-6aPMU6Hp.mjs} +10 -10
- package/dist/{AccountDetailsHeader-BZBsIKdF.mjs → AccountDetailsHeader-BkUZYoV8.mjs} +8 -8
- package/dist/{AccountFields-BD_0GT68.mjs → AccountFields-DOLjKu5l.mjs} +5 -5
- package/dist/{AccountListItem-CllIBCao.mjs → AccountListItem-CTT5m4qx.mjs} +4 -4
- package/dist/{AccountStore-BL0FE1QL.mjs → AccountStore-DTfpr3h0.mjs} +26 -15
- package/dist/{Accounts-Bvc9TJaO.mjs → Accounts-D0BmvNxn.mjs} +1 -1
- package/dist/{BudgetUtil-psfk-Amb.mjs → BudgetUtil-D2Jcp-E-.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-BmenK5bu.mjs → CategorySelectorDrawer-DomNyubP.mjs} +3 -3
- package/dist/{CategoryStore-BCcpI3oJ.mjs → CategoryStore-C1IfDPCE.mjs} +1 -1
- package/dist/{CategoryUtil-BR3H5i6n.mjs → CategoryUtil-DUM8NuGO.mjs} +1 -1
- package/dist/{ConnectDrawer-CPTXh70j.mjs → ConnectDrawer--gJHyp-S.mjs} +2 -2
- package/dist/{ConnectionsDrawer-Dkb4vBmt.mjs → ConnectionsDrawer-DabiwV9L.mjs} +3 -3
- package/dist/{CurrencyInput-C4xNRL2W.mjs → CurrencyInput-CC5cwVit.mjs} +1 -1
- package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
- package/dist/{DebtsStore-D4grpB4m.mjs → DebtsStore-9aR2sTJQ.mjs} +1 -1
- package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
- package/dist/Drawer-BEtCk82g.mjs +163 -0
- package/dist/{ExportCsvAction-CBJAfyAw.mjs → ExportCsvAction-Um-CDa4C.mjs} +3 -3
- package/dist/FinstrongStore-CC4SrBjA.mjs +436 -0
- package/dist/{GoalStore-B5MZzPLZ.mjs → GoalStore-CiBKZvTg.mjs} +3 -3
- package/dist/{Help-CzBAsKA2.mjs → Help-BZ8pIkkR.mjs} +2 -2
- package/dist/LineChart-CE3oLBQ0.mjs +566 -0
- package/dist/{ListItemAction-DSrYDGAP.mjs → ListItemAction-DGaxy7oz.mjs} +10 -10
- package/dist/{ManageIncome-DUuT-yMV.mjs → ManageIncome-BaNgfwr5.mjs} +34 -32
- package/dist/{MicroWidgetContainer-C4QQHfD7.mjs → MicroWidgetContainer-C3iV1FBR.mjs} +1 -1
- package/dist/{MiniWidgetContainer-DTQdRK-3.mjs → MiniWidgetContainer-LtXXgZ6H.mjs} +1 -1
- package/dist/{NetWorthStore-Do1Gk8Te.mjs → NetWorthStore-MnpP5KEc.mjs} +2 -2
- package/dist/{NotificationSettings-BuShgjn6.mjs → NotificationSettings-Ckx8tgQj.mjs} +5 -5
- package/dist/{OriginalBalanceAction-BsxcvNEF.mjs → OriginalBalanceAction-CGZDUsCc.mjs} +3 -3
- package/dist/{RecurringSettings-BVOt46uV.mjs → RecurringSettings-DE4T4yQy.mjs} +4 -4
- package/dist/{RecurringTransactions-ej39mgA6.mjs → RecurringTransactions-CngsRZ3K.mjs} +45 -44
- package/dist/{RecurringTransactionsStore-DrzS1LmF.mjs → RecurringTransactionsStore-C4RVULF8.mjs} +1 -1
- package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-BuJ03S9d.mjs} +16 -16
- package/dist/SpendingLegend-D24CEkL3.mjs +170 -0
- package/dist/{TransactionDetails-_cXLXTd3.mjs → TransactionDetails-DRlrltGq.mjs} +11 -8
- package/dist/{TransactionStore-B-Tq_YFE.mjs → TransactionStore-D8MKYDMb.mjs} +3 -3
- package/dist/{TrendsStore-ZZ8X36lJ.mjs → TrendsStore-DL3Vuh71.mjs} +14 -14
- package/dist/{User-DaJAQ09j.mjs → User-BthIKO4w.mjs} +2 -2
- package/dist/{WidgetContainer-DtPnPQZY.mjs → WidgetContainer-DJA1bxLn.mjs} +4 -4
- package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
- package/dist/accounts/index.es.js +14 -14
- package/dist/accounts/stores/AccountStore.d.ts +2 -0
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +12 -12
- package/dist/cashflow/index.es.js +287 -295
- package/dist/categories/index.es.js +2 -2
- package/dist/common/components/Select.d.ts +4 -2
- package/dist/common/components/charts/LineChart.d.ts +2 -0
- package/dist/common/components/charts/linechart/CustomMark.d.ts +2 -0
- package/dist/common/components/drawer/Drawer.d.ts +3 -0
- package/dist/common/components/drawer/Footer.d.ts +17 -0
- package/dist/common/index.es.js +33 -33
- package/dist/common/types/Finstrong.d.ts +50 -0
- package/dist/common/types/index.d.ts +1 -1
- package/dist/common/types/localization/FinstrongCopy.d.ts +57 -1
- package/dist/dashboard/index.es.js +2 -2
- package/dist/debts/index.es.js +11 -11
- package/dist/{exportTransactionsToCSV-D8TTNrrE.mjs → exportTransactionsToCSV-XqdHNe2V.mjs} +2 -2
- package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
- package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +2 -1
- package/dist/finstrong/components/CreditOverTimeGraph.d.ts +1 -0
- package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
- package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
- package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
- package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
- package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +1 -1
- package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
- package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
- package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
- package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
- package/dist/finstrong/components/ProgressBar.d.ts +15 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
- package/dist/finstrong/components/StatusChip.d.ts +5 -0
- package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
- package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +11 -0
- package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
- package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
- package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
- package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
- package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
- package/dist/finstrong/components/shared/TransactionList.d.ts +15 -0
- package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
- package/dist/finstrong/constants/index.d.ts +8 -0
- package/dist/finstrong/index.es.js +2899 -1017
- package/dist/finstrong/stores/FinstrongStore.d.ts +9 -1
- package/dist/finstrong/util/finstrongUtils.d.ts +65 -1
- package/dist/goals/index.es.js +14 -14
- package/dist/help/index.es.js +3 -3
- package/dist/{hooks-CE2TKk4a.mjs → hooks-CBST3rkm.mjs} +3 -3
- package/dist/investments/index.es.js +4 -4
- package/dist/merchants/index.es.js +1 -1
- package/dist/networth/index.es.js +34 -34
- package/dist/notifications/index.es.js +4 -4
- package/dist/recurringtransactions/index.es.js +13 -13
- package/dist/settings/index.es.js +8 -8
- package/dist/spending/index.es.js +222 -373
- package/dist/transactions/index.es.js +15 -15
- package/dist/trends/index.es.js +15 -15
- package/dist/{useAccountDisplayName-BXGkZN5B.mjs → useAccountDisplayName-DH1CuQ9R.mjs} +2 -2
- package/dist/{useInsightsEnabled-DSnpkUq0.mjs → useInsightsEnabled-jdvS1ppf.mjs} +1 -1
- package/package.json +1 -1
- package/dist/Drawer-kEE73B87.mjs +0 -113
- package/dist/FinstrongStore-F2c607dj.mjs +0 -101
- package/dist/LineChart-B35qvXik.mjs +0 -541
- package/dist/finstrong/utils/Finstrong.d.ts +0 -6
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import { makeAutoObservable as b, runInAction as l } from "mobx";
|
|
2
|
+
import { format as y } from "date-fns/format";
|
|
3
|
+
import { fromUnixTime as D } from "date-fns/fromUnixTime";
|
|
4
|
+
import { getUnixTime as I } from "date-fns/getUnixTime";
|
|
5
|
+
import { subMonths as x } from "date-fns/subMonths";
|
|
6
|
+
import { F as H, A as h } from "./Fetch-87LIQbEA.mjs";
|
|
7
|
+
import { jsx as i, jsxs as T } from "react/jsx-runtime";
|
|
8
|
+
import { addDays as v } from "date-fns/addDays";
|
|
9
|
+
import { addMonths as M } from "date-fns/addMonths";
|
|
10
|
+
import { addYears as G } from "date-fns/addYears";
|
|
11
|
+
import { differenceInDays as L } from "date-fns/differenceInDays";
|
|
12
|
+
import { differenceInMonths as w } from "date-fns/differenceInMonths";
|
|
13
|
+
import { differenceInWeeks as A } from "date-fns/differenceInWeeks";
|
|
14
|
+
import { startOfToday as N } from "date-fns/startOfToday";
|
|
15
|
+
import { ChevronRight as P, Check as k } from "@mxenabled/mx-icons";
|
|
16
|
+
import $ from "react";
|
|
17
|
+
import B from "@mui/material/Avatar";
|
|
18
|
+
import Y from "@mui/material/Box";
|
|
19
|
+
import K from "@mui/material/Divider";
|
|
20
|
+
import U from "@mui/material/List";
|
|
21
|
+
import X from "@mui/material/ListItem";
|
|
22
|
+
import V from "@mui/material/ListItemAvatar";
|
|
23
|
+
import j from "@mui/material/ListItemButton";
|
|
24
|
+
import z from "@mui/material/ListItemText";
|
|
25
|
+
import { Text as F } from "@mxenabled/mxui";
|
|
26
|
+
import { f as O, a as C } from "./Dialog-BPTr3qHE.mjs";
|
|
27
|
+
import { b as W } from "./Localization-2MODESHW.mjs";
|
|
28
|
+
const m = {
|
|
29
|
+
creditScore: {
|
|
30
|
+
poor: 600,
|
|
31
|
+
good: 720
|
|
32
|
+
},
|
|
33
|
+
daysOfCashOnHand: {
|
|
34
|
+
poor: 30,
|
|
35
|
+
good: 90
|
|
36
|
+
},
|
|
37
|
+
debtToIncomeRatio: {
|
|
38
|
+
poor: 40,
|
|
39
|
+
good: 30
|
|
40
|
+
},
|
|
41
|
+
emergencySavings: {
|
|
42
|
+
poor: 750,
|
|
43
|
+
good: 1e3
|
|
44
|
+
},
|
|
45
|
+
spendToIncomeRatio: {
|
|
46
|
+
poor: 110,
|
|
47
|
+
good: 100
|
|
48
|
+
}
|
|
49
|
+
}, S = {
|
|
50
|
+
GOOD: "Good",
|
|
51
|
+
FAIR: "Fair",
|
|
52
|
+
OFF_TRACK: "Off Track",
|
|
53
|
+
MISSING: "Missing"
|
|
54
|
+
};
|
|
55
|
+
var _ = /* @__PURE__ */ ((e) => (e.Connections = "connections", e.CreditScore = "credit_score", e.DateOfBirth = "date_of_birth", e.MonthlyIncome = "monthly_income", e))(_ || {});
|
|
56
|
+
const q = ({ list: e, onClickItem: t }) => /* @__PURE__ */ i(Y, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ i(
|
|
57
|
+
U,
|
|
58
|
+
{
|
|
59
|
+
sx: {
|
|
60
|
+
"& .MuiListItemSecondaryAction-root": {
|
|
61
|
+
color: "text.primary",
|
|
62
|
+
pr: 24
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
children: e.map((r, n) => /* @__PURE__ */ T($.Fragment, { children: [
|
|
66
|
+
/* @__PURE__ */ i(X, { secondaryAction: /* @__PURE__ */ i(P, {}), children: /* @__PURE__ */ T(j, { onClick: () => t(r.key), children: [
|
|
67
|
+
/* @__PURE__ */ i(V, { children: /* @__PURE__ */ i(
|
|
68
|
+
B,
|
|
69
|
+
{
|
|
70
|
+
sx: {
|
|
71
|
+
bgcolor: "primary.main",
|
|
72
|
+
...!r.isComplete && {
|
|
73
|
+
bgcolor: "transparent",
|
|
74
|
+
borderColor: "action.active",
|
|
75
|
+
borderStyle: "solid",
|
|
76
|
+
borderWidth: 1,
|
|
77
|
+
color: "action.active"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
children: r.icon
|
|
81
|
+
}
|
|
82
|
+
) }),
|
|
83
|
+
/* @__PURE__ */ i(
|
|
84
|
+
z,
|
|
85
|
+
{
|
|
86
|
+
primary: /* @__PURE__ */ i(F, { sx: { color: "text.secondary" }, variant: "caption", children: r.primaryText }),
|
|
87
|
+
secondary: /* @__PURE__ */ i(F, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: r.secondaryText })
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }) }),
|
|
91
|
+
n < e.length - 1 && /* @__PURE__ */ i(K, { sx: { color: "divider", ml: 68 } })
|
|
92
|
+
] }, r.key))
|
|
93
|
+
}
|
|
94
|
+
) }), vt = q, Mt = (e) => e * (180 / Math.PI), Gt = (e, t) => [
|
|
95
|
+
{
|
|
96
|
+
description: t.vulnerable_description,
|
|
97
|
+
max: 25,
|
|
98
|
+
scoreContent: t.accordion_details_text.vulnerable,
|
|
99
|
+
status: t.vulnerable
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
description: t.building_description,
|
|
103
|
+
max: 50,
|
|
104
|
+
scoreContent: t.accordion_details_text.building,
|
|
105
|
+
status: t.building
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
description: t.stable_description,
|
|
109
|
+
max: 75,
|
|
110
|
+
scoreContent: t.accordion_details_text.stable,
|
|
111
|
+
status: t.stable
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
description: t.strong_description,
|
|
115
|
+
max: 100,
|
|
116
|
+
scoreContent: t.accordion_details_text.strong,
|
|
117
|
+
status: t.strong
|
|
118
|
+
}
|
|
119
|
+
].find((a) => e > 0 && e <= a.max) || { status: t.insufficient_data, description: "", scoreContent: "" }, g = {
|
|
120
|
+
POOR: "#8C0E0E",
|
|
121
|
+
FAIR: "#E32727",
|
|
122
|
+
GOOD: "#FFB70D",
|
|
123
|
+
VERY_GOOD: "#0EA26C",
|
|
124
|
+
EXCEPTIONAL: "#005C3D"
|
|
125
|
+
}, u = {
|
|
126
|
+
POOR: "#B21C1C",
|
|
127
|
+
FAIR: "#FF3232",
|
|
128
|
+
GOOD: "#FFC02C",
|
|
129
|
+
VERY_GOOD: "#29C76B",
|
|
130
|
+
EXCEPTIONAL: "#008A5A"
|
|
131
|
+
}, Lt = (e, t, r) => e >= 300 && e < 580 ? {
|
|
132
|
+
status: r.poor,
|
|
133
|
+
color: t ? u.POOR : g.POOR
|
|
134
|
+
} : e >= 580 && e < 670 ? {
|
|
135
|
+
status: r.fair,
|
|
136
|
+
color: t ? u.FAIR : g.FAIR
|
|
137
|
+
} : e >= 670 && e < 740 ? {
|
|
138
|
+
status: r.good,
|
|
139
|
+
color: t ? u.GOOD : g.GOOD
|
|
140
|
+
} : e >= 740 && e < 800 ? {
|
|
141
|
+
status: r.very_good,
|
|
142
|
+
color: t ? u.VERY_GOOD : g.VERY_GOOD
|
|
143
|
+
} : e >= 800 && e <= 850 ? {
|
|
144
|
+
status: r.exceptional,
|
|
145
|
+
color: t ? u.EXCEPTIONAL : g.EXCEPTIONAL
|
|
146
|
+
} : { status: r.missing_data }, wt = (e, t, r, n) => {
|
|
147
|
+
const a = e.reduce((c, d) => c + d.value, 0);
|
|
148
|
+
let s = 0;
|
|
149
|
+
const o = e.map((c) => {
|
|
150
|
+
const d = c.value / a * t, p = r + s, f = p + d;
|
|
151
|
+
return s += d, {
|
|
152
|
+
...c,
|
|
153
|
+
startAngle: p,
|
|
154
|
+
endAngle: f
|
|
155
|
+
};
|
|
156
|
+
});
|
|
157
|
+
return [o[n].startAngle, o[n].endAngle];
|
|
158
|
+
}, Nt = (e, t, r, n, a) => {
|
|
159
|
+
let s = 0, o = 0;
|
|
160
|
+
const c = Math.floor(n), d = n - c;
|
|
161
|
+
return c > r ? (s = e, o = t) : c === r && d > 0 && (s = e, o = a), [s, o];
|
|
162
|
+
}, Pt = (e, t, r = 0) => {
|
|
163
|
+
const n = e * Math.sin(t - r), a = -e * Math.cos(t - r);
|
|
164
|
+
return [n, a];
|
|
165
|
+
}, kt = ({
|
|
166
|
+
dynamicCopy: e,
|
|
167
|
+
fallbackLabel: t,
|
|
168
|
+
icon: r,
|
|
169
|
+
key: n,
|
|
170
|
+
label: a,
|
|
171
|
+
value: s
|
|
172
|
+
}) => {
|
|
173
|
+
const o = !!s, c = o ? J(n, s) : e && W(e, t) || t;
|
|
174
|
+
return {
|
|
175
|
+
icon: o ? /* @__PURE__ */ i(k, {}) : r,
|
|
176
|
+
isComplete: o,
|
|
177
|
+
key: n,
|
|
178
|
+
primaryText: a,
|
|
179
|
+
secondaryText: c
|
|
180
|
+
};
|
|
181
|
+
}, J = (e, t) => ({
|
|
182
|
+
[_.DateOfBirth]: (n) => y(new Date(Number(n) * 1e3), "MMM d, yyyy"),
|
|
183
|
+
[_.MonthlyIncome]: (n) => `$${n}`
|
|
184
|
+
})[e]?.(t) ?? String(t), $t = (e) => e !== null ? Math.round(e * 100) : null, Bt = (e) => {
|
|
185
|
+
const t = new Date((/* @__PURE__ */ new Date()).getFullYear(), e - 1, 1);
|
|
186
|
+
return O(t, C.MONTH_SHORT);
|
|
187
|
+
}, Yt = (e) => {
|
|
188
|
+
const { good: t, poor: r } = m.daysOfCashOnHand;
|
|
189
|
+
return e === null ? "MISSING" : e >= t ? "GOOD" : e >= r ? "FAIR" : "OFF_TRACK";
|
|
190
|
+
}, Kt = (e) => {
|
|
191
|
+
const { good: t, poor: r } = m.emergencySavings;
|
|
192
|
+
return e === null ? "MISSING" : e >= t ? "GOOD" : e >= r ? "FAIR" : "OFF_TRACK";
|
|
193
|
+
}, Ut = (e) => {
|
|
194
|
+
const { good: t, poor: r } = m.spendToIncomeRatio;
|
|
195
|
+
return e === null ? "MISSING" : e < t ? "GOOD" : e < r ? "FAIR" : "OFF_TRACK";
|
|
196
|
+
}, Xt = (e) => {
|
|
197
|
+
const { good: t, poor: r } = m.debtToIncomeRatio;
|
|
198
|
+
return e === null ? "MISSING" : e <= t ? "GOOD" : e <= r ? "FAIR" : "OFF_TRACK";
|
|
199
|
+
}, Vt = (e) => {
|
|
200
|
+
const { good: t, poor: r } = m.creditScore;
|
|
201
|
+
return e === null ? "MISSING" : e >= t ? "GOOD" : e >= r ? "FAIR" : "OFF_TRACK";
|
|
202
|
+
}, Q = (e) => e === null ? "MISSING" : e === 0 ? "GOOD" : "OFF_TRACK", jt = (e, t) => {
|
|
203
|
+
const r = Q(e), n = {
|
|
204
|
+
GOOD: t.count_good_description,
|
|
205
|
+
OFF_TRACK: t.count_off_track_description,
|
|
206
|
+
MISSING: t.count_missing_description
|
|
207
|
+
};
|
|
208
|
+
return {
|
|
209
|
+
cardState: r,
|
|
210
|
+
description: n[r],
|
|
211
|
+
title: t.count_card_title
|
|
212
|
+
};
|
|
213
|
+
}, zt = (e) => ({
|
|
214
|
+
[S.GOOD]: { backgroundColor: "success.lighter", color: "success.dark" },
|
|
215
|
+
[S.FAIR]: { backgroundColor: "warning.lighter", color: "warning.dark" },
|
|
216
|
+
[S.OFF_TRACK]: { backgroundColor: "error.lighter", color: "error.dark" },
|
|
217
|
+
[S.MISSING]: { backgroundColor: "divider", color: "text.secondary" }
|
|
218
|
+
})[e], Z = 1, tt = 1, et = {
|
|
219
|
+
1: M,
|
|
220
|
+
2: G,
|
|
221
|
+
3: v
|
|
222
|
+
}, rt = {
|
|
223
|
+
1: w,
|
|
224
|
+
2: (e, t) => A(e, t) / 2,
|
|
225
|
+
3: A,
|
|
226
|
+
4: L
|
|
227
|
+
}, E = [
|
|
228
|
+
{ contributionPeriodIndex: 3, targetAmount: 6, upperLimit: 500 },
|
|
229
|
+
{ contributionPeriodIndex: 3, targetAmount: 3, upperLimit: 900 },
|
|
230
|
+
{ contributionPeriodIndex: 2, targetAmount: 1, upperLimit: 1e3 }
|
|
231
|
+
], Wt = ({
|
|
232
|
+
contribution: e,
|
|
233
|
+
goalAmount: t,
|
|
234
|
+
goalPeriod: r,
|
|
235
|
+
targetPeriod: n,
|
|
236
|
+
totalSaved: a
|
|
237
|
+
}) => {
|
|
238
|
+
const s = t - a;
|
|
239
|
+
if (s <= 0) return 0;
|
|
240
|
+
const o = N(), c = et[n], d = rt[e];
|
|
241
|
+
if (!c || !d) return s;
|
|
242
|
+
const p = c(o, r), f = d(p, o);
|
|
243
|
+
return Math.max(s / (f || 1), 1);
|
|
244
|
+
}, qt = (e) => !e || e <= 0 ? "0%" : e >= 1e3 ? "100%" : `${Math.round(e / 10)}%`, Jt = (e) => E.find((r) => e < r.upperLimit)?.targetAmount ?? tt, Qt = (e) => E.find((n) => e < n.upperLimit)?.contributionPeriodIndex ?? Z, Zt = (e, t) => e.map((n, a) => {
|
|
245
|
+
const s = new Date(0, n.month - 1, 1), o = O(s, C.MONTH_SHORT);
|
|
246
|
+
return t === "credit_score" ? {
|
|
247
|
+
x: o,
|
|
248
|
+
y: n[t],
|
|
249
|
+
showMark: a === 0
|
|
250
|
+
} : { x: o, y: n[t] };
|
|
251
|
+
}).reverse(), nt = (e) => e?.health_scores.sort((t, r) => t.monthly_health_score_average.month - r.monthly_health_score_average.month).map((t) => ({
|
|
252
|
+
x: O(
|
|
253
|
+
new Date(0, t.monthly_health_score_average.month - 1, 1),
|
|
254
|
+
C.MONTH_SHORT
|
|
255
|
+
),
|
|
256
|
+
y: t.monthly_health_score_average.average_health_score
|
|
257
|
+
})), ot = (e) => e.sort((r, n) => n.transaction.date - r.transaction.date).map(({ transaction: r }) => ({
|
|
258
|
+
...r
|
|
259
|
+
}));
|
|
260
|
+
class R {
|
|
261
|
+
fetchInstance;
|
|
262
|
+
constructor(t, r, n) {
|
|
263
|
+
this.fetchInstance = new H(t, r, void 0, n);
|
|
264
|
+
}
|
|
265
|
+
calculateHealthScore = async () => this.fetchInstance.post(`${h.HEALTH_SCORES}/calculate`).then((t) => t.health_score);
|
|
266
|
+
getAverageHealthScores = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/monthly_averages`).then((t) => t);
|
|
267
|
+
getDebtSpend = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/transactions/debt_spend`).then((t) => t.debt_spend);
|
|
268
|
+
getIncome = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/transactions/income`).then((t) => t.income);
|
|
269
|
+
getMonthlySummaries = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/monthly_summaries`).then((t) => t.monthly_summaries);
|
|
270
|
+
getHealthScoreChangeReports = async (t, r) => this.fetchInstance.get(`${h.HEALTH_SCORES}/change_report/from/${t}/to/${r}`).then((n) => n);
|
|
271
|
+
getPeerScore = async (t) => this.fetchInstance.get(`${h.HEALTH_SCORES}/average/${t}`).then((r) => r.average_health_score);
|
|
272
|
+
getSpendingFeeTransactions = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/transactions/spending_fee`).then((t) => t);
|
|
273
|
+
getStandardSpend = async () => this.fetchInstance.get(`${h.HEALTH_SCORES}/transactions/standard_spend`).then((t) => t);
|
|
274
|
+
}
|
|
275
|
+
class te {
|
|
276
|
+
api = new R("/", "");
|
|
277
|
+
augmentedChartData = [];
|
|
278
|
+
averageHealthScores = [];
|
|
279
|
+
monthlySummaries = [];
|
|
280
|
+
allTransactions = {
|
|
281
|
+
income: [],
|
|
282
|
+
debtSpend: [],
|
|
283
|
+
spendingFee: [],
|
|
284
|
+
spend: []
|
|
285
|
+
};
|
|
286
|
+
globalStore;
|
|
287
|
+
healthScore = {};
|
|
288
|
+
healthScoreChange;
|
|
289
|
+
healthScoreChangeReports = [];
|
|
290
|
+
peerScore = null;
|
|
291
|
+
constructor(t) {
|
|
292
|
+
this.globalStore = t, this.api = new R(t.endpoint, t.sessionToken, t.onError), b(this);
|
|
293
|
+
}
|
|
294
|
+
calculateHealthScore = async () => {
|
|
295
|
+
try {
|
|
296
|
+
const t = await this.api.calculateHealthScore();
|
|
297
|
+
let r = 0;
|
|
298
|
+
await this.loadHealthScoreChangeReports();
|
|
299
|
+
const n = t?.health_score || 0, a = this.healthScoreChangeReports.at(-1)?.older_health_score || 0;
|
|
300
|
+
r = n - a, l(() => {
|
|
301
|
+
this.healthScore = t, this.healthScoreChange = r;
|
|
302
|
+
});
|
|
303
|
+
} catch (t) {
|
|
304
|
+
console.error("Error calculating health score:", t);
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
loadAverageHealthScores = async () => {
|
|
308
|
+
try {
|
|
309
|
+
const t = await this.api.getAverageHealthScores();
|
|
310
|
+
l(() => {
|
|
311
|
+
this.averageHealthScores = t;
|
|
312
|
+
});
|
|
313
|
+
} catch (t) {
|
|
314
|
+
console.error("Error loading average health scores:", t);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
loadMonthlySummaries = async () => {
|
|
318
|
+
try {
|
|
319
|
+
const t = await this.api.getMonthlySummaries();
|
|
320
|
+
l(() => {
|
|
321
|
+
this.monthlySummaries = t;
|
|
322
|
+
});
|
|
323
|
+
} catch (t) {
|
|
324
|
+
console.error("Error loading monthly summaries:", t);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
loadDebtSpend = async () => {
|
|
328
|
+
try {
|
|
329
|
+
const t = await this.api.getDebtSpend();
|
|
330
|
+
l(() => {
|
|
331
|
+
this.allTransactions.debtSpend = t;
|
|
332
|
+
});
|
|
333
|
+
} catch (t) {
|
|
334
|
+
console.error("Error loading debt spend:", t);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
loadIncome = async () => {
|
|
338
|
+
try {
|
|
339
|
+
const t = await this.api.getIncome();
|
|
340
|
+
l(() => {
|
|
341
|
+
this.allTransactions.income = t;
|
|
342
|
+
});
|
|
343
|
+
} catch (t) {
|
|
344
|
+
console.error("Error loading income:", t);
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
loadHealthScoreChangeReports = async () => {
|
|
348
|
+
const t = I(x(/* @__PURE__ */ new Date(), 2)), r = I(/* @__PURE__ */ new Date());
|
|
349
|
+
try {
|
|
350
|
+
const n = await this.api.getHealthScoreChangeReports(
|
|
351
|
+
t,
|
|
352
|
+
r
|
|
353
|
+
);
|
|
354
|
+
l(() => {
|
|
355
|
+
this.healthScoreChangeReports = n;
|
|
356
|
+
});
|
|
357
|
+
} catch (n) {
|
|
358
|
+
console.error("Error loading health score change reports:", n);
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
loadPeerScore = async () => {
|
|
362
|
+
const t = y(D(this.globalStore.appDataStore.user.birthday), "yyyy");
|
|
363
|
+
try {
|
|
364
|
+
const r = await this.api.getPeerScore(t);
|
|
365
|
+
l(() => {
|
|
366
|
+
this.peerScore = r;
|
|
367
|
+
});
|
|
368
|
+
} catch (r) {
|
|
369
|
+
console.error("Error loading peer score:", r);
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
loadAugmentedChartData = async () => {
|
|
373
|
+
try {
|
|
374
|
+
const t = await this.api.getAverageHealthScores();
|
|
375
|
+
l(() => {
|
|
376
|
+
this.augmentedChartData = nt(t);
|
|
377
|
+
});
|
|
378
|
+
} catch (t) {
|
|
379
|
+
console.error(`Error occurred while getting augmented chart data: ${t}`);
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
getSpendingFeeTransactions = async () => {
|
|
383
|
+
try {
|
|
384
|
+
const t = await this.api.getSpendingFeeTransactions(), r = ot(t);
|
|
385
|
+
l(() => {
|
|
386
|
+
this.allTransactions.spendingFee = r;
|
|
387
|
+
});
|
|
388
|
+
} catch (t) {
|
|
389
|
+
console.error(`Error occurred while getting spending fee transactions: ${t}`);
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
loadSpendTransactions = async () => {
|
|
393
|
+
try {
|
|
394
|
+
const t = await this.api.getStandardSpend();
|
|
395
|
+
l(() => {
|
|
396
|
+
this.allTransactions.spend = [...t];
|
|
397
|
+
});
|
|
398
|
+
} catch (t) {
|
|
399
|
+
console.error("Error loading spend transactions:", t);
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
get spendAndDebtTransactions() {
|
|
403
|
+
return [...this.allTransactions.spend, ...this.allTransactions.debtSpend];
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
export {
|
|
407
|
+
_ as A,
|
|
408
|
+
u as C,
|
|
409
|
+
te as F,
|
|
410
|
+
vt as P,
|
|
411
|
+
Nt as a,
|
|
412
|
+
Pt as b,
|
|
413
|
+
Gt as c,
|
|
414
|
+
Lt as d,
|
|
415
|
+
g as e,
|
|
416
|
+
Zt as f,
|
|
417
|
+
wt as g,
|
|
418
|
+
zt as h,
|
|
419
|
+
S as i,
|
|
420
|
+
Vt as j,
|
|
421
|
+
Qt as k,
|
|
422
|
+
Jt as l,
|
|
423
|
+
Wt as m,
|
|
424
|
+
qt as n,
|
|
425
|
+
Kt as o,
|
|
426
|
+
Q as p,
|
|
427
|
+
Yt as q,
|
|
428
|
+
Mt as r,
|
|
429
|
+
$t as s,
|
|
430
|
+
Bt as t,
|
|
431
|
+
jt as u,
|
|
432
|
+
Ut as v,
|
|
433
|
+
Xt as w,
|
|
434
|
+
kt as x,
|
|
435
|
+
R as y
|
|
436
|
+
};
|
|
@@ -7,8 +7,8 @@ import O from "@mui/material/CardHeader";
|
|
|
7
7
|
import S from "@mui/material/Stack";
|
|
8
8
|
import { AccountBalance as w, ChevronRight as L } from "@mxenabled/mx-icons";
|
|
9
9
|
import { Text as A } from "@mxenabled/mxui";
|
|
10
|
-
import { l as b } from "./ConnectDrawer-
|
|
11
|
-
import { a as y } from "./hooks-
|
|
10
|
+
import { l as b } from "./ConnectDrawer--gJHyp-S.mjs";
|
|
11
|
+
import { a as y } from "./hooks-CBST3rkm.mjs";
|
|
12
12
|
import { makeAutoObservable as D, runInAction as c } from "mobx";
|
|
13
13
|
import { F as v, A as i } from "./Fetch-87LIQbEA.mjs";
|
|
14
14
|
import { fromUnixTime as G } from "date-fns/fromUnixTime";
|
|
@@ -16,7 +16,7 @@ import { addYears as x } from "date-fns/addYears";
|
|
|
16
16
|
import { getUnixTime as K } from "date-fns/getUnixTime";
|
|
17
17
|
import { b as E } from "./Localization-2MODESHW.mjs";
|
|
18
18
|
import { a as F } from "./NumberFormatting-Buh7u8Oi.mjs";
|
|
19
|
-
import { f as B,
|
|
19
|
+
import { f as B, a as U } from "./Dialog-BPTr3qHE.mjs";
|
|
20
20
|
var a = /* @__PURE__ */ ((e) => (e[e.DEBT_TRACK = 1] = "DEBT_TRACK", e[e.SAVINGS_TRACK = 2] = "SAVINGS_TRACK", e[e.RETIREMENT_TRACK = 3] = "RETIREMENT_TRACK", e[e.EMERGENCY_FUND_TRACK = 4] = "EMERGENCY_FUND_TRACK", e))(a || {}), $ = /* @__PURE__ */ ((e) => (e[e.SAVE_AMOUNT = 1] = "SAVE_AMOUNT", e[e.KEEP_BALANCE_BELOW = 2] = "KEEP_BALANCE_BELOW", e[e.KEEP_BALANCE_ABOVE = 3] = "KEEP_BALANCE_ABOVE", e[e.ACTION = 4] = "ACTION", e))($ || {}), l = /* @__PURE__ */ ((e) => (e[e.AUTOMOBILE = 1] = "AUTOMOBILE", e[e.COLLEGE = 2] = "COLLEGE", e[e.HOUSE = 3] = "HOUSE", e[e.RECREATIONAL_VEHICLE = 4] = "RECREATIONAL_VEHICLE", e[e.VACATION = 5] = "VACATION", e[e.ELECTRONIC = 6] = "ELECTRONIC", e[e.OTHER = 7] = "OTHER", e[e.RETIREMENT = 8] = "RETIREMENT", e[e.EMERGENCY_FUND = 9] = "EMERGENCY_FUND", e[e.SETUP_BUDGETS = 10] = "SETUP_BUDGETS", e[e.START_MONEY_MANAGEMENT = 11] = "START_MONEY_MANAGEMENT", e[e.CREDIT_CARD = 12] = "CREDIT_CARD", e[e.LINE_OF_CREDIT = 13] = "LINE_OF_CREDIT", e[e.LOANS = 14] = "LOANS", e))(l || {});
|
|
21
21
|
const at = ({ description: e, label: t, title: o }) => {
|
|
22
22
|
const { config: r } = y(), [n, s] = u.useState(!1);
|
|
@@ -13,7 +13,7 @@ import E from "@mui/material/Stack";
|
|
|
13
13
|
import { H3 as y, P as H, Icon as X, Text as T, H2 as _t, InstitutionLogo as bt } from "@mxenabled/mxui";
|
|
14
14
|
import { ExpandMore as ot, ChevronRight as wt } from "@mxenabled/mx-icons";
|
|
15
15
|
import xt from "@mui/material/Breadcrumbs";
|
|
16
|
-
import { u as V, z as tt, d as ft, o as St, b as It, a as Tt } from "./hooks-
|
|
16
|
+
import { u as V, z as tt, d as ft, o as St, b as It, a as Tt } from "./hooks-CBST3rkm.mjs";
|
|
17
17
|
import { useTheme as Z } from "@mui/material/styles";
|
|
18
18
|
import { b as s } from "./Localization-2MODESHW.mjs";
|
|
19
19
|
import { E as Et, a as Ct, P as At } from "./Help-DhcC-C05.mjs";
|
|
@@ -21,7 +21,7 @@ import { observer as rt } from "mobx-react-lite";
|
|
|
21
21
|
import at from "@mui/material/Alert";
|
|
22
22
|
import ct from "@mui/material/Snackbar";
|
|
23
23
|
import lt from "@mui/material/TextField";
|
|
24
|
-
import { D as U } from "./Drawer-
|
|
24
|
+
import { D as U } from "./Drawer-BEtCk82g.mjs";
|
|
25
25
|
import { L as dt } from "./Loader-DUaFpDGv.mjs";
|
|
26
26
|
import Ot from "@mui/material/ListItemAvatar";
|
|
27
27
|
import Nt from "@mui/material/ListItem";
|