@tesouro/embedded-components-react 0.4.28 → 0.4.30

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 (93) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +2 -2
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +15 -82
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +87 -25
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index18.js +36 -0
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +12 -12
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +5 -70
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +64 -37
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +38 -110
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +104 -73
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +87 -7
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +7 -21
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +17 -22
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +23 -63
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +66 -2
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +2 -77
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +78 -3
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +4 -5
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +5 -4
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +3 -32
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +30 -39
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +37 -166
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +164 -39
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +48 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +1 -50
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +45 -11
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +13 -8
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +8 -14
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +7 -59
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +64 -8
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +8 -24
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +18 -136
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +139 -16
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +24 -4
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +4 -41
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +39 -88
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +79 -85
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +96 -3
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +3 -49
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +47 -119
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +135 -33
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +33 -186
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +186 -75
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +75 -21
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +22 -232
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +223 -210
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +14 -25
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +202 -103
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +121 -13
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +12 -47
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +47 -31
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +27 -198
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +198 -30
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +30 -234
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +240 -19
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +19 -425
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +433 -4
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +25 -24
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +4 -38
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +35 -218
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +224 -3
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +3 -4
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +2 -44
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +46 -1
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +1 -8
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +6 -10
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +10 -110
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +112 -3
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +21 -57
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +3 -127
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +124 -8
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +8 -7
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -46
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +43 -18
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +20 -28
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +27 -82
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +83 -47
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +47 -250
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +239 -101
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +58 -5
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +107 -202
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +209 -3
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +4 -8
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +6 -113
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +115 -1
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +0 -24
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +25 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +5 -4
  90. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +1784 -1769
  91. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  92. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  93. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { RefreshingRootWidgetProvider as _ } from "./libs/tesouro-embedded-compo
14
14
  import { useDisclosuresAcceptanceSurface as v, useOwnWidgetConfig as y, useRefetchWidget as b, useWidgetConfig as x, useWidgetError as S, useWidgetInitStaleForToken as C, useWidgetLoading as w } from "./libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js";
15
15
  import { BankAccountsWidget as T } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
16
16
  import { CounterpartsWidget as E } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
17
- import { BillPayWidget as D } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js";
17
+ import { BillPayWidget as D } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js";
18
18
  import { CardDetailsWidget as O } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js";
19
19
  import { CreditCardsWidget as k } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js";
20
20
  import { DebitCardsWidget as A } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
@@ -1,3 +1,3 @@
1
- import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js";
1
+ import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js";
2
2
  import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
3
3
  export { e as BillPayWidget };
@@ -11,6 +11,6 @@ import { useSchedulePaymentMutation as p } from "./index12.js";
11
11
  import { useAttachPayableFileMutation as m, useCancelPayableMutation as h, useCancelScheduledPaymentMutation as g, useCreatePayableMutation as _, useDeletePayableFileMutation as v, useDeletePayableMutation as y, useForceApprovePayableMutation as b, useForceRejectPayableMutation as x, useMarkPayableAsPaidMutation as S, useReopenPayableMutation as C, useSubmitPayableForApprovalMutation as w, useUpdatePayableMutation as T, useUploadPayableFromFileMutation as E, useValidatePayableMutation as D } from "./index13.js";
12
12
  import { useUpdatePayableCounterpartBankAccountMutation as O } from "./index14.js";
13
13
  import { usePayableOcrQueries as k } from "./index15.js";
14
- import { useAllSuspectedDuplicatePayablesQuery as A, usePayableQuery as j, usePayablesQuery as M, usePayablesTotalCountQuery as N } from "./index16.js";
15
- import { usePayableSuggestionsQuery as P } from "./index17.js";
14
+ import { useAllSuspectedDuplicatePayablesQuery as A, usePayableQuery as j, usePayablesQuery as M, usePayablesTotalCountQuery as N } from "./index17.js";
15
+ import { usePayableSuggestionsQuery as P } from "./index18.js";
16
16
  export { n as DuplicateVerdict, r as hasSuspectedPayableDuplicate, t as isLiveScheduledPaymentRecord, i as suspectedPayableDuplicates, u as useAllPayableLineItemsQuery, A as useAllSuspectedDuplicatePayablesQuery, a as useApplyDuplicateVerdictsMutation, o as useApprovePayableApprovalRequestMutation, m as useAttachPayableFileMutation, h as useCancelPayableMutation, g as useCancelScheduledPaymentMutation, _ as useCreatePayableMutation, v as useDeletePayableFileMutation, y as useDeletePayableMutation, e as useEmbedApi, b as useForceApprovePayableMutation, x as useForceRejectPayableMutation, S as useMarkPayableAsPaidMutation, s as usePayableApprovalRequestsQuery, l as usePayableHistoryQuery, k as usePayableOcrQueries, f as usePayablePaymentRecordsQuery, j as usePayableQuery, P as usePayableSuggestionsQuery, M as usePayablesQuery, N as usePayablesTotalCountQuery, c as useRejectPayableApprovalRequestMutation, C as useReopenPayableMutation, d as useReplacePayableLineItemsMutation, p as useSchedulePaymentMutation, w as useSubmitPayableForApprovalMutation, O as useUpdatePayableCounterpartBankAccountMutation, T as useUpdatePayableMutation, E as useUploadPayableFromFileMutation, D as useValidatePayableMutation };
@@ -1,87 +1,20 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
- import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
- import { getPayables as n } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
8
- import { getPayablesAnalyticsOptions as r, getPayablesIdOptions as i, getPayablesOptions as a, getPayablesQueryKey as o } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
9
- import { withAuthEpoch as s } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
1
+ import { organizationHeaders as e } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
2
+ import { getPayablesIdOptions as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
10
3
  import "../../../shared/data-access/dist/index.js";
11
- import { payableOcrQueryOptions as c } from "./index4.js";
12
- import { queryOptions as l, useQuery as u } from "@tanstack/react-query";
13
4
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js
14
- function d({ enabled: n, ...r } = {}) {
15
- let { client: i, organizationId: o, widgetToken: c, authEpoch: l } = e(), d = !!(o && c) && (n === !0 || n === void 0), f = a({
16
- client: i,
17
- headers: t(o),
18
- query: r
19
- });
20
- return u({
21
- ...s(f, l),
22
- enabled: d
23
- });
24
- }
25
- var f = 100;
26
- function p({ enabled: r } = {}) {
27
- let { client: i, organizationId: a, widgetToken: c, authEpoch: d } = e(), p = t(a), m = {
28
- duplicate_match_status: "suspected",
29
- limit: f
30
- }, h = l({
31
- queryKey: [...o({
32
- client: i,
33
- headers: p,
34
- query: m
35
- }), "all"],
36
- queryFn: async ({ signal: e }) => {
37
- let t = [], r = /* @__PURE__ */ new Set(), a;
38
- do {
39
- let { data: o } = await n({
40
- client: i,
41
- headers: p,
42
- query: {
43
- ...m,
44
- pagination_token: a
45
- },
46
- signal: e,
47
- throwOnError: !0
48
- });
49
- t.push(...o.data ?? []);
50
- let s = o.next_pagination_token ?? void 0;
51
- a = s && !r.has(s) ? (r.add(s), s) : void 0;
52
- } while (a);
53
- return { data: t };
5
+ var n = 1e3;
6
+ function r({ client: r, organizationId: i, payableId: a }) {
7
+ return {
8
+ ...t({
9
+ client: r,
10
+ headers: e(i),
11
+ path: { payable_id: a }
12
+ }),
13
+ refetchInterval: (e) => {
14
+ let t = e.state.data;
15
+ return !t || t.approval_policy_id || t.status !== "approve_in_progress" || !t.updated_at ? !1 : Date.now() - new Date(t.updated_at).getTime() < 1e4 && n;
54
16
  }
55
- });
56
- return u({
57
- ...s(h, d),
58
- enabled: !!(a && c) && r !== !1
59
- });
60
- }
61
- function m({ enabled: n } = {}) {
62
- let { client: i, organizationId: a, widgetToken: o, authEpoch: c } = e(), l = !!(a && o) && (n === !0 || n === void 0), d = r({
63
- client: i,
64
- headers: t(a)
65
- });
66
- return u({
67
- ...s(d, c),
68
- enabled: l
69
- });
70
- }
71
- function h(n, { enabled: r = !0, pollWhileOcrProcessing: a = !1 } = {}) {
72
- let { client: o, organizationId: l, widgetToken: d, authEpoch: f } = e(), p = !!(l && d && n) && r, m = a ? c({
73
- client: o,
74
- organizationId: l,
75
- payableId: n ?? ""
76
- }) : i({
77
- client: o,
78
- headers: t(l),
79
- path: { payable_id: n ?? "" }
80
- });
81
- return u({
82
- ...s(m, f),
83
- enabled: p
84
- });
17
+ };
85
18
  }
86
19
  //#endregion
87
- export { p as useAllSuspectedDuplicatePayablesQuery, h as usePayableQuery, d as usePayablesQuery, m as usePayablesTotalCountQuery };
20
+ export { r as payablePolicyAssignmentQueryOptions };
@@ -4,33 +4,95 @@
4
4
  "use client";
5
5
  import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
6
  import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
- import { getPayablesIdSuggestionsOptions as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
8
- import { withAuthEpoch as r } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
9
- import { isApiNotFoundError as i } from "../../../shared/data-access/dist/lib/isApiNotFoundError.js";
7
+ import { getPayables as n } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
8
+ import { getPayablesAnalyticsOptions as r, getPayablesIdOptions as i, getPayablesOptions as a, getPayablesQueryKey as o } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
9
+ import { withAuthEpoch as s } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
10
10
  import "../../../shared/data-access/dist/index.js";
11
- import { useQuery as a } from "@tanstack/react-query";
11
+ import { payableOcrQueryOptions as c } from "./index4.js";
12
+ import { payablePolicyAssignmentQueryOptions as l } from "./index16.js";
13
+ import { queryOptions as u, useQuery as d } from "@tanstack/react-query";
12
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js
13
- function o(o, { enabled: s = !0 } = {}) {
14
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), f = !!(l && u && o) && s, p = n({
15
- client: c,
16
- headers: t(l),
17
- path: { payable_id: o ?? "" }
18
- }), { queryKey: m, queryFn: h } = r(p, d);
19
- return a({
20
- queryKey: m,
21
- enabled: f,
22
- retry: !1,
23
- queryFn: async (e) => {
24
- try {
25
- if (typeof h != "function") throw Error("getPayablesIdSuggestionsOptions has no queryFn");
26
- return await h(e);
27
- } catch (e) {
28
- if (i(e)) return null;
29
- throw e;
30
- }
31
- },
32
- select: (e) => e ?? void 0
15
+ function f({ enabled: n, ...r } = {}) {
16
+ let { client: i, organizationId: o, widgetToken: c, authEpoch: l } = e(), u = !!(o && c) && (n === !0 || n === void 0), f = a({
17
+ client: i,
18
+ headers: t(o),
19
+ query: r
20
+ });
21
+ return d({
22
+ ...s(f, l),
23
+ enabled: u
24
+ });
25
+ }
26
+ var p = 100;
27
+ function m({ enabled: r } = {}) {
28
+ let { client: i, organizationId: a, widgetToken: c, authEpoch: l } = e(), f = t(a), m = {
29
+ duplicate_match_status: "suspected",
30
+ limit: p
31
+ }, h = u({
32
+ queryKey: [...o({
33
+ client: i,
34
+ headers: f,
35
+ query: m
36
+ }), "all"],
37
+ queryFn: async ({ signal: e }) => {
38
+ let t = [], r = /* @__PURE__ */ new Set(), a;
39
+ do {
40
+ let { data: o } = await n({
41
+ client: i,
42
+ headers: f,
43
+ query: {
44
+ ...m,
45
+ pagination_token: a
46
+ },
47
+ signal: e,
48
+ throwOnError: !0
49
+ });
50
+ t.push(...o.data ?? []);
51
+ let s = o.next_pagination_token ?? void 0;
52
+ a = s && !r.has(s) ? (r.add(s), s) : void 0;
53
+ } while (a);
54
+ return { data: t };
55
+ }
56
+ });
57
+ return d({
58
+ ...s(h, l),
59
+ enabled: !!(a && c) && r !== !1
60
+ });
61
+ }
62
+ function h({ enabled: n } = {}) {
63
+ let { client: i, organizationId: a, widgetToken: o, authEpoch: c } = e(), l = !!(a && o) && (n === !0 || n === void 0), u = r({
64
+ client: i,
65
+ headers: t(a)
66
+ });
67
+ return d({
68
+ ...s(u, c),
69
+ enabled: l
70
+ });
71
+ }
72
+ function g(n, { enabled: r = !0, pollWhileOcrProcessing: a = !1, pollWhilePolicyAssignmentUnsettled: o = !1 } = {}) {
73
+ let { client: u, organizationId: f, widgetToken: p, authEpoch: m } = e(), h = !!(f && p && n) && r, g = a ? c({
74
+ client: u,
75
+ organizationId: f,
76
+ payableId: n ?? ""
77
+ }) : void 0, _ = o ? l({
78
+ client: u,
79
+ organizationId: f,
80
+ payableId: n ?? ""
81
+ }) : void 0, v = g ?? _ ?? i({
82
+ client: u,
83
+ headers: t(f),
84
+ path: { payable_id: n ?? "" }
85
+ }), y = g && _ ? {
86
+ ...v,
87
+ refetchInterval: (e) => {
88
+ let t = [g.refetchInterval(e), _.refetchInterval(e)].filter((e) => e !== !1);
89
+ return t.length ? Math.min(...t) : !1;
90
+ }
91
+ } : v;
92
+ return d({
93
+ ...s(y, m),
94
+ enabled: h
33
95
  });
34
96
  }
35
97
  //#endregion
36
- export { o as usePayableSuggestionsQuery };
98
+ export { m as useAllSuspectedDuplicatePayablesQuery, g as usePayableQuery, f as usePayablesQuery, h as usePayablesTotalCountQuery };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
+ import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
+ import { getPayablesIdSuggestionsOptions as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
8
+ import { withAuthEpoch as r } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
9
+ import { isApiNotFoundError as i } from "../../../shared/data-access/dist/lib/isApiNotFoundError.js";
10
+ import "../../../shared/data-access/dist/index.js";
11
+ import { useQuery as a } from "@tanstack/react-query";
12
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index18.js
13
+ function o(o, { enabled: s = !0 } = {}) {
14
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), f = !!(l && u && o) && s, p = n({
15
+ client: c,
16
+ headers: t(l),
17
+ path: { payable_id: o ?? "" }
18
+ }), { queryKey: m, queryFn: h } = r(p, d);
19
+ return a({
20
+ queryKey: m,
21
+ enabled: f,
22
+ retry: !1,
23
+ queryFn: async (e) => {
24
+ try {
25
+ if (typeof h != "function") throw Error("getPayablesIdSuggestionsOptions has no queryFn");
26
+ return await h(e);
27
+ } catch (e) {
28
+ if (i(e)) return null;
29
+ throw e;
30
+ }
31
+ },
32
+ select: (e) => e ?? void 0
33
+ });
34
+ }
35
+ //#endregion
36
+ export { o as usePayableSuggestionsQuery };
@@ -1,31 +1,31 @@
1
- import "./index5.js";
2
1
  import "./index6.js";
3
2
  import "./index7.js";
4
- import "./index9.js";
3
+ import "./index8.js";
5
4
  import "./index10.js";
6
5
  import "./index11.js";
7
6
  import "./index12.js";
8
7
  import "./index13.js";
9
8
  import "./index14.js";
10
- import "./index26.js";
9
+ import "./index15.js";
11
10
  import "./index27.js";
12
- import "./index39.js";
13
- import "./index45.js";
14
- import "./index54.js";
15
- import "./index56.js";
16
- import "./index58.js";
11
+ import "./index28.js";
12
+ import "./index40.js";
13
+ import "./index46.js";
14
+ import "./index55.js";
15
+ import "./index57.js";
17
16
  import "./index59.js";
18
17
  import "./index60.js";
19
18
  import "./index61.js";
20
19
  import "./index62.js";
21
- import "./index66.js";
20
+ import "./index63.js";
22
21
  import "./index67.js";
23
22
  import "./index68.js";
24
23
  import "./index69.js";
25
24
  import "./index70.js";
26
- import "./index73.js";
27
- import "./index79.js";
25
+ import "./index71.js";
26
+ import "./index74.js";
28
27
  import "./index80.js";
29
28
  import "./index81.js";
30
- import { BillPayWidget as e } from "./index85.js";
29
+ import "./index82.js";
30
+ import { BillPayWidget as e } from "./index86.js";
31
31
  export { e as BillPayWidget };
@@ -1,73 +1,8 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
6
- import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
7
- import { suspectedPayableDuplicates as n } from "../../data-access/dist/index7.js";
8
- import { useAllSuspectedDuplicatePayablesQuery as r, usePayablesQuery as i } from "../../data-access/dist/index16.js";
9
- import "../../data-access/dist/index.js";
10
- import { groupSuspectedDuplicates as a } from "./index6.js";
11
- import { derivePayableStatus as o } from "./index7.js";
12
- import { payableRemoval as s } from "./index9.js";
13
- import { resolveVendorName as c } from "./index8.js";
14
- import { useMemo as l } from "react";
15
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js
16
- function u(e) {
17
- return e.isError && e.data === void 0;
18
- }
19
- function d(e, n) {
20
- return e == null ? "" : t(e / 100, { currencyCode: n ?? "USD" });
21
- }
22
- function f(t) {
23
- let r = t.status ? o({
24
- apiStatus: t.status,
25
- dueDate: t.due_date,
26
- scheduledPaymentDate: t.scheduled_payment_date
27
- }) : void 0;
28
- return {
29
- id: t.id,
30
- status: r?.status,
31
- statusTone: r?.tone,
32
- matches: n(t).map((e) => ({
33
- matchId: e.id,
34
- matchedPayableId: e.matched_payable_id
35
- })),
36
- removeBy: s(t.status),
37
- vendorLabel: c(t),
38
- invoiceNumberLabel: t.document_id ?? "",
39
- amountLabel: d(t.total_amount ?? t.amount_due, t.currency),
40
- dueDateLabel: e(t.due_date),
41
- addedOnLabel: e(t.created_at?.slice(0, 10))
42
- };
43
- }
44
- function p(e) {
45
- return a(e).map(({ members: e }) => e).filter((e) => e.length > 1).map((e) => ({
46
- id: e[0].id,
47
- vendorLabel: e.map(c).find(Boolean) ?? "",
48
- bills: e.map(f)
49
- }));
50
- }
51
- function m({ enabled: e = !0 } = {}) {
52
- let t = r({ enabled: e }), n = t.data?.data;
53
- return {
54
- groups: l(() => p(n ?? []), [n]),
55
- isLoading: t.isLoading,
56
- isError: u(t)
57
- };
58
- }
59
- function h({ enabled: e = !0 } = {}) {
60
- let t = i({
61
- duplicate_match_status: "suspected",
62
- limit: 100,
63
- enabled: e
64
- });
65
- return {
66
- count: t.data?.data?.length ?? 0,
67
- isCapped: !!t.data?.next_pagination_token,
68
- isError: u(t),
69
- isLoading: t.isLoading
70
- };
2
+ function e(e) {
3
+ if (e === "draft") return "delete";
4
+ if (e === "new") return "cancel";
5
+ if (e === "canceled") return "confirm";
71
6
  }
72
7
  //#endregion
73
- export { m as useDuplicateBills, h as useDuplicateBillsCount };
8
+ export { e as payableRemoval };
@@ -2,45 +2,72 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { useCallback as e, useEffect as t, useState as n } from "react";
5
+ import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
6
+ import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
7
+ import { suspectedPayableDuplicates as n } from "../../data-access/dist/index7.js";
8
+ import { useAllSuspectedDuplicatePayablesQuery as r, usePayablesQuery as i } from "../../data-access/dist/index17.js";
9
+ import "../../data-access/dist/index.js";
10
+ import { groupSuspectedDuplicates as a } from "./index7.js";
11
+ import { derivePayableStatus as o } from "./index8.js";
12
+ import { payableRemoval as s } from "./index10.js";
13
+ import { resolveVendorName as c } from "./index9.js";
14
+ import { useMemo as l } from "react";
6
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js
7
- function r({ reviewIds: r }) {
8
- let [i, a] = n(/* @__PURE__ */ new Set());
9
- t(() => {
10
- let e = new Set(r);
11
- a((t) => {
12
- let n = new Set([...t].filter((t) => e.has(t)));
13
- return n.size === t.size ? t : n;
14
- });
15
- }, [r]);
16
- let o = e((e) => {
17
- a((t) => {
18
- let n = new Set(t);
19
- return n.delete(e) || n.add(e), n;
20
- });
21
- }, []), s = e((e) => {
22
- a((t) => {
23
- let n = new Set(t), r = e.every((e) => n.has(e));
24
- return e.forEach((e) => {
25
- r ? n.delete(e) : n.add(e);
26
- }), n;
27
- });
28
- }, []), c = e((e) => {
29
- a((t) => {
30
- let n = new Set(t);
31
- return e.forEach((e) => n.delete(e)), n;
32
- });
33
- }, []);
16
+ function u(e) {
17
+ return e.isError && e.data === void 0;
18
+ }
19
+ function d(e, n) {
20
+ return e == null ? "" : t(e / 100, { currencyCode: n ?? "USD" });
21
+ }
22
+ function f(t) {
23
+ let r = t.status ? o({
24
+ apiStatus: t.status,
25
+ dueDate: t.due_date,
26
+ scheduledPaymentDate: t.scheduled_payment_date
27
+ }) : void 0;
28
+ return {
29
+ id: t.id,
30
+ status: r?.status,
31
+ statusTone: r?.tone,
32
+ matches: n(t).map((e) => ({
33
+ matchId: e.id,
34
+ matchedPayableId: e.matched_payable_id
35
+ })),
36
+ removeBy: s(t.status),
37
+ vendorLabel: c(t),
38
+ invoiceNumberLabel: t.document_id ?? "",
39
+ amountLabel: d(t.total_amount ?? t.amount_due, t.currency),
40
+ dueDateLabel: e(t.due_date),
41
+ addedOnLabel: e(t.created_at?.slice(0, 10))
42
+ };
43
+ }
44
+ function p(e) {
45
+ return a(e).map(({ members: e }) => e).filter((e) => e.length > 1).map((e) => ({
46
+ id: e[0].id,
47
+ vendorLabel: e.map(c).find(Boolean) ?? "",
48
+ bills: e.map(f)
49
+ }));
50
+ }
51
+ function m({ enabled: e = !0 } = {}) {
52
+ let t = r({ enabled: e }), n = t.data?.data;
53
+ return {
54
+ groups: l(() => p(n ?? []), [n]),
55
+ isLoading: t.isLoading,
56
+ isError: u(t)
57
+ };
58
+ }
59
+ function h({ enabled: e = !0 } = {}) {
60
+ let t = i({
61
+ duplicate_match_status: "suspected",
62
+ limit: 100,
63
+ enabled: e
64
+ });
34
65
  return {
35
- isSelected: e((e) => i.has(e), [i]),
36
- toggle: o,
37
- toggleAll: s,
38
- checkedState: e((e) => {
39
- let t = e.filter((e) => i.has(e)).length;
40
- return t === 0 ? !1 : t === e.length || "indeterminate";
41
- }, [i]),
42
- deselect: c
66
+ count: t.data?.data?.length ?? 0,
67
+ isCapped: !!t.data?.next_pagination_token,
68
+ isError: u(t),
69
+ isLoading: t.isLoading
43
70
  };
44
71
  }
45
72
  //#endregion
46
- export { r as useDuplicateBillsSelection };
73
+ export { m as useDuplicateBills, h as useDuplicateBillsCount };