@vpdev2/metakyc-sdk 1.0.1 → 1.0.3

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.js CHANGED
@@ -5,7 +5,7 @@ import Ze from "axios";
5
5
  import * as Pe from "react";
6
6
  import ce, { createContext as Je, useMemo as Oe, useEffect as V, useContext as Xe, useState as v, useRef as ze, useCallback as q, forwardRef as Re } from "react";
7
7
  import { jsx as n, jsxs as o, Fragment as et } from "react/jsx-runtime";
8
- import { get as Ae, set as Se, appendErrors as _e, useForm as De, Controller as Q } from "react-hook-form";
8
+ import { get as Ae, set as Se, appendErrors as $e, useForm as De, Controller as Q } from "react-hook-form";
9
9
  import { z as de } from "zod";
10
10
  var K = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(K || {}), ke = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(ke || {}), ae = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(ae || {}), tt = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(tt || {}), rt = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(rt || {}), pe = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(pe || {}), ge = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(ge || {}), nt = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(nt || {}), at = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(at || {}), ne = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(ne || {}), st = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(st || {}), Ne = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Ne || {}), it = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(ot || {}), lt = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(lt || {}), Ee = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(Ee || {}), ct = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(dt || {}), X = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(X || {}), ut = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(ut || {});
11
11
  const mt = [
@@ -1320,7 +1320,7 @@ class Bt {
1320
1320
  return this.stepRouter;
1321
1321
  }
1322
1322
  }
1323
- function je(t, e) {
1323
+ function _e(t, e) {
1324
1324
  return new Promise((r, a) => {
1325
1325
  if (e && document.getElementById(e)) {
1326
1326
  r();
@@ -1347,7 +1347,7 @@ class Ot {
1347
1347
  * Load Sumsub SDK
1348
1348
  */
1349
1349
  async loadSDK() {
1350
- await je(
1350
+ await _e(
1351
1351
  "https://cdn.sumsub.com/websdk/v2/production/websdk.js",
1352
1352
  "sumsub-sdk"
1353
1353
  );
@@ -1402,7 +1402,7 @@ class zt {
1402
1402
  * Load Onfido SDK
1403
1403
  */
1404
1404
  async loadSDK() {
1405
- await je(
1405
+ await _e(
1406
1406
  "https://sdk.onfido.com/v12.0.0/onfido.min.js",
1407
1407
  "onfido-sdk"
1408
1408
  );
@@ -1458,7 +1458,7 @@ class zt {
1458
1458
  this.sdk && (this.sdk.tearDown(), this.sdk = null);
1459
1459
  }
1460
1460
  }
1461
- class _t {
1461
+ class $t {
1462
1462
  constructor(e) {
1463
1463
  U(this, "sardineContext", null);
1464
1464
  U(this, "config");
@@ -1613,7 +1613,7 @@ class fe {
1613
1613
  case ne.Onfido:
1614
1614
  return new zt(r);
1615
1615
  case ne.SardinAI:
1616
- return new _t(r);
1616
+ return new $t(r);
1617
1617
  default:
1618
1618
  throw new Error(`Unsupported identity provider: ${e}`);
1619
1619
  }
@@ -1652,7 +1652,7 @@ class fe {
1652
1652
  }
1653
1653
  }
1654
1654
  }
1655
- class jt {
1655
+ class _t {
1656
1656
  constructor(e) {
1657
1657
  U(this, "currentTheme", ee);
1658
1658
  U(this, "customStyleElement", null);
@@ -1773,9 +1773,9 @@ class jt {
1773
1773
  return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1774
1774
  }
1775
1775
  }
1776
- const $e = Je(null), Lr = ({ config: t, children: e }) => {
1776
+ const je = Je(null), Lr = ({ config: t, children: e }) => {
1777
1777
  const r = Oe(() => {
1778
- const a = new yt(t), s = new ft(a), i = new bt(a), c = new xt(a), l = new vt(a), d = new wt(a), u = new kt(a), g = new Nt(a), p = new St(a), m = new Ct(a), b = new Ft(a), y = new jt();
1778
+ const a = new yt(t), s = new ft(a), i = new bt(a), c = new xt(a), l = new vt(a), d = new wt(a), u = new kt(a), g = new Nt(a), p = new St(a), m = new Ct(a), b = new Ft(a), y = new _t();
1779
1779
  return {
1780
1780
  config: t,
1781
1781
  httpClient: a,
@@ -1816,15 +1816,15 @@ const $e = Je(null), Lr = ({ config: t, children: e }) => {
1816
1816
  }
1817
1817
  })(), () => {
1818
1818
  r.themeManager.cleanup();
1819
- }), [t.theme, r.themeService, r.themeManager]), /* @__PURE__ */ n($e.Provider, { value: r, children: e });
1819
+ }), [t.theme, r.themeService, r.themeManager]), /* @__PURE__ */ n(je.Provider, { value: r, children: e });
1820
1820
  };
1821
1821
  function ie() {
1822
- const t = Xe($e);
1822
+ const t = Xe(je);
1823
1823
  if (!t)
1824
1824
  throw new Error("useMetaKYC must be used within a MetaKYCProvider");
1825
1825
  return t;
1826
1826
  }
1827
- async function $t(t) {
1827
+ async function jt(t) {
1828
1828
  return new Promise((e, r) => {
1829
1829
  const a = new FileReader();
1830
1830
  a.readAsDataURL(t), a.onload = () => {
@@ -2088,7 +2088,7 @@ function Qt(t) {
2088
2088
  submit: b
2089
2089
  };
2090
2090
  }
2091
- function _r(t) {
2091
+ function $r(t) {
2092
2092
  const { appropriatenessTestService: e } = ie(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(null), [g, p] = v(null), m = q(async () => {
2093
2093
  if (t) {
2094
2094
  i(!0), u(null);
@@ -2356,7 +2356,7 @@ function Xt() {
2356
2356
  stopProgress: g
2357
2357
  };
2358
2358
  }
2359
- const j = ({
2359
+ const _ = ({
2360
2360
  children: t,
2361
2361
  variant: e = "primary",
2362
2362
  size: r = "md",
@@ -2868,7 +2868,7 @@ function ur(t, e) {
2868
2868
  });
2869
2869
  }), e) {
2870
2870
  var d = r[c].types, u = d && d[a.code];
2871
- r[c] = _e(c, e, r, s, u ? [].concat(u, a.message) : a.message);
2871
+ r[c] = $e(c, e, r, s, u ? [].concat(u, a.message) : a.message);
2872
2872
  }
2873
2873
  t.shift();
2874
2874
  }
@@ -2887,7 +2887,7 @@ function mr(t, e) {
2887
2887
  });
2888
2888
  }), e) {
2889
2889
  var d = r[c].types, u = d && d[a.code];
2890
- r[c] = _e(c, e, r, s, u ? [].concat(u, a.message) : a.message);
2890
+ r[c] = $e(c, e, r, s, u ? [].concat(u, a.message) : a.message);
2891
2891
  }
2892
2892
  t.shift();
2893
2893
  }
@@ -2959,7 +2959,7 @@ function pr(t) {
2959
2959
  }
2960
2960
  return e;
2961
2961
  }
2962
- function jr(t) {
2962
+ function _r(t) {
2963
2963
  const e = {};
2964
2964
  return t.uploadDocumentFiles.forEach((r) => {
2965
2965
  const a = `file_${r.id}`;
@@ -2972,7 +2972,7 @@ function gr(t) {
2972
2972
  function yr(t) {
2973
2973
  return de.string().min(1, "This question is required");
2974
2974
  }
2975
- function $r(t) {
2975
+ function jr(t) {
2976
2976
  const e = {};
2977
2977
  return t.appropriatenessQuestions.forEach((r) => {
2978
2978
  const a = `question_${r.id}`;
@@ -3118,9 +3118,9 @@ const Ur = de.any(), fr = ({
3118
3118
  })
3119
3119
  ) }),
3120
3120
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3121
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3121
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3122
3122
  /* @__PURE__ */ n(
3123
- j,
3123
+ _,
3124
3124
  {
3125
3125
  type: "submit",
3126
3126
  isLoading: i,
@@ -3148,7 +3148,7 @@ const Ur = de.any(), fr = ({
3148
3148
  const x = d[y.id] || [], R = await Promise.all(
3149
3149
  x.map(async (h) => ({
3150
3150
  fileName: h.name,
3151
- fileData: await $t(h)
3151
+ fileData: await jt(h)
3152
3152
  }))
3153
3153
  );
3154
3154
  return {
@@ -3186,8 +3186,8 @@ const Ur = de.any(), fr = ({
3186
3186
  p.id
3187
3187
  )) }),
3188
3188
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3189
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3190
- /* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
3189
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3190
+ /* @__PURE__ */ n(_, { type: "submit", isLoading: i, children: "Continue" })
3191
3191
  ] })
3192
3192
  ] }) }) : null;
3193
3193
  }, xr = ({ applicantId: t, onComplete: e, onBack: r }) => {
@@ -3223,8 +3223,8 @@ const Ur = de.any(), fr = ({
3223
3223
  ] }) })
3224
3224
  ] }),
3225
3225
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3226
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3227
- /* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Confirm and Continue" })
3226
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3227
+ /* @__PURE__ */ n(_, { onClick: d, isLoading: i, children: "Confirm and Continue" })
3228
3228
  ] })
3229
3229
  ] }) : null;
3230
3230
  }, vr = ({
@@ -3391,9 +3391,9 @@ const Ur = de.any(), fr = ({
3391
3391
  ] }, h.id);
3392
3392
  }) }),
3393
3393
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3394
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3394
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3395
3395
  /* @__PURE__ */ n(
3396
- j,
3396
+ _,
3397
3397
  {
3398
3398
  type: "submit",
3399
3399
  isLoading: i,
@@ -3535,9 +3535,9 @@ const Ur = de.any(), fr = ({
3535
3535
  ] }) })
3536
3536
  ] }),
3537
3537
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3538
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3538
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3539
3539
  /* @__PURE__ */ n(
3540
- j,
3540
+ _,
3541
3541
  {
3542
3542
  type: "submit",
3543
3543
  isLoading: c,
@@ -3572,8 +3572,8 @@ const Ur = de.any(), fr = ({
3572
3572
  const M = (C) => {
3573
3573
  const k = C.split(":").map(Number);
3574
3574
  if (k.length === 3) {
3575
- const [S, $, oe] = k;
3576
- return S * 3600 + $ * 60 + oe;
3575
+ const [S, j, oe] = k;
3576
+ return S * 3600 + j * 60 + oe;
3577
3577
  }
3578
3578
  return 0;
3579
3579
  }, I = (C) => {
@@ -3614,9 +3614,9 @@ const Ur = de.any(), fr = ({
3614
3614
  u(!0), p(null);
3615
3615
  try {
3616
3616
  const k = s.appropriatenessQuestions.map(
3617
- ($) => ({
3618
- appropriatenessQuestionId: $.id,
3619
- value: m[$.id] || ""
3617
+ (j) => ({
3618
+ appropriatenessQuestionId: j.id,
3619
+ value: m[j.id] || ""
3620
3620
  // Empty string if not answered
3621
3621
  })
3622
3622
  ), S = {
@@ -3626,14 +3626,14 @@ const Ur = de.any(), fr = ({
3626
3626
  };
3627
3627
  console.log("Submitting appropriateness test:", S);
3628
3628
  try {
3629
- const $ = await a.fillAppropriatenessTest(S);
3630
- console.log("Appropriateness test result:", $), $.message && ($.message.toLowerCase().includes("pass") || $.message.toLowerCase().includes("success") || $.message.toLowerCase().includes("congratulations")) ? e == null || e() : (p($.message || "Test completed. Please check the result."), h(!1), w(!1), b({}), setTimeout(() => f(), 1e3));
3631
- } catch ($) {
3632
- if ($.code === 400 && $.message) {
3633
- const oe = $.message;
3629
+ const j = await a.fillAppropriatenessTest(S);
3630
+ console.log("Appropriateness test result:", j), j.message && (j.message.toLowerCase().includes("pass") || j.message.toLowerCase().includes("success") || j.message.toLowerCase().includes("congratulations")) ? e == null || e() : (p(j.message || "Test completed. Please check the result."), h(!1), w(!1), b({}), setTimeout(() => f(), 1e3));
3631
+ } catch (j) {
3632
+ if (j.code === 400 && j.message) {
3633
+ const oe = j.message;
3634
3634
  console.log("Test failed:", oe), p(oe), h(!1), w(!1), b({}), setTimeout(() => f(), 1500);
3635
3635
  } else
3636
- throw $;
3636
+ throw j;
3637
3637
  }
3638
3638
  } catch (k) {
3639
3639
  console.error("Error submitting appropriateness test:", k), p(k.message || "Failed to submit test. Please try again."), h(!1), w(!1), b({});
@@ -3724,7 +3724,7 @@ Failed to reload test data. Please refresh the page.`);
3724
3724
  C.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: C.groupName }),
3725
3725
  /* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: C.question })
3726
3726
  ] }),
3727
- /* @__PURE__ */ n("div", { className: "space-y-2", children: C.answers.map((S, $) => /* @__PURE__ */ o(
3727
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: C.answers.map((S, j) => /* @__PURE__ */ o(
3728
3728
  "label",
3729
3729
  {
3730
3730
  className: `
@@ -3747,7 +3747,7 @@ Failed to reload test data. Please refresh the page.`);
3747
3747
  /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: S })
3748
3748
  ]
3749
3749
  },
3750
- $
3750
+ j
3751
3751
  )) })
3752
3752
  ]
3753
3753
  },
@@ -3765,7 +3765,7 @@ Failed to reload test data. Please refresh the page.`);
3765
3765
  ] }),
3766
3766
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3767
3767
  /* @__PURE__ */ n(
3768
- j,
3768
+ _,
3769
3769
  {
3770
3770
  type: "button",
3771
3771
  variant: "outline",
@@ -3775,7 +3775,7 @@ Failed to reload test data. Please refresh the page.`);
3775
3775
  }
3776
3776
  ),
3777
3777
  /* @__PURE__ */ n(
3778
- j,
3778
+ _,
3779
3779
  {
3780
3780
  type: "submit",
3781
3781
  isLoading: d,
@@ -3817,9 +3817,9 @@ Failed to reload test data. Please refresh the page.`);
3817
3817
  D <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
3818
3818
  ] }),
3819
3819
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3820
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3820
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3821
3821
  /* @__PURE__ */ n(
3822
- j,
3822
+ _,
3823
3823
  {
3824
3824
  type: "button",
3825
3825
  onClick: A,
@@ -3834,7 +3834,7 @@ Failed to reload test data. Please refresh the page.`);
3834
3834
  onComplete: e,
3835
3835
  onBack: r
3836
3836
  }) => {
3837
- var k, S, $, oe;
3837
+ var k, S, j, oe;
3838
3838
  const { applicantService: a, baseInformationService: s, config: i } = ie(), { identityData: c, provider: l, token: d, isLoading: u, error: g, requestIdentity: p, restartIdentity: m } = Zt(t), [b, y] = v(null), [x, R] = v(null), [h, N] = v([]), [w, E] = v(!0), [F, M] = v(!1), [I, A] = v(null), [B, z] = v(!1), f = De({
3839
3839
  defaultValues: {
3840
3840
  street: "",
@@ -3859,15 +3859,15 @@ Failed to reload test data. Please refresh the page.`);
3859
3859
  return !he || H.has(he) ? !1 : (H.add(he), !0);
3860
3860
  });
3861
3861
  N(re);
3862
- const _ = P.applicantRequestData;
3862
+ const $ = P.applicantRequestData;
3863
3863
  if (f.reset({
3864
- street: (_ == null ? void 0 : _.street) || "",
3865
- streetNumber: (_ == null ? void 0 : _.streetNumber) || "",
3866
- city: (_ == null ? void 0 : _.city) || "",
3867
- zip: (_ == null ? void 0 : _.zip) || "",
3868
- country: (_ == null ? void 0 : _.country) || "",
3869
- nationality: (_ == null ? void 0 : _.nationality) || "",
3870
- phonenumber: (_ == null ? void 0 : _.phonenumber) || ""
3864
+ street: ($ == null ? void 0 : $.street) || "",
3865
+ streetNumber: ($ == null ? void 0 : $.streetNumber) || "",
3866
+ city: ($ == null ? void 0 : $.city) || "",
3867
+ zip: ($ == null ? void 0 : $.zip) || "",
3868
+ country: ($ == null ? void 0 : $.country) || "",
3869
+ nationality: ($ == null ? void 0 : $.nationality) || "",
3870
+ phonenumber: ($ == null ? void 0 : $.phonenumber) || ""
3871
3871
  }), !c && !u) {
3872
3872
  console.log("[Identity] Auto-requesting identity verification for IdentityPending status");
3873
3873
  try {
@@ -3940,9 +3940,9 @@ Failed to reload test data. Please refresh the page.`);
3940
3940
  e == null || e();
3941
3941
  }, 2e3);
3942
3942
  }).catch((H) => {
3943
- var _;
3943
+ var $;
3944
3944
  console.error("[SardinAI] Failed to initialize:", H);
3945
- const re = ((_ = H.message) == null ? void 0 : _.toLowerCase()) || "";
3945
+ const re = (($ = H.message) == null ? void 0 : $.toLowerCase()) || "";
3946
3946
  re.includes("expired") || re.includes("invalid") || re.includes("401") || re.includes("400") ? (z(!0), A("Session expired or invalid. Please restart verification.")) : A(`Failed to initialize: ${H.message}`);
3947
3947
  });
3948
3948
  } catch (P) {
@@ -4035,8 +4035,8 @@ Failed to reload test data. Please refresh the page.`);
4035
4035
  ] })
4036
4036
  ] }),
4037
4037
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4038
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4039
- /* @__PURE__ */ n(j, { type: "button", onClick: C, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4038
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4039
+ /* @__PURE__ */ n(_, { type: "button", onClick: C, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4040
4040
  ] })
4041
4041
  ] });
4042
4042
  if (F && c) {
@@ -4048,7 +4048,7 @@ Failed to reload test data. Please refresh the page.`);
4048
4048
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4049
4049
  ] }),
4050
4050
  /* @__PURE__ */ n(
4051
- j,
4051
+ _,
4052
4052
  {
4053
4053
  type: "button",
4054
4054
  variant: "outline",
@@ -4075,7 +4075,7 @@ Failed to reload test data. Please refresh the page.`);
4075
4075
  var W, H, re;
4076
4076
  console.log("[Identity] Iframe loaded");
4077
4077
  try {
4078
- const _ = P.target, me = _.contentDocument || ((W = _.contentWindow) == null ? void 0 : W.document);
4078
+ const $ = P.target, me = $.contentDocument || ((W = $.contentWindow) == null ? void 0 : W.document);
4079
4079
  if (me) {
4080
4080
  const he = ((re = (H = me.body) == null ? void 0 : H.textContent) == null ? void 0 : re.toLowerCase()) || "";
4081
4081
  (he.includes("expired") || he.includes("invalid") || he.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), z(!0), A("Your verification link has expired."));
@@ -4087,7 +4087,7 @@ Failed to reload test data. Please refresh the page.`);
4087
4087
  }
4088
4088
  ) })
4089
4089
  ] }),
4090
- r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4090
+ r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
4091
4091
  ] }) : O === ne.SardinAI ? /* @__PURE__ */ o(L, { children: [
4092
4092
  /* @__PURE__ */ o(Z, { children: [
4093
4093
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
@@ -4104,7 +4104,7 @@ Failed to reload test data. Please refresh the page.`);
4104
4104
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4105
4105
  ] }),
4106
4106
  /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4107
- r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4107
+ r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
4108
4108
  ] });
4109
4109
  }
4110
4110
  return /* @__PURE__ */ n("form", { onSubmit: f.handleSubmit(D), children: /* @__PURE__ */ o(L, { children: [
@@ -4124,7 +4124,7 @@ Failed to reload test data. Please refresh the page.`);
4124
4124
  ] }),
4125
4125
  /* @__PURE__ */ o("div", { children: [
4126
4126
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
4127
- /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ($ = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : $.email })
4127
+ /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (j = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : j.email })
4128
4128
  ] }),
4129
4129
  /* @__PURE__ */ o("div", { children: [
4130
4130
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
@@ -4224,8 +4224,8 @@ Failed to reload test data. Please refresh the page.`);
4224
4224
  ] })
4225
4225
  ] }),
4226
4226
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4227
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4228
- /* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4227
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4228
+ /* @__PURE__ */ n(_, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4229
4229
  ] })
4230
4230
  ] }) });
4231
4231
  }, Be = ({
@@ -4362,10 +4362,10 @@ Failed to reload test data. Please refresh the page.`);
4362
4362
  ] }) })
4363
4363
  ] }),
4364
4364
  /* @__PURE__ */ o(te, { className: "flex justify-center gap-4", children: [
4365
- l.type === "success" && s && /* @__PURE__ */ n(j, { onClick: s, size: "lg", children: "Continue" }),
4365
+ l.type === "success" && s && /* @__PURE__ */ n(_, { onClick: s, size: "lg", children: "Continue" }),
4366
4366
  l.type === "error" && /* @__PURE__ */ o(et, { children: [
4367
- i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
4368
- s && /* @__PURE__ */ n(j, { onClick: s, children: "Try Again" })
4367
+ i && /* @__PURE__ */ n(_, { variant: "outline", onClick: i, children: "Contact Support" }),
4368
+ s && /* @__PURE__ */ n(_, { onClick: s, children: "Try Again" })
4369
4369
  ] }),
4370
4370
  l.type === "pending" && /* @__PURE__ */ n("div", { className: "text-center", children: /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
4371
4371
  ] })
@@ -4509,8 +4509,8 @@ Failed to reload test data. Please refresh the page.`);
4509
4509
  label: D.label,
4510
4510
  value: ((k = w[f]) == null ? void 0 : k.join(", ")) || "",
4511
4511
  onChange: (S) => {
4512
- const $ = S.target.value.split(",").map((oe) => oe.trim()).filter(Boolean);
4513
- F(f, $);
4512
+ const j = S.target.value.split(",").map((oe) => oe.trim()).filter(Boolean);
4513
+ F(f, j);
4514
4514
  },
4515
4515
  placeholder: "Enter countries separated by commas"
4516
4516
  },
@@ -4566,10 +4566,10 @@ Failed to reload test data. Please refresh the page.`);
4566
4566
  );
4567
4567
  }
4568
4568
  };
4569
- return g ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4569
+ return g ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4570
4570
  /* @__PURE__ */ n(se, { className: "my-8" }),
4571
4571
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
4572
- ] }) }) : /* @__PURE__ */ n("form", { onSubmit: M, children: /* @__PURE__ */ o(L, { children: [
4572
+ ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: M, children: /* @__PURE__ */ o(L, { children: [
4573
4573
  /* @__PURE__ */ o(Z, { children: [
4574
4574
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Create Applicant" }),
4575
4575
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: "Please fill in the required information to begin the KYC verification process." })
@@ -4583,10 +4583,10 @@ Failed to reload test data. Please refresh the page.`);
4583
4583
  /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: N.map((f) => I(f)) })
4584
4584
  ] }),
4585
4585
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4586
- a && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: a, disabled: m || l, children: "Cancel" }),
4587
- /* @__PURE__ */ n(j, { type: "submit", isLoading: m || l, children: "Create Applicant" })
4586
+ a && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: a, disabled: m || l, children: "Cancel" }),
4587
+ /* @__PURE__ */ n(_, { type: "submit", isLoading: m || l, children: "Create Applicant" })
4588
4588
  ] })
4589
- ] }) });
4589
+ ] }) }) });
4590
4590
  }, Hr = ({
4591
4591
  applicantId: t,
4592
4592
  onComplete: e,
@@ -4625,7 +4625,7 @@ Failed to reload test data. Please refresh the page.`);
4625
4625
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: m.message })
4626
4626
  ] }) }) }) });
4627
4627
  if (g && !x)
4628
- return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4628
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4629
4629
  /* @__PURE__ */ n("div", { className: "mb-6", children: /* @__PURE__ */ n("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ n("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
4630
4630
  /* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
4631
4631
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
@@ -4653,7 +4653,7 @@ Failed to reload test data. Please refresh the page.`);
4653
4653
  )
4654
4654
  ] }) }) }) });
4655
4655
  if (i.status === ae.Finished || i.status === ae.OnHold)
4656
- return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(
4656
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(
4657
4657
  Be,
4658
4658
  {
4659
4659
  kycStatus: i.kycStatus,
@@ -4667,7 +4667,7 @@ Failed to reload test data. Please refresh the page.`);
4667
4667
  }
4668
4668
  ) });
4669
4669
  if (!c)
4670
- return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4670
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4671
4671
  /* @__PURE__ */ n(se, { className: "my-8" }),
4672
4672
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === ae.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
4673
4673
  ] }) }) });
@@ -4762,7 +4762,7 @@ Failed to reload test data. Please refresh the page.`);
4762
4762
  ] }) });
4763
4763
  }
4764
4764
  };
4765
- return /* @__PURE__ */ o("div", { className: s, children: [
4765
+ return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
4766
4766
  h(),
4767
4767
  N()
4768
4768
  ] });
@@ -4778,7 +4778,7 @@ export {
4778
4778
  kr as AppropriatenessTestStep,
4779
4779
  ue as Badge,
4780
4780
  St as BaseInformationService,
4781
- j as Button,
4781
+ _ as Button,
4782
4782
  L as Card,
4783
4783
  T as CardContent,
4784
4784
  te as CardFooter,
@@ -4809,7 +4809,7 @@ export {
4809
4809
  Be as KycStatusDisplay,
4810
4810
  Hr as KycWorkflow,
4811
4811
  Kr as Logo,
4812
- $e as MetaKYCContext,
4812
+ je as MetaKYCContext,
4813
4813
  le as MetaKYCError,
4814
4814
  Lr as MetaKYCProvider,
4815
4815
  zt as OnfidoProvider,
@@ -4823,12 +4823,12 @@ export {
4823
4823
  rt as RiskLevel,
4824
4824
  kt as RiskScoringService,
4825
4825
  vr as RiskScoringStep,
4826
- _t as SardinAIProvider,
4826
+ $t as SardinAIProvider,
4827
4827
  ye as Select,
4828
4828
  se as Spinner,
4829
4829
  Mt as StepRouter,
4830
4830
  Ot as SumsubProvider,
4831
- jt as ThemeManager,
4831
+ _t as ThemeManager,
4832
4832
  Y as ThemePreset,
4833
4833
  Ft as ThemeService,
4834
4834
  xt as UploadDocumentService,
@@ -4847,20 +4847,20 @@ export {
4847
4847
  At as corporateTheme,
4848
4848
  pt as defaultConfig,
4849
4849
  ee as defaultTheme,
4850
- $t as fileToBase64,
4850
+ jt as fileToBase64,
4851
4851
  Et as fintechTheme,
4852
4852
  Ce as formatFileSize,
4853
- $r as generateAppropriatenessSchema,
4853
+ jr as generateAppropriatenessSchema,
4854
4854
  hr as generateQuestionnaireSchema,
4855
4855
  gr as generateRiskScoringSchema,
4856
- jr as generateUploadDocumentSchema,
4856
+ _r as generateUploadDocumentSchema,
4857
4857
  Br as getAcceptString,
4858
4858
  Kt as getApplicantId,
4859
4859
  ve as getThemePreset,
4860
4860
  Or as getWorkflowState,
4861
4861
  It as healthcareTheme,
4862
4862
  Pr as isScriptLoaded,
4863
- je as loadScript,
4863
+ _e as loadScript,
4864
4864
  Dt as minimalTheme,
4865
4865
  Rt as modernTheme,
4866
4866
  Fr as removeScript,
@@ -4868,7 +4868,7 @@ export {
4868
4868
  Ht as saveWorkflowState,
4869
4869
  Pt as themePresets,
4870
4870
  Xt as useApplicant,
4871
- _r as useAppropriatenessTest,
4871
+ $r as useAppropriatenessTest,
4872
4872
  Zt as useIdentityVerification,
4873
4873
  Yt as useKycWorkflow,
4874
4874
  ie as useMetaKYC,