@vpdev2/metakyc-sdk 1.0.46 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CreateApplicantForm.d.ts.map +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +814 -832
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,12 +3,12 @@ var ot = (e, t, r) => t in e ? lt(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var V = (e, t, r) => ot(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import ct from "axios";
|
|
5
5
|
import * as Ze from "react";
|
|
6
|
-
import
|
|
6
|
+
import he, { createContext as dt, useState as x, useMemo as Re, useEffect as ee, useContext as ut, useRef as X, useCallback as Q, forwardRef as $e, createElement as He } from "react";
|
|
7
7
|
import { jsx as a, jsxs as i, Fragment as mt } from "react/jsx-runtime";
|
|
8
|
-
import { useForm as pt, Controller as
|
|
9
|
-
import { z as
|
|
10
|
-
var _ = /* @__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))(_ || {}),
|
|
11
|
-
const
|
|
8
|
+
import { useForm as pt, Controller as Ae } from "react-hook-form";
|
|
9
|
+
import { z as we } from "zod";
|
|
10
|
+
var _ = /* @__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))(_ || {}), ze = /* @__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))(ze || {}), ye = /* @__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))(ye || {}), ht = /* @__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))(ht || {}), gt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(gt || {}), Ie = /* @__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))(Ie || {}), Ee = /* @__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))(Ee || {}), yt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(yt || {}), ft = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(ft || {}), ge = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(ge || {}), xt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(xt || {}), _e = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(_e || {}), bt = /* @__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))(bt || {}), vt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(vt || {}), kt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(kt || {}), Se = /* @__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))(Se || {}), wt = /* @__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))(wt || {}), Nt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Nt || {}), me = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(me || {}), St = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(St || {});
|
|
11
|
+
const qe = {
|
|
12
12
|
firstName: { label: "First Name", type: "text" },
|
|
13
13
|
lastName: { label: "Last Name", type: "text" },
|
|
14
14
|
email: { label: "Email", type: "email" },
|
|
@@ -112,7 +112,7 @@ class ke extends Error {
|
|
|
112
112
|
this.code = n, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = o, Object.setPrototypeOf(this, ke.prototype);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
class
|
|
115
|
+
class Me {
|
|
116
116
|
/**
|
|
117
117
|
* Process an error from the API response
|
|
118
118
|
*/
|
|
@@ -203,7 +203,7 @@ class Et {
|
|
|
203
203
|
});
|
|
204
204
|
return this.handleResponse(l);
|
|
205
205
|
} catch (s) {
|
|
206
|
-
throw
|
|
206
|
+
throw Me.handleAxiosError(s);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
@@ -214,7 +214,7 @@ class Et {
|
|
|
214
214
|
const s = this.buildEndpoint(t, r), l = await this.axiosInstance.post(s, n);
|
|
215
215
|
return this.handleResponse(l);
|
|
216
216
|
} catch (s) {
|
|
217
|
-
throw
|
|
217
|
+
throw Me.handleAxiosError(s);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
@@ -225,7 +225,7 @@ class Et {
|
|
|
225
225
|
const s = this.buildEndpoint(t, r), l = await this.axiosInstance.put(s, n);
|
|
226
226
|
return this.handleResponse(l);
|
|
227
227
|
} catch (s) {
|
|
228
|
-
throw
|
|
228
|
+
throw Me.handleAxiosError(s);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
/**
|
|
@@ -238,7 +238,7 @@ class Et {
|
|
|
238
238
|
});
|
|
239
239
|
return this.handleResponse(l);
|
|
240
240
|
} catch (s) {
|
|
241
|
-
throw
|
|
241
|
+
throw Me.handleAxiosError(s);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
@@ -247,7 +247,7 @@ class Et {
|
|
|
247
247
|
handleResponse(t) {
|
|
248
248
|
const r = t.data;
|
|
249
249
|
if (!r.success && r.error)
|
|
250
|
-
throw
|
|
250
|
+
throw Me.handleApiError(r.error);
|
|
251
251
|
return r;
|
|
252
252
|
}
|
|
253
253
|
/**
|
|
@@ -631,7 +631,7 @@ class $t {
|
|
|
631
631
|
)).result;
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
const
|
|
634
|
+
const ce = {
|
|
635
635
|
name: "Default",
|
|
636
636
|
title: "KYC Verification",
|
|
637
637
|
logo: {
|
|
@@ -865,15 +865,15 @@ const de = {
|
|
|
865
865
|
inputHeight: "2.25rem"
|
|
866
866
|
}
|
|
867
867
|
}, Kt = {
|
|
868
|
-
[ie.Default]:
|
|
868
|
+
[ie.Default]: ce,
|
|
869
869
|
[ie.Corporate]: Bt,
|
|
870
870
|
[ie.Fintech]: zt,
|
|
871
871
|
[ie.Healthcare]: _t,
|
|
872
872
|
[ie.Modern]: Ut,
|
|
873
873
|
[ie.Minimal]: qt
|
|
874
874
|
};
|
|
875
|
-
function
|
|
876
|
-
return Kt[e] ||
|
|
875
|
+
function Te(e) {
|
|
876
|
+
return Kt[e] || ce;
|
|
877
877
|
}
|
|
878
878
|
class jt {
|
|
879
879
|
constructor(t) {
|
|
@@ -890,8 +890,8 @@ class jt {
|
|
|
890
890
|
"GetThemeConfiguration"
|
|
891
891
|
);
|
|
892
892
|
if (!r.result.isEnabled)
|
|
893
|
-
return
|
|
894
|
-
let n = r.result.preset ?
|
|
893
|
+
return Te(ie.Default);
|
|
894
|
+
let n = r.result.preset ? Te(r.result.preset) : Te(ie.Default);
|
|
895
895
|
if (r.result.title && (n.title = r.result.title), r.result.logo && (n.logo = { ...n.logo, ...r.result.logo }), r.result.colors && (n.colors = { ...n.colors, ...r.result.colors }), r.result.typography && (n.typography = { ...n.typography, ...r.result.typography }), r.result.spacing && (n.spacing = { ...n.spacing, ...r.result.spacing }), r.result.customCSS && (n.customCSS = r.result.customCSS), r.result.darkMode && (n.darkMode = {
|
|
896
896
|
colors: {
|
|
897
897
|
...(t = n.darkMode) == null ? void 0 : t.colors,
|
|
@@ -905,7 +905,7 @@ class jt {
|
|
|
905
905
|
}
|
|
906
906
|
return n;
|
|
907
907
|
} catch (r) {
|
|
908
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", r),
|
|
908
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), Te(ie.Default);
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
/**
|
|
@@ -931,7 +931,7 @@ class jt {
|
|
|
931
931
|
* Preview theme (doesn't save)
|
|
932
932
|
*/
|
|
933
933
|
getPreviewTheme(t, r) {
|
|
934
|
-
const n =
|
|
934
|
+
const n = Te(t);
|
|
935
935
|
return r ? {
|
|
936
936
|
...n,
|
|
937
937
|
...r,
|
|
@@ -1025,7 +1025,7 @@ class Wt {
|
|
|
1025
1025
|
*/
|
|
1026
1026
|
get status() {
|
|
1027
1027
|
var t;
|
|
1028
|
-
return ((t = this._progress) == null ? void 0 : t.status) ||
|
|
1028
|
+
return ((t = this._progress) == null ? void 0 : t.status) || ye.None;
|
|
1029
1029
|
}
|
|
1030
1030
|
/**
|
|
1031
1031
|
* Get workflow result
|
|
@@ -1044,19 +1044,19 @@ class Wt {
|
|
|
1044
1044
|
* Check if workflow is complete
|
|
1045
1045
|
*/
|
|
1046
1046
|
get isComplete() {
|
|
1047
|
-
return this.status ===
|
|
1047
|
+
return this.status === ye.Finished;
|
|
1048
1048
|
}
|
|
1049
1049
|
/**
|
|
1050
1050
|
* Check if workflow is on hold
|
|
1051
1051
|
*/
|
|
1052
1052
|
get isOnHold() {
|
|
1053
|
-
return this.status ===
|
|
1053
|
+
return this.status === ye.OnHold;
|
|
1054
1054
|
}
|
|
1055
1055
|
/**
|
|
1056
1056
|
* Check if workflow is in progress
|
|
1057
1057
|
*/
|
|
1058
1058
|
get isInProgress() {
|
|
1059
|
-
return this.status ===
|
|
1059
|
+
return this.status === ye.InProgress;
|
|
1060
1060
|
}
|
|
1061
1061
|
/**
|
|
1062
1062
|
* Set applicant ID
|
|
@@ -1070,7 +1070,7 @@ class Wt {
|
|
|
1070
1070
|
updateProgress(t) {
|
|
1071
1071
|
var n, s;
|
|
1072
1072
|
const r = (n = this._progress) == null ? void 0 : n.currentStep;
|
|
1073
|
-
this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (r == null ? void 0 : r.order) !== ((s = t.currentStep) == null ? void 0 : s.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status ===
|
|
1073
|
+
this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (r == null ? void 0 : r.order) !== ((s = t.currentStep) == null ? void 0 : s.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status === ye.Finished && t.workflowResult && this.events.emit("completed", t.workflowResult);
|
|
1074
1074
|
}
|
|
1075
1075
|
/**
|
|
1076
1076
|
* Set error
|
|
@@ -1529,10 +1529,10 @@ class Zt {
|
|
|
1529
1529
|
console.log(`[SardinAI] Device ID: ${c.deviceId}`);
|
|
1530
1530
|
},
|
|
1531
1531
|
// New callback for session updates
|
|
1532
|
-
onConfigUpdate: (c, u,
|
|
1532
|
+
onConfigUpdate: (c, u, m) => {
|
|
1533
1533
|
switch (c) {
|
|
1534
1534
|
case "SESSION_UPDATE_FAILED":
|
|
1535
|
-
console.error("[SardinAI] Session update failed:",
|
|
1535
|
+
console.error("[SardinAI] Session update failed:", m);
|
|
1536
1536
|
break;
|
|
1537
1537
|
case "SESSION_UPDATED":
|
|
1538
1538
|
console.log("[SardinAI] Session updated:", u);
|
|
@@ -1600,11 +1600,11 @@ class De {
|
|
|
1600
1600
|
*/
|
|
1601
1601
|
static createProvider(t, r) {
|
|
1602
1602
|
switch (t) {
|
|
1603
|
-
case
|
|
1603
|
+
case ge.Sumsub:
|
|
1604
1604
|
return new Vt(r);
|
|
1605
|
-
case
|
|
1605
|
+
case ge.Onfido:
|
|
1606
1606
|
return new Gt(r);
|
|
1607
|
-
case
|
|
1607
|
+
case ge.SardinAI:
|
|
1608
1608
|
return new Zt(r);
|
|
1609
1609
|
default:
|
|
1610
1610
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
@@ -1616,7 +1616,7 @@ class De {
|
|
|
1616
1616
|
static parseProviderConfig(t, r, n) {
|
|
1617
1617
|
var s;
|
|
1618
1618
|
switch (t) {
|
|
1619
|
-
case
|
|
1619
|
+
case ge.Sumsub:
|
|
1620
1620
|
return {
|
|
1621
1621
|
accessToken: r.accessToken || r.token,
|
|
1622
1622
|
applicantEmail: r.email,
|
|
@@ -1624,11 +1624,11 @@ class De {
|
|
|
1624
1624
|
externalUserId: r.externalUserId,
|
|
1625
1625
|
lang: r.lang || "en"
|
|
1626
1626
|
};
|
|
1627
|
-
case
|
|
1627
|
+
case ge.Onfido:
|
|
1628
1628
|
return {
|
|
1629
1629
|
token: r.token || r.sdkToken
|
|
1630
1630
|
};
|
|
1631
|
-
case
|
|
1631
|
+
case ge.SardinAI:
|
|
1632
1632
|
const l = ((s = n == null ? void 0 : n.identityProviders) == null ? void 0 : s.sardinai) || {};
|
|
1633
1633
|
return {
|
|
1634
1634
|
clientId: l.clientId || r.clientId,
|
|
@@ -1646,7 +1646,7 @@ class De {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
class Jt {
|
|
1648
1648
|
constructor(t) {
|
|
1649
|
-
V(this, "currentTheme",
|
|
1649
|
+
V(this, "currentTheme", ce);
|
|
1650
1650
|
V(this, "customStyleElement", null);
|
|
1651
1651
|
V(this, "container");
|
|
1652
1652
|
this.container = t || document.documentElement;
|
|
@@ -1726,19 +1726,19 @@ class Jt {
|
|
|
1726
1726
|
mergeWithDefault(t) {
|
|
1727
1727
|
var r;
|
|
1728
1728
|
return {
|
|
1729
|
-
name: t.name ||
|
|
1730
|
-
title: t.title ||
|
|
1731
|
-
logo: { ...
|
|
1732
|
-
colors: { ...
|
|
1733
|
-
typography: t.typography ? { ...
|
|
1734
|
-
spacing: t.spacing ? { ...
|
|
1729
|
+
name: t.name || ce.name,
|
|
1730
|
+
title: t.title || ce.title,
|
|
1731
|
+
logo: { ...ce.logo, ...t.logo },
|
|
1732
|
+
colors: { ...ce.colors, ...t.colors },
|
|
1733
|
+
typography: t.typography ? { ...ce.typography, ...t.typography } : ce.typography,
|
|
1734
|
+
spacing: t.spacing ? { ...ce.spacing, ...t.spacing } : ce.spacing,
|
|
1735
1735
|
customCSS: t.customCSS,
|
|
1736
1736
|
darkMode: t.darkMode ? {
|
|
1737
1737
|
colors: {
|
|
1738
|
-
...(r =
|
|
1738
|
+
...(r = ce.darkMode) == null ? void 0 : r.colors,
|
|
1739
1739
|
...t.darkMode.colors
|
|
1740
1740
|
}
|
|
1741
|
-
} :
|
|
1741
|
+
} : ce.darkMode,
|
|
1742
1742
|
applicantFormVisibleFields: t.applicantFormVisibleFields,
|
|
1743
1743
|
applicantFormRequiredFields: t.applicantFormRequiredFields,
|
|
1744
1744
|
allowedLanguages: t.allowedLanguages,
|
|
@@ -1755,7 +1755,7 @@ class Jt {
|
|
|
1755
1755
|
* Reset to default theme
|
|
1756
1756
|
*/
|
|
1757
1757
|
resetTheme() {
|
|
1758
|
-
this.applyTheme(
|
|
1758
|
+
this.applyTheme(ce);
|
|
1759
1759
|
}
|
|
1760
1760
|
/**
|
|
1761
1761
|
* Remove all custom styles
|
|
@@ -1771,11 +1771,11 @@ class Jt {
|
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
1773
1773
|
const rt = dt(null), Yr = ({ config: e, children: t }) => {
|
|
1774
|
-
const [r, n] = x(null), s =
|
|
1775
|
-
const u = new Et(e),
|
|
1774
|
+
const [r, n] = x(null), s = he.useRef(!1), l = he.useRef(!1), o = Re(() => {
|
|
1775
|
+
const u = new Et(e), m = new Rt(u), w = new Ft(u), S = new Dt(u), y = new Pt(u), h = new Lt(u), g = new Mt(u), N = new Tt(u), b = new Ot(u), p = new $t(u), R = new jt(u), C = new Jt();
|
|
1776
1776
|
return {
|
|
1777
1777
|
httpClient: u,
|
|
1778
|
-
applicantService:
|
|
1778
|
+
applicantService: m,
|
|
1779
1779
|
questionnaireService: w,
|
|
1780
1780
|
uploadDocumentService: S,
|
|
1781
1781
|
appropriatenessTestService: y,
|
|
@@ -1783,11 +1783,11 @@ const rt = dt(null), Yr = ({ config: e, children: t }) => {
|
|
|
1783
1783
|
riskScoringService: g,
|
|
1784
1784
|
identityService: N,
|
|
1785
1785
|
baseInformationService: b,
|
|
1786
|
-
investorCategorizationService:
|
|
1786
|
+
investorCategorizationService: p,
|
|
1787
1787
|
themeService: R,
|
|
1788
|
-
themeManager:
|
|
1788
|
+
themeManager: C
|
|
1789
1789
|
};
|
|
1790
|
-
}, [e]), c =
|
|
1790
|
+
}, [e]), c = Re(() => ({
|
|
1791
1791
|
config: e,
|
|
1792
1792
|
...o,
|
|
1793
1793
|
currentTheme: r,
|
|
@@ -1814,10 +1814,10 @@ const rt = dt(null), Yr = ({ config: e, children: t }) => {
|
|
|
1814
1814
|
return;
|
|
1815
1815
|
}
|
|
1816
1816
|
console.log("[MetaKYC] Fetching theme from backend...");
|
|
1817
|
-
const
|
|
1818
|
-
o.themeManager.applyTheme(
|
|
1819
|
-
} catch (
|
|
1820
|
-
console.warn("[MetaKYC] Failed to load theme, using default:",
|
|
1817
|
+
const m = await o.themeService.getThemeConfiguration();
|
|
1818
|
+
o.themeManager.applyTheme(m), n(o.themeManager.getCurrentTheme()), l.current = !0, console.log("[MetaKYC] Theme loaded and applied", m);
|
|
1819
|
+
} catch (m) {
|
|
1820
|
+
console.warn("[MetaKYC] Failed to load theme, using default:", m), n(o.themeManager.getCurrentTheme()), l.current = !0;
|
|
1821
1821
|
} finally {
|
|
1822
1822
|
s.current = !1;
|
|
1823
1823
|
}
|
|
@@ -1825,7 +1825,7 @@ const rt = dt(null), Yr = ({ config: e, children: t }) => {
|
|
|
1825
1825
|
o.themeManager.cleanup();
|
|
1826
1826
|
}), []), /* @__PURE__ */ a(rt.Provider, { value: c, children: t });
|
|
1827
1827
|
};
|
|
1828
|
-
function
|
|
1828
|
+
function pe() {
|
|
1829
1829
|
const e = ut(rt);
|
|
1830
1830
|
if (!e)
|
|
1831
1831
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
@@ -1852,7 +1852,7 @@ function Vr(e, t) {
|
|
|
1852
1852
|
return e.type === n;
|
|
1853
1853
|
});
|
|
1854
1854
|
}
|
|
1855
|
-
function
|
|
1855
|
+
function Ke(e) {
|
|
1856
1856
|
if (e === 0) return "0 Bytes";
|
|
1857
1857
|
const t = 1024, r = ["Bytes", "KB", "MB", "GB"], n = Math.floor(Math.log(e) / Math.log(t));
|
|
1858
1858
|
return Math.round(e / Math.pow(t, n) * 100) / 100 + " " + r[n];
|
|
@@ -1915,41 +1915,41 @@ function Jr() {
|
|
|
1915
1915
|
rr(), nr();
|
|
1916
1916
|
}
|
|
1917
1917
|
function sr(e) {
|
|
1918
|
-
const { createOrchestrator: t } =
|
|
1918
|
+
const { createOrchestrator: t } = pe(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(null), u = X(null), m = e || tr();
|
|
1919
1919
|
ee(() => {
|
|
1920
1920
|
u.current || (u.current = t());
|
|
1921
1921
|
}, [t]), ee(() => {
|
|
1922
|
-
var
|
|
1923
|
-
r &&
|
|
1924
|
-
applicantId:
|
|
1925
|
-
currentStepOrder: (
|
|
1922
|
+
var C;
|
|
1923
|
+
r && m && (er(m), ar({
|
|
1924
|
+
applicantId: m,
|
|
1925
|
+
currentStepOrder: (C = r.currentStep) == null ? void 0 : C.order,
|
|
1926
1926
|
status: r.status,
|
|
1927
1927
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1928
1928
|
workflowKey: r.workFlowKey,
|
|
1929
1929
|
nextWorkflowKey: r.nextWorkflowKey
|
|
1930
1930
|
}));
|
|
1931
|
-
}, [r,
|
|
1932
|
-
const w = X(!1), S = X(!1), y =
|
|
1933
|
-
if (!(!
|
|
1931
|
+
}, [r, m]);
|
|
1932
|
+
const w = X(!1), S = X(!1), y = Q(async () => {
|
|
1933
|
+
if (!(!m || !u.current)) {
|
|
1934
1934
|
if (w.current) {
|
|
1935
1935
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
1936
1936
|
return;
|
|
1937
1937
|
}
|
|
1938
1938
|
w.current = !0, l(!0), c(null);
|
|
1939
1939
|
try {
|
|
1940
|
-
const
|
|
1941
|
-
n(
|
|
1942
|
-
} catch (
|
|
1943
|
-
c(
|
|
1940
|
+
const C = await u.current.initialize(m);
|
|
1941
|
+
n(C), S.current = !0;
|
|
1942
|
+
} catch (C) {
|
|
1943
|
+
c(C);
|
|
1944
1944
|
} finally {
|
|
1945
1945
|
l(!1), w.current = !1;
|
|
1946
1946
|
}
|
|
1947
1947
|
}
|
|
1948
|
-
}, [
|
|
1948
|
+
}, [m]);
|
|
1949
1949
|
ee(() => {
|
|
1950
|
-
|
|
1951
|
-
}, [
|
|
1952
|
-
const h =
|
|
1950
|
+
m && !S.current && y();
|
|
1951
|
+
}, [m, y]);
|
|
1952
|
+
const h = Q(async () => {
|
|
1953
1953
|
if (u.current) {
|
|
1954
1954
|
if (w.current) {
|
|
1955
1955
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
@@ -1957,66 +1957,66 @@ function sr(e) {
|
|
|
1957
1957
|
}
|
|
1958
1958
|
w.current = !0, l(!0), c(null);
|
|
1959
1959
|
try {
|
|
1960
|
-
const
|
|
1961
|
-
n(
|
|
1962
|
-
} catch (
|
|
1963
|
-
c(
|
|
1960
|
+
const C = await u.current.refreshProgress();
|
|
1961
|
+
n(C);
|
|
1962
|
+
} catch (C) {
|
|
1963
|
+
c(C);
|
|
1964
1964
|
} finally {
|
|
1965
1965
|
l(!1), w.current = !1;
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
|
-
}, []), g =
|
|
1968
|
+
}, []), g = Q(async () => {
|
|
1969
1969
|
if (u.current) {
|
|
1970
1970
|
l(!0), c(null);
|
|
1971
1971
|
try {
|
|
1972
|
-
const
|
|
1973
|
-
n(
|
|
1974
|
-
} catch (
|
|
1975
|
-
c(
|
|
1972
|
+
const C = await u.current.moveToNextStep();
|
|
1973
|
+
n(C);
|
|
1974
|
+
} catch (C) {
|
|
1975
|
+
c(C);
|
|
1976
1976
|
} finally {
|
|
1977
1977
|
l(!1);
|
|
1978
1978
|
}
|
|
1979
1979
|
}
|
|
1980
|
-
}, []), N =
|
|
1980
|
+
}, []), N = Q(async () => {
|
|
1981
1981
|
if (u.current) {
|
|
1982
1982
|
l(!0), c(null);
|
|
1983
1983
|
try {
|
|
1984
|
-
const
|
|
1985
|
-
n(
|
|
1986
|
-
} catch (
|
|
1987
|
-
c(
|
|
1984
|
+
const C = await u.current.moveToPreviousStep();
|
|
1985
|
+
n(C);
|
|
1986
|
+
} catch (C) {
|
|
1987
|
+
c(C);
|
|
1988
1988
|
} finally {
|
|
1989
1989
|
l(!1);
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
|
-
}, []), b =
|
|
1992
|
+
}, []), b = Q(async (C) => {
|
|
1993
1993
|
if (u.current) {
|
|
1994
1994
|
l(!0), c(null);
|
|
1995
1995
|
try {
|
|
1996
|
-
await u.current.submitCurrentStep(
|
|
1997
|
-
const
|
|
1998
|
-
n(
|
|
1999
|
-
} catch (
|
|
2000
|
-
throw c(
|
|
1996
|
+
await u.current.submitCurrentStep(C);
|
|
1997
|
+
const v = await u.current.refreshProgress();
|
|
1998
|
+
n(v);
|
|
1999
|
+
} catch (v) {
|
|
2000
|
+
throw c(v), v;
|
|
2001
2001
|
} finally {
|
|
2002
2002
|
l(!1);
|
|
2003
2003
|
}
|
|
2004
2004
|
}
|
|
2005
|
-
}, []),
|
|
2005
|
+
}, []), p = Ze.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((C, v) => C.order - v.order) : [], [r == null ? void 0 : r.stepInfoList]), R = Ze.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2006
2006
|
return {
|
|
2007
2007
|
progress: r,
|
|
2008
|
-
applicantId:
|
|
2008
|
+
applicantId: m,
|
|
2009
2009
|
currentStep: (r == null ? void 0 : r.currentStep) || null,
|
|
2010
|
-
steps:
|
|
2011
|
-
status: (r == null ? void 0 : r.status) ||
|
|
2010
|
+
steps: p,
|
|
2011
|
+
status: (r == null ? void 0 : r.status) || ye.None,
|
|
2012
2012
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
2013
2013
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
2014
2014
|
nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
|
|
2015
2015
|
hasWorkflowChanged: R,
|
|
2016
2016
|
isLoading: s,
|
|
2017
2017
|
error: o,
|
|
2018
|
-
isComplete: (r == null ? void 0 : r.status) ===
|
|
2019
|
-
isOnHold: (r == null ? void 0 : r.status) ===
|
|
2018
|
+
isComplete: (r == null ? void 0 : r.status) === ye.Finished,
|
|
2019
|
+
isOnHold: (r == null ? void 0 : r.status) === ye.OnHold,
|
|
2020
2020
|
refreshProgress: h,
|
|
2021
2021
|
moveToNext: g,
|
|
2022
2022
|
moveBack: N,
|
|
@@ -2025,8 +2025,8 @@ function sr(e) {
|
|
|
2025
2025
|
};
|
|
2026
2026
|
}
|
|
2027
2027
|
function ir(e) {
|
|
2028
|
-
const { questionnaireService: t, applicantService: r } =
|
|
2029
|
-
var
|
|
2028
|
+
const { questionnaireService: t, applicantService: r } = pe(), [n, s] = x(null), [l, o] = x({}), [c, u] = x(!1), [m, w] = x(!1), [S, y] = x(null), h = X(!1), g = X(null), N = Q(async () => {
|
|
2029
|
+
var p, R;
|
|
2030
2030
|
if (e) {
|
|
2031
2031
|
if (h.current) {
|
|
2032
2032
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
@@ -2034,24 +2034,24 @@ function ir(e) {
|
|
|
2034
2034
|
}
|
|
2035
2035
|
h.current = !0, u(!0), y(null);
|
|
2036
2036
|
try {
|
|
2037
|
-
const [
|
|
2037
|
+
const [C, v] = await Promise.all([
|
|
2038
2038
|
t.getQuestionnaire(e),
|
|
2039
2039
|
r.getApplicantData(e).catch(() => null)
|
|
2040
2040
|
]);
|
|
2041
|
-
if (s(
|
|
2041
|
+
if (s(C), (p = v == null ? void 0 : v.questionnaireResults) != null && p.length && C) {
|
|
2042
2042
|
const q = /* @__PURE__ */ new Map();
|
|
2043
|
-
for (const f of
|
|
2043
|
+
for (const f of v.questionnaireResults)
|
|
2044
2044
|
f.question && ((R = f.answers) != null && R.length) && q.set(f.question.trim().toLowerCase(), f.answers);
|
|
2045
|
-
const
|
|
2045
|
+
const W = {}, T = C.questionGroups.flatMap((f) => f.questions ?? []);
|
|
2046
2046
|
for (const f of T) {
|
|
2047
|
-
const
|
|
2048
|
-
q.has(
|
|
2047
|
+
const A = f.text.trim().toLowerCase();
|
|
2048
|
+
q.has(A) && (W[f.id] = q.get(A));
|
|
2049
2049
|
}
|
|
2050
|
-
o(
|
|
2050
|
+
o(W);
|
|
2051
2051
|
}
|
|
2052
2052
|
g.current = e;
|
|
2053
|
-
} catch (
|
|
2054
|
-
y(
|
|
2053
|
+
} catch (C) {
|
|
2054
|
+
y(C);
|
|
2055
2055
|
} finally {
|
|
2056
2056
|
u(!1), h.current = !1;
|
|
2057
2057
|
}
|
|
@@ -2060,11 +2060,11 @@ function ir(e) {
|
|
|
2060
2060
|
ee(() => {
|
|
2061
2061
|
e && g.current !== e && N();
|
|
2062
2062
|
}, [e]);
|
|
2063
|
-
const b =
|
|
2064
|
-
async (
|
|
2063
|
+
const b = Q(
|
|
2064
|
+
async (p) => {
|
|
2065
2065
|
w(!0), y(null);
|
|
2066
2066
|
try {
|
|
2067
|
-
return await t.fillQuestionnaire(
|
|
2067
|
+
return await t.fillQuestionnaire(p);
|
|
2068
2068
|
} catch (R) {
|
|
2069
2069
|
throw y(R), R;
|
|
2070
2070
|
} finally {
|
|
@@ -2077,14 +2077,14 @@ function ir(e) {
|
|
|
2077
2077
|
questionnaire: n,
|
|
2078
2078
|
initialAnswers: l,
|
|
2079
2079
|
isLoading: c,
|
|
2080
|
-
isSubmitting:
|
|
2080
|
+
isSubmitting: m,
|
|
2081
2081
|
error: S,
|
|
2082
2082
|
load: N,
|
|
2083
2083
|
submit: b
|
|
2084
2084
|
};
|
|
2085
2085
|
}
|
|
2086
2086
|
function lr(e) {
|
|
2087
|
-
const { uploadDocumentService: t } =
|
|
2087
|
+
const { uploadDocumentService: t } = pe(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, m] = x(0), [w, S] = x(null), y = X(!1), h = X(null), g = Q(async () => {
|
|
2088
2088
|
if (e) {
|
|
2089
2089
|
if (y.current) {
|
|
2090
2090
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
@@ -2104,13 +2104,13 @@ function lr(e) {
|
|
|
2104
2104
|
ee(() => {
|
|
2105
2105
|
e && h.current !== e && g();
|
|
2106
2106
|
}, [e]);
|
|
2107
|
-
const N =
|
|
2107
|
+
const N = Q(
|
|
2108
2108
|
async (b) => {
|
|
2109
|
-
c(!0),
|
|
2109
|
+
c(!0), m(0), S(null);
|
|
2110
2110
|
try {
|
|
2111
|
-
await t.fillUploadDocument(b),
|
|
2112
|
-
} catch (
|
|
2113
|
-
throw S(
|
|
2111
|
+
await t.fillUploadDocument(b), m(100);
|
|
2112
|
+
} catch (p) {
|
|
2113
|
+
throw S(p), p;
|
|
2114
2114
|
} finally {
|
|
2115
2115
|
c(!1);
|
|
2116
2116
|
}
|
|
@@ -2128,18 +2128,18 @@ function lr(e) {
|
|
|
2128
2128
|
};
|
|
2129
2129
|
}
|
|
2130
2130
|
function Xr(e) {
|
|
2131
|
-
const { appropriatenessTestService: t } =
|
|
2131
|
+
const { appropriatenessTestService: t } = pe(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, m] = x(null), [w, S] = x(null), y = X(!1), h = X(null), g = Q(async () => {
|
|
2132
2132
|
if (e) {
|
|
2133
2133
|
if (y.current) {
|
|
2134
2134
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
2135
2135
|
return;
|
|
2136
2136
|
}
|
|
2137
|
-
y.current = !0, l(!0),
|
|
2137
|
+
y.current = !0, l(!0), m(null);
|
|
2138
2138
|
try {
|
|
2139
2139
|
const b = await t.getAppropriatenessTest(e);
|
|
2140
2140
|
n(b), h.current = e;
|
|
2141
2141
|
} catch (b) {
|
|
2142
|
-
|
|
2142
|
+
m(b);
|
|
2143
2143
|
} finally {
|
|
2144
2144
|
l(!1), y.current = !1;
|
|
2145
2145
|
}
|
|
@@ -2148,14 +2148,14 @@ function Xr(e) {
|
|
|
2148
2148
|
ee(() => {
|
|
2149
2149
|
e && h.current !== e && g();
|
|
2150
2150
|
}, [e]);
|
|
2151
|
-
const N =
|
|
2151
|
+
const N = Q(
|
|
2152
2152
|
async (b) => {
|
|
2153
|
-
c(!0),
|
|
2153
|
+
c(!0), m(null);
|
|
2154
2154
|
try {
|
|
2155
|
-
const
|
|
2156
|
-
return S(
|
|
2157
|
-
} catch (
|
|
2158
|
-
throw p
|
|
2155
|
+
const p = await t.fillAppropriatenessTest(b);
|
|
2156
|
+
return S(p), p;
|
|
2157
|
+
} catch (p) {
|
|
2158
|
+
throw m(p), p;
|
|
2159
2159
|
} finally {
|
|
2160
2160
|
c(!1);
|
|
2161
2161
|
}
|
|
@@ -2173,18 +2173,18 @@ function Xr(e) {
|
|
|
2173
2173
|
};
|
|
2174
2174
|
}
|
|
2175
2175
|
function or(e) {
|
|
2176
|
-
const { overviewService: t } =
|
|
2176
|
+
const { overviewService: t } = pe(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, m] = x(null), w = X(!1), S = X(null), y = Q(async () => {
|
|
2177
2177
|
if (e) {
|
|
2178
2178
|
if (w.current) {
|
|
2179
2179
|
console.log("[Overview] Load already in progress, skipping...");
|
|
2180
2180
|
return;
|
|
2181
2181
|
}
|
|
2182
|
-
w.current = !0, l(!0),
|
|
2182
|
+
w.current = !0, l(!0), m(null);
|
|
2183
2183
|
try {
|
|
2184
2184
|
const g = await t.getOverviewData(e);
|
|
2185
2185
|
n(g), S.current = e;
|
|
2186
2186
|
} catch (g) {
|
|
2187
|
-
|
|
2187
|
+
m(g);
|
|
2188
2188
|
} finally {
|
|
2189
2189
|
l(!1), w.current = !1;
|
|
2190
2190
|
}
|
|
@@ -2193,13 +2193,13 @@ function or(e) {
|
|
|
2193
2193
|
ee(() => {
|
|
2194
2194
|
e && S.current !== e && y();
|
|
2195
2195
|
}, [e]);
|
|
2196
|
-
const h =
|
|
2196
|
+
const h = Q(async () => {
|
|
2197
2197
|
if (e) {
|
|
2198
|
-
c(!0),
|
|
2198
|
+
c(!0), m(null);
|
|
2199
2199
|
try {
|
|
2200
2200
|
await t.passOverview(e);
|
|
2201
2201
|
} catch (g) {
|
|
2202
|
-
throw
|
|
2202
|
+
throw m(g), g;
|
|
2203
2203
|
} finally {
|
|
2204
2204
|
c(!1);
|
|
2205
2205
|
}
|
|
@@ -2215,9 +2215,9 @@ function or(e) {
|
|
|
2215
2215
|
};
|
|
2216
2216
|
}
|
|
2217
2217
|
function cr(e) {
|
|
2218
|
-
const { identityService: t } =
|
|
2218
|
+
const { identityService: t } = pe(), [r, n] = x(
|
|
2219
2219
|
null
|
|
2220
|
-
), [s, l] = x(!1), [o, c] = x(null), u = X(!1),
|
|
2220
|
+
), [s, l] = x(!1), [o, c] = x(null), u = X(!1), m = Q(
|
|
2221
2221
|
async (y, h) => {
|
|
2222
2222
|
if (e) {
|
|
2223
2223
|
if (u.current) {
|
|
@@ -2244,7 +2244,7 @@ function cr(e) {
|
|
|
2244
2244
|
}
|
|
2245
2245
|
},
|
|
2246
2246
|
[e, t]
|
|
2247
|
-
), w =
|
|
2247
|
+
), w = Q(
|
|
2248
2248
|
async (y, h) => {
|
|
2249
2249
|
if (e) {
|
|
2250
2250
|
l(!0), c(null);
|
|
@@ -2264,7 +2264,7 @@ function cr(e) {
|
|
|
2264
2264
|
}
|
|
2265
2265
|
},
|
|
2266
2266
|
[e, t]
|
|
2267
|
-
), S =
|
|
2267
|
+
), S = Q(async () => {
|
|
2268
2268
|
if (e) {
|
|
2269
2269
|
if (u.current) {
|
|
2270
2270
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
@@ -2295,14 +2295,14 @@ function cr(e) {
|
|
|
2295
2295
|
token: (r == null ? void 0 : r.publicProviderTokenObject) || null,
|
|
2296
2296
|
isLoading: s,
|
|
2297
2297
|
error: o,
|
|
2298
|
-
requestIdentity:
|
|
2298
|
+
requestIdentity: m,
|
|
2299
2299
|
requestCompanyIdentity: w,
|
|
2300
2300
|
restartIdentity: S
|
|
2301
2301
|
};
|
|
2302
2302
|
}
|
|
2303
2303
|
function dr(e) {
|
|
2304
|
-
const { riskScoringService: t, applicantService: r } =
|
|
2305
|
-
var
|
|
2304
|
+
const { riskScoringService: t, applicantService: r } = pe(), [n, s] = x(null), [l, o] = x({}), [c, u] = x(!1), [m, w] = x(!1), [S, y] = x(null), [h, g] = x(null), N = X(!1), b = X(null), p = Q(async () => {
|
|
2305
|
+
var C;
|
|
2306
2306
|
if (e) {
|
|
2307
2307
|
if (N.current) {
|
|
2308
2308
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
@@ -2310,40 +2310,40 @@ function dr(e) {
|
|
|
2310
2310
|
}
|
|
2311
2311
|
N.current = !0, u(!0), y(null);
|
|
2312
2312
|
try {
|
|
2313
|
-
const [
|
|
2313
|
+
const [v, q] = await Promise.all([
|
|
2314
2314
|
t.getRiskCriterias(e),
|
|
2315
2315
|
r.getApplicantData(e).catch(() => null)
|
|
2316
2316
|
]);
|
|
2317
|
-
if (s(
|
|
2318
|
-
const
|
|
2319
|
-
for (const f of
|
|
2317
|
+
if (s(v), (C = q == null ? void 0 : q.riskScoringResults) != null && C.length) {
|
|
2318
|
+
const W = q.riskScoringResults[0], T = {};
|
|
2319
|
+
for (const f of W.riskCriteriaResults ?? [])
|
|
2320
2320
|
if (f.riskCriteriaId != null && f.answer != null && f.answer !== "") {
|
|
2321
|
-
const
|
|
2321
|
+
const A = [...new Set(
|
|
2322
2322
|
f.answer.split(",").map((F) => F.trim()).filter((F) => F !== "")
|
|
2323
2323
|
)];
|
|
2324
|
-
|
|
2324
|
+
A.length > 0 && (T[f.riskCriteriaId] = A);
|
|
2325
2325
|
}
|
|
2326
2326
|
o(T);
|
|
2327
2327
|
}
|
|
2328
2328
|
b.current = e;
|
|
2329
|
-
} catch (
|
|
2330
|
-
y(
|
|
2329
|
+
} catch (v) {
|
|
2330
|
+
y(v);
|
|
2331
2331
|
} finally {
|
|
2332
2332
|
u(!1), N.current = !1;
|
|
2333
2333
|
}
|
|
2334
2334
|
}
|
|
2335
2335
|
}, [e, t, r]);
|
|
2336
2336
|
ee(() => {
|
|
2337
|
-
e && b.current !== e &&
|
|
2337
|
+
e && b.current !== e && p();
|
|
2338
2338
|
}, [e]);
|
|
2339
|
-
const R =
|
|
2340
|
-
async (
|
|
2339
|
+
const R = Q(
|
|
2340
|
+
async (C) => {
|
|
2341
2341
|
w(!0), y(null);
|
|
2342
2342
|
try {
|
|
2343
|
-
const
|
|
2344
|
-
return g(
|
|
2345
|
-
} catch (
|
|
2346
|
-
throw y(
|
|
2343
|
+
const v = await t.submitRiskScoring(C);
|
|
2344
|
+
return g(v), v;
|
|
2345
|
+
} catch (v) {
|
|
2346
|
+
throw y(v), v;
|
|
2347
2347
|
} finally {
|
|
2348
2348
|
w(!1);
|
|
2349
2349
|
}
|
|
@@ -2355,17 +2355,17 @@ function dr(e) {
|
|
|
2355
2355
|
initialAnswers: l,
|
|
2356
2356
|
result: h,
|
|
2357
2357
|
isLoading: c,
|
|
2358
|
-
isSubmitting:
|
|
2358
|
+
isSubmitting: m,
|
|
2359
2359
|
error: S,
|
|
2360
|
-
load:
|
|
2360
|
+
load: p,
|
|
2361
2361
|
submit: R
|
|
2362
2362
|
};
|
|
2363
2363
|
}
|
|
2364
2364
|
function ur() {
|
|
2365
|
-
const { applicantService: e, config: t } =
|
|
2365
|
+
const { applicantService: e, config: t } = pe(), [r, n] = x(!1), [s, l] = x(null), o = X(!1), c = X(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(h) {
|
|
2366
2366
|
const g = Math.random() * 16 | 0;
|
|
2367
2367
|
return (h === "x" ? g : g & 3 | 8).toString(16);
|
|
2368
|
-
}),
|
|
2368
|
+
}), m = Q(
|
|
2369
2369
|
async (h) => {
|
|
2370
2370
|
var g;
|
|
2371
2371
|
if (o.current)
|
|
@@ -2387,7 +2387,7 @@ function ur() {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
},
|
|
2389
2389
|
[e, t]
|
|
2390
|
-
), w =
|
|
2390
|
+
), w = Q(
|
|
2391
2391
|
async (h) => {
|
|
2392
2392
|
n(!0), l(null);
|
|
2393
2393
|
try {
|
|
@@ -2399,7 +2399,7 @@ function ur() {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
},
|
|
2401
2401
|
[e]
|
|
2402
|
-
), S =
|
|
2402
|
+
), S = Q(
|
|
2403
2403
|
async (h) => {
|
|
2404
2404
|
if (c.current)
|
|
2405
2405
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
@@ -2413,7 +2413,7 @@ function ur() {
|
|
|
2413
2413
|
}
|
|
2414
2414
|
},
|
|
2415
2415
|
[e]
|
|
2416
|
-
), y =
|
|
2416
|
+
), y = Q(
|
|
2417
2417
|
async (h) => {
|
|
2418
2418
|
n(!0), l(null);
|
|
2419
2419
|
try {
|
|
@@ -2429,7 +2429,7 @@ function ur() {
|
|
|
2429
2429
|
return {
|
|
2430
2430
|
isLoading: r,
|
|
2431
2431
|
error: s,
|
|
2432
|
-
createApplicant:
|
|
2432
|
+
createApplicant: m,
|
|
2433
2433
|
createCompanyApplicant: w,
|
|
2434
2434
|
getApplicantData: S,
|
|
2435
2435
|
stopProgress: y
|
|
@@ -2450,7 +2450,7 @@ const U = ({
|
|
|
2450
2450
|
outline: "border-2 border-primary-500 text-primary-500 hover:bg-primary-50 focus:ring-primary-500",
|
|
2451
2451
|
danger: "bg-danger-500 text-white hover:bg-danger-600 focus:ring-danger-500",
|
|
2452
2452
|
ghost: "text-gray-700 hover:bg-gray-100 focus:ring-gray-400"
|
|
2453
|
-
},
|
|
2453
|
+
}, m = {
|
|
2454
2454
|
sm: "px-3 py-1.5 text-sm",
|
|
2455
2455
|
md: "px-4 py-2 text-base",
|
|
2456
2456
|
lg: "px-6 py-3 text-lg"
|
|
@@ -2458,7 +2458,7 @@ const U = ({
|
|
|
2458
2458
|
return /* @__PURE__ */ i(
|
|
2459
2459
|
"button",
|
|
2460
2460
|
{
|
|
2461
|
-
className: le(c, u[t],
|
|
2461
|
+
className: le(c, u[t], m[r], l),
|
|
2462
2462
|
disabled: s || n,
|
|
2463
2463
|
...o,
|
|
2464
2464
|
children: [
|
|
@@ -2496,7 +2496,7 @@ const U = ({
|
|
|
2496
2496
|
]
|
|
2497
2497
|
}
|
|
2498
2498
|
);
|
|
2499
|
-
},
|
|
2499
|
+
}, de = $e(
|
|
2500
2500
|
({ label: e, error: t, helperText: r, leftIcon: n, rightIcon: s, className: l, ...o }, c) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2501
2501
|
e && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2502
2502
|
e,
|
|
@@ -2527,8 +2527,8 @@ const U = ({
|
|
|
2527
2527
|
!t && r && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-gray-500", children: r })
|
|
2528
2528
|
] })
|
|
2529
2529
|
);
|
|
2530
|
-
|
|
2531
|
-
const
|
|
2530
|
+
de.displayName = "Input";
|
|
2531
|
+
const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
2532
2532
|
"div",
|
|
2533
2533
|
{
|
|
2534
2534
|
className: le(
|
|
@@ -2552,7 +2552,7 @@ const B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2552
2552
|
...r,
|
|
2553
2553
|
children: e
|
|
2554
2554
|
}
|
|
2555
|
-
),
|
|
2555
|
+
), B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a("div", { className: le("px-6 py-4", t), ...r, children: e }), ue = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
2556
2556
|
"div",
|
|
2557
2557
|
{
|
|
2558
2558
|
className: le("px-6 py-4 border-t", t),
|
|
@@ -2562,7 +2562,7 @@ const B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2562
2562
|
...r,
|
|
2563
2563
|
children: e
|
|
2564
2564
|
}
|
|
2565
|
-
),
|
|
2565
|
+
), Ne = ({ children: e, variant: t = "default", className: r, ...n }) => /* @__PURE__ */ a(
|
|
2566
2566
|
"span",
|
|
2567
2567
|
{
|
|
2568
2568
|
className: le(
|
|
@@ -2579,7 +2579,7 @@ const B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2579
2579
|
...n,
|
|
2580
2580
|
children: e
|
|
2581
2581
|
}
|
|
2582
|
-
),
|
|
2582
|
+
), fe = ({ size: e = "md", className: t, ...r }) => {
|
|
2583
2583
|
const n = {
|
|
2584
2584
|
sm: "h-4 w-4",
|
|
2585
2585
|
md: "h-8 w-8",
|
|
@@ -2615,7 +2615,7 @@ const B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2615
2615
|
]
|
|
2616
2616
|
}
|
|
2617
2617
|
) });
|
|
2618
|
-
},
|
|
2618
|
+
}, Ce = $e(
|
|
2619
2619
|
({ label: e, error: t, helperText: r, options: n, placeholder: s, className: l, style: o, ...c }, u) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2620
2620
|
e && /* @__PURE__ */ i(
|
|
2621
2621
|
"label",
|
|
@@ -2661,18 +2661,18 @@ const B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2661
2661
|
},
|
|
2662
2662
|
"__placeholder__"
|
|
2663
2663
|
),
|
|
2664
|
-
n.map((
|
|
2664
|
+
n.map((m, w) => /* @__PURE__ */ a(
|
|
2665
2665
|
"option",
|
|
2666
2666
|
{
|
|
2667
|
-
value:
|
|
2668
|
-
disabled:
|
|
2667
|
+
value: m.value,
|
|
2668
|
+
disabled: m.disabled,
|
|
2669
2669
|
style: {
|
|
2670
2670
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2671
|
-
color:
|
|
2671
|
+
color: m.disabled ? "var(--metakyc-text-secondary, #9ca3af)" : "var(--metakyc-text-primary, #111827)"
|
|
2672
2672
|
},
|
|
2673
|
-
children:
|
|
2673
|
+
children: m.label
|
|
2674
2674
|
},
|
|
2675
|
-
|
|
2675
|
+
m.value || `option-${w}`
|
|
2676
2676
|
))
|
|
2677
2677
|
]
|
|
2678
2678
|
}
|
|
@@ -2681,7 +2681,7 @@ const B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2681
2681
|
!t && r && /* @__PURE__ */ a("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r })
|
|
2682
2682
|
] })
|
|
2683
2683
|
);
|
|
2684
|
-
|
|
2684
|
+
Ce.displayName = "Select";
|
|
2685
2685
|
const mr = ({
|
|
2686
2686
|
label: e,
|
|
2687
2687
|
value: t,
|
|
@@ -2691,22 +2691,22 @@ const mr = ({
|
|
|
2691
2691
|
disabled: l = !1,
|
|
2692
2692
|
required: o = !1
|
|
2693
2693
|
}) => {
|
|
2694
|
-
const [c, u] = x(!1), [
|
|
2694
|
+
const [c, u] = x(!1), [m, w] = x(""), S = X(null);
|
|
2695
2695
|
ee(() => {
|
|
2696
|
-
const b = (
|
|
2697
|
-
S.current && !S.current.contains(
|
|
2696
|
+
const b = (p) => {
|
|
2697
|
+
S.current && !S.current.contains(p.target) && (u(!1), w(""));
|
|
2698
2698
|
};
|
|
2699
2699
|
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
2700
2700
|
}, []);
|
|
2701
2701
|
const y = n.filter(
|
|
2702
|
-
(b) => b.label.toLowerCase().includes(
|
|
2702
|
+
(b) => b.label.toLowerCase().includes(m.toLowerCase())
|
|
2703
2703
|
), h = (b) => {
|
|
2704
|
-
l || (t.includes(b) ? r(t.filter((
|
|
2705
|
-
}, g = (b,
|
|
2706
|
-
|
|
2704
|
+
l || (t.includes(b) ? r(t.filter((p) => p !== b)) : r([...t, b]));
|
|
2705
|
+
}, g = (b, p) => {
|
|
2706
|
+
p.stopPropagation(), l || r(t.filter((R) => R !== b));
|
|
2707
2707
|
}, N = (b) => {
|
|
2708
|
-
var
|
|
2709
|
-
return ((
|
|
2708
|
+
var p;
|
|
2709
|
+
return ((p = n.find((R) => R.value === b)) == null ? void 0 : p.label) || b;
|
|
2710
2710
|
};
|
|
2711
2711
|
return /* @__PURE__ */ i("div", { className: "w-full metakyc-multiselect", ref: S, children: [
|
|
2712
2712
|
e && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
@@ -2737,7 +2737,7 @@ const mr = ({
|
|
|
2737
2737
|
"button",
|
|
2738
2738
|
{
|
|
2739
2739
|
type: "button",
|
|
2740
|
-
onClick: (
|
|
2740
|
+
onClick: (p) => g(b, p),
|
|
2741
2741
|
className: "metakyc-multiselect-chip-remove",
|
|
2742
2742
|
style: {
|
|
2743
2743
|
background: "transparent",
|
|
@@ -2779,7 +2779,7 @@ const mr = ({
|
|
|
2779
2779
|
"input",
|
|
2780
2780
|
{
|
|
2781
2781
|
type: "text",
|
|
2782
|
-
value:
|
|
2782
|
+
value: m,
|
|
2783
2783
|
onChange: (b) => w(b.target.value),
|
|
2784
2784
|
placeholder: "Search...",
|
|
2785
2785
|
autoFocus: !0,
|
|
@@ -2843,26 +2843,26 @@ const mr = ({
|
|
|
2843
2843
|
value: o = [],
|
|
2844
2844
|
className: c
|
|
2845
2845
|
}) => {
|
|
2846
|
-
const [u,
|
|
2847
|
-
if (!
|
|
2848
|
-
const R = Array.from(
|
|
2849
|
-
if (s && R.filter((
|
|
2850
|
-
const
|
|
2851
|
-
alert(`Some files exceed the maximum size of ${
|
|
2846
|
+
const [u, m] = x(!1), w = X(null), S = (p) => {
|
|
2847
|
+
if (!p) return;
|
|
2848
|
+
const R = Array.from(p);
|
|
2849
|
+
if (s && R.filter((v) => v.size > s).length > 0) {
|
|
2850
|
+
const v = Ke(s);
|
|
2851
|
+
alert(`Some files exceed the maximum size of ${v}`);
|
|
2852
2852
|
return;
|
|
2853
2853
|
}
|
|
2854
2854
|
l == null || l(n ? [...o, ...R] : [R[0]]);
|
|
2855
|
-
}, y = (
|
|
2856
|
-
|
|
2855
|
+
}, y = (p) => {
|
|
2856
|
+
p.preventDefault(), m(!0);
|
|
2857
2857
|
}, h = () => {
|
|
2858
|
-
|
|
2859
|
-
}, g = (
|
|
2860
|
-
|
|
2858
|
+
m(!1);
|
|
2859
|
+
}, g = (p) => {
|
|
2860
|
+
p.preventDefault(), m(!1), S(p.dataTransfer.files);
|
|
2861
2861
|
}, N = () => {
|
|
2862
|
-
var
|
|
2863
|
-
(
|
|
2864
|
-
}, b = (
|
|
2865
|
-
const R = o.filter((
|
|
2862
|
+
var p;
|
|
2863
|
+
(p = w.current) == null || p.click();
|
|
2864
|
+
}, b = (p) => {
|
|
2865
|
+
const R = o.filter((C, v) => v !== p);
|
|
2866
2866
|
l == null || l(R);
|
|
2867
2867
|
};
|
|
2868
2868
|
return /* @__PURE__ */ i("div", { className: le("w-full", c), children: [
|
|
@@ -2888,7 +2888,7 @@ const mr = ({
|
|
|
2888
2888
|
className: "hidden",
|
|
2889
2889
|
accept: r,
|
|
2890
2890
|
multiple: n,
|
|
2891
|
-
onChange: (
|
|
2891
|
+
onChange: (p) => S(p.target.files)
|
|
2892
2892
|
}
|
|
2893
2893
|
),
|
|
2894
2894
|
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
@@ -2916,13 +2916,13 @@ const mr = ({
|
|
|
2916
2916
|
] }),
|
|
2917
2917
|
s && /* @__PURE__ */ i("p", { className: "text-xs text-gray-500", children: [
|
|
2918
2918
|
"Maximum file size: ",
|
|
2919
|
-
|
|
2919
|
+
Ke(s)
|
|
2920
2920
|
] })
|
|
2921
2921
|
] })
|
|
2922
2922
|
]
|
|
2923
2923
|
}
|
|
2924
2924
|
),
|
|
2925
|
-
o.length > 0 && /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: o.map((
|
|
2925
|
+
o.length > 0 && /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: o.map((p, R) => /* @__PURE__ */ i(
|
|
2926
2926
|
"div",
|
|
2927
2927
|
{
|
|
2928
2928
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -2944,10 +2944,10 @@ const mr = ({
|
|
|
2944
2944
|
)
|
|
2945
2945
|
}
|
|
2946
2946
|
),
|
|
2947
|
-
/* @__PURE__ */ a("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children:
|
|
2947
|
+
/* @__PURE__ */ a("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: p.name }),
|
|
2948
2948
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-500", children: [
|
|
2949
2949
|
"(",
|
|
2950
|
-
|
|
2950
|
+
Ke(p.size),
|
|
2951
2951
|
")"
|
|
2952
2952
|
] })
|
|
2953
2953
|
] }),
|
|
@@ -2955,8 +2955,8 @@ const mr = ({
|
|
|
2955
2955
|
"button",
|
|
2956
2956
|
{
|
|
2957
2957
|
type: "button",
|
|
2958
|
-
onClick: (
|
|
2959
|
-
|
|
2958
|
+
onClick: (C) => {
|
|
2959
|
+
C.stopPropagation(), b(R);
|
|
2960
2960
|
},
|
|
2961
2961
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2962
2962
|
children: /* @__PURE__ */ a("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ a(
|
|
@@ -2975,7 +2975,7 @@ const mr = ({
|
|
|
2975
2975
|
)) }),
|
|
2976
2976
|
t && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-danger-500", children: t })
|
|
2977
2977
|
] });
|
|
2978
|
-
}, hr =
|
|
2978
|
+
}, hr = $e(
|
|
2979
2979
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: r, ...n }, s) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2980
2980
|
n.label && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2981
2981
|
n.label,
|
|
@@ -2997,7 +2997,7 @@ const mr = ({
|
|
|
2997
2997
|
}
|
|
2998
2998
|
),
|
|
2999
2999
|
/* @__PURE__ */ a(
|
|
3000
|
-
|
|
3000
|
+
de,
|
|
3001
3001
|
{
|
|
3002
3002
|
ref: s,
|
|
3003
3003
|
type: "tel",
|
|
@@ -3080,7 +3080,7 @@ const xr = (e) => {
|
|
|
3080
3080
|
* This source code is licensed under the ISC license.
|
|
3081
3081
|
* See the LICENSE file in the root directory of this source tree.
|
|
3082
3082
|
*/
|
|
3083
|
-
const br =
|
|
3083
|
+
const br = $e(
|
|
3084
3084
|
({
|
|
3085
3085
|
color: e = "currentColor",
|
|
3086
3086
|
size: t = 24,
|
|
@@ -3090,7 +3090,7 @@ const br = Be(
|
|
|
3090
3090
|
children: l,
|
|
3091
3091
|
iconNode: o,
|
|
3092
3092
|
...c
|
|
3093
|
-
}, u) =>
|
|
3093
|
+
}, u) => He(
|
|
3094
3094
|
"svg",
|
|
3095
3095
|
{
|
|
3096
3096
|
ref: u,
|
|
@@ -3104,7 +3104,7 @@ const br = Be(
|
|
|
3104
3104
|
...c
|
|
3105
3105
|
},
|
|
3106
3106
|
[
|
|
3107
|
-
...o.map(([
|
|
3107
|
+
...o.map(([m, w]) => He(m, w)),
|
|
3108
3108
|
...Array.isArray(l) ? l : [l]
|
|
3109
3109
|
]
|
|
3110
3110
|
)
|
|
@@ -3116,8 +3116,8 @@ const br = Be(
|
|
|
3116
3116
|
* See the LICENSE file in the root directory of this source tree.
|
|
3117
3117
|
*/
|
|
3118
3118
|
const nt = (e, t) => {
|
|
3119
|
-
const r =
|
|
3120
|
-
({ className: n, ...s }, l) =>
|
|
3119
|
+
const r = $e(
|
|
3120
|
+
({ className: n, ...s }, l) => He(br, {
|
|
3121
3121
|
ref: l,
|
|
3122
3122
|
iconNode: t,
|
|
3123
3123
|
className: at(
|
|
@@ -3188,36 +3188,36 @@ const Sr = ({
|
|
|
3188
3188
|
onComplete: t,
|
|
3189
3189
|
onBack: r
|
|
3190
3190
|
}) => {
|
|
3191
|
-
const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = ir(e), [
|
|
3192
|
-
|
|
3193
|
-
s && Object.keys(s).length > 0 && Object.keys(
|
|
3191
|
+
const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = ir(e), [m, w] = x({}), [S, y] = x({}), [h, g] = x(0);
|
|
3192
|
+
he.useEffect(() => {
|
|
3193
|
+
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && w(s);
|
|
3194
3194
|
}, [s]);
|
|
3195
|
-
const N =
|
|
3195
|
+
const N = Re(
|
|
3196
3196
|
() => n ? Nr(n.questionGroups) : [],
|
|
3197
3197
|
[n]
|
|
3198
|
-
), b = h === N.length - 1,
|
|
3199
|
-
w((
|
|
3200
|
-
const F = { ...
|
|
3198
|
+
), b = h === N.length - 1, p = N[h] ?? [], R = Q((T, f) => {
|
|
3199
|
+
w((A) => ({ ...A, [T]: f })), y((A) => {
|
|
3200
|
+
const F = { ...A };
|
|
3201
3201
|
return delete F[T], F;
|
|
3202
3202
|
});
|
|
3203
|
-
}, []),
|
|
3203
|
+
}, []), C = Q(() => {
|
|
3204
3204
|
const T = {};
|
|
3205
|
-
for (const { question: f } of
|
|
3206
|
-
const
|
|
3207
|
-
|
|
3205
|
+
for (const { question: f } of p) {
|
|
3206
|
+
const A = wr(f, m[f.id] ?? []);
|
|
3207
|
+
A && (T[f.id] = A);
|
|
3208
3208
|
}
|
|
3209
3209
|
return y((f) => ({ ...f, ...T })), Object.keys(T).length === 0;
|
|
3210
|
-
}, [
|
|
3211
|
-
|
|
3210
|
+
}, [p, m]), v = () => {
|
|
3211
|
+
C() && g((T) => T + 1);
|
|
3212
3212
|
}, q = () => {
|
|
3213
3213
|
h > 0 ? g((T) => T - 1) : r == null || r();
|
|
3214
|
-
},
|
|
3215
|
-
if (!(!
|
|
3214
|
+
}, W = async () => {
|
|
3215
|
+
if (!(!C() || !n))
|
|
3216
3216
|
try {
|
|
3217
3217
|
const T = n.questionGroups.flatMap(
|
|
3218
|
-
(
|
|
3218
|
+
(A) => (A.questions ?? []).map((F) => ({
|
|
3219
3219
|
questionId: F.id,
|
|
3220
|
-
values:
|
|
3220
|
+
values: m[F.id] ?? []
|
|
3221
3221
|
}))
|
|
3222
3222
|
), f = {
|
|
3223
3223
|
applicantId: e,
|
|
@@ -3229,10 +3229,10 @@ const Sr = ({
|
|
|
3229
3229
|
console.error("Questionnaire submit error:", T);
|
|
3230
3230
|
}
|
|
3231
3231
|
};
|
|
3232
|
-
return l ? /* @__PURE__ */ a(
|
|
3232
|
+
return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(fe, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3233
3233
|
"Error loading questionnaire: ",
|
|
3234
3234
|
c.message
|
|
3235
|
-
] }) }) }) : n ? /* @__PURE__ */ i(
|
|
3235
|
+
] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
|
|
3236
3236
|
/* @__PURE__ */ i(oe, { children: [
|
|
3237
3237
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.displayName }),
|
|
3238
3238
|
n.subtitle && /* @__PURE__ */ a("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.subtitle }),
|
|
@@ -3257,17 +3257,17 @@ const Sr = ({
|
|
|
3257
3257
|
)) })
|
|
3258
3258
|
] })
|
|
3259
3259
|
] }),
|
|
3260
|
-
/* @__PURE__ */ a(
|
|
3260
|
+
/* @__PURE__ */ a(B, { className: "space-y-6", children: p.map(({ question: T }) => /* @__PURE__ */ a(
|
|
3261
3261
|
Cr,
|
|
3262
3262
|
{
|
|
3263
3263
|
question: T,
|
|
3264
|
-
value:
|
|
3264
|
+
value: m[T.id] ?? [],
|
|
3265
3265
|
error: S[T.id],
|
|
3266
3266
|
onChange: (f) => R(T.id, f)
|
|
3267
3267
|
},
|
|
3268
3268
|
T.id
|
|
3269
3269
|
)) }),
|
|
3270
|
-
/* @__PURE__ */ i(
|
|
3270
|
+
/* @__PURE__ */ i(ue, { className: "flex items-center justify-between", children: [
|
|
3271
3271
|
/* @__PURE__ */ i(
|
|
3272
3272
|
U,
|
|
3273
3273
|
{
|
|
@@ -3286,14 +3286,14 @@ const Sr = ({
|
|
|
3286
3286
|
{
|
|
3287
3287
|
type: "button",
|
|
3288
3288
|
isLoading: o,
|
|
3289
|
-
onClick:
|
|
3289
|
+
onClick: W,
|
|
3290
3290
|
children: "Continue"
|
|
3291
3291
|
}
|
|
3292
3292
|
) : /* @__PURE__ */ i(
|
|
3293
3293
|
U,
|
|
3294
3294
|
{
|
|
3295
3295
|
type: "button",
|
|
3296
|
-
onClick:
|
|
3296
|
+
onClick: v,
|
|
3297
3297
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3298
3298
|
children: [
|
|
3299
3299
|
"Next",
|
|
@@ -3315,7 +3315,7 @@ const Sr = ({
|
|
|
3315
3315
|
e.subtitle && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.subtitle }),
|
|
3316
3316
|
e.description && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.description }),
|
|
3317
3317
|
l === "text" && /* @__PURE__ */ a(
|
|
3318
|
-
|
|
3318
|
+
de,
|
|
3319
3319
|
{
|
|
3320
3320
|
value: t[0] ?? "",
|
|
3321
3321
|
onChange: (c) => n([c.target.value]),
|
|
@@ -3325,7 +3325,7 @@ const Sr = ({
|
|
|
3325
3325
|
}
|
|
3326
3326
|
),
|
|
3327
3327
|
l === "single-select" && /* @__PURE__ */ a(
|
|
3328
|
-
|
|
3328
|
+
Ce,
|
|
3329
3329
|
{
|
|
3330
3330
|
value: t[0] ?? "",
|
|
3331
3331
|
onChange: (c) => n([c.target.value]),
|
|
@@ -3384,7 +3384,7 @@ const Sr = ({
|
|
|
3384
3384
|
type: "checkbox",
|
|
3385
3385
|
checked: t.includes(c),
|
|
3386
3386
|
onChange: (u) => {
|
|
3387
|
-
u.target.checked ? n([...t, c]) : n(t.filter((
|
|
3387
|
+
u.target.checked ? n([...t, c]) : n(t.filter((m) => m !== c));
|
|
3388
3388
|
},
|
|
3389
3389
|
className: "metakyc-option-input",
|
|
3390
3390
|
style: {
|
|
@@ -3416,14 +3416,14 @@ const Sr = ({
|
|
|
3416
3416
|
onComplete: t,
|
|
3417
3417
|
onBack: r
|
|
3418
3418
|
}) => {
|
|
3419
|
-
const { uploadDocument: n, isLoading: s, isSubmitting: l, error: o, submit: c } = lr(e), [u,
|
|
3419
|
+
const { uploadDocument: n, isLoading: s, isSubmitting: l, error: o, submit: c } = lr(e), [u, m] = x({}), w = async (S) => {
|
|
3420
3420
|
if (S.preventDefault(), !n) return;
|
|
3421
3421
|
const y = await Promise.all(
|
|
3422
3422
|
n.uploadDocumentFiles.map(async (g) => {
|
|
3423
3423
|
const N = u[g.id] || [], b = await Promise.all(
|
|
3424
|
-
N.map(async (
|
|
3425
|
-
fileName:
|
|
3426
|
-
fileData: await Xt(
|
|
3424
|
+
N.map(async (p) => ({
|
|
3425
|
+
fileName: p.name,
|
|
3426
|
+
fileData: await Xt(p)
|
|
3427
3427
|
}))
|
|
3428
3428
|
);
|
|
3429
3429
|
return {
|
|
@@ -3438,15 +3438,15 @@ const Sr = ({
|
|
|
3438
3438
|
};
|
|
3439
3439
|
await c(h), t == null || t();
|
|
3440
3440
|
};
|
|
3441
|
-
return s ? /* @__PURE__ */ a(
|
|
3441
|
+
return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(fe, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3442
3442
|
"Error loading document requirements: ",
|
|
3443
3443
|
o.message
|
|
3444
|
-
] }) }) }) : n ? /* @__PURE__ */ a("form", { onSubmit: w, children: /* @__PURE__ */ i(
|
|
3444
|
+
] }) }) }) : n ? /* @__PURE__ */ a("form", { onSubmit: w, children: /* @__PURE__ */ i($, { children: [
|
|
3445
3445
|
/* @__PURE__ */ i(oe, { children: [
|
|
3446
3446
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.displayName }),
|
|
3447
3447
|
n.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.subtitle })
|
|
3448
3448
|
] }),
|
|
3449
|
-
/* @__PURE__ */ a(
|
|
3449
|
+
/* @__PURE__ */ a(B, { className: "space-y-6", children: n.uploadDocumentFiles.map((S) => /* @__PURE__ */ a(
|
|
3450
3450
|
pr,
|
|
3451
3451
|
{
|
|
3452
3452
|
label: S.displayName,
|
|
@@ -3455,12 +3455,12 @@ const Sr = ({
|
|
|
3455
3455
|
maxSize: S.maxEachFileSizeByte,
|
|
3456
3456
|
value: u[S.id] || [],
|
|
3457
3457
|
onChange: (y) => {
|
|
3458
|
-
|
|
3458
|
+
m((h) => ({ ...h, [S.id]: y }));
|
|
3459
3459
|
}
|
|
3460
3460
|
},
|
|
3461
3461
|
S.id
|
|
3462
3462
|
)) }),
|
|
3463
|
-
/* @__PURE__ */ i(
|
|
3463
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
3464
3464
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3465
3465
|
/* @__PURE__ */ a(U, { type: "submit", isLoading: l, children: "Continue" })
|
|
3466
3466
|
] })
|
|
@@ -3469,16 +3469,16 @@ const Sr = ({
|
|
|
3469
3469
|
const { overview: n, isLoading: s, isSubmitting: l, error: o, passOverview: c } = or(e), u = async () => {
|
|
3470
3470
|
await c(), t == null || t();
|
|
3471
3471
|
};
|
|
3472
|
-
return s ? /* @__PURE__ */ a(
|
|
3472
|
+
return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(fe, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3473
3473
|
"Error loading overview: ",
|
|
3474
3474
|
o.message
|
|
3475
|
-
] }) }) }) : n ? /* @__PURE__ */ i(
|
|
3475
|
+
] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
|
|
3476
3476
|
/* @__PURE__ */ i(oe, { children: [
|
|
3477
3477
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.title || "Overview" }),
|
|
3478
3478
|
n.description && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.description })
|
|
3479
3479
|
] }),
|
|
3480
|
-
/* @__PURE__ */ a(
|
|
3481
|
-
/* @__PURE__ */ a("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ a("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children:
|
|
3480
|
+
/* @__PURE__ */ a(B, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((m, w) => m.order - w.order).map((m) => /* @__PURE__ */ i("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3481
|
+
/* @__PURE__ */ a("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ a("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 }) }),
|
|
3482
3482
|
/* @__PURE__ */ i(
|
|
3483
3483
|
"div",
|
|
3484
3484
|
{
|
|
@@ -3490,13 +3490,13 @@ const Sr = ({
|
|
|
3490
3490
|
background: "transparent"
|
|
3491
3491
|
},
|
|
3492
3492
|
children: [
|
|
3493
|
-
/* @__PURE__ */ a("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children:
|
|
3494
|
-
|
|
3493
|
+
/* @__PURE__ */ a("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children: m.title }),
|
|
3494
|
+
m.description && /* @__PURE__ */ a("p", { className: "metakyc-step-description text-sm text-gray-600 dark:text-gray-400", children: m.description })
|
|
3495
3495
|
]
|
|
3496
3496
|
}
|
|
3497
3497
|
)
|
|
3498
|
-
] },
|
|
3499
|
-
/* @__PURE__ */ i(
|
|
3498
|
+
] }, m.order)) : /* @__PURE__ */ a("div", { className: "text-center py-8", children: /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
|
|
3499
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
3500
3500
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3501
3501
|
/* @__PURE__ */ a(U, { onClick: u, isLoading: l, children: "Continue" })
|
|
3502
3502
|
] })
|
|
@@ -3514,7 +3514,7 @@ function Er(e, t) {
|
|
|
3514
3514
|
return e.errorMessage || "Invalid format";
|
|
3515
3515
|
} catch {
|
|
3516
3516
|
}
|
|
3517
|
-
const s = e.valueDataType ===
|
|
3517
|
+
const s = e.valueDataType === Se.Integer || e.valueDataType === Se.Decimal || e.valueDataType === Se.DigitOnly;
|
|
3518
3518
|
if (s && n.trim() !== "") {
|
|
3519
3519
|
const l = Number(n);
|
|
3520
3520
|
if (!isNaN(l)) {
|
|
@@ -3547,66 +3547,66 @@ const Dr = ({
|
|
|
3547
3547
|
onComplete: t,
|
|
3548
3548
|
onBack: r
|
|
3549
3549
|
}) => {
|
|
3550
|
-
const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = dr(e), [
|
|
3551
|
-
|
|
3552
|
-
s && Object.keys(s).length > 0 && Object.keys(
|
|
3550
|
+
const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = dr(e), [m, w] = x({}), [S, y] = x({}), [h, g] = x(0), [N, b] = x(!1);
|
|
3551
|
+
he.useEffect(() => {
|
|
3552
|
+
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && w(s);
|
|
3553
3553
|
}, [s]);
|
|
3554
|
-
const
|
|
3554
|
+
const p = Re(
|
|
3555
3555
|
() => n && n.length > 0 ? Rr(n) : [],
|
|
3556
3556
|
[n]
|
|
3557
|
-
), R = h ===
|
|
3558
|
-
|
|
3557
|
+
), R = h === p.length - 1, C = p[h] ?? [];
|
|
3558
|
+
he.useEffect(() => {
|
|
3559
3559
|
!l && n && n.length === 0 && !N && !o && (b(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
3560
3560
|
}, [l, n, N, o, u, e, t]);
|
|
3561
|
-
const
|
|
3562
|
-
w((
|
|
3563
|
-
const
|
|
3564
|
-
return delete
|
|
3561
|
+
const v = Q((A, F) => {
|
|
3562
|
+
w((Y) => ({ ...Y, [A]: F })), y((Y) => {
|
|
3563
|
+
const H = { ...Y };
|
|
3564
|
+
return delete H[A], H;
|
|
3565
3565
|
});
|
|
3566
|
-
}, []), q =
|
|
3567
|
-
const
|
|
3568
|
-
for (const { criterion: F } of
|
|
3569
|
-
const
|
|
3570
|
-
|
|
3566
|
+
}, []), q = Q(() => {
|
|
3567
|
+
const A = {};
|
|
3568
|
+
for (const { criterion: F } of C) {
|
|
3569
|
+
const Y = Er(F, m[F.id] ?? []);
|
|
3570
|
+
Y && (A[F.id] = Y);
|
|
3571
3571
|
}
|
|
3572
|
-
return y((F) => ({ ...F, ...
|
|
3573
|
-
}, [
|
|
3574
|
-
q() && g((
|
|
3572
|
+
return y((F) => ({ ...F, ...A })), Object.keys(A).length === 0;
|
|
3573
|
+
}, [C, m]), W = () => {
|
|
3574
|
+
q() && g((A) => A + 1);
|
|
3575
3575
|
}, T = () => {
|
|
3576
|
-
h > 0 ? g((
|
|
3576
|
+
h > 0 ? g((A) => A - 1) : r == null || r();
|
|
3577
3577
|
}, f = async () => {
|
|
3578
3578
|
if (!(!q() || !n))
|
|
3579
3579
|
try {
|
|
3580
|
-
const
|
|
3581
|
-
const
|
|
3582
|
-
return
|
|
3583
|
-
}).filter((
|
|
3584
|
-
await u({ applicantId: e, criteriaValueInputs:
|
|
3585
|
-
} catch (
|
|
3586
|
-
console.error("Risk scoring submit error:",
|
|
3580
|
+
const A = n.map((Y) => {
|
|
3581
|
+
const H = (m[Y.id] ?? []).filter((P) => P && P.trim());
|
|
3582
|
+
return H.length > 0 ? { riskCriteriaId: Y.id, values: H } : null;
|
|
3583
|
+
}).filter((Y) => Y !== null);
|
|
3584
|
+
await u({ applicantId: e, criteriaValueInputs: A }), t == null || t();
|
|
3585
|
+
} catch (A) {
|
|
3586
|
+
console.error("Risk scoring submit error:", A);
|
|
3587
3587
|
}
|
|
3588
3588
|
};
|
|
3589
|
-
return l ? /* @__PURE__ */ a(
|
|
3590
|
-
/* @__PURE__ */ a(
|
|
3589
|
+
return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
3590
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
3591
3591
|
/* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
3592
|
-
] }) }) : !l && n && n.length === 0 ? /* @__PURE__ */ a(
|
|
3593
|
-
/* @__PURE__ */ a(
|
|
3592
|
+
] }) }) : !l && n && n.length === 0 ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
3593
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
3594
3594
|
/* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
3595
|
-
] }) }) : c ? /* @__PURE__ */ a(
|
|
3595
|
+
] }) }) : c ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3596
3596
|
"Error loading criteria: ",
|
|
3597
3597
|
c.message
|
|
3598
|
-
] }) }) }) : n ? /* @__PURE__ */ i(
|
|
3598
|
+
] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
|
|
3599
3599
|
/* @__PURE__ */ i(oe, { children: [
|
|
3600
3600
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3601
3601
|
/* @__PURE__ */ a("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
3602
|
-
|
|
3602
|
+
p.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3603
3603
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3604
3604
|
"Page ",
|
|
3605
3605
|
h + 1,
|
|
3606
3606
|
" of ",
|
|
3607
|
-
|
|
3607
|
+
p.length
|
|
3608
3608
|
] }),
|
|
3609
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children:
|
|
3609
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: p.map((A, F) => /* @__PURE__ */ a(
|
|
3610
3610
|
"div",
|
|
3611
3611
|
{
|
|
3612
3612
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3620,17 +3620,17 @@ const Dr = ({
|
|
|
3620
3620
|
)) })
|
|
3621
3621
|
] })
|
|
3622
3622
|
] }),
|
|
3623
|
-
/* @__PURE__ */ a(
|
|
3623
|
+
/* @__PURE__ */ a(B, { className: "space-y-6", children: C.map(({ criterion: A }) => /* @__PURE__ */ a(
|
|
3624
3624
|
Pr,
|
|
3625
3625
|
{
|
|
3626
|
-
criterion:
|
|
3627
|
-
value:
|
|
3628
|
-
error: S[
|
|
3629
|
-
onChange: (F) =>
|
|
3626
|
+
criterion: A,
|
|
3627
|
+
value: m[A.id] ?? [],
|
|
3628
|
+
error: S[A.id],
|
|
3629
|
+
onChange: (F) => v(A.id, F)
|
|
3630
3630
|
},
|
|
3631
|
-
|
|
3631
|
+
A.id
|
|
3632
3632
|
)) }),
|
|
3633
|
-
/* @__PURE__ */ i(
|
|
3633
|
+
/* @__PURE__ */ i(ue, { className: "flex items-center justify-between", children: [
|
|
3634
3634
|
/* @__PURE__ */ i(
|
|
3635
3635
|
U,
|
|
3636
3636
|
{
|
|
@@ -3648,7 +3648,7 @@ const Dr = ({
|
|
|
3648
3648
|
U,
|
|
3649
3649
|
{
|
|
3650
3650
|
type: "button",
|
|
3651
|
-
onClick:
|
|
3651
|
+
onClick: W,
|
|
3652
3652
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3653
3653
|
children: [
|
|
3654
3654
|
"Next",
|
|
@@ -3660,7 +3660,7 @@ const Dr = ({
|
|
|
3660
3660
|
c && /* @__PURE__ */ a("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: c.message }) })
|
|
3661
3661
|
] }) : null;
|
|
3662
3662
|
}, Pr = ({ criterion: e, value: t, error: r, onChange: n }) => {
|
|
3663
|
-
const s = Fr(e), l = e.valueDataType ===
|
|
3663
|
+
const s = Fr(e), l = e.valueDataType === Se.Integer || e.valueDataType === Se.Decimal || e.valueDataType === Se.DigitOnly;
|
|
3664
3664
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
3665
3665
|
/* @__PURE__ */ i("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
3666
3666
|
e.displayName,
|
|
@@ -3669,7 +3669,7 @@ const Dr = ({
|
|
|
3669
3669
|
e.description && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.description }),
|
|
3670
3670
|
l && (e.min !== void 0 || e.max !== void 0) && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.min !== void 0 && e.max !== void 0 ? `Range: ${e.min} – ${e.max}` : e.min !== void 0 ? `Minimum: ${e.min}` : `Maximum: ${e.max}` }),
|
|
3671
3671
|
s === "text" && /* @__PURE__ */ a(
|
|
3672
|
-
|
|
3672
|
+
de,
|
|
3673
3673
|
{
|
|
3674
3674
|
value: t[0] ?? "",
|
|
3675
3675
|
onChange: (o) => n([o.target.value]),
|
|
@@ -3680,7 +3680,7 @@ const Dr = ({
|
|
|
3680
3680
|
min: e.min,
|
|
3681
3681
|
max: e.max,
|
|
3682
3682
|
onKeyDown: (o) => {
|
|
3683
|
-
e.valueDataType ===
|
|
3683
|
+
e.valueDataType === Se.DigitOnly && ["e", "E", "+", "-", "."].includes(o.key) && o.preventDefault();
|
|
3684
3684
|
}
|
|
3685
3685
|
}
|
|
3686
3686
|
),
|
|
@@ -3759,7 +3759,7 @@ const Dr = ({
|
|
|
3759
3759
|
r && /* @__PURE__ */ a("p", { className: "text-sm text-danger-500", children: r })
|
|
3760
3760
|
] }),
|
|
3761
3761
|
s === "country" && /* @__PURE__ */ a(
|
|
3762
|
-
|
|
3762
|
+
Ce,
|
|
3763
3763
|
{
|
|
3764
3764
|
value: t[0] ?? "",
|
|
3765
3765
|
onChange: (o) => n([o.target.value]),
|
|
@@ -3781,13 +3781,13 @@ const Dr = ({
|
|
|
3781
3781
|
onComplete: t,
|
|
3782
3782
|
onBack: r
|
|
3783
3783
|
}) => {
|
|
3784
|
-
const { investorCategorizationService: n } =
|
|
3784
|
+
const { investorCategorizationService: n } = pe(), [s, l] = x(null), [o, c] = x(!1), [u, m] = x(null);
|
|
3785
3785
|
return /* @__PURE__ */ a("form", { onSubmit: async (S) => {
|
|
3786
3786
|
if (S.preventDefault(), s === null) {
|
|
3787
|
-
|
|
3787
|
+
m("Please select an investor type");
|
|
3788
3788
|
return;
|
|
3789
3789
|
}
|
|
3790
|
-
c(!0),
|
|
3790
|
+
c(!0), m(null);
|
|
3791
3791
|
try {
|
|
3792
3792
|
const y = {
|
|
3793
3793
|
applicantId: e,
|
|
@@ -3797,23 +3797,23 @@ const Dr = ({
|
|
|
3797
3797
|
const h = await n.setInvestorCategorization(y);
|
|
3798
3798
|
console.log("Investor categorization result:", h), t == null || t();
|
|
3799
3799
|
} catch (y) {
|
|
3800
|
-
console.error("Error submitting investor categorization:", y),
|
|
3800
|
+
console.error("Error submitting investor categorization:", y), m(y.message || "Failed to submit investor categorization");
|
|
3801
3801
|
} finally {
|
|
3802
3802
|
c(!1);
|
|
3803
3803
|
}
|
|
3804
|
-
}, children: /* @__PURE__ */ i(
|
|
3804
|
+
}, children: /* @__PURE__ */ i($, { children: [
|
|
3805
3805
|
/* @__PURE__ */ i(oe, { children: [
|
|
3806
3806
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
|
|
3807
3807
|
/* @__PURE__ */ a("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" })
|
|
3808
3808
|
] }),
|
|
3809
|
-
/* @__PURE__ */ i(
|
|
3809
|
+
/* @__PURE__ */ i(B, { className: "space-y-4", children: [
|
|
3810
3810
|
/* @__PURE__ */ a("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
|
|
3811
3811
|
/* @__PURE__ */ a(
|
|
3812
3812
|
"label",
|
|
3813
3813
|
{
|
|
3814
3814
|
className: `
|
|
3815
3815
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3816
|
-
${s ===
|
|
3816
|
+
${s === me.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3817
3817
|
`,
|
|
3818
3818
|
children: /* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
3819
3819
|
/* @__PURE__ */ a(
|
|
@@ -3821,9 +3821,9 @@ const Dr = ({
|
|
|
3821
3821
|
{
|
|
3822
3822
|
type: "radio",
|
|
3823
3823
|
name: "investorType",
|
|
3824
|
-
value:
|
|
3825
|
-
checked: s ===
|
|
3826
|
-
onChange: () => l(
|
|
3824
|
+
value: me.Individual,
|
|
3825
|
+
checked: s === me.Individual,
|
|
3826
|
+
onChange: () => l(me.Individual),
|
|
3827
3827
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3828
3828
|
}
|
|
3829
3829
|
),
|
|
@@ -3839,7 +3839,7 @@ const Dr = ({
|
|
|
3839
3839
|
{
|
|
3840
3840
|
className: `
|
|
3841
3841
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3842
|
-
${s ===
|
|
3842
|
+
${s === me.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3843
3843
|
`,
|
|
3844
3844
|
children: /* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
3845
3845
|
/* @__PURE__ */ a(
|
|
@@ -3847,9 +3847,9 @@ const Dr = ({
|
|
|
3847
3847
|
{
|
|
3848
3848
|
type: "radio",
|
|
3849
3849
|
name: "investorType",
|
|
3850
|
-
value:
|
|
3851
|
-
checked: s ===
|
|
3852
|
-
onChange: () => l(
|
|
3850
|
+
value: me.Sophisticated,
|
|
3851
|
+
checked: s === me.Sophisticated,
|
|
3852
|
+
onChange: () => l(me.Sophisticated),
|
|
3853
3853
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3854
3854
|
}
|
|
3855
3855
|
),
|
|
@@ -3870,7 +3870,7 @@ const Dr = ({
|
|
|
3870
3870
|
{
|
|
3871
3871
|
className: `
|
|
3872
3872
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3873
|
-
${s ===
|
|
3873
|
+
${s === me.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3874
3874
|
`,
|
|
3875
3875
|
children: /* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
3876
3876
|
/* @__PURE__ */ a(
|
|
@@ -3878,9 +3878,9 @@ const Dr = ({
|
|
|
3878
3878
|
{
|
|
3879
3879
|
type: "radio",
|
|
3880
3880
|
name: "investorType",
|
|
3881
|
-
value:
|
|
3882
|
-
checked: s ===
|
|
3883
|
-
onChange: () => l(
|
|
3881
|
+
value: me.HighNetWorth,
|
|
3882
|
+
checked: s === me.HighNetWorth,
|
|
3883
|
+
onChange: () => l(me.HighNetWorth),
|
|
3884
3884
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3885
3885
|
}
|
|
3886
3886
|
),
|
|
@@ -3901,7 +3901,7 @@ const Dr = ({
|
|
|
3901
3901
|
u
|
|
3902
3902
|
] }) })
|
|
3903
3903
|
] }),
|
|
3904
|
-
/* @__PURE__ */ i(
|
|
3904
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
3905
3905
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3906
3906
|
/* @__PURE__ */ a(
|
|
3907
3907
|
U,
|
|
@@ -3919,14 +3919,14 @@ const Dr = ({
|
|
|
3919
3919
|
onComplete: t,
|
|
3920
3920
|
onBack: r
|
|
3921
3921
|
}) => {
|
|
3922
|
-
const { appropriatenessTestService: n } =
|
|
3922
|
+
const { appropriatenessTestService: n } = pe(), [s, l] = x(null), [o, c] = x(!0), [u, m] = x(!1), [w, S] = x(null), [y, h] = x({}), [g, N] = x(0), [b, p] = x(!1), [R, C] = x(!1), [v, q] = x(0);
|
|
3923
3923
|
ee(() => {
|
|
3924
3924
|
(async () => {
|
|
3925
3925
|
try {
|
|
3926
3926
|
c(!0), S(null), console.log("Loading appropriateness test for applicant:", e);
|
|
3927
3927
|
const E = await n.getAppropriatenessTest(e);
|
|
3928
3928
|
if (console.log("Appropriateness test data:", E), l(E), E.waitTimeSpanForNextTry && E.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3929
|
-
const G =
|
|
3929
|
+
const G = W(E.waitTimeSpanForNextTry);
|
|
3930
3930
|
G > 0 && q(G);
|
|
3931
3931
|
}
|
|
3932
3932
|
} catch (E) {
|
|
@@ -3936,11 +3936,11 @@ const Dr = ({
|
|
|
3936
3936
|
}
|
|
3937
3937
|
})();
|
|
3938
3938
|
}, [e, n]);
|
|
3939
|
-
const
|
|
3939
|
+
const W = (P) => {
|
|
3940
3940
|
const E = P.split(":").map(Number);
|
|
3941
3941
|
if (E.length === 3) {
|
|
3942
|
-
const [G,
|
|
3943
|
-
return G * 3600 +
|
|
3942
|
+
const [G, K, ne] = E;
|
|
3943
|
+
return G * 3600 + K * 60 + ne;
|
|
3944
3944
|
}
|
|
3945
3945
|
return 0;
|
|
3946
3946
|
}, T = (P) => {
|
|
@@ -3950,21 +3950,21 @@ const Dr = ({
|
|
|
3950
3950
|
ee(() => {
|
|
3951
3951
|
if (!b || g <= 0) return;
|
|
3952
3952
|
const P = setInterval(() => {
|
|
3953
|
-
N((E) => E <= 1 ? (
|
|
3953
|
+
N((E) => E <= 1 ? (C(!0), 0) : E - 1);
|
|
3954
3954
|
}, 1e3);
|
|
3955
3955
|
return () => clearInterval(P);
|
|
3956
3956
|
}, [b, g]), ee(() => {
|
|
3957
|
-
if (
|
|
3957
|
+
if (v <= 0) return;
|
|
3958
3958
|
const P = setInterval(() => {
|
|
3959
3959
|
q((E) => E <= 1 ? 0 : E - 1);
|
|
3960
3960
|
}, 1e3);
|
|
3961
3961
|
return () => clearInterval(P);
|
|
3962
|
-
}, [
|
|
3962
|
+
}, [v]), ee(() => {
|
|
3963
3963
|
R && !u && F();
|
|
3964
3964
|
}, [R]);
|
|
3965
3965
|
const f = () => {
|
|
3966
|
-
s && (
|
|
3967
|
-
},
|
|
3966
|
+
s && (p(!0), N(s.testDurationSec));
|
|
3967
|
+
}, A = (P, E) => {
|
|
3968
3968
|
h((G) => ({
|
|
3969
3969
|
...G,
|
|
3970
3970
|
[P]: E
|
|
@@ -3978,12 +3978,12 @@ const Dr = ({
|
|
|
3978
3978
|
return;
|
|
3979
3979
|
}
|
|
3980
3980
|
}
|
|
3981
|
-
|
|
3981
|
+
m(!0), S(null);
|
|
3982
3982
|
try {
|
|
3983
3983
|
const E = s.appropriatenessQuestions.map(
|
|
3984
|
-
(
|
|
3985
|
-
appropriatenessQuestionId:
|
|
3986
|
-
value: y[
|
|
3984
|
+
(K) => ({
|
|
3985
|
+
appropriatenessQuestionId: K.id,
|
|
3986
|
+
value: y[K.id] || ""
|
|
3987
3987
|
// Empty string if not answered
|
|
3988
3988
|
})
|
|
3989
3989
|
), G = {
|
|
@@ -3993,26 +3993,26 @@ const Dr = ({
|
|
|
3993
3993
|
};
|
|
3994
3994
|
console.log("Submitting appropriateness test:", G);
|
|
3995
3995
|
try {
|
|
3996
|
-
const
|
|
3997
|
-
console.log("Appropriateness test result:",
|
|
3998
|
-
} catch (
|
|
3999
|
-
if (
|
|
4000
|
-
const
|
|
4001
|
-
console.log("Test failed:",
|
|
3996
|
+
const K = await n.fillAppropriatenessTest(G);
|
|
3997
|
+
console.log("Appropriateness test result:", K), K.message && (K.message.toLowerCase().includes("pass") || K.message.toLowerCase().includes("success") || K.message.toLowerCase().includes("congratulations")) ? t == null || t() : (S(K.message || "Test completed. Please check the result."), p(!1), C(!1), h({}), setTimeout(() => Y(), 1e3));
|
|
3998
|
+
} catch (K) {
|
|
3999
|
+
if (K.code === 400 && K.message) {
|
|
4000
|
+
const ne = K.message;
|
|
4001
|
+
console.log("Test failed:", ne), S(ne), p(!1), C(!1), h({}), setTimeout(() => Y(), 1500);
|
|
4002
4002
|
} else
|
|
4003
|
-
throw
|
|
4003
|
+
throw K;
|
|
4004
4004
|
}
|
|
4005
4005
|
} catch (E) {
|
|
4006
|
-
console.error("Error submitting appropriateness test:", E), S(E.message || "Failed to submit test. Please try again."),
|
|
4006
|
+
console.error("Error submitting appropriateness test:", E), S(E.message || "Failed to submit test. Please try again."), p(!1), C(!1), h({});
|
|
4007
4007
|
} finally {
|
|
4008
|
-
|
|
4008
|
+
m(!1);
|
|
4009
4009
|
}
|
|
4010
4010
|
}
|
|
4011
|
-
},
|
|
4011
|
+
}, Y = async () => {
|
|
4012
4012
|
try {
|
|
4013
4013
|
const P = await n.getAppropriatenessTest(e);
|
|
4014
4014
|
if (console.log("Reloaded test data:", P), l(P), P.waitTimeSpanForNextTry && P.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4015
|
-
const E =
|
|
4015
|
+
const E = W(P.waitTimeSpanForNextTry);
|
|
4016
4016
|
E > 0 && q(E);
|
|
4017
4017
|
}
|
|
4018
4018
|
} catch (P) {
|
|
@@ -4022,31 +4022,31 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4022
4022
|
}
|
|
4023
4023
|
};
|
|
4024
4024
|
if (o)
|
|
4025
|
-
return /* @__PURE__ */ a(
|
|
4026
|
-
/* @__PURE__ */ a(
|
|
4025
|
+
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
4026
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
4027
4027
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
4028
4028
|
] }) });
|
|
4029
4029
|
if (!s)
|
|
4030
|
-
return /* @__PURE__ */ a(
|
|
4030
|
+
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
|
|
4031
4031
|
/* @__PURE__ */ a("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
4032
4032
|
w && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: w })
|
|
4033
4033
|
] }) });
|
|
4034
|
-
if (
|
|
4035
|
-
return /* @__PURE__ */ i(
|
|
4034
|
+
if (v > 0)
|
|
4035
|
+
return /* @__PURE__ */ i($, { children: [
|
|
4036
4036
|
/* @__PURE__ */ i(oe, { children: [
|
|
4037
4037
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4038
4038
|
s.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
4039
4039
|
] }),
|
|
4040
|
-
/* @__PURE__ */ i(
|
|
4040
|
+
/* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
|
|
4041
4041
|
/* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
4042
|
-
/* @__PURE__ */ a("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: T(
|
|
4042
|
+
/* @__PURE__ */ a("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: T(v) }),
|
|
4043
4043
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
4044
4044
|
] }),
|
|
4045
4045
|
w && /* @__PURE__ */ a("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__ */ a("p", { className: "text-red-600 dark:text-red-400 text-sm", children: w }) })
|
|
4046
4046
|
] })
|
|
4047
4047
|
] });
|
|
4048
|
-
const
|
|
4049
|
-
return b ? /* @__PURE__ */ a("form", { onSubmit: F, children: /* @__PURE__ */ i(
|
|
4048
|
+
const H = s.testAllowedMaxTry - s.totalFailedTries;
|
|
4049
|
+
return b ? /* @__PURE__ */ a("form", { onSubmit: F, children: /* @__PURE__ */ i($, { children: [
|
|
4050
4050
|
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4051
4051
|
/* @__PURE__ */ i("div", { children: [
|
|
4052
4052
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
@@ -4063,18 +4063,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4063
4063
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
4064
4064
|
] })
|
|
4065
4065
|
] }) }),
|
|
4066
|
-
/* @__PURE__ */ i(
|
|
4066
|
+
/* @__PURE__ */ i(B, { className: "space-y-6", children: [
|
|
4067
4067
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4068
|
-
/* @__PURE__ */ i(
|
|
4068
|
+
/* @__PURE__ */ i(Ne, { variant: "info", children: [
|
|
4069
4069
|
"Question ",
|
|
4070
4070
|
Object.keys(y).length,
|
|
4071
4071
|
" of ",
|
|
4072
4072
|
s.totalQuestionCount
|
|
4073
4073
|
] }),
|
|
4074
|
-
/* @__PURE__ */ i(
|
|
4075
|
-
|
|
4074
|
+
/* @__PURE__ */ i(Ne, { variant: H > 1 ? "success" : "warning", children: [
|
|
4075
|
+
H,
|
|
4076
4076
|
" attempt",
|
|
4077
|
-
|
|
4077
|
+
H !== 1 ? "s" : "",
|
|
4078
4078
|
" remaining"
|
|
4079
4079
|
] })
|
|
4080
4080
|
] }),
|
|
@@ -4091,7 +4091,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4091
4091
|
P.groupName && /* @__PURE__ */ a("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: P.groupName }),
|
|
4092
4092
|
/* @__PURE__ */ a("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: P.question })
|
|
4093
4093
|
] }),
|
|
4094
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: P.answers.map((G,
|
|
4094
|
+
/* @__PURE__ */ a("div", { className: "space-y-2", children: P.answers.map((G, K) => /* @__PURE__ */ i(
|
|
4095
4095
|
"label",
|
|
4096
4096
|
{
|
|
4097
4097
|
className: `
|
|
@@ -4106,7 +4106,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4106
4106
|
name: `question-${P.id}`,
|
|
4107
4107
|
value: G,
|
|
4108
4108
|
checked: y[P.id] === G,
|
|
4109
|
-
onChange: (
|
|
4109
|
+
onChange: (ne) => A(P.id, ne.target.value),
|
|
4110
4110
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4111
4111
|
disabled: u
|
|
4112
4112
|
}
|
|
@@ -4114,7 +4114,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4114
4114
|
/* @__PURE__ */ a("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: G })
|
|
4115
4115
|
]
|
|
4116
4116
|
},
|
|
4117
|
-
|
|
4117
|
+
K
|
|
4118
4118
|
)) })
|
|
4119
4119
|
]
|
|
4120
4120
|
},
|
|
@@ -4130,7 +4130,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4130
4130
|
" Your answers are being submitted automatically."
|
|
4131
4131
|
] }) })
|
|
4132
4132
|
] }),
|
|
4133
|
-
/* @__PURE__ */ i(
|
|
4133
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
4134
4134
|
/* @__PURE__ */ a(
|
|
4135
4135
|
U,
|
|
4136
4136
|
{
|
|
@@ -4151,29 +4151,29 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4151
4151
|
}
|
|
4152
4152
|
)
|
|
4153
4153
|
] })
|
|
4154
|
-
] }) }) : /* @__PURE__ */ i(
|
|
4154
|
+
] }) }) : /* @__PURE__ */ i($, { children: [
|
|
4155
4155
|
/* @__PURE__ */ i(oe, { children: [
|
|
4156
4156
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4157
4157
|
s.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
4158
4158
|
] }),
|
|
4159
|
-
/* @__PURE__ */ i(
|
|
4159
|
+
/* @__PURE__ */ i(B, { children: [
|
|
4160
4160
|
s.description && /* @__PURE__ */ a("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ a("p", { className: "text-gray-700 dark:text-gray-300", children: s.description }) }),
|
|
4161
4161
|
/* @__PURE__ */ i("div", { className: "space-y-4 mb-6", children: [
|
|
4162
4162
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4163
4163
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
|
|
4164
|
-
/* @__PURE__ */ a(
|
|
4164
|
+
/* @__PURE__ */ a(Ne, { variant: "info", children: s.totalQuestionCount })
|
|
4165
4165
|
] }),
|
|
4166
4166
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4167
4167
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4168
|
-
/* @__PURE__ */ a(
|
|
4168
|
+
/* @__PURE__ */ a(Ne, { variant: "info", children: T(s.testDurationSec) })
|
|
4169
4169
|
] }),
|
|
4170
4170
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4171
4171
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
4172
|
-
/* @__PURE__ */ a(
|
|
4172
|
+
/* @__PURE__ */ a(Ne, { variant: "info", children: s.testCorrectAnswerPassLimit })
|
|
4173
4173
|
] }),
|
|
4174
4174
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4175
4175
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4176
|
-
/* @__PURE__ */ a(
|
|
4176
|
+
/* @__PURE__ */ a(Ne, { variant: H > 1 ? "success" : "warning", children: H })
|
|
4177
4177
|
] })
|
|
4178
4178
|
] }),
|
|
4179
4179
|
w && /* @__PURE__ */ a("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: [
|
|
@@ -4181,16 +4181,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4181
4181
|
" ",
|
|
4182
4182
|
w
|
|
4183
4183
|
] }) }),
|
|
4184
|
-
|
|
4184
|
+
H <= 0 && /* @__PURE__ */ a("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ a("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
4185
4185
|
] }),
|
|
4186
|
-
/* @__PURE__ */ i(
|
|
4186
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
4187
4187
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4188
4188
|
/* @__PURE__ */ a(
|
|
4189
4189
|
U,
|
|
4190
4190
|
{
|
|
4191
4191
|
type: "button",
|
|
4192
4192
|
onClick: f,
|
|
4193
|
-
disabled:
|
|
4193
|
+
disabled: H <= 0,
|
|
4194
4194
|
children: "Start Test"
|
|
4195
4195
|
}
|
|
4196
4196
|
)
|
|
@@ -4201,8 +4201,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4201
4201
|
onComplete: t,
|
|
4202
4202
|
onBack: r
|
|
4203
4203
|
}) => {
|
|
4204
|
-
var G,
|
|
4205
|
-
const { applicantService: n, baseInformationService: s, config: l } =
|
|
4204
|
+
var G, K, ne, ve;
|
|
4205
|
+
const { applicantService: n, baseInformationService: s, config: l } = pe(), { identityData: o, provider: c, token: u, isLoading: m, error: w, requestIdentity: S, restartIdentity: y } = cr(e), [h, g] = x(null), [N, b] = x(null), [p, R] = x([]), [C, v] = x(!0), [q, W] = x(!1), [T, f] = x(null), [A, F] = x(!1), Y = he.useRef(!1), H = pt({
|
|
4206
4206
|
defaultValues: {
|
|
4207
4207
|
street: "",
|
|
4208
4208
|
streetNumber: "",
|
|
@@ -4216,54 +4216,54 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4216
4216
|
ee(() => {
|
|
4217
4217
|
(async () => {
|
|
4218
4218
|
try {
|
|
4219
|
-
const [
|
|
4219
|
+
const [L, te] = await Promise.all([
|
|
4220
4220
|
n.getApplicantData(e),
|
|
4221
4221
|
s.getCountries("", "en")
|
|
4222
4222
|
]);
|
|
4223
|
-
b(
|
|
4224
|
-
const Z = /* @__PURE__ */ new Set(),
|
|
4225
|
-
const Le =
|
|
4223
|
+
b(L);
|
|
4224
|
+
const Z = /* @__PURE__ */ new Set(), re = te.filter((xe) => {
|
|
4225
|
+
const Le = xe.abbreviation3 || xe.abbreviation;
|
|
4226
4226
|
return !Le || Z.has(Le) ? !1 : (Z.add(Le), !0);
|
|
4227
4227
|
});
|
|
4228
|
-
R(
|
|
4229
|
-
const
|
|
4230
|
-
if (
|
|
4231
|
-
street: (
|
|
4232
|
-
streetNumber: (
|
|
4233
|
-
city: (
|
|
4234
|
-
zip: (
|
|
4235
|
-
country: (
|
|
4236
|
-
nationality: (
|
|
4237
|
-
phonenumber: (
|
|
4238
|
-
}),
|
|
4239
|
-
console.log("[Identity] Found existing identity verification, auto-requesting..."),
|
|
4228
|
+
R(re);
|
|
4229
|
+
const j = L.applicantRequestData;
|
|
4230
|
+
if (H.reset({
|
|
4231
|
+
street: (j == null ? void 0 : j.street) || "",
|
|
4232
|
+
streetNumber: (j == null ? void 0 : j.streetNumber) || "",
|
|
4233
|
+
city: (j == null ? void 0 : j.city) || "",
|
|
4234
|
+
zip: (j == null ? void 0 : j.zip) || "",
|
|
4235
|
+
country: (j == null ? void 0 : j.country) || "",
|
|
4236
|
+
nationality: (j == null ? void 0 : j.nationality) || "",
|
|
4237
|
+
phonenumber: (j == null ? void 0 : j.phonenumber) || ""
|
|
4238
|
+
}), L.kycRecords && L.kycRecords.length > 0 && L.kycRecords[0].providerTokenObject !== null && !Y.current) {
|
|
4239
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), Y.current = !0;
|
|
4240
4240
|
try {
|
|
4241
|
-
await S(),
|
|
4242
|
-
} catch (
|
|
4243
|
-
console.error("[Identity] Auto-request failed:",
|
|
4241
|
+
await S(), W(!0);
|
|
4242
|
+
} catch (xe) {
|
|
4243
|
+
console.error("[Identity] Auto-request failed:", xe);
|
|
4244
4244
|
}
|
|
4245
4245
|
}
|
|
4246
|
-
} catch (
|
|
4247
|
-
console.error("Error loading applicant data:",
|
|
4246
|
+
} catch (L) {
|
|
4247
|
+
console.error("Error loading applicant data:", L);
|
|
4248
4248
|
} finally {
|
|
4249
|
-
|
|
4249
|
+
v(!1);
|
|
4250
4250
|
}
|
|
4251
4251
|
})();
|
|
4252
4252
|
}, [e]), ee(() => {
|
|
4253
|
-
o && !q && (console.log("[Identity] Identity data already loaded, showing provider"),
|
|
4253
|
+
o && !q && (console.log("[Identity] Identity data already loaded, showing provider"), W(!0));
|
|
4254
4254
|
}, [o, q]), ee(() => {
|
|
4255
4255
|
if (u) {
|
|
4256
4256
|
if (u.expiresAt) {
|
|
4257
|
-
const
|
|
4258
|
-
if (Date.now() >=
|
|
4257
|
+
const O = new Date(u.expiresAt).getTime();
|
|
4258
|
+
if (Date.now() >= O) {
|
|
4259
4259
|
console.warn("[Identity] Token has expired (expiresAt)"), F(!0), f("Your verification session has expired. Please restart.");
|
|
4260
4260
|
return;
|
|
4261
4261
|
}
|
|
4262
4262
|
}
|
|
4263
4263
|
if (u.url)
|
|
4264
4264
|
try {
|
|
4265
|
-
const
|
|
4266
|
-
if (
|
|
4265
|
+
const L = new URL(u.url).toString().toLowerCase();
|
|
4266
|
+
if (L.includes("expired") || L.includes("invalid") || L.includes("error")) {
|
|
4267
4267
|
console.warn("[Identity] Token URL indicates expiration"), F(!0), f("Your verification link has expired. Please restart.");
|
|
4268
4268
|
return;
|
|
4269
4269
|
}
|
|
@@ -4276,100 +4276,100 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4276
4276
|
}
|
|
4277
4277
|
}
|
|
4278
4278
|
}, [u]), ee(() => {
|
|
4279
|
-
if (c !== null && u && !h && q && !
|
|
4280
|
-
const
|
|
4279
|
+
if (c !== null && u && !h && q && !A) {
|
|
4280
|
+
const O = c;
|
|
4281
4281
|
if (u.url) {
|
|
4282
4282
|
console.log("[Identity] Loading provider URL for user verification:", u.url), f(null);
|
|
4283
4283
|
try {
|
|
4284
|
-
if (new URL(u.url),
|
|
4284
|
+
if (new URL(u.url), O === ge.SardinAI) {
|
|
4285
4285
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4286
4286
|
try {
|
|
4287
|
-
const
|
|
4288
|
-
De.createProvider(c,
|
|
4287
|
+
const L = De.parseProviderConfig(c, u, l);
|
|
4288
|
+
De.createProvider(c, L).initialize().then(() => {
|
|
4289
4289
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4290
4290
|
}).catch((Z) => {
|
|
4291
4291
|
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", Z);
|
|
4292
4292
|
});
|
|
4293
|
-
} catch (
|
|
4294
|
-
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):",
|
|
4293
|
+
} catch (L) {
|
|
4294
|
+
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", L);
|
|
4295
4295
|
}
|
|
4296
4296
|
}
|
|
4297
4297
|
g({ type: "url", url: u.url });
|
|
4298
|
-
} catch (
|
|
4299
|
-
console.error("[Identity] Invalid URL:",
|
|
4298
|
+
} catch (L) {
|
|
4299
|
+
console.error("[Identity] Invalid URL:", L), f("Invalid verification URL. Please restart."), F(!0);
|
|
4300
4300
|
}
|
|
4301
4301
|
return;
|
|
4302
4302
|
}
|
|
4303
|
-
if (
|
|
4303
|
+
if (O === ge.SardinAI) {
|
|
4304
4304
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), f(null);
|
|
4305
4305
|
try {
|
|
4306
|
-
const
|
|
4306
|
+
const L = De.parseProviderConfig(c, u, l), te = De.createProvider(c, L);
|
|
4307
4307
|
te.initialize().then(() => {
|
|
4308
4308
|
console.log("[SardinAI] Risk SDK initialized successfully"), g(te), setTimeout(() => {
|
|
4309
4309
|
t == null || t();
|
|
4310
4310
|
}, 2e3);
|
|
4311
4311
|
}).catch((Z) => {
|
|
4312
|
-
var
|
|
4312
|
+
var j;
|
|
4313
4313
|
console.error("[SardinAI] Failed to initialize:", Z);
|
|
4314
|
-
const
|
|
4315
|
-
|
|
4314
|
+
const re = ((j = Z.message) == null ? void 0 : j.toLowerCase()) || "";
|
|
4315
|
+
re.includes("expired") || re.includes("invalid") || re.includes("401") || re.includes("400") ? (F(!0), f("Session expired or invalid. Please restart verification.")) : f(`Failed to initialize: ${Z.message}`);
|
|
4316
4316
|
});
|
|
4317
|
-
} catch (
|
|
4318
|
-
console.error("[SardinAI] Error creating provider:",
|
|
4317
|
+
} catch (L) {
|
|
4318
|
+
console.error("[SardinAI] Error creating provider:", L), f(`Configuration error: ${L.message}`);
|
|
4319
4319
|
}
|
|
4320
4320
|
return;
|
|
4321
4321
|
}
|
|
4322
4322
|
try {
|
|
4323
4323
|
f(null);
|
|
4324
|
-
const
|
|
4325
|
-
|
|
4326
|
-
var
|
|
4327
|
-
console.error("[Sumsub] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`), (
|
|
4324
|
+
const L = De.parseProviderConfig(c, u, l), te = De.createProvider(c, L);
|
|
4325
|
+
O === ge.Sumsub ? (te.initialize("identity-container").catch((Z) => {
|
|
4326
|
+
var re;
|
|
4327
|
+
console.error("[Sumsub] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`), (re = Z.message) != null && re.toLowerCase().includes("expired") && F(!0);
|
|
4328
4328
|
}), te.onComplete && te.onComplete(() => {
|
|
4329
4329
|
t == null || t();
|
|
4330
|
-
})) :
|
|
4330
|
+
})) : O === ge.Onfido && te.initialize("identity-container").catch((Z) => {
|
|
4331
4331
|
console.error("[Onfido] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`);
|
|
4332
4332
|
}), g(te);
|
|
4333
|
-
} catch (
|
|
4334
|
-
console.error("[Identity] Provider setup error:",
|
|
4333
|
+
} catch (L) {
|
|
4334
|
+
console.error("[Identity] Provider setup error:", L), f(`Setup error: ${L.message}`);
|
|
4335
4335
|
}
|
|
4336
4336
|
}
|
|
4337
4337
|
return () => {
|
|
4338
4338
|
if (h && h.destroy)
|
|
4339
4339
|
try {
|
|
4340
4340
|
h.destroy();
|
|
4341
|
-
} catch (
|
|
4342
|
-
console.error("[Identity] Error destroying provider:",
|
|
4341
|
+
} catch (O) {
|
|
4342
|
+
console.error("[Identity] Error destroying provider:", O);
|
|
4343
4343
|
}
|
|
4344
4344
|
};
|
|
4345
|
-
}, [c, u, h, q, t,
|
|
4345
|
+
}, [c, u, h, q, t, A]);
|
|
4346
4346
|
const P = async () => {
|
|
4347
4347
|
try {
|
|
4348
|
-
f(null), F(!1), await S(),
|
|
4349
|
-
} catch (
|
|
4350
|
-
console.error("Error starting identity verification:",
|
|
4348
|
+
f(null), F(!1), await S(), W(!0);
|
|
4349
|
+
} catch (O) {
|
|
4350
|
+
console.error("Error starting identity verification:", O);
|
|
4351
4351
|
}
|
|
4352
4352
|
}, E = async () => {
|
|
4353
4353
|
try {
|
|
4354
|
-
f(null), F(!1), g(null), console.log("[Identity] Restarting verification..."), await y(),
|
|
4355
|
-
} catch (
|
|
4356
|
-
console.error("Error restarting identity verification:",
|
|
4354
|
+
f(null), F(!1), g(null), console.log("[Identity] Restarting verification..."), await y(), W(!0);
|
|
4355
|
+
} catch (O) {
|
|
4356
|
+
console.error("Error restarting identity verification:", O), f(O.message || "Failed to restart verification");
|
|
4357
4357
|
}
|
|
4358
4358
|
};
|
|
4359
|
-
if (
|
|
4360
|
-
return /* @__PURE__ */ a(
|
|
4361
|
-
/* @__PURE__ */ a(
|
|
4359
|
+
if (C || m)
|
|
4360
|
+
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
4361
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
4362
4362
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4363
4363
|
] }) });
|
|
4364
4364
|
if (w)
|
|
4365
|
-
return /* @__PURE__ */ a(
|
|
4365
|
+
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
4366
4366
|
"Error: ",
|
|
4367
4367
|
w.message
|
|
4368
4368
|
] }) }) });
|
|
4369
|
-
if (q && (T ||
|
|
4370
|
-
return /* @__PURE__ */ i(
|
|
4369
|
+
if (q && (T || A))
|
|
4370
|
+
return /* @__PURE__ */ i($, { children: [
|
|
4371
4371
|
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4372
|
-
/* @__PURE__ */ i(
|
|
4372
|
+
/* @__PURE__ */ i(B, { children: [
|
|
4373
4373
|
/* @__PURE__ */ a("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: [
|
|
4374
4374
|
/* @__PURE__ */ a(
|
|
4375
4375
|
"svg",
|
|
@@ -4390,7 +4390,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4390
4390
|
}
|
|
4391
4391
|
),
|
|
4392
4392
|
/* @__PURE__ */ i("div", { children: [
|
|
4393
|
-
/* @__PURE__ */ a("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children:
|
|
4393
|
+
/* @__PURE__ */ a("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: A ? "Session Expired" : "Verification Error" }),
|
|
4394
4394
|
/* @__PURE__ */ a("p", { className: "text-red-800 dark:text-red-200 text-sm", children: T || "Your verification session has expired and needs to be restarted." })
|
|
4395
4395
|
] })
|
|
4396
4396
|
] }) }),
|
|
@@ -4403,14 +4403,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4403
4403
|
] })
|
|
4404
4404
|
] })
|
|
4405
4405
|
] }),
|
|
4406
|
-
/* @__PURE__ */ i(
|
|
4406
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
4407
4407
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4408
|
-
/* @__PURE__ */ a(U, { type: "button", onClick: E, disabled:
|
|
4408
|
+
/* @__PURE__ */ a(U, { type: "button", onClick: E, disabled: m, children: m ? "Restarting..." : "Restart Verification" })
|
|
4409
4409
|
] })
|
|
4410
4410
|
] });
|
|
4411
4411
|
if (q && o) {
|
|
4412
|
-
const
|
|
4413
|
-
return u != null && u.url ? /* @__PURE__ */ i(
|
|
4412
|
+
const O = c;
|
|
4413
|
+
return u != null && u.url ? /* @__PURE__ */ i($, { children: [
|
|
4414
4414
|
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4415
4415
|
/* @__PURE__ */ i("div", { children: [
|
|
4416
4416
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
@@ -4423,12 +4423,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4423
4423
|
variant: "outline",
|
|
4424
4424
|
size: "sm",
|
|
4425
4425
|
onClick: E,
|
|
4426
|
-
disabled:
|
|
4426
|
+
disabled: m,
|
|
4427
4427
|
children: "Restart"
|
|
4428
4428
|
}
|
|
4429
4429
|
)
|
|
4430
4430
|
] }) }),
|
|
4431
|
-
/* @__PURE__ */ i(
|
|
4431
|
+
/* @__PURE__ */ i(B, { children: [
|
|
4432
4432
|
/* @__PURE__ */ a("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: [
|
|
4433
4433
|
/* @__PURE__ */ a("strong", { children: "Important:" }),
|
|
4434
4434
|
' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
|
|
@@ -4440,14 +4440,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4440
4440
|
className: "w-full h-full border-0 rounded-lg",
|
|
4441
4441
|
allow: "camera; microphone; geolocation",
|
|
4442
4442
|
title: "Identity Verification",
|
|
4443
|
-
onLoad: (
|
|
4444
|
-
var te, Z,
|
|
4443
|
+
onLoad: (L) => {
|
|
4444
|
+
var te, Z, re;
|
|
4445
4445
|
console.log("[Identity] Iframe loaded");
|
|
4446
4446
|
try {
|
|
4447
|
-
const
|
|
4447
|
+
const j = L.target, Fe = j.contentDocument || ((te = j.contentWindow) == null ? void 0 : te.document);
|
|
4448
4448
|
if (Fe) {
|
|
4449
|
-
const
|
|
4450
|
-
(
|
|
4449
|
+
const xe = ((re = (Z = Fe.body) == null ? void 0 : Z.textContent) == null ? void 0 : re.toLowerCase()) || "";
|
|
4450
|
+
(xe.includes("expired") || xe.includes("invalid") || xe.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), F(!0), f("Your verification link has expired."));
|
|
4451
4451
|
}
|
|
4452
4452
|
} catch {
|
|
4453
4453
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4456,68 +4456,68 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4456
4456
|
}
|
|
4457
4457
|
) })
|
|
4458
4458
|
] }),
|
|
4459
|
-
r && /* @__PURE__ */ a(
|
|
4460
|
-
] }) :
|
|
4459
|
+
r && /* @__PURE__ */ a(ue, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4460
|
+
] }) : O === ge.SardinAI ? /* @__PURE__ */ i($, { children: [
|
|
4461
4461
|
/* @__PURE__ */ i(oe, { children: [
|
|
4462
4462
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4463
4463
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4464
4464
|
] }),
|
|
4465
|
-
/* @__PURE__ */ a(
|
|
4466
|
-
/* @__PURE__ */ a(
|
|
4465
|
+
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("div", { className: "text-center py-12", children: [
|
|
4466
|
+
/* @__PURE__ */ a(fe, { className: "mb-4" }),
|
|
4467
4467
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4468
4468
|
/* @__PURE__ */ a("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" })
|
|
4469
4469
|
] }) })
|
|
4470
|
-
] }) : /* @__PURE__ */ i(
|
|
4470
|
+
] }) : /* @__PURE__ */ i($, { children: [
|
|
4471
4471
|
/* @__PURE__ */ i(oe, { children: [
|
|
4472
4472
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4473
4473
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4474
4474
|
] }),
|
|
4475
|
-
/* @__PURE__ */ a(
|
|
4476
|
-
r && /* @__PURE__ */ a(
|
|
4475
|
+
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4476
|
+
r && /* @__PURE__ */ a(ue, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4477
4477
|
] });
|
|
4478
4478
|
}
|
|
4479
|
-
return /* @__PURE__ */ a("form", { onSubmit:
|
|
4479
|
+
return /* @__PURE__ */ a("form", { onSubmit: H.handleSubmit(P), children: /* @__PURE__ */ i($, { children: [
|
|
4480
4480
|
/* @__PURE__ */ i(oe, { children: [
|
|
4481
4481
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Review Your Information" }),
|
|
4482
4482
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
4483
4483
|
] }),
|
|
4484
|
-
/* @__PURE__ */ i(
|
|
4484
|
+
/* @__PURE__ */ i(B, { className: "space-y-6", children: [
|
|
4485
4485
|
/* @__PURE__ */ i("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
|
|
4486
4486
|
/* @__PURE__ */ i("div", { children: [
|
|
4487
4487
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4488
4488
|
/* @__PURE__ */ i("p", { className: "mt-1 text-base", children: [
|
|
4489
4489
|
(G = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : G.firstName,
|
|
4490
4490
|
" ",
|
|
4491
|
-
(
|
|
4491
|
+
(K = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : K.lastName
|
|
4492
4492
|
] })
|
|
4493
4493
|
] }),
|
|
4494
4494
|
/* @__PURE__ */ i("div", { children: [
|
|
4495
4495
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4496
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: (
|
|
4496
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: (ne = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : ne.email })
|
|
4497
4497
|
] }),
|
|
4498
4498
|
/* @__PURE__ */ i("div", { children: [
|
|
4499
4499
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4500
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: ((
|
|
4500
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: ((ve = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : ve.dateOfBirth) || "Not provided" })
|
|
4501
4501
|
] })
|
|
4502
4502
|
] }),
|
|
4503
4503
|
/* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
4504
4504
|
/* @__PURE__ */ a("h3", { className: "text-lg font-semibold", children: "Address Information" }),
|
|
4505
4505
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4506
4506
|
/* @__PURE__ */ a(
|
|
4507
|
-
|
|
4507
|
+
Ae,
|
|
4508
4508
|
{
|
|
4509
|
-
control:
|
|
4509
|
+
control: H.control,
|
|
4510
4510
|
name: "country",
|
|
4511
|
-
render: ({ field:
|
|
4512
|
-
|
|
4511
|
+
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4512
|
+
Ce,
|
|
4513
4513
|
{
|
|
4514
|
-
|
|
4514
|
+
...O,
|
|
4515
4515
|
label: "Country",
|
|
4516
4516
|
options: [
|
|
4517
4517
|
{ value: "", label: "Select country..." },
|
|
4518
|
-
...
|
|
4519
|
-
value:
|
|
4520
|
-
label:
|
|
4518
|
+
...p.map((L) => ({
|
|
4519
|
+
value: L.abbreviation3 || L.abbreviation,
|
|
4520
|
+
label: L.name
|
|
4521
4521
|
}))
|
|
4522
4522
|
]
|
|
4523
4523
|
}
|
|
@@ -4525,20 +4525,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4525
4525
|
}
|
|
4526
4526
|
),
|
|
4527
4527
|
/* @__PURE__ */ a(
|
|
4528
|
-
|
|
4528
|
+
Ae,
|
|
4529
4529
|
{
|
|
4530
|
-
control:
|
|
4530
|
+
control: H.control,
|
|
4531
4531
|
name: "nationality",
|
|
4532
|
-
render: ({ field:
|
|
4533
|
-
|
|
4532
|
+
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4533
|
+
Ce,
|
|
4534
4534
|
{
|
|
4535
|
-
|
|
4535
|
+
...O,
|
|
4536
4536
|
label: "Nationality",
|
|
4537
4537
|
options: [
|
|
4538
4538
|
{ value: "", label: "Select nationality..." },
|
|
4539
|
-
...
|
|
4540
|
-
value:
|
|
4541
|
-
label:
|
|
4539
|
+
...p.map((L) => ({
|
|
4540
|
+
value: L.abbreviation3 || L.abbreviation,
|
|
4541
|
+
label: L.name
|
|
4542
4542
|
}))
|
|
4543
4543
|
]
|
|
4544
4544
|
}
|
|
@@ -4548,53 +4548,53 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4548
4548
|
] }),
|
|
4549
4549
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4550
4550
|
/* @__PURE__ */ a(
|
|
4551
|
-
|
|
4551
|
+
Ae,
|
|
4552
4552
|
{
|
|
4553
|
-
control:
|
|
4553
|
+
control: H.control,
|
|
4554
4554
|
name: "street",
|
|
4555
|
-
render: ({ field:
|
|
4555
|
+
render: ({ field: O }) => /* @__PURE__ */ a(de, { ...O, label: "Street" })
|
|
4556
4556
|
}
|
|
4557
4557
|
),
|
|
4558
4558
|
/* @__PURE__ */ a(
|
|
4559
|
-
|
|
4559
|
+
Ae,
|
|
4560
4560
|
{
|
|
4561
|
-
control:
|
|
4561
|
+
control: H.control,
|
|
4562
4562
|
name: "streetNumber",
|
|
4563
|
-
render: ({ field:
|
|
4563
|
+
render: ({ field: O }) => /* @__PURE__ */ a(de, { ...O, label: "Street Number" })
|
|
4564
4564
|
}
|
|
4565
4565
|
)
|
|
4566
4566
|
] }),
|
|
4567
4567
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4568
4568
|
/* @__PURE__ */ a(
|
|
4569
|
-
|
|
4569
|
+
Ae,
|
|
4570
4570
|
{
|
|
4571
|
-
control:
|
|
4571
|
+
control: H.control,
|
|
4572
4572
|
name: "city",
|
|
4573
|
-
render: ({ field:
|
|
4573
|
+
render: ({ field: O }) => /* @__PURE__ */ a(de, { ...O, label: "City" })
|
|
4574
4574
|
}
|
|
4575
4575
|
),
|
|
4576
4576
|
/* @__PURE__ */ a(
|
|
4577
|
-
|
|
4577
|
+
Ae,
|
|
4578
4578
|
{
|
|
4579
|
-
control:
|
|
4579
|
+
control: H.control,
|
|
4580
4580
|
name: "zip",
|
|
4581
|
-
render: ({ field:
|
|
4581
|
+
render: ({ field: O }) => /* @__PURE__ */ a(de, { ...O, label: "ZIP/Postal Code" })
|
|
4582
4582
|
}
|
|
4583
4583
|
)
|
|
4584
4584
|
] }),
|
|
4585
4585
|
/* @__PURE__ */ a(
|
|
4586
|
-
|
|
4586
|
+
Ae,
|
|
4587
4587
|
{
|
|
4588
|
-
control:
|
|
4588
|
+
control: H.control,
|
|
4589
4589
|
name: "phonenumber",
|
|
4590
|
-
render: ({ field:
|
|
4590
|
+
render: ({ field: O }) => /* @__PURE__ */ a(de, { ...O, label: "Phone Number", type: "tel" })
|
|
4591
4591
|
}
|
|
4592
4592
|
)
|
|
4593
4593
|
] })
|
|
4594
4594
|
] }),
|
|
4595
|
-
/* @__PURE__ */ i(
|
|
4595
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
4596
4596
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4597
|
-
/* @__PURE__ */ a(U, { type: "submit", isLoading:
|
|
4597
|
+
/* @__PURE__ */ a(U, { type: "submit", isLoading: m, children: "Confirm and Start Verification" })
|
|
4598
4598
|
] })
|
|
4599
4599
|
] }) });
|
|
4600
4600
|
}, et = ({
|
|
@@ -4605,63 +4605,63 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4605
4605
|
onContinue: s,
|
|
4606
4606
|
onContactSupport: l
|
|
4607
4607
|
}) => {
|
|
4608
|
-
const c = e ===
|
|
4608
|
+
const c = e === Ie.Approved ? {
|
|
4609
4609
|
type: "success",
|
|
4610
4610
|
title: "Verification Approved",
|
|
4611
4611
|
icon: "✓",
|
|
4612
4612
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4613
4613
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4614
4614
|
message: "Your identity verification has been successfully approved."
|
|
4615
|
-
} : e ===
|
|
4615
|
+
} : e === Ie.Rejected ? {
|
|
4616
4616
|
type: "error",
|
|
4617
4617
|
title: "Verification Rejected",
|
|
4618
4618
|
icon: "✕",
|
|
4619
4619
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4620
4620
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4621
4621
|
message: "Unfortunately, your identity verification was not approved."
|
|
4622
|
-
} : e ===
|
|
4622
|
+
} : e === Ie.Pending || e === Ie.InProgress ? {
|
|
4623
4623
|
type: "pending",
|
|
4624
4624
|
title: "Verification Pending",
|
|
4625
4625
|
icon: "⏱",
|
|
4626
4626
|
iconBg: "bg-blue-100 dark:bg-blue-900/30",
|
|
4627
4627
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4628
4628
|
message: "Your identity verification is currently being processed."
|
|
4629
|
-
} : t ===
|
|
4629
|
+
} : t === Ee.Approved ? {
|
|
4630
4630
|
type: "success",
|
|
4631
4631
|
title: "Application Approved",
|
|
4632
4632
|
icon: "✓",
|
|
4633
4633
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4634
4634
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4635
4635
|
message: "Your application has been approved."
|
|
4636
|
-
} : t ===
|
|
4636
|
+
} : t === Ee.Reject ? {
|
|
4637
4637
|
type: "error",
|
|
4638
4638
|
title: "Application Rejected",
|
|
4639
4639
|
icon: "✕",
|
|
4640
4640
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4641
4641
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4642
4642
|
message: "Your application has been rejected."
|
|
4643
|
-
} : t ===
|
|
4643
|
+
} : t === Ee.UnderReview || t === Ee.AdminReview ? {
|
|
4644
4644
|
type: "pending",
|
|
4645
4645
|
title: "Under Review",
|
|
4646
4646
|
icon: "📋",
|
|
4647
4647
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
4648
4648
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
4649
4649
|
message: "Your application is currently under manual review."
|
|
4650
|
-
} : r ===
|
|
4650
|
+
} : r === ze.Success ? {
|
|
4651
4651
|
type: "success",
|
|
4652
4652
|
title: "Process Complete",
|
|
4653
4653
|
icon: "✓",
|
|
4654
4654
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4655
4655
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4656
4656
|
message: "Your verification process has been completed successfully."
|
|
4657
|
-
} : r ===
|
|
4657
|
+
} : r === ze.Failed ? {
|
|
4658
4658
|
type: "error",
|
|
4659
4659
|
title: "Process Failed",
|
|
4660
4660
|
icon: "✕",
|
|
4661
4661
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4662
4662
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4663
4663
|
message: "The verification process could not be completed."
|
|
4664
|
-
} : r ===
|
|
4664
|
+
} : r === ze.AdminReview ? {
|
|
4665
4665
|
type: "pending",
|
|
4666
4666
|
title: "Admin Review Required",
|
|
4667
4667
|
icon: "📋",
|
|
@@ -4676,8 +4676,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4676
4676
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4677
4677
|
message: "Your application is being reviewed."
|
|
4678
4678
|
};
|
|
4679
|
-
return /* @__PURE__ */ i(
|
|
4680
|
-
/* @__PURE__ */ i(
|
|
4679
|
+
return /* @__PURE__ */ i($, { children: [
|
|
4680
|
+
/* @__PURE__ */ i(B, { className: "py-12", children: [
|
|
4681
4681
|
/* @__PURE__ */ a("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ a(
|
|
4682
4682
|
"div",
|
|
4683
4683
|
{
|
|
@@ -4687,10 +4687,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4687
4687
|
) }),
|
|
4688
4688
|
/* @__PURE__ */ a("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: c.title }),
|
|
4689
4689
|
/* @__PURE__ */ a("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ a(
|
|
4690
|
-
|
|
4690
|
+
Ne,
|
|
4691
4691
|
{
|
|
4692
4692
|
variant: c.type === "success" ? "success" : c.type === "error" ? "danger" : c.type === "pending" ? "warning" : "info",
|
|
4693
|
-
children: e != null ?
|
|
4693
|
+
children: e != null ? Ie[e] : Ee[t]
|
|
4694
4694
|
}
|
|
4695
4695
|
) }),
|
|
4696
4696
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: n || c.message }),
|
|
@@ -4722,15 +4722,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4722
4722
|
/* @__PURE__ */ a("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
4723
4723
|
/* @__PURE__ */ i("div", { children: [
|
|
4724
4724
|
/* @__PURE__ */ a("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
|
|
4725
|
-
/* @__PURE__ */ a("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ?
|
|
4725
|
+
/* @__PURE__ */ a("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ? Ie[e] : "Not Available" })
|
|
4726
4726
|
] }),
|
|
4727
4727
|
/* @__PURE__ */ i("div", { children: [
|
|
4728
4728
|
/* @__PURE__ */ a("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
|
|
4729
|
-
/* @__PURE__ */ a("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children:
|
|
4729
|
+
/* @__PURE__ */ a("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: Ee[t] })
|
|
4730
4730
|
] })
|
|
4731
4731
|
] }) })
|
|
4732
4732
|
] }),
|
|
4733
|
-
/* @__PURE__ */ i(
|
|
4733
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-center gap-4", children: [
|
|
4734
4734
|
c.type === "success" && s && /* @__PURE__ */ a(U, { onClick: s, size: "lg", children: "Continue" }),
|
|
4735
4735
|
c.type === "error" && /* @__PURE__ */ i(mt, { children: [
|
|
4736
4736
|
l && /* @__PURE__ */ a(U, { variant: "outline", onClick: l, children: "Contact Support" }),
|
|
@@ -4754,12 +4754,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4754
4754
|
console.warn("[Logo] Failed to load logo:", e.url), r.target.style.display = "none";
|
|
4755
4755
|
}
|
|
4756
4756
|
}
|
|
4757
|
-
) }),
|
|
4757
|
+
) }), We = ({
|
|
4758
4758
|
title: e,
|
|
4759
4759
|
subtitle: t,
|
|
4760
4760
|
className: r = ""
|
|
4761
4761
|
}) => {
|
|
4762
|
-
const { currentTheme: n } =
|
|
4762
|
+
const { currentTheme: n } = pe(), s = e || (n == null ? void 0 : n.title) || "", l = !!(n != null && n.logo && n.logo.visible && n.logo.url), o = !!s;
|
|
4763
4763
|
return !l && !o ? null : /* @__PURE__ */ i("div", { className: `metakyc-header ${r}`, children: [
|
|
4764
4764
|
/* @__PURE__ */ i("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
4765
4765
|
l && /* @__PURE__ */ a(Or, { config: n.logo }),
|
|
@@ -4775,11 +4775,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4775
4775
|
] }),
|
|
4776
4776
|
t && /* @__PURE__ */ a("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
|
|
4777
4777
|
] });
|
|
4778
|
-
},
|
|
4779
|
-
function
|
|
4778
|
+
}, je = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
4779
|
+
function Be(e) {
|
|
4780
4780
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4781
4781
|
}
|
|
4782
|
-
const
|
|
4782
|
+
const Oe = {
|
|
4783
4783
|
width: "16px",
|
|
4784
4784
|
height: "16px",
|
|
4785
4785
|
minWidth: "16px",
|
|
@@ -4797,21 +4797,21 @@ const $e = {
|
|
|
4797
4797
|
onSuccess: r,
|
|
4798
4798
|
onCancel: n
|
|
4799
4799
|
}) => {
|
|
4800
|
-
var Qe, Ve
|
|
4801
|
-
const { config: s, baseInformationService: l, currentTheme: o } =
|
|
4802
|
-
if (!
|
|
4800
|
+
var Ye, Qe, Ve;
|
|
4801
|
+
const { config: s, baseInformationService: l, currentTheme: o } = pe(), { createApplicant: c, isLoading: u } = ur(), m = e || ((Ye = s.applicantForm) == null ? void 0 : Ye.workflowKey);
|
|
4802
|
+
if (!m)
|
|
4803
4803
|
throw new Error(
|
|
4804
4804
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4805
4805
|
);
|
|
4806
|
-
const w = t || ((
|
|
4806
|
+
const w = t || ((Qe = s.applicantForm) == null ? void 0 : Qe.externalRefId) || "", [S, y] = x([]), [h, g] = x(!0), N = X(!1), b = X(!1);
|
|
4807
4807
|
ee(() => {
|
|
4808
4808
|
(async () => {
|
|
4809
4809
|
if (!(N.current || b.current)) {
|
|
4810
4810
|
N.current = !0, g(!0);
|
|
4811
4811
|
try {
|
|
4812
|
-
const D = await l.getCountries("", s.locale || "en"),
|
|
4812
|
+
const D = await l.getCountries("", s.locale || "en"), M = /* @__PURE__ */ new Set();
|
|
4813
4813
|
y(
|
|
4814
|
-
D.map((
|
|
4814
|
+
D.map((k) => ({ value: k.abbreviation3 || k.abbreviation, label: k.name })).filter((k) => !k.value || M.has(k.value) ? !1 : (M.add(k.value), !0))
|
|
4815
4815
|
), b.current = !0;
|
|
4816
4816
|
} catch (D) {
|
|
4817
4817
|
console.error("Failed to load countries:", D);
|
|
@@ -4821,31 +4821,31 @@ const $e = {
|
|
|
4821
4821
|
}
|
|
4822
4822
|
})();
|
|
4823
4823
|
}, []);
|
|
4824
|
-
const
|
|
4824
|
+
const p = Re(
|
|
4825
4825
|
() => o != null && o.applicantFormPages && o.applicantFormPages.length > 0 ? o.applicantFormPages : null,
|
|
4826
4826
|
[o == null ? void 0 : o.applicantFormPages]
|
|
4827
|
-
), R =
|
|
4828
|
-
const d = new Set(
|
|
4829
|
-
if (D) for (const
|
|
4830
|
-
if (
|
|
4831
|
-
for (const
|
|
4832
|
-
for (const
|
|
4833
|
-
!
|
|
4827
|
+
), R = Re(() => {
|
|
4828
|
+
const d = new Set(je), D = o == null ? void 0 : o.applicantFormRequiredFields;
|
|
4829
|
+
if (D) for (const M of D) d.add(M);
|
|
4830
|
+
if (p)
|
|
4831
|
+
for (const M of p)
|
|
4832
|
+
for (const k of M.fields)
|
|
4833
|
+
!k.isCustom && k.name && k.required && d.add(k.name);
|
|
4834
4834
|
return Array.from(d);
|
|
4835
|
-
}, [o == null ? void 0 : o.applicantFormRequiredFields,
|
|
4836
|
-
var
|
|
4837
|
-
if (
|
|
4838
|
-
const
|
|
4839
|
-
for (const
|
|
4840
|
-
return Array.from(
|
|
4835
|
+
}, [o == null ? void 0 : o.applicantFormRequiredFields, p]), C = Re(() => {
|
|
4836
|
+
var M;
|
|
4837
|
+
if (p) {
|
|
4838
|
+
const k = p.flatMap((z) => z.fields).filter((z) => !z.isCustom && z.name).map((z) => z.name), I = new Set(k);
|
|
4839
|
+
for (const z of je) I.add(z);
|
|
4840
|
+
return Array.from(I);
|
|
4841
4841
|
}
|
|
4842
4842
|
let d;
|
|
4843
|
-
(
|
|
4843
|
+
(M = s.applicantForm) != null && M.visibleFields ? d = s.applicantForm.visibleFields : o != null && o.applicantFormVisibleFields && o.applicantFormVisibleFields.length > 0 ? d = o.applicantFormVisibleFields : d = Ct;
|
|
4844
4844
|
const D = new Set(d);
|
|
4845
|
-
for (const
|
|
4845
|
+
for (const k of je) D.add(k);
|
|
4846
4846
|
return Array.from(D);
|
|
4847
|
-
}, [(
|
|
4848
|
-
workflowKey:
|
|
4847
|
+
}, [(Ve = s.applicantForm) == null ? void 0 : Ve.visibleFields, o == null ? void 0 : o.applicantFormVisibleFields, p]), [v, q] = x({
|
|
4848
|
+
workflowKey: m,
|
|
4849
4849
|
firstName: "",
|
|
4850
4850
|
lastName: "",
|
|
4851
4851
|
title: "",
|
|
@@ -4869,154 +4869,149 @@ const $e = {
|
|
|
4869
4869
|
educationLevel: "",
|
|
4870
4870
|
occupation: "",
|
|
4871
4871
|
taxNumber: ""
|
|
4872
|
-
}), [
|
|
4873
|
-
|
|
4874
|
-
for (let d = f + 1; d < m.length; d++)
|
|
4875
|
-
if (be(m[d])) return d;
|
|
4876
|
-
return -1;
|
|
4877
|
-
}, [m, f, K]), M = we(() => {
|
|
4878
|
-
if (!m) return -1;
|
|
4879
|
-
for (let d = f - 1; d >= 0; d--)
|
|
4880
|
-
if (be(m[d])) return d;
|
|
4881
|
-
return -1;
|
|
4882
|
-
}, [m, f, K]), te = (d) => {
|
|
4883
|
-
var L;
|
|
4872
|
+
}), [W, T] = x({}), [f, A] = x(0), [F, Y] = x({}), [H, P] = x(null), [E, G] = x(!1), K = (d, D) => q((M) => ({ ...M, [d]: D })), ne = (d, D) => T((M) => ({ ...M, [d]: D })), ve = (d) => !d.conditionalOn || W[d.conditionalOn] === "true", O = p && f < p.length - 1 ? f + 1 : -1, L = p && f > 0 ? f - 1 : -1, te = (d) => {
|
|
4873
|
+
var M;
|
|
4884
4874
|
const D = {};
|
|
4885
|
-
for (const
|
|
4886
|
-
if (
|
|
4887
|
-
if (
|
|
4888
|
-
const
|
|
4889
|
-
|
|
4875
|
+
for (const k of d.fields)
|
|
4876
|
+
if (k.isCustom) {
|
|
4877
|
+
if (k.required && k.paramName) {
|
|
4878
|
+
const I = W[k.paramName], z = k.displayText || k.label || k.paramName;
|
|
4879
|
+
k.customType === "checkbox" || k.customType === "link_checkbox" ? I !== "true" && (D[k.paramName] = `${z} is required.`) : (!I || I.trim() === "") && (D[k.paramName] = `${z} is required.`);
|
|
4890
4880
|
}
|
|
4891
|
-
} else if (
|
|
4892
|
-
const
|
|
4893
|
-
if (R.includes(
|
|
4894
|
-
const
|
|
4895
|
-
D[
|
|
4881
|
+
} else if (k.name) {
|
|
4882
|
+
const I = k.name;
|
|
4883
|
+
if (R.includes(I) && Be(v[I])) {
|
|
4884
|
+
const z = k.displayText || ((M = qe[I]) == null ? void 0 : M.label) || I;
|
|
4885
|
+
D[I] = `${z} is required.`;
|
|
4896
4886
|
}
|
|
4897
4887
|
}
|
|
4898
4888
|
return D;
|
|
4899
4889
|
}, Z = async () => {
|
|
4900
|
-
if (!
|
|
4901
|
-
const d =
|
|
4902
|
-
if (
|
|
4903
|
-
|
|
4890
|
+
if (!p) return;
|
|
4891
|
+
const d = p[f];
|
|
4892
|
+
if (d.conditionalOn && !ve(d)) {
|
|
4893
|
+
Y({}), O >= 0 ? A(O) : await re();
|
|
4904
4894
|
return;
|
|
4905
4895
|
}
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4896
|
+
const D = te(d);
|
|
4897
|
+
if (Object.keys(D).length > 0) {
|
|
4898
|
+
Y(D);
|
|
4899
|
+
return;
|
|
4900
|
+
}
|
|
4901
|
+
Y({}), O >= 0 ? A(O) : await re();
|
|
4902
|
+
}, re = async () => {
|
|
4903
|
+
if (p) {
|
|
4909
4904
|
let d = {};
|
|
4910
|
-
for (const D of
|
|
4911
|
-
|
|
4905
|
+
for (const D of p)
|
|
4906
|
+
ve(D) && (d = { ...d, ...te(D) });
|
|
4912
4907
|
if (Object.keys(d).length > 0) {
|
|
4913
|
-
|
|
4908
|
+
Y(d);
|
|
4914
4909
|
return;
|
|
4915
4910
|
}
|
|
4916
4911
|
}
|
|
4917
4912
|
G(!0), P(null);
|
|
4918
4913
|
try {
|
|
4919
|
-
if (!
|
|
4914
|
+
if (!v.externalRefId || v.externalRefId.trim() === "") {
|
|
4920
4915
|
P("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
4921
4916
|
return;
|
|
4922
4917
|
}
|
|
4923
4918
|
const d = {
|
|
4924
|
-
workflowKey:
|
|
4925
|
-
externalRefId:
|
|
4919
|
+
workflowKey: v.workflowKey,
|
|
4920
|
+
externalRefId: v.externalRefId.trim()
|
|
4926
4921
|
};
|
|
4927
|
-
if (
|
|
4928
|
-
for (const
|
|
4929
|
-
if (
|
|
4930
|
-
for (const
|
|
4931
|
-
if (!
|
|
4932
|
-
const
|
|
4933
|
-
|
|
4922
|
+
if (p) {
|
|
4923
|
+
for (const k of p)
|
|
4924
|
+
if (ve(k)) {
|
|
4925
|
+
for (const I of k.fields)
|
|
4926
|
+
if (!I.isCustom && I.name) {
|
|
4927
|
+
const z = I.name, J = v[z];
|
|
4928
|
+
Be(J) || (d[z] = J);
|
|
4934
4929
|
}
|
|
4935
4930
|
}
|
|
4936
4931
|
} else
|
|
4937
|
-
|
|
4938
|
-
if (
|
|
4939
|
-
const
|
|
4940
|
-
|
|
4932
|
+
C.forEach((k) => {
|
|
4933
|
+
if (k === "externalRefId") return;
|
|
4934
|
+
const I = v[k];
|
|
4935
|
+
Be(I) || (d[k] = I);
|
|
4941
4936
|
});
|
|
4942
4937
|
const D = [];
|
|
4943
|
-
if (
|
|
4944
|
-
for (const
|
|
4945
|
-
if (
|
|
4946
|
-
for (const
|
|
4947
|
-
if (
|
|
4948
|
-
const
|
|
4949
|
-
D.push({ paramName:
|
|
4938
|
+
if (p) {
|
|
4939
|
+
for (const k of p)
|
|
4940
|
+
if (ve(k)) {
|
|
4941
|
+
for (const I of k.fields)
|
|
4942
|
+
if (I.isCustom && I.paramName) {
|
|
4943
|
+
const z = W[I.paramName] ?? "";
|
|
4944
|
+
D.push({ paramName: I.paramName, paramValue: z });
|
|
4950
4945
|
}
|
|
4951
4946
|
}
|
|
4952
4947
|
}
|
|
4953
4948
|
D.length > 0 && (d.applicantAdditionalDatas = D);
|
|
4954
|
-
const
|
|
4955
|
-
r(
|
|
4949
|
+
const M = await c(d);
|
|
4950
|
+
r(M.applicantId);
|
|
4956
4951
|
} catch (d) {
|
|
4957
4952
|
console.error("Error creating applicant:", d), P(d.message || "Failed to create applicant");
|
|
4958
4953
|
} finally {
|
|
4959
4954
|
G(!1);
|
|
4960
4955
|
}
|
|
4961
|
-
},
|
|
4956
|
+
}, j = async (d) => {
|
|
4962
4957
|
var D;
|
|
4963
4958
|
d.preventDefault();
|
|
4964
|
-
for (const
|
|
4965
|
-
if (
|
|
4966
|
-
const
|
|
4967
|
-
P(`${
|
|
4959
|
+
for (const M of R)
|
|
4960
|
+
if (Be(v[M])) {
|
|
4961
|
+
const k = ((D = qe[M]) == null ? void 0 : D.label) || M;
|
|
4962
|
+
P(`${k} is required.`);
|
|
4968
4963
|
return;
|
|
4969
4964
|
}
|
|
4970
|
-
await
|
|
4971
|
-
}, Fe = (d, D,
|
|
4972
|
-
var
|
|
4973
|
-
const
|
|
4974
|
-
if (!
|
|
4975
|
-
const
|
|
4976
|
-
switch (
|
|
4965
|
+
await re();
|
|
4966
|
+
}, Fe = (d, D, M) => {
|
|
4967
|
+
var Ge;
|
|
4968
|
+
const k = qe[d];
|
|
4969
|
+
if (!k) return null;
|
|
4970
|
+
const I = R.includes(d), z = F[d], J = M || k.label, ae = D ?? d, be = { required: I };
|
|
4971
|
+
switch (k.type) {
|
|
4977
4972
|
case "select":
|
|
4978
4973
|
if (d === "country" || d === "nationality" || d === "taxCountry" || d === "countryOfBirth")
|
|
4979
4974
|
return /* @__PURE__ */ a(
|
|
4980
|
-
|
|
4975
|
+
Ce,
|
|
4981
4976
|
{
|
|
4982
|
-
...
|
|
4977
|
+
...be,
|
|
4983
4978
|
label: J,
|
|
4984
|
-
value:
|
|
4985
|
-
onChange: (se) =>
|
|
4979
|
+
value: v[d] || "",
|
|
4980
|
+
onChange: (se) => K(d, se.target.value),
|
|
4986
4981
|
options: [{ value: "", label: `Select ${J.toLowerCase()}...` }, ...S],
|
|
4987
4982
|
disabled: h
|
|
4988
4983
|
},
|
|
4989
|
-
|
|
4984
|
+
ae
|
|
4990
4985
|
);
|
|
4991
4986
|
if (d === "salutation")
|
|
4992
4987
|
return /* @__PURE__ */ a(
|
|
4993
|
-
|
|
4988
|
+
Ce,
|
|
4994
4989
|
{
|
|
4995
|
-
...
|
|
4990
|
+
...be,
|
|
4996
4991
|
label: J,
|
|
4997
|
-
value: ((
|
|
4998
|
-
onChange: (se) =>
|
|
4992
|
+
value: ((Ge = v[d]) == null ? void 0 : Ge.toString()) || "",
|
|
4993
|
+
onChange: (se) => K(d, se.target.value ? Number(se.target.value) : null),
|
|
4999
4994
|
options: [
|
|
5000
4995
|
{ value: "", label: "Select salutation..." },
|
|
5001
|
-
{ value:
|
|
5002
|
-
{ value:
|
|
5003
|
-
{ value:
|
|
4996
|
+
{ value: _e.Male.toString(), label: "Male" },
|
|
4997
|
+
{ value: _e.Female.toString(), label: "Female" },
|
|
4998
|
+
{ value: _e.Other.toString(), label: "Other" }
|
|
5004
4999
|
]
|
|
5005
5000
|
},
|
|
5006
|
-
|
|
5001
|
+
ae
|
|
5007
5002
|
);
|
|
5008
5003
|
if (d === "defaultLanguage") {
|
|
5009
|
-
const se = o != null && o.allowedLanguages && o.allowedLanguages.length > 0 ? Je.filter((
|
|
5004
|
+
const se = o != null && o.allowedLanguages && o.allowedLanguages.length > 0 ? Je.filter((Ue) => o.allowedLanguages.includes(Ue.value)) : Je;
|
|
5010
5005
|
return /* @__PURE__ */ a(
|
|
5011
|
-
|
|
5006
|
+
Ce,
|
|
5012
5007
|
{
|
|
5013
|
-
...
|
|
5008
|
+
...be,
|
|
5014
5009
|
label: J,
|
|
5015
|
-
value:
|
|
5016
|
-
onChange: (
|
|
5010
|
+
value: v[d] || "",
|
|
5011
|
+
onChange: (Ue) => K(d, Ue.target.value),
|
|
5017
5012
|
options: [{ value: "", label: "Select language..." }, ...se]
|
|
5018
5013
|
},
|
|
5019
|
-
|
|
5014
|
+
ae
|
|
5020
5015
|
);
|
|
5021
5016
|
}
|
|
5022
5017
|
return null;
|
|
@@ -5024,72 +5019,72 @@ const $e = {
|
|
|
5024
5019
|
return d === "otherNationality" ? /* @__PURE__ */ a(
|
|
5025
5020
|
mr,
|
|
5026
5021
|
{
|
|
5027
|
-
...
|
|
5022
|
+
...be,
|
|
5028
5023
|
label: J,
|
|
5029
|
-
value:
|
|
5030
|
-
onChange: (se) =>
|
|
5024
|
+
value: v[d] || [],
|
|
5025
|
+
onChange: (se) => K(d, se),
|
|
5031
5026
|
options: S,
|
|
5032
5027
|
placeholder: "Select other nationalities...",
|
|
5033
5028
|
disabled: h
|
|
5034
5029
|
},
|
|
5035
|
-
|
|
5030
|
+
ae
|
|
5036
5031
|
) : null;
|
|
5037
5032
|
case "date":
|
|
5038
5033
|
return /* @__PURE__ */ a(
|
|
5039
|
-
|
|
5034
|
+
de,
|
|
5040
5035
|
{
|
|
5041
|
-
...
|
|
5036
|
+
...be,
|
|
5042
5037
|
type: "date",
|
|
5043
5038
|
label: J,
|
|
5044
|
-
value:
|
|
5045
|
-
onChange: (se) =>
|
|
5046
|
-
error:
|
|
5039
|
+
value: v[d] || "",
|
|
5040
|
+
onChange: (se) => K(d, se.target.value),
|
|
5041
|
+
error: z
|
|
5047
5042
|
},
|
|
5048
|
-
|
|
5043
|
+
ae
|
|
5049
5044
|
);
|
|
5050
5045
|
case "email":
|
|
5051
5046
|
return /* @__PURE__ */ a(
|
|
5052
|
-
|
|
5047
|
+
de,
|
|
5053
5048
|
{
|
|
5054
|
-
...
|
|
5049
|
+
...be,
|
|
5055
5050
|
type: "email",
|
|
5056
5051
|
label: J,
|
|
5057
|
-
value:
|
|
5058
|
-
onChange: (se) =>
|
|
5059
|
-
error:
|
|
5052
|
+
value: v[d] || "",
|
|
5053
|
+
onChange: (se) => K(d, se.target.value),
|
|
5054
|
+
error: z
|
|
5060
5055
|
},
|
|
5061
|
-
|
|
5056
|
+
ae
|
|
5062
5057
|
);
|
|
5063
5058
|
case "tel":
|
|
5064
5059
|
return /* @__PURE__ */ a(
|
|
5065
|
-
|
|
5060
|
+
de,
|
|
5066
5061
|
{
|
|
5067
|
-
...
|
|
5062
|
+
...be,
|
|
5068
5063
|
type: "tel",
|
|
5069
5064
|
label: J,
|
|
5070
|
-
value:
|
|
5071
|
-
onChange: (se) =>
|
|
5072
|
-
error:
|
|
5065
|
+
value: v[d] || "",
|
|
5066
|
+
onChange: (se) => K(d, se.target.value),
|
|
5067
|
+
error: z
|
|
5073
5068
|
},
|
|
5074
|
-
|
|
5069
|
+
ae
|
|
5075
5070
|
);
|
|
5076
5071
|
default:
|
|
5077
5072
|
return /* @__PURE__ */ a(
|
|
5078
|
-
|
|
5073
|
+
de,
|
|
5079
5074
|
{
|
|
5080
|
-
...
|
|
5075
|
+
...be,
|
|
5081
5076
|
type: "text",
|
|
5082
5077
|
label: J,
|
|
5083
|
-
value:
|
|
5084
|
-
onChange: (se) =>
|
|
5085
|
-
error:
|
|
5078
|
+
value: v[d] || "",
|
|
5079
|
+
onChange: (se) => K(d, se.target.value),
|
|
5080
|
+
error: z
|
|
5086
5081
|
},
|
|
5087
|
-
|
|
5082
|
+
ae
|
|
5088
5083
|
);
|
|
5089
5084
|
}
|
|
5090
|
-
},
|
|
5085
|
+
}, xe = (d, D) => {
|
|
5091
5086
|
if (!d.paramName) return null;
|
|
5092
|
-
const
|
|
5087
|
+
const M = F[d.paramName], k = d.displayText || d.label || d.paramName;
|
|
5093
5088
|
if (d.customType === "checkbox")
|
|
5094
5089
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
5095
5090
|
/* @__PURE__ */ i(
|
|
@@ -5102,10 +5097,10 @@ const $e = {
|
|
|
5102
5097
|
"input",
|
|
5103
5098
|
{
|
|
5104
5099
|
type: "checkbox",
|
|
5105
|
-
checked:
|
|
5106
|
-
onChange: (
|
|
5100
|
+
checked: W[d.paramName] === "true",
|
|
5101
|
+
onChange: (I) => ne(d.paramName, I.target.checked ? "true" : "false"),
|
|
5107
5102
|
className: "metakyc-option-input",
|
|
5108
|
-
style:
|
|
5103
|
+
style: Oe
|
|
5109
5104
|
}
|
|
5110
5105
|
),
|
|
5111
5106
|
/* @__PURE__ */ i(
|
|
@@ -5114,7 +5109,7 @@ const $e = {
|
|
|
5114
5109
|
className: "metakyc-option-text",
|
|
5115
5110
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5116
5111
|
children: [
|
|
5117
|
-
|
|
5112
|
+
k,
|
|
5118
5113
|
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5119
5114
|
]
|
|
5120
5115
|
}
|
|
@@ -5122,7 +5117,7 @@ const $e = {
|
|
|
5122
5117
|
]
|
|
5123
5118
|
}
|
|
5124
5119
|
),
|
|
5125
|
-
|
|
5120
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: M })
|
|
5126
5121
|
] }, `custom-${D}`);
|
|
5127
5122
|
if (d.customType === "link_checkbox")
|
|
5128
5123
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -5136,10 +5131,10 @@ const $e = {
|
|
|
5136
5131
|
"input",
|
|
5137
5132
|
{
|
|
5138
5133
|
type: "checkbox",
|
|
5139
|
-
checked:
|
|
5140
|
-
onChange: (
|
|
5134
|
+
checked: W[d.paramName] === "true",
|
|
5135
|
+
onChange: (I) => ne(d.paramName, I.target.checked ? "true" : "false"),
|
|
5141
5136
|
className: "metakyc-option-input",
|
|
5142
|
-
style: {
|
|
5137
|
+
style: { ...Oe, alignSelf: "flex-start", marginTop: "2px" }
|
|
5143
5138
|
}
|
|
5144
5139
|
),
|
|
5145
5140
|
/* @__PURE__ */ i(
|
|
@@ -5148,7 +5143,7 @@ const $e = {
|
|
|
5148
5143
|
className: "metakyc-option-text",
|
|
5149
5144
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5150
5145
|
children: [
|
|
5151
|
-
|
|
5146
|
+
k,
|
|
5152
5147
|
" ",
|
|
5153
5148
|
d.linkUrl && /* @__PURE__ */ a(
|
|
5154
5149
|
"a",
|
|
@@ -5158,7 +5153,7 @@ const $e = {
|
|
|
5158
5153
|
rel: "noopener noreferrer",
|
|
5159
5154
|
className: "underline",
|
|
5160
5155
|
style: { color: "var(--metakyc-primary, #2563eb)" },
|
|
5161
|
-
onClick: (
|
|
5156
|
+
onClick: (I) => I.stopPropagation(),
|
|
5162
5157
|
children: d.linkText || d.linkUrl
|
|
5163
5158
|
}
|
|
5164
5159
|
),
|
|
@@ -5169,10 +5164,10 @@ const $e = {
|
|
|
5169
5164
|
]
|
|
5170
5165
|
}
|
|
5171
5166
|
),
|
|
5172
|
-
|
|
5167
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: M })
|
|
5173
5168
|
] }, `custom-${D}`);
|
|
5174
5169
|
if (d.customType === "group_checkbox") {
|
|
5175
|
-
const
|
|
5170
|
+
const I = (W[d.paramName] || "").split(",").filter(Boolean);
|
|
5176
5171
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
5177
5172
|
/* @__PURE__ */ i(
|
|
5178
5173
|
"div",
|
|
@@ -5180,12 +5175,12 @@ const $e = {
|
|
|
5180
5175
|
className: "text-sm font-medium",
|
|
5181
5176
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5182
5177
|
children: [
|
|
5183
|
-
|
|
5178
|
+
k,
|
|
5184
5179
|
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5185
5180
|
]
|
|
5186
5181
|
}
|
|
5187
5182
|
),
|
|
5188
|
-
/* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((
|
|
5183
|
+
/* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((z) => /* @__PURE__ */ i(
|
|
5189
5184
|
"label",
|
|
5190
5185
|
{
|
|
5191
5186
|
className: "metakyc-option-label",
|
|
@@ -5195,13 +5190,13 @@ const $e = {
|
|
|
5195
5190
|
"input",
|
|
5196
5191
|
{
|
|
5197
5192
|
type: "checkbox",
|
|
5198
|
-
checked:
|
|
5193
|
+
checked: I.includes(z.value),
|
|
5199
5194
|
onChange: (J) => {
|
|
5200
|
-
const
|
|
5201
|
-
|
|
5195
|
+
const ae = J.target.checked ? [...I, z.value] : I.filter((be) => be !== z.value);
|
|
5196
|
+
ne(d.paramName, ae.join(","));
|
|
5202
5197
|
},
|
|
5203
5198
|
className: "metakyc-option-input",
|
|
5204
|
-
style:
|
|
5199
|
+
style: Oe
|
|
5205
5200
|
}
|
|
5206
5201
|
),
|
|
5207
5202
|
/* @__PURE__ */ a(
|
|
@@ -5209,14 +5204,14 @@ const $e = {
|
|
|
5209
5204
|
{
|
|
5210
5205
|
className: "metakyc-option-text",
|
|
5211
5206
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5212
|
-
children:
|
|
5207
|
+
children: z.label
|
|
5213
5208
|
}
|
|
5214
5209
|
)
|
|
5215
5210
|
]
|
|
5216
5211
|
},
|
|
5217
|
-
|
|
5212
|
+
z.value
|
|
5218
5213
|
)) }),
|
|
5219
|
-
|
|
5214
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: M })
|
|
5220
5215
|
] }, `custom-${D}`);
|
|
5221
5216
|
}
|
|
5222
5217
|
return d.customType === "radio_group" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
@@ -5226,12 +5221,12 @@ const $e = {
|
|
|
5226
5221
|
className: "text-sm font-medium",
|
|
5227
5222
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5228
5223
|
children: [
|
|
5229
|
-
|
|
5224
|
+
k,
|
|
5230
5225
|
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5231
5226
|
]
|
|
5232
5227
|
}
|
|
5233
5228
|
),
|
|
5234
|
-
/* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((
|
|
5229
|
+
/* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((I) => /* @__PURE__ */ i(
|
|
5235
5230
|
"label",
|
|
5236
5231
|
{
|
|
5237
5232
|
className: "metakyc-option-label",
|
|
@@ -5241,11 +5236,11 @@ const $e = {
|
|
|
5241
5236
|
"input",
|
|
5242
5237
|
{
|
|
5243
5238
|
type: "radio",
|
|
5244
|
-
checked:
|
|
5245
|
-
onChange: () =>
|
|
5239
|
+
checked: W[d.paramName] === I.value,
|
|
5240
|
+
onChange: () => ne(d.paramName, I.value),
|
|
5246
5241
|
name: `radio-group-${d.paramName}-${D}`,
|
|
5247
5242
|
className: "metakyc-option-input",
|
|
5248
|
-
style:
|
|
5243
|
+
style: Oe
|
|
5249
5244
|
}
|
|
5250
5245
|
),
|
|
5251
5246
|
/* @__PURE__ */ a(
|
|
@@ -5253,43 +5248,30 @@ const $e = {
|
|
|
5253
5248
|
{
|
|
5254
5249
|
className: "metakyc-option-text",
|
|
5255
5250
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5256
|
-
children:
|
|
5251
|
+
children: I.label
|
|
5257
5252
|
}
|
|
5258
5253
|
)
|
|
5259
5254
|
]
|
|
5260
5255
|
},
|
|
5261
|
-
|
|
5256
|
+
I.value
|
|
5262
5257
|
)) }),
|
|
5263
|
-
|
|
5258
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: M })
|
|
5264
5259
|
] }, `custom-${D}`) : /* @__PURE__ */ a(
|
|
5265
|
-
|
|
5260
|
+
de,
|
|
5266
5261
|
{
|
|
5267
5262
|
type: "text",
|
|
5268
|
-
label: `${
|
|
5269
|
-
value:
|
|
5270
|
-
onChange: (
|
|
5263
|
+
label: `${k}${d.required ? " *" : ""}`,
|
|
5264
|
+
value: W[d.paramName] || "",
|
|
5265
|
+
onChange: (I) => ne(d.paramName, I.target.value),
|
|
5271
5266
|
required: d.required,
|
|
5272
|
-
error:
|
|
5267
|
+
error: M
|
|
5273
5268
|
},
|
|
5274
5269
|
`custom-${D}`
|
|
5275
5270
|
);
|
|
5276
5271
|
}, Le = (d, D) => {
|
|
5277
|
-
const
|
|
5278
|
-
if (m) {
|
|
5279
|
-
const v = new Set(
|
|
5280
|
-
m.slice(0, D + 1).flatMap((C) => C.fields).filter((C) => C.isCustom && C.paramName).map((C) => C.paramName)
|
|
5281
|
-
);
|
|
5282
|
-
for (let C = D + 1; C < m.length; C++) {
|
|
5283
|
-
const O = m[C].conditionalOn;
|
|
5284
|
-
O && !v.has(O) && !L.includes(O) && L.push(O);
|
|
5285
|
-
}
|
|
5286
|
-
}
|
|
5272
|
+
const M = ve(d);
|
|
5287
5273
|
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
5288
|
-
/* @__PURE__ */
|
|
5289
|
-
const O = v.colSpan === 1 ? "col-span-1" : "col-span-2", J = v.isCustom ? `custom-${C}-${v.paramName}` : `builtin-${v.name}-${C}`;
|
|
5290
|
-
return /* @__PURE__ */ a("div", { className: O, children: v.isCustom ? ve(v, C) : Fe(v.name, J, v.displayText) }, J);
|
|
5291
|
-
}) }),
|
|
5292
|
-
L.length > 0 && /* @__PURE__ */ a("div", { className: "space-y-3 pt-2", children: L.map((v) => /* @__PURE__ */ i(
|
|
5274
|
+
d.conditionalOn && /* @__PURE__ */ i(
|
|
5293
5275
|
"label",
|
|
5294
5276
|
{
|
|
5295
5277
|
className: "metakyc-option-label",
|
|
@@ -5299,36 +5281,39 @@ const $e = {
|
|
|
5299
5281
|
"input",
|
|
5300
5282
|
{
|
|
5301
5283
|
type: "checkbox",
|
|
5302
|
-
checked:
|
|
5303
|
-
onChange: (
|
|
5284
|
+
checked: M,
|
|
5285
|
+
onChange: (k) => ne(d.conditionalOn, k.target.checked ? "true" : "false"),
|
|
5304
5286
|
className: "metakyc-option-input",
|
|
5305
|
-
style:
|
|
5287
|
+
style: Oe
|
|
5306
5288
|
}
|
|
5307
5289
|
),
|
|
5308
5290
|
/* @__PURE__ */ a(
|
|
5309
5291
|
"span",
|
|
5310
5292
|
{
|
|
5311
5293
|
className: "metakyc-option-text",
|
|
5312
|
-
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5313
|
-
children:
|
|
5294
|
+
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", fontWeight: 500 },
|
|
5295
|
+
children: d.conditionalOn
|
|
5314
5296
|
}
|
|
5315
5297
|
)
|
|
5316
5298
|
]
|
|
5317
|
-
}
|
|
5318
|
-
|
|
5319
|
-
)
|
|
5299
|
+
}
|
|
5300
|
+
),
|
|
5301
|
+
M && /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-4", children: d.fields.map((k, I) => {
|
|
5302
|
+
const z = k.colSpan === 1 ? "col-span-1" : "col-span-2", J = k.isCustom ? `custom-${I}-${k.paramName}` : `builtin-${k.name}-${I}`;
|
|
5303
|
+
return /* @__PURE__ */ a("div", { className: z, children: k.isCustom ? xe(k, I) : Fe(k.name, J, k.displayText) }, J);
|
|
5304
|
+
}) })
|
|
5320
5305
|
] });
|
|
5321
5306
|
};
|
|
5322
5307
|
if (h)
|
|
5323
|
-
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a(
|
|
5324
|
-
/* @__PURE__ */ a(
|
|
5308
|
+
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5309
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
5325
5310
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
5326
5311
|
] }) }) });
|
|
5327
|
-
if (
|
|
5328
|
-
const d =
|
|
5329
|
-
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(
|
|
5330
|
-
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(
|
|
5331
|
-
/* @__PURE__ */ i(
|
|
5312
|
+
if (p) {
|
|
5313
|
+
const d = p[f] ?? p[0], D = L === -1, M = O === -1, k = p.length, I = ve(d), z = Object.values(F);
|
|
5314
|
+
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i($, { children: [
|
|
5315
|
+
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(We, { title: (o == null ? void 0 : o.title) || "Create Applicant" }) }),
|
|
5316
|
+
/* @__PURE__ */ i(B, { children: [
|
|
5332
5317
|
(d.title || d.subtitle || d.description) && /* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
5333
5318
|
d.title && /* @__PURE__ */ a(
|
|
5334
5319
|
"h3",
|
|
@@ -5355,35 +5340,32 @@ const $e = {
|
|
|
5355
5340
|
}
|
|
5356
5341
|
)
|
|
5357
5342
|
] }),
|
|
5358
|
-
(
|
|
5359
|
-
|
|
5343
|
+
(H || z.length > 0) && /* @__PURE__ */ i("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
5344
|
+
H && /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
5360
5345
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
5361
5346
|
" ",
|
|
5362
|
-
|
|
5347
|
+
H
|
|
5363
5348
|
] }),
|
|
5364
|
-
|
|
5349
|
+
z.map((J, ae) => /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: J }, ae))
|
|
5365
5350
|
] }),
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
"
|
|
5371
|
-
{
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
re
|
|
5376
|
-
);
|
|
5377
|
-
}),
|
|
5351
|
+
k > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
5352
|
+
p.map((J, ae) => /* @__PURE__ */ a(
|
|
5353
|
+
"div",
|
|
5354
|
+
{
|
|
5355
|
+
className: `h-1.5 rounded-full transition-all ${ae === f ? "flex-1" : "w-8"}`,
|
|
5356
|
+
style: ae === f ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : ae < f ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
|
|
5357
|
+
},
|
|
5358
|
+
ae
|
|
5359
|
+
)),
|
|
5378
5360
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
5379
|
-
|
|
5361
|
+
f + 1,
|
|
5380
5362
|
" / ",
|
|
5381
|
-
|
|
5363
|
+
k
|
|
5382
5364
|
] })
|
|
5383
5365
|
] }),
|
|
5384
|
-
Le(d
|
|
5366
|
+
Le(d)
|
|
5385
5367
|
] }),
|
|
5386
|
-
/* @__PURE__ */ i(
|
|
5368
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
5387
5369
|
/* @__PURE__ */ i("div", { children: [
|
|
5388
5370
|
!D && /* @__PURE__ */ a(
|
|
5389
5371
|
U,
|
|
@@ -5391,7 +5373,7 @@ const $e = {
|
|
|
5391
5373
|
type: "button",
|
|
5392
5374
|
variant: "outline",
|
|
5393
5375
|
onClick: () => {
|
|
5394
|
-
|
|
5376
|
+
A(L), Y({});
|
|
5395
5377
|
},
|
|
5396
5378
|
disabled: E || u,
|
|
5397
5379
|
children: "Previous"
|
|
@@ -5404,24 +5386,24 @@ const $e = {
|
|
|
5404
5386
|
{
|
|
5405
5387
|
type: "button",
|
|
5406
5388
|
isLoading: E || u,
|
|
5407
|
-
onClick:
|
|
5408
|
-
children:
|
|
5389
|
+
onClick: M ? re : Z,
|
|
5390
|
+
children: M ? d.conditionalOn && !I ? "Skip & Submit" : "Submit" : d.conditionalOn && !I ? "Skip" : "Next"
|
|
5409
5391
|
}
|
|
5410
5392
|
)
|
|
5411
5393
|
] })
|
|
5412
5394
|
] }) });
|
|
5413
5395
|
}
|
|
5414
|
-
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a("form", { onSubmit:
|
|
5415
|
-
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(
|
|
5416
|
-
/* @__PURE__ */ i(
|
|
5417
|
-
|
|
5396
|
+
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a("form", { onSubmit: j, children: /* @__PURE__ */ i($, { children: [
|
|
5397
|
+
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(We, { title: (o == null ? void 0 : o.title) || "Create Applicant" }) }),
|
|
5398
|
+
/* @__PURE__ */ i(B, { children: [
|
|
5399
|
+
H && /* @__PURE__ */ a("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: [
|
|
5418
5400
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
5419
5401
|
" ",
|
|
5420
|
-
|
|
5402
|
+
H
|
|
5421
5403
|
] }) }),
|
|
5422
|
-
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
5404
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: C.map((d) => Fe(d)) })
|
|
5423
5405
|
] }),
|
|
5424
|
-
/* @__PURE__ */ i(
|
|
5406
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
5425
5407
|
n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: E || u, children: "Cancel" }),
|
|
5426
5408
|
/* @__PURE__ */ a(U, { type: "submit", isLoading: E || u, children: "Create Applicant" })
|
|
5427
5409
|
] })
|
|
@@ -5438,33 +5420,33 @@ const $e = {
|
|
|
5438
5420
|
currentStep: o,
|
|
5439
5421
|
steps: c,
|
|
5440
5422
|
workflowKey: u,
|
|
5441
|
-
nextWorkflowKey:
|
|
5423
|
+
nextWorkflowKey: m,
|
|
5442
5424
|
hasWorkflowChanged: w,
|
|
5443
5425
|
isLoading: S,
|
|
5444
5426
|
error: y,
|
|
5445
5427
|
moveBack: h,
|
|
5446
5428
|
refreshProgress: g
|
|
5447
|
-
} = sr(e), [N, b] =
|
|
5448
|
-
if (
|
|
5429
|
+
} = sr(e), [N, b] = he.useState(!1);
|
|
5430
|
+
if (he.useEffect(() => {
|
|
5449
5431
|
y && r && r(y);
|
|
5450
|
-
}, [y, r]),
|
|
5432
|
+
}, [y, r]), he.useEffect(() => {
|
|
5451
5433
|
l != null && l.workflowResult && t && t(l.workflowResult);
|
|
5452
|
-
}, [l == null ? void 0 : l.workflowResult, t]),
|
|
5434
|
+
}, [l == null ? void 0 : l.workflowResult, t]), he.useEffect(() => {
|
|
5453
5435
|
n === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
5454
|
-
}, [n]),
|
|
5436
|
+
}, [n]), he.useEffect(() => {
|
|
5455
5437
|
w && b(!1);
|
|
5456
5438
|
}, [w]), S || !l)
|
|
5457
|
-
return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a(
|
|
5458
|
-
/* @__PURE__ */ a(
|
|
5439
|
+
return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5440
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
5459
5441
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
5460
5442
|
] }) }) });
|
|
5461
5443
|
if (y)
|
|
5462
|
-
return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a(
|
|
5444
|
+
return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
5463
5445
|
/* @__PURE__ */ a("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
5464
5446
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: y.message })
|
|
5465
5447
|
] }) }) }) });
|
|
5466
5448
|
if (w && !N)
|
|
5467
|
-
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a(
|
|
5449
|
+
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
5468
5450
|
/* @__PURE__ */ a("div", { className: "mb-6", children: /* @__PURE__ */ a("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__ */ a("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a("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" }) }) }) }),
|
|
5469
5451
|
/* @__PURE__ */ a("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
5470
5452
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
|
|
@@ -5477,7 +5459,7 @@ const $e = {
|
|
|
5477
5459
|
/* @__PURE__ */ a("svg", { className: "w-6 h-6 text-gray-400 mx-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }),
|
|
5478
5460
|
/* @__PURE__ */ i("div", { className: "text-right", children: [
|
|
5479
5461
|
/* @__PURE__ */ a("p", { className: "text-gray-500 dark:text-gray-400 mb-1", children: "New Workflow" }),
|
|
5480
|
-
/* @__PURE__ */ a("p", { className: "font-medium text-blue-600 dark:text-blue-400", children:
|
|
5462
|
+
/* @__PURE__ */ a("p", { className: "font-medium text-blue-600 dark:text-blue-400", children: m })
|
|
5481
5463
|
] })
|
|
5482
5464
|
] }),
|
|
5483
5465
|
l.nextWorkflowName && /* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-2 text-xs", children: l.nextWorkflowName })
|
|
@@ -5491,7 +5473,7 @@ const $e = {
|
|
|
5491
5473
|
}
|
|
5492
5474
|
)
|
|
5493
5475
|
] }) }) }) });
|
|
5494
|
-
if (l.status ===
|
|
5476
|
+
if (l.status === ye.Finished || l.status === ye.OnHold)
|
|
5495
5477
|
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a(
|
|
5496
5478
|
et,
|
|
5497
5479
|
{
|
|
@@ -5506,12 +5488,12 @@ const $e = {
|
|
|
5506
5488
|
}
|
|
5507
5489
|
) });
|
|
5508
5490
|
if (!o)
|
|
5509
|
-
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a(
|
|
5510
|
-
/* @__PURE__ */ a(
|
|
5511
|
-
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status ===
|
|
5491
|
+
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5492
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
5493
|
+
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status === ye.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
5512
5494
|
] }) }) });
|
|
5513
|
-
const
|
|
5514
|
-
switch (
|
|
5495
|
+
const p = (v) => {
|
|
5496
|
+
switch (v) {
|
|
5515
5497
|
case _.Overview:
|
|
5516
5498
|
return "Overview";
|
|
5517
5499
|
case _.Questionaries:
|
|
@@ -5534,40 +5516,40 @@ const $e = {
|
|
|
5534
5516
|
return "";
|
|
5535
5517
|
}
|
|
5536
5518
|
}, R = () => {
|
|
5537
|
-
const
|
|
5519
|
+
const v = c.filter((f) => f.visibility !== !1), q = v.findIndex((f) => f.order === o.order), W = q >= 0 ? q + 1 : 1, T = v.length;
|
|
5538
5520
|
return /* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
5539
5521
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5540
|
-
/* @__PURE__ */ a(
|
|
5541
|
-
/* @__PURE__ */ i(
|
|
5522
|
+
/* @__PURE__ */ a(We, {}),
|
|
5523
|
+
/* @__PURE__ */ i(Ne, { variant: l.status === 1 ? "info" : "success", children: [
|
|
5542
5524
|
"Step ",
|
|
5543
|
-
|
|
5525
|
+
W,
|
|
5544
5526
|
" of ",
|
|
5545
5527
|
T
|
|
5546
5528
|
] })
|
|
5547
5529
|
] }),
|
|
5548
|
-
/* @__PURE__ */ a("div", { className: "flex items-center", children:
|
|
5549
|
-
const F =
|
|
5550
|
-
return /* @__PURE__ */ i(
|
|
5530
|
+
/* @__PURE__ */ a("div", { className: "flex items-center", children: v.map((f, A) => {
|
|
5531
|
+
const F = A < q, Y = f.order === o.order;
|
|
5532
|
+
return /* @__PURE__ */ i(he.Fragment, { children: [
|
|
5551
5533
|
/* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
5552
5534
|
/* @__PURE__ */ a(
|
|
5553
5535
|
"div",
|
|
5554
5536
|
{
|
|
5555
5537
|
className: `
|
|
5556
5538
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
5557
|
-
${F ||
|
|
5539
|
+
${F || Y ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
5558
5540
|
`,
|
|
5559
|
-
children:
|
|
5541
|
+
children: A + 1
|
|
5560
5542
|
}
|
|
5561
5543
|
),
|
|
5562
5544
|
/* @__PURE__ */ a(
|
|
5563
5545
|
"span",
|
|
5564
5546
|
{
|
|
5565
|
-
className: `ml-2 text-sm ${
|
|
5566
|
-
children: f.displayName || f.name ||
|
|
5547
|
+
className: `ml-2 text-sm ${Y ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
5548
|
+
children: f.displayName || f.name || p(f.action) || `Step ${A + 1}`
|
|
5567
5549
|
}
|
|
5568
5550
|
)
|
|
5569
5551
|
] }),
|
|
5570
|
-
|
|
5552
|
+
A < v.length - 1 && /* @__PURE__ */ a(
|
|
5571
5553
|
"div",
|
|
5572
5554
|
{
|
|
5573
5555
|
className: `flex-1 h-0.5 mx-4 ${F ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
@@ -5576,8 +5558,8 @@ const $e = {
|
|
|
5576
5558
|
] }, f.order);
|
|
5577
5559
|
}) })
|
|
5578
5560
|
] });
|
|
5579
|
-
},
|
|
5580
|
-
const
|
|
5561
|
+
}, C = () => {
|
|
5562
|
+
const v = {
|
|
5581
5563
|
applicantId: e,
|
|
5582
5564
|
onComplete: async () => {
|
|
5583
5565
|
await g();
|
|
@@ -5586,20 +5568,20 @@ const $e = {
|
|
|
5586
5568
|
};
|
|
5587
5569
|
switch (o.action) {
|
|
5588
5570
|
case _.Questionaries:
|
|
5589
|
-
return /* @__PURE__ */ a(Sr, { ...
|
|
5571
|
+
return /* @__PURE__ */ a(Sr, { ...v });
|
|
5590
5572
|
case _.UploadDocument:
|
|
5591
|
-
return /* @__PURE__ */ a(Ar, { ...
|
|
5573
|
+
return /* @__PURE__ */ a(Ar, { ...v });
|
|
5592
5574
|
case _.Overview:
|
|
5593
|
-
return /* @__PURE__ */ a(Ir, { ...
|
|
5575
|
+
return /* @__PURE__ */ a(Ir, { ...v });
|
|
5594
5576
|
case _.IdentitySdk:
|
|
5595
|
-
return /* @__PURE__ */ a(Tr, { ...
|
|
5577
|
+
return /* @__PURE__ */ a(Tr, { ...v });
|
|
5596
5578
|
case _.RiskScoring:
|
|
5597
|
-
return /* @__PURE__ */ a(Dr, { ...
|
|
5579
|
+
return /* @__PURE__ */ a(Dr, { ...v });
|
|
5598
5580
|
case _.AdditionalData:
|
|
5599
5581
|
case _.InvestorCategorization:
|
|
5600
|
-
return /* @__PURE__ */ a(Lr, { ...
|
|
5582
|
+
return /* @__PURE__ */ a(Lr, { ...v });
|
|
5601
5583
|
case _.AppropriatenessTest:
|
|
5602
|
-
return /* @__PURE__ */ a(Mr, { ...
|
|
5584
|
+
return /* @__PURE__ */ a(Mr, { ...v });
|
|
5603
5585
|
case _.ManualReview:
|
|
5604
5586
|
return /* @__PURE__ */ a(
|
|
5605
5587
|
et,
|
|
@@ -5611,8 +5593,8 @@ const $e = {
|
|
|
5611
5593
|
}
|
|
5612
5594
|
);
|
|
5613
5595
|
default:
|
|
5614
|
-
return /* @__PURE__ */ a(
|
|
5615
|
-
/* @__PURE__ */ a("div", { className: "mb-4", children: /* @__PURE__ */ a(
|
|
5596
|
+
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
|
|
5597
|
+
/* @__PURE__ */ a("div", { className: "mb-4", children: /* @__PURE__ */ a(fe, {}) }),
|
|
5616
5598
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
5617
5599
|
"Processing step: ",
|
|
5618
5600
|
o.title || o.name
|
|
@@ -5626,16 +5608,16 @@ const $e = {
|
|
|
5626
5608
|
};
|
|
5627
5609
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
5628
5610
|
R(),
|
|
5629
|
-
|
|
5611
|
+
C()
|
|
5630
5612
|
] });
|
|
5631
5613
|
};
|
|
5632
5614
|
function ra(e) {
|
|
5633
|
-
return
|
|
5634
|
-
questionResults:
|
|
5615
|
+
return we.object({
|
|
5616
|
+
questionResults: we.any()
|
|
5635
5617
|
}).passthrough();
|
|
5636
5618
|
}
|
|
5637
5619
|
function $r(e) {
|
|
5638
|
-
let t =
|
|
5620
|
+
let t = we.array(we.instanceof(File));
|
|
5639
5621
|
if (e.isRequired ? t = t.min(
|
|
5640
5622
|
1,
|
|
5641
5623
|
`${e.displayName} is required`
|
|
@@ -5661,62 +5643,62 @@ function aa(e) {
|
|
|
5661
5643
|
return e.uploadDocumentFiles.forEach((r) => {
|
|
5662
5644
|
const n = `file_${r.id}`;
|
|
5663
5645
|
t[n] = $r(r);
|
|
5664
|
-
}),
|
|
5646
|
+
}), we.object(t);
|
|
5665
5647
|
}
|
|
5666
5648
|
function na(e) {
|
|
5667
|
-
return
|
|
5649
|
+
return we.any();
|
|
5668
5650
|
}
|
|
5669
5651
|
function Br(e) {
|
|
5670
|
-
return
|
|
5652
|
+
return we.string().min(1, "This question is required");
|
|
5671
5653
|
}
|
|
5672
5654
|
function sa(e) {
|
|
5673
5655
|
const t = {};
|
|
5674
5656
|
return e.appropriatenessQuestions.forEach((r) => {
|
|
5675
5657
|
const n = `question_${r.id}`;
|
|
5676
5658
|
t[n] = Br();
|
|
5677
|
-
}),
|
|
5659
|
+
}), we.object(t);
|
|
5678
5660
|
}
|
|
5679
|
-
const ia =
|
|
5661
|
+
const ia = we.any();
|
|
5680
5662
|
export {
|
|
5681
5663
|
Je as ALLOWED_LANGUAGES,
|
|
5682
5664
|
ht as ApplicantProgressOnHoldReason,
|
|
5683
|
-
|
|
5665
|
+
ye as ApplicantProgressStatus,
|
|
5684
5666
|
Rt as ApplicantService,
|
|
5685
5667
|
yt as ApplicantStatus,
|
|
5686
5668
|
kt as AppropriatenessQuestionType,
|
|
5687
5669
|
Pt as AppropriatenessTestService,
|
|
5688
5670
|
Mr as AppropriatenessTestStep,
|
|
5689
|
-
|
|
5671
|
+
Ne as Badge,
|
|
5690
5672
|
Ot as BaseInformationService,
|
|
5691
5673
|
U as Button,
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5674
|
+
$ as Card,
|
|
5675
|
+
B as CardContent,
|
|
5676
|
+
ue as CardFooter,
|
|
5695
5677
|
oe as CardHeader,
|
|
5696
5678
|
ea as CreateApplicantForm,
|
|
5697
5679
|
Nt as CriteriaBuiltInType,
|
|
5698
5680
|
Ct as DEFAULT_VISIBLE_FIELDS,
|
|
5699
5681
|
vt as DocumentReviewStatus,
|
|
5700
5682
|
It as EndpointBuilder,
|
|
5701
|
-
|
|
5683
|
+
Me as ErrorHandler,
|
|
5702
5684
|
Ht as EventEmitter,
|
|
5703
|
-
|
|
5685
|
+
qe as FIELD_METADATA,
|
|
5704
5686
|
bt as FileType,
|
|
5705
5687
|
pr as FileUpload,
|
|
5706
|
-
|
|
5707
|
-
|
|
5688
|
+
_e as GenderType,
|
|
5689
|
+
We as Header,
|
|
5708
5690
|
Et as HttpClient,
|
|
5709
5691
|
De as IdentityProviderManager,
|
|
5710
5692
|
Tt as IdentityService,
|
|
5711
|
-
|
|
5693
|
+
ge as IdentityVerificationProvider,
|
|
5712
5694
|
Tr as IdentityVerificationStep,
|
|
5713
|
-
|
|
5695
|
+
de as Input,
|
|
5714
5696
|
$t as InvestorCategorizationService,
|
|
5715
5697
|
Lr as InvestorCategorizationStep,
|
|
5716
|
-
|
|
5698
|
+
me as InvestorCategorizationType,
|
|
5717
5699
|
St as InvestorCategoryType,
|
|
5718
5700
|
ft as KycProcessStatus,
|
|
5719
|
-
|
|
5701
|
+
Ie as KycStatus,
|
|
5720
5702
|
et as KycStatusDisplay,
|
|
5721
5703
|
ta as KycWorkflow,
|
|
5722
5704
|
Or as Logo,
|
|
@@ -5730,14 +5712,14 @@ export {
|
|
|
5730
5712
|
hr as PhoneInput,
|
|
5731
5713
|
Ft as QuestionnaireService,
|
|
5732
5714
|
Sr as QuestionnaireStep,
|
|
5733
|
-
|
|
5715
|
+
Ee as ReviewStatus,
|
|
5734
5716
|
wt as RiskCriteriaType,
|
|
5735
5717
|
gt as RiskLevel,
|
|
5736
5718
|
Mt as RiskScoringService,
|
|
5737
5719
|
Dr as RiskScoringStep,
|
|
5738
5720
|
Zt as SardinAIProvider,
|
|
5739
|
-
|
|
5740
|
-
|
|
5721
|
+
Ce as Select,
|
|
5722
|
+
fe as Spinner,
|
|
5741
5723
|
Yt as StepRouter,
|
|
5742
5724
|
Vt as SumsubProvider,
|
|
5743
5725
|
Jt as ThemeManager,
|
|
@@ -5746,9 +5728,9 @@ export {
|
|
|
5746
5728
|
Dt as UploadDocumentService,
|
|
5747
5729
|
Ar as UploadDocumentStep,
|
|
5748
5730
|
xt as UserType,
|
|
5749
|
-
|
|
5731
|
+
Se as ValueDataType,
|
|
5750
5732
|
Qt as WorkflowOrchestrator,
|
|
5751
|
-
|
|
5733
|
+
ze as WorkflowResultType,
|
|
5752
5734
|
Wt as WorkflowState,
|
|
5753
5735
|
_ as WorkflowStepAction,
|
|
5754
5736
|
ia as appropriatenessTestSchema,
|
|
@@ -5758,17 +5740,17 @@ export {
|
|
|
5758
5740
|
le as cn,
|
|
5759
5741
|
Bt as corporateTheme,
|
|
5760
5742
|
At as defaultConfig,
|
|
5761
|
-
|
|
5743
|
+
ce as defaultTheme,
|
|
5762
5744
|
Xt as fileToBase64,
|
|
5763
5745
|
zt as fintechTheme,
|
|
5764
|
-
|
|
5746
|
+
Ke as formatFileSize,
|
|
5765
5747
|
sa as generateAppropriatenessSchema,
|
|
5766
5748
|
ra as generateQuestionnaireSchema,
|
|
5767
5749
|
na as generateRiskScoringSchema,
|
|
5768
5750
|
aa as generateUploadDocumentSchema,
|
|
5769
5751
|
Gr as getAcceptString,
|
|
5770
5752
|
tr as getApplicantId,
|
|
5771
|
-
|
|
5753
|
+
Te as getThemePreset,
|
|
5772
5754
|
Zr as getWorkflowState,
|
|
5773
5755
|
_t as healthcareTheme,
|
|
5774
5756
|
Hr as isScriptLoaded,
|
|
@@ -5783,7 +5765,7 @@ export {
|
|
|
5783
5765
|
Xr as useAppropriatenessTest,
|
|
5784
5766
|
cr as useIdentityVerification,
|
|
5785
5767
|
sr as useKycWorkflow,
|
|
5786
|
-
|
|
5768
|
+
pe as useMetaKYC,
|
|
5787
5769
|
or as useOverview,
|
|
5788
5770
|
ir as useQuestionnaire,
|
|
5789
5771
|
dr as useRiskScoring,
|