@tesouro/embedded-components-react 0.5.83 → 0.5.85
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.
- package/dist/index.d.ts +1 -1
- package/dist/lib/InvoicingWidget.d.ts +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index.js +6 -7
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +28 -21
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index2.js +7 -23
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index3.js +34 -6
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index5.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index6.js +11 -17
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index7.js +37 -16
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index8.js +3 -43
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index9.js +31 -3
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +29 -33
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +7 -19
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +68 -77
- package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +4 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +31 -30
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/EmbedApiContext.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +186 -175
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/scopedClientSecret.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/transportInterceptors.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +39 -36
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +86 -83
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js +3 -2
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index11.js +0 -48
package/dist/index.d.ts
CHANGED
|
@@ -4232,7 +4232,7 @@ declare function ExpenseManagementWidget({ baseUrl, widgetToken, organizationId,
|
|
|
4232
4232
|
type ReceivablesWidgetMoniteProps = MoniteRegionProviderProps & Omit<ReceivablesProps, 'pageTitleComponent' | 'initialView' | 'initialCounterpartId'> & {
|
|
4233
4233
|
pageTitleComponent?: ReceivablesProps['pageTitleComponent'];
|
|
4234
4234
|
};
|
|
4235
|
-
declare function ReceivablesWidgetMonite({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, errorFallback, onError, finopsThemeColors, analytics, disclosuresAcceptance, providerLabels, pageTitleComponent, uiFramework, ...receivablesProps }: ReceivablesWidgetMoniteProps): React.JSX.Element;
|
|
4235
|
+
declare function ReceivablesWidgetMonite({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, errorFallback, onError, finopsThemeColors, analytics, disclosuresAcceptance, providerLabels, pageTitleComponent, uiFramework, implementation, ...receivablesProps }: ReceivablesWidgetMoniteProps): React.JSX.Element;
|
|
4236
4236
|
|
|
4237
4237
|
interface ProductFormSheetLabels {
|
|
4238
4238
|
createTitle: string;
|
|
@@ -662,7 +662,7 @@ type MoniteRegionProviderProps = WidgetProviderProps & MoniteWrapperProps;
|
|
|
662
662
|
type ReceivablesWidgetMoniteProps = MoniteRegionProviderProps & Omit<ReceivablesProps, 'pageTitleComponent' | 'initialView' | 'initialCounterpartId'> & {
|
|
663
663
|
pageTitleComponent?: ReceivablesProps['pageTitleComponent'];
|
|
664
664
|
};
|
|
665
|
-
declare function ReceivablesWidgetMonite({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, errorFallback, onError, finopsThemeColors, analytics, disclosuresAcceptance, providerLabels, pageTitleComponent, uiFramework, ...receivablesProps }: ReceivablesWidgetMoniteProps): React.JSX.Element;
|
|
665
|
+
declare function ReceivablesWidgetMonite({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, errorFallback, onError, finopsThemeColors, analytics, disclosuresAcceptance, providerLabels, pageTitleComponent, uiFramework, implementation, ...receivablesProps }: ReceivablesWidgetMoniteProps): React.JSX.Element;
|
|
666
666
|
|
|
667
667
|
export { ReceivablesWidgetMonite as InvoicingWidget };
|
|
668
668
|
export type { ReceivablesWidgetMoniteProps as InvoicingWidgetProps };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { OnboardingSuppressionReason as e } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
|
|
2
2
|
import { useOrganizationOnboardingSuppression as t } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
|
|
3
3
|
import "../../../shared/data-access/dist/index.js";
|
|
4
|
-
import { ApplicationClientSecretProvider as n, useApplicationClientSecret as r } from "./
|
|
5
|
-
import "./index3.js";
|
|
4
|
+
import { ApplicationClientSecretProvider as n, useApplicationClientSecret as r } from "./index3.js";
|
|
6
5
|
import { useCreateApplication as i } from "./index4.js";
|
|
7
|
-
import { useUpdateApplication as a } from "./
|
|
8
|
-
import { useSubmitApplication as o } from "./
|
|
9
|
-
import { usePollApplicationCompletion as s } from "./
|
|
10
|
-
import { useResumableBankAccountApplication as c } from "./
|
|
11
|
-
import { useStartedBankAccountApplication as l } from "./
|
|
6
|
+
import { useUpdateApplication as a } from "./index5.js";
|
|
7
|
+
import { useSubmitApplication as o } from "./index6.js";
|
|
8
|
+
import { usePollApplicationCompletion as s } from "./index7.js";
|
|
9
|
+
import { useResumableBankAccountApplication as c } from "./index9.js";
|
|
10
|
+
import { useStartedBankAccountApplication as l } from "./index10.js";
|
|
12
11
|
export { n as ApplicationClientSecretProvider, e as OnboardingSuppressionReason, r as useApplicationClientSecret, i as useCreateApplication, t as useOrganizationOnboardingSuppression, s as usePollApplicationCompletion, c as useResumableBankAccountApplication, l as useStartedBankAccountApplication, o as useSubmitApplication, a as useUpdateApplication };
|
|
@@ -3,32 +3,39 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { optionalOrganizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
+
import { getBankAccountApplicationOptions 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";
|
|
8
9
|
import "../../../shared/data-access/dist/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
10
|
+
import { useInstallApplicationClientSecret as i } from "./index3.js";
|
|
11
|
+
import { hasFreshAnswer as a } from "./index8.js";
|
|
12
|
+
import { useMemo as o } from "react";
|
|
13
|
+
import { useQuery as s } from "@tanstack/react-query";
|
|
11
14
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
let
|
|
21
|
-
...n(
|
|
22
|
-
|
|
15
|
+
var c = (e, t) => (n, r) => {
|
|
16
|
+
if (n === void 0 || r === void 0) return;
|
|
17
|
+
let [i] = r.queryKey;
|
|
18
|
+
if (i !== void 0 && i.baseUrl === e && i.path?.id === t) return n;
|
|
19
|
+
};
|
|
20
|
+
function l(l, u) {
|
|
21
|
+
let { client: d, organizationId: f, widgetToken: p, authEpoch: m } = e();
|
|
22
|
+
i(l, u);
|
|
23
|
+
let h = !!(p && l && u), g = d.getConfig().baseUrl, _ = o(() => c(g, l), [g, l]), v = s({
|
|
24
|
+
...r(n({
|
|
25
|
+
client: d,
|
|
26
|
+
path: { id: l ?? "" },
|
|
27
|
+
headers: t(f)
|
|
28
|
+
}), m),
|
|
29
|
+
placeholderData: _,
|
|
30
|
+
enabled: h,
|
|
23
31
|
retry: 2,
|
|
24
32
|
retryDelay: 300
|
|
25
|
-
})
|
|
33
|
+
});
|
|
26
34
|
return {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
ownApplicationIds: p ? l(p) : null
|
|
35
|
+
application: v.data ?? null,
|
|
36
|
+
isResolved: !h || a(v),
|
|
37
|
+
isUnavailable: h && v.isError
|
|
31
38
|
};
|
|
32
39
|
}
|
|
33
40
|
//#endregion
|
|
34
|
-
export {
|
|
41
|
+
export { l as useStartedBankAccountApplication };
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { createContext as e, useContext as t, useMemo as n, useState as r } from "react";
|
|
6
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
7
1
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index2.js
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
clientSecret: t,
|
|
15
|
-
setClientSecret: o
|
|
16
|
-
}), [t]);
|
|
17
|
-
return /* @__PURE__ */ i(a.Provider, {
|
|
18
|
-
value: s,
|
|
19
|
-
children: e
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function s() {
|
|
23
|
-
return t(a);
|
|
2
|
+
var e = ["/embedded-banking/v1/bank-account-applications/{id}"];
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
return {
|
|
5
|
+
clientSecret: n,
|
|
6
|
+
appliesTo: ({ url: n, path: r }) => e.some((e) => n.startsWith(e)) && r?.id === t
|
|
7
|
+
};
|
|
24
8
|
}
|
|
25
9
|
//#endregion
|
|
26
|
-
export {
|
|
10
|
+
export { t as applicationClientSecret };
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
|
|
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";
|
|
2
6
|
import "../../../shared/data-access/dist/index.js";
|
|
7
|
+
import { applicationClientSecret as t } from "./index2.js";
|
|
8
|
+
import { createContext as n, useContext as r, useEffect as i, useLayoutEffect as a, useMemo as o, useRef as s } from "react";
|
|
9
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
3
10
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index3.js
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
var l = n({ setClientSecret: () => void 0 }), u = "document" in globalThis ? a : i;
|
|
12
|
+
function d({ children: n }) {
|
|
13
|
+
let { installClientSecret: r } = e(), i = s(null), a = s(null), d = s(!1), f = o(() => ({ setClientSecret: (e, n) => {
|
|
14
|
+
i.current = t(e, n), d.current && (a.current = r?.(i.current) ?? null);
|
|
15
|
+
} }), [r]);
|
|
16
|
+
return u(() => (d.current = !0, i.current && (a.current = r?.(i.current) ?? null), () => {
|
|
17
|
+
d.current = !1, a.current?.(), a.current = null;
|
|
18
|
+
}), [r]), /* @__PURE__ */ c(l.Provider, {
|
|
19
|
+
value: f,
|
|
20
|
+
children: n
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function f() {
|
|
24
|
+
return r(l);
|
|
25
|
+
}
|
|
26
|
+
function p(e, t) {
|
|
27
|
+
let { setClientSecret: n } = f();
|
|
28
|
+
u(() => {
|
|
29
|
+
e && t && n(e, t);
|
|
30
|
+
}, [
|
|
31
|
+
e,
|
|
32
|
+
t,
|
|
33
|
+
n
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
8
36
|
//#endregion
|
|
9
|
-
export {
|
|
37
|
+
export { d as ApplicationClientSecretProvider, f as useApplicationClientSecret, p as useInstallApplicationClientSecret };
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
+
import { optionalOrganizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
+
import { updateApplicationMutation as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
8
|
import "../../../shared/data-access/dist/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import { applicationResourceHeaders as n } from "./index3.js";
|
|
9
|
-
import { useRef as r } from "react";
|
|
9
|
+
import { useMutation as r } from "@tanstack/react-query";
|
|
10
10
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index5.js
|
|
11
11
|
function i() {
|
|
12
|
-
let { client: i, organizationId: a } = e()
|
|
13
|
-
return
|
|
12
|
+
let { client: i, organizationId: a } = e();
|
|
13
|
+
return r(n({
|
|
14
14
|
client: i,
|
|
15
|
-
|
|
16
|
-
};
|
|
15
|
+
headers: t(a)
|
|
16
|
+
}));
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
export { i as
|
|
19
|
+
export { i as useUpdateApplication };
|
|
@@ -2,24 +2,18 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
+
import { optionalOrganizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
+
import { submitApplicationMutation as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
8
|
import "../../../shared/data-access/dist/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import { useMutation as n } from "@tanstack/react-query";
|
|
9
|
+
import { useMutation as r } from "@tanstack/react-query";
|
|
9
10
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index6.js
|
|
10
|
-
function
|
|
11
|
-
let { client:
|
|
12
|
-
return n({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}),
|
|
17
|
-
mutationFn: (t, n) => e({
|
|
18
|
-
client: r,
|
|
19
|
-
headers: i(),
|
|
20
|
-
...t
|
|
21
|
-
}).mutationFn(t, n)
|
|
22
|
-
});
|
|
11
|
+
function i() {
|
|
12
|
+
let { client: i, organizationId: a } = e();
|
|
13
|
+
return r(n({
|
|
14
|
+
client: i,
|
|
15
|
+
headers: t(a)
|
|
16
|
+
}));
|
|
23
17
|
}
|
|
24
18
|
//#endregion
|
|
25
|
-
export {
|
|
19
|
+
export { i as useSubmitApplication };
|
|
@@ -2,24 +2,45 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
+
import { getApplicationStatus as t } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
7
|
import "../../../shared/data-access/dist/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import { useMutation as n } from "@tanstack/react-query";
|
|
8
|
+
import { useCallback as n } from "react";
|
|
9
9
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index7.js
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return n
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
10
|
+
var r = 2e3, i = 30, a = "COMPLETE", o = "BANK_ACCOUNT";
|
|
11
|
+
function s(e, t) {
|
|
12
|
+
return new Promise((n, r) => {
|
|
13
|
+
if (t?.aborted) {
|
|
14
|
+
r(new DOMException("Aborted", "AbortError"));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
let i = () => {
|
|
18
|
+
clearTimeout(a), r(new DOMException("Aborted", "AbortError"));
|
|
19
|
+
}, a = setTimeout(() => {
|
|
20
|
+
t?.removeEventListener("abort", i), n();
|
|
21
|
+
}, e);
|
|
22
|
+
t?.addEventListener("abort", i, { once: !0 });
|
|
22
23
|
});
|
|
23
24
|
}
|
|
25
|
+
function c() {
|
|
26
|
+
let { client: c } = e();
|
|
27
|
+
return n(async (e, n = {}) => {
|
|
28
|
+
let { signal: l } = n, u = !1;
|
|
29
|
+
for (let n = 0; n < i; n++) {
|
|
30
|
+
if (l?.aborted) throw new DOMException("Aborted", "AbortError");
|
|
31
|
+
try {
|
|
32
|
+
let n = await t({
|
|
33
|
+
client: c,
|
|
34
|
+
signal: l
|
|
35
|
+
});
|
|
36
|
+
if (u = !0, n.data?.applications.some((t) => t.product === o && t.applicationId === e && t.status === a)) return { status: "complete" };
|
|
37
|
+
} catch (e) {
|
|
38
|
+
if (e instanceof DOMException && e.name === "AbortError") throw e;
|
|
39
|
+
}
|
|
40
|
+
n < 29 && await s(r, l);
|
|
41
|
+
}
|
|
42
|
+
return u ? { status: "timeout" } : { status: "error" };
|
|
43
|
+
}, [c]);
|
|
44
|
+
}
|
|
24
45
|
//#endregion
|
|
25
|
-
export {
|
|
46
|
+
export { c as usePollApplicationCompletion };
|
|
@@ -1,46 +1,6 @@
|
|
|
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 { getApplicationStatus as t } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
7
|
-
import "../../../shared/data-access/dist/index.js";
|
|
8
|
-
import { useCallback as n } from "react";
|
|
9
1
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index8.js
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return new Promise((n, r) => {
|
|
13
|
-
if (t?.aborted) {
|
|
14
|
-
r(new DOMException("Aborted", "AbortError"));
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
let i = () => {
|
|
18
|
-
clearTimeout(a), r(new DOMException("Aborted", "AbortError"));
|
|
19
|
-
}, a = setTimeout(() => {
|
|
20
|
-
t?.removeEventListener("abort", i), n();
|
|
21
|
-
}, e);
|
|
22
|
-
t?.addEventListener("abort", i, { once: !0 });
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
function c() {
|
|
26
|
-
let { client: c } = e();
|
|
27
|
-
return n(async (e, n = {}) => {
|
|
28
|
-
let { signal: l } = n, u = !1;
|
|
29
|
-
for (let n = 0; n < i; n++) {
|
|
30
|
-
if (l?.aborted) throw new DOMException("Aborted", "AbortError");
|
|
31
|
-
try {
|
|
32
|
-
let n = await t({
|
|
33
|
-
client: c,
|
|
34
|
-
signal: l
|
|
35
|
-
});
|
|
36
|
-
if (u = !0, n.data?.applications.some((t) => t.product === o && t.applicationId === e && t.status === a)) return { status: "complete" };
|
|
37
|
-
} catch (e) {
|
|
38
|
-
if (e instanceof DOMException && e.name === "AbortError") throw e;
|
|
39
|
-
}
|
|
40
|
-
n < 29 && await s(r, l);
|
|
41
|
-
}
|
|
42
|
-
return u ? { status: "timeout" } : { status: "error" };
|
|
43
|
-
}, [c]);
|
|
2
|
+
function e(e) {
|
|
3
|
+
return (e.isSuccess || e.isError) && !e.isFetching;
|
|
44
4
|
}
|
|
45
5
|
//#endregion
|
|
46
|
-
export {
|
|
6
|
+
export { e as hasFreshAnswer };
|
|
@@ -1,6 +1,34 @@
|
|
|
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 { getApplicationStatusOptions as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
7
|
+
import { withAuthEpoch as n } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import { hasFreshAnswer as r } from "./index8.js";
|
|
10
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
1
11
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index9.js
|
|
2
|
-
|
|
3
|
-
|
|
12
|
+
var a = "DRAFT", o = "BANK_ACCOUNT", s = "STARTED_BY_YOU";
|
|
13
|
+
function c(e) {
|
|
14
|
+
return e.find((e) => e.product === o && e.ownership === s && e.status === a && !!e.applicationId && !!e.clientSecret);
|
|
15
|
+
}
|
|
16
|
+
function l(e) {
|
|
17
|
+
return e.filter((e) => e.product === o && e.ownership === s).map((e) => e.applicationId).filter((e) => !!e);
|
|
18
|
+
}
|
|
19
|
+
function u() {
|
|
20
|
+
let { client: a, widgetToken: o, authEpoch: s } = e(), u = !!o, d = i({
|
|
21
|
+
...n(t({ client: a }), s),
|
|
22
|
+
enabled: u,
|
|
23
|
+
retry: 2,
|
|
24
|
+
retryDelay: 300
|
|
25
|
+
}), f = u && r(d), p = f && !d.isError ? d.data?.applications ?? null : null, m = p ? c(p) : void 0;
|
|
26
|
+
return {
|
|
27
|
+
applicationId: m?.applicationId ?? null,
|
|
28
|
+
clientSecret: m?.clientSecret ?? null,
|
|
29
|
+
isResolved: f,
|
|
30
|
+
ownApplicationIds: p ? l(p) : null
|
|
31
|
+
};
|
|
4
32
|
}
|
|
5
33
|
//#endregion
|
|
6
|
-
export {
|
|
34
|
+
export { u as useResumableBankAccountApplication };
|
|
@@ -32,13 +32,13 @@ import { buildOnboardingPrefill as y } from "./index18.js";
|
|
|
32
32
|
import { OnboardingAnalyticsEvent as se, WIDGET_NAME as ce } from "./index19.js";
|
|
33
33
|
import { DEFAULT_LABELS as b } from "./index20.js";
|
|
34
34
|
import { withoutResumeOnlyOwnerFields as le, withoutStoredIdentifierMarkers as ue } from "./index21.js";
|
|
35
|
-
import { ApplicationClientSecretProvider as de, useApplicationClientSecret as fe } from "../../data-access/dist/
|
|
35
|
+
import { ApplicationClientSecretProvider as de, useApplicationClientSecret as fe } from "../../data-access/dist/index3.js";
|
|
36
36
|
import { useCreateApplication as pe } from "../../data-access/dist/index4.js";
|
|
37
|
-
import { useUpdateApplication as me } from "../../data-access/dist/
|
|
38
|
-
import { useSubmitApplication as he } from "../../data-access/dist/
|
|
39
|
-
import { usePollApplicationCompletion as ge } from "../../data-access/dist/
|
|
40
|
-
import { useResumableBankAccountApplication as x } from "../../data-access/dist/
|
|
41
|
-
import { useStartedBankAccountApplication as _e } from "../../data-access/dist/
|
|
37
|
+
import { useUpdateApplication as me } from "../../data-access/dist/index5.js";
|
|
38
|
+
import { useSubmitApplication as he } from "../../data-access/dist/index6.js";
|
|
39
|
+
import { usePollApplicationCompletion as ge } from "../../data-access/dist/index7.js";
|
|
40
|
+
import { useResumableBankAccountApplication as x } from "../../data-access/dist/index9.js";
|
|
41
|
+
import { useStartedBankAccountApplication as _e } from "../../data-access/dist/index10.js";
|
|
42
42
|
import "../../data-access/dist/index.js";
|
|
43
43
|
import { useCallback as ve, useEffect as S, useMemo as C, useRef as ye, useState as w } from "react";
|
|
44
44
|
import { Fragment as be, jsx as T, jsxs as xe } from "react/jsx-runtime";
|
|
@@ -209,7 +209,7 @@ function Ee({ onEmbeddedOnboardingCompletedSuccessfully: u, onNavigateToDashboar
|
|
|
209
209
|
});
|
|
210
210
|
else {
|
|
211
211
|
let t = dt.current, n = await Xe.mutateAsync({ body: oe(H) });
|
|
212
|
-
e = n.id, We(e), Ke(t), n.clientSecret && $e(n.clientSecret);
|
|
212
|
+
e = n.id, We(e), Ke(t), n.clientSecret && $e(e, n.clientSecret);
|
|
213
213
|
}
|
|
214
214
|
vt(), ft && xt(), z(1);
|
|
215
215
|
} else if (R === 1) {
|
|
@@ -378,51 +378,47 @@ function k(e) {
|
|
|
378
378
|
}
|
|
379
379
|
var A = { canRender: !1 };
|
|
380
380
|
function j(e) {
|
|
381
|
-
let {
|
|
382
|
-
S(() => {
|
|
383
|
-
a && t(a);
|
|
384
|
-
}, [a, t]);
|
|
385
|
-
let [u, d] = w(null);
|
|
381
|
+
let { authEpoch: t } = r(), { applicationId: n, clientSecret: i, isResolved: a } = x(), { application: o, isResolved: s, isUnavailable: c } = _e(n, i), [l, u] = w(null);
|
|
386
382
|
if (S(() => {
|
|
387
|
-
if (!(
|
|
388
|
-
if (
|
|
389
|
-
|
|
383
|
+
if (!(l?.canRender === !0 || !a || !s)) {
|
|
384
|
+
if (c) {
|
|
385
|
+
u(A);
|
|
390
386
|
return;
|
|
391
387
|
}
|
|
392
|
-
if (
|
|
393
|
-
|
|
388
|
+
if (o !== null && o.status !== void 0 && o.status !== E) {
|
|
389
|
+
u(A);
|
|
394
390
|
return;
|
|
395
391
|
}
|
|
396
|
-
|
|
392
|
+
u({
|
|
397
393
|
canRender: !0,
|
|
398
|
-
applicationId:
|
|
399
|
-
authEpoch:
|
|
400
|
-
prefill: y(
|
|
394
|
+
applicationId: o === null ? null : n,
|
|
395
|
+
authEpoch: t,
|
|
396
|
+
prefill: y(o)
|
|
401
397
|
});
|
|
402
398
|
}
|
|
403
399
|
}, [
|
|
404
|
-
|
|
405
|
-
u,
|
|
406
|
-
o,
|
|
407
|
-
c,
|
|
400
|
+
t,
|
|
408
401
|
l,
|
|
402
|
+
a,
|
|
409
403
|
s,
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
404
|
+
c,
|
|
405
|
+
o,
|
|
406
|
+
n
|
|
407
|
+
]), l === null || !l.canRender) return null;
|
|
408
|
+
let { applicationId: d, authEpoch: f, prefill: p } = l;
|
|
413
409
|
return /* @__PURE__ */ T(Ee, {
|
|
414
410
|
...e,
|
|
415
|
-
initialApplicationId:
|
|
416
|
-
initialBoundAuthEpoch:
|
|
411
|
+
initialApplicationId: d,
|
|
412
|
+
initialBoundAuthEpoch: f,
|
|
417
413
|
initialBusinessDetails: {
|
|
418
414
|
...ue(e.initialBusinessDetails),
|
|
419
|
-
...
|
|
415
|
+
...p?.businessDetails
|
|
420
416
|
},
|
|
421
417
|
initialPersonalDetails: {
|
|
422
418
|
...ue(e.initialPersonalDetails),
|
|
423
|
-
...
|
|
419
|
+
...p?.personalDetails
|
|
424
420
|
},
|
|
425
|
-
initialAdditionalOwners:
|
|
421
|
+
initialAdditionalOwners: p?.additionalOwners ?? e.initialAdditionalOwners?.map(le)
|
|
426
422
|
});
|
|
427
423
|
}
|
|
428
424
|
//#endregion
|
|
@@ -46,28 +46,16 @@ function m({ isOpen: e, onClose: t, ...n }) {
|
|
|
46
46
|
...n
|
|
47
47
|
}) : null;
|
|
48
48
|
}
|
|
49
|
-
function h({
|
|
49
|
+
function h({ isOpen: e, preSelectedReceiptIds: t, onClose: r, targetTransactionId: i, onSingleTransactionUpdate: a, ...s }) {
|
|
50
50
|
return /* @__PURE__ */ d(n, {
|
|
51
|
+
...s,
|
|
51
52
|
widgetName: o,
|
|
52
|
-
baseUrl: e,
|
|
53
|
-
widgetToken: t,
|
|
54
|
-
organizationId: r,
|
|
55
|
-
configClient: i,
|
|
56
|
-
gatewayRouting: a,
|
|
57
|
-
linkComponent: s,
|
|
58
|
-
implementation: c,
|
|
59
|
-
uiFramework: l,
|
|
60
|
-
errorFallback: u,
|
|
61
|
-
onError: f,
|
|
62
|
-
analytics: p,
|
|
63
|
-
disclosuresAcceptance: h,
|
|
64
|
-
providerLabels: g,
|
|
65
53
|
children: /* @__PURE__ */ d(m, {
|
|
66
|
-
isOpen:
|
|
67
|
-
preSelectedReceiptIds:
|
|
68
|
-
onClose:
|
|
69
|
-
targetTransactionId:
|
|
70
|
-
onSingleTransactionUpdate:
|
|
54
|
+
isOpen: e,
|
|
55
|
+
preSelectedReceiptIds: t,
|
|
56
|
+
onClose: r,
|
|
57
|
+
targetTransactionId: i,
|
|
58
|
+
onSingleTransactionUpdate: a
|
|
71
59
|
})
|
|
72
60
|
});
|
|
73
61
|
}
|