@tesouro/embedded-components-react 0.11.176 → 0.11.180

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