@tesouro/embedded-components-react 0.4.0 → 0.4.2

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 (62) 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/index28.js +8 -14
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +7 -57
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +56 -16
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +18 -126
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +126 -14
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +22 -4
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +4 -41
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +40 -4
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +5 -73
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +72 -48
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +47 -91
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +91 -33
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +33 -167
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +167 -75
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +75 -21
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +23 -210
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +199 -203
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +198 -89
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +105 -13
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +12 -47
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +47 -31
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +27 -198
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +198 -30
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +30 -234
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +240 -18
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +18 -341
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +343 -4
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +4 -33
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +31 -83
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +78 -163
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +170 -3
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +3 -4
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +2 -44
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +46 -1
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +1 -8
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +6 -9
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +9 -92
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +94 -3
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +3 -128
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +125 -8
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -7
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +8 -46
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +43 -18
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +20 -28
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +27 -82
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +83 -47
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +47 -250
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +239 -101
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +107 -202
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +209 -3
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +4 -8
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +6 -113
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +115 -1
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +0 -24
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +25 -0
  59. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index523.js +6 -3
  60. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  61. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  62. package/package.json +1 -1
@@ -1,4 +1,343 @@
1
- import "./index40.js";
2
- import "./index49.js";
3
- import "./index51.js";
4
- import "./index53.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 { useAllOrganizationUsersQuery as te } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
9
+ import "../../../shared/data-access/dist/index.js";
10
+ import { formatCalendarDate as ne } from "../../../shared/util/dist/lib/formatCalendarDate.js";
11
+ import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
12
+ import "../../../shared/feature/dist/index.js";
13
+ import { usePayableHistoryQuery as ie } from "../../data-access/dist/index8.js";
14
+ import { useAllPayableLineItemsQuery as ae } from "../../data-access/dist/index9.js";
15
+ import { usePayableQuery as oe } from "../../data-access/dist/index15.js";
16
+ import "../../data-access/dist/index.js";
17
+ import { resolveVendor as se } from "./index5.js";
18
+ import { BillCreateScreen as ce } from "../../ui/dist/index45.js";
19
+ import { BillDecisionDialog as n } from "../../ui/dist/index51.js";
20
+ import { BillDuplicateNotice as le } from "../../ui/dist/index61.js";
21
+ import { ExtractionNotice as ue } from "../../ui/dist/index79.js";
22
+ import { MarkAsPaidDialog as de } from "../../ui/dist/index88.js";
23
+ import { UnsavedBillDialog as fe } from "../../ui/dist/index98.js";
24
+ import "../../ui/dist/index.js";
25
+ import { usePayableDuplicateReview as pe } from "./index10.js";
26
+ import "./index11.js";
27
+ import { resolveAmountDueMinorUnits as me } from "./index17.js";
28
+ import { PayBillFlow as he } from "./index23.js";
29
+ import "./index24.js";
30
+ import { useMarkAsPaidFlow as ge } from "./index14.js";
31
+ import "./index15.js";
32
+ import { BILL_CREATE_MESSAGE_LABELS_EN as _e, mergeBillCreateScreenCopy as ve } from "./index41.js";
33
+ import { useBillCreateController as ye } from "./index50.js";
34
+ import { useBillForm as be } from "./index52.js";
35
+ import { useApprovalPolicyCardView as xe } from "./index30.js";
36
+ import { useCurrentApprovalRequestId as Se } from "./index31.js";
37
+ import { usePayableDetailActions as Ce } from "./index32.js";
38
+ import { useScheduledPayment as we } from "./index33.js";
39
+ import { isEditablePayableStatus as Te } from "./index34.js";
40
+ import { useDraftDelete as Ee } from "./index35.js";
41
+ import { buildBillDetailView as De } from "./index37.js";
42
+ import { buildBillHistory as Oe } from "./index38.js";
43
+ import { SourceDocumentContainer as ke } from "./index42.js";
44
+ import { useVendorSectionProps as Ae } from "./index45.js";
45
+ import { usePaymentInstructionsForm as je } from "./index46.js";
46
+ import { billCreateTestIds as r } from "./index53.js";
47
+ import { useCallback as i, useEffect as Me, useMemo as a, useRef as Ne, useState as o } from "react";
48
+ import { Fragment as Pe, jsx as s, jsxs as Fe } from "react/jsx-runtime";
49
+ import { Trash2Icon as Ie } from "lucide-react";
50
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js
51
+ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f, onCollapse: Le, poweredByBankName: Re }) {
52
+ let p = a(() => ve(f), [f]), [m, h] = o(), [g, _] = o(!1), [ze, Be] = o(!1), [Ve, v] = o(!1), [He, y] = o(), b = u ?? He, x = oe(b, { pollWhileOcrProcessing: !0 }), S = ae(b), { initResponse: C } = re(), w = !!C, T = e(C?.scopes, [t.AccountingConfigReadOrg]), E = ee({ enabled: T }), D = x.data, O = !b || !!D, k = !d && O && !!b && D?.status !== "draft", Ue = !d && !!D && !Te(D?.status), A = d || Ue, j = be({
53
+ payable: D,
54
+ lineItems: S.lineItems
55
+ }), M = D?.counterpart_id;
56
+ Me(() => {
57
+ g || M && (h(M), _(!0));
58
+ }, [g, M]);
59
+ let We = i((e) => {
60
+ _(!0), h(e);
61
+ }, []), N = Ae({
62
+ payableId: d ? void 0 : b,
63
+ counterpartId: d ? void 0 : m,
64
+ payableCounterpartId: M,
65
+ onCounterpartChange: We,
66
+ requiredError: j.errors?.vendor,
67
+ payableCounterpartBankAccountId: D?.counterpart_bank_account_id ?? void 0,
68
+ extractedVendor: D?.counterpart_raw_data ?? void 0
69
+ }), Ge = !!(b && g) && !m, Ke = a(() => k ? { saveDraftButton: p.submittedSaveButton } : void 0, [p.submittedSaveButton, k]), qe = a(() => k ? { draftSaved: _e.submittedSaved } : void 0, [k]), P = x.refetch, Je = i(async () => {
70
+ let { data: e } = await P();
71
+ return e?.status ?? void 0;
72
+ }, [P]), F = ye({
73
+ payableId: u,
74
+ form: j,
75
+ labels: qe,
76
+ counterpartId: m,
77
+ clearCounterpart: Ge,
78
+ prepareVendorForSave: N.savePaymentInstructions,
79
+ onPayableCreated: y,
80
+ onSaved: y,
81
+ onDraftSaved: () => l(!1),
82
+ onFinalized: () => l(!1),
83
+ readSavedStatus: k ? Je : void 0
84
+ }), I = !!(F.isSavingDraft || F.isFinalizing), L = d ? b : void 0, R = Se({
85
+ payableId: L,
86
+ status: D?.status
87
+ }), Ye = Ne(null), z = we({
88
+ payableId: b,
89
+ scheduledPaymentDate: D?.scheduled_payment_date,
90
+ enabled: d || k
91
+ }), Xe = se(D), B = je({
92
+ payableId: L,
93
+ counterpartId: d ? M : void 0,
94
+ saveErrorMessage: p.detail.paymentInstructionsSaveError,
95
+ linkErrorMessage: p.detail.paymentInstructionsLinkError
96
+ }), Ze = e(C?.scopes, [t.PayableWriteOrg]), Qe = e(C?.scopes, [t.CounterpartWriteOrg]) && Ze, V = ge({
97
+ payableId: L,
98
+ amountDueMinorUnits: me(D) ?? 0,
99
+ amountToPayMinorUnits: D?.amount_to_pay ?? void 0,
100
+ currencyCode: D?.currency ?? void 0,
101
+ dueDate: D?.due_date,
102
+ hasScheduledPayment: z.hasScheduledPayment,
103
+ labels: p.markAsPaid
104
+ }), H = xe({
105
+ payableId: L,
106
+ approvalPolicyId: D?.approval_policy_id,
107
+ enabled: d,
108
+ copy: p.approvalPolicyCopy
109
+ }), { actions: U, decisionDialog: $e, isActionPending: et } = Ce({
110
+ payableId: d || k ? b : void 0,
111
+ status: D?.status,
112
+ currentApprovalRequestId: R.id,
113
+ isPolicyApprover: R.isPolicyApprover,
114
+ hasWaitingRequest: R.hasWaitingRequest,
115
+ arePendingApproversUnknown: H.isLoading,
116
+ hasScheduledPayment: z.hasScheduledPayment,
117
+ scheduledPaymentIntentId: z.scheduledPaymentIntentId,
118
+ isScheduledPaymentUnknown: z.isResolving,
119
+ pendingApprovers: H.pendingApprovers,
120
+ labels: p.actions,
121
+ isMarkAsPaidPending: V.isPending,
122
+ onMarkAsPaidSelect: V.open,
123
+ onPayBillSelect: () => Ye.current?.open(),
124
+ onActionSucceeded: k ? () => l(!1) : void 0
125
+ }), W = Ee({
126
+ payableId: b,
127
+ status: D?.status,
128
+ enabled: !d,
129
+ labels: p.deleteDraft,
130
+ onDeleted: () => l(!1)
131
+ }), G = I || et, tt = a(() => [...W.menuItems, ...k ? U.menu.map((e) => ({
132
+ id: e.id,
133
+ label: e.label,
134
+ onSelect: e.onSelect,
135
+ disabled: e.disabled
136
+ })) : []], [
137
+ U.menu,
138
+ W.menuItems,
139
+ k
140
+ ]), K = a(() => (E.data?.data ?? []).map((e) => ({
141
+ value: e.id,
142
+ label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
143
+ })), [E.data]), q;
144
+ w && (T ? E.isError ? q = p.lineItemsGlCodeUnavailable.loadError : !E.isResolving && K.length === 0 && (q = p.lineItemsGlCodeUnavailable.empty) : q = p.lineItemsGlCodeUnavailable.noAccess);
145
+ let nt = !w || !!q || E.isResolving, rt = T && !E.isResolving && !E.isError, it = ie(L), at = e(C?.scopes, [t.UserReadOrg]), ot = te({ enabled: d && at }), J = a(() => Oe(it.data?.data ?? [], ot.data?.data ?? [], p.history), [
146
+ it.data,
147
+ ot.data,
148
+ p.history
149
+ ]), st = a(() => d && D ? De({
150
+ payable: D,
151
+ lineItems: S.lineItems,
152
+ glCodeOptions: K,
153
+ glCodeRosterAvailable: rt,
154
+ history: J,
155
+ approvalPolicy: H.view,
156
+ labels: p.detail,
157
+ hasScheduledPayment: z.hasScheduledPayment
158
+ }) : void 0, [
159
+ z.hasScheduledPayment,
160
+ H.view,
161
+ p.detail,
162
+ K,
163
+ rt,
164
+ J,
165
+ S.lineItems,
166
+ D,
167
+ d
168
+ ]), ct = D?.source_of_payable_data === "ocr", Y = Xe?.name, lt = d ? Y ? p.viewTitle(Y) : p.readOnlyTitle : Y && (ct || k) ? p.extractedTitle(Y) : p.newTitle, ut = d && D?.created_at ? p.addedOn(ne(D.created_at.slice(0, 10))) : void 0, X = i(() => {
169
+ let e = j.isDirty || N.hasUnsavedVendorChanges || !!F.stagedFile || F.isFileDeletionPending;
170
+ if (!A && e) {
171
+ v(!0);
172
+ return;
173
+ }
174
+ l(!1);
175
+ }, [
176
+ F.isFileDeletionPending,
177
+ F.stagedFile,
178
+ j.isDirty,
179
+ A,
180
+ l,
181
+ N.hasUnsavedVendorChanges
182
+ ]), dt = i(() => {
183
+ v(!1), l(!1);
184
+ }, [l]), Z = S.isResolving || N.mode === "creating", ft = i(async () => {
185
+ if (Z) return;
186
+ let e = await F.saveDraft();
187
+ v(!1), e && l(!1);
188
+ }, [
189
+ F,
190
+ Z,
191
+ l
192
+ ]), Q = pe({
193
+ payable: D,
194
+ onRemoved: () => l(!1),
195
+ canManage: Ze
196
+ }), pt = i((e) => {
197
+ if (!(G || Q.isBusy)) return e ? l(!0) : X();
198
+ }, [
199
+ Q.isBusy,
200
+ G,
201
+ X,
202
+ l
203
+ ]), mt = Q.isPossibleDuplicate, $ = !d && ct && !ze, ht = mt || $ ? /* @__PURE__ */ Fe(Pe, { children: [mt ? /* @__PURE__ */ s(le, {
204
+ onNotADuplicate: Q.onNotADuplicate,
205
+ onRemoveBill: Q.onRemoveBill,
206
+ isActionDisabled: Q.isBusy,
207
+ labels: Q.removeBillLabel ? { removeBillButton: Q.removeBillLabel } : void 0,
208
+ testId: r.duplicateNotice
209
+ }) : null, $ ? /* @__PURE__ */ s(ue, { onDismiss: () => Be(!0) }) : null] }) : void 0;
210
+ return /* @__PURE__ */ Fe(Pe, { children: [
211
+ /* @__PURE__ */ s(ce, {
212
+ open: c,
213
+ onOpenChange: pt,
214
+ title: lt,
215
+ subtitle: ut,
216
+ notice: ht,
217
+ vendor: {
218
+ ...N,
219
+ testId: r.vendorSection
220
+ },
221
+ values: j.values,
222
+ errors: j.errors,
223
+ onChange: j.onChange,
224
+ lineItems: {
225
+ items: j.lineItemRows,
226
+ glCodeOptions: K,
227
+ glCodeDisabled: nt,
228
+ glCodeUnavailableMessage: q,
229
+ discount: j.discount,
230
+ onDiscountChange: j.onDiscountChange,
231
+ tax: j.tax,
232
+ onTaxChange: j.onTaxChange,
233
+ total: j.total,
234
+ onTotalChange: j.onTotalChange,
235
+ onAddLineItem: j.onAddLineItem,
236
+ errors: j.lineItemErrors,
237
+ totalsErrors: j.totalsErrors,
238
+ testId: r.lineItems
239
+ },
240
+ documentPanel: /* @__PURE__ */ s(ke, {
241
+ payableId: b,
242
+ readOnly: A,
243
+ isDocumentPending: !!b && !D?.file && (x.isLoading || D?.ocr_status === "processing"),
244
+ file: D?.file ? {
245
+ id: D.file.id,
246
+ name: D.file.name,
247
+ url: D.file.url,
248
+ mimetype: D.file.mimetype
249
+ } : void 0,
250
+ staging: {
251
+ stagedFile: F.stagedFile,
252
+ onFileStaged: F.stageFile,
253
+ onClearStagedFile: F.clearStagedFile,
254
+ isSaving: I
255
+ },
256
+ deletion: {
257
+ isPending: F.isFileDeletionPending,
258
+ onRequest: F.requestFileDeletion,
259
+ onDetachNow: F.detachFileNow,
260
+ isDeleting: F.isDeletingFile,
261
+ hasFailed: F.hasFileDeletionFailed
262
+ }
263
+ }),
264
+ menuItems: tt,
265
+ readOnly: A,
266
+ detail: d ? {
267
+ view: st,
268
+ actions: U,
269
+ scheduledSummary: z.hasScheduledPayment && z.scheduledDateLabel ? p.scheduledSummary(z.scheduledDateLabel) : void 0,
270
+ paymentInstructionsForm: M && Qe ? {
271
+ isOpen: B.isOpen,
272
+ values: B.values,
273
+ errors: B.errors,
274
+ isSaving: B.isSaving,
275
+ onOpen: B.open,
276
+ onCancel: B.close,
277
+ onChange: B.onChange,
278
+ onSave: B.save
279
+ } : void 0,
280
+ isLoading: x.isLoading || S.isResolving || E.isResolving,
281
+ isError: x.isError || S.isError || E.isError
282
+ } : void 0,
283
+ isLineItemsLoading: S.isResolving,
284
+ isSaving: G,
285
+ isSavingDraft: F.isSavingDraft,
286
+ isFinalizing: F.isFinalizing,
287
+ onCancel: X,
288
+ onCollapse: d ? Le : void 0,
289
+ onSaveDraft: F.saveDraft,
290
+ onFinalize: F.finalize,
291
+ scrollToErrorToken: F.scrollToErrorToken,
292
+ showFinalize: !k && O,
293
+ labels: Ke,
294
+ testId: r.dialog
295
+ }),
296
+ /* @__PURE__ */ s(fe, {
297
+ open: Ve,
298
+ onSaveDraft: ft,
299
+ onDiscard: dt,
300
+ onCancel: () => v(!1),
301
+ isSaving: F.isSavingDraft,
302
+ isSaveDraftDisabled: Z,
303
+ labels: p.unsavedChanges,
304
+ testId: r.unsavedDialog,
305
+ saveDraftTestId: r.unsavedSaveDraft,
306
+ discardTestId: r.unsavedDiscard
307
+ }),
308
+ /* @__PURE__ */ s(n, {
309
+ ...$e,
310
+ labels: { cancelButton: p.actions.decisionDialog.cancelButton },
311
+ testId: r.decisionDialog,
312
+ confirmTestId: r.decisionConfirm,
313
+ reasonTestId: r.decisionReason
314
+ }),
315
+ /* @__PURE__ */ s(n, {
316
+ ...W.dialog,
317
+ labels: { cancelButton: p.actions.decisionDialog.cancelButton },
318
+ testId: r.deleteDraftDialog,
319
+ confirmTestId: r.deleteDraftConfirm
320
+ }),
321
+ /* @__PURE__ */ s(n, {
322
+ open: Q.removeConfirmation.open,
323
+ copy: Q.removeConfirmation.copy,
324
+ onConfirm: Q.removeConfirmation.onConfirm,
325
+ onCancel: Q.removeConfirmation.onCancel,
326
+ isPending: Q.removeConfirmation.isPending,
327
+ confirmIcon: /* @__PURE__ */ s(Ie, {}),
328
+ labels: { cancelButton: Q.removeConfirmation.cancelButtonLabel },
329
+ testId: r.duplicateRemoveDialog,
330
+ confirmTestId: r.duplicateRemoveConfirm
331
+ }),
332
+ /* @__PURE__ */ s(de, { ...V.dialogProps }),
333
+ d && D ? /* @__PURE__ */ s(he, {
334
+ ref: Ye,
335
+ payable: D,
336
+ onMissingAchInstructions: Qe ? B.open : void 0,
337
+ poweredByBankName: Re,
338
+ labels: p.payBill
339
+ }) : null
340
+ ] });
341
+ }
342
+ //#endregion
343
+ export { c as BillCreateDialog, c as default };
@@ -1,33 +1,4 @@
1
- import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index56.js";
2
- import "../../ui/dist/index.js";
3
- import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index12.js";
4
- import "./index15.js";
5
- import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index25.js";
6
- import { BILL_DETAIL_ACTIONS_LABELS_EN as r, SCHEDULED_SUMMARY_LABEL_EN as i } from "./index38.js";
7
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js
8
- var a = {
9
- subtitle: "Accounts payable",
10
- vendorRow: "Vendor",
11
- bankAccountRow: "ACH bank account",
12
- bankAccountValue: (e) => `Account ending in ${e}`,
13
- invoiceNumberRow: "Number",
14
- issueDateRow: "Issue date",
15
- dueDateRow: "Due date",
16
- poNumberRow: "PO number",
17
- notProvided: "Not provided",
18
- glCodeMissing: "GL code not specified",
19
- quantityValue: (e, t) => `${e} x ${t}`,
20
- subtotalRow: "Subtotal",
21
- discountsRow: "Discounts",
22
- taxRow: "Tax",
23
- totalRow: "Total",
24
- actionError: r.actionError,
25
- actionSuccess: r.actionSuccess,
26
- scheduledSummary: i,
27
- sheet: e,
28
- decisionDialog: r.decisionDialog,
29
- approvalPolicyCopy: n,
30
- markAsPaid: t
31
- };
32
- //#endregion
33
- export { a as BILL_DETAILS_LABELS_EN };
1
+ import "./index41.js";
2
+ import "./index50.js";
3
+ import "./index52.js";
4
+ import "./index54.js";
@@ -1,85 +1,33 @@
1
- import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
- import { derivePayableStatus as t } from "./index4.js";
3
- import { resolveVendor as n, resolveVendorName as r } from "./index5.js";
4
- import { formatBillMoney as i } from "./index35.js";
1
+ import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index56.js";
2
+ import "../../ui/dist/index.js";
3
+ import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index12.js";
4
+ import "./index15.js";
5
+ import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index25.js";
6
+ import { BILL_DETAIL_ACTIONS_LABELS_EN as r, SCHEDULED_SUMMARY_LABEL_EN as i } from "./index39.js";
5
7
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js
6
- function a({ payable: a, lineItems: o, ledgerAccounts: s, labels: c, hasScheduledPayment: l, now: u }) {
7
- let d = a.currency, f = (e) => i(e, d), p = t({
8
- apiStatus: a.status,
9
- dueDate: a.due_date,
10
- scheduledPaymentDate: a.scheduled_payment_date,
11
- hasScheduledPayment: l,
12
- now: u
13
- }), m = n(a), h = r(a), g = e(a.issued_at) || c.notProvided, _ = e(a.due_date) || c.notProvided, v = [{
14
- label: c.vendorRow,
15
- value: h || c.notProvided,
16
- secondaryValue: m?.email ?? void 0
17
- }], y = m?.bank_account?.account_number;
18
- y && v.push({
19
- label: c.bankAccountRow,
20
- value: c.bankAccountValue(y.slice(-4))
21
- });
22
- let b = [
23
- {
24
- label: c.invoiceNumberRow,
25
- value: a.document_id || c.notProvided
26
- },
27
- {
28
- label: c.issueDateRow,
29
- value: g
30
- },
31
- {
32
- label: c.dueDateRow,
33
- value: _
34
- },
35
- {
36
- label: c.poNumberRow,
37
- value: c.notProvided
38
- }
39
- ], x = new Map(s.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), S = o.map((e) => {
40
- let t = f(e.unit_price);
41
- return {
42
- id: e.id,
43
- description: e.name ?? e.description ?? "",
44
- glCodeLabel: (e.ledger_account_id ? x.get(e.ledger_account_id) : void 0) || c.glCodeMissing,
45
- quantityLabel: e.quantity != null && t ? c.quantityValue(String(e.quantity), t) : "",
46
- amountLabel: f(e.subtotal) ?? ""
47
- };
48
- }), C = [
49
- {
50
- label: c.subtotalRow,
51
- value: a.subtotal
52
- },
53
- {
54
- label: c.discountsRow,
55
- value: a.discount
56
- },
57
- {
58
- label: c.taxRow,
59
- value: a.tax_amount
60
- }
61
- ].map(({ label: e, value: t }) => ({
62
- label: e,
63
- value: f(t)
64
- })).filter((e) => !!e.value), w = f(a.total_amount);
65
- return w && C.push({
66
- label: c.totalRow,
67
- value: w,
68
- emphasis: !0
69
- }), {
70
- title: h,
71
- subtitle: c.subtitle,
72
- status: p.status,
73
- statusTone: p.tone,
74
- amountDueLabel: f(a.amount_due) ?? f(a.total_amount) ?? "",
75
- invoiceDateLabel: g,
76
- dueDateLabel: _,
77
- dueDateTone: p.isOverdue ? "danger" : "default",
78
- payToItems: v,
79
- invoiceItems: b,
80
- lineItems: S,
81
- totals: C
82
- };
83
- }
8
+ var a = {
9
+ subtitle: "Accounts payable",
10
+ vendorRow: "Vendor",
11
+ bankAccountRow: "ACH bank account",
12
+ bankAccountValue: (e) => `Account ending in ${e}`,
13
+ invoiceNumberRow: "Number",
14
+ issueDateRow: "Issue date",
15
+ dueDateRow: "Due date",
16
+ poNumberRow: "PO number",
17
+ notProvided: "Not provided",
18
+ glCodeMissing: "GL code not specified",
19
+ quantityValue: (e, t) => `${e} x ${t}`,
20
+ subtotalRow: "Subtotal",
21
+ discountsRow: "Discounts",
22
+ taxRow: "Tax",
23
+ totalRow: "Total",
24
+ actionError: r.actionError,
25
+ actionSuccess: r.actionSuccess,
26
+ scheduledSummary: i,
27
+ sheet: e,
28
+ decisionDialog: r.decisionDialog,
29
+ approvalPolicyCopy: n,
30
+ markAsPaid: t
31
+ };
84
32
  //#endregion
85
- export { a as mapPayableToBillDetails };
33
+ export { a as BILL_DETAILS_LABELS_EN };