@vpdev2/metakyc 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CreateApplicantForm.d.ts.map +1 -1
- package/dist/components/CreateCompanyApplicantForm.d.ts.map +1 -1
- package/dist/components/core/Checkbox.d.ts +15 -0
- package/dist/components/core/Checkbox.d.ts.map +1 -0
- package/dist/components/core/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/index.d.ts +1 -0
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/identity/IdentityVerificationStep.d.ts.map +1 -1
- package/dist/components/steps/QuestionnaireStep.d.ts.map +1 -1
- package/dist/components/steps/RiskScoringStep.d.ts.map +1 -1
- package/dist/context/MetaKYCProvider.d.ts.map +1 -1
- package/dist/index.cjs +23 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +734 -704
- package/dist/index.js.map +1 -1
- package/dist/styles/critical-css.d.ts +2 -0
- package/dist/styles/critical-css.d.ts.map +1 -0
- package/dist/version.d.ts +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
|
|
7
|
-
import { jsxs as o, jsx as r, 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 || {}), 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 || {}),
|
|
12
|
-
const
|
|
1
|
+
var qt = Object.defineProperty;
|
|
2
|
+
var Vt = (e, t, n) => t in e ? qt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var he = (e, t, n) => Vt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import Yt from "axios";
|
|
5
|
+
import * as Rt from "react";
|
|
6
|
+
import ke, { createContext as Qt, useState as k, useMemo as De, useEffect as ge, useContext as Gt, useRef as de, useCallback as ae, forwardRef as yt, createElement as St } from "react";
|
|
7
|
+
import { jsxs as o, jsx as r, Fragment as ct } from "react/jsx-runtime";
|
|
8
|
+
import Jt, { createPortal as Ct } from "react-dom";
|
|
9
|
+
import { useForm as Zt, Controller as tt } from "react-hook-form";
|
|
10
|
+
import { z as Ye } 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 || {}), Xt = /* @__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))(Xt || {}), er = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(er || {}), rt = /* @__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))(rt || {}), nt = /* @__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))(nt || {}), tr = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(tr || {}), rr = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(rr || {}), Oe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Oe || {}), nr = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(nr || {}), bt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(bt || {}), ar = /* @__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))(ar || {}), ir = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(ir || {}), or = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(or || {}), qe = /* @__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))(qe || {}), sr = /* @__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))(sr || {}), lr = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(lr || {}), 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 || {}), cr = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(cr || {});
|
|
12
|
+
const Ze = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
15
15
|
CountryOfBirth: 30,
|
|
16
16
|
PhoneNumber: 40,
|
|
17
17
|
UboAddress: 50
|
|
18
|
-
},
|
|
18
|
+
}, at = {
|
|
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 Je = {
|
|
|
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: Ze.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: Ze.Address },
|
|
32
|
+
nationality: { label: "Nationality", type: "select", countriesType: Ze.Nationality },
|
|
33
|
+
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType: Ze.Nationality },
|
|
34
|
+
countryOfBirth: { label: "Country of Birth", type: "select", countriesType: Ze.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: Ze.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: Ze.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 Je = {
|
|
|
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: Ze.Address },
|
|
60
60
|
lei: { label: "LEI", type: "text" }
|
|
61
|
-
},
|
|
61
|
+
}, dr = [
|
|
62
62
|
"companyName",
|
|
63
63
|
"email",
|
|
64
64
|
"phone",
|
|
65
65
|
"registrationNumber"
|
|
66
|
-
],
|
|
66
|
+
], ur = [
|
|
67
67
|
"firstName",
|
|
68
68
|
"lastName",
|
|
69
69
|
"email",
|
|
70
70
|
"phonenumber",
|
|
71
71
|
"dateOfBirth"
|
|
72
|
-
],
|
|
72
|
+
], Et = [
|
|
73
73
|
{ value: "EN", label: "English" },
|
|
74
74
|
{ value: "DE", label: "German" },
|
|
75
75
|
{ value: "FR", label: "French" },
|
|
@@ -89,7 +89,7 @@ const Je = {
|
|
|
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 pr = {
|
|
93
93
|
timeout: 3e4,
|
|
94
94
|
retries: 3,
|
|
95
95
|
locale: "en",
|
|
@@ -97,7 +97,7 @@ const dr = {
|
|
|
97
97
|
pattern: "host-controller"
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
class
|
|
100
|
+
class mr {
|
|
101
101
|
constructor(t) {
|
|
102
102
|
this.config = t;
|
|
103
103
|
}
|
|
@@ -137,19 +137,19 @@ class ur {
|
|
|
137
137
|
}[t] || t;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
class
|
|
140
|
+
class Ke extends Error {
|
|
141
141
|
constructor(n, a, i, s, c) {
|
|
142
142
|
super(n);
|
|
143
143
|
he(this, "response");
|
|
144
|
-
this.code = a, this.details = i, this.validationErrors = s, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this,
|
|
144
|
+
this.code = a, this.details = i, this.validationErrors = s, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, Ke.prototype);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
class
|
|
147
|
+
class ut {
|
|
148
148
|
/**
|
|
149
149
|
* Process an error from the API response
|
|
150
150
|
*/
|
|
151
151
|
static handleApiError(t) {
|
|
152
|
-
return new
|
|
152
|
+
return new Ke(
|
|
153
153
|
t.message || "An unknown error occurred",
|
|
154
154
|
t.code,
|
|
155
155
|
t.details || void 0,
|
|
@@ -162,44 +162,44 @@ class dt {
|
|
|
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 Ke(
|
|
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 Ke(
|
|
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 Ke(
|
|
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 Ke(
|
|
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 Ke(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 Ke;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
class
|
|
197
|
+
class yr {
|
|
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 = { ...pr, ...t }, this.endpointBuilder = new mr(this.config.endpoints), this.axiosInstance = Yt.create({
|
|
203
203
|
baseURL: this.config.baseUrl,
|
|
204
204
|
timeout: this.config.timeout,
|
|
205
205
|
headers: {
|
|
@@ -241,7 +241,7 @@ class pr {
|
|
|
241
241
|
});
|
|
242
242
|
return this.handleResponse(s);
|
|
243
243
|
} catch (i) {
|
|
244
|
-
throw
|
|
244
|
+
throw ut.handleAxiosError(i);
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
/**
|
|
@@ -252,7 +252,7 @@ class pr {
|
|
|
252
252
|
const i = this.buildEndpoint(t, n), s = await this.axiosInstance.post(i, a);
|
|
253
253
|
return this.handleResponse(s);
|
|
254
254
|
} catch (i) {
|
|
255
|
-
throw
|
|
255
|
+
throw ut.handleAxiosError(i);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
@@ -263,7 +263,7 @@ class pr {
|
|
|
263
263
|
const i = this.buildEndpoint(t, n), s = await this.axiosInstance.put(i, a);
|
|
264
264
|
return this.handleResponse(s);
|
|
265
265
|
} catch (i) {
|
|
266
|
-
throw
|
|
266
|
+
throw ut.handleAxiosError(i);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
@@ -276,7 +276,7 @@ class pr {
|
|
|
276
276
|
});
|
|
277
277
|
return this.handleResponse(s);
|
|
278
278
|
} catch (i) {
|
|
279
|
-
throw
|
|
279
|
+
throw ut.handleAxiosError(i);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
@@ -285,7 +285,7 @@ class pr {
|
|
|
285
285
|
handleResponse(t) {
|
|
286
286
|
const n = t.data;
|
|
287
287
|
if (!n.success && n.error)
|
|
288
|
-
throw
|
|
288
|
+
throw ut.handleApiError(n.error);
|
|
289
289
|
return n;
|
|
290
290
|
}
|
|
291
291
|
/**
|
|
@@ -295,7 +295,7 @@ class pr {
|
|
|
295
295
|
return this.axiosInstance;
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
class
|
|
298
|
+
class hr {
|
|
299
299
|
constructor(t) {
|
|
300
300
|
this.httpClient = t;
|
|
301
301
|
}
|
|
@@ -414,7 +414,7 @@ class mr {
|
|
|
414
414
|
)).result;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
class
|
|
417
|
+
class fr {
|
|
418
418
|
constructor(t) {
|
|
419
419
|
this.httpClient = t;
|
|
420
420
|
}
|
|
@@ -441,7 +441,7 @@ class yr {
|
|
|
441
441
|
)).result;
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
class
|
|
444
|
+
class gr {
|
|
445
445
|
constructor(t) {
|
|
446
446
|
this.httpClient = t;
|
|
447
447
|
}
|
|
@@ -469,7 +469,7 @@ class hr {
|
|
|
469
469
|
await this.httpClient.post("UploadDocument", "ReviewUploadDocument", t);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
class
|
|
472
|
+
class br {
|
|
473
473
|
constructor(t) {
|
|
474
474
|
this.httpClient = t;
|
|
475
475
|
}
|
|
@@ -495,7 +495,7 @@ class fr {
|
|
|
495
495
|
)).result;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
class
|
|
498
|
+
class xr {
|
|
499
499
|
constructor(t) {
|
|
500
500
|
this.httpClient = t;
|
|
501
501
|
}
|
|
@@ -517,7 +517,7 @@ class gr {
|
|
|
517
517
|
await this.httpClient.get("Applicant", "PassOverview", { applicantId: t });
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
class
|
|
520
|
+
class vr {
|
|
521
521
|
constructor(t) {
|
|
522
522
|
this.httpClient = t;
|
|
523
523
|
}
|
|
@@ -552,7 +552,7 @@ class br {
|
|
|
552
552
|
)).result;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
class
|
|
555
|
+
class kr {
|
|
556
556
|
constructor(t) {
|
|
557
557
|
this.httpClient = t;
|
|
558
558
|
}
|
|
@@ -620,7 +620,7 @@ class xr {
|
|
|
620
620
|
return console.log("[IdentityService] Sumsub token refresh result:", n), n.result.accessToken;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
class
|
|
623
|
+
class wr {
|
|
624
624
|
constructor(t) {
|
|
625
625
|
this.httpClient = t;
|
|
626
626
|
}
|
|
@@ -656,7 +656,7 @@ class vr {
|
|
|
656
656
|
)).result;
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
class
|
|
659
|
+
class Sr {
|
|
660
660
|
constructor(t) {
|
|
661
661
|
this.httpClient = t;
|
|
662
662
|
}
|
|
@@ -741,7 +741,7 @@ const Le = {
|
|
|
741
741
|
textMuted: "#9ca3af"
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
|
-
},
|
|
744
|
+
}, Cr = {
|
|
745
745
|
name: "Corporate",
|
|
746
746
|
logo: {
|
|
747
747
|
url: "",
|
|
@@ -774,7 +774,7 @@ const Le = {
|
|
|
774
774
|
cardPadding: "1.5rem",
|
|
775
775
|
inputHeight: "2.5rem"
|
|
776
776
|
}
|
|
777
|
-
},
|
|
777
|
+
}, Nr = {
|
|
778
778
|
name: "Fintech",
|
|
779
779
|
logo: {
|
|
780
780
|
url: "",
|
|
@@ -807,7 +807,7 @@ const Le = {
|
|
|
807
807
|
cardPadding: "2rem",
|
|
808
808
|
inputHeight: "3rem"
|
|
809
809
|
}
|
|
810
|
-
},
|
|
810
|
+
}, Ir = {
|
|
811
811
|
name: "Healthcare",
|
|
812
812
|
logo: {
|
|
813
813
|
url: "",
|
|
@@ -849,7 +849,7 @@ const Le = {
|
|
|
849
849
|
textSecondary: "#CBD5E1"
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
|
-
},
|
|
852
|
+
}, Rr = {
|
|
853
853
|
name: "Modern",
|
|
854
854
|
logo: {
|
|
855
855
|
url: "",
|
|
@@ -882,7 +882,7 @@ const Le = {
|
|
|
882
882
|
cardPadding: "2rem",
|
|
883
883
|
inputHeight: "3rem"
|
|
884
884
|
}
|
|
885
|
-
},
|
|
885
|
+
}, Er = {
|
|
886
886
|
name: "Minimal",
|
|
887
887
|
logo: {
|
|
888
888
|
url: "",
|
|
@@ -915,18 +915,18 @@ const Le = {
|
|
|
915
915
|
cardPadding: "1.25rem",
|
|
916
916
|
inputHeight: "2.25rem"
|
|
917
917
|
}
|
|
918
|
-
},
|
|
918
|
+
}, Fr = {
|
|
919
919
|
[Fe.Default]: Le,
|
|
920
|
-
[Fe.Corporate]:
|
|
921
|
-
[Fe.Fintech]:
|
|
922
|
-
[Fe.Healthcare]:
|
|
923
|
-
[Fe.Modern]:
|
|
924
|
-
[Fe.Minimal]:
|
|
920
|
+
[Fe.Corporate]: Cr,
|
|
921
|
+
[Fe.Fintech]: Nr,
|
|
922
|
+
[Fe.Healthcare]: Ir,
|
|
923
|
+
[Fe.Modern]: Rr,
|
|
924
|
+
[Fe.Minimal]: Er
|
|
925
925
|
};
|
|
926
|
-
function
|
|
927
|
-
return
|
|
926
|
+
function pt(e) {
|
|
927
|
+
return Fr[e] || Le;
|
|
928
928
|
}
|
|
929
|
-
class
|
|
929
|
+
class Ar {
|
|
930
930
|
constructor(t) {
|
|
931
931
|
this.httpClient = t;
|
|
932
932
|
}
|
|
@@ -941,8 +941,8 @@ class Er {
|
|
|
941
941
|
"GetThemeConfiguration"
|
|
942
942
|
);
|
|
943
943
|
if (!n.result.isEnabled)
|
|
944
|
-
return
|
|
945
|
-
let a = n.result.preset ?
|
|
944
|
+
return pt(Fe.Default);
|
|
945
|
+
let a = n.result.preset ? pt(n.result.preset) : pt(Fe.Default);
|
|
946
946
|
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 = {
|
|
947
947
|
colors: {
|
|
948
948
|
...(t = a.darkMode) == null ? void 0 : t.colors,
|
|
@@ -992,7 +992,7 @@ class Er {
|
|
|
992
992
|
}
|
|
993
993
|
return a;
|
|
994
994
|
} catch (n) {
|
|
995
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", n),
|
|
995
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", n), pt(Fe.Default);
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
998
|
/**
|
|
@@ -1018,7 +1018,7 @@ class Er {
|
|
|
1018
1018
|
* Preview theme (doesn't save)
|
|
1019
1019
|
*/
|
|
1020
1020
|
getPreviewTheme(t, n) {
|
|
1021
|
-
const a =
|
|
1021
|
+
const a = pt(t);
|
|
1022
1022
|
return n ? {
|
|
1023
1023
|
...a,
|
|
1024
1024
|
...n,
|
|
@@ -1029,7 +1029,7 @@ class Er {
|
|
|
1029
1029
|
} : a;
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
|
-
class
|
|
1032
|
+
class Tr {
|
|
1033
1033
|
constructor() {
|
|
1034
1034
|
he(this, "listeners", /* @__PURE__ */ new Map());
|
|
1035
1035
|
}
|
|
@@ -1074,9 +1074,9 @@ class Fr {
|
|
|
1074
1074
|
this.listeners.delete(t);
|
|
1075
1075
|
}
|
|
1076
1076
|
}
|
|
1077
|
-
class
|
|
1077
|
+
class Pr {
|
|
1078
1078
|
constructor() {
|
|
1079
|
-
he(this, "events", new
|
|
1079
|
+
he(this, "events", new Tr());
|
|
1080
1080
|
he(this, "_applicantId", null);
|
|
1081
1081
|
he(this, "_progress", null);
|
|
1082
1082
|
he(this, "_error", null);
|
|
@@ -1214,7 +1214,7 @@ class Ar {
|
|
|
1214
1214
|
this.events.clear();
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
|
-
class
|
|
1217
|
+
class Lr {
|
|
1218
1218
|
constructor() {
|
|
1219
1219
|
he(this, "handlers", /* @__PURE__ */ new Map());
|
|
1220
1220
|
}
|
|
@@ -1255,11 +1255,11 @@ class Tr {
|
|
|
1255
1255
|
return a.submitData(n);
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
1258
|
-
class
|
|
1258
|
+
class Dr {
|
|
1259
1259
|
constructor(t, n, a, i, s, c, d, y) {
|
|
1260
1260
|
he(this, "state");
|
|
1261
1261
|
he(this, "stepRouter");
|
|
1262
|
-
this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = s, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new
|
|
1262
|
+
this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = s, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new Pr(), this.stepRouter = new Lr(), this.registerStepHandlers();
|
|
1263
1263
|
}
|
|
1264
1264
|
/**
|
|
1265
1265
|
* Register all step handlers
|
|
@@ -1399,7 +1399,7 @@ class Pr {
|
|
|
1399
1399
|
return this.stepRouter;
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1402
|
+
function zt(e, t) {
|
|
1403
1403
|
return new Promise((n, a) => {
|
|
1404
1404
|
if (t && document.getElementById(t)) {
|
|
1405
1405
|
n();
|
|
@@ -1409,25 +1409,25 @@ function Mt(e, t) {
|
|
|
1409
1409
|
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);
|
|
1410
1410
|
});
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function Gn(e) {
|
|
1413
1413
|
return !!document.getElementById(e);
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function Jn(e) {
|
|
1416
1416
|
const t = document.getElementById(e);
|
|
1417
1417
|
t && t.remove();
|
|
1418
1418
|
}
|
|
1419
|
-
const
|
|
1420
|
-
function
|
|
1419
|
+
const Mr = "https://static.sumsub.com/idensic/static/sns-websdk-builder.js";
|
|
1420
|
+
function Ue(e, t) {
|
|
1421
1421
|
try {
|
|
1422
1422
|
return getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
|
|
1423
1423
|
} catch {
|
|
1424
1424
|
return t;
|
|
1425
1425
|
}
|
|
1426
1426
|
}
|
|
1427
|
-
function
|
|
1428
|
-
const e =
|
|
1427
|
+
function Or() {
|
|
1428
|
+
const e = Ue("--metakyc-primary", "#2563eb"), t = Ue("--metakyc-primary-hover", "#1d4ed8"), n = Ue("--metakyc-background", "#ffffff"), a = Ue("--metakyc-surface", "#f9fafb"), i = Ue("--metakyc-text-primary", "#111827"), s = Ue("--metakyc-text-secondary", "#6b7280"), c = Ue("--metakyc-text-muted", "#9ca3af"), d = Ue("--metakyc-border", "#e5e7eb");
|
|
1429
1429
|
return `
|
|
1430
|
-
body, html { font-family: ${
|
|
1430
|
+
body, html { font-family: ${Ue(
|
|
1431
1431
|
"--metakyc-font-family",
|
|
1432
1432
|
"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"
|
|
1433
1433
|
)} !important; background-color: ${n} !important; }
|
|
@@ -1451,7 +1451,7 @@ a { color: ${e}; }
|
|
|
1451
1451
|
a:hover { color: ${t}; }
|
|
1452
1452
|
`.trim();
|
|
1453
1453
|
}
|
|
1454
|
-
class
|
|
1454
|
+
class zr {
|
|
1455
1455
|
constructor(t) {
|
|
1456
1456
|
he(this, "sdk", null);
|
|
1457
1457
|
he(this, "config");
|
|
@@ -1460,7 +1460,7 @@ class Mr {
|
|
|
1460
1460
|
this.config = t;
|
|
1461
1461
|
}
|
|
1462
1462
|
async loadSDK() {
|
|
1463
|
-
if (!window.snsWebSdk && (await
|
|
1463
|
+
if (!window.snsWebSdk && (await zt(Mr, "sumsub-websdk"), !window.snsWebSdk))
|
|
1464
1464
|
throw new Error("Sumsub Web SDK failed to load from CDN");
|
|
1465
1465
|
}
|
|
1466
1466
|
async initialize(t) {
|
|
@@ -1470,7 +1470,7 @@ class Mr {
|
|
|
1470
1470
|
};
|
|
1471
1471
|
if (this.config.applicantEmail && (n.email = this.config.applicantEmail), this.config.applicantPhone && (n.phone = this.config.applicantPhone), this.config.theme && (n.theme = this.config.theme), this.config.customizationName && (n.customizationName = this.config.customizationName), !this.config.customizationName) {
|
|
1472
1472
|
const i = {};
|
|
1473
|
-
this.config.customCss && (i.customCss = this.config.customCss), this.config.customCssStr && (i.customCssStr = this.config.customCssStr), i.customCssStr || (i.customCssStr =
|
|
1473
|
+
this.config.customCss && (i.customCss = this.config.customCss), this.config.customCssStr && (i.customCssStr = this.config.customCssStr), i.customCssStr || (i.customCssStr = Or()), n.uiConf = i;
|
|
1474
1474
|
}
|
|
1475
1475
|
const a = window.snsWebSdk.init(
|
|
1476
1476
|
this.config.accessToken,
|
|
@@ -1508,7 +1508,7 @@ class Mr {
|
|
|
1508
1508
|
this.errorCallback = t;
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
|
-
class
|
|
1511
|
+
class $r {
|
|
1512
1512
|
constructor(t) {
|
|
1513
1513
|
he(this, "sdk", null);
|
|
1514
1514
|
he(this, "config");
|
|
@@ -1518,7 +1518,7 @@ class Or {
|
|
|
1518
1518
|
* Load Onfido SDK
|
|
1519
1519
|
*/
|
|
1520
1520
|
async loadSDK() {
|
|
1521
|
-
await
|
|
1521
|
+
await zt(
|
|
1522
1522
|
"https://sdk.onfido.com/v12.0.0/onfido.min.js",
|
|
1523
1523
|
"onfido-sdk"
|
|
1524
1524
|
);
|
|
@@ -1574,7 +1574,7 @@ class Or {
|
|
|
1574
1574
|
this.sdk && (this.sdk.tearDown(), this.sdk = null);
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
|
-
class
|
|
1577
|
+
class Br {
|
|
1578
1578
|
constructor(t) {
|
|
1579
1579
|
he(this, "sardineContext", null);
|
|
1580
1580
|
he(this, "config");
|
|
@@ -1718,18 +1718,18 @@ class zr {
|
|
|
1718
1718
|
this.sardineContext && (this.sardineContext = null);
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
|
-
class
|
|
1721
|
+
class Je {
|
|
1722
1722
|
/**
|
|
1723
1723
|
* Create a provider instance
|
|
1724
1724
|
*/
|
|
1725
1725
|
static createProvider(t, n) {
|
|
1726
1726
|
switch (t) {
|
|
1727
1727
|
case Oe.Sumsub:
|
|
1728
|
-
return new
|
|
1728
|
+
return new zr(n);
|
|
1729
1729
|
case Oe.Onfido:
|
|
1730
|
-
return new
|
|
1730
|
+
return new $r(n);
|
|
1731
1731
|
case Oe.SardinAI:
|
|
1732
|
-
return new
|
|
1732
|
+
return new Br(n);
|
|
1733
1733
|
default:
|
|
1734
1734
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
1735
1735
|
}
|
|
@@ -1773,7 +1773,7 @@ class Ge {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
}
|
|
1775
1775
|
}
|
|
1776
|
-
function
|
|
1776
|
+
function _r() {
|
|
1777
1777
|
return `
|
|
1778
1778
|
/* ── metakyc-input-colors (ThemeManager failsafe — same rules as globals.css) ── */
|
|
1779
1779
|
.metakyc-sdk input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
|
|
@@ -1807,7 +1807,7 @@ function $r() {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
`;
|
|
1809
1809
|
}
|
|
1810
|
-
class
|
|
1810
|
+
class jr {
|
|
1811
1811
|
constructor(t) {
|
|
1812
1812
|
he(this, "currentTheme", Le);
|
|
1813
1813
|
he(this, "customStyleElement", null);
|
|
@@ -1890,7 +1890,7 @@ class Br {
|
|
|
1890
1890
|
* These rules are placed BEFORE any custom CSS so that custom CSS can still override them.
|
|
1891
1891
|
*/
|
|
1892
1892
|
injectInputColors() {
|
|
1893
|
-
this.inputStyleElement && this.inputStyleElement.remove(), this.inputStyleElement = document.createElement("style"), this.inputStyleElement.id = "metakyc-input-colors", this.inputStyleElement.textContent =
|
|
1893
|
+
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);
|
|
1894
1894
|
}
|
|
1895
1895
|
/**
|
|
1896
1896
|
* Inject custom CSS into document
|
|
@@ -1955,9 +1955,30 @@ class Br {
|
|
|
1955
1955
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1956
1956
|
}
|
|
1957
1957
|
}
|
|
1958
|
-
const
|
|
1959
|
-
|
|
1960
|
-
|
|
1958
|
+
const $t = Qt(null), Hr = "1.0.6", Ft = "metakyc-critical-css", Wr = `
|
|
1959
|
+
.metakyc-sdk{background-color:var(--metakyc-background,#fff)!important;color:var(--metakyc-text-primary,#111827)!important;color-scheme:light!important;line-height:1.5;-webkit-text-size-adjust:100%}
|
|
1960
|
+
.metakyc-sdk *,.metakyc-sdk *::before,.metakyc-sdk *::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--metakyc-border,#e5e7eb)}
|
|
1961
|
+
.metakyc-sdk .metakyc-card{background-color:var(--metakyc-surface,#fff)!important}
|
|
1962
|
+
.metakyc-sdk h1,.metakyc-sdk h2,.metakyc-sdk h3,.metakyc-sdk h4,.metakyc-sdk h5,.metakyc-sdk h6{color:var(--metakyc-text-primary,#111827)!important;margin:0}
|
|
1963
|
+
.metakyc-sdk p{margin:0}
|
|
1964
|
+
.metakyc-sdk input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),.metakyc-sdk select,.metakyc-sdk textarea,.metakyc-sdk .metakyc-searchable-select-trigger,.metakyc-sdk .metakyc-multiselect-trigger{background-color:var(--metakyc-input-bg,var(--metakyc-background,#fff))!important;color:var(--metakyc-input-text,var(--metakyc-text-primary,#111827))!important;border-color:var(--metakyc-input-border,var(--metakyc-border,#d1d5db))!important}
|
|
1965
|
+
.metakyc-sdk button,.metakyc-sdk input,.metakyc-sdk select,.metakyc-sdk textarea{font-family:inherit;font-size:100%;line-height:inherit;color:inherit;margin:0;padding:0}
|
|
1966
|
+
.metakyc-sdk label{color:inherit}
|
|
1967
|
+
`;
|
|
1968
|
+
let xt = !1;
|
|
1969
|
+
function Ur() {
|
|
1970
|
+
if (xt || typeof document > "u") return;
|
|
1971
|
+
if (document.getElementById(Ft)) {
|
|
1972
|
+
xt = !0;
|
|
1973
|
+
return;
|
|
1974
|
+
}
|
|
1975
|
+
const e = document.createElement("style");
|
|
1976
|
+
e.id = Ft, e.textContent = Wr, document.head.insertBefore(e, document.head.firstChild), xt = !0;
|
|
1977
|
+
}
|
|
1978
|
+
const Zn = ({ config: e, children: t }) => {
|
|
1979
|
+
Ur();
|
|
1980
|
+
const [n, a] = k(null), i = ke.useRef(!1), s = ke.useRef(!1), c = De(() => {
|
|
1981
|
+
const y = new yr(e), p = new hr(y), b = new fr(y), P = new gr(y), v = new br(y), A = new xr(y), T = new vr(y), w = new kr(y), N = new wr(y), z = new Sr(y), Q = new Ar(y), M = new jr();
|
|
1961
1982
|
return {
|
|
1962
1983
|
httpClient: y,
|
|
1963
1984
|
applicantService: p,
|
|
@@ -1976,7 +1997,7 @@ const Ot = Vt(null), _r = "1.0.4", qn = ({ config: e, children: t }) => {
|
|
|
1976
1997
|
config: e,
|
|
1977
1998
|
...c,
|
|
1978
1999
|
currentTheme: n,
|
|
1979
|
-
createOrchestrator: () => new
|
|
2000
|
+
createOrchestrator: () => new Dr(
|
|
1980
2001
|
c.applicantService,
|
|
1981
2002
|
c.questionnaireService,
|
|
1982
2003
|
c.uploadDocumentService,
|
|
@@ -2008,7 +2029,7 @@ const Ot = Vt(null), _r = "1.0.4", qn = ({ config: e, children: t }) => {
|
|
|
2008
2029
|
}
|
|
2009
2030
|
})(), () => {
|
|
2010
2031
|
c.themeManager.cleanup();
|
|
2011
|
-
}), []), /* @__PURE__ */ o(
|
|
2032
|
+
}), []), /* @__PURE__ */ o($t.Provider, { value: d, children: [
|
|
2012
2033
|
e.showVersion && /* @__PURE__ */ o(
|
|
2013
2034
|
"div",
|
|
2014
2035
|
{
|
|
@@ -2025,7 +2046,7 @@ const Ot = Vt(null), _r = "1.0.4", qn = ({ config: e, children: t }) => {
|
|
|
2025
2046
|
},
|
|
2026
2047
|
children: [
|
|
2027
2048
|
"SDK v",
|
|
2028
|
-
|
|
2049
|
+
Hr
|
|
2029
2050
|
]
|
|
2030
2051
|
}
|
|
2031
2052
|
),
|
|
@@ -2033,12 +2054,12 @@ const Ot = Vt(null), _r = "1.0.4", qn = ({ config: e, children: t }) => {
|
|
|
2033
2054
|
] });
|
|
2034
2055
|
};
|
|
2035
2056
|
function Te() {
|
|
2036
|
-
const e =
|
|
2057
|
+
const e = Gt($t);
|
|
2037
2058
|
if (!e)
|
|
2038
2059
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
2039
2060
|
return e;
|
|
2040
2061
|
}
|
|
2041
|
-
async function
|
|
2062
|
+
async function Kr(e) {
|
|
2042
2063
|
return new Promise((t, n) => {
|
|
2043
2064
|
const a = new FileReader();
|
|
2044
2065
|
a.readAsDataURL(e), a.onload = () => {
|
|
@@ -2047,10 +2068,10 @@ async function Hr(e) {
|
|
|
2047
2068
|
}, a.onerror = (i) => n(i);
|
|
2048
2069
|
});
|
|
2049
2070
|
}
|
|
2050
|
-
function
|
|
2071
|
+
function Xn(e, t) {
|
|
2051
2072
|
return e.size <= t;
|
|
2052
2073
|
}
|
|
2053
|
-
function
|
|
2074
|
+
function ea(e, t) {
|
|
2054
2075
|
return t.split(",").map((a) => a.trim()).some((a) => {
|
|
2055
2076
|
if (a.endsWith("/*")) {
|
|
2056
2077
|
const i = a.slice(0, -2);
|
|
@@ -2059,75 +2080,75 @@ function Yn(e, t) {
|
|
|
2059
2080
|
return e.type === a;
|
|
2060
2081
|
});
|
|
2061
2082
|
}
|
|
2062
|
-
function
|
|
2083
|
+
function vt(e) {
|
|
2063
2084
|
if (e === 0) return "0 Bytes";
|
|
2064
2085
|
const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
|
2065
2086
|
return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
|
|
2066
2087
|
}
|
|
2067
|
-
function
|
|
2088
|
+
function ta(e) {
|
|
2068
2089
|
return e;
|
|
2069
2090
|
}
|
|
2070
2091
|
function Ae(...e) {
|
|
2071
2092
|
return e.filter(Boolean).join(" ");
|
|
2072
2093
|
}
|
|
2073
|
-
const
|
|
2094
|
+
const dt = {
|
|
2074
2095
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
2075
2096
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
2076
2097
|
};
|
|
2077
|
-
function
|
|
2098
|
+
function qr(e) {
|
|
2078
2099
|
try {
|
|
2079
|
-
localStorage.setItem(
|
|
2100
|
+
localStorage.setItem(dt.APPLICANT_ID, e.toString());
|
|
2080
2101
|
} catch (t) {
|
|
2081
2102
|
console.warn("Failed to save applicant ID to storage:", t);
|
|
2082
2103
|
}
|
|
2083
2104
|
}
|
|
2084
|
-
function
|
|
2105
|
+
function Vr() {
|
|
2085
2106
|
try {
|
|
2086
|
-
const e = localStorage.getItem(
|
|
2107
|
+
const e = localStorage.getItem(dt.APPLICANT_ID);
|
|
2087
2108
|
return e ? parseInt(e, 10) : null;
|
|
2088
2109
|
} catch (e) {
|
|
2089
2110
|
return console.warn("Failed to retrieve applicant ID from storage:", e), null;
|
|
2090
2111
|
}
|
|
2091
2112
|
}
|
|
2092
|
-
function
|
|
2113
|
+
function Yr() {
|
|
2093
2114
|
try {
|
|
2094
|
-
localStorage.removeItem(
|
|
2115
|
+
localStorage.removeItem(dt.APPLICANT_ID);
|
|
2095
2116
|
} catch (e) {
|
|
2096
2117
|
console.warn("Failed to clear applicant ID from storage:", e);
|
|
2097
2118
|
}
|
|
2098
2119
|
}
|
|
2099
|
-
function
|
|
2120
|
+
function Qr(e) {
|
|
2100
2121
|
try {
|
|
2101
|
-
localStorage.setItem(
|
|
2122
|
+
localStorage.setItem(dt.WORKFLOW_STATE, JSON.stringify(e));
|
|
2102
2123
|
} catch (t) {
|
|
2103
2124
|
console.warn("Failed to save workflow state to storage:", t);
|
|
2104
2125
|
}
|
|
2105
2126
|
}
|
|
2106
|
-
function
|
|
2127
|
+
function ra() {
|
|
2107
2128
|
try {
|
|
2108
|
-
const e = localStorage.getItem(
|
|
2129
|
+
const e = localStorage.getItem(dt.WORKFLOW_STATE);
|
|
2109
2130
|
return e ? JSON.parse(e) : null;
|
|
2110
2131
|
} catch (e) {
|
|
2111
2132
|
return console.warn("Failed to retrieve workflow state from storage:", e), null;
|
|
2112
2133
|
}
|
|
2113
2134
|
}
|
|
2114
|
-
function
|
|
2135
|
+
function Gr() {
|
|
2115
2136
|
try {
|
|
2116
|
-
localStorage.removeItem(
|
|
2137
|
+
localStorage.removeItem(dt.WORKFLOW_STATE);
|
|
2117
2138
|
} catch (e) {
|
|
2118
2139
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
2119
2140
|
}
|
|
2120
2141
|
}
|
|
2121
|
-
function
|
|
2122
|
-
|
|
2142
|
+
function na() {
|
|
2143
|
+
Yr(), Gr();
|
|
2123
2144
|
}
|
|
2124
|
-
function
|
|
2125
|
-
const { createOrchestrator: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(null), y = de(null), p = e ||
|
|
2145
|
+
function Jr(e) {
|
|
2146
|
+
const { createOrchestrator: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(null), y = de(null), p = e || Vr();
|
|
2126
2147
|
ge(() => {
|
|
2127
2148
|
y.current || (y.current = t());
|
|
2128
2149
|
}, [t]), ge(() => {
|
|
2129
2150
|
var M;
|
|
2130
|
-
n && p && (
|
|
2151
|
+
n && p && (qr(p), Qr({
|
|
2131
2152
|
applicantId: p,
|
|
2132
2153
|
currentStepOrder: (M = n.currentStep) == null ? void 0 : M.order,
|
|
2133
2154
|
status: n.status,
|
|
@@ -2201,15 +2222,15 @@ function Vr(e) {
|
|
|
2201
2222
|
s(!0), d(null);
|
|
2202
2223
|
try {
|
|
2203
2224
|
await y.current.submitCurrentStep(M);
|
|
2204
|
-
const
|
|
2205
|
-
a(
|
|
2206
|
-
} catch (
|
|
2207
|
-
throw d(
|
|
2225
|
+
const j = await y.current.refreshProgress();
|
|
2226
|
+
a(j);
|
|
2227
|
+
} catch (j) {
|
|
2228
|
+
throw d(j), j;
|
|
2208
2229
|
} finally {
|
|
2209
2230
|
s(!1);
|
|
2210
2231
|
}
|
|
2211
2232
|
}
|
|
2212
|
-
}, []), z =
|
|
2233
|
+
}, []), 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]);
|
|
2213
2234
|
return {
|
|
2214
2235
|
progress: n,
|
|
2215
2236
|
applicantId: p,
|
|
@@ -2231,7 +2252,7 @@ function Vr(e) {
|
|
|
2231
2252
|
orchestrator: y.current
|
|
2232
2253
|
};
|
|
2233
2254
|
}
|
|
2234
|
-
function
|
|
2255
|
+
function Zr(e) {
|
|
2235
2256
|
const { questionnaireService: t, applicantService: n } = Te(), [a, i] = k(null), [s, c] = k({}), [d, y] = k(!1), [p, b] = k(!1), [P, v] = k(null), A = de(!1), T = de(null), w = ae(async () => {
|
|
2236
2257
|
var z, Q;
|
|
2237
2258
|
if (e) {
|
|
@@ -2241,13 +2262,13 @@ function Yr(e) {
|
|
|
2241
2262
|
}
|
|
2242
2263
|
A.current = !0, y(!0), v(null);
|
|
2243
2264
|
try {
|
|
2244
|
-
const [M,
|
|
2265
|
+
const [M, j] = await Promise.all([
|
|
2245
2266
|
t.getQuestionnaire(e),
|
|
2246
2267
|
n.getApplicantData(e).catch(() => null)
|
|
2247
2268
|
]);
|
|
2248
|
-
if (i(M), (z =
|
|
2269
|
+
if (i(M), (z = j == null ? void 0 : j.questionnaireResults) != null && z.length && M) {
|
|
2249
2270
|
const K = /* @__PURE__ */ new Map();
|
|
2250
|
-
for (const g of
|
|
2271
|
+
for (const g of j.questionnaireResults)
|
|
2251
2272
|
g.question && ((Q = g.answers) != null && Q.length) && K.set(g.question.trim().toLowerCase(), g.answers);
|
|
2252
2273
|
const ee = {}, E = M.questionGroups.flatMap((g) => g.questions ?? []);
|
|
2253
2274
|
for (const g of E) {
|
|
@@ -2290,7 +2311,7 @@ function Yr(e) {
|
|
|
2290
2311
|
submit: N
|
|
2291
2312
|
};
|
|
2292
2313
|
}
|
|
2293
|
-
function
|
|
2314
|
+
function Xr(e) {
|
|
2294
2315
|
const { uploadDocumentService: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(!1), [y, p] = k(0), [b, P] = k(null), v = de(!1), A = de(null), T = ae(async () => {
|
|
2295
2316
|
if (e) {
|
|
2296
2317
|
if (v.current) {
|
|
@@ -2334,7 +2355,7 @@ function Qr(e) {
|
|
|
2334
2355
|
submit: w
|
|
2335
2356
|
};
|
|
2336
2357
|
}
|
|
2337
|
-
function
|
|
2358
|
+
function aa(e) {
|
|
2338
2359
|
const { appropriatenessTestService: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(!1), [y, p] = k(null), [b, P] = k(null), v = de(!1), A = de(null), T = ae(async () => {
|
|
2339
2360
|
if (e) {
|
|
2340
2361
|
if (v.current) {
|
|
@@ -2379,7 +2400,7 @@ function Zn(e) {
|
|
|
2379
2400
|
submit: w
|
|
2380
2401
|
};
|
|
2381
2402
|
}
|
|
2382
|
-
function
|
|
2403
|
+
function en(e) {
|
|
2383
2404
|
const { overviewService: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(!1), [y, p] = k(null), b = de(!1), P = de(null), v = ae(async () => {
|
|
2384
2405
|
if (e) {
|
|
2385
2406
|
if (b.current) {
|
|
@@ -2421,7 +2442,7 @@ function Gr(e) {
|
|
|
2421
2442
|
passOverview: A
|
|
2422
2443
|
};
|
|
2423
2444
|
}
|
|
2424
|
-
function
|
|
2445
|
+
function tn(e) {
|
|
2425
2446
|
const { identityService: t } = Te(), [n, a] = k(
|
|
2426
2447
|
null
|
|
2427
2448
|
), [i, s] = k(!1), [c, d] = k(null), y = de(!1), p = ae(
|
|
@@ -2507,7 +2528,7 @@ function Jr(e) {
|
|
|
2507
2528
|
restartIdentity: P
|
|
2508
2529
|
};
|
|
2509
2530
|
}
|
|
2510
|
-
function
|
|
2531
|
+
function rn(e) {
|
|
2511
2532
|
const { riskScoringService: t, applicantService: n } = Te(), [a, i] = k(null), [s, c] = k({}), [d, y] = k(!1), [p, b] = k(!1), [P, v] = k(null), [A, T] = k(null), w = de(!1), N = de(null), z = ae(async () => {
|
|
2512
2533
|
var M;
|
|
2513
2534
|
if (e) {
|
|
@@ -2517,11 +2538,11 @@ function Zr(e) {
|
|
|
2517
2538
|
}
|
|
2518
2539
|
w.current = !0, y(!0), v(null);
|
|
2519
2540
|
try {
|
|
2520
|
-
const [
|
|
2541
|
+
const [j, K] = await Promise.all([
|
|
2521
2542
|
t.getRiskCriterias(e),
|
|
2522
2543
|
n.getApplicantData(e).catch(() => null)
|
|
2523
2544
|
]);
|
|
2524
|
-
if (i(
|
|
2545
|
+
if (i(j), (M = K == null ? void 0 : K.riskScoringResults) != null && M.length) {
|
|
2525
2546
|
const ee = K.riskScoringResults[0], E = {};
|
|
2526
2547
|
for (const g of ee.riskCriteriaResults ?? [])
|
|
2527
2548
|
if (g.riskCriteriaId != null && g.answer != null && g.answer !== "") {
|
|
@@ -2533,8 +2554,8 @@ function Zr(e) {
|
|
|
2533
2554
|
c(E);
|
|
2534
2555
|
}
|
|
2535
2556
|
N.current = e;
|
|
2536
|
-
} catch (
|
|
2537
|
-
v(
|
|
2557
|
+
} catch (j) {
|
|
2558
|
+
v(j);
|
|
2538
2559
|
} finally {
|
|
2539
2560
|
y(!1), w.current = !1;
|
|
2540
2561
|
}
|
|
@@ -2547,10 +2568,10 @@ function Zr(e) {
|
|
|
2547
2568
|
async (M) => {
|
|
2548
2569
|
b(!0), v(null);
|
|
2549
2570
|
try {
|
|
2550
|
-
const
|
|
2551
|
-
return T(
|
|
2552
|
-
} catch (
|
|
2553
|
-
throw v(
|
|
2571
|
+
const j = await t.submitRiskScoring(M);
|
|
2572
|
+
return T(j), j;
|
|
2573
|
+
} catch (j) {
|
|
2574
|
+
throw v(j), j;
|
|
2554
2575
|
} finally {
|
|
2555
2576
|
b(!1);
|
|
2556
2577
|
}
|
|
@@ -2568,7 +2589,7 @@ function Zr(e) {
|
|
|
2568
2589
|
submit: Q
|
|
2569
2590
|
};
|
|
2570
2591
|
}
|
|
2571
|
-
function
|
|
2592
|
+
function Bt() {
|
|
2572
2593
|
const { applicantService: e, config: t } = Te(), [n, a] = k(!1), [i, s] = k(null), c = de(!1), d = de(!1), y = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(A) {
|
|
2573
2594
|
const T = Math.random() * 16 | 0;
|
|
2574
2595
|
return (A === "x" ? T : T & 3 | 8).toString(16);
|
|
@@ -2642,7 +2663,7 @@ function zt() {
|
|
|
2642
2663
|
stopProgress: v
|
|
2643
2664
|
};
|
|
2644
2665
|
}
|
|
2645
|
-
const
|
|
2666
|
+
const nn = {
|
|
2646
2667
|
primary: {
|
|
2647
2668
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
2648
2669
|
color: "#ffffff",
|
|
@@ -2703,7 +2724,7 @@ const Xr = {
|
|
|
2703
2724
|
opacity: i || a ? 0.5 : 1,
|
|
2704
2725
|
lineHeight: "1.25rem",
|
|
2705
2726
|
...b[n],
|
|
2706
|
-
...
|
|
2727
|
+
...nn[t],
|
|
2707
2728
|
...c
|
|
2708
2729
|
},
|
|
2709
2730
|
disabled: i || a,
|
|
@@ -2840,7 +2861,70 @@ const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
|
2840
2861
|
...a,
|
|
2841
2862
|
children: e
|
|
2842
2863
|
}
|
|
2843
|
-
),
|
|
2864
|
+
), an = {
|
|
2865
|
+
display: "inline-flex",
|
|
2866
|
+
alignItems: "center",
|
|
2867
|
+
justifyContent: "center",
|
|
2868
|
+
width: 16,
|
|
2869
|
+
height: 16,
|
|
2870
|
+
minWidth: 16,
|
|
2871
|
+
minHeight: 16,
|
|
2872
|
+
maxWidth: 16,
|
|
2873
|
+
maxHeight: 16,
|
|
2874
|
+
borderRadius: 4,
|
|
2875
|
+
borderWidth: "1.5px",
|
|
2876
|
+
borderStyle: "solid",
|
|
2877
|
+
cursor: "pointer",
|
|
2878
|
+
flexShrink: 0,
|
|
2879
|
+
position: "relative",
|
|
2880
|
+
transition: "background-color 0.15s, border-color 0.15s",
|
|
2881
|
+
boxSizing: "border-box",
|
|
2882
|
+
padding: 0,
|
|
2883
|
+
margin: 0,
|
|
2884
|
+
verticalAlign: "middle"
|
|
2885
|
+
}, Be = ({ checked: e, onChange: t, disabled: n, style: a }) => {
|
|
2886
|
+
const i = "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))", s = "var(--metakyc-input-bg, var(--metakyc-background, #ffffff))", c = "var(--metakyc-primary, #2563eb)";
|
|
2887
|
+
return /* @__PURE__ */ r(
|
|
2888
|
+
"span",
|
|
2889
|
+
{
|
|
2890
|
+
role: "checkbox",
|
|
2891
|
+
"aria-checked": e,
|
|
2892
|
+
tabIndex: 0,
|
|
2893
|
+
onClick: () => !n && t(!e),
|
|
2894
|
+
onKeyDown: (d) => {
|
|
2895
|
+
(d.key === " " || d.key === "Enter") && (d.preventDefault(), n || t(!e));
|
|
2896
|
+
},
|
|
2897
|
+
style: {
|
|
2898
|
+
...an,
|
|
2899
|
+
backgroundColor: e ? c : s,
|
|
2900
|
+
borderColor: e ? c : i,
|
|
2901
|
+
opacity: n ? 0.5 : 1,
|
|
2902
|
+
cursor: n ? "not-allowed" : "pointer",
|
|
2903
|
+
...a
|
|
2904
|
+
},
|
|
2905
|
+
children: e && /* @__PURE__ */ r(
|
|
2906
|
+
"svg",
|
|
2907
|
+
{
|
|
2908
|
+
width: "10",
|
|
2909
|
+
height: "8",
|
|
2910
|
+
viewBox: "0 0 10 8",
|
|
2911
|
+
fill: "none",
|
|
2912
|
+
style: { display: "block", flexShrink: 0 },
|
|
2913
|
+
children: /* @__PURE__ */ r(
|
|
2914
|
+
"path",
|
|
2915
|
+
{
|
|
2916
|
+
d: "M1 4L3.5 6.5L9 1",
|
|
2917
|
+
stroke: "#ffffff",
|
|
2918
|
+
strokeWidth: "2",
|
|
2919
|
+
strokeLinecap: "round",
|
|
2920
|
+
strokeLinejoin: "round"
|
|
2921
|
+
}
|
|
2922
|
+
)
|
|
2923
|
+
}
|
|
2924
|
+
)
|
|
2925
|
+
}
|
|
2926
|
+
);
|
|
2927
|
+
}, on = {
|
|
2844
2928
|
// Theme-aware variants
|
|
2845
2929
|
default: {
|
|
2846
2930
|
backgroundColor: "var(--metakyc-surface, #f3f4f6)",
|
|
@@ -2863,14 +2947,14 @@ const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
|
2863
2947
|
backgroundColor: "#fef3c7",
|
|
2864
2948
|
color: "#92400e"
|
|
2865
2949
|
}
|
|
2866
|
-
},
|
|
2950
|
+
}, _t = ({ children: e, variant: t = "default", className: n, style: a, ...i }) => /* @__PURE__ */ r(
|
|
2867
2951
|
"span",
|
|
2868
2952
|
{
|
|
2869
2953
|
className: Ae(
|
|
2870
2954
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2871
2955
|
n
|
|
2872
2956
|
),
|
|
2873
|
-
style: { ...
|
|
2957
|
+
style: { ...on[t], ...a },
|
|
2874
2958
|
...i,
|
|
2875
2959
|
children: e
|
|
2876
2960
|
}
|
|
@@ -2910,7 +2994,7 @@ const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
|
2910
2994
|
]
|
|
2911
2995
|
}
|
|
2912
2996
|
) });
|
|
2913
|
-
},
|
|
2997
|
+
}, Nt = yt(
|
|
2914
2998
|
({ label: e, error: t, helperText: n, options: a, placeholder: i, className: s, style: c, ...d }, y) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2915
2999
|
e && /* @__PURE__ */ o(
|
|
2916
3000
|
"label",
|
|
@@ -2976,8 +3060,8 @@ const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
|
2976
3060
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
2977
3061
|
] })
|
|
2978
3062
|
);
|
|
2979
|
-
|
|
2980
|
-
const
|
|
3063
|
+
Nt.displayName = "Select";
|
|
3064
|
+
const At = 280, sn = ({
|
|
2981
3065
|
label: e,
|
|
2982
3066
|
value: t,
|
|
2983
3067
|
onChange: n,
|
|
@@ -2995,12 +3079,12 @@ const Et = 280, tn = ({
|
|
|
2995
3079
|
primaryColor: "#2563eb",
|
|
2996
3080
|
primaryLight: "#eff6ff",
|
|
2997
3081
|
hoverBg: "#f9fafb"
|
|
2998
|
-
}), z = de(null), Q = de(null), M = de(null),
|
|
3082
|
+
}), z = de(null), Q = de(null), M = de(null), j = ae(() => {
|
|
2999
3083
|
if (!Q.current) return null;
|
|
3000
|
-
const F = Q.current.getBoundingClientRect(), B = window.innerHeight - F.bottom <
|
|
3084
|
+
const F = Q.current.getBoundingClientRect(), B = window.innerHeight - F.bottom < At && F.top > At;
|
|
3001
3085
|
return { top: B ? F.top : F.bottom + 4, left: F.left, width: F.width, openUp: B };
|
|
3002
3086
|
}, []), K = ae(() => {
|
|
3003
|
-
const F = getComputedStyle(document.documentElement), U = (
|
|
3087
|
+
const F = getComputedStyle(document.documentElement), U = (H, fe) => F.getPropertyValue(H).trim() || fe, B = U("--metakyc-input-bg", U("--metakyc-background", "#ffffff"));
|
|
3004
3088
|
N({
|
|
3005
3089
|
bg: B,
|
|
3006
3090
|
borderColor: U("--metakyc-input-border", U("--metakyc-border", "#d1d5db")),
|
|
@@ -3013,29 +3097,29 @@ const Et = 280, tn = ({
|
|
|
3013
3097
|
}, []), ee = ae(() => {
|
|
3014
3098
|
if (y) return;
|
|
3015
3099
|
K();
|
|
3016
|
-
const F =
|
|
3100
|
+
const F = j();
|
|
3017
3101
|
F && T(F), b(!0);
|
|
3018
|
-
}, [y,
|
|
3102
|
+
}, [y, j, K]), E = ae(() => {
|
|
3019
3103
|
b(!1), v("");
|
|
3020
3104
|
}, []);
|
|
3021
3105
|
ge(() => {
|
|
3022
3106
|
if (!p) return;
|
|
3023
3107
|
const F = (U) => {
|
|
3024
|
-
var
|
|
3108
|
+
var H, fe;
|
|
3025
3109
|
const B = U.target;
|
|
3026
|
-
!((
|
|
3110
|
+
!((H = z.current) != null && H.contains(B)) && !((fe = M.current) != null && fe.contains(B)) && E();
|
|
3027
3111
|
};
|
|
3028
3112
|
return document.addEventListener("mousedown", F), () => document.removeEventListener("mousedown", F);
|
|
3029
3113
|
}, [p, E]), ge(() => {
|
|
3030
3114
|
if (!p) return;
|
|
3031
3115
|
const F = () => {
|
|
3032
|
-
const U =
|
|
3116
|
+
const U = j();
|
|
3033
3117
|
U && T(U);
|
|
3034
3118
|
};
|
|
3035
3119
|
return window.addEventListener("scroll", F, !0), window.addEventListener("resize", F), () => {
|
|
3036
3120
|
window.removeEventListener("scroll", F, !0), window.removeEventListener("resize", F);
|
|
3037
3121
|
};
|
|
3038
|
-
}, [p,
|
|
3122
|
+
}, [p, j]);
|
|
3039
3123
|
const g = a.filter(
|
|
3040
3124
|
(F) => F.label.toLowerCase().includes(P.toLowerCase())
|
|
3041
3125
|
), $ = (F) => {
|
|
@@ -3045,7 +3129,7 @@ const Et = 280, tn = ({
|
|
|
3045
3129
|
}, G = (F) => {
|
|
3046
3130
|
var U;
|
|
3047
3131
|
return ((U = a.find((B) => B.value === F)) == null ? void 0 : U.label) || F;
|
|
3048
|
-
}, { bg: _, borderColor: J, textPrimary: ie, textSecondary: Y, primaryColor:
|
|
3132
|
+
}, { bg: _, borderColor: J, textPrimary: ie, textSecondary: Y, primaryColor: we, primaryLight: pe, hoverBg: me } = w, ve = p && A && /* @__PURE__ */ o(
|
|
3049
3133
|
"div",
|
|
3050
3134
|
{
|
|
3051
3135
|
ref: M,
|
|
@@ -3110,7 +3194,7 @@ const Et = 280, tn = ({
|
|
|
3110
3194
|
fontSize: "13px",
|
|
3111
3195
|
cursor: "pointer",
|
|
3112
3196
|
backgroundColor: U ? pe : "transparent",
|
|
3113
|
-
color: U ?
|
|
3197
|
+
color: U ? we : ie,
|
|
3114
3198
|
userSelect: "none"
|
|
3115
3199
|
},
|
|
3116
3200
|
onMouseEnter: (B) => {
|
|
@@ -3121,12 +3205,11 @@ const Et = 280, tn = ({
|
|
|
3121
3205
|
},
|
|
3122
3206
|
children: [
|
|
3123
3207
|
/* @__PURE__ */ r(
|
|
3124
|
-
|
|
3208
|
+
Be,
|
|
3125
3209
|
{
|
|
3126
|
-
type: "checkbox",
|
|
3127
3210
|
checked: U,
|
|
3128
|
-
|
|
3129
|
-
|
|
3211
|
+
onChange: () => {
|
|
3212
|
+
}
|
|
3130
3213
|
}
|
|
3131
3214
|
),
|
|
3132
3215
|
/* @__PURE__ */ r("span", { children: F.label })
|
|
@@ -3243,9 +3326,9 @@ const Et = 280, tn = ({
|
|
|
3243
3326
|
]
|
|
3244
3327
|
}
|
|
3245
3328
|
),
|
|
3246
|
-
typeof document < "u" &&
|
|
3329
|
+
typeof document < "u" && ve ? Ct(ve, document.body) : null
|
|
3247
3330
|
] });
|
|
3248
|
-
},
|
|
3331
|
+
}, Tt = 260, Ve = ({
|
|
3249
3332
|
label: e,
|
|
3250
3333
|
error: t,
|
|
3251
3334
|
helperText: n,
|
|
@@ -3267,7 +3350,7 @@ const Et = 280, tn = ({
|
|
|
3267
3350
|
primary: "#2563eb",
|
|
3268
3351
|
primaryLight: "#eff6ff",
|
|
3269
3352
|
hoverBg: "#f9fafb"
|
|
3270
|
-
}),
|
|
3353
|
+
}), j = ae(() => {
|
|
3271
3354
|
const R = getComputedStyle(document.documentElement), te = (oe, Ne) => R.getPropertyValue(oe).trim() || Ne, ye = te("--metakyc-input-bg", te("--metakyc-background", "#ffffff"));
|
|
3272
3355
|
M({
|
|
3273
3356
|
bg: ye,
|
|
@@ -3280,7 +3363,7 @@ const Et = 280, tn = ({
|
|
|
3280
3363
|
});
|
|
3281
3364
|
}, []), K = de(null), ee = de(null), E = de(null), g = de(null), $ = ae(() => {
|
|
3282
3365
|
if (!ee.current) return null;
|
|
3283
|
-
const R = ee.current.getBoundingClientRect(), ye = window.innerHeight - R.bottom <
|
|
3366
|
+
const R = ee.current.getBoundingClientRect(), ye = window.innerHeight - R.bottom < Tt && R.top > Tt;
|
|
3284
3367
|
return {
|
|
3285
3368
|
top: ye ? R.top : R.bottom + 4,
|
|
3286
3369
|
left: R.left,
|
|
@@ -3289,10 +3372,10 @@ const Et = 280, tn = ({
|
|
|
3289
3372
|
};
|
|
3290
3373
|
}, []), V = ae(() => {
|
|
3291
3374
|
if (P) return;
|
|
3292
|
-
|
|
3375
|
+
j();
|
|
3293
3376
|
const R = $();
|
|
3294
3377
|
R && z(R), A(!0);
|
|
3295
|
-
}, [P, $,
|
|
3378
|
+
}, [P, $, j]), G = ae(() => {
|
|
3296
3379
|
A(!1), w("");
|
|
3297
3380
|
}, []), _ = () => v ? G() : V();
|
|
3298
3381
|
ge(() => {
|
|
@@ -3322,7 +3405,7 @@ const Et = 280, tn = ({
|
|
|
3322
3405
|
(R) => R.label.toLowerCase().includes(T.toLowerCase()) || R.value.toLowerCase().includes(T.toLowerCase())
|
|
3323
3406
|
), ie = (fe = a.find((R) => R.value === s)) == null ? void 0 : fe.label, Y = (R, te) => {
|
|
3324
3407
|
P || te || (c(R), G());
|
|
3325
|
-
}, { bg:
|
|
3408
|
+
}, { bg: we, border: pe, text: me, textSecondary: ve, primary: F, primaryLight: U, hoverBg: B } = Q, H = v && N && /* @__PURE__ */ o(
|
|
3326
3409
|
"div",
|
|
3327
3410
|
{
|
|
3328
3411
|
ref: E,
|
|
@@ -3337,7 +3420,7 @@ const Et = 280, tn = ({
|
|
|
3337
3420
|
borderRadius: "8px",
|
|
3338
3421
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
3339
3422
|
border: `1px solid ${pe}`,
|
|
3340
|
-
backgroundColor:
|
|
3423
|
+
backgroundColor: we,
|
|
3341
3424
|
overflow: "hidden"
|
|
3342
3425
|
},
|
|
3343
3426
|
children: [
|
|
@@ -3358,17 +3441,17 @@ const Et = 280, tn = ({
|
|
|
3358
3441
|
fontSize: "13px",
|
|
3359
3442
|
borderRadius: "6px",
|
|
3360
3443
|
border: `1px solid ${pe}`,
|
|
3361
|
-
backgroundColor:
|
|
3444
|
+
backgroundColor: we,
|
|
3362
3445
|
color: me,
|
|
3363
3446
|
outline: "none",
|
|
3364
3447
|
boxSizing: "border-box"
|
|
3365
3448
|
},
|
|
3366
3449
|
onFocus: (R) => {
|
|
3367
3450
|
const te = getComputedStyle(document.documentElement), ye = te.getPropertyValue("--metakyc-input-border-focus").trim() || te.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
3368
|
-
R.currentTarget.style.backgroundColor =
|
|
3451
|
+
R.currentTarget.style.backgroundColor = we, R.currentTarget.style.color = me, R.currentTarget.style.borderColor = ye, R.currentTarget.style.outline = "none", R.currentTarget.style.boxShadow = `0 0 0 2px ${ye}33`;
|
|
3369
3452
|
},
|
|
3370
3453
|
onBlur: (R) => {
|
|
3371
|
-
R.currentTarget.style.backgroundColor =
|
|
3454
|
+
R.currentTarget.style.backgroundColor = we, R.currentTarget.style.color = me, R.currentTarget.style.borderColor = pe, R.currentTarget.style.outline = "none", R.currentTarget.style.boxShadow = "none";
|
|
3372
3455
|
}
|
|
3373
3456
|
}
|
|
3374
3457
|
) }),
|
|
@@ -3382,7 +3465,7 @@ const Et = 280, tn = ({
|
|
|
3382
3465
|
maxHeight: "208px",
|
|
3383
3466
|
overflowY: "auto"
|
|
3384
3467
|
},
|
|
3385
|
-
children: J.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color:
|
|
3468
|
+
children: J.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: ve }, children: "No results" }) : J.map((R) => {
|
|
3386
3469
|
const te = R.value === s;
|
|
3387
3470
|
return /* @__PURE__ */ r(
|
|
3388
3471
|
"li",
|
|
@@ -3469,19 +3552,19 @@ const Et = 280, tn = ({
|
|
|
3469
3552
|
]
|
|
3470
3553
|
}
|
|
3471
3554
|
),
|
|
3472
|
-
typeof document < "u" &&
|
|
3555
|
+
typeof document < "u" && H ? Ct(H, document.body) : null,
|
|
3473
3556
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
3474
3557
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3475
3558
|
]
|
|
3476
3559
|
}
|
|
3477
3560
|
);
|
|
3478
3561
|
};
|
|
3479
|
-
|
|
3480
|
-
function
|
|
3562
|
+
Ve.displayName = "SearchableSelect";
|
|
3563
|
+
function ln(e) {
|
|
3481
3564
|
const t = e.type;
|
|
3482
3565
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : "file";
|
|
3483
3566
|
}
|
|
3484
|
-
const
|
|
3567
|
+
const cn = ({
|
|
3485
3568
|
label: e,
|
|
3486
3569
|
subtitle: t,
|
|
3487
3570
|
error: n,
|
|
@@ -3498,7 +3581,7 @@ const nn = ({
|
|
|
3498
3581
|
A(null);
|
|
3499
3582
|
const g = Array.from(E);
|
|
3500
3583
|
if (s && g.filter((V) => V.size > s).length > 0) {
|
|
3501
|
-
A(`File exceeds the maximum size of ${
|
|
3584
|
+
A(`File exceeds the maximum size of ${vt(s)}`);
|
|
3502
3585
|
return;
|
|
3503
3586
|
}
|
|
3504
3587
|
d == null || d(i ? [...y, ...g] : [g[0]]);
|
|
@@ -3511,7 +3594,7 @@ const nn = ({
|
|
|
3511
3594
|
}, [w]), M = () => {
|
|
3512
3595
|
var E;
|
|
3513
3596
|
(E = T.current) == null || E.click();
|
|
3514
|
-
},
|
|
3597
|
+
}, j = (E) => {
|
|
3515
3598
|
A(null);
|
|
3516
3599
|
const g = y.filter(($, V) => V !== E);
|
|
3517
3600
|
d == null || d(g);
|
|
@@ -3612,7 +3695,7 @@ const nn = ({
|
|
|
3612
3695
|
a && s && /* @__PURE__ */ r("span", { children: " · " }),
|
|
3613
3696
|
s && /* @__PURE__ */ o("span", { children: [
|
|
3614
3697
|
"Max ",
|
|
3615
|
-
|
|
3698
|
+
vt(s)
|
|
3616
3699
|
] })
|
|
3617
3700
|
] })
|
|
3618
3701
|
] })
|
|
@@ -3621,7 +3704,7 @@ const nn = ({
|
|
|
3621
3704
|
}
|
|
3622
3705
|
),
|
|
3623
3706
|
ee && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((E, g) => {
|
|
3624
|
-
const $ =
|
|
3707
|
+
const $ = ln(E), V = $ === "image", G = V ? URL.createObjectURL(E) : null;
|
|
3625
3708
|
return /* @__PURE__ */ o(
|
|
3626
3709
|
"div",
|
|
3627
3710
|
{
|
|
@@ -3680,14 +3763,14 @@ const nn = ({
|
|
|
3680
3763
|
textOverflow: "ellipsis",
|
|
3681
3764
|
whiteSpace: "nowrap"
|
|
3682
3765
|
}, children: E.name }),
|
|
3683
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children:
|
|
3766
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: vt(E.size) })
|
|
3684
3767
|
] }),
|
|
3685
3768
|
/* @__PURE__ */ r(
|
|
3686
3769
|
"button",
|
|
3687
3770
|
{
|
|
3688
3771
|
type: "button",
|
|
3689
3772
|
onClick: (_) => {
|
|
3690
|
-
_.stopPropagation(),
|
|
3773
|
+
_.stopPropagation(), j(g);
|
|
3691
3774
|
},
|
|
3692
3775
|
style: {
|
|
3693
3776
|
display: "flex",
|
|
@@ -3723,7 +3806,7 @@ const nn = ({
|
|
|
3723
3806
|
}) }),
|
|
3724
3807
|
K && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: K })
|
|
3725
3808
|
] });
|
|
3726
|
-
},
|
|
3809
|
+
}, dn = yt(
|
|
3727
3810
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
3728
3811
|
a.label && /* @__PURE__ */ o(
|
|
3729
3812
|
"label",
|
|
@@ -3770,28 +3853,28 @@ const nn = ({
|
|
|
3770
3853
|
a.error && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: a.error })
|
|
3771
3854
|
] })
|
|
3772
3855
|
);
|
|
3773
|
-
|
|
3856
|
+
dn.displayName = "PhoneInput";
|
|
3774
3857
|
/**
|
|
3775
3858
|
* @license lucide-react v0.574.0 - ISC
|
|
3776
3859
|
*
|
|
3777
3860
|
* This source code is licensed under the ISC license.
|
|
3778
3861
|
* See the LICENSE file in the root directory of this source tree.
|
|
3779
3862
|
*/
|
|
3780
|
-
const
|
|
3863
|
+
const jt = (...e) => e.filter((t, n, a) => !!t && t.trim() !== "" && a.indexOf(t) === n).join(" ").trim();
|
|
3781
3864
|
/**
|
|
3782
3865
|
* @license lucide-react v0.574.0 - ISC
|
|
3783
3866
|
*
|
|
3784
3867
|
* This source code is licensed under the ISC license.
|
|
3785
3868
|
* See the LICENSE file in the root directory of this source tree.
|
|
3786
3869
|
*/
|
|
3787
|
-
const
|
|
3870
|
+
const un = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3788
3871
|
/**
|
|
3789
3872
|
* @license lucide-react v0.574.0 - ISC
|
|
3790
3873
|
*
|
|
3791
3874
|
* This source code is licensed under the ISC license.
|
|
3792
3875
|
* See the LICENSE file in the root directory of this source tree.
|
|
3793
3876
|
*/
|
|
3794
|
-
const
|
|
3877
|
+
const pn = (e) => e.replace(
|
|
3795
3878
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
3796
3879
|
(t, n, a) => a ? a.toUpperCase() : n.toLowerCase()
|
|
3797
3880
|
);
|
|
@@ -3801,8 +3884,8 @@ const sn = (e) => e.replace(
|
|
|
3801
3884
|
* This source code is licensed under the ISC license.
|
|
3802
3885
|
* See the LICENSE file in the root directory of this source tree.
|
|
3803
3886
|
*/
|
|
3804
|
-
const
|
|
3805
|
-
const t =
|
|
3887
|
+
const Pt = (e) => {
|
|
3888
|
+
const t = pn(e);
|
|
3806
3889
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3807
3890
|
};
|
|
3808
3891
|
/**
|
|
@@ -3811,7 +3894,7 @@ const At = (e) => {
|
|
|
3811
3894
|
* This source code is licensed under the ISC license.
|
|
3812
3895
|
* See the LICENSE file in the root directory of this source tree.
|
|
3813
3896
|
*/
|
|
3814
|
-
var
|
|
3897
|
+
var mn = {
|
|
3815
3898
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3816
3899
|
width: 24,
|
|
3817
3900
|
height: 24,
|
|
@@ -3828,7 +3911,7 @@ var ln = {
|
|
|
3828
3911
|
* This source code is licensed under the ISC license.
|
|
3829
3912
|
* See the LICENSE file in the root directory of this source tree.
|
|
3830
3913
|
*/
|
|
3831
|
-
const
|
|
3914
|
+
const yn = (e) => {
|
|
3832
3915
|
for (const t in e)
|
|
3833
3916
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
3834
3917
|
return !0;
|
|
@@ -3840,7 +3923,7 @@ const cn = (e) => {
|
|
|
3840
3923
|
* This source code is licensed under the ISC license.
|
|
3841
3924
|
* See the LICENSE file in the root directory of this source tree.
|
|
3842
3925
|
*/
|
|
3843
|
-
const
|
|
3926
|
+
const hn = yt(
|
|
3844
3927
|
({
|
|
3845
3928
|
color: e = "currentColor",
|
|
3846
3929
|
size: t = 24,
|
|
@@ -3850,21 +3933,21 @@ const dn = yt(
|
|
|
3850
3933
|
children: s,
|
|
3851
3934
|
iconNode: c,
|
|
3852
3935
|
...d
|
|
3853
|
-
}, y) =>
|
|
3936
|
+
}, y) => St(
|
|
3854
3937
|
"svg",
|
|
3855
3938
|
{
|
|
3856
3939
|
ref: y,
|
|
3857
|
-
...
|
|
3940
|
+
...mn,
|
|
3858
3941
|
width: t,
|
|
3859
3942
|
height: t,
|
|
3860
3943
|
stroke: e,
|
|
3861
3944
|
strokeWidth: a ? Number(n) * 24 / Number(t) : n,
|
|
3862
|
-
className:
|
|
3863
|
-
...!s && !
|
|
3945
|
+
className: jt("lucide", i),
|
|
3946
|
+
...!s && !yn(d) && { "aria-hidden": "true" },
|
|
3864
3947
|
...d
|
|
3865
3948
|
},
|
|
3866
3949
|
[
|
|
3867
|
-
...c.map(([p, b]) =>
|
|
3950
|
+
...c.map(([p, b]) => St(p, b)),
|
|
3868
3951
|
...Array.isArray(s) ? s : [s]
|
|
3869
3952
|
]
|
|
3870
3953
|
)
|
|
@@ -3875,20 +3958,20 @@ const dn = yt(
|
|
|
3875
3958
|
* This source code is licensed under the ISC license.
|
|
3876
3959
|
* See the LICENSE file in the root directory of this source tree.
|
|
3877
3960
|
*/
|
|
3878
|
-
const
|
|
3961
|
+
const Ht = (e, t) => {
|
|
3879
3962
|
const n = yt(
|
|
3880
|
-
({ className: a, ...i }, s) =>
|
|
3963
|
+
({ className: a, ...i }, s) => St(hn, {
|
|
3881
3964
|
ref: s,
|
|
3882
3965
|
iconNode: t,
|
|
3883
|
-
className:
|
|
3884
|
-
`lucide-${
|
|
3966
|
+
className: jt(
|
|
3967
|
+
`lucide-${un(Pt(e))}`,
|
|
3885
3968
|
`lucide-${e}`,
|
|
3886
3969
|
a
|
|
3887
3970
|
),
|
|
3888
3971
|
...i
|
|
3889
3972
|
})
|
|
3890
3973
|
);
|
|
3891
|
-
return n.displayName =
|
|
3974
|
+
return n.displayName = Pt(e), n;
|
|
3892
3975
|
};
|
|
3893
3976
|
/**
|
|
3894
3977
|
* @license lucide-react v0.574.0 - ISC
|
|
@@ -3896,15 +3979,15 @@ const _t = (e, t) => {
|
|
|
3896
3979
|
* This source code is licensed under the ISC license.
|
|
3897
3980
|
* See the LICENSE file in the root directory of this source tree.
|
|
3898
3981
|
*/
|
|
3899
|
-
const
|
|
3982
|
+
const fn = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Wt = Ht("chevron-left", fn);
|
|
3900
3983
|
/**
|
|
3901
3984
|
* @license lucide-react v0.574.0 - ISC
|
|
3902
3985
|
*
|
|
3903
3986
|
* This source code is licensed under the ISC license.
|
|
3904
3987
|
* See the LICENSE file in the root directory of this source tree.
|
|
3905
3988
|
*/
|
|
3906
|
-
const
|
|
3907
|
-
function
|
|
3989
|
+
const gn = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ut = Ht("chevron-right", gn);
|
|
3990
|
+
function bn(e, t) {
|
|
3908
3991
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
3909
3992
|
if (e.isRequired && n)
|
|
3910
3993
|
return e.errorMessage || "This field is required";
|
|
@@ -3933,7 +4016,7 @@ function mn(e, t) {
|
|
|
3933
4016
|
}
|
|
3934
4017
|
return null;
|
|
3935
4018
|
}
|
|
3936
|
-
function
|
|
4019
|
+
function xn(e) {
|
|
3937
4020
|
const t = e.flatMap(
|
|
3938
4021
|
(a, i) => (a.questions ?? []).map((s, c) => ({ question: s, groupIndex: i, qIdx: c }))
|
|
3939
4022
|
), n = /* @__PURE__ */ new Map();
|
|
@@ -3943,17 +4026,17 @@ function yn(e) {
|
|
|
3943
4026
|
}
|
|
3944
4027
|
return Array.from(n.entries()).sort(([a], [i]) => a - i).map(([, a]) => a);
|
|
3945
4028
|
}
|
|
3946
|
-
const
|
|
4029
|
+
const vn = ({
|
|
3947
4030
|
applicantId: e,
|
|
3948
4031
|
onComplete: t,
|
|
3949
4032
|
onBack: n
|
|
3950
4033
|
}) => {
|
|
3951
|
-
const { questionnaire: a, initialAnswers: i, isLoading: s, isSubmitting: c, error: d, submit: y } =
|
|
3952
|
-
|
|
4034
|
+
const { questionnaire: a, initialAnswers: i, isLoading: s, isSubmitting: c, error: d, submit: y } = Zr(e), [p, b] = k({}), [P, v] = k({}), [A, T] = k(0);
|
|
4035
|
+
ke.useEffect(() => {
|
|
3953
4036
|
i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && b(i);
|
|
3954
4037
|
}, [i]);
|
|
3955
4038
|
const w = De(
|
|
3956
|
-
() => a ?
|
|
4039
|
+
() => a ? xn(a.questionGroups) : [],
|
|
3957
4040
|
[a]
|
|
3958
4041
|
), N = A === w.length - 1, z = w[A] ?? [], Q = ae((E, g) => {
|
|
3959
4042
|
b(($) => ({ ...$, [E]: g })), v(($) => {
|
|
@@ -3963,11 +4046,11 @@ const hn = ({
|
|
|
3963
4046
|
}, []), M = ae(() => {
|
|
3964
4047
|
const E = {};
|
|
3965
4048
|
for (const { question: g } of z) {
|
|
3966
|
-
const $ =
|
|
4049
|
+
const $ = bn(g, p[g.id] ?? []);
|
|
3967
4050
|
$ && (E[g.id] = $);
|
|
3968
4051
|
}
|
|
3969
4052
|
return v((g) => ({ ...g, ...E })), Object.keys(E).length === 0;
|
|
3970
|
-
}, [z, p]),
|
|
4053
|
+
}, [z, p]), j = () => {
|
|
3971
4054
|
M() && T((E) => E + 1);
|
|
3972
4055
|
}, K = () => {
|
|
3973
4056
|
A > 0 ? T((E) => E - 1) : n == null || n();
|
|
@@ -4018,7 +4101,7 @@ const hn = ({
|
|
|
4018
4101
|
] })
|
|
4019
4102
|
] }),
|
|
4020
4103
|
/* @__PURE__ */ r(ne, { className: "space-y-6", children: z.map(({ question: E }) => /* @__PURE__ */ r(
|
|
4021
|
-
|
|
4104
|
+
kn,
|
|
4022
4105
|
{
|
|
4023
4106
|
question: E,
|
|
4024
4107
|
value: p[E.id] ?? [],
|
|
@@ -4036,7 +4119,7 @@ const hn = ({
|
|
|
4036
4119
|
onClick: K,
|
|
4037
4120
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4038
4121
|
children: [
|
|
4039
|
-
/* @__PURE__ */ r(
|
|
4122
|
+
/* @__PURE__ */ r(Wt, { size: 14 }),
|
|
4040
4123
|
A > 0 ? "Previous" : "Back"
|
|
4041
4124
|
]
|
|
4042
4125
|
}
|
|
@@ -4053,18 +4136,18 @@ const hn = ({
|
|
|
4053
4136
|
Z,
|
|
4054
4137
|
{
|
|
4055
4138
|
type: "button",
|
|
4056
|
-
onClick:
|
|
4139
|
+
onClick: j,
|
|
4057
4140
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4058
4141
|
children: [
|
|
4059
4142
|
"Next",
|
|
4060
|
-
/* @__PURE__ */ r(
|
|
4143
|
+
/* @__PURE__ */ r(Ut, { size: 14 })
|
|
4061
4144
|
]
|
|
4062
4145
|
}
|
|
4063
4146
|
)
|
|
4064
4147
|
] }),
|
|
4065
4148
|
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 }) })
|
|
4066
4149
|
] }) : null;
|
|
4067
|
-
},
|
|
4150
|
+
}, kn = ({ question: e, value: t, error: n, onChange: a }) => {
|
|
4068
4151
|
var c;
|
|
4069
4152
|
const s = (((c = e.defaultAnswers) == null ? void 0 : c.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
4070
4153
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -4085,7 +4168,7 @@ const hn = ({
|
|
|
4085
4168
|
}
|
|
4086
4169
|
),
|
|
4087
4170
|
s === "single-select" && /* @__PURE__ */ r(
|
|
4088
|
-
|
|
4171
|
+
Nt,
|
|
4089
4172
|
{
|
|
4090
4173
|
value: t[0] ?? "",
|
|
4091
4174
|
onChange: (d) => a([d.target.value]),
|
|
@@ -4139,26 +4222,11 @@ const hn = ({
|
|
|
4139
4222
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
|
|
4140
4223
|
children: [
|
|
4141
4224
|
/* @__PURE__ */ r(
|
|
4142
|
-
|
|
4225
|
+
Be,
|
|
4143
4226
|
{
|
|
4144
|
-
type: "checkbox",
|
|
4145
4227
|
checked: t.includes(d),
|
|
4146
4228
|
onChange: (y) => {
|
|
4147
|
-
y
|
|
4148
|
-
},
|
|
4149
|
-
className: "metakyc-option-input",
|
|
4150
|
-
style: {
|
|
4151
|
-
width: "16px",
|
|
4152
|
-
height: "16px",
|
|
4153
|
-
minWidth: "16px",
|
|
4154
|
-
flexShrink: 0,
|
|
4155
|
-
flexGrow: 0,
|
|
4156
|
-
accentColor: "var(--metakyc-primary, #2563eb)",
|
|
4157
|
-
cursor: "pointer",
|
|
4158
|
-
margin: 0,
|
|
4159
|
-
padding: 0,
|
|
4160
|
-
display: "inline-block",
|
|
4161
|
-
verticalAlign: "middle"
|
|
4229
|
+
a(y ? [...t, d] : t.filter((p) => p !== d));
|
|
4162
4230
|
}
|
|
4163
4231
|
}
|
|
4164
4232
|
),
|
|
@@ -4172,7 +4240,7 @@ const hn = ({
|
|
|
4172
4240
|
n && s === "text" && null
|
|
4173
4241
|
] });
|
|
4174
4242
|
};
|
|
4175
|
-
function
|
|
4243
|
+
function wn(e) {
|
|
4176
4244
|
const t = /* @__PURE__ */ new Map();
|
|
4177
4245
|
for (const n of e) {
|
|
4178
4246
|
const a = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
@@ -4180,25 +4248,25 @@ function gn(e) {
|
|
|
4180
4248
|
}
|
|
4181
4249
|
return Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
4182
4250
|
}
|
|
4183
|
-
const
|
|
4251
|
+
const Sn = ({
|
|
4184
4252
|
applicantId: e,
|
|
4185
4253
|
onComplete: t,
|
|
4186
4254
|
onBack: n
|
|
4187
4255
|
}) => {
|
|
4188
|
-
const { uploadDocument: a, isLoading: i, isSubmitting: s, error: c, submit: d } =
|
|
4189
|
-
() => a ?
|
|
4256
|
+
const { uploadDocument: a, isLoading: i, isSubmitting: s, error: c, submit: d } = Xr(e), [y, p] = k({}), [b, P] = k(null), [v, A] = k(0), [T, w] = k({}), N = De(
|
|
4257
|
+
() => a ? wn(a.uploadDocumentFiles) : [],
|
|
4190
4258
|
[a]
|
|
4191
|
-
), z = N[v] ?? [], Q = v === N.length - 1, M = N.length,
|
|
4259
|
+
), z = N[v] ?? [], Q = v === N.length - 1, M = N.length, j = ae(() => {
|
|
4192
4260
|
const g = {};
|
|
4193
4261
|
for (const $ of z)
|
|
4194
4262
|
$.isRequired && (y[$.id] || []).length === 0 && (g[$.id] = `${$.displayName} is required`);
|
|
4195
4263
|
return w(g), Object.keys(g).length === 0;
|
|
4196
4264
|
}, [z, y]), K = () => {
|
|
4197
|
-
|
|
4265
|
+
j() && (A((g) => g + 1), w({}));
|
|
4198
4266
|
}, ee = () => {
|
|
4199
4267
|
v > 0 ? (A((g) => g - 1), w({})) : n == null || n();
|
|
4200
4268
|
}, E = async () => {
|
|
4201
|
-
if (!(!
|
|
4269
|
+
if (!(!j() || !a)) {
|
|
4202
4270
|
P(null);
|
|
4203
4271
|
try {
|
|
4204
4272
|
const g = await Promise.all(
|
|
@@ -4206,7 +4274,7 @@ const bn = ({
|
|
|
4206
4274
|
const G = y[V.id] || [], _ = await Promise.all(
|
|
4207
4275
|
G.map(async (J) => ({
|
|
4208
4276
|
fileName: J.name,
|
|
4209
|
-
fileData: await
|
|
4277
|
+
fileData: await Kr(J)
|
|
4210
4278
|
}))
|
|
4211
4279
|
);
|
|
4212
4280
|
return {
|
|
@@ -4328,7 +4396,7 @@ const bn = ({
|
|
|
4328
4396
|
}, children: a.description })
|
|
4329
4397
|
] }),
|
|
4330
4398
|
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: z.map((g) => /* @__PURE__ */ r(
|
|
4331
|
-
|
|
4399
|
+
cn,
|
|
4332
4400
|
{
|
|
4333
4401
|
label: g.displayName,
|
|
4334
4402
|
subtitle: g.subtitle,
|
|
@@ -4397,8 +4465,8 @@ const bn = ({
|
|
|
4397
4465
|
)
|
|
4398
4466
|
] }) })
|
|
4399
4467
|
] }) : null;
|
|
4400
|
-
},
|
|
4401
|
-
const { overview: a, isLoading: i, isSubmitting: s, error: c, passOverview: d } =
|
|
4468
|
+
}, Cn = ({ applicantId: e, onComplete: t, onBack: n }) => {
|
|
4469
|
+
const { overview: a, isLoading: i, isSubmitting: s, error: c, passOverview: d } = en(e), y = async () => {
|
|
4402
4470
|
await d(), t == null || t();
|
|
4403
4471
|
};
|
|
4404
4472
|
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__ */ o("p", { className: "text-danger-500", children: [
|
|
@@ -4441,7 +4509,7 @@ const bn = ({
|
|
|
4441
4509
|
] })
|
|
4442
4510
|
] }) : null;
|
|
4443
4511
|
};
|
|
4444
|
-
function
|
|
4512
|
+
function Nn(e) {
|
|
4445
4513
|
const t = (e ?? "en").toLowerCase().replace("_", "-");
|
|
4446
4514
|
try {
|
|
4447
4515
|
return Intl.NumberFormat.supportedLocalesOf([t]), t;
|
|
@@ -4449,11 +4517,11 @@ function vn(e) {
|
|
|
4449
4517
|
return "en";
|
|
4450
4518
|
}
|
|
4451
4519
|
}
|
|
4452
|
-
function
|
|
4453
|
-
return e.valueDataType ===
|
|
4520
|
+
function In(e) {
|
|
4521
|
+
return e.valueDataType === qe.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
|
|
4454
4522
|
}
|
|
4455
|
-
function
|
|
4456
|
-
const n = new Intl.NumberFormat(
|
|
4523
|
+
function Rn(e, t) {
|
|
4524
|
+
const n = new Intl.NumberFormat(Nn(t), {
|
|
4457
4525
|
minimumFractionDigits: 0,
|
|
4458
4526
|
maximumFractionDigits: 2
|
|
4459
4527
|
});
|
|
@@ -4462,7 +4530,7 @@ function wn(e, t) {
|
|
|
4462
4530
|
return isNaN(i) ? a : n.format(i);
|
|
4463
4531
|
});
|
|
4464
4532
|
}
|
|
4465
|
-
function
|
|
4533
|
+
function En(e, t) {
|
|
4466
4534
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
4467
4535
|
if (e.isRequired && n)
|
|
4468
4536
|
return e.errorMessage || `${e.displayName} is required`;
|
|
@@ -4474,7 +4542,7 @@ function Sn(e, t) {
|
|
|
4474
4542
|
return e.errorMessage || "Invalid format";
|
|
4475
4543
|
} catch {
|
|
4476
4544
|
}
|
|
4477
|
-
const i = e.valueDataType ===
|
|
4545
|
+
const i = e.valueDataType === qe.Integer || e.valueDataType === qe.Money || e.valueDataType === qe.DigitOnly;
|
|
4478
4546
|
if (i && a.trim() !== "") {
|
|
4479
4547
|
const s = Number(a);
|
|
4480
4548
|
if (!isNaN(s)) {
|
|
@@ -4492,30 +4560,30 @@ function Sn(e, t) {
|
|
|
4492
4560
|
}
|
|
4493
4561
|
return null;
|
|
4494
4562
|
}
|
|
4495
|
-
function
|
|
4563
|
+
function Fn(e) {
|
|
4496
4564
|
const t = /* @__PURE__ */ new Map();
|
|
4497
4565
|
return e.forEach((n, a) => {
|
|
4498
4566
|
const i = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
4499
4567
|
t.has(i) || t.set(i, []), t.get(i).push({ criterion: n, idx: a });
|
|
4500
4568
|
}), Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
4501
4569
|
}
|
|
4502
|
-
function
|
|
4570
|
+
function An(e) {
|
|
4503
4571
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
4504
4572
|
}
|
|
4505
|
-
const
|
|
4573
|
+
const Tn = ({
|
|
4506
4574
|
applicantId: e,
|
|
4507
4575
|
onComplete: t,
|
|
4508
4576
|
onBack: n
|
|
4509
4577
|
}) => {
|
|
4510
|
-
const { config: a } = Te(), i = a.locale ?? "en", { criteria: s, initialAnswers: c, isLoading: d, isSubmitting: y, error: p, submit: b } =
|
|
4511
|
-
|
|
4578
|
+
const { config: a } = Te(), i = a.locale ?? "en", { criteria: s, initialAnswers: c, isLoading: d, isSubmitting: y, error: p, submit: b } = rn(e), [P, v] = k({}), [A, T] = k({}), [w, N] = k(0), [z, Q] = k(!1);
|
|
4579
|
+
ke.useEffect(() => {
|
|
4512
4580
|
c && Object.keys(c).length > 0 && Object.keys(P).length === 0 && v(c);
|
|
4513
4581
|
}, [c]);
|
|
4514
4582
|
const M = De(
|
|
4515
|
-
() => s && s.length > 0 ?
|
|
4583
|
+
() => s && s.length > 0 ? Fn(s) : [],
|
|
4516
4584
|
[s]
|
|
4517
|
-
),
|
|
4518
|
-
|
|
4585
|
+
), j = w === M.length - 1, K = M[w] ?? [];
|
|
4586
|
+
ke.useEffect(() => {
|
|
4519
4587
|
!d && s && s.length === 0 && !z && !y && (Q(!0), b({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
4520
4588
|
}, [d, s, z, y, b, e, t]);
|
|
4521
4589
|
const ee = ae((G, _) => {
|
|
@@ -4526,7 +4594,7 @@ const In = ({
|
|
|
4526
4594
|
}, []), E = ae(() => {
|
|
4527
4595
|
const G = {};
|
|
4528
4596
|
for (const { criterion: _ } of K) {
|
|
4529
|
-
const J =
|
|
4597
|
+
const J = En(_, P[_.id] ?? []);
|
|
4530
4598
|
J && (G[_.id] = J);
|
|
4531
4599
|
}
|
|
4532
4600
|
return T((_) => ({ ..._, ...G })), Object.keys(G).length === 0;
|
|
@@ -4581,7 +4649,7 @@ const In = ({
|
|
|
4581
4649
|
] })
|
|
4582
4650
|
] }),
|
|
4583
4651
|
/* @__PURE__ */ r(ne, { className: "space-y-6", children: K.map(({ criterion: G }) => /* @__PURE__ */ r(
|
|
4584
|
-
|
|
4652
|
+
Pn,
|
|
4585
4653
|
{
|
|
4586
4654
|
criterion: G,
|
|
4587
4655
|
value: P[G.id] ?? [],
|
|
@@ -4600,12 +4668,12 @@ const In = ({
|
|
|
4600
4668
|
onClick: $,
|
|
4601
4669
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4602
4670
|
children: [
|
|
4603
|
-
/* @__PURE__ */ r(
|
|
4671
|
+
/* @__PURE__ */ r(Wt, { size: 14 }),
|
|
4604
4672
|
w > 0 ? "Previous" : "Back"
|
|
4605
4673
|
]
|
|
4606
4674
|
}
|
|
4607
4675
|
),
|
|
4608
|
-
|
|
4676
|
+
j ? /* @__PURE__ */ r(Z, { type: "button", isLoading: y, onClick: V, children: "Continue" }) : /* @__PURE__ */ o(
|
|
4609
4677
|
Z,
|
|
4610
4678
|
{
|
|
4611
4679
|
type: "button",
|
|
@@ -4613,15 +4681,15 @@ const In = ({
|
|
|
4613
4681
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4614
4682
|
children: [
|
|
4615
4683
|
"Next",
|
|
4616
|
-
/* @__PURE__ */ r(
|
|
4684
|
+
/* @__PURE__ */ r(Ut, { size: 14 })
|
|
4617
4685
|
]
|
|
4618
4686
|
}
|
|
4619
4687
|
)
|
|
4620
4688
|
] }),
|
|
4621
4689
|
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 }) })
|
|
4622
4690
|
] }) : null;
|
|
4623
|
-
},
|
|
4624
|
-
const s =
|
|
4691
|
+
}, Pn = ({ criterion: e, value: t, error: n, locale: a, onChange: i }) => {
|
|
4692
|
+
const s = An(e), c = e.valueDataType === qe.Integer || e.valueDataType === qe.Money || e.valueDataType === qe.DigitOnly, d = In(e), y = (p) => d ? Rn(p, a) : p;
|
|
4625
4693
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
4626
4694
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4627
4695
|
e.displayName,
|
|
@@ -4641,7 +4709,7 @@ const In = ({
|
|
|
4641
4709
|
min: e.min,
|
|
4642
4710
|
max: e.max,
|
|
4643
4711
|
onKeyDown: (p) => {
|
|
4644
|
-
e.valueDataType ===
|
|
4712
|
+
e.valueDataType === qe.DigitOnly && ["e", "E", "+", "-", "."].includes(p.key) && p.preventDefault();
|
|
4645
4713
|
}
|
|
4646
4714
|
}
|
|
4647
4715
|
),
|
|
@@ -4689,26 +4757,11 @@ const In = ({
|
|
|
4689
4757
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
|
|
4690
4758
|
children: [
|
|
4691
4759
|
/* @__PURE__ */ r(
|
|
4692
|
-
|
|
4760
|
+
Be,
|
|
4693
4761
|
{
|
|
4694
|
-
type: "checkbox",
|
|
4695
4762
|
checked: t.includes(p),
|
|
4696
4763
|
onChange: (b) => {
|
|
4697
|
-
b
|
|
4698
|
-
},
|
|
4699
|
-
className: "metakyc-option-input",
|
|
4700
|
-
style: {
|
|
4701
|
-
width: "16px",
|
|
4702
|
-
height: "16px",
|
|
4703
|
-
minWidth: "16px",
|
|
4704
|
-
flexShrink: 0,
|
|
4705
|
-
flexGrow: 0,
|
|
4706
|
-
accentColor: "var(--metakyc-primary, #2563eb)",
|
|
4707
|
-
cursor: "pointer",
|
|
4708
|
-
margin: 0,
|
|
4709
|
-
padding: 0,
|
|
4710
|
-
display: "inline-block",
|
|
4711
|
-
verticalAlign: "middle"
|
|
4764
|
+
i(b ? [...t, p] : t.filter((P) => P !== p));
|
|
4712
4765
|
}
|
|
4713
4766
|
}
|
|
4714
4767
|
),
|
|
@@ -4720,7 +4773,7 @@ const In = ({
|
|
|
4720
4773
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4721
4774
|
] }),
|
|
4722
4775
|
s === "country" && /* @__PURE__ */ r(
|
|
4723
|
-
|
|
4776
|
+
Nt,
|
|
4724
4777
|
{
|
|
4725
4778
|
value: t[0] ?? "",
|
|
4726
4779
|
onChange: (p) => i([p.target.value]),
|
|
@@ -4737,7 +4790,7 @@ const In = ({
|
|
|
4737
4790
|
}
|
|
4738
4791
|
)
|
|
4739
4792
|
] });
|
|
4740
|
-
},
|
|
4793
|
+
}, Ln = ({
|
|
4741
4794
|
applicantId: e,
|
|
4742
4795
|
onComplete: t,
|
|
4743
4796
|
onBack: n
|
|
@@ -4879,28 +4932,28 @@ const In = ({
|
|
|
4879
4932
|
] })
|
|
4880
4933
|
] }) });
|
|
4881
4934
|
};
|
|
4882
|
-
function
|
|
4935
|
+
function Lt(e) {
|
|
4883
4936
|
const t = e.split(":").map(Number);
|
|
4884
4937
|
return t.length === 3 ? t[0] * 3600 + t[1] * 60 + t[2] : 0;
|
|
4885
4938
|
}
|
|
4886
|
-
function
|
|
4939
|
+
function kt(e) {
|
|
4887
4940
|
const t = Math.floor(e / 60), n = e % 60;
|
|
4888
4941
|
return `${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
|
|
4889
4942
|
}
|
|
4890
|
-
const
|
|
4943
|
+
const Dn = ({
|
|
4891
4944
|
applicantId: e,
|
|
4892
4945
|
onComplete: t,
|
|
4893
4946
|
onBack: n
|
|
4894
4947
|
}) => {
|
|
4895
|
-
const { appropriatenessTestService: a } = Te(), [i, s] = k(null), [c, d] = k(!0), [y, p] = k(!1), [b, P] = k(null), [v, A] = k({}), [T, w] = k(0), [N, z] = k(!1), [Q, M] = k(!1), [
|
|
4948
|
+
const { appropriatenessTestService: a } = Te(), [i, s] = k(null), [c, d] = k(!0), [y, p] = k(!1), [b, P] = k(null), [v, A] = k({}), [T, w] = k(0), [N, z] = k(!1), [Q, M] = k(!1), [j, K] = k(0), [ee, E] = k(0), [g, $] = k(null);
|
|
4896
4949
|
ge(() => {
|
|
4897
4950
|
(async () => {
|
|
4898
4951
|
try {
|
|
4899
4952
|
d(!0), P(null);
|
|
4900
4953
|
const B = await a.getAppropriatenessTest(e);
|
|
4901
4954
|
if (s(B), B.waitTimeSpanForNextTry && B.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4902
|
-
const
|
|
4903
|
-
|
|
4955
|
+
const H = Lt(B.waitTimeSpanForNextTry);
|
|
4956
|
+
H > 0 && K(H);
|
|
4904
4957
|
}
|
|
4905
4958
|
} catch (B) {
|
|
4906
4959
|
P(B.message || "Failed to load appropriateness test");
|
|
@@ -4911,48 +4964,48 @@ const Fn = ({
|
|
|
4911
4964
|
}, [e, a]), ge(() => {
|
|
4912
4965
|
if (!N || T <= 0) return;
|
|
4913
4966
|
const B = setInterval(() => {
|
|
4914
|
-
w((
|
|
4967
|
+
w((H) => H <= 1 ? (M(!0), 0) : H - 1);
|
|
4915
4968
|
}, 1e3);
|
|
4916
4969
|
return () => clearInterval(B);
|
|
4917
4970
|
}, [N, T]), ge(() => {
|
|
4918
|
-
if (
|
|
4971
|
+
if (j <= 0) return;
|
|
4919
4972
|
const B = setInterval(() => {
|
|
4920
|
-
K((
|
|
4973
|
+
K((H) => H <= 1 ? 0 : H - 1);
|
|
4921
4974
|
}, 1e3);
|
|
4922
4975
|
return () => clearInterval(B);
|
|
4923
|
-
}, [
|
|
4976
|
+
}, [j]), ge(() => {
|
|
4924
4977
|
Q && !y && J();
|
|
4925
4978
|
}, [Q]);
|
|
4926
4979
|
const V = () => {
|
|
4927
4980
|
i && (z(!0), w(i.testDurationSec), E(0), A({}), P(null));
|
|
4928
|
-
}, G = (B,
|
|
4929
|
-
A((fe) => ({ ...fe, [B]:
|
|
4981
|
+
}, G = (B, H) => {
|
|
4982
|
+
A((fe) => ({ ...fe, [B]: H }));
|
|
4930
4983
|
}, _ = ae(async () => {
|
|
4931
4984
|
try {
|
|
4932
4985
|
const B = await a.getAppropriatenessTest(e);
|
|
4933
4986
|
if (s(B), B.waitTimeSpanForNextTry && B.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4934
|
-
const
|
|
4935
|
-
|
|
4987
|
+
const H = Lt(B.waitTimeSpanForNextTry);
|
|
4988
|
+
H > 0 && K(H);
|
|
4936
4989
|
}
|
|
4937
4990
|
} catch {
|
|
4938
4991
|
}
|
|
4939
4992
|
}, [e, a]), J = async (B) => {
|
|
4940
4993
|
if (i) {
|
|
4941
4994
|
if (!Q) {
|
|
4942
|
-
const
|
|
4943
|
-
if (
|
|
4944
|
-
P(`Please answer all questions. ${
|
|
4995
|
+
const H = i.appropriatenessQuestions.length - Object.keys(v).length;
|
|
4996
|
+
if (H > 0) {
|
|
4997
|
+
P(`Please answer all questions. ${H} remaining.`);
|
|
4945
4998
|
return;
|
|
4946
4999
|
}
|
|
4947
5000
|
}
|
|
4948
5001
|
p(!0), P(null);
|
|
4949
5002
|
try {
|
|
4950
|
-
const
|
|
5003
|
+
const H = i.appropriatenessQuestions.map(
|
|
4951
5004
|
(R) => ({ appropriatenessQuestionId: R.id, value: v[R.id] || "" })
|
|
4952
5005
|
), fe = {
|
|
4953
5006
|
applicantId: e,
|
|
4954
5007
|
appropriatenessTestId: i.id,
|
|
4955
|
-
appropriatenessQuestionResults:
|
|
5008
|
+
appropriatenessQuestionResults: H
|
|
4956
5009
|
};
|
|
4957
5010
|
try {
|
|
4958
5011
|
const R = await a.fillAppropriatenessTest(fe);
|
|
@@ -4963,8 +5016,8 @@ const Fn = ({
|
|
|
4963
5016
|
else
|
|
4964
5017
|
throw R;
|
|
4965
5018
|
}
|
|
4966
|
-
} catch (
|
|
4967
|
-
P(
|
|
5019
|
+
} catch (H) {
|
|
5020
|
+
P(H.message || "Failed to submit test. Please try again."), ie();
|
|
4968
5021
|
} finally {
|
|
4969
5022
|
p(!1);
|
|
4970
5023
|
}
|
|
@@ -4982,8 +5035,8 @@ const Fn = ({
|
|
|
4982
5035
|
/* @__PURE__ */ r("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: "No test data available" }),
|
|
4983
5036
|
b && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: b })
|
|
4984
5037
|
] }) }) });
|
|
4985
|
-
const Y = i.testAllowedMaxTry - i.totalFailedTries,
|
|
4986
|
-
if (
|
|
5038
|
+
const Y = i.testAllowedMaxTry - i.totalFailedTries, we = i.appropriatenessQuestions.length, pe = Object.keys(v).length;
|
|
5039
|
+
if (j > 0)
|
|
4987
5040
|
return /* @__PURE__ */ o(re, { children: [
|
|
4988
5041
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: i.displayName }) }),
|
|
4989
5042
|
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { style: { textAlign: "center", padding: "32px 0" }, children: [
|
|
@@ -5001,7 +5054,7 @@ const Fn = ({
|
|
|
5001
5054
|
fontWeight: 700,
|
|
5002
5055
|
color: "var(--metakyc-primary, #2563eb)",
|
|
5003
5056
|
fontVariantNumeric: "tabular-nums"
|
|
5004
|
-
}, children:
|
|
5057
|
+
}, children: kt(j) }) }),
|
|
5005
5058
|
/* @__PURE__ */ r("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: "Please wait before retrying" }),
|
|
5006
5059
|
/* @__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" }),
|
|
5007
5060
|
b && /* @__PURE__ */ r("div", { style: {
|
|
@@ -5085,9 +5138,9 @@ const Fn = ({
|
|
|
5085
5138
|
margin: 0
|
|
5086
5139
|
}, children: "No attempts remaining. Please contact support for assistance." }) })
|
|
5087
5140
|
] }) }),
|
|
5088
|
-
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: g.success ? /* @__PURE__ */ r(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ o(
|
|
5089
|
-
Y > 0 &&
|
|
5090
|
-
Y > 0 &&
|
|
5141
|
+
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: g.success ? /* @__PURE__ */ r(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ o(ct, { children: [
|
|
5142
|
+
Y > 0 && j <= 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "Retake Test" }),
|
|
5143
|
+
Y > 0 && j > 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "OK" }),
|
|
5091
5144
|
Y <= 0 && n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" })
|
|
5092
5145
|
] }) }) })
|
|
5093
5146
|
] });
|
|
@@ -5117,7 +5170,7 @@ const Fn = ({
|
|
|
5117
5170
|
] }),
|
|
5118
5171
|
/* @__PURE__ */ o("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "12px", marginBottom: "20px" }, children: [
|
|
5119
5172
|
/* @__PURE__ */ r(ht, { icon: "questions", label: "Questions", value: String(i.totalQuestionCount) }),
|
|
5120
|
-
/* @__PURE__ */ r(ht, { icon: "time", label: "Time Limit", value:
|
|
5173
|
+
/* @__PURE__ */ r(ht, { icon: "time", label: "Time Limit", value: kt(i.testDurationSec) }),
|
|
5121
5174
|
/* @__PURE__ */ r(ht, { icon: "target", label: "Pass Requirement", value: `${i.testCorrectAnswerPassLimit} correct` }),
|
|
5122
5175
|
/* @__PURE__ */ r(
|
|
5123
5176
|
ht,
|
|
@@ -5161,7 +5214,7 @@ const Fn = ({
|
|
|
5161
5214
|
/* @__PURE__ */ r(Z, { type: "button", onClick: V, disabled: Y <= 0, children: "Start Test" })
|
|
5162
5215
|
] }) })
|
|
5163
5216
|
] });
|
|
5164
|
-
const me = i.appropriatenessQuestions[ee],
|
|
5217
|
+
const me = i.appropriatenessQuestions[ee], ve = ee === we - 1, F = pe === we, U = T <= 60;
|
|
5165
5218
|
return /* @__PURE__ */ o(re, { children: [
|
|
5166
5219
|
/* @__PURE__ */ o(Se, { children: [
|
|
5167
5220
|
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
@@ -5171,7 +5224,7 @@ const Fn = ({
|
|
|
5171
5224
|
"Question ",
|
|
5172
5225
|
ee + 1,
|
|
5173
5226
|
" of ",
|
|
5174
|
-
|
|
5227
|
+
we
|
|
5175
5228
|
] })
|
|
5176
5229
|
] }),
|
|
5177
5230
|
/* @__PURE__ */ o("div", { style: {
|
|
@@ -5206,7 +5259,7 @@ const Fn = ({
|
|
|
5206
5259
|
fontVariantNumeric: "tabular-nums",
|
|
5207
5260
|
color: U ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-text-primary, #111827)",
|
|
5208
5261
|
transition: "color 0.3s ease"
|
|
5209
|
-
}, children:
|
|
5262
|
+
}, children: kt(T) })
|
|
5210
5263
|
] })
|
|
5211
5264
|
] }),
|
|
5212
5265
|
/* @__PURE__ */ o("div", { style: { marginTop: "12px" }, children: [
|
|
@@ -5219,7 +5272,7 @@ const Fn = ({
|
|
|
5219
5272
|
height: "100%",
|
|
5220
5273
|
borderRadius: "999px",
|
|
5221
5274
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
5222
|
-
width: `${pe /
|
|
5275
|
+
width: `${pe / we * 100}%`,
|
|
5223
5276
|
transition: "width 0.3s ease"
|
|
5224
5277
|
} }) }),
|
|
5225
5278
|
/* @__PURE__ */ o("div", { style: {
|
|
@@ -5242,7 +5295,7 @@ const Fn = ({
|
|
|
5242
5295
|
] }),
|
|
5243
5296
|
/* @__PURE__ */ o(ne, { children: [
|
|
5244
5297
|
me && /* @__PURE__ */ r(
|
|
5245
|
-
|
|
5298
|
+
On,
|
|
5246
5299
|
{
|
|
5247
5300
|
question: me,
|
|
5248
5301
|
index: ee,
|
|
@@ -5251,23 +5304,23 @@ const Fn = ({
|
|
|
5251
5304
|
disabled: y
|
|
5252
5305
|
}
|
|
5253
5306
|
),
|
|
5254
|
-
|
|
5307
|
+
we > 1 && /* @__PURE__ */ r("div", { style: {
|
|
5255
5308
|
display: "flex",
|
|
5256
5309
|
justifyContent: "center",
|
|
5257
5310
|
gap: "6px",
|
|
5258
5311
|
marginTop: "20px",
|
|
5259
5312
|
flexWrap: "wrap"
|
|
5260
|
-
}, children: i.appropriatenessQuestions.map((B,
|
|
5313
|
+
}, children: i.appropriatenessQuestions.map((B, H) => /* @__PURE__ */ r(
|
|
5261
5314
|
"button",
|
|
5262
5315
|
{
|
|
5263
5316
|
type: "button",
|
|
5264
|
-
onClick: () => E(
|
|
5317
|
+
onClick: () => E(H),
|
|
5265
5318
|
style: {
|
|
5266
5319
|
width: "28px",
|
|
5267
5320
|
height: "28px",
|
|
5268
5321
|
borderRadius: "8px",
|
|
5269
|
-
border:
|
|
5270
|
-
backgroundColor: v[B.id] ?
|
|
5322
|
+
border: H === ee ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
|
|
5323
|
+
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)",
|
|
5271
5324
|
color: v[B.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
5272
5325
|
fontSize: "12px",
|
|
5273
5326
|
fontWeight: 600,
|
|
@@ -5278,7 +5331,7 @@ const Fn = ({
|
|
|
5278
5331
|
alignItems: "center",
|
|
5279
5332
|
justifyContent: "center"
|
|
5280
5333
|
},
|
|
5281
|
-
children:
|
|
5334
|
+
children: H + 1
|
|
5282
5335
|
},
|
|
5283
5336
|
B.id
|
|
5284
5337
|
)) }),
|
|
@@ -5320,7 +5373,7 @@ const Fn = ({
|
|
|
5320
5373
|
}
|
|
5321
5374
|
),
|
|
5322
5375
|
/* @__PURE__ */ o("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
5323
|
-
!
|
|
5376
|
+
!ve && /* @__PURE__ */ r(
|
|
5324
5377
|
Z,
|
|
5325
5378
|
{
|
|
5326
5379
|
type: "button",
|
|
@@ -5328,7 +5381,7 @@ const Fn = ({
|
|
|
5328
5381
|
children: "Next"
|
|
5329
5382
|
}
|
|
5330
5383
|
),
|
|
5331
|
-
(
|
|
5384
|
+
(ve || F) && /* @__PURE__ */ r(
|
|
5332
5385
|
Z,
|
|
5333
5386
|
{
|
|
5334
5387
|
type: "button",
|
|
@@ -5342,7 +5395,7 @@ const Fn = ({
|
|
|
5342
5395
|
] })
|
|
5343
5396
|
] }) })
|
|
5344
5397
|
] });
|
|
5345
|
-
},
|
|
5398
|
+
}, Mn = {
|
|
5346
5399
|
questions: /* @__PURE__ */ o("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5347
5400
|
/* @__PURE__ */ r("path", { d: "M9 11l3 3L22 4" }),
|
|
5348
5401
|
/* @__PURE__ */ r("path", { d: "M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" })
|
|
@@ -5374,7 +5427,7 @@ const Fn = ({
|
|
|
5374
5427
|
/* @__PURE__ */ r("div", { style: {
|
|
5375
5428
|
color: i ? "#f59e0b" : "var(--metakyc-primary, #2563eb)",
|
|
5376
5429
|
flexShrink: 0
|
|
5377
|
-
}, children:
|
|
5430
|
+
}, children: Mn[e] }),
|
|
5378
5431
|
/* @__PURE__ */ o("div", { children: [
|
|
5379
5432
|
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0 }, children: t }),
|
|
5380
5433
|
/* @__PURE__ */ r("p", { style: {
|
|
@@ -5386,7 +5439,7 @@ const Fn = ({
|
|
|
5386
5439
|
}, children: n })
|
|
5387
5440
|
] })
|
|
5388
5441
|
] });
|
|
5389
|
-
},
|
|
5442
|
+
}, On = ({ question: e, selectedAnswer: t, onSelect: n, disabled: a }) => /* @__PURE__ */ o("div", { children: [
|
|
5390
5443
|
/* @__PURE__ */ o("div", { style: { marginBottom: "16px" }, children: [
|
|
5391
5444
|
e.groupName && /* @__PURE__ */ r("span", { style: {
|
|
5392
5445
|
display: "inline-block",
|
|
@@ -5468,15 +5521,15 @@ const Fn = ({
|
|
|
5468
5521
|
s
|
|
5469
5522
|
);
|
|
5470
5523
|
}) })
|
|
5471
|
-
] }),
|
|
5524
|
+
] }), zn = ({
|
|
5472
5525
|
applicantId: e,
|
|
5473
5526
|
onComplete: t,
|
|
5474
5527
|
onBack: n
|
|
5475
5528
|
}) => {
|
|
5476
|
-
var
|
|
5477
|
-
const { applicantService: a, baseInformationService: i, identityService: s, config: c, currentTheme: d } = Te(), { identityData: y, provider: p, token: b, isLoading: P, error: v, requestIdentity: A, restartIdentity: T } =
|
|
5529
|
+
var Xe, He, ot, Qe;
|
|
5530
|
+
const { applicantService: a, baseInformationService: i, identityService: s, config: c, currentTheme: d } = Te(), { identityData: y, provider: p, token: b, isLoading: P, error: v, requestIdentity: A, restartIdentity: T } = tn(e), [w, N] = k(null), [z, Q] = k(null), [M, j] = k([]), [K, ee] = k([]), [E, g] = k(!0), [$, V] = k(!1), [G, _] = k(null), [J, ie] = k(!1), Y = ke.useRef(!1), [we, pe] = k({}), [me, ve] = k({}), F = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, U = !!(d != null && d.reviewPageDisabled), B = de(!1);
|
|
5478
5531
|
B.current = U;
|
|
5479
|
-
const
|
|
5532
|
+
const H = Zt({
|
|
5480
5533
|
defaultValues: {
|
|
5481
5534
|
street: "",
|
|
5482
5535
|
streetNumber: "",
|
|
@@ -5502,7 +5555,7 @@ const Fn = ({
|
|
|
5502
5555
|
]);
|
|
5503
5556
|
Q(O);
|
|
5504
5557
|
const X = /* @__PURE__ */ new Set(), m = q.map((f) => ({ value: f.abbreviation3 || f.abbreviation, label: f.name })).filter((f) => !f.value || X.has(f.value) ? !1 : (X.add(f.value), !0));
|
|
5505
|
-
|
|
5558
|
+
j(m);
|
|
5506
5559
|
const I = /* @__PURE__ */ new Set(), L = W.filter((f) => f.countryCode).map((f) => ({ value: f.countryCode, label: `${f.countryCode} – ${f.name}` })).filter((f) => I.has(f.value) ? !1 : (I.add(f.value), !0));
|
|
5507
5560
|
ee(L);
|
|
5508
5561
|
const u = O.applicantRequestData;
|
|
@@ -5528,7 +5581,7 @@ const Fn = ({
|
|
|
5528
5581
|
occupation: (u == null ? void 0 : u.occupation) || "",
|
|
5529
5582
|
taxNumber: (u == null ? void 0 : u.taxNumber) || "",
|
|
5530
5583
|
defaultLanguage: (u == null ? void 0 : u.defaultLanguage) || ""
|
|
5531
|
-
}),
|
|
5584
|
+
}), H.reset({
|
|
5532
5585
|
street: (u == null ? void 0 : u.street) || "",
|
|
5533
5586
|
streetNumber: (u == null ? void 0 : u.streetNumber) || "",
|
|
5534
5587
|
city: (u == null ? void 0 : u.city) || "",
|
|
@@ -5584,9 +5637,9 @@ const Fn = ({
|
|
|
5584
5637
|
if (fe) {
|
|
5585
5638
|
console.log("[Sumsub] Fetching access token for Web SDK…"), _(null), (async () => {
|
|
5586
5639
|
try {
|
|
5587
|
-
const O = await s.refreshSumsubToken(e), q =
|
|
5640
|
+
const O = await s.refreshSumsubToken(e), q = Je.parseProviderConfig(p, b, c);
|
|
5588
5641
|
q.accessToken = O, q.onTokenRefresh = () => s.refreshSumsubToken(e);
|
|
5589
|
-
const W =
|
|
5642
|
+
const W = Je.createProvider(p, q);
|
|
5590
5643
|
W.onComplete((X) => {
|
|
5591
5644
|
console.log("[Sumsub] Verification complete:", X), t == null || t();
|
|
5592
5645
|
}), W.onError((X) => {
|
|
@@ -5604,8 +5657,8 @@ const Fn = ({
|
|
|
5604
5657
|
if (new URL(b.url), h === Oe.SardinAI) {
|
|
5605
5658
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
5606
5659
|
try {
|
|
5607
|
-
const O =
|
|
5608
|
-
|
|
5660
|
+
const O = Je.parseProviderConfig(p, b, c);
|
|
5661
|
+
Je.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));
|
|
5609
5662
|
} catch (O) {
|
|
5610
5663
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", O);
|
|
5611
5664
|
}
|
|
@@ -5619,7 +5672,7 @@ const Fn = ({
|
|
|
5619
5672
|
if (h === Oe.SardinAI) {
|
|
5620
5673
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), _(null);
|
|
5621
5674
|
try {
|
|
5622
|
-
const O =
|
|
5675
|
+
const O = Je.parseProviderConfig(p, b, c), q = Je.createProvider(p, O);
|
|
5623
5676
|
q.initialize().then(() => {
|
|
5624
5677
|
console.log("[SardinAI] Risk SDK initialized successfully"), N(q), setTimeout(() => t == null ? void 0 : t(), 2e3);
|
|
5625
5678
|
}).catch((W) => {
|
|
@@ -5635,7 +5688,7 @@ const Fn = ({
|
|
|
5635
5688
|
}
|
|
5636
5689
|
try {
|
|
5637
5690
|
_(null);
|
|
5638
|
-
const O =
|
|
5691
|
+
const O = Je.parseProviderConfig(p, b, c), q = Je.createProvider(p, O);
|
|
5639
5692
|
h === Oe.Onfido && q.initialize("identity-container").catch((W) => {
|
|
5640
5693
|
console.error("[Onfido] Initialization error:", W), _(`Failed to initialize: ${W.message}`);
|
|
5641
5694
|
}), N(q);
|
|
@@ -5860,7 +5913,7 @@ const Fn = ({
|
|
|
5860
5913
|
return String(O);
|
|
5861
5914
|
}, $e = ({ helpText: h }) => {
|
|
5862
5915
|
const [O, q] = k(!1), W = de(null), [, X] = k({ top: 0, left: 0 });
|
|
5863
|
-
return /* @__PURE__ */ o(
|
|
5916
|
+
return /* @__PURE__ */ o(ct, { children: [
|
|
5864
5917
|
/* @__PURE__ */ r(
|
|
5865
5918
|
"button",
|
|
5866
5919
|
{
|
|
@@ -5895,7 +5948,7 @@ const Fn = ({
|
|
|
5895
5948
|
children: "?"
|
|
5896
5949
|
}
|
|
5897
5950
|
),
|
|
5898
|
-
O &&
|
|
5951
|
+
O && Jt.createPortal(
|
|
5899
5952
|
/* @__PURE__ */ r(
|
|
5900
5953
|
"div",
|
|
5901
5954
|
{
|
|
@@ -5955,7 +6008,7 @@ const Fn = ({
|
|
|
5955
6008
|
}, Ie = (h, O) => O ? /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
|
|
5956
6009
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: h }),
|
|
5957
6010
|
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r($e, { helpText: O }) })
|
|
5958
|
-
] }) : h,
|
|
6011
|
+
] }) : h, je = (h, O) => {
|
|
5959
6012
|
const q = `cf-${O}`, W = h.paramName ?? "", X = me[W];
|
|
5960
6013
|
if (h.customType === "br")
|
|
5961
6014
|
return /* @__PURE__ */ r("div", { style: { ...oe(h.colSpan), minHeight: "0.5rem" } }, q);
|
|
@@ -5997,21 +6050,14 @@ const Fn = ({
|
|
|
5997
6050
|
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Ie(
|
|
5998
6051
|
/* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5999
6052
|
/* @__PURE__ */ r(
|
|
6000
|
-
|
|
6053
|
+
Be,
|
|
6001
6054
|
{
|
|
6002
|
-
type: "checkbox",
|
|
6003
6055
|
checked: !!m,
|
|
6004
|
-
onChange: (I) =>
|
|
6005
|
-
style: {
|
|
6006
|
-
width: 16,
|
|
6007
|
-
height: 16,
|
|
6008
|
-
flexShrink: 0,
|
|
6009
|
-
marginTop: 2,
|
|
6010
|
-
accentColor: "var(--metakyc-primary, #6366f1)"
|
|
6011
|
-
}
|
|
6056
|
+
onChange: (I) => ve((L) => ({ ...L, [W]: String(I) })),
|
|
6057
|
+
style: { marginTop: 2 }
|
|
6012
6058
|
}
|
|
6013
6059
|
),
|
|
6014
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.customType === "link_checkbox" && h.linkUrl ? /* @__PURE__ */ o(
|
|
6060
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.customType === "link_checkbox" && h.linkUrl ? /* @__PURE__ */ o(ct, { children: [
|
|
6015
6061
|
/* @__PURE__ */ r("a", { href: h.linkUrl, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--metakyc-primary, #6366f1)", textDecoration: "underline" }, children: h.linkText || h.label }),
|
|
6016
6062
|
h.label && h.linkText ? ` ${h.label}` : ""
|
|
6017
6063
|
] }) : h.displayText || h.label })
|
|
@@ -6021,7 +6067,7 @@ const Fn = ({
|
|
|
6021
6067
|
}
|
|
6022
6068
|
if (h.customType === "group_checkbox") {
|
|
6023
6069
|
const m = Array.isArray(X) ? X : X ? [X] : [], I = (L) => {
|
|
6024
|
-
h.singleSelect ?
|
|
6070
|
+
h.singleSelect ? ve((u) => ({ ...u, [W]: m[0] === L ? [] : [L] })) : ve((u) => ({
|
|
6025
6071
|
...u,
|
|
6026
6072
|
[W]: m.includes(L) ? m.filter((l) => l !== L) : [...m, L]
|
|
6027
6073
|
}));
|
|
@@ -6031,12 +6077,11 @@ const Fn = ({
|
|
|
6031
6077
|
h.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.displayText || h.label }),
|
|
6032
6078
|
(h.options || []).map((L) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
6033
6079
|
/* @__PURE__ */ r(
|
|
6034
|
-
|
|
6080
|
+
Be,
|
|
6035
6081
|
{
|
|
6036
|
-
type: "checkbox",
|
|
6037
6082
|
checked: m.includes(L.value),
|
|
6038
6083
|
onChange: () => I(L.value),
|
|
6039
|
-
style: {
|
|
6084
|
+
style: { marginTop: 2 }
|
|
6040
6085
|
}
|
|
6041
6086
|
),
|
|
6042
6087
|
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: L.label })
|
|
@@ -6056,7 +6101,7 @@ const Fn = ({
|
|
|
6056
6101
|
name: `rg-${W}`,
|
|
6057
6102
|
value: m.value,
|
|
6058
6103
|
checked: X === m.value,
|
|
6059
|
-
onChange: () =>
|
|
6104
|
+
onChange: () => ve((I) => ({ ...I, [W]: m.value })),
|
|
6060
6105
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
6061
6106
|
}
|
|
6062
6107
|
),
|
|
@@ -6070,17 +6115,17 @@ const Fn = ({
|
|
|
6070
6115
|
{
|
|
6071
6116
|
label: h.displayText || h.label || W,
|
|
6072
6117
|
value: String(X ?? ""),
|
|
6073
|
-
onChange: (m) =>
|
|
6118
|
+
onChange: (m) => ve((I) => ({ ...I, [W]: m.target.value }))
|
|
6074
6119
|
}
|
|
6075
6120
|
),
|
|
6076
6121
|
h.helpText
|
|
6077
6122
|
) }, q);
|
|
6078
|
-
},
|
|
6079
|
-
if (h.isCustom) return
|
|
6080
|
-
const q = h.name ?? "", W =
|
|
6123
|
+
}, it = (h, O) => {
|
|
6124
|
+
if (h.isCustom) return je(h, O);
|
|
6125
|
+
const q = h.name ?? "", W = at[q], X = h.displayText || (W == null ? void 0 : W.label) || q, m = we[q] ?? "", I = q === "mobileCountryCode", L = !!(W != null && W.countriesType) && !I;
|
|
6081
6126
|
return h.editable ? I ? /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Ie(
|
|
6082
6127
|
/* @__PURE__ */ r(
|
|
6083
|
-
|
|
6128
|
+
Ve,
|
|
6084
6129
|
{
|
|
6085
6130
|
label: X,
|
|
6086
6131
|
value: String(m),
|
|
@@ -6091,7 +6136,7 @@ const Fn = ({
|
|
|
6091
6136
|
h.helpText
|
|
6092
6137
|
) }, `epc-${O}`) : L ? /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Ie(
|
|
6093
6138
|
/* @__PURE__ */ r(
|
|
6094
|
-
|
|
6139
|
+
Ve,
|
|
6095
6140
|
{
|
|
6096
6141
|
label: X,
|
|
6097
6142
|
value: String(m),
|
|
@@ -6112,7 +6157,7 @@ const Fn = ({
|
|
|
6112
6157
|
),
|
|
6113
6158
|
h.helpText
|
|
6114
6159
|
) }, `ei-${O}`) : /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Ie(
|
|
6115
|
-
/* @__PURE__ */ o(
|
|
6160
|
+
/* @__PURE__ */ o(ct, { children: [
|
|
6116
6161
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: X }),
|
|
6117
6162
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Ne(q, m) })
|
|
6118
6163
|
] }),
|
|
@@ -6128,23 +6173,23 @@ const Fn = ({
|
|
|
6128
6173
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h }),
|
|
6129
6174
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: O })
|
|
6130
6175
|
] }),
|
|
6131
|
-
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: F.fields.map((q, W) =>
|
|
6176
|
+
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: F.fields.map((q, W) => it(q, W)) }) }),
|
|
6132
6177
|
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
6133
6178
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
6134
6179
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: P, children: "Confirm and Start Verification" })
|
|
6135
6180
|
] })
|
|
6136
6181
|
] }) });
|
|
6137
6182
|
}
|
|
6138
|
-
return /* @__PURE__ */ r("form", { onSubmit:
|
|
6183
|
+
return /* @__PURE__ */ r("form", { onSubmit: H.handleSubmit(R), children: /* @__PURE__ */ o(re, { children: [
|
|
6139
6184
|
/* @__PURE__ */ o(Se, { children: [
|
|
6140
6185
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
|
|
6141
6186
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please review and confirm your information before starting identity verification" })
|
|
6142
6187
|
] }),
|
|
6143
6188
|
/* @__PURE__ */ o(ne, { className: "space-y-6", children: [
|
|
6144
6189
|
/* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
6145
|
-
{ label: "Name", value: `${((
|
|
6146
|
-
{ label: "Email", value: (
|
|
6147
|
-
{ label: "Date of Birth", value: ((
|
|
6190
|
+
{ label: "Name", value: `${((Xe = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Xe.firstName) || ""} ${((He = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : He.lastName) || ""}`.trim() },
|
|
6191
|
+
{ label: "Email", value: (ot = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : ot.email },
|
|
6192
|
+
{ label: "Date of Birth", value: ((Qe = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Qe.dateOfBirth) || "Not provided" }
|
|
6148
6193
|
].map(({ label: h, value: O }) => /* @__PURE__ */ o("div", { children: [
|
|
6149
6194
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: h }),
|
|
6150
6195
|
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: O })
|
|
@@ -6153,12 +6198,12 @@ const Fn = ({
|
|
|
6153
6198
|
/* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
|
|
6154
6199
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6155
6200
|
/* @__PURE__ */ r(
|
|
6156
|
-
|
|
6201
|
+
tt,
|
|
6157
6202
|
{
|
|
6158
|
-
control:
|
|
6203
|
+
control: H.control,
|
|
6159
6204
|
name: "country",
|
|
6160
6205
|
render: ({ field: h }) => /* @__PURE__ */ r(
|
|
6161
|
-
|
|
6206
|
+
Ve,
|
|
6162
6207
|
{
|
|
6163
6208
|
label: "Country",
|
|
6164
6209
|
value: h.value,
|
|
@@ -6169,12 +6214,12 @@ const Fn = ({
|
|
|
6169
6214
|
}
|
|
6170
6215
|
),
|
|
6171
6216
|
/* @__PURE__ */ r(
|
|
6172
|
-
|
|
6217
|
+
tt,
|
|
6173
6218
|
{
|
|
6174
|
-
control:
|
|
6219
|
+
control: H.control,
|
|
6175
6220
|
name: "nationality",
|
|
6176
6221
|
render: ({ field: h }) => /* @__PURE__ */ r(
|
|
6177
|
-
|
|
6222
|
+
Ve,
|
|
6178
6223
|
{
|
|
6179
6224
|
label: "Nationality",
|
|
6180
6225
|
value: h.value,
|
|
@@ -6186,14 +6231,14 @@ const Fn = ({
|
|
|
6186
6231
|
)
|
|
6187
6232
|
] }),
|
|
6188
6233
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6189
|
-
/* @__PURE__ */ r(
|
|
6190
|
-
/* @__PURE__ */ r(
|
|
6234
|
+
/* @__PURE__ */ r(tt, { control: H.control, name: "street", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Street" }) }),
|
|
6235
|
+
/* @__PURE__ */ r(tt, { control: H.control, name: "streetNumber", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Street Number" }) })
|
|
6191
6236
|
] }),
|
|
6192
6237
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6193
|
-
/* @__PURE__ */ r(
|
|
6194
|
-
/* @__PURE__ */ r(
|
|
6238
|
+
/* @__PURE__ */ r(tt, { control: H.control, name: "city", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "City" }) }),
|
|
6239
|
+
/* @__PURE__ */ r(tt, { control: H.control, name: "zip", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "ZIP / Postal Code" }) })
|
|
6195
6240
|
] }),
|
|
6196
|
-
/* @__PURE__ */ r(
|
|
6241
|
+
/* @__PURE__ */ r(tt, { control: H.control, name: "phonenumber", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Phone Number", type: "tel" }) })
|
|
6197
6242
|
] })
|
|
6198
6243
|
] }),
|
|
6199
6244
|
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
@@ -6201,7 +6246,7 @@ const Fn = ({
|
|
|
6201
6246
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: P, children: "Confirm and Start Verification" })
|
|
6202
6247
|
] })
|
|
6203
6248
|
] }) });
|
|
6204
|
-
},
|
|
6249
|
+
}, Dt = ({
|
|
6205
6250
|
kycStatus: e,
|
|
6206
6251
|
reviewStatus: t,
|
|
6207
6252
|
workflowResult: n,
|
|
@@ -6209,42 +6254,42 @@ const Fn = ({
|
|
|
6209
6254
|
onContinue: i,
|
|
6210
6255
|
onContactSupport: s
|
|
6211
6256
|
}) => {
|
|
6212
|
-
const d = e ===
|
|
6257
|
+
const d = e === rt.Approved ? {
|
|
6213
6258
|
type: "success",
|
|
6214
6259
|
title: "Verification Approved",
|
|
6215
6260
|
icon: "✓",
|
|
6216
6261
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
6217
6262
|
iconColor: "text-green-600 dark:text-green-400",
|
|
6218
6263
|
message: "Your identity verification has been successfully approved."
|
|
6219
|
-
} : e ===
|
|
6264
|
+
} : e === rt.Rejected ? {
|
|
6220
6265
|
type: "error",
|
|
6221
6266
|
title: "Verification Rejected",
|
|
6222
6267
|
icon: "✕",
|
|
6223
6268
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
6224
6269
|
iconColor: "text-red-600 dark:text-red-400",
|
|
6225
6270
|
message: "Unfortunately, your identity verification was not approved."
|
|
6226
|
-
} : e ===
|
|
6271
|
+
} : e === rt.Pending || e === rt.InProgress ? {
|
|
6227
6272
|
type: "pending",
|
|
6228
6273
|
title: "Verification Pending",
|
|
6229
6274
|
icon: "⏱",
|
|
6230
6275
|
iconBg: "bg-blue-100 dark:bg-blue-900/30",
|
|
6231
6276
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
6232
6277
|
message: "Your identity verification is currently being processed."
|
|
6233
|
-
} : t ===
|
|
6278
|
+
} : t === nt.Approved ? {
|
|
6234
6279
|
type: "success",
|
|
6235
6280
|
title: "Application Approved",
|
|
6236
6281
|
icon: "✓",
|
|
6237
6282
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
6238
6283
|
iconColor: "text-green-600 dark:text-green-400",
|
|
6239
6284
|
message: "Your application has been approved."
|
|
6240
|
-
} : t ===
|
|
6285
|
+
} : t === nt.Reject ? {
|
|
6241
6286
|
type: "error",
|
|
6242
6287
|
title: "Application Rejected",
|
|
6243
6288
|
icon: "✕",
|
|
6244
6289
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
6245
6290
|
iconColor: "text-red-600 dark:text-red-400",
|
|
6246
6291
|
message: "Your application has been rejected."
|
|
6247
|
-
} : t ===
|
|
6292
|
+
} : t === nt.UnderReview || t === nt.AdminReview ? {
|
|
6248
6293
|
type: "pending",
|
|
6249
6294
|
title: "Under Review",
|
|
6250
6295
|
icon: "📋",
|
|
@@ -6291,10 +6336,10 @@ const Fn = ({
|
|
|
6291
6336
|
) }),
|
|
6292
6337
|
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center mb-4", style: { color: "var(--metakyc-text-primary, #111827)" }, children: d.title }),
|
|
6293
6338
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
6294
|
-
|
|
6339
|
+
_t,
|
|
6295
6340
|
{
|
|
6296
6341
|
variant: d.type === "success" ? "success" : d.type === "error" ? "danger" : d.type === "pending" ? "warning" : "info",
|
|
6297
|
-
children: e != null ?
|
|
6342
|
+
children: e != null ? rt[e] : nt[t]
|
|
6298
6343
|
}
|
|
6299
6344
|
) }),
|
|
6300
6345
|
/* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a || d.message }),
|
|
@@ -6326,24 +6371,24 @@ const Fn = ({
|
|
|
6326
6371
|
/* @__PURE__ */ r("div", { className: "mt-6 pt-6", style: { borderTop: "1px solid var(--metakyc-border, #e5e7eb)" }, children: /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
6327
6372
|
/* @__PURE__ */ o("div", { children: [
|
|
6328
6373
|
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "KYC Status:" }),
|
|
6329
|
-
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ?
|
|
6374
|
+
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ? rt[e] : "Not Available" })
|
|
6330
6375
|
] }),
|
|
6331
6376
|
/* @__PURE__ */ o("div", { children: [
|
|
6332
6377
|
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Review Status:" }),
|
|
6333
|
-
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
6378
|
+
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: nt[t] })
|
|
6334
6379
|
] })
|
|
6335
6380
|
] }) })
|
|
6336
6381
|
] }),
|
|
6337
6382
|
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "center", gap: "1rem" }, children: [
|
|
6338
6383
|
d.type === "success" && i && /* @__PURE__ */ r(Z, { onClick: i, size: "lg", children: "Continue" }),
|
|
6339
|
-
d.type === "error" && /* @__PURE__ */ o(
|
|
6384
|
+
d.type === "error" && /* @__PURE__ */ o(ct, { children: [
|
|
6340
6385
|
s && /* @__PURE__ */ r(Z, { variant: "outline", onClick: s, children: "Contact Support" }),
|
|
6341
6386
|
i && /* @__PURE__ */ r(Z, { onClick: i, children: "Try Again" })
|
|
6342
6387
|
] }),
|
|
6343
6388
|
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" }) })
|
|
6344
6389
|
] })
|
|
6345
6390
|
] });
|
|
6346
|
-
},
|
|
6391
|
+
}, $n = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ r("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ r(
|
|
6347
6392
|
"img",
|
|
6348
6393
|
{
|
|
6349
6394
|
src: e.url,
|
|
@@ -6371,7 +6416,7 @@ const Fn = ({
|
|
|
6371
6416
|
className: "metakyc-header-title flex items-center text-xl font-bold",
|
|
6372
6417
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
6373
6418
|
children: [
|
|
6374
|
-
s && /* @__PURE__ */ r(
|
|
6419
|
+
s && /* @__PURE__ */ r($n, { config: a.logo }),
|
|
6375
6420
|
s && c && /* @__PURE__ */ r(
|
|
6376
6421
|
"span",
|
|
6377
6422
|
{
|
|
@@ -6386,10 +6431,10 @@ const Fn = ({
|
|
|
6386
6431
|
t && /* @__PURE__ */ r("p", { className: "text-sm mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: t })
|
|
6387
6432
|
] });
|
|
6388
6433
|
}, ft = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
6389
|
-
function
|
|
6434
|
+
function lt(e) {
|
|
6390
6435
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
6391
6436
|
}
|
|
6392
|
-
const
|
|
6437
|
+
const Bn = {
|
|
6393
6438
|
width: "16px",
|
|
6394
6439
|
height: "16px",
|
|
6395
6440
|
minWidth: "16px",
|
|
@@ -6401,9 +6446,9 @@ const pt = {
|
|
|
6401
6446
|
padding: 0,
|
|
6402
6447
|
display: "inline-block",
|
|
6403
6448
|
verticalAlign: "middle"
|
|
6404
|
-
},
|
|
6405
|
-
const [n, a] =
|
|
6406
|
-
if (!e) return /* @__PURE__ */ r(
|
|
6449
|
+
}, Mt = ({ helpText: e, children: t }) => {
|
|
6450
|
+
const [n, a] = ke.useState(!1);
|
|
6451
|
+
if (!e) return /* @__PURE__ */ r(ct, { children: t });
|
|
6407
6452
|
const i = n ? /* @__PURE__ */ r(
|
|
6408
6453
|
"div",
|
|
6409
6454
|
{
|
|
@@ -6520,16 +6565,16 @@ const pt = {
|
|
|
6520
6565
|
children: "?"
|
|
6521
6566
|
}
|
|
6522
6567
|
),
|
|
6523
|
-
typeof document < "u" && i ?
|
|
6568
|
+
typeof document < "u" && i ? Ct(i, document.body) : null
|
|
6524
6569
|
] });
|
|
6525
|
-
},
|
|
6570
|
+
}, ia = ({
|
|
6526
6571
|
workflowKey: e,
|
|
6527
6572
|
externalRefId: t,
|
|
6528
6573
|
onSuccess: n,
|
|
6529
6574
|
onCancel: a
|
|
6530
6575
|
}) => {
|
|
6531
6576
|
var q, W, X, m, I, L, u;
|
|
6532
|
-
const { config: i, baseInformationService: s, currentTheme: c } = Te(), { createApplicant: d, isLoading: y } =
|
|
6577
|
+
const { config: i, baseInformationService: s, currentTheme: c } = Te(), { createApplicant: d, isLoading: y } = Bt(), p = e || ((q = i.applicantForm) == null ? void 0 : q.workflowKey);
|
|
6533
6578
|
if (!p)
|
|
6534
6579
|
throw new Error(
|
|
6535
6580
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
@@ -6553,7 +6598,7 @@ const pt = {
|
|
|
6553
6598
|
return Array.from(C);
|
|
6554
6599
|
}
|
|
6555
6600
|
let l;
|
|
6556
|
-
(D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l =
|
|
6601
|
+
(D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l = ur;
|
|
6557
6602
|
const f = new Set(l);
|
|
6558
6603
|
for (const x of ft) f.add(x);
|
|
6559
6604
|
return Array.from(f);
|
|
@@ -6564,26 +6609,26 @@ const pt = {
|
|
|
6564
6609
|
"countryOfBirth",
|
|
6565
6610
|
"mobileCountryCode",
|
|
6566
6611
|
"otherNationality"
|
|
6567
|
-
]),
|
|
6612
|
+
]), j = De(() => {
|
|
6568
6613
|
var f, D;
|
|
6569
6614
|
const l = /* @__PURE__ */ new Set();
|
|
6570
6615
|
if (N)
|
|
6571
6616
|
for (const x of N)
|
|
6572
6617
|
for (const C of x.fields)
|
|
6573
|
-
!C.isCustom && C.name && M.has(C.name) && l.add(C.countriesType ?? ((f =
|
|
6618
|
+
!C.isCustom && C.name && M.has(C.name) && l.add(C.countriesType ?? ((f = at[C.name]) == null ? void 0 : f.countriesType));
|
|
6574
6619
|
else
|
|
6575
6620
|
for (const x of Q)
|
|
6576
|
-
M.has(x) && l.add((D =
|
|
6621
|
+
M.has(x) && l.add((D = at[x]) == null ? void 0 : D.countriesType);
|
|
6577
6622
|
return l.size === 0 && l.add(void 0), Array.from(l);
|
|
6578
6623
|
}, [Q, N]), [K, ee] = k({}), [E, g] = k(!0), $ = de(/* @__PURE__ */ new Set()), V = de(/* @__PURE__ */ new Set());
|
|
6579
6624
|
ge(() => {
|
|
6580
6625
|
if (!c) return;
|
|
6581
|
-
const l =
|
|
6626
|
+
const l = j.filter((x) => {
|
|
6582
6627
|
const C = x != null ? String(x) : "all";
|
|
6583
6628
|
return !V.current.has(C) && !$.current.has(C);
|
|
6584
6629
|
});
|
|
6585
6630
|
if (l.length === 0) {
|
|
6586
|
-
|
|
6631
|
+
j.every((C) => {
|
|
6587
6632
|
const S = C != null ? String(C) : "all";
|
|
6588
6633
|
return V.current.has(S);
|
|
6589
6634
|
}) && g(!1);
|
|
@@ -6606,16 +6651,16 @@ const pt = {
|
|
|
6606
6651
|
} catch (x) {
|
|
6607
6652
|
f.forEach((C) => $.current.delete(C)), console.error("Failed to load countries:", x);
|
|
6608
6653
|
} finally {
|
|
6609
|
-
|
|
6654
|
+
j.every((C) => {
|
|
6610
6655
|
const S = C != null ? String(C) : "all";
|
|
6611
6656
|
return V.current.has(S);
|
|
6612
6657
|
}) && g(!1);
|
|
6613
6658
|
}
|
|
6614
6659
|
})();
|
|
6615
|
-
}, [
|
|
6660
|
+
}, [j, c]);
|
|
6616
6661
|
const G = (l, f) => {
|
|
6617
6662
|
var C;
|
|
6618
|
-
const D = f ?? ((C =
|
|
6663
|
+
const D = f ?? ((C = at[l]) == null ? void 0 : C.countriesType), x = D != null ? String(D) : "all";
|
|
6619
6664
|
return K[x] || [];
|
|
6620
6665
|
}, _ = {
|
|
6621
6666
|
firstName: 1,
|
|
@@ -6644,7 +6689,7 @@ const pt = {
|
|
|
6644
6689
|
Object.entries(v).filter(([l]) => l in _)
|
|
6645
6690
|
), ie = Object.fromEntries(
|
|
6646
6691
|
Object.entries(A).filter(([l]) => l in _)
|
|
6647
|
-
), [Y,
|
|
6692
|
+
), [Y, we] = k({
|
|
6648
6693
|
workflowKey: p,
|
|
6649
6694
|
firstName: "",
|
|
6650
6695
|
lastName: "",
|
|
@@ -6673,7 +6718,7 @@ const pt = {
|
|
|
6673
6718
|
...ie
|
|
6674
6719
|
}), pe = Object.fromEntries(
|
|
6675
6720
|
Object.entries(v).filter(([l]) => !(l in J) && l !== "externalRefId" && l !== "workflowKey")
|
|
6676
|
-
), [me,
|
|
6721
|
+
), [me, ve] = k({ ...pe }), [F, U] = k(0), [B, H] = k({}), [fe, R] = k(null), [te, ye] = k(!1), oe = (l, f) => we((D) => ({ ...D, [l]: f })), Ne = (l, f) => ve((D) => ({ ...D, [l]: f })), $e = (l) => !l.conditionalOn || me[l.conditionalOn] === "true", Ie = N && F < N.length - 1 ? F + 1 : -1, je = N && F > 0 ? F - 1 : -1, it = (l) => {
|
|
6677
6722
|
var D;
|
|
6678
6723
|
const f = {};
|
|
6679
6724
|
for (const x of l.fields)
|
|
@@ -6685,32 +6730,32 @@ const pt = {
|
|
|
6685
6730
|
}
|
|
6686
6731
|
} else if (x.name) {
|
|
6687
6732
|
const C = x.name;
|
|
6688
|
-
if (z.includes(C) &&
|
|
6689
|
-
const S = x.displayText || ((D =
|
|
6733
|
+
if (z.includes(C) && lt(Y[C])) {
|
|
6734
|
+
const S = x.displayText || ((D = at[C]) == null ? void 0 : D.label) || C;
|
|
6690
6735
|
f[C] = `${S} is required.`;
|
|
6691
6736
|
}
|
|
6692
6737
|
}
|
|
6693
6738
|
return f;
|
|
6694
|
-
},
|
|
6739
|
+
}, Xe = async () => {
|
|
6695
6740
|
if (!N) return;
|
|
6696
6741
|
const l = N[F];
|
|
6697
6742
|
if (l.conditionalOn && !$e(l)) {
|
|
6698
|
-
|
|
6743
|
+
H({}), Ie >= 0 ? U(Ie) : await He();
|
|
6699
6744
|
return;
|
|
6700
6745
|
}
|
|
6701
|
-
const f =
|
|
6746
|
+
const f = it(l);
|
|
6702
6747
|
if (Object.keys(f).length > 0) {
|
|
6703
|
-
|
|
6748
|
+
H(f);
|
|
6704
6749
|
return;
|
|
6705
6750
|
}
|
|
6706
|
-
|
|
6751
|
+
H({}), Ie >= 0 ? U(Ie) : await He();
|
|
6707
6752
|
}, He = async () => {
|
|
6708
6753
|
if (N) {
|
|
6709
6754
|
let l = {};
|
|
6710
6755
|
for (const f of N)
|
|
6711
|
-
$e(f) && (l = { ...l, ...
|
|
6756
|
+
$e(f) && (l = { ...l, ...it(f) });
|
|
6712
6757
|
if (Object.keys(l).length > 0) {
|
|
6713
|
-
|
|
6758
|
+
H(l);
|
|
6714
6759
|
return;
|
|
6715
6760
|
}
|
|
6716
6761
|
}
|
|
@@ -6730,19 +6775,19 @@ const pt = {
|
|
|
6730
6775
|
for (const S of C.fields)
|
|
6731
6776
|
if (!S.isCustom && S.name) {
|
|
6732
6777
|
const ue = S.name, se = Y[ue];
|
|
6733
|
-
|
|
6778
|
+
lt(se) || (l[ue] = se);
|
|
6734
6779
|
}
|
|
6735
6780
|
}
|
|
6736
6781
|
for (const C of ft)
|
|
6737
6782
|
if (l[C] === void 0) {
|
|
6738
6783
|
const S = Y[C];
|
|
6739
|
-
|
|
6784
|
+
lt(S) || (l[C] = S);
|
|
6740
6785
|
}
|
|
6741
6786
|
} else
|
|
6742
6787
|
Q.forEach((C) => {
|
|
6743
6788
|
if (C === "externalRefId") return;
|
|
6744
6789
|
const S = Y[C];
|
|
6745
|
-
|
|
6790
|
+
lt(S) || (l[C] = S);
|
|
6746
6791
|
});
|
|
6747
6792
|
const f = [];
|
|
6748
6793
|
if (N) {
|
|
@@ -6759,7 +6804,7 @@ const pt = {
|
|
|
6759
6804
|
}
|
|
6760
6805
|
}
|
|
6761
6806
|
for (const [C, S] of Object.entries(J))
|
|
6762
|
-
l[C] === void 0 && !
|
|
6807
|
+
l[C] === void 0 && !lt(S) && (l[C] = S);
|
|
6763
6808
|
const D = new Set(f.map((C) => C.paramName));
|
|
6764
6809
|
for (const [C, S] of Object.entries(pe))
|
|
6765
6810
|
!D.has(C) && S && f.push({ paramName: C, value: S });
|
|
@@ -6771,33 +6816,33 @@ const pt = {
|
|
|
6771
6816
|
} finally {
|
|
6772
6817
|
ye(!1);
|
|
6773
6818
|
}
|
|
6774
|
-
},
|
|
6819
|
+
}, ot = async (l) => {
|
|
6775
6820
|
var f;
|
|
6776
6821
|
l.preventDefault();
|
|
6777
6822
|
for (const D of z)
|
|
6778
|
-
if (
|
|
6779
|
-
const x = ((f =
|
|
6823
|
+
if (lt(Y[D])) {
|
|
6824
|
+
const x = ((f = at[D]) == null ? void 0 : f.label) || D;
|
|
6780
6825
|
R(`${x} is required.`);
|
|
6781
6826
|
return;
|
|
6782
6827
|
}
|
|
6783
6828
|
await He();
|
|
6784
|
-
},
|
|
6785
|
-
var
|
|
6786
|
-
const S =
|
|
6829
|
+
}, Qe = (l, f, D, x, C) => {
|
|
6830
|
+
var It;
|
|
6831
|
+
const S = at[l];
|
|
6787
6832
|
if (!S) return null;
|
|
6788
|
-
const ue = z.includes(l), se = B[l], be = D || S.label, Pe = l in ie, le = f ?? l,
|
|
6833
|
+
const ue = z.includes(l), se = B[l], be = D || S.label, Pe = l in ie, le = f ?? l, _e = { required: ue }, We = C ? C !== "placeholder" : w, Ge = We ? be : void 0, Kt = We ? "..." : be;
|
|
6789
6834
|
switch (S.type) {
|
|
6790
6835
|
case "select":
|
|
6791
6836
|
if (l === "country" || l === "nationality" || l === "taxCountry" || l === "countryOfBirth" || l === "mobileCountryCode") {
|
|
6792
6837
|
const Re = G(l, x);
|
|
6793
6838
|
return /* @__PURE__ */ r(
|
|
6794
|
-
|
|
6839
|
+
Ve,
|
|
6795
6840
|
{
|
|
6796
|
-
...
|
|
6797
|
-
label:
|
|
6841
|
+
..._e,
|
|
6842
|
+
label: Ge,
|
|
6798
6843
|
value: Y[l] || "",
|
|
6799
|
-
onChange: (
|
|
6800
|
-
options: [{ value: "", label: `Select ${
|
|
6844
|
+
onChange: (et) => oe(l, et),
|
|
6845
|
+
options: [{ value: "", label: `Select ${Kt.toLowerCase()}` }, ...Re],
|
|
6801
6846
|
disabled: E,
|
|
6802
6847
|
readOnly: Pe,
|
|
6803
6848
|
error: se
|
|
@@ -6807,14 +6852,14 @@ const pt = {
|
|
|
6807
6852
|
}
|
|
6808
6853
|
if (l === "salutation")
|
|
6809
6854
|
return /* @__PURE__ */ r(
|
|
6810
|
-
|
|
6855
|
+
Ve,
|
|
6811
6856
|
{
|
|
6812
|
-
...
|
|
6813
|
-
label:
|
|
6814
|
-
value: ((
|
|
6857
|
+
..._e,
|
|
6858
|
+
label: Ge,
|
|
6859
|
+
value: ((It = Y[l]) == null ? void 0 : It.toString()) || "",
|
|
6815
6860
|
onChange: (Re) => oe(l, Re ? Number(Re) : null),
|
|
6816
6861
|
options: [
|
|
6817
|
-
{ value: "", label:
|
|
6862
|
+
{ value: "", label: We ? "Select salutation..." : be },
|
|
6818
6863
|
{ value: bt.Male.toString(), label: "Male" },
|
|
6819
6864
|
{ value: bt.Female.toString(), label: "Female" },
|
|
6820
6865
|
{ value: bt.Other.toString(), label: "Other" }
|
|
@@ -6825,15 +6870,15 @@ const pt = {
|
|
|
6825
6870
|
le
|
|
6826
6871
|
);
|
|
6827
6872
|
if (l === "defaultLanguage") {
|
|
6828
|
-
const Re = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ?
|
|
6873
|
+
const Re = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? Et.filter((et) => c.allowedLanguages.includes(et.value)) : Et;
|
|
6829
6874
|
return /* @__PURE__ */ r(
|
|
6830
|
-
|
|
6875
|
+
Ve,
|
|
6831
6876
|
{
|
|
6832
|
-
...
|
|
6833
|
-
label:
|
|
6877
|
+
..._e,
|
|
6878
|
+
label: Ge,
|
|
6834
6879
|
value: Y[l] || "",
|
|
6835
|
-
onChange: (
|
|
6836
|
-
options: [{ value: "", label:
|
|
6880
|
+
onChange: (et) => oe(l, et),
|
|
6881
|
+
options: [{ value: "", label: We ? "Select language..." : be }, ...Re],
|
|
6837
6882
|
readOnly: Pe,
|
|
6838
6883
|
error: se
|
|
6839
6884
|
},
|
|
@@ -6845,14 +6890,14 @@ const pt = {
|
|
|
6845
6890
|
if (l === "otherNationality") {
|
|
6846
6891
|
const Re = G(l, x);
|
|
6847
6892
|
return /* @__PURE__ */ r(
|
|
6848
|
-
|
|
6893
|
+
sn,
|
|
6849
6894
|
{
|
|
6850
|
-
...
|
|
6851
|
-
label:
|
|
6895
|
+
..._e,
|
|
6896
|
+
label: Ge,
|
|
6852
6897
|
value: Y[l] || [],
|
|
6853
|
-
onChange: (
|
|
6898
|
+
onChange: (et) => oe(l, et),
|
|
6854
6899
|
options: Re,
|
|
6855
|
-
placeholder:
|
|
6900
|
+
placeholder: We ? "Select other nationalities..." : be,
|
|
6856
6901
|
disabled: E,
|
|
6857
6902
|
readOnly: Pe
|
|
6858
6903
|
},
|
|
@@ -6864,10 +6909,10 @@ const pt = {
|
|
|
6864
6909
|
return /* @__PURE__ */ r(
|
|
6865
6910
|
xe,
|
|
6866
6911
|
{
|
|
6867
|
-
...
|
|
6912
|
+
..._e,
|
|
6868
6913
|
type: "date",
|
|
6869
|
-
label:
|
|
6870
|
-
placeholder:
|
|
6914
|
+
label: Ge,
|
|
6915
|
+
placeholder: We ? void 0 : be,
|
|
6871
6916
|
value: Y[l] || "",
|
|
6872
6917
|
onChange: (Re) => oe(l, Re.target.value),
|
|
6873
6918
|
readOnly: Pe,
|
|
@@ -6879,10 +6924,10 @@ const pt = {
|
|
|
6879
6924
|
return /* @__PURE__ */ r(
|
|
6880
6925
|
xe,
|
|
6881
6926
|
{
|
|
6882
|
-
...
|
|
6927
|
+
..._e,
|
|
6883
6928
|
type: "email",
|
|
6884
|
-
label:
|
|
6885
|
-
placeholder:
|
|
6929
|
+
label: Ge,
|
|
6930
|
+
placeholder: We ? void 0 : be,
|
|
6886
6931
|
value: Y[l] || "",
|
|
6887
6932
|
onChange: (Re) => oe(l, Re.target.value),
|
|
6888
6933
|
readOnly: Pe,
|
|
@@ -6894,10 +6939,10 @@ const pt = {
|
|
|
6894
6939
|
return /* @__PURE__ */ r(
|
|
6895
6940
|
xe,
|
|
6896
6941
|
{
|
|
6897
|
-
...
|
|
6942
|
+
..._e,
|
|
6898
6943
|
type: "tel",
|
|
6899
|
-
label:
|
|
6900
|
-
placeholder:
|
|
6944
|
+
label: Ge,
|
|
6945
|
+
placeholder: We ? void 0 : be,
|
|
6901
6946
|
value: Y[l] || "",
|
|
6902
6947
|
onChange: (Re) => oe(l, Re.target.value),
|
|
6903
6948
|
readOnly: Pe,
|
|
@@ -6909,10 +6954,10 @@ const pt = {
|
|
|
6909
6954
|
return /* @__PURE__ */ r(
|
|
6910
6955
|
xe,
|
|
6911
6956
|
{
|
|
6912
|
-
...
|
|
6957
|
+
..._e,
|
|
6913
6958
|
type: "text",
|
|
6914
|
-
label:
|
|
6915
|
-
placeholder:
|
|
6959
|
+
label: Ge,
|
|
6960
|
+
placeholder: We ? void 0 : be,
|
|
6916
6961
|
value: Y[l] || "",
|
|
6917
6962
|
onChange: (Re) => oe(l, Re.target.value),
|
|
6918
6963
|
readOnly: Pe,
|
|
@@ -6985,13 +7030,10 @@ const pt = {
|
|
|
6985
7030
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
|
|
6986
7031
|
children: [
|
|
6987
7032
|
/* @__PURE__ */ r(
|
|
6988
|
-
|
|
7033
|
+
Be,
|
|
6989
7034
|
{
|
|
6990
|
-
type: "checkbox",
|
|
6991
7035
|
checked: me[l.paramName] === "true",
|
|
6992
|
-
onChange: (S) => Ne(l.paramName, S
|
|
6993
|
-
className: "metakyc-option-input",
|
|
6994
|
-
style: pt
|
|
7036
|
+
onChange: (S) => Ne(l.paramName, S ? "true" : "false")
|
|
6995
7037
|
}
|
|
6996
7038
|
),
|
|
6997
7039
|
/* @__PURE__ */ o(
|
|
@@ -7019,13 +7061,10 @@ const pt = {
|
|
|
7019
7061
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
|
|
7020
7062
|
children: [
|
|
7021
7063
|
/* @__PURE__ */ r(
|
|
7022
|
-
|
|
7064
|
+
Be,
|
|
7023
7065
|
{
|
|
7024
|
-
type: "checkbox",
|
|
7025
7066
|
checked: me[l.paramName] === "true",
|
|
7026
|
-
onChange: (S) => Ne(l.paramName, S
|
|
7027
|
-
className: "metakyc-option-input",
|
|
7028
|
-
style: { ...pt, alignSelf: "flex-start", marginTop: "2px" }
|
|
7067
|
+
onChange: (S) => Ne(l.paramName, S ? "true" : "false")
|
|
7029
7068
|
}
|
|
7030
7069
|
),
|
|
7031
7070
|
/* @__PURE__ */ o(
|
|
@@ -7080,20 +7119,17 @@ const pt = {
|
|
|
7080
7119
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
|
|
7081
7120
|
children: [
|
|
7082
7121
|
/* @__PURE__ */ r(
|
|
7083
|
-
|
|
7122
|
+
Be,
|
|
7084
7123
|
{
|
|
7085
|
-
type: "checkbox",
|
|
7086
7124
|
checked: se,
|
|
7087
7125
|
onChange: (be) => {
|
|
7088
7126
|
if (l.singleSelect)
|
|
7089
|
-
Ne(l.paramName, be
|
|
7127
|
+
Ne(l.paramName, be ? ue.value : "");
|
|
7090
7128
|
else {
|
|
7091
|
-
const Pe = be
|
|
7129
|
+
const Pe = be ? [...S, ue.value] : S.filter((le) => le !== ue.value);
|
|
7092
7130
|
Ne(l.paramName, Pe.join(","));
|
|
7093
7131
|
}
|
|
7094
|
-
}
|
|
7095
|
-
className: "metakyc-option-input",
|
|
7096
|
-
style: pt
|
|
7132
|
+
}
|
|
7097
7133
|
}
|
|
7098
7134
|
),
|
|
7099
7135
|
/* @__PURE__ */ r(
|
|
@@ -7138,7 +7174,7 @@ const pt = {
|
|
|
7138
7174
|
onChange: () => Ne(l.paramName, S.value),
|
|
7139
7175
|
name: `radio-group-${l.paramName}-${f}`,
|
|
7140
7176
|
className: "metakyc-option-input",
|
|
7141
|
-
style:
|
|
7177
|
+
style: Bn
|
|
7142
7178
|
}
|
|
7143
7179
|
),
|
|
7144
7180
|
/* @__PURE__ */ r(
|
|
@@ -7170,20 +7206,17 @@ const pt = {
|
|
|
7170
7206
|
}, O = (l, f) => {
|
|
7171
7207
|
const D = $e(l);
|
|
7172
7208
|
return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
7173
|
-
l.conditionalOn && /* @__PURE__ */ r(
|
|
7209
|
+
l.conditionalOn && /* @__PURE__ */ r(Mt, { helpText: l.conditionalHelpText, children: /* @__PURE__ */ o(
|
|
7174
7210
|
"label",
|
|
7175
7211
|
{
|
|
7176
7212
|
className: "metakyc-option-label",
|
|
7177
7213
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
|
|
7178
7214
|
children: [
|
|
7179
7215
|
/* @__PURE__ */ r(
|
|
7180
|
-
|
|
7216
|
+
Be,
|
|
7181
7217
|
{
|
|
7182
|
-
type: "checkbox",
|
|
7183
7218
|
checked: D,
|
|
7184
|
-
onChange: (x) => Ne(l.conditionalOn, x
|
|
7185
|
-
className: "metakyc-option-input",
|
|
7186
|
-
style: pt
|
|
7219
|
+
onChange: (x) => Ne(l.conditionalOn, x ? "true" : "false")
|
|
7187
7220
|
}
|
|
7188
7221
|
),
|
|
7189
7222
|
/* @__PURE__ */ r(
|
|
@@ -7199,7 +7232,7 @@ const pt = {
|
|
|
7199
7232
|
) }),
|
|
7200
7233
|
D && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: l.fields.map((x, C) => {
|
|
7201
7234
|
const S = Math.min(4, Math.max(1, Number(x.colSpan) || 4)), ue = x.isCustom ? `custom-${C}-${x.paramName}` : `builtin-${x.name}-${C}`;
|
|
7202
|
-
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${S} / span ${S}` }, children: /* @__PURE__ */ r(
|
|
7235
|
+
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${S} / span ${S}` }, children: /* @__PURE__ */ r(Mt, { helpText: x.helpText, children: x.isCustom ? h(x, C) : Qe(x.name, ue, x.displayText, x.countriesType, x.labelMode) }) }, ue);
|
|
7203
7236
|
}) })
|
|
7204
7237
|
] });
|
|
7205
7238
|
};
|
|
@@ -7209,7 +7242,7 @@ const pt = {
|
|
|
7209
7242
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7210
7243
|
] }) }) });
|
|
7211
7244
|
if (N) {
|
|
7212
|
-
const l = N[F] ?? N[0], f =
|
|
7245
|
+
const l = N[F] ?? N[0], f = je === -1, D = Ie === -1, x = N.length, C = $e(l), S = Object.values(B);
|
|
7213
7246
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(re, { children: [
|
|
7214
7247
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7215
7248
|
/* @__PURE__ */ o(ne, { children: [
|
|
@@ -7276,7 +7309,7 @@ const pt = {
|
|
|
7276
7309
|
type: "button",
|
|
7277
7310
|
variant: "outline",
|
|
7278
7311
|
onClick: () => {
|
|
7279
|
-
U(
|
|
7312
|
+
U(je), H({});
|
|
7280
7313
|
},
|
|
7281
7314
|
disabled: te || y,
|
|
7282
7315
|
children: "Previous"
|
|
@@ -7289,14 +7322,14 @@ const pt = {
|
|
|
7289
7322
|
{
|
|
7290
7323
|
type: "button",
|
|
7291
7324
|
isLoading: te || y,
|
|
7292
|
-
onClick: D ? He :
|
|
7325
|
+
onClick: D ? He : Xe,
|
|
7293
7326
|
children: D ? l.conditionalOn && !C ? "Skip & Submit" : "Submit" : l.conditionalOn && !C ? "Skip" : "Next"
|
|
7294
7327
|
}
|
|
7295
7328
|
)
|
|
7296
7329
|
] })
|
|
7297
7330
|
] }) });
|
|
7298
7331
|
}
|
|
7299
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit:
|
|
7332
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: ot, children: /* @__PURE__ */ o(re, { children: [
|
|
7300
7333
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7301
7334
|
/* @__PURE__ */ o(ne, { children: [
|
|
7302
7335
|
fe && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
@@ -7304,25 +7337,25 @@ const pt = {
|
|
|
7304
7337
|
" ",
|
|
7305
7338
|
fe
|
|
7306
7339
|
] }) }),
|
|
7307
|
-
/* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: Q.map((l) => /* @__PURE__ */ r("div", { style: { gridColumn: "span 4 / span 4" }, children:
|
|
7340
|
+
/* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: Q.map((l) => /* @__PURE__ */ r("div", { style: { gridColumn: "span 4 / span 4" }, children: Qe(l) }, l)) })
|
|
7308
7341
|
] }),
|
|
7309
7342
|
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
7310
7343
|
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || y, children: "Cancel" }),
|
|
7311
7344
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: te || y, children: "Create Applicant" })
|
|
7312
7345
|
] })
|
|
7313
7346
|
] }) }) });
|
|
7314
|
-
},
|
|
7315
|
-
function
|
|
7347
|
+
}, Ot = ["companyName", "email"];
|
|
7348
|
+
function wt(e) {
|
|
7316
7349
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
7317
7350
|
}
|
|
7318
|
-
const
|
|
7351
|
+
const oa = ({
|
|
7319
7352
|
workflowKey: e,
|
|
7320
7353
|
externalRefId: t,
|
|
7321
7354
|
onSuccess: n,
|
|
7322
7355
|
onCancel: a
|
|
7323
7356
|
}) => {
|
|
7324
|
-
var
|
|
7325
|
-
const { config: i, baseInformationService: s, currentTheme: c } = Te(), { createCompanyApplicant: d, isLoading: y } =
|
|
7357
|
+
var Qe, h, O, q, W, X;
|
|
7358
|
+
const { config: i, baseInformationService: s, currentTheme: c } = Te(), { createCompanyApplicant: d, isLoading: y } = Bt(), p = e || ((Qe = i.applicantForm) == null ? void 0 : Qe.workflowKey);
|
|
7326
7359
|
if (!p)
|
|
7327
7360
|
throw new Error(
|
|
7328
7361
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
@@ -7331,7 +7364,7 @@ const ea = ({
|
|
|
7331
7364
|
() => c != null && c.companyFormPages && c.companyFormPages.length > 0 ? c.companyFormPages : null,
|
|
7332
7365
|
[c == null ? void 0 : c.companyFormPages]
|
|
7333
7366
|
), N = De(() => {
|
|
7334
|
-
const m = new Set(
|
|
7367
|
+
const m = new Set(Ot), I = c == null ? void 0 : c.companyFormRequiredFields;
|
|
7335
7368
|
if (I) for (const L of I) m.add(L);
|
|
7336
7369
|
if (w)
|
|
7337
7370
|
for (const L of w)
|
|
@@ -7342,22 +7375,22 @@ const ea = ({
|
|
|
7342
7375
|
var m;
|
|
7343
7376
|
if (w) {
|
|
7344
7377
|
const I = w.flatMap((u) => u.fields).filter((u) => !u.isCustom && u.name).map((u) => u.name), L = new Set(I);
|
|
7345
|
-
for (const u of
|
|
7378
|
+
for (const u of Ot) L.add(u);
|
|
7346
7379
|
return Array.from(L);
|
|
7347
7380
|
}
|
|
7348
|
-
return (m = i.applicantForm) != null && m.visibleFields ? i.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields :
|
|
7381
|
+
return (m = i.applicantForm) != null && m.visibleFields ? i.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields : dr;
|
|
7349
7382
|
}, [(X = i.applicantForm) == null ? void 0 : X.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, w]), Q = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M = De(() => {
|
|
7350
7383
|
var I, L;
|
|
7351
7384
|
const m = /* @__PURE__ */ new Set();
|
|
7352
7385
|
if (w)
|
|
7353
7386
|
for (const u of w)
|
|
7354
7387
|
for (const l of u.fields)
|
|
7355
|
-
!l.isCustom && l.name && Q.has(l.name) && m.add(l.countriesType ?? ((I =
|
|
7388
|
+
!l.isCustom && l.name && Q.has(l.name) && m.add(l.countriesType ?? ((I = st[l.name]) == null ? void 0 : I.countriesType));
|
|
7356
7389
|
else
|
|
7357
7390
|
for (const u of z)
|
|
7358
|
-
Q.has(u) && m.add((L =
|
|
7391
|
+
Q.has(u) && m.add((L = st[u]) == null ? void 0 : L.countriesType);
|
|
7359
7392
|
return m.size === 0 && m.add(void 0), Array.from(m);
|
|
7360
|
-
}, [z, w]), [
|
|
7393
|
+
}, [z, w]), [j, K] = k({}), [ee, E] = k(!0), g = de(/* @__PURE__ */ new Set()), $ = de(/* @__PURE__ */ new Set());
|
|
7361
7394
|
ge(() => {
|
|
7362
7395
|
if (!c) return;
|
|
7363
7396
|
const m = M.filter((u) => {
|
|
@@ -7388,8 +7421,8 @@ const ea = ({
|
|
|
7388
7421
|
}, [M, c]);
|
|
7389
7422
|
const V = (m, I) => {
|
|
7390
7423
|
var l;
|
|
7391
|
-
const L = I ?? ((l =
|
|
7392
|
-
return
|
|
7424
|
+
const L = I ?? ((l = st[m]) == null ? void 0 : l.countriesType), u = L != null ? String(L) : "all";
|
|
7425
|
+
return j[u] || [];
|
|
7393
7426
|
}, G = {
|
|
7394
7427
|
companyName: 1,
|
|
7395
7428
|
registrationNumber: 1,
|
|
@@ -7435,7 +7468,7 @@ const ea = ({
|
|
|
7435
7468
|
lei: "",
|
|
7436
7469
|
externalRefId: b,
|
|
7437
7470
|
..._
|
|
7438
|
-
}), [Y,
|
|
7471
|
+
}), [Y, we] = k({}), [pe, me] = k(0), [ve, F] = k({}), [U, B] = k(null), [H, fe] = k(!1), R = (m, I) => ie((L) => ({ ...L, [m]: I })), te = (m, I) => we((L) => ({ ...L, [m]: I })), ye = (m) => !m.conditionalOn || Y[m.conditionalOn] === "true", oe = w && pe < w.length - 1 ? pe + 1 : -1, Ne = w && pe > 0 ? pe - 1 : -1, $e = (m) => {
|
|
7439
7472
|
var L;
|
|
7440
7473
|
const I = {};
|
|
7441
7474
|
for (const u of m.fields)
|
|
@@ -7447,8 +7480,8 @@ const ea = ({
|
|
|
7447
7480
|
}
|
|
7448
7481
|
} else if (u.name) {
|
|
7449
7482
|
const l = u.name;
|
|
7450
|
-
if (N.includes(l) &&
|
|
7451
|
-
const f = u.displayText || ((L =
|
|
7483
|
+
if (N.includes(l) && wt(J[l])) {
|
|
7484
|
+
const f = u.displayText || ((L = st[l]) == null ? void 0 : L.label) || l;
|
|
7452
7485
|
I[l] = `${f} is required.`;
|
|
7453
7486
|
}
|
|
7454
7487
|
}
|
|
@@ -7457,7 +7490,7 @@ const ea = ({
|
|
|
7457
7490
|
if (!w) return;
|
|
7458
7491
|
const m = w[pe];
|
|
7459
7492
|
if (m.conditionalOn && !ye(m)) {
|
|
7460
|
-
F({}), oe >= 0 ? me(oe) : await
|
|
7493
|
+
F({}), oe >= 0 ? me(oe) : await je();
|
|
7461
7494
|
return;
|
|
7462
7495
|
}
|
|
7463
7496
|
const I = $e(m);
|
|
@@ -7465,8 +7498,8 @@ const ea = ({
|
|
|
7465
7498
|
F(I);
|
|
7466
7499
|
return;
|
|
7467
7500
|
}
|
|
7468
|
-
F({}), oe >= 0 ? me(oe) : await
|
|
7469
|
-
},
|
|
7501
|
+
F({}), oe >= 0 ? me(oe) : await je();
|
|
7502
|
+
}, je = async () => {
|
|
7470
7503
|
var m;
|
|
7471
7504
|
if (w) {
|
|
7472
7505
|
let I = {};
|
|
@@ -7485,7 +7518,7 @@ const ea = ({
|
|
|
7485
7518
|
}, L = w ? w.filter((f) => ye(f)).flatMap((f) => f.fields).filter((f) => !f.isCustom && f.name).map((f) => f.name) : z;
|
|
7486
7519
|
for (const f of L) {
|
|
7487
7520
|
const D = J[f];
|
|
7488
|
-
if (!
|
|
7521
|
+
if (!wt(D))
|
|
7489
7522
|
switch (f) {
|
|
7490
7523
|
case "companyName":
|
|
7491
7524
|
I.companyName = D;
|
|
@@ -7538,31 +7571,31 @@ const ea = ({
|
|
|
7538
7571
|
} finally {
|
|
7539
7572
|
fe(!1);
|
|
7540
7573
|
}
|
|
7541
|
-
},
|
|
7574
|
+
}, it = async (m) => {
|
|
7542
7575
|
var I;
|
|
7543
7576
|
m.preventDefault();
|
|
7544
7577
|
for (const L of N)
|
|
7545
|
-
if (
|
|
7546
|
-
const u = ((I =
|
|
7578
|
+
if (wt(J[L])) {
|
|
7579
|
+
const u = ((I = st[L]) == null ? void 0 : I.label) || L;
|
|
7547
7580
|
B(`${u} is required.`);
|
|
7548
7581
|
return;
|
|
7549
7582
|
}
|
|
7550
|
-
await
|
|
7551
|
-
},
|
|
7552
|
-
const f =
|
|
7583
|
+
await je();
|
|
7584
|
+
}, Xe = (m, I, L, u, l) => {
|
|
7585
|
+
const f = st[m];
|
|
7553
7586
|
if (!f) return null;
|
|
7554
|
-
const D = N.includes(m), x =
|
|
7587
|
+
const D = N.includes(m), x = ve[m], C = L || f.label, S = m in _, ue = I ?? m, se = l ? l !== "placeholder" : T, be = se ? C : void 0, Pe = se ? "..." : C;
|
|
7555
7588
|
switch (f.type) {
|
|
7556
7589
|
case "select":
|
|
7557
7590
|
if (m === "countryResidence" || m === "addressCountry") {
|
|
7558
7591
|
const le = V(m, u);
|
|
7559
7592
|
return /* @__PURE__ */ r(
|
|
7560
|
-
|
|
7593
|
+
Ve,
|
|
7561
7594
|
{
|
|
7562
7595
|
required: D,
|
|
7563
7596
|
label: be,
|
|
7564
7597
|
value: J[m] || "",
|
|
7565
|
-
onChange: (
|
|
7598
|
+
onChange: (_e) => R(m, _e),
|
|
7566
7599
|
options: [{ value: "", label: `Select ${Pe.toLowerCase()}` }, ...le],
|
|
7567
7600
|
disabled: ee,
|
|
7568
7601
|
readOnly: S,
|
|
@@ -7659,16 +7692,14 @@ const ea = ({
|
|
|
7659
7692
|
}
|
|
7660
7693
|
) }, `custom-${I}`);
|
|
7661
7694
|
if (!m.paramName) return null;
|
|
7662
|
-
const L =
|
|
7695
|
+
const L = ve[m.paramName], u = m.displayText || m.label || m.paramName, l = m.labelMode ? m.labelMode !== "placeholder" : T;
|
|
7663
7696
|
return m.customType === "checkbox" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
7664
7697
|
/* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
7665
7698
|
/* @__PURE__ */ r(
|
|
7666
|
-
|
|
7699
|
+
Be,
|
|
7667
7700
|
{
|
|
7668
|
-
type: "checkbox",
|
|
7669
7701
|
checked: Y[m.paramName] === "true",
|
|
7670
|
-
onChange: (f) => te(m.paramName, f
|
|
7671
|
-
style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
|
|
7702
|
+
onChange: (f) => te(m.paramName, f ? "true" : "false")
|
|
7672
7703
|
}
|
|
7673
7704
|
),
|
|
7674
7705
|
/* @__PURE__ */ o("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
@@ -7690,24 +7721,22 @@ const ea = ({
|
|
|
7690
7721
|
},
|
|
7691
7722
|
`custom-${I}`
|
|
7692
7723
|
);
|
|
7693
|
-
},
|
|
7724
|
+
}, ot = (m) => {
|
|
7694
7725
|
const I = ye(m);
|
|
7695
7726
|
return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
7696
7727
|
m.conditionalOn && /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
7697
7728
|
/* @__PURE__ */ r(
|
|
7698
|
-
|
|
7729
|
+
Be,
|
|
7699
7730
|
{
|
|
7700
|
-
type: "checkbox",
|
|
7701
7731
|
checked: I,
|
|
7702
|
-
onChange: (L) => te(m.conditionalOn, L
|
|
7703
|
-
style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
|
|
7732
|
+
onChange: (L) => te(m.conditionalOn, L ? "true" : "false")
|
|
7704
7733
|
}
|
|
7705
7734
|
),
|
|
7706
7735
|
/* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: m.conditionalOn })
|
|
7707
7736
|
] }),
|
|
7708
7737
|
I && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: m.fields.map((L, u) => {
|
|
7709
7738
|
const l = Math.min(4, Math.max(1, Number(L.colSpan) || 4)), f = L.isCustom ? `custom-${u}-${L.paramName}` : `builtin-${L.name}-${u}`;
|
|
7710
|
-
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${l} / span ${l}` }, children: L.isCustom ? He(L, u) :
|
|
7739
|
+
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${l} / span ${l}` }, children: L.isCustom ? He(L, u) : Xe(L.name, f, L.displayText, L.countriesType, L.labelMode) }, f);
|
|
7711
7740
|
}) })
|
|
7712
7741
|
] });
|
|
7713
7742
|
};
|
|
@@ -7717,7 +7746,7 @@ const ea = ({
|
|
|
7717
7746
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7718
7747
|
] }) }) });
|
|
7719
7748
|
if (w) {
|
|
7720
|
-
const m = w[pe] ?? w[0], I = Ne === -1, L = oe === -1, u = w.length, l = ye(m), f = Object.values(
|
|
7749
|
+
const m = w[pe] ?? w[0], I = Ne === -1, L = oe === -1, u = w.length, l = ye(m), f = Object.values(ve);
|
|
7721
7750
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(re, { children: [
|
|
7722
7751
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7723
7752
|
/* @__PURE__ */ o(ne, { children: [
|
|
@@ -7752,7 +7781,7 @@ const ea = ({
|
|
|
7752
7781
|
u
|
|
7753
7782
|
] })
|
|
7754
7783
|
] }),
|
|
7755
|
-
|
|
7784
|
+
ot(m)
|
|
7756
7785
|
] }),
|
|
7757
7786
|
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
7758
7787
|
/* @__PURE__ */ o("div", { children: [
|
|
@@ -7764,17 +7793,17 @@ const ea = ({
|
|
|
7764
7793
|
onClick: () => {
|
|
7765
7794
|
me(Ne), F({});
|
|
7766
7795
|
},
|
|
7767
|
-
disabled:
|
|
7796
|
+
disabled: H || y,
|
|
7768
7797
|
children: "Previous"
|
|
7769
7798
|
}
|
|
7770
7799
|
),
|
|
7771
|
-
I && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled:
|
|
7800
|
+
I && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || y, children: "Cancel" })
|
|
7772
7801
|
] }),
|
|
7773
|
-
/* @__PURE__ */ r(Z, { type: "button", isLoading:
|
|
7802
|
+
/* @__PURE__ */ r(Z, { type: "button", isLoading: H || y, onClick: L ? je : Ie, children: L ? m.conditionalOn && !l ? "Skip & Submit" : "Submit" : m.conditionalOn && !l ? "Skip" : "Next" })
|
|
7774
7803
|
] })
|
|
7775
7804
|
] }) });
|
|
7776
7805
|
}
|
|
7777
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit:
|
|
7806
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: it, children: /* @__PURE__ */ o(re, { children: [
|
|
7778
7807
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7779
7808
|
/* @__PURE__ */ o(ne, { children: [
|
|
7780
7809
|
U && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
@@ -7782,14 +7811,14 @@ const ea = ({
|
|
|
7782
7811
|
" ",
|
|
7783
7812
|
U
|
|
7784
7813
|
] }) }),
|
|
7785
|
-
/* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: z.map((m) => /* @__PURE__ */ r("div", { style: { gridColumn: "span 4 / span 4" }, children:
|
|
7814
|
+
/* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: z.map((m) => /* @__PURE__ */ r("div", { style: { gridColumn: "span 4 / span 4" }, children: Xe(m) }, m)) })
|
|
7786
7815
|
] }),
|
|
7787
7816
|
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
7788
|
-
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled:
|
|
7789
|
-
/* @__PURE__ */ r(Z, { type: "submit", isLoading:
|
|
7817
|
+
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || y, children: "Cancel" }),
|
|
7818
|
+
/* @__PURE__ */ r(Z, { type: "submit", isLoading: H || y, children: "Register Company" })
|
|
7790
7819
|
] })
|
|
7791
7820
|
] }) }) });
|
|
7792
|
-
},
|
|
7821
|
+
}, sa = ({
|
|
7793
7822
|
applicantId: e,
|
|
7794
7823
|
onComplete: t,
|
|
7795
7824
|
onError: n,
|
|
@@ -7807,14 +7836,14 @@ const ea = ({
|
|
|
7807
7836
|
error: v,
|
|
7808
7837
|
moveBack: A,
|
|
7809
7838
|
refreshProgress: T
|
|
7810
|
-
} =
|
|
7811
|
-
if (
|
|
7839
|
+
} = Jr(e), [w, N] = ke.useState(!1), z = ke.useRef(null);
|
|
7840
|
+
if (ke.useEffect(() => {
|
|
7812
7841
|
v && n && n(v);
|
|
7813
|
-
}, [v, n]),
|
|
7842
|
+
}, [v, n]), ke.useEffect(() => {
|
|
7814
7843
|
s != null && s.workflowResult && t && t(s.workflowResult);
|
|
7815
|
-
}, [s == null ? void 0 : s.workflowResult, t]),
|
|
7844
|
+
}, [s == null ? void 0 : s.workflowResult, t]), ke.useEffect(() => {
|
|
7816
7845
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
7817
|
-
}, [a]),
|
|
7846
|
+
}, [a]), ke.useEffect(() => {
|
|
7818
7847
|
b && N(!1);
|
|
7819
7848
|
}, [b]), P || !s)
|
|
7820
7849
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ne, { children: [
|
|
@@ -7857,7 +7886,7 @@ const ea = ({
|
|
|
7857
7886
|
] }) }) }) });
|
|
7858
7887
|
if (s.status === ze.Finished || s.status === ze.OnHold)
|
|
7859
7888
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(
|
|
7860
|
-
|
|
7889
|
+
Dt,
|
|
7861
7890
|
{
|
|
7862
7891
|
kycStatus: s.kycStatus,
|
|
7863
7892
|
reviewStatus: s.reviewStatus,
|
|
@@ -7902,7 +7931,7 @@ const ea = ({
|
|
|
7902
7931
|
return /* @__PURE__ */ o("div", { style: { marginBottom: "24px" }, children: [
|
|
7903
7932
|
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
7904
7933
|
/* @__PURE__ */ r(mt, {}),
|
|
7905
|
-
/* @__PURE__ */ o(
|
|
7934
|
+
/* @__PURE__ */ o(_t, { variant: s.status === 1 ? "info" : "success", children: [
|
|
7906
7935
|
"Step ",
|
|
7907
7936
|
E,
|
|
7908
7937
|
" of ",
|
|
@@ -7922,7 +7951,7 @@ const ea = ({
|
|
|
7922
7951
|
transition: "width 0.4s ease"
|
|
7923
7952
|
} }) }) }),
|
|
7924
7953
|
/* @__PURE__ */ r(
|
|
7925
|
-
|
|
7954
|
+
_n,
|
|
7926
7955
|
{
|
|
7927
7956
|
ref: z,
|
|
7928
7957
|
visibleSteps: K,
|
|
@@ -7931,7 +7960,7 @@ const ea = ({
|
|
|
7931
7960
|
}
|
|
7932
7961
|
)
|
|
7933
7962
|
] });
|
|
7934
|
-
},
|
|
7963
|
+
}, j = () => {
|
|
7935
7964
|
const K = {
|
|
7936
7965
|
applicantId: e,
|
|
7937
7966
|
onComplete: async () => {
|
|
@@ -7941,23 +7970,23 @@ const ea = ({
|
|
|
7941
7970
|
};
|
|
7942
7971
|
switch (c.action) {
|
|
7943
7972
|
case ce.Questionaries:
|
|
7944
|
-
return /* @__PURE__ */ r(
|
|
7973
|
+
return /* @__PURE__ */ r(vn, { ...K });
|
|
7945
7974
|
case ce.UploadDocument:
|
|
7946
|
-
return /* @__PURE__ */ r(
|
|
7975
|
+
return /* @__PURE__ */ r(Sn, { ...K });
|
|
7947
7976
|
case ce.Overview:
|
|
7948
|
-
return /* @__PURE__ */ r(
|
|
7977
|
+
return /* @__PURE__ */ r(Cn, { ...K });
|
|
7949
7978
|
case ce.IdentitySdk:
|
|
7950
|
-
return /* @__PURE__ */ r(
|
|
7979
|
+
return /* @__PURE__ */ r(zn, { ...K });
|
|
7951
7980
|
case ce.RiskScoring:
|
|
7952
|
-
return /* @__PURE__ */ r(
|
|
7981
|
+
return /* @__PURE__ */ r(Tn, { ...K });
|
|
7953
7982
|
case ce.AdditionalData:
|
|
7954
7983
|
case ce.InvestorCategorization:
|
|
7955
|
-
return /* @__PURE__ */ r(
|
|
7984
|
+
return /* @__PURE__ */ r(Ln, { ...K });
|
|
7956
7985
|
case ce.AppropriatenessTest:
|
|
7957
|
-
return /* @__PURE__ */ r(
|
|
7986
|
+
return /* @__PURE__ */ r(Dn, { ...K });
|
|
7958
7987
|
case ce.ManualReview:
|
|
7959
7988
|
return /* @__PURE__ */ r(
|
|
7960
|
-
|
|
7989
|
+
Dt,
|
|
7961
7990
|
{
|
|
7962
7991
|
kycStatus: s.kycStatus,
|
|
7963
7992
|
reviewStatus: s.reviewStatus,
|
|
@@ -7981,12 +8010,12 @@ const ea = ({
|
|
|
7981
8010
|
};
|
|
7982
8011
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${i || ""}`, children: [
|
|
7983
8012
|
M(),
|
|
7984
|
-
|
|
8013
|
+
j()
|
|
7985
8014
|
] });
|
|
7986
|
-
},
|
|
8015
|
+
}, _n = ke.forwardRef(
|
|
7987
8016
|
({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: n }, a) => {
|
|
7988
|
-
const i =
|
|
7989
|
-
return
|
|
8017
|
+
const i = ke.useRef(null), s = ke.useRef(null);
|
|
8018
|
+
return ke.useImperativeHandle(a, () => i.current), ke.useEffect(() => {
|
|
7990
8019
|
if (s.current && i.current) {
|
|
7991
8020
|
const c = i.current, d = s.current, y = d.offsetLeft - c.offsetWidth / 2 + d.offsetWidth / 2;
|
|
7992
8021
|
c.scrollTo({ left: Math.max(0, y), behavior: "smooth" });
|
|
@@ -8009,7 +8038,7 @@ const ea = ({
|
|
|
8009
8038
|
},
|
|
8010
8039
|
children: e.map((c, d) => {
|
|
8011
8040
|
const y = d < t, p = d === t, b = y || p, P = c.displayName || c.name || n(c.action) || `Step ${d + 1}`;
|
|
8012
|
-
return /* @__PURE__ */ o(
|
|
8041
|
+
return /* @__PURE__ */ o(ke.Fragment, { children: [
|
|
8013
8042
|
/* @__PURE__ */ o(
|
|
8014
8043
|
"div",
|
|
8015
8044
|
{
|
|
@@ -8068,13 +8097,13 @@ const ea = ({
|
|
|
8068
8097
|
);
|
|
8069
8098
|
}
|
|
8070
8099
|
);
|
|
8071
|
-
function
|
|
8072
|
-
return
|
|
8073
|
-
questionResults:
|
|
8100
|
+
function la(e) {
|
|
8101
|
+
return Ye.object({
|
|
8102
|
+
questionResults: Ye.any()
|
|
8074
8103
|
}).passthrough();
|
|
8075
8104
|
}
|
|
8076
|
-
function
|
|
8077
|
-
let t =
|
|
8105
|
+
function jn(e) {
|
|
8106
|
+
let t = Ye.array(Ye.instanceof(File));
|
|
8078
8107
|
if (e.isRequired ? t = t.min(
|
|
8079
8108
|
1,
|
|
8080
8109
|
`${e.displayName} is required`
|
|
@@ -8095,145 +8124,146 @@ function Mn(e) {
|
|
|
8095
8124
|
}
|
|
8096
8125
|
return t;
|
|
8097
8126
|
}
|
|
8098
|
-
function
|
|
8127
|
+
function ca(e) {
|
|
8099
8128
|
const t = {};
|
|
8100
8129
|
return e.uploadDocumentFiles.forEach((n) => {
|
|
8101
8130
|
const a = `file_${n.id}`;
|
|
8102
|
-
t[a] =
|
|
8103
|
-
}),
|
|
8131
|
+
t[a] = jn(n);
|
|
8132
|
+
}), Ye.object(t);
|
|
8104
8133
|
}
|
|
8105
|
-
function
|
|
8106
|
-
return
|
|
8134
|
+
function da(e) {
|
|
8135
|
+
return Ye.any();
|
|
8107
8136
|
}
|
|
8108
|
-
function
|
|
8109
|
-
return
|
|
8137
|
+
function Hn(e) {
|
|
8138
|
+
return Ye.string().min(1, "This question is required");
|
|
8110
8139
|
}
|
|
8111
|
-
function
|
|
8140
|
+
function ua(e) {
|
|
8112
8141
|
const t = {};
|
|
8113
8142
|
return e.appropriatenessQuestions.forEach((n) => {
|
|
8114
8143
|
const a = `question_${n.id}`;
|
|
8115
|
-
t[a] =
|
|
8116
|
-
}),
|
|
8144
|
+
t[a] = Hn();
|
|
8145
|
+
}), Ye.object(t);
|
|
8117
8146
|
}
|
|
8118
|
-
const
|
|
8147
|
+
const pa = Ye.any();
|
|
8119
8148
|
export {
|
|
8120
|
-
|
|
8121
|
-
|
|
8149
|
+
Et as ALLOWED_LANGUAGES,
|
|
8150
|
+
Xt as ApplicantProgressOnHoldReason,
|
|
8122
8151
|
ze as ApplicantProgressStatus,
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8152
|
+
hr as ApplicantService,
|
|
8153
|
+
tr as ApplicantStatus,
|
|
8154
|
+
or as AppropriatenessQuestionType,
|
|
8155
|
+
br as AppropriatenessTestService,
|
|
8156
|
+
Dn as AppropriatenessTestStep,
|
|
8157
|
+
_t as Badge,
|
|
8158
|
+
wr as BaseInformationService,
|
|
8130
8159
|
Z as Button,
|
|
8131
|
-
|
|
8160
|
+
st as COMPANY_FIELD_METADATA,
|
|
8132
8161
|
re as Card,
|
|
8133
8162
|
ne as CardContent,
|
|
8134
8163
|
Ce as CardFooter,
|
|
8135
8164
|
Se as CardHeader,
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
lr as
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8165
|
+
Be as Checkbox,
|
|
8166
|
+
Ze as CountriesType,
|
|
8167
|
+
ia as CreateApplicantForm,
|
|
8168
|
+
oa as CreateCompanyApplicantForm,
|
|
8169
|
+
lr as CriteriaBuiltInType,
|
|
8170
|
+
dr as DEFAULT_COMPANY_VISIBLE_FIELDS,
|
|
8171
|
+
ur as DEFAULT_VISIBLE_FIELDS,
|
|
8172
|
+
ir as DocumentReviewStatus,
|
|
8173
|
+
mr as EndpointBuilder,
|
|
8174
|
+
ut as ErrorHandler,
|
|
8175
|
+
Tr as EventEmitter,
|
|
8176
|
+
at as FIELD_METADATA,
|
|
8177
|
+
ar as FileType,
|
|
8178
|
+
cn as FileUpload,
|
|
8149
8179
|
bt as GenderType,
|
|
8150
8180
|
mt as Header,
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8181
|
+
yr as HttpClient,
|
|
8182
|
+
Je as IdentityProviderManager,
|
|
8183
|
+
kr as IdentityService,
|
|
8154
8184
|
Oe as IdentityVerificationProvider,
|
|
8155
|
-
|
|
8185
|
+
zn as IdentityVerificationStep,
|
|
8156
8186
|
xe as Input,
|
|
8157
|
-
|
|
8158
|
-
|
|
8187
|
+
Sr as InvestorCategorizationService,
|
|
8188
|
+
Ln as InvestorCategorizationStep,
|
|
8159
8189
|
Ee as InvestorCategorizationType,
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8190
|
+
cr as InvestorCategoryType,
|
|
8191
|
+
rr as KycProcessStatus,
|
|
8192
|
+
rt as KycStatus,
|
|
8193
|
+
Dt as KycStatusDisplay,
|
|
8194
|
+
sa as KycWorkflow,
|
|
8195
|
+
$n as Logo,
|
|
8196
|
+
$t as MetaKYCContext,
|
|
8197
|
+
Ke as MetaKYCError,
|
|
8198
|
+
Zn as MetaKYCProvider,
|
|
8199
|
+
sn as MultiSelect,
|
|
8200
|
+
$r as OnfidoProvider,
|
|
8201
|
+
xr as OverviewService,
|
|
8202
|
+
Cn as OverviewStep,
|
|
8203
|
+
dn as PhoneInput,
|
|
8204
|
+
fr as QuestionnaireService,
|
|
8205
|
+
vn as QuestionnaireStep,
|
|
8206
|
+
nt as ReviewStatus,
|
|
8207
|
+
sr as RiskCriteriaType,
|
|
8208
|
+
er as RiskLevel,
|
|
8209
|
+
vr as RiskScoringService,
|
|
8210
|
+
Tn as RiskScoringStep,
|
|
8211
|
+
Hr as SDK_VERSION,
|
|
8212
|
+
Br as SardinAIProvider,
|
|
8213
|
+
Ve as SearchableSelect,
|
|
8214
|
+
Nt as Select,
|
|
8185
8215
|
Me as Spinner,
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8216
|
+
Lr as StepRouter,
|
|
8217
|
+
zr as SumsubProvider,
|
|
8218
|
+
jr as ThemeManager,
|
|
8189
8219
|
Fe as ThemePreset,
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8220
|
+
Ar as ThemeService,
|
|
8221
|
+
gr as UploadDocumentService,
|
|
8222
|
+
Sn as UploadDocumentStep,
|
|
8223
|
+
nr as UserType,
|
|
8224
|
+
qe as ValueDataType,
|
|
8225
|
+
Dr as WorkflowOrchestrator,
|
|
8196
8226
|
gt as WorkflowResultType,
|
|
8197
|
-
|
|
8227
|
+
Pr as WorkflowState,
|
|
8198
8228
|
ce as WorkflowStepAction,
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8229
|
+
pa as appropriatenessTestSchema,
|
|
8230
|
+
na as clearAllStorage,
|
|
8231
|
+
Yr as clearApplicantId,
|
|
8232
|
+
Gr as clearWorkflowState,
|
|
8203
8233
|
Ae as cn,
|
|
8204
|
-
|
|
8205
|
-
|
|
8234
|
+
Cr as corporateTheme,
|
|
8235
|
+
pr as defaultConfig,
|
|
8206
8236
|
Le as defaultTheme,
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8237
|
+
Kr as fileToBase64,
|
|
8238
|
+
Nr as fintechTheme,
|
|
8239
|
+
vt as formatFileSize,
|
|
8240
|
+
ua as generateAppropriatenessSchema,
|
|
8241
|
+
la as generateQuestionnaireSchema,
|
|
8242
|
+
da as generateRiskScoringSchema,
|
|
8243
|
+
ca as generateUploadDocumentSchema,
|
|
8244
|
+
ta as getAcceptString,
|
|
8245
|
+
Vr as getApplicantId,
|
|
8246
|
+
pt as getThemePreset,
|
|
8247
|
+
ra as getWorkflowState,
|
|
8248
|
+
Ir as healthcareTheme,
|
|
8249
|
+
Gn as isScriptLoaded,
|
|
8250
|
+
zt as loadScript,
|
|
8251
|
+
Er as minimalTheme,
|
|
8252
|
+
Rr as modernTheme,
|
|
8253
|
+
Jn as removeScript,
|
|
8254
|
+
qr as saveApplicantId,
|
|
8255
|
+
Qr as saveWorkflowState,
|
|
8256
|
+
Fr as themePresets,
|
|
8257
|
+
Bt as useApplicant,
|
|
8258
|
+
aa as useAppropriatenessTest,
|
|
8259
|
+
tn as useIdentityVerification,
|
|
8260
|
+
Jr as useKycWorkflow,
|
|
8231
8261
|
Te as useMetaKYC,
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8262
|
+
en as useOverview,
|
|
8263
|
+
Zr as useQuestionnaire,
|
|
8264
|
+
rn as useRiskScoring,
|
|
8265
|
+
Xr as useUploadDocument,
|
|
8266
|
+
Xn as validateFileSize,
|
|
8267
|
+
ea as validateFileType
|
|
8238
8268
|
};
|
|
8239
8269
|
//# sourceMappingURL=index.js.map
|