@vpdev2/metakyc-sdk 1.0.51 → 1.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -4,10 +4,10 @@ var te = (e, t, n) => ft(e, typeof t != "symbol" ? t + "" : t, n);
|
|
|
4
4
|
import xt from "axios";
|
|
5
5
|
import * as tt from "react";
|
|
6
6
|
import fe, { createContext as bt, useState as v, useMemo as Ae, useEffect as re, useContext as vt, useRef as X, useCallback as Q, forwardRef as Ue, createElement as Qe } from "react";
|
|
7
|
-
import { jsx as r, jsxs as i, Fragment as
|
|
7
|
+
import { jsx as r, jsxs as i, Fragment as kt } from "react/jsx-runtime";
|
|
8
8
|
import { createPortal as ot } from "react-dom";
|
|
9
|
-
import { useForm as
|
|
10
|
-
import { z as
|
|
9
|
+
import { useForm as wt, Controller as Re } from "react-hook-form";
|
|
10
|
+
import { z as Ne } from "zod";
|
|
11
11
|
var G = /* @__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))(G || {}), qe = /* @__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))(qe || {}), be = /* @__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))(be || {}), Nt = /* @__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))(Nt || {}), St = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(St || {}), Pe = /* @__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))(Pe || {}), De = /* @__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))(De || {}), Ct = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Ct || {}), At = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(At || {}), xe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(xe || {}), Et = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Et || {}), Ke = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ke || {}), It = /* @__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))(It || {}), Rt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Rt || {}), Pt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Pt || {}), Ee = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ee || {}), Dt = /* @__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))(Dt || {}), Ft = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Ft || {}), ge = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(ge || {}), Lt = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Lt || {});
|
|
12
12
|
const Fe = {
|
|
13
13
|
Nationality: 10,
|
|
@@ -119,7 +119,7 @@ class we extends Error {
|
|
|
119
119
|
this.code = a, this.details = s, this.validationErrors = o, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this, we.prototype);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
class
|
|
122
|
+
class $e {
|
|
123
123
|
/**
|
|
124
124
|
* Process an error from the API response
|
|
125
125
|
*/
|
|
@@ -169,7 +169,7 @@ class ze {
|
|
|
169
169
|
return t instanceof we;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
class
|
|
172
|
+
class $t {
|
|
173
173
|
constructor(t) {
|
|
174
174
|
te(this, "axiosInstance");
|
|
175
175
|
te(this, "endpointBuilder");
|
|
@@ -210,7 +210,7 @@ class zt {
|
|
|
210
210
|
});
|
|
211
211
|
return this.handleResponse(o);
|
|
212
212
|
} catch (s) {
|
|
213
|
-
throw
|
|
213
|
+
throw $e.handleAxiosError(s);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
@@ -221,7 +221,7 @@ class zt {
|
|
|
221
221
|
const s = this.buildEndpoint(t, n), o = await this.axiosInstance.post(s, a);
|
|
222
222
|
return this.handleResponse(o);
|
|
223
223
|
} catch (s) {
|
|
224
|
-
throw
|
|
224
|
+
throw $e.handleAxiosError(s);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
@@ -232,7 +232,7 @@ class zt {
|
|
|
232
232
|
const s = this.buildEndpoint(t, n), o = await this.axiosInstance.put(s, a);
|
|
233
233
|
return this.handleResponse(o);
|
|
234
234
|
} catch (s) {
|
|
235
|
-
throw
|
|
235
|
+
throw $e.handleAxiosError(s);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
@@ -245,7 +245,7 @@ class zt {
|
|
|
245
245
|
});
|
|
246
246
|
return this.handleResponse(o);
|
|
247
247
|
} catch (s) {
|
|
248
|
-
throw
|
|
248
|
+
throw $e.handleAxiosError(s);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
/**
|
|
@@ -254,7 +254,7 @@ class zt {
|
|
|
254
254
|
handleResponse(t) {
|
|
255
255
|
const n = t.data;
|
|
256
256
|
if (!n.success && n.error)
|
|
257
|
-
throw
|
|
257
|
+
throw $e.handleApiError(n.error);
|
|
258
258
|
return n;
|
|
259
259
|
}
|
|
260
260
|
/**
|
|
@@ -264,7 +264,7 @@ class zt {
|
|
|
264
264
|
return this.axiosInstance;
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
class
|
|
267
|
+
class zt {
|
|
268
268
|
constructor(t) {
|
|
269
269
|
this.httpClient = t;
|
|
270
270
|
}
|
|
@@ -383,7 +383,7 @@ class Bt {
|
|
|
383
383
|
)).result;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
class
|
|
386
|
+
class Bt {
|
|
387
387
|
constructor(t) {
|
|
388
388
|
this.httpClient = t;
|
|
389
389
|
}
|
|
@@ -879,7 +879,7 @@ const ue = {
|
|
|
879
879
|
[ce.Modern]: Vt,
|
|
880
880
|
[ce.Minimal]: Zt
|
|
881
881
|
};
|
|
882
|
-
function
|
|
882
|
+
function ze(e) {
|
|
883
883
|
return Jt[e] || ue;
|
|
884
884
|
}
|
|
885
885
|
class Xt {
|
|
@@ -897,8 +897,8 @@ class Xt {
|
|
|
897
897
|
"GetThemeConfiguration"
|
|
898
898
|
);
|
|
899
899
|
if (!n.result.isEnabled)
|
|
900
|
-
return
|
|
901
|
-
let a = n.result.preset ?
|
|
900
|
+
return ze(ce.Default);
|
|
901
|
+
let a = n.result.preset ? ze(n.result.preset) : ze(ce.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,
|
|
@@ -921,7 +921,7 @@ class Xt {
|
|
|
921
921
|
}
|
|
922
922
|
return a;
|
|
923
923
|
} catch (n) {
|
|
924
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", n),
|
|
924
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", n), ze(ce.Default);
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
927
|
/**
|
|
@@ -947,7 +947,7 @@ class Xt {
|
|
|
947
947
|
* Preview theme (doesn't save)
|
|
948
948
|
*/
|
|
949
949
|
getPreviewTheme(t, n) {
|
|
950
|
-
const a =
|
|
950
|
+
const a = ze(t);
|
|
951
951
|
return n ? {
|
|
952
952
|
...a,
|
|
953
953
|
...n,
|
|
@@ -1788,7 +1788,7 @@ class or {
|
|
|
1788
1788
|
}
|
|
1789
1789
|
const ct = bt(null), nn = ({ config: e, children: t }) => {
|
|
1790
1790
|
const [n, a] = v(null), s = fe.useRef(!1), o = fe.useRef(!1), l = Ae(() => {
|
|
1791
|
-
const u = new
|
|
1791
|
+
const u = new $t(e), m = new zt(u), x = new Bt(u), p = new _t(u), y = new Ut(u), g = new Ht(u), h = new qt(u), C = new Kt(u), F = new jt(u), k = new Wt(u), O = new Xt(u), E = new or();
|
|
1792
1792
|
return {
|
|
1793
1793
|
httpClient: u,
|
|
1794
1794
|
applicantService: m,
|
|
@@ -1797,11 +1797,11 @@ const ct = bt(null), nn = ({ config: e, children: t }) => {
|
|
|
1797
1797
|
appropriatenessTestService: y,
|
|
1798
1798
|
overviewService: g,
|
|
1799
1799
|
riskScoringService: h,
|
|
1800
|
-
identityService:
|
|
1800
|
+
identityService: C,
|
|
1801
1801
|
baseInformationService: F,
|
|
1802
|
-
investorCategorizationService:
|
|
1803
|
-
themeService:
|
|
1804
|
-
themeManager:
|
|
1802
|
+
investorCategorizationService: k,
|
|
1803
|
+
themeService: O,
|
|
1804
|
+
themeManager: E
|
|
1805
1805
|
};
|
|
1806
1806
|
}, [e]), c = Ae(() => ({
|
|
1807
1807
|
config: e,
|
|
@@ -1935,10 +1935,10 @@ function hr(e) {
|
|
|
1935
1935
|
re(() => {
|
|
1936
1936
|
u.current || (u.current = t());
|
|
1937
1937
|
}, [t]), re(() => {
|
|
1938
|
-
var
|
|
1938
|
+
var E;
|
|
1939
1939
|
n && m && (cr(m), mr({
|
|
1940
1940
|
applicantId: m,
|
|
1941
|
-
currentStepOrder: (
|
|
1941
|
+
currentStepOrder: (E = n.currentStep) == null ? void 0 : E.order,
|
|
1942
1942
|
status: n.status,
|
|
1943
1943
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1944
1944
|
workflowKey: n.workFlowKey,
|
|
@@ -1953,10 +1953,10 @@ function hr(e) {
|
|
|
1953
1953
|
}
|
|
1954
1954
|
x.current = !0, o(!0), c(null);
|
|
1955
1955
|
try {
|
|
1956
|
-
const
|
|
1957
|
-
a(
|
|
1958
|
-
} catch (
|
|
1959
|
-
c(
|
|
1956
|
+
const E = await u.current.initialize(m);
|
|
1957
|
+
a(E), p.current = !0;
|
|
1958
|
+
} catch (E) {
|
|
1959
|
+
c(E);
|
|
1960
1960
|
} finally {
|
|
1961
1961
|
o(!1), x.current = !1;
|
|
1962
1962
|
}
|
|
@@ -1973,10 +1973,10 @@ function hr(e) {
|
|
|
1973
1973
|
}
|
|
1974
1974
|
x.current = !0, o(!0), c(null);
|
|
1975
1975
|
try {
|
|
1976
|
-
const
|
|
1977
|
-
a(
|
|
1978
|
-
} catch (
|
|
1979
|
-
c(
|
|
1976
|
+
const E = await u.current.refreshProgress();
|
|
1977
|
+
a(E);
|
|
1978
|
+
} catch (E) {
|
|
1979
|
+
c(E);
|
|
1980
1980
|
} finally {
|
|
1981
1981
|
o(!1), x.current = !1;
|
|
1982
1982
|
}
|
|
@@ -1985,64 +1985,64 @@ function hr(e) {
|
|
|
1985
1985
|
if (u.current) {
|
|
1986
1986
|
o(!0), c(null);
|
|
1987
1987
|
try {
|
|
1988
|
-
const
|
|
1989
|
-
a(
|
|
1990
|
-
} catch (
|
|
1991
|
-
c(
|
|
1988
|
+
const E = await u.current.moveToNextStep();
|
|
1989
|
+
a(E);
|
|
1990
|
+
} catch (E) {
|
|
1991
|
+
c(E);
|
|
1992
1992
|
} finally {
|
|
1993
1993
|
o(!1);
|
|
1994
1994
|
}
|
|
1995
1995
|
}
|
|
1996
|
-
}, []),
|
|
1996
|
+
}, []), C = Q(async () => {
|
|
1997
1997
|
if (u.current) {
|
|
1998
1998
|
o(!0), c(null);
|
|
1999
1999
|
try {
|
|
2000
|
-
const
|
|
2001
|
-
a(
|
|
2002
|
-
} catch (
|
|
2003
|
-
c(
|
|
2000
|
+
const E = await u.current.moveToPreviousStep();
|
|
2001
|
+
a(E);
|
|
2002
|
+
} catch (E) {
|
|
2003
|
+
c(E);
|
|
2004
2004
|
} finally {
|
|
2005
2005
|
o(!1);
|
|
2006
2006
|
}
|
|
2007
2007
|
}
|
|
2008
|
-
}, []), F = Q(async (
|
|
2008
|
+
}, []), F = Q(async (E) => {
|
|
2009
2009
|
if (u.current) {
|
|
2010
2010
|
o(!0), c(null);
|
|
2011
2011
|
try {
|
|
2012
|
-
await u.current.submitCurrentStep(
|
|
2013
|
-
const
|
|
2014
|
-
a(
|
|
2015
|
-
} catch (
|
|
2016
|
-
throw c(
|
|
2012
|
+
await u.current.submitCurrentStep(E);
|
|
2013
|
+
const R = await u.current.refreshProgress();
|
|
2014
|
+
a(R);
|
|
2015
|
+
} catch (R) {
|
|
2016
|
+
throw c(R), R;
|
|
2017
2017
|
} finally {
|
|
2018
2018
|
o(!1);
|
|
2019
2019
|
}
|
|
2020
2020
|
}
|
|
2021
|
-
}, []),
|
|
2021
|
+
}, []), k = tt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((E, R) => E.order - R.order) : [], [n == null ? void 0 : n.stepInfoList]), O = tt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2022
2022
|
return {
|
|
2023
2023
|
progress: n,
|
|
2024
2024
|
applicantId: m,
|
|
2025
2025
|
currentStep: (n == null ? void 0 : n.currentStep) || null,
|
|
2026
|
-
steps:
|
|
2026
|
+
steps: k,
|
|
2027
2027
|
status: (n == null ? void 0 : n.status) || be.None,
|
|
2028
2028
|
workflowResult: (n == null ? void 0 : n.workflowResult) || null,
|
|
2029
2029
|
workflowKey: n == null ? void 0 : n.workFlowKey,
|
|
2030
2030
|
nextWorkflowKey: n == null ? void 0 : n.nextWorkflowKey,
|
|
2031
|
-
hasWorkflowChanged:
|
|
2031
|
+
hasWorkflowChanged: O,
|
|
2032
2032
|
isLoading: s,
|
|
2033
2033
|
error: l,
|
|
2034
2034
|
isComplete: (n == null ? void 0 : n.status) === be.Finished,
|
|
2035
2035
|
isOnHold: (n == null ? void 0 : n.status) === be.OnHold,
|
|
2036
2036
|
refreshProgress: g,
|
|
2037
2037
|
moveToNext: h,
|
|
2038
|
-
moveBack:
|
|
2038
|
+
moveBack: C,
|
|
2039
2039
|
submitCurrentStep: F,
|
|
2040
2040
|
orchestrator: u.current
|
|
2041
2041
|
};
|
|
2042
2042
|
}
|
|
2043
2043
|
function gr(e) {
|
|
2044
|
-
const { questionnaireService: t, applicantService: n } = ye(), [a, s] = v(null), [o, l] = v({}), [c, u] = v(!1), [m, x] = v(!1), [p, y] = v(null), g = X(!1), h = X(null),
|
|
2045
|
-
var
|
|
2044
|
+
const { questionnaireService: t, applicantService: n } = ye(), [a, s] = v(null), [o, l] = v({}), [c, u] = v(!1), [m, x] = v(!1), [p, y] = v(null), g = X(!1), h = X(null), C = Q(async () => {
|
|
2045
|
+
var k, O;
|
|
2046
2046
|
if (e) {
|
|
2047
2047
|
if (g.current) {
|
|
2048
2048
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
@@ -2050,39 +2050,39 @@ function gr(e) {
|
|
|
2050
2050
|
}
|
|
2051
2051
|
g.current = !0, u(!0), y(null);
|
|
2052
2052
|
try {
|
|
2053
|
-
const [
|
|
2053
|
+
const [E, R] = await Promise.all([
|
|
2054
2054
|
t.getQuestionnaire(e),
|
|
2055
2055
|
n.getApplicantData(e).catch(() => null)
|
|
2056
2056
|
]);
|
|
2057
|
-
if (s(
|
|
2057
|
+
if (s(E), (k = R == null ? void 0 : R.questionnaireResults) != null && k.length && E) {
|
|
2058
2058
|
const H = /* @__PURE__ */ new Map();
|
|
2059
|
-
for (const
|
|
2060
|
-
|
|
2061
|
-
const J = {}, f =
|
|
2062
|
-
for (const
|
|
2063
|
-
const
|
|
2064
|
-
H.has(
|
|
2059
|
+
for (const w of R.questionnaireResults)
|
|
2060
|
+
w.question && ((O = w.answers) != null && O.length) && H.set(w.question.trim().toLowerCase(), w.answers);
|
|
2061
|
+
const J = {}, f = E.questionGroups.flatMap((w) => w.questions ?? []);
|
|
2062
|
+
for (const w of f) {
|
|
2063
|
+
const I = w.text.trim().toLowerCase();
|
|
2064
|
+
H.has(I) && (J[w.id] = H.get(I));
|
|
2065
2065
|
}
|
|
2066
2066
|
l(J);
|
|
2067
2067
|
}
|
|
2068
2068
|
h.current = e;
|
|
2069
|
-
} catch (
|
|
2070
|
-
y(
|
|
2069
|
+
} catch (E) {
|
|
2070
|
+
y(E);
|
|
2071
2071
|
} finally {
|
|
2072
2072
|
u(!1), g.current = !1;
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
2075
2075
|
}, [e, t, n]);
|
|
2076
2076
|
re(() => {
|
|
2077
|
-
e && h.current !== e &&
|
|
2077
|
+
e && h.current !== e && C();
|
|
2078
2078
|
}, [e]);
|
|
2079
2079
|
const F = Q(
|
|
2080
|
-
async (
|
|
2080
|
+
async (k) => {
|
|
2081
2081
|
x(!0), y(null);
|
|
2082
2082
|
try {
|
|
2083
|
-
return await t.fillQuestionnaire(
|
|
2084
|
-
} catch (
|
|
2085
|
-
throw y(
|
|
2083
|
+
return await t.fillQuestionnaire(k);
|
|
2084
|
+
} catch (O) {
|
|
2085
|
+
throw y(O), O;
|
|
2086
2086
|
} finally {
|
|
2087
2087
|
x(!1);
|
|
2088
2088
|
}
|
|
@@ -2095,7 +2095,7 @@ function gr(e) {
|
|
|
2095
2095
|
isLoading: c,
|
|
2096
2096
|
isSubmitting: m,
|
|
2097
2097
|
error: p,
|
|
2098
|
-
load:
|
|
2098
|
+
load: C,
|
|
2099
2099
|
submit: F
|
|
2100
2100
|
};
|
|
2101
2101
|
}
|
|
@@ -2120,13 +2120,13 @@ function yr(e) {
|
|
|
2120
2120
|
re(() => {
|
|
2121
2121
|
e && g.current !== e && h();
|
|
2122
2122
|
}, [e]);
|
|
2123
|
-
const
|
|
2123
|
+
const C = Q(
|
|
2124
2124
|
async (F) => {
|
|
2125
2125
|
c(!0), m(0), p(null);
|
|
2126
2126
|
try {
|
|
2127
2127
|
await t.fillUploadDocument(F), m(100);
|
|
2128
|
-
} catch (
|
|
2129
|
-
throw p(
|
|
2128
|
+
} catch (k) {
|
|
2129
|
+
throw p(k), k;
|
|
2130
2130
|
} finally {
|
|
2131
2131
|
c(!1);
|
|
2132
2132
|
}
|
|
@@ -2140,7 +2140,7 @@ function yr(e) {
|
|
|
2140
2140
|
uploadProgress: u,
|
|
2141
2141
|
error: x,
|
|
2142
2142
|
load: h,
|
|
2143
|
-
submit:
|
|
2143
|
+
submit: C
|
|
2144
2144
|
};
|
|
2145
2145
|
}
|
|
2146
2146
|
function dn(e) {
|
|
@@ -2164,14 +2164,14 @@ function dn(e) {
|
|
|
2164
2164
|
re(() => {
|
|
2165
2165
|
e && g.current !== e && h();
|
|
2166
2166
|
}, [e]);
|
|
2167
|
-
const
|
|
2167
|
+
const C = Q(
|
|
2168
2168
|
async (F) => {
|
|
2169
2169
|
c(!0), m(null);
|
|
2170
2170
|
try {
|
|
2171
|
-
const
|
|
2172
|
-
return p(
|
|
2173
|
-
} catch (
|
|
2174
|
-
throw m(
|
|
2171
|
+
const k = await t.fillAppropriatenessTest(F);
|
|
2172
|
+
return p(k), k;
|
|
2173
|
+
} catch (k) {
|
|
2174
|
+
throw m(k), k;
|
|
2175
2175
|
} finally {
|
|
2176
2176
|
c(!1);
|
|
2177
2177
|
}
|
|
@@ -2185,7 +2185,7 @@ function dn(e) {
|
|
|
2185
2185
|
isSubmitting: l,
|
|
2186
2186
|
error: u,
|
|
2187
2187
|
load: h,
|
|
2188
|
-
submit:
|
|
2188
|
+
submit: C
|
|
2189
2189
|
};
|
|
2190
2190
|
}
|
|
2191
2191
|
function fr(e) {
|
|
@@ -2250,8 +2250,8 @@ function xr(e) {
|
|
|
2250
2250
|
// Default: 7 days
|
|
2251
2251
|
};
|
|
2252
2252
|
console.log("Identity request input:", h);
|
|
2253
|
-
const
|
|
2254
|
-
return console.log("Identity request result:",
|
|
2253
|
+
const C = await t.identityRequest(h);
|
|
2254
|
+
return console.log("Identity request result:", C), a(C), C;
|
|
2255
2255
|
} catch (h) {
|
|
2256
2256
|
throw c(h), h;
|
|
2257
2257
|
} finally {
|
|
@@ -2270,8 +2270,8 @@ function xr(e) {
|
|
|
2270
2270
|
restart: !1,
|
|
2271
2271
|
redirectUrl: y,
|
|
2272
2272
|
ttl: g
|
|
2273
|
-
},
|
|
2274
|
-
return a(
|
|
2273
|
+
}, C = await t.identityCompanyRequest(h);
|
|
2274
|
+
return a(C), C;
|
|
2275
2275
|
} catch (h) {
|
|
2276
2276
|
throw c(h), h;
|
|
2277
2277
|
} finally {
|
|
@@ -2317,49 +2317,49 @@ function xr(e) {
|
|
|
2317
2317
|
};
|
|
2318
2318
|
}
|
|
2319
2319
|
function br(e) {
|
|
2320
|
-
const { riskScoringService: t, applicantService: n } = ye(), [a, s] = v(null), [o, l] = v({}), [c, u] = v(!1), [m, x] = v(!1), [p, y] = v(null), [g, h] = v(null),
|
|
2321
|
-
var
|
|
2320
|
+
const { riskScoringService: t, applicantService: n } = ye(), [a, s] = v(null), [o, l] = v({}), [c, u] = v(!1), [m, x] = v(!1), [p, y] = v(null), [g, h] = v(null), C = X(!1), F = X(null), k = Q(async () => {
|
|
2321
|
+
var E;
|
|
2322
2322
|
if (e) {
|
|
2323
|
-
if (
|
|
2323
|
+
if (C.current) {
|
|
2324
2324
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
2325
2325
|
return;
|
|
2326
2326
|
}
|
|
2327
|
-
|
|
2327
|
+
C.current = !0, u(!0), y(null);
|
|
2328
2328
|
try {
|
|
2329
|
-
const [
|
|
2329
|
+
const [R, H] = await Promise.all([
|
|
2330
2330
|
t.getRiskCriterias(e),
|
|
2331
2331
|
n.getApplicantData(e).catch(() => null)
|
|
2332
2332
|
]);
|
|
2333
|
-
if (s(
|
|
2333
|
+
if (s(R), (E = H == null ? void 0 : H.riskScoringResults) != null && E.length) {
|
|
2334
2334
|
const J = H.riskScoringResults[0], f = {};
|
|
2335
|
-
for (const
|
|
2336
|
-
if (
|
|
2337
|
-
const
|
|
2338
|
-
|
|
2335
|
+
for (const w of J.riskCriteriaResults ?? [])
|
|
2336
|
+
if (w.riskCriteriaId != null && w.answer != null && w.answer !== "") {
|
|
2337
|
+
const I = [...new Set(
|
|
2338
|
+
w.answer.split(",").map(($) => $.trim()).filter(($) => $ !== "")
|
|
2339
2339
|
)];
|
|
2340
|
-
|
|
2340
|
+
I.length > 0 && (f[w.riskCriteriaId] = I);
|
|
2341
2341
|
}
|
|
2342
2342
|
l(f);
|
|
2343
2343
|
}
|
|
2344
2344
|
F.current = e;
|
|
2345
|
-
} catch (
|
|
2346
|
-
y(
|
|
2345
|
+
} catch (R) {
|
|
2346
|
+
y(R);
|
|
2347
2347
|
} finally {
|
|
2348
|
-
u(!1),
|
|
2348
|
+
u(!1), C.current = !1;
|
|
2349
2349
|
}
|
|
2350
2350
|
}
|
|
2351
2351
|
}, [e, t, n]);
|
|
2352
2352
|
re(() => {
|
|
2353
|
-
e && F.current !== e &&
|
|
2353
|
+
e && F.current !== e && k();
|
|
2354
2354
|
}, [e]);
|
|
2355
|
-
const
|
|
2356
|
-
async (
|
|
2355
|
+
const O = Q(
|
|
2356
|
+
async (E) => {
|
|
2357
2357
|
x(!0), y(null);
|
|
2358
2358
|
try {
|
|
2359
|
-
const
|
|
2360
|
-
return h(
|
|
2361
|
-
} catch (
|
|
2362
|
-
throw y(
|
|
2359
|
+
const R = await t.submitRiskScoring(E);
|
|
2360
|
+
return h(R), R;
|
|
2361
|
+
} catch (R) {
|
|
2362
|
+
throw y(R), R;
|
|
2363
2363
|
} finally {
|
|
2364
2364
|
x(!1);
|
|
2365
2365
|
}
|
|
@@ -2373,8 +2373,8 @@ function br(e) {
|
|
|
2373
2373
|
isLoading: c,
|
|
2374
2374
|
isSubmitting: m,
|
|
2375
2375
|
error: p,
|
|
2376
|
-
load:
|
|
2377
|
-
submit:
|
|
2376
|
+
load: k,
|
|
2377
|
+
submit: O
|
|
2378
2378
|
};
|
|
2379
2379
|
}
|
|
2380
2380
|
function vr() {
|
|
@@ -2396,8 +2396,8 @@ function vr() {
|
|
|
2396
2396
|
});
|
|
2397
2397
|
}
|
|
2398
2398
|
return await e.createApplicant(g);
|
|
2399
|
-
} catch (
|
|
2400
|
-
throw o(
|
|
2399
|
+
} catch (C) {
|
|
2400
|
+
throw o(C), C;
|
|
2401
2401
|
} finally {
|
|
2402
2402
|
a(!1), l.current = !1;
|
|
2403
2403
|
}
|
|
@@ -2544,7 +2544,7 @@ const V = ({
|
|
|
2544
2544
|
] })
|
|
2545
2545
|
);
|
|
2546
2546
|
me.displayName = "Input";
|
|
2547
|
-
const
|
|
2547
|
+
const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2548
2548
|
"div",
|
|
2549
2549
|
{
|
|
2550
2550
|
className: oe(
|
|
@@ -2568,7 +2568,7 @@ const q = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2568
2568
|
...n,
|
|
2569
2569
|
children: e
|
|
2570
2570
|
}
|
|
2571
|
-
),
|
|
2571
|
+
), j = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: oe("px-6 py-4", t), ...n, children: e }), pe = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2572
2572
|
"div",
|
|
2573
2573
|
{
|
|
2574
2574
|
className: oe("px-6 py-4 border-t", t),
|
|
@@ -2698,7 +2698,7 @@ const q = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2698
2698
|
] })
|
|
2699
2699
|
);
|
|
2700
2700
|
_e.displayName = "Select";
|
|
2701
|
-
const nt = 280,
|
|
2701
|
+
const nt = 280, kr = ({
|
|
2702
2702
|
label: e,
|
|
2703
2703
|
value: t,
|
|
2704
2704
|
onChange: n,
|
|
@@ -2707,15 +2707,15 @@ const nt = 280, wr = ({
|
|
|
2707
2707
|
disabled: o = !1,
|
|
2708
2708
|
required: l = !1
|
|
2709
2709
|
}) => {
|
|
2710
|
-
const [c, u] = v(!1), [m, x] = v(""), [p, y] = v(null), g = X(null), h = X(null),
|
|
2710
|
+
const [c, u] = v(!1), [m, x] = v(""), [p, y] = v(null), g = X(null), h = X(null), C = X(null), F = Q(() => {
|
|
2711
2711
|
if (!h.current) return null;
|
|
2712
2712
|
const N = h.current.getBoundingClientRect(), ne = window.innerHeight - N.bottom < nt && N.top > nt;
|
|
2713
2713
|
return { top: ne ? N.top : N.bottom + 4, left: N.left, width: N.width, openUp: ne };
|
|
2714
|
-
}, []),
|
|
2714
|
+
}, []), k = Q(() => {
|
|
2715
2715
|
if (o) return;
|
|
2716
2716
|
const N = F();
|
|
2717
2717
|
N && y(N), u(!0);
|
|
2718
|
-
}, [o, F]),
|
|
2718
|
+
}, [o, F]), O = Q(() => {
|
|
2719
2719
|
u(!1), x("");
|
|
2720
2720
|
}, []);
|
|
2721
2721
|
re(() => {
|
|
@@ -2723,10 +2723,10 @@ const nt = 280, wr = ({
|
|
|
2723
2723
|
const N = (_) => {
|
|
2724
2724
|
var B, D;
|
|
2725
2725
|
const ne = _.target;
|
|
2726
|
-
!((B = g.current) != null && B.contains(ne)) && !((D =
|
|
2726
|
+
!((B = g.current) != null && B.contains(ne)) && !((D = C.current) != null && D.contains(ne)) && O();
|
|
2727
2727
|
};
|
|
2728
2728
|
return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
2729
|
-
}, [c,
|
|
2729
|
+
}, [c, O]), re(() => {
|
|
2730
2730
|
if (!c) return;
|
|
2731
2731
|
const N = () => {
|
|
2732
2732
|
const _ = F();
|
|
@@ -2736,19 +2736,19 @@ const nt = 280, wr = ({
|
|
|
2736
2736
|
window.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N);
|
|
2737
2737
|
};
|
|
2738
2738
|
}, [c, F]);
|
|
2739
|
-
const
|
|
2739
|
+
const E = a.filter(
|
|
2740
2740
|
(N) => N.label.toLowerCase().includes(m.toLowerCase())
|
|
2741
|
-
),
|
|
2741
|
+
), R = (N) => {
|
|
2742
2742
|
o || n(t.includes(N) ? t.filter((_) => _ !== N) : [...t, N]);
|
|
2743
2743
|
}, H = (N, _) => {
|
|
2744
2744
|
_.stopPropagation(), o || n(t.filter((ne) => ne !== N));
|
|
2745
2745
|
}, J = (N) => {
|
|
2746
2746
|
var _;
|
|
2747
2747
|
return ((_ = a.find((ne) => ne.value === N)) == null ? void 0 : _.label) || N;
|
|
2748
|
-
}, f = h.current ? getComputedStyle(h.current) : null,
|
|
2748
|
+
}, f = h.current ? getComputedStyle(h.current) : null, w = (f == null ? void 0 : f.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", I = (f == null ? void 0 : f.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", $ = (f == null ? void 0 : f.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", P = (f == null ? void 0 : f.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", Y = (f == null ? void 0 : f.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", z = (f == null ? void 0 : f.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", L = (f == null ? void 0 : f.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", Z = c && p && /* @__PURE__ */ i(
|
|
2749
2749
|
"div",
|
|
2750
2750
|
{
|
|
2751
|
-
ref:
|
|
2751
|
+
ref: C,
|
|
2752
2752
|
className: "metakyc-multiselect-dropdown",
|
|
2753
2753
|
style: {
|
|
2754
2754
|
position: "fixed",
|
|
@@ -2759,12 +2759,12 @@ const nt = 280, wr = ({
|
|
|
2759
2759
|
zIndex: 99999,
|
|
2760
2760
|
borderRadius: "8px",
|
|
2761
2761
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
2762
|
-
border: `1px solid ${
|
|
2763
|
-
backgroundColor:
|
|
2762
|
+
border: `1px solid ${I}`,
|
|
2763
|
+
backgroundColor: w,
|
|
2764
2764
|
overflow: "hidden"
|
|
2765
2765
|
},
|
|
2766
2766
|
children: [
|
|
2767
|
-
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${
|
|
2767
|
+
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${I}` }, children: /* @__PURE__ */ r(
|
|
2768
2768
|
"input",
|
|
2769
2769
|
{
|
|
2770
2770
|
type: "text",
|
|
@@ -2780,20 +2780,20 @@ const nt = 280, wr = ({
|
|
|
2780
2780
|
padding: "6px 8px",
|
|
2781
2781
|
fontSize: "13px",
|
|
2782
2782
|
borderRadius: "6px",
|
|
2783
|
-
border: `1px solid ${
|
|
2784
|
-
backgroundColor:
|
|
2785
|
-
color:
|
|
2783
|
+
border: `1px solid ${I}`,
|
|
2784
|
+
backgroundColor: w,
|
|
2785
|
+
color: $,
|
|
2786
2786
|
outline: "none",
|
|
2787
2787
|
boxSizing: "border-box"
|
|
2788
2788
|
}
|
|
2789
2789
|
}
|
|
2790
2790
|
) }),
|
|
2791
|
-
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children:
|
|
2791
|
+
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: E.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: P }, children: "No results" }) : E.map((N) => {
|
|
2792
2792
|
const _ = t.includes(N.value);
|
|
2793
2793
|
return /* @__PURE__ */ i(
|
|
2794
2794
|
"li",
|
|
2795
2795
|
{
|
|
2796
|
-
onClick: () =>
|
|
2796
|
+
onClick: () => R(N.value),
|
|
2797
2797
|
className: "metakyc-multiselect-option",
|
|
2798
2798
|
style: {
|
|
2799
2799
|
display: "flex",
|
|
@@ -2803,7 +2803,7 @@ const nt = 280, wr = ({
|
|
|
2803
2803
|
fontSize: "13px",
|
|
2804
2804
|
cursor: "pointer",
|
|
2805
2805
|
backgroundColor: _ ? z : "transparent",
|
|
2806
|
-
color: _ ?
|
|
2806
|
+
color: _ ? Y : $,
|
|
2807
2807
|
userSelect: "none"
|
|
2808
2808
|
},
|
|
2809
2809
|
onMouseEnter: (ne) => {
|
|
@@ -2819,7 +2819,7 @@ const nt = 280, wr = ({
|
|
|
2819
2819
|
type: "checkbox",
|
|
2820
2820
|
checked: _,
|
|
2821
2821
|
readOnly: !0,
|
|
2822
|
-
style: { accentColor:
|
|
2822
|
+
style: { accentColor: Y, pointerEvents: "none", flexShrink: 0 }
|
|
2823
2823
|
}
|
|
2824
2824
|
),
|
|
2825
2825
|
/* @__PURE__ */ r("span", { children: N.label })
|
|
@@ -2828,7 +2828,7 @@ const nt = 280, wr = ({
|
|
|
2828
2828
|
N.value
|
|
2829
2829
|
);
|
|
2830
2830
|
}) }),
|
|
2831
|
-
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${
|
|
2831
|
+
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${I}` }, children: /* @__PURE__ */ i(
|
|
2832
2832
|
"button",
|
|
2833
2833
|
{
|
|
2834
2834
|
type: "button",
|
|
@@ -2862,7 +2862,7 @@ const nt = 280, wr = ({
|
|
|
2862
2862
|
"div",
|
|
2863
2863
|
{
|
|
2864
2864
|
ref: h,
|
|
2865
|
-
onClick: () => c ?
|
|
2865
|
+
onClick: () => c ? O() : k(),
|
|
2866
2866
|
className: oe(
|
|
2867
2867
|
"metakyc-multiselect-trigger",
|
|
2868
2868
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
|
|
@@ -2950,53 +2950,53 @@ const nt = 280, wr = ({
|
|
|
2950
2950
|
className: m
|
|
2951
2951
|
}) => {
|
|
2952
2952
|
var D;
|
|
2953
|
-
const [x, p] = v(!1), [y, g] = v(""), [h,
|
|
2954
|
-
if (!
|
|
2955
|
-
const
|
|
2953
|
+
const [x, p] = v(!1), [y, g] = v(""), [h, C] = v(null), F = X(null), k = X(null), O = X(null), E = X(null), R = Q(() => {
|
|
2954
|
+
if (!k.current) return null;
|
|
2955
|
+
const A = k.current.getBoundingClientRect(), ee = window.innerHeight - A.bottom < at && A.top > at;
|
|
2956
2956
|
return {
|
|
2957
|
-
top: ee ?
|
|
2958
|
-
left:
|
|
2959
|
-
width:
|
|
2957
|
+
top: ee ? A.top : A.bottom + 4,
|
|
2958
|
+
left: A.left,
|
|
2959
|
+
width: A.width,
|
|
2960
2960
|
openUp: ee
|
|
2961
2961
|
};
|
|
2962
2962
|
}, []), H = Q(() => {
|
|
2963
2963
|
if (c) return;
|
|
2964
|
-
const
|
|
2965
|
-
|
|
2966
|
-
}, [c,
|
|
2964
|
+
const A = R();
|
|
2965
|
+
A && C(A), p(!0);
|
|
2966
|
+
}, [c, R]), J = Q(() => {
|
|
2967
2967
|
p(!1), g("");
|
|
2968
2968
|
}, []), f = () => x ? J() : H();
|
|
2969
2969
|
re(() => {
|
|
2970
2970
|
if (!x) return;
|
|
2971
|
-
const
|
|
2972
|
-
var
|
|
2971
|
+
const A = (U) => {
|
|
2972
|
+
var W, Se;
|
|
2973
2973
|
const ee = U.target;
|
|
2974
|
-
!((
|
|
2974
|
+
!((W = F.current) != null && W.contains(ee)) && !((Se = O.current) != null && Se.contains(ee)) && J();
|
|
2975
2975
|
};
|
|
2976
|
-
return document.addEventListener("mousedown",
|
|
2976
|
+
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
2977
2977
|
}, [x, J]), re(() => {
|
|
2978
2978
|
if (!x) return;
|
|
2979
|
-
const
|
|
2980
|
-
const U =
|
|
2981
|
-
U &&
|
|
2979
|
+
const A = () => {
|
|
2980
|
+
const U = R();
|
|
2981
|
+
U && C(U);
|
|
2982
2982
|
};
|
|
2983
|
-
return window.addEventListener("scroll",
|
|
2984
|
-
window.removeEventListener("scroll",
|
|
2983
|
+
return window.addEventListener("scroll", A, !0), window.addEventListener("resize", A), () => {
|
|
2984
|
+
window.removeEventListener("scroll", A, !0), window.removeEventListener("resize", A);
|
|
2985
2985
|
};
|
|
2986
|
-
}, [x,
|
|
2987
|
-
x &&
|
|
2988
|
-
var
|
|
2989
|
-
return (
|
|
2986
|
+
}, [x, R]), re(() => {
|
|
2987
|
+
x && E.current && setTimeout(() => {
|
|
2988
|
+
var A;
|
|
2989
|
+
return (A = E.current) == null ? void 0 : A.focus();
|
|
2990
2990
|
}, 0);
|
|
2991
2991
|
}, [x]);
|
|
2992
|
-
const
|
|
2993
|
-
(
|
|
2994
|
-
),
|
|
2995
|
-
c || U || (l(
|
|
2996
|
-
}, P =
|
|
2992
|
+
const w = a.filter(
|
|
2993
|
+
(A) => A.label.toLowerCase().includes(y.toLowerCase()) || A.value.toLowerCase().includes(y.toLowerCase())
|
|
2994
|
+
), I = (D = a.find((A) => A.value === o)) == null ? void 0 : D.label, $ = (A, U) => {
|
|
2995
|
+
c || U || (l(A), J());
|
|
2996
|
+
}, P = k.current ? getComputedStyle(k.current) : null, Y = (P == null ? void 0 : P.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", z = (P == null ? void 0 : P.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", L = (P == null ? void 0 : P.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", Z = (P == null ? void 0 : P.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", N = (P == null ? void 0 : P.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", _ = (P == null ? void 0 : P.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", ne = (P == null ? void 0 : P.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", B = x && h && /* @__PURE__ */ i(
|
|
2997
2997
|
"div",
|
|
2998
2998
|
{
|
|
2999
|
-
ref:
|
|
2999
|
+
ref: O,
|
|
3000
3000
|
className: "metakyc-searchable-select-dropdown",
|
|
3001
3001
|
style: {
|
|
3002
3002
|
position: "fixed",
|
|
@@ -3008,19 +3008,19 @@ const nt = 280, wr = ({
|
|
|
3008
3008
|
borderRadius: "8px",
|
|
3009
3009
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
3010
3010
|
border: `1px solid ${z}`,
|
|
3011
|
-
backgroundColor:
|
|
3011
|
+
backgroundColor: Y,
|
|
3012
3012
|
overflow: "hidden"
|
|
3013
3013
|
},
|
|
3014
3014
|
children: [
|
|
3015
3015
|
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${z}` }, children: /* @__PURE__ */ r(
|
|
3016
3016
|
"input",
|
|
3017
3017
|
{
|
|
3018
|
-
ref:
|
|
3018
|
+
ref: E,
|
|
3019
3019
|
type: "text",
|
|
3020
3020
|
value: y,
|
|
3021
|
-
onChange: (
|
|
3021
|
+
onChange: (A) => g(A.target.value),
|
|
3022
3022
|
placeholder: "Search...",
|
|
3023
|
-
onClick: (
|
|
3023
|
+
onClick: (A) => A.stopPropagation(),
|
|
3024
3024
|
className: "metakyc-searchable-select-search w-full",
|
|
3025
3025
|
style: {
|
|
3026
3026
|
display: "block",
|
|
@@ -3029,7 +3029,7 @@ const nt = 280, wr = ({
|
|
|
3029
3029
|
fontSize: "13px",
|
|
3030
3030
|
borderRadius: "6px",
|
|
3031
3031
|
border: `1px solid ${z}`,
|
|
3032
|
-
backgroundColor:
|
|
3032
|
+
backgroundColor: Y,
|
|
3033
3033
|
color: L,
|
|
3034
3034
|
outline: "none",
|
|
3035
3035
|
boxSizing: "border-box"
|
|
@@ -3046,31 +3046,31 @@ const nt = 280, wr = ({
|
|
|
3046
3046
|
maxHeight: "208px",
|
|
3047
3047
|
overflowY: "auto"
|
|
3048
3048
|
},
|
|
3049
|
-
children:
|
|
3050
|
-
const U =
|
|
3049
|
+
children: w.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: Z }, children: "No results" }) : w.map((A) => {
|
|
3050
|
+
const U = A.value === o;
|
|
3051
3051
|
return /* @__PURE__ */ r(
|
|
3052
3052
|
"li",
|
|
3053
3053
|
{
|
|
3054
3054
|
className: "metakyc-searchable-select-option",
|
|
3055
|
-
onClick: () =>
|
|
3055
|
+
onClick: () => $(A.value, A.disabled),
|
|
3056
3056
|
style: {
|
|
3057
3057
|
padding: "8px 12px",
|
|
3058
3058
|
fontSize: "13px",
|
|
3059
|
-
cursor:
|
|
3060
|
-
opacity:
|
|
3059
|
+
cursor: A.disabled ? "not-allowed" : "pointer",
|
|
3060
|
+
opacity: A.disabled ? 0.4 : 1,
|
|
3061
3061
|
backgroundColor: U ? _ : "transparent",
|
|
3062
3062
|
color: U ? N : L,
|
|
3063
3063
|
userSelect: "none"
|
|
3064
3064
|
},
|
|
3065
3065
|
onMouseEnter: (ee) => {
|
|
3066
|
-
!U && !
|
|
3066
|
+
!U && !A.disabled && (ee.currentTarget.style.backgroundColor = ne);
|
|
3067
3067
|
},
|
|
3068
3068
|
onMouseLeave: (ee) => {
|
|
3069
3069
|
U || (ee.currentTarget.style.backgroundColor = "transparent");
|
|
3070
3070
|
},
|
|
3071
|
-
children:
|
|
3071
|
+
children: A.label
|
|
3072
3072
|
},
|
|
3073
|
-
|
|
3073
|
+
A.value
|
|
3074
3074
|
);
|
|
3075
3075
|
})
|
|
3076
3076
|
}
|
|
@@ -3098,12 +3098,12 @@ const nt = 280, wr = ({
|
|
|
3098
3098
|
/* @__PURE__ */ i(
|
|
3099
3099
|
"div",
|
|
3100
3100
|
{
|
|
3101
|
-
ref:
|
|
3101
|
+
ref: k,
|
|
3102
3102
|
role: "button",
|
|
3103
3103
|
tabIndex: c ? -1 : 0,
|
|
3104
3104
|
onClick: f,
|
|
3105
|
-
onKeyDown: (
|
|
3106
|
-
(
|
|
3105
|
+
onKeyDown: (A) => {
|
|
3106
|
+
(A.key === "Enter" || A.key === " ") && (A.preventDefault(), f()), A.key === "Escape" && J();
|
|
3107
3107
|
},
|
|
3108
3108
|
className: oe(
|
|
3109
3109
|
"metakyc-searchable-select-trigger",
|
|
@@ -3114,14 +3114,14 @@ const nt = 280, wr = ({
|
|
|
3114
3114
|
),
|
|
3115
3115
|
style: {
|
|
3116
3116
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
3117
|
-
color:
|
|
3117
|
+
color: I ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-secondary, #9ca3af)",
|
|
3118
3118
|
borderColor: t ? "var(--metakyc-error, #ef4444)" : x ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)",
|
|
3119
3119
|
minHeight: "42px",
|
|
3120
3120
|
outline: x ? "2px solid var(--metakyc-primary, #2563eb)" : "none",
|
|
3121
3121
|
outlineOffset: "-1px"
|
|
3122
3122
|
},
|
|
3123
3123
|
children: [
|
|
3124
|
-
/* @__PURE__ */ r("span", { className: "truncate flex-1", children:
|
|
3124
|
+
/* @__PURE__ */ r("span", { className: "truncate flex-1", children: I || s }),
|
|
3125
3125
|
/* @__PURE__ */ r(
|
|
3126
3126
|
"span",
|
|
3127
3127
|
{
|
|
@@ -3141,7 +3141,7 @@ const nt = 280, wr = ({
|
|
|
3141
3141
|
);
|
|
3142
3142
|
};
|
|
3143
3143
|
je.displayName = "SearchableSelect";
|
|
3144
|
-
const
|
|
3144
|
+
const wr = ({
|
|
3145
3145
|
label: e,
|
|
3146
3146
|
error: t,
|
|
3147
3147
|
accept: n,
|
|
@@ -3151,27 +3151,27 @@ const kr = ({
|
|
|
3151
3151
|
value: l = [],
|
|
3152
3152
|
className: c
|
|
3153
3153
|
}) => {
|
|
3154
|
-
const [u, m] = v(!1), x = X(null), p = (
|
|
3155
|
-
if (!
|
|
3156
|
-
const
|
|
3157
|
-
if (s &&
|
|
3158
|
-
const
|
|
3159
|
-
alert(`Some files exceed the maximum size of ${
|
|
3154
|
+
const [u, m] = v(!1), x = X(null), p = (k) => {
|
|
3155
|
+
if (!k) return;
|
|
3156
|
+
const O = Array.from(k);
|
|
3157
|
+
if (s && O.filter((R) => R.size > s).length > 0) {
|
|
3158
|
+
const R = We(s);
|
|
3159
|
+
alert(`Some files exceed the maximum size of ${R}`);
|
|
3160
3160
|
return;
|
|
3161
3161
|
}
|
|
3162
|
-
o == null || o(a ? [...l, ...
|
|
3163
|
-
}, y = (
|
|
3164
|
-
|
|
3162
|
+
o == null || o(a ? [...l, ...O] : [O[0]]);
|
|
3163
|
+
}, y = (k) => {
|
|
3164
|
+
k.preventDefault(), m(!0);
|
|
3165
3165
|
}, g = () => {
|
|
3166
3166
|
m(!1);
|
|
3167
|
-
}, h = (
|
|
3168
|
-
|
|
3169
|
-
},
|
|
3170
|
-
var
|
|
3171
|
-
(
|
|
3172
|
-
}, F = (
|
|
3173
|
-
const
|
|
3174
|
-
o == null || o(
|
|
3167
|
+
}, h = (k) => {
|
|
3168
|
+
k.preventDefault(), m(!1), p(k.dataTransfer.files);
|
|
3169
|
+
}, C = () => {
|
|
3170
|
+
var k;
|
|
3171
|
+
(k = x.current) == null || k.click();
|
|
3172
|
+
}, F = (k) => {
|
|
3173
|
+
const O = l.filter((E, R) => R !== k);
|
|
3174
|
+
o == null || o(O);
|
|
3175
3175
|
};
|
|
3176
3176
|
return /* @__PURE__ */ i("div", { className: oe("w-full", c), children: [
|
|
3177
3177
|
e && /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: e }),
|
|
@@ -3186,7 +3186,7 @@ const kr = ({
|
|
|
3186
3186
|
onDragOver: y,
|
|
3187
3187
|
onDragLeave: g,
|
|
3188
3188
|
onDrop: h,
|
|
3189
|
-
onClick:
|
|
3189
|
+
onClick: C,
|
|
3190
3190
|
children: [
|
|
3191
3191
|
/* @__PURE__ */ r(
|
|
3192
3192
|
"input",
|
|
@@ -3196,7 +3196,7 @@ const kr = ({
|
|
|
3196
3196
|
className: "hidden",
|
|
3197
3197
|
accept: n,
|
|
3198
3198
|
multiple: a,
|
|
3199
|
-
onChange: (
|
|
3199
|
+
onChange: (k) => p(k.target.files)
|
|
3200
3200
|
}
|
|
3201
3201
|
),
|
|
3202
3202
|
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
@@ -3230,7 +3230,7 @@ const kr = ({
|
|
|
3230
3230
|
]
|
|
3231
3231
|
}
|
|
3232
3232
|
),
|
|
3233
|
-
l.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: l.map((
|
|
3233
|
+
l.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: l.map((k, O) => /* @__PURE__ */ i(
|
|
3234
3234
|
"div",
|
|
3235
3235
|
{
|
|
3236
3236
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -3252,10 +3252,10 @@ const kr = ({
|
|
|
3252
3252
|
)
|
|
3253
3253
|
}
|
|
3254
3254
|
),
|
|
3255
|
-
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children:
|
|
3255
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: k.name }),
|
|
3256
3256
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-500", children: [
|
|
3257
3257
|
"(",
|
|
3258
|
-
We(
|
|
3258
|
+
We(k.size),
|
|
3259
3259
|
")"
|
|
3260
3260
|
] })
|
|
3261
3261
|
] }),
|
|
@@ -3263,8 +3263,8 @@ const kr = ({
|
|
|
3263
3263
|
"button",
|
|
3264
3264
|
{
|
|
3265
3265
|
type: "button",
|
|
3266
|
-
onClick: (
|
|
3267
|
-
|
|
3266
|
+
onClick: (E) => {
|
|
3267
|
+
E.stopPropagation(), F(O);
|
|
3268
3268
|
},
|
|
3269
3269
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
3270
3270
|
children: /* @__PURE__ */ r("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ r(
|
|
@@ -3279,7 +3279,7 @@ const kr = ({
|
|
|
3279
3279
|
)
|
|
3280
3280
|
]
|
|
3281
3281
|
},
|
|
3282
|
-
|
|
3282
|
+
O
|
|
3283
3283
|
)) }),
|
|
3284
3284
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: t })
|
|
3285
3285
|
] });
|
|
@@ -3500,78 +3500,78 @@ const Lr = ({
|
|
|
3500
3500
|
fe.useEffect(() => {
|
|
3501
3501
|
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && x(s);
|
|
3502
3502
|
}, [s]);
|
|
3503
|
-
const
|
|
3503
|
+
const C = Ae(
|
|
3504
3504
|
() => a ? Fr(a.questionGroups) : [],
|
|
3505
3505
|
[a]
|
|
3506
|
-
), F = g ===
|
|
3507
|
-
x((
|
|
3508
|
-
const
|
|
3509
|
-
return delete
|
|
3506
|
+
), F = g === C.length - 1, k = C[g] ?? [], O = Q((f, w) => {
|
|
3507
|
+
x((I) => ({ ...I, [f]: w })), y((I) => {
|
|
3508
|
+
const $ = { ...I };
|
|
3509
|
+
return delete $[f], $;
|
|
3510
3510
|
});
|
|
3511
|
-
}, []),
|
|
3511
|
+
}, []), E = Q(() => {
|
|
3512
3512
|
const f = {};
|
|
3513
|
-
for (const { question:
|
|
3514
|
-
const
|
|
3515
|
-
|
|
3513
|
+
for (const { question: w } of k) {
|
|
3514
|
+
const I = Dr(w, m[w.id] ?? []);
|
|
3515
|
+
I && (f[w.id] = I);
|
|
3516
3516
|
}
|
|
3517
|
-
return y((
|
|
3518
|
-
}, [
|
|
3519
|
-
|
|
3517
|
+
return y((w) => ({ ...w, ...f })), Object.keys(f).length === 0;
|
|
3518
|
+
}, [k, m]), R = () => {
|
|
3519
|
+
E() && h((f) => f + 1);
|
|
3520
3520
|
}, H = () => {
|
|
3521
3521
|
g > 0 ? h((f) => f - 1) : n == null || n();
|
|
3522
3522
|
}, J = async () => {
|
|
3523
|
-
if (!(!
|
|
3523
|
+
if (!(!E() || !a))
|
|
3524
3524
|
try {
|
|
3525
3525
|
const f = a.questionGroups.flatMap(
|
|
3526
|
-
(
|
|
3527
|
-
questionId:
|
|
3528
|
-
values: m[
|
|
3526
|
+
(I) => (I.questions ?? []).map(($) => ({
|
|
3527
|
+
questionId: $.id,
|
|
3528
|
+
values: m[$.id] ?? []
|
|
3529
3529
|
}))
|
|
3530
|
-
),
|
|
3530
|
+
), w = {
|
|
3531
3531
|
applicantId: e,
|
|
3532
3532
|
questionnarieId: a.id,
|
|
3533
3533
|
questionResults: f
|
|
3534
3534
|
};
|
|
3535
|
-
await u(
|
|
3535
|
+
await u(w), t == null || t();
|
|
3536
3536
|
} catch (f) {
|
|
3537
3537
|
console.error("Questionnaire submit error:", f);
|
|
3538
3538
|
}
|
|
3539
3539
|
};
|
|
3540
|
-
return o ? /* @__PURE__ */ r(
|
|
3540
|
+
return o ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(ve, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3541
3541
|
"Error loading questionnaire: ",
|
|
3542
3542
|
c.message
|
|
3543
|
-
] }) }) }) : a ? /* @__PURE__ */ i(
|
|
3543
|
+
] }) }) }) : a ? /* @__PURE__ */ i(K, { children: [
|
|
3544
3544
|
/* @__PURE__ */ i(de, { children: [
|
|
3545
3545
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3546
3546
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.subtitle }),
|
|
3547
|
-
|
|
3547
|
+
C.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3548
3548
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3549
3549
|
"Page ",
|
|
3550
3550
|
g + 1,
|
|
3551
3551
|
" of ",
|
|
3552
|
-
|
|
3552
|
+
C.length
|
|
3553
3553
|
] }),
|
|
3554
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children:
|
|
3554
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: C.map((f, w) => /* @__PURE__ */ r(
|
|
3555
3555
|
"div",
|
|
3556
3556
|
{
|
|
3557
3557
|
className: "rounded-full transition-all duration-200",
|
|
3558
3558
|
style: {
|
|
3559
3559
|
height: "6px",
|
|
3560
|
-
width:
|
|
3561
|
-
backgroundColor:
|
|
3560
|
+
width: w === g ? "20px" : "6px",
|
|
3561
|
+
backgroundColor: w <= g ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
3562
3562
|
}
|
|
3563
3563
|
},
|
|
3564
|
-
|
|
3564
|
+
w
|
|
3565
3565
|
)) })
|
|
3566
3566
|
] })
|
|
3567
3567
|
] }),
|
|
3568
|
-
/* @__PURE__ */ r(
|
|
3568
|
+
/* @__PURE__ */ r(j, { className: "space-y-6", children: k.map(({ question: f }) => /* @__PURE__ */ r(
|
|
3569
3569
|
Tr,
|
|
3570
3570
|
{
|
|
3571
3571
|
question: f,
|
|
3572
3572
|
value: m[f.id] ?? [],
|
|
3573
3573
|
error: p[f.id],
|
|
3574
|
-
onChange: (
|
|
3574
|
+
onChange: (w) => O(f.id, w)
|
|
3575
3575
|
},
|
|
3576
3576
|
f.id
|
|
3577
3577
|
)) }),
|
|
@@ -3601,7 +3601,7 @@ const Lr = ({
|
|
|
3601
3601
|
V,
|
|
3602
3602
|
{
|
|
3603
3603
|
type: "button",
|
|
3604
|
-
onClick:
|
|
3604
|
+
onClick: R,
|
|
3605
3605
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3606
3606
|
children: [
|
|
3607
3607
|
"Next",
|
|
@@ -3728,10 +3728,10 @@ const Lr = ({
|
|
|
3728
3728
|
if (p.preventDefault(), !a) return;
|
|
3729
3729
|
const y = await Promise.all(
|
|
3730
3730
|
a.uploadDocumentFiles.map(async (h) => {
|
|
3731
|
-
const
|
|
3732
|
-
|
|
3733
|
-
fileName:
|
|
3734
|
-
fileData: await lr(
|
|
3731
|
+
const C = u[h.id] || [], F = await Promise.all(
|
|
3732
|
+
C.map(async (k) => ({
|
|
3733
|
+
fileName: k.name,
|
|
3734
|
+
fileData: await lr(k)
|
|
3735
3735
|
}))
|
|
3736
3736
|
);
|
|
3737
3737
|
return {
|
|
@@ -3746,16 +3746,16 @@ const Lr = ({
|
|
|
3746
3746
|
};
|
|
3747
3747
|
await c(g), t == null || t();
|
|
3748
3748
|
};
|
|
3749
|
-
return s ? /* @__PURE__ */ r(
|
|
3749
|
+
return s ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(ve, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3750
3750
|
"Error loading document requirements: ",
|
|
3751
3751
|
l.message
|
|
3752
|
-
] }) }) }) : a ? /* @__PURE__ */ r("form", { onSubmit: x, children: /* @__PURE__ */ i(
|
|
3752
|
+
] }) }) }) : a ? /* @__PURE__ */ r("form", { onSubmit: x, children: /* @__PURE__ */ i(K, { children: [
|
|
3753
3753
|
/* @__PURE__ */ i(de, { children: [
|
|
3754
3754
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3755
3755
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3756
3756
|
] }),
|
|
3757
|
-
/* @__PURE__ */ r(
|
|
3758
|
-
|
|
3757
|
+
/* @__PURE__ */ r(j, { className: "space-y-6", children: a.uploadDocumentFiles.map((p) => /* @__PURE__ */ r(
|
|
3758
|
+
wr,
|
|
3759
3759
|
{
|
|
3760
3760
|
label: p.displayName,
|
|
3761
3761
|
accept: p.allowedTypes,
|
|
@@ -3777,15 +3777,15 @@ const Lr = ({
|
|
|
3777
3777
|
const { overview: a, isLoading: s, isSubmitting: o, error: l, passOverview: c } = fr(e), u = async () => {
|
|
3778
3778
|
await c(), t == null || t();
|
|
3779
3779
|
};
|
|
3780
|
-
return s ? /* @__PURE__ */ r(
|
|
3780
|
+
return s ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(ve, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3781
3781
|
"Error loading overview: ",
|
|
3782
3782
|
l.message
|
|
3783
|
-
] }) }) }) : a ? /* @__PURE__ */ i(
|
|
3783
|
+
] }) }) }) : a ? /* @__PURE__ */ i(K, { children: [
|
|
3784
3784
|
/* @__PURE__ */ i(de, { children: [
|
|
3785
3785
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
3786
3786
|
a.description && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
|
|
3787
3787
|
] }),
|
|
3788
|
-
/* @__PURE__ */ r(
|
|
3788
|
+
/* @__PURE__ */ r(j, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((m, x) => m.order - x.order).map((m) => /* @__PURE__ */ i("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3789
3789
|
/* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: m.order + 1 }) }),
|
|
3790
3790
|
/* @__PURE__ */ i(
|
|
3791
3791
|
"div",
|
|
@@ -3810,7 +3810,7 @@ const Lr = ({
|
|
|
3810
3810
|
] })
|
|
3811
3811
|
] }) : null;
|
|
3812
3812
|
};
|
|
3813
|
-
function
|
|
3813
|
+
function $r(e, t) {
|
|
3814
3814
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
3815
3815
|
if (e.isRequired && n)
|
|
3816
3816
|
return e.errorMessage || `${e.displayName} is required`;
|
|
@@ -3840,14 +3840,14 @@ function zr(e, t) {
|
|
|
3840
3840
|
}
|
|
3841
3841
|
return null;
|
|
3842
3842
|
}
|
|
3843
|
-
function
|
|
3843
|
+
function zr(e) {
|
|
3844
3844
|
const t = /* @__PURE__ */ new Map();
|
|
3845
3845
|
return e.forEach((n, a) => {
|
|
3846
3846
|
const s = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
3847
3847
|
t.has(s) || t.set(s, []), t.get(s).push({ criterion: n, idx: a });
|
|
3848
3848
|
}), Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
3849
3849
|
}
|
|
3850
|
-
function
|
|
3850
|
+
function Br(e) {
|
|
3851
3851
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
3852
3852
|
}
|
|
3853
3853
|
const _r = ({
|
|
@@ -3855,88 +3855,88 @@ const _r = ({
|
|
|
3855
3855
|
onComplete: t,
|
|
3856
3856
|
onBack: n
|
|
3857
3857
|
}) => {
|
|
3858
|
-
const { criteria: a, initialAnswers: s, isLoading: o, isSubmitting: l, error: c, submit: u } = br(e), [m, x] = v({}), [p, y] = v({}), [g, h] = v(0), [
|
|
3858
|
+
const { criteria: a, initialAnswers: s, isLoading: o, isSubmitting: l, error: c, submit: u } = br(e), [m, x] = v({}), [p, y] = v({}), [g, h] = v(0), [C, F] = v(!1);
|
|
3859
3859
|
fe.useEffect(() => {
|
|
3860
3860
|
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && x(s);
|
|
3861
3861
|
}, [s]);
|
|
3862
|
-
const
|
|
3863
|
-
() => a && a.length > 0 ?
|
|
3862
|
+
const k = Ae(
|
|
3863
|
+
() => a && a.length > 0 ? zr(a) : [],
|
|
3864
3864
|
[a]
|
|
3865
|
-
),
|
|
3865
|
+
), O = g === k.length - 1, E = k[g] ?? [];
|
|
3866
3866
|
fe.useEffect(() => {
|
|
3867
|
-
!o && a && a.length === 0 && !
|
|
3868
|
-
}, [o, a,
|
|
3869
|
-
const
|
|
3870
|
-
x((P) => ({ ...P, [
|
|
3871
|
-
const
|
|
3872
|
-
return delete
|
|
3867
|
+
!o && a && a.length === 0 && !C && !l && (F(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
3868
|
+
}, [o, a, C, l, u, e, t]);
|
|
3869
|
+
const R = Q((I, $) => {
|
|
3870
|
+
x((P) => ({ ...P, [I]: $ })), y((P) => {
|
|
3871
|
+
const Y = { ...P };
|
|
3872
|
+
return delete Y[I], Y;
|
|
3873
3873
|
});
|
|
3874
3874
|
}, []), H = Q(() => {
|
|
3875
|
-
const
|
|
3876
|
-
for (const { criterion:
|
|
3877
|
-
const P =
|
|
3878
|
-
P && (
|
|
3875
|
+
const I = {};
|
|
3876
|
+
for (const { criterion: $ } of E) {
|
|
3877
|
+
const P = $r($, m[$.id] ?? []);
|
|
3878
|
+
P && (I[$.id] = P);
|
|
3879
3879
|
}
|
|
3880
|
-
return y((
|
|
3881
|
-
}, [
|
|
3882
|
-
H() && h((
|
|
3880
|
+
return y(($) => ({ ...$, ...I })), Object.keys(I).length === 0;
|
|
3881
|
+
}, [E, m]), J = () => {
|
|
3882
|
+
H() && h((I) => I + 1);
|
|
3883
3883
|
}, f = () => {
|
|
3884
|
-
g > 0 ? h((
|
|
3885
|
-
},
|
|
3884
|
+
g > 0 ? h((I) => I - 1) : n == null || n();
|
|
3885
|
+
}, w = async () => {
|
|
3886
3886
|
if (!(!H() || !a))
|
|
3887
3887
|
try {
|
|
3888
|
-
const
|
|
3889
|
-
const
|
|
3890
|
-
return
|
|
3888
|
+
const I = a.map((P) => {
|
|
3889
|
+
const Y = (m[P.id] ?? []).filter((z) => z && z.trim());
|
|
3890
|
+
return Y.length > 0 ? { riskCriteriaId: P.id, values: Y } : null;
|
|
3891
3891
|
}).filter((P) => P !== null);
|
|
3892
|
-
await u({ applicantId: e, criteriaValueInputs:
|
|
3893
|
-
} catch (
|
|
3894
|
-
console.error("Risk scoring submit error:",
|
|
3892
|
+
await u({ applicantId: e, criteriaValueInputs: I }), t == null || t();
|
|
3893
|
+
} catch (I) {
|
|
3894
|
+
console.error("Risk scoring submit error:", I);
|
|
3895
3895
|
}
|
|
3896
3896
|
};
|
|
3897
|
-
return o ? /* @__PURE__ */ r(
|
|
3897
|
+
return o ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ i(j, { children: [
|
|
3898
3898
|
/* @__PURE__ */ r(ve, { className: "my-8" }),
|
|
3899
3899
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
3900
|
-
] }) }) : !o && a && a.length === 0 ? /* @__PURE__ */ r(
|
|
3900
|
+
] }) }) : !o && a && a.length === 0 ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ i(j, { children: [
|
|
3901
3901
|
/* @__PURE__ */ r(ve, { className: "my-8" }),
|
|
3902
3902
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
3903
|
-
] }) }) : c ? /* @__PURE__ */ r(
|
|
3903
|
+
] }) }) : c ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3904
3904
|
"Error loading criteria: ",
|
|
3905
3905
|
c.message
|
|
3906
|
-
] }) }) }) : a ? /* @__PURE__ */ i(
|
|
3906
|
+
] }) }) }) : a ? /* @__PURE__ */ i(K, { children: [
|
|
3907
3907
|
/* @__PURE__ */ i(de, { children: [
|
|
3908
3908
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3909
3909
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
3910
|
-
|
|
3910
|
+
k.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3911
3911
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3912
3912
|
"Page ",
|
|
3913
3913
|
g + 1,
|
|
3914
3914
|
" of ",
|
|
3915
|
-
|
|
3915
|
+
k.length
|
|
3916
3916
|
] }),
|
|
3917
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children:
|
|
3917
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: k.map((I, $) => /* @__PURE__ */ r(
|
|
3918
3918
|
"div",
|
|
3919
3919
|
{
|
|
3920
3920
|
className: "rounded-full transition-all duration-200",
|
|
3921
3921
|
style: {
|
|
3922
3922
|
height: "6px",
|
|
3923
|
-
width:
|
|
3924
|
-
backgroundColor:
|
|
3923
|
+
width: $ === g ? "20px" : "6px",
|
|
3924
|
+
backgroundColor: $ <= g ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
3925
3925
|
}
|
|
3926
3926
|
},
|
|
3927
|
-
|
|
3927
|
+
$
|
|
3928
3928
|
)) })
|
|
3929
3929
|
] })
|
|
3930
3930
|
] }),
|
|
3931
|
-
/* @__PURE__ */ r(
|
|
3931
|
+
/* @__PURE__ */ r(j, { className: "space-y-6", children: E.map(({ criterion: I }) => /* @__PURE__ */ r(
|
|
3932
3932
|
Ur,
|
|
3933
3933
|
{
|
|
3934
|
-
criterion:
|
|
3935
|
-
value: m[
|
|
3936
|
-
error: p[
|
|
3937
|
-
onChange: (
|
|
3934
|
+
criterion: I,
|
|
3935
|
+
value: m[I.id] ?? [],
|
|
3936
|
+
error: p[I.id],
|
|
3937
|
+
onChange: ($) => R(I.id, $)
|
|
3938
3938
|
},
|
|
3939
|
-
|
|
3939
|
+
I.id
|
|
3940
3940
|
)) }),
|
|
3941
3941
|
/* @__PURE__ */ i(pe, { className: "flex items-center justify-between", children: [
|
|
3942
3942
|
/* @__PURE__ */ i(
|
|
@@ -3952,7 +3952,7 @@ const _r = ({
|
|
|
3952
3952
|
]
|
|
3953
3953
|
}
|
|
3954
3954
|
),
|
|
3955
|
-
|
|
3955
|
+
O ? /* @__PURE__ */ r(V, { type: "button", isLoading: l, onClick: w, children: "Continue" }) : /* @__PURE__ */ i(
|
|
3956
3956
|
V,
|
|
3957
3957
|
{
|
|
3958
3958
|
type: "button",
|
|
@@ -3968,7 +3968,7 @@ const _r = ({
|
|
|
3968
3968
|
c && /* @__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: c.message }) })
|
|
3969
3969
|
] }) : null;
|
|
3970
3970
|
}, Ur = ({ criterion: e, value: t, error: n, onChange: a }) => {
|
|
3971
|
-
const s =
|
|
3971
|
+
const s = Br(e), o = e.valueDataType === Ee.Integer || e.valueDataType === Ee.Decimal || e.valueDataType === Ee.DigitOnly;
|
|
3972
3972
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
3973
3973
|
/* @__PURE__ */ i("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
3974
3974
|
e.displayName,
|
|
@@ -4109,12 +4109,12 @@ const _r = ({
|
|
|
4109
4109
|
} finally {
|
|
4110
4110
|
c(!1);
|
|
4111
4111
|
}
|
|
4112
|
-
}, children: /* @__PURE__ */ i(
|
|
4112
|
+
}, children: /* @__PURE__ */ i(K, { children: [
|
|
4113
4113
|
/* @__PURE__ */ i(de, { children: [
|
|
4114
4114
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
|
|
4115
4115
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", 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" })
|
|
4116
4116
|
] }),
|
|
4117
|
-
/* @__PURE__ */ i(
|
|
4117
|
+
/* @__PURE__ */ i(j, { className: "space-y-4", children: [
|
|
4118
4118
|
/* @__PURE__ */ r("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
|
|
4119
4119
|
/* @__PURE__ */ r(
|
|
4120
4120
|
"label",
|
|
@@ -4227,7 +4227,7 @@ const _r = ({
|
|
|
4227
4227
|
onComplete: t,
|
|
4228
4228
|
onBack: n
|
|
4229
4229
|
}) => {
|
|
4230
|
-
const { appropriatenessTestService: a } = ye(), [s, o] = v(null), [l, c] = v(!0), [u, m] = v(!1), [x, p] = v(null), [y, g] = v({}), [h,
|
|
4230
|
+
const { appropriatenessTestService: a } = ye(), [s, o] = v(null), [l, c] = v(!0), [u, m] = v(!1), [x, p] = v(null), [y, g] = v({}), [h, C] = v(0), [F, k] = v(!1), [O, E] = v(!1), [R, H] = v(0);
|
|
4231
4231
|
re(() => {
|
|
4232
4232
|
(async () => {
|
|
4233
4233
|
try {
|
|
@@ -4258,28 +4258,28 @@ const _r = ({
|
|
|
4258
4258
|
re(() => {
|
|
4259
4259
|
if (!F || h <= 0) return;
|
|
4260
4260
|
const z = setInterval(() => {
|
|
4261
|
-
|
|
4261
|
+
C((L) => L <= 1 ? (E(!0), 0) : L - 1);
|
|
4262
4262
|
}, 1e3);
|
|
4263
4263
|
return () => clearInterval(z);
|
|
4264
4264
|
}, [F, h]), re(() => {
|
|
4265
|
-
if (
|
|
4265
|
+
if (R <= 0) return;
|
|
4266
4266
|
const z = setInterval(() => {
|
|
4267
4267
|
H((L) => L <= 1 ? 0 : L - 1);
|
|
4268
4268
|
}, 1e3);
|
|
4269
4269
|
return () => clearInterval(z);
|
|
4270
|
-
}, [
|
|
4271
|
-
|
|
4272
|
-
}, [
|
|
4273
|
-
const
|
|
4274
|
-
s && (
|
|
4275
|
-
},
|
|
4270
|
+
}, [R]), re(() => {
|
|
4271
|
+
O && !u && $();
|
|
4272
|
+
}, [O]);
|
|
4273
|
+
const w = () => {
|
|
4274
|
+
s && (k(!0), C(s.testDurationSec));
|
|
4275
|
+
}, I = (z, L) => {
|
|
4276
4276
|
g((Z) => ({
|
|
4277
4277
|
...Z,
|
|
4278
4278
|
[z]: L
|
|
4279
4279
|
}));
|
|
4280
|
-
},
|
|
4280
|
+
}, $ = async (z) => {
|
|
4281
4281
|
if (z && z.preventDefault(), !!s) {
|
|
4282
|
-
if (!
|
|
4282
|
+
if (!O) {
|
|
4283
4283
|
const L = s.appropriatenessQuestions.length - Object.keys(y).length;
|
|
4284
4284
|
if (L > 0) {
|
|
4285
4285
|
p(`Please answer all questions. ${L} question(s) remaining.`);
|
|
@@ -4302,16 +4302,16 @@ const _r = ({
|
|
|
4302
4302
|
console.log("Submitting appropriateness test:", Z);
|
|
4303
4303
|
try {
|
|
4304
4304
|
const N = await a.fillAppropriatenessTest(Z);
|
|
4305
|
-
console.log("Appropriateness test result:", N), N.message && (N.message.toLowerCase().includes("pass") || N.message.toLowerCase().includes("success") || N.message.toLowerCase().includes("congratulations")) ? t == null || t() : (p(N.message || "Test completed. Please check the result."),
|
|
4305
|
+
console.log("Appropriateness test result:", N), N.message && (N.message.toLowerCase().includes("pass") || N.message.toLowerCase().includes("success") || N.message.toLowerCase().includes("congratulations")) ? t == null || t() : (p(N.message || "Test completed. Please check the result."), k(!1), E(!1), g({}), setTimeout(() => P(), 1e3));
|
|
4306
4306
|
} catch (N) {
|
|
4307
4307
|
if (N.code === 400 && N.message) {
|
|
4308
4308
|
const _ = N.message;
|
|
4309
|
-
console.log("Test failed:", _), p(_),
|
|
4309
|
+
console.log("Test failed:", _), p(_), k(!1), E(!1), g({}), setTimeout(() => P(), 1500);
|
|
4310
4310
|
} else
|
|
4311
4311
|
throw N;
|
|
4312
4312
|
}
|
|
4313
4313
|
} catch (L) {
|
|
4314
|
-
console.error("Error submitting appropriateness test:", L), p(L.message || "Failed to submit test. Please try again."),
|
|
4314
|
+
console.error("Error submitting appropriateness test:", L), p(L.message || "Failed to submit test. Please try again."), k(!1), E(!1), g({});
|
|
4315
4315
|
} finally {
|
|
4316
4316
|
m(!1);
|
|
4317
4317
|
}
|
|
@@ -4330,31 +4330,31 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4330
4330
|
}
|
|
4331
4331
|
};
|
|
4332
4332
|
if (l)
|
|
4333
|
-
return /* @__PURE__ */ r(
|
|
4333
|
+
return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ i(j, { children: [
|
|
4334
4334
|
/* @__PURE__ */ r(ve, { className: "my-8" }),
|
|
4335
4335
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
4336
4336
|
] }) });
|
|
4337
4337
|
if (!s)
|
|
4338
|
-
return /* @__PURE__ */ r(
|
|
4338
|
+
return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ i(j, { className: "py-12 text-center", children: [
|
|
4339
4339
|
/* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
4340
4340
|
x && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: x })
|
|
4341
4341
|
] }) });
|
|
4342
|
-
if (
|
|
4343
|
-
return /* @__PURE__ */ i(
|
|
4342
|
+
if (R > 0)
|
|
4343
|
+
return /* @__PURE__ */ i(K, { children: [
|
|
4344
4344
|
/* @__PURE__ */ i(de, { children: [
|
|
4345
4345
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4346
4346
|
s.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
4347
4347
|
] }),
|
|
4348
|
-
/* @__PURE__ */ i(
|
|
4348
|
+
/* @__PURE__ */ i(j, { className: "py-12 text-center", children: [
|
|
4349
4349
|
/* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
4350
|
-
/* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: f(
|
|
4350
|
+
/* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: f(R) }),
|
|
4351
4351
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
4352
4352
|
] }),
|
|
4353
4353
|
x && /* @__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: x }) })
|
|
4354
4354
|
] })
|
|
4355
4355
|
] });
|
|
4356
|
-
const
|
|
4357
|
-
return F ? /* @__PURE__ */ r("form", { onSubmit:
|
|
4356
|
+
const Y = s.testAllowedMaxTry - s.totalFailedTries;
|
|
4357
|
+
return F ? /* @__PURE__ */ r("form", { onSubmit: $, children: /* @__PURE__ */ i(K, { children: [
|
|
4358
4358
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4359
4359
|
/* @__PURE__ */ i("div", { children: [
|
|
4360
4360
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
@@ -4371,7 +4371,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4371
4371
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
4372
4372
|
] })
|
|
4373
4373
|
] }) }),
|
|
4374
|
-
/* @__PURE__ */ i(
|
|
4374
|
+
/* @__PURE__ */ i(j, { className: "space-y-6", children: [
|
|
4375
4375
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4376
4376
|
/* @__PURE__ */ i(Ce, { variant: "info", children: [
|
|
4377
4377
|
"Question ",
|
|
@@ -4379,10 +4379,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4379
4379
|
" of ",
|
|
4380
4380
|
s.totalQuestionCount
|
|
4381
4381
|
] }),
|
|
4382
|
-
/* @__PURE__ */ i(Ce, { variant:
|
|
4383
|
-
|
|
4382
|
+
/* @__PURE__ */ i(Ce, { variant: Y > 1 ? "success" : "warning", children: [
|
|
4383
|
+
Y,
|
|
4384
4384
|
" attempt",
|
|
4385
|
-
|
|
4385
|
+
Y !== 1 ? "s" : "",
|
|
4386
4386
|
" remaining"
|
|
4387
4387
|
] })
|
|
4388
4388
|
] }),
|
|
@@ -4414,7 +4414,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4414
4414
|
name: `question-${z.id}`,
|
|
4415
4415
|
value: Z,
|
|
4416
4416
|
checked: y[z.id] === Z,
|
|
4417
|
-
onChange: (_) =>
|
|
4417
|
+
onChange: (_) => I(z.id, _.target.value),
|
|
4418
4418
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4419
4419
|
disabled: u
|
|
4420
4420
|
}
|
|
@@ -4428,12 +4428,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4428
4428
|
},
|
|
4429
4429
|
z.id
|
|
4430
4430
|
)),
|
|
4431
|
-
x && !
|
|
4431
|
+
x && !O && /* @__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__ */ i("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4432
4432
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
4433
4433
|
" ",
|
|
4434
4434
|
x
|
|
4435
4435
|
] }) }),
|
|
4436
|
-
|
|
4436
|
+
O && /* @__PURE__ */ r("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
|
|
4437
4437
|
/* @__PURE__ */ r("strong", { children: "Time's up!" }),
|
|
4438
4438
|
" Your answers are being submitted automatically."
|
|
4439
4439
|
] }) })
|
|
@@ -4455,16 +4455,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4455
4455
|
type: "submit",
|
|
4456
4456
|
isLoading: u,
|
|
4457
4457
|
disabled: Object.keys(y).length < s.totalQuestionCount,
|
|
4458
|
-
children:
|
|
4458
|
+
children: O ? "Submitting..." : "Submit Test"
|
|
4459
4459
|
}
|
|
4460
4460
|
)
|
|
4461
4461
|
] })
|
|
4462
|
-
] }) }) : /* @__PURE__ */ i(
|
|
4462
|
+
] }) }) : /* @__PURE__ */ i(K, { children: [
|
|
4463
4463
|
/* @__PURE__ */ i(de, { children: [
|
|
4464
4464
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4465
4465
|
s.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
4466
4466
|
] }),
|
|
4467
|
-
/* @__PURE__ */ i(
|
|
4467
|
+
/* @__PURE__ */ i(j, { children: [
|
|
4468
4468
|
s.description && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-gray-700 dark:text-gray-300", children: s.description }) }),
|
|
4469
4469
|
/* @__PURE__ */ i("div", { className: "space-y-4 mb-6", children: [
|
|
4470
4470
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
@@ -4481,7 +4481,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4481
4481
|
] }),
|
|
4482
4482
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4483
4483
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4484
|
-
/* @__PURE__ */ r(Ce, { variant:
|
|
4484
|
+
/* @__PURE__ */ r(Ce, { variant: Y > 1 ? "success" : "warning", children: Y })
|
|
4485
4485
|
] })
|
|
4486
4486
|
] }),
|
|
4487
4487
|
x && /* @__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__ */ i("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -4489,7 +4489,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4489
4489
|
" ",
|
|
4490
4490
|
x
|
|
4491
4491
|
] }) }),
|
|
4492
|
-
|
|
4492
|
+
Y <= 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." }) })
|
|
4493
4493
|
] }),
|
|
4494
4494
|
/* @__PURE__ */ i(pe, { className: "flex justify-between", children: [
|
|
4495
4495
|
n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
@@ -4497,8 +4497,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4497
4497
|
V,
|
|
4498
4498
|
{
|
|
4499
4499
|
type: "button",
|
|
4500
|
-
onClick:
|
|
4501
|
-
disabled:
|
|
4500
|
+
onClick: w,
|
|
4501
|
+
disabled: Y <= 0,
|
|
4502
4502
|
children: "Start Test"
|
|
4503
4503
|
}
|
|
4504
4504
|
)
|
|
@@ -4510,7 +4510,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4510
4510
|
onBack: n
|
|
4511
4511
|
}) => {
|
|
4512
4512
|
var Z, N, _, ne;
|
|
4513
|
-
const { applicantService: a, baseInformationService: s, config: o } = ye(), { identityData: l, provider: c, token: u, isLoading: m, error: x, requestIdentity: p, restartIdentity: y } = xr(e), [g, h] = v(null), [
|
|
4513
|
+
const { applicantService: a, baseInformationService: s, config: o } = ye(), { identityData: l, provider: c, token: u, isLoading: m, error: x, requestIdentity: p, restartIdentity: y } = xr(e), [g, h] = v(null), [C, F] = v(null), [k, O] = v([]), [E, R] = v(!0), [H, J] = v(!1), [f, w] = v(null), [I, $] = v(!1), P = fe.useRef(!1), Y = wt({
|
|
4514
4514
|
defaultValues: {
|
|
4515
4515
|
street: "",
|
|
4516
4516
|
streetNumber: "",
|
|
@@ -4524,25 +4524,25 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4524
4524
|
re(() => {
|
|
4525
4525
|
(async () => {
|
|
4526
4526
|
try {
|
|
4527
|
-
const [D,
|
|
4527
|
+
const [D, A] = await Promise.all([
|
|
4528
4528
|
a.getApplicantData(e),
|
|
4529
4529
|
s.getCountries("", "en")
|
|
4530
4530
|
]);
|
|
4531
4531
|
F(D);
|
|
4532
|
-
const U = /* @__PURE__ */ new Set(), ee =
|
|
4532
|
+
const U = /* @__PURE__ */ new Set(), ee = A.filter((he) => {
|
|
4533
4533
|
const Oe = he.abbreviation3 || he.abbreviation;
|
|
4534
4534
|
return !Oe || U.has(Oe) ? !1 : (U.add(Oe), !0);
|
|
4535
4535
|
});
|
|
4536
|
-
|
|
4537
|
-
const
|
|
4538
|
-
if (
|
|
4539
|
-
street: (
|
|
4540
|
-
streetNumber: (
|
|
4541
|
-
city: (
|
|
4542
|
-
zip: (
|
|
4543
|
-
country: (
|
|
4544
|
-
nationality: (
|
|
4545
|
-
phonenumber: (
|
|
4536
|
+
O(ee);
|
|
4537
|
+
const W = D.applicantRequestData;
|
|
4538
|
+
if (Y.reset({
|
|
4539
|
+
street: (W == null ? void 0 : W.street) || "",
|
|
4540
|
+
streetNumber: (W == null ? void 0 : W.streetNumber) || "",
|
|
4541
|
+
city: (W == null ? void 0 : W.city) || "",
|
|
4542
|
+
zip: (W == null ? void 0 : W.zip) || "",
|
|
4543
|
+
country: (W == null ? void 0 : W.country) || "",
|
|
4544
|
+
nationality: (W == null ? void 0 : W.nationality) || "",
|
|
4545
|
+
phonenumber: (W == null ? void 0 : W.phonenumber) || ""
|
|
4546
4546
|
}), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !P.current) {
|
|
4547
4547
|
console.log("[Identity] Found existing identity verification, auto-requesting..."), P.current = !0;
|
|
4548
4548
|
try {
|
|
@@ -4554,7 +4554,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4554
4554
|
} catch (D) {
|
|
4555
4555
|
console.error("Error loading applicant data:", D);
|
|
4556
4556
|
} finally {
|
|
4557
|
-
|
|
4557
|
+
R(!1);
|
|
4558
4558
|
}
|
|
4559
4559
|
})();
|
|
4560
4560
|
}, [e]), re(() => {
|
|
@@ -4564,7 +4564,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4564
4564
|
if (u.expiresAt) {
|
|
4565
4565
|
const B = new Date(u.expiresAt).getTime();
|
|
4566
4566
|
if (Date.now() >= B) {
|
|
4567
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
4567
|
+
console.warn("[Identity] Token has expired (expiresAt)"), $(!0), w("Your verification session has expired. Please restart.");
|
|
4568
4568
|
return;
|
|
4569
4569
|
}
|
|
4570
4570
|
}
|
|
@@ -4572,22 +4572,22 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4572
4572
|
try {
|
|
4573
4573
|
const D = new URL(u.url).toString().toLowerCase();
|
|
4574
4574
|
if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
|
|
4575
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
4575
|
+
console.warn("[Identity] Token URL indicates expiration"), $(!0), w("Your verification link has expired. Please restart.");
|
|
4576
4576
|
return;
|
|
4577
4577
|
}
|
|
4578
4578
|
} catch {
|
|
4579
4579
|
console.error("[Identity] Invalid token URL");
|
|
4580
4580
|
}
|
|
4581
4581
|
if (u.status === "expired" || u.error === "expired" || u.expired === !0) {
|
|
4582
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
4582
|
+
console.warn("[Identity] Token object indicates expiration"), $(!0), w("Your verification session has expired. Please restart.");
|
|
4583
4583
|
return;
|
|
4584
4584
|
}
|
|
4585
4585
|
}
|
|
4586
4586
|
}, [u]), re(() => {
|
|
4587
|
-
if (c !== null && u && !g && H && !
|
|
4587
|
+
if (c !== null && u && !g && H && !I) {
|
|
4588
4588
|
const B = c;
|
|
4589
4589
|
if (u.url) {
|
|
4590
|
-
console.log("[Identity] Loading provider URL for user verification:", u.url),
|
|
4590
|
+
console.log("[Identity] Loading provider URL for user verification:", u.url), w(null);
|
|
4591
4591
|
try {
|
|
4592
4592
|
if (new URL(u.url), B === xe.SardinAI) {
|
|
4593
4593
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
@@ -4604,42 +4604,42 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4604
4604
|
}
|
|
4605
4605
|
h({ type: "url", url: u.url });
|
|
4606
4606
|
} catch (D) {
|
|
4607
|
-
console.error("[Identity] Invalid URL:", D),
|
|
4607
|
+
console.error("[Identity] Invalid URL:", D), w("Invalid verification URL. Please restart."), $(!0);
|
|
4608
4608
|
}
|
|
4609
4609
|
return;
|
|
4610
4610
|
}
|
|
4611
4611
|
if (B === xe.SardinAI) {
|
|
4612
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
4612
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), w(null);
|
|
4613
4613
|
try {
|
|
4614
|
-
const D = Te.parseProviderConfig(c, u, o),
|
|
4615
|
-
|
|
4616
|
-
console.log("[SardinAI] Risk SDK initialized successfully"), h(
|
|
4614
|
+
const D = Te.parseProviderConfig(c, u, o), A = Te.createProvider(c, D);
|
|
4615
|
+
A.initialize().then(() => {
|
|
4616
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), h(A), setTimeout(() => {
|
|
4617
4617
|
t == null || t();
|
|
4618
4618
|
}, 2e3);
|
|
4619
4619
|
}).catch((U) => {
|
|
4620
|
-
var
|
|
4620
|
+
var W;
|
|
4621
4621
|
console.error("[SardinAI] Failed to initialize:", U);
|
|
4622
|
-
const ee = ((
|
|
4623
|
-
ee.includes("expired") || ee.includes("invalid") || ee.includes("401") || ee.includes("400") ? (
|
|
4622
|
+
const ee = ((W = U.message) == null ? void 0 : W.toLowerCase()) || "";
|
|
4623
|
+
ee.includes("expired") || ee.includes("invalid") || ee.includes("401") || ee.includes("400") ? ($(!0), w("Session expired or invalid. Please restart verification.")) : w(`Failed to initialize: ${U.message}`);
|
|
4624
4624
|
});
|
|
4625
4625
|
} catch (D) {
|
|
4626
|
-
console.error("[SardinAI] Error creating provider:", D),
|
|
4626
|
+
console.error("[SardinAI] Error creating provider:", D), w(`Configuration error: ${D.message}`);
|
|
4627
4627
|
}
|
|
4628
4628
|
return;
|
|
4629
4629
|
}
|
|
4630
4630
|
try {
|
|
4631
|
-
|
|
4632
|
-
const D = Te.parseProviderConfig(c, u, o),
|
|
4633
|
-
B === xe.Sumsub ? (
|
|
4631
|
+
w(null);
|
|
4632
|
+
const D = Te.parseProviderConfig(c, u, o), A = Te.createProvider(c, D);
|
|
4633
|
+
B === xe.Sumsub ? (A.initialize("identity-container").catch((U) => {
|
|
4634
4634
|
var ee;
|
|
4635
|
-
console.error("[Sumsub] Initialization error:", U),
|
|
4636
|
-
}),
|
|
4635
|
+
console.error("[Sumsub] Initialization error:", U), w(`Failed to initialize: ${U.message}`), (ee = U.message) != null && ee.toLowerCase().includes("expired") && $(!0);
|
|
4636
|
+
}), A.onComplete && A.onComplete(() => {
|
|
4637
4637
|
t == null || t();
|
|
4638
|
-
})) : B === xe.Onfido &&
|
|
4639
|
-
console.error("[Onfido] Initialization error:", U),
|
|
4640
|
-
}), h(
|
|
4638
|
+
})) : B === xe.Onfido && A.initialize("identity-container").catch((U) => {
|
|
4639
|
+
console.error("[Onfido] Initialization error:", U), w(`Failed to initialize: ${U.message}`);
|
|
4640
|
+
}), h(A);
|
|
4641
4641
|
} catch (D) {
|
|
4642
|
-
console.error("[Identity] Provider setup error:", D),
|
|
4642
|
+
console.error("[Identity] Provider setup error:", D), w(`Setup error: ${D.message}`);
|
|
4643
4643
|
}
|
|
4644
4644
|
}
|
|
4645
4645
|
return () => {
|
|
@@ -4650,34 +4650,34 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4650
4650
|
console.error("[Identity] Error destroying provider:", B);
|
|
4651
4651
|
}
|
|
4652
4652
|
};
|
|
4653
|
-
}, [c, u, g, H, t,
|
|
4653
|
+
}, [c, u, g, H, t, I]);
|
|
4654
4654
|
const z = async () => {
|
|
4655
4655
|
try {
|
|
4656
|
-
|
|
4656
|
+
w(null), $(!1), await p(), J(!0);
|
|
4657
4657
|
} catch (B) {
|
|
4658
4658
|
console.error("Error starting identity verification:", B);
|
|
4659
4659
|
}
|
|
4660
4660
|
}, L = async () => {
|
|
4661
4661
|
try {
|
|
4662
|
-
|
|
4662
|
+
w(null), $(!1), h(null), console.log("[Identity] Restarting verification..."), await y(), J(!0);
|
|
4663
4663
|
} catch (B) {
|
|
4664
|
-
console.error("Error restarting identity verification:", B),
|
|
4664
|
+
console.error("Error restarting identity verification:", B), w(B.message || "Failed to restart verification");
|
|
4665
4665
|
}
|
|
4666
4666
|
};
|
|
4667
|
-
if (
|
|
4668
|
-
return /* @__PURE__ */ r(
|
|
4667
|
+
if (E || m)
|
|
4668
|
+
return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ i(j, { children: [
|
|
4669
4669
|
/* @__PURE__ */ r(ve, { className: "my-8" }),
|
|
4670
4670
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4671
4671
|
] }) });
|
|
4672
4672
|
if (x)
|
|
4673
|
-
return /* @__PURE__ */ r(
|
|
4673
|
+
return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
4674
4674
|
"Error: ",
|
|
4675
4675
|
x.message
|
|
4676
4676
|
] }) }) });
|
|
4677
|
-
if (H && (f ||
|
|
4678
|
-
return /* @__PURE__ */ i(
|
|
4677
|
+
if (H && (f || I))
|
|
4678
|
+
return /* @__PURE__ */ i(K, { children: [
|
|
4679
4679
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4680
|
-
/* @__PURE__ */ i(
|
|
4680
|
+
/* @__PURE__ */ i(j, { children: [
|
|
4681
4681
|
/* @__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__ */ i("div", { className: "flex items-start", children: [
|
|
4682
4682
|
/* @__PURE__ */ r(
|
|
4683
4683
|
"svg",
|
|
@@ -4698,7 +4698,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4698
4698
|
}
|
|
4699
4699
|
),
|
|
4700
4700
|
/* @__PURE__ */ i("div", { children: [
|
|
4701
|
-
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children:
|
|
4701
|
+
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: I ? "Session Expired" : "Verification Error" }),
|
|
4702
4702
|
/* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children: f || "Your verification session has expired and needs to be restarted." })
|
|
4703
4703
|
] })
|
|
4704
4704
|
] }) }),
|
|
@@ -4718,7 +4718,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4718
4718
|
] });
|
|
4719
4719
|
if (H && l) {
|
|
4720
4720
|
const B = c;
|
|
4721
|
-
return u != null && u.url ? /* @__PURE__ */ i(
|
|
4721
|
+
return u != null && u.url ? /* @__PURE__ */ i(K, { children: [
|
|
4722
4722
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4723
4723
|
/* @__PURE__ */ i("div", { children: [
|
|
4724
4724
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
@@ -4736,7 +4736,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4736
4736
|
}
|
|
4737
4737
|
)
|
|
4738
4738
|
] }) }),
|
|
4739
|
-
/* @__PURE__ */ i(
|
|
4739
|
+
/* @__PURE__ */ i(j, { children: [
|
|
4740
4740
|
/* @__PURE__ */ r("div", { className: "mb-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
|
|
4741
4741
|
/* @__PURE__ */ r("strong", { children: "Important:" }),
|
|
4742
4742
|
' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
|
|
@@ -4749,13 +4749,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4749
4749
|
allow: "camera; microphone; geolocation",
|
|
4750
4750
|
title: "Identity Verification",
|
|
4751
4751
|
onLoad: (D) => {
|
|
4752
|
-
var
|
|
4752
|
+
var A, U, ee;
|
|
4753
4753
|
console.log("[Identity] Iframe loaded");
|
|
4754
4754
|
try {
|
|
4755
|
-
const
|
|
4756
|
-
if (
|
|
4757
|
-
const he = ((ee = (U =
|
|
4758
|
-
(he.includes("expired") || he.includes("invalid") || he.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"),
|
|
4755
|
+
const W = D.target, Se = W.contentDocument || ((A = W.contentWindow) == null ? void 0 : A.document);
|
|
4756
|
+
if (Se) {
|
|
4757
|
+
const he = ((ee = (U = Se.body) == null ? void 0 : U.textContent) == null ? void 0 : ee.toLowerCase()) || "";
|
|
4758
|
+
(he.includes("expired") || he.includes("invalid") || he.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), $(!0), w("Your verification link has expired."));
|
|
4759
4759
|
}
|
|
4760
4760
|
} catch {
|
|
4761
4761
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4765,47 +4765,47 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4765
4765
|
) })
|
|
4766
4766
|
] }),
|
|
4767
4767
|
n && /* @__PURE__ */ r(pe, { children: /* @__PURE__ */ r(V, { variant: "outline", onClick: n, children: "Back" }) })
|
|
4768
|
-
] }) : B === xe.SardinAI ? /* @__PURE__ */ i(
|
|
4768
|
+
] }) : B === xe.SardinAI ? /* @__PURE__ */ i(K, { children: [
|
|
4769
4769
|
/* @__PURE__ */ i(de, { children: [
|
|
4770
4770
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4771
4771
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4772
4772
|
] }),
|
|
4773
|
-
/* @__PURE__ */ r(
|
|
4773
|
+
/* @__PURE__ */ r(j, { children: /* @__PURE__ */ i("div", { className: "text-center py-12", children: [
|
|
4774
4774
|
/* @__PURE__ */ r(ve, { className: "mb-4" }),
|
|
4775
4775
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4776
4776
|
/* @__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" })
|
|
4777
4777
|
] }) })
|
|
4778
|
-
] }) : /* @__PURE__ */ i(
|
|
4778
|
+
] }) : /* @__PURE__ */ i(K, { children: [
|
|
4779
4779
|
/* @__PURE__ */ i(de, { children: [
|
|
4780
4780
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4781
4781
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4782
4782
|
] }),
|
|
4783
|
-
/* @__PURE__ */ r(
|
|
4783
|
+
/* @__PURE__ */ r(j, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4784
4784
|
n && /* @__PURE__ */ r(pe, { children: /* @__PURE__ */ r(V, { variant: "outline", onClick: n, children: "Back" }) })
|
|
4785
4785
|
] });
|
|
4786
4786
|
}
|
|
4787
|
-
return /* @__PURE__ */ r("form", { onSubmit:
|
|
4787
|
+
return /* @__PURE__ */ r("form", { onSubmit: Y.handleSubmit(z), children: /* @__PURE__ */ i(K, { children: [
|
|
4788
4788
|
/* @__PURE__ */ i(de, { children: [
|
|
4789
4789
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Review Your Information" }),
|
|
4790
4790
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
4791
4791
|
] }),
|
|
4792
|
-
/* @__PURE__ */ i(
|
|
4792
|
+
/* @__PURE__ */ i(j, { className: "space-y-6", children: [
|
|
4793
4793
|
/* @__PURE__ */ i("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
|
|
4794
4794
|
/* @__PURE__ */ i("div", { children: [
|
|
4795
4795
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4796
4796
|
/* @__PURE__ */ i("p", { className: "mt-1 text-base", children: [
|
|
4797
|
-
(Z =
|
|
4797
|
+
(Z = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : Z.firstName,
|
|
4798
4798
|
" ",
|
|
4799
|
-
(N =
|
|
4799
|
+
(N = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : N.lastName
|
|
4800
4800
|
] })
|
|
4801
4801
|
] }),
|
|
4802
4802
|
/* @__PURE__ */ i("div", { children: [
|
|
4803
4803
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4804
|
-
/* @__PURE__ */ r("p", { className: "mt-1 text-base", children: (_ =
|
|
4804
|
+
/* @__PURE__ */ r("p", { className: "mt-1 text-base", children: (_ = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : _.email })
|
|
4805
4805
|
] }),
|
|
4806
4806
|
/* @__PURE__ */ i("div", { children: [
|
|
4807
4807
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4808
|
-
/* @__PURE__ */ r("p", { className: "mt-1 text-base", children: ((ne =
|
|
4808
|
+
/* @__PURE__ */ r("p", { className: "mt-1 text-base", children: ((ne = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : ne.dateOfBirth) || "Not provided" })
|
|
4809
4809
|
] })
|
|
4810
4810
|
] }),
|
|
4811
4811
|
/* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
@@ -4814,7 +4814,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4814
4814
|
/* @__PURE__ */ r(
|
|
4815
4815
|
Re,
|
|
4816
4816
|
{
|
|
4817
|
-
control:
|
|
4817
|
+
control: Y.control,
|
|
4818
4818
|
name: "country",
|
|
4819
4819
|
render: ({ field: B }) => /* @__PURE__ */ r(
|
|
4820
4820
|
_e,
|
|
@@ -4823,7 +4823,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4823
4823
|
label: "Country",
|
|
4824
4824
|
options: [
|
|
4825
4825
|
{ value: "", label: "Select country..." },
|
|
4826
|
-
...
|
|
4826
|
+
...k.map((D) => ({
|
|
4827
4827
|
value: D.abbreviation3 || D.abbreviation,
|
|
4828
4828
|
label: D.name
|
|
4829
4829
|
}))
|
|
@@ -4835,7 +4835,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4835
4835
|
/* @__PURE__ */ r(
|
|
4836
4836
|
Re,
|
|
4837
4837
|
{
|
|
4838
|
-
control:
|
|
4838
|
+
control: Y.control,
|
|
4839
4839
|
name: "nationality",
|
|
4840
4840
|
render: ({ field: B }) => /* @__PURE__ */ r(
|
|
4841
4841
|
_e,
|
|
@@ -4844,7 +4844,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4844
4844
|
label: "Nationality",
|
|
4845
4845
|
options: [
|
|
4846
4846
|
{ value: "", label: "Select nationality..." },
|
|
4847
|
-
...
|
|
4847
|
+
...k.map((D) => ({
|
|
4848
4848
|
value: D.abbreviation3 || D.abbreviation,
|
|
4849
4849
|
label: D.name
|
|
4850
4850
|
}))
|
|
@@ -4858,7 +4858,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4858
4858
|
/* @__PURE__ */ r(
|
|
4859
4859
|
Re,
|
|
4860
4860
|
{
|
|
4861
|
-
control:
|
|
4861
|
+
control: Y.control,
|
|
4862
4862
|
name: "street",
|
|
4863
4863
|
render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Street" })
|
|
4864
4864
|
}
|
|
@@ -4866,7 +4866,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4866
4866
|
/* @__PURE__ */ r(
|
|
4867
4867
|
Re,
|
|
4868
4868
|
{
|
|
4869
|
-
control:
|
|
4869
|
+
control: Y.control,
|
|
4870
4870
|
name: "streetNumber",
|
|
4871
4871
|
render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Street Number" })
|
|
4872
4872
|
}
|
|
@@ -4876,7 +4876,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4876
4876
|
/* @__PURE__ */ r(
|
|
4877
4877
|
Re,
|
|
4878
4878
|
{
|
|
4879
|
-
control:
|
|
4879
|
+
control: Y.control,
|
|
4880
4880
|
name: "city",
|
|
4881
4881
|
render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "City" })
|
|
4882
4882
|
}
|
|
@@ -4884,7 +4884,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4884
4884
|
/* @__PURE__ */ r(
|
|
4885
4885
|
Re,
|
|
4886
4886
|
{
|
|
4887
|
-
control:
|
|
4887
|
+
control: Y.control,
|
|
4888
4888
|
name: "zip",
|
|
4889
4889
|
render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "ZIP/Postal Code" })
|
|
4890
4890
|
}
|
|
@@ -4893,7 +4893,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4893
4893
|
/* @__PURE__ */ r(
|
|
4894
4894
|
Re,
|
|
4895
4895
|
{
|
|
4896
|
-
control:
|
|
4896
|
+
control: Y.control,
|
|
4897
4897
|
name: "phonenumber",
|
|
4898
4898
|
render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Phone Number", type: "tel" })
|
|
4899
4899
|
}
|
|
@@ -4984,8 +4984,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4984
4984
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4985
4985
|
message: "Your application is being reviewed."
|
|
4986
4986
|
};
|
|
4987
|
-
return /* @__PURE__ */ i(
|
|
4988
|
-
/* @__PURE__ */ i(
|
|
4987
|
+
return /* @__PURE__ */ i(K, { children: [
|
|
4988
|
+
/* @__PURE__ */ i(j, { className: "py-12", children: [
|
|
4989
4989
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
4990
4990
|
"div",
|
|
4991
4991
|
{
|
|
@@ -5040,7 +5040,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5040
5040
|
] }),
|
|
5041
5041
|
/* @__PURE__ */ i(pe, { className: "flex justify-center gap-4", children: [
|
|
5042
5042
|
c.type === "success" && s && /* @__PURE__ */ r(V, { onClick: s, size: "lg", children: "Continue" }),
|
|
5043
|
-
c.type === "error" && /* @__PURE__ */ i(
|
|
5043
|
+
c.type === "error" && /* @__PURE__ */ i(kt, { children: [
|
|
5044
5044
|
o && /* @__PURE__ */ r(V, { variant: "outline", onClick: o, children: "Contact Support" }),
|
|
5045
5045
|
s && /* @__PURE__ */ r(V, { onClick: s, children: "Try Again" })
|
|
5046
5046
|
] }),
|
|
@@ -5087,7 +5087,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5087
5087
|
function He(e) {
|
|
5088
5088
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
5089
5089
|
}
|
|
5090
|
-
const
|
|
5090
|
+
const Be = {
|
|
5091
5091
|
width: "16px",
|
|
5092
5092
|
height: "16px",
|
|
5093
5093
|
minWidth: "16px",
|
|
@@ -5115,8 +5115,8 @@ const $e = {
|
|
|
5115
5115
|
() => l != null && l.applicantFormPages && l.applicantFormPages.length > 0 ? l.applicantFormPages : null,
|
|
5116
5116
|
[l == null ? void 0 : l.applicantFormPages]
|
|
5117
5117
|
), y = Ae(() => {
|
|
5118
|
-
const d = new Set(Ye),
|
|
5119
|
-
if (
|
|
5118
|
+
const d = new Set(Ye), M = l == null ? void 0 : l.applicantFormRequiredFields;
|
|
5119
|
+
if (M) for (const T of M) d.add(T);
|
|
5120
5120
|
if (p)
|
|
5121
5121
|
for (const T of p)
|
|
5122
5122
|
for (const b of T.fields)
|
|
@@ -5125,15 +5125,15 @@ const $e = {
|
|
|
5125
5125
|
}, [l == null ? void 0 : l.applicantFormRequiredFields, p]), g = Ae(() => {
|
|
5126
5126
|
var T;
|
|
5127
5127
|
if (p) {
|
|
5128
|
-
const b = p.flatMap((
|
|
5129
|
-
for (const
|
|
5130
|
-
return Array.from(
|
|
5128
|
+
const b = p.flatMap((q) => q.fields).filter((q) => !q.isCustom && q.name).map((q) => q.name), S = new Set(b);
|
|
5129
|
+
for (const q of Ye) S.add(q);
|
|
5130
|
+
return Array.from(S);
|
|
5131
5131
|
}
|
|
5132
5132
|
let d;
|
|
5133
5133
|
(T = s.applicantForm) != null && T.visibleFields ? d = s.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? d = l.applicantFormVisibleFields : d = Tt;
|
|
5134
|
-
const
|
|
5135
|
-
for (const b of Ye)
|
|
5136
|
-
return Array.from(
|
|
5134
|
+
const M = new Set(d);
|
|
5135
|
+
for (const b of Ye) M.add(b);
|
|
5136
|
+
return Array.from(M);
|
|
5137
5137
|
}, [(Xe = s.applicantForm) == null ? void 0 : Xe.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields, p]), h = /* @__PURE__ */ new Set([
|
|
5138
5138
|
"country",
|
|
5139
5139
|
"nationality",
|
|
@@ -5141,49 +5141,49 @@ const $e = {
|
|
|
5141
5141
|
"countryOfBirth",
|
|
5142
5142
|
"mobileCountryCode",
|
|
5143
5143
|
"otherNationality"
|
|
5144
|
-
]),
|
|
5145
|
-
var
|
|
5144
|
+
]), C = Ae(() => {
|
|
5145
|
+
var M, T;
|
|
5146
5146
|
const d = /* @__PURE__ */ new Set();
|
|
5147
5147
|
if (p)
|
|
5148
5148
|
for (const b of p)
|
|
5149
|
-
for (const
|
|
5150
|
-
!
|
|
5149
|
+
for (const S of b.fields)
|
|
5150
|
+
!S.isCustom && S.name && h.has(S.name) && d.add(S.countriesType ?? ((M = Le[S.name]) == null ? void 0 : M.countriesType));
|
|
5151
5151
|
else
|
|
5152
5152
|
for (const b of g)
|
|
5153
5153
|
h.has(b) && d.add((T = Le[b]) == null ? void 0 : T.countriesType);
|
|
5154
5154
|
return d.size === 0 && d.add(void 0), Array.from(d);
|
|
5155
|
-
}, [g, p]), [F,
|
|
5155
|
+
}, [g, p]), [F, k] = v({}), [O, E] = v(!0), R = X(!1), H = X(/* @__PURE__ */ new Set());
|
|
5156
5156
|
re(() => {
|
|
5157
|
-
if (
|
|
5158
|
-
const d =
|
|
5157
|
+
if (R.current || C.length === 0) return;
|
|
5158
|
+
const d = C.filter((T) => {
|
|
5159
5159
|
const b = T != null ? String(T) : "all";
|
|
5160
5160
|
return !H.current.has(b);
|
|
5161
5161
|
});
|
|
5162
5162
|
if (d.length === 0) {
|
|
5163
|
-
|
|
5163
|
+
E(!1);
|
|
5164
5164
|
return;
|
|
5165
5165
|
}
|
|
5166
|
-
|
|
5166
|
+
R.current = !0, E(!0), (async () => {
|
|
5167
5167
|
try {
|
|
5168
5168
|
const T = await Promise.all(
|
|
5169
5169
|
d.map(async (b) => {
|
|
5170
|
-
const
|
|
5171
|
-
return H.current.add(
|
|
5170
|
+
const S = b != null ? String(b) : "all", q = await o.getCountries("", s.locale || "en", b), ae = /* @__PURE__ */ new Set(), se = q.map((ie) => ({ value: ie.abbreviation3 || ie.abbreviation, label: ie.name })).filter((ie) => !ie.value || ae.has(ie.value) ? !1 : (ae.add(ie.value), !0));
|
|
5171
|
+
return H.current.add(S), [S, se];
|
|
5172
5172
|
})
|
|
5173
5173
|
);
|
|
5174
|
-
|
|
5174
|
+
k((b) => ({ ...b, ...Object.fromEntries(T) }));
|
|
5175
5175
|
} catch (T) {
|
|
5176
5176
|
console.error("Failed to load countries:", T);
|
|
5177
5177
|
} finally {
|
|
5178
|
-
|
|
5178
|
+
E(!1), R.current = !1;
|
|
5179
5179
|
}
|
|
5180
5180
|
})();
|
|
5181
|
-
}, [
|
|
5182
|
-
const J = (d,
|
|
5183
|
-
var
|
|
5184
|
-
const T =
|
|
5181
|
+
}, [C]);
|
|
5182
|
+
const J = (d, M) => {
|
|
5183
|
+
var S;
|
|
5184
|
+
const T = M ?? ((S = Le[d]) == null ? void 0 : S.countriesType), b = T != null ? String(T) : "all";
|
|
5185
5185
|
return F[b] || [];
|
|
5186
|
-
}, [f,
|
|
5186
|
+
}, [f, w] = v({
|
|
5187
5187
|
workflowKey: m,
|
|
5188
5188
|
firstName: "",
|
|
5189
5189
|
lastName: "",
|
|
@@ -5208,41 +5208,42 @@ const $e = {
|
|
|
5208
5208
|
educationLevel: "",
|
|
5209
5209
|
occupation: "",
|
|
5210
5210
|
taxNumber: ""
|
|
5211
|
-
}), [
|
|
5211
|
+
}), [I, $] = v({}), [P, Y] = v(0), [z, L] = v({}), [Z, N] = v(null), [_, ne] = v(!1), B = (d, M) => w((T) => ({ ...T, [d]: M })), D = (d, M) => $((T) => ({ ...T, [d]: M })), A = (d) => !d.conditionalOn || I[d.conditionalOn] === "true", U = p && P < p.length - 1 ? P + 1 : -1, ee = p && P > 0 ? P - 1 : -1, W = (d) => {
|
|
5212
5212
|
var T;
|
|
5213
|
-
const
|
|
5213
|
+
const M = {};
|
|
5214
5214
|
for (const b of d.fields)
|
|
5215
5215
|
if (b.isCustom) {
|
|
5216
|
+
if (b.customType === "paragraph" || b.customType === "br") continue;
|
|
5216
5217
|
if (b.required && b.paramName) {
|
|
5217
|
-
const
|
|
5218
|
-
b.customType === "checkbox" || b.customType === "link_checkbox" ?
|
|
5218
|
+
const S = I[b.paramName], q = b.displayText || b.label || b.paramName;
|
|
5219
|
+
b.customType === "checkbox" || b.customType === "link_checkbox" ? S !== "true" && (M[b.paramName] = `${q} is required.`) : (!S || S.trim() === "") && (M[b.paramName] = `${q} is required.`);
|
|
5219
5220
|
}
|
|
5220
5221
|
} else if (b.name) {
|
|
5221
|
-
const
|
|
5222
|
-
if (y.includes(
|
|
5223
|
-
const
|
|
5224
|
-
|
|
5222
|
+
const S = b.name;
|
|
5223
|
+
if (y.includes(S) && He(f[S])) {
|
|
5224
|
+
const q = b.displayText || ((T = Le[S]) == null ? void 0 : T.label) || S;
|
|
5225
|
+
M[S] = `${q} is required.`;
|
|
5225
5226
|
}
|
|
5226
5227
|
}
|
|
5227
|
-
return
|
|
5228
|
-
},
|
|
5228
|
+
return M;
|
|
5229
|
+
}, Se = async () => {
|
|
5229
5230
|
if (!p) return;
|
|
5230
5231
|
const d = p[P];
|
|
5231
|
-
if (d.conditionalOn && !
|
|
5232
|
-
L({}), U >= 0 ?
|
|
5232
|
+
if (d.conditionalOn && !A(d)) {
|
|
5233
|
+
L({}), U >= 0 ? Y(U) : await he();
|
|
5233
5234
|
return;
|
|
5234
5235
|
}
|
|
5235
|
-
const
|
|
5236
|
-
if (Object.keys(
|
|
5237
|
-
L(
|
|
5236
|
+
const M = W(d);
|
|
5237
|
+
if (Object.keys(M).length > 0) {
|
|
5238
|
+
L(M);
|
|
5238
5239
|
return;
|
|
5239
5240
|
}
|
|
5240
|
-
L({}), U >= 0 ?
|
|
5241
|
+
L({}), U >= 0 ? Y(U) : await he();
|
|
5241
5242
|
}, he = async () => {
|
|
5242
5243
|
if (p) {
|
|
5243
5244
|
let d = {};
|
|
5244
|
-
for (const
|
|
5245
|
-
|
|
5245
|
+
for (const M of p)
|
|
5246
|
+
A(M) && (d = { ...d, ...W(M) });
|
|
5246
5247
|
if (Object.keys(d).length > 0) {
|
|
5247
5248
|
L(d);
|
|
5248
5249
|
return;
|
|
@@ -5260,31 +5261,31 @@ const $e = {
|
|
|
5260
5261
|
};
|
|
5261
5262
|
if (p) {
|
|
5262
5263
|
for (const b of p)
|
|
5263
|
-
if (
|
|
5264
|
-
for (const
|
|
5265
|
-
if (!
|
|
5266
|
-
const
|
|
5267
|
-
He(ae) || (d[
|
|
5264
|
+
if (A(b)) {
|
|
5265
|
+
for (const S of b.fields)
|
|
5266
|
+
if (!S.isCustom && S.name) {
|
|
5267
|
+
const q = S.name, ae = f[q];
|
|
5268
|
+
He(ae) || (d[q] = ae);
|
|
5268
5269
|
}
|
|
5269
5270
|
}
|
|
5270
5271
|
} else
|
|
5271
5272
|
g.forEach((b) => {
|
|
5272
5273
|
if (b === "externalRefId") return;
|
|
5273
|
-
const
|
|
5274
|
-
He(
|
|
5274
|
+
const S = f[b];
|
|
5275
|
+
He(S) || (d[b] = S);
|
|
5275
5276
|
});
|
|
5276
|
-
const
|
|
5277
|
+
const M = [];
|
|
5277
5278
|
if (p) {
|
|
5278
5279
|
for (const b of p)
|
|
5279
|
-
if (
|
|
5280
|
-
for (const
|
|
5281
|
-
if (
|
|
5282
|
-
const
|
|
5283
|
-
|
|
5280
|
+
if (A(b)) {
|
|
5281
|
+
for (const S of b.fields)
|
|
5282
|
+
if (S.isCustom && S.paramName && S.customType !== "paragraph" && S.customType !== "br") {
|
|
5283
|
+
const q = I[S.paramName] ?? "";
|
|
5284
|
+
M.push({ paramName: S.paramName, paramValue: q });
|
|
5284
5285
|
}
|
|
5285
5286
|
}
|
|
5286
5287
|
}
|
|
5287
|
-
|
|
5288
|
+
M.length > 0 && (d.applicantAdditionalDatas = M);
|
|
5288
5289
|
const T = await c(d);
|
|
5289
5290
|
n(T.applicantId);
|
|
5290
5291
|
} catch (d) {
|
|
@@ -5293,33 +5294,33 @@ const $e = {
|
|
|
5293
5294
|
ne(!1);
|
|
5294
5295
|
}
|
|
5295
5296
|
}, Oe = async (d) => {
|
|
5296
|
-
var
|
|
5297
|
+
var M;
|
|
5297
5298
|
d.preventDefault();
|
|
5298
5299
|
for (const T of y)
|
|
5299
5300
|
if (He(f[T])) {
|
|
5300
|
-
const b = ((
|
|
5301
|
+
const b = ((M = Le[T]) == null ? void 0 : M.label) || T;
|
|
5301
5302
|
N(`${b} is required.`);
|
|
5302
5303
|
return;
|
|
5303
5304
|
}
|
|
5304
5305
|
await he();
|
|
5305
|
-
}, Ve = (d,
|
|
5306
|
+
}, Ve = (d, M, T, b) => {
|
|
5306
5307
|
var et;
|
|
5307
|
-
const
|
|
5308
|
-
if (!
|
|
5309
|
-
const
|
|
5310
|
-
switch (
|
|
5308
|
+
const S = Le[d];
|
|
5309
|
+
if (!S) return null;
|
|
5310
|
+
const q = y.includes(d), ae = z[d], se = T || S.label, ie = M ?? d, ke = { required: q };
|
|
5311
|
+
switch (S.type) {
|
|
5311
5312
|
case "select":
|
|
5312
5313
|
if (d === "country" || d === "nationality" || d === "taxCountry" || d === "countryOfBirth" || d === "mobileCountryCode") {
|
|
5313
5314
|
const le = J(d, b);
|
|
5314
5315
|
return /* @__PURE__ */ r(
|
|
5315
5316
|
je,
|
|
5316
5317
|
{
|
|
5317
|
-
...
|
|
5318
|
+
...ke,
|
|
5318
5319
|
label: se,
|
|
5319
5320
|
value: f[d] || "",
|
|
5320
5321
|
onChange: (Ie) => B(d, Ie),
|
|
5321
5322
|
options: [{ value: "", label: `Select ${se.toLowerCase()}...` }, ...le],
|
|
5322
|
-
disabled:
|
|
5323
|
+
disabled: O,
|
|
5323
5324
|
error: ae
|
|
5324
5325
|
},
|
|
5325
5326
|
ie
|
|
@@ -5329,7 +5330,7 @@ const $e = {
|
|
|
5329
5330
|
return /* @__PURE__ */ r(
|
|
5330
5331
|
je,
|
|
5331
5332
|
{
|
|
5332
|
-
...
|
|
5333
|
+
...ke,
|
|
5333
5334
|
label: se,
|
|
5334
5335
|
value: ((et = f[d]) == null ? void 0 : et.toString()) || "",
|
|
5335
5336
|
onChange: (le) => B(d, le ? Number(le) : null),
|
|
@@ -5348,7 +5349,7 @@ const $e = {
|
|
|
5348
5349
|
return /* @__PURE__ */ r(
|
|
5349
5350
|
je,
|
|
5350
5351
|
{
|
|
5351
|
-
...
|
|
5352
|
+
...ke,
|
|
5352
5353
|
label: se,
|
|
5353
5354
|
value: f[d] || "",
|
|
5354
5355
|
onChange: (Ie) => B(d, Ie),
|
|
@@ -5363,15 +5364,15 @@ const $e = {
|
|
|
5363
5364
|
if (d === "otherNationality") {
|
|
5364
5365
|
const le = J(d, b);
|
|
5365
5366
|
return /* @__PURE__ */ r(
|
|
5366
|
-
|
|
5367
|
+
kr,
|
|
5367
5368
|
{
|
|
5368
|
-
...
|
|
5369
|
+
...ke,
|
|
5369
5370
|
label: se,
|
|
5370
5371
|
value: f[d] || [],
|
|
5371
5372
|
onChange: (Ie) => B(d, Ie),
|
|
5372
5373
|
options: le,
|
|
5373
5374
|
placeholder: "Select other nationalities...",
|
|
5374
|
-
disabled:
|
|
5375
|
+
disabled: O
|
|
5375
5376
|
},
|
|
5376
5377
|
ie
|
|
5377
5378
|
);
|
|
@@ -5381,7 +5382,7 @@ const $e = {
|
|
|
5381
5382
|
return /* @__PURE__ */ r(
|
|
5382
5383
|
me,
|
|
5383
5384
|
{
|
|
5384
|
-
...
|
|
5385
|
+
...ke,
|
|
5385
5386
|
type: "date",
|
|
5386
5387
|
label: se,
|
|
5387
5388
|
value: f[d] || "",
|
|
@@ -5394,7 +5395,7 @@ const $e = {
|
|
|
5394
5395
|
return /* @__PURE__ */ r(
|
|
5395
5396
|
me,
|
|
5396
5397
|
{
|
|
5397
|
-
...
|
|
5398
|
+
...ke,
|
|
5398
5399
|
type: "email",
|
|
5399
5400
|
label: se,
|
|
5400
5401
|
value: f[d] || "",
|
|
@@ -5407,7 +5408,7 @@ const $e = {
|
|
|
5407
5408
|
return /* @__PURE__ */ r(
|
|
5408
5409
|
me,
|
|
5409
5410
|
{
|
|
5410
|
-
...
|
|
5411
|
+
...ke,
|
|
5411
5412
|
type: "tel",
|
|
5412
5413
|
label: se,
|
|
5413
5414
|
value: f[d] || "",
|
|
@@ -5420,7 +5421,7 @@ const $e = {
|
|
|
5420
5421
|
return /* @__PURE__ */ r(
|
|
5421
5422
|
me,
|
|
5422
5423
|
{
|
|
5423
|
-
...
|
|
5424
|
+
...ke,
|
|
5424
5425
|
type: "text",
|
|
5425
5426
|
label: se,
|
|
5426
5427
|
value: f[d] || "",
|
|
@@ -5430,7 +5431,26 @@ const $e = {
|
|
|
5430
5431
|
ie
|
|
5431
5432
|
);
|
|
5432
5433
|
}
|
|
5433
|
-
}, ht = (d,
|
|
5434
|
+
}, ht = (d, M) => {
|
|
5435
|
+
if (d.customType === "paragraph") {
|
|
5436
|
+
const S = d.displayText || d.label || "";
|
|
5437
|
+
return /* @__PURE__ */ r(
|
|
5438
|
+
"p",
|
|
5439
|
+
{
|
|
5440
|
+
className: "metakyc-paragraph",
|
|
5441
|
+
style: {
|
|
5442
|
+
fontSize: "14px",
|
|
5443
|
+
lineHeight: "1.7",
|
|
5444
|
+
margin: 0,
|
|
5445
|
+
color: "var(--metakyc-text-secondary, #6b7280)"
|
|
5446
|
+
},
|
|
5447
|
+
dangerouslySetInnerHTML: { __html: S }
|
|
5448
|
+
},
|
|
5449
|
+
`custom-${M}`
|
|
5450
|
+
);
|
|
5451
|
+
}
|
|
5452
|
+
if (d.customType === "br")
|
|
5453
|
+
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${M}`);
|
|
5434
5454
|
if (!d.paramName) return null;
|
|
5435
5455
|
const T = z[d.paramName], b = d.displayText || d.label || d.paramName;
|
|
5436
5456
|
if (d.customType === "checkbox")
|
|
@@ -5445,10 +5465,10 @@ const $e = {
|
|
|
5445
5465
|
"input",
|
|
5446
5466
|
{
|
|
5447
5467
|
type: "checkbox",
|
|
5448
|
-
checked:
|
|
5449
|
-
onChange: (
|
|
5468
|
+
checked: I[d.paramName] === "true",
|
|
5469
|
+
onChange: (S) => D(d.paramName, S.target.checked ? "true" : "false"),
|
|
5450
5470
|
className: "metakyc-option-input",
|
|
5451
|
-
style:
|
|
5471
|
+
style: Be
|
|
5452
5472
|
}
|
|
5453
5473
|
),
|
|
5454
5474
|
/* @__PURE__ */ i(
|
|
@@ -5466,7 +5486,7 @@ const $e = {
|
|
|
5466
5486
|
}
|
|
5467
5487
|
),
|
|
5468
5488
|
T && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: T })
|
|
5469
|
-
] }, `custom-${
|
|
5489
|
+
] }, `custom-${M}`);
|
|
5470
5490
|
if (d.customType === "link_checkbox")
|
|
5471
5491
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
5472
5492
|
/* @__PURE__ */ i(
|
|
@@ -5479,10 +5499,10 @@ const $e = {
|
|
|
5479
5499
|
"input",
|
|
5480
5500
|
{
|
|
5481
5501
|
type: "checkbox",
|
|
5482
|
-
checked:
|
|
5483
|
-
onChange: (
|
|
5502
|
+
checked: I[d.paramName] === "true",
|
|
5503
|
+
onChange: (S) => D(d.paramName, S.target.checked ? "true" : "false"),
|
|
5484
5504
|
className: "metakyc-option-input",
|
|
5485
|
-
style: {
|
|
5505
|
+
style: { ...Be, alignSelf: "flex-start", marginTop: "2px" }
|
|
5486
5506
|
}
|
|
5487
5507
|
),
|
|
5488
5508
|
/* @__PURE__ */ i(
|
|
@@ -5501,7 +5521,7 @@ const $e = {
|
|
|
5501
5521
|
rel: "noopener noreferrer",
|
|
5502
5522
|
className: "underline",
|
|
5503
5523
|
style: { color: "var(--metakyc-primary, #2563eb)" },
|
|
5504
|
-
onClick: (
|
|
5524
|
+
onClick: (S) => S.stopPropagation(),
|
|
5505
5525
|
children: d.linkText || d.linkUrl
|
|
5506
5526
|
}
|
|
5507
5527
|
),
|
|
@@ -5513,9 +5533,9 @@ const $e = {
|
|
|
5513
5533
|
}
|
|
5514
5534
|
),
|
|
5515
5535
|
T && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: T })
|
|
5516
|
-
] }, `custom-${
|
|
5536
|
+
] }, `custom-${M}`);
|
|
5517
5537
|
if (d.customType === "group_checkbox") {
|
|
5518
|
-
const
|
|
5538
|
+
const S = (I[d.paramName] || "").split(",").filter(Boolean);
|
|
5519
5539
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
5520
5540
|
/* @__PURE__ */ i(
|
|
5521
5541
|
"div",
|
|
@@ -5528,39 +5548,46 @@ const $e = {
|
|
|
5528
5548
|
]
|
|
5529
5549
|
}
|
|
5530
5550
|
),
|
|
5531
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5551
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((q) => {
|
|
5552
|
+
const ae = d.singleSelect ? I[d.paramName] === q.value : S.includes(q.value);
|
|
5553
|
+
return /* @__PURE__ */ i(
|
|
5554
|
+
"label",
|
|
5555
|
+
{
|
|
5556
|
+
className: "metakyc-option-label",
|
|
5557
|
+
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
|
|
5558
|
+
children: [
|
|
5559
|
+
/* @__PURE__ */ r(
|
|
5560
|
+
"input",
|
|
5561
|
+
{
|
|
5562
|
+
type: "checkbox",
|
|
5563
|
+
checked: ae,
|
|
5564
|
+
onChange: (se) => {
|
|
5565
|
+
if (d.singleSelect)
|
|
5566
|
+
D(d.paramName, se.target.checked ? q.value : "");
|
|
5567
|
+
else {
|
|
5568
|
+
const ie = se.target.checked ? [...S, q.value] : S.filter((ke) => ke !== q.value);
|
|
5569
|
+
D(d.paramName, ie.join(","));
|
|
5570
|
+
}
|
|
5571
|
+
},
|
|
5572
|
+
className: "metakyc-option-input",
|
|
5573
|
+
style: Be
|
|
5574
|
+
}
|
|
5575
|
+
),
|
|
5576
|
+
/* @__PURE__ */ r(
|
|
5577
|
+
"span",
|
|
5578
|
+
{
|
|
5579
|
+
className: "metakyc-option-text",
|
|
5580
|
+
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5581
|
+
children: q.label
|
|
5582
|
+
}
|
|
5583
|
+
)
|
|
5584
|
+
]
|
|
5585
|
+
},
|
|
5586
|
+
q.value
|
|
5587
|
+
);
|
|
5588
|
+
}) }),
|
|
5562
5589
|
T && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: T })
|
|
5563
|
-
] }, `custom-${
|
|
5590
|
+
] }, `custom-${M}`);
|
|
5564
5591
|
}
|
|
5565
5592
|
return d.customType === "radio_group" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
5566
5593
|
/* @__PURE__ */ i(
|
|
@@ -5574,7 +5601,7 @@ const $e = {
|
|
|
5574
5601
|
]
|
|
5575
5602
|
}
|
|
5576
5603
|
),
|
|
5577
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((
|
|
5604
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((S) => /* @__PURE__ */ i(
|
|
5578
5605
|
"label",
|
|
5579
5606
|
{
|
|
5580
5607
|
className: "metakyc-option-label",
|
|
@@ -5584,11 +5611,11 @@ const $e = {
|
|
|
5584
5611
|
"input",
|
|
5585
5612
|
{
|
|
5586
5613
|
type: "radio",
|
|
5587
|
-
checked:
|
|
5588
|
-
onChange: () => D(d.paramName,
|
|
5589
|
-
name: `radio-group-${d.paramName}-${
|
|
5614
|
+
checked: I[d.paramName] === S.value,
|
|
5615
|
+
onChange: () => D(d.paramName, S.value),
|
|
5616
|
+
name: `radio-group-${d.paramName}-${M}`,
|
|
5590
5617
|
className: "metakyc-option-input",
|
|
5591
|
-
style:
|
|
5618
|
+
style: Be
|
|
5592
5619
|
}
|
|
5593
5620
|
),
|
|
5594
5621
|
/* @__PURE__ */ r(
|
|
@@ -5596,28 +5623,28 @@ const $e = {
|
|
|
5596
5623
|
{
|
|
5597
5624
|
className: "metakyc-option-text",
|
|
5598
5625
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5599
|
-
children:
|
|
5626
|
+
children: S.label
|
|
5600
5627
|
}
|
|
5601
5628
|
)
|
|
5602
5629
|
]
|
|
5603
5630
|
},
|
|
5604
|
-
|
|
5631
|
+
S.value
|
|
5605
5632
|
)) }),
|
|
5606
5633
|
T && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: T })
|
|
5607
|
-
] }, `custom-${
|
|
5634
|
+
] }, `custom-${M}`) : /* @__PURE__ */ r(
|
|
5608
5635
|
me,
|
|
5609
5636
|
{
|
|
5610
5637
|
type: "text",
|
|
5611
5638
|
label: `${b}${d.required ? " *" : ""}`,
|
|
5612
|
-
value:
|
|
5613
|
-
onChange: (
|
|
5639
|
+
value: I[d.paramName] || "",
|
|
5640
|
+
onChange: (S) => D(d.paramName, S.target.value),
|
|
5614
5641
|
required: d.required,
|
|
5615
5642
|
error: T
|
|
5616
5643
|
},
|
|
5617
|
-
`custom-${
|
|
5644
|
+
`custom-${M}`
|
|
5618
5645
|
);
|
|
5619
|
-
}, gt = (d,
|
|
5620
|
-
const T =
|
|
5646
|
+
}, gt = (d, M) => {
|
|
5647
|
+
const T = A(d);
|
|
5621
5648
|
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
5622
5649
|
d.conditionalOn && /* @__PURE__ */ i(
|
|
5623
5650
|
"label",
|
|
@@ -5632,7 +5659,7 @@ const $e = {
|
|
|
5632
5659
|
checked: T,
|
|
5633
5660
|
onChange: (b) => D(d.conditionalOn, b.target.checked ? "true" : "false"),
|
|
5634
5661
|
className: "metakyc-option-input",
|
|
5635
|
-
style:
|
|
5662
|
+
style: Be
|
|
5636
5663
|
}
|
|
5637
5664
|
),
|
|
5638
5665
|
/* @__PURE__ */ r(
|
|
@@ -5646,22 +5673,22 @@ const $e = {
|
|
|
5646
5673
|
]
|
|
5647
5674
|
}
|
|
5648
5675
|
),
|
|
5649
|
-
T && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: d.fields.map((b,
|
|
5650
|
-
const
|
|
5651
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5676
|
+
T && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: d.fields.map((b, S) => {
|
|
5677
|
+
const q = b.colSpan === 1 ? "col-span-1" : b.colSpan === 2 ? "col-span-2" : b.colSpan === 3 ? "col-span-3" : "col-span-4", ae = b.isCustom ? `custom-${S}-${b.paramName}` : `builtin-${b.name}-${S}`;
|
|
5678
|
+
return /* @__PURE__ */ r("div", { className: q, children: b.isCustom ? ht(b, S) : Ve(b.name, ae, b.displayText, b.countriesType) }, ae);
|
|
5652
5679
|
}) })
|
|
5653
5680
|
] });
|
|
5654
5681
|
};
|
|
5655
|
-
if (
|
|
5656
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(
|
|
5682
|
+
if (O)
|
|
5683
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ i(j, { children: [
|
|
5657
5684
|
/* @__PURE__ */ r(ve, { className: "my-8" }),
|
|
5658
5685
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
5659
5686
|
] }) }) });
|
|
5660
5687
|
if (p) {
|
|
5661
|
-
const d = p[P] ?? p[0],
|
|
5662
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(
|
|
5688
|
+
const d = p[P] ?? p[0], M = ee === -1, T = U === -1, b = p.length, S = A(d), q = Object.values(z);
|
|
5689
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(K, { children: [
|
|
5663
5690
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
|
|
5664
|
-
/* @__PURE__ */ i(
|
|
5691
|
+
/* @__PURE__ */ i(j, { children: [
|
|
5665
5692
|
(d.title || d.subtitle || d.description) && /* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
5666
5693
|
d.title && /* @__PURE__ */ r(
|
|
5667
5694
|
"h3",
|
|
@@ -5688,13 +5715,13 @@ const $e = {
|
|
|
5688
5715
|
}
|
|
5689
5716
|
)
|
|
5690
5717
|
] }),
|
|
5691
|
-
(Z ||
|
|
5718
|
+
(Z || q.length > 0) && /* @__PURE__ */ i("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
5692
5719
|
Z && /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
5693
5720
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
5694
5721
|
" ",
|
|
5695
5722
|
Z
|
|
5696
5723
|
] }),
|
|
5697
|
-
|
|
5724
|
+
q.map((ae, se) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: ae }, se))
|
|
5698
5725
|
] }),
|
|
5699
5726
|
b > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
5700
5727
|
p.map((ae, se) => /* @__PURE__ */ r(
|
|
@@ -5715,35 +5742,35 @@ const $e = {
|
|
|
5715
5742
|
] }),
|
|
5716
5743
|
/* @__PURE__ */ i(pe, { className: "flex justify-between", children: [
|
|
5717
5744
|
/* @__PURE__ */ i("div", { children: [
|
|
5718
|
-
|
|
5745
|
+
!M && /* @__PURE__ */ r(
|
|
5719
5746
|
V,
|
|
5720
5747
|
{
|
|
5721
5748
|
type: "button",
|
|
5722
5749
|
variant: "outline",
|
|
5723
5750
|
onClick: () => {
|
|
5724
|
-
|
|
5751
|
+
Y(ee), L({});
|
|
5725
5752
|
},
|
|
5726
5753
|
disabled: _ || u,
|
|
5727
5754
|
children: "Previous"
|
|
5728
5755
|
}
|
|
5729
5756
|
),
|
|
5730
|
-
|
|
5757
|
+
M && a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: _ || u, children: "Cancel" })
|
|
5731
5758
|
] }),
|
|
5732
5759
|
/* @__PURE__ */ r(
|
|
5733
5760
|
V,
|
|
5734
5761
|
{
|
|
5735
5762
|
type: "button",
|
|
5736
5763
|
isLoading: _ || u,
|
|
5737
|
-
onClick: T ? he :
|
|
5738
|
-
children: T ? d.conditionalOn && !
|
|
5764
|
+
onClick: T ? he : Se,
|
|
5765
|
+
children: T ? d.conditionalOn && !S ? "Skip & Submit" : "Submit" : d.conditionalOn && !S ? "Skip" : "Next"
|
|
5739
5766
|
}
|
|
5740
5767
|
)
|
|
5741
5768
|
] })
|
|
5742
5769
|
] }) });
|
|
5743
5770
|
}
|
|
5744
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Oe, children: /* @__PURE__ */ i(
|
|
5771
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Oe, children: /* @__PURE__ */ i(K, { children: [
|
|
5745
5772
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
|
|
5746
|
-
/* @__PURE__ */ i(
|
|
5773
|
+
/* @__PURE__ */ i(j, { children: [
|
|
5747
5774
|
Z && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
5748
5775
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
5749
5776
|
" ",
|
|
@@ -5774,7 +5801,7 @@ const $e = {
|
|
|
5774
5801
|
error: y,
|
|
5775
5802
|
moveBack: g,
|
|
5776
5803
|
refreshProgress: h
|
|
5777
|
-
} = hr(e), [
|
|
5804
|
+
} = hr(e), [C, F] = fe.useState(!1);
|
|
5778
5805
|
if (fe.useEffect(() => {
|
|
5779
5806
|
y && n && n(y);
|
|
5780
5807
|
}, [y, n]), fe.useEffect(() => {
|
|
@@ -5784,17 +5811,17 @@ const $e = {
|
|
|
5784
5811
|
}, [a]), fe.useEffect(() => {
|
|
5785
5812
|
x && F(!1);
|
|
5786
5813
|
}, [x]), p || !o)
|
|
5787
|
-
return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(
|
|
5814
|
+
return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ i(j, { children: [
|
|
5788
5815
|
/* @__PURE__ */ r(ve, { className: "my-8" }),
|
|
5789
5816
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
5790
5817
|
] }) }) });
|
|
5791
5818
|
if (y)
|
|
5792
|
-
return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(
|
|
5819
|
+
return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
5793
5820
|
/* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
5794
5821
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: y.message })
|
|
5795
5822
|
] }) }) }) });
|
|
5796
|
-
if (x && !
|
|
5797
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(
|
|
5823
|
+
if (x && !C)
|
|
5824
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
5798
5825
|
/* @__PURE__ */ r("div", { className: "mb-6", children: /* @__PURE__ */ r("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ r("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", 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" }) }) }) }),
|
|
5799
5826
|
/* @__PURE__ */ r("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
5800
5827
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
|
|
@@ -5836,12 +5863,12 @@ const $e = {
|
|
|
5836
5863
|
}
|
|
5837
5864
|
) });
|
|
5838
5865
|
if (!l)
|
|
5839
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(
|
|
5866
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ i(j, { children: [
|
|
5840
5867
|
/* @__PURE__ */ r(ve, { className: "my-8" }),
|
|
5841
5868
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: o.status === be.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
5842
5869
|
] }) }) });
|
|
5843
|
-
const
|
|
5844
|
-
switch (
|
|
5870
|
+
const k = (R) => {
|
|
5871
|
+
switch (R) {
|
|
5845
5872
|
case G.Overview:
|
|
5846
5873
|
return "Overview";
|
|
5847
5874
|
case G.Questionaries:
|
|
@@ -5863,8 +5890,8 @@ const $e = {
|
|
|
5863
5890
|
default:
|
|
5864
5891
|
return "";
|
|
5865
5892
|
}
|
|
5866
|
-
},
|
|
5867
|
-
const
|
|
5893
|
+
}, O = () => {
|
|
5894
|
+
const R = c.filter((w) => w.visibility !== !1), H = R.findIndex((w) => w.order === l.order), J = H >= 0 ? H + 1 : 1, f = R.length;
|
|
5868
5895
|
return /* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
5869
5896
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5870
5897
|
/* @__PURE__ */ r(Ge, {}),
|
|
@@ -5875,8 +5902,8 @@ const $e = {
|
|
|
5875
5902
|
f
|
|
5876
5903
|
] })
|
|
5877
5904
|
] }),
|
|
5878
|
-
/* @__PURE__ */ r("div", { className: "flex items-center", children:
|
|
5879
|
-
const
|
|
5905
|
+
/* @__PURE__ */ r("div", { className: "flex items-center", children: R.map((w, I) => {
|
|
5906
|
+
const $ = I < H, P = w.order === l.order;
|
|
5880
5907
|
return /* @__PURE__ */ i(fe.Fragment, { children: [
|
|
5881
5908
|
/* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
5882
5909
|
/* @__PURE__ */ r(
|
|
@@ -5884,30 +5911,30 @@ const $e = {
|
|
|
5884
5911
|
{
|
|
5885
5912
|
className: `
|
|
5886
5913
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
5887
|
-
${
|
|
5914
|
+
${$ || P ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
5888
5915
|
`,
|
|
5889
|
-
children:
|
|
5916
|
+
children: I + 1
|
|
5890
5917
|
}
|
|
5891
5918
|
),
|
|
5892
5919
|
/* @__PURE__ */ r(
|
|
5893
5920
|
"span",
|
|
5894
5921
|
{
|
|
5895
5922
|
className: `ml-2 text-sm ${P ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
5896
|
-
children:
|
|
5923
|
+
children: w.displayName || w.name || k(w.action) || `Step ${I + 1}`
|
|
5897
5924
|
}
|
|
5898
5925
|
)
|
|
5899
5926
|
] }),
|
|
5900
|
-
|
|
5927
|
+
I < R.length - 1 && /* @__PURE__ */ r(
|
|
5901
5928
|
"div",
|
|
5902
5929
|
{
|
|
5903
|
-
className: `flex-1 h-0.5 mx-4 ${
|
|
5930
|
+
className: `flex-1 h-0.5 mx-4 ${$ ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
5904
5931
|
}
|
|
5905
5932
|
)
|
|
5906
|
-
] },
|
|
5933
|
+
] }, w.order);
|
|
5907
5934
|
}) })
|
|
5908
5935
|
] });
|
|
5909
|
-
},
|
|
5910
|
-
const
|
|
5936
|
+
}, E = () => {
|
|
5937
|
+
const R = {
|
|
5911
5938
|
applicantId: e,
|
|
5912
5939
|
onComplete: async () => {
|
|
5913
5940
|
await h();
|
|
@@ -5916,20 +5943,20 @@ const $e = {
|
|
|
5916
5943
|
};
|
|
5917
5944
|
switch (l.action) {
|
|
5918
5945
|
case G.Questionaries:
|
|
5919
|
-
return /* @__PURE__ */ r(Lr, { ...
|
|
5946
|
+
return /* @__PURE__ */ r(Lr, { ...R });
|
|
5920
5947
|
case G.UploadDocument:
|
|
5921
|
-
return /* @__PURE__ */ r(Mr, { ...
|
|
5948
|
+
return /* @__PURE__ */ r(Mr, { ...R });
|
|
5922
5949
|
case G.Overview:
|
|
5923
|
-
return /* @__PURE__ */ r(Or, { ...
|
|
5950
|
+
return /* @__PURE__ */ r(Or, { ...R });
|
|
5924
5951
|
case G.IdentitySdk:
|
|
5925
|
-
return /* @__PURE__ */ r(Kr, { ...
|
|
5952
|
+
return /* @__PURE__ */ r(Kr, { ...R });
|
|
5926
5953
|
case G.RiskScoring:
|
|
5927
|
-
return /* @__PURE__ */ r(_r, { ...
|
|
5954
|
+
return /* @__PURE__ */ r(_r, { ...R });
|
|
5928
5955
|
case G.AdditionalData:
|
|
5929
5956
|
case G.InvestorCategorization:
|
|
5930
|
-
return /* @__PURE__ */ r(Hr, { ...
|
|
5957
|
+
return /* @__PURE__ */ r(Hr, { ...R });
|
|
5931
5958
|
case G.AppropriatenessTest:
|
|
5932
|
-
return /* @__PURE__ */ r(qr, { ...
|
|
5959
|
+
return /* @__PURE__ */ r(qr, { ...R });
|
|
5933
5960
|
case G.ManualReview:
|
|
5934
5961
|
return /* @__PURE__ */ r(
|
|
5935
5962
|
it,
|
|
@@ -5941,7 +5968,7 @@ const $e = {
|
|
|
5941
5968
|
}
|
|
5942
5969
|
);
|
|
5943
5970
|
default:
|
|
5944
|
-
return /* @__PURE__ */ r(
|
|
5971
|
+
return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ i(j, { className: "py-12 text-center", children: [
|
|
5945
5972
|
/* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(ve, {}) }),
|
|
5946
5973
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
5947
5974
|
"Processing step: ",
|
|
@@ -5955,17 +5982,17 @@ const $e = {
|
|
|
5955
5982
|
}
|
|
5956
5983
|
};
|
|
5957
5984
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
5958
|
-
|
|
5959
|
-
|
|
5985
|
+
O(),
|
|
5986
|
+
E()
|
|
5960
5987
|
] });
|
|
5961
5988
|
};
|
|
5962
5989
|
function pn(e) {
|
|
5963
|
-
return
|
|
5964
|
-
questionResults:
|
|
5990
|
+
return Ne.object({
|
|
5991
|
+
questionResults: Ne.any()
|
|
5965
5992
|
}).passthrough();
|
|
5966
5993
|
}
|
|
5967
5994
|
function Wr(e) {
|
|
5968
|
-
let t =
|
|
5995
|
+
let t = Ne.array(Ne.instanceof(File));
|
|
5969
5996
|
if (e.isRequired ? t = t.min(
|
|
5970
5997
|
1,
|
|
5971
5998
|
`${e.displayName} is required`
|
|
@@ -5991,27 +6018,27 @@ function hn(e) {
|
|
|
5991
6018
|
return e.uploadDocumentFiles.forEach((n) => {
|
|
5992
6019
|
const a = `file_${n.id}`;
|
|
5993
6020
|
t[a] = Wr(n);
|
|
5994
|
-
}),
|
|
6021
|
+
}), Ne.object(t);
|
|
5995
6022
|
}
|
|
5996
6023
|
function gn(e) {
|
|
5997
|
-
return
|
|
6024
|
+
return Ne.any();
|
|
5998
6025
|
}
|
|
5999
6026
|
function Yr(e) {
|
|
6000
|
-
return
|
|
6027
|
+
return Ne.string().min(1, "This question is required");
|
|
6001
6028
|
}
|
|
6002
6029
|
function yn(e) {
|
|
6003
6030
|
const t = {};
|
|
6004
6031
|
return e.appropriatenessQuestions.forEach((n) => {
|
|
6005
6032
|
const a = `question_${n.id}`;
|
|
6006
6033
|
t[a] = Yr();
|
|
6007
|
-
}),
|
|
6034
|
+
}), Ne.object(t);
|
|
6008
6035
|
}
|
|
6009
|
-
const fn =
|
|
6036
|
+
const fn = Ne.any();
|
|
6010
6037
|
export {
|
|
6011
6038
|
rt as ALLOWED_LANGUAGES,
|
|
6012
6039
|
Nt as ApplicantProgressOnHoldReason,
|
|
6013
6040
|
be as ApplicantProgressStatus,
|
|
6014
|
-
|
|
6041
|
+
zt as ApplicantService,
|
|
6015
6042
|
Ct as ApplicantStatus,
|
|
6016
6043
|
Pt as AppropriatenessQuestionType,
|
|
6017
6044
|
Ut as AppropriatenessTestService,
|
|
@@ -6019,8 +6046,8 @@ export {
|
|
|
6019
6046
|
Ce as Badge,
|
|
6020
6047
|
jt as BaseInformationService,
|
|
6021
6048
|
V as Button,
|
|
6022
|
-
|
|
6023
|
-
|
|
6049
|
+
K as Card,
|
|
6050
|
+
j as CardContent,
|
|
6024
6051
|
pe as CardFooter,
|
|
6025
6052
|
de as CardHeader,
|
|
6026
6053
|
Fe as CountriesType,
|
|
@@ -6029,14 +6056,14 @@ export {
|
|
|
6029
6056
|
Tt as DEFAULT_VISIBLE_FIELDS,
|
|
6030
6057
|
Rt as DocumentReviewStatus,
|
|
6031
6058
|
Ot as EndpointBuilder,
|
|
6032
|
-
|
|
6059
|
+
$e as ErrorHandler,
|
|
6033
6060
|
er as EventEmitter,
|
|
6034
6061
|
Le as FIELD_METADATA,
|
|
6035
6062
|
It as FileType,
|
|
6036
|
-
|
|
6063
|
+
wr as FileUpload,
|
|
6037
6064
|
Ke as GenderType,
|
|
6038
6065
|
Ge as Header,
|
|
6039
|
-
|
|
6066
|
+
$t as HttpClient,
|
|
6040
6067
|
Te as IdentityProviderManager,
|
|
6041
6068
|
Kt as IdentityService,
|
|
6042
6069
|
xe as IdentityVerificationProvider,
|
|
@@ -6054,12 +6081,12 @@ export {
|
|
|
6054
6081
|
ct as MetaKYCContext,
|
|
6055
6082
|
we as MetaKYCError,
|
|
6056
6083
|
nn as MetaKYCProvider,
|
|
6057
|
-
|
|
6084
|
+
kr as MultiSelect,
|
|
6058
6085
|
sr as OnfidoProvider,
|
|
6059
6086
|
Ht as OverviewService,
|
|
6060
6087
|
Or as OverviewStep,
|
|
6061
6088
|
Nr as PhoneInput,
|
|
6062
|
-
|
|
6089
|
+
Bt as QuestionnaireService,
|
|
6063
6090
|
Lr as QuestionnaireStep,
|
|
6064
6091
|
De as ReviewStatus,
|
|
6065
6092
|
Dt as RiskCriteriaType,
|
|
@@ -6100,7 +6127,7 @@ export {
|
|
|
6100
6127
|
hn as generateUploadDocumentSchema,
|
|
6101
6128
|
on as getAcceptString,
|
|
6102
6129
|
dr as getApplicantId,
|
|
6103
|
-
|
|
6130
|
+
ze as getThemePreset,
|
|
6104
6131
|
ln as getWorkflowState,
|
|
6105
6132
|
Gt as healthcareTheme,
|
|
6106
6133
|
tn as isScriptLoaded,
|