@tesouro/embedded-components-react 0.3.49 → 0.3.50

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 (133) hide show
  1. package/dist/index.css +8 -2
  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/data-access/dist/index.js +11 -10
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +39 -30
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +26 -311
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index12.js +325 -12
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +13 -26
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +20 -40
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +75 -24
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +36 -0
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +80 -68
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +86 -73
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +77 -14
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +18 -63
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +50 -29
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +22 -18
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +82 -30
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -42
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +15 -159
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +23 -33
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +66 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +2 -50
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +3 -4
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +5 -14
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +3 -14
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +31 -63
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +23 -18
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +37 -24
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +161 -61
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +29 -130
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +1 -25
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +47 -4
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +4 -41
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +12 -55
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +13 -4
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +63 -72
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +26 -49
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +23 -23
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +62 -93
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +133 -34
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +20 -163
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +4 -77
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +39 -21
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +5 -210
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +70 -211
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +47 -103
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +92 -12
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +34 -47
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +59 -62
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +163 -29
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +67 -181
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +20 -32
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +203 -94
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +214 -15
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +98 -312
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +16 -4
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +49 -31
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +29 -80
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +183 -156
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +9 -2
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +38 -3
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +102 -2
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +18 -44
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +343 -1
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +4 -8
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +30 -8
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +79 -88
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +179 -3
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +3 -9
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +2 -20
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +4 -2
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -51
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +0 -2
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +6 -126
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +9 -9
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +92 -44
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -23
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +123 -26
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +7 -82
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -48
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +45 -250
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +69 -5
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +21 -113
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +27 -208
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +86 -4
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +47 -5
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +244 -106
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +115 -1
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +201 -16
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +4 -0
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +8 -0
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +115 -0
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +44 -5
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +1 -0
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +25 -0
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +94 -3
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -19
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +1 -0
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +28 -28
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -3
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +6 -16
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +119 -16
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +24 -111
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +89 -2
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +2 -7
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +5 -28
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +30 -2
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +2 -7
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +5 -32
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +34 -2
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +2 -12
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +10 -104
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +105 -1
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -17
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +15 -123
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +125 -2
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -18
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +14 -6
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +7 -167
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +170 -2
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +2 -14
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +11 -105
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +108 -2
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +2 -10
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +8 -45
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +47 -2
  128. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +2 -0
  129. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +23 -23
  130. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +87 -71
  131. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  132. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  133. package/package.json +1 -1
@@ -1,3 +1,179 @@
1
- import "./index54.js";
2
- import "./index55.js";
3
- import "./index56.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 n } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
+ import "../../../shared/data-access/dist/index.js";
9
+ import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
+ import "../../../shared/feature/dist/index.js";
11
+ import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index9.js";
12
+ import { usePayableQuery as a } from "../../data-access/dist/index15.js";
13
+ import "../../data-access/dist/index.js";
14
+ import { resolveVendor as o } from "./index5.js";
15
+ import { BillDecisionDialog as s } from "../../ui/dist/index50.js";
16
+ import { BillDetailsSheet as c } from "../../ui/dist/index56.js";
17
+ import { BillDuplicateNotice as l } from "../../ui/dist/index60.js";
18
+ import { MarkAsPaidDialog as u } from "../../ui/dist/index87.js";
19
+ import "../../ui/dist/index.js";
20
+ import { usePayableDuplicateReview as d } from "./index10.js";
21
+ import "./index11.js";
22
+ import { resolveAmountDueMinorUnits as f } from "./index16.js";
23
+ import { PayBillFlow as p } from "./index22.js";
24
+ import "./index23.js";
25
+ import { mergeMarkAsPaidFlowLabels as m } from "./index12.js";
26
+ import { useMarkAsPaidFlow as h } from "./index14.js";
27
+ import "./index15.js";
28
+ import { mergeDecisionDialogCopy as g } from "./index38.js";
29
+ import { useApprovalPolicyCardView as _ } from "./index28.js";
30
+ import { useCurrentApprovalRequestId as v } from "./index29.js";
31
+ import { usePayableDetailActions as y } from "./index31.js";
32
+ import { useScheduledPayment as b } from "./index32.js";
33
+ import { BILL_DETAILS_LABELS_EN as x } from "./index55.js";
34
+ import { mapPayableToBillDetails as S } from "./index56.js";
35
+ import { useMemo as C, useRef as w } from "react";
36
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
37
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js
38
+ function O(e) {
39
+ return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
40
+ }
41
+ function k({ open: k, onOpenChange: A, payableId: j, onClose: M, onExpand: N, testId: P, labels: F, poweredByBankName: I }) {
42
+ let L = C(() => ({
43
+ ...x,
44
+ ...F,
45
+ sheet: {
46
+ ...x.sheet,
47
+ ...F?.sheet,
48
+ statusBadge: {
49
+ ...x.sheet.statusBadge,
50
+ ...F?.sheet?.statusBadge
51
+ },
52
+ approvalPolicy: {
53
+ ...x.sheet.approvalPolicy,
54
+ ...F?.sheet?.approvalPolicy
55
+ },
56
+ dueDate: {
57
+ ...x.sheet.dueDate,
58
+ ...F?.sheet?.dueDate
59
+ }
60
+ },
61
+ decisionDialog: g(x.decisionDialog, F?.decisionDialog),
62
+ approvalPolicyCopy: {
63
+ ...x.approvalPolicyCopy,
64
+ ...F?.approvalPolicyCopy
65
+ },
66
+ markAsPaid: m(F?.markAsPaid),
67
+ actionSuccess: {
68
+ ...x.actionSuccess,
69
+ ...F?.actionSuccess
70
+ }
71
+ }), [F]), R = a(j), z = i(j), B = n(), V = R.data, H = w(null), U = v({
72
+ payableId: j,
73
+ status: V?.status
74
+ }), W = _({
75
+ payableId: j,
76
+ approvalPolicyId: V?.approval_policy_id,
77
+ copy: L.approvalPolicyCopy
78
+ }), G = b({
79
+ payableId: j,
80
+ scheduledPaymentDate: V?.scheduled_payment_date
81
+ }), K = h({
82
+ payableId: j,
83
+ amountDueMinorUnits: f(V) ?? 0,
84
+ amountToPayMinorUnits: V?.amount_to_pay ?? void 0,
85
+ currencyCode: V?.currency ?? void 0,
86
+ dueDate: V?.due_date,
87
+ hasScheduledPayment: G.hasScheduledPayment,
88
+ testId: P,
89
+ labels: L.markAsPaid
90
+ }), { actions: q, decisionDialog: J } = y({
91
+ payableId: V ? j : void 0,
92
+ status: V?.status,
93
+ currentApprovalRequestId: U.id,
94
+ isPolicyApprover: U.isPolicyApprover,
95
+ hasWaitingRequest: U.hasWaitingRequest,
96
+ hasScheduledPayment: G.hasScheduledPayment,
97
+ scheduledPaymentIntentId: G.scheduledPaymentIntentId,
98
+ isScheduledPaymentUnknown: G.isResolving,
99
+ pendingApprovers: W.pendingApprovers,
100
+ arePendingApproversUnknown: W.isLoading,
101
+ labels: {
102
+ payBill: L.sheet.payButton,
103
+ markAsPaid: L.sheet.markAsPaidButton,
104
+ reject: L.sheet.rejectButton,
105
+ approve: L.sheet.approveButton,
106
+ cancel: L.sheet.cancelButton,
107
+ cancelScheduledPayment: L.sheet.cancelScheduledPaymentButton,
108
+ reopen: L.sheet.reopenButton,
109
+ forceApprove: L.sheet.forceApproveButton,
110
+ forceReject: L.sheet.forceRejectButton,
111
+ policyOverridesHeading: L.sheet.policyOverridesGroup,
112
+ decisionDialog: L.decisionDialog,
113
+ actionError: L.actionError,
114
+ actionSuccess: L.actionSuccess
115
+ },
116
+ isMarkAsPaidPending: K.isPending,
117
+ onMarkAsPaidSelect: K.open,
118
+ onPayBillSelect: () => {
119
+ if (!O(o(V)) && N) {
120
+ N();
121
+ return;
122
+ }
123
+ H.current?.open();
124
+ }
125
+ }), Y = G.hasScheduledPayment && G.scheduledDateLabel ? /* @__PURE__ */ E("p", {
126
+ className: "ttw:text-sm ttw:text-muted-foreground",
127
+ children: L.scheduledSummary(G.scheduledDateLabel)
128
+ }) : void 0, { initResponse: X } = r(), Z = d({
129
+ payable: V,
130
+ canManage: e(X?.scopes, [t.PayableWriteOrg])
131
+ }), Q = Z.isPossibleDuplicate ? /* @__PURE__ */ E(l, {
132
+ onNotADuplicate: Z.onNotADuplicate,
133
+ isActionDisabled: Z.isBusy
134
+ }) : void 0, $ = Q || Y ? /* @__PURE__ */ D(T, { children: [Q, Y] }) : void 0, ee = C(() => V ? S({
135
+ payable: V,
136
+ lineItems: z.lineItems,
137
+ ledgerAccounts: B.data?.data ?? [],
138
+ labels: L,
139
+ hasScheduledPayment: G.hasScheduledPayment
140
+ }) : void 0, [
141
+ V,
142
+ z.lineItems,
143
+ B.data,
144
+ L,
145
+ G.hasScheduledPayment
146
+ ]), te = R.isLoading || z.isResolving || B.isResolving, ne = R.isError || z.isError || B.isError;
147
+ return /* @__PURE__ */ D(T, { children: [
148
+ /* @__PURE__ */ E(c, {
149
+ open: k,
150
+ onOpenChange: A,
151
+ details: ee,
152
+ actions: q,
153
+ approvalPolicy: W.view,
154
+ isLoading: te,
155
+ isError: ne,
156
+ notice: $,
157
+ onClose: M,
158
+ onExpand: N,
159
+ testId: P,
160
+ labels: L.sheet
161
+ }),
162
+ /* @__PURE__ */ E(s, {
163
+ ...J,
164
+ labels: { cancelButton: L.decisionDialog.cancelButton },
165
+ testId: P ? `${P}-decision-dialog` : void 0,
166
+ confirmTestId: P ? `${P}-decision-confirm` : void 0,
167
+ reasonTestId: P ? `${P}-decision-reason` : void 0,
168
+ reasonFieldId: P ? `${P}-decision-reason-field` : void 0
169
+ }),
170
+ /* @__PURE__ */ E(u, { ...K.dialogProps }),
171
+ V ? /* @__PURE__ */ E(p, {
172
+ ref: H,
173
+ payable: V,
174
+ poweredByBankName: I
175
+ }) : null
176
+ ] });
177
+ }
178
+ //#endregion
179
+ export { k as BillDetailsContainer, k as default };
@@ -1,9 +1,3 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js
2
- var e = {
3
- duplicateBadge: "Duplicate?",
4
- existingBadge: "Existing",
5
- selectRow: ({ vendorLabel: e, designation: t, invoiceNumberLabel: n, addedOnLabel: r }) => `Select bill — ${e}, ${t}, invoice ${n}, added ${r}`,
6
- openRow: ({ vendorLabel: e, designation: t, invoiceNumberLabel: n, addedOnLabel: r }) => `View bill — ${e}, ${t}, invoice ${n}, added ${r}`
7
- };
8
- //#endregion
9
- export { e as DUPLICATE_BILLS_LABELS_EN };
1
+ import "./index55.js";
2
+ import "./index56.js";
3
+ import "./index57.js";
@@ -1,22 +1,4 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useCallback as e, useMemo as t, useState as n } from "react";
6
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js
7
- function r({ rowIds: r }) {
8
- let [i, a] = n([]), o = e((e) => {
9
- a((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
10
- }, []), s = t(() => r.filter((e) => i.includes(e)), [r, i]), c = r.length > 0 && s.length === r.length, l = e(() => {
11
- a(c ? [] : [...r]);
12
- }, [c, r]);
13
- return {
14
- selectedIds: s,
15
- isSelected: e((e) => i.includes(e), [i]),
16
- toggleRow: o,
17
- toggleAllRows: l,
18
- selectAllChecked: c ? !0 : s.length > 0 && "indeterminate"
19
- };
20
- }
2
+ var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
21
3
  //#endregion
22
- export { r as useDuplicateBillsSelection };
4
+ export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1,6 +1,8 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js
2
2
  function e(e) {
3
- return e?.amount_due ?? e?.total_amount ?? void 0;
3
+ if (e === "draft") return "delete";
4
+ if (e === "new") return "cancel";
5
+ if (e === "canceled") return "confirm";
4
6
  }
5
7
  //#endregion
6
- export { e as resolveAmountDueMinorUnits };
8
+ export { e as payableRemoval };
@@ -2,58 +2,45 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { DuplicateBillsDialog as e } from "../../ui/dist/index74.js";
6
- import "../../ui/dist/index.js";
7
- import { DUPLICATE_BILLS_LABELS_EN as t } from "./index58.js";
8
- import { useDuplicateBillsSelection as n } from "./index59.js";
9
- import { useMemo as r } from "react";
10
- import { jsx as i } from "react/jsx-runtime";
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 "./index59.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";
11
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js
12
- var a = [];
13
- function o({ open: o, onOpenChange: s, bills: c = a, canManageDuplicates: l = !0, onOpenBill: u, labels: d, dialogLabels: f }) {
14
- let p = r(() => ({
15
- ...t,
16
- ...d
17
- }), [d]), m = r(() => c.map((e) => e.id), [c]), { selectedIds: h, isSelected: g, toggleRow: _, toggleAllRows: v, selectAllChecked: y } = n({ rowIds: m }), b = r(() => c.map((e) => {
18
- let t = e.isPossibleDuplicate ? p.duplicateBadge : p.existingBadge, n = {
19
- vendorLabel: e.vendorLabel,
20
- designation: t,
21
- invoiceNumberLabel: e.invoiceNumberLabel,
22
- addedOnLabel: e.addedOnLabel
23
- };
24
- return {
25
- ...e,
26
- duplicateBadge: {
27
- label: t,
28
- tone: e.isPossibleDuplicate ? "warning" : "success"
29
- },
30
- selectLabel: p.selectRow(n),
31
- openLabel: p.openRow(n),
32
- isSelected: g(e.id),
33
- onToggleSelected: () => _(e.id),
34
- onOpen: () => u?.(e.id)
35
- };
36
- }), [
37
- c,
38
- g,
39
- p,
40
- _,
41
- u
42
- ]), x = () => {
43
- if (h.length === 0) throw Error("Duplicate review action taken with no bills selected — keep and cancel both need a subject.");
44
- s(!1);
45
- };
46
- return /* @__PURE__ */ i(e, {
47
- open: o,
48
- onOpenChange: s,
49
- rows: b,
50
- selectAllChecked: y,
51
- onToggleAllRows: v,
52
- onKeepSelected: l ? x : void 0,
53
- onCancelDuplicates: l ? x : void 0,
54
- isActionDisabled: h.length === 0,
55
- labels: f
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
+ })
56
43
  });
57
44
  }
58
45
  //#endregion
59
- export { o as DuplicateBillsContainer, o as default };
46
+ export { l as BillPayWidgetMonite, l as default };
@@ -1,3 +1 @@
1
- import "./index58.js";
2
- import "./index59.js";
3
1
  import "./index60.js";
@@ -1,128 +1,8 @@
1
- import { BillColumn as e } from "../../ui/dist/index66.js";
2
- import "../../ui/dist/index.js";
3
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js
4
- var t = {
5
- Drafts: "drafts",
6
- Pending: "pending",
7
- Scheduled: "scheduled",
8
- Paid: "paid",
9
- All: "all"
10
- }, n = {
11
- [t.Drafts]: ["draft"],
12
- [t.Pending]: [
13
- "new",
14
- "approve_in_progress",
15
- "waiting_to_be_paid",
16
- "partially_paid"
17
- ],
18
- [t.Scheduled]: [
19
- "new",
20
- "approve_in_progress",
21
- "waiting_to_be_paid",
22
- "partially_paid"
23
- ],
24
- [t.Paid]: ["paid"],
25
- [t.All]: void 0
26
- }, r = {
27
- [t.Drafts]: void 0,
28
- [t.Pending]: !1,
29
- [t.Scheduled]: !0,
30
- [t.Paid]: void 0,
31
- [t.All]: void 0
32
- };
33
- function i(e) {
34
- return e === t.Pending || e === t.Drafts;
35
- }
36
- var a = t.Pending, o = [
37
- t.Pending,
38
- t.Drafts,
39
- t.Scheduled,
40
- t.Paid,
41
- t.All
42
- ], s = {
43
- [t.Drafts]: [
44
- e.Vendor,
45
- e.Attachment,
46
- e.IssueDate,
47
- e.DueDate,
48
- e.Status,
49
- e.AmountDue,
50
- e.TotalAmount,
51
- e.AddedOn
52
- ],
53
- [t.Pending]: [
54
- e.Vendor,
55
- e.Attachment,
56
- e.IssueDate,
57
- e.DueDate,
58
- e.Status,
59
- e.AmountDue,
60
- e.TotalAmount,
61
- e.AddedOn
62
- ],
63
- [t.Scheduled]: [
64
- e.Vendor,
65
- e.Attachment,
66
- e.IssueDate,
67
- e.DueDate,
68
- e.ScheduledDate,
69
- e.Status,
70
- e.AmountScheduled,
71
- e.TotalAmount,
72
- e.AddedOn
73
- ],
74
- [t.Paid]: [
75
- e.Vendor,
76
- e.Attachment,
77
- e.IssueDate,
78
- e.DueDate,
79
- e.PaidDate,
80
- e.Status,
81
- e.AmountPaid,
82
- e.TotalAmount,
83
- e.AddedOn
84
- ],
85
- [t.All]: [
86
- e.Vendor,
87
- e.Attachment,
88
- e.IssueDate,
89
- e.DueDate,
90
- e.ScheduledDate,
91
- e.Status,
92
- e.AmountDue,
93
- e.AmountPaid,
94
- e.TotalAmount,
95
- e.AddedOn
96
- ]
97
- };
98
- function c(e) {
99
- return s[e];
100
- }
101
- function l(e) {
102
- let t = n[e];
103
- return t ? [...t] : void 0;
104
- }
105
- function u(e) {
106
- return r[e];
107
- }
108
- var d = {
109
- vendorLabel: "counterpart_name",
110
- issueDateLabel: "issued_at",
111
- dueDateLabel: "due_date",
112
- scheduledDateLabel: "scheduled_payment_date",
113
- addedOnLabel: "created_at"
114
- }, f = {
115
- [e.Vendor]: "vendorLabel",
116
- [e.IssueDate]: "issueDateLabel",
117
- [e.DueDate]: "dueDateLabel",
118
- [e.ScheduledDate]: "scheduledDateLabel",
119
- [e.AddedOn]: "addedOnLabel"
120
- };
121
- function p(e) {
122
- return f[e];
123
- }
124
- function m(e) {
125
- if (e) return d[e];
126
- }
2
+ var e = (e) => [
3
+ "bill-pay",
4
+ "upload-queue",
5
+ e ?? ""
6
+ ];
127
7
  //#endregion
128
- export { s as BILL_QUEUE_COLUMNS, r as BILL_QUEUE_HAS_SCHEDULED_PAYMENT, o as BILL_QUEUE_ORDER, n as BILL_QUEUE_STATUSES, d as BILL_SORT_FIELDS, t as BillQueue, a as DEFAULT_BILL_QUEUE, c as billQueueColumns, u as billQueueHasScheduledPayment, i as billQueueOffersAddPanel, l as billQueueStatuses, p as billSortColumnId, m as billSortField };
8
+ export { e as billPayUploadQueueKey };
@@ -1,11 +1,11 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js
2
- async function e(e) {
3
- if (!e.trim()) return !1;
4
- try {
5
- return await navigator.clipboard.writeText(e), !0;
6
- } catch {
7
- return !1;
8
- }
9
- }
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
+ };
10
10
  //#endregion
11
- export { e as copyTextToClipboard };
11
+ export { e as BILL_UPLOAD_QUEUE_LABELS_EN };
@@ -1,46 +1,94 @@
1
- import { BillQueue as e } from "./index62.js";
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/index12.js";
9
+ import { usePayableOcrQueries as r } from "../../data-access/dist/index14.js";
10
+ import "../../data-access/dist/index.js";
11
+ import { billPayUploadQueueKey as i } from "./index62.js";
12
+ import { BILL_UPLOAD_QUEUE_LABELS_EN as a } from "./index63.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";
2
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js
3
- var t = {
4
- [e.Drafts]: "Drafts",
5
- [e.Pending]: "Pending",
6
- [e.Scheduled]: "Scheduled",
7
- [e.Paid]: "Paid",
8
- [e.All]: "All bills"
9
- }, n = {
10
- [e.Drafts]: {
11
- title: "No drafts",
12
- description: "Bills wait here until someone submits them for approval."
13
- },
14
- [e.Pending]: {
15
- title: "Nothing to act on",
16
- description: "Every bill has been paid, scheduled, or is still a draft."
17
- },
18
- [e.Scheduled]: {
19
- title: "No scheduled bills",
20
- description: "Bills appear here once a payment date is set for them."
21
- },
22
- [e.Paid]: {
23
- title: "No paid bills",
24
- description: "Bills appear here once their payment has gone out."
25
- },
26
- [e.All]: {
27
- title: "No bills",
28
- description: "Bills appear here as soon as they are added."
29
- }
30
- }, r = {
31
- duplicateWarningOne: "1 possible duplicate bill found",
32
- duplicateWarningMany: (e) => `${e} possible duplicate bills found`,
33
- duplicateBadge: "Duplicate?",
34
- attachmentIndicator: "Has an attachment",
35
- emptyHeading: "Add your first bill",
36
- nonEmptyHeading: "Add a bill",
37
- createButton: "Add bill",
38
- emailCopiedToast: "Email address copied to clipboard",
39
- emailCopyFailedToast: "Could not copy the email address",
40
- queues: t,
41
- queueEmptyStates: n,
42
- filters: {},
43
- filterBar: {}
44
- };
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
+ }
45
93
  //#endregion
46
- export { r as BILLS_TAB_LABELS_EN, n as BILL_QUEUE_EMPTY_STATES_EN, t as BILL_QUEUE_LABELS_EN };
94
+ export { f as useBillUploadQueue };
@@ -1,23 +1,3 @@
1
- import { BillColumn as e } from "../../ui/dist/index66.js";
2
- import "../../ui/dist/index.js";
3
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js
4
- var t = {
5
- root: "bill-pay-bills-tab",
6
- uploadTray: "bill-pay-upload-tray",
7
- detailsSheet: "bill-pay-details-sheet"
8
- }, n = {
9
- [e.Vendor]: "bill-pay-bills-cell-vendor",
10
- [e.Attachment]: "bill-pay-bills-cell-attachment",
11
- [e.IssueDate]: "bill-pay-bills-cell-issue-date",
12
- [e.DueDate]: "bill-pay-bills-cell-due-date",
13
- [e.ScheduledDate]: "bill-pay-bills-cell-scheduled-date",
14
- [e.PaidDate]: "bill-pay-bills-cell-paid-date",
15
- [e.Status]: "bill-pay-bills-cell-status",
16
- [e.AmountDue]: "bill-pay-bills-cell-amount-due",
17
- [e.AmountScheduled]: "bill-pay-bills-cell-amount-scheduled",
18
- [e.AmountPaid]: "bill-pay-bills-cell-amount-paid",
19
- [e.TotalAmount]: "bill-pay-bills-cell-total-amount",
20
- [e.AddedOn]: "bill-pay-bills-cell-added-on"
21
- };
22
- //#endregion
23
- export { t as billsTabTestIds, n as billsTableCellTestIds };
1
+ import "./index62.js";
2
+ import "./index63.js";
3
+ import "./index64.js";