@tesouro/embedded-components-react 0.5.75 → 0.5.77

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 (88) hide show
  1. package/dist/index.css +0 -8
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +140 -7
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +46 -140
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +114 -47
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +182 -111
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +75 -164
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +31 -76
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +89 -23
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +405 -65
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +12 -381
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +84 -12
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +54 -79
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +223 -54
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +37 -223
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +245 -37
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +21 -252
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +575 -21
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -572
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +44 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +247 -38
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +3 -234
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +4 -3
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +44 -2
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -46
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -1
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +11 -6
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +127 -11
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -129
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +127 -3
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -124
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +7 -8
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +47 -8
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +18 -44
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +28 -20
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +82 -27
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +47 -83
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +250 -47
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +123 -241
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +211 -126
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +3 -219
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +7 -4
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +98 -5
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +1 -100
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +26 -0
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +10 -10
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +2 -72
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +12 -269
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +2 -19
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +16 -50
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +97 -15
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +76 -47
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +277 -2
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +2 -35
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +16 -369
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +56 -2
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +2 -23
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +15 -93
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +50 -2
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +1 -31
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +32 -49
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +374 -2
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +1 -55
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +20 -10
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +87 -188
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +1 -1
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +30 -2
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +48 -37
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +47 -10
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +10 -85
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +197 -2
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +2 -4
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +2 -14
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +41 -2
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +2 -4
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +14 -17
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +88 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -94
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +167 -161
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +5 -5
  83. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  84. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js +5 -1
  85. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  86. package/dist/packages/shared-ui-shadcn/dist/index.js +1391 -1369
  87. package/package.json +1 -1
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +0 -27
@@ -1,169 +1,80 @@
1
- import { DISCARD_CHANGES_DIALOG_LABELS_EN as e } from "../../ui/dist/index66.js";
2
- import { BILL_REJECTED_BANNER_LABELS_EN as t } from "../../ui/dist/index74.js";
3
- import { UNSAVED_BILL_DIALOG_LABELS_EN as n } from "../../ui/dist/index111.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAttachPayableFileMutation as e } from "../../data-access/dist/index13.js";
6
+ import "../../data-access/dist/index.js";
7
+ import { SourceDocumentPanel as t } from "../../ui/dist/index109.js";
4
8
  import "../../ui/dist/index.js";
5
- import { PAY_BILL_FLOW_LABELS_EN as r, mergePayBillFlowLabels as i } from "./index25.js";
6
- import { MARK_AS_PAID_FLOW_LABELS_EN as a, mergeMarkAsPaidFlowLabels as o } from "./index15.js";
7
- import "./index18.js";
8
- import { APPROVAL_POLICY_RULE_COPY_EN as s } from "./index29.js";
9
- import { AWAITING_APPROVAL_LABEL_EN as c, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as l, BILL_DETAIL_ACTIONS_LABELS_EN as u, PAYMENT_HISTORY_LABELS_EN as d, SCHEDULED_STATUS_BADGE_LABEL_EN as f, SCHEDULED_SUMMARY_LABEL_EN as p, mergeBillDetailActionsLabels as m, mergePaymentHistoryMethodLabels as h } from "./index46.js";
10
- import { PAYABLE_AUDIT_HISTORY_LABELS_EN as g } from "./index47.js";
11
- import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as _ } from "./index48.js";
9
+ import { createSourceDocumentPreview as n } from "./index47.js";
10
+ import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as r } from "./index48.js";
11
+ import { useEffect as i, useState as a } from "react";
12
+ import { jsx as o } from "react/jsx-runtime";
12
13
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js
13
- var v = {
14
- unmappedValidationError: (e, t) => `${e}: ${t}`,
15
- unknownValidationField: "(unknown field)",
16
- requiredField: "This field is required.",
17
- saveFailed: "We could not save this bill. Try again.",
18
- discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
19
- vendorResolutionFailed: "We couldn't create this vendor automatically. Select or add a vendor before submitting.",
20
- finalizeFailed: "We could not submit this bill. Try again.",
21
- draftSaved: "Bill saved as a draft.",
22
- submittedSaved: "Bill updated.",
23
- submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
24
- billFinalized: "Bill submitted for approval.",
25
- numbersOnly: "Enter numbers only.",
26
- unreadableMoney: "Enter a valid amount.",
27
- unusableQuantity: "Enter a quantity greater than 0.",
28
- lineItemsNeedAttention: "Check the highlighted line items before saving.",
29
- unreadableDiscount: "Enter a valid discount amount.",
30
- unreadableTax: "Enter a valid tax amount.",
31
- unreadableTotal: "Enter a valid total amount.",
32
- totalNotGreaterThanZero: "Total amount must be greater than $0.",
33
- poNumberTooLong: "PO number must be 255 characters or fewer.",
34
- dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
35
- }, y = {
36
- paymentInstructionsValue: (e) => `Account ending in ${e}`,
37
- noMethod: "No payment method on file",
38
- paymentMethodLoading: "Loading payment method...",
39
- paymentMethodUnavailable: "We could not load payment methods. Try again.",
40
- searchFailed: "We could not load vendors. Try again.",
41
- vendorDetailsFailed: "We could not load this vendor. Try again.",
42
- pendingVendorDescription: "Will be created when submitted",
43
- bankAccountSaveFailed: "We could not save these payment instructions. Try again."
44
- }, b = {
45
- attachFailed: "We could not attach that file. Try again.",
46
- deleteFailed: "We could not remove that document. Try again.",
47
- noDocument: "No document attached to this bill.",
48
- pendingDeletionNotice: "This document will be removed when you save this bill.",
49
- preview: _
50
- }, x = {
51
- ...d,
52
- historyDateTime: (e, t) => `${e}, ${t}`,
53
- historyWithMeta: (e, t) => `${e} · ${t}`,
54
- notProvided: "Not provided",
55
- paymentInstructionsValue: (e) => `Account ending in ${e}`,
56
- paymentInstructionsNotSet: "Not set",
57
- invoiceDateRow: "Invoice date",
58
- dueDateRow: "Due date",
59
- invoiceNumberRow: "Invoice number",
60
- glCodeMissing: "GL code not specified",
61
- glCodeUnavailable: "GL code unavailable",
62
- qtyPriceValue: (e, t) => `${e} x ${t}`,
63
- qtyOnlyValue: (e) => e,
64
- subtotalRow: "Subtotal",
65
- taxRow: "Tax",
66
- discountRow: "Discounts",
67
- totalRow: "Total",
68
- paidOnLabel: (e) => `Paid on ${e}`,
69
- paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
70
- paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again.",
71
- rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
72
- rejectedOn: (e) => `Rejected on ${e}`,
73
- rejectionMessage: (e) => `"${e}"`
74
- }, S = {
75
- newTitle: "New bill",
76
- extractedTitle: (e) => `Bill from ${e}`,
77
- viewTitle: (e) => `Bill from ${e}`,
78
- readOnlyTitle: "Bill details",
79
- addedOn: (e) => `Added on ${e}`,
80
- unsavedChanges: n,
81
- discardChanges: e,
82
- scheduledSummary: p,
83
- scheduledStatusBadge: f,
84
- awaitingApprovalNotice: c,
85
- awaitingApprovalUnknownNotice: l,
86
- actions: u,
87
- detail: x,
88
- history: g,
89
- payBill: r,
90
- markAsPaid: a,
91
- approvalPolicyCopy: s,
92
- deleteDraft: {
93
- menuItem: "Delete draft",
94
- dialog: {
95
- title: "Delete this draft?",
96
- description: "The draft and anything entered on it are removed. This can't be undone.",
97
- confirmButton: "Delete draft"
98
- },
99
- error: "Couldn't delete this draft. Try again."
100
- },
101
- lineItemsGlCodeUnavailable: {
102
- loadError: "Couldn't load GL codes",
103
- noAccess: "You don't have access to GL codes",
104
- empty: "No GL codes set up yet"
105
- },
106
- rejectedBanner: t
107
- };
108
- function C(e) {
109
- return {
110
- ...S,
111
- ...e,
112
- actions: m(e?.actions),
113
- detail: {
114
- ...S.detail,
115
- ...e?.detail,
116
- paymentHistoryMethodLabels: h(e?.detail?.paymentHistoryMethodLabels)
117
- },
118
- history: {
119
- ...S.history,
120
- ...e?.history
121
- },
122
- payBill: i(e?.payBill),
123
- markAsPaid: o(e?.markAsPaid),
124
- lineItemsGlCodeUnavailable: {
125
- ...S.lineItemsGlCodeUnavailable,
126
- ...e?.lineItemsGlCodeUnavailable
127
- },
128
- unsavedChanges: {
129
- ...S.unsavedChanges,
130
- ...e?.unsavedChanges
131
- },
132
- discardChanges: {
133
- ...S.discardChanges,
134
- ...e?.discardChanges
135
- },
136
- rejectedBanner: {
137
- ...S.rejectedBanner,
138
- ...e?.rejectedBanner
139
- },
140
- approvalPolicyCopy: {
141
- ...S.approvalPolicyCopy,
142
- ...e?.approvalPolicyCopy
143
- },
144
- deleteDraft: {
145
- ...S.deleteDraft,
146
- ...e?.deleteDraft,
147
- dialog: (() => {
148
- let t = {
149
- ...S.deleteDraft.dialog,
150
- ...e?.deleteDraft?.dialog
151
- };
152
- return delete t.reason, t;
153
- })()
14
+ function s(e) {
15
+ let [t, n] = a();
16
+ return i(() => {
17
+ if (!e) {
18
+ n(void 0);
19
+ return;
154
20
  }
155
- };
21
+ let t = URL.createObjectURL(e);
22
+ return n(t), () => URL.revokeObjectURL(t);
23
+ }, [e]), t;
24
+ }
25
+ function c({ payableId: i, file: a, isDocumentPending: c, pendingFileName: l, readOnly: u, staging: d, deletion: f, labels: p }) {
26
+ let { stagedFile: m, onFileStaged: h, onClearStagedFile: g, isSaving: _ } = d ?? {}, { isPending: v, onRequest: y, onDetachNow: b, isDeleting: x, hasFailed: S } = f ?? {}, C = {
27
+ ...r,
28
+ ...p,
29
+ preview: {
30
+ ...r.preview,
31
+ ...p?.preview
32
+ }
33
+ }, w = e(), T = s(m), E = !!(a && !v || m);
34
+ if (!E && (c || w.isPending)) return /* @__PURE__ */ o(t, {
35
+ mode: "loading",
36
+ fileName: l
37
+ });
38
+ if (!E && u) return /* @__PURE__ */ o("div", {
39
+ className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
40
+ children: C.noDocument
41
+ });
42
+ if (!E) return /* @__PURE__ */ o(t, {
43
+ mode: "upload",
44
+ uploadStatus: w.isPending || x ? "uploading" : "idle",
45
+ uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
46
+ noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
47
+ onFilesSelected: (e) => {
48
+ let [t] = e;
49
+ if (t) {
50
+ if (i) {
51
+ let e = () => w.mutate({
52
+ path: { payable_id: i },
53
+ file: t
54
+ });
55
+ if (v && b) {
56
+ b().then(e, () => void 0);
57
+ return;
58
+ }
59
+ e();
60
+ } else h?.(t);
61
+ }
62
+ }
63
+ });
64
+ let D = a?.name ?? m?.name ?? "", O = n(a || {
65
+ name: D,
66
+ url: T ?? "",
67
+ mimetype: m?.type ?? ""
68
+ }, C.preview);
69
+ return /* @__PURE__ */ o(t, {
70
+ mode: "document",
71
+ fileName: D,
72
+ preview: O,
73
+ isDeleting: x,
74
+ deleteErrorMessage: S ? C.deleteFailed : void 0,
75
+ onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
76
+ onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
77
+ });
156
78
  }
157
- var w = {
158
- createTitle: "New vendor",
159
- editTitle: "Edit vendor",
160
- switchVendorFieldLabel: "Switch to a different vendor",
161
- nameLabel: "Business name",
162
- addAddress: "Add address (optional)",
163
- cancel: "Cancel",
164
- save: "Save",
165
- cancelAriaLabel: "Cancel vendor",
166
- saveAriaLabel: "Save vendor"
167
- };
168
79
  //#endregion
169
- export { v as BILL_CREATE_MESSAGE_LABELS_EN, S as BILL_CREATE_SCREEN_LABELS_EN, x as BILL_DETAIL_VIEW_LABELS_EN, b as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, w as VENDOR_INLINE_FORM_LABELS_EN, y as VENDOR_SECTION_PROPS_LABELS_EN, C as mergeBillCreateScreenCopy };
80
+ export { c as SourceDocumentContainer, c as default };
@@ -1,80 +1,35 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAttachPayableFileMutation as e } from "../../data-access/dist/index13.js";
6
- import "../../data-access/dist/index.js";
7
- import { SourceDocumentPanel as t } from "../../ui/dist/index109.js";
8
- import "../../ui/dist/index.js";
9
- import { createSourceDocumentPreview as n } from "./index48.js";
10
- import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as r } from "./index49.js";
11
- import { useEffect as i, useState as a } from "react";
12
- import { jsx as o } from "react/jsx-runtime";
13
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js
14
- function s(e) {
15
- let [t, n] = a();
16
- return i(() => {
17
- if (!e) {
18
- n(void 0);
19
- return;
20
- }
21
- let t = URL.createObjectURL(e);
22
- return n(t), () => URL.revokeObjectURL(t);
23
- }, [e]), t;
2
+ function e(e) {
3
+ return e?.trim() ?? "";
24
4
  }
25
- function c({ payableId: i, file: a, isDocumentPending: c, pendingFileName: l, readOnly: u, staging: d, deletion: f, labels: p }) {
26
- let { stagedFile: m, onFileStaged: h, onClearStagedFile: g, isSaving: _ } = d ?? {}, { isPending: v, onRequest: y, onDetachNow: b, isDeleting: x, hasFailed: S } = f ?? {}, C = {
27
- ...r,
28
- ...p,
29
- preview: {
30
- ...r.preview,
31
- ...p?.preview
32
- }
33
- }, w = e(), T = s(m), E = !!(a && !v || m);
34
- if (!E && (c || w.isPending)) return /* @__PURE__ */ o(t, {
35
- mode: "loading",
36
- fileName: l
37
- });
38
- if (!E && u) return /* @__PURE__ */ o("div", {
39
- className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
40
- children: C.noDocument
41
- });
42
- if (!E) return /* @__PURE__ */ o(t, {
43
- mode: "upload",
44
- uploadStatus: w.isPending || x ? "uploading" : "idle",
45
- uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
46
- noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
47
- onFilesSelected: (e) => {
48
- let [t] = e;
49
- if (t) {
50
- if (i) {
51
- let e = () => w.mutate({
52
- path: { payable_id: i },
53
- file: t
54
- });
55
- if (v && b) {
56
- b().then(e, () => void 0);
57
- return;
58
- }
59
- e();
60
- } else h?.(t);
61
- }
62
- }
63
- });
64
- let D = a?.name ?? m?.name ?? "", O = n(a || {
65
- name: D,
66
- url: T ?? "",
67
- mimetype: m?.type ?? ""
68
- }, C.preview);
69
- return /* @__PURE__ */ o(t, {
70
- mode: "document",
71
- fileName: D,
72
- preview: O,
73
- isDeleting: x,
74
- deleteErrorMessage: S ? C.deleteFailed : void 0,
75
- onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
76
- onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
77
- });
5
+ function t(t) {
6
+ let n = e(t);
7
+ return n.length === 2 ? n.toUpperCase() : "";
8
+ }
9
+ function n(t) {
10
+ let n = e(t.bank_account?.routing_number), r = e(t.bank_account?.account_number);
11
+ if (!(!n && !r)) return {
12
+ accountHolderName: e(t.bank_account?.account_holder_name) || e(t.name),
13
+ routingNumber: n,
14
+ accountNumber: r
15
+ };
16
+ }
17
+ function r(r) {
18
+ if (!r) return;
19
+ let i = {
20
+ legalName: e(r.name),
21
+ email: e(r.email),
22
+ phone: e(r.phone),
23
+ address: {
24
+ line1: e(r.address?.line1),
25
+ line2: e(r.address?.line2),
26
+ city: e(r.address?.city),
27
+ state: t(r.address?.state),
28
+ postalCode: e(r.address?.postal_code)
29
+ },
30
+ bankAccount: n(r)
31
+ };
32
+ return i.legalName || i.email || i.phone || Object.values(i.address).some(Boolean) || i.bankAccount ? i : void 0;
78
33
  }
79
34
  //#endregion
80
- export { c as SourceDocumentContainer, c as default };
35
+ export { r as buildVendorPrefill };
@@ -1,26 +1,92 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { getStateOptions as t } from "../../../shared/util/dist/lib/usStates.js";
7
+ import { AchFieldGroup as n } from "../../../shared/counterpart-management/ui/dist/index5.js";
8
+ import { CounterpartFormFields as r, useFocusFirstInvalidField as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
9
+ import "../../../shared/counterpart-management/ui/dist/index.js";
10
+ import { VendorSearchCombobox as a } from "../../ui/dist/index50.js";
11
+ import "../../ui/dist/index.js";
12
+ import "../../../shared/counterpart-management/feature/dist/index.js";
13
+ import { mergeVendorInlineFormLabels as o } from "./index48.js";
14
+ import { useMemo as s } from "react";
15
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
1
16
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js
2
- function e(e) {
3
- return e?.trim() ?? "";
4
- }
5
- function t(t) {
6
- let n = e(t);
7
- return n.length === 2 ? n.toUpperCase() : "";
8
- }
9
- function n(n) {
10
- if (!n) return;
11
- let r = {
12
- legalName: e(n.name),
13
- email: e(n.email),
14
- phone: e(n.phone),
15
- address: {
16
- line1: e(n.address?.line1),
17
- line2: e(n.address?.line2),
18
- city: e(n.address?.city),
19
- state: t(n.address?.state),
20
- postalCode: e(n.address?.postal_code)
21
- }
22
- };
23
- return r.legalName || r.email || r.phone || Object.values(r.address).some(Boolean) ? r : void 0;
17
+ function u({ mode: u, values: d, errors: f, onChange: p, onAddressChange: m, sectionsToExpand: h, onAddressExpand: g, onCancel: _, onSave: v, isSaving: y = !1, search: b, paymentInstructions: x, labels: S }) {
18
+ let C = s(() => o(S), [S]), w = s(() => t(), []), T = i(f ?? {});
19
+ return /* @__PURE__ */ l("div", {
20
+ ref: T,
21
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
22
+ children: [
23
+ /* @__PURE__ */ c("p", {
24
+ className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
25
+ children: u === "edit" ? C.editTitle : C.createTitle
26
+ }),
27
+ u === "edit" && b ? /* @__PURE__ */ c(a, {
28
+ ...b,
29
+ labels: { fieldLabel: C.switchVendorFieldLabel }
30
+ }) : null,
31
+ /* @__PURE__ */ c(r, {
32
+ mode: u,
33
+ counterpartMode: "vendor",
34
+ values: d,
35
+ errors: f,
36
+ stateOptions: w,
37
+ onChange: p,
38
+ onAddressChange: m,
39
+ sections: {
40
+ entityType: !0,
41
+ profileHeading: !1,
42
+ title: !1,
43
+ taxId: !1,
44
+ address: "collapsible",
45
+ bankAccount: !1
46
+ },
47
+ sectionsToExpand: h,
48
+ onAddressExpand: g,
49
+ labels: { businessNameLabel: C.nameLabel }
50
+ }),
51
+ x ? /* @__PURE__ */ l("div", {
52
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
53
+ children: [/* @__PURE__ */ l("div", {
54
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
55
+ children: [/* @__PURE__ */ c("p", {
56
+ className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
57
+ children: C.paymentInstructionsHeading
58
+ }), /* @__PURE__ */ c("p", {
59
+ className: "ttw:text-sm ttw:text-muted-foreground",
60
+ children: x.isExtracted ? C.paymentInstructionsExtracted : C.paymentInstructionsDescription
61
+ })]
62
+ }), /* @__PURE__ */ c(n, {
63
+ idPrefix: "vendor-inline-ach",
64
+ values: x.values,
65
+ errors: x.errors,
66
+ onChange: x.onChange,
67
+ labels: C.ach
68
+ })]
69
+ }) : null,
70
+ /* @__PURE__ */ l("div", {
71
+ className: "ttw:flex ttw:justify-end ttw:gap-2",
72
+ children: [/* @__PURE__ */ c(e, {
73
+ type: "button",
74
+ variant: "outline",
75
+ onClick: _,
76
+ "aria-label": C.cancelAriaLabel,
77
+ disabled: y,
78
+ children: C.cancel
79
+ }), v ? /* @__PURE__ */ c(e, {
80
+ type: "button",
81
+ onClick: v,
82
+ "aria-label": C.saveAriaLabel,
83
+ loading: y,
84
+ disabled: y,
85
+ children: C.save
86
+ }) : null]
87
+ })
88
+ ]
89
+ });
24
90
  }
25
91
  //#endregion
26
- export { n as buildVendorPrefill };
92
+ export { u as VendorInlineForm, u as default };