@vpdev2/metakyc-sdk 1.0.43 → 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/components/core/Select.d.ts +1 -1
- package/dist/components/core/Select.d.ts.map +1 -1
- package/dist/index.cjs +17 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1146 -1099
- 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,45 +2615,74 @@ 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,
|
|
2620
|
-
e && /* @__PURE__ */ i(
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
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
|
+
e && /* @__PURE__ */ i(
|
|
2621
|
+
"label",
|
|
2622
|
+
{
|
|
2623
|
+
className: "block text-sm font-medium mb-1",
|
|
2624
|
+
style: { color: "var(--metakyc-text-primary, #374151)" },
|
|
2625
|
+
children: [
|
|
2626
|
+
e,
|
|
2627
|
+
c.required && /* @__PURE__ */ a("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
2628
|
+
]
|
|
2629
|
+
}
|
|
2630
|
+
),
|
|
2624
2631
|
/* @__PURE__ */ i(
|
|
2625
2632
|
"select",
|
|
2626
2633
|
{
|
|
2627
|
-
ref:
|
|
2634
|
+
ref: u,
|
|
2628
2635
|
className: ie(
|
|
2629
2636
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2630
|
-
"focus:outline-none focus:ring-2 focus:ring-
|
|
2631
|
-
"disabled:
|
|
2632
|
-
t ? "border-danger-500
|
|
2633
|
-
"dark:bg-gray-800 dark:text-white",
|
|
2637
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
2638
|
+
"disabled:opacity-60 disabled:cursor-not-allowed",
|
|
2639
|
+
t ? "border-danger-500" : "",
|
|
2634
2640
|
l
|
|
2635
2641
|
),
|
|
2636
|
-
|
|
2642
|
+
style: {
|
|
2643
|
+
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2644
|
+
color: "var(--metakyc-text-primary, #111827)",
|
|
2645
|
+
borderColor: t ? "var(--metakyc-error, #ef4444)" : "var(--metakyc-border, #d1d5db)",
|
|
2646
|
+
// ring color via outline on focus
|
|
2647
|
+
...o
|
|
2648
|
+
},
|
|
2649
|
+
...c,
|
|
2637
2650
|
children: [
|
|
2638
|
-
s && /* @__PURE__ */ a(
|
|
2639
|
-
n.map((d, m) => /* @__PURE__ */ a(
|
|
2651
|
+
s && /* @__PURE__ */ a(
|
|
2640
2652
|
"option",
|
|
2641
2653
|
{
|
|
2642
|
-
value:
|
|
2643
|
-
disabled:
|
|
2644
|
-
|
|
2654
|
+
value: "",
|
|
2655
|
+
disabled: !0,
|
|
2656
|
+
style: {
|
|
2657
|
+
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2658
|
+
color: "var(--metakyc-text-secondary, #6b7280)"
|
|
2659
|
+
},
|
|
2660
|
+
children: s
|
|
2645
2661
|
},
|
|
2646
|
-
|
|
2662
|
+
"__placeholder__"
|
|
2663
|
+
),
|
|
2664
|
+
n.map((p, w) => /* @__PURE__ */ a(
|
|
2665
|
+
"option",
|
|
2666
|
+
{
|
|
2667
|
+
value: p.value,
|
|
2668
|
+
disabled: p.disabled,
|
|
2669
|
+
style: {
|
|
2670
|
+
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2671
|
+
color: p.disabled ? "var(--metakyc-text-secondary, #9ca3af)" : "var(--metakyc-text-primary, #111827)"
|
|
2672
|
+
},
|
|
2673
|
+
children: p.label
|
|
2674
|
+
},
|
|
2675
|
+
p.value || `option-${w}`
|
|
2647
2676
|
))
|
|
2648
2677
|
]
|
|
2649
2678
|
}
|
|
2650
2679
|
),
|
|
2651
|
-
t && /* @__PURE__ */ a("p", { className: "mt-1 text-sm
|
|
2652
|
-
!t && r && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-
|
|
2680
|
+
t && /* @__PURE__ */ a("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
2681
|
+
!t && r && /* @__PURE__ */ a("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r })
|
|
2653
2682
|
] })
|
|
2654
2683
|
);
|
|
2655
2684
|
Ae.displayName = "Select";
|
|
2656
|
-
const
|
|
2685
|
+
const mr = ({
|
|
2657
2686
|
label: e,
|
|
2658
2687
|
value: t,
|
|
2659
2688
|
onChange: r,
|
|
@@ -2662,22 +2691,22 @@ const or = ({
|
|
|
2662
2691
|
disabled: l = !1,
|
|
2663
2692
|
required: o = !1
|
|
2664
2693
|
}) => {
|
|
2665
|
-
const [c,
|
|
2666
|
-
|
|
2667
|
-
const b = (
|
|
2668
|
-
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(""));
|
|
2669
2698
|
};
|
|
2670
2699
|
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
2671
2700
|
}, []);
|
|
2672
2701
|
const y = n.filter(
|
|
2673
|
-
(b) => b.label.toLowerCase().includes(
|
|
2702
|
+
(b) => b.label.toLowerCase().includes(p.toLowerCase())
|
|
2674
2703
|
), h = (b) => {
|
|
2675
|
-
l || (t.includes(b) ? r(t.filter((
|
|
2676
|
-
}, g = (b,
|
|
2677
|
-
|
|
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));
|
|
2678
2707
|
}, k = (b) => {
|
|
2679
|
-
var
|
|
2680
|
-
return ((
|
|
2708
|
+
var m;
|
|
2709
|
+
return ((m = n.find((F) => F.value === b)) == null ? void 0 : m.label) || b;
|
|
2681
2710
|
};
|
|
2682
2711
|
return /* @__PURE__ */ i("div", { className: "w-full metakyc-multiselect", ref: N, children: [
|
|
2683
2712
|
e && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
@@ -2688,7 +2717,7 @@ const or = ({
|
|
|
2688
2717
|
/* @__PURE__ */ i(
|
|
2689
2718
|
"div",
|
|
2690
2719
|
{
|
|
2691
|
-
onClick: () => !l &&
|
|
2720
|
+
onClick: () => !l && u(!c),
|
|
2692
2721
|
className: ie(
|
|
2693
2722
|
"metakyc-multiselect-trigger",
|
|
2694
2723
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors",
|
|
@@ -2708,7 +2737,7 @@ const or = ({
|
|
|
2708
2737
|
"button",
|
|
2709
2738
|
{
|
|
2710
2739
|
type: "button",
|
|
2711
|
-
onClick: (
|
|
2740
|
+
onClick: (m) => g(b, m),
|
|
2712
2741
|
className: "metakyc-multiselect-chip-remove",
|
|
2713
2742
|
style: {
|
|
2714
2743
|
background: "transparent",
|
|
@@ -2750,7 +2779,7 @@ const or = ({
|
|
|
2750
2779
|
"input",
|
|
2751
2780
|
{
|
|
2752
2781
|
type: "text",
|
|
2753
|
-
value:
|
|
2782
|
+
value: p,
|
|
2754
2783
|
onChange: (b) => w(b.target.value),
|
|
2755
2784
|
placeholder: "Search...",
|
|
2756
2785
|
autoFocus: !0,
|
|
@@ -2804,7 +2833,7 @@ const or = ({
|
|
|
2804
2833
|
)
|
|
2805
2834
|
] })
|
|
2806
2835
|
] });
|
|
2807
|
-
},
|
|
2836
|
+
}, pr = ({
|
|
2808
2837
|
label: e,
|
|
2809
2838
|
error: t,
|
|
2810
2839
|
accept: r,
|
|
@@ -2814,26 +2843,26 @@ const or = ({
|
|
|
2814
2843
|
value: o = [],
|
|
2815
2844
|
className: c
|
|
2816
2845
|
}) => {
|
|
2817
|
-
const [
|
|
2818
|
-
if (!
|
|
2819
|
-
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);
|
|
2820
2849
|
if (s && F.filter((v) => v.size > s).length > 0) {
|
|
2821
|
-
const v =
|
|
2850
|
+
const v = je(s);
|
|
2822
2851
|
alert(`Some files exceed the maximum size of ${v}`);
|
|
2823
2852
|
return;
|
|
2824
2853
|
}
|
|
2825
2854
|
l == null || l(n ? [...o, ...F] : [F[0]]);
|
|
2826
|
-
}, y = (
|
|
2827
|
-
|
|
2855
|
+
}, y = (m) => {
|
|
2856
|
+
m.preventDefault(), p(!0);
|
|
2828
2857
|
}, h = () => {
|
|
2829
|
-
|
|
2830
|
-
}, g = (
|
|
2831
|
-
|
|
2858
|
+
p(!1);
|
|
2859
|
+
}, g = (m) => {
|
|
2860
|
+
m.preventDefault(), p(!1), N(m.dataTransfer.files);
|
|
2832
2861
|
}, k = () => {
|
|
2833
|
-
var
|
|
2834
|
-
(
|
|
2835
|
-
}, b = (
|
|
2836
|
-
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);
|
|
2837
2866
|
l == null || l(F);
|
|
2838
2867
|
};
|
|
2839
2868
|
return /* @__PURE__ */ i("div", { className: ie("w-full", c), children: [
|
|
@@ -2843,7 +2872,7 @@ const or = ({
|
|
|
2843
2872
|
{
|
|
2844
2873
|
className: ie(
|
|
2845
2874
|
"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
|
|
2846
|
-
|
|
2875
|
+
u ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
2847
2876
|
t && "border-danger-500"
|
|
2848
2877
|
),
|
|
2849
2878
|
onDragOver: y,
|
|
@@ -2859,7 +2888,7 @@ const or = ({
|
|
|
2859
2888
|
className: "hidden",
|
|
2860
2889
|
accept: r,
|
|
2861
2890
|
multiple: n,
|
|
2862
|
-
onChange: (
|
|
2891
|
+
onChange: (m) => N(m.target.files)
|
|
2863
2892
|
}
|
|
2864
2893
|
),
|
|
2865
2894
|
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
@@ -2887,13 +2916,13 @@ const or = ({
|
|
|
2887
2916
|
] }),
|
|
2888
2917
|
s && /* @__PURE__ */ i("p", { className: "text-xs text-gray-500", children: [
|
|
2889
2918
|
"Maximum file size: ",
|
|
2890
|
-
|
|
2919
|
+
je(s)
|
|
2891
2920
|
] })
|
|
2892
2921
|
] })
|
|
2893
2922
|
]
|
|
2894
2923
|
}
|
|
2895
2924
|
),
|
|
2896
|
-
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(
|
|
2897
2926
|
"div",
|
|
2898
2927
|
{
|
|
2899
2928
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -2915,10 +2944,10 @@ const or = ({
|
|
|
2915
2944
|
)
|
|
2916
2945
|
}
|
|
2917
2946
|
),
|
|
2918
|
-
/* @__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 }),
|
|
2919
2948
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-500", children: [
|
|
2920
2949
|
"(",
|
|
2921
|
-
|
|
2950
|
+
je(m.size),
|
|
2922
2951
|
")"
|
|
2923
2952
|
] })
|
|
2924
2953
|
] }),
|
|
@@ -2926,8 +2955,8 @@ const or = ({
|
|
|
2926
2955
|
"button",
|
|
2927
2956
|
{
|
|
2928
2957
|
type: "button",
|
|
2929
|
-
onClick: (
|
|
2930
|
-
|
|
2958
|
+
onClick: (S) => {
|
|
2959
|
+
S.stopPropagation(), b(F);
|
|
2931
2960
|
},
|
|
2932
2961
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2933
2962
|
children: /* @__PURE__ */ a("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ a(
|
|
@@ -2946,7 +2975,7 @@ const or = ({
|
|
|
2946
2975
|
)) }),
|
|
2947
2976
|
t && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-danger-500", children: t })
|
|
2948
2977
|
] });
|
|
2949
|
-
},
|
|
2978
|
+
}, hr = $e(
|
|
2950
2979
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: r, ...n }, s) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2951
2980
|
n.label && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2952
2981
|
n.label,
|
|
@@ -2981,28 +3010,28 @@ const or = ({
|
|
|
2981
3010
|
n.error && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-danger-500", children: n.error })
|
|
2982
3011
|
] })
|
|
2983
3012
|
);
|
|
2984
|
-
|
|
3013
|
+
hr.displayName = "PhoneInput";
|
|
2985
3014
|
/**
|
|
2986
3015
|
* @license lucide-react v0.574.0 - ISC
|
|
2987
3016
|
*
|
|
2988
3017
|
* This source code is licensed under the ISC license.
|
|
2989
3018
|
* See the LICENSE file in the root directory of this source tree.
|
|
2990
3019
|
*/
|
|
2991
|
-
const
|
|
3020
|
+
const at = (...e) => e.filter((t, r, n) => !!t && t.trim() !== "" && n.indexOf(t) === r).join(" ").trim();
|
|
2992
3021
|
/**
|
|
2993
3022
|
* @license lucide-react v0.574.0 - ISC
|
|
2994
3023
|
*
|
|
2995
3024
|
* This source code is licensed under the ISC license.
|
|
2996
3025
|
* See the LICENSE file in the root directory of this source tree.
|
|
2997
3026
|
*/
|
|
2998
|
-
const
|
|
3027
|
+
const gr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2999
3028
|
/**
|
|
3000
3029
|
* @license lucide-react v0.574.0 - ISC
|
|
3001
3030
|
*
|
|
3002
3031
|
* This source code is licensed under the ISC license.
|
|
3003
3032
|
* See the LICENSE file in the root directory of this source tree.
|
|
3004
3033
|
*/
|
|
3005
|
-
const
|
|
3034
|
+
const yr = (e) => e.replace(
|
|
3006
3035
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
3007
3036
|
(t, r, n) => n ? n.toUpperCase() : r.toLowerCase()
|
|
3008
3037
|
);
|
|
@@ -3012,8 +3041,8 @@ const mr = (e) => e.replace(
|
|
|
3012
3041
|
* This source code is licensed under the ISC license.
|
|
3013
3042
|
* See the LICENSE file in the root directory of this source tree.
|
|
3014
3043
|
*/
|
|
3015
|
-
const
|
|
3016
|
-
const t =
|
|
3044
|
+
const Xe = (e) => {
|
|
3045
|
+
const t = yr(e);
|
|
3017
3046
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3018
3047
|
};
|
|
3019
3048
|
/**
|
|
@@ -3022,7 +3051,7 @@ const Ve = (e) => {
|
|
|
3022
3051
|
* This source code is licensed under the ISC license.
|
|
3023
3052
|
* See the LICENSE file in the root directory of this source tree.
|
|
3024
3053
|
*/
|
|
3025
|
-
var
|
|
3054
|
+
var fr = {
|
|
3026
3055
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3027
3056
|
width: 24,
|
|
3028
3057
|
height: 24,
|
|
@@ -3039,7 +3068,7 @@ var pr = {
|
|
|
3039
3068
|
* This source code is licensed under the ISC license.
|
|
3040
3069
|
* See the LICENSE file in the root directory of this source tree.
|
|
3041
3070
|
*/
|
|
3042
|
-
const
|
|
3071
|
+
const xr = (e) => {
|
|
3043
3072
|
for (const t in e)
|
|
3044
3073
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
3045
3074
|
return !0;
|
|
@@ -3051,7 +3080,7 @@ const hr = (e) => {
|
|
|
3051
3080
|
* This source code is licensed under the ISC license.
|
|
3052
3081
|
* See the LICENSE file in the root directory of this source tree.
|
|
3053
3082
|
*/
|
|
3054
|
-
const
|
|
3083
|
+
const br = $e(
|
|
3055
3084
|
({
|
|
3056
3085
|
color: e = "currentColor",
|
|
3057
3086
|
size: t = 24,
|
|
@@ -3061,21 +3090,21 @@ const gr = Te(
|
|
|
3061
3090
|
children: l,
|
|
3062
3091
|
iconNode: o,
|
|
3063
3092
|
...c
|
|
3064
|
-
},
|
|
3093
|
+
}, u) => We(
|
|
3065
3094
|
"svg",
|
|
3066
3095
|
{
|
|
3067
|
-
ref:
|
|
3068
|
-
...
|
|
3096
|
+
ref: u,
|
|
3097
|
+
...fr,
|
|
3069
3098
|
width: t,
|
|
3070
3099
|
height: t,
|
|
3071
3100
|
stroke: e,
|
|
3072
3101
|
strokeWidth: n ? Number(r) * 24 / Number(t) : r,
|
|
3073
|
-
className:
|
|
3074
|
-
...!l && !
|
|
3102
|
+
className: at("lucide", s),
|
|
3103
|
+
...!l && !xr(c) && { "aria-hidden": "true" },
|
|
3075
3104
|
...c
|
|
3076
3105
|
},
|
|
3077
3106
|
[
|
|
3078
|
-
...o.map(([
|
|
3107
|
+
...o.map(([p, w]) => We(p, w)),
|
|
3079
3108
|
...Array.isArray(l) ? l : [l]
|
|
3080
3109
|
]
|
|
3081
3110
|
)
|
|
@@ -3086,20 +3115,20 @@ const gr = Te(
|
|
|
3086
3115
|
* This source code is licensed under the ISC license.
|
|
3087
3116
|
* See the LICENSE file in the root directory of this source tree.
|
|
3088
3117
|
*/
|
|
3089
|
-
const
|
|
3090
|
-
const r =
|
|
3091
|
-
({ className: n, ...s }, l) =>
|
|
3118
|
+
const nt = (e, t) => {
|
|
3119
|
+
const r = $e(
|
|
3120
|
+
({ className: n, ...s }, l) => We(br, {
|
|
3092
3121
|
ref: l,
|
|
3093
3122
|
iconNode: t,
|
|
3094
|
-
className:
|
|
3095
|
-
`lucide-${
|
|
3123
|
+
className: at(
|
|
3124
|
+
`lucide-${gr(Xe(e))}`,
|
|
3096
3125
|
`lucide-${e}`,
|
|
3097
3126
|
n
|
|
3098
3127
|
),
|
|
3099
3128
|
...s
|
|
3100
3129
|
})
|
|
3101
3130
|
);
|
|
3102
|
-
return r.displayName =
|
|
3131
|
+
return r.displayName = Xe(e), r;
|
|
3103
3132
|
};
|
|
3104
3133
|
/**
|
|
3105
3134
|
* @license lucide-react v0.574.0 - ISC
|
|
@@ -3107,15 +3136,15 @@ const et = (e, t) => {
|
|
|
3107
3136
|
* This source code is licensed under the ISC license.
|
|
3108
3137
|
* See the LICENSE file in the root directory of this source tree.
|
|
3109
3138
|
*/
|
|
3110
|
-
const
|
|
3139
|
+
const vr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], st = nt("chevron-left", vr);
|
|
3111
3140
|
/**
|
|
3112
3141
|
* @license lucide-react v0.574.0 - ISC
|
|
3113
3142
|
*
|
|
3114
3143
|
* This source code is licensed under the ISC license.
|
|
3115
3144
|
* See the LICENSE file in the root directory of this source tree.
|
|
3116
3145
|
*/
|
|
3117
|
-
const
|
|
3118
|
-
function
|
|
3146
|
+
const wr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], it = nt("chevron-right", wr);
|
|
3147
|
+
function kr(e, t) {
|
|
3119
3148
|
const r = !t || t.length === 0 || t.every((n) => !n || !n.trim());
|
|
3120
3149
|
if (e.isRequired && r)
|
|
3121
3150
|
return e.errorMessage || "This field is required";
|
|
@@ -3144,7 +3173,7 @@ function xr(e, t) {
|
|
|
3144
3173
|
}
|
|
3145
3174
|
return null;
|
|
3146
3175
|
}
|
|
3147
|
-
function
|
|
3176
|
+
function Nr(e) {
|
|
3148
3177
|
const t = e.flatMap(
|
|
3149
3178
|
(n, s) => (n.questions ?? []).map((l, o) => ({ question: l, groupIndex: s, qIdx: o }))
|
|
3150
3179
|
), r = /* @__PURE__ */ new Map();
|
|
@@ -3154,53 +3183,53 @@ function br(e) {
|
|
|
3154
3183
|
}
|
|
3155
3184
|
return Array.from(r.entries()).sort(([n], [s]) => n - s).map(([, n]) => n);
|
|
3156
3185
|
}
|
|
3157
|
-
const
|
|
3186
|
+
const Sr = ({
|
|
3158
3187
|
applicantId: e,
|
|
3159
3188
|
onComplete: t,
|
|
3160
3189
|
onBack: r
|
|
3161
3190
|
}) => {
|
|
3162
|
-
const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit:
|
|
3163
|
-
|
|
3164
|
-
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);
|
|
3165
3194
|
}, [s]);
|
|
3166
|
-
const k =
|
|
3167
|
-
() => n ?
|
|
3195
|
+
const k = ke(
|
|
3196
|
+
() => n ? Nr(n.questionGroups) : [],
|
|
3168
3197
|
[n]
|
|
3169
|
-
), b = h === k.length - 1,
|
|
3170
|
-
w((A) => ({ ...A, [
|
|
3198
|
+
), b = h === k.length - 1, m = k[h] ?? [], F = Y((T, f) => {
|
|
3199
|
+
w((A) => ({ ...A, [T]: f })), y((A) => {
|
|
3171
3200
|
const D = { ...A };
|
|
3172
|
-
return delete D[
|
|
3201
|
+
return delete D[T], D;
|
|
3173
3202
|
});
|
|
3174
|
-
}, []),
|
|
3175
|
-
const
|
|
3176
|
-
for (const { question: f } of
|
|
3177
|
-
const A =
|
|
3178
|
-
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);
|
|
3179
3208
|
}
|
|
3180
|
-
return y((f) => ({ ...f, ...
|
|
3181
|
-
}, [
|
|
3182
|
-
|
|
3183
|
-
},
|
|
3184
|
-
h > 0 ? g((
|
|
3185
|
-
},
|
|
3186
|
-
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))
|
|
3187
3216
|
try {
|
|
3188
|
-
const
|
|
3217
|
+
const T = n.questionGroups.flatMap(
|
|
3189
3218
|
(A) => (A.questions ?? []).map((D) => ({
|
|
3190
3219
|
questionId: D.id,
|
|
3191
|
-
values:
|
|
3220
|
+
values: p[D.id] ?? []
|
|
3192
3221
|
}))
|
|
3193
3222
|
), f = {
|
|
3194
3223
|
applicantId: e,
|
|
3195
3224
|
questionnarieId: n.id,
|
|
3196
|
-
questionResults:
|
|
3225
|
+
questionResults: T
|
|
3197
3226
|
};
|
|
3198
|
-
await
|
|
3199
|
-
} catch (
|
|
3200
|
-
console.error("Questionnaire submit error:",
|
|
3227
|
+
await u(f), t == null || t();
|
|
3228
|
+
} catch (T) {
|
|
3229
|
+
console.error("Questionnaire submit error:", T);
|
|
3201
3230
|
}
|
|
3202
3231
|
};
|
|
3203
|
-
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: [
|
|
3204
3233
|
"Error loading questionnaire: ",
|
|
3205
3234
|
c.message
|
|
3206
3235
|
] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
|
|
@@ -3214,7 +3243,7 @@ const vr = ({
|
|
|
3214
3243
|
" of ",
|
|
3215
3244
|
k.length
|
|
3216
3245
|
] }),
|
|
3217
|
-
/* @__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(
|
|
3218
3247
|
"div",
|
|
3219
3248
|
{
|
|
3220
3249
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3228,54 +3257,54 @@ const vr = ({
|
|
|
3228
3257
|
)) })
|
|
3229
3258
|
] })
|
|
3230
3259
|
] }),
|
|
3231
|
-
/* @__PURE__ */ a(B, { className: "space-y-6", children:
|
|
3232
|
-
|
|
3260
|
+
/* @__PURE__ */ a(B, { className: "space-y-6", children: m.map(({ question: T }) => /* @__PURE__ */ a(
|
|
3261
|
+
Cr,
|
|
3233
3262
|
{
|
|
3234
|
-
question:
|
|
3235
|
-
value:
|
|
3236
|
-
error: N[
|
|
3237
|
-
onChange: (f) => F(
|
|
3263
|
+
question: T,
|
|
3264
|
+
value: p[T.id] ?? [],
|
|
3265
|
+
error: N[T.id],
|
|
3266
|
+
onChange: (f) => F(T.id, f)
|
|
3238
3267
|
},
|
|
3239
|
-
|
|
3268
|
+
T.id
|
|
3240
3269
|
)) }),
|
|
3241
3270
|
/* @__PURE__ */ i(me, { className: "flex items-center justify-between", children: [
|
|
3242
3271
|
/* @__PURE__ */ i(
|
|
3243
|
-
|
|
3272
|
+
U,
|
|
3244
3273
|
{
|
|
3245
3274
|
type: "button",
|
|
3246
3275
|
variant: "outline",
|
|
3247
|
-
onClick:
|
|
3276
|
+
onClick: q,
|
|
3248
3277
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3249
3278
|
children: [
|
|
3250
|
-
/* @__PURE__ */ a(
|
|
3279
|
+
/* @__PURE__ */ a(st, { size: 14 }),
|
|
3251
3280
|
h > 0 ? "Previous" : "Back"
|
|
3252
3281
|
]
|
|
3253
3282
|
}
|
|
3254
3283
|
),
|
|
3255
3284
|
b ? /* @__PURE__ */ a(
|
|
3256
|
-
|
|
3285
|
+
U,
|
|
3257
3286
|
{
|
|
3258
3287
|
type: "button",
|
|
3259
3288
|
isLoading: o,
|
|
3260
|
-
onClick:
|
|
3289
|
+
onClick: H,
|
|
3261
3290
|
children: "Continue"
|
|
3262
3291
|
}
|
|
3263
3292
|
) : /* @__PURE__ */ i(
|
|
3264
|
-
|
|
3293
|
+
U,
|
|
3265
3294
|
{
|
|
3266
3295
|
type: "button",
|
|
3267
3296
|
onClick: v,
|
|
3268
3297
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3269
3298
|
children: [
|
|
3270
3299
|
"Next",
|
|
3271
|
-
/* @__PURE__ */ a(
|
|
3300
|
+
/* @__PURE__ */ a(it, { size: 14 })
|
|
3272
3301
|
]
|
|
3273
3302
|
}
|
|
3274
3303
|
)
|
|
3275
3304
|
] }),
|
|
3276
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 }) })
|
|
3277
3306
|
] }) : null;
|
|
3278
|
-
},
|
|
3307
|
+
}, Cr = ({ question: e, value: t, error: r, onChange: n }) => {
|
|
3279
3308
|
var o;
|
|
3280
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";
|
|
3281
3310
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
@@ -3354,8 +3383,8 @@ const vr = ({
|
|
|
3354
3383
|
{
|
|
3355
3384
|
type: "checkbox",
|
|
3356
3385
|
checked: t.includes(c),
|
|
3357
|
-
onChange: (
|
|
3358
|
-
|
|
3386
|
+
onChange: (u) => {
|
|
3387
|
+
u.target.checked ? n([...t, c]) : n(t.filter((p) => p !== c));
|
|
3359
3388
|
},
|
|
3360
3389
|
className: "metakyc-option-input",
|
|
3361
3390
|
style: {
|
|
@@ -3382,19 +3411,19 @@ const vr = ({
|
|
|
3382
3411
|
] }),
|
|
3383
3412
|
r && l === "text" && null
|
|
3384
3413
|
] });
|
|
3385
|
-
},
|
|
3414
|
+
}, Ar = ({
|
|
3386
3415
|
applicantId: e,
|
|
3387
3416
|
onComplete: t,
|
|
3388
3417
|
onBack: r
|
|
3389
3418
|
}) => {
|
|
3390
|
-
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) => {
|
|
3391
3420
|
if (N.preventDefault(), !n) return;
|
|
3392
3421
|
const y = await Promise.all(
|
|
3393
3422
|
n.uploadDocumentFiles.map(async (g) => {
|
|
3394
|
-
const k =
|
|
3395
|
-
k.map(async (
|
|
3396
|
-
fileName:
|
|
3397
|
-
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)
|
|
3398
3427
|
}))
|
|
3399
3428
|
);
|
|
3400
3429
|
return {
|
|
@@ -3409,7 +3438,7 @@ const vr = ({
|
|
|
3409
3438
|
};
|
|
3410
3439
|
await c(h), t == null || t();
|
|
3411
3440
|
};
|
|
3412
|
-
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: [
|
|
3413
3442
|
"Error loading document requirements: ",
|
|
3414
3443
|
o.message
|
|
3415
3444
|
] }) }) }) : n ? /* @__PURE__ */ a("form", { onSubmit: w, children: /* @__PURE__ */ i($, { children: [
|
|
@@ -3418,29 +3447,29 @@ const vr = ({
|
|
|
3418
3447
|
n.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.subtitle })
|
|
3419
3448
|
] }),
|
|
3420
3449
|
/* @__PURE__ */ a(B, { className: "space-y-6", children: n.uploadDocumentFiles.map((N) => /* @__PURE__ */ a(
|
|
3421
|
-
|
|
3450
|
+
pr,
|
|
3422
3451
|
{
|
|
3423
3452
|
label: N.displayName,
|
|
3424
3453
|
accept: N.allowedTypes,
|
|
3425
3454
|
multiple: N.multipleFile,
|
|
3426
3455
|
maxSize: N.maxEachFileSizeByte,
|
|
3427
|
-
value:
|
|
3456
|
+
value: u[N.id] || [],
|
|
3428
3457
|
onChange: (y) => {
|
|
3429
|
-
|
|
3458
|
+
p((h) => ({ ...h, [N.id]: y }));
|
|
3430
3459
|
}
|
|
3431
3460
|
},
|
|
3432
3461
|
N.id
|
|
3433
3462
|
)) }),
|
|
3434
3463
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
3435
|
-
r && /* @__PURE__ */ a(
|
|
3436
|
-
/* @__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" })
|
|
3437
3466
|
] })
|
|
3438
3467
|
] }) }) : null;
|
|
3439
|
-
},
|
|
3440
|
-
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 () => {
|
|
3441
3470
|
await c(), t == null || t();
|
|
3442
3471
|
};
|
|
3443
|
-
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: [
|
|
3444
3473
|
"Error loading overview: ",
|
|
3445
3474
|
o.message
|
|
3446
3475
|
] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
|
|
@@ -3448,8 +3477,8 @@ const vr = ({
|
|
|
3448
3477
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.title || "Overview" }),
|
|
3449
3478
|
n.description && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.description })
|
|
3450
3479
|
] }),
|
|
3451
|
-
/* @__PURE__ */ a(B, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((
|
|
3452
|
-
/* @__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 }) }),
|
|
3453
3482
|
/* @__PURE__ */ i(
|
|
3454
3483
|
"div",
|
|
3455
3484
|
{
|
|
@@ -3461,19 +3490,19 @@ const vr = ({
|
|
|
3461
3490
|
background: "transparent"
|
|
3462
3491
|
},
|
|
3463
3492
|
children: [
|
|
3464
|
-
/* @__PURE__ */ a("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children:
|
|
3465
|
-
|
|
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 })
|
|
3466
3495
|
]
|
|
3467
3496
|
}
|
|
3468
3497
|
)
|
|
3469
|
-
] },
|
|
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..." }) }) }),
|
|
3470
3499
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
3471
|
-
r && /* @__PURE__ */ a(
|
|
3472
|
-
/* @__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" })
|
|
3473
3502
|
] })
|
|
3474
3503
|
] }) : null;
|
|
3475
3504
|
};
|
|
3476
|
-
function
|
|
3505
|
+
function Er(e, t) {
|
|
3477
3506
|
const r = !t || t.length === 0 || t.every((n) => !n || !n.trim());
|
|
3478
3507
|
if (e.isRequired && r)
|
|
3479
3508
|
return e.errorMessage || `${e.displayName} is required`;
|
|
@@ -3503,65 +3532,65 @@ function Sr(e, t) {
|
|
|
3503
3532
|
}
|
|
3504
3533
|
return null;
|
|
3505
3534
|
}
|
|
3506
|
-
function
|
|
3535
|
+
function Rr(e) {
|
|
3507
3536
|
const t = /* @__PURE__ */ new Map();
|
|
3508
3537
|
return e.forEach((r, n) => {
|
|
3509
3538
|
const s = r.pageNumber != null && r.pageNumber > 0 ? r.pageNumber : 1;
|
|
3510
3539
|
t.has(s) || t.set(s, []), t.get(s).push({ criterion: r, idx: n });
|
|
3511
3540
|
}), Array.from(t.entries()).sort(([r], [n]) => r - n).map(([, r]) => r);
|
|
3512
3541
|
}
|
|
3513
|
-
function
|
|
3542
|
+
function Fr(e) {
|
|
3514
3543
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
3515
3544
|
}
|
|
3516
|
-
const
|
|
3545
|
+
const Dr = ({
|
|
3517
3546
|
applicantId: e,
|
|
3518
3547
|
onComplete: t,
|
|
3519
3548
|
onBack: r
|
|
3520
3549
|
}) => {
|
|
3521
|
-
const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit:
|
|
3522
|
-
|
|
3523
|
-
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);
|
|
3524
3553
|
}, [s]);
|
|
3525
|
-
const
|
|
3526
|
-
() => n && n.length > 0 ?
|
|
3554
|
+
const m = ke(
|
|
3555
|
+
() => n && n.length > 0 ? Rr(n) : [],
|
|
3527
3556
|
[n]
|
|
3528
|
-
), F = h ===
|
|
3529
|
-
|
|
3530
|
-
!l && n && n.length === 0 && !k && !o && (b(!0),
|
|
3531
|
-
}, [l, n, k, o,
|
|
3532
|
-
const v =
|
|
3533
|
-
w((
|
|
3534
|
-
const
|
|
3535
|
-
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;
|
|
3536
3565
|
});
|
|
3537
|
-
}, []),
|
|
3566
|
+
}, []), q = Y(() => {
|
|
3538
3567
|
const A = {};
|
|
3539
|
-
for (const { criterion: D } of
|
|
3540
|
-
const
|
|
3541
|
-
|
|
3568
|
+
for (const { criterion: D } of S) {
|
|
3569
|
+
const Q = Er(D, p[D.id] ?? []);
|
|
3570
|
+
Q && (A[D.id] = Q);
|
|
3542
3571
|
}
|
|
3543
3572
|
return y((D) => ({ ...D, ...A })), Object.keys(A).length === 0;
|
|
3544
|
-
}, [
|
|
3545
|
-
|
|
3546
|
-
},
|
|
3573
|
+
}, [S, p]), H = () => {
|
|
3574
|
+
q() && g((A) => A + 1);
|
|
3575
|
+
}, T = () => {
|
|
3547
3576
|
h > 0 ? g((A) => A - 1) : r == null || r();
|
|
3548
3577
|
}, f = async () => {
|
|
3549
|
-
if (!(!
|
|
3578
|
+
if (!(!q() || !n))
|
|
3550
3579
|
try {
|
|
3551
|
-
const A = n.map((
|
|
3552
|
-
const
|
|
3553
|
-
return
|
|
3554
|
-
}).filter((
|
|
3555
|
-
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();
|
|
3556
3585
|
} catch (A) {
|
|
3557
3586
|
console.error("Risk scoring submit error:", A);
|
|
3558
3587
|
}
|
|
3559
3588
|
};
|
|
3560
3589
|
return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
3561
|
-
/* @__PURE__ */ a(
|
|
3590
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
3562
3591
|
/* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
3563
3592
|
] }) }) : !l && n && n.length === 0 ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
3564
|
-
/* @__PURE__ */ a(
|
|
3593
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
3565
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…" })
|
|
3566
3595
|
] }) }) : c ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3567
3596
|
"Error loading criteria: ",
|
|
@@ -3570,14 +3599,14 @@ const Ir = ({
|
|
|
3570
3599
|
/* @__PURE__ */ i(oe, { children: [
|
|
3571
3600
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3572
3601
|
/* @__PURE__ */ a("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
3573
|
-
|
|
3602
|
+
m.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3574
3603
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3575
3604
|
"Page ",
|
|
3576
3605
|
h + 1,
|
|
3577
3606
|
" of ",
|
|
3578
|
-
|
|
3607
|
+
m.length
|
|
3579
3608
|
] }),
|
|
3580
|
-
/* @__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(
|
|
3581
3610
|
"div",
|
|
3582
3611
|
{
|
|
3583
3612
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3591,11 +3620,11 @@ const Ir = ({
|
|
|
3591
3620
|
)) })
|
|
3592
3621
|
] })
|
|
3593
3622
|
] }),
|
|
3594
|
-
/* @__PURE__ */ a(B, { className: "space-y-6", children:
|
|
3595
|
-
|
|
3623
|
+
/* @__PURE__ */ a(B, { className: "space-y-6", children: S.map(({ criterion: A }) => /* @__PURE__ */ a(
|
|
3624
|
+
Pr,
|
|
3596
3625
|
{
|
|
3597
3626
|
criterion: A,
|
|
3598
|
-
value:
|
|
3627
|
+
value: p[A.id] ?? [],
|
|
3599
3628
|
error: N[A.id],
|
|
3600
3629
|
onChange: (D) => v(A.id, D)
|
|
3601
3630
|
},
|
|
@@ -3603,35 +3632,35 @@ const Ir = ({
|
|
|
3603
3632
|
)) }),
|
|
3604
3633
|
/* @__PURE__ */ i(me, { className: "flex items-center justify-between", children: [
|
|
3605
3634
|
/* @__PURE__ */ i(
|
|
3606
|
-
|
|
3635
|
+
U,
|
|
3607
3636
|
{
|
|
3608
3637
|
type: "button",
|
|
3609
3638
|
variant: "outline",
|
|
3610
|
-
onClick:
|
|
3639
|
+
onClick: T,
|
|
3611
3640
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3612
3641
|
children: [
|
|
3613
|
-
/* @__PURE__ */ a(
|
|
3642
|
+
/* @__PURE__ */ a(st, { size: 14 }),
|
|
3614
3643
|
h > 0 ? "Previous" : "Back"
|
|
3615
3644
|
]
|
|
3616
3645
|
}
|
|
3617
3646
|
),
|
|
3618
|
-
F ? /* @__PURE__ */ a(
|
|
3619
|
-
|
|
3647
|
+
F ? /* @__PURE__ */ a(U, { type: "button", isLoading: o, onClick: f, children: "Continue" }) : /* @__PURE__ */ i(
|
|
3648
|
+
U,
|
|
3620
3649
|
{
|
|
3621
3650
|
type: "button",
|
|
3622
|
-
onClick:
|
|
3651
|
+
onClick: H,
|
|
3623
3652
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3624
3653
|
children: [
|
|
3625
3654
|
"Next",
|
|
3626
|
-
/* @__PURE__ */ a(
|
|
3655
|
+
/* @__PURE__ */ a(it, { size: 14 })
|
|
3627
3656
|
]
|
|
3628
3657
|
}
|
|
3629
3658
|
)
|
|
3630
3659
|
] }),
|
|
3631
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 }) })
|
|
3632
3661
|
] }) : null;
|
|
3633
|
-
},
|
|
3634
|
-
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;
|
|
3635
3664
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
3636
3665
|
/* @__PURE__ */ i("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
3637
3666
|
e.displayName,
|
|
@@ -3704,7 +3733,7 @@ const Ir = ({
|
|
|
3704
3733
|
type: "checkbox",
|
|
3705
3734
|
checked: t.includes(o),
|
|
3706
3735
|
onChange: (c) => {
|
|
3707
|
-
c.target.checked ? n([...t, o]) : n(t.filter((
|
|
3736
|
+
c.target.checked ? n([...t, o]) : n(t.filter((u) => u !== o));
|
|
3708
3737
|
},
|
|
3709
3738
|
className: "metakyc-option-input",
|
|
3710
3739
|
style: {
|
|
@@ -3747,18 +3776,18 @@ const Ir = ({
|
|
|
3747
3776
|
}
|
|
3748
3777
|
)
|
|
3749
3778
|
] });
|
|
3750
|
-
},
|
|
3779
|
+
}, Lr = ({
|
|
3751
3780
|
applicantId: e,
|
|
3752
3781
|
onComplete: t,
|
|
3753
3782
|
onBack: r
|
|
3754
3783
|
}) => {
|
|
3755
|
-
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);
|
|
3756
3785
|
return /* @__PURE__ */ a("form", { onSubmit: async (N) => {
|
|
3757
3786
|
if (N.preventDefault(), s === null) {
|
|
3758
|
-
|
|
3787
|
+
p("Please select an investor type");
|
|
3759
3788
|
return;
|
|
3760
3789
|
}
|
|
3761
|
-
c(!0),
|
|
3790
|
+
c(!0), p(null);
|
|
3762
3791
|
try {
|
|
3763
3792
|
const y = {
|
|
3764
3793
|
applicantId: e,
|
|
@@ -3768,7 +3797,7 @@ const Ir = ({
|
|
|
3768
3797
|
const h = await n.setInvestorCategorization(y);
|
|
3769
3798
|
console.log("Investor categorization result:", h), t == null || t();
|
|
3770
3799
|
} catch (y) {
|
|
3771
|
-
console.error("Error submitting investor categorization:", y),
|
|
3800
|
+
console.error("Error submitting investor categorization:", y), p(y.message || "Failed to submit investor categorization");
|
|
3772
3801
|
} finally {
|
|
3773
3802
|
c(!1);
|
|
3774
3803
|
}
|
|
@@ -3866,16 +3895,16 @@ const Ir = ({
|
|
|
3866
3895
|
] })
|
|
3867
3896
|
}
|
|
3868
3897
|
),
|
|
3869
|
-
|
|
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: [
|
|
3870
3899
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
3871
3900
|
" ",
|
|
3872
|
-
|
|
3901
|
+
u
|
|
3873
3902
|
] }) })
|
|
3874
3903
|
] }),
|
|
3875
3904
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
3876
|
-
r && /* @__PURE__ */ a(
|
|
3905
|
+
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3877
3906
|
/* @__PURE__ */ a(
|
|
3878
|
-
|
|
3907
|
+
U,
|
|
3879
3908
|
{
|
|
3880
3909
|
type: "submit",
|
|
3881
3910
|
isLoading: o,
|
|
@@ -3885,116 +3914,116 @@ const Ir = ({
|
|
|
3885
3914
|
)
|
|
3886
3915
|
] })
|
|
3887
3916
|
] }) });
|
|
3888
|
-
},
|
|
3917
|
+
}, Mr = ({
|
|
3889
3918
|
applicantId: e,
|
|
3890
3919
|
onComplete: t,
|
|
3891
3920
|
onBack: r
|
|
3892
3921
|
}) => {
|
|
3893
|
-
const { appropriatenessTestService: n } = he(), [s, l] = x(null), [o, c] = x(!0), [
|
|
3894
|
-
|
|
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(() => {
|
|
3895
3924
|
(async () => {
|
|
3896
3925
|
try {
|
|
3897
3926
|
c(!0), N(null), console.log("Loading appropriateness test for applicant:", e);
|
|
3898
|
-
const
|
|
3899
|
-
if (console.log("Appropriateness test data:",
|
|
3900
|
-
const
|
|
3901
|
-
|
|
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);
|
|
3902
3931
|
}
|
|
3903
|
-
} catch (
|
|
3904
|
-
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");
|
|
3905
3934
|
} finally {
|
|
3906
3935
|
c(!1);
|
|
3907
3936
|
}
|
|
3908
3937
|
})();
|
|
3909
3938
|
}, [e, n]);
|
|
3910
|
-
const
|
|
3911
|
-
const
|
|
3912
|
-
if (
|
|
3913
|
-
const [
|
|
3914
|
-
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;
|
|
3915
3944
|
}
|
|
3916
3945
|
return 0;
|
|
3917
|
-
},
|
|
3918
|
-
const
|
|
3919
|
-
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")}`;
|
|
3920
3949
|
};
|
|
3921
|
-
|
|
3950
|
+
X(() => {
|
|
3922
3951
|
if (!b || g <= 0) return;
|
|
3923
3952
|
const P = setInterval(() => {
|
|
3924
|
-
k((
|
|
3953
|
+
k((R) => R <= 1 ? (S(!0), 0) : R - 1);
|
|
3925
3954
|
}, 1e3);
|
|
3926
3955
|
return () => clearInterval(P);
|
|
3927
|
-
}, [b, g]),
|
|
3956
|
+
}, [b, g]), X(() => {
|
|
3928
3957
|
if (v <= 0) return;
|
|
3929
3958
|
const P = setInterval(() => {
|
|
3930
|
-
|
|
3959
|
+
q((R) => R <= 1 ? 0 : R - 1);
|
|
3931
3960
|
}, 1e3);
|
|
3932
3961
|
return () => clearInterval(P);
|
|
3933
|
-
}, [v]),
|
|
3934
|
-
F && !
|
|
3962
|
+
}, [v]), X(() => {
|
|
3963
|
+
F && !u && D();
|
|
3935
3964
|
}, [F]);
|
|
3936
3965
|
const f = () => {
|
|
3937
|
-
s && (
|
|
3938
|
-
}, A = (P,
|
|
3939
|
-
h((
|
|
3940
|
-
...
|
|
3941
|
-
[P]:
|
|
3966
|
+
s && (m(!0), k(s.testDurationSec));
|
|
3967
|
+
}, A = (P, R) => {
|
|
3968
|
+
h((G) => ({
|
|
3969
|
+
...G,
|
|
3970
|
+
[P]: R
|
|
3942
3971
|
}));
|
|
3943
3972
|
}, D = async (P) => {
|
|
3944
3973
|
if (P && P.preventDefault(), !!s) {
|
|
3945
3974
|
if (!F) {
|
|
3946
|
-
const
|
|
3947
|
-
if (
|
|
3948
|
-
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.`);
|
|
3949
3978
|
return;
|
|
3950
3979
|
}
|
|
3951
3980
|
}
|
|
3952
|
-
|
|
3981
|
+
p(!0), N(null);
|
|
3953
3982
|
try {
|
|
3954
|
-
const
|
|
3955
|
-
(
|
|
3956
|
-
appropriatenessQuestionId:
|
|
3957
|
-
value: y[
|
|
3983
|
+
const R = s.appropriatenessQuestions.map(
|
|
3984
|
+
(K) => ({
|
|
3985
|
+
appropriatenessQuestionId: K.id,
|
|
3986
|
+
value: y[K.id] || ""
|
|
3958
3987
|
// Empty string if not answered
|
|
3959
3988
|
})
|
|
3960
|
-
),
|
|
3989
|
+
), G = {
|
|
3961
3990
|
applicantId: e,
|
|
3962
3991
|
appropriatenessTestId: s.id,
|
|
3963
|
-
appropriatenessQuestionResults:
|
|
3992
|
+
appropriatenessQuestionResults: R
|
|
3964
3993
|
};
|
|
3965
|
-
console.log("Submitting appropriateness test:",
|
|
3994
|
+
console.log("Submitting appropriateness test:", G);
|
|
3966
3995
|
try {
|
|
3967
|
-
const
|
|
3968
|
-
console.log("Appropriateness test result:",
|
|
3969
|
-
} catch (
|
|
3970
|
-
if (
|
|
3971
|
-
const le =
|
|
3972
|
-
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);
|
|
3973
4002
|
} else
|
|
3974
|
-
throw
|
|
4003
|
+
throw K;
|
|
3975
4004
|
}
|
|
3976
|
-
} catch (
|
|
3977
|
-
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({});
|
|
3978
4007
|
} finally {
|
|
3979
|
-
|
|
4008
|
+
p(!1);
|
|
3980
4009
|
}
|
|
3981
4010
|
}
|
|
3982
|
-
},
|
|
4011
|
+
}, Q = async () => {
|
|
3983
4012
|
try {
|
|
3984
4013
|
const P = await n.getAppropriatenessTest(e);
|
|
3985
4014
|
if (console.log("Reloaded test data:", P), l(P), P.waitTimeSpanForNextTry && P.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3986
|
-
const
|
|
3987
|
-
|
|
4015
|
+
const R = H(P.waitTimeSpanForNextTry);
|
|
4016
|
+
R > 0 && q(R);
|
|
3988
4017
|
}
|
|
3989
4018
|
} catch (P) {
|
|
3990
|
-
console.error("Error reloading test data:", P), N((
|
|
4019
|
+
console.error("Error reloading test data:", P), N((R) => R + `
|
|
3991
4020
|
|
|
3992
4021
|
Failed to reload test data. Please refresh the page.`);
|
|
3993
4022
|
}
|
|
3994
4023
|
};
|
|
3995
4024
|
if (o)
|
|
3996
4025
|
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
3997
|
-
/* @__PURE__ */ a(
|
|
4026
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
3998
4027
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
3999
4028
|
] }) });
|
|
4000
4029
|
if (!s)
|
|
@@ -4010,13 +4039,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4010
4039
|
] }),
|
|
4011
4040
|
/* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
|
|
4012
4041
|
/* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
4013
|
-
/* @__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) }),
|
|
4014
4043
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
4015
4044
|
] }),
|
|
4016
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 }) })
|
|
4017
4046
|
] })
|
|
4018
4047
|
] });
|
|
4019
|
-
const
|
|
4048
|
+
const W = s.testAllowedMaxTry - s.totalFailedTries;
|
|
4020
4049
|
return b ? /* @__PURE__ */ a("form", { onSubmit: D, children: /* @__PURE__ */ i($, { children: [
|
|
4021
4050
|
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4022
4051
|
/* @__PURE__ */ i("div", { children: [
|
|
@@ -4028,7 +4057,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4028
4057
|
"div",
|
|
4029
4058
|
{
|
|
4030
4059
|
className: `text-3xl font-bold ${g <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
4031
|
-
children:
|
|
4060
|
+
children: T(g)
|
|
4032
4061
|
}
|
|
4033
4062
|
),
|
|
4034
4063
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
@@ -4036,20 +4065,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4036
4065
|
] }) }),
|
|
4037
4066
|
/* @__PURE__ */ i(B, { className: "space-y-6", children: [
|
|
4038
4067
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4039
|
-
/* @__PURE__ */ i(
|
|
4068
|
+
/* @__PURE__ */ i(Se, { variant: "info", children: [
|
|
4040
4069
|
"Question ",
|
|
4041
4070
|
Object.keys(y).length,
|
|
4042
4071
|
" of ",
|
|
4043
4072
|
s.totalQuestionCount
|
|
4044
4073
|
] }),
|
|
4045
|
-
/* @__PURE__ */ i(
|
|
4046
|
-
|
|
4074
|
+
/* @__PURE__ */ i(Se, { variant: W > 1 ? "success" : "warning", children: [
|
|
4075
|
+
W,
|
|
4047
4076
|
" attempt",
|
|
4048
|
-
|
|
4077
|
+
W !== 1 ? "s" : "",
|
|
4049
4078
|
" remaining"
|
|
4050
4079
|
] })
|
|
4051
4080
|
] }),
|
|
4052
|
-
s.appropriatenessQuestions.map((P,
|
|
4081
|
+
s.appropriatenessQuestions.map((P, R) => /* @__PURE__ */ i(
|
|
4053
4082
|
"div",
|
|
4054
4083
|
{
|
|
4055
4084
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -4057,17 +4086,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4057
4086
|
/* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
4058
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: [
|
|
4059
4088
|
"Question ",
|
|
4060
|
-
|
|
4089
|
+
R + 1
|
|
4061
4090
|
] }),
|
|
4062
4091
|
P.groupName && /* @__PURE__ */ a("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: P.groupName }),
|
|
4063
4092
|
/* @__PURE__ */ a("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: P.question })
|
|
4064
4093
|
] }),
|
|
4065
|
-
/* @__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(
|
|
4066
4095
|
"label",
|
|
4067
4096
|
{
|
|
4068
4097
|
className: `
|
|
4069
4098
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
4070
|
-
${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"}
|
|
4071
4100
|
`,
|
|
4072
4101
|
children: [
|
|
4073
4102
|
/* @__PURE__ */ a(
|
|
@@ -4075,17 +4104,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4075
4104
|
{
|
|
4076
4105
|
type: "radio",
|
|
4077
4106
|
name: `question-${P.id}`,
|
|
4078
|
-
value:
|
|
4079
|
-
checked: y[P.id] ===
|
|
4107
|
+
value: G,
|
|
4108
|
+
checked: y[P.id] === G,
|
|
4080
4109
|
onChange: (le) => A(P.id, le.target.value),
|
|
4081
4110
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4082
|
-
disabled:
|
|
4111
|
+
disabled: u
|
|
4083
4112
|
}
|
|
4084
4113
|
),
|
|
4085
|
-
/* @__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 })
|
|
4086
4115
|
]
|
|
4087
4116
|
},
|
|
4088
|
-
|
|
4117
|
+
K
|
|
4089
4118
|
)) })
|
|
4090
4119
|
]
|
|
4091
4120
|
},
|
|
@@ -4103,20 +4132,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4103
4132
|
] }),
|
|
4104
4133
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
4105
4134
|
/* @__PURE__ */ a(
|
|
4106
|
-
|
|
4135
|
+
U,
|
|
4107
4136
|
{
|
|
4108
4137
|
type: "button",
|
|
4109
4138
|
variant: "outline",
|
|
4110
4139
|
onClick: r,
|
|
4111
|
-
disabled:
|
|
4140
|
+
disabled: u,
|
|
4112
4141
|
children: "Cancel"
|
|
4113
4142
|
}
|
|
4114
4143
|
),
|
|
4115
4144
|
/* @__PURE__ */ a(
|
|
4116
|
-
|
|
4145
|
+
U,
|
|
4117
4146
|
{
|
|
4118
4147
|
type: "submit",
|
|
4119
|
-
isLoading:
|
|
4148
|
+
isLoading: u,
|
|
4120
4149
|
disabled: Object.keys(y).length < s.totalQuestionCount,
|
|
4121
4150
|
children: F ? "Submitting..." : "Submit Test"
|
|
4122
4151
|
}
|
|
@@ -4132,19 +4161,19 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4132
4161
|
/* @__PURE__ */ i("div", { className: "space-y-4 mb-6", children: [
|
|
4133
4162
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4134
4163
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
|
|
4135
|
-
/* @__PURE__ */ a(
|
|
4164
|
+
/* @__PURE__ */ a(Se, { variant: "info", children: s.totalQuestionCount })
|
|
4136
4165
|
] }),
|
|
4137
4166
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4138
4167
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4139
|
-
/* @__PURE__ */ a(
|
|
4168
|
+
/* @__PURE__ */ a(Se, { variant: "info", children: T(s.testDurationSec) })
|
|
4140
4169
|
] }),
|
|
4141
4170
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4142
4171
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
4143
|
-
/* @__PURE__ */ a(
|
|
4172
|
+
/* @__PURE__ */ a(Se, { variant: "info", children: s.testCorrectAnswerPassLimit })
|
|
4144
4173
|
] }),
|
|
4145
4174
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4146
4175
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4147
|
-
/* @__PURE__ */ a(
|
|
4176
|
+
/* @__PURE__ */ a(Se, { variant: W > 1 ? "success" : "warning", children: W })
|
|
4148
4177
|
] })
|
|
4149
4178
|
] }),
|
|
4150
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: [
|
|
@@ -4152,28 +4181,28 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4152
4181
|
" ",
|
|
4153
4182
|
w
|
|
4154
4183
|
] }) }),
|
|
4155
|
-
|
|
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." }) })
|
|
4156
4185
|
] }),
|
|
4157
4186
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
4158
|
-
r && /* @__PURE__ */ a(
|
|
4187
|
+
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4159
4188
|
/* @__PURE__ */ a(
|
|
4160
|
-
|
|
4189
|
+
U,
|
|
4161
4190
|
{
|
|
4162
4191
|
type: "button",
|
|
4163
4192
|
onClick: f,
|
|
4164
|
-
disabled:
|
|
4193
|
+
disabled: W <= 0,
|
|
4165
4194
|
children: "Start Test"
|
|
4166
4195
|
}
|
|
4167
4196
|
)
|
|
4168
4197
|
] })
|
|
4169
4198
|
] });
|
|
4170
|
-
},
|
|
4199
|
+
}, Tr = ({
|
|
4171
4200
|
applicantId: e,
|
|
4172
4201
|
onComplete: t,
|
|
4173
4202
|
onBack: r
|
|
4174
4203
|
}) => {
|
|
4175
|
-
var
|
|
4176
|
-
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({
|
|
4177
4206
|
defaultValues: {
|
|
4178
4207
|
street: "",
|
|
4179
4208
|
streetNumber: "",
|
|
@@ -4184,32 +4213,32 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4184
4213
|
phonenumber: ""
|
|
4185
4214
|
}
|
|
4186
4215
|
});
|
|
4187
|
-
|
|
4216
|
+
X(() => {
|
|
4188
4217
|
(async () => {
|
|
4189
4218
|
try {
|
|
4190
|
-
const [L,
|
|
4219
|
+
const [L, ee] = await Promise.all([
|
|
4191
4220
|
n.getApplicantData(e),
|
|
4192
4221
|
s.getCountries("", "en")
|
|
4193
4222
|
]);
|
|
4194
4223
|
b(L);
|
|
4195
|
-
const
|
|
4196
|
-
const
|
|
4197
|
-
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);
|
|
4198
4227
|
});
|
|
4199
|
-
F(
|
|
4200
|
-
const
|
|
4201
|
-
if (
|
|
4202
|
-
street: (
|
|
4203
|
-
streetNumber: (
|
|
4204
|
-
city: (
|
|
4205
|
-
zip: (
|
|
4206
|
-
country: (
|
|
4207
|
-
nationality: (
|
|
4208
|
-
phonenumber: (
|
|
4209
|
-
}), L.kycRecords && L.kycRecords.length > 0 && L.kycRecords[0].providerTokenObject !== null && !
|
|
4210
|
-
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;
|
|
4211
4240
|
try {
|
|
4212
|
-
await N(),
|
|
4241
|
+
await N(), H(!0);
|
|
4213
4242
|
} catch (ve) {
|
|
4214
4243
|
console.error("[Identity] Auto-request failed:", ve);
|
|
4215
4244
|
}
|
|
@@ -4220,20 +4249,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4220
4249
|
v(!1);
|
|
4221
4250
|
}
|
|
4222
4251
|
})();
|
|
4223
|
-
}, [e]),
|
|
4224
|
-
o && !
|
|
4225
|
-
}, [o,
|
|
4226
|
-
if (
|
|
4227
|
-
if (
|
|
4228
|
-
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();
|
|
4229
4258
|
if (Date.now() >= O) {
|
|
4230
4259
|
console.warn("[Identity] Token has expired (expiresAt)"), D(!0), f("Your verification session has expired. Please restart.");
|
|
4231
4260
|
return;
|
|
4232
4261
|
}
|
|
4233
4262
|
}
|
|
4234
|
-
if (
|
|
4263
|
+
if (u.url)
|
|
4235
4264
|
try {
|
|
4236
|
-
const L = new URL(
|
|
4265
|
+
const L = new URL(u.url).toString().toLowerCase();
|
|
4237
4266
|
if (L.includes("expired") || L.includes("invalid") || L.includes("error")) {
|
|
4238
4267
|
console.warn("[Identity] Token URL indicates expiration"), D(!0), f("Your verification link has expired. Please restart.");
|
|
4239
4268
|
return;
|
|
@@ -4241,49 +4270,49 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4241
4270
|
} catch {
|
|
4242
4271
|
console.error("[Identity] Invalid token URL");
|
|
4243
4272
|
}
|
|
4244
|
-
if (
|
|
4273
|
+
if (u.status === "expired" || u.error === "expired" || u.expired === !0) {
|
|
4245
4274
|
console.warn("[Identity] Token object indicates expiration"), D(!0), f("Your verification session has expired. Please restart.");
|
|
4246
4275
|
return;
|
|
4247
4276
|
}
|
|
4248
4277
|
}
|
|
4249
|
-
}, [
|
|
4250
|
-
if (c !== null &&
|
|
4278
|
+
}, [u]), X(() => {
|
|
4279
|
+
if (c !== null && u && !h && q && !A) {
|
|
4251
4280
|
const O = c;
|
|
4252
|
-
if (
|
|
4253
|
-
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);
|
|
4254
4283
|
try {
|
|
4255
|
-
if (new URL(
|
|
4284
|
+
if (new URL(u.url), O === ye.SardinAI) {
|
|
4256
4285
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4257
4286
|
try {
|
|
4258
|
-
const L = De.parseProviderConfig(c,
|
|
4287
|
+
const L = De.parseProviderConfig(c, u, l);
|
|
4259
4288
|
De.createProvider(c, L).initialize().then(() => {
|
|
4260
4289
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4261
|
-
}).catch((
|
|
4262
|
-
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):",
|
|
4290
|
+
}).catch((Z) => {
|
|
4291
|
+
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", Z);
|
|
4263
4292
|
});
|
|
4264
4293
|
} catch (L) {
|
|
4265
4294
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", L);
|
|
4266
4295
|
}
|
|
4267
4296
|
}
|
|
4268
|
-
g({ type: "url", url:
|
|
4297
|
+
g({ type: "url", url: u.url });
|
|
4269
4298
|
} catch (L) {
|
|
4270
4299
|
console.error("[Identity] Invalid URL:", L), f("Invalid verification URL. Please restart."), D(!0);
|
|
4271
4300
|
}
|
|
4272
4301
|
return;
|
|
4273
4302
|
}
|
|
4274
|
-
if (O ===
|
|
4303
|
+
if (O === ye.SardinAI) {
|
|
4275
4304
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), f(null);
|
|
4276
4305
|
try {
|
|
4277
|
-
const L = De.parseProviderConfig(c,
|
|
4278
|
-
|
|
4279
|
-
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(() => {
|
|
4280
4309
|
t == null || t();
|
|
4281
4310
|
}, 2e3);
|
|
4282
|
-
}).catch((
|
|
4283
|
-
var
|
|
4284
|
-
console.error("[SardinAI] Failed to initialize:",
|
|
4285
|
-
const
|
|
4286
|
-
|
|
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}`);
|
|
4287
4316
|
});
|
|
4288
4317
|
} catch (L) {
|
|
4289
4318
|
console.error("[SardinAI] Error creating provider:", L), f(`Configuration error: ${L.message}`);
|
|
@@ -4292,15 +4321,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4292
4321
|
}
|
|
4293
4322
|
try {
|
|
4294
4323
|
f(null);
|
|
4295
|
-
const L = De.parseProviderConfig(c,
|
|
4296
|
-
O ===
|
|
4297
|
-
var
|
|
4298
|
-
console.error("[Sumsub] Initialization error:",
|
|
4299
|
-
}),
|
|
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(() => {
|
|
4300
4329
|
t == null || t();
|
|
4301
|
-
})) : O ===
|
|
4302
|
-
console.error("[Onfido] Initialization error:",
|
|
4303
|
-
}), 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);
|
|
4304
4333
|
} catch (L) {
|
|
4305
4334
|
console.error("[Identity] Provider setup error:", L), f(`Setup error: ${L.message}`);
|
|
4306
4335
|
}
|
|
@@ -4313,23 +4342,23 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4313
4342
|
console.error("[Identity] Error destroying provider:", O);
|
|
4314
4343
|
}
|
|
4315
4344
|
};
|
|
4316
|
-
}, [c,
|
|
4345
|
+
}, [c, u, h, q, t, A]);
|
|
4317
4346
|
const P = async () => {
|
|
4318
4347
|
try {
|
|
4319
|
-
f(null), D(!1), await N(),
|
|
4348
|
+
f(null), D(!1), await N(), H(!0);
|
|
4320
4349
|
} catch (O) {
|
|
4321
4350
|
console.error("Error starting identity verification:", O);
|
|
4322
4351
|
}
|
|
4323
|
-
},
|
|
4352
|
+
}, R = async () => {
|
|
4324
4353
|
try {
|
|
4325
|
-
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);
|
|
4326
4355
|
} catch (O) {
|
|
4327
4356
|
console.error("Error restarting identity verification:", O), f(O.message || "Failed to restart verification");
|
|
4328
4357
|
}
|
|
4329
4358
|
};
|
|
4330
|
-
if (
|
|
4359
|
+
if (S || p)
|
|
4331
4360
|
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
4332
|
-
/* @__PURE__ */ a(
|
|
4361
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
4333
4362
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4334
4363
|
] }) });
|
|
4335
4364
|
if (w)
|
|
@@ -4337,7 +4366,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4337
4366
|
"Error: ",
|
|
4338
4367
|
w.message
|
|
4339
4368
|
] }) }) });
|
|
4340
|
-
if (
|
|
4369
|
+
if (q && (T || A))
|
|
4341
4370
|
return /* @__PURE__ */ i($, { children: [
|
|
4342
4371
|
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4343
4372
|
/* @__PURE__ */ i(B, { children: [
|
|
@@ -4362,7 +4391,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4362
4391
|
),
|
|
4363
4392
|
/* @__PURE__ */ i("div", { children: [
|
|
4364
4393
|
/* @__PURE__ */ a("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: A ? "Session Expired" : "Verification Error" }),
|
|
4365
|
-
/* @__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." })
|
|
4366
4395
|
] })
|
|
4367
4396
|
] }) }),
|
|
4368
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: [
|
|
@@ -4375,26 +4404,26 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4375
4404
|
] })
|
|
4376
4405
|
] }),
|
|
4377
4406
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
4378
|
-
r && /* @__PURE__ */ a(
|
|
4379
|
-
/* @__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" })
|
|
4380
4409
|
] })
|
|
4381
4410
|
] });
|
|
4382
|
-
if (
|
|
4411
|
+
if (q && o) {
|
|
4383
4412
|
const O = c;
|
|
4384
|
-
return
|
|
4413
|
+
return u != null && u.url ? /* @__PURE__ */ i($, { children: [
|
|
4385
4414
|
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4386
4415
|
/* @__PURE__ */ i("div", { children: [
|
|
4387
4416
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4388
4417
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4389
4418
|
] }),
|
|
4390
4419
|
/* @__PURE__ */ a(
|
|
4391
|
-
|
|
4420
|
+
U,
|
|
4392
4421
|
{
|
|
4393
4422
|
type: "button",
|
|
4394
4423
|
variant: "outline",
|
|
4395
4424
|
size: "sm",
|
|
4396
|
-
onClick:
|
|
4397
|
-
disabled:
|
|
4425
|
+
onClick: R,
|
|
4426
|
+
disabled: p,
|
|
4398
4427
|
children: "Restart"
|
|
4399
4428
|
}
|
|
4400
4429
|
)
|
|
@@ -4407,17 +4436,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4407
4436
|
/* @__PURE__ */ a("div", { className: "w-full", style: { height: "600px" }, children: /* @__PURE__ */ a(
|
|
4408
4437
|
"iframe",
|
|
4409
4438
|
{
|
|
4410
|
-
src:
|
|
4439
|
+
src: u.url,
|
|
4411
4440
|
className: "w-full h-full border-0 rounded-lg",
|
|
4412
4441
|
allow: "camera; microphone; geolocation",
|
|
4413
4442
|
title: "Identity Verification",
|
|
4414
4443
|
onLoad: (L) => {
|
|
4415
|
-
var
|
|
4444
|
+
var ee, Z, ae;
|
|
4416
4445
|
console.log("[Identity] Iframe loaded");
|
|
4417
4446
|
try {
|
|
4418
|
-
const
|
|
4447
|
+
const j = L.target, Fe = j.contentDocument || ((ee = j.contentWindow) == null ? void 0 : ee.document);
|
|
4419
4448
|
if (Fe) {
|
|
4420
|
-
const ve = ((
|
|
4449
|
+
const ve = ((ae = (Z = Fe.body) == null ? void 0 : Z.textContent) == null ? void 0 : ae.toLowerCase()) || "";
|
|
4421
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."));
|
|
4422
4451
|
}
|
|
4423
4452
|
} catch {
|
|
@@ -4427,14 +4456,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4427
4456
|
}
|
|
4428
4457
|
) })
|
|
4429
4458
|
] }),
|
|
4430
|
-
r && /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(
|
|
4431
|
-
] }) : O ===
|
|
4459
|
+
r && /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4460
|
+
] }) : O === ye.SardinAI ? /* @__PURE__ */ i($, { children: [
|
|
4432
4461
|
/* @__PURE__ */ i(oe, { children: [
|
|
4433
4462
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4434
4463
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4435
4464
|
] }),
|
|
4436
4465
|
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("div", { className: "text-center py-12", children: [
|
|
4437
|
-
/* @__PURE__ */ a(
|
|
4466
|
+
/* @__PURE__ */ a(xe, { className: "mb-4" }),
|
|
4438
4467
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4439
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" })
|
|
4440
4469
|
] }) })
|
|
@@ -4444,10 +4473,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4444
4473
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4445
4474
|
] }),
|
|
4446
4475
|
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4447
|
-
r && /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(
|
|
4476
|
+
r && /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4448
4477
|
] });
|
|
4449
4478
|
}
|
|
4450
|
-
return /* @__PURE__ */ a("form", { onSubmit:
|
|
4479
|
+
return /* @__PURE__ */ a("form", { onSubmit: W.handleSubmit(P), children: /* @__PURE__ */ i($, { children: [
|
|
4451
4480
|
/* @__PURE__ */ i(oe, { children: [
|
|
4452
4481
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Review Your Information" }),
|
|
4453
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" })
|
|
@@ -4457,9 +4486,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4457
4486
|
/* @__PURE__ */ i("div", { children: [
|
|
4458
4487
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4459
4488
|
/* @__PURE__ */ i("p", { className: "mt-1 text-base", children: [
|
|
4460
|
-
(
|
|
4489
|
+
(G = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : G.firstName,
|
|
4461
4490
|
" ",
|
|
4462
|
-
(
|
|
4491
|
+
(K = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : K.lastName
|
|
4463
4492
|
] })
|
|
4464
4493
|
] }),
|
|
4465
4494
|
/* @__PURE__ */ i("div", { children: [
|
|
@@ -4468,7 +4497,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4468
4497
|
] }),
|
|
4469
4498
|
/* @__PURE__ */ i("div", { children: [
|
|
4470
4499
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4471
|
-
/* @__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" })
|
|
4472
4501
|
] })
|
|
4473
4502
|
] }),
|
|
4474
4503
|
/* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
@@ -4477,7 +4506,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4477
4506
|
/* @__PURE__ */ a(
|
|
4478
4507
|
Ie,
|
|
4479
4508
|
{
|
|
4480
|
-
control:
|
|
4509
|
+
control: W.control,
|
|
4481
4510
|
name: "country",
|
|
4482
4511
|
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4483
4512
|
Ae,
|
|
@@ -4486,7 +4515,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4486
4515
|
label: "Country",
|
|
4487
4516
|
options: [
|
|
4488
4517
|
{ value: "", label: "Select country..." },
|
|
4489
|
-
...
|
|
4518
|
+
...m.map((L) => ({
|
|
4490
4519
|
value: L.abbreviation3 || L.abbreviation,
|
|
4491
4520
|
label: L.name
|
|
4492
4521
|
}))
|
|
@@ -4498,7 +4527,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4498
4527
|
/* @__PURE__ */ a(
|
|
4499
4528
|
Ie,
|
|
4500
4529
|
{
|
|
4501
|
-
control:
|
|
4530
|
+
control: W.control,
|
|
4502
4531
|
name: "nationality",
|
|
4503
4532
|
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4504
4533
|
Ae,
|
|
@@ -4507,7 +4536,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4507
4536
|
label: "Nationality",
|
|
4508
4537
|
options: [
|
|
4509
4538
|
{ value: "", label: "Select nationality..." },
|
|
4510
|
-
...
|
|
4539
|
+
...m.map((L) => ({
|
|
4511
4540
|
value: L.abbreviation3 || L.abbreviation,
|
|
4512
4541
|
label: L.name
|
|
4513
4542
|
}))
|
|
@@ -4521,7 +4550,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4521
4550
|
/* @__PURE__ */ a(
|
|
4522
4551
|
Ie,
|
|
4523
4552
|
{
|
|
4524
|
-
control:
|
|
4553
|
+
control: W.control,
|
|
4525
4554
|
name: "street",
|
|
4526
4555
|
render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "Street" })
|
|
4527
4556
|
}
|
|
@@ -4529,7 +4558,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4529
4558
|
/* @__PURE__ */ a(
|
|
4530
4559
|
Ie,
|
|
4531
4560
|
{
|
|
4532
|
-
control:
|
|
4561
|
+
control: W.control,
|
|
4533
4562
|
name: "streetNumber",
|
|
4534
4563
|
render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "Street Number" })
|
|
4535
4564
|
}
|
|
@@ -4539,7 +4568,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4539
4568
|
/* @__PURE__ */ a(
|
|
4540
4569
|
Ie,
|
|
4541
4570
|
{
|
|
4542
|
-
control:
|
|
4571
|
+
control: W.control,
|
|
4543
4572
|
name: "city",
|
|
4544
4573
|
render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "City" })
|
|
4545
4574
|
}
|
|
@@ -4547,7 +4576,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4547
4576
|
/* @__PURE__ */ a(
|
|
4548
4577
|
Ie,
|
|
4549
4578
|
{
|
|
4550
|
-
control:
|
|
4579
|
+
control: W.control,
|
|
4551
4580
|
name: "zip",
|
|
4552
4581
|
render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "ZIP/Postal Code" })
|
|
4553
4582
|
}
|
|
@@ -4556,7 +4585,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4556
4585
|
/* @__PURE__ */ a(
|
|
4557
4586
|
Ie,
|
|
4558
4587
|
{
|
|
4559
|
-
control:
|
|
4588
|
+
control: W.control,
|
|
4560
4589
|
name: "phonenumber",
|
|
4561
4590
|
render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "Phone Number", type: "tel" })
|
|
4562
4591
|
}
|
|
@@ -4564,11 +4593,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4564
4593
|
] })
|
|
4565
4594
|
] }),
|
|
4566
4595
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
4567
|
-
r && /* @__PURE__ */ a(
|
|
4568
|
-
/* @__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" })
|
|
4569
4598
|
] })
|
|
4570
4599
|
] }) });
|
|
4571
|
-
},
|
|
4600
|
+
}, et = ({
|
|
4572
4601
|
kycStatus: e,
|
|
4573
4602
|
reviewStatus: t,
|
|
4574
4603
|
workflowResult: r,
|
|
@@ -4618,21 +4647,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4618
4647
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
4619
4648
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
4620
4649
|
message: "Your application is currently under manual review."
|
|
4621
|
-
} : r ===
|
|
4650
|
+
} : r === _e.Success ? {
|
|
4622
4651
|
type: "success",
|
|
4623
4652
|
title: "Process Complete",
|
|
4624
4653
|
icon: "✓",
|
|
4625
4654
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4626
4655
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4627
4656
|
message: "Your verification process has been completed successfully."
|
|
4628
|
-
} : r ===
|
|
4657
|
+
} : r === _e.Failed ? {
|
|
4629
4658
|
type: "error",
|
|
4630
4659
|
title: "Process Failed",
|
|
4631
4660
|
icon: "✕",
|
|
4632
4661
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4633
4662
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4634
4663
|
message: "The verification process could not be completed."
|
|
4635
|
-
} : r ===
|
|
4664
|
+
} : r === _e.AdminReview ? {
|
|
4636
4665
|
type: "pending",
|
|
4637
4666
|
title: "Admin Review Required",
|
|
4638
4667
|
icon: "📋",
|
|
@@ -4658,7 +4687,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4658
4687
|
) }),
|
|
4659
4688
|
/* @__PURE__ */ a("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: c.title }),
|
|
4660
4689
|
/* @__PURE__ */ a("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ a(
|
|
4661
|
-
|
|
4690
|
+
Se,
|
|
4662
4691
|
{
|
|
4663
4692
|
variant: c.type === "success" ? "success" : c.type === "error" ? "danger" : c.type === "pending" ? "warning" : "info",
|
|
4664
4693
|
children: e != null ? Ee[e] : Re[t]
|
|
@@ -4702,15 +4731,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4702
4731
|
] }) })
|
|
4703
4732
|
] }),
|
|
4704
4733
|
/* @__PURE__ */ i(me, { className: "flex justify-center gap-4", children: [
|
|
4705
|
-
c.type === "success" && s && /* @__PURE__ */ a(
|
|
4706
|
-
c.type === "error" && /* @__PURE__ */ i(
|
|
4707
|
-
l && /* @__PURE__ */ a(
|
|
4708
|
-
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" })
|
|
4709
4738
|
] }),
|
|
4710
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" }) })
|
|
4711
4740
|
] })
|
|
4712
4741
|
] });
|
|
4713
|
-
},
|
|
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(
|
|
4714
4743
|
"img",
|
|
4715
4744
|
{
|
|
4716
4745
|
src: e.url,
|
|
@@ -4725,7 +4754,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4725
4754
|
console.warn("[Logo] Failed to load logo:", e.url), r.target.style.display = "none";
|
|
4726
4755
|
}
|
|
4727
4756
|
}
|
|
4728
|
-
) }),
|
|
4757
|
+
) }), Ye = ({
|
|
4729
4758
|
title: e,
|
|
4730
4759
|
subtitle: t,
|
|
4731
4760
|
className: r = ""
|
|
@@ -4733,7 +4762,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4733
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;
|
|
4734
4763
|
return !l && !o ? null : /* @__PURE__ */ i("div", { className: `metakyc-header ${r}`, children: [
|
|
4735
4764
|
/* @__PURE__ */ i("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
4736
|
-
l && /* @__PURE__ */ a(
|
|
4765
|
+
l && /* @__PURE__ */ a(Or, { config: n.logo }),
|
|
4737
4766
|
l && o && /* @__PURE__ */ a(
|
|
4738
4767
|
"span",
|
|
4739
4768
|
{
|
|
@@ -4746,11 +4775,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4746
4775
|
] }),
|
|
4747
4776
|
t && /* @__PURE__ */ a("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
|
|
4748
4777
|
] });
|
|
4749
|
-
},
|
|
4750
|
-
function
|
|
4778
|
+
}, He = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
4779
|
+
function Be(e) {
|
|
4751
4780
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4752
4781
|
}
|
|
4753
|
-
const
|
|
4782
|
+
const ze = {
|
|
4754
4783
|
width: "16px",
|
|
4755
4784
|
height: "16px",
|
|
4756
4785
|
minWidth: "16px",
|
|
@@ -4762,27 +4791,27 @@ const Oe = {
|
|
|
4762
4791
|
padding: 0,
|
|
4763
4792
|
display: "inline-block",
|
|
4764
4793
|
verticalAlign: "middle"
|
|
4765
|
-
},
|
|
4794
|
+
}, ea = ({
|
|
4766
4795
|
workflowKey: e,
|
|
4767
4796
|
externalRefId: t,
|
|
4768
4797
|
onSuccess: r,
|
|
4769
4798
|
onCancel: n
|
|
4770
4799
|
}) => {
|
|
4771
|
-
var
|
|
4772
|
-
const { config: s, baseInformationService: l, currentTheme: o } = he(), { createApplicant: c, isLoading:
|
|
4773
|
-
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)
|
|
4774
4803
|
throw new Error(
|
|
4775
4804
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4776
4805
|
);
|
|
4777
|
-
const w = t || ((
|
|
4778
|
-
|
|
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(() => {
|
|
4779
4808
|
(async () => {
|
|
4780
4809
|
if (!(k.current || b.current)) {
|
|
4781
4810
|
k.current = !0, g(!0);
|
|
4782
4811
|
try {
|
|
4783
|
-
const I = await l.getCountries("", s.locale || "en"),
|
|
4812
|
+
const I = await l.getCountries("", s.locale || "en"), M = /* @__PURE__ */ new Set();
|
|
4784
4813
|
y(
|
|
4785
|
-
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))
|
|
4786
4815
|
), b.current = !0;
|
|
4787
4816
|
} catch (I) {
|
|
4788
4817
|
console.error("Failed to load countries:", I);
|
|
@@ -4792,31 +4821,31 @@ const Oe = {
|
|
|
4792
4821
|
}
|
|
4793
4822
|
})();
|
|
4794
4823
|
}, []);
|
|
4795
|
-
const
|
|
4824
|
+
const m = ke(
|
|
4796
4825
|
() => o != null && o.applicantFormPages && o.applicantFormPages.length > 0 ? o.applicantFormPages : null,
|
|
4797
4826
|
[o == null ? void 0 : o.applicantFormPages]
|
|
4798
|
-
), F =
|
|
4799
|
-
const
|
|
4800
|
-
if (I) for (const
|
|
4801
|
-
if (
|
|
4802
|
-
for (const
|
|
4803
|
-
for (const
|
|
4804
|
-
!
|
|
4805
|
-
return Array.from(
|
|
4806
|
-
}, [o == null ? void 0 : o.applicantFormRequiredFields,
|
|
4807
|
-
var
|
|
4808
|
-
if (
|
|
4809
|
-
const
|
|
4810
|
-
for (const
|
|
4811
|
-
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);
|
|
4812
4841
|
}
|
|
4813
|
-
let
|
|
4814
|
-
(
|
|
4815
|
-
const I = new Set(
|
|
4816
|
-
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);
|
|
4817
4846
|
return Array.from(I);
|
|
4818
|
-
}, [(
|
|
4819
|
-
workflowKey:
|
|
4847
|
+
}, [(Ge = s.applicantForm) == null ? void 0 : Ge.visibleFields, o == null ? void 0 : o.applicantFormVisibleFields, m]), [v, q] = x({
|
|
4848
|
+
workflowKey: p,
|
|
4820
4849
|
firstName: "",
|
|
4821
4850
|
lastName: "",
|
|
4822
4851
|
title: "",
|
|
@@ -4840,211 +4869,228 @@ const Oe = {
|
|
|
4840
4869
|
educationLevel: "",
|
|
4841
4870
|
occupation: "",
|
|
4842
4871
|
taxNumber: ""
|
|
4843
|
-
}), [
|
|
4844
|
-
(
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
}, [
|
|
4849
|
-
|
|
4850
|
-
|
|
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;
|
|
4851
4884
|
const I = {};
|
|
4852
|
-
for (const
|
|
4853
|
-
if (
|
|
4854
|
-
if (
|
|
4855
|
-
const
|
|
4856
|
-
|
|
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.`);
|
|
4857
4890
|
}
|
|
4858
|
-
} else if (
|
|
4859
|
-
const
|
|
4860
|
-
if (F.includes(
|
|
4861
|
-
const
|
|
4862
|
-
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.`;
|
|
4863
4896
|
}
|
|
4864
4897
|
}
|
|
4865
4898
|
return I;
|
|
4866
|
-
},
|
|
4867
|
-
|
|
4868
|
-
const
|
|
4869
|
-
if (
|
|
4870
|
-
|
|
4871
|
-
if (Object.keys(S).length > 0) {
|
|
4872
|
-
V(S);
|
|
4873
|
-
return;
|
|
4874
|
-
}
|
|
4875
|
-
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);
|
|
4876
4904
|
return;
|
|
4877
4905
|
}
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
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);
|
|
4884
4914
|
return;
|
|
4885
4915
|
}
|
|
4886
4916
|
}
|
|
4887
|
-
|
|
4917
|
+
G(!0), P(null);
|
|
4888
4918
|
try {
|
|
4889
4919
|
if (!v.externalRefId || v.externalRefId.trim() === "") {
|
|
4890
4920
|
P("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
4891
4921
|
return;
|
|
4892
4922
|
}
|
|
4893
|
-
|
|
4894
|
-
if (Ke(v[W])) {
|
|
4895
|
-
const X = ((T = _e[W]) == null ? void 0 : T.label) || W;
|
|
4896
|
-
P(`${X} is required.`);
|
|
4897
|
-
return;
|
|
4898
|
-
}
|
|
4899
|
-
const S = {
|
|
4923
|
+
const d = {
|
|
4900
4924
|
workflowKey: v.workflowKey,
|
|
4901
4925
|
externalRefId: v.externalRefId.trim()
|
|
4902
4926
|
};
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
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
|
+
}
|
|
4916
4952
|
}
|
|
4917
|
-
|
|
4918
|
-
const
|
|
4919
|
-
r(
|
|
4920
|
-
} catch (
|
|
4921
|
-
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");
|
|
4922
4958
|
} finally {
|
|
4923
|
-
|
|
4959
|
+
G(!1);
|
|
4924
4960
|
}
|
|
4925
|
-
},
|
|
4926
|
-
var
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
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) {
|
|
4931
4977
|
case "select":
|
|
4932
|
-
if (
|
|
4978
|
+
if (d === "country" || d === "nationality" || d === "taxCountry" || d === "countryOfBirth")
|
|
4933
4979
|
return /* @__PURE__ */ a(
|
|
4934
4980
|
Ae,
|
|
4935
4981
|
{
|
|
4936
|
-
...
|
|
4937
|
-
label:
|
|
4938
|
-
value: v[
|
|
4939
|
-
onChange: (ne) =>
|
|
4940
|
-
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],
|
|
4941
4987
|
disabled: h
|
|
4942
4988
|
},
|
|
4943
|
-
|
|
4989
|
+
ce
|
|
4944
4990
|
);
|
|
4945
|
-
if (
|
|
4991
|
+
if (d === "salutation")
|
|
4946
4992
|
return /* @__PURE__ */ a(
|
|
4947
4993
|
Ae,
|
|
4948
4994
|
{
|
|
4949
|
-
...
|
|
4950
|
-
label:
|
|
4951
|
-
value: ((
|
|
4952
|
-
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),
|
|
4953
4999
|
options: [
|
|
4954
5000
|
{ value: "", label: "Select salutation..." },
|
|
4955
|
-
{ value:
|
|
4956
|
-
{ value:
|
|
4957
|
-
{ value:
|
|
5001
|
+
{ value: Ue.Male.toString(), label: "Male" },
|
|
5002
|
+
{ value: Ue.Female.toString(), label: "Female" },
|
|
5003
|
+
{ value: Ue.Other.toString(), label: "Other" }
|
|
4958
5004
|
]
|
|
4959
5005
|
},
|
|
4960
|
-
|
|
5006
|
+
ce
|
|
4961
5007
|
);
|
|
4962
|
-
if (
|
|
4963
|
-
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;
|
|
4964
5010
|
return /* @__PURE__ */ a(
|
|
4965
5011
|
Ae,
|
|
4966
5012
|
{
|
|
4967
|
-
...
|
|
4968
|
-
label:
|
|
4969
|
-
value: v[
|
|
4970
|
-
onChange: (
|
|
5013
|
+
...re,
|
|
5014
|
+
label: te,
|
|
5015
|
+
value: v[d] || "",
|
|
5016
|
+
onChange: (qe) => K(d, qe.target.value),
|
|
4971
5017
|
options: [{ value: "", label: "Select language..." }, ...ne]
|
|
4972
5018
|
},
|
|
4973
|
-
|
|
5019
|
+
ce
|
|
4974
5020
|
);
|
|
4975
5021
|
}
|
|
4976
5022
|
return null;
|
|
4977
5023
|
case "multiselect":
|
|
4978
|
-
return
|
|
4979
|
-
|
|
5024
|
+
return d === "otherNationality" ? /* @__PURE__ */ a(
|
|
5025
|
+
mr,
|
|
4980
5026
|
{
|
|
4981
|
-
...
|
|
4982
|
-
label:
|
|
4983
|
-
value: v[
|
|
4984
|
-
onChange: (ne) =>
|
|
5027
|
+
...re,
|
|
5028
|
+
label: te,
|
|
5029
|
+
value: v[d] || [],
|
|
5030
|
+
onChange: (ne) => K(d, ne),
|
|
4985
5031
|
options: N,
|
|
4986
5032
|
placeholder: "Select other nationalities...",
|
|
4987
5033
|
disabled: h
|
|
4988
5034
|
},
|
|
4989
|
-
|
|
5035
|
+
ce
|
|
4990
5036
|
) : null;
|
|
4991
5037
|
case "date":
|
|
4992
5038
|
return /* @__PURE__ */ a(
|
|
4993
5039
|
ue,
|
|
4994
5040
|
{
|
|
4995
|
-
...
|
|
5041
|
+
...re,
|
|
4996
5042
|
type: "date",
|
|
4997
|
-
label:
|
|
4998
|
-
value: v[
|
|
4999
|
-
onChange: (ne) =>
|
|
5000
|
-
error:
|
|
5043
|
+
label: te,
|
|
5044
|
+
value: v[d] || "",
|
|
5045
|
+
onChange: (ne) => K(d, ne.target.value),
|
|
5046
|
+
error: z
|
|
5001
5047
|
},
|
|
5002
|
-
|
|
5048
|
+
ce
|
|
5003
5049
|
);
|
|
5004
5050
|
case "email":
|
|
5005
5051
|
return /* @__PURE__ */ a(
|
|
5006
5052
|
ue,
|
|
5007
5053
|
{
|
|
5008
|
-
...
|
|
5054
|
+
...re,
|
|
5009
5055
|
type: "email",
|
|
5010
|
-
label:
|
|
5011
|
-
value: v[
|
|
5012
|
-
onChange: (ne) =>
|
|
5013
|
-
error:
|
|
5056
|
+
label: te,
|
|
5057
|
+
value: v[d] || "",
|
|
5058
|
+
onChange: (ne) => K(d, ne.target.value),
|
|
5059
|
+
error: z
|
|
5014
5060
|
},
|
|
5015
|
-
|
|
5061
|
+
ce
|
|
5016
5062
|
);
|
|
5017
5063
|
case "tel":
|
|
5018
5064
|
return /* @__PURE__ */ a(
|
|
5019
5065
|
ue,
|
|
5020
5066
|
{
|
|
5021
|
-
...
|
|
5067
|
+
...re,
|
|
5022
5068
|
type: "tel",
|
|
5023
|
-
label:
|
|
5024
|
-
value: v[
|
|
5025
|
-
onChange: (ne) =>
|
|
5026
|
-
error:
|
|
5069
|
+
label: te,
|
|
5070
|
+
value: v[d] || "",
|
|
5071
|
+
onChange: (ne) => K(d, ne.target.value),
|
|
5072
|
+
error: z
|
|
5027
5073
|
},
|
|
5028
|
-
|
|
5074
|
+
ce
|
|
5029
5075
|
);
|
|
5030
5076
|
default:
|
|
5031
5077
|
return /* @__PURE__ */ a(
|
|
5032
5078
|
ue,
|
|
5033
5079
|
{
|
|
5034
|
-
...
|
|
5080
|
+
...re,
|
|
5035
5081
|
type: "text",
|
|
5036
|
-
label:
|
|
5037
|
-
value: v[
|
|
5038
|
-
onChange: (ne) =>
|
|
5039
|
-
error:
|
|
5082
|
+
label: te,
|
|
5083
|
+
value: v[d] || "",
|
|
5084
|
+
onChange: (ne) => K(d, ne.target.value),
|
|
5085
|
+
error: z
|
|
5040
5086
|
},
|
|
5041
|
-
|
|
5087
|
+
ce
|
|
5042
5088
|
);
|
|
5043
5089
|
}
|
|
5044
|
-
},
|
|
5045
|
-
if (!
|
|
5046
|
-
const
|
|
5047
|
-
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")
|
|
5048
5094
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
5049
5095
|
/* @__PURE__ */ i(
|
|
5050
5096
|
"label",
|
|
@@ -5056,10 +5102,10 @@ const Oe = {
|
|
|
5056
5102
|
"input",
|
|
5057
5103
|
{
|
|
5058
5104
|
type: "checkbox",
|
|
5059
|
-
checked:
|
|
5060
|
-
onChange: (
|
|
5105
|
+
checked: H[d.paramName] === "true",
|
|
5106
|
+
onChange: (E) => le(d.paramName, E.target.checked ? "true" : "false"),
|
|
5061
5107
|
className: "metakyc-option-input",
|
|
5062
|
-
style:
|
|
5108
|
+
style: ze
|
|
5063
5109
|
}
|
|
5064
5110
|
),
|
|
5065
5111
|
/* @__PURE__ */ i(
|
|
@@ -5068,17 +5114,17 @@ const Oe = {
|
|
|
5068
5114
|
className: "metakyc-option-text",
|
|
5069
5115
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5070
5116
|
children: [
|
|
5071
|
-
|
|
5072
|
-
|
|
5117
|
+
C,
|
|
5118
|
+
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5073
5119
|
]
|
|
5074
5120
|
}
|
|
5075
5121
|
)
|
|
5076
5122
|
]
|
|
5077
5123
|
}
|
|
5078
5124
|
),
|
|
5079
|
-
|
|
5125
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: M })
|
|
5080
5126
|
] }, `custom-${I}`);
|
|
5081
|
-
if (
|
|
5127
|
+
if (d.customType === "link_checkbox")
|
|
5082
5128
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
5083
5129
|
/* @__PURE__ */ i(
|
|
5084
5130
|
"label",
|
|
@@ -5090,10 +5136,10 @@ const Oe = {
|
|
|
5090
5136
|
"input",
|
|
5091
5137
|
{
|
|
5092
5138
|
type: "checkbox",
|
|
5093
|
-
checked:
|
|
5094
|
-
onChange: (
|
|
5139
|
+
checked: H[d.paramName] === "true",
|
|
5140
|
+
onChange: (E) => le(d.paramName, E.target.checked ? "true" : "false"),
|
|
5095
5141
|
className: "metakyc-option-input",
|
|
5096
|
-
style: { ...
|
|
5142
|
+
style: { ...ze, alignSelf: "flex-start", marginTop: "2px" }
|
|
5097
5143
|
}
|
|
5098
5144
|
),
|
|
5099
5145
|
/* @__PURE__ */ i(
|
|
@@ -5102,31 +5148,31 @@ const Oe = {
|
|
|
5102
5148
|
className: "metakyc-option-text",
|
|
5103
5149
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5104
5150
|
children: [
|
|
5105
|
-
|
|
5151
|
+
C,
|
|
5106
5152
|
" ",
|
|
5107
|
-
|
|
5153
|
+
d.linkUrl && /* @__PURE__ */ a(
|
|
5108
5154
|
"a",
|
|
5109
5155
|
{
|
|
5110
|
-
href:
|
|
5156
|
+
href: d.linkUrl,
|
|
5111
5157
|
target: "_blank",
|
|
5112
5158
|
rel: "noopener noreferrer",
|
|
5113
5159
|
className: "underline",
|
|
5114
5160
|
style: { color: "var(--metakyc-primary, #2563eb)" },
|
|
5115
|
-
onClick: (
|
|
5116
|
-
children:
|
|
5161
|
+
onClick: (E) => E.stopPropagation(),
|
|
5162
|
+
children: d.linkText || d.linkUrl
|
|
5117
5163
|
}
|
|
5118
5164
|
),
|
|
5119
|
-
|
|
5165
|
+
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5120
5166
|
]
|
|
5121
5167
|
}
|
|
5122
5168
|
)
|
|
5123
5169
|
]
|
|
5124
5170
|
}
|
|
5125
5171
|
),
|
|
5126
|
-
|
|
5172
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: M })
|
|
5127
5173
|
] }, `custom-${I}`);
|
|
5128
|
-
if (
|
|
5129
|
-
const
|
|
5174
|
+
if (d.customType === "group_checkbox") {
|
|
5175
|
+
const E = (H[d.paramName] || "").split(",").filter(Boolean);
|
|
5130
5176
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
5131
5177
|
/* @__PURE__ */ i(
|
|
5132
5178
|
"div",
|
|
@@ -5134,12 +5180,12 @@ const Oe = {
|
|
|
5134
5180
|
className: "text-sm font-medium",
|
|
5135
5181
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5136
5182
|
children: [
|
|
5137
|
-
|
|
5138
|
-
|
|
5183
|
+
C,
|
|
5184
|
+
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5139
5185
|
]
|
|
5140
5186
|
}
|
|
5141
5187
|
),
|
|
5142
|
-
/* @__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(
|
|
5143
5189
|
"label",
|
|
5144
5190
|
{
|
|
5145
5191
|
className: "metakyc-option-label",
|
|
@@ -5149,13 +5195,13 @@ const Oe = {
|
|
|
5149
5195
|
"input",
|
|
5150
5196
|
{
|
|
5151
5197
|
type: "checkbox",
|
|
5152
|
-
checked:
|
|
5153
|
-
onChange: (
|
|
5154
|
-
const
|
|
5155
|
-
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(","));
|
|
5156
5202
|
},
|
|
5157
5203
|
className: "metakyc-option-input",
|
|
5158
|
-
style:
|
|
5204
|
+
style: ze
|
|
5159
5205
|
}
|
|
5160
5206
|
),
|
|
5161
5207
|
/* @__PURE__ */ a(
|
|
@@ -5163,29 +5209,29 @@ const Oe = {
|
|
|
5163
5209
|
{
|
|
5164
5210
|
className: "metakyc-option-text",
|
|
5165
5211
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5166
|
-
children:
|
|
5212
|
+
children: z.label
|
|
5167
5213
|
}
|
|
5168
5214
|
)
|
|
5169
5215
|
]
|
|
5170
5216
|
},
|
|
5171
|
-
|
|
5217
|
+
z.value
|
|
5172
5218
|
)) }),
|
|
5173
|
-
|
|
5219
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: M })
|
|
5174
5220
|
] }, `custom-${I}`);
|
|
5175
5221
|
}
|
|
5176
|
-
return
|
|
5222
|
+
return d.customType === "radio_group" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
5177
5223
|
/* @__PURE__ */ i(
|
|
5178
5224
|
"div",
|
|
5179
5225
|
{
|
|
5180
5226
|
className: "text-sm font-medium",
|
|
5181
5227
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5182
5228
|
children: [
|
|
5183
|
-
|
|
5184
|
-
|
|
5229
|
+
C,
|
|
5230
|
+
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5185
5231
|
]
|
|
5186
5232
|
}
|
|
5187
5233
|
),
|
|
5188
|
-
/* @__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(
|
|
5189
5235
|
"label",
|
|
5190
5236
|
{
|
|
5191
5237
|
className: "metakyc-option-label",
|
|
@@ -5195,11 +5241,11 @@ const Oe = {
|
|
|
5195
5241
|
"input",
|
|
5196
5242
|
{
|
|
5197
5243
|
type: "radio",
|
|
5198
|
-
checked:
|
|
5199
|
-
onChange: () => le(
|
|
5200
|
-
name: `radio-group-${
|
|
5244
|
+
checked: H[d.paramName] === E.value,
|
|
5245
|
+
onChange: () => le(d.paramName, E.value),
|
|
5246
|
+
name: `radio-group-${d.paramName}-${I}`,
|
|
5201
5247
|
className: "metakyc-option-input",
|
|
5202
|
-
style:
|
|
5248
|
+
style: ze
|
|
5203
5249
|
}
|
|
5204
5250
|
),
|
|
5205
5251
|
/* @__PURE__ */ a(
|
|
@@ -5207,137 +5253,138 @@ const Oe = {
|
|
|
5207
5253
|
{
|
|
5208
5254
|
className: "metakyc-option-text",
|
|
5209
5255
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5210
|
-
children:
|
|
5256
|
+
children: E.label
|
|
5211
5257
|
}
|
|
5212
5258
|
)
|
|
5213
5259
|
]
|
|
5214
5260
|
},
|
|
5215
|
-
|
|
5261
|
+
E.value
|
|
5216
5262
|
)) }),
|
|
5217
|
-
|
|
5263
|
+
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: M })
|
|
5218
5264
|
] }, `custom-${I}`) : /* @__PURE__ */ a(
|
|
5219
5265
|
ue,
|
|
5220
5266
|
{
|
|
5221
5267
|
type: "text",
|
|
5222
|
-
label: `${
|
|
5223
|
-
value:
|
|
5224
|
-
onChange: (
|
|
5225
|
-
required:
|
|
5226
|
-
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
|
|
5227
5273
|
},
|
|
5228
5274
|
`custom-${I}`
|
|
5229
5275
|
);
|
|
5230
|
-
},
|
|
5231
|
-
const
|
|
5232
|
-
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);
|
|
5233
5279
|
}) });
|
|
5234
5280
|
if (h)
|
|
5235
5281
|
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5236
|
-
/* @__PURE__ */ a(
|
|
5282
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
5237
5283
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
5238
5284
|
] }) }) });
|
|
5239
|
-
if (
|
|
5240
|
-
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);
|
|
5241
5287
|
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i($, { children: [
|
|
5242
|
-
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(
|
|
5288
|
+
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(Ye, { title: (o == null ? void 0 : o.title) || "Create Applicant" }) }),
|
|
5243
5289
|
/* @__PURE__ */ i(B, { children: [
|
|
5244
|
-
(
|
|
5245
|
-
|
|
5290
|
+
(d.title || d.subtitle || d.description) && /* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
5291
|
+
d.title && /* @__PURE__ */ a(
|
|
5246
5292
|
"h3",
|
|
5247
5293
|
{
|
|
5248
5294
|
className: "font-semibold text-base",
|
|
5249
5295
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5250
|
-
children:
|
|
5296
|
+
children: d.title
|
|
5251
5297
|
}
|
|
5252
5298
|
),
|
|
5253
|
-
|
|
5299
|
+
d.subtitle && /* @__PURE__ */ a(
|
|
5254
5300
|
"p",
|
|
5255
5301
|
{
|
|
5256
5302
|
className: "text-sm mt-0.5",
|
|
5257
5303
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
5258
|
-
children:
|
|
5304
|
+
children: d.subtitle
|
|
5259
5305
|
}
|
|
5260
5306
|
),
|
|
5261
|
-
|
|
5307
|
+
d.description && d.description !== d.subtitle && /* @__PURE__ */ a(
|
|
5262
5308
|
"p",
|
|
5263
5309
|
{
|
|
5264
5310
|
className: "text-xs mt-1",
|
|
5265
5311
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
5266
|
-
children:
|
|
5312
|
+
children: d.description
|
|
5267
5313
|
}
|
|
5268
5314
|
)
|
|
5269
5315
|
] }),
|
|
5270
|
-
(
|
|
5271
|
-
|
|
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: [
|
|
5272
5318
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
5273
5319
|
" ",
|
|
5274
|
-
|
|
5320
|
+
W
|
|
5275
5321
|
] }),
|
|
5276
|
-
|
|
5322
|
+
te.map((ce, re) => /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: ce }, re))
|
|
5277
5323
|
] }),
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
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
|
+
}),
|
|
5287
5336
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
5288
|
-
|
|
5337
|
+
z,
|
|
5289
5338
|
" / ",
|
|
5290
|
-
|
|
5339
|
+
E
|
|
5291
5340
|
] })
|
|
5292
5341
|
] }),
|
|
5293
|
-
|
|
5342
|
+
Le(d)
|
|
5294
5343
|
] }),
|
|
5295
5344
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
5296
5345
|
/* @__PURE__ */ i("div", { children: [
|
|
5297
5346
|
!I && /* @__PURE__ */ a(
|
|
5298
|
-
|
|
5347
|
+
U,
|
|
5299
5348
|
{
|
|
5300
5349
|
type: "button",
|
|
5301
5350
|
variant: "outline",
|
|
5302
5351
|
onClick: () => {
|
|
5303
|
-
A(
|
|
5352
|
+
A(L), Q({});
|
|
5304
5353
|
},
|
|
5305
|
-
disabled:
|
|
5354
|
+
disabled: R || u,
|
|
5306
5355
|
children: "Previous"
|
|
5307
5356
|
}
|
|
5308
5357
|
),
|
|
5309
|
-
I && n && /* @__PURE__ */ a(
|
|
5358
|
+
I && n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: R || u, children: "Cancel" })
|
|
5310
5359
|
] }),
|
|
5311
5360
|
/* @__PURE__ */ a(
|
|
5312
|
-
|
|
5361
|
+
U,
|
|
5313
5362
|
{
|
|
5314
5363
|
type: "button",
|
|
5315
|
-
isLoading:
|
|
5316
|
-
onClick:
|
|
5317
|
-
children:
|
|
5364
|
+
isLoading: R || u,
|
|
5365
|
+
onClick: M ? ae : Z,
|
|
5366
|
+
children: M ? "Submit" : "Next"
|
|
5318
5367
|
}
|
|
5319
5368
|
)
|
|
5320
5369
|
] })
|
|
5321
5370
|
] }) });
|
|
5322
5371
|
}
|
|
5323
|
-
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a("form", { onSubmit:
|
|
5324
|
-
|
|
5325
|
-
}, children: /* @__PURE__ */ i($, { children: [
|
|
5326
|
-
/* @__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" }) }),
|
|
5327
5374
|
/* @__PURE__ */ i(B, { children: [
|
|
5328
|
-
|
|
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: [
|
|
5329
5376
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
5330
5377
|
" ",
|
|
5331
|
-
|
|
5378
|
+
W
|
|
5332
5379
|
] }) }),
|
|
5333
|
-
/* @__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)) })
|
|
5334
5381
|
] }),
|
|
5335
5382
|
/* @__PURE__ */ i(me, { className: "flex justify-between", children: [
|
|
5336
|
-
n && /* @__PURE__ */ a(
|
|
5337
|
-
/* @__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" })
|
|
5338
5385
|
] })
|
|
5339
5386
|
] }) }) });
|
|
5340
|
-
},
|
|
5387
|
+
}, ta = ({
|
|
5341
5388
|
applicantId: e,
|
|
5342
5389
|
onComplete: t,
|
|
5343
5390
|
onError: r,
|
|
@@ -5348,25 +5395,25 @@ const Oe = {
|
|
|
5348
5395
|
progress: l,
|
|
5349
5396
|
currentStep: o,
|
|
5350
5397
|
steps: c,
|
|
5351
|
-
workflowKey:
|
|
5352
|
-
nextWorkflowKey:
|
|
5398
|
+
workflowKey: u,
|
|
5399
|
+
nextWorkflowKey: p,
|
|
5353
5400
|
hasWorkflowChanged: w,
|
|
5354
5401
|
isLoading: N,
|
|
5355
5402
|
error: y,
|
|
5356
5403
|
moveBack: h,
|
|
5357
5404
|
refreshProgress: g
|
|
5358
|
-
} =
|
|
5359
|
-
if (
|
|
5405
|
+
} = sr(e), [k, b] = ge.useState(!1);
|
|
5406
|
+
if (ge.useEffect(() => {
|
|
5360
5407
|
y && r && r(y);
|
|
5361
|
-
}, [y, r]),
|
|
5408
|
+
}, [y, r]), ge.useEffect(() => {
|
|
5362
5409
|
l != null && l.workflowResult && t && t(l.workflowResult);
|
|
5363
|
-
}, [l == null ? void 0 : l.workflowResult, t]),
|
|
5410
|
+
}, [l == null ? void 0 : l.workflowResult, t]), ge.useEffect(() => {
|
|
5364
5411
|
n === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
5365
|
-
}, [n]),
|
|
5412
|
+
}, [n]), ge.useEffect(() => {
|
|
5366
5413
|
w && b(!1);
|
|
5367
5414
|
}, [w]), N || !l)
|
|
5368
5415
|
return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5369
|
-
/* @__PURE__ */ a(
|
|
5416
|
+
/* @__PURE__ */ a(xe, { className: "my-8" }),
|
|
5370
5417
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
5371
5418
|
] }) }) });
|
|
5372
5419
|
if (y)
|
|
@@ -5383,12 +5430,12 @@ const Oe = {
|
|
|
5383
5430
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between text-sm", children: [
|
|
5384
5431
|
/* @__PURE__ */ i("div", { className: "text-left", children: [
|
|
5385
5432
|
/* @__PURE__ */ a("p", { className: "text-gray-500 dark:text-gray-400 mb-1", children: "Previous Workflow" }),
|
|
5386
|
-
/* @__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 })
|
|
5387
5434
|
] }),
|
|
5388
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" }) }),
|
|
5389
5436
|
/* @__PURE__ */ i("div", { className: "text-right", children: [
|
|
5390
5437
|
/* @__PURE__ */ a("p", { className: "text-gray-500 dark:text-gray-400 mb-1", children: "New Workflow" }),
|
|
5391
|
-
/* @__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 })
|
|
5392
5439
|
] })
|
|
5393
5440
|
] }),
|
|
5394
5441
|
l.nextWorkflowName && /* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-2 text-xs", children: l.nextWorkflowName })
|
|
@@ -5402,9 +5449,9 @@ const Oe = {
|
|
|
5402
5449
|
}
|
|
5403
5450
|
)
|
|
5404
5451
|
] }) }) }) });
|
|
5405
|
-
if (l.status ===
|
|
5452
|
+
if (l.status === fe.Finished || l.status === fe.OnHold)
|
|
5406
5453
|
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a(
|
|
5407
|
-
|
|
5454
|
+
et,
|
|
5408
5455
|
{
|
|
5409
5456
|
kycStatus: l.kycStatus,
|
|
5410
5457
|
reviewStatus: l.reviewStatus,
|
|
@@ -5418,54 +5465,54 @@ const Oe = {
|
|
|
5418
5465
|
) });
|
|
5419
5466
|
if (!o)
|
|
5420
5467
|
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5421
|
-
/* @__PURE__ */ a(
|
|
5422
|
-
/* @__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..." })
|
|
5423
5470
|
] }) }) });
|
|
5424
|
-
const
|
|
5471
|
+
const m = (v) => {
|
|
5425
5472
|
switch (v) {
|
|
5426
|
-
case
|
|
5473
|
+
case _.Overview:
|
|
5427
5474
|
return "Overview";
|
|
5428
|
-
case
|
|
5475
|
+
case _.Questionaries:
|
|
5429
5476
|
return "Questionnaire";
|
|
5430
|
-
case
|
|
5477
|
+
case _.UploadDocument:
|
|
5431
5478
|
return "Documents";
|
|
5432
|
-
case
|
|
5479
|
+
case _.IdentitySdk:
|
|
5433
5480
|
return "Identity";
|
|
5434
|
-
case
|
|
5481
|
+
case _.RiskScoring:
|
|
5435
5482
|
return "Risk Assessment";
|
|
5436
|
-
case
|
|
5483
|
+
case _.InvestorCategorization:
|
|
5437
5484
|
return "Investor Categorization";
|
|
5438
|
-
case
|
|
5485
|
+
case _.AppropriatenessTest:
|
|
5439
5486
|
return "Appropriateness Test";
|
|
5440
|
-
case
|
|
5487
|
+
case _.AdditionalData:
|
|
5441
5488
|
return "Additional Data";
|
|
5442
|
-
case
|
|
5489
|
+
case _.ManualReview:
|
|
5443
5490
|
return "Review";
|
|
5444
5491
|
default:
|
|
5445
5492
|
return "";
|
|
5446
5493
|
}
|
|
5447
5494
|
}, F = () => {
|
|
5448
|
-
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;
|
|
5449
5496
|
return /* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
5450
5497
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5451
|
-
/* @__PURE__ */ a(
|
|
5452
|
-
/* @__PURE__ */ i(
|
|
5498
|
+
/* @__PURE__ */ a(Ye, {}),
|
|
5499
|
+
/* @__PURE__ */ i(Se, { variant: l.status === 1 ? "info" : "success", children: [
|
|
5453
5500
|
"Step ",
|
|
5454
|
-
|
|
5501
|
+
H,
|
|
5455
5502
|
" of ",
|
|
5456
|
-
|
|
5503
|
+
T
|
|
5457
5504
|
] })
|
|
5458
5505
|
] }),
|
|
5459
5506
|
/* @__PURE__ */ a("div", { className: "flex items-center", children: v.map((f, A) => {
|
|
5460
|
-
const D = A <
|
|
5461
|
-
return /* @__PURE__ */ i(
|
|
5507
|
+
const D = A < q, Q = f.order === o.order;
|
|
5508
|
+
return /* @__PURE__ */ i(ge.Fragment, { children: [
|
|
5462
5509
|
/* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
5463
5510
|
/* @__PURE__ */ a(
|
|
5464
5511
|
"div",
|
|
5465
5512
|
{
|
|
5466
5513
|
className: `
|
|
5467
5514
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
5468
|
-
${D ||
|
|
5515
|
+
${D || Q ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
5469
5516
|
`,
|
|
5470
5517
|
children: A + 1
|
|
5471
5518
|
}
|
|
@@ -5473,8 +5520,8 @@ const Oe = {
|
|
|
5473
5520
|
/* @__PURE__ */ a(
|
|
5474
5521
|
"span",
|
|
5475
5522
|
{
|
|
5476
|
-
className: `ml-2 text-sm ${
|
|
5477
|
-
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}`
|
|
5478
5525
|
}
|
|
5479
5526
|
)
|
|
5480
5527
|
] }),
|
|
@@ -5487,7 +5534,7 @@ const Oe = {
|
|
|
5487
5534
|
] }, f.order);
|
|
5488
5535
|
}) })
|
|
5489
5536
|
] });
|
|
5490
|
-
},
|
|
5537
|
+
}, S = () => {
|
|
5491
5538
|
const v = {
|
|
5492
5539
|
applicantId: e,
|
|
5493
5540
|
onComplete: async () => {
|
|
@@ -5496,24 +5543,24 @@ const Oe = {
|
|
|
5496
5543
|
onBack: o.order > 0 ? h : void 0
|
|
5497
5544
|
};
|
|
5498
5545
|
switch (o.action) {
|
|
5499
|
-
case
|
|
5500
|
-
return /* @__PURE__ */ a(
|
|
5501
|
-
case
|
|
5502
|
-
return /* @__PURE__ */ a(
|
|
5503
|
-
case
|
|
5504
|
-
return /* @__PURE__ */ a(Nr, { ...v });
|
|
5505
|
-
case U.IdentitySdk:
|
|
5506
|
-
return /* @__PURE__ */ a(Dr, { ...v });
|
|
5507
|
-
case U.RiskScoring:
|
|
5546
|
+
case _.Questionaries:
|
|
5547
|
+
return /* @__PURE__ */ a(Sr, { ...v });
|
|
5548
|
+
case _.UploadDocument:
|
|
5549
|
+
return /* @__PURE__ */ a(Ar, { ...v });
|
|
5550
|
+
case _.Overview:
|
|
5508
5551
|
return /* @__PURE__ */ a(Ir, { ...v });
|
|
5509
|
-
case
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
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:
|
|
5515
5562
|
return /* @__PURE__ */ a(
|
|
5516
|
-
|
|
5563
|
+
et,
|
|
5517
5564
|
{
|
|
5518
5565
|
kycStatus: l.kycStatus,
|
|
5519
5566
|
reviewStatus: l.reviewStatus,
|
|
@@ -5523,30 +5570,30 @@ const Oe = {
|
|
|
5523
5570
|
);
|
|
5524
5571
|
default:
|
|
5525
5572
|
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
|
|
5526
|
-
/* @__PURE__ */ a("div", { className: "mb-4", children: /* @__PURE__ */ a(
|
|
5573
|
+
/* @__PURE__ */ a("div", { className: "mb-4", children: /* @__PURE__ */ a(xe, {}) }),
|
|
5527
5574
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
5528
5575
|
"Processing step: ",
|
|
5529
5576
|
o.title || o.name
|
|
5530
5577
|
] }),
|
|
5531
5578
|
/* @__PURE__ */ i("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
5532
5579
|
"Action type: ",
|
|
5533
|
-
|
|
5580
|
+
_[o.action]
|
|
5534
5581
|
] })
|
|
5535
5582
|
] }) });
|
|
5536
5583
|
}
|
|
5537
5584
|
};
|
|
5538
5585
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
5539
5586
|
F(),
|
|
5540
|
-
|
|
5587
|
+
S()
|
|
5541
5588
|
] });
|
|
5542
5589
|
};
|
|
5543
|
-
function
|
|
5544
|
-
return
|
|
5545
|
-
questionResults:
|
|
5590
|
+
function ra(e) {
|
|
5591
|
+
return Ne.object({
|
|
5592
|
+
questionResults: Ne.any()
|
|
5546
5593
|
}).passthrough();
|
|
5547
5594
|
}
|
|
5548
|
-
function
|
|
5549
|
-
let t =
|
|
5595
|
+
function $r(e) {
|
|
5596
|
+
let t = Ne.array(Ne.instanceof(File));
|
|
5550
5597
|
if (e.isRequired ? t = t.min(
|
|
5551
5598
|
1,
|
|
5552
5599
|
`${e.displayName} is required`
|
|
@@ -5567,139 +5614,139 @@ function Lr(e) {
|
|
|
5567
5614
|
}
|
|
5568
5615
|
return t;
|
|
5569
5616
|
}
|
|
5570
|
-
function
|
|
5617
|
+
function aa(e) {
|
|
5571
5618
|
const t = {};
|
|
5572
5619
|
return e.uploadDocumentFiles.forEach((r) => {
|
|
5573
5620
|
const n = `file_${r.id}`;
|
|
5574
|
-
t[n] =
|
|
5575
|
-
}),
|
|
5621
|
+
t[n] = $r(r);
|
|
5622
|
+
}), Ne.object(t);
|
|
5576
5623
|
}
|
|
5577
|
-
function
|
|
5578
|
-
return
|
|
5624
|
+
function na(e) {
|
|
5625
|
+
return Ne.any();
|
|
5579
5626
|
}
|
|
5580
|
-
function
|
|
5581
|
-
return
|
|
5627
|
+
function Br(e) {
|
|
5628
|
+
return Ne.string().min(1, "This question is required");
|
|
5582
5629
|
}
|
|
5583
|
-
function
|
|
5630
|
+
function sa(e) {
|
|
5584
5631
|
const t = {};
|
|
5585
5632
|
return e.appropriatenessQuestions.forEach((r) => {
|
|
5586
5633
|
const n = `question_${r.id}`;
|
|
5587
|
-
t[n] =
|
|
5588
|
-
}),
|
|
5634
|
+
t[n] = Br();
|
|
5635
|
+
}), Ne.object(t);
|
|
5589
5636
|
}
|
|
5590
|
-
const
|
|
5637
|
+
const ia = Ne.any();
|
|
5591
5638
|
export {
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
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,
|
|
5603
5650
|
$ as Card,
|
|
5604
5651
|
B as CardContent,
|
|
5605
5652
|
me as CardFooter,
|
|
5606
5653
|
oe as CardHeader,
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
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,
|
|
5620
5667
|
De as IdentityProviderManager,
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5668
|
+
Tt as IdentityService,
|
|
5669
|
+
ye as IdentityVerificationProvider,
|
|
5670
|
+
Tr as IdentityVerificationStep,
|
|
5624
5671
|
ue as Input,
|
|
5625
|
-
|
|
5626
|
-
|
|
5672
|
+
$t as InvestorCategorizationService,
|
|
5673
|
+
Lr as InvestorCategorizationStep,
|
|
5627
5674
|
pe as InvestorCategorizationType,
|
|
5628
|
-
|
|
5629
|
-
|
|
5675
|
+
St as InvestorCategoryType,
|
|
5676
|
+
ft as KycProcessStatus,
|
|
5630
5677
|
Ee as KycStatus,
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5678
|
+
et as KycStatusDisplay,
|
|
5679
|
+
ta as KycWorkflow,
|
|
5680
|
+
Or as Logo,
|
|
5681
|
+
rt as MetaKYCContext,
|
|
5635
5682
|
we as MetaKYCError,
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
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,
|
|
5644
5691
|
Re as ReviewStatus,
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5692
|
+
kt as RiskCriteriaType,
|
|
5693
|
+
gt as RiskLevel,
|
|
5694
|
+
Mt as RiskScoringService,
|
|
5695
|
+
Dr as RiskScoringStep,
|
|
5696
|
+
Zt as SardinAIProvider,
|
|
5650
5697
|
Ae as Select,
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5698
|
+
xe as Spinner,
|
|
5699
|
+
Yt as StepRouter,
|
|
5700
|
+
Vt as SumsubProvider,
|
|
5701
|
+
Jt as ThemeManager,
|
|
5655
5702
|
se as ThemePreset,
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5703
|
+
jt as ThemeService,
|
|
5704
|
+
Dt as UploadDocumentService,
|
|
5705
|
+
Ar as UploadDocumentStep,
|
|
5706
|
+
xt as UserType,
|
|
5660
5707
|
Ce as ValueDataType,
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
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,
|
|
5669
5716
|
ie as cn,
|
|
5670
|
-
|
|
5671
|
-
|
|
5717
|
+
Bt as corporateTheme,
|
|
5718
|
+
At as defaultConfig,
|
|
5672
5719
|
de as defaultTheme,
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
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,
|
|
5697
5744
|
he as useMetaKYC,
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5745
|
+
or as useOverview,
|
|
5746
|
+
ir as useQuestionnaire,
|
|
5747
|
+
dr as useRiskScoring,
|
|
5748
|
+
lr as useUploadDocument,
|
|
5749
|
+
Qr as validateFileSize,
|
|
5750
|
+
Vr as validateFileType
|
|
5704
5751
|
};
|
|
5705
5752
|
//# sourceMappingURL=index.js.map
|