@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,76 +1,8 @@
1
- import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
- import { resolveAmountDueMinorUnits as t } from "./index6.js";
3
- import { resolveVendor as n } from "./index7.js";
4
- import { derivePayableStatus as r } from "./index25.js";
5
- import { formatBillMoney as i } from "./index26.js";
1
+ import { formatMoneyExact as e } from "../../../shared/util/dist/lib/formatMoneyExact.js";
2
+ import "../../data-access/dist/index.js";
6
3
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js
7
- function a({ payable: a, lineItems: o, glCodeOptions: s, glCodeRosterAvailable: c = !0, history: l, approvalPolicy: u, labels: d, hasScheduledPayment: f }) {
8
- let p = a.currency, m = r({
9
- apiStatus: a.status,
10
- dueDate: a.due_date,
11
- scheduledPaymentDate: a.scheduled_payment_date,
12
- hasScheduledPayment: f
13
- }), h = n(a), g = h?.bank_account?.account_number, _ = e(a.issued_at) || d.notProvided, v = e(a.due_date) || d.notProvided, y = new Map(s.map((e) => [e.value, e.label])), b = [
14
- {
15
- label: d.subtotalRow,
16
- minorUnits: a.subtotal
17
- },
18
- {
19
- label: d.discountRow,
20
- minorUnits: a.discount
21
- },
22
- {
23
- label: d.taxRow,
24
- minorUnits: a.tax_amount
25
- }
26
- ].map((e) => ({
27
- label: e.label,
28
- value: i(e.minorUnits, p)
29
- })).filter((e) => !!e.value), x = i(a.total_amount, p);
30
- return x && b.push({
31
- label: d.totalRow,
32
- value: x,
33
- emphasis: !0
34
- }), {
35
- amountDue: i(t(a), p) ?? "",
36
- invoiceDateLabel: _,
37
- dueDateLabel: v,
38
- dueDateTone: m.isOverdue ? "danger" : "default",
39
- status: m.status,
40
- statusTone: m.tone,
41
- payTo: {
42
- name: h?.name || d.notProvided,
43
- email: h?.email ?? void 0,
44
- paymentInstructionsLabel: g ? d.paymentInstructionsValue(g.slice(-4)) : void 0
45
- },
46
- invoiceFields: [
47
- {
48
- label: d.invoiceDateRow,
49
- value: _
50
- },
51
- {
52
- label: d.dueDateRow,
53
- value: v
54
- },
55
- {
56
- label: d.invoiceNumberRow,
57
- value: a.document_id || d.notProvided
58
- }
59
- ],
60
- lineItems: o.map((e) => {
61
- let t = i(e.unit_price, p);
62
- return {
63
- id: e.id,
64
- description: e.name ?? e.description ?? "",
65
- glCodeLabel: e.ledger_account_id ? y.get(e.ledger_account_id) ?? (c ? d.glCodeMissing : d.glCodeUnavailable) : d.glCodeMissing,
66
- qtyPriceLabel: e.quantity != null && t ? d.qtyPriceValue(String(e.quantity), t) : "",
67
- amount: i(e.subtotal, p) ?? ""
68
- };
69
- }),
70
- amountRows: b,
71
- approvalPolicy: u,
72
- history: l
73
- };
4
+ function t(t, n) {
5
+ if (typeof t == "number") return e(t / 100, { currencyCode: n ?? "USD" });
74
6
  }
75
7
  //#endregion
76
- export { a as buildBillDetailView };
8
+ export { t as formatBillMoney };
@@ -1,52 +1,76 @@
1
- import { BILL_STATUS_BADGE_LABELS_EN as e } from "../../ui/dist/index18.js";
2
- import "../../ui/dist/index.js";
3
- import { derivePayableStatus as t } from "./index25.js";
1
+ import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
+ import { resolveAmountDueMinorUnits as t } from "./index6.js";
3
+ import { resolveVendor as n } from "./index7.js";
4
+ import { derivePayableStatus as r } from "./index26.js";
5
+ import { formatBillMoney as i } from "./index27.js";
4
6
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js
5
- var n = /* @__PURE__ */ new Set([
6
- "credit_note_linked",
7
- "credit_note_unlinked",
8
- "line_item_added",
9
- "line_item_updated",
10
- "line_item_removed",
11
- "deleted"
12
- ]);
13
- function r(n, r, i) {
14
- switch (n) {
15
- case "payable_created": return r?.source_of_payable_data === "ocr" ? i.billUploaded : i.billAdded;
16
- case "payable_updated": return i.billUpdated;
17
- case "file_attached": return i.attachmentAdded;
18
- case "submitted_for_approval": return i.submittedForApproval;
19
- case "approval_requested": return i.approvalRequested;
20
- case "approval_action": {
21
- let e = r?.action, t = r?.reject_reason;
22
- return e === "approve" ? i.approved : e === "reject" ? typeof t == "string" && t ? i.rejectedWithReason(t) : i.rejected : void 0;
7
+ function a({ payable: a, lineItems: o, glCodeOptions: s, glCodeRosterAvailable: c = !0, history: l, approvalPolicy: u, labels: d, hasScheduledPayment: f }) {
8
+ let p = a.currency, m = r({
9
+ apiStatus: a.status,
10
+ dueDate: a.due_date,
11
+ scheduledPaymentDate: a.scheduled_payment_date,
12
+ hasScheduledPayment: f
13
+ }), h = n(a), g = h?.bank_account?.account_number, _ = e(a.issued_at) || d.notProvided, v = e(a.due_date) || d.notProvided, y = new Map(s.map((e) => [e.value, e.label])), b = [
14
+ {
15
+ label: d.subtotalRow,
16
+ minorUnits: a.subtotal
17
+ },
18
+ {
19
+ label: d.discountRow,
20
+ minorUnits: a.discount
21
+ },
22
+ {
23
+ label: d.taxRow,
24
+ minorUnits: a.tax_amount
23
25
  }
24
- case "auto_approved": return i.autoApproved;
25
- case "reopened": return i.reopened;
26
- case "marked_as_paid": return i.markedAsPaid;
27
- case "marked_as_partially_paid": return i.markedAsPartiallyPaid;
28
- case "payment_reverted": return i.paymentReverted;
29
- case "status_changed": {
30
- let n = r?.new_status;
31
- if (typeof n != "string") return;
32
- let a = t({ apiStatus: n }).status;
33
- return i.statusChanged(e[a] ?? e.unknown);
34
- }
35
- default: return;
36
- }
37
- }
38
- function i(e, t, i) {
39
- let a = new Map(t.map((e) => [e.id, e.name]));
40
- return e.filter((e) => !n.has(e.event_type)).map((e) => {
41
- let t = r(e.event_type, e.event_data, i);
42
- if (!t) return;
43
- let n = e.entity_user_id ? a.get(e.entity_user_id) : void 0;
44
- return {
45
- id: e.id,
46
- dateLabel: i.dateLabel(e.timestamp),
47
- description: n ? i.byActor(t, n) : t
48
- };
49
- }).filter((e) => !!e);
26
+ ].map((e) => ({
27
+ label: e.label,
28
+ value: i(e.minorUnits, p)
29
+ })).filter((e) => !!e.value), x = i(a.total_amount, p);
30
+ return x && b.push({
31
+ label: d.totalRow,
32
+ value: x,
33
+ emphasis: !0
34
+ }), {
35
+ amountDue: i(t(a), p) ?? "",
36
+ invoiceDateLabel: _,
37
+ dueDateLabel: v,
38
+ dueDateTone: m.isOverdue ? "danger" : "default",
39
+ status: m.status,
40
+ statusTone: m.tone,
41
+ payTo: {
42
+ name: h?.name || d.notProvided,
43
+ email: h?.email ?? void 0,
44
+ paymentInstructionsLabel: g ? d.paymentInstructionsValue(g.slice(-4)) : void 0
45
+ },
46
+ invoiceFields: [
47
+ {
48
+ label: d.invoiceDateRow,
49
+ value: _
50
+ },
51
+ {
52
+ label: d.dueDateRow,
53
+ value: v
54
+ },
55
+ {
56
+ label: d.invoiceNumberRow,
57
+ value: a.document_id || d.notProvided
58
+ }
59
+ ],
60
+ lineItems: o.map((e) => {
61
+ let t = i(e.unit_price, p);
62
+ return {
63
+ id: e.id,
64
+ description: e.name ?? e.description ?? "",
65
+ glCodeLabel: e.ledger_account_id ? y.get(e.ledger_account_id) ?? (c ? d.glCodeMissing : d.glCodeUnavailable) : d.glCodeMissing,
66
+ qtyPriceLabel: e.quantity != null && t ? d.qtyPriceValue(String(e.quantity), t) : "",
67
+ amount: i(e.subtotal, p) ?? ""
68
+ };
69
+ }),
70
+ amountRows: b,
71
+ approvalPolicy: u,
72
+ history: l
73
+ };
50
74
  }
51
75
  //#endregion
52
- export { i as buildBillHistory };
76
+ export { a as buildBillDetailView };
@@ -1,96 +1,52 @@
1
+ import { BILL_STATUS_BADGE_LABELS_EN as e } from "../../ui/dist/index18.js";
2
+ import "../../ui/dist/index.js";
3
+ import { derivePayableStatus as t } from "./index26.js";
1
4
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js
2
- var e = {
3
- payBill: "Pay bill",
4
- markAsPaid: "Mark as paid",
5
- reject: "Reject",
6
- approve: "Approve",
7
- cancel: "Cancel bill",
8
- cancelScheduledPayment: "Cancel scheduled payment",
9
- reopen: "Reopen bill",
10
- forceApprove: "Approve",
11
- forceReject: "Reject",
12
- policyOverridesHeading: "Policy overrides",
13
- decisionDialog: {
14
- reject: {
15
- title: "Reject this bill?",
16
- description: "The bill goes back as rejected and nobody else is asked to approve it.",
17
- confirmButton: "Reject bill",
18
- reason: {
19
- label: "Reason",
20
- placeholder: "Tell the submitter what needs to change",
21
- optionalHint: "Optional"
22
- }
23
- },
24
- cancel: {
25
- title: "Cancel this bill?",
26
- description: "Cancelling is permanent. The bill can't be reopened, edited, or paid afterwards.",
27
- confirmButton: "Cancel bill"
28
- },
29
- cancelScheduledPayment: {
30
- title: "Cancel this scheduled payment?",
31
- description: "The payment will not be sent. The bill stays ready to pay, so you can schedule it again for another date.",
32
- confirmButton: "Cancel payment"
33
- },
34
- forceApprove: {
35
- title: "Override approval policy?",
36
- description: "The below people haven't approved this bill yet. Approving now will bypass their required review. This will be recorded in the audit history and can't be undone.",
37
- confirmButton: "Override and approve"
38
- },
39
- forceReject: {
40
- title: "Override approval policy?",
41
- description: "The below people haven't approved this bill yet. Rejecting now will bypass their required review. This will be recorded in the audit history and can't be undone.",
42
- confirmButton: "Override and reject"
43
- },
44
- cancelButton: "Cancel"
45
- },
46
- actionError: "Couldn't update this bill. Try again.",
47
- actionSuccess: {
48
- approve: "Bill approved.",
49
- reject: "Bill rejected.",
50
- markAsPaid: "Bill marked as paid.",
51
- cancel: "Bill canceled.",
52
- cancelScheduledPayment: "Scheduled payment canceled.",
53
- reopen: "Bill reopened.",
54
- forceApprove: "Bill approved, overriding the approval policy.",
55
- forceReject: "Bill rejected, overriding the approval policy."
5
+ var n = /* @__PURE__ */ new Set([
6
+ "credit_note_linked",
7
+ "credit_note_unlinked",
8
+ "line_item_added",
9
+ "line_item_updated",
10
+ "line_item_removed",
11
+ "deleted"
12
+ ]);
13
+ function r(n, r, i) {
14
+ switch (n) {
15
+ case "payable_created": return r?.source_of_payable_data === "ocr" ? i.billUploaded : i.billAdded;
16
+ case "payable_updated": return i.billUpdated;
17
+ case "file_attached": return i.attachmentAdded;
18
+ case "submitted_for_approval": return i.submittedForApproval;
19
+ case "approval_requested": return i.approvalRequested;
20
+ case "approval_action": {
21
+ let e = r?.action, t = r?.reject_reason;
22
+ return e === "approve" ? i.approved : e === "reject" ? typeof t == "string" && t ? i.rejectedWithReason(t) : i.rejected : void 0;
23
+ }
24
+ case "auto_approved": return i.autoApproved;
25
+ case "reopened": return i.reopened;
26
+ case "marked_as_paid": return i.markedAsPaid;
27
+ case "marked_as_partially_paid": return i.markedAsPartiallyPaid;
28
+ case "payment_reverted": return i.paymentReverted;
29
+ case "status_changed": {
30
+ let n = r?.new_status;
31
+ if (typeof n != "string") return;
32
+ let a = t({ apiStatus: n }).status;
33
+ return i.statusChanged(e[a] ?? e.unknown);
34
+ }
35
+ default: return;
56
36
  }
57
- }, t = (e) => `Payment scheduled for ${e}`, n = [
58
- "reject",
59
- "cancel",
60
- "cancelScheduledPayment",
61
- "forceApprove",
62
- "forceReject"
63
- ];
64
- function r(e, t) {
65
- let n = e.reason ? {
66
- ...e.reason,
67
- ...t?.reason
68
- } : void 0, r = {
69
- ...e,
70
- ...t,
71
- reason: n
72
- };
73
- return n || delete r.reason, r;
74
37
  }
75
- function i(e, t) {
76
- let i = {
77
- ...e,
78
- ...t
79
- };
80
- for (let a of n) i[a] = r(e[a], t?.[a]);
81
- return i;
82
- }
83
- function a(t) {
84
- let n = e;
85
- return {
86
- ...n,
87
- ...t,
88
- decisionDialog: i(n.decisionDialog, t?.decisionDialog),
89
- actionSuccess: {
90
- ...n.actionSuccess,
91
- ...t?.actionSuccess
92
- }
93
- };
38
+ function i(e, t, i) {
39
+ let a = new Map(t.map((e) => [e.id, e.name]));
40
+ return e.filter((e) => !n.has(e.event_type)).map((e) => {
41
+ let t = r(e.event_type, e.event_data, i);
42
+ if (!t) return;
43
+ let n = e.entity_user_id ? a.get(e.entity_user_id) : void 0;
44
+ return {
45
+ id: e.id,
46
+ dateLabel: i.dateLabel(e.timestamp),
47
+ description: n ? i.byActor(t, n) : t
48
+ };
49
+ }).filter((e) => !!e);
94
50
  }
95
51
  //#endregion
96
- export { e as BILL_DETAIL_ACTIONS_LABELS_EN, t as SCHEDULED_SUMMARY_LABEL_EN, a as mergeBillDetailActionsLabels, i as mergeDecisionDialogCopy };
52
+ export { i as buildBillHistory };
@@ -1,38 +1,96 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js
3
- var n = {
4
- previewUnavailable: "Preview not available for this file type.",
5
- openFile: "Open file"
6
- };
7
- function r(r, i = {}) {
8
- if (r.mimetype === "application/pdf") return /* @__PURE__ */ e("iframe", {
9
- src: `${r.url}#toolbar=0&navpanes=0`,
10
- title: r.name,
11
- referrerPolicy: "no-referrer",
12
- className: "ttw:h-full ttw:w-full ttw:border-0"
13
- });
14
- if (r.mimetype.startsWith("image/")) return /* @__PURE__ */ e("img", {
15
- src: r.url,
16
- alt: r.name,
17
- className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
18
- });
19
- let a = {
2
+ var e = {
3
+ payBill: "Pay bill",
4
+ markAsPaid: "Mark as paid",
5
+ reject: "Reject",
6
+ approve: "Approve",
7
+ cancel: "Cancel bill",
8
+ cancelScheduledPayment: "Cancel scheduled payment",
9
+ reopen: "Reopen bill",
10
+ forceApprove: "Approve",
11
+ forceReject: "Reject",
12
+ policyOverridesHeading: "Policy overrides",
13
+ decisionDialog: {
14
+ reject: {
15
+ title: "Reject this bill?",
16
+ description: "The bill goes back as rejected and nobody else is asked to approve it.",
17
+ confirmButton: "Reject bill",
18
+ reason: {
19
+ label: "Reason",
20
+ placeholder: "Tell the submitter what needs to change",
21
+ optionalHint: "Optional"
22
+ }
23
+ },
24
+ cancel: {
25
+ title: "Cancel this bill?",
26
+ description: "Cancelling is permanent. The bill can't be reopened, edited, or paid afterwards.",
27
+ confirmButton: "Cancel bill"
28
+ },
29
+ cancelScheduledPayment: {
30
+ title: "Cancel this scheduled payment?",
31
+ description: "The payment will not be sent. The bill stays ready to pay, so you can schedule it again for another date.",
32
+ confirmButton: "Cancel payment"
33
+ },
34
+ forceApprove: {
35
+ title: "Override approval policy?",
36
+ description: "The below people haven't approved this bill yet. Approving now will bypass their required review. This will be recorded in the audit history and can't be undone.",
37
+ confirmButton: "Override and approve"
38
+ },
39
+ forceReject: {
40
+ title: "Override approval policy?",
41
+ description: "The below people haven't approved this bill yet. Rejecting now will bypass their required review. This will be recorded in the audit history and can't be undone.",
42
+ confirmButton: "Override and reject"
43
+ },
44
+ cancelButton: "Cancel"
45
+ },
46
+ actionError: "Couldn't update this bill. Try again.",
47
+ actionSuccess: {
48
+ approve: "Bill approved.",
49
+ reject: "Bill rejected.",
50
+ markAsPaid: "Bill marked as paid.",
51
+ cancel: "Bill canceled.",
52
+ cancelScheduledPayment: "Scheduled payment canceled.",
53
+ reopen: "Bill reopened.",
54
+ forceApprove: "Bill approved, overriding the approval policy.",
55
+ forceReject: "Bill rejected, overriding the approval policy."
56
+ }
57
+ }, t = (e) => `Payment scheduled for ${e}`, n = [
58
+ "reject",
59
+ "cancel",
60
+ "cancelScheduledPayment",
61
+ "forceApprove",
62
+ "forceReject"
63
+ ];
64
+ function r(e, t) {
65
+ let n = e.reason ? {
66
+ ...e.reason,
67
+ ...t?.reason
68
+ } : void 0, r = {
69
+ ...e,
70
+ ...t,
71
+ reason: n
72
+ };
73
+ return n || delete r.reason, r;
74
+ }
75
+ function i(e, t) {
76
+ let i = {
77
+ ...e,
78
+ ...t
79
+ };
80
+ for (let a of n) i[a] = r(e[a], t?.[a]);
81
+ return i;
82
+ }
83
+ function a(t) {
84
+ let n = e;
85
+ return {
20
86
  ...n,
21
- ...i
87
+ ...t,
88
+ decisionDialog: i(n.decisionDialog, t?.decisionDialog),
89
+ actionSuccess: {
90
+ ...n.actionSuccess,
91
+ ...t?.actionSuccess
92
+ }
22
93
  };
23
- return /* @__PURE__ */ t("div", {
24
- className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2 ttw:p-4 ttw:text-center",
25
- children: [/* @__PURE__ */ e("p", {
26
- className: "ttw:text-sm ttw:text-muted-foreground",
27
- children: a.previewUnavailable
28
- }), /* @__PURE__ */ e("a", {
29
- href: r.url,
30
- target: "_blank",
31
- rel: "noreferrer",
32
- className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:underline ttw:underline-offset-2",
33
- children: a.openFile
34
- })]
35
- });
36
94
  }
37
95
  //#endregion
38
- export { n as SOURCE_DOCUMENT_PREVIEW_LABELS_EN, r as createSourceDocumentPreview };
96
+ export { e as BILL_DETAIL_ACTIONS_LABELS_EN, t as SCHEDULED_SUMMARY_LABEL_EN, a as mergeBillDetailActionsLabels, i as mergeDecisionDialogCopy };