@vpdev2/metakyc-sdk 1.0.65 → 1.0.66
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 +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +471 -468
- package/dist/index.js.map +1 -1
- package/dist/types/common.d.ts +2 -0
- package/dist/types/common.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,19 +3,19 @@ var kt = (e, t, n) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var ne = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import wt from "axios";
|
|
5
5
|
import * as nt from "react";
|
|
6
|
-
import
|
|
6
|
+
import ye, { createContext as Nt, useState as v, useMemo as Ie, useEffect as ae, useContext as St, useRef as ee, useCallback as Q, forwardRef as je, createElement as Ge } from "react";
|
|
7
7
|
import { jsx as r, jsxs as s, Fragment as dt } from "react/jsx-runtime";
|
|
8
|
-
import { createPortal as
|
|
9
|
-
import { useForm as Ct, Controller as
|
|
10
|
-
import { z as
|
|
11
|
-
var V = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(V || {}),
|
|
12
|
-
const
|
|
8
|
+
import { createPortal as Ze } from "react-dom";
|
|
9
|
+
import { useForm as Ct, Controller as De } from "react-hook-form";
|
|
10
|
+
import { z as Ce } from "zod";
|
|
11
|
+
var V = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(V || {}), Ke = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(Ke || {}), ve = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(ve || {}), At = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(At || {}), Et = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Et || {}), Fe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(Fe || {}), Le = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(Le || {}), It = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(It || {}), Rt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Rt || {}), be = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(be || {}), Pt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Pt || {}), We = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(We || {}), Dt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(Dt || {}), Ft = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Ft || {}), Lt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Lt || {}), Re = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Re || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(Tt || {}), Mt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Mt || {}), ge = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(ge || {}), Ot = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Ot || {});
|
|
12
|
+
const Te = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
15
15
|
CountryOfBirth: 30,
|
|
16
16
|
PhoneNumber: 40,
|
|
17
17
|
UboAddress: 50
|
|
18
|
-
},
|
|
18
|
+
}, Me = {
|
|
19
19
|
firstName: { label: "First Name", type: "text" },
|
|
20
20
|
lastName: { label: "Last Name", type: "text" },
|
|
21
21
|
email: { label: "Email", type: "email" },
|
|
@@ -23,17 +23,17 @@ const Le = {
|
|
|
23
23
|
dateOfBirth: { label: "Date of Birth", type: "date" },
|
|
24
24
|
salutation: { label: "Salutation", type: "select" },
|
|
25
25
|
title: { label: "Title", type: "text" },
|
|
26
|
-
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType:
|
|
26
|
+
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType: Te.PhoneNumber },
|
|
27
27
|
street: { label: "Street", type: "text" },
|
|
28
28
|
streetNumber: { label: "Street Number", type: "text" },
|
|
29
29
|
zip: { label: "ZIP / Postal Code", type: "text" },
|
|
30
30
|
city: { label: "City", type: "text" },
|
|
31
|
-
country: { label: "Country", type: "select", countriesType:
|
|
32
|
-
nationality: { label: "Nationality", type: "select", countriesType:
|
|
33
|
-
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType:
|
|
34
|
-
countryOfBirth: { label: "Country of Birth", type: "select", countriesType:
|
|
31
|
+
country: { label: "Country", type: "select", countriesType: Te.Address },
|
|
32
|
+
nationality: { label: "Nationality", type: "select", countriesType: Te.Nationality },
|
|
33
|
+
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType: Te.Nationality },
|
|
34
|
+
countryOfBirth: { label: "Country of Birth", type: "select", countriesType: Te.CountryOfBirth },
|
|
35
35
|
placeOfBirth: { label: "Place of Birth", type: "text" },
|
|
36
|
-
taxCountry: { label: "Tax Country", type: "select", countriesType:
|
|
36
|
+
taxCountry: { label: "Tax Country", type: "select", countriesType: Te.Address },
|
|
37
37
|
taxNumber: { label: "Tax Number", type: "text" },
|
|
38
38
|
defaultLanguage: { label: "Default Language", type: "select" },
|
|
39
39
|
educationLevel: { label: "Education Level", type: "text" },
|
|
@@ -63,7 +63,7 @@ const Le = {
|
|
|
63
63
|
{ value: "FI", label: "Finnish" },
|
|
64
64
|
{ value: "NO", label: "Norwegian" }
|
|
65
65
|
];
|
|
66
|
-
var
|
|
66
|
+
var le = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(le || {});
|
|
67
67
|
const $t = {
|
|
68
68
|
timeout: 3e4,
|
|
69
69
|
retries: 3,
|
|
@@ -112,19 +112,19 @@ class Bt {
|
|
|
112
112
|
}[t] || t;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
class
|
|
115
|
+
class Se extends Error {
|
|
116
116
|
constructor(n, a, i, o, l) {
|
|
117
117
|
super(n);
|
|
118
118
|
ne(this, "response");
|
|
119
|
-
this.code = a, this.details = i, this.validationErrors = o, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this,
|
|
119
|
+
this.code = a, this.details = i, this.validationErrors = o, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this, Se.prototype);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
class
|
|
122
|
+
class $e {
|
|
123
123
|
/**
|
|
124
124
|
* Process an error from the API response
|
|
125
125
|
*/
|
|
126
126
|
static handleApiError(t) {
|
|
127
|
-
return new
|
|
127
|
+
return new Se(
|
|
128
128
|
t.message || "An unknown error occurred",
|
|
129
129
|
t.code,
|
|
130
130
|
t.details || void 0,
|
|
@@ -137,36 +137,36 @@ class ze {
|
|
|
137
137
|
static handleAxiosError(t) {
|
|
138
138
|
if (t.response) {
|
|
139
139
|
const n = t.response.data;
|
|
140
|
-
return n && n.error ? new
|
|
140
|
+
return n && n.error ? new Se(
|
|
141
141
|
n.error.message || "An unknown error occurred",
|
|
142
142
|
n.error.code,
|
|
143
143
|
n.error.details || void 0,
|
|
144
144
|
n.error.validationErrors || void 0,
|
|
145
145
|
t.response
|
|
146
|
-
) : n && n.result && n.result.message ? new
|
|
146
|
+
) : n && n.result && n.result.message ? new Se(
|
|
147
147
|
n.result.message,
|
|
148
148
|
t.response.status,
|
|
149
149
|
`HTTP ${t.response.status}: ${t.response.statusText}`,
|
|
150
150
|
void 0,
|
|
151
151
|
t.response
|
|
152
|
-
) : new
|
|
152
|
+
) : new Se(
|
|
153
153
|
(n == null ? void 0 : n.message) || t.message || "Request failed",
|
|
154
154
|
t.response.status,
|
|
155
155
|
`HTTP ${t.response.status}: ${t.response.statusText}`,
|
|
156
156
|
void 0,
|
|
157
157
|
t.response
|
|
158
158
|
);
|
|
159
|
-
} else return t.request ? new
|
|
159
|
+
} else return t.request ? new Se(
|
|
160
160
|
"No response from server",
|
|
161
161
|
0,
|
|
162
162
|
"The request was made but no response was received. Please check your network connection."
|
|
163
|
-
) : new
|
|
163
|
+
) : new Se(t.message || "An unexpected error occurred", 0, t.toString());
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Check if an error is a MetaKYCError
|
|
167
167
|
*/
|
|
168
168
|
static isMetaKYCError(t) {
|
|
169
|
-
return t instanceof
|
|
169
|
+
return t instanceof Se;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
class _t {
|
|
@@ -210,7 +210,7 @@ class _t {
|
|
|
210
210
|
});
|
|
211
211
|
return this.handleResponse(o);
|
|
212
212
|
} catch (i) {
|
|
213
|
-
throw
|
|
213
|
+
throw $e.handleAxiosError(i);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
@@ -221,7 +221,7 @@ class _t {
|
|
|
221
221
|
const i = this.buildEndpoint(t, n), o = await this.axiosInstance.post(i, a);
|
|
222
222
|
return this.handleResponse(o);
|
|
223
223
|
} catch (i) {
|
|
224
|
-
throw
|
|
224
|
+
throw $e.handleAxiosError(i);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
@@ -232,7 +232,7 @@ class _t {
|
|
|
232
232
|
const i = this.buildEndpoint(t, n), o = await this.axiosInstance.put(i, a);
|
|
233
233
|
return this.handleResponse(o);
|
|
234
234
|
} catch (i) {
|
|
235
|
-
throw
|
|
235
|
+
throw $e.handleAxiosError(i);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
@@ -245,7 +245,7 @@ class _t {
|
|
|
245
245
|
});
|
|
246
246
|
return this.handleResponse(o);
|
|
247
247
|
} catch (i) {
|
|
248
|
-
throw
|
|
248
|
+
throw $e.handleAxiosError(i);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
/**
|
|
@@ -254,7 +254,7 @@ class _t {
|
|
|
254
254
|
handleResponse(t) {
|
|
255
255
|
const n = t.data;
|
|
256
256
|
if (!n.success && n.error)
|
|
257
|
-
throw
|
|
257
|
+
throw $e.handleApiError(n.error);
|
|
258
258
|
return n;
|
|
259
259
|
}
|
|
260
260
|
/**
|
|
@@ -872,14 +872,14 @@ const ue = {
|
|
|
872
872
|
inputHeight: "2.25rem"
|
|
873
873
|
}
|
|
874
874
|
}, tr = {
|
|
875
|
-
[
|
|
876
|
-
[
|
|
877
|
-
[
|
|
878
|
-
[
|
|
879
|
-
[
|
|
880
|
-
[
|
|
875
|
+
[le.Default]: ue,
|
|
876
|
+
[le.Corporate]: Vt,
|
|
877
|
+
[le.Fintech]: Zt,
|
|
878
|
+
[le.Healthcare]: Jt,
|
|
879
|
+
[le.Modern]: Xt,
|
|
880
|
+
[le.Minimal]: er
|
|
881
881
|
};
|
|
882
|
-
function
|
|
882
|
+
function Be(e) {
|
|
883
883
|
return tr[e] || ue;
|
|
884
884
|
}
|
|
885
885
|
class rr {
|
|
@@ -897,8 +897,8 @@ class rr {
|
|
|
897
897
|
"GetThemeConfiguration"
|
|
898
898
|
);
|
|
899
899
|
if (!n.result.isEnabled)
|
|
900
|
-
return
|
|
901
|
-
let a = n.result.preset ?
|
|
900
|
+
return Be(le.Default);
|
|
901
|
+
let a = n.result.preset ? Be(n.result.preset) : Be(le.Default);
|
|
902
902
|
if (n.result.title && (a.title = n.result.title), n.result.logo && (a.logo = { ...a.logo, ...n.result.logo }), n.result.colors && (a.colors = { ...a.colors, ...n.result.colors }), n.result.typography && (a.typography = { ...a.typography, ...n.result.typography }), n.result.spacing && (a.spacing = { ...a.spacing, ...n.result.spacing }), n.result.customCSS && (a.customCSS = n.result.customCSS), n.result.darkMode && (a.darkMode = {
|
|
903
903
|
colors: {
|
|
904
904
|
...(t = a.darkMode) == null ? void 0 : t.colors,
|
|
@@ -921,7 +921,7 @@ class rr {
|
|
|
921
921
|
}
|
|
922
922
|
return a;
|
|
923
923
|
} catch (n) {
|
|
924
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", n),
|
|
924
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", n), Be(le.Default);
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
927
|
/**
|
|
@@ -935,19 +935,19 @@ class rr {
|
|
|
935
935
|
*/
|
|
936
936
|
getAvailablePresets() {
|
|
937
937
|
return [
|
|
938
|
-
{ id:
|
|
939
|
-
{ id:
|
|
940
|
-
{ id:
|
|
941
|
-
{ id:
|
|
942
|
-
{ id:
|
|
943
|
-
{ id:
|
|
938
|
+
{ id: le.Default, name: "Default" },
|
|
939
|
+
{ id: le.Corporate, name: "Corporate" },
|
|
940
|
+
{ id: le.Fintech, name: "Fintech" },
|
|
941
|
+
{ id: le.Healthcare, name: "Healthcare" },
|
|
942
|
+
{ id: le.Modern, name: "Modern" },
|
|
943
|
+
{ id: le.Minimal, name: "Minimal" }
|
|
944
944
|
];
|
|
945
945
|
}
|
|
946
946
|
/**
|
|
947
947
|
* Preview theme (doesn't save)
|
|
948
948
|
*/
|
|
949
949
|
getPreviewTheme(t, n) {
|
|
950
|
-
const a =
|
|
950
|
+
const a = Be(t);
|
|
951
951
|
return n ? {
|
|
952
952
|
...a,
|
|
953
953
|
...n,
|
|
@@ -1041,7 +1041,7 @@ class ar {
|
|
|
1041
1041
|
*/
|
|
1042
1042
|
get status() {
|
|
1043
1043
|
var t;
|
|
1044
|
-
return ((t = this._progress) == null ? void 0 : t.status) ||
|
|
1044
|
+
return ((t = this._progress) == null ? void 0 : t.status) || ve.None;
|
|
1045
1045
|
}
|
|
1046
1046
|
/**
|
|
1047
1047
|
* Get workflow result
|
|
@@ -1060,19 +1060,19 @@ class ar {
|
|
|
1060
1060
|
* Check if workflow is complete
|
|
1061
1061
|
*/
|
|
1062
1062
|
get isComplete() {
|
|
1063
|
-
return this.status ===
|
|
1063
|
+
return this.status === ve.Finished;
|
|
1064
1064
|
}
|
|
1065
1065
|
/**
|
|
1066
1066
|
* Check if workflow is on hold
|
|
1067
1067
|
*/
|
|
1068
1068
|
get isOnHold() {
|
|
1069
|
-
return this.status ===
|
|
1069
|
+
return this.status === ve.OnHold;
|
|
1070
1070
|
}
|
|
1071
1071
|
/**
|
|
1072
1072
|
* Check if workflow is in progress
|
|
1073
1073
|
*/
|
|
1074
1074
|
get isInProgress() {
|
|
1075
|
-
return this.status ===
|
|
1075
|
+
return this.status === ve.InProgress;
|
|
1076
1076
|
}
|
|
1077
1077
|
/**
|
|
1078
1078
|
* Set applicant ID
|
|
@@ -1086,7 +1086,7 @@ class ar {
|
|
|
1086
1086
|
updateProgress(t) {
|
|
1087
1087
|
var a, i;
|
|
1088
1088
|
const n = (a = this._progress) == null ? void 0 : a.currentStep;
|
|
1089
|
-
this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (n == null ? void 0 : n.order) !== ((i = t.currentStep) == null ? void 0 : i.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status ===
|
|
1089
|
+
this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (n == null ? void 0 : n.order) !== ((i = t.currentStep) == null ? void 0 : i.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status === ve.Finished && t.workflowResult && this.events.emit("completed", t.workflowResult);
|
|
1090
1090
|
}
|
|
1091
1091
|
/**
|
|
1092
1092
|
* Set error
|
|
@@ -1610,17 +1610,17 @@ class cr {
|
|
|
1610
1610
|
this.sardineContext && (this.sardineContext = null);
|
|
1611
1611
|
}
|
|
1612
1612
|
}
|
|
1613
|
-
class
|
|
1613
|
+
class Oe {
|
|
1614
1614
|
/**
|
|
1615
1615
|
* Create a provider instance
|
|
1616
1616
|
*/
|
|
1617
1617
|
static createProvider(t, n) {
|
|
1618
1618
|
switch (t) {
|
|
1619
|
-
case
|
|
1619
|
+
case be.Sumsub:
|
|
1620
1620
|
return new or(n);
|
|
1621
|
-
case
|
|
1621
|
+
case be.Onfido:
|
|
1622
1622
|
return new lr(n);
|
|
1623
|
-
case
|
|
1623
|
+
case be.SardinAI:
|
|
1624
1624
|
return new cr(n);
|
|
1625
1625
|
default:
|
|
1626
1626
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
@@ -1632,7 +1632,7 @@ class Me {
|
|
|
1632
1632
|
static parseProviderConfig(t, n, a) {
|
|
1633
1633
|
var i;
|
|
1634
1634
|
switch (t) {
|
|
1635
|
-
case
|
|
1635
|
+
case be.Sumsub:
|
|
1636
1636
|
return {
|
|
1637
1637
|
accessToken: n.accessToken || n.token,
|
|
1638
1638
|
applicantEmail: n.email,
|
|
@@ -1640,11 +1640,11 @@ class Me {
|
|
|
1640
1640
|
externalUserId: n.externalUserId,
|
|
1641
1641
|
lang: n.lang || "en"
|
|
1642
1642
|
};
|
|
1643
|
-
case
|
|
1643
|
+
case be.Onfido:
|
|
1644
1644
|
return {
|
|
1645
1645
|
token: n.token || n.sdkToken
|
|
1646
1646
|
};
|
|
1647
|
-
case
|
|
1647
|
+
case be.SardinAI:
|
|
1648
1648
|
const o = ((i = a == null ? void 0 : a.identityProviders) == null ? void 0 : i.sardinai) || {};
|
|
1649
1649
|
return {
|
|
1650
1650
|
clientId: o.clientId || n.clientId,
|
|
@@ -1789,8 +1789,8 @@ class dr {
|
|
|
1789
1789
|
}
|
|
1790
1790
|
}
|
|
1791
1791
|
const mt = Nt(null), on = ({ config: e, children: t }) => {
|
|
1792
|
-
const [n, a] = v(null), i =
|
|
1793
|
-
const u = new _t(e), p = new Ht(u), b = new Ut(u), N = new jt(u), m = new qt(u), x = new Kt(u),
|
|
1792
|
+
const [n, a] = v(null), i = ye.useRef(!1), o = ye.useRef(!1), l = Ie(() => {
|
|
1793
|
+
const u = new _t(e), p = new Ht(u), b = new Ut(u), N = new jt(u), m = new qt(u), x = new Kt(u), g = new Wt(u), C = new Yt(u), D = new Qt(u), k = new Gt(u), z = new rr(u), A = new dr();
|
|
1794
1794
|
return {
|
|
1795
1795
|
httpClient: u,
|
|
1796
1796
|
applicantService: p,
|
|
@@ -1798,14 +1798,14 @@ const mt = Nt(null), on = ({ config: e, children: t }) => {
|
|
|
1798
1798
|
uploadDocumentService: N,
|
|
1799
1799
|
appropriatenessTestService: m,
|
|
1800
1800
|
overviewService: x,
|
|
1801
|
-
riskScoringService:
|
|
1801
|
+
riskScoringService: g,
|
|
1802
1802
|
identityService: C,
|
|
1803
1803
|
baseInformationService: D,
|
|
1804
1804
|
investorCategorizationService: k,
|
|
1805
1805
|
themeService: z,
|
|
1806
1806
|
themeManager: A
|
|
1807
1807
|
};
|
|
1808
|
-
}, [e]), d =
|
|
1808
|
+
}, [e]), d = Ie(() => ({
|
|
1809
1809
|
config: e,
|
|
1810
1810
|
...l,
|
|
1811
1811
|
currentTheme: n,
|
|
@@ -1843,7 +1843,7 @@ const mt = Nt(null), on = ({ config: e, children: t }) => {
|
|
|
1843
1843
|
l.themeManager.cleanup();
|
|
1844
1844
|
}), []), /* @__PURE__ */ r(mt.Provider, { value: d, children: t });
|
|
1845
1845
|
};
|
|
1846
|
-
function
|
|
1846
|
+
function fe() {
|
|
1847
1847
|
const e = St(mt);
|
|
1848
1848
|
if (!e)
|
|
1849
1849
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
@@ -1870,7 +1870,7 @@ function cn(e, t) {
|
|
|
1870
1870
|
return e.type === a;
|
|
1871
1871
|
});
|
|
1872
1872
|
}
|
|
1873
|
-
function
|
|
1873
|
+
function Qe(e) {
|
|
1874
1874
|
if (e === 0) return "0 Bytes";
|
|
1875
1875
|
const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
|
1876
1876
|
return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
|
|
@@ -1878,23 +1878,23 @@ function Ye(e) {
|
|
|
1878
1878
|
function dn(e) {
|
|
1879
1879
|
return e;
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1881
|
+
function se(...e) {
|
|
1882
1882
|
return e.filter(Boolean).join(" ");
|
|
1883
1883
|
}
|
|
1884
|
-
const
|
|
1884
|
+
const ze = {
|
|
1885
1885
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
1886
1886
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
1887
1887
|
};
|
|
1888
1888
|
function mr(e) {
|
|
1889
1889
|
try {
|
|
1890
|
-
localStorage.setItem(
|
|
1890
|
+
localStorage.setItem(ze.APPLICANT_ID, e.toString());
|
|
1891
1891
|
} catch (t) {
|
|
1892
1892
|
console.warn("Failed to save applicant ID to storage:", t);
|
|
1893
1893
|
}
|
|
1894
1894
|
}
|
|
1895
1895
|
function pr() {
|
|
1896
1896
|
try {
|
|
1897
|
-
const e = localStorage.getItem(
|
|
1897
|
+
const e = localStorage.getItem(ze.APPLICANT_ID);
|
|
1898
1898
|
return e ? parseInt(e, 10) : null;
|
|
1899
1899
|
} catch (e) {
|
|
1900
1900
|
return console.warn("Failed to retrieve applicant ID from storage:", e), null;
|
|
@@ -1902,21 +1902,21 @@ function pr() {
|
|
|
1902
1902
|
}
|
|
1903
1903
|
function hr() {
|
|
1904
1904
|
try {
|
|
1905
|
-
localStorage.removeItem(
|
|
1905
|
+
localStorage.removeItem(ze.APPLICANT_ID);
|
|
1906
1906
|
} catch (e) {
|
|
1907
1907
|
console.warn("Failed to clear applicant ID from storage:", e);
|
|
1908
1908
|
}
|
|
1909
1909
|
}
|
|
1910
1910
|
function gr(e) {
|
|
1911
1911
|
try {
|
|
1912
|
-
localStorage.setItem(
|
|
1912
|
+
localStorage.setItem(ze.WORKFLOW_STATE, JSON.stringify(e));
|
|
1913
1913
|
} catch (t) {
|
|
1914
1914
|
console.warn("Failed to save workflow state to storage:", t);
|
|
1915
1915
|
}
|
|
1916
1916
|
}
|
|
1917
1917
|
function un() {
|
|
1918
1918
|
try {
|
|
1919
|
-
const e = localStorage.getItem(
|
|
1919
|
+
const e = localStorage.getItem(ze.WORKFLOW_STATE);
|
|
1920
1920
|
return e ? JSON.parse(e) : null;
|
|
1921
1921
|
} catch (e) {
|
|
1922
1922
|
return console.warn("Failed to retrieve workflow state from storage:", e), null;
|
|
@@ -1924,7 +1924,7 @@ function un() {
|
|
|
1924
1924
|
}
|
|
1925
1925
|
function yr() {
|
|
1926
1926
|
try {
|
|
1927
|
-
localStorage.removeItem(
|
|
1927
|
+
localStorage.removeItem(ze.WORKFLOW_STATE);
|
|
1928
1928
|
} catch (e) {
|
|
1929
1929
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
1930
1930
|
}
|
|
@@ -1933,7 +1933,7 @@ function mn() {
|
|
|
1933
1933
|
hr(), yr();
|
|
1934
1934
|
}
|
|
1935
1935
|
function fr(e) {
|
|
1936
|
-
const { createOrchestrator: t } =
|
|
1936
|
+
const { createOrchestrator: t } = fe(), [n, a] = v(null), [i, o] = v(!1), [l, d] = v(null), u = ee(null), p = e || pr();
|
|
1937
1937
|
ae(() => {
|
|
1938
1938
|
u.current || (u.current = t());
|
|
1939
1939
|
}, [t]), ae(() => {
|
|
@@ -1983,7 +1983,7 @@ function fr(e) {
|
|
|
1983
1983
|
o(!1), b.current = !1;
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
|
-
}, []),
|
|
1986
|
+
}, []), g = Q(async () => {
|
|
1987
1987
|
if (u.current) {
|
|
1988
1988
|
o(!0), d(null);
|
|
1989
1989
|
try {
|
|
@@ -2026,24 +2026,24 @@ function fr(e) {
|
|
|
2026
2026
|
applicantId: p,
|
|
2027
2027
|
currentStep: (n == null ? void 0 : n.currentStep) || null,
|
|
2028
2028
|
steps: k,
|
|
2029
|
-
status: (n == null ? void 0 : n.status) ||
|
|
2029
|
+
status: (n == null ? void 0 : n.status) || ve.None,
|
|
2030
2030
|
workflowResult: (n == null ? void 0 : n.workflowResult) || null,
|
|
2031
2031
|
workflowKey: n == null ? void 0 : n.workFlowKey,
|
|
2032
2032
|
nextWorkflowKey: n == null ? void 0 : n.nextWorkflowKey,
|
|
2033
2033
|
hasWorkflowChanged: z,
|
|
2034
2034
|
isLoading: i,
|
|
2035
2035
|
error: l,
|
|
2036
|
-
isComplete: (n == null ? void 0 : n.status) ===
|
|
2037
|
-
isOnHold: (n == null ? void 0 : n.status) ===
|
|
2036
|
+
isComplete: (n == null ? void 0 : n.status) === ve.Finished,
|
|
2037
|
+
isOnHold: (n == null ? void 0 : n.status) === ve.OnHold,
|
|
2038
2038
|
refreshProgress: x,
|
|
2039
|
-
moveToNext:
|
|
2039
|
+
moveToNext: g,
|
|
2040
2040
|
moveBack: C,
|
|
2041
2041
|
submitCurrentStep: D,
|
|
2042
2042
|
orchestrator: u.current
|
|
2043
2043
|
};
|
|
2044
2044
|
}
|
|
2045
2045
|
function xr(e) {
|
|
2046
|
-
const { questionnaireService: t, applicantService: n } =
|
|
2046
|
+
const { questionnaireService: t, applicantService: n } = fe(), [a, i] = v(null), [o, l] = v({}), [d, u] = v(!1), [p, b] = v(!1), [N, m] = v(null), x = ee(!1), g = ee(null), C = Q(async () => {
|
|
2047
2047
|
var k, z;
|
|
2048
2048
|
if (e) {
|
|
2049
2049
|
if (x.current) {
|
|
@@ -2067,7 +2067,7 @@ function xr(e) {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
l(G);
|
|
2069
2069
|
}
|
|
2070
|
-
|
|
2070
|
+
g.current = e;
|
|
2071
2071
|
} catch (A) {
|
|
2072
2072
|
m(A);
|
|
2073
2073
|
} finally {
|
|
@@ -2076,7 +2076,7 @@ function xr(e) {
|
|
|
2076
2076
|
}
|
|
2077
2077
|
}, [e, t, n]);
|
|
2078
2078
|
ae(() => {
|
|
2079
|
-
e &&
|
|
2079
|
+
e && g.current !== e && C();
|
|
2080
2080
|
}, [e]);
|
|
2081
2081
|
const D = Q(
|
|
2082
2082
|
async (k) => {
|
|
@@ -2102,7 +2102,7 @@ function xr(e) {
|
|
|
2102
2102
|
};
|
|
2103
2103
|
}
|
|
2104
2104
|
function br(e) {
|
|
2105
|
-
const { uploadDocumentService: t } =
|
|
2105
|
+
const { uploadDocumentService: t } = fe(), [n, a] = v(null), [i, o] = v(!1), [l, d] = v(!1), [u, p] = v(0), [b, N] = v(null), m = ee(!1), x = ee(null), g = Q(async () => {
|
|
2106
2106
|
if (e) {
|
|
2107
2107
|
if (m.current) {
|
|
2108
2108
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
@@ -2120,7 +2120,7 @@ function br(e) {
|
|
|
2120
2120
|
}
|
|
2121
2121
|
}, [e, t]);
|
|
2122
2122
|
ae(() => {
|
|
2123
|
-
e && x.current !== e &&
|
|
2123
|
+
e && x.current !== e && g();
|
|
2124
2124
|
}, [e]);
|
|
2125
2125
|
const C = Q(
|
|
2126
2126
|
async (D) => {
|
|
@@ -2141,12 +2141,12 @@ function br(e) {
|
|
|
2141
2141
|
isSubmitting: l,
|
|
2142
2142
|
uploadProgress: u,
|
|
2143
2143
|
error: b,
|
|
2144
|
-
load:
|
|
2144
|
+
load: g,
|
|
2145
2145
|
submit: C
|
|
2146
2146
|
};
|
|
2147
2147
|
}
|
|
2148
2148
|
function pn(e) {
|
|
2149
|
-
const { appropriatenessTestService: t } =
|
|
2149
|
+
const { appropriatenessTestService: t } = fe(), [n, a] = v(null), [i, o] = v(!1), [l, d] = v(!1), [u, p] = v(null), [b, N] = v(null), m = ee(!1), x = ee(null), g = Q(async () => {
|
|
2150
2150
|
if (e) {
|
|
2151
2151
|
if (m.current) {
|
|
2152
2152
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
@@ -2164,7 +2164,7 @@ function pn(e) {
|
|
|
2164
2164
|
}
|
|
2165
2165
|
}, [e, t]);
|
|
2166
2166
|
ae(() => {
|
|
2167
|
-
e && x.current !== e &&
|
|
2167
|
+
e && x.current !== e && g();
|
|
2168
2168
|
}, [e]);
|
|
2169
2169
|
const C = Q(
|
|
2170
2170
|
async (D) => {
|
|
@@ -2186,12 +2186,12 @@ function pn(e) {
|
|
|
2186
2186
|
isLoading: i,
|
|
2187
2187
|
isSubmitting: l,
|
|
2188
2188
|
error: u,
|
|
2189
|
-
load:
|
|
2189
|
+
load: g,
|
|
2190
2190
|
submit: C
|
|
2191
2191
|
};
|
|
2192
2192
|
}
|
|
2193
2193
|
function vr(e) {
|
|
2194
|
-
const { overviewService: t } =
|
|
2194
|
+
const { overviewService: t } = fe(), [n, a] = v(null), [i, o] = v(!1), [l, d] = v(!1), [u, p] = v(null), b = ee(!1), N = ee(null), m = Q(async () => {
|
|
2195
2195
|
if (e) {
|
|
2196
2196
|
if (b.current) {
|
|
2197
2197
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -2199,10 +2199,10 @@ function vr(e) {
|
|
|
2199
2199
|
}
|
|
2200
2200
|
b.current = !0, o(!0), p(null);
|
|
2201
2201
|
try {
|
|
2202
|
-
const
|
|
2203
|
-
a(
|
|
2204
|
-
} catch (
|
|
2205
|
-
p(
|
|
2202
|
+
const g = await t.getOverviewData(e);
|
|
2203
|
+
a(g), N.current = e;
|
|
2204
|
+
} catch (g) {
|
|
2205
|
+
p(g);
|
|
2206
2206
|
} finally {
|
|
2207
2207
|
o(!1), b.current = !1;
|
|
2208
2208
|
}
|
|
@@ -2216,8 +2216,8 @@ function vr(e) {
|
|
|
2216
2216
|
d(!0), p(null);
|
|
2217
2217
|
try {
|
|
2218
2218
|
await t.passOverview(e);
|
|
2219
|
-
} catch (
|
|
2220
|
-
throw p(
|
|
2219
|
+
} catch (g) {
|
|
2220
|
+
throw p(g), g;
|
|
2221
2221
|
} finally {
|
|
2222
2222
|
d(!1);
|
|
2223
2223
|
}
|
|
@@ -2233,7 +2233,7 @@ function vr(e) {
|
|
|
2233
2233
|
};
|
|
2234
2234
|
}
|
|
2235
2235
|
function kr(e) {
|
|
2236
|
-
const { identityService: t } =
|
|
2236
|
+
const { identityService: t } = fe(), [n, a] = v(
|
|
2237
2237
|
null
|
|
2238
2238
|
), [i, o] = v(!1), [l, d] = v(null), u = ee(!1), p = Q(
|
|
2239
2239
|
async (m, x) => {
|
|
@@ -2244,18 +2244,18 @@ function kr(e) {
|
|
|
2244
2244
|
}
|
|
2245
2245
|
u.current = !0, o(!0), d(null);
|
|
2246
2246
|
try {
|
|
2247
|
-
const
|
|
2247
|
+
const g = {
|
|
2248
2248
|
applicantId: e,
|
|
2249
2249
|
restart: !1,
|
|
2250
2250
|
redirectUrl: m || "",
|
|
2251
2251
|
ttl: x || 604800
|
|
2252
2252
|
// Default: 7 days
|
|
2253
2253
|
};
|
|
2254
|
-
console.log("Identity request input:",
|
|
2255
|
-
const C = await t.identityRequest(
|
|
2254
|
+
console.log("Identity request input:", g);
|
|
2255
|
+
const C = await t.identityRequest(g);
|
|
2256
2256
|
return console.log("Identity request result:", C), a(C), C;
|
|
2257
|
-
} catch (
|
|
2258
|
-
throw d(
|
|
2257
|
+
} catch (g) {
|
|
2258
|
+
throw d(g), g;
|
|
2259
2259
|
} finally {
|
|
2260
2260
|
o(!1), u.current = !1;
|
|
2261
2261
|
}
|
|
@@ -2267,15 +2267,15 @@ function kr(e) {
|
|
|
2267
2267
|
if (e) {
|
|
2268
2268
|
o(!0), d(null);
|
|
2269
2269
|
try {
|
|
2270
|
-
const
|
|
2270
|
+
const g = {
|
|
2271
2271
|
applicantId: e,
|
|
2272
2272
|
restart: !1,
|
|
2273
2273
|
redirectUrl: m,
|
|
2274
2274
|
ttl: x
|
|
2275
|
-
}, C = await t.identityCompanyRequest(
|
|
2275
|
+
}, C = await t.identityCompanyRequest(g);
|
|
2276
2276
|
return a(C), C;
|
|
2277
|
-
} catch (
|
|
2278
|
-
throw d(
|
|
2277
|
+
} catch (g) {
|
|
2278
|
+
throw d(g), g;
|
|
2279
2279
|
} finally {
|
|
2280
2280
|
o(!1);
|
|
2281
2281
|
}
|
|
@@ -2319,7 +2319,7 @@ function kr(e) {
|
|
|
2319
2319
|
};
|
|
2320
2320
|
}
|
|
2321
2321
|
function wr(e) {
|
|
2322
|
-
const { riskScoringService: t, applicantService: n } =
|
|
2322
|
+
const { riskScoringService: t, applicantService: n } = fe(), [a, i] = v(null), [o, l] = v({}), [d, u] = v(!1), [p, b] = v(!1), [N, m] = v(null), [x, g] = v(null), C = ee(!1), D = ee(null), k = Q(async () => {
|
|
2323
2323
|
var A;
|
|
2324
2324
|
if (e) {
|
|
2325
2325
|
if (C.current) {
|
|
@@ -2359,7 +2359,7 @@ function wr(e) {
|
|
|
2359
2359
|
b(!0), m(null);
|
|
2360
2360
|
try {
|
|
2361
2361
|
const I = await t.submitRiskScoring(A);
|
|
2362
|
-
return
|
|
2362
|
+
return g(I), I;
|
|
2363
2363
|
} catch (I) {
|
|
2364
2364
|
throw m(I), I;
|
|
2365
2365
|
} finally {
|
|
@@ -2380,17 +2380,17 @@ function wr(e) {
|
|
|
2380
2380
|
};
|
|
2381
2381
|
}
|
|
2382
2382
|
function Nr() {
|
|
2383
|
-
const { applicantService: e, config: t } =
|
|
2384
|
-
const
|
|
2385
|
-
return (x === "x" ?
|
|
2383
|
+
const { applicantService: e, config: t } = fe(), [n, a] = v(!1), [i, o] = v(null), l = ee(!1), d = ee(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(x) {
|
|
2384
|
+
const g = Math.random() * 16 | 0;
|
|
2385
|
+
return (x === "x" ? g : g & 3 | 8).toString(16);
|
|
2386
2386
|
}), p = Q(
|
|
2387
2387
|
async (x) => {
|
|
2388
|
-
var
|
|
2388
|
+
var g;
|
|
2389
2389
|
if (l.current)
|
|
2390
2390
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
2391
2391
|
l.current = !0, a(!0), o(null);
|
|
2392
2392
|
try {
|
|
2393
|
-
if (x.applicantAdditionalDatas || (x.applicantAdditionalDatas = []), (
|
|
2393
|
+
if (x.applicantAdditionalDatas || (x.applicantAdditionalDatas = []), (g = t.identityProviders) != null && g.sardinai) {
|
|
2394
2394
|
const D = u();
|
|
2395
2395
|
console.log("[SardinAI] Generated session key:", D), x.applicantAdditionalDatas.push({
|
|
2396
2396
|
paramName: "sessionKey",
|
|
@@ -2410,8 +2410,8 @@ function Nr() {
|
|
|
2410
2410
|
a(!0), o(null);
|
|
2411
2411
|
try {
|
|
2412
2412
|
return await e.createCompanyApplicant(x);
|
|
2413
|
-
} catch (
|
|
2414
|
-
throw o(
|
|
2413
|
+
} catch (g) {
|
|
2414
|
+
throw o(g), g;
|
|
2415
2415
|
} finally {
|
|
2416
2416
|
a(!1);
|
|
2417
2417
|
}
|
|
@@ -2424,8 +2424,8 @@ function Nr() {
|
|
|
2424
2424
|
d.current = !0, a(!0), o(null);
|
|
2425
2425
|
try {
|
|
2426
2426
|
return await e.getApplicantData(x);
|
|
2427
|
-
} catch (
|
|
2428
|
-
throw o(
|
|
2427
|
+
} catch (g) {
|
|
2428
|
+
throw o(g), g;
|
|
2429
2429
|
} finally {
|
|
2430
2430
|
a(!1), d.current = !1;
|
|
2431
2431
|
}
|
|
@@ -2436,8 +2436,8 @@ function Nr() {
|
|
|
2436
2436
|
a(!0), o(null);
|
|
2437
2437
|
try {
|
|
2438
2438
|
await e.stopProgress(x);
|
|
2439
|
-
} catch (
|
|
2440
|
-
throw o(
|
|
2439
|
+
} catch (g) {
|
|
2440
|
+
throw o(g), g;
|
|
2441
2441
|
} finally {
|
|
2442
2442
|
a(!1);
|
|
2443
2443
|
}
|
|
@@ -2476,7 +2476,7 @@ const Z = ({
|
|
|
2476
2476
|
return /* @__PURE__ */ s(
|
|
2477
2477
|
"button",
|
|
2478
2478
|
{
|
|
2479
|
-
className:
|
|
2479
|
+
className: se(d, u[t], p[n], o),
|
|
2480
2480
|
disabled: i || a,
|
|
2481
2481
|
...l,
|
|
2482
2482
|
children: [
|
|
@@ -2514,7 +2514,7 @@ const Z = ({
|
|
|
2514
2514
|
]
|
|
2515
2515
|
}
|
|
2516
2516
|
);
|
|
2517
|
-
}, me =
|
|
2517
|
+
}, me = je(
|
|
2518
2518
|
({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, style: l, ...d }, u) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
2519
2519
|
e && /* @__PURE__ */ s(
|
|
2520
2520
|
"label",
|
|
@@ -2533,7 +2533,7 @@ const Z = ({
|
|
|
2533
2533
|
"input",
|
|
2534
2534
|
{
|
|
2535
2535
|
ref: u,
|
|
2536
|
-
className:
|
|
2536
|
+
className: se(
|
|
2537
2537
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2538
2538
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
2539
2539
|
"disabled:opacity-60 disabled:cursor-not-allowed",
|
|
@@ -2560,7 +2560,7 @@ me.displayName = "Input";
|
|
|
2560
2560
|
const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2561
2561
|
"div",
|
|
2562
2562
|
{
|
|
2563
|
-
className:
|
|
2563
|
+
className: se(
|
|
2564
2564
|
"metakyc-card rounded-xl shadow-sm border",
|
|
2565
2565
|
t
|
|
2566
2566
|
),
|
|
@@ -2571,30 +2571,30 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2571
2571
|
...n,
|
|
2572
2572
|
children: e
|
|
2573
2573
|
}
|
|
2574
|
-
),
|
|
2574
|
+
), ce = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2575
2575
|
"div",
|
|
2576
2576
|
{
|
|
2577
|
-
className:
|
|
2577
|
+
className: se("px-6 py-4 border-b", t),
|
|
2578
2578
|
style: {
|
|
2579
2579
|
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2580
2580
|
},
|
|
2581
2581
|
...n,
|
|
2582
2582
|
children: e
|
|
2583
2583
|
}
|
|
2584
|
-
), W = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className:
|
|
2584
|
+
), W = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: se("px-6 py-4", t), ...n, children: e }), pe = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2585
2585
|
"div",
|
|
2586
2586
|
{
|
|
2587
|
-
className:
|
|
2587
|
+
className: se("px-6 py-4 border-t", t),
|
|
2588
2588
|
style: {
|
|
2589
2589
|
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2590
2590
|
},
|
|
2591
2591
|
...n,
|
|
2592
2592
|
children: e
|
|
2593
2593
|
}
|
|
2594
|
-
),
|
|
2594
|
+
), Ee = ({ children: e, variant: t = "default", className: n, ...a }) => /* @__PURE__ */ r(
|
|
2595
2595
|
"span",
|
|
2596
2596
|
{
|
|
2597
|
-
className:
|
|
2597
|
+
className: se(
|
|
2598
2598
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2599
2599
|
{
|
|
2600
2600
|
default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
|
|
@@ -2608,16 +2608,16 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2608
2608
|
...a,
|
|
2609
2609
|
children: e
|
|
2610
2610
|
}
|
|
2611
|
-
),
|
|
2611
|
+
), ke = ({ size: e = "md", className: t, ...n }) => {
|
|
2612
2612
|
const a = {
|
|
2613
2613
|
sm: "h-4 w-4",
|
|
2614
2614
|
md: "h-8 w-8",
|
|
2615
2615
|
lg: "h-12 w-12"
|
|
2616
2616
|
};
|
|
2617
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2617
|
+
return /* @__PURE__ */ r("div", { className: se("flex items-center justify-center", t), ...n, children: /* @__PURE__ */ s(
|
|
2618
2618
|
"svg",
|
|
2619
2619
|
{
|
|
2620
|
-
className:
|
|
2620
|
+
className: se("animate-spin text-primary-500", a[e]),
|
|
2621
2621
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2622
2622
|
fill: "none",
|
|
2623
2623
|
viewBox: "0 0 24 24",
|
|
@@ -2644,7 +2644,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2644
2644
|
]
|
|
2645
2645
|
}
|
|
2646
2646
|
) });
|
|
2647
|
-
},
|
|
2647
|
+
}, Ue = je(
|
|
2648
2648
|
({ label: e, error: t, helperText: n, options: a, placeholder: i, className: o, style: l, ...d }, u) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
2649
2649
|
e && /* @__PURE__ */ s(
|
|
2650
2650
|
"label",
|
|
@@ -2661,7 +2661,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2661
2661
|
"select",
|
|
2662
2662
|
{
|
|
2663
2663
|
ref: u,
|
|
2664
|
-
className:
|
|
2664
|
+
className: se(
|
|
2665
2665
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2666
2666
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
2667
2667
|
"disabled:opacity-60 disabled:cursor-not-allowed",
|
|
@@ -2710,7 +2710,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2710
2710
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
2711
2711
|
] })
|
|
2712
2712
|
);
|
|
2713
|
-
|
|
2713
|
+
Ue.displayName = "Select";
|
|
2714
2714
|
const it = 280, Sr = ({
|
|
2715
2715
|
label: e,
|
|
2716
2716
|
value: t,
|
|
@@ -2720,9 +2720,9 @@ const it = 280, Sr = ({
|
|
|
2720
2720
|
disabled: o = !1,
|
|
2721
2721
|
required: l = !1
|
|
2722
2722
|
}) => {
|
|
2723
|
-
const [d, u] = v(!1), [p, b] = v(""), [N, m] = v(null), x = ee(null),
|
|
2724
|
-
if (!
|
|
2725
|
-
const w =
|
|
2723
|
+
const [d, u] = v(!1), [p, b] = v(""), [N, m] = v(null), x = ee(null), g = ee(null), C = ee(null), D = Q(() => {
|
|
2724
|
+
if (!g.current) return null;
|
|
2725
|
+
const w = g.current.getBoundingClientRect(), re = window.innerHeight - w.bottom < it && w.top > it;
|
|
2726
2726
|
return { top: re ? w.top : w.bottom + 4, left: w.left, width: w.width, openUp: re };
|
|
2727
2727
|
}, []), k = Q(() => {
|
|
2728
2728
|
if (o) return;
|
|
@@ -2758,7 +2758,7 @@ const it = 280, Sr = ({
|
|
|
2758
2758
|
}, G = (w) => {
|
|
2759
2759
|
var q;
|
|
2760
2760
|
return ((q = a.find((re) => re.value === w)) == null ? void 0 : q.label) || w;
|
|
2761
|
-
}, E =
|
|
2761
|
+
}, E = g.current ? getComputedStyle(g.current) : null, f = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", R = (E == null ? void 0 : E.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", P = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", O = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", H = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", M = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", T = (E == null ? void 0 : E.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", J = d && N && /* @__PURE__ */ s(
|
|
2762
2762
|
"div",
|
|
2763
2763
|
{
|
|
2764
2764
|
ref: C,
|
|
@@ -2874,9 +2874,9 @@ const it = 280, Sr = ({
|
|
|
2874
2874
|
/* @__PURE__ */ s(
|
|
2875
2875
|
"div",
|
|
2876
2876
|
{
|
|
2877
|
-
ref:
|
|
2877
|
+
ref: g,
|
|
2878
2878
|
onClick: () => d ? z() : k(),
|
|
2879
|
-
className:
|
|
2879
|
+
className: se(
|
|
2880
2880
|
"metakyc-multiselect-trigger",
|
|
2881
2881
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
|
|
2882
2882
|
o ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
@@ -2948,9 +2948,9 @@ const it = 280, Sr = ({
|
|
|
2948
2948
|
]
|
|
2949
2949
|
}
|
|
2950
2950
|
),
|
|
2951
|
-
typeof document < "u" && J ?
|
|
2951
|
+
typeof document < "u" && J ? Ze(J, document.body) : null
|
|
2952
2952
|
] });
|
|
2953
|
-
}, st = 260,
|
|
2953
|
+
}, st = 260, Ye = ({
|
|
2954
2954
|
label: e,
|
|
2955
2955
|
error: t,
|
|
2956
2956
|
helperText: n,
|
|
@@ -2963,7 +2963,7 @@ const it = 280, Sr = ({
|
|
|
2963
2963
|
className: p
|
|
2964
2964
|
}) => {
|
|
2965
2965
|
var F;
|
|
2966
|
-
const [b, N] = v(!1), [m, x] = v(""), [
|
|
2966
|
+
const [b, N] = v(!1), [m, x] = v(""), [g, C] = v(null), D = ee(null), k = ee(null), z = ee(null), A = ee(null), I = Q(() => {
|
|
2967
2967
|
if (!k.current) return null;
|
|
2968
2968
|
const S = k.current.getBoundingClientRect(), X = window.innerHeight - S.bottom < st && S.top > st;
|
|
2969
2969
|
return {
|
|
@@ -2982,9 +2982,9 @@ const it = 280, Sr = ({
|
|
|
2982
2982
|
ae(() => {
|
|
2983
2983
|
if (!b) return;
|
|
2984
2984
|
const S = (U) => {
|
|
2985
|
-
var Y,
|
|
2985
|
+
var Y, Ne;
|
|
2986
2986
|
const X = U.target;
|
|
2987
|
-
!((Y = D.current) != null && Y.contains(X)) && !((
|
|
2987
|
+
!((Y = D.current) != null && Y.contains(X)) && !((Ne = z.current) != null && Ne.contains(X)) && G();
|
|
2988
2988
|
};
|
|
2989
2989
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
2990
2990
|
}, [b, G]), ae(() => {
|
|
@@ -3006,17 +3006,17 @@ const it = 280, Sr = ({
|
|
|
3006
3006
|
(S) => S.label.toLowerCase().includes(m.toLowerCase()) || S.value.toLowerCase().includes(m.toLowerCase())
|
|
3007
3007
|
), R = (F = a.find((S) => S.value === o)) == null ? void 0 : F.label, P = (S, U) => {
|
|
3008
3008
|
d || U || (l(S), G());
|
|
3009
|
-
}, O = k.current ? getComputedStyle(k.current) : null, H = (O == null ? void 0 : O.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", M = (O == null ? void 0 : O.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", T = (O == null ? void 0 : O.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", J = (O == null ? void 0 : O.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", w = (O == null ? void 0 : O.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", q = (O == null ? void 0 : O.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", re = (O == null ? void 0 : O.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", _ = b &&
|
|
3009
|
+
}, O = k.current ? getComputedStyle(k.current) : null, H = (O == null ? void 0 : O.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", M = (O == null ? void 0 : O.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", T = (O == null ? void 0 : O.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", J = (O == null ? void 0 : O.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", w = (O == null ? void 0 : O.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", q = (O == null ? void 0 : O.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", re = (O == null ? void 0 : O.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", _ = b && g && /* @__PURE__ */ s(
|
|
3010
3010
|
"div",
|
|
3011
3011
|
{
|
|
3012
3012
|
ref: z,
|
|
3013
3013
|
className: "metakyc-searchable-select-dropdown",
|
|
3014
3014
|
style: {
|
|
3015
3015
|
position: "fixed",
|
|
3016
|
-
top:
|
|
3017
|
-
bottom:
|
|
3018
|
-
left:
|
|
3019
|
-
width:
|
|
3016
|
+
top: g.openUp ? void 0 : g.top,
|
|
3017
|
+
bottom: g.openUp ? window.innerHeight - g.top + 4 : void 0,
|
|
3018
|
+
left: g.left,
|
|
3019
|
+
width: g.width,
|
|
3020
3020
|
zIndex: 99999,
|
|
3021
3021
|
borderRadius: "8px",
|
|
3022
3022
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
@@ -3094,7 +3094,7 @@ const it = 280, Sr = ({
|
|
|
3094
3094
|
return /* @__PURE__ */ s(
|
|
3095
3095
|
"div",
|
|
3096
3096
|
{
|
|
3097
|
-
className:
|
|
3097
|
+
className: se("w-full metakyc-searchable-select", p),
|
|
3098
3098
|
ref: D,
|
|
3099
3099
|
children: [
|
|
3100
3100
|
e && /* @__PURE__ */ s(
|
|
@@ -3118,7 +3118,7 @@ const it = 280, Sr = ({
|
|
|
3118
3118
|
onKeyDown: (S) => {
|
|
3119
3119
|
(S.key === "Enter" || S.key === " ") && (S.preventDefault(), E()), S.key === "Escape" && G();
|
|
3120
3120
|
},
|
|
3121
|
-
className:
|
|
3121
|
+
className: se(
|
|
3122
3122
|
"metakyc-searchable-select-trigger",
|
|
3123
3123
|
"w-full px-3 py-2 rounded-lg border text-sm transition-colors text-left",
|
|
3124
3124
|
"flex items-center justify-between gap-2",
|
|
@@ -3146,14 +3146,14 @@ const it = 280, Sr = ({
|
|
|
3146
3146
|
]
|
|
3147
3147
|
}
|
|
3148
3148
|
),
|
|
3149
|
-
typeof document < "u" && _ ?
|
|
3149
|
+
typeof document < "u" && _ ? Ze(_, document.body) : null,
|
|
3150
3150
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
3151
3151
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3152
3152
|
]
|
|
3153
3153
|
}
|
|
3154
3154
|
);
|
|
3155
3155
|
};
|
|
3156
|
-
|
|
3156
|
+
Ye.displayName = "SearchableSelect";
|
|
3157
3157
|
const Cr = ({
|
|
3158
3158
|
label: e,
|
|
3159
3159
|
error: t,
|
|
@@ -3168,7 +3168,7 @@ const Cr = ({
|
|
|
3168
3168
|
if (!k) return;
|
|
3169
3169
|
const z = Array.from(k);
|
|
3170
3170
|
if (i && z.filter((I) => I.size > i).length > 0) {
|
|
3171
|
-
const I =
|
|
3171
|
+
const I = Qe(i);
|
|
3172
3172
|
alert(`Some files exceed the maximum size of ${I}`);
|
|
3173
3173
|
return;
|
|
3174
3174
|
}
|
|
@@ -3177,7 +3177,7 @@ const Cr = ({
|
|
|
3177
3177
|
k.preventDefault(), p(!0);
|
|
3178
3178
|
}, x = () => {
|
|
3179
3179
|
p(!1);
|
|
3180
|
-
},
|
|
3180
|
+
}, g = (k) => {
|
|
3181
3181
|
k.preventDefault(), p(!1), N(k.dataTransfer.files);
|
|
3182
3182
|
}, C = () => {
|
|
3183
3183
|
var k;
|
|
@@ -3186,19 +3186,19 @@ const Cr = ({
|
|
|
3186
3186
|
const z = l.filter((A, I) => I !== k);
|
|
3187
3187
|
o == null || o(z);
|
|
3188
3188
|
};
|
|
3189
|
-
return /* @__PURE__ */ s("div", { className:
|
|
3189
|
+
return /* @__PURE__ */ s("div", { className: se("w-full", d), children: [
|
|
3190
3190
|
e && /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: e }),
|
|
3191
3191
|
/* @__PURE__ */ s(
|
|
3192
3192
|
"div",
|
|
3193
3193
|
{
|
|
3194
|
-
className:
|
|
3194
|
+
className: se(
|
|
3195
3195
|
"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
|
|
3196
3196
|
u ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
3197
3197
|
t && "border-danger-500"
|
|
3198
3198
|
),
|
|
3199
3199
|
onDragOver: m,
|
|
3200
3200
|
onDragLeave: x,
|
|
3201
|
-
onDrop:
|
|
3201
|
+
onDrop: g,
|
|
3202
3202
|
onClick: C,
|
|
3203
3203
|
children: [
|
|
3204
3204
|
/* @__PURE__ */ r(
|
|
@@ -3237,7 +3237,7 @@ const Cr = ({
|
|
|
3237
3237
|
] }),
|
|
3238
3238
|
i && /* @__PURE__ */ s("p", { className: "text-xs text-gray-500", children: [
|
|
3239
3239
|
"Maximum file size: ",
|
|
3240
|
-
|
|
3240
|
+
Qe(i)
|
|
3241
3241
|
] })
|
|
3242
3242
|
] })
|
|
3243
3243
|
]
|
|
@@ -3268,7 +3268,7 @@ const Cr = ({
|
|
|
3268
3268
|
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: k.name }),
|
|
3269
3269
|
/* @__PURE__ */ s("span", { className: "text-xs text-gray-500", children: [
|
|
3270
3270
|
"(",
|
|
3271
|
-
|
|
3271
|
+
Qe(k.size),
|
|
3272
3272
|
")"
|
|
3273
3273
|
] })
|
|
3274
3274
|
] }),
|
|
@@ -3296,7 +3296,7 @@ const Cr = ({
|
|
|
3296
3296
|
)) }),
|
|
3297
3297
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: t })
|
|
3298
3298
|
] });
|
|
3299
|
-
}, Ar =
|
|
3299
|
+
}, Ar = je(
|
|
3300
3300
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
3301
3301
|
a.label && /* @__PURE__ */ s(
|
|
3302
3302
|
"label",
|
|
@@ -3316,7 +3316,7 @@ const Cr = ({
|
|
|
3316
3316
|
type: "text",
|
|
3317
3317
|
value: e,
|
|
3318
3318
|
onChange: (o) => t == null ? void 0 : t(o.target.value),
|
|
3319
|
-
className:
|
|
3319
|
+
className: se(
|
|
3320
3320
|
"w-20 rounded-lg border px-3 py-2 text-sm",
|
|
3321
3321
|
"focus:outline-none focus:ring-2 focus:ring-offset-0"
|
|
3322
3322
|
),
|
|
@@ -3333,7 +3333,7 @@ const Cr = ({
|
|
|
3333
3333
|
{
|
|
3334
3334
|
ref: i,
|
|
3335
3335
|
type: "tel",
|
|
3336
|
-
className:
|
|
3336
|
+
className: se("flex-1", n),
|
|
3337
3337
|
...a,
|
|
3338
3338
|
label: ""
|
|
3339
3339
|
}
|
|
@@ -3412,7 +3412,7 @@ const Pr = (e) => {
|
|
|
3412
3412
|
* This source code is licensed under the ISC license.
|
|
3413
3413
|
* See the LICENSE file in the root directory of this source tree.
|
|
3414
3414
|
*/
|
|
3415
|
-
const Dr =
|
|
3415
|
+
const Dr = je(
|
|
3416
3416
|
({
|
|
3417
3417
|
color: e = "currentColor",
|
|
3418
3418
|
size: t = 24,
|
|
@@ -3422,7 +3422,7 @@ const Dr = Ue(
|
|
|
3422
3422
|
children: o,
|
|
3423
3423
|
iconNode: l,
|
|
3424
3424
|
...d
|
|
3425
|
-
}, u) =>
|
|
3425
|
+
}, u) => Ge(
|
|
3426
3426
|
"svg",
|
|
3427
3427
|
{
|
|
3428
3428
|
ref: u,
|
|
@@ -3436,7 +3436,7 @@ const Dr = Ue(
|
|
|
3436
3436
|
...d
|
|
3437
3437
|
},
|
|
3438
3438
|
[
|
|
3439
|
-
...l.map(([p, b]) =>
|
|
3439
|
+
...l.map(([p, b]) => Ge(p, b)),
|
|
3440
3440
|
...Array.isArray(o) ? o : [o]
|
|
3441
3441
|
]
|
|
3442
3442
|
)
|
|
@@ -3448,8 +3448,8 @@ const Dr = Ue(
|
|
|
3448
3448
|
* See the LICENSE file in the root directory of this source tree.
|
|
3449
3449
|
*/
|
|
3450
3450
|
const ht = (e, t) => {
|
|
3451
|
-
const n =
|
|
3452
|
-
({ className: a, ...i }, o) =>
|
|
3451
|
+
const n = je(
|
|
3452
|
+
({ className: a, ...i }, o) => Ge(Dr, {
|
|
3453
3453
|
ref: o,
|
|
3454
3454
|
iconNode: t,
|
|
3455
3455
|
className: pt(
|
|
@@ -3520,11 +3520,11 @@ const Or = ({
|
|
|
3520
3520
|
onComplete: t,
|
|
3521
3521
|
onBack: n
|
|
3522
3522
|
}) => {
|
|
3523
|
-
const { questionnaire: a, initialAnswers: i, isLoading: o, isSubmitting: l, error: d, submit: u } = xr(e), [p, b] = v({}), [N, m] = v({}), [x,
|
|
3524
|
-
|
|
3523
|
+
const { questionnaire: a, initialAnswers: i, isLoading: o, isSubmitting: l, error: d, submit: u } = xr(e), [p, b] = v({}), [N, m] = v({}), [x, g] = v(0);
|
|
3524
|
+
ye.useEffect(() => {
|
|
3525
3525
|
i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && b(i);
|
|
3526
3526
|
}, [i]);
|
|
3527
|
-
const C =
|
|
3527
|
+
const C = Ie(
|
|
3528
3528
|
() => a ? Mr(a.questionGroups) : [],
|
|
3529
3529
|
[a]
|
|
3530
3530
|
), D = x === C.length - 1, k = C[x] ?? [], z = Q((E, f) => {
|
|
@@ -3540,9 +3540,9 @@ const Or = ({
|
|
|
3540
3540
|
}
|
|
3541
3541
|
return m((f) => ({ ...f, ...E })), Object.keys(E).length === 0;
|
|
3542
3542
|
}, [k, p]), I = () => {
|
|
3543
|
-
A() &&
|
|
3543
|
+
A() && g((E) => E + 1);
|
|
3544
3544
|
}, j = () => {
|
|
3545
|
-
x > 0 ?
|
|
3545
|
+
x > 0 ? g((E) => E - 1) : n == null || n();
|
|
3546
3546
|
}, G = async () => {
|
|
3547
3547
|
if (!(!A() || !a))
|
|
3548
3548
|
try {
|
|
@@ -3561,11 +3561,11 @@ const Or = ({
|
|
|
3561
3561
|
console.error("Questionnaire submit error:", E);
|
|
3562
3562
|
}
|
|
3563
3563
|
};
|
|
3564
|
-
return o ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
|
3564
|
+
return o ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(ke, { className: "my-8" }) }) }) : d ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
3565
3565
|
"Error loading questionnaire: ",
|
|
3566
3566
|
d.message
|
|
3567
3567
|
] }) }) }) : a ? /* @__PURE__ */ s(K, { children: [
|
|
3568
|
-
/* @__PURE__ */ s(
|
|
3568
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
3569
3569
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3570
3570
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.subtitle }),
|
|
3571
3571
|
C.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
|
|
@@ -3657,7 +3657,7 @@ const Or = ({
|
|
|
3657
3657
|
}
|
|
3658
3658
|
),
|
|
3659
3659
|
o === "single-select" && /* @__PURE__ */ r(
|
|
3660
|
-
|
|
3660
|
+
Ue,
|
|
3661
3661
|
{
|
|
3662
3662
|
value: t[0] ?? "",
|
|
3663
3663
|
onChange: (d) => a([d.target.value]),
|
|
@@ -3751,15 +3751,15 @@ const Or = ({
|
|
|
3751
3751
|
const { uploadDocument: a, isLoading: i, isSubmitting: o, error: l, submit: d } = br(e), [u, p] = v({}), b = async (N) => {
|
|
3752
3752
|
if (N.preventDefault(), !a) return;
|
|
3753
3753
|
const m = await Promise.all(
|
|
3754
|
-
a.uploadDocumentFiles.map(async (
|
|
3755
|
-
const C = u[
|
|
3754
|
+
a.uploadDocumentFiles.map(async (g) => {
|
|
3755
|
+
const C = u[g.id] || [], D = await Promise.all(
|
|
3756
3756
|
C.map(async (k) => ({
|
|
3757
3757
|
fileName: k.name,
|
|
3758
3758
|
fileData: await ur(k)
|
|
3759
3759
|
}))
|
|
3760
3760
|
);
|
|
3761
3761
|
return {
|
|
3762
|
-
uploadDocumentFileId:
|
|
3762
|
+
uploadDocumentFileId: g.id,
|
|
3763
3763
|
valueList: D
|
|
3764
3764
|
};
|
|
3765
3765
|
})
|
|
@@ -3770,11 +3770,11 @@ const Or = ({
|
|
|
3770
3770
|
};
|
|
3771
3771
|
await d(x), t == null || t();
|
|
3772
3772
|
};
|
|
3773
|
-
return i ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
|
3773
|
+
return i ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(ke, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
3774
3774
|
"Error loading document requirements: ",
|
|
3775
3775
|
l.message
|
|
3776
3776
|
] }) }) }) : a ? /* @__PURE__ */ r("form", { onSubmit: b, children: /* @__PURE__ */ s(K, { children: [
|
|
3777
|
-
/* @__PURE__ */ s(
|
|
3777
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
3778
3778
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3779
3779
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3780
3780
|
] }),
|
|
@@ -3801,11 +3801,11 @@ const Or = ({
|
|
|
3801
3801
|
const { overview: a, isLoading: i, isSubmitting: o, error: l, passOverview: d } = vr(e), u = async () => {
|
|
3802
3802
|
await d(), t == null || t();
|
|
3803
3803
|
};
|
|
3804
|
-
return i ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
|
|
3804
|
+
return i ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(ke, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
3805
3805
|
"Error loading overview: ",
|
|
3806
3806
|
l.message
|
|
3807
3807
|
] }) }) }) : a ? /* @__PURE__ */ s(K, { children: [
|
|
3808
|
-
/* @__PURE__ */ s(
|
|
3808
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
3809
3809
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
3810
3810
|
a.description && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
|
|
3811
3811
|
] }),
|
|
@@ -3846,7 +3846,7 @@ function _r(e, t) {
|
|
|
3846
3846
|
return e.errorMessage || "Invalid format";
|
|
3847
3847
|
} catch {
|
|
3848
3848
|
}
|
|
3849
|
-
const i = e.valueDataType ===
|
|
3849
|
+
const i = e.valueDataType === Re.Integer || e.valueDataType === Re.Decimal || e.valueDataType === Re.DigitOnly;
|
|
3850
3850
|
if (i && a.trim() !== "") {
|
|
3851
3851
|
const o = Number(a);
|
|
3852
3852
|
if (!isNaN(o)) {
|
|
@@ -3879,15 +3879,15 @@ const jr = ({
|
|
|
3879
3879
|
onComplete: t,
|
|
3880
3880
|
onBack: n
|
|
3881
3881
|
}) => {
|
|
3882
|
-
const { criteria: a, initialAnswers: i, isLoading: o, isSubmitting: l, error: d, submit: u } = wr(e), [p, b] = v({}), [N, m] = v({}), [x,
|
|
3883
|
-
|
|
3882
|
+
const { criteria: a, initialAnswers: i, isLoading: o, isSubmitting: l, error: d, submit: u } = wr(e), [p, b] = v({}), [N, m] = v({}), [x, g] = v(0), [C, D] = v(!1);
|
|
3883
|
+
ye.useEffect(() => {
|
|
3884
3884
|
i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && b(i);
|
|
3885
3885
|
}, [i]);
|
|
3886
|
-
const k =
|
|
3886
|
+
const k = Ie(
|
|
3887
3887
|
() => a && a.length > 0 ? Hr(a) : [],
|
|
3888
3888
|
[a]
|
|
3889
3889
|
), z = x === k.length - 1, A = k[x] ?? [];
|
|
3890
|
-
|
|
3890
|
+
ye.useEffect(() => {
|
|
3891
3891
|
!o && a && a.length === 0 && !C && !l && (D(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
3892
3892
|
}, [o, a, C, l, u, e, t]);
|
|
3893
3893
|
const I = Q((R, P) => {
|
|
@@ -3903,9 +3903,9 @@ const jr = ({
|
|
|
3903
3903
|
}
|
|
3904
3904
|
return m((P) => ({ ...P, ...R })), Object.keys(R).length === 0;
|
|
3905
3905
|
}, [A, p]), G = () => {
|
|
3906
|
-
j() &&
|
|
3906
|
+
j() && g((R) => R + 1);
|
|
3907
3907
|
}, E = () => {
|
|
3908
|
-
x > 0 ?
|
|
3908
|
+
x > 0 ? g((R) => R - 1) : n == null || n();
|
|
3909
3909
|
}, f = async () => {
|
|
3910
3910
|
if (!(!j() || !a))
|
|
3911
3911
|
try {
|
|
@@ -3919,16 +3919,16 @@ const jr = ({
|
|
|
3919
3919
|
}
|
|
3920
3920
|
};
|
|
3921
3921
|
return o ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
|
|
3922
|
-
/* @__PURE__ */ r(
|
|
3922
|
+
/* @__PURE__ */ r(ke, { className: "my-8" }),
|
|
3923
3923
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
3924
3924
|
] }) }) : !o && a && a.length === 0 ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
|
|
3925
|
-
/* @__PURE__ */ r(
|
|
3925
|
+
/* @__PURE__ */ r(ke, { className: "my-8" }),
|
|
3926
3926
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
3927
3927
|
] }) }) : d ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
3928
3928
|
"Error loading criteria: ",
|
|
3929
3929
|
d.message
|
|
3930
3930
|
] }) }) }) : a ? /* @__PURE__ */ s(K, { children: [
|
|
3931
|
-
/* @__PURE__ */ s(
|
|
3931
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
3932
3932
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3933
3933
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
3934
3934
|
k.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
|
|
@@ -3992,7 +3992,7 @@ const jr = ({
|
|
|
3992
3992
|
d && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: d.message }) })
|
|
3993
3993
|
] }) : null;
|
|
3994
3994
|
}, qr = ({ criterion: e, value: t, error: n, onChange: a }) => {
|
|
3995
|
-
const i = Ur(e), o = e.valueDataType ===
|
|
3995
|
+
const i = Ur(e), o = e.valueDataType === Re.Integer || e.valueDataType === Re.Decimal || e.valueDataType === Re.DigitOnly;
|
|
3996
3996
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
3997
3997
|
/* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
3998
3998
|
e.displayName,
|
|
@@ -4012,7 +4012,7 @@ const jr = ({
|
|
|
4012
4012
|
min: e.min,
|
|
4013
4013
|
max: e.max,
|
|
4014
4014
|
onKeyDown: (l) => {
|
|
4015
|
-
e.valueDataType ===
|
|
4015
|
+
e.valueDataType === Re.DigitOnly && ["e", "E", "+", "-", "."].includes(l.key) && l.preventDefault();
|
|
4016
4016
|
}
|
|
4017
4017
|
}
|
|
4018
4018
|
),
|
|
@@ -4091,7 +4091,7 @@ const jr = ({
|
|
|
4091
4091
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4092
4092
|
] }),
|
|
4093
4093
|
i === "country" && /* @__PURE__ */ r(
|
|
4094
|
-
|
|
4094
|
+
Ue,
|
|
4095
4095
|
{
|
|
4096
4096
|
value: t[0] ?? "",
|
|
4097
4097
|
onChange: (l) => a([l.target.value]),
|
|
@@ -4113,7 +4113,7 @@ const jr = ({
|
|
|
4113
4113
|
onComplete: t,
|
|
4114
4114
|
onBack: n
|
|
4115
4115
|
}) => {
|
|
4116
|
-
const { investorCategorizationService: a } =
|
|
4116
|
+
const { investorCategorizationService: a } = fe(), [i, o] = v(null), [l, d] = v(!1), [u, p] = v(null);
|
|
4117
4117
|
return /* @__PURE__ */ r("form", { onSubmit: async (N) => {
|
|
4118
4118
|
if (N.preventDefault(), i === null) {
|
|
4119
4119
|
p("Please select an investor type");
|
|
@@ -4134,7 +4134,7 @@ const jr = ({
|
|
|
4134
4134
|
d(!1);
|
|
4135
4135
|
}
|
|
4136
4136
|
}, children: /* @__PURE__ */ s(K, { children: [
|
|
4137
|
-
/* @__PURE__ */ s(
|
|
4137
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
4138
4138
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
|
|
4139
4139
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
|
|
4140
4140
|
] }),
|
|
@@ -4145,7 +4145,7 @@ const jr = ({
|
|
|
4145
4145
|
{
|
|
4146
4146
|
className: `
|
|
4147
4147
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
4148
|
-
${i ===
|
|
4148
|
+
${i === ge.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"}
|
|
4149
4149
|
`,
|
|
4150
4150
|
children: /* @__PURE__ */ s("div", { className: "flex items-start", children: [
|
|
4151
4151
|
/* @__PURE__ */ r(
|
|
@@ -4153,9 +4153,9 @@ const jr = ({
|
|
|
4153
4153
|
{
|
|
4154
4154
|
type: "radio",
|
|
4155
4155
|
name: "investorType",
|
|
4156
|
-
value:
|
|
4157
|
-
checked: i ===
|
|
4158
|
-
onChange: () => o(
|
|
4156
|
+
value: ge.Individual,
|
|
4157
|
+
checked: i === ge.Individual,
|
|
4158
|
+
onChange: () => o(ge.Individual),
|
|
4159
4159
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
4160
4160
|
}
|
|
4161
4161
|
),
|
|
@@ -4171,7 +4171,7 @@ const jr = ({
|
|
|
4171
4171
|
{
|
|
4172
4172
|
className: `
|
|
4173
4173
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
4174
|
-
${i ===
|
|
4174
|
+
${i === ge.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"}
|
|
4175
4175
|
`,
|
|
4176
4176
|
children: /* @__PURE__ */ s("div", { className: "flex items-start", children: [
|
|
4177
4177
|
/* @__PURE__ */ r(
|
|
@@ -4179,9 +4179,9 @@ const jr = ({
|
|
|
4179
4179
|
{
|
|
4180
4180
|
type: "radio",
|
|
4181
4181
|
name: "investorType",
|
|
4182
|
-
value:
|
|
4183
|
-
checked: i ===
|
|
4184
|
-
onChange: () => o(
|
|
4182
|
+
value: ge.Sophisticated,
|
|
4183
|
+
checked: i === ge.Sophisticated,
|
|
4184
|
+
onChange: () => o(ge.Sophisticated),
|
|
4185
4185
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
4186
4186
|
}
|
|
4187
4187
|
),
|
|
@@ -4202,7 +4202,7 @@ const jr = ({
|
|
|
4202
4202
|
{
|
|
4203
4203
|
className: `
|
|
4204
4204
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
4205
|
-
${i ===
|
|
4205
|
+
${i === ge.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"}
|
|
4206
4206
|
`,
|
|
4207
4207
|
children: /* @__PURE__ */ s("div", { className: "flex items-start", children: [
|
|
4208
4208
|
/* @__PURE__ */ r(
|
|
@@ -4210,9 +4210,9 @@ const jr = ({
|
|
|
4210
4210
|
{
|
|
4211
4211
|
type: "radio",
|
|
4212
4212
|
name: "investorType",
|
|
4213
|
-
value:
|
|
4214
|
-
checked: i ===
|
|
4215
|
-
onChange: () => o(
|
|
4213
|
+
value: ge.HighNetWorth,
|
|
4214
|
+
checked: i === ge.HighNetWorth,
|
|
4215
|
+
onChange: () => o(ge.HighNetWorth),
|
|
4216
4216
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
4217
4217
|
}
|
|
4218
4218
|
),
|
|
@@ -4251,7 +4251,7 @@ const jr = ({
|
|
|
4251
4251
|
onComplete: t,
|
|
4252
4252
|
onBack: n
|
|
4253
4253
|
}) => {
|
|
4254
|
-
const { appropriatenessTestService: a } =
|
|
4254
|
+
const { appropriatenessTestService: a } = fe(), [i, o] = v(null), [l, d] = v(!0), [u, p] = v(!1), [b, N] = v(null), [m, x] = v({}), [g, C] = v(0), [D, k] = v(!1), [z, A] = v(!1), [I, j] = v(0);
|
|
4255
4255
|
ae(() => {
|
|
4256
4256
|
(async () => {
|
|
4257
4257
|
try {
|
|
@@ -4280,12 +4280,12 @@ const jr = ({
|
|
|
4280
4280
|
return `${T.toString().padStart(2, "0")}:${J.toString().padStart(2, "0")}`;
|
|
4281
4281
|
};
|
|
4282
4282
|
ae(() => {
|
|
4283
|
-
if (!D ||
|
|
4283
|
+
if (!D || g <= 0) return;
|
|
4284
4284
|
const M = setInterval(() => {
|
|
4285
4285
|
C((T) => T <= 1 ? (A(!0), 0) : T - 1);
|
|
4286
4286
|
}, 1e3);
|
|
4287
4287
|
return () => clearInterval(M);
|
|
4288
|
-
}, [D,
|
|
4288
|
+
}, [D, g]), ae(() => {
|
|
4289
4289
|
if (I <= 0) return;
|
|
4290
4290
|
const M = setInterval(() => {
|
|
4291
4291
|
j((T) => T <= 1 ? 0 : T - 1);
|
|
@@ -4355,7 +4355,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4355
4355
|
};
|
|
4356
4356
|
if (l)
|
|
4357
4357
|
return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
|
|
4358
|
-
/* @__PURE__ */ r(
|
|
4358
|
+
/* @__PURE__ */ r(ke, { className: "my-8" }),
|
|
4359
4359
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
4360
4360
|
] }) });
|
|
4361
4361
|
if (!i)
|
|
@@ -4365,7 +4365,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4365
4365
|
] }) });
|
|
4366
4366
|
if (I > 0)
|
|
4367
4367
|
return /* @__PURE__ */ s(K, { children: [
|
|
4368
|
-
/* @__PURE__ */ s(
|
|
4368
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
4369
4369
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: i.displayName }),
|
|
4370
4370
|
i.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: i.subtitle })
|
|
4371
4371
|
] }),
|
|
@@ -4379,7 +4379,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4379
4379
|
] });
|
|
4380
4380
|
const H = i.testAllowedMaxTry - i.totalFailedTries;
|
|
4381
4381
|
return D ? /* @__PURE__ */ r("form", { onSubmit: P, children: /* @__PURE__ */ s(K, { children: [
|
|
4382
|
-
/* @__PURE__ */ r(
|
|
4382
|
+
/* @__PURE__ */ r(ce, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
4383
4383
|
/* @__PURE__ */ s("div", { children: [
|
|
4384
4384
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: i.displayName }),
|
|
4385
4385
|
i.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: i.subtitle })
|
|
@@ -4388,8 +4388,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4388
4388
|
/* @__PURE__ */ r(
|
|
4389
4389
|
"div",
|
|
4390
4390
|
{
|
|
4391
|
-
className: `text-3xl font-bold ${
|
|
4392
|
-
children: E(
|
|
4391
|
+
className: `text-3xl font-bold ${g <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
4392
|
+
children: E(g)
|
|
4393
4393
|
}
|
|
4394
4394
|
),
|
|
4395
4395
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
@@ -4397,13 +4397,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4397
4397
|
] }) }),
|
|
4398
4398
|
/* @__PURE__ */ s(W, { className: "space-y-6", children: [
|
|
4399
4399
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4400
|
-
/* @__PURE__ */ s(
|
|
4400
|
+
/* @__PURE__ */ s(Ee, { variant: "info", children: [
|
|
4401
4401
|
"Question ",
|
|
4402
4402
|
Object.keys(m).length,
|
|
4403
4403
|
" of ",
|
|
4404
4404
|
i.totalQuestionCount
|
|
4405
4405
|
] }),
|
|
4406
|
-
/* @__PURE__ */ s(
|
|
4406
|
+
/* @__PURE__ */ s(Ee, { variant: H > 1 ? "success" : "warning", children: [
|
|
4407
4407
|
H,
|
|
4408
4408
|
" attempt",
|
|
4409
4409
|
H !== 1 ? "s" : "",
|
|
@@ -4484,7 +4484,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4484
4484
|
)
|
|
4485
4485
|
] })
|
|
4486
4486
|
] }) }) : /* @__PURE__ */ s(K, { children: [
|
|
4487
|
-
/* @__PURE__ */ s(
|
|
4487
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
4488
4488
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: i.displayName }),
|
|
4489
4489
|
i.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: i.subtitle })
|
|
4490
4490
|
] }),
|
|
@@ -4493,19 +4493,19 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4493
4493
|
/* @__PURE__ */ s("div", { className: "space-y-4 mb-6", children: [
|
|
4494
4494
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4495
4495
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
|
|
4496
|
-
/* @__PURE__ */ r(
|
|
4496
|
+
/* @__PURE__ */ r(Ee, { variant: "info", children: i.totalQuestionCount })
|
|
4497
4497
|
] }),
|
|
4498
4498
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4499
4499
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4500
|
-
/* @__PURE__ */ r(
|
|
4500
|
+
/* @__PURE__ */ r(Ee, { variant: "info", children: E(i.testDurationSec) })
|
|
4501
4501
|
] }),
|
|
4502
4502
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4503
4503
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
4504
|
-
/* @__PURE__ */ r(
|
|
4504
|
+
/* @__PURE__ */ r(Ee, { variant: "info", children: i.testCorrectAnswerPassLimit })
|
|
4505
4505
|
] }),
|
|
4506
4506
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4507
4507
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4508
|
-
/* @__PURE__ */ r(
|
|
4508
|
+
/* @__PURE__ */ r(Ee, { variant: H > 1 ? "success" : "warning", children: H })
|
|
4509
4509
|
] })
|
|
4510
4510
|
] }),
|
|
4511
4511
|
b && /* @__PURE__ */ r("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -4534,7 +4534,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4534
4534
|
onBack: n
|
|
4535
4535
|
}) => {
|
|
4536
4536
|
var J, w, q, re;
|
|
4537
|
-
const { applicantService: a, baseInformationService: i, config: o } =
|
|
4537
|
+
const { applicantService: a, baseInformationService: i, config: o } = fe(), { identityData: l, provider: d, token: u, isLoading: p, error: b, requestIdentity: N, restartIdentity: m } = kr(e), [x, g] = v(null), [C, D] = v(null), [k, z] = v([]), [A, I] = v(!0), [j, G] = v(!1), [E, f] = v(null), [R, P] = v(!1), O = ye.useRef(!1), H = Ct({
|
|
4538
4538
|
defaultValues: {
|
|
4539
4539
|
street: "",
|
|
4540
4540
|
streetNumber: "",
|
|
@@ -4553,9 +4553,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4553
4553
|
i.getCountries("", "en")
|
|
4554
4554
|
]);
|
|
4555
4555
|
D(F);
|
|
4556
|
-
const U = /* @__PURE__ */ new Set(), X = S.filter((
|
|
4557
|
-
const
|
|
4558
|
-
return !
|
|
4556
|
+
const U = /* @__PURE__ */ new Set(), X = S.filter((we) => {
|
|
4557
|
+
const Ae = we.abbreviation3 || we.abbreviation;
|
|
4558
|
+
return !Ae || U.has(Ae) ? !1 : (U.add(Ae), !0);
|
|
4559
4559
|
});
|
|
4560
4560
|
z(X);
|
|
4561
4561
|
const Y = F.applicantRequestData;
|
|
@@ -4571,8 +4571,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4571
4571
|
console.log("[Identity] Found existing identity verification, auto-requesting..."), O.current = !0;
|
|
4572
4572
|
try {
|
|
4573
4573
|
await N(), G(!0);
|
|
4574
|
-
} catch (
|
|
4575
|
-
console.error("[Identity] Auto-request failed:",
|
|
4574
|
+
} catch (we) {
|
|
4575
|
+
console.error("[Identity] Auto-request failed:", we);
|
|
4576
4576
|
}
|
|
4577
4577
|
}
|
|
4578
4578
|
} catch (F) {
|
|
@@ -4613,11 +4613,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4613
4613
|
if (u.url) {
|
|
4614
4614
|
console.log("[Identity] Loading provider URL for user verification:", u.url), f(null);
|
|
4615
4615
|
try {
|
|
4616
|
-
if (new URL(u.url), _ ===
|
|
4616
|
+
if (new URL(u.url), _ === be.SardinAI) {
|
|
4617
4617
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4618
4618
|
try {
|
|
4619
|
-
const F =
|
|
4620
|
-
|
|
4619
|
+
const F = Oe.parseProviderConfig(d, u, o);
|
|
4620
|
+
Oe.createProvider(d, F).initialize().then(() => {
|
|
4621
4621
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4622
4622
|
}).catch((U) => {
|
|
4623
4623
|
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", U);
|
|
@@ -4626,18 +4626,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4626
4626
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", F);
|
|
4627
4627
|
}
|
|
4628
4628
|
}
|
|
4629
|
-
|
|
4629
|
+
g({ type: "url", url: u.url });
|
|
4630
4630
|
} catch (F) {
|
|
4631
4631
|
console.error("[Identity] Invalid URL:", F), f("Invalid verification URL. Please restart."), P(!0);
|
|
4632
4632
|
}
|
|
4633
4633
|
return;
|
|
4634
4634
|
}
|
|
4635
|
-
if (_ ===
|
|
4635
|
+
if (_ === be.SardinAI) {
|
|
4636
4636
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), f(null);
|
|
4637
4637
|
try {
|
|
4638
|
-
const F =
|
|
4638
|
+
const F = Oe.parseProviderConfig(d, u, o), S = Oe.createProvider(d, F);
|
|
4639
4639
|
S.initialize().then(() => {
|
|
4640
|
-
console.log("[SardinAI] Risk SDK initialized successfully"),
|
|
4640
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), g(S), setTimeout(() => {
|
|
4641
4641
|
t == null || t();
|
|
4642
4642
|
}, 2e3);
|
|
4643
4643
|
}).catch((U) => {
|
|
@@ -4653,15 +4653,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4653
4653
|
}
|
|
4654
4654
|
try {
|
|
4655
4655
|
f(null);
|
|
4656
|
-
const F =
|
|
4657
|
-
_ ===
|
|
4656
|
+
const F = Oe.parseProviderConfig(d, u, o), S = Oe.createProvider(d, F);
|
|
4657
|
+
_ === be.Sumsub ? (S.initialize("identity-container").catch((U) => {
|
|
4658
4658
|
var X;
|
|
4659
4659
|
console.error("[Sumsub] Initialization error:", U), f(`Failed to initialize: ${U.message}`), (X = U.message) != null && X.toLowerCase().includes("expired") && P(!0);
|
|
4660
4660
|
}), S.onComplete && S.onComplete(() => {
|
|
4661
4661
|
t == null || t();
|
|
4662
|
-
})) : _ ===
|
|
4662
|
+
})) : _ === be.Onfido && S.initialize("identity-container").catch((U) => {
|
|
4663
4663
|
console.error("[Onfido] Initialization error:", U), f(`Failed to initialize: ${U.message}`);
|
|
4664
|
-
}),
|
|
4664
|
+
}), g(S);
|
|
4665
4665
|
} catch (F) {
|
|
4666
4666
|
console.error("[Identity] Provider setup error:", F), f(`Setup error: ${F.message}`);
|
|
4667
4667
|
}
|
|
@@ -4683,14 +4683,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4683
4683
|
}
|
|
4684
4684
|
}, T = async () => {
|
|
4685
4685
|
try {
|
|
4686
|
-
f(null), P(!1),
|
|
4686
|
+
f(null), P(!1), g(null), console.log("[Identity] Restarting verification..."), await m(), G(!0);
|
|
4687
4687
|
} catch (_) {
|
|
4688
4688
|
console.error("Error restarting identity verification:", _), f(_.message || "Failed to restart verification");
|
|
4689
4689
|
}
|
|
4690
4690
|
};
|
|
4691
4691
|
if (A || p)
|
|
4692
4692
|
return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
|
|
4693
|
-
/* @__PURE__ */ r(
|
|
4693
|
+
/* @__PURE__ */ r(ke, { className: "my-8" }),
|
|
4694
4694
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4695
4695
|
] }) });
|
|
4696
4696
|
if (b)
|
|
@@ -4700,7 +4700,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4700
4700
|
] }) }) });
|
|
4701
4701
|
if (j && (E || R))
|
|
4702
4702
|
return /* @__PURE__ */ s(K, { children: [
|
|
4703
|
-
/* @__PURE__ */ r(
|
|
4703
|
+
/* @__PURE__ */ r(ce, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4704
4704
|
/* @__PURE__ */ s(W, { children: [
|
|
4705
4705
|
/* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ s("div", { className: "flex items-start", children: [
|
|
4706
4706
|
/* @__PURE__ */ r(
|
|
@@ -4743,7 +4743,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4743
4743
|
if (j && l) {
|
|
4744
4744
|
const _ = d;
|
|
4745
4745
|
return u != null && u.url ? /* @__PURE__ */ s(K, { children: [
|
|
4746
|
-
/* @__PURE__ */ r(
|
|
4746
|
+
/* @__PURE__ */ r(ce, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
4747
4747
|
/* @__PURE__ */ s("div", { children: [
|
|
4748
4748
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4749
4749
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
@@ -4776,10 +4776,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4776
4776
|
var S, U, X;
|
|
4777
4777
|
console.log("[Identity] Iframe loaded");
|
|
4778
4778
|
try {
|
|
4779
|
-
const Y = F.target,
|
|
4780
|
-
if (
|
|
4781
|
-
const
|
|
4782
|
-
(
|
|
4779
|
+
const Y = F.target, Ne = Y.contentDocument || ((S = Y.contentWindow) == null ? void 0 : S.document);
|
|
4780
|
+
if (Ne) {
|
|
4781
|
+
const we = ((X = (U = Ne.body) == null ? void 0 : U.textContent) == null ? void 0 : X.toLowerCase()) || "";
|
|
4782
|
+
(we.includes("expired") || we.includes("invalid") || we.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), P(!0), f("Your verification link has expired."));
|
|
4783
4783
|
}
|
|
4784
4784
|
} catch {
|
|
4785
4785
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4789,18 +4789,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4789
4789
|
) })
|
|
4790
4790
|
] }),
|
|
4791
4791
|
n && /* @__PURE__ */ r(pe, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
|
|
4792
|
-
] }) : _ ===
|
|
4793
|
-
/* @__PURE__ */ s(
|
|
4792
|
+
] }) : _ === be.SardinAI ? /* @__PURE__ */ s(K, { children: [
|
|
4793
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
4794
4794
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4795
4795
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4796
4796
|
] }),
|
|
4797
4797
|
/* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("div", { className: "text-center py-12", children: [
|
|
4798
|
-
/* @__PURE__ */ r(
|
|
4798
|
+
/* @__PURE__ */ r(ke, { className: "mb-4" }),
|
|
4799
4799
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4800
4800
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
|
|
4801
4801
|
] }) })
|
|
4802
4802
|
] }) : /* @__PURE__ */ s(K, { children: [
|
|
4803
|
-
/* @__PURE__ */ s(
|
|
4803
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
4804
4804
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4805
4805
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4806
4806
|
] }),
|
|
@@ -4809,7 +4809,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4809
4809
|
] });
|
|
4810
4810
|
}
|
|
4811
4811
|
return /* @__PURE__ */ r("form", { onSubmit: H.handleSubmit(M), children: /* @__PURE__ */ s(K, { children: [
|
|
4812
|
-
/* @__PURE__ */ s(
|
|
4812
|
+
/* @__PURE__ */ s(ce, { children: [
|
|
4813
4813
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Review Your Information" }),
|
|
4814
4814
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
4815
4815
|
] }),
|
|
@@ -4836,12 +4836,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4836
4836
|
/* @__PURE__ */ r("h3", { className: "text-lg font-semibold", children: "Address Information" }),
|
|
4837
4837
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4838
4838
|
/* @__PURE__ */ r(
|
|
4839
|
-
|
|
4839
|
+
De,
|
|
4840
4840
|
{
|
|
4841
4841
|
control: H.control,
|
|
4842
4842
|
name: "country",
|
|
4843
4843
|
render: ({ field: _ }) => /* @__PURE__ */ r(
|
|
4844
|
-
|
|
4844
|
+
Ue,
|
|
4845
4845
|
{
|
|
4846
4846
|
..._,
|
|
4847
4847
|
label: "Country",
|
|
@@ -4857,12 +4857,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4857
4857
|
}
|
|
4858
4858
|
),
|
|
4859
4859
|
/* @__PURE__ */ r(
|
|
4860
|
-
|
|
4860
|
+
De,
|
|
4861
4861
|
{
|
|
4862
4862
|
control: H.control,
|
|
4863
4863
|
name: "nationality",
|
|
4864
4864
|
render: ({ field: _ }) => /* @__PURE__ */ r(
|
|
4865
|
-
|
|
4865
|
+
Ue,
|
|
4866
4866
|
{
|
|
4867
4867
|
..._,
|
|
4868
4868
|
label: "Nationality",
|
|
@@ -4880,7 +4880,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4880
4880
|
] }),
|
|
4881
4881
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4882
4882
|
/* @__PURE__ */ r(
|
|
4883
|
-
|
|
4883
|
+
De,
|
|
4884
4884
|
{
|
|
4885
4885
|
control: H.control,
|
|
4886
4886
|
name: "street",
|
|
@@ -4888,7 +4888,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4888
4888
|
}
|
|
4889
4889
|
),
|
|
4890
4890
|
/* @__PURE__ */ r(
|
|
4891
|
-
|
|
4891
|
+
De,
|
|
4892
4892
|
{
|
|
4893
4893
|
control: H.control,
|
|
4894
4894
|
name: "streetNumber",
|
|
@@ -4898,7 +4898,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4898
4898
|
] }),
|
|
4899
4899
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4900
4900
|
/* @__PURE__ */ r(
|
|
4901
|
-
|
|
4901
|
+
De,
|
|
4902
4902
|
{
|
|
4903
4903
|
control: H.control,
|
|
4904
4904
|
name: "city",
|
|
@@ -4906,7 +4906,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4906
4906
|
}
|
|
4907
4907
|
),
|
|
4908
4908
|
/* @__PURE__ */ r(
|
|
4909
|
-
|
|
4909
|
+
De,
|
|
4910
4910
|
{
|
|
4911
4911
|
control: H.control,
|
|
4912
4912
|
name: "zip",
|
|
@@ -4915,7 +4915,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4915
4915
|
)
|
|
4916
4916
|
] }),
|
|
4917
4917
|
/* @__PURE__ */ r(
|
|
4918
|
-
|
|
4918
|
+
De,
|
|
4919
4919
|
{
|
|
4920
4920
|
control: H.control,
|
|
4921
4921
|
name: "phonenumber",
|
|
@@ -4937,63 +4937,63 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4937
4937
|
onContinue: i,
|
|
4938
4938
|
onContactSupport: o
|
|
4939
4939
|
}) => {
|
|
4940
|
-
const d = e ===
|
|
4940
|
+
const d = e === Fe.Approved ? {
|
|
4941
4941
|
type: "success",
|
|
4942
4942
|
title: "Verification Approved",
|
|
4943
4943
|
icon: "✓",
|
|
4944
4944
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4945
4945
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4946
4946
|
message: "Your identity verification has been successfully approved."
|
|
4947
|
-
} : e ===
|
|
4947
|
+
} : e === Fe.Rejected ? {
|
|
4948
4948
|
type: "error",
|
|
4949
4949
|
title: "Verification Rejected",
|
|
4950
4950
|
icon: "✕",
|
|
4951
4951
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4952
4952
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4953
4953
|
message: "Unfortunately, your identity verification was not approved."
|
|
4954
|
-
} : e ===
|
|
4954
|
+
} : e === Fe.Pending || e === Fe.InProgress ? {
|
|
4955
4955
|
type: "pending",
|
|
4956
4956
|
title: "Verification Pending",
|
|
4957
4957
|
icon: "⏱",
|
|
4958
4958
|
iconBg: "bg-blue-100 dark:bg-blue-900/30",
|
|
4959
4959
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4960
4960
|
message: "Your identity verification is currently being processed."
|
|
4961
|
-
} : t ===
|
|
4961
|
+
} : t === Le.Approved ? {
|
|
4962
4962
|
type: "success",
|
|
4963
4963
|
title: "Application Approved",
|
|
4964
4964
|
icon: "✓",
|
|
4965
4965
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4966
4966
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4967
4967
|
message: "Your application has been approved."
|
|
4968
|
-
} : t ===
|
|
4968
|
+
} : t === Le.Reject ? {
|
|
4969
4969
|
type: "error",
|
|
4970
4970
|
title: "Application Rejected",
|
|
4971
4971
|
icon: "✕",
|
|
4972
4972
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4973
4973
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4974
4974
|
message: "Your application has been rejected."
|
|
4975
|
-
} : t ===
|
|
4975
|
+
} : t === Le.UnderReview || t === Le.AdminReview ? {
|
|
4976
4976
|
type: "pending",
|
|
4977
4977
|
title: "Under Review",
|
|
4978
4978
|
icon: "📋",
|
|
4979
4979
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
4980
4980
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
4981
4981
|
message: "Your application is currently under manual review."
|
|
4982
|
-
} : n ===
|
|
4982
|
+
} : n === Ke.Success ? {
|
|
4983
4983
|
type: "success",
|
|
4984
4984
|
title: "Process Complete",
|
|
4985
4985
|
icon: "✓",
|
|
4986
4986
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4987
4987
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4988
4988
|
message: "Your verification process has been completed successfully."
|
|
4989
|
-
} : n ===
|
|
4989
|
+
} : n === Ke.Failed ? {
|
|
4990
4990
|
type: "error",
|
|
4991
4991
|
title: "Process Failed",
|
|
4992
4992
|
icon: "✕",
|
|
4993
4993
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4994
4994
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4995
4995
|
message: "The verification process could not be completed."
|
|
4996
|
-
} : n ===
|
|
4996
|
+
} : n === Ke.AdminReview ? {
|
|
4997
4997
|
type: "pending",
|
|
4998
4998
|
title: "Admin Review Required",
|
|
4999
4999
|
icon: "📋",
|
|
@@ -5019,10 +5019,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5019
5019
|
) }),
|
|
5020
5020
|
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: d.title }),
|
|
5021
5021
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
5022
|
-
|
|
5022
|
+
Ee,
|
|
5023
5023
|
{
|
|
5024
5024
|
variant: d.type === "success" ? "success" : d.type === "error" ? "danger" : d.type === "pending" ? "warning" : "info",
|
|
5025
|
-
children: e != null ?
|
|
5025
|
+
children: e != null ? Fe[e] : Le[t]
|
|
5026
5026
|
}
|
|
5027
5027
|
) }),
|
|
5028
5028
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: a || d.message }),
|
|
@@ -5054,11 +5054,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5054
5054
|
/* @__PURE__ */ r("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
5055
5055
|
/* @__PURE__ */ s("div", { children: [
|
|
5056
5056
|
/* @__PURE__ */ r("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
|
|
5057
|
-
/* @__PURE__ */ r("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ?
|
|
5057
|
+
/* @__PURE__ */ r("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ? Fe[e] : "Not Available" })
|
|
5058
5058
|
] }),
|
|
5059
5059
|
/* @__PURE__ */ s("div", { children: [
|
|
5060
5060
|
/* @__PURE__ */ r("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
|
|
5061
|
-
/* @__PURE__ */ r("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children:
|
|
5061
|
+
/* @__PURE__ */ r("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: Le[t] })
|
|
5062
5062
|
] })
|
|
5063
5063
|
] }) })
|
|
5064
5064
|
] }),
|
|
@@ -5086,12 +5086,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5086
5086
|
console.warn("[Logo] Failed to load logo:", e.url), n.target.style.display = "none";
|
|
5087
5087
|
}
|
|
5088
5088
|
}
|
|
5089
|
-
) }),
|
|
5089
|
+
) }), Ve = ({
|
|
5090
5090
|
title: e,
|
|
5091
5091
|
subtitle: t,
|
|
5092
5092
|
className: n = ""
|
|
5093
5093
|
}) => {
|
|
5094
|
-
const { currentTheme: a } =
|
|
5094
|
+
const { currentTheme: a } = fe(), i = e || (a == null ? void 0 : a.title) || "", o = !!(a != null && a.logo && a.logo.visible && a.logo.url), l = !!i;
|
|
5095
5095
|
return !o && !l ? null : /* @__PURE__ */ s("div", { className: `metakyc-header ${n}`, children: [
|
|
5096
5096
|
/* @__PURE__ */ s("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
5097
5097
|
o && /* @__PURE__ */ r(Qr, { config: a.logo }),
|
|
@@ -5107,11 +5107,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5107
5107
|
] }),
|
|
5108
5108
|
t && /* @__PURE__ */ r("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
|
|
5109
5109
|
] });
|
|
5110
|
-
},
|
|
5111
|
-
function
|
|
5110
|
+
}, qe = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
5111
|
+
function _e(e) {
|
|
5112
5112
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
5113
5113
|
}
|
|
5114
|
-
const
|
|
5114
|
+
const He = {
|
|
5115
5115
|
width: "16px",
|
|
5116
5116
|
height: "16px",
|
|
5117
5117
|
minWidth: "16px",
|
|
@@ -5124,7 +5124,7 @@ const _e = {
|
|
|
5124
5124
|
display: "inline-block",
|
|
5125
5125
|
verticalAlign: "middle"
|
|
5126
5126
|
}, ct = ({ helpText: e, children: t }) => {
|
|
5127
|
-
const [n, a] =
|
|
5127
|
+
const [n, a] = ye.useState(!1);
|
|
5128
5128
|
if (!e) return /* @__PURE__ */ r(dt, { children: t });
|
|
5129
5129
|
const i = n ? /* @__PURE__ */ r(
|
|
5130
5130
|
"div",
|
|
@@ -5236,7 +5236,7 @@ const _e = {
|
|
|
5236
5236
|
children: "?"
|
|
5237
5237
|
}
|
|
5238
5238
|
),
|
|
5239
|
-
typeof document < "u" && i ?
|
|
5239
|
+
typeof document < "u" && i ? Ze(i, document.body) : null
|
|
5240
5240
|
] });
|
|
5241
5241
|
}, hn = ({
|
|
5242
5242
|
workflowKey: e,
|
|
@@ -5244,63 +5244,63 @@ const _e = {
|
|
|
5244
5244
|
onSuccess: n,
|
|
5245
5245
|
onCancel: a
|
|
5246
5246
|
}) => {
|
|
5247
|
-
var
|
|
5248
|
-
const { config: i, baseInformationService: o, currentTheme: l } =
|
|
5247
|
+
var Xe, et, tt, rt;
|
|
5248
|
+
const { config: i, baseInformationService: o, currentTheme: l } = fe(), { createApplicant: d, isLoading: u } = Nr(), p = e || ((Xe = i.applicantForm) == null ? void 0 : Xe.workflowKey);
|
|
5249
5249
|
if (!p)
|
|
5250
5250
|
throw new Error(
|
|
5251
5251
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
5252
5252
|
);
|
|
5253
|
-
const b = t || ((
|
|
5253
|
+
const b = t || ((et = i.applicantForm) == null ? void 0 : et.externalRefId) || "", N = ((tt = i.applicantForm) == null ? void 0 : tt.email) || "", m = Ie(
|
|
5254
5254
|
() => l != null && l.applicantFormPages && l.applicantFormPages.length > 0 ? l.applicantFormPages : null,
|
|
5255
5255
|
[l == null ? void 0 : l.applicantFormPages]
|
|
5256
|
-
), x =
|
|
5257
|
-
const c = new Set(
|
|
5256
|
+
), x = Ie(() => {
|
|
5257
|
+
const c = new Set(qe), L = l == null ? void 0 : l.applicantFormRequiredFields;
|
|
5258
5258
|
if (L) for (const $ of L) c.add($);
|
|
5259
5259
|
if (m)
|
|
5260
5260
|
for (const $ of m)
|
|
5261
5261
|
for (const y of $.fields)
|
|
5262
5262
|
!y.isCustom && y.name && y.required && c.add(y.name);
|
|
5263
5263
|
return Array.from(c);
|
|
5264
|
-
}, [l == null ? void 0 : l.applicantFormRequiredFields, m]),
|
|
5264
|
+
}, [l == null ? void 0 : l.applicantFormRequiredFields, m]), g = Ie(() => {
|
|
5265
5265
|
var $;
|
|
5266
5266
|
if (m) {
|
|
5267
|
-
const y = m.flatMap((B) => B.fields).filter((B) => !B.isCustom && B.name).map((B) => B.name),
|
|
5268
|
-
for (const B of
|
|
5269
|
-
return Array.from(
|
|
5267
|
+
const y = m.flatMap((B) => B.fields).filter((B) => !B.isCustom && B.name).map((B) => B.name), h = new Set(y);
|
|
5268
|
+
for (const B of qe) h.add(B);
|
|
5269
|
+
return Array.from(h);
|
|
5270
5270
|
}
|
|
5271
5271
|
let c;
|
|
5272
5272
|
($ = i.applicantForm) != null && $.visibleFields ? c = i.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? c = l.applicantFormVisibleFields : c = zt;
|
|
5273
5273
|
const L = new Set(c);
|
|
5274
|
-
for (const y of
|
|
5274
|
+
for (const y of qe) L.add(y);
|
|
5275
5275
|
return Array.from(L);
|
|
5276
|
-
}, [(
|
|
5276
|
+
}, [(rt = i.applicantForm) == null ? void 0 : rt.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields, m]), C = /* @__PURE__ */ new Set([
|
|
5277
5277
|
"country",
|
|
5278
5278
|
"nationality",
|
|
5279
5279
|
"taxCountry",
|
|
5280
5280
|
"countryOfBirth",
|
|
5281
5281
|
"mobileCountryCode",
|
|
5282
5282
|
"otherNationality"
|
|
5283
|
-
]), D =
|
|
5283
|
+
]), D = Ie(() => {
|
|
5284
5284
|
var L, $;
|
|
5285
5285
|
const c = /* @__PURE__ */ new Set();
|
|
5286
5286
|
if (m)
|
|
5287
5287
|
for (const y of m)
|
|
5288
|
-
for (const
|
|
5289
|
-
!
|
|
5288
|
+
for (const h of y.fields)
|
|
5289
|
+
!h.isCustom && h.name && C.has(h.name) && c.add(h.countriesType ?? ((L = Me[h.name]) == null ? void 0 : L.countriesType));
|
|
5290
5290
|
else
|
|
5291
|
-
for (const y of
|
|
5292
|
-
C.has(y) && c.add(($ =
|
|
5291
|
+
for (const y of g)
|
|
5292
|
+
C.has(y) && c.add(($ = Me[y]) == null ? void 0 : $.countriesType);
|
|
5293
5293
|
return c.size === 0 && c.add(void 0), Array.from(c);
|
|
5294
|
-
}, [
|
|
5294
|
+
}, [g, m]), [k, z] = v({}), [A, I] = v(!0), j = ee(/* @__PURE__ */ new Set()), G = ee(/* @__PURE__ */ new Set());
|
|
5295
5295
|
ae(() => {
|
|
5296
5296
|
if (!l) return;
|
|
5297
5297
|
const c = D.filter((y) => {
|
|
5298
|
-
const
|
|
5299
|
-
return !G.current.has(
|
|
5298
|
+
const h = y != null ? String(y) : "all";
|
|
5299
|
+
return !G.current.has(h) && !j.current.has(h);
|
|
5300
5300
|
});
|
|
5301
5301
|
if (c.length === 0) {
|
|
5302
|
-
D.every((
|
|
5303
|
-
const B =
|
|
5302
|
+
D.every((h) => {
|
|
5303
|
+
const B = h != null ? String(h) : "all";
|
|
5304
5304
|
return G.current.has(B);
|
|
5305
5305
|
}) && I(!1);
|
|
5306
5306
|
return;
|
|
@@ -5310,25 +5310,28 @@ const _e = {
|
|
|
5310
5310
|
L.forEach((y) => j.current.add(y)), (async () => {
|
|
5311
5311
|
try {
|
|
5312
5312
|
const y = await Promise.all(
|
|
5313
|
-
c.map(async (
|
|
5314
|
-
const B =
|
|
5315
|
-
|
|
5313
|
+
c.map(async (h) => {
|
|
5314
|
+
const B = h != null ? String(h) : "all", te = await o.getCountries("", i.locale || "en", h), ie = h === 40, he = /* @__PURE__ */ new Set(), xe = te.map((de) => ie && de.countryCode ? {
|
|
5315
|
+
value: de.countryCode,
|
|
5316
|
+
label: `${de.countryCode} – ${de.name}`
|
|
5317
|
+
} : { value: de.abbreviation3 || de.abbreviation, label: de.name }).filter((de) => !de.value || he.has(de.value) ? !1 : (he.add(de.value), !0));
|
|
5318
|
+
return G.current.add(B), j.current.delete(B), [B, xe];
|
|
5316
5319
|
})
|
|
5317
5320
|
);
|
|
5318
|
-
z((
|
|
5321
|
+
z((h) => ({ ...h, ...Object.fromEntries(y) }));
|
|
5319
5322
|
} catch (y) {
|
|
5320
|
-
L.forEach((
|
|
5323
|
+
L.forEach((h) => j.current.delete(h)), console.error("Failed to load countries:", y);
|
|
5321
5324
|
} finally {
|
|
5322
|
-
D.every((
|
|
5323
|
-
const B =
|
|
5325
|
+
D.every((h) => {
|
|
5326
|
+
const B = h != null ? String(h) : "all";
|
|
5324
5327
|
return G.current.has(B);
|
|
5325
5328
|
}) && I(!1);
|
|
5326
5329
|
}
|
|
5327
5330
|
})();
|
|
5328
5331
|
}, [D, l]);
|
|
5329
5332
|
const E = (c, L) => {
|
|
5330
|
-
var
|
|
5331
|
-
const $ = L ?? ((
|
|
5333
|
+
var h;
|
|
5334
|
+
const $ = L ?? ((h = Me[c]) == null ? void 0 : h.countriesType), y = $ != null ? String($) : "all";
|
|
5332
5335
|
return k[y] || [];
|
|
5333
5336
|
}, [f, R] = v({
|
|
5334
5337
|
workflowKey: p,
|
|
@@ -5355,42 +5358,42 @@ const _e = {
|
|
|
5355
5358
|
educationLevel: "",
|
|
5356
5359
|
occupation: "",
|
|
5357
5360
|
taxNumber: ""
|
|
5358
|
-
}), [P, O] = v({}), [H, M] = v(0), [T, J] = v({}), [w, q] = v(null), [re, _] = v(!1), F = (c, L) => R(($) => ({ ...$, [c]: L })), S = (c, L) => O(($) => ({ ...$, [c]: L })), U = (c) => !c.conditionalOn || P[c.conditionalOn] === "true", X = m && H < m.length - 1 ? H + 1 : -1, Y = m && H > 0 ? H - 1 : -1,
|
|
5361
|
+
}), [P, O] = v({}), [H, M] = v(0), [T, J] = v({}), [w, q] = v(null), [re, _] = v(!1), F = (c, L) => R(($) => ({ ...$, [c]: L })), S = (c, L) => O(($) => ({ ...$, [c]: L })), U = (c) => !c.conditionalOn || P[c.conditionalOn] === "true", X = m && H < m.length - 1 ? H + 1 : -1, Y = m && H > 0 ? H - 1 : -1, Ne = (c) => {
|
|
5359
5362
|
var $;
|
|
5360
5363
|
const L = {};
|
|
5361
5364
|
for (const y of c.fields)
|
|
5362
5365
|
if (y.isCustom) {
|
|
5363
5366
|
if (y.customType === "paragraph" || y.customType === "br" || y.customType === "link") continue;
|
|
5364
5367
|
if (y.required && y.paramName) {
|
|
5365
|
-
const
|
|
5366
|
-
y.customType === "checkbox" || y.customType === "link_checkbox" ?
|
|
5368
|
+
const h = P[y.paramName], B = y.displayText || y.label || y.paramName;
|
|
5369
|
+
y.customType === "checkbox" || y.customType === "link_checkbox" ? h !== "true" && (L[y.paramName] = `${B} is required.`) : (!h || h.trim() === "") && (L[y.paramName] = `${B} is required.`);
|
|
5367
5370
|
}
|
|
5368
5371
|
} else if (y.name) {
|
|
5369
|
-
const
|
|
5370
|
-
if (x.includes(
|
|
5371
|
-
const B = y.displayText || (($ =
|
|
5372
|
-
L[
|
|
5372
|
+
const h = y.name;
|
|
5373
|
+
if (x.includes(h) && _e(f[h])) {
|
|
5374
|
+
const B = y.displayText || (($ = Me[h]) == null ? void 0 : $.label) || h;
|
|
5375
|
+
L[h] = `${B} is required.`;
|
|
5373
5376
|
}
|
|
5374
5377
|
}
|
|
5375
5378
|
return L;
|
|
5376
|
-
},
|
|
5379
|
+
}, we = async () => {
|
|
5377
5380
|
if (!m) return;
|
|
5378
5381
|
const c = m[H];
|
|
5379
5382
|
if (c.conditionalOn && !U(c)) {
|
|
5380
|
-
J({}), X >= 0 ? M(X) : await
|
|
5383
|
+
J({}), X >= 0 ? M(X) : await Ae();
|
|
5381
5384
|
return;
|
|
5382
5385
|
}
|
|
5383
|
-
const L =
|
|
5386
|
+
const L = Ne(c);
|
|
5384
5387
|
if (Object.keys(L).length > 0) {
|
|
5385
5388
|
J(L);
|
|
5386
5389
|
return;
|
|
5387
5390
|
}
|
|
5388
|
-
J({}), X >= 0 ? M(X) : await
|
|
5389
|
-
},
|
|
5391
|
+
J({}), X >= 0 ? M(X) : await Ae();
|
|
5392
|
+
}, Ae = async () => {
|
|
5390
5393
|
if (m) {
|
|
5391
5394
|
let c = {};
|
|
5392
5395
|
for (const L of m)
|
|
5393
|
-
U(L) && (c = { ...c, ...
|
|
5396
|
+
U(L) && (c = { ...c, ...Ne(L) });
|
|
5394
5397
|
if (Object.keys(c).length > 0) {
|
|
5395
5398
|
J(c);
|
|
5396
5399
|
return;
|
|
@@ -5409,35 +5412,35 @@ const _e = {
|
|
|
5409
5412
|
if (m) {
|
|
5410
5413
|
for (const y of m)
|
|
5411
5414
|
if (U(y)) {
|
|
5412
|
-
for (const
|
|
5413
|
-
if (!
|
|
5414
|
-
const B =
|
|
5415
|
-
|
|
5415
|
+
for (const h of y.fields)
|
|
5416
|
+
if (!h.isCustom && h.name) {
|
|
5417
|
+
const B = h.name, te = f[B];
|
|
5418
|
+
_e(te) || (c[B] = te);
|
|
5416
5419
|
}
|
|
5417
5420
|
}
|
|
5418
|
-
for (const y of
|
|
5421
|
+
for (const y of qe)
|
|
5419
5422
|
if (c[y] === void 0) {
|
|
5420
|
-
const
|
|
5421
|
-
|
|
5423
|
+
const h = f[y];
|
|
5424
|
+
_e(h) || (c[y] = h);
|
|
5422
5425
|
}
|
|
5423
5426
|
} else
|
|
5424
|
-
|
|
5427
|
+
g.forEach((y) => {
|
|
5425
5428
|
if (y === "externalRefId") return;
|
|
5426
|
-
const
|
|
5427
|
-
|
|
5429
|
+
const h = f[y];
|
|
5430
|
+
_e(h) || (c[y] = h);
|
|
5428
5431
|
});
|
|
5429
5432
|
const L = [];
|
|
5430
5433
|
if (m) {
|
|
5431
5434
|
for (const y of m)
|
|
5432
5435
|
if (U(y))
|
|
5433
|
-
for (const
|
|
5434
|
-
if (!
|
|
5435
|
-
const B = P[
|
|
5436
|
+
for (const h of y.fields) {
|
|
5437
|
+
if (!h.isCustom || !h.paramName || h.customType === "paragraph" || h.customType === "br" || h.customType === "link") continue;
|
|
5438
|
+
const B = P[h.paramName] ?? "";
|
|
5436
5439
|
let te;
|
|
5437
|
-
if (
|
|
5440
|
+
if (h.customType === "checkbox" || h.customType === "link_checkbox")
|
|
5438
5441
|
te = B === "true" ? "yes" : "no";
|
|
5439
|
-
else if (te = B, !te && !
|
|
5440
|
-
L.push({ paramName:
|
|
5442
|
+
else if (te = B, !te && !h.required) continue;
|
|
5443
|
+
L.push({ paramName: h.paramName, paramValue: te });
|
|
5441
5444
|
}
|
|
5442
5445
|
}
|
|
5443
5446
|
L.length > 0 && (c.applicantAdditionalDatas = L);
|
|
@@ -5452,84 +5455,84 @@ const _e = {
|
|
|
5452
5455
|
var L;
|
|
5453
5456
|
c.preventDefault();
|
|
5454
5457
|
for (const $ of x)
|
|
5455
|
-
if (
|
|
5456
|
-
const y = ((L =
|
|
5458
|
+
if (_e(f[$])) {
|
|
5459
|
+
const y = ((L = Me[$]) == null ? void 0 : L.label) || $;
|
|
5457
5460
|
q(`${y} is required.`);
|
|
5458
5461
|
return;
|
|
5459
5462
|
}
|
|
5460
|
-
await
|
|
5461
|
-
},
|
|
5462
|
-
var
|
|
5463
|
-
const
|
|
5464
|
-
if (!
|
|
5465
|
-
const B = x.includes(c), te = T[c], ie = $ ||
|
|
5466
|
-
switch (
|
|
5463
|
+
await Ae();
|
|
5464
|
+
}, Je = (c, L, $, y) => {
|
|
5465
|
+
var de;
|
|
5466
|
+
const h = Me[c];
|
|
5467
|
+
if (!h) return null;
|
|
5468
|
+
const B = x.includes(c), te = T[c], ie = $ || h.label, he = L ?? c, xe = { required: B };
|
|
5469
|
+
switch (h.type) {
|
|
5467
5470
|
case "select":
|
|
5468
5471
|
if (c === "country" || c === "nationality" || c === "taxCountry" || c === "countryOfBirth" || c === "mobileCountryCode") {
|
|
5469
|
-
const
|
|
5472
|
+
const oe = E(c, y);
|
|
5470
5473
|
return /* @__PURE__ */ r(
|
|
5471
|
-
|
|
5474
|
+
Ye,
|
|
5472
5475
|
{
|
|
5473
|
-
...
|
|
5476
|
+
...xe,
|
|
5474
5477
|
label: ie,
|
|
5475
5478
|
value: f[c] || "",
|
|
5476
|
-
onChange: (
|
|
5477
|
-
options: [{ value: "", label: `Select ${ie.toLowerCase()}...` }, ...
|
|
5479
|
+
onChange: (Pe) => F(c, Pe),
|
|
5480
|
+
options: [{ value: "", label: `Select ${ie.toLowerCase()}...` }, ...oe],
|
|
5478
5481
|
disabled: A,
|
|
5479
5482
|
error: te
|
|
5480
5483
|
},
|
|
5481
|
-
|
|
5484
|
+
he
|
|
5482
5485
|
);
|
|
5483
5486
|
}
|
|
5484
5487
|
if (c === "salutation")
|
|
5485
5488
|
return /* @__PURE__ */ r(
|
|
5486
|
-
|
|
5489
|
+
Ye,
|
|
5487
5490
|
{
|
|
5488
|
-
...
|
|
5491
|
+
...xe,
|
|
5489
5492
|
label: ie,
|
|
5490
|
-
value: ((
|
|
5491
|
-
onChange: (
|
|
5493
|
+
value: ((de = f[c]) == null ? void 0 : de.toString()) || "",
|
|
5494
|
+
onChange: (oe) => F(c, oe ? Number(oe) : null),
|
|
5492
5495
|
options: [
|
|
5493
5496
|
{ value: "", label: "Select salutation..." },
|
|
5494
|
-
{ value:
|
|
5495
|
-
{ value:
|
|
5496
|
-
{ value:
|
|
5497
|
+
{ value: We.Male.toString(), label: "Male" },
|
|
5498
|
+
{ value: We.Female.toString(), label: "Female" },
|
|
5499
|
+
{ value: We.Other.toString(), label: "Other" }
|
|
5497
5500
|
],
|
|
5498
5501
|
error: te
|
|
5499
5502
|
},
|
|
5500
|
-
|
|
5503
|
+
he
|
|
5501
5504
|
);
|
|
5502
5505
|
if (c === "defaultLanguage") {
|
|
5503
|
-
const
|
|
5506
|
+
const oe = l != null && l.allowedLanguages && l.allowedLanguages.length > 0 ? at.filter((Pe) => l.allowedLanguages.includes(Pe.value)) : at;
|
|
5504
5507
|
return /* @__PURE__ */ r(
|
|
5505
|
-
|
|
5508
|
+
Ye,
|
|
5506
5509
|
{
|
|
5507
|
-
...
|
|
5510
|
+
...xe,
|
|
5508
5511
|
label: ie,
|
|
5509
5512
|
value: f[c] || "",
|
|
5510
|
-
onChange: (
|
|
5511
|
-
options: [{ value: "", label: "Select language..." }, ...
|
|
5513
|
+
onChange: (Pe) => F(c, Pe),
|
|
5514
|
+
options: [{ value: "", label: "Select language..." }, ...oe],
|
|
5512
5515
|
error: te
|
|
5513
5516
|
},
|
|
5514
|
-
|
|
5517
|
+
he
|
|
5515
5518
|
);
|
|
5516
5519
|
}
|
|
5517
5520
|
return null;
|
|
5518
5521
|
case "multiselect":
|
|
5519
5522
|
if (c === "otherNationality") {
|
|
5520
|
-
const
|
|
5523
|
+
const oe = E(c, y);
|
|
5521
5524
|
return /* @__PURE__ */ r(
|
|
5522
5525
|
Sr,
|
|
5523
5526
|
{
|
|
5524
|
-
...
|
|
5527
|
+
...xe,
|
|
5525
5528
|
label: ie,
|
|
5526
5529
|
value: f[c] || [],
|
|
5527
|
-
onChange: (
|
|
5528
|
-
options:
|
|
5530
|
+
onChange: (Pe) => F(c, Pe),
|
|
5531
|
+
options: oe,
|
|
5529
5532
|
placeholder: "Select other nationalities...",
|
|
5530
5533
|
disabled: A
|
|
5531
5534
|
},
|
|
5532
|
-
|
|
5535
|
+
he
|
|
5533
5536
|
);
|
|
5534
5537
|
}
|
|
5535
5538
|
return null;
|
|
@@ -5537,58 +5540,58 @@ const _e = {
|
|
|
5537
5540
|
return /* @__PURE__ */ r(
|
|
5538
5541
|
me,
|
|
5539
5542
|
{
|
|
5540
|
-
...
|
|
5543
|
+
...xe,
|
|
5541
5544
|
type: "date",
|
|
5542
5545
|
label: ie,
|
|
5543
5546
|
value: f[c] || "",
|
|
5544
|
-
onChange: (
|
|
5547
|
+
onChange: (oe) => F(c, oe.target.value),
|
|
5545
5548
|
error: te
|
|
5546
5549
|
},
|
|
5547
|
-
|
|
5550
|
+
he
|
|
5548
5551
|
);
|
|
5549
5552
|
case "email":
|
|
5550
5553
|
return /* @__PURE__ */ r(
|
|
5551
5554
|
me,
|
|
5552
5555
|
{
|
|
5553
|
-
...
|
|
5556
|
+
...xe,
|
|
5554
5557
|
type: "email",
|
|
5555
5558
|
label: ie,
|
|
5556
5559
|
value: f[c] || "",
|
|
5557
|
-
onChange: (
|
|
5560
|
+
onChange: (oe) => F(c, oe.target.value),
|
|
5558
5561
|
error: te
|
|
5559
5562
|
},
|
|
5560
|
-
|
|
5563
|
+
he
|
|
5561
5564
|
);
|
|
5562
5565
|
case "tel":
|
|
5563
5566
|
return /* @__PURE__ */ r(
|
|
5564
5567
|
me,
|
|
5565
5568
|
{
|
|
5566
|
-
...
|
|
5569
|
+
...xe,
|
|
5567
5570
|
type: "tel",
|
|
5568
5571
|
label: ie,
|
|
5569
5572
|
value: f[c] || "",
|
|
5570
|
-
onChange: (
|
|
5573
|
+
onChange: (oe) => F(c, oe.target.value),
|
|
5571
5574
|
error: te
|
|
5572
5575
|
},
|
|
5573
|
-
|
|
5576
|
+
he
|
|
5574
5577
|
);
|
|
5575
5578
|
default:
|
|
5576
5579
|
return /* @__PURE__ */ r(
|
|
5577
5580
|
me,
|
|
5578
5581
|
{
|
|
5579
|
-
...
|
|
5582
|
+
...xe,
|
|
5580
5583
|
type: "text",
|
|
5581
5584
|
label: ie,
|
|
5582
5585
|
value: f[c] || "",
|
|
5583
|
-
onChange: (
|
|
5586
|
+
onChange: (oe) => F(c, oe.target.value),
|
|
5584
5587
|
error: te
|
|
5585
5588
|
},
|
|
5586
|
-
|
|
5589
|
+
he
|
|
5587
5590
|
);
|
|
5588
5591
|
}
|
|
5589
5592
|
}, xt = (c, L) => {
|
|
5590
5593
|
if (c.customType === "paragraph") {
|
|
5591
|
-
const
|
|
5594
|
+
const h = c.displayText || c.label || "";
|
|
5592
5595
|
return /* @__PURE__ */ r(
|
|
5593
5596
|
"p",
|
|
5594
5597
|
{
|
|
@@ -5599,7 +5602,7 @@ const _e = {
|
|
|
5599
5602
|
margin: 0,
|
|
5600
5603
|
color: "var(--metakyc-text-secondary, #6b7280)"
|
|
5601
5604
|
},
|
|
5602
|
-
dangerouslySetInnerHTML: { __html:
|
|
5605
|
+
dangerouslySetInnerHTML: { __html: h }
|
|
5603
5606
|
},
|
|
5604
5607
|
`custom-${L}`
|
|
5605
5608
|
);
|
|
@@ -5607,7 +5610,7 @@ const _e = {
|
|
|
5607
5610
|
if (c.customType === "br")
|
|
5608
5611
|
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${L}`);
|
|
5609
5612
|
if (c.customType === "link") {
|
|
5610
|
-
const
|
|
5613
|
+
const h = c.displayText || c.label || c.linkText || c.linkUrl || "";
|
|
5611
5614
|
return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ s(
|
|
5612
5615
|
"a",
|
|
5613
5616
|
{
|
|
@@ -5624,7 +5627,7 @@ const _e = {
|
|
|
5624
5627
|
cursor: "pointer"
|
|
5625
5628
|
},
|
|
5626
5629
|
children: [
|
|
5627
|
-
|
|
5630
|
+
h,
|
|
5628
5631
|
/* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
|
|
5629
5632
|
]
|
|
5630
5633
|
}
|
|
@@ -5645,9 +5648,9 @@ const _e = {
|
|
|
5645
5648
|
{
|
|
5646
5649
|
type: "checkbox",
|
|
5647
5650
|
checked: P[c.paramName] === "true",
|
|
5648
|
-
onChange: (
|
|
5651
|
+
onChange: (h) => S(c.paramName, h.target.checked ? "true" : "false"),
|
|
5649
5652
|
className: "metakyc-option-input",
|
|
5650
|
-
style:
|
|
5653
|
+
style: He
|
|
5651
5654
|
}
|
|
5652
5655
|
),
|
|
5653
5656
|
/* @__PURE__ */ s(
|
|
@@ -5679,9 +5682,9 @@ const _e = {
|
|
|
5679
5682
|
{
|
|
5680
5683
|
type: "checkbox",
|
|
5681
5684
|
checked: P[c.paramName] === "true",
|
|
5682
|
-
onChange: (
|
|
5685
|
+
onChange: (h) => S(c.paramName, h.target.checked ? "true" : "false"),
|
|
5683
5686
|
className: "metakyc-option-input",
|
|
5684
|
-
style: { ...
|
|
5687
|
+
style: { ...He, alignSelf: "flex-start", marginTop: "2px" }
|
|
5685
5688
|
}
|
|
5686
5689
|
),
|
|
5687
5690
|
/* @__PURE__ */ s(
|
|
@@ -5700,7 +5703,7 @@ const _e = {
|
|
|
5700
5703
|
rel: "noopener noreferrer",
|
|
5701
5704
|
className: "underline",
|
|
5702
5705
|
style: { color: "var(--metakyc-primary, #2563eb)" },
|
|
5703
|
-
onClick: (
|
|
5706
|
+
onClick: (h) => h.stopPropagation(),
|
|
5704
5707
|
children: c.linkText || c.linkUrl
|
|
5705
5708
|
}
|
|
5706
5709
|
),
|
|
@@ -5714,7 +5717,7 @@ const _e = {
|
|
|
5714
5717
|
$ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: $ })
|
|
5715
5718
|
] }, `custom-${L}`);
|
|
5716
5719
|
if (c.customType === "group_checkbox") {
|
|
5717
|
-
const
|
|
5720
|
+
const h = (P[c.paramName] || "").split(",").filter(Boolean);
|
|
5718
5721
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
|
|
5719
5722
|
/* @__PURE__ */ s(
|
|
5720
5723
|
"div",
|
|
@@ -5728,7 +5731,7 @@ const _e = {
|
|
|
5728
5731
|
}
|
|
5729
5732
|
),
|
|
5730
5733
|
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((B) => {
|
|
5731
|
-
const te = c.singleSelect ? P[c.paramName] === B.value :
|
|
5734
|
+
const te = c.singleSelect ? P[c.paramName] === B.value : h.includes(B.value);
|
|
5732
5735
|
return /* @__PURE__ */ s(
|
|
5733
5736
|
"label",
|
|
5734
5737
|
{
|
|
@@ -5744,12 +5747,12 @@ const _e = {
|
|
|
5744
5747
|
if (c.singleSelect)
|
|
5745
5748
|
S(c.paramName, ie.target.checked ? B.value : "");
|
|
5746
5749
|
else {
|
|
5747
|
-
const
|
|
5748
|
-
S(c.paramName,
|
|
5750
|
+
const he = ie.target.checked ? [...h, B.value] : h.filter((xe) => xe !== B.value);
|
|
5751
|
+
S(c.paramName, he.join(","));
|
|
5749
5752
|
}
|
|
5750
5753
|
},
|
|
5751
5754
|
className: "metakyc-option-input",
|
|
5752
|
-
style:
|
|
5755
|
+
style: He
|
|
5753
5756
|
}
|
|
5754
5757
|
),
|
|
5755
5758
|
/* @__PURE__ */ r(
|
|
@@ -5780,7 +5783,7 @@ const _e = {
|
|
|
5780
5783
|
]
|
|
5781
5784
|
}
|
|
5782
5785
|
),
|
|
5783
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((
|
|
5786
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((h) => /* @__PURE__ */ s(
|
|
5784
5787
|
"label",
|
|
5785
5788
|
{
|
|
5786
5789
|
className: "metakyc-option-label",
|
|
@@ -5790,11 +5793,11 @@ const _e = {
|
|
|
5790
5793
|
"input",
|
|
5791
5794
|
{
|
|
5792
5795
|
type: "radio",
|
|
5793
|
-
checked: P[c.paramName] ===
|
|
5794
|
-
onChange: () => S(c.paramName,
|
|
5796
|
+
checked: P[c.paramName] === h.value,
|
|
5797
|
+
onChange: () => S(c.paramName, h.value),
|
|
5795
5798
|
name: `radio-group-${c.paramName}-${L}`,
|
|
5796
5799
|
className: "metakyc-option-input",
|
|
5797
|
-
style:
|
|
5800
|
+
style: He
|
|
5798
5801
|
}
|
|
5799
5802
|
),
|
|
5800
5803
|
/* @__PURE__ */ r(
|
|
@@ -5802,12 +5805,12 @@ const _e = {
|
|
|
5802
5805
|
{
|
|
5803
5806
|
className: "metakyc-option-text",
|
|
5804
5807
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5805
|
-
children:
|
|
5808
|
+
children: h.label
|
|
5806
5809
|
}
|
|
5807
5810
|
)
|
|
5808
5811
|
]
|
|
5809
5812
|
},
|
|
5810
|
-
|
|
5813
|
+
h.value
|
|
5811
5814
|
)) }),
|
|
5812
5815
|
$ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: $ })
|
|
5813
5816
|
] }, `custom-${L}`) : /* @__PURE__ */ r(
|
|
@@ -5816,7 +5819,7 @@ const _e = {
|
|
|
5816
5819
|
type: "text",
|
|
5817
5820
|
label: `${y}${c.required ? " *" : ""}`,
|
|
5818
5821
|
value: P[c.paramName] || "",
|
|
5819
|
-
onChange: (
|
|
5822
|
+
onChange: (h) => S(c.paramName, h.target.value),
|
|
5820
5823
|
required: c.required,
|
|
5821
5824
|
error: $
|
|
5822
5825
|
},
|
|
@@ -5838,7 +5841,7 @@ const _e = {
|
|
|
5838
5841
|
checked: $,
|
|
5839
5842
|
onChange: (y) => S(c.conditionalOn, y.target.checked ? "true" : "false"),
|
|
5840
5843
|
className: "metakyc-option-input",
|
|
5841
|
-
style:
|
|
5844
|
+
style: He
|
|
5842
5845
|
}
|
|
5843
5846
|
),
|
|
5844
5847
|
/* @__PURE__ */ r(
|
|
@@ -5852,21 +5855,21 @@ const _e = {
|
|
|
5852
5855
|
]
|
|
5853
5856
|
}
|
|
5854
5857
|
) }),
|
|
5855
|
-
$ && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: c.fields.map((y,
|
|
5856
|
-
const B = y.colSpan === 1 ? "col-span-1" : y.colSpan === 2 ? "col-span-2" : y.colSpan === 3 ? "col-span-3" : "col-span-4", te = y.isCustom ? `custom-${
|
|
5857
|
-
return /* @__PURE__ */ r("div", { className: B, children: /* @__PURE__ */ r(ct, { helpText: y.helpText, children: y.isCustom ? xt(y,
|
|
5858
|
+
$ && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: c.fields.map((y, h) => {
|
|
5859
|
+
const B = y.colSpan === 1 ? "col-span-1" : y.colSpan === 2 ? "col-span-2" : y.colSpan === 3 ? "col-span-3" : "col-span-4", te = y.isCustom ? `custom-${h}-${y.paramName}` : `builtin-${y.name}-${h}`;
|
|
5860
|
+
return /* @__PURE__ */ r("div", { className: B, children: /* @__PURE__ */ r(ct, { helpText: y.helpText, children: y.isCustom ? xt(y, h) : Je(y.name, te, y.displayText, y.countriesType) }) }, te);
|
|
5858
5861
|
}) })
|
|
5859
5862
|
] });
|
|
5860
5863
|
};
|
|
5861
5864
|
if (!l || A)
|
|
5862
5865
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
|
|
5863
|
-
/* @__PURE__ */ r(
|
|
5866
|
+
/* @__PURE__ */ r(ke, { className: "my-8" }),
|
|
5864
5867
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
5865
5868
|
] }) }) });
|
|
5866
5869
|
if (m) {
|
|
5867
|
-
const c = m[H] ?? m[0], L = Y === -1, $ = X === -1, y = m.length,
|
|
5870
|
+
const c = m[H] ?? m[0], L = Y === -1, $ = X === -1, y = m.length, h = U(c), B = Object.values(T);
|
|
5868
5871
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(K, { children: [
|
|
5869
|
-
/* @__PURE__ */ r(
|
|
5872
|
+
/* @__PURE__ */ r(ce, { children: /* @__PURE__ */ r(Ve, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
|
|
5870
5873
|
/* @__PURE__ */ s(W, { children: [
|
|
5871
5874
|
(c.title || c.subtitle || c.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
5872
5875
|
c.title && /* @__PURE__ */ r(
|
|
@@ -5940,22 +5943,22 @@ const _e = {
|
|
|
5940
5943
|
{
|
|
5941
5944
|
type: "button",
|
|
5942
5945
|
isLoading: re || u,
|
|
5943
|
-
onClick: $ ?
|
|
5944
|
-
children: $ ? c.conditionalOn && !
|
|
5946
|
+
onClick: $ ? Ae : we,
|
|
5947
|
+
children: $ ? c.conditionalOn && !h ? "Skip & Submit" : "Submit" : c.conditionalOn && !h ? "Skip" : "Next"
|
|
5945
5948
|
}
|
|
5946
5949
|
)
|
|
5947
5950
|
] })
|
|
5948
5951
|
] }) });
|
|
5949
5952
|
}
|
|
5950
5953
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: ft, children: /* @__PURE__ */ s(K, { children: [
|
|
5951
|
-
/* @__PURE__ */ r(
|
|
5954
|
+
/* @__PURE__ */ r(ce, { children: /* @__PURE__ */ r(Ve, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
|
|
5952
5955
|
/* @__PURE__ */ s(W, { children: [
|
|
5953
5956
|
w && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
|
|
5954
5957
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
5955
5958
|
" ",
|
|
5956
5959
|
w
|
|
5957
5960
|
] }) }),
|
|
5958
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children:
|
|
5961
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: g.map((c) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Je(c) }, c)) })
|
|
5959
5962
|
] }),
|
|
5960
5963
|
/* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
|
|
5961
5964
|
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: re || u, children: "Cancel" }),
|
|
@@ -5979,19 +5982,19 @@ const _e = {
|
|
|
5979
5982
|
isLoading: N,
|
|
5980
5983
|
error: m,
|
|
5981
5984
|
moveBack: x,
|
|
5982
|
-
refreshProgress:
|
|
5983
|
-
} = fr(e), [C, D] =
|
|
5984
|
-
if (
|
|
5985
|
+
refreshProgress: g
|
|
5986
|
+
} = fr(e), [C, D] = ye.useState(!1);
|
|
5987
|
+
if (ye.useEffect(() => {
|
|
5985
5988
|
m && n && n(m);
|
|
5986
|
-
}, [m, n]),
|
|
5989
|
+
}, [m, n]), ye.useEffect(() => {
|
|
5987
5990
|
o != null && o.workflowResult && t && t(o.workflowResult);
|
|
5988
|
-
}, [o == null ? void 0 : o.workflowResult, t]),
|
|
5991
|
+
}, [o == null ? void 0 : o.workflowResult, t]), ye.useEffect(() => {
|
|
5989
5992
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
5990
|
-
}, [a]),
|
|
5993
|
+
}, [a]), ye.useEffect(() => {
|
|
5991
5994
|
b && D(!1);
|
|
5992
5995
|
}, [b]), N || !o)
|
|
5993
5996
|
return /* @__PURE__ */ r("div", { className: i, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
|
|
5994
|
-
/* @__PURE__ */ r(
|
|
5997
|
+
/* @__PURE__ */ r(ke, { className: "my-8" }),
|
|
5995
5998
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
5996
5999
|
] }) }) });
|
|
5997
6000
|
if (m)
|
|
@@ -6027,7 +6030,7 @@ const _e = {
|
|
|
6027
6030
|
}
|
|
6028
6031
|
)
|
|
6029
6032
|
] }) }) }) });
|
|
6030
|
-
if (o.status ===
|
|
6033
|
+
if (o.status === ve.Finished || o.status === ve.OnHold)
|
|
6031
6034
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(
|
|
6032
6035
|
lt,
|
|
6033
6036
|
{
|
|
@@ -6043,8 +6046,8 @@ const _e = {
|
|
|
6043
6046
|
) });
|
|
6044
6047
|
if (!l)
|
|
6045
6048
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
|
|
6046
|
-
/* @__PURE__ */ r(
|
|
6047
|
-
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: o.status ===
|
|
6049
|
+
/* @__PURE__ */ r(ke, { className: "my-8" }),
|
|
6050
|
+
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: o.status === ve.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
6048
6051
|
] }) }) });
|
|
6049
6052
|
const k = (I) => {
|
|
6050
6053
|
switch (I) {
|
|
@@ -6073,8 +6076,8 @@ const _e = {
|
|
|
6073
6076
|
const I = d.filter((f) => f.visibility !== !1), j = I.findIndex((f) => f.order === l.order), G = j >= 0 ? j + 1 : 1, E = I.length;
|
|
6074
6077
|
return /* @__PURE__ */ s("div", { className: "mb-6", children: [
|
|
6075
6078
|
/* @__PURE__ */ s("div", { className: "flex items-start justify-between mb-4", children: [
|
|
6076
|
-
/* @__PURE__ */ r(
|
|
6077
|
-
/* @__PURE__ */ s(
|
|
6079
|
+
/* @__PURE__ */ r(Ve, {}),
|
|
6080
|
+
/* @__PURE__ */ s(Ee, { variant: o.status === 1 ? "info" : "success", children: [
|
|
6078
6081
|
"Step ",
|
|
6079
6082
|
G,
|
|
6080
6083
|
" of ",
|
|
@@ -6083,7 +6086,7 @@ const _e = {
|
|
|
6083
6086
|
] }),
|
|
6084
6087
|
/* @__PURE__ */ r("div", { className: "flex items-center", children: I.map((f, R) => {
|
|
6085
6088
|
const P = R < j, O = f.order === l.order;
|
|
6086
|
-
return /* @__PURE__ */ s(
|
|
6089
|
+
return /* @__PURE__ */ s(ye.Fragment, { children: [
|
|
6087
6090
|
/* @__PURE__ */ s("div", { className: "flex items-center", children: [
|
|
6088
6091
|
/* @__PURE__ */ r(
|
|
6089
6092
|
"div",
|
|
@@ -6116,7 +6119,7 @@ const _e = {
|
|
|
6116
6119
|
const I = {
|
|
6117
6120
|
applicantId: e,
|
|
6118
6121
|
onComplete: async () => {
|
|
6119
|
-
await
|
|
6122
|
+
await g();
|
|
6120
6123
|
},
|
|
6121
6124
|
onBack: l.order > 0 ? x : void 0
|
|
6122
6125
|
};
|
|
@@ -6148,7 +6151,7 @@ const _e = {
|
|
|
6148
6151
|
);
|
|
6149
6152
|
default:
|
|
6150
6153
|
return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { className: "py-12 text-center", children: [
|
|
6151
|
-
/* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(
|
|
6154
|
+
/* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(ke, {}) }),
|
|
6152
6155
|
/* @__PURE__ */ s("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
6153
6156
|
"Processing step: ",
|
|
6154
6157
|
l.title || l.name
|
|
@@ -6166,12 +6169,12 @@ const _e = {
|
|
|
6166
6169
|
] });
|
|
6167
6170
|
};
|
|
6168
6171
|
function yn(e) {
|
|
6169
|
-
return
|
|
6170
|
-
questionResults:
|
|
6172
|
+
return Ce.object({
|
|
6173
|
+
questionResults: Ce.any()
|
|
6171
6174
|
}).passthrough();
|
|
6172
6175
|
}
|
|
6173
6176
|
function Gr(e) {
|
|
6174
|
-
let t =
|
|
6177
|
+
let t = Ce.array(Ce.instanceof(File));
|
|
6175
6178
|
if (e.isRequired ? t = t.min(
|
|
6176
6179
|
1,
|
|
6177
6180
|
`${e.displayName} is required`
|
|
@@ -6197,68 +6200,68 @@ function fn(e) {
|
|
|
6197
6200
|
return e.uploadDocumentFiles.forEach((n) => {
|
|
6198
6201
|
const a = `file_${n.id}`;
|
|
6199
6202
|
t[a] = Gr(n);
|
|
6200
|
-
}),
|
|
6203
|
+
}), Ce.object(t);
|
|
6201
6204
|
}
|
|
6202
6205
|
function xn(e) {
|
|
6203
|
-
return
|
|
6206
|
+
return Ce.any();
|
|
6204
6207
|
}
|
|
6205
6208
|
function Vr(e) {
|
|
6206
|
-
return
|
|
6209
|
+
return Ce.string().min(1, "This question is required");
|
|
6207
6210
|
}
|
|
6208
6211
|
function bn(e) {
|
|
6209
6212
|
const t = {};
|
|
6210
6213
|
return e.appropriatenessQuestions.forEach((n) => {
|
|
6211
6214
|
const a = `question_${n.id}`;
|
|
6212
6215
|
t[a] = Vr();
|
|
6213
|
-
}),
|
|
6216
|
+
}), Ce.object(t);
|
|
6214
6217
|
}
|
|
6215
|
-
const vn =
|
|
6218
|
+
const vn = Ce.any();
|
|
6216
6219
|
export {
|
|
6217
6220
|
at as ALLOWED_LANGUAGES,
|
|
6218
6221
|
At as ApplicantProgressOnHoldReason,
|
|
6219
|
-
|
|
6222
|
+
ve as ApplicantProgressStatus,
|
|
6220
6223
|
Ht as ApplicantService,
|
|
6221
6224
|
It as ApplicantStatus,
|
|
6222
6225
|
Lt as AppropriatenessQuestionType,
|
|
6223
6226
|
qt as AppropriatenessTestService,
|
|
6224
6227
|
Wr as AppropriatenessTestStep,
|
|
6225
|
-
|
|
6228
|
+
Ee as Badge,
|
|
6226
6229
|
Qt as BaseInformationService,
|
|
6227
6230
|
Z as Button,
|
|
6228
6231
|
K as Card,
|
|
6229
6232
|
W as CardContent,
|
|
6230
6233
|
pe as CardFooter,
|
|
6231
|
-
|
|
6232
|
-
|
|
6234
|
+
ce as CardHeader,
|
|
6235
|
+
Te as CountriesType,
|
|
6233
6236
|
hn as CreateApplicantForm,
|
|
6234
6237
|
Mt as CriteriaBuiltInType,
|
|
6235
6238
|
zt as DEFAULT_VISIBLE_FIELDS,
|
|
6236
6239
|
Ft as DocumentReviewStatus,
|
|
6237
6240
|
Bt as EndpointBuilder,
|
|
6238
|
-
|
|
6241
|
+
$e as ErrorHandler,
|
|
6239
6242
|
nr as EventEmitter,
|
|
6240
|
-
|
|
6243
|
+
Me as FIELD_METADATA,
|
|
6241
6244
|
Dt as FileType,
|
|
6242
6245
|
Cr as FileUpload,
|
|
6243
|
-
|
|
6244
|
-
|
|
6246
|
+
We as GenderType,
|
|
6247
|
+
Ve as Header,
|
|
6245
6248
|
_t as HttpClient,
|
|
6246
|
-
|
|
6249
|
+
Oe as IdentityProviderManager,
|
|
6247
6250
|
Yt as IdentityService,
|
|
6248
|
-
|
|
6251
|
+
be as IdentityVerificationProvider,
|
|
6249
6252
|
Yr as IdentityVerificationStep,
|
|
6250
6253
|
me as Input,
|
|
6251
6254
|
Gt as InvestorCategorizationService,
|
|
6252
6255
|
Kr as InvestorCategorizationStep,
|
|
6253
|
-
|
|
6256
|
+
ge as InvestorCategorizationType,
|
|
6254
6257
|
Ot as InvestorCategoryType,
|
|
6255
6258
|
Rt as KycProcessStatus,
|
|
6256
|
-
|
|
6259
|
+
Fe as KycStatus,
|
|
6257
6260
|
lt as KycStatusDisplay,
|
|
6258
6261
|
gn as KycWorkflow,
|
|
6259
6262
|
Qr as Logo,
|
|
6260
6263
|
mt as MetaKYCContext,
|
|
6261
|
-
|
|
6264
|
+
Se as MetaKYCError,
|
|
6262
6265
|
on as MetaKYCProvider,
|
|
6263
6266
|
Sr as MultiSelect,
|
|
6264
6267
|
lr as OnfidoProvider,
|
|
@@ -6267,46 +6270,46 @@ export {
|
|
|
6267
6270
|
Ar as PhoneInput,
|
|
6268
6271
|
Ut as QuestionnaireService,
|
|
6269
6272
|
Or as QuestionnaireStep,
|
|
6270
|
-
|
|
6273
|
+
Le as ReviewStatus,
|
|
6271
6274
|
Tt as RiskCriteriaType,
|
|
6272
6275
|
Et as RiskLevel,
|
|
6273
6276
|
Wt as RiskScoringService,
|
|
6274
6277
|
jr as RiskScoringStep,
|
|
6275
6278
|
cr as SardinAIProvider,
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
+
Ye as SearchableSelect,
|
|
6280
|
+
Ue as Select,
|
|
6281
|
+
ke as Spinner,
|
|
6279
6282
|
ir as StepRouter,
|
|
6280
6283
|
or as SumsubProvider,
|
|
6281
6284
|
dr as ThemeManager,
|
|
6282
|
-
|
|
6285
|
+
le as ThemePreset,
|
|
6283
6286
|
rr as ThemeService,
|
|
6284
6287
|
jt as UploadDocumentService,
|
|
6285
6288
|
$r as UploadDocumentStep,
|
|
6286
6289
|
Pt as UserType,
|
|
6287
|
-
|
|
6290
|
+
Re as ValueDataType,
|
|
6288
6291
|
sr as WorkflowOrchestrator,
|
|
6289
|
-
|
|
6292
|
+
Ke as WorkflowResultType,
|
|
6290
6293
|
ar as WorkflowState,
|
|
6291
6294
|
V as WorkflowStepAction,
|
|
6292
6295
|
vn as appropriatenessTestSchema,
|
|
6293
6296
|
mn as clearAllStorage,
|
|
6294
6297
|
hr as clearApplicantId,
|
|
6295
6298
|
yr as clearWorkflowState,
|
|
6296
|
-
|
|
6299
|
+
se as cn,
|
|
6297
6300
|
Vt as corporateTheme,
|
|
6298
6301
|
$t as defaultConfig,
|
|
6299
6302
|
ue as defaultTheme,
|
|
6300
6303
|
ur as fileToBase64,
|
|
6301
6304
|
Zt as fintechTheme,
|
|
6302
|
-
|
|
6305
|
+
Qe as formatFileSize,
|
|
6303
6306
|
bn as generateAppropriatenessSchema,
|
|
6304
6307
|
yn as generateQuestionnaireSchema,
|
|
6305
6308
|
xn as generateRiskScoringSchema,
|
|
6306
6309
|
fn as generateUploadDocumentSchema,
|
|
6307
6310
|
dn as getAcceptString,
|
|
6308
6311
|
pr as getApplicantId,
|
|
6309
|
-
|
|
6312
|
+
Be as getThemePreset,
|
|
6310
6313
|
un as getWorkflowState,
|
|
6311
6314
|
Jt as healthcareTheme,
|
|
6312
6315
|
an as isScriptLoaded,
|
|
@@ -6321,7 +6324,7 @@ export {
|
|
|
6321
6324
|
pn as useAppropriatenessTest,
|
|
6322
6325
|
kr as useIdentityVerification,
|
|
6323
6326
|
fr as useKycWorkflow,
|
|
6324
|
-
|
|
6327
|
+
fe as useMetaKYC,
|
|
6325
6328
|
vr as useOverview,
|
|
6326
6329
|
xr as useQuestionnaire,
|
|
6327
6330
|
wr as useRiskScoring,
|