@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,167 +1,85 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAllLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
6
- import "../../../shared/data-access/dist/index.js";
7
- import { resolveAmountDueMinorUnits as t } from "./index6.js";
8
- import { resolveVendor as n } from "./index7.js";
9
- import { BillDecisionDialog as r } from "../../ui/dist/index50.js";
10
- import { BillDetailsSheet as i } from "../../ui/dist/index56.js";
11
- import { BillDuplicateNotice as a } from "../../ui/dist/index60.js";
12
- import { MarkAsPaidDialog as o } from "../../ui/dist/index86.js";
13
- import "../../ui/dist/index.js";
14
- import { useAllPayableLineItemsQuery as s } from "../../data-access/dist/index8.js";
15
- import { usePayableQuery as c } from "../../data-access/dist/index14.js";
16
- import "../../data-access/dist/index.js";
17
- import { PayBillFlow as l } from "./index13.js";
18
- import "./index14.js";
19
- import { mergeMarkAsPaidFlowLabels as u } from "./index2.js";
20
- import { useMarkAsPaidFlow as d } from "./index4.js";
21
- import "./index5.js";
22
- import { mergeDecisionDialogCopy as f } from "./index29.js";
23
- import { useApprovalPolicyCardView as p } from "./index19.js";
24
- import { useCurrentApprovalRequestId as m } from "./index20.js";
25
- import { usePayableDetailActions as h } from "./index22.js";
26
- import { useScheduledPayment as g } from "./index23.js";
27
- import { BILL_DETAILS_LABELS_EN as _ } from "./index46.js";
28
- import { mapPayableToBillDetails as v } from "./index47.js";
29
- import { useMemo as y, useRef as b } from "react";
30
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
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 "./index26.js";
4
+ import { formatBillMoney as i } from "./index27.js";
31
5
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js
32
- function w(e) {
33
- return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
34
- }
35
- function T({ open: T, onOpenChange: E, payableId: D, onClose: O, onExpand: k, testId: A, labels: j, poweredByBankName: M, isPossibleDuplicate: N }) {
36
- let P = y(() => ({
37
- ..._,
38
- ...j,
39
- sheet: {
40
- ..._.sheet,
41
- ...j?.sheet,
42
- statusBadge: {
43
- ..._.sheet.statusBadge,
44
- ...j?.sheet?.statusBadge
45
- },
46
- approvalPolicy: {
47
- ..._.sheet.approvalPolicy,
48
- ...j?.sheet?.approvalPolicy
49
- },
50
- dueDate: {
51
- ..._.sheet.dueDate,
52
- ...j?.sheet?.dueDate
53
- }
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
54
30
  },
55
- decisionDialog: f(_.decisionDialog, j?.decisionDialog),
56
- approvalPolicyCopy: {
57
- ..._.approvalPolicyCopy,
58
- ...j?.approvalPolicyCopy
31
+ {
32
+ label: c.dueDateRow,
33
+ value: _
59
34
  },
60
- markAsPaid: u(j?.markAsPaid),
61
- actionSuccess: {
62
- ..._.actionSuccess,
63
- ...j?.actionSuccess
35
+ {
36
+ label: c.poNumberRow,
37
+ value: c.notProvided
64
38
  }
65
- }), [j]), F = c(D), I = s(D), L = e(), R = F.data, z = b(null), B = m({
66
- payableId: D,
67
- status: R?.status
68
- }), V = p({
69
- payableId: D,
70
- approvalPolicyId: R?.approval_policy_id,
71
- copy: P.approvalPolicyCopy
72
- }), H = g({
73
- payableId: D,
74
- scheduledPaymentDate: R?.scheduled_payment_date
75
- }), U = d({
76
- payableId: D,
77
- amountDueMinorUnits: t(R) ?? 0,
78
- amountToPayMinorUnits: R?.amount_to_pay ?? void 0,
79
- currencyCode: R?.currency ?? void 0,
80
- dueDate: R?.due_date,
81
- hasScheduledPayment: H.hasScheduledPayment,
82
- testId: A,
83
- labels: P.markAsPaid
84
- }), { actions: W, decisionDialog: G } = h({
85
- payableId: R ? D : void 0,
86
- status: R?.status,
87
- currentApprovalRequestId: B.id,
88
- isPolicyApprover: B.isPolicyApprover,
89
- hasWaitingRequest: B.hasWaitingRequest,
90
- hasScheduledPayment: H.hasScheduledPayment,
91
- scheduledPaymentIntentId: H.scheduledPaymentIntentId,
92
- isScheduledPaymentUnknown: H.isResolving,
93
- pendingApprovers: V.pendingApprovers,
94
- arePendingApproversUnknown: V.isLoading,
95
- labels: {
96
- payBill: P.sheet.payButton,
97
- markAsPaid: P.sheet.markAsPaidButton,
98
- reject: P.sheet.rejectButton,
99
- approve: P.sheet.approveButton,
100
- cancel: P.sheet.cancelButton,
101
- cancelScheduledPayment: P.sheet.cancelScheduledPaymentButton,
102
- reopen: P.sheet.reopenButton,
103
- forceApprove: P.sheet.forceApproveButton,
104
- forceReject: P.sheet.forceRejectButton,
105
- policyOverridesHeading: P.sheet.policyOverridesGroup,
106
- decisionDialog: P.decisionDialog,
107
- actionError: P.actionError,
108
- actionSuccess: P.actionSuccess
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
109
56
  },
110
- isMarkAsPaidPending: U.isPending,
111
- onMarkAsPaidSelect: U.open,
112
- onPayBillSelect: () => {
113
- if (!w(n(R)) && k) {
114
- k();
115
- return;
116
- }
117
- z.current?.open();
57
+ {
58
+ label: c.taxRow,
59
+ value: a.tax_amount
118
60
  }
119
- }), K = H.hasScheduledPayment && H.scheduledDateLabel ? /* @__PURE__ */ S("p", {
120
- className: "ttw:text-sm ttw:text-muted-foreground",
121
- children: P.scheduledSummary(H.scheduledDateLabel)
122
- }) : void 0, q = N ? /* @__PURE__ */ S(a, {}) : void 0, J = q || K ? /* @__PURE__ */ C(x, { children: [q, K] }) : void 0, Y = y(() => R ? v({
123
- payable: R,
124
- lineItems: I.lineItems,
125
- ledgerAccounts: L.data?.data ?? [],
126
- labels: P,
127
- hasScheduledPayment: H.hasScheduledPayment
128
- }) : void 0, [
129
- R,
130
- I.lineItems,
131
- L.data,
132
- P,
133
- H.hasScheduledPayment
134
- ]), X = F.isLoading || I.isResolving || L.isResolving, Z = F.isError || I.isError || L.isError;
135
- return /* @__PURE__ */ C(x, { children: [
136
- /* @__PURE__ */ S(i, {
137
- open: T,
138
- onOpenChange: E,
139
- details: Y,
140
- actions: W,
141
- approvalPolicy: V.view,
142
- isLoading: X,
143
- isError: Z,
144
- notice: J,
145
- onClose: O,
146
- onExpand: k,
147
- testId: A,
148
- labels: P.sheet
149
- }),
150
- /* @__PURE__ */ S(r, {
151
- ...G,
152
- labels: { cancelButton: P.decisionDialog.cancelButton },
153
- testId: A ? `${A}-decision-dialog` : void 0,
154
- confirmTestId: A ? `${A}-decision-confirm` : void 0,
155
- reasonTestId: A ? `${A}-decision-reason` : void 0,
156
- reasonFieldId: A ? `${A}-decision-reason-field` : void 0
157
- }),
158
- /* @__PURE__ */ S(o, { ...U.dialogProps }),
159
- R ? /* @__PURE__ */ S(l, {
160
- ref: z,
161
- payable: R,
162
- poweredByBankName: M
163
- }) : null
164
- ] });
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
+ };
165
83
  }
166
84
  //#endregion
167
- export { T as BillDetailsContainer, T as default };
85
+ export { a as mapPayableToBillDetails };
@@ -1,3 +1,167 @@
1
- import "./index46.js";
2
- import "./index47.js";
3
- import "./index48.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAllLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
6
+ import "../../../shared/data-access/dist/index.js";
7
+ import { resolveAmountDueMinorUnits as t } from "./index6.js";
8
+ import { resolveVendor as n } from "./index7.js";
9
+ import { BillDecisionDialog as r } from "../../ui/dist/index50.js";
10
+ import { BillDetailsSheet as i } from "../../ui/dist/index56.js";
11
+ import { BillDuplicateNotice as a } from "../../ui/dist/index60.js";
12
+ import { MarkAsPaidDialog as o } from "../../ui/dist/index86.js";
13
+ import "../../ui/dist/index.js";
14
+ import { useAllPayableLineItemsQuery as s } from "../../data-access/dist/index8.js";
15
+ import { usePayableQuery as c } from "../../data-access/dist/index14.js";
16
+ import "../../data-access/dist/index.js";
17
+ import { PayBillFlow as l } from "./index13.js";
18
+ import "./index14.js";
19
+ import { mergeMarkAsPaidFlowLabels as u } from "./index2.js";
20
+ import { useMarkAsPaidFlow as d } from "./index4.js";
21
+ import "./index5.js";
22
+ import { mergeDecisionDialogCopy as f } from "./index30.js";
23
+ import { useApprovalPolicyCardView as p } from "./index19.js";
24
+ import { useCurrentApprovalRequestId as m } from "./index20.js";
25
+ import { usePayableDetailActions as h } from "./index22.js";
26
+ import { useScheduledPayment as g } from "./index23.js";
27
+ import { BILL_DETAILS_LABELS_EN as _ } from "./index47.js";
28
+ import { mapPayableToBillDetails as v } from "./index48.js";
29
+ import { useMemo as y, useRef as b } from "react";
30
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
31
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js
32
+ function w(e) {
33
+ return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
34
+ }
35
+ function T({ open: T, onOpenChange: E, payableId: D, onClose: O, onExpand: k, testId: A, labels: j, poweredByBankName: M, isPossibleDuplicate: N }) {
36
+ let P = y(() => ({
37
+ ..._,
38
+ ...j,
39
+ sheet: {
40
+ ..._.sheet,
41
+ ...j?.sheet,
42
+ statusBadge: {
43
+ ..._.sheet.statusBadge,
44
+ ...j?.sheet?.statusBadge
45
+ },
46
+ approvalPolicy: {
47
+ ..._.sheet.approvalPolicy,
48
+ ...j?.sheet?.approvalPolicy
49
+ },
50
+ dueDate: {
51
+ ..._.sheet.dueDate,
52
+ ...j?.sheet?.dueDate
53
+ }
54
+ },
55
+ decisionDialog: f(_.decisionDialog, j?.decisionDialog),
56
+ approvalPolicyCopy: {
57
+ ..._.approvalPolicyCopy,
58
+ ...j?.approvalPolicyCopy
59
+ },
60
+ markAsPaid: u(j?.markAsPaid),
61
+ actionSuccess: {
62
+ ..._.actionSuccess,
63
+ ...j?.actionSuccess
64
+ }
65
+ }), [j]), F = c(D), I = s(D), L = e(), R = F.data, z = b(null), B = m({
66
+ payableId: D,
67
+ status: R?.status
68
+ }), V = p({
69
+ payableId: D,
70
+ approvalPolicyId: R?.approval_policy_id,
71
+ copy: P.approvalPolicyCopy
72
+ }), H = g({
73
+ payableId: D,
74
+ scheduledPaymentDate: R?.scheduled_payment_date
75
+ }), U = d({
76
+ payableId: D,
77
+ amountDueMinorUnits: t(R) ?? 0,
78
+ amountToPayMinorUnits: R?.amount_to_pay ?? void 0,
79
+ currencyCode: R?.currency ?? void 0,
80
+ dueDate: R?.due_date,
81
+ hasScheduledPayment: H.hasScheduledPayment,
82
+ testId: A,
83
+ labels: P.markAsPaid
84
+ }), { actions: W, decisionDialog: G } = h({
85
+ payableId: R ? D : void 0,
86
+ status: R?.status,
87
+ currentApprovalRequestId: B.id,
88
+ isPolicyApprover: B.isPolicyApprover,
89
+ hasWaitingRequest: B.hasWaitingRequest,
90
+ hasScheduledPayment: H.hasScheduledPayment,
91
+ scheduledPaymentIntentId: H.scheduledPaymentIntentId,
92
+ isScheduledPaymentUnknown: H.isResolving,
93
+ pendingApprovers: V.pendingApprovers,
94
+ arePendingApproversUnknown: V.isLoading,
95
+ labels: {
96
+ payBill: P.sheet.payButton,
97
+ markAsPaid: P.sheet.markAsPaidButton,
98
+ reject: P.sheet.rejectButton,
99
+ approve: P.sheet.approveButton,
100
+ cancel: P.sheet.cancelButton,
101
+ cancelScheduledPayment: P.sheet.cancelScheduledPaymentButton,
102
+ reopen: P.sheet.reopenButton,
103
+ forceApprove: P.sheet.forceApproveButton,
104
+ forceReject: P.sheet.forceRejectButton,
105
+ policyOverridesHeading: P.sheet.policyOverridesGroup,
106
+ decisionDialog: P.decisionDialog,
107
+ actionError: P.actionError,
108
+ actionSuccess: P.actionSuccess
109
+ },
110
+ isMarkAsPaidPending: U.isPending,
111
+ onMarkAsPaidSelect: U.open,
112
+ onPayBillSelect: () => {
113
+ if (!w(n(R)) && k) {
114
+ k();
115
+ return;
116
+ }
117
+ z.current?.open();
118
+ }
119
+ }), K = H.hasScheduledPayment && H.scheduledDateLabel ? /* @__PURE__ */ S("p", {
120
+ className: "ttw:text-sm ttw:text-muted-foreground",
121
+ children: P.scheduledSummary(H.scheduledDateLabel)
122
+ }) : void 0, q = N ? /* @__PURE__ */ S(a, {}) : void 0, J = q || K ? /* @__PURE__ */ C(x, { children: [q, K] }) : void 0, Y = y(() => R ? v({
123
+ payable: R,
124
+ lineItems: I.lineItems,
125
+ ledgerAccounts: L.data?.data ?? [],
126
+ labels: P,
127
+ hasScheduledPayment: H.hasScheduledPayment
128
+ }) : void 0, [
129
+ R,
130
+ I.lineItems,
131
+ L.data,
132
+ P,
133
+ H.hasScheduledPayment
134
+ ]), X = F.isLoading || I.isResolving || L.isResolving, Z = F.isError || I.isError || L.isError;
135
+ return /* @__PURE__ */ C(x, { children: [
136
+ /* @__PURE__ */ S(i, {
137
+ open: T,
138
+ onOpenChange: E,
139
+ details: Y,
140
+ actions: W,
141
+ approvalPolicy: V.view,
142
+ isLoading: X,
143
+ isError: Z,
144
+ notice: J,
145
+ onClose: O,
146
+ onExpand: k,
147
+ testId: A,
148
+ labels: P.sheet
149
+ }),
150
+ /* @__PURE__ */ S(r, {
151
+ ...G,
152
+ labels: { cancelButton: P.decisionDialog.cancelButton },
153
+ testId: A ? `${A}-decision-dialog` : void 0,
154
+ confirmTestId: A ? `${A}-decision-confirm` : void 0,
155
+ reasonTestId: A ? `${A}-decision-reason` : void 0,
156
+ reasonFieldId: A ? `${A}-decision-reason-field` : void 0
157
+ }),
158
+ /* @__PURE__ */ S(o, { ...U.dialogProps }),
159
+ R ? /* @__PURE__ */ S(l, {
160
+ ref: z,
161
+ payable: R,
162
+ poweredByBankName: M
163
+ }) : null
164
+ ] });
165
+ }
166
+ //#endregion
167
+ export { T as BillDetailsContainer, T as default };
@@ -1,4 +1,3 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js
2
- var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
3
- //#endregion
4
- export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
1
+ import "./index47.js";
2
+ import "./index48.js";
3
+ import "./index49.js";
@@ -1,46 +1,4 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import "../../../shared/feature/dist/index.js";
7
- import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index50.js";
8
- import { Payables as r } from "../../../monite-sdk/dist/index443.js";
9
- import "../../../monite-sdk/dist/index.js";
10
- import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
- import "../../../shared/monite-wrapper/feature/dist/index.js";
12
- import { useEffect as a } from "react";
13
- import { jsx as o } from "react/jsx-runtime";
14
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js
15
- var s = (e) => e;
16
- function c(n) {
17
- let i = e();
18
- return a(() => {
19
- i(t.Mounted);
20
- }, [i]), /* @__PURE__ */ o(r, { ...n });
21
- }
22
- function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, providerLabels: v, pageTitleComponent: y = s, ...b }) {
23
- return /* @__PURE__ */ o(i, {
24
- widgetName: n,
25
- baseUrl: e,
26
- widgetToken: t,
27
- organizationId: r,
28
- configClient: a,
29
- gatewayRouting: l,
30
- linkComponent: u,
31
- implementation: d,
32
- uiFramework: f,
33
- errorFallback: p,
34
- onError: m,
35
- finopsThemeColors: h,
36
- analytics: g,
37
- disclosuresAcceptance: _,
38
- providerLabels: v,
39
- children: /* @__PURE__ */ o(c, {
40
- ...b,
41
- pageTitleComponent: y
42
- })
43
- });
44
- }
2
+ var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
45
3
  //#endregion
46
- export { l as BillPayWidgetMonite, l as default };
4
+ export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1 +1,46 @@
1
- import "./index51.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
+ import "../../../shared/feature/dist/index.js";
7
+ import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index51.js";
8
+ import { Payables as r } from "../../../monite-sdk/dist/index443.js";
9
+ import "../../../monite-sdk/dist/index.js";
10
+ import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
+ import "../../../shared/monite-wrapper/feature/dist/index.js";
12
+ import { useEffect as a } from "react";
13
+ import { jsx as o } from "react/jsx-runtime";
14
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js
15
+ var s = (e) => e;
16
+ function c(n) {
17
+ let i = e();
18
+ return a(() => {
19
+ i(t.Mounted);
20
+ }, [i]), /* @__PURE__ */ o(r, { ...n });
21
+ }
22
+ function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, providerLabels: v, pageTitleComponent: y = s, ...b }) {
23
+ return /* @__PURE__ */ o(i, {
24
+ widgetName: n,
25
+ baseUrl: e,
26
+ widgetToken: t,
27
+ organizationId: r,
28
+ configClient: a,
29
+ gatewayRouting: l,
30
+ linkComponent: u,
31
+ implementation: d,
32
+ uiFramework: f,
33
+ errorFallback: p,
34
+ onError: m,
35
+ finopsThemeColors: h,
36
+ analytics: g,
37
+ disclosuresAcceptance: _,
38
+ providerLabels: v,
39
+ children: /* @__PURE__ */ o(c, {
40
+ ...b,
41
+ pageTitleComponent: y
42
+ })
43
+ });
44
+ }
45
+ //#endregion
46
+ export { l as BillPayWidgetMonite, l as default };
@@ -1,8 +1 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js
2
- var e = (e) => [
3
- "bill-pay",
4
- "upload-queue",
5
- e ?? ""
6
- ];
7
- //#endregion
8
- export { e as billPayUploadQueueKey };
1
+ import "./index52.js";
@@ -1,11 +1,8 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js
2
- var e = {
3
- uploadingSummary: (e) => `Uploading and scanning ${e} ${e === 1 ? "file" : "files"}`,
4
- completeSummary: (e) => `${e} ${e === 1 ? "upload" : "uploads"} complete`,
5
- readyCaption: (e) => `${e} new ${e === 1 ? "bill" : "bills"} ready`,
6
- failedCaption: (e) => `${e} failed to upload`,
7
- tooManyFilesError: (e) => `You can only upload up to ${e} files at a time`,
8
- remainingCapacityError: (e) => e === 0 ? "Wait for the current uploads to finish before adding more files" : `You can upload ${e} more ${e === 1 ? "file" : "files"} right now`
9
- };
2
+ var e = (e) => [
3
+ "bill-pay",
4
+ "upload-queue",
5
+ e ?? ""
6
+ ];
10
7
  //#endregion
11
- export { e as BILL_UPLOAD_QUEUE_LABELS_EN };
8
+ export { e as billPayUploadQueueKey };
@@ -1,94 +1,11 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
- import "../../../shared/ui/dist/index.js";
8
- import { useUploadPayableFromFileMutation as n } from "../../data-access/dist/index11.js";
9
- import { usePayableOcrQueries as r } from "../../data-access/dist/index13.js";
10
- import "../../data-access/dist/index.js";
11
- import { billPayUploadQueueKey as i } from "./index53.js";
12
- import { BILL_UPLOAD_QUEUE_LABELS_EN as a } from "./index54.js";
13
- import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
14
- import { useQuery as u, useQueryClient as d } from "@tanstack/react-query";
15
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js
16
- function f({ onOpenBill: f, labels: p } = {}) {
17
- let m = {
18
- ...a,
19
- ...p
20
- }, h = p?.tooManyFilesError ?? a.tooManyFilesError, g = p?.remainingCapacityError ?? a.remainingCapacityError, { organizationId: _ } = t(), v = d(), y = c(() => i(_), [_]), b = n(), [x, S] = l(!1), { data: C = [] } = u({
21
- queryKey: y,
22
- queryFn: () => v.getQueryData(y) ?? [],
23
- staleTime: Infinity,
24
- gcTime: Infinity,
25
- initialData: []
26
- }), w = o((e, t) => {
27
- v.setQueryData(y, (n) => (n ?? []).map((n) => n.localId === e ? {
28
- ...n,
29
- ...t
30
- } : n));
31
- }, [v, y]), T = o((t) => {
32
- let n = (v.getQueryData(y) ?? []).filter((e) => e.status === "uploading").length;
33
- if (t.length + n > 10) {
34
- e.error(n > 0 ? g(10 - n) : h(10));
35
- return;
36
- }
37
- S(!1);
38
- for (let e of t) {
39
- let t = crypto.randomUUID();
40
- v.setQueryData(y, (n) => [...n ?? [], {
41
- localId: t,
42
- fileName: e.name,
43
- status: "uploading"
44
- }]), b.mutateAsync({ file: e }).then((e) => w(t, { payableId: e?.id })).catch(() => w(t, { status: "failed" }));
45
- }
46
- }, [
47
- w,
48
- v,
49
- y,
50
- g,
51
- h,
52
- b
53
- ]), E = r({ payableIds: C.filter((e) => e.status === "uploading" && e.payableId).map((e) => e.payableId) });
54
- s(() => {
55
- for (let { payableId: e, ocrStatus: t, isError: n } of E) {
56
- let r = C.find((t) => t.payableId === e && t.status === "uploading");
57
- r && (t === "success" ? w(r.localId, { status: "ready" }) : (n || t === "error" || t === "canceled") && w(r.localId, { status: "failed" }));
58
- }
59
- }, [
60
- C,
61
- E,
62
- w
63
- ]);
64
- let D = C.filter((e) => e.status === "uploading"), O = C.filter((e) => e.status === "ready"), k = C.filter((e) => e.status === "failed"), A = (e) => ({
65
- id: e.localId,
66
- fileName: e.fileName,
67
- status: e.status,
68
- onOpen: e.status === "ready" && e.payableId && f ? () => f(e.payableId) : void 0
69
- }), j = D.length ? [{
70
- id: "in-progress",
71
- items: C.map(A)
72
- }] : [...O.length ? [{
73
- id: "ready",
74
- caption: m.readyCaption(O.length),
75
- items: O.map(A)
76
- }] : [], ...k.length ? [{
77
- id: "failed",
78
- caption: m.failedCaption(k.length),
79
- items: k.map(A)
80
- }] : []], M = D.length ? m.uploadingSummary(C.length) : O.length ? m.completeSummary(O.length) : m.failedCaption(k.length), N = o(() => {
81
- v.setQueryData(y, []);
82
- }, [v, y]);
83
- return {
84
- enqueue: T,
85
- sections: j,
86
- summaryLabel: M,
87
- collapsed: x,
88
- onToggleCollapsed: o(() => S((e) => !e), []),
89
- onClose: N,
90
- isVisible: C.length > 0
91
- };
92
- }
2
+ var e = {
3
+ uploadingSummary: (e) => `Uploading and scanning ${e} ${e === 1 ? "file" : "files"}`,
4
+ completeSummary: (e) => `${e} ${e === 1 ? "upload" : "uploads"} complete`,
5
+ readyCaption: (e) => `${e} new ${e === 1 ? "bill" : "bills"} ready`,
6
+ failedCaption: (e) => `${e} failed to upload`,
7
+ tooManyFilesError: (e) => `You can only upload up to ${e} files at a time`,
8
+ remainingCapacityError: (e) => e === 0 ? "Wait for the current uploads to finish before adding more files" : `You can upload ${e} more ${e === 1 ? "file" : "files"} right now`
9
+ };
93
10
  //#endregion
94
- export { f as useBillUploadQueue };
11
+ export { e as BILL_UPLOAD_QUEUE_LABELS_EN };