@vpdev2/metakyc-sdk 1.0.86 → 1.0.88
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/components/KycWorkflow.d.ts.map +1 -1
- package/dist/components/core/Badge.d.ts.map +1 -1
- package/dist/components/core/Button.d.ts.map +1 -1
- package/dist/components/steps/InvestorCategorizationStep.d.ts.map +1 -1
- package/dist/components/steps/OverviewStep.d.ts.map +1 -1
- package/dist/index.cjs +14 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +663 -603
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,12 +3,12 @@ var Tt = (e, t, n) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var de = (e, t, n) => Tt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import Lt from "axios";
|
|
5
5
|
import * as ft from "react";
|
|
6
|
-
import Ie, { createContext as Dt, useState as x, useMemo as
|
|
6
|
+
import Ie, { createContext as Dt, useState as x, useMemo as $e, useEffect as me, useContext as Mt, useRef as ne, useCallback as V, forwardRef as nt, createElement as mt } from "react";
|
|
7
7
|
import { jsx as r, jsxs as s, Fragment as rt } from "react/jsx-runtime";
|
|
8
8
|
import Ot, { createPortal as ht } from "react-dom";
|
|
9
9
|
import { useForm as Bt, Controller as Ke } from "react-hook-form";
|
|
10
10
|
import { z as Oe } from "zod";
|
|
11
|
-
var te = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(te || {}), lt = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(lt || {}), Fe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(Fe || {}),
|
|
11
|
+
var te = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(te || {}), lt = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(lt || {}), Fe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(Fe || {}), zt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(zt || {}), $t = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))($t || {}), We = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(We || {}), Ye = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(Ye || {}), _t = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(_t || {}), Ht = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Ht || {}), Pe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Pe || {}), Ut = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Ut || {}), ct = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(ct || {}), jt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(jt || {}), Kt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Kt || {}), Wt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Wt || {}), Me = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Money = 2] = "Money", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Me || {}), Yt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(Yt || {}), Vt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Vt || {}), be = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(be || {}), qt = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(qt || {});
|
|
12
12
|
const qe = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
@@ -63,7 +63,7 @@ const qe = {
|
|
|
63
63
|
{ value: "FI", label: "Finnish" },
|
|
64
64
|
{ value: "NO", label: "Norwegian" }
|
|
65
65
|
];
|
|
66
|
-
var
|
|
66
|
+
var xe = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(xe || {});
|
|
67
67
|
const Gt = {
|
|
68
68
|
timeout: 3e4,
|
|
69
69
|
retries: 3,
|
|
@@ -638,7 +638,7 @@ class or {
|
|
|
638
638
|
)).result;
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
const
|
|
641
|
+
const Se = {
|
|
642
642
|
name: "Default",
|
|
643
643
|
title: "KYC Verification",
|
|
644
644
|
logo: {
|
|
@@ -872,15 +872,15 @@ const Ne = {
|
|
|
872
872
|
inputHeight: "2.25rem"
|
|
873
873
|
}
|
|
874
874
|
}, pr = {
|
|
875
|
-
[
|
|
876
|
-
[
|
|
877
|
-
[
|
|
878
|
-
[
|
|
879
|
-
[
|
|
880
|
-
[
|
|
875
|
+
[xe.Default]: Se,
|
|
876
|
+
[xe.Corporate]: lr,
|
|
877
|
+
[xe.Fintech]: cr,
|
|
878
|
+
[xe.Healthcare]: dr,
|
|
879
|
+
[xe.Modern]: ur,
|
|
880
|
+
[xe.Minimal]: mr
|
|
881
881
|
};
|
|
882
882
|
function et(e) {
|
|
883
|
-
return pr[e] ||
|
|
883
|
+
return pr[e] || Se;
|
|
884
884
|
}
|
|
885
885
|
class hr {
|
|
886
886
|
constructor(t) {
|
|
@@ -897,8 +897,8 @@ class hr {
|
|
|
897
897
|
"GetThemeConfiguration"
|
|
898
898
|
);
|
|
899
899
|
if (!n.result.isEnabled)
|
|
900
|
-
return et(
|
|
901
|
-
let a = n.result.preset ? et(n.result.preset) : et(
|
|
900
|
+
return et(xe.Default);
|
|
901
|
+
let a = n.result.preset ? et(n.result.preset) : et(xe.Default);
|
|
902
902
|
if (n.result.title && (a.title = n.result.title), n.result.logo && (a.logo = { ...a.logo, ...n.result.logo }), n.result.colors && (a.colors = { ...a.colors, ...n.result.colors }), n.result.typography && (a.typography = { ...a.typography, ...n.result.typography }), n.result.spacing && (a.spacing = { ...a.spacing, ...n.result.spacing }), n.result.customCSS && (a.customCSS = n.result.customCSS), n.result.darkMode && (a.darkMode = {
|
|
903
903
|
colors: {
|
|
904
904
|
...(t = a.darkMode) == null ? void 0 : t.colors,
|
|
@@ -927,7 +927,7 @@ class hr {
|
|
|
927
927
|
}
|
|
928
928
|
return n.result.reviewPageDisabled && (a.reviewPageDisabled = !0), n.result.fieldLabelMode === "placeholder" && (a.fieldLabelMode = "placeholder"), a;
|
|
929
929
|
} catch (n) {
|
|
930
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", n), et(
|
|
930
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", n), et(xe.Default);
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
933
|
/**
|
|
@@ -941,12 +941,12 @@ class hr {
|
|
|
941
941
|
*/
|
|
942
942
|
getAvailablePresets() {
|
|
943
943
|
return [
|
|
944
|
-
{ id:
|
|
945
|
-
{ id:
|
|
946
|
-
{ id:
|
|
947
|
-
{ id:
|
|
948
|
-
{ id:
|
|
949
|
-
{ id:
|
|
944
|
+
{ id: xe.Default, name: "Default" },
|
|
945
|
+
{ id: xe.Corporate, name: "Corporate" },
|
|
946
|
+
{ id: xe.Fintech, name: "Fintech" },
|
|
947
|
+
{ id: xe.Healthcare, name: "Healthcare" },
|
|
948
|
+
{ id: xe.Modern, name: "Modern" },
|
|
949
|
+
{ id: xe.Minimal, name: "Minimal" }
|
|
950
950
|
];
|
|
951
951
|
}
|
|
952
952
|
/**
|
|
@@ -1344,10 +1344,10 @@ function St(e, t) {
|
|
|
1344
1344
|
i.src = e, t && (i.id = t), i.async = !0, i.onload = () => n(), i.onerror = () => a(new Error(`Failed to load script: ${e}`)), document.head.appendChild(i);
|
|
1345
1345
|
});
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function Nn(e) {
|
|
1348
1348
|
return !!document.getElementById(e);
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1350
|
+
function Sn(e) {
|
|
1351
1351
|
const t = document.getElementById(e);
|
|
1352
1352
|
t && t.remove();
|
|
1353
1353
|
}
|
|
@@ -1702,7 +1702,7 @@ function wr() {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
class Nr {
|
|
1704
1704
|
constructor(t) {
|
|
1705
|
-
de(this, "currentTheme",
|
|
1705
|
+
de(this, "currentTheme", Se);
|
|
1706
1706
|
de(this, "customStyleElement", null);
|
|
1707
1707
|
de(this, "inputStyleElement", null);
|
|
1708
1708
|
de(this, "container");
|
|
@@ -1797,19 +1797,19 @@ class Nr {
|
|
|
1797
1797
|
mergeWithDefault(t) {
|
|
1798
1798
|
var n;
|
|
1799
1799
|
return {
|
|
1800
|
-
name: t.name ||
|
|
1801
|
-
title: t.title ||
|
|
1802
|
-
logo: { ...
|
|
1803
|
-
colors: { ...
|
|
1804
|
-
typography: t.typography ? { ...
|
|
1805
|
-
spacing: t.spacing ? { ...
|
|
1800
|
+
name: t.name || Se.name,
|
|
1801
|
+
title: t.title || Se.title,
|
|
1802
|
+
logo: { ...Se.logo, ...t.logo },
|
|
1803
|
+
colors: { ...Se.colors, ...t.colors },
|
|
1804
|
+
typography: t.typography ? { ...Se.typography, ...t.typography } : Se.typography,
|
|
1805
|
+
spacing: t.spacing ? { ...Se.spacing, ...t.spacing } : Se.spacing,
|
|
1806
1806
|
customCSS: t.customCSS,
|
|
1807
1807
|
darkMode: t.darkMode ? {
|
|
1808
1808
|
colors: {
|
|
1809
|
-
...(n =
|
|
1809
|
+
...(n = Se.darkMode) == null ? void 0 : n.colors,
|
|
1810
1810
|
...t.darkMode.colors
|
|
1811
1811
|
}
|
|
1812
|
-
} :
|
|
1812
|
+
} : Se.darkMode,
|
|
1813
1813
|
applicantFormVisibleFields: t.applicantFormVisibleFields,
|
|
1814
1814
|
applicantFormRequiredFields: t.applicantFormRequiredFields,
|
|
1815
1815
|
allowedLanguages: t.allowedLanguages,
|
|
@@ -1828,7 +1828,7 @@ class Nr {
|
|
|
1828
1828
|
* Reset to default theme
|
|
1829
1829
|
*/
|
|
1830
1830
|
resetTheme() {
|
|
1831
|
-
this.applyTheme(
|
|
1831
|
+
this.applyTheme(Se);
|
|
1832
1832
|
}
|
|
1833
1833
|
/**
|
|
1834
1834
|
* Remove all custom styles
|
|
@@ -1843,8 +1843,8 @@ class Nr {
|
|
|
1843
1843
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1844
1844
|
}
|
|
1845
1845
|
}
|
|
1846
|
-
const Ct = Dt(null),
|
|
1847
|
-
const [n, a] = x(null), i = Ie.useRef(!1), o = Ie.useRef(!1), d =
|
|
1846
|
+
const Ct = Dt(null), Cn = ({ config: e, children: t }) => {
|
|
1847
|
+
const [n, a] = x(null), i = Ie.useRef(!1), o = Ie.useRef(!1), d = $e(() => {
|
|
1848
1848
|
const h = new Zt(e), m = new Xt(h), b = new er(h), N = new tr(h), v = new rr(h), S = new nr(h), g = new ar(h), f = new ir(h), R = new sr(h), I = new or(h), B = new hr(h), C = new Nr();
|
|
1849
1849
|
return {
|
|
1850
1850
|
httpClient: h,
|
|
@@ -1860,7 +1860,7 @@ const Ct = Dt(null), Nn = ({ config: e, children: t }) => {
|
|
|
1860
1860
|
themeService: B,
|
|
1861
1861
|
themeManager: C
|
|
1862
1862
|
};
|
|
1863
|
-
}, [e]), u =
|
|
1863
|
+
}, [e]), u = $e(() => ({
|
|
1864
1864
|
config: e,
|
|
1865
1865
|
...d,
|
|
1866
1866
|
currentTheme: n,
|
|
@@ -1898,7 +1898,7 @@ const Ct = Dt(null), Nn = ({ config: e, children: t }) => {
|
|
|
1898
1898
|
d.themeManager.cleanup();
|
|
1899
1899
|
}), []), /* @__PURE__ */ r(Ct.Provider, { value: u, children: t });
|
|
1900
1900
|
};
|
|
1901
|
-
function
|
|
1901
|
+
function Ce() {
|
|
1902
1902
|
const e = Mt(Ct);
|
|
1903
1903
|
if (!e)
|
|
1904
1904
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
@@ -1913,10 +1913,10 @@ async function Sr(e) {
|
|
|
1913
1913
|
}, a.onerror = (i) => n(i);
|
|
1914
1914
|
});
|
|
1915
1915
|
}
|
|
1916
|
-
function
|
|
1916
|
+
function En(e, t) {
|
|
1917
1917
|
return e.size <= t;
|
|
1918
1918
|
}
|
|
1919
|
-
function
|
|
1919
|
+
function In(e, t) {
|
|
1920
1920
|
return t.split(",").map((a) => a.trim()).some((a) => {
|
|
1921
1921
|
if (a.endsWith("/*")) {
|
|
1922
1922
|
const i = a.slice(0, -2);
|
|
@@ -1930,7 +1930,7 @@ function ut(e) {
|
|
|
1930
1930
|
const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
|
1931
1931
|
return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
|
|
1932
1932
|
}
|
|
1933
|
-
function
|
|
1933
|
+
function An(e) {
|
|
1934
1934
|
return e;
|
|
1935
1935
|
}
|
|
1936
1936
|
function ge(...e) {
|
|
@@ -1969,7 +1969,7 @@ function Ar(e) {
|
|
|
1969
1969
|
console.warn("Failed to save workflow state to storage:", t);
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
|
-
function
|
|
1972
|
+
function Rn() {
|
|
1973
1973
|
try {
|
|
1974
1974
|
const e = localStorage.getItem(Je.WORKFLOW_STATE);
|
|
1975
1975
|
return e ? JSON.parse(e) : null;
|
|
@@ -1984,11 +1984,11 @@ function Rr() {
|
|
|
1984
1984
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
1987
|
-
function
|
|
1987
|
+
function Pn() {
|
|
1988
1988
|
Ir(), Rr();
|
|
1989
1989
|
}
|
|
1990
1990
|
function Pr(e) {
|
|
1991
|
-
const { createOrchestrator: t } =
|
|
1991
|
+
const { createOrchestrator: t } = Ce(), [n, a] = x(null), [i, o] = x(!1), [d, u] = x(null), h = ne(null), m = e || Er();
|
|
1992
1992
|
me(() => {
|
|
1993
1993
|
h.current || (h.current = t());
|
|
1994
1994
|
}, [t]), me(() => {
|
|
@@ -2098,7 +2098,7 @@ function Pr(e) {
|
|
|
2098
2098
|
};
|
|
2099
2099
|
}
|
|
2100
2100
|
function Fr(e) {
|
|
2101
|
-
const { questionnaireService: t, applicantService: n } =
|
|
2101
|
+
const { questionnaireService: t, applicantService: n } = Ce(), [a, i] = x(null), [o, d] = x({}), [u, h] = x(!1), [m, b] = x(!1), [N, v] = x(null), S = ne(!1), g = ne(null), f = V(async () => {
|
|
2102
2102
|
var I, B;
|
|
2103
2103
|
if (e) {
|
|
2104
2104
|
if (S.current) {
|
|
@@ -2115,8 +2115,8 @@ function Fr(e) {
|
|
|
2115
2115
|
const q = /* @__PURE__ */ new Map();
|
|
2116
2116
|
for (const F of P.questionnaireResults)
|
|
2117
2117
|
F.question && ((B = F.answers) != null && B.length) && q.set(F.question.trim().toLowerCase(), F.answers);
|
|
2118
|
-
const ae = {},
|
|
2119
|
-
for (const F of
|
|
2118
|
+
const ae = {}, $ = C.questionGroups.flatMap((F) => F.questions ?? []);
|
|
2119
|
+
for (const F of $) {
|
|
2120
2120
|
const j = F.text.trim().toLowerCase();
|
|
2121
2121
|
q.has(j) && (ae[F.id] = q.get(j));
|
|
2122
2122
|
}
|
|
@@ -2157,7 +2157,7 @@ function Fr(e) {
|
|
|
2157
2157
|
};
|
|
2158
2158
|
}
|
|
2159
2159
|
function Tr(e) {
|
|
2160
|
-
const { uploadDocumentService: t } =
|
|
2160
|
+
const { uploadDocumentService: t } = Ce(), [n, a] = x(null), [i, o] = x(!1), [d, u] = x(!1), [h, m] = x(0), [b, N] = x(null), v = ne(!1), S = ne(null), g = V(async () => {
|
|
2161
2161
|
if (e) {
|
|
2162
2162
|
if (v.current) {
|
|
2163
2163
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
@@ -2200,8 +2200,8 @@ function Tr(e) {
|
|
|
2200
2200
|
submit: f
|
|
2201
2201
|
};
|
|
2202
2202
|
}
|
|
2203
|
-
function
|
|
2204
|
-
const { appropriatenessTestService: t } =
|
|
2203
|
+
function Fn(e) {
|
|
2204
|
+
const { appropriatenessTestService: t } = Ce(), [n, a] = x(null), [i, o] = x(!1), [d, u] = x(!1), [h, m] = x(null), [b, N] = x(null), v = ne(!1), S = ne(null), g = V(async () => {
|
|
2205
2205
|
if (e) {
|
|
2206
2206
|
if (v.current) {
|
|
2207
2207
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
@@ -2246,7 +2246,7 @@ function Rn(e) {
|
|
|
2246
2246
|
};
|
|
2247
2247
|
}
|
|
2248
2248
|
function Lr(e) {
|
|
2249
|
-
const { overviewService: t } =
|
|
2249
|
+
const { overviewService: t } = Ce(), [n, a] = x(null), [i, o] = x(!1), [d, u] = x(!1), [h, m] = x(null), b = ne(!1), N = ne(null), v = V(async () => {
|
|
2250
2250
|
if (e) {
|
|
2251
2251
|
if (b.current) {
|
|
2252
2252
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -2288,7 +2288,7 @@ function Lr(e) {
|
|
|
2288
2288
|
};
|
|
2289
2289
|
}
|
|
2290
2290
|
function Dr(e) {
|
|
2291
|
-
const { identityService: t } =
|
|
2291
|
+
const { identityService: t } = Ce(), [n, a] = x(
|
|
2292
2292
|
null
|
|
2293
2293
|
), [i, o] = x(!1), [d, u] = x(null), h = ne(!1), m = V(
|
|
2294
2294
|
async (v, S) => {
|
|
@@ -2374,7 +2374,7 @@ function Dr(e) {
|
|
|
2374
2374
|
};
|
|
2375
2375
|
}
|
|
2376
2376
|
function Mr(e) {
|
|
2377
|
-
const { riskScoringService: t, applicantService: n } =
|
|
2377
|
+
const { riskScoringService: t, applicantService: n } = Ce(), [a, i] = x(null), [o, d] = x({}), [u, h] = x(!1), [m, b] = x(!1), [N, v] = x(null), [S, g] = x(null), f = ne(!1), R = ne(null), I = V(async () => {
|
|
2378
2378
|
var C;
|
|
2379
2379
|
if (e) {
|
|
2380
2380
|
if (f.current) {
|
|
@@ -2388,15 +2388,15 @@ function Mr(e) {
|
|
|
2388
2388
|
n.getApplicantData(e).catch(() => null)
|
|
2389
2389
|
]);
|
|
2390
2390
|
if (i(P), (C = q == null ? void 0 : q.riskScoringResults) != null && C.length) {
|
|
2391
|
-
const ae = q.riskScoringResults[0],
|
|
2391
|
+
const ae = q.riskScoringResults[0], $ = {};
|
|
2392
2392
|
for (const F of ae.riskCriteriaResults ?? [])
|
|
2393
2393
|
if (F.riskCriteriaId != null && F.answer != null && F.answer !== "") {
|
|
2394
2394
|
const j = [...new Set(
|
|
2395
|
-
F.answer.split(",").map((
|
|
2395
|
+
F.answer.split(",").map((Z) => Z.trim()).filter((Z) => Z !== "")
|
|
2396
2396
|
)];
|
|
2397
|
-
j.length > 0 && (
|
|
2397
|
+
j.length > 0 && ($[F.riskCriteriaId] = j);
|
|
2398
2398
|
}
|
|
2399
|
-
d(
|
|
2399
|
+
d($);
|
|
2400
2400
|
}
|
|
2401
2401
|
R.current = e;
|
|
2402
2402
|
} catch (P) {
|
|
@@ -2435,7 +2435,7 @@ function Mr(e) {
|
|
|
2435
2435
|
};
|
|
2436
2436
|
}
|
|
2437
2437
|
function Or() {
|
|
2438
|
-
const { applicantService: e, config: t } =
|
|
2438
|
+
const { applicantService: e, config: t } = Ce(), [n, a] = x(!1), [i, o] = x(null), d = ne(!1), u = ne(!1), h = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(S) {
|
|
2439
2439
|
const g = Math.random() * 16 | 0;
|
|
2440
2440
|
return (S === "x" ? g : g & 3 | 8).toString(16);
|
|
2441
2441
|
}), m = V(
|
|
@@ -2508,68 +2508,87 @@ function Or() {
|
|
|
2508
2508
|
stopProgress: v
|
|
2509
2509
|
};
|
|
2510
2510
|
}
|
|
2511
|
-
const
|
|
2511
|
+
const Br = {
|
|
2512
|
+
primary: {
|
|
2513
|
+
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
2514
|
+
color: "#ffffff",
|
|
2515
|
+
borderColor: "transparent"
|
|
2516
|
+
},
|
|
2517
|
+
secondary: {
|
|
2518
|
+
backgroundColor: "var(--metakyc-surface, #f3f4f6)",
|
|
2519
|
+
color: "var(--metakyc-text-primary, #111827)",
|
|
2520
|
+
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2521
|
+
},
|
|
2522
|
+
outline: {
|
|
2523
|
+
backgroundColor: "transparent",
|
|
2524
|
+
color: "var(--metakyc-primary, #2563eb)",
|
|
2525
|
+
borderColor: "var(--metakyc-primary, #2563eb)"
|
|
2526
|
+
},
|
|
2527
|
+
danger: {
|
|
2528
|
+
backgroundColor: "var(--metakyc-danger, #ef4444)",
|
|
2529
|
+
color: "#ffffff",
|
|
2530
|
+
borderColor: "transparent"
|
|
2531
|
+
},
|
|
2532
|
+
ghost: {
|
|
2533
|
+
backgroundColor: "transparent",
|
|
2534
|
+
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
2535
|
+
borderColor: "transparent"
|
|
2536
|
+
}
|
|
2537
|
+
}, J = ({
|
|
2512
2538
|
children: e,
|
|
2513
2539
|
variant: t = "primary",
|
|
2514
2540
|
size: n = "md",
|
|
2515
2541
|
isLoading: a = !1,
|
|
2516
2542
|
disabled: i,
|
|
2517
2543
|
className: o,
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
"
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
}
|
|
2567
|
-
),
|
|
2568
|
-
e
|
|
2569
|
-
]
|
|
2570
|
-
}
|
|
2571
|
-
);
|
|
2572
|
-
}, xe = nt(
|
|
2544
|
+
style: d,
|
|
2545
|
+
...u
|
|
2546
|
+
}) => /* @__PURE__ */ s(
|
|
2547
|
+
"button",
|
|
2548
|
+
{
|
|
2549
|
+
className: ge("inline-flex items-center justify-center rounded-lg font-medium transition-opacity border focus:outline-none focus:ring-2 focus:ring-offset-1 disabled:opacity-50 disabled:cursor-not-allowed", {
|
|
2550
|
+
sm: "px-3 py-1.5 text-sm",
|
|
2551
|
+
md: "px-4 py-2 text-sm",
|
|
2552
|
+
lg: "px-6 py-3 text-base"
|
|
2553
|
+
}[n], o),
|
|
2554
|
+
style: { ...Br[t], ...d },
|
|
2555
|
+
disabled: i || a,
|
|
2556
|
+
...u,
|
|
2557
|
+
children: [
|
|
2558
|
+
a && /* @__PURE__ */ s(
|
|
2559
|
+
"svg",
|
|
2560
|
+
{
|
|
2561
|
+
className: "animate-spin -ml-1 mr-2 h-4 w-4",
|
|
2562
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2563
|
+
fill: "none",
|
|
2564
|
+
viewBox: "0 0 24 24",
|
|
2565
|
+
children: [
|
|
2566
|
+
/* @__PURE__ */ r(
|
|
2567
|
+
"circle",
|
|
2568
|
+
{
|
|
2569
|
+
className: "opacity-25",
|
|
2570
|
+
cx: "12",
|
|
2571
|
+
cy: "12",
|
|
2572
|
+
r: "10",
|
|
2573
|
+
stroke: "currentColor",
|
|
2574
|
+
strokeWidth: "4"
|
|
2575
|
+
}
|
|
2576
|
+
),
|
|
2577
|
+
/* @__PURE__ */ r(
|
|
2578
|
+
"path",
|
|
2579
|
+
{
|
|
2580
|
+
className: "opacity-75",
|
|
2581
|
+
fill: "currentColor",
|
|
2582
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
2583
|
+
}
|
|
2584
|
+
)
|
|
2585
|
+
]
|
|
2586
|
+
}
|
|
2587
|
+
),
|
|
2588
|
+
e
|
|
2589
|
+
]
|
|
2590
|
+
}
|
|
2591
|
+
), ve = nt(
|
|
2573
2592
|
({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, style: d, ...u }, h) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
2574
2593
|
e && /* @__PURE__ */ s(
|
|
2575
2594
|
"label",
|
|
@@ -2612,7 +2631,7 @@ const J = ({
|
|
|
2612
2631
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
2613
2632
|
] })
|
|
2614
2633
|
);
|
|
2615
|
-
|
|
2634
|
+
ve.displayName = "Input";
|
|
2616
2635
|
const W = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2617
2636
|
"div",
|
|
2618
2637
|
{
|
|
@@ -2627,7 +2646,7 @@ const W = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2627
2646
|
...n,
|
|
2628
2647
|
children: e
|
|
2629
2648
|
}
|
|
2630
|
-
),
|
|
2649
|
+
), ke = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2631
2650
|
"div",
|
|
2632
2651
|
{
|
|
2633
2652
|
className: ge("px-6 py-4 border-b", t),
|
|
@@ -2637,7 +2656,7 @@ const W = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2637
2656
|
...n,
|
|
2638
2657
|
children: e
|
|
2639
2658
|
}
|
|
2640
|
-
), Y = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: ge("px-6 py-4", t), ...n, children: e }),
|
|
2659
|
+
), Y = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: ge("px-6 py-4", t), ...n, children: e }), Ne = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2641
2660
|
"div",
|
|
2642
2661
|
{
|
|
2643
2662
|
className: ge("px-6 py-4 border-t", t),
|
|
@@ -2647,21 +2666,38 @@ const W = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2647
2666
|
...n,
|
|
2648
2667
|
children: e
|
|
2649
2668
|
}
|
|
2650
|
-
),
|
|
2669
|
+
), zr = {
|
|
2670
|
+
// Theme-aware variants
|
|
2671
|
+
default: {
|
|
2672
|
+
backgroundColor: "var(--metakyc-surface, #f3f4f6)",
|
|
2673
|
+
color: "var(--metakyc-text-secondary, #6b7280)"
|
|
2674
|
+
},
|
|
2675
|
+
info: {
|
|
2676
|
+
backgroundColor: "var(--metakyc-primary-light, #dbeafe)",
|
|
2677
|
+
color: "var(--metakyc-primary, #2563eb)"
|
|
2678
|
+
},
|
|
2679
|
+
// Semantic variants — intentional fixed colors
|
|
2680
|
+
success: {
|
|
2681
|
+
backgroundColor: "#d1fae5",
|
|
2682
|
+
color: "#065f46"
|
|
2683
|
+
},
|
|
2684
|
+
danger: {
|
|
2685
|
+
backgroundColor: "#fee2e2",
|
|
2686
|
+
color: "#991b1b"
|
|
2687
|
+
},
|
|
2688
|
+
warning: {
|
|
2689
|
+
backgroundColor: "#fef3c7",
|
|
2690
|
+
color: "#92400e"
|
|
2691
|
+
}
|
|
2692
|
+
}, ze = ({ children: e, variant: t = "default", className: n, style: a, ...i }) => /* @__PURE__ */ r(
|
|
2651
2693
|
"span",
|
|
2652
2694
|
{
|
|
2653
2695
|
className: ge(
|
|
2654
2696
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2655
|
-
{
|
|
2656
|
-
default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
|
|
2657
|
-
success: "bg-success-100 text-success-800 dark:bg-success-900 dark:text-success-300",
|
|
2658
|
-
danger: "bg-danger-100 text-danger-800 dark:bg-danger-900 dark:text-danger-300",
|
|
2659
|
-
warning: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300",
|
|
2660
|
-
info: "bg-primary-100 text-primary-800 dark:bg-primary-900 dark:text-primary-300"
|
|
2661
|
-
}[t],
|
|
2662
2697
|
n
|
|
2663
2698
|
),
|
|
2664
|
-
...a,
|
|
2699
|
+
style: { ...zr[t], ...a },
|
|
2700
|
+
...i,
|
|
2665
2701
|
children: e
|
|
2666
2702
|
}
|
|
2667
2703
|
), Te = ({ size: e = "md", className: t, ...n }) => {
|
|
@@ -2766,7 +2802,7 @@ const W = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2766
2802
|
] })
|
|
2767
2803
|
);
|
|
2768
2804
|
yt.displayName = "Select";
|
|
2769
|
-
const xt = 280,
|
|
2805
|
+
const xt = 280, $r = ({
|
|
2770
2806
|
label: e,
|
|
2771
2807
|
value: t,
|
|
2772
2808
|
onChange: n,
|
|
@@ -2826,14 +2862,14 @@ const xt = 280, Br = ({
|
|
|
2826
2862
|
}, [u, B]);
|
|
2827
2863
|
const ae = a.filter(
|
|
2828
2864
|
(A) => A.label.toLowerCase().includes(m.toLowerCase())
|
|
2829
|
-
),
|
|
2865
|
+
), $ = (A) => {
|
|
2830
2866
|
o || n(t.includes(A) ? t.filter((U) => U !== A) : [...t, A]);
|
|
2831
2867
|
}, F = (A, U) => {
|
|
2832
2868
|
U.stopPropagation(), o || n(t.filter((re) => re !== A));
|
|
2833
2869
|
}, j = (A) => {
|
|
2834
2870
|
var U;
|
|
2835
2871
|
return ((U = a.find((re) => re.value === A)) == null ? void 0 : U.label) || A;
|
|
2836
|
-
}, { bg:
|
|
2872
|
+
}, { bg: Z, borderColor: L, textPrimary: O, textSecondary: T, primaryColor: M, primaryLight: K, hoverBg: X } = S, le = u && N && /* @__PURE__ */ s(
|
|
2837
2873
|
"div",
|
|
2838
2874
|
{
|
|
2839
2875
|
ref: I,
|
|
@@ -2847,12 +2883,12 @@ const xt = 280, Br = ({
|
|
|
2847
2883
|
zIndex: 99999,
|
|
2848
2884
|
borderRadius: "8px",
|
|
2849
2885
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
2850
|
-
border: `1px solid ${
|
|
2851
|
-
backgroundColor:
|
|
2886
|
+
border: `1px solid ${L}`,
|
|
2887
|
+
backgroundColor: Z,
|
|
2852
2888
|
overflow: "hidden"
|
|
2853
2889
|
},
|
|
2854
2890
|
children: [
|
|
2855
|
-
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${
|
|
2891
|
+
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${L}` }, children: /* @__PURE__ */ r(
|
|
2856
2892
|
"input",
|
|
2857
2893
|
{
|
|
2858
2894
|
type: "text",
|
|
@@ -2868,18 +2904,18 @@ const xt = 280, Br = ({
|
|
|
2868
2904
|
padding: "6px 8px",
|
|
2869
2905
|
fontSize: "13px",
|
|
2870
2906
|
borderRadius: "6px",
|
|
2871
|
-
border: `1px solid ${
|
|
2872
|
-
backgroundColor:
|
|
2907
|
+
border: `1px solid ${L}`,
|
|
2908
|
+
backgroundColor: Z,
|
|
2873
2909
|
color: O,
|
|
2874
2910
|
outline: "none",
|
|
2875
2911
|
boxSizing: "border-box"
|
|
2876
2912
|
},
|
|
2877
2913
|
onFocus: (A) => {
|
|
2878
2914
|
const U = getComputedStyle(document.documentElement), re = U.getPropertyValue("--metakyc-input-border-focus").trim() || U.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
2879
|
-
A.currentTarget.style.backgroundColor =
|
|
2915
|
+
A.currentTarget.style.backgroundColor = Z, A.currentTarget.style.color = O, A.currentTarget.style.borderColor = re, A.currentTarget.style.outline = "none", A.currentTarget.style.boxShadow = `0 0 0 2px ${re}33`;
|
|
2880
2916
|
},
|
|
2881
2917
|
onBlur: (A) => {
|
|
2882
|
-
A.currentTarget.style.backgroundColor =
|
|
2918
|
+
A.currentTarget.style.backgroundColor = Z, A.currentTarget.style.color = O, A.currentTarget.style.borderColor = L, A.currentTarget.style.outline = "none", A.currentTarget.style.boxShadow = "none";
|
|
2883
2919
|
}
|
|
2884
2920
|
}
|
|
2885
2921
|
) }),
|
|
@@ -2888,7 +2924,7 @@ const xt = 280, Br = ({
|
|
|
2888
2924
|
return /* @__PURE__ */ s(
|
|
2889
2925
|
"li",
|
|
2890
2926
|
{
|
|
2891
|
-
onClick: () =>
|
|
2927
|
+
onClick: () => $(A.value),
|
|
2892
2928
|
className: "metakyc-multiselect-option",
|
|
2893
2929
|
style: {
|
|
2894
2930
|
display: "flex",
|
|
@@ -2902,7 +2938,7 @@ const xt = 280, Br = ({
|
|
|
2902
2938
|
userSelect: "none"
|
|
2903
2939
|
},
|
|
2904
2940
|
onMouseEnter: (re) => {
|
|
2905
|
-
U || (re.currentTarget.style.backgroundColor =
|
|
2941
|
+
U || (re.currentTarget.style.backgroundColor = X);
|
|
2906
2942
|
},
|
|
2907
2943
|
onMouseLeave: (re) => {
|
|
2908
2944
|
U || (re.currentTarget.style.backgroundColor = "transparent");
|
|
@@ -2923,7 +2959,7 @@ const xt = 280, Br = ({
|
|
|
2923
2959
|
A.value
|
|
2924
2960
|
);
|
|
2925
2961
|
}) }),
|
|
2926
|
-
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${
|
|
2962
|
+
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${L}` }, children: /* @__PURE__ */ s(
|
|
2927
2963
|
"button",
|
|
2928
2964
|
{
|
|
2929
2965
|
type: "button",
|
|
@@ -3054,17 +3090,17 @@ const xt = 280, Br = ({
|
|
|
3054
3090
|
primaryLight: "#eff6ff",
|
|
3055
3091
|
hoverBg: "#f9fafb"
|
|
3056
3092
|
}), B = V(() => {
|
|
3057
|
-
const E = getComputedStyle(document.documentElement),
|
|
3093
|
+
const E = getComputedStyle(document.documentElement), ee = (oe, Ee) => E.getPropertyValue(oe).trim() || Ee, ie = ee("--metakyc-input-bg", ee("--metakyc-background", "#ffffff"));
|
|
3058
3094
|
I({
|
|
3059
3095
|
bg: ie,
|
|
3060
|
-
border:
|
|
3061
|
-
text:
|
|
3062
|
-
textSecondary:
|
|
3063
|
-
primary:
|
|
3064
|
-
primaryLight:
|
|
3065
|
-
hoverBg:
|
|
3096
|
+
border: ee("--metakyc-input-border", ee("--metakyc-border", "#d1d5db")),
|
|
3097
|
+
text: ee("--metakyc-input-text", ee("--metakyc-text-primary", "#111827")),
|
|
3098
|
+
textSecondary: ee("--metakyc-text-secondary", "#6b7280"),
|
|
3099
|
+
primary: ee("--metakyc-primary", "#2563eb"),
|
|
3100
|
+
primaryLight: ee("--metakyc-primary-light", "#eff6ff"),
|
|
3101
|
+
hoverBg: ee("--metakyc-surface", ie)
|
|
3066
3102
|
});
|
|
3067
|
-
}, []), C = ne(null), P = ne(null), q = ne(null), ae = ne(null),
|
|
3103
|
+
}, []), C = ne(null), P = ne(null), q = ne(null), ae = ne(null), $ = V(() => {
|
|
3068
3104
|
if (!P.current) return null;
|
|
3069
3105
|
const E = P.current.getBoundingClientRect(), ie = window.innerHeight - E.bottom < vt && E.top > vt;
|
|
3070
3106
|
return {
|
|
@@ -3076,39 +3112,39 @@ const xt = 280, Br = ({
|
|
|
3076
3112
|
}, []), F = V(() => {
|
|
3077
3113
|
if (u) return;
|
|
3078
3114
|
B();
|
|
3079
|
-
const E =
|
|
3115
|
+
const E = $();
|
|
3080
3116
|
E && f(E), N(!0);
|
|
3081
|
-
}, [u,
|
|
3117
|
+
}, [u, $, B]), j = V(() => {
|
|
3082
3118
|
N(!1), S("");
|
|
3083
|
-
}, []),
|
|
3119
|
+
}, []), Z = () => b ? j() : F();
|
|
3084
3120
|
me(() => {
|
|
3085
3121
|
if (!b) return;
|
|
3086
|
-
const E = (
|
|
3087
|
-
var oe,
|
|
3088
|
-
const ie =
|
|
3089
|
-
!((oe = C.current) != null && oe.contains(ie)) && !((
|
|
3122
|
+
const E = (ee) => {
|
|
3123
|
+
var oe, Ee;
|
|
3124
|
+
const ie = ee.target;
|
|
3125
|
+
!((oe = C.current) != null && oe.contains(ie)) && !((Ee = q.current) != null && Ee.contains(ie)) && j();
|
|
3090
3126
|
};
|
|
3091
3127
|
return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
|
|
3092
3128
|
}, [b, j]), me(() => {
|
|
3093
3129
|
if (!b) return;
|
|
3094
3130
|
const E = () => {
|
|
3095
|
-
const
|
|
3096
|
-
|
|
3131
|
+
const ee = $();
|
|
3132
|
+
ee && f(ee);
|
|
3097
3133
|
};
|
|
3098
3134
|
return window.addEventListener("scroll", E, !0), window.addEventListener("resize", E), () => {
|
|
3099
3135
|
window.removeEventListener("scroll", E, !0), window.removeEventListener("resize", E);
|
|
3100
3136
|
};
|
|
3101
|
-
}, [b,
|
|
3137
|
+
}, [b, $]), me(() => {
|
|
3102
3138
|
b && ae.current && setTimeout(() => {
|
|
3103
3139
|
var E;
|
|
3104
3140
|
return (E = ae.current) == null ? void 0 : E.focus();
|
|
3105
3141
|
}, 0);
|
|
3106
3142
|
}, [b]);
|
|
3107
|
-
const
|
|
3143
|
+
const L = a.filter(
|
|
3108
3144
|
(E) => E.label.toLowerCase().includes(v.toLowerCase()) || E.value.toLowerCase().includes(v.toLowerCase())
|
|
3109
|
-
), O = (pe = a.find((E) => E.value === o)) == null ? void 0 : pe.label, T = (E,
|
|
3110
|
-
u ||
|
|
3111
|
-
}, { bg: M, border: K, text:
|
|
3145
|
+
), O = (pe = a.find((E) => E.value === o)) == null ? void 0 : pe.label, T = (E, ee) => {
|
|
3146
|
+
u || ee || (d(E), j());
|
|
3147
|
+
}, { bg: M, border: K, text: X, textSecondary: le, primary: A, primaryLight: U, hoverBg: re } = R, ye = b && g && /* @__PURE__ */ s(
|
|
3112
3148
|
"div",
|
|
3113
3149
|
{
|
|
3114
3150
|
ref: q,
|
|
@@ -3145,16 +3181,16 @@ const xt = 280, Br = ({
|
|
|
3145
3181
|
borderRadius: "6px",
|
|
3146
3182
|
border: `1px solid ${K}`,
|
|
3147
3183
|
backgroundColor: M,
|
|
3148
|
-
color:
|
|
3184
|
+
color: X,
|
|
3149
3185
|
outline: "none",
|
|
3150
3186
|
boxSizing: "border-box"
|
|
3151
3187
|
},
|
|
3152
3188
|
onFocus: (E) => {
|
|
3153
|
-
const
|
|
3154
|
-
E.currentTarget.style.backgroundColor = M, E.currentTarget.style.color =
|
|
3189
|
+
const ee = getComputedStyle(document.documentElement), ie = ee.getPropertyValue("--metakyc-input-border-focus").trim() || ee.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
3190
|
+
E.currentTarget.style.backgroundColor = M, E.currentTarget.style.color = X, E.currentTarget.style.borderColor = ie, E.currentTarget.style.outline = "none", E.currentTarget.style.boxShadow = `0 0 0 2px ${ie}33`;
|
|
3155
3191
|
},
|
|
3156
3192
|
onBlur: (E) => {
|
|
3157
|
-
E.currentTarget.style.backgroundColor = M, E.currentTarget.style.color =
|
|
3193
|
+
E.currentTarget.style.backgroundColor = M, E.currentTarget.style.color = X, E.currentTarget.style.borderColor = K, E.currentTarget.style.outline = "none", E.currentTarget.style.boxShadow = "none";
|
|
3158
3194
|
}
|
|
3159
3195
|
}
|
|
3160
3196
|
) }),
|
|
@@ -3168,8 +3204,8 @@ const xt = 280, Br = ({
|
|
|
3168
3204
|
maxHeight: "208px",
|
|
3169
3205
|
overflowY: "auto"
|
|
3170
3206
|
},
|
|
3171
|
-
children:
|
|
3172
|
-
const
|
|
3207
|
+
children: L.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: le }, children: "No results" }) : L.map((E) => {
|
|
3208
|
+
const ee = E.value === o;
|
|
3173
3209
|
return /* @__PURE__ */ r(
|
|
3174
3210
|
"li",
|
|
3175
3211
|
{
|
|
@@ -3180,15 +3216,15 @@ const xt = 280, Br = ({
|
|
|
3180
3216
|
fontSize: "13px",
|
|
3181
3217
|
cursor: E.disabled ? "not-allowed" : "pointer",
|
|
3182
3218
|
opacity: E.disabled ? 0.4 : 1,
|
|
3183
|
-
backgroundColor:
|
|
3184
|
-
color:
|
|
3219
|
+
backgroundColor: ee ? U : "transparent",
|
|
3220
|
+
color: ee ? A : X,
|
|
3185
3221
|
userSelect: "none"
|
|
3186
3222
|
},
|
|
3187
3223
|
onMouseEnter: (ie) => {
|
|
3188
|
-
!
|
|
3224
|
+
!ee && !E.disabled && (ie.currentTarget.style.backgroundColor = re);
|
|
3189
3225
|
},
|
|
3190
3226
|
onMouseLeave: (ie) => {
|
|
3191
|
-
|
|
3227
|
+
ee || (ie.currentTarget.style.backgroundColor = "transparent");
|
|
3192
3228
|
},
|
|
3193
3229
|
children: E.label
|
|
3194
3230
|
},
|
|
@@ -3223,9 +3259,9 @@ const xt = 280, Br = ({
|
|
|
3223
3259
|
ref: P,
|
|
3224
3260
|
role: "button",
|
|
3225
3261
|
tabIndex: u ? -1 : 0,
|
|
3226
|
-
onClick:
|
|
3262
|
+
onClick: Z,
|
|
3227
3263
|
onKeyDown: (E) => {
|
|
3228
|
-
(E.key === "Enter" || E.key === " ") && (E.preventDefault(),
|
|
3264
|
+
(E.key === "Enter" || E.key === " ") && (E.preventDefault(), Z()), E.key === "Escape" && j();
|
|
3229
3265
|
},
|
|
3230
3266
|
className: ge(
|
|
3231
3267
|
"metakyc-searchable-select-trigger",
|
|
@@ -3263,7 +3299,7 @@ const xt = 280, Br = ({
|
|
|
3263
3299
|
);
|
|
3264
3300
|
};
|
|
3265
3301
|
_e.displayName = "SearchableSelect";
|
|
3266
|
-
const
|
|
3302
|
+
const _r = ({
|
|
3267
3303
|
label: e,
|
|
3268
3304
|
error: t,
|
|
3269
3305
|
accept: n,
|
|
@@ -3405,7 +3441,7 @@ const $r = ({
|
|
|
3405
3441
|
)) }),
|
|
3406
3442
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: t })
|
|
3407
3443
|
] });
|
|
3408
|
-
},
|
|
3444
|
+
}, Hr = nt(
|
|
3409
3445
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
3410
3446
|
a.label && /* @__PURE__ */ s(
|
|
3411
3447
|
"label",
|
|
@@ -3438,7 +3474,7 @@ const $r = ({
|
|
|
3438
3474
|
}
|
|
3439
3475
|
),
|
|
3440
3476
|
/* @__PURE__ */ r(
|
|
3441
|
-
|
|
3477
|
+
ve,
|
|
3442
3478
|
{
|
|
3443
3479
|
ref: i,
|
|
3444
3480
|
type: "tel",
|
|
@@ -3451,7 +3487,7 @@ const $r = ({
|
|
|
3451
3487
|
a.error && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: a.error })
|
|
3452
3488
|
] })
|
|
3453
3489
|
);
|
|
3454
|
-
|
|
3490
|
+
Hr.displayName = "PhoneInput";
|
|
3455
3491
|
/**
|
|
3456
3492
|
* @license lucide-react v0.574.0 - ISC
|
|
3457
3493
|
*
|
|
@@ -3465,14 +3501,14 @@ const Et = (...e) => e.filter((t, n, a) => !!t && t.trim() !== "" && a.indexOf(t
|
|
|
3465
3501
|
* This source code is licensed under the ISC license.
|
|
3466
3502
|
* See the LICENSE file in the root directory of this source tree.
|
|
3467
3503
|
*/
|
|
3468
|
-
const
|
|
3504
|
+
const Ur = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3469
3505
|
/**
|
|
3470
3506
|
* @license lucide-react v0.574.0 - ISC
|
|
3471
3507
|
*
|
|
3472
3508
|
* This source code is licensed under the ISC license.
|
|
3473
3509
|
* See the LICENSE file in the root directory of this source tree.
|
|
3474
3510
|
*/
|
|
3475
|
-
const
|
|
3511
|
+
const jr = (e) => e.replace(
|
|
3476
3512
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
3477
3513
|
(t, n, a) => a ? a.toUpperCase() : n.toLowerCase()
|
|
3478
3514
|
);
|
|
@@ -3483,7 +3519,7 @@ const Hr = (e) => e.replace(
|
|
|
3483
3519
|
* See the LICENSE file in the root directory of this source tree.
|
|
3484
3520
|
*/
|
|
3485
3521
|
const kt = (e) => {
|
|
3486
|
-
const t =
|
|
3522
|
+
const t = jr(e);
|
|
3487
3523
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3488
3524
|
};
|
|
3489
3525
|
/**
|
|
@@ -3492,7 +3528,7 @@ const kt = (e) => {
|
|
|
3492
3528
|
* This source code is licensed under the ISC license.
|
|
3493
3529
|
* See the LICENSE file in the root directory of this source tree.
|
|
3494
3530
|
*/
|
|
3495
|
-
var
|
|
3531
|
+
var Kr = {
|
|
3496
3532
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3497
3533
|
width: 24,
|
|
3498
3534
|
height: 24,
|
|
@@ -3509,7 +3545,7 @@ var Ur = {
|
|
|
3509
3545
|
* This source code is licensed under the ISC license.
|
|
3510
3546
|
* See the LICENSE file in the root directory of this source tree.
|
|
3511
3547
|
*/
|
|
3512
|
-
const
|
|
3548
|
+
const Wr = (e) => {
|
|
3513
3549
|
for (const t in e)
|
|
3514
3550
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
3515
3551
|
return !0;
|
|
@@ -3521,7 +3557,7 @@ const jr = (e) => {
|
|
|
3521
3557
|
* This source code is licensed under the ISC license.
|
|
3522
3558
|
* See the LICENSE file in the root directory of this source tree.
|
|
3523
3559
|
*/
|
|
3524
|
-
const
|
|
3560
|
+
const Yr = nt(
|
|
3525
3561
|
({
|
|
3526
3562
|
color: e = "currentColor",
|
|
3527
3563
|
size: t = 24,
|
|
@@ -3535,13 +3571,13 @@ const Kr = nt(
|
|
|
3535
3571
|
"svg",
|
|
3536
3572
|
{
|
|
3537
3573
|
ref: h,
|
|
3538
|
-
...
|
|
3574
|
+
...Kr,
|
|
3539
3575
|
width: t,
|
|
3540
3576
|
height: t,
|
|
3541
3577
|
stroke: e,
|
|
3542
3578
|
strokeWidth: a ? Number(n) * 24 / Number(t) : n,
|
|
3543
3579
|
className: Et("lucide", i),
|
|
3544
|
-
...!o && !
|
|
3580
|
+
...!o && !Wr(u) && { "aria-hidden": "true" },
|
|
3545
3581
|
...u
|
|
3546
3582
|
},
|
|
3547
3583
|
[
|
|
@@ -3558,11 +3594,11 @@ const Kr = nt(
|
|
|
3558
3594
|
*/
|
|
3559
3595
|
const It = (e, t) => {
|
|
3560
3596
|
const n = nt(
|
|
3561
|
-
({ className: a, ...i }, o) => mt(
|
|
3597
|
+
({ className: a, ...i }, o) => mt(Yr, {
|
|
3562
3598
|
ref: o,
|
|
3563
3599
|
iconNode: t,
|
|
3564
3600
|
className: Et(
|
|
3565
|
-
`lucide-${
|
|
3601
|
+
`lucide-${Ur(kt(e))}`,
|
|
3566
3602
|
`lucide-${e}`,
|
|
3567
3603
|
a
|
|
3568
3604
|
),
|
|
@@ -3577,15 +3613,15 @@ const It = (e, t) => {
|
|
|
3577
3613
|
* This source code is licensed under the ISC license.
|
|
3578
3614
|
* See the LICENSE file in the root directory of this source tree.
|
|
3579
3615
|
*/
|
|
3580
|
-
const
|
|
3616
|
+
const Vr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], At = It("chevron-left", Vr);
|
|
3581
3617
|
/**
|
|
3582
3618
|
* @license lucide-react v0.574.0 - ISC
|
|
3583
3619
|
*
|
|
3584
3620
|
* This source code is licensed under the ISC license.
|
|
3585
3621
|
* See the LICENSE file in the root directory of this source tree.
|
|
3586
3622
|
*/
|
|
3587
|
-
const
|
|
3588
|
-
function
|
|
3623
|
+
const qr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Rt = It("chevron-right", qr);
|
|
3624
|
+
function Qr(e, t) {
|
|
3589
3625
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
3590
3626
|
if (e.isRequired && n)
|
|
3591
3627
|
return e.errorMessage || "This field is required";
|
|
@@ -3614,7 +3650,7 @@ function Vr(e, t) {
|
|
|
3614
3650
|
}
|
|
3615
3651
|
return null;
|
|
3616
3652
|
}
|
|
3617
|
-
function
|
|
3653
|
+
function Gr(e) {
|
|
3618
3654
|
const t = e.flatMap(
|
|
3619
3655
|
(a, i) => (a.questions ?? []).map((o, d) => ({ question: o, groupIndex: i, qIdx: d }))
|
|
3620
3656
|
), n = /* @__PURE__ */ new Map();
|
|
@@ -3624,7 +3660,7 @@ function qr(e) {
|
|
|
3624
3660
|
}
|
|
3625
3661
|
return Array.from(n.entries()).sort(([a], [i]) => a - i).map(([, a]) => a);
|
|
3626
3662
|
}
|
|
3627
|
-
const
|
|
3663
|
+
const Jr = ({
|
|
3628
3664
|
applicantId: e,
|
|
3629
3665
|
onComplete: t,
|
|
3630
3666
|
onBack: n
|
|
@@ -3633,48 +3669,48 @@ const Qr = ({
|
|
|
3633
3669
|
Ie.useEffect(() => {
|
|
3634
3670
|
i && Object.keys(i).length > 0 && Object.keys(m).length === 0 && b(i);
|
|
3635
3671
|
}, [i]);
|
|
3636
|
-
const f =
|
|
3637
|
-
() => a ?
|
|
3672
|
+
const f = $e(
|
|
3673
|
+
() => a ? Gr(a.questionGroups) : [],
|
|
3638
3674
|
[a]
|
|
3639
|
-
), R = S === f.length - 1, I = f[S] ?? [], B = V((
|
|
3640
|
-
b((j) => ({ ...j, [
|
|
3641
|
-
const
|
|
3642
|
-
return delete
|
|
3675
|
+
), R = S === f.length - 1, I = f[S] ?? [], B = V(($, F) => {
|
|
3676
|
+
b((j) => ({ ...j, [$]: F })), v((j) => {
|
|
3677
|
+
const Z = { ...j };
|
|
3678
|
+
return delete Z[$], Z;
|
|
3643
3679
|
});
|
|
3644
3680
|
}, []), C = V(() => {
|
|
3645
|
-
const
|
|
3681
|
+
const $ = {};
|
|
3646
3682
|
for (const { question: F } of I) {
|
|
3647
|
-
const j =
|
|
3648
|
-
j && (
|
|
3683
|
+
const j = Qr(F, m[F.id] ?? []);
|
|
3684
|
+
j && ($[F.id] = j);
|
|
3649
3685
|
}
|
|
3650
|
-
return v((F) => ({ ...F,
|
|
3686
|
+
return v((F) => ({ ...F, ...$ })), Object.keys($).length === 0;
|
|
3651
3687
|
}, [I, m]), P = () => {
|
|
3652
|
-
C() && g((
|
|
3688
|
+
C() && g(($) => $ + 1);
|
|
3653
3689
|
}, q = () => {
|
|
3654
|
-
S > 0 ? g((
|
|
3690
|
+
S > 0 ? g(($) => $ - 1) : n == null || n();
|
|
3655
3691
|
}, ae = async () => {
|
|
3656
3692
|
if (!(!C() || !a))
|
|
3657
3693
|
try {
|
|
3658
|
-
const
|
|
3659
|
-
(j) => (j.questions ?? []).map((
|
|
3660
|
-
questionId:
|
|
3661
|
-
values: m[
|
|
3694
|
+
const $ = a.questionGroups.flatMap(
|
|
3695
|
+
(j) => (j.questions ?? []).map((Z) => ({
|
|
3696
|
+
questionId: Z.id,
|
|
3697
|
+
values: m[Z.id] ?? []
|
|
3662
3698
|
}))
|
|
3663
3699
|
), F = {
|
|
3664
3700
|
applicantId: e,
|
|
3665
3701
|
questionnarieId: a.id,
|
|
3666
|
-
questionResults:
|
|
3702
|
+
questionResults: $
|
|
3667
3703
|
};
|
|
3668
3704
|
await h(F), t == null || t();
|
|
3669
|
-
} catch (
|
|
3670
|
-
console.error("Questionnaire submit error:",
|
|
3705
|
+
} catch ($) {
|
|
3706
|
+
console.error("Questionnaire submit error:", $);
|
|
3671
3707
|
}
|
|
3672
3708
|
};
|
|
3673
3709
|
return o ? /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(Te, { className: "my-8" }) }) }) : u ? /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
3674
3710
|
"Error loading questionnaire: ",
|
|
3675
3711
|
u.message
|
|
3676
3712
|
] }) }) }) : a ? /* @__PURE__ */ s(W, { children: [
|
|
3677
|
-
/* @__PURE__ */ s(
|
|
3713
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
3678
3714
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3679
3715
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.subtitle }),
|
|
3680
3716
|
f.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
|
|
@@ -3684,7 +3720,7 @@ const Qr = ({
|
|
|
3684
3720
|
" of ",
|
|
3685
3721
|
f.length
|
|
3686
3722
|
] }),
|
|
3687
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: f.map((
|
|
3723
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: f.map(($, F) => /* @__PURE__ */ r(
|
|
3688
3724
|
"div",
|
|
3689
3725
|
{
|
|
3690
3726
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3698,17 +3734,17 @@ const Qr = ({
|
|
|
3698
3734
|
)) })
|
|
3699
3735
|
] })
|
|
3700
3736
|
] }),
|
|
3701
|
-
/* @__PURE__ */ r(Y, { className: "space-y-6", children: I.map(({ question:
|
|
3702
|
-
|
|
3737
|
+
/* @__PURE__ */ r(Y, { className: "space-y-6", children: I.map(({ question: $ }) => /* @__PURE__ */ r(
|
|
3738
|
+
Zr,
|
|
3703
3739
|
{
|
|
3704
|
-
question:
|
|
3705
|
-
value: m[
|
|
3706
|
-
error: N[
|
|
3707
|
-
onChange: (F) => B(
|
|
3740
|
+
question: $,
|
|
3741
|
+
value: m[$.id] ?? [],
|
|
3742
|
+
error: N[$.id],
|
|
3743
|
+
onChange: (F) => B($.id, F)
|
|
3708
3744
|
},
|
|
3709
|
-
|
|
3745
|
+
$.id
|
|
3710
3746
|
)) }),
|
|
3711
|
-
/* @__PURE__ */ s(
|
|
3747
|
+
/* @__PURE__ */ s(Ne, { className: "flex items-center justify-between", children: [
|
|
3712
3748
|
/* @__PURE__ */ s(
|
|
3713
3749
|
J,
|
|
3714
3750
|
{
|
|
@@ -3745,7 +3781,7 @@ const Qr = ({
|
|
|
3745
3781
|
] }),
|
|
3746
3782
|
u && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: u.message }) })
|
|
3747
3783
|
] }) : null;
|
|
3748
|
-
},
|
|
3784
|
+
}, Zr = ({ question: e, value: t, error: n, onChange: a }) => {
|
|
3749
3785
|
var d;
|
|
3750
3786
|
const o = (((d = e.defaultAnswers) == null ? void 0 : d.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
3751
3787
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
@@ -3756,7 +3792,7 @@ const Qr = ({
|
|
|
3756
3792
|
e.subtitle && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.subtitle }),
|
|
3757
3793
|
e.description && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.description }),
|
|
3758
3794
|
o === "text" && /* @__PURE__ */ r(
|
|
3759
|
-
|
|
3795
|
+
ve,
|
|
3760
3796
|
{
|
|
3761
3797
|
value: t[0] ?? "",
|
|
3762
3798
|
onChange: (u) => a([u.target.value]),
|
|
@@ -3852,7 +3888,7 @@ const Qr = ({
|
|
|
3852
3888
|
] }),
|
|
3853
3889
|
n && o === "text" && null
|
|
3854
3890
|
] });
|
|
3855
|
-
},
|
|
3891
|
+
}, Xr = ({
|
|
3856
3892
|
applicantId: e,
|
|
3857
3893
|
onComplete: t,
|
|
3858
3894
|
onBack: n
|
|
@@ -3883,12 +3919,12 @@ const Qr = ({
|
|
|
3883
3919
|
"Error loading document requirements: ",
|
|
3884
3920
|
d.message
|
|
3885
3921
|
] }) }) }) : a ? /* @__PURE__ */ r("form", { onSubmit: b, children: /* @__PURE__ */ s(W, { children: [
|
|
3886
|
-
/* @__PURE__ */ s(
|
|
3922
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
3887
3923
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3888
|
-
a.subtitle && /* @__PURE__ */ r("p", { className: "
|
|
3924
|
+
a.subtitle && /* @__PURE__ */ r("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.subtitle })
|
|
3889
3925
|
] }),
|
|
3890
3926
|
/* @__PURE__ */ r(Y, { className: "space-y-6", children: a.uploadDocumentFiles.map((N) => /* @__PURE__ */ r(
|
|
3891
|
-
|
|
3927
|
+
_r,
|
|
3892
3928
|
{
|
|
3893
3929
|
label: N.displayName,
|
|
3894
3930
|
accept: N.allowedTypes,
|
|
@@ -3901,12 +3937,12 @@ const Qr = ({
|
|
|
3901
3937
|
},
|
|
3902
3938
|
N.id
|
|
3903
3939
|
)) }),
|
|
3904
|
-
/* @__PURE__ */ s(
|
|
3940
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-between", children: [
|
|
3905
3941
|
n && /* @__PURE__ */ r(J, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
3906
3942
|
/* @__PURE__ */ r(J, { type: "submit", isLoading: o, children: "Continue" })
|
|
3907
3943
|
] })
|
|
3908
3944
|
] }) }) : null;
|
|
3909
|
-
},
|
|
3945
|
+
}, en = ({ applicantId: e, onComplete: t, onBack: n }) => {
|
|
3910
3946
|
const { overview: a, isLoading: i, isSubmitting: o, error: d, passOverview: u } = Lr(e), h = async () => {
|
|
3911
3947
|
await u(), t == null || t();
|
|
3912
3948
|
};
|
|
@@ -3914,12 +3950,19 @@ const Qr = ({
|
|
|
3914
3950
|
"Error loading overview: ",
|
|
3915
3951
|
d.message
|
|
3916
3952
|
] }) }) }) : a ? /* @__PURE__ */ s(W, { children: [
|
|
3917
|
-
/* @__PURE__ */ s(
|
|
3953
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
3918
3954
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
3919
|
-
a.description && /* @__PURE__ */ r("p", { className: "
|
|
3955
|
+
a.description && /* @__PURE__ */ r("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.description })
|
|
3920
3956
|
] }),
|
|
3921
3957
|
/* @__PURE__ */ r(Y, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((m, b) => m.order - b.order).map((m) => /* @__PURE__ */ s("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3922
|
-
/* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r(
|
|
3958
|
+
/* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r(
|
|
3959
|
+
"div",
|
|
3960
|
+
{
|
|
3961
|
+
className: "w-8 h-8 rounded-full flex items-center justify-center font-medium text-sm",
|
|
3962
|
+
style: { backgroundColor: "var(--metakyc-primary, #2563eb)", color: "#ffffff" },
|
|
3963
|
+
children: m.order + 1
|
|
3964
|
+
}
|
|
3965
|
+
) }),
|
|
3923
3966
|
/* @__PURE__ */ s(
|
|
3924
3967
|
"div",
|
|
3925
3968
|
{
|
|
@@ -3931,19 +3974,19 @@ const Qr = ({
|
|
|
3931
3974
|
background: "transparent"
|
|
3932
3975
|
},
|
|
3933
3976
|
children: [
|
|
3934
|
-
/* @__PURE__ */ r("span", { className: "metakyc-step-title text-sm font-semibold
|
|
3935
|
-
m.description && /* @__PURE__ */ r("p", { className: "metakyc-step-description text-sm
|
|
3977
|
+
/* @__PURE__ */ r("span", { className: "metakyc-step-title text-sm font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: m.title }),
|
|
3978
|
+
m.description && /* @__PURE__ */ r("p", { className: "metakyc-step-description text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: m.description })
|
|
3936
3979
|
]
|
|
3937
3980
|
}
|
|
3938
3981
|
)
|
|
3939
|
-
] }, m.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", {
|
|
3940
|
-
/* @__PURE__ */ s(
|
|
3982
|
+
] }, m.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading overview data..." }) }) }),
|
|
3983
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-between", children: [
|
|
3941
3984
|
n && /* @__PURE__ */ r(J, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
3942
3985
|
/* @__PURE__ */ r(J, { onClick: h, isLoading: o, children: "Continue" })
|
|
3943
3986
|
] })
|
|
3944
3987
|
] }) : null;
|
|
3945
3988
|
};
|
|
3946
|
-
function
|
|
3989
|
+
function tn(e) {
|
|
3947
3990
|
const t = (e ?? "en").toLowerCase().replace("_", "-");
|
|
3948
3991
|
try {
|
|
3949
3992
|
return Intl.NumberFormat.supportedLocalesOf([t]), t;
|
|
@@ -3951,11 +3994,11 @@ function Xr(e) {
|
|
|
3951
3994
|
return "en";
|
|
3952
3995
|
}
|
|
3953
3996
|
}
|
|
3954
|
-
function
|
|
3997
|
+
function rn(e) {
|
|
3955
3998
|
return e.valueDataType === Me.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
|
|
3956
3999
|
}
|
|
3957
|
-
function
|
|
3958
|
-
const n = new Intl.NumberFormat(
|
|
4000
|
+
function nn(e, t) {
|
|
4001
|
+
const n = new Intl.NumberFormat(tn(t), {
|
|
3959
4002
|
minimumFractionDigits: 0,
|
|
3960
4003
|
maximumFractionDigits: 2
|
|
3961
4004
|
});
|
|
@@ -3964,7 +4007,7 @@ function tn(e, t) {
|
|
|
3964
4007
|
return isNaN(i) ? a : n.format(i);
|
|
3965
4008
|
});
|
|
3966
4009
|
}
|
|
3967
|
-
function
|
|
4010
|
+
function an(e, t) {
|
|
3968
4011
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
3969
4012
|
if (e.isRequired && n)
|
|
3970
4013
|
return e.errorMessage || `${e.displayName} is required`;
|
|
@@ -3994,58 +4037,58 @@ function rn(e, t) {
|
|
|
3994
4037
|
}
|
|
3995
4038
|
return null;
|
|
3996
4039
|
}
|
|
3997
|
-
function
|
|
4040
|
+
function sn(e) {
|
|
3998
4041
|
const t = /* @__PURE__ */ new Map();
|
|
3999
4042
|
return e.forEach((n, a) => {
|
|
4000
4043
|
const i = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
4001
4044
|
t.has(i) || t.set(i, []), t.get(i).push({ criterion: n, idx: a });
|
|
4002
4045
|
}), Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
4003
4046
|
}
|
|
4004
|
-
function
|
|
4047
|
+
function on(e) {
|
|
4005
4048
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
4006
4049
|
}
|
|
4007
|
-
const
|
|
4050
|
+
const ln = ({
|
|
4008
4051
|
applicantId: e,
|
|
4009
4052
|
onComplete: t,
|
|
4010
4053
|
onBack: n
|
|
4011
4054
|
}) => {
|
|
4012
|
-
const { config: a } =
|
|
4055
|
+
const { config: a } = Ce(), i = a.locale ?? "en", { criteria: o, initialAnswers: d, isLoading: u, isSubmitting: h, error: m, submit: b } = Mr(e), [N, v] = x({}), [S, g] = x({}), [f, R] = x(0), [I, B] = x(!1);
|
|
4013
4056
|
Ie.useEffect(() => {
|
|
4014
4057
|
d && Object.keys(d).length > 0 && Object.keys(N).length === 0 && v(d);
|
|
4015
4058
|
}, [d]);
|
|
4016
|
-
const C =
|
|
4017
|
-
() => o && o.length > 0 ?
|
|
4059
|
+
const C = $e(
|
|
4060
|
+
() => o && o.length > 0 ? sn(o) : [],
|
|
4018
4061
|
[o]
|
|
4019
4062
|
), P = f === C.length - 1, q = C[f] ?? [];
|
|
4020
4063
|
Ie.useEffect(() => {
|
|
4021
4064
|
!u && o && o.length === 0 && !I && !h && (B(!0), b({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
4022
4065
|
}, [u, o, I, h, b, e, t]);
|
|
4023
|
-
const ae = V((
|
|
4024
|
-
v((T) => ({ ...T, [
|
|
4066
|
+
const ae = V((L, O) => {
|
|
4067
|
+
v((T) => ({ ...T, [L]: O })), g((T) => {
|
|
4025
4068
|
const M = { ...T };
|
|
4026
|
-
return delete M[
|
|
4069
|
+
return delete M[L], M;
|
|
4027
4070
|
});
|
|
4028
|
-
}, []),
|
|
4029
|
-
const
|
|
4071
|
+
}, []), $ = V(() => {
|
|
4072
|
+
const L = {};
|
|
4030
4073
|
for (const { criterion: O } of q) {
|
|
4031
|
-
const T =
|
|
4032
|
-
T && (
|
|
4074
|
+
const T = an(O, N[O.id] ?? []);
|
|
4075
|
+
T && (L[O.id] = T);
|
|
4033
4076
|
}
|
|
4034
|
-
return g((O) => ({ ...O, ...
|
|
4077
|
+
return g((O) => ({ ...O, ...L })), Object.keys(L).length === 0;
|
|
4035
4078
|
}, [q, N]), F = () => {
|
|
4036
|
-
|
|
4079
|
+
$() && R((L) => L + 1);
|
|
4037
4080
|
}, j = () => {
|
|
4038
|
-
f > 0 ? R((
|
|
4039
|
-
},
|
|
4040
|
-
if (!(
|
|
4081
|
+
f > 0 ? R((L) => L - 1) : n == null || n();
|
|
4082
|
+
}, Z = async () => {
|
|
4083
|
+
if (!(!$() || !o))
|
|
4041
4084
|
try {
|
|
4042
|
-
const
|
|
4085
|
+
const L = o.map((T) => {
|
|
4043
4086
|
const M = (N[T.id] ?? []).filter((K) => K && K.trim());
|
|
4044
4087
|
return M.length > 0 ? { riskCriteriaId: T.id, values: M } : null;
|
|
4045
4088
|
}).filter((T) => T !== null);
|
|
4046
|
-
await b({ applicantId: e, criteriaValueInputs:
|
|
4047
|
-
} catch (
|
|
4048
|
-
console.error("Risk scoring submit error:",
|
|
4089
|
+
await b({ applicantId: e, criteriaValueInputs: L }), t == null || t();
|
|
4090
|
+
} catch (L) {
|
|
4091
|
+
console.error("Risk scoring submit error:", L);
|
|
4049
4092
|
}
|
|
4050
4093
|
};
|
|
4051
4094
|
return u ? /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s(Y, { children: [
|
|
@@ -4058,7 +4101,7 @@ const sn = ({
|
|
|
4058
4101
|
"Error loading criteria: ",
|
|
4059
4102
|
m.message
|
|
4060
4103
|
] }) }) }) : o ? /* @__PURE__ */ s(W, { children: [
|
|
4061
|
-
/* @__PURE__ */ s(
|
|
4104
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
4062
4105
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
4063
4106
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
4064
4107
|
C.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
|
|
@@ -4068,7 +4111,7 @@ const sn = ({
|
|
|
4068
4111
|
" of ",
|
|
4069
4112
|
C.length
|
|
4070
4113
|
] }),
|
|
4071
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: C.map((
|
|
4114
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: C.map((L, O) => /* @__PURE__ */ r(
|
|
4072
4115
|
"div",
|
|
4073
4116
|
{
|
|
4074
4117
|
className: "rounded-full transition-all duration-200",
|
|
@@ -4082,18 +4125,18 @@ const sn = ({
|
|
|
4082
4125
|
)) })
|
|
4083
4126
|
] })
|
|
4084
4127
|
] }),
|
|
4085
|
-
/* @__PURE__ */ r(Y, { className: "space-y-6", children: q.map(({ criterion:
|
|
4086
|
-
|
|
4128
|
+
/* @__PURE__ */ r(Y, { className: "space-y-6", children: q.map(({ criterion: L }) => /* @__PURE__ */ r(
|
|
4129
|
+
cn,
|
|
4087
4130
|
{
|
|
4088
|
-
criterion:
|
|
4089
|
-
value: N[
|
|
4090
|
-
error: S[
|
|
4131
|
+
criterion: L,
|
|
4132
|
+
value: N[L.id] ?? [],
|
|
4133
|
+
error: S[L.id],
|
|
4091
4134
|
locale: i,
|
|
4092
|
-
onChange: (O) => ae(
|
|
4135
|
+
onChange: (O) => ae(L.id, O)
|
|
4093
4136
|
},
|
|
4094
|
-
|
|
4137
|
+
L.id
|
|
4095
4138
|
)) }),
|
|
4096
|
-
/* @__PURE__ */ s(
|
|
4139
|
+
/* @__PURE__ */ s(Ne, { className: "flex items-center justify-between", children: [
|
|
4097
4140
|
/* @__PURE__ */ s(
|
|
4098
4141
|
J,
|
|
4099
4142
|
{
|
|
@@ -4107,7 +4150,7 @@ const sn = ({
|
|
|
4107
4150
|
]
|
|
4108
4151
|
}
|
|
4109
4152
|
),
|
|
4110
|
-
P ? /* @__PURE__ */ r(J, { type: "button", isLoading: h, onClick:
|
|
4153
|
+
P ? /* @__PURE__ */ r(J, { type: "button", isLoading: h, onClick: Z, children: "Continue" }) : /* @__PURE__ */ s(
|
|
4111
4154
|
J,
|
|
4112
4155
|
{
|
|
4113
4156
|
type: "button",
|
|
@@ -4122,8 +4165,8 @@ const sn = ({
|
|
|
4122
4165
|
] }),
|
|
4123
4166
|
m && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: m.message }) })
|
|
4124
4167
|
] }) : null;
|
|
4125
|
-
},
|
|
4126
|
-
const o =
|
|
4168
|
+
}, cn = ({ criterion: e, value: t, error: n, locale: a, onChange: i }) => {
|
|
4169
|
+
const o = on(e), d = e.valueDataType === Me.Integer || e.valueDataType === Me.Money || e.valueDataType === Me.DigitOnly, u = rn(e), h = (m) => u ? nn(m, a) : m;
|
|
4127
4170
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
4128
4171
|
/* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4129
4172
|
e.displayName,
|
|
@@ -4132,7 +4175,7 @@ const sn = ({
|
|
|
4132
4175
|
e.description && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.description }),
|
|
4133
4176
|
d && (e.min !== void 0 || e.max !== void 0) && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.min !== void 0 && e.max !== void 0 ? `Range: ${e.min} – ${e.max}` : e.min !== void 0 ? `Minimum: ${e.min}` : `Maximum: ${e.max}` }),
|
|
4134
4177
|
o === "text" && /* @__PURE__ */ r(
|
|
4135
|
-
|
|
4178
|
+
ve,
|
|
4136
4179
|
{
|
|
4137
4180
|
value: t[0] ?? "",
|
|
4138
4181
|
onChange: (m) => i([m.target.value]),
|
|
@@ -4239,12 +4282,12 @@ const sn = ({
|
|
|
4239
4282
|
}
|
|
4240
4283
|
)
|
|
4241
4284
|
] });
|
|
4242
|
-
},
|
|
4285
|
+
}, dn = ({
|
|
4243
4286
|
applicantId: e,
|
|
4244
4287
|
onComplete: t,
|
|
4245
4288
|
onBack: n
|
|
4246
4289
|
}) => {
|
|
4247
|
-
const { investorCategorizationService: a } =
|
|
4290
|
+
const { investorCategorizationService: a } = Ce(), [i, o] = x(null), [d, u] = x(!1), [h, m] = x(null);
|
|
4248
4291
|
return /* @__PURE__ */ r("form", { onSubmit: async (N) => {
|
|
4249
4292
|
if (N.preventDefault(), i === null) {
|
|
4250
4293
|
m("Please select an investor type");
|
|
@@ -4265,34 +4308,35 @@ const sn = ({
|
|
|
4265
4308
|
u(!1);
|
|
4266
4309
|
}
|
|
4267
4310
|
}, children: /* @__PURE__ */ s(W, { children: [
|
|
4268
|
-
/* @__PURE__ */ s(
|
|
4269
|
-
/* @__PURE__ */ r("h2", { className: "text-lg font-bold
|
|
4270
|
-
/* @__PURE__ */ r("p", { className: "
|
|
4311
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
4312
|
+
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Which statement best describes you?" }),
|
|
4313
|
+
/* @__PURE__ */ r("p", { className: "mt-2", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
|
|
4271
4314
|
] }),
|
|
4272
4315
|
/* @__PURE__ */ s(Y, { className: "space-y-4", children: [
|
|
4273
|
-
/* @__PURE__ */ r("p", { className: "text-sm font-medium
|
|
4316
|
+
/* @__PURE__ */ r("p", { className: "text-sm font-medium mb-3", style: { color: "var(--metakyc-text-secondary, #374151)" }, children: "Choose one" }),
|
|
4274
4317
|
/* @__PURE__ */ r(
|
|
4275
4318
|
"label",
|
|
4276
4319
|
{
|
|
4277
|
-
className:
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4320
|
+
className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
|
|
4321
|
+
style: {
|
|
4322
|
+
borderColor: i === be.Individual ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
4323
|
+
backgroundColor: i === be.Individual ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
4324
|
+
},
|
|
4281
4325
|
children: /* @__PURE__ */ s("div", { className: "flex items-start", children: [
|
|
4282
4326
|
/* @__PURE__ */ r(
|
|
4283
4327
|
"input",
|
|
4284
4328
|
{
|
|
4285
4329
|
type: "radio",
|
|
4286
4330
|
name: "investorType",
|
|
4287
|
-
value:
|
|
4288
|
-
checked: i ===
|
|
4289
|
-
onChange: () => o(
|
|
4290
|
-
className: "mt-1
|
|
4331
|
+
value: be.Individual,
|
|
4332
|
+
checked: i === be.Individual,
|
|
4333
|
+
onChange: () => o(be.Individual),
|
|
4334
|
+
className: "mt-1"
|
|
4291
4335
|
}
|
|
4292
4336
|
),
|
|
4293
4337
|
/* @__PURE__ */ s("div", { className: "ml-3", children: [
|
|
4294
|
-
/* @__PURE__ */ r("div", { className: "text-base font-semibold
|
|
4295
|
-
/* @__PURE__ */ r("div", { className: "text-sm
|
|
4338
|
+
/* @__PURE__ */ r("div", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Individual investor" }),
|
|
4339
|
+
/* @__PURE__ */ r("div", { className: "text-sm mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "(Recommended) Most of our clients choose this option. Provides the strongest protection and aligns with our mission to make investing accessible to everyone." })
|
|
4296
4340
|
] })
|
|
4297
4341
|
] })
|
|
4298
4342
|
}
|
|
@@ -4300,26 +4344,27 @@ const sn = ({
|
|
|
4300
4344
|
/* @__PURE__ */ r(
|
|
4301
4345
|
"label",
|
|
4302
4346
|
{
|
|
4303
|
-
className:
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4347
|
+
className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
|
|
4348
|
+
style: {
|
|
4349
|
+
borderColor: i === be.Sophisticated ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
4350
|
+
backgroundColor: i === be.Sophisticated ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
4351
|
+
},
|
|
4307
4352
|
children: /* @__PURE__ */ s("div", { className: "flex items-start", children: [
|
|
4308
4353
|
/* @__PURE__ */ r(
|
|
4309
4354
|
"input",
|
|
4310
4355
|
{
|
|
4311
4356
|
type: "radio",
|
|
4312
4357
|
name: "investorType",
|
|
4313
|
-
value:
|
|
4314
|
-
checked: i ===
|
|
4315
|
-
onChange: () => o(
|
|
4316
|
-
className: "mt-1
|
|
4358
|
+
value: be.Sophisticated,
|
|
4359
|
+
checked: i === be.Sophisticated,
|
|
4360
|
+
onChange: () => o(be.Sophisticated),
|
|
4361
|
+
className: "mt-1"
|
|
4317
4362
|
}
|
|
4318
4363
|
),
|
|
4319
4364
|
/* @__PURE__ */ s("div", { className: "ml-3", children: [
|
|
4320
|
-
/* @__PURE__ */ r("div", { className: "text-base font-semibold
|
|
4321
|
-
/* @__PURE__ */ r("div", { className: "text-sm
|
|
4322
|
-
/* @__PURE__ */ s("ul", { className: "text-sm
|
|
4365
|
+
/* @__PURE__ */ r("div", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Sophisticated investor" }),
|
|
4366
|
+
/* @__PURE__ */ r("div", { className: "text-sm mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "In the last 2 years, I have done one or more of the following:" }),
|
|
4367
|
+
/* @__PURE__ */ s("ul", { className: "text-sm mt-2 space-y-1 list-none", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: [
|
|
4323
4368
|
/* @__PURE__ */ r("li", { children: "Worked in private equity or provided capital to small and medium enterprises, and/or" }),
|
|
4324
4369
|
/* @__PURE__ */ r("li", { children: "Been the director of a company with an annual turnover of at least (USD) $2m million, and/or" }),
|
|
4325
4370
|
/* @__PURE__ */ r("li", { children: "Invested directly in at least 2 private (not listed) companies." })
|
|
@@ -4331,25 +4376,26 @@ const sn = ({
|
|
|
4331
4376
|
/* @__PURE__ */ r(
|
|
4332
4377
|
"label",
|
|
4333
4378
|
{
|
|
4334
|
-
className:
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4379
|
+
className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
|
|
4380
|
+
style: {
|
|
4381
|
+
borderColor: i === be.HighNetWorth ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
4382
|
+
backgroundColor: i === be.HighNetWorth ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
4383
|
+
},
|
|
4338
4384
|
children: /* @__PURE__ */ s("div", { className: "flex items-start", children: [
|
|
4339
4385
|
/* @__PURE__ */ r(
|
|
4340
4386
|
"input",
|
|
4341
4387
|
{
|
|
4342
4388
|
type: "radio",
|
|
4343
4389
|
name: "investorType",
|
|
4344
|
-
value:
|
|
4345
|
-
checked: i ===
|
|
4346
|
-
onChange: () => o(
|
|
4347
|
-
className: "mt-1
|
|
4390
|
+
value: be.HighNetWorth,
|
|
4391
|
+
checked: i === be.HighNetWorth,
|
|
4392
|
+
onChange: () => o(be.HighNetWorth),
|
|
4393
|
+
className: "mt-1"
|
|
4348
4394
|
}
|
|
4349
4395
|
),
|
|
4350
4396
|
/* @__PURE__ */ s("div", { className: "ml-3", children: [
|
|
4351
|
-
/* @__PURE__ */ r("div", { className: "text-base font-semibold
|
|
4352
|
-
/* @__PURE__ */ s("div", { className: "text-sm
|
|
4397
|
+
/* @__PURE__ */ r("div", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "High networth investor" }),
|
|
4398
|
+
/* @__PURE__ */ s("div", { className: "text-sm mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: [
|
|
4353
4399
|
"I earn more than (USD/EUR) $150,000 per year, and/or",
|
|
4354
4400
|
/* @__PURE__ */ r("br", {}),
|
|
4355
4401
|
"I have net assets (excluding my main property) of at least $/EUR 300,000"
|
|
@@ -4358,13 +4404,13 @@ const sn = ({
|
|
|
4358
4404
|
] })
|
|
4359
4405
|
}
|
|
4360
4406
|
),
|
|
4361
|
-
h && /* @__PURE__ */ r("div", { className: "p-4
|
|
4407
|
+
h && /* @__PURE__ */ r("div", { className: "p-4 rounded-lg", style: { backgroundColor: "#fee2e2", border: "1px solid #fca5a5" }, children: /* @__PURE__ */ s("p", { className: "text-sm", style: { color: "#991b1b" }, children: [
|
|
4362
4408
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
4363
4409
|
" ",
|
|
4364
4410
|
h
|
|
4365
4411
|
] }) })
|
|
4366
4412
|
] }),
|
|
4367
|
-
/* @__PURE__ */ s(
|
|
4413
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-between", children: [
|
|
4368
4414
|
n && /* @__PURE__ */ r(J, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4369
4415
|
/* @__PURE__ */ r(
|
|
4370
4416
|
J,
|
|
@@ -4377,12 +4423,12 @@ const sn = ({
|
|
|
4377
4423
|
)
|
|
4378
4424
|
] })
|
|
4379
4425
|
] }) });
|
|
4380
|
-
},
|
|
4426
|
+
}, un = ({
|
|
4381
4427
|
applicantId: e,
|
|
4382
4428
|
onComplete: t,
|
|
4383
4429
|
onBack: n
|
|
4384
4430
|
}) => {
|
|
4385
|
-
const { appropriatenessTestService: a } =
|
|
4431
|
+
const { appropriatenessTestService: a } = Ce(), [i, o] = x(null), [d, u] = x(!0), [h, m] = x(!1), [b, N] = x(null), [v, S] = x({}), [g, f] = x(0), [R, I] = x(!1), [B, C] = x(!1), [P, q] = x(0);
|
|
4386
4432
|
me(() => {
|
|
4387
4433
|
(async () => {
|
|
4388
4434
|
try {
|
|
@@ -4402,11 +4448,11 @@ const sn = ({
|
|
|
4402
4448
|
const ae = (T) => {
|
|
4403
4449
|
const M = T.split(":").map(Number);
|
|
4404
4450
|
if (M.length === 3) {
|
|
4405
|
-
const [K,
|
|
4406
|
-
return K * 3600 +
|
|
4451
|
+
const [K, X, le] = M;
|
|
4452
|
+
return K * 3600 + X * 60 + le;
|
|
4407
4453
|
}
|
|
4408
4454
|
return 0;
|
|
4409
|
-
},
|
|
4455
|
+
}, $ = (T) => {
|
|
4410
4456
|
const M = Math.floor(T / 60), K = T % 60;
|
|
4411
4457
|
return `${M.toString().padStart(2, "0")}:${K.toString().padStart(2, "0")}`;
|
|
4412
4458
|
};
|
|
@@ -4423,7 +4469,7 @@ const sn = ({
|
|
|
4423
4469
|
}, 1e3);
|
|
4424
4470
|
return () => clearInterval(T);
|
|
4425
4471
|
}, [P]), me(() => {
|
|
4426
|
-
B && !h &&
|
|
4472
|
+
B && !h && Z();
|
|
4427
4473
|
}, [B]);
|
|
4428
4474
|
const F = () => {
|
|
4429
4475
|
i && (I(!0), f(i.testDurationSec));
|
|
@@ -4432,7 +4478,7 @@ const sn = ({
|
|
|
4432
4478
|
...K,
|
|
4433
4479
|
[T]: M
|
|
4434
4480
|
}));
|
|
4435
|
-
},
|
|
4481
|
+
}, Z = async (T) => {
|
|
4436
4482
|
if (T && T.preventDefault(), !!i) {
|
|
4437
4483
|
if (!B) {
|
|
4438
4484
|
const M = i.appropriatenessQuestions.length - Object.keys(v).length;
|
|
@@ -4444,9 +4490,9 @@ const sn = ({
|
|
|
4444
4490
|
m(!0), N(null);
|
|
4445
4491
|
try {
|
|
4446
4492
|
const M = i.appropriatenessQuestions.map(
|
|
4447
|
-
(
|
|
4448
|
-
appropriatenessQuestionId:
|
|
4449
|
-
value: v[
|
|
4493
|
+
(X) => ({
|
|
4494
|
+
appropriatenessQuestionId: X.id,
|
|
4495
|
+
value: v[X.id] || ""
|
|
4450
4496
|
// Empty string if not answered
|
|
4451
4497
|
})
|
|
4452
4498
|
), K = {
|
|
@@ -4456,14 +4502,14 @@ const sn = ({
|
|
|
4456
4502
|
};
|
|
4457
4503
|
console.log("Submitting appropriateness test:", K);
|
|
4458
4504
|
try {
|
|
4459
|
-
const
|
|
4460
|
-
console.log("Appropriateness test result:",
|
|
4461
|
-
} catch (
|
|
4462
|
-
if (
|
|
4463
|
-
const le =
|
|
4464
|
-
console.log("Test failed:", le), N(le), I(!1), C(!1), S({}), setTimeout(() =>
|
|
4505
|
+
const X = await a.fillAppropriatenessTest(K);
|
|
4506
|
+
console.log("Appropriateness test result:", X), X.message && (X.message.toLowerCase().includes("pass") || X.message.toLowerCase().includes("success") || X.message.toLowerCase().includes("congratulations")) ? t == null || t() : (N(X.message || "Test completed. Please check the result."), I(!1), C(!1), S({}), setTimeout(() => L(), 1e3));
|
|
4507
|
+
} catch (X) {
|
|
4508
|
+
if (X.code === 400 && X.message) {
|
|
4509
|
+
const le = X.message;
|
|
4510
|
+
console.log("Test failed:", le), N(le), I(!1), C(!1), S({}), setTimeout(() => L(), 1500);
|
|
4465
4511
|
} else
|
|
4466
|
-
throw
|
|
4512
|
+
throw X;
|
|
4467
4513
|
}
|
|
4468
4514
|
} catch (M) {
|
|
4469
4515
|
console.error("Error submitting appropriateness test:", M), N(M.message || "Failed to submit test. Please try again."), I(!1), C(!1), S({});
|
|
@@ -4471,7 +4517,7 @@ const sn = ({
|
|
|
4471
4517
|
m(!1);
|
|
4472
4518
|
}
|
|
4473
4519
|
}
|
|
4474
|
-
},
|
|
4520
|
+
}, L = async () => {
|
|
4475
4521
|
try {
|
|
4476
4522
|
const T = await a.getAppropriatenessTest(e);
|
|
4477
4523
|
if (console.log("Reloaded test data:", T), o(T), T.waitTimeSpanForNextTry && T.waitTimeSpanForNextTry !== "00:00:00") {
|
|
@@ -4496,21 +4542,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4496
4542
|
] }) });
|
|
4497
4543
|
if (P > 0)
|
|
4498
4544
|
return /* @__PURE__ */ s(W, { children: [
|
|
4499
|
-
/* @__PURE__ */ s(
|
|
4545
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
4500
4546
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: i.displayName }),
|
|
4501
4547
|
i.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: i.subtitle })
|
|
4502
4548
|
] }),
|
|
4503
4549
|
/* @__PURE__ */ s(Y, { className: "py-12 text-center", children: [
|
|
4504
4550
|
/* @__PURE__ */ s("div", { className: "mb-6", children: [
|
|
4505
|
-
/* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children:
|
|
4551
|
+
/* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: $(P) }),
|
|
4506
4552
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
4507
4553
|
] }),
|
|
4508
4554
|
b && /* @__PURE__ */ r("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400 text-sm", children: b }) })
|
|
4509
4555
|
] })
|
|
4510
4556
|
] });
|
|
4511
4557
|
const O = i.testAllowedMaxTry - i.totalFailedTries;
|
|
4512
|
-
return R ? /* @__PURE__ */ r("form", { onSubmit:
|
|
4513
|
-
/* @__PURE__ */ r(
|
|
4558
|
+
return R ? /* @__PURE__ */ r("form", { onSubmit: Z, children: /* @__PURE__ */ s(W, { children: [
|
|
4559
|
+
/* @__PURE__ */ r(ke, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
4514
4560
|
/* @__PURE__ */ s("div", { children: [
|
|
4515
4561
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: i.displayName }),
|
|
4516
4562
|
i.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: i.subtitle })
|
|
@@ -4520,7 +4566,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4520
4566
|
"div",
|
|
4521
4567
|
{
|
|
4522
4568
|
className: `text-3xl font-bold ${g <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
4523
|
-
children:
|
|
4569
|
+
children: $(g)
|
|
4524
4570
|
}
|
|
4525
4571
|
),
|
|
4526
4572
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
@@ -4528,13 +4574,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4528
4574
|
] }) }),
|
|
4529
4575
|
/* @__PURE__ */ s(Y, { className: "space-y-6", children: [
|
|
4530
4576
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4531
|
-
/* @__PURE__ */ s(
|
|
4577
|
+
/* @__PURE__ */ s(ze, { variant: "info", children: [
|
|
4532
4578
|
"Question ",
|
|
4533
4579
|
Object.keys(v).length,
|
|
4534
4580
|
" of ",
|
|
4535
4581
|
i.totalQuestionCount
|
|
4536
4582
|
] }),
|
|
4537
|
-
/* @__PURE__ */ s(
|
|
4583
|
+
/* @__PURE__ */ s(ze, { variant: O > 1 ? "success" : "warning", children: [
|
|
4538
4584
|
O,
|
|
4539
4585
|
" attempt",
|
|
4540
4586
|
O !== 1 ? "s" : "",
|
|
@@ -4554,7 +4600,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4554
4600
|
T.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: T.groupName }),
|
|
4555
4601
|
/* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: T.question })
|
|
4556
4602
|
] }),
|
|
4557
|
-
/* @__PURE__ */ r("div", { className: "space-y-2", children: T.answers.map((K,
|
|
4603
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: T.answers.map((K, X) => /* @__PURE__ */ s(
|
|
4558
4604
|
"label",
|
|
4559
4605
|
{
|
|
4560
4606
|
className: `
|
|
@@ -4577,7 +4623,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4577
4623
|
/* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: K })
|
|
4578
4624
|
]
|
|
4579
4625
|
},
|
|
4580
|
-
|
|
4626
|
+
X
|
|
4581
4627
|
)) })
|
|
4582
4628
|
]
|
|
4583
4629
|
},
|
|
@@ -4593,7 +4639,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4593
4639
|
" Your answers are being submitted automatically."
|
|
4594
4640
|
] }) })
|
|
4595
4641
|
] }),
|
|
4596
|
-
/* @__PURE__ */ s(
|
|
4642
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-between", children: [
|
|
4597
4643
|
/* @__PURE__ */ r(
|
|
4598
4644
|
J,
|
|
4599
4645
|
{
|
|
@@ -4615,7 +4661,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4615
4661
|
)
|
|
4616
4662
|
] })
|
|
4617
4663
|
] }) }) : /* @__PURE__ */ s(W, { children: [
|
|
4618
|
-
/* @__PURE__ */ s(
|
|
4664
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
4619
4665
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: i.displayName }),
|
|
4620
4666
|
i.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: i.subtitle })
|
|
4621
4667
|
] }),
|
|
@@ -4624,19 +4670,19 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4624
4670
|
/* @__PURE__ */ s("div", { className: "space-y-4 mb-6", children: [
|
|
4625
4671
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4626
4672
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
|
|
4627
|
-
/* @__PURE__ */ r(
|
|
4673
|
+
/* @__PURE__ */ r(ze, { variant: "info", children: i.totalQuestionCount })
|
|
4628
4674
|
] }),
|
|
4629
4675
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4630
4676
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4631
|
-
/* @__PURE__ */ r(
|
|
4677
|
+
/* @__PURE__ */ r(ze, { variant: "info", children: $(i.testDurationSec) })
|
|
4632
4678
|
] }),
|
|
4633
4679
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4634
4680
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
4635
|
-
/* @__PURE__ */ r(
|
|
4681
|
+
/* @__PURE__ */ r(ze, { variant: "info", children: i.testCorrectAnswerPassLimit })
|
|
4636
4682
|
] }),
|
|
4637
4683
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4638
4684
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4639
|
-
/* @__PURE__ */ r(
|
|
4685
|
+
/* @__PURE__ */ r(ze, { variant: O > 1 ? "success" : "warning", children: O })
|
|
4640
4686
|
] })
|
|
4641
4687
|
] }),
|
|
4642
4688
|
b && /* @__PURE__ */ r("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -4646,7 +4692,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4646
4692
|
] }) }),
|
|
4647
4693
|
O <= 0 && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
4648
4694
|
] }),
|
|
4649
|
-
/* @__PURE__ */ s(
|
|
4695
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-between", children: [
|
|
4650
4696
|
n && /* @__PURE__ */ r(J, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4651
4697
|
/* @__PURE__ */ r(
|
|
4652
4698
|
J,
|
|
@@ -4659,13 +4705,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4659
4705
|
)
|
|
4660
4706
|
] })
|
|
4661
4707
|
] });
|
|
4662
|
-
},
|
|
4708
|
+
}, mn = ({
|
|
4663
4709
|
applicantId: e,
|
|
4664
4710
|
onComplete: t,
|
|
4665
4711
|
onBack: n
|
|
4666
4712
|
}) => {
|
|
4667
4713
|
var Ue, it, Ze, st;
|
|
4668
|
-
const { applicantService: a, baseInformationService: i, config: o, currentTheme: d } =
|
|
4714
|
+
const { applicantService: a, baseInformationService: i, config: o, currentTheme: d } = Ce(), { identityData: u, provider: h, token: m, isLoading: b, error: N, requestIdentity: v, restartIdentity: S } = Dr(e), [g, f] = x(null), [R, I] = x(null), [B, C] = x([]), [P, q] = x([]), [ae, $] = x(!0), [F, j] = x(!1), [Z, L] = x(null), [O, T] = x(!1), M = Ie.useRef(!1), [K, X] = x({}), [le, A] = x({}), U = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, re = !!(d != null && d.reviewPageDisabled), ye = ne(!1);
|
|
4669
4715
|
ye.current = re;
|
|
4670
4716
|
const pe = Bt({
|
|
4671
4717
|
defaultValues: {
|
|
@@ -4680,24 +4726,24 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4680
4726
|
});
|
|
4681
4727
|
me(() => {
|
|
4682
4728
|
if (re) {
|
|
4683
|
-
M.current || (M.current = !0, v().then(() => j(!0)).catch((
|
|
4729
|
+
M.current || (M.current = !0, v().then(() => j(!0)).catch((D) => console.error("[Identity] Auto-request failed:", D)).finally(() => $(!1)));
|
|
4684
4730
|
return;
|
|
4685
4731
|
}
|
|
4686
4732
|
(async () => {
|
|
4687
4733
|
try {
|
|
4688
|
-
const [
|
|
4734
|
+
const [D, H, z] = await Promise.all([
|
|
4689
4735
|
a.getApplicantData(e),
|
|
4690
4736
|
i.getCountries("", "en"),
|
|
4691
4737
|
i.getCountries("", "en", 40)
|
|
4692
4738
|
// CountriesType.PhoneNumber
|
|
4693
4739
|
]);
|
|
4694
|
-
I(
|
|
4740
|
+
I(D);
|
|
4695
4741
|
const Q = /* @__PURE__ */ new Set(), G = H.map((y) => ({ value: y.abbreviation3 || y.abbreviation, label: y.name })).filter((y) => !y.value || Q.has(y.value) ? !1 : (Q.add(y.value), !0));
|
|
4696
4742
|
C(G);
|
|
4697
|
-
const ce = /* @__PURE__ */ new Set(), l =
|
|
4743
|
+
const ce = /* @__PURE__ */ new Set(), l = z.filter((y) => y.countryCode).map((y) => ({ value: y.countryCode, label: `${y.countryCode} – ${y.name}` })).filter((y) => ce.has(y.value) ? !1 : (ce.add(y.value), !0));
|
|
4698
4744
|
q(l);
|
|
4699
|
-
const c =
|
|
4700
|
-
if (
|
|
4745
|
+
const c = D.applicantRequestData;
|
|
4746
|
+
if (X({
|
|
4701
4747
|
firstName: (c == null ? void 0 : c.firstName) || "",
|
|
4702
4748
|
lastName: (c == null ? void 0 : c.lastName) || "",
|
|
4703
4749
|
email: (c == null ? void 0 : c.email) || "",
|
|
@@ -4727,7 +4773,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4727
4773
|
country: (c == null ? void 0 : c.country) || "",
|
|
4728
4774
|
nationality: (c == null ? void 0 : c.nationality) || "",
|
|
4729
4775
|
phonenumber: (c == null ? void 0 : c.phonenumber) || ""
|
|
4730
|
-
}),
|
|
4776
|
+
}), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !M.current && ye.current) {
|
|
4731
4777
|
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), M.current = !0;
|
|
4732
4778
|
try {
|
|
4733
4779
|
await v(), j(!0);
|
|
@@ -4735,10 +4781,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4735
4781
|
console.error("[Identity] Auto-request failed:", y);
|
|
4736
4782
|
}
|
|
4737
4783
|
}
|
|
4738
|
-
} catch (
|
|
4739
|
-
console.error("Error loading applicant data:",
|
|
4784
|
+
} catch (D) {
|
|
4785
|
+
console.error("Error loading applicant data:", D);
|
|
4740
4786
|
} finally {
|
|
4741
|
-
|
|
4787
|
+
$(!1);
|
|
4742
4788
|
}
|
|
4743
4789
|
})();
|
|
4744
4790
|
}, [e]), me(() => {
|
|
@@ -4748,22 +4794,22 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4748
4794
|
if (m.expiresAt) {
|
|
4749
4795
|
const p = new Date(m.expiresAt).getTime();
|
|
4750
4796
|
if (Date.now() >= p) {
|
|
4751
|
-
console.warn("[Identity] Token has expired (expiresAt)"), T(!0),
|
|
4797
|
+
console.warn("[Identity] Token has expired (expiresAt)"), T(!0), L("Your verification session has expired. Please restart.");
|
|
4752
4798
|
return;
|
|
4753
4799
|
}
|
|
4754
4800
|
}
|
|
4755
4801
|
if (m.url)
|
|
4756
4802
|
try {
|
|
4757
|
-
const
|
|
4758
|
-
if (
|
|
4759
|
-
console.warn("[Identity] Token URL indicates expiration"), T(!0),
|
|
4803
|
+
const D = new URL(m.url).toString().toLowerCase();
|
|
4804
|
+
if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
|
|
4805
|
+
console.warn("[Identity] Token URL indicates expiration"), T(!0), L("Your verification link has expired. Please restart.");
|
|
4760
4806
|
return;
|
|
4761
4807
|
}
|
|
4762
4808
|
} catch {
|
|
4763
4809
|
console.error("[Identity] Invalid token URL");
|
|
4764
4810
|
}
|
|
4765
4811
|
if (m.status === "expired" || m.error === "expired" || m.expired === !0) {
|
|
4766
|
-
console.warn("[Identity] Token object indicates expiration"), T(!0),
|
|
4812
|
+
console.warn("[Identity] Token object indicates expiration"), T(!0), L("Your verification session has expired. Please restart.");
|
|
4767
4813
|
return;
|
|
4768
4814
|
}
|
|
4769
4815
|
}
|
|
@@ -4771,59 +4817,59 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4771
4817
|
if (h !== null && m && !g && F && !O) {
|
|
4772
4818
|
const p = h;
|
|
4773
4819
|
if (m.url) {
|
|
4774
|
-
console.log("[Identity] Loading provider URL for user verification:", m.url),
|
|
4820
|
+
console.log("[Identity] Loading provider URL for user verification:", m.url), L(null);
|
|
4775
4821
|
try {
|
|
4776
4822
|
if (new URL(m.url), p === Pe.SardinAI) {
|
|
4777
4823
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4778
4824
|
try {
|
|
4779
|
-
const
|
|
4780
|
-
Qe.createProvider(h,
|
|
4825
|
+
const D = Qe.parseProviderConfig(h, m, o);
|
|
4826
|
+
Qe.createProvider(h, D).initialize().then(() => {
|
|
4781
4827
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4782
|
-
}).catch((
|
|
4783
|
-
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):",
|
|
4828
|
+
}).catch((z) => {
|
|
4829
|
+
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", z);
|
|
4784
4830
|
});
|
|
4785
|
-
} catch (
|
|
4786
|
-
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):",
|
|
4831
|
+
} catch (D) {
|
|
4832
|
+
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
|
|
4787
4833
|
}
|
|
4788
4834
|
}
|
|
4789
4835
|
f({ type: "url", url: m.url });
|
|
4790
|
-
} catch (
|
|
4791
|
-
console.error("[Identity] Invalid URL:",
|
|
4836
|
+
} catch (D) {
|
|
4837
|
+
console.error("[Identity] Invalid URL:", D), L("Invalid verification URL. Please restart."), T(!0);
|
|
4792
4838
|
}
|
|
4793
4839
|
return;
|
|
4794
4840
|
}
|
|
4795
4841
|
if (p === Pe.SardinAI) {
|
|
4796
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
4842
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), L(null);
|
|
4797
4843
|
try {
|
|
4798
|
-
const
|
|
4844
|
+
const D = Qe.parseProviderConfig(h, m, o), H = Qe.createProvider(h, D);
|
|
4799
4845
|
H.initialize().then(() => {
|
|
4800
4846
|
console.log("[SardinAI] Risk SDK initialized successfully"), f(H), setTimeout(() => {
|
|
4801
4847
|
t == null || t();
|
|
4802
4848
|
}, 2e3);
|
|
4803
|
-
}).catch((
|
|
4849
|
+
}).catch((z) => {
|
|
4804
4850
|
var G;
|
|
4805
|
-
console.error("[SardinAI] Failed to initialize:",
|
|
4806
|
-
const Q = ((G =
|
|
4807
|
-
Q.includes("expired") || Q.includes("invalid") || Q.includes("401") || Q.includes("400") ? (T(!0),
|
|
4851
|
+
console.error("[SardinAI] Failed to initialize:", z);
|
|
4852
|
+
const Q = ((G = z.message) == null ? void 0 : G.toLowerCase()) || "";
|
|
4853
|
+
Q.includes("expired") || Q.includes("invalid") || Q.includes("401") || Q.includes("400") ? (T(!0), L("Session expired or invalid. Please restart verification.")) : L(`Failed to initialize: ${z.message}`);
|
|
4808
4854
|
});
|
|
4809
|
-
} catch (
|
|
4810
|
-
console.error("[SardinAI] Error creating provider:",
|
|
4855
|
+
} catch (D) {
|
|
4856
|
+
console.error("[SardinAI] Error creating provider:", D), L(`Configuration error: ${D.message}`);
|
|
4811
4857
|
}
|
|
4812
4858
|
return;
|
|
4813
4859
|
}
|
|
4814
4860
|
try {
|
|
4815
|
-
|
|
4816
|
-
const
|
|
4817
|
-
p === Pe.Sumsub ? (H.initialize("identity-container").catch((
|
|
4861
|
+
L(null);
|
|
4862
|
+
const D = Qe.parseProviderConfig(h, m, o), H = Qe.createProvider(h, D);
|
|
4863
|
+
p === Pe.Sumsub ? (H.initialize("identity-container").catch((z) => {
|
|
4818
4864
|
var Q;
|
|
4819
|
-
console.error("[Sumsub] Initialization error:",
|
|
4865
|
+
console.error("[Sumsub] Initialization error:", z), L(`Failed to initialize: ${z.message}`), (Q = z.message) != null && Q.toLowerCase().includes("expired") && T(!0);
|
|
4820
4866
|
}), H.onComplete && H.onComplete(() => {
|
|
4821
4867
|
t == null || t();
|
|
4822
|
-
})) : p === Pe.Onfido && H.initialize("identity-container").catch((
|
|
4823
|
-
console.error("[Onfido] Initialization error:",
|
|
4868
|
+
})) : p === Pe.Onfido && H.initialize("identity-container").catch((z) => {
|
|
4869
|
+
console.error("[Onfido] Initialization error:", z), L(`Failed to initialize: ${z.message}`);
|
|
4824
4870
|
}), f(H);
|
|
4825
|
-
} catch (
|
|
4826
|
-
console.error("[Identity] Provider setup error:",
|
|
4871
|
+
} catch (D) {
|
|
4872
|
+
console.error("[Identity] Provider setup error:", D), L(`Setup error: ${D.message}`);
|
|
4827
4873
|
}
|
|
4828
4874
|
}
|
|
4829
4875
|
return () => {
|
|
@@ -4837,15 +4883,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4837
4883
|
}, [h, m, g, F, t, O]);
|
|
4838
4884
|
const E = async () => {
|
|
4839
4885
|
try {
|
|
4840
|
-
|
|
4886
|
+
L(null), T(!1), await v(), j(!0);
|
|
4841
4887
|
} catch (p) {
|
|
4842
4888
|
console.error("Error starting identity verification:", p);
|
|
4843
4889
|
}
|
|
4844
|
-
},
|
|
4890
|
+
}, ee = async () => {
|
|
4845
4891
|
try {
|
|
4846
|
-
|
|
4892
|
+
L(null), T(!1), f(null), console.log("[Identity] Restarting verification..."), await S(), j(!0);
|
|
4847
4893
|
} catch (p) {
|
|
4848
|
-
console.error("Error restarting identity verification:", p),
|
|
4894
|
+
console.error("Error restarting identity verification:", p), L(p.message || "Failed to restart verification");
|
|
4849
4895
|
}
|
|
4850
4896
|
};
|
|
4851
4897
|
if (ae || b)
|
|
@@ -4858,9 +4904,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4858
4904
|
"Error: ",
|
|
4859
4905
|
N.message
|
|
4860
4906
|
] }) }) });
|
|
4861
|
-
if (F && (
|
|
4907
|
+
if (F && (Z || O))
|
|
4862
4908
|
return /* @__PURE__ */ s(W, { children: [
|
|
4863
|
-
/* @__PURE__ */ r(
|
|
4909
|
+
/* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4864
4910
|
/* @__PURE__ */ s(Y, { children: [
|
|
4865
4911
|
/* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ s("div", { className: "flex items-start", children: [
|
|
4866
4912
|
/* @__PURE__ */ r(
|
|
@@ -4883,7 +4929,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4883
4929
|
),
|
|
4884
4930
|
/* @__PURE__ */ s("div", { children: [
|
|
4885
4931
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: O ? "Session Expired" : "Verification Error" }),
|
|
4886
|
-
/* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children:
|
|
4932
|
+
/* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children: Z || "Your verification session has expired and needs to be restarted." })
|
|
4887
4933
|
] })
|
|
4888
4934
|
] }) }),
|
|
4889
4935
|
/* @__PURE__ */ s("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
|
|
@@ -4895,15 +4941,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4895
4941
|
] })
|
|
4896
4942
|
] })
|
|
4897
4943
|
] }),
|
|
4898
|
-
/* @__PURE__ */ s(
|
|
4944
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-between", children: [
|
|
4899
4945
|
n && /* @__PURE__ */ r(J, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4900
|
-
/* @__PURE__ */ r(J, { type: "button", onClick:
|
|
4946
|
+
/* @__PURE__ */ r(J, { type: "button", onClick: ee, disabled: b, children: b ? "Restarting..." : "Restart Verification" })
|
|
4901
4947
|
] })
|
|
4902
4948
|
] });
|
|
4903
4949
|
if (F && u) {
|
|
4904
4950
|
const p = h;
|
|
4905
4951
|
return m != null && m.url ? /* @__PURE__ */ s(W, { children: [
|
|
4906
|
-
/* @__PURE__ */ r(
|
|
4952
|
+
/* @__PURE__ */ r(ke, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
4907
4953
|
/* @__PURE__ */ s("div", { children: [
|
|
4908
4954
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4909
4955
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
@@ -4914,7 +4960,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4914
4960
|
type: "button",
|
|
4915
4961
|
variant: "outline",
|
|
4916
4962
|
size: "sm",
|
|
4917
|
-
onClick:
|
|
4963
|
+
onClick: ee,
|
|
4918
4964
|
disabled: b,
|
|
4919
4965
|
children: "Restart"
|
|
4920
4966
|
}
|
|
@@ -4932,14 +4978,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4932
4978
|
className: "w-full h-full border-0 rounded-lg",
|
|
4933
4979
|
allow: "camera; microphone; geolocation",
|
|
4934
4980
|
title: "Identity Verification",
|
|
4935
|
-
onLoad: (
|
|
4936
|
-
var H,
|
|
4981
|
+
onLoad: (D) => {
|
|
4982
|
+
var H, z, Q;
|
|
4937
4983
|
console.log("[Identity] Iframe loaded");
|
|
4938
4984
|
try {
|
|
4939
|
-
const G =
|
|
4985
|
+
const G = D.target, ce = G.contentDocument || ((H = G.contentWindow) == null ? void 0 : H.document);
|
|
4940
4986
|
if (ce) {
|
|
4941
|
-
const l = ((Q = (
|
|
4942
|
-
(l.includes("expired") || l.includes("invalid") || l.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), T(!0),
|
|
4987
|
+
const l = ((Q = (z = ce.body) == null ? void 0 : z.textContent) == null ? void 0 : Q.toLowerCase()) || "";
|
|
4988
|
+
(l.includes("expired") || l.includes("invalid") || l.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), T(!0), L("Your verification link has expired."));
|
|
4943
4989
|
}
|
|
4944
4990
|
} catch {
|
|
4945
4991
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4948,9 +4994,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4948
4994
|
}
|
|
4949
4995
|
) })
|
|
4950
4996
|
] }),
|
|
4951
|
-
n && /* @__PURE__ */ r(
|
|
4997
|
+
n && /* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ r(J, { variant: "outline", onClick: n, children: "Back" }) })
|
|
4952
4998
|
] }) : p === Pe.SardinAI ? /* @__PURE__ */ s(W, { children: [
|
|
4953
|
-
/* @__PURE__ */ s(
|
|
4999
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
4954
5000
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4955
5001
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4956
5002
|
] }),
|
|
@@ -4960,33 +5006,33 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4960
5006
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
|
|
4961
5007
|
] }) })
|
|
4962
5008
|
] }) : /* @__PURE__ */ s(W, { children: [
|
|
4963
|
-
/* @__PURE__ */ s(
|
|
5009
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
4964
5010
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4965
5011
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4966
5012
|
] }),
|
|
4967
5013
|
/* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4968
|
-
n && /* @__PURE__ */ r(
|
|
5014
|
+
n && /* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ r(J, { variant: "outline", onClick: n, children: "Back" }) })
|
|
4969
5015
|
] });
|
|
4970
5016
|
}
|
|
4971
|
-
const ie = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), oe = (p = 4) => ({ 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" })[p] || "col-span-4",
|
|
4972
|
-
if (!
|
|
5017
|
+
const ie = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), oe = (p = 4) => ({ 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" })[p] || "col-span-4", Ee = (p, D) => {
|
|
5018
|
+
if (!D && D !== 0) return "—";
|
|
4973
5019
|
if (ie.has(p) && p !== "mobileCountryCode") {
|
|
4974
|
-
const H = B.find((
|
|
4975
|
-
return H ? H.label : String(
|
|
5020
|
+
const H = B.find((z) => z.value === D);
|
|
5021
|
+
return H ? H.label : String(D);
|
|
4976
5022
|
}
|
|
4977
|
-
return String(
|
|
5023
|
+
return String(D);
|
|
4978
5024
|
}, He = ({ helpText: p }) => {
|
|
4979
|
-
const [
|
|
5025
|
+
const [D, H] = x(!1), z = ne(null), [, Q] = x({ top: 0, left: 0 });
|
|
4980
5026
|
return /* @__PURE__ */ s(rt, { children: [
|
|
4981
5027
|
/* @__PURE__ */ r(
|
|
4982
5028
|
"button",
|
|
4983
5029
|
{
|
|
4984
5030
|
type: "button",
|
|
4985
5031
|
className: "metakyc-help-btn",
|
|
4986
|
-
ref:
|
|
5032
|
+
ref: z,
|
|
4987
5033
|
onClick: () => {
|
|
4988
|
-
if (
|
|
4989
|
-
const ce =
|
|
5034
|
+
if (z.current) {
|
|
5035
|
+
const ce = z.current.getBoundingClientRect();
|
|
4990
5036
|
Q({ top: ce.bottom + window.scrollY + 6, left: ce.left + window.scrollX });
|
|
4991
5037
|
}
|
|
4992
5038
|
H(!0);
|
|
@@ -5012,7 +5058,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5012
5058
|
children: "?"
|
|
5013
5059
|
}
|
|
5014
5060
|
),
|
|
5015
|
-
|
|
5061
|
+
D && Ot.createPortal(
|
|
5016
5062
|
/* @__PURE__ */ r(
|
|
5017
5063
|
"div",
|
|
5018
5064
|
{
|
|
@@ -5069,11 +5115,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5069
5115
|
document.body
|
|
5070
5116
|
)
|
|
5071
5117
|
] });
|
|
5072
|
-
}, Ae = (p,
|
|
5118
|
+
}, Ae = (p, D) => D ? /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
|
|
5073
5119
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: p }),
|
|
5074
|
-
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(He, { helpText:
|
|
5075
|
-
] }) : p, at = (p,
|
|
5076
|
-
const H = `cf-${
|
|
5120
|
+
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(He, { helpText: D }) })
|
|
5121
|
+
] }) : p, at = (p, D) => {
|
|
5122
|
+
const H = `cf-${D}`, z = p.paramName ?? "", Q = le[z];
|
|
5077
5123
|
if (p.customType === "br")
|
|
5078
5124
|
return /* @__PURE__ */ r("div", { className: oe(p.colSpan), style: { minHeight: "0.5rem" } }, H);
|
|
5079
5125
|
if (p.customType === "paragraph")
|
|
@@ -5118,7 +5164,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5118
5164
|
{
|
|
5119
5165
|
type: "checkbox",
|
|
5120
5166
|
checked: !!G,
|
|
5121
|
-
onChange: (ce) => A((l) => ({ ...l, [
|
|
5167
|
+
onChange: (ce) => A((l) => ({ ...l, [z]: String(ce.target.checked) })),
|
|
5122
5168
|
style: {
|
|
5123
5169
|
width: 16,
|
|
5124
5170
|
height: 16,
|
|
@@ -5138,9 +5184,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5138
5184
|
}
|
|
5139
5185
|
if (p.customType === "group_checkbox") {
|
|
5140
5186
|
const G = Array.isArray(Q) ? Q : Q ? [Q] : [], ce = (l) => {
|
|
5141
|
-
p.singleSelect ? A((c) => ({ ...c, [
|
|
5187
|
+
p.singleSelect ? A((c) => ({ ...c, [z]: G[0] === l ? [] : [l] })) : A((c) => ({
|
|
5142
5188
|
...c,
|
|
5143
|
-
[
|
|
5189
|
+
[z]: G.includes(l) ? G.filter((_) => _ !== l) : [...G, l]
|
|
5144
5190
|
}));
|
|
5145
5191
|
};
|
|
5146
5192
|
return /* @__PURE__ */ r("div", { className: oe(p.colSpan), children: Ae(
|
|
@@ -5170,10 +5216,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5170
5216
|
"input",
|
|
5171
5217
|
{
|
|
5172
5218
|
type: "radio",
|
|
5173
|
-
name: `rg-${
|
|
5219
|
+
name: `rg-${z}`,
|
|
5174
5220
|
value: G.value,
|
|
5175
5221
|
checked: Q === G.value,
|
|
5176
|
-
onChange: () => A((ce) => ({ ...ce, [
|
|
5222
|
+
onChange: () => A((ce) => ({ ...ce, [z]: G.value })),
|
|
5177
5223
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5178
5224
|
}
|
|
5179
5225
|
),
|
|
@@ -5183,77 +5229,77 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5183
5229
|
p.helpText
|
|
5184
5230
|
) }, H) : /* @__PURE__ */ r("div", { className: oe(p.colSpan), children: Ae(
|
|
5185
5231
|
/* @__PURE__ */ r(
|
|
5186
|
-
|
|
5232
|
+
ve,
|
|
5187
5233
|
{
|
|
5188
|
-
label: p.displayText || p.label ||
|
|
5234
|
+
label: p.displayText || p.label || z,
|
|
5189
5235
|
value: String(Q ?? ""),
|
|
5190
|
-
onChange: (G) => A((ce) => ({ ...ce, [
|
|
5236
|
+
onChange: (G) => A((ce) => ({ ...ce, [z]: G.target.value }))
|
|
5191
5237
|
}
|
|
5192
5238
|
),
|
|
5193
5239
|
p.helpText
|
|
5194
5240
|
) }, H);
|
|
5195
|
-
}, dt = (p,
|
|
5196
|
-
if (p.isCustom) return at(p,
|
|
5197
|
-
const H = p.name ?? "",
|
|
5241
|
+
}, dt = (p, D) => {
|
|
5242
|
+
if (p.isCustom) return at(p, D);
|
|
5243
|
+
const H = p.name ?? "", z = Ve[H], Q = p.displayText || (z == null ? void 0 : z.label) || H, G = K[H] ?? "", ce = H === "mobileCountryCode", l = !!(z != null && z.countriesType) && !ce;
|
|
5198
5244
|
return p.editable ? ce ? /* @__PURE__ */ r("div", { className: oe(p.colSpan ?? 2), children: Ae(
|
|
5199
5245
|
/* @__PURE__ */ r(
|
|
5200
5246
|
_e,
|
|
5201
5247
|
{
|
|
5202
5248
|
label: Q,
|
|
5203
5249
|
value: String(G),
|
|
5204
|
-
onChange: (c) =>
|
|
5250
|
+
onChange: (c) => X((_) => ({ ..._, [H]: c })),
|
|
5205
5251
|
options: [{ value: "", label: "Select country code…" }, ...P]
|
|
5206
5252
|
}
|
|
5207
5253
|
),
|
|
5208
5254
|
p.helpText
|
|
5209
|
-
) }, `epc-${
|
|
5255
|
+
) }, `epc-${D}`) : l ? /* @__PURE__ */ r("div", { className: oe(p.colSpan ?? 2), children: Ae(
|
|
5210
5256
|
/* @__PURE__ */ r(
|
|
5211
5257
|
_e,
|
|
5212
5258
|
{
|
|
5213
5259
|
label: Q,
|
|
5214
5260
|
value: String(G),
|
|
5215
|
-
onChange: (c) =>
|
|
5261
|
+
onChange: (c) => X((_) => ({ ..._, [H]: c })),
|
|
5216
5262
|
options: [{ value: "", label: `Select ${Q.toLowerCase()}…` }, ...B]
|
|
5217
5263
|
}
|
|
5218
5264
|
),
|
|
5219
5265
|
p.helpText
|
|
5220
|
-
) }, `ec-${
|
|
5266
|
+
) }, `ec-${D}`) : /* @__PURE__ */ r("div", { className: oe(p.colSpan ?? 2), children: Ae(
|
|
5221
5267
|
/* @__PURE__ */ r(
|
|
5222
|
-
|
|
5268
|
+
ve,
|
|
5223
5269
|
{
|
|
5224
5270
|
label: Q,
|
|
5225
|
-
type: (
|
|
5271
|
+
type: (z == null ? void 0 : z.type) === "date" ? "date" : (z == null ? void 0 : z.type) === "email" ? "email" : "text",
|
|
5226
5272
|
value: String(G),
|
|
5227
|
-
onChange: (c) =>
|
|
5273
|
+
onChange: (c) => X((_) => ({ ..._, [H]: c.target.value }))
|
|
5228
5274
|
}
|
|
5229
5275
|
),
|
|
5230
5276
|
p.helpText
|
|
5231
|
-
) }, `ei-${
|
|
5277
|
+
) }, `ei-${D}`) : /* @__PURE__ */ r("div", { className: oe(p.colSpan ?? 2), children: Ae(
|
|
5232
5278
|
/* @__PURE__ */ s(rt, { children: [
|
|
5233
5279
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: Q }),
|
|
5234
|
-
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children:
|
|
5280
|
+
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Ee(H, G) })
|
|
5235
5281
|
] }),
|
|
5236
5282
|
p.helpText
|
|
5237
|
-
) }, `ro-${
|
|
5283
|
+
) }, `ro-${D}`);
|
|
5238
5284
|
};
|
|
5239
5285
|
if (U) {
|
|
5240
|
-
const p = U.title || "Review Your Information",
|
|
5286
|
+
const p = U.title || "Review Your Information", D = U.subtitle || "Please review and confirm your information before starting identity verification";
|
|
5241
5287
|
return /* @__PURE__ */ r("form", { onSubmit: (H) => {
|
|
5242
5288
|
H.preventDefault(), E();
|
|
5243
5289
|
}, children: /* @__PURE__ */ s(W, { children: [
|
|
5244
|
-
/* @__PURE__ */ s(
|
|
5290
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
5245
5291
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: p }),
|
|
5246
|
-
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
5292
|
+
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: D })
|
|
5247
5293
|
] }),
|
|
5248
|
-
/* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: U.fields.map((H,
|
|
5249
|
-
/* @__PURE__ */ s(
|
|
5294
|
+
/* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: U.fields.map((H, z) => dt(H, z)) }) }),
|
|
5295
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-between", children: [
|
|
5250
5296
|
n && /* @__PURE__ */ r(J, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5251
5297
|
/* @__PURE__ */ r(J, { type: "submit", isLoading: b, children: "Confirm and Start Verification" })
|
|
5252
5298
|
] })
|
|
5253
5299
|
] }) });
|
|
5254
5300
|
}
|
|
5255
5301
|
return /* @__PURE__ */ r("form", { onSubmit: pe.handleSubmit(E), children: /* @__PURE__ */ s(W, { children: [
|
|
5256
|
-
/* @__PURE__ */ s(
|
|
5302
|
+
/* @__PURE__ */ s(ke, { children: [
|
|
5257
5303
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
|
|
5258
5304
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please review and confirm your information before starting identity verification" })
|
|
5259
5305
|
] }),
|
|
@@ -5262,9 +5308,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5262
5308
|
{ label: "Name", value: `${((Ue = R == null ? void 0 : R.applicantRequestData) == null ? void 0 : Ue.firstName) || ""} ${((it = R == null ? void 0 : R.applicantRequestData) == null ? void 0 : it.lastName) || ""}`.trim() },
|
|
5263
5309
|
{ label: "Email", value: (Ze = R == null ? void 0 : R.applicantRequestData) == null ? void 0 : Ze.email },
|
|
5264
5310
|
{ label: "Date of Birth", value: ((st = R == null ? void 0 : R.applicantRequestData) == null ? void 0 : st.dateOfBirth) || "Not provided" }
|
|
5265
|
-
].map(({ label: p, value:
|
|
5311
|
+
].map(({ label: p, value: D }) => /* @__PURE__ */ s("div", { children: [
|
|
5266
5312
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p }),
|
|
5267
|
-
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
5313
|
+
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: D })
|
|
5268
5314
|
] }, p)) }),
|
|
5269
5315
|
/* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
5270
5316
|
/* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
|
|
@@ -5303,17 +5349,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5303
5349
|
)
|
|
5304
5350
|
] }),
|
|
5305
5351
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5306
|
-
/* @__PURE__ */ r(Ke, { control: pe.control, name: "street", render: ({ field: p }) => /* @__PURE__ */ r(
|
|
5307
|
-
/* @__PURE__ */ r(Ke, { control: pe.control, name: "streetNumber", render: ({ field: p }) => /* @__PURE__ */ r(
|
|
5352
|
+
/* @__PURE__ */ r(Ke, { control: pe.control, name: "street", render: ({ field: p }) => /* @__PURE__ */ r(ve, { ...p, label: "Street" }) }),
|
|
5353
|
+
/* @__PURE__ */ r(Ke, { control: pe.control, name: "streetNumber", render: ({ field: p }) => /* @__PURE__ */ r(ve, { ...p, label: "Street Number" }) })
|
|
5308
5354
|
] }),
|
|
5309
5355
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5310
|
-
/* @__PURE__ */ r(Ke, { control: pe.control, name: "city", render: ({ field: p }) => /* @__PURE__ */ r(
|
|
5311
|
-
/* @__PURE__ */ r(Ke, { control: pe.control, name: "zip", render: ({ field: p }) => /* @__PURE__ */ r(
|
|
5356
|
+
/* @__PURE__ */ r(Ke, { control: pe.control, name: "city", render: ({ field: p }) => /* @__PURE__ */ r(ve, { ...p, label: "City" }) }),
|
|
5357
|
+
/* @__PURE__ */ r(Ke, { control: pe.control, name: "zip", render: ({ field: p }) => /* @__PURE__ */ r(ve, { ...p, label: "ZIP / Postal Code" }) })
|
|
5312
5358
|
] }),
|
|
5313
|
-
/* @__PURE__ */ r(Ke, { control: pe.control, name: "phonenumber", render: ({ field: p }) => /* @__PURE__ */ r(
|
|
5359
|
+
/* @__PURE__ */ r(Ke, { control: pe.control, name: "phonenumber", render: ({ field: p }) => /* @__PURE__ */ r(ve, { ...p, label: "Phone Number", type: "tel" }) })
|
|
5314
5360
|
] })
|
|
5315
5361
|
] }),
|
|
5316
|
-
/* @__PURE__ */ s(
|
|
5362
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-between", children: [
|
|
5317
5363
|
n && /* @__PURE__ */ r(J, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5318
5364
|
/* @__PURE__ */ r(J, { type: "submit", isLoading: b, children: "Confirm and Start Verification" })
|
|
5319
5365
|
] })
|
|
@@ -5406,15 +5452,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5406
5452
|
children: /* @__PURE__ */ r("span", { className: `text-5xl ${u.iconColor}`, children: u.icon })
|
|
5407
5453
|
}
|
|
5408
5454
|
) }),
|
|
5409
|
-
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center
|
|
5455
|
+
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center mb-4", style: { color: "var(--metakyc-text-primary, #111827)" }, children: u.title }),
|
|
5410
5456
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
5411
|
-
|
|
5457
|
+
ze,
|
|
5412
5458
|
{
|
|
5413
5459
|
variant: u.type === "success" ? "success" : u.type === "error" ? "danger" : u.type === "pending" ? "warning" : "info",
|
|
5414
5460
|
children: e != null ? We[e] : Ye[t]
|
|
5415
5461
|
}
|
|
5416
5462
|
) }),
|
|
5417
|
-
/* @__PURE__ */ r("p", { className: "text-center
|
|
5463
|
+
/* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a || u.message }),
|
|
5418
5464
|
u.type === "success" && /* @__PURE__ */ s("div", { className: "bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 mb-6", children: [
|
|
5419
5465
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-green-900 dark:text-green-100 mb-2", children: "What's Next?" }),
|
|
5420
5466
|
/* @__PURE__ */ s("ul", { className: "text-sm text-green-800 dark:text-green-200 space-y-1", children: [
|
|
@@ -5440,18 +5486,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5440
5486
|
/* @__PURE__ */ r("li", { children: "• No action is required from you at this time" })
|
|
5441
5487
|
] })
|
|
5442
5488
|
] }),
|
|
5443
|
-
/* @__PURE__ */ r("div", { className: "mt-6 pt-6
|
|
5489
|
+
/* @__PURE__ */ r("div", { className: "mt-6 pt-6", style: { borderTop: "1px solid var(--metakyc-border, #e5e7eb)" }, children: /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
5444
5490
|
/* @__PURE__ */ s("div", { children: [
|
|
5445
|
-
/* @__PURE__ */ r("span", {
|
|
5446
|
-
/* @__PURE__ */ r("div", { className: "font-medium
|
|
5491
|
+
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "KYC Status:" }),
|
|
5492
|
+
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ? We[e] : "Not Available" })
|
|
5447
5493
|
] }),
|
|
5448
5494
|
/* @__PURE__ */ s("div", { children: [
|
|
5449
|
-
/* @__PURE__ */ r("span", {
|
|
5450
|
-
/* @__PURE__ */ r("div", { className: "font-medium
|
|
5495
|
+
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Review Status:" }),
|
|
5496
|
+
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: Ye[t] })
|
|
5451
5497
|
] })
|
|
5452
5498
|
] }) })
|
|
5453
5499
|
] }),
|
|
5454
|
-
/* @__PURE__ */ s(
|
|
5500
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-center gap-4", children: [
|
|
5455
5501
|
u.type === "success" && i && /* @__PURE__ */ r(J, { onClick: i, size: "lg", children: "Continue" }),
|
|
5456
5502
|
u.type === "error" && /* @__PURE__ */ s(rt, { children: [
|
|
5457
5503
|
o && /* @__PURE__ */ r(J, { variant: "outline", onClick: o, children: "Contact Support" }),
|
|
@@ -5460,7 +5506,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5460
5506
|
u.type === "pending" && /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
|
|
5461
5507
|
] })
|
|
5462
5508
|
] });
|
|
5463
|
-
},
|
|
5509
|
+
}, pn = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ r("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ r(
|
|
5464
5510
|
"img",
|
|
5465
5511
|
{
|
|
5466
5512
|
src: e.url,
|
|
@@ -5480,7 +5526,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5480
5526
|
subtitle: t,
|
|
5481
5527
|
className: n = ""
|
|
5482
5528
|
}) => {
|
|
5483
|
-
const { currentTheme: a } =
|
|
5529
|
+
const { currentTheme: a } = Ce(), i = e || (a == null ? void 0 : a.title) || "", o = !!(a != null && a.logo && a.logo.visible && a.logo.url), d = !!i;
|
|
5484
5530
|
return !o && !d ? null : /* @__PURE__ */ s("div", { className: `metakyc-header ${n}`, children: [
|
|
5485
5531
|
/* @__PURE__ */ s(
|
|
5486
5532
|
"div",
|
|
@@ -5488,7 +5534,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5488
5534
|
className: "metakyc-header-title flex items-center text-xl font-bold",
|
|
5489
5535
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5490
5536
|
children: [
|
|
5491
|
-
o && /* @__PURE__ */ r(
|
|
5537
|
+
o && /* @__PURE__ */ r(pn, { config: a.logo }),
|
|
5492
5538
|
o && d && /* @__PURE__ */ r(
|
|
5493
5539
|
"span",
|
|
5494
5540
|
{
|
|
@@ -5639,22 +5685,22 @@ const tt = {
|
|
|
5639
5685
|
),
|
|
5640
5686
|
typeof document < "u" && i ? ht(i, document.body) : null
|
|
5641
5687
|
] });
|
|
5642
|
-
},
|
|
5688
|
+
}, Tn = ({
|
|
5643
5689
|
workflowKey: e,
|
|
5644
5690
|
externalRefId: t,
|
|
5645
5691
|
onSuccess: n,
|
|
5646
5692
|
onCancel: a
|
|
5647
5693
|
}) => {
|
|
5648
|
-
var
|
|
5649
|
-
const { config: i, baseInformationService: o, currentTheme: d } =
|
|
5694
|
+
var D, H, z, Q, G, ce;
|
|
5695
|
+
const { config: i, baseInformationService: o, currentTheme: d } = Ce(), { createApplicant: u, isLoading: h } = Or(), m = e || ((D = i.applicantForm) == null ? void 0 : D.workflowKey);
|
|
5650
5696
|
if (!m)
|
|
5651
5697
|
throw new Error(
|
|
5652
5698
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
5653
5699
|
);
|
|
5654
|
-
const b = t || ((H = i.applicantForm) == null ? void 0 : H.externalRefId) || "", N = ((
|
|
5700
|
+
const b = t || ((H = i.applicantForm) == null ? void 0 : H.externalRefId) || "", N = ((z = i.applicantForm) == null ? void 0 : z.email) || "", v = ((Q = i.applicantForm) == null ? void 0 : Q.hiddenValues) || {}, g = (((G = i.applicantForm) == null ? void 0 : G.fieldLabelMode) || (d == null ? void 0 : d.fieldLabelMode) || "label") !== "placeholder", f = $e(
|
|
5655
5701
|
() => d != null && d.applicantFormPages && d.applicantFormPages.length > 0 ? d.applicantFormPages : null,
|
|
5656
5702
|
[d == null ? void 0 : d.applicantFormPages]
|
|
5657
|
-
), R =
|
|
5703
|
+
), R = $e(() => {
|
|
5658
5704
|
const l = new Set(ot), c = d == null ? void 0 : d.applicantFormRequiredFields;
|
|
5659
5705
|
if (c) for (const _ of c) l.add(_);
|
|
5660
5706
|
if (f)
|
|
@@ -5662,7 +5708,7 @@ const tt = {
|
|
|
5662
5708
|
for (const y of _.fields)
|
|
5663
5709
|
!y.isCustom && y.name && y.required && l.add(y.name);
|
|
5664
5710
|
return Array.from(l);
|
|
5665
|
-
}, [d == null ? void 0 : d.applicantFormRequiredFields, f]), I =
|
|
5711
|
+
}, [d == null ? void 0 : d.applicantFormRequiredFields, f]), I = $e(() => {
|
|
5666
5712
|
var _;
|
|
5667
5713
|
if (f) {
|
|
5668
5714
|
const y = f.flatMap((k) => k.fields).filter((k) => !k.isCustom && k.name).map((k) => k.name), w = new Set(y);
|
|
@@ -5681,7 +5727,7 @@ const tt = {
|
|
|
5681
5727
|
"countryOfBirth",
|
|
5682
5728
|
"mobileCountryCode",
|
|
5683
5729
|
"otherNationality"
|
|
5684
|
-
]), C =
|
|
5730
|
+
]), C = $e(() => {
|
|
5685
5731
|
var c, _;
|
|
5686
5732
|
const l = /* @__PURE__ */ new Set();
|
|
5687
5733
|
if (f)
|
|
@@ -5692,7 +5738,7 @@ const tt = {
|
|
|
5692
5738
|
for (const y of I)
|
|
5693
5739
|
B.has(y) && l.add((_ = Ve[y]) == null ? void 0 : _.countriesType);
|
|
5694
5740
|
return l.size === 0 && l.add(void 0), Array.from(l);
|
|
5695
|
-
}, [I, f]), [P, q] = x({}), [ae,
|
|
5741
|
+
}, [I, f]), [P, q] = x({}), [ae, $] = x(!0), F = ne(/* @__PURE__ */ new Set()), j = ne(/* @__PURE__ */ new Set());
|
|
5696
5742
|
me(() => {
|
|
5697
5743
|
if (!d) return;
|
|
5698
5744
|
const l = C.filter((y) => {
|
|
@@ -5703,19 +5749,19 @@ const tt = {
|
|
|
5703
5749
|
C.every((w) => {
|
|
5704
5750
|
const k = w != null ? String(w) : "all";
|
|
5705
5751
|
return j.current.has(k);
|
|
5706
|
-
}) &&
|
|
5752
|
+
}) && $(!1);
|
|
5707
5753
|
return;
|
|
5708
5754
|
}
|
|
5709
|
-
|
|
5755
|
+
$(!0);
|
|
5710
5756
|
const c = l.map((y) => y != null ? String(y) : "all");
|
|
5711
5757
|
c.forEach((y) => F.current.add(y)), (async () => {
|
|
5712
5758
|
try {
|
|
5713
5759
|
const y = await Promise.all(
|
|
5714
5760
|
l.map(async (w) => {
|
|
5715
|
-
const k = w != null ? String(w) : "all", ue = await o.getCountries("", i.locale || "en", w), se = w === 40,
|
|
5761
|
+
const k = w != null ? String(w) : "all", ue = await o.getCountries("", i.locale || "en", w), se = w === 40, we = /* @__PURE__ */ new Set(), Re = ue.map((he) => se && he.countryCode ? {
|
|
5716
5762
|
value: he.countryCode,
|
|
5717
5763
|
label: `${he.countryCode} – ${he.name}`
|
|
5718
|
-
} : { value: he.abbreviation3 || he.abbreviation, label: he.name }).filter((he) => !he.value ||
|
|
5764
|
+
} : { value: he.abbreviation3 || he.abbreviation, label: he.name }).filter((he) => !he.value || we.has(he.value) ? !1 : (we.add(he.value), !0));
|
|
5719
5765
|
return j.current.add(k), F.current.delete(k), [k, Re];
|
|
5720
5766
|
})
|
|
5721
5767
|
);
|
|
@@ -5726,15 +5772,15 @@ const tt = {
|
|
|
5726
5772
|
C.every((w) => {
|
|
5727
5773
|
const k = w != null ? String(w) : "all";
|
|
5728
5774
|
return j.current.has(k);
|
|
5729
|
-
}) &&
|
|
5775
|
+
}) && $(!1);
|
|
5730
5776
|
}
|
|
5731
5777
|
})();
|
|
5732
5778
|
}, [C, d]);
|
|
5733
|
-
const
|
|
5779
|
+
const Z = (l, c) => {
|
|
5734
5780
|
var w;
|
|
5735
5781
|
const _ = c ?? ((w = Ve[l]) == null ? void 0 : w.countriesType), y = _ != null ? String(_) : "all";
|
|
5736
5782
|
return P[y] || [];
|
|
5737
|
-
},
|
|
5783
|
+
}, L = Object.fromEntries(
|
|
5738
5784
|
Object.entries(v).filter(([l]) => l in {
|
|
5739
5785
|
firstName: 1,
|
|
5740
5786
|
lastName: 1,
|
|
@@ -5784,10 +5830,10 @@ const tt = {
|
|
|
5784
5830
|
educationLevel: "",
|
|
5785
5831
|
occupation: "",
|
|
5786
5832
|
taxNumber: "",
|
|
5787
|
-
...
|
|
5833
|
+
...L
|
|
5788
5834
|
}), M = Object.fromEntries(
|
|
5789
|
-
Object.entries(v).filter(([l]) => !(l in
|
|
5790
|
-
), [K,
|
|
5835
|
+
Object.entries(v).filter(([l]) => !(l in L) && l !== "externalRefId" && l !== "workflowKey")
|
|
5836
|
+
), [K, X] = x({ ...M }), [le, A] = x(0), [U, re] = x({}), [ye, pe] = x(null), [E, ee] = x(!1), ie = (l, c) => T((_) => ({ ..._, [l]: c })), oe = (l, c) => X((_) => ({ ..._, [l]: c })), Ee = (l) => !l.conditionalOn || K[l.conditionalOn] === "true", He = f && le < f.length - 1 ? le + 1 : -1, Ae = f && le > 0 ? le - 1 : -1, at = (l) => {
|
|
5791
5837
|
var _;
|
|
5792
5838
|
const c = {};
|
|
5793
5839
|
for (const y of l.fields)
|
|
@@ -5808,7 +5854,7 @@ const tt = {
|
|
|
5808
5854
|
}, dt = async () => {
|
|
5809
5855
|
if (!f) return;
|
|
5810
5856
|
const l = f[le];
|
|
5811
|
-
if (l.conditionalOn && !
|
|
5857
|
+
if (l.conditionalOn && !Ee(l)) {
|
|
5812
5858
|
re({}), He >= 0 ? A(He) : await Ue();
|
|
5813
5859
|
return;
|
|
5814
5860
|
}
|
|
@@ -5822,13 +5868,13 @@ const tt = {
|
|
|
5822
5868
|
if (f) {
|
|
5823
5869
|
let l = {};
|
|
5824
5870
|
for (const c of f)
|
|
5825
|
-
|
|
5871
|
+
Ee(c) && (l = { ...l, ...at(c) });
|
|
5826
5872
|
if (Object.keys(l).length > 0) {
|
|
5827
5873
|
re(l);
|
|
5828
5874
|
return;
|
|
5829
5875
|
}
|
|
5830
5876
|
}
|
|
5831
|
-
|
|
5877
|
+
ee(!0), pe(null);
|
|
5832
5878
|
try {
|
|
5833
5879
|
if (!O.externalRefId || O.externalRefId.trim() === "") {
|
|
5834
5880
|
pe("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
@@ -5840,7 +5886,7 @@ const tt = {
|
|
|
5840
5886
|
};
|
|
5841
5887
|
if (f) {
|
|
5842
5888
|
for (const w of f)
|
|
5843
|
-
if (
|
|
5889
|
+
if (Ee(w)) {
|
|
5844
5890
|
for (const k of w.fields)
|
|
5845
5891
|
if (!k.isCustom && k.name) {
|
|
5846
5892
|
const ue = k.name, se = O[ue];
|
|
@@ -5861,7 +5907,7 @@ const tt = {
|
|
|
5861
5907
|
const c = [];
|
|
5862
5908
|
if (f) {
|
|
5863
5909
|
for (const w of f)
|
|
5864
|
-
if (
|
|
5910
|
+
if (Ee(w))
|
|
5865
5911
|
for (const k of w.fields) {
|
|
5866
5912
|
if (!k.isCustom || !k.paramName || k.customType === "paragraph" || k.customType === "html" || k.customType === "br" || k.customType === "link") continue;
|
|
5867
5913
|
const ue = K[k.paramName] ?? "";
|
|
@@ -5872,7 +5918,7 @@ const tt = {
|
|
|
5872
5918
|
c.push({ paramName: k.paramName, value: se });
|
|
5873
5919
|
}
|
|
5874
5920
|
}
|
|
5875
|
-
for (const [w, k] of Object.entries(
|
|
5921
|
+
for (const [w, k] of Object.entries(L))
|
|
5876
5922
|
l[w] === void 0 && !Ge(k) && (l[w] = k);
|
|
5877
5923
|
const _ = new Set(c.map((w) => w.paramName));
|
|
5878
5924
|
for (const [w, k] of Object.entries(M))
|
|
@@ -5883,7 +5929,7 @@ const tt = {
|
|
|
5883
5929
|
} catch (l) {
|
|
5884
5930
|
console.error("Error creating applicant:", l), pe(l.message || "Failed to create applicant");
|
|
5885
5931
|
} finally {
|
|
5886
|
-
|
|
5932
|
+
ee(!1);
|
|
5887
5933
|
}
|
|
5888
5934
|
}, it = async (l) => {
|
|
5889
5935
|
var c;
|
|
@@ -5899,11 +5945,11 @@ const tt = {
|
|
|
5899
5945
|
var gt;
|
|
5900
5946
|
const k = Ve[l];
|
|
5901
5947
|
if (!k) return null;
|
|
5902
|
-
const ue = R.includes(l), se = U[l],
|
|
5948
|
+
const ue = R.includes(l), se = U[l], we = _ || k.label, Re = c ?? l, he = { required: ue }, Le = w ? w !== "placeholder" : g, Be = Le ? we : void 0, Pt = Le ? "..." : we;
|
|
5903
5949
|
switch (k.type) {
|
|
5904
5950
|
case "select":
|
|
5905
5951
|
if (l === "country" || l === "nationality" || l === "taxCountry" || l === "countryOfBirth" || l === "mobileCountryCode") {
|
|
5906
|
-
const fe =
|
|
5952
|
+
const fe = Z(l, y);
|
|
5907
5953
|
return /* @__PURE__ */ r(
|
|
5908
5954
|
_e,
|
|
5909
5955
|
{
|
|
@@ -5927,7 +5973,7 @@ const tt = {
|
|
|
5927
5973
|
value: ((gt = O[l]) == null ? void 0 : gt.toString()) || "",
|
|
5928
5974
|
onChange: (fe) => ie(l, fe ? Number(fe) : null),
|
|
5929
5975
|
options: [
|
|
5930
|
-
{ value: "", label: Le ? "Select salutation..." :
|
|
5976
|
+
{ value: "", label: Le ? "Select salutation..." : we },
|
|
5931
5977
|
{ value: ct.Male.toString(), label: "Male" },
|
|
5932
5978
|
{ value: ct.Female.toString(), label: "Female" },
|
|
5933
5979
|
{ value: ct.Other.toString(), label: "Other" }
|
|
@@ -5945,7 +5991,7 @@ const tt = {
|
|
|
5945
5991
|
label: Be,
|
|
5946
5992
|
value: O[l] || "",
|
|
5947
5993
|
onChange: (je) => ie(l, je),
|
|
5948
|
-
options: [{ value: "", label: Le ? "Select language..." :
|
|
5994
|
+
options: [{ value: "", label: Le ? "Select language..." : we }, ...fe],
|
|
5949
5995
|
error: se
|
|
5950
5996
|
},
|
|
5951
5997
|
Re
|
|
@@ -5954,16 +6000,16 @@ const tt = {
|
|
|
5954
6000
|
return null;
|
|
5955
6001
|
case "multiselect":
|
|
5956
6002
|
if (l === "otherNationality") {
|
|
5957
|
-
const fe =
|
|
6003
|
+
const fe = Z(l, y);
|
|
5958
6004
|
return /* @__PURE__ */ r(
|
|
5959
|
-
|
|
6005
|
+
$r,
|
|
5960
6006
|
{
|
|
5961
6007
|
...he,
|
|
5962
6008
|
label: Be,
|
|
5963
6009
|
value: O[l] || [],
|
|
5964
6010
|
onChange: (je) => ie(l, je),
|
|
5965
6011
|
options: fe,
|
|
5966
|
-
placeholder: Le ? "Select other nationalities..." :
|
|
6012
|
+
placeholder: Le ? "Select other nationalities..." : we,
|
|
5967
6013
|
disabled: ae
|
|
5968
6014
|
},
|
|
5969
6015
|
Re
|
|
@@ -5972,12 +6018,12 @@ const tt = {
|
|
|
5972
6018
|
return null;
|
|
5973
6019
|
case "date":
|
|
5974
6020
|
return /* @__PURE__ */ r(
|
|
5975
|
-
|
|
6021
|
+
ve,
|
|
5976
6022
|
{
|
|
5977
6023
|
...he,
|
|
5978
6024
|
type: "date",
|
|
5979
6025
|
label: Be,
|
|
5980
|
-
placeholder: Le ? void 0 :
|
|
6026
|
+
placeholder: Le ? void 0 : we,
|
|
5981
6027
|
value: O[l] || "",
|
|
5982
6028
|
onChange: (fe) => ie(l, fe.target.value),
|
|
5983
6029
|
error: se
|
|
@@ -5986,12 +6032,12 @@ const tt = {
|
|
|
5986
6032
|
);
|
|
5987
6033
|
case "email":
|
|
5988
6034
|
return /* @__PURE__ */ r(
|
|
5989
|
-
|
|
6035
|
+
ve,
|
|
5990
6036
|
{
|
|
5991
6037
|
...he,
|
|
5992
6038
|
type: "email",
|
|
5993
6039
|
label: Be,
|
|
5994
|
-
placeholder: Le ? void 0 :
|
|
6040
|
+
placeholder: Le ? void 0 : we,
|
|
5995
6041
|
value: O[l] || "",
|
|
5996
6042
|
onChange: (fe) => ie(l, fe.target.value),
|
|
5997
6043
|
error: se
|
|
@@ -6000,12 +6046,12 @@ const tt = {
|
|
|
6000
6046
|
);
|
|
6001
6047
|
case "tel":
|
|
6002
6048
|
return /* @__PURE__ */ r(
|
|
6003
|
-
|
|
6049
|
+
ve,
|
|
6004
6050
|
{
|
|
6005
6051
|
...he,
|
|
6006
6052
|
type: "tel",
|
|
6007
6053
|
label: Be,
|
|
6008
|
-
placeholder: Le ? void 0 :
|
|
6054
|
+
placeholder: Le ? void 0 : we,
|
|
6009
6055
|
value: O[l] || "",
|
|
6010
6056
|
onChange: (fe) => ie(l, fe.target.value),
|
|
6011
6057
|
error: se
|
|
@@ -6014,12 +6060,12 @@ const tt = {
|
|
|
6014
6060
|
);
|
|
6015
6061
|
default:
|
|
6016
6062
|
return /* @__PURE__ */ r(
|
|
6017
|
-
|
|
6063
|
+
ve,
|
|
6018
6064
|
{
|
|
6019
6065
|
...he,
|
|
6020
6066
|
type: "text",
|
|
6021
6067
|
label: Be,
|
|
6022
|
-
placeholder: Le ? void 0 :
|
|
6068
|
+
placeholder: Le ? void 0 : we,
|
|
6023
6069
|
value: O[l] || "",
|
|
6024
6070
|
onChange: (fe) => ie(l, fe.target.value),
|
|
6025
6071
|
error: se
|
|
@@ -6190,11 +6236,11 @@ const tt = {
|
|
|
6190
6236
|
{
|
|
6191
6237
|
type: "checkbox",
|
|
6192
6238
|
checked: se,
|
|
6193
|
-
onChange: (
|
|
6239
|
+
onChange: (we) => {
|
|
6194
6240
|
if (l.singleSelect)
|
|
6195
|
-
oe(l.paramName,
|
|
6241
|
+
oe(l.paramName, we.target.checked ? ue.value : "");
|
|
6196
6242
|
else {
|
|
6197
|
-
const Re =
|
|
6243
|
+
const Re = we.target.checked ? [...k, ue.value] : k.filter((he) => he !== ue.value);
|
|
6198
6244
|
oe(l.paramName, Re.join(","));
|
|
6199
6245
|
}
|
|
6200
6246
|
},
|
|
@@ -6261,7 +6307,7 @@ const tt = {
|
|
|
6261
6307
|
)) }),
|
|
6262
6308
|
y && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: y })
|
|
6263
6309
|
] }, `custom-${c}`) : /* @__PURE__ */ r(
|
|
6264
|
-
|
|
6310
|
+
ve,
|
|
6265
6311
|
{
|
|
6266
6312
|
type: "text",
|
|
6267
6313
|
label: _ ? `${w}${l.required ? " *" : ""}` : void 0,
|
|
@@ -6274,7 +6320,7 @@ const tt = {
|
|
|
6274
6320
|
`custom-${c}`
|
|
6275
6321
|
);
|
|
6276
6322
|
}, p = (l, c) => {
|
|
6277
|
-
const _ =
|
|
6323
|
+
const _ = Ee(l);
|
|
6278
6324
|
return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
6279
6325
|
l.conditionalOn && /* @__PURE__ */ r(Nt, { helpText: l.conditionalHelpText, children: /* @__PURE__ */ s(
|
|
6280
6326
|
"label",
|
|
@@ -6315,9 +6361,9 @@ const tt = {
|
|
|
6315
6361
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
6316
6362
|
] }) }) });
|
|
6317
6363
|
if (f) {
|
|
6318
|
-
const l = f[le] ?? f[0], c = Ae === -1, _ = He === -1, y = f.length, w =
|
|
6364
|
+
const l = f[le] ?? f[0], c = Ae === -1, _ = He === -1, y = f.length, w = Ee(l), k = Object.values(U);
|
|
6319
6365
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(W, { children: [
|
|
6320
|
-
/* @__PURE__ */ r(
|
|
6366
|
+
/* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r(pt, { title: (d == null ? void 0 : d.title) || "Create Applicant" }) }),
|
|
6321
6367
|
/* @__PURE__ */ s(Y, { children: [
|
|
6322
6368
|
(l.title || l.subtitle || l.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
6323
6369
|
l.title && /* @__PURE__ */ r(
|
|
@@ -6370,7 +6416,7 @@ const tt = {
|
|
|
6370
6416
|
] }),
|
|
6371
6417
|
p(l)
|
|
6372
6418
|
] }),
|
|
6373
|
-
/* @__PURE__ */ s(
|
|
6419
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-between", children: [
|
|
6374
6420
|
/* @__PURE__ */ s("div", { children: [
|
|
6375
6421
|
!c && /* @__PURE__ */ r(
|
|
6376
6422
|
J,
|
|
@@ -6399,7 +6445,7 @@ const tt = {
|
|
|
6399
6445
|
] }) });
|
|
6400
6446
|
}
|
|
6401
6447
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: it, children: /* @__PURE__ */ s(W, { children: [
|
|
6402
|
-
/* @__PURE__ */ r(
|
|
6448
|
+
/* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r(pt, { title: (d == null ? void 0 : d.title) || "Create Applicant" }) }),
|
|
6403
6449
|
/* @__PURE__ */ s(Y, { children: [
|
|
6404
6450
|
ye && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
|
|
6405
6451
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
@@ -6408,12 +6454,12 @@ const tt = {
|
|
|
6408
6454
|
] }) }),
|
|
6409
6455
|
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: I.map((l) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(l) }, l)) })
|
|
6410
6456
|
] }),
|
|
6411
|
-
/* @__PURE__ */ s(
|
|
6457
|
+
/* @__PURE__ */ s(Ne, { className: "flex justify-between", children: [
|
|
6412
6458
|
a && /* @__PURE__ */ r(J, { type: "button", variant: "outline", onClick: a, disabled: E || h, children: "Cancel" }),
|
|
6413
6459
|
/* @__PURE__ */ r(J, { type: "submit", isLoading: E || h, children: "Create Applicant" })
|
|
6414
6460
|
] })
|
|
6415
6461
|
] }) }) });
|
|
6416
|
-
},
|
|
6462
|
+
}, Ln = ({
|
|
6417
6463
|
applicantId: e,
|
|
6418
6464
|
onComplete: t,
|
|
6419
6465
|
onError: n,
|
|
@@ -6441,39 +6487,40 @@ const tt = {
|
|
|
6441
6487
|
}, [a]), Ie.useEffect(() => {
|
|
6442
6488
|
b && R(!1);
|
|
6443
6489
|
}, [b]), N || !o)
|
|
6444
|
-
return /* @__PURE__ */ r("div", { className: i
|
|
6490
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s(Y, { children: [
|
|
6445
6491
|
/* @__PURE__ */ r(Te, { className: "my-8" }),
|
|
6446
|
-
/* @__PURE__ */ r("p", { className: "text-center
|
|
6492
|
+
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading workflow..." })
|
|
6447
6493
|
] }) }) });
|
|
6448
6494
|
if (v)
|
|
6449
|
-
return /* @__PURE__ */ r("div", { className: i
|
|
6450
|
-
/* @__PURE__ */ r("p", { className: "text-
|
|
6451
|
-
/* @__PURE__ */ r("p", {
|
|
6495
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ s("div", { className: "text-center py-8", children: [
|
|
6496
|
+
/* @__PURE__ */ r("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "An error occurred" }),
|
|
6497
|
+
/* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: v.message })
|
|
6452
6498
|
] }) }) }) });
|
|
6453
6499
|
if (b && !f)
|
|
6454
6500
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ s("div", { className: "text-center py-8", children: [
|
|
6455
|
-
/* @__PURE__ */ r("div", { className: "mb-6", children: /* @__PURE__ */ r("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full
|
|
6456
|
-
/* @__PURE__ */ r("h3", { className: "text-xl font-semibold
|
|
6457
|
-
/* @__PURE__ */ r("p", { className: "
|
|
6458
|
-
/* @__PURE__ */ s("div", { className: "
|
|
6501
|
+
/* @__PURE__ */ r("div", { className: "mb-6", children: /* @__PURE__ */ r("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full mb-4", style: { backgroundColor: "var(--metakyc-primary-light, #dbeafe)" }, children: /* @__PURE__ */ r("svg", { className: "w-8 h-8", style: { color: "var(--metakyc-primary, #2563eb)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("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" }) }) }) }),
|
|
6502
|
+
/* @__PURE__ */ r("h3", { className: "text-xl font-semibold mb-2", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Workflow Transition" }),
|
|
6503
|
+
/* @__PURE__ */ r("p", { className: "mb-6", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Your application workflow has been updated based on your progress." }),
|
|
6504
|
+
/* @__PURE__ */ s("div", { className: "rounded-lg p-4 mb-6 max-w-md mx-auto", style: { backgroundColor: "var(--metakyc-surface, #f9fafb)" }, children: [
|
|
6459
6505
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between text-sm", children: [
|
|
6460
6506
|
/* @__PURE__ */ s("div", { className: "text-left", children: [
|
|
6461
|
-
/* @__PURE__ */ r("p", { className: "
|
|
6462
|
-
/* @__PURE__ */ r("p", { className: "font-medium
|
|
6507
|
+
/* @__PURE__ */ r("p", { className: "mb-1", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Previous Workflow" }),
|
|
6508
|
+
/* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h })
|
|
6463
6509
|
] }),
|
|
6464
|
-
/* @__PURE__ */ r("svg", { className: "w-6 h-6
|
|
6510
|
+
/* @__PURE__ */ r("svg", { className: "w-6 h-6 mx-4", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }),
|
|
6465
6511
|
/* @__PURE__ */ s("div", { className: "text-right", children: [
|
|
6466
|
-
/* @__PURE__ */ r("p", { className: "
|
|
6467
|
-
/* @__PURE__ */ r("p", { className: "font-medium
|
|
6512
|
+
/* @__PURE__ */ r("p", { className: "mb-1", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "New Workflow" }),
|
|
6513
|
+
/* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-primary, #2563eb)" }, children: m })
|
|
6468
6514
|
] })
|
|
6469
6515
|
] }),
|
|
6470
|
-
o.nextWorkflowName && /* @__PURE__ */ r("p", { className: "text-center
|
|
6516
|
+
o.nextWorkflowName && /* @__PURE__ */ r("p", { className: "text-center mt-2 text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o.nextWorkflowName })
|
|
6471
6517
|
] }),
|
|
6472
6518
|
/* @__PURE__ */ r(
|
|
6473
6519
|
"button",
|
|
6474
6520
|
{
|
|
6475
6521
|
onClick: () => R(!0),
|
|
6476
|
-
className: "px-6 py-3
|
|
6522
|
+
className: "px-6 py-3 font-medium rounded-lg transition-opacity hover:opacity-90",
|
|
6523
|
+
style: { backgroundColor: "var(--metakyc-primary, #2563eb)", color: "#ffffff" },
|
|
6477
6524
|
children: "Continue with New Workflow"
|
|
6478
6525
|
}
|
|
6479
6526
|
)
|
|
@@ -6495,7 +6542,7 @@ const tt = {
|
|
|
6495
6542
|
if (!d)
|
|
6496
6543
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s(Y, { children: [
|
|
6497
6544
|
/* @__PURE__ */ r(Te, { className: "my-8" }),
|
|
6498
|
-
/* @__PURE__ */ r("p", { className: "text-center
|
|
6545
|
+
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o.status === Fe.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
6499
6546
|
] }) }) });
|
|
6500
6547
|
const I = (P) => {
|
|
6501
6548
|
switch (P) {
|
|
@@ -6521,35 +6568,45 @@ const tt = {
|
|
|
6521
6568
|
return "";
|
|
6522
6569
|
}
|
|
6523
6570
|
}, B = () => {
|
|
6524
|
-
const P = u.filter((F) => F.visibility !== !1), q = P.findIndex((F) => F.order === d.order), ae = q >= 0 ? q + 1 : 1,
|
|
6571
|
+
const P = u.filter((F) => F.visibility !== !1), q = P.findIndex((F) => F.order === d.order), ae = q >= 0 ? q + 1 : 1, $ = P.length;
|
|
6525
6572
|
return /* @__PURE__ */ s("div", { className: "mb-6", children: [
|
|
6526
6573
|
/* @__PURE__ */ s("div", { className: "flex items-start justify-between mb-4", children: [
|
|
6527
6574
|
/* @__PURE__ */ r(pt, {}),
|
|
6528
|
-
/* @__PURE__ */ s(
|
|
6575
|
+
/* @__PURE__ */ s(ze, { variant: o.status === 1 ? "info" : "success", children: [
|
|
6529
6576
|
"Step ",
|
|
6530
6577
|
ae,
|
|
6531
6578
|
" of ",
|
|
6532
|
-
|
|
6579
|
+
$
|
|
6533
6580
|
] })
|
|
6534
6581
|
] }),
|
|
6535
6582
|
/* @__PURE__ */ r("div", { className: "flex items-center", children: P.map((F, j) => {
|
|
6536
|
-
const
|
|
6583
|
+
const Z = j < q, L = F.order === d.order, O = Z || L;
|
|
6537
6584
|
return /* @__PURE__ */ s(Ie.Fragment, { children: [
|
|
6538
6585
|
/* @__PURE__ */ s("div", { className: "flex items-center", children: [
|
|
6539
6586
|
/* @__PURE__ */ r(
|
|
6540
6587
|
"div",
|
|
6541
6588
|
{
|
|
6542
|
-
className:
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6589
|
+
className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium flex-shrink-0",
|
|
6590
|
+
style: O ? {
|
|
6591
|
+
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
6592
|
+
color: "#ffffff",
|
|
6593
|
+
border: "none"
|
|
6594
|
+
} : {
|
|
6595
|
+
backgroundColor: "transparent",
|
|
6596
|
+
color: "var(--metakyc-text-muted, #9ca3af)",
|
|
6597
|
+
border: "2px solid var(--metakyc-border, #e5e7eb)"
|
|
6598
|
+
},
|
|
6599
|
+
children: Z ? /* @__PURE__ */ r("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : j + 1
|
|
6547
6600
|
}
|
|
6548
6601
|
),
|
|
6549
6602
|
/* @__PURE__ */ r(
|
|
6550
6603
|
"span",
|
|
6551
6604
|
{
|
|
6552
|
-
className:
|
|
6605
|
+
className: "ml-2 text-sm whitespace-nowrap",
|
|
6606
|
+
style: {
|
|
6607
|
+
fontWeight: L ? 600 : 400,
|
|
6608
|
+
color: L ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-muted, #9ca3af)"
|
|
6609
|
+
},
|
|
6553
6610
|
children: F.displayName || F.name || I(F.action) || `Step ${j + 1}`
|
|
6554
6611
|
}
|
|
6555
6612
|
)
|
|
@@ -6557,7 +6614,10 @@ const tt = {
|
|
|
6557
6614
|
j < P.length - 1 && /* @__PURE__ */ r(
|
|
6558
6615
|
"div",
|
|
6559
6616
|
{
|
|
6560
|
-
className:
|
|
6617
|
+
className: "flex-1 h-0.5 mx-3",
|
|
6618
|
+
style: {
|
|
6619
|
+
backgroundColor: Z ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
6620
|
+
}
|
|
6561
6621
|
}
|
|
6562
6622
|
)
|
|
6563
6623
|
] }, F.order);
|
|
@@ -6573,20 +6633,20 @@ const tt = {
|
|
|
6573
6633
|
};
|
|
6574
6634
|
switch (d.action) {
|
|
6575
6635
|
case te.Questionaries:
|
|
6576
|
-
return /* @__PURE__ */ r(Qr, { ...P });
|
|
6577
|
-
case te.UploadDocument:
|
|
6578
6636
|
return /* @__PURE__ */ r(Jr, { ...P });
|
|
6637
|
+
case te.UploadDocument:
|
|
6638
|
+
return /* @__PURE__ */ r(Xr, { ...P });
|
|
6579
6639
|
case te.Overview:
|
|
6580
|
-
return /* @__PURE__ */ r(
|
|
6640
|
+
return /* @__PURE__ */ r(en, { ...P });
|
|
6581
6641
|
case te.IdentitySdk:
|
|
6582
|
-
return /* @__PURE__ */ r(
|
|
6642
|
+
return /* @__PURE__ */ r(mn, { ...P });
|
|
6583
6643
|
case te.RiskScoring:
|
|
6584
|
-
return /* @__PURE__ */ r(
|
|
6644
|
+
return /* @__PURE__ */ r(ln, { ...P });
|
|
6585
6645
|
case te.AdditionalData:
|
|
6586
6646
|
case te.InvestorCategorization:
|
|
6587
|
-
return /* @__PURE__ */ r(
|
|
6647
|
+
return /* @__PURE__ */ r(dn, { ...P });
|
|
6588
6648
|
case te.AppropriatenessTest:
|
|
6589
|
-
return /* @__PURE__ */ r(
|
|
6649
|
+
return /* @__PURE__ */ r(un, { ...P });
|
|
6590
6650
|
case te.ManualReview:
|
|
6591
6651
|
return /* @__PURE__ */ r(
|
|
6592
6652
|
wt,
|
|
@@ -6616,12 +6676,12 @@ const tt = {
|
|
|
6616
6676
|
C()
|
|
6617
6677
|
] });
|
|
6618
6678
|
};
|
|
6619
|
-
function
|
|
6679
|
+
function Dn(e) {
|
|
6620
6680
|
return Oe.object({
|
|
6621
6681
|
questionResults: Oe.any()
|
|
6622
6682
|
}).passthrough();
|
|
6623
6683
|
}
|
|
6624
|
-
function
|
|
6684
|
+
function hn(e) {
|
|
6625
6685
|
let t = Oe.array(Oe.instanceof(File));
|
|
6626
6686
|
if (e.isRequired ? t = t.min(
|
|
6627
6687
|
1,
|
|
@@ -6643,45 +6703,45 @@ function mn(e) {
|
|
|
6643
6703
|
}
|
|
6644
6704
|
return t;
|
|
6645
6705
|
}
|
|
6646
|
-
function
|
|
6706
|
+
function Mn(e) {
|
|
6647
6707
|
const t = {};
|
|
6648
6708
|
return e.uploadDocumentFiles.forEach((n) => {
|
|
6649
6709
|
const a = `file_${n.id}`;
|
|
6650
|
-
t[a] =
|
|
6710
|
+
t[a] = hn(n);
|
|
6651
6711
|
}), Oe.object(t);
|
|
6652
6712
|
}
|
|
6653
|
-
function
|
|
6713
|
+
function On(e) {
|
|
6654
6714
|
return Oe.any();
|
|
6655
6715
|
}
|
|
6656
|
-
function
|
|
6716
|
+
function yn(e) {
|
|
6657
6717
|
return Oe.string().min(1, "This question is required");
|
|
6658
6718
|
}
|
|
6659
|
-
function
|
|
6719
|
+
function Bn(e) {
|
|
6660
6720
|
const t = {};
|
|
6661
6721
|
return e.appropriatenessQuestions.forEach((n) => {
|
|
6662
6722
|
const a = `question_${n.id}`;
|
|
6663
|
-
t[a] =
|
|
6723
|
+
t[a] = yn();
|
|
6664
6724
|
}), Oe.object(t);
|
|
6665
6725
|
}
|
|
6666
|
-
const
|
|
6726
|
+
const zn = Oe.any();
|
|
6667
6727
|
export {
|
|
6668
6728
|
bt as ALLOWED_LANGUAGES,
|
|
6669
|
-
|
|
6729
|
+
zt as ApplicantProgressOnHoldReason,
|
|
6670
6730
|
Fe as ApplicantProgressStatus,
|
|
6671
6731
|
Xt as ApplicantService,
|
|
6672
6732
|
_t as ApplicantStatus,
|
|
6673
6733
|
Wt as AppropriatenessQuestionType,
|
|
6674
6734
|
rr as AppropriatenessTestService,
|
|
6675
|
-
|
|
6676
|
-
|
|
6735
|
+
un as AppropriatenessTestStep,
|
|
6736
|
+
ze as Badge,
|
|
6677
6737
|
sr as BaseInformationService,
|
|
6678
6738
|
J as Button,
|
|
6679
6739
|
W as Card,
|
|
6680
6740
|
Y as CardContent,
|
|
6681
|
-
|
|
6682
|
-
|
|
6741
|
+
Ne as CardFooter,
|
|
6742
|
+
ke as CardHeader,
|
|
6683
6743
|
qe as CountriesType,
|
|
6684
|
-
|
|
6744
|
+
Tn as CreateApplicantForm,
|
|
6685
6745
|
Vt as CriteriaBuiltInType,
|
|
6686
6746
|
Qt as DEFAULT_VISIBLE_FIELDS,
|
|
6687
6747
|
Kt as DocumentReviewStatus,
|
|
@@ -6690,39 +6750,39 @@ export {
|
|
|
6690
6750
|
yr as EventEmitter,
|
|
6691
6751
|
Ve as FIELD_METADATA,
|
|
6692
6752
|
jt as FileType,
|
|
6693
|
-
|
|
6753
|
+
_r as FileUpload,
|
|
6694
6754
|
ct as GenderType,
|
|
6695
6755
|
pt as Header,
|
|
6696
6756
|
Zt as HttpClient,
|
|
6697
6757
|
Qe as IdentityProviderManager,
|
|
6698
6758
|
ir as IdentityService,
|
|
6699
6759
|
Pe as IdentityVerificationProvider,
|
|
6700
|
-
|
|
6701
|
-
|
|
6760
|
+
mn as IdentityVerificationStep,
|
|
6761
|
+
ve as Input,
|
|
6702
6762
|
or as InvestorCategorizationService,
|
|
6703
|
-
|
|
6704
|
-
|
|
6763
|
+
dn as InvestorCategorizationStep,
|
|
6764
|
+
be as InvestorCategorizationType,
|
|
6705
6765
|
qt as InvestorCategoryType,
|
|
6706
6766
|
Ht as KycProcessStatus,
|
|
6707
6767
|
We as KycStatus,
|
|
6708
6768
|
wt as KycStatusDisplay,
|
|
6709
|
-
|
|
6710
|
-
|
|
6769
|
+
Ln as KycWorkflow,
|
|
6770
|
+
pn as Logo,
|
|
6711
6771
|
Ct as MetaKYCContext,
|
|
6712
6772
|
De as MetaKYCError,
|
|
6713
|
-
|
|
6714
|
-
|
|
6773
|
+
Cn as MetaKYCProvider,
|
|
6774
|
+
$r as MultiSelect,
|
|
6715
6775
|
vr as OnfidoProvider,
|
|
6716
6776
|
nr as OverviewService,
|
|
6717
|
-
|
|
6718
|
-
|
|
6777
|
+
en as OverviewStep,
|
|
6778
|
+
Hr as PhoneInput,
|
|
6719
6779
|
er as QuestionnaireService,
|
|
6720
|
-
|
|
6780
|
+
Jr as QuestionnaireStep,
|
|
6721
6781
|
Ye as ReviewStatus,
|
|
6722
6782
|
Yt as RiskCriteriaType,
|
|
6723
|
-
|
|
6783
|
+
$t as RiskLevel,
|
|
6724
6784
|
ar as RiskScoringService,
|
|
6725
|
-
|
|
6785
|
+
ln as RiskScoringStep,
|
|
6726
6786
|
kr as SardinAIProvider,
|
|
6727
6787
|
_e as SearchableSelect,
|
|
6728
6788
|
yt as Select,
|
|
@@ -6730,54 +6790,54 @@ export {
|
|
|
6730
6790
|
fr as StepRouter,
|
|
6731
6791
|
xr as SumsubProvider,
|
|
6732
6792
|
Nr as ThemeManager,
|
|
6733
|
-
|
|
6793
|
+
xe as ThemePreset,
|
|
6734
6794
|
hr as ThemeService,
|
|
6735
6795
|
tr as UploadDocumentService,
|
|
6736
|
-
|
|
6796
|
+
Xr as UploadDocumentStep,
|
|
6737
6797
|
Ut as UserType,
|
|
6738
6798
|
Me as ValueDataType,
|
|
6739
6799
|
br as WorkflowOrchestrator,
|
|
6740
6800
|
lt as WorkflowResultType,
|
|
6741
6801
|
gr as WorkflowState,
|
|
6742
6802
|
te as WorkflowStepAction,
|
|
6743
|
-
|
|
6744
|
-
|
|
6803
|
+
zn as appropriatenessTestSchema,
|
|
6804
|
+
Pn as clearAllStorage,
|
|
6745
6805
|
Ir as clearApplicantId,
|
|
6746
6806
|
Rr as clearWorkflowState,
|
|
6747
6807
|
ge as cn,
|
|
6748
6808
|
lr as corporateTheme,
|
|
6749
6809
|
Gt as defaultConfig,
|
|
6750
|
-
|
|
6810
|
+
Se as defaultTheme,
|
|
6751
6811
|
Sr as fileToBase64,
|
|
6752
6812
|
cr as fintechTheme,
|
|
6753
6813
|
ut as formatFileSize,
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6814
|
+
Bn as generateAppropriatenessSchema,
|
|
6815
|
+
Dn as generateQuestionnaireSchema,
|
|
6816
|
+
On as generateRiskScoringSchema,
|
|
6817
|
+
Mn as generateUploadDocumentSchema,
|
|
6818
|
+
An as getAcceptString,
|
|
6759
6819
|
Er as getApplicantId,
|
|
6760
6820
|
et as getThemePreset,
|
|
6761
|
-
|
|
6821
|
+
Rn as getWorkflowState,
|
|
6762
6822
|
dr as healthcareTheme,
|
|
6763
|
-
|
|
6823
|
+
Nn as isScriptLoaded,
|
|
6764
6824
|
St as loadScript,
|
|
6765
6825
|
mr as minimalTheme,
|
|
6766
6826
|
ur as modernTheme,
|
|
6767
|
-
|
|
6827
|
+
Sn as removeScript,
|
|
6768
6828
|
Cr as saveApplicantId,
|
|
6769
6829
|
Ar as saveWorkflowState,
|
|
6770
6830
|
pr as themePresets,
|
|
6771
6831
|
Or as useApplicant,
|
|
6772
|
-
|
|
6832
|
+
Fn as useAppropriatenessTest,
|
|
6773
6833
|
Dr as useIdentityVerification,
|
|
6774
6834
|
Pr as useKycWorkflow,
|
|
6775
|
-
|
|
6835
|
+
Ce as useMetaKYC,
|
|
6776
6836
|
Lr as useOverview,
|
|
6777
6837
|
Fr as useQuestionnaire,
|
|
6778
6838
|
Mr as useRiskScoring,
|
|
6779
6839
|
Tr as useUploadDocument,
|
|
6780
|
-
|
|
6781
|
-
|
|
6840
|
+
En as validateFileSize,
|
|
6841
|
+
In as validateFileType
|
|
6782
6842
|
};
|
|
6783
6843
|
//# sourceMappingURL=index.js.map
|