@vpdev2/metakyc-sdk 1.0.31 → 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/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +907 -895
- package/dist/index.js.map +1 -1
- package/dist/services/theme.service.d.ts.map +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,7 +2696,7 @@ 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
|
{
|
|
@@ -2754,8 +2755,8 @@ const ar = ({
|
|
|
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(
|
|
2755
2756
|
"li",
|
|
2756
2757
|
{
|
|
2757
|
-
onClick: () =>
|
|
2758
|
-
className:
|
|
2758
|
+
onClick: () => w(p.value),
|
|
2759
|
+
className: J(
|
|
2759
2760
|
"metakyc-multiselect-option",
|
|
2760
2761
|
"flex items-center gap-2 px-3 py-2 text-sm cursor-pointer",
|
|
2761
2762
|
"hover:bg-gray-50 dark:hover:bg-gray-700",
|
|
@@ -2806,42 +2807,42 @@ const ar = ({
|
|
|
2806
2807
|
value: l = [],
|
|
2807
2808
|
className: c
|
|
2808
2809
|
}) => {
|
|
2809
|
-
const [d, u] =
|
|
2810
|
+
const [d, u] = S(!1), y = Y(null), v = (m) => {
|
|
2810
2811
|
if (!m) return;
|
|
2811
2812
|
const A = Array.from(m);
|
|
2812
|
-
if (s && A.filter((
|
|
2813
|
-
const
|
|
2814
|
-
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}`);
|
|
2815
2816
|
return;
|
|
2816
2817
|
}
|
|
2817
2818
|
i == null || i(a ? [...l, ...A] : [A[0]]);
|
|
2818
2819
|
}, g = (m) => {
|
|
2819
2820
|
m.preventDefault(), u(!0);
|
|
2820
|
-
},
|
|
2821
|
+
}, w = () => {
|
|
2821
2822
|
u(!1);
|
|
2822
2823
|
}, h = (m) => {
|
|
2823
|
-
m.preventDefault(), u(!1),
|
|
2824
|
-
},
|
|
2824
|
+
m.preventDefault(), u(!1), v(m.dataTransfer.files);
|
|
2825
|
+
}, x = () => {
|
|
2825
2826
|
var m;
|
|
2826
2827
|
(m = y.current) == null || m.click();
|
|
2827
2828
|
}, p = (m) => {
|
|
2828
|
-
const A = l.filter((
|
|
2829
|
+
const A = l.filter((C, N) => N !== m);
|
|
2829
2830
|
i == null || i(A);
|
|
2830
2831
|
};
|
|
2831
|
-
return /* @__PURE__ */ o("div", { className:
|
|
2832
|
+
return /* @__PURE__ */ o("div", { className: J("w-full", c), children: [
|
|
2832
2833
|
t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
|
|
2833
2834
|
/* @__PURE__ */ o(
|
|
2834
2835
|
"div",
|
|
2835
2836
|
{
|
|
2836
|
-
className:
|
|
2837
|
+
className: J(
|
|
2837
2838
|
"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
|
|
2838
2839
|
d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
2839
2840
|
e && "border-danger-500"
|
|
2840
2841
|
),
|
|
2841
2842
|
onDragOver: g,
|
|
2842
|
-
onDragLeave:
|
|
2843
|
+
onDragLeave: w,
|
|
2843
2844
|
onDrop: h,
|
|
2844
|
-
onClick:
|
|
2845
|
+
onClick: x,
|
|
2845
2846
|
children: [
|
|
2846
2847
|
/* @__PURE__ */ n(
|
|
2847
2848
|
"input",
|
|
@@ -2851,7 +2852,7 @@ const ar = ({
|
|
|
2851
2852
|
className: "hidden",
|
|
2852
2853
|
accept: r,
|
|
2853
2854
|
multiple: a,
|
|
2854
|
-
onChange: (m) =>
|
|
2855
|
+
onChange: (m) => v(m.target.files)
|
|
2855
2856
|
}
|
|
2856
2857
|
),
|
|
2857
2858
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -2918,8 +2919,8 @@ const ar = ({
|
|
|
2918
2919
|
"button",
|
|
2919
2920
|
{
|
|
2920
2921
|
type: "button",
|
|
2921
|
-
onClick: (
|
|
2922
|
-
|
|
2922
|
+
onClick: (C) => {
|
|
2923
|
+
C.stopPropagation(), p(A);
|
|
2923
2924
|
},
|
|
2924
2925
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2925
2926
|
children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
|
|
@@ -2951,7 +2952,7 @@ const ar = ({
|
|
|
2951
2952
|
type: "text",
|
|
2952
2953
|
value: t,
|
|
2953
2954
|
onChange: (i) => e == null ? void 0 : e(i.target.value),
|
|
2954
|
-
className:
|
|
2955
|
+
className: J(
|
|
2955
2956
|
"w-20 rounded-lg border px-3 py-2 text-sm",
|
|
2956
2957
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2957
2958
|
"border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
|
|
@@ -2960,11 +2961,11 @@ const ar = ({
|
|
|
2960
2961
|
}
|
|
2961
2962
|
),
|
|
2962
2963
|
/* @__PURE__ */ n(
|
|
2963
|
-
|
|
2964
|
+
se,
|
|
2964
2965
|
{
|
|
2965
2966
|
ref: s,
|
|
2966
2967
|
type: "tel",
|
|
2967
|
-
className:
|
|
2968
|
+
className: J("flex-1", r),
|
|
2968
2969
|
...a,
|
|
2969
2970
|
label: ""
|
|
2970
2971
|
}
|
|
@@ -2974,35 +2975,35 @@ const ar = ({
|
|
|
2974
2975
|
] })
|
|
2975
2976
|
);
|
|
2976
2977
|
ir.displayName = "PhoneInput";
|
|
2977
|
-
const
|
|
2978
|
+
const Be = (t, e, r) => {
|
|
2978
2979
|
if (t && "reportValidity" in t) {
|
|
2979
|
-
const a =
|
|
2980
|
+
const a = Fe(r, e);
|
|
2980
2981
|
t.setCustomValidity(a && a.message || ""), t.reportValidity();
|
|
2981
2982
|
}
|
|
2982
|
-
},
|
|
2983
|
+
}, Pe = (t, e) => {
|
|
2983
2984
|
for (const r in e.fields) {
|
|
2984
2985
|
const a = e.fields[r];
|
|
2985
|
-
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));
|
|
2986
2987
|
}
|
|
2987
|
-
},
|
|
2988
|
-
e.shouldUseNativeValidation &&
|
|
2988
|
+
}, ze = (t, e) => {
|
|
2989
|
+
e.shouldUseNativeValidation && Pe(t, e);
|
|
2989
2990
|
const r = {};
|
|
2990
2991
|
for (const a in t) {
|
|
2991
|
-
const s =
|
|
2992
|
+
const s = Fe(e.fields, a), i = Object.assign(t[a] || {}, { ref: s && s.ref });
|
|
2992
2993
|
if (or(e.names || Object.keys(t), a)) {
|
|
2993
|
-
const l = Object.assign({},
|
|
2994
|
+
const l = Object.assign({}, Fe(r, a));
|
|
2994
2995
|
Ee(l, "root", i), Ee(r, a, l);
|
|
2995
2996
|
} else Ee(r, a, i);
|
|
2996
2997
|
}
|
|
2997
2998
|
return r;
|
|
2998
2999
|
}, or = (t, e) => {
|
|
2999
|
-
const r =
|
|
3000
|
-
return t.some((a) =>
|
|
3000
|
+
const r = $e(e);
|
|
3001
|
+
return t.some((a) => $e(a).match(`^${r}\\.\\d+`));
|
|
3001
3002
|
};
|
|
3002
|
-
function
|
|
3003
|
+
function $e(t) {
|
|
3003
3004
|
return t.replace(/\]|\[/g, "");
|
|
3004
3005
|
}
|
|
3005
|
-
function
|
|
3006
|
+
function He(t, e, r) {
|
|
3006
3007
|
function a(c, d) {
|
|
3007
3008
|
var u;
|
|
3008
3009
|
Object.defineProperty(c, "_zod", {
|
|
@@ -3038,18 +3039,18 @@ class lr extends Error {
|
|
|
3038
3039
|
}
|
|
3039
3040
|
}
|
|
3040
3041
|
const cr = {};
|
|
3041
|
-
function
|
|
3042
|
+
function Ve(t) {
|
|
3042
3043
|
return cr;
|
|
3043
3044
|
}
|
|
3044
3045
|
function dr(t, e) {
|
|
3045
3046
|
return typeof e == "bigint" ? e.toString() : e;
|
|
3046
3047
|
}
|
|
3047
|
-
const
|
|
3048
|
+
const Ye = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
|
|
3048
3049
|
};
|
|
3049
3050
|
function ke(t) {
|
|
3050
3051
|
return typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
3051
3052
|
}
|
|
3052
|
-
function
|
|
3053
|
+
function We(t, e, r) {
|
|
3053
3054
|
var s, i, l, c, d, u;
|
|
3054
3055
|
const a = { ...t, path: t.path ?? [] };
|
|
3055
3056
|
if (!t.message) {
|
|
@@ -3058,7 +3059,7 @@ function Ye(t, e, r) {
|
|
|
3058
3059
|
}
|
|
3059
3060
|
return delete a.inst, delete a.continue, e != null && e.reportInput || delete a.input, a;
|
|
3060
3061
|
}
|
|
3061
|
-
const
|
|
3062
|
+
const Qe = (t, e) => {
|
|
3062
3063
|
t.name = "$ZodError", Object.defineProperty(t, "_zod", {
|
|
3063
3064
|
value: t._zod,
|
|
3064
3065
|
enumerable: !1
|
|
@@ -3075,25 +3076,25 @@ const We = (t, e) => {
|
|
|
3075
3076
|
value: () => t.message,
|
|
3076
3077
|
enumerable: !1
|
|
3077
3078
|
});
|
|
3078
|
-
}, ur =
|
|
3079
|
+
}, ur = He("$ZodError", Qe), Ge = He("$ZodError", Qe, { Parent: Error }), mr = (t) => (e, r, a, s) => {
|
|
3079
3080
|
const i = a ? Object.assign(a, { async: !1 }) : { async: !1 }, l = e._zod.run({ value: r, issues: [] }, i);
|
|
3080
3081
|
if (l instanceof Promise)
|
|
3081
3082
|
throw new lr();
|
|
3082
3083
|
if (l.issues.length) {
|
|
3083
|
-
const c = new ((s == null ? void 0 : s.Err) ?? t)(l.issues.map((d) =>
|
|
3084
|
-
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;
|
|
3085
3086
|
}
|
|
3086
3087
|
return l.value;
|
|
3087
|
-
}, hr = /* @__PURE__ */ mr(
|
|
3088
|
+
}, hr = /* @__PURE__ */ mr(Ge), pr = (t) => async (e, r, a, s) => {
|
|
3088
3089
|
const i = a ? Object.assign(a, { async: !0 }) : { async: !0 };
|
|
3089
3090
|
let l = e._zod.run({ value: r, issues: [] }, i);
|
|
3090
3091
|
if (l instanceof Promise && (l = await l), l.issues.length) {
|
|
3091
|
-
const c = new ((s == null ? void 0 : s.Err) ?? t)(l.issues.map((d) =>
|
|
3092
|
-
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;
|
|
3093
3094
|
}
|
|
3094
3095
|
return l.value;
|
|
3095
|
-
}, gr = /* @__PURE__ */ pr(
|
|
3096
|
-
function
|
|
3096
|
+
}, gr = /* @__PURE__ */ pr(Ge);
|
|
3097
|
+
function qe(t, e) {
|
|
3097
3098
|
try {
|
|
3098
3099
|
var r = t();
|
|
3099
3100
|
} catch (a) {
|
|
@@ -3109,8 +3110,8 @@ function yr(t, e) {
|
|
|
3109
3110
|
r[l] = { message: c.message, type: c.code };
|
|
3110
3111
|
} else r[l] = { message: i, type: s };
|
|
3111
3112
|
if ("unionErrors" in a && a.unionErrors.forEach(function(y) {
|
|
3112
|
-
return y.errors.forEach(function(
|
|
3113
|
-
return t.push(
|
|
3113
|
+
return y.errors.forEach(function(v) {
|
|
3114
|
+
return t.push(v);
|
|
3114
3115
|
});
|
|
3115
3116
|
}), e) {
|
|
3116
3117
|
var d = r[l].types, u = d && d[a.code];
|
|
@@ -3128,8 +3129,8 @@ function fr(t, e) {
|
|
|
3128
3129
|
r[l] = { message: c.message, type: c.code };
|
|
3129
3130
|
} else r[l] = { message: i, type: s };
|
|
3130
3131
|
if (a.code === "invalid_union" && a.errors.forEach(function(y) {
|
|
3131
|
-
return y.forEach(function(
|
|
3132
|
-
return t.push(
|
|
3132
|
+
return y.forEach(function(v) {
|
|
3133
|
+
return t.push(v);
|
|
3133
3134
|
});
|
|
3134
3135
|
}), e) {
|
|
3135
3136
|
var d = r[l].types, u = d && d[a.code];
|
|
@@ -3139,19 +3140,19 @@ function fr(t, e) {
|
|
|
3139
3140
|
}
|
|
3140
3141
|
return r;
|
|
3141
3142
|
}
|
|
3142
|
-
function
|
|
3143
|
+
function Ze(t, e, r) {
|
|
3143
3144
|
if (r === void 0 && (r = {}), function(a) {
|
|
3144
3145
|
return "_def" in a && typeof a._def == "object" && "typeName" in a._def;
|
|
3145
3146
|
}(t)) return function(a, s, i) {
|
|
3146
3147
|
try {
|
|
3147
|
-
return Promise.resolve(
|
|
3148
|
+
return Promise.resolve(qe(function() {
|
|
3148
3149
|
return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](a, e)).then(function(l) {
|
|
3149
|
-
return i.shouldUseNativeValidation &&
|
|
3150
|
+
return i.shouldUseNativeValidation && Pe({}, i), { errors: {}, values: r.raw ? Object.assign({}, a) : l };
|
|
3150
3151
|
});
|
|
3151
3152
|
}, function(l) {
|
|
3152
3153
|
if (function(c) {
|
|
3153
3154
|
return Array.isArray(c == null ? void 0 : c.issues);
|
|
3154
|
-
}(l)) return { values: {}, errors:
|
|
3155
|
+
}(l)) return { values: {}, errors: ze(yr(l.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
3155
3156
|
throw l;
|
|
3156
3157
|
}));
|
|
3157
3158
|
} catch (l) {
|
|
@@ -3162,14 +3163,14 @@ function Ge(t, e, r) {
|
|
|
3162
3163
|
return "_zod" in a && typeof a._zod == "object";
|
|
3163
3164
|
}(t)) return function(a, s, i) {
|
|
3164
3165
|
try {
|
|
3165
|
-
return Promise.resolve(
|
|
3166
|
+
return Promise.resolve(qe(function() {
|
|
3166
3167
|
return Promise.resolve((r.mode === "sync" ? hr : gr)(t, a, e)).then(function(l) {
|
|
3167
|
-
return i.shouldUseNativeValidation &&
|
|
3168
|
+
return i.shouldUseNativeValidation && Pe({}, i), { errors: {}, values: r.raw ? Object.assign({}, a) : l };
|
|
3168
3169
|
});
|
|
3169
3170
|
}, function(l) {
|
|
3170
3171
|
if (function(c) {
|
|
3171
3172
|
return c instanceof ur;
|
|
3172
|
-
}(l)) return { values: {}, errors:
|
|
3173
|
+
}(l)) return { values: {}, errors: ze(fr(l.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
3173
3174
|
throw l;
|
|
3174
3175
|
}));
|
|
3175
3176
|
} catch (l) {
|
|
@@ -3231,111 +3232,111 @@ const Wr = me.any(), kr = ({
|
|
|
3231
3232
|
onBack: r
|
|
3232
3233
|
}) => {
|
|
3233
3234
|
const { questionnaire: a, isLoading: s, isSubmitting: i, error: l, submit: c } = Jt(t), d = Re(() => a ? { questionResults: a.questionGroups.map(
|
|
3234
|
-
(
|
|
3235
|
+
(x) => x.questions.map((p) => ({
|
|
3235
3236
|
questionId: p.id,
|
|
3236
3237
|
values: []
|
|
3237
3238
|
}))
|
|
3238
3239
|
) } : { questionResults: [] }, [a]), u = a ? br() : null, {
|
|
3239
3240
|
control: y,
|
|
3240
|
-
handleSubmit:
|
|
3241
|
+
handleSubmit: v,
|
|
3241
3242
|
formState: { errors: g }
|
|
3242
3243
|
} = Te({
|
|
3243
|
-
resolver: u ?
|
|
3244
|
+
resolver: u ? Ze(u) : void 0,
|
|
3244
3245
|
defaultValues: d
|
|
3245
|
-
}),
|
|
3246
|
+
}), w = async (h) => {
|
|
3246
3247
|
if (a)
|
|
3247
3248
|
try {
|
|
3248
3249
|
console.log("Form submitted with data:", h);
|
|
3249
|
-
const
|
|
3250
|
-
(m, A) => m.questions.map((
|
|
3251
|
-
var
|
|
3250
|
+
const x = a.questionGroups.flatMap(
|
|
3251
|
+
(m, A) => m.questions.map((C, N) => {
|
|
3252
|
+
var B, L, F;
|
|
3252
3253
|
return {
|
|
3253
|
-
questionId:
|
|
3254
|
-
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) || []
|
|
3255
3256
|
};
|
|
3256
3257
|
})
|
|
3257
3258
|
);
|
|
3258
|
-
console.log("Question results to submit:",
|
|
3259
|
+
console.log("Question results to submit:", x);
|
|
3259
3260
|
const p = {
|
|
3260
3261
|
applicantId: t,
|
|
3261
3262
|
questionnarieId: a.id,
|
|
3262
|
-
questionResults:
|
|
3263
|
+
questionResults: x
|
|
3263
3264
|
};
|
|
3264
3265
|
console.log("Final input:", p), await c(p), e == null || e();
|
|
3265
|
-
} catch (
|
|
3266
|
-
console.error("Error submitting questionnaire:",
|
|
3266
|
+
} catch (x) {
|
|
3267
|
+
console.error("Error submitting questionnaire:", x);
|
|
3267
3268
|
}
|
|
3268
3269
|
};
|
|
3269
|
-
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: [
|
|
3270
3271
|
"Error loading questionnaire: ",
|
|
3271
3272
|
l.message
|
|
3272
|
-
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3273
|
-
/* @__PURE__ */ o(
|
|
3273
|
+
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: v(w), children: /* @__PURE__ */ o(M, { children: [
|
|
3274
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3274
3275
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3275
3276
|
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3276
3277
|
] }),
|
|
3277
|
-
/* @__PURE__ */ n(
|
|
3278
|
-
(h,
|
|
3279
|
-
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";
|
|
3280
3281
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3281
3282
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3282
3283
|
p.text,
|
|
3283
3284
|
p.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3284
3285
|
] }),
|
|
3285
|
-
|
|
3286
|
-
|
|
3286
|
+
C === "text" && /* @__PURE__ */ n(
|
|
3287
|
+
te,
|
|
3287
3288
|
{
|
|
3288
3289
|
control: y,
|
|
3289
|
-
name: `questionResults.${
|
|
3290
|
-
render: ({ field:
|
|
3291
|
-
var
|
|
3290
|
+
name: `questionResults.${x}.${m}.values.0`,
|
|
3291
|
+
render: ({ field: N }) => {
|
|
3292
|
+
var B, L, F, k;
|
|
3292
3293
|
return /* @__PURE__ */ n(
|
|
3293
|
-
|
|
3294
|
+
se,
|
|
3294
3295
|
{
|
|
3295
|
-
value:
|
|
3296
|
-
onChange:
|
|
3297
|
-
onBlur:
|
|
3298
|
-
name:
|
|
3296
|
+
value: N.value || "",
|
|
3297
|
+
onChange: N.onChange,
|
|
3298
|
+
onBlur: N.onBlur,
|
|
3299
|
+
name: N.name,
|
|
3299
3300
|
placeholder: "Enter your answer...",
|
|
3300
|
-
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
|
|
3301
3302
|
}
|
|
3302
3303
|
);
|
|
3303
3304
|
}
|
|
3304
3305
|
}
|
|
3305
3306
|
),
|
|
3306
|
-
(
|
|
3307
|
-
|
|
3307
|
+
(C === "single-select" || C === "radio") && /* @__PURE__ */ n(
|
|
3308
|
+
te,
|
|
3308
3309
|
{
|
|
3309
3310
|
control: y,
|
|
3310
|
-
name: `questionResults.${
|
|
3311
|
-
render: ({ field:
|
|
3312
|
-
var
|
|
3311
|
+
name: `questionResults.${x}.${m}.values.0`,
|
|
3312
|
+
render: ({ field: N }) => {
|
|
3313
|
+
var B, L, F, k;
|
|
3313
3314
|
return /* @__PURE__ */ n(
|
|
3314
3315
|
ge,
|
|
3315
3316
|
{
|
|
3316
|
-
value:
|
|
3317
|
-
onChange:
|
|
3318
|
-
onBlur:
|
|
3319
|
-
name:
|
|
3320
|
-
options: p.defaultAnswers.map((
|
|
3321
|
-
value:
|
|
3322
|
-
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
|
|
3323
3324
|
})),
|
|
3324
3325
|
placeholder: "Select an option...",
|
|
3325
|
-
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
|
|
3326
3327
|
}
|
|
3327
3328
|
);
|
|
3328
3329
|
}
|
|
3329
3330
|
}
|
|
3330
3331
|
),
|
|
3331
|
-
(
|
|
3332
|
+
(C === "checkbox" || C === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3332
3333
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
|
|
3333
3334
|
/* @__PURE__ */ n(
|
|
3334
|
-
|
|
3335
|
+
te,
|
|
3335
3336
|
{
|
|
3336
3337
|
control: y,
|
|
3337
|
-
name: `questionResults.${
|
|
3338
|
-
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(
|
|
3339
3340
|
"label",
|
|
3340
3341
|
{
|
|
3341
3342
|
className: "flex items-center space-x-2 cursor-pointer",
|
|
@@ -3344,10 +3345,10 @@ const Wr = me.any(), kr = ({
|
|
|
3344
3345
|
"input",
|
|
3345
3346
|
{
|
|
3346
3347
|
type: "checkbox",
|
|
3347
|
-
checked: Array.isArray(
|
|
3348
|
-
onChange: (
|
|
3349
|
-
const
|
|
3350
|
-
|
|
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);
|
|
3351
3352
|
},
|
|
3352
3353
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3353
3354
|
}
|
|
@@ -3355,7 +3356,7 @@ const Wr = me.any(), kr = ({
|
|
|
3355
3356
|
/* @__PURE__ */ n("span", { className: "text-sm", children: L })
|
|
3356
3357
|
]
|
|
3357
3358
|
},
|
|
3358
|
-
`answer-${
|
|
3359
|
+
`answer-${x}-${m}-${F}`
|
|
3359
3360
|
)) })
|
|
3360
3361
|
}
|
|
3361
3362
|
)
|
|
@@ -3363,7 +3364,7 @@ const Wr = me.any(), kr = ({
|
|
|
3363
3364
|
] }, p.id);
|
|
3364
3365
|
})
|
|
3365
3366
|
) }),
|
|
3366
|
-
/* @__PURE__ */ o(
|
|
3367
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3367
3368
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3368
3369
|
/* @__PURE__ */ n(
|
|
3369
3370
|
j,
|
|
@@ -3387,12 +3388,12 @@ const Wr = me.any(), kr = ({
|
|
|
3387
3388
|
onComplete: e,
|
|
3388
3389
|
onBack: r
|
|
3389
3390
|
}) => {
|
|
3390
|
-
const { uploadDocument: a, isLoading: s, isSubmitting: i, error: l, submit: c } = Xt(t), [d, u] =
|
|
3391
|
-
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;
|
|
3392
3393
|
const g = await Promise.all(
|
|
3393
3394
|
a.uploadDocumentFiles.map(async (h) => {
|
|
3394
|
-
const
|
|
3395
|
-
|
|
3395
|
+
const x = d[h.id] || [], p = await Promise.all(
|
|
3396
|
+
x.map(async (m) => ({
|
|
3396
3397
|
fileName: m.name,
|
|
3397
3398
|
fileData: await Ht(m)
|
|
3398
3399
|
}))
|
|
@@ -3402,36 +3403,36 @@ const Wr = me.any(), kr = ({
|
|
|
3402
3403
|
valueList: p
|
|
3403
3404
|
};
|
|
3404
3405
|
})
|
|
3405
|
-
),
|
|
3406
|
+
), w = {
|
|
3406
3407
|
applicantId: t,
|
|
3407
3408
|
uploadDocumentId: a.id,
|
|
3408
3409
|
uploadDocumentResults: g
|
|
3409
3410
|
};
|
|
3410
|
-
await c(
|
|
3411
|
+
await c(w), e == null || e();
|
|
3411
3412
|
};
|
|
3412
|
-
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: [
|
|
3413
3414
|
"Error loading document requirements: ",
|
|
3414
3415
|
l.message
|
|
3415
|
-
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(
|
|
3416
|
-
/* @__PURE__ */ o(
|
|
3416
|
+
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(M, { children: [
|
|
3417
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3417
3418
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3418
3419
|
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3419
3420
|
] }),
|
|
3420
|
-
/* @__PURE__ */ n(
|
|
3421
|
+
/* @__PURE__ */ n(O, { className: "space-y-6", children: a.uploadDocumentFiles.map((v) => /* @__PURE__ */ n(
|
|
3421
3422
|
sr,
|
|
3422
3423
|
{
|
|
3423
|
-
label:
|
|
3424
|
-
accept:
|
|
3425
|
-
multiple:
|
|
3426
|
-
maxSize:
|
|
3427
|
-
value: d[
|
|
3424
|
+
label: v.displayName,
|
|
3425
|
+
accept: v.allowedTypes,
|
|
3426
|
+
multiple: v.multipleFile,
|
|
3427
|
+
maxSize: v.maxEachFileSizeByte,
|
|
3428
|
+
value: d[v.id] || [],
|
|
3428
3429
|
onChange: (g) => {
|
|
3429
|
-
u((
|
|
3430
|
+
u((w) => ({ ...w, [v.id]: g }));
|
|
3430
3431
|
}
|
|
3431
3432
|
},
|
|
3432
|
-
|
|
3433
|
+
v.id
|
|
3433
3434
|
)) }),
|
|
3434
|
-
/* @__PURE__ */ o(
|
|
3435
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3435
3436
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3436
3437
|
/* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
|
|
3437
3438
|
] })
|
|
@@ -3440,15 +3441,15 @@ const Wr = me.any(), kr = ({
|
|
|
3440
3441
|
const { overview: a, isLoading: s, isSubmitting: i, error: l, passOverview: c } = er(t), d = async () => {
|
|
3441
3442
|
await c(), e == null || e();
|
|
3442
3443
|
};
|
|
3443
|
-
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: [
|
|
3444
3445
|
"Error loading overview: ",
|
|
3445
3446
|
l.message
|
|
3446
|
-
] }) }) }) : a ? /* @__PURE__ */ o(
|
|
3447
|
-
/* @__PURE__ */ o(
|
|
3447
|
+
] }) }) }) : a ? /* @__PURE__ */ o(M, { children: [
|
|
3448
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3448
3449
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
3449
3450
|
a.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
|
|
3450
3451
|
] }),
|
|
3451
|
-
/* @__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: [
|
|
3452
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 }) }),
|
|
3453
3454
|
/* @__PURE__ */ o(
|
|
3454
3455
|
"div",
|
|
@@ -3467,7 +3468,7 @@ const Wr = me.any(), kr = ({
|
|
|
3467
3468
|
}
|
|
3468
3469
|
)
|
|
3469
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..." }) }) }),
|
|
3470
|
-
/* @__PURE__ */ o(
|
|
3471
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3471
3472
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3472
3473
|
/* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Continue" })
|
|
3473
3474
|
] })
|
|
@@ -3477,148 +3478,148 @@ const Wr = me.any(), kr = ({
|
|
|
3477
3478
|
onComplete: e,
|
|
3478
3479
|
onBack: r
|
|
3479
3480
|
}) => {
|
|
3480
|
-
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: [] } : {
|
|
3481
3482
|
criteriaValueInputs: a.map((m) => ({
|
|
3482
3483
|
riskCriteriaId: m.id,
|
|
3483
3484
|
values: [""]
|
|
3484
3485
|
// Initialize with empty string to prevent uncontrolled input warning
|
|
3485
3486
|
}))
|
|
3486
|
-
}, [a]),
|
|
3487
|
+
}, [a]), v = a && a.length > 0 ? xr() : null, {
|
|
3487
3488
|
control: g,
|
|
3488
|
-
handleSubmit:
|
|
3489
|
+
handleSubmit: w,
|
|
3489
3490
|
formState: { errors: h }
|
|
3490
3491
|
} = Te({
|
|
3491
|
-
resolver:
|
|
3492
|
+
resolver: v ? Ze(v) : void 0,
|
|
3492
3493
|
defaultValues: y
|
|
3493
3494
|
});
|
|
3494
|
-
|
|
3495
|
+
re.useEffect(() => {
|
|
3495
3496
|
!s && a && a.length === 0 && !d && !i && (u(!0), c({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
|
|
3496
3497
|
}, [s, a, d, i, c, t, e]);
|
|
3497
|
-
const
|
|
3498
|
+
const x = async (m) => {
|
|
3498
3499
|
if (a)
|
|
3499
3500
|
try {
|
|
3500
3501
|
console.log("Risk scoring form submitted:", m), console.log("Criteria metadata:", a);
|
|
3501
|
-
const A = m.criteriaValueInputs.map((
|
|
3502
|
-
const L =
|
|
3503
|
-
return
|
|
3504
|
-
riskCriteriaId: a[
|
|
3505
|
-
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
|
|
3506
3507
|
};
|
|
3507
|
-
}).filter((
|
|
3508
|
+
}).filter((N) => N !== null);
|
|
3508
3509
|
console.log("Risk scoring criteriaValueInputs to submit:", A);
|
|
3509
|
-
const
|
|
3510
|
+
const C = {
|
|
3510
3511
|
applicantId: t,
|
|
3511
3512
|
criteriaValueInputs: A
|
|
3512
3513
|
};
|
|
3513
|
-
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();
|
|
3514
3515
|
} catch (A) {
|
|
3515
3516
|
throw console.error("Error submitting risk scoring:", A), A;
|
|
3516
3517
|
}
|
|
3517
3518
|
}, p = (m) => m.builtInType === 1 ? "country" : !m.defaultValues || m.defaultValues.length === 0 ? "text" : m.multipleValue ? "checkbox" : "radio";
|
|
3518
|
-
return s ? /* @__PURE__ */ n(
|
|
3519
|
+
return s ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
3519
3520
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3520
3521
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
|
|
3521
|
-
] }) }) : l ? /* @__PURE__ */ n(
|
|
3522
|
+
] }) }) : l ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3522
3523
|
"Error loading criteria: ",
|
|
3523
3524
|
l.message
|
|
3524
|
-
] }) }) }) : !s && a && a.length === 0 ? /* @__PURE__ */ n(
|
|
3525
|
+
] }) }) }) : !s && a && a.length === 0 ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
3525
3526
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3526
3527
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
|
|
3527
|
-
] }) }) : a ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3528
|
-
/* @__PURE__ */ o(
|
|
3528
|
+
] }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: w(x), children: /* @__PURE__ */ o(M, { children: [
|
|
3529
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3529
3530
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3530
3531
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
|
|
3531
3532
|
] }),
|
|
3532
|
-
/* @__PURE__ */ n(
|
|
3533
|
-
var
|
|
3534
|
-
const
|
|
3533
|
+
/* @__PURE__ */ n(O, { className: "space-y-8", children: a.map((m, A) => {
|
|
3534
|
+
var N, B, L;
|
|
3535
|
+
const C = p(m);
|
|
3535
3536
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3536
3537
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3537
3538
|
m.displayName,
|
|
3538
3539
|
m.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3539
3540
|
] }),
|
|
3540
3541
|
m.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: m.description }),
|
|
3541
|
-
|
|
3542
|
-
|
|
3542
|
+
C === "text" && /* @__PURE__ */ n(
|
|
3543
|
+
te,
|
|
3543
3544
|
{
|
|
3544
3545
|
control: g,
|
|
3545
3546
|
name: `criteriaValueInputs.${A}.values.0`,
|
|
3546
|
-
render: ({ field:
|
|
3547
|
-
var
|
|
3547
|
+
render: ({ field: F }) => {
|
|
3548
|
+
var k, T, D;
|
|
3548
3549
|
return /* @__PURE__ */ n(
|
|
3549
|
-
|
|
3550
|
+
se,
|
|
3550
3551
|
{
|
|
3551
|
-
...
|
|
3552
|
-
value:
|
|
3553
|
-
type: m.valueDataType ===
|
|
3552
|
+
...F,
|
|
3553
|
+
value: F.value || "",
|
|
3554
|
+
type: m.valueDataType === De.DigitOnly ? "number" : "text",
|
|
3554
3555
|
placeholder: "Enter your answer...",
|
|
3555
|
-
error: (
|
|
3556
|
-
onKeyDown: (
|
|
3557
|
-
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();
|
|
3558
3559
|
}
|
|
3559
3560
|
}
|
|
3560
3561
|
);
|
|
3561
3562
|
}
|
|
3562
3563
|
}
|
|
3563
3564
|
),
|
|
3564
|
-
|
|
3565
|
+
C === "radio" && m.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3565
3566
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
|
|
3566
3567
|
/* @__PURE__ */ n(
|
|
3567
|
-
|
|
3568
|
+
te,
|
|
3568
3569
|
{
|
|
3569
3570
|
control: g,
|
|
3570
3571
|
name: `criteriaValueInputs.${A}.values.0`,
|
|
3571
|
-
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: [
|
|
3572
3573
|
/* @__PURE__ */ n(
|
|
3573
3574
|
"input",
|
|
3574
3575
|
{
|
|
3575
3576
|
type: "radio",
|
|
3576
|
-
checked:
|
|
3577
|
-
onChange: () =>
|
|
3577
|
+
checked: F === T,
|
|
3578
|
+
onChange: () => k(T),
|
|
3578
3579
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3579
3580
|
}
|
|
3580
3581
|
),
|
|
3581
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3582
|
-
] }, `${A}-${
|
|
3582
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: T })
|
|
3583
|
+
] }, `${A}-${D}`)) })
|
|
3583
3584
|
}
|
|
3584
3585
|
)
|
|
3585
3586
|
] }),
|
|
3586
|
-
|
|
3587
|
+
C === "checkbox" && m.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3587
3588
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
|
|
3588
3589
|
/* @__PURE__ */ n(
|
|
3589
|
-
|
|
3590
|
+
te,
|
|
3590
3591
|
{
|
|
3591
3592
|
control: g,
|
|
3592
3593
|
name: `criteriaValueInputs.${A}.values`,
|
|
3593
|
-
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: [
|
|
3594
3595
|
/* @__PURE__ */ n(
|
|
3595
3596
|
"input",
|
|
3596
3597
|
{
|
|
3597
3598
|
type: "checkbox",
|
|
3598
|
-
checked: Array.isArray(
|
|
3599
|
-
onChange: (
|
|
3600
|
-
const
|
|
3601
|
-
|
|
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);
|
|
3602
3603
|
},
|
|
3603
3604
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3604
3605
|
}
|
|
3605
3606
|
),
|
|
3606
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3607
|
-
] }, `${A}-${
|
|
3607
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: T })
|
|
3608
|
+
] }, `${A}-${D}`)) })
|
|
3608
3609
|
}
|
|
3609
3610
|
)
|
|
3610
3611
|
] }),
|
|
3611
|
-
|
|
3612
|
-
|
|
3612
|
+
C === "country" && /* @__PURE__ */ n(
|
|
3613
|
+
te,
|
|
3613
3614
|
{
|
|
3614
3615
|
control: g,
|
|
3615
3616
|
name: `criteriaValueInputs.${A}.values.0`,
|
|
3616
|
-
render: ({ field:
|
|
3617
|
-
var
|
|
3617
|
+
render: ({ field: F }) => {
|
|
3618
|
+
var k, T, D;
|
|
3618
3619
|
return /* @__PURE__ */ n(
|
|
3619
3620
|
ge,
|
|
3620
3621
|
{
|
|
3621
|
-
...
|
|
3622
|
+
...F,
|
|
3622
3623
|
options: [
|
|
3623
3624
|
{ value: "US", label: "United States" },
|
|
3624
3625
|
{ value: "GB", label: "United Kingdom" },
|
|
@@ -3626,16 +3627,16 @@ const Wr = me.any(), kr = ({
|
|
|
3626
3627
|
// TODO: Load from base information service
|
|
3627
3628
|
],
|
|
3628
3629
|
placeholder: "Select a country...",
|
|
3629
|
-
error: (
|
|
3630
|
+
error: (D = (T = (k = h.criteriaValueInputs) == null ? void 0 : k[A]) == null ? void 0 : T.values) == null ? void 0 : D.message
|
|
3630
3631
|
}
|
|
3631
3632
|
);
|
|
3632
3633
|
}
|
|
3633
3634
|
}
|
|
3634
3635
|
),
|
|
3635
|
-
((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 })
|
|
3636
3637
|
] }, m.id);
|
|
3637
3638
|
}) }),
|
|
3638
|
-
/* @__PURE__ */ o(
|
|
3639
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3639
3640
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3640
3641
|
/* @__PURE__ */ n(
|
|
3641
3642
|
j,
|
|
@@ -3659,9 +3660,9 @@ const Wr = me.any(), kr = ({
|
|
|
3659
3660
|
onComplete: e,
|
|
3660
3661
|
onBack: r
|
|
3661
3662
|
}) => {
|
|
3662
|
-
const { investorCategorizationService: a } =
|
|
3663
|
-
return /* @__PURE__ */ n("form", { onSubmit: async (
|
|
3664
|
-
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) {
|
|
3665
3666
|
u("Please select an investor type");
|
|
3666
3667
|
return;
|
|
3667
3668
|
}
|
|
@@ -3672,26 +3673,26 @@ const Wr = me.any(), kr = ({
|
|
|
3672
3673
|
investorType: s
|
|
3673
3674
|
};
|
|
3674
3675
|
console.log("Submitting investor categorization:", g);
|
|
3675
|
-
const
|
|
3676
|
-
console.log("Investor categorization result:",
|
|
3676
|
+
const w = await a.setInvestorCategorization(g);
|
|
3677
|
+
console.log("Investor categorization result:", w), e == null || e();
|
|
3677
3678
|
} catch (g) {
|
|
3678
3679
|
console.error("Error submitting investor categorization:", g), u(g.message || "Failed to submit investor categorization");
|
|
3679
3680
|
} finally {
|
|
3680
3681
|
c(!1);
|
|
3681
3682
|
}
|
|
3682
|
-
}, children: /* @__PURE__ */ o(
|
|
3683
|
-
/* @__PURE__ */ o(
|
|
3683
|
+
}, children: /* @__PURE__ */ o(M, { children: [
|
|
3684
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3684
3685
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
|
|
3685
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" })
|
|
3686
3687
|
] }),
|
|
3687
|
-
/* @__PURE__ */ o(
|
|
3688
|
+
/* @__PURE__ */ o(O, { className: "space-y-4", children: [
|
|
3688
3689
|
/* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
|
|
3689
3690
|
/* @__PURE__ */ n(
|
|
3690
3691
|
"label",
|
|
3691
3692
|
{
|
|
3692
3693
|
className: `
|
|
3693
3694
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3694
|
-
${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"}
|
|
3695
3696
|
`,
|
|
3696
3697
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3697
3698
|
/* @__PURE__ */ n(
|
|
@@ -3699,9 +3700,9 @@ const Wr = me.any(), kr = ({
|
|
|
3699
3700
|
{
|
|
3700
3701
|
type: "radio",
|
|
3701
3702
|
name: "investorType",
|
|
3702
|
-
value:
|
|
3703
|
-
checked: s ===
|
|
3704
|
-
onChange: () => i(
|
|
3703
|
+
value: ae.Individual,
|
|
3704
|
+
checked: s === ae.Individual,
|
|
3705
|
+
onChange: () => i(ae.Individual),
|
|
3705
3706
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3706
3707
|
}
|
|
3707
3708
|
),
|
|
@@ -3717,7 +3718,7 @@ const Wr = me.any(), kr = ({
|
|
|
3717
3718
|
{
|
|
3718
3719
|
className: `
|
|
3719
3720
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3720
|
-
${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"}
|
|
3721
3722
|
`,
|
|
3722
3723
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3723
3724
|
/* @__PURE__ */ n(
|
|
@@ -3725,9 +3726,9 @@ const Wr = me.any(), kr = ({
|
|
|
3725
3726
|
{
|
|
3726
3727
|
type: "radio",
|
|
3727
3728
|
name: "investorType",
|
|
3728
|
-
value:
|
|
3729
|
-
checked: s ===
|
|
3730
|
-
onChange: () => i(
|
|
3729
|
+
value: ae.Sophisticated,
|
|
3730
|
+
checked: s === ae.Sophisticated,
|
|
3731
|
+
onChange: () => i(ae.Sophisticated),
|
|
3731
3732
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3732
3733
|
}
|
|
3733
3734
|
),
|
|
@@ -3748,7 +3749,7 @@ const Wr = me.any(), kr = ({
|
|
|
3748
3749
|
{
|
|
3749
3750
|
className: `
|
|
3750
3751
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3751
|
-
${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"}
|
|
3752
3753
|
`,
|
|
3753
3754
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3754
3755
|
/* @__PURE__ */ n(
|
|
@@ -3756,9 +3757,9 @@ const Wr = me.any(), kr = ({
|
|
|
3756
3757
|
{
|
|
3757
3758
|
type: "radio",
|
|
3758
3759
|
name: "investorType",
|
|
3759
|
-
value:
|
|
3760
|
-
checked: s ===
|
|
3761
|
-
onChange: () => i(
|
|
3760
|
+
value: ae.HighNetWorth,
|
|
3761
|
+
checked: s === ae.HighNetWorth,
|
|
3762
|
+
onChange: () => i(ae.HighNetWorth),
|
|
3762
3763
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3763
3764
|
}
|
|
3764
3765
|
),
|
|
@@ -3779,7 +3780,7 @@ const Wr = me.any(), kr = ({
|
|
|
3779
3780
|
d
|
|
3780
3781
|
] }) })
|
|
3781
3782
|
] }),
|
|
3782
|
-
/* @__PURE__ */ o(
|
|
3783
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3783
3784
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3784
3785
|
/* @__PURE__ */ n(
|
|
3785
3786
|
j,
|
|
@@ -3797,135 +3798,135 @@ const Wr = me.any(), kr = ({
|
|
|
3797
3798
|
onComplete: e,
|
|
3798
3799
|
onBack: r
|
|
3799
3800
|
}) => {
|
|
3800
|
-
const { appropriatenessTestService: a } =
|
|
3801
|
-
|
|
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(() => {
|
|
3802
3803
|
(async () => {
|
|
3803
3804
|
try {
|
|
3804
|
-
c(!0),
|
|
3805
|
-
const
|
|
3806
|
-
if (console.log("Appropriateness test data:",
|
|
3807
|
-
const
|
|
3808
|
-
|
|
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);
|
|
3809
3810
|
}
|
|
3810
|
-
} catch (
|
|
3811
|
-
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");
|
|
3812
3813
|
} finally {
|
|
3813
3814
|
c(!1);
|
|
3814
3815
|
}
|
|
3815
3816
|
})();
|
|
3816
3817
|
}, [t, a]);
|
|
3817
|
-
const L = (
|
|
3818
|
-
const
|
|
3819
|
-
if (
|
|
3820
|
-
const [
|
|
3821
|
-
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;
|
|
3822
3823
|
}
|
|
3823
3824
|
return 0;
|
|
3824
|
-
},
|
|
3825
|
-
const
|
|
3826
|
-
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")}`;
|
|
3827
3828
|
};
|
|
3828
|
-
|
|
3829
|
+
Q(() => {
|
|
3829
3830
|
if (!p || h <= 0) return;
|
|
3830
|
-
const
|
|
3831
|
-
|
|
3831
|
+
const R = setInterval(() => {
|
|
3832
|
+
x((E) => E <= 1 ? (C(!0), 0) : E - 1);
|
|
3832
3833
|
}, 1e3);
|
|
3833
|
-
return () => clearInterval(
|
|
3834
|
-
}, [p, h]),
|
|
3835
|
-
if (
|
|
3836
|
-
const
|
|
3837
|
-
|
|
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);
|
|
3838
3839
|
}, 1e3);
|
|
3839
|
-
return () => clearInterval(
|
|
3840
|
-
}, [
|
|
3841
|
-
A && !d &&
|
|
3840
|
+
return () => clearInterval(R);
|
|
3841
|
+
}, [N]), Q(() => {
|
|
3842
|
+
A && !d && D();
|
|
3842
3843
|
}, [A]);
|
|
3843
|
-
const
|
|
3844
|
-
s && (m(!0),
|
|
3845
|
-
},
|
|
3846
|
-
|
|
3847
|
-
...
|
|
3848
|
-
[
|
|
3844
|
+
const k = () => {
|
|
3845
|
+
s && (m(!0), x(s.testDurationSec));
|
|
3846
|
+
}, T = (R, E) => {
|
|
3847
|
+
w((H) => ({
|
|
3848
|
+
...H,
|
|
3849
|
+
[R]: E
|
|
3849
3850
|
}));
|
|
3850
|
-
},
|
|
3851
|
-
if (
|
|
3851
|
+
}, D = async (R) => {
|
|
3852
|
+
if (R && R.preventDefault(), !!s) {
|
|
3852
3853
|
if (!A) {
|
|
3853
|
-
const
|
|
3854
|
-
if (
|
|
3855
|
-
|
|
3854
|
+
const E = s.appropriatenessQuestions.length - Object.keys(g).length;
|
|
3855
|
+
if (E > 0) {
|
|
3856
|
+
v(`Please answer all questions. ${E} question(s) remaining.`);
|
|
3856
3857
|
return;
|
|
3857
3858
|
}
|
|
3858
3859
|
}
|
|
3859
|
-
u(!0),
|
|
3860
|
+
u(!0), v(null);
|
|
3860
3861
|
try {
|
|
3861
|
-
const
|
|
3862
|
-
(
|
|
3863
|
-
appropriatenessQuestionId:
|
|
3864
|
-
value: g[
|
|
3862
|
+
const E = s.appropriatenessQuestions.map(
|
|
3863
|
+
(b) => ({
|
|
3864
|
+
appropriatenessQuestionId: b.id,
|
|
3865
|
+
value: g[b.id] || ""
|
|
3865
3866
|
// Empty string if not answered
|
|
3866
3867
|
})
|
|
3867
|
-
),
|
|
3868
|
+
), H = {
|
|
3868
3869
|
applicantId: t,
|
|
3869
3870
|
appropriatenessTestId: s.id,
|
|
3870
|
-
appropriatenessQuestionResults:
|
|
3871
|
+
appropriatenessQuestionResults: E
|
|
3871
3872
|
};
|
|
3872
|
-
console.log("Submitting appropriateness test:",
|
|
3873
|
+
console.log("Submitting appropriateness test:", H);
|
|
3873
3874
|
try {
|
|
3874
|
-
const
|
|
3875
|
-
console.log("Appropriateness test result:",
|
|
3876
|
-
} catch (
|
|
3877
|
-
if (
|
|
3878
|
-
const
|
|
3879
|
-
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);
|
|
3880
3881
|
} else
|
|
3881
|
-
throw
|
|
3882
|
+
throw b;
|
|
3882
3883
|
}
|
|
3883
|
-
} catch (
|
|
3884
|
-
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({});
|
|
3885
3886
|
} finally {
|
|
3886
3887
|
u(!1);
|
|
3887
3888
|
}
|
|
3888
3889
|
}
|
|
3889
|
-
},
|
|
3890
|
+
}, G = async () => {
|
|
3890
3891
|
try {
|
|
3891
|
-
const
|
|
3892
|
-
if (console.log("Reloaded test data:",
|
|
3893
|
-
const
|
|
3894
|
-
|
|
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);
|
|
3895
3896
|
}
|
|
3896
|
-
} catch (
|
|
3897
|
-
console.error("Error reloading test data:",
|
|
3897
|
+
} catch (R) {
|
|
3898
|
+
console.error("Error reloading test data:", R), v((E) => E + `
|
|
3898
3899
|
|
|
3899
3900
|
Failed to reload test data. Please refresh the page.`);
|
|
3900
3901
|
}
|
|
3901
3902
|
};
|
|
3902
3903
|
if (l)
|
|
3903
|
-
return /* @__PURE__ */ n(
|
|
3904
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
3904
3905
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3905
3906
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
3906
3907
|
] }) });
|
|
3907
3908
|
if (!s)
|
|
3908
|
-
return /* @__PURE__ */ n(
|
|
3909
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { className: "py-12 text-center", children: [
|
|
3909
3910
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
3910
3911
|
y && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: y })
|
|
3911
3912
|
] }) });
|
|
3912
|
-
if (
|
|
3913
|
-
return /* @__PURE__ */ o(
|
|
3914
|
-
/* @__PURE__ */ o(
|
|
3913
|
+
if (N > 0)
|
|
3914
|
+
return /* @__PURE__ */ o(M, { children: [
|
|
3915
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3915
3916
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
3916
3917
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
3917
3918
|
] }),
|
|
3918
|
-
/* @__PURE__ */ o(
|
|
3919
|
+
/* @__PURE__ */ o(O, { className: "py-12 text-center", children: [
|
|
3919
3920
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
3920
|
-
/* @__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) }),
|
|
3921
3922
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
3922
3923
|
] }),
|
|
3923
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 }) })
|
|
3924
3925
|
] })
|
|
3925
3926
|
] });
|
|
3926
|
-
const
|
|
3927
|
-
return p ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3928
|
-
/* @__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: [
|
|
3929
3930
|
/* @__PURE__ */ o("div", { children: [
|
|
3930
3931
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
3931
3932
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
@@ -3935,13 +3936,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3935
3936
|
"div",
|
|
3936
3937
|
{
|
|
3937
3938
|
className: `text-3xl font-bold ${h <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
3938
|
-
children:
|
|
3939
|
+
children: F(h)
|
|
3939
3940
|
}
|
|
3940
3941
|
),
|
|
3941
3942
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
3942
3943
|
] })
|
|
3943
3944
|
] }) }),
|
|
3944
|
-
/* @__PURE__ */ o(
|
|
3945
|
+
/* @__PURE__ */ o(O, { className: "space-y-6", children: [
|
|
3945
3946
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
3946
3947
|
/* @__PURE__ */ o(pe, { variant: "info", children: [
|
|
3947
3948
|
"Question ",
|
|
@@ -3949,14 +3950,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3949
3950
|
" of ",
|
|
3950
3951
|
s.totalQuestionCount
|
|
3951
3952
|
] }),
|
|
3952
|
-
/* @__PURE__ */ o(pe, { variant:
|
|
3953
|
-
|
|
3953
|
+
/* @__PURE__ */ o(pe, { variant: K > 1 ? "success" : "warning", children: [
|
|
3954
|
+
K,
|
|
3954
3955
|
" attempt",
|
|
3955
|
-
|
|
3956
|
+
K !== 1 ? "s" : "",
|
|
3956
3957
|
" remaining"
|
|
3957
3958
|
] })
|
|
3958
3959
|
] }),
|
|
3959
|
-
s.appropriatenessQuestions.map((
|
|
3960
|
+
s.appropriatenessQuestions.map((R, E) => /* @__PURE__ */ o(
|
|
3960
3961
|
"div",
|
|
3961
3962
|
{
|
|
3962
3963
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -3964,39 +3965,39 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3964
3965
|
/* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
3965
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: [
|
|
3966
3967
|
"Question ",
|
|
3967
|
-
|
|
3968
|
+
E + 1
|
|
3968
3969
|
] }),
|
|
3969
|
-
|
|
3970
|
-
/* @__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 })
|
|
3971
3972
|
] }),
|
|
3972
|
-
/* @__PURE__ */ n("div", { className: "space-y-2", children:
|
|
3973
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: R.answers.map((H, b) => /* @__PURE__ */ o(
|
|
3973
3974
|
"label",
|
|
3974
3975
|
{
|
|
3975
3976
|
className: `
|
|
3976
3977
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
3977
|
-
${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"}
|
|
3978
3979
|
`,
|
|
3979
3980
|
children: [
|
|
3980
3981
|
/* @__PURE__ */ n(
|
|
3981
3982
|
"input",
|
|
3982
3983
|
{
|
|
3983
3984
|
type: "radio",
|
|
3984
|
-
name: `question-${
|
|
3985
|
-
value:
|
|
3986
|
-
checked: g[
|
|
3987
|
-
onChange: (
|
|
3985
|
+
name: `question-${R.id}`,
|
|
3986
|
+
value: H,
|
|
3987
|
+
checked: g[R.id] === H,
|
|
3988
|
+
onChange: (P) => T(R.id, P.target.value),
|
|
3988
3989
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
3989
3990
|
disabled: d
|
|
3990
3991
|
}
|
|
3991
3992
|
),
|
|
3992
|
-
/* @__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 })
|
|
3993
3994
|
]
|
|
3994
3995
|
},
|
|
3995
|
-
|
|
3996
|
+
b
|
|
3996
3997
|
)) })
|
|
3997
3998
|
]
|
|
3998
3999
|
},
|
|
3999
|
-
|
|
4000
|
+
R.id
|
|
4000
4001
|
)),
|
|
4001
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: [
|
|
4002
4003
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
@@ -4008,7 +4009,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4008
4009
|
" Your answers are being submitted automatically."
|
|
4009
4010
|
] }) })
|
|
4010
4011
|
] }),
|
|
4011
|
-
/* @__PURE__ */ o(
|
|
4012
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4012
4013
|
/* @__PURE__ */ n(
|
|
4013
4014
|
j,
|
|
4014
4015
|
{
|
|
@@ -4029,12 +4030,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4029
4030
|
}
|
|
4030
4031
|
)
|
|
4031
4032
|
] })
|
|
4032
|
-
] }) }) : /* @__PURE__ */ o(
|
|
4033
|
-
/* @__PURE__ */ o(
|
|
4033
|
+
] }) }) : /* @__PURE__ */ o(M, { children: [
|
|
4034
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4034
4035
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4035
4036
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
4036
4037
|
] }),
|
|
4037
|
-
/* @__PURE__ */ o(
|
|
4038
|
+
/* @__PURE__ */ o(O, { children: [
|
|
4038
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 }) }),
|
|
4039
4040
|
/* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
|
|
4040
4041
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
@@ -4043,7 +4044,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4043
4044
|
] }),
|
|
4044
4045
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4045
4046
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4046
|
-
/* @__PURE__ */ n(pe, { variant: "info", children:
|
|
4047
|
+
/* @__PURE__ */ n(pe, { variant: "info", children: F(s.testDurationSec) })
|
|
4047
4048
|
] }),
|
|
4048
4049
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4049
4050
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
@@ -4051,7 +4052,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4051
4052
|
] }),
|
|
4052
4053
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4053
4054
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4054
|
-
/* @__PURE__ */ n(pe, { variant:
|
|
4055
|
+
/* @__PURE__ */ n(pe, { variant: K > 1 ? "success" : "warning", children: K })
|
|
4055
4056
|
] })
|
|
4056
4057
|
] }),
|
|
4057
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: [
|
|
@@ -4059,16 +4060,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4059
4060
|
" ",
|
|
4060
4061
|
y
|
|
4061
4062
|
] }) }),
|
|
4062
|
-
|
|
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." }) })
|
|
4063
4064
|
] }),
|
|
4064
|
-
/* @__PURE__ */ o(
|
|
4065
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4065
4066
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4066
4067
|
/* @__PURE__ */ n(
|
|
4067
4068
|
j,
|
|
4068
4069
|
{
|
|
4069
4070
|
type: "button",
|
|
4070
|
-
onClick:
|
|
4071
|
-
disabled:
|
|
4071
|
+
onClick: k,
|
|
4072
|
+
disabled: K <= 0,
|
|
4072
4073
|
children: "Start Test"
|
|
4073
4074
|
}
|
|
4074
4075
|
)
|
|
@@ -4079,8 +4080,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4079
4080
|
onComplete: e,
|
|
4080
4081
|
onBack: r
|
|
4081
4082
|
}) => {
|
|
4082
|
-
var
|
|
4083
|
-
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({
|
|
4084
4085
|
defaultValues: {
|
|
4085
4086
|
street: "",
|
|
4086
4087
|
streetNumber: "",
|
|
@@ -4091,163 +4092,163 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4091
4092
|
phonenumber: ""
|
|
4092
4093
|
}
|
|
4093
4094
|
});
|
|
4094
|
-
|
|
4095
|
+
Q(() => {
|
|
4095
4096
|
(async () => {
|
|
4096
4097
|
try {
|
|
4097
|
-
const [
|
|
4098
|
+
const [f, _] = await Promise.all([
|
|
4098
4099
|
a.getApplicantData(t),
|
|
4099
4100
|
s.getCountries("", "en")
|
|
4100
4101
|
]);
|
|
4101
|
-
p(
|
|
4102
|
-
const
|
|
4102
|
+
p(f);
|
|
4103
|
+
const W = /* @__PURE__ */ new Set(), X = _.filter((he) => {
|
|
4103
4104
|
const Ae = he.abbreviation3 || he.abbreviation;
|
|
4104
|
-
return !Ae ||
|
|
4105
|
+
return !Ae || W.has(Ae) ? !1 : (W.add(Ae), !0);
|
|
4105
4106
|
});
|
|
4106
|
-
A(
|
|
4107
|
-
const
|
|
4108
|
-
if (
|
|
4109
|
-
street: (
|
|
4110
|
-
streetNumber: (
|
|
4111
|
-
city: (
|
|
4112
|
-
zip: (
|
|
4113
|
-
country: (
|
|
4114
|
-
nationality: (
|
|
4115
|
-
phonenumber: (
|
|
4116
|
-
}),
|
|
4117
|
-
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;
|
|
4118
4119
|
try {
|
|
4119
|
-
await
|
|
4120
|
+
await v(), L(!0);
|
|
4120
4121
|
} catch (he) {
|
|
4121
4122
|
console.error("[Identity] Auto-request failed:", he);
|
|
4122
4123
|
}
|
|
4123
4124
|
}
|
|
4124
|
-
} catch (
|
|
4125
|
-
console.error("Error loading applicant data:",
|
|
4125
|
+
} catch (f) {
|
|
4126
|
+
console.error("Error loading applicant data:", f);
|
|
4126
4127
|
} finally {
|
|
4127
|
-
|
|
4128
|
+
N(!1);
|
|
4128
4129
|
}
|
|
4129
4130
|
})();
|
|
4130
|
-
}, [t]),
|
|
4131
|
-
l && !
|
|
4132
|
-
}, [l,
|
|
4131
|
+
}, [t]), Q(() => {
|
|
4132
|
+
l && !B && (console.log("[Identity] Identity data already loaded, showing provider"), L(!0));
|
|
4133
|
+
}, [l, B]), Q(() => {
|
|
4133
4134
|
if (d) {
|
|
4134
4135
|
if (d.expiresAt) {
|
|
4135
|
-
const
|
|
4136
|
-
if (Date.now() >=
|
|
4137
|
-
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.");
|
|
4138
4139
|
return;
|
|
4139
4140
|
}
|
|
4140
4141
|
}
|
|
4141
4142
|
if (d.url)
|
|
4142
4143
|
try {
|
|
4143
|
-
const
|
|
4144
|
-
if (
|
|
4145
|
-
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.");
|
|
4146
4147
|
return;
|
|
4147
4148
|
}
|
|
4148
4149
|
} catch {
|
|
4149
4150
|
console.error("[Identity] Invalid token URL");
|
|
4150
4151
|
}
|
|
4151
4152
|
if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
|
|
4152
|
-
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.");
|
|
4153
4154
|
return;
|
|
4154
4155
|
}
|
|
4155
4156
|
}
|
|
4156
|
-
}, [d]),
|
|
4157
|
-
if (c !== null && d && !
|
|
4158
|
-
const
|
|
4157
|
+
}, [d]), Q(() => {
|
|
4158
|
+
if (c !== null && d && !w && B && !T) {
|
|
4159
|
+
const I = c;
|
|
4159
4160
|
if (d.url) {
|
|
4160
|
-
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);
|
|
4161
4162
|
try {
|
|
4162
|
-
if (new URL(d.url),
|
|
4163
|
+
if (new URL(d.url), I === le.SardinAI) {
|
|
4163
4164
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4164
4165
|
try {
|
|
4165
|
-
const
|
|
4166
|
-
be.createProvider(c,
|
|
4166
|
+
const f = be.parseProviderConfig(c, d, i);
|
|
4167
|
+
be.createProvider(c, f).initialize().then(() => {
|
|
4167
4168
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4168
|
-
}).catch((
|
|
4169
|
-
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):",
|
|
4169
|
+
}).catch((W) => {
|
|
4170
|
+
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", W);
|
|
4170
4171
|
});
|
|
4171
|
-
} catch (
|
|
4172
|
-
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):",
|
|
4172
|
+
} catch (f) {
|
|
4173
|
+
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", f);
|
|
4173
4174
|
}
|
|
4174
4175
|
}
|
|
4175
4176
|
h({ type: "url", url: d.url });
|
|
4176
|
-
} catch (
|
|
4177
|
-
console.error("[Identity] Invalid URL:",
|
|
4177
|
+
} catch (f) {
|
|
4178
|
+
console.error("[Identity] Invalid URL:", f), k("Invalid verification URL. Please restart."), D(!0);
|
|
4178
4179
|
}
|
|
4179
4180
|
return;
|
|
4180
4181
|
}
|
|
4181
|
-
if (
|
|
4182
|
-
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);
|
|
4183
4184
|
try {
|
|
4184
|
-
const
|
|
4185
|
-
|
|
4186
|
-
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(() => {
|
|
4187
4188
|
e == null || e();
|
|
4188
4189
|
}, 2e3);
|
|
4189
|
-
}).catch((
|
|
4190
|
-
var
|
|
4191
|
-
console.error("[SardinAI] Failed to initialize:",
|
|
4192
|
-
const
|
|
4193
|
-
|
|
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}`);
|
|
4194
4195
|
});
|
|
4195
|
-
} catch (
|
|
4196
|
-
console.error("[SardinAI] Error creating provider:",
|
|
4196
|
+
} catch (f) {
|
|
4197
|
+
console.error("[SardinAI] Error creating provider:", f), k(`Configuration error: ${f.message}`);
|
|
4197
4198
|
}
|
|
4198
4199
|
return;
|
|
4199
4200
|
}
|
|
4200
4201
|
try {
|
|
4201
|
-
|
|
4202
|
-
const
|
|
4203
|
-
|
|
4204
|
-
var
|
|
4205
|
-
console.error("[Sumsub] Initialization error:",
|
|
4206
|
-
}),
|
|
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(() => {
|
|
4207
4208
|
e == null || e();
|
|
4208
|
-
})) :
|
|
4209
|
-
console.error("[Onfido] Initialization error:",
|
|
4210
|
-
}), h(
|
|
4211
|
-
} catch (
|
|
4212
|
-
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}`);
|
|
4213
4214
|
}
|
|
4214
4215
|
}
|
|
4215
4216
|
return () => {
|
|
4216
|
-
if (
|
|
4217
|
+
if (w && w.destroy)
|
|
4217
4218
|
try {
|
|
4218
|
-
|
|
4219
|
-
} catch (
|
|
4220
|
-
console.error("[Identity] Error destroying provider:",
|
|
4219
|
+
w.destroy();
|
|
4220
|
+
} catch (I) {
|
|
4221
|
+
console.error("[Identity] Error destroying provider:", I);
|
|
4221
4222
|
}
|
|
4222
4223
|
};
|
|
4223
|
-
}, [c, d,
|
|
4224
|
-
const
|
|
4224
|
+
}, [c, d, w, B, e, T]);
|
|
4225
|
+
const R = async () => {
|
|
4225
4226
|
try {
|
|
4226
|
-
|
|
4227
|
-
} catch (
|
|
4228
|
-
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);
|
|
4229
4230
|
}
|
|
4230
|
-
},
|
|
4231
|
+
}, E = async () => {
|
|
4231
4232
|
try {
|
|
4232
|
-
|
|
4233
|
-
} catch (
|
|
4234
|
-
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");
|
|
4235
4236
|
}
|
|
4236
4237
|
};
|
|
4237
|
-
if (
|
|
4238
|
-
return /* @__PURE__ */ n(
|
|
4238
|
+
if (C || u)
|
|
4239
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
4239
4240
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4240
4241
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4241
4242
|
] }) });
|
|
4242
4243
|
if (y)
|
|
4243
|
-
return /* @__PURE__ */ n(
|
|
4244
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4244
4245
|
"Error: ",
|
|
4245
4246
|
y.message
|
|
4246
4247
|
] }) }) });
|
|
4247
|
-
if (
|
|
4248
|
-
return /* @__PURE__ */ o(
|
|
4249
|
-
/* @__PURE__ */ n(
|
|
4250
|
-
/* @__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: [
|
|
4251
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: [
|
|
4252
4253
|
/* @__PURE__ */ n(
|
|
4253
4254
|
"svg",
|
|
@@ -4268,8 +4269,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4268
4269
|
}
|
|
4269
4270
|
),
|
|
4270
4271
|
/* @__PURE__ */ o("div", { children: [
|
|
4271
|
-
/* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children:
|
|
4272
|
-
/* @__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." })
|
|
4273
4274
|
] })
|
|
4274
4275
|
] }) }),
|
|
4275
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: [
|
|
@@ -4281,15 +4282,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4281
4282
|
] })
|
|
4282
4283
|
] })
|
|
4283
4284
|
] }),
|
|
4284
|
-
/* @__PURE__ */ o(
|
|
4285
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4285
4286
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4286
|
-
/* @__PURE__ */ n(j, { type: "button", onClick:
|
|
4287
|
+
/* @__PURE__ */ n(j, { type: "button", onClick: E, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
|
|
4287
4288
|
] })
|
|
4288
4289
|
] });
|
|
4289
|
-
if (
|
|
4290
|
-
const
|
|
4291
|
-
return d != null && d.url ? /* @__PURE__ */ o(
|
|
4292
|
-
/* @__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: [
|
|
4293
4294
|
/* @__PURE__ */ o("div", { children: [
|
|
4294
4295
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4295
4296
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
@@ -4300,13 +4301,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4300
4301
|
type: "button",
|
|
4301
4302
|
variant: "outline",
|
|
4302
4303
|
size: "sm",
|
|
4303
|
-
onClick:
|
|
4304
|
+
onClick: E,
|
|
4304
4305
|
disabled: u,
|
|
4305
4306
|
children: "Restart"
|
|
4306
4307
|
}
|
|
4307
4308
|
)
|
|
4308
4309
|
] }) }),
|
|
4309
|
-
/* @__PURE__ */ o(
|
|
4310
|
+
/* @__PURE__ */ o(O, { children: [
|
|
4310
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: [
|
|
4311
4312
|
/* @__PURE__ */ n("strong", { children: "Important:" }),
|
|
4312
4313
|
' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
|
|
@@ -4318,14 +4319,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4318
4319
|
className: "w-full h-full border-0 rounded-lg",
|
|
4319
4320
|
allow: "camera; microphone; geolocation",
|
|
4320
4321
|
title: "Identity Verification",
|
|
4321
|
-
onLoad: (
|
|
4322
|
-
var
|
|
4322
|
+
onLoad: (f) => {
|
|
4323
|
+
var _, W, X;
|
|
4323
4324
|
console.log("[Identity] Iframe loaded");
|
|
4324
4325
|
try {
|
|
4325
|
-
const
|
|
4326
|
+
const q = f.target, Ce = q.contentDocument || ((_ = q.contentWindow) == null ? void 0 : _.document);
|
|
4326
4327
|
if (Ce) {
|
|
4327
|
-
const he = ((
|
|
4328
|
-
(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."));
|
|
4329
4330
|
}
|
|
4330
4331
|
} catch {
|
|
4331
4332
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4334,68 +4335,68 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4334
4335
|
}
|
|
4335
4336
|
) })
|
|
4336
4337
|
] }),
|
|
4337
|
-
r && /* @__PURE__ */ n(
|
|
4338
|
-
] }) :
|
|
4339
|
-
/* @__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: [
|
|
4340
4341
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4341
4342
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4342
4343
|
] }),
|
|
4343
|
-
/* @__PURE__ */ n(
|
|
4344
|
+
/* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
|
|
4344
4345
|
/* @__PURE__ */ n(de, { className: "mb-4" }),
|
|
4345
4346
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4346
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" })
|
|
4347
4348
|
] }) })
|
|
4348
|
-
] }) : /* @__PURE__ */ o(
|
|
4349
|
-
/* @__PURE__ */ o(
|
|
4349
|
+
] }) : /* @__PURE__ */ o(M, { children: [
|
|
4350
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4350
4351
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4351
4352
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4352
4353
|
] }),
|
|
4353
|
-
/* @__PURE__ */ n(
|
|
4354
|
-
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" }) })
|
|
4355
4356
|
] });
|
|
4356
4357
|
}
|
|
4357
|
-
return /* @__PURE__ */ n("form", { onSubmit:
|
|
4358
|
-
/* @__PURE__ */ o(
|
|
4358
|
+
return /* @__PURE__ */ n("form", { onSubmit: K.handleSubmit(R), children: /* @__PURE__ */ o(M, { children: [
|
|
4359
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4359
4360
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
|
|
4360
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" })
|
|
4361
4362
|
] }),
|
|
4362
|
-
/* @__PURE__ */ o(
|
|
4363
|
+
/* @__PURE__ */ o(O, { className: "space-y-6", children: [
|
|
4363
4364
|
/* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
|
|
4364
4365
|
/* @__PURE__ */ o("div", { children: [
|
|
4365
4366
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4366
4367
|
/* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
|
|
4367
|
-
(
|
|
4368
|
+
(H = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : H.firstName,
|
|
4368
4369
|
" ",
|
|
4369
|
-
(
|
|
4370
|
+
(b = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : b.lastName
|
|
4370
4371
|
] })
|
|
4371
4372
|
] }),
|
|
4372
4373
|
/* @__PURE__ */ o("div", { children: [
|
|
4373
4374
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4374
|
-
/* @__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 })
|
|
4375
4376
|
] }),
|
|
4376
4377
|
/* @__PURE__ */ o("div", { children: [
|
|
4377
4378
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4378
|
-
/* @__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" })
|
|
4379
4380
|
] })
|
|
4380
4381
|
] }),
|
|
4381
4382
|
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
4382
4383
|
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold", children: "Address Information" }),
|
|
4383
4384
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4384
4385
|
/* @__PURE__ */ n(
|
|
4385
|
-
|
|
4386
|
+
te,
|
|
4386
4387
|
{
|
|
4387
|
-
control:
|
|
4388
|
+
control: K.control,
|
|
4388
4389
|
name: "country",
|
|
4389
|
-
render: ({ field:
|
|
4390
|
+
render: ({ field: I }) => /* @__PURE__ */ n(
|
|
4390
4391
|
ge,
|
|
4391
4392
|
{
|
|
4392
|
-
...
|
|
4393
|
+
...I,
|
|
4393
4394
|
label: "Country",
|
|
4394
4395
|
options: [
|
|
4395
4396
|
{ value: "", label: "Select country..." },
|
|
4396
|
-
...m.map((
|
|
4397
|
-
value:
|
|
4398
|
-
label:
|
|
4397
|
+
...m.map((f) => ({
|
|
4398
|
+
value: f.abbreviation3 || f.abbreviation,
|
|
4399
|
+
label: f.name
|
|
4399
4400
|
}))
|
|
4400
4401
|
]
|
|
4401
4402
|
}
|
|
@@ -4403,20 +4404,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4403
4404
|
}
|
|
4404
4405
|
),
|
|
4405
4406
|
/* @__PURE__ */ n(
|
|
4406
|
-
|
|
4407
|
+
te,
|
|
4407
4408
|
{
|
|
4408
|
-
control:
|
|
4409
|
+
control: K.control,
|
|
4409
4410
|
name: "nationality",
|
|
4410
|
-
render: ({ field:
|
|
4411
|
+
render: ({ field: I }) => /* @__PURE__ */ n(
|
|
4411
4412
|
ge,
|
|
4412
4413
|
{
|
|
4413
|
-
...
|
|
4414
|
+
...I,
|
|
4414
4415
|
label: "Nationality",
|
|
4415
4416
|
options: [
|
|
4416
4417
|
{ value: "", label: "Select nationality..." },
|
|
4417
|
-
...m.map((
|
|
4418
|
-
value:
|
|
4419
|
-
label:
|
|
4418
|
+
...m.map((f) => ({
|
|
4419
|
+
value: f.abbreviation3 || f.abbreviation,
|
|
4420
|
+
label: f.name
|
|
4420
4421
|
}))
|
|
4421
4422
|
]
|
|
4422
4423
|
}
|
|
@@ -4426,51 +4427,51 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4426
4427
|
] }),
|
|
4427
4428
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4428
4429
|
/* @__PURE__ */ n(
|
|
4429
|
-
|
|
4430
|
+
te,
|
|
4430
4431
|
{
|
|
4431
|
-
control:
|
|
4432
|
+
control: K.control,
|
|
4432
4433
|
name: "street",
|
|
4433
|
-
render: ({ field:
|
|
4434
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "Street" })
|
|
4434
4435
|
}
|
|
4435
4436
|
),
|
|
4436
4437
|
/* @__PURE__ */ n(
|
|
4437
|
-
|
|
4438
|
+
te,
|
|
4438
4439
|
{
|
|
4439
|
-
control:
|
|
4440
|
+
control: K.control,
|
|
4440
4441
|
name: "streetNumber",
|
|
4441
|
-
render: ({ field:
|
|
4442
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "Street Number" })
|
|
4442
4443
|
}
|
|
4443
4444
|
)
|
|
4444
4445
|
] }),
|
|
4445
4446
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4446
4447
|
/* @__PURE__ */ n(
|
|
4447
|
-
|
|
4448
|
+
te,
|
|
4448
4449
|
{
|
|
4449
|
-
control:
|
|
4450
|
+
control: K.control,
|
|
4450
4451
|
name: "city",
|
|
4451
|
-
render: ({ field:
|
|
4452
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "City" })
|
|
4452
4453
|
}
|
|
4453
4454
|
),
|
|
4454
4455
|
/* @__PURE__ */ n(
|
|
4455
|
-
|
|
4456
|
+
te,
|
|
4456
4457
|
{
|
|
4457
|
-
control:
|
|
4458
|
+
control: K.control,
|
|
4458
4459
|
name: "zip",
|
|
4459
|
-
render: ({ field:
|
|
4460
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "ZIP/Postal Code" })
|
|
4460
4461
|
}
|
|
4461
4462
|
)
|
|
4462
4463
|
] }),
|
|
4463
4464
|
/* @__PURE__ */ n(
|
|
4464
|
-
|
|
4465
|
+
te,
|
|
4465
4466
|
{
|
|
4466
|
-
control:
|
|
4467
|
+
control: K.control,
|
|
4467
4468
|
name: "phonenumber",
|
|
4468
|
-
render: ({ field:
|
|
4469
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "Phone Number", type: "tel" })
|
|
4469
4470
|
}
|
|
4470
4471
|
)
|
|
4471
4472
|
] })
|
|
4472
4473
|
] }),
|
|
4473
|
-
/* @__PURE__ */ o(
|
|
4474
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4474
4475
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4475
4476
|
/* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
|
|
4476
4477
|
] })
|
|
@@ -4554,8 +4555,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4554
4555
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4555
4556
|
message: "Your application is being reviewed."
|
|
4556
4557
|
};
|
|
4557
|
-
return /* @__PURE__ */ o(
|
|
4558
|
-
/* @__PURE__ */ o(
|
|
4558
|
+
return /* @__PURE__ */ o(M, { children: [
|
|
4559
|
+
/* @__PURE__ */ o(O, { className: "py-12", children: [
|
|
4559
4560
|
/* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
|
|
4560
4561
|
"div",
|
|
4561
4562
|
{
|
|
@@ -4608,9 +4609,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4608
4609
|
] })
|
|
4609
4610
|
] }) })
|
|
4610
4611
|
] }),
|
|
4611
|
-
/* @__PURE__ */ o(
|
|
4612
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-center gap-4", children: [
|
|
4612
4613
|
c.type === "success" && s && /* @__PURE__ */ n(j, { onClick: s, size: "lg", children: "Continue" }),
|
|
4613
|
-
c.type === "error" && /* @__PURE__ */ o(
|
|
4614
|
+
c.type === "error" && /* @__PURE__ */ o(at, { children: [
|
|
4614
4615
|
i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
|
|
4615
4616
|
s && /* @__PURE__ */ n(j, { onClick: s, children: "Try Again" })
|
|
4616
4617
|
] }),
|
|
@@ -4632,12 +4633,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4632
4633
|
console.warn("[Logo] Failed to load logo:", t.url), r.target.style.display = "none";
|
|
4633
4634
|
}
|
|
4634
4635
|
}
|
|
4635
|
-
) }),
|
|
4636
|
+
) }), Je = ({
|
|
4636
4637
|
title: t,
|
|
4637
4638
|
subtitle: e,
|
|
4638
4639
|
className: r = ""
|
|
4639
4640
|
}) => {
|
|
4640
|
-
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;
|
|
4641
4642
|
return !i && !l ? null : /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
|
|
4642
4643
|
/* @__PURE__ */ o("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
4643
4644
|
i && /* @__PURE__ */ n(Rr, { config: a.logo }),
|
|
@@ -4659,29 +4660,35 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4659
4660
|
onSuccess: r,
|
|
4660
4661
|
onCancel: a
|
|
4661
4662
|
}) => {
|
|
4662
|
-
var
|
|
4663
|
-
const { config: s, baseInformationService: i, currentTheme: l } =
|
|
4664
|
-
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)
|
|
4665
4666
|
throw new Error(
|
|
4666
4667
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4667
4668
|
);
|
|
4668
|
-
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(() => {
|
|
4669
4676
|
var $;
|
|
4670
|
-
let
|
|
4671
|
-
($ = s.applicantForm) != null && $.visibleFields ?
|
|
4672
|
-
const
|
|
4673
|
-
for (const
|
|
4674
|
-
|
|
4675
|
-
return Array.from(
|
|
4676
|
-
}, [(
|
|
4677
|
-
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,
|
|
4678
4685
|
firstName: "",
|
|
4679
4686
|
lastName: "",
|
|
4680
4687
|
title: "",
|
|
4681
4688
|
email: "",
|
|
4682
4689
|
dateOfBirth: "",
|
|
4683
4690
|
phonenumber: "",
|
|
4684
|
-
externalRefId:
|
|
4691
|
+
externalRefId: N,
|
|
4685
4692
|
// Set from config or prop
|
|
4686
4693
|
mobileCountryCode: "",
|
|
4687
4694
|
street: "",
|
|
@@ -4700,7 +4707,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4700
4707
|
occupation: "",
|
|
4701
4708
|
taxNumber: ""
|
|
4702
4709
|
});
|
|
4703
|
-
|
|
4710
|
+
Q(() => {
|
|
4704
4711
|
(async () => {
|
|
4705
4712
|
if (m.current || A.current) {
|
|
4706
4713
|
console.log("[CreateApplicant] Countries already loading or loaded, skipping...");
|
|
@@ -4708,75 +4715,80 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4708
4715
|
}
|
|
4709
4716
|
m.current = !0, g(!0);
|
|
4710
4717
|
try {
|
|
4711
|
-
const
|
|
4712
|
-
value:
|
|
4713
|
-
label:
|
|
4714
|
-
})).filter((
|
|
4715
|
-
y(
|
|
4716
|
-
} catch (
|
|
4717
|
-
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);
|
|
4718
4725
|
} finally {
|
|
4719
4726
|
g(!1), m.current = !1;
|
|
4720
4727
|
}
|
|
4721
4728
|
})();
|
|
4722
4729
|
}, []);
|
|
4723
|
-
const D = (
|
|
4724
|
-
|
|
4725
|
-
},
|
|
4726
|
-
|
|
4730
|
+
const D = (b, P) => {
|
|
4731
|
+
T(($) => ({ ...$, [b]: P }));
|
|
4732
|
+
}, G = async (b) => {
|
|
4733
|
+
var P;
|
|
4734
|
+
b.preventDefault(), h(!0), p(null);
|
|
4727
4735
|
try {
|
|
4728
|
-
if (!
|
|
4736
|
+
if (!k.externalRefId || k.externalRefId.trim() === "") {
|
|
4729
4737
|
p("External Reference ID is required. Please pass it via config.applicantForm.externalRefId."), h(!1);
|
|
4730
4738
|
return;
|
|
4731
4739
|
}
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
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
|
+
}
|
|
4735
4747
|
}
|
|
4736
|
-
const
|
|
4737
|
-
workflowKey:
|
|
4738
|
-
externalRefId:
|
|
4748
|
+
const $ = {
|
|
4749
|
+
workflowKey: k.workflowKey,
|
|
4750
|
+
externalRefId: k.externalRefId.trim()
|
|
4739
4751
|
// Always include, never empty
|
|
4740
4752
|
};
|
|
4741
|
-
|
|
4742
|
-
if (
|
|
4743
|
-
const
|
|
4744
|
-
|
|
4745
|
-
}), console.log("Creating applicant with data:",
|
|
4746
|
-
const
|
|
4747
|
-
|
|
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
|
+
$
|
|
4748
4760
|
);
|
|
4749
|
-
console.log("Applicant created:",
|
|
4750
|
-
} catch (
|
|
4751
|
-
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");
|
|
4752
4764
|
} finally {
|
|
4753
4765
|
h(!1);
|
|
4754
4766
|
}
|
|
4755
|
-
},
|
|
4756
|
-
var
|
|
4757
|
-
const
|
|
4758
|
-
switch (
|
|
4767
|
+
}, K = (b) => {
|
|
4768
|
+
var I;
|
|
4769
|
+
const P = Oe[b], $ = L.includes(b);
|
|
4770
|
+
switch (P.type) {
|
|
4759
4771
|
case "select":
|
|
4760
|
-
return
|
|
4772
|
+
return b === "country" || b === "nationality" || b === "taxCountry" || b === "countryOfBirth" ? /* @__PURE__ */ n(
|
|
4761
4773
|
ge,
|
|
4762
4774
|
{
|
|
4763
|
-
label:
|
|
4764
|
-
value:
|
|
4765
|
-
onChange: (
|
|
4775
|
+
label: P.label,
|
|
4776
|
+
value: k[b] || "",
|
|
4777
|
+
onChange: (f) => D(b, f.target.value),
|
|
4766
4778
|
options: [
|
|
4767
|
-
{ value: "", label: `Select ${
|
|
4779
|
+
{ value: "", label: `Select ${P.label.toLowerCase()}...` },
|
|
4768
4780
|
...u
|
|
4769
4781
|
],
|
|
4770
|
-
disabled:
|
|
4782
|
+
disabled: v,
|
|
4771
4783
|
required: $
|
|
4772
4784
|
},
|
|
4773
|
-
|
|
4774
|
-
) :
|
|
4785
|
+
b
|
|
4786
|
+
) : b === "salutation" ? /* @__PURE__ */ n(
|
|
4775
4787
|
ge,
|
|
4776
4788
|
{
|
|
4777
|
-
label:
|
|
4778
|
-
value: ((
|
|
4779
|
-
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),
|
|
4780
4792
|
options: [
|
|
4781
4793
|
{ value: "", label: "Select salutation..." },
|
|
4782
4794
|
{ value: Se.Male.toString(), label: "Male" },
|
|
@@ -4785,108 +4797,108 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4785
4797
|
],
|
|
4786
4798
|
required: $
|
|
4787
4799
|
},
|
|
4788
|
-
|
|
4789
|
-
) :
|
|
4800
|
+
b
|
|
4801
|
+
) : b === "defaultLanguage" ? /* @__PURE__ */ n(
|
|
4790
4802
|
ge,
|
|
4791
4803
|
{
|
|
4792
|
-
label:
|
|
4793
|
-
value:
|
|
4794
|
-
onChange: (
|
|
4804
|
+
label: P.label,
|
|
4805
|
+
value: k[b] || "",
|
|
4806
|
+
onChange: (f) => D(b, f.target.value),
|
|
4795
4807
|
options: [
|
|
4796
4808
|
{ value: "", label: "Select language..." },
|
|
4797
|
-
...
|
|
4809
|
+
...yt
|
|
4798
4810
|
],
|
|
4799
4811
|
required: $
|
|
4800
4812
|
},
|
|
4801
|
-
|
|
4813
|
+
b
|
|
4802
4814
|
) : null;
|
|
4803
4815
|
case "multiselect":
|
|
4804
|
-
return
|
|
4816
|
+
return b === "otherNationality" ? /* @__PURE__ */ n(
|
|
4805
4817
|
ar,
|
|
4806
4818
|
{
|
|
4807
|
-
label:
|
|
4808
|
-
value:
|
|
4809
|
-
onChange: (
|
|
4819
|
+
label: P.label,
|
|
4820
|
+
value: k[b] || [],
|
|
4821
|
+
onChange: (f) => D(b, f),
|
|
4810
4822
|
options: u,
|
|
4811
4823
|
placeholder: "Select other nationalities...",
|
|
4812
|
-
disabled:
|
|
4824
|
+
disabled: v,
|
|
4813
4825
|
required: $
|
|
4814
4826
|
},
|
|
4815
|
-
|
|
4827
|
+
b
|
|
4816
4828
|
) : null;
|
|
4817
4829
|
case "date":
|
|
4818
4830
|
return /* @__PURE__ */ n(
|
|
4819
|
-
|
|
4831
|
+
se,
|
|
4820
4832
|
{
|
|
4821
4833
|
type: "date",
|
|
4822
|
-
label:
|
|
4823
|
-
value:
|
|
4824
|
-
onChange: (
|
|
4834
|
+
label: P.label,
|
|
4835
|
+
value: k[b] || "",
|
|
4836
|
+
onChange: (f) => D(b, f.target.value),
|
|
4825
4837
|
required: $
|
|
4826
4838
|
},
|
|
4827
|
-
|
|
4839
|
+
b
|
|
4828
4840
|
);
|
|
4829
4841
|
case "email":
|
|
4830
4842
|
return /* @__PURE__ */ n(
|
|
4831
|
-
|
|
4843
|
+
se,
|
|
4832
4844
|
{
|
|
4833
4845
|
type: "email",
|
|
4834
|
-
label:
|
|
4835
|
-
value:
|
|
4836
|
-
onChange: (
|
|
4846
|
+
label: P.label,
|
|
4847
|
+
value: k[b] || "",
|
|
4848
|
+
onChange: (f) => D(b, f.target.value),
|
|
4837
4849
|
required: $
|
|
4838
4850
|
},
|
|
4839
|
-
|
|
4851
|
+
b
|
|
4840
4852
|
);
|
|
4841
4853
|
case "tel":
|
|
4842
4854
|
return /* @__PURE__ */ n(
|
|
4843
|
-
|
|
4855
|
+
se,
|
|
4844
4856
|
{
|
|
4845
4857
|
type: "tel",
|
|
4846
|
-
label:
|
|
4847
|
-
value:
|
|
4848
|
-
onChange: (
|
|
4858
|
+
label: P.label,
|
|
4859
|
+
value: k[b] || "",
|
|
4860
|
+
onChange: (f) => D(b, f.target.value),
|
|
4849
4861
|
required: $
|
|
4850
4862
|
},
|
|
4851
|
-
|
|
4863
|
+
b
|
|
4852
4864
|
);
|
|
4853
4865
|
case "text":
|
|
4854
4866
|
default:
|
|
4855
4867
|
return /* @__PURE__ */ n(
|
|
4856
|
-
|
|
4868
|
+
se,
|
|
4857
4869
|
{
|
|
4858
4870
|
type: "text",
|
|
4859
|
-
label:
|
|
4860
|
-
value:
|
|
4861
|
-
onChange: (
|
|
4871
|
+
label: P.label,
|
|
4872
|
+
value: k[b] || "",
|
|
4873
|
+
onChange: (f) => D(b, f.target.value),
|
|
4862
4874
|
required: $
|
|
4863
4875
|
},
|
|
4864
|
-
|
|
4876
|
+
b
|
|
4865
4877
|
);
|
|
4866
4878
|
}
|
|
4867
4879
|
};
|
|
4868
|
-
return
|
|
4880
|
+
return v ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
4869
4881
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4870
4882
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
4871
|
-
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit:
|
|
4872
|
-
/* @__PURE__ */ n(
|
|
4873
|
-
|
|
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,
|
|
4874
4886
|
{
|
|
4875
4887
|
title: "Create Applicant",
|
|
4876
4888
|
subtitle: "Please fill in the required information to begin the KYC verification process."
|
|
4877
4889
|
}
|
|
4878
4890
|
) }),
|
|
4879
|
-
/* @__PURE__ */ o(
|
|
4880
|
-
|
|
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: [
|
|
4881
4893
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
4882
4894
|
" ",
|
|
4883
|
-
|
|
4895
|
+
x
|
|
4884
4896
|
] }) }),
|
|
4885
|
-
/* @__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)) })
|
|
4886
4898
|
] }),
|
|
4887
|
-
/* @__PURE__ */ o(
|
|
4888
|
-
a && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: a, disabled:
|
|
4889
|
-
/* @__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" })
|
|
4890
4902
|
] })
|
|
4891
4903
|
] }) }) });
|
|
4892
4904
|
}, Gr = ({
|
|
@@ -4903,31 +4915,31 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4903
4915
|
workflowKey: d,
|
|
4904
4916
|
nextWorkflowKey: u,
|
|
4905
4917
|
hasWorkflowChanged: y,
|
|
4906
|
-
isLoading:
|
|
4918
|
+
isLoading: v,
|
|
4907
4919
|
error: g,
|
|
4908
|
-
moveBack:
|
|
4920
|
+
moveBack: w,
|
|
4909
4921
|
refreshProgress: h
|
|
4910
|
-
} = Zt(t), [
|
|
4911
|
-
if (
|
|
4922
|
+
} = Zt(t), [x, p] = re.useState(!1);
|
|
4923
|
+
if (re.useEffect(() => {
|
|
4912
4924
|
g && r && r(g);
|
|
4913
|
-
}, [g, r]),
|
|
4925
|
+
}, [g, r]), re.useEffect(() => {
|
|
4914
4926
|
i != null && i.workflowResult && e && e(i.workflowResult);
|
|
4915
|
-
}, [i == null ? void 0 : i.workflowResult, e]),
|
|
4927
|
+
}, [i == null ? void 0 : i.workflowResult, e]), re.useEffect(() => {
|
|
4916
4928
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
4917
|
-
}, [a]),
|
|
4929
|
+
}, [a]), re.useEffect(() => {
|
|
4918
4930
|
y && p(!1);
|
|
4919
|
-
}, [y]),
|
|
4920
|
-
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: [
|
|
4921
4933
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4922
4934
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
4923
4935
|
] }) }) });
|
|
4924
4936
|
if (g)
|
|
4925
|
-
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: [
|
|
4926
4938
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
4927
4939
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g.message })
|
|
4928
4940
|
] }) }) }) });
|
|
4929
|
-
if (y && !
|
|
4930
|
-
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: [
|
|
4931
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" }) }) }) }),
|
|
4932
4944
|
/* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
4933
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." }),
|
|
@@ -4969,101 +4981,101 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4969
4981
|
}
|
|
4970
4982
|
) });
|
|
4971
4983
|
if (!l)
|
|
4972
|
-
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: [
|
|
4973
4985
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4974
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..." })
|
|
4975
4987
|
] }) }) });
|
|
4976
|
-
const m = (
|
|
4977
|
-
switch (
|
|
4978
|
-
case
|
|
4988
|
+
const m = (N) => {
|
|
4989
|
+
switch (N) {
|
|
4990
|
+
case z.Overview:
|
|
4979
4991
|
return "Overview";
|
|
4980
|
-
case
|
|
4992
|
+
case z.Questionaries:
|
|
4981
4993
|
return "Questionnaire";
|
|
4982
|
-
case
|
|
4994
|
+
case z.UploadDocument:
|
|
4983
4995
|
return "Documents";
|
|
4984
|
-
case
|
|
4996
|
+
case z.IdentitySdk:
|
|
4985
4997
|
return "Identity";
|
|
4986
|
-
case
|
|
4998
|
+
case z.RiskScoring:
|
|
4987
4999
|
return "Risk Assessment";
|
|
4988
|
-
case
|
|
5000
|
+
case z.InvestorCategorization:
|
|
4989
5001
|
return "Investor Categorization";
|
|
4990
|
-
case
|
|
5002
|
+
case z.AppropriatenessTest:
|
|
4991
5003
|
return "Appropriateness Test";
|
|
4992
|
-
case
|
|
5004
|
+
case z.AdditionalData:
|
|
4993
5005
|
return "Additional Data";
|
|
4994
|
-
case
|
|
5006
|
+
case z.ManualReview:
|
|
4995
5007
|
return "Review";
|
|
4996
5008
|
default:
|
|
4997
5009
|
return "";
|
|
4998
5010
|
}
|
|
4999
5011
|
}, A = () => {
|
|
5000
|
-
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;
|
|
5001
5013
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
5002
5014
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5003
|
-
/* @__PURE__ */ n(
|
|
5015
|
+
/* @__PURE__ */ n(Je, {}),
|
|
5004
5016
|
/* @__PURE__ */ o(pe, { variant: i.status === 1 ? "info" : "success", children: [
|
|
5005
5017
|
"Step ",
|
|
5006
5018
|
L,
|
|
5007
5019
|
" of ",
|
|
5008
|
-
|
|
5020
|
+
F
|
|
5009
5021
|
] })
|
|
5010
5022
|
] }),
|
|
5011
|
-
/* @__PURE__ */ n("div", { className: "flex items-center", children:
|
|
5012
|
-
const
|
|
5013
|
-
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: [
|
|
5014
5026
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
5015
5027
|
/* @__PURE__ */ n(
|
|
5016
5028
|
"div",
|
|
5017
5029
|
{
|
|
5018
5030
|
className: `
|
|
5019
5031
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
5020
|
-
${
|
|
5032
|
+
${D || G ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
5021
5033
|
`,
|
|
5022
|
-
children:
|
|
5034
|
+
children: T + 1
|
|
5023
5035
|
}
|
|
5024
5036
|
),
|
|
5025
5037
|
/* @__PURE__ */ n(
|
|
5026
5038
|
"span",
|
|
5027
5039
|
{
|
|
5028
|
-
className: `ml-2 text-sm ${
|
|
5029
|
-
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}`
|
|
5030
5042
|
}
|
|
5031
5043
|
)
|
|
5032
5044
|
] }),
|
|
5033
|
-
|
|
5045
|
+
T < N.length - 1 && /* @__PURE__ */ n(
|
|
5034
5046
|
"div",
|
|
5035
5047
|
{
|
|
5036
|
-
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"}`
|
|
5037
5049
|
}
|
|
5038
5050
|
)
|
|
5039
|
-
] },
|
|
5051
|
+
] }, k.order);
|
|
5040
5052
|
}) })
|
|
5041
5053
|
] });
|
|
5042
|
-
},
|
|
5043
|
-
const
|
|
5054
|
+
}, C = () => {
|
|
5055
|
+
const N = {
|
|
5044
5056
|
applicantId: t,
|
|
5045
5057
|
onComplete: async () => {
|
|
5046
5058
|
await h();
|
|
5047
5059
|
},
|
|
5048
|
-
onBack: l.order > 0 ?
|
|
5060
|
+
onBack: l.order > 0 ? w : void 0
|
|
5049
5061
|
};
|
|
5050
5062
|
switch (l.action) {
|
|
5051
|
-
case
|
|
5052
|
-
return /* @__PURE__ */ n(kr, { ...
|
|
5053
|
-
case
|
|
5054
|
-
return /* @__PURE__ */ n(Nr, { ...
|
|
5055
|
-
case
|
|
5056
|
-
return /* @__PURE__ */ n(Sr, { ...
|
|
5057
|
-
case
|
|
5058
|
-
return /* @__PURE__ */ n(Ir, { ...
|
|
5059
|
-
case
|
|
5060
|
-
return /* @__PURE__ */ n(Cr, { ...
|
|
5061
|
-
case
|
|
5062
|
-
case
|
|
5063
|
-
return /* @__PURE__ */ n(Ar, { ...
|
|
5064
|
-
case
|
|
5065
|
-
return /* @__PURE__ */ n(Er, { ...
|
|
5066
|
-
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:
|
|
5067
5079
|
return /* @__PURE__ */ n(
|
|
5068
5080
|
_e,
|
|
5069
5081
|
{
|
|
@@ -5074,7 +5086,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5074
5086
|
}
|
|
5075
5087
|
);
|
|
5076
5088
|
default:
|
|
5077
|
-
return /* @__PURE__ */ n(
|
|
5089
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { className: "py-12 text-center", children: [
|
|
5078
5090
|
/* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(de, {}) }),
|
|
5079
5091
|
/* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
5080
5092
|
"Processing step: ",
|
|
@@ -5082,111 +5094,111 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5082
5094
|
] }),
|
|
5083
5095
|
/* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
5084
5096
|
"Action type: ",
|
|
5085
|
-
|
|
5097
|
+
z[l.action]
|
|
5086
5098
|
] })
|
|
5087
5099
|
] }) });
|
|
5088
5100
|
}
|
|
5089
5101
|
};
|
|
5090
5102
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
5091
5103
|
A(),
|
|
5092
|
-
|
|
5104
|
+
C()
|
|
5093
5105
|
] });
|
|
5094
5106
|
};
|
|
5095
5107
|
export {
|
|
5096
|
-
|
|
5108
|
+
yt as ALLOWED_LANGUAGES,
|
|
5097
5109
|
Or as ALL_APPLICANT_FIELDS,
|
|
5098
|
-
|
|
5110
|
+
st as ApplicantProgressOnHoldReason,
|
|
5099
5111
|
ce as ApplicantProgressStatus,
|
|
5100
5112
|
wt as ApplicantService,
|
|
5101
|
-
|
|
5102
|
-
|
|
5113
|
+
ot as ApplicantStatus,
|
|
5114
|
+
mt as AppropriatenessQuestionType,
|
|
5103
5115
|
St as AppropriatenessTestService,
|
|
5104
5116
|
Er as AppropriatenessTestStep,
|
|
5105
5117
|
pe as Badge,
|
|
5106
5118
|
It as BaseInformationService,
|
|
5107
5119
|
j as Button,
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5120
|
+
M as Card,
|
|
5121
|
+
O as CardContent,
|
|
5122
|
+
ie as CardFooter,
|
|
5123
|
+
ne as CardHeader,
|
|
5112
5124
|
Qr as CreateApplicantForm,
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5125
|
+
pt as CriteriaBuiltInType,
|
|
5126
|
+
ft as DEFAULT_VISIBLE_FIELDS,
|
|
5127
|
+
ut as DocumentReviewStatus,
|
|
5116
5128
|
vt as EndpointBuilder,
|
|
5117
5129
|
xe as ErrorHandler,
|
|
5118
5130
|
Bt as EventEmitter,
|
|
5119
|
-
|
|
5120
|
-
|
|
5131
|
+
Oe as FIELD_METADATA,
|
|
5132
|
+
dt as FileType,
|
|
5121
5133
|
sr as FileUpload,
|
|
5122
5134
|
Se as GenderType,
|
|
5123
|
-
|
|
5135
|
+
Je as Header,
|
|
5124
5136
|
xt as HttpClient,
|
|
5125
5137
|
be as IdentityProviderManager,
|
|
5126
5138
|
Et as IdentityService,
|
|
5127
5139
|
le as IdentityVerificationProvider,
|
|
5128
5140
|
Ir as IdentityVerificationStep,
|
|
5129
|
-
|
|
5141
|
+
se as Input,
|
|
5130
5142
|
Rt as InvestorCategorizationService,
|
|
5131
5143
|
Ar as InvestorCategorizationStep,
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5144
|
+
ae as InvestorCategorizationType,
|
|
5145
|
+
gt as InvestorCategoryType,
|
|
5146
|
+
lt as KycProcessStatus,
|
|
5135
5147
|
ye as KycStatus,
|
|
5136
5148
|
_e as KycStatusDisplay,
|
|
5137
5149
|
Gr as KycWorkflow,
|
|
5138
5150
|
Rr as Logo,
|
|
5139
|
-
|
|
5151
|
+
Ke as MetaKYCContext,
|
|
5140
5152
|
ue as MetaKYCError,
|
|
5141
5153
|
$r as MetaKYCProvider,
|
|
5142
5154
|
ar as MultiSelect,
|
|
5143
|
-
|
|
5155
|
+
jt as OnfidoProvider,
|
|
5144
5156
|
Ct as OverviewService,
|
|
5145
5157
|
Sr as OverviewStep,
|
|
5146
5158
|
ir as PhoneInput,
|
|
5147
5159
|
kt as QuestionnaireService,
|
|
5148
5160
|
kr as QuestionnaireStep,
|
|
5149
5161
|
fe as ReviewStatus,
|
|
5150
|
-
|
|
5151
|
-
|
|
5162
|
+
ht as RiskCriteriaType,
|
|
5163
|
+
it as RiskLevel,
|
|
5152
5164
|
At as RiskScoringService,
|
|
5153
5165
|
Cr as RiskScoringStep,
|
|
5154
|
-
|
|
5166
|
+
Ut as SardinAIProvider,
|
|
5155
5167
|
ge as Select,
|
|
5156
5168
|
de as Spinner,
|
|
5157
5169
|
$t as StepRouter,
|
|
5158
|
-
|
|
5170
|
+
_t as SumsubProvider,
|
|
5159
5171
|
Kt as ThemeManager,
|
|
5160
|
-
|
|
5172
|
+
Z as ThemePreset,
|
|
5161
5173
|
Ot as ThemeService,
|
|
5162
5174
|
Nt as UploadDocumentService,
|
|
5163
5175
|
Nr as UploadDocumentStep,
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5176
|
+
ct as UserType,
|
|
5177
|
+
De as ValueDataType,
|
|
5178
|
+
qt as WorkflowOrchestrator,
|
|
5167
5179
|
Ne as WorkflowResultType,
|
|
5168
5180
|
zt as WorkflowState,
|
|
5169
|
-
|
|
5181
|
+
z as WorkflowStepAction,
|
|
5170
5182
|
Wr as appropriatenessTestSchema,
|
|
5171
5183
|
Kr as clearAllStorage,
|
|
5172
5184
|
Wt as clearApplicantId,
|
|
5173
5185
|
Gt as clearWorkflowState,
|
|
5174
|
-
|
|
5175
|
-
|
|
5186
|
+
J as cn,
|
|
5187
|
+
Ft as corporateTheme,
|
|
5176
5188
|
bt as defaultConfig,
|
|
5177
|
-
|
|
5189
|
+
ee as defaultTheme,
|
|
5178
5190
|
Ht as fileToBase64,
|
|
5179
|
-
|
|
5191
|
+
Dt as fintechTheme,
|
|
5180
5192
|
Ie as formatFileSize,
|
|
5181
5193
|
Yr as generateAppropriatenessSchema,
|
|
5182
5194
|
br as generateQuestionnaireSchema,
|
|
5183
5195
|
xr as generateRiskScoringSchema,
|
|
5184
5196
|
Vr as generateUploadDocumentSchema,
|
|
5185
|
-
|
|
5197
|
+
jr as getAcceptString,
|
|
5186
5198
|
Yt as getApplicantId,
|
|
5187
5199
|
we as getThemePreset,
|
|
5188
|
-
|
|
5189
|
-
|
|
5200
|
+
Ur as getWorkflowState,
|
|
5201
|
+
Pt as healthcareTheme,
|
|
5190
5202
|
Br as isScriptLoaded,
|
|
5191
5203
|
Ue as loadScript,
|
|
5192
5204
|
Tt as minimalTheme,
|
|
@@ -5199,12 +5211,12 @@ export {
|
|
|
5199
5211
|
Hr as useAppropriatenessTest,
|
|
5200
5212
|
tr as useIdentityVerification,
|
|
5201
5213
|
Zt as useKycWorkflow,
|
|
5202
|
-
|
|
5214
|
+
oe as useMetaKYC,
|
|
5203
5215
|
er as useOverview,
|
|
5204
5216
|
Jt as useQuestionnaire,
|
|
5205
5217
|
rr as useRiskScoring,
|
|
5206
5218
|
Xt as useUploadDocument,
|
|
5207
|
-
|
|
5208
|
-
|
|
5219
|
+
qr as validateFileSize,
|
|
5220
|
+
_r as validateFileType
|
|
5209
5221
|
};
|
|
5210
5222
|
//# sourceMappingURL=index.js.map
|