@mx-cartographer/experiences 7.0.11 → 7.0.12
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
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { jsxs as g, jsx as _ } from "react/jsx-runtime";
|
|
2
2
|
import u from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { AccountBalance as w, ChevronRight as
|
|
3
|
+
import T from "@mui/material/Button";
|
|
4
|
+
import I from "@mui/material/Card";
|
|
5
|
+
import N from "@mui/material/CardContent";
|
|
6
|
+
import O from "@mui/material/CardHeader";
|
|
7
|
+
import S from "@mui/material/Stack";
|
|
8
|
+
import { AccountBalance as w, ChevronRight as L } from "@mxenabled/mx-icons";
|
|
9
9
|
import { Text as A } from "@mxenabled/mxui";
|
|
10
|
-
import { h as
|
|
11
|
-
import { m as
|
|
12
|
-
import { makeAutoObservable as
|
|
13
|
-
import { F as
|
|
14
|
-
import { fromUnixTime as
|
|
15
|
-
import { addYears as
|
|
16
|
-
import { getUnixTime as
|
|
17
|
-
import { b as
|
|
18
|
-
import { a as
|
|
19
|
-
import { f as
|
|
10
|
+
import { h as b } from "./ConnectDrawer-BA9H_xx8.mjs";
|
|
11
|
+
import { m as y } from "./hooks-DkUqN6JE.mjs";
|
|
12
|
+
import { makeAutoObservable as D, runInAction as c } from "mobx";
|
|
13
|
+
import { F as v, A as i } from "./Fetch-CkFKy79O.mjs";
|
|
14
|
+
import { fromUnixTime as G } from "date-fns/fromUnixTime";
|
|
15
|
+
import { addYears as x } from "date-fns/addYears";
|
|
16
|
+
import { getUnixTime as K } from "date-fns/getUnixTime";
|
|
17
|
+
import { b as E } from "./Localization-2MODESHW.mjs";
|
|
18
|
+
import { a as F } from "./NumberFormatting-CtWHhyBX.mjs";
|
|
19
|
+
import { f as B, D as U } from "./Dialog-CWW597AF.mjs";
|
|
20
20
|
const at = ({ description: e, label: t, title: o }) => {
|
|
21
|
-
const { config: r } =
|
|
21
|
+
const { config: r } = y(), [n, s] = u.useState(!1);
|
|
22
22
|
if (r.show_connections_widget_in_master)
|
|
23
23
|
return /* @__PURE__ */ g(u.Fragment, { children: [
|
|
24
|
-
/* @__PURE__ */ g(
|
|
24
|
+
/* @__PURE__ */ g(I, { sx: { m: 24 }, children: [
|
|
25
25
|
/* @__PURE__ */ _(
|
|
26
|
-
|
|
26
|
+
O,
|
|
27
27
|
{
|
|
28
28
|
avatar: /* @__PURE__ */ _(w, {}),
|
|
29
29
|
sx: { ".MuiCardHeader-avatar": { mr: 8 } },
|
|
30
30
|
title: /* @__PURE__ */ _(A, { bold: !0, variant: "Body", children: o })
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
|
-
/* @__PURE__ */ _(
|
|
33
|
+
/* @__PURE__ */ _(N, { sx: { ":last-child": { pb: 4 }, ml: 28, py: 0 }, children: /* @__PURE__ */ g(S, { alignItems: "flex-start", spacing: 2, children: [
|
|
34
34
|
/* @__PURE__ */ _(A, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: e }),
|
|
35
35
|
/* @__PURE__ */ _(
|
|
36
|
-
|
|
36
|
+
T,
|
|
37
37
|
{
|
|
38
|
-
endIcon: /* @__PURE__ */ _(
|
|
38
|
+
endIcon: /* @__PURE__ */ _(L, {}),
|
|
39
39
|
onClick: () => s(!0),
|
|
40
40
|
sx: {
|
|
41
41
|
pl: 0,
|
|
@@ -50,7 +50,7 @@ const at = ({ description: e, label: t, title: o }) => {
|
|
|
50
50
|
] }) })
|
|
51
51
|
] }),
|
|
52
52
|
/* @__PURE__ */ _(
|
|
53
|
-
|
|
53
|
+
b,
|
|
54
54
|
{
|
|
55
55
|
onClose: () => s(!1),
|
|
56
56
|
showConnectWidget: n,
|
|
@@ -59,11 +59,11 @@ const at = ({ description: e, label: t, title: o }) => {
|
|
|
59
59
|
)
|
|
60
60
|
] });
|
|
61
61
|
};
|
|
62
|
-
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 || {}),
|
|
62
|
+
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 || {});
|
|
63
63
|
class R {
|
|
64
64
|
fetchInstance;
|
|
65
65
|
constructor(t, o) {
|
|
66
|
-
this.fetchInstance = new
|
|
66
|
+
this.fetchInstance = new v(t, o);
|
|
67
67
|
}
|
|
68
68
|
addGoal = async (t) => this.fetchInstance.post(i.GOALS, t).then((o) => o.goal);
|
|
69
69
|
addRetirementGoal = async (t) => this.fetchInstance.post(i.RETIREMENT_GOALS, t).then((o) => o.retirement_goal);
|
|
@@ -91,19 +91,19 @@ function it(e, t) {
|
|
|
91
91
|
style: "percent",
|
|
92
92
|
minimumFractionDigits: 0,
|
|
93
93
|
maximumFractionDigits: 0
|
|
94
|
-
},
|
|
94
|
+
}, d = t.is_complete ? t.completed_at : t.projected_to_complete_at, m = d ? G(d) : /* @__PURE__ */ new Date(), f = E(
|
|
95
95
|
e.goal_percentage,
|
|
96
|
-
|
|
97
|
-
),
|
|
96
|
+
F(r, h)
|
|
97
|
+
), p = E(
|
|
98
98
|
t.is_complete ? e.completed_label : e.goal_projection,
|
|
99
|
-
|
|
99
|
+
B(m, U.MONTH_SHORT_YEAR)
|
|
100
100
|
);
|
|
101
101
|
return {
|
|
102
102
|
backgroundColor: n,
|
|
103
103
|
color: s,
|
|
104
104
|
percentage: r,
|
|
105
|
-
percentageText:
|
|
106
|
-
projectedText:
|
|
105
|
+
percentageText: f,
|
|
106
|
+
projectedText: p
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
function st(e) {
|
|
@@ -162,15 +162,15 @@ function st(e) {
|
|
|
162
162
|
const ct = (e, t) => {
|
|
163
163
|
switch (e) {
|
|
164
164
|
case a.DEBT_TRACK:
|
|
165
|
-
return
|
|
165
|
+
return E(t.zero_state_ongoing, "debt");
|
|
166
166
|
case a.SAVINGS_TRACK:
|
|
167
|
-
return
|
|
167
|
+
return E(t.zero_state_ongoing, "saving");
|
|
168
168
|
default:
|
|
169
|
-
return
|
|
169
|
+
return E(t.zero_state_ongoing, "retirement");
|
|
170
170
|
}
|
|
171
|
-
},
|
|
172
|
-
const o =
|
|
173
|
-
return
|
|
171
|
+
}, C = (e, t) => {
|
|
172
|
+
const o = G(t), r = x(o, e);
|
|
173
|
+
return K(r);
|
|
174
174
|
};
|
|
175
175
|
class lt {
|
|
176
176
|
globalStore;
|
|
@@ -183,7 +183,7 @@ class lt {
|
|
|
183
183
|
monthlyCashFlowProfile = void 0;
|
|
184
184
|
goalsLoaded = !1;
|
|
185
185
|
constructor(t) {
|
|
186
|
-
this.globalStore = t, this.api = new R(t.endpoint, t.sessionToken),
|
|
186
|
+
this.globalStore = t, this.api = new R(t.endpoint, t.sessionToken), D(this);
|
|
187
187
|
}
|
|
188
188
|
get orderedGoals() {
|
|
189
189
|
return this.goals.slice().sort((t, o) => t.position - o.position);
|
|
@@ -223,13 +223,13 @@ class lt {
|
|
|
223
223
|
addRetirementGoal = async (t) => {
|
|
224
224
|
const o = this.globalStore.copyStore.copy.goals;
|
|
225
225
|
try {
|
|
226
|
-
const r = await this.api.addRetirementGoal(t), n = [];
|
|
227
|
-
for (const
|
|
228
|
-
const
|
|
229
|
-
...
|
|
226
|
+
const r = await this.api.addRetirementGoal(t), n = [], s = this.globalStore.userStore.user.birthday;
|
|
227
|
+
for (const h of this.newRetirementGoalAccounts) {
|
|
228
|
+
const d = await this.api.addRetirementGoalAccount({
|
|
229
|
+
...h,
|
|
230
230
|
retirement_goal_guid: r.guid
|
|
231
231
|
});
|
|
232
|
-
n.push(
|
|
232
|
+
n.push(d);
|
|
233
233
|
}
|
|
234
234
|
this.setNewRetirementGoalAccounts([]), c(() => {
|
|
235
235
|
this.goals = [
|
|
@@ -238,7 +238,8 @@ class lt {
|
|
|
238
238
|
...r,
|
|
239
239
|
amount: r.target_amount,
|
|
240
240
|
name: o.retirement,
|
|
241
|
-
track_type: a.RETIREMENT_TRACK
|
|
241
|
+
track_type: a.RETIREMENT_TRACK,
|
|
242
|
+
projected_to_complete_at: r.retirement_age && s ? C(r.retirement_age, s) : void 0
|
|
242
243
|
}
|
|
243
244
|
], this.retirementGoalAccounts = [...this.retirementGoalAccounts, ...n];
|
|
244
245
|
});
|
|
@@ -259,18 +260,18 @@ class lt {
|
|
|
259
260
|
loadGoals = async () => {
|
|
260
261
|
const t = this.globalStore.copyStore.copy.goals;
|
|
261
262
|
try {
|
|
262
|
-
const o = await this.api.getGoals(), r = await this.api.getRetirementGoals(), n = await this.api.getRetirementGoalAccounts(), s = await this.api.getMonthlyCashFlowProfile(), h = this.globalStore.userStore.user.birthday,
|
|
263
|
+
const o = await this.api.getGoals(), r = await this.api.getRetirementGoals(), n = await this.api.getRetirementGoalAccounts(), s = await this.api.getMonthlyCashFlowProfile(), h = this.globalStore.userStore.user.birthday, d = [
|
|
263
264
|
...o,
|
|
264
|
-
...r.map((
|
|
265
|
-
...
|
|
266
|
-
amount:
|
|
265
|
+
...r.map((m) => ({
|
|
266
|
+
...m,
|
|
267
|
+
amount: m.target_amount,
|
|
267
268
|
name: t.retirement,
|
|
268
269
|
track_type: a.RETIREMENT_TRACK,
|
|
269
|
-
projected_to_complete_at:
|
|
270
|
+
projected_to_complete_at: m.retirement_age && h ? C(m.retirement_age, h) : void 0
|
|
270
271
|
}))
|
|
271
272
|
];
|
|
272
273
|
c(() => {
|
|
273
|
-
this.goals =
|
|
274
|
+
this.goals = d, this.retirementGoalAccounts = n, this.monthlyCashFlowProfile = s, this.goalsLoaded = !0;
|
|
274
275
|
});
|
|
275
276
|
} catch (o) {
|
|
276
277
|
console.error(`Error occured while getting goals: ${o}`);
|
|
@@ -353,7 +354,7 @@ class lt {
|
|
|
353
354
|
}
|
|
354
355
|
export {
|
|
355
356
|
at as C,
|
|
356
|
-
|
|
357
|
+
$ as G,
|
|
357
358
|
l as M,
|
|
358
359
|
a as T,
|
|
359
360
|
ct as a,
|
package/dist/common/index.es.js
CHANGED
|
@@ -25,8 +25,8 @@ import { I as ea } from "../IconBacking-B9oC6uL2.mjs";
|
|
|
25
25
|
import { D as aa, F as ra, a as oa, c as na, R as ia, S as ca } from "../RepeatingTransaction-BW4J-jeJ.mjs";
|
|
26
26
|
import { C as nt } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
27
27
|
import { I as la } from "../CashflowStore-D9Dpuz7X.mjs";
|
|
28
|
-
import { d as it } from "../GoalStore-
|
|
29
|
-
import { C as ha, G as ga, M as pa, T as ma } from "../GoalStore-
|
|
28
|
+
import { d as it } from "../GoalStore-DLzTboF9.mjs";
|
|
29
|
+
import { C as ha, G as ga, M as pa, T as ma } from "../GoalStore-DLzTboF9.mjs";
|
|
30
30
|
import { C as ya } from "../CurrencyText-YUhH2caW.mjs";
|
|
31
31
|
import { E as Sa } from "../EmptyState-Dcb-o2tl.mjs";
|
|
32
32
|
import { L as wa } from "../ListItemAction-DNZZ5fSa.mjs";
|
package/dist/goals/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as fe, T as m, a as Oe, M as J, C as ye, b as Le, G as pe } from "../GoalStore-
|
|
2
|
-
import { c as Hn, d as Xn } from "../GoalStore-
|
|
1
|
+
import { g as fe, T as m, a as Oe, M as J, C as ye, b as Le, G as pe } from "../GoalStore-DLzTboF9.mjs";
|
|
2
|
+
import { c as Hn, d as Xn } from "../GoalStore-DLzTboF9.mjs";
|
|
3
3
|
import { jsxs as i, jsx as e, Fragment as U } from "react/jsx-runtime";
|
|
4
4
|
import y from "react";
|
|
5
5
|
import { observer as D } from "mobx-react-lite";
|