@tesouro/embedded-components-react 0.11.188 → 0.11.189

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.
Files changed (20) hide show
  1. package/dist/fixtures/index.d.ts +13 -46
  2. package/dist/index.css +3 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/lib/BankAccountsWidget.d.ts +2 -0
  5. package/dist/lib/WidgetSuite.d.ts +2 -0
  6. package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/BalanceHistoryWidgetFeature.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/lib/BalancesWidget/BalancesWidgetContext.js +2 -2
  8. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index2.js +17 -14
  9. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/formatters.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/labels.js +2 -0
  11. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +9 -3
  12. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js +76 -58
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index8.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +20 -20
  15. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +17 -17
  16. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +77 -77
  18. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js +2 -2
  19. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +129 -122
  20. package/package.json +1 -1
@@ -396,10 +396,6 @@ type BankAccountSnapshot = {
396
396
  bank_name?: string | null;
397
397
  routing_number?: string | null;
398
398
  };
399
- /**
400
- * The status of a bank account.
401
- */
402
- type BankAccountStatus = 'ACTIVE' | 'CLOSED';
403
399
  /**
404
400
  * Direction of a bank account transaction.
405
401
  */
@@ -512,47 +508,6 @@ type BankAccountTransferStatusDto = 'PENDING' | 'COMPLETED' | 'FAILED' | 'RETURN
512
508
  * Type of bank account transfer operation.
513
509
  */
514
510
  type BankAccountTransferTypeDto = 'INTERNAL_TO_EXTERNAL' | 'EXTERNAL_TO_INTERNAL' | 'INTERNAL_TO_INTERNAL';
515
- /**
516
- * Response model for a bank account with balance information.
517
- */
518
- type BankAccountWithBalanceResponse = {
519
- /**
520
- * Unique identifier for the bank account.
521
- */
522
- id: string;
523
- /**
524
- * Masked account number.
525
- */
526
- accountNumber: string;
527
- /**
528
- * Current balance of the bank account in minor units (e.g. cents for USD).
529
- */
530
- balance: AmountOutput;
531
- /**
532
- * Reference identifier associated with the bank account.
533
- */
534
- bankAccountReference?: null | string;
535
- /**
536
- * The UTC timestamp when the bank account was created.
537
- */
538
- createdDateTime: string;
539
- /**
540
- * Registered legal or DBA name on the bank account.
541
- */
542
- nameOnAccount: string;
543
- /**
544
- * Nickname for the bank account.
545
- */
546
- nickname?: null | string;
547
- /**
548
- * Bank routing number.
549
- */
550
- routingNumber: string;
551
- /**
552
- * The status of the bank account.
553
- */
554
- status: BankAccountStatus;
555
- };
556
511
  /**
557
512
  * In invoice history, this object contains information about a credit note created for this invoice.
558
513
  * In quote history, it contains information about an invoice created from this quote.
@@ -4593,7 +4548,19 @@ declare const A_VELOCITY_CONTROL: VelocityControlResponse;
4593
4548
  * only the id, so the Funding account column is resolved by a *second* read, and
4594
4549
  * a fixture whose id did not match would render the em-dash and look like a bug.
4595
4550
  */
4596
- declare const A_BANK_ACCOUNT: BankAccountWithBalanceResponse;
4551
+ declare const A_BANK_ACCOUNT: {
4552
+ id: string;
4553
+ accountNumber: string;
4554
+ routingNumber: string;
4555
+ balance: {
4556
+ currencyCode: string;
4557
+ value: number;
4558
+ };
4559
+ nameOnAccount: string;
4560
+ nickname: string;
4561
+ status: "ACTIVE";
4562
+ createdDateTime: string;
4563
+ };
4597
4564
  /**
4598
4565
  * One transaction on {@link A_BANK_ACCOUNT}, as
4599
4566
  * `GET /bank-accounts/{id}/transactions` returns it.
package/dist/index.css CHANGED
@@ -5441,6 +5441,9 @@
5441
5441
  .ttw\:disabled\:pointer-events-none:disabled {
5442
5442
  pointer-events: none;
5443
5443
  }
5444
+ .ttw\:disabled\:cursor-default:disabled {
5445
+ cursor: default;
5446
+ }
5444
5447
  .ttw\:disabled\:cursor-not-allowed:disabled {
5445
5448
  cursor: not-allowed;
5446
5449
  }
package/dist/index.d.ts CHANGED
@@ -2652,6 +2652,8 @@ interface Labels$3 {
2652
2652
 
2653
2653
  interface FeatureLabels$3 {
2654
2654
  accountFallback: string;
2655
+ pendingStatus: string;
2656
+ accountNumberUnavailable: string;
2655
2657
  createSuccessToast: string;
2656
2658
  editSuccessToast: string;
2657
2659
  /** Account-details export toast — forwarded to AccountDetailsWidget. */
@@ -719,6 +719,8 @@ interface Labels {
719
719
 
720
720
  interface FeatureLabels {
721
721
  accountFallback: string;
722
+ pendingStatus: string;
723
+ accountNumberUnavailable: string;
722
724
  createSuccessToast: string;
723
725
  editSuccessToast: string;
724
726
  /** Account-details export toast — forwarded to AccountDetailsWidget. */
@@ -1767,6 +1767,8 @@ interface Labels$3 {
1767
1767
 
1768
1768
  interface FeatureLabels$3 {
1769
1769
  accountFallback: string;
1770
+ pendingStatus: string;
1771
+ accountNumberUnavailable: string;
1770
1772
  createSuccessToast: string;
1771
1773
  editSuccessToast: string;
1772
1774
  /** Account-details export toast — forwarded to AccountDetailsWidget. */
@@ -50,7 +50,7 @@ function b({ labels: o, defaultRange: p = s.Days30, onTransferFromExternalClick:
50
50
  let [w, _e] = _(p), [T, ve] = _({}), { initResponse: E } = te(), ye = ie(), be = ne(), D = ee(), { organizationId: O, organizationStatus: k } = r(), A = k === t.Rotating, j = A && O == null, M = m((e) => ve((t) => ({
51
51
  organizationId: j ? t.organizationId : O,
52
52
  account: e || y
53
- })), [O, j]), xe = n(k), N = E?.scopes?.includes(i.BankAccountReadOrg) ?? !1, P = re(), F = N && !P, I = me({ enabled: F }), L = I.accounts, R = L?.length === 1 ? L[0].id : y, z = T.organizationId === O || j ? T.account ?? R : R, B = z === y ? void 0 : z, V = L?.find(({ id: e }) => e === B), H = ae() ?? u(/* @__PURE__ */ new Date()), U = g(() => {
53
+ })), [O, j]), xe = n(k), N = E?.scopes?.includes(i.BankAccountReadOrg) ?? !1, P = re(), F = N && !P, I = me({ enabled: F }), L = g(() => I.accounts?.filter((e) => e.status !== "PENDING"), [I.accounts]), R = L?.length === 1 ? L[0].id : y, z = T.organizationId === O || j ? T.account ?? R : R, B = z === y ? void 0 : z, V = L?.find(({ id: e }) => e === B), H = ae() ?? u(/* @__PURE__ */ new Date()), U = g(() => {
54
54
  let e = (V ? [V.createdDateTime] : (L ?? []).map(({ createdDateTime: e }) => e)).map((e) => u(new Date(e)));
55
55
  return e.length ? e.reduce((e, t) => e < t ? e : t) : void 0;
56
56
  }, [V, L]), W = U ? c({
@@ -79,7 +79,7 @@ function b({ labels: o, defaultRange: p = s.Days30, onTransferFromExternalClick:
79
79
  description: t(n)
80
80
  }, ...L.map((t) => ({
81
81
  value: t.id,
82
- label: S.accountOption(t.nickname || t.nameOnAccount, t.accountNumber.slice(-4)),
82
+ label: t.accountNumber ? S.accountOption(t.nickname || t.nameOnAccount, t.accountNumber.slice(-4)) : t.nickname || t.nameOnAccount,
83
83
  description: f(t.balance.currencyCode || "USD")(e(t.balance))
84
84
  }))];
85
85
  }, [L, S]), Z = g(() => K && U ? le({
@@ -41,12 +41,12 @@ var v = p({
41
41
  D,
42
42
  M
43
43
  ]), L = w?.data ?? [], R = g(() => L.map((t) => {
44
- let r = t.accountNumber.slice(-4), i = e(n(t.balance), t.balance?.currencyCode ?? "USD");
44
+ let r = t.accountNumber?.slice(-4), i = e(n(t.balance), t.balance?.currencyCode ?? "USD");
45
45
  return {
46
46
  accountId: t.id,
47
47
  view: {
48
48
  title: t.nickname ?? "",
49
- suffixLabel: `- ${r}`,
49
+ suffixLabel: r ? `- ${r}` : "",
50
50
  amountLabel: i.text
51
51
  },
52
52
  amount: i
@@ -2,21 +2,24 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Button as e, Tooltip as t, TooltipContent as n, TooltipTrigger as r } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import { Button as e, Tooltip as t, TooltipContent as n, TooltipTrigger as r, cn as i } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  // ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index2.js
8
- function o({ label: o, onClick: s, children: c, className: l }) {
9
- return /* @__PURE__ */ a(t, { children: [/* @__PURE__ */ i(r, {
8
+ function s({ label: s, onClick: c, children: l, className: u, disabled: d, disabledDescription: f }) {
9
+ return /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ a(r, {
10
10
  asChild: !0,
11
- children: /* @__PURE__ */ i(e, {
12
- type: "button",
13
- variant: "ghost",
14
- size: "icon-sm",
15
- "aria-label": o,
16
- className: l,
17
- onClick: s,
18
- children: c
11
+ children: /* @__PURE__ */ a("span", {
12
+ className: i("ttw:inline-flex", u),
13
+ children: /* @__PURE__ */ a(e, {
14
+ type: "button",
15
+ variant: "ghost",
16
+ size: "icon-sm",
17
+ "aria-label": s,
18
+ onClick: c,
19
+ disabled: d,
20
+ children: l
21
+ })
19
22
  })
20
- }), /* @__PURE__ */ i(n, { children: o })] });
23
+ }), /* @__PURE__ */ a(n, { children: d ? f ?? s : s })] });
21
24
  }
22
- export { o as IconActionButton };
25
+ export { s as IconActionButton };
@@ -19,7 +19,7 @@ function n(e) {
19
19
  })).join(" + ");
20
20
  }
21
21
  function r(e) {
22
- return e.trim().slice(-4);
22
+ return e?.trim().slice(-4) ?? "";
23
23
  }
24
24
  async function i(e) {
25
25
  if (!e.trim()) return !1;
@@ -1,6 +1,8 @@
1
1
  // ../../libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/labels.js
2
2
  var e = {
3
3
  accountFallback: "Account",
4
+ pendingStatus: "Pending",
5
+ accountNumberUnavailable: "Not available",
4
6
  createSuccessToast: "Account created",
5
7
  editSuccessToast: "Account updated",
6
8
  exportLoadingToast: "Exporting transactions…",
@@ -110,10 +110,12 @@ function Oe({ labels: r, featureLabels: ae, isBankingTaglineVisible: a = !0, ban
110
110
  ...t,
111
111
  [e.id]: !t[e.id]
112
112
  })),
113
- onCopyAccountNumber: () => void Q(e.id, "account", e.accountNumber),
113
+ onCopyAccountNumber: () => {
114
+ e.accountNumber && Q(e.id, "account", e.accountNumber);
115
+ },
114
116
  onCopyRoutingNumber: () => void Q(e.id, "routing", e.routingNumber),
115
117
  onSelect: () => {
116
- O(e.id), f(i.AccountSelected, { accountId: e.id });
118
+ e.status !== "PENDING" && e.accountNumber && (O(e.id), f(i.AccountSelected, { accountId: e.id }));
117
119
  }
118
120
  })), [
119
121
  J,
@@ -198,7 +200,11 @@ function ke(e, t, n) {
198
200
  id: e.id,
199
201
  name: e.nickname?.trim() || t.accountFallback,
200
202
  balanceLabel: a(e.balance),
201
- accountNumberLabel: e.accountNumber,
203
+ statusLabel: e.status === "PENDING" ? t.pendingStatus : void 0,
204
+ statusTone: "warning",
205
+ isSelectionDisabled: e.status === "PENDING" || !e.accountNumber,
206
+ isAccountNumberUnavailable: !e.accountNumber,
207
+ accountNumberLabel: e.accountNumber ?? t.accountNumberUnavailable,
202
208
  accountNumberLast4: ae(e.accountNumber),
203
209
  routingNumberLabel: e.routingNumber,
204
210
  ...n
@@ -2,84 +2,102 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Skeleton as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { formatOpenAccountAriaLabel as t } from "./labels.js";
7
- import { MaskedAccountNumber as n } from "../../../../shared/ui/dist/lib/MaskedAccountNumber/MaskedAccountNumber.js";
5
+ import { Badge as e, Skeleton as t, Tooltip as n, TooltipContent as r, TooltipTrigger as i, cn as a } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { formatOpenAccountAriaLabel as o } from "./labels.js";
7
+ import { MaskedAccountNumber as s } from "../../../../shared/ui/dist/lib/MaskedAccountNumber/MaskedAccountNumber.js";
8
8
  import "../../../../shared/ui/dist/index.js";
9
- import { IconActionButton as r } from "../../../account-details/ui/dist/index2.js";
9
+ import { IconActionButton as c } from "../../../account-details/ui/dist/index2.js";
10
10
  import "../../../account-details/ui/dist/index.js";
11
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
12
- import { CheckIcon as o, CopyIcon as s, EyeIcon as c, EyeOffIcon as l } from "lucide-react";
11
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
12
+ import { CheckIcon as d, CopyIcon as f, EyeIcon as p, EyeOffIcon as m } from "lucide-react";
13
13
  // ../../libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js
14
- var u = "ttw:absolute ttw:inset-0 ttw:z-0 ttw:cursor-pointer ttw:rounded-lg ttw:outline-none ttw:focus-visible:outline-solid ttw:focus-visible:outline-2 ttw:focus-visible:outline-offset-2 ttw:focus-visible:outline-ring", d = "ttw:pointer-events-auto ttw:relative ttw:z-10";
15
- function f({ labels: e, card: f, testId: p }) {
16
- let m = f.isAccountNumberCopied ? e.copiedLabel : e.copyAccountNumber, h = f.isRoutingNumberCopied ? e.copiedLabel : e.copyRoutingNumber;
17
- return /* @__PURE__ */ a("article", {
18
- "data-testid": p,
19
- className: "ttw:relative ttw:flex ttw:w-80 ttw:max-w-full ttw:cursor-pointer ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:transition-colors ttw:duration-150 ttw:hover:bg-muted",
20
- children: [/* @__PURE__ */ i("button", {
21
- type: "button",
22
- className: u,
23
- "aria-label": t(f.name, e),
24
- onClick: f.onSelect
25
- }), /* @__PURE__ */ a("div", {
14
+ var h = "ttw:absolute ttw:inset-0 ttw:z-0 ttw:cursor-pointer ttw:disabled:cursor-default ttw:rounded-lg ttw:outline-none ttw:focus-visible:outline-solid ttw:focus-visible:outline-2 ttw:focus-visible:outline-offset-2 ttw:focus-visible:outline-ring", g = "ttw:pointer-events-auto ttw:relative ttw:z-10";
15
+ function _({ labels: t, card: _, testId: v }) {
16
+ let y = _.isAccountNumberCopied ? t.copiedLabel : t.copyAccountNumber, b = _.isRoutingNumberCopied ? t.copiedLabel : t.copyRoutingNumber, x = /* @__PURE__ */ l("button", {
17
+ type: "button",
18
+ className: h,
19
+ "aria-label": o(_.name, t),
20
+ onClick: _.onSelect,
21
+ disabled: _.isSelectionDisabled
22
+ });
23
+ return /* @__PURE__ */ u("article", {
24
+ "data-testid": v,
25
+ className: a("ttw:relative ttw:flex ttw:w-80 ttw:max-w-full ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4", !_.isSelectionDisabled && "ttw:cursor-pointer ttw:transition-colors ttw:duration-150 ttw:hover:bg-muted"),
26
+ children: [_.isSelectionDisabled ? /* @__PURE__ */ u(n, { children: [/* @__PURE__ */ l(i, {
27
+ asChild: !0,
28
+ children: /* @__PURE__ */ l("span", {
29
+ className: "ttw:absolute ttw:inset-0",
30
+ children: x
31
+ })
32
+ }), /* @__PURE__ */ l(r, { children: _.statusLabel ?? _.accountNumberLabel })] }) : x, /* @__PURE__ */ u("div", {
26
33
  className: "ttw:pointer-events-none ttw:relative ttw:z-10 ttw:flex ttw:min-h-0 ttw:flex-1 ttw:flex-col ttw:gap-3",
27
34
  children: [
28
- /* @__PURE__ */ a("div", {
35
+ /* @__PURE__ */ u("div", {
29
36
  className: "ttw:space-y-1",
30
- children: [/* @__PURE__ */ i("p", {
31
- className: "ttw:truncate ttw:text-sm ttw:font-semibold ttw:text-foreground",
32
- children: f.name
33
- }), /* @__PURE__ */ i("p", {
34
- className: "ttw:truncate ttw:text-xl ttw:font-semibold ttw:tabular-nums ttw:text-foreground",
35
- children: f.balanceLabel
36
- })]
37
+ children: [
38
+ /* @__PURE__ */ l("p", {
39
+ className: "ttw:truncate ttw:text-sm ttw:font-semibold ttw:text-foreground",
40
+ children: _.name
41
+ }),
42
+ _.statusLabel && /* @__PURE__ */ l(e, {
43
+ tone: _.statusTone ?? "neutral",
44
+ children: _.statusLabel
45
+ }),
46
+ /* @__PURE__ */ l("p", {
47
+ className: "ttw:truncate ttw:text-xl ttw:font-semibold ttw:tabular-nums ttw:text-foreground",
48
+ children: _.balanceLabel
49
+ })
50
+ ]
37
51
  }),
38
- /* @__PURE__ */ a("div", {
52
+ /* @__PURE__ */ u("div", {
39
53
  className: "ttw:space-y-1",
40
- children: [/* @__PURE__ */ i("p", {
54
+ children: [/* @__PURE__ */ l("p", {
41
55
  className: "ttw:text-xs ttw:text-muted-foreground",
42
- children: e.accountNumberLabel
43
- }), /* @__PURE__ */ a("div", {
56
+ children: t.accountNumberLabel
57
+ }), /* @__PURE__ */ u("div", {
44
58
  className: "ttw:flex ttw:items-center ttw:gap-1",
45
59
  children: [
46
- /* @__PURE__ */ i("span", {
60
+ /* @__PURE__ */ l("span", {
47
61
  className: "ttw:text-sm ttw:tabular-nums",
48
- children: f.isAccountNumberVisible ? f.accountNumberLabel : /* @__PURE__ */ i(n, {
49
- last4: f.accountNumberLast4,
50
- labels: { endingIn: e.accountNumberEndingIn }
62
+ children: _.isAccountNumberUnavailable || _.isAccountNumberVisible ? _.accountNumberLabel : /* @__PURE__ */ l(s, {
63
+ last4: _.accountNumberLast4,
64
+ labels: { endingIn: t.accountNumberEndingIn }
51
65
  })
52
66
  }),
53
- /* @__PURE__ */ i(r, {
54
- label: f.isAccountNumberVisible ? e.hideAccountNumber : e.showAccountNumber,
55
- className: d,
56
- onClick: f.onToggleAccountNumberVisibility,
57
- children: f.isAccountNumberVisible ? /* @__PURE__ */ i(l, {}) : /* @__PURE__ */ i(c, {})
67
+ /* @__PURE__ */ l(c, {
68
+ label: _.isAccountNumberVisible ? t.hideAccountNumber : t.showAccountNumber,
69
+ className: g,
70
+ onClick: _.onToggleAccountNumberVisibility,
71
+ disabled: _.isAccountNumberUnavailable,
72
+ disabledDescription: _.accountNumberLabel,
73
+ children: _.isAccountNumberVisible ? /* @__PURE__ */ l(m, {}) : /* @__PURE__ */ l(p, {})
58
74
  }),
59
- /* @__PURE__ */ i(r, {
60
- label: m,
61
- className: d,
62
- onClick: f.onCopyAccountNumber,
63
- children: f.isAccountNumberCopied ? /* @__PURE__ */ i(o, {}) : /* @__PURE__ */ i(s, {})
75
+ /* @__PURE__ */ l(c, {
76
+ label: y,
77
+ className: g,
78
+ onClick: _.onCopyAccountNumber,
79
+ disabled: _.isAccountNumberUnavailable,
80
+ disabledDescription: _.accountNumberLabel,
81
+ children: _.isAccountNumberCopied ? /* @__PURE__ */ l(d, {}) : /* @__PURE__ */ l(f, {})
64
82
  })
65
83
  ]
66
84
  })]
67
85
  }),
68
- /* @__PURE__ */ a("div", {
86
+ /* @__PURE__ */ u("div", {
69
87
  className: "ttw:space-y-1",
70
- children: [/* @__PURE__ */ i("p", {
88
+ children: [/* @__PURE__ */ l("p", {
71
89
  className: "ttw:text-xs ttw:text-muted-foreground",
72
- children: e.routingNumberLabel
73
- }), /* @__PURE__ */ a("div", {
90
+ children: t.routingNumberLabel
91
+ }), /* @__PURE__ */ u("div", {
74
92
  className: "ttw:flex ttw:items-center ttw:gap-1",
75
- children: [/* @__PURE__ */ i("span", {
93
+ children: [/* @__PURE__ */ l("span", {
76
94
  className: "ttw:text-sm ttw:tabular-nums",
77
- children: f.routingNumberLabel
78
- }), /* @__PURE__ */ i(r, {
79
- label: h,
80
- className: d,
81
- onClick: f.onCopyRoutingNumber,
82
- children: f.isRoutingNumberCopied ? /* @__PURE__ */ i(o, {}) : /* @__PURE__ */ i(s, {})
95
+ children: _.routingNumberLabel
96
+ }), /* @__PURE__ */ l(c, {
97
+ label: b,
98
+ className: g,
99
+ onClick: _.onCopyRoutingNumber,
100
+ children: _.isRoutingNumberCopied ? /* @__PURE__ */ l(d, {}) : /* @__PURE__ */ l(f, {})
83
101
  })]
84
102
  })]
85
103
  })
@@ -87,7 +105,7 @@ function f({ labels: e, card: f, testId: p }) {
87
105
  })]
88
106
  });
89
107
  }
90
- function p() {
91
- return /* @__PURE__ */ i(e, { className: "ttw:h-52 ttw:w-80 ttw:max-w-full ttw:rounded-lg" });
108
+ function v() {
109
+ return /* @__PURE__ */ l(t, { className: "ttw:h-52 ttw:w-80 ttw:max-w-full ttw:rounded-lg" });
92
110
  }
93
- export { f as AccountCard, p as AccountCardSkeleton };
111
+ export { _ as AccountCard, v as AccountCardSkeleton };
@@ -12,7 +12,7 @@ function r(e) {
12
12
  return e.slice(-4);
13
13
  }
14
14
  function i(i, a = n) {
15
- return i.filter((e) => e.status === "ACTIVE").map((n) => {
15
+ return i.filter((e) => e.status === "ACTIVE" && !!e.accountNumber).map((n) => {
16
16
  let i = e(n.balance.value), o = n.balance.currencyCode;
17
17
  return {
18
18
  id: n.id,
@@ -224,9 +224,9 @@ var s = (t, n, r, i) => {
224
224
  throwOnError: !0
225
225
  });
226
226
  return n;
227
- } }), y = (e) => s("getDebitCardById", e), Tn = (e) => o({
227
+ } }), y = (e) => s("getDebitCardSpendSummary", e), Tn = (e) => o({
228
228
  queryFn: async ({ queryKey: t, signal: n }) => {
229
- let { data: r } = await Me({
229
+ let { data: r } = await Pe({
230
230
  ...e,
231
231
  ...t[0],
232
232
  signal: n,
@@ -235,21 +235,32 @@ var s = (t, n, r, i) => {
235
235
  return r;
236
236
  },
237
237
  queryKey: y(e)
238
- }), En = (e) => ({ mutationFn: async (t) => {
238
+ }), b = (e) => s("getDebitCardById", e), En = (e) => o({
239
+ queryFn: async ({ queryKey: t, signal: n }) => {
240
+ let { data: r } = await Me({
241
+ ...e,
242
+ ...t[0],
243
+ signal: n,
244
+ throwOnError: !0
245
+ });
246
+ return r;
247
+ },
248
+ queryKey: b(e)
249
+ }), Dn = (e) => ({ mutationFn: async (t) => {
239
250
  let { data: n } = await Wt({
240
251
  ...e,
241
252
  ...t,
242
253
  throwOnError: !0
243
254
  });
244
255
  return n;
245
- } }), Dn = (e) => ({ mutationFn: async (t) => {
256
+ } }), On = (e) => ({ mutationFn: async (t) => {
246
257
  let { data: r } = await n({
247
258
  ...e,
248
259
  ...t,
249
260
  throwOnError: !0
250
261
  });
251
262
  return r;
252
- } }), b = (e) => s("getDebitCardCredentials", e), On = (e) => o({
263
+ } }), x = (e) => s("getDebitCardCredentials", e), kn = (e) => o({
253
264
  queryFn: async ({ queryKey: t, signal: n }) => {
254
265
  let { data: r } = await Ne({
255
266
  ...e,
@@ -259,26 +270,15 @@ var s = (t, n, r, i) => {
259
270
  });
260
271
  return r;
261
272
  },
262
- queryKey: b(e)
263
- }), kn = (e) => ({ mutationFn: async (t) => {
273
+ queryKey: x(e)
274
+ }), An = (e) => ({ mutationFn: async (t) => {
264
275
  let { data: n } = await zt({
265
276
  ...e,
266
277
  ...t,
267
278
  throwOnError: !0
268
279
  });
269
280
  return n;
270
- } }), x = (e) => s("getDebitCardSpendSummary", e), An = (e) => o({
271
- queryFn: async ({ queryKey: t, signal: n }) => {
272
- let { data: r } = await Pe({
273
- ...e,
274
- ...t[0],
275
- signal: n,
276
- throwOnError: !0
277
- });
278
- return r;
279
- },
280
- queryKey: x(e)
281
- }), jn = (e) => ({ mutationFn: async (t) => {
281
+ } }), jn = (e) => ({ mutationFn: async (t) => {
282
282
  let { data: n } = await Jt({
283
283
  ...e,
284
284
  ...t,
@@ -1053,4 +1053,4 @@ var s = (t, n, r, i) => {
1053
1053
  });
1054
1054
  return n;
1055
1055
  } });
1056
- export { xn as activateCreditCardMutation, Dn as activateDebitCardMutation, Nn as connectExternalBankAccountMutation, Vn as createAchMoneyMovementMutation, en as createApplicationMutation, sn as createBankAccountMutation, Hn as createBookTransferMutation, hn as createCheckDepositMutation, Cn as createDebitCardMutation, $t as createVelocityControlMutation, Yn as deleteApprovalPoliciesIdMutation, tn as deleteBankAccountApplicationMutation, gr as deleteLedgerAccountsIdMutation, Rr as deleteReceiptsIdMutation, Ai as disableUserMutation, ln as getAggregateHistoricalBalancesQueryKey, Un as getAnalyticsPayablesOptions, w as getAnalyticsPayablesQueryKey, Wn as getAnalyticsReceiptsOptions, T as getAnalyticsReceiptsQueryKey, Gn as getAnalyticsReceivablesOptions, E as getAnalyticsReceivablesQueryKey, Kn as getAnalyticsTransactionsOptions, D as getAnalyticsTransactionsQueryKey, Yt as getApplicationStatusOptions, c as getApplicationStatusQueryKey, Qn as getApprovalPoliciesIdProcessesIdStepsOptions, A as getApprovalPoliciesIdProcessesIdStepsQueryKey, Zn as getApprovalPoliciesIdProcessesOptions, k as getApprovalPoliciesIdProcessesQueryKey, qn as getApprovalPoliciesOptions, O as getApprovalPoliciesQueryKey, $n as getApprovalRequestsOptions, j as getApprovalRequestsQueryKey, pn as getBankAccountAccessQueryKey, nn as getBankAccountApplicationOptions, l as getBankAccountApplicationQueryKey, gn as getBankAccountHistoricalBalancesQueryKey, dn as getBankAccountOptions, p as getBankAccountQueryKey, _n as getBankAccountStatementsOptions, m as getBankAccountStatementsQueryKey, vn as getBankAccountTransactionsOptions, h as getBankAccountTransactionsQueryKey, on as getBankAccountsOptions, u as getBankAccountsQueryKey, tr as getBankDetailsIdOptions, N as getBankDetailsIdQueryKey, er as getBankDetailsOptions, M as getBankDetailsQueryKey, ir as getCounterpartsIdAddressesOptions, I as getCounterpartsIdAddressesQueryKey, ar as getCounterpartsIdBankAccountsOptions, L as getCounterpartsIdBankAccountsQueryKey, rr as getCounterpartsIdOptions, F as getCounterpartsIdQueryKey, nr as getCounterpartsOptions, P as getCounterpartsQueryKey, bn as getCreditCardByIdOptions, _ as getCreditCardByIdQueryKey, yn as getCreditCardsOptions, g as getCreditCardsQueryKey, Tn as getDebitCardByIdOptions, y as getDebitCardByIdQueryKey, On as getDebitCardCredentialsOptions, b as getDebitCardCredentialsQueryKey, An as getDebitCardSpendSummaryOptions, x as getDebitCardSpendSummaryQueryKey, Sn as getDebitCardsOptions, v as getDebitCardsQueryKey, pi as getDepartmentOptions, fi as getDepartmentQueryKey, cn as getDepositableBankAccountsOptions, d as getDepositableBankAccountsQueryKey, or as getDocumentsIdNextNumbersOptions, R as getDocumentsIdNextNumbersQueryKey, sr as getEntitiesIdPaymentMethodsOptions, z as getEntitiesIdPaymentMethodsQueryKey, cr as getEntitiesIdSettingsOptions, B as getEntitiesIdSettingsQueryKey, ur as getEntityUsersMeOptions, H as getEntityUsersMeQueryKey, dr as getEntityUsersMyEntityOptions, U as getEntityUsersMyEntityQueryKey, lr as getEntityUsersOptions, V as getEntityUsersQueryKey, Ln as getExternalBankAccountAccessQueryKey, Fn as getExternalBankAccountOptions, C as getExternalBankAccountQueryKey, Mn as getExternalBankAccountsOptions, S as getExternalBankAccountsQueryKey, fr as getFilesQueryKey, mr as getLedgerAccountsOptions, pr as getLedgerAccountsQueryKey, _i as getLocationOptions, gi as getLocationQueryKey, vr as getMailboxesOptions, W as getMailboxesQueryKey, ki as getMeOptions, Oi as getMeQueryKey, yr as getMeasureUnitsOptions, G as getMeasureUnitsQueryKey, Zt as getMerchantCategoryGroupsOptions, Xt as getMerchantCategoryGroupsQueryKey, vi as getOrganizationOptions, $ as getOrganizationQueryKey, un as getOrganizationTransfersOptions, f as getOrganizationTransfersQueryKey, br as getOverdueRemindersOptions, K as getOverdueRemindersQueryKey, Cr as getPayablesIdHistoryOptions, Y as getPayablesIdHistoryQueryKey, wr as getPayablesIdLineItemsOptions, X as getPayablesIdLineItemsQueryKey, Sr as getPayablesIdOptions, J as getPayablesIdQueryKey, Tr as getPayablesIdSuggestionsOptions, Z as getPayablesIdSuggestionsQueryKey, xr as getPayablesOptions, q as getPayablesQueryKey, Er as getPaymentRecordsOptions, Q as getPaymentRecordsQueryKey, Or as getPaymentRemindersOptions, Dr as getPaymentRemindersQueryKey, Ar as getPaymentTermsOptions, kr as getPaymentTermsQueryKey, Pr as getProductsIdOptions, Nr as getProductsIdQueryKey, Mr as getProductsOptions, jr as getProductsQueryKey, zr as getReceiptsIdQueryKey, Ir as getReceiptsOptions, Fr as getReceiptsQueryKey, qr as getReceivablesIdHistoryQueryKey, Jr as getReceivablesIdMailsQueryKey, Kr as getReceivablesIdOptions, Xr as getReceivablesIdPdfLinkOptions, Yr as getReceivablesIdPdfLinkQueryKey, Gr as getReceivablesIdQueryKey, Hr as getReceivablesOptions, Vr as getReceivablesQueryKey, Wr as getReceivablesRequiredFieldsOptions, Ur as getReceivablesRequiredFieldsQueryKey, ei as getRecurrencesIdOptions, $r as getRecurrencesIdQueryKey, Qr as getRecurrencesOptions, Zr as getRecurrencesQueryKey, li as getTransactionsIdExpenseHistoryOptions, ci as getTransactionsIdExpenseHistoryQueryKey, si as getTransactionsIdOptions, oi as getTransactionsIdQueryKey, ni as getTransactionsOptions, ti as getTransactionsQueryKey, ii as getTransactionsValidationsOptions, ri as getTransactionsValidationsQueryKey, wi as getUserDataOptions, Ci as getUserDataQueryKey, Di as getUsersOptions, Ei as getUsersQueryKey, Qt as getVelocityControlsQueryKey, mn as grantBankAccountAccessMutation, Rn as grantExternalBankAccountAccessMutation, zn as linkExternalBankAccountMutation, di as listDepartmentsOptions, ui as listDepartmentsQueryKey, hi as listLocationsOptions, mi as listLocationsQueryKey, Si as listRolePermissionsOptions, xi as listRolePermissionsQueryKey, bi as listRolesOptions, yi as listRolesQueryKey, wn as manageDebitCardAccessMutation, Xn as patchApprovalPoliciesIdMutation, _r as patchLedgerAccountsIdMutation, Br as patchReceiptsIdMutation, Jn as postApprovalPoliciesMutation, hr as postLedgerAccountsMutation, Lr as postReceiptsUploadFromFileMutation, ai as putTransactionsValidationsMutation, kn as setDebitCardLockStatusMutation, an as submitApplicationMutation, Pn as unlinkExternalBankAccountMutation, rn as updateApplicationMutation, fn as updateBankAccountMutation, En as updateDebitCardMutation, In as updateExternalBankAccountMutation, Ti as upsertUserDataMutation, Bn as validateExternalBankAccountMutation, jn as verifyDebitCardMutation };
1056
+ export { xn as activateCreditCardMutation, On as activateDebitCardMutation, Nn as connectExternalBankAccountMutation, Vn as createAchMoneyMovementMutation, en as createApplicationMutation, sn as createBankAccountMutation, Hn as createBookTransferMutation, hn as createCheckDepositMutation, Cn as createDebitCardMutation, $t as createVelocityControlMutation, Yn as deleteApprovalPoliciesIdMutation, tn as deleteBankAccountApplicationMutation, gr as deleteLedgerAccountsIdMutation, Rr as deleteReceiptsIdMutation, Ai as disableUserMutation, ln as getAggregateHistoricalBalancesQueryKey, Un as getAnalyticsPayablesOptions, w as getAnalyticsPayablesQueryKey, Wn as getAnalyticsReceiptsOptions, T as getAnalyticsReceiptsQueryKey, Gn as getAnalyticsReceivablesOptions, E as getAnalyticsReceivablesQueryKey, Kn as getAnalyticsTransactionsOptions, D as getAnalyticsTransactionsQueryKey, Yt as getApplicationStatusOptions, c as getApplicationStatusQueryKey, Qn as getApprovalPoliciesIdProcessesIdStepsOptions, A as getApprovalPoliciesIdProcessesIdStepsQueryKey, Zn as getApprovalPoliciesIdProcessesOptions, k as getApprovalPoliciesIdProcessesQueryKey, qn as getApprovalPoliciesOptions, O as getApprovalPoliciesQueryKey, $n as getApprovalRequestsOptions, j as getApprovalRequestsQueryKey, pn as getBankAccountAccessQueryKey, nn as getBankAccountApplicationOptions, l as getBankAccountApplicationQueryKey, gn as getBankAccountHistoricalBalancesQueryKey, dn as getBankAccountOptions, p as getBankAccountQueryKey, _n as getBankAccountStatementsOptions, m as getBankAccountStatementsQueryKey, vn as getBankAccountTransactionsOptions, h as getBankAccountTransactionsQueryKey, on as getBankAccountsOptions, u as getBankAccountsQueryKey, tr as getBankDetailsIdOptions, N as getBankDetailsIdQueryKey, er as getBankDetailsOptions, M as getBankDetailsQueryKey, ir as getCounterpartsIdAddressesOptions, I as getCounterpartsIdAddressesQueryKey, ar as getCounterpartsIdBankAccountsOptions, L as getCounterpartsIdBankAccountsQueryKey, rr as getCounterpartsIdOptions, F as getCounterpartsIdQueryKey, nr as getCounterpartsOptions, P as getCounterpartsQueryKey, bn as getCreditCardByIdOptions, _ as getCreditCardByIdQueryKey, yn as getCreditCardsOptions, g as getCreditCardsQueryKey, En as getDebitCardByIdOptions, b as getDebitCardByIdQueryKey, kn as getDebitCardCredentialsOptions, x as getDebitCardCredentialsQueryKey, Tn as getDebitCardSpendSummaryOptions, y as getDebitCardSpendSummaryQueryKey, Sn as getDebitCardsOptions, v as getDebitCardsQueryKey, pi as getDepartmentOptions, fi as getDepartmentQueryKey, cn as getDepositableBankAccountsOptions, d as getDepositableBankAccountsQueryKey, or as getDocumentsIdNextNumbersOptions, R as getDocumentsIdNextNumbersQueryKey, sr as getEntitiesIdPaymentMethodsOptions, z as getEntitiesIdPaymentMethodsQueryKey, cr as getEntitiesIdSettingsOptions, B as getEntitiesIdSettingsQueryKey, ur as getEntityUsersMeOptions, H as getEntityUsersMeQueryKey, dr as getEntityUsersMyEntityOptions, U as getEntityUsersMyEntityQueryKey, lr as getEntityUsersOptions, V as getEntityUsersQueryKey, Ln as getExternalBankAccountAccessQueryKey, Fn as getExternalBankAccountOptions, C as getExternalBankAccountQueryKey, Mn as getExternalBankAccountsOptions, S as getExternalBankAccountsQueryKey, fr as getFilesQueryKey, mr as getLedgerAccountsOptions, pr as getLedgerAccountsQueryKey, _i as getLocationOptions, gi as getLocationQueryKey, vr as getMailboxesOptions, W as getMailboxesQueryKey, ki as getMeOptions, Oi as getMeQueryKey, yr as getMeasureUnitsOptions, G as getMeasureUnitsQueryKey, Zt as getMerchantCategoryGroupsOptions, Xt as getMerchantCategoryGroupsQueryKey, vi as getOrganizationOptions, $ as getOrganizationQueryKey, un as getOrganizationTransfersOptions, f as getOrganizationTransfersQueryKey, br as getOverdueRemindersOptions, K as getOverdueRemindersQueryKey, Cr as getPayablesIdHistoryOptions, Y as getPayablesIdHistoryQueryKey, wr as getPayablesIdLineItemsOptions, X as getPayablesIdLineItemsQueryKey, Sr as getPayablesIdOptions, J as getPayablesIdQueryKey, Tr as getPayablesIdSuggestionsOptions, Z as getPayablesIdSuggestionsQueryKey, xr as getPayablesOptions, q as getPayablesQueryKey, Er as getPaymentRecordsOptions, Q as getPaymentRecordsQueryKey, Or as getPaymentRemindersOptions, Dr as getPaymentRemindersQueryKey, Ar as getPaymentTermsOptions, kr as getPaymentTermsQueryKey, Pr as getProductsIdOptions, Nr as getProductsIdQueryKey, Mr as getProductsOptions, jr as getProductsQueryKey, zr as getReceiptsIdQueryKey, Ir as getReceiptsOptions, Fr as getReceiptsQueryKey, qr as getReceivablesIdHistoryQueryKey, Jr as getReceivablesIdMailsQueryKey, Kr as getReceivablesIdOptions, Xr as getReceivablesIdPdfLinkOptions, Yr as getReceivablesIdPdfLinkQueryKey, Gr as getReceivablesIdQueryKey, Hr as getReceivablesOptions, Vr as getReceivablesQueryKey, Wr as getReceivablesRequiredFieldsOptions, Ur as getReceivablesRequiredFieldsQueryKey, ei as getRecurrencesIdOptions, $r as getRecurrencesIdQueryKey, Qr as getRecurrencesOptions, Zr as getRecurrencesQueryKey, li as getTransactionsIdExpenseHistoryOptions, ci as getTransactionsIdExpenseHistoryQueryKey, si as getTransactionsIdOptions, oi as getTransactionsIdQueryKey, ni as getTransactionsOptions, ti as getTransactionsQueryKey, ii as getTransactionsValidationsOptions, ri as getTransactionsValidationsQueryKey, wi as getUserDataOptions, Ci as getUserDataQueryKey, Di as getUsersOptions, Ei as getUsersQueryKey, Qt as getVelocityControlsQueryKey, mn as grantBankAccountAccessMutation, Rn as grantExternalBankAccountAccessMutation, zn as linkExternalBankAccountMutation, di as listDepartmentsOptions, ui as listDepartmentsQueryKey, hi as listLocationsOptions, mi as listLocationsQueryKey, Si as listRolePermissionsOptions, xi as listRolePermissionsQueryKey, bi as listRolesOptions, yi as listRolesQueryKey, wn as manageDebitCardAccessMutation, Xn as patchApprovalPoliciesIdMutation, _r as patchLedgerAccountsIdMutation, Br as patchReceiptsIdMutation, Jn as postApprovalPoliciesMutation, hr as postLedgerAccountsMutation, Lr as postReceiptsUploadFromFileMutation, ai as putTransactionsValidationsMutation, An as setDebitCardLockStatusMutation, an as submitApplicationMutation, Pn as unlinkExternalBankAccountMutation, rn as updateApplicationMutation, fn as updateBankAccountMutation, Dn as updateDebitCardMutation, In as updateExternalBankAccountMutation, Ti as upsertUserDataMutation, Bn as validateExternalBankAccountMutation, jn as verifyDebitCardMutation };
@@ -391,6 +391,18 @@ var n = (e) => (e.client ?? t).post({
391
391
  ...e.headers
392
392
  }
393
393
  }), P = (e) => (e.client ?? t).get({
394
+ security: [{
395
+ key: "APPToken",
396
+ scheme: "bearer",
397
+ type: "http"
398
+ }, {
399
+ key: "USERToken",
400
+ scheme: "bearer",
401
+ type: "http"
402
+ }],
403
+ url: "/embedded-banking/v1/debit-cards/spend-summary",
404
+ ...e
405
+ }), F = (e) => (e.client ?? t).get({
394
406
  security: [{
395
407
  key: "APPToken",
396
408
  scheme: "bearer",
@@ -402,7 +414,7 @@ var n = (e) => (e.client ?? t).post({
402
414
  }],
403
415
  url: "/embedded-banking/v1/debit-cards/{id}",
404
416
  ...e
405
- }), F = (e) => (e.client ?? t).patch({
417
+ }), I = (e) => (e.client ?? t).patch({
406
418
  security: [{
407
419
  key: "APPToken",
408
420
  scheme: "bearer",
@@ -418,7 +430,7 @@ var n = (e) => (e.client ?? t).post({
418
430
  "Content-Type": "application/json",
419
431
  ...e.headers
420
432
  }
421
- }), I = (e) => (e.client ?? t).post({
433
+ }), L = (e) => (e.client ?? t).post({
422
434
  security: [{
423
435
  key: "APPToken",
424
436
  scheme: "bearer",
@@ -430,7 +442,7 @@ var n = (e) => (e.client ?? t).post({
430
442
  }],
431
443
  url: "/embedded-banking/v1/debit-cards/{id}/activate",
432
444
  ...e
433
- }), L = (e) => (e.client ?? t).get({
445
+ }), R = (e) => (e.client ?? t).get({
434
446
  security: [{
435
447
  key: "APPToken",
436
448
  scheme: "bearer",
@@ -442,7 +454,7 @@ var n = (e) => (e.client ?? t).post({
442
454
  }],
443
455
  url: "/embedded-banking/v1/debit-cards/{id}/credentials",
444
456
  ...e
445
- }), R = (e) => (e.client ?? t).post({
457
+ }), z = (e) => (e.client ?? t).post({
446
458
  security: [{
447
459
  key: "APPToken",
448
460
  scheme: "bearer",
@@ -458,18 +470,6 @@ var n = (e) => (e.client ?? t).post({
458
470
  "Content-Type": "application/json",
459
471
  ...e.headers
460
472
  }
461
- }), z = (e) => (e.client ?? t).get({
462
- security: [{
463
- key: "APPToken",
464
- scheme: "bearer",
465
- type: "http"
466
- }, {
467
- key: "USERToken",
468
- scheme: "bearer",
469
- type: "http"
470
- }],
471
- url: "/embedded-banking/v1/debit-cards/spend-summary",
472
- ...e
473
473
  }), B = (e) => (e.client ?? t).post({
474
474
  security: [{
475
475
  key: "APPToken",
@@ -2112,4 +2112,4 @@ var n = (e) => (e.client ?? t).post({
2112
2112
  ...e.headers
2113
2113
  }
2114
2114
  });
2115
- export { A as activateCreditCard, I as activateDebitCard, gn as bulkUpdateDepartmentMembers, Cn as bulkUpdateLocationMembers, En as bulkUpdateRoleMembers, H as connectExternalBankAccount, X as createAchMoneyMovement, s as createApplication, p as createBankAccount, Z as createBookTransfer, S as createCheckDeposit, M as createDebitCard, fn as createDepartment, yn as createLocation, jn as createUser, o as createVelocityControl, pn as deactivateDepartment, bn as deactivateLocation, ie as deleteApprovalPoliciesId, c as deleteBankAccountApplication, ge as deleteCounterpartsId, we as deleteCounterpartsIdBankAccountsId, De as deleteEntitiesIdLogo, Ie as deleteFilesId, ze as deleteLedgerAccountsId, We as deleteMeasureUnitsId, Ze as deletePayablesId, at as deletePayablesIdFile, wt as deleteProductsId, kt as deleteReceiptsId, Pt as deleteReceivablesId, Pn as disableUser, D as downloadBankAccountTransactions, g as getAggregateHistoricalBalances, Q as getAnalyticsPayables, $ as getAnalyticsReceipts, ee as getAnalyticsReceivables, te as getAnalyticsTransactions, r as getApiWidgetGatewayInit, i as getApplicationStatus, ne as getApprovalPolicies, oe as getApprovalPoliciesIdProcesses, se as getApprovalPoliciesIdProcessesIdSteps, ce as getApprovalRequests, v as getBankAccount, b as getBankAccountAccess, l as getBankAccountApplication, C as getBankAccountHistoricalBalances, T as getBankAccountStatement, w as getBankAccountStatements, E as getBankAccountTransactions, f as getBankAccounts, de as getBankDetails, pe as getBankDetailsId, me as getCounterparts, _e as getCounterpartsId, ye as getCounterpartsIdAddresses, Se as getCounterpartsIdBankAccounts, k as getCreditCardById, O as getCreditCards, P as getDebitCardById, L as getDebitCardCredentials, z as getDebitCardSpendSummary, j as getDebitCards, mn as getDepartment, h as getDepositableBankAccounts, _n as getDisclosures, Ee as getDocumentsIdNextNumbers, ke as getEntitiesIdPaymentMethods, Ae as getEntitiesIdSettings, Me as getEntityUsers, Ne as getEntityUsersMe, Pe as getEntityUsersMyEntity, W as getExternalBankAccount, K as getExternalBankAccountAccess, V as getExternalBankAccounts, Le as getLedgerAccounts, xn as getLocation, Ve as getMailboxes, Mn as getMe, He as getMeasureUnits, a as getMerchantCategoryGroups, wn as getOrganization, _ as getOrganizationTransfers, Ke as getOverdueReminders, Je as getPayables, Qe as getPayablesId, ot as getPayablesIdHistory, st as getPayablesIdLineItems, mt as getPayablesIdSuggestions, _t as getPaymentRecords, yt as getPaymentReminders, xt as getPaymentTerms, St as getProducts, Tt as getProductsId, Dt as getReceipts, jt as getReceivables, Ft as getReceivablesId, Vt as getReceivablesIdHistory, Gt as getReceivablesIdPdfLink, Nt as getReceivablesRequiredFields, qt as getRecurrences, Yt as getRecurrencesId, en as getTransactions, rn as getTransactionsId, sn as getTransactionsIdExpenseHistory, tn as getTransactionsValidations, On as getUserData, An as getUsers, x as grantBankAccountAccess, q as grantExternalBankAccountAccess, J as linkExternalBankAccount, dn as listDepartments, vn as listLocations, Dn as listRolePermissions, Tn as listRoles, m as manageBankAccountAccess, N as manageDebitCardAccess, ae as patchApprovalPoliciesId, ve as patchCounterpartsId, xe as patchCounterpartsIdAddressesId, Te as patchCounterpartsIdBankAccountsId, je as patchEntitiesIdSettings, Be as patchLedgerAccountsId, Ge as patchMeasureUnitsId, $e as patchPayablesId, Et as patchProductsId, At as patchReceiptsId, It as patchReceivablesId, Xt as patchRecurrencesId, an as patchTransactionsId, n as postApiWidgetGatewayDisclosureAcceptance, re as postApprovalPolicies, le as postApprovalRequestsIdApprove, ue as postApprovalRequestsIdReject, fe as postBankDetails, he as postCounterparts, be as postCounterpartsIdAddresses, Ce as postCounterpartsIdBankAccounts, Fe as postFiles, Re as postLedgerAccounts, Ue as postMeasureUnits, qe as postOverdueReminders, Ye as postPayables, et as postPayablesIdApprovePaymentOperation, tt as postPayablesIdAttachFile, nt as postPayablesIdCancel, rt as postPayablesIdDuplicatesIdConfirm, it as postPayablesIdDuplicatesIdDismiss, lt as postPayablesIdMarkAsPaid, ut as postPayablesIdReject, dt as postPayablesIdReopen, ft as postPayablesIdSchedulePayment, pt as postPayablesIdSubmitForApproval, ht as postPayablesIdValidate, Xe as postPayablesUploadFromFile, gt as postPaymentIntentsIdCancel, vt as postPaymentRecords, bt as postPaymentReminders, Ct as postProducts, Ot as postReceiptsUploadFromFile, Mt as postReceivables, Lt as postReceivablesIdAccept, Rt as postReceivablesIdCancel, zt as postReceivablesIdClone, Bt as postReceivablesIdDecline, Ht as postReceivablesIdIssue, Ut as postReceivablesIdMarkAsPaid, Wt as postReceivablesIdMarkAsUncollectible, Kt as postReceivablesIdSend, Jt as postRecurrences, Zt as postRecurrencesIdCancel, Qt as postRecurrencesIdPause, $t as postRecurrencesIdResume, on as postTransactionsIdApprove, cn as postTransactionsIdReject, ln as postTransactionsIdReopen, un as postTransactionsIdSubmit, Oe as putEntitiesIdLogo, ct as putPayablesIdLineItems, nn as putTransactionsValidations, Fn as resendUserInvitation, R as setDebitCardLockStatus, d as submitApplication, U as unlinkExternalBankAccount, u as updateApplication, y as updateBankAccount, F as updateDebitCard, hn as updateDepartment, G as updateExternalBankAccount, Sn as updateLocation, Nn as updateUser, kn as upsertUserData, Y as validateExternalBankAccount, B as verifyDebitCard };
2115
+ export { A as activateCreditCard, L as activateDebitCard, gn as bulkUpdateDepartmentMembers, Cn as bulkUpdateLocationMembers, En as bulkUpdateRoleMembers, H as connectExternalBankAccount, X as createAchMoneyMovement, s as createApplication, p as createBankAccount, Z as createBookTransfer, S as createCheckDeposit, M as createDebitCard, fn as createDepartment, yn as createLocation, jn as createUser, o as createVelocityControl, pn as deactivateDepartment, bn as deactivateLocation, ie as deleteApprovalPoliciesId, c as deleteBankAccountApplication, ge as deleteCounterpartsId, we as deleteCounterpartsIdBankAccountsId, De as deleteEntitiesIdLogo, Ie as deleteFilesId, ze as deleteLedgerAccountsId, We as deleteMeasureUnitsId, Ze as deletePayablesId, at as deletePayablesIdFile, wt as deleteProductsId, kt as deleteReceiptsId, Pt as deleteReceivablesId, Pn as disableUser, D as downloadBankAccountTransactions, g as getAggregateHistoricalBalances, Q as getAnalyticsPayables, $ as getAnalyticsReceipts, ee as getAnalyticsReceivables, te as getAnalyticsTransactions, r as getApiWidgetGatewayInit, i as getApplicationStatus, ne as getApprovalPolicies, oe as getApprovalPoliciesIdProcesses, se as getApprovalPoliciesIdProcessesIdSteps, ce as getApprovalRequests, v as getBankAccount, b as getBankAccountAccess, l as getBankAccountApplication, C as getBankAccountHistoricalBalances, T as getBankAccountStatement, w as getBankAccountStatements, E as getBankAccountTransactions, f as getBankAccounts, de as getBankDetails, pe as getBankDetailsId, me as getCounterparts, _e as getCounterpartsId, ye as getCounterpartsIdAddresses, Se as getCounterpartsIdBankAccounts, k as getCreditCardById, O as getCreditCards, F as getDebitCardById, R as getDebitCardCredentials, P as getDebitCardSpendSummary, j as getDebitCards, mn as getDepartment, h as getDepositableBankAccounts, _n as getDisclosures, Ee as getDocumentsIdNextNumbers, ke as getEntitiesIdPaymentMethods, Ae as getEntitiesIdSettings, Me as getEntityUsers, Ne as getEntityUsersMe, Pe as getEntityUsersMyEntity, W as getExternalBankAccount, K as getExternalBankAccountAccess, V as getExternalBankAccounts, Le as getLedgerAccounts, xn as getLocation, Ve as getMailboxes, Mn as getMe, He as getMeasureUnits, a as getMerchantCategoryGroups, wn as getOrganization, _ as getOrganizationTransfers, Ke as getOverdueReminders, Je as getPayables, Qe as getPayablesId, ot as getPayablesIdHistory, st as getPayablesIdLineItems, mt as getPayablesIdSuggestions, _t as getPaymentRecords, yt as getPaymentReminders, xt as getPaymentTerms, St as getProducts, Tt as getProductsId, Dt as getReceipts, jt as getReceivables, Ft as getReceivablesId, Vt as getReceivablesIdHistory, Gt as getReceivablesIdPdfLink, Nt as getReceivablesRequiredFields, qt as getRecurrences, Yt as getRecurrencesId, en as getTransactions, rn as getTransactionsId, sn as getTransactionsIdExpenseHistory, tn as getTransactionsValidations, On as getUserData, An as getUsers, x as grantBankAccountAccess, q as grantExternalBankAccountAccess, J as linkExternalBankAccount, dn as listDepartments, vn as listLocations, Dn as listRolePermissions, Tn as listRoles, m as manageBankAccountAccess, N as manageDebitCardAccess, ae as patchApprovalPoliciesId, ve as patchCounterpartsId, xe as patchCounterpartsIdAddressesId, Te as patchCounterpartsIdBankAccountsId, je as patchEntitiesIdSettings, Be as patchLedgerAccountsId, Ge as patchMeasureUnitsId, $e as patchPayablesId, Et as patchProductsId, At as patchReceiptsId, It as patchReceivablesId, Xt as patchRecurrencesId, an as patchTransactionsId, n as postApiWidgetGatewayDisclosureAcceptance, re as postApprovalPolicies, le as postApprovalRequestsIdApprove, ue as postApprovalRequestsIdReject, fe as postBankDetails, he as postCounterparts, be as postCounterpartsIdAddresses, Ce as postCounterpartsIdBankAccounts, Fe as postFiles, Re as postLedgerAccounts, Ue as postMeasureUnits, qe as postOverdueReminders, Ye as postPayables, et as postPayablesIdApprovePaymentOperation, tt as postPayablesIdAttachFile, nt as postPayablesIdCancel, rt as postPayablesIdDuplicatesIdConfirm, it as postPayablesIdDuplicatesIdDismiss, lt as postPayablesIdMarkAsPaid, ut as postPayablesIdReject, dt as postPayablesIdReopen, ft as postPayablesIdSchedulePayment, pt as postPayablesIdSubmitForApproval, ht as postPayablesIdValidate, Xe as postPayablesUploadFromFile, gt as postPaymentIntentsIdCancel, vt as postPaymentRecords, bt as postPaymentReminders, Ct as postProducts, Ot as postReceiptsUploadFromFile, Mt as postReceivables, Lt as postReceivablesIdAccept, Rt as postReceivablesIdCancel, zt as postReceivablesIdClone, Bt as postReceivablesIdDecline, Ht as postReceivablesIdIssue, Ut as postReceivablesIdMarkAsPaid, Wt as postReceivablesIdMarkAsUncollectible, Kt as postReceivablesIdSend, Jt as postRecurrences, Zt as postRecurrencesIdCancel, Qt as postRecurrencesIdPause, $t as postRecurrencesIdResume, on as postTransactionsIdApprove, cn as postTransactionsIdReject, ln as postTransactionsIdReopen, un as postTransactionsIdSubmit, Oe as putEntitiesIdLogo, ct as putPayablesIdLineItems, nn as putTransactionsValidations, Fn as resendUserInvitation, z as setDebitCardLockStatus, d as submitApplication, U as unlinkExternalBankAccount, u as updateApplication, y as updateBankAccount, I as updateDebitCard, hn as updateDepartment, G as updateExternalBankAccount, Sn as updateLocation, Nn as updateUser, kn as upsertUserData, Y as validateExternalBankAccount, B as verifyDebitCard };
@@ -1,5 +1,5 @@
1
1
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.11.188", n = "af5b5fcbad8da2e73c0362a44fb0118cf4a98fb6", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.11.189", n = "d37ca11d9eadf9053f52ee31b7a62f76e0d97a7e", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -5,111 +5,111 @@
5
5
  import { TESOURO_NEW_EMBEDDED_BANK_ACCOUNT_CREATED_SUCCESS_EVENT as e, TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as t } from "../../../../../shared/util/dist/lib/widgetDomEvents.js";
6
6
  import "../../../../../shared/util/dist/index.js";
7
7
  import { isOrganizationOnItsWay as ee } from "../../../../../shared/data-access/dist/lib/organizationStatus.js";
8
- import { useEmbedApi as n } from "../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
- import { Scope as r } from "../../../../../shared/data-access/dist/lib/scopes.js";
8
+ import { useEmbedApi as te } from "../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
+ import { Scope as n } from "../../../../../shared/data-access/dist/lib/scopes.js";
10
10
  import "../../../../../shared/data-access/dist/index.js";
11
- import { useAnalyticsTrack as te } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
12
- import { useWidgetConfig as ne } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
+ import { useAnalyticsTrack as r } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
12
+ import { useWidgetConfig as i } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
13
  import "../../../../../shared/feature/dist/index.js";
14
- import { DEFAULT_FEATURE_LABELS as i } from "./featureLabels.js";
15
- import { TRANSFERS_ANALYTICS_EVENTS as re } from "../analytics/events.js";
16
- import { isPaginatedAccountsQueryInFlight as a } from "../../../../data-access/dist/index2.js";
17
- import { useTransferBankAccountsQuery as ie } from "../../../../data-access/dist/index4.js";
18
- import { useTransferExternalAccountsQuery as ae } from "../../../../data-access/dist/index5.js";
19
- import { useOrganizationTransfersQuery as oe } from "../../../../data-access/dist/index6.js";
14
+ import { DEFAULT_FEATURE_LABELS as a } from "./featureLabels.js";
15
+ import { TRANSFERS_ANALYTICS_EVENTS as ne } from "../analytics/events.js";
16
+ import { isPaginatedAccountsQueryInFlight as o } from "../../../../data-access/dist/index2.js";
17
+ import { useTransferBankAccountsQuery as re } from "../../../../data-access/dist/index4.js";
18
+ import { useTransferExternalAccountsQuery as ie } from "../../../../data-access/dist/index5.js";
19
+ import { useOrganizationTransfersQuery as s } from "../../../../data-access/dist/index6.js";
20
20
  import "../../../../data-access/dist/index.js";
21
- import { useTransferMoneyModalController as se } from "./useTransferMoneyModalController.js";
22
- import { buildAccountDirectory as ce, mapTransferToDetailView as o, mapTransferToRowView as s } from "./transferViews.js";
21
+ import { useTransferMoneyModalController as ae } from "./useTransferMoneyModalController.js";
22
+ import { buildAccountDirectory as oe, mapTransferToDetailView as se, mapTransferToRowView as ce } from "./transferViews.js";
23
23
  import { transfersWidgetTestIds as c } from "./testIds.js";
24
24
  import { TRANSFERS_PAGE_SIZE_OPTIONS as le, useTransfersPageState as ue } from "./useTransfersPageState.js";
25
25
  import { TRANSFERS_WIDGET_LABELS_EN as de } from "../../../../ui/dist/lib/TransfersWidget/labels.js";
26
26
  import { TransfersWidget as fe } from "../../../../ui/dist/lib/TransfersWidget/TransfersWidget.js";
27
27
  import "../../../../ui/dist/index.js";
28
- import { useCallback as pe, useEffect as l, useMemo as u, useState as d } from "react";
29
- import { jsx as f } from "react/jsx-runtime";
28
+ import { useCallback as pe, useEffect as l, useMemo as me, useState as u } from "react";
29
+ import { jsx as he } from "react/jsx-runtime";
30
30
  // ../../libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js
31
- var p = [r.TransferWriteOrg, r.BankAccountReadOrg], m = [t, e];
32
- function h({ labels: e, featureLabels: t, isTransferMoneyOpen: h, defaultIsTransferMoneyOpen: me, onTransferMoneyOpenChange: he, onLinkAccountClick: g }) {
33
- let _ = {
34
- ...i,
31
+ var d = [n.TransferWriteOrg, n.BankAccountReadOrg], f = [t, e];
32
+ function p({ labels: e, featureLabels: t, isTransferMoneyOpen: p, defaultIsTransferMoneyOpen: ge, onTransferMoneyOpenChange: m, onLinkAccountClick: h }) {
33
+ let g = {
34
+ ...a,
35
35
  ...t
36
- }, v = {
36
+ }, _ = {
37
37
  ...de,
38
38
  ...e,
39
39
  ...t?.routeSeparator === void 0 ? {} : { listAccountsSeparator: t.routeSeparator }
40
- }, y = te(), { initResponse: b } = ne(), { organizationId: ge, organizationStatus: _e } = n(), ve = ee(_e);
40
+ }, v = r(), { initResponse: y } = i(), { organizationId: _e, organizationStatus: ve } = te(), ye = ee(ve);
41
41
  l(() => {
42
- y(re.Mounted);
43
- }, [y]);
44
- let x = b?.scopes ?? [], S = x.includes(r.ExternalBankAccountReadOrg), ye = x.includes(r.PaymentRailAch), C = S && ye, w = p.every((e) => x.includes(e)), T = ue({
45
- organizationId: ge,
46
- userId: b?.userId
47
- }), { data: E, isLoading: D, isError: O, isPlaceholderData: k, refetch: A } = oe({
48
- limit: T.pageSize,
49
- pagination_token: T.paginationToken
50
- }), j = ie(), { data: M, isError: N, refetch: P } = j, F = ae({ enabled: S }), { data: I, isError: be, refetch: L } = F, R = M?.data ?? [], z = u(() => C ? (I?.data ?? []).filter((e) => e.verificationStatus === "VERIFIED" && e.accountStatus === "ACTIVE") : [], [C, I?.data]), xe = I?.data, B = ce(R, xe ?? [], v), V = E?.data, H = (V ?? []).map((e) => s(e, B, v, _)), [Se, U] = d(), W = `${T.pageSize}:${T.paginationToken ?? ""}`, [Ce, we] = d(W);
51
- W !== Ce && (we(W), U(void 0));
52
- let G = V?.find((e) => e.id === Se), Te = G ? o(G, B, v, _) : void 0, K = E?.nextPaginationToken ?? void 0, q = E?.prevPaginationToken ?? void 0, [J, Ee] = d(T);
53
- k || J.pageIndex === T.pageIndex && J.pageSize === T.pageSize || Ee(T);
54
- let Y = J.pageIndex * J.pageSize, De = {
55
- pageSize: T.pageSize,
42
+ v(ne.Mounted);
43
+ }, [v]);
44
+ let b = y?.scopes ?? [], x = b.includes(n.ExternalBankAccountReadOrg), be = b.includes(n.PaymentRailAch), S = x && be, C = d.every((e) => b.includes(e)), w = ue({
45
+ organizationId: _e,
46
+ userId: y?.userId
47
+ }), { data: T, isLoading: E, isError: D, isPlaceholderData: O, refetch: k } = s({
48
+ limit: w.pageSize,
49
+ pagination_token: w.paginationToken
50
+ }), A = re(), { data: j, isError: M, refetch: N } = A, P = ie({ enabled: x }), { data: F, isError: xe, refetch: I } = P, L = j?.data ?? [], R = me(() => S ? (F?.data ?? []).filter((e) => e.verificationStatus === "VERIFIED" && e.accountStatus === "ACTIVE") : [], [S, F?.data]), Se = F?.data, z = oe(L, Se ?? [], _), B = T?.data, V = (B ?? []).map((e) => ce(e, z, _, g)), [Ce, H] = u(), U = `${w.pageSize}:${w.paginationToken ?? ""}`, [we, Te] = u(U);
51
+ U !== we && (Te(U), H(void 0));
52
+ let W = B?.find((e) => e.id === Ce), Ee = W ? se(W, z, _, g) : void 0, G = T?.nextPaginationToken ?? void 0, K = T?.prevPaginationToken ?? void 0, [q, De] = u(w);
53
+ O || q.pageIndex === w.pageIndex && q.pageSize === w.pageSize || De(w);
54
+ let J = q.pageIndex * q.pageSize, Oe = {
55
+ pageSize: w.pageSize,
56
56
  pageSizeOptions: le,
57
- rangeLabel: `${_.viewingRangeLabel} ${H.length === 0 ? "0-0" : `${Y + 1}-${Y + H.length}`}`,
58
- isPreviousDisabled: !q,
59
- isNextDisabled: !K,
60
- isDisabled: k,
61
- onPageSizeChange: T.changePageSize,
57
+ rangeLabel: `${g.viewingRangeLabel} ${V.length === 0 ? "0-0" : `${J + 1}-${J + V.length}`}`,
58
+ isPreviousDisabled: !K,
59
+ isNextDisabled: !G,
60
+ isDisabled: O,
61
+ onPageSizeChange: w.changePageSize,
62
62
  onPreviousPageClick: () => {
63
- q && T.goToPreviousPage(q);
63
+ K && w.goToPreviousPage(K);
64
64
  },
65
65
  onNextPageClick: () => {
66
- K && T.goToNextPage(K);
66
+ G && w.goToNextPage(G);
67
67
  }
68
- }, X = pe(() => {
69
- A(), P(), S && L();
68
+ }, Y = pe(() => {
69
+ k(), N(), x && I();
70
70
  }, [
71
- S,
72
- P,
73
- L,
74
- A
71
+ x,
72
+ N,
73
+ I,
74
+ k
75
75
  ]);
76
76
  l(() => {
77
77
  let e = () => {
78
- X();
78
+ Y();
79
79
  };
80
- for (let t of m) window.addEventListener(t, e);
80
+ for (let t of f) window.addEventListener(t, e);
81
81
  return () => {
82
- for (let t of m) window.removeEventListener(t, e);
82
+ for (let t of f) window.removeEventListener(t, e);
83
83
  };
84
- }, [X]);
85
- let { modalProps: Z, openModal: Oe } = se({
86
- labels: v,
87
- featureLabels: _,
88
- embeddedBankAccounts: R,
89
- verifiedExternalBankAccounts: z,
90
- track: y,
91
- isTransferMoneyOpen: h,
92
- defaultIsTransferMoneyOpen: me,
93
- onTransferMoneyOpenChange: he
94
- }), ke = a(j), Ae = S && a(F), je = ve && !M || D || ke || Ae, Q = O || N || S && be, Me = R.length + z.length, $ = !(R.length > 0) || Me <= 1;
95
- return /* @__PURE__ */ f(fe, {
96
- transferRows: H,
97
- pagination: De,
98
- selectedRowKey: G?.id,
99
- onRowClick: U,
100
- transferDetail: Te,
101
- onTransferDetailClose: () => U(void 0),
102
- onLinkAccountClick: g ? () => {
103
- U(void 0), g();
84
+ }, [Y]);
85
+ let { modalProps: ke, openModal: Ae } = ae({
86
+ labels: _,
87
+ featureLabels: g,
88
+ embeddedBankAccounts: L,
89
+ verifiedExternalBankAccounts: R,
90
+ track: v,
91
+ isTransferMoneyOpen: p,
92
+ defaultIsTransferMoneyOpen: ge,
93
+ onTransferMoneyOpenChange: m
94
+ }), je = o(A), Me = x && o(P), X = ye && !j || E || je || Me, Z = D || M || x && xe, Q = L.filter((e) => e.status === "ACTIVE" && !!e.accountNumber), Ne = Q.length + R.length, $ = !(Q.length > 0) || Ne <= 1;
95
+ return /* @__PURE__ */ he(fe, {
96
+ transferRows: V,
97
+ pagination: Oe,
98
+ selectedRowKey: W?.id,
99
+ onRowClick: H,
100
+ transferDetail: Ee,
101
+ onTransferDetailClose: () => H(void 0),
102
+ onLinkAccountClick: h ? () => {
103
+ H(void 0), h();
104
104
  } : void 0,
105
- isLoading: je,
106
- isError: Q,
107
- onRetry: Q ? () => void X() : void 0,
108
- showTransferMoneyCta: w,
105
+ isLoading: X,
106
+ isError: Z,
107
+ onRetry: Z ? () => void Y() : void 0,
108
+ showTransferMoneyCta: C,
109
109
  isTransferMoneyCtaDisabled: $,
110
- onTransferMoneyClick: w && !$ ? () => Oe() : void 0,
110
+ onTransferMoneyClick: C && !$ ? () => Ae() : void 0,
111
111
  transferMoneyModal: {
112
- ...Z,
112
+ ...ke,
113
113
  testIds: {
114
114
  root: c.modal,
115
115
  closeButton: c.modalCloseButton,
@@ -141,4 +141,4 @@ function h({ labels: e, featureLabels: t, isTransferMoneyOpen: h, defaultIsTrans
141
141
  }
142
142
  });
143
143
  }
144
- export { h as TransfersWidgetInner };
144
+ export { p as TransfersWidgetInner };
@@ -8,7 +8,7 @@ function r(e, t, n) {
8
8
  for (let t of e) r.set(t.id, {
9
9
  kind: "internal",
10
10
  name: t.nickname?.trim() || n.accountFallbackName,
11
- last4: t.accountNumber.slice(-4)
11
+ last4: t.accountNumber?.slice(-4)
12
12
  });
13
13
  for (let e of t) r.set(e.id, {
14
14
  kind: "external",
@@ -23,7 +23,7 @@ function i(e, t, n) {
23
23
  kind: i,
24
24
  kindLabel: i === "internal" ? n.accountKindInternal : n.accountKindExternal,
25
25
  name: r?.name ?? (e.nickname?.trim() || n.externalAccountFallbackName),
26
- ...r && { number: { last4: r.last4 } }
26
+ ...r?.last4 && { number: { last4: r.last4 } }
27
27
  };
28
28
  }
29
29
  var a = (t, n) => t.number ? `${t.name} ${e(n.accountMaskTemplate, { last4: t.number.last4 })}` : t.name, o = {
@@ -12,15 +12,15 @@ import "../../../../../shared/util/dist/index.js";
12
12
  import "../../../../../shared/ui/dist/index.js";
13
13
  import { TRANSFERS_ANALYTICS_EVENTS as c } from "../analytics/events.js";
14
14
  import { useCreateBookTransferMutation as ee } from "../../../../data-access/dist/index7.js";
15
- import { useCreateAchMoneyMovementMutation as l } from "../../../../data-access/dist/index8.js";
15
+ import { useCreateAchMoneyMovementMutation as te } from "../../../../data-access/dist/index8.js";
16
16
  import "../../../../data-access/dist/index.js";
17
- import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "react";
18
- import { useControllableState as te } from "@radix-ui/react-use-controllable-state";
17
+ import { useCallback as l, useEffect as ne, useMemo as u, useState as d } from "react";
18
+ import { useControllableState as f } from "@radix-ui/react-use-controllable-state";
19
19
  // ../../libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js
20
- function m(e) {
20
+ function p(e) {
21
21
  return e.slice(-4);
22
22
  }
23
- function h(e, t) {
23
+ function m(e, t) {
24
24
  let n = e.balance;
25
25
  if (!n || n.value === void 0 || n.value === null) return;
26
26
  let i = n.currencyCode ?? t, a = r({
@@ -32,135 +32,140 @@ function h(e, t) {
32
32
  includeSpaceAfterCurrencySymbol: !1
33
33
  });
34
34
  }
35
- function g(e, t, n, r) {
35
+ function h(e, t, n, r) {
36
36
  let i = n.find((t) => t.id === e);
37
37
  if (i?.balance?.currencyCode) return i.balance.currencyCode;
38
38
  let a = n.find((e) => e.id === t);
39
39
  return a?.balance?.currencyCode ? a.balance.currencyCode : r;
40
40
  }
41
- function _(e, t, n) {
42
- let r = e.nickname?.trim() || t.accountFallbackName, i = h(e, n.defaultCurrencyCode);
41
+ function g(e, t, n) {
42
+ let r = e.nickname?.trim() || t.accountFallbackName, i = m(e, n.defaultCurrencyCode);
43
43
  return {
44
44
  optionValue: e.id,
45
45
  primaryLabel: r,
46
- number: { last4: m(e.accountNumber) },
46
+ ...e.accountNumber && { number: { last4: p(e.accountNumber) } },
47
47
  balanceLabel: i
48
48
  };
49
49
  }
50
- function v(e) {
50
+ function _(e) {
51
51
  let t = e.nickname?.trim() || e.nameOnAccount;
52
52
  return {
53
53
  optionValue: e.id,
54
54
  primaryLabel: t,
55
- number: { last4: m(e.accountNumber) }
55
+ number: { last4: p(e.accountNumber) }
56
56
  };
57
57
  }
58
- function y(e, t) {
58
+ function v(e, t) {
59
59
  return {
60
60
  name: e?.primaryLabel ?? "",
61
61
  ...t && { number: {
62
- last4: m(t),
62
+ last4: p(t),
63
63
  fullNumber: t
64
64
  } }
65
65
  };
66
66
  }
67
- var ne = 2;
68
- function b({ labels: r, featureLabels: m, embeddedBankAccounts: h, verifiedExternalBankAccounts: b, track: x, isTransferMoneyOpen: re, defaultIsTransferMoneyOpen: ie, onTransferMoneyOpenChange: ae }) {
69
- let S = ee(), C = l(), w = f(() => new Set(h.map((e) => e.id)), [h]), T = f(() => h.map((e) => _(e, r, m)), [
70
- h,
71
- m,
67
+ var re = 2;
68
+ function y({ labels: r, featureLabels: p, embeddedBankAccounts: m, verifiedExternalBankAccounts: y, track: b, isTransferMoneyOpen: ie, defaultIsTransferMoneyOpen: x, onTransferMoneyOpenChange: S }) {
69
+ let C = ee(), w = te(), T = u(() => m.filter((e) => e.status === "ACTIVE" && !!e.accountNumber), [m]), E = u(() => new Set(T.map((e) => e.id)), [T]), D = u(() => T.map((e) => g(e, r, p)), [
70
+ T,
71
+ p,
72
72
  r.accountFallbackName
73
- ]), E = f(() => b.map((e) => v(e)), [b]), D = f(() => [...T, ...E], [T, E]), [O, k] = te({
74
- prop: re,
75
- defaultProp: ie ?? !1,
76
- onChange: ae,
73
+ ]), O = u(() => y.map((e) => _(e)), [y]), k = u(() => [...D, ...O], [D, O]), [A, j] = f({
74
+ prop: ie,
75
+ defaultProp: x ?? !1,
76
+ onChange: S,
77
77
  caller: "TransfersWidget"
78
- }), [A, j] = p("accounts"), [M, N] = p(""), [P, F] = p(""), [I, L] = p(""), [oe, R] = p(null), [z, B] = p(null), [V, H] = p(null), [U, W] = p(!1), [G, K] = p(0), q = u(() => {
79
- N(""), F(""), L(""), R(null), B(null), H(null), W(!1);
80
- }, []), se = u(() => {
81
- j("accounts"), q();
82
- }, [q]), [ce, le] = p(O);
83
- O !== ce && (le(O), O && se()), d(() => {
84
- O && x(c.TransferMoneyOpened);
85
- }, [O, x]);
86
- let ue = u((e) => {
87
- k(e);
88
- }, [k]), de = u(() => {
89
- k(!0);
90
- }, [k]), J = w.has(M), Y = w.has(P), X = f(() => g(M, P, h, m.defaultCurrencyCode), [
91
- h,
92
- m.defaultCurrencyCode,
93
- M,
94
- P
95
- ]), Z = u((e, t, i) => {
96
- let a = s(e, g(t, i, h, m.defaultCurrencyCode));
78
+ }), [M, N] = d("accounts"), [P, F] = d(""), [I, L] = d(""), [R, z] = d(""), [ae, B] = d(null), [oe, V] = d(null), [H, U] = d(null), [W, G] = d(!1), [K, se] = d(0), q = l(() => {
79
+ F(""), L(""), z(""), B(null), V(null), U(null), G(!1);
80
+ }, []), ce = l(() => {
81
+ N("accounts"), q();
82
+ }, [q]), [le, ue] = d(A);
83
+ A !== le && (ue(A), A && ce()), ne(() => {
84
+ A && b(c.TransferMoneyOpened);
85
+ }, [A, b]);
86
+ let de = l((e) => {
87
+ j(e);
88
+ }, [j]), fe = l(() => {
89
+ j(!0);
90
+ }, [j]), J = E.has(P), Y = E.has(I), X = u(() => h(P, I, T, p.defaultCurrencyCode), [
91
+ T,
92
+ p.defaultCurrencyCode,
93
+ P,
94
+ I
95
+ ]), Z = l((e, t, i) => {
96
+ let a = s(e, h(t, i, T, p.defaultCurrencyCode));
97
97
  if (a === null) return r.modalAmountInvalidError;
98
- let o = h.find((e) => e.id === t);
98
+ let o = T.find((e) => e.id === t);
99
99
  return o && a > n(o.balance?.value) ? r.modalInsufficientFundsError : null;
100
100
  }, [
101
- h,
102
- m.defaultCurrencyCode,
101
+ T,
102
+ p.defaultCurrencyCode,
103
103
  r.modalAmountInvalidError,
104
104
  r.modalInsufficientFundsError
105
- ]), Q = f(() => a(X), [X]), fe = f(() => P ? Y ? D.filter((e) => e.optionValue !== P) : T.filter((e) => e.optionValue !== P) : D, [
105
+ ]), pe = u(() => a(X), [X]), me = u(() => I ? Y ? k.filter((e) => e.optionValue !== I) : D.filter((e) => e.optionValue !== I) : k, [
106
+ k,
106
107
  D,
107
- T,
108
- P,
108
+ I,
109
109
  Y
110
- ]), pe = f(() => M ? J ? D.filter((e) => e.optionValue !== M) : T.filter((e) => e.optionValue !== M) : D, [
110
+ ]), he = u(() => P ? J ? k.filter((e) => e.optionValue !== P) : D.filter((e) => e.optionValue !== P) : k, [
111
+ k,
111
112
  D,
112
- T,
113
- M,
113
+ P,
114
114
  J
115
- ]), me = u((e) => {
116
- N(e), R(null), H(U ? Z(I, e, P) : null);
115
+ ]), ge = l((e) => {
116
+ F(e), B(null), U(W ? Z(R, e, I) : null);
117
117
  }, [
118
+ R,
118
119
  I,
119
- P,
120
120
  Z,
121
- U
122
- ]), he = u((e) => {
123
- F(e), B(null), H(U ? Z(I, M, e) : null);
121
+ W
122
+ ]), _e = l((e) => {
123
+ L(e), V(null), U(W ? Z(R, P, e) : null);
124
124
  }, [
125
- I,
126
- M,
125
+ R,
126
+ P,
127
127
  Z,
128
- U
129
- ]), ge = u((e) => {
130
- L(e), H(U ? Z(e, M, P) : null);
128
+ W
129
+ ]), ve = l((e) => {
130
+ z(e), U(W ? Z(e, P, I) : null);
131
131
  }, [
132
- M,
133
132
  P,
133
+ I,
134
134
  Z,
135
- U
136
- ]), _e = f(() => {
137
- let e = s(I, X);
135
+ W
136
+ ]), ye = u(() => {
137
+ let e = s(R, X);
138
138
  if (e === null) return "";
139
139
  let t = i(X);
140
140
  return o(e / 10 ** t, {
141
141
  currencyCode: X,
142
142
  includeSpaceAfterCurrencySymbol: !1
143
143
  });
144
- }, [I, X]), $ = u((e) => y(D.find((t) => t.optionValue === e), h.find((t) => t.id === e)?.accountNumber ?? b.find((t) => t.id === e)?.accountNumber), [
145
- D,
146
- h,
147
- b
148
- ]), ve = u(() => {
149
- let e = M ? null : r.modalFromRequiredError, t = P ? null : r.modalToRequiredError, n = Z(I, M, P);
150
- W(!0), R(e), B(t), H(n), e || t || n ? K((e) => e + 1) : j("review");
144
+ }, [R, X]), Q = l((e) => v(k.find((t) => t.optionValue === e), T.find((t) => t.id === e)?.accountNumber ?? y.find((t) => t.id === e)?.accountNumber), [
145
+ k,
146
+ T,
147
+ y
148
+ ]), $ = l(() => {
149
+ let e = k.some((e) => e.optionValue === P) ? null : r.modalFromRequiredError, t = k.some((e) => e.optionValue === I) ? null : r.modalToRequiredError, n = Z(R, P, I);
150
+ G(!0), B(e), V(t), U(n), e || t || n ? se((e) => e + 1) : N("review");
151
151
  }, [
152
- I,
153
- M,
152
+ k,
153
+ R,
154
+ P,
154
155
  r.modalFromRequiredError,
155
156
  r.modalToRequiredError,
156
- P,
157
+ I,
157
158
  Z
158
- ]), ye = u(() => {
159
- j("accounts");
160
- }, []), be = u(async () => {
161
- let t = s(I, X);
159
+ ]), be = l(() => {
160
+ N("accounts");
161
+ }, []), xe = l(async () => {
162
+ if (!k.some((e) => e.optionValue === P) || !k.some((e) => e.optionValue === I)) {
163
+ $(), N("accounts");
164
+ return;
165
+ }
166
+ let t = s(R, X);
162
167
  if (t === null) {
163
- H(r.modalAmountInvalidError);
168
+ U(r.modalAmountInvalidError);
164
169
  return;
165
170
  }
166
171
  if (!J && !Y) {
@@ -170,69 +175,71 @@ function b({ labels: r, featureLabels: m, embeddedBankAccounts: h, verifiedExter
170
175
  let n;
171
176
  n = J && Y ? "INTERNAL_TO_INTERNAL" : J && !Y ? "INTERNAL_TO_EXTERNAL" : "EXTERNAL_TO_INTERNAL";
172
177
  try {
173
- n === "INTERNAL_TO_INTERNAL" ? await S.mutateAsync({ body: {
174
- fromBankAccountId: M,
175
- toBankAccountId: P,
178
+ n === "INTERNAL_TO_INTERNAL" ? await C.mutateAsync({ body: {
179
+ fromBankAccountId: P,
180
+ toBankAccountId: I,
176
181
  amount: t,
177
182
  currencyCode: X
178
- } }) : await C.mutateAsync({ body: {
179
- fromBankAccountId: M,
180
- toBankAccountId: P,
183
+ } }) : await w.mutateAsync({ body: {
184
+ fromBankAccountId: P,
185
+ toBankAccountId: I,
181
186
  amount: t,
182
187
  currencyCode: X,
183
188
  type: n,
184
- secCode: m.defaultSecCode
185
- } }), j("result"), x(c.TransferSubmitted, { transferType: n });
189
+ secCode: p.defaultSecCode
190
+ } }), N("result"), b(c.TransferSubmitted, { transferType: n });
186
191
  } catch {
187
192
  e.error(r.modalSubmitFailedError);
188
193
  }
189
194
  }, [
190
- I,
195
+ R,
196
+ w,
197
+ k,
191
198
  C,
192
- S,
199
+ $,
193
200
  J,
194
- M,
201
+ P,
195
202
  r.modalSubmitFailedError,
196
203
  r.modalUnsupportedPairError,
197
204
  r.modalAmountInvalidError,
198
205
  Y,
199
- P,
200
- x,
206
+ I,
207
+ b,
201
208
  X,
202
- m.defaultSecCode
209
+ p.defaultSecCode
203
210
  ]);
204
211
  return {
205
212
  modalProps: {
206
- open: O,
207
- onOpenChange: ue,
208
- step: A,
209
- stepLabel: A === "result" ? void 0 : t(r.modalStepLabel, {
210
- current: String(A === "review" ? 2 : 1),
211
- total: String(ne)
213
+ open: A,
214
+ onOpenChange: de,
215
+ step: M,
216
+ stepLabel: M === "result" ? void 0 : t(r.modalStepLabel, {
217
+ current: String(M === "review" ? 2 : 1),
218
+ total: String(re)
212
219
  }),
213
- fromOptions: fe,
214
- toOptions: pe,
215
- fromValue: M,
216
- toValue: P,
217
- onFromValueChange: me,
218
- onToValueChange: he,
219
- fromError: oe,
220
- toError: z,
221
- amountValue: I,
222
- onAmountValueChange: ge,
223
- amountError: V,
224
- amountInputPrefix: Q,
225
- reviewFromAccount: $(M),
226
- reviewToAccount: $(P),
227
- reviewAmountLabel: _e,
228
- isSubmitting: S.isPending || C.isPending,
229
- onContinueFromAccounts: ve,
230
- onBack: ye,
231
- onSubmit: () => void be(),
220
+ fromOptions: me,
221
+ toOptions: he,
222
+ fromValue: P,
223
+ toValue: I,
224
+ onFromValueChange: ge,
225
+ onToValueChange: _e,
226
+ fromError: ae,
227
+ toError: oe,
228
+ amountValue: R,
229
+ onAmountValueChange: ve,
230
+ amountError: H,
231
+ amountInputPrefix: pe,
232
+ reviewFromAccount: Q(P),
233
+ reviewToAccount: Q(I),
234
+ reviewAmountLabel: ye,
235
+ isSubmitting: C.isPending || w.isPending,
236
+ onContinueFromAccounts: $,
237
+ onBack: be,
238
+ onSubmit: () => void xe(),
232
239
  onClearSelections: q,
233
- scrollToErrorToken: G
240
+ scrollToErrorToken: K
234
241
  },
235
- openModal: de
242
+ openModal: fe
236
243
  };
237
244
  }
238
- export { b as useTransferMoneyModalController };
245
+ export { y as useTransferMoneyModalController };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.11.188",
3
+ "version": "0.11.189",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [