@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
@@ -3,19 +3,22 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { isOrganizationOnItsWay as t } from "../../../shared/data-access/dist/lib/organizationStatus.js";
7
+ import { useEmbedApi as n } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
+ import "../../../shared/data-access/dist/index.js";
6
9
  import "../../../shared/ui/dist/index.js";
7
- import { useWidgetConfig as t, useWidgetLoading as n } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
+ import { useWidgetConfig as r, useWidgetLoading as i } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
8
11
  import "../../../shared/feature/dist/index.js";
9
- import { ReceiptMatchLabels as r } from "../../ui/dist/lib/ReceiptMatchWidget/lib/labels.js";
12
+ import { ReceiptMatchLabels as a } from "../../ui/dist/lib/ReceiptMatchWidget/lib/labels.js";
10
13
  import "../../ui/dist/index.js";
11
- import { useGetReceiptsQuery as i } from "../../data-access/dist/index2.js";
12
- import { useGetTransactionsQuery as a } from "../../data-access/dist/index3.js";
13
- import { usePatchReceiptMutation as o } from "../../data-access/dist/index11.js";
14
- import { useDeleteReceiptMutation as ee } from "../../data-access/dist/index12.js";
14
+ import { useGetReceiptsQuery as ee } from "../../data-access/dist/index2.js";
15
+ import { useGetTransactionsQuery as o } from "../../data-access/dist/index3.js";
16
+ import { usePatchReceiptMutation as te } from "../../data-access/dist/index11.js";
17
+ import { useDeleteReceiptMutation as s } from "../../data-access/dist/index12.js";
15
18
  import "../../data-access/dist/index.js";
16
- import { useCallback as s, useEffect as te, useMemo as c, useState as l } from "react";
19
+ import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
17
20
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js
18
- function u(e, t) {
21
+ function f(e, t) {
19
22
  if (typeof e == "object" && e) {
20
23
  let t = e.error;
21
24
  if (typeof t == "object" && t) {
@@ -25,7 +28,7 @@ function u(e, t) {
25
28
  }
26
29
  return e instanceof Error && e.message ? e.message : t;
27
30
  }
28
- function d(e, t) {
31
+ function p(e, t) {
29
32
  let n = e / 100;
30
33
  try {
31
34
  return new Intl.NumberFormat("en-US", {
@@ -36,7 +39,7 @@ function d(e, t) {
36
39
  return `${t} ${n.toFixed(2)}`;
37
40
  }
38
41
  }
39
- function f(e) {
42
+ function m(e) {
40
43
  if (!e) return "";
41
44
  let t = new Date(e);
42
45
  return Number.isNaN(t.getTime()) ? "" : t.toLocaleDateString("en-US", {
@@ -54,7 +57,7 @@ function ne(e) {
54
57
  year: "numeric"
55
58
  });
56
59
  }
57
- function p(e) {
60
+ function re(e) {
58
61
  if (!e) return "";
59
62
  let t = new Date(e);
60
63
  return Number.isNaN(t.getTime()) ? "" : t.toLocaleTimeString("en-US", {
@@ -64,201 +67,201 @@ function p(e) {
64
67
  hour12: !0
65
68
  });
66
69
  }
67
- function re(e) {
70
+ function h(e) {
68
71
  let t = e.ocr_status === "processing";
69
72
  return {
70
73
  id: e.id,
71
- primaryText: t ? r.ReceiptScanningTitle : e.merchant_name?.trim() || r.ReceiptScanningTitle,
72
- secondaryText: t ? r.ReceiptScanningSubtitle : f(e.issued_at),
74
+ primaryText: t ? a.ReceiptScanningTitle : e.merchant_name?.trim() || a.ReceiptScanningTitle,
75
+ secondaryText: t ? a.ReceiptScanningSubtitle : m(e.issued_at),
73
76
  thumbnailUrl: e.file_url ?? void 0
74
77
  };
75
78
  }
76
- function ie(e) {
79
+ function g(e) {
77
80
  return {
78
81
  id: e.id,
79
82
  merchantName: e.merchant_name,
80
- date: f(e.started_at),
81
- formattedAmount: d(e.amount, e.currency)
83
+ date: m(e.started_at),
84
+ formattedAmount: p(e.amount, e.currency)
82
85
  };
83
86
  }
84
- var m = .5, h = 3, g = .25, _ = 5e3, v = !1;
85
- function y({ preSelectedIds: f, onClose: y, targetTransactionId: b, onSingleTransactionUpdate: x, enabled: ae = !0 }) {
86
- let { initResponse: S } = t(), C = n(), w = S?.userId ?? void 0, oe = ae && !!w && !C, [T, E] = l(1), [D, O] = l(0), [k, A] = l([]), [j, M] = l(() => f), [N, P] = l(""), [F, I] = l([]), L = c(() => F.map((e) => e.id), [F]), [R, z] = l(1), B = i({
87
+ var _ = .5, v = 3, y = .25, ie = 5e3, ae = !1;
88
+ function b({ preSelectedIds: m, onClose: b, targetTransactionId: x, onSingleTransactionUpdate: S, enabled: oe = !0 }) {
89
+ let { initResponse: C } = r(), w = i(), se = t(n().organizationStatus), T = C?.userId ?? void 0, ce = oe && !!T && !w, [E, D] = d(1), [O, k] = d(0), [A, j] = d([]), [M, N] = d(() => m), [P, F] = d(""), [I, L] = d([]), le = u(() => I.map((e) => e.id), [I]), [R, z] = d(1), B = ee({
87
90
  has_transaction: !1,
88
- created_by_entity_user_id: w,
89
- enabled: oe
90
- }), V = a({
91
- merchant_name__icontains: N || void 0,
91
+ created_by_entity_user_id: T,
92
+ enabled: ce
93
+ }), V = o({
94
+ merchant_name__icontains: P || void 0,
92
95
  has_receipt: !1,
93
- enabled: T === 2
94
- }), H = o(), U = ee(), W = B.data?.data ?? [], G = c(() => w ? W.filter((e) => e.created_by_entity_user_id == null || e.created_by_entity_user_id === w) : [], [W, w]);
95
- te(() => {
96
+ enabled: E === 2
97
+ }), H = te(), U = s(), W = B.data?.data ?? [], G = u(() => T ? W.filter((e) => e.created_by_entity_user_id == null || e.created_by_entity_user_id === T) : [], [W, T]);
98
+ l(() => {
96
99
  if (!G.some((e) => e.ocr_status === "processing")) return;
97
100
  let e = window.setInterval(() => {
98
101
  B.isFetching || B.refetch();
99
- }, _);
102
+ }, ie);
100
103
  return () => window.clearInterval(e);
101
104
  }, [
102
105
  B.isFetching,
103
106
  B.refetch,
104
107
  G
105
108
  ]);
106
- let K = c(() => G.map(re), [G]), q = c(() => new Set(k.flatMap((e) => e.transactionIds)), [k]), se = c(() => (V.data?.data ?? []).filter((e) => !q.has(e.id)).map(ie), [V.data, q]), J = V.data?.data ?? [], Y = j[D], X = c(() => G.find((e) => e.id === Y), [G, Y]), ce = X?.file_url ?? void 0, le = X?.file_name ?? void 0, ue = c(() => {
107
- if (b) return "Attach";
108
- if (!(j.length <= 1)) return `Review (${D + 1}/${j.length})`;
109
+ let K = u(() => G.map(h), [G]), q = u(() => new Set(A.flatMap((e) => e.transactionIds)), [A]), J = u(() => (V.data?.data ?? []).filter((e) => !q.has(e.id)).map(g), [V.data, q]), Y = V.data?.data ?? [], X = M[O], Z = u(() => G.find((e) => e.id === X), [G, X]), ue = Z?.file_url ?? void 0, de = Z?.file_name ?? void 0, fe = u(() => {
110
+ if (x) return "Attach";
111
+ if (!(M.length <= 1)) return `Review (${O + 1}/${M.length})`;
109
112
  }, [
110
- b,
111
- j.length,
112
- D
113
- ]), de = c(() => k.filter((e) => e.receiptId === Y).flatMap((e) => e.transactionDetails), [k, Y]), fe = D >= j.length - 1 ? r.Done : r.ReviewNextReceipt(D + 2, j.length), Z = s(() => {
114
- P(""), I([]), z(1);
115
- }, []), pe = s((e) => {
116
- if (b) {
117
- M((t) => t.includes(e) ? [] : [e]);
113
+ x,
114
+ M.length,
115
+ O
116
+ ]), pe = u(() => A.filter((e) => e.receiptId === X).flatMap((e) => e.transactionDetails), [A, X]), me = O >= M.length - 1 ? a.Done : a.ReviewNextReceipt(O + 2, M.length), Q = c(() => {
117
+ F(""), L([]), z(1);
118
+ }, []), he = c((e) => {
119
+ if (x) {
120
+ N((t) => t.includes(e) ? [] : [e]);
118
121
  return;
119
122
  }
120
- M((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
121
- }, [b]), me = s(() => {
122
- M(K.map((e) => e.id));
123
- }, [K]), he = s(() => {
124
- M([]);
125
- }, []), ge = s((e) => {
123
+ N((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
124
+ }, [x]), ge = c(() => {
125
+ N(K.map((e) => e.id));
126
+ }, [K]), _e = c(() => {
127
+ N([]);
128
+ }, []), ve = c((e) => {
126
129
  let t = G.find((t) => t.id === e);
127
130
  t?.file_url && window.open(t.file_url, "_blank", "noopener,noreferrer");
128
- }, [G]), Q = s(async (t) => {
131
+ }, [G]), ye = c(async (t) => {
129
132
  try {
130
133
  await U.mutateAsync({ path: { receipt_id: t } });
131
134
  } catch (t) {
132
- e.error(u(t, "Failed to delete receipt"));
135
+ e.error(f(t, "Failed to delete receipt"));
133
136
  return;
134
137
  }
135
- M((e) => e.filter((e) => e !== t));
136
- }, [U]), _e = s(async () => {
137
- if (j.length !== 0) {
138
- if (b) {
138
+ N((e) => e.filter((e) => e !== t));
139
+ }, [U]), be = c(async () => {
140
+ if (M.length !== 0) {
141
+ if (x) {
139
142
  try {
140
143
  await H.mutateAsync({
141
- path: { receipt_id: j[0] },
142
- body: { transaction_id: b }
143
- }), x?.(), y();
144
+ path: { receipt_id: M[0] },
145
+ body: { transaction_id: x }
146
+ }), S?.(), b();
144
147
  } catch (t) {
145
- e.error(u(t, "Failed to attach receipt"));
148
+ e.error(f(t, "Failed to attach receipt"));
146
149
  }
147
150
  return;
148
151
  }
149
- O(0), A([]), Z(), E(2);
152
+ k(0), j([]), Q(), D(2);
150
153
  }
151
154
  }, [
152
- j,
153
- b,
154
- H,
155
+ M,
155
156
  x,
156
- y,
157
- Z
158
- ]), ve = s(() => {
157
+ H,
158
+ S,
159
+ b,
160
+ Q
161
+ ]), xe = c(() => {
159
162
  B.refetch();
160
- }, [B.refetch]), ye = s((e) => {
161
- P(e);
162
- }, []), be = s((e) => {
163
- I((t) => {
164
- let n = t.find((t) => t.id === e), r = J.find((t) => t.id === e);
163
+ }, [B.refetch]), Se = c((e) => {
164
+ F(e);
165
+ }, []), Ce = c((e) => {
166
+ L((t) => {
167
+ let n = t.find((t) => t.id === e), r = Y.find((t) => t.id === e);
165
168
  return n ? [] : r ? [r] : [];
166
169
  });
167
- }, [J]), xe = s(async () => {
168
- if (F.length === 0 || !Y) return;
169
- let t = F, n = (e) => ({
170
+ }, [Y]), we = c(async () => {
171
+ if (I.length === 0 || !X) return;
172
+ let t = I, n = (e) => ({
170
173
  merchant: e.merchant_name,
171
174
  location: e.merchant_location,
172
175
  date: ne(e.started_at),
173
- time: p(e.started_at),
174
- formattedAmount: d(e.amount, e.currency)
176
+ time: re(e.started_at),
177
+ formattedAmount: p(e.amount, e.currency)
175
178
  }), r = [], i = [];
176
179
  for (let a of t) try {
177
180
  await H.mutateAsync({
178
- path: { receipt_id: Y },
181
+ path: { receipt_id: X },
179
182
  body: { transaction_id: a.id }
180
183
  }), r.push(a.id), i.push(n(a));
181
184
  } catch (t) {
182
- r.length > 0 && A((e) => [...e, {
183
- receiptId: Y,
185
+ r.length > 0 && j((e) => [...e, {
186
+ receiptId: X,
184
187
  transactionIds: r,
185
188
  transactionDetails: i
186
- }]), I((e) => e.filter((e) => !r.includes(e.id))), e.error(u(t, "Failed to match receipt"));
189
+ }]), L((e) => e.filter((e) => !r.includes(e.id))), e.error(f(t, "Failed to match receipt"));
187
190
  return;
188
191
  }
189
- A((e) => [...e, {
190
- receiptId: Y,
192
+ j((e) => [...e, {
193
+ receiptId: X,
191
194
  transactionIds: r,
192
195
  transactionDetails: i
193
- }]), E(3);
196
+ }]), D(3);
194
197
  }, [
195
- F,
196
- Y,
198
+ I,
199
+ X,
197
200
  H
198
- ]), Se = s(() => {
201
+ ]), Te = c(() => {
199
202
  V.refetch();
200
- }, [V.refetch]), Ce = s(() => {
201
- z((e) => Math.min(e + g, h));
202
- }, []), we = s(() => {
203
- z((e) => Math.max(e - g, m));
204
- }, []), $ = s(() => {
205
- if (k.length > 0) {
206
- let e = new Set(k.map((e) => e.receiptId));
207
- M((t) => t.filter((t) => !e.has(t)));
203
+ }, [V.refetch]), Ee = c(() => {
204
+ z((e) => Math.min(e + y, v));
205
+ }, []), De = c(() => {
206
+ z((e) => Math.max(e - y, _));
207
+ }, []), $ = c(() => {
208
+ if (A.length > 0) {
209
+ let e = new Set(A.map((e) => e.receiptId));
210
+ N((t) => t.filter((t) => !e.has(t)));
208
211
  }
209
- Z(), O(0), A([]), E(1);
210
- }, [Z, k]), Te = s(() => {
211
- let e = D + 1;
212
- if (e < j.length) {
213
- O(e), Z(), E(2);
212
+ Q(), k(0), j([]), D(1);
213
+ }, [Q, A]), Oe = c(() => {
214
+ let e = O + 1;
215
+ if (e < M.length) {
216
+ k(e), Q(), D(2);
214
217
  return;
215
218
  }
216
- $(), y();
219
+ $(), b();
217
220
  }, [
218
- D,
219
- j.length,
220
- Z,
221
+ O,
222
+ M.length,
223
+ Q,
221
224
  $,
222
- y
225
+ b
223
226
  ]);
224
227
  return {
225
- step: T,
228
+ step: E,
226
229
  receipts: K,
227
- selectedReceiptIds: j,
228
- onSelectAll: me,
229
- onReset: he,
230
- onReceiptToggle: pe,
231
- onViewAttachment: ge,
232
- onDeleteReceipt: Q,
233
- onReview: _e,
234
- isReceiptsLoading: B.isLoading || C && !S,
230
+ selectedReceiptIds: M,
231
+ onSelectAll: ge,
232
+ onReset: _e,
233
+ onReceiptToggle: he,
234
+ onViewAttachment: ve,
235
+ onDeleteReceipt: ye,
236
+ onReview: be,
237
+ isReceiptsLoading: B.isLoading || w && !C || se && !B.data,
235
238
  isReceiptsError: B.isError,
236
- onRetryReceipts: ve,
237
- showSelectAllButton: !b,
238
- receiptPreviewUrl: ce,
239
- receiptFileName: le,
240
- transactions: se,
239
+ onRetryReceipts: xe,
240
+ showSelectAllButton: !x,
241
+ receiptPreviewUrl: ue,
242
+ receiptFileName: de,
243
+ transactions: J,
241
244
  isTransactionsLoading: V.isLoading,
242
245
  isTransactionsError: V.isError,
243
- onRetryTransactions: Se,
244
- selectedTransactionIds: L,
245
- allowMultipleTransactions: v,
246
- searchValue: N,
247
- onSearchChange: ye,
248
- onTransactionSelect: be,
249
- onConfirmMatch: xe,
246
+ onRetryTransactions: Te,
247
+ selectedTransactionIds: le,
248
+ allowMultipleTransactions: ae,
249
+ searchValue: P,
250
+ onSearchChange: Se,
251
+ onTransactionSelect: Ce,
252
+ onConfirmMatch: we,
250
253
  isConfirming: H.isPending,
251
254
  zoom: R,
252
- onZoomIn: Ce,
253
- onZoomOut: we,
254
- canZoomIn: R < h,
255
- canZoomOut: R > m,
256
- matchedTransactions: de,
257
- primaryLabel: fe,
258
- onPrimary: Te,
255
+ onZoomIn: Ee,
256
+ onZoomOut: De,
257
+ canZoomIn: R < v,
258
+ canZoomOut: R > _,
259
+ matchedTransactions: pe,
260
+ primaryLabel: me,
261
+ onPrimary: Oe,
259
262
  onCancel: $,
260
- reviewLabel: ue
263
+ reviewLabel: fe
261
264
  };
262
265
  }
263
266
  //#endregion
264
- export { y as useReceiptMatch };
267
+ export { b as useReceiptMatch };
@@ -2,19 +2,21 @@
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";
6
- import { useAllExternalBankAccountsQuery as t } from "../../../shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js";
5
+ import { OrganizationStatus as e } from "../../../shared/data-access/dist/lib/organizationStatus.js";
6
+ import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
+ import { useAllBankAccountsQuery as n } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
8
+ import { useAllExternalBankAccountsQuery as r } from "../../../shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js";
7
9
  import "../../../shared/data-access/dist/index.js";
8
- import { useRefetchWidget as n, useWidgetConfig as r, useWidgetError as i, useWidgetLoading as a } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
+ import { useRefetchWidget as i, useWidgetConfig as a, useWidgetError as o, useWidgetLoading as s } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
11
  import "../../../shared/feature/dist/index.js";
10
- import { INSIGHTS_FEATURE_LABELS_EN as o } from "./index3.js";
11
- import { useDismissedInsightIds as s } from "./index5.js";
12
- import { shouldShowRoutingOnboardingInsight as c } from "./index6.js";
13
- import { getInsightsPermissions as l } from "./index7.js";
14
- import { createContext as u, useCallback as d, useContext as f, useMemo as p, useState as m } from "react";
15
- import { jsx as h } from "react/jsx-runtime";
12
+ import { INSIGHTS_FEATURE_LABELS_EN as c } from "./index3.js";
13
+ import { useDismissedInsightIds as l } from "./index5.js";
14
+ import { shouldShowRoutingOnboardingInsight as u } from "./index6.js";
15
+ import { getInsightsPermissions as d } from "./index7.js";
16
+ import { createContext as f, useCallback as p, useContext as m, useMemo as h, useState as g } from "react";
17
+ import { jsx as ee } from "react/jsx-runtime";
16
18
  //#region ../../libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js
17
- var g = u({
19
+ var _ = f({
18
20
  activeFilter: "active",
19
21
  setActiveFilter: () => {},
20
22
  filteredInsights: [],
@@ -22,13 +24,13 @@ var g = u({
22
24
  isError: !1,
23
25
  refetch: async () => void 0,
24
26
  onDismissClick: () => {},
25
- featureLabels: o,
27
+ featureLabels: c,
26
28
  createdDateLabel: ""
27
- }), _ = () => f(g), v = ({ children: u, routingEnabled: f = !1, onRoutingToggleChange: _, onLinkExternalAccountClick: v, featureLabels: y }) => {
28
- let { initResponse: b } = r(), x = a(), S = i(), C = n(), w = p(() => c(b?.scopes), [b?.scopes]), { canReadBankAccounts: T, canReadExternalBankAccounts: E } = p(() => l(b?.scopes), [b?.scopes]), D = p(() => ({
29
- ...o,
30
- ...y
31
- }), [y]), [O, k] = m("active"), [A, j] = m(!1), M = _ !== void 0, N = M ? f : A, P = M ? _ : j, { dismissedIds: F, isLoading: I, refetch: L, dismissInsight: R } = s(), { data: z, isLoading: B, isError: V, refetch: H } = e({ enabled: T }), { data: U, isLoading: W, isError: G, refetch: K } = t({ enabled: E }), q = z?.data, J = U?.data, Y = x || B || W || I || (!!T && q === void 0 && !V || !!E && J === void 0 && !G) && !S, X = !!S || (T || E) && !(T && !V) && !(E && !G), Z = d(() => (C(), Promise.all([
29
+ }), v = () => m(_), y = ({ children: f, routingEnabled: m = !1, onRoutingToggleChange: v, onLinkExternalAccountClick: y, featureLabels: b }) => {
30
+ let { initResponse: x } = a(), te = s(), { organizationStatus: ne } = t(), S = o(), C = i(), w = h(() => u(x?.scopes), [x?.scopes]), { canReadBankAccounts: T, canReadExternalBankAccounts: E } = h(() => d(x?.scopes), [x?.scopes]), D = h(() => ({
31
+ ...c,
32
+ ...b
33
+ }), [b]), [O, k] = g("active"), [A, j] = g(!1), M = v !== void 0, N = M ? m : A, P = M ? v : j, { dismissedIds: F, isLoading: I, refetch: L, dismissInsight: R } = l(), { data: z, isLoading: B, isError: V, refetch: H } = n({ enabled: T }), { data: U, isLoading: W, isError: G, refetch: K } = r({ enabled: E }), q = z?.data, J = U?.data, Y = !T || q !== void 0 || V, X = !E || J !== void 0 || G, re = ne === e.None, Z = te || B || W || I || !(Y && X) && !S && !re, Q = !!S || (T || E) && !(T && !V) && !(E && !G), ie = p(() => (C(), Promise.all([
32
34
  T ? H() : void 0,
33
35
  E ? K() : void 0,
34
36
  L()
@@ -39,8 +41,8 @@ var g = u({
39
41
  L,
40
42
  T,
41
43
  E
42
- ]), Q = p(() => (/* @__PURE__ */ new Date()).toLocaleDateString(), []), $ = p(() => {
43
- if (Y || X) return [];
44
+ ]), ae = h(() => (/* @__PURE__ */ new Date()).toLocaleDateString(), []), $ = h(() => {
45
+ if (Z || Q) return [];
44
46
  let e = [];
45
47
  if (w && e.push({
46
48
  id: "insight-routing-onboarding",
@@ -63,8 +65,8 @@ var g = u({
63
65
  canDismiss: !0,
64
66
  showToggle: !1,
65
67
  displayText: D.connectExternalText,
66
- actionText: v ? D.linkAccountAction : void 0,
67
- onActionClick: v
68
+ actionText: y ? D.linkAccountAction : void 0,
69
+ onActionClick: y
68
70
  }), J !== void 0) {
69
71
  for (let t of J) if (t.verificationStatus !== "VERIFIED") {
70
72
  let n = `insight-verify-external-${t.id}`;
@@ -81,35 +83,35 @@ var g = u({
81
83
  }, [
82
84
  q,
83
85
  J,
84
- Y,
85
- X,
86
+ Z,
87
+ Q,
86
88
  F,
87
89
  w,
88
90
  N,
89
91
  P,
90
- v,
92
+ y,
91
93
  D
92
- ]), ee = d((e) => {
94
+ ]), oe = p((e) => {
93
95
  R(e);
94
- }, [R]), te = p(() => O === "dismissed" ? $.filter((e) => F.includes(e.id)) : $.filter((e) => !F.includes(e.id)), [
96
+ }, [R]), se = h(() => O === "dismissed" ? $.filter((e) => F.includes(e.id)) : $.filter((e) => !F.includes(e.id)), [
95
97
  $,
96
98
  O,
97
99
  F
98
100
  ]);
99
- return /* @__PURE__ */ h(g.Provider, {
101
+ return /* @__PURE__ */ ee(_.Provider, {
100
102
  value: {
101
103
  activeFilter: O,
102
104
  setActiveFilter: k,
103
- filteredInsights: te,
104
- isLoading: Y,
105
- isError: X,
106
- refetch: Z,
107
- onDismissClick: ee,
105
+ filteredInsights: se,
106
+ isLoading: Z,
107
+ isError: Q,
108
+ refetch: ie,
109
+ onDismissClick: oe,
108
110
  featureLabels: D,
109
- createdDateLabel: Q
111
+ createdDateLabel: ae
110
112
  },
111
- children: u
113
+ children: f
112
114
  });
113
115
  };
114
116
  //#endregion
115
- export { v as InsightsWidgetContextProvider, _ as useInsightsWidgetContext };
117
+ export { y as InsightsWidgetContextProvider, v as useInsightsWidgetContext };
@@ -7,7 +7,7 @@ import { useSendReceivableEmailMutation as a } from "./index5.js";
7
7
  import { useAcceptReceivableMutation as o, useCancelReceivableMutation as s, useCloneReceivableMutation as c, useCreateReceivableMutation as l, useDeclineReceivableMutation as u, useDeleteReceivableMutation as d, useIssueReceivableMutation as f, useUpdateReceivableMutation as p } from "./index7.js";
8
8
  import "./index8.js";
9
9
  import { useMarkReceivablePaidMutation as m, useMarkReceivablePartiallyPaidMutation as h, useMarkReceivableUncollectibleMutation as g } from "./index9.js";
10
- import { useReceivableHistoryQuery as _, useReceivableMailsQuery as v, useReceivablePdfLinkQuery as y, useReceivableQuery as b, useReceivablesQuery as x } from "./index10.js";
11
- import { useCreateOverdueReminderMutation as S, useCreatePaymentReminderMutation as C, useCreateRecurrenceMutation as w, useOverdueRemindersQuery as T, usePaymentRemindersQuery as E, useRecurrenceQuery as D, useUpdateRecurrenceMutation as O } from "./index11.js";
12
- import { useReceivablesAnalyticsQuery as k } from "./index12.js";
13
- export { o as useAcceptReceivableMutation, s as useCancelReceivableMutation, c as useCloneReceivableMutation, t as useCreateEntityBankAccountMutation, S as useCreateOverdueReminderMutation, C as useCreatePaymentReminderMutation, l as useCreateReceivableMutation, w as useCreateRecurrenceMutation, u as useDeclineReceivableMutation, r as useDeleteReceivableAttachmentMutation, d as useDeleteReceivableMutation, f as useIssueReceivableMutation, m as useMarkReceivablePaidMutation, h as useMarkReceivablePartiallyPaidMutation, g as useMarkReceivableUncollectibleMutation, T as useOverdueRemindersQuery, n as usePaymentAccountsQuery, E as usePaymentRemindersQuery, e as usePaymentTermsQuery, _ as useReceivableHistoryQuery, v as useReceivableMailsQuery, y as useReceivablePdfLinkQuery, b as useReceivableQuery, k as useReceivablesAnalyticsQuery, x as useReceivablesQuery, D as useRecurrenceQuery, a as useSendReceivableEmailMutation, p as useUpdateReceivableMutation, O as useUpdateRecurrenceMutation, i as useUploadReceivableAttachmentMutation };
10
+ import { useReceivableHistoryQuery as _, useReceivableMailsQuery as v, useReceivablePdfLinkQuery as y, useReceivableQuery as b, useReceivableRequiredFieldsQuery as x, useReceivablesQuery as S } from "./index10.js";
11
+ import { useCreateOverdueReminderMutation as C, useCreatePaymentReminderMutation as w, useCreateRecurrenceMutation as T, useOverdueRemindersQuery as E, usePaymentRemindersQuery as D, useRecurrenceQuery as O, useUpdateRecurrenceMutation as k } from "./index11.js";
12
+ import { useReceivablesAnalyticsQuery as A } from "./index12.js";
13
+ export { o as useAcceptReceivableMutation, s as useCancelReceivableMutation, c as useCloneReceivableMutation, t as useCreateEntityBankAccountMutation, C as useCreateOverdueReminderMutation, w as useCreatePaymentReminderMutation, l as useCreateReceivableMutation, T as useCreateRecurrenceMutation, u as useDeclineReceivableMutation, r as useDeleteReceivableAttachmentMutation, d as useDeleteReceivableMutation, f as useIssueReceivableMutation, m as useMarkReceivablePaidMutation, h as useMarkReceivablePartiallyPaidMutation, g as useMarkReceivableUncollectibleMutation, E as useOverdueRemindersQuery, n as usePaymentAccountsQuery, D as usePaymentRemindersQuery, e as usePaymentTermsQuery, _ as useReceivableHistoryQuery, v as useReceivableMailsQuery, y as useReceivablePdfLinkQuery, b as useReceivableQuery, x as useReceivableRequiredFieldsQuery, A as useReceivablesAnalyticsQuery, S as useReceivablesQuery, O as useRecurrenceQuery, a as useSendReceivableEmailMutation, p as useUpdateReceivableMutation, k as useUpdateRecurrenceMutation, i as useUploadReceivableAttachmentMutation };