@tesouro/embedded-components-react 0.11.170 → 0.11.172

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 (43) hide show
  1. package/dist/index.d.ts +6 -0
  2. package/dist/lib/ReceivablesWidget.d.ts +6 -0
  3. package/dist/lib/WidgetSuite.d.ts +6 -0
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +75 -66
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +62 -53
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +44 -38
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +331 -326
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +10 -8
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +190 -187
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +12 -19
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +25 -23
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +4 -7
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +23 -24
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +5 -5
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +196 -187
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +6 -1
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +20 -17
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +11 -14
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +157 -161
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +4 -8
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -29
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/index.js +7 -6
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/resolveBillDueDate.js +22 -0
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +116 -98
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +99 -92
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +7 -1
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +15 -24
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +59 -69
  33. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
  35. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DateDisclosure/DateDisclosure.js +28 -0
  36. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DueDateText/DueDateText.js +19 -0
  37. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +28 -27
  38. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/dueDateDisplay.js +23 -0
  39. package/package.json +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -6
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -33
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
@@ -1,24 +1,25 @@
1
1
  import { createCurrencyFormatter as e } from "../../../../../shared/util/dist/lib/createCurrencyFormatter.js";
2
2
  import { minorExponentForCurrency as t } from "../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
3
3
  import { parseDateOrTimestamp as n } from "../../../../../shared/util/dist/lib/parseCalendarDate.js";
4
+ import { resolveDueDateDisplay as r } from "../../../../../shared/util/dist/lib/dueDateDisplay.js";
4
5
  import "../../../../../shared/util/dist/index.js";
5
- import { isEmail as r } from "../../../../../../shared/util-validation/dist/index5.js";
6
- import { createLineItem as i, isBlankLineItem as a, keepsSavedTaxRates as o, lineItemToCreatePayload as s, lineItemToUpdatePayload as c, responseLineItemToFormValues as l, summarizeLineItemErrors as u, taxRateFromLineItems as d, validateLineItems as f } from "./lineItems.js";
7
- import { attachmentFormValuesToPayload as p, receivableToAttachmentFormValues as m } from "./attachments.js";
8
- import { createEmptyRecurrenceFields as h, willRecurrenceIssue as g } from "./recurrence.js";
9
- import { buildPaymentTermsPayload as _, buildPaymentTermsUpdatePayload as v, paymentTermsToFormFields as y } from "./paymentTerms.js";
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";
6
+ import { isEmail as i } from "../../../../../../shared/util-validation/dist/index5.js";
7
+ import { createLineItem as a, isBlankLineItem as o, keepsSavedTaxRates as s, lineItemToCreatePayload as c, lineItemToUpdatePayload as l, responseLineItemToFormValues as u, summarizeLineItemErrors as d, taxRateFromLineItems as f, validateLineItems as p } from "./lineItems.js";
8
+ import { attachmentFormValuesToPayload as m, receivableToAttachmentFormValues as h } from "./attachments.js";
9
+ import { createEmptyRecurrenceFields as g, willRecurrenceIssue as _ } from "./recurrence.js";
10
+ import { buildPaymentTermsPayload as v, buildPaymentTermsUpdatePayload as y, paymentTermsToFormFields as ee } from "./paymentTerms.js";
11
+ import { createEmptyDiscount as b, discountFromDraft as x, discountToDraft as S } from "./discount.js";
12
+ import { validateDiscount as C, validateInvoiceTotals as w, validateIssuableTotal as T } from "./totals.js";
13
+ import { differenceInCalendarDays as E, format as D } from "date-fns";
13
14
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js
14
- function D() {
15
+ function O() {
15
16
  return {
16
17
  type: "invoice",
17
18
  customerId: "",
18
19
  customerName: "",
19
20
  customerEmail: "",
20
21
  currency: "USD",
21
- issueDate: E(/* @__PURE__ */ new Date(), "yyyy-MM-dd"),
22
+ issueDate: D(/* @__PURE__ */ new Date(), "yyyy-MM-dd"),
22
23
  dueDate: "",
23
24
  openingNote: "",
24
25
  closingNote: "",
@@ -26,7 +27,7 @@ function D() {
26
27
  paymentTermsCustomDate: "",
27
28
  taxRate: "",
28
29
  ...b("USD"),
29
- lineItems: [i()],
30
+ lineItems: [a()],
30
31
  bankAccountId: "",
31
32
  bankAccountType: "",
32
33
  billingAddressId: "",
@@ -35,10 +36,10 @@ function D() {
35
36
  overdueReminderId: "",
36
37
  purchaseOrder: "",
37
38
  attachments: [],
38
- ...h()
39
+ ...g()
39
40
  };
40
41
  }
41
- function O(e, t) {
42
+ function k(e, t) {
42
43
  let r = n(e);
43
44
  return r ? new Intl.DateTimeFormat(void 0, {
44
45
  day: "2-digit",
@@ -46,22 +47,22 @@ function O(e, t) {
46
47
  year: "numeric"
47
48
  }).format(r) : t;
48
49
  }
49
- function k({ amount: n, currency: r, fallback: i }) {
50
+ function A({ amount: n, currency: r, fallback: i }) {
50
51
  return n == null || !r ? i : e(r).format(n / 10 ** t(r));
51
52
  }
52
- function A(e, n) {
53
+ function j(e, n) {
53
54
  let r = Number(e);
54
55
  if (!Number.isFinite(r)) return;
55
56
  let i = n ? t(n) : 2;
56
57
  return Math.round(r * 10 ** i);
57
58
  }
58
- function j(e, t) {
59
+ function M(e, t) {
59
60
  return e.document_id || t.untitledDocument;
60
61
  }
61
- function M(e, t) {
62
+ function N(e, t) {
62
63
  return e === "quote" ? t.quoteType : e === "credit_note" ? t.creditNoteType : t.invoiceType;
63
64
  }
64
- function N(e, t, n) {
65
+ function P(e, t, n) {
65
66
  let r = e.counterpart_name || (e.counterpart_id ? t.names.get(e.counterpart_id) : void 0);
66
67
  return r ? {
67
68
  customerLabel: r,
@@ -74,69 +75,75 @@ function N(e, t, n) {
74
75
  customerState: "missing"
75
76
  };
76
77
  }
77
- function P(e, t) {
78
+ function F(e, t) {
78
79
  let r = n(e);
79
- return r ? T(r, t) : void 0;
80
+ return r ? E(r, t) : void 0;
80
81
  }
81
- function F(e, t = /* @__PURE__ */ new Date()) {
82
- let n = P(e, t) ?? 0;
82
+ function I(e, t = /* @__PURE__ */ new Date()) {
83
+ let n = F(e, t) ?? 0;
83
84
  return n < 0 ? -n : 0;
84
85
  }
85
- var I = /* @__PURE__ */ new Set([
86
+ var L = /* @__PURE__ */ new Set([
86
87
  "issued",
87
88
  "partially_paid",
88
89
  "overdue"
89
90
  ]);
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,
91
+ function R(e, t, n) {
92
+ let i = e.type === "invoice" ? e.due_date : null, { label: a, overdueLabel: o, accessibleLabel: s } = r({
93
+ dueDate: i,
94
+ dateLabel: k(i, t.pendingValue),
95
+ today: D(n, "yyyy-MM-dd"),
96
+ isUnpaid: L.has(e.status),
97
+ labels: {
98
+ today: t.listDueToday,
99
+ tomorrow: t.listDueTomorrow,
100
+ dayOverdue: t.listDayOverdue,
101
+ daysOverdue: t.listDaysOverdue,
102
+ overdueAccessibleName: t.listOverdueAccessibleName
103
+ }
104
+ });
105
+ return o ? {
106
+ dueDateLabel: a,
100
107
  dueDateOverdueLabel: o,
101
- dueDateAccessibleLabel: t.listOverdueAccessibleName.replace("{overdue}", o).replace("{date}", i)
102
- };
108
+ dueDateAccessibleLabel: s
109
+ } : { dueDateLabel: a };
103
110
  }
104
- var R = {
111
+ var z = {
105
112
  names: /* @__PURE__ */ new Map(),
106
113
  isResolving: !1
107
114
  };
108
- function z(e, t) {
115
+ function B(e, t) {
109
116
  return e.type !== "invoice" || !e.recurrence_id ? {} : { recurringBadgeLabel: t.listRecurringBadge };
110
117
  }
111
- function B({ receivables: e, messages: t, customerNames: n = R, now: r = /* @__PURE__ */ new Date() }) {
118
+ function V({ receivables: e, messages: t, customerNames: n = z, now: r = /* @__PURE__ */ new Date() }) {
112
119
  return e.map((e) => ({
113
120
  id: e.id,
114
121
  type: e.type,
115
122
  documentLabel: e.document_id || t.pendingValue,
116
- ...N(e, n, t),
123
+ ...P(e, n, t),
117
124
  status: e.status,
118
- issueDateLabel: O(e.issue_date, t.pendingValue),
119
- ...L(e, t, r),
120
- balanceDueLabel: k({
125
+ issueDateLabel: k(e.issue_date, t.pendingValue),
126
+ ...R(e, t, r),
127
+ balanceDueLabel: A({
121
128
  amount: "amount_due" in e ? e.amount_due ?? 0 : 0,
122
129
  currency: e.currency,
123
130
  fallback: ""
124
131
  }),
125
- totalLabel: k({
132
+ totalLabel: A({
126
133
  amount: e.total_amount ?? 0,
127
134
  currency: e.currency,
128
135
  fallback: ""
129
136
  }),
130
- ...z(e, t)
137
+ ...B(e, t)
131
138
  }));
132
139
  }
133
- function V(e) {
140
+ function H(e) {
134
141
  if (e.memo || e.footer) return {
135
142
  opening: e.memo || void 0,
136
143
  closing: e.footer || void 0
137
144
  };
138
145
  }
139
- function H({ values: e, counterpart: t, addresses: n }) {
146
+ function U({ values: e, counterpart: t, addresses: n }) {
140
147
  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 || "";
141
148
  return {
142
149
  billingAddressId: i,
@@ -144,43 +151,43 @@ function H({ values: e, counterpart: t, addresses: n }) {
144
151
  shippingAddressId: a
145
152
  };
146
153
  }
147
- function U({ values: e, messages: t, willIssue: n = !1, hasStartedRecurrence: i = !1, canCreateCustomer: a = !0 }) {
154
+ function W({ values: e, messages: t, willIssue: n = !1, hasStartedRecurrence: r = !1, canCreateCustomer: a = !0 }) {
148
155
  let o = {}, s = a && !!e.customerName.trim();
149
156
  !e.customerId && !s && (o.customerId = t.customerRequired);
150
157
  let c = e.customerEmail.trim();
151
- !e.customerId && c && !r(c) && (o.customerEmail = t.customerEmailInvalid), e.currency || (o.currency = t.currencyRequired), n && !e.paymentTermsId && (o.paymentTermsId = t.paymentTermsRequired), n && !e.bankAccountId && (o.bankAccountId = t.bankAccountRequired);
152
- let l = f(e.lineItems, {
158
+ !e.customerId && c && !i(c) && (o.customerEmail = t.customerEmailInvalid), e.currency || (o.currency = t.currencyRequired), n && !e.paymentTermsId && (o.paymentTermsId = t.paymentTermsRequired), n && !e.bankAccountId && (o.bankAccountId = t.bankAccountRequired);
159
+ let l = p(e.lineItems, {
153
160
  currency: e.currency,
154
161
  messages: t,
155
- requireComplete: n || i
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);
157
- l && (o.lineItems = l), p && (o.lineItemsSummary = p);
158
- let m = S(e, t);
162
+ requireComplete: n || r
163
+ }), u = (n || r && _(e)) && !l && e.lineItems.length > 0 ? T(e, t) : void 0, f = d(l, w(e, t) ?? u, (n || r) && e.lineItems.length === 0 ? t.lineItemsRequired : void 0);
164
+ l && (o.lineItems = l), f && (o.lineItemsSummary = f);
165
+ let m = C(e, t);
159
166
  return m && (o.discount = m), o;
160
167
  }
161
- function W(e) {
168
+ function G(e) {
162
169
  return Object.keys(e).length > 0;
163
170
  }
164
- function G(e, t) {
165
- return !W(U({
166
- values: J(e),
171
+ function K(e, t) {
172
+ return !G(W({
173
+ values: Y(e),
167
174
  messages: t,
168
175
  willIssue: !0
169
176
  }));
170
177
  }
171
- function K({ bankAccountId: e, bankAccountType: t }) {
178
+ function q({ bankAccountId: e, bankAccountType: t }) {
172
179
  return {
173
180
  bank_account_id: e || void 0,
174
181
  bank_account_type: e && t || void 0
175
182
  };
176
183
  }
177
- function q({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById: r }) {
178
- let i = e.lineItems.filter((e) => !a(e)).map((t) => s({
184
+ function J({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById: r }) {
185
+ let i = e.lineItems.filter((e) => !o(e)).map((t) => c({
179
186
  lineItem: t,
180
187
  currency: e.currency,
181
188
  taxRate: e.taxRate,
182
189
  unitNamesById: r
183
- })), o = {
190
+ })), a = {
184
191
  counterpart_billing_address_id: t || void 0,
185
192
  counterpart_shipping_address_id: n || void 0,
186
193
  counterpart_id: e.customerId,
@@ -189,30 +196,30 @@ function q({ values: e, billingAddressId: t, shippingAddressId: n, unitNamesById
189
196
  memo: e.openingNote,
190
197
  footer: e.closingNote,
191
198
  discount: x(e) ?? void 0,
192
- ...K(e)
199
+ ...q(e)
193
200
  };
194
201
  return e.type === "quote" ? {
195
- ...o,
202
+ ...a,
196
203
  expiry_date: e.dueDate || void 0,
197
204
  type: "quote"
198
205
  } : {
199
- ...o,
200
- ..._(e),
206
+ ...a,
207
+ ...v(e),
201
208
  payment_reminder_id: e.paymentReminderId || void 0,
202
209
  overdue_reminder_id: e.overdueReminderId || void 0,
203
210
  purchase_order: e.purchaseOrder || void 0,
204
- attachments: p(e.attachments),
211
+ attachments: m(e.attachments),
205
212
  type: "invoice"
206
213
  };
207
214
  }
208
- function J(e, t) {
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({
215
+ function Y(e, t) {
216
+ let n = e.type === "quote" ? "quote" : "invoice", r = f(e.line_items), i = e.type === "invoice" ? e : void 0, o = e.line_items.map((n) => u({
210
217
  lineItem: n,
211
218
  currency: e.currency,
212
219
  units: t
213
220
  }));
214
221
  return {
215
- ...D(),
222
+ ...O(),
216
223
  type: n,
217
224
  customerId: e.counterpart_id,
218
225
  currency: e.currency,
@@ -220,25 +227,25 @@ function J(e, t) {
220
227
  dueDate: e.type === "quote" ? $(e.expiry_date) : "",
221
228
  openingNote: e.memo ?? "",
222
229
  closingNote: e.footer ?? "",
223
- ...e.type === "invoice" ? y(e.payment_terms) : {},
230
+ ...e.type === "invoice" ? ee(e.payment_terms) : {},
224
231
  taxRate: r,
225
232
  savedTaxRate: r,
226
- ...ee(e.discount, e.currency),
227
- lineItems: o.length > 0 ? o : [i(e.currency)],
233
+ ...S(e.discount, e.currency),
234
+ lineItems: o.length > 0 ? o : [a(e.currency)],
228
235
  bankAccountId: e.bank_account_id ?? "",
229
- bankAccountType: Y(e.bank_account_type),
236
+ bankAccountType: X(e.bank_account_type),
230
237
  billingAddressId: e.counterpart_billing_address?.id ?? "",
231
238
  shippingAddressId: e.counterpart_shipping_address?.id ?? "",
232
- paymentReminderId: a?.payment_reminder_id ?? "",
233
- overdueReminderId: a?.overdue_reminder_id ?? "",
234
- purchaseOrder: a?.purchase_order ?? "",
235
- attachments: m(e)
239
+ paymentReminderId: i?.payment_reminder_id ?? "",
240
+ overdueReminderId: i?.overdue_reminder_id ?? "",
241
+ purchaseOrder: i?.purchase_order ?? "",
242
+ attachments: h(e)
236
243
  };
237
244
  }
238
- function Y(e) {
245
+ function X(e) {
239
246
  return e === "BANK_DETAILS" || e === "INTERNAL" || e === "EXTERNAL" ? e : "";
240
247
  }
241
- function X({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChanges: r }) {
248
+ function Z({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChanges: r }) {
242
249
  let i = {
243
250
  counterpart_billing_address_id: t || null,
244
251
  counterpart_shipping_address_id: n || null,
@@ -248,37 +255,37 @@ function X({ values: e, billingAddressId: t, shippingAddressId: n, lineItemChang
248
255
  memo: e.openingNote,
249
256
  footer: e.closingNote,
250
257
  discount: x(e),
251
- ...K(e)
258
+ ...q(e)
252
259
  };
253
260
  return e.type === "quote" ? { quote: {
254
261
  ...i,
255
262
  ...r ? { line_items: r } : {},
256
263
  expiry_date: e.dueDate || void 0,
257
- ...v(e)
264
+ ...y(e)
258
265
  } } : { invoice: {
259
266
  ...i,
260
267
  ...r ? { line_items: r } : {},
261
- ...v(e),
268
+ ...y(e),
262
269
  payment_reminder_id: e.paymentReminderId || null,
263
270
  overdue_reminder_id: e.overdueReminderId || null,
264
- attachments: p(e.attachments) ?? null
271
+ attachments: m(e.attachments) ?? null
265
272
  } };
266
273
  }
267
- function Z({ values: e, originalLineItems: t, originalCurrency: n, unitNamesById: r, units: i }) {
268
- let s = d(t), u = o(e.taxRate, s), f = (e, t, n) => c({
274
+ function Q({ values: e, originalLineItems: t, originalCurrency: n, unitNamesById: r, units: i }) {
275
+ let a = f(t), c = s(e.taxRate, a), d = (e, t, n) => l({
269
276
  lineItem: e,
270
277
  currency: t,
271
278
  taxRate: n,
272
- keepSavedRate: u,
279
+ keepSavedRate: c,
273
280
  unitNamesById: r
274
- }), p = new Map(t.map((e) => [e.id, JSON.stringify(f(l({
281
+ }), p = new Map(t.map((e) => [e.id, JSON.stringify(d(u({
275
282
  lineItem: e,
276
283
  currency: n,
277
284
  units: i
278
- }), n, s))])), m = e.lineItems.filter((e) => !a(e)), h = new Set(m.map((e) => e.id)), g = m.filter((e) => !p.has(e.id)).map((t) => f(t, e.currency, e.taxRate)), _ = m.flatMap((t) => {
285
+ }), n, a))])), m = e.lineItems.filter((e) => !o(e)), h = new Set(m.map((e) => e.id)), g = m.filter((e) => !p.has(e.id)).map((t) => d(t, e.currency, e.taxRate)), _ = m.flatMap((t) => {
279
286
  let n = p.get(t.id);
280
287
  if (n === void 0) return [];
281
- let r = f(t, e.currency, e.taxRate);
288
+ let r = d(t, e.currency, e.taxRate);
282
289
  return n === JSON.stringify(r) ? [] : [{
283
290
  id: t.id,
284
291
  data: r
@@ -290,8 +297,8 @@ function Z({ values: e, originalLineItems: t, originalCurrency: n, unitNamesById
290
297
  ...v.length ? { remove: v } : {}
291
298
  };
292
299
  }
293
- function Q({ values: e, originalLineItems: t, changes: n }) {
294
- let r = e.lineItems.filter((e) => !a(e)).map((e) => e.id);
300
+ function te({ values: e, originalLineItems: t, changes: n }) {
301
+ let r = e.lineItems.filter((e) => !o(e)).map((e) => e.id);
295
302
  if (!t) return { created: r };
296
303
  let i = new Set(t.map((e) => e.id));
297
304
  return {
@@ -302,4 +309,4 @@ function Q({ values: e, originalLineItems: t, changes: n }) {
302
309
  function $(e) {
303
310
  return e?.slice(0, 10) ?? "";
304
311
  }
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 };
312
+ export { H as buildReceivableNotesView, V as buildReceivableRows, O as createEmptyReceivableFormValues, a as createLineItem, k as formatDate, A as formatMoney, j as fromMajorUnits, I as getDaysOverdue, M as getDocumentTitle, N as getDocumentTypeLabel, G as hasReceivableFormErrors, K as isReceivableReadyToIssue, J as receivableFormValuesToCreatePayload, Q as receivableFormValuesToLineItemChanges, Z as receivableFormValuesToUpdatePayload, Y as receivableToFormValues, U as resolveCounterpartAddresses, P as resolveCustomer, te as submittedLineItemRows, W as validateReceivableForm };
@@ -116,9 +116,15 @@ var e = {
116
116
  detailsPeriodMonth: "each month",
117
117
  detailsPeriodQuarter: "each quarter",
118
118
  detailsPeriodYear: "each year",
119
+ detailsPeriodEveryDays: "every {interval} days",
120
+ detailsPeriodEveryWeeks: "every {interval} weeks",
121
+ detailsPeriodEveryMonths: "every {interval} months",
122
+ detailsPeriodEveryQuarters: "every {interval} quarters",
123
+ detailsPeriodEveryYears: "every {interval} years",
119
124
  detailsSeriesTitle: "{name} - {frequency}",
120
- detailsSeriesSubtitle: "Recurring series",
125
+ detailsSeriesSubtitle: "Recurring series · {frequency}",
121
126
  detailsScheduleTitle: "{frequency} schedule",
127
+ detailsScheduleTitleEvery: "Schedule, {period}",
122
128
  detailsSeriesBack: "Back to {title} recurring series",
123
129
  detailsScheduleOpenInvoice: "Open invoice {number}",
124
130
  detailsSeriesStatusActive: "Active",
@@ -53,61 +53,52 @@ function m(e, t) {
53
53
  }
54
54
  };
55
55
  }
56
- function h(e, t) {
57
- return e.interval <= 1 ? o(e.frequency, t) : ({
58
- day: t.listSeriesEveryDays,
59
- week: t.listSeriesEveryWeeks,
60
- month: t.listSeriesEveryMonths,
61
- quarter: t.listSeriesEveryQuarters,
62
- year: t.listSeriesEveryYears
63
- }[e.frequency] ?? "").replace("{interval}", String(e.interval));
64
- }
65
- function g(e) {
56
+ function h(e) {
66
57
  let t = new Date(e.getFullYear(), e.getMonth() + 1, 0);
67
58
  return e.getDate() === t.getDate();
68
59
  }
69
- function _(t, r) {
60
+ function g(t, r) {
70
61
  let i = e(t.start_date);
71
62
  if (!i) return;
72
63
  let a = i.getDate();
73
64
  if (a === 1) return r.listSeriesFirstDay;
74
65
  if (a === 31) return r.listSeriesLastDay;
75
66
  let o = [i, ...(t.iterations ?? []).flatMap((t) => e(t.issue_at) ?? [])];
76
- return o.every(g) && o.some((e) => e.getDate() > a) ? r.listSeriesLastDay : n(a);
67
+ return o.every(h) && o.some((e) => e.getDate() > a) ? r.listSeriesLastDay : n(a);
77
68
  }
78
- function v(e, t) {
79
- let n = h(e, t);
69
+ function _(e, t) {
70
+ let n = o(e, t);
80
71
  if (e.frequency !== "month") return n;
81
- let r = _(e, t);
72
+ let r = g(e, t);
82
73
  return r ? t.listSeriesMonthDay.replace("{cadence}", n).replace("{day}", r) : n;
83
74
  }
84
- function y(e) {
75
+ function v(e) {
85
76
  if (e.status === "active") return e.iterations?.find((e) => e.status === "pending")?.issue_at;
86
77
  }
87
- function b(e, t) {
78
+ function y(e, t) {
88
79
  if (!e) return { nextInvoiceLabel: t.listSeriesNoValue };
89
- let n = y(e);
80
+ let n = v(e);
90
81
  return n ? { nextInvoiceLabel: r(n, t.listSeriesNoValue) } : {
91
82
  nextInvoiceLabel: t.listSeriesNoNextInvoice,
92
83
  nextInvoiceMuted: !0
93
84
  };
94
85
  }
95
- function x(e, t, n) {
86
+ function b(e, t, n) {
96
87
  return e ? {
97
88
  kind: "badge",
98
89
  label: s(e.status, n),
99
90
  tone: d[e.status] ?? "neutral"
100
91
  } : t ? { kind: "loading" } : { kind: "blank" };
101
92
  }
102
- function S({ receivables: e, recurrences: t, isRecurrencesLoading: n, messages: r, customerNames: o }) {
93
+ function x({ receivables: e, recurrences: t, isRecurrencesLoading: n, messages: r, customerNames: o }) {
103
94
  return e.map((e) => {
104
95
  let s = e.type === "invoice" && e.recurrence_id ? t.get(e.recurrence_id) : void 0;
105
96
  return {
106
97
  id: e.id,
107
98
  ...a(e, o, r),
108
- repeatsLabel: s ? v(s, r) : r.listSeriesNoValue,
109
- ...b(s, r),
110
- status: x(s, n, r),
99
+ repeatsLabel: s ? _(s, r) : r.listSeriesNoValue,
100
+ ...y(s, r),
101
+ status: b(s, n, r),
111
102
  amountLabel: i({
112
103
  amount: e.total_amount ?? 0,
113
104
  currency: e.currency,
@@ -116,4 +107,4 @@ function S({ receivables: e, recurrences: t, isRecurrencesLoading: n, messages:
116
107
  };
117
108
  });
118
109
  }
119
- export { l as SERIES_FILTER_FIELDS, S as buildRecurringSeriesRows, m as buildSeriesFilterQuery, f as buildSeriesStatusLabels, p as buildSeriesStatusOptions };
110
+ export { l as SERIES_FILTER_FIELDS, x as buildRecurringSeriesRows, m as buildSeriesFilterQuery, f as buildSeriesStatusLabels, p as buildSeriesStatusOptions };