@tesouro/embedded-components-react 0.2.267 → 0.2.270

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 (66) hide show
  1. package/README.md +15 -12
  2. package/dist/experimental/WidgetSuite.d.ts +25 -1
  3. package/dist/experimental/index.d.ts +25 -1
  4. package/dist/index.css +3 -0
  5. package/dist/index.d.ts +46 -22
  6. package/dist/lib/AcceptDisclosuresWidget.d.ts +25 -1
  7. package/dist/lib/BalancesWidget.d.ts +24 -0
  8. package/dist/lib/BankAccountOnboardingWidget.d.ts +25 -1
  9. package/dist/lib/BankAccountsWidget.d.ts +25 -1
  10. package/dist/lib/BillPayWidget.d.ts +24 -0
  11. package/dist/lib/CardDetailsWidget.d.ts +25 -1
  12. package/dist/lib/CardsWidget.d.ts +25 -1
  13. package/dist/lib/ChartOfAccountsWidget.d.ts +25 -1
  14. package/dist/lib/CounterpartsWidget.d.ts +25 -1
  15. package/dist/lib/CreateCardWidget.d.ts +25 -1
  16. package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +25 -1
  17. package/dist/lib/ExpenseManagementWidget.d.ts +25 -1
  18. package/dist/lib/ExpenseRequirementsWidget.d.ts +25 -1
  19. package/dist/lib/HelpWidget.d.ts +25 -1
  20. package/dist/lib/InsightsWidget.d.ts +24 -0
  21. package/dist/lib/InvoicingWidget.d.ts +25 -1
  22. package/dist/lib/LinkedAccountsWidget.d.ts +25 -1
  23. package/dist/lib/ProductsWidget.d.ts +25 -1
  24. package/dist/lib/ProfileWidget.d.ts +25 -1
  25. package/dist/lib/ReceiptMatchWidget.d.ts +25 -1
  26. package/dist/lib/ReceivablesWidget.d.ts +25 -1
  27. package/dist/lib/SettingsWidget.d.ts +25 -1
  28. package/dist/lib/TagsWidget.d.ts +25 -1
  29. package/dist/lib/TeamWidget.d.ts +25 -1
  30. package/dist/lib/TransfersWidget.d.ts +24 -0
  31. package/dist/lib/WidgetProvider.d.ts +25 -1
  32. package/dist/lib/WidgetProviderPublic.d.ts +24 -0
  33. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +9 -8
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +122 -121
  35. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +9 -8
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +11 -10
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +9 -8
  38. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +9 -8
  39. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index7.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +9 -8
  41. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +1 -1
  42. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +9 -8
  44. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +94 -93
  45. package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +7 -6
  46. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +9 -8
  47. package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +12 -11
  48. package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +7 -6
  49. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +9 -8
  50. package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +9 -8
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +9 -8
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +10 -9
  53. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +9 -8
  54. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +9 -8
  55. package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +9 -8
  56. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +10 -9
  57. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -21
  58. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/widgetGatewayHosts.js +14 -0
  59. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +76 -67
  60. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +107 -101
  61. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  62. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js +12 -4
  63. package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +9 -8
  64. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +106 -105
  65. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +9 -8
  66. package/package.json +1 -1
@@ -19,23 +19,24 @@ function c(n) {
19
19
  i(t.Mounted);
20
20
  }, [i]), /* @__PURE__ */ o(r, { ...n });
21
21
  }
22
- function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, linkComponent: l, implementation: u, uiFramework: d, errorFallback: f, onError: p, finopsThemeColors: m, analytics: h, pageTitleComponent: g = s, ..._ }) {
22
+ function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, pageTitleComponent: _ = s, ...v }) {
23
23
  return /* @__PURE__ */ o(i, {
24
24
  widgetName: n,
25
25
  baseUrl: e,
26
26
  widgetToken: t,
27
27
  organizationId: r,
28
28
  configClient: a,
29
- linkComponent: l,
30
- implementation: u,
31
- uiFramework: d,
32
- errorFallback: f,
33
- onError: p,
34
- finopsThemeColors: m,
35
- analytics: h,
29
+ gatewayRouting: l,
30
+ linkComponent: u,
31
+ implementation: d,
32
+ uiFramework: f,
33
+ errorFallback: p,
34
+ onError: m,
35
+ finopsThemeColors: h,
36
+ analytics: g,
36
37
  children: /* @__PURE__ */ o(c, {
37
- ..._,
38
- pageTitleComponent: g
38
+ ...v,
39
+ pageTitleComponent: _
39
40
  })
40
41
  });
41
42
  }
@@ -92,20 +92,21 @@ function w({ labels: i, tabsLabels: f, approvalPolicyLabels: w, approvalPolicyCo
92
92
  }) : null
93
93
  ] });
94
94
  }
95
- function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, ...d }) {
95
+ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, ...p }) {
96
96
  return /* @__PURE__ */ b(i, {
97
97
  widgetName: f,
98
98
  baseUrl: e,
99
99
  widgetToken: t,
100
100
  organizationId: n,
101
101
  configClient: r,
102
- linkComponent: a,
103
- implementation: o,
104
- uiFramework: s,
105
- errorFallback: c,
106
- onError: l,
107
- analytics: u,
108
- children: /* @__PURE__ */ b(w, { ...d })
102
+ gatewayRouting: a,
103
+ linkComponent: o,
104
+ implementation: s,
105
+ uiFramework: c,
106
+ errorFallback: l,
107
+ onError: u,
108
+ analytics: d,
109
+ children: /* @__PURE__ */ b(w, { ...p })
109
110
  });
110
111
  }
111
112
  //#endregion
@@ -83,20 +83,21 @@ function w({ cardId: r, cardProgram: l, onClose: w, labels: T, featureLabels: E,
83
83
  onRetry: N === d.Supported ? G : void 0
84
84
  })] });
85
85
  }
86
- function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: u, analytics: d, ...f }) {
86
+ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: u, onError: d, analytics: f, ...p }) {
87
87
  return /* @__PURE__ */ S(r, {
88
88
  widgetName: l,
89
89
  baseUrl: e,
90
90
  widgetToken: t,
91
91
  organizationId: n,
92
92
  configClient: i,
93
- linkComponent: a,
94
- implementation: o,
95
- uiFramework: s,
96
- errorFallback: c,
97
- onError: u,
98
- analytics: d,
99
- children: /* @__PURE__ */ S(w, { ...f })
93
+ gatewayRouting: a,
94
+ linkComponent: o,
95
+ implementation: s,
96
+ uiFramework: c,
97
+ errorFallback: u,
98
+ onError: d,
99
+ analytics: f,
100
+ children: /* @__PURE__ */ S(w, { ...p })
100
101
  });
101
102
  }
102
103
  //#endregion
@@ -58,7 +58,7 @@ function u({ cardProgram: s, pagination: u, defaultPagination: d, onPaginationCh
58
58
  resetKey: O,
59
59
  paginationToken: T.paginationToken,
60
60
  pageSize: T.pageSize
61
- })), [De, Oe] = o(!1), [ke, M] = he({
61
+ })), [De, Oe] = o(!0), [ke, M] = he({
62
62
  prop: ve,
63
63
  defaultProp: ye ?? null,
64
64
  onChange: be,
@@ -68,20 +68,21 @@ function m({ cardProgram: e, pagination: t, defaultPagination: m, onPaginationCh
68
68
  }, V)
69
69
  })] });
70
70
  }
71
- function h({ baseUrl: n, widgetToken: r, organizationId: i, configClient: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, ...p }) {
71
+ function h({ baseUrl: n, widgetToken: r, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: p, ...h }) {
72
72
  return /* @__PURE__ */ f(e, {
73
73
  widgetName: t,
74
74
  baseUrl: n,
75
75
  widgetToken: r,
76
76
  organizationId: i,
77
77
  configClient: a,
78
- linkComponent: o,
79
- implementation: s,
80
- uiFramework: c,
81
- errorFallback: l,
82
- onError: u,
83
- analytics: d,
84
- children: /* @__PURE__ */ f(m, { ...p })
78
+ gatewayRouting: o,
79
+ linkComponent: s,
80
+ implementation: c,
81
+ uiFramework: l,
82
+ errorFallback: u,
83
+ onError: d,
84
+ analytics: p,
85
+ children: /* @__PURE__ */ f(m, { ...h })
85
86
  });
86
87
  }
87
88
  //#endregion
@@ -24,7 +24,7 @@ function w({ columnCount: e }) {
24
24
  children: Array.from({ length: e }).map((e, n) => /* @__PURE__ */ v(a, { children: /* @__PURE__ */ v(t, { className: "ttw:h-4 ttw:w-24" }) }, n))
25
25
  }, r)) });
26
26
  }
27
- function T({ rows: t, columns: _, isLoading: C = !1, isError: T = !1, canToggleShowMyCards: E = !1, isShowingMyCards: D = !1, onShowMyCardsChange: O, canCreateCard: k = !1, onCreateCardClick: A, onRetry: j, isPaginationVisible: M = !1, pageSize: N = 10, pageSizeOptions: P = S, rangeLabel: F = "", isPreviousPageDisabled: I = !1, isNextPageDisabled: L = !1, onPageSizeChange: R, onPreviousPageClick: z, onNextPageClick: B, labels: V }) {
27
+ function T({ rows: t, columns: _, isLoading: C = !1, isError: T = !1, canToggleShowMyCards: E = !1, isShowingMyCards: D = !0, onShowMyCardsChange: O, canCreateCard: k = !1, onCreateCardClick: A, onRetry: j, isPaginationVisible: M = !1, pageSize: N = 10, pageSizeOptions: P = S, rangeLabel: F = "", isPreviousPageDisabled: I = !1, isNextPageDisabled: L = !1, onPageSizeChange: R, onPreviousPageClick: z, onNextPageClick: B, labels: V }) {
28
28
  let H = h(), U = g(() => p(V), [V]), W = !!(k && A), G = R && z && B ? {
29
29
  onPageSizeChange: R,
30
30
  onPreviousPageClick: z,
@@ -19,7 +19,7 @@ function l({ isOpen: l, onClose: u, labels: d, contentClassName: f, children: p
19
19
  },
20
20
  children: /* @__PURE__ */ c(t, {
21
21
  showCloseButton: !1,
22
- className: i("ttw:w-168 ttw:sm:max-w-168", f ?? "ttw:overflow-y-auto"),
22
+ className: i("ttw:w-168 ttw:sm:max-w-168", "ttw:!gap-0", f ?? "ttw:overflow-y-auto"),
23
23
  children: [
24
24
  /* @__PURE__ */ s(r, {
25
25
  className: "ttw:sr-only",
@@ -198,20 +198,21 @@ function g({ counterpartType: t, pageSizeOptions: s = c, showTitle: g, onViewAll
198
198
  })
199
199
  ] });
200
200
  }
201
- function _({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, linkComponent: a, implementation: o, uiFramework: c, errorFallback: l, onError: u, analytics: d, ...f }) {
201
+ function _({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, ...p }) {
202
202
  return /* @__PURE__ */ m(t, {
203
203
  widgetName: s,
204
204
  baseUrl: e,
205
205
  widgetToken: n,
206
206
  organizationId: r,
207
207
  configClient: i,
208
- linkComponent: a,
209
- implementation: o,
210
- uiFramework: c,
211
- errorFallback: l,
212
- onError: u,
213
- analytics: d,
214
- children: /* @__PURE__ */ m(g, { ...f }, f.counterpartType)
208
+ gatewayRouting: a,
209
+ linkComponent: o,
210
+ implementation: c,
211
+ uiFramework: l,
212
+ errorFallback: u,
213
+ onError: d,
214
+ analytics: f,
215
+ children: /* @__PURE__ */ m(g, { ...p }, p.counterpartType)
215
216
  });
216
217
  }
217
218
  //#endregion
@@ -16,25 +16,25 @@ import { CREATE_CARD_WIDGET_LABELS_EN as o } from "../../ui/dist/lib/CreateCardW
16
16
  import { CreateCardView as s, MailingOptionValue as c } from "../../ui/dist/lib/CreateCardWidget/types.js";
17
17
  import { CreateCardWidget as te } from "../../ui/dist/lib/CreateCardWidget/CreateCardWidget.js";
18
18
  import "../../ui/dist/index.js";
19
- import { CardFormatValue as l, buildCreateDebitCardRequest as ne, createDebitCardReference as re, formatBusinessAddress as ie, isBusinessAddressComplete as ae, isManualAddressComplete as oe } from "./index3.js";
20
- import { resolveCreateCardFeatureLabels as se } from "./index4.js";
21
- import { CreateCardWidgetAnalyticsEvent as ce, WIDGET_NAME as u } from "./index2.js";
22
- import { getCreateCardPermissions as le } from "./index5.js";
23
- import { useCreateCardCardholderOptions as ue } from "./index6.js";
24
- import { useCreateCard as de } from "../../data-access/dist/index2.js";
25
- import { useCreateDebitCardMutation as fe } from "../../data-access/dist/index4.js";
26
- import { useCreateCardOrganizationQuery as pe } from "../../data-access/dist/index5.js";
19
+ import { CardFormatValue as l, buildCreateDebitCardRequest as u, createDebitCardReference as ne, formatBusinessAddress as re, isBusinessAddressComplete as ie, isManualAddressComplete as ae } from "./index3.js";
20
+ import { resolveCreateCardFeatureLabels as oe } from "./index4.js";
21
+ import { CreateCardWidgetAnalyticsEvent as se, WIDGET_NAME as d } from "./index2.js";
22
+ import { getCreateCardPermissions as ce } from "./index5.js";
23
+ import { useCreateCardCardholderOptions as le } from "./index6.js";
24
+ import { useCreateCard as ue } from "../../data-access/dist/index2.js";
25
+ import { useCreateDebitCardMutation as de } from "../../data-access/dist/index4.js";
26
+ import { useCreateCardOrganizationQuery as fe } from "../../data-access/dist/index5.js";
27
27
  import "../../data-access/dist/index.js";
28
- import { useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
29
- import { Fragment as me, jsx as h, jsxs as he } from "react/jsx-runtime";
28
+ import { useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
29
+ import { Fragment as pe, jsx as g, jsxs as me } from "react/jsx-runtime";
30
30
  //#region ../../libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js
31
- var g = {
31
+ var _ = {
32
32
  street: "",
33
33
  city: "",
34
34
  state: "",
35
35
  zip: ""
36
- }, ge = 3e3, _e = 5e3;
37
- function ve(e, t) {
36
+ }, he = 3e3, ge = 5e3;
37
+ function _e(e, t) {
38
38
  if (e === "PENDING_ACTIVATION") return {
39
39
  title: t.success.pendingActivationTitle,
40
40
  description: t.success.pendingActivationDescription
@@ -44,157 +44,158 @@ function ve(e, t) {
44
44
  description: t.success.createdDescription
45
45
  };
46
46
  }
47
- function _(e) {
47
+ function v(e) {
48
48
  let t = e?.trim().slice(-4);
49
49
  return t ? `••••${t}` : void 0;
50
50
  }
51
- function v(e, t) {
52
- let n = e.nickname?.trim(), r = _(e.accountNumber);
51
+ function y(e, t) {
52
+ let n = e.nickname?.trim(), r = v(e.accountNumber);
53
53
  return n && r ? `${n} (${r})` : n || r || t;
54
54
  }
55
- function y({ cardArtSrc: ee, labels: u, featureLabels: _, className: y, onClose: b, onCancel: ye, onViewCard: x }) {
56
- let S = r(), { isReady: C } = de(), { initResponse: w, organizationId: T } = a(), E = f(() => le(w?.scopes), [w?.scopes]), D = se(_), O = {
55
+ function b({ cardArtSrc: ee, labels: d, featureLabels: v, className: b, onClose: x, onCancel: ve, onViewCard: S }) {
56
+ let C = r(), { isReady: w } = ue(), { initResponse: T, organizationId: E } = a(), D = p(() => ce(T?.scopes), [T?.scopes]), O = oe(v), k = {
57
57
  ...o,
58
- ...u,
58
+ ...d,
59
59
  setup: {
60
60
  ...o.setup,
61
- ...u?.setup
61
+ ...d?.setup
62
62
  }
63
- }, be = f(() => [{
63
+ }, ye = p(() => [{
64
64
  value: l.Virtual,
65
- label: O.setup.cardFormatVirtual
65
+ label: k.setup.cardFormatVirtual
66
66
  }, {
67
67
  value: l.Physical,
68
- label: O.setup.cardFormatPhysical
69
- }], [O.setup.cardFormatPhysical, O.setup.cardFormatVirtual]), xe = f(() => i(), []), [Se, k] = m(s.Setup), [A, j] = m(null), [M, N] = m(null), [Ce, P] = m(null), [F, I] = m(null), [L, R] = m(g), [z, B] = m(null), [V, H] = m(null), U = () => {
70
- j(null), N(null), P(null), I(null), R(g), B(null), H(null), k(s.Setup);
71
- }, W = p(T);
72
- T && T !== W.current && (W.current = T, U());
73
- let G = p(!0);
74
- d(() => (G.current = !0, () => {
75
- G.current = !1;
76
- }), []), d(() => {
77
- S(ce.Mounted);
78
- }, [S]);
79
- let { options: we, isError: K, refetch: Te } = ue({ enabled: C && E.canReadUsers && E.canReadRoles }), Ee = pe({ enabled: C && E.canReadOrganization }), q = t({ enabled: C && E.canReadFundingAccounts }), J = fe(), Y = !!q.isError && C && E.canReadFundingAccounts, X = f(() => Y ? [] : (q.data?.data ?? []).map((e) => ({
68
+ label: k.setup.cardFormatPhysical
69
+ }], [k.setup.cardFormatPhysical, k.setup.cardFormatVirtual]), be = p(() => i(), []), [xe, A] = h(s.Setup), [j, M] = h(null), [N, P] = h(null), [Se, F] = h(null), [I, L] = h(null), [R, z] = h(_), [B, V] = h(null), [H, U] = h(null), W = () => {
70
+ M(null), P(null), F(null), L(null), z(_), V(null), U(null), A(s.Setup);
71
+ }, G = m(E);
72
+ E && E !== G.current && (G.current = E, W());
73
+ let K = m(!0);
74
+ f(() => (K.current = !0, () => {
75
+ K.current = !1;
76
+ }), []), f(() => {
77
+ C(se.Mounted);
78
+ }, [C]);
79
+ let { options: Ce, isError: q, refetch: we } = le({ enabled: w && D.canReadUsers && D.canReadRoles }), Te = fe({ enabled: w && D.canReadOrganization }), J = t({ enabled: w && D.canReadFundingAccounts }), Ee = de(), Y = !!J.isError && w && D.canReadFundingAccounts, X = p(() => Y ? [] : (J.data?.data ?? []).map((e) => ({
80
80
  value: e.id,
81
- label: v(e, D.untitledFundingAccount)
81
+ label: y(e, O.untitledFundingAccount)
82
82
  })), [
83
- q.data?.data,
84
- D.untitledFundingAccount,
83
+ J.data?.data,
84
+ O.untitledFundingAccount,
85
85
  Y
86
- ]), Z = Ce ?? (X.length === 1 ? X[0].value : null), Q = Ee.data?.address, De = ie(Q), Oe = ae(Q), $ = M === l.Physical, ke = $ && F === c.BusinessAddress && !!De, Ae = $ && F === c.DifferentAddress, je = Y || X.length > 0, Me = !C || !E.canIssue || J.isPending || K || Y || !A || !M || !Z || M === l.Physical && (!F || F === c.BusinessAddress && !Oe || F === c.DifferentAddress && !oe(L)), Ne = f(() => {
87
- let e = ve(V, D);
86
+ ]), Z = Se ?? (X.length === 1 ? X[0].value : null), Q = Te.data?.address, De = re(Q), Oe = ie(Q), $ = N === l.Physical, ke = $ && I === c.BusinessAddress && !!De, Ae = $ && I === c.DifferentAddress, je = Y || X.length > 0, Me = !w || !D.canIssue || Ee.isPending || q || Y || !j || !N || !Z || N === l.Physical && (!I || I === c.BusinessAddress && !Oe || I === c.DifferentAddress && !ae(R)), Ne = p(() => {
87
+ let e = _e(H, O);
88
88
  return {
89
- ...u,
89
+ ...d,
90
90
  success: {
91
- ...u?.success,
91
+ ...d?.success,
92
92
  ...e
93
93
  }
94
94
  };
95
95
  }, [
96
- V,
97
- D,
98
- u
96
+ H,
97
+ O,
98
+ d
99
99
  ]), Pe = async () => {
100
- if (!C) return;
101
- let t = re(), n = ne({
102
- cardholderUserId: A,
103
- format: M,
100
+ if (!w) return;
101
+ let t = ne(), n = u({
102
+ cardholderUserId: j,
103
+ format: N,
104
104
  bankAccountId: Z,
105
105
  reference: t,
106
- mailingOption: F,
106
+ mailingOption: I,
107
107
  orgAddress: Q,
108
- manualAddress: L
108
+ manualAddress: R
109
109
  });
110
110
  if (!n) return;
111
- k(s.Preparing);
112
- let r = e.loading(D.toast.creating);
111
+ A(s.Preparing);
112
+ let r = e.loading(O.toast.creating);
113
113
  try {
114
- let t = await J.mutateAsync({ body: n });
115
- if (!G.current) {
114
+ let t = await Ee.mutateAsync({ body: n });
115
+ if (!K.current) {
116
116
  e.dismiss(r);
117
117
  return;
118
118
  }
119
- B(t.id), H(t.cardStatus), k(s.Success), e.success(D.toast.success, {
119
+ V(t.id), U(t.cardStatus), A(s.Success), e.success(O.toast.success, {
120
120
  id: r,
121
- duration: ge
121
+ duration: he
122
122
  });
123
123
  } catch {
124
- if (!G.current) {
124
+ if (!K.current) {
125
125
  e.dismiss(r);
126
126
  return;
127
127
  }
128
- k(s.Setup), e.error(D.toast.error, {
128
+ A(s.Setup), e.error(O.toast.error, {
129
129
  id: r,
130
- duration: _e
130
+ duration: ge
131
131
  });
132
132
  }
133
133
  };
134
- return /* @__PURE__ */ he(me, { children: [/* @__PURE__ */ h(n, {}), /* @__PURE__ */ h(te, {
135
- view: Se,
134
+ return /* @__PURE__ */ me(pe, { children: [/* @__PURE__ */ g(n, {}), /* @__PURE__ */ g(te, {
135
+ view: xe,
136
136
  cardArtSrc: ee,
137
137
  labels: Ne,
138
- className: y,
139
- cardholderOptions: we,
140
- selectedCardholder: A,
141
- onCardholderSelect: j,
142
- isCardholderError: K,
143
- onCardholderRetry: K ? Te : void 0,
144
- cardFormatOptions: be,
145
- selectedCardFormat: M,
138
+ className: b,
139
+ cardholderOptions: Ce,
140
+ selectedCardholder: j,
141
+ onCardholderSelect: M,
142
+ isCardholderError: q,
143
+ onCardholderRetry: q ? we : void 0,
144
+ cardFormatOptions: ye,
145
+ selectedCardFormat: N,
146
146
  onCardFormatSelect: (e) => {
147
- N(e), I(null);
147
+ P(e), L(null);
148
148
  },
149
149
  isFundingAccountVisible: je,
150
150
  fundingAccountOptions: X,
151
151
  selectedFundingAccount: Z,
152
- onFundingAccountSelect: P,
152
+ onFundingAccountSelect: F,
153
153
  isFundingAccountError: Y,
154
154
  onFundingAccountRetry: Y ? () => {
155
- q.refetch();
155
+ J.refetch();
156
156
  } : void 0,
157
157
  isMailingSectionVisible: $,
158
- selectedMailingOption: F,
159
- onMailingOptionSelect: I,
158
+ selectedMailingOption: I,
159
+ onMailingOptionSelect: L,
160
160
  businessAddress: De,
161
161
  isBusinessAddressVisible: ke,
162
162
  isManualAddressVisible: Ae,
163
- manualAddress: L,
164
- onManualAddressChange: (e) => R((t) => ({
163
+ manualAddress: R,
164
+ onManualAddressChange: (e) => z((t) => ({
165
165
  ...t,
166
166
  ...e
167
167
  })),
168
- stateOptions: xe,
168
+ stateOptions: be,
169
169
  isCreateDisabled: Me,
170
170
  onCreateClick: () => {
171
171
  Pe();
172
172
  },
173
173
  onCancelClick: () => {
174
- ye?.(), b?.();
174
+ ve?.(), x?.();
175
175
  },
176
- onClose: b,
177
- onCreateAnotherClick: U,
178
- onViewCardClick: x && z ? () => {
179
- x(z);
176
+ onClose: x,
177
+ onCreateAnotherClick: W,
178
+ onViewCardClick: S && B ? () => {
179
+ S(B);
180
180
  } : void 0
181
181
  })] });
182
182
  }
183
- function b({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, linkComponent: i, implementation: a, uiFramework: o, errorFallback: s, onError: c, analytics: te, ...l }) {
184
- return /* @__PURE__ */ h(ee, {
185
- widgetName: u,
183
+ function x({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: te, analytics: l, ...u }) {
184
+ return /* @__PURE__ */ g(ee, {
185
+ widgetName: d,
186
186
  baseUrl: e,
187
187
  widgetToken: t,
188
188
  organizationId: n,
189
189
  configClient: r,
190
- linkComponent: i,
191
- implementation: a,
192
- uiFramework: o,
193
- errorFallback: s,
194
- onError: c,
195
- analytics: te,
196
- children: /* @__PURE__ */ h(y, { ...l })
190
+ gatewayRouting: i,
191
+ linkComponent: a,
192
+ implementation: o,
193
+ uiFramework: s,
194
+ errorFallback: c,
195
+ onError: te,
196
+ analytics: l,
197
+ children: /* @__PURE__ */ g(b, { ...u })
197
198
  });
198
199
  }
199
200
  //#endregion
200
- export { b as CreateCardWidget, v as formatFundingAccountLabel };
201
+ export { x as CreateCardWidget, y as formatFundingAccountLabel };
@@ -201,18 +201,19 @@ function R() {
201
201
  onDeleteRule: (e) => void le(e)
202
202
  })] });
203
203
  }
204
- function z({ token: e, orgId: t, widgetToken: n, organizationId: r, baseUrl: i, configClient: a, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: d } = {}) {
204
+ function z({ token: e, orgId: t, widgetToken: n, organizationId: r, baseUrl: i, configClient: a, gatewayRouting: s, linkComponent: c, implementation: l, uiFramework: u, errorFallback: d, onError: p } = {}) {
205
205
  return /* @__PURE__ */ S(o, {
206
206
  widgetName: f,
207
207
  baseUrl: i,
208
208
  widgetToken: n ?? e,
209
209
  organizationId: r ?? t,
210
210
  configClient: a,
211
- linkComponent: s,
212
- implementation: c,
213
- uiFramework: l,
214
- errorFallback: u,
215
- onError: d,
211
+ gatewayRouting: s,
212
+ linkComponent: c,
213
+ implementation: l,
214
+ uiFramework: u,
215
+ errorFallback: d,
216
+ onError: p,
216
217
  children: /* @__PURE__ */ S(R, {})
217
218
  });
218
219
  }
@@ -29,20 +29,21 @@ function u({ labels: t, receiptUpload: r, receiptsContent: u, matchingContent: d
29
29
  requirementsContent: p ?? /* @__PURE__ */ l(o, {})
30
30
  });
31
31
  }
32
- function d({ baseUrl: e, widgetToken: n, organizationId: i, configClient: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: d, onError: f, analytics: p, ...m }) {
32
+ function d({ baseUrl: e, widgetToken: n, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: d, errorFallback: f, onError: p, analytics: m, ...h }) {
33
33
  return /* @__PURE__ */ l(t, {
34
34
  widgetName: r,
35
35
  baseUrl: e,
36
36
  widgetToken: n,
37
37
  organizationId: i,
38
38
  configClient: a,
39
- linkComponent: o,
40
- implementation: s,
41
- uiFramework: c,
42
- errorFallback: d,
43
- onError: f,
44
- analytics: p,
45
- children: /* @__PURE__ */ l(u, { ...m })
39
+ gatewayRouting: o,
40
+ linkComponent: s,
41
+ implementation: c,
42
+ uiFramework: d,
43
+ errorFallback: f,
44
+ onError: p,
45
+ analytics: m,
46
+ children: /* @__PURE__ */ l(u, { ...h })
46
47
  });
47
48
  }
48
49
  //#endregion
@@ -46,24 +46,25 @@ function m({ isOpen: e, onClose: t, ...n }) {
46
46
  ...n
47
47
  }) : null;
48
48
  }
49
- function h({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, linkComponent: a, implementation: s, uiFramework: c, errorFallback: l, onError: u, isOpen: f, preSelectedReceiptIds: p, onClose: h, targetTransactionId: g, onSingleTransactionUpdate: _ }) {
49
+ function h({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: f, isOpen: p, preSelectedReceiptIds: h, onClose: g, targetTransactionId: _, onSingleTransactionUpdate: v }) {
50
50
  return /* @__PURE__ */ d(n, {
51
51
  widgetName: o,
52
52
  baseUrl: e,
53
53
  widgetToken: t,
54
54
  organizationId: r,
55
55
  configClient: i,
56
- linkComponent: a,
57
- implementation: s,
58
- uiFramework: c,
59
- errorFallback: l,
60
- onError: u,
56
+ gatewayRouting: a,
57
+ linkComponent: s,
58
+ implementation: c,
59
+ uiFramework: l,
60
+ errorFallback: u,
61
+ onError: f,
61
62
  children: /* @__PURE__ */ d(m, {
62
- isOpen: f,
63
- preSelectedReceiptIds: p,
64
- onClose: h,
65
- targetTransactionId: g,
66
- onSingleTransactionUpdate: _
63
+ isOpen: p,
64
+ preSelectedReceiptIds: h,
65
+ onClose: g,
66
+ targetTransactionId: _,
67
+ onSingleTransactionUpdate: v
67
68
  })
68
69
  });
69
70
  }
@@ -63,18 +63,19 @@ function x() {
63
63
  })]
64
64
  })] });
65
65
  }
66
- function S({ token: e, orgId: t, widgetToken: n, organizationId: r, baseUrl: a, configClient: o, linkComponent: s, implementation: c, uiFramework: u, errorFallback: d, onError: f } = {}) {
66
+ function S({ token: e, orgId: t, widgetToken: n, organizationId: r, baseUrl: a, configClient: o, gatewayRouting: s, linkComponent: c, implementation: u, uiFramework: d, errorFallback: f, onError: p } = {}) {
67
67
  return /* @__PURE__ */ h(i, {
68
68
  widgetName: l,
69
69
  baseUrl: a,
70
70
  widgetToken: n ?? e,
71
71
  organizationId: r ?? t,
72
72
  configClient: o,
73
- linkComponent: s,
74
- implementation: c,
75
- uiFramework: u,
76
- errorFallback: d,
77
- onError: f,
73
+ gatewayRouting: s,
74
+ linkComponent: c,
75
+ implementation: u,
76
+ uiFramework: d,
77
+ errorFallback: f,
78
+ onError: p,
78
79
  children: /* @__PURE__ */ h(x, {})
79
80
  });
80
81
  }
@@ -111,20 +111,21 @@ function b({ onEdit: r, onDelete: o, onAdd: b, screenLabels: x, formLabels: S, d
111
111
  })
112
112
  ] })] });
113
113
  }
114
- function x({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, linkComponent: a, implementation: s, uiFramework: c, analytics: l, errorFallback: u, onError: d, ...f }) {
114
+ function x({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gatewayRouting: a, linkComponent: s, implementation: c, uiFramework: l, analytics: u, errorFallback: d, onError: f, ...p }) {
115
115
  return /* @__PURE__ */ _(r, {
116
116
  widgetName: o,
117
117
  baseUrl: e,
118
118
  widgetToken: t,
119
119
  organizationId: n,
120
120
  configClient: i,
121
- linkComponent: a,
122
- implementation: s,
123
- uiFramework: c,
124
- analytics: l,
125
- errorFallback: u,
126
- onError: d,
127
- children: /* @__PURE__ */ _(b, { ...f })
121
+ gatewayRouting: a,
122
+ linkComponent: s,
123
+ implementation: c,
124
+ uiFramework: l,
125
+ analytics: u,
126
+ errorFallback: d,
127
+ onError: f,
128
+ children: /* @__PURE__ */ _(b, { ...p })
128
129
  });
129
130
  }
130
131
  //#endregion