@tesouro/embedded-components-react 0.5.226 → 0.5.227

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 (105) hide show
  1. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index3.js +41 -39
  2. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index12.js +2 -2
  3. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index2.js +2 -2
  4. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +2 -2
  5. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +2 -2
  6. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +150 -147
  7. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +46 -51
  8. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +130 -128
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +31 -32
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +2 -2
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +2 -2
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +2 -2
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +2 -2
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +2 -2
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +36 -37
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/data-access/dist/index2.js +2 -2
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +2 -2
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index2.js +6 -10
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index3.js +2 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index4.js +2 -2
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index5.js +2 -2
  22. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js +2 -2
  23. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index7.js +2 -2
  24. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index8.js +2 -2
  25. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +154 -150
  26. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +2 -2
  27. package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index2.js +2 -2
  28. package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index3.js +2 -2
  29. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +151 -149
  30. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js +4 -4
  31. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index3.js +4 -4
  32. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index15.js +2 -2
  33. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index17.js +2 -2
  34. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index18.js +2 -2
  35. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index19.js +2 -2
  36. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index2.js +2 -2
  37. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index3.js +2 -2
  38. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index4.js +2 -2
  39. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index5.js +2 -2
  40. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index6.js +2 -2
  41. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index8.js +2 -2
  42. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index9.js +2 -2
  43. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index24.js +1 -0
  44. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index27.js +89 -87
  45. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +133 -130
  46. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js +36 -34
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +12 -12
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +6 -6
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +2 -2
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +40 -39
  51. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/data-access/dist/index4.js +2 -2
  52. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +209 -207
  53. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index4.js +10 -5
  54. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index5.js +10 -5
  55. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index6.js +11 -6
  56. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index2.js +2 -2
  57. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index3.js +2 -2
  58. package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/data-access/dist/index2.js +2 -2
  59. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index12.js +2 -2
  60. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +2 -2
  61. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index14.js +30 -28
  62. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index17.js +28 -26
  63. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index18.js +37 -34
  64. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index21.js +28 -26
  65. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index22.js +37 -34
  66. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +294 -292
  67. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index5.js +58 -58
  68. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +47 -48
  69. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index3.js +4 -4
  70. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +2 -2
  71. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js +4 -4
  72. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +39 -38
  73. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/EmbedApiContext.js +14 -13
  74. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/allPages.js +1 -1
  75. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/applicationStatusQueryOptions.js +16 -15
  76. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js +7 -5
  77. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/debit-card/useAllDebitCardsQuery.js +7 -5
  78. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js +2 -2
  79. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js +7 -5
  80. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js +28 -29
  81. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organizationStatus.js +10 -0
  82. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +26 -27
  83. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js +2 -2
  84. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js +31 -32
  85. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useRolePermissionsQueries.js +2 -2
  86. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useCurrentUserQuery.js +2 -2
  87. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useGetUserDataQuery.js +2 -2
  88. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMailboxAddress.js +2 -2
  89. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMyEntityQuery.js +2 -2
  90. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js +33 -34
  91. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js +33 -22
  92. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index3.js +2 -2
  93. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +43 -32
  94. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +138 -127
  95. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/deriveOrganizationStatus.js +6 -0
  96. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useWidgetFetch.js +1 -1
  97. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  98. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +2 -2
  99. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index2.js +2 -2
  100. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js +2 -2
  101. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +2 -2
  102. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +2 -2
  103. package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js +2 -2
  104. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js +60 -58
  105. package/package.json +1 -1
@@ -4,43 +4,38 @@
4
4
  "use client";
5
5
  import { getUsers as e } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
6
  import { getUsersOptions as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
- import { authEpochPlaceholder as n, withAuthEpoch as r } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
- import { useEmbedApi as i } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
- import { organizationHeaders as a } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
+ import { withAuthEpochInfinite as n } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import { useEmbedApi as r } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
+ import { organizationHeaders as i } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
10
10
  import "../../../shared/data-access/dist/index.js";
11
- import { useEffect as o, useMemo as s } from "react";
12
- import { useInfiniteQuery as c } from "@tanstack/react-query";
11
+ import { useEffect as a, useMemo as o } from "react";
12
+ import { useInfiniteQuery as s } from "@tanstack/react-query";
13
13
  //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js
14
- var l = 100, u = ["ACTIVE", "INVITED"];
15
- function d(u, d, f) {
16
- let { client: p, organizationId: m, authEpoch: h, organizationPending: g } = i(), _ = a(m), v = f?.length ? { Permissions: f } : {}, y = t({
17
- client: p,
18
- headers: _,
14
+ var c = 100, l = ["ACTIVE", "INVITED"];
15
+ function u(l, u, d) {
16
+ let { client: f, organizationId: p, authEpoch: m, organizationStatus: h } = r(), g = i(p), _ = d?.length ? { Permissions: d } : {}, v = t({
17
+ client: f,
18
+ headers: g,
19
19
  query: {
20
- Status: u,
21
- Limit: l,
22
- ...v
20
+ Status: l,
21
+ Limit: c,
22
+ ..._
23
23
  }
24
- }), b = c({
25
- queryKey: [
26
- ...r(y, {
27
- authEpoch: h,
28
- organizationPending: g
29
- }).queryKey,
30
- "all",
31
- u
32
- ],
33
- placeholderData: n(y.queryKey, g),
34
- enabled: d,
24
+ }), y = s({
25
+ ...n(v.queryKey, {
26
+ authEpoch: m,
27
+ organizationStatus: h
28
+ }, { suffix: ["all", l] }),
29
+ enabled: u,
35
30
  initialPageParam: void 0,
36
31
  queryFn: async ({ signal: t, pageParam: n }) => {
37
32
  let { data: r } = await e({
38
- client: p,
39
- headers: _,
33
+ client: f,
34
+ headers: g,
40
35
  query: {
41
- Status: u,
42
- Limit: l,
43
- ...v,
36
+ Status: l,
37
+ Limit: c,
38
+ ..._,
44
39
  ...n ? { PaginationToken: n } : {}
45
40
  },
46
41
  signal: t,
@@ -53,32 +48,32 @@ function d(u, d, f) {
53
48
  if (!(i === void 0 || r.includes(i))) return i;
54
49
  }
55
50
  });
56
- o(() => {
57
- d && b.hasNextPage && !b.isFetchingNextPage && !b.isError && b.fetchNextPage();
51
+ a(() => {
52
+ u && y.hasNextPage && !y.isFetchingNextPage && !y.isError && y.fetchNextPage();
58
53
  }, [
59
- d,
60
- b.hasNextPage,
61
- b.isFetchingNextPage,
62
- b.isError,
63
- b.fetchNextPage
54
+ u,
55
+ y.hasNextPage,
56
+ y.isFetchingNextPage,
57
+ y.isError,
58
+ y.fetchNextPage
64
59
  ]);
65
- let x = s(() => {
66
- if (b.data) return {
67
- data: b.data.pages.flatMap((e) => e.data ?? []),
60
+ let b = o(() => {
61
+ if (y.data) return {
62
+ data: y.data.pages.flatMap((e) => e.data ?? []),
68
63
  nextPaginationToken: null,
69
64
  prevPaginationToken: null
70
65
  };
71
- }, [b.data]);
66
+ }, [y.data]);
72
67
  return {
73
- ...b,
74
- data: x
68
+ ...y,
69
+ data: b
75
70
  };
76
71
  }
77
- function f({ enabled: e, permissions: t } = {}) {
78
- let { organizationId: n, widgetToken: r } = i(), a = !!(n && r) && (e === !0 || e === void 0), o = d("ACTIVE", a, t), c = d("INVITED", a, t), l = s(() => {
72
+ function d({ enabled: e, permissions: t } = {}) {
73
+ let { organizationId: n, widgetToken: i } = r(), a = !!(n && i) && (e === !0 || e === void 0), s = u("ACTIVE", a, t), c = u("INVITED", a, t), d = o(() => {
79
74
  let e = /* @__PURE__ */ new Map();
80
- for (let t of u) {
81
- let n = t === "ACTIVE" ? o.data?.data ?? [] : c.data?.data ?? [];
75
+ for (let t of l) {
76
+ let n = t === "ACTIVE" ? s.data?.data ?? [] : c.data?.data ?? [];
82
77
  for (let t of n) e.set(t.id, t);
83
78
  }
84
79
  return {
@@ -86,16 +81,16 @@ function f({ enabled: e, permissions: t } = {}) {
86
81
  nextPaginationToken: null,
87
82
  prevPaginationToken: null
88
83
  };
89
- }, [o.data, c.data]), f = o.isLoading || c.isLoading, p = o.isFetchingNextPage || c.isFetchingNextPage, m = o.hasNextPage || c.hasNextPage, h = o.isError || c.isError;
84
+ }, [s.data, c.data]), f = s.isLoading || c.isLoading, p = s.isFetchingNextPage || c.isFetchingNextPage, m = s.hasNextPage || c.hasNextPage, h = s.isError || c.isError;
90
85
  return {
91
- ...o,
92
- data: l,
86
+ ...s,
87
+ data: d,
93
88
  isLoading: f,
94
89
  isFetchingNextPage: p,
95
90
  hasNextPage: m,
96
91
  isError: h,
97
- isSuccess: o.isSuccess && c.isSuccess
92
+ isSuccess: s.isSuccess && c.isSuccess
98
93
  };
99
94
  }
100
95
  //#endregion
101
- export { f as useAllOrganizationUsersQuery };
96
+ export { d as useAllOrganizationUsersQuery };
@@ -4,198 +4,200 @@
4
4
  "use client";
5
5
  import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import { TESOURO_NEW_EMBEDDED_BANK_ACCOUNT_CREATED_SUCCESS_EVENT as t, emitWidgetDomEvent as n } from "../../../shared/util/dist/lib/widgetDomEvents.js";
7
- import { Scope as r } from "../../../shared/data-access/dist/lib/scopes.js";
8
- import { useAllBankAccountsQuery as ee } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
9
- import { useAllOrganizationRolesQuery as te } from "../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
7
+ import { OrganizationStatus as r, isOrganizationOnItsWay as ee } from "../../../shared/data-access/dist/lib/organizationStatus.js";
8
+ import { useEmbedApi as te } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
+ import { Scope as ne } from "../../../shared/data-access/dist/lib/scopes.js";
10
+ import { useAllBankAccountsQuery as re } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
11
+ import { useAllOrganizationRolesQuery as ie } from "../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
10
12
  import "../../../shared/data-access/dist/index.js";
11
13
  import { BankAccountsWidgetAnalyticsEvent as i } from "./index2.js";
12
- import { copyTextToClipboard as ne, formatAmountLabel as a, formatTotalAvailableBalanceLabel as re, maskAccountNumber as ie } from "./index3.js";
13
- import { DEFAULT_FEATURE_LABELS as ae } from "./index4.js";
14
- import { getBankAccountsPermissions as oe } from "./index5.js";
15
- import { toAccessRows as se, toOrganizationRoleOptions as ce, toTeamMembers as le } from "./index6.js";
16
- import { DEFAULT_LABELS as ue } from "../../ui/dist/lib/labels.js";
14
+ import { copyTextToClipboard as ae, formatAmountLabel as a, formatTotalAvailableBalanceLabel as oe, maskAccountNumber as o } from "./index3.js";
15
+ import { DEFAULT_FEATURE_LABELS as se } from "./index4.js";
16
+ import { getBankAccountsPermissions as ce } from "./index5.js";
17
+ import { toAccessRows as le, toOrganizationRoleOptions as ue, toTeamMembers as de } from "./index6.js";
18
+ import { DEFAULT_LABELS as fe } from "../../ui/dist/lib/labels.js";
17
19
  import "../../../shared/ui/dist/index.js";
18
20
  import "../../ui/dist/index.js";
19
- import { useAnalyticsTrack as de } from "../../../shared/feature/dist/lib/analytics/hooks.js";
20
- import { useWidgetConfig as fe, useWidgetError as pe, useWidgetLoading as me } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
21
+ import { useAnalyticsTrack as pe } from "../../../shared/feature/dist/lib/analytics/hooks.js";
22
+ import { useWidgetConfig as me, useWidgetError as he, useWidgetLoading as ge } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
21
23
  import "../../../shared/feature/dist/index.js";
22
- import { useCreateBankAccountMutation as he } from "../../data-access/dist/index3.js";
23
- import { useGrantBankAccountAccessMutation as ge } from "../../data-access/dist/index4.js";
24
- import { useAllOrganizationUsersQuery as o } from "../../data-access/dist/index5.js";
24
+ import { useCreateBankAccountMutation as _e } from "../../data-access/dist/index3.js";
25
+ import { useGrantBankAccountAccessMutation as ve } from "../../data-access/dist/index4.js";
26
+ import { useAllOrganizationUsersQuery as s } from "../../data-access/dist/index5.js";
25
27
  import "../../data-access/dist/index.js";
26
- import { filterRolesForOrganization as _e } from "../../../../shared/util-validation/dist/index6.js";
27
- import { useCallback as ve, useEffect as s, useMemo as c, useRef as ye, useState as l } from "react";
28
- import { useControllableState as be } from "@radix-ui/react-use-controllable-state";
28
+ import { filterRolesForOrganization as ye } from "../../../../shared/util-validation/dist/index6.js";
29
+ import { useCallback as be, useEffect as c, useMemo as l, useRef as xe, useState as u } from "react";
30
+ import { useControllableState as Se } from "@radix-ui/react-use-controllable-state";
29
31
  //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js
30
- var u = { nickname: "" }, xe = r.BankAccountWriteOrg;
31
- function d(e, t) {
32
+ var d = { nickname: "" }, Ce = ne.BankAccountWriteOrg;
33
+ function f(e, t) {
32
34
  return e !== void 0 && t !== void 0 && e !== t;
33
35
  }
34
- function f({ labels: r, featureLabels: a, isBankingTaglineVisible: ie = !0, bankLogoSrc: f, bankLogoAlt: Ce, depositAgreementUrl: we, selectedAccountId: Te, defaultSelectedAccountId: Ee, onSelectedAccountIdChange: De, "data-testid": Oe } = {}) {
35
- let ke = {
36
- ...ue,
37
- ...r
38
- }, p = {
39
- ...ae,
36
+ function p({ labels: ne, featureLabels: a, isBankingTaglineVisible: o = !0, bankLogoSrc: p, bankLogoAlt: Te, depositAgreementUrl: Ee, selectedAccountId: De, defaultSelectedAccountId: Oe, onSelectedAccountIdChange: ke, "data-testid": Ae } = {}) {
37
+ let je = {
38
+ ...fe,
39
+ ...ne
40
+ }, m = {
41
+ ...se,
40
42
  ...a
41
- }, m = de(), { organizationId: h, widgetToken: Ae, initResponse: g } = fe(), je = me(), _ = !!pe(), v = !!(h && Ae), y = c(() => oe(g?.scopes), [g?.scopes]), Me = v && y.canRead && !!g, b = g?.userId ?? void 0, [x, Ne] = l(h);
42
- h !== void 0 && h !== x && Ne(h);
43
- let [S, Pe] = l(b);
44
- b !== void 0 && b !== S && Pe(b);
45
- let [Fe, C] = be({
46
- prop: Te,
47
- defaultProp: Ee ?? null,
48
- onChange: De,
43
+ }, h = pe(), { organizationId: g, widgetToken: _, initResponse: v } = me(), Me = ge(), { organizationStatus: y } = te(), Ne = ee(y), b = !!he(), x = !!(g && _), Pe = x || !!_ && y === r.Rotating, S = l(() => ce(v?.scopes), [v?.scopes]), Fe = Pe && S.canRead && !!v, C = v?.userId ?? void 0, [w, Ie] = u(g);
44
+ g !== void 0 && g !== w && Ie(g);
45
+ let [T, Le] = u(C);
46
+ C !== void 0 && C !== T && Le(C);
47
+ let [Re, E] = Se({
48
+ prop: De,
49
+ defaultProp: Oe ?? null,
50
+ onChange: ke,
49
51
  caller: "BankAccountsWidget"
50
- }), w = ye({
51
- organizationId: x,
52
- userId: S
53
- }), Ie = d(w.current.organizationId, x) || d(w.current.userId, S);
54
- s(() => {
55
- let e = w.current;
56
- w.current = {
57
- organizationId: x,
58
- userId: S
59
- }, (d(e.organizationId, x) || d(e.userId, S)) && C(null);
52
+ }), D = xe({
53
+ organizationId: w,
54
+ userId: T
55
+ }), ze = f(D.current.organizationId, w) || f(D.current.userId, T);
56
+ c(() => {
57
+ let e = D.current;
58
+ D.current = {
59
+ organizationId: w,
60
+ userId: T
61
+ }, (f(e.organizationId, w) || f(e.userId, T)) && E(null);
60
62
  }, [
61
- x,
62
- S,
63
- C
63
+ w,
64
+ T,
65
+ E
64
66
  ]);
65
- let T = Ie ? null : Fe, E = Me && !T, D = ve((e) => {
66
- C(e);
67
- }, [C]), [O, k] = l(!1), [A, j] = l(u), [Le, M] = l([]), [Re, N] = l(!1), [P, F] = l(), [I, ze] = l({}), [L, R] = l({});
68
- s(() => {
69
- m(i.Mounted);
70
- }, [m]);
71
- let z = ee({ enabled: E }), B = he(), V = ge(), H = O, U = o({ enabled: H }), W = te({ enabled: H }), G = o({
72
- enabled: H,
73
- permissions: [xe]
74
- }), K = c(() => new Set((G.data?.data ?? []).filter((e) => e.organizationId === h).map((e) => e.id)), [G.data?.data, h]), q = c(() => {
75
- let e = W.data?.data ?? [], t = h ? _e(e, {
76
- organizationId: h,
77
- organizationTypes: g?.organizationTypes ?? []
67
+ let Be = ze ? null : Re, O = Fe && !Be, k = be((e) => {
68
+ E(e);
69
+ }, [E]), [A, j] = u(!1), [M, N] = u(d), [Ve, P] = u([]), [He, F] = u(!1), [Ue, I] = u(), [L, We] = u({}), [R, z] = u({});
70
+ c(() => {
71
+ h(i.Mounted);
72
+ }, [h]);
73
+ let B = re({ enabled: O }), V = _e(), H = ve(), U = A, W = s({ enabled: U }), G = ie({ enabled: U }), K = s({
74
+ enabled: U,
75
+ permissions: [Ce]
76
+ }), q = l(() => new Set((K.data?.data ?? []).filter((e) => e.organizationId === g).map((e) => e.id)), [K.data?.data, g]), J = l(() => {
77
+ let e = G.data?.data ?? [], t = g ? ye(e, {
78
+ organizationId: g,
79
+ organizationTypes: v?.organizationTypes ?? []
78
80
  }) : e;
79
- return le(U.data?.data ?? [], ce(t), K);
81
+ return de(W.data?.data ?? [], ue(t), q);
80
82
  }, [
81
- K,
83
+ q,
84
+ G.data?.data,
82
85
  W.data?.data,
83
- U.data?.data,
84
- h,
85
- g?.organizationTypes
86
- ]), J = U.isLoading || U.isFetchingNextPage || !!U.hasNextPage || W.isResolving || G.isLoading || G.isFetchingNextPage || !!G.hasNextPage, Be = !J && !U.isError && !G.isError, Y = E ? z.data?.data ?? [] : [], X = [.../* @__PURE__ */ new Set([...q.filter((e) => e.locked).map((e) => e.id), ...Le])], Ve = g?.bankName?.trim() ?? "", He = g?.vspName?.trim() ?? "", Ue = we?.trim() || void 0, Z = v && y.canWrite, Q = !z.hasNextPage && !z.isFetchingNextPage, We = c(() => Q ? re(Y) : void 0, [Y, Q]), Ge = Y.length > 1 && y.canRead && Q, $ = ve(async (t, n, r) => {
87
- await ne(r) && (e.success(n === "account" ? p.copyAccountNumberToast : p.copyRoutingNumberToast), R((e) => ({
86
+ g,
87
+ v?.organizationTypes
88
+ ]), Ge = W.isLoading || W.isFetchingNextPage || !!W.hasNextPage || G.isResolving || K.isLoading || K.isFetchingNextPage || !!K.hasNextPage, Ke = !Ge && !W.isError && !K.isError, Y = O ? B.data?.data ?? [] : [], X = [.../* @__PURE__ */ new Set([...J.filter((e) => e.locked).map((e) => e.id), ...Ve])], qe = v?.bankName?.trim() ?? "", Je = v?.vspName?.trim() ?? "", Ye = Ee?.trim() || void 0, Z = x && S.canWrite, Q = !B.hasNextPage && !B.isFetchingNextPage, Xe = l(() => Q ? oe(Y) : void 0, [Y, Q]), Ze = Y.length > 1 && S.canRead && Q, $ = be(async (t, n, r) => {
89
+ await ae(r) && (e.success(n === "account" ? m.copyAccountNumberToast : m.copyRoutingNumberToast), z((e) => ({
88
90
  ...e,
89
91
  [t]: n
90
92
  })), window.setTimeout(() => {
91
- R((e) => ({
93
+ z((e) => ({
92
94
  ...e,
93
95
  [t]: void 0
94
96
  }));
95
97
  }, 2e3));
96
- }, [p.copyAccountNumberToast, p.copyRoutingNumberToast]), Ke = c(() => Y.map((e) => Se(e, p, {
97
- isAccountNumberVisible: I[e.id] ?? !1,
98
- isAccountNumberCopied: L[e.id] === "account",
99
- isRoutingNumberCopied: L[e.id] === "routing",
100
- onToggleAccountNumberVisibility: () => ze((t) => ({
98
+ }, [m.copyAccountNumberToast, m.copyRoutingNumberToast]), Qe = l(() => Y.map((e) => we(e, m, {
99
+ isAccountNumberVisible: L[e.id] ?? !1,
100
+ isAccountNumberCopied: R[e.id] === "account",
101
+ isRoutingNumberCopied: R[e.id] === "routing",
102
+ onToggleAccountNumberVisibility: () => We((t) => ({
101
103
  ...t,
102
104
  [e.id]: !t[e.id]
103
105
  })),
104
106
  onCopyAccountNumber: () => void $(e.id, "account", e.accountNumber),
105
107
  onCopyRoutingNumber: () => void $(e.id, "routing", e.routingNumber),
106
108
  onSelect: () => {
107
- D(e.id), m(i.AccountSelected, { accountId: e.id });
109
+ k(e.id), h(i.AccountSelected, { accountId: e.id });
108
110
  }
109
111
  })), [
110
112
  Y,
111
- I,
112
113
  L,
113
- p,
114
+ R,
115
+ m,
114
116
  $,
115
- D,
116
- m
117
- ]), qe = (r) => {
118
- V.mutate({
117
+ k,
118
+ h
119
+ ]), $e = (r) => {
120
+ H.mutate({
119
121
  path: { id: r },
120
122
  body: { userIds: X }
121
123
  }, { onSuccess: () => {
122
- n(t), e.success(p.createSuccessToast), j(u), M([]), F(void 0), N(!1), k(!1);
124
+ n(t), e.success(m.createSuccessToast), N(d), P([]), I(void 0), F(!1), j(!1);
123
125
  } });
124
- }, Je = () => {
125
- if (Z && Be) {
126
- if (A.nickname.trim() === "") {
127
- N(!0);
126
+ }, et = () => {
127
+ if (Z && Ke) {
128
+ if (M.nickname.trim() === "") {
129
+ F(!0);
128
130
  return;
129
131
  }
130
132
  if (X.length === 0) {
131
133
  console.warn("No team members selected on submit");
132
134
  return;
133
135
  }
134
- if (P) {
135
- qe(P);
136
+ if (Ue) {
137
+ $e(Ue);
136
138
  return;
137
139
  }
138
- B.mutate({ body: { nickname: A.nickname.trim() } }, { onSuccess: (e) => {
139
- m(i.AccountCreated, { accountId: e?.id }), e?.id && (F(e.id), qe(e.id));
140
+ V.mutate({ body: { nickname: M.nickname.trim() } }, { onSuccess: (e) => {
141
+ h(i.AccountCreated, { accountId: e?.id }), e?.id && (I(e.id), $e(e.id));
140
142
  } });
141
143
  }
142
- }, Ye = (e, t) => {
143
- q.find((t) => t.id === e)?.locked || M((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
144
- }, Xe = (e) => {
145
- (!e || Z) && (e && (j(u), M([]), F(void 0), N(!1), B.reset(), V.reset()), k(e));
146
- }, Ze = B.isPending || V.isPending, Qe = se(q, {
147
- selectedUserIds: Le,
148
- disabled: Ze || !y.canWrite,
149
- fallbackTooltip: ke.teamMemberAccessTooltip,
150
- onUserToggle: Ye
144
+ }, tt = (e, t) => {
145
+ J.find((t) => t.id === e)?.locked || P((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
146
+ }, nt = (e) => {
147
+ (!e || Z) && (e && (N(d), P([]), I(void 0), F(!1), V.reset(), H.reset()), j(e));
148
+ }, rt = V.isPending || H.isPending, it = le(J, {
149
+ selectedUserIds: Ve,
150
+ disabled: rt || !S.canWrite,
151
+ fallbackTooltip: je.teamMemberAccessTooltip,
152
+ onUserToggle: tt
151
153
  });
152
154
  return {
153
- "data-testid": Oe,
154
- selectedAccountId: T,
155
- bankDisplayName: Ve,
156
- bankLogoSrc: f,
157
- bankLogoAlt: Ce,
158
- availableBalanceLabel: We,
159
- shouldDisplayAvailableBalance: Ge,
160
- isBankingTaglineVisible: ie,
161
- accountCards: Ke,
162
- shouldDisplayAddAccountCard: y.canWrite,
163
- isLoading: !_ && (!v || je && !g || E && (z.isLoading || z.isFetchingNextPage || z.hasNextPage)),
164
- isError: _ || E && z.isError,
165
- isCreateOpen: O,
166
- createForm: A,
155
+ "data-testid": Ae,
156
+ selectedAccountId: Be,
157
+ bankDisplayName: qe,
158
+ bankLogoSrc: p,
159
+ bankLogoAlt: Te,
160
+ availableBalanceLabel: Xe,
161
+ shouldDisplayAvailableBalance: Ze,
162
+ isBankingTaglineVisible: o,
163
+ accountCards: Qe,
164
+ shouldDisplayAddAccountCard: S.canWrite,
165
+ isLoading: !b && (Ne && !B.data || Me && !v || O && (B.isLoading || B.isFetchingNextPage || B.hasNextPage)),
166
+ isError: b || O && B.isError,
167
+ isCreateOpen: A,
168
+ createForm: M,
167
169
  legalCopy: {
168
- bankName: Ve,
169
- vspName: He,
170
- agreementUrl: Ue
170
+ bankName: qe,
171
+ vspName: Je,
172
+ agreementUrl: Ye
171
173
  },
172
- accessRows: Qe,
173
- isTeamMembersLoading: J,
174
- isTeamMembersError: U.isError || G.isError,
175
- isCreateSubmitDisabled: !Z || !Be || A.nickname.trim() === "" || X.length === 0,
176
- isCreateError: B.isError || V.isError,
177
- hasNicknameError: Re,
178
- isSubmitting: Ze,
174
+ accessRows: it,
175
+ isTeamMembersLoading: Ge,
176
+ isTeamMembersError: W.isError || K.isError,
177
+ isCreateSubmitDisabled: !Z || !Ke || M.nickname.trim() === "" || X.length === 0,
178
+ isCreateError: V.isError || H.isError,
179
+ hasNicknameError: He,
180
+ isSubmitting: rt,
179
181
  isCreateDisabled: !Z,
180
- onCreateOpenChange: Xe,
182
+ onCreateOpenChange: nt,
181
183
  onCreateFormChange: (e) => {
182
- N(!1), j(e);
184
+ F(!1), N(e);
183
185
  },
184
- onCreateSubmit: Je,
185
- onAddAccountClick: () => Xe(!0),
186
- onSelectAccount: D
186
+ onCreateSubmit: et,
187
+ onAddAccountClick: () => nt(!0),
188
+ onSelectAccount: k
187
189
  };
188
190
  }
189
- function Se(e, t, n) {
191
+ function we(e, t, n) {
190
192
  return {
191
193
  id: e.id,
192
194
  name: e.nickname?.trim() || t.accountFallback,
193
195
  balanceLabel: a(e.balance),
194
196
  accountNumberLabel: e.accountNumber,
195
- maskedAccountNumberLabel: ie(e.accountNumber),
197
+ maskedAccountNumberLabel: o(e.accountNumber),
196
198
  routingNumberLabel: e.routingNumber,
197
199
  ...n
198
200
  };
199
201
  }
200
202
  //#endregion
201
- export { f as useBankAccountsWidget };
203
+ export { p as useBankAccountsWidget };
@@ -4,39 +4,38 @@
4
4
  "use client";
5
5
  import { getPaymentRecords as e } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
6
  import { getPaymentRecordsOptions as t } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
- import { authEpochPlaceholder as n, withAuthEpoch as r } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
- import { useEmbedApi as i } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
- import { organizationHeaders as a } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
10
- import { getAllPagesNextPaginationTokenParam as o, isAllPagesResolving as s, useAutoFetchNextPage as c } from "../../../../shared/data-access/dist/lib/allPages.js";
7
+ import { withAuthEpochInfinite as n } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import { useEmbedApi as r } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
+ import { organizationHeaders as i } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
10
+ import { getAllPagesNextPaginationTokenParam as a, isAllPagesResolving as o, useAutoFetchNextPage as s } from "../../../../shared/data-access/dist/lib/allPages.js";
11
11
  import "../../../../shared/data-access/dist/index.js";
12
- import { useMemo as l } from "react";
13
- import { useInfiniteQuery as u } from "@tanstack/react-query";
12
+ import { useMemo as c } from "react";
13
+ import { useInfiniteQuery as l } from "@tanstack/react-query";
14
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js
15
- var d = 100;
16
- function f(f, { enabled: p } = {}) {
17
- let { client: m, organizationId: h, widgetToken: g, authEpoch: _, organizationPending: v } = i(), y = a(h), b = !!(h && g && f) && p !== !1, x = {
18
- limit: d,
19
- object_id__in: f ? [f] : [],
15
+ var u = 100;
16
+ function d(d, { enabled: f } = {}) {
17
+ let { client: p, organizationId: m, widgetToken: h, authEpoch: g, organizationStatus: _ } = r(), v = i(m), y = !!(m && h && d) && f !== !1, b = {
18
+ limit: u,
19
+ object_id__in: d ? [d] : [],
20
20
  order: "desc",
21
21
  sort: "paid_at"
22
- }, S = t({
23
- client: m,
24
- headers: y,
25
- query: x
26
- }), C = u({
27
- queryKey: [...r(S, {
28
- authEpoch: _,
29
- organizationPending: v
30
- }).queryKey, "all"],
31
- placeholderData: n(S.queryKey, v),
32
- enabled: b,
22
+ }, x = t({
23
+ client: p,
24
+ headers: v,
25
+ query: b
26
+ }), S = l({
27
+ ...n(x.queryKey, {
28
+ authEpoch: g,
29
+ organizationStatus: _
30
+ }, { suffix: ["all"] }),
31
+ enabled: y,
33
32
  initialPageParam: void 0,
34
33
  queryFn: async ({ signal: t, pageParam: n }) => {
35
34
  let { data: r } = await e({
36
- client: m,
37
- headers: y,
35
+ client: p,
36
+ headers: v,
38
37
  query: {
39
- ...x,
38
+ ...b,
40
39
  ...n ? { pagination_token: n } : {}
41
40
  },
42
41
  signal: t,
@@ -44,15 +43,15 @@ function f(f, { enabled: p } = {}) {
44
43
  });
45
44
  return r;
46
45
  },
47
- getNextPageParam: o
46
+ getNextPageParam: a
48
47
  });
49
- c(C, b);
50
- let w = l(() => C.data?.pages.flatMap((e) => e.data ?? []) ?? [], [C.data]);
48
+ s(S, y);
49
+ let C = c(() => S.data?.pages.flatMap((e) => e.data ?? []) ?? [], [S.data]);
51
50
  return {
52
- ...C,
53
- paymentRecords: w,
54
- isResolving: b && s(C)
51
+ ...S,
52
+ paymentRecords: C,
53
+ isResolving: y && o(S)
55
54
  };
56
55
  }
57
56
  //#endregion
58
- export { f as usePayablePaymentRecordsQuery };
57
+ export { d as usePayablePaymentRecordsQuery };
@@ -11,13 +11,13 @@ import "../../../../shared/data-access/dist/index.js";
11
11
  import { useQuery as a } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js
13
13
  function o(o, { enabled: s = !0 } = {}) {
14
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: f } = n(), p = !!(l && u && o) && s, m = e({
14
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = n(), p = !!(l && u && o) && s, m = e({
15
15
  client: c,
16
16
  headers: r(l),
17
17
  path: { payable_id: o ?? "" }
18
18
  }), { queryKey: h, queryFn: g } = t(m, {
19
19
  authEpoch: d,
20
- organizationPending: f
20
+ organizationStatus: f
21
21
  });
22
22
  return a({
23
23
  queryKey: h,
@@ -16,7 +16,7 @@ import "../../../data-access/dist/index.js";
16
16
  import { useMutation as d, useQuery as f } from "@tanstack/react-query";
17
17
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js
18
18
  function p(e, { enabled: t } = {}) {
19
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: p } = i(), m = !!(l && u && e) && t !== !1, h = n({
19
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: p } = i(), m = !!(l && u && e) && t !== !1, h = n({
20
20
  client: c,
21
21
  headers: a(l),
22
22
  query: {
@@ -28,7 +28,7 @@ function p(e, { enabled: t } = {}) {
28
28
  return f({
29
29
  ...r(h, {
30
30
  authEpoch: d,
31
- organizationPending: p
31
+ organizationStatus: p
32
32
  }),
33
33
  enabled: m
34
34
  });
@@ -13,7 +13,7 @@ import { payablePolicyAssignmentQueryOptions as a } from "./index20.js";
13
13
  import { useQuery as o } from "@tanstack/react-query";
14
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js
15
15
  function s(s, { enabled: c = !0, pollWhileOcrProcessing: l = !1, pollWhilePolicyAssignmentUnsettled: u = !1 } = {}) {
16
- let { client: d, organizationId: f, widgetToken: p, authEpoch: m, organizationPending: h } = n(), g = !!(f && p && s) && c, _ = l ? i({
16
+ let { client: d, organizationId: f, widgetToken: p, authEpoch: m, organizationStatus: h } = n(), g = !!(f && p && s) && c, _ = l ? i({
17
17
  client: d,
18
18
  organizationId: f,
19
19
  payableId: s ?? ""
@@ -35,7 +35,7 @@ function s(s, { enabled: c = !0, pollWhileOcrProcessing: l = !1, pollWhilePolicy
35
35
  return o({
36
36
  ...t(b, {
37
37
  authEpoch: m,
38
- organizationPending: h
38
+ organizationStatus: h
39
39
  }),
40
40
  enabled: g
41
41
  });
@@ -10,7 +10,7 @@ import "../../../../shared/data-access/dist/index.js";
10
10
  import { useQueries as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js
12
12
  function a(a, { enabled: o = !0 } = {}) {
13
- let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationPending: d } = n(), f = !!(c && l) && o, p = r(c);
13
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationStatus: d } = n(), f = !!(c && l) && o, p = r(c);
14
14
  return i({ queries: a.map((n) => ({
15
15
  ...t(e({
16
16
  client: s,
@@ -18,7 +18,7 @@ function a(a, { enabled: o = !0 } = {}) {
18
18
  path: { payable_id: n }
19
19
  }), {
20
20
  authEpoch: u,
21
- organizationPending: d
21
+ organizationStatus: d
22
22
  }),
23
23
  enabled: f
24
24
  })) });