@mx-cartographer/experiences 7.7.0-alpha.bb6 → 7.7.0-alpha.bb8
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/dist/{AccountStore-Cztkkt7b.mjs → AccountStore-DY5HniWw.mjs} +48 -54
- package/dist/{CategoryStore-CakDYxwJ.mjs → CategoryStore-BYICdb9m.mjs} +0 -3
- package/dist/accounts/index.es.js +2 -2
- package/dist/accounts/stores/AccountStore.d.ts +0 -1
- package/dist/budgets/index.es.js +242 -242
- package/dist/categories/index.es.js +1 -1
- package/dist/categories/stores/CategoryStore.d.ts +0 -1
- package/dist/common/index.es.js +3 -3
- package/dist/spending/index.es.js +92 -92
- package/dist/trends/index.es.js +301 -295
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { g as m } from "./AccountDisplayName-CO7z3v99.mjs";
|
|
2
|
-
import { A as
|
|
2
|
+
import { A as c, e as _, f as u } from "./Account-Cp4uT2pE.mjs";
|
|
3
3
|
import { makeAutoObservable as g, runInAction as d } from "mobx";
|
|
4
4
|
import { i as f } from "./User-LJpEwPtn.mjs";
|
|
5
5
|
import { A as l } from "./AccountApi-DgZ8ILj1.mjs";
|
|
6
6
|
import { d as y } from "./Accounts-DBJHvSZk.mjs";
|
|
7
|
-
const T = (
|
|
8
|
-
const
|
|
7
|
+
const T = (i, t) => i.reduce((e, s) => (e[s.guid] = t?.includes(s.guid), e), {}), M = (i, t, e) => i.reduce((s, n) => {
|
|
8
|
+
const o = _[n.account_type], r = m(n, {
|
|
9
9
|
allowNickname: e?.appConfig.config?.show_account_nicknames_in_master
|
|
10
10
|
}), a = {
|
|
11
|
-
accountNumber:
|
|
12
|
-
name: `${r} ${
|
|
13
|
-
guid:
|
|
11
|
+
accountNumber: n.account_number,
|
|
12
|
+
name: `${r} ${n.is_closed ? `(${t})` : ""}`,
|
|
13
|
+
guid: n.guid
|
|
14
14
|
};
|
|
15
|
-
return Object.prototype.hasOwnProperty.call(s,
|
|
15
|
+
return Object.prototype.hasOwnProperty.call(s, o) ? s[o] = s[o].concat(a) : s[o] = [a], s;
|
|
16
16
|
}, {});
|
|
17
|
-
function b(
|
|
18
|
-
const { heldAccounts: t, externalAccounts: e } =
|
|
19
|
-
(s,
|
|
17
|
+
function b(i) {
|
|
18
|
+
const { heldAccounts: t, externalAccounts: e } = i.reduce(
|
|
19
|
+
(s, n) => (n.member_is_managed_by_user ? s.externalAccounts.push(n) : s.heldAccounts.push(n), s),
|
|
20
20
|
{ heldAccounts: [], externalAccounts: [] }
|
|
21
21
|
);
|
|
22
22
|
return {
|
|
@@ -24,17 +24,17 @@ function b(o) {
|
|
|
24
24
|
externalAccounts: A(e)
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const { heldAccounts: e, externalAccounts: s } = b(
|
|
29
|
-
return
|
|
27
|
+
function R(i, t) {
|
|
28
|
+
const { heldAccounts: e, externalAccounts: s } = b(i), n = e.slice(0, t);
|
|
29
|
+
return n.length < t && n.push(...s.slice(0, t - n.length)), n;
|
|
30
30
|
}
|
|
31
31
|
const I = {
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
}, h = (
|
|
36
|
-
const s = h(t.account_type),
|
|
37
|
-
if (
|
|
32
|
+
[c.CHECKING]: 1,
|
|
33
|
+
[c.SAVINGS]: 2,
|
|
34
|
+
[c.CREDIT_CARD]: 3
|
|
35
|
+
}, h = (i) => I[i] ?? i + 100, A = (i) => i.sort((t, e) => {
|
|
36
|
+
const s = h(t.account_type), n = h(e.account_type), o = s - n;
|
|
37
|
+
if (o !== 0) return o;
|
|
38
38
|
const r = t.name ?? t.feed_name ?? "", a = e.name ?? e.feed_name ?? "";
|
|
39
39
|
return r.localeCompare(a);
|
|
40
40
|
});
|
|
@@ -49,7 +49,7 @@ class E {
|
|
|
49
49
|
setSelectedAccount = (t) => this.selectedAccount = t;
|
|
50
50
|
setSelectedMember = (t) => this.selectedMember = t;
|
|
51
51
|
}
|
|
52
|
-
class
|
|
52
|
+
class x {
|
|
53
53
|
globalStore;
|
|
54
54
|
api = new l("/", "");
|
|
55
55
|
accounts = [];
|
|
@@ -78,46 +78,46 @@ class R {
|
|
|
78
78
|
get accountsByTypeMap() {
|
|
79
79
|
return this.detailedAccounts.reduce((t, e) => {
|
|
80
80
|
const s = e.account_type;
|
|
81
|
-
let
|
|
82
|
-
return
|
|
81
|
+
let n = t.get(s);
|
|
82
|
+
return n || (n = []), n.push(e), t.set(s, n), t;
|
|
83
83
|
}, /* @__PURE__ */ new Map());
|
|
84
84
|
}
|
|
85
85
|
get cashAccounts() {
|
|
86
86
|
return this.detailedAccounts.filter(
|
|
87
|
-
(t) => t.account_type ===
|
|
87
|
+
(t) => t.account_type === c.CASH || t.account_type === c.CHECKING || t.account_type === c.PREPAID || t.account_type === c.SAVINGS || t.account_type === c.CHECKING_LINE_OF_CREDIT
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
90
|
get cashBalance() {
|
|
91
91
|
return this.cashAccounts.reduce((t, e) => t + (e?.balance || 0), 0);
|
|
92
92
|
}
|
|
93
93
|
get checkingAccounts() {
|
|
94
|
-
return this.detailedAccounts.filter((t) => t.account_type ===
|
|
94
|
+
return this.detailedAccounts.filter((t) => t.account_type === c.CHECKING);
|
|
95
95
|
}
|
|
96
96
|
get debtAccounts() {
|
|
97
97
|
return this.detailedAccounts.filter(
|
|
98
|
-
(t) => t.account_type ===
|
|
98
|
+
(t) => t.account_type === c.CREDIT_CARD || t.account_type === c.LOAN || t.account_type === c.MORTGAGE || t.account_type === c.LINE_OF_CREDIT || t.account_type === c.CHECKING_LINE_OF_CREDIT
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
get finstrongAccounts() {
|
|
102
102
|
const t = /* @__PURE__ */ new Set([
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
c.CHECKING,
|
|
104
|
+
c.SAVINGS,
|
|
105
|
+
c.CREDIT_CARD,
|
|
106
|
+
c.INVESTMENT
|
|
107
107
|
]);
|
|
108
108
|
return this.detailedAccounts.filter((e) => t.has(e.account_type));
|
|
109
109
|
}
|
|
110
110
|
get investmentAccounts() {
|
|
111
111
|
return this.detailedAccounts.filter(
|
|
112
|
-
(t) => t.account_type ===
|
|
112
|
+
(t) => t.account_type === c.INVESTMENT
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
get savingsAccounts() {
|
|
116
|
-
return this.detailedAccounts.filter((t) => t.account_type ===
|
|
116
|
+
return this.detailedAccounts.filter((t) => t.account_type === c.SAVINGS);
|
|
117
117
|
}
|
|
118
118
|
get retirementAccounts() {
|
|
119
119
|
return this.detailedAccounts.filter(
|
|
120
|
-
(t) => t.account_type ===
|
|
120
|
+
(t) => t.account_type === c.INVESTMENT || t.account_type === c.SAVINGS || t.account_type === c.CHECKING || t.account_type === c.CASH || t.account_type === c.PROPERTY || t.account_type === c.INSURANCE && (t.account_subtype === u.WHOLE_LIFE || t.account_subtype === u.UNIVERSAL_LIFE || t.account_subtype === u.VARIABLE_UNIVERSAL_LIFE)
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
123
|
get visibleAccounts() {
|
|
@@ -157,7 +157,7 @@ class R {
|
|
|
157
157
|
}
|
|
158
158
|
get savingsAndCheckingAccounts() {
|
|
159
159
|
return this.accounts.filter(
|
|
160
|
-
(e) => e.account_type ===
|
|
160
|
+
(e) => e.account_type === c.SAVINGS || e.account_type === c.CHECKING
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
setAccounts = (t) => {
|
|
@@ -216,10 +216,10 @@ class R {
|
|
|
216
216
|
try {
|
|
217
217
|
const e = await this.api.mergeAccounts(t), s = e[Object.keys(e)[0]];
|
|
218
218
|
d(() => {
|
|
219
|
-
const
|
|
220
|
-
this.accounts.splice(
|
|
221
|
-
const
|
|
222
|
-
this.accounts.splice(
|
|
219
|
+
const n = this.accounts.findIndex((r) => r.guid === t[1]);
|
|
220
|
+
this.accounts.splice(n, 1);
|
|
221
|
+
const o = this.accounts.findIndex((r) => r.guid === t[0]);
|
|
222
|
+
this.accounts.splice(o, 1, s);
|
|
223
223
|
});
|
|
224
224
|
} catch (e) {
|
|
225
225
|
console.error(`Error occurred while merging accounts: ${e}`);
|
|
@@ -247,7 +247,7 @@ class R {
|
|
|
247
247
|
updateAccount = async (t) => {
|
|
248
248
|
try {
|
|
249
249
|
const e = await this.api.updateAccount(t), s = this.accounts.findIndex(
|
|
250
|
-
(
|
|
250
|
+
(n) => n.guid === e.guid
|
|
251
251
|
);
|
|
252
252
|
this.accounts.splice(s, 1, e);
|
|
253
253
|
} catch (e) {
|
|
@@ -255,34 +255,28 @@ class R {
|
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
257
|
updateAccountBalance = (t, e) => {
|
|
258
|
-
const s = this.accounts.find((
|
|
258
|
+
const s = this.accounts.find((n) => n.guid === t);
|
|
259
259
|
s && d(() => {
|
|
260
260
|
s.balance = (s.balance || 0) + e;
|
|
261
261
|
});
|
|
262
262
|
};
|
|
263
|
-
updateAccountFiltering = async (t, e) => {
|
|
264
|
-
for (const s of t) {
|
|
265
|
-
const c = this.accounts.find((i) => i.guid === s);
|
|
266
|
-
c && (c.is_excluded_from_accounts = e, await this.updateAccount(c));
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
263
|
updateAccountFilter = async (t) => {
|
|
270
264
|
const e = [];
|
|
271
|
-
for (const [
|
|
272
|
-
const a = this.accounts.find((p) => p.guid ===
|
|
265
|
+
for (const [o, r] of t.entries()) {
|
|
266
|
+
const a = this.accounts.find((p) => p.guid === o);
|
|
273
267
|
a && a.is_excluded_from_accounts === r && (a.is_excluded_from_accounts = !r, e.push(this.api.updateAccount(a)));
|
|
274
268
|
}
|
|
275
|
-
const s = await Promise.all(e),
|
|
276
|
-
for (const
|
|
277
|
-
const r =
|
|
278
|
-
r !== -1 &&
|
|
269
|
+
const s = await Promise.all(e), n = [...this.accounts];
|
|
270
|
+
for (const o of s) {
|
|
271
|
+
const r = n.findIndex((a) => a.guid === o.guid);
|
|
272
|
+
r !== -1 && n.splice(r, 1, o);
|
|
279
273
|
}
|
|
280
|
-
this.setAccounts(
|
|
274
|
+
this.setAccounts(n);
|
|
281
275
|
};
|
|
282
276
|
}
|
|
283
277
|
export {
|
|
284
|
-
|
|
278
|
+
x as A,
|
|
285
279
|
T as a,
|
|
286
|
-
|
|
280
|
+
R as g,
|
|
287
281
|
M as s
|
|
288
282
|
};
|
|
@@ -152,9 +152,6 @@ class $ {
|
|
|
152
152
|
console.error(`Error occurred while getting monthly category totals: ${s}`);
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
|
-
resetCategoryTotals = () => {
|
|
156
|
-
this.dateRangeCategoryTotals = [], this.monthlyCategoryTotals = [], this.dateRangeTotalsLoaded = !1, this.monthlyTotalsLoaded = !1;
|
|
157
|
-
};
|
|
158
155
|
reloadCategoryTotals = async (t, e, o) => {
|
|
159
156
|
const a = e ?? c(/* @__PURE__ */ new Date(), 11), r = o ?? h(/* @__PURE__ */ new Date());
|
|
160
157
|
try {
|
|
@@ -60,8 +60,8 @@ import { C as s3 } from "../ConnectionsDrawer-BDpVTTSe.mjs";
|
|
|
60
60
|
import { u as f1 } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
61
61
|
import { u as t1 } from "../useWidgetLoadTimer-hIOioiKx.mjs";
|
|
62
62
|
import { L as n1 } from "../Loader-DUaFpDGv.mjs";
|
|
63
|
-
import { g as l3 } from "../AccountStore-
|
|
64
|
-
import { A as t2 } from "../AccountStore-
|
|
63
|
+
import { g as l3 } from "../AccountStore-DY5HniWw.mjs";
|
|
64
|
+
import { A as t2 } from "../AccountStore-DY5HniWw.mjs";
|
|
65
65
|
import { M as g1 } from "../MiniWidgetContainer-98-hKFqm.mjs";
|
|
66
66
|
import { A as o2 } from "../AccountApi-DgZ8ILj1.mjs";
|
|
67
67
|
const r3 = (t, o) => {
|
|
@@ -51,6 +51,5 @@ export declare class AccountStore {
|
|
|
51
51
|
removeAccount: (accountGuid: string) => Promise<void>;
|
|
52
52
|
updateAccount: (account: Account) => Promise<void>;
|
|
53
53
|
updateAccountBalance: (accountGuid: string, balanceChange: number) => void;
|
|
54
|
-
updateAccountFiltering: (guids: string[], isExcluded: boolean) => Promise<void>;
|
|
55
54
|
updateAccountFilter: (accountMap: Map<string, boolean>) => Promise<void>;
|
|
56
55
|
}
|