@tesouro/embedded-components-react 0.5.75 → 0.5.77

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 (88) hide show
  1. package/dist/index.css +0 -8
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +140 -7
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +46 -140
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +114 -47
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +182 -111
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +75 -164
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +31 -76
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +89 -23
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +405 -65
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +12 -381
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +84 -12
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +54 -79
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +223 -54
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +37 -223
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +245 -37
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +21 -252
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +575 -21
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -572
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +44 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +247 -38
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +3 -234
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +4 -3
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +44 -2
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -46
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -1
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +11 -6
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +127 -11
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -129
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +127 -3
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -124
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +7 -8
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +47 -8
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +18 -44
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +28 -20
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +82 -27
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +47 -83
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +250 -47
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +123 -241
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +211 -126
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +3 -219
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +7 -4
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +98 -5
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +1 -100
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +26 -0
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +10 -10
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +2 -72
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +12 -269
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +2 -19
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +16 -50
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +97 -15
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +76 -47
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +277 -2
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +2 -35
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +16 -369
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +56 -2
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +2 -23
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +15 -93
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +50 -2
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +1 -31
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +32 -49
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +374 -2
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +1 -55
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +20 -10
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +87 -188
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +1 -1
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +30 -2
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +48 -37
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +47 -10
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +10 -85
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +197 -2
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +2 -4
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +2 -14
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +41 -2
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +2 -4
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +14 -17
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +88 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -94
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +167 -161
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +5 -5
  83. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  84. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js +5 -1
  85. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  86. package/dist/packages/shared-ui-shadcn/dist/index.js +1391 -1369
  87. package/package.json +1 -1
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +0 -27
@@ -2,134 +2,219 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
- import { formatCalendarDate as t } from "../../../shared/util/dist/lib/formatCalendarDate.js";
7
- import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
8
- import { hasSuspectedPayableDuplicate as ee } from "../../data-access/dist/index7.js";
9
- import { usePayablesQuery as r, usePayablesTotalCountQuery as i } from "../../data-access/dist/index17.js";
10
- import "../../data-access/dist/index.js";
11
- import { derivePayableStatus as te } from "./index7.js";
12
- import { resolveVendorName as ne } from "./index8.js";
13
- import { isEditablePayableStatus as re } from "./index19.js";
14
- import { BillQueue as a, DEFAULT_BILL_QUEUE as o, billQueueColumns as s, billQueueHasScheduledPayment as c, billQueueOffersAddPanel as l, billQueueStatuses as u, billSortColumnId as d, billSortField as f } from "./index73.js";
15
- import { useBillsFilters as p } from "./index81.js";
16
- import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
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 ee, useWidgetInitStaleForToken as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
+ import "../../../shared/feature/dist/index.js";
12
+ import { useDuplicateBillsCount as i } from "./index10.js";
13
+ import { AddBillDialog as a } from "../../ui/dist/index10.js";
14
+ import { BillsScreen as o } from "../../ui/dist/index82.js";
15
+ import "../../ui/dist/index.js";
16
+ import { DuplicateBillsContainer as te } from "./index12.js";
17
+ import "./index14.js";
18
+ import { BillCreateDialog as s } from "./index60.js";
19
+ import "./index61.js";
20
+ import { BillDetailsContainer as c } from "./index63.js";
21
+ import "./index64.js";
22
+ import "./index70.js";
23
+ import "./index71.js";
24
+ import { BILL_QUEUE_ORDER as l, BillQueue as u } from "./index72.js";
25
+ import { BILLS_TAB_LABELS_EN as d } from "./index75.js";
26
+ import { useBillsTable as f } from "./index81.js";
27
+ import { copyTextToClipboard as p } from "./index73.js";
28
+ import { resolveDuplicateWarning as m } from "./index74.js";
29
+ import { billsTabTestIds as h, billsTableCellTestIds as ne } from "./index76.js";
30
+ import { useCallback as re, useEffect as ie, useMemo as g, useState as _ } from "react";
31
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
32
+ import { CalendarClockIcon as b, CheckIcon as x, FilePenIcon as S, ListIcon as C, LoaderCircleIcon as w } from "lucide-react";
17
33
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js
18
- var v = 10, y = [{
19
- id: "addedOnLabel",
20
- desc: !0
21
- }];
22
- function b({ enabled: b = !0, canReadVendors: x = !0, isVendorFilterPaused: S = !1, filterLabels: C, onOpenBill: w, duplicateRowNote: T, attachmentLabel: E }) {
23
- let [D, O] = _(o), [k, A] = _(y), [j, ie] = _(v), [M, N] = _(), [P, F] = _(""), [I, L] = _(""), R = m(() => N(void 0), []);
24
- h(() => {
25
- let e = setTimeout(() => {
26
- L(P), R();
27
- }, 300);
28
- return () => clearTimeout(e);
29
- }, [P, R]);
30
- let z = p({
31
- offersStatusFilter: D === a.All,
32
- offersVendorFilter: x,
33
- isVendorFilterPaused: S,
34
- labels: C,
35
- onFiltersChange: R
36
- }), B = k[0], V = f(B?.id), H = V ? B?.desc ? "desc" : "asc" : void 0, U = g(() => ({
37
- ...z.query,
38
- limit: j,
39
- pagination_token: M,
40
- status__in: u(D) ?? z.query.status__in,
41
- has_scheduled_payment: c(D),
42
- counterpart_name__icontains: I || void 0,
43
- sort: V,
44
- order: H
34
+ var T = "bills@business-banking.app", E = {
35
+ [u.Drafts]: /* @__PURE__ */ v(S, {
36
+ className: "ttw:size-4",
37
+ "aria-hidden": !0
38
+ }),
39
+ [u.Pending]: /* @__PURE__ */ v(w, {
40
+ className: "ttw:size-4",
41
+ "aria-hidden": !0
42
+ }),
43
+ [u.Scheduled]: /* @__PURE__ */ v(b, {
44
+ className: "ttw:size-4",
45
+ "aria-hidden": !0
46
+ }),
47
+ [u.Paid]: /* @__PURE__ */ v(x, {
48
+ className: "ttw:size-4",
49
+ "aria-hidden": !0
50
+ }),
51
+ [u.All]: /* @__PURE__ */ v(C, {
52
+ className: "ttw:size-4",
53
+ "aria-hidden": !0
54
+ })
55
+ };
56
+ function D({ labels: u, onEnqueueFiles: b, openPayableId: x, onOpenPayableHandled: S, poweredByBankName: C, onSettingsClick: w }) {
57
+ let D = g(() => ({
58
+ ...d,
59
+ ...u,
60
+ queues: {
61
+ ...d.queues,
62
+ ...u?.queues
63
+ },
64
+ filters: {
65
+ ...d.filters,
66
+ ...u?.filters,
67
+ presets: {
68
+ ...d.filters.presets,
69
+ ...u?.filters?.presets
70
+ },
71
+ statuses: {
72
+ ...d.filters.statuses,
73
+ ...u?.filters?.statuses
74
+ },
75
+ dateFieldNames: {
76
+ ...d.filters.dateFieldNames,
77
+ ...u?.filters?.dateFieldNames
78
+ }
79
+ },
80
+ filterBar: {
81
+ ...d.filterBar,
82
+ ...u?.filterBar
83
+ },
84
+ queueEmptyStates: l.reduce((e, t) => ({
85
+ ...e,
86
+ [t]: {
87
+ ...d.queueEmptyStates[t],
88
+ ...u?.queueEmptyStates?.[t]
89
+ }
90
+ }), {})
91
+ }), [u]), [ae, O] = _(!1), [oe, k] = _(), [A, j] = _(!1), [M, N] = _(), [P, F] = _(!1), [I, L] = _(!1), [R, z] = _(!1), { initResponse: B } = ee(), V = r(), H = t(B?.scopes, [n.PayableReadOrg]), U = t(B?.scopes, [n.PayableWriteOrg]), W = !B || H, G = !B || U, K = re((e, t) => {
92
+ if (t && G) {
93
+ k(e), j(!0);
94
+ return;
95
+ }
96
+ N(e), L(!0);
97
+ }, [G]), se = t(B?.scopes, [n.CounterpartReadOrg]), q = f({
98
+ enabled: W,
99
+ canReadVendors: se,
100
+ isVendorFilterPaused: V,
101
+ filterLabels: D.filters,
102
+ onOpenBill: K,
103
+ duplicateRowNote: D.duplicateRowNote,
104
+ attachmentLabel: D.attachmentIndicator
105
+ }), J = i({ enabled: W }), ce = m(J, D), le = g(() => l.map((e) => ({
106
+ id: e,
107
+ label: D.queues[e],
108
+ icon: E[e]
109
+ })), [D.queues]), ue = (e) => {
110
+ z(!1), N(e), L(!0);
111
+ }, de = () => {
112
+ F(!1), L(!0);
113
+ }, fe = () => {
114
+ L(!1), F(!0);
115
+ }, Y = () => {
116
+ F(!1), L(!1), k(M), j(!0);
117
+ }, X = g(() => ({
118
+ createButton: D.createButton,
119
+ settingsButton: D.settingsButton,
120
+ addBill: { heading: D.nonEmptyHeading }
45
121
  }), [
46
- z.query,
47
- j,
48
- M,
49
- D,
50
- I,
51
- V,
52
- H
53
- ]), { organizationId: W } = e(), G = JSON.stringify([W, U]), K = r({
54
- ...U,
55
- enabled: b,
56
- pollWhileOcrProcessing: !0
57
- }), [q, J] = _(G);
58
- h(() => {
59
- K.isFetching || J(G);
60
- }, [K.isFetching, G]);
61
- let Y = K.data?.data.length, X = Y === 0, Z = i({ enabled: b && X }), ae = !X || (Z.data?.count ?? 1) > 0, Q = g(() => (K.data?.data ?? []).filter((e) => e.ocr_status !== "processing").map((e) => {
62
- let r = te({
63
- apiStatus: e.status,
64
- dueDate: e.due_date,
65
- scheduledPaymentDate: e.scheduled_payment_date
66
- }), i = e.amount_due ?? e.total_amount, o = e.status === "partially_paid" || e.status === "paid", s = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" });
67
- return {
68
- rowKey: e.id,
69
- vendorLabel: ne(e),
70
- issueDateLabel: t(e.issued_at),
71
- dueDateLabel: t(e.due_date),
72
- dueDateTone: r.isOverdue ? "danger" : "default",
73
- scheduledDateLabel: t(e.scheduled_payment_date),
74
- scheduledDateIsGap: D === a.Scheduled,
75
- paidDateLabel: t(e.paid_at?.slice(0, 10)),
76
- amountDueLabel: s(i),
77
- amountPaidLabel: o ? s(e.amount_paid) : "",
78
- amountPaidIsGap: D === a.Paid,
79
- amountScheduledLabel: s(e.amount_to_pay ?? i),
80
- totalAmountLabel: s(e.total_amount),
81
- attachment: e.file_id ? { label: E } : void 0,
82
- status: r.status,
83
- statusTone: r.tone,
84
- addedOnLabel: t(e.created_at?.slice(0, 10)),
85
- ...ee(e) ? {
86
- rowTone: "warning",
87
- rowNote: T
88
- } : {},
89
- onOpen: () => w(e.id, re(e.status))
90
- };
91
- }), [
92
- K.data?.data,
93
- T,
94
- E,
95
- w,
96
- D
97
- ]), oe = m((e) => {
98
- let t = e;
99
- O(t), A((e) => {
100
- let n = e[0]?.id;
101
- return n ? s(t).some((e) => d(e) === n) ? e : y : e;
102
- }), R();
103
- }, [R]), se = m((e) => {
104
- A((t) => typeof e == "function" ? e(t) : e), R();
105
- }, [R]), ce = m((e) => {
106
- ie(e), R();
107
- }, [R]), le = m(() => N(K.data?.next_pagination_token ?? void 0), [K.data?.next_pagination_token]), $ = m(() => N(K.data?.prev_pagination_token ?? void 0), [K.data?.prev_pagination_token]), ue = m(() => {
108
- K.refetch();
109
- }, [K.refetch]);
110
- return {
111
- rows: Q,
112
- isLoading: K.isLoading || G !== q || X && Z.isLoading || (Y ?? 0) > 0 && Q.length === 0,
113
- isError: K.isError,
114
- onRetry: ue,
115
- selectedFilterTabId: D,
116
- onFilterTabChange: oe,
117
- searchValue: P,
118
- onSearchChange: F,
119
- hasAnyBills: ae,
120
- isSearchActive: I.length > 0 || z.isFilterActive,
121
- filterBarProps: z.filterBarProps,
122
- visibleColumns: s(D),
123
- showAddPanelWhenEmpty: l(D),
124
- sorting: k,
125
- onSortingChange: se,
126
- pageSize: j,
127
- onPageSizeChange: ce,
128
- hasNextPage: !!K.data?.next_pagination_token,
129
- hasPrevPage: !!K.data?.prev_pagination_token,
130
- onNextPage: le,
131
- onPrevPage: $
122
+ D.createButton,
123
+ D.settingsButton,
124
+ D.nonEmptyHeading
125
+ ]), pe = g(() => ({
126
+ ...q.filterBarProps,
127
+ labels: D.filterBar
128
+ }), [q.filterBarProps, D.filterBar]), Z = () => {
129
+ O(!1), k(void 0), j(!0);
130
+ }, Q = (e) => {
131
+ O(!1), b?.(e);
132
+ }, $ = async () => {
133
+ await p(T) ? e.success(D.emailCopiedToast) : e.error(D.emailCopyFailedToast);
132
134
  };
135
+ return ie(() => {
136
+ x && (k(x), j(!0), S?.());
137
+ }, [S, x]), /* @__PURE__ */ y("div", {
138
+ "data-testid": h.root,
139
+ children: [
140
+ /* @__PURE__ */ v(o, {
141
+ rows: q.rows,
142
+ isLoading: q.isLoading || !B,
143
+ isError: q.isError,
144
+ onRetry: q.onRetry,
145
+ sorting: q.sorting,
146
+ onSortingChange: q.onSortingChange,
147
+ pageSize: q.pageSize,
148
+ onPageSizeChange: q.onPageSizeChange,
149
+ hasNextPage: q.hasNextPage,
150
+ hasPrevPage: q.hasPrevPage,
151
+ onNextPage: q.onNextPage,
152
+ onPrevPage: q.onPrevPage,
153
+ filterTabs: le,
154
+ selectedFilterTabId: q.selectedFilterTabId,
155
+ onFilterTabChange: q.onFilterTabChange,
156
+ searchValue: q.searchValue,
157
+ onSearchChange: q.onSearchChange,
158
+ filters: pe,
159
+ visibleColumns: q.visibleColumns,
160
+ cellTestIds: ne,
161
+ isSearchActive: q.isSearchActive,
162
+ showAddPanelWhenEmpty: q.showAddPanelWhenEmpty,
163
+ emptyState: D.queueEmptyStates[q.selectedFilterTabId],
164
+ onCreateClick: G ? () => O(!0) : void 0,
165
+ onSettingsClick: w,
166
+ onEnterManually: G ? Z : void 0,
167
+ onFilesSelected: G ? Q : void 0,
168
+ maxFiles: 10,
169
+ emailAddress: T,
170
+ onCopyEmail: $,
171
+ duplicateWarning: ce,
172
+ onReviewDuplicates: J.isError ? void 0 : () => z(!0),
173
+ labels: X
174
+ }),
175
+ R ? /* @__PURE__ */ v(te, {
176
+ open: R,
177
+ onOpenChange: z,
178
+ enabled: W,
179
+ canManageDuplicates: G,
180
+ onOpenBill: ue
181
+ }) : null,
182
+ G ? /* @__PURE__ */ v(a, {
183
+ open: ae,
184
+ onOpenChange: O,
185
+ onFilesSelected: Q,
186
+ maxFiles: 10,
187
+ onEnterManually: Z,
188
+ emailAddress: T,
189
+ onCopyEmail: $,
190
+ labels: { heading: q.hasAnyBills ? D.nonEmptyHeading : D.emptyHeading }
191
+ }) : null,
192
+ A ? /* @__PURE__ */ v(s, {
193
+ open: A,
194
+ onOpenChange: j,
195
+ payableId: oe
196
+ }) : null,
197
+ P ? /* @__PURE__ */ v(c, {
198
+ open: P,
199
+ onOpenChange: F,
200
+ payableId: M,
201
+ onClose: () => F(!1),
202
+ onExpand: de,
203
+ onEdit: Y,
204
+ testId: h.detailsSheet,
205
+ poweredByBankName: C
206
+ }) : null,
207
+ I ? /* @__PURE__ */ v(s, {
208
+ open: I,
209
+ onOpenChange: L,
210
+ payableId: M,
211
+ readOnly: !0,
212
+ onCollapse: fe,
213
+ onEdit: Y,
214
+ poweredByBankName: C
215
+ }) : null
216
+ ]
217
+ });
133
218
  }
134
219
  //#endregion
135
- export { b as useBillsTable };
220
+ export { D as BillsTab, D as default };
@@ -1,220 +1,4 @@
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 ee, useWidgetInitStaleForToken as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
- import "../../../shared/feature/dist/index.js";
12
- import { useDuplicateBillsCount as i } from "./index10.js";
13
- import { AddBillDialog as a } from "../../ui/dist/index10.js";
14
- import { BillsScreen as o } from "../../ui/dist/index82.js";
15
- import "../../ui/dist/index.js";
16
- import { DuplicateBillsContainer as te } from "./index12.js";
17
- import "./index14.js";
18
- import { BillCreateDialog as s } from "./index61.js";
19
- import "./index62.js";
20
- import { BillDetailsContainer as c } from "./index64.js";
21
- import "./index65.js";
22
- import "./index71.js";
23
1
  import "./index72.js";
24
- import { BILL_QUEUE_ORDER as l, BillQueue as u } from "./index73.js";
25
- import { BILLS_TAB_LABELS_EN as d } from "./index76.js";
26
- import { useBillsTable as f } from "./index82.js";
27
- import { copyTextToClipboard as p } from "./index74.js";
28
- import { resolveDuplicateWarning as m } from "./index75.js";
29
- import { billsTabTestIds as h, billsTableCellTestIds as ne } from "./index77.js";
30
- import { useCallback as re, useEffect as ie, useMemo as g, useState as _ } from "react";
31
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
32
- import { CalendarClockIcon as b, CheckIcon as x, FilePenIcon as S, ListIcon as C, LoaderCircleIcon as w } from "lucide-react";
33
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js
34
- var T = "bills@business-banking.app", E = {
35
- [u.Drafts]: /* @__PURE__ */ v(S, {
36
- className: "ttw:size-4",
37
- "aria-hidden": !0
38
- }),
39
- [u.Pending]: /* @__PURE__ */ v(w, {
40
- className: "ttw:size-4",
41
- "aria-hidden": !0
42
- }),
43
- [u.Scheduled]: /* @__PURE__ */ v(b, {
44
- className: "ttw:size-4",
45
- "aria-hidden": !0
46
- }),
47
- [u.Paid]: /* @__PURE__ */ v(x, {
48
- className: "ttw:size-4",
49
- "aria-hidden": !0
50
- }),
51
- [u.All]: /* @__PURE__ */ v(C, {
52
- className: "ttw:size-4",
53
- "aria-hidden": !0
54
- })
55
- };
56
- function D({ labels: u, onEnqueueFiles: b, openPayableId: x, onOpenPayableHandled: S, poweredByBankName: C, onSettingsClick: w }) {
57
- let D = g(() => ({
58
- ...d,
59
- ...u,
60
- queues: {
61
- ...d.queues,
62
- ...u?.queues
63
- },
64
- filters: {
65
- ...d.filters,
66
- ...u?.filters,
67
- presets: {
68
- ...d.filters.presets,
69
- ...u?.filters?.presets
70
- },
71
- statuses: {
72
- ...d.filters.statuses,
73
- ...u?.filters?.statuses
74
- },
75
- dateFieldNames: {
76
- ...d.filters.dateFieldNames,
77
- ...u?.filters?.dateFieldNames
78
- }
79
- },
80
- filterBar: {
81
- ...d.filterBar,
82
- ...u?.filterBar
83
- },
84
- queueEmptyStates: l.reduce((e, t) => ({
85
- ...e,
86
- [t]: {
87
- ...d.queueEmptyStates[t],
88
- ...u?.queueEmptyStates?.[t]
89
- }
90
- }), {})
91
- }), [u]), [ae, O] = _(!1), [oe, k] = _(), [A, j] = _(!1), [M, N] = _(), [P, F] = _(!1), [I, L] = _(!1), [R, z] = _(!1), { initResponse: B } = ee(), V = r(), H = t(B?.scopes, [n.PayableReadOrg]), U = t(B?.scopes, [n.PayableWriteOrg]), W = !B || H, G = !B || U, K = re((e, t) => {
92
- if (t && G) {
93
- k(e), j(!0);
94
- return;
95
- }
96
- N(e), L(!0);
97
- }, [G]), se = t(B?.scopes, [n.CounterpartReadOrg]), q = f({
98
- enabled: W,
99
- canReadVendors: se,
100
- isVendorFilterPaused: V,
101
- filterLabels: D.filters,
102
- onOpenBill: K,
103
- duplicateRowNote: D.duplicateRowNote,
104
- attachmentLabel: D.attachmentIndicator
105
- }), J = i({ enabled: W }), ce = m(J, D), le = g(() => l.map((e) => ({
106
- id: e,
107
- label: D.queues[e],
108
- icon: E[e]
109
- })), [D.queues]), ue = (e) => {
110
- z(!1), N(e), L(!0);
111
- }, de = () => {
112
- F(!1), L(!0);
113
- }, fe = () => {
114
- L(!1), F(!0);
115
- }, Y = () => {
116
- F(!1), L(!1), k(M), j(!0);
117
- }, X = g(() => ({
118
- createButton: D.createButton,
119
- settingsButton: D.settingsButton,
120
- addBill: { heading: D.nonEmptyHeading }
121
- }), [
122
- D.createButton,
123
- D.settingsButton,
124
- D.nonEmptyHeading
125
- ]), pe = g(() => ({
126
- ...q.filterBarProps,
127
- labels: D.filterBar
128
- }), [q.filterBarProps, D.filterBar]), Z = () => {
129
- O(!1), k(void 0), j(!0);
130
- }, Q = (e) => {
131
- O(!1), b?.(e);
132
- }, $ = async () => {
133
- await p(T) ? e.success(D.emailCopiedToast) : e.error(D.emailCopyFailedToast);
134
- };
135
- return ie(() => {
136
- x && (k(x), j(!0), S?.());
137
- }, [S, x]), /* @__PURE__ */ y("div", {
138
- "data-testid": h.root,
139
- children: [
140
- /* @__PURE__ */ v(o, {
141
- rows: q.rows,
142
- isLoading: q.isLoading || !B,
143
- isError: q.isError,
144
- onRetry: q.onRetry,
145
- sorting: q.sorting,
146
- onSortingChange: q.onSortingChange,
147
- pageSize: q.pageSize,
148
- onPageSizeChange: q.onPageSizeChange,
149
- hasNextPage: q.hasNextPage,
150
- hasPrevPage: q.hasPrevPage,
151
- onNextPage: q.onNextPage,
152
- onPrevPage: q.onPrevPage,
153
- filterTabs: le,
154
- selectedFilterTabId: q.selectedFilterTabId,
155
- onFilterTabChange: q.onFilterTabChange,
156
- searchValue: q.searchValue,
157
- onSearchChange: q.onSearchChange,
158
- filters: pe,
159
- visibleColumns: q.visibleColumns,
160
- cellTestIds: ne,
161
- isSearchActive: q.isSearchActive,
162
- showAddPanelWhenEmpty: q.showAddPanelWhenEmpty,
163
- emptyState: D.queueEmptyStates[q.selectedFilterTabId],
164
- onCreateClick: G ? () => O(!0) : void 0,
165
- onSettingsClick: w,
166
- onEnterManually: G ? Z : void 0,
167
- onFilesSelected: G ? Q : void 0,
168
- maxFiles: 10,
169
- emailAddress: T,
170
- onCopyEmail: $,
171
- duplicateWarning: ce,
172
- onReviewDuplicates: J.isError ? void 0 : () => z(!0),
173
- labels: X
174
- }),
175
- R ? /* @__PURE__ */ v(te, {
176
- open: R,
177
- onOpenChange: z,
178
- enabled: W,
179
- canManageDuplicates: G,
180
- onOpenBill: ue
181
- }) : null,
182
- G ? /* @__PURE__ */ v(a, {
183
- open: ae,
184
- onOpenChange: O,
185
- onFilesSelected: Q,
186
- maxFiles: 10,
187
- onEnterManually: Z,
188
- emailAddress: T,
189
- onCopyEmail: $,
190
- labels: { heading: q.hasAnyBills ? D.nonEmptyHeading : D.emptyHeading }
191
- }) : null,
192
- A ? /* @__PURE__ */ v(s, {
193
- open: A,
194
- onOpenChange: j,
195
- payableId: oe
196
- }) : null,
197
- P ? /* @__PURE__ */ v(c, {
198
- open: P,
199
- onOpenChange: F,
200
- payableId: M,
201
- onClose: () => F(!1),
202
- onExpand: de,
203
- onEdit: Y,
204
- testId: h.detailsSheet,
205
- poweredByBankName: C
206
- }) : null,
207
- I ? /* @__PURE__ */ v(s, {
208
- open: I,
209
- onOpenChange: L,
210
- payableId: M,
211
- readOnly: !0,
212
- onCollapse: fe,
213
- onEdit: Y,
214
- poweredByBankName: C
215
- }) : null
216
- ]
217
- });
218
- }
219
- //#endregion
220
- export { D as BillsTab, D as default };
2
+ import "./index75.js";
3
+ import "./index81.js";
4
+ import "./index82.js";
@@ -1,4 +1,7 @@
1
- import "./index73.js";
2
- import "./index76.js";
3
- import "./index82.js";
4
- import "./index83.js";
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js
2
+ var e = {
3
+ bills: "Bills",
4
+ vendors: "Vendors"
5
+ };
6
+ //#endregion
7
+ export { e as DEFAULT_TABS_LABELS };
@@ -1,7 +1,100 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
6
+ import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
7
+ import "../../../shared/data-access/dist/index.js";
8
+ import { EmbeddedToaster as n } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
9
+ import "../../../shared/ui/dist/index.js";
10
+ import { useAnalyticsTrack as r } from "../../../shared/feature/dist/lib/analytics/hooks.js";
11
+ import { WidgetProvider as i } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
12
+ import { useWidgetConfig as a } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
+ import "../../../shared/feature/dist/index.js";
14
+ import { BillPayWidgetUi as o } from "../../ui/dist/index60.js";
15
+ import { BillUploadStatusTray as s } from "../../ui/dist/index85.js";
16
+ import "../../ui/dist/index.js";
17
+ import { useBillUploadQueue as c } from "./index70.js";
18
+ import "./index71.js";
19
+ import { billsTabTestIds as l } from "./index76.js";
20
+ import { BillsTab as u } from "./index82.js";
21
+ import "./index83.js";
22
+ import { BillPayWidgetAnalyticsEvent as d, WIDGET_NAME as f } from "./index65.js";
23
+ import { DEFAULT_TABS_LABELS as p } from "./index84.js";
24
+ import { CounterpartsWidget as m } from "../../../counterparts-widget/feature/dist/index8.js";
25
+ import "../../../counterparts-widget/feature/dist/index.js";
26
+ import { useCallback as h, useEffect as g, useState as _ } from "react";
27
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
1
28
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js
2
- var e = {
3
- bills: "Bills",
4
- vendors: "Vendors"
5
- };
29
+ var x = {
30
+ Bills: "bills",
31
+ Vendors: "vendors"
32
+ }, S = [x.Bills, x.Vendors];
33
+ function C({ labels: i, initialTab: f = x.Bills, tabsLabels: C, vendorLabels: w, poweredByBankName: T, onSettingsClick: E }) {
34
+ let D = r();
35
+ g(() => {
36
+ D(d.Mounted);
37
+ }, [D]);
38
+ let O = {
39
+ ...p,
40
+ ...C
41
+ }, { initResponse: k } = a(), A = e(k?.scopes, [t.ApprovalPolicyWriteOrg]) && e(k?.scopes, [t.PayableWriteOrg]) && e(k?.scopes, [t.RoleReadOrg]) && e(k?.scopes, [t.UserReadOrg]), [j, M] = _(f), [N, P] = _(), F = h((e) => {
42
+ M(x.Bills), P(e);
43
+ }, []), I = c({ onOpenBill: F }), L = [{
44
+ id: x.Bills,
45
+ label: O.bills,
46
+ content: /* @__PURE__ */ y(u, {
47
+ onEnqueueFiles: I.enqueue,
48
+ openPayableId: N,
49
+ onOpenPayableHandled: () => P(void 0),
50
+ poweredByBankName: T,
51
+ onSettingsClick: E && A ? E : void 0
52
+ })
53
+ }, {
54
+ id: x.Vendors,
55
+ label: O.vendors,
56
+ content: /* @__PURE__ */ y(m, {
57
+ ...w,
58
+ counterpartType: "vendor",
59
+ onViewAllDocuments: () => M(x.Bills)
60
+ })
61
+ }], R = L.some((e) => e.id === j) ? j : S.find((e) => L.some((t) => t.id === e)) ?? L[0]?.id ?? "";
62
+ return /* @__PURE__ */ b(v, { children: [
63
+ /* @__PURE__ */ y(n, {}),
64
+ /* @__PURE__ */ y(o, {
65
+ labels: i,
66
+ tabs: L,
67
+ selectedTabId: R,
68
+ onTabChange: M
69
+ }),
70
+ I.isVisible ? /* @__PURE__ */ y(s, {
71
+ sections: I.sections,
72
+ summaryLabel: I.summaryLabel,
73
+ collapsed: I.collapsed,
74
+ onToggleCollapsed: I.onToggleCollapsed,
75
+ onClose: I.onClose,
76
+ testId: l.uploadTray
77
+ }) : null
78
+ ] });
79
+ }
80
+ function w({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: p, providerLabels: m, ...h }) {
81
+ return /* @__PURE__ */ y(i, {
82
+ widgetName: f,
83
+ baseUrl: e,
84
+ widgetToken: t,
85
+ organizationId: n,
86
+ configClient: r,
87
+ gatewayRouting: a,
88
+ linkComponent: o,
89
+ implementation: s,
90
+ uiFramework: c,
91
+ errorFallback: l,
92
+ onError: u,
93
+ analytics: d,
94
+ disclosuresAcceptance: p,
95
+ providerLabels: m,
96
+ children: /* @__PURE__ */ y(C, { ...h })
97
+ });
98
+ }
6
99
  //#endregion
7
- export { e as DEFAULT_TABS_LABELS };
100
+ export { w as BillPayWidgetNative, w as default };