@tesouro/embedded-components-react 0.5.225 → 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 (142) hide show
  1. package/README.md +21 -21
  2. package/dist/index.d.ts +23 -2
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +23 -2
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index3.js +41 -39
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index12.js +2 -2
  8. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index2.js +2 -2
  9. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +2 -2
  10. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +2 -2
  11. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +150 -147
  12. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +46 -51
  13. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +130 -128
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +31 -32
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +2 -2
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +2 -2
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +2 -2
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +2 -2
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +2 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +36 -37
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/data-access/dist/index2.js +2 -2
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +2 -2
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index2.js +6 -10
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index3.js +2 -2
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index4.js +2 -2
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index5.js +2 -2
  27. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js +2 -2
  28. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index7.js +2 -2
  29. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index8.js +2 -2
  30. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +154 -150
  31. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +2 -2
  32. package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index2.js +2 -2
  33. package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index3.js +2 -2
  34. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +151 -149
  35. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js +4 -4
  36. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index3.js +4 -4
  37. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index15.js +2 -2
  38. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index17.js +2 -2
  39. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index18.js +2 -2
  40. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index19.js +2 -2
  41. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index2.js +2 -2
  42. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index3.js +2 -2
  43. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index4.js +2 -2
  44. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index5.js +2 -2
  45. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index6.js +2 -2
  46. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index8.js +2 -2
  47. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index9.js +2 -2
  48. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index24.js +1 -0
  49. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index27.js +89 -87
  50. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +133 -130
  51. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js +36 -34
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +50 -36
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +6 -6
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +2 -2
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +40 -39
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +51 -32
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +20 -1
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +17 -202
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +220 -31
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +32 -145
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -44
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +145 -117
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +46 -58
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +113 -87
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +58 -116
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +98 -225
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +111 -27
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +225 -462
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +34 -41
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +627 -34
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +39 -77
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -112
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +75 -310
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +124 -0
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +324 -0
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +20 -15
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +56 -53
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +33 -29
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +184 -162
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +1 -3
  83. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +78 -69
  84. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/data-access/dist/index4.js +2 -2
  85. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +209 -207
  86. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index4.js +10 -5
  87. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index5.js +10 -5
  88. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index6.js +11 -6
  89. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index2.js +2 -2
  90. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index3.js +2 -2
  91. package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/data-access/dist/index2.js +2 -2
  92. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index12.js +2 -2
  93. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +2 -2
  94. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index14.js +30 -28
  95. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index17.js +28 -26
  96. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index18.js +37 -34
  97. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index21.js +28 -26
  98. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index22.js +37 -34
  99. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +294 -292
  100. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index5.js +58 -58
  101. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +47 -48
  102. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index3.js +4 -4
  103. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +2 -2
  104. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js +4 -4
  105. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +7 -6
  106. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +20 -19
  107. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -39
  108. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/EmbedApiContext.js +14 -13
  109. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/allPages.js +1 -1
  110. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/applicationStatusQueryOptions.js +16 -15
  111. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js +7 -5
  112. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/debit-card/useAllDebitCardsQuery.js +7 -5
  113. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js +2 -2
  114. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js +7 -5
  115. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js +28 -29
  116. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organizationStatus.js +10 -0
  117. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +26 -27
  118. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js +2 -2
  119. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +210 -199
  120. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +60 -52
  121. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js +31 -32
  122. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useRolePermissionsQueries.js +2 -2
  123. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useCurrentUserQuery.js +2 -2
  124. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useGetUserDataQuery.js +2 -2
  125. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMailboxAddress.js +2 -2
  126. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMyEntityQuery.js +2 -2
  127. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js +33 -34
  128. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js +33 -22
  129. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index3.js +2 -2
  130. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +43 -32
  131. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +138 -127
  132. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/deriveOrganizationStatus.js +6 -0
  133. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useWidgetFetch.js +1 -1
  134. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  135. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +2 -2
  136. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index2.js +2 -2
  137. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js +2 -2
  138. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +2 -2
  139. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +2 -2
  140. package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js +2 -2
  141. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js +60 -58
  142. package/package.json +1 -1
@@ -2,28 +2,30 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { useAllBankAccountsQuery as e } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
5
+ import { OrganizationStatus as e, isOrganizationOnItsWay as t } from "../../../shared/data-access/dist/lib/organizationStatus.js";
6
+ import { useEmbedApi as n } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
+ import { useAllBankAccountsQuery as ee } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
6
8
  import "../../../shared/data-access/dist/index.js";
7
- import { useAnalyticsTrack as t } from "../../../shared/feature/dist/lib/analytics/hooks.js";
8
- import { useWidgetConfig as n, useWidgetError as ee, useWidgetLoading as te } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
+ import { useAnalyticsTrack as te } from "../../../shared/feature/dist/lib/analytics/hooks.js";
10
+ import { useWidgetConfig as ne, useWidgetError as re, useWidgetLoading as ie } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
11
  import { CardProgram as r } from "../../../shared/feature/dist/lib/card/cardProgram.js";
10
12
  import "../../../shared/feature/dist/index.js";
11
- import { resolveCardsFeatureLabels as ne } from "./index5.js";
12
- import { getCardsPermissions as re } from "./index7.js";
13
- import { CardsWidgetAnalyticsEvent as ie } from "./index2.js";
14
- import { maskAccountNumber as ae } from "./index6.js";
15
- import { CARD_COLUMNS_BY_PROGRAM as oe, toCardRows as se, toCreditCardListItems as ce, toDebitCardListItems as le } from "./index8.js";
16
- import { useCreditCardsQuery as ue } from "../../data-access/dist/index2.js";
17
- import { useDebitCardsQuery as de } from "../../data-access/dist/index3.js";
13
+ import { resolveCardsFeatureLabels as ae } from "./index5.js";
14
+ import { getCardsPermissions as oe } from "./index7.js";
15
+ import { CardsWidgetAnalyticsEvent as se } from "./index2.js";
16
+ import { maskAccountNumber as ce } from "./index6.js";
17
+ import { CARD_COLUMNS_BY_PROGRAM as le, toCardRows as ue, toCreditCardListItems as de, toDebitCardListItems as fe } from "./index8.js";
18
+ import { useCreditCardsQuery as pe } from "../../data-access/dist/index2.js";
19
+ import { useDebitCardsQuery as me } from "../../data-access/dist/index3.js";
18
20
  import "../../data-access/dist/index.js";
19
- import { useCallback as i, useEffect as a, useMemo as o, useRef as fe, useState as s } from "react";
20
- import { useControllableState as pe } from "@radix-ui/react-use-controllable-state";
21
+ import { useCallback as i, useEffect as a, useMemo as o, useRef as he, useState as s } from "react";
22
+ import { useControllableState as ge } from "@radix-ui/react-use-controllable-state";
21
23
  //#region ../../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js
22
- var me = [
24
+ var _e = [
23
25
  10,
24
26
  25,
25
27
  50
26
- ], c = 10, he = "<none>";
28
+ ], c = 10, ve = "<none>";
27
29
  function l(e, t) {
28
30
  return e !== void 0 && t !== void 0 && e !== t;
29
31
  }
@@ -34,195 +36,195 @@ function u(e) {
34
36
  pageSize: t
35
37
  };
36
38
  }
37
- function d({ cardProgram: c, pagination: d, defaultPagination: f, onPaginationChange: ge, featureLabels: p, selectedCardId: _e, defaultSelectedCardId: ve, onSelectedCardIdChange: ye, onCreateCard: m, onActivateCard: be }) {
38
- let h = o(() => ne(p), [p]), g = t();
39
+ function d({ cardProgram: c, pagination: d, defaultPagination: f, onPaginationChange: ye, featureLabels: p, selectedCardId: be, defaultSelectedCardId: xe, onSelectedCardIdChange: Se, onCreateCard: m, onActivateCard: h }) {
40
+ let g = o(() => ae(p), [p]), _ = te();
39
41
  a(() => {
40
- g(ie.Mounted);
41
- }, [g]);
42
- let { organizationId: _, widgetToken: xe, initResponse: v } = n(), y = v?.userId ?? void 0, Se = te(), b = !!ee(), x = !!(_ && xe), S = o(() => re({
42
+ _(se.Mounted);
43
+ }, [_]);
44
+ let { organizationId: v, widgetToken: Ce, initResponse: y } = ne(), b = y?.userId ?? void 0, we = ie(), { organizationStatus: x } = n(), Te = t(x), S = !!re(), Ee = !!(v && Ce) || !!Ce && x === e.Rotating, C = o(() => oe({
43
45
  cardProgram: c,
44
- scopes: v?.scopes
45
- }), [c, v?.scopes]), C = x && S.canRead && !!v, Ce = o(() => u(d), [d?.pageSize, d?.paginationToken]), w = o(() => u(f), [f?.pageSize, f?.paginationToken]), [T, we] = s(y);
46
- y !== void 0 && y !== T && we(y);
47
- let [E, Te] = s(_);
48
- _ !== void 0 && _ !== E && Te(_);
49
- let D = [
46
+ scopes: y?.scopes
47
+ }), [c, y?.scopes]), w = Ee && C.canRead && !!y, De = o(() => u(d), [d?.pageSize, d?.paginationToken]), T = o(() => u(f), [f?.pageSize, f?.paginationToken]), [E, Oe] = s(b);
48
+ b !== void 0 && b !== E && Oe(b);
49
+ let [D, ke] = s(v);
50
+ v !== void 0 && v !== D && ke(v);
51
+ let O = [
50
52
  c,
51
- E === null ? he : E ?? "",
52
- T ?? ""
53
- ].join("\0"), O = [
54
- D,
55
- w.paginationToken ?? "",
56
- w.pageSize
57
- ].join("\0"), k = d !== void 0, [A, j] = s(() => ({
58
- resetKey: O,
59
- paginationToken: w.paginationToken,
60
- pageSize: w.pageSize
61
- })), [Ee, M] = s(!1), [De, N] = pe({
62
- prop: _e,
63
- defaultProp: ve ?? null,
64
- onChange: ye,
53
+ D === null ? ve : D ?? "",
54
+ E ?? ""
55
+ ].join("\0"), k = [
56
+ O,
57
+ T.paginationToken ?? "",
58
+ T.pageSize
59
+ ].join("\0"), A = d !== void 0, [j, M] = s(() => ({
60
+ resetKey: k,
61
+ paginationToken: T.paginationToken,
62
+ pageSize: T.pageSize
63
+ })), [Ae, N] = s(!1), [je, P] = ge({
64
+ prop: be,
65
+ defaultProp: xe ?? null,
66
+ onChange: Se,
65
67
  caller: "CardsWidget"
66
- }), P = fe({
68
+ }), F = he({
67
69
  cardProgram: c,
68
- organizationId: E,
69
- userId: T
70
- }), Oe = P.current.cardProgram !== c || l(P.current.organizationId, E) || l(P.current.userId, T);
70
+ organizationId: D,
71
+ userId: E
72
+ }), Me = F.current.cardProgram !== c || l(F.current.organizationId, D) || l(F.current.userId, E);
71
73
  a(() => {
72
- let e = P.current;
73
- P.current = {
74
+ let e = F.current;
75
+ F.current = {
74
76
  cardProgram: c,
75
- organizationId: E,
76
- userId: T
77
- }, (e.cardProgram !== c || l(e.organizationId, E) || l(e.userId, T)) && (N(null), M(!1));
77
+ organizationId: D,
78
+ userId: E
79
+ }, (e.cardProgram !== c || l(e.organizationId, D) || l(e.userId, E)) && (P(null), N(!1));
78
80
  }, [
79
81
  c,
82
+ D,
80
83
  E,
81
- T,
82
- N
84
+ P
83
85
  ]);
84
- let F = i((e) => {
85
- N(e);
86
- }, [N]), I = Ee && !!y, ke = A.resetKey === O;
86
+ let I = i((e) => {
87
+ P(e);
88
+ }, [P]), L = Ae && !!b, Ne = j.resetKey === k;
87
89
  a(() => {
88
- k || j((e) => e.resetKey === O ? e : {
89
- resetKey: O,
90
- paginationToken: w.paginationToken,
91
- pageSize: w.pageSize
90
+ A || M((e) => e.resetKey === k ? e : {
91
+ resetKey: k,
92
+ paginationToken: T.paginationToken,
93
+ pageSize: T.pageSize
92
94
  });
93
95
  }, [
94
- w.pageSize,
95
- w.paginationToken,
96
- k,
97
- O
96
+ T.pageSize,
97
+ T.paginationToken,
98
+ A,
99
+ k
98
100
  ]);
99
- let L = k ? Ce : ke ? A : w, Ae = L.paginationToken, R = L.pageSize, z = I ? y : void 0, B = {
100
- limit: R,
101
- paginationToken: Ae
102
- }, V = ue({
103
- ...B,
104
- userId: z,
105
- enabled: C && c === r.Credit
106
- }), H = de({
107
- ...B,
108
- cardholderUserId: z,
109
- enabled: C && c === r.Debit
110
- }), U = c === r.Credit ? V : H, W = C && S.canReadFundingAccounts, G = e({ enabled: W }), K = o(() => {
101
+ let R = A ? De : Ne ? j : T, Pe = R.paginationToken, z = R.pageSize, B = L ? b : void 0, V = {
102
+ limit: z,
103
+ paginationToken: Pe
104
+ }, H = pe({
105
+ ...V,
106
+ userId: B,
107
+ enabled: w && c === r.Credit
108
+ }), U = me({
109
+ ...V,
110
+ cardholderUserId: B,
111
+ enabled: w && c === r.Debit
112
+ }), W = c === r.Credit ? H : U, G = w && C.canReadFundingAccounts, K = ee({ enabled: G }), q = o(() => {
111
113
  let e = /* @__PURE__ */ new Map();
112
- if (!S.canReadFundingAccounts) return e;
113
- for (let t of G.data?.data ?? []) {
114
+ if (!C.canReadFundingAccounts) return e;
115
+ for (let t of K.data?.data ?? []) {
114
116
  let n = t.nickname?.trim();
115
117
  e.set(t.id, n ? {
116
118
  name: n,
117
119
  lastFour: t.accountNumber?.trim().slice(-4) || void 0
118
- } : { name: ae(t.accountNumber) ?? h.untitledFundingAccount });
120
+ } : { name: ce(t.accountNumber) ?? g.untitledFundingAccount });
119
121
  }
120
122
  return e;
121
123
  }, [
122
- G.data?.data,
123
- h.untitledFundingAccount,
124
- S.canReadFundingAccounts
125
- ]), q = W && G.isError, je = W && !q && (G.isLoading || G.isFetchingNextPage || !!G.hasNextPage), J = o(() => C ? c === r.Credit ? ce(V.data?.data ?? []) : le(H.data?.data ?? []) : [], [
126
- C,
124
+ K.data?.data,
125
+ g.untitledFundingAccount,
126
+ C.canReadFundingAccounts
127
+ ]), J = G && K.isError, Fe = G && !J && (K.isLoading || K.isFetchingNextPage || !!K.hasNextPage), Y = o(() => w ? c === r.Credit ? de(H.data?.data ?? []) : fe(U.data?.data ?? []) : [], [
128
+ w,
127
129
  c,
128
- V.data?.data,
129
- H.data?.data
130
- ]), Me = o(() => se(J, {
131
- labels: h,
132
- fundingAccountNames: K,
133
- canActivate: S.canActivate,
134
- onCardSelect: F,
135
- onActivateCard: be
130
+ H.data?.data,
131
+ U.data?.data
132
+ ]), Ie = o(() => ue(Y, {
133
+ labels: g,
134
+ fundingAccountNames: q,
135
+ canActivate: C.canActivate,
136
+ onCardSelect: I,
137
+ onActivateCard: h
136
138
  }), [
137
- J,
138
- K,
139
- F,
139
+ Y,
140
+ q,
141
+ I,
142
+ g,
140
143
  h,
141
- be,
142
- S.canActivate
143
- ]), Y = U.data?.nextPaginationToken ?? void 0, X = U.data?.prevPaginationToken ?? void 0, Z = !!U.data, Ne = C && (U.isError || q), [Q, Pe] = s({
144
- key: D,
144
+ C.canActivate
145
+ ]), X = W.data?.nextPaginationToken ?? void 0, Z = W.data?.prevPaginationToken ?? void 0, Le = !!W.data, Re = w && (W.isError || J), [Q, ze] = s({
146
+ key: O,
145
147
  value: !1
146
148
  });
147
- if (C && !I && Z) {
148
- let e = Q.key !== D, t = !!y && J.some((e) => e.userId !== y) || !e && Q.value;
149
- (e || Q.value !== t) && Pe({
150
- key: D,
149
+ if (w && !L && Le) {
150
+ let e = Q.key !== O, t = !!b && Y.some((e) => e.userId !== b) || !e && Q.value;
151
+ (e || Q.value !== t) && ze({
152
+ key: O,
151
153
  value: t
152
154
  });
153
- } else Q.key !== D && Pe({
154
- key: D,
155
+ } else Q.key !== O && ze({
156
+ key: O,
155
157
  value: !1
156
158
  });
157
- let Fe = Q.value, $ = i((e) => {
158
- k || j({
159
- resetKey: O,
159
+ let Be = Q.value, $ = i((e) => {
160
+ A || M({
161
+ resetKey: k,
160
162
  paginationToken: e.paginationToken,
161
163
  pageSize: e.pageSize
162
- }), ge?.(e);
164
+ }), ye?.(e);
163
165
  }, [
164
- k,
165
- ge,
166
- O
167
- ]), Ie = i(() => {
166
+ A,
167
+ ye,
168
+ k
169
+ ]), Ve = i(() => {
168
170
  $({
169
171
  paginationToken: void 0,
170
- pageSize: R
172
+ pageSize: z
171
173
  });
172
- }, [$, R]), Le = i((e) => {
174
+ }, [$, z]), He = i((e) => {
173
175
  $({
174
176
  paginationToken: void 0,
175
177
  pageSize: e
176
178
  });
177
- }, [$]), Re = i((e) => {
178
- M(e), Ie();
179
- }, [Ie]), ze = i(() => {
179
+ }, [$]), Ue = i((e) => {
180
+ N(e), Ve();
181
+ }, [Ve]), We = i(() => {
180
182
  $({
181
- paginationToken: X,
182
- pageSize: R
183
+ paginationToken: Z,
184
+ pageSize: z
183
185
  });
184
186
  }, [
185
187
  $,
186
- R,
187
- X
188
- ]), Be = i(() => {
188
+ z,
189
+ Z
190
+ ]), Ge = i(() => {
189
191
  $({
190
- paginationToken: Y,
191
- pageSize: R
192
+ paginationToken: X,
193
+ pageSize: z
192
194
  });
193
195
  }, [
194
196
  $,
195
- Y,
196
- R
197
- ]), Ve = U.refetch, He = G.refetch, Ue = i(() => {
198
- Ve(), W && He();
197
+ X,
198
+ z
199
+ ]), Ke = W.refetch, qe = K.refetch, Je = i(() => {
200
+ Ke(), G && qe();
199
201
  }, [
200
- W,
201
- Ve,
202
- He
202
+ G,
203
+ Ke,
204
+ qe
203
205
  ]);
204
206
  return {
205
- rows: Me,
206
- selectedCardId: Oe ? null : De,
207
- onSelectCard: F,
208
- canReadCards: S.canRead,
209
- columns: oe[c],
210
- isLoading: !b && (!x || Se && !v || C && (U.isLoading || je)),
211
- isError: b || Ne,
212
- canToggleShowMyCards: S.canRead && !!y && Fe,
213
- isShowingMyCards: I,
214
- onShowMyCardsChange: Re,
215
- canCreateCard: S.canCreate && (!!m || S.canComposeDebitCreate),
207
+ rows: Ie,
208
+ selectedCardId: Me ? null : je,
209
+ onSelectCard: I,
210
+ canReadCards: C.canRead,
211
+ columns: le[c],
212
+ isLoading: !S && (Te && !W.data || we && !y || w && (W.isLoading || Fe)),
213
+ isError: S || Re,
214
+ canToggleShowMyCards: C.canRead && !!b && Be,
215
+ isShowingMyCards: L,
216
+ onShowMyCardsChange: Ue,
217
+ canCreateCard: C.canCreate && (!!m || C.canComposeDebitCreate),
216
218
  onCreateCardClick: m,
217
- onRetry: Ue,
218
- isPaginationVisible: C && Z && !Ne,
219
- pageSize: R,
220
- pageSizeOptions: me,
221
- isPreviousPageDisabled: !X,
222
- isNextPageDisabled: !Y,
223
- onPageSizeChange: Le,
224
- onPreviousPageClick: ze,
225
- onNextPageClick: Be
219
+ onRetry: Je,
220
+ isPaginationVisible: w && Le && !Re,
221
+ pageSize: z,
222
+ pageSizeOptions: _e,
223
+ isPreviousPageDisabled: !Z,
224
+ isNextPageDisabled: !X,
225
+ onPageSizeChange: He,
226
+ onPreviousPageClick: We,
227
+ onNextPageClick: Ge
226
228
  };
227
229
  }
228
230
  //#endregion
@@ -10,7 +10,7 @@ import "../../../shared/data-access/dist/index.js";
10
10
  import { useQuery as a } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js
12
12
  function o({ metric: e = "total_amount", type: o, statusIn: s, counterpartIdIn: c, enabled: l } = {}) {
13
- let { client: u, organizationId: d, widgetToken: f, authEpoch: p, organizationPending: m } = r(), h = c == null || c.length > 0, g = !!(d && f) && h && (l === !0 || l === void 0), _ = t({
13
+ let { client: u, organizationId: d, widgetToken: f, authEpoch: p, organizationStatus: m } = r(), h = c == null || c.length > 0, g = !!(d && f) && h && (l === !0 || l === void 0), _ = t({
14
14
  client: u,
15
15
  headers: i(d),
16
16
  query: {
@@ -25,13 +25,13 @@ function o({ metric: e = "total_amount", type: o, statusIn: s, counterpartIdIn:
25
25
  return a({
26
26
  ...n(_, {
27
27
  authEpoch: p,
28
- organizationPending: m
28
+ organizationStatus: m
29
29
  }),
30
30
  enabled: g
31
31
  });
32
32
  }
33
33
  function s({ metric: t = "total_amount", statusIn: o, counterpartIdIn: s, enabled: c } = {}) {
34
- let { client: l, organizationId: u, widgetToken: d, authEpoch: f, organizationPending: p } = r(), m = s == null || s.length > 0, h = !!(u && d) && m && (c === !0 || c === void 0), g = e({
34
+ let { client: l, organizationId: u, widgetToken: d, authEpoch: f, organizationStatus: p } = r(), m = s == null || s.length > 0, h = !!(u && d) && m && (c === !0 || c === void 0), g = e({
35
35
  client: l,
36
36
  headers: i(u),
37
37
  query: {
@@ -45,7 +45,7 @@ function s({ metric: t = "total_amount", statusIn: o, counterpartIdIn: s, enable
45
45
  return a({
46
46
  ...n(g, {
47
47
  authEpoch: f,
48
- organizationPending: p
48
+ organizationStatus: p
49
49
  }),
50
50
  enabled: h
51
51
  });
@@ -24,7 +24,7 @@ var o = [
24
24
  "paid"
25
25
  ];
26
26
  function c({ counterpartId: t, enabled: s }) {
27
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: f } = r(), p = !!(l && u && t) && (s === !0 || s === void 0), m = e({
27
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = r(), p = !!(l && u && t) && (s === !0 || s === void 0), m = e({
28
28
  client: c,
29
29
  headers: i(l),
30
30
  query: {
@@ -38,13 +38,13 @@ function c({ counterpartId: t, enabled: s }) {
38
38
  return a({
39
39
  ...n(m, {
40
40
  authEpoch: d,
41
- organizationPending: f
41
+ organizationStatus: f
42
42
  }),
43
43
  enabled: p
44
44
  });
45
45
  }
46
46
  function l({ counterpartId: e, enabled: o }) {
47
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: f } = r(), p = !!(l && u && e) && (o === !0 || o === void 0), m = t({
47
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = r(), p = !!(l && u && e) && (o === !0 || o === void 0), m = t({
48
48
  client: c,
49
49
  headers: i(l),
50
50
  query: {
@@ -59,7 +59,7 @@ function l({ counterpartId: e, enabled: o }) {
59
59
  return a({
60
60
  ...n(m, {
61
61
  authEpoch: d,
62
- organizationPending: f
62
+ organizationStatus: f
63
63
  }),
64
64
  enabled: p
65
65
  });
@@ -9,7 +9,7 @@ import "../../../shared/data-access/dist/index.js";
9
9
  import { useQuery as r } from "@tanstack/react-query";
10
10
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index15.js
11
11
  function i({ enabled: i, ...a } = {}) {
12
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c) && (i === !0 || i === void 0), f = e({
12
+ let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationStatus: u } = n(), d = !!(s && c) && (i === !0 || i === void 0), f = e({
13
13
  query: {
14
14
  ...a,
15
15
  metric: "id",
@@ -20,7 +20,7 @@ function i({ enabled: i, ...a } = {}) {
20
20
  }), p = r({
21
21
  ...t(f, {
22
22
  authEpoch: l,
23
- organizationPending: u
23
+ organizationStatus: u
24
24
  }),
25
25
  enabled: d
26
26
  }), m = p.data?.data?.[0]?.metric_value;
@@ -9,7 +9,7 @@ import "../../../shared/data-access/dist/index.js";
9
9
  import { useQuery as r } from "@tanstack/react-query";
10
10
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index17.js
11
11
  function i({ enabled: i, ...a } = {}) {
12
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c) && (i === !0 || i === void 0), f = e({
12
+ let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationStatus: u } = n(), d = !!(s && c) && (i === !0 || i === void 0), f = e({
13
13
  query: {
14
14
  ...a,
15
15
  metric: "id",
@@ -20,7 +20,7 @@ function i({ enabled: i, ...a } = {}) {
20
20
  }), p = r({
21
21
  ...t(f, {
22
22
  authEpoch: l,
23
- organizationPending: u
23
+ organizationStatus: u
24
24
  }),
25
25
  enabled: d
26
26
  }), m = p.data?.data?.[0]?.metric_value;
@@ -9,13 +9,13 @@ import "../../../shared/data-access/dist/index.js";
9
9
  import { useQuery as r } from "@tanstack/react-query";
10
10
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index18.js
11
11
  function i({ enabled: i } = {}) {
12
- let { client: a, organizationId: o, widgetToken: s, authEpoch: c, organizationPending: l } = n(), u = !!(o && s) && (i === !0 || i === void 0), d = e({
12
+ let { client: a, organizationId: o, widgetToken: s, authEpoch: c, organizationStatus: l } = n(), u = !!(o && s) && (i === !0 || i === void 0), d = e({
13
13
  client: a,
14
14
  headers: { "x-organization-id": o ?? "" }
15
15
  }), f = r({
16
16
  ...t(d, {
17
17
  authEpoch: c,
18
- organizationPending: l
18
+ organizationStatus: l
19
19
  }, { carryWithinOrg: !0 }),
20
20
  enabled: u
21
21
  });
@@ -9,7 +9,7 @@ import "../../../shared/data-access/dist/index.js";
9
9
  import { useQuery as r } from "@tanstack/react-query";
10
10
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index19.js
11
11
  function i({ transactionId: i, enabled: a } = {}) {
12
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c && i) && (a === !0 || a === void 0), f = e({
12
+ let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationStatus: u } = n(), d = !!(s && c && i) && (a === !0 || a === void 0), f = e({
13
13
  client: o,
14
14
  headers: { "x-organization-id": s ?? "" },
15
15
  query: {
@@ -22,7 +22,7 @@ function i({ transactionId: i, enabled: a } = {}) {
22
22
  }), p = r({
23
23
  ...t(f, {
24
24
  authEpoch: l,
25
- organizationPending: u
25
+ organizationStatus: u
26
26
  }),
27
27
  enabled: d
28
28
  });
@@ -9,7 +9,7 @@ import "../../../shared/data-access/dist/index.js";
9
9
  import { useQuery as r } from "@tanstack/react-query";
10
10
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index2.js
11
11
  function i({ enabled: i, ...a } = {}) {
12
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c) && (i === !0 || i === void 0), f = e({
12
+ let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationStatus: u } = n(), d = !!(s && c) && (i === !0 || i === void 0), f = e({
13
13
  query: a,
14
14
  client: o,
15
15
  headers: { "x-organization-id": s ?? "" }
@@ -17,7 +17,7 @@ function i({ enabled: i, ...a } = {}) {
17
17
  return r({
18
18
  ...t(f, {
19
19
  authEpoch: l,
20
- organizationPending: u
20
+ organizationStatus: u
21
21
  }),
22
22
  enabled: d
23
23
  });
@@ -9,7 +9,7 @@ import "../../../shared/data-access/dist/index.js";
9
9
  import { useQuery as r } from "@tanstack/react-query";
10
10
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index3.js
11
11
  function i({ enabled: i, ...a } = {}) {
12
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c) && (i === !0 || i === void 0), f = e({
12
+ let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationStatus: u } = n(), d = !!(s && c) && (i === !0 || i === void 0), f = e({
13
13
  query: a,
14
14
  client: o,
15
15
  headers: { "x-organization-id": s ?? "" }
@@ -17,7 +17,7 @@ function i({ enabled: i, ...a } = {}) {
17
17
  return r({
18
18
  ...t(f, {
19
19
  authEpoch: l,
20
- organizationPending: u
20
+ organizationStatus: u
21
21
  }, { carryWithinOrg: !0 }),
22
22
  enabled: d
23
23
  });
@@ -11,7 +11,7 @@ import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index4.js
12
12
  var a = 100;
13
13
  function o({ enabled: o = !0 } = {}) {
14
- let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationPending: d } = n(), f = e({
14
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationStatus: d } = n(), f = e({
15
15
  client: s,
16
16
  headers: r(c),
17
17
  query: { limit: a }
@@ -19,7 +19,7 @@ function o({ enabled: o = !0 } = {}) {
19
19
  return i({
20
20
  ...t(f, {
21
21
  authEpoch: u,
22
- organizationPending: d
22
+ organizationStatus: d
23
23
  }),
24
24
  enabled: !!(c && l) && o
25
25
  });
@@ -12,7 +12,7 @@ import { useQuery as a } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index5.js
13
13
  var o = 100;
14
14
  function s({ ids: s, enabled: c = !0 }) {
15
- let { client: l, organizationId: u, widgetToken: d, authEpoch: f, organizationPending: p } = n(), m = i(() => [...new Set(s.filter(Boolean))].sort().slice(0, o), [s]), h = e({
15
+ let { client: l, organizationId: u, widgetToken: d, authEpoch: f, organizationStatus: p } = n(), m = i(() => [...new Set(s.filter(Boolean))].sort().slice(0, o), [s]), h = e({
16
16
  client: l,
17
17
  headers: r(u),
18
18
  query: {
@@ -23,7 +23,7 @@ function s({ ids: s, enabled: c = !0 }) {
23
23
  return a({
24
24
  ...t(h, {
25
25
  authEpoch: f,
26
- organizationPending: p
26
+ organizationStatus: p
27
27
  }),
28
28
  enabled: !!(u && d) && c && m.length > 0
29
29
  });
@@ -11,7 +11,7 @@ import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index6.js
12
12
  var a = 100;
13
13
  function o({ enabled: o = !0 } = {}) {
14
- let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationPending: d } = n(), f = e({
14
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationStatus: d } = n(), f = e({
15
15
  client: s,
16
16
  headers: r(c),
17
17
  query: { limit: a }
@@ -19,7 +19,7 @@ function o({ enabled: o = !0 } = {}) {
19
19
  return i({
20
20
  ...t(f, {
21
21
  authEpoch: u,
22
- organizationPending: d
22
+ organizationStatus: d
23
23
  }),
24
24
  enabled: !!(c && l) && o
25
25
  });
@@ -11,7 +11,7 @@ import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index8.js
12
12
  var a = 500;
13
13
  function o({ transactionId: o, enabled: s = !0 } = {}) {
14
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: f } = n(), p = e({
14
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = n(), p = e({
15
15
  client: c,
16
16
  headers: r(l),
17
17
  path: { transaction_id: o ?? "" },
@@ -23,7 +23,7 @@ function o({ transactionId: o, enabled: s = !0 } = {}) {
23
23
  return i({
24
24
  ...t(p, {
25
25
  authEpoch: d,
26
- organizationPending: f
26
+ organizationStatus: f
27
27
  }),
28
28
  enabled: !!(l && u && o) && s
29
29
  });