@mx-cartographer/experiences 7.2.15-alpha.sms2 → 7.2.15-alpha.sms21

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.
@@ -4,31 +4,31 @@ import U from "@mui/material/FormControlLabel";
4
4
  import K from "@mui/material/Radio";
5
5
  import V from "@mui/material/styles/useTheme";
6
6
  import v from "@mui/material/Tooltip";
7
- import { makeAutoObservable as y, runInAction as d } from "mobx";
7
+ import { makeAutoObservable as y, autorun as B, runInAction as d } from "mobx";
8
8
  import { endOfToday as D } from "date-fns/endOfToday";
9
- import { formatISO as B } from "date-fns/formatISO";
10
- import { fromUnixTime as h } from "date-fns/fromUnixTime";
11
- import { getUnixTime as u } from "date-fns/getUnixTime";
12
- import { isBefore as Y } from "date-fns/isBefore";
9
+ import { formatISO as Y } from "date-fns/formatISO";
10
+ import { fromUnixTime as u } from "date-fns/fromUnixTime";
11
+ import { getUnixTime as h } from "date-fns/getUnixTime";
12
+ import { isBefore as F } from "date-fns/isBefore";
13
13
  import { startOfMonth as R } from "date-fns/startOfMonth";
14
14
  import { startOfToday as b } from "date-fns/startOfToday";
15
- import { subDays as F } from "date-fns/subDays";
15
+ import { subDays as W } from "date-fns/subDays";
16
16
  import { O as n, a as G, T as w } from "./User-BQUxBeZV.mjs";
17
17
  import { T as p } from "./TransactionApi-B3Tksf7L.mjs";
18
- import { b as W } from "./Category-CevNQ03n.mjs";
19
- import { f as z } from "./exportTransactionsToCSV-7bVS7KXf.mjs";
20
- import { format as k } from "date-fns/format";
21
- import { f as g, D as O, O as $ } from "./Dialog-CWW597AF.mjs";
22
- import { endOfMonth as X } from "date-fns/endOfMonth";
18
+ import { b as z } from "./Category-CevNQ03n.mjs";
19
+ import { f as k } from "./exportTransactionsToCSV-7bVS7KXf.mjs";
20
+ import { format as $ } from "date-fns/format";
21
+ import { f as g, D as O, O as X } from "./Dialog-CWW597AF.mjs";
22
+ import { endOfMonth as j } from "date-fns/endOfMonth";
23
23
  import { B as f } from "./BeatApi-DhJpgCLz.mjs";
24
- const j = ({
24
+ const Z = ({
25
25
  checked: l = !1,
26
26
  label: t,
27
27
  sx: a = {},
28
28
  tooltip: e = "",
29
29
  value: c
30
30
  }) => {
31
- const _ = V(), i = _.palette.mode === "light" ? _.palette.grey[400] : _.palette.grey[700], A = l ? _.palette.action.active : i;
31
+ const _ = V(), s = _.palette.mode === "light" ? _.palette.grey[400] : _.palette.grey[700], A = l ? _.palette.action.active : s;
32
32
  return /* @__PURE__ */ C(
33
33
  P,
34
34
  {
@@ -59,7 +59,7 @@ const j = ({
59
59
  ) })
60
60
  }
61
61
  );
62
- }, ft = j, x = {
62
+ }, mt = Z, x = {
63
63
  ASC: "ASC",
64
64
  DESC: "DESC",
65
65
  DIRECTION: {
@@ -71,7 +71,7 @@ const j = ({
71
71
  left: "flex-start",
72
72
  right: "flex-end"
73
73
  }
74
- }, T = {
74
+ }, o = {
75
75
  ADD: "Add",
76
76
  ADD_CATEGORY: "Add Category",
77
77
  CHANGE_CATEGORY: "Change Category",
@@ -85,7 +85,7 @@ const j = ({
85
85
  SELECT: "Select",
86
86
  UNHIDE: "Unhide",
87
87
  UNSPLIT: "Unsplit"
88
- }, o = {
88
+ }, T = {
89
89
  TRANSACTION_DETAILS: "Transaction Details",
90
90
  TRANSACTIONS_LIST: "Transactions List",
91
91
  TRANSACTIONS_WIDGET: "Transactions Widget"
@@ -111,227 +111,227 @@ const j = ({
111
111
  }, m = {
112
112
  // splits
113
113
  [n.ON_TRANSACTION_SPLIT_CLICK]: {
114
- action: T.SELECT,
115
- category: o.TRANSACTION_DETAILS,
114
+ action: o.SELECT,
115
+ category: T.TRANSACTION_DETAILS,
116
116
  label: r.SPLITS
117
117
  },
118
118
  [n.ON_TRANSACTION_SPLIT_CATEGORY_CLICK]: {
119
- action: T.ADD_CATEGORY,
120
- category: o.TRANSACTION_DETAILS,
119
+ action: o.ADD_CATEGORY,
120
+ category: T.TRANSACTION_DETAILS,
121
121
  label: r.SPLITS
122
122
  },
123
123
  [n.ON_TRANSACTION_SPLIT_DELETE_CLICK]: {
124
- action: T.DELETE,
125
- category: o.TRANSACTION_DETAILS,
124
+ action: o.DELETE,
125
+ category: T.TRANSACTION_DETAILS,
126
126
  label: r.SPLITS
127
127
  },
128
128
  [n.ON_TRANSACTION_SPLIT_SAVE_CLICK]: {
129
- action: T.SPLIT,
130
- category: o.TRANSACTION_DETAILS,
129
+ action: o.SPLIT,
130
+ category: T.TRANSACTION_DETAILS,
131
131
  label: r.SPLITS
132
132
  },
133
133
  [n.ON_TRANSACTION_UNSPLIT]: {
134
- action: T.UNSPLIT,
135
- category: o.TRANSACTION_DETAILS,
134
+ action: o.UNSPLIT,
135
+ category: T.TRANSACTION_DETAILS,
136
136
  label: r.SPLITS
137
137
  },
138
138
  // category
139
139
  [n.ON_TRANSACTION_CATEGORY_CLICK]: {
140
- action: T.SELECT,
141
- category: o.TRANSACTIONS_LIST,
140
+ action: o.SELECT,
141
+ category: T.TRANSACTIONS_LIST,
142
142
  label: r.CATEGORY
143
143
  },
144
144
  [n.ON_TRANSACTION_CATEGORY_CHANGED]: {
145
- action: T.CHANGE_CATEGORY,
146
- category: o.TRANSACTION_DETAILS,
145
+ action: o.CHANGE_CATEGORY,
146
+ category: T.TRANSACTION_DETAILS,
147
147
  label: r.CATEGORY
148
148
  },
149
149
  // date
150
150
  [n.ON_TRANSACTION_DATE_CHANGED]: {
151
- action: T.SAVE,
152
- category: o.TRANSACTION_DETAILS,
151
+ action: o.SAVE,
152
+ category: T.TRANSACTION_DETAILS,
153
153
  label: r.DATE
154
154
  },
155
155
  [n.ON_TRANSACTION_DATE_CLICK]: {
156
- action: T.SELECT,
157
- category: o.TRANSACTION_DETAILS,
156
+ action: o.SELECT,
157
+ category: T.TRANSACTION_DETAILS,
158
158
  label: r.DATE
159
159
  },
160
160
  // merchant logo
161
161
  [n.ON_TRANSACTION_DELETE_LOGO_CANCEL]: {
162
- action: T.CLOSE,
163
- category: o.TRANSACTION_DETAILS,
162
+ action: o.CLOSE,
163
+ category: T.TRANSACTION_DETAILS,
164
164
  label: r.DELETE_MERCHANT_LOGO
165
165
  },
166
166
  [n.ON_TRANSACTION_DELETE_LOGO_CLICK]: {
167
- action: T.SELECT,
168
- category: o.TRANSACTION_DETAILS,
167
+ action: o.SELECT,
168
+ category: T.TRANSACTION_DETAILS,
169
169
  label: r.DELETE_MERCHANT_LOGO
170
170
  },
171
171
  [n.ON_TRANSACTION_DELETE_LOGO_DELETED]: {
172
- action: T.DELETE,
173
- category: o.TRANSACTION_DETAILS,
172
+ action: o.DELETE,
173
+ category: T.TRANSACTION_DETAILS,
174
174
  label: r.DELETE_MERCHANT_LOGO
175
175
  },
176
176
  // description
177
177
  [n.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK]: {
178
- action: T.EDIT,
179
- category: o.TRANSACTION_DETAILS,
178
+ action: o.EDIT,
179
+ category: T.TRANSACTION_DETAILS,
180
180
  label: r.DESCRIPTION
181
181
  },
182
182
  [n.ON_TRANSACTION_DESCRIPTION_SAVE_CLICK]: {
183
- action: T.SAVE,
184
- category: o.TRANSACTION_DETAILS,
183
+ action: o.SAVE,
184
+ category: T.TRANSACTION_DETAILS,
185
185
  label: r.DESCRIPTION
186
186
  },
187
187
  // hide transactions
188
188
  [n.ON_TRANSACTION_HIDDEN]: {
189
- action: T.SAVE,
190
- category: o.TRANSACTION_DETAILS,
189
+ action: o.SAVE,
190
+ category: T.TRANSACTION_DETAILS,
191
191
  label: r.HIDE_TRANSACTION
192
192
  },
193
193
  [n.ON_TRANSACTION_HIDE_CLICK]: {
194
- action: T.SELECT,
195
- category: o.TRANSACTION_DETAILS,
194
+ action: o.SELECT,
195
+ category: T.TRANSACTION_DETAILS,
196
196
  label: r.HIDE_TRANSACTION
197
197
  },
198
198
  [n.ON_TRANSACTION_HIDE_CANCEL_CLICK]: {
199
- action: T.CLOSE,
200
- category: o.TRANSACTION_DETAILS,
199
+ action: o.CLOSE,
200
+ category: T.TRANSACTION_DETAILS,
201
201
  label: r.HIDE_TRANSACTION
202
202
  },
203
203
  // transaction list
204
204
  [n.ON_TRANSACTION_LIST_ITEM_CLICK]: {
205
- action: T.SELECT,
206
- category: o.TRANSACTIONS_LIST,
205
+ action: o.SELECT,
206
+ category: T.TRANSACTIONS_LIST,
207
207
  label: r.TRANSACTION
208
208
  },
209
209
  // memo
210
210
  [n.ON_TRANSACTION_MEMO_CHANGED]: {
211
- action: T.SAVE,
212
- category: o.TRANSACTION_DETAILS,
211
+ action: o.SAVE,
212
+ category: T.TRANSACTION_DETAILS,
213
213
  label: r.MEMO
214
214
  },
215
215
  [n.ON_TRANSACTION_MEMO_CLICK]: {
216
- action: T.SELECT,
217
- category: o.TRANSACTION_DETAILS,
216
+ action: o.SELECT,
217
+ category: T.TRANSACTION_DETAILS,
218
218
  label: r.MEMO
219
219
  },
220
220
  // tags
221
221
  [n.ON_TRANSACTION_TAGS_CHANGED]: {
222
- action: T.SAVE,
223
- category: o.TRANSACTION_DETAILS,
222
+ action: o.SAVE,
223
+ category: T.TRANSACTION_DETAILS,
224
224
  label: r.TAGS
225
225
  },
226
226
  [n.ON_TRANSACTION_TAGS_CLICK]: {
227
- action: T.SELECT,
228
- category: o.TRANSACTION_DETAILS,
227
+ action: o.SELECT,
228
+ category: T.TRANSACTION_DETAILS,
229
229
  label: r.TAGS
230
230
  },
231
231
  [n.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK]: {
232
- action: T.CLOSE,
233
- category: o.TRANSACTION_DETAILS,
232
+ action: o.CLOSE,
233
+ category: T.TRANSACTION_DETAILS,
234
234
  label: r.TAGS
235
235
  },
236
236
  [n.ON_TRANSACTION_TAGS_TAG_ADD_CLICK]: {
237
- action: T.ADD,
238
- category: o.TRANSACTION_DETAILS,
237
+ action: o.ADD,
238
+ category: T.TRANSACTION_DETAILS,
239
239
  label: r.TAG_ADD
240
240
  },
241
241
  [n.ON_TRANSACTION_TAGS_TAG_ADDED]: {
242
- action: T.SAVE,
243
- category: o.TRANSACTION_DETAILS,
242
+ action: o.SAVE,
243
+ category: T.TRANSACTION_DETAILS,
244
244
  label: r.TAG_ADD
245
245
  },
246
246
  [n.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK]: {
247
- action: T.SELECT,
248
- category: o.TRANSACTION_DETAILS,
247
+ action: o.SELECT,
248
+ category: T.TRANSACTION_DETAILS,
249
249
  label: r.TAG_DELETE
250
250
  },
251
251
  [n.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK]: {
252
- action: T.CLOSE,
253
- category: o.TRANSACTION_DETAILS,
252
+ action: o.CLOSE,
253
+ category: T.TRANSACTION_DETAILS,
254
254
  label: r.TAG_DELETE
255
255
  },
256
256
  [n.ON_TRANSACTION_TAGS_TAG_DELETED]: {
257
- action: T.SAVE,
258
- category: o.TRANSACTION_DETAILS,
257
+ action: o.SAVE,
258
+ category: T.TRANSACTION_DETAILS,
259
259
  label: r.TAG_DELETE
260
260
  },
261
261
  [n.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK]: {
262
- action: T.EDIT,
263
- category: o.TRANSACTION_DETAILS,
262
+ action: o.EDIT,
263
+ category: T.TRANSACTION_DETAILS,
264
264
  label: r.TAG_EDIT
265
265
  },
266
266
  [n.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED]: {
267
- action: T.SAVE,
268
- category: o.TRANSACTION_DETAILS,
267
+ action: o.SAVE,
268
+ category: T.TRANSACTION_DETAILS,
269
269
  label: r.TAG_EDIT
270
270
  },
271
271
  // flag
272
272
  [n.ON_TRANSACTION_TOGGLE_FLAG_CLICK]: {
273
- action: T.SELECT,
274
- category: o.TRANSACTION_DETAILS,
273
+ action: o.SELECT,
274
+ category: T.TRANSACTION_DETAILS,
275
275
  label: r.FLAG
276
276
  },
277
277
  // hide
278
278
  [n.ON_TRANSACTION_UNHIDDEN]: {
279
- action: T.SAVE,
280
- category: o.TRANSACTION_DETAILS,
279
+ action: o.SAVE,
280
+ category: T.TRANSACTION_DETAILS,
281
281
  label: r.UNHIDE_TRANSACTION
282
282
  },
283
283
  [n.ON_TRANSACTION_UNHIDE_CLICK]: {
284
- action: T.SELECT,
285
- category: o.TRANSACTION_DETAILS,
284
+ action: o.SELECT,
285
+ category: T.TRANSACTION_DETAILS,
286
286
  label: r.UNHIDE_TRANSACTION
287
287
  },
288
288
  [n.ON_TRANSACTION_UNHIDE_CANCEL_CLICK]: {
289
- action: T.CLOSE,
290
- category: o.TRANSACTION_DETAILS,
289
+ action: o.CLOSE,
290
+ category: T.TRANSACTION_DETAILS,
291
291
  label: r.UNHIDE_TRANSACTION
292
292
  },
293
293
  // export CSV
294
294
  [n.ON_TRANSACTION_EXPORT_CSV_CLICK]: {
295
- action: T.SELECT,
296
- category: o.TRANSACTIONS_WIDGET,
295
+ action: o.SELECT,
296
+ category: T.TRANSACTIONS_WIDGET,
297
297
  label: r.EXPORT_CSV
298
298
  },
299
299
  // add transaction
300
300
  [n.ON_TRANSACTION_MANUAL_ADD_CLICK]: {
301
- action: T.SELECT,
302
- category: o.TRANSACTIONS_WIDGET,
301
+ action: o.SELECT,
302
+ category: T.TRANSACTIONS_WIDGET,
303
303
  label: r.ADD_TRANSACTION
304
304
  },
305
305
  [n.ON_TRANSACTION_MANUAL_ADD_ADDED]: {
306
- action: T.ADD,
307
- category: o.TRANSACTIONS_WIDGET,
306
+ action: o.ADD,
307
+ category: T.TRANSACTIONS_WIDGET,
308
308
  label: r.ADD_TRANSACTION
309
309
  },
310
310
  [n.ON_TRANSACTION_DELETE_CLICK]: {
311
- action: T.SELECT,
312
- category: o.TRANSACTIONS_WIDGET,
311
+ action: o.SELECT,
312
+ category: T.TRANSACTIONS_WIDGET,
313
313
  label: r.DELETE_TRANSACTION
314
314
  },
315
315
  [n.ON_TRANSACTION_DELETE_CANCEL]: {
316
- action: T.CLOSE,
317
- category: o.TRANSACTIONS_WIDGET,
316
+ action: o.CLOSE,
317
+ category: T.TRANSACTIONS_WIDGET,
318
318
  label: r.DELETE_TRANSACTION
319
319
  },
320
320
  [n.ON_TRANSACTION_DELETE_DELETED]: {
321
- action: T.DELETE,
322
- category: o.TRANSACTIONS_WIDGET,
321
+ action: o.DELETE,
322
+ category: T.TRANSACTIONS_WIDGET,
323
323
  label: r.DELETE_TRANSACTION
324
324
  }
325
- }, Z = async (l, t) => !t || !m[l] ? null : t.sendAnalyticEvent(m[l]), L = {
325
+ }, q = async (l, t) => !t || !m[l] ? null : t.sendAnalyticEvent(m[l]), L = {
326
326
  FLAG: "flag",
327
327
  DATE: "date",
328
328
  PAYEE: "payee",
329
329
  CATEGORY: "category",
330
330
  ACCOUNT: "account",
331
331
  AMOUNT: "amount"
332
- }, q = (l, t, a, e = []) => {
333
- const c = t.reduce((A, s) => ({ ...A, [s.guid]: s }), {}), _ = a.reduce((A, s) => ({ ...A, [s.guid]: s }), {}), i = e.reduce((A, s) => {
334
- const { transaction_guid: N, tag_guid: I } = s;
332
+ }, J = (l, t, a, e = []) => {
333
+ const c = t.reduce((A, i) => ({ ...A, [i.guid]: i }), {}), _ = a.reduce((A, i) => ({ ...A, [i.guid]: i }), {}), s = e.reduce((A, i) => {
334
+ const { transaction_guid: N, tag_guid: I } = i;
335
335
  if (!A[N])
336
336
  return {
337
337
  ...A,
@@ -344,52 +344,52 @@ const j = ({
344
344
  };
345
345
  }, {});
346
346
  return l.map((A) => {
347
- const s = c[A.account_guid], N = A.category_guid ? _[A.category_guid] : null, I = i[A.guid] ?? [];
347
+ const i = c[A.account_guid], N = A.category_guid ? _[A.category_guid] : null, I = s[A.guid] ?? [];
348
348
  return {
349
349
  ...A,
350
- account: s?.user_name || "Unknown",
351
- accountIsClosed: s?.is_closed,
352
- accountIsHidden: s?.is_hidden,
350
+ account: i?.user_name || "Unknown",
351
+ accountIsClosed: i?.is_closed,
352
+ accountIsHidden: i?.is_hidden,
353
353
  category: N?.name || "Uncategorized",
354
- isIncome: A.top_level_category_guid === W.INCOME,
354
+ isIncome: A.top_level_category_guid === z.INCOME,
355
355
  isPending: A.feed_status === G.PENDING,
356
- number: s?.account_number || "",
356
+ number: i?.account_number || "",
357
357
  payee: A.description,
358
358
  tags: I
359
359
  };
360
360
  });
361
- }, J = "uncategorized", Q = (l, t, a, e, c, _) => {
362
- const i = tt(l, c, _), A = at(i, a, e);
363
- return t.forEach((s) => {
364
- const N = A.findIndex((E) => E.guid === s), I = _.filter((E) => E.parent_guid === s);
361
+ }, Q = "uncategorized", tt = (l, t, a, e, c, _) => {
362
+ const s = at(l, c, _), A = et(s, a, e);
363
+ return t.forEach((i) => {
364
+ const N = A.findIndex((E) => E.guid === i), I = _.filter((E) => E.parent_guid === i);
365
365
  A.splice(N + 1, 0, ...I);
366
366
  }), A;
367
- }, tt = (l, t, a) => {
367
+ }, at = (l, t, a) => {
368
368
  const {
369
369
  accounts: e = [],
370
370
  dateRange: c = { start: R(b()), end: D() },
371
371
  custom: _ = () => !0,
372
- searchTerm: i = "",
372
+ searchTerm: s = "",
373
373
  showSplits: A = !1
374
374
  } = l;
375
- return a.filter((s) => A ? !s.has_been_split : !s.parent_guid).filter((s) => !!e.find((N) => N === s.account_guid)).filter((s) => s.date >= u(c.start) && s.date <= u(c.end)).filter(_).filter((s) => {
376
- if (i === J && s.has_been_split)
375
+ return a.filter((i) => A ? !i.has_been_split : !i.parent_guid).filter((i) => !!e.find((N) => N === i.account_guid)).filter((i) => i.date >= h(c.start) && i.date <= h(c.end)).filter(_).filter((i) => {
376
+ if (s === Q && i.has_been_split)
377
377
  return !1;
378
- if (/^spl/i.test(i) && (s.has_been_split || s.parent_guid))
378
+ if (/^spl/i.test(s) && (i.has_been_split || i.parent_guid))
379
379
  return !0;
380
- const I = s.tags.some(
381
- (M) => S(i, t.find((H) => H.guid === M)?.name)
382
- ), E = h(s.date);
383
- return S(i, s.payee) || S(i, s.feed_description) || S(i, s.category) || S(i, g(E, O.MONTH)) || S(i, g(E, O.DAY)) || S(i, g(E, O.FULL_MONTH_DAY)) || S(i, g(E, O.MONTH_DAY_YEAR)) || S(i, k(E, $)) || S(i, s.account) || S(i, `${s.amount}`) || S(i, s.memo) || I;
380
+ const I = i.tags.some(
381
+ (M) => S(s, t.find((H) => H.guid === M)?.name)
382
+ ), E = u(i.date);
383
+ return S(s, i.payee) || S(s, i.feed_description) || S(s, i.category) || S(s, g(E, O.MONTH)) || S(s, g(E, O.DAY)) || S(s, g(E, O.FULL_MONTH_DAY)) || S(s, g(E, O.MONTH_DAY_YEAR)) || S(s, $(E, X)) || S(s, i.account) || S(s, `${i.amount}`) || S(s, i.memo) || I;
384
384
  });
385
- }, at = (l, t, a) => [...l].sort((e, c) => {
386
- const _ = t, i = (e[_] || "") > (c[_] || "");
387
- let A = i ? -1 : 1, s = i ? 1 : -1;
388
- return (t === L.DATE || t === L.AMOUNT) && (A = i ? 1 : -1, s = i ? -1 : 1), a === x.ASC ? A : s;
385
+ }, et = (l, t, a) => [...l].sort((e, c) => {
386
+ const _ = t, s = (e[_] || "") > (c[_] || "");
387
+ let A = s ? -1 : 1, i = s ? 1 : -1;
388
+ return (t === L.DATE || t === L.AMOUNT) && (A = s ? 1 : -1, i = s ? -1 : 1), a === x.ASC ? A : i;
389
389
  }), S = (l, t) => {
390
390
  const a = l.toLowerCase().split(" "), e = t?.toString().toLowerCase() ?? "";
391
391
  return a.every((c) => e.indexOf(c) > -1);
392
- }, et = {
392
+ }, st = {
393
393
  account_guid: "",
394
394
  amount: 0,
395
395
  currency_code: "",
@@ -420,7 +420,7 @@ const j = ({
420
420
  };
421
421
  class it {
422
422
  beginDate = R(/* @__PURE__ */ new Date());
423
- endDate = X(/* @__PURE__ */ new Date());
423
+ endDate = j(/* @__PURE__ */ new Date());
424
424
  expandedSplits = [];
425
425
  isInitialized = !1;
426
426
  height = 550;
@@ -428,7 +428,7 @@ class it {
428
428
  shouldDisableDrawerScroll = !1;
429
429
  searchValue = "";
430
430
  selectedAccountGuids = [];
431
- manualTransaction = et;
431
+ manualTransaction = st;
432
432
  isAmountValid = !1;
433
433
  showInsights = !1;
434
434
  constructor() {
@@ -459,13 +459,13 @@ class it {
459
459
  this.manualTransaction = t;
460
460
  };
461
461
  }
462
- class mt {
462
+ class yt {
463
463
  globalStore;
464
464
  uiStore;
465
465
  api = new p("/", "");
466
466
  beatApi = new f("/", "");
467
467
  associatedBeats = [];
468
- cachedStartDate = F(b(), 90);
468
+ cachedStartDate = W(b(), 90);
469
469
  filter = {};
470
470
  isLoading = !0;
471
471
  rawTransactions = [];
@@ -474,14 +474,28 @@ class mt {
474
474
  taggings = [];
475
475
  tags = [];
476
476
  transactionRules = [];
477
- onAnalyticEvent = Z;
477
+ listeners = [];
478
+ onAnalyticEvent = q;
478
479
  constructor(t) {
479
480
  this.globalStore = t, this.uiStore = new it(), this.api = new p(
480
481
  t.endpoint,
481
482
  t.sessionToken,
482
483
  t.onError
483
- ), this.beatApi = new f(t.endpoint, t.sessionToken, t.onError), y(this);
484
+ ), this.beatApi = new f(t.endpoint, t.sessionToken, t.onError), y(this), B(() => {
485
+ const a = this.transactions;
486
+ return this.emitChange(), a;
487
+ });
484
488
  }
489
+ // begin subscription for external library, ie Pulse
490
+ subscribe = (t) => (this.listeners = [...this.listeners, t], () => {
491
+ this.listeners = this.listeners.filter((a) => a !== t);
492
+ });
493
+ getTransactionsSnapshot = () => this.transactions;
494
+ emitChange = () => {
495
+ for (const t of this.listeners)
496
+ t();
497
+ };
498
+ // end subscription for external library, ie Pulse
485
499
  loadTransactionData = async ({
486
500
  associatedBeats: t,
487
501
  transactionRules: a,
@@ -499,7 +513,7 @@ class mt {
499
513
  });
500
514
  };
501
515
  get sortedTransactions() {
502
- return Q(
516
+ return tt(
503
517
  this.filter,
504
518
  this.uiStore.expandedSplits,
505
519
  this.sortColumn,
@@ -509,7 +523,7 @@ class mt {
509
523
  );
510
524
  }
511
525
  get sortedTransactionsWithSplits() {
512
- return z(this.sortedTransactions, this.transactions);
526
+ return k(this.sortedTransactions, this.transactions);
513
527
  }
514
528
  get transactions() {
515
529
  return this.augmentTransactions(this.rawTransactions);
@@ -545,7 +559,7 @@ class mt {
545
559
  this.globalStore.accountStore.updateAccountBalance(a.account_guid, e);
546
560
  }
547
561
  };
548
- augmentTransactions = (t) => q(
562
+ augmentTransactions = (t) => J(
549
563
  t,
550
564
  this.globalStore.accountStore.visibleAccounts,
551
565
  this.globalStore.categoryStore.categories,
@@ -553,7 +567,7 @@ class mt {
553
567
  );
554
568
  getTransactionData = () => ({});
555
569
  loadAssociatedBeats = async (t, a) => {
556
- const e = t ? B(t, { representation: "date" }) : void 0, c = a ?? await this.beatApi.getBeatsWithAssociatedTransaction(e);
570
+ const e = t ? Y(t, { representation: "date" }) : void 0, c = a ?? await this.beatApi.getBeatsWithAssociatedTransaction(e);
557
571
  d(() => this.associatedBeats = c);
558
572
  };
559
573
  loadTags = async () => {
@@ -571,7 +585,7 @@ class mt {
571
585
  loadTransactions = async (t = this.cachedStartDate, a = D(), e) => {
572
586
  this.setIsLoading(!0), this.rawTransactions = [];
573
587
  try {
574
- const c = e ?? await this.api.getTransactionsByDateRange(u(t), u(a));
588
+ const c = e ?? await this.api.getTransactionsByDateRange(h(t), h(a));
575
589
  d(() => {
576
590
  this.rawTransactions = c;
577
591
  });
@@ -584,7 +598,7 @@ class mt {
584
598
  loadTransactionsByDateRange = async (t, a) => {
585
599
  console.warn("DEPRECATED: loadTransactionsByDateRange will be removed"), this.setFilter({
586
600
  ...this.filter,
587
- dateRange: { start: h(a), end: h(t) }
601
+ dateRange: { start: u(a), end: u(t) }
588
602
  });
589
603
  };
590
604
  modifyTransactionByAccountGuid = (t, a) => {
@@ -607,7 +621,7 @@ class mt {
607
621
  }
608
622
  };
609
623
  setFilter = (t) => {
610
- this.filter = t, t.dateRange && Y(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start, D()).then(() => {
624
+ this.filter = t, t.dateRange && F(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start, D()).then(() => {
611
625
  t.dateRange && (this.cachedStartDate = t.dateRange.start);
612
626
  });
613
627
  };
@@ -617,11 +631,11 @@ class mt {
617
631
  };
618
632
  splitTransaction = async (t, a) => {
619
633
  const e = await this.api.updateTransaction(t), c = [];
620
- for (let i = 0; i < a.length; i++) {
621
- const A = await this.api.addTransaction(a[i]);
634
+ for (let s = 0; s < a.length; s++) {
635
+ const A = await this.api.addTransaction(a[s]);
622
636
  c.push(A);
623
637
  }
624
- const _ = this.transactions.findIndex((i) => i.guid === t.guid);
638
+ const _ = this.transactions.findIndex((s) => s.guid === t.guid);
625
639
  _ >= 0 && d(
626
640
  () => this.rawTransactions = [
627
641
  ...this.transactions.slice(0, _),
@@ -632,14 +646,14 @@ class mt {
632
646
  );
633
647
  };
634
648
  unSplitTransaction = async (t) => {
635
- const a = this.transactions.filter((i) => i.parent_guid === t);
649
+ const a = this.transactions.filter((s) => s.parent_guid === t);
636
650
  await this.api.removeTransactionSplit(t);
637
651
  const e = [...this.transactions];
638
- a.forEach((i) => {
639
- const A = e.findIndex((s) => s.guid === i.guid);
652
+ a.forEach((s) => {
653
+ const A = e.findIndex((i) => i.guid === s.guid);
640
654
  A >= 0 && e.splice(A, 1);
641
655
  });
642
- const c = e.findIndex((i) => i.guid === t), _ = e[c];
656
+ const c = e.findIndex((s) => s.guid === t), _ = e[c];
643
657
  _.has_been_split = !1, c >= 0 && d(
644
658
  () => this.rawTransactions = [
645
659
  ...e.slice(0, c),
@@ -649,11 +663,11 @@ class mt {
649
663
  );
650
664
  };
651
665
  updateTaggings = async (t, a) => {
652
- const e = this.taggings.filter((i) => i.transaction_guid === a), c = new Set(e.map((i) => i.tag_guid)), _ = new Set(t);
653
- for (const i of t)
654
- c.has(i) || await this.addTagging(i, a);
655
- for (const i of e)
656
- _.has(i.tag_guid) || await this.removeTagging(i.guid);
666
+ const e = this.taggings.filter((s) => s.transaction_guid === a), c = new Set(e.map((s) => s.tag_guid)), _ = new Set(t);
667
+ for (const s of t)
668
+ c.has(s) || await this.addTagging(s, a);
669
+ for (const s of e)
670
+ _.has(s.tag_guid) || await this.removeTagging(s.guid);
657
671
  await this.loadTaggings();
658
672
  };
659
673
  updateTag = async (t) => {
@@ -661,17 +675,17 @@ class mt {
661
675
  };
662
676
  updateTransaction = async (t) => {
663
677
  const a = await this.api.updateTransaction(t), e = this.transactions.findIndex((c) => c.guid === t.guid);
664
- console.log("updateTransaction ran 1", e), e >= 0 && (console.log("updateTransaction ran 2", e), d(
678
+ e >= 0 && d(
665
679
  () => this.rawTransactions = [
666
680
  ...this.transactions.slice(0, e),
667
681
  a,
668
682
  ...this.transactions.slice(e + 1)
669
683
  ]
670
- ));
684
+ );
671
685
  };
672
686
  }
673
687
  export {
674
- et as D,
675
- ft as S,
676
- mt as T
688
+ st as D,
689
+ mt as S,
690
+ yt as T
677
691
  };
@@ -7,8 +7,8 @@ import E from "@mui/material/List";
7
7
  import O from "@mui/material/ListSubheader";
8
8
  import _ from "@mui/system/Stack";
9
9
  import { Text as v } from "@mxenabled/mxui";
10
- import { A as K } from "../AccountDetailsContent-Vj4LO6cx.mjs";
11
- import { u as D1 } from "../AccountDetailsContent-Vj4LO6cx.mjs";
10
+ import { A as K } from "../AccountDetailsContent-CoXcIoZf.mjs";
11
+ import { u as D1 } from "../AccountDetailsContent-CoXcIoZf.mjs";
12
12
  import { u as z, A as P } from "../AccountDetailsHeader-Df1JkzYi.mjs";
13
13
  import { A as W } from "../AccountListItem-CeY_WIpj.mjs";
14
14
  import { a as Y } from "../AccountFields-DUToRRqW.mjs";