@mx-cartographer/experiences 7.8.2-alpha.bb5 → 7.8.2-alpha.bb6

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.
@@ -1,62 +1,62 @@
1
- import { T as Aa } from "../TransactionApi-CjBoLleL.mjs";
2
- import { u as R, C as Me, D as Re, M as Be, c as He, T as Pe, a as $e } from "../TransactionDetails-BDhz3DLT.mjs";
3
- import { B as wa, d as xa, b as Ia } from "../TransactionDetails-BDhz3DLT.mjs";
1
+ import { T as ba } from "../TransactionApi-CjBoLleL.mjs";
2
+ import { u as R, C as Le, D as Me, M as Re, c as He, T as Pe, a as Be } from "../TransactionDetails-BDhz3DLT.mjs";
3
+ import { B as Sa, d as xa, b as wa } from "../TransactionDetails-BDhz3DLT.mjs";
4
4
  import { T as E } from "../User-B0LnmiKO.mjs";
5
- import { O as va } from "../User-B0LnmiKO.mjs";
6
- import { S as ee, D as Ve } from "../TransactionStore-DcBF3oIZ.mjs";
7
- import { T as Ea } from "../TransactionStore-DcBF3oIZ.mjs";
8
- import { e as Ue } from "../exportTransactionsToCSV-DtQ7ovAR.mjs";
9
- import { E as ka } from "../ExportCsvAction-CDuzTva1.mjs";
5
+ import { O as Da } from "../User-B0LnmiKO.mjs";
6
+ import { S as Z, D as $e } from "../TransactionStore-DcBF3oIZ.mjs";
7
+ import { T as Na } from "../TransactionStore-DcBF3oIZ.mjs";
8
+ import { e as Ve } from "../exportTransactionsToCSV-DtQ7ovAR.mjs";
9
+ import { E as Oa } from "../ExportCsvAction-CDuzTva1.mjs";
10
10
  import { jsxs as _, jsx as e } from "react/jsx-runtime";
11
11
  import m from "react";
12
- import { observer as x } from "mobx-react-lite";
12
+ import { observer as w } from "mobx-react-lite";
13
13
  import We from "@mui/material/Paper";
14
- import { DataGridPro as Fe } from "@mui/x-data-grid-pro";
14
+ import { DataGridPro as Ue } from "@mui/x-data-grid-pro";
15
15
  import S from "@mui/material/Box";
16
- import { useTheme as Ge } from "@mui/material/styles";
17
- import { Text as y, Icon as M, MerchantLogo as Ke, TextField as te, P as ze } from "@mxenabled/mxui";
18
- import { h as B, u as I, b as z, d as oe, m as qe, a as je, g as Xe, o as Ye } from "../hooks-ZMp65DFz.mjs";
19
- import { fromUnixTime as Je } from "date-fns/fromUnixTime";
20
- import { f as Qe, D as Ze, a as re } from "../Dialog-B4PI-_bL.mjs";
21
- import w from "@mui/material/Stack";
22
- import { f as se } from "../NumberFormatting-DjTD0t3W.mjs";
23
- import { L as q } from "../Loader-DUaFpDGv.mjs";
24
- import { endOfMonth as et } from "date-fns/endOfMonth";
25
- import { getUnixTime as tt } from "date-fns/getUnixTime";
26
- import { startOfMonth as at } from "date-fns/startOfMonth";
27
- import { startOfToday as G } from "date-fns/startOfToday";
28
- import nt from "@mui/material/styles/useTheme";
29
- import { b as ot } from "../GlobalAccountFilter-DQCPNc95.mjs";
30
- import rt from "@mui/material/Divider";
31
- import st from "@mui/material/MenuItem";
16
+ import { useTheme as Fe } from "@mui/material/styles";
17
+ import { Text as y, Icon as M, MerchantLogo as Ge, TextField as ee, P as Ke } from "@mxenabled/mxui";
18
+ import { h as H, u as I, b as K, d as ne, m as ze, a as qe, g as je, o as Xe } from "../hooks-ZMp65DFz.mjs";
19
+ import { fromUnixTime as Ye } from "date-fns/fromUnixTime";
20
+ import { f as Je, D as Qe, a as oe } from "../Dialog-B4PI-_bL.mjs";
21
+ import x from "@mui/material/Stack";
22
+ import { f as re } from "../NumberFormatting-DjTD0t3W.mjs";
23
+ import { L as z } from "../Loader-DUaFpDGv.mjs";
24
+ import { endOfMonth as Ze } from "date-fns/endOfMonth";
25
+ import { getUnixTime as et } from "date-fns/getUnixTime";
26
+ import { startOfMonth as tt } from "date-fns/startOfMonth";
27
+ import { startOfToday as F } from "date-fns/startOfToday";
28
+ import at from "@mui/material/styles/useTheme";
29
+ import { b as nt } from "../GlobalAccountFilter-DQCPNc95.mjs";
30
+ import ot from "@mui/material/Divider";
31
+ import rt from "@mui/material/MenuItem";
32
32
  import it from "@mui/material/RadioGroup";
33
- import { ExpandMore as ct } from "@mxenabled/mx-icons";
34
- import { C as lt } from "../CurrencyInput-itK0R3wV.mjs";
35
- import { a as dt, u as ut } from "../CategorySelectorDrawer-cQKX5dZb.mjs";
36
- import { b as K } from "../Localization-2MODESHW.mjs";
37
- import { u as mt } from "../useAriaLive-B3_pRUio.mjs";
38
- import { S as _t } from "../SkeletonLoader-BaNboJjD.mjs";
39
- import { A, W as pt } from "../WidgetContainer-BbPS3Yxz.mjs";
40
- import { u as gt } from "../useScreenSize-B6JyS_Lj.mjs";
41
- import { u as ht } from "../useWidgetLoadTimer-hIOioiKx.mjs";
42
- import { S as ft } from "../SearchBox-B2_zLv8-.mjs";
43
- import { D as ae } from "../Drawer-DV4NTsFg.mjs";
44
- const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small", children: [
33
+ import { ExpandMore as st } from "@mxenabled/mx-icons";
34
+ import { C as ct } from "../CurrencyInput-itK0R3wV.mjs";
35
+ import { a as lt, u as dt } from "../CategorySelectorDrawer-cQKX5dZb.mjs";
36
+ import { b as G } from "../Localization-2MODESHW.mjs";
37
+ import { u as ut } from "../useAriaLive-B3_pRUio.mjs";
38
+ import { S as mt } from "../SkeletonLoader-BaNboJjD.mjs";
39
+ import { A, W as _t } from "../WidgetContainer-BbPS3Yxz.mjs";
40
+ import { u as pt } from "../useScreenSize-B6JyS_Lj.mjs";
41
+ import { u as gt } from "../useWidgetLoadTimer-hIOioiKx.mjs";
42
+ import { S as ht } from "../SearchBox-B2_zLv8-.mjs";
43
+ import { D as te } from "../Drawer-DV4NTsFg.mjs";
44
+ const ft = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small", children: [
45
45
  `${t.row.account}`,
46
46
  t.row.number && ` | ${t.row.number}`
47
- ] }), yt = (t) => {
48
- const { associatedBeats: s } = B(), { showInsights: o } = R(), { amount: a, transaction_type: l } = t.row, i = s.find((h) => h.associated_transaction_guid === t.row.guid), c = l === E.CREDIT;
49
- return /* @__PURE__ */ _(w, { alignItems: "flex-end", tabIndex: t.tabIndex, children: [
47
+ ] }), Ct = (t) => {
48
+ const { associatedBeats: r } = H(), { showInsights: o } = R(), { amount: a, transaction_type: l } = t.row, s = r.find((h) => h.associated_transaction_guid === t.row.guid), c = l === E.CREDIT;
49
+ return /* @__PURE__ */ _(x, { alignItems: "flex-end", tabIndex: t.tabIndex, children: [
50
50
  /* @__PURE__ */ _(y, { color: c ? "success.main" : "text.primary", variant: "Small", children: [
51
51
  c ? "+" : "",
52
- se(a, "0,0.00")
52
+ re(a, "0,0.00")
53
53
  ] }),
54
- i && o && /* @__PURE__ */ e(y, { bold: !0, color: "primary.light", variant: "XSmall", children: i.short_title })
54
+ s && o && /* @__PURE__ */ e(y, { bold: !0, color: "primary.light", variant: "XSmall", children: s.short_title })
55
55
  ] });
56
- }, Tt = (t) => {
57
- const { transactions: s } = I(), [o, a] = m.useState(!1);
56
+ }, yt = (t) => {
57
+ const { transactions: r } = I(), [o, a] = m.useState(!1);
58
58
  return /* @__PURE__ */ _(
59
- w,
59
+ x,
60
60
  {
61
61
  alignItems: "center",
62
62
  direction: "row",
@@ -67,13 +67,13 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
67
67
  width: "100%",
68
68
  children: [
69
69
  t.row.has_been_split && /* @__PURE__ */ e(M, { name: "call_split", size: 16 }),
70
- /* @__PURE__ */ e(y, { tabIndex: t.tabIndex, variant: "Small", children: t.row.has_been_split ? s.split_transaction_category_label : t.row.category }),
70
+ /* @__PURE__ */ e(y, { tabIndex: t.tabIndex, variant: "Small", children: t.row.has_been_split ? r.split_transaction_category_label : t.row.category }),
71
71
  !t.row.has_been_split && o && /* @__PURE__ */ e(M, { name: "edit", sx: { color: "action.active" } })
72
72
  ]
73
73
  }
74
74
  );
75
- }, bt = x(Tt), At = (t) => /* @__PURE__ */ e(y, { tabIndex: t.tabIndex, variant: "Small", children: Qe(Je(t.row.date), Ze.MONTH_DAY) }), St = (t) => {
76
- const s = Ge(), { transactions: o } = I(), { is_flagged: a, is_hidden: l, has_been_viewed: i, parent_guid: c } = t.row, f = !i && !!!c;
75
+ }, Tt = w(yt), bt = (t) => /* @__PURE__ */ e(y, { tabIndex: t.tabIndex, variant: "Small", children: Je(Ye(t.row.date), Qe.MONTH_DAY) }), At = (t) => {
76
+ const r = Fe(), { transactions: o } = I(), { is_flagged: a, is_hidden: l, has_been_viewed: s, parent_guid: c } = t.row, f = !s && !!!c;
77
77
  return /* @__PURE__ */ _(
78
78
  S,
79
79
  {
@@ -89,7 +89,7 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
89
89
  style: {
90
90
  display: "inline-block",
91
91
  height: 16,
92
- fill: s.palette.primary.light,
92
+ fill: r.palette.primary.light,
93
93
  verticalAlign: "middle",
94
94
  width: 16
95
95
  },
@@ -100,34 +100,34 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
100
100
  ]
101
101
  }
102
102
  );
103
- }, wt = x(St), N = (t) => /* @__PURE__ */ e(y, { fontWeight: 600, variant: "Small", children: t.colDef.headerName }), xt = (t) => /* @__PURE__ */ _(w, { alignItems: "center", direction: "row", gap: 8, children: [
103
+ }, St = w(At), N = (t) => /* @__PURE__ */ e(y, { fontWeight: 600, variant: "Small", children: t.colDef.headerName }), xt = (t) => /* @__PURE__ */ _(x, { alignItems: "center", direction: "row", gap: 8, children: [
104
104
  /* @__PURE__ */ e(
105
- Ke,
105
+ Ge,
106
106
  {
107
107
  categoryGuid: t.row.top_level_category_guid || "",
108
108
  merchantGuid: t.row.merchant_guid || ""
109
109
  }
110
110
  ),
111
111
  /* @__PURE__ */ e(y, { tabIndex: t.tabIndex, variant: "Small", children: t.row.payee })
112
- ] }), It = ({
112
+ ] }), wt = ({
113
113
  height: t = "100dvh",
114
- onCategoryClick: s,
114
+ onCategoryClick: r,
115
115
  onRowClick: o
116
116
  }) => {
117
- const { transactions: a } = I(), { isCopyLoaded: l } = z(), { isLoading: i, sortedTransactions: c } = B(), { clearExpandedSplits: h, toggleSplit: f } = R();
117
+ const { transactions: a } = I(), { isCopyLoaded: l } = K(), { isLoading: s, sortedTransactions: c } = H(), { clearExpandedSplits: h, toggleSplit: f } = R();
118
118
  m.useEffect(() => () => h(), []);
119
119
  const C = m.useMemo(
120
- () => c.map((r) => ({
121
- id: r.guid,
120
+ () => c.map((i) => ({
121
+ id: i.guid,
122
122
  isHovering: !1,
123
- ...r
123
+ ...i
124
124
  })),
125
125
  [c]
126
- ), d = ({ row: { id: r, guid: g, has_been_split: v }, field: n }) => v ? f(r) : n === "category" ? s?.(g) : o?.(g), D = (r, g) => {
127
- g.key !== "Enter" && g.key !== " " || d(r);
126
+ ), d = ({ row: { id: i, guid: g, has_been_split: v }, field: n }) => v ? f(i) : n === "category" ? r?.(g) : o?.(g), D = (i, g) => {
127
+ g.key !== "Enter" && g.key !== " " || d(i);
128
128
  };
129
129
  if (!l)
130
- return /* @__PURE__ */ e(q, {});
130
+ return /* @__PURE__ */ e(z, {});
131
131
  const p = [
132
132
  {
133
133
  field: "flag",
@@ -135,7 +135,7 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
135
135
  minWidth: 32,
136
136
  width: 32,
137
137
  sortable: !1,
138
- renderCell: (r) => /* @__PURE__ */ e(wt, { ...r }),
138
+ renderCell: (i) => /* @__PURE__ */ e(St, { ...i }),
139
139
  renderHeader: () => /* @__PURE__ */ e("span", { "aria-label": a.transaction_status, role: "presentation" })
140
140
  },
141
141
  {
@@ -143,7 +143,7 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
143
143
  headerName: a.date_title,
144
144
  width: 103,
145
145
  renderHeader: N,
146
- renderCell: (r) => r.row.parent_guid ? null : /* @__PURE__ */ e(At, { ...r }),
146
+ renderCell: (i) => i.row.parent_guid ? null : /* @__PURE__ */ e(bt, { ...i }),
147
147
  sortingOrder: ["desc", "asc"]
148
148
  },
149
149
  {
@@ -160,7 +160,7 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
160
160
  headerName: a.category_title,
161
161
  flex: 0.25,
162
162
  renderHeader: N,
163
- renderCell: (r) => /* @__PURE__ */ e(bt, { ...r }),
163
+ renderCell: (i) => /* @__PURE__ */ e(Tt, { ...i }),
164
164
  sortingOrder: ["asc", "desc"]
165
165
  },
166
166
  {
@@ -168,7 +168,7 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
168
168
  headerName: a.account_title,
169
169
  flex: 0.33,
170
170
  renderHeader: N,
171
- renderCell: (r) => r.row.parent_guid ? null : /* @__PURE__ */ e(Ct, { ...r }),
171
+ renderCell: (i) => i.row.parent_guid ? null : /* @__PURE__ */ e(ft, { ...i }),
172
172
  sortingOrder: ["asc", "desc"]
173
173
  },
174
174
  {
@@ -176,22 +176,22 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
176
176
  headerName: a.amount_title,
177
177
  flex: 0.25,
178
178
  renderHeader: N,
179
- renderCell: yt,
179
+ renderCell: Ct,
180
180
  align: "right",
181
181
  headerAlign: "right",
182
182
  sortingOrder: ["asc", "desc"]
183
183
  }
184
184
  ];
185
185
  return /* @__PURE__ */ e(We, { sx: { height: t, px: 24, width: "100%", boxShadow: "none" }, children: /* @__PURE__ */ e(
186
- Fe,
186
+ Ue,
187
187
  {
188
188
  columns: p,
189
189
  disableColumnFilter: !0,
190
190
  disableColumnMenu: !0,
191
- getCellClassName: (r) => r.row.parent_guid ? "split-row" : "",
191
+ getCellClassName: (i) => i.row.parent_guid ? "split-row" : "",
192
192
  hideFooter: !0,
193
193
  initialState: { sorting: { sortModel: [{ field: "date", sort: "desc" }] } },
194
- loading: i,
194
+ loading: s,
195
195
  onCellClick: d,
196
196
  onCellKeyDown: D,
197
197
  rows: C,
@@ -203,56 +203,56 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
203
203
  }
204
204
  }
205
205
  ) });
206
- }, Dt = x(It), vt = ({ copy: t, isOpen: s, onClose: o, onPrimaryAction: a }) => {
207
- const { common: l, transactions: i } = I(), { isCopyLoaded: c } = z();
206
+ }, It = w(wt), Dt = ({ copy: t, isOpen: r, onClose: o, onPrimaryAction: a }) => {
207
+ const { common: l, transactions: s } = I(), { isCopyLoaded: c } = K();
208
208
  return c ? /* @__PURE__ */ _(
209
- re,
209
+ oe,
210
210
  {
211
211
  copy: {
212
212
  title: t.title
213
213
  },
214
- isOpen: s,
214
+ isOpen: r,
215
215
  onClose: o,
216
216
  onPrimaryAction: a,
217
- primaryText: i.add_manual_account,
217
+ primaryText: s.add_manual_account,
218
218
  secondaryText: l.cancel_button,
219
219
  children: [
220
- /* @__PURE__ */ e(y, { component: "p", sx: { marginBottom: "20px" }, truncate: !1, children: i.add_account_modal_message }),
221
- /* @__PURE__ */ e(y, { component: "p", truncate: !1, children: i.add_account_modal_cta })
220
+ /* @__PURE__ */ e(y, { component: "p", sx: { marginBottom: "20px" }, truncate: !1, children: s.add_account_modal_message }),
221
+ /* @__PURE__ */ e(y, { component: "p", truncate: !1, children: s.add_account_modal_cta })
222
222
  ]
223
223
  }
224
- ) : /* @__PURE__ */ e(q, {});
225
- }, Nt = x(vt), Et = () => {
226
- const { visibleAccounts: t } = oe(), { common: s, transactions: o } = I(), { manualTransaction: a, setIsAmountValid: l, updateManualTransaction: i } = R(), [c, h] = m.useState(""), [f, C] = m.useState(""), d = m.useMemo(
224
+ ) : /* @__PURE__ */ e(z, {});
225
+ }, vt = w(Dt), Nt = () => {
226
+ const { visibleAccounts: t } = ne(), { common: r, transactions: o } = I(), { manualTransaction: a, setIsAmountValid: l, updateManualTransaction: s } = R(), [c, h] = m.useState(""), [f, C] = m.useState(""), d = m.useMemo(
227
227
  () => t.filter((n) => n.is_manual),
228
228
  [t]
229
229
  ).map((n) => ({
230
- label: `${n.name} | ${se(n.balance, "0,0.00")}`,
230
+ label: `${n.name} | ${re(n.balance, "0,0.00")}`,
231
231
  value: n.guid
232
232
  })), D = {
233
- error_amount_is_invalid: s.currency_input.error_amount_is_invalid,
234
- error_amount_must_be_equal_to: s.currency_input.error_amount_must_be_equal_to,
235
- error_amount_must_be_less_than_or_equal_to: s.currency_input.error_amount_must_be_less_than_or_equal_to,
236
- enter_amount: s.currency_input.enter_amount
233
+ error_amount_is_invalid: r.currency_input.error_amount_is_invalid,
234
+ error_amount_must_be_equal_to: r.currency_input.error_amount_must_be_equal_to,
235
+ error_amount_must_be_less_than_or_equal_to: r.currency_input.error_amount_must_be_less_than_or_equal_to,
236
+ enter_amount: r.currency_input.enter_amount
237
237
  }, p = (n) => {
238
- h(n), i({ ...a, amount: Number(n) });
239
- }, r = (n, H) => {
240
- i({ ...a, transaction_type: Number(H) });
238
+ h(n), s({ ...a, amount: Number(n) });
239
+ }, i = (n, P) => {
240
+ s({ ...a, transaction_type: Number(P) });
241
241
  }, g = (n) => {
242
- C(n), i({ ...a, payee: n, description: n });
242
+ C(n), s({ ...a, payee: n, description: n });
243
243
  }, v = (n) => {
244
- i({ ...a, account_guid: n });
244
+ s({ ...a, account_guid: n });
245
245
  };
246
246
  return /* @__PURE__ */ _(S, { className: "mx-txn-manual-transaction-details", children: [
247
- /* @__PURE__ */ _(w, { gap: 40, mx: 24, my: 32, children: [
247
+ /* @__PURE__ */ _(x, { gap: 40, mx: 24, my: 32, children: [
248
248
  /* @__PURE__ */ _(
249
- w,
249
+ x,
250
250
  {
251
251
  direction: "row",
252
252
  sx: { flexDirection: { xs: "column", sm: "row" }, gap: { xs: 40, sm: 8 } },
253
253
  children: [
254
254
  /* @__PURE__ */ e(
255
- lt,
255
+ ct,
256
256
  {
257
257
  allowDecimals: !0,
258
258
  amount: c,
@@ -268,9 +268,9 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
268
268
  type: "number"
269
269
  }
270
270
  ),
271
- /* @__PURE__ */ e(it, { name: "TransactionType", onChange: r, row: !0, children: /* @__PURE__ */ _(w, { alignItems: "center", direction: "row", children: [
271
+ /* @__PURE__ */ e(it, { name: "TransactionType", onChange: i, row: !0, children: /* @__PURE__ */ _(x, { alignItems: "center", direction: "row", children: [
272
272
  /* @__PURE__ */ e(
273
- ee,
273
+ Z,
274
274
  {
275
275
  checked: a.transaction_type === E.CREDIT,
276
276
  label: o.manual_transaction_credit_button_label,
@@ -280,7 +280,7 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
280
280
  }
281
281
  ),
282
282
  /* @__PURE__ */ e(
283
- ee,
283
+ Z,
284
284
  {
285
285
  checked: a.transaction_type === E.DEBIT,
286
286
  label: o.manual_transaction_debit_button_label,
@@ -293,7 +293,7 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
293
293
  }
294
294
  ),
295
295
  /* @__PURE__ */ e(
296
- te,
296
+ ee,
297
297
  {
298
298
  label: o.payee_title,
299
299
  name: "payee",
@@ -303,52 +303,52 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
303
303
  }
304
304
  ),
305
305
  /* @__PURE__ */ e(
306
- te,
306
+ ee,
307
307
  {
308
308
  InputLabelProps: { shrink: !0 },
309
- SelectProps: { defaultValue: -1, IconComponent: ct },
309
+ SelectProps: { defaultValue: -1, IconComponent: st },
310
310
  label: o.manual_transaction_select_an_account,
311
311
  onChange: (n) => v(n.target.value),
312
312
  placeholder: o.manual_transaction_select,
313
313
  select: !0,
314
314
  sx: { bgcolor: "background.paper" },
315
- children: d.map((n) => /* @__PURE__ */ e(st, { value: n.value, children: n.label }, n.value))
315
+ children: d.map((n) => /* @__PURE__ */ e(rt, { value: n.value, children: n.label }, n.value))
316
316
  }
317
317
  )
318
318
  ] }),
319
- /* @__PURE__ */ e(rt, { light: !0 }),
319
+ /* @__PURE__ */ e(ot, { light: !0 }),
320
320
  /* @__PURE__ */ _(S, { bgcolor: "background.paper", children: [
321
+ /* @__PURE__ */ e(Le, { transaction: a }),
321
322
  /* @__PURE__ */ e(Me, { transaction: a }),
322
323
  /* @__PURE__ */ e(Re, { transaction: a }),
323
- /* @__PURE__ */ e(Be, { transaction: a }),
324
324
  /* @__PURE__ */ e(He, { transaction: a })
325
325
  ] })
326
326
  ] });
327
- }, Ot = x(Et), kt = ({ onClose: t, transaction: s }) => {
328
- const { addOrUpdateTransactionRule: o, updateTransaction: a } = B(), { transactions: l } = I(), { categories: i } = qe(), [c, h] = m.useState(""), f = m.useMemo(
329
- () => i.find((d) => d.guid === c),
327
+ }, Et = w(Nt), Ot = ({ onClose: t, transaction: r }) => {
328
+ const { addOrUpdateTransactionRule: o, updateTransaction: a } = H(), { transactions: l } = I(), { categories: s } = ze(), [c, h] = m.useState(""), f = m.useMemo(
329
+ () => s.find((d) => d.guid === c),
330
330
  [c]
331
331
  ), C = async (d) => {
332
- await a({ ...s, category_guid: c }), d && await o(c, s), h(""), t();
332
+ await a({ ...r, category_guid: c }), d && await o(c, r), h(""), t();
333
333
  };
334
334
  return /* @__PURE__ */ _(S, { className: "mx-txn-edit-category-action", children: [
335
335
  /* @__PURE__ */ e(
336
- dt,
336
+ lt,
337
337
  {
338
- initialSelected: s.category_guid,
338
+ initialSelected: r.category_guid,
339
339
  onClose: t,
340
340
  onSelect: (d) => h(d),
341
- showDrawer: !!s,
341
+ showDrawer: !!r,
342
342
  title: l.actions_select_a_category
343
343
  }
344
344
  ),
345
345
  /* @__PURE__ */ e(
346
- re,
346
+ oe,
347
347
  {
348
348
  copy: {
349
- title: K(
349
+ title: G(
350
350
  l.actions_apply_to_all_transaction_types,
351
- s.description
351
+ r.description
352
352
  )
353
353
  },
354
354
  isOpen: !!c,
@@ -357,114 +357,110 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
357
357
  onSecondaryAction: () => C(!1),
358
358
  primaryText: l.actions_apply_to_all,
359
359
  secondaryText: l.actions_this_time_only,
360
- children: /* @__PURE__ */ e(ze, { variant: "Paragraph", children: K(
360
+ children: /* @__PURE__ */ e(Ke, { variant: "Paragraph", children: G(
361
361
  l.actions_all_past_and_future,
362
- s.description,
362
+ r.description,
363
363
  f?.name
364
364
  ) })
365
365
  }
366
366
  )
367
367
  ] });
368
- }, Lt = x(kt), ne = 120, Mt = ({
368
+ }, kt = w(Ot), ae = 120, Lt = ({
369
369
  onBackClick: t,
370
- height: s = "100dvh",
370
+ height: r = "100dvh",
371
371
  showInsights: o = !1,
372
372
  sx: a = {}
373
373
  }) => {
374
- const { manualAccounts: l, refreshAccounts: i } = oe(), { is_mobile_webview: c, clientConfig: h, config: f } = je(), { setSearchValue: C } = ut(), { onEvent: d } = Xe(), { common: D, transactions: p } = I(), {
375
- displayedDateRange: r,
374
+ const { manualAccounts: l, refreshAccounts: s } = ne(), { is_mobile_webview: c, clientConfig: h, config: f } = qe(), { setSearchValue: C } = dt(), { onEvent: d } = je(), { common: D, transactions: p } = I(), {
375
+ displayedDateRange: i,
376
376
  isInitialized: g,
377
377
  selectedAccountGuids: v,
378
378
  setDisplayedDate: n
379
- } = z(), { isDesktop: H, isTablet: ie } = gt(), O = nt(), {
380
- addTransaction: ce,
381
- filter: j,
382
- isTransactionDataLoaded: P,
383
- loadAssociatedBeats: le,
384
- loadTransactionData: de,
385
- setFilter: $,
386
- sortedTransactions: X,
387
- sortedTransactionsWithSplits: ue,
388
- tags: me,
389
- detailedTransactions: _e,
390
- updateTransaction: pe
391
- } = B(), {
392
- clearExpandedSplits: ge,
393
- isAmountValid: he,
379
+ } = K(), { isDesktop: P, isTablet: ie } = pt(), O = at(), {
380
+ addTransaction: se,
381
+ filter: ce,
382
+ isTransactionDataLoaded: B,
383
+ loadTransactionData: le,
384
+ setFilter: q,
385
+ sortedTransactions: j,
386
+ sortedTransactionsWithSplits: de,
387
+ tags: ue,
388
+ detailedTransactions: me,
389
+ updateTransaction: _e
390
+ } = H(), {
391
+ clearExpandedSplits: pe,
392
+ isAmountValid: ge,
394
393
  manualTransaction: k,
395
- searchValue: fe,
396
- setSearchValue: Ce,
397
- setShowInsights: ye,
398
- updateManualTransaction: Te
399
- } = R(), { userProfile: be } = Ye(), [V, T] = m.useState(""), [Y, L] = m.useState(""), [Ae, U] = m.useState(!1), [Se, J] = m.useState(!1), { announce: we, ariaLive: xe } = mt(), W = h?.transactions?.selected_account_guid;
400
- ye(o), ht({
394
+ searchValue: X,
395
+ setSearchValue: he,
396
+ setShowInsights: fe,
397
+ updateManualTransaction: Ce
398
+ } = R(), { userProfile: ye } = Xe(), [$, T] = m.useState(""), [Y, L] = m.useState(""), [Te, V] = m.useState(!1), [be, J] = m.useState(!1), { announce: Ae, ariaLive: Se } = ut(), W = h?.transactions?.selected_account_guid;
399
+ fe(o), gt({
401
400
  widgetName: "TransactionWidget",
402
- isLoaded: P
401
+ isLoaded: B
403
402
  }), m.useEffect(() => {
404
- P || de().finally();
405
- const u = at(G()), Z = et(G());
406
- n(u, Z), console.warn("Transactions: Default UseEffect - Set Filter"), $({
407
- accounts: [],
408
- dateRange: { start: u, end: Z }
409
- }), d(A.TRANSACTIONS_VIEW);
403
+ B || le().finally();
404
+ const u = tt(F()), ke = Ze(F());
405
+ n(u, ke), d(A.TRANSACTIONS_VIEW);
410
406
  }, []), m.useEffect(() => {
411
- g && (console.warn("Transactions: Initialized UseEffect - Set Filter"), $({
412
- ...j,
407
+ g && (console.warn("Transactions: Initialized UseEffect - Set Filter"), q({
413
408
  accounts: W ? [W] : v,
414
- dateRange: { start: r.start, end: r.end }
415
- }), le(r.start).finally());
416
- }, [g, r, v]), m.useEffect(() => {
417
- g && (console.warn("Transactions: Announce UseEffect"), we(
418
- K(
409
+ dateRange: { start: i.start, end: i.end },
410
+ searchTerm: X
411
+ }));
412
+ }, [g, i, v]), m.useEffect(() => {
413
+ g && (console.warn("Transactions: Announce UseEffect"), Ae(
414
+ G(
419
415
  p.showing_transactions_count,
420
- X.length
416
+ j.length
421
417
  )
422
418
  ));
423
- }, [g, X]);
424
- const b = Y ? _e.find((u) => u.guid === Y) : void 0, Q = he && !!k.payee && !!k.account_guid && !!k.category_guid, Ie = (u) => {
425
- ge(), n(u[0], u[1]);
426
- }, De = (u) => {
427
- Ce(u), $({
428
- ...j,
419
+ }, [g, j]);
420
+ const b = Y ? me.find((u) => u.guid === Y) : void 0, Q = ge && !!k.payee && !!k.account_guid && !!k.category_guid, xe = (u) => {
421
+ pe(), n(u[0], u[1]);
422
+ }, we = (u) => {
423
+ he(u), q({
424
+ ...ce,
429
425
  searchTerm: u
430
426
  }), d(A.TRANSACTIONS_CLICK_SEARCH, { search_term: u });
431
- }, ve = () => {
432
- Ue(ue, me), d(A.TRANSACTIONS_CLICK_EXPORT);
433
- }, Ne = () => {
434
- l.length > 0 ? (Te({
435
- ...Ve,
436
- date: tt(G()),
437
- user_guid: be?.user_guid || ""
427
+ }, Ie = () => {
428
+ Ve(de, ue), d(A.TRANSACTIONS_CLICK_EXPORT);
429
+ }, De = () => {
430
+ l.length > 0 ? (Ce({
431
+ ...$e,
432
+ date: et(F()),
433
+ user_guid: ye?.user_guid || ""
438
434
  }), T(
439
435
  "addTransaction"
440
436
  /* AddTransaction */
441
- ), d(A.TRANSACTIONS_CLICK_ADD)) : (U(!0), d(A.TRANSACTIONS_ADD_MANUAL_ACCOUNT_MODAL));
437
+ ), d(A.TRANSACTIONS_CLICK_ADD)) : (V(!0), d(A.TRANSACTIONS_ADD_MANUAL_ACCOUNT_MODAL));
438
+ }, ve = async () => {
439
+ Q && await se(k), T("");
440
+ }, Ne = () => {
441
+ V(!1), J(!0);
442
442
  }, Ee = async () => {
443
- Q && await ce(k), T("");
444
- }, Oe = () => {
445
- U(!1), J(!0);
446
- }, ke = async () => {
447
- J(!1), await i();
448
- }, Le = async () => {
449
- b && !b.has_been_viewed && await pe({ ...b, has_been_viewed: !0 }), T("");
443
+ J(!1), await s();
444
+ }, Oe = async () => {
445
+ b && !b.has_been_viewed && await _e({ ...b, has_been_viewed: !0 }), T("");
450
446
  };
451
447
  if (!g)
452
- return /* @__PURE__ */ e(q, {});
453
- const F = [];
454
- return !c && (H || ie) && F.push({
448
+ return /* @__PURE__ */ e(z, {});
449
+ const U = [];
450
+ return !c && (P || ie) && U.push({
455
451
  iconName: "open_in_new",
456
452
  label: p.export_csv_btn,
457
- onClick: ve
458
- }), f.show_connections_widget_in_master && F.push({
453
+ onClick: Ie
454
+ }), f.show_connections_widget_in_master && U.push({
459
455
  iconName: "add",
460
456
  label: p.add_transaction_btn,
461
- onClick: Ne
457
+ onClick: De
462
458
  }), /* @__PURE__ */ _(
463
- pt,
459
+ _t,
464
460
  {
465
- actions: F,
461
+ actions: U,
466
462
  calendarActions: {
467
- onRangeChanged: Ie
463
+ onRangeChanged: xe
468
464
  },
469
465
  onAccountsFilterClick: () => d(A.ACCOUNTS_CLICK_FILTER),
470
466
  onBackClick: t,
@@ -472,14 +468,14 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
472
468
  sx: a,
473
469
  title: p.transactions_title,
474
470
  children: [
475
- P ? /* @__PURE__ */ _(w, { children: [
476
- xe,
471
+ B ? /* @__PURE__ */ _(x, { children: [
472
+ Se,
477
473
  /* @__PURE__ */ e(S, { mt: 16, children: /* @__PURE__ */ e(
478
- ft,
474
+ ht,
479
475
  {
480
- onChange: De,
476
+ onChange: we,
481
477
  placeholder: p.action_bar_search_placeholder,
482
- searchValue: fe
478
+ searchValue: X
483
479
  }
484
480
  ) }),
485
481
  /* @__PURE__ */ e(
@@ -490,9 +486,9 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
490
486
  [O.breakpoints.up("md")]: { display: "block" }
491
487
  },
492
488
  children: /* @__PURE__ */ e(
493
- Dt,
489
+ It,
494
490
  {
495
- height: `calc(${s} - ${ne}px)`,
491
+ height: `calc(${r} - ${ae}px)`,
496
492
  onCategoryClick: (u) => {
497
493
  L(u), T(
498
494
  "category"
@@ -519,7 +515,7 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
519
515
  children: /* @__PURE__ */ e(
520
516
  Pe,
521
517
  {
522
- height: `calc(${s} - ${ne}px)`,
518
+ height: `calc(${r} - ${ae}px)`,
523
519
  onClick: (u) => {
524
520
  L(u), T(
525
521
  "transaction"
@@ -532,19 +528,19 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
532
528
  )
533
529
  }
534
530
  )
535
- ] }) : /* @__PURE__ */ e(_t, { sx: { m: 48 }, variant: "list" }),
531
+ ] }) : /* @__PURE__ */ e(mt, { sx: { m: 48 }, variant: "list" }),
536
532
  /* @__PURE__ */ e(
537
- ae,
533
+ te,
538
534
  {
539
535
  ariaLabelClose: D.close_aria,
540
- isOpen: V === "transaction" && !!b,
541
- onClose: Le,
536
+ isOpen: $ === "transaction" && !!b,
537
+ onClose: Oe,
542
538
  title: p.details_title,
543
- children: b && /* @__PURE__ */ e($e, { transaction: b })
539
+ children: b && /* @__PURE__ */ e(Be, { transaction: b })
544
540
  }
545
541
  ),
546
- b && V === "category" && /* @__PURE__ */ e(
547
- Lt,
542
+ b && $ === "category" && /* @__PURE__ */ e(
543
+ kt,
548
544
  {
549
545
  onClose: () => {
550
546
  C(""), T(""), L("");
@@ -553,53 +549,53 @@ const Ct = (t) => /* @__PURE__ */ _(y, { tabIndex: t.tabIndex, variant: "Small",
553
549
  }
554
550
  ),
555
551
  /* @__PURE__ */ e(
556
- ae,
552
+ te,
557
553
  {
558
554
  ariaLabelClose: D.close_aria,
559
- isOpen: V === "addTransaction",
555
+ isOpen: $ === "addTransaction",
560
556
  isPrimaryDisabled: !Q,
561
557
  onClose: () => T(""),
562
- onPrimaryAction: Ee,
558
+ onPrimaryAction: ve,
563
559
  title: p.add_transaction_title,
564
- children: /* @__PURE__ */ e(Ot, {})
560
+ children: /* @__PURE__ */ e(Et, {})
565
561
  }
566
562
  ),
567
563
  /* @__PURE__ */ e(
568
- Nt,
564
+ vt,
569
565
  {
570
566
  copy: { title: p.add_manual_account },
571
- isOpen: Ae,
567
+ isOpen: Te,
572
568
  onClose: () => {
573
- U(!1);
569
+ V(!1);
574
570
  },
575
- onPrimaryAction: Oe
571
+ onPrimaryAction: Ne
576
572
  }
577
573
  ),
578
574
  /* @__PURE__ */ e(
579
- ot,
575
+ nt,
580
576
  {
581
- onClose: ke,
582
- showConnectWidget: Se,
577
+ onClose: Ee,
578
+ showConnectWidget: be,
583
579
  title: p.add_manual_account
584
580
  }
585
581
  )
586
582
  ]
587
583
  }
588
584
  );
589
- }, ya = x(Mt);
585
+ }, Ca = w(Lt);
590
586
  export {
591
- Nt as AddAccountModal,
592
- wa as BottomActions,
593
- ka as ExportCsvAction,
594
- va as TRANSACTION_EVENTS,
587
+ vt as AddAccountModal,
588
+ Sa as BottomActions,
589
+ Oa as ExportCsvAction,
590
+ Da as TRANSACTION_EVENTS,
595
591
  xa as TopActions,
596
- Aa as TransactionApi,
597
- $e as TransactionDetails,
592
+ ba as TransactionApi,
593
+ Be as TransactionDetails,
598
594
  Pe as TransactionList,
599
- Ia as TransactionRow,
600
- Ea as TransactionStore,
601
- Dt as TransactionTable,
602
- ya as TransactionWidget,
603
- Ue as exportTransactionsToCSV,
595
+ wa as TransactionRow,
596
+ Na as TransactionStore,
597
+ It as TransactionTable,
598
+ Ca as TransactionWidget,
599
+ Ve as exportTransactionsToCSV,
604
600
  R as useTransactionsUiStore
605
601
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.8.2-alpha.bb5",
3
+ "version": "7.8.2-alpha.bb6",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",