@tesouro/embedded-components-react 0.3.45 → 0.3.48

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