@tesouro/embedded-components-react 0.2.318 → 0.2.320

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 (135) hide show
  1. package/README.md +5 -4
  2. package/dist/index.css +9 -0
  3. package/dist/index.d.ts +4 -1
  4. package/dist/index.js +1 -1
  5. package/dist/lib/BillPayWidget.d.ts +4 -1
  6. package/dist/lib/BillPayWidget.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +10 -7
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +170 -32
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +13 -32
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index12.js +30 -0
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +50 -0
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +36 -0
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index3.js +11 -8
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +33 -16
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +47 -2
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +18 -63
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +40 -131
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +48 -11
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +30 -20
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +18 -16
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +29 -97
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +1 -9
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +13 -109
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +24 -4
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +30 -21
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +19 -46
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +49 -76
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +4 -45
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +73 -3
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +50 -2
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +4 -50
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +7 -43
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +38 -1
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +115 -31
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +56 -8
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +206 -16
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +195 -5
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +58 -64
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +46 -139
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +34 -5
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +155 -6
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +3 -60
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +36 -7
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +92 -73
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +9 -3
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +191 -6
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +4 -114
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +26 -1
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +78 -21
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +92 -0
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +3 -0
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +4 -0
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +5 -206
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +45 -0
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +1 -0
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +53 -0
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +11 -0
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +18 -0
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +8 -0
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +79 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +148 -0
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +5 -0
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +8 -0
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +3 -197
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +9 -0
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +85 -0
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +3 -0
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +8 -0
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +115 -0
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +1 -0
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +25 -0
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +30 -41
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +38 -30
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +20 -151
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +158 -31
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +29 -17
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +13 -7
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +13 -47
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +24 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +2 -22
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +31 -283
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +261 -1
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +2 -16
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +7 -118
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +49 -2
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +2 -10
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +20 -94
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +286 -2
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +1 -12
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +14 -56
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +120 -2
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +1 -19
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +8 -157
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +96 -2
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +2 -7
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +11 -42
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +57 -1
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +2 -14
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +50 -20
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +138 -1
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +1 -54
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +5 -227
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +37 -188
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +2 -10
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +55 -5
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +229 -84
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +195 -0
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +10 -2
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +4 -3
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +88 -25
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +2 -14
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +5 -87
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +30 -2
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -0
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +7 -0
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +34 -0
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -0
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +12 -0
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +106 -0
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -0
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +18 -0
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +10 -0
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +170 -0
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +2 -0
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +14 -0
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +89 -0
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +2 -0
  128. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +21 -21
  129. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +189 -156
  130. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +157 -97
  131. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +10 -10
  132. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  133. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  134. package/package.json +1 -1
  135. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +0 -2
@@ -0,0 +1,18 @@
1
+ import { BillQueue as e } from "./index42.js";
2
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js
3
+ var t = {
4
+ [e.Drafts]: "Drafts",
5
+ [e.Pending]: "Pending",
6
+ [e.Scheduled]: "Scheduled",
7
+ [e.Paid]: "Paid",
8
+ [e.All]: "All bills"
9
+ }, n = {
10
+ emptyHeading: "Add your first bill",
11
+ nonEmptyHeading: "Add a bill",
12
+ createButton: "Add bill",
13
+ emailCopiedToast: "Email address copied to clipboard",
14
+ emailCopyFailedToast: "Could not copy the email address",
15
+ queues: t
16
+ };
17
+ //#endregion
18
+ export { n as BILLS_TAB_LABELS_EN, t as BILL_QUEUE_LABELS_EN };
@@ -0,0 +1,8 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js
2
+ var e = {
3
+ root: "bill-pay-bills-tab",
4
+ uploadTray: "bill-pay-upload-tray",
5
+ detailsSheet: "bill-pay-details-sheet"
6
+ };
7
+ //#endregion
8
+ export { e as billsTabTestIds };
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
6
+ import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
7
+ import { usePayablesQuery as n, usePayablesTotalCountQuery as r } from "../../data-access/dist/index13.js";
8
+ import "../../data-access/dist/index.js";
9
+ import { derivePayableStatus as i } from "./index16.js";
10
+ import { DEFAULT_BILL_QUEUE as a, billQueueHasScheduledPayment as o, billQueueStatuses as s, billSortField as c } from "./index42.js";
11
+ import { useCallback as l, useEffect as u, useMemo as d, useState as f } from "react";
12
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js
13
+ var p = 10, m = [{
14
+ id: "addedOnLabel",
15
+ desc: !0
16
+ }];
17
+ function h({ enabled: h = !0, onOpenBill: g }) {
18
+ let [_, v] = f(a), [y, b] = f(m), [x, S] = f(p), [C, w] = f(), [T, E] = f(""), [D, O] = f(""), k = l(() => w(void 0), []);
19
+ u(() => {
20
+ let e = setTimeout(() => {
21
+ O(T), k();
22
+ }, 300);
23
+ return () => clearTimeout(e);
24
+ }, [T, k]);
25
+ let A = y[0], j = c(A?.id), M = n({
26
+ limit: x,
27
+ pagination_token: C,
28
+ status__in: s(_),
29
+ has_scheduled_payment: o(_),
30
+ counterpart_name__icontains: D || void 0,
31
+ sort: j,
32
+ order: j ? A?.desc ? "desc" : "asc" : void 0,
33
+ enabled: h
34
+ }), N = M.data?.data.length === 0, P = r({ enabled: h && N }), F = !N || (P.data?.count ?? 1) > 0, I = d(() => (M.data?.data ?? []).map((n) => {
35
+ let r = i({
36
+ apiStatus: n.status,
37
+ dueDate: n.due_date,
38
+ scheduledPaymentDate: n.scheduled_payment_date
39
+ });
40
+ return {
41
+ vendorLabel: n.counterpart_raw_data?.name ?? "",
42
+ dueDateLabel: e(n.due_date),
43
+ amountDueLabel: t((n.amount_due ?? n.total_amount ?? 0) / 100, { currencyCode: n.currency ?? "USD" }),
44
+ status: r.status,
45
+ statusTone: r.tone,
46
+ addedOnLabel: e(n.created_at?.slice(0, 10)),
47
+ onOpen: () => g(n.id, r.status === "draft")
48
+ };
49
+ }), [M.data?.data, g]), L = l((e) => {
50
+ v(e), k();
51
+ }, [k]), R = l((e) => {
52
+ b((t) => typeof e == "function" ? e(t) : e), k();
53
+ }, [k]), z = l((e) => {
54
+ S(e), k();
55
+ }, [k]), B = l(() => w(M.data?.next_pagination_token), [M.data?.next_pagination_token]), V = l(() => w(M.data?.prev_pagination_token), [M.data?.prev_pagination_token]), H = l(() => {
56
+ M.refetch();
57
+ }, [M.refetch]);
58
+ return {
59
+ rows: I,
60
+ isLoading: M.isLoading || N && P.isLoading,
61
+ isError: M.isError,
62
+ onRetry: H,
63
+ selectedFilterTabId: _,
64
+ onFilterTabChange: L,
65
+ searchValue: T,
66
+ onSearchChange: E,
67
+ hasAnyBills: F,
68
+ sorting: y,
69
+ onSortingChange: R,
70
+ pageSize: x,
71
+ onPageSizeChange: z,
72
+ hasNextPage: !!M.data?.next_pagination_token,
73
+ hasPrevPage: !!M.data?.prev_pagination_token,
74
+ onNextPage: B,
75
+ onPrevPage: V
76
+ };
77
+ }
78
+ //#endregion
79
+ export { h as useBillsTable };
@@ -0,0 +1,148 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
7
+ import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
8
+ import "../../../shared/data-access/dist/index.js";
9
+ import "../../../shared/ui/dist/index.js";
10
+ import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
+ import "../../../shared/feature/dist/index.js";
12
+ import { AddBillDialog as i } from "../../ui/dist/index10.js";
13
+ import { BillsScreen as a } from "../../ui/dist/index42.js";
14
+ import "../../ui/dist/index.js";
15
+ import { BillCreateDialog as o } from "./index33.js";
16
+ import "./index34.js";
17
+ import { BillDetailsContainer as s } from "./index37.js";
18
+ import "./index38.js";
19
+ import { BILL_QUEUE_ORDER as c, BillQueue as l } from "./index42.js";
20
+ import { BILLS_TAB_LABELS_EN as u } from "./index44.js";
21
+ import { billsTabTestIds as d } from "./index45.js";
22
+ import { useBillsTable as f } from "./index46.js";
23
+ import { copyTextToClipboard as p } from "./index43.js";
24
+ import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
25
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
26
+ import { CalendarClockIcon as b, CheckIcon as x, FilePenIcon as S, ListIcon as C, LoaderCircleIcon as w } from "lucide-react";
27
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js
28
+ var T = "bills@business-banking.app", E = {
29
+ [l.Drafts]: /* @__PURE__ */ v(S, {
30
+ className: "ttw:size-4",
31
+ "aria-hidden": !0
32
+ }),
33
+ [l.Pending]: /* @__PURE__ */ v(w, {
34
+ className: "ttw:size-4",
35
+ "aria-hidden": !0
36
+ }),
37
+ [l.Scheduled]: /* @__PURE__ */ v(b, {
38
+ className: "ttw:size-4",
39
+ "aria-hidden": !0
40
+ }),
41
+ [l.Paid]: /* @__PURE__ */ v(x, {
42
+ className: "ttw:size-4",
43
+ "aria-hidden": !0
44
+ }),
45
+ [l.All]: /* @__PURE__ */ v(C, {
46
+ className: "ttw:size-4",
47
+ "aria-hidden": !0
48
+ })
49
+ };
50
+ function D({ labels: l, onEnqueueFiles: b, openPayableId: x, onOpenPayableHandled: S, poweredByBankName: C }) {
51
+ let w = g(() => ({
52
+ ...u,
53
+ ...l,
54
+ queues: {
55
+ ...u.queues,
56
+ ...l?.queues
57
+ }
58
+ }), [l]), [D, O] = _(!1), [k, A] = _(), [j, M] = _(!1), [N, P] = _(), [F, I] = _(!1), [L, R] = _(!1), { initResponse: z } = r(), B = t(z?.scopes, [n.PayableReadOrg]), V = t(z?.scopes, [n.PayableWriteOrg]), H = !z || B, U = !z || V, W = m((e, t) => {
59
+ if (t && U) {
60
+ A(e), M(!0);
61
+ return;
62
+ }
63
+ P(e), I(!0);
64
+ }, [U]), G = f({
65
+ enabled: H,
66
+ onOpenBill: W
67
+ }), K = g(() => c.map((e) => ({
68
+ id: e,
69
+ label: w.queues[e],
70
+ icon: E[e]
71
+ })), [w.queues]), q = () => {
72
+ I(!1), R(!0);
73
+ }, J = g(() => ({
74
+ createButton: w.createButton,
75
+ addBill: { heading: w.emptyHeading }
76
+ }), [w.createButton, w.emptyHeading]), Y = () => {
77
+ O(!1), A(void 0), M(!0);
78
+ }, X = (e) => {
79
+ O(!1), b?.(e);
80
+ }, Z = async () => {
81
+ await p(T) ? e.success(w.emailCopiedToast) : e.error(w.emailCopyFailedToast);
82
+ };
83
+ return h(() => {
84
+ x && (A(x), M(!0), S?.());
85
+ }, [S, x]), /* @__PURE__ */ y("div", {
86
+ "data-testid": d.root,
87
+ children: [
88
+ /* @__PURE__ */ v(a, {
89
+ rows: G.rows,
90
+ isLoading: G.isLoading || !z,
91
+ isError: G.isError,
92
+ onRetry: G.onRetry,
93
+ sorting: G.sorting,
94
+ onSortingChange: G.onSortingChange,
95
+ pageSize: G.pageSize,
96
+ onPageSizeChange: G.onPageSizeChange,
97
+ hasNextPage: G.hasNextPage,
98
+ hasPrevPage: G.hasPrevPage,
99
+ onNextPage: G.onNextPage,
100
+ onPrevPage: G.onPrevPage,
101
+ filterTabs: K,
102
+ selectedFilterTabId: G.selectedFilterTabId,
103
+ onFilterTabChange: G.onFilterTabChange,
104
+ searchValue: G.searchValue,
105
+ onSearchChange: G.onSearchChange,
106
+ isFiltering: G.hasAnyBills,
107
+ onCreateClick: U ? () => O(!0) : void 0,
108
+ onEnterManually: U ? Y : void 0,
109
+ onFilesSelected: U ? X : void 0,
110
+ emailAddress: T,
111
+ onCopyEmail: Z,
112
+ labels: J
113
+ }),
114
+ U ? /* @__PURE__ */ v(i, {
115
+ open: D,
116
+ onOpenChange: O,
117
+ onFilesSelected: X,
118
+ onEnterManually: Y,
119
+ emailAddress: T,
120
+ onCopyEmail: Z,
121
+ labels: { heading: G.hasAnyBills ? w.nonEmptyHeading : w.emptyHeading }
122
+ }) : null,
123
+ j ? /* @__PURE__ */ v(o, {
124
+ open: j,
125
+ onOpenChange: M,
126
+ payableId: k
127
+ }) : null,
128
+ F ? /* @__PURE__ */ v(s, {
129
+ open: F,
130
+ onOpenChange: I,
131
+ payableId: N,
132
+ onClose: () => I(!1),
133
+ onExpand: q,
134
+ testId: d.detailsSheet,
135
+ poweredByBankName: C
136
+ }) : null,
137
+ L ? /* @__PURE__ */ v(o, {
138
+ open: L,
139
+ onOpenChange: R,
140
+ payableId: N,
141
+ readOnly: !0,
142
+ poweredByBankName: C
143
+ }) : null
144
+ ]
145
+ });
146
+ }
147
+ //#endregion
148
+ export { D as BillsTab, D as default };
@@ -0,0 +1,5 @@
1
+ import "./index42.js";
2
+ import "./index44.js";
3
+ import "./index45.js";
4
+ import "./index46.js";
5
+ import "./index47.js";
@@ -0,0 +1,8 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js
2
+ var e = (e) => [
3
+ "bill-pay",
4
+ "upload-queue",
5
+ e ?? ""
6
+ ];
7
+ //#endregion
8
+ export { e as billPayUploadQueueKey };
@@ -1,200 +1,6 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { VENDOR_SECTION_PROPS_LABELS_EN as e } from "./index2.js";
6
- import { usePayableSuggestionsQuery as t } from "../../data-access/dist/index11.js";
7
- import "../../data-access/dist/index.js";
8
- import { counterpartFormBankAccountToCreatePayload as ee, counterpartFormBankAccountToUpdatePayload as te, getAchInstructions as n, getCounterpartEmail as r, getCounterpartName as i, getPayableAchInstructions as ne, hasAchFormValues as a, resolveCounterpartBankAccountWrite as re, validateAchFormValues as ie } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
9
- import { useCounterpartsQuery as ae } from "../../../shared/counterpart-management/data-access/dist/index3.js";
10
- import { useCreateCounterpartBankAccountMutation as oe, useUpdateCounterpartBankAccountMutation as o } from "../../../shared/counterpart-management/data-access/dist/index5.js";
11
- import { useCounterpartDetails as s } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
12
- import "../../../shared/counterpart-management/feature/dist/index.js";
13
- import { VendorInlineForm as se } from "./index4.js";
14
- import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
15
- import { jsx as p } from "react/jsx-runtime";
16
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js
17
- var m = 10, ce = 300, h = {
18
- accountHolderName: "",
19
- routingNumber: "",
20
- accountNumber: ""
21
- };
22
- function le(e) {
23
- return `••••••••${e.slice(-4)}`;
24
- }
25
- function g({ payableId: g, counterpartId: _, payableCounterpartId: v, onCounterpartChange: y, requiredError: b, labels: x }) {
26
- let S = {
27
- ...e,
28
- ...x
29
- }, [C, w] = f(""), [T, E] = f(""), [D, O] = f(), [ue, k] = f(!1), [A, j] = f(h), M = d(A);
30
- M.current = A;
31
- let [N, P] = f(!1), F = a(A) || N, [I, L] = f(), [R, z] = f(), B = d(_), [V, H] = f(!1), U = c(() => {
32
- k(!1), j(h), L(void 0), z(void 0);
33
- }, []), W = c((e) => {
34
- H(!0), y(e);
35
- }, [y]), G = t(g, { enabled: !!g && !_ && !v }).data?.suggested_counterpart?.id;
36
- l(() => {
37
- !V && !_ && !v && G && W(G);
38
- }, [
39
- _,
40
- v,
41
- V,
42
- G,
43
- W
44
- ]), l(() => {
45
- B.current !== _ && (B.current = _, U());
46
- }, [_, U]), l(() => {
47
- let e = setTimeout(() => {
48
- E(C.trim());
49
- }, ce);
50
- return () => clearTimeout(e);
51
- }, [C]);
52
- let K = ae({
53
- sort: "counterpart_name",
54
- order: "asc",
55
- limit: m,
56
- counterpart_name__icontains: T || void 0,
57
- is_vendor: !0,
58
- enabled: !!T
59
- }), q = s({ selectedId: _ }), J = oe(), Y = o(), X = u(() => {
60
- let e = q.counterpart;
61
- if (!e) return;
62
- if (q.isBankAccountsLoading) return {
63
- name: i(e),
64
- email: r(e),
65
- methodLabel: S.paymentMethodLoading,
66
- fields: []
67
- };
68
- if (q.isBankAccountsError) return {
69
- name: i(e),
70
- email: r(e),
71
- methodLabel: S.paymentMethodUnavailable,
72
- fields: []
73
- };
74
- let t = ne(q.bankAccounts);
75
- return {
76
- name: i(e),
77
- email: r(e),
78
- methodLabel: t ? S.achMethod : S.noMethod,
79
- fields: t ? [
80
- {
81
- label: S.accountHolder,
82
- value: t.account_holder_name ?? ""
83
- },
84
- {
85
- label: S.routingNumber,
86
- value: t.routing_number ?? ""
87
- },
88
- {
89
- label: S.accountNumber,
90
- value: t.account_number ?? "",
91
- maskedValue: t.account_number ? le(t.account_number) : ""
92
- }
93
- ] : []
94
- };
95
- }, [
96
- q.bankAccounts,
97
- q.counterpart,
98
- q.isBankAccountsError,
99
- q.isBankAccountsLoading,
100
- S
101
- ]), Z = u(() => n(q.bankAccounts), [q.bankAccounts]), Q = c(async () => {
102
- let e = M.current;
103
- if (!_ || !a(e)) return !0;
104
- if (q.isBankAccountsLoading || q.isBankAccountsError) return !1;
105
- let t = ie(e);
106
- if (Object.keys(t).length > 0) return L(t), k(!0), !1;
107
- L(void 0);
108
- let n = re(q.bankAccounts, R ?? Z?.id);
109
- if (n.kind === "update") return await Y.mutateAsync({
110
- path: {
111
- counterpart_id: _,
112
- bank_account_id: n.bankAccountId
113
- },
114
- body: te(e, { includeAchDefaults: n.includeAchDefaults })
115
- }), z(n.bankAccountId), !0;
116
- let r = await J.mutateAsync({
117
- path: { counterpart_id: _ },
118
- body: ee(e)
119
- });
120
- return z(r?.id), !0;
121
- }, [
122
- Z,
123
- _,
124
- J,
125
- q.bankAccounts,
126
- q.isBankAccountsError,
127
- q.isBankAccountsLoading,
128
- R,
129
- Y
130
- ]), de = u(() => (K.data?.data ?? []).map((e) => ({
131
- name: i(e),
132
- email: r(e),
133
- onSelect: () => W(e.id)
134
- })), [K.data, W]), $ = c(() => {
135
- O(void 0), P(!1);
136
- }, []), fe = c((e) => {
137
- O(void 0), P(!1), W(e);
138
- }, [W]);
139
- if (D) return {
140
- mode: "creating",
141
- newVendorForm: /* @__PURE__ */ p(se, {
142
- mode: D,
143
- counterpart: D === "edit" ? q.counterpart : void 0,
144
- primaryAddress: D === "edit" ? q.primaryAddress : void 0,
145
- bankAccounts: D === "edit" ? q.bankAccounts : void 0,
146
- isBankAccountsLoading: D === "edit" ? q.isBankAccountsLoading : void 0,
147
- isBankAccountsError: D === "edit" ? q.isBankAccountsError : void 0,
148
- initialName: D === "create" ? C : void 0,
149
- onSaved: fe,
150
- onCancel: $,
151
- onDirtyChange: P
152
- }),
153
- onClear: $,
154
- hasUnsavedVendorChanges: F
155
- };
156
- if (X) {
157
- let e = q.isBankAccountsLoading || q.isBankAccountsError;
158
- return {
159
- mode: "resolved",
160
- summary: X,
161
- onEdit: e ? void 0 : () => O("edit"),
162
- onClear: () => W(void 0),
163
- paymentInstructions: e ? void 0 : {
164
- isOpen: ue,
165
- values: A,
166
- errors: I,
167
- onOpen: () => {
168
- k(!0), Z && (j({
169
- accountHolderName: Z.account_holder_name ?? "",
170
- routingNumber: Z.routing_number ?? "",
171
- accountNumber: Z.account_number ?? ""
172
- }), z(Z.id));
173
- },
174
- onChange: (e) => {
175
- j((t) => ({
176
- ...t,
177
- ...e
178
- })), L(void 0);
179
- }
180
- },
181
- savePaymentInstructions: Q,
182
- hasUnsavedVendorChanges: F
183
- };
184
- }
185
- return {
186
- mode: "selecting",
187
- error: K.isError ? S.searchFailed : q.isError ? S.vendorDetailsFailed : b,
188
- search: {
189
- query: C,
190
- onQueryChange: w,
191
- isLoading: K.isLoading,
192
- onAddVendor: () => O("create"),
193
- results: de
194
- },
195
- savePaymentInstructions: Q,
196
- hasUnsavedVendorChanges: F
197
- };
2
+ function e(e) {
3
+ return e ? `••••${e.slice(-4)}` : void 0;
198
4
  }
199
5
  //#endregion
200
- export { g as useVendorSectionProps };
6
+ export { e as maskAccountNumber };
@@ -0,0 +1,9 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js
2
+ var e = {
3
+ uploadingSummary: (e) => `Uploading and scanning ${e} ${e === 1 ? "file" : "files"}`,
4
+ completeSummary: (e) => `${e} ${e === 1 ? "upload" : "uploads"} complete`,
5
+ readyCaption: (e) => `${e} new ${e === 1 ? "bill" : "bills"} ready`,
6
+ failedCaption: (e) => `${e} failed to upload`
7
+ };
8
+ //#endregion
9
+ export { e as BILL_UPLOAD_QUEUE_LABELS_EN };
@@ -0,0 +1,85 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
+ import { useUploadPayableFromFileMutation as t } from "../../data-access/dist/index10.js";
7
+ import { usePayableOcrQueries as n } from "../../data-access/dist/index12.js";
8
+ import "../../data-access/dist/index.js";
9
+ import { billPayUploadQueueKey as r } from "./index49.js";
10
+ import { BILL_UPLOAD_QUEUE_LABELS_EN as i } from "./index50.js";
11
+ import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
12
+ import { useQuery as l, useQueryClient as u } from "@tanstack/react-query";
13
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js
14
+ function d({ onOpenBill: d, labels: f } = {}) {
15
+ let p = {
16
+ ...i,
17
+ ...f
18
+ }, { organizationId: m } = e(), h = u(), g = s(() => r(m), [m]), _ = t(), [v, y] = c(!1), { data: b = [] } = l({
19
+ queryKey: g,
20
+ queryFn: () => h.getQueryData(g) ?? [],
21
+ staleTime: Infinity,
22
+ gcTime: Infinity,
23
+ initialData: []
24
+ }), x = a((e, t) => {
25
+ h.setQueryData(g, (n) => (n ?? []).map((n) => n.localId === e ? {
26
+ ...n,
27
+ ...t
28
+ } : n));
29
+ }, [h, g]), S = a((e) => {
30
+ y(!1);
31
+ for (let t of e) {
32
+ let e = crypto.randomUUID();
33
+ h.setQueryData(g, (n) => [...n ?? [], {
34
+ localId: e,
35
+ fileName: t.name,
36
+ status: "uploading"
37
+ }]), _.mutateAsync({ file: t }).then((t) => x(e, { payableId: t?.id })).catch(() => x(e, { status: "failed" }));
38
+ }
39
+ }, [
40
+ x,
41
+ h,
42
+ g,
43
+ _
44
+ ]), C = n({ payableIds: b.filter((e) => e.status === "uploading" && e.payableId).map((e) => e.payableId) });
45
+ o(() => {
46
+ for (let { payableId: e, ocrStatus: t, isError: n } of C) {
47
+ let r = b.find((t) => t.payableId === e && t.status === "uploading");
48
+ r && (t === "success" ? x(r.localId, { status: "ready" }) : (n || t === "error" || t === "canceled") && x(r.localId, { status: "failed" }));
49
+ }
50
+ }, [
51
+ b,
52
+ C,
53
+ x
54
+ ]);
55
+ let w = b.filter((e) => e.status === "uploading"), T = b.filter((e) => e.status === "ready"), E = b.filter((e) => e.status === "failed"), D = (e) => ({
56
+ id: e.localId,
57
+ fileName: e.fileName,
58
+ status: e.status,
59
+ onOpen: e.status === "ready" && e.payableId && d ? () => d(e.payableId) : void 0
60
+ }), O = w.length ? [{
61
+ id: "in-progress",
62
+ items: b.map(D)
63
+ }] : [...T.length ? [{
64
+ id: "ready",
65
+ caption: p.readyCaption(T.length),
66
+ items: T.map(D)
67
+ }] : [], ...E.length ? [{
68
+ id: "failed",
69
+ caption: p.failedCaption(E.length),
70
+ items: E.map(D)
71
+ }] : []], k = w.length ? p.uploadingSummary(b.length) : T.length ? p.completeSummary(T.length) : p.failedCaption(E.length), A = a(() => {
72
+ h.setQueryData(g, []);
73
+ }, [h, g]);
74
+ return {
75
+ enqueue: S,
76
+ sections: O,
77
+ summaryLabel: k,
78
+ collapsed: v,
79
+ onToggleCollapsed: a(() => y((e) => !e), []),
80
+ onClose: A,
81
+ isVisible: b.length > 0
82
+ };
83
+ }
84
+ //#endregion
85
+ export { d as useBillUploadQueue };
@@ -0,0 +1,3 @@
1
+ import "./index49.js";
2
+ import "./index50.js";
3
+ import "./index51.js";
@@ -0,0 +1,8 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js
2
+ var e = {
3
+ bills: "Bills",
4
+ vendors: "Vendors",
5
+ settings: "Settings"
6
+ };
7
+ //#endregion
8
+ export { e as DEFAULT_TABS_LABELS };