@mx-cartographer/experiences 9.2.6 → 9.2.8
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 -0
- package/dist/{UserStore-BceB3WHz.mjs → UserStore-CgsAunf1.mjs} +188 -167
- package/dist/UserStore-CgsAunf1.mjs.map +1 -0
- package/dist/WidgetContainer-eosXfD5G.mjs +493 -0
- package/dist/WidgetContainer-eosXfD5G.mjs.map +1 -0
- package/dist/accounts/index.es.js +1 -1
- package/dist/budgets/index.es.js +1 -1
- package/dist/cashflow/index.es.js +1 -1
- package/dist/common/components/daterangeselector/DateRangeSelector.d.ts +14 -0
- package/dist/common/index.es.js +2 -2
- package/dist/core/index.es.js +1 -1
- package/dist/core/stores/CategoryStore.d.ts +2 -0
- package/dist/debts/index.es.js +1 -1
- package/dist/finstrong/index.es.js +1 -1
- package/dist/goals/index.es.js +1 -1
- package/dist/help/index.es.js +1 -1
- package/dist/investments/index.es.js +1 -1
- package/dist/networth/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +1 -1
- package/dist/settings/index.es.js +1 -1
- package/dist/spending/index.es.js +209 -185
- package/dist/spending/index.es.js.map +1 -1
- package/dist/transactions/index.es.js +1 -1
- package/dist/trends/index.es.js +577 -575
- package/dist/trends/index.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/UserStore-BceB3WHz.mjs.map +0 -1
- package/dist/WidgetContainer-DvKtBdhn.mjs +0 -487
- package/dist/WidgetContainer-DvKtBdhn.mjs.map +0 -1
|
@@ -4,11 +4,11 @@ import { i as wt, f as Et, b as It, c as V } from "./BudgetUtil-Bg2AQJpQ.mjs";
|
|
|
4
4
|
import { c as d, d as $ } from "./Account-DR7Plrqy.mjs";
|
|
5
5
|
import { F as p, B as G, G as z } from "./GlobalCopyApi-CLhyon-B.mjs";
|
|
6
6
|
import { A as n } from "./ApiEndpoints-DXwIYNUV.mjs";
|
|
7
|
-
import
|
|
7
|
+
import Rt from "posthog-js";
|
|
8
8
|
import { endOfMonth as b } from "date-fns/endOfMonth";
|
|
9
|
-
import { startOfMonth as
|
|
10
|
-
import { startOfToday as
|
|
11
|
-
import { C as w, b as
|
|
9
|
+
import { startOfMonth as R } from "date-fns/startOfMonth";
|
|
10
|
+
import { startOfToday as y } from "date-fns/startOfToday";
|
|
11
|
+
import { C as w, b as Ct } from "./Category-DEKZGLYe.mjs";
|
|
12
12
|
import { addDays as Dt } from "date-fns/addDays";
|
|
13
13
|
import { differenceInDays as xt } from "date-fns/differenceInDays";
|
|
14
14
|
import { isBefore as W } from "date-fns/isBefore";
|
|
@@ -19,15 +19,15 @@ import { l as Ft, D as Ut } from "./DebtUtils-jG2NU0Pb.mjs";
|
|
|
19
19
|
import { format as kt } from "date-fns/format";
|
|
20
20
|
import { fromUnixTime as Ht } from "date-fns/fromUnixTime";
|
|
21
21
|
import { f as k, D as H } from "./DateFormats-HudZ3Bjs.mjs";
|
|
22
|
-
import { T, c as
|
|
23
|
-
import { A as Wt, m as Vt, a as zt, b as
|
|
24
|
-
import { f as
|
|
22
|
+
import { T, c as q } from "./GoalsUtil-C9EnLWvC.mjs";
|
|
23
|
+
import { A as Wt, m as Vt, a as zt, b as qt } from "./InvestmentUtil-BItV7uEs.mjs";
|
|
24
|
+
import { f as Kt, b as Qt, a as K, c as Yt, d as jt, e as Xt, s as Jt } from "./NetWorthUtils-Dj7CgAg2.mjs";
|
|
25
25
|
import { f as Zt } from "./NotificationUtils-BRGFTePr.mjs";
|
|
26
26
|
import { isAfter as F } from "date-fns/isAfter";
|
|
27
|
-
import { isSameDay as
|
|
27
|
+
import { isSameDay as Q } from "date-fns/isSameDay";
|
|
28
28
|
import { isWithinInterval as pt } from "date-fns/isWithinInterval";
|
|
29
29
|
import { subDays as _t } from "date-fns/subDays";
|
|
30
|
-
import { f as U, h as te, b as L, a as
|
|
30
|
+
import { f as U, h as te, b as L, a as f } from "./RecurringTransactionsUtil-CfWviBh1.mjs";
|
|
31
31
|
import { I as u, A as _, B } from "./Notification-DTNYSd8P.mjs";
|
|
32
32
|
import { endOfToday as Y } from "date-fns/endOfToday";
|
|
33
33
|
import { formatISO as ee } from "date-fns/formatISO";
|
|
@@ -113,8 +113,8 @@ class Z {
|
|
|
113
113
|
try {
|
|
114
114
|
const a = `${n.MONTHLY_CATEGORY_TOTALS}/from/${t}/to/${e}`;
|
|
115
115
|
if (s) {
|
|
116
|
-
const
|
|
117
|
-
return (await this.fetchInstance.post(a, { account_guid:
|
|
116
|
+
const i = s.length === 0 ? [""] : s.map((l) => l.guid);
|
|
117
|
+
return (await this.fetchInstance.post(a, { account_guid: i })).monthly_category_totals;
|
|
118
118
|
} else
|
|
119
119
|
return (await this.fetchInstance.get(a)).monthly_category_totals;
|
|
120
120
|
} catch (a) {
|
|
@@ -181,8 +181,8 @@ class rt {
|
|
|
181
181
|
this.fetchInstance = new p(t, e, void 0, s);
|
|
182
182
|
}
|
|
183
183
|
getMerchants = async (t = [], e = [], s = 1, a = 25) => {
|
|
184
|
-
let
|
|
185
|
-
return
|
|
184
|
+
let i = n.MERCHANTS;
|
|
185
|
+
return i += `?page=${s}&per_page=${a}`, t.length && t.forEach((o) => i += `&fuzzy_name[]=${o}`), e.length && e.forEach((o) => i += `&guid[]=${o}`), this.fetchInstance.get(i).then((o) => o.merchants);
|
|
186
186
|
};
|
|
187
187
|
getMerchantByGuid = async (t) => this.fetchInstance.get(`${n.MERCHANTS}/${t}`).then((e) => e.merchant);
|
|
188
188
|
}
|
|
@@ -250,40 +250,40 @@ class O {
|
|
|
250
250
|
getTransactionsByAccountsAndDateRange = async (t, e, s) => {
|
|
251
251
|
console.warn("DEPRECATED: getTransactionsByAccountsAndDateRange will be removed");
|
|
252
252
|
const a = t.reduce(
|
|
253
|
-
(
|
|
253
|
+
(i, o, l) => `${i}account_guids[]=${o}${l !== t.length - 1 ? "&" : ""}`,
|
|
254
254
|
""
|
|
255
255
|
);
|
|
256
|
-
return this.fetchInstance.get(`${n.TRANSACTIONS}/by_date/${e}/${s}?${a}`).then((
|
|
256
|
+
return this.fetchInstance.get(`${n.TRANSACTIONS}/by_date/${e}/${s}?${a}`).then((i) => i.map((o) => o.transaction));
|
|
257
257
|
};
|
|
258
258
|
// DEPRECATED
|
|
259
259
|
getTransactionsByGuids = async (t) => (console.warn("DEPRECATED: getTransactionsByGuids will be removed"), this.fetchInstance.post(`${n.TRANSACTIONS}/by_guids`, { guids: t.join("+") }).then((e) => e.map((s) => s.transaction)));
|
|
260
260
|
// DEPRECATED
|
|
261
261
|
getTransactionsByCategoryAndDate = async (t, e, s) => (console.warn("DEPRECATED: getTransactionsByCategoryAndDate will be removed"), this.fetchInstance.get(
|
|
262
262
|
`${n.TRANSACTIONS}/by_category_guid/${t}/by_date/${e}/${s}`
|
|
263
|
-
).then((a) => a.map((
|
|
263
|
+
).then((a) => a.map((i) => i.transaction)));
|
|
264
264
|
// DEPRECATED
|
|
265
265
|
getTransactionsByCategoryDateAndAccounts = async (t, e, s, a) => {
|
|
266
266
|
console.warn("DEPRECATED: getTransactionsByCategoryDateAndAccounts will be removed");
|
|
267
|
-
const
|
|
268
|
-
(
|
|
267
|
+
const i = a.reduce(
|
|
268
|
+
(o, l, g) => `${o}account_guids[]=${l}${g !== a.length - 1 ? "&" : ""}`,
|
|
269
269
|
""
|
|
270
270
|
);
|
|
271
271
|
return this.fetchInstance.get(
|
|
272
|
-
`${n.TRANSACTIONS}/by_category_guid/${t}/by_date/${e}/${s}?${
|
|
273
|
-
).then((
|
|
272
|
+
`${n.TRANSACTIONS}/by_category_guid/${t}/by_date/${e}/${s}?${i}`
|
|
273
|
+
).then((o) => o.map((l) => l.transaction));
|
|
274
274
|
};
|
|
275
275
|
// DEPRECATED
|
|
276
276
|
getTransactionsByCategoriesDateAndAccounts = async (t, e, s, a) => {
|
|
277
277
|
console.warn("DEPRECATED: getTransactionsByCategoriesDateAndAccounts will be removed");
|
|
278
|
-
const
|
|
279
|
-
(
|
|
278
|
+
const i = a.reduce(
|
|
279
|
+
(o, l, g) => `${o}account_guids[]=${l}${g !== a.length - 1 ? "&" : ""}`,
|
|
280
280
|
""
|
|
281
281
|
);
|
|
282
282
|
return this.fetchInstance.get(
|
|
283
283
|
`${n.TRANSACTIONS}/by_category_guids/${t.join(
|
|
284
284
|
"+"
|
|
285
|
-
)}/by_date/${e}/${s}?${
|
|
286
|
-
).then((
|
|
285
|
+
)}/by_date/${e}/${s}?${i}`
|
|
286
|
+
).then((o) => o.map((l) => l.transaction));
|
|
287
287
|
};
|
|
288
288
|
/**
|
|
289
289
|
* DEPRECATED
|
|
@@ -296,15 +296,15 @@ class O {
|
|
|
296
296
|
*/
|
|
297
297
|
getTransactionsByTopLevelCategoryAndDate = async (t, e, s, a = []) => {
|
|
298
298
|
console.warn("DEPRECATED: getTransactionsByTopLevelCategoryAndDate will be removed");
|
|
299
|
-
let
|
|
299
|
+
let i = `${n.TRANSACTIONS}/by_top_level_category_guid/${t}/by_date/${e}/${s}`;
|
|
300
300
|
if (a.length > 0) {
|
|
301
|
-
const
|
|
302
|
-
(l, g,
|
|
301
|
+
const o = a.reduce(
|
|
302
|
+
(l, g, S) => `${l}account_guids[]=${g}${S !== a.length - 1 ? "&" : ""}`,
|
|
303
303
|
""
|
|
304
304
|
);
|
|
305
|
-
|
|
305
|
+
i += `?${o}`;
|
|
306
306
|
}
|
|
307
|
-
return this.fetchInstance.get(
|
|
307
|
+
return this.fetchInstance.get(i).then((o) => o.map((l) => l.transaction));
|
|
308
308
|
};
|
|
309
309
|
removeTag = async (t) => this.fetchInstance.delete(`${n.TAGS}/${t}`).then((e) => e);
|
|
310
310
|
removeTagging = async (t) => this.fetchInstance.delete(`${n.TAGGINGS}/${t}`).then((e) => e);
|
|
@@ -507,10 +507,10 @@ class ce {
|
|
|
507
507
|
try {
|
|
508
508
|
const e = await this.api.mergeAccounts(t), s = e[Object.keys(e)[0]];
|
|
509
509
|
c(() => {
|
|
510
|
-
const a = this.accounts.findIndex((
|
|
510
|
+
const a = this.accounts.findIndex((o) => o.guid === t[1]);
|
|
511
511
|
this.accounts.splice(a, 1);
|
|
512
|
-
const
|
|
513
|
-
this.accounts.splice(
|
|
512
|
+
const i = this.accounts.findIndex((o) => o.guid === t[0]);
|
|
513
|
+
this.accounts.splice(i, 1, s);
|
|
514
514
|
});
|
|
515
515
|
} catch (e) {
|
|
516
516
|
console.error("Error occurred while merging accounts:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
@@ -557,21 +557,21 @@ class ce {
|
|
|
557
557
|
updateAccountFilter = async (t) => {
|
|
558
558
|
try {
|
|
559
559
|
const e = [];
|
|
560
|
-
for (const [
|
|
561
|
-
const g = this.accounts.find((
|
|
560
|
+
for (const [o, l] of t.entries()) {
|
|
561
|
+
const g = this.accounts.find((S) => S.guid === o);
|
|
562
562
|
if (g && g.is_excluded_from_accounts === l) {
|
|
563
|
-
const
|
|
563
|
+
const S = { ...g, is_excluded_from_accounts: !l };
|
|
564
564
|
e.push(
|
|
565
|
-
this.api.updateAccount(
|
|
565
|
+
this.api.updateAccount(S).catch((C) => (console.error("Error occurred while updating account filter:", C), this.globalStore.captureException(C, { store: "AccountStore" }), null))
|
|
566
566
|
);
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
const a = (await Promise.all(e)).filter((
|
|
570
|
-
for (const
|
|
571
|
-
const l =
|
|
572
|
-
l !== -1 &&
|
|
569
|
+
const a = (await Promise.all(e)).filter((o) => o !== null), i = [...this.accounts];
|
|
570
|
+
for (const o of a) {
|
|
571
|
+
const l = i.findIndex((g) => g.guid === o.guid);
|
|
572
|
+
l !== -1 && i.splice(l, 1, o);
|
|
573
573
|
}
|
|
574
|
-
this.setAccounts(
|
|
574
|
+
this.setAccounts(i);
|
|
575
575
|
} catch (e) {
|
|
576
576
|
console.error("Error occurred while updating account filter:", e), this.globalStore.captureException(e, { store: "AccountStore" });
|
|
577
577
|
}
|
|
@@ -669,7 +669,7 @@ class de {
|
|
|
669
669
|
return this.survey ? this.survey.questions : [];
|
|
670
670
|
}
|
|
671
671
|
loadSurvey = (t = !1) => {
|
|
672
|
-
|
|
672
|
+
Rt.getActiveMatchingSurveys((e) => {
|
|
673
673
|
c(() => {
|
|
674
674
|
if (e.length > 0) {
|
|
675
675
|
const s = e.find((a) => a.id === this.surveyId);
|
|
@@ -690,7 +690,7 @@ class de {
|
|
|
690
690
|
}
|
|
691
691
|
function ue(r, t, e, s = "asc") {
|
|
692
692
|
const a = s === "desc" ? -1 : 1;
|
|
693
|
-
return [...r, ...t].sort((
|
|
693
|
+
return [...r, ...t].sort((i, o) => i[e] < o[e] ? -1 * a : i[e] > o[e] ? 1 * a : 0);
|
|
694
694
|
}
|
|
695
695
|
const ge = (r) => ({
|
|
696
696
|
...r,
|
|
@@ -776,7 +776,7 @@ class _e {
|
|
|
776
776
|
api = new J("/", "");
|
|
777
777
|
globalStore;
|
|
778
778
|
alert = "";
|
|
779
|
-
dateRange = { start:
|
|
779
|
+
dateRange = { start: R(y()), end: b(y()) };
|
|
780
780
|
budgets = [];
|
|
781
781
|
selectedBudget;
|
|
782
782
|
selectedSubBudget;
|
|
@@ -876,7 +876,7 @@ class _e {
|
|
|
876
876
|
recalculateBudgets = async (t) => {
|
|
877
877
|
try {
|
|
878
878
|
for (const s of t) {
|
|
879
|
-
const a = this.budgets.find((
|
|
879
|
+
const a = this.budgets.find((i) => i.category_guid === s.guid);
|
|
880
880
|
a ? await this.api.updateBudget({
|
|
881
881
|
...a,
|
|
882
882
|
amount: s.totalAverageAmount
|
|
@@ -923,8 +923,8 @@ class _e {
|
|
|
923
923
|
try {
|
|
924
924
|
const { guid: e, amount: s } = t, a = await this.api.updateMerchantBudget(e, s);
|
|
925
925
|
return c(() => {
|
|
926
|
-
const
|
|
927
|
-
|
|
926
|
+
const i = this.merchantBudgets.findIndex((o) => o.guid === t.guid);
|
|
927
|
+
i >= 0 && (this.merchantBudgets[i] = a);
|
|
928
928
|
}), { isSuccess: !0 };
|
|
929
929
|
} catch (e) {
|
|
930
930
|
return console.error("Error updating merchant budget:", e), this.globalStore.captureException(e, { store: "BudgetsStore" }), { isSuccess: !1 };
|
|
@@ -940,11 +940,11 @@ class _e {
|
|
|
940
940
|
}
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
|
-
class
|
|
943
|
+
class fe {
|
|
944
944
|
globalStore;
|
|
945
945
|
uiStore;
|
|
946
946
|
constructor(t) {
|
|
947
|
-
this.globalStore = t, this.uiStore = new
|
|
947
|
+
this.globalStore = t, this.uiStore = new ye(t), h(this);
|
|
948
948
|
}
|
|
949
949
|
completeOnboarding = async () => {
|
|
950
950
|
const t = {
|
|
@@ -954,13 +954,13 @@ class ye {
|
|
|
954
954
|
await this.globalStore.userStore.updateUserProfile(t);
|
|
955
955
|
};
|
|
956
956
|
}
|
|
957
|
-
let
|
|
957
|
+
let ye = class {
|
|
958
958
|
globalStore;
|
|
959
959
|
// Cashflow is hard-coded to display 30 days starting from today. This is the
|
|
960
960
|
// single source of truth for Cash Flow's window; it intentionally does NOT
|
|
961
961
|
// mutate RecurringTransactionsStore.dateRange, so Cash Flow stays decoupled
|
|
962
962
|
// from other widgets (e.g. Recurring Transactions) that drive that shared range.
|
|
963
|
-
dateRange = { start:
|
|
963
|
+
dateRange = { start: y(), end: Dt(y(), 30) };
|
|
964
964
|
isDirty = !1;
|
|
965
965
|
constructor(t) {
|
|
966
966
|
this.globalStore = t, h(this);
|
|
@@ -1000,7 +1000,7 @@ let Se = class {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
// Returns the number of days until the next income activity or 0 if there is no income activity
|
|
1002
1002
|
get daysUntilNextIncome() {
|
|
1003
|
-
return this.nextIncome ? Math.abs(xt(
|
|
1003
|
+
return this.nextIncome ? Math.abs(xt(y(), this.nextIncome.expectedDate)) : 0;
|
|
1004
1004
|
}
|
|
1005
1005
|
// Returns the expenses (Activities) until the next income activity or the end of the month
|
|
1006
1006
|
// if there is no income activity
|
|
@@ -1010,7 +1010,7 @@ let Se = class {
|
|
|
1010
1010
|
);
|
|
1011
1011
|
}
|
|
1012
1012
|
};
|
|
1013
|
-
class
|
|
1013
|
+
class Se {
|
|
1014
1014
|
globalStore;
|
|
1015
1015
|
uiStore;
|
|
1016
1016
|
api = new Z("/", "");
|
|
@@ -1023,8 +1023,26 @@ class fe {
|
|
|
1023
1023
|
dateRangeTotalsLoading = !1;
|
|
1024
1024
|
monthlyTotalsLoaded = !1;
|
|
1025
1025
|
monthlyTotalsLoading = !1;
|
|
1026
|
+
// Monotonic request tokens, one per totals endpoint. A newer request
|
|
1027
|
+
// supersedes an older in-flight one: the stale response is discarded rather
|
|
1028
|
+
// than the newer request being dropped. These loaders used to early-return
|
|
1029
|
+
// while a request was in flight, which silently swallowed date-range/account
|
|
1030
|
+
// changes made mid-flight. (MEW-3910)
|
|
1031
|
+
//
|
|
1032
|
+
// Deliberately per-endpoint rather than one shared counter: several callers
|
|
1033
|
+
// (BubbleBudgetsWidget, BubbleBudgetsMiniWidget) fire the two loaders
|
|
1034
|
+
// independently and concurrently, and a shared counter would make the second
|
|
1035
|
+
// call supersede — and silently drop — the first.
|
|
1036
|
+
//
|
|
1037
|
+
// Kept out of the observable graph — internal concurrency bookkeeping, not
|
|
1038
|
+
// renderable state.
|
|
1039
|
+
dateRangeTotalsRequestId = 0;
|
|
1040
|
+
monthlyTotalsRequestId = 0;
|
|
1026
1041
|
constructor(t) {
|
|
1027
|
-
this.globalStore = t, this.uiStore = new me(), this.api = new Z(t.endpoint, t.sessionToken, t.onError), h(this
|
|
1042
|
+
this.globalStore = t, this.uiStore = new me(), this.api = new Z(t.endpoint, t.sessionToken, t.onError), h(this, {
|
|
1043
|
+
dateRangeTotalsRequestId: !1,
|
|
1044
|
+
monthlyTotalsRequestId: !1
|
|
1045
|
+
});
|
|
1028
1046
|
}
|
|
1029
1047
|
get detailedCategories() {
|
|
1030
1048
|
return this.globalStore.isInitialized ? Lt(
|
|
@@ -1085,41 +1103,44 @@ class fe {
|
|
|
1085
1103
|
}
|
|
1086
1104
|
};
|
|
1087
1105
|
loadDateRangeCategoryTotals = async (t, e, s) => {
|
|
1088
|
-
|
|
1106
|
+
const a = ++this.dateRangeTotalsRequestId, i = () => a !== this.dateRangeTotalsRequestId;
|
|
1107
|
+
c(() => {
|
|
1089
1108
|
this.dateRangeTotalsLoading = !0;
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1109
|
+
});
|
|
1110
|
+
try {
|
|
1111
|
+
const o = await this.api.getDateRangeCategoryTotals(
|
|
1112
|
+
m(e),
|
|
1113
|
+
m(s),
|
|
1114
|
+
t
|
|
1115
|
+
);
|
|
1116
|
+
if (i()) return;
|
|
1117
|
+
this.setDateRangeCategoryTotals(o);
|
|
1118
|
+
} catch (o) {
|
|
1119
|
+
if (i()) return;
|
|
1120
|
+
console.error("Error occurred while getting date range category totals:", o), this.globalStore.captureException(o, { store: "CategoryStore" }), this.setDateRangeCategoryTotals([]);
|
|
1100
1121
|
}
|
|
1101
1122
|
};
|
|
1102
1123
|
loadMonthlyCategoryTotals = async (t = this.globalStore.globalUiStore.selectedAccounts, e, s) => {
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1124
|
+
const a = ++this.monthlyTotalsRequestId, i = () => a !== this.monthlyTotalsRequestId;
|
|
1125
|
+
c(() => {
|
|
1126
|
+
this.monthlyTotalsLoading = !0;
|
|
1127
|
+
});
|
|
1128
|
+
const o = m(R(e ?? N(/* @__PURE__ */ new Date(), 11))), l = m(b(s ?? /* @__PURE__ */ new Date()));
|
|
1106
1129
|
try {
|
|
1107
|
-
const
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1130
|
+
const g = await this.api.getMonthlyCategoryTotals(o, l, t);
|
|
1131
|
+
if (i()) return;
|
|
1132
|
+
this.setMonthlyCategoryTotals(g);
|
|
1133
|
+
} catch (g) {
|
|
1134
|
+
if (i()) return;
|
|
1135
|
+
console.error("Error occurred while getting monthly category totals:", g), this.globalStore.captureException(g, { store: "CategoryStore" }), this.setMonthlyCategoryTotals([]);
|
|
1111
1136
|
}
|
|
1112
1137
|
};
|
|
1113
1138
|
reloadCategoryTotals = async (t, e, s) => {
|
|
1114
|
-
const a = e ?? N(/* @__PURE__ */ new Date(), 11),
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
]);
|
|
1120
|
-
} catch (i) {
|
|
1121
|
-
console.error("Error occurred while getting category totals:", i), this.globalStore.captureException(i, { store: "CategoryStore" });
|
|
1122
|
-
}
|
|
1139
|
+
const a = e ?? N(/* @__PURE__ */ new Date(), 11), i = s ?? b(/* @__PURE__ */ new Date());
|
|
1140
|
+
await Promise.all([
|
|
1141
|
+
this.loadMonthlyCategoryTotals(t, a, i),
|
|
1142
|
+
this.loadDateRangeCategoryTotals(t, a, i)
|
|
1143
|
+
]);
|
|
1123
1144
|
};
|
|
1124
1145
|
removeCategory = async (t) => {
|
|
1125
1146
|
try {
|
|
@@ -1136,7 +1157,7 @@ class fe {
|
|
|
1136
1157
|
}
|
|
1137
1158
|
};
|
|
1138
1159
|
// TODO: Remove this after refactoring Trends components to use detailedCategories
|
|
1139
|
-
getCategoryName = (t) => this.categories.find((s) => s.guid === t)?.name ??
|
|
1160
|
+
getCategoryName = (t) => this.categories.find((s) => s.guid === t)?.name ?? Ct[t];
|
|
1140
1161
|
}
|
|
1141
1162
|
let me = class {
|
|
1142
1163
|
expandedGuid = null;
|
|
@@ -1178,7 +1199,7 @@ class be {
|
|
|
1178
1199
|
this.globalStore = t, this.uiStore = new Ae(), h(this);
|
|
1179
1200
|
}
|
|
1180
1201
|
get debts() {
|
|
1181
|
-
const { visibleDebtAccounts: t } = this.globalStore.accountStore, { selectedAccountGuids: e } = this.globalStore.globalUiStore, { debtGoals: s } = this.globalStore.goalStore, a = e.length ? t.filter((
|
|
1202
|
+
const { visibleDebtAccounts: t } = this.globalStore.accountStore, { selectedAccountGuids: e } = this.globalStore.globalUiStore, { debtGoals: s } = this.globalStore.goalStore, a = e.length ? t.filter((i) => e.includes(i.guid)) : t;
|
|
1182
1203
|
return Ft(a, s);
|
|
1183
1204
|
}
|
|
1184
1205
|
get totalMonthlyPayments() {
|
|
@@ -1242,8 +1263,8 @@ class Ie {
|
|
|
1242
1263
|
const e = await this.api.calculateHealthScore();
|
|
1243
1264
|
let s = 0;
|
|
1244
1265
|
t && await this.loadHealthScoreChangeReports();
|
|
1245
|
-
const a = e?.health_score || 0,
|
|
1246
|
-
s = a -
|
|
1266
|
+
const a = e?.health_score || 0, i = this.healthScoreChangeReports.at(-1)?.older_health_score || 0;
|
|
1267
|
+
s = a - i, c(() => {
|
|
1247
1268
|
this.healthScore = e, this.healthScoreChange = s;
|
|
1248
1269
|
});
|
|
1249
1270
|
} catch (e) {
|
|
@@ -1498,11 +1519,11 @@ class Ns {
|
|
|
1498
1519
|
userStore;
|
|
1499
1520
|
// UI Stores
|
|
1500
1521
|
globalUiStore;
|
|
1501
|
-
constructor(t = ht, e = "/", s, a,
|
|
1502
|
-
this.appConfig = t, this.endpoint = e, this.sessionToken = t.options.session_token ?? "", this.onCaptureException =
|
|
1503
|
-
const { transactions:
|
|
1522
|
+
constructor(t = ht, e = "/", s, a, i) {
|
|
1523
|
+
this.appConfig = t, this.endpoint = e, this.sessionToken = t.options.session_token ?? "", this.onCaptureException = i, this.onError = s, this.onStoreUpdate = a, this.accountStore = new ce(this), this.appDataStore = new he(this), this.analyticsStore = new de(this), this.beatStore = new pe(this), this.budgetsStore = new _e(this), this.cashflowStore = new fe(this), this.categoryStore = new Se(this), this.connectStore = new Te(this), this.copyStore = new Ce(this), this.debtsStore = new be(this), this.finstrongStore = new Ie(this), this.goalStore = new De(this), this.helpStore = new ve(this), this.holdingStore = new Ge(this), this.merchantStore = new Ne(this), this.netWorthStore = new Be(this), this.notificationStore = new Me(this), this.recurringTransactionsStore = new Oe(this), this.settingsStore = new Fe(this), this.transactionStore = new Ue(this), this.trendsStore = new He(this), this.userStore = new We(this), this.globalUiStore = new Re(this), h(this), mt(() => {
|
|
1524
|
+
const { transactions: o } = this.transactionStore;
|
|
1504
1525
|
this.emitUpdate({
|
|
1505
|
-
transactions:
|
|
1526
|
+
transactions: o
|
|
1506
1527
|
});
|
|
1507
1528
|
});
|
|
1508
1529
|
}
|
|
@@ -1530,21 +1551,21 @@ class Ns {
|
|
|
1530
1551
|
appData: e,
|
|
1531
1552
|
associatedBeats: s,
|
|
1532
1553
|
categories: a,
|
|
1533
|
-
institutions:
|
|
1534
|
-
transactionRules:
|
|
1554
|
+
institutions: i,
|
|
1555
|
+
transactionRules: o,
|
|
1535
1556
|
transactions: l,
|
|
1536
1557
|
userFeatures: g,
|
|
1537
|
-
merchantBudgets:
|
|
1558
|
+
merchantBudgets: S
|
|
1538
1559
|
} = {}) => {
|
|
1539
|
-
(!e || !g) && await this.loadConfigData(), e && this.appDataStore.setAppData(e), g && this.userStore.setUserFeatures(g), t && (await this.accountStore.loadMembers(),
|
|
1560
|
+
(!e || !g) && await this.loadConfigData(), e && this.appDataStore.setAppData(e), g && this.userStore.setUserFeatures(g), t && (await this.accountStore.loadMembers(), i && this.accountStore.setInstitutions(i), this.accountStore.setAccounts(t)), s && this.transactionStore.setAssociatedBeats(s), a && this.categoryStore.setCategories(a), l && this.transactionStore.setTransactions(l), o && this.transactionStore.setTransactionRules(o), S && this.budgetsStore.setMerchantBudgets(S);
|
|
1540
1561
|
};
|
|
1541
1562
|
}
|
|
1542
|
-
class
|
|
1563
|
+
class Re {
|
|
1543
1564
|
globalStore;
|
|
1544
1565
|
accountFilterMap = /* @__PURE__ */ new Map();
|
|
1545
1566
|
displayedDate = /* @__PURE__ */ new Date();
|
|
1546
1567
|
displayedDateRange = {
|
|
1547
|
-
start:
|
|
1568
|
+
start: R(this.displayedDate),
|
|
1548
1569
|
end: b(this.displayedDate)
|
|
1549
1570
|
};
|
|
1550
1571
|
constructor(t) {
|
|
@@ -1606,7 +1627,7 @@ class Ce {
|
|
|
1606
1627
|
return t === e;
|
|
1607
1628
|
}
|
|
1608
1629
|
}
|
|
1609
|
-
class
|
|
1630
|
+
class Ce {
|
|
1610
1631
|
globalStore;
|
|
1611
1632
|
api = new z("/", "");
|
|
1612
1633
|
copy = {};
|
|
@@ -1662,7 +1683,7 @@ class De {
|
|
|
1662
1683
|
amount: s.target_amount,
|
|
1663
1684
|
name: t.retirement,
|
|
1664
1685
|
track_type: T.RETIREMENT_TRACK,
|
|
1665
|
-
projected_to_complete_at: s.retirement_age && e ?
|
|
1686
|
+
projected_to_complete_at: s.retirement_age && e ? q(s.retirement_age, e) : void 0
|
|
1666
1687
|
}))
|
|
1667
1688
|
];
|
|
1668
1689
|
}
|
|
@@ -1687,8 +1708,8 @@ class De {
|
|
|
1687
1708
|
T.RETIREMENT_TRACK
|
|
1688
1709
|
];
|
|
1689
1710
|
return t.sort((s, a) => {
|
|
1690
|
-
const
|
|
1691
|
-
return
|
|
1711
|
+
const i = s.track_type ? e.indexOf(s.track_type) : -1, o = a.track_type ? e.indexOf(a.track_type) : -1;
|
|
1712
|
+
return i - o;
|
|
1692
1713
|
}).slice(0, 3);
|
|
1693
1714
|
}
|
|
1694
1715
|
get isAllGoalDataLoaded() {
|
|
@@ -1757,10 +1778,10 @@ class De {
|
|
|
1757
1778
|
addRetirementGoal = async (t) => {
|
|
1758
1779
|
const e = this.globalStore.copyStore.copy.goals;
|
|
1759
1780
|
try {
|
|
1760
|
-
const s = await this.api.addRetirementGoal(t), a = [],
|
|
1761
|
-
for (const
|
|
1781
|
+
const s = await this.api.addRetirementGoal(t), a = [], i = this.globalStore.userStore.user.birthday;
|
|
1782
|
+
for (const o of this.newRetirementGoalAccounts) {
|
|
1762
1783
|
const l = await this.api.addRetirementGoalAccount({
|
|
1763
|
-
...
|
|
1784
|
+
...o,
|
|
1764
1785
|
retirement_goal_guid: s.guid
|
|
1765
1786
|
});
|
|
1766
1787
|
a.push(l);
|
|
@@ -1772,7 +1793,7 @@ class De {
|
|
|
1772
1793
|
amount: s.target_amount,
|
|
1773
1794
|
name: e.retirement,
|
|
1774
1795
|
track_type: T.RETIREMENT_TRACK,
|
|
1775
|
-
projected_to_complete_at: s.retirement_age &&
|
|
1796
|
+
projected_to_complete_at: s.retirement_age && i ? q(s.retirement_age, i) : void 0
|
|
1776
1797
|
}
|
|
1777
1798
|
], this.setRetirementGoalAccounts([...this.retirementGoalAccounts, ...a]);
|
|
1778
1799
|
} catch (s) {
|
|
@@ -1826,7 +1847,7 @@ class De {
|
|
|
1826
1847
|
const e = await this.api.reorderGoals(t);
|
|
1827
1848
|
c(() => {
|
|
1828
1849
|
for (const s of e) {
|
|
1829
|
-
const a = this.goals.findIndex((
|
|
1850
|
+
const a = this.goals.findIndex((i) => i.guid === s.guid);
|
|
1830
1851
|
a >= 0 && (this.goals[a].position = s.position);
|
|
1831
1852
|
}
|
|
1832
1853
|
});
|
|
@@ -1878,15 +1899,15 @@ const xe = (r, t) => r.guid === "general" || r.guid === "insights" ? !0 : r.flag
|
|
|
1878
1899
|
for (const s of oe) {
|
|
1879
1900
|
const a = t[s.guid];
|
|
1880
1901
|
if (!a) continue;
|
|
1881
|
-
const
|
|
1902
|
+
const i = {
|
|
1882
1903
|
...s,
|
|
1883
1904
|
title: a.label,
|
|
1884
|
-
topics: s.topics.map(({ topicKey:
|
|
1885
|
-
topicKey:
|
|
1905
|
+
topics: s.topics.map(({ topicKey: o }, l) => ({
|
|
1906
|
+
topicKey: o,
|
|
1886
1907
|
label: a.topics[l]
|
|
1887
1908
|
}))
|
|
1888
1909
|
};
|
|
1889
|
-
xe(
|
|
1910
|
+
xe(i, r) && e.push(i);
|
|
1890
1911
|
}
|
|
1891
1912
|
return e;
|
|
1892
1913
|
};
|
|
@@ -1940,7 +1961,7 @@ class Ge {
|
|
|
1940
1961
|
return Vt(zt(this.visibleHoldings), this.analysisType);
|
|
1941
1962
|
}
|
|
1942
1963
|
get analysisDetails() {
|
|
1943
|
-
return
|
|
1964
|
+
return qt(this.visibleHoldings)[this.analysisType] || {};
|
|
1944
1965
|
}
|
|
1945
1966
|
get visibleHoldings() {
|
|
1946
1967
|
return this.holdings.filter(
|
|
@@ -2020,7 +2041,7 @@ class Be {
|
|
|
2020
2041
|
return this.globalStore.accountStore.isAccountDataLoaded && this.monthlyAccountBalancesLoaded;
|
|
2021
2042
|
}
|
|
2022
2043
|
get netWorthAccounts() {
|
|
2023
|
-
return
|
|
2044
|
+
return Kt(
|
|
2024
2045
|
this.globalStore.globalUiStore.selectedAccounts,
|
|
2025
2046
|
this.globalStore.accountStore.members
|
|
2026
2047
|
);
|
|
@@ -2032,11 +2053,11 @@ class Be {
|
|
|
2032
2053
|
};
|
|
2033
2054
|
}
|
|
2034
2055
|
get netWorthChartData() {
|
|
2035
|
-
return
|
|
2056
|
+
return Qt(this.netWorthAccounts, this.monthlyAccountBalances, this.timeframe);
|
|
2036
2057
|
}
|
|
2037
2058
|
get selectedData() {
|
|
2038
2059
|
if (!(!this.netWorthChartData || this.netWorthChartData.length === 0))
|
|
2039
|
-
return this.selectedIndex === -1 ?
|
|
2060
|
+
return this.selectedIndex === -1 ? K(this.netWorthChartData) : this.netWorthChartData[this.selectedIndex];
|
|
2040
2061
|
}
|
|
2041
2062
|
get hoveredData() {
|
|
2042
2063
|
return this.hoveredIndex >= 0 ? this.netWorthChartData[this.hoveredIndex] : void 0;
|
|
@@ -2049,7 +2070,7 @@ class Be {
|
|
|
2049
2070
|
this.netWorthData.accounts
|
|
2050
2071
|
);
|
|
2051
2072
|
return {
|
|
2052
|
-
netWorth:
|
|
2073
|
+
netWorth: K(this.netWorthChartData),
|
|
2053
2074
|
assets: t,
|
|
2054
2075
|
liabilities: e,
|
|
2055
2076
|
totalAssets: s,
|
|
@@ -2127,7 +2148,7 @@ class Oe {
|
|
|
2127
2148
|
repeatingTransactions = [];
|
|
2128
2149
|
isDataLoaded = !1;
|
|
2129
2150
|
selectedDay;
|
|
2130
|
-
dateRange = { start:
|
|
2151
|
+
dateRange = { start: R(y()), end: b(y()) };
|
|
2131
2152
|
selectedRepeatingTransactionGuid = null;
|
|
2132
2153
|
selectedRecurrence = null;
|
|
2133
2154
|
alert = { message: "", severity: void 0 };
|
|
@@ -2169,7 +2190,7 @@ class Oe {
|
|
|
2169
2190
|
* Returns the upcoming expense recurrences scoped to the supplied date range.
|
|
2170
2191
|
*/
|
|
2171
2192
|
upcomingExpensesForRange = (t) => this.recurrencesForRange(t).filter(
|
|
2172
|
-
(e) => e.type === L.Expense && e.status ===
|
|
2193
|
+
(e) => e.type === L.Expense && e.status === f.Upcoming
|
|
2173
2194
|
);
|
|
2174
2195
|
/**
|
|
2175
2196
|
* Returns the income recurrences scoped to the supplied date range.
|
|
@@ -2181,13 +2202,13 @@ class Oe {
|
|
|
2181
2202
|
* Returns the upcoming income recurrences scoped to the supplied date range.
|
|
2182
2203
|
*/
|
|
2183
2204
|
upcomingIncomeForRange = (t) => this.incomeForRange(t).filter(
|
|
2184
|
-
(e) => e.status ===
|
|
2205
|
+
(e) => e.status === f.Upcoming
|
|
2185
2206
|
);
|
|
2186
2207
|
/**
|
|
2187
2208
|
* Returns the next upcoming income recurrence scoped to the supplied range.
|
|
2188
2209
|
*/
|
|
2189
2210
|
nextIncomeForRange = (t) => this.upcomingIncomeForRange(t).find(
|
|
2190
|
-
(e) => F(e.expectedDate,
|
|
2211
|
+
(e) => F(e.expectedDate, y())
|
|
2191
2212
|
);
|
|
2192
2213
|
/**
|
|
2193
2214
|
* Returns all recurrences built from repeating transactions and filtered by accounts.
|
|
@@ -2200,7 +2221,7 @@ class Oe {
|
|
|
2200
2221
|
*/
|
|
2201
2222
|
get pastRecurrences() {
|
|
2202
2223
|
return this.recurrences.filter(
|
|
2203
|
-
(t) => t.status ===
|
|
2224
|
+
(t) => t.status === f.Paid || t.status === f.Missed
|
|
2204
2225
|
);
|
|
2205
2226
|
}
|
|
2206
2227
|
/**
|
|
@@ -2209,7 +2230,7 @@ class Oe {
|
|
|
2209
2230
|
*/
|
|
2210
2231
|
get upcomingRecurrences() {
|
|
2211
2232
|
return this.recurrences.filter(
|
|
2212
|
-
(t) => F(t.expectedDate, _t(
|
|
2233
|
+
(t) => F(t.expectedDate, _t(y(), 3)) && W(t.expectedDate, this.dateRange.end) && t.status === f.Upcoming
|
|
2213
2234
|
);
|
|
2214
2235
|
}
|
|
2215
2236
|
/**
|
|
@@ -2225,7 +2246,7 @@ class Oe {
|
|
|
2225
2246
|
*/
|
|
2226
2247
|
get upcomingExpenses() {
|
|
2227
2248
|
return this.expenses.filter(
|
|
2228
|
-
(t) => t.status ===
|
|
2249
|
+
(t) => t.status === f.Upcoming
|
|
2229
2250
|
);
|
|
2230
2251
|
}
|
|
2231
2252
|
/**
|
|
@@ -2241,11 +2262,11 @@ class Oe {
|
|
|
2241
2262
|
*/
|
|
2242
2263
|
get upcomingIncome() {
|
|
2243
2264
|
return this.income.filter(
|
|
2244
|
-
(t) => t.status ===
|
|
2265
|
+
(t) => t.status === f.Upcoming
|
|
2245
2266
|
);
|
|
2246
2267
|
}
|
|
2247
2268
|
get nextIncomeRecurrence() {
|
|
2248
|
-
return this.upcomingIncome.find((t) => F(t.expectedDate,
|
|
2269
|
+
return this.upcomingIncome.find((t) => F(t.expectedDate, y()));
|
|
2249
2270
|
}
|
|
2250
2271
|
/**
|
|
2251
2272
|
* Returns the expense recurrences for the current month.
|
|
@@ -2273,19 +2294,19 @@ class Oe {
|
|
|
2273
2294
|
* Calculates the total amount of all paid expenses for the current month.
|
|
2274
2295
|
*/
|
|
2275
2296
|
get paidExpenseTotal() {
|
|
2276
|
-
return this.currentMonthExpenses.filter((t) => t.status ===
|
|
2297
|
+
return this.currentMonthExpenses.filter((t) => t.status === f.Paid).reduce(A, 0);
|
|
2277
2298
|
}
|
|
2278
2299
|
/**
|
|
2279
2300
|
* Calculates the total amount of all missed expenses for the current month.
|
|
2280
2301
|
*/
|
|
2281
2302
|
get missedExpenseTotal() {
|
|
2282
|
-
return this.currentMonthExpenses.filter((t) => t.status ===
|
|
2303
|
+
return this.currentMonthExpenses.filter((t) => t.status === f.Missed).reduce(A, 0);
|
|
2283
2304
|
}
|
|
2284
2305
|
/**
|
|
2285
2306
|
* Calculates the total amount of all upcoming expenses for the current month.
|
|
2286
2307
|
*/
|
|
2287
2308
|
get upcomingExpenseTotal() {
|
|
2288
|
-
return this.currentMonthExpenses.filter((t) => t.status ===
|
|
2309
|
+
return this.currentMonthExpenses.filter((t) => t.status === f.Upcoming).reduce(A, 0);
|
|
2289
2310
|
}
|
|
2290
2311
|
/**
|
|
2291
2312
|
* Calculates the total amount of all income for the current month.
|
|
@@ -2297,20 +2318,20 @@ class Oe {
|
|
|
2297
2318
|
* Calculates the total amount of all paid income for the current month.
|
|
2298
2319
|
*/
|
|
2299
2320
|
get paidIncomeTotal() {
|
|
2300
|
-
return this.currentMonthIncome.filter((t) => t.status ===
|
|
2321
|
+
return this.currentMonthIncome.filter((t) => t.status === f.Paid).reduce(A, 0);
|
|
2301
2322
|
}
|
|
2302
2323
|
/**
|
|
2303
2324
|
* Calculates the total amount of all upcoming income for the current month.
|
|
2304
2325
|
*/
|
|
2305
2326
|
get upcomingIncomeTotal() {
|
|
2306
|
-
return this.currentMonthIncome.filter((t) => t.status ===
|
|
2327
|
+
return this.currentMonthIncome.filter((t) => t.status === f.Upcoming).reduce(A, 0);
|
|
2307
2328
|
}
|
|
2308
2329
|
/**
|
|
2309
2330
|
* Get the recurrences for the currently selected day.
|
|
2310
2331
|
*/
|
|
2311
2332
|
get selectedDayRecurrences() {
|
|
2312
2333
|
return this.selectedDay && this.recurrences.filter(
|
|
2313
|
-
(t) => this.selectedDay &&
|
|
2334
|
+
(t) => this.selectedDay && Q(t.occurredOnDate || t.expectedDate, this.selectedDay)
|
|
2314
2335
|
);
|
|
2315
2336
|
}
|
|
2316
2337
|
get selectedRepeatingTransaction() {
|
|
@@ -2333,7 +2354,7 @@ class Oe {
|
|
|
2333
2354
|
* @param day - The day to select.
|
|
2334
2355
|
*/
|
|
2335
2356
|
setSelectedDay = (t) => {
|
|
2336
|
-
this.selectedDay = this.selectedDay &&
|
|
2357
|
+
this.selectedDay = this.selectedDay && Q(t, this.selectedDay) ? void 0 : t;
|
|
2337
2358
|
};
|
|
2338
2359
|
loadRepeatingTransactionData = async () => {
|
|
2339
2360
|
await Promise.all([
|
|
@@ -2481,23 +2502,23 @@ const ut = "PARENT-ENTITY", Pe = (r, t) => ({
|
|
|
2481
2502
|
[u.TransactionExpenseLarge]: t.large_transaction,
|
|
2482
2503
|
[u.PromotionalCampaignMessages]: t.promotional_campaign_messages,
|
|
2483
2504
|
[u.TransparentOverdraft]: t.transparent_overdraft
|
|
2484
|
-
})[r] || "", $e = (r, t, e, s, a,
|
|
2485
|
-
const
|
|
2505
|
+
})[r] || "", $e = (r, t, e, s, a, i) => {
|
|
2506
|
+
const o = [], {
|
|
2486
2507
|
email_notifications_enabled: l,
|
|
2487
2508
|
sms_notifications_enabled: g,
|
|
2488
|
-
push_notifications_enabled:
|
|
2509
|
+
push_notifications_enabled: S
|
|
2489
2510
|
} = t, {
|
|
2490
|
-
opted_out_of_email_notifications:
|
|
2491
|
-
opted_out_of_sms_notifications:
|
|
2492
|
-
opted_out_of_push_notifications:
|
|
2511
|
+
opted_out_of_email_notifications: C,
|
|
2512
|
+
opted_out_of_sms_notifications: ft,
|
|
2513
|
+
opted_out_of_push_notifications: yt
|
|
2493
2514
|
} = a;
|
|
2494
2515
|
for (const E of s.filter((D) => D.entity_guid === ut)) {
|
|
2495
|
-
const D = Pe(E.notification_type, e),
|
|
2516
|
+
const D = Pe(E.notification_type, e), St = s.filter(
|
|
2496
2517
|
(I) => I.entity_guid !== ut && I.notification_type === E.notification_type && r.some((P) => P.guid === I.entity_guid)
|
|
2497
2518
|
), x = [];
|
|
2498
|
-
l && !
|
|
2519
|
+
l && !C && E.email_channel && i.email && x.push(e.delivery_method_email_label), g && !ft && E.sms_channel && i.phone && x.push(e.delivery_method_sms_label), S && !yt && E.push_channel && x.push(e.delivery_method_push_label), o.push({
|
|
2499
2520
|
...E,
|
|
2500
|
-
children:
|
|
2521
|
+
children: St.map((I) => ({
|
|
2501
2522
|
...I,
|
|
2502
2523
|
account: r.find((P) => P.guid === I.entity_guid),
|
|
2503
2524
|
label: D
|
|
@@ -2506,7 +2527,7 @@ const ut = "PARENT-ENTITY", Pe = (r, t) => ({
|
|
|
2506
2527
|
label: D
|
|
2507
2528
|
});
|
|
2508
2529
|
}
|
|
2509
|
-
return
|
|
2530
|
+
return o;
|
|
2510
2531
|
};
|
|
2511
2532
|
class Fe {
|
|
2512
2533
|
globalStore;
|
|
@@ -2715,7 +2736,7 @@ class Ue {
|
|
|
2715
2736
|
transactionRulesLoaded = !1;
|
|
2716
2737
|
transactionRulesLoading = !1;
|
|
2717
2738
|
transactionSplitting = !1;
|
|
2718
|
-
cachedStartDate = _t(
|
|
2739
|
+
cachedStartDate = _t(y(), 90);
|
|
2719
2740
|
filter = {};
|
|
2720
2741
|
isLoading = !0;
|
|
2721
2742
|
alert = "";
|
|
@@ -2730,7 +2751,7 @@ class Ue {
|
|
|
2730
2751
|
}
|
|
2731
2752
|
loadTransactionData = async () => {
|
|
2732
2753
|
this.globalStore.accountStore.isAccountDataLoaded || await this.globalStore.accountStore.loadAccountData(), this.globalStore.categoryStore.categoriesLoaded || await this.globalStore.categoryStore.loadCategories(), await Promise.all([
|
|
2733
|
-
this.loadAssociatedBeats(
|
|
2754
|
+
this.loadAssociatedBeats(R(/* @__PURE__ */ new Date())),
|
|
2734
2755
|
this.loadTags(),
|
|
2735
2756
|
this.loadTaggings(),
|
|
2736
2757
|
this.loadTransactionRules(),
|
|
@@ -2950,20 +2971,20 @@ class Ue {
|
|
|
2950
2971
|
this.transactionSplitting = !0;
|
|
2951
2972
|
try {
|
|
2952
2973
|
const s = await this.api.updateTransaction(t), a = [];
|
|
2953
|
-
for (let
|
|
2954
|
-
const l = await this.api.addTransaction(e[
|
|
2974
|
+
for (let o = 0; o < e.length; o++) {
|
|
2975
|
+
const l = await this.api.addTransaction(e[o]);
|
|
2955
2976
|
a.push(l);
|
|
2956
2977
|
}
|
|
2957
|
-
const
|
|
2958
|
-
if (
|
|
2959
|
-
const
|
|
2978
|
+
const i = this.transactions.findIndex((o) => o.guid === t.guid);
|
|
2979
|
+
if (i >= 0) {
|
|
2980
|
+
const o = this.transactions.filter(
|
|
2960
2981
|
(l) => l.guid !== t.guid && l.parent_guid !== t.guid
|
|
2961
2982
|
);
|
|
2962
2983
|
this.setTransactions([
|
|
2963
|
-
...
|
|
2984
|
+
...o.slice(0, i),
|
|
2964
2985
|
s,
|
|
2965
2986
|
...a,
|
|
2966
|
-
...
|
|
2987
|
+
...o.slice(i)
|
|
2967
2988
|
]);
|
|
2968
2989
|
}
|
|
2969
2990
|
} catch (s) {
|
|
@@ -2975,19 +2996,19 @@ class Ue {
|
|
|
2975
2996
|
};
|
|
2976
2997
|
unSplitTransaction = async (t) => {
|
|
2977
2998
|
try {
|
|
2978
|
-
const e = this.transactions.filter((
|
|
2999
|
+
const e = this.transactions.filter((i) => i.parent_guid === t);
|
|
2979
3000
|
await this.api.removeTransactionSplit(t);
|
|
2980
3001
|
const s = [...this.transactions];
|
|
2981
|
-
e.forEach((
|
|
2982
|
-
const
|
|
2983
|
-
|
|
3002
|
+
e.forEach((i) => {
|
|
3003
|
+
const o = s.findIndex((l) => l.guid === i.guid);
|
|
3004
|
+
o >= 0 && s.splice(o, 1);
|
|
2984
3005
|
});
|
|
2985
|
-
const a = s.findIndex((
|
|
3006
|
+
const a = s.findIndex((i) => i.guid === t);
|
|
2986
3007
|
c(() => {
|
|
2987
|
-
const
|
|
2988
|
-
|
|
3008
|
+
const i = s[a];
|
|
3009
|
+
i && (i.has_been_split = !1), a >= 0 && this.setTransactions([
|
|
2989
3010
|
...s.slice(0, a),
|
|
2990
|
-
|
|
3011
|
+
i,
|
|
2991
3012
|
...s.slice(a + 1)
|
|
2992
3013
|
]);
|
|
2993
3014
|
});
|
|
@@ -2997,11 +3018,11 @@ class Ue {
|
|
|
2997
3018
|
};
|
|
2998
3019
|
updateTaggings = async (t, e) => {
|
|
2999
3020
|
try {
|
|
3000
|
-
const s = this.taggings.filter((
|
|
3001
|
-
for (const
|
|
3002
|
-
a.has(
|
|
3003
|
-
for (const
|
|
3004
|
-
|
|
3021
|
+
const s = this.taggings.filter((o) => o.transaction_guid === e), a = new Set(s.map((o) => o.tag_guid)), i = new Set(t);
|
|
3022
|
+
for (const o of t)
|
|
3023
|
+
a.has(o) || await this.addTagging(o, e);
|
|
3024
|
+
for (const o of s)
|
|
3025
|
+
i.has(o.tag_guid) || await this.removeTagging(o.guid);
|
|
3005
3026
|
await this.loadTaggings();
|
|
3006
3027
|
} catch (s) {
|
|
3007
3028
|
console.error("Error occurred while updating taggings:", s), this.globalStore.captureException(s, { store: "TransactionStore" });
|
|
@@ -3040,7 +3061,7 @@ class Ue {
|
|
|
3040
3061
|
};
|
|
3041
3062
|
}
|
|
3042
3063
|
class ke {
|
|
3043
|
-
beginDate =
|
|
3064
|
+
beginDate = R(/* @__PURE__ */ new Date());
|
|
3044
3065
|
endDate = b(/* @__PURE__ */ new Date());
|
|
3045
3066
|
expandedSplits = [];
|
|
3046
3067
|
height = 550;
|
|
@@ -3168,10 +3189,10 @@ class We {
|
|
|
3168
3189
|
export {
|
|
3169
3190
|
M as A,
|
|
3170
3191
|
X as B,
|
|
3171
|
-
|
|
3192
|
+
fe as C,
|
|
3172
3193
|
be as D,
|
|
3173
3194
|
tt as F,
|
|
3174
|
-
|
|
3195
|
+
Ce as G,
|
|
3175
3196
|
st as H,
|
|
3176
3197
|
rt as M,
|
|
3177
3198
|
Be as N,
|
|
@@ -3188,11 +3209,11 @@ export {
|
|
|
3188
3209
|
J as f,
|
|
3189
3210
|
_e as g,
|
|
3190
3211
|
Z as h,
|
|
3191
|
-
|
|
3212
|
+
Se as i,
|
|
3192
3213
|
Te as j,
|
|
3193
3214
|
Ie as k,
|
|
3194
3215
|
Ns as l,
|
|
3195
|
-
|
|
3216
|
+
Re as m,
|
|
3196
3217
|
et as n,
|
|
3197
3218
|
De as o,
|
|
3198
3219
|
ve as p,
|
|
@@ -3207,4 +3228,4 @@ export {
|
|
|
3207
3228
|
He as y,
|
|
3208
3229
|
We as z
|
|
3209
3230
|
};
|
|
3210
|
-
//# sourceMappingURL=UserStore-
|
|
3231
|
+
//# sourceMappingURL=UserStore-CgsAunf1.mjs.map
|