@vpdev2/metakyc-sdk 1.0.106 → 1.0.107
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/identity/providers/sumsub.d.ts.map +1 -1
- package/dist/index.cjs +12 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1011 -995
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var he = (e, t, n) =>
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import we, { createContext as
|
|
7
|
-
import { jsx as r, jsxs as s, Fragment as
|
|
8
|
-
import
|
|
9
|
-
import { useForm as
|
|
10
|
-
import { z as
|
|
11
|
-
var ce = /* @__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))(ce || {}),
|
|
12
|
-
const
|
|
1
|
+
var Ut = Object.defineProperty;
|
|
2
|
+
var Kt = (e, t, n) => t in e ? Ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var he = (e, t, n) => Kt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import qt from "axios";
|
|
5
|
+
import * as Rt from "react";
|
|
6
|
+
import we, { createContext as Vt, useState as k, useMemo as De, useEffect as ge, useContext as Yt, useRef as de, useCallback as ae, forwardRef as yt, createElement as wt } from "react";
|
|
7
|
+
import { jsx as r, jsxs as s, Fragment as lt } from "react/jsx-runtime";
|
|
8
|
+
import Qt, { createPortal as St } from "react-dom";
|
|
9
|
+
import { useForm as Gt, Controller as et } from "react-hook-form";
|
|
10
|
+
import { z as Ve } from "zod";
|
|
11
|
+
var ce = /* @__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))(ce || {}), gt = /* @__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))(gt || {}), ze = /* @__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))(ze || {}), Jt = /* @__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))(Jt || {}), Zt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Zt || {}), tt = /* @__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))(tt || {}), rt = /* @__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))(rt || {}), Xt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Xt || {}), er = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(er || {}), Oe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Oe || {}), tr = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(tr || {}), bt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(bt || {}), rr = /* @__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))(rr || {}), nr = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(nr || {}), ar = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(ar || {}), Ke = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Money = 2] = "Money", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ke || {}), ir = /* @__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))(ir || {}), sr = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(sr || {}), Ee = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Ee || {}), or = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(or || {});
|
|
12
|
+
const Je = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
15
15
|
CountryOfBirth: 30,
|
|
16
16
|
PhoneNumber: 40,
|
|
17
17
|
UboAddress: 50
|
|
18
|
-
},
|
|
18
|
+
}, nt = {
|
|
19
19
|
firstName: { label: "First Name", type: "text" },
|
|
20
20
|
lastName: { label: "Last Name", type: "text" },
|
|
21
21
|
email: { label: "Email", type: "email" },
|
|
@@ -23,27 +23,27 @@ const Ge = {
|
|
|
23
23
|
dateOfBirth: { label: "Date of Birth", type: "date" },
|
|
24
24
|
salutation: { label: "Salutation", type: "select" },
|
|
25
25
|
title: { label: "Title", type: "text" },
|
|
26
|
-
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType:
|
|
26
|
+
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType: Je.PhoneNumber },
|
|
27
27
|
street: { label: "Street", type: "text" },
|
|
28
28
|
streetNumber: { label: "Street Number", type: "text" },
|
|
29
29
|
zip: { label: "ZIP / Postal Code", type: "text" },
|
|
30
30
|
city: { label: "City", type: "text" },
|
|
31
|
-
country: { label: "Country", type: "select", countriesType:
|
|
32
|
-
nationality: { label: "Nationality", type: "select", countriesType:
|
|
33
|
-
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType:
|
|
34
|
-
countryOfBirth: { label: "Country of Birth", type: "select", countriesType:
|
|
31
|
+
country: { label: "Country", type: "select", countriesType: Je.Address },
|
|
32
|
+
nationality: { label: "Nationality", type: "select", countriesType: Je.Nationality },
|
|
33
|
+
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType: Je.Nationality },
|
|
34
|
+
countryOfBirth: { label: "Country of Birth", type: "select", countriesType: Je.CountryOfBirth },
|
|
35
35
|
placeOfBirth: { label: "Place of Birth", type: "text" },
|
|
36
|
-
taxCountry: { label: "Tax Country", type: "select", countriesType:
|
|
36
|
+
taxCountry: { label: "Tax Country", type: "select", countriesType: Je.Address },
|
|
37
37
|
taxNumber: { label: "Tax Number", type: "text" },
|
|
38
38
|
defaultLanguage: { label: "Default Language", type: "select" },
|
|
39
39
|
educationLevel: { label: "Education Level", type: "text" },
|
|
40
40
|
occupation: { label: "Occupation", type: "text" }
|
|
41
|
-
},
|
|
41
|
+
}, st = {
|
|
42
42
|
companyName: { label: "Company Name", type: "text" },
|
|
43
43
|
email: { label: "Email", type: "email" },
|
|
44
44
|
phone: { label: "Phone", type: "tel" },
|
|
45
45
|
registrationNumber: { label: "Registration Number", type: "text" },
|
|
46
|
-
countryResidence: { label: "Country of Residence", type: "select", countriesType:
|
|
46
|
+
countryResidence: { label: "Country of Residence", type: "select", countriesType: Je.Address },
|
|
47
47
|
legalAddress: { label: "Legal Address", type: "text" },
|
|
48
48
|
incorporatedOn: { label: "Incorporation Date", type: "date" },
|
|
49
49
|
controlScheme: { label: "Control Scheme", type: "text" },
|
|
@@ -56,20 +56,20 @@ const Ge = {
|
|
|
56
56
|
city: { label: "City", type: "text" },
|
|
57
57
|
state: { label: "State / Province", type: "text" },
|
|
58
58
|
postalCode: { label: "Postal Code", type: "text" },
|
|
59
|
-
addressCountry: { label: "Address Country", type: "select", countriesType:
|
|
59
|
+
addressCountry: { label: "Address Country", type: "select", countriesType: Je.Address },
|
|
60
60
|
lei: { label: "LEI", type: "text" }
|
|
61
|
-
},
|
|
61
|
+
}, lr = [
|
|
62
62
|
"companyName",
|
|
63
63
|
"email",
|
|
64
64
|
"phone",
|
|
65
65
|
"registrationNumber"
|
|
66
|
-
],
|
|
66
|
+
], cr = [
|
|
67
67
|
"firstName",
|
|
68
68
|
"lastName",
|
|
69
69
|
"email",
|
|
70
70
|
"phonenumber",
|
|
71
71
|
"dateOfBirth"
|
|
72
|
-
],
|
|
72
|
+
], It = [
|
|
73
73
|
{ value: "EN", label: "English" },
|
|
74
74
|
{ value: "DE", label: "German" },
|
|
75
75
|
{ value: "FR", label: "French" },
|
|
@@ -89,7 +89,7 @@ const Ge = {
|
|
|
89
89
|
{ value: "NO", label: "Norwegian" }
|
|
90
90
|
];
|
|
91
91
|
var Fe = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(Fe || {});
|
|
92
|
-
const
|
|
92
|
+
const dr = {
|
|
93
93
|
timeout: 3e4,
|
|
94
94
|
retries: 3,
|
|
95
95
|
locale: "en",
|
|
@@ -97,7 +97,7 @@ const cr = {
|
|
|
97
97
|
pattern: "host-controller"
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
class
|
|
100
|
+
class ur {
|
|
101
101
|
constructor(t) {
|
|
102
102
|
this.config = t;
|
|
103
103
|
}
|
|
@@ -137,19 +137,19 @@ class dr {
|
|
|
137
137
|
}[t] || t;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
class
|
|
140
|
+
class Ue extends Error {
|
|
141
141
|
constructor(n, a, i, o, c) {
|
|
142
142
|
super(n);
|
|
143
143
|
he(this, "response");
|
|
144
|
-
this.code = a, this.details = i, this.validationErrors = o, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this,
|
|
144
|
+
this.code = a, this.details = i, this.validationErrors = o, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, Ue.prototype);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
class
|
|
147
|
+
class dt {
|
|
148
148
|
/**
|
|
149
149
|
* Process an error from the API response
|
|
150
150
|
*/
|
|
151
151
|
static handleApiError(t) {
|
|
152
|
-
return new
|
|
152
|
+
return new Ue(
|
|
153
153
|
t.message || "An unknown error occurred",
|
|
154
154
|
t.code,
|
|
155
155
|
t.details || void 0,
|
|
@@ -162,44 +162,44 @@ class ct {
|
|
|
162
162
|
static handleAxiosError(t) {
|
|
163
163
|
if (t.response) {
|
|
164
164
|
const n = t.response.data;
|
|
165
|
-
return n && n.error ? new
|
|
165
|
+
return n && n.error ? new Ue(
|
|
166
166
|
n.error.message || "An unknown error occurred",
|
|
167
167
|
n.error.code,
|
|
168
168
|
n.error.details || void 0,
|
|
169
169
|
n.error.validationErrors || void 0,
|
|
170
170
|
t.response
|
|
171
|
-
) : n && n.result && n.result.message ? new
|
|
171
|
+
) : n && n.result && n.result.message ? new Ue(
|
|
172
172
|
n.result.message,
|
|
173
173
|
t.response.status,
|
|
174
174
|
`HTTP ${t.response.status}: ${t.response.statusText}`,
|
|
175
175
|
void 0,
|
|
176
176
|
t.response
|
|
177
|
-
) : new
|
|
177
|
+
) : new Ue(
|
|
178
178
|
(n == null ? void 0 : n.message) || t.message || "Request failed",
|
|
179
179
|
t.response.status,
|
|
180
180
|
`HTTP ${t.response.status}: ${t.response.statusText}`,
|
|
181
181
|
void 0,
|
|
182
182
|
t.response
|
|
183
183
|
);
|
|
184
|
-
} else return t.request ? new
|
|
184
|
+
} else return t.request ? new Ue(
|
|
185
185
|
"No response from server",
|
|
186
186
|
0,
|
|
187
187
|
"The request was made but no response was received. Please check your network connection."
|
|
188
|
-
) : new
|
|
188
|
+
) : new Ue(t.message || "An unexpected error occurred", 0, t.toString());
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
191
191
|
* Check if an error is a MetaKYCError
|
|
192
192
|
*/
|
|
193
193
|
static isMetaKYCError(t) {
|
|
194
|
-
return t instanceof
|
|
194
|
+
return t instanceof Ue;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
class
|
|
197
|
+
class pr {
|
|
198
198
|
constructor(t) {
|
|
199
199
|
he(this, "axiosInstance");
|
|
200
200
|
he(this, "endpointBuilder");
|
|
201
201
|
he(this, "config");
|
|
202
|
-
this.config = { ...
|
|
202
|
+
this.config = { ...dr, ...t }, this.endpointBuilder = new ur(this.config.endpoints), this.axiosInstance = qt.create({
|
|
203
203
|
baseURL: this.config.baseUrl,
|
|
204
204
|
timeout: this.config.timeout,
|
|
205
205
|
headers: {
|
|
@@ -235,7 +235,7 @@ class ur {
|
|
|
235
235
|
});
|
|
236
236
|
return this.handleResponse(o);
|
|
237
237
|
} catch (i) {
|
|
238
|
-
throw
|
|
238
|
+
throw dt.handleAxiosError(i);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
@@ -246,7 +246,7 @@ class ur {
|
|
|
246
246
|
const i = this.buildEndpoint(t, n), o = await this.axiosInstance.post(i, a);
|
|
247
247
|
return this.handleResponse(o);
|
|
248
248
|
} catch (i) {
|
|
249
|
-
throw
|
|
249
|
+
throw dt.handleAxiosError(i);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
/**
|
|
@@ -257,7 +257,7 @@ class ur {
|
|
|
257
257
|
const i = this.buildEndpoint(t, n), o = await this.axiosInstance.put(i, a);
|
|
258
258
|
return this.handleResponse(o);
|
|
259
259
|
} catch (i) {
|
|
260
|
-
throw
|
|
260
|
+
throw dt.handleAxiosError(i);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
@@ -270,7 +270,7 @@ class ur {
|
|
|
270
270
|
});
|
|
271
271
|
return this.handleResponse(o);
|
|
272
272
|
} catch (i) {
|
|
273
|
-
throw
|
|
273
|
+
throw dt.handleAxiosError(i);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
@@ -279,7 +279,7 @@ class ur {
|
|
|
279
279
|
handleResponse(t) {
|
|
280
280
|
const n = t.data;
|
|
281
281
|
if (!n.success && n.error)
|
|
282
|
-
throw
|
|
282
|
+
throw dt.handleApiError(n.error);
|
|
283
283
|
return n;
|
|
284
284
|
}
|
|
285
285
|
/**
|
|
@@ -289,7 +289,7 @@ class ur {
|
|
|
289
289
|
return this.axiosInstance;
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
class
|
|
292
|
+
class mr {
|
|
293
293
|
constructor(t) {
|
|
294
294
|
this.httpClient = t;
|
|
295
295
|
}
|
|
@@ -408,7 +408,7 @@ class pr {
|
|
|
408
408
|
)).result;
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
class
|
|
411
|
+
class yr {
|
|
412
412
|
constructor(t) {
|
|
413
413
|
this.httpClient = t;
|
|
414
414
|
}
|
|
@@ -435,7 +435,7 @@ class mr {
|
|
|
435
435
|
)).result;
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
class
|
|
438
|
+
class hr {
|
|
439
439
|
constructor(t) {
|
|
440
440
|
this.httpClient = t;
|
|
441
441
|
}
|
|
@@ -463,7 +463,7 @@ class yr {
|
|
|
463
463
|
await this.httpClient.post("UploadDocument", "ReviewUploadDocument", t);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
class
|
|
466
|
+
class fr {
|
|
467
467
|
constructor(t) {
|
|
468
468
|
this.httpClient = t;
|
|
469
469
|
}
|
|
@@ -489,7 +489,7 @@ class hr {
|
|
|
489
489
|
)).result;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
class
|
|
492
|
+
class gr {
|
|
493
493
|
constructor(t) {
|
|
494
494
|
this.httpClient = t;
|
|
495
495
|
}
|
|
@@ -511,7 +511,7 @@ class fr {
|
|
|
511
511
|
await this.httpClient.get("Applicant", "PassOverview", { applicantId: t });
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
class
|
|
514
|
+
class br {
|
|
515
515
|
constructor(t) {
|
|
516
516
|
this.httpClient = t;
|
|
517
517
|
}
|
|
@@ -546,7 +546,7 @@ class gr {
|
|
|
546
546
|
)).result;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
class
|
|
549
|
+
class xr {
|
|
550
550
|
constructor(t) {
|
|
551
551
|
this.httpClient = t;
|
|
552
552
|
}
|
|
@@ -614,7 +614,7 @@ class br {
|
|
|
614
614
|
return console.log("[IdentityService] Sumsub token refresh result:", n), n.result.accessToken;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
class
|
|
617
|
+
class vr {
|
|
618
618
|
constructor(t) {
|
|
619
619
|
this.httpClient = t;
|
|
620
620
|
}
|
|
@@ -650,7 +650,7 @@ class xr {
|
|
|
650
650
|
)).result;
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
class
|
|
653
|
+
class kr {
|
|
654
654
|
constructor(t) {
|
|
655
655
|
this.httpClient = t;
|
|
656
656
|
}
|
|
@@ -735,7 +735,7 @@ const Le = {
|
|
|
735
735
|
textMuted: "#9ca3af"
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
},
|
|
738
|
+
}, wr = {
|
|
739
739
|
name: "Corporate",
|
|
740
740
|
logo: {
|
|
741
741
|
url: "",
|
|
@@ -768,7 +768,7 @@ const Le = {
|
|
|
768
768
|
cardPadding: "1.5rem",
|
|
769
769
|
inputHeight: "2.5rem"
|
|
770
770
|
}
|
|
771
|
-
},
|
|
771
|
+
}, Sr = {
|
|
772
772
|
name: "Fintech",
|
|
773
773
|
logo: {
|
|
774
774
|
url: "",
|
|
@@ -801,7 +801,7 @@ const Le = {
|
|
|
801
801
|
cardPadding: "2rem",
|
|
802
802
|
inputHeight: "3rem"
|
|
803
803
|
}
|
|
804
|
-
},
|
|
804
|
+
}, Cr = {
|
|
805
805
|
name: "Healthcare",
|
|
806
806
|
logo: {
|
|
807
807
|
url: "",
|
|
@@ -843,7 +843,7 @@ const Le = {
|
|
|
843
843
|
textSecondary: "#CBD5E1"
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
},
|
|
846
|
+
}, Nr = {
|
|
847
847
|
name: "Modern",
|
|
848
848
|
logo: {
|
|
849
849
|
url: "",
|
|
@@ -876,7 +876,7 @@ const Le = {
|
|
|
876
876
|
cardPadding: "2rem",
|
|
877
877
|
inputHeight: "3rem"
|
|
878
878
|
}
|
|
879
|
-
},
|
|
879
|
+
}, Rr = {
|
|
880
880
|
name: "Minimal",
|
|
881
881
|
logo: {
|
|
882
882
|
url: "",
|
|
@@ -909,18 +909,18 @@ const Le = {
|
|
|
909
909
|
cardPadding: "1.25rem",
|
|
910
910
|
inputHeight: "2.25rem"
|
|
911
911
|
}
|
|
912
|
-
},
|
|
912
|
+
}, Ir = {
|
|
913
913
|
[Fe.Default]: Le,
|
|
914
|
-
[Fe.Corporate]:
|
|
915
|
-
[Fe.Fintech]:
|
|
916
|
-
[Fe.Healthcare]:
|
|
917
|
-
[Fe.Modern]:
|
|
918
|
-
[Fe.Minimal]:
|
|
914
|
+
[Fe.Corporate]: wr,
|
|
915
|
+
[Fe.Fintech]: Sr,
|
|
916
|
+
[Fe.Healthcare]: Cr,
|
|
917
|
+
[Fe.Modern]: Nr,
|
|
918
|
+
[Fe.Minimal]: Rr
|
|
919
919
|
};
|
|
920
|
-
function
|
|
921
|
-
return
|
|
920
|
+
function ut(e) {
|
|
921
|
+
return Ir[e] || Le;
|
|
922
922
|
}
|
|
923
|
-
class
|
|
923
|
+
class Er {
|
|
924
924
|
constructor(t) {
|
|
925
925
|
this.httpClient = t;
|
|
926
926
|
}
|
|
@@ -935,8 +935,8 @@ class Ir {
|
|
|
935
935
|
"GetThemeConfiguration"
|
|
936
936
|
);
|
|
937
937
|
if (!n.result.isEnabled)
|
|
938
|
-
return
|
|
939
|
-
let a = n.result.preset ?
|
|
938
|
+
return ut(Fe.Default);
|
|
939
|
+
let a = n.result.preset ? ut(n.result.preset) : ut(Fe.Default);
|
|
940
940
|
if (n.result.title && (a.title = n.result.title), n.result.logo && (a.logo = { ...a.logo, ...n.result.logo }), n.result.colors && (a.colors = { ...a.colors, ...n.result.colors }), n.result.typography && (a.typography = { ...a.typography, ...n.result.typography }), n.result.spacing && (a.spacing = { ...a.spacing, ...n.result.spacing }), n.result.customCSS && (a.customCSS = n.result.customCSS), n.result.darkMode && (a.darkMode = {
|
|
941
941
|
colors: {
|
|
942
942
|
...(t = a.darkMode) == null ? void 0 : t.colors,
|
|
@@ -949,9 +949,9 @@ class Ir {
|
|
|
949
949
|
const c = !o._v || o._v < 4;
|
|
950
950
|
return {
|
|
951
951
|
...o,
|
|
952
|
-
fields: (o.fields || []).map((
|
|
953
|
-
...
|
|
954
|
-
colSpan: c ?
|
|
952
|
+
fields: (o.fields || []).map((d) => ({
|
|
953
|
+
...d,
|
|
954
|
+
colSpan: c ? d.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, d.colSpan ?? 4))
|
|
955
955
|
}))
|
|
956
956
|
};
|
|
957
957
|
}));
|
|
@@ -970,9 +970,9 @@ class Ir {
|
|
|
970
970
|
const c = !o._v || o._v < 4;
|
|
971
971
|
return {
|
|
972
972
|
...o,
|
|
973
|
-
fields: (o.fields || []).map((
|
|
974
|
-
...
|
|
975
|
-
colSpan: c ?
|
|
973
|
+
fields: (o.fields || []).map((d) => ({
|
|
974
|
+
...d,
|
|
975
|
+
colSpan: c ? d.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, d.colSpan ?? 4))
|
|
976
976
|
}))
|
|
977
977
|
};
|
|
978
978
|
}));
|
|
@@ -986,7 +986,7 @@ class Ir {
|
|
|
986
986
|
}
|
|
987
987
|
return a;
|
|
988
988
|
} catch (n) {
|
|
989
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", n),
|
|
989
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", n), ut(Fe.Default);
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
/**
|
|
@@ -1012,7 +1012,7 @@ class Ir {
|
|
|
1012
1012
|
* Preview theme (doesn't save)
|
|
1013
1013
|
*/
|
|
1014
1014
|
getPreviewTheme(t, n) {
|
|
1015
|
-
const a =
|
|
1015
|
+
const a = ut(t);
|
|
1016
1016
|
return n ? {
|
|
1017
1017
|
...a,
|
|
1018
1018
|
...n,
|
|
@@ -1023,7 +1023,7 @@ class Ir {
|
|
|
1023
1023
|
} : a;
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
|
-
class
|
|
1026
|
+
class Fr {
|
|
1027
1027
|
constructor() {
|
|
1028
1028
|
he(this, "listeners", /* @__PURE__ */ new Map());
|
|
1029
1029
|
}
|
|
@@ -1068,9 +1068,9 @@ class Er {
|
|
|
1068
1068
|
this.listeners.delete(t);
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
|
-
class
|
|
1071
|
+
class Ar {
|
|
1072
1072
|
constructor() {
|
|
1073
|
-
he(this, "events", new
|
|
1073
|
+
he(this, "events", new Fr());
|
|
1074
1074
|
he(this, "_applicantId", null);
|
|
1075
1075
|
he(this, "_progress", null);
|
|
1076
1076
|
he(this, "_error", null);
|
|
@@ -1208,7 +1208,7 @@ class Fr {
|
|
|
1208
1208
|
this.events.clear();
|
|
1209
1209
|
}
|
|
1210
1210
|
}
|
|
1211
|
-
class
|
|
1211
|
+
class Pr {
|
|
1212
1212
|
constructor() {
|
|
1213
1213
|
he(this, "handlers", /* @__PURE__ */ new Map());
|
|
1214
1214
|
}
|
|
@@ -1250,10 +1250,10 @@ class Ar {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
}
|
|
1252
1252
|
class Tr {
|
|
1253
|
-
constructor(t, n, a, i, o, c,
|
|
1253
|
+
constructor(t, n, a, i, o, c, d, y) {
|
|
1254
1254
|
he(this, "state");
|
|
1255
1255
|
he(this, "stepRouter");
|
|
1256
|
-
this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = o, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new
|
|
1256
|
+
this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = o, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new Ar(), this.stepRouter = new Pr(), this.registerStepHandlers();
|
|
1257
1257
|
}
|
|
1258
1258
|
/**
|
|
1259
1259
|
* Register all step handlers
|
|
@@ -1393,7 +1393,7 @@ class Tr {
|
|
|
1393
1393
|
return this.stepRouter;
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function Mt(e, t) {
|
|
1397
1397
|
return new Promise((n, a) => {
|
|
1398
1398
|
if (t && document.getElementById(t)) {
|
|
1399
1399
|
n();
|
|
@@ -1403,86 +1403,102 @@ function Dt(e, t) {
|
|
|
1403
1403
|
i.src = e, t && (i.id = t), i.async = !0, i.onload = () => n(), i.onerror = () => a(new Error(`Failed to load script: ${e}`)), document.head.appendChild(i);
|
|
1404
1404
|
});
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1406
|
+
function Wn(e) {
|
|
1407
1407
|
return !!document.getElementById(e);
|
|
1408
1408
|
}
|
|
1409
|
-
function
|
|
1409
|
+
function Un(e) {
|
|
1410
1410
|
const t = document.getElementById(e);
|
|
1411
1411
|
t && t.remove();
|
|
1412
1412
|
}
|
|
1413
|
-
const
|
|
1414
|
-
function
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
}
|
|
1431
|
-
section.content {
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
}
|
|
1439
|
-
input {
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
}
|
|
1470
|
-
button.
|
|
1471
|
-
|
|
1472
|
-
}
|
|
1473
|
-
.
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1413
|
+
const Lr = "https://static.sumsub.com/idensic/static/sns-websdk-builder.js";
|
|
1414
|
+
function We(e, t) {
|
|
1415
|
+
try {
|
|
1416
|
+
return getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
|
|
1417
|
+
} catch {
|
|
1418
|
+
return t;
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
function Dr() {
|
|
1422
|
+
const e = We("--metakyc-primary", "#2563eb"), t = We("--metakyc-primary-hover", "#1d4ed8"), n = We("--metakyc-background", "#ffffff"), a = We("--metakyc-surface", "#f9fafb"), i = We("--metakyc-text-primary", "#111827"), o = We("--metakyc-text-secondary", "#6b7280"), c = We("--metakyc-text-muted", "#9ca3af"), d = We("--metakyc-border", "#e5e7eb");
|
|
1423
|
+
return [
|
|
1424
|
+
`body, html { font-family: ${We(
|
|
1425
|
+
"--metakyc-font-family",
|
|
1426
|
+
"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"
|
|
1427
|
+
)} !important; background-color: ${n} !important; }`,
|
|
1428
|
+
`p, span, label, div { color: ${i}; }`,
|
|
1429
|
+
`h1, h2, h3, h4 { color: ${i}; }`,
|
|
1430
|
+
`.step-desc { color: ${o}; }`,
|
|
1431
|
+
"section.content {",
|
|
1432
|
+
` background-color: ${a};`,
|
|
1433
|
+
` color: ${i};`,
|
|
1434
|
+
" padding: 32px 32px 16px;",
|
|
1435
|
+
" box-shadow: none;",
|
|
1436
|
+
" border-radius: 10px;",
|
|
1437
|
+
` border: 1px solid ${d};`,
|
|
1438
|
+
"}",
|
|
1439
|
+
"input {",
|
|
1440
|
+
` color: ${i};`,
|
|
1441
|
+
" font-weight: 500;",
|
|
1442
|
+
" outline: none;",
|
|
1443
|
+
` background-color: ${n};`,
|
|
1444
|
+
` border: 1px solid ${d};`,
|
|
1445
|
+
" border-radius: 6px;",
|
|
1446
|
+
"}",
|
|
1447
|
+
"input:focus {",
|
|
1448
|
+
` border-color: ${e};`,
|
|
1449
|
+
` box-shadow: 0 0 0 2px ${e}33;`,
|
|
1450
|
+
"}",
|
|
1451
|
+
"button.submit, button.back {",
|
|
1452
|
+
" border-radius: 8px;",
|
|
1453
|
+
" height: 44px;",
|
|
1454
|
+
" padding: 0 24px;",
|
|
1455
|
+
" font-size: 14px;",
|
|
1456
|
+
" font-weight: 600;",
|
|
1457
|
+
" background-image: none !important;",
|
|
1458
|
+
" transform: none !important;",
|
|
1459
|
+
" box-shadow: none !important;",
|
|
1460
|
+
" transition: all 0.15s ease;",
|
|
1461
|
+
" cursor: pointer;",
|
|
1462
|
+
"}",
|
|
1463
|
+
"button.submit {",
|
|
1464
|
+
" min-width: 120px;",
|
|
1465
|
+
" background: none;",
|
|
1466
|
+
` background-color: ${e};`,
|
|
1467
|
+
" color: #ffffff;",
|
|
1468
|
+
" border: none;",
|
|
1469
|
+
"}",
|
|
1470
|
+
"button.submit:hover {",
|
|
1471
|
+
` background-color: ${t};`,
|
|
1472
|
+
"}",
|
|
1473
|
+
"button.back {",
|
|
1474
|
+
" background: none;",
|
|
1475
|
+
` background-color: ${n};`,
|
|
1476
|
+
` border: 1px solid ${d};`,
|
|
1477
|
+
` color: ${i};`,
|
|
1478
|
+
"}",
|
|
1479
|
+
"button.back:hover {",
|
|
1480
|
+
` background-color: ${a};`,
|
|
1481
|
+
"}",
|
|
1482
|
+
".round-icon {",
|
|
1483
|
+
` background-color: ${e} !important;`,
|
|
1484
|
+
" background-image: none !important;",
|
|
1485
|
+
"}",
|
|
1486
|
+
".upload-item, .document-status {",
|
|
1487
|
+
` border-color: ${d} !important;`,
|
|
1488
|
+
"}",
|
|
1489
|
+
"select {",
|
|
1490
|
+
` background-color: ${n};`,
|
|
1491
|
+
` color: ${i};`,
|
|
1492
|
+
` border: 1px solid ${d};`,
|
|
1493
|
+
" border-radius: 6px;",
|
|
1494
|
+
"}",
|
|
1495
|
+
`.description { color: ${o}; }`,
|
|
1496
|
+
`.subtitle { color: ${c}; }`,
|
|
1497
|
+
`a { color: ${e}; }`,
|
|
1498
|
+
`a:hover { color: ${t}; }`
|
|
1499
|
+
].join(" ");
|
|
1484
1500
|
}
|
|
1485
|
-
class
|
|
1501
|
+
class Mr {
|
|
1486
1502
|
constructor(t) {
|
|
1487
1503
|
he(this, "sdk", null);
|
|
1488
1504
|
he(this, "config");
|
|
@@ -1491,13 +1507,13 @@ class Dr {
|
|
|
1491
1507
|
this.config = t;
|
|
1492
1508
|
}
|
|
1493
1509
|
async loadSDK() {
|
|
1494
|
-
if (!window.snsWebSdk && (await
|
|
1510
|
+
if (!window.snsWebSdk && (await Mt(Lr, "sumsub-websdk"), !window.snsWebSdk))
|
|
1495
1511
|
throw new Error("Sumsub Web SDK failed to load from CDN");
|
|
1496
1512
|
}
|
|
1497
1513
|
async initialize(t) {
|
|
1498
1514
|
await this.loadSDK();
|
|
1499
1515
|
const n = {};
|
|
1500
|
-
this.config.customCss && (n.customCss = this.config.customCss), n.customCssStr =
|
|
1516
|
+
this.config.customCss && (n.customCss = this.config.customCss), n.customCssStr = Dr();
|
|
1501
1517
|
const a = window.snsWebSdk.init(
|
|
1502
1518
|
this.config.accessToken,
|
|
1503
1519
|
() => this.config.onTokenRefresh()
|
|
@@ -1540,7 +1556,7 @@ class Dr {
|
|
|
1540
1556
|
this.errorCallback = t;
|
|
1541
1557
|
}
|
|
1542
1558
|
}
|
|
1543
|
-
class
|
|
1559
|
+
class Or {
|
|
1544
1560
|
constructor(t) {
|
|
1545
1561
|
he(this, "sdk", null);
|
|
1546
1562
|
he(this, "config");
|
|
@@ -1550,7 +1566,7 @@ class Mr {
|
|
|
1550
1566
|
* Load Onfido SDK
|
|
1551
1567
|
*/
|
|
1552
1568
|
async loadSDK() {
|
|
1553
|
-
await
|
|
1569
|
+
await Mt(
|
|
1554
1570
|
"https://sdk.onfido.com/v12.0.0/onfido.min.js",
|
|
1555
1571
|
"onfido-sdk"
|
|
1556
1572
|
);
|
|
@@ -1606,7 +1622,7 @@ class Mr {
|
|
|
1606
1622
|
this.sdk && (this.sdk.tearDown(), this.sdk = null);
|
|
1607
1623
|
}
|
|
1608
1624
|
}
|
|
1609
|
-
class
|
|
1625
|
+
class zr {
|
|
1610
1626
|
constructor(t) {
|
|
1611
1627
|
he(this, "sardineContext", null);
|
|
1612
1628
|
he(this, "config");
|
|
@@ -1681,12 +1697,12 @@ class Or {
|
|
|
1681
1697
|
// Default false
|
|
1682
1698
|
region: this.config.region,
|
|
1683
1699
|
// Callback for device response (deprecated but kept for compatibility)
|
|
1684
|
-
onDeviceResponse: (
|
|
1685
|
-
console.log(`[SardinAI] Device ID: ${
|
|
1700
|
+
onDeviceResponse: (d) => {
|
|
1701
|
+
console.log(`[SardinAI] Device ID: ${d.deviceId}`);
|
|
1686
1702
|
},
|
|
1687
1703
|
// New callback for session updates
|
|
1688
|
-
onConfigUpdate: (
|
|
1689
|
-
switch (
|
|
1704
|
+
onConfigUpdate: (d, y, p) => {
|
|
1705
|
+
switch (d) {
|
|
1690
1706
|
case "SESSION_UPDATE_FAILED":
|
|
1691
1707
|
console.error("[SardinAI] Session update failed:", p);
|
|
1692
1708
|
break;
|
|
@@ -1697,7 +1713,7 @@ class Or {
|
|
|
1697
1713
|
console.log("[SardinAI] No session update");
|
|
1698
1714
|
break;
|
|
1699
1715
|
default:
|
|
1700
|
-
console.warn("[SardinAI] Unknown event:",
|
|
1716
|
+
console.warn("[SardinAI] Unknown event:", d);
|
|
1701
1717
|
}
|
|
1702
1718
|
}
|
|
1703
1719
|
}), this.addNoScriptFallback(t), console.log("[SardinAI] SDK initialized with sessionKey:", this.sessionKey);
|
|
@@ -1750,18 +1766,18 @@ class Or {
|
|
|
1750
1766
|
this.sardineContext && (this.sardineContext = null);
|
|
1751
1767
|
}
|
|
1752
1768
|
}
|
|
1753
|
-
class
|
|
1769
|
+
class Ge {
|
|
1754
1770
|
/**
|
|
1755
1771
|
* Create a provider instance
|
|
1756
1772
|
*/
|
|
1757
1773
|
static createProvider(t, n) {
|
|
1758
1774
|
switch (t) {
|
|
1759
1775
|
case Oe.Sumsub:
|
|
1760
|
-
return new Dr(n);
|
|
1761
|
-
case Oe.Onfido:
|
|
1762
1776
|
return new Mr(n);
|
|
1763
|
-
case Oe.
|
|
1777
|
+
case Oe.Onfido:
|
|
1764
1778
|
return new Or(n);
|
|
1779
|
+
case Oe.SardinAI:
|
|
1780
|
+
return new zr(n);
|
|
1765
1781
|
default:
|
|
1766
1782
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
1767
1783
|
}
|
|
@@ -1789,22 +1805,22 @@ class Qe {
|
|
|
1789
1805
|
token: n.token || n.sdkToken
|
|
1790
1806
|
};
|
|
1791
1807
|
case Oe.SardinAI:
|
|
1792
|
-
const
|
|
1808
|
+
const d = ((o = a == null ? void 0 : a.identityProviders) == null ? void 0 : o.sardinai) || {};
|
|
1793
1809
|
return {
|
|
1794
|
-
clientId:
|
|
1795
|
-
sessionKey:
|
|
1796
|
-
environment:
|
|
1797
|
-
flow:
|
|
1798
|
-
region:
|
|
1799
|
-
enableBiometrics:
|
|
1800
|
-
enablePortScanning:
|
|
1810
|
+
clientId: d.clientId || n.clientId,
|
|
1811
|
+
sessionKey: d.sessionKey || n.sessionKey,
|
|
1812
|
+
environment: d.environment || n.environment || "production",
|
|
1813
|
+
flow: d.flow || n.flow,
|
|
1814
|
+
region: d.region,
|
|
1815
|
+
enableBiometrics: d.enableBiometrics,
|
|
1816
|
+
enablePortScanning: d.enablePortScanning
|
|
1801
1817
|
};
|
|
1802
1818
|
default:
|
|
1803
1819
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
1804
1820
|
}
|
|
1805
1821
|
}
|
|
1806
1822
|
}
|
|
1807
|
-
function
|
|
1823
|
+
function $r() {
|
|
1808
1824
|
return `
|
|
1809
1825
|
/* ── metakyc-input-colors (ThemeManager failsafe — same rules as globals.css) ── */
|
|
1810
1826
|
.metakyc-sdk input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
|
|
@@ -1921,7 +1937,7 @@ class Br {
|
|
|
1921
1937
|
* These rules are placed BEFORE any custom CSS so that custom CSS can still override them.
|
|
1922
1938
|
*/
|
|
1923
1939
|
injectInputColors() {
|
|
1924
|
-
this.inputStyleElement && this.inputStyleElement.remove(), this.inputStyleElement = document.createElement("style"), this.inputStyleElement.id = "metakyc-input-colors", this.inputStyleElement.textContent =
|
|
1940
|
+
this.inputStyleElement && this.inputStyleElement.remove(), this.inputStyleElement = document.createElement("style"), this.inputStyleElement.id = "metakyc-input-colors", this.inputStyleElement.textContent = $r(), this.customStyleElement && this.customStyleElement.parentNode ? document.head.insertBefore(this.inputStyleElement, this.customStyleElement) : document.head.appendChild(this.inputStyleElement);
|
|
1925
1941
|
}
|
|
1926
1942
|
/**
|
|
1927
1943
|
* Inject custom CSS into document
|
|
@@ -1986,24 +2002,24 @@ class Br {
|
|
|
1986
2002
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1987
2003
|
}
|
|
1988
2004
|
}
|
|
1989
|
-
const
|
|
2005
|
+
const Ot = Vt(null), Kn = ({ config: e, children: t }) => {
|
|
1990
2006
|
const [n, a] = k(null), i = we.useRef(!1), o = we.useRef(!1), c = De(() => {
|
|
1991
|
-
const y = new
|
|
2007
|
+
const y = new pr(e), p = new mr(y), x = new yr(y), T = new hr(y), v = new fr(y), A = new gr(y), P = new br(y), w = new xr(y), N = new vr(y), z = new kr(y), Q = new Er(y), M = new Br();
|
|
1992
2008
|
return {
|
|
1993
2009
|
httpClient: y,
|
|
1994
2010
|
applicantService: p,
|
|
1995
2011
|
questionnaireService: x,
|
|
1996
|
-
uploadDocumentService:
|
|
2012
|
+
uploadDocumentService: T,
|
|
1997
2013
|
appropriatenessTestService: v,
|
|
1998
2014
|
overviewService: A,
|
|
1999
|
-
riskScoringService:
|
|
2015
|
+
riskScoringService: P,
|
|
2000
2016
|
identityService: w,
|
|
2001
2017
|
baseInformationService: N,
|
|
2002
2018
|
investorCategorizationService: z,
|
|
2003
2019
|
themeService: Q,
|
|
2004
2020
|
themeManager: M
|
|
2005
2021
|
};
|
|
2006
|
-
}, [e]),
|
|
2022
|
+
}, [e]), d = De(() => ({
|
|
2007
2023
|
config: e,
|
|
2008
2024
|
...c,
|
|
2009
2025
|
currentTheme: n,
|
|
@@ -2039,15 +2055,15 @@ const Mt = qt(null), Un = ({ config: e, children: t }) => {
|
|
|
2039
2055
|
}
|
|
2040
2056
|
})(), () => {
|
|
2041
2057
|
c.themeManager.cleanup();
|
|
2042
|
-
}), []), /* @__PURE__ */ r(
|
|
2058
|
+
}), []), /* @__PURE__ */ r(Ot.Provider, { value: d, children: t });
|
|
2043
2059
|
};
|
|
2044
|
-
function
|
|
2045
|
-
const e =
|
|
2060
|
+
function Pe() {
|
|
2061
|
+
const e = Yt(Ot);
|
|
2046
2062
|
if (!e)
|
|
2047
2063
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
2048
2064
|
return e;
|
|
2049
2065
|
}
|
|
2050
|
-
async function
|
|
2066
|
+
async function _r(e) {
|
|
2051
2067
|
return new Promise((t, n) => {
|
|
2052
2068
|
const a = new FileReader();
|
|
2053
2069
|
a.readAsDataURL(e), a.onload = () => {
|
|
@@ -2056,10 +2072,10 @@ async function $r(e) {
|
|
|
2056
2072
|
}, a.onerror = (i) => n(i);
|
|
2057
2073
|
});
|
|
2058
2074
|
}
|
|
2059
|
-
function
|
|
2075
|
+
function qn(e, t) {
|
|
2060
2076
|
return e.size <= t;
|
|
2061
2077
|
}
|
|
2062
|
-
function
|
|
2078
|
+
function Vn(e, t) {
|
|
2063
2079
|
return t.split(",").map((a) => a.trim()).some((a) => {
|
|
2064
2080
|
if (a.endsWith("/*")) {
|
|
2065
2081
|
const i = a.slice(0, -2);
|
|
@@ -2068,75 +2084,75 @@ function qn(e, t) {
|
|
|
2068
2084
|
return e.type === a;
|
|
2069
2085
|
});
|
|
2070
2086
|
}
|
|
2071
|
-
function
|
|
2087
|
+
function xt(e) {
|
|
2072
2088
|
if (e === 0) return "0 Bytes";
|
|
2073
2089
|
const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
|
2074
2090
|
return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
|
|
2075
2091
|
}
|
|
2076
|
-
function
|
|
2092
|
+
function Yn(e) {
|
|
2077
2093
|
return e;
|
|
2078
2094
|
}
|
|
2079
2095
|
function Ae(...e) {
|
|
2080
2096
|
return e.filter(Boolean).join(" ");
|
|
2081
2097
|
}
|
|
2082
|
-
const
|
|
2098
|
+
const ct = {
|
|
2083
2099
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
2084
2100
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
2085
2101
|
};
|
|
2086
|
-
function
|
|
2102
|
+
function jr(e) {
|
|
2087
2103
|
try {
|
|
2088
|
-
localStorage.setItem(
|
|
2104
|
+
localStorage.setItem(ct.APPLICANT_ID, e.toString());
|
|
2089
2105
|
} catch (t) {
|
|
2090
2106
|
console.warn("Failed to save applicant ID to storage:", t);
|
|
2091
2107
|
}
|
|
2092
2108
|
}
|
|
2093
|
-
function
|
|
2109
|
+
function Hr() {
|
|
2094
2110
|
try {
|
|
2095
|
-
const e = localStorage.getItem(
|
|
2111
|
+
const e = localStorage.getItem(ct.APPLICANT_ID);
|
|
2096
2112
|
return e ? parseInt(e, 10) : null;
|
|
2097
2113
|
} catch (e) {
|
|
2098
2114
|
return console.warn("Failed to retrieve applicant ID from storage:", e), null;
|
|
2099
2115
|
}
|
|
2100
2116
|
}
|
|
2101
|
-
function
|
|
2117
|
+
function Wr() {
|
|
2102
2118
|
try {
|
|
2103
|
-
localStorage.removeItem(
|
|
2119
|
+
localStorage.removeItem(ct.APPLICANT_ID);
|
|
2104
2120
|
} catch (e) {
|
|
2105
2121
|
console.warn("Failed to clear applicant ID from storage:", e);
|
|
2106
2122
|
}
|
|
2107
2123
|
}
|
|
2108
|
-
function
|
|
2124
|
+
function Ur(e) {
|
|
2109
2125
|
try {
|
|
2110
|
-
localStorage.setItem(
|
|
2126
|
+
localStorage.setItem(ct.WORKFLOW_STATE, JSON.stringify(e));
|
|
2111
2127
|
} catch (t) {
|
|
2112
2128
|
console.warn("Failed to save workflow state to storage:", t);
|
|
2113
2129
|
}
|
|
2114
2130
|
}
|
|
2115
|
-
function
|
|
2131
|
+
function Qn() {
|
|
2116
2132
|
try {
|
|
2117
|
-
const e = localStorage.getItem(
|
|
2133
|
+
const e = localStorage.getItem(ct.WORKFLOW_STATE);
|
|
2118
2134
|
return e ? JSON.parse(e) : null;
|
|
2119
2135
|
} catch (e) {
|
|
2120
2136
|
return console.warn("Failed to retrieve workflow state from storage:", e), null;
|
|
2121
2137
|
}
|
|
2122
2138
|
}
|
|
2123
|
-
function
|
|
2139
|
+
function Kr() {
|
|
2124
2140
|
try {
|
|
2125
|
-
localStorage.removeItem(
|
|
2141
|
+
localStorage.removeItem(ct.WORKFLOW_STATE);
|
|
2126
2142
|
} catch (e) {
|
|
2127
2143
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
2128
2144
|
}
|
|
2129
2145
|
}
|
|
2130
|
-
function
|
|
2131
|
-
|
|
2146
|
+
function Gn() {
|
|
2147
|
+
Wr(), Kr();
|
|
2132
2148
|
}
|
|
2133
|
-
function
|
|
2134
|
-
const { createOrchestrator: t } =
|
|
2149
|
+
function qr(e) {
|
|
2150
|
+
const { createOrchestrator: t } = Pe(), [n, a] = k(null), [i, o] = k(!1), [c, d] = k(null), y = de(null), p = e || Hr();
|
|
2135
2151
|
ge(() => {
|
|
2136
2152
|
y.current || (y.current = t());
|
|
2137
2153
|
}, [t]), ge(() => {
|
|
2138
2154
|
var M;
|
|
2139
|
-
n && p && (
|
|
2155
|
+
n && p && (jr(p), Ur({
|
|
2140
2156
|
applicantId: p,
|
|
2141
2157
|
currentStepOrder: (M = n.currentStep) == null ? void 0 : M.order,
|
|
2142
2158
|
status: n.status,
|
|
@@ -2145,25 +2161,25 @@ function Kr(e) {
|
|
|
2145
2161
|
nextWorkflowKey: n.nextWorkflowKey
|
|
2146
2162
|
}));
|
|
2147
2163
|
}, [n, p]);
|
|
2148
|
-
const x = de(!1),
|
|
2164
|
+
const x = de(!1), T = de(!1), v = ae(async () => {
|
|
2149
2165
|
if (!(!p || !y.current)) {
|
|
2150
2166
|
if (x.current) {
|
|
2151
2167
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
2152
2168
|
return;
|
|
2153
2169
|
}
|
|
2154
|
-
x.current = !0, o(!0),
|
|
2170
|
+
x.current = !0, o(!0), d(null);
|
|
2155
2171
|
try {
|
|
2156
2172
|
const M = await y.current.initialize(p);
|
|
2157
|
-
a(M),
|
|
2173
|
+
a(M), T.current = !0;
|
|
2158
2174
|
} catch (M) {
|
|
2159
|
-
|
|
2175
|
+
d(M);
|
|
2160
2176
|
} finally {
|
|
2161
2177
|
o(!1), x.current = !1;
|
|
2162
2178
|
}
|
|
2163
2179
|
}
|
|
2164
2180
|
}, [p]);
|
|
2165
2181
|
ge(() => {
|
|
2166
|
-
p && !
|
|
2182
|
+
p && !T.current && v();
|
|
2167
2183
|
}, [p, v]);
|
|
2168
2184
|
const A = ae(async () => {
|
|
2169
2185
|
if (y.current) {
|
|
@@ -2171,54 +2187,54 @@ function Kr(e) {
|
|
|
2171
2187
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
2172
2188
|
return;
|
|
2173
2189
|
}
|
|
2174
|
-
x.current = !0, o(!0),
|
|
2190
|
+
x.current = !0, o(!0), d(null);
|
|
2175
2191
|
try {
|
|
2176
2192
|
const M = await y.current.refreshProgress();
|
|
2177
2193
|
a(M);
|
|
2178
2194
|
} catch (M) {
|
|
2179
|
-
|
|
2195
|
+
d(M);
|
|
2180
2196
|
} finally {
|
|
2181
2197
|
o(!1), x.current = !1;
|
|
2182
2198
|
}
|
|
2183
2199
|
}
|
|
2184
|
-
}, []),
|
|
2200
|
+
}, []), P = ae(async () => {
|
|
2185
2201
|
if (y.current) {
|
|
2186
|
-
o(!0),
|
|
2202
|
+
o(!0), d(null);
|
|
2187
2203
|
try {
|
|
2188
2204
|
const M = await y.current.moveToNextStep();
|
|
2189
2205
|
a(M);
|
|
2190
2206
|
} catch (M) {
|
|
2191
|
-
|
|
2207
|
+
d(M);
|
|
2192
2208
|
} finally {
|
|
2193
2209
|
o(!1);
|
|
2194
2210
|
}
|
|
2195
2211
|
}
|
|
2196
2212
|
}, []), w = ae(async () => {
|
|
2197
2213
|
if (y.current) {
|
|
2198
|
-
o(!0),
|
|
2214
|
+
o(!0), d(null);
|
|
2199
2215
|
try {
|
|
2200
2216
|
const M = await y.current.moveToPreviousStep();
|
|
2201
2217
|
a(M);
|
|
2202
2218
|
} catch (M) {
|
|
2203
|
-
|
|
2219
|
+
d(M);
|
|
2204
2220
|
} finally {
|
|
2205
2221
|
o(!1);
|
|
2206
2222
|
}
|
|
2207
2223
|
}
|
|
2208
2224
|
}, []), N = ae(async (M) => {
|
|
2209
2225
|
if (y.current) {
|
|
2210
|
-
o(!0),
|
|
2226
|
+
o(!0), d(null);
|
|
2211
2227
|
try {
|
|
2212
2228
|
await y.current.submitCurrentStep(M);
|
|
2213
2229
|
const j = await y.current.refreshProgress();
|
|
2214
2230
|
a(j);
|
|
2215
2231
|
} catch (j) {
|
|
2216
|
-
throw
|
|
2232
|
+
throw d(j), j;
|
|
2217
2233
|
} finally {
|
|
2218
2234
|
o(!1);
|
|
2219
2235
|
}
|
|
2220
2236
|
}
|
|
2221
|
-
}, []), z =
|
|
2237
|
+
}, []), z = Rt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, j) => M.order - j.order) : [], [n == null ? void 0 : n.stepInfoList]), Q = Rt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2222
2238
|
return {
|
|
2223
2239
|
progress: n,
|
|
2224
2240
|
applicantId: p,
|
|
@@ -2234,14 +2250,14 @@ function Kr(e) {
|
|
|
2234
2250
|
isComplete: (n == null ? void 0 : n.status) === ze.Finished,
|
|
2235
2251
|
isOnHold: (n == null ? void 0 : n.status) === ze.OnHold,
|
|
2236
2252
|
refreshProgress: A,
|
|
2237
|
-
moveToNext:
|
|
2253
|
+
moveToNext: P,
|
|
2238
2254
|
moveBack: w,
|
|
2239
2255
|
submitCurrentStep: N,
|
|
2240
2256
|
orchestrator: y.current
|
|
2241
2257
|
};
|
|
2242
2258
|
}
|
|
2243
|
-
function
|
|
2244
|
-
const { questionnaireService: t, applicantService: n } =
|
|
2259
|
+
function Vr(e) {
|
|
2260
|
+
const { questionnaireService: t, applicantService: n } = Pe(), [a, i] = k(null), [o, c] = k({}), [d, y] = k(!1), [p, x] = k(!1), [T, v] = k(null), A = de(!1), P = de(null), w = ae(async () => {
|
|
2245
2261
|
var z, Q;
|
|
2246
2262
|
if (e) {
|
|
2247
2263
|
if (A.current) {
|
|
@@ -2260,12 +2276,12 @@ function qr(e) {
|
|
|
2260
2276
|
b.question && ((Q = b.answers) != null && Q.length) && K.set(b.question.trim().toLowerCase(), b.answers);
|
|
2261
2277
|
const ee = {}, E = M.questionGroups.flatMap((b) => b.questions ?? []);
|
|
2262
2278
|
for (const b of E) {
|
|
2263
|
-
const
|
|
2264
|
-
K.has(
|
|
2279
|
+
const $ = b.text.trim().toLowerCase();
|
|
2280
|
+
K.has($) && (ee[b.id] = K.get($));
|
|
2265
2281
|
}
|
|
2266
2282
|
c(ee);
|
|
2267
2283
|
}
|
|
2268
|
-
|
|
2284
|
+
P.current = e;
|
|
2269
2285
|
} catch (M) {
|
|
2270
2286
|
v(M);
|
|
2271
2287
|
} finally {
|
|
@@ -2274,7 +2290,7 @@ function qr(e) {
|
|
|
2274
2290
|
}
|
|
2275
2291
|
}, [e, t, n]);
|
|
2276
2292
|
ge(() => {
|
|
2277
|
-
e &&
|
|
2293
|
+
e && P.current !== e && w();
|
|
2278
2294
|
}, [e]);
|
|
2279
2295
|
const N = ae(
|
|
2280
2296
|
async (z) => {
|
|
@@ -2292,43 +2308,43 @@ function qr(e) {
|
|
|
2292
2308
|
return {
|
|
2293
2309
|
questionnaire: a,
|
|
2294
2310
|
initialAnswers: o,
|
|
2295
|
-
isLoading:
|
|
2311
|
+
isLoading: d,
|
|
2296
2312
|
isSubmitting: p,
|
|
2297
|
-
error:
|
|
2313
|
+
error: T,
|
|
2298
2314
|
load: w,
|
|
2299
2315
|
submit: N
|
|
2300
2316
|
};
|
|
2301
2317
|
}
|
|
2302
|
-
function
|
|
2303
|
-
const { uploadDocumentService: t } =
|
|
2318
|
+
function Yr(e) {
|
|
2319
|
+
const { uploadDocumentService: t } = Pe(), [n, a] = k(null), [i, o] = k(!1), [c, d] = k(!1), [y, p] = k(0), [x, T] = k(null), v = de(!1), A = de(null), P = ae(async () => {
|
|
2304
2320
|
if (e) {
|
|
2305
2321
|
if (v.current) {
|
|
2306
2322
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2307
2323
|
return;
|
|
2308
2324
|
}
|
|
2309
|
-
v.current = !0, o(!0),
|
|
2325
|
+
v.current = !0, o(!0), T(null);
|
|
2310
2326
|
try {
|
|
2311
2327
|
const N = await t.getUploadDocument(e);
|
|
2312
2328
|
a(N), A.current = e;
|
|
2313
2329
|
} catch (N) {
|
|
2314
|
-
|
|
2330
|
+
T(N);
|
|
2315
2331
|
} finally {
|
|
2316
2332
|
o(!1), v.current = !1;
|
|
2317
2333
|
}
|
|
2318
2334
|
}
|
|
2319
2335
|
}, [e, t]);
|
|
2320
2336
|
ge(() => {
|
|
2321
|
-
e && A.current !== e &&
|
|
2337
|
+
e && A.current !== e && P();
|
|
2322
2338
|
}, [e]);
|
|
2323
2339
|
const w = ae(
|
|
2324
2340
|
async (N) => {
|
|
2325
|
-
|
|
2341
|
+
d(!0), p(0), T(null);
|
|
2326
2342
|
try {
|
|
2327
2343
|
await t.fillUploadDocument(N), p(100);
|
|
2328
2344
|
} catch (z) {
|
|
2329
|
-
throw
|
|
2345
|
+
throw T(z), z;
|
|
2330
2346
|
} finally {
|
|
2331
|
-
|
|
2347
|
+
d(!1);
|
|
2332
2348
|
}
|
|
2333
2349
|
},
|
|
2334
2350
|
[t]
|
|
@@ -2339,12 +2355,12 @@ function Vr(e) {
|
|
|
2339
2355
|
isSubmitting: c,
|
|
2340
2356
|
uploadProgress: y,
|
|
2341
2357
|
error: x,
|
|
2342
|
-
load:
|
|
2358
|
+
load: P,
|
|
2343
2359
|
submit: w
|
|
2344
2360
|
};
|
|
2345
2361
|
}
|
|
2346
|
-
function
|
|
2347
|
-
const { appropriatenessTestService: t } =
|
|
2362
|
+
function Jn(e) {
|
|
2363
|
+
const { appropriatenessTestService: t } = Pe(), [n, a] = k(null), [i, o] = k(!1), [c, d] = k(!1), [y, p] = k(null), [x, T] = k(null), v = de(!1), A = de(null), P = ae(async () => {
|
|
2348
2364
|
if (e) {
|
|
2349
2365
|
if (v.current) {
|
|
2350
2366
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
@@ -2362,18 +2378,18 @@ function Gn(e) {
|
|
|
2362
2378
|
}
|
|
2363
2379
|
}, [e, t]);
|
|
2364
2380
|
ge(() => {
|
|
2365
|
-
e && A.current !== e &&
|
|
2381
|
+
e && A.current !== e && P();
|
|
2366
2382
|
}, [e]);
|
|
2367
2383
|
const w = ae(
|
|
2368
2384
|
async (N) => {
|
|
2369
|
-
|
|
2385
|
+
d(!0), p(null);
|
|
2370
2386
|
try {
|
|
2371
2387
|
const z = await t.fillAppropriatenessTest(N);
|
|
2372
|
-
return
|
|
2388
|
+
return T(z), z;
|
|
2373
2389
|
} catch (z) {
|
|
2374
2390
|
throw p(z), z;
|
|
2375
2391
|
} finally {
|
|
2376
|
-
|
|
2392
|
+
d(!1);
|
|
2377
2393
|
}
|
|
2378
2394
|
},
|
|
2379
2395
|
[t]
|
|
@@ -2384,12 +2400,12 @@ function Gn(e) {
|
|
|
2384
2400
|
isLoading: i,
|
|
2385
2401
|
isSubmitting: c,
|
|
2386
2402
|
error: y,
|
|
2387
|
-
load:
|
|
2403
|
+
load: P,
|
|
2388
2404
|
submit: w
|
|
2389
2405
|
};
|
|
2390
2406
|
}
|
|
2391
|
-
function
|
|
2392
|
-
const { overviewService: t } =
|
|
2407
|
+
function Qr(e) {
|
|
2408
|
+
const { overviewService: t } = Pe(), [n, a] = k(null), [i, o] = k(!1), [c, d] = k(!1), [y, p] = k(null), x = de(!1), T = de(null), v = ae(async () => {
|
|
2393
2409
|
if (e) {
|
|
2394
2410
|
if (x.current) {
|
|
2395
2411
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -2397,27 +2413,27 @@ function Yr(e) {
|
|
|
2397
2413
|
}
|
|
2398
2414
|
x.current = !0, o(!0), p(null);
|
|
2399
2415
|
try {
|
|
2400
|
-
const
|
|
2401
|
-
a(
|
|
2402
|
-
} catch (
|
|
2403
|
-
p(
|
|
2416
|
+
const P = await t.getOverviewData(e);
|
|
2417
|
+
a(P), T.current = e;
|
|
2418
|
+
} catch (P) {
|
|
2419
|
+
p(P);
|
|
2404
2420
|
} finally {
|
|
2405
2421
|
o(!1), x.current = !1;
|
|
2406
2422
|
}
|
|
2407
2423
|
}
|
|
2408
2424
|
}, [e, t]);
|
|
2409
2425
|
ge(() => {
|
|
2410
|
-
e &&
|
|
2426
|
+
e && T.current !== e && v();
|
|
2411
2427
|
}, [e]);
|
|
2412
2428
|
const A = ae(async () => {
|
|
2413
2429
|
if (e) {
|
|
2414
|
-
|
|
2430
|
+
d(!0), p(null);
|
|
2415
2431
|
try {
|
|
2416
2432
|
await t.passOverview(e);
|
|
2417
|
-
} catch (
|
|
2418
|
-
throw p(
|
|
2433
|
+
} catch (P) {
|
|
2434
|
+
throw p(P), P;
|
|
2419
2435
|
} finally {
|
|
2420
|
-
|
|
2436
|
+
d(!1);
|
|
2421
2437
|
}
|
|
2422
2438
|
}
|
|
2423
2439
|
}, [e, t]);
|
|
@@ -2430,30 +2446,30 @@ function Yr(e) {
|
|
|
2430
2446
|
passOverview: A
|
|
2431
2447
|
};
|
|
2432
2448
|
}
|
|
2433
|
-
function
|
|
2434
|
-
const { identityService: t } =
|
|
2449
|
+
function Gr(e) {
|
|
2450
|
+
const { identityService: t } = Pe(), [n, a] = k(
|
|
2435
2451
|
null
|
|
2436
|
-
), [i, o] = k(!1), [c,
|
|
2452
|
+
), [i, o] = k(!1), [c, d] = k(null), y = de(!1), p = ae(
|
|
2437
2453
|
async (v, A) => {
|
|
2438
2454
|
if (e) {
|
|
2439
2455
|
if (y.current) {
|
|
2440
2456
|
console.log("[Identity] Request already in progress, skipping...");
|
|
2441
2457
|
return;
|
|
2442
2458
|
}
|
|
2443
|
-
y.current = !0, o(!0),
|
|
2459
|
+
y.current = !0, o(!0), d(null);
|
|
2444
2460
|
try {
|
|
2445
|
-
const
|
|
2461
|
+
const P = {
|
|
2446
2462
|
applicantId: e,
|
|
2447
2463
|
restart: !1,
|
|
2448
2464
|
redirectUrl: v || "",
|
|
2449
2465
|
ttl: A || 604800
|
|
2450
2466
|
// Default: 7 days
|
|
2451
2467
|
};
|
|
2452
|
-
console.log("Identity request input:",
|
|
2453
|
-
const w = await t.identityRequest(
|
|
2468
|
+
console.log("Identity request input:", P);
|
|
2469
|
+
const w = await t.identityRequest(P);
|
|
2454
2470
|
return console.log("Identity request result:", w), a(w), w;
|
|
2455
|
-
} catch (
|
|
2456
|
-
throw
|
|
2471
|
+
} catch (P) {
|
|
2472
|
+
throw d(P), P;
|
|
2457
2473
|
} finally {
|
|
2458
2474
|
o(!1), y.current = !1;
|
|
2459
2475
|
}
|
|
@@ -2463,30 +2479,30 @@ function Qr(e) {
|
|
|
2463
2479
|
), x = ae(
|
|
2464
2480
|
async (v, A) => {
|
|
2465
2481
|
if (e) {
|
|
2466
|
-
o(!0),
|
|
2482
|
+
o(!0), d(null);
|
|
2467
2483
|
try {
|
|
2468
|
-
const
|
|
2484
|
+
const P = {
|
|
2469
2485
|
applicantId: e,
|
|
2470
2486
|
restart: !1,
|
|
2471
2487
|
redirectUrl: v,
|
|
2472
2488
|
ttl: A
|
|
2473
|
-
}, w = await t.identityCompanyRequest(
|
|
2489
|
+
}, w = await t.identityCompanyRequest(P);
|
|
2474
2490
|
return a(w), w;
|
|
2475
|
-
} catch (
|
|
2476
|
-
throw
|
|
2491
|
+
} catch (P) {
|
|
2492
|
+
throw d(P), P;
|
|
2477
2493
|
} finally {
|
|
2478
2494
|
o(!1);
|
|
2479
2495
|
}
|
|
2480
2496
|
}
|
|
2481
2497
|
},
|
|
2482
2498
|
[e, t]
|
|
2483
|
-
),
|
|
2499
|
+
), T = ae(async () => {
|
|
2484
2500
|
if (e) {
|
|
2485
2501
|
if (y.current) {
|
|
2486
2502
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
2487
2503
|
return;
|
|
2488
2504
|
}
|
|
2489
|
-
y.current = !0, o(!0),
|
|
2505
|
+
y.current = !0, o(!0), d(null);
|
|
2490
2506
|
try {
|
|
2491
2507
|
const v = {
|
|
2492
2508
|
applicantId: e,
|
|
@@ -2499,7 +2515,7 @@ function Qr(e) {
|
|
|
2499
2515
|
const A = await t.identityRequest(v);
|
|
2500
2516
|
return console.log("Restart identity result:", A), a(A), A;
|
|
2501
2517
|
} catch (v) {
|
|
2502
|
-
throw
|
|
2518
|
+
throw d(v), v;
|
|
2503
2519
|
} finally {
|
|
2504
2520
|
o(!1), y.current = !1;
|
|
2505
2521
|
}
|
|
@@ -2513,11 +2529,11 @@ function Qr(e) {
|
|
|
2513
2529
|
error: c,
|
|
2514
2530
|
requestIdentity: p,
|
|
2515
2531
|
requestCompanyIdentity: x,
|
|
2516
|
-
restartIdentity:
|
|
2532
|
+
restartIdentity: T
|
|
2517
2533
|
};
|
|
2518
2534
|
}
|
|
2519
|
-
function
|
|
2520
|
-
const { riskScoringService: t, applicantService: n } =
|
|
2535
|
+
function Jr(e) {
|
|
2536
|
+
const { riskScoringService: t, applicantService: n } = Pe(), [a, i] = k(null), [o, c] = k({}), [d, y] = k(!1), [p, x] = k(!1), [T, v] = k(null), [A, P] = k(null), w = de(!1), N = de(null), z = ae(async () => {
|
|
2521
2537
|
var M;
|
|
2522
2538
|
if (e) {
|
|
2523
2539
|
if (w.current) {
|
|
@@ -2534,10 +2550,10 @@ function Gr(e) {
|
|
|
2534
2550
|
const ee = K.riskScoringResults[0], E = {};
|
|
2535
2551
|
for (const b of ee.riskCriteriaResults ?? [])
|
|
2536
2552
|
if (b.riskCriteriaId != null && b.answer != null && b.answer !== "") {
|
|
2537
|
-
const
|
|
2553
|
+
const $ = [...new Set(
|
|
2538
2554
|
b.answer.split(",").map((V) => V.trim()).filter((V) => V !== "")
|
|
2539
2555
|
)];
|
|
2540
|
-
|
|
2556
|
+
$.length > 0 && (E[b.riskCriteriaId] = $);
|
|
2541
2557
|
}
|
|
2542
2558
|
c(E);
|
|
2543
2559
|
}
|
|
@@ -2557,7 +2573,7 @@ function Gr(e) {
|
|
|
2557
2573
|
x(!0), v(null);
|
|
2558
2574
|
try {
|
|
2559
2575
|
const j = await t.submitRiskScoring(M);
|
|
2560
|
-
return
|
|
2576
|
+
return P(j), j;
|
|
2561
2577
|
} catch (j) {
|
|
2562
2578
|
throw v(j), j;
|
|
2563
2579
|
} finally {
|
|
@@ -2570,25 +2586,25 @@ function Gr(e) {
|
|
|
2570
2586
|
criteria: a,
|
|
2571
2587
|
initialAnswers: o,
|
|
2572
2588
|
result: A,
|
|
2573
|
-
isLoading:
|
|
2589
|
+
isLoading: d,
|
|
2574
2590
|
isSubmitting: p,
|
|
2575
|
-
error:
|
|
2591
|
+
error: T,
|
|
2576
2592
|
load: z,
|
|
2577
2593
|
submit: Q
|
|
2578
2594
|
};
|
|
2579
2595
|
}
|
|
2580
|
-
function
|
|
2581
|
-
const { applicantService: e, config: t } =
|
|
2582
|
-
const
|
|
2583
|
-
return (A === "x" ?
|
|
2596
|
+
function zt() {
|
|
2597
|
+
const { applicantService: e, config: t } = Pe(), [n, a] = k(!1), [i, o] = k(null), c = de(!1), d = de(!1), y = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(A) {
|
|
2598
|
+
const P = Math.random() * 16 | 0;
|
|
2599
|
+
return (A === "x" ? P : P & 3 | 8).toString(16);
|
|
2584
2600
|
}), p = ae(
|
|
2585
2601
|
async (A) => {
|
|
2586
|
-
var
|
|
2602
|
+
var P;
|
|
2587
2603
|
if (c.current)
|
|
2588
2604
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
2589
2605
|
c.current = !0, a(!0), o(null);
|
|
2590
2606
|
try {
|
|
2591
|
-
if (A.applicantAdditionalDatas || (A.applicantAdditionalDatas = []), (
|
|
2607
|
+
if (A.applicantAdditionalDatas || (A.applicantAdditionalDatas = []), (P = t.identityProviders) != null && P.sardinai) {
|
|
2592
2608
|
const N = y();
|
|
2593
2609
|
console.log("[SardinAI] Generated session key:", N), A.applicantAdditionalDatas.push({
|
|
2594
2610
|
paramName: "sessionKey",
|
|
@@ -2608,24 +2624,24 @@ function Ot() {
|
|
|
2608
2624
|
a(!0), o(null);
|
|
2609
2625
|
try {
|
|
2610
2626
|
return await e.createCompanyApplicant(A);
|
|
2611
|
-
} catch (
|
|
2612
|
-
throw o(
|
|
2627
|
+
} catch (P) {
|
|
2628
|
+
throw o(P), P;
|
|
2613
2629
|
} finally {
|
|
2614
2630
|
a(!1);
|
|
2615
2631
|
}
|
|
2616
2632
|
},
|
|
2617
2633
|
[e]
|
|
2618
|
-
),
|
|
2634
|
+
), T = ae(
|
|
2619
2635
|
async (A) => {
|
|
2620
|
-
if (
|
|
2636
|
+
if (d.current)
|
|
2621
2637
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
2622
|
-
|
|
2638
|
+
d.current = !0, a(!0), o(null);
|
|
2623
2639
|
try {
|
|
2624
2640
|
return await e.getApplicantData(A);
|
|
2625
|
-
} catch (
|
|
2626
|
-
throw o(
|
|
2641
|
+
} catch (P) {
|
|
2642
|
+
throw o(P), P;
|
|
2627
2643
|
} finally {
|
|
2628
|
-
a(!1),
|
|
2644
|
+
a(!1), d.current = !1;
|
|
2629
2645
|
}
|
|
2630
2646
|
},
|
|
2631
2647
|
[e]
|
|
@@ -2634,8 +2650,8 @@ function Ot() {
|
|
|
2634
2650
|
a(!0), o(null);
|
|
2635
2651
|
try {
|
|
2636
2652
|
await e.stopProgress(A);
|
|
2637
|
-
} catch (
|
|
2638
|
-
throw o(
|
|
2653
|
+
} catch (P) {
|
|
2654
|
+
throw o(P), P;
|
|
2639
2655
|
} finally {
|
|
2640
2656
|
a(!1);
|
|
2641
2657
|
}
|
|
@@ -2647,11 +2663,11 @@ function Ot() {
|
|
|
2647
2663
|
error: i,
|
|
2648
2664
|
createApplicant: p,
|
|
2649
2665
|
createCompanyApplicant: x,
|
|
2650
|
-
getApplicantData:
|
|
2666
|
+
getApplicantData: T,
|
|
2651
2667
|
stopProgress: v
|
|
2652
2668
|
};
|
|
2653
2669
|
}
|
|
2654
|
-
const
|
|
2670
|
+
const Zr = {
|
|
2655
2671
|
primary: {
|
|
2656
2672
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
2657
2673
|
color: "#ffffff",
|
|
@@ -2685,7 +2701,7 @@ const Jr = {
|
|
|
2685
2701
|
disabled: i,
|
|
2686
2702
|
className: o,
|
|
2687
2703
|
style: c,
|
|
2688
|
-
...
|
|
2704
|
+
...d
|
|
2689
2705
|
}) => /* @__PURE__ */ s(
|
|
2690
2706
|
"button",
|
|
2691
2707
|
{
|
|
@@ -2694,9 +2710,9 @@ const Jr = {
|
|
|
2694
2710
|
md: "px-4 py-2 text-sm",
|
|
2695
2711
|
lg: "px-6 py-3 text-base"
|
|
2696
2712
|
}[n], o),
|
|
2697
|
-
style: { ...
|
|
2713
|
+
style: { ...Zr[t], ...c },
|
|
2698
2714
|
disabled: i || a,
|
|
2699
|
-
...
|
|
2715
|
+
...d,
|
|
2700
2716
|
children: [
|
|
2701
2717
|
a && /* @__PURE__ */ s(
|
|
2702
2718
|
"svg",
|
|
@@ -2731,8 +2747,8 @@ const Jr = {
|
|
|
2731
2747
|
e
|
|
2732
2748
|
]
|
|
2733
2749
|
}
|
|
2734
|
-
), xe =
|
|
2735
|
-
({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, style: c, ...
|
|
2750
|
+
), xe = yt(
|
|
2751
|
+
({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, style: c, ...d }, y) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
2736
2752
|
e && /* @__PURE__ */ s(
|
|
2737
2753
|
"label",
|
|
2738
2754
|
{
|
|
@@ -2740,7 +2756,7 @@ const Jr = {
|
|
|
2740
2756
|
style: { color: "var(--metakyc-text-primary, #374151)" },
|
|
2741
2757
|
children: [
|
|
2742
2758
|
e,
|
|
2743
|
-
|
|
2759
|
+
d.required && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
2744
2760
|
]
|
|
2745
2761
|
}
|
|
2746
2762
|
),
|
|
@@ -2759,13 +2775,13 @@ const Jr = {
|
|
|
2759
2775
|
o
|
|
2760
2776
|
),
|
|
2761
2777
|
style: {
|
|
2762
|
-
backgroundColor:
|
|
2778
|
+
backgroundColor: d.readOnly ? "var(--metakyc-surface, #f3f4f6)" : "var(--metakyc-input-bg, #ffffff)",
|
|
2763
2779
|
color: "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))",
|
|
2764
2780
|
borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
2765
|
-
cursor:
|
|
2781
|
+
cursor: d.readOnly ? "default" : void 0,
|
|
2766
2782
|
...c
|
|
2767
2783
|
},
|
|
2768
|
-
...
|
|
2784
|
+
...d
|
|
2769
2785
|
}
|
|
2770
2786
|
),
|
|
2771
2787
|
i && /* @__PURE__ */ r("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: i })
|
|
@@ -2809,7 +2825,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2809
2825
|
...n,
|
|
2810
2826
|
children: e
|
|
2811
2827
|
}
|
|
2812
|
-
),
|
|
2828
|
+
), Xr = {
|
|
2813
2829
|
// Theme-aware variants
|
|
2814
2830
|
default: {
|
|
2815
2831
|
backgroundColor: "var(--metakyc-surface, #f3f4f6)",
|
|
@@ -2832,14 +2848,14 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2832
2848
|
backgroundColor: "#fef3c7",
|
|
2833
2849
|
color: "#92400e"
|
|
2834
2850
|
}
|
|
2835
|
-
},
|
|
2851
|
+
}, $t = ({ children: e, variant: t = "default", className: n, style: a, ...i }) => /* @__PURE__ */ r(
|
|
2836
2852
|
"span",
|
|
2837
2853
|
{
|
|
2838
2854
|
className: Ae(
|
|
2839
2855
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2840
2856
|
n
|
|
2841
2857
|
),
|
|
2842
|
-
style: { ...
|
|
2858
|
+
style: { ...Xr[t], ...a },
|
|
2843
2859
|
...i,
|
|
2844
2860
|
children: e
|
|
2845
2861
|
}
|
|
@@ -2879,8 +2895,8 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2879
2895
|
]
|
|
2880
2896
|
}
|
|
2881
2897
|
) });
|
|
2882
|
-
},
|
|
2883
|
-
({ label: e, error: t, helperText: n, options: a, placeholder: i, className: o, style: c, ...
|
|
2898
|
+
}, Ct = yt(
|
|
2899
|
+
({ label: e, error: t, helperText: n, options: a, placeholder: i, className: o, style: c, ...d }, y) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
2884
2900
|
e && /* @__PURE__ */ s(
|
|
2885
2901
|
"label",
|
|
2886
2902
|
{
|
|
@@ -2888,7 +2904,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2888
2904
|
style: { color: "var(--metakyc-text-primary, #374151)" },
|
|
2889
2905
|
children: [
|
|
2890
2906
|
e,
|
|
2891
|
-
|
|
2907
|
+
d.required && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
2892
2908
|
]
|
|
2893
2909
|
}
|
|
2894
2910
|
),
|
|
@@ -2909,7 +2925,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2909
2925
|
borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
2910
2926
|
...c
|
|
2911
2927
|
},
|
|
2912
|
-
...
|
|
2928
|
+
...d,
|
|
2913
2929
|
children: [
|
|
2914
2930
|
i && /* @__PURE__ */ r(
|
|
2915
2931
|
"option",
|
|
@@ -2944,8 +2960,8 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2944
2960
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
2945
2961
|
] })
|
|
2946
2962
|
);
|
|
2947
|
-
|
|
2948
|
-
const
|
|
2963
|
+
Ct.displayName = "Select";
|
|
2964
|
+
const Et = 280, en = ({
|
|
2949
2965
|
label: e,
|
|
2950
2966
|
value: t,
|
|
2951
2967
|
onChange: n,
|
|
@@ -2953,9 +2969,9 @@ const It = 280, Xr = ({
|
|
|
2953
2969
|
placeholder: i = "Select...",
|
|
2954
2970
|
disabled: o = !1,
|
|
2955
2971
|
readOnly: c = !1,
|
|
2956
|
-
required:
|
|
2972
|
+
required: d = !1
|
|
2957
2973
|
}) => {
|
|
2958
|
-
const y = o || c, [p, x] = k(!1), [
|
|
2974
|
+
const y = o || c, [p, x] = k(!1), [T, v] = k(""), [A, P] = k(null), [w, N] = k({
|
|
2959
2975
|
bg: "#ffffff",
|
|
2960
2976
|
borderColor: "#d1d5db",
|
|
2961
2977
|
textPrimary: "#111827",
|
|
@@ -2965,24 +2981,24 @@ const It = 280, Xr = ({
|
|
|
2965
2981
|
hoverBg: "#f9fafb"
|
|
2966
2982
|
}), z = de(null), Q = de(null), M = de(null), j = ae(() => {
|
|
2967
2983
|
if (!Q.current) return null;
|
|
2968
|
-
const F = Q.current.getBoundingClientRect(),
|
|
2969
|
-
return { top:
|
|
2984
|
+
const F = Q.current.getBoundingClientRect(), B = window.innerHeight - F.bottom < Et && F.top > Et;
|
|
2985
|
+
return { top: B ? F.top : F.bottom + 4, left: F.left, width: F.width, openUp: B };
|
|
2970
2986
|
}, []), K = ae(() => {
|
|
2971
|
-
const F = getComputedStyle(document.documentElement), U = (H, fe) => F.getPropertyValue(H).trim() || fe,
|
|
2987
|
+
const F = getComputedStyle(document.documentElement), U = (H, fe) => F.getPropertyValue(H).trim() || fe, B = U("--metakyc-input-bg", U("--metakyc-background", "#ffffff"));
|
|
2972
2988
|
N({
|
|
2973
|
-
bg:
|
|
2989
|
+
bg: B,
|
|
2974
2990
|
borderColor: U("--metakyc-input-border", U("--metakyc-border", "#d1d5db")),
|
|
2975
2991
|
textPrimary: U("--metakyc-input-text", U("--metakyc-text-primary", "#111827")),
|
|
2976
2992
|
textSecondary: U("--metakyc-text-secondary", "#6b7280"),
|
|
2977
2993
|
primaryColor: U("--metakyc-primary", "#2563eb"),
|
|
2978
2994
|
primaryLight: U("--metakyc-primary-light", "#eff6ff"),
|
|
2979
|
-
hoverBg: U("--metakyc-surface",
|
|
2995
|
+
hoverBg: U("--metakyc-surface", B)
|
|
2980
2996
|
});
|
|
2981
2997
|
}, []), ee = ae(() => {
|
|
2982
2998
|
if (y) return;
|
|
2983
2999
|
K();
|
|
2984
3000
|
const F = j();
|
|
2985
|
-
F &&
|
|
3001
|
+
F && P(F), x(!0);
|
|
2986
3002
|
}, [y, j, K]), E = ae(() => {
|
|
2987
3003
|
x(!1), v("");
|
|
2988
3004
|
}, []);
|
|
@@ -2990,29 +3006,29 @@ const It = 280, Xr = ({
|
|
|
2990
3006
|
if (!p) return;
|
|
2991
3007
|
const F = (U) => {
|
|
2992
3008
|
var H, fe;
|
|
2993
|
-
const
|
|
2994
|
-
!((H = z.current) != null && H.contains(
|
|
3009
|
+
const B = U.target;
|
|
3010
|
+
!((H = z.current) != null && H.contains(B)) && !((fe = M.current) != null && fe.contains(B)) && E();
|
|
2995
3011
|
};
|
|
2996
3012
|
return document.addEventListener("mousedown", F), () => document.removeEventListener("mousedown", F);
|
|
2997
3013
|
}, [p, E]), ge(() => {
|
|
2998
3014
|
if (!p) return;
|
|
2999
3015
|
const F = () => {
|
|
3000
3016
|
const U = j();
|
|
3001
|
-
U &&
|
|
3017
|
+
U && P(U);
|
|
3002
3018
|
};
|
|
3003
3019
|
return window.addEventListener("scroll", F, !0), window.addEventListener("resize", F), () => {
|
|
3004
3020
|
window.removeEventListener("scroll", F, !0), window.removeEventListener("resize", F);
|
|
3005
3021
|
};
|
|
3006
3022
|
}, [p, j]);
|
|
3007
3023
|
const b = a.filter(
|
|
3008
|
-
(F) => F.label.toLowerCase().includes(
|
|
3009
|
-
),
|
|
3024
|
+
(F) => F.label.toLowerCase().includes(T.toLowerCase())
|
|
3025
|
+
), $ = (F) => {
|
|
3010
3026
|
y || n(t.includes(F) ? t.filter((U) => U !== F) : [...t, F]);
|
|
3011
3027
|
}, V = (F, U) => {
|
|
3012
|
-
U.stopPropagation(), y || n(t.filter((
|
|
3028
|
+
U.stopPropagation(), y || n(t.filter((B) => B !== F));
|
|
3013
3029
|
}, G = (F) => {
|
|
3014
3030
|
var U;
|
|
3015
|
-
return ((U = a.find((
|
|
3031
|
+
return ((U = a.find((B) => B.value === F)) == null ? void 0 : U.label) || F;
|
|
3016
3032
|
}, { bg: _, borderColor: J, textPrimary: se, textSecondary: Y, primaryColor: ve, primaryLight: ue, hoverBg: me } = w, ke = p && A && /* @__PURE__ */ s(
|
|
3017
3033
|
"div",
|
|
3018
3034
|
{
|
|
@@ -3036,7 +3052,7 @@ const It = 280, Xr = ({
|
|
|
3036
3052
|
"input",
|
|
3037
3053
|
{
|
|
3038
3054
|
type: "text",
|
|
3039
|
-
value:
|
|
3055
|
+
value: T,
|
|
3040
3056
|
onChange: (F) => v(F.target.value),
|
|
3041
3057
|
placeholder: "Search...",
|
|
3042
3058
|
autoFocus: !0,
|
|
@@ -3055,8 +3071,8 @@ const It = 280, Xr = ({
|
|
|
3055
3071
|
boxSizing: "border-box"
|
|
3056
3072
|
},
|
|
3057
3073
|
onFocus: (F) => {
|
|
3058
|
-
const U = getComputedStyle(document.documentElement),
|
|
3059
|
-
F.currentTarget.style.backgroundColor = _, F.currentTarget.style.color = se, F.currentTarget.style.borderColor =
|
|
3074
|
+
const U = getComputedStyle(document.documentElement), B = U.getPropertyValue("--metakyc-input-border-focus").trim() || U.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
3075
|
+
F.currentTarget.style.backgroundColor = _, F.currentTarget.style.color = se, F.currentTarget.style.borderColor = B, F.currentTarget.style.outline = "none", F.currentTarget.style.boxShadow = `0 0 0 2px ${B}33`;
|
|
3060
3076
|
},
|
|
3061
3077
|
onBlur: (F) => {
|
|
3062
3078
|
F.currentTarget.style.backgroundColor = _, F.currentTarget.style.color = se, F.currentTarget.style.borderColor = J, F.currentTarget.style.outline = "none", F.currentTarget.style.boxShadow = "none";
|
|
@@ -3068,7 +3084,7 @@ const It = 280, Xr = ({
|
|
|
3068
3084
|
return /* @__PURE__ */ s(
|
|
3069
3085
|
"li",
|
|
3070
3086
|
{
|
|
3071
|
-
onClick: () =>
|
|
3087
|
+
onClick: () => $(F.value),
|
|
3072
3088
|
className: "metakyc-multiselect-option",
|
|
3073
3089
|
style: {
|
|
3074
3090
|
display: "flex",
|
|
@@ -3081,11 +3097,11 @@ const It = 280, Xr = ({
|
|
|
3081
3097
|
color: U ? ve : se,
|
|
3082
3098
|
userSelect: "none"
|
|
3083
3099
|
},
|
|
3084
|
-
onMouseEnter: (
|
|
3085
|
-
U || (
|
|
3100
|
+
onMouseEnter: (B) => {
|
|
3101
|
+
U || (B.currentTarget.style.backgroundColor = me);
|
|
3086
3102
|
},
|
|
3087
|
-
onMouseLeave: (
|
|
3088
|
-
U || (
|
|
3103
|
+
onMouseLeave: (B) => {
|
|
3104
|
+
U || (B.currentTarget.style.backgroundColor = "transparent");
|
|
3089
3105
|
},
|
|
3090
3106
|
children: [
|
|
3091
3107
|
/* @__PURE__ */ r(
|
|
@@ -3129,7 +3145,7 @@ const It = 280, Xr = ({
|
|
|
3129
3145
|
style: { color: "var(--metakyc-text-primary, #374151)" },
|
|
3130
3146
|
children: [
|
|
3131
3147
|
e,
|
|
3132
|
-
|
|
3148
|
+
d && /* @__PURE__ */ r("span", { style: { color: "var(--metakyc-error, #ef4444)", marginLeft: "4px" }, children: "*" })
|
|
3133
3149
|
]
|
|
3134
3150
|
}
|
|
3135
3151
|
),
|
|
@@ -3210,9 +3226,9 @@ const It = 280, Xr = ({
|
|
|
3210
3226
|
]
|
|
3211
3227
|
}
|
|
3212
3228
|
),
|
|
3213
|
-
typeof document < "u" && ke ?
|
|
3229
|
+
typeof document < "u" && ke ? St(ke, document.body) : null
|
|
3214
3230
|
] });
|
|
3215
|
-
},
|
|
3231
|
+
}, Ft = 260, qe = ({
|
|
3216
3232
|
label: e,
|
|
3217
3233
|
error: t,
|
|
3218
3234
|
helperText: n,
|
|
@@ -3220,13 +3236,13 @@ const It = 280, Xr = ({
|
|
|
3220
3236
|
placeholder: i = "Select...",
|
|
3221
3237
|
value: o,
|
|
3222
3238
|
onChange: c,
|
|
3223
|
-
disabled:
|
|
3239
|
+
disabled: d = !1,
|
|
3224
3240
|
readOnly: y = !1,
|
|
3225
3241
|
required: p = !1,
|
|
3226
3242
|
className: x
|
|
3227
3243
|
}) => {
|
|
3228
3244
|
var fe;
|
|
3229
|
-
const
|
|
3245
|
+
const T = d || y, [v, A] = k(!1), [P, w] = k(""), [N, z] = k(null), [Q, M] = k({
|
|
3230
3246
|
bg: "#ffffff",
|
|
3231
3247
|
border: "#d1d5db",
|
|
3232
3248
|
text: "#111827",
|
|
@@ -3245,9 +3261,9 @@ const It = 280, Xr = ({
|
|
|
3245
3261
|
primaryLight: te("--metakyc-primary-light", "#eff6ff"),
|
|
3246
3262
|
hoverBg: te("--metakyc-surface", ye)
|
|
3247
3263
|
});
|
|
3248
|
-
}, []), K = de(null), ee = de(null), E = de(null), b = de(null),
|
|
3264
|
+
}, []), K = de(null), ee = de(null), E = de(null), b = de(null), $ = ae(() => {
|
|
3249
3265
|
if (!ee.current) return null;
|
|
3250
|
-
const I = ee.current.getBoundingClientRect(), ye = window.innerHeight - I.bottom <
|
|
3266
|
+
const I = ee.current.getBoundingClientRect(), ye = window.innerHeight - I.bottom < Ft && I.top > Ft;
|
|
3251
3267
|
return {
|
|
3252
3268
|
top: ye ? I.top : I.bottom + 4,
|
|
3253
3269
|
left: I.left,
|
|
@@ -3255,11 +3271,11 @@ const It = 280, Xr = ({
|
|
|
3255
3271
|
openUp: ye
|
|
3256
3272
|
};
|
|
3257
3273
|
}, []), V = ae(() => {
|
|
3258
|
-
if (
|
|
3274
|
+
if (T) return;
|
|
3259
3275
|
j();
|
|
3260
|
-
const I =
|
|
3276
|
+
const I = $();
|
|
3261
3277
|
I && z(I), A(!0);
|
|
3262
|
-
}, [
|
|
3278
|
+
}, [T, $, j]), G = ae(() => {
|
|
3263
3279
|
A(!1), w("");
|
|
3264
3280
|
}, []), _ = () => v ? G() : V();
|
|
3265
3281
|
ge(() => {
|
|
@@ -3273,23 +3289,23 @@ const It = 280, Xr = ({
|
|
|
3273
3289
|
}, [v, G]), ge(() => {
|
|
3274
3290
|
if (!v) return;
|
|
3275
3291
|
const I = () => {
|
|
3276
|
-
const te =
|
|
3292
|
+
const te = $();
|
|
3277
3293
|
te && z(te);
|
|
3278
3294
|
};
|
|
3279
3295
|
return window.addEventListener("scroll", I, !0), window.addEventListener("resize", I), () => {
|
|
3280
3296
|
window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
|
|
3281
3297
|
};
|
|
3282
|
-
}, [v,
|
|
3298
|
+
}, [v, $]), ge(() => {
|
|
3283
3299
|
v && b.current && setTimeout(() => {
|
|
3284
3300
|
var I;
|
|
3285
3301
|
return (I = b.current) == null ? void 0 : I.focus();
|
|
3286
3302
|
}, 0);
|
|
3287
3303
|
}, [v]);
|
|
3288
3304
|
const J = a.filter(
|
|
3289
|
-
(I) => I.label.toLowerCase().includes(
|
|
3305
|
+
(I) => I.label.toLowerCase().includes(P.toLowerCase()) || I.value.toLowerCase().includes(P.toLowerCase())
|
|
3290
3306
|
), se = (fe = a.find((I) => I.value === o)) == null ? void 0 : fe.label, Y = (I, te) => {
|
|
3291
|
-
|
|
3292
|
-
}, { bg: ve, border: ue, text: me, textSecondary: ke, primary: F, primaryLight: U, hoverBg:
|
|
3307
|
+
T || te || (c(I), G());
|
|
3308
|
+
}, { bg: ve, border: ue, text: me, textSecondary: ke, primary: F, primaryLight: U, hoverBg: B } = Q, H = v && N && /* @__PURE__ */ s(
|
|
3293
3309
|
"div",
|
|
3294
3310
|
{
|
|
3295
3311
|
ref: E,
|
|
@@ -3313,7 +3329,7 @@ const It = 280, Xr = ({
|
|
|
3313
3329
|
{
|
|
3314
3330
|
ref: b,
|
|
3315
3331
|
type: "text",
|
|
3316
|
-
value:
|
|
3332
|
+
value: P,
|
|
3317
3333
|
onChange: (I) => w(I.target.value),
|
|
3318
3334
|
placeholder: "Search...",
|
|
3319
3335
|
onClick: (I) => I.stopPropagation(),
|
|
@@ -3366,7 +3382,7 @@ const It = 280, Xr = ({
|
|
|
3366
3382
|
userSelect: "none"
|
|
3367
3383
|
},
|
|
3368
3384
|
onMouseEnter: (ye) => {
|
|
3369
|
-
!te && !I.disabled && (ye.currentTarget.style.backgroundColor =
|
|
3385
|
+
!te && !I.disabled && (ye.currentTarget.style.backgroundColor = B);
|
|
3370
3386
|
},
|
|
3371
3387
|
onMouseLeave: (ye) => {
|
|
3372
3388
|
te || (ye.currentTarget.style.backgroundColor = "transparent");
|
|
@@ -3403,7 +3419,7 @@ const It = 280, Xr = ({
|
|
|
3403
3419
|
{
|
|
3404
3420
|
ref: ee,
|
|
3405
3421
|
role: "button",
|
|
3406
|
-
tabIndex:
|
|
3422
|
+
tabIndex: T ? -1 : 0,
|
|
3407
3423
|
onClick: _,
|
|
3408
3424
|
onKeyDown: (I) => {
|
|
3409
3425
|
(I.key === "Enter" || I.key === " ") && (I.preventDefault(), _()), I.key === "Escape" && G();
|
|
@@ -3413,7 +3429,7 @@ const It = 280, Xr = ({
|
|
|
3413
3429
|
"w-full px-3 py-2 rounded-lg border text-sm transition-colors text-left",
|
|
3414
3430
|
"flex items-center justify-between gap-2",
|
|
3415
3431
|
"focus:outline-none",
|
|
3416
|
-
|
|
3432
|
+
T ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
3417
3433
|
),
|
|
3418
3434
|
style: {
|
|
3419
3435
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
@@ -3436,19 +3452,19 @@ const It = 280, Xr = ({
|
|
|
3436
3452
|
]
|
|
3437
3453
|
}
|
|
3438
3454
|
),
|
|
3439
|
-
typeof document < "u" && H ?
|
|
3455
|
+
typeof document < "u" && H ? St(H, document.body) : null,
|
|
3440
3456
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
3441
3457
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3442
3458
|
]
|
|
3443
3459
|
}
|
|
3444
3460
|
);
|
|
3445
3461
|
};
|
|
3446
|
-
|
|
3447
|
-
function
|
|
3462
|
+
qe.displayName = "SearchableSelect";
|
|
3463
|
+
function tn(e) {
|
|
3448
3464
|
const t = e.type;
|
|
3449
3465
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : "file";
|
|
3450
3466
|
}
|
|
3451
|
-
const
|
|
3467
|
+
const rn = ({
|
|
3452
3468
|
label: e,
|
|
3453
3469
|
subtitle: t,
|
|
3454
3470
|
error: n,
|
|
@@ -3456,32 +3472,32 @@ const tn = ({
|
|
|
3456
3472
|
multiple: i = !1,
|
|
3457
3473
|
maxSize: o,
|
|
3458
3474
|
required: c,
|
|
3459
|
-
onChange:
|
|
3475
|
+
onChange: d,
|
|
3460
3476
|
value: y = [],
|
|
3461
3477
|
className: p
|
|
3462
3478
|
}) => {
|
|
3463
|
-
const [x,
|
|
3479
|
+
const [x, T] = k(!1), [v, A] = k(null), P = de(null), w = ae((E) => {
|
|
3464
3480
|
if (!E) return;
|
|
3465
3481
|
A(null);
|
|
3466
3482
|
const b = Array.from(E);
|
|
3467
3483
|
if (o && b.filter((V) => V.size > o).length > 0) {
|
|
3468
|
-
A(`File exceeds the maximum size of ${
|
|
3484
|
+
A(`File exceeds the maximum size of ${xt(o)}`);
|
|
3469
3485
|
return;
|
|
3470
3486
|
}
|
|
3471
|
-
|
|
3472
|
-
}, [o, i,
|
|
3473
|
-
E.preventDefault(), E.stopPropagation(),
|
|
3487
|
+
d == null || d(i ? [...y, ...b] : [b[0]]);
|
|
3488
|
+
}, [o, i, d, y]), N = ae((E) => {
|
|
3489
|
+
E.preventDefault(), E.stopPropagation(), T(!0);
|
|
3474
3490
|
}, []), z = ae((E) => {
|
|
3475
|
-
E.preventDefault(), E.stopPropagation(),
|
|
3491
|
+
E.preventDefault(), E.stopPropagation(), T(!1);
|
|
3476
3492
|
}, []), Q = ae((E) => {
|
|
3477
|
-
E.preventDefault(), E.stopPropagation(),
|
|
3493
|
+
E.preventDefault(), E.stopPropagation(), T(!1), w(E.dataTransfer.files);
|
|
3478
3494
|
}, [w]), M = () => {
|
|
3479
3495
|
var E;
|
|
3480
|
-
(E =
|
|
3496
|
+
(E = P.current) == null || E.click();
|
|
3481
3497
|
}, j = (E) => {
|
|
3482
3498
|
A(null);
|
|
3483
|
-
const b = y.filter((
|
|
3484
|
-
|
|
3499
|
+
const b = y.filter(($, V) => V !== E);
|
|
3500
|
+
d == null || d(b);
|
|
3485
3501
|
}, K = n || v, ee = y.length > 0;
|
|
3486
3502
|
return /* @__PURE__ */ s("div", { className: Ae("metakyc-file-upload", p), style: { width: "100%" }, children: [
|
|
3487
3503
|
e && /* @__PURE__ */ s("div", { style: { marginBottom: "8px" }, children: [
|
|
@@ -3523,7 +3539,7 @@ const tn = ({
|
|
|
3523
3539
|
/* @__PURE__ */ r(
|
|
3524
3540
|
"input",
|
|
3525
3541
|
{
|
|
3526
|
-
ref:
|
|
3542
|
+
ref: P,
|
|
3527
3543
|
type: "file",
|
|
3528
3544
|
style: { display: "none" },
|
|
3529
3545
|
accept: a,
|
|
@@ -3579,7 +3595,7 @@ const tn = ({
|
|
|
3579
3595
|
a && o && /* @__PURE__ */ r("span", { children: " · " }),
|
|
3580
3596
|
o && /* @__PURE__ */ s("span", { children: [
|
|
3581
3597
|
"Max ",
|
|
3582
|
-
|
|
3598
|
+
xt(o)
|
|
3583
3599
|
] })
|
|
3584
3600
|
] })
|
|
3585
3601
|
] })
|
|
@@ -3588,7 +3604,7 @@ const tn = ({
|
|
|
3588
3604
|
}
|
|
3589
3605
|
),
|
|
3590
3606
|
ee && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((E, b) => {
|
|
3591
|
-
const
|
|
3607
|
+
const $ = tn(E), V = $ === "image", G = V ? URL.createObjectURL(E) : null;
|
|
3592
3608
|
return /* @__PURE__ */ s(
|
|
3593
3609
|
"div",
|
|
3594
3610
|
{
|
|
@@ -3625,7 +3641,7 @@ const tn = ({
|
|
|
3625
3641
|
alt: E.name,
|
|
3626
3642
|
style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
3627
3643
|
}
|
|
3628
|
-
) :
|
|
3644
|
+
) : $ === "pdf" ? /* @__PURE__ */ s("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3629
3645
|
/* @__PURE__ */ r("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
3630
3646
|
/* @__PURE__ */ r("polyline", { points: "14 2 14 8 20 8" }),
|
|
3631
3647
|
/* @__PURE__ */ r("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
@@ -3647,7 +3663,7 @@ const tn = ({
|
|
|
3647
3663
|
textOverflow: "ellipsis",
|
|
3648
3664
|
whiteSpace: "nowrap"
|
|
3649
3665
|
}, children: E.name }),
|
|
3650
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children:
|
|
3666
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: xt(E.size) })
|
|
3651
3667
|
] }),
|
|
3652
3668
|
/* @__PURE__ */ r(
|
|
3653
3669
|
"button",
|
|
@@ -3690,7 +3706,7 @@ const tn = ({
|
|
|
3690
3706
|
}) }),
|
|
3691
3707
|
K && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: K })
|
|
3692
3708
|
] });
|
|
3693
|
-
},
|
|
3709
|
+
}, nn = yt(
|
|
3694
3710
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
3695
3711
|
a.label && /* @__PURE__ */ s(
|
|
3696
3712
|
"label",
|
|
@@ -3736,7 +3752,7 @@ const tn = ({
|
|
|
3736
3752
|
a.error && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: a.error })
|
|
3737
3753
|
] })
|
|
3738
3754
|
);
|
|
3739
|
-
|
|
3755
|
+
nn.displayName = "PhoneInput";
|
|
3740
3756
|
/**
|
|
3741
3757
|
* @license lucide-react v0.574.0 - ISC
|
|
3742
3758
|
*
|
|
@@ -3750,14 +3766,14 @@ const Bt = (...e) => e.filter((t, n, a) => !!t && t.trim() !== "" && a.indexOf(t
|
|
|
3750
3766
|
* This source code is licensed under the ISC license.
|
|
3751
3767
|
* See the LICENSE file in the root directory of this source tree.
|
|
3752
3768
|
*/
|
|
3753
|
-
const
|
|
3769
|
+
const an = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3754
3770
|
/**
|
|
3755
3771
|
* @license lucide-react v0.574.0 - ISC
|
|
3756
3772
|
*
|
|
3757
3773
|
* This source code is licensed under the ISC license.
|
|
3758
3774
|
* See the LICENSE file in the root directory of this source tree.
|
|
3759
3775
|
*/
|
|
3760
|
-
const
|
|
3776
|
+
const sn = (e) => e.replace(
|
|
3761
3777
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
3762
3778
|
(t, n, a) => a ? a.toUpperCase() : n.toLowerCase()
|
|
3763
3779
|
);
|
|
@@ -3767,8 +3783,8 @@ const an = (e) => e.replace(
|
|
|
3767
3783
|
* This source code is licensed under the ISC license.
|
|
3768
3784
|
* See the LICENSE file in the root directory of this source tree.
|
|
3769
3785
|
*/
|
|
3770
|
-
const
|
|
3771
|
-
const t =
|
|
3786
|
+
const At = (e) => {
|
|
3787
|
+
const t = sn(e);
|
|
3772
3788
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3773
3789
|
};
|
|
3774
3790
|
/**
|
|
@@ -3777,7 +3793,7 @@ const Ft = (e) => {
|
|
|
3777
3793
|
* This source code is licensed under the ISC license.
|
|
3778
3794
|
* See the LICENSE file in the root directory of this source tree.
|
|
3779
3795
|
*/
|
|
3780
|
-
var
|
|
3796
|
+
var on = {
|
|
3781
3797
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3782
3798
|
width: 24,
|
|
3783
3799
|
height: 24,
|
|
@@ -3794,7 +3810,7 @@ var sn = {
|
|
|
3794
3810
|
* This source code is licensed under the ISC license.
|
|
3795
3811
|
* See the LICENSE file in the root directory of this source tree.
|
|
3796
3812
|
*/
|
|
3797
|
-
const
|
|
3813
|
+
const ln = (e) => {
|
|
3798
3814
|
for (const t in e)
|
|
3799
3815
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
3800
3816
|
return !0;
|
|
@@ -3806,7 +3822,7 @@ const on = (e) => {
|
|
|
3806
3822
|
* This source code is licensed under the ISC license.
|
|
3807
3823
|
* See the LICENSE file in the root directory of this source tree.
|
|
3808
3824
|
*/
|
|
3809
|
-
const
|
|
3825
|
+
const cn = yt(
|
|
3810
3826
|
({
|
|
3811
3827
|
color: e = "currentColor",
|
|
3812
3828
|
size: t = 24,
|
|
@@ -3815,22 +3831,22 @@ const ln = mt(
|
|
|
3815
3831
|
className: i = "",
|
|
3816
3832
|
children: o,
|
|
3817
3833
|
iconNode: c,
|
|
3818
|
-
...
|
|
3819
|
-
}, y) =>
|
|
3834
|
+
...d
|
|
3835
|
+
}, y) => wt(
|
|
3820
3836
|
"svg",
|
|
3821
3837
|
{
|
|
3822
3838
|
ref: y,
|
|
3823
|
-
...
|
|
3839
|
+
...on,
|
|
3824
3840
|
width: t,
|
|
3825
3841
|
height: t,
|
|
3826
3842
|
stroke: e,
|
|
3827
3843
|
strokeWidth: a ? Number(n) * 24 / Number(t) : n,
|
|
3828
3844
|
className: Bt("lucide", i),
|
|
3829
|
-
...!o && !
|
|
3830
|
-
...
|
|
3845
|
+
...!o && !ln(d) && { "aria-hidden": "true" },
|
|
3846
|
+
...d
|
|
3831
3847
|
},
|
|
3832
3848
|
[
|
|
3833
|
-
...c.map(([p, x]) =>
|
|
3849
|
+
...c.map(([p, x]) => wt(p, x)),
|
|
3834
3850
|
...Array.isArray(o) ? o : [o]
|
|
3835
3851
|
]
|
|
3836
3852
|
)
|
|
@@ -3841,20 +3857,20 @@ const ln = mt(
|
|
|
3841
3857
|
* This source code is licensed under the ISC license.
|
|
3842
3858
|
* See the LICENSE file in the root directory of this source tree.
|
|
3843
3859
|
*/
|
|
3844
|
-
const
|
|
3845
|
-
const n =
|
|
3846
|
-
({ className: a, ...i }, o) =>
|
|
3860
|
+
const _t = (e, t) => {
|
|
3861
|
+
const n = yt(
|
|
3862
|
+
({ className: a, ...i }, o) => wt(cn, {
|
|
3847
3863
|
ref: o,
|
|
3848
3864
|
iconNode: t,
|
|
3849
3865
|
className: Bt(
|
|
3850
|
-
`lucide-${
|
|
3866
|
+
`lucide-${an(At(e))}`,
|
|
3851
3867
|
`lucide-${e}`,
|
|
3852
3868
|
a
|
|
3853
3869
|
),
|
|
3854
3870
|
...i
|
|
3855
3871
|
})
|
|
3856
3872
|
);
|
|
3857
|
-
return n.displayName =
|
|
3873
|
+
return n.displayName = At(e), n;
|
|
3858
3874
|
};
|
|
3859
3875
|
/**
|
|
3860
3876
|
* @license lucide-react v0.574.0 - ISC
|
|
@@ -3862,15 +3878,15 @@ const $t = (e, t) => {
|
|
|
3862
3878
|
* This source code is licensed under the ISC license.
|
|
3863
3879
|
* See the LICENSE file in the root directory of this source tree.
|
|
3864
3880
|
*/
|
|
3865
|
-
const
|
|
3881
|
+
const dn = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], jt = _t("chevron-left", dn);
|
|
3866
3882
|
/**
|
|
3867
3883
|
* @license lucide-react v0.574.0 - ISC
|
|
3868
3884
|
*
|
|
3869
3885
|
* This source code is licensed under the ISC license.
|
|
3870
3886
|
* See the LICENSE file in the root directory of this source tree.
|
|
3871
3887
|
*/
|
|
3872
|
-
const
|
|
3873
|
-
function
|
|
3888
|
+
const un = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ht = _t("chevron-right", un);
|
|
3889
|
+
function pn(e, t) {
|
|
3874
3890
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
3875
3891
|
if (e.isRequired && n)
|
|
3876
3892
|
return e.errorMessage || "This field is required";
|
|
@@ -3899,7 +3915,7 @@ function un(e, t) {
|
|
|
3899
3915
|
}
|
|
3900
3916
|
return null;
|
|
3901
3917
|
}
|
|
3902
|
-
function
|
|
3918
|
+
function mn(e) {
|
|
3903
3919
|
const t = e.flatMap(
|
|
3904
3920
|
(a, i) => (a.questions ?? []).map((o, c) => ({ question: o, groupIndex: i, qIdx: c }))
|
|
3905
3921
|
), n = /* @__PURE__ */ new Map();
|
|
@@ -3909,39 +3925,39 @@ function pn(e) {
|
|
|
3909
3925
|
}
|
|
3910
3926
|
return Array.from(n.entries()).sort(([a], [i]) => a - i).map(([, a]) => a);
|
|
3911
3927
|
}
|
|
3912
|
-
const
|
|
3928
|
+
const yn = ({
|
|
3913
3929
|
applicantId: e,
|
|
3914
3930
|
onComplete: t,
|
|
3915
3931
|
onBack: n
|
|
3916
3932
|
}) => {
|
|
3917
|
-
const { questionnaire: a, initialAnswers: i, isLoading: o, isSubmitting: c, error:
|
|
3933
|
+
const { questionnaire: a, initialAnswers: i, isLoading: o, isSubmitting: c, error: d, submit: y } = Vr(e), [p, x] = k({}), [T, v] = k({}), [A, P] = k(0);
|
|
3918
3934
|
we.useEffect(() => {
|
|
3919
3935
|
i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && x(i);
|
|
3920
3936
|
}, [i]);
|
|
3921
3937
|
const w = De(
|
|
3922
|
-
() => a ?
|
|
3938
|
+
() => a ? mn(a.questionGroups) : [],
|
|
3923
3939
|
[a]
|
|
3924
3940
|
), N = A === w.length - 1, z = w[A] ?? [], Q = ae((E, b) => {
|
|
3925
|
-
x((
|
|
3926
|
-
const V = {
|
|
3941
|
+
x(($) => ({ ...$, [E]: b })), v(($) => {
|
|
3942
|
+
const V = { ...$ };
|
|
3927
3943
|
return delete V[E], V;
|
|
3928
3944
|
});
|
|
3929
3945
|
}, []), M = ae(() => {
|
|
3930
3946
|
const E = {};
|
|
3931
3947
|
for (const { question: b } of z) {
|
|
3932
|
-
const
|
|
3933
|
-
|
|
3948
|
+
const $ = pn(b, p[b.id] ?? []);
|
|
3949
|
+
$ && (E[b.id] = $);
|
|
3934
3950
|
}
|
|
3935
3951
|
return v((b) => ({ ...b, ...E })), Object.keys(E).length === 0;
|
|
3936
3952
|
}, [z, p]), j = () => {
|
|
3937
|
-
M() &&
|
|
3953
|
+
M() && P((E) => E + 1);
|
|
3938
3954
|
}, K = () => {
|
|
3939
|
-
A > 0 ?
|
|
3955
|
+
A > 0 ? P((E) => E - 1) : n == null || n();
|
|
3940
3956
|
}, ee = async () => {
|
|
3941
3957
|
if (!(!M() || !a))
|
|
3942
3958
|
try {
|
|
3943
3959
|
const E = a.questionGroups.flatMap(
|
|
3944
|
-
(
|
|
3960
|
+
($) => ($.questions ?? []).map((V) => ({
|
|
3945
3961
|
questionId: V.id,
|
|
3946
3962
|
values: p[V.id] ?? []
|
|
3947
3963
|
}))
|
|
@@ -3955,9 +3971,9 @@ const mn = ({
|
|
|
3955
3971
|
console.error("Questionnaire submit error:", E);
|
|
3956
3972
|
}
|
|
3957
3973
|
};
|
|
3958
|
-
return o ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) :
|
|
3974
|
+
return o ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) : d ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
3959
3975
|
"Error loading questionnaire: ",
|
|
3960
|
-
|
|
3976
|
+
d.message
|
|
3961
3977
|
] }) }) }) : a ? /* @__PURE__ */ s(re, { children: [
|
|
3962
3978
|
/* @__PURE__ */ s(Se, { children: [
|
|
3963
3979
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
@@ -3984,11 +4000,11 @@ const mn = ({
|
|
|
3984
4000
|
] })
|
|
3985
4001
|
] }),
|
|
3986
4002
|
/* @__PURE__ */ r(ne, { className: "space-y-6", children: z.map(({ question: E }) => /* @__PURE__ */ r(
|
|
3987
|
-
|
|
4003
|
+
hn,
|
|
3988
4004
|
{
|
|
3989
4005
|
question: E,
|
|
3990
4006
|
value: p[E.id] ?? [],
|
|
3991
|
-
error:
|
|
4007
|
+
error: T[E.id],
|
|
3992
4008
|
onChange: (b) => Q(E.id, b)
|
|
3993
4009
|
},
|
|
3994
4010
|
E.id
|
|
@@ -4002,7 +4018,7 @@ const mn = ({
|
|
|
4002
4018
|
onClick: K,
|
|
4003
4019
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4004
4020
|
children: [
|
|
4005
|
-
/* @__PURE__ */ r(
|
|
4021
|
+
/* @__PURE__ */ r(jt, { size: 14 }),
|
|
4006
4022
|
A > 0 ? "Previous" : "Back"
|
|
4007
4023
|
]
|
|
4008
4024
|
}
|
|
@@ -4023,14 +4039,14 @@ const mn = ({
|
|
|
4023
4039
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4024
4040
|
children: [
|
|
4025
4041
|
"Next",
|
|
4026
|
-
/* @__PURE__ */ r(
|
|
4042
|
+
/* @__PURE__ */ r(Ht, { size: 14 })
|
|
4027
4043
|
]
|
|
4028
4044
|
}
|
|
4029
4045
|
)
|
|
4030
4046
|
] }),
|
|
4031
|
-
|
|
4047
|
+
d && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: d.message }) })
|
|
4032
4048
|
] }) : null;
|
|
4033
|
-
},
|
|
4049
|
+
}, hn = ({ question: e, value: t, error: n, onChange: a }) => {
|
|
4034
4050
|
var c;
|
|
4035
4051
|
const o = (((c = e.defaultAnswers) == null ? void 0 : c.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
4036
4052
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
@@ -4044,25 +4060,25 @@ const mn = ({
|
|
|
4044
4060
|
xe,
|
|
4045
4061
|
{
|
|
4046
4062
|
value: t[0] ?? "",
|
|
4047
|
-
onChange: (
|
|
4063
|
+
onChange: (d) => a([d.target.value]),
|
|
4048
4064
|
placeholder: e.subtitle ? void 0 : "Enter your answer…",
|
|
4049
4065
|
error: n,
|
|
4050
4066
|
required: e.isRequired
|
|
4051
4067
|
}
|
|
4052
4068
|
),
|
|
4053
4069
|
o === "single-select" && /* @__PURE__ */ r(
|
|
4054
|
-
|
|
4070
|
+
Ct,
|
|
4055
4071
|
{
|
|
4056
4072
|
value: t[0] ?? "",
|
|
4057
|
-
onChange: (
|
|
4058
|
-
options: (e.defaultAnswers ?? []).map((
|
|
4073
|
+
onChange: (d) => a([d.target.value]),
|
|
4074
|
+
options: (e.defaultAnswers ?? []).map((d) => ({ value: d, label: d })),
|
|
4059
4075
|
placeholder: "Select an option…",
|
|
4060
4076
|
error: n,
|
|
4061
4077
|
required: e.isRequired
|
|
4062
4078
|
}
|
|
4063
4079
|
),
|
|
4064
4080
|
o === "radio" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
4065
|
-
(e.defaultAnswers ?? []).map((
|
|
4081
|
+
(e.defaultAnswers ?? []).map((d) => /* @__PURE__ */ s(
|
|
4066
4082
|
"label",
|
|
4067
4083
|
{
|
|
4068
4084
|
className: "metakyc-option-label",
|
|
@@ -4072,8 +4088,8 @@ const mn = ({
|
|
|
4072
4088
|
"input",
|
|
4073
4089
|
{
|
|
4074
4090
|
type: "radio",
|
|
4075
|
-
checked: t[0] ===
|
|
4076
|
-
onChange: () => a([
|
|
4091
|
+
checked: t[0] === d,
|
|
4092
|
+
onChange: () => a([d]),
|
|
4077
4093
|
className: "metakyc-option-input",
|
|
4078
4094
|
style: {
|
|
4079
4095
|
width: "16px",
|
|
@@ -4090,15 +4106,15 @@ const mn = ({
|
|
|
4090
4106
|
}
|
|
4091
4107
|
}
|
|
4092
4108
|
),
|
|
4093
|
-
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children:
|
|
4109
|
+
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: d })
|
|
4094
4110
|
]
|
|
4095
4111
|
},
|
|
4096
|
-
|
|
4112
|
+
d
|
|
4097
4113
|
)),
|
|
4098
4114
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4099
4115
|
] }),
|
|
4100
4116
|
(o === "checkbox" || o === "multi-select") && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
4101
|
-
(e.defaultAnswers ?? []).map((
|
|
4117
|
+
(e.defaultAnswers ?? []).map((d) => /* @__PURE__ */ s(
|
|
4102
4118
|
"label",
|
|
4103
4119
|
{
|
|
4104
4120
|
className: "metakyc-option-label",
|
|
@@ -4108,9 +4124,9 @@ const mn = ({
|
|
|
4108
4124
|
"input",
|
|
4109
4125
|
{
|
|
4110
4126
|
type: "checkbox",
|
|
4111
|
-
checked: t.includes(
|
|
4127
|
+
checked: t.includes(d),
|
|
4112
4128
|
onChange: (y) => {
|
|
4113
|
-
y.target.checked ? a([...t,
|
|
4129
|
+
y.target.checked ? a([...t, d]) : a(t.filter((p) => p !== d));
|
|
4114
4130
|
},
|
|
4115
4131
|
className: "metakyc-option-input",
|
|
4116
4132
|
style: {
|
|
@@ -4128,17 +4144,17 @@ const mn = ({
|
|
|
4128
4144
|
}
|
|
4129
4145
|
}
|
|
4130
4146
|
),
|
|
4131
|
-
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children:
|
|
4147
|
+
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: d })
|
|
4132
4148
|
]
|
|
4133
4149
|
},
|
|
4134
|
-
|
|
4150
|
+
d
|
|
4135
4151
|
)),
|
|
4136
4152
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4137
4153
|
] }),
|
|
4138
4154
|
n && o === "text" && null
|
|
4139
4155
|
] });
|
|
4140
4156
|
};
|
|
4141
|
-
function
|
|
4157
|
+
function fn(e) {
|
|
4142
4158
|
const t = /* @__PURE__ */ new Map();
|
|
4143
4159
|
for (const n of e) {
|
|
4144
4160
|
const a = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
@@ -4146,18 +4162,18 @@ function hn(e) {
|
|
|
4146
4162
|
}
|
|
4147
4163
|
return Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
4148
4164
|
}
|
|
4149
|
-
const
|
|
4165
|
+
const gn = ({
|
|
4150
4166
|
applicantId: e,
|
|
4151
4167
|
onComplete: t,
|
|
4152
4168
|
onBack: n
|
|
4153
4169
|
}) => {
|
|
4154
|
-
const { uploadDocument: a, isLoading: i, isSubmitting: o, error: c, submit:
|
|
4155
|
-
() => a ?
|
|
4170
|
+
const { uploadDocument: a, isLoading: i, isSubmitting: o, error: c, submit: d } = Yr(e), [y, p] = k({}), [x, T] = k(null), [v, A] = k(0), [P, w] = k({}), N = De(
|
|
4171
|
+
() => a ? fn(a.uploadDocumentFiles) : [],
|
|
4156
4172
|
[a]
|
|
4157
4173
|
), z = N[v] ?? [], Q = v === N.length - 1, M = N.length, j = ae(() => {
|
|
4158
4174
|
const b = {};
|
|
4159
|
-
for (const
|
|
4160
|
-
|
|
4175
|
+
for (const $ of z)
|
|
4176
|
+
$.isRequired && (y[$.id] || []).length === 0 && (b[$.id] = `${$.displayName} is required`);
|
|
4161
4177
|
return w(b), Object.keys(b).length === 0;
|
|
4162
4178
|
}, [z, y]), K = () => {
|
|
4163
4179
|
j() && (A((b) => b + 1), w({}));
|
|
@@ -4165,14 +4181,14 @@ const fn = ({
|
|
|
4165
4181
|
v > 0 ? (A((b) => b - 1), w({})) : n == null || n();
|
|
4166
4182
|
}, E = async () => {
|
|
4167
4183
|
if (!(!j() || !a)) {
|
|
4168
|
-
|
|
4184
|
+
T(null);
|
|
4169
4185
|
try {
|
|
4170
4186
|
const b = await Promise.all(
|
|
4171
4187
|
a.uploadDocumentFiles.map(async (V) => {
|
|
4172
4188
|
const G = y[V.id] || [], _ = await Promise.all(
|
|
4173
4189
|
G.map(async (J) => ({
|
|
4174
4190
|
fileName: J.name,
|
|
4175
|
-
fileData: await
|
|
4191
|
+
fileData: await _r(J)
|
|
4176
4192
|
}))
|
|
4177
4193
|
);
|
|
4178
4194
|
return {
|
|
@@ -4180,14 +4196,14 @@ const fn = ({
|
|
|
4180
4196
|
valueList: _
|
|
4181
4197
|
};
|
|
4182
4198
|
})
|
|
4183
|
-
),
|
|
4199
|
+
), $ = {
|
|
4184
4200
|
applicantId: e,
|
|
4185
4201
|
uploadDocumentId: a.id,
|
|
4186
4202
|
uploadDocumentResults: b
|
|
4187
4203
|
};
|
|
4188
|
-
await
|
|
4204
|
+
await d($), t == null || t();
|
|
4189
4205
|
} catch (b) {
|
|
4190
|
-
|
|
4206
|
+
T((b == null ? void 0 : b.message) || "Failed to submit documents. Please try again.");
|
|
4191
4207
|
}
|
|
4192
4208
|
}
|
|
4193
4209
|
};
|
|
@@ -4242,18 +4258,18 @@ const fn = ({
|
|
|
4242
4258
|
" of ",
|
|
4243
4259
|
M
|
|
4244
4260
|
] }),
|
|
4245
|
-
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: N.map((b,
|
|
4261
|
+
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: N.map((b, $) => /* @__PURE__ */ r(
|
|
4246
4262
|
"div",
|
|
4247
4263
|
{
|
|
4248
4264
|
style: {
|
|
4249
4265
|
height: "6px",
|
|
4250
|
-
width:
|
|
4266
|
+
width: $ === v ? "20px" : "6px",
|
|
4251
4267
|
borderRadius: "999px",
|
|
4252
4268
|
transition: "all 0.2s ease",
|
|
4253
|
-
backgroundColor:
|
|
4269
|
+
backgroundColor: $ <= v ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
4254
4270
|
}
|
|
4255
4271
|
},
|
|
4256
|
-
|
|
4272
|
+
$
|
|
4257
4273
|
)) })
|
|
4258
4274
|
] })
|
|
4259
4275
|
] }),
|
|
@@ -4294,7 +4310,7 @@ const fn = ({
|
|
|
4294
4310
|
}, children: a.description })
|
|
4295
4311
|
] }),
|
|
4296
4312
|
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: z.map((b) => /* @__PURE__ */ r(
|
|
4297
|
-
|
|
4313
|
+
rn,
|
|
4298
4314
|
{
|
|
4299
4315
|
label: b.displayName,
|
|
4300
4316
|
subtitle: b.subtitle,
|
|
@@ -4302,13 +4318,13 @@ const fn = ({
|
|
|
4302
4318
|
multiple: b.multipleFile,
|
|
4303
4319
|
maxSize: b.maxEachFileSizeByte,
|
|
4304
4320
|
required: b.isRequired,
|
|
4305
|
-
error:
|
|
4321
|
+
error: P[b.id],
|
|
4306
4322
|
value: y[b.id] || [],
|
|
4307
|
-
onChange: (
|
|
4308
|
-
|
|
4323
|
+
onChange: ($) => {
|
|
4324
|
+
T(null), w((V) => {
|
|
4309
4325
|
const G = { ...V };
|
|
4310
4326
|
return delete G[b.id], G;
|
|
4311
|
-
}), p((V) => ({ ...V, [b.id]:
|
|
4327
|
+
}), p((V) => ({ ...V, [b.id]: $ }));
|
|
4312
4328
|
}
|
|
4313
4329
|
},
|
|
4314
4330
|
b.id
|
|
@@ -4363,9 +4379,9 @@ const fn = ({
|
|
|
4363
4379
|
)
|
|
4364
4380
|
] }) })
|
|
4365
4381
|
] }) : null;
|
|
4366
|
-
},
|
|
4367
|
-
const { overview: a, isLoading: i, isSubmitting: o, error: c, passOverview:
|
|
4368
|
-
await
|
|
4382
|
+
}, bn = ({ applicantId: e, onComplete: t, onBack: n }) => {
|
|
4383
|
+
const { overview: a, isLoading: i, isSubmitting: o, error: c, passOverview: d } = Qr(e), y = async () => {
|
|
4384
|
+
await d(), t == null || t();
|
|
4369
4385
|
};
|
|
4370
4386
|
return i ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
4371
4387
|
"Error loading overview: ",
|
|
@@ -4407,7 +4423,7 @@ const fn = ({
|
|
|
4407
4423
|
] })
|
|
4408
4424
|
] }) : null;
|
|
4409
4425
|
};
|
|
4410
|
-
function
|
|
4426
|
+
function xn(e) {
|
|
4411
4427
|
const t = (e ?? "en").toLowerCase().replace("_", "-");
|
|
4412
4428
|
try {
|
|
4413
4429
|
return Intl.NumberFormat.supportedLocalesOf([t]), t;
|
|
@@ -4415,11 +4431,11 @@ function bn(e) {
|
|
|
4415
4431
|
return "en";
|
|
4416
4432
|
}
|
|
4417
4433
|
}
|
|
4418
|
-
function
|
|
4419
|
-
return e.valueDataType ===
|
|
4434
|
+
function vn(e) {
|
|
4435
|
+
return e.valueDataType === Ke.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
|
|
4420
4436
|
}
|
|
4421
|
-
function
|
|
4422
|
-
const n = new Intl.NumberFormat(
|
|
4437
|
+
function kn(e, t) {
|
|
4438
|
+
const n = new Intl.NumberFormat(xn(t), {
|
|
4423
4439
|
minimumFractionDigits: 0,
|
|
4424
4440
|
maximumFractionDigits: 2
|
|
4425
4441
|
});
|
|
@@ -4428,7 +4444,7 @@ function vn(e, t) {
|
|
|
4428
4444
|
return isNaN(i) ? a : n.format(i);
|
|
4429
4445
|
});
|
|
4430
4446
|
}
|
|
4431
|
-
function
|
|
4447
|
+
function wn(e, t) {
|
|
4432
4448
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
4433
4449
|
if (e.isRequired && n)
|
|
4434
4450
|
return e.errorMessage || `${e.displayName} is required`;
|
|
@@ -4440,7 +4456,7 @@ function kn(e, t) {
|
|
|
4440
4456
|
return e.errorMessage || "Invalid format";
|
|
4441
4457
|
} catch {
|
|
4442
4458
|
}
|
|
4443
|
-
const i = e.valueDataType ===
|
|
4459
|
+
const i = e.valueDataType === Ke.Integer || e.valueDataType === Ke.Money || e.valueDataType === Ke.DigitOnly;
|
|
4444
4460
|
if (i && a.trim() !== "") {
|
|
4445
4461
|
const o = Number(a);
|
|
4446
4462
|
if (!isNaN(o)) {
|
|
@@ -4458,53 +4474,53 @@ function kn(e, t) {
|
|
|
4458
4474
|
}
|
|
4459
4475
|
return null;
|
|
4460
4476
|
}
|
|
4461
|
-
function
|
|
4477
|
+
function Sn(e) {
|
|
4462
4478
|
const t = /* @__PURE__ */ new Map();
|
|
4463
4479
|
return e.forEach((n, a) => {
|
|
4464
4480
|
const i = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
4465
4481
|
t.has(i) || t.set(i, []), t.get(i).push({ criterion: n, idx: a });
|
|
4466
4482
|
}), Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
4467
4483
|
}
|
|
4468
|
-
function
|
|
4484
|
+
function Cn(e) {
|
|
4469
4485
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
4470
4486
|
}
|
|
4471
|
-
const
|
|
4487
|
+
const Nn = ({
|
|
4472
4488
|
applicantId: e,
|
|
4473
4489
|
onComplete: t,
|
|
4474
4490
|
onBack: n
|
|
4475
4491
|
}) => {
|
|
4476
|
-
const { config: a } =
|
|
4492
|
+
const { config: a } = Pe(), i = a.locale ?? "en", { criteria: o, initialAnswers: c, isLoading: d, isSubmitting: y, error: p, submit: x } = Jr(e), [T, v] = k({}), [A, P] = k({}), [w, N] = k(0), [z, Q] = k(!1);
|
|
4477
4493
|
we.useEffect(() => {
|
|
4478
|
-
c && Object.keys(c).length > 0 && Object.keys(
|
|
4494
|
+
c && Object.keys(c).length > 0 && Object.keys(T).length === 0 && v(c);
|
|
4479
4495
|
}, [c]);
|
|
4480
4496
|
const M = De(
|
|
4481
|
-
() => o && o.length > 0 ?
|
|
4497
|
+
() => o && o.length > 0 ? Sn(o) : [],
|
|
4482
4498
|
[o]
|
|
4483
4499
|
), j = w === M.length - 1, K = M[w] ?? [];
|
|
4484
4500
|
we.useEffect(() => {
|
|
4485
|
-
!
|
|
4486
|
-
}, [
|
|
4501
|
+
!d && o && o.length === 0 && !z && !y && (Q(!0), x({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
4502
|
+
}, [d, o, z, y, x, e, t]);
|
|
4487
4503
|
const ee = ae((G, _) => {
|
|
4488
|
-
v((J) => ({ ...J, [G]: _ })),
|
|
4504
|
+
v((J) => ({ ...J, [G]: _ })), P((J) => {
|
|
4489
4505
|
const se = { ...J };
|
|
4490
4506
|
return delete se[G], se;
|
|
4491
4507
|
});
|
|
4492
4508
|
}, []), E = ae(() => {
|
|
4493
4509
|
const G = {};
|
|
4494
4510
|
for (const { criterion: _ } of K) {
|
|
4495
|
-
const J =
|
|
4511
|
+
const J = wn(_, T[_.id] ?? []);
|
|
4496
4512
|
J && (G[_.id] = J);
|
|
4497
4513
|
}
|
|
4498
|
-
return
|
|
4499
|
-
}, [K,
|
|
4514
|
+
return P((_) => ({ ..._, ...G })), Object.keys(G).length === 0;
|
|
4515
|
+
}, [K, T]), b = () => {
|
|
4500
4516
|
E() && N((G) => G + 1);
|
|
4501
|
-
},
|
|
4517
|
+
}, $ = () => {
|
|
4502
4518
|
w > 0 ? N((G) => G - 1) : n == null || n();
|
|
4503
4519
|
}, V = async () => {
|
|
4504
4520
|
if (!(!E() || !o))
|
|
4505
4521
|
try {
|
|
4506
4522
|
const G = o.map((J) => {
|
|
4507
|
-
const se = (
|
|
4523
|
+
const se = (T[J.id] ?? []).filter((Y) => Y && Y.trim());
|
|
4508
4524
|
return se.length > 0 ? { riskCriteriaId: J.id, values: se } : null;
|
|
4509
4525
|
}).filter((J) => J !== null);
|
|
4510
4526
|
await x({ applicantId: e, criteriaValueInputs: G }), t == null || t();
|
|
@@ -4512,10 +4528,10 @@ const Cn = ({
|
|
|
4512
4528
|
console.error("Risk scoring submit error:", G);
|
|
4513
4529
|
}
|
|
4514
4530
|
};
|
|
4515
|
-
return
|
|
4531
|
+
return d ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
|
|
4516
4532
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
4517
4533
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
4518
|
-
] }) }) : !
|
|
4534
|
+
] }) }) : !d && o && o.length === 0 ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
|
|
4519
4535
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
4520
4536
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
4521
4537
|
] }) }) : p ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
@@ -4547,10 +4563,10 @@ const Cn = ({
|
|
|
4547
4563
|
] })
|
|
4548
4564
|
] }),
|
|
4549
4565
|
/* @__PURE__ */ r(ne, { className: "space-y-6", children: K.map(({ criterion: G }) => /* @__PURE__ */ r(
|
|
4550
|
-
|
|
4566
|
+
Rn,
|
|
4551
4567
|
{
|
|
4552
4568
|
criterion: G,
|
|
4553
|
-
value:
|
|
4569
|
+
value: T[G.id] ?? [],
|
|
4554
4570
|
error: A[G.id],
|
|
4555
4571
|
locale: i,
|
|
4556
4572
|
onChange: (_) => ee(G.id, _)
|
|
@@ -4563,10 +4579,10 @@ const Cn = ({
|
|
|
4563
4579
|
{
|
|
4564
4580
|
type: "button",
|
|
4565
4581
|
variant: "outline",
|
|
4566
|
-
onClick:
|
|
4582
|
+
onClick: $,
|
|
4567
4583
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4568
4584
|
children: [
|
|
4569
|
-
/* @__PURE__ */ r(
|
|
4585
|
+
/* @__PURE__ */ r(jt, { size: 14 }),
|
|
4570
4586
|
w > 0 ? "Previous" : "Back"
|
|
4571
4587
|
]
|
|
4572
4588
|
}
|
|
@@ -4579,15 +4595,15 @@ const Cn = ({
|
|
|
4579
4595
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4580
4596
|
children: [
|
|
4581
4597
|
"Next",
|
|
4582
|
-
/* @__PURE__ */ r(
|
|
4598
|
+
/* @__PURE__ */ r(Ht, { size: 14 })
|
|
4583
4599
|
]
|
|
4584
4600
|
}
|
|
4585
4601
|
)
|
|
4586
4602
|
] }),
|
|
4587
4603
|
p && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: p.message }) })
|
|
4588
4604
|
] }) : null;
|
|
4589
|
-
},
|
|
4590
|
-
const o =
|
|
4605
|
+
}, Rn = ({ criterion: e, value: t, error: n, locale: a, onChange: i }) => {
|
|
4606
|
+
const o = Cn(e), c = e.valueDataType === Ke.Integer || e.valueDataType === Ke.Money || e.valueDataType === Ke.DigitOnly, d = vn(e), y = (p) => d ? kn(p, a) : p;
|
|
4591
4607
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
4592
4608
|
/* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4593
4609
|
e.displayName,
|
|
@@ -4607,7 +4623,7 @@ const Cn = ({
|
|
|
4607
4623
|
min: e.min,
|
|
4608
4624
|
max: e.max,
|
|
4609
4625
|
onKeyDown: (p) => {
|
|
4610
|
-
e.valueDataType ===
|
|
4626
|
+
e.valueDataType === Ke.DigitOnly && ["e", "E", "+", "-", "."].includes(p.key) && p.preventDefault();
|
|
4611
4627
|
}
|
|
4612
4628
|
}
|
|
4613
4629
|
),
|
|
@@ -4660,7 +4676,7 @@ const Cn = ({
|
|
|
4660
4676
|
type: "checkbox",
|
|
4661
4677
|
checked: t.includes(p),
|
|
4662
4678
|
onChange: (x) => {
|
|
4663
|
-
x.target.checked ? i([...t, p]) : i(t.filter((
|
|
4679
|
+
x.target.checked ? i([...t, p]) : i(t.filter((T) => T !== p));
|
|
4664
4680
|
},
|
|
4665
4681
|
className: "metakyc-option-input",
|
|
4666
4682
|
style: {
|
|
@@ -4686,7 +4702,7 @@ const Cn = ({
|
|
|
4686
4702
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4687
4703
|
] }),
|
|
4688
4704
|
o === "country" && /* @__PURE__ */ r(
|
|
4689
|
-
|
|
4705
|
+
Ct,
|
|
4690
4706
|
{
|
|
4691
4707
|
value: t[0] ?? "",
|
|
4692
4708
|
onChange: (p) => i([p.target.value]),
|
|
@@ -4703,18 +4719,18 @@ const Cn = ({
|
|
|
4703
4719
|
}
|
|
4704
4720
|
)
|
|
4705
4721
|
] });
|
|
4706
|
-
},
|
|
4722
|
+
}, In = ({
|
|
4707
4723
|
applicantId: e,
|
|
4708
4724
|
onComplete: t,
|
|
4709
4725
|
onBack: n
|
|
4710
4726
|
}) => {
|
|
4711
|
-
const { investorCategorizationService: a } =
|
|
4712
|
-
return /* @__PURE__ */ r("form", { onSubmit: async (
|
|
4713
|
-
if (
|
|
4727
|
+
const { investorCategorizationService: a } = Pe(), [i, o] = k(null), [c, d] = k(!1), [y, p] = k(null);
|
|
4728
|
+
return /* @__PURE__ */ r("form", { onSubmit: async (T) => {
|
|
4729
|
+
if (T.preventDefault(), i === null) {
|
|
4714
4730
|
p("Please select an investor type");
|
|
4715
4731
|
return;
|
|
4716
4732
|
}
|
|
4717
|
-
|
|
4733
|
+
d(!0), p(null);
|
|
4718
4734
|
try {
|
|
4719
4735
|
const v = {
|
|
4720
4736
|
applicantId: e,
|
|
@@ -4726,7 +4742,7 @@ const Cn = ({
|
|
|
4726
4742
|
} catch (v) {
|
|
4727
4743
|
console.error("Error submitting investor categorization:", v), p(v.message || "Failed to submit investor categorization");
|
|
4728
4744
|
} finally {
|
|
4729
|
-
|
|
4745
|
+
d(!1);
|
|
4730
4746
|
}
|
|
4731
4747
|
}, children: /* @__PURE__ */ s(re, { children: [
|
|
4732
4748
|
/* @__PURE__ */ s(Se, { children: [
|
|
@@ -4845,73 +4861,73 @@ const Cn = ({
|
|
|
4845
4861
|
] })
|
|
4846
4862
|
] }) });
|
|
4847
4863
|
};
|
|
4848
|
-
function
|
|
4864
|
+
function Pt(e) {
|
|
4849
4865
|
const t = e.split(":").map(Number);
|
|
4850
4866
|
return t.length === 3 ? t[0] * 3600 + t[1] * 60 + t[2] : 0;
|
|
4851
4867
|
}
|
|
4852
|
-
function
|
|
4868
|
+
function vt(e) {
|
|
4853
4869
|
const t = Math.floor(e / 60), n = e % 60;
|
|
4854
4870
|
return `${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
|
|
4855
4871
|
}
|
|
4856
|
-
const
|
|
4872
|
+
const En = ({
|
|
4857
4873
|
applicantId: e,
|
|
4858
4874
|
onComplete: t,
|
|
4859
4875
|
onBack: n
|
|
4860
4876
|
}) => {
|
|
4861
|
-
const { appropriatenessTestService: a } =
|
|
4877
|
+
const { appropriatenessTestService: a } = Pe(), [i, o] = k(null), [c, d] = k(!0), [y, p] = k(!1), [x, T] = k(null), [v, A] = k({}), [P, w] = k(0), [N, z] = k(!1), [Q, M] = k(!1), [j, K] = k(0), [ee, E] = k(0), [b, $] = k(null);
|
|
4862
4878
|
ge(() => {
|
|
4863
4879
|
(async () => {
|
|
4864
4880
|
try {
|
|
4865
|
-
|
|
4866
|
-
const
|
|
4867
|
-
if (o(
|
|
4868
|
-
const H =
|
|
4881
|
+
d(!0), T(null);
|
|
4882
|
+
const B = await a.getAppropriatenessTest(e);
|
|
4883
|
+
if (o(B), B.waitTimeSpanForNextTry && B.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4884
|
+
const H = Pt(B.waitTimeSpanForNextTry);
|
|
4869
4885
|
H > 0 && K(H);
|
|
4870
4886
|
}
|
|
4871
|
-
} catch (
|
|
4872
|
-
|
|
4887
|
+
} catch (B) {
|
|
4888
|
+
T(B.message || "Failed to load appropriateness test");
|
|
4873
4889
|
} finally {
|
|
4874
|
-
|
|
4890
|
+
d(!1);
|
|
4875
4891
|
}
|
|
4876
4892
|
})();
|
|
4877
4893
|
}, [e, a]), ge(() => {
|
|
4878
|
-
if (!N ||
|
|
4879
|
-
const
|
|
4894
|
+
if (!N || P <= 0) return;
|
|
4895
|
+
const B = setInterval(() => {
|
|
4880
4896
|
w((H) => H <= 1 ? (M(!0), 0) : H - 1);
|
|
4881
4897
|
}, 1e3);
|
|
4882
|
-
return () => clearInterval(
|
|
4883
|
-
}, [N,
|
|
4898
|
+
return () => clearInterval(B);
|
|
4899
|
+
}, [N, P]), ge(() => {
|
|
4884
4900
|
if (j <= 0) return;
|
|
4885
|
-
const
|
|
4901
|
+
const B = setInterval(() => {
|
|
4886
4902
|
K((H) => H <= 1 ? 0 : H - 1);
|
|
4887
4903
|
}, 1e3);
|
|
4888
|
-
return () => clearInterval(
|
|
4904
|
+
return () => clearInterval(B);
|
|
4889
4905
|
}, [j]), ge(() => {
|
|
4890
4906
|
Q && !y && J();
|
|
4891
4907
|
}, [Q]);
|
|
4892
4908
|
const V = () => {
|
|
4893
|
-
i && (z(!0), w(i.testDurationSec), E(0), A({}),
|
|
4894
|
-
}, G = (
|
|
4895
|
-
A((fe) => ({ ...fe, [
|
|
4909
|
+
i && (z(!0), w(i.testDurationSec), E(0), A({}), T(null));
|
|
4910
|
+
}, G = (B, H) => {
|
|
4911
|
+
A((fe) => ({ ...fe, [B]: H }));
|
|
4896
4912
|
}, _ = ae(async () => {
|
|
4897
4913
|
try {
|
|
4898
|
-
const
|
|
4899
|
-
if (o(
|
|
4900
|
-
const H =
|
|
4914
|
+
const B = await a.getAppropriatenessTest(e);
|
|
4915
|
+
if (o(B), B.waitTimeSpanForNextTry && B.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4916
|
+
const H = Pt(B.waitTimeSpanForNextTry);
|
|
4901
4917
|
H > 0 && K(H);
|
|
4902
4918
|
}
|
|
4903
4919
|
} catch {
|
|
4904
4920
|
}
|
|
4905
|
-
}, [e, a]), J = async (
|
|
4921
|
+
}, [e, a]), J = async (B) => {
|
|
4906
4922
|
if (i) {
|
|
4907
4923
|
if (!Q) {
|
|
4908
4924
|
const H = i.appropriatenessQuestions.length - Object.keys(v).length;
|
|
4909
4925
|
if (H > 0) {
|
|
4910
|
-
|
|
4926
|
+
T(`Please answer all questions. ${H} remaining.`);
|
|
4911
4927
|
return;
|
|
4912
4928
|
}
|
|
4913
4929
|
}
|
|
4914
|
-
p(!0),
|
|
4930
|
+
p(!0), T(null);
|
|
4915
4931
|
try {
|
|
4916
4932
|
const H = i.appropriatenessQuestions.map(
|
|
4917
4933
|
(I) => ({ appropriatenessQuestionId: I.id, value: v[I.id] || "" })
|
|
@@ -4922,15 +4938,15 @@ const In = ({
|
|
|
4922
4938
|
};
|
|
4923
4939
|
try {
|
|
4924
4940
|
const I = await a.fillAppropriatenessTest(fe);
|
|
4925
|
-
I.isSuccess ?
|
|
4941
|
+
I.isSuccess ? $({ success: !0, message: I.message || "Congratulations! You have passed the test." }) : ($({ success: !1, message: I.message || "You did not pass the test." }), setTimeout(() => _(), 1e3));
|
|
4926
4942
|
} catch (I) {
|
|
4927
4943
|
if (I.code === 400 && I.message)
|
|
4928
|
-
|
|
4944
|
+
$({ success: !1, message: I.message }), setTimeout(() => _(), 1500);
|
|
4929
4945
|
else
|
|
4930
4946
|
throw I;
|
|
4931
4947
|
}
|
|
4932
4948
|
} catch (H) {
|
|
4933
|
-
|
|
4949
|
+
T(H.message || "Failed to submit test. Please try again."), se();
|
|
4934
4950
|
} finally {
|
|
4935
4951
|
p(!1);
|
|
4936
4952
|
}
|
|
@@ -4967,7 +4983,7 @@ const In = ({
|
|
|
4967
4983
|
fontWeight: 700,
|
|
4968
4984
|
color: "var(--metakyc-primary, #2563eb)",
|
|
4969
4985
|
fontVariantNumeric: "tabular-nums"
|
|
4970
|
-
}, children:
|
|
4986
|
+
}, children: vt(j) }) }),
|
|
4971
4987
|
/* @__PURE__ */ r("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: "Please wait before retrying" }),
|
|
4972
4988
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: "You can attempt the test again once the timer expires" }),
|
|
4973
4989
|
x && /* @__PURE__ */ r("div", { style: {
|
|
@@ -4980,8 +4996,8 @@ const In = ({
|
|
|
4980
4996
|
] }) })
|
|
4981
4997
|
] });
|
|
4982
4998
|
if (b) {
|
|
4983
|
-
const
|
|
4984
|
-
|
|
4999
|
+
const B = () => {
|
|
5000
|
+
$(null), se(), T(null);
|
|
4985
5001
|
};
|
|
4986
5002
|
return /* @__PURE__ */ s(re, { children: [
|
|
4987
5003
|
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { style: {
|
|
@@ -5051,9 +5067,9 @@ const In = ({
|
|
|
5051
5067
|
margin: 0
|
|
5052
5068
|
}, children: "No attempts remaining. Please contact support for assistance." }) })
|
|
5053
5069
|
] }) }),
|
|
5054
|
-
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: b.success ? /* @__PURE__ */ r(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ s(
|
|
5055
|
-
Y > 0 && j <= 0 && /* @__PURE__ */ r(Z, { type: "button", onClick:
|
|
5056
|
-
Y > 0 && j > 0 && /* @__PURE__ */ r(Z, { type: "button", onClick:
|
|
5070
|
+
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: b.success ? /* @__PURE__ */ r(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ s(lt, { children: [
|
|
5071
|
+
Y > 0 && j <= 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "Retake Test" }),
|
|
5072
|
+
Y > 0 && j > 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "OK" }),
|
|
5057
5073
|
Y <= 0 && n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" })
|
|
5058
5074
|
] }) }) })
|
|
5059
5075
|
] });
|
|
@@ -5082,11 +5098,11 @@ const In = ({
|
|
|
5082
5098
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-secondary, #374151)", margin: 0, lineHeight: 1.5 }, children: i.description })
|
|
5083
5099
|
] }),
|
|
5084
5100
|
/* @__PURE__ */ s("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "12px", marginBottom: "20px" }, children: [
|
|
5085
|
-
/* @__PURE__ */ r(
|
|
5086
|
-
/* @__PURE__ */ r(
|
|
5087
|
-
/* @__PURE__ */ r(
|
|
5101
|
+
/* @__PURE__ */ r(ht, { icon: "questions", label: "Questions", value: String(i.totalQuestionCount) }),
|
|
5102
|
+
/* @__PURE__ */ r(ht, { icon: "time", label: "Time Limit", value: vt(i.testDurationSec) }),
|
|
5103
|
+
/* @__PURE__ */ r(ht, { icon: "target", label: "Pass Requirement", value: `${i.testCorrectAnswerPassLimit} correct` }),
|
|
5088
5104
|
/* @__PURE__ */ r(
|
|
5089
|
-
|
|
5105
|
+
ht,
|
|
5090
5106
|
{
|
|
5091
5107
|
icon: "retry",
|
|
5092
5108
|
label: "Attempts Left",
|
|
@@ -5127,7 +5143,7 @@ const In = ({
|
|
|
5127
5143
|
/* @__PURE__ */ r(Z, { type: "button", onClick: V, disabled: Y <= 0, children: "Start Test" })
|
|
5128
5144
|
] }) })
|
|
5129
5145
|
] });
|
|
5130
|
-
const me = i.appropriatenessQuestions[ee], ke = ee === ve - 1, F = ue === ve, U =
|
|
5146
|
+
const me = i.appropriatenessQuestions[ee], ke = ee === ve - 1, F = ue === ve, U = P <= 60;
|
|
5131
5147
|
return /* @__PURE__ */ s(re, { children: [
|
|
5132
5148
|
/* @__PURE__ */ s(Se, { children: [
|
|
5133
5149
|
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
@@ -5172,7 +5188,7 @@ const In = ({
|
|
|
5172
5188
|
fontVariantNumeric: "tabular-nums",
|
|
5173
5189
|
color: U ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-text-primary, #111827)",
|
|
5174
5190
|
transition: "color 0.3s ease"
|
|
5175
|
-
}, children:
|
|
5191
|
+
}, children: vt(P) })
|
|
5176
5192
|
] })
|
|
5177
5193
|
] }),
|
|
5178
5194
|
/* @__PURE__ */ s("div", { style: { marginTop: "12px" }, children: [
|
|
@@ -5208,12 +5224,12 @@ const In = ({
|
|
|
5208
5224
|
] }),
|
|
5209
5225
|
/* @__PURE__ */ s(ne, { children: [
|
|
5210
5226
|
me && /* @__PURE__ */ r(
|
|
5211
|
-
|
|
5227
|
+
An,
|
|
5212
5228
|
{
|
|
5213
5229
|
question: me,
|
|
5214
5230
|
index: ee,
|
|
5215
5231
|
selectedAnswer: v[me.id],
|
|
5216
|
-
onSelect: (
|
|
5232
|
+
onSelect: (B) => G(me.id, B),
|
|
5217
5233
|
disabled: y
|
|
5218
5234
|
}
|
|
5219
5235
|
),
|
|
@@ -5223,7 +5239,7 @@ const In = ({
|
|
|
5223
5239
|
gap: "6px",
|
|
5224
5240
|
marginTop: "20px",
|
|
5225
5241
|
flexWrap: "wrap"
|
|
5226
|
-
}, children: i.appropriatenessQuestions.map((
|
|
5242
|
+
}, children: i.appropriatenessQuestions.map((B, H) => /* @__PURE__ */ r(
|
|
5227
5243
|
"button",
|
|
5228
5244
|
{
|
|
5229
5245
|
type: "button",
|
|
@@ -5233,8 +5249,8 @@ const In = ({
|
|
|
5233
5249
|
height: "28px",
|
|
5234
5250
|
borderRadius: "8px",
|
|
5235
5251
|
border: H === ee ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
|
|
5236
|
-
backgroundColor: v[
|
|
5237
|
-
color: v[
|
|
5252
|
+
backgroundColor: v[B.id] ? H === ee ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : H === ee ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
|
|
5253
|
+
color: v[B.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
5238
5254
|
fontSize: "12px",
|
|
5239
5255
|
fontWeight: 600,
|
|
5240
5256
|
cursor: "pointer",
|
|
@@ -5246,7 +5262,7 @@ const In = ({
|
|
|
5246
5262
|
},
|
|
5247
5263
|
children: H + 1
|
|
5248
5264
|
},
|
|
5249
|
-
|
|
5265
|
+
B.id
|
|
5250
5266
|
)) }),
|
|
5251
5267
|
Q && /* @__PURE__ */ s("div", { style: {
|
|
5252
5268
|
marginTop: "16px",
|
|
@@ -5279,7 +5295,7 @@ const In = ({
|
|
|
5279
5295
|
type: "button",
|
|
5280
5296
|
variant: "outline",
|
|
5281
5297
|
onClick: () => {
|
|
5282
|
-
ee > 0 ? E((
|
|
5298
|
+
ee > 0 ? E((B) => B - 1) : n == null || n();
|
|
5283
5299
|
},
|
|
5284
5300
|
disabled: y,
|
|
5285
5301
|
children: ee > 0 ? "Previous" : "Cancel"
|
|
@@ -5290,7 +5306,7 @@ const In = ({
|
|
|
5290
5306
|
Z,
|
|
5291
5307
|
{
|
|
5292
5308
|
type: "button",
|
|
5293
|
-
onClick: () => E((
|
|
5309
|
+
onClick: () => E((B) => B + 1),
|
|
5294
5310
|
children: "Next"
|
|
5295
5311
|
}
|
|
5296
5312
|
),
|
|
@@ -5308,7 +5324,7 @@ const In = ({
|
|
|
5308
5324
|
] })
|
|
5309
5325
|
] }) })
|
|
5310
5326
|
] });
|
|
5311
|
-
},
|
|
5327
|
+
}, Fn = {
|
|
5312
5328
|
questions: /* @__PURE__ */ s("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5313
5329
|
/* @__PURE__ */ r("path", { d: "M9 11l3 3L22 4" }),
|
|
5314
5330
|
/* @__PURE__ */ r("path", { d: "M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" })
|
|
@@ -5326,7 +5342,7 @@ const In = ({
|
|
|
5326
5342
|
/* @__PURE__ */ r("polyline", { points: "23 4 23 10 17 10" }),
|
|
5327
5343
|
/* @__PURE__ */ r("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })
|
|
5328
5344
|
] })
|
|
5329
|
-
},
|
|
5345
|
+
}, ht = ({ icon: e, label: t, value: n, variant: a = "default" }) => {
|
|
5330
5346
|
const i = a === "warning";
|
|
5331
5347
|
return /* @__PURE__ */ s("div", { style: {
|
|
5332
5348
|
display: "flex",
|
|
@@ -5340,7 +5356,7 @@ const In = ({
|
|
|
5340
5356
|
/* @__PURE__ */ r("div", { style: {
|
|
5341
5357
|
color: i ? "#f59e0b" : "var(--metakyc-primary, #2563eb)",
|
|
5342
5358
|
flexShrink: 0
|
|
5343
|
-
}, children:
|
|
5359
|
+
}, children: Fn[e] }),
|
|
5344
5360
|
/* @__PURE__ */ s("div", { children: [
|
|
5345
5361
|
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0 }, children: t }),
|
|
5346
5362
|
/* @__PURE__ */ r("p", { style: {
|
|
@@ -5352,7 +5368,7 @@ const In = ({
|
|
|
5352
5368
|
}, children: n })
|
|
5353
5369
|
] })
|
|
5354
5370
|
] });
|
|
5355
|
-
},
|
|
5371
|
+
}, An = ({ question: e, selectedAnswer: t, onSelect: n, disabled: a }) => /* @__PURE__ */ s("div", { children: [
|
|
5356
5372
|
/* @__PURE__ */ s("div", { style: { marginBottom: "16px" }, children: [
|
|
5357
5373
|
e.groupName && /* @__PURE__ */ r("span", { style: {
|
|
5358
5374
|
display: "inline-block",
|
|
@@ -5388,11 +5404,11 @@ const In = ({
|
|
|
5388
5404
|
transition: "all 0.15s ease",
|
|
5389
5405
|
opacity: a ? 0.6 : 1
|
|
5390
5406
|
},
|
|
5391
|
-
onMouseEnter: (
|
|
5392
|
-
!a && !c && (
|
|
5407
|
+
onMouseEnter: (d) => {
|
|
5408
|
+
!a && !c && (d.currentTarget.style.borderColor = "color-mix(in srgb, var(--metakyc-primary, #2563eb) 50%, var(--metakyc-border, #e5e7eb))");
|
|
5393
5409
|
},
|
|
5394
|
-
onMouseLeave: (
|
|
5395
|
-
c || (
|
|
5410
|
+
onMouseLeave: (d) => {
|
|
5411
|
+
c || (d.currentTarget.style.borderColor = "var(--metakyc-border, #e5e7eb)");
|
|
5396
5412
|
},
|
|
5397
5413
|
children: [
|
|
5398
5414
|
/* @__PURE__ */ r("div", { style: {
|
|
@@ -5434,15 +5450,15 @@ const In = ({
|
|
|
5434
5450
|
o
|
|
5435
5451
|
);
|
|
5436
5452
|
}) })
|
|
5437
|
-
] }),
|
|
5453
|
+
] }), Pn = ({
|
|
5438
5454
|
applicantId: e,
|
|
5439
5455
|
onComplete: t,
|
|
5440
5456
|
onBack: n
|
|
5441
5457
|
}) => {
|
|
5442
|
-
var
|
|
5443
|
-
const { applicantService: a, baseInformationService: i, identityService: o, config: c, currentTheme:
|
|
5444
|
-
|
|
5445
|
-
const H =
|
|
5458
|
+
var Ze, je, it, Ye;
|
|
5459
|
+
const { applicantService: a, baseInformationService: i, identityService: o, config: c, currentTheme: d } = Pe(), { identityData: y, provider: p, token: x, isLoading: T, error: v, requestIdentity: A, restartIdentity: P } = Gr(e), [w, N] = k(null), [z, Q] = k(null), [M, j] = k([]), [K, ee] = k([]), [E, b] = k(!0), [$, V] = k(!1), [G, _] = k(null), [J, se] = k(!1), Y = we.useRef(!1), [ve, ue] = k({}), [me, ke] = k({}), F = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, U = !!(d != null && d.reviewPageDisabled), B = de(!1);
|
|
5460
|
+
B.current = U;
|
|
5461
|
+
const H = Gt({
|
|
5446
5462
|
defaultValues: {
|
|
5447
5463
|
street: "",
|
|
5448
5464
|
streetNumber: "",
|
|
@@ -5471,38 +5487,38 @@ const In = ({
|
|
|
5471
5487
|
j(m);
|
|
5472
5488
|
const R = /* @__PURE__ */ new Set(), L = W.filter((f) => f.countryCode).map((f) => ({ value: f.countryCode, label: `${f.countryCode} – ${f.name}` })).filter((f) => R.has(f.value) ? !1 : (R.add(f.value), !0));
|
|
5473
5489
|
ee(L);
|
|
5474
|
-
const
|
|
5490
|
+
const u = O.applicantRequestData;
|
|
5475
5491
|
if (ue({
|
|
5476
|
-
firstName: (
|
|
5477
|
-
lastName: (
|
|
5478
|
-
email: (
|
|
5479
|
-
dateOfBirth: (
|
|
5480
|
-
title: (
|
|
5481
|
-
salutation: (
|
|
5482
|
-
phonenumber: (
|
|
5483
|
-
mobileCountryCode: (
|
|
5484
|
-
street: (
|
|
5485
|
-
streetNumber: (
|
|
5486
|
-
city: (
|
|
5487
|
-
zip: (
|
|
5488
|
-
country: (
|
|
5489
|
-
nationality: (
|
|
5490
|
-
taxCountry: (
|
|
5491
|
-
countryOfBirth: (
|
|
5492
|
-
placeOfBirth: (
|
|
5493
|
-
educationLevel: (
|
|
5494
|
-
occupation: (
|
|
5495
|
-
taxNumber: (
|
|
5496
|
-
defaultLanguage: (
|
|
5492
|
+
firstName: (u == null ? void 0 : u.firstName) || "",
|
|
5493
|
+
lastName: (u == null ? void 0 : u.lastName) || "",
|
|
5494
|
+
email: (u == null ? void 0 : u.email) || "",
|
|
5495
|
+
dateOfBirth: (u == null ? void 0 : u.dateOfBirth) || "",
|
|
5496
|
+
title: (u == null ? void 0 : u.title) || "",
|
|
5497
|
+
salutation: (u == null ? void 0 : u.salutation) || "",
|
|
5498
|
+
phonenumber: (u == null ? void 0 : u.phonenumber) || "",
|
|
5499
|
+
mobileCountryCode: (u == null ? void 0 : u.mobileCountryCode) || "",
|
|
5500
|
+
street: (u == null ? void 0 : u.street) || "",
|
|
5501
|
+
streetNumber: (u == null ? void 0 : u.streetNumber) || "",
|
|
5502
|
+
city: (u == null ? void 0 : u.city) || "",
|
|
5503
|
+
zip: (u == null ? void 0 : u.zip) || "",
|
|
5504
|
+
country: (u == null ? void 0 : u.country) || "",
|
|
5505
|
+
nationality: (u == null ? void 0 : u.nationality) || "",
|
|
5506
|
+
taxCountry: (u == null ? void 0 : u.taxCountry) || "",
|
|
5507
|
+
countryOfBirth: (u == null ? void 0 : u.countryOfBirth) || "",
|
|
5508
|
+
placeOfBirth: (u == null ? void 0 : u.placeOfBirth) || "",
|
|
5509
|
+
educationLevel: (u == null ? void 0 : u.educationLevel) || "",
|
|
5510
|
+
occupation: (u == null ? void 0 : u.occupation) || "",
|
|
5511
|
+
taxNumber: (u == null ? void 0 : u.taxNumber) || "",
|
|
5512
|
+
defaultLanguage: (u == null ? void 0 : u.defaultLanguage) || ""
|
|
5497
5513
|
}), H.reset({
|
|
5498
|
-
street: (
|
|
5499
|
-
streetNumber: (
|
|
5500
|
-
city: (
|
|
5501
|
-
zip: (
|
|
5502
|
-
country: (
|
|
5503
|
-
nationality: (
|
|
5504
|
-
phonenumber: (
|
|
5505
|
-
}), O.kycRecords && O.kycRecords.length > 0 && O.kycRecords[0].providerTokenObject !== null && !Y.current &&
|
|
5514
|
+
street: (u == null ? void 0 : u.street) || "",
|
|
5515
|
+
streetNumber: (u == null ? void 0 : u.streetNumber) || "",
|
|
5516
|
+
city: (u == null ? void 0 : u.city) || "",
|
|
5517
|
+
zip: (u == null ? void 0 : u.zip) || "",
|
|
5518
|
+
country: (u == null ? void 0 : u.country) || "",
|
|
5519
|
+
nationality: (u == null ? void 0 : u.nationality) || "",
|
|
5520
|
+
phonenumber: (u == null ? void 0 : u.phonenumber) || ""
|
|
5521
|
+
}), O.kycRecords && O.kycRecords.length > 0 && O.kycRecords[0].providerTokenObject !== null && !Y.current && B.current) {
|
|
5506
5522
|
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), Y.current = !0;
|
|
5507
5523
|
try {
|
|
5508
5524
|
await A(), V(!0);
|
|
@@ -5517,8 +5533,8 @@ const In = ({
|
|
|
5517
5533
|
}
|
|
5518
5534
|
})();
|
|
5519
5535
|
}, [e]), ge(() => {
|
|
5520
|
-
y &&
|
|
5521
|
-
}, [y,
|
|
5536
|
+
y && !$ && B.current && (console.log("[Identity] Review page disabled — showing cached provider"), V(!0));
|
|
5537
|
+
}, [y, $]), ge(() => {
|
|
5522
5538
|
if (x) {
|
|
5523
5539
|
if (x.expiresAt) {
|
|
5524
5540
|
const h = new Date(x.expiresAt).getTime();
|
|
@@ -5545,14 +5561,14 @@ const In = ({
|
|
|
5545
5561
|
}, [x]);
|
|
5546
5562
|
const fe = p !== null && p === Oe.Sumsub;
|
|
5547
5563
|
ge(() => {
|
|
5548
|
-
if (p !== null && x && !w &&
|
|
5564
|
+
if (p !== null && x && !w && $ && !J) {
|
|
5549
5565
|
const h = p;
|
|
5550
5566
|
if (fe) {
|
|
5551
5567
|
console.log("[Sumsub] Fetching access token for Web SDK…"), _(null), (async () => {
|
|
5552
5568
|
try {
|
|
5553
|
-
const O = await o.refreshSumsubToken(e), q =
|
|
5569
|
+
const O = await o.refreshSumsubToken(e), q = Ge.parseProviderConfig(p, x, c);
|
|
5554
5570
|
q.accessToken = O, q.onTokenRefresh = () => o.refreshSumsubToken(e);
|
|
5555
|
-
const W =
|
|
5571
|
+
const W = Ge.createProvider(p, q);
|
|
5556
5572
|
W.onComplete((X) => {
|
|
5557
5573
|
console.log("[Sumsub] Verification complete:", X), t == null || t();
|
|
5558
5574
|
}), W.onError((X) => {
|
|
@@ -5570,8 +5586,8 @@ const In = ({
|
|
|
5570
5586
|
if (new URL(x.url), h === Oe.SardinAI) {
|
|
5571
5587
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
5572
5588
|
try {
|
|
5573
|
-
const O =
|
|
5574
|
-
|
|
5589
|
+
const O = Ge.parseProviderConfig(p, x, c);
|
|
5590
|
+
Ge.createProvider(p, O).initialize().then(() => console.log("[SardinAI] Risk SDK initialized in background")).catch((W) => console.warn("[SardinAI] Risk SDK init failed (non-blocking):", W));
|
|
5575
5591
|
} catch (O) {
|
|
5576
5592
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", O);
|
|
5577
5593
|
}
|
|
@@ -5585,7 +5601,7 @@ const In = ({
|
|
|
5585
5601
|
if (h === Oe.SardinAI) {
|
|
5586
5602
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), _(null);
|
|
5587
5603
|
try {
|
|
5588
|
-
const O =
|
|
5604
|
+
const O = Ge.parseProviderConfig(p, x, c), q = Ge.createProvider(p, O);
|
|
5589
5605
|
q.initialize().then(() => {
|
|
5590
5606
|
console.log("[SardinAI] Risk SDK initialized successfully"), N(q), setTimeout(() => t == null ? void 0 : t(), 2e3);
|
|
5591
5607
|
}).catch((W) => {
|
|
@@ -5601,7 +5617,7 @@ const In = ({
|
|
|
5601
5617
|
}
|
|
5602
5618
|
try {
|
|
5603
5619
|
_(null);
|
|
5604
|
-
const O =
|
|
5620
|
+
const O = Ge.parseProviderConfig(p, x, c), q = Ge.createProvider(p, O);
|
|
5605
5621
|
h === Oe.Onfido && q.initialize("identity-container").catch((W) => {
|
|
5606
5622
|
console.error("[Onfido] Initialization error:", W), _(`Failed to initialize: ${W.message}`);
|
|
5607
5623
|
}), N(q);
|
|
@@ -5617,7 +5633,7 @@ const In = ({
|
|
|
5617
5633
|
console.error("[Identity] Error destroying provider:", h);
|
|
5618
5634
|
}
|
|
5619
5635
|
};
|
|
5620
|
-
}, [p, x, w,
|
|
5636
|
+
}, [p, x, w, $, t, J, fe, e, c, o]);
|
|
5621
5637
|
const I = async () => {
|
|
5622
5638
|
try {
|
|
5623
5639
|
_(null), se(!1), await A(), V(!0);
|
|
@@ -5626,12 +5642,12 @@ const In = ({
|
|
|
5626
5642
|
}
|
|
5627
5643
|
}, te = async () => {
|
|
5628
5644
|
try {
|
|
5629
|
-
_(null), se(!1), N(null), console.log("[Identity] Restarting verification..."), await
|
|
5645
|
+
_(null), se(!1), N(null), console.log("[Identity] Restarting verification..."), await P(), V(!0);
|
|
5630
5646
|
} catch (h) {
|
|
5631
5647
|
console.error("Error restarting identity verification:", h), _(h.message || "Failed to restart verification");
|
|
5632
5648
|
}
|
|
5633
5649
|
};
|
|
5634
|
-
if (E ||
|
|
5650
|
+
if (E || T)
|
|
5635
5651
|
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
|
|
5636
5652
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
5637
5653
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
@@ -5641,7 +5657,7 @@ const In = ({
|
|
|
5641
5657
|
"Error: ",
|
|
5642
5658
|
v.message
|
|
5643
5659
|
] }) }) });
|
|
5644
|
-
if (
|
|
5660
|
+
if ($ && (G || J))
|
|
5645
5661
|
return /* @__PURE__ */ s(re, { children: [
|
|
5646
5662
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
5647
5663
|
/* @__PURE__ */ s(ne, { children: [
|
|
@@ -5680,10 +5696,10 @@ const In = ({
|
|
|
5680
5696
|
] }),
|
|
5681
5697
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
5682
5698
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5683
|
-
/* @__PURE__ */ r(Z, { type: "button", onClick: te, disabled:
|
|
5699
|
+
/* @__PURE__ */ r(Z, { type: "button", onClick: te, disabled: T, children: T ? "Restarting..." : "Restart Verification" })
|
|
5684
5700
|
] })
|
|
5685
5701
|
] });
|
|
5686
|
-
if (
|
|
5702
|
+
if ($ && y) {
|
|
5687
5703
|
const h = p;
|
|
5688
5704
|
return fe ? /* @__PURE__ */ s("div", { style: {
|
|
5689
5705
|
background: "var(--metakyc-background, #ffffff)",
|
|
@@ -5716,7 +5732,7 @@ const In = ({
|
|
|
5716
5732
|
{
|
|
5717
5733
|
type: "button",
|
|
5718
5734
|
onClick: te,
|
|
5719
|
-
disabled:
|
|
5735
|
+
disabled: T,
|
|
5720
5736
|
style: {
|
|
5721
5737
|
padding: "6px 14px",
|
|
5722
5738
|
fontSize: "13px",
|
|
@@ -5725,10 +5741,10 @@ const In = ({
|
|
|
5725
5741
|
border: "1px solid var(--metakyc-border, #d1d5db)",
|
|
5726
5742
|
background: "var(--metakyc-background, #ffffff)",
|
|
5727
5743
|
color: "var(--metakyc-text-primary, #111827)",
|
|
5728
|
-
cursor:
|
|
5729
|
-
opacity:
|
|
5744
|
+
cursor: T ? "not-allowed" : "pointer",
|
|
5745
|
+
opacity: T ? 0.5 : 1
|
|
5730
5746
|
},
|
|
5731
|
-
children:
|
|
5747
|
+
children: T ? "Restarting…" : "Restart"
|
|
5732
5748
|
}
|
|
5733
5749
|
)
|
|
5734
5750
|
] }),
|
|
@@ -5761,7 +5777,7 @@ const In = ({
|
|
|
5761
5777
|
variant: "outline",
|
|
5762
5778
|
size: "sm",
|
|
5763
5779
|
onClick: te,
|
|
5764
|
-
disabled:
|
|
5780
|
+
disabled: T,
|
|
5765
5781
|
children: "Restart"
|
|
5766
5782
|
}
|
|
5767
5783
|
)
|
|
@@ -5821,9 +5837,9 @@ const In = ({
|
|
|
5821
5837
|
return q ? q.label : String(O);
|
|
5822
5838
|
}
|
|
5823
5839
|
return String(O);
|
|
5824
|
-
},
|
|
5840
|
+
}, $e = ({ helpText: h }) => {
|
|
5825
5841
|
const [O, q] = k(!1), W = de(null), [, X] = k({ top: 0, left: 0 });
|
|
5826
|
-
return /* @__PURE__ */ s(
|
|
5842
|
+
return /* @__PURE__ */ s(lt, { children: [
|
|
5827
5843
|
/* @__PURE__ */ r(
|
|
5828
5844
|
"button",
|
|
5829
5845
|
{
|
|
@@ -5858,7 +5874,7 @@ const In = ({
|
|
|
5858
5874
|
children: "?"
|
|
5859
5875
|
}
|
|
5860
5876
|
),
|
|
5861
|
-
O &&
|
|
5877
|
+
O && Qt.createPortal(
|
|
5862
5878
|
/* @__PURE__ */ r(
|
|
5863
5879
|
"div",
|
|
5864
5880
|
{
|
|
@@ -5917,7 +5933,7 @@ const In = ({
|
|
|
5917
5933
|
] });
|
|
5918
5934
|
}, Re = (h, O) => O ? /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
|
|
5919
5935
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: h }),
|
|
5920
|
-
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(
|
|
5936
|
+
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r($e, { helpText: O }) })
|
|
5921
5937
|
] }) : h, _e = (h, O) => {
|
|
5922
5938
|
const q = `cf-${O}`, W = h.paramName ?? "", X = me[W];
|
|
5923
5939
|
if (h.customType === "br")
|
|
@@ -5974,7 +5990,7 @@ const In = ({
|
|
|
5974
5990
|
}
|
|
5975
5991
|
}
|
|
5976
5992
|
),
|
|
5977
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.customType === "link_checkbox" && h.linkUrl ? /* @__PURE__ */ s(
|
|
5993
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.customType === "link_checkbox" && h.linkUrl ? /* @__PURE__ */ s(lt, { children: [
|
|
5978
5994
|
/* @__PURE__ */ r("a", { href: h.linkUrl, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--metakyc-primary, #6366f1)", textDecoration: "underline" }, children: h.linkText || h.label }),
|
|
5979
5995
|
h.label && h.linkText ? ` ${h.label}` : ""
|
|
5980
5996
|
] }) : h.displayText || h.label })
|
|
@@ -5984,8 +6000,8 @@ const In = ({
|
|
|
5984
6000
|
}
|
|
5985
6001
|
if (h.customType === "group_checkbox") {
|
|
5986
6002
|
const m = Array.isArray(X) ? X : X ? [X] : [], R = (L) => {
|
|
5987
|
-
h.singleSelect ? ke((
|
|
5988
|
-
...
|
|
6003
|
+
h.singleSelect ? ke((u) => ({ ...u, [W]: m[0] === L ? [] : [L] })) : ke((u) => ({
|
|
6004
|
+
...u,
|
|
5989
6005
|
[W]: m.includes(L) ? m.filter((l) => l !== L) : [...m, L]
|
|
5990
6006
|
}));
|
|
5991
6007
|
};
|
|
@@ -6038,27 +6054,27 @@ const In = ({
|
|
|
6038
6054
|
),
|
|
6039
6055
|
h.helpText
|
|
6040
6056
|
) }, q);
|
|
6041
|
-
},
|
|
6057
|
+
}, at = (h, O) => {
|
|
6042
6058
|
if (h.isCustom) return _e(h, O);
|
|
6043
|
-
const q = h.name ?? "", W =
|
|
6059
|
+
const q = h.name ?? "", W = nt[q], X = h.displayText || (W == null ? void 0 : W.label) || q, m = ve[q] ?? "", R = q === "mobileCountryCode", L = !!(W != null && W.countriesType) && !R;
|
|
6044
6060
|
return h.editable ? R ? /* @__PURE__ */ r("div", { className: oe(h.colSpan ?? 2), children: Re(
|
|
6045
6061
|
/* @__PURE__ */ r(
|
|
6046
|
-
|
|
6062
|
+
qe,
|
|
6047
6063
|
{
|
|
6048
6064
|
label: X,
|
|
6049
6065
|
value: String(m),
|
|
6050
|
-
onChange: (
|
|
6066
|
+
onChange: (u) => ue((l) => ({ ...l, [q]: u })),
|
|
6051
6067
|
options: [{ value: "", label: "Select country code…" }, ...K]
|
|
6052
6068
|
}
|
|
6053
6069
|
),
|
|
6054
6070
|
h.helpText
|
|
6055
6071
|
) }, `epc-${O}`) : L ? /* @__PURE__ */ r("div", { className: oe(h.colSpan ?? 2), children: Re(
|
|
6056
6072
|
/* @__PURE__ */ r(
|
|
6057
|
-
|
|
6073
|
+
qe,
|
|
6058
6074
|
{
|
|
6059
6075
|
label: X,
|
|
6060
6076
|
value: String(m),
|
|
6061
|
-
onChange: (
|
|
6077
|
+
onChange: (u) => ue((l) => ({ ...l, [q]: u })),
|
|
6062
6078
|
options: [{ value: "", label: `Select ${X.toLowerCase()}…` }, ...M]
|
|
6063
6079
|
}
|
|
6064
6080
|
),
|
|
@@ -6070,12 +6086,12 @@ const In = ({
|
|
|
6070
6086
|
label: X,
|
|
6071
6087
|
type: (W == null ? void 0 : W.type) === "date" ? "date" : (W == null ? void 0 : W.type) === "email" ? "email" : "text",
|
|
6072
6088
|
value: String(m),
|
|
6073
|
-
onChange: (
|
|
6089
|
+
onChange: (u) => ue((l) => ({ ...l, [q]: u.target.value }))
|
|
6074
6090
|
}
|
|
6075
6091
|
),
|
|
6076
6092
|
h.helpText
|
|
6077
6093
|
) }, `ei-${O}`) : /* @__PURE__ */ r("div", { className: oe(h.colSpan ?? 2), children: Re(
|
|
6078
|
-
/* @__PURE__ */ s(
|
|
6094
|
+
/* @__PURE__ */ s(lt, { children: [
|
|
6079
6095
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: X }),
|
|
6080
6096
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Ne(q, m) })
|
|
6081
6097
|
] }),
|
|
@@ -6091,10 +6107,10 @@ const In = ({
|
|
|
6091
6107
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h }),
|
|
6092
6108
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: O })
|
|
6093
6109
|
] }),
|
|
6094
|
-
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: F.fields.map((q, W) =>
|
|
6110
|
+
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: F.fields.map((q, W) => at(q, W)) }) }),
|
|
6095
6111
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
6096
6112
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
6097
|
-
/* @__PURE__ */ r(Z, { type: "submit", isLoading:
|
|
6113
|
+
/* @__PURE__ */ r(Z, { type: "submit", isLoading: T, children: "Confirm and Start Verification" })
|
|
6098
6114
|
] })
|
|
6099
6115
|
] }) });
|
|
6100
6116
|
}
|
|
@@ -6105,9 +6121,9 @@ const In = ({
|
|
|
6105
6121
|
] }),
|
|
6106
6122
|
/* @__PURE__ */ s(ne, { className: "space-y-6", children: [
|
|
6107
6123
|
/* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
6108
|
-
{ label: "Name", value: `${((
|
|
6109
|
-
{ label: "Email", value: (
|
|
6110
|
-
{ label: "Date of Birth", value: ((
|
|
6124
|
+
{ label: "Name", value: `${((Ze = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Ze.firstName) || ""} ${((je = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : je.lastName) || ""}`.trim() },
|
|
6125
|
+
{ label: "Email", value: (it = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : it.email },
|
|
6126
|
+
{ label: "Date of Birth", value: ((Ye = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Ye.dateOfBirth) || "Not provided" }
|
|
6111
6127
|
].map(({ label: h, value: O }) => /* @__PURE__ */ s("div", { children: [
|
|
6112
6128
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: h }),
|
|
6113
6129
|
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: O })
|
|
@@ -6116,12 +6132,12 @@ const In = ({
|
|
|
6116
6132
|
/* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
|
|
6117
6133
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6118
6134
|
/* @__PURE__ */ r(
|
|
6119
|
-
|
|
6135
|
+
et,
|
|
6120
6136
|
{
|
|
6121
6137
|
control: H.control,
|
|
6122
6138
|
name: "country",
|
|
6123
6139
|
render: ({ field: h }) => /* @__PURE__ */ r(
|
|
6124
|
-
|
|
6140
|
+
qe,
|
|
6125
6141
|
{
|
|
6126
6142
|
label: "Country",
|
|
6127
6143
|
value: h.value,
|
|
@@ -6132,12 +6148,12 @@ const In = ({
|
|
|
6132
6148
|
}
|
|
6133
6149
|
),
|
|
6134
6150
|
/* @__PURE__ */ r(
|
|
6135
|
-
|
|
6151
|
+
et,
|
|
6136
6152
|
{
|
|
6137
6153
|
control: H.control,
|
|
6138
6154
|
name: "nationality",
|
|
6139
6155
|
render: ({ field: h }) => /* @__PURE__ */ r(
|
|
6140
|
-
|
|
6156
|
+
qe,
|
|
6141
6157
|
{
|
|
6142
6158
|
label: "Nationality",
|
|
6143
6159
|
value: h.value,
|
|
@@ -6149,19 +6165,19 @@ const In = ({
|
|
|
6149
6165
|
)
|
|
6150
6166
|
] }),
|
|
6151
6167
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6152
|
-
/* @__PURE__ */ r(
|
|
6153
|
-
/* @__PURE__ */ r(
|
|
6168
|
+
/* @__PURE__ */ r(et, { control: H.control, name: "street", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Street" }) }),
|
|
6169
|
+
/* @__PURE__ */ r(et, { control: H.control, name: "streetNumber", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Street Number" }) })
|
|
6154
6170
|
] }),
|
|
6155
6171
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6156
|
-
/* @__PURE__ */ r(
|
|
6157
|
-
/* @__PURE__ */ r(
|
|
6172
|
+
/* @__PURE__ */ r(et, { control: H.control, name: "city", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "City" }) }),
|
|
6173
|
+
/* @__PURE__ */ r(et, { control: H.control, name: "zip", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "ZIP / Postal Code" }) })
|
|
6158
6174
|
] }),
|
|
6159
|
-
/* @__PURE__ */ r(
|
|
6175
|
+
/* @__PURE__ */ r(et, { control: H.control, name: "phonenumber", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Phone Number", type: "tel" }) })
|
|
6160
6176
|
] })
|
|
6161
6177
|
] }),
|
|
6162
6178
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
6163
6179
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
6164
|
-
/* @__PURE__ */ r(Z, { type: "submit", isLoading:
|
|
6180
|
+
/* @__PURE__ */ r(Z, { type: "submit", isLoading: T, children: "Confirm and Start Verification" })
|
|
6165
6181
|
] })
|
|
6166
6182
|
] }) });
|
|
6167
6183
|
}, Tt = ({
|
|
@@ -6172,63 +6188,63 @@ const In = ({
|
|
|
6172
6188
|
onContinue: i,
|
|
6173
6189
|
onContactSupport: o
|
|
6174
6190
|
}) => {
|
|
6175
|
-
const
|
|
6191
|
+
const d = e === tt.Approved ? {
|
|
6176
6192
|
type: "success",
|
|
6177
6193
|
title: "Verification Approved",
|
|
6178
6194
|
icon: "✓",
|
|
6179
6195
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
6180
6196
|
iconColor: "text-green-600 dark:text-green-400",
|
|
6181
6197
|
message: "Your identity verification has been successfully approved."
|
|
6182
|
-
} : e ===
|
|
6198
|
+
} : e === tt.Rejected ? {
|
|
6183
6199
|
type: "error",
|
|
6184
6200
|
title: "Verification Rejected",
|
|
6185
6201
|
icon: "✕",
|
|
6186
6202
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
6187
6203
|
iconColor: "text-red-600 dark:text-red-400",
|
|
6188
6204
|
message: "Unfortunately, your identity verification was not approved."
|
|
6189
|
-
} : e ===
|
|
6205
|
+
} : e === tt.Pending || e === tt.InProgress ? {
|
|
6190
6206
|
type: "pending",
|
|
6191
6207
|
title: "Verification Pending",
|
|
6192
6208
|
icon: "⏱",
|
|
6193
6209
|
iconBg: "bg-blue-100 dark:bg-blue-900/30",
|
|
6194
6210
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
6195
6211
|
message: "Your identity verification is currently being processed."
|
|
6196
|
-
} : t ===
|
|
6212
|
+
} : t === rt.Approved ? {
|
|
6197
6213
|
type: "success",
|
|
6198
6214
|
title: "Application Approved",
|
|
6199
6215
|
icon: "✓",
|
|
6200
6216
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
6201
6217
|
iconColor: "text-green-600 dark:text-green-400",
|
|
6202
6218
|
message: "Your application has been approved."
|
|
6203
|
-
} : t ===
|
|
6219
|
+
} : t === rt.Reject ? {
|
|
6204
6220
|
type: "error",
|
|
6205
6221
|
title: "Application Rejected",
|
|
6206
6222
|
icon: "✕",
|
|
6207
6223
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
6208
6224
|
iconColor: "text-red-600 dark:text-red-400",
|
|
6209
6225
|
message: "Your application has been rejected."
|
|
6210
|
-
} : t ===
|
|
6226
|
+
} : t === rt.UnderReview || t === rt.AdminReview ? {
|
|
6211
6227
|
type: "pending",
|
|
6212
6228
|
title: "Under Review",
|
|
6213
6229
|
icon: "📋",
|
|
6214
6230
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
6215
6231
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
6216
6232
|
message: "Your application is currently under manual review."
|
|
6217
|
-
} : n ===
|
|
6233
|
+
} : n === gt.Success ? {
|
|
6218
6234
|
type: "success",
|
|
6219
6235
|
title: "Process Complete",
|
|
6220
6236
|
icon: "✓",
|
|
6221
6237
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
6222
6238
|
iconColor: "text-green-600 dark:text-green-400",
|
|
6223
6239
|
message: "Your verification process has been completed successfully."
|
|
6224
|
-
} : n ===
|
|
6240
|
+
} : n === gt.Failed ? {
|
|
6225
6241
|
type: "error",
|
|
6226
6242
|
title: "Process Failed",
|
|
6227
6243
|
icon: "✕",
|
|
6228
6244
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
6229
6245
|
iconColor: "text-red-600 dark:text-red-400",
|
|
6230
6246
|
message: "The verification process could not be completed."
|
|
6231
|
-
} : n ===
|
|
6247
|
+
} : n === gt.AdminReview ? {
|
|
6232
6248
|
type: "pending",
|
|
6233
6249
|
title: "Admin Review Required",
|
|
6234
6250
|
icon: "📋",
|
|
@@ -6248,20 +6264,20 @@ const In = ({
|
|
|
6248
6264
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
6249
6265
|
"div",
|
|
6250
6266
|
{
|
|
6251
|
-
className: `w-24 h-24 rounded-full flex items-center justify-center ${
|
|
6252
|
-
children: /* @__PURE__ */ r("span", { className: `text-5xl ${
|
|
6267
|
+
className: `w-24 h-24 rounded-full flex items-center justify-center ${d.iconBg}`,
|
|
6268
|
+
children: /* @__PURE__ */ r("span", { className: `text-5xl ${d.iconColor}`, children: d.icon })
|
|
6253
6269
|
}
|
|
6254
6270
|
) }),
|
|
6255
|
-
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center mb-4", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
6271
|
+
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center mb-4", style: { color: "var(--metakyc-text-primary, #111827)" }, children: d.title }),
|
|
6256
6272
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
6257
|
-
|
|
6273
|
+
$t,
|
|
6258
6274
|
{
|
|
6259
|
-
variant:
|
|
6260
|
-
children: e != null ?
|
|
6275
|
+
variant: d.type === "success" ? "success" : d.type === "error" ? "danger" : d.type === "pending" ? "warning" : "info",
|
|
6276
|
+
children: e != null ? tt[e] : rt[t]
|
|
6261
6277
|
}
|
|
6262
6278
|
) }),
|
|
6263
|
-
/* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a ||
|
|
6264
|
-
|
|
6279
|
+
/* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a || d.message }),
|
|
6280
|
+
d.type === "success" && /* @__PURE__ */ s("div", { className: "bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 mb-6", children: [
|
|
6265
6281
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-green-900 dark:text-green-100 mb-2", children: "What's Next?" }),
|
|
6266
6282
|
/* @__PURE__ */ s("ul", { className: "text-sm text-green-800 dark:text-green-200 space-y-1", children: [
|
|
6267
6283
|
/* @__PURE__ */ r("li", { children: "✓ Your identity has been verified" }),
|
|
@@ -6269,7 +6285,7 @@ const In = ({
|
|
|
6269
6285
|
/* @__PURE__ */ r("li", { children: "✓ All features are now accessible" })
|
|
6270
6286
|
] })
|
|
6271
6287
|
] }),
|
|
6272
|
-
|
|
6288
|
+
d.type === "error" && /* @__PURE__ */ s("div", { className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mb-6", children: [
|
|
6273
6289
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-2", children: "What Can You Do?" }),
|
|
6274
6290
|
/* @__PURE__ */ s("ul", { className: "text-sm text-red-800 dark:text-red-200 space-y-2", children: [
|
|
6275
6291
|
/* @__PURE__ */ r("li", { children: "• Review the requirements and ensure all information is correct" }),
|
|
@@ -6277,7 +6293,7 @@ const In = ({
|
|
|
6277
6293
|
/* @__PURE__ */ r("li", { children: "• You may be able to resubmit your application" })
|
|
6278
6294
|
] })
|
|
6279
6295
|
] }),
|
|
6280
|
-
|
|
6296
|
+
d.type === "pending" && /* @__PURE__ */ s("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-6", children: [
|
|
6281
6297
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-blue-900 dark:text-blue-100 mb-2", children: "What Happens Next?" }),
|
|
6282
6298
|
/* @__PURE__ */ s("ul", { className: "text-sm text-blue-800 dark:text-blue-200 space-y-2", children: [
|
|
6283
6299
|
/* @__PURE__ */ r("li", { children: "• Our team is reviewing your information" }),
|
|
@@ -6289,21 +6305,21 @@ const In = ({
|
|
|
6289
6305
|
/* @__PURE__ */ r("div", { className: "mt-6 pt-6", style: { borderTop: "1px solid var(--metakyc-border, #e5e7eb)" }, children: /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
6290
6306
|
/* @__PURE__ */ s("div", { children: [
|
|
6291
6307
|
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "KYC Status:" }),
|
|
6292
|
-
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ?
|
|
6308
|
+
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ? tt[e] : "Not Available" })
|
|
6293
6309
|
] }),
|
|
6294
6310
|
/* @__PURE__ */ s("div", { children: [
|
|
6295
6311
|
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Review Status:" }),
|
|
6296
|
-
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
6312
|
+
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: rt[t] })
|
|
6297
6313
|
] })
|
|
6298
6314
|
] }) })
|
|
6299
6315
|
] }),
|
|
6300
6316
|
/* @__PURE__ */ s(Ce, { className: "flex justify-center gap-4", children: [
|
|
6301
|
-
|
|
6302
|
-
|
|
6317
|
+
d.type === "success" && i && /* @__PURE__ */ r(Z, { onClick: i, size: "lg", children: "Continue" }),
|
|
6318
|
+
d.type === "error" && /* @__PURE__ */ s(lt, { children: [
|
|
6303
6319
|
o && /* @__PURE__ */ r(Z, { variant: "outline", onClick: o, children: "Contact Support" }),
|
|
6304
6320
|
i && /* @__PURE__ */ r(Z, { onClick: i, children: "Try Again" })
|
|
6305
6321
|
] }),
|
|
6306
|
-
|
|
6322
|
+
d.type === "pending" && /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
|
|
6307
6323
|
] })
|
|
6308
6324
|
] });
|
|
6309
6325
|
}, Tn = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ r("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ r(
|
|
@@ -6321,12 +6337,12 @@ const In = ({
|
|
|
6321
6337
|
console.warn("[Logo] Failed to load logo:", e.url), n.target.style.display = "none";
|
|
6322
6338
|
}
|
|
6323
6339
|
}
|
|
6324
|
-
) }),
|
|
6340
|
+
) }), mt = ({
|
|
6325
6341
|
title: e,
|
|
6326
6342
|
subtitle: t,
|
|
6327
6343
|
className: n = ""
|
|
6328
6344
|
}) => {
|
|
6329
|
-
const { currentTheme: a } =
|
|
6345
|
+
const { currentTheme: a } = Pe(), i = e || (a == null ? void 0 : a.title) || "", o = !!(a != null && a.logo && a.logo.visible && a.logo.url), c = !!i;
|
|
6330
6346
|
return !o && !c ? null : /* @__PURE__ */ s("div", { className: `metakyc-header ${n}`, children: [
|
|
6331
6347
|
/* @__PURE__ */ s(
|
|
6332
6348
|
"div",
|
|
@@ -6348,11 +6364,11 @@ const In = ({
|
|
|
6348
6364
|
),
|
|
6349
6365
|
t && /* @__PURE__ */ r("p", { className: "text-sm mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: t })
|
|
6350
6366
|
] });
|
|
6351
|
-
},
|
|
6352
|
-
function
|
|
6367
|
+
}, ft = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
6368
|
+
function ot(e) {
|
|
6353
6369
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
6354
6370
|
}
|
|
6355
|
-
const
|
|
6371
|
+
const pt = {
|
|
6356
6372
|
width: "16px",
|
|
6357
6373
|
height: "16px",
|
|
6358
6374
|
minWidth: "16px",
|
|
@@ -6364,9 +6380,9 @@ const ut = {
|
|
|
6364
6380
|
padding: 0,
|
|
6365
6381
|
display: "inline-block",
|
|
6366
6382
|
verticalAlign: "middle"
|
|
6367
|
-
},
|
|
6383
|
+
}, Lt = ({ helpText: e, children: t }) => {
|
|
6368
6384
|
const [n, a] = we.useState(!1);
|
|
6369
|
-
if (!e) return /* @__PURE__ */ r(
|
|
6385
|
+
if (!e) return /* @__PURE__ */ r(lt, { children: t });
|
|
6370
6386
|
const i = n ? /* @__PURE__ */ r(
|
|
6371
6387
|
"div",
|
|
6372
6388
|
{
|
|
@@ -6483,25 +6499,25 @@ const ut = {
|
|
|
6483
6499
|
children: "?"
|
|
6484
6500
|
}
|
|
6485
6501
|
),
|
|
6486
|
-
typeof document < "u" && i ?
|
|
6502
|
+
typeof document < "u" && i ? St(i, document.body) : null
|
|
6487
6503
|
] });
|
|
6488
|
-
},
|
|
6504
|
+
}, Zn = ({
|
|
6489
6505
|
workflowKey: e,
|
|
6490
6506
|
externalRefId: t,
|
|
6491
6507
|
onSuccess: n,
|
|
6492
6508
|
onCancel: a
|
|
6493
6509
|
}) => {
|
|
6494
|
-
var q, W, X, m, R, L,
|
|
6495
|
-
const { config: i, baseInformationService: o, currentTheme: c } =
|
|
6510
|
+
var q, W, X, m, R, L, u;
|
|
6511
|
+
const { config: i, baseInformationService: o, currentTheme: c } = Pe(), { createApplicant: d, isLoading: y } = zt(), p = e || ((q = i.applicantForm) == null ? void 0 : q.workflowKey);
|
|
6496
6512
|
if (!p)
|
|
6497
6513
|
throw new Error(
|
|
6498
6514
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
6499
6515
|
);
|
|
6500
|
-
const x = t || ((W = i.applicantForm) == null ? void 0 : W.externalRefId) || "",
|
|
6516
|
+
const x = t || ((W = i.applicantForm) == null ? void 0 : W.externalRefId) || "", T = ((X = i.applicantForm) == null ? void 0 : X.email) || "", v = ((m = i.applicantForm) == null ? void 0 : m.hiddenValues) || {}, A = ((R = i.applicantForm) == null ? void 0 : R.initialValues) || {}, w = (((L = i.applicantForm) == null ? void 0 : L.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", N = De(
|
|
6501
6517
|
() => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
|
|
6502
6518
|
[c == null ? void 0 : c.applicantFormPages]
|
|
6503
6519
|
), z = De(() => {
|
|
6504
|
-
const l = new Set(
|
|
6520
|
+
const l = new Set(ft), f = c == null ? void 0 : c.applicantFormRequiredFields;
|
|
6505
6521
|
if (f) for (const D of f) l.add(D);
|
|
6506
6522
|
if (N)
|
|
6507
6523
|
for (const D of N)
|
|
@@ -6512,15 +6528,15 @@ const ut = {
|
|
|
6512
6528
|
var D;
|
|
6513
6529
|
if (N) {
|
|
6514
6530
|
const g = N.flatMap((S) => S.fields).filter((S) => !S.isCustom && S.name).map((S) => S.name), C = new Set(g);
|
|
6515
|
-
for (const S of
|
|
6531
|
+
for (const S of ft) C.add(S);
|
|
6516
6532
|
return Array.from(C);
|
|
6517
6533
|
}
|
|
6518
6534
|
let l;
|
|
6519
|
-
(D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l =
|
|
6535
|
+
(D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l = cr;
|
|
6520
6536
|
const f = new Set(l);
|
|
6521
|
-
for (const g of
|
|
6537
|
+
for (const g of ft) f.add(g);
|
|
6522
6538
|
return Array.from(f);
|
|
6523
|
-
}, [(
|
|
6539
|
+
}, [(u = i.applicantForm) == null ? void 0 : u.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, N]), M = /* @__PURE__ */ new Set([
|
|
6524
6540
|
"country",
|
|
6525
6541
|
"nationality",
|
|
6526
6542
|
"taxCountry",
|
|
@@ -6533,17 +6549,17 @@ const ut = {
|
|
|
6533
6549
|
if (N)
|
|
6534
6550
|
for (const g of N)
|
|
6535
6551
|
for (const C of g.fields)
|
|
6536
|
-
!C.isCustom && C.name && M.has(C.name) && l.add(C.countriesType ?? ((f =
|
|
6552
|
+
!C.isCustom && C.name && M.has(C.name) && l.add(C.countriesType ?? ((f = nt[C.name]) == null ? void 0 : f.countriesType));
|
|
6537
6553
|
else
|
|
6538
6554
|
for (const g of Q)
|
|
6539
|
-
M.has(g) && l.add((D =
|
|
6555
|
+
M.has(g) && l.add((D = nt[g]) == null ? void 0 : D.countriesType);
|
|
6540
6556
|
return l.size === 0 && l.add(void 0), Array.from(l);
|
|
6541
|
-
}, [Q, N]), [K, ee] = k({}), [E, b] = k(!0),
|
|
6557
|
+
}, [Q, N]), [K, ee] = k({}), [E, b] = k(!0), $ = de(/* @__PURE__ */ new Set()), V = de(/* @__PURE__ */ new Set());
|
|
6542
6558
|
ge(() => {
|
|
6543
6559
|
if (!c) return;
|
|
6544
6560
|
const l = j.filter((g) => {
|
|
6545
6561
|
const C = g != null ? String(g) : "all";
|
|
6546
|
-
return !V.current.has(C) &&
|
|
6562
|
+
return !V.current.has(C) && !$.current.has(C);
|
|
6547
6563
|
});
|
|
6548
6564
|
if (l.length === 0) {
|
|
6549
6565
|
j.every((C) => {
|
|
@@ -6554,20 +6570,20 @@ const ut = {
|
|
|
6554
6570
|
}
|
|
6555
6571
|
b(!0);
|
|
6556
6572
|
const f = l.map((g) => g != null ? String(g) : "all");
|
|
6557
|
-
f.forEach((g) =>
|
|
6573
|
+
f.forEach((g) => $.current.add(g)), (async () => {
|
|
6558
6574
|
try {
|
|
6559
6575
|
const g = await Promise.all(
|
|
6560
6576
|
l.map(async (C) => {
|
|
6561
|
-
const S = C != null ? String(C) : "all", pe = await o.getCountries("", i.locale || "en", C), ie = C === 40, be = /* @__PURE__ */ new Set(),
|
|
6577
|
+
const S = C != null ? String(C) : "all", pe = await o.getCountries("", i.locale || "en", C), ie = C === 40, be = /* @__PURE__ */ new Set(), Te = pe.map((le) => ie && le.countryCode ? {
|
|
6562
6578
|
value: le.countryCode,
|
|
6563
6579
|
label: `${le.countryCode} – ${le.name}`
|
|
6564
6580
|
} : { value: le.abbreviation3 || le.abbreviation, label: le.name }).filter((le) => !le.value || be.has(le.value) ? !1 : (be.add(le.value), !0));
|
|
6565
|
-
return V.current.add(S),
|
|
6581
|
+
return V.current.add(S), $.current.delete(S), [S, Te];
|
|
6566
6582
|
})
|
|
6567
6583
|
);
|
|
6568
6584
|
ee((C) => ({ ...C, ...Object.fromEntries(g) }));
|
|
6569
6585
|
} catch (g) {
|
|
6570
|
-
f.forEach((C) =>
|
|
6586
|
+
f.forEach((C) => $.current.delete(C)), console.error("Failed to load countries:", g);
|
|
6571
6587
|
} finally {
|
|
6572
6588
|
j.every((C) => {
|
|
6573
6589
|
const S = C != null ? String(C) : "all";
|
|
@@ -6578,7 +6594,7 @@ const ut = {
|
|
|
6578
6594
|
}, [j, c]);
|
|
6579
6595
|
const G = (l, f) => {
|
|
6580
6596
|
var C;
|
|
6581
|
-
const D = f ?? ((C =
|
|
6597
|
+
const D = f ?? ((C = nt[l]) == null ? void 0 : C.countriesType), g = D != null ? String(D) : "all";
|
|
6582
6598
|
return K[g] || [];
|
|
6583
6599
|
}, _ = {
|
|
6584
6600
|
firstName: 1,
|
|
@@ -6612,7 +6628,7 @@ const ut = {
|
|
|
6612
6628
|
firstName: "",
|
|
6613
6629
|
lastName: "",
|
|
6614
6630
|
title: "",
|
|
6615
|
-
email:
|
|
6631
|
+
email: T,
|
|
6616
6632
|
dateOfBirth: "",
|
|
6617
6633
|
phonenumber: "",
|
|
6618
6634
|
externalRefId: x,
|
|
@@ -6636,7 +6652,7 @@ const ut = {
|
|
|
6636
6652
|
...se
|
|
6637
6653
|
}), ue = Object.fromEntries(
|
|
6638
6654
|
Object.entries(v).filter(([l]) => !(l in J) && l !== "externalRefId" && l !== "workflowKey")
|
|
6639
|
-
), [me, ke] = k({ ...ue }), [F, U] = k(0), [
|
|
6655
|
+
), [me, ke] = k({ ...ue }), [F, U] = k(0), [B, H] = k({}), [fe, I] = k(null), [te, ye] = k(!1), oe = (l, f) => ve((D) => ({ ...D, [l]: f })), Ne = (l, f) => ke((D) => ({ ...D, [l]: f })), $e = (l) => !l.conditionalOn || me[l.conditionalOn] === "true", Re = N && F < N.length - 1 ? F + 1 : -1, _e = N && F > 0 ? F - 1 : -1, at = (l) => {
|
|
6640
6656
|
var D;
|
|
6641
6657
|
const f = {};
|
|
6642
6658
|
for (const g of l.fields)
|
|
@@ -6648,20 +6664,20 @@ const ut = {
|
|
|
6648
6664
|
}
|
|
6649
6665
|
} else if (g.name) {
|
|
6650
6666
|
const C = g.name;
|
|
6651
|
-
if (z.includes(C) &&
|
|
6652
|
-
const S = g.displayText || ((D =
|
|
6667
|
+
if (z.includes(C) && ot(Y[C])) {
|
|
6668
|
+
const S = g.displayText || ((D = nt[C]) == null ? void 0 : D.label) || C;
|
|
6653
6669
|
f[C] = `${S} is required.`;
|
|
6654
6670
|
}
|
|
6655
6671
|
}
|
|
6656
6672
|
return f;
|
|
6657
|
-
},
|
|
6673
|
+
}, Ze = async () => {
|
|
6658
6674
|
if (!N) return;
|
|
6659
6675
|
const l = N[F];
|
|
6660
|
-
if (l.conditionalOn &&
|
|
6676
|
+
if (l.conditionalOn && !$e(l)) {
|
|
6661
6677
|
H({}), Re >= 0 ? U(Re) : await je();
|
|
6662
6678
|
return;
|
|
6663
6679
|
}
|
|
6664
|
-
const f =
|
|
6680
|
+
const f = at(l);
|
|
6665
6681
|
if (Object.keys(f).length > 0) {
|
|
6666
6682
|
H(f);
|
|
6667
6683
|
return;
|
|
@@ -6671,7 +6687,7 @@ const ut = {
|
|
|
6671
6687
|
if (N) {
|
|
6672
6688
|
let l = {};
|
|
6673
6689
|
for (const f of N)
|
|
6674
|
-
|
|
6690
|
+
$e(f) && (l = { ...l, ...at(f) });
|
|
6675
6691
|
if (Object.keys(l).length > 0) {
|
|
6676
6692
|
H(l);
|
|
6677
6693
|
return;
|
|
@@ -6689,28 +6705,28 @@ const ut = {
|
|
|
6689
6705
|
};
|
|
6690
6706
|
if (N) {
|
|
6691
6707
|
for (const C of N)
|
|
6692
|
-
if (
|
|
6708
|
+
if ($e(C)) {
|
|
6693
6709
|
for (const S of C.fields)
|
|
6694
6710
|
if (!S.isCustom && S.name) {
|
|
6695
6711
|
const pe = S.name, ie = Y[pe];
|
|
6696
|
-
|
|
6712
|
+
ot(ie) || (l[pe] = ie);
|
|
6697
6713
|
}
|
|
6698
6714
|
}
|
|
6699
|
-
for (const C of
|
|
6715
|
+
for (const C of ft)
|
|
6700
6716
|
if (l[C] === void 0) {
|
|
6701
6717
|
const S = Y[C];
|
|
6702
|
-
|
|
6718
|
+
ot(S) || (l[C] = S);
|
|
6703
6719
|
}
|
|
6704
6720
|
} else
|
|
6705
6721
|
Q.forEach((C) => {
|
|
6706
6722
|
if (C === "externalRefId") return;
|
|
6707
6723
|
const S = Y[C];
|
|
6708
|
-
|
|
6724
|
+
ot(S) || (l[C] = S);
|
|
6709
6725
|
});
|
|
6710
6726
|
const f = [];
|
|
6711
6727
|
if (N) {
|
|
6712
6728
|
for (const C of N)
|
|
6713
|
-
if (
|
|
6729
|
+
if ($e(C))
|
|
6714
6730
|
for (const S of C.fields) {
|
|
6715
6731
|
if (!S.isCustom || !S.paramName || S.customType === "paragraph" || S.customType === "html" || S.customType === "br" || S.customType === "link") continue;
|
|
6716
6732
|
const pe = me[S.paramName] ?? "";
|
|
@@ -6722,47 +6738,47 @@ const ut = {
|
|
|
6722
6738
|
}
|
|
6723
6739
|
}
|
|
6724
6740
|
for (const [C, S] of Object.entries(J))
|
|
6725
|
-
l[C] === void 0 && !
|
|
6741
|
+
l[C] === void 0 && !ot(S) && (l[C] = S);
|
|
6726
6742
|
const D = new Set(f.map((C) => C.paramName));
|
|
6727
6743
|
for (const [C, S] of Object.entries(ue))
|
|
6728
6744
|
!D.has(C) && S && f.push({ paramName: C, value: S });
|
|
6729
6745
|
f.length > 0 && (l.applicantAdditionalDatas = f);
|
|
6730
|
-
const g = await
|
|
6746
|
+
const g = await d(l);
|
|
6731
6747
|
n(g.applicantId);
|
|
6732
6748
|
} catch (l) {
|
|
6733
6749
|
console.error("Error creating applicant:", l), I(l.message || "Failed to create applicant");
|
|
6734
6750
|
} finally {
|
|
6735
6751
|
ye(!1);
|
|
6736
6752
|
}
|
|
6737
|
-
},
|
|
6753
|
+
}, it = async (l) => {
|
|
6738
6754
|
var f;
|
|
6739
6755
|
l.preventDefault();
|
|
6740
6756
|
for (const D of z)
|
|
6741
|
-
if (
|
|
6742
|
-
const g = ((f =
|
|
6757
|
+
if (ot(Y[D])) {
|
|
6758
|
+
const g = ((f = nt[D]) == null ? void 0 : f.label) || D;
|
|
6743
6759
|
I(`${g} is required.`);
|
|
6744
6760
|
return;
|
|
6745
6761
|
}
|
|
6746
6762
|
await je();
|
|
6747
|
-
},
|
|
6748
|
-
var
|
|
6749
|
-
const S =
|
|
6763
|
+
}, Ye = (l, f, D, g, C) => {
|
|
6764
|
+
var Nt;
|
|
6765
|
+
const S = nt[l];
|
|
6750
6766
|
if (!S) return null;
|
|
6751
|
-
const pe = z.includes(l), ie =
|
|
6767
|
+
const pe = z.includes(l), ie = B[l], be = D || S.label, Te = l in se, le = f ?? l, Be = { required: pe }, He = C ? C !== "placeholder" : w, Qe = He ? be : void 0, Wt = He ? "..." : be;
|
|
6752
6768
|
switch (S.type) {
|
|
6753
6769
|
case "select":
|
|
6754
6770
|
if (l === "country" || l === "nationality" || l === "taxCountry" || l === "countryOfBirth" || l === "mobileCountryCode") {
|
|
6755
6771
|
const Ie = G(l, g);
|
|
6756
6772
|
return /* @__PURE__ */ r(
|
|
6757
|
-
|
|
6773
|
+
qe,
|
|
6758
6774
|
{
|
|
6759
|
-
|
|
6760
|
-
label:
|
|
6775
|
+
...Be,
|
|
6776
|
+
label: Qe,
|
|
6761
6777
|
value: Y[l] || "",
|
|
6762
|
-
onChange: (
|
|
6763
|
-
options: [{ value: "", label: `Select ${
|
|
6778
|
+
onChange: (Xe) => oe(l, Xe),
|
|
6779
|
+
options: [{ value: "", label: `Select ${Wt.toLowerCase()}` }, ...Ie],
|
|
6764
6780
|
disabled: E,
|
|
6765
|
-
readOnly:
|
|
6781
|
+
readOnly: Te,
|
|
6766
6782
|
error: ie
|
|
6767
6783
|
},
|
|
6768
6784
|
le
|
|
@@ -6770,34 +6786,34 @@ const ut = {
|
|
|
6770
6786
|
}
|
|
6771
6787
|
if (l === "salutation")
|
|
6772
6788
|
return /* @__PURE__ */ r(
|
|
6773
|
-
|
|
6789
|
+
qe,
|
|
6774
6790
|
{
|
|
6775
|
-
|
|
6776
|
-
label:
|
|
6777
|
-
value: ((
|
|
6791
|
+
...Be,
|
|
6792
|
+
label: Qe,
|
|
6793
|
+
value: ((Nt = Y[l]) == null ? void 0 : Nt.toString()) || "",
|
|
6778
6794
|
onChange: (Ie) => oe(l, Ie ? Number(Ie) : null),
|
|
6779
6795
|
options: [
|
|
6780
6796
|
{ value: "", label: He ? "Select salutation..." : be },
|
|
6781
|
-
{ value:
|
|
6782
|
-
{ value:
|
|
6783
|
-
{ value:
|
|
6797
|
+
{ value: bt.Male.toString(), label: "Male" },
|
|
6798
|
+
{ value: bt.Female.toString(), label: "Female" },
|
|
6799
|
+
{ value: bt.Other.toString(), label: "Other" }
|
|
6784
6800
|
],
|
|
6785
|
-
readOnly:
|
|
6801
|
+
readOnly: Te,
|
|
6786
6802
|
error: ie
|
|
6787
6803
|
},
|
|
6788
6804
|
le
|
|
6789
6805
|
);
|
|
6790
6806
|
if (l === "defaultLanguage") {
|
|
6791
|
-
const Ie = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ?
|
|
6807
|
+
const Ie = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? It.filter((Xe) => c.allowedLanguages.includes(Xe.value)) : It;
|
|
6792
6808
|
return /* @__PURE__ */ r(
|
|
6793
|
-
|
|
6809
|
+
qe,
|
|
6794
6810
|
{
|
|
6795
|
-
|
|
6796
|
-
label:
|
|
6811
|
+
...Be,
|
|
6812
|
+
label: Qe,
|
|
6797
6813
|
value: Y[l] || "",
|
|
6798
|
-
onChange: (
|
|
6814
|
+
onChange: (Xe) => oe(l, Xe),
|
|
6799
6815
|
options: [{ value: "", label: He ? "Select language..." : be }, ...Ie],
|
|
6800
|
-
readOnly:
|
|
6816
|
+
readOnly: Te,
|
|
6801
6817
|
error: ie
|
|
6802
6818
|
},
|
|
6803
6819
|
le
|
|
@@ -6808,16 +6824,16 @@ const ut = {
|
|
|
6808
6824
|
if (l === "otherNationality") {
|
|
6809
6825
|
const Ie = G(l, g);
|
|
6810
6826
|
return /* @__PURE__ */ r(
|
|
6811
|
-
|
|
6827
|
+
en,
|
|
6812
6828
|
{
|
|
6813
|
-
|
|
6814
|
-
label:
|
|
6829
|
+
...Be,
|
|
6830
|
+
label: Qe,
|
|
6815
6831
|
value: Y[l] || [],
|
|
6816
|
-
onChange: (
|
|
6832
|
+
onChange: (Xe) => oe(l, Xe),
|
|
6817
6833
|
options: Ie,
|
|
6818
6834
|
placeholder: He ? "Select other nationalities..." : be,
|
|
6819
6835
|
disabled: E,
|
|
6820
|
-
readOnly:
|
|
6836
|
+
readOnly: Te
|
|
6821
6837
|
},
|
|
6822
6838
|
le
|
|
6823
6839
|
);
|
|
@@ -6827,13 +6843,13 @@ const ut = {
|
|
|
6827
6843
|
return /* @__PURE__ */ r(
|
|
6828
6844
|
xe,
|
|
6829
6845
|
{
|
|
6830
|
-
|
|
6846
|
+
...Be,
|
|
6831
6847
|
type: "date",
|
|
6832
|
-
label:
|
|
6848
|
+
label: Qe,
|
|
6833
6849
|
placeholder: He ? void 0 : be,
|
|
6834
6850
|
value: Y[l] || "",
|
|
6835
6851
|
onChange: (Ie) => oe(l, Ie.target.value),
|
|
6836
|
-
readOnly:
|
|
6852
|
+
readOnly: Te,
|
|
6837
6853
|
error: ie
|
|
6838
6854
|
},
|
|
6839
6855
|
le
|
|
@@ -6842,13 +6858,13 @@ const ut = {
|
|
|
6842
6858
|
return /* @__PURE__ */ r(
|
|
6843
6859
|
xe,
|
|
6844
6860
|
{
|
|
6845
|
-
|
|
6861
|
+
...Be,
|
|
6846
6862
|
type: "email",
|
|
6847
|
-
label:
|
|
6863
|
+
label: Qe,
|
|
6848
6864
|
placeholder: He ? void 0 : be,
|
|
6849
6865
|
value: Y[l] || "",
|
|
6850
6866
|
onChange: (Ie) => oe(l, Ie.target.value),
|
|
6851
|
-
readOnly:
|
|
6867
|
+
readOnly: Te,
|
|
6852
6868
|
error: ie
|
|
6853
6869
|
},
|
|
6854
6870
|
le
|
|
@@ -6857,13 +6873,13 @@ const ut = {
|
|
|
6857
6873
|
return /* @__PURE__ */ r(
|
|
6858
6874
|
xe,
|
|
6859
6875
|
{
|
|
6860
|
-
|
|
6876
|
+
...Be,
|
|
6861
6877
|
type: "tel",
|
|
6862
|
-
label:
|
|
6878
|
+
label: Qe,
|
|
6863
6879
|
placeholder: He ? void 0 : be,
|
|
6864
6880
|
value: Y[l] || "",
|
|
6865
6881
|
onChange: (Ie) => oe(l, Ie.target.value),
|
|
6866
|
-
readOnly:
|
|
6882
|
+
readOnly: Te,
|
|
6867
6883
|
error: ie
|
|
6868
6884
|
},
|
|
6869
6885
|
le
|
|
@@ -6872,13 +6888,13 @@ const ut = {
|
|
|
6872
6888
|
return /* @__PURE__ */ r(
|
|
6873
6889
|
xe,
|
|
6874
6890
|
{
|
|
6875
|
-
|
|
6891
|
+
...Be,
|
|
6876
6892
|
type: "text",
|
|
6877
|
-
label:
|
|
6893
|
+
label: Qe,
|
|
6878
6894
|
placeholder: He ? void 0 : be,
|
|
6879
6895
|
value: Y[l] || "",
|
|
6880
6896
|
onChange: (Ie) => oe(l, Ie.target.value),
|
|
6881
|
-
readOnly:
|
|
6897
|
+
readOnly: Te,
|
|
6882
6898
|
error: ie
|
|
6883
6899
|
},
|
|
6884
6900
|
le
|
|
@@ -6938,7 +6954,7 @@ const ut = {
|
|
|
6938
6954
|
) }, `custom-${f}`);
|
|
6939
6955
|
}
|
|
6940
6956
|
if (!l.paramName) return null;
|
|
6941
|
-
const g =
|
|
6957
|
+
const g = B[l.paramName], C = l.displayText || l.label || l.paramName;
|
|
6942
6958
|
if (l.customType === "checkbox")
|
|
6943
6959
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
6944
6960
|
/* @__PURE__ */ s(
|
|
@@ -6954,7 +6970,7 @@ const ut = {
|
|
|
6954
6970
|
checked: me[l.paramName] === "true",
|
|
6955
6971
|
onChange: (S) => Ne(l.paramName, S.target.checked ? "true" : "false"),
|
|
6956
6972
|
className: "metakyc-option-input",
|
|
6957
|
-
style:
|
|
6973
|
+
style: pt
|
|
6958
6974
|
}
|
|
6959
6975
|
),
|
|
6960
6976
|
/* @__PURE__ */ s(
|
|
@@ -6988,7 +7004,7 @@ const ut = {
|
|
|
6988
7004
|
checked: me[l.paramName] === "true",
|
|
6989
7005
|
onChange: (S) => Ne(l.paramName, S.target.checked ? "true" : "false"),
|
|
6990
7006
|
className: "metakyc-option-input",
|
|
6991
|
-
style: { ...
|
|
7007
|
+
style: { ...pt, alignSelf: "flex-start", marginTop: "2px" }
|
|
6992
7008
|
}
|
|
6993
7009
|
),
|
|
6994
7010
|
/* @__PURE__ */ s(
|
|
@@ -7051,12 +7067,12 @@ const ut = {
|
|
|
7051
7067
|
if (l.singleSelect)
|
|
7052
7068
|
Ne(l.paramName, be.target.checked ? pe.value : "");
|
|
7053
7069
|
else {
|
|
7054
|
-
const
|
|
7055
|
-
Ne(l.paramName,
|
|
7070
|
+
const Te = be.target.checked ? [...S, pe.value] : S.filter((le) => le !== pe.value);
|
|
7071
|
+
Ne(l.paramName, Te.join(","));
|
|
7056
7072
|
}
|
|
7057
7073
|
},
|
|
7058
7074
|
className: "metakyc-option-input",
|
|
7059
|
-
style:
|
|
7075
|
+
style: pt
|
|
7060
7076
|
}
|
|
7061
7077
|
),
|
|
7062
7078
|
/* @__PURE__ */ r(
|
|
@@ -7101,7 +7117,7 @@ const ut = {
|
|
|
7101
7117
|
onChange: () => Ne(l.paramName, S.value),
|
|
7102
7118
|
name: `radio-group-${l.paramName}-${f}`,
|
|
7103
7119
|
className: "metakyc-option-input",
|
|
7104
|
-
style:
|
|
7120
|
+
style: pt
|
|
7105
7121
|
}
|
|
7106
7122
|
),
|
|
7107
7123
|
/* @__PURE__ */ r(
|
|
@@ -7131,9 +7147,9 @@ const ut = {
|
|
|
7131
7147
|
`custom-${f}`
|
|
7132
7148
|
);
|
|
7133
7149
|
}, O = (l, f) => {
|
|
7134
|
-
const D =
|
|
7150
|
+
const D = $e(l);
|
|
7135
7151
|
return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
7136
|
-
l.conditionalOn && /* @__PURE__ */ r(
|
|
7152
|
+
l.conditionalOn && /* @__PURE__ */ r(Lt, { helpText: l.conditionalHelpText, children: /* @__PURE__ */ s(
|
|
7137
7153
|
"label",
|
|
7138
7154
|
{
|
|
7139
7155
|
className: "metakyc-option-label",
|
|
@@ -7146,7 +7162,7 @@ const ut = {
|
|
|
7146
7162
|
checked: D,
|
|
7147
7163
|
onChange: (g) => Ne(l.conditionalOn, g.target.checked ? "true" : "false"),
|
|
7148
7164
|
className: "metakyc-option-input",
|
|
7149
|
-
style:
|
|
7165
|
+
style: pt
|
|
7150
7166
|
}
|
|
7151
7167
|
),
|
|
7152
7168
|
/* @__PURE__ */ r(
|
|
@@ -7162,7 +7178,7 @@ const ut = {
|
|
|
7162
7178
|
) }),
|
|
7163
7179
|
D && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: l.fields.map((g, C) => {
|
|
7164
7180
|
const S = g.colSpan === 1 ? "col-span-1" : g.colSpan === 2 ? "col-span-2" : g.colSpan === 3 ? "col-span-3" : "col-span-4", pe = g.isCustom ? `custom-${C}-${g.paramName}` : `builtin-${g.name}-${C}`;
|
|
7165
|
-
return /* @__PURE__ */ r("div", { className: S, children: /* @__PURE__ */ r(
|
|
7181
|
+
return /* @__PURE__ */ r("div", { className: S, children: /* @__PURE__ */ r(Lt, { helpText: g.helpText, children: g.isCustom ? h(g, C) : Ye(g.name, pe, g.displayText, g.countriesType, g.labelMode) }) }, pe);
|
|
7166
7182
|
}) })
|
|
7167
7183
|
] });
|
|
7168
7184
|
};
|
|
@@ -7172,9 +7188,9 @@ const ut = {
|
|
|
7172
7188
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7173
7189
|
] }) }) });
|
|
7174
7190
|
if (N) {
|
|
7175
|
-
const l = N[F] ?? N[0], f = _e === -1, D = Re === -1, g = N.length, C =
|
|
7191
|
+
const l = N[F] ?? N[0], f = _e === -1, D = Re === -1, g = N.length, C = $e(l), S = Object.values(B);
|
|
7176
7192
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(re, { children: [
|
|
7177
|
-
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(
|
|
7193
|
+
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7178
7194
|
/* @__PURE__ */ s(ne, { children: [
|
|
7179
7195
|
(l.title || l.subtitle || l.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
7180
7196
|
l.title && /* @__PURE__ */ r(
|
|
@@ -7248,107 +7264,107 @@ const ut = {
|
|
|
7248
7264
|
{
|
|
7249
7265
|
type: "button",
|
|
7250
7266
|
isLoading: te || y,
|
|
7251
|
-
onClick: D ? je :
|
|
7267
|
+
onClick: D ? je : Ze,
|
|
7252
7268
|
children: D ? l.conditionalOn && !C ? "Skip & Submit" : "Submit" : l.conditionalOn && !C ? "Skip" : "Next"
|
|
7253
7269
|
}
|
|
7254
7270
|
)
|
|
7255
7271
|
] })
|
|
7256
7272
|
] }) });
|
|
7257
7273
|
}
|
|
7258
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit:
|
|
7259
|
-
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(
|
|
7274
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: it, children: /* @__PURE__ */ s(re, { children: [
|
|
7275
|
+
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7260
7276
|
/* @__PURE__ */ s(ne, { children: [
|
|
7261
7277
|
fe && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
|
|
7262
7278
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7263
7279
|
" ",
|
|
7264
7280
|
fe
|
|
7265
7281
|
] }) }),
|
|
7266
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: Q.map((l) => /* @__PURE__ */ r("div", { className: "col-span-4", children:
|
|
7282
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: Q.map((l) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ye(l) }, l)) })
|
|
7267
7283
|
] }),
|
|
7268
7284
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
7269
7285
|
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || y, children: "Cancel" }),
|
|
7270
7286
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: te || y, children: "Create Applicant" })
|
|
7271
7287
|
] })
|
|
7272
7288
|
] }) }) });
|
|
7273
|
-
},
|
|
7274
|
-
function
|
|
7289
|
+
}, Dt = ["companyName", "email"];
|
|
7290
|
+
function kt(e) {
|
|
7275
7291
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
7276
7292
|
}
|
|
7277
|
-
const
|
|
7293
|
+
const Xn = ({
|
|
7278
7294
|
workflowKey: e,
|
|
7279
7295
|
externalRefId: t,
|
|
7280
7296
|
onSuccess: n,
|
|
7281
7297
|
onCancel: a
|
|
7282
7298
|
}) => {
|
|
7283
|
-
var
|
|
7284
|
-
const { config: i, baseInformationService: o, currentTheme: c } =
|
|
7299
|
+
var Ye, h, O, q, W, X;
|
|
7300
|
+
const { config: i, baseInformationService: o, currentTheme: c } = Pe(), { createCompanyApplicant: d, isLoading: y } = zt(), p = e || ((Ye = i.applicantForm) == null ? void 0 : Ye.workflowKey);
|
|
7285
7301
|
if (!p)
|
|
7286
7302
|
throw new Error(
|
|
7287
7303
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
7288
7304
|
);
|
|
7289
|
-
const x = t || ((h = i.applicantForm) == null ? void 0 : h.externalRefId) || "",
|
|
7305
|
+
const x = t || ((h = i.applicantForm) == null ? void 0 : h.externalRefId) || "", T = ((O = i.applicantForm) == null ? void 0 : O.email) || "", v = ((q = i.applicantForm) == null ? void 0 : q.initialValues) || {}, P = (((W = i.applicantForm) == null ? void 0 : W.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", w = De(
|
|
7290
7306
|
() => c != null && c.companyFormPages && c.companyFormPages.length > 0 ? c.companyFormPages : null,
|
|
7291
7307
|
[c == null ? void 0 : c.companyFormPages]
|
|
7292
7308
|
), N = De(() => {
|
|
7293
|
-
const m = new Set(
|
|
7309
|
+
const m = new Set(Dt), R = c == null ? void 0 : c.companyFormRequiredFields;
|
|
7294
7310
|
if (R) for (const L of R) m.add(L);
|
|
7295
7311
|
if (w)
|
|
7296
7312
|
for (const L of w)
|
|
7297
|
-
for (const
|
|
7298
|
-
!
|
|
7313
|
+
for (const u of L.fields)
|
|
7314
|
+
!u.isCustom && u.name && u.required && m.add(u.name);
|
|
7299
7315
|
return Array.from(m);
|
|
7300
7316
|
}, [c == null ? void 0 : c.companyFormRequiredFields, w]), z = De(() => {
|
|
7301
7317
|
var m;
|
|
7302
7318
|
if (w) {
|
|
7303
|
-
const R = w.flatMap((
|
|
7304
|
-
for (const
|
|
7319
|
+
const R = w.flatMap((u) => u.fields).filter((u) => !u.isCustom && u.name).map((u) => u.name), L = new Set(R);
|
|
7320
|
+
for (const u of Dt) L.add(u);
|
|
7305
7321
|
return Array.from(L);
|
|
7306
7322
|
}
|
|
7307
|
-
return (m = i.applicantForm) != null && m.visibleFields ? i.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields :
|
|
7323
|
+
return (m = i.applicantForm) != null && m.visibleFields ? i.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields : lr;
|
|
7308
7324
|
}, [(X = i.applicantForm) == null ? void 0 : X.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, w]), Q = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M = De(() => {
|
|
7309
7325
|
var R, L;
|
|
7310
7326
|
const m = /* @__PURE__ */ new Set();
|
|
7311
7327
|
if (w)
|
|
7312
|
-
for (const
|
|
7313
|
-
for (const l of
|
|
7314
|
-
!l.isCustom && l.name && Q.has(l.name) && m.add(l.countriesType ?? ((R =
|
|
7328
|
+
for (const u of w)
|
|
7329
|
+
for (const l of u.fields)
|
|
7330
|
+
!l.isCustom && l.name && Q.has(l.name) && m.add(l.countriesType ?? ((R = st[l.name]) == null ? void 0 : R.countriesType));
|
|
7315
7331
|
else
|
|
7316
|
-
for (const
|
|
7317
|
-
Q.has(
|
|
7332
|
+
for (const u of z)
|
|
7333
|
+
Q.has(u) && m.add((L = st[u]) == null ? void 0 : L.countriesType);
|
|
7318
7334
|
return m.size === 0 && m.add(void 0), Array.from(m);
|
|
7319
|
-
}, [z, w]), [j, K] = k({}), [ee, E] = k(!0), b = de(/* @__PURE__ */ new Set()),
|
|
7335
|
+
}, [z, w]), [j, K] = k({}), [ee, E] = k(!0), b = de(/* @__PURE__ */ new Set()), $ = de(/* @__PURE__ */ new Set());
|
|
7320
7336
|
ge(() => {
|
|
7321
7337
|
if (!c) return;
|
|
7322
|
-
const m = M.filter((
|
|
7323
|
-
const l =
|
|
7324
|
-
return
|
|
7338
|
+
const m = M.filter((u) => {
|
|
7339
|
+
const l = u != null ? String(u) : "all";
|
|
7340
|
+
return !$.current.has(l) && !b.current.has(l);
|
|
7325
7341
|
});
|
|
7326
7342
|
if (m.length === 0) {
|
|
7327
|
-
M.every((l) =>
|
|
7343
|
+
M.every((l) => $.current.has(l != null ? String(l) : "all")) && E(!1);
|
|
7328
7344
|
return;
|
|
7329
7345
|
}
|
|
7330
7346
|
E(!0);
|
|
7331
|
-
const R = m.map((
|
|
7332
|
-
R.forEach((
|
|
7347
|
+
const R = m.map((u) => u != null ? String(u) : "all");
|
|
7348
|
+
R.forEach((u) => b.current.add(u)), (async () => {
|
|
7333
7349
|
try {
|
|
7334
|
-
const
|
|
7350
|
+
const u = await Promise.all(
|
|
7335
7351
|
m.map(async (l) => {
|
|
7336
7352
|
const f = l != null ? String(l) : "all", D = await o.getCountries("", i.locale || "en", l), g = /* @__PURE__ */ new Set(), C = D.map((S) => ({ value: S.abbreviation3 || S.abbreviation, label: S.name })).filter((S) => !S.value || g.has(S.value) ? !1 : (g.add(S.value), !0));
|
|
7337
|
-
return
|
|
7353
|
+
return $.current.add(f), b.current.delete(f), [f, C];
|
|
7338
7354
|
})
|
|
7339
7355
|
);
|
|
7340
|
-
K((l) => ({ ...l, ...Object.fromEntries(
|
|
7341
|
-
} catch (
|
|
7342
|
-
R.forEach((l) => b.current.delete(l)), console.error("Failed to load countries:",
|
|
7356
|
+
K((l) => ({ ...l, ...Object.fromEntries(u) }));
|
|
7357
|
+
} catch (u) {
|
|
7358
|
+
R.forEach((l) => b.current.delete(l)), console.error("Failed to load countries:", u);
|
|
7343
7359
|
} finally {
|
|
7344
|
-
M.every((l) =>
|
|
7360
|
+
M.every((l) => $.current.has(l != null ? String(l) : "all")) && E(!1);
|
|
7345
7361
|
}
|
|
7346
7362
|
})();
|
|
7347
7363
|
}, [M, c]);
|
|
7348
7364
|
const V = (m, R) => {
|
|
7349
7365
|
var l;
|
|
7350
|
-
const L = R ?? ((l =
|
|
7351
|
-
return j[
|
|
7366
|
+
const L = R ?? ((l = st[m]) == null ? void 0 : l.countriesType), u = L != null ? String(L) : "all";
|
|
7367
|
+
return j[u] || [];
|
|
7352
7368
|
}, G = {
|
|
7353
7369
|
companyName: 1,
|
|
7354
7370
|
registrationNumber: 1,
|
|
@@ -7374,7 +7390,7 @@ const Zn = ({
|
|
|
7374
7390
|
), [J, se] = k({
|
|
7375
7391
|
workflowKey: p,
|
|
7376
7392
|
companyName: "",
|
|
7377
|
-
email:
|
|
7393
|
+
email: T,
|
|
7378
7394
|
phone: "",
|
|
7379
7395
|
registrationNumber: "",
|
|
7380
7396
|
countryResidence: "",
|
|
@@ -7394,20 +7410,20 @@ const Zn = ({
|
|
|
7394
7410
|
lei: "",
|
|
7395
7411
|
externalRefId: x,
|
|
7396
7412
|
..._
|
|
7397
|
-
}), [Y, ve] = k({}), [ue, me] = k(0), [ke, F] = k({}), [U,
|
|
7413
|
+
}), [Y, ve] = k({}), [ue, me] = k(0), [ke, F] = k({}), [U, B] = k(null), [H, fe] = k(!1), I = (m, R) => se((L) => ({ ...L, [m]: R })), te = (m, R) => ve((L) => ({ ...L, [m]: R })), ye = (m) => !m.conditionalOn || Y[m.conditionalOn] === "true", oe = w && ue < w.length - 1 ? ue + 1 : -1, Ne = w && ue > 0 ? ue - 1 : -1, $e = (m) => {
|
|
7398
7414
|
var L;
|
|
7399
7415
|
const R = {};
|
|
7400
|
-
for (const
|
|
7401
|
-
if (
|
|
7402
|
-
if (
|
|
7403
|
-
if (
|
|
7404
|
-
const l = Y[
|
|
7405
|
-
|
|
7416
|
+
for (const u of m.fields)
|
|
7417
|
+
if (u.isCustom) {
|
|
7418
|
+
if (u.customType === "paragraph" || u.customType === "html" || u.customType === "br" || u.customType === "link") continue;
|
|
7419
|
+
if (u.required && u.paramName) {
|
|
7420
|
+
const l = Y[u.paramName], f = u.displayText || u.label || u.paramName;
|
|
7421
|
+
u.customType === "checkbox" || u.customType === "link_checkbox" ? l !== "true" && (R[u.paramName] = `${f} is required.`) : (!l || l.trim() === "") && (R[u.paramName] = `${f} is required.`);
|
|
7406
7422
|
}
|
|
7407
|
-
} else if (
|
|
7408
|
-
const l =
|
|
7409
|
-
if (N.includes(l) &&
|
|
7410
|
-
const f =
|
|
7423
|
+
} else if (u.name) {
|
|
7424
|
+
const l = u.name;
|
|
7425
|
+
if (N.includes(l) && kt(J[l])) {
|
|
7426
|
+
const f = u.displayText || ((L = st[l]) == null ? void 0 : L.label) || l;
|
|
7411
7427
|
R[l] = `${f} is required.`;
|
|
7412
7428
|
}
|
|
7413
7429
|
}
|
|
@@ -7419,7 +7435,7 @@ const Zn = ({
|
|
|
7419
7435
|
F({}), oe >= 0 ? me(oe) : await _e();
|
|
7420
7436
|
return;
|
|
7421
7437
|
}
|
|
7422
|
-
const R =
|
|
7438
|
+
const R = $e(m);
|
|
7423
7439
|
if (Object.keys(R).length > 0) {
|
|
7424
7440
|
F(R);
|
|
7425
7441
|
return;
|
|
@@ -7430,13 +7446,13 @@ const Zn = ({
|
|
|
7430
7446
|
if (w) {
|
|
7431
7447
|
let R = {};
|
|
7432
7448
|
for (const L of w)
|
|
7433
|
-
ye(L) && (R = { ...R,
|
|
7449
|
+
ye(L) && (R = { ...R, ...$e(L) });
|
|
7434
7450
|
if (Object.keys(R).length > 0) {
|
|
7435
7451
|
F(R);
|
|
7436
7452
|
return;
|
|
7437
7453
|
}
|
|
7438
7454
|
}
|
|
7439
|
-
fe(!0),
|
|
7455
|
+
fe(!0), B(null);
|
|
7440
7456
|
try {
|
|
7441
7457
|
const R = {
|
|
7442
7458
|
workflowKey: J.workflowKey,
|
|
@@ -7444,7 +7460,7 @@ const Zn = ({
|
|
|
7444
7460
|
}, L = w ? w.filter((f) => ye(f)).flatMap((f) => f.fields).filter((f) => !f.isCustom && f.name).map((f) => f.name) : z;
|
|
7445
7461
|
for (const f of L) {
|
|
7446
7462
|
const D = J[f];
|
|
7447
|
-
if (!
|
|
7463
|
+
if (!kt(D))
|
|
7448
7464
|
switch (f) {
|
|
7449
7465
|
case "companyName":
|
|
7450
7466
|
R.companyName = D;
|
|
@@ -7475,7 +7491,7 @@ const Zn = ({
|
|
|
7475
7491
|
break;
|
|
7476
7492
|
}
|
|
7477
7493
|
}
|
|
7478
|
-
const
|
|
7494
|
+
const u = [];
|
|
7479
7495
|
if (w) {
|
|
7480
7496
|
for (const f of w)
|
|
7481
7497
|
if (ye(f))
|
|
@@ -7486,43 +7502,43 @@ const Zn = ({
|
|
|
7486
7502
|
if (D.customType === "checkbox" || D.customType === "link_checkbox")
|
|
7487
7503
|
C = g === "true" ? "yes" : "no";
|
|
7488
7504
|
else if (C = g, !C && !D.required) continue;
|
|
7489
|
-
|
|
7505
|
+
u.push({ paramName: D.paramName, value: C });
|
|
7490
7506
|
}
|
|
7491
7507
|
}
|
|
7492
|
-
|
|
7493
|
-
const l = await
|
|
7508
|
+
u.length > 0 && (R.applicantAdditionalDatas = u);
|
|
7509
|
+
const l = await d(R);
|
|
7494
7510
|
n(l.applicantId);
|
|
7495
7511
|
} catch (R) {
|
|
7496
|
-
console.error("Error creating company applicant:", R),
|
|
7512
|
+
console.error("Error creating company applicant:", R), B(R.message || "Failed to create company applicant");
|
|
7497
7513
|
} finally {
|
|
7498
7514
|
fe(!1);
|
|
7499
7515
|
}
|
|
7500
|
-
},
|
|
7516
|
+
}, at = async (m) => {
|
|
7501
7517
|
var R;
|
|
7502
7518
|
m.preventDefault();
|
|
7503
7519
|
for (const L of N)
|
|
7504
|
-
if (
|
|
7505
|
-
const
|
|
7506
|
-
|
|
7520
|
+
if (kt(J[L])) {
|
|
7521
|
+
const u = ((R = st[L]) == null ? void 0 : R.label) || L;
|
|
7522
|
+
B(`${u} is required.`);
|
|
7507
7523
|
return;
|
|
7508
7524
|
}
|
|
7509
7525
|
await _e();
|
|
7510
|
-
},
|
|
7511
|
-
const f =
|
|
7526
|
+
}, Ze = (m, R, L, u, l) => {
|
|
7527
|
+
const f = st[m];
|
|
7512
7528
|
if (!f) return null;
|
|
7513
|
-
const D = N.includes(m), g = ke[m], C = L || f.label, S = m in _, pe = R ?? m, ie = l ? l !== "placeholder" :
|
|
7529
|
+
const D = N.includes(m), g = ke[m], C = L || f.label, S = m in _, pe = R ?? m, ie = l ? l !== "placeholder" : P, be = ie ? C : void 0, Te = ie ? "..." : C;
|
|
7514
7530
|
switch (f.type) {
|
|
7515
7531
|
case "select":
|
|
7516
7532
|
if (m === "countryResidence" || m === "addressCountry") {
|
|
7517
|
-
const le = V(m,
|
|
7533
|
+
const le = V(m, u);
|
|
7518
7534
|
return /* @__PURE__ */ r(
|
|
7519
|
-
|
|
7535
|
+
qe,
|
|
7520
7536
|
{
|
|
7521
7537
|
required: D,
|
|
7522
7538
|
label: be,
|
|
7523
7539
|
value: J[m] || "",
|
|
7524
|
-
onChange: (
|
|
7525
|
-
options: [{ value: "", label: `Select ${
|
|
7540
|
+
onChange: (Be) => I(m, Be),
|
|
7541
|
+
options: [{ value: "", label: `Select ${Te.toLowerCase()}` }, ...le],
|
|
7526
7542
|
disabled: ee,
|
|
7527
7543
|
readOnly: S,
|
|
7528
7544
|
error: g
|
|
@@ -7618,7 +7634,7 @@ const Zn = ({
|
|
|
7618
7634
|
}
|
|
7619
7635
|
) }, `custom-${R}`);
|
|
7620
7636
|
if (!m.paramName) return null;
|
|
7621
|
-
const L = ke[m.paramName],
|
|
7637
|
+
const L = ke[m.paramName], u = m.displayText || m.label || m.paramName, l = m.labelMode ? m.labelMode !== "placeholder" : P;
|
|
7622
7638
|
return m.customType === "checkbox" ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
7623
7639
|
/* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
7624
7640
|
/* @__PURE__ */ r(
|
|
@@ -7631,7 +7647,7 @@ const Zn = ({
|
|
|
7631
7647
|
}
|
|
7632
7648
|
),
|
|
7633
7649
|
/* @__PURE__ */ s("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
7634
|
-
|
|
7650
|
+
u,
|
|
7635
7651
|
m.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
7636
7652
|
] })
|
|
7637
7653
|
] }),
|
|
@@ -7640,8 +7656,8 @@ const Zn = ({
|
|
|
7640
7656
|
xe,
|
|
7641
7657
|
{
|
|
7642
7658
|
type: "text",
|
|
7643
|
-
label: l ? `${
|
|
7644
|
-
placeholder: l ? void 0 :
|
|
7659
|
+
label: l ? `${u}${m.required ? " *" : ""}` : void 0,
|
|
7660
|
+
placeholder: l ? void 0 : u,
|
|
7645
7661
|
value: Y[m.paramName] || "",
|
|
7646
7662
|
onChange: (f) => te(m.paramName, f.target.value),
|
|
7647
7663
|
required: m.required,
|
|
@@ -7649,7 +7665,7 @@ const Zn = ({
|
|
|
7649
7665
|
},
|
|
7650
7666
|
`custom-${R}`
|
|
7651
7667
|
);
|
|
7652
|
-
},
|
|
7668
|
+
}, it = (m) => {
|
|
7653
7669
|
const R = ye(m);
|
|
7654
7670
|
return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
7655
7671
|
m.conditionalOn && /* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
@@ -7664,9 +7680,9 @@ const Zn = ({
|
|
|
7664
7680
|
),
|
|
7665
7681
|
/* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: m.conditionalOn })
|
|
7666
7682
|
] }),
|
|
7667
|
-
R && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: m.fields.map((L,
|
|
7668
|
-
const l = L.colSpan === 1 ? "col-span-1" : L.colSpan === 2 ? "col-span-2" : L.colSpan === 3 ? "col-span-3" : "col-span-4", f = L.isCustom ? `custom-${
|
|
7669
|
-
return /* @__PURE__ */ r("div", { className: l, children: L.isCustom ? je(L,
|
|
7683
|
+
R && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: m.fields.map((L, u) => {
|
|
7684
|
+
const l = L.colSpan === 1 ? "col-span-1" : L.colSpan === 2 ? "col-span-2" : L.colSpan === 3 ? "col-span-3" : "col-span-4", f = L.isCustom ? `custom-${u}-${L.paramName}` : `builtin-${L.name}-${u}`;
|
|
7685
|
+
return /* @__PURE__ */ r("div", { className: l, children: L.isCustom ? je(L, u) : Ze(L.name, f, L.displayText, L.countriesType, L.labelMode) }, f);
|
|
7670
7686
|
}) })
|
|
7671
7687
|
] });
|
|
7672
7688
|
};
|
|
@@ -7676,9 +7692,9 @@ const Zn = ({
|
|
|
7676
7692
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7677
7693
|
] }) }) });
|
|
7678
7694
|
if (w) {
|
|
7679
|
-
const m = w[ue] ?? w[0], R = Ne === -1, L = oe === -1,
|
|
7695
|
+
const m = w[ue] ?? w[0], R = Ne === -1, L = oe === -1, u = w.length, l = ye(m), f = Object.values(ke);
|
|
7680
7696
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(re, { children: [
|
|
7681
|
-
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(
|
|
7697
|
+
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7682
7698
|
/* @__PURE__ */ s(ne, { children: [
|
|
7683
7699
|
(m.title || m.subtitle) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
7684
7700
|
m.title && /* @__PURE__ */ r("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: m.title }),
|
|
@@ -7692,7 +7708,7 @@ const Zn = ({
|
|
|
7692
7708
|
] }),
|
|
7693
7709
|
f.map((D, g) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: D }, g))
|
|
7694
7710
|
] }),
|
|
7695
|
-
|
|
7711
|
+
u > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
7696
7712
|
w.map((D, g) => /* @__PURE__ */ r(
|
|
7697
7713
|
"div",
|
|
7698
7714
|
{
|
|
@@ -7704,10 +7720,10 @@ const Zn = ({
|
|
|
7704
7720
|
/* @__PURE__ */ s("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
7705
7721
|
ue + 1,
|
|
7706
7722
|
" / ",
|
|
7707
|
-
|
|
7723
|
+
u
|
|
7708
7724
|
] })
|
|
7709
7725
|
] }),
|
|
7710
|
-
|
|
7726
|
+
it(m)
|
|
7711
7727
|
] }),
|
|
7712
7728
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
7713
7729
|
/* @__PURE__ */ s("div", { children: [
|
|
@@ -7729,22 +7745,22 @@ const Zn = ({
|
|
|
7729
7745
|
] })
|
|
7730
7746
|
] }) });
|
|
7731
7747
|
}
|
|
7732
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit:
|
|
7733
|
-
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(
|
|
7748
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: at, children: /* @__PURE__ */ s(re, { children: [
|
|
7749
|
+
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7734
7750
|
/* @__PURE__ */ s(ne, { children: [
|
|
7735
7751
|
U && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
|
|
7736
7752
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7737
7753
|
" ",
|
|
7738
7754
|
U
|
|
7739
7755
|
] }) }),
|
|
7740
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: z.map((m) => /* @__PURE__ */ r("div", { className: "col-span-4", children:
|
|
7756
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: z.map((m) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(m) }, m)) })
|
|
7741
7757
|
] }),
|
|
7742
7758
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
7743
7759
|
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || y, children: "Cancel" }),
|
|
7744
7760
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: H || y, children: "Register Company" })
|
|
7745
7761
|
] })
|
|
7746
7762
|
] }) }) });
|
|
7747
|
-
},
|
|
7763
|
+
}, ea = ({
|
|
7748
7764
|
applicantId: e,
|
|
7749
7765
|
onComplete: t,
|
|
7750
7766
|
onError: n,
|
|
@@ -7754,15 +7770,15 @@ const Zn = ({
|
|
|
7754
7770
|
const {
|
|
7755
7771
|
progress: o,
|
|
7756
7772
|
currentStep: c,
|
|
7757
|
-
steps:
|
|
7773
|
+
steps: d,
|
|
7758
7774
|
workflowKey: y,
|
|
7759
7775
|
nextWorkflowKey: p,
|
|
7760
7776
|
hasWorkflowChanged: x,
|
|
7761
|
-
isLoading:
|
|
7777
|
+
isLoading: T,
|
|
7762
7778
|
error: v,
|
|
7763
7779
|
moveBack: A,
|
|
7764
|
-
refreshProgress:
|
|
7765
|
-
} =
|
|
7780
|
+
refreshProgress: P
|
|
7781
|
+
} = qr(e), [w, N] = we.useState(!1), z = we.useRef(null);
|
|
7766
7782
|
if (we.useEffect(() => {
|
|
7767
7783
|
v && n && n(v);
|
|
7768
7784
|
}, [v, n]), we.useEffect(() => {
|
|
@@ -7771,7 +7787,7 @@ const Zn = ({
|
|
|
7771
7787
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
7772
7788
|
}, [a]), we.useEffect(() => {
|
|
7773
7789
|
x && N(!1);
|
|
7774
|
-
}, [x]),
|
|
7790
|
+
}, [x]), T || !o)
|
|
7775
7791
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
|
|
7776
7792
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
7777
7793
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading workflow..." })
|
|
@@ -7853,11 +7869,11 @@ const Zn = ({
|
|
|
7853
7869
|
return "";
|
|
7854
7870
|
}
|
|
7855
7871
|
}, M = () => {
|
|
7856
|
-
const K =
|
|
7872
|
+
const K = d.filter((V) => V.visibility !== !1), ee = K.findIndex((V) => V.order === c.order), E = ee >= 0 ? ee + 1 : 1, b = K.length, $ = b > 1 ? ee / (b - 1) * 100 : 100;
|
|
7857
7873
|
return /* @__PURE__ */ s("div", { style: { marginBottom: "24px" }, children: [
|
|
7858
7874
|
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
7859
|
-
/* @__PURE__ */ r(
|
|
7860
|
-
/* @__PURE__ */ s(
|
|
7875
|
+
/* @__PURE__ */ r(mt, {}),
|
|
7876
|
+
/* @__PURE__ */ s($t, { variant: o.status === 1 ? "info" : "success", children: [
|
|
7861
7877
|
"Step ",
|
|
7862
7878
|
E,
|
|
7863
7879
|
" of ",
|
|
@@ -7873,11 +7889,11 @@ const Zn = ({
|
|
|
7873
7889
|
height: "100%",
|
|
7874
7890
|
borderRadius: "999px",
|
|
7875
7891
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
7876
|
-
width: `${
|
|
7892
|
+
width: `${$}%`,
|
|
7877
7893
|
transition: "width 0.4s ease"
|
|
7878
7894
|
} }) }) }),
|
|
7879
7895
|
/* @__PURE__ */ r(
|
|
7880
|
-
|
|
7896
|
+
Ln,
|
|
7881
7897
|
{
|
|
7882
7898
|
ref: z,
|
|
7883
7899
|
visibleSteps: K,
|
|
@@ -7890,26 +7906,26 @@ const Zn = ({
|
|
|
7890
7906
|
const K = {
|
|
7891
7907
|
applicantId: e,
|
|
7892
7908
|
onComplete: async () => {
|
|
7893
|
-
await
|
|
7909
|
+
await P();
|
|
7894
7910
|
},
|
|
7895
7911
|
onBack: c.order > 0 ? A : void 0
|
|
7896
7912
|
};
|
|
7897
7913
|
switch (c.action) {
|
|
7898
7914
|
case ce.Questionaries:
|
|
7899
|
-
return /* @__PURE__ */ r(
|
|
7915
|
+
return /* @__PURE__ */ r(yn, { ...K });
|
|
7900
7916
|
case ce.UploadDocument:
|
|
7901
|
-
return /* @__PURE__ */ r(fn, { ...K });
|
|
7902
|
-
case ce.Overview:
|
|
7903
7917
|
return /* @__PURE__ */ r(gn, { ...K });
|
|
7918
|
+
case ce.Overview:
|
|
7919
|
+
return /* @__PURE__ */ r(bn, { ...K });
|
|
7904
7920
|
case ce.IdentitySdk:
|
|
7905
|
-
return /* @__PURE__ */ r(
|
|
7921
|
+
return /* @__PURE__ */ r(Pn, { ...K });
|
|
7906
7922
|
case ce.RiskScoring:
|
|
7907
|
-
return /* @__PURE__ */ r(
|
|
7923
|
+
return /* @__PURE__ */ r(Nn, { ...K });
|
|
7908
7924
|
case ce.AdditionalData:
|
|
7909
7925
|
case ce.InvestorCategorization:
|
|
7910
|
-
return /* @__PURE__ */ r(Rn, { ...K });
|
|
7911
|
-
case ce.AppropriatenessTest:
|
|
7912
7926
|
return /* @__PURE__ */ r(In, { ...K });
|
|
7927
|
+
case ce.AppropriatenessTest:
|
|
7928
|
+
return /* @__PURE__ */ r(En, { ...K });
|
|
7913
7929
|
case ce.ManualReview:
|
|
7914
7930
|
return /* @__PURE__ */ r(
|
|
7915
7931
|
Tt,
|
|
@@ -7938,12 +7954,12 @@ const Zn = ({
|
|
|
7938
7954
|
M(),
|
|
7939
7955
|
j()
|
|
7940
7956
|
] });
|
|
7941
|
-
},
|
|
7957
|
+
}, Ln = we.forwardRef(
|
|
7942
7958
|
({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: n }, a) => {
|
|
7943
7959
|
const i = we.useRef(null), o = we.useRef(null);
|
|
7944
7960
|
return we.useImperativeHandle(a, () => i.current), we.useEffect(() => {
|
|
7945
7961
|
if (o.current && i.current) {
|
|
7946
|
-
const c = i.current,
|
|
7962
|
+
const c = i.current, d = o.current, y = d.offsetLeft - c.offsetWidth / 2 + d.offsetWidth / 2;
|
|
7947
7963
|
c.scrollTo({ left: Math.max(0, y), behavior: "smooth" });
|
|
7948
7964
|
}
|
|
7949
7965
|
}, [t]), /* @__PURE__ */ r(
|
|
@@ -7962,8 +7978,8 @@ const Zn = ({
|
|
|
7962
7978
|
padding: "4px 0",
|
|
7963
7979
|
gap: "0"
|
|
7964
7980
|
},
|
|
7965
|
-
children: e.map((c,
|
|
7966
|
-
const y =
|
|
7981
|
+
children: e.map((c, d) => {
|
|
7982
|
+
const y = d < t, p = d === t, x = y || p, T = c.displayName || c.name || n(c.action) || `Step ${d + 1}`;
|
|
7967
7983
|
return /* @__PURE__ */ s(we.Fragment, { children: [
|
|
7968
7984
|
/* @__PURE__ */ s(
|
|
7969
7985
|
"div",
|
|
@@ -7995,7 +8011,7 @@ const Zn = ({
|
|
|
7995
8011
|
color: "var(--metakyc-text-muted, #9ca3af)",
|
|
7996
8012
|
border: "2px solid var(--metakyc-border, #e5e7eb)"
|
|
7997
8013
|
}
|
|
7998
|
-
}, children: y ? /* @__PURE__ */ r("svg", { width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) :
|
|
8014
|
+
}, children: y ? /* @__PURE__ */ r("svg", { width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : d + 1 }),
|
|
7999
8015
|
/* @__PURE__ */ r("span", { style: {
|
|
8000
8016
|
marginLeft: "6px",
|
|
8001
8017
|
fontSize: "13px",
|
|
@@ -8003,11 +8019,11 @@ const Zn = ({
|
|
|
8003
8019
|
fontWeight: p ? 600 : 400,
|
|
8004
8020
|
color: p ? "var(--metakyc-text-primary, #111827)" : y ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
8005
8021
|
transition: "color 0.2s ease"
|
|
8006
|
-
}, children:
|
|
8022
|
+
}, children: T })
|
|
8007
8023
|
]
|
|
8008
8024
|
}
|
|
8009
8025
|
),
|
|
8010
|
-
|
|
8026
|
+
d < e.length - 1 && /* @__PURE__ */ r("div", { style: {
|
|
8011
8027
|
width: "32px",
|
|
8012
8028
|
minWidth: "16px",
|
|
8013
8029
|
height: "2px",
|
|
@@ -8023,13 +8039,13 @@ const Zn = ({
|
|
|
8023
8039
|
);
|
|
8024
8040
|
}
|
|
8025
8041
|
);
|
|
8026
|
-
function
|
|
8027
|
-
return
|
|
8028
|
-
questionResults:
|
|
8042
|
+
function ta(e) {
|
|
8043
|
+
return Ve.object({
|
|
8044
|
+
questionResults: Ve.any()
|
|
8029
8045
|
}).passthrough();
|
|
8030
8046
|
}
|
|
8031
|
-
function
|
|
8032
|
-
let t =
|
|
8047
|
+
function Dn(e) {
|
|
8048
|
+
let t = Ve.array(Ve.instanceof(File));
|
|
8033
8049
|
if (e.isRequired ? t = t.min(
|
|
8034
8050
|
1,
|
|
8035
8051
|
`${e.displayName} is required`
|
|
@@ -8050,144 +8066,144 @@ function Ln(e) {
|
|
|
8050
8066
|
}
|
|
8051
8067
|
return t;
|
|
8052
8068
|
}
|
|
8053
|
-
function
|
|
8069
|
+
function ra(e) {
|
|
8054
8070
|
const t = {};
|
|
8055
8071
|
return e.uploadDocumentFiles.forEach((n) => {
|
|
8056
8072
|
const a = `file_${n.id}`;
|
|
8057
|
-
t[a] =
|
|
8058
|
-
}),
|
|
8073
|
+
t[a] = Dn(n);
|
|
8074
|
+
}), Ve.object(t);
|
|
8059
8075
|
}
|
|
8060
|
-
function
|
|
8061
|
-
return
|
|
8076
|
+
function na(e) {
|
|
8077
|
+
return Ve.any();
|
|
8062
8078
|
}
|
|
8063
|
-
function
|
|
8064
|
-
return
|
|
8079
|
+
function Mn(e) {
|
|
8080
|
+
return Ve.string().min(1, "This question is required");
|
|
8065
8081
|
}
|
|
8066
|
-
function
|
|
8082
|
+
function aa(e) {
|
|
8067
8083
|
const t = {};
|
|
8068
8084
|
return e.appropriatenessQuestions.forEach((n) => {
|
|
8069
8085
|
const a = `question_${n.id}`;
|
|
8070
|
-
t[a] =
|
|
8071
|
-
}),
|
|
8086
|
+
t[a] = Mn();
|
|
8087
|
+
}), Ve.object(t);
|
|
8072
8088
|
}
|
|
8073
|
-
const
|
|
8089
|
+
const ia = Ve.any();
|
|
8074
8090
|
export {
|
|
8075
|
-
|
|
8076
|
-
|
|
8091
|
+
It as ALLOWED_LANGUAGES,
|
|
8092
|
+
Jt as ApplicantProgressOnHoldReason,
|
|
8077
8093
|
ze as ApplicantProgressStatus,
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8094
|
+
mr as ApplicantService,
|
|
8095
|
+
Xt as ApplicantStatus,
|
|
8096
|
+
ar as AppropriatenessQuestionType,
|
|
8097
|
+
fr as AppropriatenessTestService,
|
|
8098
|
+
En as AppropriatenessTestStep,
|
|
8099
|
+
$t as Badge,
|
|
8100
|
+
vr as BaseInformationService,
|
|
8085
8101
|
Z as Button,
|
|
8086
|
-
|
|
8102
|
+
st as COMPANY_FIELD_METADATA,
|
|
8087
8103
|
re as Card,
|
|
8088
8104
|
ne as CardContent,
|
|
8089
8105
|
Ce as CardFooter,
|
|
8090
8106
|
Se as CardHeader,
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8107
|
+
Je as CountriesType,
|
|
8108
|
+
Zn as CreateApplicantForm,
|
|
8109
|
+
Xn as CreateCompanyApplicantForm,
|
|
8110
|
+
sr as CriteriaBuiltInType,
|
|
8111
|
+
lr as DEFAULT_COMPANY_VISIBLE_FIELDS,
|
|
8112
|
+
cr as DEFAULT_VISIBLE_FIELDS,
|
|
8113
|
+
nr as DocumentReviewStatus,
|
|
8114
|
+
ur as EndpointBuilder,
|
|
8115
|
+
dt as ErrorHandler,
|
|
8116
|
+
Fr as EventEmitter,
|
|
8117
|
+
nt as FIELD_METADATA,
|
|
8118
|
+
rr as FileType,
|
|
8119
|
+
rn as FileUpload,
|
|
8120
|
+
bt as GenderType,
|
|
8121
|
+
mt as Header,
|
|
8122
|
+
pr as HttpClient,
|
|
8123
|
+
Ge as IdentityProviderManager,
|
|
8124
|
+
xr as IdentityService,
|
|
8109
8125
|
Oe as IdentityVerificationProvider,
|
|
8110
|
-
|
|
8126
|
+
Pn as IdentityVerificationStep,
|
|
8111
8127
|
xe as Input,
|
|
8112
|
-
|
|
8113
|
-
|
|
8128
|
+
kr as InvestorCategorizationService,
|
|
8129
|
+
In as InvestorCategorizationStep,
|
|
8114
8130
|
Ee as InvestorCategorizationType,
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8131
|
+
or as InvestorCategoryType,
|
|
8132
|
+
er as KycProcessStatus,
|
|
8133
|
+
tt as KycStatus,
|
|
8118
8134
|
Tt as KycStatusDisplay,
|
|
8119
|
-
|
|
8135
|
+
ea as KycWorkflow,
|
|
8120
8136
|
Tn as Logo,
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8137
|
+
Ot as MetaKYCContext,
|
|
8138
|
+
Ue as MetaKYCError,
|
|
8139
|
+
Kn as MetaKYCProvider,
|
|
8140
|
+
en as MultiSelect,
|
|
8141
|
+
Or as OnfidoProvider,
|
|
8142
|
+
gr as OverviewService,
|
|
8143
|
+
bn as OverviewStep,
|
|
8144
|
+
nn as PhoneInput,
|
|
8145
|
+
yr as QuestionnaireService,
|
|
8146
|
+
yn as QuestionnaireStep,
|
|
8147
|
+
rt as ReviewStatus,
|
|
8148
|
+
ir as RiskCriteriaType,
|
|
8149
|
+
Zt as RiskLevel,
|
|
8150
|
+
br as RiskScoringService,
|
|
8151
|
+
Nn as RiskScoringStep,
|
|
8152
|
+
zr as SardinAIProvider,
|
|
8153
|
+
qe as SearchableSelect,
|
|
8154
|
+
Ct as Select,
|
|
8139
8155
|
Me as Spinner,
|
|
8140
|
-
|
|
8141
|
-
|
|
8156
|
+
Pr as StepRouter,
|
|
8157
|
+
Mr as SumsubProvider,
|
|
8142
8158
|
Br as ThemeManager,
|
|
8143
8159
|
Fe as ThemePreset,
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8160
|
+
Er as ThemeService,
|
|
8161
|
+
hr as UploadDocumentService,
|
|
8162
|
+
gn as UploadDocumentStep,
|
|
8163
|
+
tr as UserType,
|
|
8164
|
+
Ke as ValueDataType,
|
|
8149
8165
|
Tr as WorkflowOrchestrator,
|
|
8150
|
-
|
|
8151
|
-
|
|
8166
|
+
gt as WorkflowResultType,
|
|
8167
|
+
Ar as WorkflowState,
|
|
8152
8168
|
ce as WorkflowStepAction,
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8169
|
+
ia as appropriatenessTestSchema,
|
|
8170
|
+
Gn as clearAllStorage,
|
|
8171
|
+
Wr as clearApplicantId,
|
|
8172
|
+
Kr as clearWorkflowState,
|
|
8157
8173
|
Ae as cn,
|
|
8158
|
-
|
|
8159
|
-
|
|
8174
|
+
wr as corporateTheme,
|
|
8175
|
+
dr as defaultConfig,
|
|
8160
8176
|
Le as defaultTheme,
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8177
|
+
_r as fileToBase64,
|
|
8178
|
+
Sr as fintechTheme,
|
|
8179
|
+
xt as formatFileSize,
|
|
8180
|
+
aa as generateAppropriatenessSchema,
|
|
8181
|
+
ta as generateQuestionnaireSchema,
|
|
8182
|
+
na as generateRiskScoringSchema,
|
|
8183
|
+
ra as generateUploadDocumentSchema,
|
|
8184
|
+
Yn as getAcceptString,
|
|
8185
|
+
Hr as getApplicantId,
|
|
8186
|
+
ut as getThemePreset,
|
|
8187
|
+
Qn as getWorkflowState,
|
|
8188
|
+
Cr as healthcareTheme,
|
|
8189
|
+
Wn as isScriptLoaded,
|
|
8190
|
+
Mt as loadScript,
|
|
8191
|
+
Rr as minimalTheme,
|
|
8192
|
+
Nr as modernTheme,
|
|
8193
|
+
Un as removeScript,
|
|
8194
|
+
jr as saveApplicantId,
|
|
8195
|
+
Ur as saveWorkflowState,
|
|
8196
|
+
Ir as themePresets,
|
|
8197
|
+
zt as useApplicant,
|
|
8198
|
+
Jn as useAppropriatenessTest,
|
|
8199
|
+
Gr as useIdentityVerification,
|
|
8200
|
+
qr as useKycWorkflow,
|
|
8201
|
+
Pe as useMetaKYC,
|
|
8202
|
+
Qr as useOverview,
|
|
8203
|
+
Vr as useQuestionnaire,
|
|
8204
|
+
Jr as useRiskScoring,
|
|
8205
|
+
Yr as useUploadDocument,
|
|
8206
|
+
qn as validateFileSize,
|
|
8207
|
+
Vn as validateFileType
|
|
8192
8208
|
};
|
|
8193
8209
|
//# sourceMappingURL=index.js.map
|