@tesouro/embedded-components-react 0.7.35 → 0.7.36

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 (34) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/lib/CounterpartsWidget.d.ts +0 -1
  3. package/dist/lib/CounterpartsWidgetPublic.d.ts +0 -1
  4. package/dist/lib/CustomersWidget.d.ts +0 -1
  5. package/dist/lib/ReceivablesWidget.d.ts +0 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +109 -110
  7. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +2 -2
  8. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +2 -4
  11. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index4.js +89 -2
  12. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +48 -50
  13. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +4 -6
  14. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +2 -3
  15. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +0 -1
  16. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +2 -2
  19. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +2 -2
  20. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +3 -6
  23. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +48 -7
  24. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +4 -48
  25. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +28 -6
  26. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  27. package/package.json +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index6.js +0 -7
  29. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js +0 -92
  30. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +0 -7
  31. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +0 -8
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js +0 -4
  33. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +0 -28
  34. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index16.js +0 -4
package/dist/index.d.ts CHANGED
@@ -4444,7 +4444,6 @@ interface CounterpartMessageLabels {
4444
4444
  accountHolderNameRequired: string;
4445
4445
  routingNumberInvalid: string;
4446
4446
  accountNumberInvalid: string;
4447
- vatIdValueRequired: string;
4448
4447
  /** Shown for a non-field-specific submit failure. */
4449
4448
  genericError: string;
4450
4449
  /** Toasted when the list's billed/received/due analytics fail to load. */
@@ -787,7 +787,6 @@ interface CounterpartMessageLabels {
787
787
  accountHolderNameRequired: string;
788
788
  routingNumberInvalid: string;
789
789
  accountNumberInvalid: string;
790
- vatIdValueRequired: string;
791
790
  /** Shown for a non-field-specific submit failure. */
792
791
  genericError: string;
793
792
  /** Toasted when the list's billed/received/due analytics fail to load. */
@@ -787,7 +787,6 @@ interface CounterpartMessageLabels {
787
787
  accountHolderNameRequired: string;
788
788
  routingNumberInvalid: string;
789
789
  accountNumberInvalid: string;
790
- vatIdValueRequired: string;
791
790
  /** Shown for a non-field-specific submit failure. */
792
791
  genericError: string;
793
792
  /** Toasted when the list's billed/received/due analytics fail to load. */
@@ -777,7 +777,6 @@ interface CounterpartMessageLabels {
777
777
  accountHolderNameRequired: string;
778
778
  routingNumberInvalid: string;
779
779
  accountNumberInvalid: string;
780
- vatIdValueRequired: string;
781
780
  /** Shown for a non-field-specific submit failure. */
782
781
  genericError: string;
783
782
  /** Toasted when the list's billed/received/due analytics fail to load. */
@@ -852,7 +852,6 @@ interface CounterpartMessageLabels {
852
852
  accountHolderNameRequired: string;
853
853
  routingNumberInvalid: string;
854
854
  accountNumberInvalid: string;
855
- vatIdValueRequired: string;
856
855
  /** Shown for a non-field-specific submit failure. */
857
856
  genericError: string;
858
857
  /** Toasted when the list's billed/received/due analytics fail to load. */
@@ -14,81 +14,81 @@ import { usePayableSuggestionsQuery as i } from "../../data-access/dist/index19.
14
14
  import "../../data-access/dist/index.js";
15
15
  import { resolvePaymentInstructionsGestures as a } from "./index15.js";
16
16
  import { COUNTERPART_MESSAGE_LABELS_EN as o } from "../../../../shared/counterpart-management/feature/dist/lib/labels.js";
17
- import { counterpartFormBankAccountToCreatePayload as te, counterpartFormBankAccountToUpdatePayload as ne, getAchInstructions as s, getCounterpartEmail as c, getCounterpartName as re, getPayableAchInstructions as ie, hasCounterpartFormErrors as ae, isAchCompatibleBankAccount as l, resolveCounterpartBankAccountWrite as oe, validateAchFormValues as se, validateCounterpartForm as ce } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
18
- import { useCounterpartsQuery as le } from "../../../../shared/counterpart-management/data-access/dist/index3.js";
19
- import { useCreateCounterpartBankAccountMutation as ue, useUpdateCounterpartBankAccountMutation as de } from "../../../../shared/counterpart-management/data-access/dist/index5.js";
20
- import { useCounterpartDetails as fe } from "../../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
21
- import { useCounterpartForm as pe } from "../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
17
+ import { counterpartFormBankAccountToCreatePayload as te, counterpartFormBankAccountToUpdatePayload as ne, getAchInstructions as s, getCounterpartEmail as re, getCounterpartName as ie, getPayableAchInstructions as ae, hasCounterpartFormErrors as oe, isAchCompatibleBankAccount as c, resolveCounterpartBankAccountWrite as se, validateAchFormValues as ce, validateCounterpartForm as le } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
18
+ import { useCounterpartsQuery as ue } from "../../../../shared/counterpart-management/data-access/dist/index3.js";
19
+ import { useCreateCounterpartBankAccountMutation as de, useUpdateCounterpartBankAccountMutation as fe } from "../../../../shared/counterpart-management/data-access/dist/index4.js";
20
+ import { useCounterpartDetails as pe } from "../../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
21
+ import { useCounterpartForm as me } from "../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
22
22
  import "../../../../shared/counterpart-management/feature/dist/index.js";
23
- import { buildVendorPrefill as me, canAutoCreateVendor as he, toCounterpartRawData as ge } from "./index31.js";
24
- import { VendorInlineForm as _e } from "./index32.js";
25
- import { useCallback as u, useEffect as d, useLayoutEffect as ve, useMemo as f, useRef as p, useState as m } from "react";
26
- import { jsx as ye } from "react/jsx-runtime";
23
+ import { buildVendorPrefill as he, canAutoCreateVendor as ge, toCounterpartRawData as _e } from "./index31.js";
24
+ import { VendorInlineForm as ve } from "./index32.js";
25
+ import { useCallback as l, useEffect as u, useLayoutEffect as ye, useMemo as d, useRef as f, useState as p } from "react";
26
+ import { jsx as be } from "react/jsx-runtime";
27
27
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js
28
- var be = 10, xe = 300, h = {
28
+ var xe = 10, Se = 300, m = {
29
29
  accountHolderName: "",
30
30
  routingNumber: "",
31
31
  accountNumber: ""
32
32
  };
33
- function Se(e) {
33
+ function Ce(e) {
34
34
  return {
35
35
  accountHolderName: e.account_holder_name ?? "",
36
36
  routingNumber: e.routing_number ?? "",
37
37
  accountNumber: e.account_number ?? ""
38
38
  };
39
39
  }
40
- function g(e, t) {
40
+ function h(e, t) {
41
41
  return e.accountHolderName.trim() === t.accountHolderName.trim() && e.routingNumber.trim() === t.routingNumber.trim() && e.accountNumber.trim() === t.accountNumber.trim();
42
42
  }
43
- function Ce(e, t) {
44
- return e?.find((e) => e.id === t && l(e)) ?? s(e);
43
+ function we(e, t) {
44
+ return e?.find((e) => e.id === t && c(e)) ?? s(e);
45
45
  }
46
- function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCounterpartBankAccountId: we, isVendorKnown: Te = !0, onCounterpartChange: Ee, requiredError: De, extractedVendor: v, readOnly: y = !1, canEditVendor: b = !0, canEditPaymentInstructions: Oe = !0, canAddPaymentInstructions: ke = !0, confirmDiscard: x = (e) => e(), labels: Ae }) {
47
- let S = {
46
+ function g({ payableId: s, counterpartId: c, payableCounterpartId: g, payableCounterpartBankAccountId: Te, isVendorKnown: Ee = !0, onCounterpartChange: De, requiredError: Oe, extractedVendor: _, readOnly: v = !1, canEditVendor: y = !0, canEditPaymentInstructions: ke = !0, canAddPaymentInstructions: Ae = !0, confirmDiscard: b = (e) => e(), labels: x }) {
47
+ let S = d(() => ({
48
48
  ...r,
49
- ...Ae
50
- }, je = Ae?.messages, C = f(() => ({
49
+ ...x
50
+ }), [x]), je = x?.messages, C = d(() => ({
51
51
  ...o,
52
52
  ...je
53
- }), [je]), { initResponse: Me } = n(), Ne = t(Me?.scopes, [ee.CounterpartReadOrg]), [w, Pe] = m(""), [T, Fe] = m(""), Ie = p(T), [E, Le] = m(), [Re, ze] = m("none"), [Be, Ve] = m(), [He, D] = m(!1), [O, k] = m(!1), [A, Ue] = m(h), j = p(A);
53
+ }), [je]), { initResponse: Me } = n(), Ne = t(Me?.scopes, [ee.CounterpartReadOrg]), [w, Pe] = p(""), [T, Fe] = p(""), Ie = f(T), [E, Le] = p(), [Re, ze] = p("none"), [Be, Ve] = p(), [He, D] = p(!1), [O, k] = p(!1), [A, Ue] = p(m), j = f(A);
54
54
  j.current = A;
55
- let M = p(h), [We, N] = m(), [Ge, Ke] = m(), qe = Ge?.bankAccountId, P = p(void 0), Je = p(l), [Ye, Xe] = m(!1), [Ze, Qe] = m(!1), F = p(void 0), I = u(() => {
56
- k(!1), Ue(h), M.current = h, N(void 0);
57
- }, []), L = u((e) => {
58
- Xe(!0), Ee(e);
59
- }, [Ee]), $e = i(s, { enabled: !y && !!s && !l && !_ }), R = $e.data?.suggested_counterpart?.id, et = v?.name;
60
- d(() => {
61
- !y && !Ye && !l && !_ && R && L(R);
55
+ let M = f(m), [We, N] = p(), [Ge, Ke] = p(), qe = Ge?.bankAccountId, P = f(void 0), Je = f(c), [Ye, Xe] = p(!1), [Ze, Qe] = p(!1), F = f(void 0), I = l(() => {
56
+ k(!1), Ue(m), M.current = m, N(void 0);
57
+ }, []), L = l((e) => {
58
+ Xe(!0), De(e);
59
+ }, [De]), $e = i(s, { enabled: !v && !!s && !c && !g }), R = $e.data?.suggested_counterpart?.id, et = _?.name;
60
+ u(() => {
61
+ !v && !Ye && !c && !g && R && L(R);
62
62
  }, [
63
- l,
64
- _,
65
- y,
63
+ c,
64
+ g,
65
+ v,
66
66
  Ye,
67
67
  R,
68
68
  L
69
- ]), d(() => {
70
- Je.current !== l && (Je.current = l, I(), Ke((e) => e?.counterpartId === l ? e : void 0));
71
- }, [l, I]), d(() => {
69
+ ]), u(() => {
70
+ Je.current !== c && (Je.current = c, I(), Ke((e) => e?.counterpartId === c ? e : void 0));
71
+ }, [c, I]), u(() => {
72
72
  let e = setTimeout(() => {
73
73
  Fe(w.trim());
74
- }, xe);
74
+ }, Se);
75
75
  return () => clearTimeout(e);
76
76
  }, [w]);
77
- let z = f(() => me(v), [v]), B = z?.bankAccount, tt = f(() => he(v), [v]), nt = E === "create" ? !g(A, B ?? h) : O && !g(A, M.current), rt = !y && (E === "edit" || E === "create" && !!z), V = le({
77
+ let z = d(() => he(_), [_]), B = z?.bankAccount, tt = d(() => ge(_), [_]), nt = E === "create" ? !h(A, B ?? m) : O && !h(A, M.current), rt = !v && (E === "edit" || E === "create" && !!z), V = ue({
78
78
  sort: "counterpart_name",
79
79
  order: "asc",
80
- limit: be,
80
+ limit: xe,
81
81
  counterpart_name__icontains: T || void 0,
82
82
  is_vendor: !0,
83
- enabled: (rt || !y && !E && !l) && Te && Ne
83
+ enabled: (rt || !v && !E && !c) && Ee && Ne
84
84
  });
85
- d(() => {
85
+ u(() => {
86
86
  V.isPlaceholderData || (Ie.current = T);
87
87
  }, [T, V.isPlaceholderData]);
88
- let it = V.isPlaceholderData && Ie.current !== T, H = fe({
89
- selectedId: l,
88
+ let it = V.isPlaceholderData && Ie.current !== T, H = pe({
89
+ selectedId: c,
90
90
  enabled: Ne
91
- }), at = ue(), ot = de(), U = pe({
91
+ }), at = de(), ot = fe(), U = me({
92
92
  view: Re,
93
93
  setView: ze,
94
94
  selectedId: Be,
@@ -98,25 +98,25 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
98
98
  counterpart: H.counterpart,
99
99
  primaryAddress: H.primaryAddress,
100
100
  includeBankAccount: !1
101
- }), { openCreate: st, openEdit: ct, close: lt, setValues: W, submit: ut, values: dt } = U, G = f(() => {
101
+ }), { openCreate: st, openEdit: ct, close: lt, setValues: W, submit: ut, values: dt } = U, G = d(() => {
102
102
  let e = H.counterpart;
103
103
  if (!e) return;
104
104
  if (H.isBankAccountsLoading) return {
105
- name: re(e),
106
- email: c(e),
105
+ name: ie(e),
106
+ email: re(e),
107
107
  methodLabel: S.paymentMethodLoading,
108
108
  hasPaymentInstructions: !1
109
109
  };
110
110
  if (H.isBankAccountsError) return {
111
- name: re(e),
112
- email: c(e),
111
+ name: ie(e),
112
+ email: re(e),
113
113
  methodLabel: S.paymentMethodUnavailable,
114
114
  hasPaymentInstructions: !1
115
115
  };
116
- let t = ie(H.bankAccounts);
116
+ let t = ae(H.bankAccounts);
117
117
  return {
118
- name: re(e),
119
- email: c(e),
118
+ name: ie(e),
119
+ email: re(e),
120
120
  methodLabel: t ? S.paymentInstructionsValue(t.account_number?.slice(-4) ?? "") : S.noMethod,
121
121
  hasPaymentInstructions: !!t
122
122
  };
@@ -126,31 +126,29 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
126
126
  H.isBankAccountsError,
127
127
  H.isBankAccountsLoading,
128
128
  S
129
- ]), K = f(() => {
129
+ ]), K = d(() => {
130
130
  let e = et?.trim();
131
- if (!e || l || E) return;
131
+ if (!e || c || E) return;
132
132
  let t = B?.accountNumber;
133
133
  return {
134
134
  name: e,
135
- email: v?.email ?? "",
135
+ email: _?.email ?? "",
136
136
  description: tt ? S.pendingVendorDescription : S.pendingVendorIncompleteDescription,
137
137
  methodLabel: t ? S.paymentInstructionsValue(t.slice(-4)) : "",
138
138
  hasPaymentInstructions: !!t
139
139
  };
140
140
  }, [
141
- l,
141
+ c,
142
142
  B?.accountNumber,
143
- v?.email,
143
+ _?.email,
144
144
  et,
145
145
  E,
146
146
  tt,
147
- S.paymentInstructionsValue,
148
- S.pendingVendorDescription,
149
- S.pendingVendorIncompleteDescription
150
- ]), ft = !!K && !tt, q = l === _ ? we : void 0, J = f(() => Ce(H.bankAccounts, q), [H.bankAccounts, q]), pt = f(() => ie(H.bankAccounts)?.id, [H.bankAccounts]), mt = !H.counterpart || H.isLoading || H.isFetching || H.isError || H.isBankAccountsLoading || H.isBankAccountsFetching || H.isBankAccountsError, ht = mt || H.isAddressesLoading || H.isAddressesFetching || H.isAddressesError, gt = b && !mt && H.isAddressesError ? { onRetry: H.refetchAddresses } : void 0, Y = u(() => {
147
+ S
148
+ ]), ft = !!K && !tt, q = c === g ? Te : void 0, J = d(() => we(H.bankAccounts, q), [H.bankAccounts, q]), pt = d(() => ae(H.bankAccounts)?.id, [H.bankAccounts]), mt = !H.counterpart || H.isLoading || H.isFetching || H.isError || H.isBankAccountsLoading || H.isBankAccountsFetching || H.isBankAccountsError, ht = mt || H.isAddressesLoading || H.isAddressesFetching || H.isAddressesError, gt = y && !mt && H.isAddressesError ? { onRetry: H.refetchAddresses } : void 0, Y = l(() => {
151
149
  lt(), Le(void 0), D(!1), P.current = void 0;
152
- }, [lt]), X = u((e) => {
153
- if (D(!1), P.current = void 0, e === "edit") Ve(l), ct();
150
+ }, [lt]), X = l((e) => {
151
+ if (D(!1), P.current = void 0, e === "edit") Ve(c), ct();
154
152
  else {
155
153
  st();
156
154
  let e = w.trim();
@@ -161,83 +159,83 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
161
159
  email: z?.email || t.email,
162
160
  phone: z?.phone || t.phone,
163
161
  address: z?.address ?? t.address
164
- })), Ue(B ?? h), N(void 0), M.current = h;
162
+ })), Ue(B ?? m), N(void 0), M.current = m;
165
163
  }
166
164
  Le(e);
167
165
  }, [
168
- l,
166
+ c,
169
167
  B,
170
168
  st,
171
169
  ct,
172
170
  w,
173
171
  W,
174
172
  z
175
- ]), _t = U.revealErrors, vt = u(() => {
173
+ ]), _t = U.revealErrors, vt = l(() => {
176
174
  Xe(!0), X("create"), _t();
177
- let e = B ? se(B, C) : {};
175
+ let e = B ? ce(B, C) : {};
178
176
  Object.keys(e).length && N(e);
179
177
  }, [
180
178
  B,
181
179
  C,
182
180
  X,
183
181
  _t
184
- ]), yt = p(!1), bt = !yt.current && !y && b && Te && !_ && !R && !Ye && ft, xt = bt && !$e.isLoading;
185
- ve(() => {
182
+ ]), yt = f(!1), bt = !yt.current && !v && y && Ee && !g && !R && !Ye && ft, xt = bt && !$e.isLoading;
183
+ ye(() => {
186
184
  xt && (yt.current = !0, vt());
187
185
  }, [vt, xt]);
188
- let St = u(() => {
189
- let e = J ? Se(J) : h;
186
+ let St = l(() => {
187
+ let e = J ? Ce(J) : m;
190
188
  M.current = e, Ue(e), N(void 0), k(!0);
191
- }, [J]), Ct = u((e) => {
189
+ }, [J]), Ct = l((e) => {
192
190
  let t = {
193
191
  ...j.current,
194
192
  ...e
195
193
  };
196
194
  j.current = t, Ue(t);
197
- let ee = se(t, C);
195
+ let ee = ce(t, C);
198
196
  N((e) => {
199
197
  if (!e) return e;
200
198
  let t = { ...e };
201
199
  for (let e of Object.keys(t)) ee[e] || delete t[e];
202
200
  return Object.keys(t).length ? t : void 0;
203
201
  });
204
- }, [C]), wt = u(() => {
205
- nt ? x(I) : I();
202
+ }, [C]), wt = l(() => {
203
+ nt ? b(I) : I();
206
204
  }, [
207
205
  I,
208
- x,
206
+ b,
209
207
  nt
210
- ]), Z = u(() => {
208
+ ]), Z = l(() => {
211
209
  Y(), I();
212
- }, [I, Y]), Q = He || nt, $ = u((e) => {
210
+ }, [I, Y]), Q = He || nt, $ = l((e) => {
213
211
  let t = () => {
214
212
  Z(), e();
215
213
  };
216
- Q ? x(t) : t();
214
+ Q ? b(t) : t();
217
215
  }, [
218
- x,
216
+ b,
219
217
  Z,
220
218
  Q
221
- ]), Tt = u(() => {
222
- Q ? x(Z) : Z();
219
+ ]), Tt = l(() => {
220
+ Q ? b(Z) : Z();
223
221
  }, [
224
- x,
222
+ b,
225
223
  Z,
226
224
  Q
227
- ]), Et = u(async ({ closeOnSuccess: t = !0, allowIncompleteVendor: ee = !1 } = {}) => {
225
+ ]), Et = l(async ({ closeOnSuccess: t = !0, allowIncompleteVendor: ee = !1 } = {}) => {
228
226
  if (ee && E === "create" && !P.current) {
229
- let e = j.current, t = ce({
227
+ let e = j.current, t = le({
230
228
  ...dt,
231
229
  bankAccount: e
232
230
  }, "create", C, "vendor");
233
- if (ae(t)) return He || !g(e, B ?? h) ? {
231
+ if (oe(t)) return He || !h(e, B ?? m) ? {
234
232
  ok: !0,
235
- counterpartRawData: ge(dt, e, v)
233
+ counterpartRawData: _e(dt, e, _)
236
234
  } : { ok: !0 };
237
235
  }
238
- let n = l, r = !1, i = j.current;
239
- if (!g(i, M.current)) {
240
- let e = se(i, C);
236
+ let n = c, r = !1, i = j.current;
237
+ if (!h(i, M.current)) {
238
+ let e = ce(i, C);
241
239
  if (Object.keys(e).length > 0) return N(e), E !== "create" && k(!0), { ok: !1 };
242
240
  }
243
241
  if (E === "edit" && ht) return { ok: !1 };
@@ -252,7 +250,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
252
250
  }
253
251
  if (!n) return { ok: !0 };
254
252
  let a = H.isBankAccountsLoading || H.isBankAccountsFetching || H.isBankAccountsError;
255
- if (g(i, M.current)) {
253
+ if (h(i, M.current)) {
256
254
  let e = qe ?? q;
257
255
  return e ? (t && (k(!1), E && Y()), r && L(n), {
258
256
  ok: !0,
@@ -269,7 +267,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
269
267
  }
270
268
  if (a) return { ok: !1 };
271
269
  N(void 0);
272
- let o = oe(H.bankAccounts, qe ?? J?.id), s;
270
+ let o = se(H.bankAccounts, qe ?? J?.id), s;
273
271
  try {
274
272
  o.kind === "update" ? (await ot.mutateAsync({
275
273
  path: {
@@ -297,18 +295,19 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
297
295
  };
298
296
  }, [
299
297
  Y,
300
- l,
298
+ c,
301
299
  at,
302
300
  H.bankAccounts,
303
301
  H.isBankAccountsError,
304
302
  H.isBankAccountsFetching,
305
303
  H.isBankAccountsLoading,
306
304
  B,
307
- v,
305
+ _,
308
306
  E,
309
307
  dt,
310
308
  He,
311
309
  ht,
310
+ S.bankAccountSaveFailed,
312
311
  q,
313
312
  C,
314
313
  pt,
@@ -317,7 +316,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
317
316
  ut,
318
317
  ot,
319
318
  qe
320
- ]), Dt = u((e) => {
319
+ ]), Dt = l((e) => {
321
320
  if (F.current) return F.current;
322
321
  let t = (async () => {
323
322
  Qe(!0);
@@ -328,11 +327,11 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
328
327
  }
329
328
  })();
330
329
  return F.current = t, t;
331
- }, [Et]), Ot = u(() => {
330
+ }, [Et]), Ot = l(() => {
332
331
  k(!1), E && Y();
333
- }, [E, Y]), kt = f(() => (V.data?.data ?? []).map((e) => ({
334
- name: re(e),
335
- email: c(e),
332
+ }, [E, Y]), kt = d(() => (V.data?.data ?? []).map((e) => ({
333
+ name: ie(e),
334
+ email: re(e),
336
335
  onSelect: () => {
337
336
  $(() => L(e.id));
338
337
  }
@@ -340,7 +339,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
340
339
  V.data,
341
340
  $,
342
341
  L
343
- ]), At = u((e) => {
342
+ ]), At = l((e) => {
344
343
  D(!0), W((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
345
344
  ...t,
346
345
  ...e,
@@ -354,7 +353,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
354
353
  ...t,
355
354
  ...e
356
355
  });
357
- }, [W]), jt = u((e) => {
356
+ }, [W]), jt = l((e) => {
358
357
  D(!0), W((t) => ({
359
358
  ...t,
360
359
  address: {
@@ -365,7 +364,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
365
364
  }, [W]), Mt = {
366
365
  query: w,
367
366
  onQueryChange: Pe,
368
- isLoading: bt || !Te || !Me || !!l && H.isLoading || V.isLoading || V.isFetching && it,
367
+ isLoading: bt || !Ee || !Me || !!c && H.isLoading || V.isLoading || V.isFetching && it,
369
368
  onAddVendor: () => {
370
369
  if (E === "create") {
371
370
  let e = w.trim(), [t, ...ee] = e.split(/\s+/);
@@ -382,7 +381,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
382
381
  $(() => X("create"));
383
382
  },
384
383
  results: kt
385
- }, Nt = ke && (E === "create" || !mt) ? {
384
+ }, Nt = Ae && (E === "create" || !mt) ? {
386
385
  isOpen: O,
387
386
  values: A,
388
387
  errors: We,
@@ -392,7 +391,7 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
392
391
  } : void 0, Pt = E !== "create" && Nt ? {
393
392
  ...Nt,
394
393
  onOpen: E === "edit" ? () => $(St) : Nt.onOpen,
395
- canEditExisting: Oe
394
+ canEditExisting: ke
396
395
  } : void 0, Ft = U.isSubmitting || at.isPending || ot.isPending, It = {
397
396
  prepareVendorForSave: Dt,
398
397
  isVendorSavePending: Ze || Ft,
@@ -407,16 +406,16 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
407
406
  paymentInstructions: a(Pt, !!G?.hasPaymentInstructions),
408
407
  paymentInstructionsEditor: Pt,
409
408
  detailsWarning: gt
410
- }, Lt = E === "create" && ke ? {
409
+ }, Lt = E === "create" && Ae ? {
411
410
  values: A,
412
411
  errors: We,
413
412
  onChange: Ct,
414
- isExtracted: !!(B && g(A, B))
413
+ isExtracted: !!(B && h(A, B))
415
414
  } : void 0;
416
415
  if (E) return {
417
416
  mode: "creating",
418
417
  summary: G,
419
- newVendorForm: /* @__PURE__ */ ye(_e, {
418
+ newVendorForm: /* @__PURE__ */ be(ve, {
420
419
  mode: E,
421
420
  values: U.values,
422
421
  errors: U.errors,
@@ -429,20 +428,20 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
429
428
  isSaving: Ft,
430
429
  search: rt ? Mt : void 0,
431
430
  paymentInstructions: Lt,
432
- labels: Ae?.inlineForm
431
+ labels: x?.inlineForm
433
432
  }),
434
433
  ...It
435
434
  };
436
435
  if (G) return {
437
436
  mode: "resolved",
438
437
  summary: G,
439
- onEdit: b && !ht ? () => $(() => X("edit")) : void 0,
438
+ onEdit: y && !ht ? () => $(() => X("edit")) : void 0,
440
439
  ...It
441
440
  };
442
441
  if (K && !bt) {
443
442
  let e = () => $(() => {
444
443
  Xe(!0), X("create");
445
- }), t = b && ke ? {
444
+ }), t = y && Ae ? {
446
445
  isOpen: !1,
447
446
  values: A,
448
447
  errors: We,
@@ -454,8 +453,8 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
454
453
  return {
455
454
  mode: "resolved",
456
455
  summary: K,
457
- onEdit: b ? e : void 0,
458
- error: De,
456
+ onEdit: y ? e : void 0,
457
+ error: Oe,
459
458
  ...It,
460
459
  showPaymentInstructions: !0,
461
460
  paymentInstructions: a(t, K.hasPaymentInstructions),
@@ -464,10 +463,10 @@ function _({ payableId: s, counterpartId: l, payableCounterpartId: _, payableCou
464
463
  }
465
464
  return {
466
465
  mode: "selecting",
467
- error: V.isError ? S.searchFailed : H.isError ? S.vendorDetailsFailed : De,
466
+ error: V.isError ? S.searchFailed : H.isError ? S.vendorDetailsFailed : Oe,
468
467
  search: Mt,
469
468
  ...It
470
469
  };
471
470
  }
472
471
  //#endregion
473
- export { _ as useVendorSectionProps };
472
+ export { g as useVendorSectionProps };
@@ -2,8 +2,8 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { BankAccountFormSheet as e } from "../../../../../shared/counterpart-management/ui/dist/index12.js";
6
- import { ConfirmDeleteDialog as t } from "../../../../../shared/counterpart-management/ui/dist/index15.js";
5
+ import { BankAccountFormSheet as e } from "../../../../../shared/counterpart-management/ui/dist/index11.js";
6
+ import { ConfirmDeleteDialog as t } from "../../../../../shared/counterpart-management/ui/dist/index13.js";
7
7
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
8
8
  import { EDIT_FORM_FIELD_KEYS as n, addressFormLabelOverrides as r, buildCounterpartEditFormView as i, editFormLabelOverrides as a, withAddressLabelOverrides as o } from "./viewModels.js";
9
9
  import { COUNTERPART_DETAILS_SHEET_LABELS_EN as s } from "../../../../ui/dist/index2.js";
@@ -6,7 +6,7 @@ import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/
6
6
  import "../../../../../shared/ui/dist/index.js";
7
7
  import { buildAnalyticsMap as t, buildCounterpartRows as n } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
8
8
  import { useCounterpartsQuery as r } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
9
- import { useCounterpartAddressesForRowsQuery as i } from "../../../../../shared/counterpart-management/data-access/dist/index7.js";
9
+ import { useCounterpartAddressesForRowsQuery as i } from "../../../../../shared/counterpart-management/data-access/dist/index5.js";
10
10
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
11
11
  import { PAYABLES_BILLED_STATUSES as a, PAYABLES_OWED_STATUSES as o, RECEIVABLES_BILLED_STATUSES as s, RECEIVABLES_DUE_STATUSES as c } from "./constants.js";
12
12
  import { usePayablesAnalyticsByCounterpartQuery as l, useReceivablesAnalyticsByCounterpartQuery as u } from "../../../../data-access/dist/index2.js";
@@ -9,7 +9,7 @@ import "../../../../../shared/ui/dist/index.js";
9
9
  import { COUNTERPART_MESSAGE_LABELS_EN as r } from "../../../../../shared/counterpart-management/feature/dist/lib/labels.js";
10
10
  import { getCounterpartEmail as i } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
11
11
  import { useCounterpartQuery as a, useCreateCounterpartMutation as o } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
12
- import { useCounterpartAddressesQuery as s } from "../../../../../shared/counterpart-management/data-access/dist/index7.js";
12
+ import { useCounterpartAddressesQuery as s } from "../../../../../shared/counterpart-management/data-access/dist/index5.js";
13
13
  import { useCounterpartForm as c } from "../../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
14
14
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
15
15
  import "../../../../ui/dist/index20.js";
@@ -1,7 +1,5 @@
1
1
  import "./index2.js";
2
2
  import { useCounterpartQuery as e, useCounterpartsByIdsQuery as t, useCounterpartsQuery as n, useCreateCounterpartMutation as r, useDeleteCounterpartMutation as i, useUpdateCounterpartMutation as a } from "./index3.js";
3
- import "./index4.js";
4
- import { useCounterpartBankAccountsQuery as o, useCreateCounterpartBankAccountMutation as s, useDeleteCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "./index5.js";
5
- import "./index6.js";
6
- import { useCounterpartAddressesForRowsQuery as u, useCounterpartAddressesQuery as d, useCreateCounterpartAddressMutation as f, useUpdateCounterpartAddressMutation as p } from "./index7.js";
3
+ import { useCounterpartBankAccountsQuery as o, useCreateCounterpartBankAccountMutation as s, useDeleteCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "./index4.js";
4
+ import { useCounterpartAddressesForRowsQuery as u, useCounterpartAddressesQuery as d, useCreateCounterpartAddressMutation as f, useUpdateCounterpartAddressMutation as p } from "./index5.js";
7
5
  export { u as useCounterpartAddressesForRowsQuery, d as useCounterpartAddressesQuery, o as useCounterpartBankAccountsQuery, e as useCounterpartQuery, t as useCounterpartsByIdsQuery, n as useCounterpartsQuery, f as useCreateCounterpartAddressMutation, s as useCreateCounterpartBankAccountMutation, r as useCreateCounterpartMutation, c as useDeleteCounterpartBankAccountMutation, i as useDeleteCounterpartMutation, p as useUpdateCounterpartAddressMutation, l as useUpdateCounterpartBankAccountMutation, a as useUpdateCounterpartMutation };