@tesouro/embedded-components-react 0.5.74 → 0.5.76

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 (97) hide show
  1. package/dist/experimental/InvoiceSettings.d.ts +660 -0
  2. package/dist/experimental/InvoiceSettings.js +3 -0
  3. package/dist/experimental/index.d.ts +31 -2
  4. package/dist/experimental/index.js +4 -2
  5. package/dist/index.css +0 -8
  6. package/dist/index.js +1 -1
  7. package/dist/lib/BillPayWidget.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +140 -7
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +46 -140
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +114 -47
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +163 -112
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +75 -164
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +21 -75
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +71 -23
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +376 -65
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +12 -381
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +84 -12
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +54 -79
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +223 -54
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +37 -223
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +245 -37
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +21 -252
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +571 -21
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -572
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +44 -4
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +247 -38
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +3 -234
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +4 -3
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +44 -2
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -46
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -1
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +11 -6
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +127 -11
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -129
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +127 -3
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -124
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +7 -8
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +47 -8
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +18 -44
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +28 -20
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +82 -27
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +47 -83
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +250 -47
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +123 -241
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +211 -126
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +3 -219
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +7 -4
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +98 -5
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +1 -100
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +26 -0
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +10 -10
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +2 -72
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +12 -269
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +2 -19
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +16 -50
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +97 -15
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +76 -47
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +277 -2
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +2 -35
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +16 -369
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +56 -2
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +2 -23
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +15 -93
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +50 -2
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +1 -31
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +32 -49
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +374 -2
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +1 -55
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +20 -10
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +87 -188
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +1 -1
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +30 -2
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +48 -37
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +47 -10
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +10 -85
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +197 -2
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +2 -4
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +2 -14
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +41 -2
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +2 -4
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +14 -17
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +88 -2
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -94
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +167 -161
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +5 -5
  87. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index.js +3 -1
  88. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index.js +4 -0
  89. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index2.js +5 -0
  90. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index3.js +29 -0
  91. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index4.js +2 -0
  92. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  93. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js +5 -1
  94. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  95. package/dist/packages/shared-ui-shadcn/dist/index.js +1391 -1369
  96. package/package.json +1 -1
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +0 -27
@@ -1,42 +1,251 @@
1
- import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index64.js";
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 { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
+ import "../../../shared/data-access/dist/index.js";
9
+ import { buildPayableAuditHistory as te, hasUnattributedAuditRows as ne } from "../../../shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js";
10
+ import { useWidgetConfig as n } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
+ import { useOrganizationUserNames as r } from "../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
12
+ import "../../../shared/feature/dist/index.js";
13
+ import { usePayableApprovalRequestsQuery as i } from "../../data-access/dist/index8.js";
14
+ import { usePayableHistoryQuery as a } from "../../data-access/dist/index9.js";
15
+ import { useAllPayableLineItemsQuery as o } from "../../data-access/dist/index10.js";
16
+ import { usePayableQuery as s } from "../../data-access/dist/index17.js";
17
+ import "../../data-access/dist/index.js";
18
+ import { BillDecisionDialog as c } from "../../ui/dist/index63.js";
19
+ import { BillDetailsSheet as l } from "../../ui/dist/index65.js";
20
+ import { BillDuplicateNotice as u } from "../../ui/dist/index72.js";
21
+ import { MarkAsPaidDialog as d } from "../../ui/dist/index102.js";
2
22
  import "../../ui/dist/index.js";
3
- import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index15.js";
23
+ import { usePayableDuplicateReview as f } from "./index13.js";
24
+ import "./index14.js";
25
+ import { canOverrideApprovalPolicy as p, canReadCounterpartBankAccounts as re } from "./index20.js";
26
+ import { resolveAmountDueMinorUnits as ie } from "./index21.js";
27
+ import { usePayableAchInstructions as ae } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
28
+ import "../../../shared/counterpart-management/feature/dist/index.js";
29
+ import { PayBillFlow as oe } from "./index27.js";
30
+ import "./index28.js";
31
+ import { mapPayableToBillDetails as se } from "./index42.js";
32
+ import { mergeMarkAsPaidFlowLabels as ce } from "./index15.js";
33
+ import { useMarkAsPaidFlow as le } from "./index17.js";
4
34
  import "./index18.js";
5
- import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index29.js";
6
- import { AWAITING_APPROVAL_LABEL_EN as r, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as i, BILL_DETAIL_ACTIONS_LABELS_EN as a, PAYMENT_HISTORY_LABELS_EN as o, SCHEDULED_STATUS_BADGE_LABEL_EN as s, SCHEDULED_SUMMARY_LABEL_EN as c } from "./index46.js";
35
+ import { mergeDecisionDialogCopy as ue, mergePaymentHistoryMethodLabels as de } from "./index45.js";
36
+ import { buildPaymentHistory as fe } from "./index3.js";
37
+ import { currentApprovalRound as pe } from "./index4.js";
38
+ import { usePayableApprovalRoundStart as me } from "./index32.js";
39
+ import { useApprovalPolicyCardView as he } from "./index33.js";
40
+ import { resolveBillRejectionNotice as ge } from "./index34.js";
41
+ import { useCurrentApprovalRequestId as _e } from "./index35.js";
42
+ import { usePayableDetailActions as ve } from "./index36.js";
43
+ import { useScheduledPayment as ye } from "./index37.js";
44
+ import { BILL_DETAILS_LABELS_EN as m } from "./index62.js";
45
+ import { useMemo as h, useRef as be } from "react";
46
+ import { Fragment as xe, jsx as g, jsxs as _ } from "react/jsx-runtime";
7
47
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js
8
- var l = {
9
- subtitle: "Accounts payable",
10
- vendorRow: "Vendor",
11
- bankAccountRow: "ACH bank account",
12
- bankAccountValue: (e) => `Account ending in ${e}`,
13
- ...o,
14
- invoiceNumberRow: "Number",
15
- issueDateRow: "Issue date",
16
- dueDateRow: "Due date",
17
- poNumberRow: "PO number",
18
- notProvided: "Not provided",
19
- glCodeMissing: "GL code not specified",
20
- quantityValue: (e, t) => `${e} x ${t}`,
21
- quantityOnlyValue: (e) => e,
22
- subtotalRow: "Subtotal",
23
- discountsRow: "Discounts",
24
- taxRow: "Tax",
25
- totalRow: "Total",
26
- actionError: a.actionError,
27
- actionSuccess: a.actionSuccess,
28
- scheduledSummary: c,
29
- scheduledStatusBadge: s,
30
- awaitingApprovalNotice: r,
31
- awaitingApprovalUnknownNotice: i,
32
- paidOnLabel: (e) => `Paid on ${e}`,
33
- rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
34
- rejectedOn: (e) => `Rejected on ${e}`,
35
- rejectionMessage: (e) => `"${e}"`,
36
- sheet: e,
37
- decisionDialog: a.decisionDialog,
38
- approvalPolicyCopy: n,
39
- markAsPaid: t
40
- };
48
+ function v({ open: v, onOpenChange: y, payableId: b, onClose: x, onExpand: S, onEdit: C, testId: w, labels: T, poweredByBankName: E }) {
49
+ let D = h(() => ({
50
+ ...m,
51
+ ...T,
52
+ sheet: {
53
+ ...m.sheet,
54
+ ...T?.sheet,
55
+ statusBadge: {
56
+ ...m.sheet.statusBadge,
57
+ ...T?.sheet?.statusBadge
58
+ },
59
+ approvalPolicy: {
60
+ ...m.sheet.approvalPolicy,
61
+ ...T?.sheet?.approvalPolicy
62
+ },
63
+ dueDate: {
64
+ ...m.sheet.dueDate,
65
+ ...T?.sheet?.dueDate
66
+ },
67
+ auditHistory: {
68
+ ...m.sheet.auditHistory,
69
+ ...T?.sheet?.auditHistory
70
+ }
71
+ },
72
+ decisionDialog: ue(m.decisionDialog, T?.decisionDialog),
73
+ approvalPolicyCopy: {
74
+ ...m.approvalPolicyCopy,
75
+ ...T?.approvalPolicyCopy
76
+ },
77
+ history: {
78
+ ...m.history,
79
+ ...T?.history
80
+ },
81
+ markAsPaid: ce(T?.markAsPaid),
82
+ actionSuccess: {
83
+ ...m.actionSuccess,
84
+ ...T?.actionSuccess
85
+ },
86
+ paymentHistoryMethodLabels: de(T?.paymentHistoryMethodLabels)
87
+ }), [T]), O = s(b), k = o(b), A = ee(), { initResponse: j } = n(), M = O.data, N = be(null), P = _e({
88
+ payableId: b,
89
+ status: M?.status
90
+ }), Se = M?.status === "rejected", Ce = e(j?.scopes, [t.ApprovalRequestReadOrg]), F = Se && Ce, I = me({
91
+ payableId: b,
92
+ enabled: F
93
+ }), L = i(b, { enabled: F }), R = e(j?.scopes, [t.UserReadOrg]), { userNames: z, isError: we, isResolving: Te } = r({ enabled: R }), B = h(() => pe(L.data?.data, I.roundStartedAt), [L.data, I.roundStartedAt]), V = h(() => ge({
94
+ payableStatus: M?.status,
95
+ approvalRequests: B,
96
+ userNames: z,
97
+ payableUpdatedAt: M?.updated_at,
98
+ labels: D
99
+ }), [
100
+ M?.status,
101
+ M?.updated_at,
102
+ B,
103
+ z,
104
+ D
105
+ ]), H = he({
106
+ payableId: b,
107
+ approvalPolicyId: M?.approval_policy_id,
108
+ copy: D.approvalPolicyCopy
109
+ }), U = p({
110
+ status: M?.status,
111
+ scopes: j?.scopes,
112
+ arePendingApproversUnknown: H.isLoading,
113
+ hasApprovalPolicy: !!M?.approval_policy_id,
114
+ hasWaitingRequest: P.hasWaitingRequest
115
+ }), Ee = !!P.id, W = P.isLoading || H.isLoading, G = h(() => H.pendingApprovers.length ? H.pendingApprovers.flatMap((e) => e.names) : void 0, [H.pendingApprovers]), K = ye({
116
+ payableId: b,
117
+ scheduledPaymentDate: M?.scheduled_payment_date
118
+ }), q = re(j?.scopes), J = ae({
119
+ counterpartId: M?.counterpart_id,
120
+ currency: M?.currency,
121
+ currentBankAccountId: M?.counterpart_bank_account_id,
122
+ enabled: q
123
+ }), Y = le({
124
+ payableId: b,
125
+ amountDueMinorUnits: ie(M) ?? 0,
126
+ amountToPayMinorUnits: M?.amount_to_pay ?? void 0,
127
+ currencyCode: M?.currency ?? void 0,
128
+ dueDate: M?.due_date,
129
+ hasScheduledPayment: K.hasScheduledPayment,
130
+ testId: w,
131
+ labels: D.markAsPaid
132
+ }), { actions: De, decisionDialog: Oe } = ve({
133
+ payableId: M ? b : void 0,
134
+ status: M?.status,
135
+ currentApprovalRequestId: P.id,
136
+ hasScheduledPayment: K.hasScheduledPayment,
137
+ scheduledPaymentIntentId: K.scheduledPaymentIntentId,
138
+ isScheduledPaymentUnknown: K.isResolving,
139
+ isPayabilityUnknown: J.isLoading,
140
+ hasApprovalPolicy: !!M?.approval_policy_id,
141
+ hasWaitingRequest: P.hasWaitingRequest,
142
+ pendingApprovers: H.pendingApprovers,
143
+ arePendingApproversUnknown: H.isLoading,
144
+ labels: {
145
+ edit: D.sheet.editButton,
146
+ payBill: D.sheet.payButton,
147
+ markAsPaid: D.sheet.markAsPaidButton,
148
+ reject: D.sheet.rejectButton,
149
+ approve: D.sheet.approveButton,
150
+ cancel: D.sheet.cancelButton,
151
+ cancelScheduledPayment: D.sheet.cancelScheduledPaymentButton,
152
+ reopen: D.sheet.reopenButton,
153
+ forceApprove: D.sheet.forceApproveButton,
154
+ forceReject: D.sheet.forceRejectButton,
155
+ policyOverridesHeading: D.sheet.policyOverridesGroup,
156
+ decisionDialog: D.decisionDialog,
157
+ actionError: D.actionError,
158
+ actionSuccess: D.actionSuccess
159
+ },
160
+ isMarkAsPaidPending: Y.isPending,
161
+ onMarkAsPaidSelect: Y.open,
162
+ onPayBillSelect: () => N.current?.open(),
163
+ onEditSelect: C,
164
+ onActionSucceeded: (e) => {
165
+ e === "reopen" && C?.();
166
+ }
167
+ }), ke = K.hasScheduledPayment && K.scheduledDateLabel ? D.scheduledSummary(K.scheduledDateLabel) : void 0, X = f({
168
+ payable: M,
169
+ canManage: e(j?.scopes, [t.PayableWriteOrg])
170
+ }), Z = X.isPossibleDuplicate ? /* @__PURE__ */ g(u, {
171
+ onNotADuplicate: X.onNotADuplicate,
172
+ isActionDisabled: X.isBusy
173
+ }) : void 0, Q = a(b), $ = h(() => te(Q.data?.data ?? [], z, D.history), [
174
+ Q.data,
175
+ z,
176
+ D.history
177
+ ]), Ae = R && we && ne(Q.data?.data ?? [], $, z), je = h(() => fe({
178
+ records: K.paymentRecords,
179
+ events: Q.data?.data ?? [],
180
+ currencyCode: M?.currency,
181
+ labels: D
182
+ }), [
183
+ K.paymentRecords,
184
+ Q.data,
185
+ M?.currency,
186
+ D
187
+ ]), Me = h(() => M ? se({
188
+ payable: M,
189
+ lineItems: k.lineItems,
190
+ ledgerAccounts: A.data?.data ?? [],
191
+ labels: D,
192
+ hasScheduledPayment: K.hasScheduledPayment,
193
+ rejection: V,
194
+ achInstructions: J.achInstructions,
195
+ achInstructionsReadable: q && !J.isLoading && !J.isError
196
+ }) : void 0, [
197
+ M,
198
+ k.lineItems,
199
+ A.data,
200
+ D,
201
+ K.hasScheduledPayment,
202
+ V,
203
+ J.achInstructions,
204
+ J.isError,
205
+ J.isLoading,
206
+ q
207
+ ]), Ne = O.isLoading || k.isResolving || A.isResolving || J.isLoading, Pe = O.isError || k.isError || A.isError;
208
+ return /* @__PURE__ */ _(xe, { children: [
209
+ /* @__PURE__ */ g(l, {
210
+ open: v,
211
+ onOpenChange: y,
212
+ details: Me,
213
+ actions: De,
214
+ approvalPolicy: H.view,
215
+ showApprovalOverrideNotice: !W && U,
216
+ awaitingApprovalNotice: !W && !Ee && !U && M?.status === "approve_in_progress" && M?.approval_policy_id ? G ? D.awaitingApprovalNotice(G) : D.awaitingApprovalUnknownNotice : void 0,
217
+ scheduledSummary: ke,
218
+ auditHistory: $,
219
+ auditHistoryError: Q.isError,
220
+ auditHistoryLoading: Q.isLoading || Te,
221
+ auditHistoryNamesError: Ae,
222
+ paymentHistory: je,
223
+ paymentHistoryError: K.isError || Q.isError,
224
+ paymentHistoryLoading: K.isResolving || Q.isLoading,
225
+ isLoading: Ne,
226
+ isError: Pe,
227
+ notice: Z,
228
+ onClose: x,
229
+ onExpand: S,
230
+ testId: w,
231
+ labels: D.sheet
232
+ }),
233
+ /* @__PURE__ */ g(c, {
234
+ ...Oe,
235
+ labels: { cancelButton: D.decisionDialog.cancelButton },
236
+ testId: w ? `${w}-decision-dialog` : void 0,
237
+ confirmTestId: w ? `${w}-decision-confirm` : void 0,
238
+ reasonTestId: w ? `${w}-decision-reason` : void 0,
239
+ reasonFieldId: w ? `${w}-decision-reason-field` : void 0
240
+ }),
241
+ /* @__PURE__ */ g(d, { ...Y.dialogProps }),
242
+ M ? /* @__PURE__ */ g(oe, {
243
+ ref: N,
244
+ payable: M,
245
+ onMissingAchInstructions: S,
246
+ poweredByBankName: E
247
+ }) : null
248
+ ] });
249
+ }
41
250
  //#endregion
42
- export { l as BILL_DETAILS_LABELS_EN };
251
+ export { v as BillDetailsContainer, v as default };
@@ -1,234 +1,3 @@
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 { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
- import "../../../shared/data-access/dist/index.js";
9
- import { useWidgetConfig as te } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
- import { useOrganizationUserNames as ne } from "../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
11
- import "../../../shared/feature/dist/index.js";
12
- import { usePayableApprovalRequestsQuery as n } from "../../data-access/dist/index8.js";
13
- import { usePayableHistoryQuery as r } from "../../data-access/dist/index9.js";
14
- import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index10.js";
15
- import { usePayableQuery as a } from "../../data-access/dist/index17.js";
16
- import "../../data-access/dist/index.js";
17
- import { BillDecisionDialog as o } from "../../ui/dist/index56.js";
18
- import { BillDetailsSheet as s } from "../../ui/dist/index65.js";
19
- import { BillDuplicateNotice as c } from "../../ui/dist/index72.js";
20
- import { MarkAsPaidDialog as l } from "../../ui/dist/index102.js";
21
- import "../../ui/dist/index.js";
22
- import { usePayableDuplicateReview as u } from "./index13.js";
23
- import "./index14.js";
24
- import { canOverrideApprovalPolicy as d, canReadCounterpartBankAccounts as f } from "./index20.js";
25
- import { resolveAmountDueMinorUnits as p } from "./index21.js";
26
- import { usePayableAchInstructions as m } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
27
- import "../../../shared/counterpart-management/feature/dist/index.js";
28
- import { PayBillFlow as h } from "./index27.js";
29
- import "./index28.js";
30
- import { mapPayableToBillDetails as re } from "./index42.js";
31
- import { mergeMarkAsPaidFlowLabels as ie } from "./index15.js";
32
- import { useMarkAsPaidFlow as ae } from "./index17.js";
33
- import "./index18.js";
34
- import { mergeDecisionDialogCopy as oe, mergePaymentHistoryMethodLabels as se } from "./index46.js";
35
- import { buildPaymentHistory as ce } from "./index3.js";
36
- import { currentApprovalRound as le } from "./index4.js";
37
- import { usePayableApprovalRoundStart as ue } from "./index32.js";
38
- import { useApprovalPolicyCardView as de } from "./index33.js";
39
- import { resolveBillRejectionNotice as fe } from "./index34.js";
40
- import { useCurrentApprovalRequestId as pe } from "./index35.js";
41
- import { usePayableDetailActions as me } from "./index36.js";
42
- import { useScheduledPayment as he } from "./index37.js";
43
- import { BILL_DETAILS_LABELS_EN as g } from "./index63.js";
44
- import { useMemo as _, useRef as ge } from "react";
45
- import { Fragment as _e, jsx as v, jsxs as ve } from "react/jsx-runtime";
46
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js
47
- function y({ open: y, onOpenChange: b, payableId: x, onClose: S, onExpand: C, onEdit: w, testId: T, labels: E, poweredByBankName: D }) {
48
- let O = _(() => ({
49
- ...g,
50
- ...E,
51
- sheet: {
52
- ...g.sheet,
53
- ...E?.sheet,
54
- statusBadge: {
55
- ...g.sheet.statusBadge,
56
- ...E?.sheet?.statusBadge
57
- },
58
- approvalPolicy: {
59
- ...g.sheet.approvalPolicy,
60
- ...E?.sheet?.approvalPolicy
61
- },
62
- dueDate: {
63
- ...g.sheet.dueDate,
64
- ...E?.sheet?.dueDate
65
- }
66
- },
67
- decisionDialog: oe(g.decisionDialog, E?.decisionDialog),
68
- approvalPolicyCopy: {
69
- ...g.approvalPolicyCopy,
70
- ...E?.approvalPolicyCopy
71
- },
72
- markAsPaid: ie(E?.markAsPaid),
73
- actionSuccess: {
74
- ...g.actionSuccess,
75
- ...E?.actionSuccess
76
- },
77
- paymentHistoryMethodLabels: se(E?.paymentHistoryMethodLabels)
78
- }), [E]), k = a(x), A = i(x), j = ee(), { initResponse: M } = te(), N = k.data, P = ge(null), F = pe({
79
- payableId: x,
80
- status: N?.status
81
- }), I = N?.status === "rejected", ye = e(M?.scopes, [t.ApprovalRequestReadOrg]), L = I && ye, R = ue({
82
- payableId: x,
83
- enabled: L
84
- }), z = n(x, { enabled: L }), be = e(M?.scopes, [t.UserReadOrg]), { userNames: B } = ne({ enabled: I && be }), V = _(() => le(z.data?.data, R.roundStartedAt), [z.data, R.roundStartedAt]), H = _(() => fe({
85
- payableStatus: N?.status,
86
- approvalRequests: V,
87
- userNames: B,
88
- payableUpdatedAt: N?.updated_at,
89
- labels: O
90
- }), [
91
- N?.status,
92
- N?.updated_at,
93
- V,
94
- B,
95
- O
96
- ]), U = de({
97
- payableId: x,
98
- approvalPolicyId: N?.approval_policy_id,
99
- copy: O.approvalPolicyCopy
100
- }), W = d({
101
- status: N?.status,
102
- scopes: M?.scopes,
103
- arePendingApproversUnknown: U.isLoading,
104
- hasApprovalPolicy: !!N?.approval_policy_id,
105
- hasWaitingRequest: F.hasWaitingRequest
106
- }), xe = !!F.id, G = F.isLoading || U.isLoading, K = _(() => U.pendingApprovers.length ? U.pendingApprovers.flatMap((e) => e.names) : void 0, [U.pendingApprovers]), q = he({
107
- payableId: x,
108
- scheduledPaymentDate: N?.scheduled_payment_date
109
- }), J = f(M?.scopes), Y = m({
110
- counterpartId: N?.counterpart_id,
111
- currency: N?.currency,
112
- currentBankAccountId: N?.counterpart_bank_account_id,
113
- enabled: J
114
- }), X = ae({
115
- payableId: x,
116
- amountDueMinorUnits: p(N) ?? 0,
117
- amountToPayMinorUnits: N?.amount_to_pay ?? void 0,
118
- currencyCode: N?.currency ?? void 0,
119
- dueDate: N?.due_date,
120
- hasScheduledPayment: q.hasScheduledPayment,
121
- testId: T,
122
- labels: O.markAsPaid
123
- }), { actions: Se, decisionDialog: Ce } = me({
124
- payableId: N ? x : void 0,
125
- status: N?.status,
126
- currentApprovalRequestId: F.id,
127
- hasScheduledPayment: q.hasScheduledPayment,
128
- scheduledPaymentIntentId: q.scheduledPaymentIntentId,
129
- isScheduledPaymentUnknown: q.isResolving,
130
- isPayabilityUnknown: Y.isLoading,
131
- hasApprovalPolicy: !!N?.approval_policy_id,
132
- hasWaitingRequest: F.hasWaitingRequest,
133
- pendingApprovers: U.pendingApprovers,
134
- arePendingApproversUnknown: U.isLoading,
135
- labels: {
136
- edit: O.sheet.editButton,
137
- payBill: O.sheet.payButton,
138
- markAsPaid: O.sheet.markAsPaidButton,
139
- reject: O.sheet.rejectButton,
140
- approve: O.sheet.approveButton,
141
- cancel: O.sheet.cancelButton,
142
- cancelScheduledPayment: O.sheet.cancelScheduledPaymentButton,
143
- reopen: O.sheet.reopenButton,
144
- forceApprove: O.sheet.forceApproveButton,
145
- forceReject: O.sheet.forceRejectButton,
146
- policyOverridesHeading: O.sheet.policyOverridesGroup,
147
- decisionDialog: O.decisionDialog,
148
- actionError: O.actionError,
149
- actionSuccess: O.actionSuccess
150
- },
151
- isMarkAsPaidPending: X.isPending,
152
- onMarkAsPaidSelect: X.open,
153
- onPayBillSelect: () => P.current?.open(),
154
- onEditSelect: w,
155
- onActionSucceeded: (e) => {
156
- e === "reopen" && w?.();
157
- }
158
- }), we = q.hasScheduledPayment && q.scheduledDateLabel ? O.scheduledSummary(q.scheduledDateLabel) : void 0, Z = u({
159
- payable: N,
160
- canManage: e(M?.scopes, [t.PayableWriteOrg])
161
- }), Q = Z.isPossibleDuplicate ? /* @__PURE__ */ v(c, {
162
- onNotADuplicate: Z.onNotADuplicate,
163
- isActionDisabled: Z.isBusy
164
- }) : void 0, $ = r(x), Te = _(() => ce({
165
- records: q.paymentRecords,
166
- events: $.data?.data ?? [],
167
- currencyCode: N?.currency,
168
- labels: O
169
- }), [
170
- q.paymentRecords,
171
- $.data,
172
- N?.currency,
173
- O
174
- ]), Ee = _(() => N ? re({
175
- payable: N,
176
- lineItems: A.lineItems,
177
- ledgerAccounts: j.data?.data ?? [],
178
- labels: O,
179
- hasScheduledPayment: q.hasScheduledPayment,
180
- rejection: H,
181
- achInstructions: Y.achInstructions,
182
- achInstructionsReadable: J && !Y.isLoading && !Y.isError
183
- }) : void 0, [
184
- N,
185
- A.lineItems,
186
- j.data,
187
- O,
188
- q.hasScheduledPayment,
189
- H,
190
- Y.achInstructions,
191
- Y.isError,
192
- Y.isLoading,
193
- J
194
- ]), De = k.isLoading || A.isResolving || j.isResolving || Y.isLoading, Oe = k.isError || A.isError || j.isError;
195
- return /* @__PURE__ */ ve(_e, { children: [
196
- /* @__PURE__ */ v(s, {
197
- open: y,
198
- onOpenChange: b,
199
- details: Ee,
200
- actions: Se,
201
- approvalPolicy: U.view,
202
- showApprovalOverrideNotice: !G && W,
203
- awaitingApprovalNotice: !G && !xe && !W && N?.status === "approve_in_progress" && N?.approval_policy_id ? K ? O.awaitingApprovalNotice(K) : O.awaitingApprovalUnknownNotice : void 0,
204
- scheduledSummary: we,
205
- paymentHistory: Te,
206
- paymentHistoryError: q.isError || $.isError,
207
- paymentHistoryLoading: q.isResolving || $.isLoading,
208
- isLoading: De,
209
- isError: Oe,
210
- notice: Q,
211
- onClose: S,
212
- onExpand: C,
213
- testId: T,
214
- labels: O.sheet
215
- }),
216
- /* @__PURE__ */ v(o, {
217
- ...Ce,
218
- labels: { cancelButton: O.decisionDialog.cancelButton },
219
- testId: T ? `${T}-decision-dialog` : void 0,
220
- confirmTestId: T ? `${T}-decision-confirm` : void 0,
221
- reasonTestId: T ? `${T}-decision-reason` : void 0,
222
- reasonFieldId: T ? `${T}-decision-reason-field` : void 0
223
- }),
224
- /* @__PURE__ */ v(l, { ...X.dialogProps }),
225
- N ? /* @__PURE__ */ v(h, {
226
- ref: P,
227
- payable: N,
228
- onMissingAchInstructions: C,
229
- poweredByBankName: D
230
- }) : null
231
- ] });
232
- }
233
- //#endregion
234
- export { y as BillDetailsContainer, y as default };
1
+ import "./index42.js";
2
+ import "./index62.js";
3
+ import "./index63.js";
@@ -1,3 +1,4 @@
1
- import "./index42.js";
2
- import "./index63.js";
3
- import "./index64.js";
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js
2
+ var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
3
+ //#endregion
4
+ export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1,4 +1,46 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
+ import "../../../shared/feature/dist/index.js";
7
+ import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index65.js";
8
+ import { Payables as r } from "../../../monite-sdk/dist/index447.js";
9
+ import "../../../monite-sdk/dist/index.js";
10
+ import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
+ import "../../../shared/monite-wrapper/feature/dist/index.js";
12
+ import { useEffect as a } from "react";
13
+ import { jsx as o } from "react/jsx-runtime";
1
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js
2
- var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
15
+ var s = (e) => e;
16
+ function c(n) {
17
+ let i = e();
18
+ return a(() => {
19
+ i(t.Mounted);
20
+ }, [i]), /* @__PURE__ */ o(r, { ...n });
21
+ }
22
+ function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, providerLabels: v, pageTitleComponent: y = s, ...b }) {
23
+ return /* @__PURE__ */ o(i, {
24
+ widgetName: n,
25
+ baseUrl: e,
26
+ widgetToken: t,
27
+ organizationId: r,
28
+ configClient: a,
29
+ gatewayRouting: l,
30
+ linkComponent: u,
31
+ implementation: d,
32
+ uiFramework: f,
33
+ errorFallback: p,
34
+ onError: m,
35
+ finopsThemeColors: h,
36
+ analytics: g,
37
+ disclosuresAcceptance: _,
38
+ providerLabels: v,
39
+ children: /* @__PURE__ */ o(c, {
40
+ ...b,
41
+ pageTitleComponent: y
42
+ })
43
+ });
44
+ }
3
45
  //#endregion
4
- export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
46
+ export { l as BillPayWidgetMonite, l as default };
@@ -1,46 +1 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import "../../../shared/feature/dist/index.js";
7
- import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index66.js";
8
- import { Payables as r } from "../../../monite-sdk/dist/index447.js";
9
- import "../../../monite-sdk/dist/index.js";
10
- import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
- import "../../../shared/monite-wrapper/feature/dist/index.js";
12
- import { useEffect as a } from "react";
13
- import { jsx as o } from "react/jsx-runtime";
14
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js
15
- var s = (e) => e;
16
- function c(n) {
17
- let i = e();
18
- return a(() => {
19
- i(t.Mounted);
20
- }, [i]), /* @__PURE__ */ o(r, { ...n });
21
- }
22
- function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, providerLabels: v, pageTitleComponent: y = s, ...b }) {
23
- return /* @__PURE__ */ o(i, {
24
- widgetName: n,
25
- baseUrl: e,
26
- widgetToken: t,
27
- organizationId: r,
28
- configClient: a,
29
- gatewayRouting: l,
30
- linkComponent: u,
31
- implementation: d,
32
- uiFramework: f,
33
- errorFallback: p,
34
- onError: m,
35
- finopsThemeColors: h,
36
- analytics: g,
37
- disclosuresAcceptance: _,
38
- providerLabels: v,
39
- children: /* @__PURE__ */ o(c, {
40
- ...b,
41
- pageTitleComponent: y
42
- })
43
- });
44
- }
45
- //#endregion
46
- export { l as BillPayWidgetMonite, l as default };
1
+ import "./index66.js";
@@ -1 +1,8 @@
1
- import "./index67.js";
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js
2
+ var e = (e) => [
3
+ "bill-pay",
4
+ "upload-queue",
5
+ e ?? ""
6
+ ];
7
+ //#endregion
8
+ export { e as billPayUploadQueueKey };
@@ -1,8 +1,13 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js
2
- var e = (e) => [
3
- "bill-pay",
4
- "upload-queue",
5
- e ?? ""
6
- ];
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
+ duplicateCaption: (e) => `${e} possible ${e === 1 ? "duplicate" : "duplicates"}`,
7
+ failedCaption: (e) => `${e} failed to upload`,
8
+ tooManyFilesError: (e) => `You can only upload up to ${e} files at a time`,
9
+ remainingCapacityError: (e) => e === 0 ? "Wait for the current uploads to finish before adding more files" : `You can upload ${e} more ${e === 1 ? "file" : "files"} right now`,
10
+ billDeletedError: "This bill was already deleted"
11
+ };
7
12
  //#endregion
8
- export { e as billPayUploadQueueKey };
13
+ export { e as BILL_UPLOAD_QUEUE_LABELS_EN };