@tesouro/embedded-components-react 0.3.13 → 0.3.15

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 (57) hide show
  1. package/dist/index.d.ts +30 -30
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +2 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +23 -205
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +200 -185
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +199 -50
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +105 -13
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +12 -46
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +46 -30
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +26 -158
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +162 -31
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +32 -98
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +102 -13
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +13 -242
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +247 -4
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +4 -30
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +28 -82
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +76 -137
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +145 -3
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +3 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +2 -43
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +45 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +1 -8
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +6 -9
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +9 -92
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +94 -3
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +3 -9
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -20
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +14 -51
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +59 -3
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +3 -110
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +107 -8
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +8 -40
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -15
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +18 -98
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +92 -173
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +180 -4
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +5 -8
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +6 -112
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +114 -1
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +0 -24
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +25 -0
  45. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index247.js +9 -9
  46. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index392.js +124 -124
  47. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index418.js +116 -116
  48. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index443.js +94 -94
  49. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +9 -9
  50. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +6 -3
  51. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +1 -0
  52. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +1 -1
  53. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +1028 -1019
  54. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  55. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  56. package/dist/packages/shared-ui-shadcn/dist/index.js +2625 -2626
  57. package/package.json +1 -1
@@ -6,157 +6,157 @@ import { useMoniteContext as r } from "./index47.js";
6
6
  import { useRootElements as i } from "./index206.js";
7
7
  import "./index207.js";
8
8
  import { useFileInput as a } from "./index209.js";
9
- import { useComponentSettings as o } from "./index215.js";
9
+ import { useComponentSettings as ee } from "./index215.js";
10
10
  import "./index217.js";
11
- import { Dialog as s } from "./index229.js";
11
+ import { Dialog as o } from "./index229.js";
12
12
  import "./index230.js";
13
- import { MoniteScopedProviders as c } from "./index237.js";
14
- import { useUserPermissions as ee } from "./index116.js";
15
- import { AccessRestriction as l } from "./index247.js";
13
+ import { MoniteScopedProviders as s } from "./index237.js";
14
+ import { useUserPermissions as te } from "./index116.js";
15
+ import { AccessRestriction as c } from "./index247.js";
16
16
  import "./index249.js";
17
- import { usePayableCallbacks as u } from "./index361.js";
18
- import { PayableDetails as d } from "./index425.js";
19
- import { PayablesTable as f } from "./index438.js";
17
+ import { usePayableCallbacks as l } from "./index361.js";
18
+ import { PayableDetails as u } from "./index425.js";
19
+ import { PayablesTable as ne } from "./index438.js";
20
20
  import "./index426.js";
21
21
  import "./index439.js";
22
- import { CreatePayableMenu as p } from "./index441.js";
22
+ import { CreatePayableMenu as d } from "./index441.js";
23
23
  import "./index442.js";
24
- import { useEffect as te, useMemo as ne, useRef as re, useState as m } from "react";
25
- import { jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
26
- import { toast as _ } from "react-hot-toast";
27
- import { useLingui as v } from "@lingui/react";
24
+ import { useEffect as re, useMemo as ie, useRef as ae, useState as f } from "react";
25
+ import { jsx as p, jsxs as m } from "@emotion/react/jsx-runtime";
26
+ import { toast as h } from "react-hot-toast";
27
+ import { useLingui as g } from "@lingui/react";
28
28
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index443.js
29
- var y = (e) => /* @__PURE__ */ h(c, { children: /* @__PURE__ */ h(b, { ...e }) }), b = ({ pageTitleComponent: c, enableGLCodes: y, initialView: b, initialCounterpartId: x, onSaved: S, onCanceled: C, onSubmitted: w, onRejected: T, onApproved: ie, onReopened: ae, onDeleted: oe, onPay: se }) => {
30
- let { i18n: E } = v(), { api: D, queryClient: O, theme: k } = r(), { componentSettings: A } = o(), { handleSaved: j, handleCanceled: M, handleSubmitted: N, handleRejected: P, handleApproved: F, handleReopened: I, handleDeleted: L, handlePay: R } = u({
31
- onSaved: S,
32
- onCanceled: C,
33
- onSubmitted: w,
34
- onRejected: T,
35
- onApproved: ie,
36
- onReopened: ae,
37
- onDeleted: oe,
38
- onPay: se
39
- }), [z, B] = m({
29
+ var _ = (e) => /* @__PURE__ */ p(s, { children: /* @__PURE__ */ p(v, { ...e }) }), v = ({ pageTitleComponent: s, enableGLCodes: _, initialView: v, initialCounterpartId: y, onSaved: b, onCanceled: x, onSubmitted: S, onRejected: C, onApproved: oe, onReopened: se, onDeleted: ce, onPay: le }) => {
30
+ let { i18n: w } = g(), { api: T, queryClient: E, theme: D } = r(), { componentSettings: O } = ee(), { handleSaved: k, handleCanceled: A, handleSubmitted: j, handleRejected: M, handleApproved: N, handleReopened: P, handleDeleted: F, handlePay: I } = l({
31
+ onSaved: b,
32
+ onCanceled: x,
33
+ onSubmitted: S,
34
+ onRejected: C,
35
+ onApproved: oe,
36
+ onReopened: se,
37
+ onDeleted: ce,
38
+ onPay: le
39
+ }), [L, R] = f({
40
40
  invoiceId: void 0,
41
41
  open: !1,
42
42
  shouldOpenEditMode: !1
43
- }), V = () => {
44
- B((e) => ({
43
+ }), z = () => {
44
+ R((e) => ({
45
45
  ...e,
46
46
  open: !1,
47
47
  shouldOpenEditMode: !1,
48
48
  invoiceId: void 0
49
49
  }));
50
- }, [ce, H] = m(!1), [U, W] = m(void 0), G = re(!1), K = () => {
51
- H(!1), W(void 0);
52
- }, { FileInput: le, openFileInput: ue, checkFileError: de } = a(), q = D.finops.postPayablesUploadFromFile.useMutation({}, {
53
- onSuccess: () => D.finops.getPayables.invalidateQueries(O),
50
+ }, [B, V] = f(!1), [H, U] = f(void 0), W = ae(!1), G = () => {
51
+ V(!1), U(void 0);
52
+ }, { FileInput: ue, openFileInput: de, checkFileError: fe } = a(), K = T.finops.postPayablesUploadFromFile.useMutation({}, {
53
+ onSuccess: () => T.finops.getPayables.invalidateQueries(E),
54
54
  onError: () => {}
55
- }), J = (e) => {
55
+ }), q = (e) => {
56
56
  let n = e instanceof File ? [e] : Array.from(e);
57
57
  if (n.length > 10) {
58
- _.error(E._("You can only upload up to {fileCount} files at a time", { fileCount: 10 }));
58
+ h.error(w._("You can only upload up to {fileCount} files at a time", { fileCount: 10 }));
59
59
  return;
60
60
  }
61
61
  n.forEach((e) => {
62
- let n = de(e);
62
+ let n = fe(e);
63
63
  if (n) {
64
- _.error(n);
64
+ h.error(n);
65
65
  return;
66
66
  }
67
- _.promise(q.mutateAsync({ file: e }), {
68
- loading: E._("Uploading {fileName}", { fileName: e.name }),
69
- success: E._("Payable {fileName} uploaded successfully", { fileName: e.name }),
70
- error: (e) => t(E, e)
67
+ h.promise(K.mutateAsync({ file: e }), {
68
+ loading: w._("Uploading {fileName}", { fileName: e.name }),
69
+ success: w._("Payable {fileName} uploaded successfully", { fileName: e.name }),
70
+ error: (e) => t(w, e)
71
71
  });
72
72
  });
73
- }, Y = ee(), X = Y.has(e.PayableWriteOrg), Z = Y.has(e.PayableReadOrg);
74
- te(() => {
75
- G.current || b === "create" && X && (G.current = !0, W(x), H(!0));
73
+ }, J = te(), Y = J.has(e.PayableWriteOrg), X = J.has(e.PayableReadOrg);
74
+ re(() => {
75
+ W.current || v === "create" && Y && (W.current = !0, U(y), V(!0));
76
76
  }, [
77
- b,
78
- X,
79
- x
77
+ v,
78
+ Y,
79
+ y
80
80
  ]);
81
- let { root: Q } = i(), $ = y ?? A?.payables?.enableGLCodes ?? !1, fe = ne(() => n(k.components?.styles?.payables?.button), [k.components?.styles?.payables?.button]);
82
- return /* @__PURE__ */ g("div", {
81
+ let { root: Z } = i(), Q = "Monite-Payables-Header", $ = _ ?? O?.payables?.enableGLCodes ?? !1, pe = ie(() => n(D.components?.styles?.payables?.button), [D.components?.styles?.payables?.button]);
82
+ return /* @__PURE__ */ m("div", {
83
83
  className: "Monite-Payables",
84
- style: fe,
84
+ style: pe,
85
85
  children: [
86
- c(/* @__PURE__ */ h(p, {
87
- isCreateAllowed: X,
86
+ s(/* @__PURE__ */ p(d, {
87
+ isCreateAllowed: Y,
88
88
  onCreateInvoice: () => {
89
- W(void 0), H(!0);
89
+ U(void 0), V(!0);
90
90
  },
91
- handleFileUpload: J
91
+ handleFileUpload: q
92
92
  })),
93
- !Z && /* @__PURE__ */ h(l, {}),
94
- Z && /* @__PURE__ */ h(f, {
95
- initialCounterpartId: b === "create" ? void 0 : x,
96
- onRowClick: (e) => B({
93
+ !X && /* @__PURE__ */ p(c, {}),
94
+ X && /* @__PURE__ */ p(ne, {
95
+ initialCounterpartId: v === "create" ? void 0 : y,
96
+ onRowClick: (e) => R({
97
97
  open: !0,
98
98
  invoiceId: e
99
99
  }),
100
- onPay: R,
101
- onApproved: F,
102
- onCanceled: M,
103
- onSubmitted: N,
104
- openFileInput: ue,
105
- setIsCreateInvoiceDialogOpen: H,
106
- openEditDialog: (e) => B({
100
+ onPay: I,
101
+ onApproved: N,
102
+ onCanceled: A,
103
+ onSubmitted: j,
104
+ openFileInput: de,
105
+ setIsCreateInvoiceDialogOpen: V,
106
+ openEditDialog: (e) => R({
107
107
  open: !0,
108
108
  invoiceId: e,
109
109
  shouldOpenEditMode: !0
110
110
  })
111
111
  }),
112
- /* @__PURE__ */ h(le, {
113
- "aria-label": E._("Upload payable files"),
112
+ /* @__PURE__ */ p(ue, {
113
+ "aria-label": w._("Upload payable files"),
114
114
  multiple: !0,
115
115
  onChange: (e) => {
116
116
  let t = e.target.files;
117
- t && J(t);
117
+ t && q(t);
118
118
  }
119
119
  }),
120
- /* @__PURE__ */ h(s, {
121
- className: "Monite-Payables-Header-Dialog-PayableDetails",
122
- open: z.open,
123
- container: Q,
124
- onClose: V,
125
- onClosed: V,
120
+ /* @__PURE__ */ p(o, {
121
+ className: Q + "-Dialog-PayableDetails",
122
+ open: L.open,
123
+ container: Z,
124
+ onClose: z,
125
+ onClosed: z,
126
126
  fullScreen: !0,
127
- children: /* @__PURE__ */ h(d, {
128
- id: z.invoiceId,
129
- shouldOpenInEditMode: z.shouldOpenEditMode,
127
+ children: /* @__PURE__ */ p(u, {
128
+ id: L.invoiceId,
129
+ shouldOpenInEditMode: L.shouldOpenEditMode,
130
130
  enableGLCodes: $,
131
- onClose: V,
132
- onSaved: j,
133
- onCanceled: M,
134
- onSubmitted: N,
135
- onRejected: P,
136
- onApproved: F,
137
- onReopened: I,
131
+ onClose: z,
132
+ onSaved: k,
133
+ onCanceled: A,
134
+ onSubmitted: j,
135
+ onRejected: M,
136
+ onApproved: N,
137
+ onReopened: P,
138
138
  onDeleted: (e) => {
139
- L?.(e), V(), _(E._("Bill #{payableId} has been deleted", { payableId: e }), { duration: 5e3 });
139
+ F?.(e), z(), h(w._("Bill #{payableId} has been deleted", { payableId: e }), { duration: 5e3 });
140
140
  },
141
- onPay: R
141
+ onPay: I
142
142
  })
143
143
  }),
144
- /* @__PURE__ */ h(s, {
145
- className: "Monite-Payables-Header-Dialog-CreatePayable",
146
- open: ce,
147
- container: Q,
148
- onClose: K,
144
+ /* @__PURE__ */ p(o, {
145
+ className: Q + "-Dialog-CreatePayable",
146
+ open: B,
147
+ container: Z,
148
+ onClose: G,
149
149
  fullScreen: !0,
150
- children: /* @__PURE__ */ h(d, {
150
+ children: /* @__PURE__ */ p(u, {
151
151
  shouldOpenInEditMode: !0,
152
- initialCounterpartId: U,
152
+ initialCounterpartId: H,
153
153
  enableGLCodes: $,
154
- onClose: K,
154
+ onClose: G,
155
155
  onSaved: (e) => {
156
- B({
156
+ R({
157
157
  open: !0,
158
158
  invoiceId: e
159
- }), K(), j?.(e);
159
+ }), G(), k?.(e);
160
160
  }
161
161
  })
162
162
  })
@@ -164,4 +164,4 @@ var y = (e) => /* @__PURE__ */ h(c, { children: /* @__PURE__ */ h(b, { ...e }) }
164
164
  });
165
165
  };
166
166
  //#endregion
167
- export { y as Payables };
167
+ export { _ as Payables };
@@ -8,15 +8,15 @@ import "../../ui/dist/index.js";
8
8
  import { COUNTERPART_MESSAGE_LABELS_EN as s } from "./lib/labels.js";
9
9
  import { buildAnalyticsMap as c, buildCounterpartRows as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as d, formatCounterpartDate as f, formatMoney as p, getAchInstructions as m, getCounterpartEmail as h, getCounterpartName as g, getPayableAchInstructions as _, hasAchFormValues as v, hasSelectedText as y, resolveCounterpartBankAccountWrite as b, validateAchFormValues as x } from "./lib/helpers.js";
10
10
  import { useCounterpartsQuery as S } from "../../data-access/dist/index3.js";
11
- import { useCreateCounterpartBankAccountMutation as C, useUpdateCounterpartBankAccountMutation as w } from "../../data-access/dist/index5.js";
12
- import { useCounterpartAddressesForRowsQuery as T, useCounterpartAddressesQuery as E } from "../../data-access/dist/index7.js";
11
+ import { useCounterpartBankAccountsQuery as C, useCreateCounterpartBankAccountMutation as w, useUpdateCounterpartBankAccountMutation as T } from "../../data-access/dist/index5.js";
12
+ import { useCounterpartAddressesForRowsQuery as E, useCounterpartAddressesQuery as D } from "../../data-access/dist/index7.js";
13
13
  import "../../data-access/dist/index.js";
14
- import { useAddressForm as D } from "./lib/useAddressForm.js";
15
- import { useCounterpartDetails as O } from "./lib/useCounterpartDetails.js";
16
- import { useCounterpartForm as k } from "./lib/useCounterpartForm.js";
14
+ import { useAddressForm as O } from "./lib/useAddressForm.js";
15
+ import { useCounterpartDetails as k } from "./lib/useCounterpartDetails.js";
16
+ import { useCounterpartForm as A } from "./lib/useCounterpartForm.js";
17
17
  import "./lib/useCounterpartSelector.js";
18
- import { CounterpartSelector as A } from "./lib/CounterpartSelector.js";
19
- import { useDeleteController as j } from "./lib/useDeleteController.js";
18
+ import { CounterpartSelector as j } from "./lib/CounterpartSelector.js";
19
+ import { useDeleteController as M } from "./lib/useDeleteController.js";
20
20
  import "./lib/useSubEntityForm.js";
21
- import { useBankAccountForm as M } from "./lib/subEntityForms.js";
22
- export { e as AchFieldGroup, a as AddressFormSheet, i as BankAccountFormSheet, s as COUNTERPART_MESSAGE_LABELS_EN, o as ConfirmDeleteDialog, t as CounterpartFormFields, n as CounterpartFormSheet, A as CounterpartSelector, c as buildAnalyticsMap, l as buildCounterpartRows, u as counterpartFormBankAccountToCreatePayload, d as counterpartFormBankAccountToUpdatePayload, f as formatCounterpartDate, p as formatMoney, m as getAchInstructions, h as getCounterpartEmail, g as getCounterpartName, _ as getPayableAchInstructions, v as hasAchFormValues, y as hasSelectedText, b as resolveCounterpartBankAccountWrite, D as useAddressForm, M as useBankAccountForm, T as useCounterpartAddressesForRowsQuery, E as useCounterpartAddressesQuery, O as useCounterpartDetails, k as useCounterpartForm, S as useCounterpartsQuery, C as useCreateCounterpartBankAccountMutation, j as useDeleteController, r as useFocusFirstInvalidField, w as useUpdateCounterpartBankAccountMutation, x as validateAchFormValues };
21
+ import { useBankAccountForm as N } from "./lib/subEntityForms.js";
22
+ export { e as AchFieldGroup, a as AddressFormSheet, i as BankAccountFormSheet, s as COUNTERPART_MESSAGE_LABELS_EN, o as ConfirmDeleteDialog, t as CounterpartFormFields, n as CounterpartFormSheet, j as CounterpartSelector, c as buildAnalyticsMap, l as buildCounterpartRows, u as counterpartFormBankAccountToCreatePayload, d as counterpartFormBankAccountToUpdatePayload, f as formatCounterpartDate, p as formatMoney, m as getAchInstructions, h as getCounterpartEmail, g as getCounterpartName, _ as getPayableAchInstructions, v as hasAchFormValues, y as hasSelectedText, b as resolveCounterpartBankAccountWrite, O as useAddressForm, N as useBankAccountForm, E as useCounterpartAddressesForRowsQuery, D as useCounterpartAddressesQuery, C as useCounterpartBankAccountsQuery, k as useCounterpartDetails, A as useCounterpartForm, S as useCounterpartsQuery, w as useCreateCounterpartBankAccountMutation, M as useDeleteController, r as useFocusFirstInvalidField, T as useUpdateCounterpartBankAccountMutation, x as validateAchFormValues };
@@ -268,14 +268,14 @@ function N(e) {
268
268
  function P(e) {
269
269
  return N(e.bankAccount);
270
270
  }
271
- function F(e) {
271
+ function F(e, t = {}) {
272
272
  return {
273
273
  account_holder_name: e.accountHolderName.trim() || void 0,
274
274
  account_number: e.accountNumber.trim() || void 0,
275
275
  routing_number: e.routingNumber.trim() || void 0,
276
276
  country: "US",
277
277
  currency: "USD",
278
- is_default_for_currency: !0
278
+ is_default_for_currency: t.isDefaultForCurrency ?? !0
279
279
  };
280
280
  }
281
281
  function I(e, t = {}) {
@@ -309,7 +309,10 @@ function R(e, t) {
309
309
  kind: "update",
310
310
  bankAccountId: n.id,
311
311
  includeAchDefaults: !0
312
- } : { kind: "create" };
312
+ } : {
313
+ kind: "create",
314
+ isDefaultForCurrency: !(e ?? []).some((e) => e.currency === "USD" && e.is_default_for_currency)
315
+ };
313
316
  }
314
317
  function z() {
315
318
  return {
@@ -27,6 +27,7 @@ function o({ selectedId: o, enabled: s = !0 }) {
27
27
  isOrganization: d,
28
28
  isLoading: l.isLoading,
29
29
  isBankAccountsLoading: m.isLoading,
30
+ isBankAccountsFetching: m.isFetching,
30
31
  isError: l.isError,
31
32
  isBankAccountsError: m.isError,
32
33
  primaryAddress: g,
@@ -113,7 +113,7 @@ function D({ view: r, setView: D, selectedId: O, setSelectedId: k, messages: A,
113
113
  body: a(U.bankAccount, { includeAchDefaults: r.includeAchDefaults })
114
114
  }) : r?.kind === "create" ? z.mutateAsync({
115
115
  path: { counterpart_id: O },
116
- body: i(U.bankAccount)
116
+ body: i(U.bankAccount, { isDefaultForCurrency: r.isDefaultForCurrency })
117
117
  }) : void 0, [c, l] = await Promise.allSettled([e, o]);
118
118
  if (r?.kind === "create" && l.status === "fulfilled" && X(l.value?.id), c.status === "rejected") throw c.reason;
119
119
  if (l.status === "rejected") throw l.reason;