@tesouro/embedded-components-react 0.5.250 → 0.5.252

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.
@@ -7,8 +7,8 @@ import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiC
7
7
  import "../../../shared/data-access/dist/index.js";
8
8
  import { useCallback as n } from "react";
9
9
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index9.js
10
- var r = 2e3, i = 16, a = "COMPLETE", o = "BANK_ACCOUNT";
11
- function s(e, t) {
10
+ var r = 2e3, i = 16, a = "COMPLETE", o = "BANK_ACCOUNT", s = /* @__PURE__ */ new Set(["MANUAL_REVIEW", "DOCUMENT_VERIFICATION_REQUIRED"]);
11
+ function c(e, t) {
12
12
  return new Promise((n, r) => {
13
13
  if (t?.aborted) {
14
14
  r(new DOMException("Aborted", "AbortError"));
@@ -22,25 +22,28 @@ function s(e, t) {
22
22
  t?.addEventListener("abort", i, { once: !0 });
23
23
  });
24
24
  }
25
- function c() {
26
- let { client: c } = t();
25
+ function l() {
26
+ let { client: l } = t();
27
27
  return n(async (t, n = {}) => {
28
- let { signal: l } = n, u = !1;
28
+ let { signal: u } = n, d = !1;
29
29
  for (let n = 0; n < i; n++) {
30
- if (l?.aborted) throw new DOMException("Aborted", "AbortError");
30
+ if (u?.aborted) throw new DOMException("Aborted", "AbortError");
31
31
  try {
32
32
  let n = await e({
33
- client: c,
34
- signal: l
33
+ client: l,
34
+ signal: u
35
35
  });
36
- if (u = !0, n.data?.applications.some((e) => e.product === o && e.applicationId === t && e.status === a)) return { status: "complete" };
36
+ d = !0;
37
+ let r = n.data?.applications.find((e) => e.product === o && e.applicationId === t);
38
+ if (r?.status === a) return { status: "complete" };
39
+ if (r?.kycVerificationStatus && s.has(r.kycVerificationStatus)) return { status: "underReview" };
37
40
  } catch (e) {
38
41
  if (e instanceof DOMException && e.name === "AbortError") throw e;
39
42
  }
40
- n < 15 && await s(r, l);
43
+ n < 15 && await c(r, u);
41
44
  }
42
- return u ? { status: "timeout" } : { status: "error" };
43
- }, [c]);
45
+ return d ? { status: "timeout" } : { status: "error" };
46
+ }, [l]);
44
47
  }
45
48
  //#endregion
46
- export { c as usePollApplicationCompletion };
49
+ export { l as usePollApplicationCompletion };
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.5.250", n = "e5dbdc4892f6a1c34cf2bd00af14a333eefd78b3", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.252", n = "b4b43df3d280492512e2ae984cc2b17fe839d9c3", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.250",
3
+ "version": "0.5.252",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {