@tesouro/embedded-components-react 0.5.46 → 0.5.47

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 (54) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +3 -3
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +7 -49
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +46 -36
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +34 -184
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +163 -75
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +75 -21
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +22 -93
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +88 -317
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +322 -12
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -64
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +57 -50
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +52 -214
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +215 -35
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +35 -234
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +240 -21
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +21 -532
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +536 -4
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -42
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +38 -230
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +234 -3
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -4
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +2 -44
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +46 -1
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -8
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -11
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +11 -127
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +129 -3
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -127
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -47
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +44 -18
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +27 -82
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +83 -47
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +47 -250
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +241 -122
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +125 -211
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +219 -3
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +4 -7
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +5 -98
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +100 -1
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +0 -26
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +27 -0
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +28 -28
  49. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +4 -4
  50. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  51. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/user/useOrganizationUserNames.js +13 -1
  52. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js +137 -0
  53. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  54. package/package.json +1 -1
@@ -1,534 +1,23 @@
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 { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
9
- import { useAllOrganizationUsersQuery as te } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
10
- import "../../../shared/data-access/dist/index.js";
11
- import "../../../shared/ui/dist/index.js";
12
- import { formatCalendarDate as ne } from "../../../shared/util/dist/lib/formatCalendarDate.js";
13
- import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
14
- import "../../../shared/feature/dist/index.js";
15
- import { usePayableApprovalRequestsQuery as ie } from "../../data-access/dist/index8.js";
16
- import { usePayableHistoryQuery as ae } from "../../data-access/dist/index9.js";
17
- import { useAllPayableLineItemsQuery as oe } from "../../data-access/dist/index10.js";
18
- import { useUpdatePayableMutation as se } from "../../data-access/dist/index13.js";
19
- import { usePayableQuery as ce } from "../../data-access/dist/index17.js";
20
- import "../../data-access/dist/index.js";
21
- import { hasUnpaidBalance as le } from "./index7.js";
22
- import { resolveVendor as ue } from "./index8.js";
23
- import { BillCreateScreen as de } from "../../ui/dist/index50.js";
24
- import { BillDecisionDialog as r } from "../../ui/dist/index56.js";
25
- import { DiscardChangesDialog as fe } from "../../ui/dist/index67.js";
26
- import { BillDuplicateNotice as pe } from "../../ui/dist/index72.js";
27
- import { BillRejectedBanner as me } from "../../ui/dist/index75.js";
28
- import { ExtractionNotice as he } from "../../ui/dist/index93.js";
29
- import { MarkAsPaidDialog as ge } from "../../ui/dist/index102.js";
30
- import { UnsavedBillDialog as _e } from "../../ui/dist/index112.js";
31
- import "../../ui/dist/index.js";
32
- import { usePayableDuplicateReview as ve } from "./index13.js";
33
- import "./index14.js";
34
- import { isEditablePayableStatus as ye } from "./index19.js";
35
- import { canOverrideApprovalPolicy as be, canReadCounterpartBankAccounts as xe } from "./index20.js";
36
- import { resolveAmountDueMinorUnits as Se } from "./index21.js";
37
- import { usePayableAchInstructions as Ce } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
38
- import "../../../shared/counterpart-management/feature/dist/index.js";
39
- import { PayBillFlow as we } from "./index27.js";
40
- import "./index28.js";
41
- import { useMarkAsPaidFlow as Te } from "./index17.js";
42
- import "./index18.js";
43
- import { BILL_CREATE_MESSAGE_LABELS_EN as Ee, mergeBillCreateScreenCopy as De } from "./index48.js";
44
- import { useBillCreateController as Oe } from "./index56.js";
45
- import { useBillForm as ke } from "./index58.js";
46
- import { buildPaymentHistory as Ae } from "./index3.js";
47
- import { currentApprovalRound as je } from "./index4.js";
48
- import { usePayableApprovalRoundStart as Me } from "./index32.js";
49
- import { useApprovalPolicyCardView as Ne } from "./index33.js";
50
- import { resolveBillRejectionNotice as Pe } from "./index34.js";
51
- import { useCurrentApprovalRequestId as Fe } from "./index35.js";
52
- import { usePayableDetailActions as Ie } from "./index36.js";
53
- import { useScheduledPayment as Le } from "./index37.js";
54
- import { useDraftDelete as Re } from "./index38.js";
55
- import { buildBillDetailView as ze } from "./index43.js";
56
- import { resolveEditorDismissal as Be } from "./index44.js";
57
- import { buildBillHistory as Ve } from "./index45.js";
58
- import { SourceDocumentContainer as He } from "./index49.js";
59
- import { useVendorSectionProps as Ue } from "./index52.js";
60
- import { billCreateTestIds as i } from "./index59.js";
61
- import { useCallback as a, useEffect as We, useMemo as o, useRef as Ge, useState as s } from "react";
62
- import { Fragment as Ke, jsx as c, jsxs as qe } from "react/jsx-runtime";
63
- import { Trash2Icon as Je } from "lucide-react";
64
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js
65
- function Ye(e) {
66
- let t = [...new Set(e)];
67
- return t.length > 0 ? t : void 0;
68
- }
69
- function l({ open: l, onOpenChange: u, payableId: Xe, readOnly: d = !1, copy: Ze, onCollapse: f, onEdit: Qe, poweredByBankName: $e }) {
70
- let p = o(() => De(Ze), [Ze]), [m, et] = s(), [h, tt] = s(!1), [nt, rt] = s(!1), [it, g] = s(!1), [at, _] = s(), v = a((e) => {
71
- _(() => e);
72
- }, []), [ot, st] = s(), y = Xe ?? ot, b = ce(y, { pollWhileOcrProcessing: !0 }), x = oe(y), { initResponse: S } = re(), ct = !!S, C = t(S?.scopes, [n.AccountingConfigReadOrg]), w = ee({ enabled: C }), T = b.data, lt = !y || !!T, E = !d && lt && !!y && T?.status !== "draft", ut = !d && !!T && !ye(T?.status), D = d || ut, O = ke({
73
- payable: T,
74
- lineItems: x.lineItems
75
- }), k = T?.counterpart_id;
76
- We(() => {
77
- h || k && (et(k), tt(!0));
78
- }, [h, k]);
79
- let dt = a((e) => {
80
- tt(!0), et(e);
81
- }, []), A = Le({
82
- payableId: y,
83
- scheduledPaymentDate: T?.scheduled_payment_date,
84
- enabled: d || E
85
- }), j = xe(S?.scopes), ft = t(S?.scopes, [n.PayableWriteOrg]), M = t(S?.scopes, [n.CounterpartWriteOrg]) && ft, N = M && le(T?.status) && !A.hasScheduledPayment && !A.isResolving, pt = N && j, mt = N || M && T?.status === "rejected", P = Ue({
86
- payableId: y,
87
- counterpartId: d ? k : m,
88
- payableCounterpartId: k,
89
- isVendorKnown: d ? !!T : lt,
90
- onCounterpartChange: dt,
91
- requiredError: O.errors?.vendor,
92
- payableCounterpartBankAccountId: T?.counterpart_bank_account_id ?? void 0,
93
- extractedVendor: T?.counterpart_raw_data ?? void 0,
94
- readOnly: d,
95
- canEditVendor: !d || pt,
96
- canEditPaymentInstructions: !d || N,
97
- canAddPaymentInstructions: !d || mt,
98
- confirmDiscard: v
99
- }), F = d && (P.activePayToOperation === "missingInstructions" ? mt : P.activePayToOperation === "vendor" ? pt : P.activePayToOperation === "existingInstructions" && N), ht = !!(y && h) && !m, I = b.refetch, gt = a(async () => {
100
- let { data: e } = await I();
101
- return e?.status ?? void 0;
102
- }, [I]), _t = se(), [vt, yt] = s(!1), bt = a(async () => {
103
- if (!F) {
104
- P.discardPayToEdits();
105
- return;
106
- }
107
- yt(!0);
108
- try {
109
- let t;
110
- try {
111
- t = await P.prepareVendorForSave();
112
- } catch {
113
- e.error(p.detail.paymentInstructionsSaveError);
114
- return;
115
- }
116
- if (!t.ok) return;
117
- let n = t.counterpartBankAccountId;
118
- if (y && n && n !== T?.counterpart_bank_account_id) try {
119
- await _t.mutateAsync({
120
- path: { payable_id: y },
121
- body: { counterpart_bank_account_id: n }
122
- });
123
- return;
124
- } catch {
125
- e.error(p.detail.paymentInstructionsLinkError);
126
- }
127
- await I();
128
- } finally {
129
- yt(!1);
130
- }
131
- }, [
132
- F,
133
- p.detail.paymentInstructionsLinkError,
134
- p.detail.paymentInstructionsSaveError,
135
- _t,
136
- T?.counterpart_bank_account_id,
137
- y,
138
- I,
139
- P
140
- ]);
141
- We(() => {
142
- d && P.isEditingPayTo && !F && P.discardPayToEdits();
143
- }, [
144
- F,
145
- d,
146
- P.discardPayToEdits,
147
- P.isEditingPayTo
148
- ]);
149
- let xt = o(() => E ? { draftSaved: Ee.submittedSaved } : void 0, [E]), L = Oe({
150
- payableId: Xe,
151
- form: O,
152
- labels: xt,
153
- counterpartId: m,
154
- isVendorPending: P.mode === "creating",
155
- clearCounterpart: ht,
156
- prepareVendorForSave: P.prepareVendorForSave,
157
- onPayableCreated: st,
158
- onSaved: st,
159
- onDraftSaved: () => u(!1),
160
- onFinalized: () => u(!1),
161
- readSavedStatus: E ? gt : void 0
162
- }), St = !!(L.isSavingDraft || L.isFinalizing), R = d ? y : void 0, z = Fe({
163
- payableId: R,
164
- status: T?.status
165
- }), Ct = Ge(null), wt = ue(T), B = Ce({
166
- counterpartId: d ? k : void 0,
167
- currency: T?.currency,
168
- currentBankAccountId: d ? T?.counterpart_bank_account_id ?? void 0 : void 0,
169
- enabled: j && d
170
- }), V = Te({
171
- payableId: R,
172
- amountDueMinorUnits: Se(T) ?? 0,
173
- amountToPayMinorUnits: T?.amount_to_pay ?? void 0,
174
- currencyCode: T?.currency ?? void 0,
175
- dueDate: T?.due_date,
176
- hasScheduledPayment: A.hasScheduledPayment,
177
- labels: p.markAsPaid
178
- }), H = Ne({
179
- payableId: R,
180
- approvalPolicyId: T?.approval_policy_id,
181
- enabled: d,
182
- copy: p.approvalPolicyCopy
183
- }), Tt = be({
184
- status: T?.status,
185
- scopes: S?.scopes,
186
- arePendingApproversUnknown: H.isLoading,
187
- hasApprovalPolicy: !!T?.approval_policy_id,
188
- hasWaitingRequest: z.hasWaitingRequest
189
- }), Et = !!z.id, Dt = z.isLoading || H.isLoading, Ot = o(() => Ye(H.pendingApprovers.flatMap((e) => e.names)), [H.pendingApprovers]), kt = d || E ? y : void 0, At = d ? Qe : void 0, { actions: U, decisionDialog: jt, isActionPending: Mt } = Ie({
190
- payableId: kt,
191
- status: T?.status,
192
- currentApprovalRequestId: z.id,
193
- arePendingApproversUnknown: H.isLoading,
194
- hasScheduledPayment: A.hasScheduledPayment,
195
- scheduledPaymentIntentId: A.scheduledPaymentIntentId,
196
- isScheduledPaymentUnknown: A.isResolving,
197
- isPayabilityUnknown: B.isLoading,
198
- hasApprovalPolicy: !!T?.approval_policy_id,
199
- hasWaitingRequest: z.hasWaitingRequest,
200
- pendingApprovers: H.pendingApprovers,
201
- labels: p.actions,
202
- isMarkAsPaidPending: V.isPending,
203
- onMarkAsPaidSelect: V.open,
204
- onPayBillSelect: () => Ct.current?.open(),
205
- onEditSelect: At,
206
- onActionSucceeded: (e) => {
207
- if (e === "reopen") {
208
- At?.();
209
- return;
210
- }
211
- E && u(!1);
212
- }
213
- }), W = Re({
214
- payableId: y,
215
- status: T?.status,
216
- enabled: !d,
217
- labels: p.deleteDraft,
218
- onDeleted: () => u(!1)
219
- }), G = St || Mt, Nt = T?.ocr_status === "processing", Pt = b.isLoading || x.isResolving || Nt, Ft = b.isLoading || x.isResolving || w.isResolving || B.isLoading, It = b.isError || x.isError || w.isError, Lt = o(() => [...W.menuItems, ...E || d && !Ft && !It ? U.menu.map((e) => ({
220
- id: e.id,
221
- label: e.label,
222
- onSelect: e.onSelect,
223
- disabled: e.disabled,
224
- icon: e.icon,
225
- sectionHeading: e.sectionHeading
226
- })) : []], [
227
- U.menu,
228
- W.menuItems,
229
- E,
230
- d,
231
- Ft,
232
- It
233
- ]), K = o(() => (w.data?.data ?? []).map((e) => ({
234
- value: e.id,
235
- label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
236
- })), [w.data]), q;
237
- ct && (C ? w.isError ? q = p.lineItemsGlCodeUnavailable.loadError : !w.isResolving && K.length === 0 && (q = p.lineItemsGlCodeUnavailable.empty) : q = p.lineItemsGlCodeUnavailable.noAccess);
238
- let Rt = !ct || !!q || w.isResolving, zt = C && !w.isResolving && !w.isError, J = ae(R), Bt = T?.status === "rejected" || !d && E, Vt = t(S?.scopes, [n.ApprovalRequestReadOrg]), Ht = Bt && Vt, Ut = t(S?.scopes, [n.UserReadOrg]), Y = te({ enabled: (d || Bt) && Ut }), Wt = o(() => Ve(J.data?.data ?? [], Y.data?.data ?? [], p.history), [
239
- J.data,
240
- Y.data,
241
- p.history
242
- ]), Gt = Me({
243
- payableId: y,
244
- enabled: Ht
245
- }), Kt = ie(y, { enabled: Ht }), qt = o(() => je(Kt.data?.data, Gt.roundStartedAt), [Kt.data, Gt.roundStartedAt]), X = o(() => Pe({
246
- payableStatus: T?.status,
247
- approvalRequests: qt,
248
- users: Y.data?.data ?? [],
249
- payableUpdatedAt: T?.updated_at,
250
- labels: p.detail
251
- }), [
252
- T?.status,
253
- T?.updated_at,
254
- qt,
255
- Y.data,
256
- p.detail
257
- ]), Jt = o(() => Ae({
258
- records: A.paymentRecords,
259
- events: J.data?.data ?? [],
260
- currencyCode: T?.currency,
261
- labels: p.detail
262
- }), [
263
- A.paymentRecords,
264
- J.data,
265
- T?.currency,
266
- p.detail
267
- ]), Yt = o(() => {
268
- if (!d || !T) return;
269
- let e = ze({
270
- payable: T,
271
- lineItems: x.lineItems,
272
- glCodeOptions: K,
273
- glCodeRosterAvailable: zt,
274
- history: Wt,
275
- paymentHistory: Jt,
276
- approvalPolicy: H.view,
277
- labels: p.detail,
278
- hasScheduledPayment: A.hasScheduledPayment,
279
- rejection: X,
280
- payableAchInstructions: B.achInstructions,
281
- payableAchInstructionsReadable: j && !B.isError
282
- });
283
- return P.mode === "resolved" && P.summary ? {
284
- ...e,
285
- payTo: P.summary
286
- } : e;
287
- }, [
288
- A.hasScheduledPayment,
289
- H.view,
290
- j,
291
- p.detail,
292
- K,
293
- zt,
294
- Wt,
295
- x.lineItems,
296
- T,
297
- B.achInstructions,
298
- B.isError,
299
- Jt,
300
- d,
301
- X,
302
- P.mode,
303
- P.summary
304
- ]), Xt = T?.source_of_payable_data === "ocr", Z = wt?.name, Zt = d ? Z ? p.viewTitle(Z) : p.readOnlyTitle : Z && (Xt || E) ? p.extractedTitle(Z) : p.newTitle, Qt = d && T?.created_at ? p.addedOn(ne(T.created_at.slice(0, 10))) : void 0, Q = a((e) => {
305
- let t = () => {
306
- P.discardPayToEdits(), e?.();
307
- };
308
- P.hasUnsavedVendorChanges ? v(t) : t();
309
- }, [v, P]), $t = a(() => {
310
- if (d && P.isEditingPayTo) {
311
- Q(() => u(!1));
312
- return;
313
- }
314
- let e = O.isDirty || P.hasUnsavedVendorChanges || !!L.stagedFile || L.isFileDeletionPending;
315
- switch (Be({
316
- isUnsavedPromptOpen: it,
317
- isLocked: D,
318
- isDirty: e
319
- })) {
320
- case "dismiss-prompt":
321
- g(!1);
322
- return;
323
- case "prompt":
324
- g(!0);
325
- return;
326
- default: u(!1);
327
- }
328
- }, [
329
- L.isFileDeletionPending,
330
- L.stagedFile,
331
- O.isDirty,
332
- D,
333
- it,
334
- Q,
335
- u,
336
- d,
337
- P.hasUnsavedVendorChanges,
338
- P.isEditingPayTo
339
- ]), en = a(() => {
340
- if (P.isEditingPayTo) {
341
- Q(f);
342
- return;
343
- }
344
- f?.();
345
- }, [
346
- Q,
347
- f,
348
- P.isEditingPayTo
349
- ]), tn = a(() => {
350
- g(!1), u(!1);
351
- }, [u]), nn = Pt || P.mode === "creating", rn = a(async () => {
352
- if (nn) return;
353
- let e = await L.saveDraft();
354
- g(!1), e && u(!1);
355
- }, [
356
- L,
357
- nn,
358
- u
359
- ]), $ = ve({
360
- payable: T,
361
- onRemoved: () => u(!1),
362
- canManage: ft
363
- }), an = a((e) => {
364
- if (!(G || $.isBusy)) return e ? u(!0) : $t();
365
- }, [
366
- $.isBusy,
367
- G,
368
- $t,
369
- u
370
- ]), on = $.isPossibleDuplicate, sn = !d && Xt && !nt, cn = !d && !!X, ln = cn || on || sn ? /* @__PURE__ */ qe(Ke, { children: [
371
- cn && X ? /* @__PURE__ */ c(me, {
372
- ...X,
373
- labels: p.rejectedBanner
374
- }) : null,
375
- on ? /* @__PURE__ */ c(pe, {
376
- onNotADuplicate: $.onNotADuplicate,
377
- onRemoveBill: $.onRemoveBill,
378
- isActionDisabled: $.isBusy,
379
- labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
380
- testId: i.duplicateNotice
381
- }) : null,
382
- sn ? /* @__PURE__ */ c(he, { onDismiss: () => rt(!0) }) : null
383
- ] }) : void 0;
384
- return /* @__PURE__ */ qe(Ke, { children: [
385
- /* @__PURE__ */ c(de, {
386
- open: l,
387
- onOpenChange: an,
388
- title: Zt,
389
- subtitle: Qt,
390
- notice: ln,
391
- vendor: {
392
- ...P,
393
- testId: i.vendorSection
394
- },
395
- values: O.values,
396
- errors: O.errors,
397
- onChange: O.onChange,
398
- lineItems: {
399
- items: O.lineItemRows,
400
- glCodeOptions: K,
401
- glCodeDisabled: Rt,
402
- glCodeUnavailableMessage: q,
403
- discount: O.discount,
404
- onDiscountChange: O.onDiscountChange,
405
- tax: O.tax,
406
- onTaxChange: O.onTaxChange,
407
- total: O.total,
408
- onTotalChange: O.onTotalChange,
409
- onAddLineItem: O.onAddLineItem,
410
- errors: O.lineItemErrors,
411
- totalsErrors: O.totalsErrors,
412
- testId: i.lineItems
413
- },
414
- documentPanel: /* @__PURE__ */ c(He, {
415
- payableId: y,
416
- readOnly: D,
417
- isDocumentPending: !!y && !T?.file && (b.isLoading || T?.ocr_status === "processing"),
418
- file: T?.file ? {
419
- id: T.file.id,
420
- name: T.file.name,
421
- url: T.file.url,
422
- mimetype: T.file.mimetype
423
- } : void 0,
424
- staging: {
425
- stagedFile: L.stagedFile,
426
- onFileStaged: L.stageFile,
427
- onClearStagedFile: L.clearStagedFile,
428
- isSaving: St
429
- },
430
- deletion: {
431
- isPending: L.isFileDeletionPending,
432
- onRequest: L.requestFileDeletion,
433
- onDetachNow: L.detachFileNow,
434
- isDeleting: L.isDeletingFile,
435
- hasFailed: L.hasFileDeletionFailed
436
- }
437
- }),
438
- menuItems: Lt,
439
- readOnly: D,
440
- detail: d ? {
441
- view: Yt,
442
- actions: U,
443
- scheduledSummary: A.hasScheduledPayment && A.scheduledDateLabel ? p.scheduledSummary(A.scheduledDateLabel) : void 0,
444
- scheduledStatusLabel: A.hasScheduledPayment && A.scheduledDateLabel ? p.scheduledStatusBadge(A.scheduledDateLabel) : void 0,
445
- showApprovalOverrideNotice: !Dt && !Et && Tt && !!T?.approval_policy_id,
446
- awaitingApprovalNotice: !Dt && !Et && !Tt && T?.status === "approve_in_progress" && T?.approval_policy_id ? Ot ? p.awaitingApprovalNotice(Ot) : p.awaitingApprovalUnknownNotice : void 0,
447
- payTo: {
448
- onEdit: P.mode === "resolved" ? P.onEdit : void 0,
449
- paymentInstructions: P.mode === "resolved" ? P.paymentInstructions : void 0,
450
- editForm: P.mode === "creating" ? P.newVendorForm : void 0
451
- },
452
- hideMissingPaymentInstructions: T?.status === "paid" || T?.status === "canceled",
453
- isLoading: Ft,
454
- isError: It,
455
- paymentHistoryError: A.isError || J.isError,
456
- paymentHistoryLoading: A.isResolving || J.isLoading
457
- } : void 0,
458
- detailEdit: d && P.isEditingPayTo && F ? {
459
- onSave: bt,
460
- onCancel: () => Q(),
461
- isSaving: vt
462
- } : void 0,
463
- isLineItemsLoading: Pt,
464
- isSaving: G || vt,
465
- isSavingDraft: L.isSavingDraft,
466
- isSubmitting: L.isFinalizing,
467
- onCancel: $t,
468
- onCollapse: d ? en : void 0,
469
- onSaveDraft: L.saveDraft,
470
- onFinalize: L.finalize,
471
- scrollToErrorToken: L.scrollToErrorToken,
472
- showSubmit: !D && lt,
473
- testId: i.dialog
474
- }),
475
- /* @__PURE__ */ c(_e, {
476
- open: it,
477
- onSaveDraft: rn,
478
- onDiscard: tn,
479
- onCancel: () => g(!1),
480
- isSaving: L.isSavingDraft,
481
- isSaveDraftDisabled: nn,
482
- labels: p.unsavedChanges,
483
- testId: i.unsavedDialog,
484
- saveDraftTestId: i.unsavedSaveDraft,
485
- discardTestId: i.unsavedDiscard,
486
- closeTestId: i.unsavedClose
487
- }),
488
- /* @__PURE__ */ c(fe, {
489
- open: !!at,
490
- onDiscard: () => {
491
- let e = at;
492
- _(void 0), e?.();
493
- },
494
- onKeepEditing: () => _(void 0),
495
- labels: p.discardChanges,
496
- testId: i.discardDialog,
497
- discardTestId: i.discardConfirm
498
- }),
499
- /* @__PURE__ */ c(r, {
500
- ...jt,
501
- labels: { cancelButton: p.actions.decisionDialog.cancelButton },
502
- testId: i.decisionDialog,
503
- confirmTestId: i.decisionConfirm,
504
- reasonTestId: i.decisionReason
505
- }),
506
- /* @__PURE__ */ c(r, {
507
- ...W.dialog,
508
- labels: { cancelButton: p.actions.decisionDialog.cancelButton },
509
- testId: i.deleteDraftDialog,
510
- confirmTestId: i.deleteDraftConfirm
511
- }),
512
- /* @__PURE__ */ c(r, {
513
- open: $.removeConfirmation.open,
514
- copy: $.removeConfirmation.copy,
515
- onConfirm: $.removeConfirmation.onConfirm,
516
- onCancel: $.removeConfirmation.onCancel,
517
- isPending: $.removeConfirmation.isPending,
518
- confirmIcon: /* @__PURE__ */ c(Je, {}),
519
- labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
520
- testId: i.duplicateRemoveDialog,
521
- confirmTestId: i.duplicateRemoveConfirm
522
- }),
523
- /* @__PURE__ */ c(ge, { ...V.dialogProps }),
524
- d && T ? /* @__PURE__ */ c(we, {
525
- ref: Ct,
526
- payable: T,
527
- onMissingAchInstructions: M ? P.openPaymentInstructions : void 0,
528
- poweredByBankName: $e,
529
- labels: p.payBill
530
- }) : null
531
- ] });
532
- }
2
+ var e = {
3
+ dialog: "bill-pay-bill-create-dialog",
4
+ vendorSection: "bill-pay-bill-create-vendor",
5
+ lineItems: "bill-pay-bill-create-line-items",
6
+ documentPanel: "bill-pay-bill-create-document",
7
+ duplicateNotice: "bill-pay-bill-create-duplicate-notice",
8
+ duplicateRemoveDialog: "bill-pay-bill-create-duplicate-remove-dialog",
9
+ duplicateRemoveConfirm: "bill-pay-bill-create-duplicate-remove-confirm",
10
+ decisionDialog: "bill-pay-bill-decision-dialog",
11
+ decisionConfirm: "bill-pay-bill-decision-confirm",
12
+ decisionReason: "bill-pay-bill-decision-reason",
13
+ deleteDraftDialog: "bill-pay-bill-delete-draft-dialog",
14
+ deleteDraftConfirm: "bill-pay-bill-delete-draft-confirm",
15
+ unsavedDialog: "bill-pay-bill-unsaved-dialog",
16
+ unsavedSaveDraft: "bill-pay-bill-unsaved-save-draft",
17
+ unsavedDiscard: "bill-pay-bill-unsaved-discard",
18
+ unsavedClose: "bill-pay-bill-unsaved-close",
19
+ discardDialog: "bill-pay-bill-discard-dialog",
20
+ discardConfirm: "bill-pay-bill-discard-confirm"
21
+ };
533
22
  //#endregion
534
- export { l as BillCreateDialog, l as default };
23
+ export { e as billCreateTestIds };