@tesouro/embedded-components-react 0.11.141 → 0.11.167

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 (148) hide show
  1. package/NOTICE +24 -0
  2. package/README.md +15 -37
  3. package/dist/experimental/BalanceHistoryWidget.d.ts +0 -11
  4. package/dist/experimental/QuickViewWidget.d.ts +0 -11
  5. package/dist/experimental/RemoteCheckCapture.d.ts +0 -11
  6. package/dist/experimental/index.d.ts +0 -11
  7. package/dist/fixtures/index.d.ts +27 -1
  8. package/dist/index.css +6976 -6246
  9. package/dist/index.d.ts +64 -173
  10. package/dist/index.js +9 -10
  11. package/dist/lib/AcceptDisclosuresWidget.d.ts +0 -11
  12. package/dist/lib/BalancesWidget.d.ts +0 -11
  13. package/dist/lib/BankAccountOnboardingWidget.d.ts +0 -11
  14. package/dist/lib/BankAccountsWidget.d.ts +2 -11
  15. package/dist/lib/BankingComplianceBannerWidget.d.ts +0 -11
  16. package/dist/lib/BillPayWidget.d.ts +0 -11
  17. package/dist/lib/CardDetailsWidget.d.ts +0 -11
  18. package/dist/lib/CounterpartsWidget.d.ts +1 -12
  19. package/dist/lib/CounterpartsWidgetPublic.d.ts +1 -12
  20. package/dist/lib/CreditCardsWidget.d.ts +0 -11
  21. package/dist/lib/DebitCardsWidget.d.ts +0 -11
  22. package/dist/lib/ExpenseManagementWidget.d.ts +1 -12
  23. package/dist/lib/InsightsWidget.d.ts +0 -11
  24. package/dist/lib/LinkedAccountsWidget.d.ts +0 -11
  25. package/dist/lib/OfferWidget.d.ts +0 -11
  26. package/dist/lib/ReceivablesWidget.d.ts +60 -17
  27. package/dist/lib/ReceivablesWidget.js +3 -2
  28. package/dist/lib/SettingsWidget.d.ts +0 -11
  29. package/dist/lib/TransfersWidget.d.ts +0 -11
  30. package/dist/lib/WidgetProvider.d.ts +0 -11
  31. package/dist/lib/WidgetProviderPublic.d.ts +0 -11
  32. package/dist/lib/WidgetSuite.d.ts +60 -15
  33. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +20 -19
  35. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index10.js +8 -8
  36. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index4.js +2 -3
  37. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index10.js +83 -82
  38. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index4.js +84 -79
  39. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index9.js +2 -1
  40. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/formatters.js +2 -3
  41. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +4 -4
  42. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js +51 -46
  43. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js +2 -1
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +1 -1
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +1 -1
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +1 -1
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +1 -1
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +1 -1
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +1 -1
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index10.js +1 -1
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index4.js +1 -1
  55. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useActivateCard.js +1 -1
  56. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useCardLock.js +1 -1
  57. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/useEditCardNickname.js +1 -1
  58. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +1 -1
  59. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +1 -1
  60. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index7.js +1 -1
  61. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +10 -9
  62. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -1
  63. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +1 -1
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +2 -2
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +66 -74
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +3 -2
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +351 -318
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +126 -133
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +63 -56
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilter.js +78 -72
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilterLabels.js +2 -1
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +14 -1
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +138 -129
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +119 -0
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusCards.js +37 -28
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/tabs.js +1 -2
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useInvoicesFilter.js +131 -81
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useLocalDayStart.js +15 -0
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +46 -46
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +1 -1
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +13 -13
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +1 -1
  83. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +440 -438
  84. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +7 -7
  85. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentTerms.js +1 -1
  86. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +62 -56
  87. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -1
  88. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +47 -16
  89. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +78 -86
  90. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +180 -158
  91. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useRecurringSeriesTable.js +132 -0
  92. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/invoicing.js +4 -0
  93. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/mocks/receivables.js +153 -137
  94. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -19
  95. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +6 -4
  96. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +1 -1
  97. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +3 -3
  98. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +137 -129
  99. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +21 -46
  100. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +143 -0
  101. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +2 -0
  102. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +47 -0
  103. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +25 -25
  104. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +1 -1
  105. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductDelete.js +1 -1
  106. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/mocks/products.js +3 -11
  107. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/scenarios.js +1 -1
  108. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index2.js +36 -77
  109. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/summarizeCardSpend.js +11 -13
  110. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/useCardSpendSummary.js +20 -17
  111. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +1 -1
  112. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index7.js +1 -1
  113. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js +7 -0
  114. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index7.js +1 -1
  115. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index8.js +1 -1
  116. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index8.js +4 -9
  117. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index12.js +1 -1
  118. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js +2 -3
  119. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +2 -2
  120. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js +1 -1
  121. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index3.js +2 -2
  122. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +1 -1
  123. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
  124. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +43 -43
  125. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +233 -211
  126. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +66 -42
  127. package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +1 -1
  128. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +5 -4
  129. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  130. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +1 -1
  131. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/toasts.js +1 -1
  132. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +28 -28
  133. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/EmbeddedToaster.js +33 -32
  134. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +9 -8
  135. package/dist/node_modules/sonner/dist/index.js +620 -0
  136. package/dist/packages/shared-ui-shadcn/dist/index.js +6072 -6062
  137. package/dist/scenarios/index.d.ts +1 -3
  138. package/dist/scenarios/index.js +17 -20
  139. package/package.json +17 -4
  140. package/dist/lib/CustomersWidget.d.ts +0 -993
  141. package/dist/lib/CustomersWidget.js +0 -2
  142. package/dist/lib/ProductsWidget.d.ts +0 -893
  143. package/dist/lib/ProductsWidget.js +0 -2
  144. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index.js +0 -1
  145. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/CustomersWidget/CustomersWidget.js +0 -41
  146. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/analytics/events.js +0 -3
  147. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/scenarios.js +0 -2
  148. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useUtcDayStart.js +0 -15
@@ -108,24 +108,17 @@ function v(e, t) {
108
108
  completed: t.detailsSeriesStatusCompleted
109
109
  }[e] ?? "";
110
110
  }
111
- var y = {
111
+ var ee = {
112
112
  active: "info",
113
113
  paused: "warning",
114
114
  canceled: "danger",
115
115
  completed: "success"
116
- };
117
- function b(e, t) {
118
- return {
119
- label: v(e, t),
120
- tone: y[e] ?? "neutral"
121
- };
122
- }
123
- var x = {
116
+ }, te = {
124
117
  active: "forward",
125
118
  paused: "pause",
126
119
  canceled: "ban",
127
120
  completed: "check"
128
- }, S = {
121
+ }, y = {
129
122
  pending: "neutral",
130
123
  skipped: "warning",
131
124
  canceled: "danger",
@@ -133,7 +126,7 @@ var x = {
133
126
  send_failed: "danger",
134
127
  completed: "success"
135
128
  };
136
- function C(e, t) {
129
+ function b(e, t) {
137
130
  return {
138
131
  pending: t.detailsIterationStatusPending,
139
132
  skipped: t.detailsIterationStatusSkipped,
@@ -143,13 +136,13 @@ function C(e, t) {
143
136
  completed: t.detailsIterationStatusCompleted
144
137
  }[e] ?? "";
145
138
  }
146
- function w(e, t, n) {
139
+ function x(e, t, n) {
147
140
  return n.detailsSeriesTitle.replace("{name}", e.counterpart_name ?? n.invoiceType).replace("{frequency}", g(t.frequency, n));
148
141
  }
149
- function T(e, t) {
142
+ function S(e, t) {
150
143
  return t[e] ?? t.unknown;
151
144
  }
152
- function E({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLabels: i, messages: a, onOpenReceivable: s }) {
145
+ function ne({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLabels: i, messages: a, onOpenReceivable: s }) {
153
146
  return (t.iterations ?? []).map((t, c) => {
154
147
  let l = t.issued_invoice_id, u = l ? n.get(l) : void 0, d = u ?? e;
155
148
  return {
@@ -162,12 +155,12 @@ function E({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLab
162
155
  }),
163
156
  chip: u ? {
164
157
  kind: "invoice",
165
- label: T(u.status, i),
158
+ label: S(u.status, i),
166
159
  status: u.status
167
160
  } : {
168
161
  kind: "iteration",
169
- label: C(t.status, a),
170
- tone: S[t.status] ?? "neutral"
162
+ label: b(t.status, a),
163
+ tone: y[t.status] ?? "neutral"
171
164
  },
172
165
  numberLabel: l ? u?.document_id ?? "" : a.detailsPending,
173
166
  onOpen: u ? () => s(u.id) : void 0,
@@ -175,7 +168,7 @@ function E({ invoice: e, recurrence: t, iterationInvoices: n, date: r, statusLab
175
168
  };
176
169
  });
177
170
  }
178
- function ee(e) {
171
+ function C(e) {
179
172
  if (!e?.line1) return;
180
173
  let t = [e.city, [e.state, e.postal_code].filter(Boolean).join(" ")].filter(Boolean).join(", ");
181
174
  return [
@@ -184,7 +177,7 @@ function ee(e) {
184
177
  e.country ? l(e.country) : void 0
185
178
  ].filter(Boolean).join(", ");
186
179
  }
187
- function te(e, t, n) {
180
+ function re(e, t, n) {
188
181
  let r = {
189
182
  label: n.detailsAmountReceived,
190
183
  value: t(e.amount_paid)
@@ -246,7 +239,7 @@ function te(e, t, n) {
246
239
  };
247
240
  }
248
241
  }
249
- function ne(t, i, a) {
242
+ function ie(t, i, a) {
250
243
  let o = t.line_items.reduce((t, n) => {
251
244
  let r = n.total_before_tax ?? 0;
252
245
  return e(n.tax_status) ? {
@@ -291,175 +284,175 @@ function ne(t, i, a) {
291
284
  emphasis: !0
292
285
  }), m;
293
286
  }
294
- var re = {
287
+ var ae = {
295
288
  primary: [],
296
289
  overflow: []
297
290
  };
298
- function D({ receivable: e, pdfUrl: n, paymentReminder: r, overdueReminder: l, depositAccount: u, isAccountListIncomplete: m, recurrence: b, paymentRecords: S = [], isLoadingPaymentRecords: C = !1, iterationInvoices: T = /* @__PURE__ */ new Map(), auditHistory: D, statusLabels: O, messages: k, canRecordPayment: A, hasBeenSent: ie = !1, canWrite: j = !0, onOpenReceivable: M, onOpenCustomer: N, now: ae }) {
291
+ function w({ receivable: e, pdfUrl: n, paymentReminder: r, overdueReminder: l, depositAccount: u, isAccountListIncomplete: m, recurrence: y, paymentRecords: b = [], isLoadingPaymentRecords: S = !1, iterationInvoices: w = /* @__PURE__ */ new Map(), auditHistory: T, statusLabels: E, messages: D, canRecordPayment: O, hasBeenSent: oe = !1, canWrite: k = !0, onOpenReceivable: A, onOpenCustomer: j, now: M }) {
299
292
  if (!e || e.type !== "invoice") return;
300
- let P = e, F = (e) => o({
293
+ let N = e, P = (e) => o({
301
294
  amount: e ?? 0,
302
- currency: P.currency,
295
+ currency: N.currency,
303
296
  fallback: ""
304
- }), I = (e) => a(e, "-"), L = (e) => e ? I(e) : k.detailsPending, { status: R } = P, z = R === "canceled", B = R === "recurring" ? b : void 0, V = P.recurrence_id && R !== "recurring" ? b : void 0, H = R === "overdue" ? s(P.due_date, ae) : 0, { amountTone: oe, amountRows: U } = te(P, F, k), W = P.counterpart_contact, G = ee(P.counterpart_billing_address), K = P.counterpart_id, se = P.counterpart_name ? {
305
- label: k.detailsCustomerName,
306
- name: P.counterpart_name,
307
- onOpen: N && K ? () => N(K) : void 0
308
- } : void 0, ce = [
309
- ...W?.email ? [{
310
- label: k.detailsCustomerEmail,
311
- value: W.email
297
+ }), F = (e) => a(e, "-"), I = (e) => e ? F(e) : D.detailsPending, { status: L } = N, R = L === "canceled", z = L === "recurring" ? y : void 0, B = N.recurrence_id && L !== "recurring" ? y : void 0, V = L === "overdue" ? s(N.due_date, M) : 0, { amountTone: se, amountRows: H } = re(N, P, D), U = N.counterpart_contact, W = C(N.counterpart_billing_address), G = N.counterpart_id, ce = N.counterpart_name ? {
298
+ label: D.detailsCustomerName,
299
+ name: N.counterpart_name,
300
+ onOpen: j && G ? () => j(G) : void 0
301
+ } : void 0, le = [
302
+ ...U?.email ? [{
303
+ label: D.detailsCustomerEmail,
304
+ value: U.email
312
305
  }] : [],
313
- ...W?.phone ? [{
314
- label: k.detailsCustomerPhone,
315
- value: W.phone
306
+ ...U?.phone ? [{
307
+ label: D.detailsCustomerPhone,
308
+ value: U.phone
316
309
  }] : [],
317
- ...G ? [{
318
- label: k.detailsCustomerAddress,
319
- value: G
310
+ ...W ? [{
311
+ label: D.detailsCustomerAddress,
312
+ value: W
320
313
  }] : []
321
- ], q = {
322
- label: k.detailsPaymentReminders,
314
+ ], K = {
315
+ label: D.detailsPaymentReminders,
323
316
  value: h({
324
317
  paymentReminder: r,
325
318
  overdueReminder: l,
326
- remindersConfigured: !!(P.payment_reminder_id || P.overdue_reminder_id),
327
- messages: k
319
+ remindersConfigured: !!(N.payment_reminder_id || N.overdue_reminder_id),
320
+ messages: D
328
321
  })
322
+ }, q = {
323
+ label: D.detailsDepositAccount,
324
+ value: u ? c(u, D) : m && N.bank_account_id ? "-" : D.detailsNotProvided
329
325
  }, J = {
330
- label: k.detailsDepositAccount,
331
- value: u ? c(u, k) : m && P.bank_account_id ? "-" : k.detailsNotProvided
332
- }, Y = {
333
- label: k.detailsPaymentTerms,
334
- value: P.payment_terms?.name ?? k.detailsPending
335
- }, le = B ? [
326
+ label: D.detailsPaymentTerms,
327
+ value: N.payment_terms?.name ?? D.detailsPending
328
+ }, Y = z ? [
336
329
  {
337
- label: k.detailsFrequency,
338
- value: g(B.frequency, k)
330
+ label: D.detailsFrequency,
331
+ value: g(z.frequency, D)
339
332
  },
340
333
  {
341
- label: k.detailsInvoiceAmount,
342
- value: F(P.total_amount)
334
+ label: D.detailsInvoiceAmount,
335
+ value: P(N.total_amount)
343
336
  },
344
- Y,
345
- q,
337
+ J,
338
+ K,
346
339
  {
347
- label: k.detailsPoNumber,
348
- value: P.purchase_order || k.detailsNotProvided
340
+ label: D.detailsPoNumber,
341
+ value: N.purchase_order || D.detailsNotProvided
349
342
  },
350
- J
343
+ q
351
344
  ] : [
352
- ...P.document_id ? [{
353
- label: k.detailsInvoiceNumber,
354
- value: P.document_id
345
+ ...N.document_id ? [{
346
+ label: D.detailsInvoiceNumber,
347
+ value: N.document_id
355
348
  }] : [],
356
349
  {
357
- label: k.detailsInvoiceAmount,
358
- value: F(P.total_amount)
350
+ label: D.detailsInvoiceAmount,
351
+ value: P(N.total_amount)
359
352
  },
360
353
  {
361
- label: k.detailsInvoiceDate,
362
- value: L(P.issue_date)
354
+ label: D.detailsInvoiceDate,
355
+ value: I(N.issue_date)
363
356
  },
364
357
  {
365
- label: k.detailsDueDate,
366
- value: L(P.due_date)
358
+ label: D.detailsDueDate,
359
+ value: I(N.due_date)
367
360
  },
368
- Y,
369
- q,
370
- ...P.purchase_order ? [{
371
- label: k.detailsPoNumber,
372
- value: P.purchase_order
361
+ J,
362
+ K,
363
+ ...N.purchase_order ? [{
364
+ label: D.detailsPoNumber,
365
+ value: N.purchase_order
373
366
  }] : [],
374
- J
375
- ], X = B ? void 0 : i(P), { primary: Z, overflow: Q } = j ? d[R] ?? {
367
+ q
368
+ ], X = z ? void 0 : i(N), { primary: Z, overflow: Q } = k ? d[L] ?? {
376
369
  primary: [],
377
370
  overflow: ["clone"]
378
- } : re;
379
- if (B && j) {
380
- let e = B.status === "active" || B.status === "paused";
381
- Q = B.status === "active" ? ["pauseRecurrence", "cancelRecurrence"] : B.status === "paused" ? ["resumeRecurrence", "cancelRecurrence"] : [], Z = e ? ["edit"] : [];
371
+ } : ae;
372
+ if (z && k) {
373
+ let e = z.status === "active" || z.status === "paused";
374
+ Q = z.status === "active" ? ["pauseRecurrence", "cancelRecurrence"] : z.status === "paused" ? ["resumeRecurrence", "cancelRecurrence"] : [], Z = e ? ["edit"] : [];
382
375
  }
383
- A || (Z = Z.filter((e) => e !== "recordPayment"));
384
- let ue = f.has(R) ? {
385
- rows: S.map((e) => ({
376
+ O || (Z = Z.filter((e) => e !== "recordPayment"));
377
+ let ue = f.has(L) ? {
378
+ rows: b.map((e) => ({
386
379
  id: e.id,
387
- dateLabel: I(e.paid_at),
388
- amountLabel: F(e.amount)
380
+ dateLabel: F(e.paid_at),
381
+ amountLabel: P(e.amount)
389
382
  })),
390
- totalLabel: F(P.amount_paid),
391
- emptyTone: R === "overdue" ? "danger" : "default",
392
- isLoading: C
393
- } : void 0, de = B ? {
394
- statusLabel: v(B.status, k),
395
- statusTone: y[B.status] ?? "neutral",
396
- statusIcon: x[B.status],
397
- amountLabel: F(P.total_amount),
398
- amountPeriodLabel: _(B.frequency, k),
399
- startsOnLabel: L(B.start_date),
400
- endsOnLabel: I(B.end_date ?? (B.max_occurrences ? B.iterations?.at(-1)?.issue_at : void 0)),
401
- scheduleTitle: k.detailsScheduleTitle.replace("{frequency}", g(B.frequency, k)),
402
- schedule: E({
403
- invoice: P,
404
- recurrence: B,
405
- iterationInvoices: T,
406
- date: I,
407
- statusLabels: O,
408
- messages: k,
409
- onOpenReceivable: M
383
+ totalLabel: P(N.amount_paid),
384
+ emptyTone: L === "overdue" ? "danger" : "default",
385
+ isLoading: S
386
+ } : void 0, de = z ? {
387
+ statusLabel: v(z.status, D),
388
+ statusTone: ee[z.status] ?? "neutral",
389
+ statusIcon: te[z.status],
390
+ amountLabel: P(N.total_amount),
391
+ amountPeriodLabel: _(z.frequency, D),
392
+ startsOnLabel: I(z.start_date),
393
+ endsOnLabel: F(z.end_date ?? (z.max_occurrences ? z.iterations?.at(-1)?.issue_at : void 0)),
394
+ scheduleTitle: D.detailsScheduleTitle.replace("{frequency}", g(z.frequency, D)),
395
+ schedule: ne({
396
+ invoice: N,
397
+ recurrence: z,
398
+ iterationInvoices: w,
399
+ date: F,
400
+ statusLabels: E,
401
+ messages: D,
402
+ onOpenReceivable: A
410
403
  })
411
- } : void 0, $ = V ? w(P, V, k) : void 0, fe = V && $ ? {
404
+ } : void 0, $ = B ? x(N, B, D) : void 0, fe = B && $ ? {
412
405
  title: $,
413
- backLabel: k.detailsSeriesBack.replace("{title}", $),
414
- onOpen: () => M(V.invoice_id)
406
+ backLabel: D.detailsSeriesBack.replace("{title}", $),
407
+ onOpen: () => A(B.invoice_id)
415
408
  } : void 0;
416
409
  return {
417
- id: P.id,
418
- type: P.type,
419
- title: B ? w(P, B, k) : P.counterpart_name ?? k.invoiceType,
420
- status: R,
421
- statusTone: p[R] ?? "neutral",
410
+ id: N.id,
411
+ type: N.type,
412
+ title: z ? x(N, z, D) : N.counterpart_name ?? D.invoiceType,
413
+ status: L,
414
+ statusTone: p[L] ?? "neutral",
422
415
  pdfUrl: n,
423
- lineItems: P.line_items.map((e, t) => ({
416
+ lineItems: N.line_items.map((e, t) => ({
424
417
  id: `${e.product.id ?? "item"}-${t}`,
425
418
  name: e.product.name,
426
419
  quantityLabel: String(e.quantity),
427
- unitPriceLabel: F(e.product.price?.value),
428
- totalLabel: F(e.total_before_tax ?? (e.product.price?.value ?? 0) * e.quantity)
420
+ unitPriceLabel: P(e.product.price?.value),
421
+ totalLabel: P(e.total_before_tax ?? (e.product.price?.value ?? 0) * e.quantity)
429
422
  })),
430
423
  panel: {
431
- subtitle: B ? k.detailsSeriesSubtitle : P.document_id ? k.detailsInvoiceSubtitle.replace("{number}", P.document_id) : void 0,
432
- statusLabel: R === "partially_paid" ? O.issued : O[R] ?? O.unknown,
433
- recurring: !!P.recurrence_id || R === "recurring",
434
- overdueLabel: H > 0 ? k.detailsDaysOverdue.replace("{days}", String(H)) : void 0,
435
- amountTone: oe,
436
- amountRows: U,
437
- issueDateLabel: L(P.issue_date),
438
- dueDateLabel: z ? I(P.updated_at) : L(P.due_date),
439
- dueDateCaption: z ? k.detailsCancelledOnCaption : k.detailsDueDate,
424
+ subtitle: z ? D.detailsSeriesSubtitle : N.document_id ? D.detailsInvoiceSubtitle.replace("{number}", N.document_id) : void 0,
425
+ statusLabel: L === "partially_paid" ? E.issued : E[L] ?? E.unknown,
426
+ recurring: !!N.recurrence_id || L === "recurring",
427
+ overdueLabel: V > 0 ? D.detailsDaysOverdue.replace("{days}", String(V)) : void 0,
428
+ amountTone: se,
429
+ amountRows: H,
430
+ issueDateLabel: I(N.issue_date),
431
+ dueDateLabel: R ? F(N.updated_at) : I(N.due_date),
432
+ dueDateCaption: R ? D.detailsCancelledOnCaption : D.detailsDueDate,
440
433
  paymentHistory: ue,
441
- customerName: se,
442
- customerContact: ce,
434
+ customerName: ce,
435
+ customerContact: le,
443
436
  recurringSeries: de,
444
437
  seriesLink: fe,
445
- billingItems: le,
446
- lineItemsSection: B ? void 0 : {
447
- countLabel: String(P.line_items.length),
448
- totals: ne(P, F, k)
438
+ billingItems: Y,
439
+ lineItemsSection: z ? void 0 : {
440
+ countLabel: String(N.line_items.length),
441
+ totals: ie(N, P, D)
449
442
  },
450
443
  notes: X && {
451
444
  ...X,
452
445
  countLabel: String([X.opening, X.closing].filter(Boolean).length)
453
446
  },
454
- attachments: t(P, k),
455
- auditHistory: D,
447
+ attachments: t(N, D),
448
+ auditHistory: T,
456
449
  primaryActions: Z,
457
450
  overflowActions: Q,
458
- actionLabels: { send: ie ? k.detailsResendButton : k.detailsSendButton }
451
+ actionLabels: { send: oe ? D.detailsResendButton : D.detailsSendButton }
459
452
  }
460
453
  };
461
454
  }
462
- function O(e, t, n) {
455
+ function T(e, t, n) {
463
456
  if (!e) return {
464
457
  title: n.detailsNotFoundTitle,
465
458
  description: n.detailsNotFoundDescription.replace("{invoiceId}", t)
@@ -469,4 +462,4 @@ function O(e, t, n) {
469
462
  description: n.detailsUnsupportedDescription.replace("{type}", e.type)
470
463
  };
471
464
  }
472
- export { O as buildDetailsMessageView, D as buildReceivableDetailsView, b as buildSeriesStatusChipView, h as formatReminderSchedule };
465
+ export { T as buildDetailsMessageView, w as buildReceivableDetailsView, h as formatReminderSchedule, g as frequencyLabel, v as seriesStatusLabel };
@@ -7,9 +7,9 @@ import { createLineItem as i, isBlankLineItem as a, keepsSavedTaxRates as o, lin
7
7
  import { attachmentFormValuesToPayload as p, receivableToAttachmentFormValues as m } from "./attachments.js";
8
8
  import { createEmptyRecurrenceFields as h, willRecurrenceIssue as g } from "./recurrence.js";
9
9
  import { buildPaymentTermsPayload as _, buildPaymentTermsUpdatePayload as v, paymentTermsToFormFields as y } from "./paymentTerms.js";
10
- import { createEmptyDiscount as b, discountFromDraft as x, discountToDraft as S } from "./discount.js";
11
- import { validateDiscount as C, validateInvoiceTotals as w, validateIssuableTotal as T } from "./totals.js";
12
- import { format as E } from "date-fns";
10
+ import { createEmptyDiscount as b, discountFromDraft as x, discountToDraft as ee } from "./discount.js";
11
+ import { validateDiscount as S, validateInvoiceTotals as C, validateIssuableTotal as w } from "./totals.js";
12
+ import { differenceInCalendarDays as T, format as E } from "date-fns";
13
13
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js
14
14
  function D() {
15
15
  return {
@@ -74,38 +74,41 @@ function N(e, t, n) {
74
74
  customerState: "missing"
75
75
  };
76
76
  }
77
- function P(e, t = /* @__PURE__ */ new Date()) {
78
- if (!e) return 0;
79
- let n = new Date(e);
80
- if (Number.isNaN(n.getTime())) return 0;
81
- let r = Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()), i = Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()), a = Math.floor((r - i) / 864e5);
82
- return a > 0 ? a : 0;
77
+ function P(e, t) {
78
+ let r = n(e);
79
+ return r ? T(r, t) : void 0;
83
80
  }
84
- function F(e, t, n) {
85
- if (e.type !== "invoice" || e.status !== "draft") return {};
86
- let r = P(e.due_date, n);
87
- return r === 0 ? {} : { dueDateOverdueLabel: (r === 1 ? t.listDayOverdue : t.listDaysOverdue).replace("{days}", String(r)) };
81
+ function F(e, t = /* @__PURE__ */ new Date()) {
82
+ let n = P(e, t) ?? 0;
83
+ return n < 0 ? -n : 0;
88
84
  }
89
- var I = {
85
+ var I = /* @__PURE__ */ new Set([
86
+ "issued",
87
+ "partially_paid",
88
+ "overdue"
89
+ ]);
90
+ function L(e, t, n) {
91
+ let r = e.type === "invoice" ? e.due_date : null, i = O(r, t.pendingValue);
92
+ if (!I.has(e.status)) return { dueDateLabel: i };
93
+ let a = P(r, n);
94
+ if (a === 0) return { dueDateLabel: t.listDueToday };
95
+ if (a === 1) return { dueDateLabel: t.listDueTomorrow };
96
+ if (a === void 0 || a > 0) return { dueDateLabel: i };
97
+ let o = (a === -1 ? t.listDayOverdue : t.listDaysOverdue).replace("{days}", String(-a));
98
+ return {
99
+ dueDateLabel: i,
100
+ dueDateOverdueLabel: o,
101
+ dueDateAccessibleLabel: t.listOverdueAccessibleName.replace("{overdue}", o).replace("{date}", i)
102
+ };
103
+ }
104
+ var R = {
90
105
  names: /* @__PURE__ */ new Map(),
91
106
  isResolving: !1
92
107
  };
93
- function L(e) {
94
- return e?.isLoading ? { kind: "loading" } : e?.status ? {
95
- kind: "chip",
96
- ...e.status
97
- } : { kind: "blank" };
98
- }
99
- function R(e, t, n) {
100
- if (e.type !== "invoice" || e.status !== "recurring") return {};
101
- let r = e.recurrence_id ? t.get(e.recurrence_id) : void 0;
102
- return {
103
- documentLabel: e.document_id || n.recurringNumber,
104
- statusOverride: L(r),
105
- showDocumentSyncIcon: !0
106
- };
108
+ function z(e, t) {
109
+ return e.type !== "invoice" || !e.recurrence_id ? {} : { recurringBadgeLabel: t.listRecurringBadge };
107
110
  }
108
- function z({ receivables: e, messages: t, customerNames: n = I, seriesStatuses: r = /* @__PURE__ */ new Map(), now: i = /* @__PURE__ */ new Date() }) {
111
+ function B({ receivables: e, messages: t, customerNames: n = R, now: r = /* @__PURE__ */ new Date() }) {
109
112
  return e.map((e) => ({
110
113
  id: e.id,
111
114
  type: e.type,
@@ -113,23 +116,27 @@ function z({ receivables: e, messages: t, customerNames: n = I, seriesStatuses:
113
116
  ...N(e, n, t),
114
117
  status: e.status,
115
118
  issueDateLabel: O(e.issue_date, t.pendingValue),
116
- dueDateLabel: O(e.type === "invoice" ? e.due_date : void 0, t.pendingValue),
117
- ...F(e, t, i),
119
+ ...L(e, t, r),
120
+ balanceDueLabel: k({
121
+ amount: "amount_due" in e ? e.amount_due ?? 0 : 0,
122
+ currency: e.currency,
123
+ fallback: ""
124
+ }),
118
125
  totalLabel: k({
119
126
  amount: e.total_amount ?? 0,
120
127
  currency: e.currency,
121
128
  fallback: ""
122
129
  }),
123
- ...R(e, r, t)
130
+ ...z(e, t)
124
131
  }));
125
132
  }
126
- function B(e) {
133
+ function V(e) {
127
134
  if (e.memo || e.footer) return {
128
135
  opening: e.memo || void 0,
129
136
  closing: e.footer || void 0
130
137
  };
131
138
  }
132
- function V({ values: e, counterpart: t, addresses: n }) {
139
+ function H({ values: e, counterpart: t, addresses: n }) {
133
140
  let r = n?.length && t?.id === e.customerId ? t : void 0, i = e.billingAddressId || r?.default_billing_address_id || (n?.length === 1 ? n[0].id : ""), a = e.shippingAddressId || r?.default_shipping_address_id || "";
134
141
  return {
135
142
  billingAddressId: i,
@@ -137,7 +144,7 @@ function V({ values: e, counterpart: t, addresses: n }) {
137
144
  shippingAddressId: a
138
145
  };
139
146
  }
140
- function H({ values: e, messages: t, willIssue: n = !1, hasStartedRecurrence: i = !1, canCreateCustomer: a = !0 }) {
147
+ function U({ values: e, messages: t, willIssue: n = !1, hasStartedRecurrence: i = !1, canCreateCustomer: a = !0 }) {
141
148
  let o = {}, s = a && !!e.customerName.trim();
142
149
  !e.customerId && !s && (o.customerId = t.customerRequired);
143
150
  let c = e.customerEmail.trim();
@@ -146,28 +153,28 @@ function H({ values: e, messages: t, willIssue: n = !1, hasStartedRecurrence: i
146
153
  currency: e.currency,
147
154
  messages: t,
148
155
  requireComplete: n || i
149
- }), d = (n || i && g(e)) && !l && e.lineItems.length > 0 ? T(e, t) : void 0, p = u(l, w(e, t) ?? d, (n || i) && e.lineItems.length === 0 ? t.lineItemsRequired : void 0);
156
+ }), d = (n || i && g(e)) && !l && e.lineItems.length > 0 ? w(e, t) : void 0, p = u(l, C(e, t) ?? d, (n || i) && e.lineItems.length === 0 ? t.lineItemsRequired : void 0);
150
157
  l && (o.lineItems = l), p && (o.lineItemsSummary = p);
151
- let m = C(e, t);
158
+ let m = S(e, t);
152
159
  return m && (o.discount = m), o;
153
160
  }
154
- function U(e) {
161
+ function W(e) {
155
162
  return Object.keys(e).length > 0;
156
163
  }
157
- function W(e, t) {
158
- return !U(H({
159
- values: q(e),
164
+ function G(e, t) {
165
+ return !W(U({
166
+ values: J(e),
160
167
  messages: t,
161
168
  willIssue: !0
162
169
  }));
163
170
  }
164
- function G({ bankAccountId: e, bankAccountType: t }) {
171
+ function K({ bankAccountId: e, bankAccountType: t }) {
165
172
  return {
166
173
  bank_account_id: e || void 0,
167
174
  bank_account_type: e && t || void 0
168
175
  };
169
176
  }
170
- function K({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById: r }) {
177
+ function q({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById: r }) {
171
178
  let i = e.lineItems.filter((e) => !a(e)).map((t) => s({
172
179
  lineItem: t,
173
180
  currency: e.currency,
@@ -182,7 +189,7 @@ function K({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById
182
189
  memo: e.openingNote,
183
190
  footer: e.closingNote,
184
191
  discount: x(e) ?? void 0,
185
- ...G(e)
192
+ ...K(e)
186
193
  };
187
194
  return e.type === "quote" ? {
188
195
  ...o,
@@ -198,7 +205,7 @@ function K({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById
198
205
  type: "invoice"
199
206
  };
200
207
  }
201
- function q(e, t) {
208
+ function J(e, t) {
202
209
  let n = e.type === "quote" ? "quote" : "invoice", r = d(e.line_items), a = e.type === "invoice" ? e : void 0, o = e.line_items.map((n) => l({
203
210
  lineItem: n,
204
211
  currency: e.currency,
@@ -209,17 +216,17 @@ function q(e, t) {
209
216
  type: n,
210
217
  customerId: e.counterpart_id,
211
218
  currency: e.currency,
212
- issueDate: Q(e.issue_date),
213
- dueDate: e.type === "quote" ? Q(e.expiry_date) : "",
219
+ issueDate: $(e.issue_date),
220
+ dueDate: e.type === "quote" ? $(e.expiry_date) : "",
214
221
  openingNote: e.memo ?? "",
215
222
  closingNote: e.footer ?? "",
216
223
  ...e.type === "invoice" ? y(e.payment_terms) : {},
217
224
  taxRate: r,
218
225
  savedTaxRate: r,
219
- ...S(e.discount, e.currency),
226
+ ...ee(e.discount, e.currency),
220
227
  lineItems: o.length > 0 ? o : [i(e.currency)],
221
228
  bankAccountId: e.bank_account_id ?? "",
222
- bankAccountType: J(e.bank_account_type),
229
+ bankAccountType: Y(e.bank_account_type),
223
230
  billingAddressId: e.counterpart_billing_address?.id ?? "",
224
231
  shippingAddressId: e.counterpart_shipping_address?.id ?? "",
225
232
  paymentReminderId: a?.payment_reminder_id ?? "",
@@ -228,10 +235,10 @@ function q(e, t) {
228
235
  attachments: m(e)
229
236
  };
230
237
  }
231
- function J(e) {
238
+ function Y(e) {
232
239
  return e === "BANK_DETAILS" || e === "INTERNAL" || e === "EXTERNAL" ? e : "";
233
240
  }
234
- function Y({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChanges: r }) {
241
+ function X({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChanges: r }) {
235
242
  let i = {
236
243
  counterpart_billing_address_id: t || null,
237
244
  counterpart_shipping_address_id: n || null,
@@ -241,7 +248,7 @@ function Y({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChang
241
248
  memo: e.openingNote,
242
249
  footer: e.closingNote,
243
250
  discount: x(e),
244
- ...G(e)
251
+ ...K(e)
245
252
  };
246
253
  return e.type === "quote" ? { quote: {
247
254
  ...i,
@@ -257,7 +264,7 @@ function Y({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChang
257
264
  attachments: p(e.attachments) ?? null
258
265
  } };
259
266
  }
260
- function X({ values: e, originalLineItems: t, originalCurrency: n, unitNamesById: r, units: i }) {
267
+ function Z({ values: e, originalLineItems: t, originalCurrency: n, unitNamesById: r, units: i }) {
261
268
  let s = d(t), u = o(e.taxRate, s), f = (e, t, n) => c({
262
269
  lineItem: e,
263
270
  currency: t,
@@ -283,7 +290,7 @@ function X({ values: e, originalLineItems: t, originalCurrency: n, unitNamesById
283
290
  ...v.length ? { remove: v } : {}
284
291
  };
285
292
  }
286
- function Z({ values: e, originalLineItems: t, changes: n }) {
293
+ function Q({ values: e, originalLineItems: t, changes: n }) {
287
294
  let r = e.lineItems.filter((e) => !a(e)).map((e) => e.id);
288
295
  if (!t) return { created: r };
289
296
  let i = new Set(t.map((e) => e.id));
@@ -292,7 +299,7 @@ function Z({ values: e, originalLineItems: t, changes: n }) {
292
299
  replaced: n?.replace?.map((e) => e.id) ?? []
293
300
  };
294
301
  }
295
- function Q(e) {
302
+ function $(e) {
296
303
  return e?.slice(0, 10) ?? "";
297
304
  }
298
- export { B as buildReceivableNotesView, z as buildReceivableRows, D as createEmptyReceivableFormValues, i as createLineItem, O as formatDate, k as formatMoney, A as fromMajorUnits, P as getDaysOverdue, j as getDocumentTitle, M as getDocumentTypeLabel, U as hasReceivableFormErrors, W as isReceivableReadyToIssue, K as receivableFormValuesToCreatePayload, X as receivableFormValuesToLineItemChanges, Y as receivableFormValuesToUpdatePayload, q as receivableToFormValues, V as resolveCounterpartAddresses, Z as submittedLineItemRows, H as validateReceivableForm };
305
+ export { V as buildReceivableNotesView, B as buildReceivableRows, D as createEmptyReceivableFormValues, i as createLineItem, O as formatDate, k as formatMoney, A as fromMajorUnits, F as getDaysOverdue, j as getDocumentTitle, M as getDocumentTypeLabel, W as hasReceivableFormErrors, G as isReceivableReadyToIssue, q as receivableFormValuesToCreatePayload, Z as receivableFormValuesToLineItemChanges, X as receivableFormValuesToUpdatePayload, J as receivableToFormValues, H as resolveCounterpartAddresses, N as resolveCustomer, Q as submittedLineItemRows, U as validateReceivableForm };