@tesouro/embedded-components-react 0.5.224 → 0.5.226

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 (41) hide show
  1. package/README.md +335 -413
  2. package/dist/index.d.ts +23 -2
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +23 -2
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +45 -31
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +51 -32
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +20 -1
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +17 -202
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +220 -31
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +32 -145
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -44
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +145 -117
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +46 -58
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +113 -87
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +58 -116
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +98 -225
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +111 -27
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +225 -462
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +34 -41
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +627 -34
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +39 -77
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -112
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +75 -310
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +124 -0
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +324 -0
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +20 -15
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +56 -53
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +33 -29
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +184 -162
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +1 -3
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +78 -69
  35. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +7 -6
  36. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +20 -19
  37. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +39 -39
  38. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +210 -199
  39. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +60 -52
  40. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  41. package/package.json +1 -1
@@ -52,27 +52,30 @@ function m() {
52
52
  function h(e) {
53
53
  return e.frequency !== "once";
54
54
  }
55
- function g({ to: t = [], cc: n = [], bcc: r = [], subject: i, body: a }) {
55
+ function g(e) {
56
+ return h(e) && e.recurrenceAutomationLevel !== "draft";
57
+ }
58
+ function _({ to: t = [], cc: n = [], bcc: r = [], subject: i, body: a }) {
56
59
  return t.length > 0 && [
57
60
  ...t,
58
61
  ...n,
59
62
  ...r
60
63
  ].every((t) => e(t)) && !!(i?.trim() && a?.trim());
61
64
  }
62
- function _(e) {
65
+ function v(e) {
63
66
  return e ? i(e) : void 0;
64
67
  }
65
- function v(e) {
68
+ function y(e) {
66
69
  return e ? r(e, s) : "";
67
70
  }
68
- function y(e) {
71
+ function b(e) {
69
72
  return n(a(e), 1);
70
73
  }
71
- function b(e, t) {
74
+ function x(e, t) {
72
75
  let r = a(t), i = (f[e] - r.getDay() + 7) % 7 || 7;
73
76
  return n(r, i);
74
77
  }
75
- var x = {
78
+ var S = {
76
79
  recurrenceStartDate: "",
77
80
  recurrenceEndDate: "",
78
81
  recurrenceIssueMode: "",
@@ -80,10 +83,10 @@ var x = {
80
83
  recurrenceEndMode: "",
81
84
  recurrenceMaxOccurrences: ""
82
85
  };
83
- function S(e, n) {
86
+ function C(e, n) {
84
87
  let r = {
85
88
  ...e,
86
- ...x,
89
+ ...S,
87
90
  frequency: n
88
91
  };
89
92
  return u.includes(n) ? {
@@ -97,21 +100,21 @@ function S(e, n) {
97
100
  paymentTermsCustomDate: ""
98
101
  } : r;
99
102
  }
100
- function C(e, t, { lockSchedule: n }) {
103
+ function w(e, t, { lockSchedule: n }) {
101
104
  return {
102
105
  ...e,
103
106
  recurrenceIssueMode: t,
104
107
  ...n ? {} : { recurrenceStartDate: "" }
105
108
  };
106
109
  }
107
- function w(e, t, { lockSchedule: n, today: r = /* @__PURE__ */ new Date() }) {
110
+ function T(e, t, { lockSchedule: n, today: r = /* @__PURE__ */ new Date() }) {
108
111
  return n || e.recurrenceDayOfWeek === t ? e : {
109
112
  ...e,
110
113
  recurrenceDayOfWeek: t,
111
- recurrenceStartDate: v(b(t, r))
114
+ recurrenceStartDate: y(x(t, r))
112
115
  };
113
116
  }
114
- function T(e, t) {
117
+ function E(e, t) {
115
118
  return t === "after" ? {
116
119
  ...e,
117
120
  recurrenceEndMode: t,
@@ -122,13 +125,13 @@ function T(e, t) {
122
125
  recurrenceMaxOccurrences: ""
123
126
  };
124
127
  }
125
- function E(e, t, n) {
128
+ function D(e, t, n) {
126
129
  return {
127
130
  ...e,
128
- [t]: v(n)
131
+ [t]: y(n)
129
132
  };
130
133
  }
131
- function D(e) {
134
+ function O(e) {
132
135
  return {
133
136
  ...e,
134
137
  recurrenceRecipientsTo: void 0,
@@ -136,7 +139,7 @@ function D(e) {
136
139
  recurrenceRecipientsBcc: []
137
140
  };
138
141
  }
139
- function O(e, t) {
142
+ function k(e, t) {
140
143
  return {
141
144
  to: e.recurrenceRecipientsTo ?? (t ? [t] : []),
142
145
  toInput: "",
@@ -148,31 +151,31 @@ function O(e, t) {
148
151
  message: e.recurrenceBody
149
152
  };
150
153
  }
151
- function k(e) {
154
+ function A(e) {
152
155
  let t = e.toInput.trim();
153
156
  return t ? [...e.to, t] : e.to;
154
157
  }
155
- function A(e) {
156
- return g({
157
- to: k(e),
158
+ function j(e) {
159
+ return _({
160
+ to: A(e),
158
161
  cc: e.cc,
159
162
  bcc: e.bcc,
160
163
  subject: e.subject,
161
164
  body: e.message
162
165
  });
163
166
  }
164
- function j(e, t) {
167
+ function M(e, t) {
165
168
  return {
166
169
  ...e,
167
- recurrenceRecipientsTo: k(t),
170
+ recurrenceRecipientsTo: A(t),
168
171
  recurrenceRecipientsCc: t.cc,
169
172
  recurrenceRecipientsBcc: t.bcc,
170
173
  recurrenceSubject: t.subject,
171
174
  recurrenceBody: t.message
172
175
  };
173
176
  }
174
- function M(e, t) {
175
- return t === "issue_and_send" && !g({
177
+ function N(e, t) {
178
+ return t === "issue_and_send" && !_({
176
179
  to: e.recurrenceRecipientsTo,
177
180
  cc: e.recurrenceRecipientsCc,
178
181
  bcc: e.recurrenceRecipientsBcc,
@@ -180,7 +183,7 @@ function M(e, t) {
180
183
  body: e.recurrenceBody
181
184
  });
182
185
  }
183
- function N({ open: e, ready: t, draft: n, messages: r }) {
186
+ function P({ open: e, ready: t, draft: n, messages: r }) {
184
187
  return {
185
188
  open: e,
186
189
  ready: t,
@@ -193,21 +196,21 @@ function N({ open: e, ready: t, draft: n, messages: r }) {
193
196
  subject: n.subject,
194
197
  message: n.message,
195
198
  showToPlaceholder: n.to.length === 0,
196
- saveDisabled: !A(n),
199
+ saveDisabled: !j(n),
197
200
  removeRecipientLabel: (e) => r.recurrenceRemoveRecipient.replace("{recipient}", e)
198
201
  };
199
202
  }
200
- var P = [
203
+ var F = [
201
204
  "th",
202
205
  "st",
203
206
  "nd",
204
207
  "rd"
205
208
  ];
206
- function F(e) {
209
+ function I(e) {
207
210
  let t = e % 100;
208
- return `${e}${P[(t - 20) % 10] ?? P[t] ?? P[0]}`;
211
+ return `${e}${F[(t - 20) % 10] ?? F[t] ?? F[0]}`;
209
212
  }
210
- function I(e, t) {
213
+ function L(e, t) {
211
214
  let [n, r] = {
212
215
  day: [t.recurrenceUnitDay, t.recurrenceUnitDays],
213
216
  week: [t.recurrenceUnitWeek, t.recurrenceUnitWeeks],
@@ -220,8 +223,8 @@ function I(e, t) {
220
223
  plural: r
221
224
  };
222
225
  }
223
- function L(e, t, n = /* @__PURE__ */ new Date()) {
224
- if (t < y(n)) return !0;
226
+ function R(e, t, n = /* @__PURE__ */ new Date()) {
227
+ if (t < b(n)) return !0;
225
228
  if (e.frequency === "week") return e.recurrenceDayOfWeek ? t.getDay() !== f[e.recurrenceDayOfWeek] : !1;
226
229
  if (e.frequency !== "month" || !e.recurrenceIssueMode) return !1;
227
230
  let r = t.getDate(), i = new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate();
@@ -230,8 +233,8 @@ function L(e, t, n = /* @__PURE__ */ new Date()) {
230
233
  let a = Number(e.recurrenceIssueMode);
231
234
  return !Number.isNaN(a) && r !== Math.min(a, i);
232
235
  }
233
- function R({ fields: e, errors: t, lockSchedule: n, messages: r, today: i = /* @__PURE__ */ new Date() }) {
234
- let { frequency: a } = e, o = _(e.recurrenceStartDate), s = _(e.recurrenceEndDate), c = y(i), u = (t) => L(e, t, i), f = { frequency: {
236
+ function z({ fields: e, errors: t, lockSchedule: n, messages: r, today: i = /* @__PURE__ */ new Date() }) {
237
+ let { frequency: a } = e, o = v(e.recurrenceStartDate), s = v(e.recurrenceEndDate), c = b(i), u = (t) => R(e, t, i), f = { frequency: {
235
238
  value: a,
236
239
  disabled: n,
237
240
  options: [
@@ -274,7 +277,7 @@ function R({ fields: e, errors: t, lockSchedule: n, messages: r, today: i = /* @
274
277
  }],
275
278
  dayOptions: Array.from({ length: 31 }, (e, t) => ({
276
279
  value: String(t + 1),
277
- label: F(t + 1)
280
+ label: I(t + 1)
278
281
  }))
279
282
  }), a === "week") {
280
283
  let i = {
@@ -304,7 +307,7 @@ function R({ fields: e, errors: t, lockSchedule: n, messages: r, today: i = /* @
304
307
  minDate: c,
305
308
  maxDate: s ?? l,
306
309
  isDateDisabled: u
307
- }, m = I(a, r), h = {
310
+ }, m = L(a, r), h = {
308
311
  value: e.recurrenceMaxOccurrences,
309
312
  unitLabel: Number(e.recurrenceMaxOccurrences) === 1 ? m.singular : m.plural,
310
313
  invalid: !!t?.recurrenceMaxOccurrences
@@ -362,22 +365,22 @@ function R({ fields: e, errors: t, lockSchedule: n, messages: r, today: i = /* @
362
365
  emailError: g
363
366
  }, f;
364
367
  }
365
- function z(e, t, n) {
366
- let { singular: r, plural: i } = I(t, n), a = (e) => e.replace("{unit}", r).replace("{units}", i);
368
+ function B(e, t, n) {
369
+ let { singular: r, plural: i } = L(t, n), a = (e) => e.replace("{unit}", r).replace("{units}", i);
367
370
  if (!e) return a(n.recurrenceOccurrencesRequired);
368
371
  let o = Number(e);
369
372
  if (o < 1) return a(n.recurrenceOccurrencesTooFew);
370
373
  if (o > c) return a(n.recurrenceOccurrencesTooMany);
371
374
  if (!Number.isInteger(o)) return n.recurrenceOccurrencesWhole;
372
375
  }
373
- function B({ fields: t, issuedCount: n = 0, messages: r }) {
376
+ function V({ fields: t, issuedCount: n = 0, messages: r }) {
374
377
  let { frequency: i } = t;
375
378
  if (i === "once") return {};
376
379
  let a = {};
377
380
  t.recurrenceStartDate || (a.recurrenceStartDate = r.recurrenceStartDateRequired);
378
381
  let o = i !== "day" || t.recurrenceEndMode === "after";
379
382
  if (i === "month" && !t.recurrenceIssueMode && (a.recurrenceIssueMode = r.recurrenceDayOfMonthRequired), i === "week" && !t.recurrenceDayOfWeek && (a.recurrenceDayOfWeek = r.recurrenceDayOfWeekRequired), i === "day" && !t.recurrenceEndMode && (a.recurrenceEndMode = r.recurrenceEndConditionRequired), i === "day" && t.recurrenceEndMode === "on" && !t.recurrenceEndDate && (a.recurrenceEndDate = r.recurrenceEndDateRequired), o) {
380
- let e = z(t.recurrenceMaxOccurrences, i, r);
383
+ let e = B(t.recurrenceMaxOccurrences, i, r);
381
384
  e && (a.recurrenceMaxOccurrences = e);
382
385
  }
383
386
  let s = i === "day" && t.recurrenceEndMode === "on";
@@ -395,7 +398,7 @@ function B({ fields: t, issuedCount: n = 0, messages: r }) {
395
398
  }
396
399
  return a;
397
400
  }
398
- function V(e) {
401
+ function H(e) {
399
402
  let t = e.recurrenceAutomationLevel;
400
403
  if (t !== "issue_and_send") return {
401
404
  automation_level: t,
@@ -415,7 +418,7 @@ function V(e) {
415
418
  recipients: Object.values(n).some(Boolean) ? n : void 0
416
419
  };
417
420
  }
418
- function H(e, { hasExistingRecurrence: t }) {
421
+ function U(e, { hasExistingRecurrence: t }) {
419
422
  let n = e.frequency === "day" && e.recurrenceEndMode === "on" && !!e.recurrenceEndDate, r = t ? null : void 0;
420
423
  return {
421
424
  frequency: e.frequency,
@@ -424,32 +427,32 @@ function H(e, { hasExistingRecurrence: t }) {
424
427
  end_date: n ? e.recurrenceEndDate : r
425
428
  };
426
429
  }
427
- function U(e, t) {
430
+ function W(e, t) {
428
431
  return {
429
- ...H(e, { hasExistingRecurrence: !1 }),
430
- ...V(e),
432
+ ...U(e, { hasExistingRecurrence: !1 }),
433
+ ...H(e),
431
434
  invoice_id: t,
432
435
  interval: 1
433
436
  };
434
437
  }
435
- function W(e, { lockSchedule: t }) {
436
- let n = H(e, { hasExistingRecurrence: !0 });
438
+ function G(e, { lockSchedule: t }) {
439
+ let n = U(e, { hasExistingRecurrence: !0 });
437
440
  return t ? {
438
441
  max_occurrences: n.max_occurrences,
439
442
  end_date: n.end_date,
440
- ...V(e)
443
+ ...H(e)
441
444
  } : {
442
445
  ...n,
443
- ...V(e)
446
+ ...H(e)
444
447
  };
445
448
  }
446
- function G(e) {
449
+ function K(e) {
447
450
  return e?.iterations.filter((e) => e.issued_invoice_id).length ?? 0;
448
451
  }
449
- function K(e) {
452
+ function q(e) {
450
453
  let t = m();
451
454
  if (!e) return t;
452
- let n = _(e.start_date);
455
+ let n = v(e.start_date);
453
456
  return {
454
457
  frequency: e.frequency,
455
458
  recurrenceStartDate: e.start_date.slice(0, 10),
@@ -467,4 +470,4 @@ function K(e) {
467
470
  };
468
471
  }
469
472
  //#endregion
470
- export { o as DEFAULT_RECURRENCE_AUTOMATION_LEVEL, j as applyRecurrenceEmailDraft, U as buildCreateRecurrencePayload, V as buildRecurrenceDeliveryPayload, N as buildRecurrenceEmailView, R as buildRecurrenceView, W as buildUpdateRecurrencePayload, D as clearRecurrenceRecipients, G as countIssuedIterations, m as createEmptyRecurrenceFields, O as createRecurrenceEmailDraft, L as isRecurrenceDateDisabled, g as isRecurrenceEmailComplete, A as isRecurrenceEmailDraftComplete, h as isRecurring, K as recurrenceToFormFields, E as selectRecurrenceDate, w as selectRecurrenceDayOfWeek, T as selectRecurrenceEndMode, S as selectRecurrenceFrequency, C as selectRecurrenceIssueMode, M as shouldOpenRecurrenceEmail, B as validateRecurrence };
473
+ export { o as DEFAULT_RECURRENCE_AUTOMATION_LEVEL, M as applyRecurrenceEmailDraft, W as buildCreateRecurrencePayload, H as buildRecurrenceDeliveryPayload, P as buildRecurrenceEmailView, z as buildRecurrenceView, G as buildUpdateRecurrencePayload, O as clearRecurrenceRecipients, K as countIssuedIterations, m as createEmptyRecurrenceFields, k as createRecurrenceEmailDraft, R as isRecurrenceDateDisabled, _ as isRecurrenceEmailComplete, j as isRecurrenceEmailDraftComplete, h as isRecurring, q as recurrenceToFormFields, D as selectRecurrenceDate, T as selectRecurrenceDayOfWeek, E as selectRecurrenceEndMode, C as selectRecurrenceFrequency, w as selectRecurrenceIssueMode, N as shouldOpenRecurrenceEmail, V as validateRecurrence, g as willRecurrenceIssue };
@@ -1,9 +1,9 @@
1
1
  import { RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE as e, RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as t } from "../../ui/dist/index10.js";
2
2
  import "../../ui/dist/index.js";
3
- import { addDays as n, addYears as r, format as i, max as a, min as o, parseISO as s, subYears as c } from "date-fns";
3
+ import { addDays as n, addYears as r, format as i, isValid as a, max as o, min as s, parseISO as c, subYears as l } from "date-fns";
4
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js
5
- var l = "MMM d, yyyy", u = "yyyy-MM-dd", d = 10, f = 5;
6
- function p(e) {
5
+ var u = "MMM d, yyyy", d = "yyyy-MM-dd", f = 10, p = 5;
6
+ function m(e) {
7
7
  let t = (e) => e ? {
8
8
  number_of_days: e.number_of_days ?? null,
9
9
  discount: e.discount ?? null
@@ -16,39 +16,43 @@ function p(e) {
16
16
  term_2: t(e.term_2)
17
17
  });
18
18
  }
19
- function m(e) {
19
+ function h(e) {
20
20
  let t = /* @__PURE__ */ new Set();
21
21
  return e.filter((e) => {
22
- let n = p(e);
22
+ let n = m(e);
23
23
  return !t.has(n) && (t.add(n), !0);
24
24
  });
25
25
  }
26
- function h(e) {
27
- return i(e, l);
26
+ function g(e) {
27
+ return i(e, u);
28
28
  }
29
- function g(e, t) {
29
+ function _(e, t) {
30
30
  let r = e.term_final?.number_of_days;
31
31
  return r ? n(t, r) : void 0;
32
32
  }
33
- function _(e, t) {
34
- let n = g(e, t);
33
+ function v(e, t = /* @__PURE__ */ new Date()) {
34
+ let n = c(e);
35
+ return a(n) ? n : t;
36
+ }
37
+ function y(e, t) {
38
+ let n = _(e, t);
35
39
  return {
36
40
  value: e.id,
37
41
  label: e.name,
38
- ...n ? { dueDateLabel: h(n) } : {}
42
+ ...n ? { dueDateLabel: g(n) } : {}
39
43
  };
40
44
  }
41
- function v(e) {
42
- return e ? s(e) : void 0;
45
+ function b(e) {
46
+ return e ? c(e) : void 0;
43
47
  }
44
- function y({ terms: e, isLoading: t, fields: n, customDatePickerOpen: r, isRecurring: i = !1, messages: a, today: o = /* @__PURE__ */ new Date() }) {
48
+ function x({ terms: e, isLoading: t, fields: n, customDatePickerOpen: r, isRecurring: i = !1, messages: a, issueDate: o = /* @__PURE__ */ new Date() }) {
45
49
  if (t) return { kind: "loading" };
46
- let s = m(e ?? []).map((e) => _(e, o)), c = v(n.paymentTermsCustomDate), l;
50
+ let s = h(e ?? []).map((e) => y(e, o)), c = b(n.paymentTermsCustomDate), l;
47
51
  if (n.paymentTermsId === "receipt_due") l = { kind: "receiptDue" };
48
52
  else if (n.paymentTermsId === "custom") l = {
49
53
  kind: "customDate",
50
54
  hasDate: !!c,
51
- dateLabel: c ? h(c) : a.paymentTermsCustomDatePlaceholder
55
+ dateLabel: c ? g(c) : a.paymentTermsCustomDatePlaceholder
52
56
  };
53
57
  else {
54
58
  let e = s.find((e) => e.value === n.paymentTermsId);
@@ -67,15 +71,15 @@ function y({ terms: e, isLoading: t, fields: n, customDatePickerOpen: r, isRecur
67
71
  ...i ? { description: a.recurrenceSeriesPaymentTerms } : {}
68
72
  };
69
73
  }
70
- function b(e, t = /* @__PURE__ */ new Date()) {
71
- let n = v(e), i = c(t, d), s = r(t, f);
74
+ function S(e, t = /* @__PURE__ */ new Date()) {
75
+ let n = b(e), i = l(t, f), a = r(t, p);
72
76
  return {
73
77
  selected: n,
74
- startMonth: n ? o([i, n]) : i,
75
- endMonth: n ? a([s, n]) : s
78
+ startMonth: n ? s([i, n]) : i,
79
+ endMonth: n ? o([a, n]) : a
76
80
  };
77
81
  }
78
- function x(e, t) {
82
+ function C(e, t) {
79
83
  return t === "custom" ? {
80
84
  paymentTermsId: t,
81
85
  paymentTermsCustomDate: e.paymentTermsId === "custom" ? e.paymentTermsCustomDate : ""
@@ -84,25 +88,25 @@ function x(e, t) {
84
88
  paymentTermsCustomDate: ""
85
89
  };
86
90
  }
87
- function S(e) {
91
+ function w(e) {
88
92
  return e.paymentTermsId === "custom" && !e.paymentTermsCustomDate ? {
89
93
  paymentTermsId: "",
90
94
  paymentTermsCustomDate: ""
91
95
  } : e;
92
96
  }
93
- function C(e) {
94
- return e ? i(e, u) : "";
97
+ function T(e) {
98
+ return e ? i(e, d) : "";
95
99
  }
96
- function w(e) {
100
+ function E(e) {
97
101
  return e.paymentTermsId === "custom" ? e.paymentTermsCustomDate ? { payment_terms: { term_final: { end_date: e.paymentTermsCustomDate } } } : { payment_terms: { term_final: { number_of_days: 0 } } } : e.paymentTermsId === "receipt_due" ? { payment_terms: { term_final: { number_of_days: 0 } } } : e.paymentTermsId ? { payment_terms_id: e.paymentTermsId } : {};
98
102
  }
99
- function T(e) {
100
- return e.paymentTermsId ? w(e) : {
103
+ function D(e) {
104
+ return e.paymentTermsId ? E(e) : {
101
105
  payment_terms_id: null,
102
106
  payment_terms: null
103
107
  };
104
108
  }
105
- function E(n) {
109
+ function O(n) {
106
110
  if (n?.id) return {
107
111
  paymentTermsId: n.id,
108
112
  paymentTermsCustomDate: ""
@@ -120,4 +124,4 @@ function E(n) {
120
124
  };
121
125
  }
122
126
  //#endregion
123
- export { b as buildCustomDateCalendar, w as buildPaymentTermsPayload, T as buildPaymentTermsUpdatePayload, y as buildPaymentTermsView, S as closeCustomDatePickerFields, m as dedupePaymentTerms, h as formatTermDate, E as paymentTermsToFormFields, x as selectPaymentTermsFields, g as termDueDate, C as toCustomDateValue };
127
+ export { S as buildCustomDateCalendar, E as buildPaymentTermsPayload, D as buildPaymentTermsUpdatePayload, x as buildPaymentTermsView, w as closeCustomDatePickerFields, h as dedupePaymentTerms, g as formatTermDate, O as paymentTermsToFormFields, v as resolveIssueDate, C as selectPaymentTermsFields, _ as termDueDate, T as toCustomDateValue };