@vpdev2/metakyc-sdk 1.0.44 → 1.0.45
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 +17 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1106 -1088
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import { jsx as a, jsxs as i, Fragment as
|
|
8
|
-
import { useForm as
|
|
9
|
-
import { z as
|
|
10
|
-
var
|
|
11
|
-
const
|
|
1
|
+
var lt = Object.defineProperty;
|
|
2
|
+
var ot = (e, t, r) => t in e ? lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var V = (e, t, r) => ot(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import ct from "axios";
|
|
5
|
+
import * as Ze from "react";
|
|
6
|
+
import ge, { createContext as dt, useState as x, useMemo as ke, useEffect as X, useContext as ut, useRef as J, useCallback as Y, forwardRef as $e, createElement as We } from "react";
|
|
7
|
+
import { jsx as a, jsxs as i, Fragment as mt } from "react/jsx-runtime";
|
|
8
|
+
import { useForm as pt, Controller as Ie } from "react-hook-form";
|
|
9
|
+
import { z as Ne } from "zod";
|
|
10
|
+
var _ = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(_ || {}), _e = /* @__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))(_e || {}), fe = /* @__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))(fe || {}), ht = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(ht || {}), gt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(gt || {}), Ee = /* @__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))(Ee || {}), Re = /* @__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))(Re || {}), yt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(yt || {}), ft = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(ft || {}), ye = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(ye || {}), xt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(xt || {}), Ue = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ue || {}), bt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(bt || {}), vt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(vt || {}), wt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(wt || {}), Ce = /* @__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))(Ce || {}), kt = /* @__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))(kt || {}), Nt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Nt || {}), pe = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(pe || {}), St = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(St || {});
|
|
11
|
+
const Ke = {
|
|
12
12
|
firstName: { label: "First Name", type: "text" },
|
|
13
13
|
lastName: { label: "Last Name", type: "text" },
|
|
14
14
|
email: { label: "Email", type: "email" },
|
|
@@ -31,13 +31,13 @@ const _e = {
|
|
|
31
31
|
defaultLanguage: { label: "Default Language", type: "select" },
|
|
32
32
|
educationLevel: { label: "Education Level", type: "text" },
|
|
33
33
|
occupation: { label: "Occupation", type: "text" }
|
|
34
|
-
},
|
|
34
|
+
}, Ct = [
|
|
35
35
|
"firstName",
|
|
36
36
|
"lastName",
|
|
37
37
|
"email",
|
|
38
38
|
"phonenumber",
|
|
39
39
|
"dateOfBirth"
|
|
40
|
-
],
|
|
40
|
+
], Je = [
|
|
41
41
|
{ value: "EN", label: "English" },
|
|
42
42
|
{ value: "DE", label: "German" },
|
|
43
43
|
{ value: "FR", label: "French" },
|
|
@@ -57,7 +57,7 @@ const _e = {
|
|
|
57
57
|
{ value: "NO", label: "Norwegian" }
|
|
58
58
|
];
|
|
59
59
|
var se = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(se || {});
|
|
60
|
-
const
|
|
60
|
+
const At = {
|
|
61
61
|
timeout: 3e4,
|
|
62
62
|
retries: 3,
|
|
63
63
|
locale: "en",
|
|
@@ -65,7 +65,7 @@ const kt = {
|
|
|
65
65
|
pattern: "host-controller"
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
class
|
|
68
|
+
class It {
|
|
69
69
|
constructor(t) {
|
|
70
70
|
this.config = t;
|
|
71
71
|
}
|
|
@@ -108,11 +108,11 @@ class Nt {
|
|
|
108
108
|
class we extends Error {
|
|
109
109
|
constructor(r, n, s, l, o) {
|
|
110
110
|
super(r);
|
|
111
|
-
|
|
111
|
+
V(this, "response");
|
|
112
112
|
this.code = n, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = o, Object.setPrototypeOf(this, we.prototype);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
class
|
|
115
|
+
class Te {
|
|
116
116
|
/**
|
|
117
117
|
* Process an error from the API response
|
|
118
118
|
*/
|
|
@@ -162,12 +162,12 @@ class Le {
|
|
|
162
162
|
return t instanceof we;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
class
|
|
165
|
+
class Et {
|
|
166
166
|
constructor(t) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
this.config = { ...
|
|
167
|
+
V(this, "axiosInstance");
|
|
168
|
+
V(this, "endpointBuilder");
|
|
169
|
+
V(this, "config");
|
|
170
|
+
this.config = { ...At, ...t }, this.endpointBuilder = new It(this.config.endpoints), this.axiosInstance = ct.create({
|
|
171
171
|
baseURL: this.config.baseUrl,
|
|
172
172
|
timeout: this.config.timeout,
|
|
173
173
|
headers: {
|
|
@@ -203,7 +203,7 @@ class St {
|
|
|
203
203
|
});
|
|
204
204
|
return this.handleResponse(l);
|
|
205
205
|
} catch (s) {
|
|
206
|
-
throw
|
|
206
|
+
throw Te.handleAxiosError(s);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
@@ -214,7 +214,7 @@ class St {
|
|
|
214
214
|
const s = this.buildEndpoint(t, r), l = await this.axiosInstance.post(s, n);
|
|
215
215
|
return this.handleResponse(l);
|
|
216
216
|
} catch (s) {
|
|
217
|
-
throw
|
|
217
|
+
throw Te.handleAxiosError(s);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
@@ -225,7 +225,7 @@ class St {
|
|
|
225
225
|
const s = this.buildEndpoint(t, r), l = await this.axiosInstance.put(s, n);
|
|
226
226
|
return this.handleResponse(l);
|
|
227
227
|
} catch (s) {
|
|
228
|
-
throw
|
|
228
|
+
throw Te.handleAxiosError(s);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
/**
|
|
@@ -238,7 +238,7 @@ class St {
|
|
|
238
238
|
});
|
|
239
239
|
return this.handleResponse(l);
|
|
240
240
|
} catch (s) {
|
|
241
|
-
throw
|
|
241
|
+
throw Te.handleAxiosError(s);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
@@ -247,7 +247,7 @@ class St {
|
|
|
247
247
|
handleResponse(t) {
|
|
248
248
|
const r = t.data;
|
|
249
249
|
if (!r.success && r.error)
|
|
250
|
-
throw
|
|
250
|
+
throw Te.handleApiError(r.error);
|
|
251
251
|
return r;
|
|
252
252
|
}
|
|
253
253
|
/**
|
|
@@ -257,7 +257,7 @@ class St {
|
|
|
257
257
|
return this.axiosInstance;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
class
|
|
260
|
+
class Rt {
|
|
261
261
|
constructor(t) {
|
|
262
262
|
this.httpClient = t;
|
|
263
263
|
}
|
|
@@ -376,7 +376,7 @@ class Ct {
|
|
|
376
376
|
)).result;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
class
|
|
379
|
+
class Ft {
|
|
380
380
|
constructor(t) {
|
|
381
381
|
this.httpClient = t;
|
|
382
382
|
}
|
|
@@ -403,7 +403,7 @@ class At {
|
|
|
403
403
|
)).result;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
class
|
|
406
|
+
class Dt {
|
|
407
407
|
constructor(t) {
|
|
408
408
|
this.httpClient = t;
|
|
409
409
|
}
|
|
@@ -431,7 +431,7 @@ class It {
|
|
|
431
431
|
await this.httpClient.post("UploadDocument", "ReviewUploadDocument", t);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
class
|
|
434
|
+
class Pt {
|
|
435
435
|
constructor(t) {
|
|
436
436
|
this.httpClient = t;
|
|
437
437
|
}
|
|
@@ -457,7 +457,7 @@ class Et {
|
|
|
457
457
|
)).result;
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
class
|
|
460
|
+
class Lt {
|
|
461
461
|
constructor(t) {
|
|
462
462
|
this.httpClient = t;
|
|
463
463
|
}
|
|
@@ -479,7 +479,7 @@ class Rt {
|
|
|
479
479
|
await this.httpClient.get("Applicant", "PassOverview", { applicantId: t });
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
class
|
|
482
|
+
class Mt {
|
|
483
483
|
constructor(t) {
|
|
484
484
|
this.httpClient = t;
|
|
485
485
|
}
|
|
@@ -514,7 +514,7 @@ class Ft {
|
|
|
514
514
|
)).result;
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
class
|
|
517
|
+
class Tt {
|
|
518
518
|
constructor(t) {
|
|
519
519
|
this.httpClient = t;
|
|
520
520
|
}
|
|
@@ -569,7 +569,7 @@ class Dt {
|
|
|
569
569
|
return this.identityCompanyRequest(r);
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
class
|
|
572
|
+
class Ot {
|
|
573
573
|
constructor(t) {
|
|
574
574
|
this.httpClient = t;
|
|
575
575
|
}
|
|
@@ -605,7 +605,7 @@ class Pt {
|
|
|
605
605
|
)).result;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
class
|
|
608
|
+
class $t {
|
|
609
609
|
constructor(t) {
|
|
610
610
|
this.httpClient = t;
|
|
611
611
|
}
|
|
@@ -690,7 +690,7 @@ const de = {
|
|
|
690
690
|
textMuted: "#9ca3af"
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
|
-
},
|
|
693
|
+
}, Bt = {
|
|
694
694
|
name: "Corporate",
|
|
695
695
|
logo: {
|
|
696
696
|
url: "",
|
|
@@ -723,7 +723,7 @@ const de = {
|
|
|
723
723
|
cardPadding: "1.5rem",
|
|
724
724
|
inputHeight: "2.5rem"
|
|
725
725
|
}
|
|
726
|
-
},
|
|
726
|
+
}, zt = {
|
|
727
727
|
name: "Fintech",
|
|
728
728
|
logo: {
|
|
729
729
|
url: "",
|
|
@@ -756,7 +756,7 @@ const de = {
|
|
|
756
756
|
cardPadding: "2rem",
|
|
757
757
|
inputHeight: "3rem"
|
|
758
758
|
}
|
|
759
|
-
},
|
|
759
|
+
}, _t = {
|
|
760
760
|
name: "Healthcare",
|
|
761
761
|
logo: {
|
|
762
762
|
url: "",
|
|
@@ -798,7 +798,7 @@ const de = {
|
|
|
798
798
|
textSecondary: "#CBD5E1"
|
|
799
799
|
}
|
|
800
800
|
}
|
|
801
|
-
},
|
|
801
|
+
}, Ut = {
|
|
802
802
|
name: "Modern",
|
|
803
803
|
logo: {
|
|
804
804
|
url: "",
|
|
@@ -831,7 +831,7 @@ const de = {
|
|
|
831
831
|
cardPadding: "2rem",
|
|
832
832
|
inputHeight: "3rem"
|
|
833
833
|
}
|
|
834
|
-
},
|
|
834
|
+
}, qt = {
|
|
835
835
|
name: "Minimal",
|
|
836
836
|
logo: {
|
|
837
837
|
url: "",
|
|
@@ -864,18 +864,18 @@ const de = {
|
|
|
864
864
|
cardPadding: "1.25rem",
|
|
865
865
|
inputHeight: "2.25rem"
|
|
866
866
|
}
|
|
867
|
-
},
|
|
867
|
+
}, Kt = {
|
|
868
868
|
[se.Default]: de,
|
|
869
|
-
[se.Corporate]:
|
|
870
|
-
[se.Fintech]:
|
|
871
|
-
[se.Healthcare]:
|
|
872
|
-
[se.Modern]:
|
|
873
|
-
[se.Minimal]:
|
|
869
|
+
[se.Corporate]: Bt,
|
|
870
|
+
[se.Fintech]: zt,
|
|
871
|
+
[se.Healthcare]: _t,
|
|
872
|
+
[se.Modern]: Ut,
|
|
873
|
+
[se.Minimal]: qt
|
|
874
874
|
};
|
|
875
|
-
function
|
|
876
|
-
return
|
|
875
|
+
function Oe(e) {
|
|
876
|
+
return Kt[e] || de;
|
|
877
877
|
}
|
|
878
|
-
class
|
|
878
|
+
class jt {
|
|
879
879
|
constructor(t) {
|
|
880
880
|
this.httpClient = t;
|
|
881
881
|
}
|
|
@@ -890,8 +890,8 @@ class _t {
|
|
|
890
890
|
"GetThemeConfiguration"
|
|
891
891
|
);
|
|
892
892
|
if (!r.result.isEnabled)
|
|
893
|
-
return
|
|
894
|
-
let n = r.result.preset ?
|
|
893
|
+
return Oe(se.Default);
|
|
894
|
+
let n = r.result.preset ? Oe(r.result.preset) : Oe(se.Default);
|
|
895
895
|
if (r.result.title && (n.title = r.result.title), r.result.logo && (n.logo = { ...n.logo, ...r.result.logo }), r.result.colors && (n.colors = { ...n.colors, ...r.result.colors }), r.result.typography && (n.typography = { ...n.typography, ...r.result.typography }), r.result.spacing && (n.spacing = { ...n.spacing, ...r.result.spacing }), r.result.customCSS && (n.customCSS = r.result.customCSS), r.result.darkMode && (n.darkMode = {
|
|
896
896
|
colors: {
|
|
897
897
|
...(t = n.darkMode) == null ? void 0 : t.colors,
|
|
@@ -905,7 +905,7 @@ class _t {
|
|
|
905
905
|
}
|
|
906
906
|
return n;
|
|
907
907
|
} catch (r) {
|
|
908
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", r),
|
|
908
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), Oe(se.Default);
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
/**
|
|
@@ -931,7 +931,7 @@ class _t {
|
|
|
931
931
|
* Preview theme (doesn't save)
|
|
932
932
|
*/
|
|
933
933
|
getPreviewTheme(t, r) {
|
|
934
|
-
const n =
|
|
934
|
+
const n = Oe(t);
|
|
935
935
|
return r ? {
|
|
936
936
|
...n,
|
|
937
937
|
...r,
|
|
@@ -942,9 +942,9 @@ class _t {
|
|
|
942
942
|
} : n;
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
class
|
|
945
|
+
class Ht {
|
|
946
946
|
constructor() {
|
|
947
|
-
|
|
947
|
+
V(this, "listeners", /* @__PURE__ */ new Map());
|
|
948
948
|
}
|
|
949
949
|
/**
|
|
950
950
|
* Subscribe to an event
|
|
@@ -987,12 +987,12 @@ class Ut {
|
|
|
987
987
|
this.listeners.delete(t);
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
|
-
class
|
|
990
|
+
class Wt {
|
|
991
991
|
constructor() {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
992
|
+
V(this, "events", new Ht());
|
|
993
|
+
V(this, "_applicantId", null);
|
|
994
|
+
V(this, "_progress", null);
|
|
995
|
+
V(this, "_error", null);
|
|
996
996
|
}
|
|
997
997
|
/**
|
|
998
998
|
* Get current applicant ID
|
|
@@ -1025,7 +1025,7 @@ class qt {
|
|
|
1025
1025
|
*/
|
|
1026
1026
|
get status() {
|
|
1027
1027
|
var t;
|
|
1028
|
-
return ((t = this._progress) == null ? void 0 : t.status) ||
|
|
1028
|
+
return ((t = this._progress) == null ? void 0 : t.status) || fe.None;
|
|
1029
1029
|
}
|
|
1030
1030
|
/**
|
|
1031
1031
|
* Get workflow result
|
|
@@ -1044,19 +1044,19 @@ class qt {
|
|
|
1044
1044
|
* Check if workflow is complete
|
|
1045
1045
|
*/
|
|
1046
1046
|
get isComplete() {
|
|
1047
|
-
return this.status ===
|
|
1047
|
+
return this.status === fe.Finished;
|
|
1048
1048
|
}
|
|
1049
1049
|
/**
|
|
1050
1050
|
* Check if workflow is on hold
|
|
1051
1051
|
*/
|
|
1052
1052
|
get isOnHold() {
|
|
1053
|
-
return this.status ===
|
|
1053
|
+
return this.status === fe.OnHold;
|
|
1054
1054
|
}
|
|
1055
1055
|
/**
|
|
1056
1056
|
* Check if workflow is in progress
|
|
1057
1057
|
*/
|
|
1058
1058
|
get isInProgress() {
|
|
1059
|
-
return this.status ===
|
|
1059
|
+
return this.status === fe.InProgress;
|
|
1060
1060
|
}
|
|
1061
1061
|
/**
|
|
1062
1062
|
* Set applicant ID
|
|
@@ -1070,7 +1070,7 @@ class qt {
|
|
|
1070
1070
|
updateProgress(t) {
|
|
1071
1071
|
var n, s;
|
|
1072
1072
|
const r = (n = this._progress) == null ? void 0 : n.currentStep;
|
|
1073
|
-
this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (r == null ? void 0 : r.order) !== ((s = t.currentStep) == null ? void 0 : s.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status ===
|
|
1073
|
+
this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (r == null ? void 0 : r.order) !== ((s = t.currentStep) == null ? void 0 : s.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status === fe.Finished && t.workflowResult && this.events.emit("completed", t.workflowResult);
|
|
1074
1074
|
}
|
|
1075
1075
|
/**
|
|
1076
1076
|
* Set error
|
|
@@ -1127,9 +1127,9 @@ class qt {
|
|
|
1127
1127
|
this.events.clear();
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
class
|
|
1130
|
+
class Yt {
|
|
1131
1131
|
constructor() {
|
|
1132
|
-
|
|
1132
|
+
V(this, "handlers", /* @__PURE__ */ new Map());
|
|
1133
1133
|
}
|
|
1134
1134
|
/**
|
|
1135
1135
|
* Register a step handler
|
|
@@ -1155,7 +1155,7 @@ class Kt {
|
|
|
1155
1155
|
async loadStepData(t, r) {
|
|
1156
1156
|
const n = this.getHandler(t);
|
|
1157
1157
|
if (!n)
|
|
1158
|
-
throw new Error(`No handler registered for step action: ${
|
|
1158
|
+
throw new Error(`No handler registered for step action: ${_[t]}`);
|
|
1159
1159
|
return n.loadData(r);
|
|
1160
1160
|
}
|
|
1161
1161
|
/**
|
|
@@ -1164,61 +1164,61 @@ class Kt {
|
|
|
1164
1164
|
async submitStepData(t, r) {
|
|
1165
1165
|
const n = this.getHandler(t);
|
|
1166
1166
|
if (!n)
|
|
1167
|
-
throw new Error(`No handler registered for step action: ${
|
|
1167
|
+
throw new Error(`No handler registered for step action: ${_[t]}`);
|
|
1168
1168
|
return n.submitData(r);
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
|
-
class
|
|
1172
|
-
constructor(t, r, n, s, l, o, c,
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
this.applicantService = t, this.questionnaireService = r, this.uploadDocumentService = n, this.appropriatenessTestService = s, this.overviewService = l, this.riskScoringService = o, this.investorCategorizationService =
|
|
1171
|
+
class Qt {
|
|
1172
|
+
constructor(t, r, n, s, l, o, c, u) {
|
|
1173
|
+
V(this, "state");
|
|
1174
|
+
V(this, "stepRouter");
|
|
1175
|
+
this.applicantService = t, this.questionnaireService = r, this.uploadDocumentService = n, this.appropriatenessTestService = s, this.overviewService = l, this.riskScoringService = o, this.investorCategorizationService = u, this.state = new Wt(), this.stepRouter = new Yt(), this.registerStepHandlers();
|
|
1176
1176
|
}
|
|
1177
1177
|
/**
|
|
1178
1178
|
* Register all step handlers
|
|
1179
1179
|
*/
|
|
1180
1180
|
registerStepHandlers() {
|
|
1181
|
-
this.stepRouter.registerHandler(
|
|
1181
|
+
this.stepRouter.registerHandler(_.Questionaries, {
|
|
1182
1182
|
loadData: (t) => this.questionnaireService.getQuestionnaire(t),
|
|
1183
1183
|
submitData: async (t) => {
|
|
1184
1184
|
await this.questionnaireService.fillQuestionnaire(t);
|
|
1185
1185
|
}
|
|
1186
|
-
}), this.stepRouter.registerHandler(
|
|
1186
|
+
}), this.stepRouter.registerHandler(_.UploadDocument, {
|
|
1187
1187
|
loadData: (t) => this.uploadDocumentService.getUploadDocument(t),
|
|
1188
1188
|
submitData: (t) => this.uploadDocumentService.fillUploadDocument(t)
|
|
1189
|
-
}), this.stepRouter.registerHandler(
|
|
1189
|
+
}), this.stepRouter.registerHandler(_.AppropriatenessTest, {
|
|
1190
1190
|
loadData: (t) => this.appropriatenessTestService.getAppropriatenessTest(t),
|
|
1191
1191
|
submitData: async (t) => {
|
|
1192
1192
|
await this.appropriatenessTestService.fillAppropriatenessTest(t);
|
|
1193
1193
|
}
|
|
1194
|
-
}), this.stepRouter.registerHandler(
|
|
1194
|
+
}), this.stepRouter.registerHandler(_.Overview, {
|
|
1195
1195
|
loadData: (t) => this.overviewService.getOverviewData(t),
|
|
1196
1196
|
submitData: (t) => this.overviewService.passOverview(t.applicantId)
|
|
1197
|
-
}), this.stepRouter.registerHandler(
|
|
1197
|
+
}), this.stepRouter.registerHandler(_.RiskScoring, {
|
|
1198
1198
|
loadData: (t) => this.riskScoringService.getRiskCriterias(t),
|
|
1199
1199
|
submitData: async (t) => {
|
|
1200
1200
|
await this.riskScoringService.submitRiskScoring(t);
|
|
1201
1201
|
}
|
|
1202
|
-
}), this.stepRouter.registerHandler(
|
|
1202
|
+
}), this.stepRouter.registerHandler(_.IdentitySdk, {
|
|
1203
1203
|
loadData: async (t) => ({
|
|
1204
1204
|
applicantId: t,
|
|
1205
1205
|
message: "Identity verification required"
|
|
1206
1206
|
}),
|
|
1207
1207
|
submitData: async () => {
|
|
1208
1208
|
}
|
|
1209
|
-
}), this.stepRouter.registerHandler(
|
|
1209
|
+
}), this.stepRouter.registerHandler(_.InvestorCategorization, {
|
|
1210
1210
|
loadData: (t) => this.investorCategorizationService.getInvestorCategorization(t),
|
|
1211
1211
|
submitData: async (t) => {
|
|
1212
1212
|
await this.investorCategorizationService.setInvestorCategorization(t);
|
|
1213
1213
|
}
|
|
1214
|
-
}), this.stepRouter.registerHandler(
|
|
1214
|
+
}), this.stepRouter.registerHandler(_.ManualReview, {
|
|
1215
1215
|
loadData: async (t) => ({
|
|
1216
1216
|
applicantId: t,
|
|
1217
1217
|
message: "Your application is under manual review"
|
|
1218
1218
|
}),
|
|
1219
1219
|
submitData: async () => {
|
|
1220
1220
|
}
|
|
1221
|
-
}), this.stepRouter.registerHandler(
|
|
1221
|
+
}), this.stepRouter.registerHandler(_.AdditionalData, {
|
|
1222
1222
|
loadData: async (t) => ({
|
|
1223
1223
|
applicantId: t,
|
|
1224
1224
|
message: "Additional data required"
|
|
@@ -1312,7 +1312,7 @@ class jt {
|
|
|
1312
1312
|
return this.stepRouter;
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function tt(e, t) {
|
|
1316
1316
|
return new Promise((r, n) => {
|
|
1317
1317
|
if (t && document.getElementById(t)) {
|
|
1318
1318
|
r();
|
|
@@ -1322,24 +1322,24 @@ function Ze(e, t) {
|
|
|
1322
1322
|
s.src = e, t && (s.id = t), s.async = !0, s.onload = () => r(), s.onerror = () => n(new Error(`Failed to load script: ${e}`)), document.head.appendChild(s);
|
|
1323
1323
|
});
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function Hr(e) {
|
|
1326
1326
|
return !!document.getElementById(e);
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1328
|
+
function Wr(e) {
|
|
1329
1329
|
const t = document.getElementById(e);
|
|
1330
1330
|
t && t.remove();
|
|
1331
1331
|
}
|
|
1332
|
-
class
|
|
1332
|
+
class Vt {
|
|
1333
1333
|
constructor(t) {
|
|
1334
|
-
|
|
1335
|
-
|
|
1334
|
+
V(this, "sdk", null);
|
|
1335
|
+
V(this, "config");
|
|
1336
1336
|
this.config = t;
|
|
1337
1337
|
}
|
|
1338
1338
|
/**
|
|
1339
1339
|
* Load Sumsub SDK
|
|
1340
1340
|
*/
|
|
1341
1341
|
async loadSDK() {
|
|
1342
|
-
await
|
|
1342
|
+
await tt(
|
|
1343
1343
|
"https://cdn.sumsub.com/websdk/v2/production/websdk.js",
|
|
1344
1344
|
"sumsub-sdk"
|
|
1345
1345
|
);
|
|
@@ -1384,17 +1384,17 @@ class Ht {
|
|
|
1384
1384
|
this.sdk && this.sdk.on("idCheck.onError", t);
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
|
-
class
|
|
1387
|
+
class Gt {
|
|
1388
1388
|
constructor(t) {
|
|
1389
|
-
|
|
1390
|
-
|
|
1389
|
+
V(this, "sdk", null);
|
|
1390
|
+
V(this, "config");
|
|
1391
1391
|
this.config = t;
|
|
1392
1392
|
}
|
|
1393
1393
|
/**
|
|
1394
1394
|
* Load Onfido SDK
|
|
1395
1395
|
*/
|
|
1396
1396
|
async loadSDK() {
|
|
1397
|
-
await
|
|
1397
|
+
await tt(
|
|
1398
1398
|
"https://sdk.onfido.com/v12.0.0/onfido.min.js",
|
|
1399
1399
|
"onfido-sdk"
|
|
1400
1400
|
);
|
|
@@ -1450,11 +1450,11 @@ class Wt {
|
|
|
1450
1450
|
this.sdk && (this.sdk.tearDown(), this.sdk = null);
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
|
-
class
|
|
1453
|
+
class Zt {
|
|
1454
1454
|
constructor(t) {
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1455
|
+
V(this, "sardineContext", null);
|
|
1456
|
+
V(this, "config");
|
|
1457
|
+
V(this, "sessionKey");
|
|
1458
1458
|
this.config = t, this.sessionKey = t.sessionKey || this.generateSessionKey();
|
|
1459
1459
|
}
|
|
1460
1460
|
/**
|
|
@@ -1529,13 +1529,13 @@ class Yt {
|
|
|
1529
1529
|
console.log(`[SardinAI] Device ID: ${c.deviceId}`);
|
|
1530
1530
|
},
|
|
1531
1531
|
// New callback for session updates
|
|
1532
|
-
onConfigUpdate: (c,
|
|
1532
|
+
onConfigUpdate: (c, u, p) => {
|
|
1533
1533
|
switch (c) {
|
|
1534
1534
|
case "SESSION_UPDATE_FAILED":
|
|
1535
|
-
console.error("[SardinAI] Session update failed:",
|
|
1535
|
+
console.error("[SardinAI] Session update failed:", p);
|
|
1536
1536
|
break;
|
|
1537
1537
|
case "SESSION_UPDATED":
|
|
1538
|
-
console.log("[SardinAI] Session updated:",
|
|
1538
|
+
console.log("[SardinAI] Session updated:", u);
|
|
1539
1539
|
break;
|
|
1540
1540
|
case "SESSION_NO_UPDATE":
|
|
1541
1541
|
console.log("[SardinAI] No session update");
|
|
@@ -1600,12 +1600,12 @@ class De {
|
|
|
1600
1600
|
*/
|
|
1601
1601
|
static createProvider(t, r) {
|
|
1602
1602
|
switch (t) {
|
|
1603
|
-
case
|
|
1604
|
-
return new
|
|
1605
|
-
case
|
|
1606
|
-
return new
|
|
1607
|
-
case
|
|
1608
|
-
return new
|
|
1603
|
+
case ye.Sumsub:
|
|
1604
|
+
return new Vt(r);
|
|
1605
|
+
case ye.Onfido:
|
|
1606
|
+
return new Gt(r);
|
|
1607
|
+
case ye.SardinAI:
|
|
1608
|
+
return new Zt(r);
|
|
1609
1609
|
default:
|
|
1610
1610
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
1611
1611
|
}
|
|
@@ -1616,7 +1616,7 @@ class De {
|
|
|
1616
1616
|
static parseProviderConfig(t, r, n) {
|
|
1617
1617
|
var s;
|
|
1618
1618
|
switch (t) {
|
|
1619
|
-
case
|
|
1619
|
+
case ye.Sumsub:
|
|
1620
1620
|
return {
|
|
1621
1621
|
accessToken: r.accessToken || r.token,
|
|
1622
1622
|
applicantEmail: r.email,
|
|
@@ -1624,11 +1624,11 @@ class De {
|
|
|
1624
1624
|
externalUserId: r.externalUserId,
|
|
1625
1625
|
lang: r.lang || "en"
|
|
1626
1626
|
};
|
|
1627
|
-
case
|
|
1627
|
+
case ye.Onfido:
|
|
1628
1628
|
return {
|
|
1629
1629
|
token: r.token || r.sdkToken
|
|
1630
1630
|
};
|
|
1631
|
-
case
|
|
1631
|
+
case ye.SardinAI:
|
|
1632
1632
|
const l = ((s = n == null ? void 0 : n.identityProviders) == null ? void 0 : s.sardinai) || {};
|
|
1633
1633
|
return {
|
|
1634
1634
|
clientId: l.clientId || r.clientId,
|
|
@@ -1644,11 +1644,11 @@ class De {
|
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
|
-
class
|
|
1647
|
+
class Jt {
|
|
1648
1648
|
constructor(t) {
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1649
|
+
V(this, "currentTheme", de);
|
|
1650
|
+
V(this, "customStyleElement", null);
|
|
1651
|
+
V(this, "container");
|
|
1652
1652
|
this.container = t || document.documentElement;
|
|
1653
1653
|
}
|
|
1654
1654
|
/**
|
|
@@ -1770,12 +1770,12 @@ class Qt {
|
|
|
1770
1770
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
1773
|
-
const
|
|
1774
|
-
const [r, n] = x(null), s =
|
|
1775
|
-
const
|
|
1773
|
+
const rt = dt(null), Yr = ({ config: e, children: t }) => {
|
|
1774
|
+
const [r, n] = x(null), s = ge.useRef(!1), l = ge.useRef(!1), o = ke(() => {
|
|
1775
|
+
const u = new Et(e), p = new Rt(u), w = new Ft(u), N = new Dt(u), y = new Pt(u), h = new Lt(u), g = new Mt(u), k = new Tt(u), b = new Ot(u), m = new $t(u), F = new jt(u), S = new Jt();
|
|
1776
1776
|
return {
|
|
1777
|
-
httpClient:
|
|
1778
|
-
applicantService:
|
|
1777
|
+
httpClient: u,
|
|
1778
|
+
applicantService: p,
|
|
1779
1779
|
questionnaireService: w,
|
|
1780
1780
|
uploadDocumentService: N,
|
|
1781
1781
|
appropriatenessTestService: y,
|
|
@@ -1783,15 +1783,15 @@ const Je = it(null), Kr = ({ config: e, children: t }) => {
|
|
|
1783
1783
|
riskScoringService: g,
|
|
1784
1784
|
identityService: k,
|
|
1785
1785
|
baseInformationService: b,
|
|
1786
|
-
investorCategorizationService:
|
|
1786
|
+
investorCategorizationService: m,
|
|
1787
1787
|
themeService: F,
|
|
1788
|
-
themeManager:
|
|
1788
|
+
themeManager: S
|
|
1789
1789
|
};
|
|
1790
|
-
}, [e]), c =
|
|
1790
|
+
}, [e]), c = ke(() => ({
|
|
1791
1791
|
config: e,
|
|
1792
1792
|
...o,
|
|
1793
1793
|
currentTheme: r,
|
|
1794
|
-
createOrchestrator: () => new
|
|
1794
|
+
createOrchestrator: () => new Qt(
|
|
1795
1795
|
o.applicantService,
|
|
1796
1796
|
o.questionnaireService,
|
|
1797
1797
|
o.uploadDocumentService,
|
|
@@ -1802,7 +1802,7 @@ const Je = it(null), Kr = ({ config: e, children: t }) => {
|
|
|
1802
1802
|
o.investorCategorizationService
|
|
1803
1803
|
)
|
|
1804
1804
|
}), [e, o, r]);
|
|
1805
|
-
return
|
|
1805
|
+
return X(() => ((async () => {
|
|
1806
1806
|
if (s.current || l.current) {
|
|
1807
1807
|
console.log("[MetaKYC] Theme already loading or loaded, skipping...");
|
|
1808
1808
|
return;
|
|
@@ -1814,24 +1814,24 @@ const Je = it(null), Kr = ({ config: e, children: t }) => {
|
|
|
1814
1814
|
return;
|
|
1815
1815
|
}
|
|
1816
1816
|
console.log("[MetaKYC] Fetching theme from backend...");
|
|
1817
|
-
const
|
|
1818
|
-
o.themeManager.applyTheme(
|
|
1819
|
-
} catch (
|
|
1820
|
-
console.warn("[MetaKYC] Failed to load theme, using default:",
|
|
1817
|
+
const p = await o.themeService.getThemeConfiguration();
|
|
1818
|
+
o.themeManager.applyTheme(p), n(o.themeManager.getCurrentTheme()), l.current = !0, console.log("[MetaKYC] Theme loaded and applied", p);
|
|
1819
|
+
} catch (p) {
|
|
1820
|
+
console.warn("[MetaKYC] Failed to load theme, using default:", p), n(o.themeManager.getCurrentTheme()), l.current = !0;
|
|
1821
1821
|
} finally {
|
|
1822
1822
|
s.current = !1;
|
|
1823
1823
|
}
|
|
1824
1824
|
})(), () => {
|
|
1825
1825
|
o.themeManager.cleanup();
|
|
1826
|
-
}), []), /* @__PURE__ */ a(
|
|
1826
|
+
}), []), /* @__PURE__ */ a(rt.Provider, { value: c, children: t });
|
|
1827
1827
|
};
|
|
1828
1828
|
function he() {
|
|
1829
|
-
const e =
|
|
1829
|
+
const e = ut(rt);
|
|
1830
1830
|
if (!e)
|
|
1831
1831
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
1832
1832
|
return e;
|
|
1833
1833
|
}
|
|
1834
|
-
async function
|
|
1834
|
+
async function Xt(e) {
|
|
1835
1835
|
return new Promise((t, r) => {
|
|
1836
1836
|
const n = new FileReader();
|
|
1837
1837
|
n.readAsDataURL(e), n.onload = () => {
|
|
@@ -1840,10 +1840,10 @@ async function Vt(e) {
|
|
|
1840
1840
|
}, n.onerror = (s) => r(s);
|
|
1841
1841
|
});
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1843
|
+
function Qr(e, t) {
|
|
1844
1844
|
return e.size <= t;
|
|
1845
1845
|
}
|
|
1846
|
-
function
|
|
1846
|
+
function Vr(e, t) {
|
|
1847
1847
|
return t.split(",").map((n) => n.trim()).some((n) => {
|
|
1848
1848
|
if (n.endsWith("/*")) {
|
|
1849
1849
|
const s = n.slice(0, -2);
|
|
@@ -1852,12 +1852,12 @@ function Hr(e, t) {
|
|
|
1852
1852
|
return e.type === n;
|
|
1853
1853
|
});
|
|
1854
1854
|
}
|
|
1855
|
-
function
|
|
1855
|
+
function je(e) {
|
|
1856
1856
|
if (e === 0) return "0 Bytes";
|
|
1857
1857
|
const t = 1024, r = ["Bytes", "KB", "MB", "GB"], n = Math.floor(Math.log(e) / Math.log(t));
|
|
1858
1858
|
return Math.round(e / Math.pow(t, n) * 100) / 100 + " " + r[n];
|
|
1859
1859
|
}
|
|
1860
|
-
function
|
|
1860
|
+
function Gr(e) {
|
|
1861
1861
|
return e;
|
|
1862
1862
|
}
|
|
1863
1863
|
function ie(...e) {
|
|
@@ -1867,14 +1867,14 @@ const Pe = {
|
|
|
1867
1867
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
1868
1868
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
1869
1869
|
};
|
|
1870
|
-
function
|
|
1870
|
+
function er(e) {
|
|
1871
1871
|
try {
|
|
1872
1872
|
localStorage.setItem(Pe.APPLICANT_ID, e.toString());
|
|
1873
1873
|
} catch (t) {
|
|
1874
1874
|
console.warn("Failed to save applicant ID to storage:", t);
|
|
1875
1875
|
}
|
|
1876
1876
|
}
|
|
1877
|
-
function
|
|
1877
|
+
function tr() {
|
|
1878
1878
|
try {
|
|
1879
1879
|
const e = localStorage.getItem(Pe.APPLICANT_ID);
|
|
1880
1880
|
return e ? parseInt(e, 10) : null;
|
|
@@ -1882,21 +1882,21 @@ function Zt() {
|
|
|
1882
1882
|
return console.warn("Failed to retrieve applicant ID from storage:", e), null;
|
|
1883
1883
|
}
|
|
1884
1884
|
}
|
|
1885
|
-
function
|
|
1885
|
+
function rr() {
|
|
1886
1886
|
try {
|
|
1887
1887
|
localStorage.removeItem(Pe.APPLICANT_ID);
|
|
1888
1888
|
} catch (e) {
|
|
1889
1889
|
console.warn("Failed to clear applicant ID from storage:", e);
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
|
-
function
|
|
1892
|
+
function ar(e) {
|
|
1893
1893
|
try {
|
|
1894
1894
|
localStorage.setItem(Pe.WORKFLOW_STATE, JSON.stringify(e));
|
|
1895
1895
|
} catch (t) {
|
|
1896
1896
|
console.warn("Failed to save workflow state to storage:", t);
|
|
1897
1897
|
}
|
|
1898
1898
|
}
|
|
1899
|
-
function
|
|
1899
|
+
function Zr() {
|
|
1900
1900
|
try {
|
|
1901
1901
|
const e = localStorage.getItem(Pe.WORKFLOW_STATE);
|
|
1902
1902
|
return e ? JSON.parse(e) : null;
|
|
@@ -1904,97 +1904,97 @@ function Yr() {
|
|
|
1904
1904
|
return console.warn("Failed to retrieve workflow state from storage:", e), null;
|
|
1905
1905
|
}
|
|
1906
1906
|
}
|
|
1907
|
-
function
|
|
1907
|
+
function nr() {
|
|
1908
1908
|
try {
|
|
1909
1909
|
localStorage.removeItem(Pe.WORKFLOW_STATE);
|
|
1910
1910
|
} catch (e) {
|
|
1911
1911
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
1912
1912
|
}
|
|
1913
1913
|
}
|
|
1914
|
-
function
|
|
1915
|
-
|
|
1914
|
+
function Jr() {
|
|
1915
|
+
rr(), nr();
|
|
1916
1916
|
}
|
|
1917
|
-
function
|
|
1918
|
-
const { createOrchestrator: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(null),
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
}, [t]),
|
|
1922
|
-
var
|
|
1923
|
-
r &&
|
|
1924
|
-
applicantId:
|
|
1925
|
-
currentStepOrder: (
|
|
1917
|
+
function sr(e) {
|
|
1918
|
+
const { createOrchestrator: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(null), u = J(null), p = e || tr();
|
|
1919
|
+
X(() => {
|
|
1920
|
+
u.current || (u.current = t());
|
|
1921
|
+
}, [t]), X(() => {
|
|
1922
|
+
var S;
|
|
1923
|
+
r && p && (er(p), ar({
|
|
1924
|
+
applicantId: p,
|
|
1925
|
+
currentStepOrder: (S = r.currentStep) == null ? void 0 : S.order,
|
|
1926
1926
|
status: r.status,
|
|
1927
1927
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1928
1928
|
workflowKey: r.workFlowKey,
|
|
1929
1929
|
nextWorkflowKey: r.nextWorkflowKey
|
|
1930
1930
|
}));
|
|
1931
|
-
}, [r,
|
|
1932
|
-
const w =
|
|
1933
|
-
if (!(!
|
|
1931
|
+
}, [r, p]);
|
|
1932
|
+
const w = J(!1), N = J(!1), y = Y(async () => {
|
|
1933
|
+
if (!(!p || !u.current)) {
|
|
1934
1934
|
if (w.current) {
|
|
1935
1935
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
1936
1936
|
return;
|
|
1937
1937
|
}
|
|
1938
1938
|
w.current = !0, l(!0), c(null);
|
|
1939
1939
|
try {
|
|
1940
|
-
const
|
|
1941
|
-
n(
|
|
1942
|
-
} catch (
|
|
1943
|
-
c(
|
|
1940
|
+
const S = await u.current.initialize(p);
|
|
1941
|
+
n(S), N.current = !0;
|
|
1942
|
+
} catch (S) {
|
|
1943
|
+
c(S);
|
|
1944
1944
|
} finally {
|
|
1945
1945
|
l(!1), w.current = !1;
|
|
1946
1946
|
}
|
|
1947
1947
|
}
|
|
1948
|
-
}, [
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
}, [
|
|
1952
|
-
const h =
|
|
1953
|
-
if (
|
|
1948
|
+
}, [p]);
|
|
1949
|
+
X(() => {
|
|
1950
|
+
p && !N.current && y();
|
|
1951
|
+
}, [p, y]);
|
|
1952
|
+
const h = Y(async () => {
|
|
1953
|
+
if (u.current) {
|
|
1954
1954
|
if (w.current) {
|
|
1955
1955
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
1956
1956
|
return;
|
|
1957
1957
|
}
|
|
1958
1958
|
w.current = !0, l(!0), c(null);
|
|
1959
1959
|
try {
|
|
1960
|
-
const
|
|
1961
|
-
n(
|
|
1962
|
-
} catch (
|
|
1963
|
-
c(
|
|
1960
|
+
const S = await u.current.refreshProgress();
|
|
1961
|
+
n(S);
|
|
1962
|
+
} catch (S) {
|
|
1963
|
+
c(S);
|
|
1964
1964
|
} finally {
|
|
1965
1965
|
l(!1), w.current = !1;
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
|
-
}, []), g =
|
|
1969
|
-
if (
|
|
1968
|
+
}, []), g = Y(async () => {
|
|
1969
|
+
if (u.current) {
|
|
1970
1970
|
l(!0), c(null);
|
|
1971
1971
|
try {
|
|
1972
|
-
const
|
|
1973
|
-
n(
|
|
1974
|
-
} catch (
|
|
1975
|
-
c(
|
|
1972
|
+
const S = await u.current.moveToNextStep();
|
|
1973
|
+
n(S);
|
|
1974
|
+
} catch (S) {
|
|
1975
|
+
c(S);
|
|
1976
1976
|
} finally {
|
|
1977
1977
|
l(!1);
|
|
1978
1978
|
}
|
|
1979
1979
|
}
|
|
1980
|
-
}, []), k =
|
|
1981
|
-
if (
|
|
1980
|
+
}, []), k = Y(async () => {
|
|
1981
|
+
if (u.current) {
|
|
1982
1982
|
l(!0), c(null);
|
|
1983
1983
|
try {
|
|
1984
|
-
const
|
|
1985
|
-
n(
|
|
1986
|
-
} catch (
|
|
1987
|
-
c(
|
|
1984
|
+
const S = await u.current.moveToPreviousStep();
|
|
1985
|
+
n(S);
|
|
1986
|
+
} catch (S) {
|
|
1987
|
+
c(S);
|
|
1988
1988
|
} finally {
|
|
1989
1989
|
l(!1);
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
|
-
}, []), b =
|
|
1993
|
-
if (
|
|
1992
|
+
}, []), b = Y(async (S) => {
|
|
1993
|
+
if (u.current) {
|
|
1994
1994
|
l(!0), c(null);
|
|
1995
1995
|
try {
|
|
1996
|
-
await
|
|
1997
|
-
const v = await
|
|
1996
|
+
await u.current.submitCurrentStep(S);
|
|
1997
|
+
const v = await u.current.refreshProgress();
|
|
1998
1998
|
n(v);
|
|
1999
1999
|
} catch (v) {
|
|
2000
2000
|
throw c(v), v;
|
|
@@ -2002,69 +2002,69 @@ function tr(e) {
|
|
|
2002
2002
|
l(!1);
|
|
2003
2003
|
}
|
|
2004
2004
|
}
|
|
2005
|
-
}, []),
|
|
2005
|
+
}, []), m = Ze.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((S, v) => S.order - v.order) : [], [r == null ? void 0 : r.stepInfoList]), F = Ze.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2006
2006
|
return {
|
|
2007
2007
|
progress: r,
|
|
2008
|
-
applicantId:
|
|
2008
|
+
applicantId: p,
|
|
2009
2009
|
currentStep: (r == null ? void 0 : r.currentStep) || null,
|
|
2010
|
-
steps:
|
|
2011
|
-
status: (r == null ? void 0 : r.status) ||
|
|
2010
|
+
steps: m,
|
|
2011
|
+
status: (r == null ? void 0 : r.status) || fe.None,
|
|
2012
2012
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
2013
2013
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
2014
2014
|
nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
|
|
2015
2015
|
hasWorkflowChanged: F,
|
|
2016
2016
|
isLoading: s,
|
|
2017
2017
|
error: o,
|
|
2018
|
-
isComplete: (r == null ? void 0 : r.status) ===
|
|
2019
|
-
isOnHold: (r == null ? void 0 : r.status) ===
|
|
2018
|
+
isComplete: (r == null ? void 0 : r.status) === fe.Finished,
|
|
2019
|
+
isOnHold: (r == null ? void 0 : r.status) === fe.OnHold,
|
|
2020
2020
|
refreshProgress: h,
|
|
2021
2021
|
moveToNext: g,
|
|
2022
2022
|
moveBack: k,
|
|
2023
2023
|
submitCurrentStep: b,
|
|
2024
|
-
orchestrator:
|
|
2024
|
+
orchestrator: u.current
|
|
2025
2025
|
};
|
|
2026
2026
|
}
|
|
2027
|
-
function
|
|
2028
|
-
const { questionnaireService: t, applicantService: r } = he(), [n, s] = x(null), [l, o] = x({}), [c,
|
|
2029
|
-
var
|
|
2027
|
+
function ir(e) {
|
|
2028
|
+
const { questionnaireService: t, applicantService: r } = he(), [n, s] = x(null), [l, o] = x({}), [c, u] = x(!1), [p, w] = x(!1), [N, y] = x(null), h = J(!1), g = J(null), k = Y(async () => {
|
|
2029
|
+
var m, F;
|
|
2030
2030
|
if (e) {
|
|
2031
2031
|
if (h.current) {
|
|
2032
2032
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
2033
2033
|
return;
|
|
2034
2034
|
}
|
|
2035
|
-
h.current = !0,
|
|
2035
|
+
h.current = !0, u(!0), y(null);
|
|
2036
2036
|
try {
|
|
2037
|
-
const [
|
|
2037
|
+
const [S, v] = await Promise.all([
|
|
2038
2038
|
t.getQuestionnaire(e),
|
|
2039
2039
|
r.getApplicantData(e).catch(() => null)
|
|
2040
2040
|
]);
|
|
2041
|
-
if (s(
|
|
2042
|
-
const
|
|
2041
|
+
if (s(S), (m = v == null ? void 0 : v.questionnaireResults) != null && m.length && S) {
|
|
2042
|
+
const q = /* @__PURE__ */ new Map();
|
|
2043
2043
|
for (const f of v.questionnaireResults)
|
|
2044
|
-
f.question && ((F = f.answers) != null && F.length) &&
|
|
2045
|
-
const
|
|
2046
|
-
for (const f of
|
|
2044
|
+
f.question && ((F = f.answers) != null && F.length) && q.set(f.question.trim().toLowerCase(), f.answers);
|
|
2045
|
+
const H = {}, T = S.questionGroups.flatMap((f) => f.questions ?? []);
|
|
2046
|
+
for (const f of T) {
|
|
2047
2047
|
const A = f.text.trim().toLowerCase();
|
|
2048
|
-
|
|
2048
|
+
q.has(A) && (H[f.id] = q.get(A));
|
|
2049
2049
|
}
|
|
2050
|
-
o(
|
|
2050
|
+
o(H);
|
|
2051
2051
|
}
|
|
2052
2052
|
g.current = e;
|
|
2053
|
-
} catch (
|
|
2054
|
-
y(
|
|
2053
|
+
} catch (S) {
|
|
2054
|
+
y(S);
|
|
2055
2055
|
} finally {
|
|
2056
|
-
|
|
2056
|
+
u(!1), h.current = !1;
|
|
2057
2057
|
}
|
|
2058
2058
|
}
|
|
2059
2059
|
}, [e, t, r]);
|
|
2060
|
-
|
|
2060
|
+
X(() => {
|
|
2061
2061
|
e && g.current !== e && k();
|
|
2062
2062
|
}, [e]);
|
|
2063
|
-
const b =
|
|
2064
|
-
async (
|
|
2063
|
+
const b = Y(
|
|
2064
|
+
async (m) => {
|
|
2065
2065
|
w(!0), y(null);
|
|
2066
2066
|
try {
|
|
2067
|
-
return await t.fillQuestionnaire(
|
|
2067
|
+
return await t.fillQuestionnaire(m);
|
|
2068
2068
|
} catch (F) {
|
|
2069
2069
|
throw y(F), F;
|
|
2070
2070
|
} finally {
|
|
@@ -2077,14 +2077,14 @@ function rr(e) {
|
|
|
2077
2077
|
questionnaire: n,
|
|
2078
2078
|
initialAnswers: l,
|
|
2079
2079
|
isLoading: c,
|
|
2080
|
-
isSubmitting:
|
|
2080
|
+
isSubmitting: p,
|
|
2081
2081
|
error: N,
|
|
2082
2082
|
load: k,
|
|
2083
2083
|
submit: b
|
|
2084
2084
|
};
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2087
|
-
const { uploadDocumentService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [
|
|
2086
|
+
function lr(e) {
|
|
2087
|
+
const { uploadDocumentService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, p] = x(0), [w, N] = x(null), y = J(!1), h = J(null), g = Y(async () => {
|
|
2088
2088
|
if (e) {
|
|
2089
2089
|
if (y.current) {
|
|
2090
2090
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
@@ -2101,16 +2101,16 @@ function ar(e) {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
}
|
|
2103
2103
|
}, [e, t]);
|
|
2104
|
-
|
|
2104
|
+
X(() => {
|
|
2105
2105
|
e && h.current !== e && g();
|
|
2106
2106
|
}, [e]);
|
|
2107
|
-
const k =
|
|
2107
|
+
const k = Y(
|
|
2108
2108
|
async (b) => {
|
|
2109
|
-
c(!0),
|
|
2109
|
+
c(!0), p(0), N(null);
|
|
2110
2110
|
try {
|
|
2111
|
-
await t.fillUploadDocument(b),
|
|
2112
|
-
} catch (
|
|
2113
|
-
throw N(
|
|
2111
|
+
await t.fillUploadDocument(b), p(100);
|
|
2112
|
+
} catch (m) {
|
|
2113
|
+
throw N(m), m;
|
|
2114
2114
|
} finally {
|
|
2115
2115
|
c(!1);
|
|
2116
2116
|
}
|
|
@@ -2121,41 +2121,41 @@ function ar(e) {
|
|
|
2121
2121
|
uploadDocument: r,
|
|
2122
2122
|
isLoading: s,
|
|
2123
2123
|
isSubmitting: o,
|
|
2124
|
-
uploadProgress:
|
|
2124
|
+
uploadProgress: u,
|
|
2125
2125
|
error: w,
|
|
2126
2126
|
load: g,
|
|
2127
2127
|
submit: k
|
|
2128
2128
|
};
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2131
|
-
const { appropriatenessTestService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [
|
|
2130
|
+
function Xr(e) {
|
|
2131
|
+
const { appropriatenessTestService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, p] = x(null), [w, N] = x(null), y = J(!1), h = J(null), g = Y(async () => {
|
|
2132
2132
|
if (e) {
|
|
2133
2133
|
if (y.current) {
|
|
2134
2134
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
2135
2135
|
return;
|
|
2136
2136
|
}
|
|
2137
|
-
y.current = !0, l(!0),
|
|
2137
|
+
y.current = !0, l(!0), p(null);
|
|
2138
2138
|
try {
|
|
2139
2139
|
const b = await t.getAppropriatenessTest(e);
|
|
2140
2140
|
n(b), h.current = e;
|
|
2141
2141
|
} catch (b) {
|
|
2142
|
-
|
|
2142
|
+
p(b);
|
|
2143
2143
|
} finally {
|
|
2144
2144
|
l(!1), y.current = !1;
|
|
2145
2145
|
}
|
|
2146
2146
|
}
|
|
2147
2147
|
}, [e, t]);
|
|
2148
|
-
|
|
2148
|
+
X(() => {
|
|
2149
2149
|
e && h.current !== e && g();
|
|
2150
2150
|
}, [e]);
|
|
2151
|
-
const k =
|
|
2151
|
+
const k = Y(
|
|
2152
2152
|
async (b) => {
|
|
2153
|
-
c(!0),
|
|
2153
|
+
c(!0), p(null);
|
|
2154
2154
|
try {
|
|
2155
|
-
const
|
|
2156
|
-
return N(
|
|
2157
|
-
} catch (
|
|
2158
|
-
throw m
|
|
2155
|
+
const m = await t.fillAppropriatenessTest(b);
|
|
2156
|
+
return N(m), m;
|
|
2157
|
+
} catch (m) {
|
|
2158
|
+
throw p(m), m;
|
|
2159
2159
|
} finally {
|
|
2160
2160
|
c(!1);
|
|
2161
2161
|
}
|
|
@@ -2167,39 +2167,39 @@ function Vr(e) {
|
|
|
2167
2167
|
result: w,
|
|
2168
2168
|
isLoading: s,
|
|
2169
2169
|
isSubmitting: o,
|
|
2170
|
-
error:
|
|
2170
|
+
error: u,
|
|
2171
2171
|
load: g,
|
|
2172
2172
|
submit: k
|
|
2173
2173
|
};
|
|
2174
2174
|
}
|
|
2175
|
-
function
|
|
2176
|
-
const { overviewService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [
|
|
2175
|
+
function or(e) {
|
|
2176
|
+
const { overviewService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, p] = x(null), w = J(!1), N = J(null), y = Y(async () => {
|
|
2177
2177
|
if (e) {
|
|
2178
2178
|
if (w.current) {
|
|
2179
2179
|
console.log("[Overview] Load already in progress, skipping...");
|
|
2180
2180
|
return;
|
|
2181
2181
|
}
|
|
2182
|
-
w.current = !0, l(!0),
|
|
2182
|
+
w.current = !0, l(!0), p(null);
|
|
2183
2183
|
try {
|
|
2184
2184
|
const g = await t.getOverviewData(e);
|
|
2185
2185
|
n(g), N.current = e;
|
|
2186
2186
|
} catch (g) {
|
|
2187
|
-
|
|
2187
|
+
p(g);
|
|
2188
2188
|
} finally {
|
|
2189
2189
|
l(!1), w.current = !1;
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
2192
2192
|
}, [e, t]);
|
|
2193
|
-
|
|
2193
|
+
X(() => {
|
|
2194
2194
|
e && N.current !== e && y();
|
|
2195
2195
|
}, [e]);
|
|
2196
|
-
const h =
|
|
2196
|
+
const h = Y(async () => {
|
|
2197
2197
|
if (e) {
|
|
2198
|
-
c(!0),
|
|
2198
|
+
c(!0), p(null);
|
|
2199
2199
|
try {
|
|
2200
2200
|
await t.passOverview(e);
|
|
2201
2201
|
} catch (g) {
|
|
2202
|
-
throw
|
|
2202
|
+
throw p(g), g;
|
|
2203
2203
|
} finally {
|
|
2204
2204
|
c(!1);
|
|
2205
2205
|
}
|
|
@@ -2209,22 +2209,22 @@ function nr(e) {
|
|
|
2209
2209
|
overview: r,
|
|
2210
2210
|
isLoading: s,
|
|
2211
2211
|
isSubmitting: o,
|
|
2212
|
-
error:
|
|
2212
|
+
error: u,
|
|
2213
2213
|
load: y,
|
|
2214
2214
|
passOverview: h
|
|
2215
2215
|
};
|
|
2216
2216
|
}
|
|
2217
|
-
function
|
|
2217
|
+
function cr(e) {
|
|
2218
2218
|
const { identityService: t } = he(), [r, n] = x(
|
|
2219
2219
|
null
|
|
2220
|
-
), [s, l] = x(!1), [o, c] = x(null),
|
|
2220
|
+
), [s, l] = x(!1), [o, c] = x(null), u = J(!1), p = Y(
|
|
2221
2221
|
async (y, h) => {
|
|
2222
2222
|
if (e) {
|
|
2223
|
-
if (
|
|
2223
|
+
if (u.current) {
|
|
2224
2224
|
console.log("[Identity] Request already in progress, skipping...");
|
|
2225
2225
|
return;
|
|
2226
2226
|
}
|
|
2227
|
-
|
|
2227
|
+
u.current = !0, l(!0), c(null);
|
|
2228
2228
|
try {
|
|
2229
2229
|
const g = {
|
|
2230
2230
|
applicantId: e,
|
|
@@ -2239,12 +2239,12 @@ function sr(e) {
|
|
|
2239
2239
|
} catch (g) {
|
|
2240
2240
|
throw c(g), g;
|
|
2241
2241
|
} finally {
|
|
2242
|
-
l(!1),
|
|
2242
|
+
l(!1), u.current = !1;
|
|
2243
2243
|
}
|
|
2244
2244
|
}
|
|
2245
2245
|
},
|
|
2246
2246
|
[e, t]
|
|
2247
|
-
), w =
|
|
2247
|
+
), w = Y(
|
|
2248
2248
|
async (y, h) => {
|
|
2249
2249
|
if (e) {
|
|
2250
2250
|
l(!0), c(null);
|
|
@@ -2264,13 +2264,13 @@ function sr(e) {
|
|
|
2264
2264
|
}
|
|
2265
2265
|
},
|
|
2266
2266
|
[e, t]
|
|
2267
|
-
), N =
|
|
2267
|
+
), N = Y(async () => {
|
|
2268
2268
|
if (e) {
|
|
2269
|
-
if (
|
|
2269
|
+
if (u.current) {
|
|
2270
2270
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
2271
2271
|
return;
|
|
2272
2272
|
}
|
|
2273
|
-
|
|
2273
|
+
u.current = !0, l(!0), c(null);
|
|
2274
2274
|
try {
|
|
2275
2275
|
const y = {
|
|
2276
2276
|
applicantId: e,
|
|
@@ -2285,7 +2285,7 @@ function sr(e) {
|
|
|
2285
2285
|
} catch (y) {
|
|
2286
2286
|
throw c(y), y;
|
|
2287
2287
|
} finally {
|
|
2288
|
-
l(!1),
|
|
2288
|
+
l(!1), u.current = !1;
|
|
2289
2289
|
}
|
|
2290
2290
|
}
|
|
2291
2291
|
}, [e, t]);
|
|
@@ -2295,52 +2295,52 @@ function sr(e) {
|
|
|
2295
2295
|
token: (r == null ? void 0 : r.publicProviderTokenObject) || null,
|
|
2296
2296
|
isLoading: s,
|
|
2297
2297
|
error: o,
|
|
2298
|
-
requestIdentity:
|
|
2298
|
+
requestIdentity: p,
|
|
2299
2299
|
requestCompanyIdentity: w,
|
|
2300
2300
|
restartIdentity: N
|
|
2301
2301
|
};
|
|
2302
2302
|
}
|
|
2303
|
-
function
|
|
2304
|
-
const { riskScoringService: t, applicantService: r } = he(), [n, s] = x(null), [l, o] = x({}), [c,
|
|
2305
|
-
var
|
|
2303
|
+
function dr(e) {
|
|
2304
|
+
const { riskScoringService: t, applicantService: r } = he(), [n, s] = x(null), [l, o] = x({}), [c, u] = x(!1), [p, w] = x(!1), [N, y] = x(null), [h, g] = x(null), k = J(!1), b = J(null), m = Y(async () => {
|
|
2305
|
+
var S;
|
|
2306
2306
|
if (e) {
|
|
2307
2307
|
if (k.current) {
|
|
2308
2308
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
2309
2309
|
return;
|
|
2310
2310
|
}
|
|
2311
|
-
k.current = !0,
|
|
2311
|
+
k.current = !0, u(!0), y(null);
|
|
2312
2312
|
try {
|
|
2313
|
-
const [v,
|
|
2313
|
+
const [v, q] = await Promise.all([
|
|
2314
2314
|
t.getRiskCriterias(e),
|
|
2315
2315
|
r.getApplicantData(e).catch(() => null)
|
|
2316
2316
|
]);
|
|
2317
|
-
if (s(v), (
|
|
2318
|
-
const
|
|
2319
|
-
for (const f of
|
|
2317
|
+
if (s(v), (S = q == null ? void 0 : q.riskScoringResults) != null && S.length) {
|
|
2318
|
+
const H = q.riskScoringResults[0], T = {};
|
|
2319
|
+
for (const f of H.riskCriteriaResults ?? [])
|
|
2320
2320
|
if (f.riskCriteriaId != null && f.answer != null && f.answer !== "") {
|
|
2321
2321
|
const A = [...new Set(
|
|
2322
2322
|
f.answer.split(",").map((D) => D.trim()).filter((D) => D !== "")
|
|
2323
2323
|
)];
|
|
2324
|
-
A.length > 0 && (
|
|
2324
|
+
A.length > 0 && (T[f.riskCriteriaId] = A);
|
|
2325
2325
|
}
|
|
2326
|
-
o(
|
|
2326
|
+
o(T);
|
|
2327
2327
|
}
|
|
2328
2328
|
b.current = e;
|
|
2329
2329
|
} catch (v) {
|
|
2330
2330
|
y(v);
|
|
2331
2331
|
} finally {
|
|
2332
|
-
|
|
2332
|
+
u(!1), k.current = !1;
|
|
2333
2333
|
}
|
|
2334
2334
|
}
|
|
2335
2335
|
}, [e, t, r]);
|
|
2336
|
-
|
|
2337
|
-
e && b.current !== e &&
|
|
2336
|
+
X(() => {
|
|
2337
|
+
e && b.current !== e && m();
|
|
2338
2338
|
}, [e]);
|
|
2339
|
-
const F =
|
|
2340
|
-
async (
|
|
2339
|
+
const F = Y(
|
|
2340
|
+
async (S) => {
|
|
2341
2341
|
w(!0), y(null);
|
|
2342
2342
|
try {
|
|
2343
|
-
const v = await t.submitRiskScoring(
|
|
2343
|
+
const v = await t.submitRiskScoring(S);
|
|
2344
2344
|
return g(v), v;
|
|
2345
2345
|
} catch (v) {
|
|
2346
2346
|
throw y(v), v;
|
|
@@ -2355,17 +2355,17 @@ function ir(e) {
|
|
|
2355
2355
|
initialAnswers: l,
|
|
2356
2356
|
result: h,
|
|
2357
2357
|
isLoading: c,
|
|
2358
|
-
isSubmitting:
|
|
2358
|
+
isSubmitting: p,
|
|
2359
2359
|
error: N,
|
|
2360
|
-
load:
|
|
2360
|
+
load: m,
|
|
2361
2361
|
submit: F
|
|
2362
2362
|
};
|
|
2363
2363
|
}
|
|
2364
|
-
function
|
|
2365
|
-
const { applicantService: e, config: t } = he(), [r, n] = x(!1), [s, l] = x(null), o =
|
|
2364
|
+
function ur() {
|
|
2365
|
+
const { applicantService: e, config: t } = he(), [r, n] = x(!1), [s, l] = x(null), o = J(!1), c = J(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(h) {
|
|
2366
2366
|
const g = Math.random() * 16 | 0;
|
|
2367
2367
|
return (h === "x" ? g : g & 3 | 8).toString(16);
|
|
2368
|
-
}),
|
|
2368
|
+
}), p = Y(
|
|
2369
2369
|
async (h) => {
|
|
2370
2370
|
var g;
|
|
2371
2371
|
if (o.current)
|
|
@@ -2373,7 +2373,7 @@ function lr() {
|
|
|
2373
2373
|
o.current = !0, n(!0), l(null);
|
|
2374
2374
|
try {
|
|
2375
2375
|
if (h.applicantAdditionalDatas || (h.applicantAdditionalDatas = []), (g = t.identityProviders) != null && g.sardinai) {
|
|
2376
|
-
const b =
|
|
2376
|
+
const b = u();
|
|
2377
2377
|
console.log("[SardinAI] Generated session key:", b), h.applicantAdditionalDatas.push({
|
|
2378
2378
|
paramName: "sessionKey",
|
|
2379
2379
|
value: b
|
|
@@ -2387,7 +2387,7 @@ function lr() {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
},
|
|
2389
2389
|
[e, t]
|
|
2390
|
-
), w =
|
|
2390
|
+
), w = Y(
|
|
2391
2391
|
async (h) => {
|
|
2392
2392
|
n(!0), l(null);
|
|
2393
2393
|
try {
|
|
@@ -2399,7 +2399,7 @@ function lr() {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
},
|
|
2401
2401
|
[e]
|
|
2402
|
-
), N =
|
|
2402
|
+
), N = Y(
|
|
2403
2403
|
async (h) => {
|
|
2404
2404
|
if (c.current)
|
|
2405
2405
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
@@ -2413,7 +2413,7 @@ function lr() {
|
|
|
2413
2413
|
}
|
|
2414
2414
|
},
|
|
2415
2415
|
[e]
|
|
2416
|
-
), y =
|
|
2416
|
+
), y = Y(
|
|
2417
2417
|
async (h) => {
|
|
2418
2418
|
n(!0), l(null);
|
|
2419
2419
|
try {
|
|
@@ -2429,13 +2429,13 @@ function lr() {
|
|
|
2429
2429
|
return {
|
|
2430
2430
|
isLoading: r,
|
|
2431
2431
|
error: s,
|
|
2432
|
-
createApplicant:
|
|
2432
|
+
createApplicant: p,
|
|
2433
2433
|
createCompanyApplicant: w,
|
|
2434
2434
|
getApplicantData: N,
|
|
2435
2435
|
stopProgress: y
|
|
2436
2436
|
};
|
|
2437
2437
|
}
|
|
2438
|
-
const
|
|
2438
|
+
const U = ({
|
|
2439
2439
|
children: e,
|
|
2440
2440
|
variant: t = "primary",
|
|
2441
2441
|
size: r = "md",
|
|
@@ -2444,13 +2444,13 @@ const q = ({
|
|
|
2444
2444
|
className: l,
|
|
2445
2445
|
...o
|
|
2446
2446
|
}) => {
|
|
2447
|
-
const c = "inline-flex items-center justify-center rounded-lg font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2447
|
+
const c = "inline-flex items-center justify-center rounded-lg font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed", u = {
|
|
2448
2448
|
primary: "bg-primary-500 text-white hover:bg-primary-600 focus:ring-primary-500",
|
|
2449
2449
|
secondary: "bg-gray-200 text-gray-900 hover:bg-gray-300 focus:ring-gray-400",
|
|
2450
2450
|
outline: "border-2 border-primary-500 text-primary-500 hover:bg-primary-50 focus:ring-primary-500",
|
|
2451
2451
|
danger: "bg-danger-500 text-white hover:bg-danger-600 focus:ring-danger-500",
|
|
2452
2452
|
ghost: "text-gray-700 hover:bg-gray-100 focus:ring-gray-400"
|
|
2453
|
-
},
|
|
2453
|
+
}, p = {
|
|
2454
2454
|
sm: "px-3 py-1.5 text-sm",
|
|
2455
2455
|
md: "px-4 py-2 text-base",
|
|
2456
2456
|
lg: "px-6 py-3 text-lg"
|
|
@@ -2458,7 +2458,7 @@ const q = ({
|
|
|
2458
2458
|
return /* @__PURE__ */ i(
|
|
2459
2459
|
"button",
|
|
2460
2460
|
{
|
|
2461
|
-
className: ie(c,
|
|
2461
|
+
className: ie(c, u[t], p[r], l),
|
|
2462
2462
|
disabled: s || n,
|
|
2463
2463
|
...o,
|
|
2464
2464
|
children: [
|
|
@@ -2496,7 +2496,7 @@ const q = ({
|
|
|
2496
2496
|
]
|
|
2497
2497
|
}
|
|
2498
2498
|
);
|
|
2499
|
-
}, ue =
|
|
2499
|
+
}, ue = $e(
|
|
2500
2500
|
({ label: e, error: t, helperText: r, leftIcon: n, rightIcon: s, className: l, ...o }, c) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2501
2501
|
e && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2502
2502
|
e,
|
|
@@ -2562,7 +2562,7 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2562
2562
|
...r,
|
|
2563
2563
|
children: e
|
|
2564
2564
|
}
|
|
2565
|
-
),
|
|
2565
|
+
), Se = ({ children: e, variant: t = "default", className: r, ...n }) => /* @__PURE__ */ a(
|
|
2566
2566
|
"span",
|
|
2567
2567
|
{
|
|
2568
2568
|
className: ie(
|
|
@@ -2579,7 +2579,7 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2579
2579
|
...n,
|
|
2580
2580
|
children: e
|
|
2581
2581
|
}
|
|
2582
|
-
),
|
|
2582
|
+
), xe = ({ size: e = "md", className: t, ...r }) => {
|
|
2583
2583
|
const n = {
|
|
2584
2584
|
sm: "h-4 w-4",
|
|
2585
2585
|
md: "h-8 w-8",
|
|
@@ -2615,8 +2615,8 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2615
2615
|
]
|
|
2616
2616
|
}
|
|
2617
2617
|
) });
|
|
2618
|
-
}, Ae =
|
|
2619
|
-
({ label: e, error: t, helperText: r, options: n, placeholder: s, className: l, style: o, ...c },
|
|
2618
|
+
}, Ae = $e(
|
|
2619
|
+
({ label: e, error: t, helperText: r, options: n, placeholder: s, className: l, style: o, ...c }, u) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2620
2620
|
e && /* @__PURE__ */ i(
|
|
2621
2621
|
"label",
|
|
2622
2622
|
{
|
|
@@ -2631,7 +2631,7 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2631
2631
|
/* @__PURE__ */ i(
|
|
2632
2632
|
"select",
|
|
2633
2633
|
{
|
|
2634
|
-
ref:
|
|
2634
|
+
ref: u,
|
|
2635
2635
|
className: ie(
|
|
2636
2636
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2637
2637
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
@@ -2661,18 +2661,18 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2661
2661
|
},
|
|
2662
2662
|
"__placeholder__"
|
|
2663
2663
|
),
|
|
2664
|
-
n.map((
|
|
2664
|
+
n.map((p, w) => /* @__PURE__ */ a(
|
|
2665
2665
|
"option",
|
|
2666
2666
|
{
|
|
2667
|
-
value:
|
|
2668
|
-
disabled:
|
|
2667
|
+
value: p.value,
|
|
2668
|
+
disabled: p.disabled,
|
|
2669
2669
|
style: {
|
|
2670
2670
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2671
|
-
color:
|
|
2671
|
+
color: p.disabled ? "var(--metakyc-text-secondary, #9ca3af)" : "var(--metakyc-text-primary, #111827)"
|
|
2672
2672
|
},
|
|
2673
|
-
children:
|
|
2673
|
+
children: p.label
|
|
2674
2674
|
},
|
|
2675
|
-
|
|
2675
|
+
p.value || `option-${w}`
|
|
2676
2676
|
))
|
|
2677
2677
|
]
|
|
2678
2678
|
}
|
|
@@ -2682,7 +2682,7 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2682
2682
|
] })
|
|
2683
2683
|
);
|
|
2684
2684
|
Ae.displayName = "Select";
|
|
2685
|
-
const
|
|
2685
|
+
const mr = ({
|
|
2686
2686
|
label: e,
|
|
2687
2687
|
value: t,
|
|
2688
2688
|
onChange: r,
|
|
@@ -2691,22 +2691,22 @@ const or = ({
|
|
|
2691
2691
|
disabled: l = !1,
|
|
2692
2692
|
required: o = !1
|
|
2693
2693
|
}) => {
|
|
2694
|
-
const [c,
|
|
2695
|
-
|
|
2696
|
-
const b = (
|
|
2697
|
-
N.current && !N.current.contains(
|
|
2694
|
+
const [c, u] = x(!1), [p, w] = x(""), N = J(null);
|
|
2695
|
+
X(() => {
|
|
2696
|
+
const b = (m) => {
|
|
2697
|
+
N.current && !N.current.contains(m.target) && (u(!1), w(""));
|
|
2698
2698
|
};
|
|
2699
2699
|
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
2700
2700
|
}, []);
|
|
2701
2701
|
const y = n.filter(
|
|
2702
|
-
(b) => b.label.toLowerCase().includes(
|
|
2702
|
+
(b) => b.label.toLowerCase().includes(p.toLowerCase())
|
|
2703
2703
|
), h = (b) => {
|
|
2704
|
-
l || (t.includes(b) ? r(t.filter((
|
|
2705
|
-
}, g = (b,
|
|
2706
|
-
|
|
2704
|
+
l || (t.includes(b) ? r(t.filter((m) => m !== b)) : r([...t, b]));
|
|
2705
|
+
}, g = (b, m) => {
|
|
2706
|
+
m.stopPropagation(), l || r(t.filter((F) => F !== b));
|
|
2707
2707
|
}, k = (b) => {
|
|
2708
|
-
var
|
|
2709
|
-
return ((
|
|
2708
|
+
var m;
|
|
2709
|
+
return ((m = n.find((F) => F.value === b)) == null ? void 0 : m.label) || b;
|
|
2710
2710
|
};
|
|
2711
2711
|
return /* @__PURE__ */ i("div", { className: "w-full metakyc-multiselect", ref: N, children: [
|
|
2712
2712
|
e && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
@@ -2717,7 +2717,7 @@ const or = ({
|
|
|
2717
2717
|
/* @__PURE__ */ i(
|
|
2718
2718
|
"div",
|
|
2719
2719
|
{
|
|
2720
|
-
onClick: () => !l &&
|
|
2720
|
+
onClick: () => !l && u(!c),
|
|
2721
2721
|
className: ie(
|
|
2722
2722
|
"metakyc-multiselect-trigger",
|
|
2723
2723
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors",
|
|
@@ -2737,7 +2737,7 @@ const or = ({
|
|
|
2737
2737
|
"button",
|
|
2738
2738
|
{
|
|
2739
2739
|
type: "button",
|
|
2740
|
-
onClick: (
|
|
2740
|
+
onClick: (m) => g(b, m),
|
|
2741
2741
|
className: "metakyc-multiselect-chip-remove",
|
|
2742
2742
|
style: {
|
|
2743
2743
|
background: "transparent",
|
|
@@ -2779,7 +2779,7 @@ const or = ({
|
|
|
2779
2779
|
"input",
|
|
2780
2780
|
{
|
|
2781
2781
|
type: "text",
|
|
2782
|
-
value:
|
|
2782
|
+
value: p,
|
|
2783
2783
|
onChange: (b) => w(b.target.value),
|
|
2784
2784
|
placeholder: "Search...",
|
|
2785
2785
|
autoFocus: !0,
|
|
@@ -2833,7 +2833,7 @@ const or = ({
|
|
|
2833
2833
|
)
|
|
2834
2834
|
] })
|
|
2835
2835
|
] });
|
|
2836
|
-
},
|
|
2836
|
+
}, pr = ({
|
|
2837
2837
|
label: e,
|
|
2838
2838
|
error: t,
|
|
2839
2839
|
accept: r,
|
|
@@ -2843,26 +2843,26 @@ const or = ({
|
|
|
2843
2843
|
value: o = [],
|
|
2844
2844
|
className: c
|
|
2845
2845
|
}) => {
|
|
2846
|
-
const [
|
|
2847
|
-
if (!
|
|
2848
|
-
const F = Array.from(
|
|
2846
|
+
const [u, p] = x(!1), w = J(null), N = (m) => {
|
|
2847
|
+
if (!m) return;
|
|
2848
|
+
const F = Array.from(m);
|
|
2849
2849
|
if (s && F.filter((v) => v.size > s).length > 0) {
|
|
2850
|
-
const v =
|
|
2850
|
+
const v = je(s);
|
|
2851
2851
|
alert(`Some files exceed the maximum size of ${v}`);
|
|
2852
2852
|
return;
|
|
2853
2853
|
}
|
|
2854
2854
|
l == null || l(n ? [...o, ...F] : [F[0]]);
|
|
2855
|
-
}, y = (
|
|
2856
|
-
|
|
2855
|
+
}, y = (m) => {
|
|
2856
|
+
m.preventDefault(), p(!0);
|
|
2857
2857
|
}, h = () => {
|
|
2858
|
-
|
|
2859
|
-
}, g = (
|
|
2860
|
-
|
|
2858
|
+
p(!1);
|
|
2859
|
+
}, g = (m) => {
|
|
2860
|
+
m.preventDefault(), p(!1), N(m.dataTransfer.files);
|
|
2861
2861
|
}, k = () => {
|
|
2862
|
-
var
|
|
2863
|
-
(
|
|
2864
|
-
}, b = (
|
|
2865
|
-
const F = o.filter((
|
|
2862
|
+
var m;
|
|
2863
|
+
(m = w.current) == null || m.click();
|
|
2864
|
+
}, b = (m) => {
|
|
2865
|
+
const F = o.filter((S, v) => v !== m);
|
|
2866
2866
|
l == null || l(F);
|
|
2867
2867
|
};
|
|
2868
2868
|
return /* @__PURE__ */ i("div", { className: ie("w-full", c), children: [
|
|
@@ -2872,7 +2872,7 @@ const or = ({
|
|
|
2872
2872
|
{
|
|
2873
2873
|
className: ie(
|
|
2874
2874
|
"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
|
|
2875
|
-
|
|
2875
|
+
u ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
2876
2876
|
t && "border-danger-500"
|
|
2877
2877
|
),
|
|
2878
2878
|
onDragOver: y,
|
|
@@ -2888,7 +2888,7 @@ const or = ({
|
|
|
2888
2888
|
className: "hidden",
|
|
2889
2889
|
accept: r,
|
|
2890
2890
|
multiple: n,
|
|
2891
|
-
onChange: (
|
|
2891
|
+
onChange: (m) => N(m.target.files)
|
|
2892
2892
|
}
|
|
2893
2893
|
),
|
|
2894
2894
|
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
@@ -2916,13 +2916,13 @@ const or = ({
|
|
|
2916
2916
|
] }),
|
|
2917
2917
|
s && /* @__PURE__ */ i("p", { className: "text-xs text-gray-500", children: [
|
|
2918
2918
|
"Maximum file size: ",
|
|
2919
|
-
|
|
2919
|
+
je(s)
|
|
2920
2920
|
] })
|
|
2921
2921
|
] })
|
|
2922
2922
|
]
|
|
2923
2923
|
}
|
|
2924
2924
|
),
|
|
2925
|
-
o.length > 0 && /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: o.map((
|
|
2925
|
+
o.length > 0 && /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: o.map((m, F) => /* @__PURE__ */ i(
|
|
2926
2926
|
"div",
|
|
2927
2927
|
{
|
|
2928
2928
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -2944,10 +2944,10 @@ const or = ({
|
|
|
2944
2944
|
)
|
|
2945
2945
|
}
|
|
2946
2946
|
),
|
|
2947
|
-
/* @__PURE__ */ a("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children:
|
|
2947
|
+
/* @__PURE__ */ a("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: m.name }),
|
|
2948
2948
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-500", children: [
|
|
2949
2949
|
"(",
|
|
2950
|
-
|
|
2950
|
+
je(m.size),
|
|
2951
2951
|
")"
|
|
2952
2952
|
] })
|
|
2953
2953
|
] }),
|
|
@@ -2955,8 +2955,8 @@ const or = ({
|
|
|
2955
2955
|
"button",
|
|
2956
2956
|
{
|
|
2957
2957
|
type: "button",
|
|
2958
|
-
onClick: (
|
|
2959
|
-
|
|
2958
|
+
onClick: (S) => {
|
|
2959
|
+
S.stopPropagation(), b(F);
|
|
2960
2960
|
},
|
|
2961
2961
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2962
2962
|
children: /* @__PURE__ */ a("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ a(
|
|
@@ -2975,7 +2975,7 @@ const or = ({
|
|
|
2975
2975
|
)) }),
|
|
2976
2976
|
t && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-danger-500", children: t })
|
|
2977
2977
|
] });
|
|
2978
|
-
},
|
|
2978
|
+
}, hr = $e(
|
|
2979
2979
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: r, ...n }, s) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2980
2980
|
n.label && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2981
2981
|
n.label,
|
|
@@ -3010,28 +3010,28 @@ const or = ({
|
|
|
3010
3010
|
n.error && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-danger-500", children: n.error })
|
|
3011
3011
|
] })
|
|
3012
3012
|
);
|
|
3013
|
-
|
|
3013
|
+
hr.displayName = "PhoneInput";
|
|
3014
3014
|
/**
|
|
3015
3015
|
* @license lucide-react v0.574.0 - ISC
|
|
3016
3016
|
*
|
|
3017
3017
|
* This source code is licensed under the ISC license.
|
|
3018
3018
|
* See the LICENSE file in the root directory of this source tree.
|
|
3019
3019
|
*/
|
|
3020
|
-
const
|
|
3020
|
+
const at = (...e) => e.filter((t, r, n) => !!t && t.trim() !== "" && n.indexOf(t) === r).join(" ").trim();
|
|
3021
3021
|
/**
|
|
3022
3022
|
* @license lucide-react v0.574.0 - ISC
|
|
3023
3023
|
*
|
|
3024
3024
|
* This source code is licensed under the ISC license.
|
|
3025
3025
|
* See the LICENSE file in the root directory of this source tree.
|
|
3026
3026
|
*/
|
|
3027
|
-
const
|
|
3027
|
+
const gr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3028
3028
|
/**
|
|
3029
3029
|
* @license lucide-react v0.574.0 - ISC
|
|
3030
3030
|
*
|
|
3031
3031
|
* This source code is licensed under the ISC license.
|
|
3032
3032
|
* See the LICENSE file in the root directory of this source tree.
|
|
3033
3033
|
*/
|
|
3034
|
-
const
|
|
3034
|
+
const yr = (e) => e.replace(
|
|
3035
3035
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
3036
3036
|
(t, r, n) => n ? n.toUpperCase() : r.toLowerCase()
|
|
3037
3037
|
);
|
|
@@ -3041,8 +3041,8 @@ const mr = (e) => e.replace(
|
|
|
3041
3041
|
* This source code is licensed under the ISC license.
|
|
3042
3042
|
* See the LICENSE file in the root directory of this source tree.
|
|
3043
3043
|
*/
|
|
3044
|
-
const
|
|
3045
|
-
const t =
|
|
3044
|
+
const Xe = (e) => {
|
|
3045
|
+
const t = yr(e);
|
|
3046
3046
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3047
3047
|
};
|
|
3048
3048
|
/**
|
|
@@ -3051,7 +3051,7 @@ const Ve = (e) => {
|
|
|
3051
3051
|
* This source code is licensed under the ISC license.
|
|
3052
3052
|
* See the LICENSE file in the root directory of this source tree.
|
|
3053
3053
|
*/
|
|
3054
|
-
var
|
|
3054
|
+
var fr = {
|
|
3055
3055
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3056
3056
|
width: 24,
|
|
3057
3057
|
height: 24,
|
|
@@ -3068,7 +3068,7 @@ var pr = {
|
|
|
3068
3068
|
* This source code is licensed under the ISC license.
|
|
3069
3069
|
* See the LICENSE file in the root directory of this source tree.
|
|
3070
3070
|
*/
|
|
3071
|
-
const
|
|
3071
|
+
const xr = (e) => {
|
|
3072
3072
|
for (const t in e)
|
|
3073
3073
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
3074
3074
|
return !0;
|
|
@@ -3080,7 +3080,7 @@ const hr = (e) => {
|
|
|
3080
3080
|
* This source code is licensed under the ISC license.
|
|
3081
3081
|
* See the LICENSE file in the root directory of this source tree.
|
|
3082
3082
|
*/
|
|
3083
|
-
const
|
|
3083
|
+
const br = $e(
|
|
3084
3084
|
({
|
|
3085
3085
|
color: e = "currentColor",
|
|
3086
3086
|
size: t = 24,
|
|
@@ -3090,21 +3090,21 @@ const gr = Te(
|
|
|
3090
3090
|
children: l,
|
|
3091
3091
|
iconNode: o,
|
|
3092
3092
|
...c
|
|
3093
|
-
},
|
|
3093
|
+
}, u) => We(
|
|
3094
3094
|
"svg",
|
|
3095
3095
|
{
|
|
3096
|
-
ref:
|
|
3097
|
-
...
|
|
3096
|
+
ref: u,
|
|
3097
|
+
...fr,
|
|
3098
3098
|
width: t,
|
|
3099
3099
|
height: t,
|
|
3100
3100
|
stroke: e,
|
|
3101
3101
|
strokeWidth: n ? Number(r) * 24 / Number(t) : r,
|
|
3102
|
-
className:
|
|
3103
|
-
...!l && !
|
|
3102
|
+
className: at("lucide", s),
|
|
3103
|
+
...!l && !xr(c) && { "aria-hidden": "true" },
|
|
3104
3104
|
...c
|
|
3105
3105
|
},
|
|
3106
3106
|
[
|
|
3107
|
-
...o.map(([
|
|
3107
|
+
...o.map(([p, w]) => We(p, w)),
|
|
3108
3108
|
...Array.isArray(l) ? l : [l]
|
|
3109
3109
|
]
|
|
3110
3110
|
)
|
|
@@ -3115,20 +3115,20 @@ const gr = Te(
|
|
|
3115
3115
|
* This source code is licensed under the ISC license.
|
|
3116
3116
|
* See the LICENSE file in the root directory of this source tree.
|
|
3117
3117
|
*/
|
|
3118
|
-
const
|
|
3119
|
-
const r =
|
|
3120
|
-
({ className: n, ...s }, l) =>
|
|
3118
|
+
const nt = (e, t) => {
|
|
3119
|
+
const r = $e(
|
|
3120
|
+
({ className: n, ...s }, l) => We(br, {
|
|
3121
3121
|
ref: l,
|
|
3122
3122
|
iconNode: t,
|
|
3123
|
-
className:
|
|
3124
|
-
`lucide-${
|
|
3123
|
+
className: at(
|
|
3124
|
+
`lucide-${gr(Xe(e))}`,
|
|
3125
3125
|
`lucide-${e}`,
|
|
3126
3126
|
n
|
|
3127
3127
|
),
|
|
3128
3128
|
...s
|
|
3129
3129
|
})
|
|
3130
3130
|
);
|
|
3131
|
-
return r.displayName =
|
|
3131
|
+
return r.displayName = Xe(e), r;
|
|
3132
3132
|
};
|
|
3133
3133
|
/**
|
|
3134
3134
|
* @license lucide-react v0.574.0 - ISC
|
|
@@ -3136,15 +3136,15 @@ const et = (e, t) => {
|
|
|
3136
3136
|
* This source code is licensed under the ISC license.
|
|
3137
3137
|
* See the LICENSE file in the root directory of this source tree.
|
|
3138
3138
|
*/
|
|
3139
|
-
const
|
|
3139
|
+
const vr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], st = nt("chevron-left", vr);
|
|
3140
3140
|
/**
|
|
3141
3141
|
* @license lucide-react v0.574.0 - ISC
|
|
3142
3142
|
*
|
|
3143
3143
|
* This source code is licensed under the ISC license.
|
|
3144
3144
|
* See the LICENSE file in the root directory of this source tree.
|
|
3145
3145
|
*/
|
|
3146
|
-
const
|
|
3147
|
-
function
|
|
3146
|
+
const wr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], it = nt("chevron-right", wr);
|
|
3147
|
+
function kr(e, t) {
|
|
3148
3148
|
const r = !t || t.length === 0 || t.every((n) => !n || !n.trim());
|
|
3149
3149
|
if (e.isRequired && r)
|
|
3150
3150
|
return e.errorMessage || "This field is required";
|
|
@@ -3173,7 +3173,7 @@ function xr(e, t) {
|
|
|
3173
3173
|
}
|
|
3174
3174
|
return null;
|
|
3175
3175
|
}
|
|
3176
|
-
function
|
|
3176
|
+
function Nr(e) {
|
|
3177
3177
|
const t = e.flatMap(
|
|
3178
3178
|
(n, s) => (n.questions ?? []).map((l, o) => ({ question: l, groupIndex: s, qIdx: o }))
|
|
3179
3179
|
), r = /* @__PURE__ */ new Map();
|
|
@@ -3183,53 +3183,53 @@ function br(e) {
|
|
|
3183
3183
|
}
|
|
3184
3184
|
return Array.from(r.entries()).sort(([n], [s]) => n - s).map(([, n]) => n);
|
|
3185
3185
|
}
|
|
3186
|
-
const
|
|
3186
|
+
const Sr = ({
|
|
3187
3187
|
applicantId: e,
|
|
3188
3188
|
onComplete: t,
|
|
3189
3189
|
onBack: r
|
|
3190
3190
|
}) => {
|
|
3191
|
-
const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit:
|
|
3192
|
-
|
|
3193
|
-
s && Object.keys(s).length > 0 && Object.keys(
|
|
3191
|
+
const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = ir(e), [p, w] = x({}), [N, y] = x({}), [h, g] = x(0);
|
|
3192
|
+
ge.useEffect(() => {
|
|
3193
|
+
s && Object.keys(s).length > 0 && Object.keys(p).length === 0 && w(s);
|
|
3194
3194
|
}, [s]);
|
|
3195
|
-
const k =
|
|
3196
|
-
() => n ?
|
|
3195
|
+
const k = ke(
|
|
3196
|
+
() => n ? Nr(n.questionGroups) : [],
|
|
3197
3197
|
[n]
|
|
3198
|
-
), b = h === k.length - 1,
|
|
3199
|
-
w((A) => ({ ...A, [
|
|
3198
|
+
), b = h === k.length - 1, m = k[h] ?? [], F = Y((T, f) => {
|
|
3199
|
+
w((A) => ({ ...A, [T]: f })), y((A) => {
|
|
3200
3200
|
const D = { ...A };
|
|
3201
|
-
return delete D[
|
|
3201
|
+
return delete D[T], D;
|
|
3202
3202
|
});
|
|
3203
|
-
}, []),
|
|
3204
|
-
const
|
|
3205
|
-
for (const { question: f } of
|
|
3206
|
-
const A =
|
|
3207
|
-
A && (
|
|
3203
|
+
}, []), S = Y(() => {
|
|
3204
|
+
const T = {};
|
|
3205
|
+
for (const { question: f } of m) {
|
|
3206
|
+
const A = kr(f, p[f.id] ?? []);
|
|
3207
|
+
A && (T[f.id] = A);
|
|
3208
3208
|
}
|
|
3209
|
-
return y((f) => ({ ...f, ...
|
|
3210
|
-
}, [
|
|
3211
|
-
|
|
3212
|
-
},
|
|
3213
|
-
h > 0 ? g((
|
|
3214
|
-
},
|
|
3215
|
-
if (!(!
|
|
3209
|
+
return y((f) => ({ ...f, ...T })), Object.keys(T).length === 0;
|
|
3210
|
+
}, [m, p]), v = () => {
|
|
3211
|
+
S() && g((T) => T + 1);
|
|
3212
|
+
}, q = () => {
|
|
3213
|
+
h > 0 ? g((T) => T - 1) : r == null || r();
|
|
3214
|
+
}, H = async () => {
|
|
3215
|
+
if (!(!S() || !n))
|
|
3216
3216
|
try {
|
|
3217
|
-
const
|
|
3217
|
+
const T = n.questionGroups.flatMap(
|
|
3218
3218
|
(A) => (A.questions ?? []).map((D) => ({
|
|
3219
3219
|
questionId: D.id,
|
|
3220
|
-
values:
|
|
3220
|
+
values: p[D.id] ?? []
|
|
3221
3221
|
}))
|
|
3222
3222
|
), f = {
|
|
3223
3223
|
applicantId: e,
|
|
3224
3224
|
questionnarieId: n.id,
|
|
3225
|
-
questionResults:
|
|
3225
|
+
questionResults: T
|
|
3226
3226
|
};
|
|
3227
|
-
await
|
|
3228
|
-
} catch (
|
|
3229
|
-
console.error("Questionnaire submit error:",
|
|
3227
|
+
await u(f), t == null || t();
|
|
3228
|
+
} catch (T) {
|
|
3229
|
+
console.error("Questionnaire submit error:", T);
|
|
3230
3230
|
}
|
|
3231
3231
|
};
|
|
3232
|
-
return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(
|
|
3232
|
+
return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(xe, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3233
3233
|
"Error loading questionnaire: ",
|
|
3234
3234
|
c.message
|
|
3235
3235
|
] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
|
|
@@ -3243,7 +3243,7 @@ const vr = ({
|
|
|
3243
3243
|
" of ",
|
|
3244
3244
|
k.length
|
|
3245
3245
|
] }),
|
|
3246
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: k.map((
|
|
3246
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: k.map((T, f) => /* @__PURE__ */ a(
|
|
3247
3247
|
"div",
|
|
3248
3248
|
{
|
|
3249
3249
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3257,54 +3257,54 @@ const vr = ({
|
|
|
3257
3257
|
)) })
|
|
3258
3258
|
] })
|
|
3259
3259
|
] }),
|
|
3260
|
-
/* @__PURE__ */ a(B, { className: "space-y-6", children:
|
|
3261
|
-
|
|
3260
|
+
/* @__PURE__ */ a(B, { className: "space-y-6", children: m.map(({ question: T }) => /* @__PURE__ */ a(
|
|
3261
|
+
Cr,
|
|
3262
3262
|
{
|
|
3263
|
-
question:
|
|
3264
|
-
value:
|
|
3265
|
-
error: N[
|
|
3266
|
-
onChange: (f) => F(
|
|
3263
|
+
question: T,
|
|
3264
|
+
value: p[T.id] ?? [],
|
|
3265
|
+
error: N[T.id],
|
|
3266
|
+
onChange: (f) => F(T.id, f)
|
|
3267
3267
|
},
|
|
3268
|
-
|
|
3268
|
+
T.id
|
|
3269
3269
|
)) }),
|
|
3270
3270
|
/* @__PURE__ */ i(me, { className: "flex items-center justify-between", children: [
|
|
3271
3271
|
/* @__PURE__ */ i(
|
|
3272
|
-
|
|
3272
|
+
U,
|
|
3273
3273
|
{
|
|
3274
3274
|
type: "button",
|
|
3275
3275
|
variant: "outline",
|
|
3276
|
-
onClick:
|
|
3276
|
+
onClick: q,
|
|
3277
3277
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3278
3278
|
children: [
|
|
3279
|
-
/* @__PURE__ */ a(
|
|
3279
|
+
/* @__PURE__ */ a(st, { size: 14 }),
|
|
3280
3280
|
h > 0 ? "Previous" : "Back"
|
|
3281
3281
|
]
|
|
3282
3282
|
}
|
|
3283
3283
|
),
|
|
3284
3284
|
b ? /* @__PURE__ */ a(
|
|
3285
|
-
|
|
3285
|
+
U,
|
|
3286
3286
|
{
|
|
3287
3287
|
type: "button",
|
|
3288
3288
|
isLoading: o,
|
|
3289
|
-
onClick:
|
|
3289
|
+
onClick: H,
|
|
3290
3290
|
children: "Continue"
|
|
3291
3291
|
}
|
|
3292
3292
|
) : /* @__PURE__ */ i(
|
|
3293
|
-
|
|
3293
|
+
U,
|
|
3294
3294
|
{
|
|
3295
3295
|
type: "button",
|
|
3296
3296
|
onClick: v,
|
|
3297
3297
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3298
3298
|
children: [
|
|
3299
3299
|
"Next",
|
|
3300
|
-
/* @__PURE__ */ a(
|
|
3300
|
+
/* @__PURE__ */ a(it, { size: 14 })
|
|
3301
3301
|
]
|
|
3302
3302
|
}
|
|
3303
3303
|
)
|
|
3304
3304
|
] }),
|
|
3305
3305
|
c && /* @__PURE__ */ a("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: c.message }) })
|
|
3306
3306
|
] }) : null;
|
|
3307
|
-
},
|
|
3307
|
+
}, Cr = ({ question: e, value: t, error: r, onChange: n }) => {
|
|
3308
3308
|
var o;
|
|
3309
3309
|
const l = (((o = e.defaultAnswers) == null ? void 0 : o.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
3310
3310
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
@@ -3383,8 +3383,8 @@ const vr = ({
|
|
|
3383
3383
|
{
|
|
3384
3384
|
type: "checkbox",
|
|
3385
3385
|
checked: t.includes(c),
|
|
3386
|
-
onChange: (
|
|
3387
|
-
|
|
3386
|
+
onChange: (u) => {
|
|
3387
|
+
u.target.checked ? n([...t, c]) : n(t.filter((p) => p !== c));
|
|
3388
3388
|
},
|
|
3389
3389
|
className: "metakyc-option-input",
|
|
3390
3390
|
style: {
|
|
@@ -3411,19 +3411,19 @@ const vr = ({
|
|
|
3411
3411
|
] }),
|
|
3412
3412
|
r && l === "text" && null
|
|
3413
3413
|
] });
|
|
3414
|
-
},
|
|
3414
|
+
}, Ar = ({
|
|
3415
3415
|
applicantId: e,
|
|
3416
3416
|
onComplete: t,
|
|
3417
3417
|
onBack: r
|
|
3418
3418
|
}) => {
|
|
3419
|
-
const { uploadDocument: n, isLoading: s, isSubmitting: l, error: o, submit: c } =
|
|
3419
|
+
const { uploadDocument: n, isLoading: s, isSubmitting: l, error: o, submit: c } = lr(e), [u, p] = x({}), w = async (N) => {
|
|
3420
3420
|
if (N.preventDefault(), !n) return;
|
|
3421
3421
|
const y = await Promise.all(
|
|
3422
3422
|
n.uploadDocumentFiles.map(async (g) => {
|
|
3423
|
-
const k =
|
|
3424
|
-
k.map(async (
|
|
3425
|
-
fileName:
|
|
3426
|
-
fileData: await
|
|
3423
|
+
const k = u[g.id] || [], b = await Promise.all(
|
|
3424
|
+
k.map(async (m) => ({
|
|
3425
|
+
fileName: m.name,
|
|
3426
|
+
fileData: await Xt(m)
|
|
3427
3427
|
}))
|
|
3428
3428
|
);
|
|
3429
3429
|
return {
|
|
@@ -3438,7 +3438,7 @@ const vr = ({
|
|
|
3438
3438
|
};
|
|
3439
3439
|
await c(h), t == null || t();
|
|
3440
3440
|
};
|
|
3441
|
-
return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(
|
|
3441
|
+
return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(xe, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3442
3442
|
"Error loading document requirements: ",
|
|
3443
3443
|
o.message
|
|
3444
3444
|
] }) }) }) : n ? /* @__PURE__ */ a("form", { onSubmit: w, children: /* @__PURE__ */ i($, { children: [
|
|
@@ -3447,29 +3447,29 @@ const vr = ({
|
|
|
3447
3447
|
n.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.subtitle })
|
|
3448
3448
|
] }),
|
|
3449
3449
|
/* @__PURE__ */ a(B, { className: "space-y-6", children: n.uploadDocumentFiles.map((N) => /* @__PURE__ */ a(
|
|
3450
|
-
|
|
3450
|
+
pr,
|
|
3451
3451
|
{
|
|
3452
3452
|
label: N.displayName,
|
|
3453
3453
|
accept: N.allowedTypes,
|
|
3454
3454
|
multiple: N.multipleFile,
|
|
3455
3455
|
maxSize: N.maxEachFileSizeByte,
|
|
3456
|
-
value:
|
|
3456
|
+
value: u[N.id] || [],
|
|
3457
3457
|
onChange: (y) => {
|
|
3458
|
-
|
|
3458
|
+
p((h) => ({ ...h, [N.id]: y }));
|
|
3459
3459
|
}
|
|
3460
3460
|
},
|
|
3461
3461
|
N.id
|
|
3462
3462
|
)) }),
|
|
3463
3463
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
3464
|
-
r && /* @__PURE__ */ a(
|
|
3465
|
-
/* @__PURE__ */ a(
|
|
3464
|
+
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3465
|
+
/* @__PURE__ */ a(U, { type: "submit", isLoading: l, children: "Continue" })
|
|
3466
3466
|
] })
|
|
3467
3467
|
] }) }) : null;
|
|
3468
|
-
},
|
|
3469
|
-
const { overview: n, isLoading: s, isSubmitting: l, error: o, passOverview: c } =
|
|
3468
|
+
}, Ir = ({ applicantId: e, onComplete: t, onBack: r }) => {
|
|
3469
|
+
const { overview: n, isLoading: s, isSubmitting: l, error: o, passOverview: c } = or(e), u = async () => {
|
|
3470
3470
|
await c(), t == null || t();
|
|
3471
3471
|
};
|
|
3472
|
-
return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(
|
|
3472
|
+
return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(xe, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3473
3473
|
"Error loading overview: ",
|
|
3474
3474
|
o.message
|
|
3475
3475
|
] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
|
|
@@ -3477,8 +3477,8 @@ const vr = ({
|
|
|
3477
3477
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.title || "Overview" }),
|
|
3478
3478
|
n.description && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.description })
|
|
3479
3479
|
] }),
|
|
3480
|
-
/* @__PURE__ */ a(B, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((
|
|
3481
|
-
/* @__PURE__ */ a("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ a("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children:
|
|
3480
|
+
/* @__PURE__ */ a(B, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((p, w) => p.order - w.order).map((p) => /* @__PURE__ */ i("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3481
|
+
/* @__PURE__ */ a("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ a("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: p.order + 1 }) }),
|
|
3482
3482
|
/* @__PURE__ */ i(
|
|
3483
3483
|
"div",
|
|
3484
3484
|
{
|
|
@@ -3490,19 +3490,19 @@ const vr = ({
|
|
|
3490
3490
|
background: "transparent"
|
|
3491
3491
|
},
|
|
3492
3492
|
children: [
|
|
3493
|
-
/* @__PURE__ */ a("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children:
|
|
3494
|
-
|
|
3493
|
+
/* @__PURE__ */ a("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children: p.title }),
|
|
3494
|
+
p.description && /* @__PURE__ */ a("p", { className: "metakyc-step-description text-sm text-gray-600 dark:text-gray-400", children: p.description })
|
|
3495
3495
|
]
|
|
3496
3496
|
}
|
|
3497
3497
|
)
|
|
3498
|
-
] },
|
|
3498
|
+
] }, p.order)) : /* @__PURE__ */ a("div", { className: "text-center py-8", children: /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
|
|
3499
3499
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
3500
|
-
r && /* @__PURE__ */ a(
|
|
3501
|
-
/* @__PURE__ */ a(
|
|
3500
|
+
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3501
|
+
/* @__PURE__ */ a(U, { onClick: u, isLoading: l, children: "Continue" })
|
|
3502
3502
|
] })
|
|
3503
3503
|
] }) : null;
|
|
3504
3504
|
};
|
|
3505
|
-
function
|
|
3505
|
+
function Er(e, t) {
|
|
3506
3506
|
const r = !t || t.length === 0 || t.every((n) => !n || !n.trim());
|
|
3507
3507
|
if (e.isRequired && r)
|
|
3508
3508
|
return e.errorMessage || `${e.displayName} is required`;
|
|
@@ -3532,65 +3532,65 @@ function Sr(e, t) {
|
|
|
3532
3532
|
}
|
|
3533
3533
|
return null;
|
|
3534
3534
|
}
|
|
3535
|
-
function
|
|
3535
|
+
function Rr(e) {
|
|
3536
3536
|
const t = /* @__PURE__ */ new Map();
|
|
3537
3537
|
return e.forEach((r, n) => {
|
|
3538
3538
|
const s = r.pageNumber != null && r.pageNumber > 0 ? r.pageNumber : 1;
|
|
3539
3539
|
t.has(s) || t.set(s, []), t.get(s).push({ criterion: r, idx: n });
|
|
3540
3540
|
}), Array.from(t.entries()).sort(([r], [n]) => r - n).map(([, r]) => r);
|
|
3541
3541
|
}
|
|
3542
|
-
function
|
|
3542
|
+
function Fr(e) {
|
|
3543
3543
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
3544
3544
|
}
|
|
3545
|
-
const
|
|
3545
|
+
const Dr = ({
|
|
3546
3546
|
applicantId: e,
|
|
3547
3547
|
onComplete: t,
|
|
3548
3548
|
onBack: r
|
|
3549
3549
|
}) => {
|
|
3550
|
-
const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit:
|
|
3551
|
-
|
|
3552
|
-
s && Object.keys(s).length > 0 && Object.keys(
|
|
3550
|
+
const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = dr(e), [p, w] = x({}), [N, y] = x({}), [h, g] = x(0), [k, b] = x(!1);
|
|
3551
|
+
ge.useEffect(() => {
|
|
3552
|
+
s && Object.keys(s).length > 0 && Object.keys(p).length === 0 && w(s);
|
|
3553
3553
|
}, [s]);
|
|
3554
|
-
const
|
|
3555
|
-
() => n && n.length > 0 ?
|
|
3554
|
+
const m = ke(
|
|
3555
|
+
() => n && n.length > 0 ? Rr(n) : [],
|
|
3556
3556
|
[n]
|
|
3557
|
-
), F = h ===
|
|
3558
|
-
|
|
3559
|
-
!l && n && n.length === 0 && !k && !o && (b(!0),
|
|
3560
|
-
}, [l, n, k, o,
|
|
3561
|
-
const v =
|
|
3562
|
-
w((
|
|
3563
|
-
const
|
|
3564
|
-
return delete
|
|
3557
|
+
), F = h === m.length - 1, S = m[h] ?? [];
|
|
3558
|
+
ge.useEffect(() => {
|
|
3559
|
+
!l && n && n.length === 0 && !k && !o && (b(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
3560
|
+
}, [l, n, k, o, u, e, t]);
|
|
3561
|
+
const v = Y((A, D) => {
|
|
3562
|
+
w((Q) => ({ ...Q, [A]: D })), y((Q) => {
|
|
3563
|
+
const W = { ...Q };
|
|
3564
|
+
return delete W[A], W;
|
|
3565
3565
|
});
|
|
3566
|
-
}, []),
|
|
3566
|
+
}, []), q = Y(() => {
|
|
3567
3567
|
const A = {};
|
|
3568
|
-
for (const { criterion: D } of
|
|
3569
|
-
const
|
|
3570
|
-
|
|
3568
|
+
for (const { criterion: D } of S) {
|
|
3569
|
+
const Q = Er(D, p[D.id] ?? []);
|
|
3570
|
+
Q && (A[D.id] = Q);
|
|
3571
3571
|
}
|
|
3572
3572
|
return y((D) => ({ ...D, ...A })), Object.keys(A).length === 0;
|
|
3573
|
-
}, [
|
|
3574
|
-
|
|
3575
|
-
},
|
|
3573
|
+
}, [S, p]), H = () => {
|
|
3574
|
+
q() && g((A) => A + 1);
|
|
3575
|
+
}, T = () => {
|
|
3576
3576
|
h > 0 ? g((A) => A - 1) : r == null || r();
|
|
3577
3577
|
}, f = async () => {
|
|
3578
|
-
if (!(!
|
|
3578
|
+
if (!(!q() || !n))
|
|
3579
3579
|
try {
|
|
3580
|
-
const A = n.map((
|
|
3581
|
-
const
|
|
3582
|
-
return
|
|
3583
|
-
}).filter((
|
|
3584
|
-
await
|
|
3580
|
+
const A = n.map((Q) => {
|
|
3581
|
+
const W = (p[Q.id] ?? []).filter((P) => P && P.trim());
|
|
3582
|
+
return W.length > 0 ? { riskCriteriaId: Q.id, values: W } : null;
|
|
3583
|
+
}).filter((Q) => Q !== null);
|
|
3584
|
+
await u({ applicantId: e, criteriaValueInputs: A }), t == null || t();
|
|
3585
3585
|
} catch (A) {
|
|
3586
3586
|
console.error("Risk scoring submit error:", A);
|
|
3587
3587
|
}
|
|
3588
3588
|
};
|
|
3589
3589
|
return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
3590
|
-
/* @__PURE__ */ a(
|
|
3590
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
3591
3591
|
/* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
3592
3592
|
] }) }) : !l && n && n.length === 0 ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
3593
|
-
/* @__PURE__ */ a(
|
|
3593
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
3594
3594
|
/* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
3595
3595
|
] }) }) : c ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3596
3596
|
"Error loading criteria: ",
|
|
@@ -3599,14 +3599,14 @@ const Ir = ({
|
|
|
3599
3599
|
/* @__PURE__ */ i(oe, { children: [
|
|
3600
3600
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3601
3601
|
/* @__PURE__ */ a("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
3602
|
-
|
|
3602
|
+
m.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3603
3603
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3604
3604
|
"Page ",
|
|
3605
3605
|
h + 1,
|
|
3606
3606
|
" of ",
|
|
3607
|
-
|
|
3607
|
+
m.length
|
|
3608
3608
|
] }),
|
|
3609
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children:
|
|
3609
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: m.map((A, D) => /* @__PURE__ */ a(
|
|
3610
3610
|
"div",
|
|
3611
3611
|
{
|
|
3612
3612
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3620,11 +3620,11 @@ const Ir = ({
|
|
|
3620
3620
|
)) })
|
|
3621
3621
|
] })
|
|
3622
3622
|
] }),
|
|
3623
|
-
/* @__PURE__ */ a(B, { className: "space-y-6", children:
|
|
3624
|
-
|
|
3623
|
+
/* @__PURE__ */ a(B, { className: "space-y-6", children: S.map(({ criterion: A }) => /* @__PURE__ */ a(
|
|
3624
|
+
Pr,
|
|
3625
3625
|
{
|
|
3626
3626
|
criterion: A,
|
|
3627
|
-
value:
|
|
3627
|
+
value: p[A.id] ?? [],
|
|
3628
3628
|
error: N[A.id],
|
|
3629
3629
|
onChange: (D) => v(A.id, D)
|
|
3630
3630
|
},
|
|
@@ -3632,35 +3632,35 @@ const Ir = ({
|
|
|
3632
3632
|
)) }),
|
|
3633
3633
|
/* @__PURE__ */ i(me, { className: "flex items-center justify-between", children: [
|
|
3634
3634
|
/* @__PURE__ */ i(
|
|
3635
|
-
|
|
3635
|
+
U,
|
|
3636
3636
|
{
|
|
3637
3637
|
type: "button",
|
|
3638
3638
|
variant: "outline",
|
|
3639
|
-
onClick:
|
|
3639
|
+
onClick: T,
|
|
3640
3640
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3641
3641
|
children: [
|
|
3642
|
-
/* @__PURE__ */ a(
|
|
3642
|
+
/* @__PURE__ */ a(st, { size: 14 }),
|
|
3643
3643
|
h > 0 ? "Previous" : "Back"
|
|
3644
3644
|
]
|
|
3645
3645
|
}
|
|
3646
3646
|
),
|
|
3647
|
-
F ? /* @__PURE__ */ a(
|
|
3648
|
-
|
|
3647
|
+
F ? /* @__PURE__ */ a(U, { type: "button", isLoading: o, onClick: f, children: "Continue" }) : /* @__PURE__ */ i(
|
|
3648
|
+
U,
|
|
3649
3649
|
{
|
|
3650
3650
|
type: "button",
|
|
3651
|
-
onClick:
|
|
3651
|
+
onClick: H,
|
|
3652
3652
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3653
3653
|
children: [
|
|
3654
3654
|
"Next",
|
|
3655
|
-
/* @__PURE__ */ a(
|
|
3655
|
+
/* @__PURE__ */ a(it, { size: 14 })
|
|
3656
3656
|
]
|
|
3657
3657
|
}
|
|
3658
3658
|
)
|
|
3659
3659
|
] }),
|
|
3660
3660
|
c && /* @__PURE__ */ a("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: c.message }) })
|
|
3661
3661
|
] }) : null;
|
|
3662
|
-
},
|
|
3663
|
-
const s =
|
|
3662
|
+
}, Pr = ({ criterion: e, value: t, error: r, onChange: n }) => {
|
|
3663
|
+
const s = Fr(e), l = e.valueDataType === Ce.Integer || e.valueDataType === Ce.Decimal || e.valueDataType === Ce.DigitOnly;
|
|
3664
3664
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
3665
3665
|
/* @__PURE__ */ i("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
3666
3666
|
e.displayName,
|
|
@@ -3733,7 +3733,7 @@ const Ir = ({
|
|
|
3733
3733
|
type: "checkbox",
|
|
3734
3734
|
checked: t.includes(o),
|
|
3735
3735
|
onChange: (c) => {
|
|
3736
|
-
c.target.checked ? n([...t, o]) : n(t.filter((
|
|
3736
|
+
c.target.checked ? n([...t, o]) : n(t.filter((u) => u !== o));
|
|
3737
3737
|
},
|
|
3738
3738
|
className: "metakyc-option-input",
|
|
3739
3739
|
style: {
|
|
@@ -3776,18 +3776,18 @@ const Ir = ({
|
|
|
3776
3776
|
}
|
|
3777
3777
|
)
|
|
3778
3778
|
] });
|
|
3779
|
-
},
|
|
3779
|
+
}, Lr = ({
|
|
3780
3780
|
applicantId: e,
|
|
3781
3781
|
onComplete: t,
|
|
3782
3782
|
onBack: r
|
|
3783
3783
|
}) => {
|
|
3784
|
-
const { investorCategorizationService: n } = he(), [s, l] = x(null), [o, c] = x(!1), [
|
|
3784
|
+
const { investorCategorizationService: n } = he(), [s, l] = x(null), [o, c] = x(!1), [u, p] = x(null);
|
|
3785
3785
|
return /* @__PURE__ */ a("form", { onSubmit: async (N) => {
|
|
3786
3786
|
if (N.preventDefault(), s === null) {
|
|
3787
|
-
|
|
3787
|
+
p("Please select an investor type");
|
|
3788
3788
|
return;
|
|
3789
3789
|
}
|
|
3790
|
-
c(!0),
|
|
3790
|
+
c(!0), p(null);
|
|
3791
3791
|
try {
|
|
3792
3792
|
const y = {
|
|
3793
3793
|
applicantId: e,
|
|
@@ -3797,7 +3797,7 @@ const Ir = ({
|
|
|
3797
3797
|
const h = await n.setInvestorCategorization(y);
|
|
3798
3798
|
console.log("Investor categorization result:", h), t == null || t();
|
|
3799
3799
|
} catch (y) {
|
|
3800
|
-
console.error("Error submitting investor categorization:", y),
|
|
3800
|
+
console.error("Error submitting investor categorization:", y), p(y.message || "Failed to submit investor categorization");
|
|
3801
3801
|
} finally {
|
|
3802
3802
|
c(!1);
|
|
3803
3803
|
}
|
|
@@ -3895,16 +3895,16 @@ const Ir = ({
|
|
|
3895
3895
|
] })
|
|
3896
3896
|
}
|
|
3897
3897
|
),
|
|
3898
|
-
|
|
3898
|
+
u && /* @__PURE__ */ a("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
3899
3899
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
3900
3900
|
" ",
|
|
3901
|
-
|
|
3901
|
+
u
|
|
3902
3902
|
] }) })
|
|
3903
3903
|
] }),
|
|
3904
3904
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
3905
|
-
r && /* @__PURE__ */ a(
|
|
3905
|
+
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3906
3906
|
/* @__PURE__ */ a(
|
|
3907
|
-
|
|
3907
|
+
U,
|
|
3908
3908
|
{
|
|
3909
3909
|
type: "submit",
|
|
3910
3910
|
isLoading: o,
|
|
@@ -3914,116 +3914,116 @@ const Ir = ({
|
|
|
3914
3914
|
)
|
|
3915
3915
|
] })
|
|
3916
3916
|
] }) });
|
|
3917
|
-
},
|
|
3917
|
+
}, Mr = ({
|
|
3918
3918
|
applicantId: e,
|
|
3919
3919
|
onComplete: t,
|
|
3920
3920
|
onBack: r
|
|
3921
3921
|
}) => {
|
|
3922
|
-
const { appropriatenessTestService: n } = he(), [s, l] = x(null), [o, c] = x(!0), [
|
|
3923
|
-
|
|
3922
|
+
const { appropriatenessTestService: n } = he(), [s, l] = x(null), [o, c] = x(!0), [u, p] = x(!1), [w, N] = x(null), [y, h] = x({}), [g, k] = x(0), [b, m] = x(!1), [F, S] = x(!1), [v, q] = x(0);
|
|
3923
|
+
X(() => {
|
|
3924
3924
|
(async () => {
|
|
3925
3925
|
try {
|
|
3926
3926
|
c(!0), N(null), console.log("Loading appropriateness test for applicant:", e);
|
|
3927
|
-
const
|
|
3928
|
-
if (console.log("Appropriateness test data:",
|
|
3929
|
-
const
|
|
3930
|
-
|
|
3927
|
+
const R = await n.getAppropriatenessTest(e);
|
|
3928
|
+
if (console.log("Appropriateness test data:", R), l(R), R.waitTimeSpanForNextTry && R.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3929
|
+
const G = H(R.waitTimeSpanForNextTry);
|
|
3930
|
+
G > 0 && q(G);
|
|
3931
3931
|
}
|
|
3932
|
-
} catch (
|
|
3933
|
-
console.error("Error loading appropriateness test:",
|
|
3932
|
+
} catch (R) {
|
|
3933
|
+
console.error("Error loading appropriateness test:", R), N(R.message || "Failed to load appropriateness test");
|
|
3934
3934
|
} finally {
|
|
3935
3935
|
c(!1);
|
|
3936
3936
|
}
|
|
3937
3937
|
})();
|
|
3938
3938
|
}, [e, n]);
|
|
3939
|
-
const
|
|
3940
|
-
const
|
|
3941
|
-
if (
|
|
3942
|
-
const [
|
|
3943
|
-
return
|
|
3939
|
+
const H = (P) => {
|
|
3940
|
+
const R = P.split(":").map(Number);
|
|
3941
|
+
if (R.length === 3) {
|
|
3942
|
+
const [G, K, le] = R;
|
|
3943
|
+
return G * 3600 + K * 60 + le;
|
|
3944
3944
|
}
|
|
3945
3945
|
return 0;
|
|
3946
|
-
},
|
|
3947
|
-
const
|
|
3948
|
-
return `${
|
|
3946
|
+
}, T = (P) => {
|
|
3947
|
+
const R = Math.floor(P / 60), G = P % 60;
|
|
3948
|
+
return `${R.toString().padStart(2, "0")}:${G.toString().padStart(2, "0")}`;
|
|
3949
3949
|
};
|
|
3950
|
-
|
|
3950
|
+
X(() => {
|
|
3951
3951
|
if (!b || g <= 0) return;
|
|
3952
3952
|
const P = setInterval(() => {
|
|
3953
|
-
k((
|
|
3953
|
+
k((R) => R <= 1 ? (S(!0), 0) : R - 1);
|
|
3954
3954
|
}, 1e3);
|
|
3955
3955
|
return () => clearInterval(P);
|
|
3956
|
-
}, [b, g]),
|
|
3956
|
+
}, [b, g]), X(() => {
|
|
3957
3957
|
if (v <= 0) return;
|
|
3958
3958
|
const P = setInterval(() => {
|
|
3959
|
-
|
|
3959
|
+
q((R) => R <= 1 ? 0 : R - 1);
|
|
3960
3960
|
}, 1e3);
|
|
3961
3961
|
return () => clearInterval(P);
|
|
3962
|
-
}, [v]),
|
|
3963
|
-
F && !
|
|
3962
|
+
}, [v]), X(() => {
|
|
3963
|
+
F && !u && D();
|
|
3964
3964
|
}, [F]);
|
|
3965
3965
|
const f = () => {
|
|
3966
|
-
s && (
|
|
3967
|
-
}, A = (P,
|
|
3968
|
-
h((
|
|
3969
|
-
...
|
|
3970
|
-
[P]:
|
|
3966
|
+
s && (m(!0), k(s.testDurationSec));
|
|
3967
|
+
}, A = (P, R) => {
|
|
3968
|
+
h((G) => ({
|
|
3969
|
+
...G,
|
|
3970
|
+
[P]: R
|
|
3971
3971
|
}));
|
|
3972
3972
|
}, D = async (P) => {
|
|
3973
3973
|
if (P && P.preventDefault(), !!s) {
|
|
3974
3974
|
if (!F) {
|
|
3975
|
-
const
|
|
3976
|
-
if (
|
|
3977
|
-
N(`Please answer all questions. ${
|
|
3975
|
+
const R = s.appropriatenessQuestions.length - Object.keys(y).length;
|
|
3976
|
+
if (R > 0) {
|
|
3977
|
+
N(`Please answer all questions. ${R} question(s) remaining.`);
|
|
3978
3978
|
return;
|
|
3979
3979
|
}
|
|
3980
3980
|
}
|
|
3981
|
-
|
|
3981
|
+
p(!0), N(null);
|
|
3982
3982
|
try {
|
|
3983
|
-
const
|
|
3984
|
-
(
|
|
3985
|
-
appropriatenessQuestionId:
|
|
3986
|
-
value: y[
|
|
3983
|
+
const R = s.appropriatenessQuestions.map(
|
|
3984
|
+
(K) => ({
|
|
3985
|
+
appropriatenessQuestionId: K.id,
|
|
3986
|
+
value: y[K.id] || ""
|
|
3987
3987
|
// Empty string if not answered
|
|
3988
3988
|
})
|
|
3989
|
-
),
|
|
3989
|
+
), G = {
|
|
3990
3990
|
applicantId: e,
|
|
3991
3991
|
appropriatenessTestId: s.id,
|
|
3992
|
-
appropriatenessQuestionResults:
|
|
3992
|
+
appropriatenessQuestionResults: R
|
|
3993
3993
|
};
|
|
3994
|
-
console.log("Submitting appropriateness test:",
|
|
3994
|
+
console.log("Submitting appropriateness test:", G);
|
|
3995
3995
|
try {
|
|
3996
|
-
const
|
|
3997
|
-
console.log("Appropriateness test result:",
|
|
3998
|
-
} catch (
|
|
3999
|
-
if (
|
|
4000
|
-
const le =
|
|
4001
|
-
console.log("Test failed:", le), N(le),
|
|
3996
|
+
const K = await n.fillAppropriatenessTest(G);
|
|
3997
|
+
console.log("Appropriateness test result:", K), K.message && (K.message.toLowerCase().includes("pass") || K.message.toLowerCase().includes("success") || K.message.toLowerCase().includes("congratulations")) ? t == null || t() : (N(K.message || "Test completed. Please check the result."), m(!1), S(!1), h({}), setTimeout(() => Q(), 1e3));
|
|
3998
|
+
} catch (K) {
|
|
3999
|
+
if (K.code === 400 && K.message) {
|
|
4000
|
+
const le = K.message;
|
|
4001
|
+
console.log("Test failed:", le), N(le), m(!1), S(!1), h({}), setTimeout(() => Q(), 1500);
|
|
4002
4002
|
} else
|
|
4003
|
-
throw
|
|
4003
|
+
throw K;
|
|
4004
4004
|
}
|
|
4005
|
-
} catch (
|
|
4006
|
-
console.error("Error submitting appropriateness test:",
|
|
4005
|
+
} catch (R) {
|
|
4006
|
+
console.error("Error submitting appropriateness test:", R), N(R.message || "Failed to submit test. Please try again."), m(!1), S(!1), h({});
|
|
4007
4007
|
} finally {
|
|
4008
|
-
|
|
4008
|
+
p(!1);
|
|
4009
4009
|
}
|
|
4010
4010
|
}
|
|
4011
|
-
},
|
|
4011
|
+
}, Q = async () => {
|
|
4012
4012
|
try {
|
|
4013
4013
|
const P = await n.getAppropriatenessTest(e);
|
|
4014
4014
|
if (console.log("Reloaded test data:", P), l(P), P.waitTimeSpanForNextTry && P.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4015
|
-
const
|
|
4016
|
-
|
|
4015
|
+
const R = H(P.waitTimeSpanForNextTry);
|
|
4016
|
+
R > 0 && q(R);
|
|
4017
4017
|
}
|
|
4018
4018
|
} catch (P) {
|
|
4019
|
-
console.error("Error reloading test data:", P), N((
|
|
4019
|
+
console.error("Error reloading test data:", P), N((R) => R + `
|
|
4020
4020
|
|
|
4021
4021
|
Failed to reload test data. Please refresh the page.`);
|
|
4022
4022
|
}
|
|
4023
4023
|
};
|
|
4024
4024
|
if (o)
|
|
4025
4025
|
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
4026
|
-
/* @__PURE__ */ a(
|
|
4026
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
4027
4027
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
4028
4028
|
] }) });
|
|
4029
4029
|
if (!s)
|
|
@@ -4039,13 +4039,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4039
4039
|
] }),
|
|
4040
4040
|
/* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
|
|
4041
4041
|
/* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
4042
|
-
/* @__PURE__ */ a("div", { className: "text-6xl font-bold text-primary-500 mb-2", children:
|
|
4042
|
+
/* @__PURE__ */ a("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: T(v) }),
|
|
4043
4043
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
4044
4044
|
] }),
|
|
4045
4045
|
w && /* @__PURE__ */ a("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ a("p", { className: "text-red-600 dark:text-red-400 text-sm", children: w }) })
|
|
4046
4046
|
] })
|
|
4047
4047
|
] });
|
|
4048
|
-
const
|
|
4048
|
+
const W = s.testAllowedMaxTry - s.totalFailedTries;
|
|
4049
4049
|
return b ? /* @__PURE__ */ a("form", { onSubmit: D, children: /* @__PURE__ */ i($, { children: [
|
|
4050
4050
|
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4051
4051
|
/* @__PURE__ */ i("div", { children: [
|
|
@@ -4057,7 +4057,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4057
4057
|
"div",
|
|
4058
4058
|
{
|
|
4059
4059
|
className: `text-3xl font-bold ${g <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
4060
|
-
children:
|
|
4060
|
+
children: T(g)
|
|
4061
4061
|
}
|
|
4062
4062
|
),
|
|
4063
4063
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
@@ -4065,20 +4065,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4065
4065
|
] }) }),
|
|
4066
4066
|
/* @__PURE__ */ i(B, { className: "space-y-6", children: [
|
|
4067
4067
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4068
|
-
/* @__PURE__ */ i(
|
|
4068
|
+
/* @__PURE__ */ i(Se, { variant: "info", children: [
|
|
4069
4069
|
"Question ",
|
|
4070
4070
|
Object.keys(y).length,
|
|
4071
4071
|
" of ",
|
|
4072
4072
|
s.totalQuestionCount
|
|
4073
4073
|
] }),
|
|
4074
|
-
/* @__PURE__ */ i(
|
|
4075
|
-
|
|
4074
|
+
/* @__PURE__ */ i(Se, { variant: W > 1 ? "success" : "warning", children: [
|
|
4075
|
+
W,
|
|
4076
4076
|
" attempt",
|
|
4077
|
-
|
|
4077
|
+
W !== 1 ? "s" : "",
|
|
4078
4078
|
" remaining"
|
|
4079
4079
|
] })
|
|
4080
4080
|
] }),
|
|
4081
|
-
s.appropriatenessQuestions.map((P,
|
|
4081
|
+
s.appropriatenessQuestions.map((P, R) => /* @__PURE__ */ i(
|
|
4082
4082
|
"div",
|
|
4083
4083
|
{
|
|
4084
4084
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -4086,17 +4086,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4086
4086
|
/* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
4087
4087
|
/* @__PURE__ */ i("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
|
|
4088
4088
|
"Question ",
|
|
4089
|
-
|
|
4089
|
+
R + 1
|
|
4090
4090
|
] }),
|
|
4091
4091
|
P.groupName && /* @__PURE__ */ a("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: P.groupName }),
|
|
4092
4092
|
/* @__PURE__ */ a("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: P.question })
|
|
4093
4093
|
] }),
|
|
4094
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: P.answers.map((
|
|
4094
|
+
/* @__PURE__ */ a("div", { className: "space-y-2", children: P.answers.map((G, K) => /* @__PURE__ */ i(
|
|
4095
4095
|
"label",
|
|
4096
4096
|
{
|
|
4097
4097
|
className: `
|
|
4098
4098
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
4099
|
-
${y[P.id] ===
|
|
4099
|
+
${y[P.id] === G ? "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"}
|
|
4100
4100
|
`,
|
|
4101
4101
|
children: [
|
|
4102
4102
|
/* @__PURE__ */ a(
|
|
@@ -4104,17 +4104,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4104
4104
|
{
|
|
4105
4105
|
type: "radio",
|
|
4106
4106
|
name: `question-${P.id}`,
|
|
4107
|
-
value:
|
|
4108
|
-
checked: y[P.id] ===
|
|
4107
|
+
value: G,
|
|
4108
|
+
checked: y[P.id] === G,
|
|
4109
4109
|
onChange: (le) => A(P.id, le.target.value),
|
|
4110
4110
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4111
|
-
disabled:
|
|
4111
|
+
disabled: u
|
|
4112
4112
|
}
|
|
4113
4113
|
),
|
|
4114
|
-
/* @__PURE__ */ a("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children:
|
|
4114
|
+
/* @__PURE__ */ a("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: G })
|
|
4115
4115
|
]
|
|
4116
4116
|
},
|
|
4117
|
-
|
|
4117
|
+
K
|
|
4118
4118
|
)) })
|
|
4119
4119
|
]
|
|
4120
4120
|
},
|
|
@@ -4132,20 +4132,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4132
4132
|
] }),
|
|
4133
4133
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
4134
4134
|
/* @__PURE__ */ a(
|
|
4135
|
-
|
|
4135
|
+
U,
|
|
4136
4136
|
{
|
|
4137
4137
|
type: "button",
|
|
4138
4138
|
variant: "outline",
|
|
4139
4139
|
onClick: r,
|
|
4140
|
-
disabled:
|
|
4140
|
+
disabled: u,
|
|
4141
4141
|
children: "Cancel"
|
|
4142
4142
|
}
|
|
4143
4143
|
),
|
|
4144
4144
|
/* @__PURE__ */ a(
|
|
4145
|
-
|
|
4145
|
+
U,
|
|
4146
4146
|
{
|
|
4147
4147
|
type: "submit",
|
|
4148
|
-
isLoading:
|
|
4148
|
+
isLoading: u,
|
|
4149
4149
|
disabled: Object.keys(y).length < s.totalQuestionCount,
|
|
4150
4150
|
children: F ? "Submitting..." : "Submit Test"
|
|
4151
4151
|
}
|
|
@@ -4161,19 +4161,19 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4161
4161
|
/* @__PURE__ */ i("div", { className: "space-y-4 mb-6", children: [
|
|
4162
4162
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4163
4163
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
|
|
4164
|
-
/* @__PURE__ */ a(
|
|
4164
|
+
/* @__PURE__ */ a(Se, { variant: "info", children: s.totalQuestionCount })
|
|
4165
4165
|
] }),
|
|
4166
4166
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4167
4167
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4168
|
-
/* @__PURE__ */ a(
|
|
4168
|
+
/* @__PURE__ */ a(Se, { variant: "info", children: T(s.testDurationSec) })
|
|
4169
4169
|
] }),
|
|
4170
4170
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4171
4171
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
4172
|
-
/* @__PURE__ */ a(
|
|
4172
|
+
/* @__PURE__ */ a(Se, { variant: "info", children: s.testCorrectAnswerPassLimit })
|
|
4173
4173
|
] }),
|
|
4174
4174
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4175
4175
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4176
|
-
/* @__PURE__ */ a(
|
|
4176
|
+
/* @__PURE__ */ a(Se, { variant: W > 1 ? "success" : "warning", children: W })
|
|
4177
4177
|
] })
|
|
4178
4178
|
] }),
|
|
4179
4179
|
w && /* @__PURE__ */ a("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -4181,28 +4181,28 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4181
4181
|
" ",
|
|
4182
4182
|
w
|
|
4183
4183
|
] }) }),
|
|
4184
|
-
|
|
4184
|
+
W <= 0 && /* @__PURE__ */ a("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ a("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
4185
4185
|
] }),
|
|
4186
4186
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
4187
|
-
r && /* @__PURE__ */ a(
|
|
4187
|
+
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4188
4188
|
/* @__PURE__ */ a(
|
|
4189
|
-
|
|
4189
|
+
U,
|
|
4190
4190
|
{
|
|
4191
4191
|
type: "button",
|
|
4192
4192
|
onClick: f,
|
|
4193
|
-
disabled:
|
|
4193
|
+
disabled: W <= 0,
|
|
4194
4194
|
children: "Start Test"
|
|
4195
4195
|
}
|
|
4196
4196
|
)
|
|
4197
4197
|
] })
|
|
4198
4198
|
] });
|
|
4199
|
-
},
|
|
4199
|
+
}, Tr = ({
|
|
4200
4200
|
applicantId: e,
|
|
4201
4201
|
onComplete: t,
|
|
4202
4202
|
onBack: r
|
|
4203
4203
|
}) => {
|
|
4204
|
-
var
|
|
4205
|
-
const { applicantService: n, baseInformationService: s, config: l } = he(), { identityData: o, provider: c, token:
|
|
4204
|
+
var G, K, le, be;
|
|
4205
|
+
const { applicantService: n, baseInformationService: s, config: l } = he(), { identityData: o, provider: c, token: u, isLoading: p, error: w, requestIdentity: N, restartIdentity: y } = cr(e), [h, g] = x(null), [k, b] = x(null), [m, F] = x([]), [S, v] = x(!0), [q, H] = x(!1), [T, f] = x(null), [A, D] = x(!1), Q = ge.useRef(!1), W = pt({
|
|
4206
4206
|
defaultValues: {
|
|
4207
4207
|
street: "",
|
|
4208
4208
|
streetNumber: "",
|
|
@@ -4213,32 +4213,32 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4213
4213
|
phonenumber: ""
|
|
4214
4214
|
}
|
|
4215
4215
|
});
|
|
4216
|
-
|
|
4216
|
+
X(() => {
|
|
4217
4217
|
(async () => {
|
|
4218
4218
|
try {
|
|
4219
|
-
const [L,
|
|
4219
|
+
const [L, ee] = await Promise.all([
|
|
4220
4220
|
n.getApplicantData(e),
|
|
4221
4221
|
s.getCountries("", "en")
|
|
4222
4222
|
]);
|
|
4223
4223
|
b(L);
|
|
4224
|
-
const
|
|
4225
|
-
const
|
|
4226
|
-
return !
|
|
4224
|
+
const Z = /* @__PURE__ */ new Set(), ae = ee.filter((ve) => {
|
|
4225
|
+
const Le = ve.abbreviation3 || ve.abbreviation;
|
|
4226
|
+
return !Le || Z.has(Le) ? !1 : (Z.add(Le), !0);
|
|
4227
4227
|
});
|
|
4228
|
-
F(
|
|
4229
|
-
const
|
|
4230
|
-
if (
|
|
4231
|
-
street: (
|
|
4232
|
-
streetNumber: (
|
|
4233
|
-
city: (
|
|
4234
|
-
zip: (
|
|
4235
|
-
country: (
|
|
4236
|
-
nationality: (
|
|
4237
|
-
phonenumber: (
|
|
4238
|
-
}), L.kycRecords && L.kycRecords.length > 0 && L.kycRecords[0].providerTokenObject !== null && !
|
|
4239
|
-
console.log("[Identity] Found existing identity verification, auto-requesting..."),
|
|
4228
|
+
F(ae);
|
|
4229
|
+
const j = L.applicantRequestData;
|
|
4230
|
+
if (W.reset({
|
|
4231
|
+
street: (j == null ? void 0 : j.street) || "",
|
|
4232
|
+
streetNumber: (j == null ? void 0 : j.streetNumber) || "",
|
|
4233
|
+
city: (j == null ? void 0 : j.city) || "",
|
|
4234
|
+
zip: (j == null ? void 0 : j.zip) || "",
|
|
4235
|
+
country: (j == null ? void 0 : j.country) || "",
|
|
4236
|
+
nationality: (j == null ? void 0 : j.nationality) || "",
|
|
4237
|
+
phonenumber: (j == null ? void 0 : j.phonenumber) || ""
|
|
4238
|
+
}), L.kycRecords && L.kycRecords.length > 0 && L.kycRecords[0].providerTokenObject !== null && !Q.current) {
|
|
4239
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), Q.current = !0;
|
|
4240
4240
|
try {
|
|
4241
|
-
await N(),
|
|
4241
|
+
await N(), H(!0);
|
|
4242
4242
|
} catch (ve) {
|
|
4243
4243
|
console.error("[Identity] Auto-request failed:", ve);
|
|
4244
4244
|
}
|
|
@@ -4249,20 +4249,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4249
4249
|
v(!1);
|
|
4250
4250
|
}
|
|
4251
4251
|
})();
|
|
4252
|
-
}, [e]),
|
|
4253
|
-
o && !
|
|
4254
|
-
}, [o,
|
|
4255
|
-
if (
|
|
4256
|
-
if (
|
|
4257
|
-
const O = new Date(
|
|
4252
|
+
}, [e]), X(() => {
|
|
4253
|
+
o && !q && (console.log("[Identity] Identity data already loaded, showing provider"), H(!0));
|
|
4254
|
+
}, [o, q]), X(() => {
|
|
4255
|
+
if (u) {
|
|
4256
|
+
if (u.expiresAt) {
|
|
4257
|
+
const O = new Date(u.expiresAt).getTime();
|
|
4258
4258
|
if (Date.now() >= O) {
|
|
4259
4259
|
console.warn("[Identity] Token has expired (expiresAt)"), D(!0), f("Your verification session has expired. Please restart.");
|
|
4260
4260
|
return;
|
|
4261
4261
|
}
|
|
4262
4262
|
}
|
|
4263
|
-
if (
|
|
4263
|
+
if (u.url)
|
|
4264
4264
|
try {
|
|
4265
|
-
const L = new URL(
|
|
4265
|
+
const L = new URL(u.url).toString().toLowerCase();
|
|
4266
4266
|
if (L.includes("expired") || L.includes("invalid") || L.includes("error")) {
|
|
4267
4267
|
console.warn("[Identity] Token URL indicates expiration"), D(!0), f("Your verification link has expired. Please restart.");
|
|
4268
4268
|
return;
|
|
@@ -4270,49 +4270,49 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4270
4270
|
} catch {
|
|
4271
4271
|
console.error("[Identity] Invalid token URL");
|
|
4272
4272
|
}
|
|
4273
|
-
if (
|
|
4273
|
+
if (u.status === "expired" || u.error === "expired" || u.expired === !0) {
|
|
4274
4274
|
console.warn("[Identity] Token object indicates expiration"), D(!0), f("Your verification session has expired. Please restart.");
|
|
4275
4275
|
return;
|
|
4276
4276
|
}
|
|
4277
4277
|
}
|
|
4278
|
-
}, [
|
|
4279
|
-
if (c !== null &&
|
|
4278
|
+
}, [u]), X(() => {
|
|
4279
|
+
if (c !== null && u && !h && q && !A) {
|
|
4280
4280
|
const O = c;
|
|
4281
|
-
if (
|
|
4282
|
-
console.log("[Identity] Loading provider URL for user verification:",
|
|
4281
|
+
if (u.url) {
|
|
4282
|
+
console.log("[Identity] Loading provider URL for user verification:", u.url), f(null);
|
|
4283
4283
|
try {
|
|
4284
|
-
if (new URL(
|
|
4284
|
+
if (new URL(u.url), O === ye.SardinAI) {
|
|
4285
4285
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4286
4286
|
try {
|
|
4287
|
-
const L = De.parseProviderConfig(c,
|
|
4287
|
+
const L = De.parseProviderConfig(c, u, l);
|
|
4288
4288
|
De.createProvider(c, L).initialize().then(() => {
|
|
4289
4289
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4290
|
-
}).catch((
|
|
4291
|
-
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):",
|
|
4290
|
+
}).catch((Z) => {
|
|
4291
|
+
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", Z);
|
|
4292
4292
|
});
|
|
4293
4293
|
} catch (L) {
|
|
4294
4294
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", L);
|
|
4295
4295
|
}
|
|
4296
4296
|
}
|
|
4297
|
-
g({ type: "url", url:
|
|
4297
|
+
g({ type: "url", url: u.url });
|
|
4298
4298
|
} catch (L) {
|
|
4299
4299
|
console.error("[Identity] Invalid URL:", L), f("Invalid verification URL. Please restart."), D(!0);
|
|
4300
4300
|
}
|
|
4301
4301
|
return;
|
|
4302
4302
|
}
|
|
4303
|
-
if (O ===
|
|
4303
|
+
if (O === ye.SardinAI) {
|
|
4304
4304
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), f(null);
|
|
4305
4305
|
try {
|
|
4306
|
-
const L = De.parseProviderConfig(c,
|
|
4307
|
-
|
|
4308
|
-
console.log("[SardinAI] Risk SDK initialized successfully"), g(
|
|
4306
|
+
const L = De.parseProviderConfig(c, u, l), ee = De.createProvider(c, L);
|
|
4307
|
+
ee.initialize().then(() => {
|
|
4308
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), g(ee), setTimeout(() => {
|
|
4309
4309
|
t == null || t();
|
|
4310
4310
|
}, 2e3);
|
|
4311
|
-
}).catch((
|
|
4312
|
-
var
|
|
4313
|
-
console.error("[SardinAI] Failed to initialize:",
|
|
4314
|
-
const
|
|
4315
|
-
|
|
4311
|
+
}).catch((Z) => {
|
|
4312
|
+
var j;
|
|
4313
|
+
console.error("[SardinAI] Failed to initialize:", Z);
|
|
4314
|
+
const ae = ((j = Z.message) == null ? void 0 : j.toLowerCase()) || "";
|
|
4315
|
+
ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (D(!0), f("Session expired or invalid. Please restart verification.")) : f(`Failed to initialize: ${Z.message}`);
|
|
4316
4316
|
});
|
|
4317
4317
|
} catch (L) {
|
|
4318
4318
|
console.error("[SardinAI] Error creating provider:", L), f(`Configuration error: ${L.message}`);
|
|
@@ -4321,15 +4321,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4321
4321
|
}
|
|
4322
4322
|
try {
|
|
4323
4323
|
f(null);
|
|
4324
|
-
const L = De.parseProviderConfig(c,
|
|
4325
|
-
O ===
|
|
4326
|
-
var
|
|
4327
|
-
console.error("[Sumsub] Initialization error:",
|
|
4328
|
-
}),
|
|
4324
|
+
const L = De.parseProviderConfig(c, u, l), ee = De.createProvider(c, L);
|
|
4325
|
+
O === ye.Sumsub ? (ee.initialize("identity-container").catch((Z) => {
|
|
4326
|
+
var ae;
|
|
4327
|
+
console.error("[Sumsub] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`), (ae = Z.message) != null && ae.toLowerCase().includes("expired") && D(!0);
|
|
4328
|
+
}), ee.onComplete && ee.onComplete(() => {
|
|
4329
4329
|
t == null || t();
|
|
4330
|
-
})) : O ===
|
|
4331
|
-
console.error("[Onfido] Initialization error:",
|
|
4332
|
-
}), g(
|
|
4330
|
+
})) : O === ye.Onfido && ee.initialize("identity-container").catch((Z) => {
|
|
4331
|
+
console.error("[Onfido] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`);
|
|
4332
|
+
}), g(ee);
|
|
4333
4333
|
} catch (L) {
|
|
4334
4334
|
console.error("[Identity] Provider setup error:", L), f(`Setup error: ${L.message}`);
|
|
4335
4335
|
}
|
|
@@ -4342,23 +4342,23 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4342
4342
|
console.error("[Identity] Error destroying provider:", O);
|
|
4343
4343
|
}
|
|
4344
4344
|
};
|
|
4345
|
-
}, [c,
|
|
4345
|
+
}, [c, u, h, q, t, A]);
|
|
4346
4346
|
const P = async () => {
|
|
4347
4347
|
try {
|
|
4348
|
-
f(null), D(!1), await N(),
|
|
4348
|
+
f(null), D(!1), await N(), H(!0);
|
|
4349
4349
|
} catch (O) {
|
|
4350
4350
|
console.error("Error starting identity verification:", O);
|
|
4351
4351
|
}
|
|
4352
|
-
},
|
|
4352
|
+
}, R = async () => {
|
|
4353
4353
|
try {
|
|
4354
|
-
f(null), D(!1), g(null), console.log("[Identity] Restarting verification..."), await y(),
|
|
4354
|
+
f(null), D(!1), g(null), console.log("[Identity] Restarting verification..."), await y(), H(!0);
|
|
4355
4355
|
} catch (O) {
|
|
4356
4356
|
console.error("Error restarting identity verification:", O), f(O.message || "Failed to restart verification");
|
|
4357
4357
|
}
|
|
4358
4358
|
};
|
|
4359
|
-
if (
|
|
4359
|
+
if (S || p)
|
|
4360
4360
|
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
4361
|
-
/* @__PURE__ */ a(
|
|
4361
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
4362
4362
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4363
4363
|
] }) });
|
|
4364
4364
|
if (w)
|
|
@@ -4366,7 +4366,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4366
4366
|
"Error: ",
|
|
4367
4367
|
w.message
|
|
4368
4368
|
] }) }) });
|
|
4369
|
-
if (
|
|
4369
|
+
if (q && (T || A))
|
|
4370
4370
|
return /* @__PURE__ */ i($, { children: [
|
|
4371
4371
|
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4372
4372
|
/* @__PURE__ */ i(B, { children: [
|
|
@@ -4391,7 +4391,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4391
4391
|
),
|
|
4392
4392
|
/* @__PURE__ */ i("div", { children: [
|
|
4393
4393
|
/* @__PURE__ */ a("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: A ? "Session Expired" : "Verification Error" }),
|
|
4394
|
-
/* @__PURE__ */ a("p", { className: "text-red-800 dark:text-red-200 text-sm", children:
|
|
4394
|
+
/* @__PURE__ */ a("p", { className: "text-red-800 dark:text-red-200 text-sm", children: T || "Your verification session has expired and needs to be restarted." })
|
|
4395
4395
|
] })
|
|
4396
4396
|
] }) }),
|
|
4397
4397
|
/* @__PURE__ */ i("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
|
|
@@ -4404,26 +4404,26 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4404
4404
|
] })
|
|
4405
4405
|
] }),
|
|
4406
4406
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
4407
|
-
r && /* @__PURE__ */ a(
|
|
4408
|
-
/* @__PURE__ */ a(
|
|
4407
|
+
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4408
|
+
/* @__PURE__ */ a(U, { type: "button", onClick: R, disabled: p, children: p ? "Restarting..." : "Restart Verification" })
|
|
4409
4409
|
] })
|
|
4410
4410
|
] });
|
|
4411
|
-
if (
|
|
4411
|
+
if (q && o) {
|
|
4412
4412
|
const O = c;
|
|
4413
|
-
return
|
|
4413
|
+
return u != null && u.url ? /* @__PURE__ */ i($, { children: [
|
|
4414
4414
|
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4415
4415
|
/* @__PURE__ */ i("div", { children: [
|
|
4416
4416
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4417
4417
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4418
4418
|
] }),
|
|
4419
4419
|
/* @__PURE__ */ a(
|
|
4420
|
-
|
|
4420
|
+
U,
|
|
4421
4421
|
{
|
|
4422
4422
|
type: "button",
|
|
4423
4423
|
variant: "outline",
|
|
4424
4424
|
size: "sm",
|
|
4425
|
-
onClick:
|
|
4426
|
-
disabled:
|
|
4425
|
+
onClick: R,
|
|
4426
|
+
disabled: p,
|
|
4427
4427
|
children: "Restart"
|
|
4428
4428
|
}
|
|
4429
4429
|
)
|
|
@@ -4436,17 +4436,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4436
4436
|
/* @__PURE__ */ a("div", { className: "w-full", style: { height: "600px" }, children: /* @__PURE__ */ a(
|
|
4437
4437
|
"iframe",
|
|
4438
4438
|
{
|
|
4439
|
-
src:
|
|
4439
|
+
src: u.url,
|
|
4440
4440
|
className: "w-full h-full border-0 rounded-lg",
|
|
4441
4441
|
allow: "camera; microphone; geolocation",
|
|
4442
4442
|
title: "Identity Verification",
|
|
4443
4443
|
onLoad: (L) => {
|
|
4444
|
-
var
|
|
4444
|
+
var ee, Z, ae;
|
|
4445
4445
|
console.log("[Identity] Iframe loaded");
|
|
4446
4446
|
try {
|
|
4447
|
-
const
|
|
4447
|
+
const j = L.target, Fe = j.contentDocument || ((ee = j.contentWindow) == null ? void 0 : ee.document);
|
|
4448
4448
|
if (Fe) {
|
|
4449
|
-
const ve = ((
|
|
4449
|
+
const ve = ((ae = (Z = Fe.body) == null ? void 0 : Z.textContent) == null ? void 0 : ae.toLowerCase()) || "";
|
|
4450
4450
|
(ve.includes("expired") || ve.includes("invalid") || ve.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), D(!0), f("Your verification link has expired."));
|
|
4451
4451
|
}
|
|
4452
4452
|
} catch {
|
|
@@ -4456,14 +4456,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4456
4456
|
}
|
|
4457
4457
|
) })
|
|
4458
4458
|
] }),
|
|
4459
|
-
r && /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(
|
|
4460
|
-
] }) : O ===
|
|
4459
|
+
r && /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4460
|
+
] }) : O === ye.SardinAI ? /* @__PURE__ */ i($, { children: [
|
|
4461
4461
|
/* @__PURE__ */ i(oe, { children: [
|
|
4462
4462
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4463
4463
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4464
4464
|
] }),
|
|
4465
4465
|
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("div", { className: "text-center py-12", children: [
|
|
4466
|
-
/* @__PURE__ */ a(
|
|
4466
|
+
/* @__PURE__ */ a(xe, { className: "mb-4" }),
|
|
4467
4467
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4468
4468
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
|
|
4469
4469
|
] }) })
|
|
@@ -4473,10 +4473,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4473
4473
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4474
4474
|
] }),
|
|
4475
4475
|
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4476
|
-
r && /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(
|
|
4476
|
+
r && /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4477
4477
|
] });
|
|
4478
4478
|
}
|
|
4479
|
-
return /* @__PURE__ */ a("form", { onSubmit:
|
|
4479
|
+
return /* @__PURE__ */ a("form", { onSubmit: W.handleSubmit(P), children: /* @__PURE__ */ i($, { children: [
|
|
4480
4480
|
/* @__PURE__ */ i(oe, { children: [
|
|
4481
4481
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Review Your Information" }),
|
|
4482
4482
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
@@ -4486,9 +4486,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4486
4486
|
/* @__PURE__ */ i("div", { children: [
|
|
4487
4487
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4488
4488
|
/* @__PURE__ */ i("p", { className: "mt-1 text-base", children: [
|
|
4489
|
-
(
|
|
4489
|
+
(G = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : G.firstName,
|
|
4490
4490
|
" ",
|
|
4491
|
-
(
|
|
4491
|
+
(K = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : K.lastName
|
|
4492
4492
|
] })
|
|
4493
4493
|
] }),
|
|
4494
4494
|
/* @__PURE__ */ i("div", { children: [
|
|
@@ -4497,7 +4497,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4497
4497
|
] }),
|
|
4498
4498
|
/* @__PURE__ */ i("div", { children: [
|
|
4499
4499
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4500
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: ((
|
|
4500
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: ((be = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : be.dateOfBirth) || "Not provided" })
|
|
4501
4501
|
] })
|
|
4502
4502
|
] }),
|
|
4503
4503
|
/* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
@@ -4506,7 +4506,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4506
4506
|
/* @__PURE__ */ a(
|
|
4507
4507
|
Ie,
|
|
4508
4508
|
{
|
|
4509
|
-
control:
|
|
4509
|
+
control: W.control,
|
|
4510
4510
|
name: "country",
|
|
4511
4511
|
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4512
4512
|
Ae,
|
|
@@ -4515,7 +4515,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4515
4515
|
label: "Country",
|
|
4516
4516
|
options: [
|
|
4517
4517
|
{ value: "", label: "Select country..." },
|
|
4518
|
-
...
|
|
4518
|
+
...m.map((L) => ({
|
|
4519
4519
|
value: L.abbreviation3 || L.abbreviation,
|
|
4520
4520
|
label: L.name
|
|
4521
4521
|
}))
|
|
@@ -4527,7 +4527,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4527
4527
|
/* @__PURE__ */ a(
|
|
4528
4528
|
Ie,
|
|
4529
4529
|
{
|
|
4530
|
-
control:
|
|
4530
|
+
control: W.control,
|
|
4531
4531
|
name: "nationality",
|
|
4532
4532
|
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4533
4533
|
Ae,
|
|
@@ -4536,7 +4536,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4536
4536
|
label: "Nationality",
|
|
4537
4537
|
options: [
|
|
4538
4538
|
{ value: "", label: "Select nationality..." },
|
|
4539
|
-
...
|
|
4539
|
+
...m.map((L) => ({
|
|
4540
4540
|
value: L.abbreviation3 || L.abbreviation,
|
|
4541
4541
|
label: L.name
|
|
4542
4542
|
}))
|
|
@@ -4550,7 +4550,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4550
4550
|
/* @__PURE__ */ a(
|
|
4551
4551
|
Ie,
|
|
4552
4552
|
{
|
|
4553
|
-
control:
|
|
4553
|
+
control: W.control,
|
|
4554
4554
|
name: "street",
|
|
4555
4555
|
render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "Street" })
|
|
4556
4556
|
}
|
|
@@ -4558,7 +4558,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4558
4558
|
/* @__PURE__ */ a(
|
|
4559
4559
|
Ie,
|
|
4560
4560
|
{
|
|
4561
|
-
control:
|
|
4561
|
+
control: W.control,
|
|
4562
4562
|
name: "streetNumber",
|
|
4563
4563
|
render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "Street Number" })
|
|
4564
4564
|
}
|
|
@@ -4568,7 +4568,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4568
4568
|
/* @__PURE__ */ a(
|
|
4569
4569
|
Ie,
|
|
4570
4570
|
{
|
|
4571
|
-
control:
|
|
4571
|
+
control: W.control,
|
|
4572
4572
|
name: "city",
|
|
4573
4573
|
render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "City" })
|
|
4574
4574
|
}
|
|
@@ -4576,7 +4576,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4576
4576
|
/* @__PURE__ */ a(
|
|
4577
4577
|
Ie,
|
|
4578
4578
|
{
|
|
4579
|
-
control:
|
|
4579
|
+
control: W.control,
|
|
4580
4580
|
name: "zip",
|
|
4581
4581
|
render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "ZIP/Postal Code" })
|
|
4582
4582
|
}
|
|
@@ -4585,7 +4585,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4585
4585
|
/* @__PURE__ */ a(
|
|
4586
4586
|
Ie,
|
|
4587
4587
|
{
|
|
4588
|
-
control:
|
|
4588
|
+
control: W.control,
|
|
4589
4589
|
name: "phonenumber",
|
|
4590
4590
|
render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "Phone Number", type: "tel" })
|
|
4591
4591
|
}
|
|
@@ -4593,11 +4593,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4593
4593
|
] })
|
|
4594
4594
|
] }),
|
|
4595
4595
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
4596
|
-
r && /* @__PURE__ */ a(
|
|
4597
|
-
/* @__PURE__ */ a(
|
|
4596
|
+
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4597
|
+
/* @__PURE__ */ a(U, { type: "submit", isLoading: p, children: "Confirm and Start Verification" })
|
|
4598
4598
|
] })
|
|
4599
4599
|
] }) });
|
|
4600
|
-
},
|
|
4600
|
+
}, et = ({
|
|
4601
4601
|
kycStatus: e,
|
|
4602
4602
|
reviewStatus: t,
|
|
4603
4603
|
workflowResult: r,
|
|
@@ -4647,21 +4647,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4647
4647
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
4648
4648
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
4649
4649
|
message: "Your application is currently under manual review."
|
|
4650
|
-
} : r ===
|
|
4650
|
+
} : r === _e.Success ? {
|
|
4651
4651
|
type: "success",
|
|
4652
4652
|
title: "Process Complete",
|
|
4653
4653
|
icon: "✓",
|
|
4654
4654
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4655
4655
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4656
4656
|
message: "Your verification process has been completed successfully."
|
|
4657
|
-
} : r ===
|
|
4657
|
+
} : r === _e.Failed ? {
|
|
4658
4658
|
type: "error",
|
|
4659
4659
|
title: "Process Failed",
|
|
4660
4660
|
icon: "✕",
|
|
4661
4661
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4662
4662
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4663
4663
|
message: "The verification process could not be completed."
|
|
4664
|
-
} : r ===
|
|
4664
|
+
} : r === _e.AdminReview ? {
|
|
4665
4665
|
type: "pending",
|
|
4666
4666
|
title: "Admin Review Required",
|
|
4667
4667
|
icon: "📋",
|
|
@@ -4687,7 +4687,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4687
4687
|
) }),
|
|
4688
4688
|
/* @__PURE__ */ a("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: c.title }),
|
|
4689
4689
|
/* @__PURE__ */ a("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ a(
|
|
4690
|
-
|
|
4690
|
+
Se,
|
|
4691
4691
|
{
|
|
4692
4692
|
variant: c.type === "success" ? "success" : c.type === "error" ? "danger" : c.type === "pending" ? "warning" : "info",
|
|
4693
4693
|
children: e != null ? Ee[e] : Re[t]
|
|
@@ -4731,15 +4731,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4731
4731
|
] }) })
|
|
4732
4732
|
] }),
|
|
4733
4733
|
/* @__PURE__ */ i(me, { className: "flex justify-center gap-4", children: [
|
|
4734
|
-
c.type === "success" && s && /* @__PURE__ */ a(
|
|
4735
|
-
c.type === "error" && /* @__PURE__ */ i(
|
|
4736
|
-
l && /* @__PURE__ */ a(
|
|
4737
|
-
s && /* @__PURE__ */ a(
|
|
4734
|
+
c.type === "success" && s && /* @__PURE__ */ a(U, { onClick: s, size: "lg", children: "Continue" }),
|
|
4735
|
+
c.type === "error" && /* @__PURE__ */ i(mt, { children: [
|
|
4736
|
+
l && /* @__PURE__ */ a(U, { variant: "outline", onClick: l, children: "Contact Support" }),
|
|
4737
|
+
s && /* @__PURE__ */ a(U, { onClick: s, children: "Try Again" })
|
|
4738
4738
|
] }),
|
|
4739
4739
|
c.type === "pending" && /* @__PURE__ */ a("div", { className: "text-center", children: /* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
|
|
4740
4740
|
] })
|
|
4741
4741
|
] });
|
|
4742
|
-
},
|
|
4742
|
+
}, Or = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ a("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ a(
|
|
4743
4743
|
"img",
|
|
4744
4744
|
{
|
|
4745
4745
|
src: e.url,
|
|
@@ -4754,7 +4754,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4754
4754
|
console.warn("[Logo] Failed to load logo:", e.url), r.target.style.display = "none";
|
|
4755
4755
|
}
|
|
4756
4756
|
}
|
|
4757
|
-
) }),
|
|
4757
|
+
) }), Ye = ({
|
|
4758
4758
|
title: e,
|
|
4759
4759
|
subtitle: t,
|
|
4760
4760
|
className: r = ""
|
|
@@ -4762,7 +4762,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4762
4762
|
const { currentTheme: n } = he(), s = e || (n == null ? void 0 : n.title) || "", l = !!(n != null && n.logo && n.logo.visible && n.logo.url), o = !!s;
|
|
4763
4763
|
return !l && !o ? null : /* @__PURE__ */ i("div", { className: `metakyc-header ${r}`, children: [
|
|
4764
4764
|
/* @__PURE__ */ i("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
4765
|
-
l && /* @__PURE__ */ a(
|
|
4765
|
+
l && /* @__PURE__ */ a(Or, { config: n.logo }),
|
|
4766
4766
|
l && o && /* @__PURE__ */ a(
|
|
4767
4767
|
"span",
|
|
4768
4768
|
{
|
|
@@ -4775,11 +4775,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4775
4775
|
] }),
|
|
4776
4776
|
t && /* @__PURE__ */ a("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
|
|
4777
4777
|
] });
|
|
4778
|
-
},
|
|
4779
|
-
function
|
|
4778
|
+
}, He = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
4779
|
+
function Be(e) {
|
|
4780
4780
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4781
4781
|
}
|
|
4782
|
-
const
|
|
4782
|
+
const ze = {
|
|
4783
4783
|
width: "16px",
|
|
4784
4784
|
height: "16px",
|
|
4785
4785
|
minWidth: "16px",
|
|
@@ -4791,27 +4791,27 @@ const Oe = {
|
|
|
4791
4791
|
padding: 0,
|
|
4792
4792
|
display: "inline-block",
|
|
4793
4793
|
verticalAlign: "middle"
|
|
4794
|
-
},
|
|
4794
|
+
}, ea = ({
|
|
4795
4795
|
workflowKey: e,
|
|
4796
4796
|
externalRefId: t,
|
|
4797
4797
|
onSuccess: r,
|
|
4798
4798
|
onCancel: n
|
|
4799
4799
|
}) => {
|
|
4800
|
-
var
|
|
4801
|
-
const { config: s, baseInformationService: l, currentTheme: o } = he(), { createApplicant: c, isLoading:
|
|
4802
|
-
if (!
|
|
4800
|
+
var Qe, Ve, Ge;
|
|
4801
|
+
const { config: s, baseInformationService: l, currentTheme: o } = he(), { createApplicant: c, isLoading: u } = ur(), p = e || ((Qe = s.applicantForm) == null ? void 0 : Qe.workflowKey);
|
|
4802
|
+
if (!p)
|
|
4803
4803
|
throw new Error(
|
|
4804
4804
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4805
4805
|
);
|
|
4806
|
-
const w = t || ((
|
|
4807
|
-
|
|
4806
|
+
const w = t || ((Ve = s.applicantForm) == null ? void 0 : Ve.externalRefId) || "", [N, y] = x([]), [h, g] = x(!0), k = J(!1), b = J(!1);
|
|
4807
|
+
X(() => {
|
|
4808
4808
|
(async () => {
|
|
4809
4809
|
if (!(k.current || b.current)) {
|
|
4810
4810
|
k.current = !0, g(!0);
|
|
4811
4811
|
try {
|
|
4812
|
-
const I = await l.getCountries("", s.locale || "en"),
|
|
4812
|
+
const I = await l.getCountries("", s.locale || "en"), M = /* @__PURE__ */ new Set();
|
|
4813
4813
|
y(
|
|
4814
|
-
I.map((
|
|
4814
|
+
I.map((C) => ({ value: C.abbreviation3 || C.abbreviation, label: C.name })).filter((C) => !C.value || M.has(C.value) ? !1 : (M.add(C.value), !0))
|
|
4815
4815
|
), b.current = !0;
|
|
4816
4816
|
} catch (I) {
|
|
4817
4817
|
console.error("Failed to load countries:", I);
|
|
@@ -4821,31 +4821,31 @@ const Oe = {
|
|
|
4821
4821
|
}
|
|
4822
4822
|
})();
|
|
4823
4823
|
}, []);
|
|
4824
|
-
const
|
|
4824
|
+
const m = ke(
|
|
4825
4825
|
() => o != null && o.applicantFormPages && o.applicantFormPages.length > 0 ? o.applicantFormPages : null,
|
|
4826
4826
|
[o == null ? void 0 : o.applicantFormPages]
|
|
4827
|
-
), F =
|
|
4828
|
-
const
|
|
4829
|
-
if (I) for (const
|
|
4830
|
-
if (
|
|
4831
|
-
for (const
|
|
4832
|
-
for (const
|
|
4833
|
-
!
|
|
4834
|
-
return Array.from(
|
|
4835
|
-
}, [o == null ? void 0 : o.applicantFormRequiredFields,
|
|
4836
|
-
var
|
|
4837
|
-
if (
|
|
4838
|
-
const
|
|
4839
|
-
for (const
|
|
4840
|
-
return Array.from(
|
|
4827
|
+
), F = ke(() => {
|
|
4828
|
+
const d = new Set(He), I = o == null ? void 0 : o.applicantFormRequiredFields;
|
|
4829
|
+
if (I) for (const M of I) d.add(M);
|
|
4830
|
+
if (m)
|
|
4831
|
+
for (const M of m)
|
|
4832
|
+
for (const C of M.fields)
|
|
4833
|
+
!C.isCustom && C.name && C.required && d.add(C.name);
|
|
4834
|
+
return Array.from(d);
|
|
4835
|
+
}, [o == null ? void 0 : o.applicantFormRequiredFields, m]), S = ke(() => {
|
|
4836
|
+
var M;
|
|
4837
|
+
if (m) {
|
|
4838
|
+
const C = m.flatMap((z) => z.fields).filter((z) => !z.isCustom && z.name).map((z) => z.name), E = new Set(C);
|
|
4839
|
+
for (const z of He) E.add(z);
|
|
4840
|
+
return Array.from(E);
|
|
4841
4841
|
}
|
|
4842
|
-
let
|
|
4843
|
-
(
|
|
4844
|
-
const I = new Set(
|
|
4845
|
-
for (const
|
|
4842
|
+
let d;
|
|
4843
|
+
(M = s.applicantForm) != null && M.visibleFields ? d = s.applicantForm.visibleFields : o != null && o.applicantFormVisibleFields && o.applicantFormVisibleFields.length > 0 ? d = o.applicantFormVisibleFields : d = Ct;
|
|
4844
|
+
const I = new Set(d);
|
|
4845
|
+
for (const C of He) I.add(C);
|
|
4846
4846
|
return Array.from(I);
|
|
4847
|
-
}, [(
|
|
4848
|
-
workflowKey:
|
|
4847
|
+
}, [(Ge = s.applicantForm) == null ? void 0 : Ge.visibleFields, o == null ? void 0 : o.applicantFormVisibleFields, m]), [v, q] = x({
|
|
4848
|
+
workflowKey: p,
|
|
4849
4849
|
firstName: "",
|
|
4850
4850
|
lastName: "",
|
|
4851
4851
|
title: "",
|
|
@@ -4869,211 +4869,228 @@ const Oe = {
|
|
|
4869
4869
|
educationLevel: "",
|
|
4870
4870
|
occupation: "",
|
|
4871
4871
|
taxNumber: ""
|
|
4872
|
-
}), [
|
|
4873
|
-
(
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
}, [
|
|
4878
|
-
|
|
4879
|
-
|
|
4872
|
+
}), [H, T] = x({}), [f, A] = x(0), [D, Q] = x({}), [W, P] = x(null), [R, G] = x(!1), K = (d, I) => q((M) => ({ ...M, [d]: I })), le = (d, I) => T((M) => ({ ...M, [d]: I })), be = (d) => !d.conditionalOn || H[d.conditionalOn] === "true", O = ke(() => {
|
|
4873
|
+
if (!m) return -1;
|
|
4874
|
+
for (let d = f + 1; d < m.length; d++)
|
|
4875
|
+
if (be(m[d])) return d;
|
|
4876
|
+
return -1;
|
|
4877
|
+
}, [m, f, H]), L = ke(() => {
|
|
4878
|
+
if (!m) return -1;
|
|
4879
|
+
for (let d = f - 1; d >= 0; d--)
|
|
4880
|
+
if (be(m[d])) return d;
|
|
4881
|
+
return -1;
|
|
4882
|
+
}, [m, f, H]), ee = (d) => {
|
|
4883
|
+
var M;
|
|
4880
4884
|
const I = {};
|
|
4881
|
-
for (const
|
|
4882
|
-
if (
|
|
4883
|
-
if (
|
|
4884
|
-
const
|
|
4885
|
-
|
|
4885
|
+
for (const C of d.fields)
|
|
4886
|
+
if (C.isCustom) {
|
|
4887
|
+
if (C.required && C.paramName) {
|
|
4888
|
+
const E = H[C.paramName], z = C.displayText || C.label || C.paramName;
|
|
4889
|
+
C.customType === "checkbox" || C.customType === "link_checkbox" ? E !== "true" && (I[C.paramName] = `${z} is required.`) : (!E || E.trim() === "") && (I[C.paramName] = `${z} is required.`);
|
|
4886
4890
|
}
|
|
4887
|
-
} else if (
|
|
4888
|
-
const
|
|
4889
|
-
if (F.includes(
|
|
4890
|
-
const
|
|
4891
|
-
I[
|
|
4891
|
+
} else if (C.name) {
|
|
4892
|
+
const E = C.name;
|
|
4893
|
+
if (F.includes(E) && Be(v[E])) {
|
|
4894
|
+
const z = C.displayText || ((M = Ke[E]) == null ? void 0 : M.label) || E;
|
|
4895
|
+
I[E] = `${z} is required.`;
|
|
4892
4896
|
}
|
|
4893
4897
|
}
|
|
4894
4898
|
return I;
|
|
4895
|
-
},
|
|
4896
|
-
|
|
4897
|
-
const
|
|
4898
|
-
if (
|
|
4899
|
-
|
|
4900
|
-
if (Object.keys(S).length > 0) {
|
|
4901
|
-
V(S);
|
|
4902
|
-
return;
|
|
4903
|
-
}
|
|
4904
|
-
V({}), A((R) => R + 1);
|
|
4899
|
+
}, Z = async () => {
|
|
4900
|
+
if (!m) return;
|
|
4901
|
+
const d = ee(m[f]);
|
|
4902
|
+
if (Object.keys(d).length > 0) {
|
|
4903
|
+
Q(d);
|
|
4905
4904
|
return;
|
|
4906
4905
|
}
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4906
|
+
Q({}), O >= 0 ? A(O) : await ae();
|
|
4907
|
+
}, ae = async () => {
|
|
4908
|
+
if (m) {
|
|
4909
|
+
let d = {};
|
|
4910
|
+
for (const I of m)
|
|
4911
|
+
be(I) && (d = { ...d, ...ee(I) });
|
|
4912
|
+
if (Object.keys(d).length > 0) {
|
|
4913
|
+
Q(d);
|
|
4913
4914
|
return;
|
|
4914
4915
|
}
|
|
4915
4916
|
}
|
|
4916
|
-
|
|
4917
|
+
G(!0), P(null);
|
|
4917
4918
|
try {
|
|
4918
4919
|
if (!v.externalRefId || v.externalRefId.trim() === "") {
|
|
4919
4920
|
P("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
4920
4921
|
return;
|
|
4921
4922
|
}
|
|
4922
|
-
|
|
4923
|
-
if (Ke(v[W])) {
|
|
4924
|
-
const X = ((T = _e[W]) == null ? void 0 : T.label) || W;
|
|
4925
|
-
P(`${X} is required.`);
|
|
4926
|
-
return;
|
|
4927
|
-
}
|
|
4928
|
-
const S = {
|
|
4923
|
+
const d = {
|
|
4929
4924
|
workflowKey: v.workflowKey,
|
|
4930
4925
|
externalRefId: v.externalRefId.trim()
|
|
4931
4926
|
};
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4927
|
+
if (m) {
|
|
4928
|
+
for (const C of m)
|
|
4929
|
+
if (be(C)) {
|
|
4930
|
+
for (const E of C.fields)
|
|
4931
|
+
if (!E.isCustom && E.name) {
|
|
4932
|
+
const z = E.name, te = v[z];
|
|
4933
|
+
Be(te) || (d[z] = te);
|
|
4934
|
+
}
|
|
4935
|
+
}
|
|
4936
|
+
} else
|
|
4937
|
+
S.forEach((C) => {
|
|
4938
|
+
if (C === "externalRefId") return;
|
|
4939
|
+
const E = v[C];
|
|
4940
|
+
Be(E) || (d[C] = E);
|
|
4941
|
+
});
|
|
4942
|
+
const I = [];
|
|
4943
|
+
if (m) {
|
|
4944
|
+
for (const C of m)
|
|
4945
|
+
if (be(C)) {
|
|
4946
|
+
for (const E of C.fields)
|
|
4947
|
+
if (E.isCustom && E.paramName) {
|
|
4948
|
+
const z = H[E.paramName] ?? "";
|
|
4949
|
+
I.push({ paramName: E.paramName, paramValue: z });
|
|
4950
|
+
}
|
|
4951
|
+
}
|
|
4945
4952
|
}
|
|
4946
|
-
|
|
4947
|
-
const
|
|
4948
|
-
r(
|
|
4949
|
-
} catch (
|
|
4950
|
-
console.error("Error creating applicant:",
|
|
4953
|
+
I.length > 0 && (d.applicantAdditionalDatas = I);
|
|
4954
|
+
const M = await c(d);
|
|
4955
|
+
r(M.applicantId);
|
|
4956
|
+
} catch (d) {
|
|
4957
|
+
console.error("Error creating applicant:", d), P(d.message || "Failed to create applicant");
|
|
4951
4958
|
} finally {
|
|
4952
|
-
|
|
4959
|
+
G(!1);
|
|
4953
4960
|
}
|
|
4954
|
-
},
|
|
4955
|
-
var
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4961
|
+
}, j = async (d) => {
|
|
4962
|
+
var I;
|
|
4963
|
+
d.preventDefault();
|
|
4964
|
+
for (const M of F)
|
|
4965
|
+
if (Be(v[M])) {
|
|
4966
|
+
const C = ((I = Ke[M]) == null ? void 0 : I.label) || M;
|
|
4967
|
+
P(`${C} is required.`);
|
|
4968
|
+
return;
|
|
4969
|
+
}
|
|
4970
|
+
await ae();
|
|
4971
|
+
}, Fe = (d, I, M) => {
|
|
4972
|
+
var Me;
|
|
4973
|
+
const C = Ke[d];
|
|
4974
|
+
if (!C) return null;
|
|
4975
|
+
const E = F.includes(d), z = D[d], te = M || C.label, ce = I ?? d, re = { required: E };
|
|
4976
|
+
switch (C.type) {
|
|
4960
4977
|
case "select":
|
|
4961
|
-
if (
|
|
4978
|
+
if (d === "country" || d === "nationality" || d === "taxCountry" || d === "countryOfBirth")
|
|
4962
4979
|
return /* @__PURE__ */ a(
|
|
4963
4980
|
Ae,
|
|
4964
4981
|
{
|
|
4965
|
-
...
|
|
4966
|
-
label:
|
|
4967
|
-
value: v[
|
|
4968
|
-
onChange: (ne) =>
|
|
4969
|
-
options: [{ value: "", label: `Select ${
|
|
4982
|
+
...re,
|
|
4983
|
+
label: te,
|
|
4984
|
+
value: v[d] || "",
|
|
4985
|
+
onChange: (ne) => K(d, ne.target.value),
|
|
4986
|
+
options: [{ value: "", label: `Select ${te.toLowerCase()}...` }, ...N],
|
|
4970
4987
|
disabled: h
|
|
4971
4988
|
},
|
|
4972
|
-
|
|
4989
|
+
ce
|
|
4973
4990
|
);
|
|
4974
|
-
if (
|
|
4991
|
+
if (d === "salutation")
|
|
4975
4992
|
return /* @__PURE__ */ a(
|
|
4976
4993
|
Ae,
|
|
4977
4994
|
{
|
|
4978
|
-
...
|
|
4979
|
-
label:
|
|
4980
|
-
value: ((
|
|
4981
|
-
onChange: (ne) =>
|
|
4995
|
+
...re,
|
|
4996
|
+
label: te,
|
|
4997
|
+
value: ((Me = v[d]) == null ? void 0 : Me.toString()) || "",
|
|
4998
|
+
onChange: (ne) => K(d, ne.target.value ? Number(ne.target.value) : null),
|
|
4982
4999
|
options: [
|
|
4983
5000
|
{ value: "", label: "Select salutation..." },
|
|
4984
|
-
{ value:
|
|
4985
|
-
{ value:
|
|
4986
|
-
{ value:
|
|
5001
|
+
{ value: Ue.Male.toString(), label: "Male" },
|
|
5002
|
+
{ value: Ue.Female.toString(), label: "Female" },
|
|
5003
|
+
{ value: Ue.Other.toString(), label: "Other" }
|
|
4987
5004
|
]
|
|
4988
5005
|
},
|
|
4989
|
-
|
|
5006
|
+
ce
|
|
4990
5007
|
);
|
|
4991
|
-
if (
|
|
4992
|
-
const ne = o != null && o.allowedLanguages && o.allowedLanguages.length > 0 ?
|
|
5008
|
+
if (d === "defaultLanguage") {
|
|
5009
|
+
const ne = o != null && o.allowedLanguages && o.allowedLanguages.length > 0 ? Je.filter((qe) => o.allowedLanguages.includes(qe.value)) : Je;
|
|
4993
5010
|
return /* @__PURE__ */ a(
|
|
4994
5011
|
Ae,
|
|
4995
5012
|
{
|
|
4996
|
-
...
|
|
4997
|
-
label:
|
|
4998
|
-
value: v[
|
|
4999
|
-
onChange: (
|
|
5013
|
+
...re,
|
|
5014
|
+
label: te,
|
|
5015
|
+
value: v[d] || "",
|
|
5016
|
+
onChange: (qe) => K(d, qe.target.value),
|
|
5000
5017
|
options: [{ value: "", label: "Select language..." }, ...ne]
|
|
5001
5018
|
},
|
|
5002
|
-
|
|
5019
|
+
ce
|
|
5003
5020
|
);
|
|
5004
5021
|
}
|
|
5005
5022
|
return null;
|
|
5006
5023
|
case "multiselect":
|
|
5007
|
-
return
|
|
5008
|
-
|
|
5024
|
+
return d === "otherNationality" ? /* @__PURE__ */ a(
|
|
5025
|
+
mr,
|
|
5009
5026
|
{
|
|
5010
|
-
...
|
|
5011
|
-
label:
|
|
5012
|
-
value: v[
|
|
5013
|
-
onChange: (ne) =>
|
|
5027
|
+
...re,
|
|
5028
|
+
label: te,
|
|
5029
|
+
value: v[d] || [],
|
|
5030
|
+
onChange: (ne) => K(d, ne),
|
|
5014
5031
|
options: N,
|
|
5015
5032
|
placeholder: "Select other nationalities...",
|
|
5016
5033
|
disabled: h
|
|
5017
5034
|
},
|
|
5018
|
-
|
|
5035
|
+
ce
|
|
5019
5036
|
) : null;
|
|
5020
5037
|
case "date":
|
|
5021
5038
|
return /* @__PURE__ */ a(
|
|
5022
5039
|
ue,
|
|
5023
5040
|
{
|
|
5024
|
-
...
|
|
5041
|
+
...re,
|
|
5025
5042
|
type: "date",
|
|
5026
|
-
label:
|
|
5027
|
-
value: v[
|
|
5028
|
-
onChange: (ne) =>
|
|
5029
|
-
error:
|
|
5043
|
+
label: te,
|
|
5044
|
+
value: v[d] || "",
|
|
5045
|
+
onChange: (ne) => K(d, ne.target.value),
|
|
5046
|
+
error: z
|
|
5030
5047
|
},
|
|
5031
|
-
|
|
5048
|
+
ce
|
|
5032
5049
|
);
|
|
5033
5050
|
case "email":
|
|
5034
5051
|
return /* @__PURE__ */ a(
|
|
5035
5052
|
ue,
|
|
5036
5053
|
{
|
|
5037
|
-
...
|
|
5054
|
+
...re,
|
|
5038
5055
|
type: "email",
|
|
5039
|
-
label:
|
|
5040
|
-
value: v[
|
|
5041
|
-
onChange: (ne) =>
|
|
5042
|
-
error:
|
|
5056
|
+
label: te,
|
|
5057
|
+
value: v[d] || "",
|
|
5058
|
+
onChange: (ne) => K(d, ne.target.value),
|
|
5059
|
+
error: z
|
|
5043
5060
|
},
|
|
5044
|
-
|
|
5061
|
+
ce
|
|
5045
5062
|
);
|
|
5046
5063
|
case "tel":
|
|
5047
5064
|
return /* @__PURE__ */ a(
|
|
5048
5065
|
ue,
|
|
5049
5066
|
{
|
|
5050
|
-
...
|
|
5067
|
+
...re,
|
|
5051
5068
|
type: "tel",
|
|
5052
|
-
label:
|
|
5053
|
-
value: v[
|
|
5054
|
-
onChange: (ne) =>
|
|
5055
|
-
error:
|
|
5069
|
+
label: te,
|
|
5070
|
+
value: v[d] || "",
|
|
5071
|
+
onChange: (ne) => K(d, ne.target.value),
|
|
5072
|
+
error: z
|
|
5056
5073
|
},
|
|
5057
|
-
|
|
5074
|
+
ce
|
|
5058
5075
|
);
|
|
5059
5076
|
default:
|
|
5060
5077
|
return /* @__PURE__ */ a(
|
|
5061
5078
|
ue,
|
|
5062
5079
|
{
|
|
5063
|
-
...
|
|
5080
|
+
...re,
|
|
5064
5081
|
type: "text",
|
|
5065
|
-
label:
|
|
5066
|
-
value: v[
|
|
5067
|
-
onChange: (ne) =>
|
|
5068
|
-
error:
|
|
5082
|
+
label: te,
|
|
5083
|
+
value: v[d] || "",
|
|
5084
|
+
onChange: (ne) => K(d, ne.target.value),
|
|
5085
|
+
error: z
|
|
5069
5086
|
},
|
|
5070
|
-
|
|
5087
|
+
ce
|
|
5071
5088
|
);
|
|
5072
5089
|
}
|
|
5073
|
-
},
|
|
5074
|
-
if (!
|
|
5075
|
-
const
|
|
5076
|
-
if (
|
|
5090
|
+
}, ve = (d, I) => {
|
|
5091
|
+
if (!d.paramName) return null;
|
|
5092
|
+
const M = D[d.paramName], C = d.displayText || d.label || d.paramName;
|
|
5093
|
+
if (d.customType === "checkbox")
|
|
5077
5094
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
5078
5095
|
/* @__PURE__ */ i(
|
|
5079
5096
|
"label",
|
|
@@ -5085,10 +5102,10 @@ const Oe = {
|
|
|
5085
5102
|
"input",
|
|
5086
5103
|
{
|
|
5087
5104
|
type: "checkbox",
|
|
5088
|
-
checked:
|
|
5089
|
-
onChange: (
|
|
5105
|
+
checked: H[d.paramName] === "true",
|
|
5106
|
+
onChange: (E) => le(d.paramName, E.target.checked ? "true" : "false"),
|
|
5090
5107
|
className: "metakyc-option-input",
|
|
5091
|
-
style:
|
|
5108
|
+
style: ze
|
|
5092
5109
|
}
|
|
5093
5110
|
),
|
|
5094
5111
|
/* @__PURE__ */ i(
|
|
@@ -5097,17 +5114,17 @@ const Oe = {
|
|
|
5097
5114
|
className: "metakyc-option-text",
|
|
5098
5115
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5099
5116
|
children: [
|
|
5100
|
-
|
|
5101
|
-
|
|
5117
|
+
C,
|
|
5118
|
+
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5102
5119
|
]
|
|
5103
5120
|
}
|
|
5104
5121
|
)
|
|
5105
5122
|
]
|
|
5106
5123
|
}
|
|
5107
5124
|
),
|
|
5108
|
-
|
|
5125
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: M })
|
|
5109
5126
|
] }, `custom-${I}`);
|
|
5110
|
-
if (
|
|
5127
|
+
if (d.customType === "link_checkbox")
|
|
5111
5128
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
5112
5129
|
/* @__PURE__ */ i(
|
|
5113
5130
|
"label",
|
|
@@ -5119,10 +5136,10 @@ const Oe = {
|
|
|
5119
5136
|
"input",
|
|
5120
5137
|
{
|
|
5121
5138
|
type: "checkbox",
|
|
5122
|
-
checked:
|
|
5123
|
-
onChange: (
|
|
5139
|
+
checked: H[d.paramName] === "true",
|
|
5140
|
+
onChange: (E) => le(d.paramName, E.target.checked ? "true" : "false"),
|
|
5124
5141
|
className: "metakyc-option-input",
|
|
5125
|
-
style: { ...
|
|
5142
|
+
style: { ...ze, alignSelf: "flex-start", marginTop: "2px" }
|
|
5126
5143
|
}
|
|
5127
5144
|
),
|
|
5128
5145
|
/* @__PURE__ */ i(
|
|
@@ -5131,31 +5148,31 @@ const Oe = {
|
|
|
5131
5148
|
className: "metakyc-option-text",
|
|
5132
5149
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5133
5150
|
children: [
|
|
5134
|
-
|
|
5151
|
+
C,
|
|
5135
5152
|
" ",
|
|
5136
|
-
|
|
5153
|
+
d.linkUrl && /* @__PURE__ */ a(
|
|
5137
5154
|
"a",
|
|
5138
5155
|
{
|
|
5139
|
-
href:
|
|
5156
|
+
href: d.linkUrl,
|
|
5140
5157
|
target: "_blank",
|
|
5141
5158
|
rel: "noopener noreferrer",
|
|
5142
5159
|
className: "underline",
|
|
5143
5160
|
style: { color: "var(--metakyc-primary, #2563eb)" },
|
|
5144
|
-
onClick: (
|
|
5145
|
-
children:
|
|
5161
|
+
onClick: (E) => E.stopPropagation(),
|
|
5162
|
+
children: d.linkText || d.linkUrl
|
|
5146
5163
|
}
|
|
5147
5164
|
),
|
|
5148
|
-
|
|
5165
|
+
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5149
5166
|
]
|
|
5150
5167
|
}
|
|
5151
5168
|
)
|
|
5152
5169
|
]
|
|
5153
5170
|
}
|
|
5154
5171
|
),
|
|
5155
|
-
|
|
5172
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: M })
|
|
5156
5173
|
] }, `custom-${I}`);
|
|
5157
|
-
if (
|
|
5158
|
-
const
|
|
5174
|
+
if (d.customType === "group_checkbox") {
|
|
5175
|
+
const E = (H[d.paramName] || "").split(",").filter(Boolean);
|
|
5159
5176
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
5160
5177
|
/* @__PURE__ */ i(
|
|
5161
5178
|
"div",
|
|
@@ -5163,12 +5180,12 @@ const Oe = {
|
|
|
5163
5180
|
className: "text-sm font-medium",
|
|
5164
5181
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5165
5182
|
children: [
|
|
5166
|
-
|
|
5167
|
-
|
|
5183
|
+
C,
|
|
5184
|
+
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5168
5185
|
]
|
|
5169
5186
|
}
|
|
5170
5187
|
),
|
|
5171
|
-
/* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (
|
|
5188
|
+
/* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((z) => /* @__PURE__ */ i(
|
|
5172
5189
|
"label",
|
|
5173
5190
|
{
|
|
5174
5191
|
className: "metakyc-option-label",
|
|
@@ -5178,13 +5195,13 @@ const Oe = {
|
|
|
5178
5195
|
"input",
|
|
5179
5196
|
{
|
|
5180
5197
|
type: "checkbox",
|
|
5181
|
-
checked:
|
|
5182
|
-
onChange: (
|
|
5183
|
-
const
|
|
5184
|
-
le(
|
|
5198
|
+
checked: E.includes(z.value),
|
|
5199
|
+
onChange: (te) => {
|
|
5200
|
+
const ce = te.target.checked ? [...E, z.value] : E.filter((re) => re !== z.value);
|
|
5201
|
+
le(d.paramName, ce.join(","));
|
|
5185
5202
|
},
|
|
5186
5203
|
className: "metakyc-option-input",
|
|
5187
|
-
style:
|
|
5204
|
+
style: ze
|
|
5188
5205
|
}
|
|
5189
5206
|
),
|
|
5190
5207
|
/* @__PURE__ */ a(
|
|
@@ -5192,29 +5209,29 @@ const Oe = {
|
|
|
5192
5209
|
{
|
|
5193
5210
|
className: "metakyc-option-text",
|
|
5194
5211
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5195
|
-
children:
|
|
5212
|
+
children: z.label
|
|
5196
5213
|
}
|
|
5197
5214
|
)
|
|
5198
5215
|
]
|
|
5199
5216
|
},
|
|
5200
|
-
|
|
5217
|
+
z.value
|
|
5201
5218
|
)) }),
|
|
5202
|
-
|
|
5219
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: M })
|
|
5203
5220
|
] }, `custom-${I}`);
|
|
5204
5221
|
}
|
|
5205
|
-
return
|
|
5222
|
+
return d.customType === "radio_group" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
5206
5223
|
/* @__PURE__ */ i(
|
|
5207
5224
|
"div",
|
|
5208
5225
|
{
|
|
5209
5226
|
className: "text-sm font-medium",
|
|
5210
5227
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5211
5228
|
children: [
|
|
5212
|
-
|
|
5213
|
-
|
|
5229
|
+
C,
|
|
5230
|
+
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5214
5231
|
]
|
|
5215
5232
|
}
|
|
5216
5233
|
),
|
|
5217
|
-
/* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (
|
|
5234
|
+
/* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((E) => /* @__PURE__ */ i(
|
|
5218
5235
|
"label",
|
|
5219
5236
|
{
|
|
5220
5237
|
className: "metakyc-option-label",
|
|
@@ -5224,11 +5241,11 @@ const Oe = {
|
|
|
5224
5241
|
"input",
|
|
5225
5242
|
{
|
|
5226
5243
|
type: "radio",
|
|
5227
|
-
checked:
|
|
5228
|
-
onChange: () => le(
|
|
5229
|
-
name: `radio-group-${
|
|
5244
|
+
checked: H[d.paramName] === E.value,
|
|
5245
|
+
onChange: () => le(d.paramName, E.value),
|
|
5246
|
+
name: `radio-group-${d.paramName}-${I}`,
|
|
5230
5247
|
className: "metakyc-option-input",
|
|
5231
|
-
style:
|
|
5248
|
+
style: ze
|
|
5232
5249
|
}
|
|
5233
5250
|
),
|
|
5234
5251
|
/* @__PURE__ */ a(
|
|
@@ -5236,137 +5253,138 @@ const Oe = {
|
|
|
5236
5253
|
{
|
|
5237
5254
|
className: "metakyc-option-text",
|
|
5238
5255
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5239
|
-
children:
|
|
5256
|
+
children: E.label
|
|
5240
5257
|
}
|
|
5241
5258
|
)
|
|
5242
5259
|
]
|
|
5243
5260
|
},
|
|
5244
|
-
|
|
5261
|
+
E.value
|
|
5245
5262
|
)) }),
|
|
5246
|
-
|
|
5263
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: M })
|
|
5247
5264
|
] }, `custom-${I}`) : /* @__PURE__ */ a(
|
|
5248
5265
|
ue,
|
|
5249
5266
|
{
|
|
5250
5267
|
type: "text",
|
|
5251
|
-
label: `${
|
|
5252
|
-
value:
|
|
5253
|
-
onChange: (
|
|
5254
|
-
required:
|
|
5255
|
-
error:
|
|
5268
|
+
label: `${C}${d.required ? " *" : ""}`,
|
|
5269
|
+
value: H[d.paramName] || "",
|
|
5270
|
+
onChange: (E) => le(d.paramName, E.target.value),
|
|
5271
|
+
required: d.required,
|
|
5272
|
+
error: M
|
|
5256
5273
|
},
|
|
5257
5274
|
`custom-${I}`
|
|
5258
5275
|
);
|
|
5259
|
-
},
|
|
5260
|
-
const
|
|
5261
|
-
return /* @__PURE__ */ a("div", { className:
|
|
5276
|
+
}, Le = (d) => /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-4", children: d.fields.map((I, M) => {
|
|
5277
|
+
const C = I.colSpan === 1 ? "col-span-1" : "col-span-2", E = I.isCustom ? `custom-${M}-${I.paramName}` : `builtin-${I.name}-${M}`;
|
|
5278
|
+
return /* @__PURE__ */ a("div", { className: C, children: I.isCustom ? ve(I, M) : Fe(I.name, E, I.displayText) }, E);
|
|
5262
5279
|
}) });
|
|
5263
5280
|
if (h)
|
|
5264
5281
|
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5265
|
-
/* @__PURE__ */ a(
|
|
5282
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
5266
5283
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
5267
5284
|
] }) }) });
|
|
5268
|
-
if (
|
|
5269
|
-
const
|
|
5285
|
+
if (m) {
|
|
5286
|
+
const d = m[f] ?? m[0], I = L === -1, M = O === -1, C = m.length, E = m.filter(be).length, z = m.slice(0, f + 1).filter(be).length, te = Object.values(D);
|
|
5270
5287
|
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i($, { children: [
|
|
5271
|
-
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(
|
|
5288
|
+
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(Ye, { title: (o == null ? void 0 : o.title) || "Create Applicant" }) }),
|
|
5272
5289
|
/* @__PURE__ */ i(B, { children: [
|
|
5273
|
-
(
|
|
5274
|
-
|
|
5290
|
+
(d.title || d.subtitle || d.description) && /* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
5291
|
+
d.title && /* @__PURE__ */ a(
|
|
5275
5292
|
"h3",
|
|
5276
5293
|
{
|
|
5277
5294
|
className: "font-semibold text-base",
|
|
5278
5295
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5279
|
-
children:
|
|
5296
|
+
children: d.title
|
|
5280
5297
|
}
|
|
5281
5298
|
),
|
|
5282
|
-
|
|
5299
|
+
d.subtitle && /* @__PURE__ */ a(
|
|
5283
5300
|
"p",
|
|
5284
5301
|
{
|
|
5285
5302
|
className: "text-sm mt-0.5",
|
|
5286
5303
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
5287
|
-
children:
|
|
5304
|
+
children: d.subtitle
|
|
5288
5305
|
}
|
|
5289
5306
|
),
|
|
5290
|
-
|
|
5307
|
+
d.description && d.description !== d.subtitle && /* @__PURE__ */ a(
|
|
5291
5308
|
"p",
|
|
5292
5309
|
{
|
|
5293
5310
|
className: "text-xs mt-1",
|
|
5294
5311
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
5295
|
-
children:
|
|
5312
|
+
children: d.description
|
|
5296
5313
|
}
|
|
5297
5314
|
)
|
|
5298
5315
|
] }),
|
|
5299
|
-
(
|
|
5300
|
-
|
|
5316
|
+
(W || te.length > 0) && /* @__PURE__ */ i("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
5317
|
+
W && /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
5301
5318
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
5302
5319
|
" ",
|
|
5303
|
-
|
|
5320
|
+
W
|
|
5304
5321
|
] }),
|
|
5305
|
-
|
|
5322
|
+
te.map((ce, re) => /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: ce }, re))
|
|
5306
5323
|
] }),
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5324
|
+
C > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
5325
|
+
m.map((ce, re) => {
|
|
5326
|
+
const Me = be(ce);
|
|
5327
|
+
return /* @__PURE__ */ a(
|
|
5328
|
+
"div",
|
|
5329
|
+
{
|
|
5330
|
+
className: `h-1.5 rounded-full transition-all ${re === f ? "flex-1" : "w-8"} ${Me ? "" : "opacity-30"}`,
|
|
5331
|
+
style: re === f ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : re < f ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: Me ? 0.7 : 0.2 } : { backgroundColor: "#e5e7eb" }
|
|
5332
|
+
},
|
|
5333
|
+
re
|
|
5334
|
+
);
|
|
5335
|
+
}),
|
|
5316
5336
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
5317
|
-
|
|
5337
|
+
z,
|
|
5318
5338
|
" / ",
|
|
5319
|
-
|
|
5339
|
+
E
|
|
5320
5340
|
] })
|
|
5321
5341
|
] }),
|
|
5322
|
-
|
|
5342
|
+
Le(d)
|
|
5323
5343
|
] }),
|
|
5324
5344
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
5325
5345
|
/* @__PURE__ */ i("div", { children: [
|
|
5326
5346
|
!I && /* @__PURE__ */ a(
|
|
5327
|
-
|
|
5347
|
+
U,
|
|
5328
5348
|
{
|
|
5329
5349
|
type: "button",
|
|
5330
5350
|
variant: "outline",
|
|
5331
5351
|
onClick: () => {
|
|
5332
|
-
A(
|
|
5352
|
+
A(L), Q({});
|
|
5333
5353
|
},
|
|
5334
|
-
disabled:
|
|
5354
|
+
disabled: R || u,
|
|
5335
5355
|
children: "Previous"
|
|
5336
5356
|
}
|
|
5337
5357
|
),
|
|
5338
|
-
I && n && /* @__PURE__ */ a(
|
|
5358
|
+
I && n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: R || u, children: "Cancel" })
|
|
5339
5359
|
] }),
|
|
5340
5360
|
/* @__PURE__ */ a(
|
|
5341
|
-
|
|
5361
|
+
U,
|
|
5342
5362
|
{
|
|
5343
5363
|
type: "button",
|
|
5344
|
-
isLoading:
|
|
5345
|
-
onClick:
|
|
5346
|
-
children:
|
|
5364
|
+
isLoading: R || u,
|
|
5365
|
+
onClick: M ? ae : Z,
|
|
5366
|
+
children: M ? "Submit" : "Next"
|
|
5347
5367
|
}
|
|
5348
5368
|
)
|
|
5349
5369
|
] })
|
|
5350
5370
|
] }) });
|
|
5351
5371
|
}
|
|
5352
|
-
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a("form", { onSubmit:
|
|
5353
|
-
|
|
5354
|
-
}, children: /* @__PURE__ */ i($, { children: [
|
|
5355
|
-
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(He, { title: (o == null ? void 0 : o.title) || "Create Applicant" }) }),
|
|
5372
|
+
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a("form", { onSubmit: j, children: /* @__PURE__ */ i($, { children: [
|
|
5373
|
+
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(Ye, { title: (o == null ? void 0 : o.title) || "Create Applicant" }) }),
|
|
5356
5374
|
/* @__PURE__ */ i(B, { children: [
|
|
5357
|
-
|
|
5375
|
+
W && /* @__PURE__ */ a("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
5358
5376
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
5359
5377
|
" ",
|
|
5360
|
-
|
|
5378
|
+
W
|
|
5361
5379
|
] }) }),
|
|
5362
|
-
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
5380
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: S.map((d) => Fe(d)) })
|
|
5363
5381
|
] }),
|
|
5364
5382
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
5365
|
-
n && /* @__PURE__ */ a(
|
|
5366
|
-
/* @__PURE__ */ a(
|
|
5383
|
+
n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: R || u, children: "Cancel" }),
|
|
5384
|
+
/* @__PURE__ */ a(U, { type: "submit", isLoading: R || u, children: "Create Applicant" })
|
|
5367
5385
|
] })
|
|
5368
5386
|
] }) }) });
|
|
5369
|
-
},
|
|
5387
|
+
}, ta = ({
|
|
5370
5388
|
applicantId: e,
|
|
5371
5389
|
onComplete: t,
|
|
5372
5390
|
onError: r,
|
|
@@ -5377,25 +5395,25 @@ const Oe = {
|
|
|
5377
5395
|
progress: l,
|
|
5378
5396
|
currentStep: o,
|
|
5379
5397
|
steps: c,
|
|
5380
|
-
workflowKey:
|
|
5381
|
-
nextWorkflowKey:
|
|
5398
|
+
workflowKey: u,
|
|
5399
|
+
nextWorkflowKey: p,
|
|
5382
5400
|
hasWorkflowChanged: w,
|
|
5383
5401
|
isLoading: N,
|
|
5384
5402
|
error: y,
|
|
5385
5403
|
moveBack: h,
|
|
5386
5404
|
refreshProgress: g
|
|
5387
|
-
} =
|
|
5388
|
-
if (
|
|
5405
|
+
} = sr(e), [k, b] = ge.useState(!1);
|
|
5406
|
+
if (ge.useEffect(() => {
|
|
5389
5407
|
y && r && r(y);
|
|
5390
|
-
}, [y, r]),
|
|
5408
|
+
}, [y, r]), ge.useEffect(() => {
|
|
5391
5409
|
l != null && l.workflowResult && t && t(l.workflowResult);
|
|
5392
|
-
}, [l == null ? void 0 : l.workflowResult, t]),
|
|
5410
|
+
}, [l == null ? void 0 : l.workflowResult, t]), ge.useEffect(() => {
|
|
5393
5411
|
n === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
5394
|
-
}, [n]),
|
|
5412
|
+
}, [n]), ge.useEffect(() => {
|
|
5395
5413
|
w && b(!1);
|
|
5396
5414
|
}, [w]), N || !l)
|
|
5397
5415
|
return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5398
|
-
/* @__PURE__ */ a(
|
|
5416
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
5399
5417
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
5400
5418
|
] }) }) });
|
|
5401
5419
|
if (y)
|
|
@@ -5412,12 +5430,12 @@ const Oe = {
|
|
|
5412
5430
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between text-sm", children: [
|
|
5413
5431
|
/* @__PURE__ */ i("div", { className: "text-left", children: [
|
|
5414
5432
|
/* @__PURE__ */ a("p", { className: "text-gray-500 dark:text-gray-400 mb-1", children: "Previous Workflow" }),
|
|
5415
|
-
/* @__PURE__ */ a("p", { className: "font-medium text-gray-900 dark:text-white", children:
|
|
5433
|
+
/* @__PURE__ */ a("p", { className: "font-medium text-gray-900 dark:text-white", children: u })
|
|
5416
5434
|
] }),
|
|
5417
5435
|
/* @__PURE__ */ a("svg", { className: "w-6 h-6 text-gray-400 mx-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }),
|
|
5418
5436
|
/* @__PURE__ */ i("div", { className: "text-right", children: [
|
|
5419
5437
|
/* @__PURE__ */ a("p", { className: "text-gray-500 dark:text-gray-400 mb-1", children: "New Workflow" }),
|
|
5420
|
-
/* @__PURE__ */ a("p", { className: "font-medium text-blue-600 dark:text-blue-400", children:
|
|
5438
|
+
/* @__PURE__ */ a("p", { className: "font-medium text-blue-600 dark:text-blue-400", children: p })
|
|
5421
5439
|
] })
|
|
5422
5440
|
] }),
|
|
5423
5441
|
l.nextWorkflowName && /* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-2 text-xs", children: l.nextWorkflowName })
|
|
@@ -5431,9 +5449,9 @@ const Oe = {
|
|
|
5431
5449
|
}
|
|
5432
5450
|
)
|
|
5433
5451
|
] }) }) }) });
|
|
5434
|
-
if (l.status ===
|
|
5452
|
+
if (l.status === fe.Finished || l.status === fe.OnHold)
|
|
5435
5453
|
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a(
|
|
5436
|
-
|
|
5454
|
+
et,
|
|
5437
5455
|
{
|
|
5438
5456
|
kycStatus: l.kycStatus,
|
|
5439
5457
|
reviewStatus: l.reviewStatus,
|
|
@@ -5447,54 +5465,54 @@ const Oe = {
|
|
|
5447
5465
|
) });
|
|
5448
5466
|
if (!o)
|
|
5449
5467
|
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5450
|
-
/* @__PURE__ */ a(
|
|
5451
|
-
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status ===
|
|
5468
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
5469
|
+
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status === fe.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
5452
5470
|
] }) }) });
|
|
5453
|
-
const
|
|
5471
|
+
const m = (v) => {
|
|
5454
5472
|
switch (v) {
|
|
5455
|
-
case
|
|
5473
|
+
case _.Overview:
|
|
5456
5474
|
return "Overview";
|
|
5457
|
-
case
|
|
5475
|
+
case _.Questionaries:
|
|
5458
5476
|
return "Questionnaire";
|
|
5459
|
-
case
|
|
5477
|
+
case _.UploadDocument:
|
|
5460
5478
|
return "Documents";
|
|
5461
|
-
case
|
|
5479
|
+
case _.IdentitySdk:
|
|
5462
5480
|
return "Identity";
|
|
5463
|
-
case
|
|
5481
|
+
case _.RiskScoring:
|
|
5464
5482
|
return "Risk Assessment";
|
|
5465
|
-
case
|
|
5483
|
+
case _.InvestorCategorization:
|
|
5466
5484
|
return "Investor Categorization";
|
|
5467
|
-
case
|
|
5485
|
+
case _.AppropriatenessTest:
|
|
5468
5486
|
return "Appropriateness Test";
|
|
5469
|
-
case
|
|
5487
|
+
case _.AdditionalData:
|
|
5470
5488
|
return "Additional Data";
|
|
5471
|
-
case
|
|
5489
|
+
case _.ManualReview:
|
|
5472
5490
|
return "Review";
|
|
5473
5491
|
default:
|
|
5474
5492
|
return "";
|
|
5475
5493
|
}
|
|
5476
5494
|
}, F = () => {
|
|
5477
|
-
const v = c.filter((f) => f.visibility !== !1),
|
|
5495
|
+
const v = c.filter((f) => f.visibility !== !1), q = v.findIndex((f) => f.order === o.order), H = q >= 0 ? q + 1 : 1, T = v.length;
|
|
5478
5496
|
return /* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
5479
5497
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5480
|
-
/* @__PURE__ */ a(
|
|
5481
|
-
/* @__PURE__ */ i(
|
|
5498
|
+
/* @__PURE__ */ a(Ye, {}),
|
|
5499
|
+
/* @__PURE__ */ i(Se, { variant: l.status === 1 ? "info" : "success", children: [
|
|
5482
5500
|
"Step ",
|
|
5483
|
-
|
|
5501
|
+
H,
|
|
5484
5502
|
" of ",
|
|
5485
|
-
|
|
5503
|
+
T
|
|
5486
5504
|
] })
|
|
5487
5505
|
] }),
|
|
5488
5506
|
/* @__PURE__ */ a("div", { className: "flex items-center", children: v.map((f, A) => {
|
|
5489
|
-
const D = A <
|
|
5490
|
-
return /* @__PURE__ */ i(
|
|
5507
|
+
const D = A < q, Q = f.order === o.order;
|
|
5508
|
+
return /* @__PURE__ */ i(ge.Fragment, { children: [
|
|
5491
5509
|
/* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
5492
5510
|
/* @__PURE__ */ a(
|
|
5493
5511
|
"div",
|
|
5494
5512
|
{
|
|
5495
5513
|
className: `
|
|
5496
5514
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
5497
|
-
${D ||
|
|
5515
|
+
${D || Q ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
5498
5516
|
`,
|
|
5499
5517
|
children: A + 1
|
|
5500
5518
|
}
|
|
@@ -5502,8 +5520,8 @@ const Oe = {
|
|
|
5502
5520
|
/* @__PURE__ */ a(
|
|
5503
5521
|
"span",
|
|
5504
5522
|
{
|
|
5505
|
-
className: `ml-2 text-sm ${
|
|
5506
|
-
children: f.displayName || f.name ||
|
|
5523
|
+
className: `ml-2 text-sm ${Q ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
5524
|
+
children: f.displayName || f.name || m(f.action) || `Step ${A + 1}`
|
|
5507
5525
|
}
|
|
5508
5526
|
)
|
|
5509
5527
|
] }),
|
|
@@ -5516,7 +5534,7 @@ const Oe = {
|
|
|
5516
5534
|
] }, f.order);
|
|
5517
5535
|
}) })
|
|
5518
5536
|
] });
|
|
5519
|
-
},
|
|
5537
|
+
}, S = () => {
|
|
5520
5538
|
const v = {
|
|
5521
5539
|
applicantId: e,
|
|
5522
5540
|
onComplete: async () => {
|
|
@@ -5525,24 +5543,24 @@ const Oe = {
|
|
|
5525
5543
|
onBack: o.order > 0 ? h : void 0
|
|
5526
5544
|
};
|
|
5527
5545
|
switch (o.action) {
|
|
5528
|
-
case
|
|
5529
|
-
return /* @__PURE__ */ a(
|
|
5530
|
-
case
|
|
5531
|
-
return /* @__PURE__ */ a(
|
|
5532
|
-
case
|
|
5533
|
-
return /* @__PURE__ */ a(Nr, { ...v });
|
|
5534
|
-
case U.IdentitySdk:
|
|
5535
|
-
return /* @__PURE__ */ a(Dr, { ...v });
|
|
5536
|
-
case U.RiskScoring:
|
|
5546
|
+
case _.Questionaries:
|
|
5547
|
+
return /* @__PURE__ */ a(Sr, { ...v });
|
|
5548
|
+
case _.UploadDocument:
|
|
5549
|
+
return /* @__PURE__ */ a(Ar, { ...v });
|
|
5550
|
+
case _.Overview:
|
|
5537
5551
|
return /* @__PURE__ */ a(Ir, { ...v });
|
|
5538
|
-
case
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
case
|
|
5552
|
+
case _.IdentitySdk:
|
|
5553
|
+
return /* @__PURE__ */ a(Tr, { ...v });
|
|
5554
|
+
case _.RiskScoring:
|
|
5555
|
+
return /* @__PURE__ */ a(Dr, { ...v });
|
|
5556
|
+
case _.AdditionalData:
|
|
5557
|
+
case _.InvestorCategorization:
|
|
5558
|
+
return /* @__PURE__ */ a(Lr, { ...v });
|
|
5559
|
+
case _.AppropriatenessTest:
|
|
5560
|
+
return /* @__PURE__ */ a(Mr, { ...v });
|
|
5561
|
+
case _.ManualReview:
|
|
5544
5562
|
return /* @__PURE__ */ a(
|
|
5545
|
-
|
|
5563
|
+
et,
|
|
5546
5564
|
{
|
|
5547
5565
|
kycStatus: l.kycStatus,
|
|
5548
5566
|
reviewStatus: l.reviewStatus,
|
|
@@ -5552,30 +5570,30 @@ const Oe = {
|
|
|
5552
5570
|
);
|
|
5553
5571
|
default:
|
|
5554
5572
|
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
|
|
5555
|
-
/* @__PURE__ */ a("div", { className: "mb-4", children: /* @__PURE__ */ a(
|
|
5573
|
+
/* @__PURE__ */ a("div", { className: "mb-4", children: /* @__PURE__ */ a(xe, {}) }),
|
|
5556
5574
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
5557
5575
|
"Processing step: ",
|
|
5558
5576
|
o.title || o.name
|
|
5559
5577
|
] }),
|
|
5560
5578
|
/* @__PURE__ */ i("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
5561
5579
|
"Action type: ",
|
|
5562
|
-
|
|
5580
|
+
_[o.action]
|
|
5563
5581
|
] })
|
|
5564
5582
|
] }) });
|
|
5565
5583
|
}
|
|
5566
5584
|
};
|
|
5567
5585
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
5568
5586
|
F(),
|
|
5569
|
-
|
|
5587
|
+
S()
|
|
5570
5588
|
] });
|
|
5571
5589
|
};
|
|
5572
|
-
function
|
|
5573
|
-
return
|
|
5574
|
-
questionResults:
|
|
5590
|
+
function ra(e) {
|
|
5591
|
+
return Ne.object({
|
|
5592
|
+
questionResults: Ne.any()
|
|
5575
5593
|
}).passthrough();
|
|
5576
5594
|
}
|
|
5577
|
-
function
|
|
5578
|
-
let t =
|
|
5595
|
+
function $r(e) {
|
|
5596
|
+
let t = Ne.array(Ne.instanceof(File));
|
|
5579
5597
|
if (e.isRequired ? t = t.min(
|
|
5580
5598
|
1,
|
|
5581
5599
|
`${e.displayName} is required`
|
|
@@ -5596,139 +5614,139 @@ function Lr(e) {
|
|
|
5596
5614
|
}
|
|
5597
5615
|
return t;
|
|
5598
5616
|
}
|
|
5599
|
-
function
|
|
5617
|
+
function aa(e) {
|
|
5600
5618
|
const t = {};
|
|
5601
5619
|
return e.uploadDocumentFiles.forEach((r) => {
|
|
5602
5620
|
const n = `file_${r.id}`;
|
|
5603
|
-
t[n] =
|
|
5604
|
-
}),
|
|
5621
|
+
t[n] = $r(r);
|
|
5622
|
+
}), Ne.object(t);
|
|
5605
5623
|
}
|
|
5606
|
-
function
|
|
5607
|
-
return
|
|
5624
|
+
function na(e) {
|
|
5625
|
+
return Ne.any();
|
|
5608
5626
|
}
|
|
5609
|
-
function
|
|
5610
|
-
return
|
|
5627
|
+
function Br(e) {
|
|
5628
|
+
return Ne.string().min(1, "This question is required");
|
|
5611
5629
|
}
|
|
5612
|
-
function
|
|
5630
|
+
function sa(e) {
|
|
5613
5631
|
const t = {};
|
|
5614
5632
|
return e.appropriatenessQuestions.forEach((r) => {
|
|
5615
5633
|
const n = `question_${r.id}`;
|
|
5616
|
-
t[n] =
|
|
5617
|
-
}),
|
|
5634
|
+
t[n] = Br();
|
|
5635
|
+
}), Ne.object(t);
|
|
5618
5636
|
}
|
|
5619
|
-
const
|
|
5637
|
+
const ia = Ne.any();
|
|
5620
5638
|
export {
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5639
|
+
Je as ALLOWED_LANGUAGES,
|
|
5640
|
+
ht as ApplicantProgressOnHoldReason,
|
|
5641
|
+
fe as ApplicantProgressStatus,
|
|
5642
|
+
Rt as ApplicantService,
|
|
5643
|
+
yt as ApplicantStatus,
|
|
5644
|
+
wt as AppropriatenessQuestionType,
|
|
5645
|
+
Pt as AppropriatenessTestService,
|
|
5646
|
+
Mr as AppropriatenessTestStep,
|
|
5647
|
+
Se as Badge,
|
|
5648
|
+
Ot as BaseInformationService,
|
|
5649
|
+
U as Button,
|
|
5632
5650
|
$ as Card,
|
|
5633
5651
|
B as CardContent,
|
|
5634
5652
|
me as CardFooter,
|
|
5635
5653
|
oe as CardHeader,
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5654
|
+
ea as CreateApplicantForm,
|
|
5655
|
+
Nt as CriteriaBuiltInType,
|
|
5656
|
+
Ct as DEFAULT_VISIBLE_FIELDS,
|
|
5657
|
+
vt as DocumentReviewStatus,
|
|
5658
|
+
It as EndpointBuilder,
|
|
5659
|
+
Te as ErrorHandler,
|
|
5660
|
+
Ht as EventEmitter,
|
|
5661
|
+
Ke as FIELD_METADATA,
|
|
5662
|
+
bt as FileType,
|
|
5663
|
+
pr as FileUpload,
|
|
5664
|
+
Ue as GenderType,
|
|
5665
|
+
Ye as Header,
|
|
5666
|
+
Et as HttpClient,
|
|
5649
5667
|
De as IdentityProviderManager,
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5668
|
+
Tt as IdentityService,
|
|
5669
|
+
ye as IdentityVerificationProvider,
|
|
5670
|
+
Tr as IdentityVerificationStep,
|
|
5653
5671
|
ue as Input,
|
|
5654
|
-
|
|
5655
|
-
|
|
5672
|
+
$t as InvestorCategorizationService,
|
|
5673
|
+
Lr as InvestorCategorizationStep,
|
|
5656
5674
|
pe as InvestorCategorizationType,
|
|
5657
|
-
|
|
5658
|
-
|
|
5675
|
+
St as InvestorCategoryType,
|
|
5676
|
+
ft as KycProcessStatus,
|
|
5659
5677
|
Ee as KycStatus,
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5678
|
+
et as KycStatusDisplay,
|
|
5679
|
+
ta as KycWorkflow,
|
|
5680
|
+
Or as Logo,
|
|
5681
|
+
rt as MetaKYCContext,
|
|
5664
5682
|
we as MetaKYCError,
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5683
|
+
Yr as MetaKYCProvider,
|
|
5684
|
+
mr as MultiSelect,
|
|
5685
|
+
Gt as OnfidoProvider,
|
|
5686
|
+
Lt as OverviewService,
|
|
5687
|
+
Ir as OverviewStep,
|
|
5688
|
+
hr as PhoneInput,
|
|
5689
|
+
Ft as QuestionnaireService,
|
|
5690
|
+
Sr as QuestionnaireStep,
|
|
5673
5691
|
Re as ReviewStatus,
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5692
|
+
kt as RiskCriteriaType,
|
|
5693
|
+
gt as RiskLevel,
|
|
5694
|
+
Mt as RiskScoringService,
|
|
5695
|
+
Dr as RiskScoringStep,
|
|
5696
|
+
Zt as SardinAIProvider,
|
|
5679
5697
|
Ae as Select,
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5698
|
+
xe as Spinner,
|
|
5699
|
+
Yt as StepRouter,
|
|
5700
|
+
Vt as SumsubProvider,
|
|
5701
|
+
Jt as ThemeManager,
|
|
5684
5702
|
se as ThemePreset,
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5703
|
+
jt as ThemeService,
|
|
5704
|
+
Dt as UploadDocumentService,
|
|
5705
|
+
Ar as UploadDocumentStep,
|
|
5706
|
+
xt as UserType,
|
|
5689
5707
|
Ce as ValueDataType,
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5708
|
+
Qt as WorkflowOrchestrator,
|
|
5709
|
+
_e as WorkflowResultType,
|
|
5710
|
+
Wt as WorkflowState,
|
|
5711
|
+
_ as WorkflowStepAction,
|
|
5712
|
+
ia as appropriatenessTestSchema,
|
|
5713
|
+
Jr as clearAllStorage,
|
|
5714
|
+
rr as clearApplicantId,
|
|
5715
|
+
nr as clearWorkflowState,
|
|
5698
5716
|
ie as cn,
|
|
5699
|
-
|
|
5700
|
-
|
|
5717
|
+
Bt as corporateTheme,
|
|
5718
|
+
At as defaultConfig,
|
|
5701
5719
|
de as defaultTheme,
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5720
|
+
Xt as fileToBase64,
|
|
5721
|
+
zt as fintechTheme,
|
|
5722
|
+
je as formatFileSize,
|
|
5723
|
+
sa as generateAppropriatenessSchema,
|
|
5724
|
+
ra as generateQuestionnaireSchema,
|
|
5725
|
+
na as generateRiskScoringSchema,
|
|
5726
|
+
aa as generateUploadDocumentSchema,
|
|
5727
|
+
Gr as getAcceptString,
|
|
5728
|
+
tr as getApplicantId,
|
|
5729
|
+
Oe as getThemePreset,
|
|
5730
|
+
Zr as getWorkflowState,
|
|
5731
|
+
_t as healthcareTheme,
|
|
5732
|
+
Hr as isScriptLoaded,
|
|
5733
|
+
tt as loadScript,
|
|
5734
|
+
qt as minimalTheme,
|
|
5735
|
+
Ut as modernTheme,
|
|
5736
|
+
Wr as removeScript,
|
|
5737
|
+
er as saveApplicantId,
|
|
5738
|
+
ar as saveWorkflowState,
|
|
5739
|
+
Kt as themePresets,
|
|
5740
|
+
ur as useApplicant,
|
|
5741
|
+
Xr as useAppropriatenessTest,
|
|
5742
|
+
cr as useIdentityVerification,
|
|
5743
|
+
sr as useKycWorkflow,
|
|
5726
5744
|
he as useMetaKYC,
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5745
|
+
or as useOverview,
|
|
5746
|
+
ir as useQuestionnaire,
|
|
5747
|
+
dr as useRiskScoring,
|
|
5748
|
+
lr as useUploadDocument,
|
|
5749
|
+
Qr as validateFileSize,
|
|
5750
|
+
Vr as validateFileType
|
|
5733
5751
|
};
|
|
5734
5752
|
//# sourceMappingURL=index.js.map
|