@vpdev2/metakyc-sdk 1.0.30 → 1.0.32
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/components/core/MultiSelect.d.ts.map +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +987 -948
- package/dist/index.js.map +1 -1
- package/dist/services/theme.service.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/theme-manager.d.ts.map +1 -1
- package/dist/types/theme.d.ts +4 -1
- package/dist/types/theme.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
1
|
+
var Xe = Object.defineProperty;
|
|
2
|
+
var et = (t, e, r) => e in t ? Xe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var U = (t, e, r) => et(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import tt from "axios";
|
|
5
5
|
import * as Me from "react";
|
|
6
|
-
import
|
|
7
|
-
import { jsx as n, jsxs as o, Fragment as
|
|
8
|
-
import { get as
|
|
6
|
+
import re, { createContext as rt, useState as S, useMemo as Re, useEffect as Q, useContext as nt, useRef as Y, useCallback as V, forwardRef as Le } from "react";
|
|
7
|
+
import { jsx as n, jsxs as o, Fragment as at } from "react/jsx-runtime";
|
|
8
|
+
import { get as Fe, set as Ee, appendErrors as je, useForm as Te, Controller as te } from "react-hook-form";
|
|
9
9
|
import { z as me } from "zod";
|
|
10
|
-
var
|
|
11
|
-
const
|
|
10
|
+
var z = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(z || {}), Ne = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(Ne || {}), ce = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(ce || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(st || {}), it = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(it || {}), ye = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(ye || {}), fe = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(fe || {}), ot = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(ot || {}), lt = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(lt || {}), le = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(le || {}), ct = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(ct || {}), Se = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Se || {}), dt = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(ut || {}), mt = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(mt || {}), De = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(De || {}), ht = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(ht || {}), pt = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(pt || {}), ae = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(ae || {}), gt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(gt || {});
|
|
11
|
+
const yt = [
|
|
12
12
|
{ value: "EN", label: "English" },
|
|
13
13
|
{ value: "DE", label: "German" },
|
|
14
14
|
{ value: "FR", label: "French" },
|
|
@@ -26,7 +26,7 @@ const gt = [
|
|
|
26
26
|
{ value: "DA", label: "Danish" },
|
|
27
27
|
{ value: "FI", label: "Finnish" },
|
|
28
28
|
{ value: "NO", label: "Norwegian" }
|
|
29
|
-
],
|
|
29
|
+
], ft = [
|
|
30
30
|
"firstName",
|
|
31
31
|
"lastName",
|
|
32
32
|
"email",
|
|
@@ -64,7 +64,7 @@ const gt = [
|
|
|
64
64
|
"occupation",
|
|
65
65
|
"taxNumber",
|
|
66
66
|
"externalRefId"
|
|
67
|
-
],
|
|
67
|
+
], Oe = {
|
|
68
68
|
firstName: { label: "First Name", type: "text" },
|
|
69
69
|
lastName: { label: "Last Name", type: "text" },
|
|
70
70
|
title: { label: "Title", type: "text" },
|
|
@@ -89,7 +89,7 @@ const gt = [
|
|
|
89
89
|
taxNumber: { label: "Tax Number", type: "text" },
|
|
90
90
|
externalRefId: { label: "External Reference ID", type: "text" }
|
|
91
91
|
};
|
|
92
|
-
var
|
|
92
|
+
var Z = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(Z || {});
|
|
93
93
|
const bt = {
|
|
94
94
|
timeout: 3e4,
|
|
95
95
|
retries: 3,
|
|
@@ -141,7 +141,7 @@ class vt {
|
|
|
141
141
|
class ue extends Error {
|
|
142
142
|
constructor(r, a, s, i, l) {
|
|
143
143
|
super(r);
|
|
144
|
-
|
|
144
|
+
U(this, "response");
|
|
145
145
|
this.code = a, this.details = s, this.validationErrors = i, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this, ue.prototype);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -197,10 +197,10 @@ class xe {
|
|
|
197
197
|
}
|
|
198
198
|
class xt {
|
|
199
199
|
constructor(e) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
this.config = { ...bt, ...e }, this.endpointBuilder = new vt(this.config.endpoints), this.axiosInstance =
|
|
200
|
+
U(this, "axiosInstance");
|
|
201
|
+
U(this, "endpointBuilder");
|
|
202
|
+
U(this, "config");
|
|
203
|
+
this.config = { ...bt, ...e }, this.endpointBuilder = new vt(this.config.endpoints), this.axiosInstance = tt.create({
|
|
204
204
|
baseURL: this.config.baseUrl,
|
|
205
205
|
timeout: this.config.timeout,
|
|
206
206
|
headers: {
|
|
@@ -664,7 +664,7 @@ class Rt {
|
|
|
664
664
|
)).result;
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
|
-
const
|
|
667
|
+
const ee = {
|
|
668
668
|
name: "Default",
|
|
669
669
|
title: "KYC Verification",
|
|
670
670
|
logo: {
|
|
@@ -723,7 +723,7 @@ const J = {
|
|
|
723
723
|
textMuted: "#9ca3af"
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
},
|
|
726
|
+
}, Ft = {
|
|
727
727
|
name: "Corporate",
|
|
728
728
|
logo: {
|
|
729
729
|
url: "",
|
|
@@ -756,7 +756,7 @@ const J = {
|
|
|
756
756
|
cardPadding: "1.5rem",
|
|
757
757
|
inputHeight: "2.5rem"
|
|
758
758
|
}
|
|
759
|
-
},
|
|
759
|
+
}, Dt = {
|
|
760
760
|
name: "Fintech",
|
|
761
761
|
logo: {
|
|
762
762
|
url: "",
|
|
@@ -789,7 +789,7 @@ const J = {
|
|
|
789
789
|
cardPadding: "2rem",
|
|
790
790
|
inputHeight: "3rem"
|
|
791
791
|
}
|
|
792
|
-
},
|
|
792
|
+
}, Pt = {
|
|
793
793
|
name: "Healthcare",
|
|
794
794
|
logo: {
|
|
795
795
|
url: "",
|
|
@@ -898,15 +898,15 @@ const J = {
|
|
|
898
898
|
inputHeight: "2.25rem"
|
|
899
899
|
}
|
|
900
900
|
}, Mt = {
|
|
901
|
-
[
|
|
902
|
-
[
|
|
903
|
-
[
|
|
904
|
-
[
|
|
905
|
-
[
|
|
906
|
-
[
|
|
901
|
+
[Z.Default]: ee,
|
|
902
|
+
[Z.Corporate]: Ft,
|
|
903
|
+
[Z.Fintech]: Dt,
|
|
904
|
+
[Z.Healthcare]: Pt,
|
|
905
|
+
[Z.Modern]: Lt,
|
|
906
|
+
[Z.Minimal]: Tt
|
|
907
907
|
};
|
|
908
908
|
function we(t) {
|
|
909
|
-
return Mt[t] ||
|
|
909
|
+
return Mt[t] || ee;
|
|
910
910
|
}
|
|
911
911
|
class Ot {
|
|
912
912
|
constructor(e) {
|
|
@@ -923,16 +923,16 @@ class Ot {
|
|
|
923
923
|
"GetThemeConfiguration"
|
|
924
924
|
);
|
|
925
925
|
if (!r.result.isEnabled)
|
|
926
|
-
return we(
|
|
927
|
-
let a = r.result.preset ? we(r.result.preset) : we(
|
|
926
|
+
return we(Z.Default);
|
|
927
|
+
let a = r.result.preset ? we(r.result.preset) : we(Z.Default);
|
|
928
928
|
return r.result.title && (a.title = r.result.title), r.result.logo && (a.logo = { ...a.logo, ...r.result.logo }), r.result.colors && (a.colors = { ...a.colors, ...r.result.colors }), r.result.typography && (a.typography = { ...a.typography, ...r.result.typography }), r.result.spacing && (a.spacing = { ...a.spacing, ...r.result.spacing }), r.result.customCSS && (a.customCSS = r.result.customCSS), r.result.darkMode && (a.darkMode = {
|
|
929
929
|
colors: {
|
|
930
930
|
...(e = a.darkMode) == null ? void 0 : e.colors,
|
|
931
931
|
...r.result.darkMode.colors
|
|
932
932
|
}
|
|
933
|
-
}), r.result.applicantFormVisibleFields && r.result.applicantFormVisibleFields.length > 0 && (a.applicantFormVisibleFields = r.result.applicantFormVisibleFields), a;
|
|
933
|
+
}), r.result.applicantFormVisibleFields && r.result.applicantFormVisibleFields.length > 0 && (a.applicantFormVisibleFields = r.result.applicantFormVisibleFields), r.result.applicantFormRequiredFields && r.result.applicantFormRequiredFields.length > 0 && (a.applicantFormRequiredFields = r.result.applicantFormRequiredFields), a;
|
|
934
934
|
} catch (r) {
|
|
935
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), we(
|
|
935
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), we(Z.Default);
|
|
936
936
|
}
|
|
937
937
|
}
|
|
938
938
|
/**
|
|
@@ -946,12 +946,12 @@ class Ot {
|
|
|
946
946
|
*/
|
|
947
947
|
getAvailablePresets() {
|
|
948
948
|
return [
|
|
949
|
-
{ id:
|
|
950
|
-
{ id:
|
|
951
|
-
{ id:
|
|
952
|
-
{ id:
|
|
953
|
-
{ id:
|
|
954
|
-
{ id:
|
|
949
|
+
{ id: Z.Default, name: "Default" },
|
|
950
|
+
{ id: Z.Corporate, name: "Corporate" },
|
|
951
|
+
{ id: Z.Fintech, name: "Fintech" },
|
|
952
|
+
{ id: Z.Healthcare, name: "Healthcare" },
|
|
953
|
+
{ id: Z.Modern, name: "Modern" },
|
|
954
|
+
{ id: Z.Minimal, name: "Minimal" }
|
|
955
955
|
];
|
|
956
956
|
}
|
|
957
957
|
/**
|
|
@@ -971,7 +971,7 @@ class Ot {
|
|
|
971
971
|
}
|
|
972
972
|
class Bt {
|
|
973
973
|
constructor() {
|
|
974
|
-
|
|
974
|
+
U(this, "listeners", /* @__PURE__ */ new Map());
|
|
975
975
|
}
|
|
976
976
|
/**
|
|
977
977
|
* Subscribe to an event
|
|
@@ -1016,10 +1016,10 @@ class Bt {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
class zt {
|
|
1018
1018
|
constructor() {
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1019
|
+
U(this, "events", new Bt());
|
|
1020
|
+
U(this, "_applicantId", null);
|
|
1021
|
+
U(this, "_progress", null);
|
|
1022
|
+
U(this, "_error", null);
|
|
1023
1023
|
}
|
|
1024
1024
|
/**
|
|
1025
1025
|
* Get current applicant ID
|
|
@@ -1156,7 +1156,7 @@ class zt {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
class $t {
|
|
1158
1158
|
constructor() {
|
|
1159
|
-
|
|
1159
|
+
U(this, "handlers", /* @__PURE__ */ new Map());
|
|
1160
1160
|
}
|
|
1161
1161
|
/**
|
|
1162
1162
|
* Register a step handler
|
|
@@ -1182,7 +1182,7 @@ class $t {
|
|
|
1182
1182
|
async loadStepData(e, r) {
|
|
1183
1183
|
const a = this.getHandler(e);
|
|
1184
1184
|
if (!a)
|
|
1185
|
-
throw new Error(`No handler registered for step action: ${
|
|
1185
|
+
throw new Error(`No handler registered for step action: ${z[e]}`);
|
|
1186
1186
|
return a.loadData(r);
|
|
1187
1187
|
}
|
|
1188
1188
|
/**
|
|
@@ -1191,61 +1191,61 @@ class $t {
|
|
|
1191
1191
|
async submitStepData(e, r) {
|
|
1192
1192
|
const a = this.getHandler(e);
|
|
1193
1193
|
if (!a)
|
|
1194
|
-
throw new Error(`No handler registered for step action: ${
|
|
1194
|
+
throw new Error(`No handler registered for step action: ${z[e]}`);
|
|
1195
1195
|
return a.submitData(r);
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
|
-
class
|
|
1198
|
+
class qt {
|
|
1199
1199
|
constructor(e, r, a, s, i, l, c, d) {
|
|
1200
|
-
|
|
1201
|
-
|
|
1200
|
+
U(this, "state");
|
|
1201
|
+
U(this, "stepRouter");
|
|
1202
1202
|
this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService = a, this.appropriatenessTestService = s, this.overviewService = i, this.riskScoringService = l, this.investorCategorizationService = d, this.state = new zt(), this.stepRouter = new $t(), this.registerStepHandlers();
|
|
1203
1203
|
}
|
|
1204
1204
|
/**
|
|
1205
1205
|
* Register all step handlers
|
|
1206
1206
|
*/
|
|
1207
1207
|
registerStepHandlers() {
|
|
1208
|
-
this.stepRouter.registerHandler(
|
|
1208
|
+
this.stepRouter.registerHandler(z.Questionaries, {
|
|
1209
1209
|
loadData: (e) => this.questionnaireService.getQuestionnaire(e),
|
|
1210
1210
|
submitData: async (e) => {
|
|
1211
1211
|
await this.questionnaireService.fillQuestionnaire(e);
|
|
1212
1212
|
}
|
|
1213
|
-
}), this.stepRouter.registerHandler(
|
|
1213
|
+
}), this.stepRouter.registerHandler(z.UploadDocument, {
|
|
1214
1214
|
loadData: (e) => this.uploadDocumentService.getUploadDocument(e),
|
|
1215
1215
|
submitData: (e) => this.uploadDocumentService.fillUploadDocument(e)
|
|
1216
|
-
}), this.stepRouter.registerHandler(
|
|
1216
|
+
}), this.stepRouter.registerHandler(z.AppropriatenessTest, {
|
|
1217
1217
|
loadData: (e) => this.appropriatenessTestService.getAppropriatenessTest(e),
|
|
1218
1218
|
submitData: async (e) => {
|
|
1219
1219
|
await this.appropriatenessTestService.fillAppropriatenessTest(e);
|
|
1220
1220
|
}
|
|
1221
|
-
}), this.stepRouter.registerHandler(
|
|
1221
|
+
}), this.stepRouter.registerHandler(z.Overview, {
|
|
1222
1222
|
loadData: (e) => this.overviewService.getOverviewData(e),
|
|
1223
1223
|
submitData: (e) => this.overviewService.passOverview(e.applicantId)
|
|
1224
|
-
}), this.stepRouter.registerHandler(
|
|
1224
|
+
}), this.stepRouter.registerHandler(z.RiskScoring, {
|
|
1225
1225
|
loadData: (e) => this.riskScoringService.getRiskCriterias(e),
|
|
1226
1226
|
submitData: async (e) => {
|
|
1227
1227
|
await this.riskScoringService.submitRiskScoring(e);
|
|
1228
1228
|
}
|
|
1229
|
-
}), this.stepRouter.registerHandler(
|
|
1229
|
+
}), this.stepRouter.registerHandler(z.IdentitySdk, {
|
|
1230
1230
|
loadData: async (e) => ({
|
|
1231
1231
|
applicantId: e,
|
|
1232
1232
|
message: "Identity verification required"
|
|
1233
1233
|
}),
|
|
1234
1234
|
submitData: async () => {
|
|
1235
1235
|
}
|
|
1236
|
-
}), this.stepRouter.registerHandler(
|
|
1236
|
+
}), this.stepRouter.registerHandler(z.InvestorCategorization, {
|
|
1237
1237
|
loadData: (e) => this.investorCategorizationService.getInvestorCategorization(e),
|
|
1238
1238
|
submitData: async (e) => {
|
|
1239
1239
|
await this.investorCategorizationService.setInvestorCategorization(e);
|
|
1240
1240
|
}
|
|
1241
|
-
}), this.stepRouter.registerHandler(
|
|
1241
|
+
}), this.stepRouter.registerHandler(z.ManualReview, {
|
|
1242
1242
|
loadData: async (e) => ({
|
|
1243
1243
|
applicantId: e,
|
|
1244
1244
|
message: "Your application is under manual review"
|
|
1245
1245
|
}),
|
|
1246
1246
|
submitData: async () => {
|
|
1247
1247
|
}
|
|
1248
|
-
}), this.stepRouter.registerHandler(
|
|
1248
|
+
}), this.stepRouter.registerHandler(z.AdditionalData, {
|
|
1249
1249
|
loadData: async (e) => ({
|
|
1250
1250
|
applicantId: e,
|
|
1251
1251
|
message: "Additional data required"
|
|
@@ -1356,10 +1356,10 @@ function zr(t) {
|
|
|
1356
1356
|
const e = document.getElementById(t);
|
|
1357
1357
|
e && e.remove();
|
|
1358
1358
|
}
|
|
1359
|
-
class
|
|
1359
|
+
class _t {
|
|
1360
1360
|
constructor(e) {
|
|
1361
|
-
|
|
1362
|
-
|
|
1361
|
+
U(this, "sdk", null);
|
|
1362
|
+
U(this, "config");
|
|
1363
1363
|
this.config = e;
|
|
1364
1364
|
}
|
|
1365
1365
|
/**
|
|
@@ -1411,10 +1411,10 @@ class jt {
|
|
|
1411
1411
|
this.sdk && this.sdk.on("idCheck.onError", e);
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
|
-
class
|
|
1414
|
+
class jt {
|
|
1415
1415
|
constructor(e) {
|
|
1416
|
-
|
|
1417
|
-
|
|
1416
|
+
U(this, "sdk", null);
|
|
1417
|
+
U(this, "config");
|
|
1418
1418
|
this.config = e;
|
|
1419
1419
|
}
|
|
1420
1420
|
/**
|
|
@@ -1477,11 +1477,11 @@ class Ut {
|
|
|
1477
1477
|
this.sdk && (this.sdk.tearDown(), this.sdk = null);
|
|
1478
1478
|
}
|
|
1479
1479
|
}
|
|
1480
|
-
class
|
|
1480
|
+
class Ut {
|
|
1481
1481
|
constructor(e) {
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1482
|
+
U(this, "sardineContext", null);
|
|
1483
|
+
U(this, "config");
|
|
1484
|
+
U(this, "sessionKey");
|
|
1485
1485
|
this.config = e, this.sessionKey = e.sessionKey || this.generateSessionKey();
|
|
1486
1486
|
}
|
|
1487
1487
|
/**
|
|
@@ -1628,11 +1628,11 @@ class be {
|
|
|
1628
1628
|
static createProvider(e, r) {
|
|
1629
1629
|
switch (e) {
|
|
1630
1630
|
case le.Sumsub:
|
|
1631
|
-
return new
|
|
1631
|
+
return new _t(r);
|
|
1632
1632
|
case le.Onfido:
|
|
1633
|
-
return new
|
|
1633
|
+
return new jt(r);
|
|
1634
1634
|
case le.SardinAI:
|
|
1635
|
-
return new
|
|
1635
|
+
return new Ut(r);
|
|
1636
1636
|
default:
|
|
1637
1637
|
throw new Error(`Unsupported identity provider: ${e}`);
|
|
1638
1638
|
}
|
|
@@ -1673,9 +1673,9 @@ class be {
|
|
|
1673
1673
|
}
|
|
1674
1674
|
class Kt {
|
|
1675
1675
|
constructor(e) {
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1676
|
+
U(this, "currentTheme", ee);
|
|
1677
|
+
U(this, "customStyleElement", null);
|
|
1678
|
+
U(this, "container");
|
|
1679
1679
|
this.container = e || document.documentElement;
|
|
1680
1680
|
}
|
|
1681
1681
|
/**
|
|
@@ -1753,20 +1753,21 @@ class Kt {
|
|
|
1753
1753
|
mergeWithDefault(e) {
|
|
1754
1754
|
var r;
|
|
1755
1755
|
return {
|
|
1756
|
-
name: e.name ||
|
|
1757
|
-
title: e.title ||
|
|
1758
|
-
logo: { ...
|
|
1759
|
-
colors: { ...
|
|
1760
|
-
typography: e.typography ? { ...
|
|
1761
|
-
spacing: e.spacing ? { ...
|
|
1756
|
+
name: e.name || ee.name,
|
|
1757
|
+
title: e.title || ee.title,
|
|
1758
|
+
logo: { ...ee.logo, ...e.logo },
|
|
1759
|
+
colors: { ...ee.colors, ...e.colors },
|
|
1760
|
+
typography: e.typography ? { ...ee.typography, ...e.typography } : ee.typography,
|
|
1761
|
+
spacing: e.spacing ? { ...ee.spacing, ...e.spacing } : ee.spacing,
|
|
1762
1762
|
customCSS: e.customCSS,
|
|
1763
1763
|
darkMode: e.darkMode ? {
|
|
1764
1764
|
colors: {
|
|
1765
|
-
...(r =
|
|
1765
|
+
...(r = ee.darkMode) == null ? void 0 : r.colors,
|
|
1766
1766
|
...e.darkMode.colors
|
|
1767
1767
|
}
|
|
1768
|
-
} :
|
|
1769
|
-
applicantFormVisibleFields: e.applicantFormVisibleFields
|
|
1768
|
+
} : ee.darkMode,
|
|
1769
|
+
applicantFormVisibleFields: e.applicantFormVisibleFields,
|
|
1770
|
+
applicantFormRequiredFields: e.applicantFormRequiredFields
|
|
1770
1771
|
};
|
|
1771
1772
|
}
|
|
1772
1773
|
/**
|
|
@@ -1779,7 +1780,7 @@ class Kt {
|
|
|
1779
1780
|
* Reset to default theme
|
|
1780
1781
|
*/
|
|
1781
1782
|
resetTheme() {
|
|
1782
|
-
this.applyTheme(
|
|
1783
|
+
this.applyTheme(ee);
|
|
1783
1784
|
}
|
|
1784
1785
|
/**
|
|
1785
1786
|
* Remove all custom styles
|
|
@@ -1794,28 +1795,28 @@ class Kt {
|
|
|
1794
1795
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1795
1796
|
}
|
|
1796
1797
|
}
|
|
1797
|
-
const
|
|
1798
|
-
const [r, a] =
|
|
1799
|
-
const d = new xt(t), u = new wt(d), y = new kt(d),
|
|
1798
|
+
const Ke = rt(null), $r = ({ config: t, children: e }) => {
|
|
1799
|
+
const [r, a] = S(null), s = re.useRef(!1), i = re.useRef(!1), l = Re(() => {
|
|
1800
|
+
const d = new xt(t), u = new wt(d), y = new kt(d), v = new Nt(d), g = new St(d), w = new Ct(d), h = new At(d), x = new Et(d), p = new It(d), m = new Rt(d), A = new Ot(d), C = new Kt();
|
|
1800
1801
|
return {
|
|
1801
1802
|
httpClient: d,
|
|
1802
1803
|
applicantService: u,
|
|
1803
1804
|
questionnaireService: y,
|
|
1804
|
-
uploadDocumentService:
|
|
1805
|
+
uploadDocumentService: v,
|
|
1805
1806
|
appropriatenessTestService: g,
|
|
1806
|
-
overviewService:
|
|
1807
|
+
overviewService: w,
|
|
1807
1808
|
riskScoringService: h,
|
|
1808
|
-
identityService:
|
|
1809
|
+
identityService: x,
|
|
1809
1810
|
baseInformationService: p,
|
|
1810
1811
|
investorCategorizationService: m,
|
|
1811
1812
|
themeService: A,
|
|
1812
|
-
themeManager:
|
|
1813
|
+
themeManager: C
|
|
1813
1814
|
};
|
|
1814
1815
|
}, [t]), c = Re(() => ({
|
|
1815
1816
|
config: t,
|
|
1816
1817
|
...l,
|
|
1817
1818
|
currentTheme: r,
|
|
1818
|
-
createOrchestrator: () => new
|
|
1819
|
+
createOrchestrator: () => new qt(
|
|
1819
1820
|
l.applicantService,
|
|
1820
1821
|
l.questionnaireService,
|
|
1821
1822
|
l.uploadDocumentService,
|
|
@@ -1826,7 +1827,7 @@ const qe = tt(null), $r = ({ config: t, children: e }) => {
|
|
|
1826
1827
|
l.investorCategorizationService
|
|
1827
1828
|
)
|
|
1828
1829
|
}), [t, l, r]);
|
|
1829
|
-
return
|
|
1830
|
+
return Q(() => ((async () => {
|
|
1830
1831
|
if (s.current || i.current) {
|
|
1831
1832
|
console.log("[MetaKYC] Theme already loading or loaded, skipping...");
|
|
1832
1833
|
return;
|
|
@@ -1847,10 +1848,10 @@ const qe = tt(null), $r = ({ config: t, children: e }) => {
|
|
|
1847
1848
|
}
|
|
1848
1849
|
})(), () => {
|
|
1849
1850
|
l.themeManager.cleanup();
|
|
1850
|
-
}), []), /* @__PURE__ */ n(
|
|
1851
|
+
}), []), /* @__PURE__ */ n(Ke.Provider, { value: c, children: e });
|
|
1851
1852
|
};
|
|
1852
|
-
function
|
|
1853
|
-
const t =
|
|
1853
|
+
function oe() {
|
|
1854
|
+
const t = nt(Ke);
|
|
1854
1855
|
if (!t)
|
|
1855
1856
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
1856
1857
|
return t;
|
|
@@ -1864,10 +1865,10 @@ async function Ht(t) {
|
|
|
1864
1865
|
}, a.onerror = (s) => r(s);
|
|
1865
1866
|
});
|
|
1866
1867
|
}
|
|
1867
|
-
function
|
|
1868
|
+
function qr(t, e) {
|
|
1868
1869
|
return t.size <= e;
|
|
1869
1870
|
}
|
|
1870
|
-
function
|
|
1871
|
+
function _r(t, e) {
|
|
1871
1872
|
return e.split(",").map((a) => a.trim()).some((a) => {
|
|
1872
1873
|
if (a.endsWith("/*")) {
|
|
1873
1874
|
const s = a.slice(0, -2);
|
|
@@ -1881,10 +1882,10 @@ function Ie(t) {
|
|
|
1881
1882
|
const e = 1024, r = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(t) / Math.log(e));
|
|
1882
1883
|
return Math.round(t / Math.pow(e, a) * 100) / 100 + " " + r[a];
|
|
1883
1884
|
}
|
|
1884
|
-
function
|
|
1885
|
+
function jr(t) {
|
|
1885
1886
|
return t;
|
|
1886
1887
|
}
|
|
1887
|
-
function
|
|
1888
|
+
function J(...t) {
|
|
1888
1889
|
return t.filter(Boolean).join(" ");
|
|
1889
1890
|
}
|
|
1890
1891
|
const ve = {
|
|
@@ -1920,7 +1921,7 @@ function Qt(t) {
|
|
|
1920
1921
|
console.warn("Failed to save workflow state to storage:", e);
|
|
1921
1922
|
}
|
|
1922
1923
|
}
|
|
1923
|
-
function
|
|
1924
|
+
function Ur() {
|
|
1924
1925
|
try {
|
|
1925
1926
|
const t = localStorage.getItem(ve.WORKFLOW_STATE);
|
|
1926
1927
|
return t ? JSON.parse(t) : null;
|
|
@@ -1939,21 +1940,21 @@ function Kr() {
|
|
|
1939
1940
|
Wt(), Gt();
|
|
1940
1941
|
}
|
|
1941
1942
|
function Zt(t) {
|
|
1942
|
-
const { createOrchestrator: e } =
|
|
1943
|
-
|
|
1943
|
+
const { createOrchestrator: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(null), d = Y(null), u = t || Yt();
|
|
1944
|
+
Q(() => {
|
|
1944
1945
|
d.current || (d.current = e());
|
|
1945
|
-
}, [e]),
|
|
1946
|
-
var
|
|
1946
|
+
}, [e]), Q(() => {
|
|
1947
|
+
var C;
|
|
1947
1948
|
r && u && (Vt(u), Qt({
|
|
1948
1949
|
applicantId: u,
|
|
1949
|
-
currentStepOrder: (
|
|
1950
|
+
currentStepOrder: (C = r.currentStep) == null ? void 0 : C.order,
|
|
1950
1951
|
status: r.status,
|
|
1951
1952
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1952
1953
|
workflowKey: r.workFlowKey,
|
|
1953
1954
|
nextWorkflowKey: r.nextWorkflowKey
|
|
1954
1955
|
}));
|
|
1955
1956
|
}, [r, u]);
|
|
1956
|
-
const y =
|
|
1957
|
+
const y = Y(!1), v = Y(!1), g = V(async () => {
|
|
1957
1958
|
if (!(!u || !d.current)) {
|
|
1958
1959
|
if (y.current) {
|
|
1959
1960
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
@@ -1961,19 +1962,19 @@ function Zt(t) {
|
|
|
1961
1962
|
}
|
|
1962
1963
|
y.current = !0, i(!0), c(null);
|
|
1963
1964
|
try {
|
|
1964
|
-
const
|
|
1965
|
-
a(
|
|
1966
|
-
} catch (
|
|
1967
|
-
c(
|
|
1965
|
+
const C = await d.current.initialize(u);
|
|
1966
|
+
a(C), v.current = !0;
|
|
1967
|
+
} catch (C) {
|
|
1968
|
+
c(C);
|
|
1968
1969
|
} finally {
|
|
1969
1970
|
i(!1), y.current = !1;
|
|
1970
1971
|
}
|
|
1971
1972
|
}
|
|
1972
1973
|
}, [u]);
|
|
1973
|
-
|
|
1974
|
-
u && !
|
|
1974
|
+
Q(() => {
|
|
1975
|
+
u && !v.current && g();
|
|
1975
1976
|
}, [u, g]);
|
|
1976
|
-
const
|
|
1977
|
+
const w = V(async () => {
|
|
1977
1978
|
if (d.current) {
|
|
1978
1979
|
if (y.current) {
|
|
1979
1980
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
@@ -1981,52 +1982,52 @@ function Zt(t) {
|
|
|
1981
1982
|
}
|
|
1982
1983
|
y.current = !0, i(!0), c(null);
|
|
1983
1984
|
try {
|
|
1984
|
-
const
|
|
1985
|
-
a(
|
|
1986
|
-
} catch (
|
|
1987
|
-
c(
|
|
1985
|
+
const C = await d.current.refreshProgress();
|
|
1986
|
+
a(C);
|
|
1987
|
+
} catch (C) {
|
|
1988
|
+
c(C);
|
|
1988
1989
|
} finally {
|
|
1989
1990
|
i(!1), y.current = !1;
|
|
1990
1991
|
}
|
|
1991
1992
|
}
|
|
1992
|
-
}, []), h =
|
|
1993
|
+
}, []), h = V(async () => {
|
|
1993
1994
|
if (d.current) {
|
|
1994
1995
|
i(!0), c(null);
|
|
1995
1996
|
try {
|
|
1996
|
-
const
|
|
1997
|
-
a(
|
|
1998
|
-
} catch (
|
|
1999
|
-
c(
|
|
1997
|
+
const C = await d.current.moveToNextStep();
|
|
1998
|
+
a(C);
|
|
1999
|
+
} catch (C) {
|
|
2000
|
+
c(C);
|
|
2000
2001
|
} finally {
|
|
2001
2002
|
i(!1);
|
|
2002
2003
|
}
|
|
2003
2004
|
}
|
|
2004
|
-
}, []),
|
|
2005
|
+
}, []), x = V(async () => {
|
|
2005
2006
|
if (d.current) {
|
|
2006
2007
|
i(!0), c(null);
|
|
2007
2008
|
try {
|
|
2008
|
-
const
|
|
2009
|
-
a(
|
|
2010
|
-
} catch (
|
|
2011
|
-
c(
|
|
2009
|
+
const C = await d.current.moveToPreviousStep();
|
|
2010
|
+
a(C);
|
|
2011
|
+
} catch (C) {
|
|
2012
|
+
c(C);
|
|
2012
2013
|
} finally {
|
|
2013
2014
|
i(!1);
|
|
2014
2015
|
}
|
|
2015
2016
|
}
|
|
2016
|
-
}, []), p =
|
|
2017
|
+
}, []), p = V(async (C) => {
|
|
2017
2018
|
if (d.current) {
|
|
2018
2019
|
i(!0), c(null);
|
|
2019
2020
|
try {
|
|
2020
|
-
await d.current.submitCurrentStep(
|
|
2021
|
-
const
|
|
2022
|
-
a(
|
|
2023
|
-
} catch (
|
|
2024
|
-
throw c(
|
|
2021
|
+
await d.current.submitCurrentStep(C);
|
|
2022
|
+
const N = await d.current.refreshProgress();
|
|
2023
|
+
a(N);
|
|
2024
|
+
} catch (N) {
|
|
2025
|
+
throw c(N), N;
|
|
2025
2026
|
} finally {
|
|
2026
2027
|
i(!1);
|
|
2027
2028
|
}
|
|
2028
2029
|
}
|
|
2029
|
-
}, []), m = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((
|
|
2030
|
+
}, []), m = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((C, N) => C.order - N.order) : [], [r == null ? void 0 : r.stepInfoList]), A = Me.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2030
2031
|
return {
|
|
2031
2032
|
progress: r,
|
|
2032
2033
|
applicantId: u,
|
|
@@ -2041,15 +2042,15 @@ function Zt(t) {
|
|
|
2041
2042
|
error: l,
|
|
2042
2043
|
isComplete: (r == null ? void 0 : r.status) === ce.Finished,
|
|
2043
2044
|
isOnHold: (r == null ? void 0 : r.status) === ce.OnHold,
|
|
2044
|
-
refreshProgress:
|
|
2045
|
+
refreshProgress: w,
|
|
2045
2046
|
moveToNext: h,
|
|
2046
|
-
moveBack:
|
|
2047
|
+
moveBack: x,
|
|
2047
2048
|
submitCurrentStep: p,
|
|
2048
2049
|
orchestrator: d.current
|
|
2049
2050
|
};
|
|
2050
2051
|
}
|
|
2051
2052
|
function Jt(t) {
|
|
2052
|
-
const { questionnaireService: e } =
|
|
2053
|
+
const { questionnaireService: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(!1), [d, u] = S(null), y = Y(!1), v = Y(null), g = V(async () => {
|
|
2053
2054
|
if (t) {
|
|
2054
2055
|
if (y.current) {
|
|
2055
2056
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
@@ -2058,7 +2059,7 @@ function Jt(t) {
|
|
|
2058
2059
|
y.current = !0, i(!0), u(null);
|
|
2059
2060
|
try {
|
|
2060
2061
|
const h = await e.getQuestionnaire(t);
|
|
2061
|
-
a(h),
|
|
2062
|
+
a(h), v.current = t;
|
|
2062
2063
|
} catch (h) {
|
|
2063
2064
|
u(h);
|
|
2064
2065
|
} finally {
|
|
@@ -2066,16 +2067,16 @@ function Jt(t) {
|
|
|
2066
2067
|
}
|
|
2067
2068
|
}
|
|
2068
2069
|
}, [t, e]);
|
|
2069
|
-
|
|
2070
|
-
t &&
|
|
2070
|
+
Q(() => {
|
|
2071
|
+
t && v.current !== t && g();
|
|
2071
2072
|
}, [t]);
|
|
2072
|
-
const
|
|
2073
|
+
const w = V(
|
|
2073
2074
|
async (h) => {
|
|
2074
2075
|
c(!0), u(null);
|
|
2075
2076
|
try {
|
|
2076
2077
|
return await e.fillQuestionnaire(h);
|
|
2077
|
-
} catch (
|
|
2078
|
-
throw u(
|
|
2078
|
+
} catch (x) {
|
|
2079
|
+
throw u(x), x;
|
|
2079
2080
|
} finally {
|
|
2080
2081
|
c(!1);
|
|
2081
2082
|
}
|
|
@@ -2088,37 +2089,37 @@ function Jt(t) {
|
|
|
2088
2089
|
isSubmitting: l,
|
|
2089
2090
|
error: d,
|
|
2090
2091
|
load: g,
|
|
2091
|
-
submit:
|
|
2092
|
+
submit: w
|
|
2092
2093
|
};
|
|
2093
2094
|
}
|
|
2094
2095
|
function Xt(t) {
|
|
2095
|
-
const { uploadDocumentService: e } =
|
|
2096
|
+
const { uploadDocumentService: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(!1), [d, u] = S(0), [y, v] = S(null), g = Y(!1), w = Y(null), h = V(async () => {
|
|
2096
2097
|
if (t) {
|
|
2097
2098
|
if (g.current) {
|
|
2098
2099
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2099
2100
|
return;
|
|
2100
2101
|
}
|
|
2101
|
-
g.current = !0, i(!0),
|
|
2102
|
+
g.current = !0, i(!0), v(null);
|
|
2102
2103
|
try {
|
|
2103
2104
|
const p = await e.getUploadDocument(t);
|
|
2104
|
-
a(p),
|
|
2105
|
+
a(p), w.current = t;
|
|
2105
2106
|
} catch (p) {
|
|
2106
|
-
|
|
2107
|
+
v(p);
|
|
2107
2108
|
} finally {
|
|
2108
2109
|
i(!1), g.current = !1;
|
|
2109
2110
|
}
|
|
2110
2111
|
}
|
|
2111
2112
|
}, [t, e]);
|
|
2112
|
-
|
|
2113
|
-
t &&
|
|
2113
|
+
Q(() => {
|
|
2114
|
+
t && w.current !== t && h();
|
|
2114
2115
|
}, [t]);
|
|
2115
|
-
const
|
|
2116
|
+
const x = V(
|
|
2116
2117
|
async (p) => {
|
|
2117
|
-
c(!0), u(0),
|
|
2118
|
+
c(!0), u(0), v(null);
|
|
2118
2119
|
try {
|
|
2119
2120
|
await e.fillUploadDocument(p), u(100);
|
|
2120
2121
|
} catch (m) {
|
|
2121
|
-
throw
|
|
2122
|
+
throw v(m), m;
|
|
2122
2123
|
} finally {
|
|
2123
2124
|
c(!1);
|
|
2124
2125
|
}
|
|
@@ -2132,11 +2133,11 @@ function Xt(t) {
|
|
|
2132
2133
|
uploadProgress: d,
|
|
2133
2134
|
error: y,
|
|
2134
2135
|
load: h,
|
|
2135
|
-
submit:
|
|
2136
|
+
submit: x
|
|
2136
2137
|
};
|
|
2137
2138
|
}
|
|
2138
2139
|
function Hr(t) {
|
|
2139
|
-
const { appropriatenessTestService: e } =
|
|
2140
|
+
const { appropriatenessTestService: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(!1), [d, u] = S(null), [y, v] = S(null), g = Y(!1), w = Y(null), h = V(async () => {
|
|
2140
2141
|
if (t) {
|
|
2141
2142
|
if (g.current) {
|
|
2142
2143
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
@@ -2145,7 +2146,7 @@ function Hr(t) {
|
|
|
2145
2146
|
g.current = !0, i(!0), u(null);
|
|
2146
2147
|
try {
|
|
2147
2148
|
const p = await e.getAppropriatenessTest(t);
|
|
2148
|
-
a(p),
|
|
2149
|
+
a(p), w.current = t;
|
|
2149
2150
|
} catch (p) {
|
|
2150
2151
|
u(p);
|
|
2151
2152
|
} finally {
|
|
@@ -2153,15 +2154,15 @@ function Hr(t) {
|
|
|
2153
2154
|
}
|
|
2154
2155
|
}
|
|
2155
2156
|
}, [t, e]);
|
|
2156
|
-
|
|
2157
|
-
t &&
|
|
2157
|
+
Q(() => {
|
|
2158
|
+
t && w.current !== t && h();
|
|
2158
2159
|
}, [t]);
|
|
2159
|
-
const
|
|
2160
|
+
const x = V(
|
|
2160
2161
|
async (p) => {
|
|
2161
2162
|
c(!0), u(null);
|
|
2162
2163
|
try {
|
|
2163
2164
|
const m = await e.fillAppropriatenessTest(p);
|
|
2164
|
-
return
|
|
2165
|
+
return v(m), m;
|
|
2165
2166
|
} catch (m) {
|
|
2166
2167
|
throw u(m), m;
|
|
2167
2168
|
} finally {
|
|
@@ -2177,11 +2178,11 @@ function Hr(t) {
|
|
|
2177
2178
|
isSubmitting: l,
|
|
2178
2179
|
error: d,
|
|
2179
2180
|
load: h,
|
|
2180
|
-
submit:
|
|
2181
|
+
submit: x
|
|
2181
2182
|
};
|
|
2182
2183
|
}
|
|
2183
2184
|
function er(t) {
|
|
2184
|
-
const { overviewService: e } =
|
|
2185
|
+
const { overviewService: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(!1), [d, u] = S(null), y = Y(!1), v = Y(null), g = V(async () => {
|
|
2185
2186
|
if (t) {
|
|
2186
2187
|
if (y.current) {
|
|
2187
2188
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -2190,7 +2191,7 @@ function er(t) {
|
|
|
2190
2191
|
y.current = !0, i(!0), u(null);
|
|
2191
2192
|
try {
|
|
2192
2193
|
const h = await e.getOverviewData(t);
|
|
2193
|
-
a(h),
|
|
2194
|
+
a(h), v.current = t;
|
|
2194
2195
|
} catch (h) {
|
|
2195
2196
|
u(h);
|
|
2196
2197
|
} finally {
|
|
@@ -2198,10 +2199,10 @@ function er(t) {
|
|
|
2198
2199
|
}
|
|
2199
2200
|
}
|
|
2200
2201
|
}, [t, e]);
|
|
2201
|
-
|
|
2202
|
-
t &&
|
|
2202
|
+
Q(() => {
|
|
2203
|
+
t && v.current !== t && g();
|
|
2203
2204
|
}, [t]);
|
|
2204
|
-
const
|
|
2205
|
+
const w = V(async () => {
|
|
2205
2206
|
if (t) {
|
|
2206
2207
|
c(!0), u(null);
|
|
2207
2208
|
try {
|
|
@@ -2219,14 +2220,14 @@ function er(t) {
|
|
|
2219
2220
|
isSubmitting: l,
|
|
2220
2221
|
error: d,
|
|
2221
2222
|
load: g,
|
|
2222
|
-
passOverview:
|
|
2223
|
+
passOverview: w
|
|
2223
2224
|
};
|
|
2224
2225
|
}
|
|
2225
2226
|
function tr(t) {
|
|
2226
|
-
const { identityService: e } =
|
|
2227
|
+
const { identityService: e } = oe(), [r, a] = S(
|
|
2227
2228
|
null
|
|
2228
|
-
), [s, i] =
|
|
2229
|
-
async (g,
|
|
2229
|
+
), [s, i] = S(!1), [l, c] = S(null), d = Y(!1), u = V(
|
|
2230
|
+
async (g, w) => {
|
|
2230
2231
|
if (t) {
|
|
2231
2232
|
if (d.current) {
|
|
2232
2233
|
console.log("[Identity] Request already in progress, skipping...");
|
|
@@ -2238,12 +2239,12 @@ function tr(t) {
|
|
|
2238
2239
|
applicantId: t,
|
|
2239
2240
|
restart: !1,
|
|
2240
2241
|
redirectUrl: g || "",
|
|
2241
|
-
ttl:
|
|
2242
|
+
ttl: w || 604800
|
|
2242
2243
|
// Default: 7 days
|
|
2243
2244
|
};
|
|
2244
2245
|
console.log("Identity request input:", h);
|
|
2245
|
-
const
|
|
2246
|
-
return console.log("Identity request result:",
|
|
2246
|
+
const x = await e.identityRequest(h);
|
|
2247
|
+
return console.log("Identity request result:", x), a(x), x;
|
|
2247
2248
|
} catch (h) {
|
|
2248
2249
|
throw c(h), h;
|
|
2249
2250
|
} finally {
|
|
@@ -2252,8 +2253,8 @@ function tr(t) {
|
|
|
2252
2253
|
}
|
|
2253
2254
|
},
|
|
2254
2255
|
[t, e]
|
|
2255
|
-
), y =
|
|
2256
|
-
async (g,
|
|
2256
|
+
), y = V(
|
|
2257
|
+
async (g, w) => {
|
|
2257
2258
|
if (t) {
|
|
2258
2259
|
i(!0), c(null);
|
|
2259
2260
|
try {
|
|
@@ -2261,9 +2262,9 @@ function tr(t) {
|
|
|
2261
2262
|
applicantId: t,
|
|
2262
2263
|
restart: !1,
|
|
2263
2264
|
redirectUrl: g,
|
|
2264
|
-
ttl:
|
|
2265
|
-
},
|
|
2266
|
-
return a(
|
|
2265
|
+
ttl: w
|
|
2266
|
+
}, x = await e.identityCompanyRequest(h);
|
|
2267
|
+
return a(x), x;
|
|
2267
2268
|
} catch (h) {
|
|
2268
2269
|
throw c(h), h;
|
|
2269
2270
|
} finally {
|
|
@@ -2272,7 +2273,7 @@ function tr(t) {
|
|
|
2272
2273
|
}
|
|
2273
2274
|
},
|
|
2274
2275
|
[t, e]
|
|
2275
|
-
),
|
|
2276
|
+
), v = V(async () => {
|
|
2276
2277
|
if (t) {
|
|
2277
2278
|
if (d.current) {
|
|
2278
2279
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
@@ -2288,8 +2289,8 @@ function tr(t) {
|
|
|
2288
2289
|
// 7 days
|
|
2289
2290
|
};
|
|
2290
2291
|
console.log("Restarting identity with input:", g);
|
|
2291
|
-
const
|
|
2292
|
-
return console.log("Restart identity result:",
|
|
2292
|
+
const w = await e.identityRequest(g);
|
|
2293
|
+
return console.log("Restart identity result:", w), a(w), w;
|
|
2293
2294
|
} catch (g) {
|
|
2294
2295
|
throw c(g), g;
|
|
2295
2296
|
} finally {
|
|
@@ -2305,11 +2306,11 @@ function tr(t) {
|
|
|
2305
2306
|
error: l,
|
|
2306
2307
|
requestIdentity: u,
|
|
2307
2308
|
requestCompanyIdentity: y,
|
|
2308
|
-
restartIdentity:
|
|
2309
|
+
restartIdentity: v
|
|
2309
2310
|
};
|
|
2310
2311
|
}
|
|
2311
2312
|
function rr(t) {
|
|
2312
|
-
const { riskScoringService: e } =
|
|
2313
|
+
const { riskScoringService: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(!1), [d, u] = S(null), [y, v] = S(null), g = Y(!1), w = Y(null), h = V(async () => {
|
|
2313
2314
|
if (t) {
|
|
2314
2315
|
if (g.current) {
|
|
2315
2316
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
@@ -2318,7 +2319,7 @@ function rr(t) {
|
|
|
2318
2319
|
g.current = !0, i(!0), u(null);
|
|
2319
2320
|
try {
|
|
2320
2321
|
const p = await e.getRiskCriterias(t);
|
|
2321
|
-
a(p),
|
|
2322
|
+
a(p), w.current = t;
|
|
2322
2323
|
} catch (p) {
|
|
2323
2324
|
u(p);
|
|
2324
2325
|
} finally {
|
|
@@ -2326,15 +2327,15 @@ function rr(t) {
|
|
|
2326
2327
|
}
|
|
2327
2328
|
}
|
|
2328
2329
|
}, [t, e]);
|
|
2329
|
-
|
|
2330
|
-
t &&
|
|
2330
|
+
Q(() => {
|
|
2331
|
+
t && w.current !== t && h();
|
|
2331
2332
|
}, [t]);
|
|
2332
|
-
const
|
|
2333
|
+
const x = V(
|
|
2333
2334
|
async (p) => {
|
|
2334
2335
|
c(!0), u(null);
|
|
2335
2336
|
try {
|
|
2336
2337
|
const m = await e.submitRiskScoring(p);
|
|
2337
|
-
return
|
|
2338
|
+
return v(m), m;
|
|
2338
2339
|
} catch (m) {
|
|
2339
2340
|
throw u(m), m;
|
|
2340
2341
|
} finally {
|
|
@@ -2350,40 +2351,40 @@ function rr(t) {
|
|
|
2350
2351
|
isSubmitting: l,
|
|
2351
2352
|
error: d,
|
|
2352
2353
|
load: h,
|
|
2353
|
-
submit:
|
|
2354
|
+
submit: x
|
|
2354
2355
|
};
|
|
2355
2356
|
}
|
|
2356
2357
|
function nr() {
|
|
2357
|
-
const { applicantService: t, config: e } =
|
|
2358
|
+
const { applicantService: t, config: e } = oe(), [r, a] = S(!1), [s, i] = S(null), l = Y(!1), c = Y(!1), d = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(w) {
|
|
2358
2359
|
const h = Math.random() * 16 | 0;
|
|
2359
|
-
return (
|
|
2360
|
-
}), u =
|
|
2361
|
-
async (
|
|
2360
|
+
return (w === "x" ? h : h & 3 | 8).toString(16);
|
|
2361
|
+
}), u = V(
|
|
2362
|
+
async (w) => {
|
|
2362
2363
|
var h;
|
|
2363
2364
|
if (l.current)
|
|
2364
2365
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
2365
2366
|
l.current = !0, a(!0), i(null);
|
|
2366
2367
|
try {
|
|
2367
|
-
if (
|
|
2368
|
+
if (w.applicantAdditionalDatas || (w.applicantAdditionalDatas = []), (h = e.identityProviders) != null && h.sardinai) {
|
|
2368
2369
|
const p = d();
|
|
2369
|
-
console.log("[SardinAI] Generated session key:", p),
|
|
2370
|
+
console.log("[SardinAI] Generated session key:", p), w.applicantAdditionalDatas.push({
|
|
2370
2371
|
paramName: "sessionKey",
|
|
2371
2372
|
value: p
|
|
2372
2373
|
});
|
|
2373
2374
|
}
|
|
2374
|
-
return await t.createApplicant(
|
|
2375
|
-
} catch (
|
|
2376
|
-
throw i(
|
|
2375
|
+
return await t.createApplicant(w);
|
|
2376
|
+
} catch (x) {
|
|
2377
|
+
throw i(x), x;
|
|
2377
2378
|
} finally {
|
|
2378
2379
|
a(!1), l.current = !1;
|
|
2379
2380
|
}
|
|
2380
2381
|
},
|
|
2381
2382
|
[t, e]
|
|
2382
|
-
), y =
|
|
2383
|
-
async (
|
|
2383
|
+
), y = V(
|
|
2384
|
+
async (w) => {
|
|
2384
2385
|
a(!0), i(null);
|
|
2385
2386
|
try {
|
|
2386
|
-
return await t.createCompanyApplicant(
|
|
2387
|
+
return await t.createCompanyApplicant(w);
|
|
2387
2388
|
} catch (h) {
|
|
2388
2389
|
throw i(h), h;
|
|
2389
2390
|
} finally {
|
|
@@ -2391,13 +2392,13 @@ function nr() {
|
|
|
2391
2392
|
}
|
|
2392
2393
|
},
|
|
2393
2394
|
[t]
|
|
2394
|
-
),
|
|
2395
|
-
async (
|
|
2395
|
+
), v = V(
|
|
2396
|
+
async (w) => {
|
|
2396
2397
|
if (c.current)
|
|
2397
2398
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
2398
2399
|
c.current = !0, a(!0), i(null);
|
|
2399
2400
|
try {
|
|
2400
|
-
return await t.getApplicantData(
|
|
2401
|
+
return await t.getApplicantData(w);
|
|
2401
2402
|
} catch (h) {
|
|
2402
2403
|
throw i(h), h;
|
|
2403
2404
|
} finally {
|
|
@@ -2405,11 +2406,11 @@ function nr() {
|
|
|
2405
2406
|
}
|
|
2406
2407
|
},
|
|
2407
2408
|
[t]
|
|
2408
|
-
), g =
|
|
2409
|
-
async (
|
|
2409
|
+
), g = V(
|
|
2410
|
+
async (w) => {
|
|
2410
2411
|
a(!0), i(null);
|
|
2411
2412
|
try {
|
|
2412
|
-
await t.stopProgress(
|
|
2413
|
+
await t.stopProgress(w);
|
|
2413
2414
|
} catch (h) {
|
|
2414
2415
|
throw i(h), h;
|
|
2415
2416
|
} finally {
|
|
@@ -2423,7 +2424,7 @@ function nr() {
|
|
|
2423
2424
|
error: s,
|
|
2424
2425
|
createApplicant: u,
|
|
2425
2426
|
createCompanyApplicant: y,
|
|
2426
|
-
getApplicantData:
|
|
2427
|
+
getApplicantData: v,
|
|
2427
2428
|
stopProgress: g
|
|
2428
2429
|
};
|
|
2429
2430
|
}
|
|
@@ -2450,7 +2451,7 @@ const j = ({
|
|
|
2450
2451
|
return /* @__PURE__ */ o(
|
|
2451
2452
|
"button",
|
|
2452
2453
|
{
|
|
2453
|
-
className:
|
|
2454
|
+
className: J(c, d[e], u[r], i),
|
|
2454
2455
|
disabled: s || a,
|
|
2455
2456
|
...l,
|
|
2456
2457
|
children: [
|
|
@@ -2488,7 +2489,7 @@ const j = ({
|
|
|
2488
2489
|
]
|
|
2489
2490
|
}
|
|
2490
2491
|
);
|
|
2491
|
-
},
|
|
2492
|
+
}, se = Le(
|
|
2492
2493
|
({ label: t, error: e, helperText: r, leftIcon: a, rightIcon: s, className: i, ...l }, c) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2493
2494
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2494
2495
|
t,
|
|
@@ -2500,7 +2501,7 @@ const j = ({
|
|
|
2500
2501
|
"input",
|
|
2501
2502
|
{
|
|
2502
2503
|
ref: c,
|
|
2503
|
-
className:
|
|
2504
|
+
className: J(
|
|
2504
2505
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2505
2506
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2506
2507
|
"disabled:bg-gray-100 disabled:cursor-not-allowed",
|
|
@@ -2519,11 +2520,11 @@ const j = ({
|
|
|
2519
2520
|
!e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
|
|
2520
2521
|
] })
|
|
2521
2522
|
);
|
|
2522
|
-
|
|
2523
|
-
const
|
|
2523
|
+
se.displayName = "Input";
|
|
2524
|
+
const M = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2524
2525
|
"div",
|
|
2525
2526
|
{
|
|
2526
|
-
className:
|
|
2527
|
+
className: J(
|
|
2527
2528
|
"metakyc-card rounded-xl shadow-sm border",
|
|
2528
2529
|
e
|
|
2529
2530
|
),
|
|
@@ -2534,20 +2535,20 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2534
2535
|
...r,
|
|
2535
2536
|
children: t
|
|
2536
2537
|
}
|
|
2537
|
-
),
|
|
2538
|
+
), ne = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2538
2539
|
"div",
|
|
2539
2540
|
{
|
|
2540
|
-
className:
|
|
2541
|
+
className: J("px-6 py-4 border-b", e),
|
|
2541
2542
|
style: {
|
|
2542
2543
|
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2543
2544
|
},
|
|
2544
2545
|
...r,
|
|
2545
2546
|
children: t
|
|
2546
2547
|
}
|
|
2547
|
-
),
|
|
2548
|
+
), O = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: J("px-6 py-4", e), ...r, children: t }), ie = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2548
2549
|
"div",
|
|
2549
2550
|
{
|
|
2550
|
-
className:
|
|
2551
|
+
className: J("px-6 py-4 border-t", e),
|
|
2551
2552
|
style: {
|
|
2552
2553
|
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2553
2554
|
},
|
|
@@ -2557,7 +2558,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2557
2558
|
), pe = ({ children: t, variant: e = "default", className: r, ...a }) => /* @__PURE__ */ n(
|
|
2558
2559
|
"span",
|
|
2559
2560
|
{
|
|
2560
|
-
className:
|
|
2561
|
+
className: J(
|
|
2561
2562
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2562
2563
|
{
|
|
2563
2564
|
default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
|
|
@@ -2577,10 +2578,10 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2577
2578
|
md: "h-8 w-8",
|
|
2578
2579
|
lg: "h-12 w-12"
|
|
2579
2580
|
};
|
|
2580
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2581
|
+
return /* @__PURE__ */ n("div", { className: J("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
|
|
2581
2582
|
"svg",
|
|
2582
2583
|
{
|
|
2583
|
-
className:
|
|
2584
|
+
className: J("animate-spin text-primary-500", a[t]),
|
|
2584
2585
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2585
2586
|
fill: "none",
|
|
2586
2587
|
viewBox: "0 0 24 24",
|
|
@@ -2617,7 +2618,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2617
2618
|
"select",
|
|
2618
2619
|
{
|
|
2619
2620
|
ref: c,
|
|
2620
|
-
className:
|
|
2621
|
+
className: J(
|
|
2621
2622
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2622
2623
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2623
2624
|
"disabled:bg-gray-100 disabled:cursor-not-allowed",
|
|
@@ -2654,24 +2655,24 @@ const ar = ({
|
|
|
2654
2655
|
disabled: i = !1,
|
|
2655
2656
|
required: l = !1
|
|
2656
2657
|
}) => {
|
|
2657
|
-
const [c, d] =
|
|
2658
|
-
|
|
2658
|
+
const [c, d] = S(!1), [u, y] = S(""), v = Y(null);
|
|
2659
|
+
Q(() => {
|
|
2659
2660
|
const p = (m) => {
|
|
2660
|
-
|
|
2661
|
+
v.current && !v.current.contains(m.target) && (d(!1), y(""));
|
|
2661
2662
|
};
|
|
2662
2663
|
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
2663
2664
|
}, []);
|
|
2664
2665
|
const g = a.filter(
|
|
2665
2666
|
(p) => p.label.toLowerCase().includes(u.toLowerCase())
|
|
2666
|
-
),
|
|
2667
|
+
), w = (p) => {
|
|
2667
2668
|
i || (e.includes(p) ? r(e.filter((m) => m !== p)) : r([...e, p]));
|
|
2668
2669
|
}, h = (p, m) => {
|
|
2669
2670
|
m.stopPropagation(), i || r(e.filter((A) => A !== p));
|
|
2670
|
-
},
|
|
2671
|
+
}, x = (p) => {
|
|
2671
2672
|
var m;
|
|
2672
2673
|
return ((m = a.find((A) => A.value === p)) == null ? void 0 : m.label) || p;
|
|
2673
2674
|
};
|
|
2674
|
-
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref:
|
|
2675
|
+
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref: v, children: [
|
|
2675
2676
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2676
2677
|
t,
|
|
2677
2678
|
l && /* @__PURE__ */ n("span", { className: "text-red-500 ml-1", children: "*" })
|
|
@@ -2681,7 +2682,7 @@ const ar = ({
|
|
|
2681
2682
|
"div",
|
|
2682
2683
|
{
|
|
2683
2684
|
onClick: () => !i && d(!c),
|
|
2684
|
-
className:
|
|
2685
|
+
className: J(
|
|
2685
2686
|
"metakyc-multiselect-trigger",
|
|
2686
2687
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors",
|
|
2687
2688
|
"bg-white dark:bg-gray-800",
|
|
@@ -2695,13 +2696,32 @@ const ar = ({
|
|
|
2695
2696
|
{
|
|
2696
2697
|
className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded bg-blue-100 dark:bg-blue-900/40 text-blue-800 dark:text-blue-300 text-xs font-medium",
|
|
2697
2698
|
children: [
|
|
2698
|
-
|
|
2699
|
+
x(p),
|
|
2699
2700
|
!i && /* @__PURE__ */ n(
|
|
2700
2701
|
"button",
|
|
2701
2702
|
{
|
|
2702
2703
|
type: "button",
|
|
2703
2704
|
onClick: (m) => h(p, m),
|
|
2704
|
-
className: "
|
|
2705
|
+
className: "metakyc-multiselect-chip-remove",
|
|
2706
|
+
style: {
|
|
2707
|
+
background: "transparent",
|
|
2708
|
+
border: "none",
|
|
2709
|
+
padding: "0 0 0 2px",
|
|
2710
|
+
margin: 0,
|
|
2711
|
+
cursor: "pointer",
|
|
2712
|
+
fontSize: "14px",
|
|
2713
|
+
lineHeight: 1,
|
|
2714
|
+
fontWeight: "bold",
|
|
2715
|
+
display: "inline-flex",
|
|
2716
|
+
alignItems: "center",
|
|
2717
|
+
boxShadow: "none",
|
|
2718
|
+
transform: "none",
|
|
2719
|
+
minWidth: 0,
|
|
2720
|
+
width: "auto",
|
|
2721
|
+
height: "auto",
|
|
2722
|
+
letterSpacing: "normal",
|
|
2723
|
+
textTransform: "none"
|
|
2724
|
+
},
|
|
2705
2725
|
children: "×"
|
|
2706
2726
|
}
|
|
2707
2727
|
)
|
|
@@ -2713,60 +2733,68 @@ const ar = ({
|
|
|
2713
2733
|
]
|
|
2714
2734
|
}
|
|
2715
2735
|
),
|
|
2716
|
-
c && /* @__PURE__ */ o(
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
"
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2736
|
+
c && /* @__PURE__ */ o(
|
|
2737
|
+
"div",
|
|
2738
|
+
{
|
|
2739
|
+
className: "metakyc-multiselect-dropdown absolute z-50 w-full mt-1 rounded-lg shadow-lg",
|
|
2740
|
+
style: { background: "inherit", border: "1px solid #d1d5db" },
|
|
2741
|
+
children: [
|
|
2742
|
+
/* @__PURE__ */ n("div", { className: "metakyc-multiselect-search-wrapper p-2", style: { borderBottom: "1px solid #e5e7eb" }, children: /* @__PURE__ */ n(
|
|
2743
|
+
"input",
|
|
2744
|
+
{
|
|
2745
|
+
type: "text",
|
|
2746
|
+
value: u,
|
|
2747
|
+
onChange: (p) => y(p.target.value),
|
|
2748
|
+
placeholder: "Search...",
|
|
2749
|
+
autoFocus: !0,
|
|
2750
|
+
onClick: (p) => p.stopPropagation(),
|
|
2751
|
+
className: "metakyc-multiselect-search w-full px-2 py-1.5 text-sm rounded focus:outline-none focus:ring-1 focus:ring-blue-500",
|
|
2752
|
+
style: { border: "1px solid #d1d5db" }
|
|
2753
|
+
}
|
|
2754
|
+
) }),
|
|
2755
|
+
/* @__PURE__ */ n("ul", { className: "max-h-48 overflow-y-auto py-1", children: g.length === 0 ? /* @__PURE__ */ n("li", { className: "px-3 py-2 text-sm text-gray-500 dark:text-gray-400", children: "No results" }) : g.map((p) => /* @__PURE__ */ o(
|
|
2756
|
+
"li",
|
|
2757
|
+
{
|
|
2758
|
+
onClick: () => w(p.value),
|
|
2759
|
+
className: J(
|
|
2760
|
+
"metakyc-multiselect-option",
|
|
2761
|
+
"flex items-center gap-2 px-3 py-2 text-sm cursor-pointer",
|
|
2762
|
+
"hover:bg-gray-50 dark:hover:bg-gray-700",
|
|
2763
|
+
e.includes(p.value) && "metakyc-multiselect-option-selected bg-blue-50 dark:bg-blue-900/20"
|
|
2764
|
+
),
|
|
2765
|
+
children: [
|
|
2766
|
+
/* @__PURE__ */ n(
|
|
2767
|
+
"input",
|
|
2768
|
+
{
|
|
2769
|
+
type: "checkbox",
|
|
2770
|
+
checked: e.includes(p.value),
|
|
2771
|
+
readOnly: !0,
|
|
2772
|
+
className: "rounded border-gray-300 text-blue-600 pointer-events-none"
|
|
2773
|
+
}
|
|
2774
|
+
),
|
|
2775
|
+
/* @__PURE__ */ n("span", { className: "text-gray-900 dark:text-gray-100", children: p.label })
|
|
2776
|
+
]
|
|
2777
|
+
},
|
|
2778
|
+
p.value
|
|
2779
|
+
)) }),
|
|
2780
|
+
e.length > 0 && /* @__PURE__ */ n("div", { className: "metakyc-multiselect-clear p-2 border-t border-gray-100 dark:border-gray-700", children: /* @__PURE__ */ o(
|
|
2781
|
+
"button",
|
|
2782
|
+
{
|
|
2783
|
+
type: "button",
|
|
2784
|
+
onClick: () => {
|
|
2785
|
+
r([]), y("");
|
|
2786
|
+
},
|
|
2787
|
+
className: "text-xs text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",
|
|
2788
|
+
children: [
|
|
2789
|
+
"Clear all (",
|
|
2790
|
+
e.length,
|
|
2791
|
+
" selected)"
|
|
2792
|
+
]
|
|
2793
|
+
}
|
|
2794
|
+
) })
|
|
2795
|
+
]
|
|
2796
|
+
}
|
|
2797
|
+
)
|
|
2770
2798
|
] })
|
|
2771
2799
|
] });
|
|
2772
2800
|
}, sr = ({
|
|
@@ -2779,42 +2807,42 @@ const ar = ({
|
|
|
2779
2807
|
value: l = [],
|
|
2780
2808
|
className: c
|
|
2781
2809
|
}) => {
|
|
2782
|
-
const [d, u] =
|
|
2810
|
+
const [d, u] = S(!1), y = Y(null), v = (m) => {
|
|
2783
2811
|
if (!m) return;
|
|
2784
2812
|
const A = Array.from(m);
|
|
2785
|
-
if (s && A.filter((
|
|
2786
|
-
const
|
|
2787
|
-
alert(`Some files exceed the maximum size of ${
|
|
2813
|
+
if (s && A.filter((N) => N.size > s).length > 0) {
|
|
2814
|
+
const N = Ie(s);
|
|
2815
|
+
alert(`Some files exceed the maximum size of ${N}`);
|
|
2788
2816
|
return;
|
|
2789
2817
|
}
|
|
2790
2818
|
i == null || i(a ? [...l, ...A] : [A[0]]);
|
|
2791
2819
|
}, g = (m) => {
|
|
2792
2820
|
m.preventDefault(), u(!0);
|
|
2793
|
-
},
|
|
2821
|
+
}, w = () => {
|
|
2794
2822
|
u(!1);
|
|
2795
2823
|
}, h = (m) => {
|
|
2796
|
-
m.preventDefault(), u(!1),
|
|
2797
|
-
},
|
|
2824
|
+
m.preventDefault(), u(!1), v(m.dataTransfer.files);
|
|
2825
|
+
}, x = () => {
|
|
2798
2826
|
var m;
|
|
2799
2827
|
(m = y.current) == null || m.click();
|
|
2800
2828
|
}, p = (m) => {
|
|
2801
|
-
const A = l.filter((
|
|
2829
|
+
const A = l.filter((C, N) => N !== m);
|
|
2802
2830
|
i == null || i(A);
|
|
2803
2831
|
};
|
|
2804
|
-
return /* @__PURE__ */ o("div", { className:
|
|
2832
|
+
return /* @__PURE__ */ o("div", { className: J("w-full", c), children: [
|
|
2805
2833
|
t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
|
|
2806
2834
|
/* @__PURE__ */ o(
|
|
2807
2835
|
"div",
|
|
2808
2836
|
{
|
|
2809
|
-
className:
|
|
2837
|
+
className: J(
|
|
2810
2838
|
"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
|
|
2811
2839
|
d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
2812
2840
|
e && "border-danger-500"
|
|
2813
2841
|
),
|
|
2814
2842
|
onDragOver: g,
|
|
2815
|
-
onDragLeave:
|
|
2843
|
+
onDragLeave: w,
|
|
2816
2844
|
onDrop: h,
|
|
2817
|
-
onClick:
|
|
2845
|
+
onClick: x,
|
|
2818
2846
|
children: [
|
|
2819
2847
|
/* @__PURE__ */ n(
|
|
2820
2848
|
"input",
|
|
@@ -2824,7 +2852,7 @@ const ar = ({
|
|
|
2824
2852
|
className: "hidden",
|
|
2825
2853
|
accept: r,
|
|
2826
2854
|
multiple: a,
|
|
2827
|
-
onChange: (m) =>
|
|
2855
|
+
onChange: (m) => v(m.target.files)
|
|
2828
2856
|
}
|
|
2829
2857
|
),
|
|
2830
2858
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -2891,8 +2919,8 @@ const ar = ({
|
|
|
2891
2919
|
"button",
|
|
2892
2920
|
{
|
|
2893
2921
|
type: "button",
|
|
2894
|
-
onClick: (
|
|
2895
|
-
|
|
2922
|
+
onClick: (C) => {
|
|
2923
|
+
C.stopPropagation(), p(A);
|
|
2896
2924
|
},
|
|
2897
2925
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2898
2926
|
children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
|
|
@@ -2924,7 +2952,7 @@ const ar = ({
|
|
|
2924
2952
|
type: "text",
|
|
2925
2953
|
value: t,
|
|
2926
2954
|
onChange: (i) => e == null ? void 0 : e(i.target.value),
|
|
2927
|
-
className:
|
|
2955
|
+
className: J(
|
|
2928
2956
|
"w-20 rounded-lg border px-3 py-2 text-sm",
|
|
2929
2957
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2930
2958
|
"border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
|
|
@@ -2933,11 +2961,11 @@ const ar = ({
|
|
|
2933
2961
|
}
|
|
2934
2962
|
),
|
|
2935
2963
|
/* @__PURE__ */ n(
|
|
2936
|
-
|
|
2964
|
+
se,
|
|
2937
2965
|
{
|
|
2938
2966
|
ref: s,
|
|
2939
2967
|
type: "tel",
|
|
2940
|
-
className:
|
|
2968
|
+
className: J("flex-1", r),
|
|
2941
2969
|
...a,
|
|
2942
2970
|
label: ""
|
|
2943
2971
|
}
|
|
@@ -2947,35 +2975,35 @@ const ar = ({
|
|
|
2947
2975
|
] })
|
|
2948
2976
|
);
|
|
2949
2977
|
ir.displayName = "PhoneInput";
|
|
2950
|
-
const
|
|
2978
|
+
const Be = (t, e, r) => {
|
|
2951
2979
|
if (t && "reportValidity" in t) {
|
|
2952
|
-
const a =
|
|
2980
|
+
const a = Fe(r, e);
|
|
2953
2981
|
t.setCustomValidity(a && a.message || ""), t.reportValidity();
|
|
2954
2982
|
}
|
|
2955
|
-
},
|
|
2983
|
+
}, Pe = (t, e) => {
|
|
2956
2984
|
for (const r in e.fields) {
|
|
2957
2985
|
const a = e.fields[r];
|
|
2958
|
-
a && a.ref && "reportValidity" in a.ref ?
|
|
2986
|
+
a && a.ref && "reportValidity" in a.ref ? Be(a.ref, r, t) : a && a.refs && a.refs.forEach((s) => Be(s, r, t));
|
|
2959
2987
|
}
|
|
2960
|
-
},
|
|
2961
|
-
e.shouldUseNativeValidation &&
|
|
2988
|
+
}, ze = (t, e) => {
|
|
2989
|
+
e.shouldUseNativeValidation && Pe(t, e);
|
|
2962
2990
|
const r = {};
|
|
2963
2991
|
for (const a in t) {
|
|
2964
|
-
const s =
|
|
2992
|
+
const s = Fe(e.fields, a), i = Object.assign(t[a] || {}, { ref: s && s.ref });
|
|
2965
2993
|
if (or(e.names || Object.keys(t), a)) {
|
|
2966
|
-
const l = Object.assign({},
|
|
2994
|
+
const l = Object.assign({}, Fe(r, a));
|
|
2967
2995
|
Ee(l, "root", i), Ee(r, a, l);
|
|
2968
2996
|
} else Ee(r, a, i);
|
|
2969
2997
|
}
|
|
2970
2998
|
return r;
|
|
2971
2999
|
}, or = (t, e) => {
|
|
2972
|
-
const r =
|
|
2973
|
-
return t.some((a) =>
|
|
3000
|
+
const r = $e(e);
|
|
3001
|
+
return t.some((a) => $e(a).match(`^${r}\\.\\d+`));
|
|
2974
3002
|
};
|
|
2975
|
-
function
|
|
3003
|
+
function $e(t) {
|
|
2976
3004
|
return t.replace(/\]|\[/g, "");
|
|
2977
3005
|
}
|
|
2978
|
-
function
|
|
3006
|
+
function He(t, e, r) {
|
|
2979
3007
|
function a(c, d) {
|
|
2980
3008
|
var u;
|
|
2981
3009
|
Object.defineProperty(c, "_zod", {
|
|
@@ -3011,18 +3039,18 @@ class lr extends Error {
|
|
|
3011
3039
|
}
|
|
3012
3040
|
}
|
|
3013
3041
|
const cr = {};
|
|
3014
|
-
function
|
|
3042
|
+
function Ve(t) {
|
|
3015
3043
|
return cr;
|
|
3016
3044
|
}
|
|
3017
3045
|
function dr(t, e) {
|
|
3018
3046
|
return typeof e == "bigint" ? e.toString() : e;
|
|
3019
3047
|
}
|
|
3020
|
-
const
|
|
3048
|
+
const Ye = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
|
|
3021
3049
|
};
|
|
3022
3050
|
function ke(t) {
|
|
3023
3051
|
return typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
3024
3052
|
}
|
|
3025
|
-
function
|
|
3053
|
+
function We(t, e, r) {
|
|
3026
3054
|
var s, i, l, c, d, u;
|
|
3027
3055
|
const a = { ...t, path: t.path ?? [] };
|
|
3028
3056
|
if (!t.message) {
|
|
@@ -3031,7 +3059,7 @@ function Ye(t, e, r) {
|
|
|
3031
3059
|
}
|
|
3032
3060
|
return delete a.inst, delete a.continue, e != null && e.reportInput || delete a.input, a;
|
|
3033
3061
|
}
|
|
3034
|
-
const
|
|
3062
|
+
const Qe = (t, e) => {
|
|
3035
3063
|
t.name = "$ZodError", Object.defineProperty(t, "_zod", {
|
|
3036
3064
|
value: t._zod,
|
|
3037
3065
|
enumerable: !1
|
|
@@ -3048,25 +3076,25 @@ const We = (t, e) => {
|
|
|
3048
3076
|
value: () => t.message,
|
|
3049
3077
|
enumerable: !1
|
|
3050
3078
|
});
|
|
3051
|
-
}, ur =
|
|
3079
|
+
}, ur = He("$ZodError", Qe), Ge = He("$ZodError", Qe, { Parent: Error }), mr = (t) => (e, r, a, s) => {
|
|
3052
3080
|
const i = a ? Object.assign(a, { async: !1 }) : { async: !1 }, l = e._zod.run({ value: r, issues: [] }, i);
|
|
3053
3081
|
if (l instanceof Promise)
|
|
3054
3082
|
throw new lr();
|
|
3055
3083
|
if (l.issues.length) {
|
|
3056
|
-
const c = new ((s == null ? void 0 : s.Err) ?? t)(l.issues.map((d) =>
|
|
3057
|
-
throw
|
|
3084
|
+
const c = new ((s == null ? void 0 : s.Err) ?? t)(l.issues.map((d) => We(d, i, Ve())));
|
|
3085
|
+
throw Ye(c, s == null ? void 0 : s.callee), c;
|
|
3058
3086
|
}
|
|
3059
3087
|
return l.value;
|
|
3060
|
-
}, hr = /* @__PURE__ */ mr(
|
|
3088
|
+
}, hr = /* @__PURE__ */ mr(Ge), pr = (t) => async (e, r, a, s) => {
|
|
3061
3089
|
const i = a ? Object.assign(a, { async: !0 }) : { async: !0 };
|
|
3062
3090
|
let l = e._zod.run({ value: r, issues: [] }, i);
|
|
3063
3091
|
if (l instanceof Promise && (l = await l), l.issues.length) {
|
|
3064
|
-
const c = new ((s == null ? void 0 : s.Err) ?? t)(l.issues.map((d) =>
|
|
3065
|
-
throw
|
|
3092
|
+
const c = new ((s == null ? void 0 : s.Err) ?? t)(l.issues.map((d) => We(d, i, Ve())));
|
|
3093
|
+
throw Ye(c, s == null ? void 0 : s.callee), c;
|
|
3066
3094
|
}
|
|
3067
3095
|
return l.value;
|
|
3068
|
-
}, gr = /* @__PURE__ */ pr(
|
|
3069
|
-
function
|
|
3096
|
+
}, gr = /* @__PURE__ */ pr(Ge);
|
|
3097
|
+
function qe(t, e) {
|
|
3070
3098
|
try {
|
|
3071
3099
|
var r = t();
|
|
3072
3100
|
} catch (a) {
|
|
@@ -3082,8 +3110,8 @@ function yr(t, e) {
|
|
|
3082
3110
|
r[l] = { message: c.message, type: c.code };
|
|
3083
3111
|
} else r[l] = { message: i, type: s };
|
|
3084
3112
|
if ("unionErrors" in a && a.unionErrors.forEach(function(y) {
|
|
3085
|
-
return y.errors.forEach(function(
|
|
3086
|
-
return t.push(
|
|
3113
|
+
return y.errors.forEach(function(v) {
|
|
3114
|
+
return t.push(v);
|
|
3087
3115
|
});
|
|
3088
3116
|
}), e) {
|
|
3089
3117
|
var d = r[l].types, u = d && d[a.code];
|
|
@@ -3101,8 +3129,8 @@ function fr(t, e) {
|
|
|
3101
3129
|
r[l] = { message: c.message, type: c.code };
|
|
3102
3130
|
} else r[l] = { message: i, type: s };
|
|
3103
3131
|
if (a.code === "invalid_union" && a.errors.forEach(function(y) {
|
|
3104
|
-
return y.forEach(function(
|
|
3105
|
-
return t.push(
|
|
3132
|
+
return y.forEach(function(v) {
|
|
3133
|
+
return t.push(v);
|
|
3106
3134
|
});
|
|
3107
3135
|
}), e) {
|
|
3108
3136
|
var d = r[l].types, u = d && d[a.code];
|
|
@@ -3112,19 +3140,19 @@ function fr(t, e) {
|
|
|
3112
3140
|
}
|
|
3113
3141
|
return r;
|
|
3114
3142
|
}
|
|
3115
|
-
function
|
|
3143
|
+
function Ze(t, e, r) {
|
|
3116
3144
|
if (r === void 0 && (r = {}), function(a) {
|
|
3117
3145
|
return "_def" in a && typeof a._def == "object" && "typeName" in a._def;
|
|
3118
3146
|
}(t)) return function(a, s, i) {
|
|
3119
3147
|
try {
|
|
3120
|
-
return Promise.resolve(
|
|
3148
|
+
return Promise.resolve(qe(function() {
|
|
3121
3149
|
return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](a, e)).then(function(l) {
|
|
3122
|
-
return i.shouldUseNativeValidation &&
|
|
3150
|
+
return i.shouldUseNativeValidation && Pe({}, i), { errors: {}, values: r.raw ? Object.assign({}, a) : l };
|
|
3123
3151
|
});
|
|
3124
3152
|
}, function(l) {
|
|
3125
3153
|
if (function(c) {
|
|
3126
3154
|
return Array.isArray(c == null ? void 0 : c.issues);
|
|
3127
|
-
}(l)) return { values: {}, errors:
|
|
3155
|
+
}(l)) return { values: {}, errors: ze(yr(l.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
3128
3156
|
throw l;
|
|
3129
3157
|
}));
|
|
3130
3158
|
} catch (l) {
|
|
@@ -3135,14 +3163,14 @@ function Ge(t, e, r) {
|
|
|
3135
3163
|
return "_zod" in a && typeof a._zod == "object";
|
|
3136
3164
|
}(t)) return function(a, s, i) {
|
|
3137
3165
|
try {
|
|
3138
|
-
return Promise.resolve(
|
|
3166
|
+
return Promise.resolve(qe(function() {
|
|
3139
3167
|
return Promise.resolve((r.mode === "sync" ? hr : gr)(t, a, e)).then(function(l) {
|
|
3140
|
-
return i.shouldUseNativeValidation &&
|
|
3168
|
+
return i.shouldUseNativeValidation && Pe({}, i), { errors: {}, values: r.raw ? Object.assign({}, a) : l };
|
|
3141
3169
|
});
|
|
3142
3170
|
}, function(l) {
|
|
3143
3171
|
if (function(c) {
|
|
3144
3172
|
return c instanceof ur;
|
|
3145
|
-
}(l)) return { values: {}, errors:
|
|
3173
|
+
}(l)) return { values: {}, errors: ze(fr(l.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
3146
3174
|
throw l;
|
|
3147
3175
|
}));
|
|
3148
3176
|
} catch (l) {
|
|
@@ -3204,111 +3232,111 @@ const Wr = me.any(), kr = ({
|
|
|
3204
3232
|
onBack: r
|
|
3205
3233
|
}) => {
|
|
3206
3234
|
const { questionnaire: a, isLoading: s, isSubmitting: i, error: l, submit: c } = Jt(t), d = Re(() => a ? { questionResults: a.questionGroups.map(
|
|
3207
|
-
(
|
|
3235
|
+
(x) => x.questions.map((p) => ({
|
|
3208
3236
|
questionId: p.id,
|
|
3209
3237
|
values: []
|
|
3210
3238
|
}))
|
|
3211
3239
|
) } : { questionResults: [] }, [a]), u = a ? br() : null, {
|
|
3212
3240
|
control: y,
|
|
3213
|
-
handleSubmit:
|
|
3241
|
+
handleSubmit: v,
|
|
3214
3242
|
formState: { errors: g }
|
|
3215
3243
|
} = Te({
|
|
3216
|
-
resolver: u ?
|
|
3244
|
+
resolver: u ? Ze(u) : void 0,
|
|
3217
3245
|
defaultValues: d
|
|
3218
|
-
}),
|
|
3246
|
+
}), w = async (h) => {
|
|
3219
3247
|
if (a)
|
|
3220
3248
|
try {
|
|
3221
3249
|
console.log("Form submitted with data:", h);
|
|
3222
|
-
const
|
|
3223
|
-
(m, A) => m.questions.map((
|
|
3224
|
-
var
|
|
3250
|
+
const x = a.questionGroups.flatMap(
|
|
3251
|
+
(m, A) => m.questions.map((C, N) => {
|
|
3252
|
+
var B, L, F;
|
|
3225
3253
|
return {
|
|
3226
|
-
questionId:
|
|
3227
|
-
values: ((
|
|
3254
|
+
questionId: C.id,
|
|
3255
|
+
values: ((F = (L = (B = h.questionResults) == null ? void 0 : B[A]) == null ? void 0 : L[N]) == null ? void 0 : F.values) || []
|
|
3228
3256
|
};
|
|
3229
3257
|
})
|
|
3230
3258
|
);
|
|
3231
|
-
console.log("Question results to submit:",
|
|
3259
|
+
console.log("Question results to submit:", x);
|
|
3232
3260
|
const p = {
|
|
3233
3261
|
applicantId: t,
|
|
3234
3262
|
questionnarieId: a.id,
|
|
3235
|
-
questionResults:
|
|
3263
|
+
questionResults: x
|
|
3236
3264
|
};
|
|
3237
3265
|
console.log("Final input:", p), await c(p), e == null || e();
|
|
3238
|
-
} catch (
|
|
3239
|
-
console.error("Error submitting questionnaire:",
|
|
3266
|
+
} catch (x) {
|
|
3267
|
+
console.error("Error submitting questionnaire:", x);
|
|
3240
3268
|
}
|
|
3241
3269
|
};
|
|
3242
|
-
return s ? /* @__PURE__ */ n(
|
|
3270
|
+
return s ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(de, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3243
3271
|
"Error loading questionnaire: ",
|
|
3244
3272
|
l.message
|
|
3245
|
-
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3246
|
-
/* @__PURE__ */ o(
|
|
3273
|
+
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: v(w), children: /* @__PURE__ */ o(M, { children: [
|
|
3274
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3247
3275
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3248
3276
|
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3249
3277
|
] }),
|
|
3250
|
-
/* @__PURE__ */ n(
|
|
3251
|
-
(h,
|
|
3252
|
-
const
|
|
3278
|
+
/* @__PURE__ */ n(O, { className: "space-y-8", children: a.questionGroups.flatMap(
|
|
3279
|
+
(h, x) => h.questions.map((p, m) => {
|
|
3280
|
+
const C = p.defaultAnswers && p.defaultAnswers.length > 0 ? p.showAsDropdown ? p.canMultipleAnswer ? "multi-select" : "single-select" : p.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
3253
3281
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3254
3282
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3255
3283
|
p.text,
|
|
3256
3284
|
p.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3257
3285
|
] }),
|
|
3258
|
-
|
|
3259
|
-
|
|
3286
|
+
C === "text" && /* @__PURE__ */ n(
|
|
3287
|
+
te,
|
|
3260
3288
|
{
|
|
3261
3289
|
control: y,
|
|
3262
|
-
name: `questionResults.${
|
|
3263
|
-
render: ({ field:
|
|
3264
|
-
var
|
|
3290
|
+
name: `questionResults.${x}.${m}.values.0`,
|
|
3291
|
+
render: ({ field: N }) => {
|
|
3292
|
+
var B, L, F, k;
|
|
3265
3293
|
return /* @__PURE__ */ n(
|
|
3266
|
-
|
|
3294
|
+
se,
|
|
3267
3295
|
{
|
|
3268
|
-
value:
|
|
3269
|
-
onChange:
|
|
3270
|
-
onBlur:
|
|
3271
|
-
name:
|
|
3296
|
+
value: N.value || "",
|
|
3297
|
+
onChange: N.onChange,
|
|
3298
|
+
onBlur: N.onBlur,
|
|
3299
|
+
name: N.name,
|
|
3272
3300
|
placeholder: "Enter your answer...",
|
|
3273
|
-
error: (
|
|
3301
|
+
error: (k = (F = (L = (B = g.questionResults) == null ? void 0 : B[x]) == null ? void 0 : L[m]) == null ? void 0 : F.values) == null ? void 0 : k.message
|
|
3274
3302
|
}
|
|
3275
3303
|
);
|
|
3276
3304
|
}
|
|
3277
3305
|
}
|
|
3278
3306
|
),
|
|
3279
|
-
(
|
|
3280
|
-
|
|
3307
|
+
(C === "single-select" || C === "radio") && /* @__PURE__ */ n(
|
|
3308
|
+
te,
|
|
3281
3309
|
{
|
|
3282
3310
|
control: y,
|
|
3283
|
-
name: `questionResults.${
|
|
3284
|
-
render: ({ field:
|
|
3285
|
-
var
|
|
3311
|
+
name: `questionResults.${x}.${m}.values.0`,
|
|
3312
|
+
render: ({ field: N }) => {
|
|
3313
|
+
var B, L, F, k;
|
|
3286
3314
|
return /* @__PURE__ */ n(
|
|
3287
3315
|
ge,
|
|
3288
3316
|
{
|
|
3289
|
-
value:
|
|
3290
|
-
onChange:
|
|
3291
|
-
onBlur:
|
|
3292
|
-
name:
|
|
3293
|
-
options: p.defaultAnswers.map((
|
|
3294
|
-
value:
|
|
3295
|
-
label:
|
|
3317
|
+
value: N.value || "",
|
|
3318
|
+
onChange: N.onChange,
|
|
3319
|
+
onBlur: N.onBlur,
|
|
3320
|
+
name: N.name,
|
|
3321
|
+
options: p.defaultAnswers.map((T) => ({
|
|
3322
|
+
value: T,
|
|
3323
|
+
label: T
|
|
3296
3324
|
})),
|
|
3297
3325
|
placeholder: "Select an option...",
|
|
3298
|
-
error: (
|
|
3326
|
+
error: (k = (F = (L = (B = g.questionResults) == null ? void 0 : B[x]) == null ? void 0 : L[m]) == null ? void 0 : F.values) == null ? void 0 : k.message
|
|
3299
3327
|
}
|
|
3300
3328
|
);
|
|
3301
3329
|
}
|
|
3302
3330
|
}
|
|
3303
3331
|
),
|
|
3304
|
-
(
|
|
3332
|
+
(C === "checkbox" || C === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3305
3333
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
|
|
3306
3334
|
/* @__PURE__ */ n(
|
|
3307
|
-
|
|
3335
|
+
te,
|
|
3308
3336
|
{
|
|
3309
3337
|
control: y,
|
|
3310
|
-
name: `questionResults.${
|
|
3311
|
-
render: ({ field: { value:
|
|
3338
|
+
name: `questionResults.${x}.${m}.values`,
|
|
3339
|
+
render: ({ field: { value: N = [], onChange: B } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: p.defaultAnswers.map((L, F) => /* @__PURE__ */ o(
|
|
3312
3340
|
"label",
|
|
3313
3341
|
{
|
|
3314
3342
|
className: "flex items-center space-x-2 cursor-pointer",
|
|
@@ -3317,10 +3345,10 @@ const Wr = me.any(), kr = ({
|
|
|
3317
3345
|
"input",
|
|
3318
3346
|
{
|
|
3319
3347
|
type: "checkbox",
|
|
3320
|
-
checked: Array.isArray(
|
|
3321
|
-
onChange: (
|
|
3322
|
-
const
|
|
3323
|
-
|
|
3348
|
+
checked: Array.isArray(N) && N.includes(L),
|
|
3349
|
+
onChange: (k) => {
|
|
3350
|
+
const T = Array.isArray(N) ? N : [], D = k.target.checked ? [...T, L] : T.filter((G) => G !== L);
|
|
3351
|
+
B(D);
|
|
3324
3352
|
},
|
|
3325
3353
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3326
3354
|
}
|
|
@@ -3328,7 +3356,7 @@ const Wr = me.any(), kr = ({
|
|
|
3328
3356
|
/* @__PURE__ */ n("span", { className: "text-sm", children: L })
|
|
3329
3357
|
]
|
|
3330
3358
|
},
|
|
3331
|
-
`answer-${
|
|
3359
|
+
`answer-${x}-${m}-${F}`
|
|
3332
3360
|
)) })
|
|
3333
3361
|
}
|
|
3334
3362
|
)
|
|
@@ -3336,7 +3364,7 @@ const Wr = me.any(), kr = ({
|
|
|
3336
3364
|
] }, p.id);
|
|
3337
3365
|
})
|
|
3338
3366
|
) }),
|
|
3339
|
-
/* @__PURE__ */ o(
|
|
3367
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3340
3368
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3341
3369
|
/* @__PURE__ */ n(
|
|
3342
3370
|
j,
|
|
@@ -3360,12 +3388,12 @@ const Wr = me.any(), kr = ({
|
|
|
3360
3388
|
onComplete: e,
|
|
3361
3389
|
onBack: r
|
|
3362
3390
|
}) => {
|
|
3363
|
-
const { uploadDocument: a, isLoading: s, isSubmitting: i, error: l, submit: c } = Xt(t), [d, u] =
|
|
3364
|
-
if (
|
|
3391
|
+
const { uploadDocument: a, isLoading: s, isSubmitting: i, error: l, submit: c } = Xt(t), [d, u] = S({}), y = async (v) => {
|
|
3392
|
+
if (v.preventDefault(), !a) return;
|
|
3365
3393
|
const g = await Promise.all(
|
|
3366
3394
|
a.uploadDocumentFiles.map(async (h) => {
|
|
3367
|
-
const
|
|
3368
|
-
|
|
3395
|
+
const x = d[h.id] || [], p = await Promise.all(
|
|
3396
|
+
x.map(async (m) => ({
|
|
3369
3397
|
fileName: m.name,
|
|
3370
3398
|
fileData: await Ht(m)
|
|
3371
3399
|
}))
|
|
@@ -3375,36 +3403,36 @@ const Wr = me.any(), kr = ({
|
|
|
3375
3403
|
valueList: p
|
|
3376
3404
|
};
|
|
3377
3405
|
})
|
|
3378
|
-
),
|
|
3406
|
+
), w = {
|
|
3379
3407
|
applicantId: t,
|
|
3380
3408
|
uploadDocumentId: a.id,
|
|
3381
3409
|
uploadDocumentResults: g
|
|
3382
3410
|
};
|
|
3383
|
-
await c(
|
|
3411
|
+
await c(w), e == null || e();
|
|
3384
3412
|
};
|
|
3385
|
-
return s ? /* @__PURE__ */ n(
|
|
3413
|
+
return s ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(de, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3386
3414
|
"Error loading document requirements: ",
|
|
3387
3415
|
l.message
|
|
3388
|
-
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(
|
|
3389
|
-
/* @__PURE__ */ o(
|
|
3416
|
+
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(M, { children: [
|
|
3417
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3390
3418
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3391
3419
|
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3392
3420
|
] }),
|
|
3393
|
-
/* @__PURE__ */ n(
|
|
3421
|
+
/* @__PURE__ */ n(O, { className: "space-y-6", children: a.uploadDocumentFiles.map((v) => /* @__PURE__ */ n(
|
|
3394
3422
|
sr,
|
|
3395
3423
|
{
|
|
3396
|
-
label:
|
|
3397
|
-
accept:
|
|
3398
|
-
multiple:
|
|
3399
|
-
maxSize:
|
|
3400
|
-
value: d[
|
|
3424
|
+
label: v.displayName,
|
|
3425
|
+
accept: v.allowedTypes,
|
|
3426
|
+
multiple: v.multipleFile,
|
|
3427
|
+
maxSize: v.maxEachFileSizeByte,
|
|
3428
|
+
value: d[v.id] || [],
|
|
3401
3429
|
onChange: (g) => {
|
|
3402
|
-
u((
|
|
3430
|
+
u((w) => ({ ...w, [v.id]: g }));
|
|
3403
3431
|
}
|
|
3404
3432
|
},
|
|
3405
|
-
|
|
3433
|
+
v.id
|
|
3406
3434
|
)) }),
|
|
3407
|
-
/* @__PURE__ */ o(
|
|
3435
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3408
3436
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3409
3437
|
/* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
|
|
3410
3438
|
] })
|
|
@@ -3413,15 +3441,15 @@ const Wr = me.any(), kr = ({
|
|
|
3413
3441
|
const { overview: a, isLoading: s, isSubmitting: i, error: l, passOverview: c } = er(t), d = async () => {
|
|
3414
3442
|
await c(), e == null || e();
|
|
3415
3443
|
};
|
|
3416
|
-
return s ? /* @__PURE__ */ n(
|
|
3444
|
+
return s ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(de, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3417
3445
|
"Error loading overview: ",
|
|
3418
3446
|
l.message
|
|
3419
|
-
] }) }) }) : a ? /* @__PURE__ */ o(
|
|
3420
|
-
/* @__PURE__ */ o(
|
|
3447
|
+
] }) }) }) : a ? /* @__PURE__ */ o(M, { children: [
|
|
3448
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3421
3449
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
3422
3450
|
a.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
|
|
3423
3451
|
] }),
|
|
3424
|
-
/* @__PURE__ */ n(
|
|
3452
|
+
/* @__PURE__ */ n(O, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((u, y) => u.order - y.order).map((u) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3425
3453
|
/* @__PURE__ */ n("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: u.order + 1 }) }),
|
|
3426
3454
|
/* @__PURE__ */ o(
|
|
3427
3455
|
"div",
|
|
@@ -3440,7 +3468,7 @@ const Wr = me.any(), kr = ({
|
|
|
3440
3468
|
}
|
|
3441
3469
|
)
|
|
3442
3470
|
] }, u.order)) : /* @__PURE__ */ n("div", { className: "text-center py-8", children: /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
|
|
3443
|
-
/* @__PURE__ */ o(
|
|
3471
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3444
3472
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3445
3473
|
/* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Continue" })
|
|
3446
3474
|
] })
|
|
@@ -3450,148 +3478,148 @@ const Wr = me.any(), kr = ({
|
|
|
3450
3478
|
onComplete: e,
|
|
3451
3479
|
onBack: r
|
|
3452
3480
|
}) => {
|
|
3453
|
-
const { criteria: a, isLoading: s, isSubmitting: i, error: l, submit: c } = rr(t), [d, u] =
|
|
3481
|
+
const { criteria: a, isLoading: s, isSubmitting: i, error: l, submit: c } = rr(t), [d, u] = re.useState(!1), y = re.useMemo(() => !a || a.length === 0 ? { criteriaValueInputs: [] } : {
|
|
3454
3482
|
criteriaValueInputs: a.map((m) => ({
|
|
3455
3483
|
riskCriteriaId: m.id,
|
|
3456
3484
|
values: [""]
|
|
3457
3485
|
// Initialize with empty string to prevent uncontrolled input warning
|
|
3458
3486
|
}))
|
|
3459
|
-
}, [a]),
|
|
3487
|
+
}, [a]), v = a && a.length > 0 ? xr() : null, {
|
|
3460
3488
|
control: g,
|
|
3461
|
-
handleSubmit:
|
|
3489
|
+
handleSubmit: w,
|
|
3462
3490
|
formState: { errors: h }
|
|
3463
3491
|
} = Te({
|
|
3464
|
-
resolver:
|
|
3492
|
+
resolver: v ? Ze(v) : void 0,
|
|
3465
3493
|
defaultValues: y
|
|
3466
3494
|
});
|
|
3467
|
-
|
|
3495
|
+
re.useEffect(() => {
|
|
3468
3496
|
!s && a && a.length === 0 && !d && !i && (u(!0), c({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
|
|
3469
3497
|
}, [s, a, d, i, c, t, e]);
|
|
3470
|
-
const
|
|
3498
|
+
const x = async (m) => {
|
|
3471
3499
|
if (a)
|
|
3472
3500
|
try {
|
|
3473
3501
|
console.log("Risk scoring form submitted:", m), console.log("Criteria metadata:", a);
|
|
3474
|
-
const A = m.criteriaValueInputs.map((
|
|
3475
|
-
const L =
|
|
3476
|
-
return
|
|
3477
|
-
riskCriteriaId: a[
|
|
3478
|
-
values:
|
|
3502
|
+
const A = m.criteriaValueInputs.map((N, B) => {
|
|
3503
|
+
const L = N.values || [], F = Array.isArray(L) ? L.filter((k) => k && k.trim()) : L && L.toString().trim() ? [L.toString()] : [];
|
|
3504
|
+
return F.length === 0 ? null : {
|
|
3505
|
+
riskCriteriaId: a[B].id,
|
|
3506
|
+
values: F
|
|
3479
3507
|
};
|
|
3480
|
-
}).filter((
|
|
3508
|
+
}).filter((N) => N !== null);
|
|
3481
3509
|
console.log("Risk scoring criteriaValueInputs to submit:", A);
|
|
3482
|
-
const
|
|
3510
|
+
const C = {
|
|
3483
3511
|
applicantId: t,
|
|
3484
3512
|
criteriaValueInputs: A
|
|
3485
3513
|
};
|
|
3486
|
-
console.log("Final risk scoring input:",
|
|
3514
|
+
console.log("Final risk scoring input:", C), await c(C), console.log("Risk scoring submitted successfully!"), e == null || e();
|
|
3487
3515
|
} catch (A) {
|
|
3488
3516
|
throw console.error("Error submitting risk scoring:", A), A;
|
|
3489
3517
|
}
|
|
3490
3518
|
}, p = (m) => m.builtInType === 1 ? "country" : !m.defaultValues || m.defaultValues.length === 0 ? "text" : m.multipleValue ? "checkbox" : "radio";
|
|
3491
|
-
return s ? /* @__PURE__ */ n(
|
|
3519
|
+
return s ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
3492
3520
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3493
3521
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
|
|
3494
|
-
] }) }) : l ? /* @__PURE__ */ n(
|
|
3522
|
+
] }) }) : l ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3495
3523
|
"Error loading criteria: ",
|
|
3496
3524
|
l.message
|
|
3497
|
-
] }) }) }) : !s && a && a.length === 0 ? /* @__PURE__ */ n(
|
|
3525
|
+
] }) }) }) : !s && a && a.length === 0 ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
3498
3526
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3499
3527
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
|
|
3500
|
-
] }) }) : a ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3501
|
-
/* @__PURE__ */ o(
|
|
3528
|
+
] }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: w(x), children: /* @__PURE__ */ o(M, { children: [
|
|
3529
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3502
3530
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3503
3531
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
|
|
3504
3532
|
] }),
|
|
3505
|
-
/* @__PURE__ */ n(
|
|
3506
|
-
var
|
|
3507
|
-
const
|
|
3533
|
+
/* @__PURE__ */ n(O, { className: "space-y-8", children: a.map((m, A) => {
|
|
3534
|
+
var N, B, L;
|
|
3535
|
+
const C = p(m);
|
|
3508
3536
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3509
3537
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3510
3538
|
m.displayName,
|
|
3511
3539
|
m.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3512
3540
|
] }),
|
|
3513
3541
|
m.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: m.description }),
|
|
3514
|
-
|
|
3515
|
-
|
|
3542
|
+
C === "text" && /* @__PURE__ */ n(
|
|
3543
|
+
te,
|
|
3516
3544
|
{
|
|
3517
3545
|
control: g,
|
|
3518
3546
|
name: `criteriaValueInputs.${A}.values.0`,
|
|
3519
|
-
render: ({ field:
|
|
3520
|
-
var
|
|
3547
|
+
render: ({ field: F }) => {
|
|
3548
|
+
var k, T, D;
|
|
3521
3549
|
return /* @__PURE__ */ n(
|
|
3522
|
-
|
|
3550
|
+
se,
|
|
3523
3551
|
{
|
|
3524
|
-
...
|
|
3525
|
-
value:
|
|
3526
|
-
type: m.valueDataType ===
|
|
3552
|
+
...F,
|
|
3553
|
+
value: F.value || "",
|
|
3554
|
+
type: m.valueDataType === De.DigitOnly ? "number" : "text",
|
|
3527
3555
|
placeholder: "Enter your answer...",
|
|
3528
|
-
error: (
|
|
3529
|
-
onKeyDown: (
|
|
3530
|
-
m.valueDataType ===
|
|
3556
|
+
error: (D = (T = (k = h.criteriaValueInputs) == null ? void 0 : k[A]) == null ? void 0 : T.values) == null ? void 0 : D.message,
|
|
3557
|
+
onKeyDown: (G) => {
|
|
3558
|
+
m.valueDataType === De.DigitOnly && ["e", "E", "+", "-", "."].includes(G.key) && G.preventDefault();
|
|
3531
3559
|
}
|
|
3532
3560
|
}
|
|
3533
3561
|
);
|
|
3534
3562
|
}
|
|
3535
3563
|
}
|
|
3536
3564
|
),
|
|
3537
|
-
|
|
3565
|
+
C === "radio" && m.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3538
3566
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
|
|
3539
3567
|
/* @__PURE__ */ n(
|
|
3540
|
-
|
|
3568
|
+
te,
|
|
3541
3569
|
{
|
|
3542
3570
|
control: g,
|
|
3543
3571
|
name: `criteriaValueInputs.${A}.values.0`,
|
|
3544
|
-
render: ({ field: { value:
|
|
3572
|
+
render: ({ field: { value: F, onChange: k } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: m.defaultValues.map((T, D) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3545
3573
|
/* @__PURE__ */ n(
|
|
3546
3574
|
"input",
|
|
3547
3575
|
{
|
|
3548
3576
|
type: "radio",
|
|
3549
|
-
checked:
|
|
3550
|
-
onChange: () =>
|
|
3577
|
+
checked: F === T,
|
|
3578
|
+
onChange: () => k(T),
|
|
3551
3579
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3552
3580
|
}
|
|
3553
3581
|
),
|
|
3554
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3555
|
-
] }, `${A}-${
|
|
3582
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: T })
|
|
3583
|
+
] }, `${A}-${D}`)) })
|
|
3556
3584
|
}
|
|
3557
3585
|
)
|
|
3558
3586
|
] }),
|
|
3559
|
-
|
|
3587
|
+
C === "checkbox" && m.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3560
3588
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
|
|
3561
3589
|
/* @__PURE__ */ n(
|
|
3562
|
-
|
|
3590
|
+
te,
|
|
3563
3591
|
{
|
|
3564
3592
|
control: g,
|
|
3565
3593
|
name: `criteriaValueInputs.${A}.values`,
|
|
3566
|
-
render: ({ field: { value:
|
|
3594
|
+
render: ({ field: { value: F = [], onChange: k } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: m.defaultValues.map((T, D) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3567
3595
|
/* @__PURE__ */ n(
|
|
3568
3596
|
"input",
|
|
3569
3597
|
{
|
|
3570
3598
|
type: "checkbox",
|
|
3571
|
-
checked: Array.isArray(
|
|
3572
|
-
onChange: (
|
|
3573
|
-
const
|
|
3574
|
-
|
|
3599
|
+
checked: Array.isArray(F) && F.includes(T),
|
|
3600
|
+
onChange: (G) => {
|
|
3601
|
+
const K = Array.isArray(F) ? F : [], R = G.target.checked ? [...K, T] : K.filter((E) => E !== T);
|
|
3602
|
+
k(R);
|
|
3575
3603
|
},
|
|
3576
3604
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3577
3605
|
}
|
|
3578
3606
|
),
|
|
3579
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3580
|
-
] }, `${A}-${
|
|
3607
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: T })
|
|
3608
|
+
] }, `${A}-${D}`)) })
|
|
3581
3609
|
}
|
|
3582
3610
|
)
|
|
3583
3611
|
] }),
|
|
3584
|
-
|
|
3585
|
-
|
|
3612
|
+
C === "country" && /* @__PURE__ */ n(
|
|
3613
|
+
te,
|
|
3586
3614
|
{
|
|
3587
3615
|
control: g,
|
|
3588
3616
|
name: `criteriaValueInputs.${A}.values.0`,
|
|
3589
|
-
render: ({ field:
|
|
3590
|
-
var
|
|
3617
|
+
render: ({ field: F }) => {
|
|
3618
|
+
var k, T, D;
|
|
3591
3619
|
return /* @__PURE__ */ n(
|
|
3592
3620
|
ge,
|
|
3593
3621
|
{
|
|
3594
|
-
...
|
|
3622
|
+
...F,
|
|
3595
3623
|
options: [
|
|
3596
3624
|
{ value: "US", label: "United States" },
|
|
3597
3625
|
{ value: "GB", label: "United Kingdom" },
|
|
@@ -3599,16 +3627,16 @@ const Wr = me.any(), kr = ({
|
|
|
3599
3627
|
// TODO: Load from base information service
|
|
3600
3628
|
],
|
|
3601
3629
|
placeholder: "Select a country...",
|
|
3602
|
-
error: (
|
|
3630
|
+
error: (D = (T = (k = h.criteriaValueInputs) == null ? void 0 : k[A]) == null ? void 0 : T.values) == null ? void 0 : D.message
|
|
3603
3631
|
}
|
|
3604
3632
|
);
|
|
3605
3633
|
}
|
|
3606
3634
|
}
|
|
3607
3635
|
),
|
|
3608
|
-
((L = (
|
|
3636
|
+
((L = (B = (N = h.criteriaValueInputs) == null ? void 0 : N[A]) == null ? void 0 : B.values) == null ? void 0 : L.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: h.criteriaValueInputs[A].values.message })
|
|
3609
3637
|
] }, m.id);
|
|
3610
3638
|
}) }),
|
|
3611
|
-
/* @__PURE__ */ o(
|
|
3639
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3612
3640
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3613
3641
|
/* @__PURE__ */ n(
|
|
3614
3642
|
j,
|
|
@@ -3632,9 +3660,9 @@ const Wr = me.any(), kr = ({
|
|
|
3632
3660
|
onComplete: e,
|
|
3633
3661
|
onBack: r
|
|
3634
3662
|
}) => {
|
|
3635
|
-
const { investorCategorizationService: a } =
|
|
3636
|
-
return /* @__PURE__ */ n("form", { onSubmit: async (
|
|
3637
|
-
if (
|
|
3663
|
+
const { investorCategorizationService: a } = oe(), [s, i] = S(null), [l, c] = S(!1), [d, u] = S(null);
|
|
3664
|
+
return /* @__PURE__ */ n("form", { onSubmit: async (v) => {
|
|
3665
|
+
if (v.preventDefault(), s === null) {
|
|
3638
3666
|
u("Please select an investor type");
|
|
3639
3667
|
return;
|
|
3640
3668
|
}
|
|
@@ -3645,26 +3673,26 @@ const Wr = me.any(), kr = ({
|
|
|
3645
3673
|
investorType: s
|
|
3646
3674
|
};
|
|
3647
3675
|
console.log("Submitting investor categorization:", g);
|
|
3648
|
-
const
|
|
3649
|
-
console.log("Investor categorization result:",
|
|
3676
|
+
const w = await a.setInvestorCategorization(g);
|
|
3677
|
+
console.log("Investor categorization result:", w), e == null || e();
|
|
3650
3678
|
} catch (g) {
|
|
3651
3679
|
console.error("Error submitting investor categorization:", g), u(g.message || "Failed to submit investor categorization");
|
|
3652
3680
|
} finally {
|
|
3653
3681
|
c(!1);
|
|
3654
3682
|
}
|
|
3655
|
-
}, children: /* @__PURE__ */ o(
|
|
3656
|
-
/* @__PURE__ */ o(
|
|
3683
|
+
}, children: /* @__PURE__ */ o(M, { children: [
|
|
3684
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3657
3685
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
|
|
3658
3686
|
/* @__PURE__ */ n("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" })
|
|
3659
3687
|
] }),
|
|
3660
|
-
/* @__PURE__ */ o(
|
|
3688
|
+
/* @__PURE__ */ o(O, { className: "space-y-4", children: [
|
|
3661
3689
|
/* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
|
|
3662
3690
|
/* @__PURE__ */ n(
|
|
3663
3691
|
"label",
|
|
3664
3692
|
{
|
|
3665
3693
|
className: `
|
|
3666
3694
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3667
|
-
${s ===
|
|
3695
|
+
${s === ae.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"}
|
|
3668
3696
|
`,
|
|
3669
3697
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3670
3698
|
/* @__PURE__ */ n(
|
|
@@ -3672,9 +3700,9 @@ const Wr = me.any(), kr = ({
|
|
|
3672
3700
|
{
|
|
3673
3701
|
type: "radio",
|
|
3674
3702
|
name: "investorType",
|
|
3675
|
-
value:
|
|
3676
|
-
checked: s ===
|
|
3677
|
-
onChange: () => i(
|
|
3703
|
+
value: ae.Individual,
|
|
3704
|
+
checked: s === ae.Individual,
|
|
3705
|
+
onChange: () => i(ae.Individual),
|
|
3678
3706
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3679
3707
|
}
|
|
3680
3708
|
),
|
|
@@ -3690,7 +3718,7 @@ const Wr = me.any(), kr = ({
|
|
|
3690
3718
|
{
|
|
3691
3719
|
className: `
|
|
3692
3720
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3693
|
-
${s ===
|
|
3721
|
+
${s === ae.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"}
|
|
3694
3722
|
`,
|
|
3695
3723
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3696
3724
|
/* @__PURE__ */ n(
|
|
@@ -3698,9 +3726,9 @@ const Wr = me.any(), kr = ({
|
|
|
3698
3726
|
{
|
|
3699
3727
|
type: "radio",
|
|
3700
3728
|
name: "investorType",
|
|
3701
|
-
value:
|
|
3702
|
-
checked: s ===
|
|
3703
|
-
onChange: () => i(
|
|
3729
|
+
value: ae.Sophisticated,
|
|
3730
|
+
checked: s === ae.Sophisticated,
|
|
3731
|
+
onChange: () => i(ae.Sophisticated),
|
|
3704
3732
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3705
3733
|
}
|
|
3706
3734
|
),
|
|
@@ -3721,7 +3749,7 @@ const Wr = me.any(), kr = ({
|
|
|
3721
3749
|
{
|
|
3722
3750
|
className: `
|
|
3723
3751
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3724
|
-
${s ===
|
|
3752
|
+
${s === ae.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"}
|
|
3725
3753
|
`,
|
|
3726
3754
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3727
3755
|
/* @__PURE__ */ n(
|
|
@@ -3729,9 +3757,9 @@ const Wr = me.any(), kr = ({
|
|
|
3729
3757
|
{
|
|
3730
3758
|
type: "radio",
|
|
3731
3759
|
name: "investorType",
|
|
3732
|
-
value:
|
|
3733
|
-
checked: s ===
|
|
3734
|
-
onChange: () => i(
|
|
3760
|
+
value: ae.HighNetWorth,
|
|
3761
|
+
checked: s === ae.HighNetWorth,
|
|
3762
|
+
onChange: () => i(ae.HighNetWorth),
|
|
3735
3763
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3736
3764
|
}
|
|
3737
3765
|
),
|
|
@@ -3752,7 +3780,7 @@ const Wr = me.any(), kr = ({
|
|
|
3752
3780
|
d
|
|
3753
3781
|
] }) })
|
|
3754
3782
|
] }),
|
|
3755
|
-
/* @__PURE__ */ o(
|
|
3783
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3756
3784
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3757
3785
|
/* @__PURE__ */ n(
|
|
3758
3786
|
j,
|
|
@@ -3770,135 +3798,135 @@ const Wr = me.any(), kr = ({
|
|
|
3770
3798
|
onComplete: e,
|
|
3771
3799
|
onBack: r
|
|
3772
3800
|
}) => {
|
|
3773
|
-
const { appropriatenessTestService: a } =
|
|
3774
|
-
|
|
3801
|
+
const { appropriatenessTestService: a } = oe(), [s, i] = S(null), [l, c] = S(!0), [d, u] = S(!1), [y, v] = S(null), [g, w] = S({}), [h, x] = S(0), [p, m] = S(!1), [A, C] = S(!1), [N, B] = S(0);
|
|
3802
|
+
Q(() => {
|
|
3775
3803
|
(async () => {
|
|
3776
3804
|
try {
|
|
3777
|
-
c(!0),
|
|
3778
|
-
const
|
|
3779
|
-
if (console.log("Appropriateness test data:",
|
|
3780
|
-
const
|
|
3781
|
-
|
|
3805
|
+
c(!0), v(null), console.log("Loading appropriateness test for applicant:", t);
|
|
3806
|
+
const E = await a.getAppropriatenessTest(t);
|
|
3807
|
+
if (console.log("Appropriateness test data:", E), i(E), E.waitTimeSpanForNextTry && E.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3808
|
+
const H = L(E.waitTimeSpanForNextTry);
|
|
3809
|
+
H > 0 && B(H);
|
|
3782
3810
|
}
|
|
3783
|
-
} catch (
|
|
3784
|
-
console.error("Error loading appropriateness test:",
|
|
3811
|
+
} catch (E) {
|
|
3812
|
+
console.error("Error loading appropriateness test:", E), v(E.message || "Failed to load appropriateness test");
|
|
3785
3813
|
} finally {
|
|
3786
3814
|
c(!1);
|
|
3787
3815
|
}
|
|
3788
3816
|
})();
|
|
3789
3817
|
}, [t, a]);
|
|
3790
|
-
const L = (
|
|
3791
|
-
const
|
|
3792
|
-
if (
|
|
3793
|
-
const [
|
|
3794
|
-
return
|
|
3818
|
+
const L = (R) => {
|
|
3819
|
+
const E = R.split(":").map(Number);
|
|
3820
|
+
if (E.length === 3) {
|
|
3821
|
+
const [H, b, P] = E;
|
|
3822
|
+
return H * 3600 + b * 60 + P;
|
|
3795
3823
|
}
|
|
3796
3824
|
return 0;
|
|
3797
|
-
},
|
|
3798
|
-
const
|
|
3799
|
-
return `${
|
|
3825
|
+
}, F = (R) => {
|
|
3826
|
+
const E = Math.floor(R / 60), H = R % 60;
|
|
3827
|
+
return `${E.toString().padStart(2, "0")}:${H.toString().padStart(2, "0")}`;
|
|
3800
3828
|
};
|
|
3801
|
-
|
|
3829
|
+
Q(() => {
|
|
3802
3830
|
if (!p || h <= 0) return;
|
|
3803
|
-
const
|
|
3804
|
-
|
|
3831
|
+
const R = setInterval(() => {
|
|
3832
|
+
x((E) => E <= 1 ? (C(!0), 0) : E - 1);
|
|
3805
3833
|
}, 1e3);
|
|
3806
|
-
return () => clearInterval(
|
|
3807
|
-
}, [p, h]),
|
|
3808
|
-
if (
|
|
3809
|
-
const
|
|
3810
|
-
|
|
3834
|
+
return () => clearInterval(R);
|
|
3835
|
+
}, [p, h]), Q(() => {
|
|
3836
|
+
if (N <= 0) return;
|
|
3837
|
+
const R = setInterval(() => {
|
|
3838
|
+
B((E) => E <= 1 ? 0 : E - 1);
|
|
3811
3839
|
}, 1e3);
|
|
3812
|
-
return () => clearInterval(
|
|
3813
|
-
}, [
|
|
3814
|
-
A && !d &&
|
|
3840
|
+
return () => clearInterval(R);
|
|
3841
|
+
}, [N]), Q(() => {
|
|
3842
|
+
A && !d && D();
|
|
3815
3843
|
}, [A]);
|
|
3816
|
-
const
|
|
3817
|
-
s && (m(!0),
|
|
3818
|
-
},
|
|
3819
|
-
|
|
3820
|
-
...
|
|
3821
|
-
[
|
|
3844
|
+
const k = () => {
|
|
3845
|
+
s && (m(!0), x(s.testDurationSec));
|
|
3846
|
+
}, T = (R, E) => {
|
|
3847
|
+
w((H) => ({
|
|
3848
|
+
...H,
|
|
3849
|
+
[R]: E
|
|
3822
3850
|
}));
|
|
3823
|
-
},
|
|
3824
|
-
if (
|
|
3851
|
+
}, D = async (R) => {
|
|
3852
|
+
if (R && R.preventDefault(), !!s) {
|
|
3825
3853
|
if (!A) {
|
|
3826
|
-
const
|
|
3827
|
-
if (
|
|
3828
|
-
|
|
3854
|
+
const E = s.appropriatenessQuestions.length - Object.keys(g).length;
|
|
3855
|
+
if (E > 0) {
|
|
3856
|
+
v(`Please answer all questions. ${E} question(s) remaining.`);
|
|
3829
3857
|
return;
|
|
3830
3858
|
}
|
|
3831
3859
|
}
|
|
3832
|
-
u(!0),
|
|
3860
|
+
u(!0), v(null);
|
|
3833
3861
|
try {
|
|
3834
|
-
const
|
|
3835
|
-
(
|
|
3836
|
-
appropriatenessQuestionId:
|
|
3837
|
-
value: g[
|
|
3862
|
+
const E = s.appropriatenessQuestions.map(
|
|
3863
|
+
(b) => ({
|
|
3864
|
+
appropriatenessQuestionId: b.id,
|
|
3865
|
+
value: g[b.id] || ""
|
|
3838
3866
|
// Empty string if not answered
|
|
3839
3867
|
})
|
|
3840
|
-
),
|
|
3868
|
+
), H = {
|
|
3841
3869
|
applicantId: t,
|
|
3842
3870
|
appropriatenessTestId: s.id,
|
|
3843
|
-
appropriatenessQuestionResults:
|
|
3871
|
+
appropriatenessQuestionResults: E
|
|
3844
3872
|
};
|
|
3845
|
-
console.log("Submitting appropriateness test:",
|
|
3873
|
+
console.log("Submitting appropriateness test:", H);
|
|
3846
3874
|
try {
|
|
3847
|
-
const
|
|
3848
|
-
console.log("Appropriateness test result:",
|
|
3849
|
-
} catch (
|
|
3850
|
-
if (
|
|
3851
|
-
const
|
|
3852
|
-
console.log("Test failed:",
|
|
3875
|
+
const b = await a.fillAppropriatenessTest(H);
|
|
3876
|
+
console.log("Appropriateness test result:", b), b.message && (b.message.toLowerCase().includes("pass") || b.message.toLowerCase().includes("success") || b.message.toLowerCase().includes("congratulations")) ? e == null || e() : (v(b.message || "Test completed. Please check the result."), m(!1), C(!1), w({}), setTimeout(() => G(), 1e3));
|
|
3877
|
+
} catch (b) {
|
|
3878
|
+
if (b.code === 400 && b.message) {
|
|
3879
|
+
const P = b.message;
|
|
3880
|
+
console.log("Test failed:", P), v(P), m(!1), C(!1), w({}), setTimeout(() => G(), 1500);
|
|
3853
3881
|
} else
|
|
3854
|
-
throw
|
|
3882
|
+
throw b;
|
|
3855
3883
|
}
|
|
3856
|
-
} catch (
|
|
3857
|
-
console.error("Error submitting appropriateness test:",
|
|
3884
|
+
} catch (E) {
|
|
3885
|
+
console.error("Error submitting appropriateness test:", E), v(E.message || "Failed to submit test. Please try again."), m(!1), C(!1), w({});
|
|
3858
3886
|
} finally {
|
|
3859
3887
|
u(!1);
|
|
3860
3888
|
}
|
|
3861
3889
|
}
|
|
3862
|
-
},
|
|
3890
|
+
}, G = async () => {
|
|
3863
3891
|
try {
|
|
3864
|
-
const
|
|
3865
|
-
if (console.log("Reloaded test data:",
|
|
3866
|
-
const
|
|
3867
|
-
|
|
3892
|
+
const R = await a.getAppropriatenessTest(t);
|
|
3893
|
+
if (console.log("Reloaded test data:", R), i(R), R.waitTimeSpanForNextTry && R.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3894
|
+
const E = L(R.waitTimeSpanForNextTry);
|
|
3895
|
+
E > 0 && B(E);
|
|
3868
3896
|
}
|
|
3869
|
-
} catch (
|
|
3870
|
-
console.error("Error reloading test data:",
|
|
3897
|
+
} catch (R) {
|
|
3898
|
+
console.error("Error reloading test data:", R), v((E) => E + `
|
|
3871
3899
|
|
|
3872
3900
|
Failed to reload test data. Please refresh the page.`);
|
|
3873
3901
|
}
|
|
3874
3902
|
};
|
|
3875
3903
|
if (l)
|
|
3876
|
-
return /* @__PURE__ */ n(
|
|
3904
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
3877
3905
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3878
3906
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
3879
3907
|
] }) });
|
|
3880
3908
|
if (!s)
|
|
3881
|
-
return /* @__PURE__ */ n(
|
|
3909
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { className: "py-12 text-center", children: [
|
|
3882
3910
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
3883
3911
|
y && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: y })
|
|
3884
3912
|
] }) });
|
|
3885
|
-
if (
|
|
3886
|
-
return /* @__PURE__ */ o(
|
|
3887
|
-
/* @__PURE__ */ o(
|
|
3913
|
+
if (N > 0)
|
|
3914
|
+
return /* @__PURE__ */ o(M, { children: [
|
|
3915
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3888
3916
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
3889
3917
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
3890
3918
|
] }),
|
|
3891
|
-
/* @__PURE__ */ o(
|
|
3919
|
+
/* @__PURE__ */ o(O, { className: "py-12 text-center", children: [
|
|
3892
3920
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
3893
|
-
/* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children:
|
|
3921
|
+
/* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: F(N) }),
|
|
3894
3922
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
3895
3923
|
] }),
|
|
3896
3924
|
y && /* @__PURE__ */ n("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__ */ n("p", { className: "text-red-600 dark:text-red-400 text-sm", children: y }) })
|
|
3897
3925
|
] })
|
|
3898
3926
|
] });
|
|
3899
|
-
const
|
|
3900
|
-
return p ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3901
|
-
/* @__PURE__ */ n(
|
|
3927
|
+
const K = s.testAllowedMaxTry - s.totalFailedTries;
|
|
3928
|
+
return p ? /* @__PURE__ */ n("form", { onSubmit: D, children: /* @__PURE__ */ o(M, { children: [
|
|
3929
|
+
/* @__PURE__ */ n(ne, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
3902
3930
|
/* @__PURE__ */ o("div", { children: [
|
|
3903
3931
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
3904
3932
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
@@ -3908,13 +3936,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3908
3936
|
"div",
|
|
3909
3937
|
{
|
|
3910
3938
|
className: `text-3xl font-bold ${h <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
3911
|
-
children:
|
|
3939
|
+
children: F(h)
|
|
3912
3940
|
}
|
|
3913
3941
|
),
|
|
3914
3942
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
3915
3943
|
] })
|
|
3916
3944
|
] }) }),
|
|
3917
|
-
/* @__PURE__ */ o(
|
|
3945
|
+
/* @__PURE__ */ o(O, { className: "space-y-6", children: [
|
|
3918
3946
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
3919
3947
|
/* @__PURE__ */ o(pe, { variant: "info", children: [
|
|
3920
3948
|
"Question ",
|
|
@@ -3922,14 +3950,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3922
3950
|
" of ",
|
|
3923
3951
|
s.totalQuestionCount
|
|
3924
3952
|
] }),
|
|
3925
|
-
/* @__PURE__ */ o(pe, { variant:
|
|
3926
|
-
|
|
3953
|
+
/* @__PURE__ */ o(pe, { variant: K > 1 ? "success" : "warning", children: [
|
|
3954
|
+
K,
|
|
3927
3955
|
" attempt",
|
|
3928
|
-
|
|
3956
|
+
K !== 1 ? "s" : "",
|
|
3929
3957
|
" remaining"
|
|
3930
3958
|
] })
|
|
3931
3959
|
] }),
|
|
3932
|
-
s.appropriatenessQuestions.map((
|
|
3960
|
+
s.appropriatenessQuestions.map((R, E) => /* @__PURE__ */ o(
|
|
3933
3961
|
"div",
|
|
3934
3962
|
{
|
|
3935
3963
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -3937,39 +3965,39 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3937
3965
|
/* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
3938
3966
|
/* @__PURE__ */ o("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
|
|
3939
3967
|
"Question ",
|
|
3940
|
-
|
|
3968
|
+
E + 1
|
|
3941
3969
|
] }),
|
|
3942
|
-
|
|
3943
|
-
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children:
|
|
3970
|
+
R.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: R.groupName }),
|
|
3971
|
+
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: R.question })
|
|
3944
3972
|
] }),
|
|
3945
|
-
/* @__PURE__ */ n("div", { className: "space-y-2", children:
|
|
3973
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: R.answers.map((H, b) => /* @__PURE__ */ o(
|
|
3946
3974
|
"label",
|
|
3947
3975
|
{
|
|
3948
3976
|
className: `
|
|
3949
3977
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
3950
|
-
${g[
|
|
3978
|
+
${g[R.id] === H ? "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"}
|
|
3951
3979
|
`,
|
|
3952
3980
|
children: [
|
|
3953
3981
|
/* @__PURE__ */ n(
|
|
3954
3982
|
"input",
|
|
3955
3983
|
{
|
|
3956
3984
|
type: "radio",
|
|
3957
|
-
name: `question-${
|
|
3958
|
-
value:
|
|
3959
|
-
checked: g[
|
|
3960
|
-
onChange: (
|
|
3985
|
+
name: `question-${R.id}`,
|
|
3986
|
+
value: H,
|
|
3987
|
+
checked: g[R.id] === H,
|
|
3988
|
+
onChange: (P) => T(R.id, P.target.value),
|
|
3961
3989
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
3962
3990
|
disabled: d
|
|
3963
3991
|
}
|
|
3964
3992
|
),
|
|
3965
|
-
/* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children:
|
|
3993
|
+
/* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: H })
|
|
3966
3994
|
]
|
|
3967
3995
|
},
|
|
3968
|
-
|
|
3996
|
+
b
|
|
3969
3997
|
)) })
|
|
3970
3998
|
]
|
|
3971
3999
|
},
|
|
3972
|
-
|
|
4000
|
+
R.id
|
|
3973
4001
|
)),
|
|
3974
4002
|
y && !A && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
3975
4003
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
@@ -3981,7 +4009,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3981
4009
|
" Your answers are being submitted automatically."
|
|
3982
4010
|
] }) })
|
|
3983
4011
|
] }),
|
|
3984
|
-
/* @__PURE__ */ o(
|
|
4012
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3985
4013
|
/* @__PURE__ */ n(
|
|
3986
4014
|
j,
|
|
3987
4015
|
{
|
|
@@ -4002,12 +4030,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4002
4030
|
}
|
|
4003
4031
|
)
|
|
4004
4032
|
] })
|
|
4005
|
-
] }) }) : /* @__PURE__ */ o(
|
|
4006
|
-
/* @__PURE__ */ o(
|
|
4033
|
+
] }) }) : /* @__PURE__ */ o(M, { children: [
|
|
4034
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4007
4035
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4008
4036
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
4009
4037
|
] }),
|
|
4010
|
-
/* @__PURE__ */ o(
|
|
4038
|
+
/* @__PURE__ */ o(O, { children: [
|
|
4011
4039
|
s.description && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-gray-700 dark:text-gray-300", children: s.description }) }),
|
|
4012
4040
|
/* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
|
|
4013
4041
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
@@ -4016,7 +4044,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4016
4044
|
] }),
|
|
4017
4045
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4018
4046
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4019
|
-
/* @__PURE__ */ n(pe, { variant: "info", children:
|
|
4047
|
+
/* @__PURE__ */ n(pe, { variant: "info", children: F(s.testDurationSec) })
|
|
4020
4048
|
] }),
|
|
4021
4049
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4022
4050
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
@@ -4024,7 +4052,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4024
4052
|
] }),
|
|
4025
4053
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4026
4054
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4027
|
-
/* @__PURE__ */ n(pe, { variant:
|
|
4055
|
+
/* @__PURE__ */ n(pe, { variant: K > 1 ? "success" : "warning", children: K })
|
|
4028
4056
|
] })
|
|
4029
4057
|
] }),
|
|
4030
4058
|
y && /* @__PURE__ */ n("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__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -4032,16 +4060,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4032
4060
|
" ",
|
|
4033
4061
|
y
|
|
4034
4062
|
] }) }),
|
|
4035
|
-
|
|
4063
|
+
K <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
4036
4064
|
] }),
|
|
4037
|
-
/* @__PURE__ */ o(
|
|
4065
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4038
4066
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4039
4067
|
/* @__PURE__ */ n(
|
|
4040
4068
|
j,
|
|
4041
4069
|
{
|
|
4042
4070
|
type: "button",
|
|
4043
|
-
onClick:
|
|
4044
|
-
disabled:
|
|
4071
|
+
onClick: k,
|
|
4072
|
+
disabled: K <= 0,
|
|
4045
4073
|
children: "Start Test"
|
|
4046
4074
|
}
|
|
4047
4075
|
)
|
|
@@ -4052,8 +4080,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4052
4080
|
onComplete: e,
|
|
4053
4081
|
onBack: r
|
|
4054
4082
|
}) => {
|
|
4055
|
-
var
|
|
4056
|
-
const { applicantService: a, baseInformationService: s, config: i } =
|
|
4083
|
+
var H, b, P, $;
|
|
4084
|
+
const { applicantService: a, baseInformationService: s, config: i } = oe(), { identityData: l, provider: c, token: d, isLoading: u, error: y, requestIdentity: v, restartIdentity: g } = tr(t), [w, h] = S(null), [x, p] = S(null), [m, A] = S([]), [C, N] = S(!0), [B, L] = S(!1), [F, k] = S(null), [T, D] = S(!1), G = re.useRef(!1), K = Te({
|
|
4057
4085
|
defaultValues: {
|
|
4058
4086
|
street: "",
|
|
4059
4087
|
streetNumber: "",
|
|
@@ -4064,163 +4092,163 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4064
4092
|
phonenumber: ""
|
|
4065
4093
|
}
|
|
4066
4094
|
});
|
|
4067
|
-
|
|
4095
|
+
Q(() => {
|
|
4068
4096
|
(async () => {
|
|
4069
4097
|
try {
|
|
4070
|
-
const [
|
|
4098
|
+
const [f, _] = await Promise.all([
|
|
4071
4099
|
a.getApplicantData(t),
|
|
4072
4100
|
s.getCountries("", "en")
|
|
4073
4101
|
]);
|
|
4074
|
-
p(
|
|
4075
|
-
const
|
|
4102
|
+
p(f);
|
|
4103
|
+
const W = /* @__PURE__ */ new Set(), X = _.filter((he) => {
|
|
4076
4104
|
const Ae = he.abbreviation3 || he.abbreviation;
|
|
4077
|
-
return !Ae ||
|
|
4105
|
+
return !Ae || W.has(Ae) ? !1 : (W.add(Ae), !0);
|
|
4078
4106
|
});
|
|
4079
|
-
A(
|
|
4080
|
-
const
|
|
4081
|
-
if (
|
|
4082
|
-
street: (
|
|
4083
|
-
streetNumber: (
|
|
4084
|
-
city: (
|
|
4085
|
-
zip: (
|
|
4086
|
-
country: (
|
|
4087
|
-
nationality: (
|
|
4088
|
-
phonenumber: (
|
|
4089
|
-
}),
|
|
4090
|
-
console.log("[Identity] Found existing identity verification, auto-requesting..."),
|
|
4107
|
+
A(X);
|
|
4108
|
+
const q = f.applicantRequestData;
|
|
4109
|
+
if (K.reset({
|
|
4110
|
+
street: (q == null ? void 0 : q.street) || "",
|
|
4111
|
+
streetNumber: (q == null ? void 0 : q.streetNumber) || "",
|
|
4112
|
+
city: (q == null ? void 0 : q.city) || "",
|
|
4113
|
+
zip: (q == null ? void 0 : q.zip) || "",
|
|
4114
|
+
country: (q == null ? void 0 : q.country) || "",
|
|
4115
|
+
nationality: (q == null ? void 0 : q.nationality) || "",
|
|
4116
|
+
phonenumber: (q == null ? void 0 : q.phonenumber) || ""
|
|
4117
|
+
}), f.kycRecords && f.kycRecords.length > 0 && f.kycRecords[0].providerTokenObject !== null && !G.current) {
|
|
4118
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), G.current = !0;
|
|
4091
4119
|
try {
|
|
4092
|
-
await
|
|
4120
|
+
await v(), L(!0);
|
|
4093
4121
|
} catch (he) {
|
|
4094
4122
|
console.error("[Identity] Auto-request failed:", he);
|
|
4095
4123
|
}
|
|
4096
4124
|
}
|
|
4097
|
-
} catch (
|
|
4098
|
-
console.error("Error loading applicant data:",
|
|
4125
|
+
} catch (f) {
|
|
4126
|
+
console.error("Error loading applicant data:", f);
|
|
4099
4127
|
} finally {
|
|
4100
|
-
|
|
4128
|
+
N(!1);
|
|
4101
4129
|
}
|
|
4102
4130
|
})();
|
|
4103
|
-
}, [t]),
|
|
4104
|
-
l && !
|
|
4105
|
-
}, [l,
|
|
4131
|
+
}, [t]), Q(() => {
|
|
4132
|
+
l && !B && (console.log("[Identity] Identity data already loaded, showing provider"), L(!0));
|
|
4133
|
+
}, [l, B]), Q(() => {
|
|
4106
4134
|
if (d) {
|
|
4107
4135
|
if (d.expiresAt) {
|
|
4108
|
-
const
|
|
4109
|
-
if (Date.now() >=
|
|
4110
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
4136
|
+
const I = new Date(d.expiresAt).getTime();
|
|
4137
|
+
if (Date.now() >= I) {
|
|
4138
|
+
console.warn("[Identity] Token has expired (expiresAt)"), D(!0), k("Your verification session has expired. Please restart.");
|
|
4111
4139
|
return;
|
|
4112
4140
|
}
|
|
4113
4141
|
}
|
|
4114
4142
|
if (d.url)
|
|
4115
4143
|
try {
|
|
4116
|
-
const
|
|
4117
|
-
if (
|
|
4118
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
4144
|
+
const f = new URL(d.url).toString().toLowerCase();
|
|
4145
|
+
if (f.includes("expired") || f.includes("invalid") || f.includes("error")) {
|
|
4146
|
+
console.warn("[Identity] Token URL indicates expiration"), D(!0), k("Your verification link has expired. Please restart.");
|
|
4119
4147
|
return;
|
|
4120
4148
|
}
|
|
4121
4149
|
} catch {
|
|
4122
4150
|
console.error("[Identity] Invalid token URL");
|
|
4123
4151
|
}
|
|
4124
4152
|
if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
|
|
4125
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
4153
|
+
console.warn("[Identity] Token object indicates expiration"), D(!0), k("Your verification session has expired. Please restart.");
|
|
4126
4154
|
return;
|
|
4127
4155
|
}
|
|
4128
4156
|
}
|
|
4129
|
-
}, [d]),
|
|
4130
|
-
if (c !== null && d && !
|
|
4131
|
-
const
|
|
4157
|
+
}, [d]), Q(() => {
|
|
4158
|
+
if (c !== null && d && !w && B && !T) {
|
|
4159
|
+
const I = c;
|
|
4132
4160
|
if (d.url) {
|
|
4133
|
-
console.log("[Identity] Loading provider URL for user verification:", d.url),
|
|
4161
|
+
console.log("[Identity] Loading provider URL for user verification:", d.url), k(null);
|
|
4134
4162
|
try {
|
|
4135
|
-
if (new URL(d.url),
|
|
4163
|
+
if (new URL(d.url), I === le.SardinAI) {
|
|
4136
4164
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4137
4165
|
try {
|
|
4138
|
-
const
|
|
4139
|
-
be.createProvider(c,
|
|
4166
|
+
const f = be.parseProviderConfig(c, d, i);
|
|
4167
|
+
be.createProvider(c, f).initialize().then(() => {
|
|
4140
4168
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4141
|
-
}).catch((
|
|
4142
|
-
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):",
|
|
4169
|
+
}).catch((W) => {
|
|
4170
|
+
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", W);
|
|
4143
4171
|
});
|
|
4144
|
-
} catch (
|
|
4145
|
-
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):",
|
|
4172
|
+
} catch (f) {
|
|
4173
|
+
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", f);
|
|
4146
4174
|
}
|
|
4147
4175
|
}
|
|
4148
4176
|
h({ type: "url", url: d.url });
|
|
4149
|
-
} catch (
|
|
4150
|
-
console.error("[Identity] Invalid URL:",
|
|
4177
|
+
} catch (f) {
|
|
4178
|
+
console.error("[Identity] Invalid URL:", f), k("Invalid verification URL. Please restart."), D(!0);
|
|
4151
4179
|
}
|
|
4152
4180
|
return;
|
|
4153
4181
|
}
|
|
4154
|
-
if (
|
|
4155
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
4182
|
+
if (I === le.SardinAI) {
|
|
4183
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), k(null);
|
|
4156
4184
|
try {
|
|
4157
|
-
const
|
|
4158
|
-
|
|
4159
|
-
console.log("[SardinAI] Risk SDK initialized successfully"), h(
|
|
4185
|
+
const f = be.parseProviderConfig(c, d, i), _ = be.createProvider(c, f);
|
|
4186
|
+
_.initialize().then(() => {
|
|
4187
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), h(_), setTimeout(() => {
|
|
4160
4188
|
e == null || e();
|
|
4161
4189
|
}, 2e3);
|
|
4162
|
-
}).catch((
|
|
4163
|
-
var
|
|
4164
|
-
console.error("[SardinAI] Failed to initialize:",
|
|
4165
|
-
const
|
|
4166
|
-
|
|
4190
|
+
}).catch((W) => {
|
|
4191
|
+
var q;
|
|
4192
|
+
console.error("[SardinAI] Failed to initialize:", W);
|
|
4193
|
+
const X = ((q = W.message) == null ? void 0 : q.toLowerCase()) || "";
|
|
4194
|
+
X.includes("expired") || X.includes("invalid") || X.includes("401") || X.includes("400") ? (D(!0), k("Session expired or invalid. Please restart verification.")) : k(`Failed to initialize: ${W.message}`);
|
|
4167
4195
|
});
|
|
4168
|
-
} catch (
|
|
4169
|
-
console.error("[SardinAI] Error creating provider:",
|
|
4196
|
+
} catch (f) {
|
|
4197
|
+
console.error("[SardinAI] Error creating provider:", f), k(`Configuration error: ${f.message}`);
|
|
4170
4198
|
}
|
|
4171
4199
|
return;
|
|
4172
4200
|
}
|
|
4173
4201
|
try {
|
|
4174
|
-
|
|
4175
|
-
const
|
|
4176
|
-
|
|
4177
|
-
var
|
|
4178
|
-
console.error("[Sumsub] Initialization error:",
|
|
4179
|
-
}),
|
|
4202
|
+
k(null);
|
|
4203
|
+
const f = be.parseProviderConfig(c, d, i), _ = be.createProvider(c, f);
|
|
4204
|
+
I === le.Sumsub ? (_.initialize("identity-container").catch((W) => {
|
|
4205
|
+
var X;
|
|
4206
|
+
console.error("[Sumsub] Initialization error:", W), k(`Failed to initialize: ${W.message}`), (X = W.message) != null && X.toLowerCase().includes("expired") && D(!0);
|
|
4207
|
+
}), _.onComplete && _.onComplete(() => {
|
|
4180
4208
|
e == null || e();
|
|
4181
|
-
})) :
|
|
4182
|
-
console.error("[Onfido] Initialization error:",
|
|
4183
|
-
}), h(
|
|
4184
|
-
} catch (
|
|
4185
|
-
console.error("[Identity] Provider setup error:",
|
|
4209
|
+
})) : I === le.Onfido && _.initialize("identity-container").catch((W) => {
|
|
4210
|
+
console.error("[Onfido] Initialization error:", W), k(`Failed to initialize: ${W.message}`);
|
|
4211
|
+
}), h(_);
|
|
4212
|
+
} catch (f) {
|
|
4213
|
+
console.error("[Identity] Provider setup error:", f), k(`Setup error: ${f.message}`);
|
|
4186
4214
|
}
|
|
4187
4215
|
}
|
|
4188
4216
|
return () => {
|
|
4189
|
-
if (
|
|
4217
|
+
if (w && w.destroy)
|
|
4190
4218
|
try {
|
|
4191
|
-
|
|
4192
|
-
} catch (
|
|
4193
|
-
console.error("[Identity] Error destroying provider:",
|
|
4219
|
+
w.destroy();
|
|
4220
|
+
} catch (I) {
|
|
4221
|
+
console.error("[Identity] Error destroying provider:", I);
|
|
4194
4222
|
}
|
|
4195
4223
|
};
|
|
4196
|
-
}, [c, d,
|
|
4197
|
-
const
|
|
4224
|
+
}, [c, d, w, B, e, T]);
|
|
4225
|
+
const R = async () => {
|
|
4198
4226
|
try {
|
|
4199
|
-
|
|
4200
|
-
} catch (
|
|
4201
|
-
console.error("Error starting identity verification:",
|
|
4227
|
+
k(null), D(!1), await v(), L(!0);
|
|
4228
|
+
} catch (I) {
|
|
4229
|
+
console.error("Error starting identity verification:", I);
|
|
4202
4230
|
}
|
|
4203
|
-
},
|
|
4231
|
+
}, E = async () => {
|
|
4204
4232
|
try {
|
|
4205
|
-
|
|
4206
|
-
} catch (
|
|
4207
|
-
console.error("Error restarting identity verification:",
|
|
4233
|
+
k(null), D(!1), h(null), console.log("[Identity] Restarting verification..."), await g(), L(!0);
|
|
4234
|
+
} catch (I) {
|
|
4235
|
+
console.error("Error restarting identity verification:", I), k(I.message || "Failed to restart verification");
|
|
4208
4236
|
}
|
|
4209
4237
|
};
|
|
4210
|
-
if (
|
|
4211
|
-
return /* @__PURE__ */ n(
|
|
4238
|
+
if (C || u)
|
|
4239
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
4212
4240
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4213
4241
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4214
4242
|
] }) });
|
|
4215
4243
|
if (y)
|
|
4216
|
-
return /* @__PURE__ */ n(
|
|
4244
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4217
4245
|
"Error: ",
|
|
4218
4246
|
y.message
|
|
4219
4247
|
] }) }) });
|
|
4220
|
-
if (
|
|
4221
|
-
return /* @__PURE__ */ o(
|
|
4222
|
-
/* @__PURE__ */ n(
|
|
4223
|
-
/* @__PURE__ */ o(
|
|
4248
|
+
if (B && (F || T))
|
|
4249
|
+
return /* @__PURE__ */ o(M, { children: [
|
|
4250
|
+
/* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4251
|
+
/* @__PURE__ */ o(O, { children: [
|
|
4224
4252
|
/* @__PURE__ */ n("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__ */ o("div", { className: "flex items-start", children: [
|
|
4225
4253
|
/* @__PURE__ */ n(
|
|
4226
4254
|
"svg",
|
|
@@ -4241,8 +4269,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4241
4269
|
}
|
|
4242
4270
|
),
|
|
4243
4271
|
/* @__PURE__ */ o("div", { children: [
|
|
4244
|
-
/* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children:
|
|
4245
|
-
/* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children:
|
|
4272
|
+
/* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: T ? "Session Expired" : "Verification Error" }),
|
|
4273
|
+
/* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: F || "Your verification session has expired and needs to be restarted." })
|
|
4246
4274
|
] })
|
|
4247
4275
|
] }) }),
|
|
4248
4276
|
/* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
|
|
@@ -4254,15 +4282,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4254
4282
|
] })
|
|
4255
4283
|
] })
|
|
4256
4284
|
] }),
|
|
4257
|
-
/* @__PURE__ */ o(
|
|
4285
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4258
4286
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4259
|
-
/* @__PURE__ */ n(j, { type: "button", onClick:
|
|
4287
|
+
/* @__PURE__ */ n(j, { type: "button", onClick: E, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
|
|
4260
4288
|
] })
|
|
4261
4289
|
] });
|
|
4262
|
-
if (
|
|
4263
|
-
const
|
|
4264
|
-
return d != null && d.url ? /* @__PURE__ */ o(
|
|
4265
|
-
/* @__PURE__ */ n(
|
|
4290
|
+
if (B && l) {
|
|
4291
|
+
const I = c;
|
|
4292
|
+
return d != null && d.url ? /* @__PURE__ */ o(M, { children: [
|
|
4293
|
+
/* @__PURE__ */ n(ne, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4266
4294
|
/* @__PURE__ */ o("div", { children: [
|
|
4267
4295
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4268
4296
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
@@ -4273,13 +4301,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4273
4301
|
type: "button",
|
|
4274
4302
|
variant: "outline",
|
|
4275
4303
|
size: "sm",
|
|
4276
|
-
onClick:
|
|
4304
|
+
onClick: E,
|
|
4277
4305
|
disabled: u,
|
|
4278
4306
|
children: "Restart"
|
|
4279
4307
|
}
|
|
4280
4308
|
)
|
|
4281
4309
|
] }) }),
|
|
4282
|
-
/* @__PURE__ */ o(
|
|
4310
|
+
/* @__PURE__ */ o(O, { children: [
|
|
4283
4311
|
/* @__PURE__ */ n("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__ */ o("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
|
|
4284
4312
|
/* @__PURE__ */ n("strong", { children: "Important:" }),
|
|
4285
4313
|
' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
|
|
@@ -4291,14 +4319,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4291
4319
|
className: "w-full h-full border-0 rounded-lg",
|
|
4292
4320
|
allow: "camera; microphone; geolocation",
|
|
4293
4321
|
title: "Identity Verification",
|
|
4294
|
-
onLoad: (
|
|
4295
|
-
var
|
|
4322
|
+
onLoad: (f) => {
|
|
4323
|
+
var _, W, X;
|
|
4296
4324
|
console.log("[Identity] Iframe loaded");
|
|
4297
4325
|
try {
|
|
4298
|
-
const
|
|
4326
|
+
const q = f.target, Ce = q.contentDocument || ((_ = q.contentWindow) == null ? void 0 : _.document);
|
|
4299
4327
|
if (Ce) {
|
|
4300
|
-
const he = ((
|
|
4301
|
-
(he.includes("expired") || he.includes("invalid") || he.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"),
|
|
4328
|
+
const he = ((X = (W = Ce.body) == null ? void 0 : W.textContent) == null ? void 0 : X.toLowerCase()) || "";
|
|
4329
|
+
(he.includes("expired") || he.includes("invalid") || he.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), D(!0), k("Your verification link has expired."));
|
|
4302
4330
|
}
|
|
4303
4331
|
} catch {
|
|
4304
4332
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4307,68 +4335,68 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4307
4335
|
}
|
|
4308
4336
|
) })
|
|
4309
4337
|
] }),
|
|
4310
|
-
r && /* @__PURE__ */ n(
|
|
4311
|
-
] }) :
|
|
4312
|
-
/* @__PURE__ */ o(
|
|
4338
|
+
r && /* @__PURE__ */ n(ie, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4339
|
+
] }) : I === le.SardinAI ? /* @__PURE__ */ o(M, { children: [
|
|
4340
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4313
4341
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4314
4342
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4315
4343
|
] }),
|
|
4316
|
-
/* @__PURE__ */ n(
|
|
4344
|
+
/* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
|
|
4317
4345
|
/* @__PURE__ */ n(de, { className: "mb-4" }),
|
|
4318
4346
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4319
4347
|
/* @__PURE__ */ n("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" })
|
|
4320
4348
|
] }) })
|
|
4321
|
-
] }) : /* @__PURE__ */ o(
|
|
4322
|
-
/* @__PURE__ */ o(
|
|
4349
|
+
] }) : /* @__PURE__ */ o(M, { children: [
|
|
4350
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4323
4351
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4324
4352
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4325
4353
|
] }),
|
|
4326
|
-
/* @__PURE__ */ n(
|
|
4327
|
-
r && /* @__PURE__ */ n(
|
|
4354
|
+
/* @__PURE__ */ n(O, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4355
|
+
r && /* @__PURE__ */ n(ie, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4328
4356
|
] });
|
|
4329
4357
|
}
|
|
4330
|
-
return /* @__PURE__ */ n("form", { onSubmit:
|
|
4331
|
-
/* @__PURE__ */ o(
|
|
4358
|
+
return /* @__PURE__ */ n("form", { onSubmit: K.handleSubmit(R), children: /* @__PURE__ */ o(M, { children: [
|
|
4359
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4332
4360
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
|
|
4333
4361
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
4334
4362
|
] }),
|
|
4335
|
-
/* @__PURE__ */ o(
|
|
4363
|
+
/* @__PURE__ */ o(O, { className: "space-y-6", children: [
|
|
4336
4364
|
/* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
|
|
4337
4365
|
/* @__PURE__ */ o("div", { children: [
|
|
4338
4366
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4339
4367
|
/* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
|
|
4340
|
-
(
|
|
4368
|
+
(H = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : H.firstName,
|
|
4341
4369
|
" ",
|
|
4342
|
-
(
|
|
4370
|
+
(b = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : b.lastName
|
|
4343
4371
|
] })
|
|
4344
4372
|
] }),
|
|
4345
4373
|
/* @__PURE__ */ o("div", { children: [
|
|
4346
4374
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4347
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (
|
|
4375
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (P = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : P.email })
|
|
4348
4376
|
] }),
|
|
4349
4377
|
/* @__PURE__ */ o("div", { children: [
|
|
4350
4378
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4351
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((
|
|
4379
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (($ = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : $.dateOfBirth) || "Not provided" })
|
|
4352
4380
|
] })
|
|
4353
4381
|
] }),
|
|
4354
4382
|
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
4355
4383
|
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold", children: "Address Information" }),
|
|
4356
4384
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4357
4385
|
/* @__PURE__ */ n(
|
|
4358
|
-
|
|
4386
|
+
te,
|
|
4359
4387
|
{
|
|
4360
|
-
control:
|
|
4388
|
+
control: K.control,
|
|
4361
4389
|
name: "country",
|
|
4362
|
-
render: ({ field:
|
|
4390
|
+
render: ({ field: I }) => /* @__PURE__ */ n(
|
|
4363
4391
|
ge,
|
|
4364
4392
|
{
|
|
4365
|
-
...
|
|
4393
|
+
...I,
|
|
4366
4394
|
label: "Country",
|
|
4367
4395
|
options: [
|
|
4368
4396
|
{ value: "", label: "Select country..." },
|
|
4369
|
-
...m.map((
|
|
4370
|
-
value:
|
|
4371
|
-
label:
|
|
4397
|
+
...m.map((f) => ({
|
|
4398
|
+
value: f.abbreviation3 || f.abbreviation,
|
|
4399
|
+
label: f.name
|
|
4372
4400
|
}))
|
|
4373
4401
|
]
|
|
4374
4402
|
}
|
|
@@ -4376,20 +4404,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4376
4404
|
}
|
|
4377
4405
|
),
|
|
4378
4406
|
/* @__PURE__ */ n(
|
|
4379
|
-
|
|
4407
|
+
te,
|
|
4380
4408
|
{
|
|
4381
|
-
control:
|
|
4409
|
+
control: K.control,
|
|
4382
4410
|
name: "nationality",
|
|
4383
|
-
render: ({ field:
|
|
4411
|
+
render: ({ field: I }) => /* @__PURE__ */ n(
|
|
4384
4412
|
ge,
|
|
4385
4413
|
{
|
|
4386
|
-
...
|
|
4414
|
+
...I,
|
|
4387
4415
|
label: "Nationality",
|
|
4388
4416
|
options: [
|
|
4389
4417
|
{ value: "", label: "Select nationality..." },
|
|
4390
|
-
...m.map((
|
|
4391
|
-
value:
|
|
4392
|
-
label:
|
|
4418
|
+
...m.map((f) => ({
|
|
4419
|
+
value: f.abbreviation3 || f.abbreviation,
|
|
4420
|
+
label: f.name
|
|
4393
4421
|
}))
|
|
4394
4422
|
]
|
|
4395
4423
|
}
|
|
@@ -4399,51 +4427,51 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4399
4427
|
] }),
|
|
4400
4428
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4401
4429
|
/* @__PURE__ */ n(
|
|
4402
|
-
|
|
4430
|
+
te,
|
|
4403
4431
|
{
|
|
4404
|
-
control:
|
|
4432
|
+
control: K.control,
|
|
4405
4433
|
name: "street",
|
|
4406
|
-
render: ({ field:
|
|
4434
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "Street" })
|
|
4407
4435
|
}
|
|
4408
4436
|
),
|
|
4409
4437
|
/* @__PURE__ */ n(
|
|
4410
|
-
|
|
4438
|
+
te,
|
|
4411
4439
|
{
|
|
4412
|
-
control:
|
|
4440
|
+
control: K.control,
|
|
4413
4441
|
name: "streetNumber",
|
|
4414
|
-
render: ({ field:
|
|
4442
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "Street Number" })
|
|
4415
4443
|
}
|
|
4416
4444
|
)
|
|
4417
4445
|
] }),
|
|
4418
4446
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4419
4447
|
/* @__PURE__ */ n(
|
|
4420
|
-
|
|
4448
|
+
te,
|
|
4421
4449
|
{
|
|
4422
|
-
control:
|
|
4450
|
+
control: K.control,
|
|
4423
4451
|
name: "city",
|
|
4424
|
-
render: ({ field:
|
|
4452
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "City" })
|
|
4425
4453
|
}
|
|
4426
4454
|
),
|
|
4427
4455
|
/* @__PURE__ */ n(
|
|
4428
|
-
|
|
4456
|
+
te,
|
|
4429
4457
|
{
|
|
4430
|
-
control:
|
|
4458
|
+
control: K.control,
|
|
4431
4459
|
name: "zip",
|
|
4432
|
-
render: ({ field:
|
|
4460
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "ZIP/Postal Code" })
|
|
4433
4461
|
}
|
|
4434
4462
|
)
|
|
4435
4463
|
] }),
|
|
4436
4464
|
/* @__PURE__ */ n(
|
|
4437
|
-
|
|
4465
|
+
te,
|
|
4438
4466
|
{
|
|
4439
|
-
control:
|
|
4467
|
+
control: K.control,
|
|
4440
4468
|
name: "phonenumber",
|
|
4441
|
-
render: ({ field:
|
|
4469
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "Phone Number", type: "tel" })
|
|
4442
4470
|
}
|
|
4443
4471
|
)
|
|
4444
4472
|
] })
|
|
4445
4473
|
] }),
|
|
4446
|
-
/* @__PURE__ */ o(
|
|
4474
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4447
4475
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4448
4476
|
/* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
|
|
4449
4477
|
] })
|
|
@@ -4527,8 +4555,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4527
4555
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4528
4556
|
message: "Your application is being reviewed."
|
|
4529
4557
|
};
|
|
4530
|
-
return /* @__PURE__ */ o(
|
|
4531
|
-
/* @__PURE__ */ o(
|
|
4558
|
+
return /* @__PURE__ */ o(M, { children: [
|
|
4559
|
+
/* @__PURE__ */ o(O, { className: "py-12", children: [
|
|
4532
4560
|
/* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
|
|
4533
4561
|
"div",
|
|
4534
4562
|
{
|
|
@@ -4581,9 +4609,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4581
4609
|
] })
|
|
4582
4610
|
] }) })
|
|
4583
4611
|
] }),
|
|
4584
|
-
/* @__PURE__ */ o(
|
|
4612
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-center gap-4", children: [
|
|
4585
4613
|
c.type === "success" && s && /* @__PURE__ */ n(j, { onClick: s, size: "lg", children: "Continue" }),
|
|
4586
|
-
c.type === "error" && /* @__PURE__ */ o(
|
|
4614
|
+
c.type === "error" && /* @__PURE__ */ o(at, { children: [
|
|
4587
4615
|
i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
|
|
4588
4616
|
s && /* @__PURE__ */ n(j, { onClick: s, children: "Try Again" })
|
|
4589
4617
|
] }),
|
|
@@ -4605,12 +4633,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4605
4633
|
console.warn("[Logo] Failed to load logo:", t.url), r.target.style.display = "none";
|
|
4606
4634
|
}
|
|
4607
4635
|
}
|
|
4608
|
-
) }),
|
|
4636
|
+
) }), Je = ({
|
|
4609
4637
|
title: t,
|
|
4610
4638
|
subtitle: e,
|
|
4611
4639
|
className: r = ""
|
|
4612
4640
|
}) => {
|
|
4613
|
-
const { currentTheme: a } =
|
|
4641
|
+
const { currentTheme: a } = oe(), s = t || (a == null ? void 0 : a.title) || "", i = !!(a != null && a.logo && a.logo.visible && a.logo.url), l = !!s;
|
|
4614
4642
|
return !i && !l ? null : /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
|
|
4615
4643
|
/* @__PURE__ */ o("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
4616
4644
|
i && /* @__PURE__ */ n(Rr, { config: a.logo }),
|
|
@@ -4632,29 +4660,35 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4632
4660
|
onSuccess: r,
|
|
4633
4661
|
onCancel: a
|
|
4634
4662
|
}) => {
|
|
4635
|
-
var
|
|
4636
|
-
const { config: s, baseInformationService: i, currentTheme: l } =
|
|
4637
|
-
if (!
|
|
4663
|
+
var R, E, H;
|
|
4664
|
+
const { config: s, baseInformationService: i, currentTheme: l } = oe(), { createApplicant: c, isLoading: d } = nr(), [u, y] = S([]), [v, g] = S(!0), [w, h] = S(!1), [x, p] = S(null), m = Y(!1), A = Y(!1), C = t || ((R = s.applicantForm) == null ? void 0 : R.workflowKey);
|
|
4665
|
+
if (!C)
|
|
4638
4666
|
throw new Error(
|
|
4639
4667
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4640
4668
|
);
|
|
4641
|
-
const
|
|
4669
|
+
const N = e || ((E = s.applicantForm) == null ? void 0 : E.externalRefId) || "", B = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"], L = re.useMemo(() => {
|
|
4670
|
+
const b = new Set(B), P = l == null ? void 0 : l.applicantFormRequiredFields;
|
|
4671
|
+
if (P && P.length > 0)
|
|
4672
|
+
for (const $ of P)
|
|
4673
|
+
b.add($);
|
|
4674
|
+
return Array.from(b);
|
|
4675
|
+
}, [l == null ? void 0 : l.applicantFormRequiredFields]), F = re.useMemo(() => {
|
|
4642
4676
|
var $;
|
|
4643
|
-
let
|
|
4644
|
-
($ = s.applicantForm) != null && $.visibleFields ?
|
|
4645
|
-
const
|
|
4646
|
-
for (const
|
|
4647
|
-
|
|
4648
|
-
return Array.from(
|
|
4649
|
-
}, [(
|
|
4650
|
-
workflowKey:
|
|
4677
|
+
let b;
|
|
4678
|
+
($ = s.applicantForm) != null && $.visibleFields ? b = s.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? b = l.applicantFormVisibleFields : b = ft;
|
|
4679
|
+
const P = new Set(b);
|
|
4680
|
+
for (const I of B)
|
|
4681
|
+
P.add(I);
|
|
4682
|
+
return Array.from(P);
|
|
4683
|
+
}, [(H = s.applicantForm) == null ? void 0 : H.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields]), [k, T] = S({
|
|
4684
|
+
workflowKey: C,
|
|
4651
4685
|
firstName: "",
|
|
4652
4686
|
lastName: "",
|
|
4653
4687
|
title: "",
|
|
4654
4688
|
email: "",
|
|
4655
4689
|
dateOfBirth: "",
|
|
4656
4690
|
phonenumber: "",
|
|
4657
|
-
externalRefId:
|
|
4691
|
+
externalRefId: N,
|
|
4658
4692
|
// Set from config or prop
|
|
4659
4693
|
mobileCountryCode: "",
|
|
4660
4694
|
street: "",
|
|
@@ -4673,7 +4707,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4673
4707
|
occupation: "",
|
|
4674
4708
|
taxNumber: ""
|
|
4675
4709
|
});
|
|
4676
|
-
|
|
4710
|
+
Q(() => {
|
|
4677
4711
|
(async () => {
|
|
4678
4712
|
if (m.current || A.current) {
|
|
4679
4713
|
console.log("[CreateApplicant] Countries already loading or loaded, skipping...");
|
|
@@ -4681,75 +4715,80 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4681
4715
|
}
|
|
4682
4716
|
m.current = !0, g(!0);
|
|
4683
4717
|
try {
|
|
4684
|
-
const
|
|
4685
|
-
value:
|
|
4686
|
-
label:
|
|
4687
|
-
})).filter((
|
|
4688
|
-
y(
|
|
4689
|
-
} catch (
|
|
4690
|
-
console.error("Failed to load countries:",
|
|
4718
|
+
const P = await i.getCountries("", s.locale || "en"), $ = /* @__PURE__ */ new Set(), I = P.map((f) => ({
|
|
4719
|
+
value: f.abbreviation3 || f.abbreviation,
|
|
4720
|
+
label: f.name
|
|
4721
|
+
})).filter((f) => !f.value || $.has(f.value) ? !1 : ($.add(f.value), !0));
|
|
4722
|
+
y(I), A.current = !0;
|
|
4723
|
+
} catch (P) {
|
|
4724
|
+
console.error("Failed to load countries:", P);
|
|
4691
4725
|
} finally {
|
|
4692
4726
|
g(!1), m.current = !1;
|
|
4693
4727
|
}
|
|
4694
4728
|
})();
|
|
4695
4729
|
}, []);
|
|
4696
|
-
const D = (
|
|
4697
|
-
|
|
4698
|
-
},
|
|
4699
|
-
|
|
4730
|
+
const D = (b, P) => {
|
|
4731
|
+
T(($) => ({ ...$, [b]: P }));
|
|
4732
|
+
}, G = async (b) => {
|
|
4733
|
+
var P;
|
|
4734
|
+
b.preventDefault(), h(!0), p(null);
|
|
4700
4735
|
try {
|
|
4701
|
-
if (!
|
|
4736
|
+
if (!k.externalRefId || k.externalRefId.trim() === "") {
|
|
4702
4737
|
p("External Reference ID is required. Please pass it via config.applicantForm.externalRefId."), h(!1);
|
|
4703
4738
|
return;
|
|
4704
4739
|
}
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4740
|
+
for (const f of L) {
|
|
4741
|
+
const _ = k[f];
|
|
4742
|
+
if (_ == null || _ === "" || Array.isArray(_) && _.length === 0) {
|
|
4743
|
+
const X = ((P = Oe[f]) == null ? void 0 : P.label) || f;
|
|
4744
|
+
p(`${X} is required.`), h(!1);
|
|
4745
|
+
return;
|
|
4746
|
+
}
|
|
4708
4747
|
}
|
|
4709
|
-
const
|
|
4710
|
-
workflowKey:
|
|
4711
|
-
externalRefId:
|
|
4748
|
+
const $ = {
|
|
4749
|
+
workflowKey: k.workflowKey,
|
|
4750
|
+
externalRefId: k.externalRefId.trim()
|
|
4712
4751
|
// Always include, never empty
|
|
4713
4752
|
};
|
|
4714
|
-
|
|
4715
|
-
if (
|
|
4716
|
-
const
|
|
4717
|
-
|
|
4718
|
-
}), console.log("Creating applicant with data:",
|
|
4719
|
-
const
|
|
4720
|
-
|
|
4753
|
+
F.forEach((f) => {
|
|
4754
|
+
if (f === "externalRefId") return;
|
|
4755
|
+
const _ = k[f];
|
|
4756
|
+
_ != null && _ !== "" && !(Array.isArray(_) && _.length === 0) && ($[f] = _);
|
|
4757
|
+
}), console.log("Creating applicant with data:", $);
|
|
4758
|
+
const I = await c(
|
|
4759
|
+
$
|
|
4721
4760
|
);
|
|
4722
|
-
console.log("Applicant created:",
|
|
4723
|
-
} catch (
|
|
4724
|
-
console.error("Error creating applicant:",
|
|
4761
|
+
console.log("Applicant created:", I), r(I.applicantId);
|
|
4762
|
+
} catch ($) {
|
|
4763
|
+
console.error("Error creating applicant:", $), p($.message || "Failed to create applicant");
|
|
4725
4764
|
} finally {
|
|
4726
4765
|
h(!1);
|
|
4727
4766
|
}
|
|
4728
|
-
},
|
|
4729
|
-
var
|
|
4730
|
-
const
|
|
4731
|
-
switch (
|
|
4767
|
+
}, K = (b) => {
|
|
4768
|
+
var I;
|
|
4769
|
+
const P = Oe[b], $ = L.includes(b);
|
|
4770
|
+
switch (P.type) {
|
|
4732
4771
|
case "select":
|
|
4733
|
-
return
|
|
4772
|
+
return b === "country" || b === "nationality" || b === "taxCountry" || b === "countryOfBirth" ? /* @__PURE__ */ n(
|
|
4734
4773
|
ge,
|
|
4735
4774
|
{
|
|
4736
|
-
label:
|
|
4737
|
-
value:
|
|
4738
|
-
onChange: (
|
|
4775
|
+
label: P.label,
|
|
4776
|
+
value: k[b] || "",
|
|
4777
|
+
onChange: (f) => D(b, f.target.value),
|
|
4739
4778
|
options: [
|
|
4740
|
-
{ value: "", label: `Select ${
|
|
4779
|
+
{ value: "", label: `Select ${P.label.toLowerCase()}...` },
|
|
4741
4780
|
...u
|
|
4742
4781
|
],
|
|
4743
|
-
disabled:
|
|
4782
|
+
disabled: v,
|
|
4744
4783
|
required: $
|
|
4745
4784
|
},
|
|
4746
|
-
|
|
4747
|
-
) :
|
|
4785
|
+
b
|
|
4786
|
+
) : b === "salutation" ? /* @__PURE__ */ n(
|
|
4748
4787
|
ge,
|
|
4749
4788
|
{
|
|
4750
|
-
label:
|
|
4751
|
-
value: ((
|
|
4752
|
-
onChange: (
|
|
4789
|
+
label: P.label,
|
|
4790
|
+
value: ((I = k[b]) == null ? void 0 : I.toString()) || "",
|
|
4791
|
+
onChange: (f) => D(b, f.target.value ? Number(f.target.value) : null),
|
|
4753
4792
|
options: [
|
|
4754
4793
|
{ value: "", label: "Select salutation..." },
|
|
4755
4794
|
{ value: Se.Male.toString(), label: "Male" },
|
|
@@ -4758,108 +4797,108 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4758
4797
|
],
|
|
4759
4798
|
required: $
|
|
4760
4799
|
},
|
|
4761
|
-
|
|
4762
|
-
) :
|
|
4800
|
+
b
|
|
4801
|
+
) : b === "defaultLanguage" ? /* @__PURE__ */ n(
|
|
4763
4802
|
ge,
|
|
4764
4803
|
{
|
|
4765
|
-
label:
|
|
4766
|
-
value:
|
|
4767
|
-
onChange: (
|
|
4804
|
+
label: P.label,
|
|
4805
|
+
value: k[b] || "",
|
|
4806
|
+
onChange: (f) => D(b, f.target.value),
|
|
4768
4807
|
options: [
|
|
4769
4808
|
{ value: "", label: "Select language..." },
|
|
4770
|
-
...
|
|
4809
|
+
...yt
|
|
4771
4810
|
],
|
|
4772
4811
|
required: $
|
|
4773
4812
|
},
|
|
4774
|
-
|
|
4813
|
+
b
|
|
4775
4814
|
) : null;
|
|
4776
4815
|
case "multiselect":
|
|
4777
|
-
return
|
|
4816
|
+
return b === "otherNationality" ? /* @__PURE__ */ n(
|
|
4778
4817
|
ar,
|
|
4779
4818
|
{
|
|
4780
|
-
label:
|
|
4781
|
-
value:
|
|
4782
|
-
onChange: (
|
|
4819
|
+
label: P.label,
|
|
4820
|
+
value: k[b] || [],
|
|
4821
|
+
onChange: (f) => D(b, f),
|
|
4783
4822
|
options: u,
|
|
4784
4823
|
placeholder: "Select other nationalities...",
|
|
4785
|
-
disabled:
|
|
4824
|
+
disabled: v,
|
|
4786
4825
|
required: $
|
|
4787
4826
|
},
|
|
4788
|
-
|
|
4827
|
+
b
|
|
4789
4828
|
) : null;
|
|
4790
4829
|
case "date":
|
|
4791
4830
|
return /* @__PURE__ */ n(
|
|
4792
|
-
|
|
4831
|
+
se,
|
|
4793
4832
|
{
|
|
4794
4833
|
type: "date",
|
|
4795
|
-
label:
|
|
4796
|
-
value:
|
|
4797
|
-
onChange: (
|
|
4834
|
+
label: P.label,
|
|
4835
|
+
value: k[b] || "",
|
|
4836
|
+
onChange: (f) => D(b, f.target.value),
|
|
4798
4837
|
required: $
|
|
4799
4838
|
},
|
|
4800
|
-
|
|
4839
|
+
b
|
|
4801
4840
|
);
|
|
4802
4841
|
case "email":
|
|
4803
4842
|
return /* @__PURE__ */ n(
|
|
4804
|
-
|
|
4843
|
+
se,
|
|
4805
4844
|
{
|
|
4806
4845
|
type: "email",
|
|
4807
|
-
label:
|
|
4808
|
-
value:
|
|
4809
|
-
onChange: (
|
|
4846
|
+
label: P.label,
|
|
4847
|
+
value: k[b] || "",
|
|
4848
|
+
onChange: (f) => D(b, f.target.value),
|
|
4810
4849
|
required: $
|
|
4811
4850
|
},
|
|
4812
|
-
|
|
4851
|
+
b
|
|
4813
4852
|
);
|
|
4814
4853
|
case "tel":
|
|
4815
4854
|
return /* @__PURE__ */ n(
|
|
4816
|
-
|
|
4855
|
+
se,
|
|
4817
4856
|
{
|
|
4818
4857
|
type: "tel",
|
|
4819
|
-
label:
|
|
4820
|
-
value:
|
|
4821
|
-
onChange: (
|
|
4858
|
+
label: P.label,
|
|
4859
|
+
value: k[b] || "",
|
|
4860
|
+
onChange: (f) => D(b, f.target.value),
|
|
4822
4861
|
required: $
|
|
4823
4862
|
},
|
|
4824
|
-
|
|
4863
|
+
b
|
|
4825
4864
|
);
|
|
4826
4865
|
case "text":
|
|
4827
4866
|
default:
|
|
4828
4867
|
return /* @__PURE__ */ n(
|
|
4829
|
-
|
|
4868
|
+
se,
|
|
4830
4869
|
{
|
|
4831
4870
|
type: "text",
|
|
4832
|
-
label:
|
|
4833
|
-
value:
|
|
4834
|
-
onChange: (
|
|
4871
|
+
label: P.label,
|
|
4872
|
+
value: k[b] || "",
|
|
4873
|
+
onChange: (f) => D(b, f.target.value),
|
|
4835
4874
|
required: $
|
|
4836
4875
|
},
|
|
4837
|
-
|
|
4876
|
+
b
|
|
4838
4877
|
);
|
|
4839
4878
|
}
|
|
4840
4879
|
};
|
|
4841
|
-
return
|
|
4880
|
+
return v ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
4842
4881
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4843
4882
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
4844
|
-
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit:
|
|
4845
|
-
/* @__PURE__ */ n(
|
|
4846
|
-
|
|
4883
|
+
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: G, children: /* @__PURE__ */ o(M, { children: [
|
|
4884
|
+
/* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(
|
|
4885
|
+
Je,
|
|
4847
4886
|
{
|
|
4848
4887
|
title: "Create Applicant",
|
|
4849
4888
|
subtitle: "Please fill in the required information to begin the KYC verification process."
|
|
4850
4889
|
}
|
|
4851
4890
|
) }),
|
|
4852
|
-
/* @__PURE__ */ o(
|
|
4853
|
-
|
|
4891
|
+
/* @__PURE__ */ o(O, { children: [
|
|
4892
|
+
x && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4854
4893
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
4855
4894
|
" ",
|
|
4856
|
-
|
|
4895
|
+
x
|
|
4857
4896
|
] }) }),
|
|
4858
|
-
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
4897
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: F.map((b) => K(b)) })
|
|
4859
4898
|
] }),
|
|
4860
|
-
/* @__PURE__ */ o(
|
|
4861
|
-
a && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: a, disabled:
|
|
4862
|
-
/* @__PURE__ */ n(j, { type: "submit", isLoading:
|
|
4899
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4900
|
+
a && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: a, disabled: w || d, children: "Cancel" }),
|
|
4901
|
+
/* @__PURE__ */ n(j, { type: "submit", isLoading: w || d, children: "Create Applicant" })
|
|
4863
4902
|
] })
|
|
4864
4903
|
] }) }) });
|
|
4865
4904
|
}, Gr = ({
|
|
@@ -4876,31 +4915,31 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4876
4915
|
workflowKey: d,
|
|
4877
4916
|
nextWorkflowKey: u,
|
|
4878
4917
|
hasWorkflowChanged: y,
|
|
4879
|
-
isLoading:
|
|
4918
|
+
isLoading: v,
|
|
4880
4919
|
error: g,
|
|
4881
|
-
moveBack:
|
|
4920
|
+
moveBack: w,
|
|
4882
4921
|
refreshProgress: h
|
|
4883
|
-
} = Zt(t), [
|
|
4884
|
-
if (
|
|
4922
|
+
} = Zt(t), [x, p] = re.useState(!1);
|
|
4923
|
+
if (re.useEffect(() => {
|
|
4885
4924
|
g && r && r(g);
|
|
4886
|
-
}, [g, r]),
|
|
4925
|
+
}, [g, r]), re.useEffect(() => {
|
|
4887
4926
|
i != null && i.workflowResult && e && e(i.workflowResult);
|
|
4888
|
-
}, [i == null ? void 0 : i.workflowResult, e]),
|
|
4927
|
+
}, [i == null ? void 0 : i.workflowResult, e]), re.useEffect(() => {
|
|
4889
4928
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
4890
|
-
}, [a]),
|
|
4929
|
+
}, [a]), re.useEffect(() => {
|
|
4891
4930
|
y && p(!1);
|
|
4892
|
-
}, [y]),
|
|
4893
|
-
return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(
|
|
4931
|
+
}, [y]), v || !i)
|
|
4932
|
+
return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
4894
4933
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4895
4934
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
4896
4935
|
] }) }) });
|
|
4897
4936
|
if (g)
|
|
4898
|
-
return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(
|
|
4937
|
+
return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4899
4938
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
4900
4939
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g.message })
|
|
4901
4940
|
] }) }) }) });
|
|
4902
|
-
if (y && !
|
|
4903
|
-
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(
|
|
4941
|
+
if (y && !x)
|
|
4942
|
+
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4904
4943
|
/* @__PURE__ */ n("div", { className: "mb-6", children: /* @__PURE__ */ n("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ n("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
|
|
4905
4944
|
/* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
4906
4945
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
|
|
@@ -4942,101 +4981,101 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4942
4981
|
}
|
|
4943
4982
|
) });
|
|
4944
4983
|
if (!l)
|
|
4945
|
-
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(
|
|
4984
|
+
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
4946
4985
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4947
4986
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === ce.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
4948
4987
|
] }) }) });
|
|
4949
|
-
const m = (
|
|
4950
|
-
switch (
|
|
4951
|
-
case
|
|
4988
|
+
const m = (N) => {
|
|
4989
|
+
switch (N) {
|
|
4990
|
+
case z.Overview:
|
|
4952
4991
|
return "Overview";
|
|
4953
|
-
case
|
|
4992
|
+
case z.Questionaries:
|
|
4954
4993
|
return "Questionnaire";
|
|
4955
|
-
case
|
|
4994
|
+
case z.UploadDocument:
|
|
4956
4995
|
return "Documents";
|
|
4957
|
-
case
|
|
4996
|
+
case z.IdentitySdk:
|
|
4958
4997
|
return "Identity";
|
|
4959
|
-
case
|
|
4998
|
+
case z.RiskScoring:
|
|
4960
4999
|
return "Risk Assessment";
|
|
4961
|
-
case
|
|
5000
|
+
case z.InvestorCategorization:
|
|
4962
5001
|
return "Investor Categorization";
|
|
4963
|
-
case
|
|
5002
|
+
case z.AppropriatenessTest:
|
|
4964
5003
|
return "Appropriateness Test";
|
|
4965
|
-
case
|
|
5004
|
+
case z.AdditionalData:
|
|
4966
5005
|
return "Additional Data";
|
|
4967
|
-
case
|
|
5006
|
+
case z.ManualReview:
|
|
4968
5007
|
return "Review";
|
|
4969
5008
|
default:
|
|
4970
5009
|
return "";
|
|
4971
5010
|
}
|
|
4972
5011
|
}, A = () => {
|
|
4973
|
-
const
|
|
5012
|
+
const N = c.filter((k) => k.visibility !== !1), B = N.findIndex((k) => k.order === l.order), L = B >= 0 ? B + 1 : 1, F = N.length;
|
|
4974
5013
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
4975
5014
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
4976
|
-
/* @__PURE__ */ n(
|
|
5015
|
+
/* @__PURE__ */ n(Je, {}),
|
|
4977
5016
|
/* @__PURE__ */ o(pe, { variant: i.status === 1 ? "info" : "success", children: [
|
|
4978
5017
|
"Step ",
|
|
4979
5018
|
L,
|
|
4980
5019
|
" of ",
|
|
4981
|
-
|
|
5020
|
+
F
|
|
4982
5021
|
] })
|
|
4983
5022
|
] }),
|
|
4984
|
-
/* @__PURE__ */ n("div", { className: "flex items-center", children:
|
|
4985
|
-
const
|
|
4986
|
-
return /* @__PURE__ */ o(
|
|
5023
|
+
/* @__PURE__ */ n("div", { className: "flex items-center", children: N.map((k, T) => {
|
|
5024
|
+
const D = T < B, G = k.order === l.order;
|
|
5025
|
+
return /* @__PURE__ */ o(re.Fragment, { children: [
|
|
4987
5026
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
4988
5027
|
/* @__PURE__ */ n(
|
|
4989
5028
|
"div",
|
|
4990
5029
|
{
|
|
4991
5030
|
className: `
|
|
4992
5031
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
4993
|
-
${
|
|
5032
|
+
${D || G ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
4994
5033
|
`,
|
|
4995
|
-
children:
|
|
5034
|
+
children: T + 1
|
|
4996
5035
|
}
|
|
4997
5036
|
),
|
|
4998
5037
|
/* @__PURE__ */ n(
|
|
4999
5038
|
"span",
|
|
5000
5039
|
{
|
|
5001
|
-
className: `ml-2 text-sm ${
|
|
5002
|
-
children:
|
|
5040
|
+
className: `ml-2 text-sm ${G ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
5041
|
+
children: k.displayName || k.name || m(k.action) || `Step ${T + 1}`
|
|
5003
5042
|
}
|
|
5004
5043
|
)
|
|
5005
5044
|
] }),
|
|
5006
|
-
|
|
5045
|
+
T < N.length - 1 && /* @__PURE__ */ n(
|
|
5007
5046
|
"div",
|
|
5008
5047
|
{
|
|
5009
|
-
className: `flex-1 h-0.5 mx-4 ${
|
|
5048
|
+
className: `flex-1 h-0.5 mx-4 ${D ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
5010
5049
|
}
|
|
5011
5050
|
)
|
|
5012
|
-
] },
|
|
5051
|
+
] }, k.order);
|
|
5013
5052
|
}) })
|
|
5014
5053
|
] });
|
|
5015
|
-
},
|
|
5016
|
-
const
|
|
5054
|
+
}, C = () => {
|
|
5055
|
+
const N = {
|
|
5017
5056
|
applicantId: t,
|
|
5018
5057
|
onComplete: async () => {
|
|
5019
5058
|
await h();
|
|
5020
5059
|
},
|
|
5021
|
-
onBack: l.order > 0 ?
|
|
5060
|
+
onBack: l.order > 0 ? w : void 0
|
|
5022
5061
|
};
|
|
5023
5062
|
switch (l.action) {
|
|
5024
|
-
case
|
|
5025
|
-
return /* @__PURE__ */ n(kr, { ...
|
|
5026
|
-
case
|
|
5027
|
-
return /* @__PURE__ */ n(Nr, { ...
|
|
5028
|
-
case
|
|
5029
|
-
return /* @__PURE__ */ n(Sr, { ...
|
|
5030
|
-
case
|
|
5031
|
-
return /* @__PURE__ */ n(Ir, { ...
|
|
5032
|
-
case
|
|
5033
|
-
return /* @__PURE__ */ n(Cr, { ...
|
|
5034
|
-
case
|
|
5035
|
-
case
|
|
5036
|
-
return /* @__PURE__ */ n(Ar, { ...
|
|
5037
|
-
case
|
|
5038
|
-
return /* @__PURE__ */ n(Er, { ...
|
|
5039
|
-
case
|
|
5063
|
+
case z.Questionaries:
|
|
5064
|
+
return /* @__PURE__ */ n(kr, { ...N });
|
|
5065
|
+
case z.UploadDocument:
|
|
5066
|
+
return /* @__PURE__ */ n(Nr, { ...N });
|
|
5067
|
+
case z.Overview:
|
|
5068
|
+
return /* @__PURE__ */ n(Sr, { ...N });
|
|
5069
|
+
case z.IdentitySdk:
|
|
5070
|
+
return /* @__PURE__ */ n(Ir, { ...N });
|
|
5071
|
+
case z.RiskScoring:
|
|
5072
|
+
return /* @__PURE__ */ n(Cr, { ...N });
|
|
5073
|
+
case z.AdditionalData:
|
|
5074
|
+
case z.InvestorCategorization:
|
|
5075
|
+
return /* @__PURE__ */ n(Ar, { ...N });
|
|
5076
|
+
case z.AppropriatenessTest:
|
|
5077
|
+
return /* @__PURE__ */ n(Er, { ...N });
|
|
5078
|
+
case z.ManualReview:
|
|
5040
5079
|
return /* @__PURE__ */ n(
|
|
5041
5080
|
_e,
|
|
5042
5081
|
{
|
|
@@ -5047,7 +5086,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5047
5086
|
}
|
|
5048
5087
|
);
|
|
5049
5088
|
default:
|
|
5050
|
-
return /* @__PURE__ */ n(
|
|
5089
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { className: "py-12 text-center", children: [
|
|
5051
5090
|
/* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(de, {}) }),
|
|
5052
5091
|
/* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
5053
5092
|
"Processing step: ",
|
|
@@ -5055,111 +5094,111 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5055
5094
|
] }),
|
|
5056
5095
|
/* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
5057
5096
|
"Action type: ",
|
|
5058
|
-
|
|
5097
|
+
z[l.action]
|
|
5059
5098
|
] })
|
|
5060
5099
|
] }) });
|
|
5061
5100
|
}
|
|
5062
5101
|
};
|
|
5063
5102
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
5064
5103
|
A(),
|
|
5065
|
-
|
|
5104
|
+
C()
|
|
5066
5105
|
] });
|
|
5067
5106
|
};
|
|
5068
5107
|
export {
|
|
5069
|
-
|
|
5108
|
+
yt as ALLOWED_LANGUAGES,
|
|
5070
5109
|
Or as ALL_APPLICANT_FIELDS,
|
|
5071
|
-
|
|
5110
|
+
st as ApplicantProgressOnHoldReason,
|
|
5072
5111
|
ce as ApplicantProgressStatus,
|
|
5073
5112
|
wt as ApplicantService,
|
|
5074
|
-
|
|
5075
|
-
|
|
5113
|
+
ot as ApplicantStatus,
|
|
5114
|
+
mt as AppropriatenessQuestionType,
|
|
5076
5115
|
St as AppropriatenessTestService,
|
|
5077
5116
|
Er as AppropriatenessTestStep,
|
|
5078
5117
|
pe as Badge,
|
|
5079
5118
|
It as BaseInformationService,
|
|
5080
5119
|
j as Button,
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5120
|
+
M as Card,
|
|
5121
|
+
O as CardContent,
|
|
5122
|
+
ie as CardFooter,
|
|
5123
|
+
ne as CardHeader,
|
|
5085
5124
|
Qr as CreateApplicantForm,
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5125
|
+
pt as CriteriaBuiltInType,
|
|
5126
|
+
ft as DEFAULT_VISIBLE_FIELDS,
|
|
5127
|
+
ut as DocumentReviewStatus,
|
|
5089
5128
|
vt as EndpointBuilder,
|
|
5090
5129
|
xe as ErrorHandler,
|
|
5091
5130
|
Bt as EventEmitter,
|
|
5092
|
-
|
|
5093
|
-
|
|
5131
|
+
Oe as FIELD_METADATA,
|
|
5132
|
+
dt as FileType,
|
|
5094
5133
|
sr as FileUpload,
|
|
5095
5134
|
Se as GenderType,
|
|
5096
|
-
|
|
5135
|
+
Je as Header,
|
|
5097
5136
|
xt as HttpClient,
|
|
5098
5137
|
be as IdentityProviderManager,
|
|
5099
5138
|
Et as IdentityService,
|
|
5100
5139
|
le as IdentityVerificationProvider,
|
|
5101
5140
|
Ir as IdentityVerificationStep,
|
|
5102
|
-
|
|
5141
|
+
se as Input,
|
|
5103
5142
|
Rt as InvestorCategorizationService,
|
|
5104
5143
|
Ar as InvestorCategorizationStep,
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5144
|
+
ae as InvestorCategorizationType,
|
|
5145
|
+
gt as InvestorCategoryType,
|
|
5146
|
+
lt as KycProcessStatus,
|
|
5108
5147
|
ye as KycStatus,
|
|
5109
5148
|
_e as KycStatusDisplay,
|
|
5110
5149
|
Gr as KycWorkflow,
|
|
5111
5150
|
Rr as Logo,
|
|
5112
|
-
|
|
5151
|
+
Ke as MetaKYCContext,
|
|
5113
5152
|
ue as MetaKYCError,
|
|
5114
5153
|
$r as MetaKYCProvider,
|
|
5115
5154
|
ar as MultiSelect,
|
|
5116
|
-
|
|
5155
|
+
jt as OnfidoProvider,
|
|
5117
5156
|
Ct as OverviewService,
|
|
5118
5157
|
Sr as OverviewStep,
|
|
5119
5158
|
ir as PhoneInput,
|
|
5120
5159
|
kt as QuestionnaireService,
|
|
5121
5160
|
kr as QuestionnaireStep,
|
|
5122
5161
|
fe as ReviewStatus,
|
|
5123
|
-
|
|
5124
|
-
|
|
5162
|
+
ht as RiskCriteriaType,
|
|
5163
|
+
it as RiskLevel,
|
|
5125
5164
|
At as RiskScoringService,
|
|
5126
5165
|
Cr as RiskScoringStep,
|
|
5127
|
-
|
|
5166
|
+
Ut as SardinAIProvider,
|
|
5128
5167
|
ge as Select,
|
|
5129
5168
|
de as Spinner,
|
|
5130
5169
|
$t as StepRouter,
|
|
5131
|
-
|
|
5170
|
+
_t as SumsubProvider,
|
|
5132
5171
|
Kt as ThemeManager,
|
|
5133
|
-
|
|
5172
|
+
Z as ThemePreset,
|
|
5134
5173
|
Ot as ThemeService,
|
|
5135
5174
|
Nt as UploadDocumentService,
|
|
5136
5175
|
Nr as UploadDocumentStep,
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5176
|
+
ct as UserType,
|
|
5177
|
+
De as ValueDataType,
|
|
5178
|
+
qt as WorkflowOrchestrator,
|
|
5140
5179
|
Ne as WorkflowResultType,
|
|
5141
5180
|
zt as WorkflowState,
|
|
5142
|
-
|
|
5181
|
+
z as WorkflowStepAction,
|
|
5143
5182
|
Wr as appropriatenessTestSchema,
|
|
5144
5183
|
Kr as clearAllStorage,
|
|
5145
5184
|
Wt as clearApplicantId,
|
|
5146
5185
|
Gt as clearWorkflowState,
|
|
5147
|
-
|
|
5148
|
-
|
|
5186
|
+
J as cn,
|
|
5187
|
+
Ft as corporateTheme,
|
|
5149
5188
|
bt as defaultConfig,
|
|
5150
|
-
|
|
5189
|
+
ee as defaultTheme,
|
|
5151
5190
|
Ht as fileToBase64,
|
|
5152
|
-
|
|
5191
|
+
Dt as fintechTheme,
|
|
5153
5192
|
Ie as formatFileSize,
|
|
5154
5193
|
Yr as generateAppropriatenessSchema,
|
|
5155
5194
|
br as generateQuestionnaireSchema,
|
|
5156
5195
|
xr as generateRiskScoringSchema,
|
|
5157
5196
|
Vr as generateUploadDocumentSchema,
|
|
5158
|
-
|
|
5197
|
+
jr as getAcceptString,
|
|
5159
5198
|
Yt as getApplicantId,
|
|
5160
5199
|
we as getThemePreset,
|
|
5161
|
-
|
|
5162
|
-
|
|
5200
|
+
Ur as getWorkflowState,
|
|
5201
|
+
Pt as healthcareTheme,
|
|
5163
5202
|
Br as isScriptLoaded,
|
|
5164
5203
|
Ue as loadScript,
|
|
5165
5204
|
Tt as minimalTheme,
|
|
@@ -5172,12 +5211,12 @@ export {
|
|
|
5172
5211
|
Hr as useAppropriatenessTest,
|
|
5173
5212
|
tr as useIdentityVerification,
|
|
5174
5213
|
Zt as useKycWorkflow,
|
|
5175
|
-
|
|
5214
|
+
oe as useMetaKYC,
|
|
5176
5215
|
er as useOverview,
|
|
5177
5216
|
Jt as useQuestionnaire,
|
|
5178
5217
|
rr as useRiskScoring,
|
|
5179
5218
|
Xt as useUploadDocument,
|
|
5180
|
-
|
|
5181
|
-
|
|
5219
|
+
qr as validateFileSize,
|
|
5220
|
+
_r as validateFileType
|
|
5182
5221
|
};
|
|
5183
5222
|
//# sourceMappingURL=index.js.map
|